From 04ef762b63af3bb92b0702e31bed3ea73ad6d8b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgardo=20Obreg=C3=B3n?= Date: Mon, 29 Dec 2025 07:13:02 -0500 Subject: [PATCH 1/3] build: fix docker volume issue, add entrypoint --- DOCKER_USAGE.md | 96 +- Dockerfile | 16 +- README.md | 130 +- docker-entrypoint.sh | 46 + dumps/store_1_20251229_115627.sql | 127 + dumps/store_1_20251229_121147.sql | 56555 ++++++++++++++++++++++++++++ src/pgslice/cli.py | 46 +- 7 files changed, 56954 insertions(+), 62 deletions(-) create mode 100755 docker-entrypoint.sh create mode 100644 dumps/store_1_20251229_115627.sql create mode 100644 dumps/store_1_20251229_121147.sql diff --git a/DOCKER_USAGE.md b/DOCKER_USAGE.md index 984462a..47799da 100644 --- a/DOCKER_USAGE.md +++ b/DOCKER_USAGE.md @@ -39,6 +39,44 @@ docker run --rm -it \ edraobdu/pgslice:latest \ pgslice --host your.db.host --port 5432 --user your_user --database your_db ``` + +### Connecting to Localhost Database + +When your PostgreSQL database is running on your host machine (localhost), the container cannot access it using `localhost` or `127.0.0.1` because these refer to the container itself, not your host. + +**Solution 1: Use host networking (Linux, simplest)** +```bash +docker run --rm -it \ + --network host \ + -v $(pwd)/dumps:/home/pgslice/.pgslice/dumps \ + -e PGPASSWORD=your_password \ + edraobdu/pgslice:latest \ + pgslice --host localhost --port 5432 --user your_user --database your_db +``` + +**Solution 2: Use host.docker.internal (Mac/Windows)** +```bash +docker run --rm -it \ + -v $(pwd)/dumps:/home/pgslice/.pgslice/dumps \ + -e PGPASSWORD=your_password \ + edraobdu/pgslice:latest \ + pgslice --host host.docker.internal --port 5432 --user your_user --database your_db +``` + +**Solution 3: Use Docker bridge IP (Linux alternative)** +```bash +# Find your host's Docker bridge IP (usually 172.17.0.1) +docker run --rm -it \ + -v $(pwd)/dumps:/home/pgslice/.pgslice/dumps \ + -e PGPASSWORD=your_password \ + edraobdu/pgslice:latest \ + pgslice --host 172.17.0.1 --port 5432 --user your_user --database your_db +``` + +**Note:** Make sure your PostgreSQL is configured to accept connections from Docker containers: +- Edit `postgresql.conf`: Set `listen_addresses = '*'` or `listen_addresses = '0.0.0.0'` +- Edit `pg_hba.conf`: Add entry like `host all all 172.17.0.0/16 md5` (for Docker bridge network) + ### Using Environment File Create a `.env` file: @@ -86,7 +124,63 @@ Mount a local directory to persist SQL dumps: -v $(pwd)/dumps:/home/pgslice/.pgslice/dumps ``` -**Important:** The dumps directory is created inside the container with non-root user permissions (UID 1000). +#### Volume Permissions + +The container runs as non-root user `pgslice` (UID 1000) for security. When mounting local directories: + +**The entrypoint script automatically handles permissions** by: +1. Detecting mounted volumes +2. Fixing ownership to UID 1000 if needed +3. Providing helpful error messages if permissions can't be fixed + +**If you encounter permission errors:** + +**Option 1: Pre-fix permissions on host (recommended)** +```bash +# Create dumps directory and set ownership +mkdir -p dumps +sudo chown -R 1000:1000 dumps + +# Run container +docker run --rm -it \ + -v $(pwd)/dumps:/home/pgslice/.pgslice/dumps \ + edraobdu/pgslice:latest pgslice +``` + +**Option 2: Run as your user ID** +```bash +# Run container as your user (bypasses UID 1000) +docker run --rm -it \ + -v $(pwd)/dumps:/home/pgslice/.pgslice/dumps \ + --user $(id -u):$(id -g) \ + edraobdu/pgslice:latest pgslice +``` + +**Why UID 1000?** +- Common default UID for first user on Linux systems +- Matches most developer workstations +- If your user is different, use `--user $(id -u):$(id -g)` flag + +### Remote Server Workflow + +When running pgslice on a remote server, dumps are created as files with visible progress: + +```bash +# SSH into remote server and run dump +ssh user@remote-server "docker run --rm \ + -v /tmp/dumps:/home/pgslice/.pgslice/dumps \ + --env-file .env \ + edraobdu/pgslice:latest \ + pgslice --dump users --pks 42" + +# Copy the generated file to your local machine +scp user@remote-server:/tmp/dumps/public_users_42_*.sql ./local_dumps/ + +# Or use rsync for better performance with large files +rsync -avz user@remote-server:/tmp/dumps/public_users_42_*.sql ./local_dumps/ +``` + +Progress bars are visible during the dump, and the file is ready to transfer when complete. ## Links diff --git a/Dockerfile b/Dockerfile index 5c7c025..4c03ccf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ FROM python:3.13-alpine COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv # Install system dependencies -RUN apk add --no-cache postgresql-client +RUN apk add --no-cache postgresql-client su-exec # Install the project into `/app` WORKDIR /app @@ -31,6 +31,9 @@ COPY . /app RUN --mount=type=cache,target=/root/.cache/uv \ uv pip install --no-deps -e . +# Copy entrypoint script (must be done as root before USER directive) +COPY --chmod=755 docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh + # Set environment variables ENV PYTHONUNBUFFERED=1 @@ -39,14 +42,13 @@ RUN adduser -D -u 1000 pgslice && \ mkdir -p /home/pgslice/.cache/pgslice /home/pgslice/.pgslice/dumps && \ chown -R pgslice:pgslice /app /home/pgslice -# Switch to non-root user -USER pgslice - # Update cache directory to use pgslice's home ENV PGSLICE_CACHE_DIR=/home/pgslice/.cache/pgslice -# Reset the entrypoint, don't invoke `uv` -ENTRYPOINT [] +# Note: Container runs as root, entrypoint will drop to pgslice user after fixing permissions + +# Use custom entrypoint to fix permissions +ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] -# Default command +# Default command (passed to entrypoint) CMD ["pgslice", "--help"] diff --git a/README.md b/README.md index e386d72..bcbf5c1 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Extract only what you need while maintaining referential integrity. ## Features -- ✅ **CLI-first design**: Stream SQL to stdout for easy piping and scripting +- ✅ **CLI-first design**: Dumps always saved to files with visible progress (matches REPL behavior) - ✅ **Bidirectional FK traversal**: Follows relationships in both directions (forward and reverse) - ✅ **Circular relationship handling**: Prevents infinite loops with visited tracking - ✅ **Multiple records**: Extract multiple records in one operation @@ -79,6 +79,65 @@ docker pull edraobdu/pgslice:0.1.1 docker pull --platform linux/amd64 edraobdu/pgslice:latest ``` +#### Connecting to Localhost Database + +When your PostgreSQL database runs on your host machine, use `--network host` (Linux) or `host.docker.internal` (Mac/Windows): + +```bash +# Linux: Use host networking +docker run --rm -it \ + --network host \ + -v $(pwd)/dumps:/home/pgslice/.pgslice/dumps \ + -e PGPASSWORD=your_password \ + edraobdu/pgslice:latest \ + pgslice --host localhost --database your_db --dump users --pks 42 + +# Mac/Windows: Use special hostname +docker run --rm -it \ + -v $(pwd)/dumps:/home/pgslice/.pgslice/dumps \ + -e PGPASSWORD=your_password \ + edraobdu/pgslice:latest \ + pgslice --host host.docker.internal --database your_db --dump users --pks 42 +``` + +See [DOCKER_USAGE.md](DOCKER_USAGE.md#connecting-to-localhost-database) for more connection options. + +#### Docker Volume Permissions + +The pgslice container runs as user `pgslice` (UID 1000) for security. When mounting local directories as volumes, you may encounter permission issues. + +**The entrypoint script automatically fixes permissions** on mounted volumes. However, if you still encounter issues: + +```bash +# Fix permissions on host before mounting +sudo chown -R 1000:1000 ./dumps + +# Then run normally +docker run --rm -it \ + -v $(pwd)/dumps:/home/pgslice/.pgslice/dumps \ + edraobdu/pgslice:latest \ + pgslice --host your.db.host --database your_db --dump users --pks 42 +``` + +**Alternative:** Run container as your user: +```bash +docker run --rm -it \ + -v $(pwd)/dumps:/home/pgslice/.pgslice/dumps \ + --user $(id -u):$(id -g) \ + edraobdu/pgslice:latest \ + pgslice --host your.db.host --database your_db --dump users --pks 42 +``` + +**For remote servers:** +```bash +# Run dump on remote server +ssh user@remote-server "docker run --rm -v /tmp/dumps:/home/pgslice/.pgslice/dumps \ + edraobdu/pgslice:latest pgslice --dump users --pks 42" + +# Copy file locally +scp user@remote-server:/tmp/dumps/users_42_*.sql ./ +``` + ### From Source (Development) See [DEVELOPMENT.md](DEVELOPMENT.md) for detailed development setup instructions. @@ -87,40 +146,40 @@ See [DEVELOPMENT.md](DEVELOPMENT.md) for detailed development setup instructions ### CLI Mode -The CLI mode streams SQL to stdout by default, making it easy to pipe or redirect output: +Dumps are always saved to files with visible progress indicators (helpful for large datasets): ```bash -# Basic dump to stdout (pipe to file) -PGPASSWORD=xxx pgslice --host localhost --database mydb --table users --pks 42 > user_42.sql +# Basic dump (auto-generates filename like: public_users_42_TIMESTAMP.sql) +PGPASSWORD=xxx pgslice --host localhost --database mydb --dump users --pks 42 # Multiple records -PGPASSWORD=xxx pgslice --host localhost --database mydb --table users --pks 1,2,3 > users.sql +PGPASSWORD=xxx pgslice --host localhost --database mydb --dump users --pks 1,2,3 -# Output directly to file with --output flag -pgslice --host localhost --database mydb --table users --pks 42 --output user_42.sql +# Specify output file path +pgslice --host localhost --database mydb --dump users --pks 42 --output user_42.sql # Dump by timeframe (instead of PKs) - filters main table by date range -pgslice --host localhost --database mydb --table orders \ - --timeframe "created_at:2024-01-01:2024-12-31" > orders_2024.sql +pgslice --host localhost --database mydb --dump orders \ + --timeframe "created_at:2024-01-01:2024-12-31" --output orders_2024.sql # Wide mode: follow all relationships including self-referencing FKs # Be cautious - this can result in larger datasets -pgslice --host localhost --database mydb --table customer --pks 42 --wide > customer.sql +pgslice --host localhost --database mydb --dump customer --pks 42 --wide # Keep original primary keys (no remapping) -pgslice --host localhost --database mydb --table film --pks 1 --keep-pks > film.sql +pgslice --host localhost --database mydb --dump film --pks 1 --keep-pks # Generate self-contained SQL with DDL statements # Includes CREATE DATABASE/SCHEMA/TABLE statements -pgslice --host localhost --database mydb --table film --pks 1 --create-schema > film_complete.sql +pgslice --host localhost --database mydb --dump film --pks 1 --create-schema # Apply truncate filter to limit related tables by date range -pgslice --host localhost --database mydb --table customer --pks 42 \ - --truncate "rental:rental_date:2024-01-01:2024-12-31" > customer.sql +pgslice --host localhost --database mydb --dump customer --pks 42 \ + --truncate "rental:rental_date:2024-01-01:2024-12-31" # Enable debug logging (writes to stderr) -pgslice --host localhost --database mydb --table users --pks 42 \ - --log-level DEBUG 2>debug.log > output.sql +pgslice --host localhost --database mydb --dump users --pks 42 \ + --log-level DEBUG 2>debug.log ``` ### Schema Exploration @@ -140,12 +199,12 @@ Run pgslice on a remote server and capture output locally: ```bash # Execute on remote server, save output locally ssh remote.server.com "PGPASSWORD=xxx pgslice --host db.internal --database mydb \ - --table users --pks 1 --create-schema" > local_dump.sql + --dump users --pks 1 --create-schema" > local_dump.sql # With SSH tunnel for database access ssh -f -N -L 5433:db.internal:5432 bastion.example.com PGPASSWORD=xxx pgslice --host localhost --port 5433 --database mydb \ - --table users --pks 42 > user.sql + --dump users --pks 42 > user.sql ``` ### Interactive REPL @@ -163,43 +222,42 @@ pgslice> describe "film" Understanding the difference between CLI and REPL modes: -### CLI Mode (stdout by default) -The CLI streams SQL to **stdout** by default, perfect for piping and scripting: +### CLI Mode (files with progress) +The CLI writes to files and shows progress bars (helpful for large datasets): ```bash -# Streams to stdout - redirect with > -pgslice --table users --pks 42 > user_42.sql +# Writes to ~/.pgslice/dumps/public_users_42_TIMESTAMP.sql +pgslice --dump users --pks 42 -# Or use --output flag -pgslice --table users --pks 42 --output user_42.sql - -# Pipe to other commands -pgslice --table users --pks 42 | gzip > user_42.sql.gz +# Specify output file +pgslice --dump users --pks 42 --output user_42.sql ``` -### REPL Mode (files by default) -The REPL writes to **`~/.pgslice/dumps/`** by default when `--output` is not specified: +### REPL Mode (same behavior) +The REPL also writes to **`~/.pgslice/dumps/`** by default: ```bash -# In REPL: writes to ~/.pgslice/dumps/public_users_42.sql +# Writes to ~/.pgslice/dumps/public_users_42_TIMESTAMP.sql pgslice> dump "users" 42 # Specify custom output path pgslice> dump "users" 42 --output /path/to/user.sql ``` +Both modes now behave identically - always writing to files with visible progress. + ### Same Operations, Different Modes | Operation | CLI | REPL | |-----------|-----|------| | **List tables** | `pgslice --tables` | `pgslice> tables` | | **Describe table** | `pgslice --describe users` | `pgslice> describe "users"` | -| **Dump to stdout** | `pgslice --table users --pks 42` | N/A (REPL always writes to file) | -| **Dump to file** | `pgslice --table users --pks 42 --output user.sql` | `pgslice> dump "users" 42 --output user.sql` | -| **Dump (default)** | Stdout | `~/.pgslice/dumps/public_users_42.sql` | -| **Multiple PKs** | `pgslice --table users --pks 1,2,3` | `pgslice> dump "users" 1,2,3` | -| **Truncate filter** | `pgslice --table users --pks 42 --truncate "orders:2024-01-01:2024-12-31"` | `pgslice> dump "users" 42 --truncate "orders:2024-01-01:2024-12-31"` | -| **Wide mode** | `pgslice --table users --pks 42 --wide` | `pgslice> dump "users" 42 --wide` | +| **Dump (auto-named)** | `pgslice --dump users --pks 42` | `pgslice> dump "users" 42` | +| **Dump to file** | `pgslice --dump users --pks 42 --output user.sql` | `pgslice> dump "users" 42 --output user.sql` | +| **Dump (default path)** | `~/.pgslice/dumps/public_users_42_TIMESTAMP.sql` | `~/.pgslice/dumps/public_users_42_TIMESTAMP.sql` | +| **Multiple PKs** | `pgslice --dump users --pks 1,2,3` | `pgslice> dump "users" 1,2,3` | +| **Truncate filter** | `pgslice --dump users --pks 42 --truncate "orders:2024-01-01:2024-12-31"` | `pgslice> dump "users" 42 --truncate "orders:2024-01-01:2024-12-31"` | +| **Wide mode** | `pgslice --dump users --pks 42 --wide` | `pgslice> dump "users" 42 --wide` | ### When to Use Each Mode diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh new file mode 100755 index 0000000..4e39970 --- /dev/null +++ b/docker-entrypoint.sh @@ -0,0 +1,46 @@ +#!/bin/sh +set -e + +# Docker entrypoint for pgslice +# Fixes permissions on mounted volumes to allow UID 1000 (pgslice user) to write + +DUMPS_DIR="/home/pgslice/.pgslice/dumps" +CACHE_DIR="/home/pgslice/.cache/pgslice" + +# Function to check if directory is writable +is_writable() { + su-exec pgslice test -w "$1" 2>/dev/null +} + +# Function to fix permissions if needed +fix_permissions() { + local dir="$1" + + # Only fix if directory exists and is not writable by pgslice user + if [ -d "$dir" ] && ! is_writable "$dir"; then + echo "Fixing permissions on $dir..." + # Change ownership to pgslice:pgslice (UID:GID 1000:1000) + chown -R pgslice:pgslice "$dir" 2>/dev/null || { + echo "Warning: Could not fix permissions on $dir. Volume may be read-only or owned by different user." + echo "To fix: Run 'sudo chown -R 1000:1000 ./dumps' on host before mounting." + } + fi +} + +# Fix permissions on dumps directory if mounted +if [ -d "$DUMPS_DIR" ]; then + fix_permissions "$DUMPS_DIR" +fi + +# Fix permissions on cache directory if mounted +if [ -d "$CACHE_DIR" ]; then + fix_permissions "$CACHE_DIR" +fi + +# If no command provided, show help +if [ $# -eq 0 ]; then + exec su-exec pgslice pgslice --help +fi + +# Execute command as pgslice user +exec su-exec pgslice "$@" diff --git a/dumps/store_1_20251229_115627.sql b/dumps/store_1_20251229_115627.sql new file mode 100644 index 0000000..b2f2b44 --- /dev/null +++ b/dumps/store_1_20251229_115627.sql @@ -0,0 +1,127 @@ +-- Generated by pgslice +-- Date: 2025-12-29T11:56:27.238674 +-- Records: 6 +-- Mode: PL/pgSQL with ID remapping + +-- Create temporary table for ID mapping +CREATE TEMP TABLE IF NOT EXISTS _pgslice_id_map ( + table_name TEXT NOT NULL, + old_id TEXT NOT NULL, + new_id TEXT NOT NULL, + PRIMARY KEY (table_name, old_id) +); + +-- Main PL/pgSQL block with ID remapping +DO $$ +DECLARE + v_new_id_staff integer; + v_new_ids_staff integer[]; + v_old_ids_staff TEXT[]; + v_new_id_country integer; + v_new_ids_country integer[]; + v_old_ids_country TEXT[]; + v_new_id_city integer; + v_new_ids_city integer[]; + v_old_ids_city TEXT[]; + v_new_id_store integer; + v_new_ids_store integer[]; + v_old_ids_store TEXT[]; + v_new_id_address integer; + v_new_ids_address integer[]; + v_old_ids_address TEXT[]; + i INTEGER; +BEGIN + + -- Table: "public"."country" (1 records) + INSERT INTO "public"."country" ("country", "last_update") + VALUES + ('Canada', '2006-02-15T09:44:00') + RETURNING country_id INTO v_new_id_country; + INSERT INTO _pgslice_id_map VALUES ('"public"."country"', '20', v_new_id_country::TEXT); + + -- Table: "public"."city" (1 records) + INSERT INTO "public"."city" ("city", "country_id", "last_update") + SELECT + data.city::character varying, + map0.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('Lethbridge', '20', '2006-02-15T09:45:25') + ) AS data(city, old_country_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."country"' + AND map0.old_id = data.old_country_id + RETURNING city_id INTO v_new_id_city; + INSERT INTO _pgslice_id_map VALUES ('"public"."city"', '300', v_new_id_city::TEXT); + + -- Table: "public"."address" (2 records) + v_old_ids_address := ARRAY['1', '3']; + WITH inserted AS ( + INSERT INTO "public"."address" ("address", "address2", "city_id", "district", "last_update", "phone", "postal_code") + SELECT + data.address::character varying, + data.address2::character varying, + map0.new_id::smallint, + data.district::character varying, + data.last_update::timestamp without time zone, + data.phone::character varying, + data.postal_code::character varying + FROM (VALUES + ('47 MySakila Drive', NULL, '300', 'Alberta', '2006-02-15T09:45:30', '', ''), + ('23 Workhaven Lane', NULL, '300', 'Alberta', '2006-02-15T09:45:30', '14033335568', '') + ) AS data(address, address2, old_city_id, district, last_update, phone, postal_code) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."city"' + AND map0.old_id = data.old_city_id + RETURNING address_id + ) + SELECT array_agg(address_id) INTO v_new_ids_address FROM inserted; + + FOR i IN 1..array_length(v_new_ids_address, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."address"', v_old_ids_address[i], v_new_ids_address[i]::TEXT); + END LOOP; + + -- Table: "public"."staff" (1 records) + INSERT INTO "public"."staff" ("active", "address_id", "email", "first_name", "last_name", "last_update", "password", "picture", "store_id", "username") + SELECT + data.active::boolean, + map0.new_id::smallint, + data.email::character varying, + data.first_name::character varying, + data.last_name::character varying, + data.last_update::timestamp without time zone, + data.password::character varying, + data.picture::bytea, + data.store_id::smallint, + data.username::character varying + FROM (VALUES + (TRUE, '3', 'Mike.Hillyer@sakilastaff.com', 'Mike', 'Hillyer', '2006-05-16T16:13:11.793280', '8cb2237d0679ca88db6464eac60da96345513964', '\x89504e470d0a5a0a', 1, 'Mike') + ) AS data(active, old_address_id, email, first_name, last_name, last_update, password, picture, store_id, username) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."address"' + AND map0.old_id = data.old_address_id + RETURNING staff_id INTO v_new_id_staff; + INSERT INTO _pgslice_id_map VALUES ('"public"."staff"', '1', v_new_id_staff::TEXT); + + -- Table: "public"."store" (1 records) + INSERT INTO "public"."store" ("address_id", "last_update", "manager_staff_id") + SELECT + map0.new_id::smallint, + data.last_update::timestamp without time zone, + map1.new_id::smallint + FROM (VALUES + ('1', '2006-02-15T09:57:12', '1') + ) AS data(old_address_id, last_update, old_manager_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."address"' + AND map0.old_id = data.old_address_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."staff"' + AND map1.old_id = data.old_manager_staff_id + RETURNING store_id INTO v_new_id_store; + INSERT INTO _pgslice_id_map VALUES ('"public"."store"', '1', v_new_id_store::TEXT); + +END $$; + +-- Cleanup +DROP TABLE IF EXISTS _pgslice_id_map; diff --git a/dumps/store_1_20251229_121147.sql b/dumps/store_1_20251229_121147.sql new file mode 100644 index 0000000..e82268c --- /dev/null +++ b/dumps/store_1_20251229_121147.sql @@ -0,0 +1,56555 @@ +-- NOTE: PostgreSQL does not support 'CREATE DATABASE IF NOT EXISTS'. +-- If the database already exists, comment out the line below or it will fail. +-- For a new database: Uncomment the following line +-- CREATE DATABASE "dvdrental"; + +-- Connect to the database before creating schemas/tables. +-- For psql: Use the \c command below +-- For other clients: Disconnect and reconnect to the database manually +\c "dvdrental" + +CREATE SCHEMA IF NOT EXISTS "public"; + +CREATE TABLE IF NOT EXISTS "public"."customer" ( + "customer_id" INTEGER NOT NULL, + "store_id" SMALLINT NOT NULL, + "first_name" TEXT NOT NULL, + "last_name" TEXT NOT NULL, + "email" TEXT, + "address_id" SMALLINT NOT NULL, + "activebool" BOOLEAN NOT NULL DEFAULT true, + "create_date" DATE NOT NULL DEFAULT ('now'::text)::date, + "last_update" TIMESTAMP DEFAULT now(), + "active" INTEGER +); +CREATE TABLE IF NOT EXISTS "public"."city" ( + "city_id" INTEGER NOT NULL, + "city" TEXT NOT NULL, + "country_id" SMALLINT NOT NULL, + "last_update" TIMESTAMP NOT NULL DEFAULT now() +); +CREATE TABLE IF NOT EXISTS "public"."inventory" ( + "inventory_id" INTEGER NOT NULL, + "film_id" SMALLINT NOT NULL, + "store_id" SMALLINT NOT NULL, + "last_update" TIMESTAMP NOT NULL DEFAULT now() +); +CREATE TABLE IF NOT EXISTS "public"."address" ( + "address_id" INTEGER NOT NULL, + "address" TEXT NOT NULL, + "address2" TEXT, + "district" TEXT NOT NULL, + "city_id" SMALLINT NOT NULL, + "postal_code" TEXT, + "phone" TEXT NOT NULL, + "last_update" TIMESTAMP NOT NULL DEFAULT now() +); +CREATE TABLE IF NOT EXISTS "public"."category" ( + "category_id" INTEGER NOT NULL, + "name" TEXT NOT NULL, + "last_update" TIMESTAMP NOT NULL DEFAULT now() +); +CREATE TABLE IF NOT EXISTS "public"."film_actor" ( + "actor_id" SMALLINT NOT NULL PRIMARY KEY, + "film_id" SMALLINT NOT NULL PRIMARY KEY, + "last_update" TIMESTAMP NOT NULL DEFAULT now(), + PRIMARY KEY ("actor_id", "film_id") +); +CREATE TABLE IF NOT EXISTS "public"."country" ( + "country_id" INTEGER NOT NULL, + "country" TEXT NOT NULL, + "last_update" TIMESTAMP NOT NULL DEFAULT now() +); +CREATE TABLE IF NOT EXISTS "public"."actor" ( + "actor_id" INTEGER NOT NULL, + "first_name" TEXT NOT NULL, + "last_name" TEXT NOT NULL, + "last_update" TIMESTAMP NOT NULL DEFAULT now() +); +CREATE TABLE IF NOT EXISTS "public"."film_category" ( + "film_id" SMALLINT NOT NULL PRIMARY KEY, + "category_id" SMALLINT NOT NULL PRIMARY KEY, + "last_update" TIMESTAMP NOT NULL DEFAULT now(), + PRIMARY KEY ("film_id", "category_id") +); +CREATE TABLE IF NOT EXISTS "public"."payment" ( + "payment_id" INTEGER NOT NULL, + "customer_id" SMALLINT NOT NULL, + "staff_id" SMALLINT NOT NULL, + "rental_id" INTEGER NOT NULL, + "amount" NUMERIC NOT NULL, + "payment_date" TIMESTAMP NOT NULL +); +CREATE TABLE IF NOT EXISTS "public"."language" ( + "language_id" INTEGER NOT NULL, + "name" CHAR NOT NULL, + "last_update" TIMESTAMP NOT NULL DEFAULT now() +); +CREATE TABLE IF NOT EXISTS "public"."store" ( + "store_id" INTEGER NOT NULL, + "manager_staff_id" SMALLINT NOT NULL, + "address_id" SMALLINT NOT NULL, + "last_update" TIMESTAMP NOT NULL DEFAULT now() +); +CREATE TABLE IF NOT EXISTS "public"."staff" ( + "staff_id" INTEGER NOT NULL, + "first_name" TEXT NOT NULL, + "last_name" TEXT NOT NULL, + "address_id" SMALLINT NOT NULL, + "email" TEXT, + "store_id" SMALLINT NOT NULL, + "active" BOOLEAN NOT NULL DEFAULT true, + "username" TEXT NOT NULL, + "password" TEXT, + "last_update" TIMESTAMP NOT NULL DEFAULT now(), + "picture" BYTEA +); +CREATE TABLE IF NOT EXISTS "public"."film" ( + "film_id" INTEGER NOT NULL, + "title" TEXT NOT NULL, + "description" TEXT, + "release_year" INTEGER, + "language_id" SMALLINT NOT NULL, + "rental_duration" SMALLINT NOT NULL DEFAULT 3, + "rental_rate" NUMERIC NOT NULL DEFAULT 4.99, + "length" SMALLINT, + "replacement_cost" NUMERIC NOT NULL DEFAULT 19.99, + "rating" mpaa_rating DEFAULT 'G'::mpaa_rating, + "last_update" TIMESTAMP NOT NULL DEFAULT now(), + "special_features" TEXT[], + "fulltext" TSVECTOR NOT NULL +); +CREATE TABLE IF NOT EXISTS "public"."rental" ( + "rental_id" INTEGER NOT NULL, + "rental_date" TIMESTAMP NOT NULL, + "inventory_id" INTEGER NOT NULL, + "customer_id" SMALLINT NOT NULL, + "return_date" TIMESTAMP, + "staff_id" SMALLINT NOT NULL, + "last_update" TIMESTAMP NOT NULL DEFAULT now() +); + +-- Add foreign key constraints +ALTER TABLE "public"."customer" + ADD CONSTRAINT "customer_address_id_fkey" + FOREIGN KEY ("address_id") + REFERENCES "public"."public.address"("address_id") + ON DELETE RESTRICT; +ALTER TABLE "public"."city" + ADD CONSTRAINT "fk_city" + FOREIGN KEY ("country_id") + REFERENCES "public"."public.country"("country_id"); +ALTER TABLE "public"."inventory" + ADD CONSTRAINT "inventory_film_id_fkey" + FOREIGN KEY ("film_id") + REFERENCES "public"."public.film"("film_id") + ON DELETE RESTRICT; +ALTER TABLE "public"."address" + ADD CONSTRAINT "fk_address_city" + FOREIGN KEY ("city_id") + REFERENCES "public"."public.city"("city_id"); +ALTER TABLE "public"."film_actor" + ADD CONSTRAINT "film_actor_actor_id_fkey" + FOREIGN KEY ("actor_id") + REFERENCES "public"."public.actor"("actor_id") + ON DELETE RESTRICT; + +ALTER TABLE "public"."film_actor" + ADD CONSTRAINT "film_actor_film_id_fkey" + FOREIGN KEY ("film_id") + REFERENCES "public"."public.film"("film_id") + ON DELETE RESTRICT; +ALTER TABLE "public"."film_category" + ADD CONSTRAINT "film_category_category_id_fkey" + FOREIGN KEY ("category_id") + REFERENCES "public"."public.category"("category_id") + ON DELETE RESTRICT; + +ALTER TABLE "public"."film_category" + ADD CONSTRAINT "film_category_film_id_fkey" + FOREIGN KEY ("film_id") + REFERENCES "public"."public.film"("film_id") + ON DELETE RESTRICT; +ALTER TABLE "public"."payment" + ADD CONSTRAINT "payment_customer_id_fkey" + FOREIGN KEY ("customer_id") + REFERENCES "public"."public.customer"("customer_id") + ON DELETE RESTRICT; + +ALTER TABLE "public"."payment" + ADD CONSTRAINT "payment_rental_id_fkey" + FOREIGN KEY ("rental_id") + REFERENCES "public"."public.rental"("rental_id") + ON DELETE SET NULL; + +ALTER TABLE "public"."payment" + ADD CONSTRAINT "payment_staff_id_fkey" + FOREIGN KEY ("staff_id") + REFERENCES "public"."public.staff"("staff_id") + ON DELETE RESTRICT; +ALTER TABLE "public"."store" + ADD CONSTRAINT "store_address_id_fkey" + FOREIGN KEY ("address_id") + REFERENCES "public"."public.address"("address_id") + ON DELETE RESTRICT; + +ALTER TABLE "public"."store" + ADD CONSTRAINT "store_manager_staff_id_fkey" + FOREIGN KEY ("manager_staff_id") + REFERENCES "public"."public.staff"("staff_id") + ON DELETE RESTRICT; +ALTER TABLE "public"."staff" + ADD CONSTRAINT "staff_address_id_fkey" + FOREIGN KEY ("address_id") + REFERENCES "public"."public.address"("address_id") + ON DELETE RESTRICT; +ALTER TABLE "public"."film" + ADD CONSTRAINT "film_language_id_fkey" + FOREIGN KEY ("language_id") + REFERENCES "public"."public.language"("language_id") + ON DELETE RESTRICT; +ALTER TABLE "public"."rental" + ADD CONSTRAINT "rental_customer_id_fkey" + FOREIGN KEY ("customer_id") + REFERENCES "public"."public.customer"("customer_id") + ON DELETE RESTRICT; + +ALTER TABLE "public"."rental" + ADD CONSTRAINT "rental_inventory_id_fkey" + FOREIGN KEY ("inventory_id") + REFERENCES "public"."public.inventory"("inventory_id") + ON DELETE RESTRICT; + +ALTER TABLE "public"."rental" + ADD CONSTRAINT "rental_staff_id_key" + FOREIGN KEY ("staff_id") + REFERENCES "public"."public.staff"("staff_id"); + +-- Generated by pgslice +-- Date: 2025-12-29T12:11:44.092831 +-- Records: 44815 +-- Mode: PL/pgSQL with ID remapping + +-- Create temporary table for ID mapping +CREATE TEMP TABLE IF NOT EXISTS _pgslice_id_map ( + table_name TEXT NOT NULL, + old_id TEXT NOT NULL, + new_id TEXT NOT NULL, + PRIMARY KEY (table_name, old_id) +); + +-- Main PL/pgSQL block with ID remapping +DO $$ +DECLARE + v_new_id_customer integer; + v_new_ids_customer integer[]; + v_old_ids_customer TEXT[]; + v_new_id_city integer; + v_new_ids_city integer[]; + v_old_ids_city TEXT[]; + v_new_id_inventory integer; + v_new_ids_inventory integer[]; + v_old_ids_inventory TEXT[]; + v_new_id_address integer; + v_new_ids_address integer[]; + v_old_ids_address TEXT[]; + v_new_id_category integer; + v_new_ids_category integer[]; + v_old_ids_category TEXT[]; + v_new_id_payment integer; + v_new_ids_payment integer[]; + v_old_ids_payment TEXT[]; + v_new_id_country integer; + v_new_ids_country integer[]; + v_old_ids_country TEXT[]; + v_new_id_actor integer; + v_new_ids_actor integer[]; + v_old_ids_actor TEXT[]; + v_new_id_language integer; + v_new_ids_language integer[]; + v_old_ids_language TEXT[]; + v_new_id_store integer; + v_new_ids_store integer[]; + v_old_ids_store TEXT[]; + v_new_id_staff integer; + v_new_ids_staff integer[]; + v_old_ids_staff TEXT[]; + v_new_id_film integer; + v_new_ids_film integer[]; + v_old_ids_film TEXT[]; + v_new_id_rental integer; + v_new_ids_rental integer[]; + v_old_ids_rental TEXT[]; + i INTEGER; +BEGIN + + -- Table: "public"."category" (16 records) + v_old_ids_category := ARRAY['9', '1', '5', '15', '2', '12', '14', '3', '4', '13', '16', '7', '6', '11', '8', '10']; + WITH inserted AS ( + INSERT INTO "public"."category" ("last_update", "name") + VALUES + ('2006-02-15T09:46:27', 'Foreign'), + ('2006-02-15T09:46:27', 'Action'), + ('2006-02-15T09:46:27', 'Comedy'), + ('2006-02-15T09:46:27', 'Sports'), + ('2006-02-15T09:46:27', 'Animation'), + ('2006-02-15T09:46:27', 'Music'), + ('2006-02-15T09:46:27', 'Sci-Fi'), + ('2006-02-15T09:46:27', 'Children'), + ('2006-02-15T09:46:27', 'Classics'), + ('2006-02-15T09:46:27', 'New'), + ('2006-02-15T09:46:27', 'Travel'), + ('2006-02-15T09:46:27', 'Drama'), + ('2006-02-15T09:46:27', 'Documentary'), + ('2006-02-15T09:46:27', 'Horror'), + ('2006-02-15T09:46:27', 'Family'), + ('2006-02-15T09:46:27', 'Games') + RETURNING category_id + ) + SELECT array_agg(category_id) INTO v_new_ids_category FROM inserted; + + FOR i IN 1..array_length(v_new_ids_category, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."category"', v_old_ids_category[i], v_new_ids_category[i]::TEXT); + END LOOP; + + -- Table: "public"."actor" (200 records) + v_old_ids_actor := ARRAY['103', '145', '133', '68', '199', '113', '190', '119', '28', '38', '42', '107', '84', '172', '117', '40', '51', '167', '18', '56', '10', '159', '109', '178', '123', '194', '59', '20', '142', '9', '135', '160', '146', '48', '94', '164', '23', '161', '39', '83', '11', '50', '157', '44', '1', '189', '98', '8', '106', '200', '49', '195', '70', '148', '36', '155', '5', '79', '125', '95', '64', '99', '89', '134', '188', '25', '67', '198', '131', '163', '76', '129', '116', '15', '151', '2', '86', '80', '52', '63', '12', '130', '182', '14', '100', '45', '175', '75', '33', '105', '132', '170', '140', '126', '144', '71', '139', '158', '168', '193']; + WITH inserted AS ( + INSERT INTO "public"."actor" ("first_name", "last_name", "last_update") + VALUES + ('Matthew', 'Leigh', '2013-05-26T14:47:57.620000'), + ('Kim', 'Allen', '2013-05-26T14:47:57.620000'), + ('Richard', 'Penn', '2013-05-26T14:47:57.620000'), + ('Rip', 'Winslet', '2013-05-26T14:47:57.620000'), + ('Julia', 'Fawcett', '2013-05-26T14:47:57.620000'), + ('Morgan', 'Hopkins', '2013-05-26T14:47:57.620000'), + ('Audrey', 'Bailey', '2013-05-26T14:47:57.620000'), + ('Warren', 'Jackman', '2013-05-26T14:47:57.620000'), + ('Woody', 'Hoffman', '2013-05-26T14:47:57.620000'), + ('Tom', 'Mckellen', '2013-05-26T14:47:57.620000'), + ('Tom', 'Miranda', '2013-05-26T14:47:57.620000'), + ('Gina', 'Degeneres', '2013-05-26T14:47:57.620000'), + ('James', 'Pitt', '2013-05-26T14:47:57.620000'), + ('Groucho', 'Williams', '2013-05-26T14:47:57.620000'), + ('Renee', 'Tracy', '2013-05-26T14:47:57.620000'), + ('Johnny', 'Cage', '2013-05-26T14:47:57.620000'), + ('Gary', 'Phoenix', '2013-05-26T14:47:57.620000'), + ('Laurence', 'Bullock', '2013-05-26T14:47:57.620000'), + ('Dan', 'Torn', '2013-05-26T14:47:57.620000'), + ('Dan', 'Harris', '2013-05-26T14:47:57.620000'), + ('Christian', 'Gable', '2013-05-26T14:47:57.620000'), + ('Laura', 'Brody', '2013-05-26T14:47:57.620000'), + ('Sylvester', 'Dern', '2013-05-26T14:47:57.620000'), + ('Lisa', 'Monroe', '2013-05-26T14:47:57.620000'), + ('Julianne', 'Dench', '2013-05-26T14:47:57.620000'), + ('Meryl', 'Allen', '2013-05-26T14:47:57.620000'), + ('Dustin', 'Tautou', '2013-05-26T14:47:57.620000'), + ('Lucille', 'Tracy', '2013-05-26T14:47:57.620000'), + ('Jada', 'Ryder', '2013-05-26T14:47:57.620000'), + ('Joe', 'Swank', '2013-05-26T14:47:57.620000'), + ('Rita', 'Reynolds', '2013-05-26T14:47:57.620000'), + ('Chris', 'Depp', '2013-05-26T14:47:57.620000'), + ('Albert', 'Johansson', '2013-05-26T14:47:57.620000'), + ('Frances', 'Day-Lewis', '2013-05-26T14:47:57.620000'), + ('Kenneth', 'Torn', '2013-05-26T14:47:57.620000'), + ('Humphrey', 'Willis', '2013-05-26T14:47:57.620000'), + ('Sandra', 'Kilmer', '2013-05-26T14:47:57.620000'), + ('Harvey', 'Hope', '2013-05-26T14:47:57.620000'), + ('Goldie', 'Brody', '2013-05-26T14:47:57.620000'), + ('Ben', 'Willis', '2013-05-26T14:47:57.620000'), + ('Zero', 'Cage', '2013-05-26T14:47:57.620000'), + ('Natalie', 'Hopkins', '2013-05-26T14:47:57.620000'), + ('Greta', 'Malden', '2013-05-26T14:47:57.620000'), + ('Nick', 'Stallone', '2013-05-26T14:47:57.620000'), + ('Penelope', 'Guiness', '2013-05-26T14:47:57.620000'), + ('Cuba', 'Birch', '2013-05-26T14:47:57.620000'), + ('Chris', 'Bridges', '2013-05-26T14:47:57.620000'), + ('Matthew', 'Johansson', '2013-05-26T14:47:57.620000'), + ('Groucho', 'Dunst', '2013-05-26T14:47:57.620000'), + ('Thora', 'Temple', '2013-05-26T14:47:57.620000'), + ('Anne', 'Cronyn', '2013-05-26T14:47:57.620000'), + ('Jayne', 'Silverstone', '2013-05-26T14:47:57.620000'), + ('Michelle', 'Mcconaughey', '2013-05-26T14:47:57.620000'), + ('Emily', 'Dee', '2013-05-26T14:47:57.620000'), + ('Burt', 'Dukakis', '2013-05-26T14:47:57.620000'), + ('Ian', 'Tandy', '2013-05-26T14:47:57.620000'), + ('Johnny', 'Lollobrigida', '2013-05-26T14:47:57.620000'), + ('Mae', 'Hoffman', '2013-05-26T14:47:57.620000'), + ('Albert', 'Nolte', '2013-05-26T14:47:57.620000'), + ('Daryl', 'Wahlberg', '2013-05-26T14:47:57.620000'), + ('Ray', 'Johansson', '2013-05-26T14:47:57.620000'), + ('Jim', 'Mostel', '2013-05-26T14:47:57.620000'), + ('Charlize', 'Dench', '2013-05-26T14:47:57.620000'), + ('Gene', 'Hopkins', '2013-05-26T14:47:57.620000'), + ('Rock', 'Dukakis', '2013-05-26T14:47:57.620000'), + ('Kevin', 'Bloom', '2013-05-26T14:47:57.620000'), + ('Jessica', 'Bailey', '2013-05-26T14:47:57.620000'), + ('Mary', 'Keitel', '2013-05-26T14:47:57.620000'), + ('Jane', 'Jackman', '2013-05-26T14:47:57.620000'), + ('Christopher', 'West', '2013-05-26T14:47:57.620000'), + ('Angelina', 'Astaire', '2013-05-26T14:47:57.620000'), + ('Daryl', 'Crawford', '2013-05-26T14:47:57.620000'), + ('Dan', 'Streep', '2013-05-26T14:47:57.620000'), + ('Cuba', 'Olivier', '2013-05-26T14:47:57.620000'), + ('Geoffrey', 'Heston', '2013-05-26T14:47:57.620000'), + ('Nick', 'Wahlberg', '2013-05-26T14:47:57.620000'), + ('Greg', 'Chaplin', '2013-05-26T14:47:57.620000'), + ('Ralph', 'Cruz', '2013-05-26T14:47:57.620000'), + ('Carmen', 'Hunt', '2013-05-26T14:47:57.620000'), + ('Cameron', 'Wray', '2013-05-26T14:47:57.620000'), + ('Karl', 'Berry', '2013-05-26T14:47:57.620000'), + ('Greta', 'Keitel', '2013-05-26T14:47:57.620000'), + ('Debbie', 'Akroyd', '2013-05-26T14:47:57.620000'), + ('Vivien', 'Bergen', '2013-05-26T14:47:57.620000'), + ('Spencer', 'Depp', '2013-05-26T14:47:57.620000'), + ('Reese', 'Kilmer', '2013-05-26T14:47:57.620000'), + ('William', 'Hackman', '2013-05-26T14:47:57.620000'), + ('Burt', 'Posey', '2013-05-26T14:47:57.620000'), + ('Milla', 'Peck', '2013-05-26T14:47:57.620000'), + ('Sidney', 'Crowe', '2013-05-26T14:47:57.620000'), + ('Adam', 'Hopper', '2013-05-26T14:47:57.620000'), + ('Mena', 'Hopper', '2013-05-26T14:47:57.620000'), + ('Whoopi', 'Hurt', '2013-05-26T14:47:57.620000'), + ('Frances', 'Tomei', '2013-05-26T14:47:57.620000'), + ('Angela', 'Witherspoon', '2013-05-26T14:47:57.620000'), + ('Adam', 'Grant', '2013-05-26T14:47:57.620000'), + ('Ewan', 'Gooding', '2013-05-26T14:47:57.620000'), + ('Vivien', 'Basinger', '2013-05-26T14:47:57.620000'), + ('Will', 'Wilson', '2013-05-26T14:47:57.620000'), + ('Burt', 'Temple', '2013-05-26T14:47:57.620000') + RETURNING actor_id + ) + SELECT array_agg(actor_id) INTO v_new_ids_actor FROM inserted; + + FOR i IN 1..array_length(v_new_ids_actor, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."actor"', v_old_ids_actor[i], v_new_ids_actor[i]::TEXT); + END LOOP; + + v_old_ids_actor := ARRAY['57', '120', '27', '96', '65', '118', '87', '47', '102', '150', '143', '29', '147', '177', '165', '97', '61', '35', '171', '22', '156', '111', '21', '108', '186', '69', '41', '93', '192', '43', '101', '152', '162', '74', '53', '191', '196', '104', '54', '88', '77', '72', '179', '60', '24', '122', '187', '112', '166', '30', '181', '3', '46', '32', '26', '37', '184', '153', '90', '137', '4', '34', '91', '124', '180', '127', '154', '19', '78', '13', '16', '197', '185', '7', '66', '173', '115', '128', '6', '110', '62', '176', '82', '169', '55', '136', '183', '174', '85', '17', '114', '138', '121', '58', '141', '31', '81', '73', '92', '149']; + WITH inserted AS ( + INSERT INTO "public"."actor" ("first_name", "last_name", "last_update") + VALUES + ('Jude', 'Cruise', '2013-05-26T14:47:57.620000'), + ('Penelope', 'Monroe', '2013-05-26T14:47:57.620000'), + ('Julia', 'Mcqueen', '2013-05-26T14:47:57.620000'), + ('Gene', 'Willis', '2013-05-26T14:47:57.620000'), + ('Angela', 'Hudson', '2013-05-26T14:47:57.620000'), + ('Cuba', 'Allen', '2013-05-26T14:47:57.620000'), + ('Spencer', 'Peck', '2013-05-26T14:47:57.620000'), + ('Julia', 'Barrymore', '2013-05-26T14:47:57.620000'), + ('Walter', 'Torn', '2013-05-26T14:47:57.620000'), + ('Jayne', 'Nolte', '2013-05-26T14:47:57.620000'), + ('River', 'Dean', '2013-05-26T14:47:57.620000'), + ('Alec', 'Wayne', '2013-05-26T14:47:57.620000'), + ('Fay', 'Winslet', '2013-05-26T14:47:57.620000'), + ('Gene', 'Mckellen', '2013-05-26T14:47:57.620000'), + ('Al', 'Garland', '2013-05-26T14:47:57.620000'), + ('Meg', 'Hawke', '2013-05-26T14:47:57.620000'), + ('Christian', 'Neeson', '2013-05-26T14:47:57.620000'), + ('Judy', 'Dean', '2013-05-26T14:47:57.620000'), + ('Olympia', 'Pfeiffer', '2013-05-26T14:47:57.620000'), + ('Elvis', 'Marx', '2013-05-26T14:47:57.620000'), + ('Fay', 'Wood', '2013-05-26T14:47:57.620000'), + ('Cameron', 'Zellweger', '2013-05-26T14:47:57.620000'), + ('Kirsten', 'Paltrow', '2013-05-26T14:47:57.620000'), + ('Warren', 'Nolte', '2013-05-26T14:47:57.620000'), + ('Julia', 'Zellweger', '2013-05-26T14:47:57.620000'), + ('Kenneth', 'Paltrow', '2013-05-26T14:47:57.620000'), + ('Jodie', 'Degeneres', '2013-05-26T14:47:57.620000'), + ('Ellen', 'Presley', '2013-05-26T14:47:57.620000'), + ('John', 'Suvari', '2013-05-26T14:47:57.620000'), + ('Kirk', 'Jovovich', '2013-05-26T14:47:57.620000'), + ('Susan', 'Davis', '2013-05-26T14:47:57.620000'), + ('Ben', 'Harris', '2013-05-26T14:47:57.620000'), + ('Oprah', 'Kilmer', '2013-05-26T14:47:57.620000'), + ('Milla', 'Keitel', '2013-05-26T14:47:57.620000'), + ('Mena', 'Temple', '2013-05-26T14:47:57.620000'), + ('Gregory', 'Gooding', '2013-05-26T14:47:57.620000'), + ('Bela', 'Walken', '2013-05-26T14:47:57.620000'), + ('Penelope', 'Cronyn', '2013-05-26T14:47:57.620000'), + ('Penelope', 'Pinkett', '2013-05-26T14:47:57.620000'), + ('Kenneth', 'Pesci', '2013-05-26T14:47:57.620000'), + ('Cary', 'Mcconaughey', '2013-05-26T14:47:57.620000'), + ('Sean', 'Williams', '2013-05-26T14:47:57.620000'), + ('Ed', 'Guiness', '2013-05-26T14:47:57.620000'), + ('Henry', 'Berry', '2013-05-26T14:47:57.620000'), + ('Cameron', 'Streep', '2013-05-26T14:47:57.620000'), + ('Salma', 'Nolte', '2013-05-26T14:47:57.620000'), + ('Renee', 'Ball', '2013-05-26T14:47:57.620000'), + ('Russell', 'Bacall', '2013-05-26T14:47:57.620000'), + ('Nick', 'Degeneres', '2013-05-26T14:47:57.620000'), + ('Sandra', 'Peck', '2013-05-26T14:47:57.620000'), + ('Matthew', 'Carrey', '2013-05-26T14:47:57.620000'), + ('Ed', 'Chase', '2013-05-26T14:47:57.620000'), + ('Parker', 'Goldberg', '2013-05-26T14:47:57.620000'), + ('Tim', 'Hackman', '2013-05-26T14:47:57.620000'), + ('Rip', 'Crawford', '2013-05-26T14:47:57.620000'), + ('Val', 'Bolger', '2013-05-26T14:47:57.620000'), + ('Humphrey', 'Garland', '2013-05-26T14:47:57.620000'), + ('Minnie', 'Kilmer', '2013-05-26T14:47:57.620000'), + ('Sean', 'Guiness', '2013-05-26T14:47:57.620000'), + ('Morgan', 'Williams', '2013-05-26T14:47:57.620000'), + ('Jennifer', 'Davis', '2013-05-26T14:47:57.620000'), + ('Audrey', 'Olivier', '2013-05-26T14:47:57.620000'), + ('Christopher', 'Berry', '2013-05-26T14:47:57.620000'), + ('Scarlett', 'Bening', '2013-05-26T14:47:57.620000'), + ('Jeff', 'Silverstone', '2013-05-26T14:47:57.620000'), + ('Kevin', 'Garland', '2013-05-26T14:47:57.620000'), + ('Meryl', 'Gibson', '2013-05-26T14:47:57.620000'), + ('Bob', 'Fawcett', '2013-05-26T14:47:57.620000'), + ('Groucho', 'Sinatra', '2013-05-26T14:47:57.620000'), + ('Uma', 'Wood', '2013-05-26T14:47:57.620000'), + ('Fred', 'Costner', '2013-05-26T14:47:57.620000'), + ('Reese', 'West', '2013-05-26T14:47:57.620000'), + ('Michael', 'Bolger', '2013-05-26T14:47:57.620000'), + ('Grace', 'Mostel', '2013-05-26T14:47:57.620000'), + ('Mary', 'Tandy', '2013-05-26T14:47:57.620000'), + ('Alan', 'Dreyfuss', '2013-05-26T14:47:57.620000'), + ('Harrison', 'Bale', '2013-05-26T14:47:57.620000'), + ('Cate', 'Mcqueen', '2013-05-26T14:47:57.620000'), + ('Bette', 'Nicholson', '2013-05-26T14:47:57.620000'), + ('Susan', 'Davis', '2013-05-26T14:47:57.620000'), + ('Jayne', 'Neeson', '2013-05-26T14:47:57.620000'), + ('Jon', 'Chase', '2013-05-26T14:47:57.620000'), + ('Woody', 'Jolie', '2013-05-26T14:47:57.620000'), + ('Kenneth', 'Hoffman', '2013-05-26T14:47:57.620000'), + ('Fay', 'Kilmer', '2013-05-26T14:47:57.620000'), + ('Ed', 'Mansfield', '2013-05-26T14:47:57.620000'), + ('Russell', 'Close', '2013-05-26T14:47:57.620000'), + ('Michael', 'Bening', '2013-05-26T14:47:57.620000'), + ('Minnie', 'Zellweger', '2013-05-26T14:47:57.620000'), + ('Helen', 'Voight', '2013-05-26T14:47:57.620000'), + ('Morgan', 'Mcdormand', '2013-05-26T14:47:57.620000'), + ('Lucille', 'Dee', '2013-05-26T14:47:57.620000'), + ('Liza', 'Bergman', '2013-05-26T14:47:57.620000'), + ('Christian', 'Akroyd', '2013-05-26T14:47:57.620000'), + ('Cate', 'Harris', '2013-05-26T14:47:57.620000'), + ('Sissy', 'Sobieski', '2013-05-26T14:47:57.620000'), + ('Scarlett', 'Damon', '2013-05-26T14:47:57.620000'), + ('Gary', 'Penn', '2013-05-26T14:47:57.620000'), + ('Kirsten', 'Akroyd', '2013-05-26T14:47:57.620000'), + ('Russell', 'Temple', '2013-05-26T14:47:57.620000') + RETURNING actor_id + ) + SELECT array_agg(actor_id) INTO v_new_ids_actor FROM inserted; + + FOR i IN 1..array_length(v_new_ids_actor, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."actor"', v_old_ids_actor[i], v_new_ids_actor[i]::TEXT); + END LOOP; + + -- Table: "public"."country" (109 records) + v_old_ids_country := ARRAY['105', '47', '102', '29', '35', '22', '71', '21', '101', '87', '74', '53', '97', '61', '104', '77', '108', '69', '41', '93', '43', '24', '32', '54', '37', '88', '90', '72', '4', '91', '60', '78', '30', '3', '46', '26', '7', '66', '62', '82', '34', '55', '17', '19', '13', '16', '31', '81', '73', '92', '6', '103', '85', '68', '28', '58', '107', '40', '56', '59', '20', '9', '48', '94', '38', '42', '23', '84', '39', '11', '50', '51', '44', '1', '18', '8', '106', '10', '109', '49', '36', '5', '95', '64', '99', '25', '83', '98', '2', '70', '52', '12', '79', '100', '75', '89', '33', '67', '76', '15']; + WITH inserted AS ( + INSERT INTO "public"."country" ("country", "last_update") + VALUES + ('Vietnam', '2006-02-15T09:44:00'), + ('Iraq', '2006-02-15T09:44:00'), + ('United Kingdom', '2006-02-15T09:44:00'), + ('Egypt', '2006-02-15T09:44:00'), + ('French Guiana', '2006-02-15T09:44:00'), + ('Chile', '2006-02-15T09:44:00'), + ('Oman', '2006-02-15T09:44:00'), + ('Chad', '2006-02-15T09:44:00'), + ('United Arab Emirates', '2006-02-15T09:44:00'), + ('Spain', '2006-02-15T09:44:00'), + ('Peru', '2006-02-15T09:44:00'), + ('Kuwait', '2006-02-15T09:44:00'), + ('Turkey', '2006-02-15T09:44:00'), + ('Moldova', '2006-02-15T09:44:00'), + ('Venezuela', '2006-02-15T09:44:00'), + ('Puerto Rico', '2006-02-15T09:44:00'), + ('Yugoslavia', '2006-02-15T09:44:00'), + ('Nigeria', '2006-02-15T09:44:00'), + ('Holy See (Vatican City State)', '2006-02-15T09:44:00'), + ('Tanzania', '2006-02-15T09:44:00'), + ('Hungary', '2006-02-15T09:44:00'), + ('Colombia', '2006-02-15T09:44:00'), + ('Faroe Islands', '2006-02-15T09:44:00'), + ('Latvia', '2006-02-15T09:44:00'), + ('Gambia', '2006-02-15T09:44:00'), + ('Sri Lanka', '2006-02-15T09:44:00'), + ('Sweden', '2006-02-15T09:44:00'), + ('Pakistan', '2006-02-15T09:44:00'), + ('Angola', '2006-02-15T09:44:00'), + ('Switzerland', '2006-02-15T09:44:00'), + ('Mexico', '2006-02-15T09:44:00'), + ('Romania', '2006-02-15T09:44:00'), + ('Estonia', '2006-02-15T09:44:00'), + ('American Samoa', '2006-02-15T09:44:00'), + ('Iran', '2006-02-15T09:44:00'), + ('Czech Republic', '2006-02-15T09:44:00'), + ('Armenia', '2006-02-15T09:44:00'), + ('Nepal', '2006-02-15T09:44:00'), + ('Morocco', '2006-02-15T09:44:00'), + ('Saudi Arabia', '2006-02-15T09:44:00'), + ('France', '2006-02-15T09:44:00'), + ('Liechtenstein', '2006-02-15T09:44:00'), + ('Bulgaria', '2006-02-15T09:44:00'), + ('Cameroon', '2006-02-15T09:44:00'), + ('Belarus', '2006-02-15T09:44:00'), + ('Brunei', '2006-02-15T09:44:00'), + ('Ethiopia', '2006-02-15T09:44:00'), + ('Saint Vincent and the Grenadines', '2006-02-15T09:44:00'), + ('Paraguay', '2006-02-15T09:44:00'), + ('Taiwan', '2006-02-15T09:44:00'), + ('Argentina', '2006-02-15T09:44:00'), + ('United States', '2006-02-15T09:44:00'), + ('South Africa', '2006-02-15T09:44:00'), + ('New Zealand', '2006-02-15T09:44:00'), + ('Ecuador', '2006-02-15T09:44:00'), + ('Malawi', '2006-02-15T09:44:00'), + ('Yemen', '2006-02-15T09:44:00'), + ('Greenland', '2006-02-15T09:44:00'), + ('Lithuania', '2006-02-15T09:44:00'), + ('Malaysia', '2006-02-15T09:44:00'), + ('Canada', '2006-02-15T09:44:00'), + ('Austria', '2006-02-15T09:44:00'), + ('Israel', '2006-02-15T09:44:00'), + ('Thailand', '2006-02-15T09:44:00'), + ('Germany', '2006-02-15T09:44:00'), + ('Hong Kong', '2006-02-15T09:44:00'), + ('China', '2006-02-15T09:44:00'), + ('Slovakia', '2006-02-15T09:44:00'), + ('Greece', '2006-02-15T09:44:00'), + ('Bahrain', '2006-02-15T09:44:00'), + ('Japan', '2006-02-15T09:44:00'), + ('Kazakstan', '2006-02-15T09:44:00'), + ('India', '2006-02-15T09:44:00'), + ('Afghanistan', '2006-02-15T09:44:00'), + ('Cambodia', '2006-02-15T09:44:00'), + ('Australia', '2006-02-15T09:44:00'), + ('Virgin Islands, U.S.', '2006-02-15T09:44:00'), + ('Azerbaijan', '2006-02-15T09:44:00'), + ('Zambia', '2006-02-15T09:44:00'), + ('Italy', '2006-02-15T09:44:00'), + ('French Polynesia', '2006-02-15T09:44:00'), + ('Anguilla', '2006-02-15T09:44:00'), + ('Tonga', '2006-02-15T09:44:00'), + ('Myanmar', '2006-02-15T09:44:00'), + ('Tuvalu', '2006-02-15T09:44:00'), + ('Congo, The Democratic Republic of the', '2006-02-15T09:44:00'), + ('Senegal', '2006-02-15T09:44:00'), + ('Turkmenistan', '2006-02-15T09:44:00'), + ('Algeria', '2006-02-15T09:44:00'), + ('North Korea', '2006-02-15T09:44:00'), + ('Kenya', '2006-02-15T09:44:00'), + ('Bangladesh', '2006-02-15T09:44:00'), + ('Runion', '2006-02-15T09:44:00'), + ('Ukraine', '2006-02-15T09:44:00'), + ('Philippines', '2006-02-15T09:44:00'), + ('Sudan', '2006-02-15T09:44:00'), + ('Finland', '2006-02-15T09:44:00'), + ('Netherlands', '2006-02-15T09:44:00'), + ('Poland', '2006-02-15T09:44:00'), + ('Brazil', '2006-02-15T09:44:00') + RETURNING country_id + ) + SELECT array_agg(country_id) INTO v_new_ids_country FROM inserted; + + FOR i IN 1..array_length(v_new_ids_country, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."country"', v_old_ids_country[i], v_new_ids_country[i]::TEXT); + END LOOP; + + v_old_ids_country := ARRAY['86', '80', '57', '63', '27', '14', '96', '65', '45']; + WITH inserted AS ( + INSERT INTO "public"."country" ("country", "last_update") + VALUES + ('South Korea', '2006-02-15T09:44:00'), + ('Russian Federation', '2006-02-15T09:44:00'), + ('Madagascar', '2006-02-15T09:44:00'), + ('Mozambique', '2006-02-15T09:44:00'), + ('Dominican Republic', '2006-02-15T09:44:00'), + ('Bolivia', '2006-02-15T09:44:00'), + ('Tunisia', '2006-02-15T09:44:00'), + ('Nauru', '2006-02-15T09:44:00'), + ('Indonesia', '2006-02-15T09:44:00') + RETURNING country_id + ) + SELECT array_agg(country_id) INTO v_new_ids_country FROM inserted; + + FOR i IN 1..array_length(v_new_ids_country, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."country"', v_old_ids_country[i], v_new_ids_country[i]::TEXT); + END LOOP; + + -- Table: "public"."language" (1 records) + INSERT INTO "public"."language" ("last_update", "name") + VALUES + ('2006-02-15T10:02:19', 'English ') + RETURNING language_id INTO v_new_id_language; + INSERT INTO _pgslice_id_map VALUES ('"public"."language"', '1', v_new_id_language::TEXT); + + -- Table: "public"."city" (600 records) + v_old_ids_city := ARRAY['201', '366', '571', '194', '359', '100', '344', '589', '500', '496', '88', '312', '149', '494', '495', '337', '79', '216', '465', '421', '476', '105', '428', '127', '27', '329', '444', '363', '3', '470', '12', '181', '1', '388', '146', '459', '503', '214', '99', '305', '233', '180', '58', '281', '266', '222', '538', '142', '50', '529', '384', '557', '482', '504', '163', '5', '115', '561', '326', '102', '55', '132', '562', '373', '411', '32', '368', '280', '488', '252', '389', '390', '374', '152', '381', '69', '141', '220', '218', '217', '596', '121', '593', '513', '347', '512', '405', '487', '147', '170', '480', '96', '545', '137', '303', '54', '230', '321', '324', '375']; + WITH inserted AS ( + INSERT INTO "public"."city" ("city", "country_id", "last_update") + SELECT + data.city::character varying, + map0.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('Hanoi', '105', '2006-02-15T09:45:25'), + ('Nha Trang', '105', '2006-02-15T09:45:25'), + ('Vinh', '105', '2006-02-15T09:45:25'), + ('Haiphong', '105', '2006-02-15T09:45:25'), + ('Nam Dinh', '105', '2006-02-15T09:45:25'), + ('Cam Ranh', '105', '2006-02-15T09:45:25'), + ('Mosul', '47', '2006-02-15T09:45:25'), + ('York', '102', '2006-02-15T09:45:25'), + ('Stockport', '102', '2006-02-15T09:45:25'), + ('Southport', '102', '2006-02-15T09:45:25'), + ('Bradford', '102', '2006-02-15T09:45:25'), + ('London', '102', '2006-02-15T09:45:25'), + ('Dundee', '102', '2006-02-15T09:45:25'), + ('Southampton', '102', '2006-02-15T09:45:25'), + ('Southend-on-Sea', '102', '2006-02-15T09:45:25'), + ('Mit Ghamr', '29', '2006-02-15T09:45:25'), + ('Bilbays', '29', '2006-02-15T09:45:25'), + ('Idfu', '29', '2006-02-15T09:45:25'), + ('Sawhaj', '29', '2006-02-15T09:45:25'), + ('Qalyub', '29', '2006-02-15T09:45:25'), + ('Shubra al-Khayma', '29', '2006-02-15T09:45:25'), + ('Cayenne', '35', '2006-02-15T09:45:25'), + ('Rancagua', '22', '2006-02-15T09:45:25'), + ('Coquimbo', '22', '2006-02-15T09:45:25'), + ('Antofagasta', '22', '2006-02-15T09:45:25'), + ('Masqat', '71', '2006-02-15T09:45:25'), + ('Salala', '71', '2006-02-15T09:45:25'), + ('NDjamna', '21', '2006-02-15T09:45:25'), + ('Abu Dhabi', '101', '2006-02-15T09:45:25'), + ('Sharja', '101', '2006-02-15T09:45:25'), + ('al-Ayn', '101', '2006-02-15T09:45:25'), + ('Gijn', '87', '2006-02-15T09:45:25'), + ('A Corua (La Corua)', '87', '2006-02-15T09:45:25'), + ('Ourense (Orense)', '87', '2006-02-15T09:45:25'), + ('Donostia-San Sebastin', '87', '2006-02-15T09:45:25'), + ('Santiago de Compostela', '87', '2006-02-15T09:45:25'), + ('Sullana', '74', '2006-02-15T09:45:25'), + ('Hunuco', '74', '2006-02-15T09:45:25'), + ('Callao', '74', '2006-02-15T09:45:25'), + ('Lima', '74', '2006-02-15T09:45:25'), + ('Jalib al-Shuyukh', '53', '2006-02-15T09:45:25'), + ('Gaziantep', '97', '2006-02-15T09:45:25'), + ('Batman', '97', '2006-02-15T09:45:25'), + ('Ktahya', '97', '2006-02-15T09:45:25'), + ('Kilis', '97', '2006-02-15T09:45:25'), + ('Inegl', '97', '2006-02-15T09:45:25'), + ('Tokat', '97', '2006-02-15T09:45:25'), + ('Denizli', '97', '2006-02-15T09:45:25'), + ('Balikesir', '97', '2006-02-15T09:45:25'), + ('Tarsus', '97', '2006-02-15T09:45:25'), + ('Osmaniye', '97', '2006-02-15T09:45:25'), + ('Usak', '97', '2006-02-15T09:45:25'), + ('Sivas', '97', '2006-02-15T09:45:25'), + ('Sultanbeyli', '97', '2006-02-15T09:45:25'), + ('Eskisehir', '97', '2006-02-15T09:45:25'), + ('Adana', '97', '2006-02-15T09:45:25'), + ('Chisinau', '61', '2006-02-15T09:45:25'), + ('Valencia', '104', '2006-02-15T09:45:25'), + ('Maracabo', '104', '2006-02-15T09:45:25'), + ('Caracas', '104', '2006-02-15T09:45:25'), + ('Barcelona', '104', '2006-02-15T09:45:25'), + ('Cuman', '104', '2006-02-15T09:45:25'), + ('Valle de la Pascua', '104', '2006-02-15T09:45:25'), + ('Ocumare del Tuy', '104', '2006-02-15T09:45:25'), + ('Ponce', '77', '2006-02-15T09:45:25'), + ('Arecibo', '77', '2006-02-15T09:45:25'), + ('Novi Sad', '108', '2006-02-15T09:45:25'), + ('Kragujevac', '108', '2006-02-15T09:45:25'), + ('Sokoto', '69', '2006-02-15T09:45:25'), + ('Kaduna', '69', '2006-02-15T09:45:25'), + ('Owo', '69', '2006-02-15T09:45:25'), + ('Oyo', '69', '2006-02-15T09:45:25'), + ('Ogbomosho', '69', '2006-02-15T09:45:25'), + ('Effon-Alaiye', '69', '2006-02-15T09:45:25'), + ('Ondo', '69', '2006-02-15T09:45:25'), + ('Benin City', '69', '2006-02-15T09:45:25'), + ('Deba Habe', '69', '2006-02-15T09:45:25'), + ('Ilorin', '69', '2006-02-15T09:45:25'), + ('Ikerre', '69', '2006-02-15T09:45:25'), + ('Ife', '69', '2006-02-15T09:45:25'), + ('Zaria', '69', '2006-02-15T09:45:25'), + ('Citt del Vaticano', '41', '2006-02-15T09:45:25'), + ('Zanzibar', '93', '2006-02-15T09:45:25'), + ('Tabora', '93', '2006-02-15T09:45:25'), + ('Mwanza', '93', '2006-02-15T09:45:25'), + ('Szkesfehrvr', '43', '2006-02-15T09:45:25'), + ('Pereira', '24', '2006-02-15T09:45:25'), + ('Sogamoso', '24', '2006-02-15T09:45:25'), + ('Dos Quebradas', '24', '2006-02-15T09:45:25'), + ('Florencia', '24', '2006-02-15T09:45:25'), + ('Sincelejo', '24', '2006-02-15T09:45:25'), + ('Buenaventura', '24', '2006-02-15T09:45:25'), + ('Trshavn', '32', '2006-02-15T09:45:25'), + ('Daugavpils', '54', '2006-02-15T09:45:25'), + ('Liepaja', '54', '2006-02-15T09:45:25'), + ('Banjul', '37', '2006-02-15T09:45:25'), + ('Jaffna', '88', '2006-02-15T09:45:25'), + ('Malm', '90', '2006-02-15T09:45:25'), + ('Mandi Bahauddin', '72', '2006-02-15T09:45:25'), + ('Okara', '72', '2006-02-15T09:45:25') + ) AS data(city, old_country_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."country"' + AND map0.old_id = data.old_country_id + RETURNING city_id + ) + SELECT array_agg(city_id) INTO v_new_ids_city FROM inserted; + + FOR i IN 1..array_length(v_new_ids_city, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."city"', v_old_ids_city[i], v_new_ids_city[i]::TEXT); + END LOOP; + + v_old_ids_city := ARRAY['472', '134', '327', '360', '67', '72', '296', '56', '106', '451', '556', '154', '131', '288', '341', '103', '125', '393', '541', '335', '365', '212', '213', '452', '246', '250', '40', '130', '595', '188', '124', '19', '202', '445', '563', '4', '129', '330', '86', '95', '530', '516', '423', '481', '356', '162', '31', '467', '514', '265', '378', '586', '81', '443', '68', '353', '237', '2', '13', '16', '515', '543', '92', '297', '544', '560', '436', '498', '52', '585', '339', '340', '53', '6', '269', '453', '37', '122', '168', '108', '209', '546', '316', '116', '542', '361', '114', '526', '424', '128', '524', '334', '165', '20', '161', '457', '45', '454', '43', '567']; + WITH inserted AS ( + INSERT INTO "public"."city" ("city", "country_id", "last_update") + SELECT + data.city::character varying, + map0.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('Shikarpur', '72', '2006-02-15T09:45:25'), + ('Dadu', '72', '2006-02-15T09:45:25'), + ('Mardan', '72', '2006-02-15T09:45:25'), + ('Namibe', '4', '2006-02-15T09:45:25'), + ('Benguela', '4', '2006-02-15T09:45:25'), + ('Bern', '91', '2006-02-15T09:45:25'), + ('Lausanne', '91', '2006-02-15T09:45:25'), + ('Basel', '91', '2006-02-15T09:45:25'), + ('Celaya', '60', '2006-02-15T09:45:25'), + ('San Felipe del Progreso', '60', '2006-02-15T09:45:25'), + ('Uruapan', '60', '2006-02-15T09:45:25'), + ('El Fuerte', '60', '2006-02-15T09:45:25'), + ('Cuernavaca', '60', '2006-02-15T09:45:25'), + ('La Paz', '60', '2006-02-15T09:45:25'), + ('Monclova', '60', '2006-02-15T09:45:25'), + ('Carmen', '60', '2006-02-15T09:45:25'), + ('Coatzacoalcos', '60', '2006-02-15T09:45:25'), + ('Pachuca de Soto', '60', '2006-02-15T09:45:25'), + ('Torren', '60', '2006-02-15T09:45:25'), + ('Mexicali', '60', '2006-02-15T09:45:25'), + ('Nezahualcyotl', '60', '2006-02-15T09:45:25'), + ('Huejutla de Reyes', '60', '2006-02-15T09:45:25'), + ('Huixquilucan', '60', '2006-02-15T09:45:25'), + ('San Juan Bautista Tuxtepec', '60', '2006-02-15T09:45:25'), + ('Jos Azueta', '60', '2006-02-15T09:45:25'), + ('Jurez', '60', '2006-02-15T09:45:25'), + ('Atlixco', '60', '2006-02-15T09:45:25'), + ('Cuautla', '60', '2006-02-15T09:45:25'), + ('Zapopan', '60', '2006-02-15T09:45:25'), + ('Guadalajara', '60', '2006-02-15T09:45:25'), + ('Coacalco de Berriozbal', '60', '2006-02-15T09:45:25'), + ('Allende', '60', '2006-02-15T09:45:25'), + ('Hidalgo', '60', '2006-02-15T09:45:25'), + ('Salamanca', '60', '2006-02-15T09:45:25'), + ('Valle de Santiago', '60', '2006-02-15T09:45:25'), + ('Acua', '60', '2006-02-15T09:45:25'), + ('Cuauhtmoc', '60', '2006-02-15T09:45:25'), + ('Matamoros', '60', '2006-02-15T09:45:25'), + ('Botosani', '78', '2006-02-15T09:45:25'), + ('Bucuresti', '78', '2006-02-15T09:45:25'), + ('Tartu', '30', '2006-02-15T09:45:25'), + ('Tafuna', '3', '2006-02-15T09:45:25'), + ('Qomsheh', '46', '2006-02-15T09:45:25'), + ('Sirjan', '46', '2006-02-15T09:45:25'), + ('Najafabad', '46', '2006-02-15T09:45:25'), + ('Esfahan', '46', '2006-02-15T09:45:25'), + ('Arak', '46', '2006-02-15T09:45:25'), + ('Shahr-e Kord', '46', '2006-02-15T09:45:25'), + ('Tabriz', '46', '2006-02-15T09:45:25'), + ('Kermanshah', '46', '2006-02-15T09:45:25'), + ('Olomouc', '26', '2006-02-15T09:45:25'), + ('Yerevan', '7', '2006-02-15T09:45:25'), + ('Birgunj', '66', '2006-02-15T09:45:25'), + ('Sal', '62', '2006-02-15T09:45:25'), + ('Beni-Mellal', '62', '2006-02-15T09:45:25'), + ('Nador', '62', '2006-02-15T09:45:25'), + ('Jedda', '82', '2006-02-15T09:45:25'), + ('Abha', '82', '2006-02-15T09:45:25'), + ('al-Hawiya', '82', '2006-02-15T09:45:25'), + ('al-Qatif', '82', '2006-02-15T09:45:25'), + ('Tabuk', '82', '2006-02-15T09:45:25'), + ('Toulon', '34', '2006-02-15T09:45:25'), + ('Brest', '34', '2006-02-15T09:45:25'), + ('Le Mans', '34', '2006-02-15T09:45:25'), + ('Toulouse', '34', '2006-02-15T09:45:25'), + ('Vaduz', '55', '2006-02-15T09:45:25'), + ('Ruse', '17', '2006-02-15T09:45:25'), + ('Stara Zagora', '17', '2006-02-15T09:45:25'), + ('Bamenda', '19', '2006-02-15T09:45:25'), + ('Yaound', '19', '2006-02-15T09:45:25'), + ('Mogiljov', '13', '2006-02-15T09:45:25'), + ('Molodetno', '13', '2006-02-15T09:45:25'), + ('Bandar Seri Begawan', '16', '2006-02-15T09:45:25'), + ('Addis Abeba', '31', '2006-02-15T09:45:25'), + ('Kingstown', '81', '2006-02-15T09:45:25'), + ('San Lorenzo', '73', '2006-02-15T09:45:25'), + ('Asuncin', '73', '2006-02-15T09:45:25'), + ('Ciudad del Este', '73', '2006-02-15T09:45:25'), + ('Fengshan', '92', '2006-02-15T09:45:25'), + ('Changhwa', '92', '2006-02-15T09:45:25'), + ('Hsichuh', '92', '2006-02-15T09:45:25'), + ('Tsaotun', '92', '2006-02-15T09:45:25'), + ('Lungtan', '92', '2006-02-15T09:45:25'), + ('Chungho', '92', '2006-02-15T09:45:25'), + ('Touliu', '92', '2006-02-15T09:45:25'), + ('Nantou', '92', '2006-02-15T09:45:25'), + ('Chiayi', '92', '2006-02-15T09:45:25'), + ('Tanshui', '92', '2006-02-15T09:45:25'), + ('Quilmes', '6', '2006-02-15T09:45:25'), + ('Crdoba', '6', '2006-02-15T09:45:25'), + ('Tandil', '6', '2006-02-15T09:45:25'), + ('Merlo', '6', '2006-02-15T09:45:25'), + ('Ezeiza', '6', '2006-02-15T09:45:25'), + ('Almirante Brown', '6', '2006-02-15T09:45:25'), + ('Escobar', '6', '2006-02-15T09:45:25'), + ('Santa F', '6', '2006-02-15T09:45:25'), + ('Baha Blanca', '6', '2006-02-15T09:45:25'), + ('San Miguel de Tucumn', '6', '2006-02-15T09:45:25'), + ('Avellaneda', '6', '2006-02-15T09:45:25'), + ('Vicente Lpez', '6', '2006-02-15T09:45:25') + ) AS data(city, old_country_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."country"' + AND map0.old_id = data.old_country_id + RETURNING city_id + ) + SELECT array_agg(city_id) INTO v_new_ids_city FROM inserted; + + FOR i IN 1..array_length(v_new_ids_city, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."city"', v_old_ids_city[i], v_new_ids_city[i]::TEXT); + END LOOP; + + v_old_ids_city := ARRAY['289', '33', '573', '262', '42', '178', '126', '123', '65', '446', '449', '333', '435', '135', '508', '292', '499', '245', '433', '120', '187', '177', '140', '11', '322', '441', '404', '94', '520', '306', '171', '155', '295', '185', '101', '41', '112', '273', '85', '364', '491', '437', '267', '497', '87', '244', '392', '200', '311', '414', '434', '304', '206', '7', '455', '518', '371', '570', '507', '223', '282', '196', '300', '430', '179', '383', '565', '313', '447', '186', '307', '34', '57', '533', '36', '358', '394', '489', '439', '160', '198', '575', '148', '477', '325', '279', '581', '47', '174', '594', '584', '432', '536', '159', '592', '535', '590', '574', '362', '293']; + WITH inserted AS ( + INSERT INTO "public"."city" ("city", "country_id", "last_update") + SELECT + data.city::character varying, + map0.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('La Plata', '6', '2006-02-15T09:45:25'), + ('Arlington', '103', '2006-02-15T09:45:25'), + ('Warren', '103', '2006-02-15T09:45:25'), + ('Kansas City', '103', '2006-02-15T09:45:25'), + ('Aurora', '103', '2006-02-15T09:45:25'), + ('Garland', '103', '2006-02-15T09:45:25'), + ('Compton', '103', '2006-02-15T09:45:25'), + ('Clarksville', '103', '2006-02-15T09:45:25'), + ('Bellevue', '103', '2006-02-15T09:45:25'), + ('Salinas', '103', '2006-02-15T09:45:25'), + ('San Bernardino', '103', '2006-02-15T09:45:25'), + ('Memphis', '103', '2006-02-15T09:45:25'), + ('Rockford', '103', '2006-02-15T09:45:25'), + ('Dallas', '103', '2006-02-15T09:45:25'), + ('Sunnyvale', '103', '2006-02-15T09:45:25'), + ('Lancaster', '103', '2006-02-15T09:45:25'), + ('Sterling Heights', '103', '2006-02-15T09:45:25'), + ('Joliet', '103', '2006-02-15T09:45:25'), + ('Roanoke', '103', '2006-02-15T09:45:25'), + ('Citrus Heights', '103', '2006-02-15T09:45:25'), + ('Greensboro', '103', '2006-02-15T09:45:25'), + ('Garden Grove', '103', '2006-02-15T09:45:25'), + ('Dayton', '103', '2006-02-15T09:45:25'), + ('Akron', '103', '2006-02-15T09:45:25'), + ('Manchester', '103', '2006-02-15T09:45:25'), + ('Saint Louis', '103', '2006-02-15T09:45:25'), + ('Peoria', '103', '2006-02-15T09:45:25'), + ('Brockton', '103', '2006-02-15T09:45:25'), + ('Tallahassee', '103', '2006-02-15T09:45:25'), + ('Lincoln', '103', '2006-02-15T09:45:25'), + ('Fontana', '103', '2006-02-15T09:45:25'), + ('El Monte', '103', '2006-02-15T09:45:25'), + ('Laredo', '103', '2006-02-15T09:45:25'), + ('Grand Prairie', '103', '2006-02-15T09:45:25'), + ('Cape Coral', '103', '2006-02-15T09:45:25'), + ('Augusta-Richmond County', '103', '2006-02-15T09:45:25'), + ('Chatsworth', '85', '2006-02-15T09:45:25'), + ('Klerksdorp', '85', '2006-02-15T09:45:25'), + ('Boksburg', '85', '2006-02-15T09:45:25'), + ('Newcastle', '85', '2006-02-15T09:45:25'), + ('Soshanguve', '85', '2006-02-15T09:45:25'), + ('Rustenburg', '85', '2006-02-15T09:45:25'), + ('Kimberley', '85', '2006-02-15T09:45:25'), + ('Springs', '85', '2006-02-15T09:45:25'), + ('Botshabelo', '85', '2006-02-15T09:45:25'), + ('Johannesburg', '85', '2006-02-15T09:45:25'), + ('Paarl', '85', '2006-02-15T09:45:25'), + ('Hamilton', '68', '2006-02-15T09:45:25'), + ('Loja', '28', '2006-02-15T09:45:25'), + ('Portoviejo', '28', '2006-02-15T09:45:25'), + ('Robamba', '28', '2006-02-15T09:45:25'), + ('Lilongwe', '58', '2006-02-15T09:45:25'), + ('Hodeida', '107', '2006-02-15T09:45:25'), + ('Aden', '107', '2006-02-15T09:45:25'), + ('Sanaa', '107', '2006-02-15T09:45:25'), + ('Taizz', '107', '2006-02-15T09:45:25'), + ('Nuuk', '40', '2006-02-15T09:45:25'), + ('Vilnius', '56', '2006-02-15T09:45:25'), + ('Sungai Petani', '59', '2006-02-15T09:45:25'), + ('Ipoh', '59', '2006-02-15T09:45:25'), + ('Kuching', '59', '2006-02-15T09:45:25'), + ('Halifax', '20', '2006-02-15T09:45:25'), + ('Lethbridge', '20', '2006-02-15T09:45:25'), + ('Richmond Hill', '20', '2006-02-15T09:45:25'), + ('Gatineau', '20', '2006-02-15T09:45:25'), + ('Oshawa', '20', '2006-02-15T09:45:25'), + ('Vancouver', '20', '2006-02-15T09:45:25'), + ('London', '20', '2006-02-15T09:45:25'), + ('Salzburg', '9', '2006-02-15T09:45:25'), + ('Graz', '9', '2006-02-15T09:45:25'), + ('Linz', '9', '2006-02-15T09:45:25'), + ('Ashdod', '48', '2006-02-15T09:45:25'), + ('Bat Yam', '48', '2006-02-15T09:45:25'), + ('Tel Aviv-Jaffa', '48', '2006-02-15T09:45:25'), + ('Ashqelon', '48', '2006-02-15T09:45:25'), + ('Nakhon Sawan', '94', '2006-02-15T09:45:25'), + ('Pak Kret', '94', '2006-02-15T09:45:25'), + ('Songkhla', '94', '2006-02-15T09:45:25'), + ('Saarbrcken', '38', '2006-02-15T09:45:25'), + ('Erlangen', '38', '2006-02-15T09:45:25'), + ('Halle/Saale', '38', '2006-02-15T09:45:25'), + ('Witten', '38', '2006-02-15T09:45:25'), + ('Duisburg', '38', '2006-02-15T09:45:25'), + ('Siegen', '38', '2006-02-15T09:45:25'), + ('Mannheim', '38', '2006-02-15T09:45:25'), + ('Kowloon and New Kowloon', '42', '2006-02-15T09:45:25'), + ('Xinxiang', '23', '2006-02-15T09:45:25'), + ('Baiyin', '23', '2006-02-15T09:45:25'), + ('Fuyu', '23', '2006-02-15T09:45:25'), + ('Zaoyang', '23', '2006-02-15T09:45:25'), + ('Yantai', '23', '2006-02-15T09:45:25'), + ('Rizhao', '23', '2006-02-15T09:45:25'), + ('Tiefa', '23', '2006-02-15T09:45:25'), + ('Enshi', '23', '2006-02-15T09:45:25'), + ('Zalantun', '23', '2006-02-15T09:45:25'), + ('Tianjin', '23', '2006-02-15T09:45:25'), + ('Yuncheng', '23', '2006-02-15T09:45:25'), + ('Weifang', '23', '2006-02-15T09:45:25'), + ('Nanyang', '23', '2006-02-15T09:45:25'), + ('Laohekou', '23', '2006-02-15T09:45:25') + ) AS data(city, old_country_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."country"' + AND map0.old_id = data.old_country_id + RETURNING city_id + ) + SELECT array_agg(city_id) INTO v_new_ids_city FROM inserted; + + FOR i IN 1..array_length(v_new_ids_city, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."city"', v_old_ids_city[i], v_new_ids_city[i]::TEXT); + END LOOP; + + v_old_ids_city := ARRAY['210', '175', '241', '277', '240', '468', '80', '578', '588', '422', '471', '193', '332', '136', '302', '591', '249', '46', '580', '109', '540', '207', '298', '291', '299', '145', '139', '199', '166', '469', '579', '242', '407', '157', '537', '502', '599', '587', '462', '90', '38', '401', '14', '338', '382', '386', '331', '284', '256', '555', '521', '440', '552', '474', '287', '260', '355', '229', '276', '226', '203', '204', '380', '205', '253', '227', '376', '10', '228', '463', '377', '224', '172', '547', '598', '402', '429', '231', '211', '522', '417', '197', '74', '243', '427', '144', '395', '426', '564', '475', '107', '22', '582', '399', '169', '464', '554', '176', '76', '416']; + WITH inserted AS ( + INSERT INTO "public"."city" ("city", "country_id", "last_update") + SELECT + data.city::character varying, + map0.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('Huaian', '23', '2006-02-15T09:45:25'), + ('Fuzhou', '23', '2006-02-15T09:45:25'), + ('Jining', '23', '2006-02-15T09:45:25'), + ('Korla', '23', '2006-02-15T09:45:25'), + ('Jinchang', '23', '2006-02-15T09:45:25'), + ('Shanwei', '23', '2006-02-15T09:45:25'), + ('Binzhou', '23', '2006-02-15T09:45:25'), + ('Xiangfan', '23', '2006-02-15T09:45:25'), + ('Yingkou', '23', '2006-02-15T09:45:25'), + ('Qinhuangdao', '23', '2006-02-15T09:45:25'), + ('Shenzhen', '23', '2006-02-15T09:45:25'), + ('Haining', '23', '2006-02-15T09:45:25'), + ('Meixian', '23', '2006-02-15T09:45:25'), + ('Datong', '23', '2006-02-15T09:45:25'), + ('Liaocheng', '23', '2006-02-15T09:45:25'), + ('Yuzhou', '23', '2006-02-15T09:45:25'), + ('Junan', '23', '2006-02-15T09:45:25'), + ('Baicheng', '23', '2006-02-15T09:45:25'), + ('Xintai', '23', '2006-02-15T09:45:25'), + ('Changzhou', '23', '2006-02-15T09:45:25'), + ('Tongliao', '23', '2006-02-15T09:45:25'), + ('Hohhot', '23', '2006-02-15T09:45:25'), + ('Lengshuijiang', '23', '2006-02-15T09:45:25'), + ('Laiwu', '23', '2006-02-15T09:45:25'), + ('Leshan', '23', '2006-02-15T09:45:25'), + ('Dongying', '23', '2006-02-15T09:45:25'), + ('Daxian', '23', '2006-02-15T09:45:25'), + ('Hami', '23', '2006-02-15T09:45:25'), + ('Ezhou', '23', '2006-02-15T09:45:25'), + ('Shaoguan', '23', '2006-02-15T09:45:25'), + ('Xiangtan', '23', '2006-02-15T09:45:25'), + ('Jinzhou', '23', '2006-02-15T09:45:25'), + ('Pingxiang', '23', '2006-02-15T09:45:25'), + ('Emeishan', '23', '2006-02-15T09:45:25'), + ('Tieli', '23', '2006-02-15T09:45:25'), + ('Suihua', '23', '2006-02-15T09:45:25'), + ('Zhoushan', '23', '2006-02-15T09:45:25'), + ('Yinchuan', '23', '2006-02-15T09:45:25'), + ('Sanya', '23', '2006-02-15T09:45:25'), + ('Bratislava', '84', '2006-02-15T09:45:25'), + ('Athenai', '39', '2006-02-15T09:45:25'), + ('Patras', '39', '2006-02-15T09:45:25'), + ('al-Manama', '11', '2006-02-15T09:45:25'), + ('Miyakonojo', '50', '2006-02-15T09:45:25'), + ('Onomichi', '50', '2006-02-15T09:45:25'), + ('Otsu', '50', '2006-02-15T09:45:25'), + ('Matsue', '50', '2006-02-15T09:45:25'), + ('Kurashiki', '50', '2006-02-15T09:45:25'), + ('Kamakura', '50', '2006-02-15T09:45:25'), + ('Urawa', '50', '2006-02-15T09:45:25'), + ('Tama', '50', '2006-02-15T09:45:25'), + ('Sagamihara', '50', '2006-02-15T09:45:25'), + ('Ueda', '50', '2006-02-15T09:45:25'), + ('Shimonoseki', '50', '2006-02-15T09:45:25'), + ('Kuwana', '50', '2006-02-15T09:45:25'), + ('Kanazawa', '50', '2006-02-15T09:45:25'), + ('Nagareyama', '50', '2006-02-15T09:45:25'), + ('Izumisano', '50', '2006-02-15T09:45:25'), + ('Koriyama', '50', '2006-02-15T09:45:25'), + ('Iwaki', '50', '2006-02-15T09:45:25'), + ('Higashiosaka', '50', '2006-02-15T09:45:25'), + ('Hino', '50', '2006-02-15T09:45:25'), + ('Omiya', '50', '2006-02-15T09:45:25'), + ('Hiroshima', '50', '2006-02-15T09:45:25'), + ('Kakamigahara', '50', '2006-02-15T09:45:25'), + ('Iwakuni', '50', '2006-02-15T09:45:25'), + ('Okayama', '50', '2006-02-15T09:45:25'), + ('Akishima', '50', '2006-02-15T09:45:25'), + ('Iwatsuki', '50', '2006-02-15T09:45:25'), + ('Sasebo', '50', '2006-02-15T09:45:25'), + ('Okinawa', '50', '2006-02-15T09:45:25'), + ('Isesaki', '50', '2006-02-15T09:45:25'), + ('Fukuyama', '50', '2006-02-15T09:45:25'), + ('Tsuyama', '50', '2006-02-15T09:45:25'), + ('Zhezqazghan', '51', '2006-02-15T09:45:25'), + ('Pavlodar', '51', '2006-02-15T09:45:25'), + ('Ranchi', '44', '2006-02-15T09:45:25'), + ('Jaipur', '44', '2006-02-15T09:45:25'), + ('Hubli-Dharwad', '44', '2006-02-15T09:45:25'), + ('Tambaram', '44', '2006-02-15T09:45:25'), + ('Pune', '44', '2006-02-15T09:45:25'), + ('Halisahar', '44', '2006-02-15T09:45:25'), + ('Bhilwara', '44', '2006-02-15T09:45:25'), + ('Jodhpur', '44', '2006-02-15T09:45:25'), + ('Rampur', '44', '2006-02-15T09:45:25'), + ('Dhule (Dhulia)', '44', '2006-02-15T09:45:25'), + ('Palghat (Palakkad)', '44', '2006-02-15T09:45:25'), + ('Rajkot', '44', '2006-02-15T09:45:25'), + ('Valparai', '44', '2006-02-15T09:45:25'), + ('Shivapuri', '44', '2006-02-15T09:45:25'), + ('Chandrapur', '44', '2006-02-15T09:45:25'), + ('Ambattur', '44', '2006-02-15T09:45:25'), + ('Yamuna Nagar', '44', '2006-02-15T09:45:25'), + ('Pathankot', '44', '2006-02-15T09:45:25'), + ('Firozabad', '44', '2006-02-15T09:45:25'), + ('Satna', '44', '2006-02-15T09:45:25'), + ('Uluberia', '44', '2006-02-15T09:45:25'), + ('Gandhinagar', '44', '2006-02-15T09:45:25'), + ('Bhopal', '44', '2006-02-15T09:45:25'), + ('Pudukkottai', '44', '2006-02-15T09:45:25') + ) AS data(city, old_country_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."country"' + AND map0.old_id = data.old_country_id + RETURNING city_id + ) + SELECT array_agg(city_id) INTO v_new_ids_city FROM inserted; + + FOR i IN 1..array_length(v_new_ids_city, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."city"', v_old_ids_city[i], v_new_ids_city[i]::TEXT); + END LOOP; + + v_old_ids_city := ARRAY['239', '398', '75', '550', '257', '24', '71', '566', '473', '283', '263', '350', '77', '425', '354', '478', '261', '164', '448', '264', '191', '400', '568', '73', '110', '336', '51', '418', '18', '78', '8', '208', '346', '195', '9', '559', '251', '60', '406', '576', '111', '48', '505', '272', '551', '93', '511', '17', '309', '70', '91', '167', '397', '493', '370', '349', '342', '173', '348', '315', '600', '35', '63', '59', '483', '420', '372', '271', '143', '234', '525', '442', '479', '258', '385', '506', '345', '275', '182', '517', '528', '294', '82', '527', '221', '391', '458', '519', '219', '104', '323', '98', '61', '548', '138', '523', '62', '192', '15', '379']; + WITH inserted AS ( + INSERT INTO "public"."city" ("city", "country_id", "last_update") + SELECT + data.city::character varying, + map0.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('Jhansi', '44', '2006-02-15T09:45:25'), + ('Parbhani', '44', '2006-02-15T09:45:25'), + ('Bhimavaram', '44', '2006-02-15T09:45:25'), + ('Udaipur', '44', '2006-02-15T09:45:25'), + ('Kamarhati', '44', '2006-02-15T09:45:25'), + ('Amroha', '44', '2006-02-15T09:45:25'), + ('Berhampore (Baharampur)', '44', '2006-02-15T09:45:25'), + ('Varanasi (Benares)', '44', '2006-02-15T09:45:25'), + ('Shimoga', '44', '2006-02-15T09:45:25'), + ('Kumbakonam', '44', '2006-02-15T09:45:25'), + ('Karnal', '44', '2006-02-15T09:45:25'), + ('Mysore', '44', '2006-02-15T09:45:25'), + ('Bhusawal', '44', '2006-02-15T09:45:25'), + ('Rae Bareli', '44', '2006-02-15T09:45:25'), + ('Nagaon', '44', '2006-02-15T09:45:25'), + ('Siliguri (Shiliguri)', '44', '2006-02-15T09:45:25'), + ('Kanchrapara', '44', '2006-02-15T09:45:25'), + ('Etawah', '44', '2006-02-15T09:45:25'), + ('Sambhal', '44', '2006-02-15T09:45:25'), + ('Katihar', '44', '2006-02-15T09:45:25'), + ('Gulbarga', '44', '2006-02-15T09:45:25'), + ('Patiala', '44', '2006-02-15T09:45:25'), + ('Vijayawada', '44', '2006-02-15T09:45:25'), + ('Bhavnagar', '44', '2006-02-15T09:45:25'), + ('Chapra', '44', '2006-02-15T09:45:25'), + ('Miraj', '44', '2006-02-15T09:45:25'), + ('Balurghat', '44', '2006-02-15T09:45:25'), + ('Purnea (Purnia)', '44', '2006-02-15T09:45:25'), + ('Allappuzha (Alleppey)', '44', '2006-02-15T09:45:25'), + ('Bijapur', '44', '2006-02-15T09:45:25'), + ('Adoni', '44', '2006-02-15T09:45:25'), + ('Hoshiarpur', '44', '2006-02-15T09:45:25'), + ('Munger (Monghyr)', '44', '2006-02-15T09:45:25'), + ('Haldia', '44', '2006-02-15T09:45:25'), + ('Ahmadnagar', '44', '2006-02-15T09:45:25'), + ('Uttarpara-Kotrung', '44', '2006-02-15T09:45:25'), + ('Kabul', '1', '2006-02-15T09:45:25'), + ('Battambang', '18', '2006-02-15T09:45:25'), + ('Phnom Penh', '18', '2006-02-15T09:45:25'), + ('Woodridge', '8', '2006-02-15T09:45:25'), + ('Charlotte Amalie', '106', '2006-02-15T09:45:25'), + ('Baku', '10', '2006-02-15T09:45:25'), + ('Sumqayit', '10', '2006-02-15T09:45:25'), + ('Kitwe', '109', '2006-02-15T09:45:25'), + ('Udine', '49', '2006-02-15T09:45:25'), + ('Brindisi', '49', '2006-02-15T09:45:25'), + ('Syrakusa', '49', '2006-02-15T09:45:25'), + ('Alessandria', '49', '2006-02-15T09:45:25'), + ('Livorno', '49', '2006-02-15T09:45:25'), + ('Bergamo', '49', '2006-02-15T09:45:25'), + ('Brescia', '49', '2006-02-15T09:45:25'), + ('Faaa', '36', '2006-02-15T09:45:25'), + ('Papeete', '36', '2006-02-15T09:45:25'), + ('South Hill', '5', '2006-02-15T09:45:25'), + ('Nukualofa', '95', '2006-02-15T09:45:25'), + ('Myingyan', '64', '2006-02-15T09:45:25'), + ('Monywa', '64', '2006-02-15T09:45:25'), + ('Funafuti', '99', '2006-02-15T09:45:25'), + ('Mwene-Ditu', '25', '2006-02-15T09:45:25'), + ('Lubumbashi', '25', '2006-02-15T09:45:25'), + ('Ziguinchor', '83', '2006-02-15T09:45:25'), + ('Ashgabat', '98', '2006-02-15T09:45:25'), + ('Bchar', '2', '2006-02-15T09:45:25'), + ('Batna', '2', '2006-02-15T09:45:25'), + ('Skikda', '2', '2006-02-15T09:45:25'), + ('Pyongyang', '70', '2006-02-15T09:45:25'), + ('Nyeri', '52', '2006-02-15T09:45:25'), + ('Kisumu', '52', '2006-02-15T09:45:25'), + ('Dhaka', '12', '2006-02-15T09:45:25'), + ('Jamalpur', '12', '2006-02-15T09:45:25'), + ('Tangail', '12', '2006-02-15T09:45:25'), + ('Saint-Denis', '79', '2006-02-15T09:45:25'), + ('Simferopol', '100', '2006-02-15T09:45:25'), + ('Kamjanets-Podilskyi', '100', '2006-02-15T09:45:25'), + ('ostka', '100', '2006-02-15T09:45:25'), + ('Sumy', '100', '2006-02-15T09:45:25'), + ('Mukateve', '100', '2006-02-15T09:45:25'), + ('Konotop', '100', '2006-02-15T09:45:25'), + ('Gingoog', '75', '2006-02-15T09:45:25'), + ('Taguig', '75', '2006-02-15T09:45:25'), + ('Tarlac', '75', '2006-02-15T09:45:25'), + ('Lapu-Lapu', '75', '2006-02-15T09:45:25'), + ('Bislig', '75', '2006-02-15T09:45:25'), + ('Tanza', '75', '2006-02-15T09:45:25'), + ('Imus', '75', '2006-02-15T09:45:25'), + ('Ozamis', '75', '2006-02-15T09:45:25'), + ('Santa Rosa', '75', '2006-02-15T09:45:25'), + ('Talavera', '75', '2006-02-15T09:45:25'), + ('Iligan', '75', '2006-02-15T09:45:25'), + ('Cavite', '75', '2006-02-15T09:45:25'), + ('Mandaluyong', '75', '2006-02-15T09:45:25'), + ('Cabuyao', '75', '2006-02-15T09:45:25'), + ('Baybay', '75', '2006-02-15T09:45:25'), + ('Tuguegarao', '75', '2006-02-15T09:45:25'), + ('Davao', '75', '2006-02-15T09:45:25'), + ('Tanauan', '75', '2006-02-15T09:45:25'), + ('Bayugan', '75', '2006-02-15T09:45:25'), + ('Hagonoy', '75', '2006-02-15T09:45:25'), + ('al-Qadarif', '89', '2006-02-15T09:45:25'), + ('Omdurman', '89', '2006-02-15T09:45:25') + ) AS data(city, old_country_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."country"' + AND map0.old_id = data.old_country_id + RETURNING city_id + ) + SELECT array_agg(city_id) INTO v_new_ids_city FROM inserted; + + FOR i IN 1..array_length(v_new_ids_city, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."city"', v_old_ids_city[i], v_new_ids_city[i]::TEXT); + END LOOP; + + v_old_ids_city := ARRAY['387', '29', '158', '23', '151', '438', '409', '133', '577', '97', '236', '255', '549', '314', '84', '486', '28', '317', '26', '21', '30', '89', '490', '44', '215', '485', '461', '83', '572', '456', '190', '413', '183', '328', '410', '25', '431', '189', '248', '66', '247', '569', '268', '357', '113', '539', '553', '310', '278', '156', '285', '274', '466', '343', '254', '369', '597', '308', '39', '320', '270', '150', '235', '225', '510', '367', '49', '408', '238', '558', '484', '259', '531', '352', '286', '319', '64', '534', '351', '460', '450', '290', '501', '153', '492', '583', '118', '184', '119', '412', '509', '396', '403', '415', '532', '117', '301', '419', '232', '318']; + WITH inserted AS ( + INSERT INTO "public"."city" ("city", "country_id", "last_update") + SELECT + data.city::character varying, + map0.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('Oulu', '33', '2006-02-15T09:45:25'), + ('Apeldoorn', '67', '2006-02-15T09:45:25'), + ('Emmen', '67', '2006-02-15T09:45:25'), + ('Amersfoort', '67', '2006-02-15T09:45:25'), + ('Ede', '67', '2006-02-15T09:45:25'), + ('s-Hertogenbosch', '67', '2006-02-15T09:45:25'), + ('Plock', '76', '2006-02-15T09:45:25'), + ('Czestochowa', '76', '2006-02-15T09:45:25'), + ('Wroclaw', '76', '2006-02-15T09:45:25'), + ('Bydgoszcz', '76', '2006-02-15T09:45:25'), + ('Jastrzebie-Zdrj', '76', '2006-02-15T09:45:25'), + ('Kalisz', '76', '2006-02-15T09:45:25'), + ('Tychy', '76', '2006-02-15T09:45:25'), + ('Lublin', '76', '2006-02-15T09:45:25'), + ('Boa Vista', '15', '2006-02-15T09:45:25'), + ('So Leopoldo', '15', '2006-02-15T09:45:25'), + ('Aparecida de Goinia', '15', '2006-02-15T09:45:25'), + ('Luzinia', '15', '2006-02-15T09:45:25'), + ('Anpolis', '15', '2006-02-15T09:45:25'), + ('Alvorada', '15', '2006-02-15T09:45:25'), + ('Araatuba', '15', '2006-02-15T09:45:25'), + ('Braslia', '15', '2006-02-15T09:45:25'), + ('Sorocaba', '15', '2006-02-15T09:45:25'), + ('Bag', '15', '2006-02-15T09:45:25'), + ('Ibirit', '15', '2006-02-15T09:45:25'), + ('So Bernardo do Campo', '15', '2006-02-15T09:45:25'), + ('Santo Andr', '15', '2006-02-15T09:45:25'), + ('Blumenau', '15', '2006-02-15T09:45:25'), + ('Vitria de Santo Anto', '15', '2006-02-15T09:45:25'), + ('Santa Brbara dOeste', '15', '2006-02-15T09:45:25'), + ('guas Lindas de Gois', '15', '2006-02-15T09:45:25'), + ('Poos de Caldas', '15', '2006-02-15T09:45:25'), + ('Goinia', '15', '2006-02-15T09:45:25'), + ('Maring', '15', '2006-02-15T09:45:25'), + ('Po', '15', '2006-02-15T09:45:25'), + ('Angra dos Reis', '15', '2006-02-15T09:45:25'), + ('Rio Claro', '15', '2006-02-15T09:45:25'), + ('Guaruj', '15', '2006-02-15T09:45:25'), + ('Juiz de Fora', '15', '2006-02-15T09:45:25'), + ('Belm', '15', '2006-02-15T09:45:25'), + ('Juazeiro do Norte', '15', '2006-02-15T09:45:25'), + ('Vila Velha', '15', '2006-02-15T09:45:25'), + ('Kimchon', '86', '2006-02-15T09:45:25'), + ('Naju', '86', '2006-02-15T09:45:25'), + ('Cheju', '86', '2006-02-15T09:45:25'), + ('Tonghae', '86', '2006-02-15T09:45:25'), + ('Uijongbu', '86', '2006-02-15T09:45:25'), + ('Ljubertsy', '80', '2006-02-15T09:45:25'), + ('Korolev', '80', '2006-02-15T09:45:25'), + ('Elista', '80', '2006-02-15T09:45:25'), + ('Kurgan', '80', '2006-02-15T09:45:25'), + ('Kolpino', '80', '2006-02-15T09:45:25'), + ('Serpuhov', '80', '2006-02-15T09:45:25'), + ('Moscow', '80', '2006-02-15T09:45:25'), + ('Kaliningrad', '80', '2006-02-15T09:45:25'), + ('Novoterkassk', '80', '2006-02-15T09:45:25'), + ('Zeleznogorsk', '80', '2006-02-15T09:45:25'), + ('Lipetsk', '80', '2006-02-15T09:45:25'), + ('Atinsk', '80', '2006-02-15T09:45:25'), + ('Maikop', '80', '2006-02-15T09:45:25'), + ('Kirovo-Tepetsk', '80', '2006-02-15T09:45:25'), + ('Dzerzinsk', '80', '2006-02-15T09:45:25'), + ('Jaroslavl', '80', '2006-02-15T09:45:25'), + ('Ivanovo', '80', '2006-02-15T09:45:25'), + ('Syktyvkar', '80', '2006-02-15T09:45:25'), + ('Niznekamsk', '80', '2006-02-15T09:45:25'), + ('Balaiha', '80', '2006-02-15T09:45:25'), + ('Pjatigorsk', '80', '2006-02-15T09:45:25'), + ('Jelets', '80', '2006-02-15T09:45:25'), + ('Usolje-Sibirskoje', '80', '2006-02-15T09:45:25'), + ('Smolensk', '80', '2006-02-15T09:45:25'), + ('Kamyin', '80', '2006-02-15T09:45:25'), + ('Teboksary', '80', '2006-02-15T09:45:25'), + ('Nabereznyje Telny', '80', '2006-02-15T09:45:25'), + ('Kursk', '80', '2006-02-15T09:45:25'), + ('Mahajanga', '57', '2006-02-15T09:45:25'), + ('Beira', '63', '2006-02-15T09:45:25'), + ('Tete', '63', '2006-02-15T09:45:25'), + ('Naala-Porto', '63', '2006-02-15T09:45:25'), + ('Santiago de los Caballeros', '27', '2006-02-15T09:45:25'), + ('San Felipe de Puerto Plata', '27', '2006-02-15T09:45:25'), + ('La Romana', '27', '2006-02-15T09:45:25'), + ('Sucre', '14', '2006-02-15T09:45:25'), + ('El Alto', '14', '2006-02-15T09:45:25'), + ('Sousse', '96', '2006-02-15T09:45:25'), + ('Yangor', '65', '2006-02-15T09:45:25'), + ('Ciomas', '45', '2006-02-15T09:45:25'), + ('Gorontalo', '45', '2006-02-15T09:45:25'), + ('Ciparay', '45', '2006-02-15T09:45:25'), + ('Pontianak', '45', '2006-02-15T09:45:25'), + ('Surakarta', '45', '2006-02-15T09:45:25'), + ('Pangkal Pinang', '45', '2006-02-15T09:45:25'), + ('Pemalang', '45', '2006-02-15T09:45:25'), + ('Probolinggo', '45', '2006-02-15T09:45:25'), + ('Tegal', '45', '2006-02-15T09:45:25'), + ('Cianjur', '45', '2006-02-15T09:45:25'), + ('Lhokseumawe', '45', '2006-02-15T09:45:25'), + ('Purwakarta', '45', '2006-02-15T09:45:25'), + ('Jakarta', '45', '2006-02-15T09:45:25'), + ('Madiun', '45', '2006-02-15T09:45:25') + ) AS data(city, old_country_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."country"' + AND map0.old_id = data.old_country_id + RETURNING city_id + ) + SELECT array_agg(city_id) INTO v_new_ids_city FROM inserted; + + FOR i IN 1..array_length(v_new_ids_city, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."city"', v_old_ids_city[i], v_new_ids_city[i]::TEXT); + END LOOP; + + -- Table: "public"."film" (1000 records) + v_old_ids_film := ARRAY['805', '853', '817', '732', '65', '915', '999', '564', '176', '655', '32', '75', '653', '362', '789', '642', '930', '82', '34', '233', '792', '355', '761', '575', '643', '454', '71', '488', '108', '91', '387', '959', '458', '728', '704', '950', '752', '818', '583', '626', '834', '160', '483', '189', '822', '248', '647', '228', '29', '520', '969', '411', '755', '501', '247', '186', '654', '769', '858', '509', '352', '394', '599', '526', '979', '182', '451', '992', '331', '278', '381', '117', '414', '597', '305', '105', '68', '450', '841', '449', '487', '7', '889', '457', '839', '894', '146', '508', '578', '623', '735', '200', '808', '275', '3', '519', '921', '456', '663', '770']; + WITH inserted AS ( + INSERT INTO "public"."film" ("description", "fulltext", "language_id", "last_update", "length", "rating", "release_year", "rental_duration", "rental_rate", "replacement_cost", "special_features", "title") + SELECT + data.description::text, + data.fulltext::tsvector, + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.length::smallint, + data.rating::mpaa_rating, + data.release_year::integer, + data.rental_duration::smallint, + data.rental_rate::numeric, + data.replacement_cost::numeric, + data.special_features::text[], + data.title::character varying + FROM (VALUES + ('A Amazing Saga of a Moose And a Pastry Chef who must Escape a Butler in Australia', '''amaz'':4 ''australia'':19 ''butler'':17 ''chef'':12 ''escap'':15 ''monsoon'':2 ''moos'':8 ''must'':14 ''pastri'':11 ''saga'':5 ''sleepless'':1', '1', '2013-05-26T14:50:58.951000', 64, 'G', 2006, 5, '4.99', '12.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Sleepless Monsoon'), + ('A Awe-Inspiring Yarn of a Womanizer And a Explorer who must Fight a Woman in The First Manned Space Station', '''awe'':5 ''awe-inspir'':4 ''explor'':13 ''fight'':16 ''first'':21 ''inspir'':6 ''man'':22 ''must'':15 ''space'':23 ''station'':24 ''stranger'':1,2 ''woman'':10,18 ''yarn'':7', '1', '2013-05-26T14:50:58.951000', 139, 'G', 2006, 3, '4.99', '12.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Stranger Strangers'), + ('A Lacklusture Panorama of a A Shark And a Pioneer who must Confront a Student in The First Manned Space Station', '''confront'':15 ''evolut'':2 ''first'':20 ''lacklustur'':4 ''man'':21 ''must'':14 ''panorama'':5 ''pioneer'':12 ''shark'':9 ''soldier'':1 ''space'':22 ''station'':23 ''student'':17', '1', '2013-05-26T14:50:58.951000', 185, 'R', 2006, 7, '4.99', '27.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Soldiers Evolution'), + ('A Amazing Yarn of a Sumo Wrestler And a Boat who must Conquer a Waitress in New Orleans', '''amaz'':4 ''boat'':12 ''conquer'':15 ''heartbreak'':2 ''must'':14 ''new'':19 ''orlean'':20 ''ring'':1 ''sumo'':8 ''waitress'':17 ''wrestler'':9 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 58, 'G', 2006, 5, '0.99', '17.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Rings Heartbreakers'), + ('A Unbelieveable Drama of a Student And a Husband who must Outrace a Sumo Wrestler in Berlin', '''behavior'':1 ''berlin'':19 ''drama'':5 ''husband'':11 ''must'':13 ''outrac'':14 ''runaway'':2 ''student'':8 ''sumo'':16 ''unbeliev'':4 ''wrestler'':17', '1', '2013-05-26T14:50:58.951000', 100, 'PG', 2006, 3, '4.99', '20.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Behavior Runaway'), + ('A Thrilling Epistle of a Moose And a Boy who must Meet a Database Administrator in A Monastery', '''administr'':17 ''boy'':11 ''crazi'':2 ''databas'':16 ''epistl'':5 ''meet'':14 ''monasteri'':20 ''moos'':8 ''must'':13 ''thrill'':4 ''truman'':1', '1', '2013-05-26T14:50:58.951000', 92, 'G', 2006, 7, '4.99', '9.99', ARRAY['Trailers', 'Commentaries']::text[], 'Truman Crazy'), + ('A Fateful Reflection of a Waitress And a Boat who must Discover a Sumo Wrestler in Ancient China', '''ancient'':19 ''boat'':11 ''china'':20 ''discov'':14 ''fate'':4 ''fiction'':2 ''must'':13 ''reflect'':5 ''sumo'':16 ''waitress'':8 ''wrestler'':17 ''zooland'':1', '1', '2013-05-26T14:50:58.951000', 101, 'R', 2006, 5, '2.99', '28.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Zoolander Fiction'), + ('A Fateful Drama of a Frisbee And a Crocodile who must Vanquish a Dog in The First Manned Space Station', '''crocodil'':11 ''dog'':16 ''drama'':5 ''fate'':4 ''first'':19 ''frisbe'':8 ''imag'':2 ''man'':20 ''massag'':1 ''must'':13 ''space'':21 ''station'':22 ''vanquish'':14', '1', '2013-05-26T14:50:58.951000', 161, 'PG', 2006, 4, '2.99', '11.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Massage Image'), + ('A Touching Documentary of a Cat And a Pastry Chef who must Find a Lumberjack in A Baloon', '''baloon'':20 ''cat'':8 ''chef'':12 ''congeni'':1 ''documentari'':5 ''find'':15 ''lumberjack'':17 ''must'':14 ''pastri'':11 ''quest'':2 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 87, 'PG-13', 2006, 6, '0.99', '21.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Congeniality Quest'), + ('A Brilliant Panorama of a Moose And a Man who must Reach a Teacher in The Gulf of Mexico', '''brilliant'':4 ''gulf'':19 ''man'':11 ''mexico'':21 ''moos'':8 ''must'':13 ''panorama'':5 ''panther'':1 ''reach'':14 ''red'':2 ''teacher'':16', '1', '2013-05-26T14:50:58.951000', 109, 'NC-17', 2006, 5, '4.99', '22.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Panther Reds'), + ('A Astounding Story of a Dog And a Squirrel who must Defeat a Woman in An Abandoned Amusement Park', '''abandon'':19 ''amus'':20 ''apocalyps'':1 ''astound'':4 ''defeat'':14 ''dog'':8 ''flamingo'':2 ''must'':13 ''park'':21 ''squirrel'':11 ''stori'':5 ''woman'':16', '1', '2013-05-26T14:50:58.951000', 119, 'R', 2006, 6, '4.99', '11.99', ARRAY['Trailers', 'Commentaries']::text[], 'Apocalypse Flamingos'), + ('A Thrilling Documentary of a Car And a Student who must Sink a Hunter in The Canadian Rockies', '''bird'':1 ''canadian'':19 ''car'':8 ''documentari'':5 ''hunter'':16 ''independ'':2 ''must'':13 ''rocki'':20 ''sink'':14 ''student'':11 ''thrill'':4', '1', '2013-05-26T14:50:58.951000', 163, 'G', 2006, 6, '4.99', '14.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Bird Independence'), + ('A Fanciful Display of a Teacher And a Crocodile who must Succumb a Girl in A Baloon', '''baloon'':19 ''club'':2 ''crocodil'':11 ''display'':5 ''fanci'':4 ''girl'':16 ''must'':13 ''panic'':1 ''succumb'':14 ''teacher'':8', '1', '2013-05-26T14:50:58.951000', 102, 'G', 2006, 3, '4.99', '15.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Panic Club'), + ('A Amazing Saga of a Woman And a Womanizer who must Discover a Cat in The First Manned Space Station', '''amaz'':4 ''cat'':16 ''discov'':14 ''first'':19 ''glori'':1 ''man'':20 ''must'':13 ''saga'':5 ''space'':21 ''station'':22 ''traci'':2 ''woman'':8,11', '1', '2013-05-26T14:50:58.951000', 115, 'PG-13', 2006, 7, '2.99', '13.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Glory Tracy'), + ('A Fateful Tale of a Mad Cow And a Crocodile who must Meet a Husband in New Orleans', '''cabin'':2 ''cow'':9 ''crocodil'':12 ''fate'':4 ''husband'':17 ''mad'':8 ''meet'':15 ''must'':14 ''new'':19 ''orlean'':20 ''shock'':1 ''tale'':5', '1', '2013-05-26T14:50:58.951000', 79, 'PG-13', 2006, 7, '2.99', '15.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Shock Cabin'), + ('A Amazing Saga of a Dog And a A Shark who must Challenge a Cat in The Sahara Desert', '''amaz'':4 ''betray'':2 ''cat'':17 ''challeng'':15 ''desert'':21 ''dog'':8 ''must'':14 ''order'':1 ''saga'':5 ''sahara'':20 ''shark'':12', '1', '2013-05-26T14:50:58.951000', 120, 'PG-13', 2006, 7, '2.99', '13.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Order Betrayed'), + ('A Fanciful Character Study of a Secret Agent And a Mad Scientist who must Reach a Teacher in Australia', '''agent'':10 ''australia'':21 ''boondock'':2 ''charact'':5 ''fanci'':4 ''mad'':13 ''must'':16 ''reach'':17 ''scientist'':14 ''secret'':9 ''studi'':6 ''teacher'':19 ''vacat'':1', '1', '2013-05-26T14:50:58.951000', 145, 'R', 2006, 4, '2.99', '23.99', ARRAY['Commentaries']::text[], 'Vacation Boondock'), + ('A Boring Drama of a Explorer And a Man who must Kill a Lumberjack in A Manhattan Penthouse', '''argonaut'':2 ''blood'':1 ''bore'':4 ''drama'':5 ''explor'':8 ''kill'':14 ''lumberjack'':16 ''man'':11 ''manhattan'':19 ''must'':13 ''penthous'':20', '1', '2013-05-26T14:50:58.951000', 71, 'G', 2006, 3, '0.99', '13.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Blood Argonauts'), + ('A Touching Epistle of a Madman And a Mad Cow who must Defeat a Student in Nigeria', '''arabia'':1 ''cow'':12 ''defeat'':15 ''dogma'':2 ''epistl'':5 ''mad'':11 ''madman'':8 ''must'':14 ''nigeria'':19 ''student'':17 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 62, 'NC-17', 2006, 6, '0.99', '29.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Arabia Dogma'), + ('A Touching Reflection of a Mad Scientist And a Boat who must Face a Moose in A Shark Tank', '''boat'':12 ''discipl'':1 ''face'':15 ''mad'':8 ''moos'':17 ''mother'':2 ''must'':14 ''reflect'':5 ''scientist'':9 ''shark'':20 ''tank'':21 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 141, 'PG', 2006, 3, '0.99', '17.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Disciple Mother'), + ('A Fateful Yarn of a Secret Agent And a Feminist who must Find a Feminist in A Jet Boat', '''agent'':9 ''boat'':21 ''fate'':4 ''feminist'':12,17 ''find'':15 ''jet'':20 ''licens'':2 ''must'':14 ''secret'':8 ''shrek'':1 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 154, 'PG-13', 2006, 7, '2.99', '15.99', ARRAY['Commentaries']::text[], 'Shrek License'), + ('A Thoughtful Epistle of a Dog And a Feminist who must Chase a Composer in Berlin', '''berlin'':18 ''chase'':14 ''compos'':16 ''dog'':8 ''elf'':2 ''epistl'':5 ''feminist'':11 ''ghostbust'':1 ''must'':13 ''thought'':4', '1', '2013-05-26T14:50:58.951000', 101, 'R', 2006, 7, '0.99', '18.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Ghostbusters Elf'), + ('A Emotional Documentary of a Moose And a Car who must Redeem a Mad Cow in A Baloon Factory', '''baloon'':20 ''car'':11 ''cow'':17 ''documentari'':5 ''emot'':4 ''factori'':21 ''mad'':16 ''moos'':8 ''must'':13 ''pari'':2 ''redeem'':14 ''santa'':1', '1', '2013-05-26T14:50:58.951000', 154, 'PG', 2006, 7, '2.99', '23.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Santa Paris'), + ('A Fateful Panorama of a Moose And a Dog who must Chase a Crocodile in Ancient Japan', '''ancient'':18 ''chase'':14 ''crocodil'':16 ''dog'':11 ''fate'':4 ''groundhog'':2 ''japan'':19 ''midsumm'':1 ''moos'':8 ''must'':13 ''panorama'':5', '1', '2013-05-26T14:50:58.951000', 48, 'G', 2006, 3, '4.99', '27.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Midsummer Groundhog'), + ('A Astounding Epistle of a Technical Writer And a Teacher who must Fight a Squirrel in The Sahara Desert', '''astound'':4 ''closer'':2 ''desert'':21 ''epistl'':5 ''fight'':15 ''must'':14 ''orient'':1 ''sahara'':20 ''squirrel'':17 ''teacher'':12 ''technic'':8 ''writer'':9', '1', '2013-05-26T14:50:58.951000', 118, 'R', 2006, 3, '2.99', '22.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Orient Closer'), + ('A Epic Character Study of a Frisbee And a Moose who must Outgun a Technical Writer in A Shark Tank', '''aladdin'':2 ''charact'':5 ''epic'':4 ''frisbe'':9 ''impact'':1 ''moos'':12 ''must'':14 ''outgun'':15 ''shark'':21 ''studi'':6 ''tank'':22 ''technic'':17 ''writer'':18', '1', '2013-05-26T14:50:58.951000', 180, 'PG-13', 2006, 6, '0.99', '20.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Impact Aladdin'), + ('A Emotional Reflection of a Teacher And a Man who must Meet a Cat in The First Manned Space Station', '''anonym'':2 ''bilko'':1 ''cat'':16 ''emot'':4 ''first'':19 ''man'':11,20 ''meet'':14 ''must'':13 ''reflect'':5 ''space'':21 ''station'':22 ''teacher'':8', '1', '2013-05-26T14:50:58.951000', 100, 'PG-13', 2006, 3, '4.99', '25.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Bilko Anonymous'), + ('A Thrilling Panorama of a Technical Writer And a Car who must Discover a Forensic Psychologist in A Shark Tank', '''car'':12 ''discov'':15 ''forens'':17 ''joon'':1 ''must'':14 ''northwest'':2 ''panorama'':5 ''psychologist'':18 ''shark'':21 ''tank'':22 ''technic'':8 ''thrill'':4 ''writer'':9', '1', '2013-05-26T14:50:58.951000', 105, 'NC-17', 2006, 3, '0.99', '23.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Joon Northwest'), + ('A Lacklusture Yarn of a Feminist And a Database Administrator who must Face a Hunter in New Orleans', '''administr'':12 ''butch'':1 ''databas'':11 ''face'':15 ''feminist'':8 ''hunter'':17 ''lacklustur'':4 ''must'':14 ''new'':19 ''orlean'':20 ''panther'':2 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 67, 'PG-13', 2006, 6, '0.99', '19.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Butch Panther'), + ('A Thrilling Panorama of a Database Administrator And a Astronaut who must Challenge a Lumberjack in A Baloon', '''administr'':9 ''astronaut'':12 ''baloon'':20 ''bound'':1 ''challeng'':15 ''cheaper'':2 ''databas'':8 ''lumberjack'':17 ''must'':14 ''panorama'':5 ''thrill'':4', '1', '2013-05-26T14:50:58.951000', 98, 'PG', 2006, 5, '0.99', '17.99', ARRAY['Behind the Scenes']::text[], 'Bound Cheaper'), + ('A Boring Display of a Sumo Wrestler And a Husband who must Build a Waitress in The Gulf of Mexico', '''bonni'':2 ''bore'':4 ''build'':15 ''display'':5 ''gulf'':20 ''gun'':1 ''husband'':12 ''mexico'':22 ''must'':14 ''sumo'':8 ''waitress'':17 ''wrestler'':9', '1', '2013-05-26T14:50:58.951000', 100, 'G', 2006, 7, '0.99', '27.99', ARRAY['Behind the Scenes']::text[], 'Gun Bonnie'), + ('A Astounding Yarn of a Pioneer And a Crocodile who must Defeat a A Shark in The Outback', '''astound'':4 ''crocodil'':11 ''defeat'':14 ''must'':13 ''outback'':20 ''pioneer'':8 ''shark'':17 ''warlock'':1 ''werewolf'':2 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 83, 'G', 2006, 6, '2.99', '10.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Warlock Werewolf'), + ('A Insightful Saga of a Mad Scientist And a Mad Scientist who must Kill a Astronaut in An Abandoned Fun House', '''abandon'':21 ''astronaut'':18 ''fun'':22 ''hous'':23 ''indian'':1 ''insight'':4 ''kill'':16 ''love'':2 ''mad'':8,12 ''must'':15 ''saga'':5 ''scientist'':9,13', '1', '2013-05-26T14:50:58.951000', 135, 'NC-17', 2006, 4, '0.99', '26.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Indian Love'), + ('A Unbelieveable Documentary of a Database Administrator And a Frisbee who must Redeem a Mad Scientist in A Baloon Factory', '''administr'':9 ''baloon'':21 ''databas'':8 ''documentari'':5 ''factori'':22 ''frisbe'':12 ''mad'':17 ''must'':14 ''redeem'':15 ''reunion'':1 ''scientist'':18 ''unbeliev'':4 ''witch'':2', '1', '2013-05-26T14:50:58.951000', 63, 'R', 2006, 3, '0.99', '26.99', ARRAY['Commentaries']::text[], 'Reunion Witches'), + ('A Thoughtful Documentary of a Student And a Madman who must Challenge a Squirrel in A Manhattan Penthouse', '''challeng'':14 ''documentari'':5 ''madman'':11 ''manhattan'':19 ''must'':13 ''penthous'':20 ''pure'':1 ''runner'':2 ''squirrel'':16 ''student'':8 ''thought'':4', '1', '2013-05-26T14:50:58.951000', 121, 'NC-17', 2006, 3, '2.99', '25.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Pure Runner'), + ('A Boring Tale of a Dog And a Woman who must Meet a Dentist in California', '''bore'':4 ''california'':18 ''dentist'':16 ''dog'':8 ''hous'':2 ''meet'':14 ''must'':13 ''tale'':5 ''volum'':1 ''woman'':11', '1', '2013-05-26T14:50:58.951000', 132, 'PG', 2006, 7, '4.99', '12.99', ARRAY['Commentaries']::text[], 'Volume House'), + ('A Thoughtful Documentary of a Crocodile And a Robot who must Outrace a Womanizer in The Outback', '''crocodil'':8 ''documentari'':5 ''madigan'':2 ''must'':13 ''outback'':19 ''outrac'':14 ''robot'':11 ''runner'':1 ''thought'':4 ''woman'':16', '1', '2013-05-26T14:50:58.951000', 101, 'NC-17', 2006, 6, '0.99', '27.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Runner Madigan'), + ('A Boring Character Study of a Car And a Husband who must Outgun a Frisbee in The First Manned Space Station', '''bore'':4 ''car'':9 ''charact'':5 ''duck'':2 ''first'':20 ''frisbe'':17 ''husband'':12 ''man'':21 ''must'':14 ''outgun'':15 ''someth'':1 ''space'':22 ''station'':23 ''studi'':6', '1', '2013-05-26T14:50:58.951000', 180, 'NC-17', 2006, 4, '4.99', '17.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Something Duck'), + ('A Intrepid Story of a Sumo Wrestler And a Teacher who must Meet a A Shark in An Abandoned Fun House', '''abandon'':21 ''fun'':22 ''hous'':23 ''intrepid'':4 ''meet'':15 ''mission'':1 ''must'':14 ''shark'':18 ''stori'':5 ''sumo'':8 ''teacher'':12 ''wrestler'':9 ''zooland'':2', '1', '2013-05-26T14:50:58.951000', 164, 'PG-13', 2006, 3, '4.99', '26.99', ARRAY['Behind the Scenes']::text[], 'Mission Zoolander'), + ('A Unbelieveable Character Study of a Mad Scientist And a Astronaut who must Find a Pioneer in A Manhattan Penthouse', '''astronaut'':13 ''charact'':5 ''find'':16 ''mad'':9 ''manhattan'':21 ''must'':15 ''noon'':1 ''papi'':2 ''penthous'':22 ''pioneer'':18 ''scientist'':10 ''studi'':6 ''unbeliev'':4', '1', '2013-05-26T14:50:58.951000', 57, 'G', 2006, 5, '2.99', '12.99', ARRAY['Behind the Scenes']::text[], 'Noon Papi'), + ('A Fanciful Story of a Technical Writer And a Squirrel who must Defeat a Dog in The Gulf of Mexico', '''defeat'':15 ''dog'':17 ''fanci'':4 ''gulf'':20 ''hellfight'':2 ''mexico'':22 ''must'':14 ''spoiler'':1 ''squirrel'':12 ''stori'':5 ''technic'':8 ''writer'':9', '1', '2013-05-26T14:50:58.951000', 151, 'G', 2006, 4, '0.99', '26.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Spoilers Hellfighters'), + ('A Epic Tale of a Pioneer And a Hunter who must Escape a Girl in A U-Boat', '''boat'':21 ''club'':1 ''epic'':4 ''escap'':14 ''girl'':16 ''graffiti'':2 ''hunter'':11 ''must'':13 ''pioneer'':8 ''tale'':5 ''u'':20 ''u-boat'':19', '1', '2013-05-26T14:50:58.951000', 65, 'PG-13', 2006, 4, '0.99', '12.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Club Graffiti'), + ('A Amazing Yarn of a Hunter And a Butler who must Defeat a Boy in A Jet Boat', '''amaz'':4 ''boat'':20 ''boy'':16 ''butler'':11 ''defeat'':14 ''hunter'':8 ''jericho'':1 ''jet'':19 ''mulan'':2 ''must'':13 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 171, 'NC-17', 2006, 3, '2.99', '29.99', ARRAY['Commentaries']::text[], 'Jericho Mulan'), + ('A Emotional Drama of a Womanizer And a Squirrel who must Vanquish a Crocodile in Ancient India', '''ancient'':18 ''creatur'':1 ''crocodil'':16 ''drama'':5 ''emot'':4 ''india'':19 ''must'':13 ''shakespear'':2 ''squirrel'':11 ''vanquish'':14 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 139, 'NC-17', 2006, 3, '0.99', '23.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Creatures Shakespeare'), + ('A Fast-Paced Display of a Robot And a Butler who must Defeat a Butler in A MySQL Convention', '''butler'':13,18 ''convent'':22 ''defeat'':16 ''display'':7 ''fast'':5 ''fast-pac'':4 ''must'':15 ''mysql'':21 ''pace'':6 ''robot'':10 ''soup'':1 ''wisdom'':2', '1', '2013-05-26T14:50:58.951000', 169, 'R', 2006, 6, '0.99', '12.99', ARRAY['Behind the Scenes']::text[], 'Soup Wisdom'), + ('A Taut Drama of a Cat And a Girl who must Defeat a Frisbee in The Canadian Rockies', '''canadian'':19 ''cat'':8 ''defeat'':14 ''dozen'':1 ''drama'':5 ''frisbe'':16 ''girl'':11 ''lion'':2 ''must'':13 ''rocki'':20 ''taut'':4', '1', '2013-05-26T14:50:58.951000', 177, 'NC-17', 2006, 6, '4.99', '20.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Dozen Lion'), + ('A Thoughtful Drama of a Husband And a Secret Agent who must Pursue a Database Administrator in Ancient India', '''administr'':18 ''agent'':12 ''ancient'':20 ''databas'':17 ''drama'':5 ''husband'':8 ''india'':21 ''massacr'':2 ''must'':14 ''outfield'':1 ''pursu'':15 ''secret'':11 ''thought'':4', '1', '2013-05-26T14:50:58.951000', 129, 'NC-17', 2006, 4, '0.99', '18.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Outfield Massacre'), + ('A Fanciful Documentary of a Pioneer And a Woman who must Redeem a Hunter in Ancient Japan', '''ancient'':18 ''detect'':1 ''documentari'':5 ''fanci'':4 ''hunter'':16 ''japan'':19 ''must'':13 ''pioneer'':8 ''redeem'':14 ''vision'':2 ''woman'':11', '1', '2013-05-26T14:50:58.951000', 143, 'PG-13', 2006, 4, '0.99', '16.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Detective Vision'), + ('A Fateful Yarn of a Womanizer And a Feminist who must Succumb a Database Administrator in Ancient India', '''administr'':17 ''ancient'':19 ''antitrust'':1 ''databas'':16 ''fate'':4 ''feminist'':11 ''india'':20 ''must'':13 ''succumb'':14 ''tomato'':2 ''woman'':8 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 168, 'NC-17', 2006, 5, '2.99', '11.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Antitrust Tomatoes'), + ('A Insightful Story of a Man And a Husband who must Overcome a Madman in A Monastery', '''husband'':11 ''insight'':4 ''licens'':1 ''madman'':16 ''man'':8 ''monasteri'':19 ''must'':13 ''overcom'':14 ''stori'':5 ''weekend'':2', '1', '2013-05-26T14:50:58.951000', 91, 'NC-17', 2006, 7, '2.99', '28.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'License Weekend'), + ('A Intrepid Drama of a Butler And a Lumberjack who must Challenge a Database Administrator in A Manhattan Penthouse', '''administr'':17 ''butler'':8 ''challeng'':14 ''databas'':16 ''drama'':5 ''intrepid'':4 ''lion'':2 ''lumberjack'':11 ''manhattan'':20 ''must'':13 ''penthous'':21 ''west'':1', '1', '2013-05-26T14:50:58.951000', 159, 'G', 2006, 4, '4.99', '29.99', ARRAY['Trailers']::text[], 'West Lion'), + ('A Beautiful Yarn of a Forensic Psychologist And a Frisbee who must Battle a Moose in A Jet Boat', '''battl'':15 ''beauti'':4 ''boat'':21 ''forens'':8 ''frisbe'':12 ''gun'':2 ''heaven'':1 ''jet'':20 ''moos'':17 ''must'':14 ''psychologist'':9 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 49, 'NC-17', 2006, 5, '4.99', '13.99', ARRAY['Behind the Scenes']::text[], 'Heavenly Gun'), + ('A Emotional Story of a Squirrel And a Crocodile who must Succumb a Husband in The Sahara Desert', '''crocodil'':11 ''desert'':20 ''emot'':4 ''husband'':16 ''midnight'':2 ''must'':13 ''sabrina'':1 ''sahara'':19 ''squirrel'':8 ''stori'':5 ''succumb'':14', '1', '2013-05-26T14:50:58.951000', 99, 'PG', 2006, 5, '4.99', '11.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Sabrina Midnight'), + ('A Insightful Reflection of a Pioneer And a Teacher who must Build a Composer in The First Manned Space Station', '''build'':14 ''compos'':16 ''doll'':2 ''first'':19 ''insight'':4 ''kiss'':1 ''man'':20 ''must'':13 ''pioneer'':8 ''reflect'':5 ''space'':21 ''station'':22 ''teacher'':11', '1', '2013-05-26T14:50:58.951000', 141, 'R', 2006, 3, '4.99', '9.99', ARRAY['Trailers']::text[], 'Kissing Dolls'), + ('A Emotional Tale of a Pastry Chef And a Forensic Psychologist who must Succumb a Monkey in The Sahara Desert', '''chef'':9 ''desert'':22 ''downhil'':1 ''emot'':4 ''enough'':2 ''forens'':12 ''monkey'':18 ''must'':15 ''pastri'':8 ''psychologist'':13 ''sahara'':21 ''succumb'':16 ''tale'':5', '1', '2013-05-26T14:50:58.951000', 47, 'G', 2006, 3, '0.99', '19.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Downhill Enough'), + ('A Lacklusture Display of a Explorer And a Hunter who must Succumb a Database Administrator in A Baloon Factory', '''administr'':17 ''baloon'':20 ''craft'':1 ''databas'':16 ''display'':5 ''explor'':8 ''factori'':21 ''hunter'':11 ''lacklustur'':4 ''must'':13 ''outfield'':2 ''succumb'':14', '1', '2013-05-26T14:50:58.951000', 64, 'NC-17', 2006, 6, '0.99', '17.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Craft Outfield'), + ('A Touching Documentary of a Dentist And a Sumo Wrestler who must Overcome a Boy in The Gulf of Mexico', '''boy'':17 ''dentist'':8 ''documentari'':5 ''gulf'':20 ''mexico'':22 ''must'':14 ''overcom'':15 ''panki'':1 ''submarin'':2 ''sumo'':11 ''touch'':4 ''wrestler'':12', '1', '2013-05-26T14:50:58.951000', 93, 'G', 2006, 4, '4.99', '19.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Panky Submarine'), + ('A Intrepid Yarn of a Monkey And a Boy who must Fight a Composer in A Manhattan Penthouse', '''boy'':11 ''compos'':16 ''fight'':14 ''intrepid'':4 ''jacket'':2 ''manhattan'':19 ''monkey'':8 ''must'':13 ''penthous'':20 ''school'':1 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 151, 'PG-13', 2006, 5, '4.99', '21.99', ARRAY['Trailers']::text[], 'School Jacket'), + ('A Amazing Display of a Car And a Monkey who must Fight a Teacher in Soviet Georgia', '''amaz'':4 ''bed'':2 ''car'':8 ''display'':5 ''fight'':14 ''georgia'':19 ''monkey'':11 ''must'':13 ''soviet'':18 ''submarin'':1 ''teacher'':16', '1', '2013-05-26T14:50:58.951000', 127, 'R', 2006, 5, '4.99', '21.99', ARRAY['Trailers']::text[], 'Submarine Bed'), + ('A Epic Yarn of a Cat And a Madman who must Vanquish a Dentist in An Abandoned Amusement Park', '''abandon'':19 ''amus'':20 ''cat'':8 ''cowboy'':2 ''dentist'':16 ''epic'':4 ''languag'':1 ''madman'':11 ''must'':13 ''park'':21 ''vanquish'':14 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 78, 'NC-17', 2006, 5, '0.99', '26.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Language Cowboy'), + ('A Intrepid Tale of a Pioneer And a Moose who must Conquer a Frisbee in A MySQL Convention', '''calendar'':2 ''conquer'':14 ''convent'':20 ''frisbe'':16 ''gather'':1 ''intrepid'':4 ''moos'':11 ''must'':13 ''mysql'':19 ''pioneer'':8 ''tale'':5', '1', '2013-05-26T14:50:58.951000', 176, 'PG-13', 2006, 4, '0.99', '22.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Gathering Calendar'), + ('A Touching Reflection of a Man And a Man who must Sink a Robot in The Outback', '''hamlet'':1 ''man'':8,11 ''must'':13 ''outback'':19 ''reflect'':5 ''robot'':16 ''sink'':14 ''touch'':4 ''wisdom'':2', '1', '2013-05-26T14:50:58.951000', 146, 'R', 2006, 7, '2.99', '21.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Hamlet Wisdom'), + ('A Boring Tale of a Husband And a Boy who must Fight a Squirrel in Ancient China', '''ancient'':18 ''bore'':4 ''boy'':11 ''china'':19 ''fight'':14 ''husband'':8 ''mother'':1 ''must'':13 ''oleand'':2 ''squirrel'':16 ''tale'':5', '1', '2013-05-26T14:50:58.951000', 103, 'R', 2006, 3, '0.99', '20.99', ARRAY['Trailers', 'Commentaries']::text[], 'Mother Oleander'), + ('A Thoughtful Character Study of a Squirrel And a Technical Writer who must Outrace a Student in Ancient Japan', '''ancient'':20 ''charact'':5 ''japan'':21 ''lock'':1 ''must'':15 ''outrac'':16 ''rear'':2 ''squirrel'':9 ''student'':18 ''studi'':6 ''technic'':12 ''thought'':4 ''writer'':13', '1', '2013-05-26T14:50:58.951000', 120, 'R', 2006, 7, '2.99', '10.99', ARRAY['Trailers', 'Commentaries']::text[], 'Lock Rear'), + ('A Awe-Inspiring Drama of a Secret Agent And a Hunter who must Fight a Moose in Nigeria', '''agent'':11 ''awe'':5 ''awe-inspir'':4 ''drama'':7 ''fight'':17 ''hunter'':14 ''inspir'':6 ''moos'':19 ''must'':16 ''nigeria'':21 ''panic'':2 ''secret'':10 ''witch'':1', '1', '2013-05-26T14:50:58.951000', 100, 'NC-17', 2006, 6, '4.99', '10.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Witches Panic'), + ('A Fateful Documentary of a Robot And a Student who must Battle a Cat in A Monastery', '''anthem'':2 ''battl'':14 ''cat'':16 ''control'':1 ''documentari'':5 ''fate'':4 ''monasteri'':19 ''must'':13 ''robot'':8 ''student'':11', '1', '2013-05-26T14:50:58.951000', 185, 'G', 2006, 7, '4.99', '9.99', ARRAY['Commentaries']::text[], 'Control Anthem'), + ('A Epic Documentary of a Hunter And a Dog who must Outgun a Dog in A Baloon Factory', '''baloon'':19 ''documentari'':5 ''dog'':11,16 ''epic'':4 ''factori'':20 ''hunter'':8 ''igbi'':1 ''maker'':2 ''must'':13 ''outgun'':14', '1', '2013-05-26T14:50:58.951000', 160, 'NC-17', 2006, 7, '4.99', '12.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Igby Maker'), + ('A Intrepid Reflection of a Technical Writer And a Hunter who must Defeat a Sumo Wrestler in A Monastery', '''defeat'':15 ''hunter'':12 ''intrepid'':4 ''mile'':2 ''monasteri'':21 ''must'':14 ''reflect'':5 ''sumo'':17 ''technic'':8 ''wrath'':1 ''wrestler'':18 ''writer'':9', '1', '2013-05-26T14:50:58.951000', 176, 'NC-17', 2006, 5, '0.99', '17.99', ARRAY['Trailers', 'Commentaries']::text[], 'Wrath Mile'), + ('A Astounding Display of a Forensic Psychologist And a Mad Scientist who must Challenge a Girl in New Orleans', '''astound'':4 ''challeng'':16 ''display'':5 ''forens'':8 ''forward'':1 ''girl'':18 ''mad'':12 ''must'':15 ''new'':20 ''orlean'':21 ''psychologist'':9 ''scientist'':13 ''templ'':2', '1', '2013-05-26T14:50:58.951000', 90, 'NC-17', 2006, 6, '2.99', '25.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Forward Temple'), + ('A Action-Packed Story of a Frisbee And a Woman who must Reach a Girl in An Abandoned Mine Shaft', '''abandon'':21 ''action'':5 ''action-pack'':4 ''elf'':1 ''frisbe'':10 ''girl'':18 ''mine'':22 ''murder'':2 ''must'':15 ''pack'':6 ''reach'':16 ''shaft'':23 ''stori'':7 ''woman'':13', '1', '2013-05-26T14:50:58.951000', 155, 'NC-17', 2006, 4, '4.99', '19.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Elf Murder'), + ('A Intrepid Display of a Madman And a Feminist who must Pursue a Pioneer in The First Manned Space Station', '''display'':5 ''feminist'':11 ''first'':19 ''grinch'':1 ''intrepid'':4 ''madman'':8 ''man'':20 ''massag'':2 ''must'':13 ''pioneer'':16 ''pursu'':14 ''space'':21 ''station'':22', '1', '2013-05-26T14:50:58.951000', 150, 'R', 2006, 7, '4.99', '25.99', ARRAY['Trailers']::text[], 'Grinch Massage'), + ('A Fanciful Character Study of a Monkey And a Explorer who must Build a Astronaut in An Abandoned Fun House', '''abandon'':20 ''astronaut'':17 ''build'':15 ''candl'':1 ''charact'':5 ''explor'':12 ''fanci'':4 ''fun'':21 ''grape'':2 ''hous'':22 ''monkey'':9 ''must'':14 ''studi'':6', '1', '2013-05-26T14:50:58.951000', 135, 'NC-17', 2006, 6, '4.99', '15.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Candles Grapes'), + ('A Taut Reflection of a A Shark And a Dentist who must Battle a Boat in Soviet Georgia', '''battl'':15 ''boat'':17 ''dentist'':12 ''georgia'':20 ''hellfight'':1 ''must'':14 ''reflect'':5 ''shark'':9 ''sierra'':2 ''soviet'':19 ''taut'':4', '1', '2013-05-26T14:50:58.951000', 75, 'PG', 2006, 3, '2.99', '23.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Hellfighters Sierra'), + ('A Epic Drama of a Feminist And a Pioneer who must Sink a Composer in New Orleans', '''compos'':16 ''drama'':5 ''epic'':4 ''feminist'':8 ''fool'':2 ''moonwalk'':1 ''must'':13 ''new'':18 ''orlean'':19 ''pioneer'':11 ''sink'':14', '1', '2013-05-26T14:50:58.951000', 184, 'G', 2006, 5, '4.99', '12.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Moonwalker Fool'), + ('A Beautiful Drama of a Student And a Secret Agent who must Confront a Dentist in Ancient Japan', '''agent'':12 ''ancient'':19 ''beauti'':4 ''confront'':15 ''dentist'':17 ''drama'':5 ''fatal'':1 ''haunt'':2 ''japan'':20 ''must'':14 ''secret'':11 ''student'':8', '1', '2013-05-26T14:50:58.951000', 91, 'PG', 2006, 6, '2.99', '24.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Fatal Haunted'), + ('A Fanciful Drama of a Moose And a Squirrel who must Conquer a Pioneer in The Canadian Rockies', '''bull'':1 ''canadian'':19 ''conquer'':14 ''drama'':5 ''fanci'':4 ''moos'':8 ''must'':13 ''pioneer'':16 ''rocki'':20 ''shawshank'':2 ''squirrel'':11', '1', '2013-05-26T14:50:58.951000', 125, 'NC-17', 2006, 6, '0.99', '21.99', ARRAY['Deleted Scenes']::text[], 'Bull Shawshank'), + ('A Emotional Character Study of a Boat And a Pioneer who must Find a Explorer in A Shark Tank', '''betray'':1 ''boat'':9 ''charact'':5 ''emot'':4 ''explor'':17 ''find'':15 ''must'':14 ''pioneer'':12 ''rear'':2 ''shark'':20 ''studi'':6 ''tank'':21', '1', '2013-05-26T14:50:58.951000', 122, 'NC-17', 2006, 5, '4.99', '26.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Betrayed Rear'), + ('A Insightful Drama of a Car And a Composer who must Fight a Man in A Monastery', '''car'':8 ''compos'':11 ''drama'':5 ''fight'':14 ''idol'':1 ''insight'':4 ''man'':16 ''monasteri'':19 ''must'':13 ''snatcher'':2', '1', '2013-05-26T14:50:58.951000', 84, 'NC-17', 2006, 5, '2.99', '29.99', ARRAY['Trailers']::text[], 'Idols Snatchers'), + ('A Insightful Character Study of a Girl And a Car who must Pursue a Mad Cow in A Shark Tank', '''car'':12 ''charact'':5 ''cow'':18 ''girl'':9 ''insight'':4 ''mad'':17 ''must'':14 ''oper'':2 ''pursu'':15 ''shark'':21 ''star'':1 ''studi'':6 ''tank'':22', '1', '2013-05-26T14:50:58.951000', 181, 'PG', 2006, 5, '2.99', '9.99', ARRAY['Commentaries']::text[], 'Star Operation'), + ('A Boring Tale of a Composer And a Mad Cow who must Defeat a Car in The Outback', '''bore'':4 ''car'':17 ''compos'':8 ''cow'':12 ''defeat'':15 ''ident'':1 ''lover'':2 ''mad'':11 ''must'':14 ''outback'':20 ''tale'':5', '1', '2013-05-26T14:50:58.951000', 119, 'PG-13', 2006, 4, '2.99', '12.99', ARRAY['Deleted Scenes']::text[], 'Identity Lover'), + ('A Epic Character Study of a Feminist And a Student who must Meet a Woman in A Baloon', '''baloon'':20 ''charact'':5 ''epic'':4 ''feminist'':9 ''jingl'':1 ''meet'':15 ''must'':14 ''sagebrush'':2 ''student'':12 ''studi'':6 ''woman'':17', '1', '2013-05-26T14:50:58.951000', 124, 'PG-13', 2006, 6, '4.99', '29.99', ARRAY['Trailers', 'Commentaries']::text[], 'Jingle Sagebrush'), + ('A Touching Saga of a Hunter And a Butler who must Discover a Butler in A Jet Boat', '''airplan'':1 ''boat'':20 ''butler'':11,16 ''discov'':14 ''hunter'':8 ''jet'':19 ''must'':13 ''saga'':5 ''sierra'':2 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 62, 'PG-13', 2006, 6, '4.99', '28.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Airplane Sierra'), + ('A Insightful Saga of a Astronaut And a Explorer who must Pursue a Mad Scientist in A U-Boat', '''astronaut'':8 ''boat'':22 ''explor'':11 ''hunger'':2 ''insight'':4 ''mad'':16 ''must'':13 ''pursu'':14 ''saga'':5 ''scientist'':17 ''tie'':1 ''u'':21 ''u-boat'':20', '1', '2013-05-26T14:50:58.951000', 111, 'R', 2006, 3, '4.99', '28.99', ARRAY['Deleted Scenes']::text[], 'Ties Hunger'), + ('A Thrilling Tale of a Technical Writer And a Boy who must Face a Pioneer in A Monastery', '''boy'':12 ''face'':15 ''hotel'':2 ''independ'':1 ''monasteri'':20 ''must'':14 ''pioneer'':17 ''tale'':5 ''technic'':8 ''thrill'':4 ''writer'':9', '1', '2013-05-26T14:50:58.951000', 157, 'NC-17', 2006, 5, '0.99', '21.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Independence Hotel'), + ('A Fast-Paced Tale of a Car And a Dog who must Outgun a A Shark in Australia', '''australia'':21 ''car'':10 ''dog'':13 ''fast'':5 ''fast-pac'':4 ''must'':15 ''outgun'':16 ''pace'':6 ''shark'':19 ''stallion'':1 ''sundanc'':2 ''tale'':7', '1', '2013-05-26T14:50:58.951000', 130, 'PG-13', 2006, 5, '0.99', '23.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Stallion Sundance'), + ('A Thoughtful Epistle of a Madman And a Astronaut who must Overcome a Monkey in A Shark Tank', '''astronaut'':11 ''epistl'':5 ''hellfight'':2 ''madman'':8 ''monkey'':16 ''must'':13 ''overcom'':14 ''shark'':19 ''tank'':20 ''thought'':4 ''tomato'':1', '1', '2013-05-26T14:50:58.951000', 68, 'PG', 2006, 6, '0.99', '23.99', ARRAY['Behind the Scenes']::text[], 'Tomatoes Hellfighters'), + ('A Boring Epistle of a Boat And a Database Administrator who must Kill a Sumo Wrestler in The First Manned Space Station', '''administr'':12 ''boat'':8 ''bore'':4 ''chitti'':1 ''databas'':11 ''epistl'':5 ''first'':21 ''kill'':15 ''lock'':2 ''man'':22 ''must'':14 ''space'':23 ''station'':24 ''sumo'':17 ''wrestler'':18', '1', '2013-05-26T14:50:58.951000', 107, 'G', 2006, 6, '2.99', '24.99', ARRAY['Commentaries']::text[], 'Chitty Lock'), + ('A Insightful Story of a Man And a Feminist who must Fight a Composer in Australia', '''australia'':18 ''cincinatti'':2 ''compos'':16 ''feminist'':11 ''fight'':14 ''insight'':4 ''lamb'':1 ''man'':8 ''must'':13 ''stori'':5', '1', '2013-05-26T14:50:58.951000', 144, 'PG-13', 2006, 6, '4.99', '18.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Lambs Cincinatti'), + ('A Brilliant Documentary of a Womanizer And a Squirrel who must Find a Technical Writer in The Sahara Desert', '''ace'':2 ''brilliant'':4 ''desert'':21 ''documentari'':5 ''find'':14 ''million'':1 ''must'':13 ''sahara'':20 ''squirrel'':11 ''technic'':16 ''woman'':8 ''writer'':17', '1', '2013-05-26T14:50:58.951000', 142, 'PG-13', 2006, 4, '4.99', '16.99', ARRAY['Deleted Scenes']::text[], 'Million Ace'), + ('A Intrepid Character Study of a Moose And a Waitress who must Find a A Shark in Ancient India', '''ancient'':20 ''charact'':5 ''find'':15 ''india'':21 ''intrepid'':4 ''labyrinth'':2 ''moos'':9 ''must'':14 ''newton'':1 ''shark'':18 ''studi'':6 ''waitress'':12', '1', '2013-05-26T14:50:58.951000', 75, 'PG', 2006, 4, '0.99', '9.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Newton Labyrinth'), + ('A Thoughtful Story of a Mad Scientist And a Waitress who must Confront a Forensic Psychologist in Soviet Georgia', '''confront'':15 ''forens'':17 ''georgia'':21 ''joon'':2 ''mad'':8 ''must'':14 ''psychologist'':18 ''robber'':1 ''scientist'':9 ''soviet'':20 ''stori'':5 ''thought'':4 ''waitress'':12', '1', '2013-05-26T14:50:58.951000', 102, 'PG-13', 2006, 7, '2.99', '26.99', ARRAY['Commentaries']::text[], 'Robbers Joon'), + ('A Boring Reflection of a Dentist And a Mad Cow who must Chase a Secret Agent in A Shark Tank', '''agent'':18 ''bore'':4 ''chase'':15 ''cow'':12 ''curtain'':1 ''dentist'':8 ''mad'':11 ''must'':14 ''reflect'':5 ''secret'':17 ''shark'':21 ''tank'':22 ''videotap'':2', '1', '2013-05-26T14:50:58.951000', 133, 'PG-13', 2006, 7, '0.99', '27.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Curtain Videotape'), + ('A Intrepid Character Study of a Robot And a Monkey who must Reach a Secret Agent in An Abandoned Amusement Park', '''abandon'':21 ''agent'':18 ''amus'':22 ''charact'':5 ''intrepid'':4 ''luke'':2 ''monkey'':12 ''must'':14 ''park'':23 ''reach'':15 ''robot'':9 ''secret'':17 ''sling'':1 ''studi'':6', '1', '2013-05-26T14:50:58.951000', 84, 'R', 2006, 5, '0.99', '10.99', ARRAY['Behind the Scenes']::text[], 'Sling Luke'), + ('A Intrepid Story of a Madman And a Secret Agent who must Outrace a Astronaut in An Abandoned Amusement Park', '''abandon'':20 ''agent'':12 ''amus'':21 ''astronaut'':17 ''egypt'':1 ''intrepid'':4 ''madman'':8 ''must'':14 ''outrac'':15 ''park'':22 ''secret'':11 ''stori'':5 ''tenenbaum'':2', '1', '2013-05-26T14:50:58.951000', 85, 'PG', 2006, 3, '0.99', '11.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Egypt Tenenbaums'), + ('A Astounding Reflection of a Lumberjack And a Car who must Sink a Lumberjack in A Baloon Factory', '''adapt'':1 ''astound'':4 ''baloon'':19 ''car'':11 ''factori'':20 ''hole'':2 ''lumberjack'':8,16 ''must'':13 ''reflect'':5 ''sink'':14', '1', '2013-05-26T14:50:58.951000', 50, 'NC-17', 2006, 7, '2.99', '18.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Adaptation Holes'), + ('A Boring Drama of a Student And a Cat who must Sink a Technical Writer in A Baloon', '''baloon'':20 ''bore'':4 ''cat'':11 ''drama'':5 ''liberti'':1 ''magnific'':2 ''must'':13 ''sink'':14 ''student'':8 ''technic'':16 ''writer'':17', '1', '2013-05-26T14:50:58.951000', 138, 'G', 2006, 3, '2.99', '27.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Liberty Magnificent'), + ('A Intrepid Yarn of a Explorer And a Pastry Chef who must Pursue a Mad Cow in A U-Boat', '''boat'':23 ''chef'':12 ''cow'':18 ''explor'':8 ''intrepid'':4 ''mad'':17 ''must'':14 ''pastri'':11 ''pursu'':15 ''suicid'':2 ''u'':22 ''u-boat'':21 ''uncut'':1 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 172, 'PG-13', 2006, 7, '2.99', '29.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Uncut Suicides'), + ('A Fateful Saga of a Womanizer And a Student who must Defeat a Butler in A Monastery', '''butler'':16 ''defeat'':14 ''fate'':4 ''inch'':1 ''jet'':2 ''monasteri'':19 ''must'':13 ''saga'':5 ''student'':11 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 167, 'NC-17', 2006, 6, '4.99', '18.99', ARRAY['Deleted Scenes']::text[], 'Inch Jet'), + ('A Emotional Epistle of a Squirrel And a Robot who must Confront a Lumberjack in Soviet Georgia', '''confront'':14 ''emot'':4 ''epistl'':5 ''georgia'':19 ''lumberjack'':16 ''must'':13 ''patient'':1 ''robot'':11 ''sister'':2 ''soviet'':18 ''squirrel'':8', '1', '2013-05-26T14:50:58.951000', 99, 'NC-17', 2006, 7, '0.99', '29.99', ARRAY['Trailers', 'Commentaries']::text[], 'Patient Sister'), + ('A Awe-Inspiring Drama of a Girl And a Technical Writer who must Meet a Feminist in The Canadian Rockies', '''awe'':5 ''awe-inspir'':4 ''canadian'':22 ''drama'':7 ''feminist'':19 ''girl'':10 ''inspir'':6 ''meet'':17 ''must'':16 ''rocki'':23 ''scissorhand'':1 ''slum'':2 ''technic'':13 ''writer'':14', '1', '2013-05-26T14:50:58.951000', 147, 'G', 2006, 5, '2.99', '13.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Scissorhands Slums') + ) AS data(description, fulltext, old_language_id, last_update, length, rating, release_year, rental_duration, rental_rate, replacement_cost, special_features, title) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."language"' + AND map0.old_id = data.old_language_id + RETURNING film_id + ) + SELECT array_agg(film_id) INTO v_new_ids_film FROM inserted; + + FOR i IN 1..array_length(v_new_ids_film, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."film"', v_old_ids_film[i], v_new_ids_film[i]::TEXT); + END LOOP; + + v_old_ids_film := ARRAY['651', '296', '142', '890', '727', '98', '668', '492', '322', '86', '832', '291', '796', '563', '242', '658', '199', '797', '787', '139', '976', '619', '118', '940', '363', '549', '868', '878', '677', '16', '427', '912', '551', '869', '621', '516', '243', '2', '364', '47', '347', '644', '131', '52', '167', '254', '733', '590', '690', '360', '293', '333', '730', '257', '134', '215', '571', '461', '820', '892', '641', '326', '610', '687', '402', '961', '471', '962', '981', '358', '61', '624', '413', '645', '380', '823', '768', '888', '504', '824', '431', '757', '669', '251', '810', '523', '686', '753', '830', '637', '763', '470', '8', '463', '63', '87', '141', '512', '586', '462']; + WITH inserted AS ( + INSERT INTO "public"."film" ("description", "fulltext", "language_id", "last_update", "length", "rating", "release_year", "rental_duration", "rental_rate", "replacement_cost", "special_features", "title") + SELECT + data.description::text, + data.fulltext::tsvector, + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.length::smallint, + data.rating::mpaa_rating, + data.release_year::integer, + data.rental_duration::smallint, + data.rental_rate::numeric, + data.replacement_cost::numeric, + data.special_features::text[], + data.title::character varying + FROM (VALUES + ('A Epic Display of a Sumo Wrestler And a Forensic Psychologist who must Build a Woman in An Abandoned Amusement Park', '''abandon'':21 ''amus'':22 ''build'':16 ''display'':5 ''epic'':4 ''forens'':12 ''madigan'':2 ''must'':15 ''packer'':1 ''park'':23 ''psychologist'':13 ''sumo'':8 ''woman'':18 ''wrestler'':9', '1', '2013-05-26T14:50:58.951000', 84, 'PG-13', 2006, 3, '0.99', '20.99', ARRAY['Trailers']::text[], 'Packer Madigan'), + ('A Boring Drama of a Astronaut And a Boat who must Face a Boat in California', '''astronaut'':8 ''boat'':11,16 ''bore'':4 ''california'':18 ''drama'':5 ''express'':1 ''face'':14 ''lone'':2 ''must'':13', '1', '2013-05-26T14:50:58.951000', 178, 'R', 2006, 5, '2.99', '23.99', ARRAY['Trailers']::text[], 'Express Lonely'), + ('A Emotional Drama of a Dog And a Explorer who must Outrace a Technical Writer in Australia', '''australia'':19 ''chicken'':1 ''dog'':8 ''drama'':5 ''emot'':4 ''explor'':11 ''hellfight'':2 ''must'':13 ''outrac'':14 ''technic'':16 ''writer'':17', '1', '2013-05-26T14:50:58.951000', 122, 'PG', 2006, 3, '0.99', '24.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Chicken Hellfighters'), + ('A Thrilling Epistle of a Boat And a Secret Agent who must Face a Boy in A Baloon', '''agent'':12 ''baloon'':20 ''boat'':8 ''boy'':17 ''dawn'':2 ''epistl'':5 ''face'':15 ''must'':14 ''secret'':11 ''thrill'':4 ''tight'':1', '1', '2013-05-26T14:50:58.951000', 172, 'R', 2006, 5, '0.99', '14.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Tights Dawn'), + ('A Epic Yarn of a Robot And a Explorer who must Challenge a Girl in A MySQL Convention', '''challeng'':14 ''convent'':20 ''epic'':4 ''explor'':11 ''girl'':16 ''must'':13 ''mysql'':19 ''resurrect'':1 ''robot'':8 ''silverado'':2 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 117, 'PG', 2006, 6, '0.99', '12.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Resurrection Silverado'), + ('A Fateful Yarn of a Lumberjack And a Feminist who must Conquer a Student in A Jet Boat', '''boat'':20 ''bright'':1 ''conquer'':14 ''encount'':2 ''fate'':4 ''feminist'':11 ''jet'':19 ''lumberjack'':8 ''must'':13 ''student'':16 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 73, 'PG-13', 2006, 4, '4.99', '12.99', ARRAY['Trailers']::text[], 'Bright Encounters'), + ('A Insightful Reflection of a Boat And a Secret Agent who must Vanquish a Astronaut in An Abandoned Mine Shaft', '''abandon'':20 ''agent'':12 ''astronaut'':17 ''boat'':8 ''forev'':2 ''insight'':4 ''mine'':21 ''must'':14 ''peak'':1 ''reflect'':5 ''secret'':11 ''shaft'':22 ''vanquish'':15', '1', '2013-05-26T14:50:58.951000', 80, 'PG', 2006, 7, '4.99', '25.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Peak Forever'), + ('A Boring Character Study of a Boy And a Woman who must Battle a Astronaut in Australia', '''astronaut'':17 ''australia'':19 ''battl'':15 ''bore'':4 ''boy'':9 ''charact'':5 ''closer'':2 ''jungl'':1 ''must'':14 ''studi'':6 ''woman'':12', '1', '2013-05-26T14:50:58.951000', 134, 'NC-17', 2006, 6, '0.99', '11.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Jungle Closer'), + ('A Taut Display of a Secret Agent And a Waitress who must Sink a Robot in An Abandoned Mine Shaft', '''abandon'':20 ''agent'':9 ''display'':5 ''flatlin'':1 ''killer'':2 ''mine'':21 ''must'':14 ''robot'':17 ''secret'':8 ''shaft'':22 ''sink'':15 ''taut'':4 ''waitress'':12', '1', '2013-05-26T14:50:58.951000', 100, 'G', 2006, 5, '2.99', '29.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Flatliners Killer'), + ('A Lacklusture Character Study of a Husband And a Sumo Wrestler who must Succumb a Technical Writer in The Gulf of Mexico', '''ameli'':2 ''boogi'':1 ''charact'':5 ''gulf'':22 ''husband'':9 ''lacklustur'':4 ''mexico'':24 ''must'':15 ''studi'':6 ''succumb'':16 ''sumo'':12 ''technic'':18 ''wrestler'':13 ''writer'':19', '1', '2013-05-26T14:50:58.951000', 121, 'R', 2006, 6, '4.99', '11.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Boogie Amelie'), + ('A Taut Saga of a Crocodile And a Boat who must Conquer a Hunter in A Shark Tank', '''boat'':11 ''conquer'':14 ''crocodil'':8 ''gump'':2 ''hunter'':16 ''must'':13 ''saga'':5 ''shark'':19 ''splash'':1 ''tank'':20 ''taut'':4', '1', '2013-05-26T14:50:58.951000', 175, 'PG', 2006, 5, '0.99', '16.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Splash Gump'), + ('A Fanciful Character Study of a Feminist And a Madman who must Find a Explorer in A Baloon Factory', '''alter'':2 ''baloon'':20 ''charact'':5 ''evolut'':1 ''explor'':17 ''factori'':21 ''fanci'':4 ''feminist'':9 ''find'':15 ''madman'':12 ''must'':14 ''studi'':6', '1', '2013-05-26T14:50:58.951000', 174, 'PG-13', 2006, 5, '0.99', '10.99', ARRAY['Behind the Scenes']::text[], 'Evolution Alter'), + ('A Emotional Character Study of a Frisbee And a Mad Scientist who must Build a Madman in California', '''build'':16 ''california'':20 ''charact'':5 ''divid'':2 ''emot'':4 ''frisbe'':9 ''mad'':12 ''madman'':18 ''must'':15 ''scientist'':13 ''sierra'':1 ''studi'':6', '1', '2013-05-26T14:50:58.951000', 135, 'NC-17', 2006, 3, '0.99', '12.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Sierra Divide'), + ('A Fateful Reflection of a Waitress And a Crocodile who must Challenge a Forensic Psychologist in California', '''california'':19 ''challeng'':14 ''crocodil'':11 ''fate'':4 ''forens'':16 ''massacr'':1 ''must'':13 ''psychologist'':17 ''reflect'':5 ''usual'':2 ''waitress'':8', '1', '2013-05-26T14:50:58.951000', 165, 'R', 2006, 6, '4.99', '16.99', ARRAY['Commentaries']::text[], 'Massacre Usual'), + ('A Astounding Panorama of a Car And a Mad Scientist who must Battle a Lumberjack in A MySQL Convention', '''astound'':4 ''battl'':15 ''car'':8 ''convent'':21 ''danc'':2 ''doom'':1 ''lumberjack'':17 ''mad'':11 ''must'':14 ''mysql'':20 ''panorama'':5 ''scientist'':12', '1', '2013-05-26T14:50:58.951000', 68, 'R', 2006, 4, '0.99', '13.99', ARRAY['Trailers', 'Commentaries']::text[], 'Doom Dancing'), + ('A Intrepid Story of a Squirrel And a Crocodile who must Defeat a Monkey in The Outback', '''crocodil'':11 ''defeat'':14 ''intrepid'':4 ''monkey'':16 ''must'':13 ''outback'':19 ''pari'':1 ''squirrel'':8 ''stori'':5 ''weekend'':2', '1', '2013-05-26T14:50:58.951000', 121, 'PG-13', 2006, 7, '2.99', '19.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Paris Weekend'), + ('A Emotional Reflection of a Frisbee And a Boat who must Reach a Pastry Chef in An Abandoned Amusement Park', '''abandon'':20 ''amus'':21 ''boat'':11 ''chef'':17 ''cupboard'':1 ''emot'':4 ''frisbe'':8 ''must'':13 ''park'':22 ''pastri'':16 ''reach'':14 ''reflect'':5 ''sinner'':2', '1', '2013-05-26T14:50:58.951000', 56, 'R', 2006, 4, '2.99', '29.99', ARRAY['Behind the Scenes']::text[], 'Cupboard Sinners'), + ('A Emotional Drama of a Sumo Wrestler And a Dentist who must Confront a Sumo Wrestler in A Baloon', '''baloon'':21 ''confront'':15 ''dentist'':12 ''drama'':5 ''emot'':4 ''kane'':2 ''must'':14 ''silenc'':1 ''sumo'':8,17 ''wrestler'':9,18', '1', '2013-05-26T14:50:58.951000', 67, 'R', 2006, 7, '0.99', '23.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Silence Kane'), + ('A Awe-Inspiring Character Study of a Astronaut And a Forensic Psychologist who must Challenge a Madman in Ancient India', '''ancient'':22 ''astronaut'':11 ''awe'':5 ''awe-inspir'':4 ''challeng'':18 ''charact'':7 ''forens'':14 ''india'':23 ''inspir'':6 ''madman'':20 ''must'':17 ''psychologist'':15 ''rose'':2 ''shine'':1 ''studi'':8', '1', '2013-05-26T14:50:58.951000', 125, 'G', 2006, 4, '0.99', '12.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Shining Roses'), + ('A Astounding Saga of a Technical Writer And a Butler who must Battle a Butler in A Shark Tank', '''astound'':4 ''battl'':15 ''butler'':12,17 ''chase'':1 ''fight'':2 ''must'':14 ''saga'':5 ''shark'':20 ''tank'':21 ''technic'':8 ''writer'':9', '1', '2013-05-26T14:50:58.951000', 114, 'PG', 2006, 7, '4.99', '21.99', ARRAY['Trailers', 'Commentaries']::text[], 'Chasing Fight'), + ('A Touching Saga of a Madman And a Forensic Psychologist who must Build a Sumo Wrestler in An Abandoned Mine Shaft', '''abandon'':21 ''build'':15 ''forens'':11 ''madman'':8 ''mine'':22 ''must'':14 ''phantom'':2 ''psychologist'':12 ''saga'':5 ''shaft'':23 ''sumo'':17 ''touch'':4 ''wind'':1 ''wrestler'':18', '1', '2013-05-26T14:50:58.951000', 111, 'R', 2006, 6, '0.99', '12.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Wind Phantom'), + ('A Fanciful Reflection of a Crocodile And a Astronaut who must Outrace a Feminist in An Abandoned Amusement Park', '''abandon'':19 ''amus'':20 ''astronaut'':11 ''charad'':2 ''crocodil'':8 ''fanci'':4 ''feminist'':16 ''must'':13 ''neighbor'':1 ''outrac'':14 ''park'':21 ''reflect'':5', '1', '2013-05-26T14:50:58.951000', 161, 'R', 2006, 3, '0.99', '20.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Neighbors Charade'), + ('A Thoughtful Reflection of a Waitress And a Feminist who must Escape a Squirrel in A Manhattan Penthouse', '''canyon'':1 ''escap'':14 ''feminist'':11 ''manhattan'':19 ''must'':13 ''penthous'':20 ''reflect'':5 ''squirrel'':16 ''stock'':2 ''thought'':4 ''waitress'':8', '1', '2013-05-26T14:50:58.951000', 85, 'R', 2006, 7, '0.99', '26.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Canyon Stock'), + ('A Insightful Epistle of a Mad Scientist And a Explorer who must Challenge a Cat in The Sahara Desert', '''academi'':2 ''cat'':17 ''challeng'':15 ''desert'':21 ''epistl'':5 ''explor'':12 ''insight'':4 ''mad'':8 ''must'':14 ''sahara'':20 ''scientist'':9 ''victori'':1', '1', '2013-05-26T14:50:58.951000', 64, 'PG-13', 2006, 6, '0.99', '19.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Victory Academy'), + ('A Fast-Paced Display of a Car And a Database Administrator who must Battle a Woman in A Baloon', '''administr'':14 ''baloon'':22 ''battl'':17 ''car'':10 ''databas'':13 ''display'':7 ''fast'':5 ''fast-pac'':4 ''go'':1 ''must'':16 ''pace'':6 ''purpl'':2 ''woman'':19', '1', '2013-05-26T14:50:58.951000', 54, 'R', 2006, 3, '0.99', '12.99', ARRAY['Trailers']::text[], 'Go Purple'), + ('A Thoughtful Documentary of a Composer And a Explorer who must Conquer a Dentist in New Orleans', '''compos'':8 ''conquer'':14 ''dentist'':16 ''documentari'':5 ''explor'':11 ''forrest'':2 ''magnolia'':1 ''must'':13 ''new'':18 ''orlean'':19 ''thought'':4', '1', '2013-05-26T14:50:58.951000', 171, 'PG-13', 2006, 4, '0.99', '28.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Magnolia Forrester'), + ('A Beautiful Saga of a Lumberjack And a Teacher who must Build a Technical Writer in An Abandoned Fun House', '''abandon'':20 ''beauti'':4 ''build'':14 ''fun'':21 ''hous'':22 ''lumberjack'':8 ''must'':13 ''saga'':5 ''superfli'':1 ''teacher'':11 ''technic'':16 ''trip'':2 ''writer'':17', '1', '2013-05-26T14:50:58.951000', 114, 'PG', 2006, 5, '0.99', '27.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Superfly Trip'), + ('A Awe-Inspiring Drama of a Dog And a Man who must Escape a Robot in A Shark Tank', '''apollo'':2 ''awe'':5 ''awe-inspir'':4 ''dog'':10 ''drama'':7 ''escap'':16 ''inspir'':6 ''man'':13 ''must'':15 ''robot'':18 ''shark'':21 ''tank'':22 ''teen'':1', '1', '2013-05-26T14:50:58.951000', 74, 'G', 2006, 3, '4.99', '25.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Teen Apollo'), + ('A Intrepid Story of a Boy And a Technical Writer who must Pursue a Lumberjack in A Monastery', '''boy'':8 ''intrepid'':4 ''lumberjack'':17 ''monasteri'':20 ''must'':14 ''outfield'':2 ''pianist'':1 ''pursu'':15 ''stori'':5 ''technic'':11 ''writer'':12', '1', '2013-05-26T14:50:58.951000', 136, 'NC-17', 2006, 6, '0.99', '25.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Pianist Outfield'), + ('A Fast-Paced Drama of a Robot And a Composer who must Battle a Astronaut in New Orleans', '''alley'':1 ''astronaut'':18 ''battl'':16 ''compos'':13 ''drama'':7 ''evolut'':2 ''fast'':5 ''fast-pac'':4 ''must'':15 ''new'':20 ''orlean'':21 ''pace'':6 ''robot'':10', '1', '2013-05-26T14:50:58.951000', 180, 'NC-17', 2006, 6, '2.99', '23.99', ARRAY['Trailers', 'Commentaries']::text[], 'Alley Evolution'), + ('A Taut Reflection of a Astronaut And a Squirrel who must Fight a Squirrel in A Manhattan Penthouse', '''astronaut'':8 ''cider'':2 ''fight'':14 ''homeward'':1 ''manhattan'':19 ''must'':13 ''penthous'':20 ''reflect'':5 ''squirrel'':11,16 ''taut'':4', '1', '2013-05-26T14:50:58.951000', 103, 'R', 2006, 5, '0.99', '19.99', ARRAY['Trailers']::text[], 'Homeward Cider'), + ('A Astounding Panorama of a Husband And a Sumo Wrestler who must Pursue a Boat in Ancient India', '''ancient'':19 ''astound'':4 ''boat'':17 ''husband'':8 ''india'':20 ''must'':14 ''panorama'':5 ''pursu'':15 ''sumo'':11 ''tomorrow'':2 ''trojan'':1 ''wrestler'':12', '1', '2013-05-26T14:50:58.951000', 52, 'PG', 2006, 3, '2.99', '9.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Trojan Tomorrow'), + ('A Lacklusture Saga of a Moose And a Teacher who must Kill a Forensic Psychologist in A MySQL Convention', '''convent'':21 ''forens'':16 ''home'':2 ''kill'':14 ''lacklustur'':4 ''maiden'':1 ''moos'':8 ''must'':13 ''mysql'':20 ''psychologist'':17 ''saga'':5 ''teacher'':11', '1', '2013-05-26T14:50:58.951000', 138, 'PG', 2006, 3, '4.99', '9.99', ARRAY['Behind the Scenes']::text[], 'Maiden Home'), + ('A Emotional Epistle of a Pioneer And a Crocodile who must Battle a Man in A Manhattan Penthouse', '''battl'':14 ''crocodil'':11 ''emot'':4 ''epistl'':5 ''man'':16 ''manhattan'':19 ''must'':13 ''penthous'':20 ''pioneer'':8 ''quill'':2 ''suspect'':1', '1', '2013-05-26T14:50:58.951000', 47, 'PG', 2006, 4, '2.99', '22.99', ARRAY['Trailers']::text[], 'Suspects Quills'), + ('A Unbelieveable Reflection of a Butler And a Boat who must Outgun a Mad Scientist in California', '''boat'':11 ''butler'':8 ''california'':19 ''mad'':16 ''must'':13 ''network'':1 ''outgun'':14 ''peak'':2 ''reflect'':5 ''scientist'':17 ''unbeliev'':4', '1', '2013-05-26T14:50:58.951000', 75, 'PG-13', 2006, 5, '2.99', '23.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Network Peak'), + ('A Awe-Inspiring Epistle of a Pioneer And a Student who must Outgun a Crocodile in The Outback', '''awe'':5 ''awe-inspir'':4 ''crocodil'':18 ''epistl'':7 ''inspir'':6 ''jedi'':2 ''legend'':1 ''must'':15 ''outback'':21 ''outgun'':16 ''pioneer'':10 ''student'':13', '1', '2013-05-26T14:50:58.951000', 59, 'PG', 2006, 7, '0.99', '18.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Legend Jedi'), + ('A Awe-Inspiring Display of a Squirrel And a Woman who must Overcome a Boy in The Gulf of Mexico', '''awe'':5 ''awe-inspir'':4 ''boy'':18 ''display'':7 ''door'':1 ''gulf'':21 ''inspir'':6 ''mexico'':23 ''must'':15 ''overcom'':16 ''presid'':2 ''squirrel'':10 ''woman'':13', '1', '2013-05-26T14:50:58.951000', 49, 'NC-17', 2006, 3, '4.99', '22.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Doors President'), + ('A Astounding Epistle of a Database Administrator And a Explorer who must Find a Car in Ancient China', '''ace'':1 ''administr'':9 ''ancient'':19 ''astound'':4 ''car'':17 ''china'':20 ''databas'':8 ''epistl'':5 ''explor'':12 ''find'':15 ''goldfing'':2 ''must'':14', '1', '2013-05-26T14:50:58.951000', 48, 'G', 2006, 3, '4.99', '12.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Ace Goldfinger'), + ('A Stunning Saga of a Lumberjack And a Squirrel who must Chase a Car in The Outback', '''car'':16 ''chase'':14 ''diari'':2 ''godfath'':1 ''lumberjack'':8 ''must'':13 ''outback'':19 ''saga'':5 ''squirrel'':11 ''stun'':4', '1', '2013-05-26T14:50:58.951000', 73, 'NC-17', 2006, 3, '2.99', '14.99', ARRAY['Trailers']::text[], 'Godfather Diary'), + ('A Boring Character Study of a A Shark And a Girl who must Outrace a Feminist in An Abandoned Mine Shaft', '''abandon'':21 ''babi'':1 ''bore'':4 ''charact'':5 ''feminist'':18 ''girl'':13 ''hall'':2 ''mine'':22 ''must'':15 ''outrac'':16 ''shaft'':23 ''shark'':10 ''studi'':6', '1', '2013-05-26T14:50:58.951000', 153, 'NC-17', 2006, 5, '4.99', '23.99', ARRAY['Commentaries']::text[], 'Baby Hall'), + ('A Astounding Documentary of a Butler And a Explorer who must Challenge a Butler in A Monastery', '''astound'':4 ''bowfing'':2 ''butler'':8,16 ''challeng'':14 ''documentari'':5 ''explor'':11 ''game'':1 ''monasteri'':19 ''must'':13', '1', '2013-05-26T14:50:58.951000', 119, 'PG-13', 2006, 7, '4.99', '17.99', ARRAY['Behind the Scenes']::text[], 'Games Bowfinger'), + ('A Insightful Tale of a Database Administrator And a Dog who must Face a Madman in Soviet Georgia', '''administr'':9 ''databas'':8 ''dog'':12 ''face'':15 ''georgia'':20 ''gold'':2 ''insight'':4 ''madman'':17 ''must'':14 ''oscar'':1 ''soviet'':19 ''tale'':5', '1', '2013-05-26T14:50:58.951000', 115, 'PG', 2006, 7, '2.99', '29.99', ARRAY['Behind the Scenes']::text[], 'Oscar Gold'), + ('A Beautiful Character Study of a Sumo Wrestler And a Dentist who must Find a Dog in California', '''beauti'':4 ''california'':20 ''center'':1 ''charact'':5 ''dentist'':13 ''dinosaur'':2 ''dog'':18 ''find'':16 ''must'':15 ''studi'':6 ''sumo'':9 ''wrestler'':10', '1', '2013-05-26T14:50:58.951000', 152, 'PG', 2006, 5, '4.99', '12.99', ARRAY['Deleted Scenes']::text[], 'Center Dinosaur'), + ('A Thrilling Documentary of a Composer And a Monkey who must Find a Feminist in California', '''ballroom'':1 ''california'':18 ''compos'':8 ''documentari'':5 ''feminist'':16 ''find'':14 ''mockingbird'':2 ''monkey'':11 ''must'':13 ''thrill'':4', '1', '2013-05-26T14:50:58.951000', 173, 'G', 2006, 6, '0.99', '29.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Ballroom Mockingbird'), + ('A Awe-Inspiring Drama of a Boy And a Frisbee who must Escape a Pastry Chef in California', '''awe'':5 ''awe-inspir'':4 ''boy'':10 ''california'':21 ''chef'':19 ''coma'':1 ''drama'':7 ''escap'':16 ''frisbe'':13 ''head'':2 ''inspir'':6 ''must'':15 ''pastri'':18', '1', '2013-05-26T14:50:58.951000', 109, 'NC-17', 2006, 6, '4.99', '10.99', ARRAY['Commentaries']::text[], 'Coma Head'), + ('A Lacklusture Character Study of a Butler And a Car who must Redeem a Boat in An Abandoned Fun House', '''abandon'':20 ''anni'':2 ''boat'':17 ''butler'':9 ''car'':12 ''charact'':5 ''driver'':1 ''fun'':21 ''hous'':22 ''lacklustur'':4 ''must'':14 ''redeem'':15 ''studi'':6', '1', '2013-05-26T14:50:58.951000', 159, 'PG-13', 2006, 4, '2.99', '11.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Driver Annie'), + ('A Thrilling Character Study of a Squirrel And a Lumberjack who must Face a Hunter in A MySQL Convention', '''charact'':5 ''convent'':21 ''face'':15 ''hunter'':17 ''lumberjack'':12 ''must'':14 ''mysql'':20 ''outlaw'':2 ''river'':1 ''squirrel'':9 ''studi'':6 ''thrill'':4', '1', '2013-05-26T14:50:58.951000', 149, 'PG-13', 2006, 4, '0.99', '29.99', ARRAY['Commentaries']::text[], 'River Outlaw'), + ('A Touching Tale of a Explorer And a Boat who must Defeat a Robot in Australia', '''australia'':18 ''boat'':11 ''defeat'':14 ''explor'':8 ''harold'':2 ''money'':1 ''must'':13 ''robot'':16 ''tale'':5 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 135, 'PG', 2006, 3, '2.99', '17.99', ARRAY['Trailers', 'Commentaries']::text[], 'Money Harold'), + ('A Stunning Drama of a Teacher And a Boat who must Battle a Feminist in Ancient China', '''ancient'':18 ''battl'':14 ''boat'':11 ''china'':19 ''drama'':5 ''feminist'':16 ''must'':13 ''pond'':1 ''seattl'':2 ''stun'':4 ''teacher'':8', '1', '2013-05-26T14:50:58.951000', 185, 'PG-13', 2006, 7, '2.99', '25.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Pond Seattle'), + ('A Astounding Drama of a Frisbee And a Astronaut who must Fight a Dog in Ancient Japan', '''ancient'':18 ''astound'':4 ''astronaut'':11 ''die'':2 ''dog'':16 ''drama'':5 ''fight'':14 ''frisbe'':8 ''glass'':1 ''japan'':19 ''must'':13', '1', '2013-05-26T14:50:58.951000', 103, 'G', 2006, 4, '0.99', '24.99', ARRAY['Trailers']::text[], 'Glass Dying'), + ('A Touching Drama of a Dog And a Sumo Wrestler who must Conquer a Mad Scientist in Berlin', '''berlin'':20 ''conquer'':15 ''dog'':8 ''drama'':5 ''exorcist'':1 ''mad'':17 ''must'':14 ''scientist'':18 ''sting'':2 ''sumo'':11 ''touch'':4 ''wrestler'':12', '1', '2013-05-26T14:50:58.951000', 167, 'G', 2006, 6, '2.99', '17.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Exorcist Sting'), + ('A Fast-Paced Documentary of a Pastry Chef And a Crocodile who must Chase a Squirrel in The Gulf of Mexico', '''chase'':17 ''chef'':11 ''crocodil'':14 ''documentari'':7 ''fast'':5 ''fast-pac'':4 ''freaki'':1 ''gulf'':22 ''mexico'':24 ''must'':16 ''pace'':6 ''pastri'':10 ''pocus'':2 ''squirrel'':19', '1', '2013-05-26T14:50:58.951000', 126, 'R', 2006, 7, '2.99', '16.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Freaky Pocus'), + ('A Unbelieveable Drama of a Waitress And a Composer who must Sink a Mad Cow in Ancient Japan', '''ancient'':19 ''compos'':11 ''cow'':17 ''drama'':5 ''japan'':20 ''mad'':16 ''must'':13 ''ridgemont'':1 ''sink'':14 ''submarin'':2 ''unbeliev'':4 ''waitress'':8', '1', '2013-05-26T14:50:58.951000', 46, 'PG-13', 2006, 3, '0.99', '28.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Ridgemont Submarine'), + ('A Insightful Panorama of a Monkey And a Sumo Wrestler who must Outrace a Mad Scientist in The Canadian Rockies', '''canadian'':21 ''cyclon'':2 ''drumlin'':1 ''insight'':4 ''mad'':17 ''monkey'':8 ''must'':14 ''outrac'':15 ''panorama'':5 ''rocki'':22 ''scientist'':18 ''sumo'':11 ''wrestler'':12', '1', '2013-05-26T14:50:58.951000', 110, 'G', 2006, 3, '0.99', '14.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Drumline Cyclone'), + ('A Amazing Story of a Mad Cow And a Dog who must Kill a Husband in A Monastery', '''amaz'':4 ''champion'':1 ''cow'':9 ''dog'':12 ''flatlin'':2 ''husband'':17 ''kill'':15 ''mad'':8 ''monasteri'':20 ''must'':14 ''stori'':5', '1', '2013-05-26T14:50:58.951000', 51, 'PG', 2006, 4, '4.99', '21.99', ARRAY['Trailers']::text[], 'Champion Flatliners'), + ('A Thoughtful Documentary of a Dentist And a Forensic Psychologist who must Defeat a Waitress in Berlin', '''berlin'':19 ''dawn'':1 ''defeat'':15 ''dentist'':8 ''documentari'':5 ''forens'':11 ''must'':14 ''pond'':2 ''psychologist'':12 ''thought'':4 ''waitress'':17', '1', '2013-05-26T14:50:58.951000', 57, 'PG', 2006, 4, '4.99', '27.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Dawn Pond'), + ('A Thrilling Display of a Lumberjack And a Crocodile who must Meet a Monkey in A Baloon Factory', '''armageddon'':2 ''baloon'':19 ''crocodil'':11 ''display'':5 ''factori'':20 ''lumberjack'':8 ''meet'':14 ''metal'':1 ''monkey'':16 ''must'':13 ''thrill'':4', '1', '2013-05-26T14:50:58.951000', 161, 'PG-13', 2006, 6, '2.99', '26.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Metal Armageddon'), + ('A Epic Display of a Butler And a Dog who must Vanquish a Crocodile in A Manhattan Penthouse', '''butler'':8 ''crocodil'':16 ''display'':5 ''dog'':11 ''epic'':4 ''insect'':1 ''manhattan'':19 ''must'':13 ''penthous'':20 ''stone'':2 ''vanquish'':14', '1', '2013-05-26T14:50:58.951000', 123, 'NC-17', 2006, 3, '0.99', '14.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Insects Stone'), + ('A Taut Character Study of a Explorer And a Mad Cow who must Battle a Hunter in Ancient China', '''ancient'':20 ''battl'':16 ''charact'':5 ''china'':21 ''cow'':13 ''explor'':9 ''hunter'':18 ''interview'':2 ''mad'':12 ''must'':15 ''son'':1 ''studi'':6 ''taut'':4', '1', '2013-05-26T14:50:58.951000', 184, 'NC-17', 2006, 3, '2.99', '11.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Sons Interview'), + ('A Brilliant Reflection of a Feminist And a Dog who must Fight a Boy in A Baloon Factory', '''baloon'':19 ''boondock'':2 ''boy'':16 ''brilliant'':4 ''dog'':11 ''factori'':20 ''feminist'':8 ''fight'':14 ''must'':13 ''reflect'':5 ''titan'':1', '1', '2013-05-26T14:50:58.951000', 104, 'R', 2006, 3, '4.99', '18.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Titanic Boondock'), + ('A Astounding Documentary of a Butler And a Womanizer who must Face a Dog in A U-Boat', '''astound'':4 ''boat'':21 ''butler'':8 ''documentari'':5 ''dog'':16 ''face'':14 ''grape'':2 ''must'':13 ''orang'':1 ''u'':20 ''u-boat'':19 ''woman'':11', '1', '2013-05-26T14:50:58.951000', 76, 'PG-13', 2006, 4, '0.99', '21.99', ARRAY['Trailers', 'Commentaries']::text[], 'Orange Grapes'), + ('A Thrilling Display of a Mad Cow And a Dog who must Challenge a Frisbee in Nigeria', '''challeng'':15 ''cow'':9 ''display'':5 ''dog'':12 ''fli'':1 ''frisbe'':17 ''hook'':2 ''mad'':8 ''must'':14 ''nigeria'':19 ''thrill'':4', '1', '2013-05-26T14:50:58.951000', 69, 'NC-17', 2006, 6, '2.99', '18.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Flying Hook'), + ('A Thrilling Tale of a Butler And a Astronaut who must Battle a Explorer in The First Manned Space Station', '''astronaut'':11 ''battl'':14 ''boondock'':2 ''butler'':8 ''explor'':16 ''first'':19 ''man'':20 ''music'':1 ''must'':13 ''space'':21 ''station'':22 ''tale'':5 ''thrill'':4', '1', '2013-05-26T14:50:58.951000', 129, 'R', 2006, 7, '0.99', '17.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Music Boondock'), + ('A Intrepid Yarn of a Frisbee And a Dog who must Build a Astronaut in A Baloon Factory', '''astronaut'':16 ''baloon'':19 ''build'':14 ''dog'':11 ''factori'':20 ''frisbe'':8 ''intrepid'':4 ''must'':13 ''pocus'':1 ''pulp'':2 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 138, 'NC-17', 2006, 6, '0.99', '15.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Pocus Pulp'), + ('A Awe-Inspiring Reflection of a Woman And a Cat who must Confront a Feminist in The Sahara Desert', '''awe'':5 ''awe-inspir'':4 ''cat'':13 ''confront'':16 ''desert'':22 ''die'':2 ''feminist'':18 ''harper'':1 ''inspir'':6 ''must'':15 ''reflect'':7 ''sahara'':21 ''woman'':10', '1', '2013-05-26T14:50:58.951000', 52, 'G', 2006, 3, '0.99', '15.99', ARRAY['Trailers']::text[], 'Harper Dying'), + ('A Awe-Inspiring Reflection of a Cat And a Pioneer who must Escape a Hunter in Ancient China', '''ancient'':20 ''awe'':5 ''awe-inspir'':4 ''cat'':10 ''china'':21 ''escap'':16 ''heaven'':2 ''hunter'':18 ''inspir'':6 ''must'':15 ''pioneer'':13 ''reflect'':7 ''wash'':1', '1', '2013-05-26T14:50:58.951000', 161, 'R', 2006, 7, '4.99', '22.99', ARRAY['Commentaries']::text[], 'Wash Heavenly'), + ('A Fanciful Panorama of a Technical Writer And a Boy who must Find a Dentist in An Abandoned Fun House', '''abandon'':20 ''boy'':12 ''dentist'':17 ''exorcist'':2 ''fanci'':4 ''find'':15 ''fun'':21 ''hous'':22 ''island'':1 ''must'':14 ''panorama'':5 ''technic'':8 ''writer'':9', '1', '2013-05-26T14:50:58.951000', 84, 'NC-17', 2006, 7, '2.99', '23.99', ARRAY['Trailers', 'Commentaries']::text[], 'Island Exorcist'), + ('A Fanciful Story of a Database Administrator And a Womanizer who must Fight a Database Administrator in Ancient China', '''administr'':9,18 ''ancient'':20 ''china'':21 ''databas'':8,17 ''divin'':2 ''fanci'':4 ''fight'':15 ''must'':14 ''stori'':5 ''wasteland'':1 ''woman'':12', '1', '2013-05-26T14:50:58.951000', 85, 'PG', 2006, 7, '2.99', '18.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Wasteland Divine'), + ('A Fast-Paced Drama of a Squirrel And a Robot who must Succumb a Technical Writer in A Manhattan Penthouse', '''desir'':2 ''drama'':7 ''fast'':5 ''fast-pac'':4 ''manhattan'':22 ''must'':15 ''pace'':6 ''penthous'':23 ''robot'':13 ''squirrel'':10 ''succumb'':16 ''technic'':18 ''wolv'':1 ''writer'':19', '1', '2013-05-26T14:50:58.951000', 55, 'NC-17', 2006, 7, '0.99', '13.99', ARRAY['Behind the Scenes']::text[], 'Wolves Desire'), + ('A Unbelieveable Documentary of a Boat And a Husband who must Succumb a Student in A U-Boat', '''boat'':8,21 ''boil'':2 ''documentari'':5 ''gilmor'':1 ''husband'':11 ''must'':13 ''student'':16 ''succumb'':14 ''u'':20 ''u-boat'':19 ''unbeliev'':4', '1', '2013-05-26T14:50:58.951000', 163, 'R', 2006, 5, '0.99', '29.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Gilmore Boiled'), + ('A Fast-Paced Display of a Composer And a Moose who must Sink a Robot in An Abandoned Mine Shaft', '''abandon'':21 ''beauti'':1 ''compos'':10 ''display'':7 ''fast'':5 ''fast-pac'':4 ''greas'':2 ''mine'':22 ''moos'':13 ''must'':15 ''pace'':6 ''robot'':18 ''shaft'':23 ''sink'':16', '1', '2013-05-26T14:50:58.951000', 175, 'G', 2006, 5, '4.99', '28.99', ARRAY['Trailers', 'Commentaries']::text[], 'Beauty Grease'), + ('A Brilliant Display of a Robot And a Butler who must Fight a Waitress in An Abandoned Mine Shaft', '''abandon'':19 ''brilliant'':4 ''butler'':11 ''chill'':2 ''display'':5 ''fight'':14 ''mine'':20 ''must'':13 ''nightmar'':1 ''robot'':8 ''shaft'':21 ''waitress'':16', '1', '2013-05-26T14:50:58.951000', 149, 'PG', 2006, 3, '4.99', '25.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Nightmare Chill'), + ('A Action-Packed Yarn of a Womanizer And a Lumberjack who must Chase a Sumo Wrestler in A Monastery', '''action'':5 ''action-pack'':4 ''alter'':2 ''chase'':16 ''hedwig'':1 ''lumberjack'':13 ''monasteri'':22 ''must'':15 ''pack'':6 ''sumo'':18 ''woman'':10 ''wrestler'':19 ''yarn'':7', '1', '2013-05-26T14:50:58.951000', 169, 'NC-17', 2006, 7, '2.99', '16.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Hedwig Alter'), + ('A Lacklusture Documentary of a Mad Cow And a Madman who must Sink a Moose in The Gulf of Mexico', '''cow'':9 ''documentari'':5 ''gulf'':20 ''lacklustur'':4 ''mad'':8 ''madman'':12 ''mexico'':22 ''moos'':17 ''must'':14 ''other'':1 ''sink'':15 ''soup'':2', '1', '2013-05-26T14:50:58.951000', 118, 'PG', 2006, 7, '2.99', '18.99', ARRAY['Deleted Scenes']::text[], 'Others Soup'), + ('A Stunning Display of a Butler And a Teacher who must Confront a A Shark in The First Manned Space Station', '''butler'':8 ''confront'':14 ''display'':5 ''everyon'':2 ''first'':20 ''greek'':1 ''man'':21 ''must'':13 ''shark'':17 ''space'':22 ''station'':23 ''stun'':4 ''teacher'':11', '1', '2013-05-26T14:50:58.951000', 176, 'PG', 2006, 7, '2.99', '11.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Greek Everyone'), + ('A Amazing Documentary of a Car And a Robot who must Escape a Lumberjack in An Abandoned Amusement Park', '''abandon'':19 ''amaz'':4 ''amus'':20 ''car'':8 ''documentari'':5 ''escap'':14 ''lumberjack'':16 ''must'':13 ''park'':21 ''robot'':11 ''south'':1 ''wait'':2', '1', '2013-05-26T14:50:58.951000', 143, 'R', 2006, 4, '2.99', '21.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'South Wait'), + ('A Emotional Yarn of a Teacher And a Girl who must Find a Teacher in A Baloon Factory', '''baloon'':19 ''bang'':2 ''emot'':4 ''factori'':20 ''find'':14 ''girl'':11 ''must'':13 ''scarfac'':1 ''teacher'':8,16 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 102, 'PG-13', 2006, 3, '4.99', '11.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Scarface Bang'), + ('A Emotional Drama of a Husband And a Lumberjack who must Build a Cat in Ancient India', '''ancient'':18 ''build'':14 ''cat'':16 ''drama'':5 ''emot'':4 ''husband'':8 ''india'':19 ''lumberjack'':11 ''must'':13 ''sagebrush'':2 ''thin'':1', '1', '2013-05-26T14:50:58.951000', 53, 'PG-13', 2006, 5, '4.99', '9.99', ARRAY['Behind the Scenes']::text[], 'Thin Sagebrush'), + ('A Amazing Drama of a Car And a Squirrel who must Pursue a Car in Soviet Georgia', '''amaz'':4 ''car'':8,16 ''drama'':5 ''georgia'':19 ''homeward'':2 ''kwai'':1 ''must'':13 ''pursu'':14 ''soviet'':18 ''squirrel'':11', '1', '2013-05-26T14:50:58.951000', 46, 'PG-13', 2006, 5, '0.99', '25.99', ARRAY['Trailers', 'Commentaries']::text[], 'Kwai Homeward'), + ('A Thrilling Panorama of a Pastry Chef And a Secret Agent who must Overcome a Student in A Manhattan Penthouse', '''agent'':13 ''cheaper'':2 ''chef'':9 ''manhattan'':21 ''must'':15 ''overcom'':16 ''panorama'':5 ''pastri'':8 ''penthous'':22 ''secret'':12 ''spartacus'':1 ''student'':18 ''thrill'':4', '1', '2013-05-26T14:50:58.951000', 52, 'NC-17', 2006, 4, '4.99', '19.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Spartacus Cheaper'), + ('A Astounding Display of a Explorer And a Boat who must Vanquish a Car in The First Manned Space Station', '''astound'':4 ''birdcag'':2 ''boat'':11 ''car'':16 ''display'':5 ''explor'':8 ''first'':19 ''hoosier'':1 ''man'':20 ''must'':13 ''space'':21 ''station'':22 ''vanquish'':14', '1', '2013-05-26T14:50:58.951000', 176, 'G', 2006, 3, '2.99', '12.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Hoosiers Birdcage'), + ('A Insightful Story of a Lumberjack And a Hunter who must Kill a Boy in Ancient Japan', '''ancient'':18 ''boy'':16 ''clueless'':2 ''hunter'':11 ''insight'':4 ''japan'':19 ''kill'':14 ''lumberjack'':8 ''must'':13 ''sagebrush'':1 ''stori'':5', '1', '2013-05-26T14:50:58.951000', 106, 'G', 2006, 4, '2.99', '28.99', ARRAY['Trailers']::text[], 'Sagebrush Clueless'), + ('A Lacklusture Yarn of a Astronaut And a Pastry Chef who must Sink a Dog in A U-Boat', '''astronaut'':8 ''boat'':22 ''chef'':12 ''destini'':2 ''dog'':17 ''lacklustur'':4 ''must'':14 ''pastri'':11 ''pearl'':1 ''sink'':15 ''u'':21 ''u-boat'':20 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 74, 'NC-17', 2006, 3, '2.99', '10.99', ARRAY['Trailers']::text[], 'Pearl Destiny'), + ('A Boring Documentary of a Pioneer And a Man who must Vanquish a Man in Nigeria', '''bore'':4 ''documentari'':5 ''dragonfli'':1 ''man'':11,16 ''must'':13 ''nigeria'':18 ''pioneer'':8 ''stranger'':2 ''vanquish'':14', '1', '2013-05-26T14:50:58.951000', 133, 'NC-17', 2006, 6, '4.99', '19.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Dragonfly Strangers'), + ('A Amazing Character Study of a Teacher And a Database Administrator who must Defeat a Waitress in A Jet Boat', '''administr'':13 ''amaz'':4 ''boat'':22 ''charact'':5 ''databas'':12 ''defeat'':16 ''duck'':2 ''jet'':21 ''must'':15 ''slum'':1 ''studi'':6 ''teacher'':9 ''waitress'':18', '1', '2013-05-26T14:50:58.951000', 147, 'PG', 2006, 5, '0.99', '21.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Slums Duck'), + ('A Unbelieveable Epistle of a Dog And a Woman who must Confront a Moose in The Gulf of Mexico', '''confront'':14 ''deer'':2 ''dog'':8 ''epistl'':5 ''gulf'':19 ''light'':1 ''mexico'':21 ''moos'':16 ''must'':13 ''unbeliev'':4 ''woman'':11', '1', '2013-05-26T14:50:58.951000', 174, 'R', 2006, 7, '0.99', '21.99', ARRAY['Commentaries']::text[], 'Lights Deer'), + ('A Action-Packed Reflection of a Car And a Moose who must Outgun a Car in A Shark Tank', '''action'':5 ''action-pack'':4 ''car'':10,18 ''moos'':13 ''must'':15 ''oleand'':2 ''outgun'':16 ''pack'':6 ''pluto'':1 ''reflect'':7 ''shark'':21 ''tank'':22', '1', '2013-05-26T14:50:58.951000', 84, 'R', 2006, 5, '4.99', '9.99', ARRAY['Behind the Scenes']::text[], 'Pluto Oleander'), + ('A Emotional Display of a Man And a Dentist who must Challenge a Squirrel in Australia', '''australia'':18 ''challeng'':14 ''dentist'':11 ''display'':5 ''emot'':4 ''goodfella'':2 ''man'':8 ''must'':13 ''rush'':1 ''squirrel'':16', '1', '2013-05-26T14:50:58.951000', 48, 'PG', 2006, 3, '0.99', '20.99', ARRAY['Deleted Scenes']::text[], 'Rush Goodfellas'), + ('A Brilliant Yarn of a Cat And a Car who must Confront a Explorer in Ancient Japan', '''ancient'':18 ''brilliant'':4 ''car'':11 ''cat'':8 ''confront'':14 ''explor'':16 ''flintston'':2 ''japan'':19 ''must'':13 ''spirit'':1 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 149, 'R', 2006, 7, '0.99', '23.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Spirit Flintstones'), + ('A Lacklusture Drama of a Secret Agent And a Explorer who must Discover a Car in A U-Boat', '''african'':2 ''agent'':9 ''boat'':22 ''car'':17 ''discov'':15 ''drama'':5 ''explor'':12 ''lacklustur'':4 ''must'':14 ''open'':1 ''secret'':8 ''u'':21 ''u-boat'':20', '1', '2013-05-26T14:50:58.951000', 131, 'PG', 2006, 7, '4.99', '16.99', ARRAY['Trailers', 'Commentaries']::text[], 'Open African'), + ('A Lacklusture Yarn of a Dentist And a Butler who must Meet a Secret Agent in Ancient China', '''agent'':17 ''ancient'':19 ''butler'':11 ''china'':20 ''confidenti'':2 ''dentist'':8 ''lacklustur'':4 ''meet'':14 ''must'':13 ''satisfact'':1 ''secret'':16 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 75, 'G', 2006, 3, '4.99', '26.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Satisfaction Confidential'), + ('A Astounding Saga of a Dog And a Squirrel who must Conquer a Dog in An Abandoned Fun House', '''abandon'':19 ''astound'':4 ''conquer'':14 ''dog'':8,16 ''fun'':20 ''hous'':21 ''ishtar'':1 ''must'':13 ''rocket'':2 ''saga'':5 ''squirrel'':11', '1', '2013-05-26T14:50:58.951000', 79, 'R', 2006, 4, '4.99', '24.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Ishtar Rocketeer'), + ('A Epic Tale of a Moose And a Girl who must Confront a Monkey in Ancient India', '''airport'':1 ''ancient'':18 ''confront'':14 ''epic'':4 ''girl'':11 ''india'':19 ''monkey'':16 ''moos'':8 ''must'':13 ''pollock'':2 ''tale'':5', '1', '2013-05-26T14:50:58.951000', 54, 'R', 2006, 6, '4.99', '15.99', ARRAY['Trailers']::text[], 'Airport Pollock'), + ('A Touching Documentary of a Mad Cow And a Explorer who must Confront a Butler in A Manhattan Penthouse', '''airport'':2 ''butler'':17 ''confront'':15 ''cow'':9 ''documentari'':5 ''explor'':12 ''instinct'':1 ''mad'':8 ''manhattan'':20 ''must'':14 ''penthous'':21 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 116, 'PG', 2006, 4, '2.99', '21.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Instinct Airport'), + ('A Astounding Character Study of a Madman And a Robot who must Meet a Mad Scientist in An Abandoned Fun House', '''abandon'':21 ''astound'':4 ''bedazzl'':1 ''charact'':5 ''fun'':22 ''hous'':23 ''mad'':17 ''madman'':9 ''marri'':2 ''meet'':15 ''must'':14 ''robot'':12 ''scientist'':18 ''studi'':6', '1', '2013-05-26T14:50:58.951000', 73, 'PG', 2006, 6, '0.99', '21.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Bedazzled Married'), + ('A Fateful Panorama of a Crocodile And a Boy who must Defeat a Monkey in The Gulf of Mexico', '''ballroom'':2 ''boondock'':1 ''boy'':11 ''crocodil'':8 ''defeat'':14 ''fate'':4 ''gulf'':19 ''mexico'':21 ''monkey'':16 ''must'':13 ''panorama'':5', '1', '2013-05-26T14:50:58.951000', 76, 'NC-17', 2006, 7, '0.99', '14.99', ARRAY['Behind the Scenes']::text[], 'Boondock Ballroom'), + ('A Fateful Yarn of a Mad Cow And a Waitress who must Battle a Student in California', '''battl'':15 ''california'':19 ''chicago'':1 ''cow'':9 ''fate'':4 ''mad'':8 ''must'':14 ''north'':2 ''student'':17 ''waitress'':12 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 185, 'PG-13', 2006, 6, '4.99', '11.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Chicago North'), + ('A Thoughtful Saga of a A Shark And a Monkey who must Outgun a Student in Ancient China', '''ancient'':19 ''china'':20 ''hellfight'':2 ''leagu'':1 ''monkey'':12 ''must'':14 ''outgun'':15 ''saga'':5 ''shark'':9 ''student'':17 ''thought'':4', '1', '2013-05-26T14:50:58.951000', 110, 'PG-13', 2006, 5, '4.99', '25.99', ARRAY['Trailers']::text[], 'League Hellfighters'), + ('A Thoughtful Panorama of a Man And a Car who must Sink a Composer in Berlin', '''berlin'':18 ''car'':11 ''compos'':16 ''hollywood'':2 ''man'':8 ''mockingbird'':1 ''must'':13 ''panorama'':5 ''sink'':14 ''thought'':4', '1', '2013-05-26T14:50:58.951000', 60, 'PG', 2006, 4, '0.99', '27.99', ARRAY['Behind the Scenes']::text[], 'Mockingbird Hollywood'), + ('A Astounding Saga of a Mad Scientist And a Hunter who must Pursue a Robot in A Baloon Factory', '''arizona'':2 ''astound'':4 ''baloon'':20 ''factori'':21 ''hunter'':12 ''insid'':1 ''mad'':8 ''must'':14 ''pursu'':15 ''robot'':17 ''saga'':5 ''scientist'':9', '1', '2013-05-26T14:50:58.951000', 78, 'NC-17', 2006, 5, '2.99', '17.99', ARRAY['Commentaries']::text[], 'Insider Arizona') + ) AS data(description, fulltext, old_language_id, last_update, length, rating, release_year, rental_duration, rental_rate, replacement_cost, special_features, title) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."language"' + AND map0.old_id = data.old_language_id + RETURNING film_id + ) + SELECT array_agg(film_id) INTO v_new_ids_film FROM inserted; + + FOR i IN 1..array_length(v_new_ids_film, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."film"', v_old_ids_film[i], v_new_ids_film[i]::TEXT); + END LOOP; + + v_old_ids_film := ARRAY['70', '809', '209', '724', '390', '607', '442', '316', '781', '867', '554', '794', '993', '170', '337', '825', '541', '945', '659', '374', '562', '95', '923', '113', '468', '532', '313', '566', '219', '225', '974', '699', '25', '269', '64', '507', '109', '378', '917', '697', '138', '48', '264', '234', '43', '230', '115', '919', '531', '553', '371', '778', '12', '330', '121', '90', '715', '174', '956', '980', '158', '865', '528', '846', '514', '635', '373', '421', '169', '232', '926', '398', '754', '609', '606', '365', '860', '527', '460', '871', '24', '952', '419', '570', '270', '292', '780', '72', '939', '190', '612', '283', '152', '478', '31', '444', '137', '85', '944', '14']; + WITH inserted AS ( + INSERT INTO "public"."film" ("description", "fulltext", "language_id", "last_update", "length", "rating", "release_year", "rental_duration", "rental_rate", "replacement_cost", "special_features", "title") + SELECT + data.description::text, + data.fulltext::tsvector, + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.length::smallint, + data.rating::mpaa_rating, + data.release_year::integer, + data.rental_duration::smallint, + data.rental_rate::numeric, + data.replacement_cost::numeric, + data.special_features::text[], + data.title::character varying + FROM (VALUES + ('A Astounding Drama of a Astronaut And a Cat who must Discover a Woman in The First Manned Space Station', '''astound'':4 ''astronaut'':8 ''bikini'':1 ''borrow'':2 ''cat'':11 ''discov'':14 ''drama'':5 ''first'':19 ''man'':20 ''must'':13 ''space'':21 ''station'':22 ''woman'':16', '1', '2013-05-26T14:50:58.951000', 142, 'NC-17', 2006, 7, '4.99', '26.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Bikini Borrowers'), + ('A Taut Reflection of a Secret Agent And a Man who must Redeem a Explorer in A MySQL Convention', '''agent'':9 ''convent'':21 ''explor'':17 ''fidel'':2 ''man'':12 ''must'':14 ''mysql'':20 ''redeem'':15 ''reflect'':5 ''secret'':8 ''slipper'':1 ''taut'':4', '1', '2013-05-26T14:50:58.951000', 156, 'PG-13', 2006, 5, '0.99', '14.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Slipper Fidelity'), + ('A Touching Documentary of a Husband And a Hunter who must Escape a Boy in The Sahara Desert', '''boy'':16 ''dark'':1 ''desert'':20 ''documentari'':5 ''escap'':14 ''hunter'':11 ''husband'':8 ''must'':13 ''sahara'':19 ''touch'':4 ''war'':2', '1', '2013-05-26T14:50:58.951000', 99, 'NC-17', 2006, 6, '2.99', '24.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Darkness War'), + ('A Insightful Tale of a Technical Writer And a Waitress who must Conquer a Monkey in Ancient India', '''ancient'':19 ''conquer'':15 ''diari'':2 ''india'':20 ''insight'':4 ''monkey'':17 ''must'':14 ''rememb'':1 ''tale'':5 ''technic'':8 ''waitress'':12 ''writer'':9', '1', '2013-05-26T14:50:58.951000', 110, 'R', 2006, 5, '2.99', '15.99', ARRAY['Trailers', 'Commentaries']::text[], 'Remember Diary'), + ('A Boring Story of a Woman And a Feminist who must Redeem a Squirrel in A U-Boat', '''boat'':21 ''bore'':4 ''falcon'':2 ''feminist'':11 ''guy'':1 ''must'':13 ''redeem'':14 ''squirrel'':16 ''stori'':5 ''u'':20 ''u-boat'':19 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 84, 'R', 2006, 4, '4.99', '20.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Guys Falcon'), + ('A Lacklusture Story of a Madman And a Teacher who must Kill a Frisbee in The Gulf of Mexico', '''frisbe'':16 ''gulf'':19 ''kill'':14 ''lacklustur'':4 ''madman'':8 ''mexico'':21 ''mile'':2 ''muppet'':1 ''must'':13 ''stori'':5 ''teacher'':11', '1', '2013-05-26T14:50:58.951000', 50, 'PG', 2006, 5, '4.99', '18.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Muppet Mile'), + ('A Thrilling Reflection of a Pioneer And a Dentist who must Outrace a Womanizer in An Abandoned Mine Shaft', '''abandon'':19 ''dentist'':11 ''hunt'':1 ''mine'':20 ''musket'':2 ''must'':13 ''outrac'':14 ''pioneer'':8 ''reflect'':5 ''shaft'':21 ''thrill'':4 ''woman'':16', '1', '2013-05-26T14:50:58.951000', 65, 'NC-17', 2006, 6, '2.99', '24.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Hunting Musketeers'), + ('A Intrepid Documentary of a Frisbee And a Dog who must Outrace a Lumberjack in Nigeria', '''documentari'':5 ''dog'':11 ''fire'':1 ''frisbe'':8 ''intrepid'':4 ''lumberjack'':16 ''must'':13 ''nigeria'':18 ''outrac'':14 ''wolv'':2', '1', '2013-05-26T14:50:58.951000', 173, 'R', 2006, 5, '4.99', '18.99', ARRAY['Trailers']::text[], 'Fire Wolves'), + ('A Unbelieveable Character Study of a Dog And a Mad Cow who must Kill a Monkey in Berlin', '''berlin'':20 ''charact'':5 ''cow'':13 ''dog'':9 ''kill'':16 ''mad'':12 ''monkey'':18 ''must'':15 ''seven'':1 ''studi'':6 ''swarm'':2 ''unbeliev'':4', '1', '2013-05-26T14:50:58.951000', 127, 'R', 2006, 4, '4.99', '15.99', ARRAY['Deleted Scenes']::text[], 'Seven Swarm'), + ('A Action-Packed Saga of a Pastry Chef And a Explorer who must Discover a A Shark in The Outback', '''action'':5 ''action-pack'':4 ''chef'':11 ''discov'':17 ''explor'':14 ''must'':16 ''outback'':23 ''pack'':6 ''pastri'':10 ''saga'':7 ''shark'':20 ''super'':1 ''wyom'':2', '1', '2013-05-26T14:50:58.951000', 58, 'PG', 2006, 5, '4.99', '10.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Super Wyoming'), + ('A Intrepid Reflection of a Waitress And a A Shark who must Kill a Squirrel in The Outback', '''intrepid'':4 ''kill'':15 ''malkovich'':1 ''must'':14 ''outback'':20 ''pet'':2 ''reflect'':5 ''shark'':12 ''squirrel'':17 ''waitress'':8', '1', '2013-05-26T14:50:58.951000', 159, 'G', 2006, 6, '2.99', '22.99', ARRAY['Behind the Scenes']::text[], 'Malkovich Pet'), + ('A Stunning Panorama of a Crocodile And a Womanizer who must Meet a Feminist in The Canadian Rockies', '''ark'':2 ''canadian'':19 ''crocodil'':8 ''feminist'':16 ''meet'':14 ''must'':13 ''panorama'':5 ''rocki'':20 ''side'':1 ''stun'':4 ''woman'':11', '1', '2013-05-26T14:50:58.951000', 52, 'G', 2006, 5, '0.99', '28.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Side Ark'), + ('A Emotional Saga of a Crocodile And a Sumo Wrestler who must Discover a Mad Cow in New Orleans', '''behavior'':2 ''cow'':18 ''crocodil'':8 ''discov'':15 ''emot'':4 ''mad'':17 ''must'':14 ''new'':20 ''orlean'':21 ''saga'':5 ''sumo'':11 ''wrestler'':12 ''wrong'':1', '1', '2013-05-26T14:50:58.951000', 178, 'PG-13', 2006, 6, '2.99', '10.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Wrong Behavior'), + ('A Awe-Inspiring Tale of a Forensic Psychologist And a Woman who must Challenge a Database Administrator in Ancient Japan', '''administr'':20 ''ancient'':22 ''awe'':5 ''awe-inspir'':4 ''challeng'':17 ''command'':1 ''darl'':2 ''databas'':19 ''forens'':10 ''inspir'':6 ''japan'':23 ''must'':16 ''psychologist'':11 ''tale'':7 ''woman'':14', '1', '2013-05-26T14:50:58.951000', 120, 'PG-13', 2006, 5, '4.99', '28.99', ARRAY['Behind the Scenes']::text[], 'Command Darling'), + ('A Fateful Story of a Lumberjack And a Car who must Escape a Boat in An Abandoned Mine Shaft', '''abandon'':19 ''boat'':16 ''car'':11 ''escap'':14 ''fate'':4 ''frida'':1 ''lumberjack'':8 ''mine'':20 ''must'':13 ''shaft'':21 ''slipper'':2 ''stori'':5', '1', '2013-05-26T14:50:58.951000', 73, 'R', 2006, 6, '2.99', '11.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Frida Slipper'), + ('A Lacklusture Drama of a Forensic Psychologist And a Car who must Redeem a Man in A Manhattan Penthouse', '''car'':12 ''date'':2 ''drama'':5 ''forens'':8 ''lacklustur'':4 ''man'':17 ''manhattan'':20 ''must'':14 ''penthous'':21 ''psychologist'':9 ''redeem'':15 ''speakeasi'':1', '1', '2013-05-26T14:50:58.951000', 165, 'PG-13', 2006, 6, '2.99', '22.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Speakeasy Date'), + ('A Taut Character Study of a Boy And a Robot who must Redeem a Mad Scientist in Ancient India', '''ancient'':20 ''boy'':9 ''charact'':5 ''india'':21 ''luke'':1 ''mad'':17 ''mummi'':2 ''must'':14 ''redeem'':15 ''robot'':12 ''scientist'':18 ''studi'':6 ''taut'':4', '1', '2013-05-26T14:50:58.951000', 74, 'NC-17', 2006, 5, '2.99', '21.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Luke Mummy'), + ('A Emotional Panorama of a Dentist And a Crocodile who must Meet a Boy in Berlin', '''berlin'':18 ''boy'':16 ''crocodil'':11 ''dentist'':8 ''emot'':4 ''meet'':14 ''must'':13 ''panorama'':5 ''pluto'':2 ''virginian'':1', '1', '2013-05-26T14:50:58.951000', 164, 'R', 2006, 5, '0.99', '22.99', ARRAY['Deleted Scenes']::text[], 'Virginian Pluto'), + ('A Taut Epistle of a Sumo Wrestler And a Girl who must Face a Husband in Ancient Japan', '''ancient'':19 ''citizen'':2 ''epistl'':5 ''face'':15 ''girl'':12 ''husband'':17 ''japan'':20 ''must'':14 ''park'':1 ''sumo'':8 ''taut'':4 ''wrestler'':9', '1', '2013-05-26T14:50:58.951000', 109, 'PG-13', 2006, 3, '4.99', '14.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Park Citizen'), + ('A Unbelieveable Epistle of a Sumo Wrestler And a Hunter who must Build a Composer in Berlin', '''berlin'':19 ''build'':15 ''compos'':17 ''epistl'':5 ''graffiti'':1 ''hunter'':12 ''love'':2 ''must'':14 ''sumo'':8 ''unbeliev'':4 ''wrestler'':9', '1', '2013-05-26T14:50:58.951000', 117, 'PG', 2006, 3, '0.99', '29.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Graffiti Love'), + ('A Fanciful Documentary of a Pioneer And a Boat who must Pursue a Pioneer in An Abandoned Mine Shaft', '''abandon'':19 ''boat'':11 ''bubbl'':2 ''documentari'':5 ''fanci'':4 ''mask'':1 ''mine'':20 ''must'':13 ''pioneer'':8,16 ''pursu'':14 ''shaft'':21', '1', '2013-05-26T14:50:58.951000', 151, 'PG-13', 2006, 6, '0.99', '12.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Masked Bubble'), + ('A Beautiful Reflection of a Student And a Student who must Fight a Moose in Berlin', '''beauti'':4 ''berlin'':18 ''breakfast'':1 ''fight'':14 ''goldfing'':2 ''moos'':16 ''must'':13 ''reflect'':5 ''student'':8,11', '1', '2013-05-26T14:50:58.951000', 123, 'G', 2006, 5, '4.99', '18.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Breakfast Goldfinger'), + ('A Taut Documentary of a Waitress And a Mad Scientist who must Battle a Technical Writer in New Orleans', '''battl'':15 ''documentari'':5 ''kill'':2 ''mad'':11 ''must'':14 ''new'':20 ''orlean'':21 ''scientist'':12 ''taut'':4 ''technic'':17 ''unfaith'':1 ''waitress'':8 ''writer'':18', '1', '2013-05-26T14:50:58.951000', 78, 'R', 2006, 7, '2.99', '12.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Unfaithful Kill'), + ('A Thrilling Yarn of a Database Administrator And a Robot who must Battle a Database Administrator in Ancient India', '''administr'':9,18 ''ancient'':20 ''battl'':15 ''bird'':2 ''california'':1 ''databas'':8,17 ''india'':21 ''must'':14 ''robot'':12 ''thrill'':4 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 75, 'NC-17', 2006, 4, '4.99', '19.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'California Birds'), + ('A Lacklusture Character Study of a Mad Scientist And a Womanizer who must Outrace a Explorer in A Monastery', '''charact'':5 ''cyclon'':2 ''explor'':18 ''invas'':1 ''lacklustur'':4 ''mad'':9 ''monasteri'':21 ''must'':15 ''outrac'':16 ''scientist'':10 ''studi'':6 ''woman'':13', '1', '2013-05-26T14:50:58.951000', 97, 'PG', 2006, 5, '2.99', '12.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Invasion Cyclone'), + ('A Stunning Drama of a Robot And a Feminist who must Outgun a Butler in Nigeria', '''butler'':16 ''drama'':5 ''feminist'':11 ''hustler'':2 ''loser'':1 ''must'':13 ''nigeria'':18 ''outgun'':14 ''robot'':8 ''stun'':4', '1', '2013-05-26T14:50:58.951000', 80, 'PG', 2006, 5, '4.99', '28.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Loser Hustler'), + ('A Awe-Inspiring Drama of a Technical Writer And a Composer who must Reach a Pastry Chef in A U-Boat', '''awe'':5 ''awe-inspir'':4 ''boat'':25 ''chef'':20 ''compos'':14 ''devil'':2 ''drama'':7 ''fidel'':1 ''inspir'':6 ''must'':16 ''pastri'':19 ''reach'':17 ''technic'':10 ''u'':24 ''u-boat'':23 ''writer'':11', '1', '2013-05-26T14:50:58.951000', 118, 'G', 2006, 5, '4.99', '11.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Fidelity Devil'), + ('A Beautiful Documentary of a Forensic Psychologist And a Cat who must Reach a Astronaut in Nigeria', '''astronaut'':17 ''beauti'':4 ''cat'':12 ''documentari'':5 ''forens'':8 ''maud'':1 ''mod'':2 ''must'':14 ''nigeria'':19 ''psychologist'':9 ''reach'':15', '1', '2013-05-26T14:50:58.951000', 72, 'R', 2006, 6, '0.99', '20.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Maude Mod'), + ('A Amazing Tale of a Crocodile And a Squirrel who must Discover a Composer in Australia', '''amaz'':4 ''australia'':18 ''compos'':16 ''crocodil'':8 ''crusad'':2 ''deep'':1 ''discov'':14 ''must'':13 ''squirrel'':11 ''tale'':5', '1', '2013-05-26T14:50:58.951000', 51, 'PG-13', 2006, 6, '4.99', '20.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Deep Crusade'), + ('A Beautiful Yarn of a Teacher And a Cat who must Build a Car in A U-Boat', '''beauti'':4 ''boat'':21 ''build'':14 ''car'':16 ''cat'':11 ''destin'':1 ''jerk'':2 ''must'':13 ''teacher'':8 ''u'':20 ''u-boat'':19 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 76, 'PG-13', 2006, 3, '0.99', '19.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Destination Jerk'), + ('A Beautiful Story of a Monkey And a Sumo Wrestler who must Conquer a A Shark in A MySQL Convention', '''apollo'':2 ''beauti'':4 ''conquer'':15 ''convent'':22 ''monkey'':8 ''must'':14 ''mysql'':21 ''shark'':18 ''stori'':5 ''sumo'':11 ''wild'':1 ''wrestler'':12', '1', '2013-05-26T14:50:58.951000', 181, 'R', 2006, 4, '0.99', '24.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Wild Apollo'), + ('A Stunning Story of a Technical Writer And a Hunter who must Succumb a Secret Agent in A Baloon', '''agent'':18 ''baloon'':21 ''drop'':2 ''hunter'':12 ''must'':14 ''privat'':1 ''secret'':17 ''stori'':5 ''stun'':4 ''succumb'':15 ''technic'':8 ''writer'':9', '1', '2013-05-26T14:50:58.951000', 106, 'PG', 2006, 7, '4.99', '26.99', ARRAY['Trailers']::text[], 'Private Drop'), + ('A Thoughtful Display of a Woman And a Astronaut who must Battle a Robot in Berlin', '''angel'':1 ''astronaut'':11 ''battl'':14 ''berlin'':18 ''display'':5 ''life'':2 ''must'':13 ''robot'':16 ''thought'':4 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 74, 'G', 2006, 3, '2.99', '15.99', ARRAY['Trailers']::text[], 'Angels Life'), + ('A Stunning Character Study of a Dentist And a Mad Cow who must Find a Teacher in Nigeria', '''charact'':5 ''cow'':13 ''dentist'':9 ''earring'':1 ''find'':16 ''instinct'':2 ''mad'':12 ''must'':15 ''nigeria'':20 ''studi'':6 ''stun'':4 ''teacher'':18', '1', '2013-05-26T14:50:58.951000', 98, 'R', 2006, 3, '0.99', '22.99', ARRAY['Behind the Scenes']::text[], 'Earring Instinct'), + ('A Epic Display of a Pioneer And a Student who must Challenge a Butler in The Gulf of Mexico', '''beethoven'':1 ''butler'':16 ''challeng'':14 ''display'':5 ''epic'':4 ''exorcist'':2 ''gulf'':19 ''mexico'':21 ''must'':13 ''pioneer'':8 ''student'':11', '1', '2013-05-26T14:50:58.951000', 151, 'PG-13', 2006, 6, '0.99', '26.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Beethoven Exorcist'), + ('A Fateful Reflection of a Dog And a Mad Scientist who must Meet a Mad Scientist in New Orleans', '''armageddon'':2 ''dog'':8 ''fate'':4 ''ladybug'':1 ''mad'':11,17 ''meet'':15 ''must'':14 ''new'':20 ''orlean'':21 ''reflect'':5 ''scientist'':12,18', '1', '2013-05-26T14:50:58.951000', 113, 'NC-17', 2006, 4, '0.99', '13.99', ARRAY['Deleted Scenes']::text[], 'Ladybugs Armageddon'), + ('A Fateful Story of a Girl And a Composer who must Conquer a Husband in A Shark Tank', '''butterfli'':1 ''chocolat'':2 ''compos'':11 ''conquer'':14 ''fate'':4 ''girl'':8 ''husband'':16 ''must'':13 ''shark'':19 ''stori'':5 ''tank'':20', '1', '2013-05-26T14:50:58.951000', 89, 'G', 2006, 3, '0.99', '17.99', ARRAY['Behind the Scenes']::text[], 'Butterfly Chocolat'), + ('A Astounding Character Study of a Secret Agent And a Robot who must Build a A Shark in Berlin', '''agent'':10 ''astound'':4 ''berlin'':21 ''build'':16 ''charact'':5 ''greatest'':1 ''must'':15 ''north'':2 ''robot'':13 ''secret'':9 ''shark'':19 ''studi'':6', '1', '2013-05-26T14:50:58.951000', 93, 'NC-17', 2006, 5, '2.99', '24.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Greatest North'), + ('A Boring Drama of a Man And a Forensic Psychologist who must Face a Frisbee in Ancient India', '''ancient'':19 ''bore'':4 ''drama'':5 ''face'':15 ''forens'':11 ''frisbe'':17 ''india'':20 ''man'':8 ''mile'':2 ''must'':14 ''psychologist'':12 ''tuxedo'':1', '1', '2013-05-26T14:50:58.951000', 152, 'R', 2006, 3, '2.99', '24.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Tuxedo Mile'), + ('A Fateful Documentary of a Pastry Chef And a Butler who must Build a Dog in The Canadian Rockies', '''build'':15 ''butler'':12 ''canadian'':20 ''chef'':9 ''documentari'':5 ''dog'':17 ''fate'':4 ''glass'':2 ''must'':14 ''pastri'':8 ''primari'':1 ''rocki'':21', '1', '2013-05-26T14:50:58.951000', 53, 'G', 2006, 7, '0.99', '16.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Primary Glass'), + ('A Unbelieveable Epistle of a Robot And a Husband who must Chase a Robot in The First Manned Space Station', '''chariot'':1 ''chase'':14 ''conspiraci'':2 ''epistl'':5 ''first'':19 ''husband'':11 ''man'':20 ''must'':13 ''robot'':8,16 ''space'':21 ''station'':22 ''unbeliev'':4', '1', '2013-05-26T14:50:58.951000', 71, 'R', 2006, 5, '2.99', '29.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Chariots Conspiracy'), + ('A Stunning Character Study of a Mad Scientist And a Mad Cow who must Kill a Car in A Monastery', '''backlash'':1 ''car'':19 ''charact'':5 ''cow'':14 ''kill'':17 ''mad'':9,13 ''monasteri'':22 ''must'':16 ''scientist'':10 ''studi'':6 ''stun'':4 ''undef'':2', '1', '2013-05-26T14:50:58.951000', 118, 'PG-13', 2006, 3, '4.99', '24.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Backlash Undefeated'), + ('A Emotional Yarn of a Girl And a Dog who must Challenge a Composer in Ancient Japan', '''alter'':2 ''ancient'':18 ''challeng'':14 ''compos'':16 ''dog'':11 ''dwarf'':1 ''emot'':4 ''girl'':8 ''japan'':19 ''must'':13 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 101, 'G', 2006, 6, '2.99', '13.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Dwarfs Alter'), + ('A Lacklusture Display of a Crocodile And a Butler who must Overcome a Monkey in A U-Boat', '''boat'':21 ''butler'':11 ''crocodil'':8 ''display'':5 ''disturb'':1 ''lacklustur'':4 ''monkey'':16 ''must'':13 ''overcom'':14 ''scarfac'':2 ''u'':20 ''u-boat'':19', '1', '2013-05-26T14:50:58.951000', 94, 'R', 2006, 6, '2.99', '27.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Disturbing Scarface'), + ('A Thrilling Yarn of a Feminist And a Hunter who must Fight a Technical Writer in A Shark Tank', '''atlanti'':1 ''caus'':2 ''feminist'':8 ''fight'':14 ''hunter'':11 ''must'':13 ''shark'':20 ''tank'':21 ''technic'':16 ''thrill'':4 ''writer'':17 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 170, 'G', 2006, 6, '2.99', '15.99', ARRAY['Behind the Scenes']::text[], 'Atlantis Cause'), + ('A Thoughtful Character Study of a Frisbee And a Mad Cow who must Outgun a Man in Ancient India', '''ancient'':20 ''charact'':5 ''cow'':13 ''diari'':1 ''frisbe'':9 ''india'':21 ''mad'':12 ''man'':18 ''must'':15 ''outgun'':16 ''panic'':2 ''studi'':6 ''thought'':4', '1', '2013-05-26T14:50:58.951000', 107, 'G', 2006, 7, '2.99', '20.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Diary Panic'), + ('A Astounding Drama of a Crocodile And a Mad Cow who must Build a Robot in A Jet Boat', '''astound'':4 ''boat'':21 ''build'':15 ''campus'':1 ''cow'':12 ''crocodil'':8 ''drama'':5 ''jet'':20 ''mad'':11 ''must'':14 ''rememb'':2 ''robot'':17', '1', '2013-05-26T14:50:58.951000', 167, 'R', 2006, 5, '2.99', '27.99', ARRAY['Behind the Scenes']::text[], 'Campus Remember'), + ('A Emotional Display of a Husband And a A Shark who must Succumb a Madman in A Manhattan Penthouse', '''display'':5 ''emot'':4 ''gather'':2 ''husband'':8 ''madman'':17 ''manhattan'':20 ''must'':14 ''penthous'':21 ''shark'':12 ''succumb'':15 ''tycoon'':1', '1', '2013-05-26T14:50:58.951000', 82, 'G', 2006, 3, '4.99', '17.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Tycoon Gathering'), + ('A Stunning Reflection of a Student And a Technical Writer who must Battle a Butler in The First Manned Space Station', '''battl'':15 ''butler'':17 ''first'':20 ''inch'':2 ''lose'':1 ''man'':21 ''must'':14 ''reflect'':5 ''space'':22 ''station'':23 ''student'':8 ''stun'':4 ''technic'':11 ''writer'':12', '1', '2013-05-26T14:50:58.951000', 137, 'R', 2006, 3, '0.99', '18.99', ARRAY['Trailers', 'Commentaries']::text[], 'Lose Inch'), + ('A Stunning Display of a Moose And a Database Administrator who must Pursue a Composer in A Jet Boat', '''administr'':12 ''boat'':21 ''compos'':17 ''databas'':11 ''display'':5 ''gabl'':2 ''jet'':20 ''maker'':1 ''moos'':8 ''must'':14 ''pursu'':15 ''stun'':4', '1', '2013-05-26T14:50:58.951000', 136, 'PG-13', 2006, 4, '0.99', '12.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Maker Gables'), + ('A Epic Panorama of a Mad Scientist And a Monkey who must Redeem a Secret Agent in Berlin', '''agent'':18 ''berlin'':20 ''donni'':2 ''epic'':4 ''gosford'':1 ''mad'':8 ''monkey'':12 ''must'':14 ''panorama'':5 ''redeem'':15 ''scientist'':9 ''secret'':17', '1', '2013-05-26T14:50:58.951000', 129, 'G', 2006, 5, '4.99', '17.99', ARRAY['Commentaries']::text[], 'Gosford Donnie'), + ('A Fateful Saga of a Cat And a Frisbee who must Kill a Girl in A Manhattan Penthouse', '''cat'':8 ''fate'':4 ''frisbe'':11 ''girl'':16 ''kill'':14 ''manhattan'':19 ''must'':13 ''paradis'':2 ''penthous'':20 ''saga'':5 ''secret'':1', '1', '2013-05-26T14:50:58.951000', 109, 'G', 2006, 3, '4.99', '24.99', ARRAY['Trailers', 'Commentaries']::text[], 'Secrets Paradise'), + ('A Fanciful Saga of a Hunter And a Pastry Chef who must Vanquish a Boy in Australia', '''alaska'':1 ''australia'':19 ''boy'':17 ''chef'':12 ''fanci'':4 ''hunter'':8 ''must'':14 ''pastri'':11 ''phantom'':2 ''saga'':5 ''vanquish'':15', '1', '2013-05-26T14:50:58.951000', 136, 'PG', 2006, 6, '0.99', '22.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Alaska Phantom'), + ('A Fateful Tale of a Squirrel And a Forensic Psychologist who must Redeem a Man in Nigeria', '''comanchero'':2 ''fate'':4 ''forens'':11 ''forrest'':1 ''man'':17 ''must'':14 ''nigeria'':19 ''psychologist'':12 ''redeem'':15 ''squirrel'':8 ''tale'':5', '1', '2013-05-26T14:50:58.951000', 112, 'NC-17', 2006, 7, '4.99', '22.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Forrester Comancheros'), + ('A Astounding Character Study of a Composer And a Student who must Overcome a Composer in A Monastery', '''astound'':4 ''carol'':1 ''charact'':5 ''compos'':9,17 ''monasteri'':20 ''must'':14 ''overcom'':15 ''student'':12 ''studi'':6 ''texa'':2', '1', '2013-05-26T14:50:58.951000', 151, 'PG', 2006, 4, '2.99', '15.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Carol Texas'), + ('A Fateful Epistle of a Moose And a Monkey who must Confront a Lumberjack in Ancient China', '''ancient'':18 ''boulevard'':1 ''china'':19 ''confront'':14 ''epistl'':5 ''fate'':4 ''lumberjack'':16 ''mob'':2 ''monkey'':11 ''moos'':8 ''must'':13', '1', '2013-05-26T14:50:58.951000', 63, 'R', 2006, 3, '0.99', '11.99', ARRAY['Trailers']::text[], 'Boulevard Mob'), + ('A Insightful Documentary of a Hunter And a Dentist who must Confront a Crocodile in A Baloon', '''baloon'':19 ''confront'':14 ''crocodil'':16 ''dentist'':11 ''documentari'':5 ''hunter'':8 ''insight'':4 ''moonwalk'':2 ''must'':13 ''rang'':1', '1', '2013-05-26T14:50:58.951000', 147, 'PG', 2006, 3, '4.99', '25.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Range Moonwalker'), + ('A Stunning Reflection of a Cat And a Woman who must Find a Astronaut in Ancient Japan', '''ancient'':18 ''astronaut'':16 ''cat'':8 ''confidenti'':1 ''find'':14 ''interview'':2 ''japan'':19 ''must'':13 ''reflect'':5 ''stun'':4 ''woman'':11', '1', '2013-05-26T14:50:58.951000', 180, 'NC-17', 2006, 6, '4.99', '13.99', ARRAY['Commentaries']::text[], 'Confidential Interview'), + ('A Insightful Drama of a A Shark And a Pioneer who must Find a Womanizer in The Outback', '''chamber'':2 ''drama'':5 ''find'':15 ''insight'':4 ''must'':14 ''outback'':20 ''pioneer'':12 ''shark'':9 ''wanda'':1 ''woman'':17', '1', '2013-05-26T14:50:58.951000', 107, 'PG-13', 2006, 7, '4.99', '23.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Wanda Chamber'), + ('A Lacklusture Display of a Robot And a Girl who must Defeat a Sumo Wrestler in A MySQL Convention', '''coldblood'':2 ''convent'':21 ''defeat'':14 ''display'':5 ''girl'':11 ''lacklustur'':4 ''must'':13 ''mysql'':20 ''robot'':8 ''sumo'':16 ''wizard'':1 ''wrestler'':17', '1', '2013-05-26T14:50:58.951000', 75, 'PG', 2006, 4, '4.99', '12.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Wizard Coldblooded'), + ('A Amazing Drama of a Car And a Robot who must Pursue a Dentist in New Orleans', '''amaz'':4 ''car'':8 ''clone'':1 ''dentist'':16 ''drama'':5 ''must'':13 ''new'':18 ''orlean'':19 ''pinocchio'':2 ''pursu'':14 ''robot'':11', '1', '2013-05-26T14:50:58.951000', 124, 'R', 2006, 6, '2.99', '16.99', ARRAY['Behind the Scenes']::text[], 'Clones Pinocchio'), + ('A Beautiful Epistle of a Madman And a Butler who must Face a Crocodile in A Manhattan Penthouse', '''beauti'':4 ''butler'':11 ''crocodil'':16 ''epistl'':5 ''face'':14 ''leagu'':2 ''madman'':8 ''manhattan'':19 ''must'':13 ''penthous'':20 ''sunris'':1', '1', '2013-05-26T14:50:58.951000', 135, 'PG-13', 2006, 3, '4.99', '19.99', ARRAY['Behind the Scenes']::text[], 'Sunrise League'), + ('A Thrilling Drama of a Girl And a Robot who must Redeem a Waitress in An Abandoned Mine Shaft', '''abandon'':19 ''drama'':5 ''girl'':8 ''lolita'':1 ''mine'':20 ''must'':13 ''redeem'':14 ''robot'':11 ''shaft'':21 ''thrill'':4 ''waitress'':16 ''world'':2', '1', '2013-05-26T14:50:58.951000', 155, 'NC-17', 2006, 4, '2.99', '25.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Lolita World'), + ('A Fanciful Drama of a Frisbee And a Dog who must Fight a Madman in A Jet Boat', '''boat'':20 ''dog'':11 ''drama'':5 ''fanci'':4 ''fight'':14 ''frisbe'':8 ''jet'':19 ''madman'':16 ''must'':13 ''person'':2 ''sting'':1', '1', '2013-05-26T14:50:58.951000', 93, 'NC-17', 2006, 3, '4.99', '9.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Sting Personal'), + ('A Beautiful Epistle of a Secret Agent And a Pioneer who must Chase a Astronaut in Ancient China', '''agent'':9 ''ancient'':19 ''astronaut'':17 ''beauti'':4 ''chase'':15 ''china'':20 ''epistl'':5 ''lebowski'':1 ''must'':14 ''pioneer'':12 ''secret'':8 ''soldier'':2', '1', '2013-05-26T14:50:58.951000', 69, 'PG-13', 2006, 6, '2.99', '17.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Lebowski Soldiers'), + ('A Thoughtful Drama of a Dentist And a Womanizer who must Meet a Husband in The Sahara Desert', '''dentist'':8 ''desert'':20 ''drama'':5 ''husband'':16 ''jumanji'':2 ''meet'':14 ''must'':13 ''oklahoma'':1 ''sahara'':19 ''thought'':4 ''woman'':11', '1', '2013-05-26T14:50:58.951000', 58, 'PG', 2006, 7, '0.99', '15.99', ARRAY['Behind the Scenes']::text[], 'Oklahoma Jumanji'), + ('A Lacklusture Epistle of a Girl And a A Shark who must Meet a Mad Scientist in Ancient China', '''ancient'':20 ''china'':21 ''epistl'':5 ''girl'':8 ''graduat'':1 ''lacklustur'':4 ''lord'':2 ''mad'':17 ''meet'':15 ''must'':14 ''scientist'':18 ''shark'':12', '1', '2013-05-26T14:50:58.951000', 156, 'G', 2006, 7, '2.99', '14.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Graduate Lord'), + ('A Insightful Reflection of a Waitress And a Madman who must Pursue a Boy in Ancient Japan', '''ancient'':18 ''boy'':16 ''game'':2 ''holiday'':1 ''insight'':4 ''japan'':19 ''madman'':11 ''must'':13 ''pursu'':14 ''reflect'':5 ''waitress'':8', '1', '2013-05-26T14:50:58.951000', 78, 'PG-13', 2006, 7, '4.99', '10.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Holiday Games'), + ('A Unbelieveable Panorama of a Pioneer And a Husband who must Meet a Mad Cow in An Abandoned Mine Shaft', '''abandon'':20 ''comfort'':1 ''cow'':17 ''husband'':11 ''mad'':16 ''meet'':14 ''mine'':21 ''must'':13 ''panorama'':5 ''pioneer'':8 ''rush'':2 ''shaft'':22 ''unbeliev'':4', '1', '2013-05-26T14:50:58.951000', 76, 'NC-17', 2006, 3, '2.99', '19.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Comforts Rush'), + ('A Action-Packed Character Study of a Forensic Psychologist And a Girl who must Build a Dentist in The Outback', '''ace'':2 ''action'':5 ''action-pack'':4 ''build'':18 ''charact'':7 ''dentist'':20 ''dirti'':1 ''forens'':11 ''girl'':15 ''must'':17 ''outback'':23 ''pack'':6 ''psychologist'':12 ''studi'':8', '1', '2013-05-26T14:50:58.951000', 147, 'NC-17', 2006, 7, '2.99', '29.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Dirty Ace'), + ('A Amazing Documentary of a Woman And a Astronaut who must Outrace a Teacher in An Abandoned Fun House', '''abandon'':19 ''amaz'':4 ''astronaut'':11 ''documentari'':5 ''fun'':20 ''hous'':21 ''must'':13 ''outrac'':14 ''sunris'':2 ''teacher'':16 ''untouch'':1 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 120, 'NC-17', 2006, 5, '2.99', '11.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Untouchables Sunrise'), + ('A Stunning Reflection of a Girl And a Secret Agent who must Succumb a Boy in A MySQL Convention', '''agent'':12 ''boy'':17 ''convent'':21 ''galaxi'':2 ''girl'':8 ''hanov'':1 ''must'':14 ''mysql'':20 ''reflect'':5 ''secret'':11 ''stun'':4 ''succumb'':15', '1', '2013-05-26T14:50:58.951000', 47, 'NC-17', 2006, 5, '4.99', '21.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Hanover Galaxy'), + ('A Boring Story of a Woman And a Moose who must Reach a Husband in A Shark Tank', '''bore'':4 ''husband'':16 ''mermaid'':2 ''moos'':11 ''must'':13 ''reach'':14 ''rushmor'':1 ''shark'':19 ''stori'':5 ''tank'':20 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 150, 'PG-13', 2006, 6, '2.99', '17.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Rushmore Mermaid'), + ('A Stunning Panorama of a Sumo Wrestler And a Husband who must Redeem a Madman in Ancient India', '''ancient'':19 ''bright'':2 ''husband'':12 ''india'':20 ''madman'':17 ''muscl'':1 ''must'':14 ''panorama'':5 ''redeem'':15 ''stun'':4 ''sumo'':8 ''wrestler'':9', '1', '2013-05-26T14:50:58.951000', 185, 'G', 2006, 7, '2.99', '23.99', ARRAY['Deleted Scenes']::text[], 'Muscle Bright'), + ('A Fateful Character Study of a Crocodile And a Monkey who must Meet a Dentist in Australia', '''australia'':19 ''charact'':5 ''creatur'':2 ''crocodil'':9 ''dentist'':17 ''fate'':4 ''meet'':15 ''monkey'':12 ''mummi'':1 ''must'':14 ''studi'':6', '1', '2013-05-26T14:50:58.951000', 160, 'NC-17', 2006, 3, '0.99', '15.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Mummy Creatures'), + ('A Taut Documentary of a Database Administrator And a Waitress who must Reach a Mad Scientist in A Baloon Factory', '''administr'':9 ''baloon'':21 ''databas'':8 ''documentari'':5 ''factori'':22 ''gold'':1 ''mad'':17 ''must'':14 ''reach'':15 ''river'':2 ''scientist'':18 ''taut'':4 ''waitress'':12', '1', '2013-05-26T14:50:58.951000', 154, 'R', 2006, 4, '4.99', '21.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Gold River'), + ('A Emotional Character Study of a Car And a Girl who must Face a Composer in A U-Boat', '''boat'':22 ''car'':9 ''charact'':5 ''compos'':17 ''emot'':4 ''face'':15 ''girl'':12 ''must'':14 ''silenc'':2 ''studi'':6 ''suicid'':1 ''u'':21 ''u-boat'':20', '1', '2013-05-26T14:50:58.951000', 93, 'G', 2006, 4, '4.99', '13.99', ARRAY['Deleted Scenes']::text[], 'Suicides Silence'), + ('A Astounding Tale of a Mad Scientist And a Husband who must Redeem a Database Administrator in Ancient Japan', '''administr'':18 ''agent'':2 ''ancient'':20 ''astound'':4 ''databas'':17 ''husband'':12 ''japan'':21 ''lola'':1 ''mad'':8 ''must'':14 ''redeem'':15 ''scientist'':9 ''tale'':5', '1', '2013-05-26T14:50:58.951000', 85, 'PG', 2006, 4, '4.99', '24.99', ARRAY['Trailers', 'Commentaries']::text[], 'Lola Agent'), + ('A Beautiful Drama of a Pioneer And a Crocodile who must Challenge a Student in The Outback', '''beauti'':4 ''challeng'':14 ''crocodil'':11 ''drama'':5 ''innoc'':1 ''must'':13 ''outback'':19 ''pioneer'':8 ''student'':16 ''usual'':2', '1', '2013-05-26T14:50:58.951000', 178, 'PG-13', 2006, 3, '4.99', '26.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Innocent Usual'), + ('A Taut Documentary of a Car And a Robot who must Conquer a Boy in The Canadian Rockies', '''boy'':16 ''canadian'':19 ''car'':8 ''conquer'':14 ''documentari'':5 ''must'':13 ''robot'':11 ''rocki'':20 ''shine'':2 ''sweden'':1 ''taut'':4', '1', '2013-05-26T14:50:58.951000', 176, 'PG', 2006, 6, '4.99', '19.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Sweden Shining'), + ('A Thoughtful Display of a Explorer And a Pastry Chef who must Overcome a Feminist in The Sahara Desert', '''analyz'':1 ''chef'':12 ''desert'':21 ''display'':5 ''explor'':8 ''feminist'':17 ''hoosier'':2 ''must'':14 ''overcom'':15 ''pastri'':11 ''sahara'':20 ''thought'':4', '1', '2013-05-26T14:50:58.951000', 181, 'R', 2006, 6, '2.99', '19.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Analyze Hoosiers'), + ('A Intrepid Drama of a Moose And a Boat who must Kill a Explorer in A Manhattan Penthouse', '''boat'':11 ''drama'':5 ''explor'':16 ''intrepid'':4 ''jaw'':2 ''kill'':14 ''manhattan'':19 ''moos'':8 ''must'':13 ''penthous'':20 ''wagon'':1', '1', '2013-05-26T14:50:58.951000', 152, 'PG', 2006, 7, '2.99', '17.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Wagon Jaws'), + ('A Awe-Inspiring Tale of a Girl And a Madman who must Outgun a Student in A Shark Tank', '''awe'':5 ''awe-inspir'':4 ''frida'':2 ''girl'':10 ''hocus'':1 ''inspir'':6 ''madman'':13 ''must'':15 ''outgun'':16 ''shark'':21 ''student'':18 ''tale'':7 ''tank'':22', '1', '2013-05-26T14:50:58.951000', 141, 'G', 2006, 4, '2.99', '19.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Hocus Frida'), + ('A Lacklusture Drama of a Waitress And a Husband who must Fight a Husband in California', '''california'':18 ''drama'':5 ''fight'':14 ''husband'':11,16 ''insect'':2 ''lacklustur'':4 ''mermaid'':1 ''must'':13 ''waitress'':8', '1', '2013-05-26T14:50:58.951000', 104, 'NC-17', 2006, 5, '4.99', '20.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Mermaid Insects'), + ('A Stunning Drama of a Butler And a Madman who must Outrace a Womanizer in Ancient India', '''ancient'':18 ''butler'':8 ''drama'':5 ''earth'':1 ''india'':19 ''madman'':11 ''must'':13 ''outrac'':14 ''stun'':4 ''vision'':2 ''woman'':16', '1', '2013-05-26T14:50:58.951000', 85, 'NC-17', 2006, 7, '0.99', '29.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Earth Vision'), + ('A Brilliant Documentary of a Monkey And a Car who must Conquer a Crocodile in A Shark Tank', '''brilliant'':4 ''car'':11 ''conquer'':14 ''crocodil'':16 ''documentari'':5 ''eve'':2 ''excit'':1 ''monkey'':8 ''must'':13 ''shark'':19 ''tank'':20', '1', '2013-05-26T14:50:58.951000', 51, 'G', 2006, 3, '0.99', '20.99', ARRAY['Commentaries']::text[], 'Excitement Eve'), + ('A Emotional Tale of a Robot And a Sumo Wrestler who must Redeem a Pastry Chef in A Baloon Factory', '''baloon'':21 ''chef'':18 ''emot'':4 ''factori'':22 ''must'':14 ''pastri'':17 ''rear'':2 ''redeem'':15 ''robot'':8 ''sensibl'':1 ''sumo'':11 ''tale'':5 ''wrestler'':12', '1', '2013-05-26T14:50:58.951000', 98, 'PG', 2006, 7, '4.99', '15.99', ARRAY['Behind the Scenes']::text[], 'Sensibility Rear'), + ('A Stunning Saga of a Mad Scientist And a Forensic Psychologist who must Challenge a Squirrel in A MySQL Convention', '''bill'':1 ''challeng'':16 ''convent'':22 ''forens'':12 ''mad'':8 ''must'':15 ''mysql'':21 ''other'':2 ''psychologist'':13 ''saga'':5 ''scientist'':9 ''squirrel'':18 ''stun'':4', '1', '2013-05-26T14:50:58.951000', 93, 'PG', 2006, 6, '2.99', '12.99', ARRAY['Trailers', 'Commentaries']::text[], 'Bill Others'), + ('A Unbelieveable Display of a Mad Scientist And a Mad Scientist who must Outgun a Mad Cow in Ancient Japan', '''ancient'':21 ''cow'':19 ''display'':5 ''japan'':22 ''mad'':8,12,18 ''must'':15 ''northwest'':2 ''outgun'':16 ''scientist'':9,13 ''unbeliev'':4 ''vertigo'':1', '1', '2013-05-26T14:50:58.951000', 90, 'R', 2006, 4, '2.99', '17.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Vertigo Northwest'), + ('A Awe-Inspiring Reflection of a Squirrel And a Boat who must Outrace a Car in A Jet Boat', '''awe'':5 ''awe-inspir'':4 ''boat'':13,22 ''car'':18 ''creeper'':1 ''inspir'':6 ''jet'':21 ''kane'':2 ''must'':15 ''outrac'':16 ''reflect'':7 ''squirrel'':10', '1', '2013-05-26T14:50:58.951000', 172, 'NC-17', 2006, 5, '4.99', '23.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Creepers Kane'), + ('A Thrilling Display of a Boat And a Monkey who must Meet a Composer in Ancient China', '''ancient'':18 ''boat'':8 ''china'':19 ''compos'':16 ''display'':5 ''meet'':14 ''monkey'':11 ''mussolini'':1 ''must'':13 ''spoiler'':2 ''thrill'':4', '1', '2013-05-26T14:50:58.951000', 180, 'G', 2006, 6, '2.99', '10.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Mussolini Spoilers'), + ('A Unbelieveable Display of a Dentist And a Madman who must Vanquish a Squirrel in Berlin', '''berlin'':18 ''crowd'':2 ''dentist'':8 ''display'':5 ''end'':1 ''madman'':11 ''must'':13 ''squirrel'':16 ''unbeliev'':4 ''vanquish'':14', '1', '2013-05-26T14:50:58.951000', 85, 'NC-17', 2006, 6, '0.99', '10.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Ending Crowds'), + ('A Thoughtful Drama of a Pastry Chef And a Dentist who must Pursue a Girl in A Baloon', '''baloon'':20 ''chef'':9 ''circus'':1 ''dentist'':12 ''drama'':5 ''girl'':17 ''must'':14 ''pastri'':8 ''pursu'':15 ''thought'':4 ''youth'':2', '1', '2013-05-26T14:50:58.951000', 90, 'PG-13', 2006, 5, '2.99', '13.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Circus Youth'), + ('A Thrilling Display of a Database Administrator And a Monkey who must Overcome a Dog in An Abandoned Fun House', '''abandon'':20 ''administr'':9 ''databas'':8 ''display'':5 ''dog'':17 ''fun'':21 ''harri'':2 ''hous'':22 ''jaw'':1 ''monkey'':12 ''must'':14 ''overcom'':15 ''thrill'':4', '1', '2013-05-26T14:50:58.951000', 112, 'G', 2006, 4, '2.99', '10.99', ARRAY['Deleted Scenes']::text[], 'Jaws Harry'), + ('A Awe-Inspiring Reflection of a Pastry Chef And a Teacher who must Overcome a Sumo Wrestler in A U-Boat', '''apach'':1 ''awe'':5 ''awe-inspir'':4 ''boat'':25 ''chef'':11 ''divin'':2 ''inspir'':6 ''must'':16 ''overcom'':17 ''pastri'':10 ''reflect'':7 ''sumo'':19 ''teacher'':14 ''u'':24 ''u-boat'':23 ''wrestler'':20', '1', '2013-05-26T14:50:58.951000', 92, 'NC-17', 2006, 5, '4.99', '16.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Apache Divine'), + ('A Emotional Reflection of a Sumo Wrestler And a Monkey who must Conquer a Robot in The Sahara Desert', '''conquer'':15 ''desert'':21 ''emot'':4 ''hustler'':1 ''monkey'':12 ''must'':14 ''parti'':2 ''reflect'':5 ''robot'':17 ''sahara'':20 ''sumo'':8 ''wrestler'':9', '1', '2013-05-26T14:50:58.951000', 83, 'NC-17', 2006, 3, '4.99', '22.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Hustler Party'), + ('A Action-Packed Display of a Man And a Waitress who must Build a Dog in A MySQL Convention', '''action'':5 ''action-pack'':4 ''build'':16 ''charad'':1 ''convent'':22 ''display'':7 ''dog'':18 ''duffel'':2 ''man'':10 ''must'':15 ''mysql'':21 ''pack'':6 ''waitress'':13', '1', '2013-05-26T14:50:58.951000', 66, 'PG', 2006, 3, '2.99', '21.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Charade Duffel'), + ('A Fast-Paced Story of a Crocodile And a Robot who must Find a Moose in Ancient Japan', '''ancient'':20 ''bonni'':1 ''crocodil'':10 ''fast'':5 ''fast-pac'':4 ''find'':16 ''holocaust'':2 ''japan'':21 ''moos'':18 ''must'':15 ''pace'':6 ''robot'':13 ''stori'':7', '1', '2013-05-26T14:50:58.951000', 63, 'G', 2006, 4, '0.99', '29.99', ARRAY['Deleted Scenes']::text[], 'Bonnie Holocaust'), + ('A Awe-Inspiring Documentary of a Robot And a Mad Scientist who must Reach a Database Administrator in A Shark Tank', '''administr'':20 ''awe'':5 ''awe-inspir'':4 ''daisi'':2 ''databas'':19 ''documentari'':7 ''inspir'':6 ''mad'':13 ''must'':16 ''reach'':17 ''robot'':10 ''scientist'':14 ''shark'':23 ''tank'':24 ''virgin'':1', '1', '2013-05-26T14:50:58.951000', 179, 'PG-13', 2006, 6, '4.99', '29.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Virgin Daisy'), + ('A Emotional Drama of a A Shark And a Database Administrator who must Vanquish a Pioneer in Soviet Georgia', '''administr'':13 ''alic'':1 ''databas'':12 ''drama'':5 ''emot'':4 ''fantasia'':2 ''georgia'':21 ''must'':15 ''pioneer'':18 ''shark'':9 ''soviet'':20 ''vanquish'':16', '1', '2013-05-26T14:50:58.951000', 94, 'NC-17', 2006, 6, '0.99', '23.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Alice Fantasia') + ) AS data(description, fulltext, old_language_id, last_update, length, rating, release_year, rental_duration, rental_rate, replacement_cost, special_features, title) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."language"' + AND map0.old_id = data.old_language_id + RETURNING film_id + ) + SELECT array_agg(film_id) INTO v_new_ids_film FROM inserted; + + FOR i IN 1..array_length(v_new_ids_film, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."film"', v_old_ids_film[i], v_new_ids_film[i]::TEXT); + END LOOP; + + v_old_ids_film := ARRAY['410', '271', '891', '184', '205', '207', '814', '372', '223', '568', '737', '306', '803', '162', '793', '989', '632', '81', '67', '370', '236', '147', '897', '932', '760', '99', '436', '106', '310', '622', '546', '679', '689', '555', '274', '731', '766', '341', '799', '886', '399', '446', '951', '879', '369', '500', '740', '779', '909', '258', '620', '55', '736', '585', '480', '745', '250', '588', '963', '307', '120', '844', '734', '843', '593', '829', '168', '786', '340', '336', '511', '812', '129', '346', '613', '895', '795', '741', '119', '42', '726', '198', '385', '17', '806', '672', '343', '239', '318', '464', '26', '988', '670', '608', '524', '212', '819', '308', '89', '23']; + WITH inserted AS ( + INSERT INTO "public"."film" ("description", "fulltext", "language_id", "last_update", "length", "rating", "release_year", "rental_duration", "rental_rate", "replacement_cost", "special_features", "title") + SELECT + data.description::text, + data.fulltext::tsvector, + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.length::smallint, + data.rating::mpaa_rating, + data.release_year::integer, + data.rental_duration::smallint, + data.rental_rate::numeric, + data.replacement_cost::numeric, + data.special_features::text[], + data.title::character varying + FROM (VALUES + ('A Intrepid Story of a Butler And a Car who must Vanquish a Man in New Orleans', '''butler'':8 ''car'':11 ''freedom'':2 ''heaven'':1 ''intrepid'':4 ''man'':16 ''must'':13 ''new'':18 ''orlean'':19 ''stori'':5 ''vanquish'':14', '1', '2013-05-26T14:50:58.951000', 48, 'PG', 2006, 7, '2.99', '19.99', ARRAY['Commentaries']::text[], 'Heaven Freedom'), + ('A Fateful Story of a Monkey And a Girl who must Overcome a Pastry Chef in Ancient India', '''ancient'':19 ''chef'':17 ''easi'':1 ''fate'':4 ''girl'':11 ''gladiat'':2 ''india'':20 ''monkey'':8 ''must'':13 ''overcom'':14 ''pastri'':16 ''stori'':5', '1', '2013-05-26T14:50:58.951000', 148, 'G', 2006, 5, '4.99', '12.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Easy Gladiator'), + ('A Boring Display of a Man And a Dog who must Redeem a Girl in A U-Boat', '''boat'':21 ''bore'':4 ''display'':5 ''dog'':11 ''girl'':16 ''man'':8 ''must'':13 ''redeem'':14 ''sky'':2 ''timberland'':1 ''u'':20 ''u-boat'':19', '1', '2013-05-26T14:50:58.951000', 69, 'G', 2006, 3, '0.99', '13.99', ARRAY['Commentaries']::text[], 'Timberland Sky'), + ('A Unbelieveable Tale of a Car And a Explorer who must Confront a Boat in A Manhattan Penthouse', '''boat'':16 ''car'':8 ''confront'':14 ''core'':1 ''explor'':11 ''manhattan'':19 ''must'':13 ''penthous'':20 ''suit'':2 ''tale'':5 ''unbeliev'':4', '1', '2013-05-26T14:50:58.951000', 92, 'PG-13', 2006, 3, '2.99', '24.99', ARRAY['Deleted Scenes']::text[], 'Core Suit'), + ('A Insightful Reflection of a A Shark And a Dog who must Kill a Butler in An Abandoned Amusement Park', '''abandon'':20 ''amus'':21 ''butler'':17 ''danc'':1 ''dog'':12 ''insight'':4 ''kill'':15 ''must'':14 ''none'':2 ''park'':22 ''reflect'':5 ''shark'':9', '1', '2013-05-26T14:50:58.951000', 58, 'NC-17', 2006, 3, '0.99', '22.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Dances None'), + ('A Unbelieveable Story of a Mad Scientist And a Woman who must Overcome a Dog in California', '''california'':19 ''danger'':1 ''dog'':17 ''mad'':8 ''must'':14 ''overcom'':15 ''scientist'':9 ''stori'':5 ''unbeliev'':4 ''uptown'':2 ''woman'':12', '1', '2013-05-26T14:50:58.951000', 121, 'PG', 2006, 7, '4.99', '26.99', ARRAY['Commentaries']::text[], 'Dangerous Uptown'), + ('A Insightful Panorama of a Woman And a Feminist who must Defeat a Forensic Psychologist in Berlin', '''berlin'':19 ''defeat'':14 ''feminist'':11 ''forens'':16 ''insight'':4 ''must'':13 ''panorama'':5 ''psychologist'':17 ''slipper'':2 ''snatch'':1 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 110, 'PG', 2006, 6, '4.99', '15.99', ARRAY['Commentaries']::text[], 'Snatch Slipper'), + ('A Taut Display of a Cat And a Girl who must Overcome a Database Administrator in New Orleans', '''administr'':17 ''cat'':8 ''databas'':16 ''display'':5 ''dynamit'':2 ''girl'':11 ''graceland'':1 ''must'':13 ''new'':19 ''orlean'':20 ''overcom'':14 ''taut'':4', '1', '2013-05-26T14:50:58.951000', 140, 'R', 2006, 5, '4.99', '26.99', ARRAY['Trailers', 'Commentaries']::text[], 'Graceland Dynamite'), + ('A Fast-Paced Tale of a Dog And a Forensic Psychologist who must Meet a Astronaut in The First Manned Space Station', '''alien'':2 ''astronaut'':19 ''desir'':1 ''dog'':10 ''fast'':5 ''fast-pac'':4 ''first'':22 ''forens'':13 ''man'':23 ''meet'':17 ''must'':16 ''pace'':6 ''psychologist'':14 ''space'':24 ''station'':25 ''tale'':7', '1', '2013-05-26T14:50:58.951000', 76, 'NC-17', 2006, 7, '2.99', '24.99', ARRAY['Deleted Scenes']::text[], 'Desire Alien'), + ('A Touching Epistle of a Squirrel And a Explorer who must Redeem a Pastry Chef in The Sahara Desert', '''chef'':17 ''desert'':21 ''epistl'':5 ''explor'':11 ''memento'':1 ''must'':13 ''pastri'':16 ''redeem'':14 ''sahara'':20 ''squirrel'':8 ''touch'':4 ''zooland'':2', '1', '2013-05-26T14:50:58.951000', 77, 'NC-17', 2006, 4, '4.99', '11.99', ARRAY['Behind the Scenes']::text[], 'Memento Zoolander'), + ('A Astounding Character Study of a Robot And a Moose who must Overcome a Astronaut in Ancient India', '''ancient'':19 ''astound'':4 ''astronaut'':17 ''charact'':5 ''india'':20 ''instinct'':2 ''moos'':12 ''must'':14 ''overcom'':15 ''robot'':9 ''rock'':1 ''studi'':6', '1', '2013-05-26T14:50:58.951000', 102, 'G', 2006, 4, '0.99', '28.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Rock Instinct'), + ('A Thoughtful Yarn of a Monkey And a Teacher who must Find a Dog in Australia', '''australia'':18 ''dog'':16 ''feather'':1 ''find'':14 ''metal'':2 ''monkey'':8 ''must'':13 ''teacher'':11 ''thought'':4 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 104, 'PG-13', 2006, 3, '0.99', '12.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Feathers Metal'), + ('A Fast-Paced Tale of a A Shark And a Student who must Meet a Crocodile in Ancient China', '''ancient'':21 ''china'':22 ''crocodil'':19 ''fast'':5 ''fast-pac'':4 ''liaison'':2 ''meet'':17 ''must'':16 ''pace'':6 ''shark'':11 ''slacker'':1 ''student'':14 ''tale'':7', '1', '2013-05-26T14:50:58.951000', 179, 'R', 2006, 7, '4.99', '29.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Slacker Liaisons'), + ('A Taut Tale of a Car And a Pioneer who must Conquer a Sumo Wrestler in An Abandoned Fun House', '''abandon'':20 ''bucket'':2 ''car'':8 ''clueless'':1 ''conquer'':14 ''fun'':21 ''hous'':22 ''must'':13 ''pioneer'':11 ''sumo'':16 ''tale'':5 ''taut'':4 ''wrestler'':17', '1', '2013-05-26T14:50:58.951000', 95, 'R', 2006, 4, '2.99', '13.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Clueless Bucket'), + ('A Fateful Character Study of a Waitress And a Technical Writer who must Battle a Hunter in A Baloon', '''baloon'':21 ''battl'':16 ''charact'':5 ''divin'':2 ''fate'':4 ''hunter'':18 ''must'':15 ''shrunk'':1 ''studi'':6 ''technic'':12 ''waitress'':9 ''writer'':13', '1', '2013-05-26T14:50:58.951000', 139, 'R', 2006, 6, '2.99', '14.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Shrunk Divine'), + ('A Stunning Epistle of a Dentist And a Dog who must Kill a Madman in Ancient China', '''ancient'':18 ''china'':19 ''dentist'':8 ''dog'':11 ''epistl'':5 ''kill'':14 ''madman'':16 ''microcosmo'':2 ''must'':13 ''stun'':4 ''work'':1', '1', '2013-05-26T14:50:58.951000', 74, 'R', 2006, 4, '4.99', '22.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Working Microcosmos'), + ('A Thoughtful Drama of a Explorer And a Womanizer who must Meet a Teacher in California', '''california'':18 ''drama'':5 ''explor'':8 ''meet'':14 ''must'':13 ''nut'':1 ''teacher'':16 ''thought'':4 ''tie'':2 ''woman'':11', '1', '2013-05-26T14:50:58.951000', 145, 'NC-17', 2006, 5, '4.99', '10.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Nuts Ties'), + ('A Touching Drama of a Robot And a Dentist who must Meet a Hunter in A Jet Boat', '''blind'':1 ''boat'':20 ''dentist'':11 ''drama'':5 ''gun'':2 ''hunter'':16 ''jet'':19 ''meet'':14 ''must'':13 ''robot'':8 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 103, 'PG-13', 2006, 6, '4.99', '29.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Blindness Gun'), + ('A Taut Saga of a Crocodile And a Boy who must Overcome a Technical Writer in Ancient China', '''agent'':2 ''ancient'':19 ''beret'':1 ''boy'':11 ''china'':20 ''crocodil'':8 ''must'':13 ''overcom'':14 ''saga'':5 ''taut'':4 ''technic'':16 ''writer'':17', '1', '2013-05-26T14:50:58.951000', 77, 'PG-13', 2006, 5, '2.99', '24.99', ARRAY['Deleted Scenes']::text[], 'Berets Agent'), + ('A Action-Packed Display of a Sumo Wrestler And a Car who must Overcome a Waitress in A Baloon Factory', '''action'':5 ''action-pack'':4 ''baloon'':22 ''bingo'':2 ''car'':14 ''display'':7 ''factori'':23 ''gorgeous'':1 ''must'':16 ''overcom'':17 ''pack'':6 ''sumo'':10 ''waitress'':19 ''wrestler'':11', '1', '2013-05-26T14:50:58.951000', 108, 'R', 2006, 4, '2.99', '26.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Gorgeous Bingo'), + ('A Boring Character Study of a Man And a Womanizer who must Succumb a Teacher in An Abandoned Amusement Park', '''abandon'':20 ''amus'':21 ''bore'':4 ''charact'':5 ''divin'':1 ''man'':9 ''must'':14 ''park'':22 ''resurrect'':2 ''studi'':6 ''succumb'':15 ''teacher'':17 ''woman'':12', '1', '2013-05-26T14:50:58.951000', 100, 'R', 2006, 4, '2.99', '19.99', ARRAY['Trailers', 'Commentaries']::text[], 'Divine Resurrection'), + ('A Action-Packed Epistle of a Dentist And a Moose who must Meet a Mad Cow in Ancient Japan', '''action'':5 ''action-pack'':4 ''ancient'':21 ''chocolat'':1 ''cow'':19 ''dentist'':10 ''epistl'':7 ''harri'':2 ''japan'':22 ''mad'':18 ''meet'':16 ''moos'':13 ''must'':15 ''pack'':6', '1', '2013-05-26T14:50:58.951000', 101, 'NC-17', 2006, 5, '0.99', '16.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Chocolat Harry'), + ('A Emotional Display of a Crocodile And a Husband who must Reach a Man in Ancient Japan', '''ancient'':18 ''bound'':2 ''crocodil'':8 ''display'':5 ''emot'':4 ''husband'':11 ''japan'':19 ''man'':16 ''must'':13 ''reach'':14 ''torqu'':1', '1', '2013-05-26T14:50:58.951000', 179, 'G', 2006, 3, '4.99', '27.99', ARRAY['Trailers', 'Commentaries']::text[], 'Torque Bound'), + ('A Astounding Documentary of a Astronaut And a Boy who must Outrace a Sumo Wrestler in Berlin', '''astound'':4 ''astronaut'':8 ''berlin'':19 ''boy'':11 ''documentari'':5 ''must'':13 ''outrac'':14 ''packer'':2 ''sumo'':16 ''valley'':1 ''wrestler'':17', '1', '2013-05-26T14:50:58.951000', 73, 'G', 2006, 3, '0.99', '21.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Valley Packer'), + ('A Fast-Paced Story of a Pioneer And a Astronaut who must Reach a Boat in A Baloon', '''astronaut'':13 ''baloon'':21 ''boat'':18 ''fast'':5 ''fast-pac'':4 ''lion'':2 ''must'':15 ''pace'':6 ''pioneer'':10 ''reach'':16 ''samurai'':1 ''stori'':7', '1', '2013-05-26T14:50:58.951000', 110, 'G', 2006, 5, '2.99', '21.99', ARRAY['Commentaries']::text[], 'Samurai Lion'), + ('A Fateful Saga of a A Shark And a Technical Writer who must Find a Woman in A Jet Boat', '''boat'':22 ''bring'':1 ''fate'':4 ''find'':16 ''hyster'':2 ''jet'':21 ''must'':15 ''saga'':5 ''shark'':9 ''technic'':12 ''woman'':18 ''writer'':13', '1', '2013-05-26T14:50:58.951000', 136, 'PG', 2006, 7, '2.99', '14.99', ARRAY['Trailers']::text[], 'Bringing Hysterical'), + ('A Fateful Story of a Explorer And a Feminist who must Meet a Technical Writer in Soviet Georgia', '''explor'':8 ''fate'':4 ''feminist'':11 ''georgia'':20 ''hour'':1 ''meet'':14 ''must'':13 ''rage'':2 ''soviet'':19 ''stori'':5 ''technic'':16 ''writer'':17', '1', '2013-05-26T14:50:58.951000', 122, 'NC-17', 2006, 4, '0.99', '14.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Hours Rage'), + ('A Amazing Display of a Mad Cow And a Pioneer who must Redeem a Sumo Wrestler in The Outback', '''amaz'':4 ''bulworth'':1 ''command'':2 ''cow'':9 ''display'':5 ''mad'':8 ''must'':14 ''outback'':21 ''pioneer'':12 ''redeem'':15 ''sumo'':17 ''wrestler'':18', '1', '2013-05-26T14:50:58.951000', 61, 'G', 2006, 4, '2.99', '14.99', ARRAY['Trailers']::text[], 'Bulworth Commandments'), + ('A Insightful Panorama of a Cat And a Boat who must Defeat a Boat in The Gulf of Mexico', '''boat'':11,16 ''cat'':8 ''defeat'':14 ''empir'':2 ''fever'':1 ''gulf'':19 ''insight'':4 ''mexico'':21 ''must'':13 ''panorama'':5', '1', '2013-05-26T14:50:58.951000', 158, 'R', 2006, 5, '4.99', '20.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Fever Empire'), + ('A Action-Packed Character Study of a Dog And a Lumberjack who must Outrace a Moose in The Gulf of Mexico', '''action'':5 ''action-pack'':4 ''charact'':7 ''dog'':11 ''gulf'':22 ''lumberjack'':14 ''mexico'':24 ''moos'':19 ''must'':16 ''newsi'':1 ''outrac'':17 ''pack'':6 ''stori'':2 ''studi'':8', '1', '2013-05-26T14:50:58.951000', 159, 'G', 2006, 4, '0.99', '25.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Newsies Story'), + ('A Intrepid Panorama of a Sumo Wrestler And a Forensic Psychologist who must Discover a Moose in The First Manned Space Station', '''discov'':16 ''first'':21 ''forens'':12 ''gabl'':2 ''intrepid'':4 ''madr'':1 ''man'':22 ''moos'':18 ''must'':15 ''panorama'':5 ''psychologist'':13 ''space'':23 ''station'':24 ''sumo'':8 ''wrestler'':9', '1', '2013-05-26T14:50:58.951000', 98, 'PG-13', 2006, 7, '2.99', '27.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Madre Gables'), + ('A Awe-Inspiring Reflection of a Crocodile And a Sumo Wrestler who must Meet a Forensic Psychologist in An Abandoned Mine Shaft', '''abandon'':23 ''awe'':5 ''awe-inspir'':4 ''crocodil'':10 ''forens'':19 ''hoosier'':2 ''inspir'':6 ''meet'':17 ''mine'':24 ''must'':16 ''pilot'':1 ''psychologist'':20 ''reflect'':7 ''shaft'':25 ''sumo'':13 ''wrestler'':14', '1', '2013-05-26T14:50:58.951000', 50, 'PG', 2006, 6, '2.99', '17.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Pilot Hoosiers'), + ('A Intrepid Story of a Madman And a Frisbee who must Outgun a Boat in The Sahara Desert', '''boat'':16 ''deliver'':2 ''desert'':20 ''frisbe'':11 ''intrepid'':4 ''madman'':8 ''must'':13 ''outgun'':14 ''pollock'':1 ''sahara'':19 ''stori'':5', '1', '2013-05-26T14:50:58.951000', 137, 'PG', 2006, 5, '2.99', '14.99', ARRAY['Commentaries']::text[], 'Pollock Deliverance'), + ('A Thrilling Yarn of a Waitress And a Dentist who must Find a Hunter in A Monastery', '''dentist'':11 ''find'':14 ''hunter'':16 ''mallrat'':1 ''monasteri'':19 ''must'':13 ''thrill'':4 ''unit'':2 ''waitress'':8 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 133, 'PG', 2006, 4, '0.99', '25.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Mallrats United'), + ('A Beautiful Documentary of a Boat And a Sumo Wrestler who must Succumb a Database Administrator in The First Manned Space Station', '''administr'':18 ''beauti'':4 ''boat'':8 ''databas'':17 ''documentari'':5 ''egg'':1 ''first'':21 ''igbi'':2 ''man'':22 ''must'':14 ''space'':23 ''station'':24 ''succumb'':15 ''sumo'':11 ''wrestler'':12', '1', '2013-05-26T14:50:58.951000', 67, 'PG', 2006, 4, '2.99', '20.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Egg Igby'), + ('A Fateful Character Study of a Boat And a Cat who must Find a Database Administrator in A Jet Boat', '''administr'':18 ''boat'':9,22 ''cat'':12 ''charact'':5 ''crane'':2 ''databas'':17 ''fate'':4 ''find'':15 ''jet'':21 ''must'':14 ''right'':1 ''studi'':6', '1', '2013-05-26T14:50:58.951000', 153, 'PG-13', 2006, 7, '4.99', '29.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Right Cranes'), + ('A Awe-Inspiring Tale of a Astronaut And a Database Administrator who must Chase a Secret Agent in The Gulf of Mexico', '''administr'':14 ''agent'':20 ''astronaut'':10 ''awe'':5 ''awe-inspir'':4 ''chase'':17 ''databas'':13 ''gulf'':23 ''inspir'':6 ''mexico'':25 ''must'':16 ''savannah'':1 ''secret'':19 ''tale'':7 ''town'':2', '1', '2013-05-26T14:50:58.951000', 84, 'PG-13', 2006, 5, '0.99', '25.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Savannah Town'), + ('A Amazing Reflection of a Lumberjack And a Cat who must Discover a Husband in A MySQL Convention', '''amaz'':4 ''cat'':11 ''convent'':20 ''discov'':14 ''frost'':1 ''head'':2 ''husband'':16 ''lumberjack'':8 ''must'':13 ''mysql'':19 ''reflect'':5', '1', '2013-05-26T14:50:58.951000', 82, 'PG', 2006, 5, '0.99', '13.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Frost Head'), + ('A Thrilling Documentary of a Technical Writer And a A Shark who must Face a Pioneer in A Shark Tank', '''documentari'':5 ''face'':16 ''must'':15 ''north'':2 ''pioneer'':18 ''shark'':13,21 ''simon'':1 ''tank'':22 ''technic'':8 ''thrill'':4 ''writer'':9', '1', '2013-05-26T14:50:58.951000', 51, 'NC-17', 2006, 3, '0.99', '26.99', ARRAY['Trailers', 'Commentaries']::text[], 'Simon North'), + ('A Fateful Yarn of a Composer And a Monkey who must Vanquish a Womanizer in The First Manned Space Station', '''compos'':8 ''fate'':4 ''first'':19 ''man'':20 ''mermaid'':2 ''monkey'':11 ''must'':13 ''space'':21 ''station'':22 ''theori'':1 ''vanquish'':14 ''woman'':16 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 184, 'PG-13', 2006, 5, '0.99', '9.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Theory Mermaid'), + ('A Action-Packed Panorama of a Husband And a Feminist who must Meet a Forensic Psychologist in Ancient Japan', '''action'':5 ''action-pack'':4 ''ancient'':21 ''feminist'':13 ''forens'':18 ''happi'':1 ''husband'':10 ''japan'':22 ''meet'':16 ''must'':15 ''pack'':6 ''panorama'':7 ''psychologist'':19 ''unit'':2', '1', '2013-05-26T14:50:58.951000', 100, 'G', 2006, 6, '2.99', '23.99', ARRAY['Deleted Scenes']::text[], 'Happiness United'), + ('A Amazing Saga of a Madman And a Dentist who must Build a Car in A Manhattan Penthouse', '''amaz'':4 ''build'':14 ''car'':16 ''dentist'':11 ''grail'':2 ''hyster'':1 ''madman'':8 ''manhattan'':19 ''must'':13 ''penthous'':20 ''saga'':5', '1', '2013-05-26T14:50:58.951000', 150, 'PG', 2006, 5, '4.99', '19.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Hysterical Grail'), + ('A Epic Tale of a Squirrel And a Hunter who must Conquer a Boy in An Abandoned Mine Shaft', '''abandon'':19 ''boy'':16 ''conquer'':14 ''epic'':4 ''hunter'':11 ''legal'':2 ''mine'':20 ''must'':13 ''shaft'':21 ''squirrel'':8 ''tale'':5 ''voyag'':1', '1', '2013-05-26T14:50:58.951000', 78, 'PG-13', 2006, 6, '0.99', '28.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Voyage Legally'), + ('A Fateful Yarn of a Husband And a Dog who must Battle a Waitress in A Jet Boat', '''battl'':14 ''boat'':20 ''dog'':11 ''fate'':4 ''husband'':8 ''jet'':19 ''must'':13 ''telegraph'':1 ''voyag'':2 ''waitress'':16 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 148, 'PG', 2006, 3, '4.99', '20.99', ARRAY['Commentaries']::text[], 'Telegraph Voyage'), + ('A Unbelieveable Tale of a Dog And a Explorer who must Sink a Mad Cow in A Baloon Factory', '''baloon'':20 ''cow'':17 ''dog'':8 ''explor'':11 ''factori'':21 ''goodfella'':1 ''mad'':16 ''must'':13 ''salut'':2 ''sink'':14 ''tale'':5 ''unbeliev'':4', '1', '2013-05-26T14:50:58.951000', 56, 'PG', 2006, 4, '4.99', '22.99', ARRAY['Deleted Scenes']::text[], 'Goodfellas Salute'), + ('A Lacklusture Reflection of a Girl And a Husband who must Find a Robot in The Canadian Rockies', '''canadian'':19 ''find'':14 ''girl'':8 ''glori'':2 ''husband'':11 ''kiss'':1 ''lacklustur'':4 ''must'':13 ''reflect'':5 ''robot'':16 ''rocki'':20', '1', '2013-05-26T14:50:58.951000', 163, 'PG-13', 2006, 5, '4.99', '11.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Kiss Glory'), + ('A Beautiful Drama of a Robot And a Lumberjack who must Discover a Technical Writer in A Shark Tank', '''beauti'':4 ''bring'':2 ''discov'':14 ''drama'':5 ''lumberjack'':11 ''must'':13 ''robot'':8 ''rollercoast'':1 ''shark'':20 ''tank'':21 ''technic'':16 ''writer'':17', '1', '2013-05-26T14:50:58.951000', 153, 'PG-13', 2006, 5, '2.99', '13.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Rollercoaster Bringing'), + ('A Taut Saga of a Lumberjack And a Pastry Chef who must Escape a Sumo Wrestler in An Abandoned Fun House', '''abandon'':21 ''chef'':12 ''escap'':15 ''fun'':22 ''greek'':2 ''hous'':23 ''lumberjack'':8 ''must'':14 ''pastri'':11 ''saga'':5 ''sens'':1 ''sumo'':17 ''taut'':4 ''wrestler'':18', '1', '2013-05-26T14:50:58.951000', 54, 'R', 2006, 4, '4.99', '23.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Sense Greek'), + ('A Emotional Saga of a Car And a Madman who must Discover a Pioneer in California', '''california'':18 ''car'':8 ''command'':2 ''discov'':14 ''emot'':4 ''madman'':11 ''must'':13 ''pioneer'':16 ''saga'':5 ''treasur'':1', '1', '2013-05-26T14:50:58.951000', 102, 'PG-13', 2006, 3, '0.99', '28.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Treasure Command'), + ('A Epic Display of a Crocodile And a Crocodile who must Confront a Dog in An Abandoned Amusement Park', '''abandon'':19 ''amus'':20 ''confront'':14 ''crocodil'':8,11 ''display'':5 ''dog'':16 ''drum'':1 ''dynamit'':2 ''epic'':4 ''must'':13 ''park'':21', '1', '2013-05-26T14:50:58.951000', 96, 'PG', 2006, 6, '0.99', '11.99', ARRAY['Trailers']::text[], 'Drums Dynamite'), + ('A Lacklusture Reflection of a Monkey And a Squirrel who must Outrace a Womanizer in A Manhattan Penthouse', '''campus'':2 ''lacklustur'':4 ''manhattan'':19 ''monkey'':8 ''must'':13 ''nemo'':1 ''outrac'':14 ''penthous'':20 ''reflect'':5 ''squirrel'':11 ''woman'':16', '1', '2013-05-26T14:50:58.951000', 131, 'NC-17', 2006, 5, '2.99', '23.99', ARRAY['Trailers']::text[], 'Nemo Campus'), + ('A Awe-Inspiring Story of a Feminist And a Cat who must Conquer a Dog in A Monastery', '''awe'':5 ''awe-inspir'':4 ''barbarella'':1 ''cat'':13 ''conquer'':16 ''dog'':18 ''feminist'':10 ''inspir'':6 ''monasteri'':21 ''must'':15 ''stori'':7 ''streetcar'':2', '1', '2013-05-26T14:50:58.951000', 65, 'G', 2006, 6, '2.99', '27.99', ARRAY['Behind the Scenes']::text[], 'Barbarella Streetcar'), + ('A Taut Reflection of a Robot And a Squirrel who must Fight a Boat in Ancient Japan', '''ancient'':18 ''boat'':16 ''bright'':2 ''fight'':14 ''japan'':19 ''must'':13 ''reflect'':5 ''robberi'':1 ''robot'':8 ''squirrel'':11 ''taut'':4', '1', '2013-05-26T14:50:58.951000', 134, 'R', 2006, 4, '0.99', '21.99', ARRAY['Trailers']::text[], 'Robbery Bright'), + ('A Unbelieveable Documentary of a Frisbee And a Boat who must Meet a Boy in The Canadian Rockies', '''boat'':11 ''boy'':16 ''canadian'':19 ''documentari'':5 ''duffel'':2 ''frisbe'':8 ''meet'':14 ''mob'':1 ''must'':13 ''rocki'':20 ''unbeliev'':4', '1', '2013-05-26T14:50:58.951000', 105, 'G', 2006, 4, '0.99', '25.99', ARRAY['Trailers']::text[], 'Mob Duffel'), + ('A Astounding Display of a Composer And a Dog who must Kill a Pastry Chef in Soviet Georgia', '''astound'':4 ''chef'':17 ''compos'':8 ''display'':5 ''dog'':11 ''georgia'':20 ''jeeper'':1 ''kill'':14 ''must'':13 ''pastri'':16 ''soviet'':19 ''wed'':2', '1', '2013-05-26T14:50:58.951000', 84, 'R', 2006, 3, '2.99', '29.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Jeepers Wedding'), + ('A Astounding Panorama of a Monkey And a Secret Agent who must Defeat a Woman in The First Manned Space Station', '''agent'':12 ''astound'':4 ''defeat'':15 ''first'':20 ''man'':21 ''monkey'':8 ''must'':14 ''panorama'':5 ''rose'':1 ''secret'':11 ''space'':22 ''station'':23 ''treasur'':2 ''woman'':17', '1', '2013-05-26T14:50:58.951000', 162, 'PG-13', 2006, 5, '4.99', '23.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Roses Treasure'), + ('A Taut Reflection of a Boy And a Waitress who must Outgun a Teacher in Ancient China', '''ancient'':18 ''boy'':8 ''china'':19 ''dragon'':1 ''must'':13 ''outgun'':14 ''reflect'':5 ''squad'':2 ''taut'':4 ''teacher'':16 ''waitress'':11', '1', '2013-05-26T14:50:58.951000', 170, 'NC-17', 2006, 4, '0.99', '26.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Dragon Squad'), + ('A Beautiful Panorama of a Boat And a Crocodile who must Outrace a Dog in Australia', '''australia'':18 ''beauti'':4 ''boat'':8 ''crocodil'':11 ''dog'':16 ''fish'':2 ''model'':1 ''must'':13 ''outrac'':14 ''panorama'':5', '1', '2013-05-26T14:50:58.951000', 175, 'NC-17', 2006, 4, '4.99', '11.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Model Fish'), + ('A Fast-Paced Yarn of a Dog And a Frisbee who must Conquer a Hunter in Nigeria', '''conquer'':16 ''dog'':10 ''fast'':5 ''fast-pac'':4 ''frisbe'':13 ''hunter'':18 ''must'':15 ''nigeria'':20 ''pace'':6 ''traci'':2 ''watch'':1 ''yarn'':7', '1', '2013-05-26T14:50:58.951000', 78, 'PG', 2006, 5, '0.99', '12.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Watch Tracy'), + ('A Lacklusture Reflection of a Dentist And a Hunter who must Meet a Teacher in A Baloon', '''autumn'':2 ''baloon'':19 ''dentist'':8 ''fellowship'':1 ''hunter'':11 ''lacklustur'':4 ''meet'':14 ''must'':13 ''reflect'':5 ''teacher'':16', '1', '2013-05-26T14:50:58.951000', 77, 'NC-17', 2006, 6, '4.99', '9.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Fellowship Autumn'), + ('A Fanciful Tale of a Pioneer And a Technical Writer who must Outgun a Pioneer in A Shark Tank', '''caribbean'':1 ''fanci'':4 ''liberti'':2 ''must'':14 ''outgun'':15 ''pioneer'':8,17 ''shark'':20 ''tale'':5 ''tank'':21 ''technic'':11 ''writer'':12', '1', '2013-05-26T14:50:58.951000', 92, 'NC-17', 2006, 3, '4.99', '16.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Caribbean Liberty'), + ('A Stunning Character Study of a Car And a Girl who must Succumb a Car in A MySQL Convention', '''armageddon'':2 ''car'':9,17 ''charact'':5 ''convent'':21 ''girl'':12 ''must'':14 ''mysql'':20 ''steer'':1 ''studi'':6 ''stun'':4 ''succumb'':15', '1', '2013-05-26T14:50:58.951000', 140, 'PG', 2006, 6, '4.99', '16.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Steers Armageddon'), + ('A Boring Character Study of a Waitress And a Astronaut who must Fight a Crocodile in Ancient Japan', '''ancient'':19 ''astronaut'':12 ''bore'':4 ''charact'':5 ''crocodil'':17 ''fight'':15 ''japan'':20 ''must'':14 ''road'':1 ''roxann'':2 ''studi'':6 ''waitress'':9', '1', '2013-05-26T14:50:58.951000', 158, 'R', 2006, 4, '4.99', '12.99', ARRAY['Behind the Scenes']::text[], 'Road Roxanne'), + ('A Fast-Paced Yarn of a Composer And a Frisbee who must Face a Moose in Nigeria', '''compos'':10 ''face'':16 ''fast'':5 ''fast-pac'':4 ''frisbe'':13 ''moos'':18 ''must'':15 ''nigeria'':20 ''pace'':6 ''santa'':2 ''steel'':1 ''yarn'':7', '1', '2013-05-26T14:50:58.951000', 143, 'NC-17', 2006, 4, '4.99', '15.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Steel Santa'), + ('A Awe-Inspiring Drama of a Monkey And a Composer who must Escape a Feminist in A U-Boat', '''awe'':5 ''awe-inspir'':4 ''boat'':23 ''compos'':13 ''drama'':7 ''escap'':16 ''feminist'':18 ''inspir'':6 ''labyrinth'':2 ''monkey'':10 ''monterey'':1 ''must'':15 ''u'':22 ''u-boat'':21', '1', '2013-05-26T14:50:58.951000', 158, 'G', 2006, 6, '0.99', '13.99', ARRAY['Trailers', 'Commentaries']::text[], 'Monterey Labyrinth'), + ('A Lacklusture Epistle of a Sumo Wrestler And a Squirrel who must Defeat a Explorer in California', '''california'':19 ''defeat'':15 ''epistl'':5 ''explor'':17 ''lacklustur'':4 ''must'':14 ''rocki'':2 ''spinal'':1 ''squirrel'':12 ''sumo'':8 ''wrestler'':9', '1', '2013-05-26T14:50:58.951000', 138, 'PG-13', 2006, 7, '2.99', '12.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Spinal Rocky'), + ('A Boring Saga of a Lumberjack And a Monkey who must Find a Monkey in The Gulf of Mexico', '''bore'':4 ''comanchero'':1 ''enemi'':2 ''find'':14 ''gulf'':19 ''lumberjack'':8 ''mexico'':21 ''monkey'':11,16 ''must'':13 ''saga'':5', '1', '2013-05-26T14:50:58.951000', 67, 'R', 2006, 5, '0.99', '23.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Comancheros Enemy'), + ('A Thoughtful Drama of a Robot And a Womanizer who must Kill a Lumberjack in A Baloon', '''baloon'':19 ''drama'':5 ''kill'':14 ''lumberjack'':16 ''midsumm'':2 ''must'':13 ''robot'':8 ''shepherd'':1 ''thought'':4 ''woman'':11', '1', '2013-05-26T14:50:58.951000', 113, 'R', 2006, 7, '0.99', '14.99', ARRAY['Deleted Scenes']::text[], 'Shepherd Midsummer'), + ('A Emotional Story of a Madman And a Waitress who must Battle a Teacher in An Abandoned Fun House', '''abandon'':19 ''battl'':14 ''cabin'':2 ''emot'':4 ''frontier'':1 ''fun'':20 ''hous'':21 ''madman'':8 ''must'':13 ''stori'':5 ''teacher'':16 ''waitress'':11', '1', '2013-05-26T14:50:58.951000', 183, 'PG-13', 2006, 6, '4.99', '14.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Frontier Cabin'), + ('A Thrilling Epistle of a Dog And a Feminist who must Kill a Madman in Berlin', '''berlin'':18 ''dog'':8 ''epistl'':5 ''feminist'':11 ''french'':1 ''holiday'':2 ''kill'':14 ''madman'':16 ''must'':13 ''thrill'':4', '1', '2013-05-26T14:50:58.951000', 99, 'PG', 2006, 5, '4.99', '22.99', ARRAY['Behind the Scenes']::text[], 'French Holiday'), + ('A Fanciful Yarn of a Database Administrator And a Mad Cow who must Pursue a Womanizer in Berlin', '''administr'':9 ''berlin'':20 ''cow'':13 ''databas'':8 ''fanci'':4 ''lawrenc'':1 ''love'':2 ''mad'':12 ''must'':15 ''pursu'':16 ''woman'':18 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 175, 'NC-17', 2006, 7, '0.99', '23.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Lawrence Love'), + ('A Lacklusture Saga of a Mad Cow And a Mad Scientist who must Sink a Cat in A MySQL Convention', '''barbarella'':2 ''cat'':18 ''convent'':22 ''cow'':9 ''lacklustur'':4 ''mad'':8,12 ''must'':15 ''mysql'':21 ''saga'':5 ''scientist'':13 ''sink'':16 ''smoke'':1', '1', '2013-05-26T14:50:58.951000', 50, 'PG-13', 2006, 7, '0.99', '13.99', ARRAY['Behind the Scenes']::text[], 'Smoking Barbarella'), + ('A Taut Tale of a Explorer And a Pastry Chef who must Conquer a Hunter in A MySQL Convention', '''caus'':1 ''chef'':12 ''conquer'':15 ''convent'':21 ''date'':2 ''explor'':8 ''hunter'':17 ''must'':14 ''mysql'':20 ''pastri'':11 ''tale'':5 ''taut'':4', '1', '2013-05-26T14:50:58.951000', 179, 'R', 2006, 3, '2.99', '16.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Cause Date'), + ('A Emotional Reflection of a Womanizer And a Pioneer who must Face a Squirrel in Berlin', '''berlin'':18 ''emot'':4 ''face'':14 ''galaxi'':1 ''must'':13 ''pioneer'':11 ''reflect'':5 ''squirrel'':16 ''sweetheart'':2 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 128, 'R', 2006, 4, '4.99', '13.99', ARRAY['Deleted Scenes']::text[], 'Galaxy Sweethearts'), + ('A Epic Yarn of a Teacher And a Hunter who must Outgun a Explorer in Soviet Georgia', '''epic'':4 ''explor'':16 ''georgia'':19 ''hunter'':11 ''must'':13 ''mystic'':1 ''outgun'':14 ''soviet'':18 ''teacher'':8 ''truman'':2 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 92, 'NC-17', 2006, 5, '0.99', '19.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Mystic Truman'), + ('A Thoughtful Story of a Moose And a Husband who must Face a Secret Agent in The Sahara Desert', '''agent'':17 ''desert'':21 ''face'':14 ''husband'':11 ''hustler'':2 ''moos'':8 ''must'':13 ''sahara'':20 ''secret'':16 ''stori'':5 ''thought'':4 ''tomorrow'':1', '1', '2013-05-26T14:50:58.951000', 142, 'R', 2006, 3, '2.99', '21.99', ARRAY['Commentaries']::text[], 'Tomorrow Hustler'), + ('A Boring Tale of a Frisbee And a Crocodile who must Vanquish a Moose in An Abandoned Mine Shaft', '''abandon'':19 ''bore'':4 ''crocodil'':11 ''frisbe'':8 ''madr'':2 ''mine'':20 ''moos'':16 ''must'':13 ''shaft'':21 ''sieg'':1 ''tale'':5 ''vanquish'':14', '1', '2013-05-26T14:50:58.951000', 111, 'R', 2006, 7, '0.99', '23.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Siege Madre'), + ('A Thoughtful Panorama of a Mad Cow And a Student who must Battle a Forensic Psychologist in Berlin', '''battl'':15 ''berlin'':20 ''cow'':9 ''forens'':17 ''mad'':8 ''must'':14 ''panorama'':5 ''psychologist'':18 ''punk'':2 ''roman'':1 ''student'':12 ''thought'':4', '1', '2013-05-26T14:50:58.951000', 81, 'NC-17', 2006, 7, '0.99', '28.99', ARRAY['Trailers']::text[], 'Roman Punk'), + ('A Fateful Saga of a Moose And a Car who must Pursue a Woman in A MySQL Convention', '''caper'':1 ''car'':11 ''convent'':20 ''fate'':4 ''moos'':8 ''motion'':2 ''must'':13 ''mysql'':19 ''pursu'':14 ''saga'':5 ''woman'':16', '1', '2013-05-26T14:50:58.951000', 176, 'G', 2006, 6, '0.99', '22.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Caper Motions'), + ('A Stunning Reflection of a Robot And a Moose who must Challenge a Woman in California', '''artist'':1 ''california'':18 ''challeng'':14 ''coldblood'':2 ''moos'':11 ''must'':13 ''reflect'':5 ''robot'':8 ''stun'':4 ''woman'':16', '1', '2013-05-26T14:50:58.951000', 170, 'NC-17', 2006, 5, '2.99', '10.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Artist Coldblooded'), + ('A Intrepid Drama of a Teacher And a Moose who must Kill a Car in California', '''adapt'':2 ''california'':18 ''car'':16 ''drama'':5 ''intrepid'':4 ''kill'':14 ''moos'':11 ''must'':13 ''reservoir'':1 ''teacher'':8', '1', '2013-05-26T14:50:58.951000', 61, 'PG-13', 2006, 7, '2.99', '29.99', ARRAY['Commentaries']::text[], 'Reservoir Adaptation'), + ('A Fast-Paced Character Study of a Feminist And a Explorer who must Face a Pastry Chef in Ancient Japan', '''ancient'':22 ''break'':2 ''charact'':7 ''chef'':20 ''crystal'':1 ''explor'':14 ''face'':17 ''fast'':5 ''fast-pac'':4 ''feminist'':11 ''japan'':23 ''must'':16 ''pace'':6 ''pastri'':19 ''studi'':8', '1', '2013-05-26T14:50:58.951000', 184, 'NC-17', 2006, 6, '2.99', '22.99', ARRAY['Trailers', 'Commentaries']::text[], 'Crystal Breaking'), + ('A Brilliant Panorama of a Astronaut And a Technical Writer who must Discover a Butler in A Manhattan Penthouse', '''astronaut'':8 ''brilliant'':4 ''butler'':17 ''discov'':15 ''groundhog'':1 ''manhattan'':20 ''must'':14 ''panorama'':5 ''penthous'':21 ''technic'':11 ''uncut'':2 ''writer'':12', '1', '2013-05-26T14:50:58.951000', 139, 'PG-13', 2006, 6, '4.99', '26.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Groundhog Uncut'), + ('A Fast-Paced Character Study of a Composer And a Dog who must Outgun a Boat in An Abandoned Fun House', '''abandon'':22 ''alon'':1 ''boat'':19 ''charact'':7 ''compos'':11 ''dog'':14 ''fast'':5 ''fast-pac'':4 ''fun'':23 ''hous'':24 ''must'':16 ''outgun'':17 ''pace'':6 ''studi'':8 ''trip'':2', '1', '2013-05-26T14:50:58.951000', 82, 'R', 2006, 3, '0.99', '14.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Alone Trip'), + ('A Emotional Epistle of a Moose And a Composer who must Fight a Technical Writer in The Outback', '''compos'':11 ''emot'':4 ''epistl'':5 ''fight'':14 ''japanes'':2 ''moos'':8 ''must'':13 ''outback'':20 ''sleepi'':1 ''technic'':16 ''writer'':17', '1', '2013-05-26T14:50:58.951000', 137, 'PG', 2006, 4, '2.99', '25.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Sleepy Japanese'), + ('A Thrilling Yarn of a Dog And a Dog who must Build a Husband in A Baloon', '''baloon'':19 ''build'':14 ''dog'':8,11 ''groov'':2 ''husband'':16 ''must'':13 ''perfect'':1 ''thrill'':4 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 82, 'PG-13', 2006, 7, '2.99', '17.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Perfect Groove'), + ('A Beautiful Documentary of a Astronaut And a Moose who must Pursue a Monkey in A Shark Tank', '''astronaut'':8 ''beauti'':4 ''documentari'':5 ''flatlin'':2 ''full'':1 ''monkey'':16 ''moos'':11 ''must'':13 ''pursu'':14 ''shark'':19 ''tank'':20', '1', '2013-05-26T14:50:58.951000', 94, 'PG', 2006, 6, '2.99', '14.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Full Flatliners'), + ('A Brilliant Character Study of a Database Administrator And a Monkey who must Succumb a Astronaut in New Orleans', '''administr'':10 ''astronaut'':18 ''brilliant'':4 ''charact'':5 ''databas'':9 ''dogma'':1 ''famili'':2 ''monkey'':13 ''must'':15 ''new'':20 ''orlean'':21 ''studi'':6 ''succumb'':16', '1', '2013-05-26T14:50:58.951000', 122, 'G', 2006, 5, '4.99', '16.99', ARRAY['Commentaries']::text[], 'Dogma Family'), + ('A Awe-Inspiring Character Study of a Boat And a Boy who must Kill a Pastry Chef in The Sahara Desert', '''awe'':5 ''awe-inspir'':4 ''boat'':11 ''boy'':14 ''charact'':7 ''chef'':20 ''desert'':24 ''firehous'':1 ''inspir'':6 ''kill'':17 ''must'':16 ''pastri'':19 ''sahara'':23 ''studi'':8 ''vietnam'':2', '1', '2013-05-26T14:50:58.951000', 103, 'G', 2006, 7, '0.99', '14.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Firehouse Vietnam'), + ('A Astounding Epistle of a Cat And a Cat who must Conquer a Mad Cow in A U-Boat', '''astound'':4 ''boat'':22 ''cat'':8,11 ''conquer'':14 ''cow'':17 ''empir'':2 ''epistl'':5 ''intent'':1 ''mad'':16 ''must'':13 ''u'':21 ''u-boat'':20', '1', '2013-05-26T14:50:58.951000', 107, 'PG-13', 2006, 3, '2.99', '13.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Intentions Empire'), + ('A Amazing Panorama of a Pastry Chef And a Boat who must Escape a Woman in An Abandoned Amusement Park', '''abandon'':20 ''amaz'':4 ''amus'':21 ''anni'':1 ''boat'':12 ''chef'':9 ''escap'':15 ''ident'':2 ''must'':14 ''panorama'':5 ''park'':22 ''pastri'':8 ''woman'':17', '1', '2013-05-26T14:50:58.951000', 86, 'G', 2006, 3, '0.99', '15.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Annie Identity'), + ('A Action-Packed Yarn of a Secret Agent And a Technical Writer who must Battle a Sumo Wrestler in The First Manned Space Station', '''action'':5 ''action-pack'':4 ''agent'':11 ''battl'':18 ''first'':24 ''man'':25 ''must'':17 ''pack'':6 ''secret'':10 ''space'':26 ''station'':27 ''sumo'':20 ''tarzan'':2 ''technic'':14 ''worker'':1 ''wrestler'':21 ''writer'':15 ''yarn'':7', '1', '2013-05-26T14:50:58.951000', 139, 'R', 2006, 7, '2.99', '26.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Worker Tarzan'), + ('A Epic Documentary of a Boy And a Monkey who must Pursue a Astronaut in Berlin', '''astronaut'':16 ''berlin'':18 ''boy'':8 ''comfort'':2 ''documentari'':5 ''epic'':4 ''monkey'':11 ''must'':13 ''pelican'':1 ''pursu'':14', '1', '2013-05-26T14:50:58.951000', 48, 'PG', 2006, 4, '4.99', '17.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Pelican Comforts'), + ('A Brilliant Yarn of a Car And a Database Administrator who must Escape a Boy in A MySQL Convention', '''administr'':12 ''antitrust'':2 ''boy'':17 ''brilliant'':4 ''car'':8 ''convent'':21 ''databas'':11 ''escap'':15 ''murder'':1 ''must'':14 ''mysql'':20 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 166, 'PG', 2006, 6, '2.99', '11.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Murder Antitrust'), + ('A Intrepid Display of a Pastry Chef And a Cat who must Kill a A Shark in Ancient China', '''ancient'':20 ''cat'':12 ''chef'':9 ''china'':21 ''display'':5 ''intrepid'':4 ''kill'':15 ''lion'':1 ''must'':14 ''pastri'':8 ''shark'':18 ''uncut'':2', '1', '2013-05-26T14:50:58.951000', 50, 'PG', 2006, 6, '0.99', '13.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Lion Uncut'), + ('A Fateful Story of a A Shark And a Explorer who must Succumb a Technical Writer in A Jet Boat', '''boat'':22 ''darn'':1 ''explor'':12 ''fate'':4 ''forrest'':2 ''jet'':21 ''must'':14 ''shark'':9 ''stori'':5 ''succumb'':15 ''technic'':17 ''writer'':18', '1', '2013-05-26T14:50:58.951000', 185, 'G', 2006, 7, '4.99', '14.99', ARRAY['Deleted Scenes']::text[], 'Darn Forrester'), + ('A Amazing Documentary of a Man And a Husband who must Confront a Squirrel in A MySQL Convention', '''amaz'':4 ''confront'':14 ''convent'':20 ''documentari'':5 ''hedwig'':2 ''husband'':11 ''man'':8 ''must'':13 ''mysql'':19 ''song'':1 ''squirrel'':16', '1', '2013-05-26T14:50:58.951000', 165, 'PG-13', 2006, 3, '0.99', '29.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Song Hedwig'), + ('A Touching Display of a Frisbee And a Frisbee who must Kill a Girl in The Gulf of Mexico', '''display'':5 ''ferri'':1 ''frisbe'':8,11 ''girl'':16 ''gulf'':19 ''kill'':14 ''mexico'':21 ''mother'':2 ''must'':13 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 142, 'PG', 2006, 3, '2.99', '13.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Ferris Mother'), + ('A Brilliant Epistle of a Teacher And a Sumo Wrestler who must Defeat a Man in An Abandoned Fun House', '''abandon'':20 ''bedazzl'':2 ''borrow'':1 ''brilliant'':4 ''defeat'':15 ''epistl'':5 ''fun'':21 ''hous'':22 ''man'':17 ''must'':14 ''sumo'':11 ''teacher'':8 ''wrestler'':12', '1', '2013-05-26T14:50:58.951000', 63, 'G', 2006, 7, '0.99', '22.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Borrowers Bedazzled'), + ('A Lacklusture Display of a Dentist And a Dentist who must Fight a Girl in Australia', '''anaconda'':1 ''australia'':18 ''confess'':2 ''dentist'':8,11 ''display'':5 ''fight'':14 ''girl'':16 ''lacklustur'':4 ''must'':13', '1', '2013-05-26T14:50:58.951000', 92, 'R', 2006, 3, '0.99', '9.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Anaconda Confessions') + ) AS data(description, fulltext, old_language_id, last_update, length, rating, release_year, rental_duration, rental_rate, replacement_cost, special_features, title) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."language"' + AND map0.old_id = data.old_language_id + RETURNING film_id + ) + SELECT array_agg(film_id) INTO v_new_ids_film FROM inserted; + + FOR i IN 1..array_length(v_new_ids_film, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."film"', v_old_ids_film[i], v_new_ids_film[i]::TEXT); + END LOOP; + + v_old_ids_film := ARRAY['260', '111', '934', '743', '943', '221', '603', '826', '473', '543', '201', '350', '136', '698', '332', '905', '973', '261', '177', '614', '148', '217', '937', '960', '873', '649', '667', '49', '222', '703', '272', '875', '845', '356', '165', '388', '948', '155', '116', '415', '18', '224', '625', '69', '361', '633', '977', '887', '211', '505', '534', '9', '314', '798', '517', '896', '334', '443', '284', '802', '126', '144', '466', '97', '107', '901', '850', '982', '821', '638', '582', '813', '665', '661', '420', '535', '876', '435', '692', '557', '229', '598', '452', '995', '771', '870', '235', '648', '290', '128', '491', '357', '772', '19', '947', '298', '899', '877', '58', '400']; + WITH inserted AS ( + INSERT INTO "public"."film" ("description", "fulltext", "language_id", "last_update", "length", "rating", "release_year", "rental_duration", "rental_rate", "replacement_cost", "special_features", "title") + SELECT + data.description::text, + data.fulltext::tsvector, + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.length::smallint, + data.rating::mpaa_rating, + data.release_year::integer, + data.rental_duration::smallint, + data.rental_rate::numeric, + data.replacement_cost::numeric, + data.special_features::text[], + data.title::character varying + FROM (VALUES + ('A Stunning Reflection of a Husband And a Lumberjack who must Face a Frisbee in An Abandoned Fun House', '''abandon'':19 ''blind'':2 ''dude'':1 ''face'':14 ''frisbe'':16 ''fun'':20 ''hous'':21 ''husband'':8 ''lumberjack'':11 ''must'':13 ''reflect'':5 ''stun'':4', '1', '2013-05-26T14:50:58.951000', 132, 'G', 2006, 3, '4.99', '9.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Dude Blindness'), + ('A Awe-Inspiring Epistle of a Woman And a Madman who must Fight a Robot in Soviet Georgia', '''awe'':5 ''awe-inspir'':4 ''caddyshack'':1 ''epistl'':7 ''fight'':16 ''georgia'':21 ''inspir'':6 ''jedi'':2 ''madman'':13 ''must'':15 ''robot'':18 ''soviet'':20 ''woman'':10', '1', '2013-05-26T14:50:58.951000', 52, 'NC-17', 2006, 3, '0.99', '17.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Caddyshack Jedi'), + ('A Fast-Paced Saga of a Girl And a Forensic Psychologist who must Redeem a Girl in Nigeria', '''day'':2 ''fast'':5 ''fast-pac'':4 ''forens'':13 ''girl'':10,19 ''must'':16 ''nigeria'':21 ''pace'':6 ''psychologist'':14 ''redeem'':17 ''saga'':7 ''vanilla'':1', '1', '2013-05-26T14:50:58.951000', 122, 'NC-17', 2006, 7, '4.99', '20.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Vanilla Day'), + ('A Awe-Inspiring Panorama of a Composer And a Secret Agent who must Sink a Composer in A Shark Tank', '''agent'':14 ''awe'':5 ''awe-inspir'':4 ''compos'':10,19 ''inspir'':6 ''must'':16 ''panorama'':7 ''roman'':2 ''room'':1 ''secret'':13 ''shark'':22 ''sink'':17 ''tank'':23', '1', '2013-05-26T14:50:58.951000', 60, 'PG', 2006, 7, '0.99', '27.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Room Roman'), + ('A Boring Yarn of a Pioneer And a Feminist who must Redeem a Cat in An Abandoned Amusement Park', '''abandon'':19 ''amus'':20 ''bore'':4 ''cat'':16 ''desper'':2 ''feminist'':11 ''must'':13 ''park'':21 ''pioneer'':8 ''redeem'':14 ''villain'':1 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 76, 'PG-13', 2006, 4, '4.99', '27.99', ARRAY['Trailers', 'Commentaries']::text[], 'Villain Desperate'), + ('A Astounding Saga of a Monkey And a Moose who must Conquer a Butler in A Shark Tank', '''astound'':4 ''butler'':16 ''conquer'':14 ''deliver'':1 ''monkey'':8 ''moos'':11 ''mulholland'':2 ''must'':13 ''saga'':5 ''shark'':19 ''tank'':20', '1', '2013-05-26T14:50:58.951000', 100, 'R', 2006, 4, '0.99', '9.99', ARRAY['Deleted Scenes']::text[], 'Deliverance Mulholland'), + ('A Insightful Display of a Database Administrator And a Student who must Build a Hunter in Berlin', '''administr'':9 ''berlin'':19 ''build'':15 ''databas'':8 ''display'':5 ''hunter'':17 ''insight'':4 ''movi'':1 ''must'':14 ''shakespear'':2 ''student'':12', '1', '2013-05-26T14:50:58.951000', 53, 'PG', 2006, 6, '4.99', '27.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Movie Shakespeare'), + ('A Brilliant Display of a Frisbee And a Mad Scientist who must Succumb a Robot in Ancient China', '''ancient'':19 ''brilliant'':4 ''china'':20 ''display'':5 ''frisbe'':8 ''mad'':11 ''must'':14 ''robot'':17 ''scientist'':12 ''speed'':1 ''succumb'':15 ''suit'':2', '1', '2013-05-26T14:50:58.951000', 124, 'PG-13', 2006, 7, '4.99', '19.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Speed Suit'), + ('A Insightful Reflection of a Womanizer And a Husband who must Conquer a Pastry Chef in A Baloon', '''baloon'':20 ''chef'':17 ''conquer'':14 ''frisco'':2 ''husband'':11 ''insight'':4 ''jacket'':1 ''must'':13 ''pastri'':16 ''reflect'':5 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 181, 'PG-13', 2006, 5, '2.99', '16.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Jacket Frisco'), + ('A Astounding Character Study of a A Shark And a A Shark who must Discover a Crocodile in The Outback', '''astound'':4 ''charact'':5 ''crocodil'':19 ''discov'':17 ''dorado'':2 ''madigan'':1 ''must'':16 ''outback'':22 ''shark'':10,14 ''studi'':6', '1', '2013-05-26T14:50:58.951000', 116, 'R', 2006, 5, '4.99', '20.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Madigan Dorado'), + ('A Lacklusture Drama of a Student And a Monkey who must Sink a Womanizer in A MySQL Convention', '''convent'':20 ''cyclon'':1 ''drama'':5 ''famili'':2 ''lacklustur'':4 ''monkey'':11 ''must'':13 ''mysql'':19 ''sink'':14 ''student'':8 ''woman'':16', '1', '2013-05-26T14:50:58.951000', 176, 'PG', 2006, 7, '2.99', '18.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Cyclone Family'), + ('A Unbelieveable Character Study of a Womanizer And a Madman who must Reach a Man in The Outback', '''charact'':5 ''garden'':1 ''island'':2 ''madman'':12 ''man'':17 ''must'':14 ''outback'':20 ''reach'':15 ''studi'':6 ''unbeliev'':4 ''woman'':9', '1', '2013-05-26T14:50:58.951000', 80, 'G', 2006, 3, '4.99', '21.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Garden Island'), + ('A Boring Drama of a Dog And a Forensic Psychologist who must Outrace a Explorer in Ancient India', '''ancient'':19 ''bore'':4 ''chaplin'':1 ''dog'':8 ''drama'':5 ''explor'':17 ''forens'':11 ''india'':20 ''licens'':2 ''must'':14 ''outrac'':15 ''psychologist'':12', '1', '2013-05-26T14:50:58.951000', 146, 'NC-17', 2006, 7, '2.99', '26.99', ARRAY['Behind the Scenes']::text[], 'Chaplin License'), + ('A Thrilling Yarn of a Pastry Chef And a Monkey who must Battle a Monkey in A Shark Tank', '''battl'':15 ''chef'':9 ''giant'':2 ''monkey'':12,17 ''must'':14 ''pastri'':8 ''princess'':1 ''shark'':20 ''tank'':21 ''thrill'':4 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 71, 'NC-17', 2006, 3, '2.99', '29.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Princess Giant'), + ('A Insightful Character Study of a Feminist And a Pioneer who must Pursue a Pastry Chef in Nigeria', '''charact'':5 ''chef'':18 ''feminist'':9 ''frankenstein'':1 ''insight'':4 ''must'':14 ''nigeria'':20 ''pastri'':17 ''pioneer'':12 ''pursu'':15 ''stranger'':2 ''studi'':6', '1', '2013-05-26T14:50:58.951000', 159, 'NC-17', 2006, 7, '0.99', '16.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Frankenstein Stranger'), + ('A Fast-Paced Drama of a Pioneer And a Mad Cow who must Challenge a Madman in Ancient Japan', '''ancient'':21 ''challeng'':17 ''cow'':14 ''drama'':7 ''fast'':5 ''fast-pac'':4 ''japan'':22 ''mad'':13 ''madman'':19 ''must'':16 ''pace'':6 ''pioneer'':10 ''stranger'':2 ''trainspot'':1', '1', '2013-05-26T14:50:58.951000', 132, 'PG-13', 2006, 7, '4.99', '10.99', ARRAY['Trailers']::text[], 'Trainspotting Strangers'), + ('A Awe-Inspiring Epistle of a Teacher And a Feminist who must Confront a Pioneer in Ancient Japan', '''ancient'':20 ''awe'':5 ''awe-inspir'':4 ''confront'':16 ''epistl'':7 ''feminist'':13 ''inspir'':6 ''japan'':21 ''must'':15 ''pioneer'':18 ''teacher'':10 ''turn'':2 ''wife'':1', '1', '2013-05-26T14:50:58.951000', 183, 'NC-17', 2006, 3, '4.99', '27.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Wife Turn'), + ('A Emotional Display of a Boat And a Explorer who must Challenge a Madman in A MySQL Convention', '''apocalyps'':2 ''boat'':8 ''challeng'':14 ''convent'':20 ''display'':5 ''duffel'':1 ''emot'':4 ''explor'':11 ''madman'':16 ''must'':13 ''mysql'':19', '1', '2013-05-26T14:50:58.951000', 171, 'G', 2006, 5, '0.99', '13.99', ARRAY['Commentaries']::text[], 'Duffel Apocalypse'), + ('A Unbelieveable Drama of a Crocodile And a Mad Cow who must Reach a Dentist in A Shark Tank', '''connecticut'':1 ''cow'':12 ''crocodil'':8 ''dentist'':17 ''drama'':5 ''mad'':11 ''must'':14 ''reach'':15 ''shark'':20 ''tank'':21 ''tramp'':2 ''unbeliev'':4', '1', '2013-05-26T14:50:58.951000', 172, 'R', 2006, 4, '4.99', '20.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Connecticut Tramp'), + ('A Touching Saga of a Sumo Wrestler And a Cat who must Pursue a Mad Scientist in Nigeria', '''cat'':12 ''detect'':2 ''mad'':17 ''must'':14 ''name'':1 ''nigeria'':20 ''pursu'':15 ''saga'':5 ''scientist'':18 ''sumo'':8 ''touch'':4 ''wrestler'':9', '1', '2013-05-26T14:50:58.951000', 178, 'PG-13', 2006, 5, '4.99', '11.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Name Detective'), + ('A Unbelieveable Story of a Mad Scientist And a Technical Writer who must Discover a Composer in Ancient China', '''ancient'':20 ''china'':21 ''chocol'':1 ''compos'':18 ''discov'':16 ''duck'':2 ''mad'':8 ''must'':15 ''scientist'':9 ''stori'':5 ''technic'':12 ''unbeliev'':4 ''writer'':13', '1', '2013-05-26T14:50:58.951000', 132, 'R', 2006, 3, '2.99', '13.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Chocolate Duck'), + ('A Action-Packed Story of a Pioneer And a Technical Writer who must Discover a Forensic Psychologist in An Abandoned Amusement Park', '''abandon'':23 ''action'':5 ''action-pack'':4 ''amus'':24 ''daze'':1 ''discov'':17 ''forens'':19 ''must'':16 ''pack'':6 ''park'':25 ''pioneer'':10 ''psychologist'':20 ''punk'':2 ''stori'':7 ''technic'':13 ''writer'':14', '1', '2013-05-26T14:50:58.951000', 120, 'G', 2006, 6, '4.99', '20.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Dazed Punk'), + ('A Action-Packed Character Study of a Astronaut And a Explorer who must Reach a Monkey in A MySQL Convention', '''action'':5 ''action-pack'':4 ''astronaut'':11 ''charact'':7 ''convent'':23 ''explor'':14 ''monkey'':19 ''must'':16 ''mysql'':22 ''pack'':6 ''reach'':17 ''studi'':8 ''trip'':2 ''varsiti'':1', '1', '2013-05-26T14:50:58.951000', 85, 'NC-17', 2006, 7, '2.99', '14.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Varsity Trip'), + ('A Taut Reflection of a Teacher And a Database Administrator who must Chase a Madman in The Sahara Desert', '''administr'':12 ''chase'':15 ''databas'':11 ''desert'':21 ''madman'':17 ''must'':14 ''pluto'':2 ''reflect'':5 ''sahara'':20 ''taut'':4 ''teacher'':8 ''war'':1', '1', '2013-05-26T14:50:58.951000', 128, 'G', 2006, 5, '2.99', '15.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Wars Pluto'), + ('A Brilliant Character Study of a Frisbee And a Sumo Wrestler who must Confront a Woman in The Gulf of Mexico', '''brilliant'':4 ''charact'':5 ''confront'':16 ''frisbe'':9 ''gulf'':21 ''mexico'':23 ''must'':15 ''studi'':6 ''sumo'':12 ''suspect'':2 ''sweetheart'':1 ''woman'':18 ''wrestler'':13', '1', '2013-05-26T14:50:58.951000', 108, 'G', 2006, 3, '0.99', '13.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Sweethearts Suspects'), + ('A Epic Yarn of a Mad Scientist And a Cat who must Confront a Womanizer in A Baloon Factory', '''baloon'':20 ''cat'':12 ''confront'':15 ''epic'':4 ''factori'':21 ''liaison'':2 ''mad'':8 ''must'':14 ''oz'':1 ''scientist'':9 ''woman'':17 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 85, 'R', 2006, 4, '2.99', '14.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Oz Liaisons'), + ('A Action-Packed Drama of a Monkey And a Dentist who must Chase a Butler in Berlin', '''action'':5 ''action-pack'':4 ''berlin'':20 ''butler'':18 ''chase'':16 ''dentist'':13 ''drama'':7 ''innoc'':2 ''monkey'':10 ''must'':15 ''pack'':6 ''peach'':1', '1', '2013-05-26T14:50:58.951000', 160, 'PG-13', 2006, 3, '2.99', '20.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Peach Innocent'), + ('A Emotional Panorama of a Pioneer And a Composer who must Escape a Mad Scientist in A Jet Boat', '''badman'':1 ''boat'':21 ''compos'':11 ''dawn'':2 ''emot'':4 ''escap'':14 ''jet'':20 ''mad'':16 ''must'':13 ''panorama'':5 ''pioneer'':8 ''scientist'':17', '1', '2013-05-26T14:50:58.951000', 162, 'R', 2006, 6, '2.99', '22.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Badman Dawn'), + ('A Brilliant Documentary of a Butler And a Frisbee who must Build a Astronaut in New Orleans', '''astronaut'':16 ''brilliant'':4 ''build'':14 ''butler'':8 ''desert'':1 ''documentari'':5 ''frisbe'':11 ''must'':13 ''new'':18 ''orlean'':19 ''poseidon'':2', '1', '2013-05-26T14:50:58.951000', 64, 'R', 2006, 4, '4.99', '27.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Desert Poseidon'), + ('A Fast-Paced Tale of a Pastry Chef And a Boat who must Face a Frisbee in The Canadian Rockies', '''boat'':14 ''canadian'':22 ''chef'':11 ''divorc'':2 ''face'':17 ''fast'':5 ''fast-pac'':4 ''frisbe'':19 ''must'':16 ''pace'':6 ''pastri'':10 ''punk'':1 ''rocki'':23 ''tale'':7', '1', '2013-05-26T14:50:58.951000', 100, 'PG', 2006, 6, '4.99', '18.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Punk Divorce'), + ('A Beautiful Yarn of a Composer And a Mad Cow who must Redeem a Mad Scientist in A Jet Boat', '''beauti'':4 ''boat'':22 ''compos'':8 ''cow'':12 ''edg'':1 ''jet'':21 ''kiss'':2 ''mad'':11,17 ''must'':14 ''redeem'':15 ''scientist'':18 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 153, 'NC-17', 2006, 5, '4.99', '9.99', ARRAY['Deleted Scenes']::text[], 'Edge Kissing'), + ('A Lacklusture Panorama of a Dentist And a Forensic Psychologist who must Outrace a Pioneer in A U-Boat', '''boat'':22 ''dentist'':8 ''forens'':11 ''homicid'':2 ''lacklustur'':4 ''must'':14 ''outrac'':15 ''panorama'':5 ''pioneer'':17 ''psychologist'':12 ''talent'':1 ''u'':21 ''u-boat'':20', '1', '2013-05-26T14:50:58.951000', 173, 'PG', 2006, 6, '0.99', '9.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Talented Homicide'), + ('A Touching Epistle of a Crocodile And a Teacher who must Build a Forensic Psychologist in A MySQL Convention', '''build'':14 ''convent'':21 ''crocodil'':8 ''dream'':2 ''epistl'':5 ''forens'':16 ''must'':13 ''mysql'':20 ''psychologist'':17 ''stepmom'':1 ''teacher'':11 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 48, 'NC-17', 2006, 7, '4.99', '9.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Stepmom Dream'), + ('A Fateful Display of a Feminist And a Monkey who must Vanquish a Monkey in The Canadian Rockies', '''canadian'':19 ''display'':5 ''fate'':4 ''feminist'':8 ''giant'':1 ''monkey'':11,16 ''must'':13 ''rocki'':20 ''trooper'':2 ''vanquish'':14', '1', '2013-05-26T14:50:58.951000', 102, 'R', 2006, 5, '2.99', '10.99', ARRAY['Trailers', 'Commentaries']::text[], 'Giant Troopers'), + ('A Brilliant Panorama of a Dentist And a Moose who must Find a Student in The Gulf of Mexico', '''brilliant'':4 ''coldblood'':1 ''darl'':2 ''dentist'':8 ''find'':14 ''gulf'':19 ''mexico'':21 ''moos'':11 ''must'':13 ''panorama'':5 ''student'':16', '1', '2013-05-26T14:50:58.951000', 70, 'G', 2006, 7, '4.99', '27.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Coldblooded Darling'), + ('A Epic Reflection of a Pastry Chef And a Explorer who must Reach a Dentist in The Sahara Desert', '''chef'':9 ''dentist'':17 ''desert'':21 ''epic'':4 ''explor'':12 ''gunfight'':1 ''moon'':2 ''must'':14 ''pastri'':8 ''reach'':15 ''reflect'':5 ''sahara'':20', '1', '2013-05-26T14:50:58.951000', 70, 'NC-17', 2006, 5, '0.99', '16.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Gunfight Moon'), + ('A Amazing Panorama of a Pioneer And a Student who must Overcome a Mad Scientist in A Manhattan Penthouse', '''amaz'':4 ''mad'':16 ''manhattan'':20 ''must'':13 ''overcom'':14 ''panorama'':5 ''peach'':2 ''penthous'':21 ''pioneer'':8 ''scientist'':17 ''student'':11 ''voic'':1', '1', '2013-05-26T14:50:58.951000', 139, 'PG-13', 2006, 6, '0.99', '22.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Voice Peach'), + ('A Fanciful Documentary of a Crocodile And a Technical Writer who must Fight a A Shark in A Baloon', '''baloon'':21 ''cleopatra'':1 ''crocodil'':8 ''devil'':2 ''documentari'':5 ''fanci'':4 ''fight'':15 ''must'':14 ''shark'':18 ''technic'':11 ''writer'':12', '1', '2013-05-26T14:50:58.951000', 150, 'PG-13', 2006, 6, '0.99', '26.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Cleopatra Devil'), + ('A Brilliant Epistle of a Composer And a Database Administrator who must Vanquish a Mad Scientist in The First Manned Space Station', '''administr'':12 ''brilliant'':4 ''candid'':1 ''compos'':8 ''databas'':11 ''epistl'':5 ''first'':21 ''mad'':17 ''man'':22 ''must'':14 ''perdit'':2 ''scientist'':18 ''space'':23 ''station'':24 ''vanquish'':15', '1', '2013-05-26T14:50:58.951000', 70, 'R', 2006, 4, '2.99', '10.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Candidate Perdition'), + ('A Fateful Saga of a Waitress And a Hunter who must Outrace a Sumo Wrestler in Australia', '''australia'':19 ''encino'':2 ''fate'':4 ''high'':1 ''hunter'':11 ''must'':13 ''outrac'':14 ''saga'':5 ''sumo'':16 ''waitress'':8 ''wrestler'':17', '1', '2013-05-26T14:50:58.951000', 84, 'R', 2006, 3, '2.99', '23.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'High Encino'), + ('A Thoughtful Drama of a Composer And a Feminist who must Meet a Secret Agent in The Canadian Rockies', '''agent'':17 ''alter'':1 ''canadian'':20 ''compos'':8 ''drama'':5 ''feminist'':11 ''meet'':14 ''must'':13 ''rocki'':21 ''secret'':16 ''thought'':4 ''victori'':2', '1', '2013-05-26T14:50:58.951000', 57, 'PG-13', 2006, 6, '0.99', '27.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Alter Victory'), + ('A Epic Yarn of a Forensic Psychologist And a Teacher who must Face a Lumberjack in California', '''california'':19 ''desper'':1 ''epic'':4 ''face'':15 ''forens'':8 ''lumberjack'':17 ''must'':14 ''psychologist'':9 ''teacher'':12 ''trainspot'':2 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 81, 'G', 2006, 7, '4.99', '29.99', ARRAY['Deleted Scenes']::text[], 'Desperate Trainspotting'), + ('A Boring Reflection of a Secret Agent And a Astronaut who must Face a Composer in A Manhattan Penthouse', '''agent'':9 ''astronaut'':12 ''bore'':4 ''compos'':17 ''face'':15 ''manhattan'':20 ''must'':14 ''none'':1 ''penthous'':21 ''reflect'':5 ''secret'':8 ''spike'':2', '1', '2013-05-26T14:50:58.951000', 83, 'NC-17', 2006, 3, '0.99', '18.99', ARRAY['Trailers', 'Commentaries']::text[], 'None Spiking'), + ('A Fanciful Documentary of a Womanizer And a Boat who must Defeat a Madman in The First Manned Space Station', '''bever'':1 ''boat'':11 ''defeat'':14 ''documentari'':5 ''fanci'':4 ''first'':19 ''madman'':16 ''man'':20 ''must'':13 ''outlaw'':2 ''space'':21 ''station'':22 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 85, 'R', 2006, 3, '2.99', '21.99', ARRAY['Trailers']::text[], 'Beverly Outlaw'), + ('A Amazing Display of a Composer And a Forensic Psychologist who must Discover a Car in The Canadian Rockies', '''amaz'':4 ''canadian'':20 ''car'':17 ''compos'':8 ''discov'':15 ''display'':5 ''forens'':11 ''gleam'':1 ''jawbreak'':2 ''must'':14 ''psychologist'':12 ''rocki'':21', '1', '2013-05-26T14:50:58.951000', 89, 'NC-17', 2006, 5, '2.99', '25.99', ARRAY['Trailers', 'Commentaries']::text[], 'Gleaming Jawbreaker'), + ('A Taut Epistle of a Monkey And a Boy who must Confront a Husband in A Jet Boat', '''boat'':20 ''boy'':11 ''confront'':14 ''epistl'':5 ''husband'':16 ''jet'':19 ''monkey'':8 ''must'':13 ''octob'':1 ''submarin'':2 ''taut'':4', '1', '2013-05-26T14:50:58.951000', 54, 'PG-13', 2006, 6, '4.99', '10.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'October Submarine'), + ('A Astounding Character Study of a Womanizer And a Hunter who must Escape a Robot in A Monastery', '''astound'':4 ''charact'':5 ''escap'':15 ''hunter'':12 ''monasteri'':20 ''must'':14 ''robot'':17 ''side'':2 ''studi'':6 ''window'':1 ''woman'':9', '1', '2013-05-26T14:50:58.951000', 85, 'R', 2006, 3, '2.99', '25.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Window Side'), + ('A Touching Documentary of a Madman And a Mad Scientist who must Outrace a Feminist in An Abandoned Mine Shaft', '''abandon'':20 ''documentari'':5 ''feminist'':17 ''mad'':11 ''madman'':8 ''mine'':21 ''must'':14 ''outrac'':15 ''pelican'':2 ''scientist'':12 ''shaft'':22 ''thief'':1 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 135, 'PG-13', 2006, 5, '4.99', '28.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Thief Pelican'), + ('A Brilliant Documentary of a Astronaut And a Squirrel who must Succumb a Student in The Gulf of Mexico', '''astronaut'':8 ''break'':2 ''brilliant'':4 ''darl'':1 ''documentari'':5 ''gulf'':19 ''mexico'':21 ''must'':13 ''squirrel'':11 ''student'':16 ''succumb'':14', '1', '2013-05-26T14:50:58.951000', 165, 'PG-13', 2006, 7, '4.99', '20.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Darling Breaking'), + ('A Awe-Inspiring Saga of a Composer And a Frisbee who must Succumb a Pioneer in The Sahara Desert', '''awe'':5 ''awe-inspir'':4 ''compos'':10 ''desert'':22 ''frisbe'':13 ''inspir'':6 ''labyrinth'':1 ''leagu'':2 ''must'':15 ''pioneer'':18 ''saga'':7 ''sahara'':21 ''succumb'':16', '1', '2013-05-26T14:50:58.951000', 46, 'PG-13', 2006, 6, '2.99', '24.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Labyrinth League'), + ('A Lacklusture Drama of a Girl And a Technical Writer who must Redeem a Monkey in A Shark Tank', '''drama'':5 ''girl'':8 ''harri'':2 ''lacklustur'':4 ''louisiana'':1 ''monkey'':17 ''must'':14 ''redeem'':15 ''shark'':20 ''tank'':21 ''technic'':11 ''writer'':12', '1', '2013-05-26T14:50:58.951000', 70, 'PG-13', 2006, 5, '0.99', '18.99', ARRAY['Trailers']::text[], 'Louisiana Harry'), + ('A Thoughtful Panorama of a Database Administrator And a Mad Scientist who must Outgun a Mad Scientist in A Jet Boat', '''administr'':9 ''alabama'':1 ''boat'':23 ''databas'':8 ''devil'':2 ''jet'':22 ''mad'':12,18 ''must'':15 ''outgun'':16 ''panorama'':5 ''scientist'':13,19 ''thought'':4', '1', '2013-05-26T14:50:58.951000', 114, 'PG-13', 2006, 3, '2.99', '21.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Alabama Devil'), + ('A Intrepid Panorama of a Womanizer And a Girl who must Escape a Girl in A Manhattan Penthouse', '''escap'':14 ''fight'':1 ''girl'':11,16 ''intrepid'':4 ''jawbreak'':2 ''manhattan'':19 ''must'':13 ''panorama'':5 ''penthous'':20 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 91, 'R', 2006, 3, '0.99', '13.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Fight Jawbreaker'), + ('A Stunning Epistle of a Sumo Wrestler And a Man who must Challenge a Waitress in Ancient India', '''ancient'':19 ''challeng'':15 ''epistl'':5 ''goldfing'':2 ''india'':20 ''man'':12 ''must'':14 ''silverado'':1 ''stun'':4 ''sumo'':8 ''waitress'':17 ''wrestler'':9', '1', '2013-05-26T14:50:58.951000', 74, 'PG', 2006, 4, '4.99', '11.99', ARRAY['Trailers', 'Commentaries']::text[], 'Silverado Goldfinger'), + ('A Emotional Display of a Man And a Explorer who must Build a Boy in A Manhattan Penthouse', '''boy'':16 ''build'':14 ''cleopatra'':2 ''display'':5 ''emot'':4 ''explor'':11 ''lesson'':1 ''man'':8 ''manhattan'':19 ''must'':13 ''penthous'':20', '1', '2013-05-26T14:50:58.951000', 167, 'NC-17', 2006, 3, '0.99', '28.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Lesson Cleopatra'), + ('A Awe-Inspiring Documentary of a Womanizer And a Pastry Chef who must Kill a Lumberjack in Berlin', '''awe'':5 ''awe-inspir'':4 ''berlin'':21 ''chef'':14 ''documentari'':7 ''inspir'':6 ''kill'':17 ''lumberjack'':19 ''must'':16 ''pastri'':13 ''pilot'':2 ''tootsi'':1 ''woman'':10', '1', '2013-05-26T14:50:58.951000', 157, 'PG', 2006, 3, '0.99', '10.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Tootsie Pilot'), + ('A Intrepid Saga of a Man And a Lumberjack who must Vanquish a Husband in The Outback', '''freddi'':1 ''husband'':16 ''intrepid'':4 ''lumberjack'':11 ''man'':8 ''must'':13 ''outback'':19 ''saga'':5 ''storm'':2 ''vanquish'':14', '1', '2013-05-26T14:50:58.951000', 65, 'NC-17', 2006, 6, '4.99', '21.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Freddy Storm'), + ('A Lacklusture Epistle of a Database Administrator And a Woman who must Meet a Hunter in An Abandoned Mine Shaft', '''abandon'':20 ''administr'':9 ''affair'':2 ''databas'':8 ''epistl'':5 ''hunter'':17 ''hurrican'':1 ''lacklustur'':4 ''meet'':15 ''mine'':21 ''must'':14 ''shaft'':22 ''woman'':12', '1', '2013-05-26T14:50:58.951000', 49, 'PG', 2006, 6, '2.99', '11.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Hurricane Affair'), + ('A Fanciful Panorama of a Mad Scientist And a Woman who must Pursue a Astronaut in Ancient India', '''ancient'':19 ''astronaut'':17 ''enemi'':1 ''fanci'':4 ''india'':20 ''mad'':8 ''must'':14 ''odd'':2 ''panorama'':5 ''pursu'':15 ''scientist'':9 ''woman'':12', '1', '2013-05-26T14:50:58.951000', 77, 'NC-17', 2006, 5, '4.99', '23.99', ARRAY['Trailers']::text[], 'Enemy Odds'), + ('A Epic Drama of a Mad Scientist And a Explorer who must Succumb a Waitress in An Abandoned Fun House', '''abandon'':20 ''drama'':5 ''epic'':4 ''explor'':12 ''fun'':21 ''hous'':22 ''mad'':8 ''miracl'':2 ''must'':14 ''scientist'':9 ''sky'':1 ''succumb'':15 ''waitress'':17', '1', '2013-05-26T14:50:58.951000', 132, 'PG', 2006, 7, '2.99', '15.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Sky Miracle'), + ('A Insightful Yarn of a A Shark And a Pastry Chef who must Face a Boy in A Monastery', '''boy'':18 ''casualti'':1 ''chef'':13 ''encino'':2 ''face'':16 ''insight'':4 ''monasteri'':21 ''must'':15 ''pastri'':12 ''shark'':9 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 179, 'G', 2006, 3, '4.99', '16.99', ARRAY['Trailers']::text[], 'Casualties Encino'), + ('A Brilliant Panorama of a Technical Writer And a Lumberjack who must Escape a Butler in Ancient India', '''ancient'':19 ''brilliant'':4 ''butler'':17 ''chinatown'':1 ''escap'':15 ''gladiat'':2 ''india'':20 ''lumberjack'':12 ''must'':14 ''panorama'':5 ''technic'':8 ''writer'':9', '1', '2013-05-26T14:50:58.951000', 61, 'PG', 2006, 7, '4.99', '24.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Chinatown Gladiator'), + ('A Awe-Inspiring Story of a Monkey And a Pastry Chef who must Succumb a Womanizer in A MySQL Convention', '''awe'':5 ''awe-inspir'':4 ''chef'':14 ''convent'':23 ''inspir'':6 ''intent'':2 ''intoler'':1 ''monkey'':10 ''must'':16 ''mysql'':22 ''pastri'':13 ''stori'':7 ''succumb'':17 ''woman'':19', '1', '2013-05-26T14:50:58.951000', 63, 'PG-13', 2006, 6, '4.99', '20.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Intolerable Intentions'), + ('A Epic Tale of a Robot And a Monkey who must Vanquish a Man in New Orleans', '''bride'':1 ''epic'':4 ''intrigu'':2 ''man'':16 ''monkey'':11 ''must'':13 ''new'':18 ''orlean'':19 ''robot'':8 ''tale'':5 ''vanquish'':14', '1', '2013-05-26T14:50:58.951000', 56, 'G', 2006, 7, '0.99', '24.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Bride Intrigue'), + ('A Emotional Story of a Feminist And a Feminist who must Escape a Pastry Chef in A MySQL Convention', '''bunch'':1 ''chef'':17 ''convent'':21 ''emot'':4 ''escap'':14 ''feminist'':8,11 ''mind'':2 ''must'':13 ''mysql'':20 ''pastri'':16 ''stori'':5', '1', '2013-05-26T14:50:58.951000', 63, 'G', 2006, 4, '2.99', '13.99', ARRAY['Behind the Scenes']::text[], 'Bunch Minds'), + ('A Touching Reflection of a Database Administrator And a Madman who must Build a Lumberjack in Nigeria', '''administr'':9 ''build'':15 ''cider'':2 ''databas'':8 ''lumberjack'':17 ''madman'':12 ''must'':14 ''nigeria'':19 ''reflect'':5 ''touch'':4 ''traci'':1', '1', '2013-05-26T14:50:58.951000', 142, 'G', 2006, 3, '0.99', '29.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Tracy Cider'), + ('A Lacklusture Saga of a Boy And a Cat who must Sink a Dentist in An Abandoned Mine Shaft', '''abandon'':19 ''boy'':8 ''cat'':11 ''dentist'':16 ''lacklustur'':4 ''mine'':20 ''must'':13 ''saga'':5 ''shaft'':21 ''side'':2 ''sink'':14 ''stori'':1', '1', '2013-05-26T14:50:58.951000', 163, 'R', 2006, 7, '0.99', '27.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Story Side'), + ('A Insightful Documentary of a Waitress And a Butler who must Vanquish a Composer in Australia', '''australia'':18 ''butler'':11 ''compos'':16 ''documentari'':5 ''dorado'':2 ''insight'':4 ''must'':13 ''vanquish'':14 ''waitress'':8 ''women'':1', '1', '2013-05-26T14:50:58.951000', 126, 'R', 2006, 4, '0.99', '23.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Women Dorado'), + ('A Fast-Paced Display of a Squirrel And a Composer who must Fight a Forensic Psychologist in A Jet Boat', '''boat'':23 ''compos'':13 ''display'':7 ''fast'':5 ''fast-pac'':4 ''fight'':16 ''forens'':18 ''jet'':22 ''must'':15 ''pace'':6 ''psychologist'':19 ''queen'':2 ''soror'':1 ''squirrel'':10', '1', '2013-05-26T14:50:58.951000', 184, 'NC-17', 2006, 6, '0.99', '17.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Sorority Queen'), + ('A Intrepid Character Study of a Man And a Frisbee who must Overcome a Madman in Ancient China', '''ancient'':19 ''charact'':5 ''china'':20 ''frisbe'':12 ''intrepid'':4 ''madman'':17 ''man'':9 ''must'':14 ''oper'':1,2 ''overcom'':15 ''studi'':6', '1', '2013-05-26T14:50:58.951000', 156, 'G', 2006, 7, '2.99', '23.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Operation Operation'), + ('A Touching Epistle of a Butler And a Boy who must Find a Mad Scientist in The Sahara Desert', '''boy'':11 ''butler'':8 ''desert'':21 ''epistl'':5 ''find'':14 ''mad'':16 ''miracl'':1 ''must'':13 ''sahara'':20 ''scientist'':17 ''touch'':4 ''virtual'':2', '1', '2013-05-26T14:50:58.951000', 162, 'PG-13', 2006, 3, '2.99', '19.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Miracle Virtual'), + ('A Thrilling Documentary of a Husband And a Feminist who must Face a Mad Scientist in Ancient China', '''ancient'':19 ''china'':20 ''control'':2 ''documentari'':5 ''face'':14 ''feminist'':11 ''husband'':8 ''mad'':16 ''must'':13 ''scientist'':17 ''smoochi'':1 ''thrill'':4', '1', '2013-05-26T14:50:58.951000', 184, 'R', 2006, 7, '0.99', '18.99', ARRAY['Behind the Scenes']::text[], 'Smoochy Control'), + ('A Thrilling Documentary of a Composer And a Secret Agent who must Succumb a Cat in Berlin', '''agent'':12 ''berlin'':19 ''cat'':17 ''compos'':8 ''documentari'':5 ''interview'':2 ''must'':14 ''patton'':1 ''secret'':11 ''succumb'':15 ''thrill'':4', '1', '2013-05-26T14:50:58.951000', 175, 'PG', 2006, 4, '2.99', '22.99', ARRAY['Commentaries']::text[], 'Patton Interview'), + ('A Intrepid Tale of a Madman And a Astronaut who must Challenge a Hunter in A Monastery', '''astronaut'':11 ''challeng'':14 ''hunter'':16 ''intrepid'':4 ''madman'':8 ''monasteri'':19 ''must'':13 ''past'':1 ''suicid'':2 ''tale'':5', '1', '2013-05-26T14:50:58.951000', 157, 'PG-13', 2006, 5, '4.99', '17.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Past Suicides'), + ('A Fast-Paced Reflection of a Technical Writer And a Student who must Fight a Boy in The Canadian Rockies', '''boy'':19 ''brannigan'':2 ''canadian'':22 ''fast'':5 ''fast-pac'':4 ''fight'':17 ''hole'':1 ''must'':16 ''pace'':6 ''reflect'':7 ''rocki'':23 ''student'':14 ''technic'':10 ''writer'':11', '1', '2013-05-26T14:50:58.951000', 128, 'PG', 2006, 7, '4.99', '27.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Holes Brannigan'), + ('A Brilliant Panorama of a Hunter And a Explorer who must Pursue a Dentist in An Abandoned Fun House', '''abandon'':19 ''brilliant'':4 ''dentist'':16 ''explor'':11 ''fun'':20 ''hous'':21 ''hunter'':8 ''love'':1 ''must'':13 ''panorama'':5 ''pursu'':14 ''suicid'':2', '1', '2013-05-26T14:50:58.951000', 181, 'R', 2006, 6, '0.99', '21.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Love Suicides'), + ('A Fast-Paced Display of a Lumberjack And a Mad Scientist who must Succumb a Sumo Wrestler in The Sahara Desert', '''desert'':24 ''display'':7 ''fast'':5 ''fast-pac'':4 ''lumberjack'':10 ''mad'':13 ''must'':16 ''pace'':6 ''sahara'':23 ''scientist'':14 ''succumb'':17 ''sumo'':19 ''tarzan'':1 ''videotap'':2 ''wrestler'':20', '1', '2013-05-26T14:50:58.951000', 91, 'PG-13', 2006, 3, '2.99', '11.99', ARRAY['Trailers']::text[], 'Tarzan Videotape'), + ('A Thrilling Yarn of a Pastry Chef And a A Shark who must Challenge a Mad Scientist in The Outback', '''challeng'':16 ''chef'':9 ''happi'':2 ''hotel'':1 ''mad'':18 ''must'':15 ''outback'':22 ''pastri'':8 ''scientist'':19 ''shark'':13 ''thrill'':4 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 181, 'PG-13', 2006, 6, '4.99', '28.99', ARRAY['Behind the Scenes']::text[], 'Hotel Happiness'), + ('A Beautiful Story of a Dog And a Technical Writer who must Outgun a Student in A Baloon', '''baloon'':20 ''beauti'':4 ''dog'':8 ''mix'':2 ''must'':14 ''outgun'':15 ''potluck'':1 ''stori'':5 ''student'':17 ''technic'':11 ''writer'':12', '1', '2013-05-26T14:50:58.951000', 179, 'G', 2006, 3, '2.99', '10.99', ARRAY['Behind the Scenes']::text[], 'Potluck Mixed'), + ('A Stunning Tale of a Mad Cow And a Boy who must Battle a Boy in Berlin', '''battl'':15 ''berlin'':19 ''boy'':12,17 ''cow'':9 ''curtain'':2 ''mad'':8 ''manchurian'':1 ''must'':14 ''stun'':4 ''tale'':5', '1', '2013-05-26T14:50:58.951000', 177, 'PG', 2006, 5, '2.99', '27.99', ARRAY['Trailers', 'Commentaries']::text[], 'Manchurian Curtain'), + ('A Beautiful Reflection of a Monkey And a Dentist who must Face a Database Administrator in Ancient Japan', '''administr'':17 ''ancient'':19 ''beauti'':4 ''databas'':16 ''dentist'':11 ''desir'':2 ''devil'':1 ''face'':14 ''japan'':20 ''monkey'':8 ''must'':13 ''reflect'':5', '1', '2013-05-26T14:50:58.951000', 87, 'R', 2006, 6, '4.99', '12.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Devil Desire'), + ('A Thoughtful Character Study of a Waitress And a Feminist who must Build a Teacher in Ancient Japan', '''ancient'':19 ''armageddon'':2 ''build'':15 ''charact'':5 ''feminist'':12 ''japan'':20 ''mosquito'':1 ''must'':14 ''studi'':6 ''teacher'':17 ''thought'':4 ''waitress'':9', '1', '2013-05-26T14:50:58.951000', 57, 'G', 2006, 6, '0.99', '22.99', ARRAY['Trailers']::text[], 'Mosquito Armageddon'), + ('A Emotional Epistle of a Boat And a Mad Scientist who must Outrace a Robot in An Abandoned Mine Shaft', '''abandon'':20 ''ameli'':2 ''boat'':8 ''emot'':4 ''epistl'':5 ''illus'':1 ''mad'':11 ''mine'':21 ''must'':14 ''outrac'':15 ''robot'':17 ''scientist'':12 ''shaft'':22', '1', '2013-05-26T14:50:58.951000', 122, 'R', 2006, 4, '0.99', '15.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Illusion Amelie'), + ('A Amazing Display of a Robot And a Astronaut who must Fight a Womanizer in Berlin', '''amaz'':4 ''astronaut'':11 ''berlin'':18 ''display'':5 ''fight'':14 ''idaho'':2 ''must'':13 ''robot'':8 ''woman'':16 ''yentl'':1', '1', '2013-05-26T14:50:58.951000', 86, 'R', 2006, 5, '4.99', '11.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Yentl Idaho'), + ('A Awe-Inspiring Documentary of a Technical Writer And a Husband who must Meet a Monkey in An Abandoned Fun House', '''abandon'':22 ''apollo'':2 ''awe'':5 ''awe-inspir'':4 ''documentari'':7 ''fun'':23 ''hous'':24 ''husband'':14 ''inspir'':6 ''meet'':17 ''monkey'':19 ''must'':16 ''scorpion'':1 ''technic'':10 ''writer'':11', '1', '2013-05-26T14:50:58.951000', 137, 'NC-17', 2006, 3, '4.99', '23.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Scorpion Apollo'), + ('A Insightful Panorama of a Crocodile And a Boat who must Conquer a Sumo Wrestler in A MySQL Convention', '''boat'':11 ''conquer'':14 ''convent'':21 ''crocodil'':8 ''gold'':2 ''insight'':4 ''must'':13 ''mysql'':20 ''panorama'':5 ''sumo'':16 ''swarm'':1 ''wrestler'':17', '1', '2013-05-26T14:50:58.951000', 123, 'PG-13', 2006, 4, '0.99', '12.99', ARRAY['Trailers', 'Commentaries']::text[], 'Swarm Gold'), + ('A Intrepid Saga of a Man And a Forensic Psychologist who must Reach a Squirrel in A Monastery', '''divid'':1 ''forens'':11 ''intrepid'':4 ''man'':8 ''monasteri'':20 ''monster'':2 ''must'':14 ''psychologist'':12 ''reach'':15 ''saga'':5 ''squirrel'':17', '1', '2013-05-26T14:50:58.951000', 68, 'PG-13', 2006, 6, '2.99', '13.99', ARRAY['Trailers', 'Commentaries']::text[], 'Divide Monster'), + ('A Thoughtful Story of a Astronaut And a Composer who must Conquer a Dog in The Sahara Desert', '''astronaut'':8 ''compos'':11 ''conquer'':14 ''desert'':20 ''dog'':16 ''hanki'':2 ''must'':13 ''outlaw'':1 ''sahara'':19 ''stori'':5 ''thought'':4', '1', '2013-05-26T14:50:58.951000', 148, 'PG-13', 2006, 7, '4.99', '17.99', ARRAY['Trailers', 'Commentaries']::text[], 'Outlaw Hanky'), + ('A Fateful Display of a Waitress And a Dentist who must Reach a Butler in Nigeria', '''butler'':16 ''craft'':2 ''dentist'':11 ''display'':5 ''everyon'':1 ''fate'':4 ''must'':13 ''nigeria'':18 ''reach'':14 ''waitress'':8', '1', '2013-05-26T14:50:58.951000', 163, 'PG', 2006, 4, '0.99', '29.99', ARRAY['Trailers', 'Commentaries']::text[], 'Everyone Craft'), + ('A Boring Reflection of a Lumberjack And a Feminist who must Discover a Woman in Nigeria', '''amistad'':2 ''bore'':4 ''catch'':1 ''discov'':14 ''feminist'':11 ''lumberjack'':8 ''must'':13 ''nigeria'':18 ''reflect'':5 ''woman'':16', '1', '2013-05-26T14:50:58.951000', 183, 'G', 2006, 7, '0.99', '10.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Catch Amistad'), + ('A Touching Epistle of a Monkey And a Feminist who must Discover a Boat in Berlin', '''berlin'':18 ''boat'':16 ''discov'':14 ''epistl'':5 ''feminist'':11 ''jump'':1 ''monkey'':8 ''must'':13 ''touch'':4 ''wrath'':2', '1', '2013-05-26T14:50:58.951000', 74, 'NC-17', 2006, 4, '0.99', '18.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Jumping Wrath'), + ('A Fateful Tale of a Man And a Feminist who must Conquer a Crocodile in A Manhattan Penthouse', '''conquer'':14 ''crocodil'':16 ''fate'':4 ''feminist'':11 ''gilbert'':1 ''man'':8 ''manhattan'':19 ''must'':13 ''pelican'':2 ''penthous'':20 ''tale'':5', '1', '2013-05-26T14:50:58.951000', 114, 'G', 2006, 7, '0.99', '13.99', ARRAY['Trailers', 'Commentaries']::text[], 'Gilbert Pelican'), + ('A Fast-Paced Documentary of a Technical Writer And a Pastry Chef who must Escape a Moose in A U-Boat', '''boat'':25 ''chef'':15 ''documentari'':7 ''escap'':18 ''fast'':5 ''fast-pac'':4 ''moos'':20 ''must'':17 ''pace'':6 ''pastri'':14 ''sea'':1 ''technic'':10 ''u'':24 ''u-boat'':23 ''virgin'':2 ''writer'':11', '1', '2013-05-26T14:50:58.951000', 80, 'PG', 2006, 4, '2.99', '24.99', ARRAY['Deleted Scenes']::text[], 'Sea Virgin'), + ('A Emotional Display of a Pioneer And a Technical Writer who must Battle a Man in A Baloon', '''amadeus'':1 ''baloon'':20 ''battl'':15 ''display'':5 ''emot'':4 ''holi'':2 ''man'':17 ''must'':14 ''pioneer'':8 ''technic'':11 ''writer'':12', '1', '2013-05-26T14:50:58.951000', 113, 'PG', 2006, 6, '0.99', '20.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Amadeus Holy'), + ('A Thoughtful Documentary of a Dog And a Man who must Sink a Man in A Shark Tank', '''documentari'':5 ''dog'':8 ''man'':11,16 ''must'':13 ''shark'':19 ''sink'':14 ''tank'':20 ''thought'':4 ''torqu'':2 ''vision'':1', '1', '2013-05-26T14:50:58.951000', 59, 'PG-13', 2006, 5, '0.99', '16.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Vision Torque'), + ('A Thrilling Story of a Cat And a Waitress who must Fight a Explorer in The Outback', '''cat'':8 ''drive'':2 ''explor'':16 ''eye'':1 ''fight'':14 ''must'':13 ''outback'':19 ''stori'':5 ''thrill'':4 ''waitress'':11', '1', '2013-05-26T14:50:58.951000', 172, 'PG-13', 2006, 4, '2.99', '13.99', ARRAY['Trailers', 'Commentaries']::text[], 'Eyes Driving'), + ('A Fateful Display of a Monkey And a Car who must Sink a Husband in A MySQL Convention', '''car'':11 ''convent'':20 ''display'':5 ''fate'':4 ''hurrican'':2 ''husband'':16 ''monkey'':8 ''must'':13 ''mysql'':19 ''sink'':14 ''tower'':1', '1', '2013-05-26T14:50:58.951000', 144, 'NC-17', 2006, 7, '0.99', '14.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Towers Hurricane'), + ('A Amazing Epistle of a Girl And a Woman who must Outrace a Waitress in Soviet Georgia', '''amaz'':4 ''epistl'':5 ''georgia'':19 ''girl'':8 ''kick'':2 ''must'':13 ''outrac'':14 ''soviet'':18 ''taxi'':1 ''waitress'':16 ''woman'':11', '1', '2013-05-26T14:50:58.951000', 64, 'PG-13', 2006, 4, '0.99', '23.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Taxi Kick'), + ('A Fateful Display of a Womanizer And a Mad Scientist who must Outgun a A Shark in Soviet Georgia', '''beach'':1 ''display'':5 ''fate'':4 ''georgia'':21 ''heartbreak'':2 ''mad'':11 ''must'':14 ''outgun'':15 ''scientist'':12 ''shark'':18 ''soviet'':20 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 122, 'G', 2006, 6, '2.99', '16.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Beach Heartbreakers'), + ('A Emotional Character Study of a Hunter And a Car who must Kill a Woman in Berlin', '''berlin'':19 ''car'':12 ''charact'':5 ''emot'':4 ''hard'':1 ''hunter'':9 ''kill'':15 ''must'':14 ''robber'':2 ''studi'':6 ''woman'':17', '1', '2013-05-26T14:50:58.951000', 72, 'R', 2006, 7, '2.99', '15.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Hardly Robbers') + ) AS data(description, fulltext, old_language_id, last_update, length, rating, release_year, rental_duration, rental_rate, replacement_cost, special_features, title) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."language"' + AND map0.old_id = data.old_language_id + RETURNING film_id + ) + SELECT array_agg(film_id) INTO v_new_ids_film FROM inserted; + + FOR i IN 1..array_length(v_new_ids_film, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."film"', v_old_ids_film[i], v_new_ids_film[i]::TEXT); + END LOOP; + + v_old_ids_film := ARRAY['73', '94', '329', '484', '579', '78', '161', '898', '601', '885', '92', '863', '920', '338', '522', '681', '650', '6', '345', '664', '767', '791', '872', '396', '432', '486', '592', '21', '122', '163', '709', '847', '744', '710', '866', '277', '967', '604', '80', '718', '972', '762', '742', '864', '409', '916', '949', '882', '683', '751', '193', '775', '975', '680', '204', '56', '102', '595', '991', '580', '100', '558', '725', '756', '342', '615', '312', '15', '494', '630', '27', '827', '565', '382', '231', '587', '581', '924', '720', '262', '946', '862', '900', '682', '708', '938', '758', '265', '685', '35', '392', '804', '815', '574', '430', '721', '706', '693', '39', '196']; + WITH inserted AS ( + INSERT INTO "public"."film" ("description", "fulltext", "language_id", "last_update", "length", "rating", "release_year", "rental_duration", "rental_rate", "replacement_cost", "special_features", "title") + SELECT + data.description::text, + data.fulltext::tsvector, + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.length::smallint, + data.rating::mpaa_rating, + data.release_year::integer, + data.rental_duration::smallint, + data.rental_rate::numeric, + data.replacement_cost::numeric, + data.special_features::text[], + data.title::character varying + FROM (VALUES + ('A Touching Tale of a Girl And a Crocodile who must Discover a Waitress in Nigeria', '''bingo'':1 ''crocodil'':11 ''discov'':14 ''girl'':8 ''must'':13 ''nigeria'':18 ''tale'':5 ''talent'':2 ''touch'':4 ''waitress'':16', '1', '2013-05-26T14:50:58.951000', 150, 'PG-13', 2006, 5, '2.99', '22.99', ARRAY['Trailers', 'Commentaries']::text[], 'Bingo Talented'), + ('A Insightful Story of a Dog And a Pastry Chef who must Battle a Girl in Berlin', '''battl'':15 ''berlin'':19 ''braveheart'':1 ''chef'':12 ''dog'':8 ''girl'':17 ''human'':2 ''insight'':4 ''must'':14 ''pastri'':11 ''stori'':5', '1', '2013-05-26T14:50:58.951000', 176, 'PG-13', 2006, 7, '2.99', '14.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Braveheart Human'), + ('A Thrilling Documentary of a Forensic Psychologist And a Butler who must Defeat a Explorer in A Jet Boat', '''boat'':21 ''butler'':12 ''defeat'':15 ''documentari'':5 ''explor'':17 ''forens'':8 ''forrest'':1 ''jet'':20 ''must'':14 ''psychologist'':9 ''son'':2 ''thrill'':4', '1', '2013-05-26T14:50:58.951000', 63, 'R', 2006, 4, '2.99', '15.99', ARRAY['Commentaries']::text[], 'Forrest Sons'), + ('A Touching Character Study of a Pastry Chef And a Database Administrator who must Reach a A Shark in Ancient Japan', '''administr'':14 ''ancient'':22 ''charact'':5 ''chef'':10 ''databas'':13 ''japan'':23 ''jerk'':1 ''must'':16 ''pastri'':9 ''paycheck'':2 ''reach'':17 ''shark'':20 ''studi'':6 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 172, 'NC-17', 2006, 3, '2.99', '13.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Jerk Paycheck'), + ('A Taut Yarn of a Mad Scientist And a Crocodile who must Outgun a Database Administrator in A Monastery', '''administr'':18 ''crocodil'':12 ''databas'':17 ''mad'':8 ''mind'':1 ''monasteri'':21 ''must'':14 ''outgun'':15 ''scientist'':9 ''taut'':4 ''truman'':2 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 149, 'PG-13', 2006, 3, '4.99', '22.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Minds Truman'), + ('A Intrepid Yarn of a Pastry Chef And a Mad Scientist who must Challenge a Secret Agent in Ancient Japan', '''agent'':19 ''ancient'':21 ''blackout'':1 ''challeng'':16 ''chef'':9 ''intrepid'':4 ''japan'':22 ''mad'':12 ''must'':15 ''pastri'':8 ''privat'':2 ''scientist'':13 ''secret'':18 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 85, 'PG', 2006, 7, '2.99', '12.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Blackout Private'), + ('A Taut Tale of a Butler And a Mad Scientist who must Build a Crocodile in Ancient China', '''ancient'':19 ''build'':15 ''butler'':8 ''china'':20 ''clue'':1 ''crocodil'':17 ''grail'':2 ''mad'':11 ''must'':14 ''scientist'':12 ''tale'':5 ''taut'':4', '1', '2013-05-26T14:50:58.951000', 70, 'NC-17', 2006, 6, '4.99', '27.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Clue Grail'), + ('A Boring Story of a Butler And a Astronaut who must Outrace a Pioneer in Australia', '''astronaut'':11 ''australia'':18 ''bore'':4 ''butler'':8 ''must'':13 ''outrac'':14 ''pelican'':2 ''pioneer'':16 ''stori'':5 ''tourist'':1', '1', '2013-05-26T14:50:58.951000', 152, 'PG-13', 2006, 4, '4.99', '18.99', ARRAY['Deleted Scenes']::text[], 'Tourist Pelican'), + ('A Astounding Story of a Forensic Psychologist And a Cat who must Battle a Teacher in An Abandoned Mine Shaft', '''abandon'':20 ''astound'':4 ''battl'':15 ''cat'':12 ''forens'':8 ''mine'':21 ''moulin'':1 ''must'':14 ''psychologist'':9 ''shaft'':22 ''stori'':5 ''teacher'':17 ''wake'':2', '1', '2013-05-26T14:50:58.951000', 79, 'PG-13', 2006, 4, '0.99', '20.99', ARRAY['Trailers']::text[], 'Moulin Wake'), + ('A Awe-Inspiring Yarn of a Student And a Teacher who must Fight a Teacher in An Abandoned Amusement Park', '''abandon'':21 ''amus'':22 ''awe'':5 ''awe-inspir'':4 ''fight'':16 ''inspir'':6 ''must'':15 ''park'':23 ''student'':10 ''teacher'':13,18 ''texa'':1 ''watch'':2 ''yarn'':7', '1', '2013-05-26T14:50:58.951000', 179, 'NC-17', 2006, 7, '0.99', '22.99', ARRAY['Trailers']::text[], 'Texas Watch'), + ('A Fast-Paced Yarn of a Waitress And a Composer who must Outgun a Dentist in California', '''bowfing'':1 ''california'':20 ''compos'':13 ''dentist'':18 ''fast'':5 ''fast-pac'':4 ''gabl'':2 ''must'':15 ''outgun'':16 ''pace'':6 ''waitress'':10 ''yarn'':7', '1', '2013-05-26T14:50:58.951000', 72, 'NC-17', 2006, 7, '4.99', '19.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Bowfinger Gables'), + ('A Beautiful Display of a Mad Cow And a Dog who must Redeem a Waitress in An Abandoned Amusement Park', '''abandon'':20 ''amus'':21 ''beauti'':4 ''confess'':2 ''cow'':9 ''display'':5 ''dog'':12 ''mad'':8 ''must'':14 ''park'':22 ''redeem'':15 ''sun'':1 ''waitress'':17', '1', '2013-05-26T14:50:58.951000', 141, 'R', 2006, 5, '0.99', '9.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Sun Confessions'), + ('A Amazing Character Study of a Robot And a Student who must Chase a Robot in Australia', '''amaz'':4 ''australia'':19 ''charact'':5 ''chase'':15 ''karat'':2 ''must'':14 ''robot'':9,17 ''student'':12 ''studi'':6 ''unbreak'':1', '1', '2013-05-26T14:50:58.951000', 62, 'G', 2006, 3, '0.99', '16.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Unbreakable Karate'), + ('A Beautiful Documentary of a Woman And a Pioneer who must Pursue a Mad Scientist in A Shark Tank', '''beauti'':4 ''documentari'':5 ''forrest'':2 ''frisco'':1 ''mad'':16 ''must'':13 ''pioneer'':11 ''pursu'':14 ''scientist'':17 ''shark'':20 ''tank'':21 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 51, 'PG', 2006, 6, '4.99', '23.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Frisco Forrest'), + ('A Thrilling Reflection of a Teacher And a Composer who must Find a Man in The First Manned Space Station', '''compos'':11 ''find'':14 ''first'':19 ''life'':1 ''man'':16,20 ''must'':13 ''reflect'':5 ''space'':21 ''station'':22 ''teacher'':8 ''thrill'':4 ''twist'':2', '1', '2013-05-26T14:50:58.951000', 137, 'NC-17', 2006, 4, '2.99', '9.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Life Twisted'), + ('A Stunning Drama of a Woman And a Lumberjack who must Overcome a A Shark in The Canadian Rockies', '''canadian'':20 ''drama'':5 ''lumberjack'':11 ''must'':13 ''overcom'':14 ''pirat'':1 ''rocki'':21 ''roxann'':2 ''shark'':17 ''stun'':4 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 100, 'PG', 2006, 4, '0.99', '20.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Pirates Roxanne'), + ('A Thrilling Yarn of a Dog And a Moose who must Kill a Pastry Chef in A Manhattan Penthouse', '''amistad'':2 ''chef'':17 ''dog'':8 ''kill'':14 ''manhattan'':20 ''moos'':11 ''must'':13 ''pacif'':1 ''pastri'':16 ''penthous'':21 ''thrill'':4 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 144, 'G', 2006, 3, '0.99', '27.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Pacific Amistad'), + ('A Intrepid Panorama of a Robot And a Boy who must Escape a Sumo Wrestler in Ancient China', '''agent'':1 ''ancient'':19 ''boy'':11 ''china'':20 ''escap'':14 ''intrepid'':4 ''must'':13 ''panorama'':5 ''robot'':8 ''sumo'':16 ''truman'':2 ''wrestler'':17', '1', '2013-05-26T14:50:58.951000', 169, 'PG', 2006, 3, '2.99', '17.99', ARRAY['Deleted Scenes']::text[], 'Agent Truman'), + ('A Fateful Display of a Cat And a Pioneer who must Challenge a Pastry Chef in A Baloon Factory', '''baloon'':20 ''cat'':8 ''challeng'':14 ''chef'':17 ''display'':5 ''factori'':21 ''fate'':4 ''gabl'':1 ''metropoli'':2 ''must'':13 ''pastri'':16 ''pioneer'':11', '1', '2013-05-26T14:50:58.951000', 161, 'PG', 2006, 3, '0.99', '17.99', ARRAY['Trailers', 'Commentaries']::text[], 'Gables Metropolis'), + ('A Taut Saga of a Robot And a Database Administrator who must Challenge a Astronaut in California', '''administr'':12 ''astronaut'':17 ''california'':19 ''challeng'':15 ''databas'':11 ''must'':14 ''patriot'':1 ''robot'':8 ''roman'':2 ''saga'':5 ''taut'':4', '1', '2013-05-26T14:50:58.951000', 65, 'PG', 2006, 6, '2.99', '12.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Patriot Roman'), + ('A Fateful Reflection of a Car And a Teacher who must Confront a Waitress in A Monastery', '''car'':8 ''confront'':14 ''duck'':2 ''fate'':4 ''monasteri'':19 ''must'':13 ''reflect'':5 ''scalawag'':1 ''teacher'':11 ''waitress'':16', '1', '2013-05-26T14:50:58.951000', 183, 'NC-17', 2006, 6, '4.99', '13.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Scalawag Duck'), + ('A Fanciful Saga of a Student And a Girl who must Find a Butler in Ancient Japan', '''ancient'':18 ''butler'':16 ''fanci'':4 ''find'':14 ''girl'':11 ''japan'':19 ''lord'':2 ''must'':13 ''saga'':5 ''show'':1 ''student'':8', '1', '2013-05-26T14:50:58.951000', 167, 'PG-13', 2006, 3, '4.99', '24.99', ARRAY['Deleted Scenes']::text[], 'Show Lord'), + ('A Unbelieveable Epistle of a Sumo Wrestler And a Hunter who must Chase a Forensic Psychologist in A Baloon', '''baloon'':21 ''brotherhood'':2 ''chase'':15 ''epistl'':5 ''forens'':17 ''hunter'':12 ''must'':14 ''psychologist'':18 ''sumo'':8 ''sweet'':1 ''unbeliev'':4 ''wrestler'':9', '1', '2013-05-26T14:50:58.951000', 185, 'R', 2006, 3, '2.99', '27.99', ARRAY['Deleted Scenes']::text[], 'Sweet Brotherhood'), + ('A Action-Packed Yarn of a Boat And a Crocodile who must Build a Monkey in Berlin', '''action'':5 ''action-pack'':4 ''berlin'':20 ''boat'':10 ''build'':16 ''crocodil'':13 ''deep'':2 ''hang'':1 ''monkey'':18 ''must'':15 ''pack'':6 ''yarn'':7', '1', '2013-05-26T14:50:58.951000', 62, 'G', 2006, 5, '4.99', '18.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Hanging Deep'), + ('A Amazing Documentary of a Student And a Sumo Wrestler who must Outgun a A Shark in A Shark Tank', '''amaz'':4 ''documentari'':5 ''hope'':1 ''must'':14 ''outgun'':15 ''shark'':18,21 ''student'':8 ''sumo'':11 ''tank'':22 ''tootsi'':2 ''wrestler'':12', '1', '2013-05-26T14:50:58.951000', 139, 'NC-17', 2006, 4, '2.99', '22.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Hope Tootsie'), + ('A Amazing Display of a Lumberjack And a Teacher who must Outrace a Woman in A U-Boat', '''amaz'':4 ''boat'':21 ''display'':5 ''jet'':1 ''lumberjack'':8 ''must'':13 ''neighbor'':2 ''outrac'':14 ''teacher'':11 ''u'':20 ''u-boat'':19 ''woman'':16', '1', '2013-05-26T14:50:58.951000', 59, 'R', 2006, 7, '4.99', '14.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Jet Neighbors'), + ('A Fast-Paced Story of a Waitress And a Cat who must Fight a Girl in Australia', '''australia'':20 ''cat'':13 ''fast'':5 ''fast-pac'':4 ''fight'':16 ''girl'':18 ''monster'':1 ''must'':15 ''pace'':6 ''spartacus'':2 ''stori'':7 ''waitress'':10', '1', '2013-05-26T14:50:58.951000', 107, 'PG', 2006, 6, '2.99', '28.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Monster Spartacus'), + ('A Insightful Drama of a Girl And a Astronaut who must Face a Database Administrator in A Shark Tank', '''administr'':17 ''american'':1 ''astronaut'':11 ''circus'':2 ''databas'':16 ''drama'':5 ''face'':14 ''girl'':8 ''insight'':4 ''must'':13 ''shark'':20 ''tank'':21', '1', '2013-05-26T14:50:58.951000', 129, 'R', 2006, 3, '4.99', '17.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'American Circus'), + ('A Amazing Epistle of a Student And a Astronaut who must Discover a Frisbee in The Canadian Rockies', '''amaz'':4 ''astronaut'':11 ''bunch'':2 ''canadian'':19 ''carri'':1 ''discov'':14 ''epistl'':5 ''frisbe'':16 ''must'':13 ''rocki'':20 ''student'':8', '1', '2013-05-26T14:50:58.951000', 114, 'PG', 2006, 7, '0.99', '11.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Carrie Bunch'), + ('A Beautiful Yarn of a Astronaut And a Frisbee who must Overcome a Explorer in A Jet Boat', '''astronaut'':8 ''beauti'':4 ''boat'':20 ''clyde'':1 ''explor'':16 ''frisbe'':11 ''jet'':19 ''must'':13 ''overcom'':14 ''theori'':2 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 139, 'PG-13', 2006, 4, '0.99', '29.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Clyde Theory'), + ('A Emotional Display of a Monkey And a Waitress who must Reach a Secret Agent in California', '''agent'':17 ''california'':19 ''display'':5 ''egg'':2 ''emot'':4 ''monkey'':8 ''must'':13 ''racer'':1 ''reach'':14 ''secret'':16 ''waitress'':11', '1', '2013-05-26T14:50:58.951000', 147, 'NC-17', 2006, 7, '2.99', '19.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Racer Egg'), + ('A Boring Epistle of a Crocodile And a Lumberjack who must Outgun a Moose in Ancient China', '''ancient'':18 ''bore'':4 ''china'':19 ''crocodil'':8 ''epistl'':5 ''glass'':2 ''lumberjack'':11 ''moos'':16 ''must'':13 ''outgun'':14 ''stock'':1', '1', '2013-05-26T14:50:58.951000', 160, 'PG', 2006, 7, '2.99', '10.99', ARRAY['Commentaries']::text[], 'Stock Glass'), + ('A Brilliant Drama of a Mad Cow And a Hunter who must Escape a Hunter in Berlin', '''berlin'':19 ''brilliant'':4 ''cow'':9 ''drama'':5 ''escap'':15 ''hunter'':12,17 ''mad'':8 ''must'':14 ''rememb'':2 ''root'':1', '1', '2013-05-26T14:50:58.951000', 89, 'PG-13', 2006, 4, '0.99', '23.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Roots Remember'), + ('A Fast-Paced Saga of a Astronaut And a Secret Agent who must Escape a Hunter in An Abandoned Amusement Park', '''abandon'':22 ''agent'':14 ''amus'':23 ''astronaut'':10 ''escap'':17 ''fast'':5 ''fast-pac'':4 ''game'':2 ''hunter'':19 ''must'':16 ''pace'':6 ''park'':24 ''rage'':1 ''saga'':7 ''secret'':13', '1', '2013-05-26T14:50:58.951000', 120, 'R', 2006, 4, '4.99', '18.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Rage Games'), + ('A Awe-Inspiring Reflection of a Astronaut And a A Shark who must Defeat a Forensic Psychologist in California', '''astronaut'':10 ''awe'':5 ''awe-inspir'':4 ''california'':22 ''defeat'':17 ''forens'':19 ''inspir'':6 ''must'':16 ''psychologist'':20 ''racer'':2 ''reflect'':7 ''shark'':14 ''sunset'':1', '1', '2013-05-26T14:50:58.951000', 48, 'NC-17', 2006, 6, '0.99', '28.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Sunset Racer'), + ('A Beautiful Panorama of a Lumberjack And a Forensic Psychologist who must Overcome a Frisbee in A Baloon', '''baloon'':20 ''beauti'':4 ''eleph'':1 ''forens'':11 ''frisbe'':17 ''lumberjack'':8 ''must'':14 ''overcom'':15 ''panorama'':5 ''psychologist'':12 ''trojan'':2', '1', '2013-05-26T14:50:58.951000', 126, 'PG-13', 2006, 4, '4.99', '24.99', ARRAY['Behind the Scenes']::text[], 'Elephant Trojan'), + ('A Fast-Paced Documentary of a Car And a Butler who must Find a Frisbee in A Jet Boat', '''boat'':22 ''butler'':13 ''car'':10 ''documentari'':7 ''fast'':5 ''fast-pac'':4 ''find'':16 ''frisbe'':18 ''jet'':21 ''must'':15 ''pace'':6 ''person'':2 ''weekend'':1', '1', '2013-05-26T14:50:58.951000', 134, 'R', 2006, 5, '2.99', '26.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Weekend Personal'), + ('A Emotional Saga of a Womanizer And a Pioneer who must Overcome a Dentist in A Baloon', '''baloon'':19 ''dentist'':16 ''emot'':4 ''moon'':2 ''mulan'':1 ''must'':13 ''overcom'':14 ''pioneer'':11 ''saga'':5 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 160, 'G', 2006, 4, '0.99', '10.99', ARRAY['Behind the Scenes']::text[], 'Mulan Moon'), + ('A Emotional Documentary of a Student And a Girl who must Build a Boat in Nigeria', '''bever'':2 ''blanket'':1 ''boat'':16 ''build'':14 ''documentari'':5 ''emot'':4 ''girl'':11 ''must'':13 ''nigeria'':18 ''student'':8', '1', '2013-05-26T14:50:58.951000', 148, 'G', 2006, 7, '2.99', '21.99', ARRAY['Trailers']::text[], 'Blanket Beverly'), + ('A Intrepid Yarn of a Database Administrator And a Boat who must Outrace a Husband in Ancient India', '''administr'':9 ''airport'':2 ''ancient'':19 ''boat'':12 ''databas'':8 ''husband'':17 ''india'':20 ''intrepid'':4 ''must'':14 ''outrac'':15 ''rebel'':1 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 73, 'G', 2006, 7, '0.99', '24.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Rebel Airport'), + ('A Intrepid Story of a Dentist And a Hunter who must Confront a Monkey in Ancient Japan', '''ancient'':18 ''confront'':14 ''dentist'':8 ''giant'':2 ''hunter'':11 ''intrepid'':4 ''japan'':19 ''monkey'':16 ''must'':13 ''stori'':5 ''whisper'':1', '1', '2013-05-26T14:50:58.951000', 59, 'PG-13', 2006, 4, '4.99', '24.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Whisperer Giant'), + ('A Fast-Paced Documentary of a Dog And a Teacher who must Find a Moose in A Manhattan Penthouse', '''documentari'':7 ''dog'':10 ''fast'':5 ''fast-pac'':4 ''find'':16 ''manhattan'':21 ''moos'':18 ''must'':15 ''pace'':6 ''packer'':2 ''penthous'':22 ''sassi'':1 ''teacher'':13', '1', '2013-05-26T14:50:58.951000', 154, 'G', 2006, 6, '0.99', '29.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Sassy Packer'), + ('A Lacklusture Reflection of a Car And a Explorer who must Find a Monkey in A Baloon', '''baloon'':19 ''car'':8 ''champion'':2 ''explor'':11 ''find'':14 ''lacklustur'':4 ''monkey'':16 ''must'':13 ''reflect'':5 ''roof'':1', '1', '2013-05-26T14:50:58.951000', 101, 'R', 2006, 7, '0.99', '25.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Roof Champion'), + ('A Epic Drama of a Lumberjack And a Explorer who must Confront a Hunter in A Baloon Factory', '''baloon'':19 ''confront'':14 ''drama'':5 ''epic'':4 ''explor'':11 ''factori'':20 ''hunter'':16 ''invas'':2 ''lumberjack'':8 ''must'':13 ''sundanc'':1', '1', '2013-05-26T14:50:58.951000', 92, 'NC-17', 2006, 5, '0.99', '21.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Sundance Invasion'), + ('A Awe-Inspiring Documentary of a A Shark And a Dentist who must Outrace a Pastry Chef in The Canadian Rockies', '''awe'':5 ''awe-inspir'':4 ''bright'':2 ''canadian'':23 ''chef'':20 ''dentist'':14 ''documentari'':7 ''heartbreak'':1 ''inspir'':6 ''must'':16 ''outrac'':17 ''pastri'':19 ''rocki'':24 ''shark'':11', '1', '2013-05-26T14:50:58.951000', 59, 'G', 2006, 3, '4.99', '9.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Heartbreakers Bright'), + ('A Stunning Tale of a Man And a Monkey who must Chase a Student in New Orleans', '''chase'':14 ''man'':8 ''monkey'':11 ''must'':13 ''new'':18 ''orlean'':19 ''star'':2 ''student'':16 ''stun'':4 ''tale'':5 ''turn'':1', '1', '2013-05-26T14:50:58.951000', 80, 'G', 2006, 3, '2.99', '10.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Turn Star'), + ('A Awe-Inspiring Yarn of a Hunter And a Feminist who must Challenge a Dentist in The Outback', '''awe'':5 ''awe-inspir'':4 ''challeng'':16 ''dentist'':18 ''feminist'':13 ''hunter'':10 ''inspir'':6 ''must'':15 ''outback'':21 ''texa'':2 ''volcano'':1 ''yarn'':7', '1', '2013-05-26T14:50:58.951000', 157, 'NC-17', 2006, 6, '0.99', '27.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Volcano Texas'), + ('A Taut Display of a Pioneer And a Man who must Reach a Girl in The Gulf of Mexico', '''command'':2 ''display'':5 ''girl'':16 ''gulf'':19 ''man'':11 ''mexico'':21 ''must'':13 ''pioneer'':8 ''reach'':14 ''taut'':4 ''tenenbaum'':1', '1', '2013-05-26T14:50:58.951000', 99, 'PG-13', 2006, 4, '0.99', '24.99', ARRAY['Trailers', 'Commentaries']::text[], 'Tenenbaums Command'), + ('A Boring Panorama of a Feminist And a Moose who must Defeat a Database Administrator in Nigeria', '''administr'':17 ''bore'':4 ''bound'':2 ''databas'':16 ''defeat'':14 ''feminist'':8 ''moos'':11 ''must'':13 ''nigeria'':19 ''panorama'':5 ''piti'':1', '1', '2013-05-26T14:50:58.951000', 60, 'NC-17', 2006, 5, '4.99', '19.99', ARRAY['Commentaries']::text[], 'Pity Bound'), + ('A Thoughtful Documentary of a Boat And a Man who must Meet a Boat in An Abandoned Fun House', '''abandon'':19 ''boat'':8,16 ''documentari'':5 ''fun'':20 ''hous'':21 ''man'':11 ''meet'':14 ''must'':13 ''runaway'':1 ''tenenbaum'':2 ''thought'':4', '1', '2013-05-26T14:50:58.951000', 181, 'NC-17', 2006, 6, '0.99', '17.99', ARRAY['Commentaries']::text[], 'Runaway Tenenbaums'), + ('A Intrepid Documentary of a Sumo Wrestler And a Astronaut who must Battle a Composer in The Outback', '''astronaut'':12 ''battl'':15 ''casualti'':2 ''compos'':17 ''crossroad'':1 ''documentari'':5 ''intrepid'':4 ''must'':14 ''outback'':20 ''sumo'':8 ''wrestler'':9', '1', '2013-05-26T14:50:58.951000', 153, 'G', 2006, 5, '2.99', '20.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Crossroads Casualties'), + ('A Insightful Reflection of a Crocodile And a Sumo Wrestler who must Meet a Technical Writer in The Sahara Desert', '''crocodil'':8 ''desert'':22 ''expec'':2 ''insight'':4 ''meet'':15 ''must'':14 ''reflect'':5 ''sahara'':21 ''seattl'':1 ''sumo'':11 ''technic'':17 ''wrestler'':12 ''writer'':18', '1', '2013-05-26T14:50:58.951000', 110, 'PG-13', 2006, 4, '4.99', '18.99', ARRAY['Trailers']::text[], 'Seattle Expecations'), + ('A Brilliant Panorama of a Boat And a Astronaut who must Challenge a Teacher in A Manhattan Penthouse', '''astronaut'':11 ''boat'':8 ''brilliant'':4 ''challeng'':14 ''manhattan'':19 ''must'':13 ''panorama'':5 ''penthous'':20 ''teacher'':16 ''traci'':2 ''willow'':1', '1', '2013-05-26T14:50:58.951000', 137, 'R', 2006, 6, '2.99', '22.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Willow Tracy'), + ('A Action-Packed Reflection of a Mad Scientist And a A Shark who must Find a Feminist in California', '''action'':5 ''action-pack'':4 ''california'':22 ''feminist'':20 ''find'':18 ''mad'':10 ''must'':17 ''pack'':6 ''pinocchio'':1 ''reflect'':7 ''scientist'':11 ''shark'':15 ''simon'':2', '1', '2013-05-26T14:50:58.951000', 103, 'PG', 2006, 4, '4.99', '21.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Pinocchio Simon'), + ('A Emotional Epistle of a Moose And a Hunter who must Overcome a Robot in A Manhattan Penthouse', '''dalmat'':1 ''emot'':4 ''epistl'':5 ''hunter'':11 ''manhattan'':19 ''moos'':8 ''must'':13 ''overcom'':14 ''penthous'':20 ''robot'':16 ''sweden'':2', '1', '2013-05-26T14:50:58.951000', 106, 'PG', 2006, 4, '0.99', '25.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Dalmations Sweden'), + ('A Intrepid Story of a Cat And a Student who must Vanquish a Girl in An Abandoned Amusement Park', '''abandon'':19 ''amus'':20 ''barefoot'':1 ''cat'':8 ''girl'':16 ''intrepid'':4 ''manchurian'':2 ''must'':13 ''park'':21 ''stori'':5 ''student'':11 ''vanquish'':14', '1', '2013-05-26T14:50:58.951000', 129, 'G', 2006, 6, '2.99', '15.99', ARRAY['Trailers', 'Commentaries']::text[], 'Barefoot Manchurian'), + ('A Awe-Inspiring Panorama of a Crocodile And a Moose who must Confront a Girl in A Baloon', '''awe'':5 ''awe-inspir'':4 ''baloon'':21 ''bubbl'':1 ''confront'':16 ''crocodil'':10 ''girl'':18 ''gross'':2 ''inspir'':6 ''moos'':13 ''must'':15 ''panorama'':7', '1', '2013-05-26T14:50:58.951000', 60, 'R', 2006, 4, '4.99', '20.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Bubble Grosse'), + ('A Beautiful Tale of a Astronaut And a Mad Cow who must Challenge a Cat in A Baloon Factory', '''astronaut'':8 ''baloon'':20 ''beauti'':4 ''bunch'':2 ''cat'':17 ''challeng'':15 ''cow'':12 ''factori'':21 ''mad'':11 ''moon'':1 ''must'':14 ''tale'':5', '1', '2013-05-26T14:50:58.951000', 83, 'PG', 2006, 7, '0.99', '20.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Moon Bunch'), + ('A Thrilling Drama of a Madman And a Dentist who must Conquer a Boy in The Outback', '''banger'':2 ''boy'':16 ''conquer'':14 ''dentist'':11 ''drama'':5 ''madman'':8 ''must'':13 ''outback'':19 ''thrill'':4 ''worst'':1', '1', '2013-05-26T14:50:58.951000', 185, 'PG', 2006, 4, '2.99', '26.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Worst Banger'), + ('A Amazing Yarn of a Robot And a Womanizer who must Discover a Forensic Psychologist in Berlin', '''amaz'':4 ''berlin'':19 ''discov'':14 ''forens'':16 ''mine'':1 ''must'':13 ''psychologist'':17 ''robot'':8 ''titan'':2 ''woman'':11 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 166, 'PG-13', 2006, 3, '4.99', '12.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Mine Titans'), + ('A Beautiful Drama of a Dentist And a Composer who must Battle a Sumo Wrestler in The First Manned Space Station', '''battl'':14 ''beauti'':4 ''brooklyn'':1 ''compos'':11 ''dentist'':8 ''desert'':2 ''drama'':5 ''first'':20 ''man'':21 ''must'':13 ''space'':22 ''station'':23 ''sumo'':16 ''wrestler'':17', '1', '2013-05-26T14:50:58.951000', 161, 'R', 2006, 7, '4.99', '21.99', ARRAY['Commentaries']::text[], 'Brooklyn Desert'), + ('A Astounding Saga of a Mad Cow And a Pastry Chef who must Discover a Husband in Ancient India', '''ancient'':20 ''astound'':4 ''chef'':13 ''cow'':9 ''discov'':16 ''husband'':18 ''india'':21 ''mad'':8 ''mannequin'':1 ''must'':15 ''pastri'':12 ''saga'':5 ''worst'':2', '1', '2013-05-26T14:50:58.951000', 71, 'PG-13', 2006, 3, '2.99', '18.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Mannequin Worst'), + ('A Unbelieveable Character Study of a Cat And a Database Administrator who must Pursue a Teacher in A Monastery', '''administr'':13 ''cat'':9 ''charact'':5 ''databas'':12 ''monasteri'':21 ''must'':15 ''pursu'':16 ''requiem'':1 ''studi'':6 ''teacher'':18 ''tycoon'':2 ''unbeliev'':4', '1', '2013-05-26T14:50:58.951000', 167, 'R', 2006, 6, '4.99', '25.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Requiem Tycoon'), + ('A Stunning Epistle of a Feminist And a A Shark who must Battle a Woman in An Abandoned Fun House', '''abandon'':20 ''antitrust'':2 ''battl'':15 ''epistl'':5 ''feminist'':8 ''fun'':21 ''hous'':22 ''must'':14 ''saddl'':1 ''shark'':12 ''stun'':4 ''woman'':17', '1', '2013-05-26T14:50:58.951000', 80, 'PG-13', 2006, 7, '2.99', '10.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Saddle Antitrust'), + ('A Taut Epistle of a Feminist And a Sumo Wrestler who must Battle a Crocodile in Australia', '''australia'':19 ''battl'':15 ''crocodil'':17 ''epistl'':5 ''feminist'':8 ''fugit'':1 ''maguir'':2 ''must'':14 ''sumo'':11 ''taut'':4 ''wrestler'':12', '1', '2013-05-26T14:50:58.951000', 83, 'R', 2006, 7, '4.99', '28.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Fugitive Maguire'), + ('A Epic Reflection of a Monkey And a Mad Cow who must Kill a Forensic Psychologist in An Abandoned Mine Shaft', '''abandon'':21 ''chocolat'':2 ''cow'':12 ''epic'':4 ''forens'':17 ''kill'':15 ''mad'':11 ''mine'':22 ''monkey'':8 ''must'':14 ''nash'':1 ''psychologist'':18 ''reflect'':5 ''shaft'':23', '1', '2013-05-26T14:50:58.951000', 180, 'PG-13', 2006, 6, '2.99', '21.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Nash Chocolat'), + ('A Boring Tale of a Squirrel And a Dog who must Challenge a Madman in The Gulf of Mexico', '''bore'':4 ''challeng'':14 ''dog'':11 ''fiddler'':1 ''gulf'':19 ''lost'':2 ''madman'':16 ''mexico'':21 ''must'':13 ''squirrel'':8 ''tale'':5', '1', '2013-05-26T14:50:58.951000', 75, 'R', 2006, 4, '4.99', '20.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Fiddler Lost'), + ('A Brilliant Drama of a Cat And a Mad Scientist who must Battle a Feminist in A MySQL Convention', '''alien'':1 ''battl'':15 ''brilliant'':4 ''cat'':8 ''center'':2 ''convent'':21 ''drama'':5 ''feminist'':17 ''mad'':11 ''must'':14 ''mysql'':20 ''scientist'':12', '1', '2013-05-26T14:50:58.951000', 46, 'NC-17', 2006, 5, '2.99', '10.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Alien Center'), + ('A Astounding Yarn of a Womanizer And a Dog who must Reach a Waitress in A MySQL Convention', '''astound'':4 ''convent'':20 ''dog'':11 ''karat'':1 ''moon'':2 ''must'':13 ''mysql'':19 ''reach'':14 ''waitress'':16 ''woman'':8 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 120, 'PG-13', 2006, 4, '0.99', '21.99', ARRAY['Behind the Scenes']::text[], 'Karate Moon'), + ('A Thoughtful Display of a Butler And a Womanizer who must Find a Waitress in The Canadian Rockies', '''butler'':8 ''canadian'':19 ''display'':5 ''find'':14 ''must'':13 ''not'':1 ''rocki'':20 ''speakeasi'':2 ''thought'':4 ''waitress'':16 ''woman'':11', '1', '2013-05-26T14:50:58.951000', 48, 'PG-13', 2006, 7, '0.99', '19.99', ARRAY['Trailers', 'Commentaries']::text[], 'Notting Speakeasy'), + ('A Amazing Reflection of a Database Administrator And a Astronaut who must Outrace a Database Administrator in A Shark Tank', '''administr'':9,18 ''amaz'':4 ''anonym'':1 ''astronaut'':12 ''databas'':8,17 ''human'':2 ''must'':14 ''outrac'':15 ''reflect'':5 ''shark'':21 ''tank'':22', '1', '2013-05-26T14:50:58.951000', 179, 'NC-17', 2006, 7, '0.99', '12.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Anonymous Human'), + ('A Fateful Display of a Pioneer And a Hunter who must Defeat a Husband in An Abandoned Mine Shaft', '''abandon'':19 ''defeat'':14 ''display'':5 ''fate'':4 ''hunter'':11 ''husband'':16 ''mine'':20 ''must'':13 ''pioneer'':8 ''shaft'':21 ''soror'':2 ''spice'':1', '1', '2013-05-26T14:50:58.951000', 141, 'NC-17', 2006, 5, '4.99', '22.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Spice Sorority'), + ('A Action-Packed Saga of a Womanizer And a Woman who must Overcome a Student in California', '''action'':5 ''action-pack'':4 ''california'':20 ''matrix'':1 ''must'':15 ''overcom'':16 ''pack'':6 ''saga'':7 ''snowman'':2 ''student'':18 ''woman'':10,13', '1', '2013-05-26T14:50:58.951000', 56, 'PG-13', 2006, 6, '4.99', '9.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Matrix Snowman'), + ('A Thoughtful Display of a Dentist And a Squirrel who must Confront a Lumberjack in A Shark Tank', '''clockwork'':2 ''confront'':14 ''dentist'':8 ''display'':5 ''grit'':1 ''lumberjack'':16 ''must'':13 ''shark'':19 ''squirrel'':11 ''tank'':20 ''thought'':4', '1', '2013-05-26T14:50:58.951000', 137, 'PG', 2006, 3, '0.99', '21.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Grit Clockwork'), + ('A Action-Packed Drama of a Feminist And a Girl who must Reach a Robot in The Canadian Rockies', '''action'':5 ''action-pack'':4 ''canadian'':21 ''dinosaur'':1 ''drama'':7 ''feminist'':10 ''girl'':13 ''must'':15 ''pack'':6 ''reach'':16 ''robot'':18 ''rocki'':22 ''secretari'':2', '1', '2013-05-26T14:50:58.951000', 63, 'R', 2006, 7, '2.99', '27.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Dinosaur Secretary'), + ('A Boring Documentary of a Mad Cow And a Cat who must Build a Lumberjack in New Orleans', '''bore'':4 ''build'':15 ''cat'':12 ''cow'':9 ''documentari'':5 ''lumberjack'':17 ''mad'':8 ''mod'':1 ''must'':14 ''new'':19 ''orlean'':20 ''secretari'':2', '1', '2013-05-26T14:50:58.951000', 77, 'NC-17', 2006, 6, '4.99', '20.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Mod Secretary'), + ('A Insightful Display of a Lumberjack And a Sumo Wrestler who must Meet a Man in The Outback', '''display'':5 ''insight'':4 ''kiss'':2 ''lumberjack'':8 ''man'':17 ''meet'':15 ''minor'':1 ''must'':14 ''outback'':20 ''sumo'':11 ''wrestler'':12', '1', '2013-05-26T14:50:58.951000', 59, 'G', 2006, 4, '0.99', '16.99', ARRAY['Trailers']::text[], 'Minority Kiss'), + ('A Taut Epistle of a Monkey And a Sumo Wrestler who must Vanquish a A Shark in A Baloon Factory', '''baloon'':21 ''epistl'':5 ''factori'':22 ''monkey'':8 ''must'':14 ''shark'':18 ''sumo'':11 ''taut'':4 ''unforgiven'':1 ''vanquish'':15 ''wrestler'':12 ''zooland'':2', '1', '2013-05-26T14:50:58.951000', 129, 'PG', 2006, 7, '0.99', '15.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Unforgiven Zoolander'), + ('A Emotional Documentary of a Dentist And a Woman who must Battle a Mad Scientist in Ancient China', '''ancient'':19 ''battl'':14 ''china'':20 ''comfort'':2 ''dentist'':8 ''documentari'':5 ''emot'':4 ''mad'':16 ''must'':13 ''redempt'':1 ''scientist'':17 ''woman'':11', '1', '2013-05-26T14:50:58.951000', 179, 'NC-17', 2006, 3, '2.99', '20.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Redemption Comforts'), + ('A Touching Display of a Feminist And a Dentist who must Conquer a Husband in The Gulf of Mexico', '''conquer'':14 ''dentist'':11 ''display'':5 ''dumbo'':1 ''feminist'':8 ''gulf'':19 ''husband'':16 ''lust'':2 ''mexico'':21 ''must'':13 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 119, 'NC-17', 2006, 5, '0.99', '17.99', ARRAY['Behind the Scenes']::text[], 'Dumbo Lust'), + ('A Fateful Tale of a Database Administrator And a Squirrel who must Discover a Student in Soviet Georgia', '''administr'':9 ''databas'':8 ''discov'':15 ''fate'':4 ''georgia'':20 ''must'':14 ''soviet'':19 ''spoiler'':2 ''squirrel'':12 ''student'':17 ''tale'':5 ''virtual'':1', '1', '2013-05-26T14:50:58.951000', 144, 'NC-17', 2006, 3, '4.99', '14.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Virtual Spoilers'), + ('A Emotional Panorama of a Lumberjack And a Hunter who must Meet a Girl in A Shark Tank', '''emot'':4 ''girl'':16 ''hunter'':11 ''lumberjack'':8 ''meet'':14 ''must'':13 ''panorama'':5 ''scarfac'':2 ''shark'':19 ''summer'':1 ''tank'':20', '1', '2013-05-26T14:50:58.951000', 53, 'G', 2006, 5, '0.99', '25.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Summer Scarface'), + ('A Awe-Inspiring Documentary of a Moose And a Madman who must Meet a Dog in An Abandoned Mine Shaft', '''abandon'':21 ''ark'':2 ''awe'':5 ''awe-inspir'':4 ''documentari'':7 ''dog'':18 ''inspir'':6 ''madman'':13 ''meet'':16 ''mine'':22 ''moos'':10 ''must'':15 ''shaft'':23 ''town'':1', '1', '2013-05-26T14:50:58.951000', 136, 'R', 2006, 6, '2.99', '17.99', ARRAY['Behind the Scenes']::text[], 'Town Ark'), + ('A Thrilling Epistle of a Boy And a Boat who must Find a Student in Soviet Georgia', '''boat'':11 ''boy'':8 ''epistl'':5 ''find'':14 ''georgia'':19 ''hunchback'':2 ''must'':13 ''pittsburgh'':1 ''soviet'':18 ''student'':16 ''thrill'':4', '1', '2013-05-26T14:50:58.951000', 134, 'PG-13', 2006, 4, '4.99', '17.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Pittsburgh Hunchback'), + ('A Thoughtful Story of a Pioneer And a Woman who must Reach a Moose in Australia', '''australia'':18 ''bull'':2 ''moos'':16 ''must'':13 ''pioneer'':8 ''quill'':1 ''reach'':14 ''stori'':5 ''thought'':4 ''woman'':11', '1', '2013-05-26T14:50:58.951000', 112, 'R', 2006, 4, '4.99', '19.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Quills Bull'), + ('A Lacklusture Tale of a Pastry Chef And a Technical Writer who must Confront a Crocodile in An Abandoned Amusement Park', '''abandon'':21 ''amus'':22 ''chef'':9 ''confront'':16 ''crocodil'':18 ''lacklustur'':4 ''must'':15 ''park'':23 ''pastri'':8 ''tale'':5 ''technic'':12 ''termin'':2 ''velvet'':1 ''writer'':13', '1', '2013-05-26T14:50:58.951000', 173, 'R', 2006, 3, '4.99', '14.99', ARRAY['Behind the Scenes']::text[], 'Velvet Terminator'), + ('A Fateful Tale of a Technical Writer And a Composer who must Pursue a Explorer in The Gulf of Mexico', '''bride'':2 ''compos'':12 ''explor'':17 ''fate'':4 ''gulf'':20 ''mexico'':22 ''must'':14 ''pursu'':15 ''saint'':1 ''tale'':5 ''technic'':8 ''writer'':9', '1', '2013-05-26T14:50:58.951000', 125, 'G', 2006, 5, '2.99', '11.99', ARRAY['Deleted Scenes']::text[], 'Saints Bride'), + ('A Intrepid Tale of a Boat And a Monkey who must Kill a Cat in California', '''boat'':8 ''california'':18 ''cat'':16 ''die'':1 ''intrepid'':4 ''kill'':14 ''maker'':2 ''monkey'':11 ''must'':13 ''tale'':5', '1', '2013-05-26T14:50:58.951000', 168, 'PG', 2006, 5, '4.99', '28.99', ARRAY['Behind the Scenes']::text[], 'Dying Maker'), + ('A Thrilling Panorama of a Man And a Woman who must Reach a Woman in Australia', '''australia'':18 ''instinct'':2 ''man'':8 ''must'':13 ''panorama'':5 ''platoon'':1 ''reach'':14 ''thrill'':4 ''woman'':11,16', '1', '2013-05-26T14:50:58.951000', 132, 'PG-13', 2006, 6, '4.99', '10.99', ARRAY['Trailers', 'Commentaries']::text[], 'Platoon Instinct'), + ('A Action-Packed Reflection of a Pastry Chef And a Composer who must Discover a Mad Scientist in The First Manned Space Station', '''action'':5 ''action-pack'':4 ''arachnophobia'':1 ''chef'':11 ''compos'':14 ''discov'':17 ''first'':23 ''mad'':19 ''man'':24 ''must'':16 ''pack'':6 ''pastri'':10 ''reflect'':7 ''rollercoast'':2 ''scientist'':20 ''space'':25 ''station'':26', '1', '2013-05-26T14:50:58.951000', 147, 'PG-13', 2006, 4, '2.99', '24.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Arachnophobia Rollercoaster'), + ('A Beautiful Panorama of a Pastry Chef And a A Shark who must Battle a Pioneer in Soviet Georgia', '''battl'':16 ''beauti'':4 ''cassidi'':2 ''chef'':9 ''georgia'':21 ''hall'':1 ''must'':15 ''panorama'':5 ''pastri'':8 ''pioneer'':18 ''shark'':13 ''soviet'':20', '1', '2013-05-26T14:50:58.951000', 51, 'NC-17', 2006, 5, '4.99', '13.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Hall Cassidy'), + ('A Stunning Reflection of a Sumo Wrestler And a Explorer who must Sink a Frisbee in A MySQL Convention', '''convent'':21 ''explor'':12 ''frisbe'':17 ''must'':14 ''mysql'':20 ''reflect'':5 ''sink'':15 ''sleep'':1 ''stun'':4 ''sumo'':8 ''suspect'':2 ''wrestler'':9', '1', '2013-05-26T14:50:58.951000', 129, 'PG-13', 2006, 7, '4.99', '13.99', ARRAY['Trailers', 'Commentaries']::text[], 'Sleeping Suspects'), + ('A Boring Epistle of a Sumo Wrestler And a Woman who must Escape a Man in The Canadian Rockies', '''bore'':4 ''canadian'':20 ''epistl'':5 ''escap'':15 ''man'':17 ''montezuma'':2 ''must'':14 ''rocki'':21 ''snatcher'':1 ''sumo'':8 ''woman'':12 ''wrestler'':9', '1', '2013-05-26T14:50:58.951000', 74, 'PG-13', 2006, 4, '2.99', '14.99', ARRAY['Commentaries']::text[], 'Snatchers Montezuma'), + ('A Taut Reflection of a Husband And a A Shark who must Redeem a Pastry Chef in A Monastery', '''chef'':18 ''husband'':8 ''midnight'':1 ''monasteri'':21 ''must'':14 ''pastri'':17 ''redeem'':15 ''reflect'':5 ''shark'':12 ''taut'':4 ''westward'':2', '1', '2013-05-26T14:50:58.951000', 86, 'G', 2006, 3, '0.99', '19.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Midnight Westward'), + ('A Insightful Story of a Boy And a Dog who must Redeem a Boy in Australia', '''australia'':18 ''boy'':8,16 ''chariot'':2 ''dog'':11 ''hook'':1 ''insight'':4 ''must'':13 ''redeem'':14 ''stori'':5', '1', '2013-05-26T14:50:58.951000', 49, 'G', 2006, 7, '0.99', '23.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Hook Chariots'), + ('A Lacklusture Yarn of a Sumo Wrestler And a Squirrel who must Redeem a Monkey in Soviet Georgia', '''georgia'':20 ''lacklustur'':4 ''monkey'':17 ''must'':14 ''pocus'':2 ''red'':1 ''redeem'':15 ''soviet'':19 ''squirrel'':12 ''sumo'':8 ''wrestler'':9 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 182, 'PG-13', 2006, 7, '4.99', '23.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Reds Pocus'), + ('A Astounding Story of a Girl And a Boy who must Challenge a Composer in New Orleans', '''astound'':4 ''boy'':11 ''challeng'':14 ''compos'':16 ''girl'':8 ''luke'':2 ''must'':13 ''new'':18 ''orlean'':19 ''queen'':1 ''stori'':5', '1', '2013-05-26T14:50:58.951000', 163, 'PG', 2006, 5, '4.99', '22.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Queen Luke'), + ('A Thrilling Epistle of a Frisbee And a Cat who must Fight a Technical Writer in Berlin', '''berlin'':19 ''cat'':11 ''connecticut'':2 ''epistl'':5 ''fight'':14 ''frisbe'':8 ''must'':13 ''potter'':1 ''technic'':16 ''thrill'':4 ''writer'':17', '1', '2013-05-26T14:50:58.951000', 115, 'PG', 2006, 5, '2.99', '16.99', ARRAY['Trailers', 'Commentaries']::text[], 'Potter Connecticut'), + ('A Fast-Paced Tale of a Boat And a Teacher who must Succumb a Composer in An Abandoned Mine Shaft', '''abandon'':21 ''armageddon'':1 ''boat'':10 ''compos'':18 ''fast'':5 ''fast-pac'':4 ''lost'':2 ''mine'':22 ''must'':15 ''pace'':6 ''shaft'':23 ''succumb'':16 ''tale'':7 ''teacher'':13', '1', '2013-05-26T14:50:58.951000', 99, 'G', 2006, 5, '0.99', '10.99', ARRAY['Trailers']::text[], 'Armageddon Lost'), + ('A Brilliant Tale of a Car And a Moose who must Battle a Dentist in Nigeria', '''battl'':14 ''brilliant'':4 ''car'':8 ''cruelti'':1 ''dentist'':16 ''moos'':11 ''must'':13 ''nigeria'':18 ''tale'':5 ''unforgiven'':2', '1', '2013-05-26T14:50:58.951000', 69, 'G', 2006, 7, '0.99', '29.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Cruelty Unforgiven') + ) AS data(description, fulltext, old_language_id, last_update, length, rating, release_year, rental_duration, rental_rate, replacement_cost, special_features, title) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."language"' + AND map0.old_id = data.old_language_id + RETURNING film_id + ) + SELECT array_agg(film_id) INTO v_new_ids_film FROM inserted; + + FOR i IN 1..array_length(v_new_ids_film, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."film"', v_old_ids_film[i], v_new_ids_film[i]::TEXT); + END LOOP; + + v_old_ids_film := ARRAY['855', '179', '255', '617', '634', '83', '783', '276', '282', '784', '405', '688', '506', '842', '353', '188', '187', '164', '249', '722', '618', '729', '874', '397', '408', '861', '576', '931', '112', '496', '941', '171', '101', '114', '957', '502', '5', '987', '723', '429', '978', '178', '907', '965', '556', '852', '600', '998', '123', '914', '45', '616', '675', '749', '521', '424', '636', '76', '406', '605', '639', '311', '495', '301', '572', '150', '36', '656', '629', '226', '389', '925', '747', '77', '662', '328', '183', '459', '11', '801', '143', '244', '958', '955', '367', '253', '445', '110', '166', '194', '377', '807', '74', '412', '423', '666', '79', '154', '904', '395']; + WITH inserted AS ( + INSERT INTO "public"."film" ("description", "fulltext", "language_id", "last_update", "length", "rating", "release_year", "rental_duration", "rental_rate", "replacement_cost", "special_features", "title") + SELECT + data.description::text, + data.fulltext::tsvector, + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.length::smallint, + data.rating::mpaa_rating, + data.release_year::integer, + data.rental_duration::smallint, + data.rental_rate::numeric, + data.replacement_cost::numeric, + data.special_features::text[], + data.title::character varying + FROM (VALUES + ('A Astounding Character Study of a Hunter And a Waitress who must Sink a Man in New Orleans', '''astound'':4 ''charact'':5 ''hunter'':9 ''man'':17 ''must'':14 ''new'':19 ''orlean'':20 ''ridgemont'':2 ''sink'':15 ''streak'':1 ''studi'':6 ''waitress'':12', '1', '2013-05-26T14:50:58.951000', 132, 'PG-13', 2006, 7, '0.99', '28.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Streak Ridgemont'), + ('A Taut Drama of a Mad Scientist And a Man who must Escape a Pioneer in An Abandoned Mine Shaft', '''abandon'':20 ''conquer'':1 ''drama'':5 ''escap'':15 ''mad'':8 ''man'':12 ''mine'':21 ''must'':14 ''nut'':2 ''pioneer'':17 ''scientist'':9 ''shaft'':22 ''taut'':4', '1', '2013-05-26T14:50:58.951000', 173, 'G', 2006, 4, '4.99', '14.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Conquerer Nuts'), + ('A Action-Packed Yarn of a Feminist And a Technical Writer who must Sink a Boat in An Abandoned Mine Shaft', '''abandon'':22 ''action'':5 ''action-pack'':4 ''boat'':19 ''drive'':1 ''feminist'':10 ''mine'':23 ''must'':16 ''pack'':6 ''polish'':2 ''shaft'':24 ''sink'':17 ''technic'':13 ''writer'':14 ''yarn'':7', '1', '2013-05-26T14:50:58.951000', 175, 'NC-17', 2006, 6, '4.99', '21.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Driving Polish'), + ('A Fast-Paced Story of a Sumo Wrestler And a Girl who must Defeat a Car in A Baloon Factory', '''baloon'':22 ''car'':19 ''defeat'':17 ''factori'':23 ''fast'':5 ''fast-pac'':4 ''girl'':14 ''must'':16 ''natur'':1 ''pace'':6 ''stock'':2 ''stori'':7 ''sumo'':10 ''wrestler'':11', '1', '2013-05-26T14:50:58.951000', 50, 'PG-13', 2006, 4, '0.99', '24.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Natural Stock'), + ('A Thrilling Yarn of a Feminist And a Madman who must Battle a Hunter in Berlin', '''battl'':14 ''berlin'':18 ''boogi'':2 ''feminist'':8 ''hunter'':16 ''madman'':11 ''must'':13 ''odd'':1 ''thrill'':4 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 48, 'NC-17', 2006, 6, '0.99', '14.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Odds Boogie'), + ('A Insightful Documentary of a Boat And a Composer who must Meet a Forensic Psychologist in An Abandoned Fun House', '''abandon'':20 ''blue'':1 ''boat'':8 ''compos'':11 ''documentari'':5 ''forens'':16 ''fun'':21 ''hous'':22 ''insight'':4 ''instinct'':2 ''meet'':14 ''must'':13 ''psychologist'':17', '1', '2013-05-26T14:50:58.951000', 50, 'G', 2006, 5, '2.99', '18.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Blues Instinct'), + ('A Action-Packed Saga of a Moose And a Lumberjack who must Find a Woman in Berlin', '''action'':5 ''action-pack'':4 ''berlin'':20 ''dark'':2 ''find'':16 ''lumberjack'':13 ''moos'':10 ''must'':15 ''pack'':6 ''saga'':7 ''shane'':1 ''woman'':18', '1', '2013-05-26T14:50:58.951000', 93, 'PG', 2006, 5, '2.99', '22.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Shane Darkness'), + ('A Awe-Inspiring Reflection of a Waitress And a Squirrel who must Kill a Mad Cow in A Jet Boat', '''awe'':5 ''awe-inspir'':4 ''boat'':23 ''cow'':19 ''element'':1 ''freddi'':2 ''inspir'':6 ''jet'':22 ''kill'':16 ''mad'':18 ''must'':15 ''reflect'':7 ''squirrel'':13 ''waitress'':10', '1', '2013-05-26T14:50:58.951000', 115, 'NC-17', 2006, 6, '4.99', '28.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Element Freddy'), + ('A Insightful Epistle of a Pastry Chef And a Womanizer who must Build a Boat in New Orleans', '''boat'':17 ''build'':15 ''chef'':9 ''curtain'':2 ''encount'':1 ''epistl'':5 ''insight'':4 ''must'':14 ''new'':19 ''orlean'':20 ''pastri'':8 ''woman'':12', '1', '2013-05-26T14:50:58.951000', 92, 'NC-17', 2006, 5, '0.99', '20.99', ARRAY['Trailers']::text[], 'Encounters Curtain'), + ('A Fast-Paced Character Study of a Crocodile And a Lumberjack who must Build a Husband in An Abandoned Fun House', '''abandon'':22 ''build'':17 ''charact'':7 ''crocodil'':11 ''fast'':5 ''fast-pac'':4 ''fun'':23 ''hous'':24 ''husband'':19 ''lumberjack'':14 ''must'':16 ''pace'':6 ''shanghai'':1 ''studi'':8 ''tycoon'':2', '1', '2013-05-26T14:50:58.951000', 47, 'PG', 2006, 7, '2.99', '20.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Shanghai Tycoon'), + ('A Amazing Saga of a Man And a Dentist who must Reach a Technical Writer in Ancient India', '''amaz'':4 ''ancient'':19 ''antitrust'':2 ''dentist'':11 ''haunt'':1 ''india'':20 ''man'':8 ''must'':13 ''reach'':14 ''saga'':5 ''technic'':16 ''writer'':17', '1', '2013-05-26T14:50:58.951000', 76, 'NC-17', 2006, 6, '4.99', '13.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Haunted Antitrust'), + ('A Boring Character Study of a Database Administrator And a Lumberjack who must Reach a Madman in The Outback', '''administr'':10 ''bore'':4 ''brooklyn'':2 ''charact'':5 ''databas'':9 ''lumberjack'':13 ''madman'':18 ''must'':15 ''outback'':21 ''polish'':1 ''reach'':16 ''studi'':6', '1', '2013-05-26T14:50:58.951000', 61, 'PG', 2006, 6, '0.99', '12.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Polish Brooklyn'), + ('A Beautiful Character Study of a Woman And a Man who must Pursue a Explorer in A U-Boat', '''beauti'':4 ''boat'':22 ''charact'':5 ''explor'':17 ''ladi'':1 ''man'':12 ''must'':14 ''pursu'':15 ''stage'':2 ''studi'':6 ''u'':21 ''u-boat'':20 ''woman'':9', '1', '2013-05-26T14:50:58.951000', 67, 'PG', 2006, 4, '4.99', '14.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Lady Stage'), + ('A Beautiful Display of a Cat And a Pastry Chef who must Outrace a Mad Cow in A Jet Boat', '''beauti'':4 ''boat'':22 ''cat'':8 ''chef'':12 ''cow'':18 ''display'':5 ''jet'':21 ''mad'':17 ''must'':14 ''outrac'':15 ''pastri'':11 ''state'':1 ''wasteland'':2', '1', '2013-05-26T14:50:58.951000', 113, 'NC-17', 2006, 4, '2.99', '13.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'State Wasteland'), + ('A Awe-Inspiring Reflection of a Monkey And a Student who must Overcome a Dentist in The First Manned Space Station', '''awe'':5 ''awe-inspir'':4 ''dentist'':18 ''first'':21 ''gentlemen'':1 ''inspir'':6 ''man'':22 ''monkey'':10 ''must'':15 ''overcom'':16 ''reflect'':7 ''space'':23 ''stage'':2 ''station'':24 ''student'':13', '1', '2013-05-26T14:50:58.951000', 125, 'NC-17', 2006, 6, '2.99', '22.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Gentlemen Stage'), + ('A Fanciful Panorama of a Boy And a Woman who must Vanquish a Database Administrator in The Outback', '''administr'':17 ''boy'':8 ''crazi'':1 ''databas'':16 ''fanci'':4 ''home'':2 ''must'':13 ''outback'':20 ''panorama'':5 ''vanquish'':14 ''woman'':11', '1', '2013-05-26T14:50:58.951000', 136, 'PG', 2006, 7, '2.99', '24.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Crazy Home'), + ('A Fanciful Documentary of a Teacher And a Dog who must Outgun a Forensic Psychologist in A Baloon Factory', '''baloon'':20 ''crane'':1 ''documentari'':5 ''dog'':11 ''factori'':21 ''fanci'':4 ''forens'':16 ''must'':13 ''outgun'':14 ''psychologist'':17 ''reservoir'':2 ''teacher'':8', '1', '2013-05-26T14:50:58.951000', 57, 'NC-17', 2006, 5, '2.99', '12.99', ARRAY['Commentaries']::text[], 'Cranes Reservoir'), + ('A Astounding Documentary of a Mad Cow And a Pioneer who must Challenge a Butler in The Sahara Desert', '''astound'':4 ''butler'':17 ''challeng'':15 ''coast'':1 ''cow'':9 ''desert'':21 ''documentari'':5 ''mad'':8 ''must'':14 ''pioneer'':12 ''rainbow'':2 ''sahara'':20', '1', '2013-05-26T14:50:58.951000', 55, 'PG', 2006, 4, '0.99', '20.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Coast Rainbow'), + ('A Thrilling Reflection of a Feminist And a Cat who must Find a Frisbee in An Abandoned Fun House', '''abandon'':19 ''cat'':11 ''crystal'':2 ''dracula'':1 ''feminist'':8 ''find'':14 ''frisbe'':16 ''fun'':20 ''hous'':21 ''must'':13 ''reflect'':5 ''thrill'':4', '1', '2013-05-26T14:50:58.951000', 176, 'G', 2006, 7, '0.99', '26.99', ARRAY['Commentaries']::text[], 'Dracula Crystal'), + ('A Action-Packed Saga of a Teacher And a Lumberjack who must Battle a Dentist in A Baloon', '''action'':5 ''action-pack'':4 ''baloon'':21 ''battl'':16 ''dentist'':18 ''lumberjack'':13 ''must'':15 ''pack'':6 ''reef'':1 ''saga'':7 ''salut'':2 ''teacher'':10', '1', '2013-05-26T14:50:58.951000', 123, 'NC-17', 2006, 5, '0.99', '26.99', ARRAY['Behind the Scenes']::text[], 'Reef Salute'), + ('A Astounding Epistle of a Database Administrator And a Mad Scientist who must Pursue a Cat in California', '''administr'':9 ''astound'':4 ''california'':20 ''cat'':18 ''databas'':8 ''epistl'':5 ''mad'':12 ''must'':15 ''necklac'':1 ''outbreak'':2 ''pursu'':16 ''scientist'':13', '1', '2013-05-26T14:50:58.951000', 132, 'PG', 2006, 3, '0.99', '21.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Necklace Outbreak'), + ('A Taut Reflection of a Monkey And a Womanizer who must Chase a Moose in Nigeria', '''caddyshack'':2 ''chase'':14 ''monkey'':8 ''moos'':16 ''must'':13 ''nigeria'':18 ''reflect'':5 ''rider'':1 ''taut'':4 ''woman'':11', '1', '2013-05-26T14:50:58.951000', 177, 'PG', 2006, 5, '2.99', '28.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Rider Caddyshack'), + ('A Beautiful Tale of a Frisbee And a Moose who must Vanquish a Dog in An Abandoned Amusement Park', '''abandon'':19 ''amus'':20 ''beauti'':4 ''dog'':16 ''frisbe'':8 ''moos'':11 ''must'':13 ''park'':2,21 ''tadpol'':1 ''tale'':5 ''vanquish'':14', '1', '2013-05-26T14:50:58.951000', 155, 'PG', 2006, 6, '2.99', '13.99', ARRAY['Trailers', 'Commentaries']::text[], 'Tadpole Park'), + ('A Boring Epistle of a Database Administrator And a Explorer who must Pursue a Madman in Soviet Georgia', '''administr'':9 ''bore'':4 ''databas'':8 ''epistl'':5 ''explor'':12 ''georgia'':20 ''hanki'':1 ''madman'':17 ''must'':14 ''octob'':2 ''pursu'':15 ''soviet'':19', '1', '2013-05-26T14:50:58.951000', 107, 'NC-17', 2006, 5, '2.99', '26.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Hanky October'), + ('A Thoughtful Saga of a Hunter And a Crocodile who must Confront a Dog in The Gulf of Mexico', '''confront'':14 ''crocodil'':11 ''dog'':16 ''gulf'':19 ''head'':1 ''hunter'':8 ''mexico'':21 ''must'':13 ''saga'':5 ''stranger'':2 ''thought'':4', '1', '2013-05-26T14:50:58.951000', 69, 'R', 2006, 4, '4.99', '28.99', ARRAY['Trailers', 'Commentaries']::text[], 'Head Stranger'), + ('A Touching Panorama of a Lumberjack And a Frisbee who must Build a Dog in Australia', '''australia'':18 ''build'':14 ''dog'':16 ''frisbe'':11 ''lumberjack'':8 ''must'':13 ''panorama'':5 ''suit'':1 ''touch'':4 ''wall'':2', '1', '2013-05-26T14:50:58.951000', 111, 'R', 2006, 3, '4.99', '12.99', ARRAY['Commentaries']::text[], 'Suit Walls'), + ('A Astounding Epistle of a Mad Scientist And a Pioneer who must Escape a Database Administrator in A MySQL Convention', '''administr'':18 ''astound'':4 ''convent'':22 ''databas'':17 ''epistl'':5 ''escap'':15 ''luck'':2 ''mad'':8 ''mighti'':1 ''must'':14 ''mysql'':21 ''pioneer'':12 ''scientist'':9', '1', '2013-05-26T14:50:58.951000', 122, 'PG', 2006, 7, '2.99', '13.99', ARRAY['Behind the Scenes']::text[], 'Mighty Luck'), + ('A Thrilling Display of a Husband And a Butler who must Reach a Pastry Chef in California', '''butler'':11 ''california'':19 ''chef'':17 ''display'':5 ''husband'':8 ''must'':13 ''pastri'':16 ''reach'':14 ''thrill'':4 ''valentin'':1 ''vanish'':2', '1', '2013-05-26T14:50:58.951000', 48, 'PG-13', 2006, 7, '0.99', '9.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Valentine Vanishing'), + ('A Thrilling Drama of a Frisbee And a Lumberjack who must Sink a Man in Nigeria', '''calendar'':1 ''drama'':5 ''frisbe'':8 ''gunfight'':2 ''lumberjack'':11 ''man'':16 ''must'':13 ''nigeria'':18 ''sink'':14 ''thrill'':4', '1', '2013-05-26T14:50:58.951000', 120, 'NC-17', 2006, 4, '4.99', '22.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Calendar Gunfight'), + ('A Emotional Drama of a Monkey And a Robot who must Defeat a Monkey in New Orleans', '''defeat'':14 ''drama'':5 ''emot'':4 ''kick'':1 ''monkey'':8,16 ''must'':13 ''new'':18 ''orlean'':19 ''robot'':11 ''savannah'':2', '1', '2013-05-26T14:50:58.951000', 179, 'PG-13', 2006, 3, '0.99', '10.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Kick Savannah'), + ('A Lacklusture Display of a Girl And a Astronaut who must Succumb a Student in Australia', '''arsenic'':2 ''astronaut'':11 ''australia'':18 ''display'':5 ''girl'':8 ''lacklustur'':4 ''must'':13 ''student'':16 ''succumb'':14 ''videotap'':1', '1', '2013-05-26T14:50:58.951000', 145, 'NC-17', 2006, 4, '4.99', '10.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Videotape Arsenic'), + ('A Fanciful Saga of a Student And a Mad Scientist who must Battle a Hunter in An Abandoned Mine Shaft', '''abandon'':20 ''battl'':15 ''command'':1 ''express'':2 ''fanci'':4 ''hunter'':17 ''mad'':11 ''mine'':21 ''must'':14 ''saga'':5 ''scientist'':12 ''shaft'':22 ''student'':8', '1', '2013-05-26T14:50:58.951000', 59, 'R', 2006, 6, '4.99', '13.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Commandments Express'), + ('A Fateful Character Study of a Butler And a Technical Writer who must Sink a Astronaut in Ancient Japan', '''ancient'':20 ''astronaut'':18 ''blanket'':2 ''brotherhood'':1 ''butler'':9 ''charact'':5 ''fate'':4 ''japan'':21 ''must'':15 ''sink'':16 ''studi'':6 ''technic'':12 ''writer'':13', '1', '2013-05-26T14:50:58.951000', 73, 'R', 2006, 3, '0.99', '26.99', ARRAY['Behind the Scenes']::text[], 'Brotherhood Blanket'), + ('A Touching Character Study of a Woman And a Waitress who must Battle a Pastry Chef in A MySQL Convention', '''battl'':15 ''camelot'':1 ''charact'':5 ''chef'':18 ''convent'':22 ''must'':14 ''mysql'':21 ''pastri'':17 ''studi'':6 ''touch'':4 ''vacat'':2 ''waitress'':12 ''woman'':9', '1', '2013-05-26T14:50:58.951000', 61, 'NC-17', 2006, 3, '0.99', '26.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Camelot Vacation'), + ('A Boring Drama of a Teacher And a Sumo Wrestler who must Challenge a Secret Agent in The Canadian Rockies', '''agent'':18 ''bore'':4 ''canadian'':21 ''challeng'':15 ''drama'':5 ''must'':14 ''not'':2 ''rocki'':22 ''secret'':17 ''sumo'':11 ''teacher'':8 ''war'':1 ''wrestler'':12', '1', '2013-05-26T14:50:58.951000', 80, 'G', 2006, 7, '4.99', '26.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'War Notting'), + ('A Unbelieveable Story of a Teacher And a Boat who must Confront a Moose in A Baloon', '''baloon'':19 ''boat'':11 ''confront'':14 ''knock'':1 ''moos'':16 ''must'':13 ''stori'':5 ''teacher'':8 ''unbeliev'':4 ''warlock'':2', '1', '2013-05-26T14:50:58.951000', 71, 'PG-13', 2006, 4, '2.99', '21.99', ARRAY['Trailers']::text[], 'Knock Warlock'), + ('A Fast-Paced Documentary of a Pastry Chef And a Dentist who must Pursue a Forensic Psychologist in The Gulf of Mexico', '''african'':1 ''chef'':11 ''dentist'':14 ''documentari'':7 ''egg'':2 ''fast'':5 ''fast-pac'':4 ''forens'':19 ''gulf'':23 ''mexico'':25 ''must'':16 ''pace'':6 ''pastri'':10 ''psychologist'':20 ''pursu'':17', '1', '2013-05-26T14:50:58.951000', 130, 'G', 2006, 6, '2.99', '22.99', ARRAY['Deleted Scenes']::text[], 'African Egg'), + ('A Action-Packed Reflection of a Composer And a Mad Scientist who must Face a Pioneer in A MySQL Convention', '''action'':5 ''action-pack'':4 ''compos'':10 ''convent'':23 ''face'':17 ''hunter'':2 ''mad'':13 ''must'':16 ''mysql'':22 ''pack'':6 ''pioneer'':19 ''reflect'':7 ''scientist'':14 ''word'':1', '1', '2013-05-26T14:50:58.951000', 116, 'PG', 2006, 3, '2.99', '13.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Words Hunter'), + ('A Emotional Yarn of a Composer And a Man who must Escape a Butler in The Gulf of Mexico', '''butler'':16 ''compos'':8 ''emot'':4 ''escap'':14 ''gentlemen'':2 ''gulf'':19 ''man'':11 ''mexico'':21 ''must'':13 ''reign'':1 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 82, 'PG-13', 2006, 3, '2.99', '29.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Reign Gentlemen'), + ('A Taut Story of a Waitress And a Crocodile who must Outrace a Lumberjack in A Shark Tank', '''crocodil'':11 ''honey'':1 ''lumberjack'':16 ''must'':13 ''outrac'':14 ''shark'':19 ''stori'':5 ''tank'':20 ''taut'':4 ''tie'':2 ''waitress'':8', '1', '2013-05-26T14:50:58.951000', 84, 'R', 2006, 3, '0.99', '29.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Honey Ties'), + ('A Unbelieveable Saga of a Forensic Psychologist And a Student who must Face a Squirrel in The First Manned Space Station', '''face'':15 ''first'':20 ''forens'':8 ''man'':21 ''must'':14 ''psychologist'':9 ''saga'':5 ''space'':22 ''squirrel'':17 ''station'':23 ''student'':12 ''unbeliev'':4 ''wisdom'':1 ''worker'':2', '1', '2013-05-26T14:50:58.951000', 98, 'R', 2006, 3, '0.99', '12.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Wisdom Worker'), + ('A Fateful Documentary of a Crocodile And a Husband who must Face a Husband in The First Manned Space Station', '''connect'':1 ''crocodil'':8 ''documentari'':5 ''face'':14 ''fate'':4 ''first'':19 ''husband'':11,16 ''man'':20 ''microcosmo'':2 ''must'':13 ''space'':21 ''station'':22', '1', '2013-05-26T14:50:58.951000', 115, 'G', 2006, 6, '0.99', '25.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Connection Microcosmos'), + ('A Touching Reflection of a Man And a Monkey who must Pursue a Womanizer in A MySQL Convention', '''convent'':20 ''man'':8 ''monkey'':11 ''must'':13 ''mysql'':19 ''pursu'':14 ''reflect'':5 ''summer'':2 ''touch'':4 ''translat'':1 ''woman'':16', '1', '2013-05-26T14:50:58.951000', 168, 'PG-13', 2006, 4, '0.99', '10.99', ARRAY['Trailers']::text[], 'Translation Summer'), + ('A Emotional Yarn of a Boat And a Crocodile who must Meet a Moose in Soviet Georgia', '''boat'':8 ''crocodil'':11 ''emot'':4 ''frontier'':2 ''georgia'':19 ''meet'':14 ''moos'':16 ''must'':13 ''soviet'':18 ''watership'':1 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 112, 'G', 2006, 6, '0.99', '28.99', ARRAY['Commentaries']::text[], 'Watership Frontier'), + ('A Fast-Paced Documentary of a Crocodile And a Sumo Wrestler who must Conquer a Explorer in California', '''california'':21 ''conquer'':17 ''crocodil'':10 ''documentari'':7 ''explor'':19 ''fast'':5 ''fast-pac'':4 ''hope'':2 ''maltes'':1 ''must'':16 ''pace'':6 ''sumo'':13 ''wrestler'':14', '1', '2013-05-26T14:50:58.951000', 127, 'PG-13', 2006, 6, '4.99', '26.99', ARRAY['Behind the Scenes']::text[], 'Maltese Hope'), + ('A Awe-Inspiring Panorama of a Lumberjack And a Waitress who must Defeat a Crocodile in An Abandoned Amusement Park', '''abandon'':21 ''amus'':22 ''awe'':5 ''awe-inspir'':4 ''crocodil'':18 ''defeat'':16 ''desir'':2 ''inspir'':6 ''lumberjack'':10 ''must'':15 ''panorama'':7 ''park'':23 ''strangelov'':1 ''waitress'':13', '1', '2013-05-26T14:50:58.951000', 103, 'NC-17', 2006, 4, '0.99', '27.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Strangelove Desire'), + ('A Awe-Inspiring Reflection of a Dog And a Student who must Kill a Car in An Abandoned Fun House', '''abandon'':21 ''awe'':5 ''awe-inspir'':4 ''car'':18 ''detail'':2 ''dog'':10 ''fun'':22 ''hous'':23 ''inspir'':6 ''kill'':16 ''motion'':1 ''must'':15 ''reflect'':7 ''student'':13', '1', '2013-05-26T14:50:58.951000', 166, 'PG', 2006, 5, '0.99', '16.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Motions Details'), + ('A Fateful Yarn of a Composer And a Man who must Face a Boy in The Canadian Rockies', '''boy'':16 ''canadian'':19 ''compos'':8 ''core'':2 ''face'':14 ''fate'':4 ''man'':11 ''must'':13 ''rocki'':20 ''yarn'':5 ''zhivago'':1', '1', '2013-05-26T14:50:58.951000', 105, 'NC-17', 2006, 6, '0.99', '10.99', ARRAY['Deleted Scenes']::text[], 'Zhivago Core'), + ('A Amazing Panorama of a Crocodile And a Forensic Psychologist who must Pursue a Secret Agent in The First Manned Space Station', '''agent'':18 ''amaz'':4 ''casablanca'':1 ''crocodil'':8 ''first'':21 ''forens'':11 ''man'':22 ''must'':14 ''panorama'':5 ''psychologist'':12 ''pursu'':15 ''secret'':17 ''space'':23 ''station'':24 ''super'':2', '1', '2013-05-26T14:50:58.951000', 85, 'G', 2006, 6, '4.99', '22.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Casablanca Super'), + ('A Lacklusture Panorama of a Forensic Psychologist And a Woman who must Kill a Explorer in Ancient Japan', '''ancient'':19 ''date'':2 ''explor'':17 ''forens'':8 ''japan'':20 ''kill'':15 ''lacklustur'':4 ''must'':14 ''panorama'':5 ''psychologist'':9 ''troubl'':1 ''woman'':12', '1', '2013-05-26T14:50:58.951000', 61, 'PG', 2006, 6, '2.99', '13.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Trouble Date'), + ('A Astounding Panorama of a Composer And a Frisbee who must Reach a Husband in Ancient Japan', '''ancient'':18 ''astound'':4 ''attract'':1 ''compos'':8 ''frisbe'':11 ''husband'':16 ''japan'':19 ''must'':13 ''newton'':2 ''panorama'':5 ''reach'':14', '1', '2013-05-26T14:50:58.951000', 83, 'PG-13', 2006, 5, '4.99', '14.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Attraction Newton'), + ('A Taut Epistle of a Mad Scientist And a Girl who must Escape a Monkey in California', '''california'':19 ''epistl'':5 ''escap'':15 ''girl'':12 ''mad'':8 ''monkey'':17 ''must'':14 ''nation'':1 ''scientist'':9 ''stori'':2 ''taut'':4', '1', '2013-05-26T14:50:58.951000', 92, 'NC-17', 2006, 4, '2.99', '19.99', ARRAY['Trailers']::text[], 'National Story'), + ('A Beautiful Documentary of a Astronaut And a Crocodile who must Discover a Madman in A Monastery', '''astronaut'':8 ''beauti'':4 ''crocodil'':11 ''discov'':14 ''documentari'':5 ''glori'':2 ''madman'':16 ''monasteri'':19 ''must'':13 ''phantom'':1', '1', '2013-05-26T14:50:58.951000', 60, 'NC-17', 2006, 6, '2.99', '17.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Phantom Glory'), + ('A Beautiful Epistle of a Astronaut And a Student who must Confront a Monkey in An Abandoned Fun House', '''abandon'':19 ''astronaut'':8 ''beauti'':4 ''confront'':14 ''epistl'':5 ''fun'':20 ''hous'':21 ''human'':2 ''monkey'':16 ''must'':13 ''rule'':1 ''student'':11', '1', '2013-05-26T14:50:58.951000', 153, 'R', 2006, 6, '4.99', '19.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Rules Human'), + ('A Fast-Paced Character Study of a Dentist And a Moose who must Defeat a Composer in The First Manned Space Station', '''charact'':7 ''compos'':19 ''defeat'':17 ''dentist'':11 ''fast'':5 ''fast-pac'':4 ''first'':22 ''lie'':1 ''man'':23 ''moos'':14 ''must'':16 ''pace'':6 ''space'':24 ''station'':25 ''studi'':8 ''treatment'':2', '1', '2013-05-26T14:50:58.951000', 147, 'NC-17', 2006, 7, '4.99', '28.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Lies Treatment'), + ('A Awe-Inspiring Yarn of a Composer And a Man who must Find a Robot in Soviet Georgia', '''awe'':5 ''awe-inspir'':4 ''compos'':10 ''find'':16 ''georgia'':21 ''highbal'':2 ''holocaust'':1 ''inspir'':6 ''man'':13 ''must'':15 ''robot'':18 ''soviet'':20 ''yarn'':7', '1', '2013-05-26T14:50:58.951000', 149, 'R', 2006, 6, '0.99', '12.99', ARRAY['Deleted Scenes']::text[], 'Holocaust Highball'), + ('A Boring Story of a Teacher And a Monkey who must Succumb a Forensic Psychologist in A Jet Boat', '''boat'':21 ''bore'':4 ''clue'':2 ''forens'':16 ''jet'':20 ''monkey'':11 ''must'':13 ''oleand'':1 ''psychologist'':17 ''stori'':5 ''succumb'':14 ''teacher'':8', '1', '2013-05-26T14:50:58.951000', 161, 'PG', 2006, 5, '0.99', '12.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Oleander Clue'), + ('A Fast-Paced Saga of a Frisbee And a Astronaut who must Overcome a Feminist in Ancient India', '''ancient'':20 ''astronaut'':13 ''birdcag'':1 ''casper'':2 ''fast'':5 ''fast-pac'':4 ''feminist'':18 ''frisbe'':10 ''india'':21 ''must'':15 ''overcom'':16 ''pace'':6 ''saga'':7', '1', '2013-05-26T14:50:58.951000', 103, 'NC-17', 2006, 4, '0.99', '23.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Birdcage Casper'), + ('A Fast-Paced Story of a Database Administrator And a Composer who must Defeat a Squirrel in An Abandoned Amusement Park', '''abandon'':22 ''administr'':11 ''amus'':23 ''compos'':14 ''databas'':10 ''defeat'':17 ''fast'':5 ''fast-pac'':4 ''haunt'':1 ''must'':16 ''pace'':6 ''park'':24 ''pianist'':2 ''squirrel'':19 ''stori'':7', '1', '2013-05-26T14:50:58.951000', 181, 'R', 2006, 5, '0.99', '22.99', ARRAY['Behind the Scenes']::text[], 'Haunting Pianist'), + ('A Awe-Inspiring Display of a Husband And a Squirrel who must Battle a Sumo Wrestler in A Jet Boat', '''awe'':5 ''awe-inspir'':4 ''battl'':16 ''beast'':2 ''boat'':23 ''display'':7 ''husband'':10 ''inspir'':6 ''jet'':22 ''mulholland'':1 ''must'':15 ''squirrel'':13 ''sumo'':18 ''wrestler'':19', '1', '2013-05-26T14:50:58.951000', 157, 'PG', 2006, 7, '2.99', '13.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Mulholland Beast'), + ('A Fateful Epistle of a Crocodile And a Moose who must Kill a Explorer in Nigeria', '''crocodil'':8 ''epistl'':5 ''explor'':16 ''fate'':4 ''kill'':14 ''moos'':11 ''must'':13 ''necklac'':2 ''nigeria'':18 ''opposit'':1', '1', '2013-05-26T14:50:58.951000', 92, 'PG', 2006, 7, '4.99', '9.99', ARRAY['Deleted Scenes']::text[], 'Opposite Necklace'), + ('A Emotional Yarn of a A Shark And a Student who must Battle a Robot in An Abandoned Mine Shaft', '''abandon'':20 ''battl'':15 ''christma'':2 ''emot'':4 ''fiction'':1 ''mine'':21 ''must'':14 ''robot'':17 ''shaft'':22 ''shark'':9 ''student'':12 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 72, 'PG', 2006, 4, '0.99', '14.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Fiction Christmas'), + ('A Stunning Yarn of a Woman And a Frisbee who must Escape a Waitress in A U-Boat', '''boat'':21 ''escap'':14 ''frisbe'':11 ''giant'':2 ''kentuckian'':1 ''must'':13 ''stun'':4 ''u'':20 ''u-boat'':19 ''waitress'':16 ''woman'':8 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 169, 'PG', 2006, 5, '2.99', '10.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Kentuckian Giant'), + ('A Epic Documentary of a Teacher And a Boy who must Escape a Woman in Berlin', '''berlin'':18 ''boy'':11 ''documentari'':5 ''epic'':4 ''escap'':14 ''famili'':1 ''must'':13 ''sweet'':2 ''teacher'':8 ''woman'':16', '1', '2013-05-26T14:50:58.951000', 155, 'R', 2006, 4, '0.99', '24.99', ARRAY['Trailers']::text[], 'Family Sweet'), + ('A Emotional Saga of a Database Administrator And a Pastry Chef who must Confront a Teacher in A Baloon Factory', '''administr'':9 ''baloon'':21 ''chef'':13 ''coma'':2 ''confront'':16 ''databas'':8 ''emot'':4 ''factori'':22 ''metropoli'':1 ''must'':15 ''pastri'':12 ''saga'':5 ''teacher'':18', '1', '2013-05-26T14:50:58.951000', 64, 'PG-13', 2006, 4, '2.99', '9.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Metropolis Coma'), + ('A Stunning Character Study of a Composer And a Mad Cow who must Succumb a Cat in Soviet Georgia', '''cat'':18 ''charact'':5 ''cider'':1 ''compos'':9 ''cow'':13 ''desir'':2 ''georgia'':21 ''mad'':12 ''must'':15 ''soviet'':20 ''studi'':6 ''stun'':4 ''succumb'':16', '1', '2013-05-26T14:50:58.951000', 101, 'PG', 2006, 7, '2.99', '9.99', ARRAY['Behind the Scenes']::text[], 'Cider Desire'), + ('A Emotional Epistle of a Forensic Psychologist And a Butler who must Challenge a Waitress in An Abandoned Mine Shaft', '''abandon'':20 ''argonaut'':1 ''butler'':12 ''challeng'':15 ''emot'':4 ''epistl'':5 ''forens'':8 ''mine'':21 ''must'':14 ''psychologist'':9 ''shaft'':22 ''town'':2 ''waitress'':17', '1', '2013-05-26T14:50:58.951000', 127, 'PG-13', 2006, 7, '0.99', '12.99', ARRAY['Trailers', 'Commentaries']::text[], 'Argonauts Town'), + ('A Fanciful Display of a Car And a Monkey who must Escape a Squirrel in Ancient Japan', '''ancient'':18 ''car'':8 ''display'':5 ''escap'':14 ''fanci'':4 ''japan'':19 ''monkey'':11 ''must'':13 ''necklac'':2 ''papi'':1 ''squirrel'':16', '1', '2013-05-26T14:50:58.951000', 128, 'PG', 2006, 3, '0.99', '9.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Papi Necklace'), + ('A Amazing Epistle of a Woman And a Squirrel who must Fight a Hunter in A Baloon', '''amaz'':4 ''baloon'':19 ''epistl'':5 ''fight'':14 ''hunter'':16 ''must'':13 ''notori'':1 ''reunion'':2 ''squirrel'':11 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 128, 'NC-17', 2006, 7, '0.99', '9.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Notorious Reunion'), + ('A Touching Drama of a Crocodile And a Crocodile who must Conquer a Explorer in Soviet Georgia', '''conquer'':14 ''crocodil'':8,11 ''destini'':1 ''drama'':5 ''explor'':16 ''georgia'':19 ''must'':13 ''saturday'':2 ''soviet'':18 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 56, 'G', 2006, 4, '4.99', '20.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Destiny Saturday'), + ('A Touching Saga of a Robot And a Boy who must Kill a Man in Ancient Japan', '''ancient'':18 ''boy'':11 ''gunfight'':1 ''japan'':19 ''kill'':14 ''man'':16 ''mussolini'':2 ''must'':13 ''robot'':8 ''saga'':5 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 127, 'PG-13', 2006, 3, '2.99', '9.99', ARRAY['Trailers', 'Commentaries']::text[], 'Gunfighter Mussolini'), + ('A Fast-Paced Reflection of a Cat And a Mad Cow who must Fight a Car in The Sahara Desert', '''car'':19 ''cat'':10 ''cow'':14 ''desert'':23 ''fast'':5 ''fast-pac'':4 ''fight'':17 ''mad'':13 ''must'':16 ''pace'':6 ''pilot'':2 ''reflect'':7 ''sahara'':22 ''unit'':1', '1', '2013-05-26T14:50:58.951000', 164, 'R', 2006, 3, '0.99', '27.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'United Pilot'), + ('A Astounding Story of a Pastry Chef And a Database Administrator who must Fight a Man in The Outback', '''administr'':13 ''astound'':4 ''chef'':9 ''databas'':12 ''fight'':16 ''man'':18 ''must'':15 ''outback'':21 ''pastri'':8 ''rebel'':2 ''roxann'':1 ''stori'':5', '1', '2013-05-26T14:50:58.951000', 171, 'R', 2006, 5, '0.99', '9.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Roxanne Rebel'), + ('A Boring Story of a Womanizer And a Pioneer who must Face a Dog in California', '''bird'':1 ''bore'':4 ''california'':18 ''dog'':16 ''face'':14 ''must'':13 ''perdit'':2 ''pioneer'':11 ''stori'':5 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 61, 'G', 2006, 5, '4.99', '15.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Birds Perdition'), + ('A Astounding Documentary of a Butler And a Cat who must Find a Frisbee in Ancient China', '''ancient'':18 ''astound'':4 ''butler'':8 ''cat'':11 ''china'':19 ''control'':2 ''documentari'':5 ''find'':14 ''frisbe'':16 ''must'':13 ''path'':1', '1', '2013-05-26T14:50:58.951000', 118, 'PG', 2006, 3, '4.99', '9.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Paths Control'), + ('A Unbelieveable Panorama of a Technical Writer And a Man who must Pursue a Frisbee in A U-Boat', '''boat'':22 ''candid'':2 ''forev'':1 ''frisbe'':17 ''man'':12 ''must'':14 ''panorama'':5 ''pursu'':15 ''technic'':8 ''u'':21 ''u-boat'':20 ''unbeliev'':4 ''writer'':9', '1', '2013-05-26T14:50:58.951000', 131, 'NC-17', 2006, 7, '2.99', '28.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Forever Candidate'), + ('A Taut Character Study of a Husband And a Waitress who must Sink a Squirrel in A MySQL Convention', '''charact'':5 ''convent'':21 ''convers'':1 ''downhil'':2 ''husband'':9 ''must'':14 ''mysql'':20 ''sink'':15 ''squirrel'':17 ''studi'':6 ''taut'':4 ''waitress'':12', '1', '2013-05-26T14:50:58.951000', 112, 'R', 2006, 4, '4.99', '14.99', ARRAY['Commentaries']::text[], 'Conversation Downhill'), + ('A Action-Packed Display of a Woman And a Dentist who must Redeem a Forensic Psychologist in The Canadian Rockies', '''action'':5 ''action-pack'':4 ''canadian'':22 ''dentist'':13 ''display'':7 ''doubl'':2 ''forens'':18 ''inform'':1 ''must'':15 ''pack'':6 ''psychologist'':19 ''redeem'':16 ''rocki'':23 ''woman'':10', '1', '2013-05-26T14:50:58.951000', 74, 'NC-17', 2006, 4, '4.99', '23.99', ARRAY['Trailers', 'Commentaries']::text[], 'Informer Double'), + ('A Boring Epistle of a Butler And a Cat who must Fight a Pastry Chef in A MySQL Convention', '''alamo'':1 ''bore'':4 ''butler'':8 ''cat'':11 ''chef'':17 ''convent'':21 ''epistl'':5 ''fight'':14 ''must'':13 ''mysql'':20 ''pastri'':16 ''videotap'':2', '1', '2013-05-26T14:50:58.951000', 126, 'G', 2006, 6, '0.99', '16.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Alamo Videotape'), + ('A Stunning Saga of a Butler And a Woman who must Pursue a Explorer in Australia', '''australia'':18 ''butler'':8 ''explor'':16 ''freddi'':2 ''must'':13 ''pursu'':14 ''saga'':5 ''sister'':1 ''stun'':4 ''woman'':11', '1', '2013-05-26T14:50:58.951000', 152, 'PG-13', 2006, 5, '4.99', '19.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Sister Freddy'), + ('A Lacklusture Epistle of a Boat And a Technical Writer who must Fight a A Shark in The Canadian Rockies', '''boat'':8 ''canadian'':21 ''chill'':1 ''epistl'':5 ''fight'':15 ''lacklustur'':4 ''luck'':2 ''must'':14 ''rocki'':22 ''shark'':18 ''technic'':11 ''writer'':12', '1', '2013-05-26T14:50:58.951000', 142, 'PG', 2006, 6, '0.99', '17.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Chill Luck'), + ('A Action-Packed Tale of a Sumo Wrestler And a A Shark who must Meet a Frisbee in California', '''action'':5 ''action-pack'':4 ''california'':22 ''dorado'':1 ''frisbe'':20 ''meet'':18 ''must'':17 ''not'':2 ''pack'':6 ''shark'':15 ''sumo'':10 ''tale'':7 ''wrestler'':11', '1', '2013-05-26T14:50:58.951000', 139, 'NC-17', 2006, 5, '4.99', '26.99', ARRAY['Commentaries']::text[], 'Dorado Notting'), + ('A Action-Packed Display of a Mad Cow And a Astronaut who must Kill a Car in Ancient India', '''action'':5 ''action-pack'':4 ''ancient'':21 ''astronaut'':14 ''car'':19 ''cow'':11 ''display'':7 ''india'':22 ''kill'':17 ''mad'':10 ''must'':16 ''pack'':6 ''phantom'':2 ''wardrob'':1', '1', '2013-05-26T14:50:58.951000', 178, 'G', 2006, 6, '2.99', '19.99', ARRAY['Trailers', 'Commentaries']::text[], 'Wardrobe Phantom'), + ('A Insightful Panorama of a Teacher And a Teacher who must Overcome a Mad Cow in An Abandoned Fun House', '''abandon'':20 ''artist'':2 ''cow'':17 ''fun'':21 ''hous'':22 ''insight'':4 ''mad'':16 ''must'':13 ''overcom'':14 ''panorama'':5 ''teacher'':8,11 ''wall'':1', '1', '2013-05-26T14:50:58.951000', 135, 'PG', 2006, 7, '4.99', '19.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Walls Artist'), + ('A Brilliant Epistle of a Composer And a Frisbee who must Conquer a Husband in The Outback', '''brilliant'':4 ''compos'':8 ''conquer'':14 ''epistl'':5 ''frisbe'':11 ''goldmin'':1 ''husband'':16 ''must'':13 ''outback'':19 ''tycoon'':2', '1', '2013-05-26T14:50:58.951000', 153, 'R', 2006, 6, '0.99', '20.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Goldmine Tycoon'), + ('A Epic Reflection of a Womanizer And a Squirrel who must Discover a Husband in A Jet Boat', '''boat'':20 ''command'':2 ''discov'':14 ''drifter'':1 ''epic'':4 ''husband'':16 ''jet'':19 ''must'':13 ''reflect'':5 ''squirrel'':11 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 61, 'PG-13', 2006, 5, '4.99', '18.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Drifter Commandments'), + ('A Fanciful Documentary of a Boy And a Woman who must Redeem a Womanizer in A Jet Boat', '''boat'':20 ''boy'':8 ''doctor'':2 ''documentari'':5 ''fanci'':4 ''hyde'':1 ''jet'':19 ''must'':13 ''redeem'':14 ''woman'':11,16', '1', '2013-05-26T14:50:58.951000', 100, 'G', 2006, 5, '2.99', '11.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Hyde Doctor'), + ('A Stunning Epistle of a Boat And a Man who must Challenge a A Shark in A Baloon Factory', '''baloon'':20 ''boat'':8 ''cabin'':1 ''challeng'':14 ''epistl'':5 ''factori'':21 ''flash'':2 ''man'':11 ''must'':13 ''shark'':17 ''stun'':4', '1', '2013-05-26T14:50:58.951000', 53, 'NC-17', 2006, 4, '0.99', '25.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Cabin Flash'), + ('A Thoughtful Panorama of a Car And a Crocodile who must Sink a Monkey in The Sahara Desert', '''car'':8 ''color'':1 ''crocodil'':11 ''desert'':20 ''monkey'':16 ''must'':13 ''panorama'':5 ''philadelphia'':2 ''sahara'':19 ''sink'':14 ''thought'':4', '1', '2013-05-26T14:50:58.951000', 149, 'G', 2006, 6, '2.99', '19.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Color Philadelphia'), + ('A Awe-Inspiring Documentary of a Woman And a Husband who must Sink a Database Administrator in The First Manned Space Station', '''administr'':19 ''awe'':5 ''awe-inspir'':4 ''crow'':1 ''databas'':18 ''documentari'':7 ''first'':22 ''greas'':2 ''husband'':13 ''inspir'':6 ''man'':23 ''must'':15 ''sink'':16 ''space'':24 ''station'':25 ''woman'':10', '1', '2013-05-26T14:50:58.951000', 104, 'PG', 2006, 6, '0.99', '22.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Crow Grease'), + ('A Emotional Panorama of a Secret Agent And a Waitress who must Escape a Composer in Soviet Georgia', '''agent'':9 ''compos'':17 ''emot'':4 ''escap'':15 ''georgia'':20 ''greas'':1 ''must'':14 ''panorama'':5 ''secret'':8 ''soviet'':19 ''waitress'':12 ''youth'':2', '1', '2013-05-26T14:50:58.951000', 135, 'G', 2006, 7, '0.99', '20.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Grease Youth'), + ('A Fateful Character Study of a Husband And a Dog who must Find a Feminist in Ancient India', '''ancient'':19 ''charact'':5 ''dog'':12 ''fate'':4 ''feminist'':17 ''find'':15 ''husband'':9 ''india'':20 ''must'':14 ''orient'':2 ''sleuth'':1 ''studi'':6', '1', '2013-05-26T14:50:58.951000', 87, 'NC-17', 2006, 4, '0.99', '25.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Sleuth Orient'), + ('A Fanciful Panorama of a Husband And a Pioneer who must Outgun a Dog in A Baloon', '''antitrust'':2 ''baloon'':19 ''birch'':1 ''dog'':16 ''fanci'':4 ''husband'':8 ''must'':13 ''outgun'':14 ''panorama'':5 ''pioneer'':11', '1', '2013-05-26T14:50:58.951000', 162, 'PG', 2006, 4, '4.99', '18.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Birch Antitrust'), + ('A Unbelieveable Story of a Composer And a Dog who must Overcome a Womanizer in An Abandoned Amusement Park', '''abandon'':19 ''amus'':20 ''beast'':2 ''compos'':8 ''dog'':11 ''heavyweight'':1 ''must'':13 ''overcom'':14 ''park'':21 ''stori'':5 ''unbeliev'':4 ''woman'':16', '1', '2013-05-26T14:50:58.951000', 102, 'G', 2006, 6, '4.99', '25.99', ARRAY['Deleted Scenes']::text[], 'Heavyweights Beast'), + ('A Fast-Paced Epistle of a Boy And a Explorer who must Escape a Dog in A U-Boat', '''anonym'':2 ''boat'':23 ''boy'':10 ''dog'':18 ''epistl'':7 ''escap'':16 ''explor'':13 ''fast'':5 ''fast-pac'':4 ''hollywood'':1 ''must'':15 ''pace'':6 ''u'':22 ''u-boat'':21', '1', '2013-05-26T14:50:58.951000', 69, 'PG', 2006, 7, '0.99', '29.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Hollywood Anonymous'), + ('A Awe-Inspiring Reflection of a Boy And a Man who must Discover a Moose in The Sahara Desert', '''awe'':5 ''awe-inspir'':4 ''boy'':10 ''desert'':22 ''discov'':16 ''inspir'':6 ''man'':13 ''moos'':18 ''must'':15 ''paycheck'':1 ''reflect'':7 ''sahara'':21 ''wait'':2', '1', '2013-05-26T14:50:58.951000', 145, 'PG-13', 2006, 4, '4.99', '27.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Paycheck Wait'), + ('A Thoughtful Character Study of a Frisbee And a Pastry Chef who must Fight a Dentist in The First Manned Space Station', '''blade'':1 ''charact'':5 ''chef'':13 ''dentist'':18 ''fight'':16 ''first'':21 ''frisbe'':9 ''man'':22 ''must'':15 ''pastri'':12 ''polish'':2 ''space'':23 ''station'':24 ''studi'':6 ''thought'':4', '1', '2013-05-26T14:50:58.951000', 114, 'PG-13', 2006, 5, '0.99', '10.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Blade Polish'), + ('A Amazing Yarn of a Composer And a Squirrel who must Escape a Astronaut in Australia', '''amaz'':4 ''astronaut'':16 ''australia'':18 ''clash'':1 ''compos'':8 ''escap'':14 ''freddi'':2 ''must'':13 ''squirrel'':11 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 81, 'G', 2006, 6, '2.99', '12.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Clash Freddy'), + ('A Thrilling Character Study of a Robot And a Squirrel who must Face a Dog in Ancient India', '''ancient'':19 ''bunch'':2 ''charact'':5 ''dog'':17 ''face'':15 ''india'':20 ''must'':14 ''robot'':9 ''squirrel'':12 ''studi'':6 ''thrill'':4 ''train'':1', '1', '2013-05-26T14:50:58.951000', 71, 'R', 2006, 3, '4.99', '26.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Train Bunch'), + ('A Beautiful Display of a Pioneer And a Squirrel who must Vanquish a Sumo Wrestler in Soviet Georgia', '''beauti'':4 ''boondock'':2 ''display'':5 ''georgia'':20 ''handicap'':1 ''must'':13 ''pioneer'':8 ''soviet'':19 ''squirrel'':11 ''sumo'':16 ''vanquish'':14 ''wrestler'':17', '1', '2013-05-26T14:50:58.951000', 108, 'R', 2006, 4, '0.99', '28.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Handicap Boondock') + ) AS data(description, fulltext, old_language_id, last_update, length, rating, release_year, rental_duration, rental_rate, replacement_cost, special_features, title) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."language"' + AND map0.old_id = data.old_language_id + RETURNING film_id + ) + SELECT array_agg(film_id) INTO v_new_ids_film FROM inserted; + + FOR i IN 1..array_length(v_new_ids_film, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."film"', v_old_ids_film[i], v_new_ids_film[i]::TEXT); + END LOOP; + + v_old_ids_film := ARRAY['530', '59', '691', '317', '596', '348', '60', '479', '908', '335', '774', '838', '294', '788', '880', '903', '700', '719', '153', '44', '922', '38', '746', '716', '714', '713', '349', '53', '640', '40', '245', '302', '104', '493', '203', '673', '837', '790', '268', '151', '927', '966', '652', '140', '764', '227', '1', '202', '577', '983', '437', '66', '469', '851', '465', '295', '489', '259', '41', '149', '515', '401', '518', '561', '386', '602', '285', '28', '811', '702', '759', '694', '344', '266', '490', '440', '883', '287', '953', '383', '717', '327', '359', '237', '325', '971', '391', '263', '57', '785', '130', '750', '46', '375', '548', '911', '567', '627', '482', '476']; + WITH inserted AS ( + INSERT INTO "public"."film" ("description", "fulltext", "language_id", "last_update", "length", "rating", "release_year", "rental_duration", "rental_rate", "replacement_cost", "special_features", "title") + SELECT + data.description::text, + data.fulltext::tsvector, + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.length::smallint, + data.rating::mpaa_rating, + data.release_year::integer, + data.rental_duration::smallint, + data.rental_rate::numeric, + data.replacement_cost::numeric, + data.special_features::text[], + data.title::character varying + FROM (VALUES + ('A Action-Packed Display of a Frisbee And a Pastry Chef who must Pursue a Crocodile in A Jet Boat', '''action'':5 ''action-pack'':4 ''arizona'':2 ''boat'':23 ''chef'':14 ''crocodil'':19 ''display'':7 ''frisbe'':10 ''jet'':22 ''lord'':1 ''must'':16 ''pack'':6 ''pastri'':13 ''pursu'':17', '1', '2013-05-26T14:50:58.951000', 108, 'PG-13', 2006, 5, '2.99', '27.99', ARRAY['Trailers']::text[], 'Lord Arizona'), + ('A Astounding Saga of a Dog And a Boy who must Kill a Teacher in The First Manned Space Station', '''astound'':4 ''bear'':1 ''boy'':11 ''dog'':8 ''first'':19 ''graceland'':2 ''kill'':14 ''man'':20 ''must'':13 ''saga'':5 ''space'':21 ''station'':22 ''teacher'':16', '1', '2013-05-26T14:50:58.951000', 160, 'R', 2006, 4, '2.99', '20.99', ARRAY['Deleted Scenes']::text[], 'Bear Graceland'), + ('A Thoughtful Epistle of a Womanizer And a Monkey who must Vanquish a Dentist in A Monastery', '''dentist'':16 ''epistl'':5 ''forev'':2 ''monasteri'':19 ''monkey'':11 ''must'':13 ''poseidon'':1 ''thought'':4 ''vanquish'':14 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 159, 'PG-13', 2006, 6, '4.99', '29.99', ARRAY['Commentaries']::text[], 'Poseidon Forever'), + ('A Amazing Yarn of a Dentist And a A Shark who must Vanquish a Madman in An Abandoned Mine Shaft', '''abandon'':20 ''amaz'':4 ''dentist'':8 ''firebal'':1 ''madman'':17 ''mine'':21 ''must'':14 ''philadelphia'':2 ''shaft'':22 ''shark'':12 ''vanquish'':15 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 148, 'PG', 2006, 4, '0.99', '25.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Fireball Philadelphia'), + ('A Thoughtful Display of a Astronaut And a Feminist who must Chase a Frisbee in A Jet Boat', '''astronaut'':8 ''boat'':20 ''cabin'':2 ''chase'':14 ''display'':5 ''feminist'':11 ''frisbe'':16 ''jet'':19 ''moonshin'':1 ''must'':13 ''thought'':4', '1', '2013-05-26T14:50:58.951000', 171, 'PG-13', 2006, 4, '4.99', '25.99', ARRAY['Behind the Scenes']::text[], 'Moonshine Cabin'), + ('A Thoughtful Display of a Mad Scientist And a Secret Agent who must Chase a Boat in Berlin', '''agent'':13 ''berlin'':20 ''boat'':18 ''chase'':16 ''display'':5 ''gandhi'':1 ''kwai'':2 ''mad'':8 ''must'':15 ''scientist'':9 ''secret'':12 ''thought'':4', '1', '2013-05-26T14:50:58.951000', 86, 'PG-13', 2006, 7, '0.99', '9.99', ARRAY['Trailers']::text[], 'Gandhi Kwai'), + ('A Awe-Inspiring Epistle of a Student And a Squirrel who must Defeat a Boy in Ancient China', '''ancient'':20 ''awe'':5 ''awe-inspir'':4 ''beast'':1 ''boy'':18 ''china'':21 ''defeat'':16 ''epistl'':7 ''hunchback'':2 ''inspir'':6 ''must'':15 ''squirrel'':13 ''student'':10', '1', '2013-05-26T14:50:58.951000', 89, 'R', 2006, 3, '4.99', '22.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Beast Hunchback'), + ('A Astounding Reflection of a Explorer And a Dentist who must Pursue a Student in Nigeria', '''astound'':4 ''beneath'':2 ''dentist'':11 ''explor'':8 ''jedi'':1 ''must'':13 ''nigeria'':18 ''pursu'':14 ''reflect'':5 ''student'':16', '1', '2013-05-26T14:50:58.951000', 128, 'PG', 2006, 7, '0.99', '12.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Jedi Beneath'), + ('A Unbelieveable Story of a Boy And a Mad Cow who must Challenge a Database Administrator in The Sahara Desert', '''administr'':18 ''boy'':8 ''challeng'':15 ''cow'':12 ''databas'':17 ''desert'':22 ''guy'':2 ''mad'':11 ''must'':14 ''sahara'':21 ''stori'':5 ''trap'':1 ''unbeliev'':4', '1', '2013-05-26T14:50:58.951000', 110, 'G', 2006, 3, '4.99', '11.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Trap Guys'), + ('A Emotional Reflection of a Dentist And a Mad Cow who must Face a Squirrel in A Baloon', '''baloon'':20 ''cleopatra'':2 ''cow'':12 ''dentist'':8 ''emot'':4 ''face'':15 ''freedom'':1 ''mad'':11 ''must'':14 ''reflect'':5 ''squirrel'':17', '1', '2013-05-26T14:50:58.951000', 133, 'PG-13', 2006, 5, '0.99', '23.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Freedom Cleopatra'), + ('A Fast-Paced Tale of a Car And a Mad Scientist who must Kill a Womanizer in Ancient Japan', '''ancient'':21 ''car'':10 ''fast'':5 ''fast-pac'':4 ''japan'':22 ''kill'':17 ''mad'':13 ''must'':16 ''pace'':6 ''scientist'':14 ''searcher'':1 ''tale'':7 ''wait'':2 ''woman'':19', '1', '2013-05-26T14:50:58.951000', 182, 'NC-17', 2006, 3, '2.99', '22.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Searchers Wait'), + ('A Touching Display of a Pioneer And a Butler who must Chase a Car in California', '''armageddon'':2 ''butler'':11 ''california'':18 ''car'':16 ''chase'':14 ''display'':5 ''must'':13 ''pioneer'':8 ''stagecoach'':1 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 112, 'R', 2006, 5, '4.99', '25.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Stagecoach Armageddon'), + ('A Amazing Drama of a Butler And a Husband who must Reach a A Shark in A U-Boat', '''amaz'':4 ''boat'':22 ''butler'':8 ''drama'':5 ''expec'':1 ''husband'':11 ''must'':13 ''natur'':2 ''reach'':14 ''shark'':17 ''u'':21 ''u-boat'':20', '1', '2013-05-26T14:50:58.951000', 138, 'PG-13', 2006, 5, '4.99', '26.99', ARRAY['Deleted Scenes']::text[], 'Expecations Natural'), + ('A Thrilling Saga of a Monkey And a Frisbee who must Escape a Explorer in The Outback', '''escap'':14 ''explor'':16 ''frisbe'':11 ''monkey'':8 ''must'':13 ''outback'':19 ''saga'':5 ''ship'':1 ''thrill'':4 ''wonderland'':2', '1', '2013-05-26T14:50:58.951000', 104, 'R', 2006, 5, '2.99', '15.99', ARRAY['Commentaries']::text[], 'Ship Wonderland'), + ('A Action-Packed Panorama of a Technical Writer And a Man who must Build a Forensic Psychologist in A Manhattan Penthouse', '''action'':5 ''action-pack'':4 ''build'':17 ''forens'':19 ''heartbreak'':2 ''man'':14 ''manhattan'':23 ''must'':16 ''pack'':6 ''panorama'':7 ''penthous'':24 ''psychologist'':20 ''technic'':10 ''telemark'':1 ''writer'':11', '1', '2013-05-26T14:50:58.951000', 152, 'PG-13', 2006, 6, '2.99', '9.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Telemark Heartbreakers'), + ('A Amazing Epistle of a Squirrel And a Lumberjack who must Succumb a Database Administrator in A U-Boat', '''administr'':17 ''amaz'':4 ''boat'':22 ''databas'':16 ''epistl'':5 ''hobbit'':2 ''lumberjack'':11 ''must'':13 ''squirrel'':8 ''succumb'':14 ''traffic'':1 ''u'':21 ''u-boat'':20', '1', '2013-05-26T14:50:58.951000', 139, 'G', 2006, 5, '4.99', '13.99', ARRAY['Trailers', 'Commentaries']::text[], 'Traffic Hobbit'), + ('A Stunning Saga of a Mad Scientist And a Boat who must Overcome a Dentist in Ancient China', '''ancient'':19 ''boat'':12 ''china'':20 ''dentist'':17 ''mad'':8 ''must'':14 ''overcom'':15 ''prix'':1 ''saga'':5 ''scientist'':9 ''stun'':4 ''undef'':2', '1', '2013-05-26T14:50:58.951000', 115, 'R', 2006, 4, '2.99', '13.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Prix Undefeated'), + ('A Amazing Drama of a Mad Scientist And a Composer who must Build a Husband in The Outback', '''amaz'':4 ''build'':15 ''compos'':12 ''drama'':5 ''husband'':17 ''mad'':8 ''must'':14 ''outback'':20 ''record'':1 ''scientist'':9 ''zorro'':2', '1', '2013-05-26T14:50:58.951000', 182, 'PG', 2006, 7, '4.99', '11.99', ARRAY['Behind the Scenes']::text[], 'Records Zorro'), + ('A Fanciful Character Study of a Technical Writer And a Husband who must Redeem a Robot in The Outback', '''charact'':5 ''citizen'':1 ''fanci'':4 ''husband'':13 ''must'':15 ''outback'':21 ''redeem'':16 ''robot'':18 ''shrek'':2 ''studi'':6 ''technic'':9 ''writer'':10', '1', '2013-05-26T14:50:58.951000', 165, 'G', 2006, 7, '0.99', '18.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Citizen Shrek'), + ('A Fast-Paced Panorama of a Technical Writer And a Mad Scientist who must Find a Feminist in An Abandoned Mine Shaft', '''abandon'':23 ''attack'':1 ''fast'':5 ''fast-pac'':4 ''feminist'':20 ''find'':18 ''hate'':2 ''mad'':14 ''mine'':24 ''must'':17 ''pace'':6 ''panorama'':7 ''scientist'':15 ''shaft'':25 ''technic'':10 ''writer'':11', '1', '2013-05-26T14:50:58.951000', 113, 'PG-13', 2006, 5, '4.99', '21.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Attacks Hate'), + ('A Unbelieveable Display of a Crocodile And a Feminist who must Overcome a Moose in An Abandoned Amusement Park', '''abandon'':19 ''amus'':20 ''crocodil'':8 ''dalmat'':2 ''display'':5 ''feminist'':11 ''moos'':16 ''must'':13 ''overcom'':14 ''park'':21 ''unbeliev'':4 ''undef'':1', '1', '2013-05-26T14:50:58.951000', 107, 'PG-13', 2006, 7, '4.99', '22.99', ARRAY['Commentaries']::text[], 'Undefeated Dalmations'), + ('A Beautiful Yarn of a Pioneer And a Monkey who must Pursue a Explorer in The Sahara Desert', '''ark'':1 ''beauti'':4 ''desert'':20 ''explor'':16 ''monkey'':11 ''must'':13 ''pioneer'':8 ''pursu'':14 ''ridgemont'':2 ''sahara'':19 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 68, 'NC-17', 2006, 6, '0.99', '25.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Ark Ridgemont'), + ('A Awe-Inspiring Drama of a Astronaut And a Frisbee who must Conquer a Mad Scientist in Australia', '''astronaut'':10 ''australia'':21 ''awe'':5 ''awe-inspir'':4 ''conquer'':16 ''drama'':7 ''frisbe'':13 ''inspir'':6 ''mad'':18 ''must'':15 ''roug'':1 ''scientist'':19 ''squad'':2', '1', '2013-05-26T14:50:58.951000', 118, 'NC-17', 2006, 3, '0.99', '10.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Rouge Squad'), + ('A Thrilling Epistle of a Composer And a Sumo Wrestler who must Challenge a Mad Cow in A MySQL Convention', '''challeng'':15 ''compos'':8 ''convent'':22 ''cow'':18 ''epistl'':5 ''mad'':17 ''must'':14 ''mysql'':21 ''reap'':1 ''sumo'':11 ''thrill'':4 ''unfaith'':2 ''wrestler'':12', '1', '2013-05-26T14:50:58.951000', 136, 'PG-13', 2006, 6, '2.99', '26.99', ARRAY['Trailers', 'Commentaries']::text[], 'Reap Unfaithful'), + ('A Fateful Drama of a Frisbee And a Student who must Confront a Cat in A Shark Tank', '''cat'':16 ''confront'':14 ''drama'':5 ''fate'':4 ''frisbe'':8 ''go'':2 ''must'':13 ''random'':1 ''shark'':19 ''student'':11 ''tank'':20', '1', '2013-05-26T14:50:58.951000', 73, 'NC-17', 2006, 6, '2.99', '29.99', ARRAY['Trailers']::text[], 'Random Go'), + ('A Action-Packed Story of a Hunter And a Boy who must Discover a Lumberjack in Ancient India', '''action'':5 ''action-pack'':4 ''ancient'':20 ''boy'':13 ''discov'':16 ''hunter'':10 ''india'':21 ''lumberjack'':18 ''must'':15 ''pack'':6 ''rainbow'':1 ''shock'':2 ''stori'':7', '1', '2013-05-26T14:50:58.951000', 74, 'PG', 2006, 3, '4.99', '14.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Rainbow Shock'), + ('A Taut Character Study of a Woman And a A Shark who must Confront a Frisbee in Berlin', '''berlin'':20 ''charact'':5 ''confront'':16 ''frisbe'':18 ''gang'':1 ''must'':15 ''pride'':2 ''shark'':13 ''studi'':6 ''taut'':4 ''woman'':9', '1', '2013-05-26T14:50:58.951000', 185, 'PG-13', 2006, 4, '2.99', '27.99', ARRAY['Behind the Scenes']::text[], 'Gangs Pride'), + ('A Epic Drama of a Madman And a Cat who must Face a A Shark in An Abandoned Amusement Park', '''abandon'':20 ''amus'':21 ''bang'':1 ''cat'':11 ''drama'':5 ''epic'':4 ''face'':14 ''kwai'':2 ''madman'':8 ''must'':13 ''park'':22 ''shark'':17', '1', '2013-05-26T14:50:58.951000', 87, 'NC-17', 2006, 5, '2.99', '25.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Bang Kwai'), + ('A Fast-Paced Drama of a Hunter And a Boy who must Discover a Feminist in The Sahara Desert', '''boy'':13 ''desert'':22 ''discov'':16 ''drama'':7 ''fast'':5 ''fast-pac'':4 ''feminist'':18 ''hunter'':10 ''ice'':2 ''must'':15 ''opus'':1 ''pace'':6 ''sahara'':21', '1', '2013-05-26T14:50:58.951000', 102, 'R', 2006, 5, '4.99', '21.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Opus Ice'), + ('A Boring Saga of a Database Administrator And a Womanizer who must Battle a Waitress in Nigeria', '''administr'':9 ''armi'':1 ''battl'':15 ''bore'':4 ''databas'':8 ''flintston'':2 ''must'':14 ''nigeria'':19 ''saga'':5 ''waitress'':17 ''woman'':12', '1', '2013-05-26T14:50:58.951000', 148, 'R', 2006, 4, '0.99', '22.99', ARRAY['Trailers', 'Commentaries']::text[], 'Army Flintstones'), + ('A Thoughtful Yarn of a Womanizer And a Dog who must Challenge a Madman in The Gulf of Mexico', '''challeng'':14 ''dog'':11 ''doubl'':1 ''gulf'':19 ''madman'':16 ''mexico'':21 ''must'':13 ''thought'':4 ''woman'':8 ''wrath'':2 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 177, 'R', 2006, 4, '0.99', '28.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Double Wrath'), + ('A Thoughtful Documentary of a Mad Scientist And a A Shark who must Outrace a Feminist in Australia', '''australia'':20 ''documentari'':5 ''fantasia'':1 ''feminist'':18 ''mad'':8 ''must'':15 ''outrac'':16 ''park'':2 ''scientist'':9 ''shark'':13 ''thought'':4', '1', '2013-05-26T14:50:58.951000', 131, 'G', 2006, 5, '2.99', '29.99', ARRAY['Commentaries']::text[], 'Fantasia Park'), + ('A Awe-Inspiring Character Study of a Secret Agent And a Boat who must Find a Squirrel in The First Manned Space Station', '''agent'':12 ''awe'':5 ''awe-inspir'':4 ''boat'':15 ''bugsi'':1 ''charact'':7 ''find'':18 ''first'':23 ''inspir'':6 ''man'':24 ''must'':17 ''secret'':11 ''song'':2 ''space'':25 ''squirrel'':20 ''station'':26 ''studi'':8', '1', '2013-05-26T14:50:58.951000', 119, 'G', 2006, 4, '2.99', '17.99', ARRAY['Commentaries']::text[], 'Bugsy Song'), + ('A Epic Documentary of a Composer And a Robot who must Overcome a Car in Berlin', '''berlin'':18 ''car'':16 ''compos'':8 ''documentari'':5 ''epic'':4 ''exorcist'':2 ''kane'':1 ''must'':13 ''overcom'':14 ''robot'':11', '1', '2013-05-26T14:50:58.951000', 92, 'R', 2006, 5, '0.99', '18.99', ARRAY['Trailers', 'Commentaries']::text[], 'Kane Exorcist'), + ('A Fast-Paced Saga of a Pastry Chef And a Monkey who must Sink a Composer in Ancient India', '''ancient'':21 ''chef'':11 ''compos'':19 ''daisi'':1 ''fast'':5 ''fast-pac'':4 ''india'':22 ''menageri'':2 ''monkey'':14 ''must'':16 ''pace'':6 ''pastri'':10 ''saga'':7 ''sink'':17', '1', '2013-05-26T14:50:58.951000', 84, 'G', 2006, 5, '4.99', '9.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Daisy Menagerie'), + ('A Epic Saga of a Hunter And a Technical Writer who must Conquer a Cat in Ancient Japan', '''ancient'':19 ''cat'':17 ''conquer'':15 ''epic'':4 ''hunter'':8 ''japan'':20 ''ladybug'':2 ''must'':14 ''person'':1 ''saga'':5 ''technic'':11 ''writer'':12', '1', '2013-05-26T14:50:58.951000', 118, 'PG-13', 2006, 3, '0.99', '19.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Personal Ladybugs'), + ('A Lacklusture Panorama of a Woman And a Frisbee who must Chase a Crocodile in A Jet Boat', '''boat'':20 ''chase'':14 ''crocodil'':16 ''frisbe'':11 ''jet'':19 ''lacklustur'':4 ''must'':13 ''panorama'':5 ''stage'':1 ''woman'':8 ''world'':2', '1', '2013-05-26T14:50:58.951000', 85, 'PG', 2006, 4, '2.99', '19.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Stage World'), + ('A Fast-Paced Story of a Crocodile And a A Shark who must Sink a Pioneer in Berlin', '''berlin'':21 ''crocodil'':10 ''fast'':5 ''fast-pac'':4 ''must'':16 ''pace'':6 ''pioneer'':19 ''shark'':14 ''shootist'':1 ''sink'':17 ''stori'':7 ''superfli'':2', '1', '2013-05-26T14:50:58.951000', 67, 'PG-13', 2006, 6, '0.99', '22.99', ARRAY['Trailers']::text[], 'Shootist Superfly'), + ('A Amazing Panorama of a Mad Scientist And a Husband who must Meet a Woman in The Outback', '''amaz'':4 ''earli'':1 ''home'':2 ''husband'':12 ''mad'':8 ''meet'':15 ''must'':14 ''outback'':20 ''panorama'':5 ''scientist'':9 ''woman'':17', '1', '2013-05-26T14:50:58.951000', 96, 'NC-17', 2006, 6, '4.99', '27.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Early Home'), + ('A Brilliant Saga of a Pastry Chef And a Hunter who must Confront a Butler in Berlin', '''berlin'':19 ''brilliant'':4 ''butler'':17 ''chef'':9 ''cincinatti'':1 ''confront'':15 ''hunter'':12 ''must'':14 ''pastri'':8 ''saga'':5 ''whisper'':2', '1', '2013-05-26T14:50:58.951000', 143, 'NC-17', 2006, 5, '4.99', '26.99', ARRAY['Deleted Scenes']::text[], 'Cincinatti Whisperer'), + ('A Fanciful Reflection of a Boy And a Butler who must Pursue a Woman in Berlin', '''berlin'':18 ''boy'':8 ''butler'':11 ''fanci'':4 ''must'':13 ''pursu'':14 ''reflect'':5 ''upris'':1 ''uptown'':2 ''woman'':16', '1', '2013-05-26T14:50:58.951000', 174, 'NC-17', 2006, 6, '2.99', '16.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Uprising Uptown'), + ('A Action-Packed Tale of a Student And a Waitress who must Conquer a Lumberjack in An Abandoned Mine Shaft', '''abandon'':21 ''action'':5 ''action-pack'':4 ''apollo'':2 ''conquer'':16 ''lumberjack'':18 ''mine'':22 ''must'':15 ''pack'':6 ''shaft'':23 ''student'':10 ''tale'':7 ''waitress'':13 ''wed'':1', '1', '2013-05-26T14:50:58.951000', 70, 'PG', 2006, 3, '0.99', '14.99', ARRAY['Trailers']::text[], 'Wedding Apollo'), + ('A Emotional Drama of a Boy And a Technical Writer who must Redeem a Sumo Wrestler in California', '''boy'':8 ''california'':20 ''drama'':5 ''emot'':4 ''jawbreak'':2 ''must'':14 ''pajama'':1 ''redeem'':15 ''sumo'':17 ''technic'':11 ''wrestler'':18 ''writer'':12', '1', '2013-05-26T14:50:58.951000', 126, 'R', 2006, 3, '0.99', '14.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Pajama Jawbreaker'), + ('A Emotional Character Study of a Pioneer And a Girl who must Discover a Dog in Ancient Japan', '''ancient'':19 ''charact'':5 ''cheaper'':1 ''clyde'':2 ''discov'':15 ''dog'':17 ''emot'':4 ''girl'':12 ''japan'':20 ''must'':14 ''pioneer'':9 ''studi'':6', '1', '2013-05-26T14:50:58.951000', 87, 'G', 2006, 6, '0.99', '23.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Cheaper Clyde'), + ('A Thoughtful Reflection of a Mad Scientist And a Moose who must Kill a Husband in A Baloon', '''baloon'':20 ''husband'':17 ''kill'':15 ''lamb'':2 ''mad'':8 ''moos'':12 ''must'':14 ''reflect'':5 ''saturday'':1 ''scientist'':9 ''thought'':4', '1', '2013-05-26T14:50:58.951000', 150, 'G', 2006, 3, '4.99', '28.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Saturday Lambs'), + ('A Epic Saga of a Waitress And a Composer who must Face a Boat in A U-Boat', '''boat'':16,21 ''compos'':11 ''detail'':1 ''epic'':4 ''face'':14 ''must'':13 ''packer'':2 ''saga'':5 ''u'':20 ''u-boat'':19 ''waitress'':8', '1', '2013-05-26T14:50:58.951000', 88, 'R', 2006, 4, '4.99', '17.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Details Packer'), + ('A Epic Drama of a Feminist And a Mad Scientist who must Battle a Teacher in The Canadian Rockies', '''academi'':1 ''battl'':15 ''canadian'':20 ''dinosaur'':2 ''drama'':5 ''epic'':4 ''feminist'':8 ''mad'':11 ''must'':14 ''rocki'':21 ''scientist'':12 ''teacher'':17', '1', '2013-05-26T14:50:58.951000', 86, 'PG', 2006, 6, '0.99', '20.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Academy Dinosaur'), + ('A Epic Story of a A Shark And a Student who must Confront a Explorer in The Gulf of Mexico', '''confront'':15 ''daddi'':1 ''epic'':4 ''explor'':17 ''gulf'':20 ''mexico'':22 ''must'':14 ''pittsburgh'':2 ''shark'':9 ''stori'':5 ''student'':12', '1', '2013-05-26T14:50:58.951000', 161, 'G', 2006, 5, '4.99', '26.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Daddy Pittsburgh'), + ('A Lacklusture Epistle of a Cat And a Husband who must Confront a Boy in A MySQL Convention', '''boy'':16 ''cat'':8 ''confront'':14 ''convent'':20 ''epistl'':5 ''husband'':11 ''lacklustur'':4 ''mile'':1 ''mulan'':2 ''must'':13 ''mysql'':19', '1', '2013-05-26T14:50:58.951000', 64, 'PG', 2006, 4, '0.99', '10.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Mile Mulan'), + ('A Unbelieveable Documentary of a Teacher And a Monkey who must Defeat a Explorer in A U-Boat', '''boat'':21 ''dare'':2 ''defeat'':14 ''documentari'':5 ''explor'':16 ''monkey'':11 ''must'':13 ''teacher'':8 ''u'':20 ''u-boat'':19 ''unbeliev'':4 ''won'':1', '1', '2013-05-26T14:50:58.951000', 105, 'PG', 2006, 7, '2.99', '18.99', ARRAY['Behind the Scenes']::text[], 'Won Dares'), + ('A Taut Story of a Pioneer And a Squirrel who must Battle a Student in Soviet Georgia', '''battl'':14 ''dynamit'':2 ''georgia'':19 ''hous'':1 ''must'':13 ''pioneer'':8 ''soviet'':18 ''squirrel'':11 ''stori'':5 ''student'':16 ''taut'':4', '1', '2013-05-26T14:50:58.951000', 109, 'R', 2006, 7, '2.99', '13.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'House Dynamite'), + ('A Astounding Panorama of a Man And a Monkey who must Discover a Man in The First Manned Space Station', '''astound'':4 ''beneath'':1 ''discov'':14 ''first'':19 ''man'':8,16,20 ''monkey'':11 ''must'':13 ''panorama'':5 ''rush'':2 ''space'':21 ''station'':22', '1', '2013-05-26T14:50:58.951000', 53, 'NC-17', 2006, 6, '0.99', '27.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Beneath Rush'), + ('A Fast-Paced Documentary of a Mad Cow And a Boy who must Pursue a Dentist in A Baloon', '''baloon'':22 ''boy'':14 ''cow'':11 ''dentist'':19 ''documentari'':7 ''fast'':5 ''fast-pac'':4 ''iron'':1 ''mad'':10 ''moon'':2 ''must'':16 ''pace'':6 ''pursu'':17', '1', '2013-05-26T14:50:58.951000', 46, 'PG', 2006, 7, '4.99', '27.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Iron Moon'), + ('A Boring Panorama of a Secret Agent And a Girl who must Sink a Waitress in The Outback', '''agent'':9 ''bore'':4 ''girl'':12 ''hour'':2 ''must'':14 ''outback'':20 ''panorama'':5 ''secret'':8 ''sink'':15 ''straight'':1 ''waitress'':17', '1', '2013-05-26T14:50:58.951000', 151, 'R', 2006, 3, '0.99', '19.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Straight Hours'), + ('A Action-Packed Reflection of a Student And a Butler who must Discover a Database Administrator in A Manhattan Penthouse', '''action'':5 ''action-pack'':4 ''administr'':19 ''butler'':13 ''databas'':18 ''discov'':16 ''interview'':1 ''liaison'':2 ''manhattan'':22 ''must'':15 ''pack'':6 ''penthous'':23 ''reflect'':7 ''student'':10', '1', '2013-05-26T14:50:58.951000', 59, 'R', 2006, 4, '4.99', '17.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Interview Liaisons'), + ('A Amazing Character Study of a Mad Cow And a Squirrel who must Discover a Hunter in A U-Boat', '''amaz'':4 ''boat'':23 ''charact'':5 ''cow'':10 ''discov'':16 ''expend'':1 ''hunter'':18 ''mad'':9 ''must'':15 ''squirrel'':13 ''stallion'':2 ''studi'':6 ''u'':22 ''u-boat'':21', '1', '2013-05-26T14:50:58.951000', 97, 'PG', 2006, 3, '0.99', '14.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Expendable Stallion'), + ('A Epic Story of a Mad Cow And a Astronaut who must Challenge a Car in California', '''astronaut'':12 ''california'':19 ''car'':17 ''challeng'':15 ''cow'':9 ''epic'':4 ''hard'':2 ''juggler'':1 ''mad'':8 ''must'':14 ''stori'':5', '1', '2013-05-26T14:50:58.951000', 54, 'PG-13', 2006, 4, '0.99', '14.99', ARRAY['Trailers', 'Commentaries']::text[], 'Juggler Hardly'), + ('A Lacklusture Yarn of a Teacher And a Squirrel who must Overcome a Dog in A Shark Tank', '''dog'':16 ''duck'':1 ''lacklustur'':4 ''must'':13 ''overcom'':14 ''racer'':2 ''shark'':19 ''squirrel'':11 ''tank'':20 ''teacher'':8 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 116, 'NC-17', 2006, 4, '2.99', '15.99', ARRAY['Behind the Scenes']::text[], 'Duck Racer'), + ('A Fanciful Documentary of a Mad Cow And a Womanizer who must Find a Dentist in Berlin', '''arsenic'':1 ''berlin'':19 ''cow'':9 ''dentist'':17 ''documentari'':5 ''fanci'':4 ''find'':15 ''independ'':2 ''mad'':8 ''must'':14 ''woman'':12', '1', '2013-05-26T14:50:58.951000', 137, 'PG', 2006, 4, '0.99', '17.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Arsenic Independence'), + ('A Action-Packed Epistle of a Feminist And a Astronaut who must Conquer a Boat in A Manhattan Penthouse', '''action'':5 ''action-pack'':4 ''astronaut'':13 ''boat'':18 ''christma'':1 ''conquer'':16 ''epistl'':7 ''feminist'':10 ''manhattan'':21 ''moonshin'':2 ''must'':15 ''pack'':6 ''penthous'':22', '1', '2013-05-26T14:50:58.951000', 150, 'NC-17', 2006, 7, '0.99', '21.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Christmas Moonshine'), + ('A Astounding Tale of a A Shark And a Moose who must Meet a Womanizer in The Sahara Desert', '''astound'':4 ''desert'':21 ''legal'':1 ''meet'':15 ''moos'':12 ''must'':14 ''sahara'':20 ''secretari'':2 ''shark'':9 ''tale'':5 ''woman'':17', '1', '2013-05-26T14:50:58.951000', 113, 'PG', 2006, 7, '4.99', '14.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Legally Secretary'), + ('A Stunning Saga of a Sumo Wrestler And a Student who must Outrace a Moose in The Sahara Desert', '''desert'':21 ''french'':2 ''harold'':1 ''moos'':17 ''must'':14 ''outrac'':15 ''saga'':5 ''sahara'':20 ''student'':12 ''stun'':4 ''sumo'':8 ''wrestler'':9', '1', '2013-05-26T14:50:58.951000', 168, 'NC-17', 2006, 6, '0.99', '10.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Harold French'), + ('A Boring Drama of a A Shark And a Explorer who must Redeem a Waitress in The Canadian Rockies', '''bore'':4 ''canadian'':20 ''drama'':5 ''explor'':12 ''liaison'':1 ''must'':14 ''redeem'':15 ''rocki'':21 ''shark'':9 ''sweet'':2 ''waitress'':17', '1', '2013-05-26T14:50:58.951000', 140, 'PG', 2006, 5, '4.99', '15.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Liaisons Sweet'), + ('A Boring Character Study of a Student And a Robot who must Meet a Woman in California', '''bore'':4 ''california'':19 ''charact'':5 ''mask'':1 ''meet'':15 ''must'':14 ''peach'':2 ''robot'':12 ''student'':9 ''studi'':6 ''woman'':17', '1', '2013-05-26T14:50:58.951000', 123, 'NC-17', 2006, 6, '2.99', '26.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Mask Peach'), + ('A Intrepid Yarn of a Explorer And a Student who must Kill a Husband in An Abandoned Mine Shaft', '''abandon'':19 ''date'':2 ''explor'':8 ''gump'':1 ''husband'':16 ''intrepid'':4 ''kill'':14 ''mine'':20 ''must'':13 ''shaft'':21 ''student'':11 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 53, 'NC-17', 2006, 3, '4.99', '12.99', ARRAY['Deleted Scenes']::text[], 'Gump Date'), + ('A Lacklusture Display of a Waitress And a Lumberjack who must Chase a Pioneer in New Orleans', '''chase'':14 ''display'':5 ''lacklustur'':4 ''lumberjack'':11 ''mourn'':1 ''must'':13 ''new'':18 ''orlean'':19 ''pioneer'':16 ''purpl'':2 ''waitress'':8', '1', '2013-05-26T14:50:58.951000', 146, 'PG', 2006, 5, '0.99', '14.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Mourning Purple'), + ('A Intrepid Epistle of a Pastry Chef And a Pastry Chef who must Pursue a Crocodile in Ancient China', '''ancient'':20 ''bulworth'':2 ''chef'':9,13 ''china'':21 ''crocodil'':18 ''english'':1 ''epistl'':5 ''intrepid'':4 ''must'':15 ''pastri'':8,12 ''pursu'':16', '1', '2013-05-26T14:50:58.951000', 51, 'PG-13', 2006, 3, '0.99', '18.99', ARRAY['Deleted Scenes']::text[], 'English Bulworth'), + ('A Touching Panorama of a Waitress And a Woman who must Outrace a Dog in An Abandoned Amusement Park', '''abandon'':19 ''amus'':20 ''anthem'':1 ''dog'':16 ''luke'':2 ''must'':13 ''outrac'':14 ''panorama'':5 ''park'':21 ''touch'':4 ''waitress'':8 ''woman'':11', '1', '2013-05-26T14:50:58.951000', 91, 'PG-13', 2006, 5, '4.99', '16.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Anthem Luke'), + ('A Intrepid Drama of a Teacher And a Butler who must Build a Pastry Chef in Berlin', '''berlin'':19 ''build'':14 ''butler'':11 ''chef'':17 ''drama'':5 ''earring'':2 ''intrepid'':4 ''must'':13 ''pastri'':16 ''smile'':1 ''teacher'':8', '1', '2013-05-26T14:50:58.951000', 60, 'G', 2006, 4, '2.99', '29.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Smile Earring'), + ('A Unbelieveable Display of a Dog And a Crocodile who must Outrace a Man in Nigeria', '''bever'':2 ''crocodil'':11 ''display'':5 ''dog'':8 ''man'':16 ''must'':13 ''nigeria'':18 ''outrac'':14 ''pulp'':1 ''unbeliev'':4', '1', '2013-05-26T14:50:58.951000', 89, 'G', 2006, 4, '2.99', '12.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Pulp Beverly'), + ('A Awe-Inspiring Character Study of a Boy And a Feminist who must Sink a Crocodile in Ancient China', '''ancient'':21 ''apollo'':2 ''awe'':5 ''awe-inspir'':4 ''boy'':11 ''charact'':7 ''china'':22 ''crocodil'':19 ''feminist'':14 ''inspir'':6 ''must'':16 ''salut'':1 ''sink'':17 ''studi'':8', '1', '2013-05-26T14:50:58.951000', 73, 'R', 2006, 4, '2.99', '29.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Salute Apollo'), + ('A Epic Saga of a Boy And a Dentist who must Outrace a Madman in A U-Boat', '''boat'':21 ''boy'':8 ''dentist'':11 ''epic'':4 ''madman'':16 ''must'':13 ''oleand'':2 ''outrac'':14 ''prejudic'':1 ''saga'':5 ''u'':20 ''u-boat'':19', '1', '2013-05-26T14:50:58.951000', 98, 'PG-13', 2006, 6, '4.99', '15.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Prejudice Oleander'), + ('A Lacklusture Reflection of a Boat And a Forensic Psychologist who must Fight a Waitress in A Monastery', '''boat'':8 ''fight'':15 ''forens'':11 ''furi'':1 ''lacklustur'':4 ''monasteri'':20 ''murder'':2 ''must'':14 ''psychologist'':12 ''reflect'':5 ''waitress'':17', '1', '2013-05-26T14:50:58.951000', 178, 'PG-13', 2006, 3, '0.99', '28.99', ARRAY['Deleted Scenes']::text[], 'Fury Murder'), + ('A Intrepid Documentary of a Forensic Psychologist And a Mad Scientist who must Face a Explorer in A U-Boat', '''boat'':23 ''documentari'':5 ''dynamit'':1 ''explor'':18 ''face'':16 ''forens'':8 ''intrepid'':4 ''mad'':12 ''must'':15 ''psychologist'':9 ''scientist'':13 ''tarzan'':2 ''u'':22 ''u-boat'':21', '1', '2013-05-26T14:50:58.951000', 141, 'PG-13', 2006, 4, '0.99', '27.99', ARRAY['Deleted Scenes']::text[], 'Dynamite Tarzan'), + ('A Intrepid Yarn of a Husband And a Womanizer who must Pursue a Mad Scientist in New Orleans', '''blade'':2 ''husband'':8 ''intrepid'':4 ''jumanji'':1 ''mad'':16 ''must'':13 ''new'':19 ''orlean'':20 ''pursu'':14 ''scientist'':17 ''woman'':11 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 121, 'G', 2006, 4, '2.99', '13.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Jumanji Blade'), + ('A Unbelieveable Yarn of a Student And a Database Administrator who must Outgun a Husband in An Abandoned Mine Shaft', '''abandon'':20 ''administr'':12 ''databas'':11 ''hunger'':1 ''husband'':17 ''mine'':21 ''must'':14 ''outgun'':15 ''roof'':2 ''shaft'':22 ''student'':8 ''unbeliev'':4 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 105, 'G', 2006, 6, '0.99', '21.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Hunger Roof'), + ('A Action-Packed Panorama of a Mad Scientist And a Robot who must Challenge a Student in Nigeria', '''action'':5 ''action-pack'':4 ''challeng'':17 ''mad'':10 ''must'':16 ''nigeria'':21 ''pack'':6 ''panorama'':7 ''past'':2 ''robot'':14 ''scientist'':11 ''student'':19 ''tequila'':1', '1', '2013-05-26T14:50:58.951000', 53, 'PG', 2006, 6, '4.99', '17.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Tequila Past'), + ('A Thoughtful Panorama of a Hunter And a Teacher who must Reach a Mad Cow in A U-Boat', '''boat'':22 ''cow'':17 ''entrap'':1 ''hunter'':8 ''mad'':16 ''must'':13 ''panorama'':5 ''reach'':14 ''satisfact'':2 ''teacher'':11 ''thought'':4 ''u'':21 ''u-boat'':20', '1', '2013-05-26T14:50:58.951000', 176, 'R', 2006, 5, '0.99', '19.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Entrapment Satisfaction'), + ('A Intrepid Epistle of a Woman And a Forensic Psychologist who must Succumb a Astronaut in A Manhattan Penthouse', '''astronaut'':17 ''cider'':2 ''epistl'':5 ''forens'':11 ''intrepid'':4 ''manhattan'':20 ''must'':14 ''penthous'':21 ''psychologist'':12 ''succumb'':15 ''wait'':1 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 112, 'PG-13', 2006, 3, '0.99', '9.99', ARRAY['Trailers']::text[], 'Wait Cider'), + ('A Unbelieveable Reflection of a Moose And a A Shark who must Defeat a Lumberjack in An Abandoned Mine Shaft', '''abandon'':20 ''defeat'':15 ''fiction'':2 ''groov'':1 ''lumberjack'':17 ''mine'':21 ''moos'':8 ''must'':14 ''reflect'':5 ''shaft'':22 ''shark'':12 ''unbeliev'':4', '1', '2013-05-26T14:50:58.951000', 111, 'NC-17', 2006, 6, '0.99', '13.99', ARRAY['Behind the Scenes']::text[], 'Groove Fiction'), + ('A Awe-Inspiring Reflection of a Forensic Psychologist And a Secret Agent who must Succumb a Pastry Chef in Soviet Georgia', '''agent'':15 ''awe'':5 ''awe-inspir'':4 ''chef'':21 ''forens'':10 ''georgia'':24 ''inspir'':6 ''must'':17 ''pastri'':20 ''psychologist'':11 ''rear'':1 ''reflect'':7 ''secret'':14 ''soviet'':23 ''succumb'':18 ''trade'':2', '1', '2013-05-26T14:50:58.951000', 97, 'NC-17', 2006, 6, '0.99', '23.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Rear Trading'), + ('A Lacklusture Tale of a Crocodile And a Composer who must Defeat a Madman in A U-Boat', '''boat'':21 ''compos'':11 ''crocodil'':8 ''defeat'':14 ''fool'':1 ''lacklustur'':4 ''madman'':16 ''mockingbird'':2 ''must'':13 ''tale'':5 ''u'':20 ''u-boat'':19', '1', '2013-05-26T14:50:58.951000', 158, 'PG', 2006, 3, '4.99', '24.99', ARRAY['Trailers', 'Commentaries']::text[], 'Fool Mockingbird'), + ('A Astounding Reflection of a Squirrel And a Sumo Wrestler who must Sink a Dentist in Ancient Japan', '''ancient'':19 ''astound'':4 ''dentist'':17 ''gladiat'':1 ''japan'':20 ''must'':14 ''reflect'':5 ''sink'':15 ''squirrel'':8 ''sumo'':11 ''westward'':2 ''wrestler'':12', '1', '2013-05-26T14:50:58.951000', 173, 'PG', 2006, 6, '4.99', '20.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Gladiator Westward'), + ('A Unbelieveable Saga of a Crocodile And a Student who must Discover a Cat in Ancient India', '''ancient'':18 ''cat'':16 ''crocodil'':8 ''discov'':14 ''divorc'':1 ''india'':19 ''must'':13 ''saga'':5 ''shine'':2 ''student'':11 ''unbeliev'':4', '1', '2013-05-26T14:50:58.951000', 47, 'G', 2006, 3, '2.99', '21.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Divorce Shining'), + ('A Action-Packed Epistle of a Robot And a Car who must Chase a Boat in Ancient Japan', '''action'':5 ''action-pack'':4 ''ancient'':20 ''boat'':18 ''car'':13 ''chase'':16 ''epistl'':7 ''float'':1 ''garden'':2 ''japan'':21 ''must'':15 ''pack'':6 ''robot'':10', '1', '2013-05-26T14:50:58.951000', 145, 'PG-13', 2006, 6, '2.99', '29.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Floats Garden'), + ('A Intrepid Story of a Pastry Chef And a Database Administrator who must Kill a Feminist in A MySQL Convention', '''administr'':13 ''bikini'':2 ''chef'':9 ''convent'':22 ''databas'':12 ''feminist'':18 ''intrepid'':4 ''kill'':16 ''must'':15 ''mysql'':21 ''pastri'':8 ''stori'':5 ''whale'':1', '1', '2013-05-26T14:50:58.951000', 109, 'PG-13', 2006, 4, '4.99', '11.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Whale Bikini'), + ('A Epic Epistle of a Database Administrator And a Crocodile who must Face a Madman in A Jet Boat', '''administr'':9 ''boat'':21 ''crocodil'':12 ''databas'':8 ''epic'':4 ''epistl'':5 ''face'':15 ''half'':1 ''jet'':20 ''madman'':17 ''must'':14 ''outfield'':2', '1', '2013-05-26T14:50:58.951000', 146, 'PG-13', 2006, 6, '2.99', '25.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Half Outfield'), + ('A Brilliant Panorama of a Girl And a Boy who must Face a Mad Scientist in An Abandoned Mine Shaft', '''abandon'':20 ''boy'':11 ''brilliant'':4 ''durham'':1 ''face'':14 ''girl'':8 ''mad'':16 ''mine'':21 ''must'':13 ''panki'':2 ''panorama'':5 ''scientist'':17 ''shaft'':22', '1', '2013-05-26T14:50:58.951000', 154, 'R', 2006, 6, '4.99', '14.99', ARRAY['Trailers', 'Commentaries']::text[], 'Durham Panky'), + ('A Stunning Epistle of a Man And a Husband who must Reach a Mad Scientist in A Jet Boat', '''basic'':1 ''boat'':21 ''easi'':2 ''epistl'':5 ''husband'':11 ''jet'':20 ''mad'':16 ''man'':8 ''must'':13 ''reach'':14 ''scientist'':17 ''stun'':4', '1', '2013-05-26T14:50:58.951000', 90, 'PG-13', 2006, 4, '2.99', '18.99', ARRAY['Deleted Scenes']::text[], 'Basic Easy'), + ('A Lacklusture Story of a Moose And a Monkey who must Confront a Butler in An Abandoned Amusement Park', '''abandon'':19 ''amus'':20 ''bubbl'':2 ''butler'':16 ''confront'':14 ''lacklustur'':4 ''monkey'':11 ''moos'':8 ''must'':13 ''park'':21 ''shawshank'':1 ''stori'':5', '1', '2013-05-26T14:50:58.951000', 80, 'PG', 2006, 6, '4.99', '20.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Shawshank Bubble'), + ('A Amazing Documentary of a Secret Agent And a Astronaut who must Vanquish a Hunter in A Shark Tank', '''agent'':9 ''amaz'':4 ''astronaut'':12 ''celebr'':1 ''documentari'':5 ''horn'':2 ''hunter'':17 ''must'':14 ''secret'':8 ''shark'':20 ''tank'':21 ''vanquish'':15', '1', '2013-05-26T14:50:58.951000', 110, 'PG-13', 2006, 7, '0.99', '24.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Celebrity Horn'), + ('A Touching Tale of a Cat And a Pastry Chef who must Conquer a Pastry Chef in A MySQL Convention', '''cat'':8 ''chef'':12,18 ''conquer'':15 ''convent'':22 ''must'':14 ''mysql'':21 ''pacif'':2 ''pastri'':11,17 ''run'':1 ''tale'':5 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 145, 'R', 2006, 3, '0.99', '25.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Run Pacific'), + ('A Beautiful Tale of a Dentist And a Mad Cow who must Battle a Moose in The Sahara Desert', '''autumn'':1 ''battl'':15 ''beauti'':4 ''cow'':12 ''crow'':2 ''dentist'':8 ''desert'':21 ''mad'':11 ''moos'':17 ''must'':14 ''sahara'':20 ''tale'':5', '1', '2013-05-26T14:50:58.951000', 108, 'G', 2006, 3, '4.99', '13.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Autumn Crow'), + ('A Unbelieveable Saga of a Teacher And a Monkey who must Fight a Girl in An Abandoned Mine Shaft', '''abandon'':19 ''fight'':14 ''frankenstein'':2 ''girl'':16 ''grail'':1 ''mine'':20 ''monkey'':11 ''must'':13 ''saga'':5 ''shaft'':21 ''teacher'':8 ''unbeliev'':4', '1', '2013-05-26T14:50:58.951000', 85, 'NC-17', 2006, 4, '2.99', '17.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Grail Frankenstein'), + ('A Insightful Story of a Teacher And a Hunter who must Face a Mad Cow in California', '''california'':19 ''chitti'':2 ''cow'':17 ''face'':14 ''hunter'':11 ''insight'':4 ''mad'':16 ''magnific'':1 ''must'':13 ''stori'':5 ''teacher'':8', '1', '2013-05-26T14:50:58.951000', 53, 'R', 2006, 3, '2.99', '27.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Magnificent Chitty'), + ('A Fanciful Character Study of a Lumberjack And a Car who must Discover a Cat in An Abandoned Amusement Park', '''abandon'':20 ''amus'':21 ''car'':12 ''cat'':17 ''charact'':5 ''discov'':15 ''fanci'':4 ''lumberjack'':9 ''must'':14 ''newton'':2 ''park'':22 ''studi'':6 ''trip'':1', '1', '2013-05-26T14:50:58.951000', 64, 'PG-13', 2006, 7, '4.99', '14.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Trip Newton'), + ('A Boring Documentary of a Dentist And a Butler who must Confront a Monkey in A MySQL Convention', '''bore'':4 ''butler'':11 ''chocol'':2 ''confront'':14 ''convent'':20 ''dentist'':8 ''documentari'':5 ''meet'':1 ''monkey'':16 ''must'':13 ''mysql'':19', '1', '2013-05-26T14:50:58.951000', 80, 'G', 2006, 3, '2.99', '26.99', ARRAY['Trailers']::text[], 'Meet Chocolate'), + ('A Beautiful Character Study of a Mad Cow And a Robot who must Reach a Womanizer in New Orleans', '''beauti'':4 ''charact'':5 ''cow'':10 ''mad'':9 ''must'':15 ''new'':20 ''north'':1 ''orlean'':21 ''reach'':16 ''robot'':13 ''studi'':6 ''tequila'':2 ''woman'':18', '1', '2013-05-26T14:50:58.951000', 67, 'NC-17', 2006, 4, '4.99', '9.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'North Tequila'), + ('A Boring Panorama of a Man And a Mad Cow who must Face a Explorer in Ancient India', '''ancient'':19 ''bore'':4 ''cow'':12 ''encino'':2 ''explor'':17 ''face'':15 ''india'':20 ''jeopardi'':1 ''mad'':11 ''man'':8 ''must'':14 ''panorama'':5', '1', '2013-05-26T14:50:58.951000', 102, 'R', 2006, 3, '0.99', '12.99', ARRAY['Trailers', 'Commentaries']::text[], 'Jeopardy Encino'), + ('A Thoughtful Tale of a Woman And a A Shark who must Conquer a Dog in A Monastery', '''conquer'':15 ''dog'':17 ''jason'':1 ''monasteri'':20 ''must'':14 ''shark'':12 ''tale'':5 ''thought'':4 ''trap'':2 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 130, 'NC-17', 2006, 5, '2.99', '9.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Jason Trap') + ) AS data(description, fulltext, old_language_id, last_update, length, rating, release_year, rental_duration, rental_rate, replacement_cost, special_features, title) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."language"' + AND map0.old_id = data.old_language_id + RETURNING film_id + ) + SELECT array_agg(film_id) INTO v_new_ids_film FROM inserted; + + FOR i IN 1..array_length(v_new_ids_film, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."film"', v_old_ids_film[i], v_new_ids_film[i]::TEXT); + END LOOP; + + v_old_ids_film := ARRAY['404', '906', '859', '674', '10', '481', '418', '300', '836', '881', '611', '455', '542', '933', '918', '37', '569', '712', '273', '671', '281', '910', '538', '84', '297', '256', '695', '467', '426', '472', '856', '288', '954', '833', '990', '942', '854', '631', '125', '30', '816', '135', '474', '485', '50', '552', '216', '246', '403', '173', '773', '503', '309', '928', '315', '684', '422', '93', '354', '996', '711', '124', '206', '323', '453', '279', '748', '1000', '893', '428', '970', '544', '238', '589', '498', '62', '145', '192', '537', '286', '33', '180', '968', '197', '849', '321', '840', '22', '536', '393', '159', '280', '103', '477', '303', '416', '800', '545', '351', '366']; + WITH inserted AS ( + INSERT INTO "public"."film" ("description", "fulltext", "language_id", "last_update", "length", "rating", "release_year", "rental_duration", "rental_rate", "replacement_cost", "special_features", "title") + SELECT + data.description::text, + data.fulltext::tsvector, + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.length::smallint, + data.rating::mpaa_rating, + data.release_year::integer, + data.rental_duration::smallint, + data.rental_rate::numeric, + data.replacement_cost::numeric, + data.special_features::text[], + data.title::character varying + FROM (VALUES + ('A Intrepid Reflection of a Mad Scientist And a Pioneer who must Overcome a Hunter in The First Manned Space Station', '''first'':20 ''handicap'':2 ''hate'':1 ''hunter'':17 ''intrepid'':4 ''mad'':8 ''man'':21 ''must'':14 ''overcom'':15 ''pioneer'':12 ''reflect'':5 ''scientist'':9 ''space'':22 ''station'':23', '1', '2013-05-26T14:50:58.951000', 107, 'PG', 2006, 4, '0.99', '26.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Hate Handicap'), + ('A Brilliant Display of a Composer And a Cat who must Succumb a A Shark in Ancient India', '''ancient'':19 ''brilliant'':4 ''cat'':11 ''compos'':8 ''display'':5 ''india'':20 ''must'':13 ''other'':2 ''shark'':17 ''succumb'':14 ''tramp'':1', '1', '2013-05-26T14:50:58.951000', 171, 'PG', 2006, 4, '0.99', '27.99', ARRAY['Deleted Scenes']::text[], 'Tramp Others'), + ('A Touching Story of a Dentist And a Database Administrator who must Conquer a Astronaut in An Abandoned Amusement Park', '''abandon'':20 ''administr'':12 ''amus'':21 ''astronaut'':17 ''conquer'':15 ''databas'':11 ''dentist'':8 ''must'':14 ''park'':22 ''stori'':5 ''sugar'':1 ''touch'':4 ''wonka'':2', '1', '2013-05-26T14:50:58.951000', 114, 'PG', 2006, 3, '4.99', '20.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Sugar Wonka'), + ('A Unbelieveable Reflection of a Explorer And a Boat who must Conquer a Woman in California', '''boat'':11 ''california'':18 ''conquer'':14 ''explor'':8 ''haunt'':2 ''must'':13 ''pet'':1 ''reflect'':5 ''unbeliev'':4 ''woman'':16', '1', '2013-05-26T14:50:58.951000', 99, 'PG', 2006, 3, '0.99', '11.99', ARRAY['Trailers', 'Commentaries']::text[], 'Pet Haunting'), + ('A Action-Packed Tale of a Man And a Lumberjack who must Reach a Feminist in Ancient China', '''action'':5 ''action-pack'':4 ''aladdin'':1 ''ancient'':20 ''calendar'':2 ''china'':21 ''feminist'':18 ''lumberjack'':13 ''man'':10 ''must'':15 ''pack'':6 ''reach'':16 ''tale'':7', '1', '2013-05-26T14:50:58.951000', 63, 'NC-17', 2006, 6, '4.99', '24.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Aladdin Calendar'), + ('A Fanciful Epistle of a Student And a Astronaut who must Kill a Waitress in A Shark Tank', '''astronaut'':11 ''epistl'':5 ''fanci'':4 ''frogmen'':2 ''jekyl'':1 ''kill'':14 ''must'':13 ''shark'':19 ''student'':8 ''tank'':20 ''waitress'':16', '1', '2013-05-26T14:50:58.951000', 58, 'PG', 2006, 4, '2.99', '22.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Jekyll Frogmen'), + ('A Emotional Drama of a Husband And a Girl who must Outgun a Composer in The First Manned Space Station', '''alien'':2 ''compos'':16 ''drama'':5 ''emot'':4 ''first'':19 ''girl'':11 ''hobbit'':1 ''husband'':8 ''man'':20 ''must'':13 ''outgun'':14 ''space'':21 ''station'':22', '1', '2013-05-26T14:50:58.951000', 157, 'PG-13', 2006, 5, '0.99', '27.99', ARRAY['Commentaries']::text[], 'Hobbit Alien'), + ('A Fateful Saga of a Sumo Wrestler And a Hunter who must Redeem a A Shark in New Orleans', '''falcon'':1 ''fate'':4 ''hunter'':12 ''must'':14 ''new'':20 ''orlean'':21 ''redeem'':15 ''saga'':5 ''shark'':18 ''sumo'':8 ''volum'':2 ''wrestler'':9', '1', '2013-05-26T14:50:58.951000', 102, 'PG-13', 2006, 5, '4.99', '21.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Falcon Volume'), + ('A Fast-Paced Display of a Pastry Chef And a Dog who must Kill a Teacher in Berlin', '''berlin'':21 ''chef'':11 ''display'':7 ''dog'':14 ''fast'':5 ''fast-pac'':4 ''fish'':2 ''kill'':17 ''must'':16 ''pace'':6 ''pastri'':10 ''squad'':1 ''teacher'':19', '1', '2013-05-26T14:50:58.951000', 136, 'PG', 2006, 3, '2.99', '14.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Squad Fish'), + ('A Action-Packed Saga of a Forensic Psychologist And a Woman who must Battle a Womanizer in Soviet Georgia', '''action'':5 ''action-pack'':4 ''attract'':2 ''battl'':17 ''forens'':10 ''georgia'':22 ''must'':16 ''pack'':6 ''psychologist'':11 ''saga'':7 ''soviet'':21 ''templ'':1 ''woman'':14,19', '1', '2013-05-26T14:50:58.951000', 71, 'PG', 2006, 5, '4.99', '13.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Temple Attraction'), + ('A Touching Yarn of a Student And a Moose who must Fight a Mad Cow in Australia', '''australia'':19 ''cow'':17 ''fight'':14 ''mad'':16 ''moos'':11 ''musket'':1 ''must'':13 ''student'':8 ''touch'':4 ''wait'':2 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 73, 'PG', 2006, 7, '4.99', '17.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Musketeers Wait'), + ('A Awe-Inspiring Yarn of a Monkey And a Hunter who must Chase a Teacher in Ancient China', '''ancient'':20 ''awe'':5 ''awe-inspir'':4 ''chase'':16 ''china'':21 ''hunter'':13 ''imposs'':1 ''inspir'':6 ''monkey'':10 ''must'':15 ''prejudic'':2 ''teacher'':18 ''yarn'':7', '1', '2013-05-26T14:50:58.951000', 103, 'NC-17', 2006, 7, '4.99', '11.99', ARRAY['Deleted Scenes']::text[], 'Impossible Prejudice'), + ('A Fanciful Panorama of a Hunter And a Dentist who must Meet a Secret Agent in The Sahara Desert', '''agent'':17 ''dentist'':11 ''desert'':21 ''fanci'':4 ''hunter'':8 ''lock'':2 ''lust'':1 ''meet'':14 ''must'':13 ''panorama'':5 ''sahara'':20 ''secret'':16', '1', '2013-05-26T14:50:58.951000', 52, 'G', 2006, 3, '2.99', '28.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Lust Lock'), + ('A Epic Story of a Lumberjack And a Monkey who must Confront a Pioneer in A MySQL Convention', '''confront'':14 ''convent'':20 ''epic'':4 ''lumberjack'':8 ''monkey'':11 ''must'':13 ''mysql'':19 ''pioneer'':16 ''stori'':5 ''vampir'':1 ''whale'':2', '1', '2013-05-26T14:50:58.951000', 126, 'NC-17', 2006, 4, '4.99', '11.99', ARRAY['Trailers', 'Commentaries']::text[], 'Vampire Whale'), + ('A Touching Display of a Frisbee And a Boat who must Kill a Girl in A MySQL Convention', '''boat'':11 ''convent'':20 ''display'':5 ''frisbe'':8 ''girl'':16 ''kill'':14 ''must'':13 ''mysql'':19 ''pirat'':2 ''touch'':4 ''twist'':1', '1', '2013-05-26T14:50:58.951000', 152, 'PG', 2006, 4, '4.99', '23.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Twisted Pirates'), + ('A Brilliant Panorama of a Mad Scientist And a Mad Cow who must Meet a Pioneer in A Monastery', '''arizona'':1 ''bang'':2 ''brilliant'':4 ''cow'':13 ''mad'':8,12 ''meet'':16 ''monasteri'':21 ''must'':15 ''panorama'':5 ''pioneer'':18 ''scientist'':9', '1', '2013-05-26T14:50:58.951000', 121, 'PG', 2006, 3, '2.99', '28.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Arizona Bang'), + ('A Unbelieveable Panorama of a Composer And a Butler who must Overcome a Database Administrator in The First Manned Space Station', '''administr'':17 ''butler'':11 ''compos'':8 ''databas'':16 ''first'':20 ''man'':21 ''menageri'':1 ''must'':13 ''overcom'':14 ''panorama'':5 ''rushmor'':2 ''space'':22 ''station'':23 ''unbeliev'':4', '1', '2013-05-26T14:50:58.951000', 147, 'G', 2006, 7, '2.99', '18.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Menagerie Rushmore'), + ('A Amazing Drama of a Teacher And a Feminist who must Meet a Woman in The First Manned Space Station', '''amaz'':4 ''antitrust'':2 ''drama'':5 ''feminist'':11 ''first'':19 ''man'':20 ''meet'':14 ''must'':13 ''raider'':1 ''space'':21 ''station'':22 ''teacher'':8 ''woman'':16', '1', '2013-05-26T14:50:58.951000', 82, 'PG-13', 2006, 4, '0.99', '11.99', ARRAY['Deleted Scenes']::text[], 'Raiders Antitrust'), + ('A Beautiful Display of a Pastry Chef And a Pastry Chef who must Outgun a Forensic Psychologist in A Manhattan Penthouse', '''beauti'':4 ''chef'':9,13 ''display'':5 ''effect'':1 ''forens'':18 ''gladiat'':2 ''manhattan'':22 ''must'':15 ''outgun'':16 ''pastri'':8,12 ''penthous'':23 ''psychologist'':19', '1', '2013-05-26T14:50:58.951000', 107, 'PG', 2006, 6, '0.99', '14.99', ARRAY['Commentaries']::text[], 'Effect Gladiator'), + ('A Fast-Paced Story of a Car And a Cat who must Outgun a Hunter in Berlin', '''berlin'':20 ''car'':10 ''cat'':13 ''fargo'':2 ''fast'':5 ''fast-pac'':4 ''hunter'':18 ''must'':15 ''outgun'':16 ''pace'':6 ''perdit'':1 ''stori'':7', '1', '2013-05-26T14:50:58.951000', 99, 'NC-17', 2006, 7, '4.99', '27.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Perdition Fargo'), + ('A Astounding Drama of a Feminist And a Teacher who must Confront a Husband in A Baloon', '''astound'':4 ''baloon'':19 ''confront'':14 ''drama'':5 ''elf'':2 ''encino'':1 ''feminist'':8 ''husband'':16 ''must'':13 ''teacher'':11', '1', '2013-05-26T14:50:58.951000', 143, 'G', 2006, 6, '0.99', '9.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Encino Elf'), + ('A Boring Story of a Teacher And a Student who must Outgun a Cat in An Abandoned Mine Shaft', '''abandon'':19 ''bore'':4 ''cat'':16 ''jekyl'':2 ''mine'':20 ''must'':13 ''outgun'':14 ''shaft'':21 ''stori'':5 ''student'':11 ''teacher'':8 ''treatment'':1', '1', '2013-05-26T14:50:58.951000', 87, 'PG', 2006, 3, '0.99', '19.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Treatment Jekyll'), + ('A Boring Story of a Car And a Butler who must Build a Girl in Soviet Georgia', '''attack'':2 ''bore'':4 ''build'':14 ''butler'':11 ''car'':8 ''georgia'':19 ''girl'':16 ''loverboy'':1 ''must'':13 ''soviet'':18 ''stori'':5', '1', '2013-05-26T14:50:58.951000', 162, 'PG-13', 2006, 7, '0.99', '19.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Loverboy Attacks'), + ('A Awe-Inspiring Story of a Waitress And a Dog who must Discover a Dentist in Ancient Japan', '''ancient'':20 ''awe'':5 ''awe-inspir'':4 ''boil'':1 ''dare'':2 ''dentist'':18 ''discov'':16 ''dog'':13 ''inspir'':6 ''japan'':21 ''must'':15 ''stori'':7 ''waitress'':10', '1', '2013-05-26T14:50:58.951000', 102, 'PG', 2006, 7, '4.99', '13.99', ARRAY['Trailers', 'Commentaries']::text[], 'Boiled Dares'), + ('A Stunning Story of a Dog And a Feminist who must Face a Forensic Psychologist in Berlin', '''berlin'':19 ''conquer'':2 ''dog'':8 ''extraordinari'':1 ''face'':14 ''feminist'':11 ''forens'':16 ''must'':13 ''psychologist'':17 ''stori'':5 ''stun'':4', '1', '2013-05-26T14:50:58.951000', 122, 'G', 2006, 6, '2.99', '29.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Extraordinary Conquerer'), + ('A Fanciful Documentary of a Husband And a Explorer who must Reach a Madman in Ancient China', '''ancient'':18 ''china'':19 ''documentari'':5 ''drop'':1 ''explor'':11 ''fanci'':4 ''husband'':8 ''madman'':16 ''must'':13 ''reach'':14 ''waterfront'':2', '1', '2013-05-26T14:50:58.951000', 178, 'R', 2006, 6, '4.99', '20.99', ARRAY['Trailers', 'Commentaries']::text[], 'Drop Waterfront'), + ('A Fateful Panorama of a Technical Writer And a Moose who must Battle a Robot in Soviet Georgia', '''bang'':2 ''battl'':15 ''fate'':4 ''georgia'':20 ''moos'':12 ''must'':14 ''panorama'':5 ''presid'':1 ''robot'':17 ''soviet'':19 ''technic'':8 ''writer'':9', '1', '2013-05-26T14:50:58.951000', 144, 'PG', 2006, 6, '4.99', '12.99', ARRAY['Behind the Scenes']::text[], 'President Bang'), + ('A Fanciful Character Study of a Explorer And a Mad Scientist who must Vanquish a Squirrel in A Jet Boat', '''boat'':22 ''charact'':5 ''explor'':9 ''fanci'':4 ''intrigu'':1 ''jet'':21 ''mad'':12 ''must'':15 ''scientist'':13 ''squirrel'':18 ''studi'':6 ''vanquish'':16 ''worst'':2', '1', '2013-05-26T14:50:58.951000', 181, 'G', 2006, 6, '0.99', '10.99', ARRAY['Deleted Scenes']::text[], 'Intrigue Worst'), + ('A Touching Panorama of a Man And a Secret Agent who must Challenge a Teacher in A MySQL Convention', '''agent'':12 ''challeng'':15 ''convent'':21 ''home'':1 ''man'':8 ''must'':14 ''mysql'':20 ''panorama'':5 ''piti'':2 ''secret'':11 ''teacher'':17 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 185, 'R', 2006, 7, '4.99', '15.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Home Pity'), + ('A Astounding Character Study of a Monkey And a Moose who must Outgun a Cat in A U-Boat', '''african'':2 ''astound'':4 ''boat'':22 ''cat'':17 ''charact'':5 ''italian'':1 ''monkey'':9 ''moos'':12 ''must'':14 ''outgun'':15 ''studi'':6 ''u'':21 ''u-boat'':20', '1', '2013-05-26T14:50:58.951000', 174, 'G', 2006, 3, '4.99', '24.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Italian African'), + ('A Insightful Character Study of a Waitress And a Crocodile who must Sink a Waitress in The Gulf of Mexico', '''charact'':5 ''crocodil'':12 ''gulf'':20 ''insight'':4 ''intent'':2 ''mexico'':22 ''must'':14 ''sink'':15 ''streetcar'':1 ''studi'':6 ''waitress'':9,17', '1', '2013-05-26T14:50:58.951000', 73, 'R', 2006, 5, '4.99', '11.99', ARRAY['Commentaries']::text[], 'Streetcar Intentions'), + ('A Taut Yarn of a Astronaut And a Technical Writer who must Outgun a Boat in New Orleans', '''astronaut'':8 ''boat'':17 ''escap'':1 ''metropoli'':2 ''must'':14 ''new'':19 ''orlean'':20 ''outgun'':15 ''taut'':4 ''technic'':11 ''writer'':12 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 167, 'R', 2006, 7, '2.99', '20.99', ARRAY['Trailers']::text[], 'Escape Metropolis'), + ('A Beautiful Saga of a Feminist And a Composer who must Challenge a Moose in Berlin', '''beauti'':4 ''berlin'':18 ''challeng'':14 ''compos'':11 ''feminist'':8 ''jaw'':2 ''moos'':16 ''must'':13 ''saga'':5 ''wake'':1', '1', '2013-05-26T14:50:58.951000', 73, 'G', 2006, 7, '4.99', '18.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Wake Jaws'), + ('A Taut Story of a Dog And a Explorer who must Find a Astronaut in Berlin', '''astronaut'':16 ''berlin'':18 ''dog'':8 ''explor'':11 ''find'':14 ''must'':13 ''patton'':2 ''splendor'':1 ''stori'':5 ''taut'':4', '1', '2013-05-26T14:50:58.951000', 134, 'R', 2006, 5, '0.99', '20.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Splendor Patton'), + ('A Unbelieveable Tale of a Pioneer And a Astronaut who must Overcome a Robot in An Abandoned Amusement Park', '''abandon'':19 ''amus'':20 ''astronaut'':11 ''leatherneck'':2 ''must'':13 ''overcom'':14 ''park'':21 ''pioneer'':8 ''robot'':16 ''tale'':5 ''unbeliev'':4 ''world'':1', '1', '2013-05-26T14:50:58.951000', 171, 'PG-13', 2006, 3, '0.99', '13.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'World Leathernecks'), + ('A Lacklusture Display of a Butler And a Man who must Sink a Explorer in Soviet Georgia', '''butler'':8 ''display'':5 ''explor'':16 ''georgia'':19 ''lacklustur'':4 ''man'':11 ''must'':13 ''sink'':14 ''smoochi'':2 ''soviet'':18 ''vietnam'':1', '1', '2013-05-26T14:50:58.951000', 174, 'PG-13', 2006, 7, '0.99', '27.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Vietnam Smoochy'), + ('A Brilliant Character Study of a Secret Agent And a Man who must Find a Cat in The Gulf of Mexico', '''agent'':10 ''brilliant'':4 ''cat'':18 ''charact'':5 ''find'':16 ''graffiti'':2 ''gulf'':21 ''man'':13 ''mexico'':23 ''must'':15 ''secret'':9 ''stranger'':1 ''studi'':6', '1', '2013-05-26T14:50:58.951000', 119, 'R', 2006, 4, '4.99', '22.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Strangers Graffiti'), + ('A Fanciful Display of a Student And a Teacher who must Outgun a Crocodile in Nigeria', '''crocodil'':16 ''display'':5 ''fanci'':4 ''flight'':2 ''must'':13 ''nigeria'':18 ''novocain'':1 ''outgun'':14 ''student'':8 ''teacher'':11', '1', '2013-05-26T14:50:58.951000', 64, 'G', 2006, 4, '0.99', '11.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Novocaine Flight'), + ('A Intrepid Drama of a Frisbee And a Hunter who must Kill a Secret Agent in New Orleans', '''agent'':17 ''cassidi'':1 ''drama'':5 ''frisbe'':8 ''hunter'':11 ''intrepid'':4 ''kill'':14 ''must'':13 ''new'':19 ''orlean'':20 ''secret'':16 ''wyom'':2', '1', '2013-05-26T14:50:58.951000', 61, 'NC-17', 2006, 5, '2.99', '19.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Cassidy Wyoming'), + ('A Epic Story of a Pastry Chef And a Woman who must Chase a Feminist in An Abandoned Fun House', '''abandon'':20 ''anyth'':1 ''chase'':15 ''chef'':9 ''epic'':4 ''feminist'':17 ''fun'':21 ''hous'':22 ''must'':14 ''pastri'':8 ''savannah'':2 ''stori'':5 ''woman'':12', '1', '2013-05-26T14:50:58.951000', 82, 'R', 2006, 4, '2.99', '27.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Anything Savannah'), + ('A Fateful Display of a Lumberjack And a Girl who must Succumb a Mad Cow in A Manhattan Penthouse', '''cow'':17 ''display'':5 ''fate'':4 ''girl'':11 ''lumberjack'':8 ''mad'':16 ''manhattan'':20 ''must'':13 ''penthous'':21 ''rollercoast'':2 ''snowman'':1 ''succumb'':14', '1', '2013-05-26T14:50:58.951000', 62, 'G', 2006, 3, '0.99', '27.99', ARRAY['Trailers']::text[], 'Snowman Rollercoaster'), + ('A Astounding Story of a Forensic Psychologist And a Forensic Psychologist who must Overcome a Moose in Ancient China', '''ancient'':20 ''astound'':4 ''chanc'':1 ''china'':21 ''forens'':8,12 ''moos'':18 ''must'':15 ''overcom'':16 ''psychologist'':9,13 ''resurrect'':2 ''stori'':5', '1', '2013-05-26T14:50:58.951000', 70, 'R', 2006, 3, '2.99', '22.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Chance Resurrection'), + ('A Insightful Panorama of a Squirrel And a Mad Cow who must Confront a Student in The First Manned Space Station', '''bunch'':2 ''confront'':15 ''cow'':12 ''first'':20 ''insight'':4 ''jade'':1 ''mad'':11 ''man'':21 ''must'':14 ''panorama'':5 ''space'':22 ''squirrel'':8 ''station'':23 ''student'':17', '1', '2013-05-26T14:50:58.951000', 174, 'NC-17', 2006, 6, '2.99', '21.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Jade Bunch'), + ('A Lacklusture Documentary of a Madman And a Mad Cow who must Find a Feminist in Ancient Japan', '''ancient'':19 ''cow'':12 ''documentari'':5 ''feminist'':17 ''find'':15 ''japan'':20 ''jersey'':1 ''lacklustur'':4 ''mad'':11 ''madman'':8 ''must'':14 ''sassi'':2', '1', '2013-05-26T14:50:58.951000', 60, 'PG', 2006, 6, '4.99', '16.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Jersey Sassy'), + ('A Stunning Drama of a Forensic Psychologist And a Husband who must Overcome a Waitress in A Monastery', '''bake'':1 ''cleopatra'':2 ''drama'':5 ''forens'':8 ''husband'':12 ''monasteri'':20 ''must'':14 ''overcom'':15 ''psychologist'':9 ''stun'':4 ''waitress'':17', '1', '2013-05-26T14:50:58.951000', 182, 'G', 2006, 3, '2.99', '20.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Baked Cleopatra'), + ('A Thrilling Character Study of a Moose And a Student who must Escape a Butler in The First Manned Space Station', '''butler'':17 ''charact'':5 ''escap'':15 ''first'':20 ''float'':2 ''majest'':1 ''man'':21 ''moos'':9 ''must'':14 ''space'':22 ''station'':23 ''student'':12 ''studi'':6 ''thrill'':4', '1', '2013-05-26T14:50:58.951000', 130, 'PG', 2006, 5, '0.99', '15.99', ARRAY['Trailers']::text[], 'Majestic Floats'), + ('A Stunning Documentary of a Composer And a Mad Scientist who must Find a Technical Writer in A U-Boat', '''boat'':23 ''compos'':8 ''day'':1 ''documentari'':5 ''find'':15 ''mad'':11 ''must'':14 ''scientist'':12 ''stun'':4 ''technic'':17 ''u'':22 ''u-boat'':21 ''unfaith'':2 ''writer'':18', '1', '2013-05-26T14:50:58.951000', 113, 'G', 2006, 3, '4.99', '16.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Day Unfaithful'), + ('A Intrepid Panorama of a Butler And a Composer who must Meet a Mad Cow in The Sahara Desert', '''butler'':8 ''compos'':11 ''cow'':17 ''desert'':21 ''doubtfir'':1 ''intrepid'':4 ''labyrinth'':2 ''mad'':16 ''meet'':14 ''must'':13 ''panorama'':5 ''sahara'':20', '1', '2013-05-26T14:50:58.951000', 154, 'R', 2006, 5, '4.99', '16.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Doubtfire Labyrinth'), + ('A Taut Yarn of a Technical Writer And a Feminist who must Outrace a Dog in California', '''california'':19 ''dog'':17 ''feminist'':12 ''harri'':1 ''idaho'':2 ''must'':14 ''outrac'':15 ''taut'':4 ''technic'':8 ''writer'':9 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 121, 'PG-13', 2006, 5, '4.99', '18.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Harry Idaho'), + ('A Insightful Story of a Car And a Boy who must Battle a Technical Writer in A Baloon', '''baloon'':20 ''battl'':14 ''boy'':11 ''car'':8 ''confess'':1 ''insight'':4 ''maguir'':2 ''must'':13 ''stori'':5 ''technic'':16 ''writer'':17', '1', '2013-05-26T14:50:58.951000', 65, 'PG-13', 2006, 7, '4.99', '25.99', ARRAY['Behind the Scenes']::text[], 'Confessions Maguire'), + ('A Insightful Saga of a Man And a Forensic Psychologist who must Discover a Mad Cow in A MySQL Convention', '''convent'':22 ''cow'':18 ''discov'':15 ''forens'':11 ''insight'':4 ''mad'':17 ''man'':8 ''must'':14 ''mysql'':21 ''psychologist'':12 ''punk'':2 ''saga'':5 ''seabiscuit'':1', '1', '2013-05-26T14:50:58.951000', 112, 'NC-17', 2006, 6, '2.99', '28.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Seabiscuit Punk'), + ('A Amazing Yarn of a Robot And a Pastry Chef who must Redeem a Mad Scientist in The Outback', '''amaz'':4 ''chef'':12 ''chocol'':2 ''kramer'':1 ''mad'':17 ''must'':14 ''outback'':21 ''pastri'':11 ''redeem'':15 ''robot'':8 ''scientist'':18 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 171, 'R', 2006, 3, '2.99', '24.99', ARRAY['Trailers']::text[], 'Kramer Chocolate'), + ('A Brilliant Reflection of a Database Administrator And a Mad Cow who must Chase a Woman in The Canadian Rockies', '''administr'':9 ''brilliant'':4 ''canadian'':21 ''chase'':16 ''cow'':13 ''databas'':8 ''feud'':1 ''frogmen'':2 ''mad'':12 ''must'':15 ''reflect'':5 ''rocki'':22 ''woman'':18', '1', '2013-05-26T14:50:58.951000', 98, 'R', 2006, 6, '0.99', '29.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Feud Frogmen'), + ('A Fateful Documentary of a Dog And a Hunter who must Pursue a Teacher in An Abandoned Amusement Park', '''abandon'':19 ''amus'':20 ''documentari'':5 ''dog'':8 ''fate'':4 ''hunter'':11 ''must'':13 ''park'':21 ''pursu'':14 ''teacher'':16 ''uptown'':1 ''young'':2', '1', '2013-05-26T14:50:58.951000', 84, 'PG', 2006, 5, '2.99', '16.99', ARRAY['Commentaries']::text[], 'Uptown Young'), + ('A Fateful Tale of a Database Administrator And a Girl who must Battle a Squirrel in New Orleans', '''administr'':9 ''anaconda'':2 ''battl'':15 ''databas'':8 ''fate'':4 ''find'':1 ''girl'':12 ''must'':14 ''new'':19 ''orlean'':20 ''squirrel'':17 ''tale'':5', '1', '2013-05-26T14:50:58.951000', 156, 'R', 2006, 4, '0.99', '10.99', ARRAY['Trailers', 'Commentaries']::text[], 'Finding Anaconda'), + ('A Epic Saga of a Cat And a Squirrel who must Outgun a Robot in A U-Boat', '''boat'':21 ''cat'':8 ''epic'':4 ''jumanji'':2 ''must'':13 ''outgun'':14 ''pizza'':1 ''robot'':16 ''saga'':5 ''squirrel'':11 ''u'':20 ''u-boat'':19', '1', '2013-05-26T14:50:58.951000', 173, 'NC-17', 2006, 4, '2.99', '11.99', ARRAY['Commentaries']::text[], 'Pizza Jumanji'), + ('A Beautiful Character Study of a Robot And a Astronaut who must Overcome a Boat in A Monastery', '''astronaut'':12 ''beauti'':4 ''boat'':17 ''charact'':5 ''hollow'':1 ''jeopardi'':2 ''monasteri'':20 ''must'':14 ''overcom'':15 ''robot'':9 ''studi'':6', '1', '2013-05-26T14:50:58.951000', 136, 'NC-17', 2006, 7, '4.99', '25.99', ARRAY['Behind the Scenes']::text[], 'Hollow Jeopardy'), + ('A Amazing Epistle of a Moose And a Crocodile who must Outrace a Dog in Berlin', '''amaz'':4 ''berlin'':18 ''brannigan'':1 ''crocodil'':11 ''dog'':16 ''epistl'':5 ''moos'':8 ''must'':13 ''outrac'':14 ''sunris'':2', '1', '2013-05-26T14:50:58.951000', 121, 'PG', 2006, 4, '4.99', '27.99', ARRAY['Trailers']::text[], 'Brannigan Sunrise'), + ('A Brilliant Panorama of a Madman And a Composer who must Succumb a Car in Ancient India', '''ancient'':18 ''brilliant'':4 ''car'':16 ''compos'':11 ''ghost'':1 ''groundhog'':2 ''india'':19 ''madman'':8 ''must'':13 ''panorama'':5 ''succumb'':14', '1', '2013-05-26T14:50:58.951000', 85, 'G', 2006, 6, '4.99', '18.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Ghost Groundhog'), + ('A Unbelieveable Yarn of a Boat And a Database Administrator who must Meet a Boy in The First Manned Space Station', '''administr'':12 ''boat'':8 ''boy'':17 ''databas'':11 ''first'':20 ''languag'':2 ''man'':21 ''meet'':15 ''must'':14 ''space'':22 ''station'':23 ''unbeliev'':4 ''yarn'':5 ''young'':1', '1', '2013-05-26T14:50:58.951000', 183, 'G', 2006, 6, '0.99', '9.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Young Language'), + ('A Astounding Display of a Secret Agent And a Technical Writer who must Escape a Mad Scientist in A Jet Boat', '''agent'':9 ''airplan'':2 ''astound'':4 ''boat'':23 ''display'':5 ''escap'':16 ''jet'':22 ''mad'':18 ''must'':15 ''rage'':1 ''scientist'':19 ''secret'':8 ''technic'':12 ''writer'':13', '1', '2013-05-26T14:50:58.951000', 154, 'R', 2006, 4, '4.99', '18.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Raging Airplane'), + ('A Intrepid Documentary of a Boat And a Crocodile who must Chase a Robot in The Sahara Desert', '''boat'':8 ''casper'':1 ''chase'':14 ''crocodil'':11 ''desert'':20 ''documentari'':5 ''dragonfli'':2 ''intrepid'':4 ''must'':13 ''robot'':16 ''sahara'':19', '1', '2013-05-26T14:50:58.951000', 163, 'PG-13', 2006, 3, '4.99', '16.99', ARRAY['Trailers']::text[], 'Casper Dragonfly'), + ('A Stunning Story of a Explorer And a Forensic Psychologist who must Face a Crocodile in A Shark Tank', '''crocodil'':17 ''danc'':1 ''explor'':8 ''face'':15 ''fever'':2 ''forens'':11 ''must'':14 ''psychologist'':12 ''shark'':20 ''stori'':5 ''stun'':4 ''tank'':21', '1', '2013-05-26T14:50:58.951000', 144, 'G', 2006, 6, '0.99', '25.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Dancing Fever'), + ('A Stunning Character Study of a Crocodile And a Pioneer who must Pursue a Teacher in New Orleans', '''charact'':5 ''crocodil'':9 ''flight'':1 ''lie'':2 ''must'':14 ''new'':19 ''orlean'':20 ''pioneer'':12 ''pursu'':15 ''studi'':6 ''stun'':4 ''teacher'':17', '1', '2013-05-26T14:50:58.951000', 179, 'R', 2006, 7, '4.99', '22.99', ARRAY['Trailers']::text[], 'Flight Lies'), + ('A Lacklusture Panorama of a Secret Agent And a Crocodile who must Discover a Madman in The Canadian Rockies', '''agent'':9 ''canadian'':20 ''crocodil'':12 ''discov'':15 ''imag'':1 ''lacklustur'':4 ''madman'':17 ''must'':14 ''panorama'':5 ''princess'':2 ''rocki'':21 ''secret'':8', '1', '2013-05-26T14:50:58.951000', 178, 'PG-13', 2006, 3, '2.99', '17.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Image Princess'), + ('A Lacklusture Display of a Womanizer And a Dog who must Face a Sumo Wrestler in Ancient Japan', '''ancient'':19 ''display'':5 ''dog'':11 ''elizabeth'':1 ''face'':14 ''japan'':20 ''lacklustur'':4 ''must'':13 ''shane'':2 ''sumo'':16 ''woman'':8 ''wrestler'':17', '1', '2013-05-26T14:50:58.951000', 152, 'NC-17', 2006, 7, '4.99', '11.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Elizabeth Shane'), + ('A Touching Saga of a Crocodile And a Crocodile who must Discover a Technical Writer in Nigeria', '''crocodil'':8,11 ''discov'':14 ''must'':13 ''nigeria'':19 ''rugrat'':1 ''saga'':5 ''shakespear'':2 ''technic'':16 ''touch'':4 ''writer'':17', '1', '2013-05-26T14:50:58.951000', 109, 'PG-13', 2006, 4, '0.99', '16.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Rugrats Shakespeare'), + ('A Intrepid Panorama of a Mad Scientist And a Boy who must Redeem a Boy in A Monastery', '''ark'':2 ''boy'':12,17 ''intrepid'':4 ''mad'':8 ''monasteri'':20 ''must'':14 ''panorama'':5 ''redeem'':15 ''scientist'':9 ''zorro'':1', '1', '2013-05-26T14:50:58.951000', 50, 'NC-17', 2006, 3, '4.99', '18.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Zorro Ark'), + ('A Unbelieveable Panorama of a Feminist And a Sumo Wrestler who must Challenge a Technical Writer in Ancient China', '''ancient'':20 ''challeng'':15 ''china'':21 ''feminist'':8 ''jerk'':2 ''must'':14 ''panorama'':5 ''sumo'':11 ''technic'':17 ''titan'':1 ''unbeliev'':4 ''wrestler'':12 ''writer'':18', '1', '2013-05-26T14:50:58.951000', 91, 'PG', 2006, 4, '4.99', '11.99', ARRAY['Behind the Scenes']::text[], 'Titans Jerk'), + ('A Astounding Documentary of a Hunter And a Boy who must Confront a Boy in A MySQL Convention', '''astound'':4 ''boy'':11,16 ''confront'':14 ''convent'':20 ''documentari'':5 ''homicid'':1 ''hunter'':8 ''must'':13 ''mysql'':19 ''peach'':2', '1', '2013-05-26T14:50:58.951000', 141, 'PG-13', 2006, 6, '2.99', '21.99', ARRAY['Commentaries']::text[], 'Homicide Peach'), + ('A Lacklusture Tale of a Butler And a Husband who must Face a Boy in Ancient China', '''ancient'':18 ''boy'':16 ''butler'':8 ''china'':19 ''face'':14 ''husband'':11 ''lacklustur'':4 ''must'':13 ''seabiscuit'':2 ''tale'':5 ''westward'':1', '1', '2013-05-26T14:50:58.951000', 52, 'NC-17', 2006, 7, '0.99', '11.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Westward Seabiscuit'), + ('A Awe-Inspiring Reflection of a Monkey And a Dentist who must Overcome a Pioneer in A U-Boat', '''awe'':5 ''awe-inspir'':4 ''boat'':23 ''dentist'':13 ''inspir'':6 ''madison'':1 ''monkey'':10 ''must'':15 ''overcom'':16 ''pioneer'':18 ''reflect'':7 ''trap'':2 ''u'':22 ''u-boat'':21', '1', '2013-05-26T14:50:58.951000', 147, 'R', 2006, 4, '2.99', '11.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Madison Trap'), + ('A Insightful Drama of a Womanizer And a Waitress who must Reach a Forensic Psychologist in The Outback', '''doctor'':1 ''drama'':5 ''forens'':16 ''grail'':2 ''insight'':4 ''must'':13 ''outback'':20 ''psychologist'':17 ''reach'':14 ''waitress'':11 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 57, 'G', 2006, 4, '2.99', '29.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Doctor Grail'), + ('A Awe-Inspiring Story of a Butler And a Sumo Wrestler who must Redeem a Boy in New Orleans', '''awe'':5 ''awe-inspir'':4 ''boy'':19 ''butler'':10 ''dorado'':2 ''inspir'':6 ''modern'':1 ''must'':16 ''new'':21 ''orlean'':22 ''redeem'':17 ''stori'':7 ''sumo'':13 ''wrestler'':14', '1', '2013-05-26T14:50:58.951000', 74, 'PG', 2006, 3, '0.99', '20.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Modern Dorado'), + ('A Fanciful Character Study of a Student And a Explorer who must Succumb a Composer in An Abandoned Mine Shaft', '''abandon'':20 ''charact'':5 ''compos'':17 ''explor'':12 ''fanci'':4 ''innoc'':2 ''killer'':1 ''mine'':21 ''must'':14 ''shaft'':22 ''student'':9 ''studi'':6 ''succumb'':15', '1', '2013-05-26T14:50:58.951000', 161, 'R', 2006, 7, '2.99', '11.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Killer Innocent'), + ('A Astounding Panorama of a Lumberjack And a Dog who must Redeem a Woman in An Abandoned Fun House', '''abandon'':19 ''astound'':4 ''bed'':1 ''dog'':11 ''fun'':20 ''highbal'':2 ''hous'':21 ''lumberjack'':8 ''must'':13 ''panorama'':5 ''redeem'':14 ''woman'':16', '1', '2013-05-26T14:50:58.951000', 106, 'NC-17', 2006, 5, '2.99', '23.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Bed Highball'), + ('A Epic Documentary of a Sumo Wrestler And a Butler who must Kill a Car in Ancient India', '''ancient'':19 ''behavior'':2 ''butler'':12 ''car'':17 ''chisum'':1 ''documentari'':5 ''epic'':4 ''india'':20 ''kill'':15 ''must'':14 ''sumo'':8 ''wrestler'':9', '1', '2013-05-26T14:50:58.951000', 124, 'G', 2006, 5, '4.99', '25.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Chisum Behavior'), + ('A Beautiful Documentary of a Dog And a Robot who must Redeem a Womanizer in Berlin', '''beauti'':4 ''berlin'':18 ''cross'':1 ''divorc'':2 ''documentari'':5 ''dog'':8 ''must'':13 ''redeem'':14 ''robot'':11 ''woman'':16', '1', '2013-05-26T14:50:58.951000', 50, 'R', 2006, 4, '4.99', '19.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Crossing Divorce'), + ('A Emotional Yarn of a Robot And a Boy who must Outgun a Technical Writer in A U-Boat', '''boat'':22 ''boy'':11 ''emot'':4 ''lover'':1 ''must'':13 ''outgun'':14 ''robot'':8 ''technic'':16 ''truman'':2 ''u'':21 ''u-boat'':20 ''writer'':17 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 75, 'G', 2006, 3, '2.99', '29.99', ARRAY['Trailers']::text[], 'Lover Truman'), + ('A Astounding Character Study of a Boat And a Secret Agent who must Find a Mad Cow in The Sahara Desert', '''agent'':13 ''astound'':4 ''boat'':9 ''charact'':5 ''cow'':19 ''desert'':23 ''enough'':1 ''find'':16 ''mad'':18 ''must'':15 ''rage'':2 ''sahara'':22 ''secret'':12 ''studi'':6', '1', '2013-05-26T14:50:58.951000', 158, 'NC-17', 2006, 7, '2.99', '16.99', ARRAY['Commentaries']::text[], 'Enough Raging'), + ('A Action-Packed Reflection of a Crocodile And a Explorer who must Find a Sumo Wrestler in An Abandoned Mine Shaft', '''abandon'':22 ''action'':5 ''action-pack'':4 ''apollo'':1 ''crocodil'':10 ''explor'':13 ''find'':16 ''mine'':23 ''must'':15 ''pack'':6 ''reflect'':7 ''shaft'':24 ''sumo'':18 ''teen'':2 ''wrestler'':19', '1', '2013-05-26T14:50:58.951000', 153, 'PG-13', 2006, 5, '2.99', '15.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Apollo Teen'), + ('A Awe-Inspiring Story of a Student And a Frisbee who must Conquer a Crocodile in An Abandoned Mine Shaft', '''abandon'':21 ''awe'':5 ''awe-inspir'':4 ''conquer'':16 ''conspiraci'':1 ''crocodil'':18 ''frisbe'':13 ''inspir'':6 ''mine'':22 ''must'':15 ''shaft'':23 ''spirit'':2 ''stori'':7 ''student'':10', '1', '2013-05-26T14:50:58.951000', 184, 'PG-13', 2006, 4, '2.99', '27.99', ARRAY['Trailers', 'Commentaries']::text[], 'Conspiracy Spirit'), + ('A Fanciful Story of a Man And a Sumo Wrestler who must Outrace a Student in A Monastery', '''fanci'':4 ''lola'':2 ''man'':8 ''monasteri'':20 ''must'':14 ''outrac'':15 ''stori'':5 ''student'':17 ''sumo'':11 ''werewolf'':1 ''wrestler'':12', '1', '2013-05-26T14:50:58.951000', 79, 'G', 2006, 6, '4.99', '19.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Werewolf Lola'), + ('A Fast-Paced Reflection of a Explorer And a Butler who must Battle a Madman in An Abandoned Amusement Park', '''abandon'':21 ''amus'':22 ''battl'':16 ''butler'':13 ''crusad'':1 ''explor'':10 ''fast'':5 ''fast-pac'':4 ''honey'':2 ''madman'':18 ''must'':15 ''pace'':6 ''park'':23 ''reflect'':7', '1', '2013-05-26T14:50:58.951000', 112, 'R', 2006, 4, '2.99', '27.99', ARRAY['Commentaries']::text[], 'Crusade Honey'), + ('A Insightful Drama of a Feminist And a A Shark who must Vanquish a Boat in A Shark Tank', '''boat'':17 ''drama'':5 ''feminist'':8 ''happi'':2 ''insight'':4 ''must'':14 ''shark'':12,20 ''storm'':1 ''tank'':21 ''vanquish'':15', '1', '2013-05-26T14:50:58.951000', 57, 'NC-17', 2006, 6, '0.99', '28.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Storm Happiness'), + ('A Astounding Saga of a Moose And a Pastry Chef who must Chase a Student in The Gulf of Mexico', '''astound'':4 ''chase'':15 ''chef'':12 ''flash'':1 ''gulf'':20 ''mexico'':22 ''moos'':8 ''must'':14 ''pastri'':11 ''saga'':5 ''student'':17 ''war'':2', '1', '2013-05-26T14:50:58.951000', 123, 'NC-17', 2006, 3, '4.99', '21.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Flash Wars'), + ('A Unbelieveable Tale of a Woman And a Lumberjack who must Fight a Frisbee in A U-Boat', '''boat'':21 ''disturb'':2 ''fight'':14 ''frisbe'':16 ''lumberjack'':11 ''must'':13 ''stamped'':1 ''tale'':5 ''u'':20 ''u-boat'':19 ''unbeliev'':4 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 75, 'R', 2006, 5, '0.99', '26.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Stampede Disturbing'), + ('A Emotional Character Study of a Dentist And a Crocodile who must Meet a Sumo Wrestler in California', '''amistad'':1 ''california'':20 ''charact'':5 ''crocodil'':12 ''dentist'':9 ''emot'':4 ''meet'':15 ''midsumm'':2 ''must'':14 ''studi'':6 ''sumo'':17 ''wrestler'':18', '1', '2013-05-26T14:50:58.951000', 85, 'G', 2006, 6, '2.99', '10.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Amistad Midsummer'), + ('A Fanciful Yarn of a Crocodile And a Forensic Psychologist who must Discover a Crocodile in The Outback', '''crocodil'':8,17 ''discov'':15 ''fanci'':4 ''forens'':11 ''jingl'':2 ''love'':1 ''must'':14 ''outback'':20 ''psychologist'':12 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 65, 'PG', 2006, 3, '2.99', '18.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Lovely Jingle'), + ('A Amazing Panorama of a Forensic Psychologist And a Technical Writer who must Fight a Dentist in A U-Boat', '''amaz'':4 ''boat'':23 ''dentist'':18 ''fight'':16 ''forens'':8 ''halloween'':1 ''must'':15 ''nut'':2 ''panorama'':5 ''psychologist'':9 ''technic'':12 ''u'':22 ''u-boat'':21 ''writer'':13', '1', '2013-05-26T14:50:58.951000', 47, 'PG-13', 2006, 6, '2.99', '19.99', ARRAY['Deleted Scenes']::text[], 'Halloween Nuts'), + ('A Unbelieveable Panorama of a Frisbee And a Hunter who must Vanquish a Monkey in Ancient India', '''ancient'':18 ''bang'':2 ''closer'':1 ''frisbe'':8 ''hunter'':11 ''india'':19 ''monkey'':16 ''must'':13 ''panorama'':5 ''unbeliev'':4 ''vanquish'':14', '1', '2013-05-26T14:50:58.951000', 58, 'R', 2006, 5, '4.99', '12.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Closer Bang'), + ('A Amazing Story of a Feminist And a Cat who must Face a Car in An Abandoned Fun House', '''abandon'':19 ''amaz'':4 ''car'':16 ''cat'':11 ''empir'':1 ''face'':14 ''feminist'':8 ''fun'':20 ''hous'':21 ''malkovich'':2 ''must'':13 ''stori'':5', '1', '2013-05-26T14:50:58.951000', 177, 'G', 2006, 7, '0.99', '26.99', ARRAY['Deleted Scenes']::text[], 'Empire Malkovich'), + ('A Amazing Display of a Girl And a Womanizer who must Succumb a Lumberjack in A Baloon Factory', '''amaz'':4 ''baloon'':19 ''brotherhood'':2 ''bucket'':1 ''display'':5 ''factori'':20 ''girl'':8 ''lumberjack'':16 ''must'':13 ''succumb'':14 ''woman'':11', '1', '2013-05-26T14:50:58.951000', 133, 'PG', 2006, 7, '4.99', '27.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Bucket Brotherhood'), + ('A Stunning Reflection of a Boat And a Pastry Chef who must Succumb a A Shark in A Jet Boat', '''boat'':8,22 ''brooklyn'':2 ''chef'':12 ''jawbreak'':1 ''jet'':21 ''must'':14 ''pastri'':11 ''reflect'':5 ''shark'':18 ''stun'':4 ''succumb'':15', '1', '2013-05-26T14:50:58.951000', 118, 'PG', 2006, 5, '0.99', '15.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Jawbreaker Brooklyn'), + ('A Touching Saga of a Teacher And a Monkey who must Overcome a Secret Agent in A MySQL Convention', '''agent'':17 ''convent'':21 ''fantasi'':1 ''monkey'':11 ''must'':13 ''mysql'':20 ''overcom'':14 ''saga'':5 ''secret'':16 ''teacher'':8 ''touch'':4 ''trooper'':2', '1', '2013-05-26T14:50:58.951000', 58, 'PG-13', 2006, 6, '0.99', '27.99', ARRAY['Behind the Scenes']::text[], 'Fantasy Troopers'), + ('A Action-Packed Saga of a Husband And a Dog who must Redeem a Database Administrator in The Sahara Desert', '''action'':5 ''action-pack'':4 ''administr'':19 ''databas'':18 ''desert'':23 ''dog'':13 ''highbal'':1 ''husband'':10 ''must'':15 ''pack'':6 ''potter'':2 ''redeem'':16 ''saga'':7 ''sahara'':22', '1', '2013-05-26T14:50:58.951000', 110, 'R', 2006, 6, '0.99', '10.99', ARRAY['Deleted Scenes']::text[], 'Highball Potter'), + ('A Epic Display of a Dog And a Boat who must Succumb a Mad Scientist in An Abandoned Mine Shaft', '''abandon'':20 ''atlanti'':2 ''boat'':11 ''display'':5 ''dog'':8 ''epic'':4 ''mad'':16 ''mine'':21 ''must'':13 ''scientist'':17 ''shaft'':22 ''sinner'':1 ''succumb'':14', '1', '2013-05-26T14:50:58.951000', 126, 'PG-13', 2006, 7, '2.99', '19.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Sinners Atlantis'), + ('A Fanciful Tale of a Squirrel And a Boat who must Defeat a Crocodile in The Gulf of Mexico', '''attack'':2 ''boat'':11 ''crocodil'':16 ''defeat'':14 ''fanci'':4 ''gulf'':19 ''mad'':1 ''mexico'':21 ''must'':13 ''squirrel'':8 ''tale'':5', '1', '2013-05-26T14:50:58.951000', 178, 'PG-13', 2006, 4, '0.99', '14.99', ARRAY['Trailers']::text[], 'Madness Attacks'), + ('A Amazing Epistle of a Boy And a Astronaut who must Redeem a Man in The Gulf of Mexico', '''amaz'':4 ''astronaut'':11 ''boy'':8 ''crusad'':2 ''epistl'':5 ''gaslight'':1 ''gulf'':19 ''man'':16 ''mexico'':21 ''must'':13 ''redeem'':14', '1', '2013-05-26T14:50:58.951000', 106, 'PG', 2006, 4, '2.99', '10.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Gaslight Crusade'), + ('A Insightful Drama of a Mad Scientist And a Hunter who must Defeat a Pastry Chef in New Orleans', '''chef'':18 ''defeat'':15 ''drama'':5 ''goldfing'':1 ''hunter'':12 ''insight'':4 ''mad'':8 ''must'':14 ''new'':20 ''orlean'':21 ''pastri'':17 ''scientist'':9 ''sensibl'':2', '1', '2013-05-26T14:50:58.951000', 93, 'G', 2006, 3, '0.99', '29.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Goldfinger Sensibility') + ) AS data(description, fulltext, old_language_id, last_update, length, rating, release_year, rental_duration, rental_rate, replacement_cost, special_features, title) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."language"' + AND map0.old_id = data.old_language_id + RETURNING film_id + ) + SELECT array_agg(film_id) INTO v_new_ids_film FROM inserted; + + FOR i IN 1..array_length(v_new_ids_film, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."film"', v_old_ids_film[i], v_new_ids_film[i]::TEXT); + END LOOP; + + v_old_ids_film := ARRAY['997', '175', '550', '54', '88', '213', '678', '339', '986', '701', '499', '782', '252', '985', '433', '776', '267', '218', '510', '214', '368', '513', '707', '379', '441', '738', '447', '299', '132', '407', '51', '20', '525', '828', '560', '157', '195', '434', '208', '628', '559', '573', '319', '660', '156', '417', '848', '739', '324', '181', '438', '584', '13', '765', '475', '913', '831', '210', '657', '935', '320', '646', '241', '533', '529', '240', '676', '884', '857', '127', '964', '696', '929', '902', '705', '425', '539', '591', '448', '540', '384', '289', '439', '191', '96', '304', '376', '936', '4', '984', '497', '777', '220', '994', '185', '172', '547', '835', '594', '133']; + WITH inserted AS ( + INSERT INTO "public"."film" ("description", "fulltext", "language_id", "last_update", "length", "rating", "release_year", "rental_duration", "rental_rate", "replacement_cost", "special_features", "title") + SELECT + data.description::text, + data.fulltext::tsvector, + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.length::smallint, + data.rating::mpaa_rating, + data.release_year::integer, + data.rental_duration::smallint, + data.rental_rate::numeric, + data.replacement_cost::numeric, + data.special_features::text[], + data.title::character varying + FROM (VALUES + ('A Touching Drama of a Teacher And a Cat who must Challenge a Technical Writer in A U-Boat', '''boat'':22 ''cat'':11 ''challeng'':14 ''drama'':5 ''kick'':2 ''must'':13 ''teacher'':8 ''technic'':16 ''touch'':4 ''u'':21 ''u-boat'':20 ''writer'':17 ''youth'':1', '1', '2013-05-26T14:50:58.951000', 179, 'NC-17', 2006, 4, '0.99', '14.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Youth Kick'), + ('A Stunning Epistle of a Cat And a Forensic Psychologist who must Confront a Pioneer in A Baloon', '''baloon'':20 ''candl'':2 ''cat'':8 ''confront'':15 ''confus'':1 ''epistl'':5 ''forens'':11 ''must'':14 ''pioneer'':17 ''psychologist'':12 ''stun'':4', '1', '2013-05-26T14:50:58.951000', 122, 'PG-13', 2006, 3, '2.99', '27.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Confused Candles'), + ('A Fast-Paced Reflection of a Waitress And a Hunter who must Defeat a Forensic Psychologist in A Baloon', '''apach'':2 ''baloon'':22 ''defeat'':16 ''fast'':5 ''fast-pac'':4 ''forens'':18 ''hunter'':13 ''maguir'':1 ''must'':15 ''pace'':6 ''psychologist'':19 ''reflect'':7 ''waitress'':10', '1', '2013-05-26T14:50:58.951000', 74, 'NC-17', 2006, 6, '2.99', '22.99', ARRAY['Trailers', 'Commentaries']::text[], 'Maguire Apache'), + ('A Awe-Inspiring Drama of a Car And a Pastry Chef who must Chase a Crocodile in The First Manned Space Station', '''awe'':5 ''awe-inspir'':4 ''banger'':1 ''car'':10 ''chase'':17 ''chef'':14 ''crocodil'':19 ''drama'':7 ''first'':22 ''inspir'':6 ''man'':23 ''must'':16 ''pastri'':13 ''pinocchio'':2 ''space'':24 ''station'':25', '1', '2013-05-26T14:50:58.951000', 113, 'R', 2006, 5, '0.99', '15.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Banger Pinocchio'), + ('A Touching Epistle of a Frisbee And a Husband who must Pursue a Student in Nigeria', '''born'':1 ''epistl'':5 ''frisbe'':8 ''husband'':11 ''must'':13 ''nigeria'':18 ''pursu'':14 ''spinal'':2 ''student'':16 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 179, 'PG', 2006, 7, '4.99', '17.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Born Spinal'), + ('A Touching Saga of a Composer And a Moose who must Discover a Dentist in A MySQL Convention', '''compos'':8 ''convent'':20 ''date'':1 ''dentist'':16 ''discov'':14 ''moos'':11 ''must'':13 ''mysql'':19 ''saga'':5 ''speed'':2 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 104, 'R', 2006, 4, '0.99', '19.99', ARRAY['Commentaries']::text[], 'Date Speed'), + ('A Touching Documentary of a Husband And a Boat who must Meet a Pastry Chef in A Baloon Factory', '''baloon'':20 ''boat'':11 ''chef'':17 ''documentari'':5 ''drive'':2 ''factori'':21 ''husband'':8 ''meet'':14 ''must'':13 ''pastri'':16 ''pickup'':1 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 77, 'G', 2006, 3, '2.99', '23.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Pickup Driving'), + ('A Unbelieveable Yarn of a Mad Scientist And a Cat who must Chase a Lumberjack in Australia', '''australia'':19 ''break'':2 ''cat'':12 ''chase'':15 ''frogmen'':1 ''lumberjack'':17 ''mad'':8 ''must'':14 ''scientist'':9 ''unbeliev'':4 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 111, 'R', 2006, 5, '0.99', '17.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Frogmen Breaking'), + ('A Brilliant Saga of a Boat And a Mad Scientist who must Meet a Moose in Ancient India', '''ancient'':19 ''boat'':8 ''brilliant'':4 ''india'':20 ''mad'':11 ''meet'':15 ''moos'':17 ''must'':14 ''saga'':5 ''scientist'':12 ''sea'':2 ''wonka'':1', '1', '2013-05-26T14:50:58.951000', 85, 'NC-17', 2006, 6, '2.99', '24.99', ARRAY['Trailers', 'Commentaries']::text[], 'Wonka Sea'), + ('A Amazing Panorama of a Crocodile And a Explorer who must Fight a Husband in Nigeria', '''amaz'':4 ''crocodil'':8 ''explor'':11 ''fight'':14 ''husband'':16 ''must'':13 ''nigeria'':18 ''panorama'':5 ''psycho'':1 ''shrunk'':2', '1', '2013-05-26T14:50:58.951000', 155, 'PG-13', 2006, 5, '2.99', '11.99', ARRAY['Behind the Scenes']::text[], 'Psycho Shrunk'), + ('A Action-Packed Tale of a Boy And a Lumberjack who must Chase a Madman in A Baloon', '''action'':5 ''action-pack'':4 ''baloon'':21 ''boy'':10 ''chase'':16 ''evolut'':2 ''king'':1 ''lumberjack'':13 ''madman'':18 ''must'':15 ''pack'':6 ''tale'':7', '1', '2013-05-26T14:50:58.951000', 184, 'NC-17', 2006, 3, '4.99', '24.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'King Evolution'), + ('A Fast-Paced Panorama of a Lumberjack And a Database Administrator who must Defeat a Madman in A MySQL Convention', '''administr'':14 ''convent'':23 ''databas'':13 ''defeat'':17 ''fast'':5 ''fast-pac'':4 ''lumberjack'':10 ''madman'':19 ''must'':16 ''mysql'':22 ''pace'':6 ''panorama'':7 ''saddl'':2 ''shakespear'':1', '1', '2013-05-26T14:50:58.951000', 60, 'PG-13', 2006, 6, '2.99', '26.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Shakespeare Saddle'), + ('A Epic Display of a Car And a Composer who must Overcome a Forensic Psychologist in The Gulf of Mexico', '''car'':8 ''compos'':11 ''display'':5 ''dream'':1 ''epic'':4 ''forens'':16 ''gulf'':20 ''mexico'':22 ''must'':13 ''overcom'':14 ''pickup'':2 ''psychologist'':17', '1', '2013-05-26T14:50:58.951000', 135, 'PG', 2006, 6, '2.99', '18.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Dream Pickup'), + ('A Awe-Inspiring Character Study of a Waitress And a Car who must Pursue a Mad Scientist in The First Manned Space Station', '''awe'':5 ''awe-inspir'':4 ''car'':14 ''charact'':7 ''christma'':2 ''first'':23 ''inspir'':6 ''mad'':19 ''man'':24 ''must'':16 ''pursu'':17 ''scientist'':20 ''space'':25 ''station'':26 ''studi'':8 ''waitress'':11 ''wonderland'':1', '1', '2013-05-26T14:50:58.951000', 111, 'PG', 2006, 4, '4.99', '19.99', ARRAY['Commentaries']::text[], 'Wonderland Christmas'), + ('A Stunning Display of a Mad Scientist And a Technical Writer who must Succumb a Monkey in A Shark Tank', '''display'':5 ''horn'':1 ''mad'':8 ''monkey'':18 ''must'':15 ''scientist'':9 ''shark'':21 ''stun'':4 ''succumb'':16 ''tank'':22 ''technic'':12 ''work'':2 ''writer'':13', '1', '2013-05-26T14:50:58.951000', 95, 'PG', 2006, 4, '2.99', '23.99', ARRAY['Trailers']::text[], 'Horn Working'), + ('A Astounding Story of a Cat And a Database Administrator who must Build a Technical Writer in New Orleans', '''administr'':12 ''astound'':4 ''build'':15 ''cat'':8 ''databas'':11 ''groundhog'':2 ''must'':14 ''new'':20 ''orlean'':21 ''secret'':1 ''stori'':5 ''technic'':17 ''writer'':18', '1', '2013-05-26T14:50:58.951000', 90, 'PG', 2006, 6, '4.99', '11.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Secret Groundhog'), + ('A Thoughtful Story of a Car And a Boy who must Find a A Shark in The Sahara Desert', '''boy'':11 ''car'':8 ''desert'':21 ''eagl'':1 ''find'':14 ''must'':13 ''panki'':2 ''sahara'':20 ''shark'':17 ''stori'':5 ''thought'':4', '1', '2013-05-26T14:50:58.951000', 140, 'NC-17', 2006, 4, '4.99', '14.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Eagles Panky'), + ('A Taut Story of a Moose And a Squirrel who must Build a Husband in Ancient India', '''ancient'':18 ''betray'':2 ''build'':14 ''deceiv'':1 ''husband'':16 ''india'':19 ''moos'':8 ''must'':13 ''squirrel'':11 ''stori'':5 ''taut'':4', '1', '2013-05-26T14:50:58.951000', 122, 'NC-17', 2006, 7, '0.99', '22.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Deceiver Betrayed'), + ('A Insightful Yarn of a Boy And a Sumo Wrestler who must Outgun a Car in The Outback', '''boy'':8 ''car'':17 ''insight'':4 ''lawless'':1 ''must'':14 ''outback'':20 ''outgun'':15 ''sumo'':11 ''vision'':2 ''wrestler'':12 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 181, 'G', 2006, 6, '4.99', '29.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Lawless Vision'), + ('A Beautiful Tale of a Hunter And a Mad Scientist who must Confront a Squirrel in The First Manned Space Station', '''beauti'':4 ''confront'':15 ''daughter'':1 ''first'':20 ''hunter'':8 ''mad'':11 ''madigan'':2 ''man'':21 ''must'':14 ''scientist'':12 ''space'':22 ''squirrel'':17 ''station'':23 ''tale'':5', '1', '2013-05-26T14:50:58.951000', 59, 'PG-13', 2006, 3, '4.99', '13.99', ARRAY['Trailers']::text[], 'Daughter Madigan'), + ('A Insightful Character Study of a Mad Cow And a Forensic Psychologist who must Conquer a A Shark in A Manhattan Penthouse', '''charact'':5 ''conquer'':17 ''cow'':10 ''forens'':13 ''gone'':1 ''insight'':4 ''mad'':9 ''manhattan'':23 ''must'':16 ''penthous'':24 ''psychologist'':14 ''shark'':20 ''studi'':6 ''troubl'':2', '1', '2013-05-26T14:50:58.951000', 84, 'R', 2006, 7, '2.99', '20.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Gone Trouble'), + ('A Fateful Reflection of a Dog And a Mad Cow who must Outrace a Teacher in An Abandoned Mine Shaft', '''abandon'':20 ''cow'':12 ''dog'':8 ''dwarf'':2 ''fate'':4 ''leatherneck'':1 ''mad'':11 ''mine'':21 ''must'':14 ''outrac'':15 ''reflect'':5 ''shaft'':22 ''teacher'':17', '1', '2013-05-26T14:50:58.951000', 153, 'PG-13', 2006, 6, '2.99', '21.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Leathernecks Dwarfs'), + ('A Fateful Drama of a Husband And a Sumo Wrestler who must Battle a Pastry Chef in A Baloon Factory', '''baloon'':21 ''battl'':15 ''chef'':18 ''drama'':5 ''factori'':22 ''fate'':4 ''husband'':8 ''mussolini'':2 ''must'':14 ''pastri'':17 ''quest'':1 ''sumo'':11 ''wrestler'':12', '1', '2013-05-26T14:50:58.951000', 177, 'R', 2006, 5, '2.99', '29.99', ARRAY['Behind the Scenes']::text[], 'Quest Mussolini'), + ('A Amazing Reflection of a A Shark And a Butler who must Chase a Hunter in The Canadian Rockies', '''amaz'':4 ''butler'':12 ''canadian'':20 ''chase'':15 ''greedi'':1 ''hunter'':17 ''must'':14 ''reflect'':5 ''rocki'':21 ''root'':2 ''shark'':9', '1', '2013-05-26T14:50:58.951000', 166, 'R', 2006, 7, '0.99', '14.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Greedy Roots'), + ('A Emotional Drama of a Mad Cow And a Boat who must Redeem a Secret Agent in A Shark Tank', '''agent'':18 ''alter'':2 ''boat'':12 ''cow'':9 ''drama'':5 ''emot'':4 ''hunter'':1 ''mad'':8 ''must'':14 ''redeem'':15 ''secret'':17 ''shark'':21 ''tank'':22', '1', '2013-05-26T14:50:58.951000', 125, 'PG-13', 2006, 5, '2.99', '21.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Hunter Alter'), + ('A Awe-Inspiring Character Study of a Robot And a Sumo Wrestler who must Discover a Womanizer in A Shark Tank', '''awe'':5 ''awe-inspir'':4 ''charact'':7 ''discov'':18 ''inspir'':6 ''mother'':2 ''must'':17 ''robot'':11 ''rocket'':1 ''shark'':23 ''studi'':8 ''sumo'':14 ''tank'':24 ''woman'':20 ''wrestler'':15', '1', '2013-05-26T14:50:58.951000', 178, 'PG-13', 2006, 3, '0.99', '27.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Rocketeer Mother'), + ('A Fast-Paced Tale of a Butler And a Moose who must Overcome a Pioneer in A Manhattan Penthouse', '''butler'':10 ''cross'':2 ''fast'':5 ''fast-pac'':4 ''ice'':1 ''manhattan'':21 ''moos'':13 ''must'':15 ''overcom'':16 ''pace'':6 ''penthous'':22 ''pioneer'':18 ''tale'':7', '1', '2013-05-26T14:50:58.951000', 131, 'R', 2006, 5, '2.99', '28.99', ARRAY['Deleted Scenes']::text[], 'Ice Crossing'), + ('A Action-Packed Saga of a Teacher And a Frisbee who must Escape a Lumberjack in The Sahara Desert', '''action'':5 ''action-pack'':4 ''desert'':22 ''dragon'':2 ''escap'':16 ''factori'':1 ''frisbe'':13 ''lumberjack'':18 ''must'':15 ''pack'':6 ''saga'':7 ''sahara'':21 ''teacher'':10', '1', '2013-05-26T14:50:58.951000', 144, 'PG-13', 2006, 4, '0.99', '9.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Factory Dragon'), + ('A Beautiful Documentary of a Boy And a Robot who must Discover a Squirrel in Australia', '''australia'':18 ''beauti'':4 ''boy'':8 ''chainsaw'':1 ''discov'':14 ''documentari'':5 ''must'':13 ''robot'':11 ''squirrel'':16 ''uptown'':2', '1', '2013-05-26T14:50:58.951000', 114, 'PG', 2006, 6, '0.99', '25.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Chainsaw Uptown'), + ('A Action-Packed Drama of a Mad Scientist And a Composer who must Outgun a Car in Australia', '''action'':5 ''action-pack'':4 ''australia'':21 ''car'':19 ''chill'':2 ''compos'':14 ''drama'':7 ''hawk'':1 ''mad'':10 ''must'':16 ''outgun'':17 ''pack'':6 ''scientist'':11', '1', '2013-05-26T14:50:58.951000', 47, 'PG-13', 2006, 5, '0.99', '12.99', ARRAY['Behind the Scenes']::text[], 'Hawk Chill'), + ('A Insightful Panorama of a Forensic Psychologist And a Mad Cow who must Build a Mad Scientist in The First Manned Space Station', '''balloon'':1 ''build'':16 ''cow'':13 ''first'':22 ''forens'':8 ''homeward'':2 ''insight'':4 ''mad'':12,18 ''man'':23 ''must'':15 ''panorama'':5 ''psychologist'':9 ''scientist'':19 ''space'':24 ''station'':25', '1', '2013-05-26T14:50:58.951000', 75, 'NC-17', 2006, 5, '2.99', '10.99', ARRAY['Deleted Scenes']::text[], 'Balloon Homeward'), + ('A Boring Drama of a Woman And a Squirrel who must Conquer a Student in A Baloon', '''ameli'':1 ''baloon'':19 ''bore'':4 ''conquer'':14 ''drama'':5 ''hellfight'':2 ''must'':13 ''squirrel'':11 ''student'':16 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 79, 'R', 2006, 4, '4.99', '23.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Amelie Hellfighters'), + ('A Boring Epistle of a Pioneer And a Mad Scientist who must Escape a Frisbee in The Gulf of Mexico', '''bore'':4 ''epistl'':5 ''escap'':15 ''frisbe'':17 ''gulf'':20 ''legal'':2 ''loath'':1 ''mad'':11 ''mexico'':22 ''must'':14 ''pioneer'':8 ''scientist'':12', '1', '2013-05-26T14:50:58.951000', 140, 'R', 2006, 4, '0.99', '29.99', ARRAY['Deleted Scenes']::text[], 'Loathing Legally'), + ('A Lacklusture Epistle of a Dentist And a Technical Writer who must Find a Dog in A Monastery', '''dentist'':8 ''dog'':17 ''element'':2 ''epistl'':5 ''find'':15 ''lacklustur'':4 ''monasteri'':20 ''must'':14 ''spike'':1 ''technic'':11 ''writer'':12', '1', '2013-05-26T14:50:58.951000', 79, 'G', 2006, 7, '2.99', '12.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Spiking Element'), + ('A Boring Drama of a Car And a Dog who must Succumb a Madman in Soviet Georgia', '''bore'':4 ''car'':8 ''dog'':11 ''drama'':5 ''georgia'':19 ''madman'':16 ''mar'':1 ''must'':13 ''roman'':2 ''soviet'':18 ''succumb'':14', '1', '2013-05-26T14:50:58.951000', 62, 'NC-17', 2006, 6, '0.99', '21.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Mars Roman'), + ('A Insightful Documentary of a Technical Writer And a Feminist who must Challenge a Cat in A Baloon', '''baloon'':20 ''cat'':17 ''challeng'':15 ''clockwork'':1 ''documentari'':5 ''feminist'':12 ''insight'':4 ''must'':14 ''paradis'':2 ''technic'':8 ''writer'':9', '1', '2013-05-26T14:50:58.951000', 143, 'PG-13', 2006, 7, '0.99', '29.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Clockwork Paradise'), + ('A Intrepid Documentary of a Astronaut And a Forensic Psychologist who must Find a Frisbee in An Abandoned Fun House', '''abandon'':20 ''astronaut'':8 ''crowd'':1 ''documentari'':5 ''find'':15 ''forens'':11 ''frisbe'':17 ''fun'':21 ''hous'':22 ''intrepid'':4 ''must'':14 ''psychologist'':12 ''telemark'':2', '1', '2013-05-26T14:50:58.951000', 112, 'R', 2006, 3, '4.99', '16.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Crowds Telemark'), + ('A Touching Documentary of a A Shark And a Car who must Build a Husband in Nigeria', '''build'':15 ''car'':12 ''documentari'':5 ''horror'':1 ''husband'':17 ''must'':14 ''nigeria'':19 ''reign'':2 ''shark'':9 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 139, 'R', 2006, 3, '0.99', '25.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Horror Reign'), + ('A Fateful Story of a Robot And a Dentist who must Defeat a Astronaut in New Orleans', '''astronaut'':16 ''dare'':1 ''defeat'':14 ''dentist'':11 ''fate'':4 ''must'':13 ''new'':18 ''orlean'':19 ''pluto'':2 ''robot'':8 ''stori'':5', '1', '2013-05-26T14:50:58.951000', 89, 'PG-13', 2006, 7, '2.99', '16.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Dares Pluto'), + ('A Boring Character Study of a Boy And a A Shark who must Outrace a Womanizer in The Outback', '''bore'':4 ''boy'':9 ''charact'':5 ''must'':15 ''northwest'':1 ''outback'':21 ''outrac'':16 ''polish'':2 ''shark'':13 ''studi'':6 ''woman'':18', '1', '2013-05-26T14:50:58.951000', 172, 'PG', 2006, 5, '2.99', '24.99', ARRAY['Trailers']::text[], 'Northwest Polish'), + ('A Fanciful Story of a Womanizer And a Dog who must Face a Forensic Psychologist in The Sahara Desert', '''desert'':21 ''dog'':11 ''face'':14 ''fanci'':4 ''forens'':16 ''go'':2 ''marri'':1 ''must'':13 ''psychologist'':17 ''sahara'':20 ''stori'':5 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 114, 'G', 2006, 7, '2.99', '22.99', ARRAY['Behind the Scenes']::text[], 'Married Go'), + ('A Touching Character Study of a Boat And a Student who must Sink a A Shark in Nigeria', '''boat'':9 ''charact'':5 ''microcosmo'':1 ''must'':14 ''nigeria'':20 ''paradis'':2 ''shark'':18 ''sink'':15 ''student'':12 ''studi'':6 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 105, 'PG-13', 2006, 6, '2.99', '22.99', ARRAY['Commentaries']::text[], 'Microcosmos Paradise'), + ('A Touching Display of a Feminist And a Girl who must Confront a Astronaut in Australia', '''astronaut'':16 ''australia'':18 ''confront'':14 ''display'':5 ''feminist'':8 ''fish'':1 ''girl'':11 ''must'':13 ''opus'':2 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 125, 'R', 2006, 4, '2.99', '22.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Fish Opus'), + ('A Fateful Display of a Technical Writer And a Butler who must Battle a Sumo Wrestler in An Abandoned Mine Shaft', '''abandon'':21 ''battl'':15 ''butler'':12 ''display'':5 ''fate'':4 ''knock'':2 ''mine'':22 ''must'':14 ''parti'':1 ''shaft'':23 ''sumo'':17 ''technic'':8 ''wrestler'':18 ''writer'':9', '1', '2013-05-26T14:50:58.951000', 107, 'PG', 2006, 7, '2.99', '11.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Party Knock'), + ('A Thrilling Display of a Sumo Wrestler And a Girl who must Confront a Man in A Baloon', '''angel'':2 ''baloon'':20 ''clerk'':1 ''confront'':15 ''display'':5 ''girl'':12 ''man'':17 ''must'':14 ''sumo'':8 ''thrill'':4 ''wrestler'':9', '1', '2013-05-26T14:50:58.951000', 164, 'G', 2006, 3, '4.99', '15.99', ARRAY['Commentaries']::text[], 'Clerks Angels'), + ('A Epic Display of a Hunter And a Feminist who must Sink a Car in A U-Boat', '''boat'':21 ''car'':16 ''display'':5 ''epic'':4 ''feminist'':11 ''hill'':1 ''hunter'':8 ''must'':13 ''neighbor'':2 ''sink'':14 ''u'':20 ''u-boat'':19', '1', '2013-05-26T14:50:58.951000', 93, 'G', 2006, 5, '0.99', '29.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Hills Neighbors'), + ('A Intrepid Drama of a Astronaut And a Crocodile who must Find a Boat in Soviet Georgia', '''astronaut'':8 ''boat'':16 ''crocodil'':11 ''drama'':5 ''find'':14 ''fire'':2 ''georgia'':19 ''intrepid'':4 ''must'':13 ''soviet'':18 ''stone'':1', '1', '2013-05-26T14:50:58.951000', 94, 'G', 2006, 3, '0.99', '19.99', ARRAY['Trailers']::text[], 'Stone Fire'), + ('A Fast-Paced Display of a Squirrel And a Explorer who must Outgun a Mad Scientist in Nigeria', '''display'':7 ''explor'':13 ''fast'':5 ''fast-pac'':4 ''mad'':18 ''must'':15 ''nigeria'':21 ''outgun'':16 ''pace'':6 ''rocki'':1 ''scientist'':19 ''squirrel'':10 ''war'':2', '1', '2013-05-26T14:50:58.951000', 145, 'PG-13', 2006, 4, '4.99', '17.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Rocky War'), + ('A Fateful Story of a Husband And a Moose who must Vanquish a Boy in California', '''boy'':16 ''california'':18 ''fate'':4 ''flintston'':1 ''happi'':2 ''husband'':8 ''moos'':11 ''must'':13 ''stori'':5 ''vanquish'':14', '1', '2013-05-26T14:50:58.951000', 148, 'PG-13', 2006, 3, '4.99', '11.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Flintstones Happiness'), + ('A Insightful Display of a A Shark And a Monkey who must Face a Database Administrator in Ancient India', '''administr'':18 ''ancient'':20 ''anonym'':2 ''contact'':1 ''databas'':17 ''display'':5 ''face'':15 ''india'':21 ''insight'':4 ''monkey'':12 ''must'':14 ''shark'':9', '1', '2013-05-26T14:50:58.951000', 166, 'PG-13', 2006, 7, '2.99', '10.99', ARRAY['Commentaries']::text[], 'Contact Anonymous'), + ('A Beautiful Reflection of a Womanizer And a Sumo Wrestler who must Chase a Database Administrator in The Gulf of Mexico', '''administr'':18 ''beauti'':4 ''chase'':15 ''databas'':17 ''graffiti'':2 ''gulf'':21 ''human'':1 ''mexico'':23 ''must'':14 ''reflect'':5 ''sumo'':11 ''woman'':8 ''wrestler'':12', '1', '2013-05-26T14:50:58.951000', 68, 'NC-17', 2006, 3, '2.99', '22.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Human Graffiti'), + ('A Taut Drama of a Womanizer And a Lumberjack who must Succumb a Pioneer in Ancient India', '''ancient'':18 ''door'':2 ''drama'':5 ''india'':19 ''lumberjack'':11 ''mix'':1 ''must'':13 ''pioneer'':16 ''succumb'':14 ''taut'':4 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 180, 'PG-13', 2006, 6, '2.99', '26.99', ARRAY['Behind the Scenes']::text[], 'Mixed Doors'), + ('A Action-Packed Drama of a Dentist And a Crocodile who must Battle a Feminist in The Canadian Rockies', '''action'':5 ''action-pack'':4 ''ali'':1 ''battl'':16 ''canadian'':21 ''crocodil'':13 ''dentist'':10 ''drama'':7 ''feminist'':18 ''forev'':2 ''must'':15 ''pack'':6 ''rocki'':22', '1', '2013-05-26T14:50:58.951000', 150, 'PG', 2006, 4, '4.99', '21.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Ali Forever'), + ('A Fateful Epistle of a Butler And a Boy who must Redeem a Teacher in Berlin', '''berlin'':18 ''boy'':11 ''butler'':8 ''epistl'':5 ''fate'':4 ''must'':13 ''name'':2 ''redeem'':14 ''saturn'':1 ''teacher'':16', '1', '2013-05-26T14:50:58.951000', 182, 'R', 2006, 7, '4.99', '18.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Saturn Name'), + ('A Awe-Inspiring Epistle of a Feminist And a Girl who must Sink a Girl in The Outback', '''awe'':5 ''awe-inspir'':4 ''epistl'':7 ''feminist'':10 ''girl'':13,18 ''inspir'':6 ''japanes'':1 ''must'':15 ''outback'':21 ''run'':2 ''sink'':16', '1', '2013-05-26T14:50:58.951000', 135, 'G', 2006, 6, '0.99', '29.99', ARRAY['Deleted Scenes']::text[], 'Japanese Run'), + ('A Fanciful Drama of a Monkey And a Feminist who must Sink a Man in Berlin', '''berlin'':18 ''drama'':5 ''fanci'':4 ''feminist'':11 ''man'':16 ''metal'':2 ''monkey'':8 ''must'':13 ''sink'':14 ''trooper'':1', '1', '2013-05-26T14:50:58.951000', 115, 'R', 2006, 3, '0.99', '20.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Troopers Metal'), + ('A Taut Story of a Waitress And a Man who must Face a Car in A Baloon Factory', '''baloon'':19 ''car'':16 ''casualti'':2 ''face'':14 ''factori'':20 ''man'':11 ''must'':13 ''spirit'':1 ''stori'':5 ''taut'':4 ''waitress'':8', '1', '2013-05-26T14:50:58.951000', 138, 'PG-13', 2006, 5, '0.99', '20.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Spirited Casualties'), + ('A Stunning Reflection of a Frisbee And a Husband who must Redeem a Dog in New Orleans', '''darko'':1 ''dog'':16 ''dorado'':2 ''frisbe'':8 ''husband'':11 ''must'':13 ''new'':18 ''orlean'':19 ''redeem'':14 ''reflect'':5 ''stun'':4', '1', '2013-05-26T14:50:58.951000', 130, 'NC-17', 2006, 3, '4.99', '13.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Darko Dorado'), + ('A Intrepid Yarn of a Car And a Moose who must Outrace a Crocodile in A Manhattan Penthouse', '''car'':8 ''crocodil'':16 ''intrepid'':4 ''manhattan'':19 ''moos'':11 ''must'':13 ''outrac'':14 ''paradis'':1 ''penthous'':20 ''sabrina'':2 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 48, 'PG-13', 2006, 5, '2.99', '12.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Paradise Sabrina'), + ('A Intrepid Character Study of a Squirrel And a A Shark who must Kill a Lumberjack in California', '''california'':20 ''charact'':5 ''garden'':2 ''intrepid'':4 ''kill'':16 ''lumberjack'':18 ''must'':15 ''shark'':13 ''squirrel'':9 ''studi'':6 ''vanish'':1', '1', '2013-05-26T14:50:58.951000', 142, 'R', 2006, 5, '0.99', '17.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Vanished Garden'), + ('A Fast-Paced Reflection of a Composer And a Composer who must Meet a Cat in The Sahara Desert', '''cat'':18 ''compos'':10,13 ''connecticut'':2 ''desert'':22 ''fast'':5 ''fast-pac'':4 ''flamingo'':1 ''meet'':16 ''must'':15 ''pace'':6 ''reflect'':7 ''sahara'':21', '1', '2013-05-26T14:50:58.951000', 80, 'PG-13', 2006, 4, '4.99', '28.99', ARRAY['Trailers']::text[], 'Flamingos Connecticut'), + ('A Unbelieveable Yarn of a Database Administrator And a Woman who must Succumb a A Shark in A U-Boat', '''administr'':9 ''boat'':23 ''databas'':8 ''divin'':2 ''must'':14 ''outbreak'':1 ''shark'':18 ''succumb'':15 ''u'':22 ''u-boat'':21 ''unbeliev'':4 ''woman'':12 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 169, 'NC-17', 2006, 6, '0.99', '12.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Outbreak Divine'), + ('A Awe-Inspiring Tale of a Butler And a Frisbee who must Vanquish a Teacher in Ancient Japan', '''alley'':2 ''ancient'':20 ''awe'':5 ''awe-inspir'':4 ''butler'':10 ''donni'':1 ''frisbe'':13 ''inspir'':6 ''japan'':21 ''must'':15 ''tale'':7 ''teacher'':18 ''vanquish'':16', '1', '2013-05-26T14:50:58.951000', 125, 'NC-17', 2006, 4, '0.99', '20.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Donnie Alley'), + ('A Emotional Character Study of a Robot And a A Shark who must Defeat a Technical Writer in A Manhattan Penthouse', '''bird'':2 ''charact'':5 ''defeat'':16 ''emot'':4 ''lost'':1 ''manhattan'':22 ''must'':15 ''penthous'':23 ''robot'':9 ''shark'':13 ''studi'':6 ''technic'':18 ''writer'':19', '1', '2013-05-26T14:50:58.951000', 98, 'PG-13', 2006, 4, '2.99', '21.99', ARRAY['Deleted Scenes']::text[], 'Lost Bird'), + ('A Intrepid Story of a Student And a Dog who must Challenge a Explorer in Soviet Georgia', '''challeng'':14 ''dog'':11 ''eleph'':2 ''explor'':16 ''georgia'':19 ''intrepid'':4 ''lone'':1 ''must'':13 ''soviet'':18 ''stori'':5 ''student'':8', '1', '2013-05-26T14:50:58.951000', 67, 'G', 2006, 3, '2.99', '12.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Lonely Elephant'), + ('A Thrilling Display of a Pioneer And a Frisbee who must Escape a Teacher in The Outback', '''display'':5 ''doll'':1 ''escap'':14 ''frisbe'':11 ''must'':13 ''outback'':19 ''pioneer'':8 ''rage'':2 ''teacher'':16 ''thrill'':4', '1', '2013-05-26T14:50:58.951000', 120, 'PG-13', 2006, 7, '2.99', '10.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Dolls Rage'), + ('A Taut Yarn of a Hunter And a Astronaut who must Conquer a Database Administrator in The Sahara Desert', '''administr'':17 ''astronaut'':11 ''conquer'':14 ''databas'':16 ''desert'':21 ''hunter'':8 ''must'':13 ''philadelphia'':1 ''sahara'':20 ''taut'':4 ''wife'':2 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 137, 'PG-13', 2006, 7, '4.99', '16.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Philadelphia Wife'), + ('A Touching Story of a Crocodile And a Girl who must Sink a Man in The Gulf of Mexico', '''club'':2 ''crocodil'':8 ''girl'':11 ''gulf'':19 ''man'':16 ''mexico'':21 ''must'':13 ''sink'':14 ''stori'':5 ''termin'':1 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 88, 'R', 2006, 5, '4.99', '11.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Terminator Club'), + ('A Touching Reflection of a Crocodile And a Dog who must Chase a Hunter in An Abandoned Fun House', '''abandon'':19 ''chase'':14 ''crocodil'':8 ''dog'':11 ''fun'':20 ''hous'':21 ''hunter'':16 ''must'':13 ''reflect'':5 ''scarfac'':2 ''strict'':1 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 144, 'PG-13', 2006, 3, '2.99', '24.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Strictly Scarface'), + ('A Fast-Paced Panorama of a Girl And a A Shark who must Confront a Boy in Ancient India', '''ancient'':21 ''boy'':19 ''cat'':1 ''conehead'':2 ''confront'':17 ''fast'':5 ''fast-pac'':4 ''girl'':10 ''india'':22 ''must'':16 ''pace'':6 ''panorama'':7 ''shark'':14', '1', '2013-05-26T14:50:58.951000', 112, 'G', 2006, 5, '4.99', '14.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Cat Coneheads'), + ('A Unbelieveable Documentary of a Dentist And a Technical Writer who must Build a Womanizer in Nigeria', '''build'':15 ''deliver'':2 ''dentist'':8 ''documentari'':5 ''must'':14 ''nigeria'':19 ''technic'':11 ''unbeliev'':4 ''waterfront'':1 ''woman'':17 ''writer'':12', '1', '2013-05-26T14:50:58.951000', 61, 'G', 2006, 4, '4.99', '17.99', ARRAY['Behind the Scenes']::text[], 'Waterfront Deliverance'), + ('A Thoughtful Drama of a A Shark And a Forensic Psychologist who must Vanquish a Student in Ancient India', '''alamo'':2 ''ancient'':20 ''drama'':5 ''forens'':12 ''india'':21 ''must'':15 ''pride'':1 ''psychologist'':13 ''shark'':9 ''student'':18 ''thought'':4 ''vanquish'':16', '1', '2013-05-26T14:50:58.951000', 114, 'NC-17', 2006, 6, '0.99', '20.99', ARRAY['Deleted Scenes']::text[], 'Pride Alamo'), + ('A Touching Display of a Explorer And a Lumberjack who must Fight a Forensic Psychologist in A Shark Tank', '''display'':5 ''explor'':8 ''fight'':14 ''forens'':16 ''lumberjack'':11 ''must'':13 ''psychologist'':17 ''shark'':20 ''tank'':21 ''touch'':4 ''untouch'':2 ''usual'':1', '1', '2013-05-26T14:50:58.951000', 128, 'PG-13', 2006, 5, '4.99', '21.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Usual Untouchables'), + ('A Emotional Character Study of a Student And a Explorer who must Discover a Frisbee in The First Manned Space Station', '''charact'':5 ''discov'':15 ''emot'':4 ''explor'':12 ''first'':20 ''frisbe'':17 ''man'':21 ''must'':14 ''pinocchio'':2 ''space'':22 ''station'':23 ''student'':9 ''studi'':6 ''trade'':1', '1', '2013-05-26T14:50:58.951000', 170, 'PG', 2006, 6, '4.99', '22.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Trading Pinocchio'), + ('A Boring Display of a Pastry Chef And a Sumo Wrestler who must Discover a Frisbee in An Abandoned Amusement Park', '''abandon'':21 ''amus'':22 ''bore'':4 ''chef'':9 ''discov'':16 ''display'':5 ''frisbe'':18 ''movi'':2 ''must'':15 ''park'':23 ''pastri'':8 ''purpl'':1 ''sumo'':12 ''wrestler'':13', '1', '2013-05-26T14:50:58.951000', 88, 'R', 2006, 4, '2.99', '9.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Purple Movie'), + ('A Action-Packed Display of a Feminist And a Pioneer who must Pursue a Dog in A Baloon Factory', '''action'':5 ''action-pack'':4 ''baloon'':21 ''display'':7 ''dog'':18 ''factori'':22 ''feminist'':10 ''holi'':1 ''must'':15 ''pack'':6 ''pioneer'':13 ''pursu'':16 ''tadpol'':2', '1', '2013-05-26T14:50:58.951000', 88, 'R', 2006, 6, '0.99', '20.99', ARRAY['Behind the Scenes']::text[], 'Holy Tadpole'), + ('A Boring Display of a Moose And a Squirrel who must Outrace a Teacher in A Shark Tank', '''bore'':4 ''display'':5 ''luck'':1 ''moos'':8 ''must'':13 ''opus'':2 ''outrac'':14 ''shark'':19 ''squirrel'':11 ''tank'':20 ''teacher'':16', '1', '2013-05-26T14:50:58.951000', 152, 'NC-17', 2006, 7, '2.99', '21.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Luck Opus'), + ('A Astounding Tale of a Crocodile And a Car who must Outrace a Squirrel in A U-Boat', '''astound'':4 ''boat'':21 ''car'':11 ''caus'':2 ''crocodil'':8 ''monsoon'':1 ''must'':13 ''outrac'':14 ''squirrel'':16 ''tale'':5 ''u'':20 ''u-boat'':19', '1', '2013-05-26T14:50:58.951000', 182, 'PG', 2006, 6, '4.99', '20.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Monsoon Cause'), + ('A Fast-Paced Drama of a Student And a Crocodile who must Meet a Database Administrator in The Outback', '''administr'':19 ''crocodil'':13 ''databas'':18 ''drama'':7 ''fast'':5 ''fast-pac'':4 ''idaho'':1 ''love'':2 ''meet'':16 ''must'':15 ''outback'':22 ''pace'':6 ''student'':10', '1', '2013-05-26T14:50:58.951000', 172, 'PG-13', 2006, 3, '2.99', '25.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Idaho Love'), + ('A Lacklusture Character Study of a A Shark And a Man who must Find a Forensic Psychologist in A U-Boat', '''boat'':24 ''charact'':5 ''find'':16 ''fli'':2 ''forens'':18 ''lacklustur'':4 ''lucki'':1 ''man'':13 ''must'':15 ''psychologist'':19 ''shark'':10 ''studi'':6 ''u'':23 ''u-boat'':22', '1', '2013-05-26T14:50:58.951000', 97, 'PG-13', 2006, 7, '2.99', '10.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Lucky Flying'), + ('A Epic Drama of a Cat And a Explorer who must Redeem a Moose in Australia', '''australia'':18 ''cat'':8 ''drama'':5 ''epic'':4 ''explor'':11 ''gross'':1 ''moos'':16 ''must'':13 ''redeem'':14 ''wonder'':2', '1', '2013-05-26T14:50:58.951000', 49, 'R', 2006, 5, '4.99', '19.99', ARRAY['Behind the Scenes']::text[], 'Grosse Wonderful'), + ('A Awe-Inspiring Yarn of a Pastry Chef And a Database Administrator who must Challenge a Teacher in A Baloon', '''administr'':15 ''awe'':5 ''awe-inspir'':4 ''baloon'':23 ''challeng'':18 ''chef'':11 ''databas'':14 ''eve'':1 ''inspir'':6 ''must'':17 ''pastri'':10 ''resurrect'':2 ''teacher'':20 ''yarn'':7', '1', '2013-05-26T14:50:58.951000', 66, 'G', 2006, 5, '4.99', '25.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Eve Resurrection'), + ('A Touching Yarn of a Frisbee And a Dentist who must Fight a Composer in Ancient Japan', '''ancient'':18 ''compos'':16 ''dentist'':11 ''fight'':14 ''frisbe'':8 ''hunchback'':1 ''imposs'':2 ''japan'':19 ''must'':13 ''touch'':4 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 151, 'PG-13', 2006, 4, '4.99', '28.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Hunchback Impossible'), + ('A Unbelieveable Drama of a Hunter And a Database Administrator who must Battle a Crocodile in An Abandoned Amusement Park', '''abandon'':20 ''administr'':12 ''amus'':21 ''battl'':15 ''crocodil'':17 ''crook'':1 ''databas'':11 ''drama'':5 ''frogmen'':2 ''hunter'':8 ''must'':14 ''park'':22 ''unbeliev'':4', '1', '2013-05-26T14:50:58.951000', 143, 'PG-13', 2006, 6, '0.99', '27.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Crooked Frogmen'), + ('A Beautiful Display of a Secret Agent And a Monkey who must Battle a Sumo Wrestler in An Abandoned Mine Shaft', '''abandon'':21 ''agent'':9 ''battl'':15 ''beauti'':4 ''break'':1 ''display'':5 ''home'':2 ''mine'':22 ''monkey'':12 ''must'':14 ''secret'':8 ''shaft'':23 ''sumo'':17 ''wrestler'':18', '1', '2013-05-26T14:50:58.951000', 169, 'PG-13', 2006, 4, '2.99', '21.99', ARRAY['Trailers', 'Commentaries']::text[], 'Breaking Home'), + ('A Thrilling Reflection of a Pastry Chef And a Crocodile who must Reach a Teacher in The Outback', '''chef'':9 ''crocodil'':12 ''fargo'':1 ''gandhi'':2 ''must'':14 ''outback'':20 ''pastri'':8 ''reach'':15 ''reflect'':5 ''teacher'':17 ''thrill'':4', '1', '2013-05-26T14:50:58.951000', 130, 'G', 2006, 3, '2.99', '28.99', ARRAY['Deleted Scenes']::text[], 'Fargo Gandhi'), + ('A Boring Yarn of a Mad Cow And a Sumo Wrestler who must Meet a Robot in Australia', '''australia'':20 ''bore'':4 ''cow'':9 ''furi'':2 ''grape'':1 ''mad'':8 ''meet'':16 ''must'':15 ''robot'':18 ''sumo'':12 ''wrestler'':13 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 155, 'G', 2006, 4, '0.99', '20.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Grapes Fury'), + ('A Brilliant Reflection of a Man And a Woman who must Conquer a Pioneer in A MySQL Convention', '''brilliant'':4 ''conquer'':14 ''convent'':20 ''man'':8 ''must'':13 ''mysql'':19 ''pioneer'':16 ''reflect'':5 ''rocki'':2 ''vanish'':1 ''woman'':11', '1', '2013-05-26T14:50:58.951000', 123, 'NC-17', 2006, 3, '2.99', '21.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Vanishing Rocky'), + ('A Fanciful Documentary of a Frisbee And a Lumberjack who must Chase a Monkey in A Shark Tank', '''affair'':1 ''chase'':14 ''documentari'':5 ''fanci'':4 ''frisbe'':8 ''lumberjack'':11 ''monkey'':16 ''must'':13 ''prejudic'':2 ''shark'':19 ''tank'':20', '1', '2013-05-26T14:50:58.951000', 117, 'G', 2006, 5, '2.99', '26.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Affair Prejudice'), + ('A Boring Panorama of a Woman And a Madman who must Overcome a Butler in A U-Boat', '''boat'':21 ''bore'':4 ''butler'':16 ''drop'':2 ''madman'':11 ''must'':13 ''overcom'':14 ''panorama'':5 ''u'':20 ''u-boat'':19 ''woman'':8 ''wonder'':1', '1', '2013-05-26T14:50:58.951000', 126, 'NC-17', 2006, 3, '2.99', '20.99', ARRAY['Commentaries']::text[], 'Wonderful Drop'), + ('A Touching Display of a Hunter And a Secret Agent who must Redeem a Husband in The Outback', '''agent'':12 ''brotherhood'':2 ''display'':5 ''hunter'':8 ''husband'':17 ''kill'':1 ''must'':14 ''outback'':20 ''redeem'':15 ''secret'':11 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 54, 'G', 2006, 4, '0.99', '15.99', ARRAY['Trailers', 'Commentaries']::text[], 'Kill Brotherhood'), + ('A Action-Packed Panorama of a Mad Cow And a Composer who must Discover a Robot in A Baloon Factory', '''action'':5 ''action-pack'':4 ''baloon'':22 ''compos'':14 ''cow'':11 ''discov'':17 ''factori'':23 ''mad'':10 ''must'':16 ''pack'':6 ''panorama'':7 ''robot'':19 ''roug'':2 ''secretari'':1', '1', '2013-05-26T14:50:58.951000', 158, 'PG', 2006, 5, '4.99', '10.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Secretary Rouge'), + ('A Thoughtful Story of a Mad Cow And a Womanizer who must Overcome a Mad Scientist in Soviet Georgia', '''cow'':9 ''deer'':1 ''georgia'':21 ''mad'':8,17 ''must'':14 ''overcom'':15 ''scientist'':18 ''soviet'':20 ''stori'':5 ''thought'':4 ''virginian'':2 ''woman'':12', '1', '2013-05-26T14:50:58.951000', 106, 'NC-17', 2006, 7, '2.99', '13.99', ARRAY['Deleted Scenes']::text[], 'Deer Virginian'), + ('A Awe-Inspiring Panorama of a Robot And a Boat who must Overcome a Feminist in A U-Boat', '''awe'':5 ''awe-inspir'':4 ''boat'':13,23 ''feminist'':18 ''inspir'':6 ''must'':15 ''overcom'':16 ''panorama'':7 ''robot'':10 ''storm'':2 ''u'':22 ''u-boat'':21 ''wyom'':1', '1', '2013-05-26T14:50:58.951000', 100, 'PG-13', 2006, 6, '4.99', '29.99', ARRAY['Deleted Scenes']::text[], 'Wyoming Storm'), + ('A Astounding Drama of a Boy And a Lumberjack who must Fight a Butler in A Baloon', '''astound'':4 ''baloon'':19 ''boy'':8 ''butler'':16 ''cowboy'':1 ''doom'':2 ''drama'':5 ''fight'':14 ''lumberjack'':11 ''must'':13', '1', '2013-05-26T14:50:58.951000', 146, 'PG', 2006, 3, '2.99', '10.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Cowboy Doom'), + ('A Touching Story of a Womanizer And a Composer who must Pursue a Husband in Nigeria', '''compos'':11 ''conehead'':1 ''husband'':16 ''must'':13 ''nigeria'':18 ''pursu'':14 ''smoochi'':2 ''stori'':5 ''touch'':4 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 112, 'NC-17', 2006, 7, '4.99', '12.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Coneheads Smoochy'), + ('A Touching Documentary of a Pastry Chef And a Pastry Chef who must Build a Mad Scientist in California', '''build'':16 ''california'':21 ''chef'':9,13 ''documentari'':5 ''mad'':18 ''magic'':1 ''mallrat'':2 ''must'':15 ''pastri'':8,12 ''scientist'':19 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 117, 'PG', 2006, 3, '0.99', '19.99', ARRAY['Trailers', 'Commentaries']::text[], 'Magic Mallrats'), + ('A Thrilling Documentary of a Feminist And a Feminist who must Confront a Feminist in A Baloon', '''baloon'':19 ''confront'':14 ''documentari'':5 ''feminist'':8,11,16 ''mile'':2 ''must'':13 ''spi'':1 ''thrill'':4', '1', '2013-05-26T14:50:58.951000', 112, 'PG-13', 2006, 6, '2.99', '13.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Spy Mile'), + ('A Thrilling Reflection of a Waitress And a Butler who must Battle a Butler in A Jet Boat', '''battl'':14 ''boat'':20 ''butler'':11,16 ''command'':2 ''jet'':19 ''montezuma'':1 ''must'':13 ''reflect'':5 ''thrill'':4 ''waitress'':8', '1', '2013-05-26T14:50:58.951000', 126, 'NC-17', 2006, 6, '0.99', '22.99', ARRAY['Trailers']::text[], 'Montezuma Command'), + ('A Fateful Reflection of a Moose And a Husband who must Overcome a Monkey in Nigeria', '''chamber'':1 ''fate'':4 ''husband'':11 ''italian'':2 ''monkey'':16 ''moos'':8 ''must'':13 ''nigeria'':18 ''overcom'':14 ''reflect'':5', '1', '2013-05-26T14:50:58.951000', 117, 'NC-17', 2006, 7, '4.99', '14.99', ARRAY['Trailers']::text[], 'Chamber Italian') + ) AS data(description, fulltext, old_language_id, last_update, length, rating, release_year, rental_duration, rental_rate, replacement_cost, special_features, title) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."language"' + AND map0.old_id = data.old_language_id + RETURNING film_id + ) + SELECT array_agg(film_id) INTO v_new_ids_film FROM inserted; + + FOR i IN 1..array_length(v_new_ids_film, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."film"', v_old_ids_film[i], v_new_ids_film[i]::TEXT); + END LOOP; + + -- Table: "public"."address" (603 records) + v_old_ids_address := ARRAY['345', '526', '529', '203', '477', '538', '585', '502', '482', '562', '89', '517', '256', '146', '589', '20', '496', '565', '237', '428', '138', '123', '69', '469', '521', '49', '13', '503', '541', '457', '297', '102', '399', '56', '474', '298', '555', '603', '571', '309', '126', '238', '485', '176', '128', '147', '283', '572', '488', '371', '168', '17', '208', '524', '498', '512', '332', '42', '545', '458', '115', '574', '117', '295', '178', '287', '365', '559', '11', '568', '22', '285', '254', '282', '291', '160', '289', '414', '107', '202', '84', '236', '30', '224', '194', '486', '598', '184', '495', '124', '465', '91', '239', '322', '352', '27', '590', '413', '70', '227']; + WITH inserted AS ( + INSERT INTO "public"."address" ("address", "address2", "city_id", "district", "last_update", "phone", "postal_code") + SELECT + data.address::character varying, + data.address2::character varying, + map0.new_id::smallint, + data.district::character varying, + data.last_update::timestamp without time zone, + data.phone::character varying, + data.postal_code::character varying + FROM (VALUES + ('68 Ponce Parkway', '', '201', 'Hanoi', '2006-02-15T09:45:30', '870635127812', '85926'), + ('617 Klerksdorp Place', '', '366', 'Khanh Hoa', '2006-02-15T09:45:30', '574973479129', '94707'), + ('600 Purnea (Purnia) Avenue', '', '571', 'Nghe An', '2006-02-15T09:45:30', '638409958875', '18043'), + ('1149 A Corua (La Corua) Boulevard', '', '194', 'Haiphong', '2006-02-15T09:45:30', '470884141195', '95824'), + ('1786 Salinas Place', '', '359', 'Nam Ha', '2006-02-15T09:45:30', '206060652238', '66546'), + ('1817 Livorno Way', '', '100', 'Khanh Hoa', '2006-02-15T09:45:30', '478380208348', '79401'), + ('1208 Tama Loop', '', '344', 'Ninawa', '2006-02-15T09:45:30', '954786054144', '73605'), + ('1515 Korla Way', '', '589', 'England', '2006-02-15T09:45:30', '959467760895', '57197'), + ('808 Naala-Porto Parkway', '', '500', 'England', '2006-02-15T09:45:30', '553452430707', '41060'), + ('869 Shikarpur Way', '', '496', 'England', '2006-02-15T09:45:30', '590764256785', '57380'), + ('1557 Ktahya Boulevard', '', '88', 'England', '2006-02-15T09:45:30', '720998247660', '88002'), + ('548 Uruapan Street', '', '312', 'Ontario', '2006-02-15T09:45:30', '879347453467', '35653'), + ('1497 Yuzhou Drive', '', '312', 'England', '2006-02-15T09:45:30', '246810237916', '3433'), + ('483 Ljubertsy Parkway', '', '149', 'Scotland', '2006-02-15T09:45:30', '581174211853', '60562'), + ('1584 Ljubertsy Lane', '', '494', 'England', '2006-02-15T09:45:30', '285710089439', '22954'), + ('360 Toulouse Parkway', '', '495', 'England', '2006-02-15T09:45:30', '949312333307', '54308'), + ('775 ostka Drive', '', '337', 'al-Daqahliya', '2006-02-15T09:45:30', '171973024401', '22358'), + ('1741 Hoshiarpur Boulevard', '', '79', 'al-Sharqiya', '2006-02-15T09:45:30', '855066328617', '22372'), + ('1736 Cavite Place', '', '216', 'Qina', '2006-02-15T09:45:30', '431770603551', '98775'), + ('1727 Matamoros Place', '', '465', 'Sawhaj', '2006-02-15T09:45:30', '129673677866', '78813'), + ('765 Southampton Drive', '', '421', 'al-Qalyubiya', '2006-02-15T09:45:30', '23712411567', '4285'), + ('1987 Coacalco de Berriozbal Loop', '', '476', 'al-Qalyubiya', '2006-02-15T09:45:30', '787654415858', '96065'), + ('698 Otsu Street', '', '105', 'Cayenne', '2006-02-15T09:45:30', '409983924481', '71110'), + ('1872 Toulon Loop', '', '428', 'OHiggins', '2006-02-15T09:45:30', '928809465153', '7939'), + ('568 Dhule (Dhulia) Loop', '', '127', 'Coquimbo', '2006-02-15T09:45:30', '602101369463', '92568'), + ('1718 Valencia Street', '', '27', 'Antofagasta', '2006-02-15T09:45:30', '675292816413', '37359'), + ('613 Korolev Drive', '', '329', 'Masqat', '2006-02-15T09:45:30', '380657522649', '45844'), + ('1416 San Juan Bautista Tuxtepec Avenue', '', '444', 'Zufar', '2006-02-15T09:45:30', '144206758053', '50592'), + ('195 Ilorin Street', '', '363', 'Chari-Baguirmi', '2006-02-15T09:45:30', '8912935608', '49250'), + ('535 Ahmadnagar Manor', '', '3', 'Abu Dhabi', '2006-02-15T09:45:30', '985109775584', '41136'), + ('1192 Tongliao Street', '', '470', 'Sharja', '2006-02-15T09:45:30', '350970907017', '19065'), + ('669 Firozabad Loop', '', '12', 'Abu Dhabi', '2006-02-15T09:45:30', '412903167998', '92265'), + ('331 Bydgoszcz Parkway', '', '181', 'Asturia', '2006-02-15T09:45:30', '537374465982', '966'), + ('939 Probolinggo Loop', '', '1', 'Galicia', '2006-02-15T09:45:30', '680428310138', '4166'), + ('1469 Plock Lane', '', '388', 'Galicia', '2006-02-15T09:45:30', '622884741180', '95835'), + ('44 Najafabad Way', '', '146', 'Baskimaa', '2006-02-15T09:45:30', '96604821070', '61391'), + ('1764 Jalib al-Shuyukh Parkway', '', '459', 'Galicia', '2006-02-15T09:45:30', '84794532510', '77642'), + ('1103 Quilmes Boulevard', '', '503', 'Piura', '2006-02-15T09:45:30', '644021380889', '52137'), + ('1746 Faaa Way', '', '214', 'Huanuco', '2006-02-15T09:45:30', '863080561151', '32515'), + ('827 Yuncheng Drive', '', '99', 'Callao', '2006-02-15T09:45:30', '504434452842', '79047'), + ('1175 Tanauan Way', '', '305', 'Lima', '2006-02-15T09:45:30', '937222955822', '64615'), + ('346 Skikda Parkway', '', '233', 'Hawalli', '2006-02-15T09:45:30', '630424482919', '90628'), + ('984 Novoterkassk Loop', '', '180', 'Gaziantep', '2006-02-15T09:45:30', '435118527255', '28165'), + ('29 Pyongyang Loop', '', '58', 'Batman', '2006-02-15T09:45:30', '734780743462', '47753'), + ('848 Tafuna Manor', '', '281', 'Ktahya', '2006-02-15T09:45:30', '614935229095', '45142'), + ('374 Bat Yam Boulevard', '', '266', 'Kilis', '2006-02-15T09:45:30', '923261616249', '97700'), + ('457 Tongliao Loop', '', '222', 'Bursa', '2006-02-15T09:45:30', '880756161823', '56254'), + ('539 Hami Way', '', '538', 'Tokat', '2006-02-15T09:45:30', '525518075499', '52196'), + ('698 Jelets Boulevard', '', '142', 'Denizli', '2006-02-15T09:45:30', '975185523021', '2596'), + ('1912 Emeishan Drive', '', '50', 'Balikesir', '2006-02-15T09:45:30', '99883471275', '33050'), + ('842 Salzburg Lane', '', '529', 'Adana', '2006-02-15T09:45:30', '697151428760', '3313'), + ('270 Amroha Parkway', '', '384', 'Osmaniye', '2006-02-15T09:45:30', '695479687538', '29610'), + ('1215 Pyongyang Parkway', '', '557', 'Usak', '2006-02-15T09:45:30', '646237101779', '25238'), + ('680 A Corua (La Corua) Manor', '', '482', 'Sivas', '2006-02-15T09:45:30', '158326114853', '49806'), + ('319 Plock Parkway', '', '504', 'Istanbul', '2006-02-15T09:45:30', '854259976812', '26101'), + ('1269 Ipoh Avenue', '', '163', 'Eskisehir', '2006-02-15T09:45:30', '402630109080', '54674'), + ('663 Baha Blanca Parkway', '', '5', 'Adana', '2006-02-15T09:45:30', '834418779292', '33463'), + ('269 Cam Ranh Parkway', '', '115', 'Chisinau', '2006-02-15T09:45:30', '489783829737', '34689'), + ('163 Augusta-Richmond County Loop', '', '561', 'Carabobo', '2006-02-15T09:45:30', '754579047924', '33030'), + ('138 Caracas Boulevard', '', '326', 'Zulia', '2006-02-15T09:45:30', '974433019532', '16790'), + ('1378 Alvorada Avenue', '', '102', 'Distrito Federal', '2006-02-15T09:45:30', '272234298332', '75834'), + ('502 Mandi Bahauddin Parkway', '', '55', 'Anzotegui', '2006-02-15T09:45:30', '618156722572', '15992'), + ('1079 Tel Aviv-Jaffa Boulevard', '', '132', 'Sucre', '2006-02-15T09:45:30', '358178933857', '10885'), + ('544 Tarsus Boulevard', '', '562', 'Gurico', '2006-02-15T09:45:30', '892523334', '53145'), + ('1848 Salala Boulevard', '', '373', 'Miranda', '2006-02-15T09:45:30', '48265851133', '25220'), + ('1405 Chisinau Place', '', '411', 'Ponce', '2006-02-15T09:45:30', '62781725285', '8160'), + ('1009 Zanzibar Lane', '', '32', 'Arecibo', '2006-02-15T09:45:30', '102396298916', '64875'), + ('1917 Kumbakonam Parkway', '', '368', 'Vojvodina', '2006-02-15T09:45:30', '698182547686', '11892'), + ('900 Santiago de Compostela Parkway', '', '280', 'Central Serbia', '2006-02-15T09:45:30', '716571220373', '93896'), + ('1342 Sharja Way', '', '488', 'Sokoto & Kebbi & Zam', '2006-02-15T09:45:30', '946114054231', '93655'), + ('320 Brest Avenue', '', '252', 'Kaduna', '2006-02-15T09:45:30', '747791594069', '43331'), + ('1006 Santa Brbara dOeste Manor', '', '389', 'Ondo & Ekiti', '2006-02-15T09:45:30', '85059738746', '36229'), + ('786 Stara Zagora Way', '', '390', 'Oyo & Osun', '2006-02-15T09:45:30', '716256596301', '98332'), + ('556 Baybay Manor', '', '374', 'Oyo & Osun', '2006-02-15T09:45:30', '363982224739', '55802'), + ('1155 Liaocheng Place', '', '152', 'Oyo & Osun', '2006-02-15T09:45:30', '558236142492', '22650'), + ('1367 Yantai Manor', '', '381', 'Ondo & Ekiti', '2006-02-15T09:45:30', '889538496300', '21294'), + ('1279 Udine Parkway', '', '69', 'Edo & Delta', '2006-02-15T09:45:30', '195003555232', '75860'), + ('1936 Lapu-Lapu Parkway', '', '141', 'Bauchi & Gombe', '2006-02-15T09:45:30', '653436985797', '7122'), + ('1177 Jelets Way', '', '220', 'Kwara & Kogi', '2006-02-15T09:45:30', '484292626944', '3305'), + ('955 Bamenda Way', '', '218', 'Ondo & Ekiti', '2006-02-15T09:45:30', '768481779568', '1545'), + ('1888 Kabul Drive', '', '217', 'Oyo & Osun', '2006-02-15T09:45:30', '701457319790', '20936'), + ('885 Yingkou Manor', '', '596', 'Kaduna', '2006-02-15T09:45:30', '588964509072', '31390'), + ('18 Duisburg Boulevard', '', '121', '', '2006-02-15T09:45:30', '998009777982', '58327'), + ('1842 Luzinia Boulevard', '', '593', 'Zanzibar West', '2006-02-15T09:45:30', '706878974831', '94420'), + ('605 Rio Claro Parkway', '', '513', 'Tabora', '2006-02-15T09:45:30', '352469351088', '49348'), + ('64 Korla Street', '', '347', 'Mwanza', '2006-02-15T09:45:30', '510383179153', '25145'), + ('42 Fontana Avenue', '', '512', 'Fejr', '2006-02-15T09:45:30', '437829801725', '14684'), + ('1410 Benin City Parkway', '', '405', 'Risaralda', '2006-02-15T09:45:30', '104150372603', '29747'), + ('656 Matamoros Drive', '', '487', 'Boyac', '2006-02-15T09:45:30', '17305839123', '19489'), + ('241 Mosul Lane', '', '147', 'Risaralda', '2006-02-15T09:45:30', '765345144779', '76157'), + ('734 Tanshui Avenue', '', '170', 'Caquet', '2006-02-15T09:45:30', '366776723320', '70664'), + ('1740 Portoviejo Avenue', '', '480', 'Sucre', '2006-02-15T09:45:30', '198123170793', '29932'), + ('98 Stara Zagora Boulevard', '', '96', 'Valle', '2006-02-15T09:45:30', '610173756082', '76448'), + ('1359 Zhoushan Parkway', '', '545', 'Streymoyar', '2006-02-15T09:45:30', '46568045367', '29763'), + ('1673 Tangail Drive', '', '137', 'Daugavpils', '2006-02-15T09:45:30', '627924259271', '26857'), + ('1780 Hino Boulevard', '', '303', 'Liepaja', '2006-02-15T09:45:30', '902731229323', '7716'), + ('247 Jining Parkway', '', '54', 'Banjul', '2006-02-15T09:45:30', '170115379190', '53446'), + ('692 Amroha Drive', '', '230', 'Northern', '2006-02-15T09:45:30', '359478883004', '35575'), + ('1150 Kimchon Manor', '', '321', 'Skne ln', '2006-02-15T09:45:30', '663449333709', '96109'), + ('1820 Maring Parkway', '', '324', 'Punjab', '2006-02-15T09:45:30', '99760893676', '88307') + ) AS data(address, address2, old_city_id, district, last_update, phone, postal_code) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."city"' + AND map0.old_id = data.old_city_id + RETURNING address_id + ) + SELECT array_agg(address_id) INTO v_new_ids_address FROM inserted; + + FOR i IN 1..array_length(v_new_ids_address, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."address"', v_old_ids_address[i], v_new_ids_address[i]::TEXT); + END LOOP; + + v_old_ids_address := ARRAY['404', '29', '421', '24', '388', '534', '159', '604', '65', '593', '324', '459', '456', '581', '493', '576', '584', '487', '358', '137', '348', '119', '588', '112', '430', '587', '374', '88', '328', '470', '369', '251', '419', '154', '278', '293', '491', '472', '181', '234', '569', '449', '325', '464', '454', '373', '14', '40', '189', '284', '382', '270', '45', '326', '26', '549', '44', '53', '105', '74', '422', '317', '108', '407', '166', '39', '61', '546', '219', '357', '366', '533', '148', '95', '397', '331', '350', '230', '209', '582', '79', '353', '592', '34', '523', '143', '9', '77', '583', '591', '28', '410', '111', '536', '364', '450', '336', '327', '247', '566']; + WITH inserted AS ( + INSERT INTO "public"."address" ("address", "address2", "city_id", "district", "last_update", "phone", "postal_code") + SELECT + data.address::character varying, + data.address2::character varying, + map0.new_id::smallint, + data.district::character varying, + data.last_update::timestamp without time zone, + data.phone::character varying, + data.postal_code::character varying + FROM (VALUES + ('734 Bchar Place', '', '375', 'Punjab', '2006-02-15T09:45:30', '280578750435', '30586'), + ('934 San Felipe de Puerto Plata Street', '', '472', 'Sind', '2006-02-15T09:45:30', '196495945706', '99780'), + ('966 Arecibo Loop', '', '134', 'Sind', '2006-02-15T09:45:30', '15273765306', '94018'), + ('1688 Okara Way', '', '327', 'Nothwest Border Prov', '2006-02-15T09:45:30', '144453869132', '21954'), + ('368 Hunuco Boulevard', '', '360', 'Namibe', '2006-02-15T09:45:30', '106439158941', '17165'), + ('486 Ondo Parkway', '', '67', 'Benguela', '2006-02-15T09:45:30', '105882218332', '35202'), + ('185 Novi Sad Place', '', '72', 'Bern', '2006-02-15T09:45:30', '904253967161', '41778'), + ('1331 Usak Boulevard', '', '296', 'Vaud', '2006-02-15T09:45:30', '145308717464', '61960'), + ('915 Ponce Place', '', '56', 'Basel-Stadt', '2006-02-15T09:45:30', '1395251317', '83980'), + ('1402 Zanzibar Boulevard', '', '106', 'Guanajuato', '2006-02-15T09:45:30', '387448063440', '71102'), + ('1145 Vilnius Manor', '', '451', 'Mxico', '2006-02-15T09:45:30', '674805712553', '73170'), + ('251 Florencia Drive', '', '556', 'Michoacn de Ocampo', '2006-02-15T09:45:30', '118011831565', '16119'), + ('814 Simferopol Loop', '', '154', 'Sinaloa', '2006-02-15T09:45:30', '524567129902', '48745'), + ('186 Skikda Lane', '', '131', 'Morelos', '2006-02-15T09:45:30', '14465669789', '89422'), + ('184 Mandaluyong Street', '', '288', 'Baja California Sur', '2006-02-15T09:45:30', '488425406814', '94239'), + ('1351 Sousse Lane', '', '341', 'Coahuila de Zaragoza', '2006-02-15T09:45:30', '203804046132', '37815'), + ('1819 Alessandria Loop', '', '103', 'Campeche', '2006-02-15T09:45:30', '377633994405', '53829'), + ('1785 So Bernardo do Campo Street', '', '125', 'Veracruz', '2006-02-15T09:45:30', '684529463244', '71182'), + ('1698 Southport Loop', '', '393', 'Hidalgo', '2006-02-15T09:45:30', '754358349853', '49009'), + ('261 Saint Louis Way', '', '541', 'Coahuila de Zaragoza', '2006-02-15T09:45:30', '321944036800', '83401'), + ('785 Vaduz Street', '', '335', 'Baja California', '2006-02-15T09:45:30', '895616862749', '36170'), + ('1107 Nakhon Sawan Avenue', '', '365', 'Mxico', '2006-02-15T09:45:30', '867546627903', '75149'), + ('966 Asuncin Way', '', '212', 'Hidalgo', '2006-02-15T09:45:30', '995527378381', '62703'), + ('1002 Ahmadnagar Manor', '', '213', 'Mxico', '2006-02-15T09:45:30', '371490777743', '93026'), + ('355 Vitria de Santo Anto Way', '', '452', 'Oaxaca', '2006-02-15T09:45:30', '548003849552', '81758'), + ('760 Miyakonojo Drive', '', '246', 'Guerrero', '2006-02-15T09:45:30', '294449058179', '64682'), + ('433 Florencia Street', '', '250', 'Chihuahua', '2006-02-15T09:45:30', '561729882725', '91330'), + ('125 Citt del Vaticano Boulevard', '', '40', 'Puebla', '2006-02-15T09:45:30', '48417642933', '67912'), + ('479 San Felipe del Progreso Avenue', '', '130', 'Morelos', '2006-02-15T09:45:30', '869051782691', '54949'), + ('1088 Ibirit Place', '', '595', 'Jalisco', '2006-02-15T09:45:30', '49084281333', '88502'), + ('817 Laredo Avenue', '', '188', 'Jalisco', '2006-02-15T09:45:30', '151249681135', '77449'), + ('1473 Changhwa Parkway', '', '124', 'Mxico', '2006-02-15T09:45:30', '266798132374', '75933'), + ('397 Sunnyvale Avenue', '', '19', 'Guanajuato', '2006-02-15T09:45:30', '680851640676', '55566'), + ('781 Shimonoseki Drive', '', '202', 'Michoacn de Ocampo', '2006-02-15T09:45:30', '632316273199', '95444'), + ('144 South Hill Loop', '', '445', 'Guanajuato', '2006-02-15T09:45:30', '45387294817', '2012'), + ('86 Higashiosaka Lane', '', '563', 'Guanajuato', '2006-02-15T09:45:30', '957128697225', '33768'), + ('1789 Saint-Denis Parkway', '', '4', 'Coahuila de Zaragoza', '2006-02-15T09:45:30', '936806643983', '8268'), + ('1447 Chatsworth Place', '', '129', 'Chihuahua', '2006-02-15T09:45:30', '769370126331', '41545'), + ('146 Johannesburg Way', '', '330', 'Tamaulipas', '2006-02-15T09:45:30', '953689007081', '54132'), + ('1256 Bislig Boulevard', '', '86', 'Botosani', '2006-02-15T09:45:30', '479007229460', '50598'), + ('1342 Abha Boulevard', '', '95', 'Bukarest', '2006-02-15T09:45:30', '997453607116', '10714'), + ('1289 Belm Boulevard', '', '530', 'Tartumaa', '2006-02-15T09:45:30', '237368926031', '88306'), + ('1892 Nabereznyje Telny Lane', '', '516', 'Tutuila', '2006-02-15T09:45:30', '478229987054', '28396'), + ('76 Kermanshah Manor', '', '423', 'Esfahan', '2006-02-15T09:45:30', '762361821578', '23343'), + ('956 Nam Dinh Manor', '', '481', 'Kerman', '2006-02-15T09:45:30', '474047727727', '21872'), + ('1922 Miraj Way', '', '356', 'Esfahan', '2006-02-15T09:45:30', '320471479776', '13203'), + ('1531 Sal Drive', '', '162', 'Esfahan', '2006-02-15T09:45:30', '648856936185', '53628'), + ('334 Munger (Monghyr) Lane', '', '31', 'Markazi', '2006-02-15T09:45:30', '481183273622', '38145'), + ('927 Barcelona Street', '', '467', 'Chaharmahal va Bakht', '2006-02-15T09:45:30', '951486492670', '65121'), + ('600 Bradford Street', '', '514', 'East Azerbaidzan', '2006-02-15T09:45:30', '117592274996', '96204'), + ('220 Hidalgo Drive', '', '265', 'Kermanshah', '2006-02-15T09:45:30', '342720754566', '45298'), + ('682 Halisahar Place', '', '378', 'Severn Morava', '2006-02-15T09:45:30', '475553436330', '20536'), + ('42 Brindisi Place', '', '586', 'Yerevan', '2006-02-15T09:45:30', '42384721397', '16744'), + ('470 Boksburg Street', '', '81', 'Central', '2006-02-15T09:45:30', '908029859266', '97960'), + ('28 Charlotte Amalie Street', '', '443', 'Rabat-Sal-Zammour-Z', '2006-02-15T09:45:30', '161968374323', '37551'), + ('454 Qinhuangdao Drive', '', '68', 'Tadla-Azilal', '2006-02-15T09:45:30', '786270036240', '25866'), + ('671 Graz Street', '', '353', 'Oriental', '2006-02-15T09:45:30', '680768868518', '94399'), + ('725 Isesaki Place', '', '237', 'Mekka', '2006-02-15T09:45:30', '876295323994', '74428'), + ('733 Mandaluyong Place', '', '2', 'Asir', '2006-02-15T09:45:30', '196568435814', '77459'), + ('1124 Buenaventura Drive', '', '13', 'Mekka', '2006-02-15T09:45:30', '407733804223', '6856'), + ('289 Santo Andr Manor', '', '16', 'al-Sharqiya', '2006-02-15T09:45:30', '214976066017', '72410'), + ('780 Kimberley Way', '', '515', 'Tabuk', '2006-02-15T09:45:30', '824396883951', '17032'), + ('1386 Yangor Avenue', '', '543', 'Provence-Alpes-Cte', '2006-02-15T09:45:30', '449216226468', '80720'), + ('1346 Mysore Drive', '', '92', 'Bretagne', '2006-02-15T09:45:30', '516647474029', '61507'), + ('1740 Le Mans Loop', '', '297', 'Pays de la Loire', '2006-02-15T09:45:30', '168476538960', '22853'), + ('391 Callao Drive', '', '544', 'Midi-Pyrnes', '2006-02-15T09:45:30', '440512153169', '34021'), + ('943 Tokat Street', '', '560', 'Vaduz', '2006-02-15T09:45:30', '889318963672', '45428'), + ('191 Jos Azueta Parkway', '', '436', 'Ruse', '2006-02-15T09:45:30', '932156667696', '13629'), + ('1229 Valencia Parkway', '', '498', 'Haskovo', '2006-02-15T09:45:30', '352679173732', '99124'), + ('1641 Changhwa Place', '', '52', 'Nord-Ouest', '2006-02-15T09:45:30', '256546485220', '37636'), + ('114 Jalib al-Shuyukh Manor', '', '585', 'Centre', '2006-02-15T09:45:30', '845378657301', '60440'), + ('556 Asuncin Way', '', '339', 'Mogiljov', '2006-02-15T09:45:30', '338244023543', '35364'), + ('1027 Songkhla Manor', '', '340', 'Minsk', '2006-02-15T09:45:30', '563660187896', '30861'), + ('1370 Le Mans Avenue', '', '53', 'Brunei and Muara', '2006-02-15T09:45:30', '345679835036', '52163'), + ('614 Pak Kret Street', '', '6', 'Addis Abeba', '2006-02-15T09:45:30', '47808359842', '27796'), + ('1016 Iwakuni Street', '', '269', 'St George', '2006-02-15T09:45:30', '961370847344', '49833'), + ('1628 Nagareyama Lane', '', '453', 'Central', '2006-02-15T09:45:30', '20064292617', '60079'), + ('201 Effon-Alaiye Way', '', '37', 'Asuncin', '2006-02-15T09:45:30', '684192903087', '64344'), + ('1679 Antofagasta Street', '', '122', 'Alto Paran', '2006-02-15T09:45:30', '905903574913', '86599'), + ('1568 Celaya Parkway', '', '168', 'Kaohsiung', '2006-02-15T09:45:30', '278669994384', '34750'), + ('1551 Rampur Lane', '', '108', 'Changhwa', '2006-02-15T09:45:30', '251164340471', '72394'), + ('381 Kabul Way', '', '209', 'Taipei', '2006-02-15T09:45:30', '55477302294', '87272'), + ('1923 Stara Zagora Lane', '', '546', 'Nantou', '2006-02-15T09:45:30', '182178609211', '95179'), + ('1668 Anpolis Street', '', '316', 'Taipei', '2006-02-15T09:45:30', '525255540978', '50199'), + ('608 Birgunj Parkway', '', '116', 'Taipei', '2006-02-15T09:45:30', '627425618482', '400'), + ('1029 Dzerzinsk Manor', '', '542', 'Ynlin', '2006-02-15T09:45:30', '33173584456', '57519'), + ('53 Idfu Parkway', '', '361', 'Nantou', '2006-02-15T09:45:30', '10655648674', '42399'), + ('1947 Poos de Caldas Boulevard', '', '114', 'Chiayi', '2006-02-15T09:45:30', '427454485876', '60951'), + ('1489 Kakamigahara Lane', '', '526', 'Taipei', '2006-02-15T09:45:30', '29341849811', '98883'), + ('773 Dallas Manor', '', '424', 'Buenos Aires', '2006-02-15T09:45:30', '914466027044', '12664'), + ('96 Tafuna Way', '', '128', 'Crdoba', '2006-02-15T09:45:30', '934730187245', '99865'), + ('88 Nagaon Manor', '', '524', 'Buenos Aires', '2006-02-15T09:45:30', '779461480495', '86868'), + ('1532 Dzerzinsk Way', '', '334', 'Buenos Aires', '2006-02-15T09:45:30', '330838016880', '9599'), + ('166 Jinchang Street', '', '165', 'Buenos Aires', '2006-02-15T09:45:30', '717566026669', '86760'), + ('1623 Kingstown Drive', '', '20', 'Buenos Aires', '2006-02-15T09:45:30', '296394569728', '91299'), + ('203 Tambaram Street', '', '161', 'Buenos Aires', '2006-02-15T09:45:30', '411549550611', '73942'), + ('430 Kumbakonam Drive', '', '457', 'Santa F', '2006-02-15T09:45:30', '105470691550', '28814'), + ('1427 A Corua (La Corua) Place', '', '45', 'Buenos Aires', '2006-02-15T09:45:30', '972574862516', '85799'), + ('1483 Pathankot Street', '', '454', 'Tucumn', '2006-02-15T09:45:30', '686015532180', '37288'), + ('1229 Varanasi (Benares) Manor', '', '43', 'Buenos Aires', '2006-02-15T09:45:30', '817740355461', '40195') + ) AS data(address, address2, old_city_id, district, last_update, phone, postal_code) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."city"' + AND map0.old_id = data.old_city_id + RETURNING address_id + ) + SELECT array_agg(address_id) INTO v_new_ids_address FROM inserted; + + FOR i IN 1..array_length(v_new_ids_address, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."address"', v_old_ids_address[i], v_new_ids_address[i]::TEXT); + END LOOP; + + v_old_ids_address := ARRAY['223', '93', '310', '281', '313', '543', '335', '567', '186', '144', '216', '274', '6', '185', '462', '405', '218', '116', '150', '509', '296', '18', '162', '599', '299', '484', '387', '66', '280', '153', '252', '67', '55', '425', '10', '122', '532', '100', '561', '113', '129', '437', '149', '412', '23', '87', '136', '476', '343', '12', '595', '267', '499', '170', '475', '214', '308', '217', '211', '563', '311', '175', '62', '468', '1', '3', '415', '481', '193', '441', '271', '177', '163', '106', '320', '165', '483', '395', '46', '90', '231', '453', '255', '205', '118', '199', '200', '294', '344', '500', '215', '520', '277', '501', '307', '114', '97', '253', '158', '594']; + WITH inserted AS ( + INSERT INTO "public"."address" ("address", "address2", "city_id", "district", "last_update", "phone", "postal_code") + SELECT + data.address::character varying, + data.address2::character varying, + map0.new_id::smallint, + data.district::character varying, + data.last_update::timestamp without time zone, + data.phone::character varying, + data.postal_code::character varying + FROM (VALUES + ('1244 Allappuzha (Alleppey) Place', '', '567', 'Buenos Aires', '2006-02-15T09:45:30', '991802825778', '20657'), + ('1926 El Alto Avenue', '', '289', 'Buenos Aires', '2006-02-15T09:45:30', '846225459260', '75543'), + ('913 Coacalco de Berriozbal Loop', '', '33', 'Texas', '2006-02-15T09:45:30', '262088367001', '42141'), + ('1944 Bamenda Way', '', '573', 'Michigan', '2006-02-15T09:45:30', '75975221996', '24645'), + ('1191 Sungai Petani Boulevard', '', '262', 'Missouri', '2006-02-15T09:45:30', '983259819766', '9668'), + ('43 Vilnius Manor', '', '42', 'Colorado', '2006-02-15T09:45:30', '484500282381', '79814'), + ('587 Benguela Manor', '', '42', 'Illinois', '2006-02-15T09:45:30', '165450987037', '91590'), + ('1894 Boa Vista Way', '', '178', 'Texas', '2006-02-15T09:45:30', '239357986667', '77464'), + ('533 al-Ayn Boulevard', '', '126', 'California', '2006-02-15T09:45:30', '662227486184', '8862'), + ('1666 Beni-Mellal Place', '', '123', 'Tennessee', '2006-02-15T09:45:30', '9099941466', '13377'), + ('660 Jedda Boulevard', '', '65', 'Washington', '2006-02-15T09:45:30', '168758068397', '25053'), + ('920 Kumbakonam Loop', '', '446', 'California', '2006-02-15T09:45:30', '685010736240', '75090'), + ('1121 Loja Avenue', '', '449', 'California', '2006-02-15T09:45:30', '838635286649', '17886'), + ('682 Garden Grove Place', '', '333', 'Tennessee', '2006-02-15T09:45:30', '72136330362', '67497'), + ('1485 Bratislava Place', '', '435', 'Illinois', '2006-02-15T09:45:30', '924663855568', '83183'), + ('530 Lausanne Lane', '', '135', 'Texas', '2006-02-15T09:45:30', '775235029633', '11067'), + ('226 Brest Manor', '', '508', 'California', '2006-02-15T09:45:30', '785881412500', '2299'), + ('793 Cam Ranh Avenue', '', '292', 'California', '2006-02-15T09:45:30', '824370924746', '87057'), + ('879 Newcastle Way', '', '499', 'Michigan', '2006-02-15T09:45:30', '206841104594', '90732'), + ('786 Matsue Way', '', '245', 'Illinois', '2006-02-15T09:45:30', '111177206479', '37469'), + ('1936 Cuman Avenue', '', '433', 'Virginia', '2006-02-15T09:45:30', '976798660411', '61195'), + ('770 Bydgoszcz Avenue', '', '120', 'California', '2006-02-15T09:45:30', '517338314235', '16266'), + ('369 Papeete Way', '', '187', 'North Carolina', '2006-02-15T09:45:30', '170117068815', '66639'), + ('1895 Zhezqazghan Drive', '', '177', 'California', '2006-02-15T09:45:30', '137809746111', '36693'), + ('32 Pudukkottai Lane', '', '140', 'Ohio', '2006-02-15T09:45:30', '967274728547', '38834'), + ('98 Pyongyang Boulevard', '', '11', 'Ohio', '2006-02-15T09:45:30', '191958435142', '88749'), + ('401 Sucre Boulevard', '', '322', 'New Hampshire', '2006-02-15T09:45:30', '486395999608', '25007'), + ('1717 Guadalajara Lane', '', '441', 'Missouri', '2006-02-15T09:45:30', '914090181665', '85505'), + ('1980 Kamjanets-Podilskyi Street', '', '404', 'Illinois', '2006-02-15T09:45:30', '874337098891', '89502'), + ('782 Mosul Street', '', '94', 'Massachusetts', '2006-02-15T09:45:30', '885899703621', '25545'), + ('1309 Weifang Street', '', '520', 'Florida', '2006-02-15T09:45:30', '435785045362', '57338'), + ('1214 Hanoi Way', '', '306', 'Nebraska', '2006-02-15T09:45:30', '491001136577', '67055'), + ('1135 Izumisano Parkway', '', '171', 'California', '2006-02-15T09:45:30', '171822533480', '48150'), + ('1866 al-Qatif Avenue', '', '155', 'California', '2006-02-15T09:45:30', '546793516940', '89420'), + ('1795 Santiago de Compostela Way', '', '295', 'Texas', '2006-02-15T09:45:30', '860452626434', '18743'), + ('333 Goinia Way', '', '185', 'Texas', '2006-02-15T09:45:30', '909029256431', '78625'), + ('1427 Tabuk Place', '', '101', 'Florida', '2006-02-15T09:45:30', '214756839122', '31342'), + ('1308 Arecibo Way', '', '41', 'Georgia', '2006-02-15T09:45:30', '6171054059', '30695'), + ('1497 Fengshan Drive', '', '112', 'KwaZulu-Natal', '2006-02-15T09:45:30', '368738360376', '63022'), + ('682 Junan Way', '', '273', 'North West', '2006-02-15T09:45:30', '622255216127', '30418'), + ('569 Baicheng Lane', '', '85', 'Gauteng', '2006-02-15T09:45:30', '490211944645', '60304'), + ('1766 Almirante Brown Street', '', '364', 'KwaZulu-Natal', '2006-02-15T09:45:30', '617567598243', '63104'), + ('999 Sanaa Loop', '', '491', 'Gauteng', '2006-02-15T09:45:30', '918032330119', '3439'), + ('1639 Saarbrcken Drive', '', '437', 'North West', '2006-02-15T09:45:30', '328494873422', '9827'), + ('1417 Lancaster Avenue', '', '267', 'Northern Cape', '2006-02-15T09:45:30', '272572357893', '72192'), + ('929 Tallahassee Loop', '', '497', 'Gauteng', '2006-02-15T09:45:30', '800716535041', '74671'), + ('898 Belm Manor', '', '87', 'Free State', '2006-02-15T09:45:30', '707169393853', '49757'), + ('270 Tambaram Parkway', '', '244', 'Gauteng', '2006-02-15T09:45:30', '248446668735', '9668'), + ('1443 Mardan Street', '', '392', 'Western Cape', '2006-02-15T09:45:30', '231383037471', '31483'), + ('478 Joliet Way', '', '200', 'Hamilton', '2006-02-15T09:45:30', '657282285970', '77948'), + ('1074 Sanaa Parkway', '', '311', 'Loja', '2006-02-15T09:45:30', '154124128457', '22474'), + ('816 Cayenne Parkway', '', '414', 'Manab', '2006-02-15T09:45:30', '282874611748', '93629'), + ('1954 Kowloon and New Kowloon Way', '', '434', 'Chimborazo', '2006-02-15T09:45:30', '898559280434', '63667'), + ('710 San Felipe del Progreso Avenue', '', '304', 'Lilongwe', '2006-02-15T09:45:30', '843801144113', '76901'), + ('434 Ourense (Orense) Manor', '', '206', 'Hodeida', '2006-02-15T09:45:30', '562370137426', '14122'), + ('751 Lima Loop', '', '7', 'Aden', '2006-02-15T09:45:30', '756460337785', '99405'), + ('687 Alessandria Parkway', '', '455', 'Sanaa', '2006-02-15T09:45:30', '407218522294', '57587'), + ('1001 Miyakonojo Lane', '', '518', 'Taizz', '2006-02-15T09:45:30', '584316724815', '67924'), + ('850 Salala Loop', '', '371', 'Kitaa', '2006-02-15T09:45:30', '403404780639', '10800'), + ('1059 Yuncheng Avenue', '', '570', 'Vilna', '2006-02-15T09:45:30', '107092893983', '47498'), + ('715 So Bernardo do Campo Lane', '', '507', 'Kedah', '2006-02-15T09:45:30', '181179321332', '84804'), + ('316 Uruapan Street', '', '223', 'Perak', '2006-02-15T09:45:30', '275788967899', '58194'), + ('1114 Liepaja Street', '', '282', 'Sarawak', '2006-02-15T09:45:30', '212869228936', '69226'), + ('1844 Usak Avenue', '', '196', 'Nova Scotia', '2006-02-15T09:45:30', '164414772677', '84461'), + ('47 MySakila Drive', NULL, '300', 'Alberta', '2006-02-15T09:45:30', '', ''), + ('23 Workhaven Lane', NULL, '300', 'Alberta', '2006-02-15T09:45:30', '14033335568', ''), + ('432 Garden Grove Street', '', '430', 'Ontario', '2006-02-15T09:45:30', '615964523510', '65630'), + ('1153 Allende Way', '', '179', 'Qubec', '2006-02-15T09:45:30', '856872225376', '20336'), + ('891 Novi Sad Manor', '', '383', 'Ontario', '2006-02-15T09:45:30', '247646995453', '5379'), + ('983 Santa F Way', '', '565', 'British Colombia', '2006-02-15T09:45:30', '145720452260', '47472'), + ('1587 Loja Manor', '', '447', 'Salzburg', '2006-02-15T09:45:30', '621625204422', '5410'), + ('1010 Klerksdorp Way', '', '186', 'Steiermark', '2006-02-15T09:45:30', '493008546874', '6802'), + ('1440 Compton Place', '', '307', 'North Austria', '2006-02-15T09:45:30', '931059836497', '81037'), + ('659 Vaduz Drive', '', '34', 'Ha Darom', '2006-02-15T09:45:30', '709935135487', '49708'), + ('1542 Lubumbashi Boulevard', '', '57', 'Tel Aviv', '2006-02-15T09:45:30', '508800331065', '62472'), + ('97 Shimoga Avenue', '', '533', 'Tel Aviv', '2006-02-15T09:45:30', '177167004331', '44660'), + ('632 Usolje-Sibirskoje Parkway', '', '36', 'Ha Darom', '2006-02-15T09:45:30', '667648979883', '73085'), + ('1337 Mit Ghamr Avenue', '', '358', 'Nakhon Sawan', '2006-02-15T09:45:30', '175283210378', '29810'), + ('1632 Bislig Avenue', '', '394', 'Nonthaburi', '2006-02-15T09:45:30', '471675840679', '61117'), + ('870 Ashqelon Loop', '', '489', 'Songkhla', '2006-02-15T09:45:30', '135117278909', '84931'), + ('430 Alessandria Loop', '', '439', 'Saarland', '2006-02-15T09:45:30', '669828224459', '47446'), + ('319 Springs Loop', '', '160', 'Baijeri', '2006-02-15T09:45:30', '72524459905', '99552'), + ('1966 Tonghae Street', '', '198', 'Anhalt Sachsen', '2006-02-15T09:45:30', '567359279425', '36481'), + ('68 Molodetno Manor', '', '575', 'Nordrhein-Westfalen', '2006-02-15T09:45:30', '146640639760', '4662'), + ('442 Rae Bareli Place', '', '148', 'Nordrhein-Westfalen', '2006-02-15T09:45:30', '886636413768', '24321'), + ('1792 Valle de la Pascua Place', '', '477', 'Nordrhein-Westfalen', '2006-02-15T09:45:30', '419419591240', '15540'), + ('1074 Binzhou Manor', '', '325', 'Baden-Wrttemberg', '2006-02-15T09:45:30', '331132568928', '36490'), + ('1912 Allende Manor', '', '279', 'Kowloon and New Kowl', '2006-02-15T09:45:30', '172262454487', '58124'), + ('1909 Benguela Lane', '', '581', 'Henan', '2006-02-15T09:45:30', '624138001031', '19913'), + ('362 Rajkot Lane', '', '47', 'Gansu', '2006-02-15T09:45:30', '962020153680', '98030'), + ('1333 Haldia Street', '', '174', 'Jilin', '2006-02-15T09:45:30', '408304391718', '82161'), + ('1778 Gijn Manor', '', '594', 'Hubei', '2006-02-15T09:45:30', '288910576761', '35156'), + ('85 San Felipe de Puerto Plata Drive', '', '584', 'Shandong', '2006-02-15T09:45:30', '170739645687', '46063'), + ('1060 Tandil Lane', '', '432', 'Shandong', '2006-02-15T09:45:30', '211256301880', '72349'), + ('1908 Gaziantep Place', '', '536', 'Liaoning', '2006-02-15T09:45:30', '108053751300', '58979'), + ('804 Elista Drive', '', '159', 'Hubei', '2006-02-15T09:45:30', '379804592943', '61069'), + ('832 Nakhon Sawan Manor', '', '592', 'Inner Mongolia', '2006-02-15T09:45:30', '275595571388', '49021'), + ('1760 Oshawa Manor', '', '535', 'Tianjin', '2006-02-15T09:45:30', '56257502250', '38140'), + ('798 Cianjur Avenue', '', '590', 'Shanxi', '2006-02-15T09:45:30', '499408708580', '76990'), + ('1464 Kursk Parkway', '', '574', 'Shandong', '2006-02-15T09:45:30', '338758048786', '17381') + ) AS data(address, address2, old_city_id, district, last_update, phone, postal_code) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."city"' + AND map0.old_id = data.old_city_id + RETURNING address_id + ) + SELECT array_agg(address_id) INTO v_new_ids_address FROM inserted; + + FOR i IN 1..array_length(v_new_ids_address, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."address"', v_old_ids_address[i], v_new_ids_address[i]::TEXT); + END LOOP; + + v_old_ids_address := ARRAY['41', '427', '389', '286', '600', '288', '172', '429', '539', '245', '527', '246', '383', '558', '94', '265', '133', '329', '440', '544', '570', '201', '447', '142', '272', '155', '575', '471', '68', '169', '318', '490', '71', '601', '173', '394', '605', '516', '556', '489', '552', '362', '7', '602', '596', '258', '342', '290', '360', '38', '83', '151', '390', '15', '508', '33', '537', '553', '57', '396', '406', '244', '269', '198', '409', '304', '167', '58', '494', '580', '401', '5', '370', '525', '145', '434', '579', '80', '363', '64', '140', '292', '139', '264', '213', '228', '341', '445', '273', '560', '408', '72', '171', '229', '16', '99', '196', '361', '451', '121']; + WITH inserted AS ( + INSERT INTO "public"."address" ("address", "address2", "city_id", "district", "last_update", "phone", "postal_code") + SELECT + data.address::character varying, + data.address2::character varying, + map0.new_id::smallint, + data.district::character varying, + data.last_update::timestamp without time zone, + data.phone::character varying, + data.postal_code::character varying + FROM (VALUES + ('1440 Fukuyama Loop', '', '362', 'Henan', '2006-02-15T09:45:30', '912257250465', '47929'), + ('1557 Cape Coral Parkway', '', '293', 'Hubei', '2006-02-15T09:45:30', '368284120423', '46875'), + ('500 Lincoln Parkway', '', '210', 'Jiangsu', '2006-02-15T09:45:30', '550306965159', '95509'), + ('1308 Sumy Loop', '', '175', 'Fujian', '2006-02-15T09:45:30', '583021225407', '30657'), + ('1837 Kaduna Parkway', '', '241', 'Inner Mongolia', '2006-02-15T09:45:30', '640843562301', '82580'), + ('226 Halifax Street', '', '277', 'Xinxiang', '2006-02-15T09:45:30', '790651020929', '58492'), + ('475 Atinsk Way', '', '240', 'Gansu', '2006-02-15T09:45:30', '201705577290', '59571'), + ('1269 Botosani Manor', '', '468', 'Guangdong', '2006-02-15T09:45:30', '736517327853', '47394'), + ('1332 Gaziantep Lane', '', '80', 'Shandong', '2006-02-15T09:45:30', '383353187467', '22813'), + ('1103 Bilbays Parkway', '', '578', 'Hubei', '2006-02-15T09:45:30', '279979529227', '87660'), + ('1993 0 Loop', '', '588', 'Liaoning', '2006-02-15T09:45:30', '25865528181', '41214'), + ('1246 Boksburg Parkway', '', '422', 'Hebei', '2006-02-15T09:45:30', '890283544295', '28349'), + ('686 Donostia-San Sebastin Lane', '', '471', 'Guangdong', '2006-02-15T09:45:30', '71857599858', '97390'), + ('904 Clarksville Drive', '', '193', 'Zhejiang', '2006-02-15T09:45:30', '955349440539', '52234'), + ('1952 Chatsworth Drive', '', '332', 'Guangdong', '2006-02-15T09:45:30', '991562402283', '25958'), + ('1158 Mandi Bahauddin Parkway', '', '136', 'Shanxi', '2006-02-15T09:45:30', '276555730211', '98484'), + ('1854 Tieli Street', '', '302', 'Shandong', '2006-02-15T09:45:30', '509492324775', '15819'), + ('867 Benin City Avenue', '', '591', 'Henan', '2006-02-15T09:45:30', '168884817145', '78543'), + ('722 Bradford Lane', '', '249', 'Shandong', '2006-02-15T09:45:30', '746251338300', '90920'), + ('183 Haiphong Street', '', '46', 'Jilin', '2006-02-15T09:45:30', '488600270038', '69953'), + ('415 Pune Avenue', '', '580', 'Shandong', '2006-02-15T09:45:30', '203202500108', '44274'), + ('817 Bradford Loop', '', '109', 'Jiangsu', '2006-02-15T09:45:30', '264286442804', '89459'), + ('105 Dzerzinsk Manor', '', '540', 'Inner Mongolia', '2006-02-15T09:45:30', '240776414296', '48570'), + ('1587 Sullana Lane', '', '207', 'Inner Mongolia', '2006-02-15T09:45:30', '468060467018', '85769'), + ('1762 Paarl Parkway', '', '298', 'Hunan', '2006-02-15T09:45:30', '192459639410', '53928'), + ('1560 Jelets Boulevard', '', '291', 'Shandong', '2006-02-15T09:45:30', '189446090264', '77777'), + ('1052 Pathankot Avenue', '', '299', 'Sichuan', '2006-02-15T09:45:30', '128499386727', '77397'), + ('1322 Mosul Parkway', '', '145', 'Shandong', '2006-02-15T09:45:30', '268053970382', '95400'), + ('1966 Amroha Avenue', '', '139', 'Sichuan', '2006-02-15T09:45:30', '333489324603', '70385'), + ('154 Tallahassee Loop', '', '199', 'Xinxiang', '2006-02-15T09:45:30', '935508855935', '62250'), + ('1774 Yaound Place', '', '166', 'Hubei', '2006-02-15T09:45:30', '613124286867', '91400'), + ('1909 Dayton Avenue', '', '469', 'Guangdong', '2006-02-15T09:45:30', '702955450528', '88513'), + ('1586 Guaruj Place', '', '579', 'Hunan', '2006-02-15T09:45:30', '947233365992', '5135'), + ('844 Bucuresti Place', '', '242', 'Liaoning', '2006-02-15T09:45:30', '935952366111', '36603'), + ('1294 Firozabad Drive', '', '407', 'Jiangxi', '2006-02-15T09:45:30', '161801569569', '70618'), + ('753 Ilorin Avenue', '', '157', 'Sichuan', '2006-02-15T09:45:30', '464511145118', '3656'), + ('1325 Fukuyama Street', '', '537', 'Heilongjiang', '2006-02-15T09:45:30', '288241215394', '27107'), + ('1574 Goinia Boulevard', '', '502', 'Heilongjiang', '2006-02-15T09:45:30', '59634255214', '39529'), + ('346 Cam Ranh Avenue', '', '599', 'Zhejiang', '2006-02-15T09:45:30', '978430786151', '39976'), + ('1297 Alvorada Parkway', '', '587', 'Ningxia', '2006-02-15T09:45:30', '508348602835', '11839'), + ('390 Wroclaw Way', '', '462', 'Hainan', '2006-02-15T09:45:30', '357593328658', '5753'), + ('482 Kowloon and New Kowloon Manor', '', '90', 'Bratislava', '2006-02-15T09:45:30', '738968474939', '97056'), + ('692 Joliet Street', '', '38', 'Attika', '2006-02-15T09:45:30', '448477190408', '83579'), + ('1101 Bucuresti Boulevard', '', '401', 'West Greece', '2006-02-15T09:45:30', '199514580428', '97661'), + ('1759 Niznekamsk Avenue', '', '14', 'al-Manama', '2006-02-15T09:45:30', '864392582257', '39414'), + ('752 Ondo Loop', '', '338', 'Miyazaki', '2006-02-15T09:45:30', '134673576619', '32474'), + ('124 al-Manama Way', '', '382', 'Hiroshima', '2006-02-15T09:45:30', '647899404952', '52368'), + ('1336 Benin City Drive', '', '386', 'Shiga', '2006-02-15T09:45:30', '341242939532', '46044'), + ('619 Hunuco Avenue', '', '331', 'Shimane', '2006-02-15T09:45:30', '142596392389', '81508'), + ('61 Tama Street', '', '284', 'Okayama', '2006-02-15T09:45:30', '708403338270', '94065'), + ('586 Tete Way', '', '256', 'Kanagawa', '2006-02-15T09:45:30', '18581624103', '1079'), + ('1337 Lincoln Parkway', '', '555', 'Saitama', '2006-02-15T09:45:30', '597815221267', '99457'), + ('102 Chapra Drive', '', '521', 'Ibaragi', '2006-02-15T09:45:30', '776031833752', '14073'), + ('1542 Tarlac Parkway', '', '440', 'Kanagawa', '2006-02-15T09:45:30', '635297277345', '1027'), + ('496 Celaya Drive', '', '552', 'Nagano', '2006-02-15T09:45:30', '759586584889', '90797'), + ('786 Aurora Avenue', '', '474', 'Yamaguchi', '2006-02-15T09:45:30', '18461860151', '65750'), + ('958 Sagamihara Lane', '', '287', 'Mie', '2006-02-15T09:45:30', '427274926505', '88408'), + ('1421 Quilmes Lane', '', '260', 'Ishikawa', '2006-02-15T09:45:30', '135407755975', '19151'), + ('17 Kabul Boulevard', '', '355', 'Chiba', '2006-02-15T09:45:30', '697760867968', '38594'), + ('767 Pyongyang Drive', '', '229', 'Osaka', '2006-02-15T09:45:30', '667736124769', '83536'), + ('454 Patiala Lane', '', '276', 'Fukushima', '2006-02-15T09:45:30', '794553031307', '13496'), + ('1148 Saarbrcken Parkway', '', '226', 'Fukushima', '2006-02-15T09:45:30', '137773001988', '1921'), + ('446 Kirovo-Tepetsk Lane', '', '203', 'Osaka', '2006-02-15T09:45:30', '303967439816', '19428'), + ('345 Oshawa Boulevard', '', '204', 'Tokyo-to', '2006-02-15T09:45:30', '104491201771', '32114'), + ('1266 Laredo Parkway', '', '380', 'Saitama', '2006-02-15T09:45:30', '1483365694', '7664'), + ('1635 Kuwana Boulevard', '', '205', 'Hiroshima', '2006-02-15T09:45:30', '710603868323', '52137'), + ('1287 Xiangfan Boulevard', '', '253', 'Gifu', '2006-02-15T09:45:30', '819416131190', '57844'), + ('1964 Allappuzha (Alleppey) Street', '', '227', 'Yamaguchi', '2006-02-15T09:45:30', '920811325222', '48980'), + ('591 Sungai Petani Drive', '', '376', 'Okayama', '2006-02-15T09:45:30', '37247325001', '46400'), + ('923 Tangail Boulevard', '', '10', 'Tokyo-to', '2006-02-15T09:45:30', '315528269898', '33384'), + ('168 Cianjur Manor', '', '228', 'Saitama', '2006-02-15T09:45:30', '679095087143', '73824'), + ('1913 Hanoi Way', '', '463', 'Nagasaki', '2006-02-15T09:45:30', '28303384290', '35200'), + ('1565 Tangail Manor', '', '377', 'Okinawa', '2006-02-15T09:45:30', '634445428822', '45750'), + ('1949 Sanya Street', '', '224', 'Gumma', '2006-02-15T09:45:30', '132100972047', '61244'), + ('928 Jaffna Loop', '', '172', 'Hiroshima', '2006-02-15T09:45:30', '581852137991', '93762'), + ('1404 Taguig Drive', '', '547', 'Okayama', '2006-02-15T09:45:30', '572068624538', '87212'), + ('521 San Juan Bautista Tuxtepec Place', '', '598', 'Qaraghandy', '2006-02-15T09:45:30', '844018348565', '95093'), + ('602 Paarl Street', '', '402', 'Pavlodar', '2006-02-15T09:45:30', '896314772871', '98889'), + ('604 Bern Place', '', '429', 'Jharkhand', '2006-02-15T09:45:30', '620719383725', '5373'), + ('81 Hodeida Way', '', '231', 'Rajasthan', '2006-02-15T09:45:30', '250767749542', '55561'), + ('788 Atinsk Street', '', '211', 'Karnataka', '2006-02-15T09:45:30', '146497509724', '81691'), + ('1993 Tabuk Lane', '', '522', 'Tamil Nadu', '2006-02-15T09:45:30', '648482415405', '64221'), + ('943 Johannesburg Avenue', '', '417', 'Maharashtra', '2006-02-15T09:45:30', '90921003005', '5892'), + ('1027 Banjul Place', '', '197', 'West Bengali', '2006-02-15T09:45:30', '538241037443', '50390'), + ('43 Dadu Avenue', '', '74', 'Rajasthan', '2006-02-15T09:45:30', '95666951770', '4855'), + ('60 Poos de Caldas Street', '', '243', 'Rajasthan', '2006-02-15T09:45:30', '963063788669', '82338'), + ('1920 Weifang Avenue', '', '427', 'Uttar Pradesh', '2006-02-15T09:45:30', '869507847714', '15643'), + ('495 Bhimavaram Lane', '', '144', 'Maharashtra', '2006-02-15T09:45:30', '82088937724', '3'), + ('1519 Ilorin Place', '', '395', 'Kerala', '2006-02-15T09:45:30', '357445645426', '49298'), + ('1447 Imus Place', '', '426', 'Gujarat', '2006-02-15T09:45:30', '62127829280', '12905'), + ('990 Etawah Loop', '', '564', 'Tamil Nadu', '2006-02-15T09:45:30', '206169448769', '79940'), + ('57 Arlington Manor', '', '475', 'Madhya Pradesh', '2006-02-15T09:45:30', '990214419142', '48960'), + ('1540 Wroclaw Drive', '', '107', 'Maharashtra', '2006-02-15T09:45:30', '182363341674', '62686'), + ('1014 Loja Manor', '', '22', 'Tamil Nadu', '2006-02-15T09:45:30', '460795526514', '66851'), + ('808 Bhopal Manor', '', '582', 'Haryana', '2006-02-15T09:45:30', '465887807014', '10672'), + ('1697 Tanauan Lane', '', '399', 'Punjab', '2006-02-15T09:45:30', '4764773857', '22870'), + ('9 San Miguel de Tucumn Manor', '', '169', 'Uttar Pradesh', '2006-02-15T09:45:30', '956188728558', '90845'), + ('45 Aparecida de Goinia Place', '', '464', 'Madhya Pradesh', '2006-02-15T09:45:30', '650496654258', '7431'), + ('1704 Tambaram Manor', '', '554', 'West Bengali', '2006-02-15T09:45:30', '39463554936', '2834'), + ('1967 Sincelejo Place', '', '176', 'Gujarat', '2006-02-15T09:45:30', '577812616052', '73644') + ) AS data(address, address2, old_city_id, district, last_update, phone, postal_code) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."city"' + AND map0.old_id = data.old_city_id + RETURNING address_id + ) + SELECT array_agg(address_id) INTO v_new_ids_address FROM inserted; + + FOR i IN 1..array_length(v_new_ids_address, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."address"', v_old_ids_address[i], v_new_ids_address[i]::TEXT); + END LOOP; + + v_old_ids_address := ARRAY['19', '426', '36', '305', '535', '174', '35', '540', '418', '127', '242', '276', '279', '63', '206', '82', '156', '507', '497', '125', '221', '424', '375', '301', '513', '384', '514', '321', '212', '431', '179', '473', '372', '417', '32', '190', '302', '235', '222', '522', '232', '2', '4', '411', '338', '339', '443', '531', '504', '225', '37', '547', '444', '314', '47', '60', '386', '349', '8', '261', '109', '380', '392', '461', '204', '73', '446', '180', '161', '368', '197', '337', '334', '25', '152', '86', '391', '480', '191', '135', '551', '466', '76', '554', '248', '98', '240', '354', '439', '528', '510', '586', '393', '268', '376', '75', '266', '31', '378', '192']; + WITH inserted AS ( + INSERT INTO "public"."address" ("address", "address2", "city_id", "district", "last_update", "phone", "postal_code") + SELECT + data.address::character varying, + data.address2::character varying, + map0.new_id::smallint, + data.district::character varying, + data.last_update::timestamp without time zone, + data.phone::character varying, + data.postal_code::character varying + FROM (VALUES + ('419 Iligan Lane', '', '76', 'Madhya Pradesh', '2006-02-15T09:45:30', '990911107354', '72878'), + ('1661 Abha Drive', '', '416', 'Tamil Nadu', '2006-02-15T09:45:30', '270456873752', '14400'), + ('176 Mandaluyong Place', '', '239', 'Uttar Pradesh', '2006-02-15T09:45:30', '627705991774', '65213'), + ('41 El Alto Parkway', '', '398', 'Maharashtra', '2006-02-15T09:45:30', '51917807050', '56883'), + ('635 Brest Manor', '', '75', 'Andhra Pradesh', '2006-02-15T09:45:30', '80593242951', '40899'), + ('1877 Ezhou Lane', '', '550', 'Rajasthan', '2006-02-15T09:45:30', '264541743403', '63337'), + ('33 Gorontalo Way', '', '257', 'West Bengali', '2006-02-15T09:45:30', '745994947458', '30348'), + ('949 Allende Lane', '', '24', 'Uttar Pradesh', '2006-02-15T09:45:30', '122981120653', '67521'), + ('126 Acua Parkway', '', '71', 'West Bengali', '2006-02-15T09:45:30', '480039662421', '58888'), + ('117 Boa Vista Way', '', '566', 'Uttar Pradesh', '2006-02-15T09:45:30', '677976133614', '6804'), + ('1964 Gijn Manor', '', '473', 'Karnataka', '2006-02-15T09:45:30', '918119601885', '14408'), + ('1675 Xiangfan Manor', '', '283', 'Tamil Nadu', '2006-02-15T09:45:30', '271149517630', '11763'), + ('1884 Shikarpur Avenue', '', '263', 'Haryana', '2006-02-15T09:45:30', '959949395183', '85548'), + ('1213 Ranchi Parkway', '', '350', 'Karnataka', '2006-02-15T09:45:30', '800024380485', '94352'), + ('642 Nador Drive', '', '77', 'Maharashtra', '2006-02-15T09:45:30', '369050085652', '3924'), + ('936 Salzburg Lane', '', '425', 'Uttar Pradesh', '2006-02-15T09:45:30', '875756771675', '96709'), + ('1963 Moscow Place', '', '354', 'Assam', '2006-02-15T09:45:30', '761379480249', '64863'), + ('1197 Sokoto Boulevard', '', '478', 'West Bengali', '2006-02-15T09:45:30', '868602816371', '87687'), + ('1013 Tabuk Boulevard', '', '261', 'West Bengali', '2006-02-15T09:45:30', '158399646978', '96203'), + ('211 Chiayi Drive', '', '164', 'Uttar Pradesh', '2006-02-15T09:45:30', '665993880048', '58186'), + ('866 Shivapuri Manor', '', '448', 'Uttar Pradesh', '2006-02-15T09:45:30', '778502731092', '22474'), + ('1948 Bayugan Parkway', '', '264', 'Bihar', '2006-02-15T09:45:30', '987306329957', '60622'), + ('1049 Matamoros Parkway', '', '191', 'Karnataka', '2006-02-15T09:45:30', '960505250340', '69640'), + ('951 Stara Zagora Manor', '', '400', 'Punjab', '2006-02-15T09:45:30', '429925609431', '98573'), + ('758 Korolev Parkway', '', '568', 'Andhra Pradesh', '2006-02-15T09:45:30', '441628280920', '75474'), + ('97 Mogiljov Lane', '', '73', 'Gujarat', '2006-02-15T09:45:30', '924815207181', '89294'), + ('1747 Rustenburg Place', '', '110', 'Bihar', '2006-02-15T09:45:30', '442673923363', '51369'), + ('651 Pathankot Loop', '', '336', 'Maharashtra', '2006-02-15T09:45:30', '139378397418', '59811'), + ('624 Oshawa Boulevard', '', '51', 'West Bengali', '2006-02-15T09:45:30', '49677664184', '89959'), + ('1596 Acua Parkway', '', '418', 'Jharkhand', '2006-02-15T09:45:30', '157133457169', '70425'), + ('431 Xiangtan Avenue', '', '18', 'Kerala', '2006-02-15T09:45:30', '230250973122', '4854'), + ('1257 Guadalajara Street', '', '78', 'Karnataka', '2006-02-15T09:45:30', '195337700615', '33599'), + ('230 Urawa Drive', '', '8', 'Andhra Pradesh', '2006-02-15T09:45:30', '166898395731', '2738'), + ('791 Salinas Street', '', '208', 'Punjab', '2006-02-15T09:45:30', '129953030512', '40509'), + ('1425 Shikarpur Manor', '', '346', 'Bihar', '2006-02-15T09:45:30', '678220867005', '65599'), + ('435 0 Way', '', '195', 'West Bengali', '2006-02-15T09:45:30', '760171523969', '74750'), + ('922 Vila Velha Loop', '', '9', 'Maharashtra', '2006-02-15T09:45:30', '510737228015', '4085'), + ('954 Kimchon Place', '', '559', 'West Bengali', '2006-02-15T09:45:30', '541327526474', '42420'), + ('1168 Najafabad Parkway', '', '251', 'Kabol', '2006-02-15T09:45:30', '886649065861', '40301'), + ('1768 Udine Loop', '', '60', 'Battambang', '2006-02-15T09:45:30', '448876499197', '32347'), + ('754 Valencia Place', '', '406', 'Phnom Penh', '2006-02-15T09:45:30', '594319417514', '87911'), + ('28 MySQL Boulevard', NULL, '576', 'QLD', '2006-02-15T09:45:30', '', ''), + ('1411 Lillydale Drive', NULL, '576', 'QLD', '2006-02-15T09:45:30', '6172235589', ''), + ('264 Bhimavaram Manor', '', '111', 'St Thomas', '2006-02-15T09:45:30', '302526949177', '54749'), + ('431 Szkesfehrvr Avenue', '', '48', 'Baki', '2006-02-15T09:45:30', '119501405123', '57828'), + ('503 Sogamoso Loop', '', '505', 'Sumqayit', '2006-02-15T09:45:30', '834626715837', '49812'), + ('1836 Korla Parkway', '', '272', 'Copperbelt', '2006-02-15T09:45:30', '689681677428', '55405'), + ('1986 Sivas Place', '', '551', 'Friuli-Venezia Giuli', '2006-02-15T09:45:30', '182059202712', '95775'), + ('1 Valle de Santiago Avenue', '', '93', 'Apulia', '2006-02-15T09:45:30', '465897838272', '86208'), + ('1926 Gingoog Street', '', '511', 'Sisilia', '2006-02-15T09:45:30', '469738825391', '22824'), + ('127 Purnea (Purnia) Manor', '', '17', 'Piemonte', '2006-02-15T09:45:30', '911872220378', '79388'), + ('379 Lublin Parkway', '', '309', 'Toscana', '2006-02-15T09:45:30', '921960450089', '74568'), + ('231 Kaliningrad Place', '', '70', 'Lombardia', '2006-02-15T09:45:30', '575081026569', '57833'), + ('1224 Huejutla de Reyes Boulevard', '', '91', 'Lombardia', '2006-02-15T09:45:30', '806016930576', '70923'), + ('1447 Imus Way', '', '167', 'Tahiti', '2006-02-15T09:45:30', '539758313890', '48942'), + ('1668 Saint Louis Place', '', '397', 'Tahiti', '2006-02-15T09:45:30', '347487831378', '39072'), + ('1368 Maracabo Boulevard', '', '493', '', '2006-02-15T09:45:30', '934352415130', '32716'), + ('1516 Escobar Drive', '', '370', 'Tongatapu', '2006-02-15T09:45:30', '64536069371', '46069'), + ('1566 Inegl Manor', '', '349', 'Mandalay', '2006-02-15T09:45:30', '705814003527', '53561'), + ('51 Laredo Avenue', '', '342', 'Sagaing', '2006-02-15T09:45:30', '884536620568', '68146'), + ('454 Nakhon Sawan Boulevard', '', '173', 'Funafuti', '2006-02-15T09:45:30', '963887147572', '76383'), + ('1519 Santiago de los Caballeros Loop', '', '348', 'East Kasai', '2006-02-15T09:45:30', '409315295763', '22025'), + ('514 Ife Way', '', '315', 'Shaba', '2006-02-15T09:45:30', '900235712074', '69973'), + ('1889 Valparai Way', '', '600', 'Ziguinchor', '2006-02-15T09:45:30', '670370974122', '75559'), + ('387 Mwene-Ditu Drive', '', '35', 'Ahal', '2006-02-15T09:45:30', '764477681869', '8073'), + ('1031 Daugavpils Parkway', '', '63', 'Bchar', '2006-02-15T09:45:30', '107137400143', '59025'), + ('1924 Shimonoseki Drive', '', '59', 'Batna', '2006-02-15T09:45:30', '406784385440', '52625'), + ('757 Rustenburg Avenue', '', '483', 'Skikda', '2006-02-15T09:45:30', '506134035434', '89668'), + ('1386 Nakhon Sawan Boulevard', '', '420', 'Pyongyang-si', '2006-02-15T09:45:30', '368899174225', '53502'), + ('1658 Jastrzebie-Zdrj Loop', '', '372', 'Central', '2006-02-15T09:45:30', '568367775448', '96584'), + ('447 Surakarta Loop', '', '271', 'Nyanza', '2006-02-15T09:45:30', '940830176580', '10428'), + ('1838 Tabriz Lane', '', '143', 'Dhaka', '2006-02-15T09:45:30', '38988715447', '1195'), + ('1816 Bydgoszcz Loop', '', '234', 'Dhaka', '2006-02-15T09:45:30', '965273813662', '64308'), + ('262 A Corua (La Corua) Parkway', '', '525', 'Dhaka', '2006-02-15T09:45:30', '892775750063', '34418'), + ('1952 Pune Lane', '', '442', 'Saint-Denis', '2006-02-15T09:45:30', '354615066969', '92150'), + ('927 Baha Blanca Parkway', '', '479', 'Krim', '2006-02-15T09:45:30', '821972242086', '9495'), + ('1793 Meixian Place', '', '258', 'Hmelnytskyi', '2006-02-15T09:45:30', '619966287415', '33535'), + ('421 Yaound Street', '', '385', 'Sumy', '2006-02-15T09:45:30', '726875628268', '11363'), + ('140 Chiayi Parkway', '', '506', 'Sumy', '2006-02-15T09:45:30', '855863906434', '38982'), + ('1752 So Leopoldo Parkway', '', '345', 'Taka-Karpatia', '2006-02-15T09:45:30', '252265130067', '14014'), + ('182 Nukualofa Drive', '', '275', 'Sumy', '2006-02-15T09:45:30', '426346224043', '15414'), + ('118 Jaffna Loop', '', '182', 'Northern Mindanao', '2006-02-15T09:45:30', '325526730021', '10447'), + ('89 Allappuzha (Alleppey) Manor', '', '517', 'National Capital Reg', '2006-02-15T09:45:30', '255800440636', '75444'), + ('947 Trshavn Place', '', '528', 'Central Luzon', '2006-02-15T09:45:30', '50898428626', '841'), + ('582 Papeete Loop', '', '294', 'Central Visayas', '2006-02-15T09:45:30', '569868543137', '27722'), + ('152 Kitwe Parkway', '', '82', 'Caraga', '2006-02-15T09:45:30', '835433605312', '53182'), + ('1479 Rustenburg Boulevard', '', '527', 'Southern Tagalog', '2006-02-15T09:45:30', '727785483194', '18727'), + ('953 Hodeida Street', '', '221', 'Southern Tagalog', '2006-02-15T09:45:30', '53912826864', '18841'), + ('1351 Aparecida de Goinia Parkway', '', '391', 'Northern Mindanao', '2006-02-15T09:45:30', '959834530529', '41775'), + ('1176 Southend-on-Sea Manor', '', '458', 'Southern Tagalog', '2006-02-15T09:45:30', '236679267178', '81651'), + ('48 Maracabo Place', '', '519', 'Central Luzon', '2006-02-15T09:45:30', '82671830126', '1570'), + ('951 Springs Lane', '', '219', 'Central Mindanao', '2006-02-15T09:45:30', '165164761435', '96115'), + ('717 Changzhou Lane', '', '104', 'Southern Tagalog', '2006-02-15T09:45:30', '426255288071', '21615'), + ('1831 Nam Dinh Loop', '', '323', 'National Capital Reg', '2006-02-15T09:45:30', '322888976727', '51990'), + ('1061 Ede Avenue', '', '98', 'Southern Tagalog', '2006-02-15T09:45:30', '333390595558', '57810'), + ('492 Cam Ranh Street', '', '61', 'Eastern Visayas', '2006-02-15T09:45:30', '565018274456', '50805'), + ('862 Xintai Lane', '', '548', 'Cagayan Valley', '2006-02-15T09:45:30', '265153400632', '30065'), + ('217 Botshabelo Place', '', '138', 'Southern Mindanao', '2006-02-15T09:45:30', '665356572025', '49521'), + ('1191 Tandil Drive', '', '523', 'Southern Tagalog', '2006-02-15T09:45:30', '45554316010', '6362'), + ('1166 Changhwa Street', '', '62', 'Caraga', '2006-02-15T09:45:30', '650752094490', '58852') + ) AS data(address, address2, old_city_id, district, last_update, phone, postal_code) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."city"' + AND map0.old_id = data.old_city_id + RETURNING address_id + ) + SELECT array_agg(address_id) INTO v_new_ids_address FROM inserted; + + FOR i IN 1..array_length(v_new_ids_address, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."address"', v_old_ids_address[i], v_new_ids_address[i]::TEXT); + END LOOP; + + v_old_ids_address := ARRAY['260', '400', '54', '303', '141', '479', '420', '346', '188', '577', '578', '564', '323', '132', '275', '385', '506', '347', '448', '220', '187', '233', '557', '81', '330', '319', '403', '315', '550', '359', '210', '379', '182', '134', '259', '96', '250', '130', '312', '78', '432', '597', '367', '51', '43', '103', '241', '92', '542', '249', '164', '398', '21', '381', '300', '573', '50', '306', '195', '356', '48', '402', '351', '183', '435', '226', '110', '433', '52', '59', '492', '104', '467', '131', '515', '355', '452', '316', '85', '262', '101', '438', '263', '423', '442', '436', '460', '340', '519', '243', '207', '333', '511', '455', '548', '120', '377', '463', '416', '478']; + WITH inserted AS ( + INSERT INTO "public"."address" ("address", "address2", "city_id", "district", "last_update", "phone", "postal_code") + SELECT + data.address::character varying, + data.address2::character varying, + map0.new_id::smallint, + data.district::character varying, + data.last_update::timestamp without time zone, + data.phone::character varying, + data.postal_code::character varying + FROM (VALUES + ('127 Iwakuni Boulevard', '', '192', 'Central Luzon', '2006-02-15T09:45:30', '987442542471', '20777'), + ('1152 Citrus Heights Manor', '', '15', 'al-Qadarif', '2006-02-15T09:45:30', '765957414528', '5239'), + ('115 Hidalgo Parkway', '', '379', 'Khartum', '2006-02-15T09:45:30', '307703950263', '80168'), + ('898 Jining Lane', '', '387', 'Pohjois-Pohjanmaa', '2006-02-15T09:45:30', '161643343536', '40070'), + ('1749 Daxian Place', '', '29', 'Gelderland', '2006-02-15T09:45:30', '963369996279', '11044'), + ('1854 Okara Boulevard', '', '158', 'Drenthe', '2006-02-15T09:45:30', '131912793873', '42123'), + ('992 Klerksdorp Loop', '', '23', 'Utrecht', '2006-02-15T09:45:30', '855290087237', '33711'), + ('1217 Konotop Avenue', '', '151', 'Gelderland', '2006-02-15T09:45:30', '718917251754', '504'), + ('741 Ambattur Manor', '', '438', 'Noord-Brabant', '2006-02-15T09:45:30', '302590383819', '43310'), + ('1501 Pangkal Pinang Avenue', '', '409', 'Mazowieckie', '2006-02-15T09:45:30', '770864062795', '943'), + ('1405 Hagonoy Avenue', '', '133', 'Slaskie', '2006-02-15T09:45:30', '867287719310', '86587'), + ('505 Madiun Boulevard', '', '577', 'Dolnoslaskie', '2006-02-15T09:45:30', '970638808606', '97271'), + ('1769 Iwaki Lane', '', '97', 'Kujawsko-Pomorskie', '2006-02-15T09:45:30', '556100547674', '25787'), + ('1050 Garden Grove Avenue', '', '236', 'Slaskie', '2006-02-15T09:45:30', '973047364353', '4999'), + ('906 Goinia Way', '', '255', 'Wielkopolskie', '2006-02-15T09:45:30', '701767622697', '83565'), + ('1642 Charlotte Amalie Drive', '', '549', 'Slaskie', '2006-02-15T09:45:30', '821476736117', '75442'), + ('414 Mandaluyong Street', '', '314', 'Lubelskie', '2006-02-15T09:45:30', '52709222667', '16370'), + ('1293 Nam Dinh Way', '', '84', 'Roraima', '2006-02-15T09:45:30', '697656479977', '71583'), + ('614 Denizli Parkway', '', '486', 'Rio Grande do Sul', '2006-02-15T09:45:30', '876491807547', '29444'), + ('1201 Qomsheh Manor', '', '28', 'Gois', '2006-02-15T09:45:30', '873492228462', '21464'), + ('1839 Szkesfehrvr Parkway', '', '317', 'Gois', '2006-02-15T09:45:30', '947468818183', '55709'), + ('356 Olomouc Manor', '', '26', 'Gois', '2006-02-15T09:45:30', '22326410776', '93323'), + ('1407 Pachuca de Soto Place', '', '21', 'Rio Grande do Sul', '2006-02-15T09:45:30', '380077794770', '26284'), + ('1692 Ede Loop', '', '30', 'So Paulo', '2006-02-15T09:45:30', '918711376618', '9223'), + ('981 Kumbakonam Place', '', '89', 'Distrito Federal', '2006-02-15T09:45:30', '829116184079', '87611'), + ('1957 Yantai Lane', '', '490', 'So Paulo', '2006-02-15T09:45:30', '704948322302', '59255'), + ('1190 0 Place', '', '44', 'Rio Grande do Sul', '2006-02-15T09:45:30', '841876514789', '10417'), + ('543 Bergamo Avenue', '', '215', 'Minas Gerais', '2006-02-15T09:45:30', '103602195112', '59686'), + ('1715 Okayama Street', '', '485', 'So Paulo', '2006-02-15T09:45:30', '169352919175', '55676'), + ('519 Nyeri Manor', '', '461', 'So Paulo', '2006-02-15T09:45:30', '764680915323', '37650'), + ('1304 s-Hertogenbosch Way', '', '83', 'Santa Catarina', '2006-02-15T09:45:30', '90336226227', '10925'), + ('1133 Rizhao Avenue', '', '572', 'Pernambuco', '2006-02-15T09:45:30', '600264533987', '2800'), + ('1891 Rizhao Boulevard', '', '456', 'So Paulo', '2006-02-15T09:45:30', '391065549876', '47288'), + ('758 Junan Lane', '', '190', 'Gois', '2006-02-15T09:45:30', '935448624185', '82639'), + ('1338 Zalantun Lane', '', '413', 'Minas Gerais', '2006-02-15T09:45:30', '840522972766', '45403'), + ('984 Effon-Alaiye Avenue', '', '183', 'Gois', '2006-02-15T09:45:30', '132986892228', '17119'), + ('829 Grand Prairie Way', '', '328', 'Paran', '2006-02-15T09:45:30', '741070712873', '6461'), + ('1666 Qomsheh Drive', '', '410', 'So Paulo', '2006-02-15T09:45:30', '582835362905', '66255'), + ('1354 Siegen Street', '', '25', 'Rio de Janeiro', '2006-02-15T09:45:30', '573441801529', '80184'), + ('1206 Dos Quebradas Place', '', '431', 'So Paulo', '2006-02-15T09:45:30', '241832790687', '20207'), + ('259 Ipoh Drive', '', '189', 'So Paulo', '2006-02-15T09:45:30', '419009857119', '64964'), + ('32 Liaocheng Way', '', '248', 'Minas Gerais', '2006-02-15T09:45:30', '410877354933', '1944'), + ('1163 London Parkway', '', '66', 'Par', '2006-02-15T09:45:30', '675120358494', '6066'), + ('686 Garland Manor', '', '247', 'Cear', '2006-02-15T09:45:30', '69493378813', '52535'), + ('306 Antofagasta Place', '', '569', 'Esprito Santo', '2006-02-15T09:45:30', '378318851631', '3989'), + ('588 Vila Velha Manor', '', '268', 'Kyongsangbuk', '2006-02-15T09:45:30', '333339908719', '51540'), + ('647 A Corua (La Corua) Street', '', '357', 'Chollanam', '2006-02-15T09:45:30', '792557457753', '36971'), + ('1942 Ciparay Parkway', '', '113', 'Cheju', '2006-02-15T09:45:30', '978987363654', '82624'), + ('193 Bhusawal Place', '', '539', 'Kang-won', '2006-02-15T09:45:30', '745267607502', '9750'), + ('300 Junan Street', '', '553', 'Kyonggi', '2006-02-15T09:45:30', '890289150158', '81314'), + ('1623 Baha Blanca Manor', '', '310', 'Moskova', '2006-02-15T09:45:30', '149981248346', '81511'), + ('954 Lapu-Lapu Way', '', '278', 'Moskova', '2006-02-15T09:45:30', '737229003916', '8816'), + ('270 Toulon Boulevard', '', '156', 'Kalmykia', '2006-02-15T09:45:30', '407752414682', '81766'), + ('1618 Olomouc Manor', '', '285', 'Kurgan', '2006-02-15T09:45:30', '96846695220', '26385'), + ('661 Chisinau Lane', '', '274', 'Pietari', '2006-02-15T09:45:30', '816436065431', '8856'), + ('1407 Surakarta Manor', '', '466', 'Moskova', '2006-02-15T09:45:30', '324346485054', '33224'), + ('46 Pjatigorsk Lane', '', '343', 'Moscow (City)', '2006-02-15T09:45:30', '262076994845', '23616'), + ('1883 Maikop Lane', '', '254', 'Kaliningrad', '2006-02-15T09:45:30', '96110042435', '68469'), + ('1077 San Felipe de Puerto Plata Place', '', '369', 'Rostov-na-Donu', '2006-02-15T09:45:30', '812824036424', '65387'), + ('1378 Beira Loop', '', '597', 'Krasnojarsk', '2006-02-15T09:45:30', '840957664136', '40792'), + ('1998 Halifax Drive', '', '308', 'Lipetsk', '2006-02-15T09:45:30', '177727722820', '76022'), + ('616 Hagonoy Avenue', '', '39', 'Krasnojarsk', '2006-02-15T09:45:30', '604177838256', '46043'), + ('1157 Nyeri Loop', '', '320', 'Adygea', '2006-02-15T09:45:30', '262744791493', '56380'), + ('1089 Iwatsuki Avenue', '', '270', 'Kirov', '2006-02-15T09:45:30', '866092335135', '35109'), + ('740 Udaipur Lane', '', '150', 'Nizni Novgorod', '2006-02-15T09:45:30', '497288595103', '33505'), + ('810 Palghat (Palakkad) Boulevard', '', '235', 'Jaroslavl', '2006-02-15T09:45:30', '516331171356', '73431'), + ('1867 San Juan Bautista Tuxtepec Avenue', '', '225', 'Ivanovo', '2006-02-15T09:45:30', '547003310357', '78311'), + ('1823 Hoshiarpur Lane', '', '510', 'Komi', '2006-02-15T09:45:30', '307133768620', '33191'), + ('909 Garland Manor', '', '367', 'Tatarstan', '2006-02-15T09:45:30', '705800322606', '69367'), + ('1697 Kowloon and New Kowloon Loop', '', '49', 'Moskova', '2006-02-15T09:45:30', '499352017190', '57807'), + ('185 Mannheim Lane', '', '408', 'Stavropol', '2006-02-15T09:45:30', '589377568313', '23661'), + ('1913 Kamakura Place', '', '238', 'Lipetsk', '2006-02-15T09:45:30', '942570536750', '97287'), + ('1621 Tongliao Avenue', '', '558', 'Irkutsk', '2006-02-15T09:45:30', '209342540247', '22173'), + ('801 Hagonoy Drive', '', '484', 'Smolensk', '2006-02-15T09:45:30', '237426099212', '8439'), + ('886 Tonghae Place', '', '259', 'Volgograd', '2006-02-15T09:45:30', '711928348157', '19450'), + ('469 Nakhon Sawan Street', '', '531', 'Tuvassia', '2006-02-15T09:45:30', '689199636560', '58866'), + ('207 Cuernavaca Loop', '', '352', 'Tatarstan', '2006-02-15T09:45:30', '782900030287', '52671'), + ('746 Joliet Lane', '', '286', 'Kursk', '2006-02-15T09:45:30', '688485191923', '94878'), + ('320 Baiyin Parkway', '', '319', 'Mahajanga', '2006-02-15T09:45:30', '223664661973', '37307'), + ('771 Yaound Manor', '', '64', 'Sofala', '2006-02-15T09:45:30', '245477603573', '86768'), + ('1599 Plock Drive', '', '534', 'Tete', '2006-02-15T09:45:30', '817248913162', '71986'), + ('596 Huixquilucan Place', '', '351', 'Nampula', '2006-02-15T09:45:30', '342709348083', '65892'), + ('532 Toulon Street', '', '460', 'Santiago', '2006-02-15T09:45:30', '46871694740', '69517'), + ('437 Chungho Drive', '', '450', 'Puerto Plata', '2006-02-15T09:45:30', '491271355190', '59489'), + ('1245 Ibirit Way', '', '290', 'La Romana', '2006-02-15T09:45:30', '331888642162', '40926'), + ('287 Cuautla Boulevard', '', '501', 'Chuquisaca', '2006-02-15T09:45:30', '82619513349', '72736'), + ('659 Gatineau Boulevard', '', '153', 'La Paz', '2006-02-15T09:45:30', '205524798287', '28587'), + ('507 Smolensk Loop', '', '492', 'Sousse', '2006-02-15T09:45:30', '80303246192', '22971'), + ('962 Tama Loop', '', '583', '', '2006-02-15T09:45:30', '282667506728', '65952'), + ('47 Syktyvkar Lane', '', '118', 'West Java', '2006-02-15T09:45:30', '63937119031', '22236'), + ('1688 Nador Lane', '', '184', 'Sulawesi Utara', '2006-02-15T09:45:30', '652218196731', '61613'), + ('1860 Taguig Loop', '', '119', 'West Java', '2006-02-15T09:45:30', '38158430589', '59550'), + ('1152 al-Qatif Lane', '', '412', 'Kalimantan Barat', '2006-02-15T09:45:30', '131370665218', '44816'), + ('1947 Paarl Way', '', '509', 'Central Java', '2006-02-15T09:45:30', '834061016202', '23636'), + ('1658 Cuman Loop', '', '396', 'Sumatera Selatan', '2006-02-15T09:45:30', '784907335610', '51309'), + ('544 Malm Parkway', '', '403', 'Central Java', '2006-02-15T09:45:30', '386759646229', '63502'), + ('154 Oshawa Manor', '', '415', 'East Java', '2006-02-15T09:45:30', '440365973660', '72771'), + ('935 Aden Boulevard', '', '532', 'Central Java', '2006-02-15T09:45:30', '335052544020', '64709'), + ('1445 Carmen Parkway', '', '117', 'West Java', '2006-02-15T09:45:30', '598912394463', '70809'), + ('1078 Stara Zagora Drive', '', '301', 'Aceh', '2006-02-15T09:45:30', '932992626595', '69221') + ) AS data(address, address2, old_city_id, district, last_update, phone, postal_code) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."city"' + AND map0.old_id = data.old_city_id + RETURNING address_id + ) + SELECT array_agg(address_id) INTO v_new_ids_address FROM inserted; + + FOR i IN 1..array_length(v_new_ids_address, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."address"', v_old_ids_address[i], v_new_ids_address[i]::TEXT); + END LOOP; + + v_old_ids_address := ARRAY['530', '157', '505']; + WITH inserted AS ( + INSERT INTO "public"."address" ("address", "address2", "city_id", "district", "last_update", "phone", "postal_code") + SELECT + data.address::character varying, + data.address2::character varying, + map0.new_id::smallint, + data.district::character varying, + data.last_update::timestamp without time zone, + data.phone::character varying, + data.postal_code::character varying + FROM (VALUES + ('1003 Qinhuangdao Street', '', '419', 'West Java', '2006-02-15T09:45:30', '35533115997', '25972'), + ('456 Escobar Way', '', '232', 'Jakarta Raya', '2006-02-15T09:45:30', '719202533520', '36061'), + ('519 Brescia Parkway', '', '318', 'East Java', '2006-02-15T09:45:30', '793996678771', '69504') + ) AS data(address, address2, old_city_id, district, last_update, phone, postal_code) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."city"' + AND map0.old_id = data.old_city_id + RETURNING address_id + ) + SELECT array_agg(address_id) INTO v_new_ids_address FROM inserted; + + FOR i IN 1..array_length(v_new_ids_address, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."address"', v_old_ids_address[i], v_new_ids_address[i]::TEXT); + END LOOP; + + -- Table: "public"."inventory" (4581 records) + v_old_ids_inventory := ARRAY['3683', '3680', '3679', '3681', '3682', '3910', '3909', '3911', '3737', '3738', '3329', '3328', '3327', '3326', '290', '287', '288', '289', '4209', '4210', '4207', '4211', '4208', '4212', '4571', '4569', '4573', '4570', '4572', '2578', '2576', '2577', '808', '810', '809', '812', '811', '813', '2988', '2989', '2987', '2990', '2991', '2986', '154', '155', '340', '341', '339', '2981', '2980', '1659', '1660', '3614', '3613', '3608', '3615', '3611', '3612', '3609', '3610', '4277', '4274', '4272', '4276', '4273', '4275', '372', '373', '159', '156', '158', '157', '1042', '1045', '1046', '1044', '1047', '1043', '3629', '3630', '3631', '1625', '1626', '3472', '3473', '3474', '2626', '2622', '2621', '2623', '2624', '2625', '2925', '2926', '2927', '2922', '2923', '2924', '2095']; + WITH inserted AS ( + INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") + SELECT + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + ('805', '2006-02-15T10:09:17', 2), + ('805', '2006-02-15T10:09:17', 1), + ('805', '2006-02-15T10:09:17', 1), + ('805', '2006-02-15T10:09:17', 2), + ('805', '2006-02-15T10:09:17', 2), + ('853', '2006-02-15T10:09:17', 1), + ('853', '2006-02-15T10:09:17', 1), + ('853', '2006-02-15T10:09:17', 1), + ('817', '2006-02-15T10:09:17', 1), + ('817', '2006-02-15T10:09:17', 1), + ('732', '2006-02-15T10:09:17', 1), + ('732', '2006-02-15T10:09:17', 1), + ('732', '2006-02-15T10:09:17', 1), + ('732', '2006-02-15T10:09:17', 1), + ('65', '2006-02-15T10:09:17', 2), + ('65', '2006-02-15T10:09:17', 2), + ('65', '2006-02-15T10:09:17', 2), + ('65', '2006-02-15T10:09:17', 2), + ('915', '2006-02-15T10:09:17', 1), + ('915', '2006-02-15T10:09:17', 1), + ('915', '2006-02-15T10:09:17', 1), + ('915', '2006-02-15T10:09:17', 2), + ('915', '2006-02-15T10:09:17', 1), + ('915', '2006-02-15T10:09:17', 2), + ('999', '2006-02-15T10:09:17', 2), + ('999', '2006-02-15T10:09:17', 1), + ('999', '2006-02-15T10:09:17', 2), + ('999', '2006-02-15T10:09:17', 1), + ('999', '2006-02-15T10:09:17', 2), + ('564', '2006-02-15T10:09:17', 2), + ('564', '2006-02-15T10:09:17', 2), + ('564', '2006-02-15T10:09:17', 2), + ('176', '2006-02-15T10:09:17', 1), + ('176', '2006-02-15T10:09:17', 2), + ('176', '2006-02-15T10:09:17', 1), + ('176', '2006-02-15T10:09:17', 2), + ('176', '2006-02-15T10:09:17', 2), + ('176', '2006-02-15T10:09:17', 2), + ('655', '2006-02-15T10:09:17', 1), + ('655', '2006-02-15T10:09:17', 2), + ('655', '2006-02-15T10:09:17', 1), + ('655', '2006-02-15T10:09:17', 2), + ('655', '2006-02-15T10:09:17', 2), + ('655', '2006-02-15T10:09:17', 1), + ('32', '2006-02-15T10:09:17', 2), + ('32', '2006-02-15T10:09:17', 2), + ('75', '2006-02-15T10:09:17', 2), + ('75', '2006-02-15T10:09:17', 2), + ('75', '2006-02-15T10:09:17', 2), + ('653', '2006-02-15T10:09:17', 1), + ('653', '2006-02-15T10:09:17', 1), + ('362', '2006-02-15T10:09:17', 1), + ('362', '2006-02-15T10:09:17', 1), + ('789', '2006-02-15T10:09:17', 2), + ('789', '2006-02-15T10:09:17', 2), + ('789', '2006-02-15T10:09:17', 1), + ('789', '2006-02-15T10:09:17', 2), + ('789', '2006-02-15T10:09:17', 1), + ('789', '2006-02-15T10:09:17', 2), + ('789', '2006-02-15T10:09:17', 1), + ('789', '2006-02-15T10:09:17', 1), + ('930', '2006-02-15T10:09:17', 2), + ('930', '2006-02-15T10:09:17', 1), + ('930', '2006-02-15T10:09:17', 1), + ('930', '2006-02-15T10:09:17', 2), + ('930', '2006-02-15T10:09:17', 1), + ('930', '2006-02-15T10:09:17', 2), + ('82', '2006-02-15T10:09:17', 1), + ('82', '2006-02-15T10:09:17', 1), + ('34', '2006-02-15T10:09:17', 2), + ('34', '2006-02-15T10:09:17', 2), + ('34', '2006-02-15T10:09:17', 2), + ('34', '2006-02-15T10:09:17', 2), + ('233', '2006-02-15T10:09:17', 1), + ('233', '2006-02-15T10:09:17', 1), + ('233', '2006-02-15T10:09:17', 2), + ('233', '2006-02-15T10:09:17', 1), + ('233', '2006-02-15T10:09:17', 2), + ('233', '2006-02-15T10:09:17', 1), + ('792', '2006-02-15T10:09:17', 2), + ('792', '2006-02-15T10:09:17', 2), + ('792', '2006-02-15T10:09:17', 2), + ('355', '2006-02-15T10:09:17', 2), + ('355', '2006-02-15T10:09:17', 2), + ('761', '2006-02-15T10:09:17', 2), + ('761', '2006-02-15T10:09:17', 2), + ('761', '2006-02-15T10:09:17', 2), + ('575', '2006-02-15T10:09:17', 2), + ('575', '2006-02-15T10:09:17', 1), + ('575', '2006-02-15T10:09:17', 1), + ('575', '2006-02-15T10:09:17', 2), + ('575', '2006-02-15T10:09:17', 2), + ('575', '2006-02-15T10:09:17', 2), + ('643', '2006-02-15T10:09:17', 2), + ('643', '2006-02-15T10:09:17', 2), + ('643', '2006-02-15T10:09:17', 2), + ('643', '2006-02-15T10:09:17', 1), + ('643', '2006-02-15T10:09:17', 1), + ('643', '2006-02-15T10:09:17', 1), + ('454', '2006-02-15T10:09:17', 1) + ) AS data(old_film_id, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."film"' + AND map0.old_id = data.old_film_id + RETURNING inventory_id + ) + SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; + + FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); + END LOOP; + + v_old_ids_inventory := ARRAY['2094', '318', '319', '316', '317', '2258', '2255', '2256', '2257', '2259', '412', '416', '417', '418', '411', '415', '413', '414', '1783', '1782', '1779', '1780', '1778', '1781', '4390', '4391', '2113', '2115', '2114', '2116', '2112', '2117', '3308', '3310', '3306', '3309', '3307', '3204', '3203', '3206', '3205', '3202', '3428', '3430', '3429', '3743', '3740', '3742', '3741', '3739', '2658', '2657', '2656', '2660', '2659', '2859', '2858', '2857', '2860', '3809', '3808', '3810', '734', '732', '731', '735', '733', '2232', '2235', '2233', '2231', '2234', '861', '862', '860', '857', '858', '859', '3757', '3758', '1120', '1119', '2948', '2947', '2951', '2949', '2946', '2950', '1019', '1022', '1016', '1021', '1017', '1018', '1020', '142', '143', '2383', '2384', '4430']; + WITH inserted AS ( + INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") + SELECT + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + ('454', '2006-02-15T10:09:17', 1), + ('71', '2006-02-15T10:09:17', 2), + ('71', '2006-02-15T10:09:17', 2), + ('71', '2006-02-15T10:09:17', 2), + ('71', '2006-02-15T10:09:17', 2), + ('488', '2006-02-15T10:09:17', 2), + ('488', '2006-02-15T10:09:17', 1), + ('488', '2006-02-15T10:09:17', 1), + ('488', '2006-02-15T10:09:17', 2), + ('488', '2006-02-15T10:09:17', 2), + ('91', '2006-02-15T10:09:17', 1), + ('91', '2006-02-15T10:09:17', 2), + ('91', '2006-02-15T10:09:17', 2), + ('91', '2006-02-15T10:09:17', 2), + ('91', '2006-02-15T10:09:17', 1), + ('91', '2006-02-15T10:09:17', 2), + ('91', '2006-02-15T10:09:17', 1), + ('91', '2006-02-15T10:09:17', 1), + ('387', '2006-02-15T10:09:17', 2), + ('387', '2006-02-15T10:09:17', 2), + ('387', '2006-02-15T10:09:17', 1), + ('387', '2006-02-15T10:09:17', 1), + ('387', '2006-02-15T10:09:17', 1), + ('387', '2006-02-15T10:09:17', 2), + ('959', '2006-02-15T10:09:17', 1), + ('959', '2006-02-15T10:09:17', 1), + ('458', '2006-02-15T10:09:17', 1), + ('458', '2006-02-15T10:09:17', 2), + ('458', '2006-02-15T10:09:17', 2), + ('458', '2006-02-15T10:09:17', 2), + ('458', '2006-02-15T10:09:17', 1), + ('458', '2006-02-15T10:09:17', 2), + ('728', '2006-02-15T10:09:17', 1), + ('728', '2006-02-15T10:09:17', 2), + ('728', '2006-02-15T10:09:17', 1), + ('728', '2006-02-15T10:09:17', 2), + ('728', '2006-02-15T10:09:17', 1), + ('704', '2006-02-15T10:09:17', 2), + ('704', '2006-02-15T10:09:17', 1), + ('704', '2006-02-15T10:09:17', 2), + ('704', '2006-02-15T10:09:17', 2), + ('704', '2006-02-15T10:09:17', 1), + ('752', '2006-02-15T10:09:17', 2), + ('752', '2006-02-15T10:09:17', 2), + ('752', '2006-02-15T10:09:17', 2), + ('818', '2006-02-15T10:09:17', 2), + ('818', '2006-02-15T10:09:17', 1), + ('818', '2006-02-15T10:09:17', 2), + ('818', '2006-02-15T10:09:17', 1), + ('818', '2006-02-15T10:09:17', 1), + ('583', '2006-02-15T10:09:17', 1), + ('583', '2006-02-15T10:09:17', 1), + ('583', '2006-02-15T10:09:17', 1), + ('583', '2006-02-15T10:09:17', 2), + ('583', '2006-02-15T10:09:17', 2), + ('626', '2006-02-15T10:09:17', 2), + ('626', '2006-02-15T10:09:17', 2), + ('626', '2006-02-15T10:09:17', 2), + ('626', '2006-02-15T10:09:17', 2), + ('834', '2006-02-15T10:09:17', 2), + ('834', '2006-02-15T10:09:17', 2), + ('834', '2006-02-15T10:09:17', 2), + ('160', '2006-02-15T10:09:17', 2), + ('160', '2006-02-15T10:09:17', 1), + ('160', '2006-02-15T10:09:17', 1), + ('160', '2006-02-15T10:09:17', 2), + ('160', '2006-02-15T10:09:17', 2), + ('483', '2006-02-15T10:09:17', 1), + ('483', '2006-02-15T10:09:17', 2), + ('483', '2006-02-15T10:09:17', 1), + ('483', '2006-02-15T10:09:17', 1), + ('483', '2006-02-15T10:09:17', 2), + ('189', '2006-02-15T10:09:17', 2), + ('189', '2006-02-15T10:09:17', 2), + ('189', '2006-02-15T10:09:17', 2), + ('189', '2006-02-15T10:09:17', 1), + ('189', '2006-02-15T10:09:17', 1), + ('189', '2006-02-15T10:09:17', 2), + ('822', '2006-02-15T10:09:17', 2), + ('822', '2006-02-15T10:09:17', 2), + ('248', '2006-02-15T10:09:17', 2), + ('248', '2006-02-15T10:09:17', 2), + ('647', '2006-02-15T10:09:17', 1), + ('647', '2006-02-15T10:09:17', 1), + ('647', '2006-02-15T10:09:17', 2), + ('647', '2006-02-15T10:09:17', 2), + ('647', '2006-02-15T10:09:17', 1), + ('647', '2006-02-15T10:09:17', 2), + ('228', '2006-02-15T10:09:17', 2), + ('228', '2006-02-15T10:09:17', 2), + ('228', '2006-02-15T10:09:17', 1), + ('228', '2006-02-15T10:09:17', 2), + ('228', '2006-02-15T10:09:17', 1), + ('228', '2006-02-15T10:09:17', 1), + ('228', '2006-02-15T10:09:17', 2), + ('29', '2006-02-15T10:09:17', 1), + ('29', '2006-02-15T10:09:17', 1), + ('520', '2006-02-15T10:09:17', 1), + ('520', '2006-02-15T10:09:17', 1), + ('969', '2006-02-15T10:09:17', 1) + ) AS data(old_film_id, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."film"' + AND map0.old_id = data.old_film_id + RETURNING inventory_id + ) + SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; + + FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); + END LOOP; + + v_old_ids_inventory := ARRAY['4431', '4433', '4432', '1886', '1887', '3447', '3446', '3441', '3442', '3443', '3445', '3444', '2306', '2308', '2304', '2305', '2307', '1113', '1116', '1118', '1115', '1114', '1117', '1112', '847', '848', '849', '850', '2985', '2984', '2982', '2983', '3514', '3513', '3936', '3938', '3937', '3935', '2340', '2342', '2341', '1611', '1610', '1612', '1613', '1812', '1813', '1814', '1815', '2730', '2729', '2732', '2731', '2733', '2411', '2410', '2412', '2413', '4484', '4482', '4480', '4481', '4478', '4483', '4479', '832', '833', '2084', '2082', '2080', '2081', '2083', '4546', '4544', '4543', '4545', '1519', '1520', '1515', '1516', '1517', '1521', '1518', '1514', '1256', '1257', '1752', '1753', '1756', '1754', '1755', '534', '535', '533', '537', '532', '536', '1902', '1900', '1903']; + WITH inserted AS ( + INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") + SELECT + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + ('969', '2006-02-15T10:09:17', 1), + ('969', '2006-02-15T10:09:17', 1), + ('969', '2006-02-15T10:09:17', 1), + ('411', '2006-02-15T10:09:17', 1), + ('411', '2006-02-15T10:09:17', 1), + ('755', '2006-02-15T10:09:17', 2), + ('755', '2006-02-15T10:09:17', 2), + ('755', '2006-02-15T10:09:17', 1), + ('755', '2006-02-15T10:09:17', 1), + ('755', '2006-02-15T10:09:17', 1), + ('755', '2006-02-15T10:09:17', 2), + ('755', '2006-02-15T10:09:17', 1), + ('501', '2006-02-15T10:09:17', 1), + ('501', '2006-02-15T10:09:17', 2), + ('501', '2006-02-15T10:09:17', 1), + ('501', '2006-02-15T10:09:17', 1), + ('501', '2006-02-15T10:09:17', 2), + ('247', '2006-02-15T10:09:17', 1), + ('247', '2006-02-15T10:09:17', 2), + ('247', '2006-02-15T10:09:17', 2), + ('247', '2006-02-15T10:09:17', 2), + ('247', '2006-02-15T10:09:17', 1), + ('247', '2006-02-15T10:09:17', 2), + ('247', '2006-02-15T10:09:17', 1), + ('186', '2006-02-15T10:09:17', 1), + ('186', '2006-02-15T10:09:17', 1), + ('186', '2006-02-15T10:09:17', 2), + ('186', '2006-02-15T10:09:17', 2), + ('654', '2006-02-15T10:09:17', 2), + ('654', '2006-02-15T10:09:17', 2), + ('654', '2006-02-15T10:09:17', 1), + ('654', '2006-02-15T10:09:17', 1), + ('769', '2006-02-15T10:09:17', 2), + ('769', '2006-02-15T10:09:17', 2), + ('858', '2006-02-15T10:09:17', 2), + ('858', '2006-02-15T10:09:17', 2), + ('858', '2006-02-15T10:09:17', 2), + ('858', '2006-02-15T10:09:17', 2), + ('509', '2006-02-15T10:09:17', 2), + ('509', '2006-02-15T10:09:17', 2), + ('509', '2006-02-15T10:09:17', 2), + ('352', '2006-02-15T10:09:17', 2), + ('352', '2006-02-15T10:09:17', 2), + ('352', '2006-02-15T10:09:17', 2), + ('352', '2006-02-15T10:09:17', 2), + ('394', '2006-02-15T10:09:17', 1), + ('394', '2006-02-15T10:09:17', 1), + ('394', '2006-02-15T10:09:17', 1), + ('394', '2006-02-15T10:09:17', 1), + ('599', '2006-02-15T10:09:17', 1), + ('599', '2006-02-15T10:09:17', 1), + ('599', '2006-02-15T10:09:17', 2), + ('599', '2006-02-15T10:09:17', 1), + ('599', '2006-02-15T10:09:17', 2), + ('526', '2006-02-15T10:09:17', 2), + ('526', '2006-02-15T10:09:17', 2), + ('526', '2006-02-15T10:09:17', 2), + ('526', '2006-02-15T10:09:17', 2), + ('979', '2006-02-15T10:09:17', 2), + ('979', '2006-02-15T10:09:17', 2), + ('979', '2006-02-15T10:09:17', 1), + ('979', '2006-02-15T10:09:17', 1), + ('979', '2006-02-15T10:09:17', 1), + ('979', '2006-02-15T10:09:17', 2), + ('979', '2006-02-15T10:09:17', 1), + ('182', '2006-02-15T10:09:17', 1), + ('182', '2006-02-15T10:09:17', 1), + ('451', '2006-02-15T10:09:17', 2), + ('451', '2006-02-15T10:09:17', 2), + ('451', '2006-02-15T10:09:17', 1), + ('451', '2006-02-15T10:09:17', 1), + ('451', '2006-02-15T10:09:17', 2), + ('992', '2006-02-15T10:09:17', 2), + ('992', '2006-02-15T10:09:17', 2), + ('992', '2006-02-15T10:09:17', 2), + ('992', '2006-02-15T10:09:17', 2), + ('331', '2006-02-15T10:09:17', 2), + ('331', '2006-02-15T10:09:17', 2), + ('331', '2006-02-15T10:09:17', 1), + ('331', '2006-02-15T10:09:17', 1), + ('331', '2006-02-15T10:09:17', 1), + ('331', '2006-02-15T10:09:17', 2), + ('331', '2006-02-15T10:09:17', 2), + ('331', '2006-02-15T10:09:17', 1), + ('278', '2006-02-15T10:09:17', 1), + ('278', '2006-02-15T10:09:17', 1), + ('381', '2006-02-15T10:09:17', 1), + ('381', '2006-02-15T10:09:17', 1), + ('381', '2006-02-15T10:09:17', 2), + ('381', '2006-02-15T10:09:17', 2), + ('381', '2006-02-15T10:09:17', 2), + ('117', '2006-02-15T10:09:17', 1), + ('117', '2006-02-15T10:09:17', 1), + ('117', '2006-02-15T10:09:17', 1), + ('117', '2006-02-15T10:09:17', 2), + ('117', '2006-02-15T10:09:17', 1), + ('117', '2006-02-15T10:09:17', 2), + ('414', '2006-02-15T10:09:17', 2), + ('414', '2006-02-15T10:09:17', 1), + ('414', '2006-02-15T10:09:17', 2) + ) AS data(old_film_id, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."film"' + AND map0.old_id = data.old_film_id + RETURNING inventory_id + ) + SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; + + FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); + END LOOP; + + v_old_ids_inventory := ARRAY['1899', '1901', '1904', '2722', '2723', '2721', '2724', '1391', '1390', '1392', '1394', '1396', '1395', '1393', '477', '479', '476', '478', '480', '303', '302', '300', '301', '2077', '2076', '2078', '2073', '2075', '2079', '2074', '3838', '3837', '3839', '3842', '3840', '3843', '3841', '2072', '2070', '2069', '2071', '2252', '2254', '2253', '36', '33', '32', '35', '34', '4078', '4077', '4079', '2110', '2106', '2111', '2108', '2107', '2109', '3832', '3831', '4111', '4113', '4112', '4109', '4110', '671', '670', '669', '2337', '2339', '2338', '2636', '2637', '2633', '2634', '2635', '2839', '2840', '2842', '2838', '2841', '3348', '3346', '3344', '3345', '3343', '3347', '3349', '899', '902', '904', '900', '903', '901', '897', '898', '3694', '3695', '1248', '1246']; + WITH inserted AS ( + INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") + SELECT + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + ('414', '2006-02-15T10:09:17', 1), + ('414', '2006-02-15T10:09:17', 1), + ('414', '2006-02-15T10:09:17', 2), + ('597', '2006-02-15T10:09:17', 2), + ('597', '2006-02-15T10:09:17', 2), + ('597', '2006-02-15T10:09:17', 2), + ('597', '2006-02-15T10:09:17', 2), + ('305', '2006-02-15T10:09:17', 1), + ('305', '2006-02-15T10:09:17', 1), + ('305', '2006-02-15T10:09:17', 1), + ('305', '2006-02-15T10:09:17', 2), + ('305', '2006-02-15T10:09:17', 2), + ('305', '2006-02-15T10:09:17', 2), + ('305', '2006-02-15T10:09:17', 1), + ('105', '2006-02-15T10:09:17', 1), + ('105', '2006-02-15T10:09:17', 2), + ('105', '2006-02-15T10:09:17', 1), + ('105', '2006-02-15T10:09:17', 2), + ('105', '2006-02-15T10:09:17', 2), + ('68', '2006-02-15T10:09:17', 2), + ('68', '2006-02-15T10:09:17', 2), + ('68', '2006-02-15T10:09:17', 1), + ('68', '2006-02-15T10:09:17', 1), + ('450', '2006-02-15T10:09:17', 2), + ('450', '2006-02-15T10:09:17', 2), + ('450', '2006-02-15T10:09:17', 2), + ('450', '2006-02-15T10:09:17', 1), + ('450', '2006-02-15T10:09:17', 1), + ('450', '2006-02-15T10:09:17', 2), + ('450', '2006-02-15T10:09:17', 1), + ('841', '2006-02-15T10:09:17', 1), + ('841', '2006-02-15T10:09:17', 1), + ('841', '2006-02-15T10:09:17', 1), + ('841', '2006-02-15T10:09:17', 2), + ('841', '2006-02-15T10:09:17', 2), + ('841', '2006-02-15T10:09:17', 2), + ('841', '2006-02-15T10:09:17', 2), + ('449', '2006-02-15T10:09:17', 2), + ('449', '2006-02-15T10:09:17', 2), + ('449', '2006-02-15T10:09:17', 2), + ('449', '2006-02-15T10:09:17', 2), + ('487', '2006-02-15T10:09:17', 2), + ('487', '2006-02-15T10:09:17', 2), + ('487', '2006-02-15T10:09:17', 2), + ('7', '2006-02-15T10:09:17', 2), + ('7', '2006-02-15T10:09:17', 1), + ('7', '2006-02-15T10:09:17', 1), + ('7', '2006-02-15T10:09:17', 2), + ('7', '2006-02-15T10:09:17', 2), + ('889', '2006-02-15T10:09:17', 1), + ('889', '2006-02-15T10:09:17', 1), + ('889', '2006-02-15T10:09:17', 1), + ('457', '2006-02-15T10:09:17', 2), + ('457', '2006-02-15T10:09:17', 1), + ('457', '2006-02-15T10:09:17', 2), + ('457', '2006-02-15T10:09:17', 2), + ('457', '2006-02-15T10:09:17', 1), + ('457', '2006-02-15T10:09:17', 2), + ('839', '2006-02-15T10:09:17', 2), + ('839', '2006-02-15T10:09:17', 2), + ('894', '2006-02-15T10:09:17', 1), + ('894', '2006-02-15T10:09:17', 2), + ('894', '2006-02-15T10:09:17', 2), + ('894', '2006-02-15T10:09:17', 1), + ('894', '2006-02-15T10:09:17', 1), + ('146', '2006-02-15T10:09:17', 1), + ('146', '2006-02-15T10:09:17', 1), + ('146', '2006-02-15T10:09:17', 1), + ('508', '2006-02-15T10:09:17', 2), + ('508', '2006-02-15T10:09:17', 2), + ('508', '2006-02-15T10:09:17', 2), + ('578', '2006-02-15T10:09:17', 2), + ('578', '2006-02-15T10:09:17', 2), + ('578', '2006-02-15T10:09:17', 1), + ('578', '2006-02-15T10:09:17', 1), + ('578', '2006-02-15T10:09:17', 2), + ('623', '2006-02-15T10:09:17', 1), + ('623', '2006-02-15T10:09:17', 2), + ('623', '2006-02-15T10:09:17', 2), + ('623', '2006-02-15T10:09:17', 1), + ('623', '2006-02-15T10:09:17', 2), + ('735', '2006-02-15T10:09:17', 2), + ('735', '2006-02-15T10:09:17', 2), + ('735', '2006-02-15T10:09:17', 1), + ('735', '2006-02-15T10:09:17', 1), + ('735', '2006-02-15T10:09:17', 1), + ('735', '2006-02-15T10:09:17', 2), + ('735', '2006-02-15T10:09:17', 2), + ('200', '2006-02-15T10:09:17', 1), + ('200', '2006-02-15T10:09:17', 2), + ('200', '2006-02-15T10:09:17', 2), + ('200', '2006-02-15T10:09:17', 1), + ('200', '2006-02-15T10:09:17', 2), + ('200', '2006-02-15T10:09:17', 2), + ('200', '2006-02-15T10:09:17', 1), + ('200', '2006-02-15T10:09:17', 1), + ('808', '2006-02-15T10:09:17', 2), + ('808', '2006-02-15T10:09:17', 2), + ('275', '2006-02-15T10:09:17', 2), + ('275', '2006-02-15T10:09:17', 1) + ) AS data(old_film_id, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."film"' + AND map0.old_id = data.old_film_id + RETURNING inventory_id + ) + SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; + + FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); + END LOOP; + + v_old_ids_inventory := ARRAY['1244', '1247', '1245', '13', '14', '15', '12', '2379', '2382', '2380', '2381', '4237', '4236', '4238', '4235', '2101', '2102', '2100', '2105', '2104', '2103', '3019', '3018', '3021', '3022', '3020', '3517', '3515', '3516', '2973', '2970', '2974', '2972', '2975', '2971', '1343', '1346', '1345', '1344', '655', '656', '657', '658', '654', '4081', '4086', '4083', '4084', '4082', '4085', '4080', '3302', '3301', '3305', '3304', '3303', '444', '443', '442', '3048', '3045', '3047', '3046', '3044', '2276', '2277', '1474', '1472', '1473', '1470', '1475', '1471', '393', '387', '391', '389', '390', '388', '392', '394', '3800', '3797', '3798', '3799', '1316', '1318', '1317', '1315', '3644', '3647', '3645', '3648', '3646', '2573', '2575', '2571', '2570', '2572', '2569', '2574']; + WITH inserted AS ( + INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") + SELECT + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + ('275', '2006-02-15T10:09:17', 1), + ('275', '2006-02-15T10:09:17', 2), + ('275', '2006-02-15T10:09:17', 1), + ('3', '2006-02-15T10:09:17', 2), + ('3', '2006-02-15T10:09:17', 2), + ('3', '2006-02-15T10:09:17', 2), + ('3', '2006-02-15T10:09:17', 2), + ('519', '2006-02-15T10:09:17', 2), + ('519', '2006-02-15T10:09:17', 2), + ('519', '2006-02-15T10:09:17', 2), + ('519', '2006-02-15T10:09:17', 2), + ('921', '2006-02-15T10:09:17', 2), + ('921', '2006-02-15T10:09:17', 1), + ('921', '2006-02-15T10:09:17', 2), + ('921', '2006-02-15T10:09:17', 1), + ('456', '2006-02-15T10:09:17', 1), + ('456', '2006-02-15T10:09:17', 2), + ('456', '2006-02-15T10:09:17', 1), + ('456', '2006-02-15T10:09:17', 2), + ('456', '2006-02-15T10:09:17', 2), + ('456', '2006-02-15T10:09:17', 2), + ('663', '2006-02-15T10:09:17', 1), + ('663', '2006-02-15T10:09:17', 1), + ('663', '2006-02-15T10:09:17', 2), + ('663', '2006-02-15T10:09:17', 2), + ('663', '2006-02-15T10:09:17', 1), + ('770', '2006-02-15T10:09:17', 2), + ('770', '2006-02-15T10:09:17', 2), + ('770', '2006-02-15T10:09:17', 2), + ('651', '2006-02-15T10:09:17', 2), + ('651', '2006-02-15T10:09:17', 1), + ('651', '2006-02-15T10:09:17', 2), + ('651', '2006-02-15T10:09:17', 2), + ('651', '2006-02-15T10:09:17', 2), + ('651', '2006-02-15T10:09:17', 1), + ('296', '2006-02-15T10:09:17', 1), + ('296', '2006-02-15T10:09:17', 1), + ('296', '2006-02-15T10:09:17', 1), + ('296', '2006-02-15T10:09:17', 1), + ('142', '2006-02-15T10:09:17', 1), + ('142', '2006-02-15T10:09:17', 1), + ('142', '2006-02-15T10:09:17', 2), + ('142', '2006-02-15T10:09:17', 2), + ('142', '2006-02-15T10:09:17', 1), + ('890', '2006-02-15T10:09:17', 1), + ('890', '2006-02-15T10:09:17', 2), + ('890', '2006-02-15T10:09:17', 2), + ('890', '2006-02-15T10:09:17', 2), + ('890', '2006-02-15T10:09:17', 1), + ('890', '2006-02-15T10:09:17', 2), + ('890', '2006-02-15T10:09:17', 1), + ('727', '2006-02-15T10:09:17', 1), + ('727', '2006-02-15T10:09:17', 1), + ('727', '2006-02-15T10:09:17', 2), + ('727', '2006-02-15T10:09:17', 2), + ('727', '2006-02-15T10:09:17', 2), + ('98', '2006-02-15T10:09:17', 1), + ('98', '2006-02-15T10:09:17', 1), + ('98', '2006-02-15T10:09:17', 1), + ('668', '2006-02-15T10:09:17', 2), + ('668', '2006-02-15T10:09:17', 1), + ('668', '2006-02-15T10:09:17', 2), + ('668', '2006-02-15T10:09:17', 2), + ('668', '2006-02-15T10:09:17', 1), + ('492', '2006-02-15T10:09:17', 1), + ('492', '2006-02-15T10:09:17', 1), + ('322', '2006-02-15T10:09:17', 2), + ('322', '2006-02-15T10:09:17', 1), + ('322', '2006-02-15T10:09:17', 1), + ('322', '2006-02-15T10:09:17', 1), + ('322', '2006-02-15T10:09:17', 2), + ('322', '2006-02-15T10:09:17', 1), + ('86', '2006-02-15T10:09:17', 2), + ('86', '2006-02-15T10:09:17', 1), + ('86', '2006-02-15T10:09:17', 2), + ('86', '2006-02-15T10:09:17', 1), + ('86', '2006-02-15T10:09:17', 1), + ('86', '2006-02-15T10:09:17', 1), + ('86', '2006-02-15T10:09:17', 2), + ('86', '2006-02-15T10:09:17', 2), + ('832', '2006-02-15T10:09:17', 1), + ('832', '2006-02-15T10:09:17', 1), + ('832', '2006-02-15T10:09:17', 1), + ('832', '2006-02-15T10:09:17', 1), + ('291', '2006-02-15T10:09:17', 1), + ('291', '2006-02-15T10:09:17', 1), + ('291', '2006-02-15T10:09:17', 1), + ('291', '2006-02-15T10:09:17', 1), + ('796', '2006-02-15T10:09:17', 1), + ('796', '2006-02-15T10:09:17', 2), + ('796', '2006-02-15T10:09:17', 1), + ('796', '2006-02-15T10:09:17', 2), + ('796', '2006-02-15T10:09:17', 2), + ('563', '2006-02-15T10:09:17', 2), + ('563', '2006-02-15T10:09:17', 2), + ('563', '2006-02-15T10:09:17', 1), + ('563', '2006-02-15T10:09:17', 1), + ('563', '2006-02-15T10:09:17', 1), + ('563', '2006-02-15T10:09:17', 1), + ('563', '2006-02-15T10:09:17', 2) + ) AS data(old_film_id, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."film"' + AND map0.old_id = data.old_film_id + RETURNING inventory_id + ) + SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; + + FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); + END LOOP; + + v_old_ids_inventory := ARRAY['1084', '1087', '1086', '1088', '1085', '3002', '3000', '3001', '3003', '893', '896', '895', '890', '889', '894', '891', '892', '3649', '3653', '3652', '3650', '3651', '3602', '3601', '3603', '640', '642', '639', '643', '638', '641', '4471', '4469', '4466', '4470', '4468', '4467', '2821', '2818', '2819', '2820', '2822', '2817', '543', '538', '541', '539', '542', '540', '4314', '4316', '4315', '1665', '1662', '1666', '1663', '1664', '1661', '2501', '2500', '2498', '2499', '3981', '3982', '3983', '4029', '4030', '4032', '4031', '3078', '3083', '3081', '3082', '3080', '3077', '3079', '79', '77', '78', '80', '1959', '1956', '1957', '1958', '4192', '4191', '4193', '4194', '4190', '4189', '2507', '2509', '2508', '2505', '2506', '2510', '3988', '3986', '3987', '3990']; + WITH inserted AS ( + INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") + SELECT + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + ('242', '2006-02-15T10:09:17', 1), + ('242', '2006-02-15T10:09:17', 2), + ('242', '2006-02-15T10:09:17', 2), + ('242', '2006-02-15T10:09:17', 2), + ('242', '2006-02-15T10:09:17', 1), + ('658', '2006-02-15T10:09:17', 2), + ('658', '2006-02-15T10:09:17', 2), + ('658', '2006-02-15T10:09:17', 2), + ('658', '2006-02-15T10:09:17', 2), + ('199', '2006-02-15T10:09:17', 2), + ('199', '2006-02-15T10:09:17', 2), + ('199', '2006-02-15T10:09:17', 2), + ('199', '2006-02-15T10:09:17', 1), + ('199', '2006-02-15T10:09:17', 1), + ('199', '2006-02-15T10:09:17', 2), + ('199', '2006-02-15T10:09:17', 1), + ('199', '2006-02-15T10:09:17', 1), + ('797', '2006-02-15T10:09:17', 1), + ('797', '2006-02-15T10:09:17', 2), + ('797', '2006-02-15T10:09:17', 2), + ('797', '2006-02-15T10:09:17', 1), + ('797', '2006-02-15T10:09:17', 2), + ('787', '2006-02-15T10:09:17', 1), + ('787', '2006-02-15T10:09:17', 1), + ('787', '2006-02-15T10:09:17', 1), + ('139', '2006-02-15T10:09:17', 1), + ('139', '2006-02-15T10:09:17', 2), + ('139', '2006-02-15T10:09:17', 1), + ('139', '2006-02-15T10:09:17', 2), + ('139', '2006-02-15T10:09:17', 1), + ('139', '2006-02-15T10:09:17', 1), + ('976', '2006-02-15T10:09:17', 2), + ('976', '2006-02-15T10:09:17', 2), + ('976', '2006-02-15T10:09:17', 1), + ('976', '2006-02-15T10:09:17', 2), + ('976', '2006-02-15T10:09:17', 2), + ('976', '2006-02-15T10:09:17', 1), + ('619', '2006-02-15T10:09:17', 2), + ('619', '2006-02-15T10:09:17', 1), + ('619', '2006-02-15T10:09:17', 2), + ('619', '2006-02-15T10:09:17', 2), + ('619', '2006-02-15T10:09:17', 2), + ('619', '2006-02-15T10:09:17', 1), + ('118', '2006-02-15T10:09:17', 2), + ('118', '2006-02-15T10:09:17', 1), + ('118', '2006-02-15T10:09:17', 1), + ('118', '2006-02-15T10:09:17', 1), + ('118', '2006-02-15T10:09:17', 2), + ('118', '2006-02-15T10:09:17', 1), + ('940', '2006-02-15T10:09:17', 1), + ('940', '2006-02-15T10:09:17', 1), + ('940', '2006-02-15T10:09:17', 1), + ('363', '2006-02-15T10:09:17', 2), + ('363', '2006-02-15T10:09:17', 1), + ('363', '2006-02-15T10:09:17', 2), + ('363', '2006-02-15T10:09:17', 1), + ('363', '2006-02-15T10:09:17', 2), + ('363', '2006-02-15T10:09:17', 1), + ('549', '2006-02-15T10:09:17', 2), + ('549', '2006-02-15T10:09:17', 2), + ('549', '2006-02-15T10:09:17', 1), + ('549', '2006-02-15T10:09:17', 1), + ('868', '2006-02-15T10:09:17', 1), + ('868', '2006-02-15T10:09:17', 1), + ('868', '2006-02-15T10:09:17', 1), + ('878', '2006-02-15T10:09:17', 2), + ('878', '2006-02-15T10:09:17', 2), + ('878', '2006-02-15T10:09:17', 2), + ('878', '2006-02-15T10:09:17', 2), + ('677', '2006-02-15T10:09:17', 1), + ('677', '2006-02-15T10:09:17', 2), + ('677', '2006-02-15T10:09:17', 2), + ('677', '2006-02-15T10:09:17', 2), + ('677', '2006-02-15T10:09:17', 2), + ('677', '2006-02-15T10:09:17', 1), + ('677', '2006-02-15T10:09:17', 1), + ('16', '2006-02-15T10:09:17', 2), + ('16', '2006-02-15T10:09:17', 1), + ('16', '2006-02-15T10:09:17', 1), + ('16', '2006-02-15T10:09:17', 2), + ('427', '2006-02-15T10:09:17', 1), + ('427', '2006-02-15T10:09:17', 1), + ('427', '2006-02-15T10:09:17', 1), + ('427', '2006-02-15T10:09:17', 1), + ('912', '2006-02-15T10:09:17', 2), + ('912', '2006-02-15T10:09:17', 1), + ('912', '2006-02-15T10:09:17', 2), + ('912', '2006-02-15T10:09:17', 2), + ('912', '2006-02-15T10:09:17', 1), + ('912', '2006-02-15T10:09:17', 1), + ('551', '2006-02-15T10:09:17', 1), + ('551', '2006-02-15T10:09:17', 2), + ('551', '2006-02-15T10:09:17', 2), + ('551', '2006-02-15T10:09:17', 1), + ('551', '2006-02-15T10:09:17', 1), + ('551', '2006-02-15T10:09:17', 2), + ('869', '2006-02-15T10:09:17', 2), + ('869', '2006-02-15T10:09:17', 1), + ('869', '2006-02-15T10:09:17', 1), + ('869', '2006-02-15T10:09:17', 2) + ) AS data(old_film_id, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."film"' + AND map0.old_id = data.old_film_id + RETURNING inventory_id + ) + SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; + + FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); + END LOOP; + + v_old_ids_inventory := ARRAY['3989', '3984', '3985', '2831', '2835', '2830', '2832', '2828', '2829', '2834', '2833', '2368', '2370', '2369', '1089', '1094', '1090', '1091', '1093', '1092', '9', '10', '11', '1668', '1669', '1667', '211', '210', '1582', '1583', '1584', '1581', '2929', '2930', '2928', '2934', '2933', '2931', '2932', '603', '605', '602', '600', '601', '604', '234', '233', '770', '765', '766', '767', '769', '768', '764', '1150', '1151', '1152', '1148', '1149', '3332', '3330', '3333', '3335', '3331', '3334', '3336', '2689', '2686', '2692', '2691', '2690', '2687', '2688', '3141', '3144', '3143', '3145', '3142', '3140', '1647', '1649', '1650', '1648', '1326', '1325', '1327', '1328', '1329', '1525', '1523', '1522', '1524', '3322', '3316', '3319', '3321', '3315', '3320', '3317', '3318']; + WITH inserted AS ( + INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") + SELECT + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + ('869', '2006-02-15T10:09:17', 2), + ('869', '2006-02-15T10:09:17', 1), + ('869', '2006-02-15T10:09:17', 1), + ('621', '2006-02-15T10:09:17', 1), + ('621', '2006-02-15T10:09:17', 2), + ('621', '2006-02-15T10:09:17', 1), + ('621', '2006-02-15T10:09:17', 2), + ('621', '2006-02-15T10:09:17', 1), + ('621', '2006-02-15T10:09:17', 1), + ('621', '2006-02-15T10:09:17', 2), + ('621', '2006-02-15T10:09:17', 2), + ('516', '2006-02-15T10:09:17', 2), + ('516', '2006-02-15T10:09:17', 2), + ('516', '2006-02-15T10:09:17', 2), + ('243', '2006-02-15T10:09:17', 1), + ('243', '2006-02-15T10:09:17', 2), + ('243', '2006-02-15T10:09:17', 1), + ('243', '2006-02-15T10:09:17', 2), + ('243', '2006-02-15T10:09:17', 2), + ('243', '2006-02-15T10:09:17', 2), + ('2', '2006-02-15T10:09:17', 2), + ('2', '2006-02-15T10:09:17', 2), + ('2', '2006-02-15T10:09:17', 2), + ('364', '2006-02-15T10:09:17', 1), + ('364', '2006-02-15T10:09:17', 1), + ('364', '2006-02-15T10:09:17', 1), + ('47', '2006-02-15T10:09:17', 2), + ('47', '2006-02-15T10:09:17', 2), + ('347', '2006-02-15T10:09:17', 1), + ('347', '2006-02-15T10:09:17', 1), + ('347', '2006-02-15T10:09:17', 1), + ('347', '2006-02-15T10:09:17', 1), + ('644', '2006-02-15T10:09:17', 1), + ('644', '2006-02-15T10:09:17', 1), + ('644', '2006-02-15T10:09:17', 1), + ('644', '2006-02-15T10:09:17', 2), + ('644', '2006-02-15T10:09:17', 2), + ('644', '2006-02-15T10:09:17', 2), + ('644', '2006-02-15T10:09:17', 2), + ('131', '2006-02-15T10:09:17', 1), + ('131', '2006-02-15T10:09:17', 2), + ('131', '2006-02-15T10:09:17', 1), + ('131', '2006-02-15T10:09:17', 1), + ('131', '2006-02-15T10:09:17', 1), + ('131', '2006-02-15T10:09:17', 2), + ('52', '2006-02-15T10:09:17', 2), + ('52', '2006-02-15T10:09:17', 2), + ('167', '2006-02-15T10:09:17', 2), + ('167', '2006-02-15T10:09:17', 1), + ('167', '2006-02-15T10:09:17', 1), + ('167', '2006-02-15T10:09:17', 1), + ('167', '2006-02-15T10:09:17', 2), + ('167', '2006-02-15T10:09:17', 2), + ('167', '2006-02-15T10:09:17', 1), + ('254', '2006-02-15T10:09:17', 2), + ('254', '2006-02-15T10:09:17', 2), + ('254', '2006-02-15T10:09:17', 2), + ('254', '2006-02-15T10:09:17', 1), + ('254', '2006-02-15T10:09:17', 1), + ('733', '2006-02-15T10:09:17', 1), + ('733', '2006-02-15T10:09:17', 1), + ('733', '2006-02-15T10:09:17', 1), + ('733', '2006-02-15T10:09:17', 2), + ('733', '2006-02-15T10:09:17', 1), + ('733', '2006-02-15T10:09:17', 2), + ('733', '2006-02-15T10:09:17', 2), + ('590', '2006-02-15T10:09:17', 2), + ('590', '2006-02-15T10:09:17', 1), + ('590', '2006-02-15T10:09:17', 2), + ('590', '2006-02-15T10:09:17', 2), + ('590', '2006-02-15T10:09:17', 2), + ('590', '2006-02-15T10:09:17', 1), + ('590', '2006-02-15T10:09:17', 1), + ('690', '2006-02-15T10:09:17', 1), + ('690', '2006-02-15T10:09:17', 2), + ('690', '2006-02-15T10:09:17', 1), + ('690', '2006-02-15T10:09:17', 2), + ('690', '2006-02-15T10:09:17', 1), + ('690', '2006-02-15T10:09:17', 1), + ('360', '2006-02-15T10:09:17', 1), + ('360', '2006-02-15T10:09:17', 1), + ('360', '2006-02-15T10:09:17', 1), + ('360', '2006-02-15T10:09:17', 1), + ('293', '2006-02-15T10:09:17', 1), + ('293', '2006-02-15T10:09:17', 1), + ('293', '2006-02-15T10:09:17', 2), + ('293', '2006-02-15T10:09:17', 2), + ('293', '2006-02-15T10:09:17', 2), + ('333', '2006-02-15T10:09:17', 2), + ('333', '2006-02-15T10:09:17', 1), + ('333', '2006-02-15T10:09:17', 1), + ('333', '2006-02-15T10:09:17', 2), + ('730', '2006-02-15T10:09:17', 2), + ('730', '2006-02-15T10:09:17', 1), + ('730', '2006-02-15T10:09:17', 2), + ('730', '2006-02-15T10:09:17', 2), + ('730', '2006-02-15T10:09:17', 1), + ('730', '2006-02-15T10:09:17', 2), + ('730', '2006-02-15T10:09:17', 1), + ('730', '2006-02-15T10:09:17', 1) + ) AS data(old_film_id, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."film"' + AND map0.old_id = data.old_film_id + RETURNING inventory_id + ) + SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; + + FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); + END LOOP; + + v_old_ids_inventory := ARRAY['1164', '1163', '1162', '616', '618', '617', '963', '968', '965', '966', '967', '964', '2598', '2599', '2601', '2603', '2602', '2600', '2128', '2129', '2132', '2133', '2130', '2131', '3747', '3749', '3751', '3748', '3750', '3752', '4099', '4094', '4100', '4098', '4096', '4095', '4097', '2916', '2918', '2921', '2920', '2915', '2917', '2919', '1487', '1486', '1489', '1490', '1485', '1488', '2783', '2779', '2781', '2782', '2780', '3129', '3128', '3126', '3125', '3124', '3123', '3127', '1848', '1846', '1843', '1845', '1844', '1847', '4399', '4395', '4397', '4398', '4396', '2181', '2184', '2178', '2182', '2183', '2180', '2179', '4401', '4400', '4402', '4403', '4490', '4491', '4495', '4493', '4492', '4494', '1641', '1643', '1646', '1644', '1645', '1640', '1639', '1642', '275', '272']; + WITH inserted AS ( + INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") + SELECT + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + ('257', '2006-02-15T10:09:17', 2), + ('257', '2006-02-15T10:09:17', 2), + ('257', '2006-02-15T10:09:17', 2), + ('134', '2006-02-15T10:09:17', 2), + ('134', '2006-02-15T10:09:17', 2), + ('134', '2006-02-15T10:09:17', 2), + ('215', '2006-02-15T10:09:17', 1), + ('215', '2006-02-15T10:09:17', 2), + ('215', '2006-02-15T10:09:17', 1), + ('215', '2006-02-15T10:09:17', 2), + ('215', '2006-02-15T10:09:17', 2), + ('215', '2006-02-15T10:09:17', 1), + ('571', '2006-02-15T10:09:17', 1), + ('571', '2006-02-15T10:09:17', 1), + ('571', '2006-02-15T10:09:17', 2), + ('571', '2006-02-15T10:09:17', 2), + ('571', '2006-02-15T10:09:17', 2), + ('571', '2006-02-15T10:09:17', 2), + ('461', '2006-02-15T10:09:17', 1), + ('461', '2006-02-15T10:09:17', 1), + ('461', '2006-02-15T10:09:17', 2), + ('461', '2006-02-15T10:09:17', 2), + ('461', '2006-02-15T10:09:17', 2), + ('461', '2006-02-15T10:09:17', 2), + ('820', '2006-02-15T10:09:17', 1), + ('820', '2006-02-15T10:09:17', 1), + ('820', '2006-02-15T10:09:17', 2), + ('820', '2006-02-15T10:09:17', 1), + ('820', '2006-02-15T10:09:17', 1), + ('820', '2006-02-15T10:09:17', 2), + ('892', '2006-02-15T10:09:17', 2), + ('892', '2006-02-15T10:09:17', 1), + ('892', '2006-02-15T10:09:17', 2), + ('892', '2006-02-15T10:09:17', 2), + ('892', '2006-02-15T10:09:17', 1), + ('892', '2006-02-15T10:09:17', 1), + ('892', '2006-02-15T10:09:17', 2), + ('641', '2006-02-15T10:09:17', 1), + ('641', '2006-02-15T10:09:17', 2), + ('641', '2006-02-15T10:09:17', 2), + ('641', '2006-02-15T10:09:17', 2), + ('641', '2006-02-15T10:09:17', 1), + ('641', '2006-02-15T10:09:17', 1), + ('641', '2006-02-15T10:09:17', 2), + ('326', '2006-02-15T10:09:17', 2), + ('326', '2006-02-15T10:09:17', 1), + ('326', '2006-02-15T10:09:17', 2), + ('326', '2006-02-15T10:09:17', 2), + ('326', '2006-02-15T10:09:17', 1), + ('326', '2006-02-15T10:09:17', 2), + ('610', '2006-02-15T10:09:17', 2), + ('610', '2006-02-15T10:09:17', 1), + ('610', '2006-02-15T10:09:17', 2), + ('610', '2006-02-15T10:09:17', 2), + ('610', '2006-02-15T10:09:17', 1), + ('687', '2006-02-15T10:09:17', 2), + ('687', '2006-02-15T10:09:17', 2), + ('687', '2006-02-15T10:09:17', 2), + ('687', '2006-02-15T10:09:17', 1), + ('687', '2006-02-15T10:09:17', 1), + ('687', '2006-02-15T10:09:17', 1), + ('687', '2006-02-15T10:09:17', 2), + ('402', '2006-02-15T10:09:17', 2), + ('402', '2006-02-15T10:09:17', 2), + ('402', '2006-02-15T10:09:17', 1), + ('402', '2006-02-15T10:09:17', 1), + ('402', '2006-02-15T10:09:17', 1), + ('402', '2006-02-15T10:09:17', 2), + ('961', '2006-02-15T10:09:17', 2), + ('961', '2006-02-15T10:09:17', 1), + ('961', '2006-02-15T10:09:17', 1), + ('961', '2006-02-15T10:09:17', 2), + ('961', '2006-02-15T10:09:17', 1), + ('471', '2006-02-15T10:09:17', 2), + ('471', '2006-02-15T10:09:17', 2), + ('471', '2006-02-15T10:09:17', 1), + ('471', '2006-02-15T10:09:17', 2), + ('471', '2006-02-15T10:09:17', 2), + ('471', '2006-02-15T10:09:17', 1), + ('471', '2006-02-15T10:09:17', 1), + ('962', '2006-02-15T10:09:17', 1), + ('962', '2006-02-15T10:09:17', 1), + ('962', '2006-02-15T10:09:17', 1), + ('962', '2006-02-15T10:09:17', 1), + ('981', '2006-02-15T10:09:17', 1), + ('981', '2006-02-15T10:09:17', 1), + ('981', '2006-02-15T10:09:17', 2), + ('981', '2006-02-15T10:09:17', 2), + ('981', '2006-02-15T10:09:17', 1), + ('981', '2006-02-15T10:09:17', 2), + ('358', '2006-02-15T10:09:17', 1), + ('358', '2006-02-15T10:09:17', 2), + ('358', '2006-02-15T10:09:17', 2), + ('358', '2006-02-15T10:09:17', 2), + ('358', '2006-02-15T10:09:17', 2), + ('358', '2006-02-15T10:09:17', 1), + ('358', '2006-02-15T10:09:17', 1), + ('358', '2006-02-15T10:09:17', 1), + ('61', '2006-02-15T10:09:17', 1), + ('61', '2006-02-15T10:09:17', 1) + ) AS data(old_film_id, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."film"' + AND map0.old_id = data.old_film_id + RETURNING inventory_id + ) + SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; + + FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); + END LOOP; + + v_old_ids_inventory := ARRAY['276', '274', '277', '273', '2844', '2845', '2849', '2846', '2848', '2847', '2843', '1897', '1898', '1896', '2935', '2938', '2936', '2937', '2939', '2940', '1750', '1748', '1747', '1749', '1751', '3763', '3762', '3760', '3764', '3759', '3765', '3761', '3512', '3508', '3511', '3510', '3509', '3507', '4073', '4076', '4075', '4074', '2322', '2319', '2323', '2321', '2320', '2324', '3766', '3767', '3769', '3768', '1976', '1978', '1977', '3452', '3455', '3451', '3454', '3453', '1133', '1135', '1132', '1134', '1131', '3706', '3702', '3703', '3700', '3704', '3701', '3705', '2394', '2395', '3120', '3122', '3119', '3121', '3433', '3434', '3432', '3438', '3431', '3437', '3435', '3436', '3793', '3791', '3792', '3790', '2899', '2898', '2897', '2896', '2900', '3479', '3483', '3481', '3480', '3482']; + WITH inserted AS ( + INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") + SELECT + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + ('61', '2006-02-15T10:09:17', 2), + ('61', '2006-02-15T10:09:17', 1), + ('61', '2006-02-15T10:09:17', 2), + ('61', '2006-02-15T10:09:17', 1), + ('624', '2006-02-15T10:09:17', 1), + ('624', '2006-02-15T10:09:17', 1), + ('624', '2006-02-15T10:09:17', 2), + ('624', '2006-02-15T10:09:17', 2), + ('624', '2006-02-15T10:09:17', 2), + ('624', '2006-02-15T10:09:17', 2), + ('624', '2006-02-15T10:09:17', 1), + ('413', '2006-02-15T10:09:17', 1), + ('413', '2006-02-15T10:09:17', 1), + ('413', '2006-02-15T10:09:17', 1), + ('645', '2006-02-15T10:09:17', 1), + ('645', '2006-02-15T10:09:17', 2), + ('645', '2006-02-15T10:09:17', 1), + ('645', '2006-02-15T10:09:17', 1), + ('645', '2006-02-15T10:09:17', 2), + ('645', '2006-02-15T10:09:17', 2), + ('380', '2006-02-15T10:09:17', 2), + ('380', '2006-02-15T10:09:17', 1), + ('380', '2006-02-15T10:09:17', 1), + ('380', '2006-02-15T10:09:17', 2), + ('380', '2006-02-15T10:09:17', 2), + ('823', '2006-02-15T10:09:17', 2), + ('823', '2006-02-15T10:09:17', 2), + ('823', '2006-02-15T10:09:17', 1), + ('823', '2006-02-15T10:09:17', 2), + ('823', '2006-02-15T10:09:17', 1), + ('823', '2006-02-15T10:09:17', 2), + ('823', '2006-02-15T10:09:17', 1), + ('768', '2006-02-15T10:09:17', 2), + ('768', '2006-02-15T10:09:17', 1), + ('768', '2006-02-15T10:09:17', 2), + ('768', '2006-02-15T10:09:17', 2), + ('768', '2006-02-15T10:09:17', 1), + ('768', '2006-02-15T10:09:17', 1), + ('888', '2006-02-15T10:09:17', 1), + ('888', '2006-02-15T10:09:17', 1), + ('888', '2006-02-15T10:09:17', 1), + ('888', '2006-02-15T10:09:17', 1), + ('504', '2006-02-15T10:09:17', 1), + ('504', '2006-02-15T10:09:17', 1), + ('504', '2006-02-15T10:09:17', 2), + ('504', '2006-02-15T10:09:17', 1), + ('504', '2006-02-15T10:09:17', 1), + ('504', '2006-02-15T10:09:17', 2), + ('824', '2006-02-15T10:09:17', 2), + ('824', '2006-02-15T10:09:17', 2), + ('824', '2006-02-15T10:09:17', 2), + ('824', '2006-02-15T10:09:17', 2), + ('431', '2006-02-15T10:09:17', 2), + ('431', '2006-02-15T10:09:17', 2), + ('431', '2006-02-15T10:09:17', 2), + ('757', '2006-02-15T10:09:17', 1), + ('757', '2006-02-15T10:09:17', 2), + ('757', '2006-02-15T10:09:17', 1), + ('757', '2006-02-15T10:09:17', 2), + ('757', '2006-02-15T10:09:17', 1), + ('251', '2006-02-15T10:09:17', 2), + ('251', '2006-02-15T10:09:17', 2), + ('251', '2006-02-15T10:09:17', 1), + ('251', '2006-02-15T10:09:17', 2), + ('251', '2006-02-15T10:09:17', 1), + ('810', '2006-02-15T10:09:17', 2), + ('810', '2006-02-15T10:09:17', 1), + ('810', '2006-02-15T10:09:17', 1), + ('810', '2006-02-15T10:09:17', 1), + ('810', '2006-02-15T10:09:17', 2), + ('810', '2006-02-15T10:09:17', 1), + ('810', '2006-02-15T10:09:17', 2), + ('523', '2006-02-15T10:09:17', 1), + ('523', '2006-02-15T10:09:17', 1), + ('686', '2006-02-15T10:09:17', 1), + ('686', '2006-02-15T10:09:17', 1), + ('686', '2006-02-15T10:09:17', 1), + ('686', '2006-02-15T10:09:17', 1), + ('753', '2006-02-15T10:09:17', 1), + ('753', '2006-02-15T10:09:17', 1), + ('753', '2006-02-15T10:09:17', 1), + ('753', '2006-02-15T10:09:17', 2), + ('753', '2006-02-15T10:09:17', 1), + ('753', '2006-02-15T10:09:17', 2), + ('753', '2006-02-15T10:09:17', 2), + ('753', '2006-02-15T10:09:17', 2), + ('830', '2006-02-15T10:09:17', 2), + ('830', '2006-02-15T10:09:17', 2), + ('830', '2006-02-15T10:09:17', 2), + ('830', '2006-02-15T10:09:17', 2), + ('637', '2006-02-15T10:09:17', 2), + ('637', '2006-02-15T10:09:17', 2), + ('637', '2006-02-15T10:09:17', 1), + ('637', '2006-02-15T10:09:17', 1), + ('637', '2006-02-15T10:09:17', 2), + ('763', '2006-02-15T10:09:17', 1), + ('763', '2006-02-15T10:09:17', 2), + ('763', '2006-02-15T10:09:17', 1), + ('763', '2006-02-15T10:09:17', 1), + ('763', '2006-02-15T10:09:17', 2) + ) AS data(old_film_id, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."film"' + AND map0.old_id = data.old_film_id + RETURNING inventory_id + ) + SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; + + FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); + END LOOP; + + v_old_ids_inventory := ARRAY['2176', '2177', '40', '37', '39', '38', '2141', '2140', '2139', '2143', '2142', '280', '281', '283', '282', '649', '653', '650', '651', '652', '2352', '2355', '2356', '2353', '2354', '2357', '2674', '2669', '2671', '2670', '2672', '2667', '2673', '2668', '2137', '2136', '2138', '2135', '2134', '314', '313', '315', '312', '3696', '3698', '3699', '3697', '944', '941', '943', '942', '3289', '3290', '3288', '3287', '3291', '3286', '1794', '1795', '1796', '2030', '2031', '2029', '1443', '1444', '3571', '3570', '3978', '3980', '3979', '3977', '2522', '2524', '2518', '2520', '2519', '2523', '2521', '3639', '3637', '3636', '3638', '4550', '4547', '4549', '4553', '4551', '4548', '4552', '782', '780', '779', '777', '781', '778', '1541', '1542', '1540', '1539', '3772']; + WITH inserted AS ( + INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") + SELECT + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + ('470', '2006-02-15T10:09:17', 1), + ('470', '2006-02-15T10:09:17', 1), + ('8', '2006-02-15T10:09:17', 2), + ('8', '2006-02-15T10:09:17', 2), + ('8', '2006-02-15T10:09:17', 2), + ('8', '2006-02-15T10:09:17', 2), + ('463', '2006-02-15T10:09:17', 1), + ('463', '2006-02-15T10:09:17', 1), + ('463', '2006-02-15T10:09:17', 1), + ('463', '2006-02-15T10:09:17', 2), + ('463', '2006-02-15T10:09:17', 2), + ('63', '2006-02-15T10:09:17', 1), + ('63', '2006-02-15T10:09:17', 1), + ('63', '2006-02-15T10:09:17', 2), + ('63', '2006-02-15T10:09:17', 2), + ('141', '2006-02-15T10:09:17', 1), + ('141', '2006-02-15T10:09:17', 2), + ('141', '2006-02-15T10:09:17', 1), + ('141', '2006-02-15T10:09:17', 1), + ('141', '2006-02-15T10:09:17', 2), + ('512', '2006-02-15T10:09:17', 1), + ('512', '2006-02-15T10:09:17', 2), + ('512', '2006-02-15T10:09:17', 2), + ('512', '2006-02-15T10:09:17', 1), + ('512', '2006-02-15T10:09:17', 2), + ('512', '2006-02-15T10:09:17', 2), + ('586', '2006-02-15T10:09:17', 2), + ('586', '2006-02-15T10:09:17', 1), + ('586', '2006-02-15T10:09:17', 2), + ('586', '2006-02-15T10:09:17', 1), + ('586', '2006-02-15T10:09:17', 2), + ('586', '2006-02-15T10:09:17', 1), + ('586', '2006-02-15T10:09:17', 2), + ('586', '2006-02-15T10:09:17', 1), + ('462', '2006-02-15T10:09:17', 2), + ('462', '2006-02-15T10:09:17', 2), + ('462', '2006-02-15T10:09:17', 2), + ('462', '2006-02-15T10:09:17', 1), + ('462', '2006-02-15T10:09:17', 1), + ('70', '2006-02-15T10:09:17', 2), + ('70', '2006-02-15T10:09:17', 1), + ('70', '2006-02-15T10:09:17', 2), + ('70', '2006-02-15T10:09:17', 1), + ('809', '2006-02-15T10:09:17', 2), + ('809', '2006-02-15T10:09:17', 2), + ('809', '2006-02-15T10:09:17', 2), + ('809', '2006-02-15T10:09:17', 2), + ('209', '2006-02-15T10:09:17', 1), + ('209', '2006-02-15T10:09:17', 1), + ('209', '2006-02-15T10:09:17', 1), + ('209', '2006-02-15T10:09:17', 1), + ('724', '2006-02-15T10:09:17', 2), + ('724', '2006-02-15T10:09:17', 2), + ('724', '2006-02-15T10:09:17', 2), + ('724', '2006-02-15T10:09:17', 1), + ('724', '2006-02-15T10:09:17', 2), + ('724', '2006-02-15T10:09:17', 1), + ('390', '2006-02-15T10:09:17', 1), + ('390', '2006-02-15T10:09:17', 1), + ('390', '2006-02-15T10:09:17', 1), + ('442', '2006-02-15T10:09:17', 1), + ('442', '2006-02-15T10:09:17', 1), + ('442', '2006-02-15T10:09:17', 1), + ('316', '2006-02-15T10:09:17', 2), + ('316', '2006-02-15T10:09:17', 2), + ('781', '2006-02-15T10:09:17', 2), + ('781', '2006-02-15T10:09:17', 2), + ('867', '2006-02-15T10:09:17', 1), + ('867', '2006-02-15T10:09:17', 1), + ('867', '2006-02-15T10:09:17', 1), + ('867', '2006-02-15T10:09:17', 1), + ('554', '2006-02-15T10:09:17', 2), + ('554', '2006-02-15T10:09:17', 2), + ('554', '2006-02-15T10:09:17', 1), + ('554', '2006-02-15T10:09:17', 1), + ('554', '2006-02-15T10:09:17', 1), + ('554', '2006-02-15T10:09:17', 2), + ('554', '2006-02-15T10:09:17', 1), + ('794', '2006-02-15T10:09:17', 2), + ('794', '2006-02-15T10:09:17', 1), + ('794', '2006-02-15T10:09:17', 1), + ('794', '2006-02-15T10:09:17', 2), + ('993', '2006-02-15T10:09:17', 1), + ('993', '2006-02-15T10:09:17', 1), + ('993', '2006-02-15T10:09:17', 1), + ('993', '2006-02-15T10:09:17', 2), + ('993', '2006-02-15T10:09:17', 2), + ('993', '2006-02-15T10:09:17', 1), + ('993', '2006-02-15T10:09:17', 2), + ('170', '2006-02-15T10:09:17', 2), + ('170', '2006-02-15T10:09:17', 2), + ('170', '2006-02-15T10:09:17', 2), + ('170', '2006-02-15T10:09:17', 1), + ('170', '2006-02-15T10:09:17', 2), + ('170', '2006-02-15T10:09:17', 1), + ('337', '2006-02-15T10:09:17', 2), + ('337', '2006-02-15T10:09:17', 2), + ('337', '2006-02-15T10:09:17', 1), + ('337', '2006-02-15T10:09:17', 1), + ('825', '2006-02-15T10:09:17', 1) + ) AS data(old_film_id, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."film"' + AND map0.old_id = data.old_film_id + RETURNING inventory_id + ) + SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; + + FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); + END LOOP; + + v_old_ids_inventory := ARRAY['3770', '3771', '2471', '2470', '4340', '4335', '4338', '4333', '4339', '4336', '4337', '4334', '3004', '3005', '1717', '1718', '1716', '1714', '1713', '1719', '1715', '2567', '2566', '2564', '2565', '2568', '2563', '431', '430', '428', '429', '432', '4248', '4247', '4246', '511', '510', '508', '509', '2166', '2167', '2168', '2171', '2165', '2169', '2172', '2170', '2438', '2440', '2439', '2441', '1431', '1432', '1430', '1428', '1429', '1433', '2582', '2581', '984', '983', '981', '982', '1003', '1005', '1004', '4460', '4459', '3188', '3187', '125', '128', '126', '124', '129', '127', '1210', '1208', '1212', '1209', '1213', '1211', '286', '284', '285', '2336', '2335', '492', '490', '491', '485', '487', '489', '486', '488', '1741', '1738', '1737', '1736', '1739']; + WITH inserted AS ( + INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") + SELECT + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + ('825', '2006-02-15T10:09:17', 1), + ('825', '2006-02-15T10:09:17', 1), + ('541', '2006-02-15T10:09:17', 2), + ('541', '2006-02-15T10:09:17', 2), + ('945', '2006-02-15T10:09:17', 2), + ('945', '2006-02-15T10:09:17', 1), + ('945', '2006-02-15T10:09:17', 2), + ('945', '2006-02-15T10:09:17', 1), + ('945', '2006-02-15T10:09:17', 2), + ('945', '2006-02-15T10:09:17', 1), + ('945', '2006-02-15T10:09:17', 2), + ('945', '2006-02-15T10:09:17', 1), + ('659', '2006-02-15T10:09:17', 2), + ('659', '2006-02-15T10:09:17', 2), + ('374', '2006-02-15T10:09:17', 2), + ('374', '2006-02-15T10:09:17', 2), + ('374', '2006-02-15T10:09:17', 2), + ('374', '2006-02-15T10:09:17', 1), + ('374', '2006-02-15T10:09:17', 1), + ('374', '2006-02-15T10:09:17', 2), + ('374', '2006-02-15T10:09:17', 1), + ('562', '2006-02-15T10:09:17', 2), + ('562', '2006-02-15T10:09:17', 1), + ('562', '2006-02-15T10:09:17', 1), + ('562', '2006-02-15T10:09:17', 1), + ('562', '2006-02-15T10:09:17', 2), + ('562', '2006-02-15T10:09:17', 1), + ('95', '2006-02-15T10:09:17', 2), + ('95', '2006-02-15T10:09:17', 2), + ('95', '2006-02-15T10:09:17', 1), + ('95', '2006-02-15T10:09:17', 1), + ('95', '2006-02-15T10:09:17', 2), + ('923', '2006-02-15T10:09:17', 2), + ('923', '2006-02-15T10:09:17', 2), + ('923', '2006-02-15T10:09:17', 2), + ('113', '2006-02-15T10:09:17', 2), + ('113', '2006-02-15T10:09:17', 2), + ('113', '2006-02-15T10:09:17', 2), + ('113', '2006-02-15T10:09:17', 2), + ('468', '2006-02-15T10:09:17', 1), + ('468', '2006-02-15T10:09:17', 1), + ('468', '2006-02-15T10:09:17', 1), + ('468', '2006-02-15T10:09:17', 2), + ('468', '2006-02-15T10:09:17', 1), + ('468', '2006-02-15T10:09:17', 2), + ('468', '2006-02-15T10:09:17', 2), + ('468', '2006-02-15T10:09:17', 2), + ('532', '2006-02-15T10:09:17', 2), + ('532', '2006-02-15T10:09:17', 2), + ('532', '2006-02-15T10:09:17', 2), + ('532', '2006-02-15T10:09:17', 2), + ('313', '2006-02-15T10:09:17', 1), + ('313', '2006-02-15T10:09:17', 2), + ('313', '2006-02-15T10:09:17', 1), + ('313', '2006-02-15T10:09:17', 1), + ('313', '2006-02-15T10:09:17', 1), + ('313', '2006-02-15T10:09:17', 2), + ('566', '2006-02-15T10:09:17', 1), + ('566', '2006-02-15T10:09:17', 1), + ('219', '2006-02-15T10:09:17', 1), + ('219', '2006-02-15T10:09:17', 1), + ('219', '2006-02-15T10:09:17', 1), + ('219', '2006-02-15T10:09:17', 1), + ('225', '2006-02-15T10:09:17', 1), + ('225', '2006-02-15T10:09:17', 1), + ('225', '2006-02-15T10:09:17', 1), + ('974', '2006-02-15T10:09:17', 1), + ('974', '2006-02-15T10:09:17', 1), + ('699', '2006-02-15T10:09:17', 1), + ('699', '2006-02-15T10:09:17', 1), + ('25', '2006-02-15T10:09:17', 1), + ('25', '2006-02-15T10:09:17', 2), + ('25', '2006-02-15T10:09:17', 1), + ('25', '2006-02-15T10:09:17', 1), + ('25', '2006-02-15T10:09:17', 2), + ('25', '2006-02-15T10:09:17', 1), + ('269', '2006-02-15T10:09:17', 2), + ('269', '2006-02-15T10:09:17', 1), + ('269', '2006-02-15T10:09:17', 2), + ('269', '2006-02-15T10:09:17', 1), + ('269', '2006-02-15T10:09:17', 2), + ('269', '2006-02-15T10:09:17', 2), + ('64', '2006-02-15T10:09:17', 2), + ('64', '2006-02-15T10:09:17', 2), + ('64', '2006-02-15T10:09:17', 2), + ('507', '2006-02-15T10:09:17', 2), + ('507', '2006-02-15T10:09:17', 2), + ('109', '2006-02-15T10:09:17', 2), + ('109', '2006-02-15T10:09:17', 2), + ('109', '2006-02-15T10:09:17', 2), + ('109', '2006-02-15T10:09:17', 1), + ('109', '2006-02-15T10:09:17', 1), + ('109', '2006-02-15T10:09:17', 2), + ('109', '2006-02-15T10:09:17', 1), + ('109', '2006-02-15T10:09:17', 1), + ('378', '2006-02-15T10:09:17', 2), + ('378', '2006-02-15T10:09:17', 1), + ('378', '2006-02-15T10:09:17', 1), + ('378', '2006-02-15T10:09:17', 1), + ('378', '2006-02-15T10:09:17', 2) + ) AS data(old_film_id, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."film"' + AND map0.old_id = data.old_film_id + RETURNING inventory_id + ) + SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; + + FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); + END LOOP; + + v_old_ids_inventory := ARRAY['1740', '1742', '1735', '4221', '4217', '4218', '4219', '4220', '3176', '3174', '3178', '3179', '3173', '3172', '3175', '3177', '636', '634', '637', '635', '633', '212', '214', '213', '215', '1187', '1186', '1053', '1054', '1051', '1049', '1048', '1050', '1052', '191', '190', '189', '193', '192', '194', '195', '1027', '1028', '519', '521', '523', '522', '524', '520', '525', '4226', '4228', '4229', '4227', '2436', '2432', '2435', '2430', '2434', '2433', '2431', '2437', '2517', '2516', '2515', '1705', '1703', '1704', '3561', '3563', '3559', '3560', '3562', '3564', '62', '61', '66', '65', '63', '64', '60', '1510', '1512', '1509', '1511', '1513', '1507', '1508', '558', '556', '555', '557', '559', '554', '409', '408', '406', '405', '407', '410']; + WITH inserted AS ( + INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") + SELECT + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + ('378', '2006-02-15T10:09:17', 2), + ('378', '2006-02-15T10:09:17', 2), + ('378', '2006-02-15T10:09:17', 1), + ('917', '2006-02-15T10:09:17', 2), + ('917', '2006-02-15T10:09:17', 1), + ('917', '2006-02-15T10:09:17', 1), + ('917', '2006-02-15T10:09:17', 1), + ('917', '2006-02-15T10:09:17', 2), + ('697', '2006-02-15T10:09:17', 2), + ('697', '2006-02-15T10:09:17', 1), + ('697', '2006-02-15T10:09:17', 2), + ('697', '2006-02-15T10:09:17', 2), + ('697', '2006-02-15T10:09:17', 1), + ('697', '2006-02-15T10:09:17', 1), + ('697', '2006-02-15T10:09:17', 1), + ('697', '2006-02-15T10:09:17', 2), + ('138', '2006-02-15T10:09:17', 2), + ('138', '2006-02-15T10:09:17', 1), + ('138', '2006-02-15T10:09:17', 2), + ('138', '2006-02-15T10:09:17', 2), + ('138', '2006-02-15T10:09:17', 1), + ('48', '2006-02-15T10:09:17', 1), + ('48', '2006-02-15T10:09:17', 2), + ('48', '2006-02-15T10:09:17', 1), + ('48', '2006-02-15T10:09:17', 2), + ('264', '2006-02-15T10:09:17', 2), + ('264', '2006-02-15T10:09:17', 2), + ('234', '2006-02-15T10:09:17', 2), + ('234', '2006-02-15T10:09:17', 2), + ('234', '2006-02-15T10:09:17', 1), + ('234', '2006-02-15T10:09:17', 1), + ('234', '2006-02-15T10:09:17', 1), + ('234', '2006-02-15T10:09:17', 1), + ('234', '2006-02-15T10:09:17', 2), + ('43', '2006-02-15T10:09:17', 1), + ('43', '2006-02-15T10:09:17', 1), + ('43', '2006-02-15T10:09:17', 1), + ('43', '2006-02-15T10:09:17', 2), + ('43', '2006-02-15T10:09:17', 2), + ('43', '2006-02-15T10:09:17', 2), + ('43', '2006-02-15T10:09:17', 2), + ('230', '2006-02-15T10:09:17', 1), + ('230', '2006-02-15T10:09:17', 1), + ('115', '2006-02-15T10:09:17', 1), + ('115', '2006-02-15T10:09:17', 1), + ('115', '2006-02-15T10:09:17', 2), + ('115', '2006-02-15T10:09:17', 2), + ('115', '2006-02-15T10:09:17', 2), + ('115', '2006-02-15T10:09:17', 1), + ('115', '2006-02-15T10:09:17', 2), + ('919', '2006-02-15T10:09:17', 1), + ('919', '2006-02-15T10:09:17', 1), + ('919', '2006-02-15T10:09:17', 1), + ('919', '2006-02-15T10:09:17', 1), + ('531', '2006-02-15T10:09:17', 2), + ('531', '2006-02-15T10:09:17', 1), + ('531', '2006-02-15T10:09:17', 2), + ('531', '2006-02-15T10:09:17', 1), + ('531', '2006-02-15T10:09:17', 2), + ('531', '2006-02-15T10:09:17', 1), + ('531', '2006-02-15T10:09:17', 1), + ('531', '2006-02-15T10:09:17', 2), + ('553', '2006-02-15T10:09:17', 2), + ('553', '2006-02-15T10:09:17', 2), + ('553', '2006-02-15T10:09:17', 2), + ('371', '2006-02-15T10:09:17', 1), + ('371', '2006-02-15T10:09:17', 1), + ('371', '2006-02-15T10:09:17', 1), + ('778', '2006-02-15T10:09:17', 1), + ('778', '2006-02-15T10:09:17', 2), + ('778', '2006-02-15T10:09:17', 1), + ('778', '2006-02-15T10:09:17', 1), + ('778', '2006-02-15T10:09:17', 1), + ('778', '2006-02-15T10:09:17', 2), + ('12', '2006-02-15T10:09:17', 1), + ('12', '2006-02-15T10:09:17', 1), + ('12', '2006-02-15T10:09:17', 2), + ('12', '2006-02-15T10:09:17', 2), + ('12', '2006-02-15T10:09:17', 2), + ('12', '2006-02-15T10:09:17', 2), + ('12', '2006-02-15T10:09:17', 1), + ('330', '2006-02-15T10:09:17', 1), + ('330', '2006-02-15T10:09:17', 2), + ('330', '2006-02-15T10:09:17', 1), + ('330', '2006-02-15T10:09:17', 2), + ('330', '2006-02-15T10:09:17', 2), + ('330', '2006-02-15T10:09:17', 1), + ('330', '2006-02-15T10:09:17', 1), + ('121', '2006-02-15T10:09:17', 2), + ('121', '2006-02-15T10:09:17', 1), + ('121', '2006-02-15T10:09:17', 1), + ('121', '2006-02-15T10:09:17', 2), + ('121', '2006-02-15T10:09:17', 2), + ('121', '2006-02-15T10:09:17', 1), + ('90', '2006-02-15T10:09:17', 2), + ('90', '2006-02-15T10:09:17', 2), + ('90', '2006-02-15T10:09:17', 1), + ('90', '2006-02-15T10:09:17', 1), + ('90', '2006-02-15T10:09:17', 1), + ('90', '2006-02-15T10:09:17', 2) + ) AS data(old_film_id, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."film"' + AND map0.old_id = data.old_film_id + RETURNING inventory_id + ) + SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; + + FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); + END LOOP; + + v_old_ids_inventory := ARRAY['3252', '3249', '3248', '3250', '3246', '3251', '3247', '798', '796', '795', '800', '797', '802', '801', '799', '4378', '4375', '4376', '4377', '4489', '4488', '4487', '4485', '4486', '721', '723', '720', '719', '722', '3969', '3970', '3974', '3973', '3972', '3971', '2422', '2421', '2420', '3870', '3872', '3866', '3871', '3873', '3867', '3869', '3868', '2363', '2364', '2365', '2361', '2360', '2362', '2892', '2891', '1711', '1708', '1712', '1709', '1710', '1936', '1937', '1938', '1939', '774', '775', '776', '773', '1038', '1041', '1039', '1040', '1037', '4259', '4260', '1834', '1836', '1833', '1835', '3439', '3440', '2774', '2778', '2771', '2777', '2772', '2773', '2775', '2776', '2763', '2760', '2764', '2759', '2761', '2762', '1673', '1672', '1670', '1671', '2416', '2419']; + WITH inserted AS ( + INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") + SELECT + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + ('715', '2006-02-15T10:09:17', 2), + ('715', '2006-02-15T10:09:17', 1), + ('715', '2006-02-15T10:09:17', 1), + ('715', '2006-02-15T10:09:17', 2), + ('715', '2006-02-15T10:09:17', 1), + ('715', '2006-02-15T10:09:17', 2), + ('715', '2006-02-15T10:09:17', 1), + ('174', '2006-02-15T10:09:17', 1), + ('174', '2006-02-15T10:09:17', 1), + ('174', '2006-02-15T10:09:17', 1), + ('174', '2006-02-15T10:09:17', 2), + ('174', '2006-02-15T10:09:17', 1), + ('174', '2006-02-15T10:09:17', 2), + ('174', '2006-02-15T10:09:17', 2), + ('174', '2006-02-15T10:09:17', 2), + ('956', '2006-02-15T10:09:17', 1), + ('956', '2006-02-15T10:09:17', 1), + ('956', '2006-02-15T10:09:17', 1), + ('956', '2006-02-15T10:09:17', 1), + ('980', '2006-02-15T10:09:17', 2), + ('980', '2006-02-15T10:09:17', 2), + ('980', '2006-02-15T10:09:17', 1), + ('980', '2006-02-15T10:09:17', 1), + ('980', '2006-02-15T10:09:17', 1), + ('158', '2006-02-15T10:09:17', 2), + ('158', '2006-02-15T10:09:17', 2), + ('158', '2006-02-15T10:09:17', 1), + ('158', '2006-02-15T10:09:17', 1), + ('158', '2006-02-15T10:09:17', 2), + ('865', '2006-02-15T10:09:17', 1), + ('865', '2006-02-15T10:09:17', 1), + ('865', '2006-02-15T10:09:17', 2), + ('865', '2006-02-15T10:09:17', 2), + ('865', '2006-02-15T10:09:17', 1), + ('865', '2006-02-15T10:09:17', 1), + ('528', '2006-02-15T10:09:17', 1), + ('528', '2006-02-15T10:09:17', 1), + ('528', '2006-02-15T10:09:17', 1), + ('846', '2006-02-15T10:09:17', 2), + ('846', '2006-02-15T10:09:17', 2), + ('846', '2006-02-15T10:09:17', 1), + ('846', '2006-02-15T10:09:17', 2), + ('846', '2006-02-15T10:09:17', 2), + ('846', '2006-02-15T10:09:17', 1), + ('846', '2006-02-15T10:09:17', 1), + ('846', '2006-02-15T10:09:17', 1), + ('514', '2006-02-15T10:09:17', 2), + ('514', '2006-02-15T10:09:17', 2), + ('514', '2006-02-15T10:09:17', 2), + ('514', '2006-02-15T10:09:17', 1), + ('514', '2006-02-15T10:09:17', 1), + ('514', '2006-02-15T10:09:17', 2), + ('635', '2006-02-15T10:09:17', 2), + ('635', '2006-02-15T10:09:17', 2), + ('373', '2006-02-15T10:09:17', 2), + ('373', '2006-02-15T10:09:17', 1), + ('373', '2006-02-15T10:09:17', 2), + ('373', '2006-02-15T10:09:17', 1), + ('373', '2006-02-15T10:09:17', 1), + ('421', '2006-02-15T10:09:17', 2), + ('421', '2006-02-15T10:09:17', 2), + ('421', '2006-02-15T10:09:17', 2), + ('421', '2006-02-15T10:09:17', 2), + ('169', '2006-02-15T10:09:17', 1), + ('169', '2006-02-15T10:09:17', 2), + ('169', '2006-02-15T10:09:17', 2), + ('169', '2006-02-15T10:09:17', 1), + ('232', '2006-02-15T10:09:17', 1), + ('232', '2006-02-15T10:09:17', 2), + ('232', '2006-02-15T10:09:17', 1), + ('232', '2006-02-15T10:09:17', 2), + ('232', '2006-02-15T10:09:17', 1), + ('926', '2006-02-15T10:09:17', 2), + ('926', '2006-02-15T10:09:17', 2), + ('398', '2006-02-15T10:09:17', 2), + ('398', '2006-02-15T10:09:17', 2), + ('398', '2006-02-15T10:09:17', 2), + ('398', '2006-02-15T10:09:17', 2), + ('754', '2006-02-15T10:09:17', 2), + ('754', '2006-02-15T10:09:17', 2), + ('609', '2006-02-15T10:09:17', 1), + ('609', '2006-02-15T10:09:17', 2), + ('609', '2006-02-15T10:09:17', 1), + ('609', '2006-02-15T10:09:17', 2), + ('609', '2006-02-15T10:09:17', 1), + ('609', '2006-02-15T10:09:17', 1), + ('609', '2006-02-15T10:09:17', 2), + ('609', '2006-02-15T10:09:17', 2), + ('606', '2006-02-15T10:09:17', 2), + ('606', '2006-02-15T10:09:17', 1), + ('606', '2006-02-15T10:09:17', 2), + ('606', '2006-02-15T10:09:17', 1), + ('606', '2006-02-15T10:09:17', 2), + ('606', '2006-02-15T10:09:17', 2), + ('365', '2006-02-15T10:09:17', 2), + ('365', '2006-02-15T10:09:17', 2), + ('365', '2006-02-15T10:09:17', 1), + ('365', '2006-02-15T10:09:17', 1), + ('527', '2006-02-15T10:09:17', 2), + ('527', '2006-02-15T10:09:17', 2) + ) AS data(old_film_id, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."film"' + AND map0.old_id = data.old_film_id + RETURNING inventory_id + ) + SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; + + FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); + END LOOP; + + v_old_ids_inventory := ARRAY['2418', '2414', '2417', '2415', '2126', '2120', '2122', '2123', '2124', '2121', '2127', '2125', '4000', '4003', '3999', '4001', '4002', '121', '120', '123', '122', '4368', '4366', '4367', '2596', '2597', '2593', '2595', '2594', '1215', '1216', '1214', '1220', '1217', '1219', '1218', '1321', '1322', '1319', '1324', '1323', '1320', '3567', '3568', '3569', '322', '325', '324', '320', '323', '321', '4313', '4310', '4311', '4312', '864', '865', '866', '863', '2791', '2790', '1279', '1280', '1278', '696', '694', '695', '697', '2209', '2210', '2208', '2212', '2211', '150', '152', '147', '153', '146', '148', '149', '151', '2041', '2039', '2046', '2043', '2040', '2042', '2044', '2045', '631', '629', '632', '630', '386', '385', '383', '384', '4332', '4329', '4330']; + WITH inserted AS ( + INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") + SELECT + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + ('527', '2006-02-15T10:09:17', 2), + ('527', '2006-02-15T10:09:17', 1), + ('527', '2006-02-15T10:09:17', 2), + ('527', '2006-02-15T10:09:17', 1), + ('460', '2006-02-15T10:09:17', 2), + ('460', '2006-02-15T10:09:17', 1), + ('460', '2006-02-15T10:09:17', 1), + ('460', '2006-02-15T10:09:17', 1), + ('460', '2006-02-15T10:09:17', 2), + ('460', '2006-02-15T10:09:17', 1), + ('460', '2006-02-15T10:09:17', 2), + ('460', '2006-02-15T10:09:17', 2), + ('871', '2006-02-15T10:09:17', 1), + ('871', '2006-02-15T10:09:17', 2), + ('871', '2006-02-15T10:09:17', 1), + ('871', '2006-02-15T10:09:17', 2), + ('871', '2006-02-15T10:09:17', 2), + ('24', '2006-02-15T10:09:17', 1), + ('24', '2006-02-15T10:09:17', 1), + ('24', '2006-02-15T10:09:17', 1), + ('24', '2006-02-15T10:09:17', 1), + ('952', '2006-02-15T10:09:17', 1), + ('952', '2006-02-15T10:09:17', 1), + ('952', '2006-02-15T10:09:17', 1), + ('570', '2006-02-15T10:09:17', 2), + ('570', '2006-02-15T10:09:17', 2), + ('570', '2006-02-15T10:09:17', 1), + ('570', '2006-02-15T10:09:17', 2), + ('570', '2006-02-15T10:09:17', 1), + ('270', '2006-02-15T10:09:17', 1), + ('270', '2006-02-15T10:09:17', 1), + ('270', '2006-02-15T10:09:17', 1), + ('270', '2006-02-15T10:09:17', 2), + ('270', '2006-02-15T10:09:17', 2), + ('270', '2006-02-15T10:09:17', 2), + ('270', '2006-02-15T10:09:17', 2), + ('292', '2006-02-15T10:09:17', 1), + ('292', '2006-02-15T10:09:17', 2), + ('292', '2006-02-15T10:09:17', 1), + ('292', '2006-02-15T10:09:17', 2), + ('292', '2006-02-15T10:09:17', 2), + ('292', '2006-02-15T10:09:17', 1), + ('780', '2006-02-15T10:09:17', 2), + ('780', '2006-02-15T10:09:17', 2), + ('780', '2006-02-15T10:09:17', 2), + ('72', '2006-02-15T10:09:17', 1), + ('72', '2006-02-15T10:09:17', 2), + ('72', '2006-02-15T10:09:17', 2), + ('72', '2006-02-15T10:09:17', 1), + ('72', '2006-02-15T10:09:17', 1), + ('72', '2006-02-15T10:09:17', 1), + ('939', '2006-02-15T10:09:17', 2), + ('939', '2006-02-15T10:09:17', 2), + ('939', '2006-02-15T10:09:17', 2), + ('939', '2006-02-15T10:09:17', 2), + ('190', '2006-02-15T10:09:17', 2), + ('190', '2006-02-15T10:09:17', 2), + ('190', '2006-02-15T10:09:17', 2), + ('190', '2006-02-15T10:09:17', 2), + ('612', '2006-02-15T10:09:17', 2), + ('612', '2006-02-15T10:09:17', 2), + ('283', '2006-02-15T10:09:17', 1), + ('283', '2006-02-15T10:09:17', 1), + ('283', '2006-02-15T10:09:17', 1), + ('152', '2006-02-15T10:09:17', 1), + ('152', '2006-02-15T10:09:17', 1), + ('152', '2006-02-15T10:09:17', 1), + ('152', '2006-02-15T10:09:17', 1), + ('478', '2006-02-15T10:09:17', 1), + ('478', '2006-02-15T10:09:17', 2), + ('478', '2006-02-15T10:09:17', 1), + ('478', '2006-02-15T10:09:17', 2), + ('478', '2006-02-15T10:09:17', 2), + ('31', '2006-02-15T10:09:17', 2), + ('31', '2006-02-15T10:09:17', 2), + ('31', '2006-02-15T10:09:17', 1), + ('31', '2006-02-15T10:09:17', 2), + ('31', '2006-02-15T10:09:17', 1), + ('31', '2006-02-15T10:09:17', 1), + ('31', '2006-02-15T10:09:17', 1), + ('31', '2006-02-15T10:09:17', 2), + ('444', '2006-02-15T10:09:17', 1), + ('444', '2006-02-15T10:09:17', 1), + ('444', '2006-02-15T10:09:17', 2), + ('444', '2006-02-15T10:09:17', 2), + ('444', '2006-02-15T10:09:17', 1), + ('444', '2006-02-15T10:09:17', 1), + ('444', '2006-02-15T10:09:17', 2), + ('444', '2006-02-15T10:09:17', 2), + ('137', '2006-02-15T10:09:17', 2), + ('137', '2006-02-15T10:09:17', 2), + ('137', '2006-02-15T10:09:17', 2), + ('137', '2006-02-15T10:09:17', 2), + ('85', '2006-02-15T10:09:17', 2), + ('85', '2006-02-15T10:09:17', 2), + ('85', '2006-02-15T10:09:17', 2), + ('85', '2006-02-15T10:09:17', 2), + ('944', '2006-02-15T10:09:17', 2), + ('944', '2006-02-15T10:09:17', 1), + ('944', '2006-02-15T10:09:17', 2) + ) AS data(old_film_id, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."film"' + AND map0.old_id = data.old_film_id + RETURNING inventory_id + ) + SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; + + FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); + END LOOP; + + v_old_ids_inventory := ARRAY['4331', '4328', '1881', '1883', '1882', '1885', '1884', '1224', '1225', '1221', '1223', '1222', '4088', '4093', '4089', '4087', '4092', '4090', '4091', '841', '844', '843', '842', '840', '924', '925', '923', '922', '936', '935', '934', '937', '3723', '3726', '3725', '3724', '3722', '3720', '3721', '1706', '1707', '999', '1000', '2588', '2587', '2590', '2589', '3354', '3356', '3359', '3358', '3357', '3355', '1399', '1397', '1398', '3669', '3666', '3670', '3671', '3668', '3667', '742', '738', '741', '744', '740', '739', '743', '3634', '3635', '3633', '3632', '4533', '4531', '4535', '4530', '4532', '4534', '2883', '2882', '2881', '369', '370', '371', '368', '298', '299', '294', '297', '296', '295', '1699', '1700', '1698', '1701', '1702', '1063', '1064', '1062']; + WITH inserted AS ( + INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") + SELECT + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + ('944', '2006-02-15T10:09:17', 2), + ('944', '2006-02-15T10:09:17', 1), + ('410', '2006-02-15T10:09:17', 1), + ('410', '2006-02-15T10:09:17', 1), + ('410', '2006-02-15T10:09:17', 1), + ('410', '2006-02-15T10:09:17', 2), + ('410', '2006-02-15T10:09:17', 2), + ('271', '2006-02-15T10:09:17', 2), + ('271', '2006-02-15T10:09:17', 2), + ('271', '2006-02-15T10:09:17', 1), + ('271', '2006-02-15T10:09:17', 1), + ('271', '2006-02-15T10:09:17', 1), + ('891', '2006-02-15T10:09:17', 1), + ('891', '2006-02-15T10:09:17', 2), + ('891', '2006-02-15T10:09:17', 1), + ('891', '2006-02-15T10:09:17', 1), + ('891', '2006-02-15T10:09:17', 2), + ('891', '2006-02-15T10:09:17', 2), + ('891', '2006-02-15T10:09:17', 2), + ('184', '2006-02-15T10:09:17', 1), + ('184', '2006-02-15T10:09:17', 2), + ('184', '2006-02-15T10:09:17', 2), + ('184', '2006-02-15T10:09:17', 2), + ('184', '2006-02-15T10:09:17', 1), + ('205', '2006-02-15T10:09:17', 1), + ('205', '2006-02-15T10:09:17', 1), + ('205', '2006-02-15T10:09:17', 1), + ('205', '2006-02-15T10:09:17', 1), + ('207', '2006-02-15T10:09:17', 1), + ('207', '2006-02-15T10:09:17', 1), + ('207', '2006-02-15T10:09:17', 1), + ('207', '2006-02-15T10:09:17', 1), + ('814', '2006-02-15T10:09:17', 2), + ('814', '2006-02-15T10:09:17', 2), + ('814', '2006-02-15T10:09:17', 2), + ('814', '2006-02-15T10:09:17', 2), + ('814', '2006-02-15T10:09:17', 1), + ('814', '2006-02-15T10:09:17', 1), + ('814', '2006-02-15T10:09:17', 1), + ('372', '2006-02-15T10:09:17', 1), + ('372', '2006-02-15T10:09:17', 1), + ('223', '2006-02-15T10:09:17', 2), + ('223', '2006-02-15T10:09:17', 2), + ('568', '2006-02-15T10:09:17', 1), + ('568', '2006-02-15T10:09:17', 1), + ('568', '2006-02-15T10:09:17', 2), + ('568', '2006-02-15T10:09:17', 2), + ('737', '2006-02-15T10:09:17', 1), + ('737', '2006-02-15T10:09:17', 2), + ('737', '2006-02-15T10:09:17', 2), + ('737', '2006-02-15T10:09:17', 2), + ('737', '2006-02-15T10:09:17', 2), + ('737', '2006-02-15T10:09:17', 1), + ('306', '2006-02-15T10:09:17', 1), + ('306', '2006-02-15T10:09:17', 1), + ('306', '2006-02-15T10:09:17', 1), + ('803', '2006-02-15T10:09:17', 1), + ('803', '2006-02-15T10:09:17', 1), + ('803', '2006-02-15T10:09:17', 2), + ('803', '2006-02-15T10:09:17', 2), + ('803', '2006-02-15T10:09:17', 1), + ('803', '2006-02-15T10:09:17', 1), + ('162', '2006-02-15T10:09:17', 2), + ('162', '2006-02-15T10:09:17', 1), + ('162', '2006-02-15T10:09:17', 2), + ('162', '2006-02-15T10:09:17', 2), + ('162', '2006-02-15T10:09:17', 1), + ('162', '2006-02-15T10:09:17', 1), + ('162', '2006-02-15T10:09:17', 2), + ('793', '2006-02-15T10:09:17', 1), + ('793', '2006-02-15T10:09:17', 1), + ('793', '2006-02-15T10:09:17', 1), + ('793', '2006-02-15T10:09:17', 1), + ('989', '2006-02-15T10:09:17', 1), + ('989', '2006-02-15T10:09:17', 1), + ('989', '2006-02-15T10:09:17', 2), + ('989', '2006-02-15T10:09:17', 1), + ('989', '2006-02-15T10:09:17', 1), + ('989', '2006-02-15T10:09:17', 2), + ('632', '2006-02-15T10:09:17', 1), + ('632', '2006-02-15T10:09:17', 1), + ('632', '2006-02-15T10:09:17', 1), + ('81', '2006-02-15T10:09:17', 1), + ('81', '2006-02-15T10:09:17', 1), + ('81', '2006-02-15T10:09:17', 1), + ('81', '2006-02-15T10:09:17', 1), + ('67', '2006-02-15T10:09:17', 2), + ('67', '2006-02-15T10:09:17', 2), + ('67', '2006-02-15T10:09:17', 1), + ('67', '2006-02-15T10:09:17', 2), + ('67', '2006-02-15T10:09:17', 2), + ('67', '2006-02-15T10:09:17', 1), + ('370', '2006-02-15T10:09:17', 1), + ('370', '2006-02-15T10:09:17', 1), + ('370', '2006-02-15T10:09:17', 1), + ('370', '2006-02-15T10:09:17', 2), + ('370', '2006-02-15T10:09:17', 2), + ('236', '2006-02-15T10:09:17', 2), + ('236', '2006-02-15T10:09:17', 2), + ('236', '2006-02-15T10:09:17', 2) + ) AS data(old_film_id, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."film"' + AND map0.old_id = data.old_film_id + RETURNING inventory_id + ) + SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; + + FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); + END LOOP; + + v_old_ids_inventory := ARRAY['1061', '675', '672', '673', '676', '677', '674', '4126', '4127', '4129', '4125', '4131', '4130', '4132', '4128', '4283', '4282', '4281', '4284', '3465', '3468', '3471', '3466', '3469', '3470', '3467', '446', '445', '447', '450', '449', '448', '2000', '2003', '2002', '2004', '2001', '2005', '481', '482', '1417', '1416', '2837', '2836', '2493', '2490', '2491', '2492', '3090', '3091', '3089', '3088', '3135', '3139', '3137', '3138', '3134', '3136', '2528', '2529', '2530', '2527', '2531', '2526', '2525', '1243', '1241', '1240', '1242', '1237', '1239', '1238', '3325', '3324', '3323', '3496', '3497', '3498', '1556', '1552', '1558', '1553', '1554', '1557', '1551', '1555', '3658', '3659', '4065', '4063', '4066', '4064', '1838', '1837', '2055', '2053', '2054', '2056', '4360', '4359']; + WITH inserted AS ( + INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") + SELECT + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + ('236', '2006-02-15T10:09:17', 2), + ('147', '2006-02-15T10:09:17', 2), + ('147', '2006-02-15T10:09:17', 1), + ('147', '2006-02-15T10:09:17', 1), + ('147', '2006-02-15T10:09:17', 2), + ('147', '2006-02-15T10:09:17', 2), + ('147', '2006-02-15T10:09:17', 1), + ('897', '2006-02-15T10:09:17', 1), + ('897', '2006-02-15T10:09:17', 1), + ('897', '2006-02-15T10:09:17', 2), + ('897', '2006-02-15T10:09:17', 1), + ('897', '2006-02-15T10:09:17', 2), + ('897', '2006-02-15T10:09:17', 2), + ('897', '2006-02-15T10:09:17', 2), + ('897', '2006-02-15T10:09:17', 1), + ('932', '2006-02-15T10:09:17', 2), + ('932', '2006-02-15T10:09:17', 1), + ('932', '2006-02-15T10:09:17', 1), + ('932', '2006-02-15T10:09:17', 2), + ('760', '2006-02-15T10:09:17', 1), + ('760', '2006-02-15T10:09:17', 2), + ('760', '2006-02-15T10:09:17', 2), + ('760', '2006-02-15T10:09:17', 1), + ('760', '2006-02-15T10:09:17', 2), + ('760', '2006-02-15T10:09:17', 2), + ('760', '2006-02-15T10:09:17', 1), + ('99', '2006-02-15T10:09:17', 1), + ('99', '2006-02-15T10:09:17', 1), + ('99', '2006-02-15T10:09:17', 1), + ('99', '2006-02-15T10:09:17', 2), + ('99', '2006-02-15T10:09:17', 2), + ('99', '2006-02-15T10:09:17', 2), + ('436', '2006-02-15T10:09:17', 1), + ('436', '2006-02-15T10:09:17', 2), + ('436', '2006-02-15T10:09:17', 1), + ('436', '2006-02-15T10:09:17', 2), + ('436', '2006-02-15T10:09:17', 1), + ('436', '2006-02-15T10:09:17', 2), + ('106', '2006-02-15T10:09:17', 1), + ('106', '2006-02-15T10:09:17', 1), + ('310', '2006-02-15T10:09:17', 1), + ('310', '2006-02-15T10:09:17', 1), + ('622', '2006-02-15T10:09:17', 2), + ('622', '2006-02-15T10:09:17', 2), + ('546', '2006-02-15T10:09:17', 2), + ('546', '2006-02-15T10:09:17', 2), + ('546', '2006-02-15T10:09:17', 2), + ('546', '2006-02-15T10:09:17', 2), + ('679', '2006-02-15T10:09:17', 2), + ('679', '2006-02-15T10:09:17', 2), + ('679', '2006-02-15T10:09:17', 1), + ('679', '2006-02-15T10:09:17', 1), + ('689', '2006-02-15T10:09:17', 1), + ('689', '2006-02-15T10:09:17', 2), + ('689', '2006-02-15T10:09:17', 1), + ('689', '2006-02-15T10:09:17', 2), + ('689', '2006-02-15T10:09:17', 1), + ('689', '2006-02-15T10:09:17', 1), + ('555', '2006-02-15T10:09:17', 2), + ('555', '2006-02-15T10:09:17', 2), + ('555', '2006-02-15T10:09:17', 2), + ('555', '2006-02-15T10:09:17', 1), + ('555', '2006-02-15T10:09:17', 2), + ('555', '2006-02-15T10:09:17', 1), + ('555', '2006-02-15T10:09:17', 1), + ('274', '2006-02-15T10:09:17', 2), + ('274', '2006-02-15T10:09:17', 2), + ('274', '2006-02-15T10:09:17', 2), + ('274', '2006-02-15T10:09:17', 2), + ('274', '2006-02-15T10:09:17', 1), + ('274', '2006-02-15T10:09:17', 1), + ('274', '2006-02-15T10:09:17', 1), + ('731', '2006-02-15T10:09:17', 2), + ('731', '2006-02-15T10:09:17', 2), + ('731', '2006-02-15T10:09:17', 2), + ('766', '2006-02-15T10:09:17', 1), + ('766', '2006-02-15T10:09:17', 1), + ('766', '2006-02-15T10:09:17', 1), + ('341', '2006-02-15T10:09:17', 2), + ('341', '2006-02-15T10:09:17', 1), + ('341', '2006-02-15T10:09:17', 2), + ('341', '2006-02-15T10:09:17', 1), + ('341', '2006-02-15T10:09:17', 1), + ('341', '2006-02-15T10:09:17', 2), + ('341', '2006-02-15T10:09:17', 1), + ('341', '2006-02-15T10:09:17', 2), + ('799', '2006-02-15T10:09:17', 1), + ('799', '2006-02-15T10:09:17', 1), + ('886', '2006-02-15T10:09:17', 1), + ('886', '2006-02-15T10:09:17', 1), + ('886', '2006-02-15T10:09:17', 1), + ('886', '2006-02-15T10:09:17', 1), + ('399', '2006-02-15T10:09:17', 2), + ('399', '2006-02-15T10:09:17', 2), + ('446', '2006-02-15T10:09:17', 2), + ('446', '2006-02-15T10:09:17', 1), + ('446', '2006-02-15T10:09:17', 1), + ('446', '2006-02-15T10:09:17', 2), + ('951', '2006-02-15T10:09:17', 1), + ('951', '2006-02-15T10:09:17', 1) + ) AS data(old_film_id, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."film"' + AND map0.old_id = data.old_film_id + RETURNING inventory_id + ) + SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; + + FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); + END LOOP; + + v_old_ids_inventory := ARRAY['4364', '4361', '4363', '4362', '4365', '4033', '4036', '4039', '4037', '4038', '4034', '4035', '1692', '1694', '1693', '1690', '1697', '1696', '1695', '1691', '2297', '2296', '2298', '2301', '2303', '2300', '2302', '2299', '3373', '3374', '3375', '3565', '3566', '1165', '1166', '1167', '1168', '2825', '2823', '2826', '2824', '2827', '245', '242', '243', '247', '246', '244', '3352', '3350', '3353', '3351', '2665', '2663', '2664', '2666', '2219', '2221', '2220', '2218', '3400', '3399', '3396', '3393', '3394', '3397', '3398', '3395', '1127', '1129', '1128', '1130', '2681', '2680', '2678', '2679', '4408', '4404', '4406', '4405', '4407', '1400', '1404', '1403', '1405', '1401', '1402', '551', '552', '553', '3857', '3856', '3855', '3858', '3337', '3340', '3342', '3338', '3341', '3339']; + WITH inserted AS ( + INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") + SELECT + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + ('951', '2006-02-15T10:09:17', 2), + ('951', '2006-02-15T10:09:17', 1), + ('951', '2006-02-15T10:09:17', 2), + ('951', '2006-02-15T10:09:17', 2), + ('951', '2006-02-15T10:09:17', 2), + ('879', '2006-02-15T10:09:17', 1), + ('879', '2006-02-15T10:09:17', 1), + ('879', '2006-02-15T10:09:17', 2), + ('879', '2006-02-15T10:09:17', 2), + ('879', '2006-02-15T10:09:17', 2), + ('879', '2006-02-15T10:09:17', 1), + ('879', '2006-02-15T10:09:17', 1), + ('369', '2006-02-15T10:09:17', 1), + ('369', '2006-02-15T10:09:17', 2), + ('369', '2006-02-15T10:09:17', 1), + ('369', '2006-02-15T10:09:17', 1), + ('369', '2006-02-15T10:09:17', 2), + ('369', '2006-02-15T10:09:17', 2), + ('369', '2006-02-15T10:09:17', 2), + ('369', '2006-02-15T10:09:17', 1), + ('500', '2006-02-15T10:09:17', 1), + ('500', '2006-02-15T10:09:17', 1), + ('500', '2006-02-15T10:09:17', 1), + ('500', '2006-02-15T10:09:17', 2), + ('500', '2006-02-15T10:09:17', 2), + ('500', '2006-02-15T10:09:17', 2), + ('500', '2006-02-15T10:09:17', 2), + ('500', '2006-02-15T10:09:17', 1), + ('740', '2006-02-15T10:09:17', 2), + ('740', '2006-02-15T10:09:17', 2), + ('740', '2006-02-15T10:09:17', 2), + ('779', '2006-02-15T10:09:17', 2), + ('779', '2006-02-15T10:09:17', 2), + ('258', '2006-02-15T10:09:17', 2), + ('258', '2006-02-15T10:09:17', 2), + ('258', '2006-02-15T10:09:17', 2), + ('258', '2006-02-15T10:09:17', 2), + ('620', '2006-02-15T10:09:17', 2), + ('620', '2006-02-15T10:09:17', 1), + ('620', '2006-02-15T10:09:17', 2), + ('620', '2006-02-15T10:09:17', 1), + ('620', '2006-02-15T10:09:17', 2), + ('55', '2006-02-15T10:09:17', 1), + ('55', '2006-02-15T10:09:17', 1), + ('55', '2006-02-15T10:09:17', 1), + ('55', '2006-02-15T10:09:17', 2), + ('55', '2006-02-15T10:09:17', 2), + ('55', '2006-02-15T10:09:17', 1), + ('736', '2006-02-15T10:09:17', 1), + ('736', '2006-02-15T10:09:17', 1), + ('736', '2006-02-15T10:09:17', 1), + ('736', '2006-02-15T10:09:17', 1), + ('585', '2006-02-15T10:09:17', 2), + ('585', '2006-02-15T10:09:17', 2), + ('585', '2006-02-15T10:09:17', 2), + ('585', '2006-02-15T10:09:17', 2), + ('480', '2006-02-15T10:09:17', 1), + ('480', '2006-02-15T10:09:17', 2), + ('480', '2006-02-15T10:09:17', 2), + ('480', '2006-02-15T10:09:17', 1), + ('745', '2006-02-15T10:09:17', 2), + ('745', '2006-02-15T10:09:17', 2), + ('745', '2006-02-15T10:09:17', 1), + ('745', '2006-02-15T10:09:17', 1), + ('745', '2006-02-15T10:09:17', 1), + ('745', '2006-02-15T10:09:17', 2), + ('745', '2006-02-15T10:09:17', 2), + ('745', '2006-02-15T10:09:17', 1), + ('250', '2006-02-15T10:09:17', 2), + ('250', '2006-02-15T10:09:17', 2), + ('250', '2006-02-15T10:09:17', 2), + ('250', '2006-02-15T10:09:17', 2), + ('588', '2006-02-15T10:09:17', 2), + ('588', '2006-02-15T10:09:17', 2), + ('588', '2006-02-15T10:09:17', 2), + ('588', '2006-02-15T10:09:17', 2), + ('963', '2006-02-15T10:09:17', 2), + ('963', '2006-02-15T10:09:17', 1), + ('963', '2006-02-15T10:09:17', 2), + ('963', '2006-02-15T10:09:17', 1), + ('963', '2006-02-15T10:09:17', 2), + ('307', '2006-02-15T10:09:17', 1), + ('307', '2006-02-15T10:09:17', 2), + ('307', '2006-02-15T10:09:17', 2), + ('307', '2006-02-15T10:09:17', 2), + ('307', '2006-02-15T10:09:17', 1), + ('307', '2006-02-15T10:09:17', 1), + ('120', '2006-02-15T10:09:17', 1), + ('120', '2006-02-15T10:09:17', 1), + ('120', '2006-02-15T10:09:17', 1), + ('844', '2006-02-15T10:09:17', 2), + ('844', '2006-02-15T10:09:17', 1), + ('844', '2006-02-15T10:09:17', 1), + ('844', '2006-02-15T10:09:17', 2), + ('734', '2006-02-15T10:09:17', 1), + ('734', '2006-02-15T10:09:17', 2), + ('734', '2006-02-15T10:09:17', 2), + ('734', '2006-02-15T10:09:17', 1), + ('734', '2006-02-15T10:09:17', 2), + ('734', '2006-02-15T10:09:17', 2) + ) AS data(old_film_id, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."film"' + AND map0.old_id = data.old_film_id + RETURNING inventory_id + ) + SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; + + FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); + END LOOP; + + v_old_ids_inventory := ARRAY['3853', '3848', '3849', '3851', '3854', '3850', '3852', '2701', '2700', '2703', '2702', '3788', '3787', '3789', '3786', '3785', '771', '772', '3595', '3600', '3598', '3594', '3597', '3596', '3599', '1550', '1549', '1535', '1537', '1534', '1536', '1538', '2351', '2347', '2350', '2349', '2348', '3712', '3714', '3710', '3715', '3711', '3713', '590', '588', '589', '591', '593', '592', '1577', '1575', '1578', '1579', '1576', '1580', '2792', '2793', '4120', '4118', '4116', '4114', '4115', '4119', '4117', '3640', '3641', '3642', '3643', '3379', '3378', '3380', '3376', '3381', '3377', '547', '544', '549', '545', '546', '550', '548', '187', '186', '188', '185', '3299', '3300', '3298', '1774', '1775', '1773', '1776', '1777', '86', '84', '85', '82', '81', '83', '3686']; + WITH inserted AS ( + INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") + SELECT + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + ('843', '2006-02-15T10:09:17', 2), + ('843', '2006-02-15T10:09:17', 1), + ('843', '2006-02-15T10:09:17', 1), + ('843', '2006-02-15T10:09:17', 1), + ('843', '2006-02-15T10:09:17', 2), + ('843', '2006-02-15T10:09:17', 1), + ('843', '2006-02-15T10:09:17', 2), + ('593', '2006-02-15T10:09:17', 2), + ('593', '2006-02-15T10:09:17', 2), + ('593', '2006-02-15T10:09:17', 2), + ('593', '2006-02-15T10:09:17', 2), + ('829', '2006-02-15T10:09:17', 2), + ('829', '2006-02-15T10:09:17', 2), + ('829', '2006-02-15T10:09:17', 2), + ('829', '2006-02-15T10:09:17', 1), + ('829', '2006-02-15T10:09:17', 1), + ('168', '2006-02-15T10:09:17', 1), + ('168', '2006-02-15T10:09:17', 1), + ('786', '2006-02-15T10:09:17', 1), + ('786', '2006-02-15T10:09:17', 2), + ('786', '2006-02-15T10:09:17', 2), + ('786', '2006-02-15T10:09:17', 1), + ('786', '2006-02-15T10:09:17', 2), + ('786', '2006-02-15T10:09:17', 1), + ('786', '2006-02-15T10:09:17', 2), + ('340', '2006-02-15T10:09:17', 1), + ('340', '2006-02-15T10:09:17', 1), + ('336', '2006-02-15T10:09:17', 1), + ('336', '2006-02-15T10:09:17', 2), + ('336', '2006-02-15T10:09:17', 1), + ('336', '2006-02-15T10:09:17', 1), + ('336', '2006-02-15T10:09:17', 2), + ('511', '2006-02-15T10:09:17', 2), + ('511', '2006-02-15T10:09:17', 1), + ('511', '2006-02-15T10:09:17', 2), + ('511', '2006-02-15T10:09:17', 2), + ('511', '2006-02-15T10:09:17', 1), + ('812', '2006-02-15T10:09:17', 1), + ('812', '2006-02-15T10:09:17', 2), + ('812', '2006-02-15T10:09:17', 1), + ('812', '2006-02-15T10:09:17', 2), + ('812', '2006-02-15T10:09:17', 1), + ('812', '2006-02-15T10:09:17', 2), + ('129', '2006-02-15T10:09:17', 1), + ('129', '2006-02-15T10:09:17', 1), + ('129', '2006-02-15T10:09:17', 1), + ('129', '2006-02-15T10:09:17', 2), + ('129', '2006-02-15T10:09:17', 2), + ('129', '2006-02-15T10:09:17', 2), + ('346', '2006-02-15T10:09:17', 2), + ('346', '2006-02-15T10:09:17', 1), + ('346', '2006-02-15T10:09:17', 2), + ('346', '2006-02-15T10:09:17', 2), + ('346', '2006-02-15T10:09:17', 1), + ('346', '2006-02-15T10:09:17', 2), + ('613', '2006-02-15T10:09:17', 1), + ('613', '2006-02-15T10:09:17', 1), + ('895', '2006-02-15T10:09:17', 2), + ('895', '2006-02-15T10:09:17', 2), + ('895', '2006-02-15T10:09:17', 1), + ('895', '2006-02-15T10:09:17', 1), + ('895', '2006-02-15T10:09:17', 1), + ('895', '2006-02-15T10:09:17', 2), + ('895', '2006-02-15T10:09:17', 1), + ('795', '2006-02-15T10:09:17', 1), + ('795', '2006-02-15T10:09:17', 1), + ('795', '2006-02-15T10:09:17', 1), + ('795', '2006-02-15T10:09:17', 1), + ('741', '2006-02-15T10:09:17', 1), + ('741', '2006-02-15T10:09:17', 1), + ('741', '2006-02-15T10:09:17', 2), + ('741', '2006-02-15T10:09:17', 1), + ('741', '2006-02-15T10:09:17', 2), + ('741', '2006-02-15T10:09:17', 1), + ('119', '2006-02-15T10:09:17', 2), + ('119', '2006-02-15T10:09:17', 1), + ('119', '2006-02-15T10:09:17', 2), + ('119', '2006-02-15T10:09:17', 1), + ('119', '2006-02-15T10:09:17', 1), + ('119', '2006-02-15T10:09:17', 2), + ('119', '2006-02-15T10:09:17', 2), + ('42', '2006-02-15T10:09:17', 2), + ('42', '2006-02-15T10:09:17', 2), + ('42', '2006-02-15T10:09:17', 2), + ('42', '2006-02-15T10:09:17', 2), + ('726', '2006-02-15T10:09:17', 2), + ('726', '2006-02-15T10:09:17', 2), + ('726', '2006-02-15T10:09:17', 2), + ('385', '2006-02-15T10:09:17', 1), + ('385', '2006-02-15T10:09:17', 2), + ('385', '2006-02-15T10:09:17', 1), + ('385', '2006-02-15T10:09:17', 2), + ('385', '2006-02-15T10:09:17', 2), + ('17', '2006-02-15T10:09:17', 2), + ('17', '2006-02-15T10:09:17', 2), + ('17', '2006-02-15T10:09:17', 2), + ('17', '2006-02-15T10:09:17', 1), + ('17', '2006-02-15T10:09:17', 1), + ('17', '2006-02-15T10:09:17', 1), + ('806', '2006-02-15T10:09:17', 1) + ) AS data(old_film_id, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."film"' + AND map0.old_id = data.old_film_id + RETURNING inventory_id + ) + SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; + + FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); + END LOOP; + + v_old_ids_inventory := ARRAY['3684', '3688', '3685', '3687', '3057', '3060', '3058', '3056', '3059', '3061', '1563', '1564', '1075', '1069', '1072', '1076', '1071', '1073', '1070', '1074', '2147', '2148', '2144', '2146', '2149', '2150', '2145', '133', '132', '130', '131', '134', '4528', '4529', '4525', '4527', '4526', '3052', '3049', '3054', '3055', '3050', '3053', '3051', '2770', '2767', '2765', '2766', '2769', '2768', '2400', '2398', '2397', '2399', '2401', '2396', '951', '952', '954', '950', '953', '3745', '3744', '3746', '1409', '1407', '1408', '1406', '401', '400', '402', '403', '399', '404', '119', '115', '116', '118', '117', '1174', '1171', '1173', '1172', '499', '498', '500', '497', '4288', '4289', '4290', '3387', '3384', '3385', '3383', '3386', '3382', '2749', '2748', '2751', '2750']; + WITH inserted AS ( + INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") + SELECT + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + ('806', '2006-02-15T10:09:17', 1), + ('806', '2006-02-15T10:09:17', 2), + ('806', '2006-02-15T10:09:17', 1), + ('806', '2006-02-15T10:09:17', 2), + ('672', '2006-02-15T10:09:17', 1), + ('672', '2006-02-15T10:09:17', 2), + ('672', '2006-02-15T10:09:17', 2), + ('672', '2006-02-15T10:09:17', 1), + ('672', '2006-02-15T10:09:17', 2), + ('672', '2006-02-15T10:09:17', 2), + ('343', '2006-02-15T10:09:17', 1), + ('343', '2006-02-15T10:09:17', 1), + ('239', '2006-02-15T10:09:17', 2), + ('239', '2006-02-15T10:09:17', 1), + ('239', '2006-02-15T10:09:17', 1), + ('239', '2006-02-15T10:09:17', 2), + ('239', '2006-02-15T10:09:17', 1), + ('239', '2006-02-15T10:09:17', 2), + ('239', '2006-02-15T10:09:17', 1), + ('239', '2006-02-15T10:09:17', 2), + ('464', '2006-02-15T10:09:17', 1), + ('464', '2006-02-15T10:09:17', 2), + ('464', '2006-02-15T10:09:17', 1), + ('464', '2006-02-15T10:09:17', 1), + ('464', '2006-02-15T10:09:17', 2), + ('464', '2006-02-15T10:09:17', 2), + ('464', '2006-02-15T10:09:17', 1), + ('26', '2006-02-15T10:09:17', 2), + ('26', '2006-02-15T10:09:17', 2), + ('26', '2006-02-15T10:09:17', 1), + ('26', '2006-02-15T10:09:17', 1), + ('26', '2006-02-15T10:09:17', 2), + ('988', '2006-02-15T10:09:17', 2), + ('988', '2006-02-15T10:09:17', 2), + ('988', '2006-02-15T10:09:17', 1), + ('988', '2006-02-15T10:09:17', 1), + ('988', '2006-02-15T10:09:17', 1), + ('670', '2006-02-15T10:09:17', 1), + ('670', '2006-02-15T10:09:17', 1), + ('670', '2006-02-15T10:09:17', 2), + ('670', '2006-02-15T10:09:17', 2), + ('670', '2006-02-15T10:09:17', 1), + ('670', '2006-02-15T10:09:17', 2), + ('670', '2006-02-15T10:09:17', 1), + ('608', '2006-02-15T10:09:17', 2), + ('608', '2006-02-15T10:09:17', 2), + ('608', '2006-02-15T10:09:17', 1), + ('608', '2006-02-15T10:09:17', 1), + ('608', '2006-02-15T10:09:17', 2), + ('608', '2006-02-15T10:09:17', 2), + ('524', '2006-02-15T10:09:17', 2), + ('524', '2006-02-15T10:09:17', 2), + ('524', '2006-02-15T10:09:17', 1), + ('524', '2006-02-15T10:09:17', 2), + ('524', '2006-02-15T10:09:17', 2), + ('524', '2006-02-15T10:09:17', 1), + ('212', '2006-02-15T10:09:17', 1), + ('212', '2006-02-15T10:09:17', 1), + ('212', '2006-02-15T10:09:17', 2), + ('212', '2006-02-15T10:09:17', 1), + ('212', '2006-02-15T10:09:17', 2), + ('819', '2006-02-15T10:09:17', 1), + ('819', '2006-02-15T10:09:17', 1), + ('819', '2006-02-15T10:09:17', 1), + ('308', '2006-02-15T10:09:17', 2), + ('308', '2006-02-15T10:09:17', 1), + ('308', '2006-02-15T10:09:17', 2), + ('308', '2006-02-15T10:09:17', 1), + ('89', '2006-02-15T10:09:17', 1), + ('89', '2006-02-15T10:09:17', 1), + ('89', '2006-02-15T10:09:17', 2), + ('89', '2006-02-15T10:09:17', 2), + ('89', '2006-02-15T10:09:17', 1), + ('89', '2006-02-15T10:09:17', 2), + ('23', '2006-02-15T10:09:17', 2), + ('23', '2006-02-15T10:09:17', 1), + ('23', '2006-02-15T10:09:17', 1), + ('23', '2006-02-15T10:09:17', 2), + ('23', '2006-02-15T10:09:17', 1), + ('260', '2006-02-15T10:09:17', 2), + ('260', '2006-02-15T10:09:17', 2), + ('260', '2006-02-15T10:09:17', 2), + ('260', '2006-02-15T10:09:17', 2), + ('111', '2006-02-15T10:09:17', 2), + ('111', '2006-02-15T10:09:17', 2), + ('111', '2006-02-15T10:09:17', 2), + ('111', '2006-02-15T10:09:17', 2), + ('934', '2006-02-15T10:09:17', 2), + ('934', '2006-02-15T10:09:17', 2), + ('934', '2006-02-15T10:09:17', 2), + ('743', '2006-02-15T10:09:17', 2), + ('743', '2006-02-15T10:09:17', 2), + ('743', '2006-02-15T10:09:17', 2), + ('743', '2006-02-15T10:09:17', 1), + ('743', '2006-02-15T10:09:17', 2), + ('743', '2006-02-15T10:09:17', 1), + ('603', '2006-02-15T10:09:17', 1), + ('603', '2006-02-15T10:09:17', 1), + ('603', '2006-02-15T10:09:17', 1), + ('603', '2006-02-15T10:09:17', 1) + ) AS data(old_film_id, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."film"' + AND map0.old_id = data.old_film_id + RETURNING inventory_id + ) + SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; + + FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); + END LOOP; + + v_old_ids_inventory := ARRAY['2753', '2752', '3774', '3773', '2189', '2187', '2191', '2188', '2190', '2478', '2479', '908', '907', '905', '906', '1596', '1602', '1603', '1599', '1600', '1598', '1601', '1597', '628', '626', '627', '3184', '3186', '3185', '3183', '3181', '3182', '3180', '4164', '4165', '4163', '4456', '4458', '4454', '4455', '4453', '4451', '4452', '4457', '1176', '1175', '814', '816', '815', '2796', '2798', '2794', '2797', '2799', '2795', '4300', '4301', '4299', '4302', '4303', '4392', '4394', '4393', '4011', '4014', '4009', '4010', '4007', '4008', '4013', '4012', '2960', '2961', '2962', '2958', '2963', '2959', '3040', '3043', '3041', '3042', '219', '216', '220', '218', '217', '221', '993', '997', '996', '995', '994', '998', '3200', '3201', '1228', '1229', '1226', '1227', '4015']; + WITH inserted AS ( + INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") + SELECT + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + ('603', '2006-02-15T10:09:17', 2), + ('603', '2006-02-15T10:09:17', 2), + ('826', '2006-02-15T10:09:17', 2), + ('826', '2006-02-15T10:09:17', 2), + ('473', '2006-02-15T10:09:17', 2), + ('473', '2006-02-15T10:09:17', 1), + ('473', '2006-02-15T10:09:17', 2), + ('473', '2006-02-15T10:09:17', 1), + ('473', '2006-02-15T10:09:17', 2), + ('543', '2006-02-15T10:09:17', 1), + ('543', '2006-02-15T10:09:17', 1), + ('201', '2006-02-15T10:09:17', 1), + ('201', '2006-02-15T10:09:17', 1), + ('201', '2006-02-15T10:09:17', 1), + ('201', '2006-02-15T10:09:17', 1), + ('350', '2006-02-15T10:09:17', 1), + ('350', '2006-02-15T10:09:17', 2), + ('350', '2006-02-15T10:09:17', 2), + ('350', '2006-02-15T10:09:17', 1), + ('350', '2006-02-15T10:09:17', 2), + ('350', '2006-02-15T10:09:17', 1), + ('350', '2006-02-15T10:09:17', 2), + ('350', '2006-02-15T10:09:17', 1), + ('136', '2006-02-15T10:09:17', 1), + ('136', '2006-02-15T10:09:17', 1), + ('136', '2006-02-15T10:09:17', 1), + ('698', '2006-02-15T10:09:17', 2), + ('698', '2006-02-15T10:09:17', 2), + ('698', '2006-02-15T10:09:17', 2), + ('698', '2006-02-15T10:09:17', 1), + ('698', '2006-02-15T10:09:17', 1), + ('698', '2006-02-15T10:09:17', 1), + ('698', '2006-02-15T10:09:17', 1), + ('905', '2006-02-15T10:09:17', 1), + ('905', '2006-02-15T10:09:17', 1), + ('905', '2006-02-15T10:09:17', 1), + ('973', '2006-02-15T10:09:17', 2), + ('973', '2006-02-15T10:09:17', 2), + ('973', '2006-02-15T10:09:17', 1), + ('973', '2006-02-15T10:09:17', 2), + ('973', '2006-02-15T10:09:17', 1), + ('973', '2006-02-15T10:09:17', 1), + ('973', '2006-02-15T10:09:17', 1), + ('973', '2006-02-15T10:09:17', 2), + ('261', '2006-02-15T10:09:17', 1), + ('261', '2006-02-15T10:09:17', 1), + ('177', '2006-02-15T10:09:17', 2), + ('177', '2006-02-15T10:09:17', 2), + ('177', '2006-02-15T10:09:17', 2), + ('614', '2006-02-15T10:09:17', 1), + ('614', '2006-02-15T10:09:17', 2), + ('614', '2006-02-15T10:09:17', 1), + ('614', '2006-02-15T10:09:17', 2), + ('614', '2006-02-15T10:09:17', 2), + ('614', '2006-02-15T10:09:17', 1), + ('937', '2006-02-15T10:09:17', 1), + ('937', '2006-02-15T10:09:17', 2), + ('937', '2006-02-15T10:09:17', 1), + ('937', '2006-02-15T10:09:17', 2), + ('937', '2006-02-15T10:09:17', 2), + ('960', '2006-02-15T10:09:17', 2), + ('960', '2006-02-15T10:09:17', 2), + ('960', '2006-02-15T10:09:17', 2), + ('873', '2006-02-15T10:09:17', 2), + ('873', '2006-02-15T10:09:17', 2), + ('873', '2006-02-15T10:09:17', 1), + ('873', '2006-02-15T10:09:17', 1), + ('873', '2006-02-15T10:09:17', 1), + ('873', '2006-02-15T10:09:17', 1), + ('873', '2006-02-15T10:09:17', 2), + ('873', '2006-02-15T10:09:17', 2), + ('649', '2006-02-15T10:09:17', 2), + ('649', '2006-02-15T10:09:17', 2), + ('649', '2006-02-15T10:09:17', 2), + ('649', '2006-02-15T10:09:17', 1), + ('649', '2006-02-15T10:09:17', 2), + ('649', '2006-02-15T10:09:17', 1), + ('667', '2006-02-15T10:09:17', 1), + ('667', '2006-02-15T10:09:17', 2), + ('667', '2006-02-15T10:09:17', 1), + ('667', '2006-02-15T10:09:17', 2), + ('49', '2006-02-15T10:09:17', 2), + ('49', '2006-02-15T10:09:17', 1), + ('49', '2006-02-15T10:09:17', 2), + ('49', '2006-02-15T10:09:17', 1), + ('49', '2006-02-15T10:09:17', 1), + ('49', '2006-02-15T10:09:17', 2), + ('222', '2006-02-15T10:09:17', 1), + ('222', '2006-02-15T10:09:17', 2), + ('222', '2006-02-15T10:09:17', 2), + ('222', '2006-02-15T10:09:17', 2), + ('222', '2006-02-15T10:09:17', 1), + ('222', '2006-02-15T10:09:17', 2), + ('703', '2006-02-15T10:09:17', 2), + ('703', '2006-02-15T10:09:17', 2), + ('272', '2006-02-15T10:09:17', 1), + ('272', '2006-02-15T10:09:17', 1), + ('272', '2006-02-15T10:09:17', 1), + ('272', '2006-02-15T10:09:17', 1), + ('875', '2006-02-15T10:09:17', 1) + ) AS data(old_film_id, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."film"' + AND map0.old_id = data.old_film_id + RETURNING inventory_id + ) + SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; + + FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); + END LOOP; + + v_old_ids_inventory := ARRAY['4019', '4020', '4016', '4021', '4018', '4017', '3859', '3862', '3865', '3864', '3861', '3863', '3860', '1627', '1631', '1634', '1630', '1629', '1632', '1628', '1633', '757', '754', '753', '756', '755', '1785', '1788', '1789', '1786', '1787', '1784', '4352', '4350', '4348', '4351', '4349', '4347', '709', '713', '711', '710', '712', '526', '528', '531', '529', '530', '527', '1908', '1907', '1906', '1905', '1910', '1909', '90', '91', '89', '88', '87', '92', '1002', '1001', '2850', '2851', '2853', '2856', '2852', '2855', '2854', '309', '305', '304', '307', '308', '310', '306', '311', '1658', '1651', '1653', '1654', '1655', '1656', '1652', '1657', '2885', '2884', '2886', '4474', '4473', '4472', '4068', '4069', '4072', '4070', '4071', '4067', '949', '948']; + WITH inserted AS ( + INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") + SELECT + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + ('875', '2006-02-15T10:09:17', 2), + ('875', '2006-02-15T10:09:17', 2), + ('875', '2006-02-15T10:09:17', 1), + ('875', '2006-02-15T10:09:17', 2), + ('875', '2006-02-15T10:09:17', 2), + ('875', '2006-02-15T10:09:17', 1), + ('845', '2006-02-15T10:09:17', 1), + ('845', '2006-02-15T10:09:17', 1), + ('845', '2006-02-15T10:09:17', 2), + ('845', '2006-02-15T10:09:17', 2), + ('845', '2006-02-15T10:09:17', 1), + ('845', '2006-02-15T10:09:17', 2), + ('845', '2006-02-15T10:09:17', 1), + ('356', '2006-02-15T10:09:17', 1), + ('356', '2006-02-15T10:09:17', 2), + ('356', '2006-02-15T10:09:17', 2), + ('356', '2006-02-15T10:09:17', 1), + ('356', '2006-02-15T10:09:17', 1), + ('356', '2006-02-15T10:09:17', 2), + ('356', '2006-02-15T10:09:17', 1), + ('356', '2006-02-15T10:09:17', 2), + ('165', '2006-02-15T10:09:17', 2), + ('165', '2006-02-15T10:09:17', 1), + ('165', '2006-02-15T10:09:17', 1), + ('165', '2006-02-15T10:09:17', 2), + ('165', '2006-02-15T10:09:17', 1), + ('388', '2006-02-15T10:09:17', 1), + ('388', '2006-02-15T10:09:17', 2), + ('388', '2006-02-15T10:09:17', 2), + ('388', '2006-02-15T10:09:17', 1), + ('388', '2006-02-15T10:09:17', 2), + ('388', '2006-02-15T10:09:17', 1), + ('948', '2006-02-15T10:09:17', 2), + ('948', '2006-02-15T10:09:17', 2), + ('948', '2006-02-15T10:09:17', 1), + ('948', '2006-02-15T10:09:17', 2), + ('948', '2006-02-15T10:09:17', 2), + ('948', '2006-02-15T10:09:17', 1), + ('155', '2006-02-15T10:09:17', 1), + ('155', '2006-02-15T10:09:17', 2), + ('155', '2006-02-15T10:09:17', 2), + ('155', '2006-02-15T10:09:17', 1), + ('155', '2006-02-15T10:09:17', 2), + ('116', '2006-02-15T10:09:17', 1), + ('116', '2006-02-15T10:09:17', 2), + ('116', '2006-02-15T10:09:17', 2), + ('116', '2006-02-15T10:09:17', 2), + ('116', '2006-02-15T10:09:17', 2), + ('116', '2006-02-15T10:09:17', 1), + ('415', '2006-02-15T10:09:17', 2), + ('415', '2006-02-15T10:09:17', 1), + ('415', '2006-02-15T10:09:17', 1), + ('415', '2006-02-15T10:09:17', 1), + ('415', '2006-02-15T10:09:17', 2), + ('415', '2006-02-15T10:09:17', 2), + ('18', '2006-02-15T10:09:17', 2), + ('18', '2006-02-15T10:09:17', 2), + ('18', '2006-02-15T10:09:17', 1), + ('18', '2006-02-15T10:09:17', 1), + ('18', '2006-02-15T10:09:17', 1), + ('18', '2006-02-15T10:09:17', 2), + ('224', '2006-02-15T10:09:17', 1), + ('224', '2006-02-15T10:09:17', 1), + ('625', '2006-02-15T10:09:17', 1), + ('625', '2006-02-15T10:09:17', 1), + ('625', '2006-02-15T10:09:17', 2), + ('625', '2006-02-15T10:09:17', 2), + ('625', '2006-02-15T10:09:17', 1), + ('625', '2006-02-15T10:09:17', 2), + ('625', '2006-02-15T10:09:17', 2), + ('69', '2006-02-15T10:09:17', 2), + ('69', '2006-02-15T10:09:17', 1), + ('69', '2006-02-15T10:09:17', 1), + ('69', '2006-02-15T10:09:17', 1), + ('69', '2006-02-15T10:09:17', 2), + ('69', '2006-02-15T10:09:17', 2), + ('69', '2006-02-15T10:09:17', 1), + ('69', '2006-02-15T10:09:17', 2), + ('361', '2006-02-15T10:09:17', 2), + ('361', '2006-02-15T10:09:17', 1), + ('361', '2006-02-15T10:09:17', 1), + ('361', '2006-02-15T10:09:17', 1), + ('361', '2006-02-15T10:09:17', 2), + ('361', '2006-02-15T10:09:17', 2), + ('361', '2006-02-15T10:09:17', 1), + ('361', '2006-02-15T10:09:17', 2), + ('633', '2006-02-15T10:09:17', 2), + ('633', '2006-02-15T10:09:17', 2), + ('633', '2006-02-15T10:09:17', 2), + ('977', '2006-02-15T10:09:17', 2), + ('977', '2006-02-15T10:09:17', 2), + ('977', '2006-02-15T10:09:17', 2), + ('887', '2006-02-15T10:09:17', 1), + ('887', '2006-02-15T10:09:17', 1), + ('887', '2006-02-15T10:09:17', 2), + ('887', '2006-02-15T10:09:17', 1), + ('887', '2006-02-15T10:09:17', 2), + ('887', '2006-02-15T10:09:17', 1), + ('211', '2006-02-15T10:09:17', 1), + ('211', '2006-02-15T10:09:17', 1) + ) AS data(old_film_id, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."film"' + AND map0.old_id = data.old_film_id + RETURNING inventory_id + ) + SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; + + FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); + END LOOP; + + v_old_ids_inventory := ARRAY['2325', '2327', '2328', '2326', '2445', '2447', '2448', '2449', '2446', '45', '42', '41', '44', '43', '1437', '1435', '1439', '1434', '1438', '1436', '3655', '3657', '3654', '3656', '2371', '2372', '4121', '4124', '4122', '4123', '1529', '1530', '1527', '1531', '1528', '1526', '2035', '2036', '2033', '2037', '2038', '2034', '2032', '1284', '1281', '1283', '1282', '1285', '1286', '1287', '577', '579', '578', '2156', '2157', '441', '436', '440', '437', '438', '439', '483', '484', '4146', '4148', '4145', '4151', '4150', '4147', '4149', '3889', '3892', '3893', '3890', '3894', '3895', '3891', '4501', '4496', '4498', '4502', '4500', '4499', '4497', '3756', '3754', '3755', '3753', '2903', '2905', '2907', '2908', '2902', '2904', '2901', '2906', '2654', '2655', '3719', '3718']; + WITH inserted AS ( + INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") + SELECT + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + ('505', '2006-02-15T10:09:17', 2), + ('505', '2006-02-15T10:09:17', 2), + ('505', '2006-02-15T10:09:17', 2), + ('505', '2006-02-15T10:09:17', 2), + ('534', '2006-02-15T10:09:17', 1), + ('534', '2006-02-15T10:09:17', 2), + ('534', '2006-02-15T10:09:17', 2), + ('534', '2006-02-15T10:09:17', 2), + ('534', '2006-02-15T10:09:17', 1), + ('9', '2006-02-15T10:09:17', 2), + ('9', '2006-02-15T10:09:17', 1), + ('9', '2006-02-15T10:09:17', 1), + ('9', '2006-02-15T10:09:17', 2), + ('9', '2006-02-15T10:09:17', 1), + ('314', '2006-02-15T10:09:17', 2), + ('314', '2006-02-15T10:09:17', 1), + ('314', '2006-02-15T10:09:17', 2), + ('314', '2006-02-15T10:09:17', 1), + ('314', '2006-02-15T10:09:17', 2), + ('314', '2006-02-15T10:09:17', 2), + ('798', '2006-02-15T10:09:17', 1), + ('798', '2006-02-15T10:09:17', 2), + ('798', '2006-02-15T10:09:17', 1), + ('798', '2006-02-15T10:09:17', 2), + ('517', '2006-02-15T10:09:17', 2), + ('517', '2006-02-15T10:09:17', 2), + ('896', '2006-02-15T10:09:17', 1), + ('896', '2006-02-15T10:09:17', 2), + ('896', '2006-02-15T10:09:17', 1), + ('896', '2006-02-15T10:09:17', 2), + ('334', '2006-02-15T10:09:17', 2), + ('334', '2006-02-15T10:09:17', 2), + ('334', '2006-02-15T10:09:17', 1), + ('334', '2006-02-15T10:09:17', 2), + ('334', '2006-02-15T10:09:17', 2), + ('334', '2006-02-15T10:09:17', 1), + ('443', '2006-02-15T10:09:17', 2), + ('443', '2006-02-15T10:09:17', 2), + ('443', '2006-02-15T10:09:17', 1), + ('443', '2006-02-15T10:09:17', 2), + ('443', '2006-02-15T10:09:17', 2), + ('443', '2006-02-15T10:09:17', 1), + ('443', '2006-02-15T10:09:17', 1), + ('284', '2006-02-15T10:09:17', 2), + ('284', '2006-02-15T10:09:17', 1), + ('284', '2006-02-15T10:09:17', 1), + ('284', '2006-02-15T10:09:17', 1), + ('284', '2006-02-15T10:09:17', 2), + ('284', '2006-02-15T10:09:17', 2), + ('284', '2006-02-15T10:09:17', 2), + ('126', '2006-02-15T10:09:17', 2), + ('126', '2006-02-15T10:09:17', 2), + ('126', '2006-02-15T10:09:17', 2), + ('466', '2006-02-15T10:09:17', 1), + ('466', '2006-02-15T10:09:17', 1), + ('97', '2006-02-15T10:09:17', 2), + ('97', '2006-02-15T10:09:17', 1), + ('97', '2006-02-15T10:09:17', 2), + ('97', '2006-02-15T10:09:17', 1), + ('97', '2006-02-15T10:09:17', 1), + ('97', '2006-02-15T10:09:17', 1), + ('107', '2006-02-15T10:09:17', 2), + ('107', '2006-02-15T10:09:17', 2), + ('901', '2006-02-15T10:09:17', 1), + ('901', '2006-02-15T10:09:17', 1), + ('901', '2006-02-15T10:09:17', 1), + ('901', '2006-02-15T10:09:17', 2), + ('901', '2006-02-15T10:09:17', 2), + ('901', '2006-02-15T10:09:17', 1), + ('901', '2006-02-15T10:09:17', 2), + ('850', '2006-02-15T10:09:17', 1), + ('850', '2006-02-15T10:09:17', 2), + ('850', '2006-02-15T10:09:17', 2), + ('850', '2006-02-15T10:09:17', 1), + ('850', '2006-02-15T10:09:17', 2), + ('850', '2006-02-15T10:09:17', 2), + ('850', '2006-02-15T10:09:17', 1), + ('982', '2006-02-15T10:09:17', 2), + ('982', '2006-02-15T10:09:17', 1), + ('982', '2006-02-15T10:09:17', 1), + ('982', '2006-02-15T10:09:17', 2), + ('982', '2006-02-15T10:09:17', 2), + ('982', '2006-02-15T10:09:17', 2), + ('982', '2006-02-15T10:09:17', 1), + ('821', '2006-02-15T10:09:17', 2), + ('821', '2006-02-15T10:09:17', 2), + ('821', '2006-02-15T10:09:17', 2), + ('821', '2006-02-15T10:09:17', 2), + ('638', '2006-02-15T10:09:17', 1), + ('638', '2006-02-15T10:09:17', 2), + ('638', '2006-02-15T10:09:17', 2), + ('638', '2006-02-15T10:09:17', 2), + ('638', '2006-02-15T10:09:17', 1), + ('638', '2006-02-15T10:09:17', 1), + ('638', '2006-02-15T10:09:17', 1), + ('638', '2006-02-15T10:09:17', 2), + ('582', '2006-02-15T10:09:17', 2), + ('582', '2006-02-15T10:09:17', 2), + ('813', '2006-02-15T10:09:17', 2), + ('813', '2006-02-15T10:09:17', 2) + ) AS data(old_film_id, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."film"' + AND map0.old_id = data.old_film_id + RETURNING inventory_id + ) + SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; + + FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); + END LOOP; + + v_old_ids_inventory := ARRAY['3716', '3717', '3032', '3034', '3031', '3033', '3028', '3030', '3029', '3013', '3011', '3010', '3012', '1932', '1935', '1931', '1933', '1934', '2451', '2453', '2450', '2452', '4022', '4023', '1999', '1998', '3151', '3153', '3152', '2539', '2541', '2543', '2540', '2542', '1025', '1026', '1024', '1023', '2726', '2728', '2727', '2725', '2086', '2085', '2088', '2087', '4559', '4561', '4560', '4558', '4562', '4557', '3520', '3522', '3519', '3521', '3523', '3524', '3518', '3996', '3995', '3998', '3992', '3994', '3993', '3991', '3997', '1058', '1057', '1055', '1056', '1059', '1060', '2952', '2953', '2956', '2957', '2954', '2955', '1314', '1313', '1312', '2274', '2275', '2271', '2270', '2273', '2272', '1638', '1637', '1636', '1635', '3530', '3528', '3527', '3529', '3525', '3526', '96', '93']; + WITH inserted AS ( + INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") + SELECT + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + ('813', '2006-02-15T10:09:17', 2), + ('813', '2006-02-15T10:09:17', 2), + ('665', '2006-02-15T10:09:17', 2), + ('665', '2006-02-15T10:09:17', 2), + ('665', '2006-02-15T10:09:17', 1), + ('665', '2006-02-15T10:09:17', 2), + ('665', '2006-02-15T10:09:17', 1), + ('665', '2006-02-15T10:09:17', 1), + ('665', '2006-02-15T10:09:17', 1), + ('661', '2006-02-15T10:09:17', 1), + ('661', '2006-02-15T10:09:17', 1), + ('661', '2006-02-15T10:09:17', 1), + ('661', '2006-02-15T10:09:17', 1), + ('420', '2006-02-15T10:09:17', 1), + ('420', '2006-02-15T10:09:17', 2), + ('420', '2006-02-15T10:09:17', 1), + ('420', '2006-02-15T10:09:17', 2), + ('420', '2006-02-15T10:09:17', 2), + ('535', '2006-02-15T10:09:17', 1), + ('535', '2006-02-15T10:09:17', 1), + ('535', '2006-02-15T10:09:17', 1), + ('535', '2006-02-15T10:09:17', 1), + ('876', '2006-02-15T10:09:17', 1), + ('876', '2006-02-15T10:09:17', 1), + ('435', '2006-02-15T10:09:17', 1), + ('435', '2006-02-15T10:09:17', 1), + ('692', '2006-02-15T10:09:17', 2), + ('692', '2006-02-15T10:09:17', 2), + ('692', '2006-02-15T10:09:17', 2), + ('557', '2006-02-15T10:09:17', 1), + ('557', '2006-02-15T10:09:17', 2), + ('557', '2006-02-15T10:09:17', 2), + ('557', '2006-02-15T10:09:17', 1), + ('557', '2006-02-15T10:09:17', 2), + ('229', '2006-02-15T10:09:17', 2), + ('229', '2006-02-15T10:09:17', 2), + ('229', '2006-02-15T10:09:17', 1), + ('229', '2006-02-15T10:09:17', 1), + ('598', '2006-02-15T10:09:17', 1), + ('598', '2006-02-15T10:09:17', 1), + ('598', '2006-02-15T10:09:17', 1), + ('598', '2006-02-15T10:09:17', 1), + ('452', '2006-02-15T10:09:17', 2), + ('452', '2006-02-15T10:09:17', 2), + ('452', '2006-02-15T10:09:17', 2), + ('452', '2006-02-15T10:09:17', 2), + ('995', '2006-02-15T10:09:17', 1), + ('995', '2006-02-15T10:09:17', 2), + ('995', '2006-02-15T10:09:17', 1), + ('995', '2006-02-15T10:09:17', 1), + ('995', '2006-02-15T10:09:17', 2), + ('995', '2006-02-15T10:09:17', 1), + ('771', '2006-02-15T10:09:17', 1), + ('771', '2006-02-15T10:09:17', 2), + ('771', '2006-02-15T10:09:17', 1), + ('771', '2006-02-15T10:09:17', 2), + ('771', '2006-02-15T10:09:17', 2), + ('771', '2006-02-15T10:09:17', 2), + ('771', '2006-02-15T10:09:17', 1), + ('870', '2006-02-15T10:09:17', 2), + ('870', '2006-02-15T10:09:17', 2), + ('870', '2006-02-15T10:09:17', 2), + ('870', '2006-02-15T10:09:17', 1), + ('870', '2006-02-15T10:09:17', 1), + ('870', '2006-02-15T10:09:17', 1), + ('870', '2006-02-15T10:09:17', 1), + ('870', '2006-02-15T10:09:17', 2), + ('235', '2006-02-15T10:09:17', 2), + ('235', '2006-02-15T10:09:17', 2), + ('235', '2006-02-15T10:09:17', 1), + ('235', '2006-02-15T10:09:17', 1), + ('235', '2006-02-15T10:09:17', 2), + ('235', '2006-02-15T10:09:17', 2), + ('648', '2006-02-15T10:09:17', 1), + ('648', '2006-02-15T10:09:17', 1), + ('648', '2006-02-15T10:09:17', 2), + ('648', '2006-02-15T10:09:17', 2), + ('648', '2006-02-15T10:09:17', 1), + ('648', '2006-02-15T10:09:17', 1), + ('290', '2006-02-15T10:09:17', 1), + ('290', '2006-02-15T10:09:17', 1), + ('290', '2006-02-15T10:09:17', 1), + ('491', '2006-02-15T10:09:17', 2), + ('491', '2006-02-15T10:09:17', 2), + ('491', '2006-02-15T10:09:17', 1), + ('491', '2006-02-15T10:09:17', 1), + ('491', '2006-02-15T10:09:17', 2), + ('491', '2006-02-15T10:09:17', 2), + ('357', '2006-02-15T10:09:17', 2), + ('357', '2006-02-15T10:09:17', 2), + ('357', '2006-02-15T10:09:17', 2), + ('357', '2006-02-15T10:09:17', 2), + ('772', '2006-02-15T10:09:17', 2), + ('772', '2006-02-15T10:09:17', 1), + ('772', '2006-02-15T10:09:17', 1), + ('772', '2006-02-15T10:09:17', 2), + ('772', '2006-02-15T10:09:17', 1), + ('772', '2006-02-15T10:09:17', 1), + ('19', '2006-02-15T10:09:17', 1), + ('19', '2006-02-15T10:09:17', 1) + ) AS data(old_film_id, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."film"' + AND map0.old_id = data.old_film_id + RETURNING inventory_id + ) + SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; + + FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); + END LOOP; + + v_old_ids_inventory := ARRAY['94', '98', '97', '95', '4346', '4345', '1353', '1350', '1352', '1351', '1349', '4139', '4140', '4138', '4028', '4025', '4027', '4024', '4026', '263', '262', '260', '261', '1839', '1840', '326', '333', '331', '329', '328', '332', '330', '327', '427', '426', '1502', '1506', '1503', '1504', '1501', '1505', '2239', '2242', '2237', '2236', '2240', '2238', '2241', '2638', '2644', '2639', '2640', '2642', '2641', '2643', '356', '351', '354', '357', '353', '355', '352', '737', '736', '4135', '4137', '4134', '4133', '4136', '2738', '2740', '2742', '2741', '2739', '4062', '4061', '420', '422', '421', '419', '3962', '3959', '3960', '3957', '3961', '3958', '3956', '4230', '4234', '4231', '4233', '4232', '1544', '1545', '1543', '2392', '2393', '3099', '3098', '3101']; + WITH inserted AS ( + INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") + SELECT + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + ('19', '2006-02-15T10:09:17', 1), + ('19', '2006-02-15T10:09:17', 2), + ('19', '2006-02-15T10:09:17', 2), + ('19', '2006-02-15T10:09:17', 1), + ('947', '2006-02-15T10:09:17', 1), + ('947', '2006-02-15T10:09:17', 1), + ('298', '2006-02-15T10:09:17', 2), + ('298', '2006-02-15T10:09:17', 1), + ('298', '2006-02-15T10:09:17', 2), + ('298', '2006-02-15T10:09:17', 2), + ('298', '2006-02-15T10:09:17', 1), + ('899', '2006-02-15T10:09:17', 1), + ('899', '2006-02-15T10:09:17', 1), + ('899', '2006-02-15T10:09:17', 1), + ('877', '2006-02-15T10:09:17', 2), + ('877', '2006-02-15T10:09:17', 1), + ('877', '2006-02-15T10:09:17', 2), + ('877', '2006-02-15T10:09:17', 1), + ('877', '2006-02-15T10:09:17', 1), + ('58', '2006-02-15T10:09:17', 2), + ('58', '2006-02-15T10:09:17', 2), + ('58', '2006-02-15T10:09:17', 2), + ('58', '2006-02-15T10:09:17', 2), + ('400', '2006-02-15T10:09:17', 1), + ('400', '2006-02-15T10:09:17', 1), + ('73', '2006-02-15T10:09:17', 1), + ('73', '2006-02-15T10:09:17', 2), + ('73', '2006-02-15T10:09:17', 2), + ('73', '2006-02-15T10:09:17', 1), + ('73', '2006-02-15T10:09:17', 1), + ('73', '2006-02-15T10:09:17', 2), + ('73', '2006-02-15T10:09:17', 2), + ('73', '2006-02-15T10:09:17', 1), + ('94', '2006-02-15T10:09:17', 1), + ('94', '2006-02-15T10:09:17', 1), + ('329', '2006-02-15T10:09:17', 1), + ('329', '2006-02-15T10:09:17', 2), + ('329', '2006-02-15T10:09:17', 1), + ('329', '2006-02-15T10:09:17', 2), + ('329', '2006-02-15T10:09:17', 1), + ('329', '2006-02-15T10:09:17', 2), + ('484', '2006-02-15T10:09:17', 1), + ('484', '2006-02-15T10:09:17', 2), + ('484', '2006-02-15T10:09:17', 1), + ('484', '2006-02-15T10:09:17', 1), + ('484', '2006-02-15T10:09:17', 2), + ('484', '2006-02-15T10:09:17', 1), + ('484', '2006-02-15T10:09:17', 2), + ('579', '2006-02-15T10:09:17', 1), + ('579', '2006-02-15T10:09:17', 2), + ('579', '2006-02-15T10:09:17', 1), + ('579', '2006-02-15T10:09:17', 1), + ('579', '2006-02-15T10:09:17', 2), + ('579', '2006-02-15T10:09:17', 1), + ('579', '2006-02-15T10:09:17', 2), + ('78', '2006-02-15T10:09:17', 2), + ('78', '2006-02-15T10:09:17', 1), + ('78', '2006-02-15T10:09:17', 2), + ('78', '2006-02-15T10:09:17', 2), + ('78', '2006-02-15T10:09:17', 1), + ('78', '2006-02-15T10:09:17', 2), + ('78', '2006-02-15T10:09:17', 1), + ('161', '2006-02-15T10:09:17', 1), + ('161', '2006-02-15T10:09:17', 1), + ('898', '2006-02-15T10:09:17', 1), + ('898', '2006-02-15T10:09:17', 2), + ('898', '2006-02-15T10:09:17', 1), + ('898', '2006-02-15T10:09:17', 1), + ('898', '2006-02-15T10:09:17', 2), + ('601', '2006-02-15T10:09:17', 1), + ('601', '2006-02-15T10:09:17', 1), + ('601', '2006-02-15T10:09:17', 2), + ('601', '2006-02-15T10:09:17', 2), + ('601', '2006-02-15T10:09:17', 1), + ('885', '2006-02-15T10:09:17', 1), + ('885', '2006-02-15T10:09:17', 1), + ('92', '2006-02-15T10:09:17', 1), + ('92', '2006-02-15T10:09:17', 2), + ('92', '2006-02-15T10:09:17', 2), + ('92', '2006-02-15T10:09:17', 1), + ('863', '2006-02-15T10:09:17', 2), + ('863', '2006-02-15T10:09:17', 1), + ('863', '2006-02-15T10:09:17', 2), + ('863', '2006-02-15T10:09:17', 1), + ('863', '2006-02-15T10:09:17', 2), + ('863', '2006-02-15T10:09:17', 1), + ('863', '2006-02-15T10:09:17', 1), + ('920', '2006-02-15T10:09:17', 1), + ('920', '2006-02-15T10:09:17', 2), + ('920', '2006-02-15T10:09:17', 1), + ('920', '2006-02-15T10:09:17', 2), + ('920', '2006-02-15T10:09:17', 1), + ('338', '2006-02-15T10:09:17', 2), + ('338', '2006-02-15T10:09:17', 2), + ('338', '2006-02-15T10:09:17', 2), + ('522', '2006-02-15T10:09:17', 2), + ('522', '2006-02-15T10:09:17', 2), + ('681', '2006-02-15T10:09:17', 1), + ('681', '2006-02-15T10:09:17', 1), + ('681', '2006-02-15T10:09:17', 2) + ) AS data(old_film_id, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."film"' + AND map0.old_id = data.old_film_id + RETURNING inventory_id + ) + SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; + + FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); + END LOOP; + + v_old_ids_inventory := ARRAY['3103', '3102', '3100', '2967', '2968', '2966', '2965', '2969', '2964', '26', '30', '29', '31', '28', '27', '1573', '1574', '1572', '1571', '1570', '3024', '3026', '3023', '3027', '3025', '3503', '3502', '3505', '3506', '3500', '3504', '3501', '3499', '3627', '3628', '3625', '3624', '3623', '3626', '4005', '4006', '4004', '1824', '1822', '1825', '1823', '1979', '1980', '1983', '1981', '1982', '2246', '2247', '2250', '2251', '2249', '2248', '2696', '2698', '2697', '2699', '103', '105', '106', '104', '102', '107', '566', '561', '563', '562', '560', '564', '565', '745', '747', '746', '3229', '3228', '3232', '3231', '3230', '3227', '3875', '3876', '3874', '3877', '3389', '3392', '3390', '3391', '3388', '3236', '3238', '3235', '3233', '3234', '3237', '3975', '3976']; + WITH inserted AS ( + INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") + SELECT + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + ('681', '2006-02-15T10:09:17', 2), + ('681', '2006-02-15T10:09:17', 2), + ('681', '2006-02-15T10:09:17', 1), + ('650', '2006-02-15T10:09:17', 2), + ('650', '2006-02-15T10:09:17', 2), + ('650', '2006-02-15T10:09:17', 2), + ('650', '2006-02-15T10:09:17', 1), + ('650', '2006-02-15T10:09:17', 2), + ('650', '2006-02-15T10:09:17', 1), + ('6', '2006-02-15T10:09:17', 1), + ('6', '2006-02-15T10:09:17', 2), + ('6', '2006-02-15T10:09:17', 2), + ('6', '2006-02-15T10:09:17', 2), + ('6', '2006-02-15T10:09:17', 1), + ('6', '2006-02-15T10:09:17', 1), + ('345', '2006-02-15T10:09:17', 2), + ('345', '2006-02-15T10:09:17', 2), + ('345', '2006-02-15T10:09:17', 1), + ('345', '2006-02-15T10:09:17', 1), + ('345', '2006-02-15T10:09:17', 1), + ('664', '2006-02-15T10:09:17', 1), + ('664', '2006-02-15T10:09:17', 2), + ('664', '2006-02-15T10:09:17', 1), + ('664', '2006-02-15T10:09:17', 2), + ('664', '2006-02-15T10:09:17', 2), + ('767', '2006-02-15T10:09:17', 2), + ('767', '2006-02-15T10:09:17', 1), + ('767', '2006-02-15T10:09:17', 2), + ('767', '2006-02-15T10:09:17', 2), + ('767', '2006-02-15T10:09:17', 1), + ('767', '2006-02-15T10:09:17', 2), + ('767', '2006-02-15T10:09:17', 1), + ('767', '2006-02-15T10:09:17', 1), + ('791', '2006-02-15T10:09:17', 2), + ('791', '2006-02-15T10:09:17', 2), + ('791', '2006-02-15T10:09:17', 2), + ('791', '2006-02-15T10:09:17', 1), + ('791', '2006-02-15T10:09:17', 1), + ('791', '2006-02-15T10:09:17', 2), + ('872', '2006-02-15T10:09:17', 2), + ('872', '2006-02-15T10:09:17', 2), + ('872', '2006-02-15T10:09:17', 2), + ('396', '2006-02-15T10:09:17', 2), + ('396', '2006-02-15T10:09:17', 2), + ('396', '2006-02-15T10:09:17', 2), + ('396', '2006-02-15T10:09:17', 2), + ('432', '2006-02-15T10:09:17', 1), + ('432', '2006-02-15T10:09:17', 1), + ('432', '2006-02-15T10:09:17', 2), + ('432', '2006-02-15T10:09:17', 1), + ('432', '2006-02-15T10:09:17', 2), + ('486', '2006-02-15T10:09:17', 1), + ('486', '2006-02-15T10:09:17', 1), + ('486', '2006-02-15T10:09:17', 2), + ('486', '2006-02-15T10:09:17', 2), + ('486', '2006-02-15T10:09:17', 1), + ('486', '2006-02-15T10:09:17', 1), + ('592', '2006-02-15T10:09:17', 1), + ('592', '2006-02-15T10:09:17', 2), + ('592', '2006-02-15T10:09:17', 1), + ('592', '2006-02-15T10:09:17', 2), + ('21', '2006-02-15T10:09:17', 1), + ('21', '2006-02-15T10:09:17', 2), + ('21', '2006-02-15T10:09:17', 2), + ('21', '2006-02-15T10:09:17', 2), + ('21', '2006-02-15T10:09:17', 1), + ('21', '2006-02-15T10:09:17', 2), + ('122', '2006-02-15T10:09:17', 2), + ('122', '2006-02-15T10:09:17', 1), + ('122', '2006-02-15T10:09:17', 1), + ('122', '2006-02-15T10:09:17', 1), + ('122', '2006-02-15T10:09:17', 1), + ('122', '2006-02-15T10:09:17', 2), + ('122', '2006-02-15T10:09:17', 2), + ('163', '2006-02-15T10:09:17', 2), + ('163', '2006-02-15T10:09:17', 2), + ('163', '2006-02-15T10:09:17', 2), + ('709', '2006-02-15T10:09:17', 2), + ('709', '2006-02-15T10:09:17', 1), + ('709', '2006-02-15T10:09:17', 2), + ('709', '2006-02-15T10:09:17', 2), + ('709', '2006-02-15T10:09:17', 2), + ('709', '2006-02-15T10:09:17', 1), + ('847', '2006-02-15T10:09:17', 2), + ('847', '2006-02-15T10:09:17', 2), + ('847', '2006-02-15T10:09:17', 2), + ('847', '2006-02-15T10:09:17', 2), + ('744', '2006-02-15T10:09:17', 1), + ('744', '2006-02-15T10:09:17', 2), + ('744', '2006-02-15T10:09:17', 2), + ('744', '2006-02-15T10:09:17', 2), + ('744', '2006-02-15T10:09:17', 1), + ('710', '2006-02-15T10:09:17', 1), + ('710', '2006-02-15T10:09:17', 2), + ('710', '2006-02-15T10:09:17', 1), + ('710', '2006-02-15T10:09:17', 1), + ('710', '2006-02-15T10:09:17', 1), + ('710', '2006-02-15T10:09:17', 2), + ('866', '2006-02-15T10:09:17', 2), + ('866', '2006-02-15T10:09:17', 2) + ) AS data(old_film_id, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."film"' + AND map0.old_id = data.old_film_id + RETURNING inventory_id + ) + SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; + + FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); + END LOOP; + + v_old_ids_inventory := ARRAY['1254', '1253', '1255', '4426', '4423', '4425', '4424', '4422', '2754', '2756', '2755', '367', '366', '365', '364', '3263', '3262', '4446', '4450', '4449', '4448', '4447', '4445', '3477', '3476', '3475', '3478', '3967', '3963', '3966', '3964', '3968', '3965', '1880', '1875', '1874', '1879', '1876', '1878', '1877', '4216', '4213', '4215', '4214', '4358', '4355', '4354', '4356', '4357', '4353', '4052', '4055', '4053', '4054', '3113', '3109', '3112', '3107', '3114', '3108', '3110', '3111', '3427', '3426', '873', '879', '877', '876', '874', '875', '880', '878', '3546', '3545', '3544', '3547', '3543', '4463', '4464', '4465', '4461', '4462', '3093', '3097', '3092', '3096', '3095', '3094', '920', '921', '916', '919', '918', '917', '252', '251', '248', '250', '249', '464']; + WITH inserted AS ( + INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") + SELECT + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + ('277', '2006-02-15T10:09:17', 1), + ('277', '2006-02-15T10:09:17', 1), + ('277', '2006-02-15T10:09:17', 1), + ('967', '2006-02-15T10:09:17', 2), + ('967', '2006-02-15T10:09:17', 1), + ('967', '2006-02-15T10:09:17', 2), + ('967', '2006-02-15T10:09:17', 1), + ('967', '2006-02-15T10:09:17', 1), + ('604', '2006-02-15T10:09:17', 2), + ('604', '2006-02-15T10:09:17', 2), + ('604', '2006-02-15T10:09:17', 2), + ('80', '2006-02-15T10:09:17', 1), + ('80', '2006-02-15T10:09:17', 1), + ('80', '2006-02-15T10:09:17', 1), + ('80', '2006-02-15T10:09:17', 1), + ('718', '2006-02-15T10:09:17', 2), + ('718', '2006-02-15T10:09:17', 2), + ('972', '2006-02-15T10:09:17', 1), + ('972', '2006-02-15T10:09:17', 2), + ('972', '2006-02-15T10:09:17', 2), + ('972', '2006-02-15T10:09:17', 2), + ('972', '2006-02-15T10:09:17', 1), + ('972', '2006-02-15T10:09:17', 1), + ('762', '2006-02-15T10:09:17', 2), + ('762', '2006-02-15T10:09:17', 2), + ('762', '2006-02-15T10:09:17', 2), + ('762', '2006-02-15T10:09:17', 2), + ('864', '2006-02-15T10:09:17', 2), + ('864', '2006-02-15T10:09:17', 1), + ('864', '2006-02-15T10:09:17', 1), + ('864', '2006-02-15T10:09:17', 1), + ('864', '2006-02-15T10:09:17', 2), + ('864', '2006-02-15T10:09:17', 1), + ('409', '2006-02-15T10:09:17', 2), + ('409', '2006-02-15T10:09:17', 1), + ('409', '2006-02-15T10:09:17', 1), + ('409', '2006-02-15T10:09:17', 2), + ('409', '2006-02-15T10:09:17', 1), + ('409', '2006-02-15T10:09:17', 2), + ('409', '2006-02-15T10:09:17', 1), + ('916', '2006-02-15T10:09:17', 2), + ('916', '2006-02-15T10:09:17', 1), + ('916', '2006-02-15T10:09:17', 2), + ('916', '2006-02-15T10:09:17', 1), + ('949', '2006-02-15T10:09:17', 2), + ('949', '2006-02-15T10:09:17', 1), + ('949', '2006-02-15T10:09:17', 1), + ('949', '2006-02-15T10:09:17', 1), + ('949', '2006-02-15T10:09:17', 2), + ('949', '2006-02-15T10:09:17', 1), + ('882', '2006-02-15T10:09:17', 1), + ('882', '2006-02-15T10:09:17', 1), + ('882', '2006-02-15T10:09:17', 1), + ('882', '2006-02-15T10:09:17', 1), + ('683', '2006-02-15T10:09:17', 2), + ('683', '2006-02-15T10:09:17', 1), + ('683', '2006-02-15T10:09:17', 2), + ('683', '2006-02-15T10:09:17', 1), + ('683', '2006-02-15T10:09:17', 2), + ('683', '2006-02-15T10:09:17', 1), + ('683', '2006-02-15T10:09:17', 1), + ('683', '2006-02-15T10:09:17', 2), + ('751', '2006-02-15T10:09:17', 2), + ('751', '2006-02-15T10:09:17', 2), + ('193', '2006-02-15T10:09:17', 1), + ('193', '2006-02-15T10:09:17', 2), + ('193', '2006-02-15T10:09:17', 2), + ('193', '2006-02-15T10:09:17', 1), + ('193', '2006-02-15T10:09:17', 1), + ('193', '2006-02-15T10:09:17', 1), + ('193', '2006-02-15T10:09:17', 2), + ('193', '2006-02-15T10:09:17', 2), + ('775', '2006-02-15T10:09:17', 2), + ('775', '2006-02-15T10:09:17', 1), + ('775', '2006-02-15T10:09:17', 1), + ('775', '2006-02-15T10:09:17', 2), + ('775', '2006-02-15T10:09:17', 1), + ('975', '2006-02-15T10:09:17', 2), + ('975', '2006-02-15T10:09:17', 2), + ('975', '2006-02-15T10:09:17', 2), + ('975', '2006-02-15T10:09:17', 1), + ('975', '2006-02-15T10:09:17', 1), + ('680', '2006-02-15T10:09:17', 1), + ('680', '2006-02-15T10:09:17', 2), + ('680', '2006-02-15T10:09:17', 1), + ('680', '2006-02-15T10:09:17', 2), + ('680', '2006-02-15T10:09:17', 2), + ('680', '2006-02-15T10:09:17', 2), + ('204', '2006-02-15T10:09:17', 2), + ('204', '2006-02-15T10:09:17', 2), + ('204', '2006-02-15T10:09:17', 1), + ('204', '2006-02-15T10:09:17', 1), + ('204', '2006-02-15T10:09:17', 1), + ('204', '2006-02-15T10:09:17', 1), + ('56', '2006-02-15T10:09:17', 2), + ('56', '2006-02-15T10:09:17', 2), + ('56', '2006-02-15T10:09:17', 1), + ('56', '2006-02-15T10:09:17', 1), + ('56', '2006-02-15T10:09:17', 1), + ('102', '2006-02-15T10:09:17', 2) + ) AS data(old_film_id, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."film"' + AND map0.old_id = data.old_film_id + RETURNING inventory_id + ) + SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; + + FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); + END LOOP; + + v_old_ids_inventory := ARRAY['463', '2712', '2709', '2708', '2707', '2714', '2710', '2713', '2711', '4539', '4542', '4541', '4538', '4540', '2650', '2645', '2649', '2648', '2647', '2646', '456', '453', '451', '455', '452', '454', '2545', '2544', '3294', '3293', '3297', '3292', '3295', '3296', '3448', '3449', '3450', '1562', '1560', '1559', '1561', '2802', '2803', '2801', '2800', '1425', '1427', '1426', '74', '76', '75', '73', '71', '72', '2284', '2285', '2286', '2282', '2281', '2283', '2875', '2873', '2874', '135', '136', '137', '138', '3775', '3777', '3776', '3780', '3778', '3779', '2580', '2579', '1758', '1759', '1760', '1757', '1763', '1764', '1761', '1762', '1036', '1030', '1034', '1032', '1031', '1033', '1035', '1029', '2676', '2675', '2677', '2653', '2652', '2651', '4252', '4251', '4250']; + WITH inserted AS ( + INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") + SELECT + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + ('102', '2006-02-15T10:09:17', 2), + ('595', '2006-02-15T10:09:17', 2), + ('595', '2006-02-15T10:09:17', 1), + ('595', '2006-02-15T10:09:17', 1), + ('595', '2006-02-15T10:09:17', 1), + ('595', '2006-02-15T10:09:17', 2), + ('595', '2006-02-15T10:09:17', 1), + ('595', '2006-02-15T10:09:17', 2), + ('595', '2006-02-15T10:09:17', 2), + ('991', '2006-02-15T10:09:17', 1), + ('991', '2006-02-15T10:09:17', 2), + ('991', '2006-02-15T10:09:17', 2), + ('991', '2006-02-15T10:09:17', 1), + ('991', '2006-02-15T10:09:17', 2), + ('580', '2006-02-15T10:09:17', 2), + ('580', '2006-02-15T10:09:17', 1), + ('580', '2006-02-15T10:09:17', 2), + ('580', '2006-02-15T10:09:17', 1), + ('580', '2006-02-15T10:09:17', 1), + ('580', '2006-02-15T10:09:17', 1), + ('100', '2006-02-15T10:09:17', 2), + ('100', '2006-02-15T10:09:17', 1), + ('100', '2006-02-15T10:09:17', 1), + ('100', '2006-02-15T10:09:17', 2), + ('100', '2006-02-15T10:09:17', 1), + ('100', '2006-02-15T10:09:17', 1), + ('558', '2006-02-15T10:09:17', 2), + ('558', '2006-02-15T10:09:17', 2), + ('725', '2006-02-15T10:09:17', 1), + ('725', '2006-02-15T10:09:17', 1), + ('725', '2006-02-15T10:09:17', 2), + ('725', '2006-02-15T10:09:17', 1), + ('725', '2006-02-15T10:09:17', 2), + ('725', '2006-02-15T10:09:17', 2), + ('756', '2006-02-15T10:09:17', 2), + ('756', '2006-02-15T10:09:17', 2), + ('756', '2006-02-15T10:09:17', 2), + ('342', '2006-02-15T10:09:17', 1), + ('342', '2006-02-15T10:09:17', 1), + ('342', '2006-02-15T10:09:17', 1), + ('342', '2006-02-15T10:09:17', 1), + ('615', '2006-02-15T10:09:17', 2), + ('615', '2006-02-15T10:09:17', 2), + ('615', '2006-02-15T10:09:17', 2), + ('615', '2006-02-15T10:09:17', 2), + ('312', '2006-02-15T10:09:17', 2), + ('312', '2006-02-15T10:09:17', 2), + ('312', '2006-02-15T10:09:17', 2), + ('15', '2006-02-15T10:09:17', 2), + ('15', '2006-02-15T10:09:17', 2), + ('15', '2006-02-15T10:09:17', 2), + ('15', '2006-02-15T10:09:17', 2), + ('15', '2006-02-15T10:09:17', 1), + ('15', '2006-02-15T10:09:17', 1), + ('494', '2006-02-15T10:09:17', 1), + ('494', '2006-02-15T10:09:17', 2), + ('494', '2006-02-15T10:09:17', 2), + ('494', '2006-02-15T10:09:17', 1), + ('494', '2006-02-15T10:09:17', 1), + ('494', '2006-02-15T10:09:17', 1), + ('630', '2006-02-15T10:09:17', 2), + ('630', '2006-02-15T10:09:17', 2), + ('630', '2006-02-15T10:09:17', 2), + ('27', '2006-02-15T10:09:17', 1), + ('27', '2006-02-15T10:09:17', 1), + ('27', '2006-02-15T10:09:17', 1), + ('27', '2006-02-15T10:09:17', 1), + ('827', '2006-02-15T10:09:17', 1), + ('827', '2006-02-15T10:09:17', 2), + ('827', '2006-02-15T10:09:17', 1), + ('827', '2006-02-15T10:09:17', 2), + ('827', '2006-02-15T10:09:17', 2), + ('827', '2006-02-15T10:09:17', 2), + ('565', '2006-02-15T10:09:17', 1), + ('565', '2006-02-15T10:09:17', 1), + ('382', '2006-02-15T10:09:17', 1), + ('382', '2006-02-15T10:09:17', 1), + ('382', '2006-02-15T10:09:17', 1), + ('382', '2006-02-15T10:09:17', 1), + ('382', '2006-02-15T10:09:17', 2), + ('382', '2006-02-15T10:09:17', 2), + ('382', '2006-02-15T10:09:17', 2), + ('382', '2006-02-15T10:09:17', 2), + ('231', '2006-02-15T10:09:17', 2), + ('231', '2006-02-15T10:09:17', 1), + ('231', '2006-02-15T10:09:17', 2), + ('231', '2006-02-15T10:09:17', 1), + ('231', '2006-02-15T10:09:17', 1), + ('231', '2006-02-15T10:09:17', 2), + ('231', '2006-02-15T10:09:17', 2), + ('231', '2006-02-15T10:09:17', 1), + ('587', '2006-02-15T10:09:17', 1), + ('587', '2006-02-15T10:09:17', 1), + ('587', '2006-02-15T10:09:17', 1), + ('581', '2006-02-15T10:09:17', 1), + ('581', '2006-02-15T10:09:17', 1), + ('581', '2006-02-15T10:09:17', 1), + ('924', '2006-02-15T10:09:17', 2), + ('924', '2006-02-15T10:09:17', 2), + ('924', '2006-02-15T10:09:17', 1) + ) AS data(old_film_id, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."film"' + AND map0.old_id = data.old_film_id + RETURNING inventory_id + ) + SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; + + FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); + END LOOP; + + v_old_ids_inventory := ARRAY['4253', '4249', '3266', '3271', '3272', '3269', '3267', '3270', '3268', '1178', '1177', '4343', '4344', '4341', '4342', '3954', '3951', '3952', '3955', '3953', '4144', '4141', '4143', '4142', '3106', '3104', '3105', '3225', '3226', '3223', '3224', '4308', '4304', '4307', '4309', '4305', '4306', '3457', '3456', '3458', '1190', '1189', '1188', '1191', '3117', '3118', '163', '160', '165', '162', '161', '166', '164', '1806', '1804', '1809', '1808', '1805', '1807', '3673', '3674', '3672', '3675', '3678', '3677', '3676', '3727', '3728', '3729', '2620', '2617', '2616', '2618', '2619', '1973', '1974', '1975', '1972', '3273', '3274', '3212', '3216', '3214', '3211', '3213', '3215', '3156', '3157', '3158', '3154', '3155', '180', '174', '178', '175', '177', '179', '176', '885', '886']; + WITH inserted AS ( + INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") + SELECT + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + ('924', '2006-02-15T10:09:17', 2), + ('924', '2006-02-15T10:09:17', 1), + ('720', '2006-02-15T10:09:17', 1), + ('720', '2006-02-15T10:09:17', 2), + ('720', '2006-02-15T10:09:17', 2), + ('720', '2006-02-15T10:09:17', 2), + ('720', '2006-02-15T10:09:17', 1), + ('720', '2006-02-15T10:09:17', 2), + ('720', '2006-02-15T10:09:17', 1), + ('262', '2006-02-15T10:09:17', 2), + ('262', '2006-02-15T10:09:17', 2), + ('946', '2006-02-15T10:09:17', 2), + ('946', '2006-02-15T10:09:17', 2), + ('946', '2006-02-15T10:09:17', 2), + ('946', '2006-02-15T10:09:17', 2), + ('862', '2006-02-15T10:09:17', 2), + ('862', '2006-02-15T10:09:17', 1), + ('862', '2006-02-15T10:09:17', 1), + ('862', '2006-02-15T10:09:17', 2), + ('862', '2006-02-15T10:09:17', 1), + ('900', '2006-02-15T10:09:17', 2), + ('900', '2006-02-15T10:09:17', 1), + ('900', '2006-02-15T10:09:17', 2), + ('900', '2006-02-15T10:09:17', 1), + ('682', '2006-02-15T10:09:17', 1), + ('682', '2006-02-15T10:09:17', 1), + ('682', '2006-02-15T10:09:17', 1), + ('708', '2006-02-15T10:09:17', 2), + ('708', '2006-02-15T10:09:17', 2), + ('708', '2006-02-15T10:09:17', 1), + ('708', '2006-02-15T10:09:17', 1), + ('938', '2006-02-15T10:09:17', 2), + ('938', '2006-02-15T10:09:17', 1), + ('938', '2006-02-15T10:09:17', 1), + ('938', '2006-02-15T10:09:17', 2), + ('938', '2006-02-15T10:09:17', 1), + ('938', '2006-02-15T10:09:17', 1), + ('758', '2006-02-15T10:09:17', 2), + ('758', '2006-02-15T10:09:17', 2), + ('758', '2006-02-15T10:09:17', 2), + ('265', '2006-02-15T10:09:17', 1), + ('265', '2006-02-15T10:09:17', 1), + ('265', '2006-02-15T10:09:17', 1), + ('265', '2006-02-15T10:09:17', 1), + ('685', '2006-02-15T10:09:17', 2), + ('685', '2006-02-15T10:09:17', 2), + ('35', '2006-02-15T10:09:17', 1), + ('35', '2006-02-15T10:09:17', 1), + ('35', '2006-02-15T10:09:17', 2), + ('35', '2006-02-15T10:09:17', 1), + ('35', '2006-02-15T10:09:17', 1), + ('35', '2006-02-15T10:09:17', 2), + ('35', '2006-02-15T10:09:17', 2), + ('392', '2006-02-15T10:09:17', 1), + ('392', '2006-02-15T10:09:17', 1), + ('392', '2006-02-15T10:09:17', 2), + ('392', '2006-02-15T10:09:17', 2), + ('392', '2006-02-15T10:09:17', 1), + ('392', '2006-02-15T10:09:17', 1), + ('804', '2006-02-15T10:09:17', 1), + ('804', '2006-02-15T10:09:17', 1), + ('804', '2006-02-15T10:09:17', 1), + ('804', '2006-02-15T10:09:17', 1), + ('804', '2006-02-15T10:09:17', 2), + ('804', '2006-02-15T10:09:17', 2), + ('804', '2006-02-15T10:09:17', 2), + ('815', '2006-02-15T10:09:17', 1), + ('815', '2006-02-15T10:09:17', 1), + ('815', '2006-02-15T10:09:17', 1), + ('574', '2006-02-15T10:09:17', 2), + ('574', '2006-02-15T10:09:17', 1), + ('574', '2006-02-15T10:09:17', 1), + ('574', '2006-02-15T10:09:17', 2), + ('574', '2006-02-15T10:09:17', 2), + ('430', '2006-02-15T10:09:17', 2), + ('430', '2006-02-15T10:09:17', 2), + ('430', '2006-02-15T10:09:17', 2), + ('430', '2006-02-15T10:09:17', 2), + ('721', '2006-02-15T10:09:17', 1), + ('721', '2006-02-15T10:09:17', 1), + ('706', '2006-02-15T10:09:17', 1), + ('706', '2006-02-15T10:09:17', 2), + ('706', '2006-02-15T10:09:17', 2), + ('706', '2006-02-15T10:09:17', 1), + ('706', '2006-02-15T10:09:17', 2), + ('706', '2006-02-15T10:09:17', 2), + ('693', '2006-02-15T10:09:17', 2), + ('693', '2006-02-15T10:09:17', 2), + ('693', '2006-02-15T10:09:17', 2), + ('693', '2006-02-15T10:09:17', 1), + ('693', '2006-02-15T10:09:17', 1), + ('39', '2006-02-15T10:09:17', 2), + ('39', '2006-02-15T10:09:17', 1), + ('39', '2006-02-15T10:09:17', 2), + ('39', '2006-02-15T10:09:17', 1), + ('39', '2006-02-15T10:09:17', 2), + ('39', '2006-02-15T10:09:17', 2), + ('39', '2006-02-15T10:09:17', 1), + ('196', '2006-02-15T10:09:17', 1), + ('196', '2006-02-15T10:09:17', 1) + ) AS data(old_film_id, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."film"' + AND map0.old_id = data.old_film_id + RETURNING inventory_id + ) + SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; + + FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); + END LOOP; + + v_old_ids_inventory := ARRAY['3919', '3917', '3918', '3916', '822', '819', '820', '821', '1155', '1156', '1154', '1158', '1157', '1153', '2810', '2812', '2811', '2887', '2889', '2888', '2890', '376', '374', '377', '375', '378', '3580', '3581', '3579', '3578', '1252', '1251', '1249', '1250', '1274', '1273', '1272', '1276', '1277', '1275', '3585', '3587', '3586', '3582', '3584', '3583', '1858', '1857', '3131', '3130', '3132', '3133', '2334', '2333', '2332', '2330', '2329', '2331', '3847', '3846', '3845', '3844', '1619', '1614', '1615', '1617', '1618', '1616', '854', '855', '856', '852', '853', '851', '749', '751', '750', '748', '752', '1121', '1123', '1126', '1124', '1122', '1125', '3277', '3275', '3276', '3278', '2814', '2813', '2815', '2816', '3314', '3311', '3313', '3312', '1826', '1832', '1831']; + WITH inserted AS ( + INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") + SELECT + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + ('855', '2006-02-15T10:09:17', 2), + ('855', '2006-02-15T10:09:17', 1), + ('855', '2006-02-15T10:09:17', 2), + ('855', '2006-02-15T10:09:17', 1), + ('179', '2006-02-15T10:09:17', 1), + ('179', '2006-02-15T10:09:17', 1), + ('179', '2006-02-15T10:09:17', 1), + ('179', '2006-02-15T10:09:17', 1), + ('255', '2006-02-15T10:09:17', 1), + ('255', '2006-02-15T10:09:17', 1), + ('255', '2006-02-15T10:09:17', 1), + ('255', '2006-02-15T10:09:17', 2), + ('255', '2006-02-15T10:09:17', 2), + ('255', '2006-02-15T10:09:17', 1), + ('617', '2006-02-15T10:09:17', 1), + ('617', '2006-02-15T10:09:17', 1), + ('617', '2006-02-15T10:09:17', 1), + ('634', '2006-02-15T10:09:17', 2), + ('634', '2006-02-15T10:09:17', 2), + ('634', '2006-02-15T10:09:17', 2), + ('634', '2006-02-15T10:09:17', 2), + ('83', '2006-02-15T10:09:17', 1), + ('83', '2006-02-15T10:09:17', 1), + ('83', '2006-02-15T10:09:17', 2), + ('83', '2006-02-15T10:09:17', 1), + ('83', '2006-02-15T10:09:17', 2), + ('783', '2006-02-15T10:09:17', 1), + ('783', '2006-02-15T10:09:17', 1), + ('783', '2006-02-15T10:09:17', 1), + ('783', '2006-02-15T10:09:17', 1), + ('276', '2006-02-15T10:09:17', 1), + ('276', '2006-02-15T10:09:17', 1), + ('276', '2006-02-15T10:09:17', 1), + ('276', '2006-02-15T10:09:17', 1), + ('282', '2006-02-15T10:09:17', 1), + ('282', '2006-02-15T10:09:17', 1), + ('282', '2006-02-15T10:09:17', 1), + ('282', '2006-02-15T10:09:17', 2), + ('282', '2006-02-15T10:09:17', 2), + ('282', '2006-02-15T10:09:17', 2), + ('784', '2006-02-15T10:09:17', 2), + ('784', '2006-02-15T10:09:17', 2), + ('784', '2006-02-15T10:09:17', 2), + ('784', '2006-02-15T10:09:17', 1), + ('784', '2006-02-15T10:09:17', 1), + ('784', '2006-02-15T10:09:17', 1), + ('405', '2006-02-15T10:09:17', 2), + ('405', '2006-02-15T10:09:17', 2), + ('688', '2006-02-15T10:09:17', 2), + ('688', '2006-02-15T10:09:17', 2), + ('688', '2006-02-15T10:09:17', 2), + ('688', '2006-02-15T10:09:17', 2), + ('506', '2006-02-15T10:09:17', 2), + ('506', '2006-02-15T10:09:17', 2), + ('506', '2006-02-15T10:09:17', 1), + ('506', '2006-02-15T10:09:17', 1), + ('506', '2006-02-15T10:09:17', 1), + ('506', '2006-02-15T10:09:17', 1), + ('842', '2006-02-15T10:09:17', 2), + ('842', '2006-02-15T10:09:17', 2), + ('842', '2006-02-15T10:09:17', 1), + ('842', '2006-02-15T10:09:17', 1), + ('353', '2006-02-15T10:09:17', 2), + ('353', '2006-02-15T10:09:17', 1), + ('353', '2006-02-15T10:09:17', 1), + ('353', '2006-02-15T10:09:17', 2), + ('353', '2006-02-15T10:09:17', 2), + ('353', '2006-02-15T10:09:17', 2), + ('188', '2006-02-15T10:09:17', 1), + ('188', '2006-02-15T10:09:17', 1), + ('188', '2006-02-15T10:09:17', 1), + ('187', '2006-02-15T10:09:17', 2), + ('187', '2006-02-15T10:09:17', 2), + ('187', '2006-02-15T10:09:17', 2), + ('164', '2006-02-15T10:09:17', 1), + ('164', '2006-02-15T10:09:17', 2), + ('164', '2006-02-15T10:09:17', 2), + ('164', '2006-02-15T10:09:17', 1), + ('164', '2006-02-15T10:09:17', 2), + ('249', '2006-02-15T10:09:17', 1), + ('249', '2006-02-15T10:09:17', 2), + ('249', '2006-02-15T10:09:17', 2), + ('249', '2006-02-15T10:09:17', 2), + ('249', '2006-02-15T10:09:17', 1), + ('249', '2006-02-15T10:09:17', 2), + ('722', '2006-02-15T10:09:17', 2), + ('722', '2006-02-15T10:09:17', 1), + ('722', '2006-02-15T10:09:17', 1), + ('722', '2006-02-15T10:09:17', 2), + ('618', '2006-02-15T10:09:17', 2), + ('618', '2006-02-15T10:09:17', 2), + ('618', '2006-02-15T10:09:17', 2), + ('618', '2006-02-15T10:09:17', 2), + ('729', '2006-02-15T10:09:17', 2), + ('729', '2006-02-15T10:09:17', 2), + ('729', '2006-02-15T10:09:17', 2), + ('729', '2006-02-15T10:09:17', 2), + ('397', '2006-02-15T10:09:17', 1), + ('397', '2006-02-15T10:09:17', 2), + ('397', '2006-02-15T10:09:17', 2) + ) AS data(old_film_id, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."film"' + AND map0.old_id = data.old_film_id + RETURNING inventory_id + ) + SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; + + FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); + END LOOP; + + v_old_ids_inventory := ARRAY['1828', '1830', '1827', '1829', '1868', '1871', '1867', '1873', '1869', '1870', '1872', '3948', '3950', '3949', '3945', '3946', '3947', '2627', '2629', '2628', '4279', '4280', '4278', '505', '501', '506', '507', '502', '503', '504', '2289', '2288', '2291', '2287', '2290', '4317', '4322', '4319', '4323', '4321', '4320', '4318', '462', '461', '458', '460', '457', '459', '513', '515', '518', '517', '516', '514', '512', '4381', '4382', '4379', '4383', '4380', '2311', '2314', '2313', '2310', '2312', '2309', '2315', '23', '25', '24', '4522', '4521', '4524', '4523', '3284', '3280', '3285', '3283', '3279', '3282', '3281', '1966', '1967', '1969', '1971', '1968', '1970', '4476', '4475', '4477', '817', '818', '4173', '4171', '4174', '4172', '4415', '4414', '2532', '2536']; + WITH inserted AS ( + INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") + SELECT + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + ('397', '2006-02-15T10:09:17', 1), + ('397', '2006-02-15T10:09:17', 2), + ('397', '2006-02-15T10:09:17', 1), + ('397', '2006-02-15T10:09:17', 2), + ('408', '2006-02-15T10:09:17', 1), + ('408', '2006-02-15T10:09:17', 2), + ('408', '2006-02-15T10:09:17', 1), + ('408', '2006-02-15T10:09:17', 2), + ('408', '2006-02-15T10:09:17', 1), + ('408', '2006-02-15T10:09:17', 1), + ('408', '2006-02-15T10:09:17', 2), + ('861', '2006-02-15T10:09:17', 2), + ('861', '2006-02-15T10:09:17', 2), + ('861', '2006-02-15T10:09:17', 2), + ('861', '2006-02-15T10:09:17', 1), + ('861', '2006-02-15T10:09:17', 1), + ('861', '2006-02-15T10:09:17', 1), + ('576', '2006-02-15T10:09:17', 2), + ('576', '2006-02-15T10:09:17', 2), + ('576', '2006-02-15T10:09:17', 2), + ('931', '2006-02-15T10:09:17', 2), + ('931', '2006-02-15T10:09:17', 2), + ('931', '2006-02-15T10:09:17', 2), + ('112', '2006-02-15T10:09:17', 2), + ('112', '2006-02-15T10:09:17', 1), + ('112', '2006-02-15T10:09:17', 2), + ('112', '2006-02-15T10:09:17', 2), + ('112', '2006-02-15T10:09:17', 1), + ('112', '2006-02-15T10:09:17', 1), + ('112', '2006-02-15T10:09:17', 1), + ('496', '2006-02-15T10:09:17', 2), + ('496', '2006-02-15T10:09:17', 1), + ('496', '2006-02-15T10:09:17', 2), + ('496', '2006-02-15T10:09:17', 1), + ('496', '2006-02-15T10:09:17', 2), + ('941', '2006-02-15T10:09:17', 1), + ('941', '2006-02-15T10:09:17', 2), + ('941', '2006-02-15T10:09:17', 1), + ('941', '2006-02-15T10:09:17', 2), + ('941', '2006-02-15T10:09:17', 2), + ('941', '2006-02-15T10:09:17', 1), + ('941', '2006-02-15T10:09:17', 1), + ('101', '2006-02-15T10:09:17', 2), + ('101', '2006-02-15T10:09:17', 2), + ('101', '2006-02-15T10:09:17', 1), + ('101', '2006-02-15T10:09:17', 1), + ('101', '2006-02-15T10:09:17', 1), + ('101', '2006-02-15T10:09:17', 1), + ('114', '2006-02-15T10:09:17', 1), + ('114', '2006-02-15T10:09:17', 1), + ('114', '2006-02-15T10:09:17', 2), + ('114', '2006-02-15T10:09:17', 2), + ('114', '2006-02-15T10:09:17', 2), + ('114', '2006-02-15T10:09:17', 1), + ('114', '2006-02-15T10:09:17', 1), + ('957', '2006-02-15T10:09:17', 1), + ('957', '2006-02-15T10:09:17', 2), + ('957', '2006-02-15T10:09:17', 1), + ('957', '2006-02-15T10:09:17', 2), + ('957', '2006-02-15T10:09:17', 1), + ('502', '2006-02-15T10:09:17', 1), + ('502', '2006-02-15T10:09:17', 2), + ('502', '2006-02-15T10:09:17', 2), + ('502', '2006-02-15T10:09:17', 1), + ('502', '2006-02-15T10:09:17', 1), + ('502', '2006-02-15T10:09:17', 1), + ('502', '2006-02-15T10:09:17', 2), + ('5', '2006-02-15T10:09:17', 2), + ('5', '2006-02-15T10:09:17', 2), + ('5', '2006-02-15T10:09:17', 2), + ('987', '2006-02-15T10:09:17', 1), + ('987', '2006-02-15T10:09:17', 1), + ('987', '2006-02-15T10:09:17', 2), + ('987', '2006-02-15T10:09:17', 2), + ('723', '2006-02-15T10:09:17', 2), + ('723', '2006-02-15T10:09:17', 1), + ('723', '2006-02-15T10:09:17', 2), + ('723', '2006-02-15T10:09:17', 2), + ('723', '2006-02-15T10:09:17', 1), + ('723', '2006-02-15T10:09:17', 1), + ('723', '2006-02-15T10:09:17', 1), + ('429', '2006-02-15T10:09:17', 1), + ('429', '2006-02-15T10:09:17', 1), + ('429', '2006-02-15T10:09:17', 2), + ('429', '2006-02-15T10:09:17', 2), + ('429', '2006-02-15T10:09:17', 2), + ('429', '2006-02-15T10:09:17', 2), + ('978', '2006-02-15T10:09:17', 1), + ('978', '2006-02-15T10:09:17', 1), + ('978', '2006-02-15T10:09:17', 1), + ('178', '2006-02-15T10:09:17', 1), + ('178', '2006-02-15T10:09:17', 1), + ('907', '2006-02-15T10:09:17', 1), + ('907', '2006-02-15T10:09:17', 1), + ('907', '2006-02-15T10:09:17', 1), + ('907', '2006-02-15T10:09:17', 1), + ('965', '2006-02-15T10:09:17', 1), + ('965', '2006-02-15T10:09:17', 1), + ('556', '2006-02-15T10:09:17', 1), + ('556', '2006-02-15T10:09:17', 2) + ) AS data(old_film_id, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."film"' + AND map0.old_id = data.old_film_id + RETURNING inventory_id + ) + SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; + + FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); + END LOOP; + + v_old_ids_inventory := ARRAY['2533', '2534', '2535', '2538', '2537', '3908', '3902', '3907', '3904', '3903', '3906', '3905', '2735', '2737', '2734', '2736', '4567', '4568', '568', '567', '571', '570', '569', '4201', '4205', '4206', '4203', '4204', '4202', '205', '202', '201', '203', '204', '206', '2808', '2807', '2809', '2804', '2805', '2806', '3070', '3069', '3422', '3421', '3419', '3420', '2388', '2387', '2386', '2385', '2389', '2391', '2390', '1946', '1950', '1947', '1948', '1949', '2895', '2893', '2894', '344', '342', '343', '1859', '1860', '1862', '1863', '1864', '1861', '2758', '2757', '2910', '2911', '2909', '1418', '1419', '1424', '1423', '1420', '1422', '1421', '1366', '1371', '1370', '1365', '1368', '1364', '1369', '1367', '2607', '2610', '2608', '2606', '2611', '2609', '2604', '2605', '684']; + WITH inserted AS ( + INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") + SELECT + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + ('556', '2006-02-15T10:09:17', 1), + ('556', '2006-02-15T10:09:17', 1), + ('556', '2006-02-15T10:09:17', 2), + ('556', '2006-02-15T10:09:17', 2), + ('556', '2006-02-15T10:09:17', 2), + ('852', '2006-02-15T10:09:17', 2), + ('852', '2006-02-15T10:09:17', 1), + ('852', '2006-02-15T10:09:17', 2), + ('852', '2006-02-15T10:09:17', 1), + ('852', '2006-02-15T10:09:17', 1), + ('852', '2006-02-15T10:09:17', 2), + ('852', '2006-02-15T10:09:17', 1), + ('600', '2006-02-15T10:09:17', 1), + ('600', '2006-02-15T10:09:17', 2), + ('600', '2006-02-15T10:09:17', 1), + ('600', '2006-02-15T10:09:17', 2), + ('998', '2006-02-15T10:09:17', 2), + ('998', '2006-02-15T10:09:17', 2), + ('123', '2006-02-15T10:09:17', 1), + ('123', '2006-02-15T10:09:17', 1), + ('123', '2006-02-15T10:09:17', 2), + ('123', '2006-02-15T10:09:17', 2), + ('123', '2006-02-15T10:09:17', 2), + ('914', '2006-02-15T10:09:17', 1), + ('914', '2006-02-15T10:09:17', 2), + ('914', '2006-02-15T10:09:17', 2), + ('914', '2006-02-15T10:09:17', 2), + ('914', '2006-02-15T10:09:17', 2), + ('914', '2006-02-15T10:09:17', 1), + ('45', '2006-02-15T10:09:17', 2), + ('45', '2006-02-15T10:09:17', 1), + ('45', '2006-02-15T10:09:17', 1), + ('45', '2006-02-15T10:09:17', 1), + ('45', '2006-02-15T10:09:17', 1), + ('45', '2006-02-15T10:09:17', 2), + ('616', '2006-02-15T10:09:17', 2), + ('616', '2006-02-15T10:09:17', 2), + ('616', '2006-02-15T10:09:17', 2), + ('616', '2006-02-15T10:09:17', 1), + ('616', '2006-02-15T10:09:17', 1), + ('616', '2006-02-15T10:09:17', 2), + ('675', '2006-02-15T10:09:17', 1), + ('675', '2006-02-15T10:09:17', 1), + ('749', '2006-02-15T10:09:17', 2), + ('749', '2006-02-15T10:09:17', 2), + ('749', '2006-02-15T10:09:17', 1), + ('749', '2006-02-15T10:09:17', 1), + ('521', '2006-02-15T10:09:17', 1), + ('521', '2006-02-15T10:09:17', 1), + ('521', '2006-02-15T10:09:17', 1), + ('521', '2006-02-15T10:09:17', 1), + ('521', '2006-02-15T10:09:17', 2), + ('521', '2006-02-15T10:09:17', 2), + ('521', '2006-02-15T10:09:17', 2), + ('424', '2006-02-15T10:09:17', 1), + ('424', '2006-02-15T10:09:17', 2), + ('424', '2006-02-15T10:09:17', 1), + ('424', '2006-02-15T10:09:17', 1), + ('424', '2006-02-15T10:09:17', 2), + ('636', '2006-02-15T10:09:17', 1), + ('636', '2006-02-15T10:09:17', 1), + ('636', '2006-02-15T10:09:17', 1), + ('76', '2006-02-15T10:09:17', 1), + ('76', '2006-02-15T10:09:17', 1), + ('76', '2006-02-15T10:09:17', 1), + ('406', '2006-02-15T10:09:17', 1), + ('406', '2006-02-15T10:09:17', 1), + ('406', '2006-02-15T10:09:17', 2), + ('406', '2006-02-15T10:09:17', 2), + ('406', '2006-02-15T10:09:17', 2), + ('406', '2006-02-15T10:09:17', 2), + ('605', '2006-02-15T10:09:17', 2), + ('605', '2006-02-15T10:09:17', 2), + ('639', '2006-02-15T10:09:17', 2), + ('639', '2006-02-15T10:09:17', 2), + ('639', '2006-02-15T10:09:17', 2), + ('311', '2006-02-15T10:09:17', 1), + ('311', '2006-02-15T10:09:17', 1), + ('311', '2006-02-15T10:09:17', 2), + ('311', '2006-02-15T10:09:17', 2), + ('311', '2006-02-15T10:09:17', 1), + ('311', '2006-02-15T10:09:17', 2), + ('311', '2006-02-15T10:09:17', 2), + ('301', '2006-02-15T10:09:17', 1), + ('301', '2006-02-15T10:09:17', 2), + ('301', '2006-02-15T10:09:17', 2), + ('301', '2006-02-15T10:09:17', 1), + ('301', '2006-02-15T10:09:17', 2), + ('301', '2006-02-15T10:09:17', 1), + ('301', '2006-02-15T10:09:17', 2), + ('301', '2006-02-15T10:09:17', 1), + ('572', '2006-02-15T10:09:17', 1), + ('572', '2006-02-15T10:09:17', 2), + ('572', '2006-02-15T10:09:17', 2), + ('572', '2006-02-15T10:09:17', 1), + ('572', '2006-02-15T10:09:17', 2), + ('572', '2006-02-15T10:09:17', 2), + ('572', '2006-02-15T10:09:17', 1), + ('572', '2006-02-15T10:09:17', 1), + ('150', '2006-02-15T10:09:17', 1) + ) AS data(old_film_id, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."film"' + AND map0.old_id = data.old_film_id + RETURNING inventory_id + ) + SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; + + FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); + END LOOP; + + v_old_ids_inventory := ARRAY['686', '687', '688', '689', '685', '2993', '2992', '2872', '2870', '2869', '2871', '1008', '1007', '1006', '1010', '1009', '1793', '1792', '1791', '1790', '4256', '4254', '4258', '4255', '4257', '3410', '3406', '3407', '3409', '3408', '346', '349', '350', '347', '345', '348', '3016', '3017', '3015', '3014', '1499', '1497', '1500', '1498', '834', '835', '838', '836', '837', '839', '2118', '2119', '53', '58', '57', '54', '55', '56', '59', '665', '661', '660', '662', '663', '659', '664', '1100', '1099', '1096', '1095', '1098', '1101', '1097', '4384', '4389', '4388', '4387', '4386', '4385', '1685', '1687', '1683', '1686', '1684', '1681', '1682', '1144', '1145', '1147', '1143', '1142', '1146', '2047', '2049', '2050', '2048', '2051', '2052', '496', '493']; + WITH inserted AS ( + INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") + SELECT + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + ('150', '2006-02-15T10:09:17', 2), + ('150', '2006-02-15T10:09:17', 2), + ('150', '2006-02-15T10:09:17', 2), + ('150', '2006-02-15T10:09:17', 2), + ('150', '2006-02-15T10:09:17', 1), + ('656', '2006-02-15T10:09:17', 2), + ('656', '2006-02-15T10:09:17', 2), + ('629', '2006-02-15T10:09:17', 2), + ('629', '2006-02-15T10:09:17', 2), + ('629', '2006-02-15T10:09:17', 2), + ('629', '2006-02-15T10:09:17', 2), + ('226', '2006-02-15T10:09:17', 2), + ('226', '2006-02-15T10:09:17', 1), + ('226', '2006-02-15T10:09:17', 1), + ('226', '2006-02-15T10:09:17', 2), + ('226', '2006-02-15T10:09:17', 2), + ('389', '2006-02-15T10:09:17', 2), + ('389', '2006-02-15T10:09:17', 2), + ('389', '2006-02-15T10:09:17', 1), + ('389', '2006-02-15T10:09:17', 1), + ('925', '2006-02-15T10:09:17', 1), + ('925', '2006-02-15T10:09:17', 1), + ('925', '2006-02-15T10:09:17', 2), + ('925', '2006-02-15T10:09:17', 1), + ('925', '2006-02-15T10:09:17', 2), + ('747', '2006-02-15T10:09:17', 2), + ('747', '2006-02-15T10:09:17', 1), + ('747', '2006-02-15T10:09:17', 1), + ('747', '2006-02-15T10:09:17', 2), + ('747', '2006-02-15T10:09:17', 2), + ('77', '2006-02-15T10:09:17', 1), + ('77', '2006-02-15T10:09:17', 2), + ('77', '2006-02-15T10:09:17', 2), + ('77', '2006-02-15T10:09:17', 1), + ('77', '2006-02-15T10:09:17', 1), + ('77', '2006-02-15T10:09:17', 1), + ('662', '2006-02-15T10:09:17', 2), + ('662', '2006-02-15T10:09:17', 2), + ('662', '2006-02-15T10:09:17', 1), + ('662', '2006-02-15T10:09:17', 1), + ('328', '2006-02-15T10:09:17', 2), + ('328', '2006-02-15T10:09:17', 2), + ('328', '2006-02-15T10:09:17', 2), + ('328', '2006-02-15T10:09:17', 2), + ('183', '2006-02-15T10:09:17', 1), + ('183', '2006-02-15T10:09:17', 1), + ('183', '2006-02-15T10:09:17', 2), + ('183', '2006-02-15T10:09:17', 1), + ('183', '2006-02-15T10:09:17', 2), + ('183', '2006-02-15T10:09:17', 2), + ('459', '2006-02-15T10:09:17', 2), + ('459', '2006-02-15T10:09:17', 2), + ('11', '2006-02-15T10:09:17', 1), + ('11', '2006-02-15T10:09:17', 2), + ('11', '2006-02-15T10:09:17', 2), + ('11', '2006-02-15T10:09:17', 1), + ('11', '2006-02-15T10:09:17', 1), + ('11', '2006-02-15T10:09:17', 1), + ('11', '2006-02-15T10:09:17', 2), + ('143', '2006-02-15T10:09:17', 2), + ('143', '2006-02-15T10:09:17', 1), + ('143', '2006-02-15T10:09:17', 1), + ('143', '2006-02-15T10:09:17', 1), + ('143', '2006-02-15T10:09:17', 2), + ('143', '2006-02-15T10:09:17', 1), + ('143', '2006-02-15T10:09:17', 2), + ('244', '2006-02-15T10:09:17', 2), + ('244', '2006-02-15T10:09:17', 2), + ('244', '2006-02-15T10:09:17', 1), + ('244', '2006-02-15T10:09:17', 1), + ('244', '2006-02-15T10:09:17', 1), + ('244', '2006-02-15T10:09:17', 2), + ('244', '2006-02-15T10:09:17', 1), + ('958', '2006-02-15T10:09:17', 1), + ('958', '2006-02-15T10:09:17', 2), + ('958', '2006-02-15T10:09:17', 2), + ('958', '2006-02-15T10:09:17', 2), + ('958', '2006-02-15T10:09:17', 1), + ('958', '2006-02-15T10:09:17', 1), + ('367', '2006-02-15T10:09:17', 2), + ('367', '2006-02-15T10:09:17', 2), + ('367', '2006-02-15T10:09:17', 1), + ('367', '2006-02-15T10:09:17', 2), + ('367', '2006-02-15T10:09:17', 1), + ('367', '2006-02-15T10:09:17', 1), + ('367', '2006-02-15T10:09:17', 1), + ('253', '2006-02-15T10:09:17', 1), + ('253', '2006-02-15T10:09:17', 1), + ('253', '2006-02-15T10:09:17', 2), + ('253', '2006-02-15T10:09:17', 1), + ('253', '2006-02-15T10:09:17', 1), + ('253', '2006-02-15T10:09:17', 2), + ('445', '2006-02-15T10:09:17', 1), + ('445', '2006-02-15T10:09:17', 1), + ('445', '2006-02-15T10:09:17', 2), + ('445', '2006-02-15T10:09:17', 1), + ('445', '2006-02-15T10:09:17', 2), + ('445', '2006-02-15T10:09:17', 2), + ('110', '2006-02-15T10:09:17', 1), + ('110', '2006-02-15T10:09:17', 1) + ) AS data(old_film_id, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."film"' + AND map0.old_id = data.old_film_id + RETURNING inventory_id + ) + SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; + + FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); + END LOOP; + + v_old_ids_inventory := ARRAY['494', '495', '762', '760', '759', '763', '758', '761', '882', '884', '881', '883', '1729', '1733', '1734', '1731', '1732', '1730', '3690', '3691', '3692', '3689', '3693', '338', '335', '337', '334', '336', '1892', '1888', '1894', '1891', '1895', '1893', '1889', '1890', '1943', '1942', '1945', '1944', '3038', '3039', '3037', '3036', '3035', '363', '362', '360', '358', '361', '359', '703', '707', '706', '705', '708', '704', '702', '4162', '4161', '1818', '1816', '1820', '1819', '1821', '1817', '2427', '2428', '2429', '264', '266', '267', '268', '265', '3149', '3148', '3150', '3146', '3147', '1449', '1451', '1445', '1446', '1447', '1450', '1448', '2719', '2716', '2720', '2717', '2715', '2718', '1585', '1587', '1586', '1588', '269', '271', '270', '2216']; + WITH inserted AS ( + INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") + SELECT + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + ('110', '2006-02-15T10:09:17', 1), + ('110', '2006-02-15T10:09:17', 1), + ('166', '2006-02-15T10:09:17', 2), + ('166', '2006-02-15T10:09:17', 1), + ('166', '2006-02-15T10:09:17', 1), + ('166', '2006-02-15T10:09:17', 2), + ('166', '2006-02-15T10:09:17', 1), + ('166', '2006-02-15T10:09:17', 1), + ('194', '2006-02-15T10:09:17', 1), + ('194', '2006-02-15T10:09:17', 2), + ('194', '2006-02-15T10:09:17', 1), + ('194', '2006-02-15T10:09:17', 2), + ('377', '2006-02-15T10:09:17', 1), + ('377', '2006-02-15T10:09:17', 2), + ('377', '2006-02-15T10:09:17', 2), + ('377', '2006-02-15T10:09:17', 1), + ('377', '2006-02-15T10:09:17', 2), + ('377', '2006-02-15T10:09:17', 1), + ('807', '2006-02-15T10:09:17', 1), + ('807', '2006-02-15T10:09:17', 1), + ('807', '2006-02-15T10:09:17', 2), + ('807', '2006-02-15T10:09:17', 1), + ('807', '2006-02-15T10:09:17', 2), + ('74', '2006-02-15T10:09:17', 2), + ('74', '2006-02-15T10:09:17', 1), + ('74', '2006-02-15T10:09:17', 2), + ('74', '2006-02-15T10:09:17', 1), + ('74', '2006-02-15T10:09:17', 1), + ('412', '2006-02-15T10:09:17', 2), + ('412', '2006-02-15T10:09:17', 1), + ('412', '2006-02-15T10:09:17', 2), + ('412', '2006-02-15T10:09:17', 1), + ('412', '2006-02-15T10:09:17', 2), + ('412', '2006-02-15T10:09:17', 2), + ('412', '2006-02-15T10:09:17', 1), + ('412', '2006-02-15T10:09:17', 1), + ('423', '2006-02-15T10:09:17', 1), + ('423', '2006-02-15T10:09:17', 1), + ('423', '2006-02-15T10:09:17', 2), + ('423', '2006-02-15T10:09:17', 2), + ('666', '2006-02-15T10:09:17', 2), + ('666', '2006-02-15T10:09:17', 2), + ('666', '2006-02-15T10:09:17', 1), + ('666', '2006-02-15T10:09:17', 1), + ('666', '2006-02-15T10:09:17', 1), + ('79', '2006-02-15T10:09:17', 2), + ('79', '2006-02-15T10:09:17', 2), + ('79', '2006-02-15T10:09:17', 1), + ('79', '2006-02-15T10:09:17', 1), + ('79', '2006-02-15T10:09:17', 2), + ('79', '2006-02-15T10:09:17', 1), + ('154', '2006-02-15T10:09:17', 1), + ('154', '2006-02-15T10:09:17', 2), + ('154', '2006-02-15T10:09:17', 2), + ('154', '2006-02-15T10:09:17', 2), + ('154', '2006-02-15T10:09:17', 2), + ('154', '2006-02-15T10:09:17', 1), + ('154', '2006-02-15T10:09:17', 1), + ('904', '2006-02-15T10:09:17', 1), + ('904', '2006-02-15T10:09:17', 1), + ('395', '2006-02-15T10:09:17', 1), + ('395', '2006-02-15T10:09:17', 1), + ('395', '2006-02-15T10:09:17', 2), + ('395', '2006-02-15T10:09:17', 2), + ('395', '2006-02-15T10:09:17', 2), + ('395', '2006-02-15T10:09:17', 1), + ('530', '2006-02-15T10:09:17', 1), + ('530', '2006-02-15T10:09:17', 1), + ('530', '2006-02-15T10:09:17', 1), + ('59', '2006-02-15T10:09:17', 1), + ('59', '2006-02-15T10:09:17', 1), + ('59', '2006-02-15T10:09:17', 2), + ('59', '2006-02-15T10:09:17', 2), + ('59', '2006-02-15T10:09:17', 1), + ('691', '2006-02-15T10:09:17', 2), + ('691', '2006-02-15T10:09:17', 1), + ('691', '2006-02-15T10:09:17', 2), + ('691', '2006-02-15T10:09:17', 1), + ('691', '2006-02-15T10:09:17', 1), + ('317', '2006-02-15T10:09:17', 2), + ('317', '2006-02-15T10:09:17', 2), + ('317', '2006-02-15T10:09:17', 1), + ('317', '2006-02-15T10:09:17', 1), + ('317', '2006-02-15T10:09:17', 1), + ('317', '2006-02-15T10:09:17', 2), + ('317', '2006-02-15T10:09:17', 1), + ('596', '2006-02-15T10:09:17', 2), + ('596', '2006-02-15T10:09:17', 1), + ('596', '2006-02-15T10:09:17', 2), + ('596', '2006-02-15T10:09:17', 2), + ('596', '2006-02-15T10:09:17', 1), + ('596', '2006-02-15T10:09:17', 2), + ('348', '2006-02-15T10:09:17', 2), + ('348', '2006-02-15T10:09:17', 2), + ('348', '2006-02-15T10:09:17', 2), + ('348', '2006-02-15T10:09:17', 2), + ('60', '2006-02-15T10:09:17', 1), + ('60', '2006-02-15T10:09:17', 1), + ('60', '2006-02-15T10:09:17', 1), + ('479', '2006-02-15T10:09:17', 2) + ) AS data(old_film_id, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."film"' + AND map0.old_id = data.old_film_id + RETURNING inventory_id + ) + SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; + + FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); + END LOOP; + + v_old_ids_inventory := ARRAY['2217', '2213', '2215', '2214', '4175', '4176', '4178', '4177', '1532', '1533', '3541', '3539', '3542', '3540', '3828', '3830', '3826', '3829', '3827', '3825', '1334', '1331', '1330', '1332', '1333', '3605', '3606', '3604', '3607', '4043', '4040', '4042', '4047', '4045', '4044', '4046', '4041', '4160', '4159', '3191', '3189', '3190', '3264', '3265', '698', '699', '700', '701', '197', '199', '198', '196', '200', '4241', '4239', '4242', '4244', '4243', '4240', '4245', '3405', '3404', '3403', '3401', '3402', '3253', '3256', '3255', '3257', '3254', '3245', '3244', '3243', '1592', '1594', '1589', '1595', '1591', '1590', '1593', '235', '236', '2913', '2912', '2914', '184', '182', '181', '183', '1102', '1103', '1107', '1106', '1105', '1108', '1104', '1376', '1377', '1372', '1373']; + WITH inserted AS ( + INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") + SELECT + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + ('479', '2006-02-15T10:09:17', 2), + ('479', '2006-02-15T10:09:17', 1), + ('479', '2006-02-15T10:09:17', 2), + ('479', '2006-02-15T10:09:17', 1), + ('908', '2006-02-15T10:09:17', 1), + ('908', '2006-02-15T10:09:17', 1), + ('908', '2006-02-15T10:09:17', 2), + ('908', '2006-02-15T10:09:17', 2), + ('335', '2006-02-15T10:09:17', 1), + ('335', '2006-02-15T10:09:17', 1), + ('774', '2006-02-15T10:09:17', 1), + ('774', '2006-02-15T10:09:17', 1), + ('774', '2006-02-15T10:09:17', 1), + ('774', '2006-02-15T10:09:17', 1), + ('838', '2006-02-15T10:09:17', 2), + ('838', '2006-02-15T10:09:17', 2), + ('838', '2006-02-15T10:09:17', 1), + ('838', '2006-02-15T10:09:17', 2), + ('838', '2006-02-15T10:09:17', 2), + ('838', '2006-02-15T10:09:17', 1), + ('294', '2006-02-15T10:09:17', 2), + ('294', '2006-02-15T10:09:17', 1), + ('294', '2006-02-15T10:09:17', 1), + ('294', '2006-02-15T10:09:17', 2), + ('294', '2006-02-15T10:09:17', 2), + ('788', '2006-02-15T10:09:17', 1), + ('788', '2006-02-15T10:09:17', 2), + ('788', '2006-02-15T10:09:17', 1), + ('788', '2006-02-15T10:09:17', 2), + ('880', '2006-02-15T10:09:17', 1), + ('880', '2006-02-15T10:09:17', 1), + ('880', '2006-02-15T10:09:17', 1), + ('880', '2006-02-15T10:09:17', 2), + ('880', '2006-02-15T10:09:17', 2), + ('880', '2006-02-15T10:09:17', 2), + ('880', '2006-02-15T10:09:17', 2), + ('880', '2006-02-15T10:09:17', 1), + ('903', '2006-02-15T10:09:17', 2), + ('903', '2006-02-15T10:09:17', 2), + ('700', '2006-02-15T10:09:17', 2), + ('700', '2006-02-15T10:09:17', 2), + ('700', '2006-02-15T10:09:17', 2), + ('719', '2006-02-15T10:09:17', 1), + ('719', '2006-02-15T10:09:17', 1), + ('153', '2006-02-15T10:09:17', 1), + ('153', '2006-02-15T10:09:17', 1), + ('153', '2006-02-15T10:09:17', 1), + ('153', '2006-02-15T10:09:17', 1), + ('44', '2006-02-15T10:09:17', 1), + ('44', '2006-02-15T10:09:17', 2), + ('44', '2006-02-15T10:09:17', 2), + ('44', '2006-02-15T10:09:17', 1), + ('44', '2006-02-15T10:09:17', 2), + ('922', '2006-02-15T10:09:17', 1), + ('922', '2006-02-15T10:09:17', 1), + ('922', '2006-02-15T10:09:17', 2), + ('922', '2006-02-15T10:09:17', 2), + ('922', '2006-02-15T10:09:17', 2), + ('922', '2006-02-15T10:09:17', 1), + ('922', '2006-02-15T10:09:17', 2), + ('746', '2006-02-15T10:09:17', 2), + ('746', '2006-02-15T10:09:17', 2), + ('746', '2006-02-15T10:09:17', 2), + ('746', '2006-02-15T10:09:17', 1), + ('746', '2006-02-15T10:09:17', 1), + ('716', '2006-02-15T10:09:17', 1), + ('716', '2006-02-15T10:09:17', 2), + ('716', '2006-02-15T10:09:17', 2), + ('716', '2006-02-15T10:09:17', 2), + ('716', '2006-02-15T10:09:17', 1), + ('714', '2006-02-15T10:09:17', 2), + ('714', '2006-02-15T10:09:17', 2), + ('714', '2006-02-15T10:09:17', 2), + ('349', '2006-02-15T10:09:17', 1), + ('349', '2006-02-15T10:09:17', 2), + ('349', '2006-02-15T10:09:17', 1), + ('349', '2006-02-15T10:09:17', 2), + ('349', '2006-02-15T10:09:17', 1), + ('349', '2006-02-15T10:09:17', 1), + ('349', '2006-02-15T10:09:17', 2), + ('53', '2006-02-15T10:09:17', 1), + ('53', '2006-02-15T10:09:17', 1), + ('640', '2006-02-15T10:09:17', 2), + ('640', '2006-02-15T10:09:17', 2), + ('640', '2006-02-15T10:09:17', 2), + ('40', '2006-02-15T10:09:17', 2), + ('40', '2006-02-15T10:09:17', 2), + ('40', '2006-02-15T10:09:17', 2), + ('40', '2006-02-15T10:09:17', 2), + ('245', '2006-02-15T10:09:17', 1), + ('245', '2006-02-15T10:09:17', 1), + ('245', '2006-02-15T10:09:17', 2), + ('245', '2006-02-15T10:09:17', 2), + ('245', '2006-02-15T10:09:17', 2), + ('245', '2006-02-15T10:09:17', 2), + ('245', '2006-02-15T10:09:17', 1), + ('302', '2006-02-15T10:09:17', 2), + ('302', '2006-02-15T10:09:17', 2), + ('302', '2006-02-15T10:09:17', 1), + ('302', '2006-02-15T10:09:17', 1) + ) AS data(old_film_id, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."film"' + AND map0.old_id = data.old_film_id + RETURNING inventory_id + ) + SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; + + FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); + END LOOP; + + v_old_ids_inventory := ARRAY['1374', '1375', '473', '474', '475', '2279', '2278', '2280', '912', '915', '914', '913', '3064', '3065', '3063', '3062', '3823', '3824', '3822', '3621', '3622', '3617', '3616', '3620', '3618', '3619', '1207', '1206', '690', '693', '692', '691', '4262', '4264', '4261', '4263', '4420', '4418', '4416', '4421', '4417', '4419', '2978', '2977', '2976', '2979', '648', '647', '646', '644', '645', '3484', '3488', '3489', '3491', '3486', '3487', '3485', '3490', '1014', '1012', '1013', '1015', '1011', '1', '4', '8', '5', '2', '6', '7', '3', '910', '909', '911', '2630', '2632', '2631', '4504', '4503', '4505', '2007', '2010', '2008', '2009', '2006', '2011', '291', '293', '292', '2174', '2175', '2173', '3896', '3898', '3901', '3897', '3899', '3900', '2151']; + WITH inserted AS ( + INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") + SELECT + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + ('302', '2006-02-15T10:09:17', 2), + ('302', '2006-02-15T10:09:17', 2), + ('104', '2006-02-15T10:09:17', 2), + ('104', '2006-02-15T10:09:17', 2), + ('104', '2006-02-15T10:09:17', 2), + ('493', '2006-02-15T10:09:17', 2), + ('493', '2006-02-15T10:09:17', 2), + ('493', '2006-02-15T10:09:17', 2), + ('203', '2006-02-15T10:09:17', 2), + ('203', '2006-02-15T10:09:17', 2), + ('203', '2006-02-15T10:09:17', 2), + ('203', '2006-02-15T10:09:17', 2), + ('673', '2006-02-15T10:09:17', 2), + ('673', '2006-02-15T10:09:17', 2), + ('673', '2006-02-15T10:09:17', 1), + ('673', '2006-02-15T10:09:17', 1), + ('837', '2006-02-15T10:09:17', 2), + ('837', '2006-02-15T10:09:17', 2), + ('837', '2006-02-15T10:09:17', 2), + ('790', '2006-02-15T10:09:17', 2), + ('790', '2006-02-15T10:09:17', 2), + ('790', '2006-02-15T10:09:17', 1), + ('790', '2006-02-15T10:09:17', 1), + ('790', '2006-02-15T10:09:17', 2), + ('790', '2006-02-15T10:09:17', 1), + ('790', '2006-02-15T10:09:17', 1), + ('268', '2006-02-15T10:09:17', 2), + ('268', '2006-02-15T10:09:17', 2), + ('151', '2006-02-15T10:09:17', 1), + ('151', '2006-02-15T10:09:17', 2), + ('151', '2006-02-15T10:09:17', 2), + ('151', '2006-02-15T10:09:17', 1), + ('927', '2006-02-15T10:09:17', 1), + ('927', '2006-02-15T10:09:17', 1), + ('927', '2006-02-15T10:09:17', 1), + ('927', '2006-02-15T10:09:17', 1), + ('966', '2006-02-15T10:09:17', 2), + ('966', '2006-02-15T10:09:17', 2), + ('966', '2006-02-15T10:09:17', 1), + ('966', '2006-02-15T10:09:17', 2), + ('966', '2006-02-15T10:09:17', 1), + ('966', '2006-02-15T10:09:17', 2), + ('652', '2006-02-15T10:09:17', 1), + ('652', '2006-02-15T10:09:17', 1), + ('652', '2006-02-15T10:09:17', 1), + ('652', '2006-02-15T10:09:17', 1), + ('140', '2006-02-15T10:09:17', 2), + ('140', '2006-02-15T10:09:17', 2), + ('140', '2006-02-15T10:09:17', 2), + ('140', '2006-02-15T10:09:17', 1), + ('140', '2006-02-15T10:09:17', 1), + ('764', '2006-02-15T10:09:17', 1), + ('764', '2006-02-15T10:09:17', 2), + ('764', '2006-02-15T10:09:17', 2), + ('764', '2006-02-15T10:09:17', 2), + ('764', '2006-02-15T10:09:17', 1), + ('764', '2006-02-15T10:09:17', 1), + ('764', '2006-02-15T10:09:17', 1), + ('764', '2006-02-15T10:09:17', 2), + ('227', '2006-02-15T10:09:17', 2), + ('227', '2006-02-15T10:09:17', 1), + ('227', '2006-02-15T10:09:17', 1), + ('227', '2006-02-15T10:09:17', 2), + ('227', '2006-02-15T10:09:17', 1), + ('1', '2006-02-15T10:09:17', 1), + ('1', '2006-02-15T10:09:17', 1), + ('1', '2006-02-15T10:09:17', 2), + ('1', '2006-02-15T10:09:17', 2), + ('1', '2006-02-15T10:09:17', 1), + ('1', '2006-02-15T10:09:17', 2), + ('1', '2006-02-15T10:09:17', 2), + ('1', '2006-02-15T10:09:17', 1), + ('202', '2006-02-15T10:09:17', 1), + ('202', '2006-02-15T10:09:17', 1), + ('202', '2006-02-15T10:09:17', 1), + ('577', '2006-02-15T10:09:17', 1), + ('577', '2006-02-15T10:09:17', 1), + ('577', '2006-02-15T10:09:17', 1), + ('983', '2006-02-15T10:09:17', 1), + ('983', '2006-02-15T10:09:17', 1), + ('983', '2006-02-15T10:09:17', 1), + ('437', '2006-02-15T10:09:17', 1), + ('437', '2006-02-15T10:09:17', 2), + ('437', '2006-02-15T10:09:17', 2), + ('437', '2006-02-15T10:09:17', 2), + ('437', '2006-02-15T10:09:17', 1), + ('437', '2006-02-15T10:09:17', 2), + ('66', '2006-02-15T10:09:17', 1), + ('66', '2006-02-15T10:09:17', 1), + ('66', '2006-02-15T10:09:17', 1), + ('469', '2006-02-15T10:09:17', 2), + ('469', '2006-02-15T10:09:17', 2), + ('469', '2006-02-15T10:09:17', 2), + ('851', '2006-02-15T10:09:17', 1), + ('851', '2006-02-15T10:09:17', 1), + ('851', '2006-02-15T10:09:17', 2), + ('851', '2006-02-15T10:09:17', 1), + ('851', '2006-02-15T10:09:17', 2), + ('851', '2006-02-15T10:09:17', 2), + ('465', '2006-02-15T10:09:17', 1) + ) AS data(old_film_id, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."film"' + AND map0.old_id = data.old_film_id + RETURNING inventory_id + ) + SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; + + FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); + END LOOP; + + v_old_ids_inventory := ARRAY['2152', '2154', '2153', '2155', '1340', '1335', '1336', '1342', '1337', '1341', '1339', '1338', '2265', '2260', '2267', '2264', '2263', '2261', '2266', '2262', '1170', '1169', '681', '683', '679', '682', '680', '678', '2367', '2366', '1841', '1842', '2376', '2377', '2374', '2378', '2373', '2375', '2561', '2560', '2559', '2562', '2746', '2744', '2745', '2743', '2747', '1292', '1289', '1294', '1288', '1290', '1293', '1291', '139', '140', '141', '3707', '3708', '3709', '3198', '3199', '3195', '3193', '3197', '3194', '3192', '3196', '3463', '3461', '3462', '3460', '3464', '3459', '3161', '3163', '3159', '3162', '3160', '3164', '1567', '1569', '1568', '1566', '1565', '1196', '1195', '1193', '1197', '1194', '1198', '1192', '1199', '2269', '2268', '2026', '2023', '2025', '2024', '4057']; + WITH inserted AS ( + INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") + SELECT + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + ('465', '2006-02-15T10:09:17', 1), + ('465', '2006-02-15T10:09:17', 2), + ('465', '2006-02-15T10:09:17', 2), + ('465', '2006-02-15T10:09:17', 2), + ('295', '2006-02-15T10:09:17', 2), + ('295', '2006-02-15T10:09:17', 1), + ('295', '2006-02-15T10:09:17', 1), + ('295', '2006-02-15T10:09:17', 2), + ('295', '2006-02-15T10:09:17', 1), + ('295', '2006-02-15T10:09:17', 2), + ('295', '2006-02-15T10:09:17', 2), + ('295', '2006-02-15T10:09:17', 1), + ('489', '2006-02-15T10:09:17', 2), + ('489', '2006-02-15T10:09:17', 1), + ('489', '2006-02-15T10:09:17', 2), + ('489', '2006-02-15T10:09:17', 2), + ('489', '2006-02-15T10:09:17', 1), + ('489', '2006-02-15T10:09:17', 1), + ('489', '2006-02-15T10:09:17', 2), + ('489', '2006-02-15T10:09:17', 1), + ('259', '2006-02-15T10:09:17', 1), + ('259', '2006-02-15T10:09:17', 1), + ('149', '2006-02-15T10:09:17', 2), + ('149', '2006-02-15T10:09:17', 2), + ('149', '2006-02-15T10:09:17', 1), + ('149', '2006-02-15T10:09:17', 2), + ('149', '2006-02-15T10:09:17', 1), + ('149', '2006-02-15T10:09:17', 1), + ('515', '2006-02-15T10:09:17', 2), + ('515', '2006-02-15T10:09:17', 2), + ('401', '2006-02-15T10:09:17', 1), + ('401', '2006-02-15T10:09:17', 1), + ('518', '2006-02-15T10:09:17', 2), + ('518', '2006-02-15T10:09:17', 2), + ('518', '2006-02-15T10:09:17', 1), + ('518', '2006-02-15T10:09:17', 2), + ('518', '2006-02-15T10:09:17', 1), + ('518', '2006-02-15T10:09:17', 2), + ('561', '2006-02-15T10:09:17', 1), + ('561', '2006-02-15T10:09:17', 1), + ('561', '2006-02-15T10:09:17', 1), + ('561', '2006-02-15T10:09:17', 1), + ('602', '2006-02-15T10:09:17', 2), + ('602', '2006-02-15T10:09:17', 1), + ('602', '2006-02-15T10:09:17', 2), + ('602', '2006-02-15T10:09:17', 1), + ('602', '2006-02-15T10:09:17', 2), + ('285', '2006-02-15T10:09:17', 2), + ('285', '2006-02-15T10:09:17', 1), + ('285', '2006-02-15T10:09:17', 2), + ('285', '2006-02-15T10:09:17', 1), + ('285', '2006-02-15T10:09:17', 1), + ('285', '2006-02-15T10:09:17', 2), + ('285', '2006-02-15T10:09:17', 2), + ('28', '2006-02-15T10:09:17', 1), + ('28', '2006-02-15T10:09:17', 1), + ('28', '2006-02-15T10:09:17', 1), + ('811', '2006-02-15T10:09:17', 1), + ('811', '2006-02-15T10:09:17', 1), + ('811', '2006-02-15T10:09:17', 1), + ('702', '2006-02-15T10:09:17', 2), + ('702', '2006-02-15T10:09:17', 2), + ('702', '2006-02-15T10:09:17', 1), + ('702', '2006-02-15T10:09:17', 1), + ('702', '2006-02-15T10:09:17', 2), + ('702', '2006-02-15T10:09:17', 1), + ('702', '2006-02-15T10:09:17', 1), + ('702', '2006-02-15T10:09:17', 2), + ('759', '2006-02-15T10:09:17', 2), + ('759', '2006-02-15T10:09:17', 2), + ('759', '2006-02-15T10:09:17', 2), + ('759', '2006-02-15T10:09:17', 1), + ('759', '2006-02-15T10:09:17', 2), + ('759', '2006-02-15T10:09:17', 1), + ('694', '2006-02-15T10:09:17', 1), + ('694', '2006-02-15T10:09:17', 2), + ('694', '2006-02-15T10:09:17', 1), + ('694', '2006-02-15T10:09:17', 1), + ('694', '2006-02-15T10:09:17', 1), + ('694', '2006-02-15T10:09:17', 2), + ('344', '2006-02-15T10:09:17', 1), + ('344', '2006-02-15T10:09:17', 2), + ('344', '2006-02-15T10:09:17', 2), + ('344', '2006-02-15T10:09:17', 1), + ('344', '2006-02-15T10:09:17', 1), + ('266', '2006-02-15T10:09:17', 2), + ('266', '2006-02-15T10:09:17', 1), + ('266', '2006-02-15T10:09:17', 1), + ('266', '2006-02-15T10:09:17', 2), + ('266', '2006-02-15T10:09:17', 1), + ('266', '2006-02-15T10:09:17', 2), + ('266', '2006-02-15T10:09:17', 1), + ('266', '2006-02-15T10:09:17', 2), + ('490', '2006-02-15T10:09:17', 1), + ('490', '2006-02-15T10:09:17', 1), + ('440', '2006-02-15T10:09:17', 2), + ('440', '2006-02-15T10:09:17', 1), + ('440', '2006-02-15T10:09:17', 2), + ('440', '2006-02-15T10:09:17', 1), + ('883', '2006-02-15T10:09:17', 2) + ) AS data(old_film_id, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."film"' + AND map0.old_id = data.old_film_id + RETURNING inventory_id + ) + SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; + + FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); + END LOOP; + + v_old_ids_inventory := ARRAY['4056', '1302', '1303', '1300', '1301', '4371', '4373', '4370', '4374', '4372', '4369', '1767', '1769', '1766', '1765', '1768', '3260', '3259', '3261', '3258', '1495', '1496', '1491', '1493', '1492', '1494', '1066', '1065', '4441', '4444', '4442', '4443', '1797', '1799', '1798', '1800', '1801', '1803', '1802', '1180', '1179', '1184', '1183', '1185', '1182', '1181', '253', '259', '258', '256', '257', '255', '254', '3589', '3590', '3593', '3592', '3588', '3591', '599', '597', '594', '595', '598', '596', '3423', '3425', '3424', '209', '207', '208', '1721', '1720', '2496', '2497', '4186', '4188', '4183', '4184', '4185', '4181', '4187', '4182', '2584', '2585', '2583', '2586', '2863', '2861', '2862', '2230', '2228', '2229', '2204', '2202', '2199', '2200', '2198', '2201', '2203']; + WITH inserted AS ( + INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") + SELECT + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + ('883', '2006-02-15T10:09:17', 2), + ('287', '2006-02-15T10:09:17', 2), + ('287', '2006-02-15T10:09:17', 2), + ('287', '2006-02-15T10:09:17', 1), + ('287', '2006-02-15T10:09:17', 1), + ('953', '2006-02-15T10:09:17', 1), + ('953', '2006-02-15T10:09:17', 2), + ('953', '2006-02-15T10:09:17', 1), + ('953', '2006-02-15T10:09:17', 2), + ('953', '2006-02-15T10:09:17', 1), + ('953', '2006-02-15T10:09:17', 1), + ('383', '2006-02-15T10:09:17', 1), + ('383', '2006-02-15T10:09:17', 2), + ('383', '2006-02-15T10:09:17', 1), + ('383', '2006-02-15T10:09:17', 1), + ('383', '2006-02-15T10:09:17', 2), + ('717', '2006-02-15T10:09:17', 2), + ('717', '2006-02-15T10:09:17', 1), + ('717', '2006-02-15T10:09:17', 2), + ('717', '2006-02-15T10:09:17', 1), + ('327', '2006-02-15T10:09:17', 2), + ('327', '2006-02-15T10:09:17', 2), + ('327', '2006-02-15T10:09:17', 1), + ('327', '2006-02-15T10:09:17', 1), + ('327', '2006-02-15T10:09:17', 1), + ('327', '2006-02-15T10:09:17', 1), + ('237', '2006-02-15T10:09:17', 1), + ('237', '2006-02-15T10:09:17', 1), + ('971', '2006-02-15T10:09:17', 1), + ('971', '2006-02-15T10:09:17', 1), + ('971', '2006-02-15T10:09:17', 1), + ('971', '2006-02-15T10:09:17', 1), + ('391', '2006-02-15T10:09:17', 1), + ('391', '2006-02-15T10:09:17', 1), + ('391', '2006-02-15T10:09:17', 1), + ('391', '2006-02-15T10:09:17', 1), + ('391', '2006-02-15T10:09:17', 2), + ('391', '2006-02-15T10:09:17', 2), + ('391', '2006-02-15T10:09:17', 2), + ('263', '2006-02-15T10:09:17', 1), + ('263', '2006-02-15T10:09:17', 1), + ('263', '2006-02-15T10:09:17', 2), + ('263', '2006-02-15T10:09:17', 2), + ('263', '2006-02-15T10:09:17', 2), + ('263', '2006-02-15T10:09:17', 1), + ('263', '2006-02-15T10:09:17', 1), + ('57', '2006-02-15T10:09:17', 1), + ('57', '2006-02-15T10:09:17', 2), + ('57', '2006-02-15T10:09:17', 2), + ('57', '2006-02-15T10:09:17', 1), + ('57', '2006-02-15T10:09:17', 2), + ('57', '2006-02-15T10:09:17', 1), + ('57', '2006-02-15T10:09:17', 1), + ('785', '2006-02-15T10:09:17', 1), + ('785', '2006-02-15T10:09:17', 1), + ('785', '2006-02-15T10:09:17', 2), + ('785', '2006-02-15T10:09:17', 2), + ('785', '2006-02-15T10:09:17', 1), + ('785', '2006-02-15T10:09:17', 1), + ('130', '2006-02-15T10:09:17', 2), + ('130', '2006-02-15T10:09:17', 2), + ('130', '2006-02-15T10:09:17', 1), + ('130', '2006-02-15T10:09:17', 1), + ('130', '2006-02-15T10:09:17', 2), + ('130', '2006-02-15T10:09:17', 2), + ('750', '2006-02-15T10:09:17', 1), + ('750', '2006-02-15T10:09:17', 1), + ('750', '2006-02-15T10:09:17', 1), + ('46', '2006-02-15T10:09:17', 2), + ('46', '2006-02-15T10:09:17', 2), + ('46', '2006-02-15T10:09:17', 2), + ('375', '2006-02-15T10:09:17', 1), + ('375', '2006-02-15T10:09:17', 1), + ('548', '2006-02-15T10:09:17', 1), + ('548', '2006-02-15T10:09:17', 1), + ('911', '2006-02-15T10:09:17', 2), + ('911', '2006-02-15T10:09:17', 2), + ('911', '2006-02-15T10:09:17', 1), + ('911', '2006-02-15T10:09:17', 1), + ('911', '2006-02-15T10:09:17', 2), + ('911', '2006-02-15T10:09:17', 1), + ('911', '2006-02-15T10:09:17', 2), + ('911', '2006-02-15T10:09:17', 1), + ('567', '2006-02-15T10:09:17', 1), + ('567', '2006-02-15T10:09:17', 2), + ('567', '2006-02-15T10:09:17', 1), + ('567', '2006-02-15T10:09:17', 2), + ('627', '2006-02-15T10:09:17', 2), + ('627', '2006-02-15T10:09:17', 2), + ('627', '2006-02-15T10:09:17', 2), + ('482', '2006-02-15T10:09:17', 1), + ('482', '2006-02-15T10:09:17', 1), + ('482', '2006-02-15T10:09:17', 1), + ('476', '2006-02-15T10:09:17', 2), + ('476', '2006-02-15T10:09:17', 2), + ('476', '2006-02-15T10:09:17', 1), + ('476', '2006-02-15T10:09:17', 1), + ('476', '2006-02-15T10:09:17', 1), + ('476', '2006-02-15T10:09:17', 2), + ('476', '2006-02-15T10:09:17', 2) + ) AS data(old_film_id, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."film"' + AND map0.old_id = data.old_film_id + RETURNING inventory_id + ) + SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; + + FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); + END LOOP; + + v_old_ids_inventory := ARRAY['4166', '4167', '4169', '4170', '4168', '3940', '3942', '3941', '3939', '3943', '3944', '3066', '3067', '3068', '49', '47', '51', '50', '46', '52', '48', '2224', '2226', '2225', '2223', '2227', '2222', '1928', '1923', '1929', '1926', '1925', '1927', '1930', '1924', '1359', '1361', '1360', '1358', '1362', '1363', '3821', '3820', '3819', '4050', '4049', '4051', '4048', '2785', '2784', '2786', '2788', '2787', '2789', '2097', '2099', '2096', '2098', '2472', '2476', '2473', '2475', '2474', '2477', '4285', '4286', '4287', '4224', '4222', '4225', '4223', '167', '170', '168', '171', '169', '172', '173', '2591', '2592', '1235', '1236', '1232', '1233', '1234', '1231', '1230', '1270', '1268', '1267', '1269', '1271', '1266', '4180', '4179', '2463', '2462', '2464', '382', '379']; + WITH inserted AS ( + INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") + SELECT + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + ('906', '2006-02-15T10:09:17', 1), + ('906', '2006-02-15T10:09:17', 1), + ('906', '2006-02-15T10:09:17', 2), + ('906', '2006-02-15T10:09:17', 2), + ('906', '2006-02-15T10:09:17', 2), + ('859', '2006-02-15T10:09:17', 1), + ('859', '2006-02-15T10:09:17', 2), + ('859', '2006-02-15T10:09:17', 1), + ('859', '2006-02-15T10:09:17', 1), + ('859', '2006-02-15T10:09:17', 2), + ('859', '2006-02-15T10:09:17', 2), + ('674', '2006-02-15T10:09:17', 1), + ('674', '2006-02-15T10:09:17', 1), + ('674', '2006-02-15T10:09:17', 1), + ('10', '2006-02-15T10:09:17', 1), + ('10', '2006-02-15T10:09:17', 1), + ('10', '2006-02-15T10:09:17', 2), + ('10', '2006-02-15T10:09:17', 2), + ('10', '2006-02-15T10:09:17', 1), + ('10', '2006-02-15T10:09:17', 2), + ('10', '2006-02-15T10:09:17', 1), + ('481', '2006-02-15T10:09:17', 1), + ('481', '2006-02-15T10:09:17', 2), + ('481', '2006-02-15T10:09:17', 2), + ('481', '2006-02-15T10:09:17', 1), + ('481', '2006-02-15T10:09:17', 2), + ('481', '2006-02-15T10:09:17', 1), + ('418', '2006-02-15T10:09:17', 2), + ('418', '2006-02-15T10:09:17', 1), + ('418', '2006-02-15T10:09:17', 2), + ('418', '2006-02-15T10:09:17', 1), + ('418', '2006-02-15T10:09:17', 1), + ('418', '2006-02-15T10:09:17', 2), + ('418', '2006-02-15T10:09:17', 2), + ('418', '2006-02-15T10:09:17', 1), + ('300', '2006-02-15T10:09:17', 1), + ('300', '2006-02-15T10:09:17', 2), + ('300', '2006-02-15T10:09:17', 2), + ('300', '2006-02-15T10:09:17', 1), + ('300', '2006-02-15T10:09:17', 2), + ('300', '2006-02-15T10:09:17', 2), + ('836', '2006-02-15T10:09:17', 1), + ('836', '2006-02-15T10:09:17', 1), + ('836', '2006-02-15T10:09:17', 1), + ('881', '2006-02-15T10:09:17', 2), + ('881', '2006-02-15T10:09:17', 2), + ('881', '2006-02-15T10:09:17', 2), + ('881', '2006-02-15T10:09:17', 2), + ('611', '2006-02-15T10:09:17', 1), + ('611', '2006-02-15T10:09:17', 1), + ('611', '2006-02-15T10:09:17', 1), + ('611', '2006-02-15T10:09:17', 2), + ('611', '2006-02-15T10:09:17', 1), + ('611', '2006-02-15T10:09:17', 2), + ('455', '2006-02-15T10:09:17', 1), + ('455', '2006-02-15T10:09:17', 1), + ('455', '2006-02-15T10:09:17', 1), + ('455', '2006-02-15T10:09:17', 1), + ('542', '2006-02-15T10:09:17', 1), + ('542', '2006-02-15T10:09:17', 2), + ('542', '2006-02-15T10:09:17', 1), + ('542', '2006-02-15T10:09:17', 1), + ('542', '2006-02-15T10:09:17', 1), + ('542', '2006-02-15T10:09:17', 2), + ('933', '2006-02-15T10:09:17', 1), + ('933', '2006-02-15T10:09:17', 1), + ('933', '2006-02-15T10:09:17', 1), + ('918', '2006-02-15T10:09:17', 2), + ('918', '2006-02-15T10:09:17', 2), + ('918', '2006-02-15T10:09:17', 2), + ('918', '2006-02-15T10:09:17', 2), + ('37', '2006-02-15T10:09:17', 1), + ('37', '2006-02-15T10:09:17', 1), + ('37', '2006-02-15T10:09:17', 1), + ('37', '2006-02-15T10:09:17', 2), + ('37', '2006-02-15T10:09:17', 1), + ('37', '2006-02-15T10:09:17', 2), + ('37', '2006-02-15T10:09:17', 2), + ('569', '2006-02-15T10:09:17', 1), + ('569', '2006-02-15T10:09:17', 1), + ('273', '2006-02-15T10:09:17', 2), + ('273', '2006-02-15T10:09:17', 2), + ('273', '2006-02-15T10:09:17', 1), + ('273', '2006-02-15T10:09:17', 1), + ('273', '2006-02-15T10:09:17', 2), + ('273', '2006-02-15T10:09:17', 1), + ('273', '2006-02-15T10:09:17', 1), + ('281', '2006-02-15T10:09:17', 2), + ('281', '2006-02-15T10:09:17', 2), + ('281', '2006-02-15T10:09:17', 1), + ('281', '2006-02-15T10:09:17', 2), + ('281', '2006-02-15T10:09:17', 2), + ('281', '2006-02-15T10:09:17', 1), + ('910', '2006-02-15T10:09:17', 2), + ('910', '2006-02-15T10:09:17', 2), + ('538', '2006-02-15T10:09:17', 2), + ('538', '2006-02-15T10:09:17', 2), + ('538', '2006-02-15T10:09:17', 2), + ('84', '2006-02-15T10:09:17', 1), + ('84', '2006-02-15T10:09:17', 1) + ) AS data(old_film_id, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."film"' + AND map0.old_id = data.old_film_id + RETURNING inventory_id + ) + SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; + + FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); + END LOOP; + + v_old_ids_inventory := ARRAY['380', '381', '1347', '1348', '1161', '1160', '1159', '3165', '3166', '2164', '2160', '2162', '2163', '2159', '2158', '2161', '1953', '1955', '1954', '2186', '2185', '3926', '3924', '3922', '3923', '3925', '3920', '3927', '3921', '1309', '1307', '1304', '1308', '1306', '1305', '3802', '3801', '3806', '3803', '3804', '3807', '3805', '4536', '4537', '4324', '4325', '4326', '4327', '3915', '3914', '3913', '3912', '2880', '2879', '2876', '2877', '2878', '576', '575', '145', '144', '3736', '3735', '3731', '3733', '3730', '3734', '3732', '621', '622', '620', '624', '619', '625', '623', '2192', '2195', '2194', '2193', '2243', '2244', '2245', '222', '223', '226', '225', '224', '2513', '2512', '2511', '2514', '971', '970', '969', '973', '972', '1111', '1110', '1109', '1853']; + WITH inserted AS ( + INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") + SELECT + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + ('84', '2006-02-15T10:09:17', 1), + ('84', '2006-02-15T10:09:17', 1), + ('297', '2006-02-15T10:09:17', 2), + ('297', '2006-02-15T10:09:17', 2), + ('256', '2006-02-15T10:09:17', 2), + ('256', '2006-02-15T10:09:17', 2), + ('256', '2006-02-15T10:09:17', 2), + ('695', '2006-02-15T10:09:17', 1), + ('695', '2006-02-15T10:09:17', 1), + ('467', '2006-02-15T10:09:17', 2), + ('467', '2006-02-15T10:09:17', 1), + ('467', '2006-02-15T10:09:17', 2), + ('467', '2006-02-15T10:09:17', 2), + ('467', '2006-02-15T10:09:17', 1), + ('467', '2006-02-15T10:09:17', 1), + ('467', '2006-02-15T10:09:17', 1), + ('426', '2006-02-15T10:09:17', 2), + ('426', '2006-02-15T10:09:17', 2), + ('426', '2006-02-15T10:09:17', 2), + ('472', '2006-02-15T10:09:17', 2), + ('472', '2006-02-15T10:09:17', 2), + ('856', '2006-02-15T10:09:17', 2), + ('856', '2006-02-15T10:09:17', 2), + ('856', '2006-02-15T10:09:17', 1), + ('856', '2006-02-15T10:09:17', 1), + ('856', '2006-02-15T10:09:17', 2), + ('856', '2006-02-15T10:09:17', 1), + ('856', '2006-02-15T10:09:17', 2), + ('856', '2006-02-15T10:09:17', 1), + ('288', '2006-02-15T10:09:17', 2), + ('288', '2006-02-15T10:09:17', 2), + ('288', '2006-02-15T10:09:17', 1), + ('288', '2006-02-15T10:09:17', 2), + ('288', '2006-02-15T10:09:17', 2), + ('288', '2006-02-15T10:09:17', 1), + ('833', '2006-02-15T10:09:17', 1), + ('833', '2006-02-15T10:09:17', 1), + ('833', '2006-02-15T10:09:17', 2), + ('833', '2006-02-15T10:09:17', 1), + ('833', '2006-02-15T10:09:17', 2), + ('833', '2006-02-15T10:09:17', 2), + ('833', '2006-02-15T10:09:17', 2), + ('990', '2006-02-15T10:09:17', 2), + ('990', '2006-02-15T10:09:17', 2), + ('942', '2006-02-15T10:09:17', 1), + ('942', '2006-02-15T10:09:17', 1), + ('942', '2006-02-15T10:09:17', 2), + ('942', '2006-02-15T10:09:17', 2), + ('854', '2006-02-15T10:09:17', 2), + ('854', '2006-02-15T10:09:17', 2), + ('854', '2006-02-15T10:09:17', 2), + ('854', '2006-02-15T10:09:17', 2), + ('631', '2006-02-15T10:09:17', 2), + ('631', '2006-02-15T10:09:17', 2), + ('631', '2006-02-15T10:09:17', 1), + ('631', '2006-02-15T10:09:17', 1), + ('631', '2006-02-15T10:09:17', 1), + ('125', '2006-02-15T10:09:17', 2), + ('125', '2006-02-15T10:09:17', 2), + ('30', '2006-02-15T10:09:17', 1), + ('30', '2006-02-15T10:09:17', 1), + ('816', '2006-02-15T10:09:17', 2), + ('816', '2006-02-15T10:09:17', 2), + ('816', '2006-02-15T10:09:17', 1), + ('816', '2006-02-15T10:09:17', 1), + ('816', '2006-02-15T10:09:17', 1), + ('816', '2006-02-15T10:09:17', 2), + ('816', '2006-02-15T10:09:17', 1), + ('135', '2006-02-15T10:09:17', 1), + ('135', '2006-02-15T10:09:17', 2), + ('135', '2006-02-15T10:09:17', 1), + ('135', '2006-02-15T10:09:17', 2), + ('135', '2006-02-15T10:09:17', 1), + ('135', '2006-02-15T10:09:17', 2), + ('135', '2006-02-15T10:09:17', 2), + ('474', '2006-02-15T10:09:17', 2), + ('474', '2006-02-15T10:09:17', 2), + ('474', '2006-02-15T10:09:17', 2), + ('474', '2006-02-15T10:09:17', 2), + ('485', '2006-02-15T10:09:17', 2), + ('485', '2006-02-15T10:09:17', 2), + ('485', '2006-02-15T10:09:17', 2), + ('50', '2006-02-15T10:09:17', 1), + ('50', '2006-02-15T10:09:17', 1), + ('50', '2006-02-15T10:09:17', 2), + ('50', '2006-02-15T10:09:17', 2), + ('50', '2006-02-15T10:09:17', 1), + ('552', '2006-02-15T10:09:17', 2), + ('552', '2006-02-15T10:09:17', 2), + ('552', '2006-02-15T10:09:17', 2), + ('552', '2006-02-15T10:09:17', 2), + ('216', '2006-02-15T10:09:17', 2), + ('216', '2006-02-15T10:09:17', 1), + ('216', '2006-02-15T10:09:17', 1), + ('216', '2006-02-15T10:09:17', 2), + ('216', '2006-02-15T10:09:17', 2), + ('246', '2006-02-15T10:09:17', 2), + ('246', '2006-02-15T10:09:17', 2), + ('246', '2006-02-15T10:09:17', 2), + ('403', '2006-02-15T10:09:17', 2) + ) AS data(old_film_id, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."film"' + AND map0.old_id = data.old_film_id + RETURNING inventory_id + ) + SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; + + FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); + END LOOP; + + v_old_ids_inventory := ARRAY['1855', '1856', '1854', '1851', '1852', '1849', '1850', '793', '790', '792', '791', '794', '3536', '3531', '3538', '3534', '3537', '3532', '3535', '3533', '2317', '2318', '2316', '1412', '1415', '1411', '1410', '1413', '1414', '4266', '4267', '4265', '1441', '1440', '1442', '3115', '3116', '1941', '1940', '424', '423', '425', '1622', '1623', '1624', '1620', '1621', '4563', '4564', '3241', '3240', '3239', '3242', '574', '573', '572', '928', '929', '926', '931', '933', '930', '932', '927', '1477', '1478', '1479', '1476', '2090', '2089', '2092', '2093', '2091', '1258', '1259', '3415', '3418', '3411', '3412', '3414', '3417', '3413', '3416', '4577', '4579', '4581', '4576', '4578', '4580', '4574', '4575', '4103', '4104', '4101', '4107', '4108', '4105', '4106', '4102', '1963']; + WITH inserted AS ( + INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") + SELECT + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + ('403', '2006-02-15T10:09:17', 2), + ('403', '2006-02-15T10:09:17', 2), + ('403', '2006-02-15T10:09:17', 2), + ('403', '2006-02-15T10:09:17', 1), + ('403', '2006-02-15T10:09:17', 1), + ('403', '2006-02-15T10:09:17', 1), + ('403', '2006-02-15T10:09:17', 1), + ('173', '2006-02-15T10:09:17', 2), + ('173', '2006-02-15T10:09:17', 1), + ('173', '2006-02-15T10:09:17', 1), + ('173', '2006-02-15T10:09:17', 1), + ('173', '2006-02-15T10:09:17', 2), + ('773', '2006-02-15T10:09:17', 2), + ('773', '2006-02-15T10:09:17', 1), + ('773', '2006-02-15T10:09:17', 2), + ('773', '2006-02-15T10:09:17', 1), + ('773', '2006-02-15T10:09:17', 2), + ('773', '2006-02-15T10:09:17', 1), + ('773', '2006-02-15T10:09:17', 2), + ('773', '2006-02-15T10:09:17', 1), + ('503', '2006-02-15T10:09:17', 1), + ('503', '2006-02-15T10:09:17', 1), + ('503', '2006-02-15T10:09:17', 1), + ('309', '2006-02-15T10:09:17', 2), + ('309', '2006-02-15T10:09:17', 2), + ('309', '2006-02-15T10:09:17', 1), + ('309', '2006-02-15T10:09:17', 1), + ('309', '2006-02-15T10:09:17', 2), + ('309', '2006-02-15T10:09:17', 2), + ('928', '2006-02-15T10:09:17', 1), + ('928', '2006-02-15T10:09:17', 1), + ('928', '2006-02-15T10:09:17', 1), + ('315', '2006-02-15T10:09:17', 2), + ('315', '2006-02-15T10:09:17', 2), + ('315', '2006-02-15T10:09:17', 2), + ('684', '2006-02-15T10:09:17', 2), + ('684', '2006-02-15T10:09:17', 2), + ('422', '2006-02-15T10:09:17', 2), + ('422', '2006-02-15T10:09:17', 2), + ('93', '2006-02-15T10:09:17', 2), + ('93', '2006-02-15T10:09:17', 2), + ('93', '2006-02-15T10:09:17', 2), + ('354', '2006-02-15T10:09:17', 1), + ('354', '2006-02-15T10:09:17', 2), + ('354', '2006-02-15T10:09:17', 2), + ('354', '2006-02-15T10:09:17', 1), + ('354', '2006-02-15T10:09:17', 1), + ('996', '2006-02-15T10:09:17', 1), + ('996', '2006-02-15T10:09:17', 1), + ('711', '2006-02-15T10:09:17', 2), + ('711', '2006-02-15T10:09:17', 2), + ('711', '2006-02-15T10:09:17', 2), + ('711', '2006-02-15T10:09:17', 2), + ('124', '2006-02-15T10:09:17', 2), + ('124', '2006-02-15T10:09:17', 2), + ('124', '2006-02-15T10:09:17', 2), + ('206', '2006-02-15T10:09:17', 1), + ('206', '2006-02-15T10:09:17', 1), + ('206', '2006-02-15T10:09:17', 1), + ('206', '2006-02-15T10:09:17', 2), + ('206', '2006-02-15T10:09:17', 2), + ('206', '2006-02-15T10:09:17', 2), + ('206', '2006-02-15T10:09:17', 2), + ('206', '2006-02-15T10:09:17', 1), + ('323', '2006-02-15T10:09:17', 2), + ('323', '2006-02-15T10:09:17', 2), + ('323', '2006-02-15T10:09:17', 2), + ('323', '2006-02-15T10:09:17', 2), + ('453', '2006-02-15T10:09:17', 1), + ('453', '2006-02-15T10:09:17', 1), + ('453', '2006-02-15T10:09:17', 2), + ('453', '2006-02-15T10:09:17', 2), + ('453', '2006-02-15T10:09:17', 1), + ('279', '2006-02-15T10:09:17', 1), + ('279', '2006-02-15T10:09:17', 1), + ('748', '2006-02-15T10:09:17', 2), + ('748', '2006-02-15T10:09:17', 2), + ('748', '2006-02-15T10:09:17', 1), + ('748', '2006-02-15T10:09:17', 1), + ('748', '2006-02-15T10:09:17', 1), + ('748', '2006-02-15T10:09:17', 2), + ('748', '2006-02-15T10:09:17', 1), + ('748', '2006-02-15T10:09:17', 2), + ('1000', '2006-02-15T10:09:17', 1), + ('1000', '2006-02-15T10:09:17', 2), + ('1000', '2006-02-15T10:09:17', 2), + ('1000', '2006-02-15T10:09:17', 1), + ('1000', '2006-02-15T10:09:17', 2), + ('1000', '2006-02-15T10:09:17', 2), + ('1000', '2006-02-15T10:09:17', 1), + ('1000', '2006-02-15T10:09:17', 1), + ('893', '2006-02-15T10:09:17', 1), + ('893', '2006-02-15T10:09:17', 1), + ('893', '2006-02-15T10:09:17', 1), + ('893', '2006-02-15T10:09:17', 2), + ('893', '2006-02-15T10:09:17', 2), + ('893', '2006-02-15T10:09:17', 2), + ('893', '2006-02-15T10:09:17', 2), + ('893', '2006-02-15T10:09:17', 1), + ('428', '2006-02-15T10:09:17', 1) + ) AS data(old_film_id, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."film"' + AND map0.old_id = data.old_film_id + RETURNING inventory_id + ) + SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; + + FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); + END LOOP; + + v_old_ids_inventory := ARRAY['1965', '1960', '1961', '1964', '1962', '4438', '4434', '4437', '4440', '4435', '4439', '4436', '2480', '2482', '2481', '2483', '1067', '1068', '2683', '2684', '2685', '2682', '2292', '2293', '278', '279', '667', '666', '668', '2460', '2461', '2459', '1295', '1297', '1298', '1296', '1299', '824', '823', '4429', '4427', '4428', '887', '888', '3887', '3881', '3885', '3884', '3882', '3883', '3886', '3888', '1468', '1466', '1469', '1467', '3833', '3835', '3834', '3836', '108', '113', '110', '112', '111', '114', '109', '2456', '2458', '2454', '2457', '2455', '1810', '1811', '724', '728', '726', '727', '725', '730', '729', '1263', '1260', '1264', '1261', '1262', '1265', '468', '471', '469', '470', '465', '472', '466', '467', '2205', '2207', '2206', '1381', '1378']; + WITH inserted AS ( + INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") + SELECT + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + ('428', '2006-02-15T10:09:17', 2), + ('428', '2006-02-15T10:09:17', 1), + ('428', '2006-02-15T10:09:17', 1), + ('428', '2006-02-15T10:09:17', 2), + ('428', '2006-02-15T10:09:17', 1), + ('970', '2006-02-15T10:09:17', 2), + ('970', '2006-02-15T10:09:17', 1), + ('970', '2006-02-15T10:09:17', 2), + ('970', '2006-02-15T10:09:17', 2), + ('970', '2006-02-15T10:09:17', 1), + ('970', '2006-02-15T10:09:17', 2), + ('970', '2006-02-15T10:09:17', 1), + ('544', '2006-02-15T10:09:17', 1), + ('544', '2006-02-15T10:09:17', 2), + ('544', '2006-02-15T10:09:17', 1), + ('544', '2006-02-15T10:09:17', 2), + ('238', '2006-02-15T10:09:17', 1), + ('238', '2006-02-15T10:09:17', 1), + ('589', '2006-02-15T10:09:17', 2), + ('589', '2006-02-15T10:09:17', 2), + ('589', '2006-02-15T10:09:17', 2), + ('589', '2006-02-15T10:09:17', 2), + ('498', '2006-02-15T10:09:17', 1), + ('498', '2006-02-15T10:09:17', 1), + ('62', '2006-02-15T10:09:17', 2), + ('62', '2006-02-15T10:09:17', 2), + ('145', '2006-02-15T10:09:17', 2), + ('145', '2006-02-15T10:09:17', 2), + ('145', '2006-02-15T10:09:17', 2), + ('537', '2006-02-15T10:09:17', 2), + ('537', '2006-02-15T10:09:17', 2), + ('537', '2006-02-15T10:09:17', 2), + ('286', '2006-02-15T10:09:17', 1), + ('286', '2006-02-15T10:09:17', 2), + ('286', '2006-02-15T10:09:17', 2), + ('286', '2006-02-15T10:09:17', 1), + ('286', '2006-02-15T10:09:17', 2), + ('180', '2006-02-15T10:09:17', 2), + ('180', '2006-02-15T10:09:17', 2), + ('968', '2006-02-15T10:09:17', 1), + ('968', '2006-02-15T10:09:17', 1), + ('968', '2006-02-15T10:09:17', 1), + ('197', '2006-02-15T10:09:17', 1), + ('197', '2006-02-15T10:09:17', 1), + ('849', '2006-02-15T10:09:17', 2), + ('849', '2006-02-15T10:09:17', 1), + ('849', '2006-02-15T10:09:17', 2), + ('849', '2006-02-15T10:09:17', 1), + ('849', '2006-02-15T10:09:17', 1), + ('849', '2006-02-15T10:09:17', 1), + ('849', '2006-02-15T10:09:17', 2), + ('849', '2006-02-15T10:09:17', 2), + ('321', '2006-02-15T10:09:17', 1), + ('321', '2006-02-15T10:09:17', 1), + ('321', '2006-02-15T10:09:17', 1), + ('321', '2006-02-15T10:09:17', 1), + ('840', '2006-02-15T10:09:17', 1), + ('840', '2006-02-15T10:09:17', 1), + ('840', '2006-02-15T10:09:17', 1), + ('840', '2006-02-15T10:09:17', 1), + ('22', '2006-02-15T10:09:17', 1), + ('22', '2006-02-15T10:09:17', 2), + ('22', '2006-02-15T10:09:17', 1), + ('22', '2006-02-15T10:09:17', 2), + ('22', '2006-02-15T10:09:17', 1), + ('22', '2006-02-15T10:09:17', 2), + ('22', '2006-02-15T10:09:17', 1), + ('536', '2006-02-15T10:09:17', 1), + ('536', '2006-02-15T10:09:17', 2), + ('536', '2006-02-15T10:09:17', 1), + ('536', '2006-02-15T10:09:17', 2), + ('536', '2006-02-15T10:09:17', 1), + ('393', '2006-02-15T10:09:17', 1), + ('393', '2006-02-15T10:09:17', 1), + ('159', '2006-02-15T10:09:17', 1), + ('159', '2006-02-15T10:09:17', 2), + ('159', '2006-02-15T10:09:17', 1), + ('159', '2006-02-15T10:09:17', 1), + ('159', '2006-02-15T10:09:17', 1), + ('159', '2006-02-15T10:09:17', 2), + ('159', '2006-02-15T10:09:17', 2), + ('280', '2006-02-15T10:09:17', 1), + ('280', '2006-02-15T10:09:17', 1), + ('280', '2006-02-15T10:09:17', 2), + ('280', '2006-02-15T10:09:17', 1), + ('280', '2006-02-15T10:09:17', 1), + ('280', '2006-02-15T10:09:17', 2), + ('103', '2006-02-15T10:09:17', 1), + ('103', '2006-02-15T10:09:17', 2), + ('103', '2006-02-15T10:09:17', 2), + ('103', '2006-02-15T10:09:17', 2), + ('103', '2006-02-15T10:09:17', 1), + ('103', '2006-02-15T10:09:17', 2), + ('103', '2006-02-15T10:09:17', 1), + ('103', '2006-02-15T10:09:17', 1), + ('477', '2006-02-15T10:09:17', 2), + ('477', '2006-02-15T10:09:17', 2), + ('477', '2006-02-15T10:09:17', 2), + ('303', '2006-02-15T10:09:17', 1), + ('303', '2006-02-15T10:09:17', 1) + ) AS data(old_film_id, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."film"' + AND map0.old_id = data.old_film_id + RETURNING inventory_id + ) + SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; + + FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); + END LOOP; + + v_old_ids_inventory := ARRAY['1379', '1382', '1380', '1383', '1912', '1916', '1914', '1913', '1911', '1915', '3662', '3661', '3663', '3665', '3664', '3660', '2487', '2489', '2484', '2486', '2485', '2488', '1604', '1608', '1606', '1609', '1607', '1605', '1674', '1678', '1679', '1677', '1680', '1675', '1676', '4566', '4565', '805', '803', '804', '806', '807', '2503', '2504', '2502', '239', '238', '241', '240', '237', '397', '398', '395', '396', '955', '956', '957', '958', '3086', '3087', '3085', '3084', '1546', '1547', '1548', '4518', '4517', '4519', '4516', '4515', '4520', '2295', '2294', '3577', '3576', '3574', '3575', '3572', '3573', '1136', '1139', '1140', '1141', '1137', '1138', '4513', '4512', '4508', '4511', '4509', '4514', '4510', '1986', '1988', '1987', '1985', '1984', '1989', '3552', '3551']; + WITH inserted AS ( + INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") + SELECT + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + ('303', '2006-02-15T10:09:17', 1), + ('303', '2006-02-15T10:09:17', 2), + ('303', '2006-02-15T10:09:17', 1), + ('303', '2006-02-15T10:09:17', 2), + ('416', '2006-02-15T10:09:17', 1), + ('416', '2006-02-15T10:09:17', 2), + ('416', '2006-02-15T10:09:17', 2), + ('416', '2006-02-15T10:09:17', 2), + ('416', '2006-02-15T10:09:17', 1), + ('416', '2006-02-15T10:09:17', 2), + ('800', '2006-02-15T10:09:17', 2), + ('800', '2006-02-15T10:09:17', 1), + ('800', '2006-02-15T10:09:17', 2), + ('800', '2006-02-15T10:09:17', 2), + ('800', '2006-02-15T10:09:17', 2), + ('800', '2006-02-15T10:09:17', 1), + ('545', '2006-02-15T10:09:17', 1), + ('545', '2006-02-15T10:09:17', 2), + ('545', '2006-02-15T10:09:17', 1), + ('545', '2006-02-15T10:09:17', 1), + ('545', '2006-02-15T10:09:17', 1), + ('545', '2006-02-15T10:09:17', 2), + ('351', '2006-02-15T10:09:17', 1), + ('351', '2006-02-15T10:09:17', 2), + ('351', '2006-02-15T10:09:17', 1), + ('351', '2006-02-15T10:09:17', 2), + ('351', '2006-02-15T10:09:17', 2), + ('351', '2006-02-15T10:09:17', 1), + ('366', '2006-02-15T10:09:17', 1), + ('366', '2006-02-15T10:09:17', 2), + ('366', '2006-02-15T10:09:17', 2), + ('366', '2006-02-15T10:09:17', 1), + ('366', '2006-02-15T10:09:17', 2), + ('366', '2006-02-15T10:09:17', 1), + ('366', '2006-02-15T10:09:17', 1), + ('997', '2006-02-15T10:09:17', 1), + ('997', '2006-02-15T10:09:17', 1), + ('175', '2006-02-15T10:09:17', 2), + ('175', '2006-02-15T10:09:17', 1), + ('175', '2006-02-15T10:09:17', 1), + ('175', '2006-02-15T10:09:17', 2), + ('175', '2006-02-15T10:09:17', 2), + ('550', '2006-02-15T10:09:17', 1), + ('550', '2006-02-15T10:09:17', 1), + ('550', '2006-02-15T10:09:17', 1), + ('54', '2006-02-15T10:09:17', 1), + ('54', '2006-02-15T10:09:17', 1), + ('54', '2006-02-15T10:09:17', 2), + ('54', '2006-02-15T10:09:17', 2), + ('54', '2006-02-15T10:09:17', 1), + ('88', '2006-02-15T10:09:17', 2), + ('88', '2006-02-15T10:09:17', 2), + ('88', '2006-02-15T10:09:17', 2), + ('88', '2006-02-15T10:09:17', 2), + ('213', '2006-02-15T10:09:17', 1), + ('213', '2006-02-15T10:09:17', 1), + ('213', '2006-02-15T10:09:17', 1), + ('213', '2006-02-15T10:09:17', 1), + ('678', '2006-02-15T10:09:17', 1), + ('678', '2006-02-15T10:09:17', 1), + ('678', '2006-02-15T10:09:17', 1), + ('678', '2006-02-15T10:09:17', 1), + ('339', '2006-02-15T10:09:17', 2), + ('339', '2006-02-15T10:09:17', 2), + ('339', '2006-02-15T10:09:17', 2), + ('986', '2006-02-15T10:09:17', 1), + ('986', '2006-02-15T10:09:17', 1), + ('986', '2006-02-15T10:09:17', 2), + ('986', '2006-02-15T10:09:17', 1), + ('986', '2006-02-15T10:09:17', 1), + ('986', '2006-02-15T10:09:17', 2), + ('499', '2006-02-15T10:09:17', 1), + ('499', '2006-02-15T10:09:17', 1), + ('782', '2006-02-15T10:09:17', 2), + ('782', '2006-02-15T10:09:17', 2), + ('782', '2006-02-15T10:09:17', 1), + ('782', '2006-02-15T10:09:17', 2), + ('782', '2006-02-15T10:09:17', 1), + ('782', '2006-02-15T10:09:17', 1), + ('252', '2006-02-15T10:09:17', 1), + ('252', '2006-02-15T10:09:17', 2), + ('252', '2006-02-15T10:09:17', 2), + ('252', '2006-02-15T10:09:17', 2), + ('252', '2006-02-15T10:09:17', 1), + ('252', '2006-02-15T10:09:17', 1), + ('985', '2006-02-15T10:09:17', 2), + ('985', '2006-02-15T10:09:17', 2), + ('985', '2006-02-15T10:09:17', 1), + ('985', '2006-02-15T10:09:17', 1), + ('985', '2006-02-15T10:09:17', 1), + ('985', '2006-02-15T10:09:17', 2), + ('985', '2006-02-15T10:09:17', 1), + ('433', '2006-02-15T10:09:17', 1), + ('433', '2006-02-15T10:09:17', 2), + ('433', '2006-02-15T10:09:17', 1), + ('433', '2006-02-15T10:09:17', 1), + ('433', '2006-02-15T10:09:17', 1), + ('433', '2006-02-15T10:09:17', 2), + ('776', '2006-02-15T10:09:17', 2), + ('776', '2006-02-15T10:09:17', 2) + ) AS data(old_film_id, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."film"' + AND map0.old_id = data.old_film_id + RETURNING inventory_id + ) + SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; + + FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); + END LOOP; + + v_old_ids_inventory := ARRAY['3549', '3550', '3548', '1204', '1205', '1200', '1202', '1201', '1203', '979', '978', '980', '974', '975', '976', '977', '2343', '2345', '2344', '2346', '959', '961', '962', '960', '1688', '1689', '2358', '2359', '3217', '3219', '3220', '3222', '3221', '3218', '1744', '1745', '1743', '1746', '2027', '2028', '3366', '3361', '3364', '3363', '3365', '3362', '3367', '3360', '2058', '2060', '2061', '2059', '2057', '2062', '2063', '1355', '1356', '1357', '1354', '610', '608', '609', '611', '606', '607', '1866', '1865', '231', '232', '230', '228', '229', '227', '99', '100', '101', '2408', '2409', '2402', '2403', '2406', '2407', '2405', '2404', '3784', '3783', '3782', '3781', '2556', '2557', '2558', '2554', '2555', '716', '718', '717', '1992', '1993', '1990', '1994']; + WITH inserted AS ( + INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") + SELECT + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + ('776', '2006-02-15T10:09:17', 1), + ('776', '2006-02-15T10:09:17', 2), + ('776', '2006-02-15T10:09:17', 1), + ('267', '2006-02-15T10:09:17', 2), + ('267', '2006-02-15T10:09:17', 2), + ('267', '2006-02-15T10:09:17', 1), + ('267', '2006-02-15T10:09:17', 1), + ('267', '2006-02-15T10:09:17', 1), + ('267', '2006-02-15T10:09:17', 1), + ('218', '2006-02-15T10:09:17', 2), + ('218', '2006-02-15T10:09:17', 2), + ('218', '2006-02-15T10:09:17', 2), + ('218', '2006-02-15T10:09:17', 1), + ('218', '2006-02-15T10:09:17', 1), + ('218', '2006-02-15T10:09:17', 1), + ('218', '2006-02-15T10:09:17', 1), + ('510', '2006-02-15T10:09:17', 1), + ('510', '2006-02-15T10:09:17', 1), + ('510', '2006-02-15T10:09:17', 1), + ('510', '2006-02-15T10:09:17', 1), + ('214', '2006-02-15T10:09:17', 2), + ('214', '2006-02-15T10:09:17', 2), + ('214', '2006-02-15T10:09:17', 2), + ('214', '2006-02-15T10:09:17', 2), + ('368', '2006-02-15T10:09:17', 1), + ('368', '2006-02-15T10:09:17', 1), + ('513', '2006-02-15T10:09:17', 2), + ('513', '2006-02-15T10:09:17', 2), + ('707', '2006-02-15T10:09:17', 1), + ('707', '2006-02-15T10:09:17', 2), + ('707', '2006-02-15T10:09:17', 2), + ('707', '2006-02-15T10:09:17', 2), + ('707', '2006-02-15T10:09:17', 2), + ('707', '2006-02-15T10:09:17', 1), + ('379', '2006-02-15T10:09:17', 2), + ('379', '2006-02-15T10:09:17', 2), + ('379', '2006-02-15T10:09:17', 2), + ('379', '2006-02-15T10:09:17', 2), + ('441', '2006-02-15T10:09:17', 1), + ('441', '2006-02-15T10:09:17', 1), + ('738', '2006-02-15T10:09:17', 2), + ('738', '2006-02-15T10:09:17', 1), + ('738', '2006-02-15T10:09:17', 2), + ('738', '2006-02-15T10:09:17', 1), + ('738', '2006-02-15T10:09:17', 2), + ('738', '2006-02-15T10:09:17', 1), + ('738', '2006-02-15T10:09:17', 2), + ('738', '2006-02-15T10:09:17', 1), + ('447', '2006-02-15T10:09:17', 1), + ('447', '2006-02-15T10:09:17', 1), + ('447', '2006-02-15T10:09:17', 2), + ('447', '2006-02-15T10:09:17', 1), + ('447', '2006-02-15T10:09:17', 1), + ('447', '2006-02-15T10:09:17', 2), + ('447', '2006-02-15T10:09:17', 2), + ('299', '2006-02-15T10:09:17', 1), + ('299', '2006-02-15T10:09:17', 1), + ('299', '2006-02-15T10:09:17', 1), + ('299', '2006-02-15T10:09:17', 1), + ('132', '2006-02-15T10:09:17', 2), + ('132', '2006-02-15T10:09:17', 1), + ('132', '2006-02-15T10:09:17', 1), + ('132', '2006-02-15T10:09:17', 2), + ('132', '2006-02-15T10:09:17', 1), + ('132', '2006-02-15T10:09:17', 1), + ('407', '2006-02-15T10:09:17', 1), + ('407', '2006-02-15T10:09:17', 1), + ('51', '2006-02-15T10:09:17', 2), + ('51', '2006-02-15T10:09:17', 2), + ('51', '2006-02-15T10:09:17', 2), + ('51', '2006-02-15T10:09:17', 1), + ('51', '2006-02-15T10:09:17', 2), + ('51', '2006-02-15T10:09:17', 1), + ('20', '2006-02-15T10:09:17', 1), + ('20', '2006-02-15T10:09:17', 1), + ('20', '2006-02-15T10:09:17', 1), + ('525', '2006-02-15T10:09:17', 2), + ('525', '2006-02-15T10:09:17', 2), + ('525', '2006-02-15T10:09:17', 1), + ('525', '2006-02-15T10:09:17', 1), + ('525', '2006-02-15T10:09:17', 2), + ('525', '2006-02-15T10:09:17', 2), + ('525', '2006-02-15T10:09:17', 1), + ('525', '2006-02-15T10:09:17', 1), + ('828', '2006-02-15T10:09:17', 2), + ('828', '2006-02-15T10:09:17', 2), + ('828', '2006-02-15T10:09:17', 2), + ('828', '2006-02-15T10:09:17', 2), + ('560', '2006-02-15T10:09:17', 1), + ('560', '2006-02-15T10:09:17', 2), + ('560', '2006-02-15T10:09:17', 2), + ('560', '2006-02-15T10:09:17', 1), + ('560', '2006-02-15T10:09:17', 1), + ('157', '2006-02-15T10:09:17', 2), + ('157', '2006-02-15T10:09:17', 2), + ('157', '2006-02-15T10:09:17', 2), + ('434', '2006-02-15T10:09:17', 1), + ('434', '2006-02-15T10:09:17', 1), + ('434', '2006-02-15T10:09:17', 1), + ('434', '2006-02-15T10:09:17', 2) + ) AS data(old_film_id, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."film"' + AND map0.old_id = data.old_film_id + RETURNING inventory_id + ) + SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; + + FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); + END LOOP; + + v_old_ids_inventory := ARRAY['1997', '1991', '1996', '1995', '939', '938', '940', '2864', '2867', '2866', '2868', '2865', '2547', '2551', '2550', '2553', '2548', '2549', '2546', '2552', '2612', '2615', '2613', '2614', '1457', '1456', '1455', '1458', '1452', '1454', '1453', '3009', '3008', '3006', '3007', '714', '715', '1917', '1920', '1919', '1921', '1918', '1922', '3878', '3879', '3880', '3372', '3368', '3371', '3369', '3370', '1483', '1481', '1480', '1482', '1484', '829', '826', '825', '830', '828', '831', '827', '2016', '2013', '2015', '2014', '2012', '2662', '2661', '70', '68', '67', '69', '3495', '3494', '3493', '3492', '2197', '2196', '4197', '4198', '4196', '4195', '4200', '4199', '3794', '3795', '3796', '947', '946', '945', '2997', '2995', '2999', '2996', '2994', '2998', '4291', '4292']; + WITH inserted AS ( + INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") + SELECT + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + ('434', '2006-02-15T10:09:17', 2), + ('434', '2006-02-15T10:09:17', 1), + ('434', '2006-02-15T10:09:17', 2), + ('434', '2006-02-15T10:09:17', 2), + ('208', '2006-02-15T10:09:17', 1), + ('208', '2006-02-15T10:09:17', 1), + ('208', '2006-02-15T10:09:17', 1), + ('628', '2006-02-15T10:09:17', 1), + ('628', '2006-02-15T10:09:17', 2), + ('628', '2006-02-15T10:09:17', 1), + ('628', '2006-02-15T10:09:17', 2), + ('628', '2006-02-15T10:09:17', 1), + ('559', '2006-02-15T10:09:17', 1), + ('559', '2006-02-15T10:09:17', 2), + ('559', '2006-02-15T10:09:17', 2), + ('559', '2006-02-15T10:09:17', 2), + ('559', '2006-02-15T10:09:17', 1), + ('559', '2006-02-15T10:09:17', 1), + ('559', '2006-02-15T10:09:17', 1), + ('559', '2006-02-15T10:09:17', 2), + ('573', '2006-02-15T10:09:17', 1), + ('573', '2006-02-15T10:09:17', 1), + ('573', '2006-02-15T10:09:17', 1), + ('573', '2006-02-15T10:09:17', 1), + ('319', '2006-02-15T10:09:17', 2), + ('319', '2006-02-15T10:09:17', 2), + ('319', '2006-02-15T10:09:17', 2), + ('319', '2006-02-15T10:09:17', 2), + ('319', '2006-02-15T10:09:17', 1), + ('319', '2006-02-15T10:09:17', 1), + ('319', '2006-02-15T10:09:17', 1), + ('660', '2006-02-15T10:09:17', 2), + ('660', '2006-02-15T10:09:17', 2), + ('660', '2006-02-15T10:09:17', 1), + ('660', '2006-02-15T10:09:17', 1), + ('156', '2006-02-15T10:09:17', 2), + ('156', '2006-02-15T10:09:17', 2), + ('417', '2006-02-15T10:09:17', 1), + ('417', '2006-02-15T10:09:17', 1), + ('417', '2006-02-15T10:09:17', 1), + ('417', '2006-02-15T10:09:17', 2), + ('417', '2006-02-15T10:09:17', 1), + ('417', '2006-02-15T10:09:17', 2), + ('848', '2006-02-15T10:09:17', 1), + ('848', '2006-02-15T10:09:17', 1), + ('848', '2006-02-15T10:09:17', 1), + ('739', '2006-02-15T10:09:17', 2), + ('739', '2006-02-15T10:09:17', 1), + ('739', '2006-02-15T10:09:17', 2), + ('739', '2006-02-15T10:09:17', 1), + ('739', '2006-02-15T10:09:17', 2), + ('324', '2006-02-15T10:09:17', 2), + ('324', '2006-02-15T10:09:17', 1), + ('324', '2006-02-15T10:09:17', 1), + ('324', '2006-02-15T10:09:17', 1), + ('324', '2006-02-15T10:09:17', 2), + ('181', '2006-02-15T10:09:17', 2), + ('181', '2006-02-15T10:09:17', 1), + ('181', '2006-02-15T10:09:17', 1), + ('181', '2006-02-15T10:09:17', 2), + ('181', '2006-02-15T10:09:17', 2), + ('181', '2006-02-15T10:09:17', 2), + ('181', '2006-02-15T10:09:17', 1), + ('438', '2006-02-15T10:09:17', 2), + ('438', '2006-02-15T10:09:17', 1), + ('438', '2006-02-15T10:09:17', 2), + ('438', '2006-02-15T10:09:17', 2), + ('438', '2006-02-15T10:09:17', 1), + ('584', '2006-02-15T10:09:17', 1), + ('584', '2006-02-15T10:09:17', 1), + ('13', '2006-02-15T10:09:17', 2), + ('13', '2006-02-15T10:09:17', 2), + ('13', '2006-02-15T10:09:17', 2), + ('13', '2006-02-15T10:09:17', 2), + ('765', '2006-02-15T10:09:17', 1), + ('765', '2006-02-15T10:09:17', 1), + ('765', '2006-02-15T10:09:17', 1), + ('765', '2006-02-15T10:09:17', 1), + ('475', '2006-02-15T10:09:17', 2), + ('475', '2006-02-15T10:09:17', 2), + ('913', '2006-02-15T10:09:17', 1), + ('913', '2006-02-15T10:09:17', 1), + ('913', '2006-02-15T10:09:17', 1), + ('913', '2006-02-15T10:09:17', 1), + ('913', '2006-02-15T10:09:17', 2), + ('913', '2006-02-15T10:09:17', 2), + ('831', '2006-02-15T10:09:17', 1), + ('831', '2006-02-15T10:09:17', 1), + ('831', '2006-02-15T10:09:17', 1), + ('210', '2006-02-15T10:09:17', 2), + ('210', '2006-02-15T10:09:17', 2), + ('210', '2006-02-15T10:09:17', 2), + ('657', '2006-02-15T10:09:17', 1), + ('657', '2006-02-15T10:09:17', 1), + ('657', '2006-02-15T10:09:17', 2), + ('657', '2006-02-15T10:09:17', 1), + ('657', '2006-02-15T10:09:17', 1), + ('657', '2006-02-15T10:09:17', 2), + ('935', '2006-02-15T10:09:17', 2), + ('935', '2006-02-15T10:09:17', 2) + ) AS data(old_film_id, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."film"' + AND map0.old_id = data.old_film_id + RETURNING inventory_id + ) + SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; + + FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); + END LOOP; + + v_old_ids_inventory := ARRAY['1465', '1459', '1463', '1460', '1461', '1464', '1462', '2941', '2945', '2943', '2944', '2942', '1082', '1081', '1080', '1083', '2443', '2444', '2442', '2424', '2423', '2426', '2425', '1078', '1077', '1079', '3072', '3076', '3073', '3074', '3075', '3071', '4059', '4060', '4058', '3929', '3928', '3933', '3932', '3931', '3934', '3930', '586', '587', '580', '584', '585', '581', '583', '582', '4410', '4412', '4409', '4411', '4413', '3167', '3171', '3169', '3170', '3168', '4271', '4269', '4268', '4270', '4158', '4155', '4152', '4156', '4153', '4154', '4157', '3207', '3208', '3209', '3210', '1951', '1952', '2466', '2465', '2695', '2694', '2693', '2066', '2068', '2067', '2065', '2064', '2469', '2468', '2467', '1770', '1772', '1771', '1310', '1311', '2021', '2018', '2022', '2019', '2020']; + WITH inserted AS ( + INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") + SELECT + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + ('320', '2006-02-15T10:09:17', 2), + ('320', '2006-02-15T10:09:17', 1), + ('320', '2006-02-15T10:09:17', 2), + ('320', '2006-02-15T10:09:17', 1), + ('320', '2006-02-15T10:09:17', 1), + ('320', '2006-02-15T10:09:17', 2), + ('320', '2006-02-15T10:09:17', 2), + ('646', '2006-02-15T10:09:17', 1), + ('646', '2006-02-15T10:09:17', 2), + ('646', '2006-02-15T10:09:17', 1), + ('646', '2006-02-15T10:09:17', 2), + ('646', '2006-02-15T10:09:17', 1), + ('241', '2006-02-15T10:09:17', 1), + ('241', '2006-02-15T10:09:17', 1), + ('241', '2006-02-15T10:09:17', 1), + ('241', '2006-02-15T10:09:17', 1), + ('533', '2006-02-15T10:09:17', 1), + ('533', '2006-02-15T10:09:17', 1), + ('533', '2006-02-15T10:09:17', 1), + ('529', '2006-02-15T10:09:17', 1), + ('529', '2006-02-15T10:09:17', 1), + ('529', '2006-02-15T10:09:17', 1), + ('529', '2006-02-15T10:09:17', 1), + ('240', '2006-02-15T10:09:17', 2), + ('240', '2006-02-15T10:09:17', 2), + ('240', '2006-02-15T10:09:17', 2), + ('676', '2006-02-15T10:09:17', 1), + ('676', '2006-02-15T10:09:17', 2), + ('676', '2006-02-15T10:09:17', 2), + ('676', '2006-02-15T10:09:17', 2), + ('676', '2006-02-15T10:09:17', 2), + ('676', '2006-02-15T10:09:17', 1), + ('884', '2006-02-15T10:09:17', 2), + ('884', '2006-02-15T10:09:17', 2), + ('884', '2006-02-15T10:09:17', 2), + ('857', '2006-02-15T10:09:17', 1), + ('857', '2006-02-15T10:09:17', 1), + ('857', '2006-02-15T10:09:17', 2), + ('857', '2006-02-15T10:09:17', 2), + ('857', '2006-02-15T10:09:17', 2), + ('857', '2006-02-15T10:09:17', 2), + ('857', '2006-02-15T10:09:17', 1), + ('127', '2006-02-15T10:09:17', 2), + ('127', '2006-02-15T10:09:17', 2), + ('127', '2006-02-15T10:09:17', 1), + ('127', '2006-02-15T10:09:17', 2), + ('127', '2006-02-15T10:09:17', 2), + ('127', '2006-02-15T10:09:17', 1), + ('127', '2006-02-15T10:09:17', 1), + ('127', '2006-02-15T10:09:17', 1), + ('964', '2006-02-15T10:09:17', 1), + ('964', '2006-02-15T10:09:17', 2), + ('964', '2006-02-15T10:09:17', 1), + ('964', '2006-02-15T10:09:17', 1), + ('964', '2006-02-15T10:09:17', 2), + ('696', '2006-02-15T10:09:17', 1), + ('696', '2006-02-15T10:09:17', 2), + ('696', '2006-02-15T10:09:17', 2), + ('696', '2006-02-15T10:09:17', 2), + ('696', '2006-02-15T10:09:17', 1), + ('929', '2006-02-15T10:09:17', 1), + ('929', '2006-02-15T10:09:17', 1), + ('929', '2006-02-15T10:09:17', 1), + ('929', '2006-02-15T10:09:17', 1), + ('902', '2006-02-15T10:09:17', 2), + ('902', '2006-02-15T10:09:17', 1), + ('902', '2006-02-15T10:09:17', 1), + ('902', '2006-02-15T10:09:17', 2), + ('902', '2006-02-15T10:09:17', 1), + ('902', '2006-02-15T10:09:17', 1), + ('902', '2006-02-15T10:09:17', 2), + ('705', '2006-02-15T10:09:17', 1), + ('705', '2006-02-15T10:09:17', 1), + ('705', '2006-02-15T10:09:17', 1), + ('705', '2006-02-15T10:09:17', 1), + ('425', '2006-02-15T10:09:17', 2), + ('425', '2006-02-15T10:09:17', 2), + ('539', '2006-02-15T10:09:17', 1), + ('539', '2006-02-15T10:09:17', 1), + ('591', '2006-02-15T10:09:17', 2), + ('591', '2006-02-15T10:09:17', 2), + ('591', '2006-02-15T10:09:17', 2), + ('448', '2006-02-15T10:09:17', 2), + ('448', '2006-02-15T10:09:17', 2), + ('448', '2006-02-15T10:09:17', 2), + ('448', '2006-02-15T10:09:17', 1), + ('448', '2006-02-15T10:09:17', 1), + ('540', '2006-02-15T10:09:17', 1), + ('540', '2006-02-15T10:09:17', 1), + ('540', '2006-02-15T10:09:17', 1), + ('384', '2006-02-15T10:09:17', 2), + ('384', '2006-02-15T10:09:17', 2), + ('384', '2006-02-15T10:09:17', 2), + ('289', '2006-02-15T10:09:17', 1), + ('289', '2006-02-15T10:09:17', 1), + ('439', '2006-02-15T10:09:17', 2), + ('439', '2006-02-15T10:09:17', 1), + ('439', '2006-02-15T10:09:17', 2), + ('439', '2006-02-15T10:09:17', 1), + ('439', '2006-02-15T10:09:17', 1) + ) AS data(old_film_id, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."film"' + AND map0.old_id = data.old_film_id + RETURNING inventory_id + ) + SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; + + FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); + END LOOP; + + v_old_ids_inventory := ARRAY['2017', '870', '869', '867', '871', '872', '868', '433', '435', '434', '1385', '1389', '1384', '1388', '1386', '1387', '1725', '1722', '1726', '1727', '1724', '1723', '1728', '4298', '4294', '4293', '4297', '4296', '4295', '19', '20', '17', '21', '18', '22', '16', '4507', '4506', '3555', '3558', '3553', '3557', '3554', '3556', '986', '987', '988', '985', '992', '989', '991', '990', '4555', '4554', '4556', '845', '846', '786', '789', '787', '784', '785', '788', '783', '2495', '2494', '3818', '3814', '3813', '3817', '3815', '3812', '3816', '3811', '2706', '2704', '2705', '613', '612', '615', '614']; + WITH inserted AS ( + INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") + SELECT + map0.new_id::smallint, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + ('439', '2006-02-15T10:09:17', 1), + ('191', '2006-02-15T10:09:17', 2), + ('191', '2006-02-15T10:09:17', 1), + ('191', '2006-02-15T10:09:17', 1), + ('191', '2006-02-15T10:09:17', 2), + ('191', '2006-02-15T10:09:17', 2), + ('191', '2006-02-15T10:09:17', 1), + ('96', '2006-02-15T10:09:17', 1), + ('96', '2006-02-15T10:09:17', 1), + ('96', '2006-02-15T10:09:17', 1), + ('304', '2006-02-15T10:09:17', 1), + ('304', '2006-02-15T10:09:17', 2), + ('304', '2006-02-15T10:09:17', 1), + ('304', '2006-02-15T10:09:17', 2), + ('304', '2006-02-15T10:09:17', 1), + ('304', '2006-02-15T10:09:17', 1), + ('376', '2006-02-15T10:09:17', 1), + ('376', '2006-02-15T10:09:17', 1), + ('376', '2006-02-15T10:09:17', 2), + ('376', '2006-02-15T10:09:17', 2), + ('376', '2006-02-15T10:09:17', 1), + ('376', '2006-02-15T10:09:17', 1), + ('376', '2006-02-15T10:09:17', 2), + ('936', '2006-02-15T10:09:17', 2), + ('936', '2006-02-15T10:09:17', 1), + ('936', '2006-02-15T10:09:17', 1), + ('936', '2006-02-15T10:09:17', 2), + ('936', '2006-02-15T10:09:17', 2), + ('936', '2006-02-15T10:09:17', 2), + ('4', '2006-02-15T10:09:17', 1), + ('4', '2006-02-15T10:09:17', 2), + ('4', '2006-02-15T10:09:17', 1), + ('4', '2006-02-15T10:09:17', 2), + ('4', '2006-02-15T10:09:17', 1), + ('4', '2006-02-15T10:09:17', 2), + ('4', '2006-02-15T10:09:17', 1), + ('984', '2006-02-15T10:09:17', 1), + ('984', '2006-02-15T10:09:17', 1), + ('777', '2006-02-15T10:09:17', 1), + ('777', '2006-02-15T10:09:17', 2), + ('777', '2006-02-15T10:09:17', 1), + ('777', '2006-02-15T10:09:17', 2), + ('777', '2006-02-15T10:09:17', 1), + ('777', '2006-02-15T10:09:17', 2), + ('220', '2006-02-15T10:09:17', 1), + ('220', '2006-02-15T10:09:17', 1), + ('220', '2006-02-15T10:09:17', 1), + ('220', '2006-02-15T10:09:17', 1), + ('220', '2006-02-15T10:09:17', 2), + ('220', '2006-02-15T10:09:17', 2), + ('220', '2006-02-15T10:09:17', 2), + ('220', '2006-02-15T10:09:17', 2), + ('994', '2006-02-15T10:09:17', 1), + ('994', '2006-02-15T10:09:17', 1), + ('994', '2006-02-15T10:09:17', 1), + ('185', '2006-02-15T10:09:17', 1), + ('185', '2006-02-15T10:09:17', 1), + ('172', '2006-02-15T10:09:17', 1), + ('172', '2006-02-15T10:09:17', 2), + ('172', '2006-02-15T10:09:17', 2), + ('172', '2006-02-15T10:09:17', 1), + ('172', '2006-02-15T10:09:17', 1), + ('172', '2006-02-15T10:09:17', 2), + ('172', '2006-02-15T10:09:17', 1), + ('547', '2006-02-15T10:09:17', 2), + ('547', '2006-02-15T10:09:17', 2), + ('835', '2006-02-15T10:09:17', 2), + ('835', '2006-02-15T10:09:17', 1), + ('835', '2006-02-15T10:09:17', 1), + ('835', '2006-02-15T10:09:17', 2), + ('835', '2006-02-15T10:09:17', 2), + ('835', '2006-02-15T10:09:17', 1), + ('835', '2006-02-15T10:09:17', 2), + ('835', '2006-02-15T10:09:17', 1), + ('594', '2006-02-15T10:09:17', 1), + ('594', '2006-02-15T10:09:17', 1), + ('594', '2006-02-15T10:09:17', 1), + ('133', '2006-02-15T10:09:17', 1), + ('133', '2006-02-15T10:09:17', 1), + ('133', '2006-02-15T10:09:17', 2), + ('133', '2006-02-15T10:09:17', 2) + ) AS data(old_film_id, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."film"' + AND map0.old_id = data.old_film_id + RETURNING inventory_id + ) + SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; + + FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); + END LOOP; + + -- Table: "public"."film_actor" (5462 records) + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('60', '805', '2006-02-15T10:05:03'), + ('129', '805', '2006-02-15T10:05:03'), + ('27', '805', '2006-02-15T10:05:03'), + ('7', '805', '2006-02-15T10:05:03'), + ('79', '853', '2006-02-15T10:05:03'), + ('17', '853', '2006-02-15T10:05:03'), + ('34', '853', '2006-02-15T10:05:03'), + ('59', '853', '2006-02-15T10:05:03'), + ('174', '853', '2006-02-15T10:05:03'), + ('23', '853', '2006-02-15T10:05:03'), + ('37', '853', '2006-02-15T10:05:03'), + ('38', '853', '2006-02-15T10:05:03'), + ('189', '853', '2006-02-15T10:05:03'), + ('35', '817', '2006-02-15T10:05:03'), + ('5', '817', '2006-02-15T10:05:03'), + ('90', '817', '2006-02-15T10:05:03'), + ('112', '817', '2006-02-15T10:05:03'), + ('13', '817', '2006-02-15T10:05:03'), + ('198', '817', '2006-02-15T10:05:03'), + ('153', '817', '2006-02-15T10:05:03'), + ('179', '817', '2006-02-15T10:05:03'), + ('15', '817', '2006-02-15T10:05:03'), + ('50', '732', '2006-02-15T10:05:03'), + ('179', '732', '2006-02-15T10:05:03'), + ('30', '732', '2006-02-15T10:05:03'), + ('5', '732', '2006-02-15T10:05:03'), + ('35', '732', '2006-02-15T10:05:03'), + ('180', '732', '2006-02-15T10:05:03'), + ('111', '732', '2006-02-15T10:05:03'), + ('26', '732', '2006-02-15T10:05:03'), + ('113', '732', '2006-02-15T10:05:03'), + ('153', '732', '2006-02-15T10:05:03'), + ('109', '732', '2006-02-15T10:05:03'), + ('179', '65', '2006-02-15T10:05:03'), + ('135', '65', '2006-02-15T10:05:03'), + ('45', '65', '2006-02-15T10:05:03'), + ('32', '65', '2006-02-15T10:05:03'), + ('95', '65', '2006-02-15T10:05:03'), + ('134', '915', '2006-02-15T10:05:03'), + ('36', '915', '2006-02-15T10:05:03'), + ('67', '915', '2006-02-15T10:05:03'), + ('105', '915', '2006-02-15T10:05:03'), + ('66', '915', '2006-02-15T10:05:03'), + ('52', '915', '2006-02-15T10:05:03'), + ('104', '999', '2006-02-15T10:05:03'), + ('52', '999', '2006-02-15T10:05:03'), + ('142', '999', '2006-02-15T10:05:03'), + ('140', '999', '2006-02-15T10:05:03'), + ('66', '999', '2006-02-15T10:05:03'), + ('92', '564', '2006-02-15T10:05:03'), + ('25', '564', '2006-02-15T10:05:03'), + ('137', '564', '2006-02-15T10:05:03'), + ('169', '564', '2006-02-15T10:05:03'), + ('89', '564', '2006-02-15T10:05:03'), + ('81', '564', '2006-02-15T10:05:03'), + ('128', '564', '2006-02-15T10:05:03'), + ('26', '564', '2006-02-15T10:05:03'), + ('173', '564', '2006-02-15T10:05:03'), + ('91', '176', '2006-02-15T10:05:03'), + ('38', '176', '2006-02-15T10:05:03'), + ('44', '176', '2006-02-15T10:05:03'), + ('108', '655', '2006-02-15T10:05:03'), + ('83', '655', '2006-02-15T10:05:03'), + ('134', '655', '2006-02-15T10:05:03'), + ('101', '655', '2006-02-15T10:05:03'), + ('161', '655', '2006-02-15T10:05:03'), + ('168', '32', '2006-02-15T10:05:03'), + ('162', '32', '2006-02-15T10:05:03'), + ('79', '32', '2006-02-15T10:05:03'), + ('183', '32', '2006-02-15T10:05:03'), + ('158', '32', '2006-02-15T10:05:03'), + ('150', '75', '2006-02-15T10:05:03'), + ('55', '75', '2006-02-15T10:05:03'), + ('24', '653', '2006-02-15T10:05:03'), + ('161', '653', '2006-02-15T10:05:03'), + ('116', '653', '2006-02-15T10:05:03'), + ('175', '362', '2006-02-15T10:05:03'), + ('149', '362', '2006-02-15T10:05:03'), + ('182', '362', '2006-02-15T10:05:03'), + ('80', '362', '2006-02-15T10:05:03'), + ('61', '362', '2006-02-15T10:05:03'), + ('71', '362', '2006-02-15T10:05:03'), + ('159', '789', '2006-02-15T10:05:03'), + ('157', '642', '2006-02-15T10:05:03'), + ('169', '642', '2006-02-15T10:05:03'), + ('76', '642', '2006-02-15T10:05:03'), + ('100', '642', '2006-02-15T10:05:03'), + ('184', '642', '2006-02-15T10:05:03'), + ('113', '642', '2006-02-15T10:05:03'), + ('120', '642', '2006-02-15T10:05:03'), + ('130', '930', '2006-02-15T10:05:03'), + ('10', '930', '2006-02-15T10:05:03'), + ('178', '930', '2006-02-15T10:05:03'), + ('97', '930', '2006-02-15T10:05:03'), + ('132', '930', '2006-02-15T10:05:03'), + ('55', '930', '2006-02-15T10:05:03'), + ('128', '82', '2006-02-15T10:05:03'), + ('132', '82', '2006-02-15T10:05:03'), + ('189', '82', '2006-02-15T10:05:03'), + ('159', '82', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('57', '34', '2006-02-15T10:05:03'), + ('40', '34', '2006-02-15T10:05:03'), + ('178', '34', '2006-02-15T10:05:03'), + ('126', '34', '2006-02-15T10:05:03'), + ('157', '34', '2006-02-15T10:05:03'), + ('102', '34', '2006-02-15T10:05:03'), + ('72', '34', '2006-02-15T10:05:03'), + ('112', '34', '2006-02-15T10:05:03'), + ('75', '34', '2006-02-15T10:05:03'), + ('12', '34', '2006-02-15T10:05:03'), + ('26', '34', '2006-02-15T10:05:03'), + ('27', '34', '2006-02-15T10:05:03'), + ('40', '233', '2006-02-15T10:05:03'), + ('47', '233', '2006-02-15T10:05:03'), + ('104', '233', '2006-02-15T10:05:03'), + ('150', '233', '2006-02-15T10:05:03'), + ('71', '233', '2006-02-15T10:05:03'), + ('181', '233', '2006-02-15T10:05:03'), + ('139', '233', '2006-02-15T10:05:03'), + ('48', '792', '2006-02-15T10:05:03'), + ('148', '792', '2006-02-15T10:05:03'), + ('143', '792', '2006-02-15T10:05:03'), + ('4', '355', '2006-02-15T10:05:03'), + ('69', '761', '2006-02-15T10:05:03'), + ('85', '761', '2006-02-15T10:05:03'), + ('149', '761', '2006-02-15T10:05:03'), + ('81', '761', '2006-02-15T10:05:03'), + ('171', '761', '2006-02-15T10:05:03'), + ('185', '761', '2006-02-15T10:05:03'), + ('196', '575', '2006-02-15T10:05:03'), + ('142', '575', '2006-02-15T10:05:03'), + ('111', '643', '2006-02-15T10:05:03'), + ('103', '643', '2006-02-15T10:05:03'), + ('81', '643', '2006-02-15T10:05:03'), + ('20', '643', '2006-02-15T10:05:03'), + ('107', '454', '2006-02-15T10:05:03'), + ('14', '454', '2006-02-15T10:05:03'), + ('119', '454', '2006-02-15T10:05:03'), + ('39', '71', '2006-02-15T10:05:03'), + ('183', '71', '2006-02-15T10:05:03'), + ('93', '71', '2006-02-15T10:05:03'), + ('29', '488', '2006-02-15T10:05:03'), + ('89', '488', '2006-02-15T10:05:03'), + ('106', '108', '2006-02-15T10:05:03'), + ('52', '108', '2006-02-15T10:05:03'), + ('15', '108', '2006-02-15T10:05:03'), + ('15', '91', '2006-02-15T10:05:03'), + ('12', '91', '2006-02-15T10:05:03'), + ('181', '387', '2006-02-15T10:05:03'), + ('36', '387', '2006-02-15T10:05:03'), + ('168', '387', '2006-02-15T10:05:03'), + ('78', '387', '2006-02-15T10:05:03'), + ('155', '387', '2006-02-15T10:05:03'), + ('17', '959', '2006-02-15T10:05:03'), + ('172', '959', '2006-02-15T10:05:03'), + ('190', '959', '2006-02-15T10:05:03'), + ('184', '959', '2006-02-15T10:05:03'), + ('168', '959', '2006-02-15T10:05:03'), + ('7', '959', '2006-02-15T10:05:03'), + ('8', '458', '2006-02-15T10:05:03'), + ('77', '458', '2006-02-15T10:05:03'), + ('107', '458', '2006-02-15T10:05:03'), + ('38', '458', '2006-02-15T10:05:03'), + ('149', '458', '2006-02-15T10:05:03'), + ('176', '458', '2006-02-15T10:05:03'), + ('177', '458', '2006-02-15T10:05:03'), + ('2', '458', '2006-02-15T10:05:03'), + ('135', '458', '2006-02-15T10:05:03'), + ('81', '458', '2006-02-15T10:05:03'), + ('56', '728', '2006-02-15T10:05:03'), + ('150', '728', '2006-02-15T10:05:03'), + ('112', '728', '2006-02-15T10:05:03'), + ('12', '728', '2006-02-15T10:05:03'), + ('97', '728', '2006-02-15T10:05:03'), + ('92', '728', '2006-02-15T10:05:03'), + ('102', '728', '2006-02-15T10:05:03'), + ('74', '704', '2006-02-15T10:05:03'), + ('24', '704', '2006-02-15T10:05:03'), + ('160', '950', '2006-02-15T10:05:03'), + ('34', '950', '2006-02-15T10:05:03'), + ('94', '950', '2006-02-15T10:05:03'), + ('73', '950', '2006-02-15T10:05:03'), + ('197', '950', '2006-02-15T10:05:03'), + ('197', '752', '2006-02-15T10:05:03'), + ('9', '752', '2006-02-15T10:05:03'), + ('19', '752', '2006-02-15T10:05:03'), + ('141', '752', '2006-02-15T10:05:03'), + ('61', '752', '2006-02-15T10:05:03'), + ('86', '752', '2006-02-15T10:05:03'), + ('106', '752', '2006-02-15T10:05:03'), + ('8', '752', '2006-02-15T10:05:03'), + ('159', '818', '2006-02-15T10:05:03'), + ('185', '818', '2006-02-15T10:05:03'), + ('136', '818', '2006-02-15T10:05:03'), + ('16', '583', '2006-02-15T10:05:03'), + ('138', '583', '2006-02-15T10:05:03'), + ('38', '583', '2006-02-15T10:05:03'), + ('25', '583', '2006-02-15T10:05:03'), + ('104', '583', '2006-02-15T10:05:03'), + ('132', '626', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('168', '626', '2006-02-15T10:05:03'), + ('74', '626', '2006-02-15T10:05:03'), + ('15', '626', '2006-02-15T10:05:03'), + ('158', '626', '2006-02-15T10:05:03'), + ('167', '626', '2006-02-15T10:05:03'), + ('191', '834', '2006-02-15T10:05:03'), + ('68', '834', '2006-02-15T10:05:03'), + ('164', '834', '2006-02-15T10:05:03'), + ('193', '834', '2006-02-15T10:05:03'), + ('129', '834', '2006-02-15T10:05:03'), + ('70', '834', '2006-02-15T10:05:03'), + ('74', '834', '2006-02-15T10:05:03'), + ('178', '160', '2006-02-15T10:05:03'), + ('182', '160', '2006-02-15T10:05:03'), + ('38', '160', '2006-02-15T10:05:03'), + ('137', '160', '2006-02-15T10:05:03'), + ('178', '483', '2006-02-15T10:05:03'), + ('158', '483', '2006-02-15T10:05:03'), + ('175', '483', '2006-02-15T10:05:03'), + ('22', '483', '2006-02-15T10:05:03'), + ('106', '189', '2006-02-15T10:05:03'), + ('197', '189', '2006-02-15T10:05:03'), + ('101', '189', '2006-02-15T10:05:03'), + ('103', '822', '2006-02-15T10:05:03'), + ('145', '822', '2006-02-15T10:05:03'), + ('169', '248', '2006-02-15T10:05:03'), + ('142', '248', '2006-02-15T10:05:03'), + ('152', '248', '2006-02-15T10:05:03'), + ('63', '248', '2006-02-15T10:05:03'), + ('50', '248', '2006-02-15T10:05:03'), + ('159', '248', '2006-02-15T10:05:03'), + ('150', '647', '2006-02-15T10:05:03'), + ('116', '647', '2006-02-15T10:05:03'), + ('131', '647', '2006-02-15T10:05:03'), + ('140', '647', '2006-02-15T10:05:03'), + ('186', '228', '2006-02-15T10:05:03'), + ('144', '228', '2006-02-15T10:05:03'), + ('94', '228', '2006-02-15T10:05:03'), + ('105', '29', '2006-02-15T10:05:03'), + ('6', '29', '2006-02-15T10:05:03'), + ('122', '29', '2006-02-15T10:05:03'), + ('13', '29', '2006-02-15T10:05:03'), + ('197', '29', '2006-02-15T10:05:03'), + ('187', '29', '2006-02-15T10:05:03'), + ('175', '29', '2006-02-15T10:05:03'), + ('90', '520', '2006-02-15T10:05:03'), + ('129', '520', '2006-02-15T10:05:03'), + ('86', '520', '2006-02-15T10:05:03'), + ('107', '520', '2006-02-15T10:05:03'), + ('50', '520', '2006-02-15T10:05:03'), + ('195', '520', '2006-02-15T10:05:03'), + ('183', '520', '2006-02-15T10:05:03'), + ('78', '520', '2006-02-15T10:05:03'), + ('118', '969', '2006-02-15T10:05:03'), + ('146', '969', '2006-02-15T10:05:03'), + ('77', '969', '2006-02-15T10:05:03'), + ('24', '969', '2006-02-15T10:05:03'), + ('184', '969', '2006-02-15T10:05:03'), + ('113', '969', '2006-02-15T10:05:03'), + ('11', '969', '2006-02-15T10:05:03'), + ('72', '969', '2006-02-15T10:05:03'), + ('191', '969', '2006-02-15T10:05:03'), + ('127', '411', '2006-02-15T10:05:03'), + ('5', '411', '2006-02-15T10:05:03'), + ('100', '411', '2006-02-15T10:05:03'), + ('190', '411', '2006-02-15T10:05:03'), + ('185', '411', '2006-02-15T10:05:03'), + ('25', '411', '2006-02-15T10:05:03'), + ('25', '755', '2006-02-15T10:05:03'), + ('160', '755', '2006-02-15T10:05:03'), + ('58', '755', '2006-02-15T10:05:03'), + ('97', '755', '2006-02-15T10:05:03'), + ('151', '501', '2006-02-15T10:05:03'), + ('142', '501', '2006-02-15T10:05:03'), + ('38', '501', '2006-02-15T10:05:03'), + ('161', '247', '2006-02-15T10:05:03'), + ('129', '247', '2006-02-15T10:05:03'), + ('83', '247', '2006-02-15T10:05:03'), + ('82', '247', '2006-02-15T10:05:03'), + ('198', '186', '2006-02-15T10:05:03'), + ('60', '186', '2006-02-15T10:05:03'), + ('142', '186', '2006-02-15T10:05:03'), + ('121', '186', '2006-02-15T10:05:03'), + ('26', '186', '2006-02-15T10:05:03'), + ('81', '186', '2006-02-15T10:05:03'), + ('87', '654', '2006-02-15T10:05:03'), + ('68', '654', '2006-02-15T10:05:03'), + ('121', '654', '2006-02-15T10:05:03'), + ('70', '654', '2006-02-15T10:05:03'), + ('112', '654', '2006-02-15T10:05:03'), + ('106', '654', '2006-02-15T10:05:03'), + ('122', '654', '2006-02-15T10:05:03'), + ('186', '654', '2006-02-15T10:05:03'), + ('66', '769', '2006-02-15T10:05:03'), + ('197', '769', '2006-02-15T10:05:03'), + ('195', '769', '2006-02-15T10:05:03'), + ('56', '769', '2006-02-15T10:05:03'), + ('160', '769', '2006-02-15T10:05:03'), + ('79', '769', '2006-02-15T10:05:03'), + ('179', '769', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('8', '769', '2006-02-15T10:05:03'), + ('54', '858', '2006-02-15T10:05:03'), + ('119', '858', '2006-02-15T10:05:03'), + ('198', '858', '2006-02-15T10:05:03'), + ('4', '858', '2006-02-15T10:05:03'), + ('124', '858', '2006-02-15T10:05:03'), + ('58', '858', '2006-02-15T10:05:03'), + ('90', '858', '2006-02-15T10:05:03'), + ('105', '858', '2006-02-15T10:05:03'), + ('191', '858', '2006-02-15T10:05:03'), + ('80', '858', '2006-02-15T10:05:03'), + ('106', '858', '2006-02-15T10:05:03'), + ('189', '509', '2006-02-15T10:05:03'), + ('119', '509', '2006-02-15T10:05:03'), + ('1', '509', '2006-02-15T10:05:03'), + ('91', '509', '2006-02-15T10:05:03'), + ('6', '509', '2006-02-15T10:05:03'), + ('140', '509', '2006-02-15T10:05:03'), + ('194', '352', '2006-02-15T10:05:03'), + ('174', '352', '2006-02-15T10:05:03'), + ('193', '352', '2006-02-15T10:05:03'), + ('163', '394', '2006-02-15T10:05:03'), + ('40', '394', '2006-02-15T10:05:03'), + ('119', '394', '2006-02-15T10:05:03'), + ('104', '394', '2006-02-15T10:05:03'), + ('147', '394', '2006-02-15T10:05:03'), + ('140', '599', '2006-02-15T10:05:03'), + ('144', '599', '2006-02-15T10:05:03'), + ('78', '599', '2006-02-15T10:05:03'), + ('87', '599', '2006-02-15T10:05:03'), + ('48', '599', '2006-02-15T10:05:03'), + ('161', '526', '2006-02-15T10:05:03'), + ('102', '526', '2006-02-15T10:05:03'), + ('80', '979', '2006-02-15T10:05:03'), + ('197', '979', '2006-02-15T10:05:03'), + ('102', '979', '2006-02-15T10:05:03'), + ('100', '979', '2006-02-15T10:05:03'), + ('19', '182', '2006-02-15T10:05:03'), + ('89', '182', '2006-02-15T10:05:03'), + ('34', '182', '2006-02-15T10:05:03'), + ('6', '451', '2006-02-15T10:05:03'), + ('174', '451', '2006-02-15T10:05:03'), + ('151', '451', '2006-02-15T10:05:03'), + ('90', '451', '2006-02-15T10:05:03'), + ('116', '451', '2006-02-15T10:05:03'), + ('100', '992', '2006-02-15T10:05:03'), + ('149', '992', '2006-02-15T10:05:03'), + ('141', '992', '2006-02-15T10:05:03'), + ('169', '992', '2006-02-15T10:05:03'), + ('72', '331', '2006-02-15T10:05:03'), + ('86', '331', '2006-02-15T10:05:03'), + ('68', '331', '2006-02-15T10:05:03'), + ('146', '278', '2006-02-15T10:05:03'), + ('190', '278', '2006-02-15T10:05:03'), + ('63', '278', '2006-02-15T10:05:03'), + ('134', '278', '2006-02-15T10:05:03'), + ('108', '278', '2006-02-15T10:05:03'), + ('92', '381', '2006-02-15T10:05:03'), + ('119', '381', '2006-02-15T10:05:03'), + ('181', '381', '2006-02-15T10:05:03'), + ('13', '381', '2006-02-15T10:05:03'), + ('99', '381', '2006-02-15T10:05:03'), + ('36', '381', '2006-02-15T10:05:03'), + ('74', '117', '2006-02-15T10:05:03'), + ('146', '117', '2006-02-15T10:05:03'), + ('89', '117', '2006-02-15T10:05:03'), + ('65', '117', '2006-02-15T10:05:03'), + ('45', '117', '2006-02-15T10:05:03'), + ('192', '117', '2006-02-15T10:05:03'), + ('23', '117', '2006-02-15T10:05:03'), + ('99', '414', '2006-02-15T10:05:03'), + ('125', '414', '2006-02-15T10:05:03'), + ('7', '414', '2006-02-15T10:05:03'), + ('70', '414', '2006-02-15T10:05:03'), + ('100', '414', '2006-02-15T10:05:03'), + ('111', '414', '2006-02-15T10:05:03'), + ('120', '414', '2006-02-15T10:05:03'), + ('161', '414', '2006-02-15T10:05:03'), + ('84', '414', '2006-02-15T10:05:03'), + ('15', '414', '2006-02-15T10:05:03'), + ('23', '414', '2006-02-15T10:05:03'), + ('136', '414', '2006-02-15T10:05:03'), + ('11', '597', '2006-02-15T10:05:03'), + ('198', '597', '2006-02-15T10:05:03'), + ('13', '597', '2006-02-15T10:05:03'), + ('64', '597', '2006-02-15T10:05:03'), + ('184', '597', '2006-02-15T10:05:03'), + ('129', '597', '2006-02-15T10:05:03'), + ('28', '597', '2006-02-15T10:05:03'), + ('114', '305', '2006-02-15T10:05:03'), + ('168', '305', '2006-02-15T10:05:03'), + ('147', '305', '2006-02-15T10:05:03'), + ('41', '305', '2006-02-15T10:05:03'), + ('65', '305', '2006-02-15T10:05:03'), + ('33', '305', '2006-02-15T10:05:03'), + ('2', '105', '2006-02-15T10:05:03'), + ('150', '105', '2006-02-15T10:05:03'), + ('144', '105', '2006-02-15T10:05:03'), + ('23', '105', '2006-02-15T10:05:03'), + ('123', '105', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('116', '105', '2006-02-15T10:05:03'), + ('29', '105', '2006-02-15T10:05:03'), + ('43', '105', '2006-02-15T10:05:03'), + ('114', '68', '2006-02-15T10:05:03'), + ('166', '68', '2006-02-15T10:05:03'), + ('58', '68', '2006-02-15T10:05:03'), + ('76', '68', '2006-02-15T10:05:03'), + ('71', '450', '2006-02-15T10:05:03'), + ('72', '450', '2006-02-15T10:05:03'), + ('125', '450', '2006-02-15T10:05:03'), + ('198', '450', '2006-02-15T10:05:03'), + ('131', '450', '2006-02-15T10:05:03'), + ('38', '450', '2006-02-15T10:05:03'), + ('171', '450', '2006-02-15T10:05:03'), + ('112', '450', '2006-02-15T10:05:03'), + ('168', '841', '2006-02-15T10:05:03'), + ('114', '841', '2006-02-15T10:05:03'), + ('137', '841', '2006-02-15T10:05:03'), + ('5', '841', '2006-02-15T10:05:03'), + ('101', '841', '2006-02-15T10:05:03'), + ('29', '449', '2006-02-15T10:05:03'), + ('23', '449', '2006-02-15T10:05:03'), + ('124', '449', '2006-02-15T10:05:03'), + ('121', '449', '2006-02-15T10:05:03'), + ('172', '487', '2006-02-15T10:05:03'), + ('145', '487', '2006-02-15T10:05:03'), + ('162', '7', '2006-02-15T10:05:03'), + ('99', '7', '2006-02-15T10:05:03'), + ('185', '7', '2006-02-15T10:05:03'), + ('133', '7', '2006-02-15T10:05:03'), + ('170', '7', '2006-02-15T10:05:03'), + ('9', '889', '2006-02-15T10:05:03'), + ('150', '889', '2006-02-15T10:05:03'), + ('46', '889', '2006-02-15T10:05:03'), + ('92', '889', '2006-02-15T10:05:03'), + ('168', '889', '2006-02-15T10:05:03'), + ('27', '889', '2006-02-15T10:05:03'), + ('78', '457', '2006-02-15T10:05:03'), + ('94', '457', '2006-02-15T10:05:03'), + ('17', '457', '2006-02-15T10:05:03'), + ('145', '457', '2006-02-15T10:05:03'), + ('56', '457', '2006-02-15T10:05:03'), + ('62', '457', '2006-02-15T10:05:03'), + ('106', '457', '2006-02-15T10:05:03'), + ('12', '457', '2006-02-15T10:05:03'), + ('143', '457', '2006-02-15T10:05:03'), + ('82', '839', '2006-02-15T10:05:03'), + ('37', '839', '2006-02-15T10:05:03'), + ('38', '839', '2006-02-15T10:05:03'), + ('176', '839', '2006-02-15T10:05:03'), + ('127', '839', '2006-02-15T10:05:03'), + ('68', '839', '2006-02-15T10:05:03'), + ('88', '839', '2006-02-15T10:05:03'), + ('41', '894', '2006-02-15T10:05:03'), + ('169', '894', '2006-02-15T10:05:03'), + ('106', '894', '2006-02-15T10:05:03'), + ('158', '894', '2006-02-15T10:05:03'), + ('133', '894', '2006-02-15T10:05:03'), + ('111', '894', '2006-02-15T10:05:03'), + ('144', '894', '2006-02-15T10:05:03'), + ('120', '894', '2006-02-15T10:05:03'), + ('108', '894', '2006-02-15T10:05:03'), + ('165', '146', '2006-02-15T10:05:03'), + ('37', '146', '2006-02-15T10:05:03'), + ('166', '146', '2006-02-15T10:05:03'), + ('188', '146', '2006-02-15T10:05:03'), + ('171', '146', '2006-02-15T10:05:03'), + ('101', '146', '2006-02-15T10:05:03'), + ('184', '146', '2006-02-15T10:05:03'), + ('5', '146', '2006-02-15T10:05:03'), + ('178', '146', '2006-02-15T10:05:03'), + ('20', '146', '2006-02-15T10:05:03'), + ('22', '146', '2006-02-15T10:05:03'), + ('31', '146', '2006-02-15T10:05:03'), + ('149', '146', '2006-02-15T10:05:03'), + ('45', '508', '2006-02-15T10:05:03'), + ('28', '508', '2006-02-15T10:05:03'), + ('186', '508', '2006-02-15T10:05:03'), + ('47', '508', '2006-02-15T10:05:03'), + ('61', '508', '2006-02-15T10:05:03'), + ('37', '508', '2006-02-15T10:05:03'), + ('102', '508', '2006-02-15T10:05:03'), + ('147', '508', '2006-02-15T10:05:03'), + ('53', '508', '2006-02-15T10:05:03'), + ('150', '508', '2006-02-15T10:05:03'), + ('170', '508', '2006-02-15T10:05:03'), + ('75', '508', '2006-02-15T10:05:03'), + ('111', '508', '2006-02-15T10:05:03'), + ('138', '508', '2006-02-15T10:05:03'), + ('81', '508', '2006-02-15T10:05:03'), + ('117', '578', '2006-02-15T10:05:03'), + ('58', '578', '2006-02-15T10:05:03'), + ('81', '578', '2006-02-15T10:05:03'), + ('152', '578', '2006-02-15T10:05:03'), + ('192', '578', '2006-02-15T10:05:03'), + ('125', '623', '2006-02-15T10:05:03'), + ('72', '623', '2006-02-15T10:05:03'), + ('86', '623', '2006-02-15T10:05:03'), + ('190', '623', '2006-02-15T10:05:03'), + ('33', '735', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('103', '735', '2006-02-15T10:05:03'), + ('118', '735', '2006-02-15T10:05:03'), + ('142', '735', '2006-02-15T10:05:03'), + ('65', '735', '2006-02-15T10:05:03'), + ('9', '200', '2006-02-15T10:05:03'), + ('102', '200', '2006-02-15T10:05:03'), + ('139', '200', '2006-02-15T10:05:03'), + ('18', '808', '2006-02-15T10:05:03'), + ('86', '808', '2006-02-15T10:05:03'), + ('136', '808', '2006-02-15T10:05:03'), + ('73', '275', '2006-02-15T10:05:03'), + ('15', '275', '2006-02-15T10:05:03'), + ('101', '275', '2006-02-15T10:05:03'), + ('160', '275', '2006-02-15T10:05:03'), + ('94', '275', '2006-02-15T10:05:03'), + ('64', '3', '2006-02-15T10:05:03'), + ('123', '3', '2006-02-15T10:05:03'), + ('2', '3', '2006-02-15T10:05:03'), + ('19', '3', '2006-02-15T10:05:03'), + ('24', '3', '2006-02-15T10:05:03'), + ('86', '519', '2006-02-15T10:05:03'), + ('29', '519', '2006-02-15T10:05:03'), + ('83', '519', '2006-02-15T10:05:03'), + ('61', '519', '2006-02-15T10:05:03'), + ('189', '519', '2006-02-15T10:05:03'), + ('168', '519', '2006-02-15T10:05:03'), + ('6', '519', '2006-02-15T10:05:03'), + ('173', '921', '2006-02-15T10:05:03'), + ('113', '921', '2006-02-15T10:05:03'), + ('181', '921', '2006-02-15T10:05:03'), + ('131', '921', '2006-02-15T10:05:03'), + ('149', '921', '2006-02-15T10:05:03'), + ('64', '921', '2006-02-15T10:05:03'), + ('161', '921', '2006-02-15T10:05:03'), + ('181', '456', '2006-02-15T10:05:03'), + ('46', '456', '2006-02-15T10:05:03'), + ('16', '456', '2006-02-15T10:05:03'), + ('39', '456', '2006-02-15T10:05:03'), + ('13', '456', '2006-02-15T10:05:03'), + ('90', '663', '2006-02-15T10:05:03'), + ('20', '663', '2006-02-15T10:05:03'), + ('74', '663', '2006-02-15T10:05:03'), + ('37', '663', '2006-02-15T10:05:03'), + ('17', '770', '2006-02-15T10:05:03'), + ('188', '770', '2006-02-15T10:05:03'), + ('7', '770', '2006-02-15T10:05:03'), + ('131', '770', '2006-02-15T10:05:03'), + ('47', '770', '2006-02-15T10:05:03'), + ('32', '651', '2006-02-15T10:05:03'), + ('191', '296', '2006-02-15T10:05:03'), + ('171', '296', '2006-02-15T10:05:03'), + ('146', '296', '2006-02-15T10:05:03'), + ('68', '296', '2006-02-15T10:05:03'), + ('29', '296', '2006-02-15T10:05:03'), + ('72', '296', '2006-02-15T10:05:03'), + ('46', '296', '2006-02-15T10:05:03'), + ('85', '296', '2006-02-15T10:05:03'), + ('60', '142', '2006-02-15T10:05:03'), + ('21', '142', '2006-02-15T10:05:03'), + ('42', '890', '2006-02-15T10:05:03'), + ('155', '890', '2006-02-15T10:05:03'), + ('175', '890', '2006-02-15T10:05:03'), + ('14', '890', '2006-02-15T10:05:03'), + ('113', '890', '2006-02-15T10:05:03'), + ('53', '727', '2006-02-15T10:05:03'), + ('79', '727', '2006-02-15T10:05:03'), + ('133', '727', '2006-02-15T10:05:03'), + ('127', '727', '2006-02-15T10:05:03'), + ('169', '727', '2006-02-15T10:05:03'), + ('187', '98', '2006-02-15T10:05:03'), + ('194', '98', '2006-02-15T10:05:03'), + ('111', '98', '2006-02-15T10:05:03'), + ('125', '98', '2006-02-15T10:05:03'), + ('144', '668', '2006-02-15T10:05:03'), + ('182', '668', '2006-02-15T10:05:03'), + ('34', '668', '2006-02-15T10:05:03'), + ('191', '668', '2006-02-15T10:05:03'), + ('88', '668', '2006-02-15T10:05:03'), + ('184', '492', '2006-02-15T10:05:03'), + ('116', '492', '2006-02-15T10:05:03'), + ('75', '492', '2006-02-15T10:05:03'), + ('189', '492', '2006-02-15T10:05:03'), + ('53', '492', '2006-02-15T10:05:03'), + ('20', '492', '2006-02-15T10:05:03'), + ('170', '322', '2006-02-15T10:05:03'), + ('113', '322', '2006-02-15T10:05:03'), + ('124', '322', '2006-02-15T10:05:03'), + ('44', '322', '2006-02-15T10:05:03'), + ('94', '322', '2006-02-15T10:05:03'), + ('188', '322', '2006-02-15T10:05:03'), + ('99', '322', '2006-02-15T10:05:03'), + ('73', '322', '2006-02-15T10:05:03'), + ('112', '322', '2006-02-15T10:05:03'), + ('194', '86', '2006-02-15T10:05:03'), + ('177', '86', '2006-02-15T10:05:03'), + ('41', '86', '2006-02-15T10:05:03'), + ('25', '86', '2006-02-15T10:05:03'), + ('78', '86', '2006-02-15T10:05:03'), + ('166', '86', '2006-02-15T10:05:03'), + ('164', '832', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('96', '832', '2006-02-15T10:05:03'), + ('24', '832', '2006-02-15T10:05:03'), + ('4', '832', '2006-02-15T10:05:03'), + ('165', '832', '2006-02-15T10:05:03'), + ('137', '832', '2006-02-15T10:05:03'), + ('61', '832', '2006-02-15T10:05:03'), + ('1', '832', '2006-02-15T10:05:03'), + ('13', '832', '2006-02-15T10:05:03'), + ('64', '832', '2006-02-15T10:05:03'), + ('193', '291', '2006-02-15T10:05:03'), + ('144', '291', '2006-02-15T10:05:03'), + ('64', '291', '2006-02-15T10:05:03'), + ('179', '291', '2006-02-15T10:05:03'), + ('22', '291', '2006-02-15T10:05:03'), + ('157', '291', '2006-02-15T10:05:03'), + ('112', '796', '2006-02-15T10:05:03'), + ('99', '796', '2006-02-15T10:05:03'), + ('107', '796', '2006-02-15T10:05:03'), + ('198', '796', '2006-02-15T10:05:03'), + ('102', '796', '2006-02-15T10:05:03'), + ('100', '563', '2006-02-15T10:05:03'), + ('177', '563', '2006-02-15T10:05:03'), + ('147', '563', '2006-02-15T10:05:03'), + ('67', '242', '2006-02-15T10:05:03'), + ('79', '242', '2006-02-15T10:05:03'), + ('160', '242', '2006-02-15T10:05:03'), + ('24', '242', '2006-02-15T10:05:03'), + ('58', '242', '2006-02-15T10:05:03'), + ('108', '242', '2006-02-15T10:05:03'), + ('44', '242', '2006-02-15T10:05:03'), + ('82', '242', '2006-02-15T10:05:03'), + ('60', '658', '2006-02-15T10:05:03'), + ('121', '658', '2006-02-15T10:05:03'), + ('65', '658', '2006-02-15T10:05:03'), + ('151', '658', '2006-02-15T10:05:03'), + ('54', '658', '2006-02-15T10:05:03'), + ('195', '658', '2006-02-15T10:05:03'), + ('32', '199', '2006-02-15T10:05:03'), + ('126', '199', '2006-02-15T10:05:03'), + ('17', '199', '2006-02-15T10:05:03'), + ('142', '199', '2006-02-15T10:05:03'), + ('24', '199', '2006-02-15T10:05:03'), + ('103', '199', '2006-02-15T10:05:03'), + ('87', '199', '2006-02-15T10:05:03'), + ('58', '199', '2006-02-15T10:05:03'), + ('30', '797', '2006-02-15T10:05:03'), + ('45', '797', '2006-02-15T10:05:03'), + ('174', '797', '2006-02-15T10:05:03'), + ('117', '797', '2006-02-15T10:05:03'), + ('141', '787', '2006-02-15T10:05:03'), + ('184', '787', '2006-02-15T10:05:03'), + ('47', '787', '2006-02-15T10:05:03'), + ('82', '787', '2006-02-15T10:05:03'), + ('101', '787', '2006-02-15T10:05:03'), + ('147', '139', '2006-02-15T10:05:03'), + ('142', '139', '2006-02-15T10:05:03'), + ('170', '139', '2006-02-15T10:05:03'), + ('149', '139', '2006-02-15T10:05:03'), + ('42', '139', '2006-02-15T10:05:03'), + ('89', '976', '2006-02-15T10:05:03'), + ('179', '976', '2006-02-15T10:05:03'), + ('187', '976', '2006-02-15T10:05:03'), + ('38', '619', '2006-02-15T10:05:03'), + ('81', '619', '2006-02-15T10:05:03'), + ('28', '619', '2006-02-15T10:05:03'), + ('114', '619', '2006-02-15T10:05:03'), + ('80', '619', '2006-02-15T10:05:03'), + ('95', '619', '2006-02-15T10:05:03'), + ('168', '619', '2006-02-15T10:05:03'), + ('149', '118', '2006-02-15T10:05:03'), + ('37', '118', '2006-02-15T10:05:03'), + ('11', '118', '2006-02-15T10:05:03'), + ('100', '118', '2006-02-15T10:05:03'), + ('80', '118', '2006-02-15T10:05:03'), + ('103', '118', '2006-02-15T10:05:03'), + ('182', '940', '2006-02-15T10:05:03'), + ('189', '940', '2006-02-15T10:05:03'), + ('194', '940', '2006-02-15T10:05:03'), + ('88', '940', '2006-02-15T10:05:03'), + ('51', '940', '2006-02-15T10:05:03'), + ('177', '363', '2006-02-15T10:05:03'), + ('122', '363', '2006-02-15T10:05:03'), + ('90', '363', '2006-02-15T10:05:03'), + ('23', '549', '2006-02-15T10:05:03'), + ('159', '549', '2006-02-15T10:05:03'), + ('58', '549', '2006-02-15T10:05:03'), + ('78', '549', '2006-02-15T10:05:03'), + ('190', '549', '2006-02-15T10:05:03'), + ('130', '549', '2006-02-15T10:05:03'), + ('171', '549', '2006-02-15T10:05:03'), + ('119', '868', '2006-02-15T10:05:03'), + ('40', '868', '2006-02-15T10:05:03'), + ('90', '868', '2006-02-15T10:05:03'), + ('56', '868', '2006-02-15T10:05:03'), + ('133', '868', '2006-02-15T10:05:03'), + ('181', '868', '2006-02-15T10:05:03'), + ('170', '868', '2006-02-15T10:05:03'), + ('52', '878', '2006-02-15T10:05:03'), + ('44', '878', '2006-02-15T10:05:03'), + ('86', '878', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('33', '878', '2006-02-15T10:05:03'), + ('143', '878', '2006-02-15T10:05:03'), + ('195', '677', '2006-02-15T10:05:03'), + ('182', '677', '2006-02-15T10:05:03'), + ('174', '677', '2006-02-15T10:05:03'), + ('104', '677', '2006-02-15T10:05:03'), + ('192', '677', '2006-02-15T10:05:03'), + ('57', '16', '2006-02-15T10:05:03'), + ('12', '16', '2006-02-15T10:05:03'), + ('191', '16', '2006-02-15T10:05:03'), + ('192', '16', '2006-02-15T10:05:03'), + ('146', '16', '2006-02-15T10:05:03'), + ('146', '427', '2006-02-15T10:05:03'), + ('32', '427', '2006-02-15T10:05:03'), + ('36', '427', '2006-02-15T10:05:03'), + ('185', '427', '2006-02-15T10:05:03'), + ('93', '427', '2006-02-15T10:05:03'), + ('13', '427', '2006-02-15T10:05:03'), + ('155', '427', '2006-02-15T10:05:03'), + ('22', '912', '2006-02-15T10:05:03'), + ('110', '912', '2006-02-15T10:05:03'), + ('76', '912', '2006-02-15T10:05:03'), + ('98', '912', '2006-02-15T10:05:03'), + ('103', '912', '2006-02-15T10:05:03'), + ('200', '912', '2006-02-15T10:05:03'), + ('41', '912', '2006-02-15T10:05:03'), + ('128', '912', '2006-02-15T10:05:03'), + ('28', '551', '2006-02-15T10:05:03'), + ('150', '551', '2006-02-15T10:05:03'), + ('95', '551', '2006-02-15T10:05:03'), + ('82', '551', '2006-02-15T10:05:03'), + ('58', '551', '2006-02-15T10:05:03'), + ('60', '551', '2006-02-15T10:05:03'), + ('191', '551', '2006-02-15T10:05:03'), + ('94', '551', '2006-02-15T10:05:03'), + ('85', '869', '2006-02-15T10:05:03'), + ('195', '869', '2006-02-15T10:05:03'), + ('40', '869', '2006-02-15T10:05:03'), + ('130', '869', '2006-02-15T10:05:03'), + ('70', '869', '2006-02-15T10:05:03'), + ('158', '869', '2006-02-15T10:05:03'), + ('112', '869', '2006-02-15T10:05:03'), + ('180', '869', '2006-02-15T10:05:03'), + ('93', '621', '2006-02-15T10:05:03'), + ('43', '621', '2006-02-15T10:05:03'), + ('50', '621', '2006-02-15T10:05:03'), + ('65', '516', '2006-02-15T10:05:03'), + ('104', '516', '2006-02-15T10:05:03'), + ('38', '516', '2006-02-15T10:05:03'), + ('128', '516', '2006-02-15T10:05:03'), + ('145', '243', '2006-02-15T10:05:03'), + ('50', '243', '2006-02-15T10:05:03'), + ('20', '243', '2006-02-15T10:05:03'), + ('136', '243', '2006-02-15T10:05:03'), + ('12', '243', '2006-02-15T10:05:03'), + ('109', '243', '2006-02-15T10:05:03'), + ('197', '243', '2006-02-15T10:05:03'), + ('134', '243', '2006-02-15T10:05:03'), + ('58', '243', '2006-02-15T10:05:03'), + ('90', '2', '2006-02-15T10:05:03'), + ('85', '2', '2006-02-15T10:05:03'), + ('19', '2', '2006-02-15T10:05:03'), + ('160', '2', '2006-02-15T10:05:03'), + ('86', '364', '2006-02-15T10:05:03'), + ('11', '364', '2006-02-15T10:05:03'), + ('136', '364', '2006-02-15T10:05:03'), + ('135', '364', '2006-02-15T10:05:03'), + ('197', '364', '2006-02-15T10:05:03'), + ('159', '364', '2006-02-15T10:05:03'), + ('158', '47', '2006-02-15T10:05:03'), + ('8', '47', '2006-02-15T10:05:03'), + ('95', '47', '2006-02-15T10:05:03'), + ('153', '47', '2006-02-15T10:05:03'), + ('143', '47', '2006-02-15T10:05:03'), + ('89', '47', '2006-02-15T10:05:03'), + ('2', '47', '2006-02-15T10:05:03'), + ('127', '47', '2006-02-15T10:05:03'), + ('65', '347', '2006-02-15T10:05:03'), + ('68', '347', '2006-02-15T10:05:03'), + ('164', '347', '2006-02-15T10:05:03'), + ('126', '347', '2006-02-15T10:05:03'), + ('75', '347', '2006-02-15T10:05:03'), + ('198', '347', '2006-02-15T10:05:03'), + ('27', '347', '2006-02-15T10:05:03'), + ('103', '347', '2006-02-15T10:05:03'), + ('165', '644', '2006-02-15T10:05:03'), + ('19', '644', '2006-02-15T10:05:03'), + ('161', '644', '2006-02-15T10:05:03'), + ('59', '644', '2006-02-15T10:05:03'), + ('26', '644', '2006-02-15T10:05:03'), + ('93', '644', '2006-02-15T10:05:03'), + ('147', '131', '2006-02-15T10:05:03'), + ('179', '131', '2006-02-15T10:05:03'), + ('151', '131', '2006-02-15T10:05:03'), + ('29', '131', '2006-02-15T10:05:03'), + ('83', '52', '2006-02-15T10:05:03'), + ('115', '52', '2006-02-15T10:05:03'), + ('177', '52', '2006-02-15T10:05:03'), + ('71', '52', '2006-02-15T10:05:03'), + ('35', '52', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('95', '52', '2006-02-15T10:05:03'), + ('138', '52', '2006-02-15T10:05:03'), + ('117', '167', '2006-02-15T10:05:03'), + ('151', '167', '2006-02-15T10:05:03'), + ('63', '167', '2006-02-15T10:05:03'), + ('114', '254', '2006-02-15T10:05:03'), + ('23', '254', '2006-02-15T10:05:03'), + ('46', '254', '2006-02-15T10:05:03'), + ('58', '254', '2006-02-15T10:05:03'), + ('89', '254', '2006-02-15T10:05:03'), + ('137', '254', '2006-02-15T10:05:03'), + ('13', '254', '2006-02-15T10:05:03'), + ('147', '254', '2006-02-15T10:05:03'), + ('108', '733', '2006-02-15T10:05:03'), + ('21', '733', '2006-02-15T10:05:03'), + ('178', '733', '2006-02-15T10:05:03'), + ('51', '733', '2006-02-15T10:05:03'), + ('29', '590', '2006-02-15T10:05:03'), + ('131', '590', '2006-02-15T10:05:03'), + ('182', '590', '2006-02-15T10:05:03'), + ('36', '590', '2006-02-15T10:05:03'), + ('120', '590', '2006-02-15T10:05:03'), + ('155', '590', '2006-02-15T10:05:03'), + ('96', '590', '2006-02-15T10:05:03'), + ('134', '690', '2006-02-15T10:05:03'), + ('143', '690', '2006-02-15T10:05:03'), + ('95', '690', '2006-02-15T10:05:03'), + ('165', '360', '2006-02-15T10:05:03'), + ('110', '360', '2006-02-15T10:05:03'), + ('185', '360', '2006-02-15T10:05:03'), + ('103', '360', '2006-02-15T10:05:03'), + ('158', '293', '2006-02-15T10:05:03'), + ('145', '293', '2006-02-15T10:05:03'), + ('191', '293', '2006-02-15T10:05:03'), + ('144', '293', '2006-02-15T10:05:03'), + ('39', '293', '2006-02-15T10:05:03'), + ('147', '333', '2006-02-15T10:05:03'), + ('105', '333', '2006-02-15T10:05:03'), + ('127', '333', '2006-02-15T10:05:03'), + ('42', '333', '2006-02-15T10:05:03'), + ('103', '333', '2006-02-15T10:05:03'), + ('5', '730', '2006-02-15T10:05:03'), + ('199', '730', '2006-02-15T10:05:03'), + ('140', '730', '2006-02-15T10:05:03'), + ('185', '730', '2006-02-15T10:05:03'), + ('123', '730', '2006-02-15T10:05:03'), + ('57', '134', '2006-02-15T10:05:03'), + ('48', '134', '2006-02-15T10:05:03'), + ('96', '134', '2006-02-15T10:05:03'), + ('63', '134', '2006-02-15T10:05:03'), + ('103', '215', '2006-02-15T10:05:03'), + ('172', '215', '2006-02-15T10:05:03'), + ('194', '215', '2006-02-15T10:05:03'), + ('68', '215', '2006-02-15T10:05:03'), + ('158', '215', '2006-02-15T10:05:03'), + ('81', '215', '2006-02-15T10:05:03'), + ('13', '571', '2006-02-15T10:05:03'), + ('146', '571', '2006-02-15T10:05:03'), + ('5', '571', '2006-02-15T10:05:03'), + ('169', '571', '2006-02-15T10:05:03'), + ('65', '571', '2006-02-15T10:05:03'), + ('185', '571', '2006-02-15T10:05:03'), + ('107', '571', '2006-02-15T10:05:03'), + ('173', '571', '2006-02-15T10:05:03'), + ('191', '461', '2006-02-15T10:05:03'), + ('176', '461', '2006-02-15T10:05:03'), + ('85', '461', '2006-02-15T10:05:03'), + ('51', '461', '2006-02-15T10:05:03'), + ('23', '820', '2006-02-15T10:05:03'), + ('46', '820', '2006-02-15T10:05:03'), + ('189', '820', '2006-02-15T10:05:03'), + ('180', '820', '2006-02-15T10:05:03'), + ('164', '820', '2006-02-15T10:05:03'), + ('140', '820', '2006-02-15T10:05:03'), + ('168', '892', '2006-02-15T10:05:03'), + ('123', '892', '2006-02-15T10:05:03'), + ('104', '892', '2006-02-15T10:05:03'), + ('151', '892', '2006-02-15T10:05:03'), + ('181', '892', '2006-02-15T10:05:03'), + ('56', '892', '2006-02-15T10:05:03'), + ('198', '892', '2006-02-15T10:05:03'), + ('171', '892', '2006-02-15T10:05:03'), + ('150', '892', '2006-02-15T10:05:03'), + ('6', '892', '2006-02-15T10:05:03'), + ('139', '892', '2006-02-15T10:05:03'), + ('108', '892', '2006-02-15T10:05:03'), + ('97', '641', '2006-02-15T10:05:03'), + ('118', '641', '2006-02-15T10:05:03'), + ('120', '641', '2006-02-15T10:05:03'), + ('145', '641', '2006-02-15T10:05:03'), + ('127', '641', '2006-02-15T10:05:03'), + ('130', '326', '2006-02-15T10:05:03'), + ('15', '326', '2006-02-15T10:05:03'), + ('102', '326', '2006-02-15T10:05:03'), + ('128', '326', '2006-02-15T10:05:03'), + ('169', '326', '2006-02-15T10:05:03'), + ('40', '326', '2006-02-15T10:05:03'), + ('166', '326', '2006-02-15T10:05:03'), + ('157', '326', '2006-02-15T10:05:03'), + ('174', '610', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('137', '610', '2006-02-15T10:05:03'), + ('164', '610', '2006-02-15T10:05:03'), + ('106', '687', '2006-02-15T10:05:03'), + ('80', '687', '2006-02-15T10:05:03'), + ('42', '687', '2006-02-15T10:05:03'), + ('143', '687', '2006-02-15T10:05:03'), + ('5', '687', '2006-02-15T10:05:03'), + ('146', '402', '2006-02-15T10:05:03'), + ('94', '402', '2006-02-15T10:05:03'), + ('147', '402', '2006-02-15T10:05:03'), + ('145', '402', '2006-02-15T10:05:03'), + ('110', '961', '2006-02-15T10:05:03'), + ('122', '961', '2006-02-15T10:05:03'), + ('114', '961', '2006-02-15T10:05:03'), + ('53', '961', '2006-02-15T10:05:03'), + ('87', '961', '2006-02-15T10:05:03'), + ('64', '471', '2006-02-15T10:05:03'), + ('129', '471', '2006-02-15T10:05:03'), + ('65', '471', '2006-02-15T10:05:03'), + ('129', '962', '2006-02-15T10:05:03'), + ('150', '962', '2006-02-15T10:05:03'), + ('20', '962', '2006-02-15T10:05:03'), + ('195', '962', '2006-02-15T10:05:03'), + ('111', '962', '2006-02-15T10:05:03'), + ('165', '962', '2006-02-15T10:05:03'), + ('130', '981', '2006-02-15T10:05:03'), + ('62', '981', '2006-02-15T10:05:03'), + ('23', '981', '2006-02-15T10:05:03'), + ('63', '981', '2006-02-15T10:05:03'), + ('113', '981', '2006-02-15T10:05:03'), + ('67', '981', '2006-02-15T10:05:03'), + ('28', '358', '2006-02-15T10:05:03'), + ('193', '358', '2006-02-15T10:05:03'), + ('97', '358', '2006-02-15T10:05:03'), + ('170', '358', '2006-02-15T10:05:03'), + ('141', '358', '2006-02-15T10:05:03'), + ('53', '358', '2006-02-15T10:05:03'), + ('111', '61', '2006-02-15T10:05:03'), + ('166', '61', '2006-02-15T10:05:03'), + ('174', '61', '2006-02-15T10:05:03'), + ('136', '61', '2006-02-15T10:05:03'), + ('138', '61', '2006-02-15T10:05:03'), + ('102', '624', '2006-02-15T10:05:03'), + ('134', '624', '2006-02-15T10:05:03'), + ('84', '413', '2006-02-15T10:05:03'), + ('134', '413', '2006-02-15T10:05:03'), + ('62', '413', '2006-02-15T10:05:03'), + ('182', '413', '2006-02-15T10:05:03'), + ('50', '645', '2006-02-15T10:05:03'), + ('171', '645', '2006-02-15T10:05:03'), + ('48', '645', '2006-02-15T10:05:03'), + ('75', '645', '2006-02-15T10:05:03'), + ('141', '380', '2006-02-15T10:05:03'), + ('68', '380', '2006-02-15T10:05:03'), + ('31', '380', '2006-02-15T10:05:03'), + ('36', '380', '2006-02-15T10:05:03'), + ('70', '823', '2006-02-15T10:05:03'), + ('73', '823', '2006-02-15T10:05:03'), + ('93', '768', '2006-02-15T10:05:03'), + ('46', '768', '2006-02-15T10:05:03'), + ('187', '768', '2006-02-15T10:05:03'), + ('141', '768', '2006-02-15T10:05:03'), + ('155', '768', '2006-02-15T10:05:03'), + ('148', '768', '2006-02-15T10:05:03'), + ('152', '768', '2006-02-15T10:05:03'), + ('11', '888', '2006-02-15T10:05:03'), + ('80', '888', '2006-02-15T10:05:03'), + ('144', '504', '2006-02-15T10:05:03'), + ('50', '504', '2006-02-15T10:05:03'), + ('156', '504', '2006-02-15T10:05:03'), + ('70', '504', '2006-02-15T10:05:03'), + ('142', '504', '2006-02-15T10:05:03'), + ('98', '824', '2006-02-15T10:05:03'), + ('158', '824', '2006-02-15T10:05:03'), + ('180', '824', '2006-02-15T10:05:03'), + ('164', '431', '2006-02-15T10:05:03'), + ('39', '431', '2006-02-15T10:05:03'), + ('95', '431', '2006-02-15T10:05:03'), + ('130', '431', '2006-02-15T10:05:03'), + ('102', '431', '2006-02-15T10:05:03'), + ('147', '431', '2006-02-15T10:05:03'), + ('129', '431', '2006-02-15T10:05:03'), + ('157', '431', '2006-02-15T10:05:03'), + ('31', '431', '2006-02-15T10:05:03'), + ('32', '431', '2006-02-15T10:05:03'), + ('48', '757', '2006-02-15T10:05:03'), + ('20', '757', '2006-02-15T10:05:03'), + ('72', '757', '2006-02-15T10:05:03'), + ('97', '757', '2006-02-15T10:05:03'), + ('173', '757', '2006-02-15T10:05:03'), + ('114', '757', '2006-02-15T10:05:03'), + ('155', '757', '2006-02-15T10:05:03'), + ('32', '669', '2006-02-15T10:05:03'), + ('129', '669', '2006-02-15T10:05:03'), + ('111', '669', '2006-02-15T10:05:03'), + ('161', '669', '2006-02-15T10:05:03'), + ('76', '251', '2006-02-15T10:05:03'), + ('10', '251', '2006-02-15T10:05:03'), + ('147', '251', '2006-02-15T10:05:03'), + ('149', '810', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('45', '810', '2006-02-15T10:05:03'), + ('102', '810', '2006-02-15T10:05:03'), + ('32', '523', '2006-02-15T10:05:03'), + ('8', '523', '2006-02-15T10:05:03'), + ('115', '686', '2006-02-15T10:05:03'), + ('105', '686', '2006-02-15T10:05:03'), + ('98', '686', '2006-02-15T10:05:03'), + ('136', '686', '2006-02-15T10:05:03'), + ('83', '686', '2006-02-15T10:05:03'), + ('92', '686', '2006-02-15T10:05:03'), + ('21', '686', '2006-02-15T10:05:03'), + ('79', '753', '2006-02-15T10:05:03'), + ('173', '753', '2006-02-15T10:05:03'), + ('109', '753', '2006-02-15T10:05:03'), + ('144', '753', '2006-02-15T10:05:03'), + ('43', '753', '2006-02-15T10:05:03'), + ('140', '830', '2006-02-15T10:05:03'), + ('174', '830', '2006-02-15T10:05:03'), + ('158', '830', '2006-02-15T10:05:03'), + ('27', '830', '2006-02-15T10:05:03'), + ('46', '830', '2006-02-15T10:05:03'), + ('84', '830', '2006-02-15T10:05:03'), + ('143', '830', '2006-02-15T10:05:03'), + ('191', '830', '2006-02-15T10:05:03'), + ('87', '830', '2006-02-15T10:05:03'), + ('120', '830', '2006-02-15T10:05:03'), + ('60', '830', '2006-02-15T10:05:03'), + ('158', '637', '2006-02-15T10:05:03'), + ('186', '637', '2006-02-15T10:05:03'), + ('107', '637', '2006-02-15T10:05:03'), + ('31', '637', '2006-02-15T10:05:03'), + ('7', '637', '2006-02-15T10:05:03'), + ('27', '637', '2006-02-15T10:05:03'), + ('74', '637', '2006-02-15T10:05:03'), + ('132', '637', '2006-02-15T10:05:03'), + ('57', '637', '2006-02-15T10:05:03'), + ('106', '763', '2006-02-15T10:05:03'), + ('192', '763', '2006-02-15T10:05:03'), + ('63', '763', '2006-02-15T10:05:03'), + ('177', '763', '2006-02-15T10:05:03'), + ('127', '763', '2006-02-15T10:05:03'), + ('192', '470', '2006-02-15T10:05:03'), + ('142', '470', '2006-02-15T10:05:03'), + ('122', '470', '2006-02-15T10:05:03'), + ('92', '470', '2006-02-15T10:05:03'), + ('55', '8', '2006-02-15T10:05:03'), + ('110', '8', '2006-02-15T10:05:03'), + ('138', '8', '2006-02-15T10:05:03'), + ('96', '8', '2006-02-15T10:05:03'), + ('4', '463', '2006-02-15T10:05:03'), + ('40', '463', '2006-02-15T10:05:03'), + ('179', '463', '2006-02-15T10:05:03'), + ('104', '463', '2006-02-15T10:05:03'), + ('151', '463', '2006-02-15T10:05:03'), + ('109', '463', '2006-02-15T10:05:03'), + ('46', '463', '2006-02-15T10:05:03'), + ('133', '463', '2006-02-15T10:05:03'), + ('45', '463', '2006-02-15T10:05:03'), + ('7', '463', '2006-02-15T10:05:03'), + ('24', '463', '2006-02-15T10:05:03'), + ('150', '63', '2006-02-15T10:05:03'), + ('56', '63', '2006-02-15T10:05:03'), + ('167', '63', '2006-02-15T10:05:03'), + ('20', '63', '2006-02-15T10:05:03'), + ('51', '63', '2006-02-15T10:05:03'), + ('197', '63', '2006-02-15T10:05:03'), + ('120', '63', '2006-02-15T10:05:03'), + ('119', '87', '2006-02-15T10:05:03'), + ('3', '87', '2006-02-15T10:05:03'), + ('88', '87', '2006-02-15T10:05:03'), + ('4', '87', '2006-02-15T10:05:03'), + ('30', '87', '2006-02-15T10:05:03'), + ('13', '87', '2006-02-15T10:05:03'), + ('64', '87', '2006-02-15T10:05:03'), + ('21', '87', '2006-02-15T10:05:03'), + ('190', '87', '2006-02-15T10:05:03'), + ('56', '87', '2006-02-15T10:05:03'), + ('184', '87', '2006-02-15T10:05:03'), + ('16', '87', '2006-02-15T10:05:03'), + ('98', '87', '2006-02-15T10:05:03'), + ('118', '141', '2006-02-15T10:05:03'), + ('195', '141', '2006-02-15T10:05:03'), + ('154', '141', '2006-02-15T10:05:03'), + ('143', '141', '2006-02-15T10:05:03'), + ('79', '141', '2006-02-15T10:05:03'), + ('121', '141', '2006-02-15T10:05:03'), + ('127', '141', '2006-02-15T10:05:03'), + ('193', '141', '2006-02-15T10:05:03'), + ('92', '512', '2006-02-15T10:05:03'), + ('189', '512', '2006-02-15T10:05:03'), + ('94', '512', '2006-02-15T10:05:03'), + ('67', '512', '2006-02-15T10:05:03'), + ('99', '512', '2006-02-15T10:05:03'), + ('146', '512', '2006-02-15T10:05:03'), + ('132', '586', '2006-02-15T10:05:03'), + ('90', '586', '2006-02-15T10:05:03'), + ('27', '586', '2006-02-15T10:05:03'), + ('29', '462', '2006-02-15T10:05:03'), + ('27', '462', '2006-02-15T10:05:03'), + ('156', '462', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('43', '462', '2006-02-15T10:05:03'), + ('128', '462', '2006-02-15T10:05:03'), + ('18', '462', '2006-02-15T10:05:03'), + ('200', '462', '2006-02-15T10:05:03'), + ('56', '462', '2006-02-15T10:05:03'), + ('193', '462', '2006-02-15T10:05:03'), + ('104', '70', '2006-02-15T10:05:03'), + ('6', '70', '2006-02-15T10:05:03'), + ('180', '809', '2006-02-15T10:05:03'), + ('63', '809', '2006-02-15T10:05:03'), + ('165', '809', '2006-02-15T10:05:03'), + ('131', '809', '2006-02-15T10:05:03'), + ('84', '809', '2006-02-15T10:05:03'), + ('130', '809', '2006-02-15T10:05:03'), + ('174', '809', '2006-02-15T10:05:03'), + ('96', '209', '2006-02-15T10:05:03'), + ('107', '209', '2006-02-15T10:05:03'), + ('180', '724', '2006-02-15T10:05:03'), + ('197', '724', '2006-02-15T10:05:03'), + ('94', '724', '2006-02-15T10:05:03'), + ('41', '724', '2006-02-15T10:05:03'), + ('183', '390', '2006-02-15T10:05:03'), + ('26', '390', '2006-02-15T10:05:03'), + ('133', '390', '2006-02-15T10:05:03'), + ('36', '390', '2006-02-15T10:05:03'), + ('137', '390', '2006-02-15T10:05:03'), + ('68', '607', '2006-02-15T10:05:03'), + ('152', '607', '2006-02-15T10:05:03'), + ('165', '607', '2006-02-15T10:05:03'), + ('98', '607', '2006-02-15T10:05:03'), + ('115', '607', '2006-02-15T10:05:03'), + ('104', '607', '2006-02-15T10:05:03'), + ('141', '607', '2006-02-15T10:05:03'), + ('79', '607', '2006-02-15T10:05:03'), + ('175', '442', '2006-02-15T10:05:03'), + ('174', '442', '2006-02-15T10:05:03'), + ('90', '442', '2006-02-15T10:05:03'), + ('77', '442', '2006-02-15T10:05:03'), + ('123', '442', '2006-02-15T10:05:03'), + ('82', '316', '2006-02-15T10:05:03'), + ('5', '316', '2006-02-15T10:05:03'), + ('143', '316', '2006-02-15T10:05:03'), + ('117', '316', '2006-02-15T10:05:03'), + ('58', '316', '2006-02-15T10:05:03'), + ('107', '781', '2006-02-15T10:05:03'), + ('76', '781', '2006-02-15T10:05:03'), + ('195', '781', '2006-02-15T10:05:03'), + ('63', '781', '2006-02-15T10:05:03'), + ('56', '781', '2006-02-15T10:05:03'), + ('24', '781', '2006-02-15T10:05:03'), + ('136', '781', '2006-02-15T10:05:03'), + ('166', '867', '2006-02-15T10:05:03'), + ('42', '867', '2006-02-15T10:05:03'), + ('184', '867', '2006-02-15T10:05:03'), + ('7', '554', '2006-02-15T10:05:03'), + ('197', '554', '2006-02-15T10:05:03'), + ('147', '554', '2006-02-15T10:05:03'), + ('167', '554', '2006-02-15T10:05:03'), + ('142', '554', '2006-02-15T10:05:03'), + ('185', '554', '2006-02-15T10:05:03'), + ('8', '554', '2006-02-15T10:05:03'), + ('195', '794', '2006-02-15T10:05:03'), + ('160', '794', '2006-02-15T10:05:03'), + ('17', '794', '2006-02-15T10:05:03'), + ('34', '794', '2006-02-15T10:05:03'), + ('142', '794', '2006-02-15T10:05:03'), + ('167', '794', '2006-02-15T10:05:03'), + ('136', '993', '2006-02-15T10:05:03'), + ('51', '993', '2006-02-15T10:05:03'), + ('170', '993', '2006-02-15T10:05:03'), + ('114', '993', '2006-02-15T10:05:03'), + ('33', '993', '2006-02-15T10:05:03'), + ('191', '993', '2006-02-15T10:05:03'), + ('200', '993', '2006-02-15T10:05:03'), + ('77', '993', '2006-02-15T10:05:03'), + ('105', '993', '2006-02-15T10:05:03'), + ('154', '170', '2006-02-15T10:05:03'), + ('135', '170', '2006-02-15T10:05:03'), + ('75', '170', '2006-02-15T10:05:03'), + ('7', '170', '2006-02-15T10:05:03'), + ('88', '170', '2006-02-15T10:05:03'), + ('121', '170', '2006-02-15T10:05:03'), + ('139', '170', '2006-02-15T10:05:03'), + ('151', '170', '2006-02-15T10:05:03'), + ('85', '337', '2006-02-15T10:05:03'), + ('13', '337', '2006-02-15T10:05:03'), + ('117', '337', '2006-02-15T10:05:03'), + ('94', '337', '2006-02-15T10:05:03'), + ('62', '337', '2006-02-15T10:05:03'), + ('92', '825', '2006-02-15T10:05:03'), + ('161', '825', '2006-02-15T10:05:03'), + ('44', '825', '2006-02-15T10:05:03'), + ('65', '541', '2006-02-15T10:05:03'), + ('192', '541', '2006-02-15T10:05:03'), + ('199', '541', '2006-02-15T10:05:03'), + ('75', '541', '2006-02-15T10:05:03'), + ('198', '541', '2006-02-15T10:05:03'), + ('196', '541', '2006-02-15T10:05:03'), + ('58', '541', '2006-02-15T10:05:03'), + ('15', '541', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('135', '541', '2006-02-15T10:05:03'), + ('200', '945', '2006-02-15T10:05:03'), + ('146', '945', '2006-02-15T10:05:03'), + ('12', '945', '2006-02-15T10:05:03'), + ('63', '945', '2006-02-15T10:05:03'), + ('96', '945', '2006-02-15T10:05:03'), + ('67', '945', '2006-02-15T10:05:03'), + ('104', '945', '2006-02-15T10:05:03'), + ('30', '945', '2006-02-15T10:05:03'), + ('165', '659', '2006-02-15T10:05:03'), + ('162', '659', '2006-02-15T10:05:03'), + ('106', '659', '2006-02-15T10:05:03'), + ('174', '659', '2006-02-15T10:05:03'), + ('120', '659', '2006-02-15T10:05:03'), + ('143', '659', '2006-02-15T10:05:03'), + ('73', '374', '2006-02-15T10:05:03'), + ('90', '374', '2006-02-15T10:05:03'), + ('190', '374', '2006-02-15T10:05:03'), + ('40', '374', '2006-02-15T10:05:03'), + ('69', '374', '2006-02-15T10:05:03'), + ('61', '374', '2006-02-15T10:05:03'), + ('190', '562', '2006-02-15T10:05:03'), + ('73', '562', '2006-02-15T10:05:03'), + ('132', '562', '2006-02-15T10:05:03'), + ('165', '95', '2006-02-15T10:05:03'), + ('76', '95', '2006-02-15T10:05:03'), + ('185', '95', '2006-02-15T10:05:03'), + ('186', '95', '2006-02-15T10:05:03'), + ('149', '95', '2006-02-15T10:05:03'), + ('95', '923', '2006-02-15T10:05:03'), + ('187', '923', '2006-02-15T10:05:03'), + ('86', '923', '2006-02-15T10:05:03'), + ('145', '923', '2006-02-15T10:05:03'), + ('140', '923', '2006-02-15T10:05:03'), + ('167', '923', '2006-02-15T10:05:03'), + ('47', '923', '2006-02-15T10:05:03'), + ('138', '923', '2006-02-15T10:05:03'), + ('124', '113', '2006-02-15T10:05:03'), + ('183', '113', '2006-02-15T10:05:03'), + ('179', '468', '2006-02-15T10:05:03'), + ('117', '468', '2006-02-15T10:05:03'), + ('124', '468', '2006-02-15T10:05:03'), + ('82', '468', '2006-02-15T10:05:03'), + ('126', '468', '2006-02-15T10:05:03'), + ('150', '468', '2006-02-15T10:05:03'), + ('148', '468', '2006-02-15T10:05:03'), + ('8', '532', '2006-02-15T10:05:03'), + ('71', '532', '2006-02-15T10:05:03'), + ('158', '532', '2006-02-15T10:05:03'), + ('28', '532', '2006-02-15T10:05:03'), + ('11', '532', '2006-02-15T10:05:03'), + ('173', '313', '2006-02-15T10:05:03'), + ('104', '313', '2006-02-15T10:05:03'), + ('183', '313', '2006-02-15T10:05:03'), + ('17', '313', '2006-02-15T10:05:03'), + ('106', '566', '2006-02-15T10:05:03'), + ('84', '566', '2006-02-15T10:05:03'), + ('171', '566', '2006-02-15T10:05:03'), + ('179', '566', '2006-02-15T10:05:03'), + ('77', '566', '2006-02-15T10:05:03'), + ('188', '566', '2006-02-15T10:05:03'), + ('191', '219', '2006-02-15T10:05:03'), + ('171', '219', '2006-02-15T10:05:03'), + ('32', '219', '2006-02-15T10:05:03'), + ('81', '219', '2006-02-15T10:05:03'), + ('45', '219', '2006-02-15T10:05:03'), + ('108', '219', '2006-02-15T10:05:03'), + ('134', '219', '2006-02-15T10:05:03'), + ('26', '225', '2006-02-15T10:05:03'), + ('7', '225', '2006-02-15T10:05:03'), + ('63', '225', '2006-02-15T10:05:03'), + ('9', '974', '2006-02-15T10:05:03'), + ('178', '974', '2006-02-15T10:05:03'), + ('51', '974', '2006-02-15T10:05:03'), + ('197', '974', '2006-02-15T10:05:03'), + ('44', '699', '2006-02-15T10:05:03'), + ('176', '699', '2006-02-15T10:05:03'), + ('111', '699', '2006-02-15T10:05:03'), + ('93', '699', '2006-02-15T10:05:03'), + ('92', '699', '2006-02-15T10:05:03'), + ('47', '25', '2006-02-15T10:05:03'), + ('4', '25', '2006-02-15T10:05:03'), + ('91', '25', '2006-02-15T10:05:03'), + ('1', '25', '2006-02-15T10:05:03'), + ('187', '25', '2006-02-15T10:05:03'), + ('166', '25', '2006-02-15T10:05:03'), + ('136', '25', '2006-02-15T10:05:03'), + ('167', '25', '2006-02-15T10:05:03'), + ('7', '25', '2006-02-15T10:05:03'), + ('16', '269', '2006-02-15T10:05:03'), + ('135', '269', '2006-02-15T10:05:03'), + ('161', '269', '2006-02-15T10:05:03'), + ('79', '269', '2006-02-15T10:05:03'), + ('20', '269', '2006-02-15T10:05:03'), + ('153', '64', '2006-02-15T10:05:03'), + ('124', '64', '2006-02-15T10:05:03'), + ('30', '64', '2006-02-15T10:05:03'), + ('196', '64', '2006-02-15T10:05:03'), + ('119', '64', '2006-02-15T10:05:03'), + ('158', '64', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('21', '507', '2006-02-15T10:05:03'), + ('130', '507', '2006-02-15T10:05:03'), + ('108', '507', '2006-02-15T10:05:03'), + ('181', '507', '2006-02-15T10:05:03'), + ('44', '109', '2006-02-15T10:05:03'), + ('53', '109', '2006-02-15T10:05:03'), + ('179', '109', '2006-02-15T10:05:03'), + ('145', '109', '2006-02-15T10:05:03'), + ('178', '109', '2006-02-15T10:05:03'), + ('193', '109', '2006-02-15T10:05:03'), + ('198', '109', '2006-02-15T10:05:03'), + ('103', '378', '2006-02-15T10:05:03'), + ('108', '378', '2006-02-15T10:05:03'), + ('189', '378', '2006-02-15T10:05:03'), + ('191', '378', '2006-02-15T10:05:03'), + ('17', '378', '2006-02-15T10:05:03'), + ('68', '378', '2006-02-15T10:05:03'), + ('43', '917', '2006-02-15T10:05:03'), + ('137', '917', '2006-02-15T10:05:03'), + ('18', '917', '2006-02-15T10:05:03'), + ('25', '697', '2006-02-15T10:05:03'), + ('37', '697', '2006-02-15T10:05:03'), + ('9', '697', '2006-02-15T10:05:03'), + ('89', '697', '2006-02-15T10:05:03'), + ('53', '697', '2006-02-15T10:05:03'), + ('150', '697', '2006-02-15T10:05:03'), + ('66', '697', '2006-02-15T10:05:03'), + ('185', '138', '2006-02-15T10:05:03'), + ('107', '138', '2006-02-15T10:05:03'), + ('109', '48', '2006-02-15T10:05:03'), + ('131', '48', '2006-02-15T10:05:03'), + ('58', '48', '2006-02-15T10:05:03'), + ('87', '48', '2006-02-15T10:05:03'), + ('91', '48', '2006-02-15T10:05:03'), + ('127', '48', '2006-02-15T10:05:03'), + ('116', '48', '2006-02-15T10:05:03'), + ('198', '264', '2006-02-15T10:05:03'), + ('123', '234', '2006-02-15T10:05:03'), + ('76', '234', '2006-02-15T10:05:03'), + ('88', '234', '2006-02-15T10:05:03'), + ('190', '234', '2006-02-15T10:05:03'), + ('123', '43', '2006-02-15T10:05:03'), + ('189', '43', '2006-02-15T10:05:03'), + ('161', '43', '2006-02-15T10:05:03'), + ('160', '43', '2006-02-15T10:05:03'), + ('34', '43', '2006-02-15T10:05:03'), + ('141', '43', '2006-02-15T10:05:03'), + ('28', '43', '2006-02-15T10:05:03'), + ('130', '43', '2006-02-15T10:05:03'), + ('126', '43', '2006-02-15T10:05:03'), + ('129', '230', '2006-02-15T10:05:03'), + ('41', '230', '2006-02-15T10:05:03'), + ('79', '230', '2006-02-15T10:05:03'), + ('66', '230', '2006-02-15T10:05:03'), + ('45', '115', '2006-02-15T10:05:03'), + ('8', '115', '2006-02-15T10:05:03'), + ('168', '115', '2006-02-15T10:05:03'), + ('100', '919', '2006-02-15T10:05:03'), + ('185', '919', '2006-02-15T10:05:03'), + ('14', '919', '2006-02-15T10:05:03'), + ('111', '919', '2006-02-15T10:05:03'), + ('153', '919', '2006-02-15T10:05:03'), + ('196', '919', '2006-02-15T10:05:03'), + ('194', '531', '2006-02-15T10:05:03'), + ('20', '531', '2006-02-15T10:05:03'), + ('197', '531', '2006-02-15T10:05:03'), + ('115', '531', '2006-02-15T10:05:03'), + ('37', '553', '2006-02-15T10:05:03'), + ('15', '553', '2006-02-15T10:05:03'), + ('135', '553', '2006-02-15T10:05:03'), + ('58', '553', '2006-02-15T10:05:03'), + ('92', '553', '2006-02-15T10:05:03'), + ('66', '553', '2006-02-15T10:05:03'), + ('127', '553', '2006-02-15T10:05:03'), + ('97', '553', '2006-02-15T10:05:03'), + ('138', '553', '2006-02-15T10:05:03'), + ('80', '553', '2006-02-15T10:05:03'), + ('118', '553', '2006-02-15T10:05:03'), + ('65', '371', '2006-02-15T10:05:03'), + ('142', '371', '2006-02-15T10:05:03'), + ('184', '371', '2006-02-15T10:05:03'), + ('117', '778', '2006-02-15T10:05:03'), + ('169', '778', '2006-02-15T10:05:03'), + ('175', '778', '2006-02-15T10:05:03'), + ('45', '778', '2006-02-15T10:05:03'), + ('140', '778', '2006-02-15T10:05:03'), + ('96', '778', '2006-02-15T10:05:03'), + ('75', '12', '2006-02-15T10:05:03'), + ('109', '12', '2006-02-15T10:05:03'), + ('105', '12', '2006-02-15T10:05:03'), + ('177', '12', '2006-02-15T10:05:03'), + ('37', '12', '2006-02-15T10:05:03'), + ('180', '12', '2006-02-15T10:05:03'), + ('146', '12', '2006-02-15T10:05:03'), + ('90', '330', '2006-02-15T10:05:03'), + ('43', '330', '2006-02-15T10:05:03'), + ('45', '330', '2006-02-15T10:05:03'), + ('59', '121', '2006-02-15T10:05:03'), + ('158', '121', '2006-02-15T10:05:03'), + ('51', '121', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('83', '121', '2006-02-15T10:05:03'), + ('16', '121', '2006-02-15T10:05:03'), + ('162', '121', '2006-02-15T10:05:03'), + ('200', '121', '2006-02-15T10:05:03'), + ('34', '90', '2006-02-15T10:05:03'), + ('139', '90', '2006-02-15T10:05:03'), + ('144', '90', '2006-02-15T10:05:03'), + ('92', '90', '2006-02-15T10:05:03'), + ('26', '90', '2006-02-15T10:05:03'), + ('114', '90', '2006-02-15T10:05:03'), + ('161', '90', '2006-02-15T10:05:03'), + ('116', '90', '2006-02-15T10:05:03'), + ('36', '715', '2006-02-15T10:05:03'), + ('26', '715', '2006-02-15T10:05:03'), + ('120', '715', '2006-02-15T10:05:03'), + ('183', '715', '2006-02-15T10:05:03'), + ('109', '174', '2006-02-15T10:05:03'), + ('46', '174', '2006-02-15T10:05:03'), + ('71', '956', '2006-02-15T10:05:03'), + ('116', '956', '2006-02-15T10:05:03'), + ('36', '956', '2006-02-15T10:05:03'), + ('72', '956', '2006-02-15T10:05:03'), + ('103', '956', '2006-02-15T10:05:03'), + ('74', '956', '2006-02-15T10:05:03'), + ('177', '956', '2006-02-15T10:05:03'), + ('10', '980', '2006-02-15T10:05:03'), + ('102', '980', '2006-02-15T10:05:03'), + ('32', '980', '2006-02-15T10:05:03'), + ('1', '980', '2006-02-15T10:05:03'), + ('49', '980', '2006-02-15T10:05:03'), + ('46', '980', '2006-02-15T10:05:03'), + ('64', '980', '2006-02-15T10:05:03'), + ('101', '980', '2006-02-15T10:05:03'), + ('53', '980', '2006-02-15T10:05:03'), + ('65', '158', '2006-02-15T10:05:03'), + ('105', '158', '2006-02-15T10:05:03'), + ('8', '158', '2006-02-15T10:05:03'), + ('122', '158', '2006-02-15T10:05:03'), + ('154', '158', '2006-02-15T10:05:03'), + ('42', '865', '2006-02-15T10:05:03'), + ('9', '865', '2006-02-15T10:05:03'), + ('5', '865', '2006-02-15T10:05:03'), + ('72', '865', '2006-02-15T10:05:03'), + ('112', '865', '2006-02-15T10:05:03'), + ('13', '528', '2006-02-15T10:05:03'), + ('115', '846', '2006-02-15T10:05:03'), + ('152', '846', '2006-02-15T10:05:03'), + ('34', '846', '2006-02-15T10:05:03'), + ('127', '846', '2006-02-15T10:05:03'), + ('100', '846', '2006-02-15T10:05:03'), + ('96', '846', '2006-02-15T10:05:03'), + ('7', '846', '2006-02-15T10:05:03'), + ('9', '514', '2006-02-15T10:05:03'), + ('146', '514', '2006-02-15T10:05:03'), + ('133', '514', '2006-02-15T10:05:03'), + ('58', '635', '2006-02-15T10:05:03'), + ('196', '635', '2006-02-15T10:05:03'), + ('1', '635', '2006-02-15T10:05:03'), + ('15', '635', '2006-02-15T10:05:03'), + ('4', '635', '2006-02-15T10:05:03'), + ('77', '635', '2006-02-15T10:05:03'), + ('133', '635', '2006-02-15T10:05:03'), + ('12', '635', '2006-02-15T10:05:03'), + ('26', '635', '2006-02-15T10:05:03'), + ('140', '373', '2006-02-15T10:05:03'), + ('139', '373', '2006-02-15T10:05:03'), + ('87', '421', '2006-02-15T10:05:03'), + ('165', '421', '2006-02-15T10:05:03'), + ('56', '421', '2006-02-15T10:05:03'), + ('85', '421', '2006-02-15T10:05:03'), + ('182', '421', '2006-02-15T10:05:03'), + ('154', '421', '2006-02-15T10:05:03'), + ('184', '169', '2006-02-15T10:05:03'), + ('164', '169', '2006-02-15T10:05:03'), + ('154', '169', '2006-02-15T10:05:03'), + ('149', '169', '2006-02-15T10:05:03'), + ('196', '169', '2006-02-15T10:05:03'), + ('14', '232', '2006-02-15T10:05:03'), + ('143', '232', '2006-02-15T10:05:03'), + ('194', '232', '2006-02-15T10:05:03'), + ('81', '232', '2006-02-15T10:05:03'), + ('151', '232', '2006-02-15T10:05:03'), + ('48', '926', '2006-02-15T10:05:03'), + ('123', '926', '2006-02-15T10:05:03'), + ('117', '926', '2006-02-15T10:05:03'), + ('104', '926', '2006-02-15T10:05:03'), + ('9', '926', '2006-02-15T10:05:03'), + ('81', '398', '2006-02-15T10:05:03'), + ('27', '398', '2006-02-15T10:05:03'), + ('4', '398', '2006-02-15T10:05:03'), + ('21', '398', '2006-02-15T10:05:03'), + ('169', '398', '2006-02-15T10:05:03'), + ('65', '398', '2006-02-15T10:05:03'), + ('62', '398', '2006-02-15T10:05:03'), + ('40', '754', '2006-02-15T10:05:03'), + ('54', '754', '2006-02-15T10:05:03'), + ('156', '754', '2006-02-15T10:05:03'), + ('115', '754', '2006-02-15T10:05:03'), + ('33', '754', '2006-02-15T10:05:03'), + ('60', '754', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('2', '754', '2006-02-15T10:05:03'), + ('172', '609', '2006-02-15T10:05:03'), + ('180', '609', '2006-02-15T10:05:03'), + ('72', '609', '2006-02-15T10:05:03'), + ('181', '609', '2006-02-15T10:05:03'), + ('103', '609', '2006-02-15T10:05:03'), + ('116', '606', '2006-02-15T10:05:03'), + ('25', '606', '2006-02-15T10:05:03'), + ('102', '606', '2006-02-15T10:05:03'), + ('188', '606', '2006-02-15T10:05:03'), + ('32', '606', '2006-02-15T10:05:03'), + ('39', '606', '2006-02-15T10:05:03'), + ('112', '606', '2006-02-15T10:05:03'), + ('107', '606', '2006-02-15T10:05:03'), + ('76', '606', '2006-02-15T10:05:03'), + ('87', '606', '2006-02-15T10:05:03'), + ('105', '606', '2006-02-15T10:05:03'), + ('190', '606', '2006-02-15T10:05:03'), + ('17', '606', '2006-02-15T10:05:03'), + ('106', '365', '2006-02-15T10:05:03'), + ('149', '365', '2006-02-15T10:05:03'), + ('64', '860', '2006-02-15T10:05:03'), + ('123', '860', '2006-02-15T10:05:03'), + ('126', '860', '2006-02-15T10:05:03'), + ('145', '527', '2006-02-15T10:05:03'), + ('151', '527', '2006-02-15T10:05:03'), + ('81', '527', '2006-02-15T10:05:03'), + ('20', '527', '2006-02-15T10:05:03'), + ('42', '527', '2006-02-15T10:05:03'), + ('82', '527', '2006-02-15T10:05:03'), + ('84', '460', '2006-02-15T10:05:03'), + ('58', '460', '2006-02-15T10:05:03'), + ('18', '460', '2006-02-15T10:05:03'), + ('25', '871', '2006-02-15T10:05:03'), + ('146', '871', '2006-02-15T10:05:03'), + ('12', '871', '2006-02-15T10:05:03'), + ('66', '871', '2006-02-15T10:05:03'), + ('198', '871', '2006-02-15T10:05:03'), + ('38', '24', '2006-02-15T10:05:03'), + ('179', '24', '2006-02-15T10:05:03'), + ('42', '24', '2006-02-15T10:05:03'), + ('67', '24', '2006-02-15T10:05:03'), + ('157', '24', '2006-02-15T10:05:03'), + ('115', '952', '2006-02-15T10:05:03'), + ('87', '952', '2006-02-15T10:05:03'), + ('44', '952', '2006-02-15T10:05:03'), + ('60', '952', '2006-02-15T10:05:03'), + ('198', '952', '2006-02-15T10:05:03'), + ('133', '952', '2006-02-15T10:05:03'), + ('23', '419', '2006-02-15T10:05:03'), + ('200', '419', '2006-02-15T10:05:03'), + ('126', '419', '2006-02-15T10:05:03'), + ('198', '570', '2006-02-15T10:05:03'), + ('119', '570', '2006-02-15T10:05:03'), + ('87', '570', '2006-02-15T10:05:03'), + ('48', '570', '2006-02-15T10:05:03'), + ('151', '570', '2006-02-15T10:05:03'), + ('139', '570', '2006-02-15T10:05:03'), + ('94', '270', '2006-02-15T10:05:03'), + ('150', '270', '2006-02-15T10:05:03'), + ('133', '270', '2006-02-15T10:05:03'), + ('7', '292', '2006-02-15T10:05:03'), + ('113', '292', '2006-02-15T10:05:03'), + ('14', '292', '2006-02-15T10:05:03'), + ('69', '292', '2006-02-15T10:05:03'), + ('30', '292', '2006-02-15T10:05:03'), + ('54', '292', '2006-02-15T10:05:03'), + ('110', '292', '2006-02-15T10:05:03'), + ('107', '292', '2006-02-15T10:05:03'), + ('74', '780', '2006-02-15T10:05:03'), + ('174', '780', '2006-02-15T10:05:03'), + ('61', '780', '2006-02-15T10:05:03'), + ('121', '780', '2006-02-15T10:05:03'), + ('106', '780', '2006-02-15T10:05:03'), + ('75', '780', '2006-02-15T10:05:03'), + ('167', '72', '2006-02-15T10:05:03'), + ('98', '72', '2006-02-15T10:05:03'), + ('85', '72', '2006-02-15T10:05:03'), + ('149', '72', '2006-02-15T10:05:03'), + ('165', '72', '2006-02-15T10:05:03'), + ('59', '72', '2006-02-15T10:05:03'), + ('116', '939', '2006-02-15T10:05:03'), + ('196', '939', '2006-02-15T10:05:03'), + ('119', '939', '2006-02-15T10:05:03'), + ('1', '939', '2006-02-15T10:05:03'), + ('150', '190', '2006-02-15T10:05:03'), + ('109', '190', '2006-02-15T10:05:03'), + ('124', '190', '2006-02-15T10:05:03'), + ('91', '190', '2006-02-15T10:05:03'), + ('117', '190', '2006-02-15T10:05:03'), + ('175', '190', '2006-02-15T10:05:03'), + ('35', '612', '2006-02-15T10:05:03'), + ('18', '612', '2006-02-15T10:05:03'), + ('77', '612', '2006-02-15T10:05:03'), + ('55', '612', '2006-02-15T10:05:03'), + ('14', '612', '2006-02-15T10:05:03'), + ('69', '612', '2006-02-15T10:05:03'), + ('162', '612', '2006-02-15T10:05:03'), + ('105', '283', '2006-02-15T10:05:03'), + ('66', '283', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('11', '283', '2006-02-15T10:05:03'), + ('36', '283', '2006-02-15T10:05:03'), + ('163', '283', '2006-02-15T10:05:03'), + ('181', '152', '2006-02-15T10:05:03'), + ('19', '152', '2006-02-15T10:05:03'), + ('130', '478', '2006-02-15T10:05:03'), + ('20', '478', '2006-02-15T10:05:03'), + ('17', '478', '2006-02-15T10:05:03'), + ('46', '478', '2006-02-15T10:05:03'), + ('85', '478', '2006-02-15T10:05:03'), + ('2', '31', '2006-02-15T10:05:03'), + ('60', '31', '2006-02-15T10:05:03'), + ('49', '31', '2006-02-15T10:05:03'), + ('15', '31', '2006-02-15T10:05:03'), + ('163', '444', '2006-02-15T10:05:03'), + ('76', '444', '2006-02-15T10:05:03'), + ('29', '444', '2006-02-15T10:05:03'), + ('153', '444', '2006-02-15T10:05:03'), + ('86', '137', '2006-02-15T10:05:03'), + ('92', '137', '2006-02-15T10:05:03'), + ('108', '137', '2006-02-15T10:05:03'), + ('101', '85', '2006-02-15T10:05:03'), + ('60', '85', '2006-02-15T10:05:03'), + ('162', '85', '2006-02-15T10:05:03'), + ('5', '85', '2006-02-15T10:05:03'), + ('126', '85', '2006-02-15T10:05:03'), + ('147', '85', '2006-02-15T10:05:03'), + ('27', '85', '2006-02-15T10:05:03'), + ('179', '85', '2006-02-15T10:05:03'), + ('85', '85', '2006-02-15T10:05:03'), + ('166', '944', '2006-02-15T10:05:03'), + ('128', '944', '2006-02-15T10:05:03'), + ('18', '944', '2006-02-15T10:05:03'), + ('100', '944', '2006-02-15T10:05:03'), + ('29', '944', '2006-02-15T10:05:03'), + ('63', '944', '2006-02-15T10:05:03'), + ('47', '944', '2006-02-15T10:05:03'), + ('44', '944', '2006-02-15T10:05:03'), + ('137', '14', '2006-02-15T10:05:03'), + ('85', '14', '2006-02-15T10:05:03'), + ('188', '14', '2006-02-15T10:05:03'), + ('28', '14', '2006-02-15T10:05:03'), + ('132', '410', '2006-02-15T10:05:03'), + ('43', '410', '2006-02-15T10:05:03'), + ('89', '410', '2006-02-15T10:05:03'), + ('137', '410', '2006-02-15T10:05:03'), + ('147', '410', '2006-02-15T10:05:03'), + ('162', '410', '2006-02-15T10:05:03'), + ('191', '410', '2006-02-15T10:05:03'), + ('36', '410', '2006-02-15T10:05:03'), + ('146', '410', '2006-02-15T10:05:03'), + ('133', '410', '2006-02-15T10:05:03'), + ('103', '271', '2006-02-15T10:05:03'), + ('16', '271', '2006-02-15T10:05:03'), + ('136', '271', '2006-02-15T10:05:03'), + ('51', '891', '2006-02-15T10:05:03'), + ('163', '891', '2006-02-15T10:05:03'), + ('57', '891', '2006-02-15T10:05:03'), + ('152', '891', '2006-02-15T10:05:03'), + ('144', '184', '2006-02-15T10:05:03'), + ('54', '184', '2006-02-15T10:05:03'), + ('170', '184', '2006-02-15T10:05:03'), + ('104', '184', '2006-02-15T10:05:03'), + ('8', '205', '2006-02-15T10:05:03'), + ('68', '205', '2006-02-15T10:05:03'), + ('11', '205', '2006-02-15T10:05:03'), + ('102', '205', '2006-02-15T10:05:03'), + ('79', '205', '2006-02-15T10:05:03'), + ('146', '207', '2006-02-15T10:05:03'), + ('49', '207', '2006-02-15T10:05:03'), + ('92', '207', '2006-02-15T10:05:03'), + ('80', '207', '2006-02-15T10:05:03'), + ('95', '207', '2006-02-15T10:05:03'), + ('87', '207', '2006-02-15T10:05:03'), + ('141', '207', '2006-02-15T10:05:03'), + ('66', '207', '2006-02-15T10:05:03'), + ('124', '814', '2006-02-15T10:05:03'), + ('135', '814', '2006-02-15T10:05:03'), + ('128', '814', '2006-02-15T10:05:03'), + ('146', '372', '2006-02-15T10:05:03'), + ('105', '372', '2006-02-15T10:05:03'), + ('50', '372', '2006-02-15T10:05:03'), + ('75', '372', '2006-02-15T10:05:03'), + ('61', '372', '2006-02-15T10:05:03'), + ('169', '372', '2006-02-15T10:05:03'), + ('76', '223', '2006-02-15T10:05:03'), + ('123', '223', '2006-02-15T10:05:03'), + ('159', '223', '2006-02-15T10:05:03'), + ('38', '223', '2006-02-15T10:05:03'), + ('40', '223', '2006-02-15T10:05:03'), + ('188', '223', '2006-02-15T10:05:03'), + ('141', '223', '2006-02-15T10:05:03'), + ('125', '568', '2006-02-15T10:05:03'), + ('76', '568', '2006-02-15T10:05:03'), + ('92', '568', '2006-02-15T10:05:03'), + ('198', '568', '2006-02-15T10:05:03'), + ('42', '568', '2006-02-15T10:05:03'), + ('101', '568', '2006-02-15T10:05:03'), + ('33', '737', '2006-02-15T10:05:03'), + ('40', '737', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('165', '737', '2006-02-15T10:05:03'), + ('57', '737', '2006-02-15T10:05:03'), + ('111', '737', '2006-02-15T10:05:03'), + ('51', '737', '2006-02-15T10:05:03'), + ('47', '737', '2006-02-15T10:05:03'), + ('179', '737', '2006-02-15T10:05:03'), + ('150', '306', '2006-02-15T10:05:03'), + ('50', '306', '2006-02-15T10:05:03'), + ('69', '306', '2006-02-15T10:05:03'), + ('124', '306', '2006-02-15T10:05:03'), + ('82', '306', '2006-02-15T10:05:03'), + ('33', '306', '2006-02-15T10:05:03'), + ('166', '306', '2006-02-15T10:05:03'), + ('89', '306', '2006-02-15T10:05:03'), + ('58', '306', '2006-02-15T10:05:03'), + ('114', '162', '2006-02-15T10:05:03'), + ('13', '162', '2006-02-15T10:05:03'), + ('89', '162', '2006-02-15T10:05:03'), + ('132', '162', '2006-02-15T10:05:03'), + ('107', '162', '2006-02-15T10:05:03'), + ('173', '162', '2006-02-15T10:05:03'), + ('111', '162', '2006-02-15T10:05:03'), + ('176', '162', '2006-02-15T10:05:03'), + ('66', '793', '2006-02-15T10:05:03'), + ('31', '793', '2006-02-15T10:05:03'), + ('28', '793', '2006-02-15T10:05:03'), + ('38', '793', '2006-02-15T10:05:03'), + ('94', '989', '2006-02-15T10:05:03'), + ('37', '989', '2006-02-15T10:05:03'), + ('151', '989', '2006-02-15T10:05:03'), + ('188', '989', '2006-02-15T10:05:03'), + ('138', '989', '2006-02-15T10:05:03'), + ('58', '632', '2006-02-15T10:05:03'), + ('50', '632', '2006-02-15T10:05:03'), + ('36', '81', '2006-02-15T10:05:03'), + ('98', '81', '2006-02-15T10:05:03'), + ('132', '81', '2006-02-15T10:05:03'), + ('123', '67', '2006-02-15T10:05:03'), + ('7', '67', '2006-02-15T10:05:03'), + ('67', '67', '2006-02-15T10:05:03'), + ('47', '67', '2006-02-15T10:05:03'), + ('141', '67', '2006-02-15T10:05:03'), + ('155', '67', '2006-02-15T10:05:03'), + ('194', '67', '2006-02-15T10:05:03'), + ('175', '67', '2006-02-15T10:05:03'), + ('199', '67', '2006-02-15T10:05:03'), + ('144', '67', '2006-02-15T10:05:03'), + ('126', '370', '2006-02-15T10:05:03'), + ('151', '370', '2006-02-15T10:05:03'), + ('140', '370', '2006-02-15T10:05:03'), + ('97', '370', '2006-02-15T10:05:03'), + ('23', '370', '2006-02-15T10:05:03'), + ('14', '370', '2006-02-15T10:05:03'), + ('197', '370', '2006-02-15T10:05:03'), + ('56', '236', '2006-02-15T10:05:03'), + ('17', '236', '2006-02-15T10:05:03'), + ('69', '236', '2006-02-15T10:05:03'), + ('10', '236', '2006-02-15T10:05:03'), + ('15', '236', '2006-02-15T10:05:03'), + ('9', '147', '2006-02-15T10:05:03'), + ('26', '147', '2006-02-15T10:05:03'), + ('43', '147', '2006-02-15T10:05:03'), + ('131', '147', '2006-02-15T10:05:03'), + ('197', '147', '2006-02-15T10:05:03'), + ('134', '897', '2006-02-15T10:05:03'), + ('50', '897', '2006-02-15T10:05:03'), + ('169', '897', '2006-02-15T10:05:03'), + ('132', '897', '2006-02-15T10:05:03'), + ('13', '897', '2006-02-15T10:05:03'), + ('83', '932', '2006-02-15T10:05:03'), + ('63', '932', '2006-02-15T10:05:03'), + ('42', '932', '2006-02-15T10:05:03'), + ('101', '932', '2006-02-15T10:05:03'), + ('86', '760', '2006-02-15T10:05:03'), + ('76', '760', '2006-02-15T10:05:03'), + ('144', '99', '2006-02-15T10:05:03'), + ('48', '99', '2006-02-15T10:05:03'), + ('60', '436', '2006-02-15T10:05:03'), + ('29', '436', '2006-02-15T10:05:03'), + ('75', '436', '2006-02-15T10:05:03'), + ('131', '436', '2006-02-15T10:05:03'), + ('80', '436', '2006-02-15T10:05:03'), + ('92', '436', '2006-02-15T10:05:03'), + ('65', '106', '2006-02-15T10:05:03'), + ('124', '106', '2006-02-15T10:05:03'), + ('173', '106', '2006-02-15T10:05:03'), + ('1', '106', '2006-02-15T10:05:03'), + ('147', '310', '2006-02-15T10:05:03'), + ('190', '310', '2006-02-15T10:05:03'), + ('17', '310', '2006-02-15T10:05:03'), + ('166', '622', '2006-02-15T10:05:03'), + ('192', '622', '2006-02-15T10:05:03'), + ('174', '622', '2006-02-15T10:05:03'), + ('116', '622', '2006-02-15T10:05:03'), + ('99', '622', '2006-02-15T10:05:03'), + ('180', '622', '2006-02-15T10:05:03'), + ('109', '622', '2006-02-15T10:05:03'), + ('80', '622', '2006-02-15T10:05:03'), + ('54', '546', '2006-02-15T10:05:03'), + ('181', '546', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('95', '546', '2006-02-15T10:05:03'), + ('42', '546', '2006-02-15T10:05:03'), + ('27', '679', '2006-02-15T10:05:03'), + ('87', '679', '2006-02-15T10:05:03'), + ('190', '679', '2006-02-15T10:05:03'), + ('60', '679', '2006-02-15T10:05:03'), + ('28', '679', '2006-02-15T10:05:03'), + ('182', '679', '2006-02-15T10:05:03'), + ('111', '679', '2006-02-15T10:05:03'), + ('39', '689', '2006-02-15T10:05:03'), + ('78', '689', '2006-02-15T10:05:03'), + ('59', '689', '2006-02-15T10:05:03'), + ('193', '689', '2006-02-15T10:05:03'), + ('199', '689', '2006-02-15T10:05:03'), + ('52', '689', '2006-02-15T10:05:03'), + ('37', '555', '2006-02-15T10:05:03'), + ('2', '555', '2006-02-15T10:05:03'), + ('158', '555', '2006-02-15T10:05:03'), + ('198', '555', '2006-02-15T10:05:03'), + ('111', '555', '2006-02-15T10:05:03'), + ('38', '274', '2006-02-15T10:05:03'), + ('162', '274', '2006-02-15T10:05:03'), + ('20', '274', '2006-02-15T10:05:03'), + ('154', '274', '2006-02-15T10:05:03'), + ('50', '274', '2006-02-15T10:05:03'), + ('111', '731', '2006-02-15T10:05:03'), + ('67', '731', '2006-02-15T10:05:03'), + ('22', '731', '2006-02-15T10:05:03'), + ('146', '731', '2006-02-15T10:05:03'), + ('140', '731', '2006-02-15T10:05:03'), + ('36', '731', '2006-02-15T10:05:03'), + ('46', '731', '2006-02-15T10:05:03'), + ('61', '766', '2006-02-15T10:05:03'), + ('67', '766', '2006-02-15T10:05:03'), + ('23', '766', '2006-02-15T10:05:03'), + ('7', '766', '2006-02-15T10:05:03'), + ('46', '766', '2006-02-15T10:05:03'), + ('153', '766', '2006-02-15T10:05:03'), + ('3', '341', '2006-02-15T10:05:03'), + ('134', '341', '2006-02-15T10:05:03'), + ('141', '341', '2006-02-15T10:05:03'), + ('147', '341', '2006-02-15T10:05:03'), + ('167', '341', '2006-02-15T10:05:03'), + ('80', '341', '2006-02-15T10:05:03'), + ('52', '341', '2006-02-15T10:05:03'), + ('41', '799', '2006-02-15T10:05:03'), + ('40', '799', '2006-02-15T10:05:03'), + ('158', '799', '2006-02-15T10:05:03'), + ('198', '886', '2006-02-15T10:05:03'), + ('170', '886', '2006-02-15T10:05:03'), + ('15', '886', '2006-02-15T10:05:03'), + ('199', '886', '2006-02-15T10:05:03'), + ('16', '886', '2006-02-15T10:05:03'), + ('168', '886', '2006-02-15T10:05:03'), + ('118', '399', '2006-02-15T10:05:03'), + ('154', '399', '2006-02-15T10:05:03'), + ('2', '399', '2006-02-15T10:05:03'), + ('106', '399', '2006-02-15T10:05:03'), + ('71', '399', '2006-02-15T10:05:03'), + ('97', '446', '2006-02-15T10:05:03'), + ('138', '446', '2006-02-15T10:05:03'), + ('123', '446', '2006-02-15T10:05:03'), + ('137', '446', '2006-02-15T10:05:03'), + ('85', '446', '2006-02-15T10:05:03'), + ('150', '446', '2006-02-15T10:05:03'), + ('89', '446', '2006-02-15T10:05:03'), + ('102', '446', '2006-02-15T10:05:03'), + ('75', '446', '2006-02-15T10:05:03'), + ('62', '951', '2006-02-15T10:05:03'), + ('66', '951', '2006-02-15T10:05:03'), + ('97', '951', '2006-02-15T10:05:03'), + ('52', '951', '2006-02-15T10:05:03'), + ('65', '951', '2006-02-15T10:05:03'), + ('107', '879', '2006-02-15T10:05:03'), + ('28', '879', '2006-02-15T10:05:03'), + ('138', '879', '2006-02-15T10:05:03'), + ('52', '879', '2006-02-15T10:05:03'), + ('200', '879', '2006-02-15T10:05:03'), + ('174', '879', '2006-02-15T10:05:03'), + ('158', '879', '2006-02-15T10:05:03'), + ('22', '369', '2006-02-15T10:05:03'), + ('110', '369', '2006-02-15T10:05:03'), + ('126', '369', '2006-02-15T10:05:03'), + ('107', '369', '2006-02-15T10:05:03'), + ('83', '369', '2006-02-15T10:05:03'), + ('5', '369', '2006-02-15T10:05:03'), + ('197', '369', '2006-02-15T10:05:03'), + ('2', '369', '2006-02-15T10:05:03'), + ('162', '500', '2006-02-15T10:05:03'), + ('17', '500', '2006-02-15T10:05:03'), + ('184', '500', '2006-02-15T10:05:03'), + ('106', '500', '2006-02-15T10:05:03'), + ('27', '500', '2006-02-15T10:05:03'), + ('42', '500', '2006-02-15T10:05:03'), + ('15', '500', '2006-02-15T10:05:03'), + ('141', '740', '2006-02-15T10:05:03'), + ('176', '740', '2006-02-15T10:05:03'), + ('115', '740', '2006-02-15T10:05:03'), + ('41', '779', '2006-02-15T10:05:03'), + ('171', '779', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('100', '779', '2006-02-15T10:05:03'), + ('16', '779', '2006-02-15T10:05:03'), + ('165', '779', '2006-02-15T10:05:03'), + ('187', '779', '2006-02-15T10:05:03'), + ('34', '779', '2006-02-15T10:05:03'), + ('141', '909', '2006-02-15T10:05:03'), + ('100', '909', '2006-02-15T10:05:03'), + ('146', '909', '2006-02-15T10:05:03'), + ('66', '909', '2006-02-15T10:05:03'), + ('93', '909', '2006-02-15T10:05:03'), + ('4', '909', '2006-02-15T10:05:03'), + ('162', '909', '2006-02-15T10:05:03'), + ('57', '258', '2006-02-15T10:05:03'), + ('180', '258', '2006-02-15T10:05:03'), + ('140', '258', '2006-02-15T10:05:03'), + ('113', '258', '2006-02-15T10:05:03'), + ('14', '258', '2006-02-15T10:05:03'), + ('138', '258', '2006-02-15T10:05:03'), + ('197', '258', '2006-02-15T10:05:03'), + ('55', '620', '2006-02-15T10:05:03'), + ('99', '620', '2006-02-15T10:05:03'), + ('122', '620', '2006-02-15T10:05:03'), + ('88', '620', '2006-02-15T10:05:03'), + ('136', '620', '2006-02-15T10:05:03'), + ('177', '55', '2006-02-15T10:05:03'), + ('166', '55', '2006-02-15T10:05:03'), + ('66', '55', '2006-02-15T10:05:03'), + ('173', '55', '2006-02-15T10:05:03'), + ('118', '55', '2006-02-15T10:05:03'), + ('140', '736', '2006-02-15T10:05:03'), + ('39', '736', '2006-02-15T10:05:03'), + ('103', '585', '2006-02-15T10:05:03'), + ('106', '585', '2006-02-15T10:05:03'), + ('61', '585', '2006-02-15T10:05:03'), + ('24', '585', '2006-02-15T10:05:03'), + ('31', '585', '2006-02-15T10:05:03'), + ('32', '585', '2006-02-15T10:05:03'), + ('123', '480', '2006-02-15T10:05:03'), + ('3', '480', '2006-02-15T10:05:03'), + ('153', '480', '2006-02-15T10:05:03'), + ('91', '480', '2006-02-15T10:05:03'), + ('10', '480', '2006-02-15T10:05:03'), + ('82', '480', '2006-02-15T10:05:03'), + ('184', '745', '2006-02-15T10:05:03'), + ('193', '745', '2006-02-15T10:05:03'), + ('198', '745', '2006-02-15T10:05:03'), + ('15', '745', '2006-02-15T10:05:03'), + ('137', '745', '2006-02-15T10:05:03'), + ('99', '250', '2006-02-15T10:05:03'), + ('49', '250', '2006-02-15T10:05:03'), + ('125', '250', '2006-02-15T10:05:03'), + ('87', '250', '2006-02-15T10:05:03'), + ('134', '250', '2006-02-15T10:05:03'), + ('101', '250', '2006-02-15T10:05:03'), + ('179', '250', '2006-02-15T10:05:03'), + ('100', '250', '2006-02-15T10:05:03'), + ('133', '588', '2006-02-15T10:05:03'), + ('154', '588', '2006-02-15T10:05:03'), + ('198', '588', '2006-02-15T10:05:03'), + ('134', '588', '2006-02-15T10:05:03'), + ('13', '588', '2006-02-15T10:05:03'), + ('161', '588', '2006-02-15T10:05:03'), + ('179', '588', '2006-02-15T10:05:03'), + ('37', '588', '2006-02-15T10:05:03'), + ('37', '963', '2006-02-15T10:05:03'), + ('77', '963', '2006-02-15T10:05:03'), + ('180', '963', '2006-02-15T10:05:03'), + ('78', '963', '2006-02-15T10:05:03'), + ('55', '963', '2006-02-15T10:05:03'), + ('53', '307', '2006-02-15T10:05:03'), + ('61', '307', '2006-02-15T10:05:03'), + ('56', '307', '2006-02-15T10:05:03'), + ('122', '307', '2006-02-15T10:05:03'), + ('163', '307', '2006-02-15T10:05:03'), + ('64', '307', '2006-02-15T10:05:03'), + ('55', '307', '2006-02-15T10:05:03'), + ('145', '120', '2006-02-15T10:05:03'), + ('110', '120', '2006-02-15T10:05:03'), + ('167', '120', '2006-02-15T10:05:03'), + ('93', '120', '2006-02-15T10:05:03'), + ('83', '120', '2006-02-15T10:05:03'), + ('98', '120', '2006-02-15T10:05:03'), + ('131', '120', '2006-02-15T10:05:03'), + ('161', '120', '2006-02-15T10:05:03'), + ('162', '844', '2006-02-15T10:05:03'), + ('56', '844', '2006-02-15T10:05:03'), + ('116', '844', '2006-02-15T10:05:03'), + ('156', '844', '2006-02-15T10:05:03'), + ('47', '734', '2006-02-15T10:05:03'), + ('17', '734', '2006-02-15T10:05:03'), + ('189', '734', '2006-02-15T10:05:03'), + ('21', '734', '2006-02-15T10:05:03'), + ('167', '734', '2006-02-15T10:05:03'), + ('146', '734', '2006-02-15T10:05:03'), + ('51', '734', '2006-02-15T10:05:03'), + ('98', '734', '2006-02-15T10:05:03'), + ('84', '843', '2006-02-15T10:05:03'), + ('198', '843', '2006-02-15T10:05:03'), + ('13', '843', '2006-02-15T10:05:03'), + ('123', '593', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('27', '593', '2006-02-15T10:05:03'), + ('156', '593', '2006-02-15T10:05:03'), + ('188', '593', '2006-02-15T10:05:03'), + ('56', '593', '2006-02-15T10:05:03'), + ('12', '593', '2006-02-15T10:05:03'), + ('112', '829', '2006-02-15T10:05:03'), + ('24', '829', '2006-02-15T10:05:03'), + ('98', '829', '2006-02-15T10:05:03'), + ('46', '829', '2006-02-15T10:05:03'), + ('66', '829', '2006-02-15T10:05:03'), + ('50', '829', '2006-02-15T10:05:03'), + ('91', '829', '2006-02-15T10:05:03'), + ('141', '829', '2006-02-15T10:05:03'), + ('150', '168', '2006-02-15T10:05:03'), + ('174', '168', '2006-02-15T10:05:03'), + ('39', '168', '2006-02-15T10:05:03'), + ('187', '168', '2006-02-15T10:05:03'), + ('128', '168', '2006-02-15T10:05:03'), + ('109', '786', '2006-02-15T10:05:03'), + ('123', '786', '2006-02-15T10:05:03'), + ('119', '786', '2006-02-15T10:05:03'), + ('162', '786', '2006-02-15T10:05:03'), + ('194', '786', '2006-02-15T10:05:03'), + ('83', '340', '2006-02-15T10:05:03'), + ('26', '340', '2006-02-15T10:05:03'), + ('55', '340', '2006-02-15T10:05:03'), + ('161', '340', '2006-02-15T10:05:03'), + ('57', '340', '2006-02-15T10:05:03'), + ('5', '340', '2006-02-15T10:05:03'), + ('34', '336', '2006-02-15T10:05:03'), + ('128', '336', '2006-02-15T10:05:03'), + ('184', '336', '2006-02-15T10:05:03'), + ('116', '336', '2006-02-15T10:05:03'), + ('168', '336', '2006-02-15T10:05:03'), + ('41', '336', '2006-02-15T10:05:03'), + ('3', '336', '2006-02-15T10:05:03'), + ('101', '511', '2006-02-15T10:05:03'), + ('91', '511', '2006-02-15T10:05:03'), + ('85', '812', '2006-02-15T10:05:03'), + ('117', '812', '2006-02-15T10:05:03'), + ('158', '812', '2006-02-15T10:05:03'), + ('12', '812', '2006-02-15T10:05:03'), + ('29', '812', '2006-02-15T10:05:03'), + ('52', '812', '2006-02-15T10:05:03'), + ('197', '129', '2006-02-15T10:05:03'), + ('54', '129', '2006-02-15T10:05:03'), + ('195', '129', '2006-02-15T10:05:03'), + ('175', '129', '2006-02-15T10:05:03'), + ('59', '129', '2006-02-15T10:05:03'), + ('62', '129', '2006-02-15T10:05:03'), + ('13', '346', '2006-02-15T10:05:03'), + ('182', '346', '2006-02-15T10:05:03'), + ('200', '346', '2006-02-15T10:05:03'), + ('127', '613', '2006-02-15T10:05:03'), + ('164', '613', '2006-02-15T10:05:03'), + ('143', '613', '2006-02-15T10:05:03'), + ('81', '613', '2006-02-15T10:05:03'), + ('151', '895', '2006-02-15T10:05:03'), + ('45', '895', '2006-02-15T10:05:03'), + ('8', '895', '2006-02-15T10:05:03'), + ('51', '895', '2006-02-15T10:05:03'), + ('103', '895', '2006-02-15T10:05:03'), + ('85', '895', '2006-02-15T10:05:03'), + ('105', '795', '2006-02-15T10:05:03'), + ('122', '795', '2006-02-15T10:05:03'), + ('56', '795', '2006-02-15T10:05:03'), + ('26', '795', '2006-02-15T10:05:03'), + ('196', '795', '2006-02-15T10:05:03'), + ('50', '795', '2006-02-15T10:05:03'), + ('15', '795', '2006-02-15T10:05:03'), + ('108', '741', '2006-02-15T10:05:03'), + ('99', '741', '2006-02-15T10:05:03'), + ('34', '119', '2006-02-15T10:05:03'), + ('128', '119', '2006-02-15T10:05:03'), + ('127', '119', '2006-02-15T10:05:03'), + ('193', '119', '2006-02-15T10:05:03'), + ('37', '119', '2006-02-15T10:05:03'), + ('58', '119', '2006-02-15T10:05:03'), + ('17', '119', '2006-02-15T10:05:03'), + ('105', '42', '2006-02-15T10:05:03'), + ('194', '42', '2006-02-15T10:05:03'), + ('23', '42', '2006-02-15T10:05:03'), + ('117', '42', '2006-02-15T10:05:03'), + ('43', '42', '2006-02-15T10:05:03'), + ('3', '42', '2006-02-15T10:05:03'), + ('62', '42', '2006-02-15T10:05:03'), + ('145', '726', '2006-02-15T10:05:03'), + ('176', '726', '2006-02-15T10:05:03'), + ('99', '726', '2006-02-15T10:05:03'), + ('67', '726', '2006-02-15T10:05:03'), + ('113', '726', '2006-02-15T10:05:03'), + ('177', '726', '2006-02-15T10:05:03'), + ('58', '726', '2006-02-15T10:05:03'), + ('124', '726', '2006-02-15T10:05:03'), + ('121', '198', '2006-02-15T10:05:03'), + ('62', '198', '2006-02-15T10:05:03'), + ('104', '198', '2006-02-15T10:05:03'), + ('156', '198', '2006-02-15T10:05:03'), + ('45', '198', '2006-02-15T10:05:03'), + ('172', '385', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('47', '385', '2006-02-15T10:05:03'), + ('62', '385', '2006-02-15T10:05:03'), + ('71', '385', '2006-02-15T10:05:03'), + ('90', '385', '2006-02-15T10:05:03'), + ('133', '385', '2006-02-15T10:05:03'), + ('13', '385', '2006-02-15T10:05:03'), + ('3', '17', '2006-02-15T10:05:03'), + ('13', '17', '2006-02-15T10:05:03'), + ('160', '17', '2006-02-15T10:05:03'), + ('82', '17', '2006-02-15T10:05:03'), + ('187', '17', '2006-02-15T10:05:03'), + ('12', '17', '2006-02-15T10:05:03'), + ('167', '17', '2006-02-15T10:05:03'), + ('100', '17', '2006-02-15T10:05:03'), + ('198', '806', '2006-02-15T10:05:03'), + ('190', '806', '2006-02-15T10:05:03'), + ('136', '806', '2006-02-15T10:05:03'), + ('133', '806', '2006-02-15T10:05:03'), + ('132', '806', '2006-02-15T10:05:03'), + ('7', '806', '2006-02-15T10:05:03'), + ('50', '672', '2006-02-15T10:05:03'), + ('83', '672', '2006-02-15T10:05:03'), + ('167', '672', '2006-02-15T10:05:03'), + ('150', '672', '2006-02-15T10:05:03'), + ('99', '672', '2006-02-15T10:05:03'), + ('12', '672', '2006-02-15T10:05:03'), + ('80', '343', '2006-02-15T10:05:03'), + ('159', '343', '2006-02-15T10:05:03'), + ('124', '343', '2006-02-15T10:05:03'), + ('77', '343', '2006-02-15T10:05:03'), + ('110', '343', '2006-02-15T10:05:03'), + ('70', '343', '2006-02-15T10:05:03'), + ('105', '239', '2006-02-15T10:05:03'), + ('107', '239', '2006-02-15T10:05:03'), + ('143', '239', '2006-02-15T10:05:03'), + ('43', '239', '2006-02-15T10:05:03'), + ('78', '239', '2006-02-15T10:05:03'), + ('163', '239', '2006-02-15T10:05:03'), + ('60', '239', '2006-02-15T10:05:03'), + ('171', '318', '2006-02-15T10:05:03'), + ('152', '318', '2006-02-15T10:05:03'), + ('103', '318', '2006-02-15T10:05:03'), + ('30', '318', '2006-02-15T10:05:03'), + ('147', '318', '2006-02-15T10:05:03'), + ('76', '464', '2006-02-15T10:05:03'), + ('198', '464', '2006-02-15T10:05:03'), + ('130', '26', '2006-02-15T10:05:03'), + ('128', '26', '2006-02-15T10:05:03'), + ('71', '26', '2006-02-15T10:05:03'), + ('11', '988', '2006-02-15T10:05:03'), + ('123', '988', '2006-02-15T10:05:03'), + ('54', '988', '2006-02-15T10:05:03'), + ('154', '988', '2006-02-15T10:05:03'), + ('153', '988', '2006-02-15T10:05:03'), + ('62', '988', '2006-02-15T10:05:03'), + ('101', '988', '2006-02-15T10:05:03'), + ('188', '988', '2006-02-15T10:05:03'), + ('112', '988', '2006-02-15T10:05:03'), + ('149', '670', '2006-02-15T10:05:03'), + ('47', '670', '2006-02-15T10:05:03'), + ('78', '670', '2006-02-15T10:05:03'), + ('19', '670', '2006-02-15T10:05:03'), + ('140', '670', '2006-02-15T10:05:03'), + ('66', '608', '2006-02-15T10:05:03'), + ('140', '608', '2006-02-15T10:05:03'), + ('142', '608', '2006-02-15T10:05:03'), + ('91', '608', '2006-02-15T10:05:03'), + ('43', '608', '2006-02-15T10:05:03'), + ('111', '608', '2006-02-15T10:05:03'), + ('171', '608', '2006-02-15T10:05:03'), + ('101', '608', '2006-02-15T10:05:03'), + ('13', '524', '2006-02-15T10:05:03'), + ('196', '524', '2006-02-15T10:05:03'), + ('54', '524', '2006-02-15T10:05:03'), + ('41', '212', '2006-02-15T10:05:03'), + ('19', '212', '2006-02-15T10:05:03'), + ('89', '212', '2006-02-15T10:05:03'), + ('128', '212', '2006-02-15T10:05:03'), + ('90', '212', '2006-02-15T10:05:03'), + ('98', '212', '2006-02-15T10:05:03'), + ('23', '212', '2006-02-15T10:05:03'), + ('80', '212', '2006-02-15T10:05:03'), + ('170', '212', '2006-02-15T10:05:03'), + ('192', '819', '2006-02-15T10:05:03'), + ('191', '819', '2006-02-15T10:05:03'), + ('182', '819', '2006-02-15T10:05:03'), + ('88', '819', '2006-02-15T10:05:03'), + ('127', '819', '2006-02-15T10:05:03'), + ('31', '308', '2006-02-15T10:05:03'), + ('22', '89', '2006-02-15T10:05:03'), + ('81', '89', '2006-02-15T10:05:03'), + ('129', '89', '2006-02-15T10:05:03'), + ('176', '89', '2006-02-15T10:05:03'), + ('15', '89', '2006-02-15T10:05:03'), + ('43', '89', '2006-02-15T10:05:03'), + ('161', '89', '2006-02-15T10:05:03'), + ('4', '23', '2006-02-15T10:05:03'), + ('1', '23', '2006-02-15T10:05:03'), + ('22', '23', '2006-02-15T10:05:03'), + ('164', '23', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('150', '23', '2006-02-15T10:05:03'), + ('78', '260', '2006-02-15T10:05:03'), + ('124', '260', '2006-02-15T10:05:03'), + ('30', '260', '2006-02-15T10:05:03'), + ('37', '260', '2006-02-15T10:05:03'), + ('81', '260', '2006-02-15T10:05:03'), + ('144', '260', '2006-02-15T10:05:03'), + ('80', '260', '2006-02-15T10:05:03'), + ('38', '111', '2006-02-15T10:05:03'), + ('69', '111', '2006-02-15T10:05:03'), + ('3', '111', '2006-02-15T10:05:03'), + ('22', '111', '2006-02-15T10:05:03'), + ('188', '111', '2006-02-15T10:05:03'), + ('50', '111', '2006-02-15T10:05:03'), + ('154', '111', '2006-02-15T10:05:03'), + ('140', '934', '2006-02-15T10:05:03'), + ('106', '934', '2006-02-15T10:05:03'), + ('28', '743', '2006-02-15T10:05:03'), + ('72', '743', '2006-02-15T10:05:03'), + ('77', '943', '2006-02-15T10:05:03'), + ('59', '943', '2006-02-15T10:05:03'), + ('103', '221', '2006-02-15T10:05:03'), + ('16', '221', '2006-02-15T10:05:03'), + ('184', '221', '2006-02-15T10:05:03'), + ('24', '603', '2006-02-15T10:05:03'), + ('143', '603', '2006-02-15T10:05:03'), + ('55', '603', '2006-02-15T10:05:03'), + ('137', '603', '2006-02-15T10:05:03'), + ('111', '603', '2006-02-15T10:05:03'), + ('17', '603', '2006-02-15T10:05:03'), + ('107', '603', '2006-02-15T10:05:03'), + ('112', '603', '2006-02-15T10:05:03'), + ('129', '826', '2006-02-15T10:05:03'), + ('23', '826', '2006-02-15T10:05:03'), + ('6', '826', '2006-02-15T10:05:03'), + ('97', '826', '2006-02-15T10:05:03'), + ('168', '826', '2006-02-15T10:05:03'), + ('160', '826', '2006-02-15T10:05:03'), + ('93', '473', '2006-02-15T10:05:03'), + ('165', '473', '2006-02-15T10:05:03'), + ('158', '473', '2006-02-15T10:05:03'), + ('144', '473', '2006-02-15T10:05:03'), + ('196', '473', '2006-02-15T10:05:03'), + ('79', '473', '2006-02-15T10:05:03'), + ('19', '473', '2006-02-15T10:05:03'), + ('89', '473', '2006-02-15T10:05:03'), + ('94', '473', '2006-02-15T10:05:03'), + ('33', '473', '2006-02-15T10:05:03'), + ('177', '543', '2006-02-15T10:05:03'), + ('64', '543', '2006-02-15T10:05:03'), + ('85', '543', '2006-02-15T10:05:03'), + ('92', '543', '2006-02-15T10:05:03'), + ('74', '543', '2006-02-15T10:05:03'), + ('176', '543', '2006-02-15T10:05:03'), + ('26', '201', '2006-02-15T10:05:03'), + ('35', '201', '2006-02-15T10:05:03'), + ('17', '201', '2006-02-15T10:05:03'), + ('66', '350', '2006-02-15T10:05:03'), + ('108', '350', '2006-02-15T10:05:03'), + ('142', '350', '2006-02-15T10:05:03'), + ('118', '136', '2006-02-15T10:05:03'), + ('104', '136', '2006-02-15T10:05:03'), + ('32', '136', '2006-02-15T10:05:03'), + ('106', '136', '2006-02-15T10:05:03'), + ('107', '136', '2006-02-15T10:05:03'), + ('153', '136', '2006-02-15T10:05:03'), + ('132', '698', '2006-02-15T10:05:03'), + ('164', '698', '2006-02-15T10:05:03'), + ('58', '698', '2006-02-15T10:05:03'), + ('154', '698', '2006-02-15T10:05:03'), + ('179', '698', '2006-02-15T10:05:03'), + ('152', '332', '2006-02-15T10:05:03'), + ('81', '332', '2006-02-15T10:05:03'), + ('86', '905', '2006-02-15T10:05:03'), + ('107', '905', '2006-02-15T10:05:03'), + ('149', '905', '2006-02-15T10:05:03'), + ('135', '905', '2006-02-15T10:05:03'), + ('157', '973', '2006-02-15T10:05:03'), + ('28', '973', '2006-02-15T10:05:03'), + ('185', '973', '2006-02-15T10:05:03'), + ('107', '973', '2006-02-15T10:05:03'), + ('111', '973', '2006-02-15T10:05:03'), + ('47', '973', '2006-02-15T10:05:03'), + ('78', '261', '2006-02-15T10:05:03'), + ('77', '261', '2006-02-15T10:05:03'), + ('139', '261', '2006-02-15T10:05:03'), + ('40', '177', '2006-02-15T10:05:03'), + ('60', '177', '2006-02-15T10:05:03'), + ('158', '177', '2006-02-15T10:05:03'), + ('97', '177', '2006-02-15T10:05:03'), + ('12', '177', '2006-02-15T10:05:03'), + ('16', '177', '2006-02-15T10:05:03'), + ('146', '177', '2006-02-15T10:05:03'), + ('119', '614', '2006-02-15T10:05:03'), + ('128', '614', '2006-02-15T10:05:03'), + ('192', '614', '2006-02-15T10:05:03'), + ('85', '148', '2006-02-15T10:05:03'), + ('123', '148', '2006-02-15T10:05:03'), + ('9', '148', '2006-02-15T10:05:03'), + ('172', '148', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('164', '148', '2006-02-15T10:05:03'), + ('73', '148', '2006-02-15T10:05:03'), + ('24', '148', '2006-02-15T10:05:03'), + ('19', '217', '2006-02-15T10:05:03'), + ('157', '217', '2006-02-15T10:05:03'), + ('152', '217', '2006-02-15T10:05:03'), + ('83', '217', '2006-02-15T10:05:03'), + ('7', '217', '2006-02-15T10:05:03'), + ('151', '217', '2006-02-15T10:05:03'), + ('44', '937', '2006-02-15T10:05:03'), + ('193', '937', '2006-02-15T10:05:03'), + ('53', '937', '2006-02-15T10:05:03'), + ('85', '960', '2006-02-15T10:05:03'), + ('179', '960', '2006-02-15T10:05:03'), + ('193', '960', '2006-02-15T10:05:03'), + ('66', '960', '2006-02-15T10:05:03'), + ('150', '873', '2006-02-15T10:05:03'), + ('17', '873', '2006-02-15T10:05:03'), + ('83', '873', '2006-02-15T10:05:03'), + ('27', '873', '2006-02-15T10:05:03'), + ('9', '873', '2006-02-15T10:05:03'), + ('136', '649', '2006-02-15T10:05:03'), + ('23', '649', '2006-02-15T10:05:03'), + ('54', '649', '2006-02-15T10:05:03'), + ('119', '649', '2006-02-15T10:05:03'), + ('172', '649', '2006-02-15T10:05:03'), + ('195', '649', '2006-02-15T10:05:03'), + ('177', '649', '2006-02-15T10:05:03'), + ('61', '649', '2006-02-15T10:05:03'), + ('147', '649', '2006-02-15T10:05:03'), + ('105', '649', '2006-02-15T10:05:03'), + ('122', '649', '2006-02-15T10:05:03'), + ('73', '667', '2006-02-15T10:05:03'), + ('75', '667', '2006-02-15T10:05:03'), + ('172', '667', '2006-02-15T10:05:03'), + ('33', '667', '2006-02-15T10:05:03'), + ('32', '667', '2006-02-15T10:05:03'), + ('130', '49', '2006-02-15T10:05:03'), + ('171', '49', '2006-02-15T10:05:03'), + ('83', '49', '2006-02-15T10:05:03'), + ('200', '49', '2006-02-15T10:05:03'), + ('173', '49', '2006-02-15T10:05:03'), + ('119', '49', '2006-02-15T10:05:03'), + ('118', '49', '2006-02-15T10:05:03'), + ('115', '49', '2006-02-15T10:05:03'), + ('121', '222', '2006-02-15T10:05:03'), + ('75', '222', '2006-02-15T10:05:03'), + ('39', '222', '2006-02-15T10:05:03'), + ('187', '222', '2006-02-15T10:05:03'), + ('60', '222', '2006-02-15T10:05:03'), + ('84', '703', '2006-02-15T10:05:03'), + ('39', '703', '2006-02-15T10:05:03'), + ('115', '703', '2006-02-15T10:05:03'), + ('10', '703', '2006-02-15T10:05:03'), + ('61', '703', '2006-02-15T10:05:03'), + ('137', '703', '2006-02-15T10:05:03'), + ('151', '703', '2006-02-15T10:05:03'), + ('62', '272', '2006-02-15T10:05:03'), + ('144', '272', '2006-02-15T10:05:03'), + ('189', '272', '2006-02-15T10:05:03'), + ('142', '875', '2006-02-15T10:05:03'), + ('36', '875', '2006-02-15T10:05:03'), + ('85', '875', '2006-02-15T10:05:03'), + ('131', '875', '2006-02-15T10:05:03'), + ('44', '875', '2006-02-15T10:05:03'), + ('102', '845', '2006-02-15T10:05:03'), + ('185', '845', '2006-02-15T10:05:03'), + ('182', '845', '2006-02-15T10:05:03'), + ('144', '845', '2006-02-15T10:05:03'), + ('103', '356', '2006-02-15T10:05:03'), + ('20', '165', '2006-02-15T10:05:03'), + ('83', '165', '2006-02-15T10:05:03'), + ('6', '165', '2006-02-15T10:05:03'), + ('107', '165', '2006-02-15T10:05:03'), + ('183', '388', '2006-02-15T10:05:03'), + ('127', '388', '2006-02-15T10:05:03'), + ('107', '388', '2006-02-15T10:05:03'), + ('52', '388', '2006-02-15T10:05:03'), + ('165', '948', '2006-02-15T10:05:03'), + ('17', '948', '2006-02-15T10:05:03'), + ('14', '948', '2006-02-15T10:05:03'), + ('156', '155', '2006-02-15T10:05:03'), + ('175', '155', '2006-02-15T10:05:03'), + ('192', '155', '2006-02-15T10:05:03'), + ('145', '155', '2006-02-15T10:05:03'), + ('139', '155', '2006-02-15T10:05:03'), + ('12', '155', '2006-02-15T10:05:03'), + ('16', '155', '2006-02-15T10:05:03'), + ('200', '116', '2006-02-15T10:05:03'), + ('105', '116', '2006-02-15T10:05:03'), + ('23', '116', '2006-02-15T10:05:03'), + ('113', '116', '2006-02-15T10:05:03'), + ('179', '415', '2006-02-15T10:05:03'), + ('162', '415', '2006-02-15T10:05:03'), + ('194', '415', '2006-02-15T10:05:03'), + ('14', '415', '2006-02-15T10:05:03'), + ('39', '415', '2006-02-15T10:05:03'), + ('27', '415', '2006-02-15T10:05:03'), + ('74', '415', '2006-02-15T10:05:03'), + ('162', '18', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('142', '18', '2006-02-15T10:05:03'), + ('45', '18', '2006-02-15T10:05:03'), + ('144', '18', '2006-02-15T10:05:03'), + ('117', '224', '2006-02-15T10:05:03'), + ('137', '224', '2006-02-15T10:05:03'), + ('187', '224', '2006-02-15T10:05:03'), + ('77', '224', '2006-02-15T10:05:03'), + ('28', '625', '2006-02-15T10:05:03'), + ('145', '625', '2006-02-15T10:05:03'), + ('110', '625', '2006-02-15T10:05:03'), + ('187', '625', '2006-02-15T10:05:03'), + ('171', '625', '2006-02-15T10:05:03'), + ('181', '625', '2006-02-15T10:05:03'), + ('41', '69', '2006-02-15T10:05:03'), + ('30', '69', '2006-02-15T10:05:03'), + ('192', '69', '2006-02-15T10:05:03'), + ('80', '69', '2006-02-15T10:05:03'), + ('125', '361', '2006-02-15T10:05:03'), + ('143', '361', '2006-02-15T10:05:03'), + ('195', '361', '2006-02-15T10:05:03'), + ('66', '361', '2006-02-15T10:05:03'), + ('166', '361', '2006-02-15T10:05:03'), + ('155', '361', '2006-02-15T10:05:03'), + ('1', '361', '2006-02-15T10:05:03'), + ('192', '361', '2006-02-15T10:05:03'), + ('121', '633', '2006-02-15T10:05:03'), + ('90', '633', '2006-02-15T10:05:03'), + ('7', '633', '2006-02-15T10:05:03'), + ('148', '633', '2006-02-15T10:05:03'), + ('63', '633', '2006-02-15T10:05:03'), + ('175', '977', '2006-02-15T10:05:03'), + ('20', '977', '2006-02-15T10:05:03'), + ('49', '977', '2006-02-15T10:05:03'), + ('107', '977', '2006-02-15T10:05:03'), + ('150', '887', '2006-02-15T10:05:03'), + ('117', '887', '2006-02-15T10:05:03'), + ('108', '887', '2006-02-15T10:05:03'), + ('115', '887', '2006-02-15T10:05:03'), + ('40', '887', '2006-02-15T10:05:03'), + ('21', '887', '2006-02-15T10:05:03'), + ('84', '887', '2006-02-15T10:05:03'), + ('48', '211', '2006-02-15T10:05:03'), + ('62', '211', '2006-02-15T10:05:03'), + ('92', '505', '2006-02-15T10:05:03'), + ('169', '505', '2006-02-15T10:05:03'), + ('42', '505', '2006-02-15T10:05:03'), + ('78', '505', '2006-02-15T10:05:03'), + ('106', '505', '2006-02-15T10:05:03'), + ('81', '505', '2006-02-15T10:05:03'), + ('107', '534', '2006-02-15T10:05:03'), + ('195', '534', '2006-02-15T10:05:03'), + ('60', '534', '2006-02-15T10:05:03'), + ('26', '9', '2006-02-15T10:05:03'), + ('108', '9', '2006-02-15T10:05:03'), + ('22', '9', '2006-02-15T10:05:03'), + ('53', '9', '2006-02-15T10:05:03'), + ('130', '9', '2006-02-15T10:05:03'), + ('10', '9', '2006-02-15T10:05:03'), + ('68', '9', '2006-02-15T10:05:03'), + ('175', '9', '2006-02-15T10:05:03'), + ('194', '9', '2006-02-15T10:05:03'), + ('146', '314', '2006-02-15T10:05:03'), + ('154', '314', '2006-02-15T10:05:03'), + ('2', '314', '2006-02-15T10:05:03'), + ('131', '798', '2006-02-15T10:05:03'), + ('4', '798', '2006-02-15T10:05:03'), + ('42', '798', '2006-02-15T10:05:03'), + ('165', '798', '2006-02-15T10:05:03'), + ('21', '798', '2006-02-15T10:05:03'), + ('6', '517', '2006-02-15T10:05:03'), + ('108', '517', '2006-02-15T10:05:03'), + ('52', '517', '2006-02-15T10:05:03'), + ('63', '517', '2006-02-15T10:05:03'), + ('102', '517', '2006-02-15T10:05:03'), + ('94', '517', '2006-02-15T10:05:03'), + ('118', '517', '2006-02-15T10:05:03'), + ('176', '517', '2006-02-15T10:05:03'), + ('188', '517', '2006-02-15T10:05:03'), + ('121', '517', '2006-02-15T10:05:03'), + ('65', '517', '2006-02-15T10:05:03'), + ('178', '517', '2006-02-15T10:05:03'), + ('158', '896', '2006-02-15T10:05:03'), + ('11', '896', '2006-02-15T10:05:03'), + ('134', '896', '2006-02-15T10:05:03'), + ('189', '896', '2006-02-15T10:05:03'), + ('44', '896', '2006-02-15T10:05:03'), + ('60', '334', '2006-02-15T10:05:03'), + ('102', '334', '2006-02-15T10:05:03'), + ('27', '334', '2006-02-15T10:05:03'), + ('112', '443', '2006-02-15T10:05:03'), + ('92', '443', '2006-02-15T10:05:03'), + ('147', '443', '2006-02-15T10:05:03'), + ('121', '284', '2006-02-15T10:05:03'), + ('14', '284', '2006-02-15T10:05:03'), + ('139', '284', '2006-02-15T10:05:03'), + ('196', '284', '2006-02-15T10:05:03'), + ('82', '802', '2006-02-15T10:05:03'), + ('190', '802', '2006-02-15T10:05:03'), + ('176', '802', '2006-02-15T10:05:03'), + ('157', '802', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('22', '802', '2006-02-15T10:05:03'), + ('102', '802', '2006-02-15T10:05:03'), + ('167', '802', '2006-02-15T10:05:03'), + ('31', '802', '2006-02-15T10:05:03'), + ('92', '802', '2006-02-15T10:05:03'), + ('159', '802', '2006-02-15T10:05:03'), + ('154', '802', '2006-02-15T10:05:03'), + ('119', '802', '2006-02-15T10:05:03'), + ('110', '126', '2006-02-15T10:05:03'), + ('106', '126', '2006-02-15T10:05:03'), + ('95', '126', '2006-02-15T10:05:03'), + ('24', '126', '2006-02-15T10:05:03'), + ('53', '126', '2006-02-15T10:05:03'), + ('67', '144', '2006-02-15T10:05:03'), + ('57', '144', '2006-02-15T10:05:03'), + ('13', '144', '2006-02-15T10:05:03'), + ('180', '144', '2006-02-15T10:05:03'), + ('151', '144', '2006-02-15T10:05:03'), + ('18', '144', '2006-02-15T10:05:03'), + ('72', '144', '2006-02-15T10:05:03'), + ('195', '144', '2006-02-15T10:05:03'), + ('120', '144', '2006-02-15T10:05:03'), + ('19', '144', '2006-02-15T10:05:03'), + ('40', '466', '2006-02-15T10:05:03'), + ('171', '466', '2006-02-15T10:05:03'), + ('70', '466', '2006-02-15T10:05:03'), + ('97', '466', '2006-02-15T10:05:03'), + ('69', '466', '2006-02-15T10:05:03'), + ('36', '466', '2006-02-15T10:05:03'), + ('65', '97', '2006-02-15T10:05:03'), + ('40', '107', '2006-02-15T10:05:03'), + ('130', '107', '2006-02-15T10:05:03'), + ('142', '107', '2006-02-15T10:05:03'), + ('167', '107', '2006-02-15T10:05:03'), + ('139', '107', '2006-02-15T10:05:03'), + ('12', '107', '2006-02-15T10:05:03'), + ('28', '107', '2006-02-15T10:05:03'), + ('98', '107', '2006-02-15T10:05:03'), + ('7', '901', '2006-02-15T10:05:03'), + ('90', '901', '2006-02-15T10:05:03'), + ('45', '901', '2006-02-15T10:05:03'), + ('183', '850', '2006-02-15T10:05:03'), + ('161', '850', '2006-02-15T10:05:03'), + ('76', '850', '2006-02-15T10:05:03'), + ('100', '850', '2006-02-15T10:05:03'), + ('11', '850', '2006-02-15T10:05:03'), + ('44', '982', '2006-02-15T10:05:03'), + ('91', '982', '2006-02-15T10:05:03'), + ('93', '982', '2006-02-15T10:05:03'), + ('99', '982', '2006-02-15T10:05:03'), + ('174', '982', '2006-02-15T10:05:03'), + ('143', '821', '2006-02-15T10:05:03'), + ('26', '821', '2006-02-15T10:05:03'), + ('141', '821', '2006-02-15T10:05:03'), + ('152', '821', '2006-02-15T10:05:03'), + ('58', '638', '2006-02-15T10:05:03'), + ('191', '638', '2006-02-15T10:05:03'), + ('71', '638', '2006-02-15T10:05:03'), + ('16', '582', '2006-02-15T10:05:03'), + ('95', '813', '2006-02-15T10:05:03'), + ('195', '813', '2006-02-15T10:05:03'), + ('140', '665', '2006-02-15T10:05:03'), + ('5', '665', '2006-02-15T10:05:03'), + ('68', '665', '2006-02-15T10:05:03'), + ('151', '665', '2006-02-15T10:05:03'), + ('185', '665', '2006-02-15T10:05:03'), + ('72', '665', '2006-02-15T10:05:03'), + ('42', '665', '2006-02-15T10:05:03'), + ('128', '665', '2006-02-15T10:05:03'), + ('60', '665', '2006-02-15T10:05:03'), + ('172', '661', '2006-02-15T10:05:03'), + ('157', '661', '2006-02-15T10:05:03'), + ('184', '661', '2006-02-15T10:05:03'), + ('96', '661', '2006-02-15T10:05:03'), + ('115', '661', '2006-02-15T10:05:03'), + ('145', '661', '2006-02-15T10:05:03'), + ('191', '420', '2006-02-15T10:05:03'), + ('136', '420', '2006-02-15T10:05:03'), + ('12', '420', '2006-02-15T10:05:03'), + ('116', '420', '2006-02-15T10:05:03'), + ('181', '420', '2006-02-15T10:05:03'), + ('51', '420', '2006-02-15T10:05:03'), + ('50', '420', '2006-02-15T10:05:03'), + ('95', '420', '2006-02-15T10:05:03'), + ('114', '420', '2006-02-15T10:05:03'), + ('44', '420', '2006-02-15T10:05:03'), + ('25', '420', '2006-02-15T10:05:03'), + ('42', '535', '2006-02-15T10:05:03'), + ('61', '535', '2006-02-15T10:05:03'), + ('5', '535', '2006-02-15T10:05:03'), + ('157', '535', '2006-02-15T10:05:03'), + ('159', '876', '2006-02-15T10:05:03'), + ('38', '876', '2006-02-15T10:05:03'), + ('42', '876', '2006-02-15T10:05:03'), + ('187', '435', '2006-02-15T10:05:03'), + ('110', '435', '2006-02-15T10:05:03'), + ('68', '435', '2006-02-15T10:05:03'), + ('23', '435', '2006-02-15T10:05:03'), + ('145', '692', '2006-02-15T10:05:03'), + ('191', '692', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('81', '692', '2006-02-15T10:05:03'), + ('167', '692', '2006-02-15T10:05:03'), + ('6', '692', '2006-02-15T10:05:03'), + ('103', '692', '2006-02-15T10:05:03'), + ('64', '557', '2006-02-15T10:05:03'), + ('125', '557', '2006-02-15T10:05:03'), + ('92', '229', '2006-02-15T10:05:03'), + ('136', '229', '2006-02-15T10:05:03'), + ('66', '229', '2006-02-15T10:05:03'), + ('106', '229', '2006-02-15T10:05:03'), + ('139', '229', '2006-02-15T10:05:03'), + ('44', '598', '2006-02-15T10:05:03'), + ('197', '598', '2006-02-15T10:05:03'), + ('39', '598', '2006-02-15T10:05:03'), + ('43', '598', '2006-02-15T10:05:03'), + ('69', '452', '2006-02-15T10:05:03'), + ('129', '452', '2006-02-15T10:05:03'), + ('130', '452', '2006-02-15T10:05:03'), + ('96', '452', '2006-02-15T10:05:03'), + ('133', '452', '2006-02-15T10:05:03'), + ('184', '452', '2006-02-15T10:05:03'), + ('114', '452', '2006-02-15T10:05:03'), + ('197', '995', '2006-02-15T10:05:03'), + ('27', '771', '2006-02-15T10:05:03'), + ('60', '771', '2006-02-15T10:05:03'), + ('19', '771', '2006-02-15T10:05:03'), + ('121', '771', '2006-02-15T10:05:03'), + ('172', '771', '2006-02-15T10:05:03'), + ('127', '771', '2006-02-15T10:05:03'), + ('8', '771', '2006-02-15T10:05:03'), + ('90', '771', '2006-02-15T10:05:03'), + ('87', '870', '2006-02-15T10:05:03'), + ('82', '870', '2006-02-15T10:05:03'), + ('67', '870', '2006-02-15T10:05:03'), + ('76', '870', '2006-02-15T10:05:03'), + ('181', '870', '2006-02-15T10:05:03'), + ('75', '870', '2006-02-15T10:05:03'), + ('58', '235', '2006-02-15T10:05:03'), + ('23', '235', '2006-02-15T10:05:03'), + ('177', '235', '2006-02-15T10:05:03'), + ('60', '235', '2006-02-15T10:05:03'), + ('61', '235', '2006-02-15T10:05:03'), + ('173', '235', '2006-02-15T10:05:03'), + ('61', '648', '2006-02-15T10:05:03'), + ('39', '648', '2006-02-15T10:05:03'), + ('108', '648', '2006-02-15T10:05:03'), + ('42', '648', '2006-02-15T10:05:03'), + ('22', '648', '2006-02-15T10:05:03'), + ('76', '648', '2006-02-15T10:05:03'), + ('186', '648', '2006-02-15T10:05:03'), + ('39', '290', '2006-02-15T10:05:03'), + ('85', '290', '2006-02-15T10:05:03'), + ('84', '290', '2006-02-15T10:05:03'), + ('82', '290', '2006-02-15T10:05:03'), + ('70', '290', '2006-02-15T10:05:03'), + ('88', '128', '2006-02-15T10:05:03'), + ('155', '128', '2006-02-15T10:05:03'), + ('116', '128', '2006-02-15T10:05:03'), + ('40', '128', '2006-02-15T10:05:03'), + ('58', '128', '2006-02-15T10:05:03'), + ('101', '491', '2006-02-15T10:05:03'), + ('141', '491', '2006-02-15T10:05:03'), + ('65', '491', '2006-02-15T10:05:03'), + ('22', '491', '2006-02-15T10:05:03'), + ('122', '491', '2006-02-15T10:05:03'), + ('173', '491', '2006-02-15T10:05:03'), + ('23', '491', '2006-02-15T10:05:03'), + ('84', '491', '2006-02-15T10:05:03'), + ('30', '357', '2006-02-15T10:05:03'), + ('68', '357', '2006-02-15T10:05:03'), + ('2', '357', '2006-02-15T10:05:03'), + ('135', '357', '2006-02-15T10:05:03'), + ('39', '772', '2006-02-15T10:05:03'), + ('148', '772', '2006-02-15T10:05:03'), + ('73', '772', '2006-02-15T10:05:03'), + ('141', '772', '2006-02-15T10:05:03'), + ('112', '772', '2006-02-15T10:05:03'), + ('175', '772', '2006-02-15T10:05:03'), + ('59', '772', '2006-02-15T10:05:03'), + ('184', '772', '2006-02-15T10:05:03'), + ('27', '19', '2006-02-15T10:05:03'), + ('43', '19', '2006-02-15T10:05:03'), + ('37', '19', '2006-02-15T10:05:03'), + ('84', '19', '2006-02-15T10:05:03'), + ('5', '19', '2006-02-15T10:05:03'), + ('104', '19', '2006-02-15T10:05:03'), + ('97', '947', '2006-02-15T10:05:03'), + ('149', '947', '2006-02-15T10:05:03'), + ('163', '947', '2006-02-15T10:05:03'), + ('165', '947', '2006-02-15T10:05:03'), + ('53', '947', '2006-02-15T10:05:03'), + ('56', '298', '2006-02-15T10:05:03'), + ('195', '298', '2006-02-15T10:05:03'), + ('117', '298', '2006-02-15T10:05:03'), + ('147', '298', '2006-02-15T10:05:03'), + ('174', '298', '2006-02-15T10:05:03'), + ('189', '899', '2006-02-15T10:05:03'), + ('149', '899', '2006-02-15T10:05:03'), + ('132', '899', '2006-02-15T10:05:03'), + ('128', '899', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('100', '877', '2006-02-15T10:05:03'), + ('125', '877', '2006-02-15T10:05:03'), + ('170', '877', '2006-02-15T10:05:03'), + ('69', '877', '2006-02-15T10:05:03'), + ('19', '877', '2006-02-15T10:05:03'), + ('82', '877', '2006-02-15T10:05:03'), + ('126', '58', '2006-02-15T10:05:03'), + ('28', '58', '2006-02-15T10:05:03'), + ('96', '58', '2006-02-15T10:05:03'), + ('83', '58', '2006-02-15T10:05:03'), + ('44', '58', '2006-02-15T10:05:03'), + ('53', '58', '2006-02-15T10:05:03'), + ('161', '58', '2006-02-15T10:05:03'), + ('49', '400', '2006-02-15T10:05:03'), + ('12', '400', '2006-02-15T10:05:03'), + ('157', '400', '2006-02-15T10:05:03'), + ('63', '73', '2006-02-15T10:05:03'), + ('39', '73', '2006-02-15T10:05:03'), + ('187', '73', '2006-02-15T10:05:03'), + ('176', '73', '2006-02-15T10:05:03'), + ('77', '73', '2006-02-15T10:05:03'), + ('150', '94', '2006-02-15T10:05:03'), + ('131', '94', '2006-02-15T10:05:03'), + ('92', '94', '2006-02-15T10:05:03'), + ('44', '94', '2006-02-15T10:05:03'), + ('102', '329', '2006-02-15T10:05:03'), + ('3', '329', '2006-02-15T10:05:03'), + ('26', '329', '2006-02-15T10:05:03'), + ('198', '329', '2006-02-15T10:05:03'), + ('95', '329', '2006-02-15T10:05:03'), + ('196', '484', '2006-02-15T10:05:03'), + ('160', '484', '2006-02-15T10:05:03'), + ('45', '484', '2006-02-15T10:05:03'), + ('18', '484', '2006-02-15T10:05:03'), + ('36', '484', '2006-02-15T10:05:03'), + ('47', '484', '2006-02-15T10:05:03'), + ('74', '484', '2006-02-15T10:05:03'), + ('135', '484', '2006-02-15T10:05:03'), + ('160', '579', '2006-02-15T10:05:03'), + ('81', '579', '2006-02-15T10:05:03'), + ('186', '579', '2006-02-15T10:05:03'), + ('49', '579', '2006-02-15T10:05:03'), + ('75', '579', '2006-02-15T10:05:03'), + ('181', '579', '2006-02-15T10:05:03'), + ('111', '78', '2006-02-15T10:05:03'), + ('169', '78', '2006-02-15T10:05:03'), + ('77', '78', '2006-02-15T10:05:03'), + ('181', '78', '2006-02-15T10:05:03'), + ('23', '78', '2006-02-15T10:05:03'), + ('194', '161', '2006-02-15T10:05:03'), + ('121', '161', '2006-02-15T10:05:03'), + ('68', '161', '2006-02-15T10:05:03'), + ('43', '161', '2006-02-15T10:05:03'), + ('87', '161', '2006-02-15T10:05:03'), + ('134', '161', '2006-02-15T10:05:03'), + ('171', '898', '2006-02-15T10:05:03'), + ('152', '898', '2006-02-15T10:05:03'), + ('120', '898', '2006-02-15T10:05:03'), + ('67', '601', '2006-02-15T10:05:03'), + ('124', '601', '2006-02-15T10:05:03'), + ('158', '601', '2006-02-15T10:05:03'), + ('138', '885', '2006-02-15T10:05:03'), + ('195', '885', '2006-02-15T10:05:03'), + ('155', '885', '2006-02-15T10:05:03'), + ('121', '885', '2006-02-15T10:05:03'), + ('26', '885', '2006-02-15T10:05:03'), + ('109', '885', '2006-02-15T10:05:03'), + ('12', '92', '2006-02-15T10:05:03'), + ('85', '92', '2006-02-15T10:05:03'), + ('168', '92', '2006-02-15T10:05:03'), + ('52', '92', '2006-02-15T10:05:03'), + ('70', '92', '2006-02-15T10:05:03'), + ('141', '863', '2006-02-15T10:05:03'), + ('142', '863', '2006-02-15T10:05:03'), + ('18', '863', '2006-02-15T10:05:03'), + ('20', '863', '2006-02-15T10:05:03'), + ('109', '863', '2006-02-15T10:05:03'), + ('45', '920', '2006-02-15T10:05:03'), + ('129', '920', '2006-02-15T10:05:03'), + ('185', '920', '2006-02-15T10:05:03'), + ('75', '920', '2006-02-15T10:05:03'), + ('108', '920', '2006-02-15T10:05:03'), + ('161', '920', '2006-02-15T10:05:03'), + ('39', '920', '2006-02-15T10:05:03'), + ('21', '920', '2006-02-15T10:05:03'), + ('133', '338', '2006-02-15T10:05:03'), + ('92', '338', '2006-02-15T10:05:03'), + ('125', '338', '2006-02-15T10:05:03'), + ('116', '338', '2006-02-15T10:05:03'), + ('107', '338', '2006-02-15T10:05:03'), + ('38', '338', '2006-02-15T10:05:03'), + ('188', '338', '2006-02-15T10:05:03'), + ('121', '338', '2006-02-15T10:05:03'), + ('65', '338', '2006-02-15T10:05:03'), + ('181', '522', '2006-02-15T10:05:03'), + ('85', '522', '2006-02-15T10:05:03'), + ('163', '522', '2006-02-15T10:05:03'), + ('13', '522', '2006-02-15T10:05:03'), + ('197', '522', '2006-02-15T10:05:03'), + ('95', '522', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('10', '522', '2006-02-15T10:05:03'), + ('177', '522', '2006-02-15T10:05:03'), + ('164', '681', '2006-02-15T10:05:03'), + ('179', '650', '2006-02-15T10:05:03'), + ('110', '650', '2006-02-15T10:05:03'), + ('128', '650', '2006-02-15T10:05:03'), + ('5', '650', '2006-02-15T10:05:03'), + ('9', '650', '2006-02-15T10:05:03'), + ('59', '650', '2006-02-15T10:05:03'), + ('76', '650', '2006-02-15T10:05:03'), + ('184', '650', '2006-02-15T10:05:03'), + ('169', '6', '2006-02-15T10:05:03'), + ('62', '6', '2006-02-15T10:05:03'), + ('21', '6', '2006-02-15T10:05:03'), + ('23', '6', '2006-02-15T10:05:03'), + ('197', '6', '2006-02-15T10:05:03'), + ('137', '6', '2006-02-15T10:05:03'), + ('108', '6', '2006-02-15T10:05:03'), + ('172', '345', '2006-02-15T10:05:03'), + ('128', '345', '2006-02-15T10:05:03'), + ('48', '345', '2006-02-15T10:05:03'), + ('16', '345', '2006-02-15T10:05:03'), + ('106', '345', '2006-02-15T10:05:03'), + ('132', '345', '2006-02-15T10:05:03'), + ('26', '345', '2006-02-15T10:05:03'), + ('64', '345', '2006-02-15T10:05:03'), + ('52', '664', '2006-02-15T10:05:03'), + ('187', '664', '2006-02-15T10:05:03'), + ('145', '664', '2006-02-15T10:05:03'), + ('125', '664', '2006-02-15T10:05:03'), + ('160', '767', '2006-02-15T10:05:03'), + ('78', '767', '2006-02-15T10:05:03'), + ('57', '767', '2006-02-15T10:05:03'), + ('61', '767', '2006-02-15T10:05:03'), + ('45', '767', '2006-02-15T10:05:03'), + ('127', '791', '2006-02-15T10:05:03'), + ('69', '791', '2006-02-15T10:05:03'), + ('74', '872', '2006-02-15T10:05:03'), + ('143', '872', '2006-02-15T10:05:03'), + ('176', '872', '2006-02-15T10:05:03'), + ('194', '872', '2006-02-15T10:05:03'), + ('171', '872', '2006-02-15T10:05:03'), + ('100', '872', '2006-02-15T10:05:03'), + ('144', '396', '2006-02-15T10:05:03'), + ('40', '396', '2006-02-15T10:05:03'), + ('188', '396', '2006-02-15T10:05:03'), + ('8', '396', '2006-02-15T10:05:03'), + ('68', '396', '2006-02-15T10:05:03'), + ('154', '396', '2006-02-15T10:05:03'), + ('69', '396', '2006-02-15T10:05:03'), + ('117', '432', '2006-02-15T10:05:03'), + ('86', '432', '2006-02-15T10:05:03'), + ('199', '432', '2006-02-15T10:05:03'), + ('131', '432', '2006-02-15T10:05:03'), + ('55', '486', '2006-02-15T10:05:03'), + ('153', '486', '2006-02-15T10:05:03'), + ('194', '486', '2006-02-15T10:05:03'), + ('86', '486', '2006-02-15T10:05:03'), + ('184', '486', '2006-02-15T10:05:03'), + ('96', '486', '2006-02-15T10:05:03'), + ('192', '592', '2006-02-15T10:05:03'), + ('173', '592', '2006-02-15T10:05:03'), + ('195', '592', '2006-02-15T10:05:03'), + ('119', '592', '2006-02-15T10:05:03'), + ('130', '592', '2006-02-15T10:05:03'), + ('57', '592', '2006-02-15T10:05:03'), + ('145', '592', '2006-02-15T10:05:03'), + ('26', '21', '2006-02-15T10:05:03'), + ('119', '21', '2006-02-15T10:05:03'), + ('25', '21', '2006-02-15T10:05:03'), + ('105', '21', '2006-02-15T10:05:03'), + ('126', '21', '2006-02-15T10:05:03'), + ('196', '122', '2006-02-15T10:05:03'), + ('53', '122', '2006-02-15T10:05:03'), + ('57', '122', '2006-02-15T10:05:03'), + ('37', '122', '2006-02-15T10:05:03'), + ('76', '122', '2006-02-15T10:05:03'), + ('94', '122', '2006-02-15T10:05:03'), + ('157', '122', '2006-02-15T10:05:03'), + ('40', '163', '2006-02-15T10:05:03'), + ('31', '163', '2006-02-15T10:05:03'), + ('194', '163', '2006-02-15T10:05:03'), + ('86', '163', '2006-02-15T10:05:03'), + ('49', '709', '2006-02-15T10:05:03'), + ('193', '709', '2006-02-15T10:05:03'), + ('11', '709', '2006-02-15T10:05:03'), + ('80', '709', '2006-02-15T10:05:03'), + ('55', '709', '2006-02-15T10:05:03'), + ('76', '709', '2006-02-15T10:05:03'), + ('121', '847', '2006-02-15T10:05:03'), + ('180', '847', '2006-02-15T10:05:03'), + ('14', '847', '2006-02-15T10:05:03'), + ('51', '847', '2006-02-15T10:05:03'), + ('111', '847', '2006-02-15T10:05:03'), + ('153', '847', '2006-02-15T10:05:03'), + ('169', '847', '2006-02-15T10:05:03'), + ('139', '744', '2006-02-15T10:05:03'), + ('75', '744', '2006-02-15T10:05:03'), + ('178', '744', '2006-02-15T10:05:03'), + ('102', '744', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('93', '744', '2006-02-15T10:05:03'), + ('108', '744', '2006-02-15T10:05:03'), + ('40', '744', '2006-02-15T10:05:03'), + ('111', '744', '2006-02-15T10:05:03'), + ('181', '744', '2006-02-15T10:05:03'), + ('172', '744', '2006-02-15T10:05:03'), + ('117', '710', '2006-02-15T10:05:03'), + ('81', '710', '2006-02-15T10:05:03'), + ('127', '710', '2006-02-15T10:05:03'), + ('172', '710', '2006-02-15T10:05:03'), + ('142', '710', '2006-02-15T10:05:03'), + ('125', '710', '2006-02-15T10:05:03'), + ('98', '710', '2006-02-15T10:05:03'), + ('106', '866', '2006-02-15T10:05:03'), + ('76', '866', '2006-02-15T10:05:03'), + ('114', '866', '2006-02-15T10:05:03'), + ('115', '277', '2006-02-15T10:05:03'), + ('1', '277', '2006-02-15T10:05:03'), + ('37', '277', '2006-02-15T10:05:03'), + ('107', '277', '2006-02-15T10:05:03'), + ('24', '277', '2006-02-15T10:05:03'), + ('109', '967', '2006-02-15T10:05:03'), + ('16', '967', '2006-02-15T10:05:03'), + ('3', '967', '2006-02-15T10:05:03'), + ('158', '967', '2006-02-15T10:05:03'), + ('99', '967', '2006-02-15T10:05:03'), + ('157', '967', '2006-02-15T10:05:03'), + ('184', '967', '2006-02-15T10:05:03'), + ('100', '967', '2006-02-15T10:05:03'), + ('197', '967', '2006-02-15T10:05:03'), + ('27', '967', '2006-02-15T10:05:03'), + ('44', '604', '2006-02-15T10:05:03'), + ('157', '604', '2006-02-15T10:05:03'), + ('199', '604', '2006-02-15T10:05:03'), + ('76', '604', '2006-02-15T10:05:03'), + ('181', '604', '2006-02-15T10:05:03'), + ('173', '80', '2006-02-15T10:05:03'), + ('193', '80', '2006-02-15T10:05:03'), + ('200', '80', '2006-02-15T10:05:03'), + ('16', '80', '2006-02-15T10:05:03'), + ('148', '718', '2006-02-15T10:05:03'), + ('87', '718', '2006-02-15T10:05:03'), + ('13', '718', '2006-02-15T10:05:03'), + ('100', '718', '2006-02-15T10:05:03'), + ('72', '718', '2006-02-15T10:05:03'), + ('122', '718', '2006-02-15T10:05:03'), + ('196', '972', '2006-02-15T10:05:03'), + ('67', '972', '2006-02-15T10:05:03'), + ('33', '972', '2006-02-15T10:05:03'), + ('178', '762', '2006-02-15T10:05:03'), + ('144', '762', '2006-02-15T10:05:03'), + ('78', '762', '2006-02-15T10:05:03'), + ('2', '742', '2006-02-15T10:05:03'), + ('116', '742', '2006-02-15T10:05:03'), + ('124', '742', '2006-02-15T10:05:03'), + ('22', '742', '2006-02-15T10:05:03'), + ('140', '742', '2006-02-15T10:05:03'), + ('167', '864', '2006-02-15T10:05:03'), + ('89', '864', '2006-02-15T10:05:03'), + ('69', '864', '2006-02-15T10:05:03'), + ('182', '864', '2006-02-15T10:05:03'), + ('117', '864', '2006-02-15T10:05:03'), + ('147', '864', '2006-02-15T10:05:03'), + ('105', '864', '2006-02-15T10:05:03'), + ('145', '409', '2006-02-15T10:05:03'), + ('181', '409', '2006-02-15T10:05:03'), + ('107', '409', '2006-02-15T10:05:03'), + ('163', '409', '2006-02-15T10:05:03'), + ('162', '409', '2006-02-15T10:05:03'), + ('93', '916', '2006-02-15T10:05:03'), + ('197', '916', '2006-02-15T10:05:03'), + ('79', '916', '2006-02-15T10:05:03'), + ('125', '949', '2006-02-15T10:05:03'), + ('149', '949', '2006-02-15T10:05:03'), + ('15', '949', '2006-02-15T10:05:03'), + ('183', '949', '2006-02-15T10:05:03'), + ('128', '949', '2006-02-15T10:05:03'), + ('185', '882', '2006-02-15T10:05:03'), + ('167', '882', '2006-02-15T10:05:03'), + ('133', '882', '2006-02-15T10:05:03'), + ('189', '882', '2006-02-15T10:05:03'), + ('124', '882', '2006-02-15T10:05:03'), + ('125', '683', '2006-02-15T10:05:03'), + ('134', '683', '2006-02-15T10:05:03'), + ('39', '683', '2006-02-15T10:05:03'), + ('177', '683', '2006-02-15T10:05:03'), + ('65', '683', '2006-02-15T10:05:03'), + ('119', '751', '2006-02-15T10:05:03'), + ('44', '751', '2006-02-15T10:05:03'), + ('177', '751', '2006-02-15T10:05:03'), + ('126', '193', '2006-02-15T10:05:03'), + ('6', '193', '2006-02-15T10:05:03'), + ('136', '193', '2006-02-15T10:05:03'), + ('149', '193', '2006-02-15T10:05:03'), + ('154', '193', '2006-02-15T10:05:03'), + ('179', '193', '2006-02-15T10:05:03'), + ('88', '193', '2006-02-15T10:05:03'), + ('94', '193', '2006-02-15T10:05:03'), + ('22', '775', '2006-02-15T10:05:03'), + ('94', '775', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('33', '775', '2006-02-15T10:05:03'), + ('124', '775', '2006-02-15T10:05:03'), + ('156', '775', '2006-02-15T10:05:03'), + ('191', '775', '2006-02-15T10:05:03'), + ('84', '975', '2006-02-15T10:05:03'), + ('45', '975', '2006-02-15T10:05:03'), + ('192', '680', '2006-02-15T10:05:03'), + ('93', '680', '2006-02-15T10:05:03'), + ('45', '680', '2006-02-15T10:05:03'), + ('152', '680', '2006-02-15T10:05:03'), + ('143', '680', '2006-02-15T10:05:03'), + ('113', '680', '2006-02-15T10:05:03'), + ('154', '680', '2006-02-15T10:05:03'), + ('159', '680', '2006-02-15T10:05:03'), + ('111', '680', '2006-02-15T10:05:03'), + ('21', '680', '2006-02-15T10:05:03'), + ('80', '680', '2006-02-15T10:05:03'), + ('165', '204', '2006-02-15T10:05:03'), + ('25', '204', '2006-02-15T10:05:03'), + ('9', '204', '2006-02-15T10:05:03'), + ('37', '204', '2006-02-15T10:05:03'), + ('125', '204', '2006-02-15T10:05:03'), + ('106', '204', '2006-02-15T10:05:03'), + ('43', '56', '2006-02-15T10:05:03'), + ('136', '56', '2006-02-15T10:05:03'), + ('4', '56', '2006-02-15T10:05:03'), + ('137', '56', '2006-02-15T10:05:03'), + ('33', '56', '2006-02-15T10:05:03'), + ('22', '56', '2006-02-15T10:05:03'), + ('129', '56', '2006-02-15T10:05:03'), + ('168', '56', '2006-02-15T10:05:03'), + ('158', '102', '2006-02-15T10:05:03'), + ('188', '102', '2006-02-15T10:05:03'), + ('170', '102', '2006-02-15T10:05:03'), + ('49', '595', '2006-02-15T10:05:03'), + ('100', '991', '2006-02-15T10:05:03'), + ('46', '991', '2006-02-15T10:05:03'), + ('181', '991', '2006-02-15T10:05:03'), + ('92', '991', '2006-02-15T10:05:03'), + ('166', '580', '2006-02-15T10:05:03'), + ('184', '580', '2006-02-15T10:05:03'), + ('90', '100', '2006-02-15T10:05:03'), + ('125', '100', '2006-02-15T10:05:03'), + ('172', '100', '2006-02-15T10:05:03'), + ('41', '100', '2006-02-15T10:05:03'), + ('62', '100', '2006-02-15T10:05:03'), + ('49', '558', '2006-02-15T10:05:03'), + ('105', '558', '2006-02-15T10:05:03'), + ('118', '558', '2006-02-15T10:05:03'), + ('134', '558', '2006-02-15T10:05:03'), + ('85', '558', '2006-02-15T10:05:03'), + ('53', '725', '2006-02-15T10:05:03'), + ('70', '725', '2006-02-15T10:05:03'), + ('49', '725', '2006-02-15T10:05:03'), + ('66', '725', '2006-02-15T10:05:03'), + ('98', '725', '2006-02-15T10:05:03'), + ('130', '725', '2006-02-15T10:05:03'), + ('123', '725', '2006-02-15T10:05:03'), + ('67', '725', '2006-02-15T10:05:03'), + ('153', '756', '2006-02-15T10:05:03'), + ('19', '756', '2006-02-15T10:05:03'), + ('132', '756', '2006-02-15T10:05:03'), + ('15', '342', '2006-02-15T10:05:03'), + ('148', '342', '2006-02-15T10:05:03'), + ('80', '342', '2006-02-15T10:05:03'), + ('29', '342', '2006-02-15T10:05:03'), + ('171', '342', '2006-02-15T10:05:03'), + ('89', '342', '2006-02-15T10:05:03'), + ('151', '342', '2006-02-15T10:05:03'), + ('97', '342', '2006-02-15T10:05:03'), + ('66', '342', '2006-02-15T10:05:03'), + ('133', '342', '2006-02-15T10:05:03'), + ('159', '342', '2006-02-15T10:05:03'), + ('196', '615', '2006-02-15T10:05:03'), + ('115', '615', '2006-02-15T10:05:03'), + ('35', '615', '2006-02-15T10:05:03'), + ('83', '615', '2006-02-15T10:05:03'), + ('65', '615', '2006-02-15T10:05:03'), + ('184', '615', '2006-02-15T10:05:03'), + ('152', '615', '2006-02-15T10:05:03'), + ('87', '312', '2006-02-15T10:05:03'), + ('48', '312', '2006-02-15T10:05:03'), + ('155', '312', '2006-02-15T10:05:03'), + ('32', '312', '2006-02-15T10:05:03'), + ('128', '312', '2006-02-15T10:05:03'), + ('112', '312', '2006-02-15T10:05:03'), + ('97', '312', '2006-02-15T10:05:03'), + ('144', '312', '2006-02-15T10:05:03'), + ('95', '312', '2006-02-15T10:05:03'), + ('84', '312', '2006-02-15T10:05:03'), + ('124', '312', '2006-02-15T10:05:03'), + ('117', '15', '2006-02-15T10:05:03'), + ('105', '15', '2006-02-15T10:05:03'), + ('164', '15', '2006-02-15T10:05:03'), + ('69', '15', '2006-02-15T10:05:03'), + ('36', '15', '2006-02-15T10:05:03'), + ('170', '15', '2006-02-15T10:05:03'), + ('123', '494', '2006-02-15T10:05:03'), + ('195', '494', '2006-02-15T10:05:03'), + ('101', '494', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('40', '494', '2006-02-15T10:05:03'), + ('142', '494', '2006-02-15T10:05:03'), + ('145', '494', '2006-02-15T10:05:03'), + ('185', '494', '2006-02-15T10:05:03'), + ('131', '494', '2006-02-15T10:05:03'), + ('85', '630', '2006-02-15T10:05:03'), + ('155', '630', '2006-02-15T10:05:03'), + ('55', '27', '2006-02-15T10:05:03'), + ('154', '27', '2006-02-15T10:05:03'), + ('170', '27', '2006-02-15T10:05:03'), + ('7', '27', '2006-02-15T10:05:03'), + ('140', '27', '2006-02-15T10:05:03'), + ('179', '27', '2006-02-15T10:05:03'), + ('148', '27', '2006-02-15T10:05:03'), + ('110', '27', '2006-02-15T10:05:03'), + ('99', '27', '2006-02-15T10:05:03'), + ('28', '827', '2006-02-15T10:05:03'), + ('114', '827', '2006-02-15T10:05:03'), + ('43', '827', '2006-02-15T10:05:03'), + ('55', '827', '2006-02-15T10:05:03'), + ('3', '827', '2006-02-15T10:05:03'), + ('38', '827', '2006-02-15T10:05:03'), + ('177', '827', '2006-02-15T10:05:03'), + ('191', '827', '2006-02-15T10:05:03'), + ('176', '827', '2006-02-15T10:05:03'), + ('81', '827', '2006-02-15T10:05:03'), + ('174', '827', '2006-02-15T10:05:03'), + ('30', '565', '2006-02-15T10:05:03'), + ('73', '565', '2006-02-15T10:05:03'), + ('112', '565', '2006-02-15T10:05:03'), + ('111', '382', '2006-02-15T10:05:03'), + ('127', '382', '2006-02-15T10:05:03'), + ('151', '382', '2006-02-15T10:05:03'), + ('62', '231', '2006-02-15T10:05:03'), + ('112', '231', '2006-02-15T10:05:03'), + ('20', '231', '2006-02-15T10:05:03'), + ('36', '231', '2006-02-15T10:05:03'), + ('120', '231', '2006-02-15T10:05:03'), + ('153', '231', '2006-02-15T10:05:03'), + ('11', '587', '2006-02-15T10:05:03'), + ('39', '587', '2006-02-15T10:05:03'), + ('196', '587', '2006-02-15T10:05:03'), + ('178', '587', '2006-02-15T10:05:03'), + ('10', '587', '2006-02-15T10:05:03'), + ('140', '587', '2006-02-15T10:05:03'), + ('158', '581', '2006-02-15T10:05:03'), + ('198', '924', '2006-02-15T10:05:03'), + ('47', '924', '2006-02-15T10:05:03'), + ('161', '924', '2006-02-15T10:05:03'), + ('15', '924', '2006-02-15T10:05:03'), + ('50', '924', '2006-02-15T10:05:03'), + ('4', '924', '2006-02-15T10:05:03'), + ('179', '924', '2006-02-15T10:05:03'), + ('34', '720', '2006-02-15T10:05:03'), + ('146', '720', '2006-02-15T10:05:03'), + ('69', '720', '2006-02-15T10:05:03'), + ('182', '720', '2006-02-15T10:05:03'), + ('74', '720', '2006-02-15T10:05:03'), + ('79', '262', '2006-02-15T10:05:03'), + ('30', '262', '2006-02-15T10:05:03'), + ('60', '262', '2006-02-15T10:05:03'), + ('90', '262', '2006-02-15T10:05:03'), + ('139', '262', '2006-02-15T10:05:03'), + ('136', '262', '2006-02-15T10:05:03'), + ('80', '262', '2006-02-15T10:05:03'), + ('198', '262', '2006-02-15T10:05:03'), + ('156', '262', '2006-02-15T10:05:03'), + ('176', '946', '2006-02-15T10:05:03'), + ('59', '946', '2006-02-15T10:05:03'), + ('73', '946', '2006-02-15T10:05:03'), + ('141', '862', '2006-02-15T10:05:03'), + ('59', '862', '2006-02-15T10:05:03'), + ('56', '862', '2006-02-15T10:05:03'), + ('76', '862', '2006-02-15T10:05:03'), + ('139', '862', '2006-02-15T10:05:03'), + ('29', '862', '2006-02-15T10:05:03'), + ('97', '862', '2006-02-15T10:05:03'), + ('183', '862', '2006-02-15T10:05:03'), + ('119', '900', '2006-02-15T10:05:03'), + ('37', '900', '2006-02-15T10:05:03'), + ('45', '900', '2006-02-15T10:05:03'), + ('7', '900', '2006-02-15T10:05:03'), + ('190', '682', '2006-02-15T10:05:03'), + ('192', '682', '2006-02-15T10:05:03'), + ('26', '682', '2006-02-15T10:05:03'), + ('27', '682', '2006-02-15T10:05:03'), + ('120', '682', '2006-02-15T10:05:03'), + ('178', '708', '2006-02-15T10:05:03'), + ('192', '708', '2006-02-15T10:05:03'), + ('147', '708', '2006-02-15T10:05:03'), + ('190', '708', '2006-02-15T10:05:03'), + ('118', '938', '2006-02-15T10:05:03'), + ('153', '938', '2006-02-15T10:05:03'), + ('65', '938', '2006-02-15T10:05:03'), + ('40', '938', '2006-02-15T10:05:03'), + ('77', '938', '2006-02-15T10:05:03'), + ('194', '938', '2006-02-15T10:05:03'), + ('129', '938', '2006-02-15T10:05:03'), + ('11', '938', '2006-02-15T10:05:03'), + ('72', '938', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('170', '758', '2006-02-15T10:05:03'), + ('101', '758', '2006-02-15T10:05:03'), + ('137', '758', '2006-02-15T10:05:03'), + ('172', '758', '2006-02-15T10:05:03'), + ('176', '758', '2006-02-15T10:05:03'), + ('197', '758', '2006-02-15T10:05:03'), + ('16', '758', '2006-02-15T10:05:03'), + ('7', '758', '2006-02-15T10:05:03'), + ('198', '758', '2006-02-15T10:05:03'), + ('26', '758', '2006-02-15T10:05:03'), + ('78', '265', '2006-02-15T10:05:03'), + ('185', '265', '2006-02-15T10:05:03'), + ('149', '685', '2006-02-15T10:05:03'), + ('3', '685', '2006-02-15T10:05:03'), + ('168', '685', '2006-02-15T10:05:03'), + ('57', '685', '2006-02-15T10:05:03'), + ('126', '685', '2006-02-15T10:05:03'), + ('184', '35', '2006-02-15T10:05:03'), + ('113', '35', '2006-02-15T10:05:03'), + ('7', '35', '2006-02-15T10:05:03'), + ('135', '35', '2006-02-15T10:05:03'), + ('95', '35', '2006-02-15T10:05:03'), + ('118', '35', '2006-02-15T10:05:03'), + ('35', '35', '2006-02-15T10:05:03'), + ('139', '35', '2006-02-15T10:05:03'), + ('63', '392', '2006-02-15T10:05:03'), + ('195', '392', '2006-02-15T10:05:03'), + ('5', '392', '2006-02-15T10:05:03'), + ('107', '392', '2006-02-15T10:05:03'), + ('26', '392', '2006-02-15T10:05:03'), + ('23', '804', '2006-02-15T10:05:03'), + ('168', '804', '2006-02-15T10:05:03'), + ('74', '804', '2006-02-15T10:05:03'), + ('21', '804', '2006-02-15T10:05:03'), + ('100', '815', '2006-02-15T10:05:03'), + ('197', '815', '2006-02-15T10:05:03'), + ('188', '815', '2006-02-15T10:05:03'), + ('39', '815', '2006-02-15T10:05:03'), + ('55', '815', '2006-02-15T10:05:03'), + ('196', '815', '2006-02-15T10:05:03'), + ('169', '815', '2006-02-15T10:05:03'), + ('9', '815', '2006-02-15T10:05:03'), + ('32', '815', '2006-02-15T10:05:03'), + ('157', '574', '2006-02-15T10:05:03'), + ('71', '574', '2006-02-15T10:05:03'), + ('184', '574', '2006-02-15T10:05:03'), + ('28', '574', '2006-02-15T10:05:03'), + ('107', '574', '2006-02-15T10:05:03'), + ('84', '574', '2006-02-15T10:05:03'), + ('33', '574', '2006-02-15T10:05:03'), + ('162', '574', '2006-02-15T10:05:03'), + ('151', '574', '2006-02-15T10:05:03'), + ('79', '430', '2006-02-15T10:05:03'), + ('107', '430', '2006-02-15T10:05:03'), + ('96', '430', '2006-02-15T10:05:03'), + ('22', '430', '2006-02-15T10:05:03'), + ('98', '721', '2006-02-15T10:05:03'), + ('4', '721', '2006-02-15T10:05:03'), + ('108', '721', '2006-02-15T10:05:03'), + ('41', '721', '2006-02-15T10:05:03'), + ('87', '721', '2006-02-15T10:05:03'), + ('139', '706', '2006-02-15T10:05:03'), + ('143', '706', '2006-02-15T10:05:03'), + ('87', '706', '2006-02-15T10:05:03'), + ('195', '706', '2006-02-15T10:05:03'), + ('68', '706', '2006-02-15T10:05:03'), + ('66', '706', '2006-02-15T10:05:03'), + ('190', '693', '2006-02-15T10:05:03'), + ('140', '693', '2006-02-15T10:05:03'), + ('128', '693', '2006-02-15T10:05:03'), + ('108', '693', '2006-02-15T10:05:03'), + ('131', '693', '2006-02-15T10:05:03'), + ('119', '693', '2006-02-15T10:05:03'), + ('165', '693', '2006-02-15T10:05:03'), + ('118', '39', '2006-02-15T10:05:03'), + ('65', '39', '2006-02-15T10:05:03'), + ('104', '39', '2006-02-15T10:05:03'), + ('191', '39', '2006-02-15T10:05:03'), + ('145', '39', '2006-02-15T10:05:03'), + ('84', '39', '2006-02-15T10:05:03'), + ('177', '39', '2006-02-15T10:05:03'), + ('86', '196', '2006-02-15T10:05:03'), + ('168', '196', '2006-02-15T10:05:03'), + ('90', '855', '2006-02-15T10:05:03'), + ('23', '855', '2006-02-15T10:05:03'), + ('95', '855', '2006-02-15T10:05:03'), + ('25', '179', '2006-02-15T10:05:03'), + ('60', '179', '2006-02-15T10:05:03'), + ('8', '179', '2006-02-15T10:05:03'), + ('192', '179', '2006-02-15T10:05:03'), + ('111', '179', '2006-02-15T10:05:03'), + ('21', '179', '2006-02-15T10:05:03'), + ('101', '255', '2006-02-15T10:05:03'), + ('166', '255', '2006-02-15T10:05:03'), + ('68', '255', '2006-02-15T10:05:03'), + ('8', '255', '2006-02-15T10:05:03'), + ('14', '255', '2006-02-15T10:05:03'), + ('168', '255', '2006-02-15T10:05:03'), + ('120', '255', '2006-02-15T10:05:03'), + ('74', '617', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('101', '617', '2006-02-15T10:05:03'), + ('187', '617', '2006-02-15T10:05:03'), + ('127', '617', '2006-02-15T10:05:03'), + ('79', '634', '2006-02-15T10:05:03'), + ('22', '634', '2006-02-15T10:05:03'), + ('169', '634', '2006-02-15T10:05:03'), + ('151', '634', '2006-02-15T10:05:03'), + ('98', '634', '2006-02-15T10:05:03'), + ('181', '83', '2006-02-15T10:05:03'), + ('122', '83', '2006-02-15T10:05:03'), + ('106', '83', '2006-02-15T10:05:03'), + ('24', '83', '2006-02-15T10:05:03'), + ('117', '783', '2006-02-15T10:05:03'), + ('15', '783', '2006-02-15T10:05:03'), + ('60', '783', '2006-02-15T10:05:03'), + ('43', '276', '2006-02-15T10:05:03'), + ('154', '276', '2006-02-15T10:05:03'), + ('196', '276', '2006-02-15T10:05:03'), + ('65', '276', '2006-02-15T10:05:03'), + ('139', '282', '2006-02-15T10:05:03'), + ('154', '282', '2006-02-15T10:05:03'), + ('49', '282', '2006-02-15T10:05:03'), + ('29', '282', '2006-02-15T10:05:03'), + ('60', '784', '2006-02-15T10:05:03'), + ('199', '784', '2006-02-15T10:05:03'), + ('116', '784', '2006-02-15T10:05:03'), + ('20', '784', '2006-02-15T10:05:03'), + ('83', '784', '2006-02-15T10:05:03'), + ('41', '784', '2006-02-15T10:05:03'), + ('159', '784', '2006-02-15T10:05:03'), + ('44', '784', '2006-02-15T10:05:03'), + ('147', '405', '2006-02-15T10:05:03'), + ('175', '405', '2006-02-15T10:05:03'), + ('72', '405', '2006-02-15T10:05:03'), + ('24', '405', '2006-02-15T10:05:03'), + ('173', '405', '2006-02-15T10:05:03'), + ('25', '688', '2006-02-15T10:05:03'), + ('147', '688', '2006-02-15T10:05:03'), + ('173', '688', '2006-02-15T10:05:03'), + ('22', '688', '2006-02-15T10:05:03'), + ('62', '688', '2006-02-15T10:05:03'), + ('155', '688', '2006-02-15T10:05:03'), + ('26', '688', '2006-02-15T10:05:03'), + ('80', '688', '2006-02-15T10:05:03'), + ('14', '688', '2006-02-15T10:05:03'), + ('137', '688', '2006-02-15T10:05:03'), + ('48', '506', '2006-02-15T10:05:03'), + ('1', '506', '2006-02-15T10:05:03'), + ('180', '506', '2006-02-15T10:05:03'), + ('188', '506', '2006-02-15T10:05:03'), + ('104', '506', '2006-02-15T10:05:03'), + ('49', '506', '2006-02-15T10:05:03'), + ('115', '506', '2006-02-15T10:05:03'), + ('64', '506', '2006-02-15T10:05:03'), + ('54', '842', '2006-02-15T10:05:03'), + ('142', '842', '2006-02-15T10:05:03'), + ('175', '842', '2006-02-15T10:05:03'), + ('18', '842', '2006-02-15T10:05:03'), + ('136', '842', '2006-02-15T10:05:03'), + ('23', '842', '2006-02-15T10:05:03'), + ('154', '842', '2006-02-15T10:05:03'), + ('135', '353', '2006-02-15T10:05:03'), + ('38', '353', '2006-02-15T10:05:03'), + ('121', '353', '2006-02-15T10:05:03'), + ('157', '353', '2006-02-15T10:05:03'), + ('113', '353', '2006-02-15T10:05:03'), + ('95', '353', '2006-02-15T10:05:03'), + ('179', '353', '2006-02-15T10:05:03'), + ('161', '353', '2006-02-15T10:05:03'), + ('161', '188', '2006-02-15T10:05:03'), + ('149', '188', '2006-02-15T10:05:03'), + ('177', '188', '2006-02-15T10:05:03'), + ('114', '188', '2006-02-15T10:05:03'), + ('141', '188', '2006-02-15T10:05:03'), + ('82', '188', '2006-02-15T10:05:03'), + ('158', '188', '2006-02-15T10:05:03'), + ('112', '188', '2006-02-15T10:05:03'), + ('31', '188', '2006-02-15T10:05:03'), + ('125', '188', '2006-02-15T10:05:03'), + ('97', '188', '2006-02-15T10:05:03'), + ('173', '188', '2006-02-15T10:05:03'), + ('168', '188', '2006-02-15T10:05:03'), + ('76', '187', '2006-02-15T10:05:03'), + ('186', '187', '2006-02-15T10:05:03'), + ('45', '187', '2006-02-15T10:05:03'), + ('14', '187', '2006-02-15T10:05:03'), + ('89', '187', '2006-02-15T10:05:03'), + ('159', '187', '2006-02-15T10:05:03'), + ('144', '164', '2006-02-15T10:05:03'), + ('162', '164', '2006-02-15T10:05:03'), + ('45', '164', '2006-02-15T10:05:03'), + ('48', '164', '2006-02-15T10:05:03'), + ('31', '164', '2006-02-15T10:05:03'), + ('178', '164', '2006-02-15T10:05:03'), + ('24', '164', '2006-02-15T10:05:03'), + ('193', '164', '2006-02-15T10:05:03'), + ('6', '164', '2006-02-15T10:05:03'), + ('197', '164', '2006-02-15T10:05:03'), + ('197', '249', '2006-02-15T10:05:03'), + ('86', '249', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('72', '249', '2006-02-15T10:05:03'), + ('63', '249', '2006-02-15T10:05:03'), + ('137', '249', '2006-02-15T10:05:03'), + ('41', '249', '2006-02-15T10:05:03'), + ('83', '249', '2006-02-15T10:05:03'), + ('52', '249', '2006-02-15T10:05:03'), + ('2', '249', '2006-02-15T10:05:03'), + ('113', '249', '2006-02-15T10:05:03'), + ('70', '249', '2006-02-15T10:05:03'), + ('155', '249', '2006-02-15T10:05:03'), + ('129', '249', '2006-02-15T10:05:03'), + ('69', '722', '2006-02-15T10:05:03'), + ('120', '722', '2006-02-15T10:05:03'), + ('9', '722', '2006-02-15T10:05:03'), + ('174', '722', '2006-02-15T10:05:03'), + ('38', '618', '2006-02-15T10:05:03'), + ('3', '618', '2006-02-15T10:05:03'), + ('33', '618', '2006-02-15T10:05:03'), + ('192', '618', '2006-02-15T10:05:03'), + ('174', '618', '2006-02-15T10:05:03'), + ('99', '618', '2006-02-15T10:05:03'), + ('92', '618', '2006-02-15T10:05:03'), + ('7', '618', '2006-02-15T10:05:03'), + ('152', '729', '2006-02-15T10:05:03'), + ('180', '729', '2006-02-15T10:05:03'), + ('13', '729', '2006-02-15T10:05:03'), + ('84', '729', '2006-02-15T10:05:03'), + ('175', '729', '2006-02-15T10:05:03'), + ('140', '729', '2006-02-15T10:05:03'), + ('81', '729', '2006-02-15T10:05:03'), + ('186', '729', '2006-02-15T10:05:03'), + ('49', '729', '2006-02-15T10:05:03'), + ('93', '874', '2006-02-15T10:05:03'), + ('180', '874', '2006-02-15T10:05:03'), + ('181', '874', '2006-02-15T10:05:03'), + ('96', '874', '2006-02-15T10:05:03'), + ('17', '874', '2006-02-15T10:05:03'), + ('190', '874', '2006-02-15T10:05:03'), + ('157', '874', '2006-02-15T10:05:03'), + ('71', '874', '2006-02-15T10:05:03'), + ('178', '397', '2006-02-15T10:05:03'), + ('133', '397', '2006-02-15T10:05:03'), + ('171', '397', '2006-02-15T10:05:03'), + ('51', '408', '2006-02-15T10:05:03'), + ('67', '408', '2006-02-15T10:05:03'), + ('54', '861', '2006-02-15T10:05:03'), + ('114', '861', '2006-02-15T10:05:03'), + ('134', '861', '2006-02-15T10:05:03'), + ('42', '861', '2006-02-15T10:05:03'), + ('67', '861', '2006-02-15T10:05:03'), + ('140', '576', '2006-02-15T10:05:03'), + ('123', '576', '2006-02-15T10:05:03'), + ('143', '576', '2006-02-15T10:05:03'), + ('196', '576', '2006-02-15T10:05:03'), + ('67', '576', '2006-02-15T10:05:03'), + ('47', '576', '2006-02-15T10:05:03'), + ('183', '576', '2006-02-15T10:05:03'), + ('53', '576', '2006-02-15T10:05:03'), + ('36', '931', '2006-02-15T10:05:03'), + ('179', '931', '2006-02-15T10:05:03'), + ('107', '112', '2006-02-15T10:05:03'), + ('6', '112', '2006-02-15T10:05:03'), + ('32', '112', '2006-02-15T10:05:03'), + ('140', '112', '2006-02-15T10:05:03'), + ('51', '112', '2006-02-15T10:05:03'), + ('24', '112', '2006-02-15T10:05:03'), + ('130', '112', '2006-02-15T10:05:03'), + ('33', '112', '2006-02-15T10:05:03'), + ('65', '496', '2006-02-15T10:05:03'), + ('167', '496', '2006-02-15T10:05:03'), + ('173', '496', '2006-02-15T10:05:03'), + ('174', '496', '2006-02-15T10:05:03'), + ('67', '496', '2006-02-15T10:05:03'), + ('157', '496', '2006-02-15T10:05:03'), + ('183', '941', '2006-02-15T10:05:03'), + ('101', '941', '2006-02-15T10:05:03'), + ('155', '941', '2006-02-15T10:05:03'), + ('80', '941', '2006-02-15T10:05:03'), + ('91', '941', '2006-02-15T10:05:03'), + ('189', '171', '2006-02-15T10:05:03'), + ('5', '171', '2006-02-15T10:05:03'), + ('36', '171', '2006-02-15T10:05:03'), + ('119', '171', '2006-02-15T10:05:03'), + ('57', '101', '2006-02-15T10:05:03'), + ('62', '101', '2006-02-15T10:05:03'), + ('48', '101', '2006-02-15T10:05:03'), + ('129', '101', '2006-02-15T10:05:03'), + ('16', '101', '2006-02-15T10:05:03'), + ('125', '114', '2006-02-15T10:05:03'), + ('57', '114', '2006-02-15T10:05:03'), + ('7', '957', '2006-02-15T10:05:03'), + ('50', '957', '2006-02-15T10:05:03'), + ('118', '957', '2006-02-15T10:05:03'), + ('85', '957', '2006-02-15T10:05:03'), + ('147', '957', '2006-02-15T10:05:03'), + ('17', '957', '2006-02-15T10:05:03'), + ('122', '957', '2006-02-15T10:05:03'), + ('164', '957', '2006-02-15T10:05:03'), + ('66', '957', '2006-02-15T10:05:03'), + ('42', '502', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('15', '502', '2006-02-15T10:05:03'), + ('57', '502', '2006-02-15T10:05:03'), + ('45', '502', '2006-02-15T10:05:03'), + ('28', '502', '2006-02-15T10:05:03'), + ('34', '502', '2006-02-15T10:05:03'), + ('51', '5', '2006-02-15T10:05:03'), + ('181', '5', '2006-02-15T10:05:03'), + ('103', '5', '2006-02-15T10:05:03'), + ('200', '5', '2006-02-15T10:05:03'), + ('59', '5', '2006-02-15T10:05:03'), + ('96', '987', '2006-02-15T10:05:03'), + ('132', '987', '2006-02-15T10:05:03'), + ('124', '987', '2006-02-15T10:05:03'), + ('147', '987', '2006-02-15T10:05:03'), + ('155', '987', '2006-02-15T10:05:03'), + ('110', '987', '2006-02-15T10:05:03'), + ('40', '723', '2006-02-15T10:05:03'), + ('29', '723', '2006-02-15T10:05:03'), + ('113', '723', '2006-02-15T10:05:03'), + ('146', '429', '2006-02-15T10:05:03'), + ('11', '429', '2006-02-15T10:05:03'), + ('123', '429', '2006-02-15T10:05:03'), + ('125', '429', '2006-02-15T10:05:03'), + ('21', '429', '2006-02-15T10:05:03'), + ('31', '978', '2006-02-15T10:05:03'), + ('45', '978', '2006-02-15T10:05:03'), + ('101', '978', '2006-02-15T10:05:03'), + ('159', '978', '2006-02-15T10:05:03'), + ('82', '978', '2006-02-15T10:05:03'), + ('175', '978', '2006-02-15T10:05:03'), + ('99', '978', '2006-02-15T10:05:03'), + ('147', '178', '2006-02-15T10:05:03'), + ('81', '178', '2006-02-15T10:05:03'), + ('158', '178', '2006-02-15T10:05:03'), + ('24', '178', '2006-02-15T10:05:03'), + ('149', '178', '2006-02-15T10:05:03'), + ('50', '178', '2006-02-15T10:05:03'), + ('117', '178', '2006-02-15T10:05:03'), + ('181', '907', '2006-02-15T10:05:03'), + ('159', '907', '2006-02-15T10:05:03'), + ('42', '907', '2006-02-15T10:05:03'), + ('65', '965', '2006-02-15T10:05:03'), + ('33', '965', '2006-02-15T10:05:03'), + ('128', '965', '2006-02-15T10:05:03'), + ('56', '965', '2006-02-15T10:05:03'), + ('125', '965', '2006-02-15T10:05:03'), + ('185', '965', '2006-02-15T10:05:03'), + ('65', '556', '2006-02-15T10:05:03'), + ('57', '852', '2006-02-15T10:05:03'), + ('64', '852', '2006-02-15T10:05:03'), + ('78', '852', '2006-02-15T10:05:03'), + ('102', '852', '2006-02-15T10:05:03'), + ('179', '852', '2006-02-15T10:05:03'), + ('118', '852', '2006-02-15T10:05:03'), + ('174', '852', '2006-02-15T10:05:03'), + ('173', '852', '2006-02-15T10:05:03'), + ('65', '852', '2006-02-15T10:05:03'), + ('54', '600', '2006-02-15T10:05:03'), + ('159', '600', '2006-02-15T10:05:03'), + ('22', '600', '2006-02-15T10:05:03'), + ('102', '600', '2006-02-15T10:05:03'), + ('13', '600', '2006-02-15T10:05:03'), + ('104', '600', '2006-02-15T10:05:03'), + ('99', '600', '2006-02-15T10:05:03'), + ('36', '600', '2006-02-15T10:05:03'), + ('13', '998', '2006-02-15T10:05:03'), + ('44', '998', '2006-02-15T10:05:03'), + ('175', '998', '2006-02-15T10:05:03'), + ('169', '998', '2006-02-15T10:05:03'), + ('73', '998', '2006-02-15T10:05:03'), + ('122', '998', '2006-02-15T10:05:03'), + ('197', '123', '2006-02-15T10:05:03'), + ('102', '123', '2006-02-15T10:05:03'), + ('144', '123', '2006-02-15T10:05:03'), + ('92', '123', '2006-02-15T10:05:03'), + ('183', '914', '2006-02-15T10:05:03'), + ('25', '914', '2006-02-15T10:05:03'), + ('35', '914', '2006-02-15T10:05:03'), + ('191', '914', '2006-02-15T10:05:03'), + ('10', '914', '2006-02-15T10:05:03'), + ('187', '914', '2006-02-15T10:05:03'), + ('142', '914', '2006-02-15T10:05:03'), + ('69', '914', '2006-02-15T10:05:03'), + ('13', '45', '2006-02-15T10:05:03'), + ('163', '45', '2006-02-15T10:05:03'), + ('73', '45', '2006-02-15T10:05:03'), + ('68', '45', '2006-02-15T10:05:03'), + ('4', '616', '2006-02-15T10:05:03'), + ('64', '616', '2006-02-15T10:05:03'), + ('135', '616', '2006-02-15T10:05:03'), + ('158', '616', '2006-02-15T10:05:03'), + ('84', '616', '2006-02-15T10:05:03'), + ('175', '616', '2006-02-15T10:05:03'), + ('157', '616', '2006-02-15T10:05:03'), + ('106', '675', '2006-02-15T10:05:03'), + ('52', '675', '2006-02-15T10:05:03'), + ('77', '749', '2006-02-15T10:05:03'), + ('1', '749', '2006-02-15T10:05:03'), + ('161', '749', '2006-02-15T10:05:03'), + ('127', '749', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('59', '749', '2006-02-15T10:05:03'), + ('40', '521', '2006-02-15T10:05:03'), + ('102', '521', '2006-02-15T10:05:03'), + ('119', '521', '2006-02-15T10:05:03'), + ('94', '521', '2006-02-15T10:05:03'), + ('17', '521', '2006-02-15T10:05:03'), + ('176', '521', '2006-02-15T10:05:03'), + ('56', '521', '2006-02-15T10:05:03'), + ('66', '424', '2006-02-15T10:05:03'), + ('120', '424', '2006-02-15T10:05:03'), + ('52', '424', '2006-02-15T10:05:03'), + ('95', '424', '2006-02-15T10:05:03'), + ('175', '424', '2006-02-15T10:05:03'), + ('72', '636', '2006-02-15T10:05:03'), + ('86', '636', '2006-02-15T10:05:03'), + ('99', '636', '2006-02-15T10:05:03'), + ('139', '636', '2006-02-15T10:05:03'), + ('23', '636', '2006-02-15T10:05:03'), + ('11', '636', '2006-02-15T10:05:03'), + ('54', '636', '2006-02-15T10:05:03'), + ('183', '636', '2006-02-15T10:05:03'), + ('119', '636', '2006-02-15T10:05:03'), + ('162', '636', '2006-02-15T10:05:03'), + ('122', '76', '2006-02-15T10:05:03'), + ('88', '76', '2006-02-15T10:05:03'), + ('187', '76', '2006-02-15T10:05:03'), + ('94', '76', '2006-02-15T10:05:03'), + ('157', '406', '2006-02-15T10:05:03'), + ('90', '406', '2006-02-15T10:05:03'), + ('198', '406', '2006-02-15T10:05:03'), + ('89', '406', '2006-02-15T10:05:03'), + ('62', '406', '2006-02-15T10:05:03'), + ('57', '605', '2006-02-15T10:05:03'), + ('102', '605', '2006-02-15T10:05:03'), + ('1', '605', '2006-02-15T10:05:03'), + ('6', '605', '2006-02-15T10:05:03'), + ('139', '605', '2006-02-15T10:05:03'), + ('43', '605', '2006-02-15T10:05:03'), + ('103', '639', '2006-02-15T10:05:03'), + ('182', '639', '2006-02-15T10:05:03'), + ('172', '639', '2006-02-15T10:05:03'), + ('106', '639', '2006-02-15T10:05:03'), + ('61', '639', '2006-02-15T10:05:03'), + ('138', '639', '2006-02-15T10:05:03'), + ('118', '311', '2006-02-15T10:05:03'), + ('132', '311', '2006-02-15T10:05:03'), + ('198', '311', '2006-02-15T10:05:03'), + ('25', '311', '2006-02-15T10:05:03'), + ('178', '311', '2006-02-15T10:05:03'), + ('188', '311', '2006-02-15T10:05:03'), + ('29', '311', '2006-02-15T10:05:03'), + ('181', '311', '2006-02-15T10:05:03'), + ('108', '495', '2006-02-15T10:05:03'), + ('14', '495', '2006-02-15T10:05:03'), + ('183', '495', '2006-02-15T10:05:03'), + ('22', '495', '2006-02-15T10:05:03'), + ('54', '301', '2006-02-15T10:05:03'), + ('95', '301', '2006-02-15T10:05:03'), + ('30', '301', '2006-02-15T10:05:03'), + ('182', '301', '2006-02-15T10:05:03'), + ('156', '301', '2006-02-15T10:05:03'), + ('78', '301', '2006-02-15T10:05:03'), + ('169', '301', '2006-02-15T10:05:03'), + ('75', '301', '2006-02-15T10:05:03'), + ('181', '301', '2006-02-15T10:05:03'), + ('64', '572', '2006-02-15T10:05:03'), + ('118', '572', '2006-02-15T10:05:03'), + ('37', '572', '2006-02-15T10:05:03'), + ('59', '572', '2006-02-15T10:05:03'), + ('99', '572', '2006-02-15T10:05:03'), + ('96', '572', '2006-02-15T10:05:03'), + ('48', '150', '2006-02-15T10:05:03'), + ('54', '150', '2006-02-15T10:05:03'), + ('27', '150', '2006-02-15T10:05:03'), + ('41', '150', '2006-02-15T10:05:03'), + ('176', '150', '2006-02-15T10:05:03'), + ('127', '36', '2006-02-15T10:05:03'), + ('73', '36', '2006-02-15T10:05:03'), + ('116', '36', '2006-02-15T10:05:03'), + ('96', '36', '2006-02-15T10:05:03'), + ('47', '36', '2006-02-15T10:05:03'), + ('113', '656', '2006-02-15T10:05:03'), + ('97', '656', '2006-02-15T10:05:03'), + ('118', '656', '2006-02-15T10:05:03'), + ('150', '629', '2006-02-15T10:05:03'), + ('145', '629', '2006-02-15T10:05:03'), + ('66', '226', '2006-02-15T10:05:03'), + ('23', '226', '2006-02-15T10:05:03'), + ('29', '226', '2006-02-15T10:05:03'), + ('56', '226', '2006-02-15T10:05:03'), + ('25', '226', '2006-02-15T10:05:03'), + ('148', '226', '2006-02-15T10:05:03'), + ('2', '226', '2006-02-15T10:05:03'), + ('34', '389', '2006-02-15T10:05:03'), + ('81', '389', '2006-02-15T10:05:03'), + ('35', '389', '2006-02-15T10:05:03'), + ('183', '389', '2006-02-15T10:05:03'), + ('37', '925', '2006-02-15T10:05:03'), + ('45', '925', '2006-02-15T10:05:03'), + ('188', '925', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('90', '925', '2006-02-15T10:05:03'), + ('170', '925', '2006-02-15T10:05:03'), + ('64', '925', '2006-02-15T10:05:03'), + ('40', '747', '2006-02-15T10:05:03'), + ('68', '747', '2006-02-15T10:05:03'), + ('192', '747', '2006-02-15T10:05:03'), + ('138', '747', '2006-02-15T10:05:03'), + ('74', '747', '2006-02-15T10:05:03'), + ('73', '77', '2006-02-15T10:05:03'), + ('140', '77', '2006-02-15T10:05:03'), + ('109', '77', '2006-02-15T10:05:03'), + ('30', '77', '2006-02-15T10:05:03'), + ('49', '662', '2006-02-15T10:05:03'), + ('92', '662', '2006-02-15T10:05:03'), + ('101', '662', '2006-02-15T10:05:03'), + ('37', '662', '2006-02-15T10:05:03'), + ('188', '662', '2006-02-15T10:05:03'), + ('142', '328', '2006-02-15T10:05:03'), + ('98', '183', '2006-02-15T10:05:03'), + ('59', '183', '2006-02-15T10:05:03'), + ('157', '183', '2006-02-15T10:05:03'), + ('117', '459', '2006-02-15T10:05:03'), + ('155', '459', '2006-02-15T10:05:03'), + ('127', '459', '2006-02-15T10:05:03'), + ('90', '11', '2006-02-15T10:05:03'), + ('40', '11', '2006-02-15T10:05:03'), + ('174', '11', '2006-02-15T10:05:03'), + ('81', '11', '2006-02-15T10:05:03'), + ('110', '801', '2006-02-15T10:05:03'), + ('191', '801', '2006-02-15T10:05:03'), + ('164', '801', '2006-02-15T10:05:03'), + ('82', '143', '2006-02-15T10:05:03'), + ('119', '143', '2006-02-15T10:05:03'), + ('75', '143', '2006-02-15T10:05:03'), + ('66', '143', '2006-02-15T10:05:03'), + ('97', '143', '2006-02-15T10:05:03'), + ('96', '244', '2006-02-15T10:05:03'), + ('156', '244', '2006-02-15T10:05:03'), + ('67', '244', '2006-02-15T10:05:03'), + ('34', '244', '2006-02-15T10:05:03'), + ('108', '958', '2006-02-15T10:05:03'), + ('143', '958', '2006-02-15T10:05:03'), + ('200', '958', '2006-02-15T10:05:03'), + ('102', '958', '2006-02-15T10:05:03'), + ('43', '958', '2006-02-15T10:05:03'), + ('191', '958', '2006-02-15T10:05:03'), + ('2', '958', '2006-02-15T10:05:03'), + ('76', '958', '2006-02-15T10:05:03'), + ('146', '955', '2006-02-15T10:05:03'), + ('98', '955', '2006-02-15T10:05:03'), + ('115', '955', '2006-02-15T10:05:03'), + ('180', '955', '2006-02-15T10:05:03'), + ('109', '955', '2006-02-15T10:05:03'), + ('164', '367', '2006-02-15T10:05:03'), + ('192', '367', '2006-02-15T10:05:03'), + ('23', '367', '2006-02-15T10:05:03'), + ('125', '367', '2006-02-15T10:05:03'), + ('151', '367', '2006-02-15T10:05:03'), + ('79', '367', '2006-02-15T10:05:03'), + ('129', '367', '2006-02-15T10:05:03'), + ('14', '253', '2006-02-15T10:05:03'), + ('190', '253', '2006-02-15T10:05:03'), + ('165', '253', '2006-02-15T10:05:03'), + ('21', '253', '2006-02-15T10:05:03'), + ('87', '253', '2006-02-15T10:05:03'), + ('60', '253', '2006-02-15T10:05:03'), + ('37', '253', '2006-02-15T10:05:03'), + ('107', '445', '2006-02-15T10:05:03'), + ('93', '445', '2006-02-15T10:05:03'), + ('20', '445', '2006-02-15T10:05:03'), + ('15', '445', '2006-02-15T10:05:03'), + ('62', '445', '2006-02-15T10:05:03'), + ('75', '445', '2006-02-15T10:05:03'), + ('83', '110', '2006-02-15T10:05:03'), + ('29', '110', '2006-02-15T10:05:03'), + ('13', '110', '2006-02-15T10:05:03'), + ('187', '110', '2006-02-15T10:05:03'), + ('171', '166', '2006-02-15T10:05:03'), + ('129', '166', '2006-02-15T10:05:03'), + ('106', '166', '2006-02-15T10:05:03'), + ('192', '166', '2006-02-15T10:05:03'), + ('122', '166', '2006-02-15T10:05:03'), + ('163', '166', '2006-02-15T10:05:03'), + ('1', '166', '2006-02-15T10:05:03'), + ('98', '194', '2006-02-15T10:05:03'), + ('114', '194', '2006-02-15T10:05:03'), + ('41', '194', '2006-02-15T10:05:03'), + ('102', '194', '2006-02-15T10:05:03'), + ('106', '194', '2006-02-15T10:05:03'), + ('81', '194', '2006-02-15T10:05:03'), + ('126', '194', '2006-02-15T10:05:03'), + ('178', '194', '2006-02-15T10:05:03'), + ('24', '194', '2006-02-15T10:05:03'), + ('111', '194', '2006-02-15T10:05:03'), + ('43', '377', '2006-02-15T10:05:03'), + ('105', '377', '2006-02-15T10:05:03'), + ('132', '377', '2006-02-15T10:05:03'), + ('91', '807', '2006-02-15T10:05:03'), + ('168', '807', '2006-02-15T10:05:03'), + ('165', '807', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('161', '807', '2006-02-15T10:05:03'), + ('80', '807', '2006-02-15T10:05:03'), + ('193', '807', '2006-02-15T10:05:03'), + ('114', '807', '2006-02-15T10:05:03'), + ('181', '74', '2006-02-15T10:05:03'), + ('139', '74', '2006-02-15T10:05:03'), + ('28', '74', '2006-02-15T10:05:03'), + ('173', '74', '2006-02-15T10:05:03'), + ('95', '74', '2006-02-15T10:05:03'), + ('9', '74', '2006-02-15T10:05:03'), + ('188', '412', '2006-02-15T10:05:03'), + ('83', '412', '2006-02-15T10:05:03'), + ('116', '412', '2006-02-15T10:05:03'), + ('193', '412', '2006-02-15T10:05:03'), + ('119', '412', '2006-02-15T10:05:03'), + ('49', '423', '2006-02-15T10:05:03'), + ('172', '423', '2006-02-15T10:05:03'), + ('196', '423', '2006-02-15T10:05:03'), + ('117', '423', '2006-02-15T10:05:03'), + ('61', '423', '2006-02-15T10:05:03'), + ('60', '423', '2006-02-15T10:05:03'), + ('73', '666', '2006-02-15T10:05:03'), + ('121', '666', '2006-02-15T10:05:03'), + ('112', '666', '2006-02-15T10:05:03'), + ('127', '79', '2006-02-15T10:05:03'), + ('29', '79', '2006-02-15T10:05:03'), + ('144', '79', '2006-02-15T10:05:03'), + ('143', '79', '2006-02-15T10:05:03'), + ('4', '79', '2006-02-15T10:05:03'), + ('121', '154', '2006-02-15T10:05:03'), + ('17', '154', '2006-02-15T10:05:03'), + ('33', '154', '2006-02-15T10:05:03'), + ('145', '154', '2006-02-15T10:05:03'), + ('173', '154', '2006-02-15T10:05:03'), + ('13', '154', '2006-02-15T10:05:03'), + ('14', '154', '2006-02-15T10:05:03'), + ('104', '904', '2006-02-15T10:05:03'), + ('26', '904', '2006-02-15T10:05:03'), + ('27', '904', '2006-02-15T10:05:03'), + ('132', '904', '2006-02-15T10:05:03'), + ('117', '395', '2006-02-15T10:05:03'), + ('141', '395', '2006-02-15T10:05:03'), + ('51', '395', '2006-02-15T10:05:03'), + ('125', '395', '2006-02-15T10:05:03'), + ('11', '395', '2006-02-15T10:05:03'), + ('198', '395', '2006-02-15T10:05:03'), + ('165', '395', '2006-02-15T10:05:03'), + ('21', '530', '2006-02-15T10:05:03'), + ('10', '530', '2006-02-15T10:05:03'), + ('78', '530', '2006-02-15T10:05:03'), + ('105', '530', '2006-02-15T10:05:03'), + ('123', '530', '2006-02-15T10:05:03'), + ('137', '530', '2006-02-15T10:05:03'), + ('104', '59', '2006-02-15T10:05:03'), + ('152', '59', '2006-02-15T10:05:03'), + ('81', '59', '2006-02-15T10:05:03'), + ('139', '691', '2006-02-15T10:05:03'), + ('23', '691', '2006-02-15T10:05:03'), + ('7', '691', '2006-02-15T10:05:03'), + ('4', '691', '2006-02-15T10:05:03'), + ('197', '691', '2006-02-15T10:05:03'), + ('120', '691', '2006-02-15T10:05:03'), + ('126', '317', '2006-02-15T10:05:03'), + ('57', '317', '2006-02-15T10:05:03'), + ('37', '317', '2006-02-15T10:05:03'), + ('84', '317', '2006-02-15T10:05:03'), + ('71', '317', '2006-02-15T10:05:03'), + ('52', '596', '2006-02-15T10:05:03'), + ('41', '596', '2006-02-15T10:05:03'), + ('175', '596', '2006-02-15T10:05:03'), + ('191', '596', '2006-02-15T10:05:03'), + ('181', '596', '2006-02-15T10:05:03'), + ('54', '348', '2006-02-15T10:05:03'), + ('97', '348', '2006-02-15T10:05:03'), + ('76', '348', '2006-02-15T10:05:03'), + ('20', '348', '2006-02-15T10:05:03'), + ('49', '348', '2006-02-15T10:05:03'), + ('129', '348', '2006-02-15T10:05:03'), + ('11', '348', '2006-02-15T10:05:03'), + ('107', '348', '2006-02-15T10:05:03'), + ('41', '60', '2006-02-15T10:05:03'), + ('94', '60', '2006-02-15T10:05:03'), + ('101', '60', '2006-02-15T10:05:03'), + ('76', '60', '2006-02-15T10:05:03'), + ('6', '60', '2006-02-15T10:05:03'), + ('123', '479', '2006-02-15T10:05:03'), + ('131', '479', '2006-02-15T10:05:03'), + ('84', '479', '2006-02-15T10:05:03'), + ('121', '479', '2006-02-15T10:05:03'), + ('164', '908', '2006-02-15T10:05:03'), + ('28', '908', '2006-02-15T10:05:03'), + ('125', '908', '2006-02-15T10:05:03'), + ('14', '908', '2006-02-15T10:05:03'), + ('196', '908', '2006-02-15T10:05:03'), + ('175', '908', '2006-02-15T10:05:03'), + ('88', '908', '2006-02-15T10:05:03'), + ('24', '335', '2006-02-15T10:05:03'), + ('29', '335', '2006-02-15T10:05:03'), + ('64', '335', '2006-02-15T10:05:03'), + ('91', '335', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('38', '335', '2006-02-15T10:05:03'), + ('128', '774', '2006-02-15T10:05:03'), + ('107', '774', '2006-02-15T10:05:03'), + ('188', '774', '2006-02-15T10:05:03'), + ('101', '774', '2006-02-15T10:05:03'), + ('90', '838', '2006-02-15T10:05:03'), + ('12', '838', '2006-02-15T10:05:03'), + ('113', '838', '2006-02-15T10:05:03'), + ('92', '838', '2006-02-15T10:05:03'), + ('30', '838', '2006-02-15T10:05:03'), + ('82', '838', '2006-02-15T10:05:03'), + ('22', '294', '2006-02-15T10:05:03'), + ('167', '294', '2006-02-15T10:05:03'), + ('95', '294', '2006-02-15T10:05:03'), + ('94', '788', '2006-02-15T10:05:03'), + ('34', '788', '2006-02-15T10:05:03'), + ('79', '788', '2006-02-15T10:05:03'), + ('80', '788', '2006-02-15T10:05:03'), + ('118', '788', '2006-02-15T10:05:03'), + ('119', '788', '2006-02-15T10:05:03'), + ('189', '788', '2006-02-15T10:05:03'), + ('166', '788', '2006-02-15T10:05:03'), + ('151', '880', '2006-02-15T10:05:03'), + ('31', '880', '2006-02-15T10:05:03'), + ('12', '880', '2006-02-15T10:05:03'), + ('78', '880', '2006-02-15T10:05:03'), + ('150', '880', '2006-02-15T10:05:03'), + ('158', '880', '2006-02-15T10:05:03'), + ('90', '880', '2006-02-15T10:05:03'), + ('185', '880', '2006-02-15T10:05:03'), + ('27', '880', '2006-02-15T10:05:03'), + ('161', '880', '2006-02-15T10:05:03'), + ('17', '880', '2006-02-15T10:05:03'), + ('9', '903', '2006-02-15T10:05:03'), + ('171', '903', '2006-02-15T10:05:03'), + ('103', '903', '2006-02-15T10:05:03'), + ('95', '903', '2006-02-15T10:05:03'), + ('112', '700', '2006-02-15T10:05:03'), + ('113', '700', '2006-02-15T10:05:03'), + ('109', '700', '2006-02-15T10:05:03'), + ('31', '700', '2006-02-15T10:05:03'), + ('21', '700', '2006-02-15T10:05:03'), + ('39', '700', '2006-02-15T10:05:03'), + ('101', '700', '2006-02-15T10:05:03'), + ('135', '719', '2006-02-15T10:05:03'), + ('163', '719', '2006-02-15T10:05:03'), + ('62', '719', '2006-02-15T10:05:03'), + ('194', '719', '2006-02-15T10:05:03'), + ('175', '719', '2006-02-15T10:05:03'), + ('139', '719', '2006-02-15T10:05:03'), + ('83', '719', '2006-02-15T10:05:03'), + ('113', '719', '2006-02-15T10:05:03'), + ('152', '153', '2006-02-15T10:05:03'), + ('149', '153', '2006-02-15T10:05:03'), + ('57', '153', '2006-02-15T10:05:03'), + ('94', '153', '2006-02-15T10:05:03'), + ('25', '153', '2006-02-15T10:05:03'), + ('155', '153', '2006-02-15T10:05:03'), + ('77', '153', '2006-02-15T10:05:03'), + ('51', '153', '2006-02-15T10:05:03'), + ('74', '44', '2006-02-15T10:05:03'), + ('193', '44', '2006-02-15T10:05:03'), + ('106', '44', '2006-02-15T10:05:03'), + ('18', '44', '2006-02-15T10:05:03'), + ('42', '922', '2006-02-15T10:05:03'), + ('48', '922', '2006-02-15T10:05:03'), + ('146', '922', '2006-02-15T10:05:03'), + ('166', '38', '2006-02-15T10:05:03'), + ('46', '38', '2006-02-15T10:05:03'), + ('190', '38', '2006-02-15T10:05:03'), + ('120', '746', '2006-02-15T10:05:03'), + ('176', '746', '2006-02-15T10:05:03'), + ('139', '746', '2006-02-15T10:05:03'), + ('197', '746', '2006-02-15T10:05:03'), + ('49', '716', '2006-02-15T10:05:03'), + ('10', '716', '2006-02-15T10:05:03'), + ('12', '716', '2006-02-15T10:05:03'), + ('36', '716', '2006-02-15T10:05:03'), + ('100', '714', '2006-02-15T10:05:03'), + ('36', '714', '2006-02-15T10:05:03'), + ('52', '714', '2006-02-15T10:05:03'), + ('182', '714', '2006-02-15T10:05:03'), + ('115', '714', '2006-02-15T10:05:03'), + ('161', '714', '2006-02-15T10:05:03'), + ('57', '714', '2006-02-15T10:05:03'), + ('4', '714', '2006-02-15T10:05:03'), + ('200', '714', '2006-02-15T10:05:03'), + ('65', '714', '2006-02-15T10:05:03'), + ('166', '714', '2006-02-15T10:05:03'), + ('20', '714', '2006-02-15T10:05:03'), + ('45', '714', '2006-02-15T10:05:03'), + ('42', '713', '2006-02-15T10:05:03'), + ('131', '713', '2006-02-15T10:05:03'), + ('59', '713', '2006-02-15T10:05:03'), + ('145', '713', '2006-02-15T10:05:03'), + ('94', '713', '2006-02-15T10:05:03'), + ('157', '713', '2006-02-15T10:05:03'), + ('48', '349', '2006-02-15T10:05:03'), + ('156', '349', '2006-02-15T10:05:03'), + ('169', '349', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('22', '349', '2006-02-15T10:05:03'), + ('6', '53', '2006-02-15T10:05:03'), + ('70', '53', '2006-02-15T10:05:03'), + ('47', '53', '2006-02-15T10:05:03'), + ('149', '53', '2006-02-15T10:05:03'), + ('30', '53', '2006-02-15T10:05:03'), + ('156', '53', '2006-02-15T10:05:03'), + ('102', '53', '2006-02-15T10:05:03'), + ('184', '640', '2006-02-15T10:05:03'), + ('129', '640', '2006-02-15T10:05:03'), + ('199', '640', '2006-02-15T10:05:03'), + ('72', '640', '2006-02-15T10:05:03'), + ('79', '40', '2006-02-15T10:05:03'), + ('77', '40', '2006-02-15T10:05:03'), + ('181', '40', '2006-02-15T10:05:03'), + ('96', '40', '2006-02-15T10:05:03'), + ('3', '40', '2006-02-15T10:05:03'), + ('183', '40', '2006-02-15T10:05:03'), + ('104', '40', '2006-02-15T10:05:03'), + ('73', '245', '2006-02-15T10:05:03'), + ('48', '245', '2006-02-15T10:05:03'), + ('36', '245', '2006-02-15T10:05:03'), + ('95', '245', '2006-02-15T10:05:03'), + ('123', '245', '2006-02-15T10:05:03'), + ('115', '245', '2006-02-15T10:05:03'), + ('25', '245', '2006-02-15T10:05:03'), + ('77', '245', '2006-02-15T10:05:03'), + ('115', '302', '2006-02-15T10:05:03'), + ('108', '302', '2006-02-15T10:05:03'), + ('172', '302', '2006-02-15T10:05:03'), + ('82', '104', '2006-02-15T10:05:03'), + ('92', '104', '2006-02-15T10:05:03'), + ('34', '493', '2006-02-15T10:05:03'), + ('172', '493', '2006-02-15T10:05:03'), + ('60', '493', '2006-02-15T10:05:03'), + ('36', '493', '2006-02-15T10:05:03'), + ('91', '493', '2006-02-15T10:05:03'), + ('41', '203', '2006-02-15T10:05:03'), + ('153', '203', '2006-02-15T10:05:03'), + ('74', '203', '2006-02-15T10:05:03'), + ('52', '203', '2006-02-15T10:05:03'), + ('39', '203', '2006-02-15T10:05:03'), + ('13', '203', '2006-02-15T10:05:03'), + ('5', '203', '2006-02-15T10:05:03'), + ('169', '673', '2006-02-15T10:05:03'), + ('42', '673', '2006-02-15T10:05:03'), + ('141', '673', '2006-02-15T10:05:03'), + ('19', '673', '2006-02-15T10:05:03'), + ('122', '673', '2006-02-15T10:05:03'), + ('164', '673', '2006-02-15T10:05:03'), + ('23', '673', '2006-02-15T10:05:03'), + ('195', '673', '2006-02-15T10:05:03'), + ('108', '673', '2006-02-15T10:05:03'), + ('196', '837', '2006-02-15T10:05:03'), + ('102', '837', '2006-02-15T10:05:03'), + ('55', '790', '2006-02-15T10:05:03'), + ('28', '790', '2006-02-15T10:05:03'), + ('47', '790', '2006-02-15T10:05:03'), + ('53', '268', '2006-02-15T10:05:03'), + ('137', '268', '2006-02-15T10:05:03'), + ('102', '268', '2006-02-15T10:05:03'), + ('81', '268', '2006-02-15T10:05:03'), + ('18', '268', '2006-02-15T10:05:03'), + ('83', '268', '2006-02-15T10:05:03'), + ('118', '151', '2006-02-15T10:05:03'), + ('123', '151', '2006-02-15T10:05:03'), + ('112', '151', '2006-02-15T10:05:03'), + ('49', '151', '2006-02-15T10:05:03'), + ('168', '927', '2006-02-15T10:05:03'), + ('134', '927', '2006-02-15T10:05:03'), + ('161', '927', '2006-02-15T10:05:03'), + ('49', '927', '2006-02-15T10:05:03'), + ('152', '927', '2006-02-15T10:05:03'), + ('37', '966', '2006-02-15T10:05:03'), + ('108', '966', '2006-02-15T10:05:03'), + ('3', '966', '2006-02-15T10:05:03'), + ('115', '966', '2006-02-15T10:05:03'), + ('10', '966', '2006-02-15T10:05:03'), + ('121', '966', '2006-02-15T10:05:03'), + ('13', '966', '2006-02-15T10:05:03'), + ('146', '966', '2006-02-15T10:05:03'), + ('155', '966', '2006-02-15T10:05:03'), + ('184', '966', '2006-02-15T10:05:03'), + ('133', '652', '2006-02-15T10:05:03'), + ('28', '652', '2006-02-15T10:05:03'), + ('168', '652', '2006-02-15T10:05:03'), + ('108', '652', '2006-02-15T10:05:03'), + ('20', '652', '2006-02-15T10:05:03'), + ('1', '140', '2006-02-15T10:05:03'), + ('20', '140', '2006-02-15T10:05:03'), + ('83', '764', '2006-02-15T10:05:03'), + ('26', '764', '2006-02-15T10:05:03'), + ('54', '764', '2006-02-15T10:05:03'), + ('170', '764', '2006-02-15T10:05:03'), + ('14', '764', '2006-02-15T10:05:03'), + ('84', '764', '2006-02-15T10:05:03'), + ('130', '764', '2006-02-15T10:05:03'), + ('177', '764', '2006-02-15T10:05:03'), + ('75', '764', '2006-02-15T10:05:03'), + ('122', '227', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('70', '227', '2006-02-15T10:05:03'), + ('20', '1', '2006-02-15T10:05:03'), + ('108', '1', '2006-02-15T10:05:03'), + ('162', '1', '2006-02-15T10:05:03'), + ('40', '1', '2006-02-15T10:05:03'), + ('198', '1', '2006-02-15T10:05:03'), + ('1', '1', '2006-02-15T10:05:03'), + ('188', '1', '2006-02-15T10:05:03'), + ('10', '1', '2006-02-15T10:05:03'), + ('30', '1', '2006-02-15T10:05:03'), + ('53', '1', '2006-02-15T10:05:03'), + ('129', '202', '2006-02-15T10:05:03'), + ('69', '202', '2006-02-15T10:05:03'), + ('127', '202', '2006-02-15T10:05:03'), + ('70', '202', '2006-02-15T10:05:03'), + ('5', '202', '2006-02-15T10:05:03'), + ('123', '577', '2006-02-15T10:05:03'), + ('53', '577', '2006-02-15T10:05:03'), + ('65', '577', '2006-02-15T10:05:03'), + ('186', '983', '2006-02-15T10:05:03'), + ('10', '983', '2006-02-15T10:05:03'), + ('178', '983', '2006-02-15T10:05:03'), + ('21', '983', '2006-02-15T10:05:03'), + ('183', '983', '2006-02-15T10:05:03'), + ('57', '437', '2006-02-15T10:05:03'), + ('158', '437', '2006-02-15T10:05:03'), + ('182', '437', '2006-02-15T10:05:03'), + ('181', '437', '2006-02-15T10:05:03'), + ('165', '437', '2006-02-15T10:05:03'), + ('97', '437', '2006-02-15T10:05:03'), + ('185', '437', '2006-02-15T10:05:03'), + ('50', '437', '2006-02-15T10:05:03'), + ('103', '437', '2006-02-15T10:05:03'), + ('101', '66', '2006-02-15T10:05:03'), + ('158', '66', '2006-02-15T10:05:03'), + ('45', '66', '2006-02-15T10:05:03'), + ('76', '66', '2006-02-15T10:05:03'), + ('98', '66', '2006-02-15T10:05:03'), + ('131', '66', '2006-02-15T10:05:03'), + ('96', '66', '2006-02-15T10:05:03'), + ('17', '469', '2006-02-15T10:05:03'), + ('106', '469', '2006-02-15T10:05:03'), + ('160', '469', '2006-02-15T10:05:03'), + ('126', '469', '2006-02-15T10:05:03'), + ('164', '469', '2006-02-15T10:05:03'), + ('49', '469', '2006-02-15T10:05:03'), + ('64', '469', '2006-02-15T10:05:03'), + ('161', '469', '2006-02-15T10:05:03'), + ('56', '851', '2006-02-15T10:05:03'), + ('164', '851', '2006-02-15T10:05:03'), + ('193', '851', '2006-02-15T10:05:03'), + ('200', '465', '2006-02-15T10:05:03'), + ('53', '465', '2006-02-15T10:05:03'), + ('81', '465', '2006-02-15T10:05:03'), + ('62', '465', '2006-02-15T10:05:03'), + ('192', '465', '2006-02-15T10:05:03'), + ('62', '295', '2006-02-15T10:05:03'), + ('147', '295', '2006-02-15T10:05:03'), + ('59', '295', '2006-02-15T10:05:03'), + ('48', '295', '2006-02-15T10:05:03'), + ('54', '489', '2006-02-15T10:05:03'), + ('120', '489', '2006-02-15T10:05:03'), + ('154', '489', '2006-02-15T10:05:03'), + ('137', '489', '2006-02-15T10:05:03'), + ('179', '489', '2006-02-15T10:05:03'), + ('33', '489', '2006-02-15T10:05:03'), + ('111', '489', '2006-02-15T10:05:03'), + ('122', '489', '2006-02-15T10:05:03'), + ('139', '489', '2006-02-15T10:05:03'), + ('104', '259', '2006-02-15T10:05:03'), + ('28', '259', '2006-02-15T10:05:03'), + ('162', '41', '2006-02-15T10:05:03'), + ('135', '41', '2006-02-15T10:05:03'), + ('118', '41', '2006-02-15T10:05:03'), + ('120', '149', '2006-02-15T10:05:03'), + ('200', '149', '2006-02-15T10:05:03'), + ('148', '149', '2006-02-15T10:05:03'), + ('24', '515', '2006-02-15T10:05:03'), + ('13', '515', '2006-02-15T10:05:03'), + ('131', '515', '2006-02-15T10:05:03'), + ('52', '515', '2006-02-15T10:05:03'), + ('196', '515', '2006-02-15T10:05:03'), + ('17', '515', '2006-02-15T10:05:03'), + ('50', '401', '2006-02-15T10:05:03'), + ('177', '401', '2006-02-15T10:05:03'), + ('161', '401', '2006-02-15T10:05:03'), + ('104', '401', '2006-02-15T10:05:03'), + ('176', '401', '2006-02-15T10:05:03'), + ('32', '401', '2006-02-15T10:05:03'), + ('136', '401', '2006-02-15T10:05:03'), + ('2', '518', '2006-02-15T10:05:03'), + ('185', '518', '2006-02-15T10:05:03'), + ('97', '518', '2006-02-15T10:05:03'), + ('156', '518', '2006-02-15T10:05:03'), + ('53', '518', '2006-02-15T10:05:03'), + ('61', '518', '2006-02-15T10:05:03'), + ('2', '561', '2006-02-15T10:05:03'), + ('97', '561', '2006-02-15T10:05:03'), + ('108', '561', '2006-02-15T10:05:03'), + ('138', '561', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('82', '561', '2006-02-15T10:05:03'), + ('159', '561', '2006-02-15T10:05:03'), + ('187', '561', '2006-02-15T10:05:03'), + ('105', '561', '2006-02-15T10:05:03'), + ('180', '561', '2006-02-15T10:05:03'), + ('73', '561', '2006-02-15T10:05:03'), + ('18', '561', '2006-02-15T10:05:03'), + ('53', '386', '2006-02-15T10:05:03'), + ('68', '386', '2006-02-15T10:05:03'), + ('150', '386', '2006-02-15T10:05:03'), + ('18', '386', '2006-02-15T10:05:03'), + ('143', '386', '2006-02-15T10:05:03'), + ('134', '386', '2006-02-15T10:05:03'), + ('58', '602', '2006-02-15T10:05:03'), + ('88', '602', '2006-02-15T10:05:03'), + ('139', '602', '2006-02-15T10:05:03'), + ('129', '602', '2006-02-15T10:05:03'), + ('125', '602', '2006-02-15T10:05:03'), + ('154', '602', '2006-02-15T10:05:03'), + ('168', '602', '2006-02-15T10:05:03'), + ('53', '285', '2006-02-15T10:05:03'), + ('103', '285', '2006-02-15T10:05:03'), + ('150', '285', '2006-02-15T10:05:03'), + ('156', '285', '2006-02-15T10:05:03'), + ('54', '285', '2006-02-15T10:05:03'), + ('74', '28', '2006-02-15T10:05:03'), + ('162', '28', '2006-02-15T10:05:03'), + ('149', '811', '2006-02-15T10:05:03'), + ('179', '811', '2006-02-15T10:05:03'), + ('78', '811', '2006-02-15T10:05:03'), + ('2', '811', '2006-02-15T10:05:03'), + ('9', '811', '2006-02-15T10:05:03'), + ('5', '811', '2006-02-15T10:05:03'), + ('49', '811', '2006-02-15T10:05:03'), + ('180', '811', '2006-02-15T10:05:03'), + ('108', '702', '2006-02-15T10:05:03'), + ('21', '702', '2006-02-15T10:05:03'), + ('101', '702', '2006-02-15T10:05:03'), + ('130', '702', '2006-02-15T10:05:03'), + ('59', '702', '2006-02-15T10:05:03'), + ('140', '702', '2006-02-15T10:05:03'), + ('144', '702', '2006-02-15T10:05:03'), + ('142', '759', '2006-02-15T10:05:03'), + ('14', '759', '2006-02-15T10:05:03'), + ('128', '759', '2006-02-15T10:05:03'), + ('100', '759', '2006-02-15T10:05:03'), + ('10', '694', '2006-02-15T10:05:03'), + ('77', '694', '2006-02-15T10:05:03'), + ('109', '694', '2006-02-15T10:05:03'), + ('185', '694', '2006-02-15T10:05:03'), + ('64', '694', '2006-02-15T10:05:03'), + ('169', '694', '2006-02-15T10:05:03'), + ('33', '694', '2006-02-15T10:05:03'), + ('65', '694', '2006-02-15T10:05:03'), + ('59', '694', '2006-02-15T10:05:03'), + ('37', '694', '2006-02-15T10:05:03'), + ('43', '344', '2006-02-15T10:05:03'), + ('159', '344', '2006-02-15T10:05:03'), + ('82', '344', '2006-02-15T10:05:03'), + ('12', '344', '2006-02-15T10:05:03'), + ('139', '266', '2006-02-15T10:05:03'), + ('123', '266', '2006-02-15T10:05:03'), + ('189', '266', '2006-02-15T10:05:03'), + ('89', '266', '2006-02-15T10:05:03'), + ('19', '266', '2006-02-15T10:05:03'), + ('19', '490', '2006-02-15T10:05:03'), + ('53', '490', '2006-02-15T10:05:03'), + ('99', '490', '2006-02-15T10:05:03'), + ('51', '490', '2006-02-15T10:05:03'), + ('44', '490', '2006-02-15T10:05:03'), + ('4', '490', '2006-02-15T10:05:03'), + ('154', '440', '2006-02-15T10:05:03'), + ('160', '883', '2006-02-15T10:05:03'), + ('18', '883', '2006-02-15T10:05:03'), + ('44', '883', '2006-02-15T10:05:03'), + ('48', '287', '2006-02-15T10:05:03'), + ('104', '287', '2006-02-15T10:05:03'), + ('28', '287', '2006-02-15T10:05:03'), + ('16', '287', '2006-02-15T10:05:03'), + ('199', '953', '2006-02-15T10:05:03'), + ('144', '953', '2006-02-15T10:05:03'), + ('145', '953', '2006-02-15T10:05:03'), + ('127', '953', '2006-02-15T10:05:03'), + ('171', '953', '2006-02-15T10:05:03'), + ('150', '953', '2006-02-15T10:05:03'), + ('70', '953', '2006-02-15T10:05:03'), + ('28', '953', '2006-02-15T10:05:03'), + ('193', '953', '2006-02-15T10:05:03'), + ('85', '383', '2006-02-15T10:05:03'), + ('131', '383', '2006-02-15T10:05:03'), + ('115', '383', '2006-02-15T10:05:03'), + ('41', '383', '2006-02-15T10:05:03'), + ('56', '383', '2006-02-15T10:05:03'), + ('5', '383', '2006-02-15T10:05:03'), + ('155', '383', '2006-02-15T10:05:03'), + ('50', '717', '2006-02-15T10:05:03'), + ('120', '717', '2006-02-15T10:05:03'), + ('88', '717', '2006-02-15T10:05:03'), + ('57', '717', '2006-02-15T10:05:03'), + ('167', '717', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('18', '717', '2006-02-15T10:05:03'), + ('20', '717', '2006-02-15T10:05:03'), + ('16', '717', '2006-02-15T10:05:03'), + ('50', '327', '2006-02-15T10:05:03'), + ('26', '327', '2006-02-15T10:05:03'), + ('27', '359', '2006-02-15T10:05:03'), + ('43', '359', '2006-02-15T10:05:03'), + ('111', '359', '2006-02-15T10:05:03'), + ('195', '359', '2006-02-15T10:05:03'), + ('155', '359', '2006-02-15T10:05:03'), + ('71', '359', '2006-02-15T10:05:03'), + ('114', '237', '2006-02-15T10:05:03'), + ('186', '237', '2006-02-15T10:05:03'), + ('168', '237', '2006-02-15T10:05:03'), + ('177', '237', '2006-02-15T10:05:03'), + ('61', '237', '2006-02-15T10:05:03'), + ('72', '237', '2006-02-15T10:05:03'), + ('99', '325', '2006-02-15T10:05:03'), + ('68', '325', '2006-02-15T10:05:03'), + ('72', '325', '2006-02-15T10:05:03'), + ('93', '325', '2006-02-15T10:05:03'), + ('111', '325', '2006-02-15T10:05:03'), + ('3', '971', '2006-02-15T10:05:03'), + ('60', '971', '2006-02-15T10:05:03'), + ('68', '971', '2006-02-15T10:05:03'), + ('34', '971', '2006-02-15T10:05:03'), + ('191', '971', '2006-02-15T10:05:03'), + ('129', '391', '2006-02-15T10:05:03'), + ('49', '391', '2006-02-15T10:05:03'), + ('90', '391', '2006-02-15T10:05:03'), + ('182', '391', '2006-02-15T10:05:03'), + ('115', '391', '2006-02-15T10:05:03'), + ('86', '391', '2006-02-15T10:05:03'), + ('8', '263', '2006-02-15T10:05:03'), + ('126', '263', '2006-02-15T10:05:03'), + ('83', '263', '2006-02-15T10:05:03'), + ('28', '263', '2006-02-15T10:05:03'), + ('74', '263', '2006-02-15T10:05:03'), + ('156', '263', '2006-02-15T10:05:03'), + ('124', '263', '2006-02-15T10:05:03'), + ('137', '263', '2006-02-15T10:05:03'), + ('101', '263', '2006-02-15T10:05:03'), + ('67', '57', '2006-02-15T10:05:03'), + ('130', '57', '2006-02-15T10:05:03'), + ('172', '57', '2006-02-15T10:05:03'), + ('148', '57', '2006-02-15T10:05:03'), + ('139', '57', '2006-02-15T10:05:03'), + ('120', '57', '2006-02-15T10:05:03'), + ('117', '785', '2006-02-15T10:05:03'), + ('163', '785', '2006-02-15T10:05:03'), + ('155', '785', '2006-02-15T10:05:03'), + ('37', '785', '2006-02-15T10:05:03'), + ('19', '785', '2006-02-15T10:05:03'), + ('144', '785', '2006-02-15T10:05:03'), + ('88', '785', '2006-02-15T10:05:03'), + ('199', '785', '2006-02-15T10:05:03'), + ('109', '785', '2006-02-15T10:05:03'), + ('124', '785', '2006-02-15T10:05:03'), + ('59', '130', '2006-02-15T10:05:03'), + ('195', '130', '2006-02-15T10:05:03'), + ('144', '130', '2006-02-15T10:05:03'), + ('103', '130', '2006-02-15T10:05:03'), + ('19', '750', '2006-02-15T10:05:03'), + ('82', '750', '2006-02-15T10:05:03'), + ('79', '750', '2006-02-15T10:05:03'), + ('105', '750', '2006-02-15T10:05:03'), + ('56', '750', '2006-02-15T10:05:03'), + ('51', '750', '2006-02-15T10:05:03'), + ('59', '46', '2006-02-15T10:05:03'), + ('65', '46', '2006-02-15T10:05:03'), + ('84', '46', '2006-02-15T10:05:03'), + ('130', '375', '2006-02-15T10:05:03'), + ('5', '375', '2006-02-15T10:05:03'), + ('62', '375', '2006-02-15T10:05:03'), + ('165', '375', '2006-02-15T10:05:03'), + ('95', '375', '2006-02-15T10:05:03'), + ('107', '548', '2006-02-15T10:05:03'), + ('189', '548', '2006-02-15T10:05:03'), + ('187', '548', '2006-02-15T10:05:03'), + ('94', '548', '2006-02-15T10:05:03'), + ('73', '548', '2006-02-15T10:05:03'), + ('86', '548', '2006-02-15T10:05:03'), + ('16', '548', '2006-02-15T10:05:03'), + ('120', '911', '2006-02-15T10:05:03'), + ('82', '911', '2006-02-15T10:05:03'), + ('127', '911', '2006-02-15T10:05:03'), + ('181', '911', '2006-02-15T10:05:03'), + ('46', '567', '2006-02-15T10:05:03'), + ('119', '567', '2006-02-15T10:05:03'), + ('172', '567', '2006-02-15T10:05:03'), + ('108', '567', '2006-02-15T10:05:03'), + ('32', '567', '2006-02-15T10:05:03'), + ('11', '567', '2006-02-15T10:05:03'), + ('138', '627', '2006-02-15T10:05:03'), + ('153', '627', '2006-02-15T10:05:03'), + ('95', '627', '2006-02-15T10:05:03'), + ('73', '627', '2006-02-15T10:05:03'), + ('51', '627', '2006-02-15T10:05:03'), + ('151', '482', '2006-02-15T10:05:03'), + ('198', '482', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('186', '482', '2006-02-15T10:05:03'), + ('86', '482', '2006-02-15T10:05:03'), + ('29', '482', '2006-02-15T10:05:03'), + ('153', '476', '2006-02-15T10:05:03'), + ('50', '476', '2006-02-15T10:05:03'), + ('39', '476', '2006-02-15T10:05:03'), + ('65', '476', '2006-02-15T10:05:03'), + ('152', '476', '2006-02-15T10:05:03'), + ('143', '404', '2006-02-15T10:05:03'), + ('19', '404', '2006-02-15T10:05:03'), + ('25', '404', '2006-02-15T10:05:03'), + ('187', '906', '2006-02-15T10:05:03'), + ('143', '906', '2006-02-15T10:05:03'), + ('196', '906', '2006-02-15T10:05:03'), + ('105', '906', '2006-02-15T10:05:03'), + ('142', '906', '2006-02-15T10:05:03'), + ('26', '906', '2006-02-15T10:05:03'), + ('91', '859', '2006-02-15T10:05:03'), + ('176', '859', '2006-02-15T10:05:03'), + ('142', '859', '2006-02-15T10:05:03'), + ('8', '859', '2006-02-15T10:05:03'), + ('107', '859', '2006-02-15T10:05:03'), + ('113', '674', '2006-02-15T10:05:03'), + ('159', '674', '2006-02-15T10:05:03'), + ('41', '674', '2006-02-15T10:05:03'), + ('166', '674', '2006-02-15T10:05:03'), + ('78', '674', '2006-02-15T10:05:03'), + ('152', '674', '2006-02-15T10:05:03'), + ('192', '674', '2006-02-15T10:05:03'), + ('142', '10', '2006-02-15T10:05:03'), + ('35', '10', '2006-02-15T10:05:03'), + ('29', '10', '2006-02-15T10:05:03'), + ('64', '10', '2006-02-15T10:05:03'), + ('117', '10', '2006-02-15T10:05:03'), + ('37', '10', '2006-02-15T10:05:03'), + ('157', '10', '2006-02-15T10:05:03'), + ('188', '10', '2006-02-15T10:05:03'), + ('142', '481', '2006-02-15T10:05:03'), + ('2', '481', '2006-02-15T10:05:03'), + ('116', '481', '2006-02-15T10:05:03'), + ('119', '418', '2006-02-15T10:05:03'), + ('59', '418', '2006-02-15T10:05:03'), + ('102', '418', '2006-02-15T10:05:03'), + ('22', '418', '2006-02-15T10:05:03'), + ('129', '418', '2006-02-15T10:05:03'), + ('159', '418', '2006-02-15T10:05:03'), + ('14', '418', '2006-02-15T10:05:03'), + ('197', '418', '2006-02-15T10:05:03'), + ('122', '300', '2006-02-15T10:05:03'), + ('66', '300', '2006-02-15T10:05:03'), + ('136', '300', '2006-02-15T10:05:03'), + ('69', '300', '2006-02-15T10:05:03'), + ('34', '836', '2006-02-15T10:05:03'), + ('126', '836', '2006-02-15T10:05:03'), + ('181', '836', '2006-02-15T10:05:03'), + ('46', '836', '2006-02-15T10:05:03'), + ('74', '836', '2006-02-15T10:05:03'), + ('33', '881', '2006-02-15T10:05:03'), + ('88', '881', '2006-02-15T10:05:03'), + ('106', '881', '2006-02-15T10:05:03'), + ('131', '881', '2006-02-15T10:05:03'), + ('163', '881', '2006-02-15T10:05:03'), + ('152', '611', '2006-02-15T10:05:03'), + ('135', '455', '2006-02-15T10:05:03'), + ('160', '455', '2006-02-15T10:05:03'), + ('16', '455', '2006-02-15T10:05:03'), + ('89', '542', '2006-02-15T10:05:03'), + ('90', '542', '2006-02-15T10:05:03'), + ('150', '542', '2006-02-15T10:05:03'), + ('181', '542', '2006-02-15T10:05:03'), + ('122', '542', '2006-02-15T10:05:03'), + ('136', '542', '2006-02-15T10:05:03'), + ('49', '542', '2006-02-15T10:05:03'), + ('40', '933', '2006-02-15T10:05:03'), + ('97', '933', '2006-02-15T10:05:03'), + ('133', '933', '2006-02-15T10:05:03'), + ('173', '933', '2006-02-15T10:05:03'), + ('136', '933', '2006-02-15T10:05:03'), + ('57', '918', '2006-02-15T10:05:03'), + ('71', '918', '2006-02-15T10:05:03'), + ('50', '918', '2006-02-15T10:05:03'), + ('112', '37', '2006-02-15T10:05:03'), + ('12', '37', '2006-02-15T10:05:03'), + ('64', '37', '2006-02-15T10:05:03'), + ('130', '37', '2006-02-15T10:05:03'), + ('64', '569', '2006-02-15T10:05:03'), + ('36', '569', '2006-02-15T10:05:03'), + ('92', '712', '2006-02-15T10:05:03'), + ('4', '712', '2006-02-15T10:05:03'), + ('94', '712', '2006-02-15T10:05:03'), + ('102', '712', '2006-02-15T10:05:03'), + ('33', '712', '2006-02-15T10:05:03'), + ('142', '712', '2006-02-15T10:05:03'), + ('29', '273', '2006-02-15T10:05:03'), + ('47', '273', '2006-02-15T10:05:03'), + ('27', '273', '2006-02-15T10:05:03'), + ('44', '273', '2006-02-15T10:05:03'), + ('117', '273', '2006-02-15T10:05:03'), + ('171', '273', '2006-02-15T10:05:03'), + ('178', '273', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('115', '671', '2006-02-15T10:05:03'), + ('187', '671', '2006-02-15T10:05:03'), + ('128', '671', '2006-02-15T10:05:03'), + ('68', '671', '2006-02-15T10:05:03'), + ('9', '671', '2006-02-15T10:05:03'), + ('11', '281', '2006-02-15T10:05:03'), + ('109', '281', '2006-02-15T10:05:03'), + ('83', '281', '2006-02-15T10:05:03'), + ('161', '281', '2006-02-15T10:05:03'), + ('21', '281', '2006-02-15T10:05:03'), + ('84', '281', '2006-02-15T10:05:03'), + ('105', '910', '2006-02-15T10:05:03'), + ('81', '910', '2006-02-15T10:05:03'), + ('129', '910', '2006-02-15T10:05:03'), + ('7', '910', '2006-02-15T10:05:03'), + ('177', '910', '2006-02-15T10:05:03'), + ('77', '538', '2006-02-15T10:05:03'), + ('20', '538', '2006-02-15T10:05:03'), + ('46', '538', '2006-02-15T10:05:03'), + ('132', '538', '2006-02-15T10:05:03'), + ('114', '538', '2006-02-15T10:05:03'), + ('200', '538', '2006-02-15T10:05:03'), + ('187', '538', '2006-02-15T10:05:03'), + ('25', '538', '2006-02-15T10:05:03'), + ('172', '538', '2006-02-15T10:05:03'), + ('99', '84', '2006-02-15T10:05:03'), + ('18', '84', '2006-02-15T10:05:03'), + ('199', '84', '2006-02-15T10:05:03'), + ('32', '84', '2006-02-15T10:05:03'), + ('113', '84', '2006-02-15T10:05:03'), + ('54', '84', '2006-02-15T10:05:03'), + ('44', '84', '2006-02-15T10:05:03'), + ('191', '84', '2006-02-15T10:05:03'), + ('121', '297', '2006-02-15T10:05:03'), + ('166', '297', '2006-02-15T10:05:03'), + ('187', '297', '2006-02-15T10:05:03'), + ('98', '297', '2006-02-15T10:05:03'), + ('85', '297', '2006-02-15T10:05:03'), + ('60', '297', '2006-02-15T10:05:03'), + ('156', '297', '2006-02-15T10:05:03'), + ('53', '256', '2006-02-15T10:05:03'), + ('35', '256', '2006-02-15T10:05:03'), + ('67', '256', '2006-02-15T10:05:03'), + ('6', '256', '2006-02-15T10:05:03'), + ('24', '256', '2006-02-15T10:05:03'), + ('126', '256', '2006-02-15T10:05:03'), + ('136', '256', '2006-02-15T10:05:03'), + ('97', '256', '2006-02-15T10:05:03'), + ('27', '695', '2006-02-15T10:05:03'), + ('182', '695', '2006-02-15T10:05:03'), + ('138', '695', '2006-02-15T10:05:03'), + ('118', '695', '2006-02-15T10:05:03'), + ('190', '695', '2006-02-15T10:05:03'), + ('37', '467', '2006-02-15T10:05:03'), + ('141', '467', '2006-02-15T10:05:03'), + ('73', '467', '2006-02-15T10:05:03'), + ('107', '467', '2006-02-15T10:05:03'), + ('45', '467', '2006-02-15T10:05:03'), + ('154', '467', '2006-02-15T10:05:03'), + ('156', '467', '2006-02-15T10:05:03'), + ('21', '426', '2006-02-15T10:05:03'), + ('58', '426', '2006-02-15T10:05:03'), + ('166', '426', '2006-02-15T10:05:03'), + ('192', '426', '2006-02-15T10:05:03'), + ('190', '426', '2006-02-15T10:05:03'), + ('36', '426', '2006-02-15T10:05:03'), + ('14', '472', '2006-02-15T10:05:03'), + ('190', '472', '2006-02-15T10:05:03'), + ('58', '856', '2006-02-15T10:05:03'), + ('112', '856', '2006-02-15T10:05:03'), + ('70', '856', '2006-02-15T10:05:03'), + ('93', '856', '2006-02-15T10:05:03'), + ('167', '856', '2006-02-15T10:05:03'), + ('14', '856', '2006-02-15T10:05:03'), + ('23', '856', '2006-02-15T10:05:03'), + ('5', '288', '2006-02-15T10:05:03'), + ('126', '288', '2006-02-15T10:05:03'), + ('50', '288', '2006-02-15T10:05:03'), + ('136', '288', '2006-02-15T10:05:03'), + ('154', '954', '2006-02-15T10:05:03'), + ('169', '954', '2006-02-15T10:05:03'), + ('160', '954', '2006-02-15T10:05:03'), + ('82', '954', '2006-02-15T10:05:03'), + ('105', '954', '2006-02-15T10:05:03'), + ('83', '833', '2006-02-15T10:05:03'), + ('43', '833', '2006-02-15T10:05:03'), + ('13', '833', '2006-02-15T10:05:03'), + ('163', '833', '2006-02-15T10:05:03'), + ('165', '833', '2006-02-15T10:05:03'), + ('196', '833', '2006-02-15T10:05:03'), + ('89', '833', '2006-02-15T10:05:03'), + ('172', '833', '2006-02-15T10:05:03'), + ('23', '833', '2006-02-15T10:05:03'), + ('71', '833', '2006-02-15T10:05:03'), + ('98', '990', '2006-02-15T10:05:03'), + ('182', '990', '2006-02-15T10:05:03'), + ('54', '990', '2006-02-15T10:05:03'), + ('61', '990', '2006-02-15T10:05:03'), + ('158', '990', '2006-02-15T10:05:03'), + ('105', '990', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('62', '990', '2006-02-15T10:05:03'), + ('51', '990', '2006-02-15T10:05:03'), + ('103', '942', '2006-02-15T10:05:03'), + ('41', '942', '2006-02-15T10:05:03'), + ('72', '854', '2006-02-15T10:05:03'), + ('27', '854', '2006-02-15T10:05:03'), + ('44', '854', '2006-02-15T10:05:03'), + ('150', '854', '2006-02-15T10:05:03'), + ('11', '854', '2006-02-15T10:05:03'), + ('83', '631', '2006-02-15T10:05:03'), + ('86', '631', '2006-02-15T10:05:03'), + ('12', '631', '2006-02-15T10:05:03'), + ('149', '631', '2006-02-15T10:05:03'), + ('102', '631', '2006-02-15T10:05:03'), + ('185', '631', '2006-02-15T10:05:03'), + ('198', '125', '2006-02-15T10:05:03'), + ('144', '125', '2006-02-15T10:05:03'), + ('138', '125', '2006-02-15T10:05:03'), + ('15', '125', '2006-02-15T10:05:03'), + ('34', '125', '2006-02-15T10:05:03'), + ('65', '125', '2006-02-15T10:05:03'), + ('23', '125', '2006-02-15T10:05:03'), + ('178', '30', '2006-02-15T10:05:03'), + ('163', '30', '2006-02-15T10:05:03'), + ('9', '30', '2006-02-15T10:05:03'), + ('28', '816', '2006-02-15T10:05:03'), + ('181', '816', '2006-02-15T10:05:03'), + ('13', '816', '2006-02-15T10:05:03'), + ('33', '135', '2006-02-15T10:05:03'), + ('194', '135', '2006-02-15T10:05:03'), + ('140', '135', '2006-02-15T10:05:03'), + ('83', '135', '2006-02-15T10:05:03'), + ('144', '135', '2006-02-15T10:05:03'), + ('58', '135', '2006-02-15T10:05:03'), + ('187', '474', '2006-02-15T10:05:03'), + ('111', '474', '2006-02-15T10:05:03'), + ('200', '474', '2006-02-15T10:05:03'), + ('76', '474', '2006-02-15T10:05:03'), + ('56', '474', '2006-02-15T10:05:03'), + ('136', '474', '2006-02-15T10:05:03'), + ('52', '474', '2006-02-15T10:05:03'), + ('154', '474', '2006-02-15T10:05:03'), + ('37', '485', '2006-02-15T10:05:03'), + ('102', '485', '2006-02-15T10:05:03'), + ('128', '485', '2006-02-15T10:05:03'), + ('2', '485', '2006-02-15T10:05:03'), + ('11', '485', '2006-02-15T10:05:03'), + ('192', '485', '2006-02-15T10:05:03'), + ('136', '485', '2006-02-15T10:05:03'), + ('143', '485', '2006-02-15T10:05:03'), + ('55', '485', '2006-02-15T10:05:03'), + ('70', '50', '2006-02-15T10:05:03'), + ('78', '552', '2006-02-15T10:05:03'), + ('9', '552', '2006-02-15T10:05:03'), + ('186', '552', '2006-02-15T10:05:03'), + ('136', '552', '2006-02-15T10:05:03'), + ('50', '552', '2006-02-15T10:05:03'), + ('86', '216', '2006-02-15T10:05:03'), + ('199', '216', '2006-02-15T10:05:03'), + ('12', '216', '2006-02-15T10:05:03'), + ('144', '216', '2006-02-15T10:05:03'), + ('85', '216', '2006-02-15T10:05:03'), + ('115', '246', '2006-02-15T10:05:03'), + ('124', '246', '2006-02-15T10:05:03'), + ('169', '246', '2006-02-15T10:05:03'), + ('123', '246', '2006-02-15T10:05:03'), + ('117', '246', '2006-02-15T10:05:03'), + ('55', '403', '2006-02-15T10:05:03'), + ('181', '403', '2006-02-15T10:05:03'), + ('113', '403', '2006-02-15T10:05:03'), + ('138', '403', '2006-02-15T10:05:03'), + ('195', '403', '2006-02-15T10:05:03'), + ('111', '403', '2006-02-15T10:05:03'), + ('7', '173', '2006-02-15T10:05:03'), + ('119', '173', '2006-02-15T10:05:03'), + ('190', '173', '2006-02-15T10:05:03'), + ('112', '173', '2006-02-15T10:05:03'), + ('188', '773', '2006-02-15T10:05:03'), + ('71', '773', '2006-02-15T10:05:03'), + ('72', '773', '2006-02-15T10:05:03'), + ('16', '503', '2006-02-15T10:05:03'), + ('123', '503', '2006-02-15T10:05:03'), + ('74', '503', '2006-02-15T10:05:03'), + ('27', '503', '2006-02-15T10:05:03'), + ('82', '503', '2006-02-15T10:05:03'), + ('5', '503', '2006-02-15T10:05:03'), + ('6', '503', '2006-02-15T10:05:03'), + ('45', '503', '2006-02-15T10:05:03'), + ('198', '309', '2006-02-15T10:05:03'), + ('42', '309', '2006-02-15T10:05:03'), + ('104', '309', '2006-02-15T10:05:03'), + ('32', '309', '2006-02-15T10:05:03'), + ('66', '928', '2006-02-15T10:05:03'), + ('29', '928', '2006-02-15T10:05:03'), + ('11', '928', '2006-02-15T10:05:03'), + ('173', '928', '2006-02-15T10:05:03'), + ('32', '928', '2006-02-15T10:05:03'), + ('101', '928', '2006-02-15T10:05:03'), + ('60', '928', '2006-02-15T10:05:03'), + ('68', '315', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('48', '315', '2006-02-15T10:05:03'), + ('189', '315', '2006-02-15T10:05:03'), + ('103', '315', '2006-02-15T10:05:03'), + ('105', '315', '2006-02-15T10:05:03'), + ('184', '684', '2006-02-15T10:05:03'), + ('129', '684', '2006-02-15T10:05:03'), + ('196', '684', '2006-02-15T10:05:03'), + ('177', '684', '2006-02-15T10:05:03'), + ('161', '684', '2006-02-15T10:05:03'), + ('148', '422', '2006-02-15T10:05:03'), + ('186', '422', '2006-02-15T10:05:03'), + ('169', '93', '2006-02-15T10:05:03'), + ('26', '93', '2006-02-15T10:05:03'), + ('94', '354', '2006-02-15T10:05:03'), + ('187', '354', '2006-02-15T10:05:03'), + ('127', '354', '2006-02-15T10:05:03'), + ('56', '354', '2006-02-15T10:05:03'), + ('149', '354', '2006-02-15T10:05:03'), + ('3', '996', '2006-02-15T10:05:03'), + ('163', '996', '2006-02-15T10:05:03'), + ('84', '996', '2006-02-15T10:05:03'), + ('170', '996', '2006-02-15T10:05:03'), + ('27', '996', '2006-02-15T10:05:03'), + ('85', '711', '2006-02-15T10:05:03'), + ('19', '711', '2006-02-15T10:05:03'), + ('192', '711', '2006-02-15T10:05:03'), + ('64', '124', '2006-02-15T10:05:03'), + ('17', '124', '2006-02-15T10:05:03'), + ('102', '124', '2006-02-15T10:05:03'), + ('80', '124', '2006-02-15T10:05:03'), + ('93', '124', '2006-02-15T10:05:03'), + ('159', '206', '2006-02-15T10:05:03'), + ('94', '206', '2006-02-15T10:05:03'), + ('188', '206', '2006-02-15T10:05:03'), + ('150', '206', '2006-02-15T10:05:03'), + ('103', '206', '2006-02-15T10:05:03'), + ('131', '206', '2006-02-15T10:05:03'), + ('3', '453', '2006-02-15T10:05:03'), + ('82', '453', '2006-02-15T10:05:03'), + ('130', '453', '2006-02-15T10:05:03'), + ('70', '453', '2006-02-15T10:05:03'), + ('81', '453', '2006-02-15T10:05:03'), + ('36', '453', '2006-02-15T10:05:03'), + ('11', '453', '2006-02-15T10:05:03'), + ('138', '453', '2006-02-15T10:05:03'), + ('93', '453', '2006-02-15T10:05:03'), + ('16', '453', '2006-02-15T10:05:03'), + ('92', '453', '2006-02-15T10:05:03'), + ('162', '279', '2006-02-15T10:05:03'), + ('18', '279', '2006-02-15T10:05:03'), + ('83', '279', '2006-02-15T10:05:03'), + ('95', '748', '2006-02-15T10:05:03'), + ('189', '748', '2006-02-15T10:05:03'), + ('35', '748', '2006-02-15T10:05:03'), + ('145', '748', '2006-02-15T10:05:03'), + ('73', '748', '2006-02-15T10:05:03'), + ('113', '748', '2006-02-15T10:05:03'), + ('178', '1000', '2006-02-15T10:05:03'), + ('155', '1000', '2006-02-15T10:05:03'), + ('166', '1000', '2006-02-15T10:05:03'), + ('63', '893', '2006-02-15T10:05:03'), + ('21', '893', '2006-02-15T10:05:03'), + ('82', '893', '2006-02-15T10:05:03'), + ('105', '893', '2006-02-15T10:05:03'), + ('86', '893', '2006-02-15T10:05:03'), + ('145', '893', '2006-02-15T10:05:03'), + ('56', '893', '2006-02-15T10:05:03'), + ('125', '428', '2006-02-15T10:05:03'), + ('62', '428', '2006-02-15T10:05:03'), + ('19', '428', '2006-02-15T10:05:03'), + ('78', '428', '2006-02-15T10:05:03'), + ('115', '428', '2006-02-15T10:05:03'), + ('94', '428', '2006-02-15T10:05:03'), + ('48', '428', '2006-02-15T10:05:03'), + ('79', '428', '2006-02-15T10:05:03'), + ('14', '970', '2006-02-15T10:05:03'), + ('54', '970', '2006-02-15T10:05:03'), + ('138', '970', '2006-02-15T10:05:03'), + ('1', '970', '2006-02-15T10:05:03'), + ('89', '970', '2006-02-15T10:05:03'), + ('127', '970', '2006-02-15T10:05:03'), + ('26', '544', '2006-02-15T10:05:03'), + ('102', '544', '2006-02-15T10:05:03'), + ('41', '544', '2006-02-15T10:05:03'), + ('200', '544', '2006-02-15T10:05:03'), + ('191', '544', '2006-02-15T10:05:03'), + ('125', '238', '2006-02-15T10:05:03'), + ('120', '238', '2006-02-15T10:05:03'), + ('176', '238', '2006-02-15T10:05:03'), + ('84', '238', '2006-02-15T10:05:03'), + ('122', '238', '2006-02-15T10:05:03'), + ('128', '238', '2006-02-15T10:05:03'), + ('35', '589', '2006-02-15T10:05:03'), + ('20', '589', '2006-02-15T10:05:03'), + ('123', '589', '2006-02-15T10:05:03'), + ('84', '589', '2006-02-15T10:05:03'), + ('141', '589', '2006-02-15T10:05:03'), + ('194', '498', '2006-02-15T10:05:03'), + ('75', '498', '2006-02-15T10:05:03'), + ('140', '498', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('76', '498', '2006-02-15T10:05:03'), + ('95', '498', '2006-02-15T10:05:03'), + ('190', '62', '2006-02-15T10:05:03'), + ('110', '62', '2006-02-15T10:05:03'), + ('125', '62', '2006-02-15T10:05:03'), + ('107', '62', '2006-02-15T10:05:03'), + ('4', '62', '2006-02-15T10:05:03'), + ('2', '145', '2006-02-15T10:05:03'), + ('199', '145', '2006-02-15T10:05:03'), + ('134', '145', '2006-02-15T10:05:03'), + ('147', '145', '2006-02-15T10:05:03'), + ('74', '192', '2006-02-15T10:05:03'), + ('57', '192', '2006-02-15T10:05:03'), + ('74', '537', '2006-02-15T10:05:03'), + ('200', '537', '2006-02-15T10:05:03'), + ('14', '537', '2006-02-15T10:05:03'), + ('61', '537', '2006-02-15T10:05:03'), + ('178', '537', '2006-02-15T10:05:03'), + ('45', '537', '2006-02-15T10:05:03'), + ('170', '537', '2006-02-15T10:05:03'), + ('123', '286', '2006-02-15T10:05:03'), + ('127', '286', '2006-02-15T10:05:03'), + ('30', '286', '2006-02-15T10:05:03'), + ('165', '286', '2006-02-15T10:05:03'), + ('5', '286', '2006-02-15T10:05:03'), + ('72', '286', '2006-02-15T10:05:03'), + ('185', '286', '2006-02-15T10:05:03'), + ('133', '286', '2006-02-15T10:05:03'), + ('181', '286', '2006-02-15T10:05:03'), + ('162', '33', '2006-02-15T10:05:03'), + ('79', '33', '2006-02-15T10:05:03'), + ('136', '33', '2006-02-15T10:05:03'), + ('180', '33', '2006-02-15T10:05:03'), + ('146', '33', '2006-02-15T10:05:03'), + ('182', '33', '2006-02-15T10:05:03'), + ('170', '33', '2006-02-15T10:05:03'), + ('82', '33', '2006-02-15T10:05:03'), + ('170', '180', '2006-02-15T10:05:03'), + ('43', '180', '2006-02-15T10:05:03'), + ('153', '180', '2006-02-15T10:05:03'), + ('163', '180', '2006-02-15T10:05:03'), + ('158', '968', '2006-02-15T10:05:03'), + ('162', '968', '2006-02-15T10:05:03'), + ('88', '968', '2006-02-15T10:05:03'), + ('152', '968', '2006-02-15T10:05:03'), + ('96', '968', '2006-02-15T10:05:03'), + ('15', '968', '2006-02-15T10:05:03'), + ('78', '968', '2006-02-15T10:05:03'), + ('178', '197', '2006-02-15T10:05:03'), + ('32', '197', '2006-02-15T10:05:03'), + ('146', '197', '2006-02-15T10:05:03'), + ('97', '197', '2006-02-15T10:05:03'), + ('64', '197', '2006-02-15T10:05:03'), + ('117', '197', '2006-02-15T10:05:03'), + ('55', '197', '2006-02-15T10:05:03'), + ('103', '197', '2006-02-15T10:05:03'), + ('90', '197', '2006-02-15T10:05:03'), + ('91', '849', '2006-02-15T10:05:03'), + ('169', '849', '2006-02-15T10:05:03'), + ('141', '849', '2006-02-15T10:05:03'), + ('191', '849', '2006-02-15T10:05:03'), + ('155', '849', '2006-02-15T10:05:03'), + ('188', '849', '2006-02-15T10:05:03'), + ('171', '849', '2006-02-15T10:05:03'), + ('107', '849', '2006-02-15T10:05:03'), + ('21', '321', '2006-02-15T10:05:03'), + ('30', '321', '2006-02-15T10:05:03'), + ('74', '321', '2006-02-15T10:05:03'), + ('2', '321', '2006-02-15T10:05:03'), + ('8', '321', '2006-02-15T10:05:03'), + ('18', '321', '2006-02-15T10:05:03'), + ('157', '321', '2006-02-15T10:05:03'), + ('50', '840', '2006-02-15T10:05:03'), + ('79', '840', '2006-02-15T10:05:03'), + ('37', '840', '2006-02-15T10:05:03'), + ('141', '840', '2006-02-15T10:05:03'), + ('68', '840', '2006-02-15T10:05:03'), + ('158', '840', '2006-02-15T10:05:03'), + ('124', '22', '2006-02-15T10:05:03'), + ('95', '22', '2006-02-15T10:05:03'), + ('77', '22', '2006-02-15T10:05:03'), + ('122', '22', '2006-02-15T10:05:03'), + ('153', '536', '2006-02-15T10:05:03'), + ('14', '536', '2006-02-15T10:05:03'), + ('22', '536', '2006-02-15T10:05:03'), + ('18', '536', '2006-02-15T10:05:03'), + ('23', '536', '2006-02-15T10:05:03'), + ('198', '536', '2006-02-15T10:05:03'), + ('109', '393', '2006-02-15T10:05:03'), + ('144', '393', '2006-02-15T10:05:03'), + ('3', '393', '2006-02-15T10:05:03'), + ('57', '393', '2006-02-15T10:05:03'), + ('78', '393', '2006-02-15T10:05:03'), + ('34', '393', '2006-02-15T10:05:03'), + ('62', '393', '2006-02-15T10:05:03'), + ('157', '159', '2006-02-15T10:05:03'), + ('179', '159', '2006-02-15T10:05:03'), + ('149', '159', '2006-02-15T10:05:03'), + ('41', '159', '2006-02-15T10:05:03'), + ('21', '159', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('199', '159', '2006-02-15T10:05:03'), + ('80', '280', '2006-02-15T10:05:03'), + ('64', '280', '2006-02-15T10:05:03'), + ('15', '280', '2006-02-15T10:05:03'), + ('93', '280', '2006-02-15T10:05:03'), + ('105', '280', '2006-02-15T10:05:03'), + ('17', '280', '2006-02-15T10:05:03'), + ('18', '280', '2006-02-15T10:05:03'), + ('133', '280', '2006-02-15T10:05:03'), + ('16', '280', '2006-02-15T10:05:03'), + ('32', '103', '2006-02-15T10:05:03'), + ('26', '103', '2006-02-15T10:05:03'), + ('89', '103', '2006-02-15T10:05:03'), + ('51', '103', '2006-02-15T10:05:03'), + ('193', '103', '2006-02-15T10:05:03'), + ('92', '103', '2006-02-15T10:05:03'), + ('27', '477', '2006-02-15T10:05:03'), + ('67', '477', '2006-02-15T10:05:03'), + ('10', '477', '2006-02-15T10:05:03'), + ('58', '477', '2006-02-15T10:05:03'), + ('37', '477', '2006-02-15T10:05:03'), + ('90', '303', '2006-02-15T10:05:03'), + ('86', '303', '2006-02-15T10:05:03'), + ('163', '303', '2006-02-15T10:05:03'), + ('157', '303', '2006-02-15T10:05:03'), + ('50', '303', '2006-02-15T10:05:03'), + ('198', '303', '2006-02-15T10:05:03'), + ('176', '303', '2006-02-15T10:05:03'), + ('155', '303', '2006-02-15T10:05:03'), + ('196', '303', '2006-02-15T10:05:03'), + ('45', '416', '2006-02-15T10:05:03'), + ('12', '416', '2006-02-15T10:05:03'), + ('170', '416', '2006-02-15T10:05:03'), + ('91', '416', '2006-02-15T10:05:03'), + ('130', '416', '2006-02-15T10:05:03'), + ('17', '800', '2006-02-15T10:05:03'), + ('167', '800', '2006-02-15T10:05:03'), + ('159', '800', '2006-02-15T10:05:03'), + ('58', '800', '2006-02-15T10:05:03'), + ('48', '545', '2006-02-15T10:05:03'), + ('110', '545', '2006-02-15T10:05:03'), + ('164', '545', '2006-02-15T10:05:03'), + ('126', '545', '2006-02-15T10:05:03'), + ('81', '545', '2006-02-15T10:05:03'), + ('198', '545', '2006-02-15T10:05:03'), + ('92', '545', '2006-02-15T10:05:03'), + ('147', '351', '2006-02-15T10:05:03'), + ('102', '351', '2006-02-15T10:05:03'), + ('133', '351', '2006-02-15T10:05:03'), + ('7', '351', '2006-02-15T10:05:03'), + ('47', '351', '2006-02-15T10:05:03'), + ('127', '366', '2006-02-15T10:05:03'), + ('10', '366', '2006-02-15T10:05:03'), + ('166', '366', '2006-02-15T10:05:03'), + ('20', '366', '2006-02-15T10:05:03'), + ('155', '997', '2006-02-15T10:05:03'), + ('23', '997', '2006-02-15T10:05:03'), + ('198', '997', '2006-02-15T10:05:03'), + ('124', '997', '2006-02-15T10:05:03'), + ('37', '997', '2006-02-15T10:05:03'), + ('125', '175', '2006-02-15T10:05:03'), + ('80', '175', '2006-02-15T10:05:03'), + ('143', '175', '2006-02-15T10:05:03'), + ('58', '175', '2006-02-15T10:05:03'), + ('84', '175', '2006-02-15T10:05:03'), + ('177', '175', '2006-02-15T10:05:03'), + ('2', '550', '2006-02-15T10:05:03'), + ('72', '550', '2006-02-15T10:05:03'), + ('173', '550', '2006-02-15T10:05:03'), + ('117', '550', '2006-02-15T10:05:03'), + ('190', '54', '2006-02-15T10:05:03'), + ('5', '54', '2006-02-15T10:05:03'), + ('62', '54', '2006-02-15T10:05:03'), + ('59', '54', '2006-02-15T10:05:03'), + ('20', '54', '2006-02-15T10:05:03'), + ('96', '54', '2006-02-15T10:05:03'), + ('135', '88', '2006-02-15T10:05:03'), + ('194', '88', '2006-02-15T10:05:03'), + ('59', '88', '2006-02-15T10:05:03'), + ('44', '88', '2006-02-15T10:05:03'), + ('116', '88', '2006-02-15T10:05:03'), + ('31', '88', '2006-02-15T10:05:03'), + ('69', '88', '2006-02-15T10:05:03'), + ('21', '88', '2006-02-15T10:05:03'), + ('64', '88', '2006-02-15T10:05:03'), + ('57', '213', '2006-02-15T10:05:03'), + ('68', '213', '2006-02-15T10:05:03'), + ('25', '213', '2006-02-15T10:05:03'), + ('12', '213', '2006-02-15T10:05:03'), + ('93', '678', '2006-02-15T10:05:03'), + ('168', '678', '2006-02-15T10:05:03'), + ('51', '678', '2006-02-15T10:05:03'), + ('85', '678', '2006-02-15T10:05:03'), + ('41', '678', '2006-02-15T10:05:03'), + ('83', '339', '2006-02-15T10:05:03'), + ('167', '339', '2006-02-15T10:05:03'), + ('143', '339', '2006-02-15T10:05:03'), + ('114', '339', '2006-02-15T10:05:03'), + ('149', '339', '2006-02-15T10:05:03'), + ('93', '339', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('27', '986', '2006-02-15T10:05:03'), + ('60', '986', '2006-02-15T10:05:03'), + ('171', '701', '2006-02-15T10:05:03'), + ('198', '499', '2006-02-15T10:05:03'), + ('36', '499', '2006-02-15T10:05:03'), + ('118', '499', '2006-02-15T10:05:03'), + ('1', '499', '2006-02-15T10:05:03'), + ('187', '499', '2006-02-15T10:05:03'), + ('20', '499', '2006-02-15T10:05:03'), + ('10', '782', '2006-02-15T10:05:03'), + ('23', '782', '2006-02-15T10:05:03'), + ('98', '782', '2006-02-15T10:05:03'), + ('149', '782', '2006-02-15T10:05:03'), + ('119', '782', '2006-02-15T10:05:03'), + ('84', '782', '2006-02-15T10:05:03'), + ('164', '252', '2006-02-15T10:05:03'), + ('33', '252', '2006-02-15T10:05:03'), + ('41', '252', '2006-02-15T10:05:03'), + ('176', '252', '2006-02-15T10:05:03'), + ('184', '985', '2006-02-15T10:05:03'), + ('98', '985', '2006-02-15T10:05:03'), + ('115', '985', '2006-02-15T10:05:03'), + ('82', '985', '2006-02-15T10:05:03'), + ('15', '985', '2006-02-15T10:05:03'), + ('61', '433', '2006-02-15T10:05:03'), + ('150', '433', '2006-02-15T10:05:03'), + ('90', '433', '2006-02-15T10:05:03'), + ('49', '433', '2006-02-15T10:05:03'), + ('11', '433', '2006-02-15T10:05:03'), + ('168', '433', '2006-02-15T10:05:03'), + ('177', '433', '2006-02-15T10:05:03'), + ('137', '433', '2006-02-15T10:05:03'), + ('144', '776', '2006-02-15T10:05:03'), + ('79', '776', '2006-02-15T10:05:03'), + ('55', '776', '2006-02-15T10:05:03'), + ('48', '267', '2006-02-15T10:05:03'), + ('160', '267', '2006-02-15T10:05:03'), + ('81', '267', '2006-02-15T10:05:03'), + ('16', '267', '2006-02-15T10:05:03'), + ('79', '267', '2006-02-15T10:05:03'), + ('57', '267', '2006-02-15T10:05:03'), + ('7', '218', '2006-02-15T10:05:03'), + ('146', '218', '2006-02-15T10:05:03'), + ('113', '218', '2006-02-15T10:05:03'), + ('16', '218', '2006-02-15T10:05:03'), + ('54', '510', '2006-02-15T10:05:03'), + ('9', '510', '2006-02-15T10:05:03'), + ('19', '510', '2006-02-15T10:05:03'), + ('185', '510', '2006-02-15T10:05:03'), + ('138', '214', '2006-02-15T10:05:03'), + ('33', '214', '2006-02-15T10:05:03'), + ('192', '214', '2006-02-15T10:05:03'), + ('136', '214', '2006-02-15T10:05:03'), + ('172', '368', '2006-02-15T10:05:03'), + ('160', '368', '2006-02-15T10:05:03'), + ('148', '368', '2006-02-15T10:05:03'), + ('133', '368', '2006-02-15T10:05:03'), + ('31', '368', '2006-02-15T10:05:03'), + ('12', '513', '2006-02-15T10:05:03'), + ('100', '513', '2006-02-15T10:05:03'), + ('120', '513', '2006-02-15T10:05:03'), + ('155', '513', '2006-02-15T10:05:03'), + ('19', '513', '2006-02-15T10:05:03'), + ('13', '513', '2006-02-15T10:05:03'), + ('110', '513', '2006-02-15T10:05:03'), + ('73', '707', '2006-02-15T10:05:03'), + ('117', '707', '2006-02-15T10:05:03'), + ('35', '707', '2006-02-15T10:05:03'), + ('57', '707', '2006-02-15T10:05:03'), + ('62', '707', '2006-02-15T10:05:03'), + ('173', '379', '2006-02-15T10:05:03'), + ('108', '379', '2006-02-15T10:05:03'), + ('198', '379', '2006-02-15T10:05:03'), + ('156', '379', '2006-02-15T10:05:03'), + ('115', '379', '2006-02-15T10:05:03'), + ('4', '379', '2006-02-15T10:05:03'), + ('187', '379', '2006-02-15T10:05:03'), + ('73', '379', '2006-02-15T10:05:03'), + ('187', '441', '2006-02-15T10:05:03'), + ('3', '441', '2006-02-15T10:05:03'), + ('176', '441', '2006-02-15T10:05:03'), + ('180', '441', '2006-02-15T10:05:03'), + ('98', '738', '2006-02-15T10:05:03'), + ('195', '738', '2006-02-15T10:05:03'), + ('117', '738', '2006-02-15T10:05:03'), + ('42', '738', '2006-02-15T10:05:03'), + ('119', '738', '2006-02-15T10:05:03'), + ('194', '738', '2006-02-15T10:05:03'), + ('35', '738', '2006-02-15T10:05:03'), + ('171', '447', '2006-02-15T10:05:03'), + ('150', '447', '2006-02-15T10:05:03'), + ('139', '447', '2006-02-15T10:05:03'), + ('57', '447', '2006-02-15T10:05:03'), + ('91', '447', '2006-02-15T10:05:03'), + ('53', '447', '2006-02-15T10:05:03'), + ('31', '299', '2006-02-15T10:05:03'), + ('170', '299', '2006-02-15T10:05:03'), + ('154', '299', '2006-02-15T10:05:03'), + ('79', '299', '2006-02-15T10:05:03'), + ('60', '299', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('128', '299', '2006-02-15T10:05:03'), + ('2', '132', '2006-02-15T10:05:03'), + ('134', '132', '2006-02-15T10:05:03'), + ('111', '407', '2006-02-15T10:05:03'), + ('155', '407', '2006-02-15T10:05:03'), + ('45', '407', '2006-02-15T10:05:03'), + ('128', '407', '2006-02-15T10:05:03'), + ('52', '407', '2006-02-15T10:05:03'), + ('49', '407', '2006-02-15T10:05:03'), + ('46', '407', '2006-02-15T10:05:03'), + ('53', '51', '2006-02-15T10:05:03'), + ('188', '51', '2006-02-15T10:05:03'), + ('73', '51', '2006-02-15T10:05:03'), + ('133', '51', '2006-02-15T10:05:03'), + ('46', '51', '2006-02-15T10:05:03'), + ('187', '51', '2006-02-15T10:05:03'), + ('52', '20', '2006-02-15T10:05:03'), + ('159', '20', '2006-02-15T10:05:03'), + ('102', '20', '2006-02-15T10:05:03'), + ('155', '20', '2006-02-15T10:05:03'), + ('136', '20', '2006-02-15T10:05:03'), + ('139', '20', '2006-02-15T10:05:03'), + ('130', '525', '2006-02-15T10:05:03'), + ('34', '525', '2006-02-15T10:05:03'), + ('110', '525', '2006-02-15T10:05:03'), + ('51', '525', '2006-02-15T10:05:03'), + ('113', '525', '2006-02-15T10:05:03'), + ('101', '828', '2006-02-15T10:05:03'), + ('175', '828', '2006-02-15T10:05:03'), + ('102', '828', '2006-02-15T10:05:03'), + ('193', '828', '2006-02-15T10:05:03'), + ('182', '828', '2006-02-15T10:05:03'), + ('95', '828', '2006-02-15T10:05:03'), + ('195', '560', '2006-02-15T10:05:03'), + ('189', '560', '2006-02-15T10:05:03'), + ('143', '560', '2006-02-15T10:05:03'), + ('196', '560', '2006-02-15T10:05:03'), + ('171', '560', '2006-02-15T10:05:03'), + ('71', '560', '2006-02-15T10:05:03'), + ('185', '560', '2006-02-15T10:05:03'), + ('138', '157', '2006-02-15T10:05:03'), + ('127', '157', '2006-02-15T10:05:03'), + ('122', '157', '2006-02-15T10:05:03'), + ('109', '157', '2006-02-15T10:05:03'), + ('87', '157', '2006-02-15T10:05:03'), + ('180', '195', '2006-02-15T10:05:03'), + ('8', '195', '2006-02-15T10:05:03'), + ('49', '195', '2006-02-15T10:05:03'), + ('181', '195', '2006-02-15T10:05:03'), + ('66', '434', '2006-02-15T10:05:03'), + ('44', '434', '2006-02-15T10:05:03'), + ('163', '434', '2006-02-15T10:05:03'), + ('169', '434', '2006-02-15T10:05:03'), + ('9', '434', '2006-02-15T10:05:03'), + ('159', '208', '2006-02-15T10:05:03'), + ('63', '208', '2006-02-15T10:05:03'), + ('154', '208', '2006-02-15T10:05:03'), + ('120', '208', '2006-02-15T10:05:03'), + ('168', '208', '2006-02-15T10:05:03'), + ('108', '208', '2006-02-15T10:05:03'), + ('130', '208', '2006-02-15T10:05:03'), + ('19', '208', '2006-02-15T10:05:03'), + ('186', '208', '2006-02-15T10:05:03'), + ('12', '208', '2006-02-15T10:05:03'), + ('189', '628', '2006-02-15T10:05:03'), + ('197', '628', '2006-02-15T10:05:03'), + ('198', '628', '2006-02-15T10:05:03'), + ('135', '628', '2006-02-15T10:05:03'), + ('79', '628', '2006-02-15T10:05:03'), + ('70', '628', '2006-02-15T10:05:03'), + ('180', '628', '2006-02-15T10:05:03'), + ('167', '628', '2006-02-15T10:05:03'), + ('39', '559', '2006-02-15T10:05:03'), + ('48', '559', '2006-02-15T10:05:03'), + ('106', '559', '2006-02-15T10:05:03'), + ('93', '573', '2006-02-15T10:05:03'), + ('53', '573', '2006-02-15T10:05:03'), + ('17', '573', '2006-02-15T10:05:03'), + ('176', '573', '2006-02-15T10:05:03'), + ('127', '573', '2006-02-15T10:05:03'), + ('157', '573', '2006-02-15T10:05:03'), + ('167', '319', '2006-02-15T10:05:03'), + ('46', '319', '2006-02-15T10:05:03'), + ('143', '660', '2006-02-15T10:05:03'), + ('160', '660', '2006-02-15T10:05:03'), + ('110', '156', '2006-02-15T10:05:03'), + ('196', '156', '2006-02-15T10:05:03'), + ('132', '156', '2006-02-15T10:05:03'), + ('104', '156', '2006-02-15T10:05:03'), + ('50', '417', '2006-02-15T10:05:03'), + ('14', '417', '2006-02-15T10:05:03'), + ('187', '417', '2006-02-15T10:05:03'), + ('176', '417', '2006-02-15T10:05:03'), + ('58', '417', '2006-02-15T10:05:03'), + ('56', '417', '2006-02-15T10:05:03'), + ('74', '848', '2006-02-15T10:05:03'), + ('104', '739', '2006-02-15T10:05:03'), + ('31', '739', '2006-02-15T10:05:03'), + ('117', '739', '2006-02-15T10:05:03'), + ('196', '324', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('125', '324', '2006-02-15T10:05:03'), + ('164', '324', '2006-02-15T10:05:03'), + ('182', '324', '2006-02-15T10:05:03'), + ('139', '181', '2006-02-15T10:05:03'), + ('113', '181', '2006-02-15T10:05:03'), + ('91', '181', '2006-02-15T10:05:03'), + ('53', '181', '2006-02-15T10:05:03'), + ('171', '181', '2006-02-15T10:05:03'), + ('16', '438', '2006-02-15T10:05:03'), + ('34', '438', '2006-02-15T10:05:03'), + ('168', '438', '2006-02-15T10:05:03'), + ('1', '438', '2006-02-15T10:05:03'), + ('155', '584', '2006-02-15T10:05:03'), + ('70', '584', '2006-02-15T10:05:03'), + ('116', '584', '2006-02-15T10:05:03'), + ('185', '584', '2006-02-15T10:05:03'), + ('125', '584', '2006-02-15T10:05:03'), + ('52', '584', '2006-02-15T10:05:03'), + ('91', '13', '2006-02-15T10:05:03'), + ('94', '13', '2006-02-15T10:05:03'), + ('176', '13', '2006-02-15T10:05:03'), + ('77', '13', '2006-02-15T10:05:03'), + ('114', '13', '2006-02-15T10:05:03'), + ('76', '765', '2006-02-15T10:05:03'), + ('98', '765', '2006-02-15T10:05:03'), + ('14', '475', '2006-02-15T10:05:03'), + ('65', '475', '2006-02-15T10:05:03'), + ('85', '475', '2006-02-15T10:05:03'), + ('94', '475', '2006-02-15T10:05:03'), + ('145', '475', '2006-02-15T10:05:03'), + ('192', '475', '2006-02-15T10:05:03'), + ('99', '475', '2006-02-15T10:05:03'), + ('152', '475', '2006-02-15T10:05:03'), + ('80', '475', '2006-02-15T10:05:03'), + ('149', '913', '2006-02-15T10:05:03'), + ('54', '913', '2006-02-15T10:05:03'), + ('114', '913', '2006-02-15T10:05:03'), + ('47', '913', '2006-02-15T10:05:03'), + ('157', '913', '2006-02-15T10:05:03'), + ('39', '831', '2006-02-15T10:05:03'), + ('117', '831', '2006-02-15T10:05:03'), + ('61', '831', '2006-02-15T10:05:03'), + ('105', '831', '2006-02-15T10:05:03'), + ('107', '831', '2006-02-15T10:05:03'), + ('59', '210', '2006-02-15T10:05:03'), + ('133', '210', '2006-02-15T10:05:03'), + ('114', '210', '2006-02-15T10:05:03'), + ('157', '210', '2006-02-15T10:05:03'), + ('180', '657', '2006-02-15T10:05:03'), + ('109', '657', '2006-02-15T10:05:03'), + ('104', '657', '2006-02-15T10:05:03'), + ('41', '657', '2006-02-15T10:05:03'), + ('76', '935', '2006-02-15T10:05:03'), + ('23', '935', '2006-02-15T10:05:03'), + ('131', '320', '2006-02-15T10:05:03'), + ('135', '320', '2006-02-15T10:05:03'), + ('39', '320', '2006-02-15T10:05:03'), + ('42', '320', '2006-02-15T10:05:03'), + ('55', '320', '2006-02-15T10:05:03'), + ('176', '320', '2006-02-15T10:05:03'), + ('94', '320', '2006-02-15T10:05:03'), + ('146', '320', '2006-02-15T10:05:03'), + ('96', '320', '2006-02-15T10:05:03'), + ('29', '646', '2006-02-15T10:05:03'), + ('156', '646', '2006-02-15T10:05:03'), + ('79', '646', '2006-02-15T10:05:03'), + ('64', '646', '2006-02-15T10:05:03'), + ('84', '646', '2006-02-15T10:05:03'), + ('38', '241', '2006-02-15T10:05:03'), + ('59', '241', '2006-02-15T10:05:03'), + ('158', '241', '2006-02-15T10:05:03'), + ('106', '241', '2006-02-15T10:05:03'), + ('26', '241', '2006-02-15T10:05:03'), + ('14', '241', '2006-02-15T10:05:03'), + ('168', '241', '2006-02-15T10:05:03'), + ('43', '533', '2006-02-15T10:05:03'), + ('189', '533', '2006-02-15T10:05:03'), + ('94', '533', '2006-02-15T10:05:03'), + ('84', '529', '2006-02-15T10:05:03'), + ('89', '529', '2006-02-15T10:05:03'), + ('188', '529', '2006-02-15T10:05:03'), + ('90', '529', '2006-02-15T10:05:03'), + ('172', '529', '2006-02-15T10:05:03'), + ('102', '529', '2006-02-15T10:05:03'), + ('139', '529', '2006-02-15T10:05:03'), + ('173', '529', '2006-02-15T10:05:03'), + ('83', '529', '2006-02-15T10:05:03'), + ('26', '529', '2006-02-15T10:05:03'), + ('69', '529', '2006-02-15T10:05:03'), + ('37', '529', '2006-02-15T10:05:03'), + ('77', '240', '2006-02-15T10:05:03'), + ('90', '676', '2006-02-15T10:05:03'), + ('66', '676', '2006-02-15T10:05:03'), + ('121', '884', '2006-02-15T10:05:03'), + ('164', '884', '2006-02-15T10:05:03'), + ('173', '857', '2006-02-15T10:05:03'), + ('129', '857', '2006-02-15T10:05:03'), + ('86', '857', '2006-02-15T10:05:03'), + ('140', '857', '2006-02-15T10:05:03'), + ('17', '127', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('144', '127', '2006-02-15T10:05:03'), + ('187', '127', '2006-02-15T10:05:03'), + ('159', '127', '2006-02-15T10:05:03'), + ('152', '964', '2006-02-15T10:05:03'), + ('72', '964', '2006-02-15T10:05:03'), + ('10', '964', '2006-02-15T10:05:03'), + ('9', '964', '2006-02-15T10:05:03'), + ('70', '964', '2006-02-15T10:05:03'), + ('22', '964', '2006-02-15T10:05:03'), + ('128', '696', '2006-02-15T10:05:03'), + ('157', '696', '2006-02-15T10:05:03'), + ('108', '696', '2006-02-15T10:05:03'), + ('39', '696', '2006-02-15T10:05:03'), + ('92', '929', '2006-02-15T10:05:03'), + ('10', '929', '2006-02-15T10:05:03'), + ('34', '929', '2006-02-15T10:05:03'), + ('88', '929', '2006-02-15T10:05:03'), + ('86', '929', '2006-02-15T10:05:03'), + ('6', '902', '2006-02-15T10:05:03'), + ('74', '902', '2006-02-15T10:05:03'), + ('44', '902', '2006-02-15T10:05:03'), + ('48', '705', '2006-02-15T10:05:03'), + ('156', '705', '2006-02-15T10:05:03'), + ('190', '705', '2006-02-15T10:05:03'), + ('129', '705', '2006-02-15T10:05:03'), + ('38', '705', '2006-02-15T10:05:03'), + ('174', '705', '2006-02-15T10:05:03'), + ('170', '705', '2006-02-15T10:05:03'), + ('98', '705', '2006-02-15T10:05:03'), + ('39', '425', '2006-02-15T10:05:03'), + ('114', '425', '2006-02-15T10:05:03'), + ('161', '425', '2006-02-15T10:05:03'), + ('3', '539', '2006-02-15T10:05:03'), + ('124', '539', '2006-02-15T10:05:03'), + ('151', '539', '2006-02-15T10:05:03'), + ('110', '539', '2006-02-15T10:05:03'), + ('181', '539', '2006-02-15T10:05:03'), + ('131', '539', '2006-02-15T10:05:03'), + ('175', '591', '2006-02-15T10:05:03'), + ('146', '591', '2006-02-15T10:05:03'), + ('50', '591', '2006-02-15T10:05:03'), + ('85', '591', '2006-02-15T10:05:03'), + ('44', '591', '2006-02-15T10:05:03'), + ('156', '448', '2006-02-15T10:05:03'), + ('164', '448', '2006-02-15T10:05:03'), + ('185', '448', '2006-02-15T10:05:03'), + ('46', '448', '2006-02-15T10:05:03'), + ('64', '448', '2006-02-15T10:05:03'), + ('38', '448', '2006-02-15T10:05:03'), + ('84', '540', '2006-02-15T10:05:03'), + ('94', '540', '2006-02-15T10:05:03'), + ('142', '540', '2006-02-15T10:05:03'), + ('99', '540', '2006-02-15T10:05:03'), + ('2', '540', '2006-02-15T10:05:03'), + ('144', '540', '2006-02-15T10:05:03'), + ('139', '540', '2006-02-15T10:05:03'), + ('12', '540', '2006-02-15T10:05:03'), + ('46', '540', '2006-02-15T10:05:03'), + ('27', '540', '2006-02-15T10:05:03'), + ('146', '384', '2006-02-15T10:05:03'), + ('118', '384', '2006-02-15T10:05:03'), + ('90', '384', '2006-02-15T10:05:03'), + ('116', '384', '2006-02-15T10:05:03'), + ('177', '289', '2006-02-15T10:05:03'), + ('3', '289', '2006-02-15T10:05:03'), + ('124', '289', '2006-02-15T10:05:03'), + ('169', '289', '2006-02-15T10:05:03'), + ('101', '289', '2006-02-15T10:05:03'), + ('188', '289', '2006-02-15T10:05:03'), + ('106', '439', '2006-02-15T10:05:03'), + ('175', '439', '2006-02-15T10:05:03'), + ('167', '191', '2006-02-15T10:05:03'), + ('10', '191', '2006-02-15T10:05:03'), + ('175', '191', '2006-02-15T10:05:03'), + ('9', '191', '2006-02-15T10:05:03'), + ('141', '191', '2006-02-15T10:05:03'), + ('146', '191', '2006-02-15T10:05:03'), + ('126', '96', '2006-02-15T10:05:03'), + ('17', '96', '2006-02-15T10:05:03'), + ('28', '96', '2006-02-15T10:05:03'), + ('7', '96', '2006-02-15T10:05:03'), + ('52', '96', '2006-02-15T10:05:03'), + ('137', '96', '2006-02-15T10:05:03'), + ('81', '304', '2006-02-15T10:05:03'), + ('88', '304', '2006-02-15T10:05:03'), + ('163', '304', '2006-02-15T10:05:03'), + ('137', '304', '2006-02-15T10:05:03'), + ('70', '304', '2006-02-15T10:05:03'), + ('193', '376', '2006-02-15T10:05:03'), + ('138', '376', '2006-02-15T10:05:03'), + ('52', '376', '2006-02-15T10:05:03'), + ('60', '376', '2006-02-15T10:05:03'), + ('66', '376', '2006-02-15T10:05:03'), + ('8', '936', '2006-02-15T10:05:03'), + ('73', '936', '2006-02-15T10:05:03'), + ('134', '936', '2006-02-15T10:05:03'), + ('101', '936', '2006-02-15T10:05:03'), + ('56', '936', '2006-02-15T10:05:03'), + ('81', '4', '2006-02-15T10:05:03'), + ('88', '4', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('41', '4', '2006-02-15T10:05:03'), + ('147', '4', '2006-02-15T10:05:03'), + ('162', '4', '2006-02-15T10:05:03'), + ('59', '984', '2006-02-15T10:05:03'), + ('164', '984', '2006-02-15T10:05:03'), + ('104', '984', '2006-02-15T10:05:03'), + ('101', '984', '2006-02-15T10:05:03'), + ('68', '497', '2006-02-15T10:05:03'), + ('125', '497', '2006-02-15T10:05:03'), + ('143', '497', '2006-02-15T10:05:03'), + ('21', '497', '2006-02-15T10:05:03'), + ('82', '497', '2006-02-15T10:05:03'), + ('180', '777', '2006-02-15T10:05:03'), + ('150', '777', '2006-02-15T10:05:03'), + ('83', '777', '2006-02-15T10:05:03'), + ('93', '777', '2006-02-15T10:05:03'), + ('47', '777', '2006-02-15T10:05:03'), + ('111', '777', '2006-02-15T10:05:03'), + ('121', '220', '2006-02-15T10:05:03'), + ('155', '220', '2006-02-15T10:05:03'), + ('107', '220', '2006-02-15T10:05:03'), + ('120', '994', '2006-02-15T10:05:03'), + ('115', '994', '2006-02-15T10:05:03'), + ('105', '994', '2006-02-15T10:05:03'), + ('186', '994', '2006-02-15T10:05:03'), + ('6', '994', '2006-02-15T10:05:03'), + ('28', '994', '2006-02-15T10:05:03'), + ('3', '185', '2006-02-15T10:05:03'), + ('191', '185', '2006-02-15T10:05:03'), + ('140', '185', '2006-02-15T10:05:03'), + ('123', '185', '2006-02-15T10:05:03'), + ('74', '185', '2006-02-15T10:05:03'), + ('29', '172', '2006-02-15T10:05:03'), + ('27', '172', '2006-02-15T10:05:03'), + ('119', '172', '2006-02-15T10:05:03'), + ('18', '172', '2006-02-15T10:05:03'), + ('47', '172', '2006-02-15T10:05:03'), + ('5', '172', '2006-02-15T10:05:03'), + ('34', '172', '2006-02-15T10:05:03'), + ('107', '172', '2006-02-15T10:05:03'), + ('133', '172', '2006-02-15T10:05:03'), + ('92', '547', '2006-02-15T10:05:03'), + ('29', '547', '2006-02-15T10:05:03'), + ('38', '547', '2006-02-15T10:05:03'), + ('75', '547', '2006-02-15T10:05:03'), + ('105', '835', '2006-02-15T10:05:03'), + ('93', '835', '2006-02-15T10:05:03'), + ('140', '835', '2006-02-15T10:05:03'), + ('99', '835', '2006-02-15T10:05:03'), + ('157', '835', '2006-02-15T10:05:03'), + ('28', '835', '2006-02-15T10:05:03'), + ('40', '835', '2006-02-15T10:05:03'), + ('60', '835', '2006-02-15T10:05:03'), + ('133', '594', '2006-02-15T10:05:03'), + ('15', '594', '2006-02-15T10:05:03'), + ('68', '133', '2006-02-15T10:05:03'), + ('148', '133', '2006-02-15T10:05:03'), + ('107', '133', '2006-02-15T10:05:03'), + ('133', '133', '2006-02-15T10:05:03'), + ('29', '133', '2006-02-15T10:05:03'), + ('132', '133', '2006-02-15T10:05:03'), + ('60', '133', '2006-02-15T10:05:03') + ) AS data(old_actor_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."actor"' + AND map0.old_id = data.old_actor_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + -- Table: "public"."film_category" (1000 records) + INSERT INTO "public"."film_category" ("category_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('2', '805', '2006-02-15T10:07:09'), + ('3', '853', '2006-02-15T10:07:09'), + ('14', '817', '2006-02-15T10:07:09'), + ('1', '732', '2006-02-15T10:07:09'), + ('11', '65', '2006-02-15T10:07:09'), + ('1', '915', '2006-02-15T10:07:09'), + ('3', '999', '2006-02-15T10:07:09'), + ('2', '564', '2006-02-15T10:07:09'), + ('15', '176', '2006-02-15T10:07:09'), + ('14', '655', '2006-02-15T10:07:09'), + ('13', '32', '2006-02-15T10:07:09'), + ('16', '75', '2006-02-15T10:07:09'), + ('11', '653', '2006-02-15T10:07:09'), + ('10', '362', '2006-02-15T10:07:09'), + ('9', '789', '2006-02-15T10:07:09'), + ('16', '642', '2006-02-15T10:07:09'), + ('14', '930', '2006-02-15T10:07:09'), + ('8', '82', '2006-02-15T10:07:09'), + ('11', '34', '2006-02-15T10:07:09'), + ('16', '233', '2006-02-15T10:07:09'), + ('9', '792', '2006-02-15T10:07:09'), + ('2', '355', '2006-02-15T10:07:09'), + ('3', '761', '2006-02-15T10:07:09'), + ('6', '575', '2006-02-15T10:07:09'), + ('7', '643', '2006-02-15T10:07:09'), + ('12', '454', '2006-02-15T10:07:09'), + ('8', '71', '2006-02-15T10:07:09'), + ('15', '488', '2006-02-15T10:07:09'), + ('13', '108', '2006-02-15T10:07:09'), + ('4', '91', '2006-02-15T10:07:09'), + ('10', '387', '2006-02-15T10:07:09'), + ('3', '959', '2006-02-15T10:07:09'), + ('8', '458', '2006-02-15T10:07:09'), + ('7', '728', '2006-02-15T10:07:09'), + ('5', '704', '2006-02-15T10:07:09'), + ('4', '950', '2006-02-15T10:07:09'), + ('12', '752', '2006-02-15T10:07:09'), + ('7', '818', '2006-02-15T10:07:09'), + ('2', '583', '2006-02-15T10:07:09'), + ('3', '626', '2006-02-15T10:07:09'), + ('6', '834', '2006-02-15T10:07:09'), + ('2', '160', '2006-02-15T10:07:09'), + ('10', '483', '2006-02-15T10:07:09'), + ('10', '189', '2006-02-15T10:07:09'), + ('8', '822', '2006-02-15T10:07:09'), + ('6', '248', '2006-02-15T10:07:09'), + ('12', '647', '2006-02-15T10:07:09'), + ('4', '228', '2006-02-15T10:07:09'), + ('1', '29', '2006-02-15T10:07:09'), + ('14', '520', '2006-02-15T10:07:09'), + ('7', '969', '2006-02-15T10:07:09'), + ('12', '411', '2006-02-15T10:07:09'), + ('3', '755', '2006-02-15T10:07:09'), + ('1', '501', '2006-02-15T10:07:09'), + ('5', '247', '2006-02-15T10:07:09'), + ('7', '186', '2006-02-15T10:07:09'), + ('10', '654', '2006-02-15T10:07:09'), + ('9', '769', '2006-02-15T10:07:09'), + ('5', '858', '2006-02-15T10:07:09'), + ('3', '509', '2006-02-15T10:07:09'), + ('10', '352', '2006-02-15T10:07:09'), + ('14', '394', '2006-02-15T10:07:09'), + ('15', '599', '2006-02-15T10:07:09'), + ('16', '526', '2006-02-15T10:07:09'), + ('7', '979', '2006-02-15T10:07:09'), + ('5', '182', '2006-02-15T10:07:09'), + ('16', '451', '2006-02-15T10:07:09'), + ('6', '992', '2006-02-15T10:07:09'), + ('10', '331', '2006-02-15T10:07:09'), + ('12', '278', '2006-02-15T10:07:09'), + ('10', '381', '2006-02-15T10:07:09'), + ('10', '117', '2006-02-15T10:07:09'), + ('9', '414', '2006-02-15T10:07:09'), + ('10', '597', '2006-02-15T10:07:09'), + ('13', '305', '2006-02-15T10:07:09'), + ('1', '105', '2006-02-15T10:07:09'), + ('3', '68', '2006-02-15T10:07:09'), + ('3', '450', '2006-02-15T10:07:09'), + ('15', '841', '2006-02-15T10:07:09'), + ('14', '449', '2006-02-15T10:07:09'), + ('4', '487', '2006-02-15T10:07:09'), + ('5', '7', '2006-02-15T10:07:09'), + ('3', '889', '2006-02-15T10:07:09'), + ('6', '457', '2006-02-15T10:07:09'), + ('14', '839', '2006-02-15T10:07:09'), + ('16', '894', '2006-02-15T10:07:09'), + ('7', '146', '2006-02-15T10:07:09'), + ('10', '508', '2006-02-15T10:07:09'), + ('4', '578', '2006-02-15T10:07:09'), + ('9', '623', '2006-02-15T10:07:09'), + ('3', '735', '2006-02-15T10:07:09'), + ('10', '200', '2006-02-15T10:07:09'), + ('4', '808', '2006-02-15T10:07:09'), + ('11', '275', '2006-02-15T10:07:09'), + ('6', '3', '2006-02-15T10:07:09'), + ('15', '519', '2006-02-15T10:07:09'), + ('12', '921', '2006-02-15T10:07:09'), + ('2', '456', '2006-02-15T10:07:09'), + ('4', '663', '2006-02-15T10:07:09'), + ('9', '770', '2006-02-15T10:07:09') + ) AS data(old_category_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."category"' + AND map0.old_id = data.old_category_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_category" ("category_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('2', '651', '2006-02-15T10:07:09'), + ('14', '296', '2006-02-15T10:07:09'), + ('6', '142', '2006-02-15T10:07:09'), + ('15', '890', '2006-02-15T10:07:09'), + ('8', '727', '2006-02-15T10:07:09'), + ('7', '98', '2006-02-15T10:07:09'), + ('15', '668', '2006-02-15T10:07:09'), + ('13', '492', '2006-02-15T10:07:09'), + ('15', '322', '2006-02-15T10:07:09'), + ('12', '86', '2006-02-15T10:07:09'), + ('8', '832', '2006-02-15T10:07:09'), + ('15', '291', '2006-02-15T10:07:09'), + ('15', '796', '2006-02-15T10:07:09'), + ('10', '563', '2006-02-15T10:07:09'), + ('5', '242', '2006-02-15T10:07:09'), + ('11', '658', '2006-02-15T10:07:09'), + ('6', '199', '2006-02-15T10:07:09'), + ('12', '797', '2006-02-15T10:07:09'), + ('16', '787', '2006-02-15T10:07:09'), + ('8', '139', '2006-02-15T10:07:09'), + ('10', '976', '2006-02-15T10:07:09'), + ('15', '619', '2006-02-15T10:07:09'), + ('2', '118', '2006-02-15T10:07:09'), + ('15', '940', '2006-02-15T10:07:09'), + ('12', '363', '2006-02-15T10:07:09'), + ('1', '549', '2006-02-15T10:07:09'), + ('16', '868', '2006-02-15T10:07:09'), + ('16', '878', '2006-02-15T10:07:09'), + ('13', '677', '2006-02-15T10:07:09'), + ('9', '16', '2006-02-15T10:07:09'), + ('6', '427', '2006-02-15T10:07:09'), + ('14', '912', '2006-02-15T10:07:09'), + ('13', '551', '2006-02-15T10:07:09'), + ('1', '869', '2006-02-15T10:07:09'), + ('8', '621', '2006-02-15T10:07:09'), + ('12', '516', '2006-02-15T10:07:09'), + ('2', '243', '2006-02-15T10:07:09'), + ('11', '2', '2006-02-15T10:07:09'), + ('13', '364', '2006-02-15T10:07:09'), + ('9', '47', '2006-02-15T10:07:09'), + ('16', '347', '2006-02-15T10:07:09'), + ('2', '644', '2006-02-15T10:07:09'), + ('4', '131', '2006-02-15T10:07:09'), + ('9', '52', '2006-02-15T10:07:09'), + ('16', '167', '2006-02-15T10:07:09'), + ('15', '254', '2006-02-15T10:07:09'), + ('15', '733', '2006-02-15T10:07:09'), + ('13', '590', '2006-02-15T10:07:09'), + ('2', '690', '2006-02-15T10:07:09'), + ('1', '360', '2006-02-15T10:07:09'), + ('15', '293', '2006-02-15T10:07:09'), + ('12', '333', '2006-02-15T10:07:09'), + ('13', '730', '2006-02-15T10:07:09'), + ('16', '257', '2006-02-15T10:07:09'), + ('2', '134', '2006-02-15T10:07:09'), + ('10', '215', '2006-02-15T10:07:09'), + ('6', '571', '2006-02-15T10:07:09'), + ('2', '461', '2006-02-15T10:07:09'), + ('2', '820', '2006-02-15T10:07:09'), + ('2', '892', '2006-02-15T10:07:09'), + ('9', '641', '2006-02-15T10:07:09'), + ('2', '326', '2006-02-15T10:07:09'), + ('8', '610', '2006-02-15T10:07:09'), + ('6', '687', '2006-02-15T10:07:09'), + ('2', '402', '2006-02-15T10:07:09'), + ('9', '961', '2006-02-15T10:07:09'), + ('4', '471', '2006-02-15T10:07:09'), + ('4', '962', '2006-02-15T10:07:09'), + ('16', '981', '2006-02-15T10:07:09'), + ('4', '358', '2006-02-15T10:07:09'), + ('7', '61', '2006-02-15T10:07:09'), + ('10', '624', '2006-02-15T10:07:09'), + ('5', '413', '2006-02-15T10:07:09'), + ('16', '645', '2006-02-15T10:07:09'), + ('9', '380', '2006-02-15T10:07:09'), + ('1', '823', '2006-02-15T10:07:09'), + ('3', '768', '2006-02-15T10:07:09'), + ('6', '888', '2006-02-15T10:07:09'), + ('7', '504', '2006-02-15T10:07:09'), + ('8', '824', '2006-02-15T10:07:09'), + ('9', '431', '2006-02-15T10:07:09'), + ('6', '757', '2006-02-15T10:07:09'), + ('9', '669', '2006-02-15T10:07:09'), + ('13', '251', '2006-02-15T10:07:09'), + ('8', '810', '2006-02-15T10:07:09'), + ('4', '523', '2006-02-15T10:07:09'), + ('13', '686', '2006-02-15T10:07:09'), + ('8', '753', '2006-02-15T10:07:09'), + ('11', '830', '2006-02-15T10:07:09'), + ('14', '637', '2006-02-15T10:07:09'), + ('15', '763', '2006-02-15T10:07:09'), + ('2', '470', '2006-02-15T10:07:09'), + ('11', '8', '2006-02-15T10:07:09'), + ('15', '463', '2006-02-15T10:07:09'), + ('8', '63', '2006-02-15T10:07:09'), + ('16', '87', '2006-02-15T10:07:09'), + ('10', '141', '2006-02-15T10:07:09'), + ('4', '512', '2006-02-15T10:07:09'), + ('1', '586', '2006-02-15T10:07:09'), + ('12', '462', '2006-02-15T10:07:09') + ) AS data(old_category_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."category"' + AND map0.old_id = data.old_category_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_category" ("category_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('2', '70', '2006-02-15T10:07:09'), + ('15', '809', '2006-02-15T10:07:09'), + ('7', '209', '2006-02-15T10:07:09'), + ('8', '724', '2006-02-15T10:07:09'), + ('14', '390', '2006-02-15T10:07:09'), + ('9', '607', '2006-02-15T10:07:09'), + ('8', '442', '2006-02-15T10:07:09'), + ('10', '316', '2006-02-15T10:07:09'), + ('10', '781', '2006-02-15T10:07:09'), + ('8', '867', '2006-02-15T10:07:09'), + ('4', '554', '2006-02-15T10:07:09'), + ('1', '794', '2006-02-15T10:07:09'), + ('3', '993', '2006-02-15T10:07:09'), + ('9', '170', '2006-02-15T10:07:09'), + ('9', '337', '2006-02-15T10:07:09'), + ('1', '825', '2006-02-15T10:07:09'), + ('2', '541', '2006-02-15T10:07:09'), + ('6', '945', '2006-02-15T10:07:09'), + ('1', '659', '2006-02-15T10:07:09'), + ('14', '374', '2006-02-15T10:07:09'), + ('12', '562', '2006-02-15T10:07:09'), + ('13', '95', '2006-02-15T10:07:09'), + ('7', '923', '2006-02-15T10:07:09'), + ('15', '113', '2006-02-15T10:07:09'), + ('3', '468', '2006-02-15T10:07:09'), + ('15', '532', '2006-02-15T10:07:09'), + ('11', '313', '2006-02-15T10:07:09'), + ('9', '566', '2006-02-15T10:07:09'), + ('6', '219', '2006-02-15T10:07:09'), + ('7', '225', '2006-02-15T10:07:09'), + ('13', '974', '2006-02-15T10:07:09'), + ('10', '699', '2006-02-15T10:07:09'), + ('13', '25', '2006-02-15T10:07:09'), + ('8', '269', '2006-02-15T10:07:09'), + ('7', '64', '2006-02-15T10:07:09'), + ('10', '507', '2006-02-15T10:07:09'), + ('13', '109', '2006-02-15T10:07:09'), + ('12', '378', '2006-02-15T10:07:09'), + ('15', '917', '2006-02-15T10:07:09'), + ('1', '697', '2006-02-15T10:07:09'), + ('14', '138', '2006-02-15T10:07:09'), + ('3', '48', '2006-02-15T10:07:09'), + ('10', '264', '2006-02-15T10:07:09'), + ('14', '234', '2006-02-15T10:07:09'), + ('8', '43', '2006-02-15T10:07:09'), + ('7', '230', '2006-02-15T10:07:09'), + ('1', '115', '2006-02-15T10:07:09'), + ('10', '919', '2006-02-15T10:07:09'), + ('9', '531', '2006-02-15T10:07:09'), + ('3', '553', '2006-02-15T10:07:09'), + ('1', '371', '2006-02-15T10:07:09'), + ('8', '778', '2006-02-15T10:07:09'), + ('12', '12', '2006-02-15T10:07:09'), + ('2', '330', '2006-02-15T10:07:09'), + ('2', '121', '2006-02-15T10:07:09'), + ('13', '90', '2006-02-15T10:07:09'), + ('8', '715', '2006-02-15T10:07:09'), + ('12', '174', '2006-02-15T10:07:09'), + ('10', '956', '2006-02-15T10:07:09'), + ('12', '980', '2006-02-15T10:07:09'), + ('12', '158', '2006-02-15T10:07:09'), + ('2', '865', '2006-02-15T10:07:09'), + ('8', '528', '2006-02-15T10:07:09'), + ('13', '846', '2006-02-15T10:07:09'), + ('7', '514', '2006-02-15T10:07:09'), + ('13', '635', '2006-02-15T10:07:09'), + ('3', '373', '2006-02-15T10:07:09'), + ('9', '421', '2006-02-15T10:07:09'), + ('16', '169', '2006-02-15T10:07:09'), + ('10', '232', '2006-02-15T10:07:09'), + ('6', '926', '2006-02-15T10:07:09'), + ('12', '398', '2006-02-15T10:07:09'), + ('5', '754', '2006-02-15T10:07:09'), + ('16', '609', '2006-02-15T10:07:09'), + ('15', '606', '2006-02-15T10:07:09'), + ('5', '365', '2006-02-15T10:07:09'), + ('14', '860', '2006-02-15T10:07:09'), + ('11', '527', '2006-02-15T10:07:09'), + ('9', '460', '2006-02-15T10:07:09'), + ('5', '871', '2006-02-15T10:07:09'), + ('11', '24', '2006-02-15T10:07:09'), + ('6', '952', '2006-02-15T10:07:09'), + ('8', '419', '2006-02-15T10:07:09'), + ('15', '570', '2006-02-15T10:07:09'), + ('13', '270', '2006-02-15T10:07:09'), + ('1', '292', '2006-02-15T10:07:09'), + ('8', '780', '2006-02-15T10:07:09'), + ('6', '72', '2006-02-15T10:07:09'), + ('5', '939', '2006-02-15T10:07:09'), + ('4', '190', '2006-02-15T10:07:09'), + ('15', '612', '2006-02-15T10:07:09'), + ('13', '283', '2006-02-15T10:07:09'), + ('3', '152', '2006-02-15T10:07:09'), + ('5', '478', '2006-02-15T10:07:09'), + ('8', '31', '2006-02-15T10:07:09'), + ('5', '444', '2006-02-15T10:07:09'), + ('14', '137', '2006-02-15T10:07:09'), + ('6', '85', '2006-02-15T10:07:09'), + ('7', '944', '2006-02-15T10:07:09'), + ('4', '14', '2006-02-15T10:07:09') + ) AS data(old_category_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."category"' + AND map0.old_id = data.old_category_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_category" ("category_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('5', '410', '2006-02-15T10:07:09'), + ('1', '271', '2006-02-15T10:07:09'), + ('4', '891', '2006-02-15T10:07:09'), + ('4', '184', '2006-02-15T10:07:09'), + ('1', '205', '2006-02-15T10:07:09'), + ('9', '207', '2006-02-15T10:07:09'), + ('5', '814', '2006-02-15T10:07:09'), + ('15', '372', '2006-02-15T10:07:09'), + ('2', '223', '2006-02-15T10:07:09'), + ('5', '568', '2006-02-15T10:07:09'), + ('11', '737', '2006-02-15T10:07:09'), + ('10', '306', '2006-02-15T10:07:09'), + ('7', '803', '2006-02-15T10:07:09'), + ('1', '162', '2006-02-15T10:07:09'), + ('1', '793', '2006-02-15T10:07:09'), + ('16', '989', '2006-02-15T10:07:09'), + ('13', '632', '2006-02-15T10:07:09'), + ('14', '81', '2006-02-15T10:07:09'), + ('1', '67', '2006-02-15T10:07:09'), + ('3', '370', '2006-02-15T10:07:09'), + ('10', '236', '2006-02-15T10:07:09'), + ('8', '147', '2006-02-15T10:07:09'), + ('7', '897', '2006-02-15T10:07:09'), + ('5', '932', '2006-02-15T10:07:09'), + ('13', '760', '2006-02-15T10:07:09'), + ('5', '99', '2006-02-15T10:07:09'), + ('13', '436', '2006-02-15T10:07:09'), + ('10', '106', '2006-02-15T10:07:09'), + ('10', '310', '2006-02-15T10:07:09'), + ('6', '622', '2006-02-15T10:07:09'), + ('10', '546', '2006-02-15T10:07:09'), + ('8', '679', '2006-02-15T10:07:09'), + ('9', '689', '2006-02-15T10:07:09'), + ('5', '555', '2006-02-15T10:07:09'), + ('6', '274', '2006-02-15T10:07:09'), + ('4', '731', '2006-02-15T10:07:09'), + ('7', '766', '2006-02-15T10:07:09'), + ('4', '341', '2006-02-15T10:07:09'), + ('11', '799', '2006-02-15T10:07:09'), + ('2', '886', '2006-02-15T10:07:09'), + ('9', '399', '2006-02-15T10:07:09'), + ('15', '446', '2006-02-15T10:07:09'), + ('4', '951', '2006-02-15T10:07:09'), + ('12', '879', '2006-02-15T10:07:09'), + ('14', '369', '2006-02-15T10:07:09'), + ('9', '500', '2006-02-15T10:07:09'), + ('11', '740', '2006-02-15T10:07:09'), + ('15', '779', '2006-02-15T10:07:09'), + ('11', '909', '2006-02-15T10:07:09'), + ('11', '258', '2006-02-15T10:07:09'), + ('14', '620', '2006-02-15T10:07:09'), + ('14', '55', '2006-02-15T10:07:09'), + ('8', '736', '2006-02-15T10:07:09'), + ('7', '585', '2006-02-15T10:07:09'), + ('4', '480', '2006-02-15T10:07:09'), + ('15', '745', '2006-02-15T10:07:09'), + ('1', '250', '2006-02-15T10:07:09'), + ('3', '588', '2006-02-15T10:07:09'), + ('2', '963', '2006-02-15T10:07:09'), + ('16', '307', '2006-02-15T10:07:09'), + ('15', '120', '2006-02-15T10:07:09'), + ('15', '844', '2006-02-15T10:07:09'), + ('6', '734', '2006-02-15T10:07:09'), + ('4', '843', '2006-02-15T10:07:09'), + ('11', '593', '2006-02-15T10:07:09'), + ('8', '829', '2006-02-15T10:07:09'), + ('3', '168', '2006-02-15T10:07:09'), + ('3', '786', '2006-02-15T10:07:09'), + ('13', '340', '2006-02-15T10:07:09'), + ('6', '336', '2006-02-15T10:07:09'), + ('1', '511', '2006-02-15T10:07:09'), + ('6', '812', '2006-02-15T10:07:09'), + ('6', '129', '2006-02-15T10:07:09'), + ('4', '346', '2006-02-15T10:07:09'), + ('5', '613', '2006-02-15T10:07:09'), + ('4', '895', '2006-02-15T10:07:09'), + ('8', '795', '2006-02-15T10:07:09'), + ('12', '741', '2006-02-15T10:07:09'), + ('5', '119', '2006-02-15T10:07:09'), + ('15', '42', '2006-02-15T10:07:09'), + ('9', '726', '2006-02-15T10:07:09'), + ('9', '198', '2006-02-15T10:07:09'), + ('5', '385', '2006-02-15T10:07:09'), + ('12', '17', '2006-02-15T10:07:09'), + ('13', '806', '2006-02-15T10:07:09'), + ('5', '672', '2006-02-15T10:07:09'), + ('3', '343', '2006-02-15T10:07:09'), + ('2', '239', '2006-02-15T10:07:09'), + ('1', '318', '2006-02-15T10:07:09'), + ('2', '464', '2006-02-15T10:07:09'), + ('14', '26', '2006-02-15T10:07:09'), + ('16', '988', '2006-02-15T10:07:09'), + ('6', '670', '2006-02-15T10:07:09'), + ('3', '608', '2006-02-15T10:07:09'), + ('5', '524', '2006-02-15T10:07:09'), + ('1', '212', '2006-02-15T10:07:09'), + ('12', '819', '2006-02-15T10:07:09'), + ('5', '308', '2006-02-15T10:07:09'), + ('2', '89', '2006-02-15T10:07:09'), + ('2', '23', '2006-02-15T10:07:09') + ) AS data(old_category_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."category"' + AND map0.old_id = data.old_category_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_category" ("category_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('15', '260', '2006-02-15T10:07:09'), + ('1', '111', '2006-02-15T10:07:09'), + ('10', '934', '2006-02-15T10:07:09'), + ('2', '743', '2006-02-15T10:07:09'), + ('6', '943', '2006-02-15T10:07:09'), + ('6', '221', '2006-02-15T10:07:09'), + ('8', '603', '2006-02-15T10:07:09'), + ('16', '826', '2006-02-15T10:07:09'), + ('7', '473', '2006-02-15T10:07:09'), + ('16', '543', '2006-02-15T10:07:09'), + ('9', '201', '2006-02-15T10:07:09'), + ('14', '350', '2006-02-15T10:07:09'), + ('13', '136', '2006-02-15T10:07:09'), + ('6', '698', '2006-02-15T10:07:09'), + ('5', '332', '2006-02-15T10:07:09'), + ('5', '905', '2006-02-15T10:07:09'), + ('6', '973', '2006-02-15T10:07:09'), + ('6', '261', '2006-02-15T10:07:09'), + ('14', '177', '2006-02-15T10:07:09'), + ('10', '614', '2006-02-15T10:07:09'), + ('9', '148', '2006-02-15T10:07:09'), + ('10', '217', '2006-02-15T10:07:09'), + ('13', '937', '2006-02-15T10:07:09'), + ('6', '960', '2006-02-15T10:07:09'), + ('3', '873', '2006-02-15T10:07:09'), + ('2', '649', '2006-02-15T10:07:09'), + ('15', '667', '2006-02-15T10:07:09'), + ('14', '49', '2006-02-15T10:07:09'), + ('11', '222', '2006-02-15T10:07:09'), + ('2', '703', '2006-02-15T10:07:09'), + ('7', '272', '2006-02-15T10:07:09'), + ('15', '875', '2006-02-15T10:07:09'), + ('9', '845', '2006-02-15T10:07:09'), + ('3', '356', '2006-02-15T10:07:09'), + ('14', '165', '2006-02-15T10:07:09'), + ('5', '388', '2006-02-15T10:07:09'), + ('13', '948', '2006-02-15T10:07:09'), + ('13', '155', '2006-02-15T10:07:09'), + ('4', '116', '2006-02-15T10:07:09'), + ('11', '415', '2006-02-15T10:07:09'), + ('2', '18', '2006-02-15T10:07:09'), + ('16', '224', '2006-02-15T10:07:09'), + ('14', '625', '2006-02-15T10:07:09'), + ('14', '69', '2006-02-15T10:07:09'), + ('15', '361', '2006-02-15T10:07:09'), + ('4', '633', '2006-02-15T10:07:09'), + ('16', '977', '2006-02-15T10:07:09'), + ('2', '887', '2006-02-15T10:07:09'), + ('10', '211', '2006-02-15T10:07:09'), + ('3', '505', '2006-02-15T10:07:09'), + ('8', '534', '2006-02-15T10:07:09'), + ('11', '9', '2006-02-15T10:07:09'), + ('2', '314', '2006-02-15T10:07:09'), + ('14', '798', '2006-02-15T10:07:09'), + ('15', '517', '2006-02-15T10:07:09'), + ('3', '896', '2006-02-15T10:07:09'), + ('11', '334', '2006-02-15T10:07:09'), + ('5', '443', '2006-02-15T10:07:09'), + ('12', '284', '2006-02-15T10:07:09'), + ('1', '802', '2006-02-15T10:07:09'), + ('1', '126', '2006-02-15T10:07:09'), + ('13', '144', '2006-02-15T10:07:09'), + ('6', '466', '2006-02-15T10:07:09'), + ('1', '97', '2006-02-15T10:07:09'), + ('7', '107', '2006-02-15T10:07:09'), + ('2', '901', '2006-02-15T10:07:09'), + ('1', '850', '2006-02-15T10:07:09'), + ('1', '982', '2006-02-15T10:07:09'), + ('9', '821', '2006-02-15T10:07:09'), + ('5', '638', '2006-02-15T10:07:09'), + ('2', '582', '2006-02-15T10:07:09'), + ('15', '813', '2006-02-15T10:07:09'), + ('11', '665', '2006-02-15T10:07:09'), + ('9', '661', '2006-02-15T10:07:09'), + ('15', '420', '2006-02-15T10:07:09'), + ('11', '535', '2006-02-15T10:07:09'), + ('11', '876', '2006-02-15T10:07:09'), + ('9', '435', '2006-02-15T10:07:09'), + ('2', '692', '2006-02-15T10:07:09'), + ('8', '557', '2006-02-15T10:07:09'), + ('1', '229', '2006-02-15T10:07:09'), + ('15', '598', '2006-02-15T10:07:09'), + ('9', '452', '2006-02-15T10:07:09'), + ('11', '995', '2006-02-15T10:07:09'), + ('7', '771', '2006-02-15T10:07:09'), + ('11', '870', '2006-02-15T10:07:09'), + ('14', '235', '2006-02-15T10:07:09'), + ('16', '648', '2006-02-15T10:07:09'), + ('9', '290', '2006-02-15T10:07:09'), + ('9', '128', '2006-02-15T10:07:09'), + ('3', '491', '2006-02-15T10:07:09'), + ('4', '357', '2006-02-15T10:07:09'), + ('7', '772', '2006-02-15T10:07:09'), + ('1', '19', '2006-02-15T10:07:09'), + ('9', '947', '2006-02-15T10:07:09'), + ('14', '298', '2006-02-15T10:07:09'), + ('4', '899', '2006-02-15T10:07:09'), + ('12', '877', '2006-02-15T10:07:09'), + ('6', '58', '2006-02-15T10:07:09'), + ('6', '400', '2006-02-15T10:07:09') + ) AS data(old_category_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."category"' + AND map0.old_id = data.old_category_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_category" ("category_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('14', '73', '2006-02-15T10:07:09'), + ('8', '94', '2006-02-15T10:07:09'), + ('1', '329', '2006-02-15T10:07:09'), + ('4', '484', '2006-02-15T10:07:09'), + ('1', '579', '2006-02-15T10:07:09'), + ('2', '78', '2006-02-15T10:07:09'), + ('12', '161', '2006-02-15T10:07:09'), + ('15', '898', '2006-02-15T10:07:09'), + ('16', '601', '2006-02-15T10:07:09'), + ('11', '885', '2006-02-15T10:07:09'), + ('11', '92', '2006-02-15T10:07:09'), + ('14', '863', '2006-02-15T10:07:09'), + ('13', '920', '2006-02-15T10:07:09'), + ('14', '338', '2006-02-15T10:07:09'), + ('5', '522', '2006-02-15T10:07:09'), + ('15', '681', '2006-02-15T10:07:09'), + ('6', '650', '2006-02-15T10:07:09'), + ('9', '6', '2006-02-15T10:07:09'), + ('8', '345', '2006-02-15T10:07:09'), + ('1', '664', '2006-02-15T10:07:09'), + ('12', '767', '2006-02-15T10:07:09'), + ('6', '791', '2006-02-15T10:07:09'), + ('16', '872', '2006-02-15T10:07:09'), + ('7', '396', '2006-02-15T10:07:09'), + ('4', '432', '2006-02-15T10:07:09'), + ('9', '486', '2006-02-15T10:07:09'), + ('12', '592', '2006-02-15T10:07:09'), + ('1', '21', '2006-02-15T10:07:09'), + ('11', '122', '2006-02-15T10:07:09'), + ('13', '163', '2006-02-15T10:07:09'), + ('7', '709', '2006-02-15T10:07:09'), + ('13', '847', '2006-02-15T10:07:09'), + ('4', '744', '2006-02-15T10:07:09'), + ('8', '710', '2006-02-15T10:07:09'), + ('8', '866', '2006-02-15T10:07:09'), + ('11', '277', '2006-02-15T10:07:09'), + ('14', '967', '2006-02-15T10:07:09'), + ('5', '604', '2006-02-15T10:07:09'), + ('8', '80', '2006-02-15T10:07:09'), + ('12', '718', '2006-02-15T10:07:09'), + ('14', '972', '2006-02-15T10:07:09'), + ('10', '762', '2006-02-15T10:07:09'), + ('10', '742', '2006-02-15T10:07:09'), + ('3', '864', '2006-02-15T10:07:09'), + ('3', '409', '2006-02-15T10:07:09'), + ('2', '916', '2006-02-15T10:07:09'), + ('10', '949', '2006-02-15T10:07:09'), + ('7', '882', '2006-02-15T10:07:09'), + ('7', '683', '2006-02-15T10:07:09'), + ('13', '751', '2006-02-15T10:07:09'), + ('2', '193', '2006-02-15T10:07:09'), + ('7', '775', '2006-02-15T10:07:09'), + ('8', '975', '2006-02-15T10:07:09'), + ('5', '680', '2006-02-15T10:07:09'), + ('7', '204', '2006-02-15T10:07:09'), + ('1', '56', '2006-02-15T10:07:09'), + ('15', '102', '2006-02-15T10:07:09'), + ('9', '595', '2006-02-15T10:07:09'), + ('1', '991', '2006-02-15T10:07:09'), + ('13', '580', '2006-02-15T10:07:09'), + ('9', '100', '2006-02-15T10:07:09'), + ('13', '558', '2006-02-15T10:07:09'), + ('4', '725', '2006-02-15T10:07:09'), + ('5', '756', '2006-02-15T10:07:09'), + ('16', '342', '2006-02-15T10:07:09'), + ('2', '615', '2006-02-15T10:07:09'), + ('14', '312', '2006-02-15T10:07:09'), + ('9', '15', '2006-02-15T10:07:09'), + ('11', '494', '2006-02-15T10:07:09'), + ('7', '630', '2006-02-15T10:07:09'), + ('15', '27', '2006-02-15T10:07:09'), + ('7', '827', '2006-02-15T10:07:09'), + ('9', '565', '2006-02-15T10:07:09'), + ('10', '382', '2006-02-15T10:07:09'), + ('8', '231', '2006-02-15T10:07:09'), + ('6', '587', '2006-02-15T10:07:09'), + ('12', '581', '2006-02-15T10:07:09'), + ('14', '924', '2006-02-15T10:07:09'), + ('13', '720', '2006-02-15T10:07:09'), + ('8', '262', '2006-02-15T10:07:09'), + ('8', '946', '2006-02-15T10:07:09'), + ('4', '862', '2006-02-15T10:07:09'), + ('9', '900', '2006-02-15T10:07:09'), + ('8', '682', '2006-02-15T10:07:09'), + ('6', '708', '2006-02-15T10:07:09'), + ('5', '938', '2006-02-15T10:07:09'), + ('7', '758', '2006-02-15T10:07:09'), + ('5', '265', '2006-02-15T10:07:09'), + ('13', '685', '2006-02-15T10:07:09'), + ('11', '35', '2006-02-15T10:07:09'), + ('3', '392', '2006-02-15T10:07:09'), + ('11', '804', '2006-02-15T10:07:09'), + ('4', '815', '2006-02-15T10:07:09'), + ('1', '574', '2006-02-15T10:07:09'), + ('2', '430', '2006-02-15T10:07:09'), + ('12', '721', '2006-02-15T10:07:09'), + ('7', '706', '2006-02-15T10:07:09'), + ('2', '693', '2006-02-15T10:07:09'), + ('14', '39', '2006-02-15T10:07:09'), + ('4', '196', '2006-02-15T10:07:09') + ) AS data(old_category_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."category"' + AND map0.old_id = data.old_category_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_category" ("category_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('6', '855', '2006-02-15T10:07:09'), + ('7', '179', '2006-02-15T10:07:09'), + ('12', '255', '2006-02-15T10:07:09'), + ('8', '617', '2006-02-15T10:07:09'), + ('8', '634', '2006-02-15T10:07:09'), + ('8', '83', '2006-02-15T10:07:09'), + ('16', '783', '2006-02-15T10:07:09'), + ('5', '276', '2006-02-15T10:07:09'), + ('7', '282', '2006-02-15T10:07:09'), + ('16', '784', '2006-02-15T10:07:09'), + ('16', '405', '2006-02-15T10:07:09'), + ('3', '688', '2006-02-15T10:07:09'), + ('11', '506', '2006-02-15T10:07:09'), + ('10', '842', '2006-02-15T10:07:09'), + ('9', '353', '2006-02-15T10:07:09'), + ('5', '188', '2006-02-15T10:07:09'), + ('15', '187', '2006-02-15T10:07:09'), + ('6', '164', '2006-02-15T10:07:09'), + ('4', '249', '2006-02-15T10:07:09'), + ('11', '722', '2006-02-15T10:07:09'), + ('7', '618', '2006-02-15T10:07:09'), + ('15', '729', '2006-02-15T10:07:09'), + ('4', '874', '2006-02-15T10:07:09'), + ('14', '397', '2006-02-15T10:07:09'), + ('10', '408', '2006-02-15T10:07:09'), + ('10', '861', '2006-02-15T10:07:09'), + ('6', '576', '2006-02-15T10:07:09'), + ('16', '931', '2006-02-15T10:07:09'), + ('9', '112', '2006-02-15T10:07:09'), + ('16', '496', '2006-02-15T10:07:09'), + ('10', '941', '2006-02-15T10:07:09'), + ('11', '171', '2006-02-15T10:07:09'), + ('6', '101', '2006-02-15T10:07:09'), + ('14', '114', '2006-02-15T10:07:09'), + ('9', '957', '2006-02-15T10:07:09'), + ('5', '502', '2006-02-15T10:07:09'), + ('8', '5', '2006-02-15T10:07:09'), + ('12', '987', '2006-02-15T10:07:09'), + ('14', '723', '2006-02-15T10:07:09'), + ('15', '429', '2006-02-15T10:07:09'), + ('5', '978', '2006-02-15T10:07:09'), + ('5', '178', '2006-02-15T10:07:09'), + ('7', '907', '2006-02-15T10:07:09'), + ('11', '965', '2006-02-15T10:07:09'), + ('10', '556', '2006-02-15T10:07:09'), + ('3', '852', '2006-02-15T10:07:09'), + ('11', '600', '2006-02-15T10:07:09'), + ('11', '998', '2006-02-15T10:07:09'), + ('16', '123', '2006-02-15T10:07:09'), + ('16', '914', '2006-02-15T10:07:09'), + ('13', '45', '2006-02-15T10:07:09'), + ('6', '616', '2006-02-15T10:07:09'), + ('13', '675', '2006-02-15T10:07:09'), + ('11', '749', '2006-02-15T10:07:09'), + ('7', '521', '2006-02-15T10:07:09'), + ('3', '424', '2006-02-15T10:07:09'), + ('12', '636', '2006-02-15T10:07:09'), + ('12', '76', '2006-02-15T10:07:09'), + ('10', '406', '2006-02-15T10:07:09'), + ('9', '605', '2006-02-15T10:07:09'), + ('8', '639', '2006-02-15T10:07:09'), + ('9', '311', '2006-02-15T10:07:09'), + ('11', '495', '2006-02-15T10:07:09'), + ('11', '301', '2006-02-15T10:07:09'), + ('14', '572', '2006-02-15T10:07:09'), + ('6', '150', '2006-02-15T10:07:09'), + ('2', '36', '2006-02-15T10:07:09'), + ('16', '656', '2006-02-15T10:07:09'), + ('6', '629', '2006-02-15T10:07:09'), + ('13', '226', '2006-02-15T10:07:09'), + ('15', '389', '2006-02-15T10:07:09'), + ('6', '925', '2006-02-15T10:07:09'), + ('10', '747', '2006-02-15T10:07:09'), + ('13', '77', '2006-02-15T10:07:09'), + ('7', '662', '2006-02-15T10:07:09'), + ('3', '328', '2006-02-15T10:07:09'), + ('8', '183', '2006-02-15T10:07:09'), + ('9', '459', '2006-02-15T10:07:09'), + ('9', '11', '2006-02-15T10:07:09'), + ('3', '801', '2006-02-15T10:07:09'), + ('7', '143', '2006-02-15T10:07:09'), + ('12', '244', '2006-02-15T10:07:09'), + ('7', '958', '2006-02-15T10:07:09'), + ('3', '955', '2006-02-15T10:07:09'), + ('14', '367', '2006-02-15T10:07:09'), + ('1', '253', '2006-02-15T10:07:09'), + ('4', '445', '2006-02-15T10:07:09'), + ('3', '110', '2006-02-15T10:07:09'), + ('4', '166', '2006-02-15T10:07:09'), + ('1', '194', '2006-02-15T10:07:09'), + ('8', '377', '2006-02-15T10:07:09'), + ('10', '807', '2006-02-15T10:07:09'), + ('12', '74', '2006-02-15T10:07:09'), + ('6', '412', '2006-02-15T10:07:09'), + ('3', '423', '2006-02-15T10:07:09'), + ('7', '666', '2006-02-15T10:07:09'), + ('7', '79', '2006-02-15T10:07:09'), + ('2', '154', '2006-02-15T10:07:09'), + ('11', '904', '2006-02-15T10:07:09'), + ('1', '395', '2006-02-15T10:07:09') + ) AS data(old_category_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."category"' + AND map0.old_id = data.old_category_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_category" ("category_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('1', '530', '2006-02-15T10:07:09'), + ('3', '59', '2006-02-15T10:07:09'), + ('15', '691', '2006-02-15T10:07:09'), + ('5', '317', '2006-02-15T10:07:09'), + ('10', '596', '2006-02-15T10:07:09'), + ('8', '348', '2006-02-15T10:07:09'), + ('4', '60', '2006-02-15T10:07:09'), + ('8', '479', '2006-02-15T10:07:09'), + ('9', '908', '2006-02-15T10:07:09'), + ('5', '335', '2006-02-15T10:07:09'), + ('5', '774', '2006-02-15T10:07:09'), + ('1', '838', '2006-02-15T10:07:09'), + ('16', '294', '2006-02-15T10:07:09'), + ('6', '788', '2006-02-15T10:07:09'), + ('2', '880', '2006-02-15T10:07:09'), + ('16', '903', '2006-02-15T10:07:09'), + ('8', '700', '2006-02-15T10:07:09'), + ('15', '719', '2006-02-15T10:07:09'), + ('14', '153', '2006-02-15T10:07:09'), + ('14', '44', '2006-02-15T10:07:09'), + ('11', '922', '2006-02-15T10:07:09'), + ('1', '38', '2006-02-15T10:07:09'), + ('10', '746', '2006-02-15T10:07:09'), + ('11', '716', '2006-02-15T10:07:09'), + ('14', '714', '2006-02-15T10:07:09'), + ('6', '713', '2006-02-15T10:07:09'), + ('2', '349', '2006-02-15T10:07:09'), + ('8', '53', '2006-02-15T10:07:09'), + ('9', '640', '2006-02-15T10:07:09'), + ('6', '40', '2006-02-15T10:07:09'), + ('2', '245', '2006-02-15T10:07:09'), + ('10', '302', '2006-02-15T10:07:09'), + ('9', '104', '2006-02-15T10:07:09'), + ('9', '493', '2006-02-15T10:07:09'), + ('14', '203', '2006-02-15T10:07:09'), + ('12', '673', '2006-02-15T10:07:09'), + ('5', '837', '2006-02-15T10:07:09'), + ('7', '790', '2006-02-15T10:07:09'), + ('2', '268', '2006-02-15T10:07:09'), + ('14', '151', '2006-02-15T10:07:09'), + ('1', '927', '2006-02-15T10:07:09'), + ('6', '966', '2006-02-15T10:07:09'), + ('4', '652', '2006-02-15T10:07:09'), + ('14', '140', '2006-02-15T10:07:09'), + ('15', '764', '2006-02-15T10:07:09'), + ('10', '227', '2006-02-15T10:07:09'), + ('6', '1', '2006-02-15T10:07:09'), + ('5', '202', '2006-02-15T10:07:09'), + ('15', '577', '2006-02-15T10:07:09'), + ('12', '983', '2006-02-15T10:07:09'), + ('8', '437', '2006-02-15T10:07:09'), + ('3', '66', '2006-02-15T10:07:09'), + ('4', '469', '2006-02-15T10:07:09'), + ('15', '851', '2006-02-15T10:07:09'), + ('13', '465', '2006-02-15T10:07:09'), + ('6', '295', '2006-02-15T10:07:09'), + ('2', '489', '2006-02-15T10:07:09'), + ('2', '259', '2006-02-15T10:07:09'), + ('16', '41', '2006-02-15T10:07:09'), + ('3', '149', '2006-02-15T10:07:09'), + ('3', '515', '2006-02-15T10:07:09'), + ('7', '401', '2006-02-15T10:07:09'), + ('16', '518', '2006-02-15T10:07:09'), + ('13', '561', '2006-02-15T10:07:09'), + ('16', '386', '2006-02-15T10:07:09'), + ('14', '602', '2006-02-15T10:07:09'), + ('14', '285', '2006-02-15T10:07:09'), + ('5', '28', '2006-02-15T10:07:09'), + ('16', '811', '2006-02-15T10:07:09'), + ('11', '702', '2006-02-15T10:07:09'), + ('13', '759', '2006-02-15T10:07:09'), + ('4', '694', '2006-02-15T10:07:09'), + ('3', '344', '2006-02-15T10:07:09'), + ('4', '266', '2006-02-15T10:07:09'), + ('13', '490', '2006-02-15T10:07:09'), + ('9', '440', '2006-02-15T10:07:09'), + ('3', '883', '2006-02-15T10:07:09'), + ('1', '287', '2006-02-15T10:07:09'), + ('2', '953', '2006-02-15T10:07:09'), + ('15', '383', '2006-02-15T10:07:09'), + ('1', '717', '2006-02-15T10:07:09'), + ('1', '327', '2006-02-15T10:07:09'), + ('8', '359', '2006-02-15T10:07:09'), + ('15', '237', '2006-02-15T10:07:09'), + ('2', '325', '2006-02-15T10:07:09'), + ('9', '971', '2006-02-15T10:07:09'), + ('8', '391', '2006-02-15T10:07:09'), + ('15', '263', '2006-02-15T10:07:09'), + ('16', '57', '2006-02-15T10:07:09'), + ('16', '785', '2006-02-15T10:07:09'), + ('1', '130', '2006-02-15T10:07:09'), + ('13', '750', '2006-02-15T10:07:09'), + ('10', '46', '2006-02-15T10:07:09'), + ('1', '375', '2006-02-15T10:07:09'), + ('4', '548', '2006-02-15T10:07:09'), + ('1', '911', '2006-02-15T10:07:09'), + ('9', '567', '2006-02-15T10:07:09'), + ('6', '627', '2006-02-15T10:07:09'), + ('4', '482', '2006-02-15T10:07:09'), + ('8', '476', '2006-02-15T10:07:09') + ) AS data(old_category_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."category"' + AND map0.old_id = data.old_category_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_category" ("category_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('5', '404', '2006-02-15T10:07:09'), + ('5', '906', '2006-02-15T10:07:09'), + ('2', '859', '2006-02-15T10:07:09'), + ('9', '674', '2006-02-15T10:07:09'), + ('15', '10', '2006-02-15T10:07:09'), + ('13', '481', '2006-02-15T10:07:09'), + ('7', '418', '2006-02-15T10:07:09'), + ('2', '300', '2006-02-15T10:07:09'), + ('15', '836', '2006-02-15T10:07:09'), + ('11', '881', '2006-02-15T10:07:09'), + ('4', '611', '2006-02-15T10:07:09'), + ('9', '455', '2006-02-15T10:07:09'), + ('1', '542', '2006-02-15T10:07:09'), + ('13', '933', '2006-02-15T10:07:09'), + ('3', '918', '2006-02-15T10:07:09'), + ('4', '37', '2006-02-15T10:07:09'), + ('2', '569', '2006-02-15T10:07:09'), + ('6', '712', '2006-02-15T10:07:09'), + ('8', '273', '2006-02-15T10:07:09'), + ('15', '671', '2006-02-15T10:07:09'), + ('10', '281', '2006-02-15T10:07:09'), + ('7', '910', '2006-02-15T10:07:09'), + ('13', '538', '2006-02-15T10:07:09'), + ('16', '84', '2006-02-15T10:07:09'), + ('4', '297', '2006-02-15T10:07:09'), + ('15', '256', '2006-02-15T10:07:09'), + ('8', '695', '2006-02-15T10:07:09'), + ('9', '467', '2006-02-15T10:07:09'), + ('12', '426', '2006-02-15T10:07:09'), + ('16', '472', '2006-02-15T10:07:09'), + ('11', '856', '2006-02-15T10:07:09'), + ('16', '288', '2006-02-15T10:07:09'), + ('13', '954', '2006-02-15T10:07:09'), + ('3', '833', '2006-02-15T10:07:09'), + ('11', '990', '2006-02-15T10:07:09'), + ('7', '942', '2006-02-15T10:07:09'), + ('11', '854', '2006-02-15T10:07:09'), + ('15', '631', '2006-02-15T10:07:09'), + ('16', '125', '2006-02-15T10:07:09'), + ('11', '30', '2006-02-15T10:07:09'), + ('2', '816', '2006-02-15T10:07:09'), + ('15', '135', '2006-02-15T10:07:09'), + ('15', '474', '2006-02-15T10:07:09'), + ('3', '485', '2006-02-15T10:07:09'), + ('8', '50', '2006-02-15T10:07:09'), + ('6', '552', '2006-02-15T10:07:09'), + ('13', '216', '2006-02-15T10:07:09'), + ('9', '246', '2006-02-15T10:07:09'), + ('7', '403', '2006-02-15T10:07:09'), + ('7', '173', '2006-02-15T10:07:09'), + ('15', '773', '2006-02-15T10:07:09'), + ('15', '503', '2006-02-15T10:07:09'), + ('8', '309', '2006-02-15T10:07:09'), + ('3', '928', '2006-02-15T10:07:09'), + ('8', '315', '2006-02-15T10:07:09'), + ('10', '684', '2006-02-15T10:07:09'), + ('14', '422', '2006-02-15T10:07:09'), + ('13', '93', '2006-02-15T10:07:09'), + ('3', '354', '2006-02-15T10:07:09'), + ('6', '996', '2006-02-15T10:07:09'), + ('14', '711', '2006-02-15T10:07:09'), + ('3', '124', '2006-02-15T10:07:09'), + ('6', '206', '2006-02-15T10:07:09'), + ('15', '323', '2006-02-15T10:07:09'), + ('15', '453', '2006-02-15T10:07:09'), + ('15', '279', '2006-02-15T10:07:09'), + ('1', '748', '2006-02-15T10:07:09'), + ('5', '1000', '2006-02-15T10:07:09'), + ('14', '893', '2006-02-15T10:07:09'), + ('8', '428', '2006-02-15T10:07:09'), + ('4', '970', '2006-02-15T10:07:09'), + ('6', '544', '2006-02-15T10:07:09'), + ('3', '238', '2006-02-15T10:07:09'), + ('6', '589', '2006-02-15T10:07:09'), + ('8', '498', '2006-02-15T10:07:09'), + ('6', '62', '2006-02-15T10:07:09'), + ('8', '145', '2006-02-15T10:07:09'), + ('9', '192', '2006-02-15T10:07:09'), + ('4', '537', '2006-02-15T10:07:09'), + ('16', '286', '2006-02-15T10:07:09'), + ('7', '33', '2006-02-15T10:07:09'), + ('4', '180', '2006-02-15T10:07:09'), + ('1', '968', '2006-02-15T10:07:09'), + ('15', '197', '2006-02-15T10:07:09'), + ('2', '849', '2006-02-15T10:07:09'), + ('13', '321', '2006-02-15T10:07:09'), + ('10', '840', '2006-02-15T10:07:09'), + ('13', '22', '2006-02-15T10:07:09'), + ('4', '536', '2006-02-15T10:07:09'), + ('6', '393', '2006-02-15T10:07:09'), + ('5', '159', '2006-02-15T10:07:09'), + ('3', '280', '2006-02-15T10:07:09'), + ('16', '103', '2006-02-15T10:07:09'), + ('12', '477', '2006-02-15T10:07:09'), + ('1', '303', '2006-02-15T10:07:09'), + ('9', '416', '2006-02-15T10:07:09'), + ('11', '800', '2006-02-15T10:07:09'), + ('9', '545', '2006-02-15T10:07:09'), + ('11', '351', '2006-02-15T10:07:09'), + ('7', '366', '2006-02-15T10:07:09') + ) AS data(old_category_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."category"' + AND map0.old_id = data.old_category_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + INSERT INTO "public"."film_category" ("category_id", "film_id", "last_update") + SELECT + map0.new_id::smallint, + map1.new_id::smallint, + data.last_update::timestamp without time zone + FROM (VALUES + ('12', '997', '2006-02-15T10:07:09'), + ('8', '175', '2006-02-15T10:07:09'), + ('8', '550', '2006-02-15T10:07:09'), + ('12', '54', '2006-02-15T10:07:09'), + ('16', '88', '2006-02-15T10:07:09'), + ('8', '213', '2006-02-15T10:07:09'), + ('15', '678', '2006-02-15T10:07:09'), + ('16', '339', '2006-02-15T10:07:09'), + ('2', '986', '2006-02-15T10:07:09'), + ('10', '701', '2006-02-15T10:07:09'), + ('8', '499', '2006-02-15T10:07:09'), + ('15', '782', '2006-02-15T10:07:09'), + ('1', '252', '2006-02-15T10:07:09'), + ('14', '985', '2006-02-15T10:07:09'), + ('2', '433', '2006-02-15T10:07:09'), + ('6', '776', '2006-02-15T10:07:09'), + ('13', '267', '2006-02-15T10:07:09'), + ('7', '218', '2006-02-15T10:07:09'), + ('2', '510', '2006-02-15T10:07:09'), + ('3', '214', '2006-02-15T10:07:09'), + ('7', '368', '2006-02-15T10:07:09'), + ('16', '513', '2006-02-15T10:07:09'), + ('1', '707', '2006-02-15T10:07:09'), + ('7', '379', '2006-02-15T10:07:09'), + ('6', '441', '2006-02-15T10:07:09'), + ('9', '738', '2006-02-15T10:07:09'), + ('10', '447', '2006-02-15T10:07:09'), + ('16', '299', '2006-02-15T10:07:09'), + ('14', '132', '2006-02-15T10:07:09'), + ('6', '407', '2006-02-15T10:07:09'), + ('12', '51', '2006-02-15T10:07:09'), + ('12', '20', '2006-02-15T10:07:09'), + ('4', '525', '2006-02-15T10:07:09'), + ('4', '828', '2006-02-15T10:07:09'), + ('10', '560', '2006-02-15T10:07:09'), + ('3', '157', '2006-02-15T10:07:09'), + ('14', '195', '2006-02-15T10:07:09'), + ('16', '434', '2006-02-15T10:07:09'), + ('2', '208', '2006-02-15T10:07:09'), + ('15', '628', '2006-02-15T10:07:09'), + ('14', '559', '2006-02-15T10:07:09'), + ('3', '573', '2006-02-15T10:07:09'), + ('14', '319', '2006-02-15T10:07:09'), + ('5', '660', '2006-02-15T10:07:09'), + ('6', '156', '2006-02-15T10:07:09'), + ('1', '417', '2006-02-15T10:07:09'), + ('16', '848', '2006-02-15T10:07:09'), + ('7', '739', '2006-02-15T10:07:09'), + ('5', '324', '2006-02-15T10:07:09'), + ('16', '181', '2006-02-15T10:07:09'), + ('10', '438', '2006-02-15T10:07:09'), + ('9', '584', '2006-02-15T10:07:09'), + ('11', '13', '2006-02-15T10:07:09'), + ('5', '765', '2006-02-15T10:07:09'), + ('11', '475', '2006-02-15T10:07:09'), + ('13', '913', '2006-02-15T10:07:09'), + ('14', '831', '2006-02-15T10:07:09'), + ('1', '210', '2006-02-15T10:07:09'), + ('5', '657', '2006-02-15T10:07:09'), + ('13', '935', '2006-02-15T10:07:09'), + ('13', '320', '2006-02-15T10:07:09'), + ('10', '646', '2006-02-15T10:07:09'), + ('2', '241', '2006-02-15T10:07:09'), + ('9', '533', '2006-02-15T10:07:09'), + ('5', '529', '2006-02-15T10:07:09'), + ('14', '240', '2006-02-15T10:07:09'), + ('15', '676', '2006-02-15T10:07:09'), + ('12', '884', '2006-02-15T10:07:09'), + ('5', '857', '2006-02-15T10:07:09'), + ('5', '127', '2006-02-15T10:07:09'), + ('1', '964', '2006-02-15T10:07:09'), + ('2', '696', '2006-02-15T10:07:09'), + ('9', '929', '2006-02-15T10:07:09'), + ('15', '902', '2006-02-15T10:07:09'), + ('9', '705', '2006-02-15T10:07:09'), + ('4', '425', '2006-02-15T10:07:09'), + ('7', '539', '2006-02-15T10:07:09'), + ('10', '591', '2006-02-15T10:07:09'), + ('13', '448', '2006-02-15T10:07:09'), + ('12', '540', '2006-02-15T10:07:09'), + ('12', '384', '2006-02-15T10:07:09'), + ('13', '289', '2006-02-15T10:07:09'), + ('7', '439', '2006-02-15T10:07:09'), + ('3', '191', '2006-02-15T10:07:09'), + ('13', '96', '2006-02-15T10:07:09'), + ('3', '304', '2006-02-15T10:07:09'), + ('9', '376', '2006-02-15T10:07:09'), + ('12', '936', '2006-02-15T10:07:09'), + ('11', '4', '2006-02-15T10:07:09'), + ('9', '984', '2006-02-15T10:07:09'), + ('6', '497', '2006-02-15T10:07:09'), + ('15', '777', '2006-02-15T10:07:09'), + ('12', '220', '2006-02-15T10:07:09'), + ('13', '994', '2006-02-15T10:07:09'), + ('9', '185', '2006-02-15T10:07:09'), + ('7', '172', '2006-02-15T10:07:09'), + ('3', '547', '2006-02-15T10:07:09'), + ('10', '835', '2006-02-15T10:07:09'), + ('1', '594', '2006-02-15T10:07:09'), + ('12', '133', '2006-02-15T10:07:09') + ) AS data(old_category_id, old_film_id, last_update) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."category"' + AND map0.old_id = data.old_category_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."film"' + AND map1.old_id = data.old_film_id; + + -- Table: "public"."customer" (599 records) + v_old_ids_customer := ARRAY['340', '520', '523', '199', '472', '532', '579', '497', '477', '556', '85', '512', '252', '142', '583', '16', '491', '559', '233', '423', '134', '119', '65', '464', '515', '45', '9', '498', '535', '452', '292', '98', '394', '52', '469', '293', '549', '597', '565', '304', '122', '234', '480', '172', '124', '143', '278', '566', '483', '366', '164', '13', '204', '518', '493', '507', '327', '38', '539', '453', '111', '568', '113', '290', '174', '282', '360', '553', '7', '562', '18', '280', '250', '277', '286', '156', '284', '409', '103', '198', '80', '232', '26', '220', '190', '481', '592', '180', '490', '120', '460', '87', '235', '317', '347', '23', '584', '408', '66', '223']; + WITH inserted AS ( + INSERT INTO "public"."customer" ("active", "activebool", "address_id", "create_date", "email", "first_name", "last_name", "last_update", "store_id") + SELECT + data.active::integer, + data.activebool::boolean, + map0.new_id::smallint, + data.create_date::date, + data.email::character varying, + data.first_name::character varying, + data.last_name::character varying, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + (1, TRUE, '345', '2006-02-14', 'patrick.newsom@sakilacustomer.org', 'Patrick', 'Newsom', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '526', '2006-02-14', 'mitchell.westmoreland@sakilacustomer.org', 'Mitchell', 'Westmoreland', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '529', '2006-02-14', 'harvey.guajardo@sakilacustomer.org', 'Harvey', 'Guajardo', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '203', '2006-02-14', 'beth.franklin@sakilacustomer.org', 'Beth', 'Franklin', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '477', '2006-02-14', 'greg.robins@sakilacustomer.org', 'Greg', 'Robins', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '538', '2006-02-14', 'neil.renner@sakilacustomer.org', 'Neil', 'Renner', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '585', '2006-02-14', 'daryl.larue@sakilacustomer.org', 'Daryl', 'Larue', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '502', '2006-02-14', 'gilbert.sledge@sakilacustomer.org', 'Gilbert', 'Sledge', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '482', '2006-02-14', 'dan.paine@sakilacustomer.org', 'Dan', 'Paine', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '562', '2006-02-14', 'armando.gruber@sakilacustomer.org', 'Armando', 'Gruber', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '89', '2006-02-14', 'anne.powell@sakilacustomer.org', 'Anne', 'Powell', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '517', '2006-02-14', 'cecil.vines@sakilacustomer.org', 'Cecil', 'Vines', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '256', '2006-02-14', 'mattie.hoffman@sakilacustomer.org', 'Mattie', 'Hoffman', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '146', '2006-02-14', 'april.burns@sakilacustomer.org', 'April', 'Burns', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '589', '2006-02-14', 'marshall.thorn@sakilacustomer.org', 'Marshall', 'Thorn', '2013-05-26T14:49:45.738000', 1), + (0, TRUE, '20', '2006-02-14', 'sandra.martin@sakilacustomer.org', 'Sandra', 'Martin', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '496', '2006-02-14', 'rick.mattox@sakilacustomer.org', 'Rick', 'Mattox', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '565', '2006-02-14', 'everett.banda@sakilacustomer.org', 'Everett', 'Banda', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '237', '2006-02-14', 'lillie.kim@sakilacustomer.org', 'Lillie', 'Kim', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '428', '2006-02-14', 'alfred.casillas@sakilacustomer.org', 'Alfred', 'Casillas', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '138', '2006-02-14', 'emma.boyd@sakilacustomer.org', 'Emma', 'Boyd', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '123', '2006-02-14', 'sherry.marshall@sakilacustomer.org', 'Sherry', 'Marshall', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '69', '2006-02-14', 'rose.howard@sakilacustomer.org', 'Rose', 'Howard', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '469', '2006-02-14', 'jerome.kenyon@sakilacustomer.org', 'Jerome', 'Kenyon', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '521', '2006-02-14', 'andre.rapp@sakilacustomer.org', 'Andre', 'Rapp', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '49', '2006-02-14', 'janet.phillips@sakilacustomer.org', 'Janet', 'Phillips', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '13', '2006-02-14', 'margaret.moore@sakilacustomer.org', 'Margaret', 'Moore', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '503', '2006-02-14', 'gene.sanborn@sakilacustomer.org', 'Gene', 'Sanborn', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '541', '2006-02-14', 'javier.elrod@sakilacustomer.org', 'Javier', 'Elrod', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '457', '2006-02-14', 'tom.milner@sakilacustomer.org', 'Tom', 'Milner', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '297', '2006-02-14', 'misty.lambert@sakilacustomer.org', 'Misty', 'Lambert', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '102', '2006-02-14', 'lillian.griffin@sakilacustomer.org', 'Lillian', 'Griffin', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '399', '2006-02-14', 'chris.brothers@sakilacustomer.org', 'Chris', 'Brothers', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '56', '2006-02-14', 'julie.sanchez@sakilacustomer.org', 'Julie', 'Sanchez', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '474', '2006-02-14', 'wesley.bull@sakilacustomer.org', 'Wesley', 'Bull', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '298', '2006-02-14', 'mae.fletcher@sakilacustomer.org', 'Mae', 'Fletcher', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '555', '2006-02-14', 'nelson.christenson@sakilacustomer.org', 'Nelson', 'Christenson', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '603', '2006-02-14', 'freddie.duggan@sakilacustomer.org', 'Freddie', 'Duggan', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '571', '2006-02-14', 'jaime.nettles@sakilacustomer.org', 'Jaime', 'Nettles', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '309', '2006-02-14', 'david.royal@sakilacustomer.org', 'David', 'Royal', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '126', '2006-02-14', 'thelma.murray@sakilacustomer.org', 'Thelma', 'Murray', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '238', '2006-02-14', 'claudia.fuller@sakilacustomer.org', 'Claudia', 'Fuller', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '485', '2006-02-14', 'corey.hauser@sakilacustomer.org', 'Corey', 'Hauser', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '176', '2006-02-14', 'bernice.willis@sakilacustomer.org', 'Bernice', 'Willis', '2013-05-26T14:49:45.738000', 1), + (0, TRUE, '128', '2006-02-14', 'sheila.wells@sakilacustomer.org', 'Sheila', 'Wells', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '147', '2006-02-14', 'leslie.gordon@sakilacustomer.org', 'Leslie', 'Gordon', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '283', '2006-02-14', 'billie.horton@sakilacustomer.org', 'Billie', 'Horton', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '572', '2006-02-14', 'casey.mena@sakilacustomer.org', 'Casey', 'Mena', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '488', '2006-02-14', 'vernon.chapa@sakilacustomer.org', 'Vernon', 'Chapa', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '371', '2006-02-14', 'brandon.huey@sakilacustomer.org', 'Brandon', 'Huey', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '168', '2006-02-14', 'joann.gardner@sakilacustomer.org', 'Joann', 'Gardner', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '17', '2006-02-14', 'karen.jackson@sakilacustomer.org', 'Karen', 'Jackson', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '208', '2006-02-14', 'rosemary.schmidt@sakilacustomer.org', 'Rosemary', 'Schmidt', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '524', '2006-02-14', 'gabriel.harder@sakilacustomer.org', 'Gabriel', 'Harder', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '498', '2006-02-14', 'brent.harkins@sakilacustomer.org', 'Brent', 'Harkins', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '512', '2006-02-14', 'edgar.rhoads@sakilacustomer.org', 'Edgar', 'Rhoads', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '332', '2006-02-14', 'larry.thrasher@sakilacustomer.org', 'Larry', 'Thrasher', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '42', '2006-02-14', 'martha.gonzalez@sakilacustomer.org', 'Martha', 'Gonzalez', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '545', '2006-02-14', 'mathew.bolin@sakilacustomer.org', 'Mathew', 'Bolin', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '458', '2006-02-14', 'calvin.martel@sakilacustomer.org', 'Calvin', 'Martel', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '115', '2006-02-14', 'carmen.owens@sakilacustomer.org', 'Carmen', 'Owens', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '574', '2006-02-14', 'alberto.henning@sakilacustomer.org', 'Alberto', 'Henning', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '117', '2006-02-14', 'cindy.fisher@sakilacustomer.org', 'Cindy', 'Fisher', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '295', '2006-02-14', 'kristina.chambers@sakilacustomer.org', 'Kristina', 'Chambers', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '178', '2006-02-14', 'yvonne.watkins@sakilacustomer.org', 'Yvonne', 'Watkins', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '287', '2006-02-14', 'jenny.castro@sakilacustomer.org', 'Jenny', 'Castro', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '365', '2006-02-14', 'ralph.madrigal@sakilacustomer.org', 'Ralph', 'Madrigal', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '559', '2006-02-14', 'max.pitt@sakilacustomer.org', 'Max', 'Pitt', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '11', '2006-02-14', 'maria.miller@sakilacustomer.org', 'Maria', 'Miller', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '568', '2006-02-14', 'wallace.slone@sakilacustomer.org', 'Wallace', 'Slone', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '22', '2006-02-14', 'carol.garcia@sakilacustomer.org', 'Carol', 'Garcia', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '285', '2006-02-14', 'tracey.barrett@sakilacustomer.org', 'Tracey', 'Barrett', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '254', '2006-02-14', 'jo.fowler@sakilacustomer.org', 'Jo', 'Fowler', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '282', '2006-02-14', 'olga.jimenez@sakilacustomer.org', 'Olga', 'Jimenez', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '291', '2006-02-14', 'velma.lucas@sakilacustomer.org', 'Velma', 'Lucas', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '160', '2006-02-14', 'bertha.ferguson@sakilacustomer.org', 'Bertha', 'Ferguson', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '289', '2006-02-14', 'sonia.gregory@sakilacustomer.org', 'Sonia', 'Gregory', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '414', '2006-02-14', 'rodney.moeller@sakilacustomer.org', 'Rodney', 'Moeller', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '107', '2006-02-14', 'gladys.hamilton@sakilacustomer.org', 'Gladys', 'Hamilton', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '202', '2006-02-14', 'elsie.kelley@sakilacustomer.org', 'Elsie', 'Kelley', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '84', '2006-02-14', 'marilyn.ross@sakilacustomer.org', 'Marilyn', 'Ross', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '236', '2006-02-14', 'constance.reid@sakilacustomer.org', 'Constance', 'Reid', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '30', '2006-02-14', 'jessica.hall@sakilacustomer.org', 'Jessica', 'Hall', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '224', '2006-02-14', 'charlene.alvarez@sakilacustomer.org', 'Charlene', 'Alvarez', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '194', '2006-02-14', 'yolanda.weaver@sakilacustomer.org', 'Yolanda', 'Weaver', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '486', '2006-02-14', 'herman.devore@sakilacustomer.org', 'Herman', 'Devore', '2013-05-26T14:49:45.738000', 1), + (0, TRUE, '598', '2006-02-14', 'terrance.roush@sakilacustomer.org', 'Terrance', 'Roush', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '184', '2006-02-14', 'stacy.cunningham@sakilacustomer.org', 'Stacy', 'Cunningham', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '495', '2006-02-14', 'sam.mcduffie@sakilacustomer.org', 'Sam', 'Mcduffie', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '124', '2006-02-14', 'sylvia.ortiz@sakilacustomer.org', 'Sylvia', 'Ortiz', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '465', '2006-02-14', 'leon.bostic@sakilacustomer.org', 'Leon', 'Bostic', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '91', '2006-02-14', 'wanda.patterson@sakilacustomer.org', 'Wanda', 'Patterson', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '239', '2006-02-14', 'jackie.lynch@sakilacustomer.org', 'Jackie', 'Lynch', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '322', '2006-02-14', 'edward.baugh@sakilacustomer.org', 'Edward', 'Baugh', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '352', '2006-02-14', 'ryan.salisbury@sakilacustomer.org', 'Ryan', 'Salisbury', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '27', '2006-02-14', 'sarah.lewis@sakilacustomer.org', 'Sarah', 'Lewis', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '590', '2006-02-14', 'salvador.teel@sakilacustomer.org', 'Salvador', 'Teel', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '413', '2006-02-14', 'manuel.murrell@sakilacustomer.org', 'Manuel', 'Murrell', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '70', '2006-02-14', 'janice.ward@sakilacustomer.org', 'Janice', 'Ward', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '227', '2006-02-14', 'melinda.fernandez@sakilacustomer.org', 'Melinda', 'Fernandez', '2013-05-26T14:49:45.738000', 1) + ) AS data(active, activebool, old_address_id, create_date, email, first_name, last_name, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."address"' + AND map0.old_id = data.old_address_id + RETURNING customer_id + ) + SELECT array_agg(customer_id) INTO v_new_ids_customer FROM inserted; + + FOR i IN 1..array_length(v_new_ids_customer, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."customer"', v_old_ids_customer[i], v_new_ids_customer[i]::TEXT); + END LOOP; + + v_old_ids_customer := ARRAY['399', '25', '416', '20', '383', '528', '155', '598', '61', '587', '319', '454', '451', '575', '488', '570', '578', '482', '353', '133', '343', '115', '582', '108', '425', '581', '369', '84', '323', '465', '364', '247', '414', '150', '273', '288', '486', '467', '177', '230', '563', '444', '320', '459', '449', '368', '10', '36', '185', '279', '377', '265', '41', '321', '22', '543', '40', '49', '101', '70', '417', '312', '104', '402', '162', '35', '57', '540', '215', '352', '361', '527', '144', '91', '392', '326', '345', '226', '205', '576', '75', '348', '586', '30', '517', '139', '5', '73', '577', '585', '24', '405', '107', '530', '359', '445', '331', '322', '243', '560']; + WITH inserted AS ( + INSERT INTO "public"."customer" ("active", "activebool", "address_id", "create_date", "email", "first_name", "last_name", "last_update", "store_id") + SELECT + data.active::integer, + data.activebool::boolean, + map0.new_id::smallint, + data.create_date::date, + data.email::character varying, + data.first_name::character varying, + data.last_name::character varying, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + (1, TRUE, '404', '2006-02-14', 'danny.isom@sakilacustomer.org', 'Danny', 'Isom', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '29', '2006-02-14', 'deborah.walker@sakilacustomer.org', 'Deborah', 'Walker', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '421', '2006-02-14', 'jeffery.pinson@sakilacustomer.org', 'Jeffery', 'Pinson', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '24', '2006-02-14', 'sharon.robinson@sakilacustomer.org', 'Sharon', 'Robinson', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '388', '2006-02-14', 'martin.bales@sakilacustomer.org', 'Martin', 'Bales', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '534', '2006-02-14', 'claude.herzog@sakilacustomer.org', 'Claude', 'Herzog', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '159', '2006-02-14', 'gail.knight@sakilacustomer.org', 'Gail', 'Knight', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '604', '2006-02-14', 'wade.delvalle@sakilacustomer.org', 'Wade', 'Delvalle', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '65', '2006-02-14', 'katherine.rivera@sakilacustomer.org', 'Katherine', 'Rivera', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '593', '2006-02-14', 'sergio.stanfield@sakilacustomer.org', 'Sergio', 'Stanfield', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '324', '2006-02-14', 'ronald.weiner@sakilacustomer.org', 'Ronald', 'Weiner', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '459', '2006-02-14', 'alex.gresham@sakilacustomer.org', 'Alex', 'Gresham', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '456', '2006-02-14', 'jim.rea@sakilacustomer.org', 'Jim', 'Rea', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '581', '2006-02-14', 'isaac.oglesby@sakilacustomer.org', 'Isaac', 'Oglesby', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '493', '2006-02-14', 'shane.millard@sakilacustomer.org', 'Shane', 'Millard', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '576', '2006-02-14', 'ivan.cromwell@sakilacustomer.org', 'Ivan', 'Cromwell', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '584', '2006-02-14', 'willard.lumpkin@sakilacustomer.org', 'Willard', 'Lumpkin', '2013-05-26T14:49:45.738000', 2), + (0, TRUE, '487', '2006-02-14', 'maurice.crawley@sakilacustomer.org', 'Maurice', 'Crawley', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '358', '2006-02-14', 'jonathan.scarborough@sakilacustomer.org', 'Jonathan', 'Scarborough', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '137', '2006-02-14', 'pauline.henry@sakilacustomer.org', 'Pauline', 'Henry', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '348', '2006-02-14', 'douglas.graf@sakilacustomer.org', 'Douglas', 'Graf', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '119', '2006-02-14', 'wendy.harrison@sakilacustomer.org', 'Wendy', 'Harrison', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '588', '2006-02-14', 'andy.vanhorn@sakilacustomer.org', 'Andy', 'Vanhorn', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '112', '2006-02-14', 'tracy.cole@sakilacustomer.org', 'Tracy', 'Cole', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '430', '2006-02-14', 'francis.sikes@sakilacustomer.org', 'Francis', 'Sikes', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '587', '2006-02-14', 'virgil.wofford@sakilacustomer.org', 'Virgil', 'Wofford', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '374', '2006-02-14', 'fred.wheat@sakilacustomer.org', 'Fred', 'Wheat', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '88', '2006-02-14', 'sara.perry@sakilacustomer.org', 'Sara', 'Perry', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '328', '2006-02-14', 'matthew.mahan@sakilacustomer.org', 'Matthew', 'Mahan', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '470', '2006-02-14', 'floyd.gandy@sakilacustomer.org', 'Floyd', 'Gandy', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '369', '2006-02-14', 'benjamin.varney@sakilacustomer.org', 'Benjamin', 'Varney', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '251', '2006-02-14', 'stella.moreno@sakilacustomer.org', 'Stella', 'Moreno', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '419', '2006-02-14', 'vincent.ralston@sakilacustomer.org', 'Vincent', 'Ralston', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '154', '2006-02-14', 'danielle.daniels@sakilacustomer.org', 'Danielle', 'Daniels', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '278', '2006-02-14', 'priscilla.lowe@sakilacustomer.org', 'Priscilla', 'Lowe', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '293', '2006-02-14', 'bobbie.craig@sakilacustomer.org', 'Bobbie', 'Craig', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '491', '2006-02-14', 'glen.talbert@sakilacustomer.org', 'Glen', 'Talbert', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '472', '2006-02-14', 'alvin.deloach@sakilacustomer.org', 'Alvin', 'Deloach', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '181', '2006-02-14', 'samantha.duncan@sakilacustomer.org', 'Samantha', 'Duncan', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '234', '2006-02-14', 'joy.george@sakilacustomer.org', 'Joy', 'George', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '569', '2006-02-14', 'ken.prewitt@sakilacustomer.org', 'Ken', 'Prewitt', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '449', '2006-02-14', 'marcus.hidalgo@sakilacustomer.org', 'Marcus', 'Hidalgo', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '325', '2006-02-14', 'anthony.schwab@sakilacustomer.org', 'Anthony', 'Schwab', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '464', '2006-02-14', 'tommy.collazo@sakilacustomer.org', 'Tommy', 'Collazo', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '454', '2006-02-14', 'oscar.aquino@sakilacustomer.org', 'Oscar', 'Aquino', '2013-05-26T14:49:45.738000', 2), + (0, TRUE, '373', '2006-02-14', 'harry.arce@sakilacustomer.org', 'Harry', 'Arce', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '14', '2006-02-14', 'dorothy.taylor@sakilacustomer.org', 'Dorothy', 'Taylor', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '40', '2006-02-14', 'kathleen.adams@sakilacustomer.org', 'Kathleen', 'Adams', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '189', '2006-02-14', 'roberta.harper@sakilacustomer.org', 'Roberta', 'Harper', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '284', '2006-02-14', 'dianne.shelton@sakilacustomer.org', 'Dianne', 'Shelton', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '382', '2006-02-14', 'howard.fortner@sakilacustomer.org', 'Howard', 'Fortner', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '270', '2006-02-14', 'jennie.terry@sakilacustomer.org', 'Jennie', 'Terry', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '45', '2006-02-14', 'stephanie.mitchell@sakilacustomer.org', 'Stephanie', 'Mitchell', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '326', '2006-02-14', 'kevin.schuler@sakilacustomer.org', 'Kevin', 'Schuler', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '26', '2006-02-14', 'laura.rodriguez@sakilacustomer.org', 'Laura', 'Rodriguez', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '549', '2006-02-14', 'lance.pemberton@sakilacustomer.org', 'Lance', 'Pemberton', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '44', '2006-02-14', 'amanda.carter@sakilacustomer.org', 'Amanda', 'Carter', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '53', '2006-02-14', 'joyce.edwards@sakilacustomer.org', 'Joyce', 'Edwards', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '105', '2006-02-14', 'peggy.myers@sakilacustomer.org', 'Peggy', 'Myers', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '74', '2006-02-14', 'christina.ramirez@sakilacustomer.org', 'Christina', 'Ramirez', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '422', '2006-02-14', 'travis.estep@sakilacustomer.org', 'Travis', 'Estep', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '317', '2006-02-14', 'mark.rinehart@sakilacustomer.org', 'Mark', 'Rinehart', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '108', '2006-02-14', 'rita.graham@sakilacustomer.org', 'Rita', 'Graham', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '407', '2006-02-14', 'luis.yanez@sakilacustomer.org', 'Luis', 'Yanez', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '166', '2006-02-14', 'lauren.hudson@sakilacustomer.org', 'Lauren', 'Hudson', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '39', '2006-02-14', 'virginia.green@sakilacustomer.org', 'Virginia', 'Green', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '61', '2006-02-14', 'evelyn.morgan@sakilacustomer.org', 'Evelyn', 'Morgan', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '546', '2006-02-14', 'tyrone.asher@sakilacustomer.org', 'Tyrone', 'Asher', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '219', '2006-02-14', 'jessie.banks@sakilacustomer.org', 'Jessie', 'Banks', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '357', '2006-02-14', 'albert.crouse@sakilacustomer.org', 'Albert', 'Crouse', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '366', '2006-02-14', 'lawrence.lawton@sakilacustomer.org', 'Lawrence', 'Lawton', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '533', '2006-02-14', 'cory.meehan@sakilacustomer.org', 'Cory', 'Meehan', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '148', '2006-02-14', 'clara.shaw@sakilacustomer.org', 'Clara', 'Shaw', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '95', '2006-02-14', 'lois.butler@sakilacustomer.org', 'Lois', 'Butler', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '397', '2006-02-14', 'sean.douglass@sakilacustomer.org', 'Sean', 'Douglass', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '331', '2006-02-14', 'jose.andrew@sakilacustomer.org', 'Jose', 'Andrew', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '350', '2006-02-14', 'carl.artis@sakilacustomer.org', 'Carl', 'Artis', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '230', '2006-02-14', 'maureen.little@sakilacustomer.org', 'Maureen', 'Little', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '209', '2006-02-14', 'eileen.carr@sakilacustomer.org', 'Eileen', 'Carr', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '582', '2006-02-14', 'morris.mccarter@sakilacustomer.org', 'Morris', 'Mccarter', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '79', '2006-02-14', 'tammy.sanders@sakilacustomer.org', 'Tammy', 'Sanders', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '353', '2006-02-14', 'roger.quintanilla@sakilacustomer.org', 'Roger', 'Quintanilla', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '592', '2006-02-14', 'kirk.stclair@sakilacustomer.org', 'Kirk', 'Stclair', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '34', '2006-02-14', 'melissa.king@sakilacustomer.org', 'Melissa', 'King', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '523', '2006-02-14', 'brad.mccurdy@sakilacustomer.org', 'Brad', 'Mccurdy', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '143', '2006-02-14', 'amber.dixon@sakilacustomer.org', 'Amber', 'Dixon', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '9', '2006-02-14', 'elizabeth.brown@sakilacustomer.org', 'Elizabeth', 'Brown', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '77', '2006-02-14', 'beverly.brooks@sakilacustomer.org', 'Beverly', 'Brooks', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '583', '2006-02-14', 'clifton.malcolm@sakilacustomer.org', 'Clifton', 'Malcolm', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '591', '2006-02-14', 'perry.swafford@sakilacustomer.org', 'Perry', 'Swafford', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '28', '2006-02-14', 'kimberly.lee@sakilacustomer.org', 'Kimberly', 'Lee', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '410', '2006-02-14', 'leonard.schofield@sakilacustomer.org', 'Leonard', 'Schofield', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '111', '2006-02-14', 'florence.woods@sakilacustomer.org', 'Florence', 'Woods', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '536', '2006-02-14', 'darryl.ashcraft@sakilacustomer.org', 'Darryl', 'Ashcraft', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '364', '2006-02-14', 'willie.markham@sakilacustomer.org', 'Willie', 'Markham', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '450', '2006-02-14', 'micheal.forman@sakilacustomer.org', 'Micheal', 'Forman', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '336', '2006-02-14', 'eric.robert@sakilacustomer.org', 'Eric', 'Robert', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '327', '2006-02-14', 'jason.morrissey@sakilacustomer.org', 'Jason', 'Morrissey', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '247', '2006-02-14', 'lydia.burke@sakilacustomer.org', 'Lydia', 'Burke', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '566', '2006-02-14', 'jordan.archuleta@sakilacustomer.org', 'Jordan', 'Archuleta', '2013-05-26T14:49:45.738000', 1) + ) AS data(active, activebool, old_address_id, create_date, email, first_name, last_name, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."address"' + AND map0.old_id = data.old_address_id + RETURNING customer_id + ) + SELECT array_agg(customer_id) INTO v_new_ids_customer FROM inserted; + + FOR i IN 1..array_length(v_new_ids_customer, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."customer"', v_old_ids_customer[i], v_new_ids_customer[i]::TEXT); + END LOOP; + + v_old_ids_customer := ARRAY['219', '89', '305', '276', '308', '537', '330', '561', '182', '140', '212', '269', '2', '181', '457', '400', '214', '112', '146', '504', '291', '14', '158', '593', '294', '479', '382', '62', '275', '149', '248', '63', '51', '420', '6', '118', '526', '96', '555', '109', '125', '432', '145', '407', '19', '83', '132', '471', '338', '8', '589', '262', '494', '166', '470', '210', '303', '213', '207', '557', '306', '171', '58', '463', '410', '476', '189', '436', '266', '173', '159', '102', '315', '161', '478', '390', '42', '86', '227', '448', '251', '201', '114', '195', '196', '289', '339', '495', '211', '514', '272', '496', '302', '110', '93', '249', '154', '588', '37', '422']; + WITH inserted AS ( + INSERT INTO "public"."customer" ("active", "activebool", "address_id", "create_date", "email", "first_name", "last_name", "last_update", "store_id") + SELECT + data.active::integer, + data.activebool::boolean, + map0.new_id::smallint, + data.create_date::date, + data.email::character varying, + data.first_name::character varying, + data.last_name::character varying, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + (1, TRUE, '223', '2006-02-14', 'willie.howell@sakilacustomer.org', 'Willie', 'Howell', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '93', '2006-02-14', 'julia.flores@sakilacustomer.org', 'Julia', 'Flores', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '310', '2006-02-14', 'richard.mccrary@sakilacustomer.org', 'Richard', 'Mccrary', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '281', '2006-02-14', 'brandy.graves@sakilacustomer.org', 'Brandy', 'Graves', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '313', '2006-02-14', 'thomas.grigsby@sakilacustomer.org', 'Thomas', 'Grigsby', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '543', '2006-02-14', 'clinton.buford@sakilacustomer.org', 'Clinton', 'Buford', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '335', '2006-02-14', 'scott.shelley@sakilacustomer.org', 'Scott', 'Shelley', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '567', '2006-02-14', 'ian.still@sakilacustomer.org', 'Ian', 'Still', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '186', '2006-02-14', 'renee.lane@sakilacustomer.org', 'Renee', 'Lane', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '144', '2006-02-14', 'eva.ramos@sakilacustomer.org', 'Eva', 'Ramos', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '216', '2006-02-14', 'wilma.richards@sakilacustomer.org', 'Wilma', 'Richards', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '274', '2006-02-14', 'cassandra.walters@sakilacustomer.org', 'Cassandra', 'Walters', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '6', '2006-02-14', 'patricia.johnson@sakilacustomer.org', 'Patricia', 'Johnson', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '185', '2006-02-14', 'ana.bradley@sakilacustomer.org', 'Ana', 'Bradley', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '462', '2006-02-14', 'bill.gavin@sakilacustomer.org', 'Bill', 'Gavin', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '405', '2006-02-14', 'bryan.hardison@sakilacustomer.org', 'Bryan', 'Hardison', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '218', '2006-02-14', 'kristin.johnston@sakilacustomer.org', 'Kristin', 'Johnston', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '116', '2006-02-14', 'rosa.reynolds@sakilacustomer.org', 'Rosa', 'Reynolds', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '150', '2006-02-14', 'jamie.rice@sakilacustomer.org', 'Jamie', 'Rice', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '509', '2006-02-14', 'nathaniel.adam@sakilacustomer.org', 'Nathaniel', 'Adam', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '296', '2006-02-14', 'toni.holt@sakilacustomer.org', 'Toni', 'Holt', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '18', '2006-02-14', 'betty.white@sakilacustomer.org', 'Betty', 'White', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '162', '2006-02-14', 'veronica.stone@sakilacustomer.org', 'Veronica', 'Stone', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '599', '2006-02-14', 'rene.mcalister@sakilacustomer.org', 'Rene', 'Mcalister', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '299', '2006-02-14', 'shelly.watts@sakilacustomer.org', 'Shelly', 'Watts', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '484', '2006-02-14', 'zachary.hite@sakilacustomer.org', 'Zachary', 'Hite', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '387', '2006-02-14', 'victor.barkley@sakilacustomer.org', 'Victor', 'Barkley', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '66', '2006-02-14', 'joan.cooper@sakilacustomer.org', 'Joan', 'Cooper', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '280', '2006-02-14', 'carole.barnett@sakilacustomer.org', 'Carole', 'Barnett', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '153', '2006-02-14', 'valerie.black@sakilacustomer.org', 'Valerie', 'Black', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '252', '2006-02-14', 'caroline.bowman@sakilacustomer.org', 'Caroline', 'Bowman', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '67', '2006-02-14', 'ashley.richardson@sakilacustomer.org', 'Ashley', 'Richardson', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '55', '2006-02-14', 'alice.stewart@sakilacustomer.org', 'Alice', 'Stewart', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '425', '2006-02-14', 'jacob.lance@sakilacustomer.org', 'Jacob', 'Lance', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '10', '2006-02-14', 'jennifer.davis@sakilacustomer.org', 'Jennifer', 'Davis', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '122', '2006-02-14', 'kim.cruz@sakilacustomer.org', 'Kim', 'Cruz', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '532', '2006-02-14', 'karl.seal@sakilacustomer.org', 'Karl', 'Seal', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '100', '2006-02-14', 'diana.alexander@sakilacustomer.org', 'Diana', 'Alexander', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '561', '2006-02-14', 'dwight.lombardi@sakilacustomer.org', 'Dwight', 'Lombardi', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '113', '2006-02-14', 'edna.west@sakilacustomer.org', 'Edna', 'West', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '129', '2006-02-14', 'ethel.webb@sakilacustomer.org', 'Ethel', 'Webb', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '437', '2006-02-14', 'edwin.burk@sakilacustomer.org', 'Edwin', 'Burk', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '149', '2006-02-14', 'lucille.holmes@sakilacustomer.org', 'Lucille', 'Holmes', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '412', '2006-02-14', 'dale.ratcliff@sakilacustomer.org', 'Dale', 'Ratcliff', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '23', '2006-02-14', 'ruth.martinez@sakilacustomer.org', 'Ruth', 'Martinez', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '87', '2006-02-14', 'louise.jenkins@sakilacustomer.org', 'Louise', 'Jenkins', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '136', '2006-02-14', 'esther.crawford@sakilacustomer.org', 'Esther', 'Crawford', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '476', '2006-02-14', 'dean.sauer@sakilacustomer.org', 'Dean', 'Sauer', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '343', '2006-02-14', 'dennis.gilman@sakilacustomer.org', 'Dennis', 'Gilman', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '12', '2006-02-14', 'susan.wilson@sakilacustomer.org', 'Susan', 'Wilson', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '595', '2006-02-14', 'tracy.herrmann@sakilacustomer.org', 'Tracy', 'Herrmann', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '267', '2006-02-14', 'patsy.davidson@sakilacustomer.org', 'Patsy', 'Davidson', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '499', '2006-02-14', 'ramon.choate@sakilacustomer.org', 'Ramon', 'Choate', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '170', '2006-02-14', 'lynn.payne@sakilacustomer.org', 'Lynn', 'Payne', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '475', '2006-02-14', 'gordon.allard@sakilacustomer.org', 'Gordon', 'Allard', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '214', '2006-02-14', 'ella.oliver@sakilacustomer.org', 'Ella', 'Oliver', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '308', '2006-02-14', 'william.satterfield@sakilacustomer.org', 'William', 'Satterfield', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '217', '2006-02-14', 'gina.williamson@sakilacustomer.org', 'Gina', 'Williamson', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '211', '2006-02-14', 'gertrude.castillo@sakilacustomer.org', 'Gertrude', 'Castillo', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '563', '2006-02-14', 'felix.gaffney@sakilacustomer.org', 'Felix', 'Gaffney', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '311', '2006-02-14', 'charles.kowalski@sakilacustomer.org', 'Charles', 'Kowalski', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '175', '2006-02-14', 'dolores.wagner@sakilacustomer.org', 'Dolores', 'Wagner', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '62', '2006-02-14', 'jean.bell@sakilacustomer.org', 'Jean', 'Bell', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '468', '2006-02-14', 'darrell.power@sakilacustomer.org', 'Darrell', 'Power', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '415', '2006-02-14', 'curtis.irby@sakilacustomer.org', 'Curtis', 'Irby', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '481', '2006-02-14', 'derrick.bourque@sakilacustomer.org', 'Derrick', 'Bourque', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '193', '2006-02-14', 'loretta.carpenter@sakilacustomer.org', 'Loretta', 'Carpenter', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '441', '2006-02-14', 'troy.quigley@sakilacustomer.org', 'Troy', 'Quigley', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '271', '2006-02-14', 'nora.herrera@sakilacustomer.org', 'Nora', 'Herrera', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '177', '2006-02-14', 'audrey.ray@sakilacustomer.org', 'Audrey', 'Ray', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '163', '2006-02-14', 'jill.hawkins@sakilacustomer.org', 'Jill', 'Hawkins', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '106', '2006-02-14', 'crystal.ford@sakilacustomer.org', 'Crystal', 'Ford', '2013-05-26T14:49:45.738000', 1), + (0, TRUE, '320', '2006-02-14', 'kenneth.gooden@sakilacustomer.org', 'Kenneth', 'Gooden', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '165', '2006-02-14', 'geraldine.perkins@sakilacustomer.org', 'Geraldine', 'Perkins', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '483', '2006-02-14', 'lewis.lyman@sakilacustomer.org', 'Lewis', 'Lyman', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '395', '2006-02-14', 'shawn.heaton@sakilacustomer.org', 'Shawn', 'Heaton', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '46', '2006-02-14', 'carolyn.perez@sakilacustomer.org', 'Carolyn', 'Perez', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '90', '2006-02-14', 'jacqueline.long@sakilacustomer.org', 'Jacqueline', 'Long', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '231', '2006-02-14', 'colleen.burton@sakilacustomer.org', 'Colleen', 'Burton', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '453', '2006-02-14', 'miguel.betancourt@sakilacustomer.org', 'Miguel', 'Betancourt', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '255', '2006-02-14', 'vickie.brewer@sakilacustomer.org', 'Vickie', 'Brewer', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '205', '2006-02-14', 'vicki.fields@sakilacustomer.org', 'Vicki', 'Fields', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '118', '2006-02-14', 'grace.ellis@sakilacustomer.org', 'Grace', 'Ellis', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '199', '2006-02-14', 'vanessa.sims@sakilacustomer.org', 'Vanessa', 'Sims', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '200', '2006-02-14', 'alma.austin@sakilacustomer.org', 'Alma', 'Austin', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '294', '2006-02-14', 'violet.rodriquez@sakilacustomer.org', 'Violet', 'Rodriquez', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '344', '2006-02-14', 'walter.perryman@sakilacustomer.org', 'Walter', 'Perryman', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '500', '2006-02-14', 'charlie.bess@sakilacustomer.org', 'Charlie', 'Bess', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '215', '2006-02-14', 'stacey.montgomery@sakilacustomer.org', 'Stacey', 'Montgomery', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '520', '2006-02-14', 'franklin.troutman@sakilacustomer.org', 'Franklin', 'Troutman', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '277', '2006-02-14', 'kay.caldwell@sakilacustomer.org', 'Kay', 'Caldwell', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '501', '2006-02-14', 'tyler.wren@sakilacustomer.org', 'Tyler', 'Wren', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '307', '2006-02-14', 'michael.silverman@sakilacustomer.org', 'Michael', 'Silverman', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '114', '2006-02-14', 'tiffany.jordan@sakilacustomer.org', 'Tiffany', 'Jordan', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '97', '2006-02-14', 'phyllis.foster@sakilacustomer.org', 'Phyllis', 'Foster', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '253', '2006-02-14', 'dora.medina@sakilacustomer.org', 'Dora', 'Medina', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '158', '2006-02-14', 'michele.grant@sakilacustomer.org', 'Michele', 'Grant', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '594', '2006-02-14', 'marion.ocampo@sakilacustomer.org', 'Marion', 'Ocampo', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '41', '2006-02-14', 'pamela.baker@sakilacustomer.org', 'Pamela', 'Baker', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '427', '2006-02-14', 'melvin.ellington@sakilacustomer.org', 'Melvin', 'Ellington', '2013-05-26T14:49:45.738000', 1) + ) AS data(active, activebool, old_address_id, create_date, email, first_name, last_name, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."address"' + AND map0.old_id = data.old_address_id + RETURNING customer_id + ) + SELECT array_agg(customer_id) INTO v_new_ids_customer FROM inserted; + + FOR i IN 1..array_length(v_new_ids_customer, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."customer"', v_old_ids_customer[i], v_new_ids_customer[i]::TEXT); + END LOOP; + + v_old_ids_customer := ARRAY['384', '281', '594', '283', '168', '424', '533', '241', '521', '242', '378', '552', '90', '260', '129', '324', '435', '538', '564', '197', '442', '138', '267', '151', '569', '466', '64', '165', '313', '485', '67', '595', '169', '389', '599', '511', '550', '484', '546', '357', '3', '596', '590', '253', '337', '285', '355', '34', '79', '147', '385', '11', '503', '29', '531', '547', '53', '391', '401', '240', '264', '194', '404', '299', '163', '54', '489', '574', '396', '1', '365', '519', '141', '429', '573', '76', '358', '60', '136', '287', '135', '259', '209', '224', '336', '440', '268', '554', '403', '68', '167', '225', '12', '95', '192', '356', '446', '117', '15', '421']; + WITH inserted AS ( + INSERT INTO "public"."customer" ("active", "activebool", "address_id", "create_date", "email", "first_name", "last_name", "last_update", "store_id") + SELECT + data.active::integer, + data.activebool::boolean, + map0.new_id::smallint, + data.create_date::date, + data.email::character varying, + data.first_name::character varying, + data.last_name::character varying, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + (1, TRUE, '389', '2006-02-14', 'ernest.stepp@sakilacustomer.org', 'Ernest', 'Stepp', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '286', '2006-02-14', 'leona.obrien@sakilacustomer.org', 'Leona', 'Obrien', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '600', '2006-02-14', 'eduardo.hiatt@sakilacustomer.org', 'Eduardo', 'Hiatt', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '288', '2006-02-14', 'felicia.sutton@sakilacustomer.org', 'Felicia', 'Sutton', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '172', '2006-02-14', 'regina.berry@sakilacustomer.org', 'Regina', 'Berry', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '429', '2006-02-14', 'kyle.spurlock@sakilacustomer.org', 'Kyle', 'Spurlock', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '539', '2006-02-14', 'jessie.milam@sakilacustomer.org', 'Jessie', 'Milam', '2013-05-26T14:49:45.738000', 1), + (0, TRUE, '245', '2006-02-14', 'heidi.larson@sakilacustomer.org', 'Heidi', 'Larson', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '527', '2006-02-14', 'roland.south@sakilacustomer.org', 'Roland', 'South', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '246', '2006-02-14', 'glenda.frazier@sakilacustomer.org', 'Glenda', 'Frazier', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '383', '2006-02-14', 'eugene.culpepper@sakilacustomer.org', 'Eugene', 'Culpepper', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '558', '2006-02-14', 'hugh.waldrop@sakilacustomer.org', 'Hugh', 'Waldrop', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '94', '2006-02-14', 'ruby.washington@sakilacustomer.org', 'Ruby', 'Washington', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '265', '2006-02-14', 'christy.vargas@sakilacustomer.org', 'Christy', 'Vargas', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '133', '2006-02-14', 'carrie.porter@sakilacustomer.org', 'Carrie', 'Porter', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '329', '2006-02-14', 'gary.coy@sakilacustomer.org', 'Gary', 'Coy', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '440', '2006-02-14', 'ricky.shelby@sakilacustomer.org', 'Ricky', 'Shelby', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '544', '2006-02-14', 'ted.breaux@sakilacustomer.org', 'Ted', 'Breaux', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '570', '2006-02-14', 'bob.pfeiffer@sakilacustomer.org', 'Bob', 'Pfeiffer', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '201', '2006-02-14', 'sue.peters@sakilacustomer.org', 'Sue', 'Peters', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '447', '2006-02-14', 'leroy.bustamante@sakilacustomer.org', 'Leroy', 'Bustamante', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '142', '2006-02-14', 'hazel.warren@sakilacustomer.org', 'Hazel', 'Warren', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '272', '2006-02-14', 'margie.wade@sakilacustomer.org', 'Margie', 'Wade', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '155', '2006-02-14', 'megan.palmer@sakilacustomer.org', 'Megan', 'Palmer', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '575', '2006-02-14', 'dave.gardiner@sakilacustomer.org', 'Dave', 'Gardiner', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '471', '2006-02-14', 'leo.ebert@sakilacustomer.org', 'Leo', 'Ebert', '2013-05-26T14:49:45.738000', 1), + (0, TRUE, '68', '2006-02-14', 'judith.cox@sakilacustomer.org', 'Judith', 'Cox', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '169', '2006-02-14', 'lorraine.stephens@sakilacustomer.org', 'Lorraine', 'Stephens', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '318', '2006-02-14', 'donald.mahon@sakilacustomer.org', 'Donald', 'Mahon', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '490', '2006-02-14', 'clyde.tobias@sakilacustomer.org', 'Clyde', 'Tobias', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '71', '2006-02-14', 'kelly.torres@sakilacustomer.org', 'Kelly', 'Torres', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '601', '2006-02-14', 'terrence.gunderson@sakilacustomer.org', 'Terrence', 'Gunderson', '2013-05-26T14:49:45.738000', 1), + (0, TRUE, '173', '2006-02-14', 'erica.matthews@sakilacustomer.org', 'Erica', 'Matthews', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '394', '2006-02-14', 'alan.kahn@sakilacustomer.org', 'Alan', 'Kahn', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '605', '2006-02-14', 'austin.cintron@sakilacustomer.org', 'Austin', 'Cintron', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '516', '2006-02-14', 'chester.benner@sakilacustomer.org', 'Chester', 'Benner', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '556', '2006-02-14', 'guy.brownlee@sakilacustomer.org', 'Guy', 'Brownlee', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '489', '2006-02-14', 'roberto.vu@sakilacustomer.org', 'Roberto', 'Vu', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '552', '2006-02-14', 'kelly.knott@sakilacustomer.org', 'Kelly', 'Knott', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '362', '2006-02-14', 'keith.rico@sakilacustomer.org', 'Keith', 'Rico', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '7', '2006-02-14', 'linda.williams@sakilacustomer.org', 'Linda', 'Williams', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '602', '2006-02-14', 'enrique.forsythe@sakilacustomer.org', 'Enrique', 'Forsythe', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '596', '2006-02-14', 'seth.hannon@sakilacustomer.org', 'Seth', 'Hannon', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '258', '2006-02-14', 'terry.carlson@sakilacustomer.org', 'Terry', 'Carlson', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '342', '2006-02-14', 'jerry.jordon@sakilacustomer.org', 'Jerry', 'Jordon', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '290', '2006-02-14', 'miriam.mckinney@sakilacustomer.org', 'Miriam', 'Mckinney', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '360', '2006-02-14', 'terry.grissom@sakilacustomer.org', 'Terry', 'Grissom', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '38', '2006-02-14', 'rebecca.scott@sakilacustomer.org', 'Rebecca', 'Scott', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '83', '2006-02-14', 'rachel.barnes@sakilacustomer.org', 'Rachel', 'Barnes', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '151', '2006-02-14', 'joanne.robertson@sakilacustomer.org', 'Joanne', 'Robertson', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '390', '2006-02-14', 'phillip.holm@sakilacustomer.org', 'Phillip', 'Holm', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '15', '2006-02-14', 'lisa.anderson@sakilacustomer.org', 'Lisa', 'Anderson', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '508', '2006-02-14', 'angel.barclay@sakilacustomer.org', 'Angel', 'Barclay', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '33', '2006-02-14', 'angela.hernandez@sakilacustomer.org', 'Angela', 'Hernandez', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '537', '2006-02-14', 'jamie.waugh@sakilacustomer.org', 'Jamie', 'Waugh', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '553', '2006-02-14', 'kurt.emmons@sakilacustomer.org', 'Kurt', 'Emmons', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '57', '2006-02-14', 'heather.morris@sakilacustomer.org', 'Heather', 'Morris', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '396', '2006-02-14', 'clarence.gamez@sakilacustomer.org', 'Clarence', 'Gamez', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '406', '2006-02-14', 'tony.carranza@sakilacustomer.org', 'Tony', 'Carranza', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '244', '2006-02-14', 'marlene.welch@sakilacustomer.org', 'Marlene', 'Welch', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '269', '2006-02-14', 'gwendolyn.may@sakilacustomer.org', 'Gwendolyn', 'May', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '198', '2006-02-14', 'kristen.chavez@sakilacustomer.org', 'Kristen', 'Chavez', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '409', '2006-02-14', 'stanley.scroggins@sakilacustomer.org', 'Stanley', 'Scroggins', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '304', '2006-02-14', 'james.gannon@sakilacustomer.org', 'James', 'Gannon', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '167', '2006-02-14', 'cathy.spencer@sakilacustomer.org', 'Cathy', 'Spencer', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '58', '2006-02-14', 'teresa.rogers@sakilacustomer.org', 'Teresa', 'Rogers', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '494', '2006-02-14', 'ricardo.meador@sakilacustomer.org', 'Ricardo', 'Meador', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '580', '2006-02-14', 'julian.vest@sakilacustomer.org', 'Julian', 'Vest', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '401', '2006-02-14', 'earl.shanks@sakilacustomer.org', 'Earl', 'Shanks', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '5', '2006-02-14', 'mary.smith@sakilacustomer.org', 'Mary', 'Smith', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '370', '2006-02-14', 'bruce.schwarz@sakilacustomer.org', 'Bruce', 'Schwarz', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '525', '2006-02-14', 'ron.deluca@sakilacustomer.org', 'Ron', 'Deluca', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '145', '2006-02-14', 'debbie.reyes@sakilacustomer.org', 'Debbie', 'Reyes', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '434', '2006-02-14', 'frederick.isbell@sakilacustomer.org', 'Frederick', 'Isbell', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '579', '2006-02-14', 'byron.box@sakilacustomer.org', 'Byron', 'Box', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '80', '2006-02-14', 'irene.price@sakilacustomer.org', 'Irene', 'Price', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '363', '2006-02-14', 'samuel.marlow@sakilacustomer.org', 'Samuel', 'Marlow', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '64', '2006-02-14', 'mildred.bailey@sakilacustomer.org', 'Mildred', 'Bailey', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '140', '2006-02-14', 'anita.morales@sakilacustomer.org', 'Anita', 'Morales', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '292', '2006-02-14', 'becky.miles@sakilacustomer.org', 'Becky', 'Miles', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '139', '2006-02-14', 'juanita.mason@sakilacustomer.org', 'Juanita', 'Mason', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '264', '2006-02-14', 'lena.jensen@sakilacustomer.org', 'Lena', 'Jensen', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '213', '2006-02-14', 'tonya.chapman@sakilacustomer.org', 'Tonya', 'Chapman', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '228', '2006-02-14', 'pearl.garza@sakilacustomer.org', 'Pearl', 'Garza', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '341', '2006-02-14', 'joshua.mark@sakilacustomer.org', 'Joshua', 'Mark', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '445', '2006-02-14', 'bernard.colby@sakilacustomer.org', 'Bernard', 'Colby', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '273', '2006-02-14', 'nina.soto@sakilacustomer.org', 'Nina', 'Soto', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '560', '2006-02-14', 'dwayne.olvera@sakilacustomer.org', 'Dwayne', 'Olvera', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '408', '2006-02-14', 'mike.way@sakilacustomer.org', 'Mike', 'Way', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '72', '2006-02-14', 'nicole.peterson@sakilacustomer.org', 'Nicole', 'Peterson', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '171', '2006-02-14', 'sally.pierce@sakilacustomer.org', 'Sally', 'Pierce', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '229', '2006-02-14', 'arlene.harvey@sakilacustomer.org', 'Arlene', 'Harvey', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '16', '2006-02-14', 'nancy.thomas@sakilacustomer.org', 'Nancy', 'Thomas', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '99', '2006-02-14', 'paula.bryant@sakilacustomer.org', 'Paula', 'Bryant', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '196', '2006-02-14', 'laurie.lawrence@sakilacustomer.org', 'Laurie', 'Lawrence', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '361', '2006-02-14', 'gerald.fultz@sakilacustomer.org', 'Gerald', 'Fultz', '2013-05-26T14:49:45.738000', 2), + (0, TRUE, '451', '2006-02-14', 'theodore.culp@sakilacustomer.org', 'Theodore', 'Culp', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '121', '2006-02-14', 'edith.mcdonald@sakilacustomer.org', 'Edith', 'Mcdonald', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '19', '2006-02-14', 'helen.harris@sakilacustomer.org', 'Helen', 'Harris', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '426', '2006-02-14', 'lee.hawks@sakilacustomer.org', 'Lee', 'Hawks', '2013-05-26T14:49:45.738000', 1) + ) AS data(active, activebool, old_address_id, create_date, email, first_name, last_name, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."address"' + AND map0.old_id = data.old_address_id + RETURNING customer_id + ) + SELECT array_agg(customer_id) INTO v_new_ids_customer FROM inserted; + + FOR i IN 1..array_length(v_new_ids_customer, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."customer"', v_old_ids_customer[i], v_new_ids_customer[i]::TEXT); + END LOOP; + + v_old_ids_customer := ARRAY['32', '300', '529', '170', '31', '534', '413', '123', '238', '271', '274', '59', '202', '78', '152', '502', '492', '121', '217', '419', '370', '296', '508', '379', '509', '316', '208', '426', '175', '468', '367', '412', '28', '186', '297', '231', '218', '516', '228', '406', '333', '334', '438', '525', '499', '221', '33', '541', '439', '309', '43', '56', '381', '344', '4', '256', '105', '375', '387', '456', '200', '69', '441', '176', '157', '363', '193', '332', '329', '21', '148', '82', '386', '475', '187', '131', '545', '461', '72', '548', '244', '94', '236', '349', '434', '522', '505', '580', '388', '263', '371', '71', '261', '27', '373', '188', '255', '395', '50', '298']; + WITH inserted AS ( + INSERT INTO "public"."customer" ("active", "activebool", "address_id", "create_date", "email", "first_name", "last_name", "last_update", "store_id") + SELECT + data.active::integer, + data.activebool::boolean, + map0.new_id::smallint, + data.create_date::date, + data.email::character varying, + data.first_name::character varying, + data.last_name::character varying, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + (1, TRUE, '36', '2006-02-14', 'amy.lopez@sakilacustomer.org', 'Amy', 'Lopez', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '305', '2006-02-14', 'john.farnsworth@sakilacustomer.org', 'John', 'Farnsworth', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '535', '2006-02-14', 'erik.guillen@sakilacustomer.org', 'Erik', 'Guillen', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '174', '2006-02-14', 'beatrice.arnold@sakilacustomer.org', 'Beatrice', 'Arnold', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '35', '2006-02-14', 'brenda.wright@sakilacustomer.org', 'Brenda', 'Wright', '2013-05-26T14:49:45.738000', 2), + (0, TRUE, '540', '2006-02-14', 'christian.jung@sakilacustomer.org', 'Christian', 'Jung', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '418', '2006-02-14', 'marvin.yee@sakilacustomer.org', 'Marvin', 'Yee', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '127', '2006-02-14', 'shannon.freeman@sakilacustomer.org', 'Shannon', 'Freeman', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '242', '2006-02-14', 'nellie.garrett@sakilacustomer.org', 'Nellie', 'Garrett', '2013-05-26T14:49:45.738000', 1), + (0, TRUE, '276', '2006-02-14', 'penny.neal@sakilacustomer.org', 'Penny', 'Neal', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '279', '2006-02-14', 'naomi.jennings@sakilacustomer.org', 'Naomi', 'Jennings', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '63', '2006-02-14', 'cheryl.murphy@sakilacustomer.org', 'Cheryl', 'Murphy', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '206', '2006-02-14', 'carla.gutierrez@sakilacustomer.org', 'Carla', 'Gutierrez', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '82', '2006-02-14', 'lori.wood@sakilacustomer.org', 'Lori', 'Wood', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '156', '2006-02-14', 'alicia.mills@sakilacustomer.org', 'Alicia', 'Mills', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '507', '2006-02-14', 'brett.cornwell@sakilacustomer.org', 'Brett', 'Cornwell', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '497', '2006-02-14', 'lester.kraus@sakilacustomer.org', 'Lester', 'Kraus', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '125', '2006-02-14', 'josephine.gomez@sakilacustomer.org', 'Josephine', 'Gomez', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '221', '2006-02-14', 'agnes.bishop@sakilacustomer.org', 'Agnes', 'Bishop', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '424', '2006-02-14', 'chad.carbone@sakilacustomer.org', 'Chad', 'Carbone', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '375', '2006-02-14', 'wayne.truong@sakilacustomer.org', 'Wayne', 'Truong', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '301', '2006-02-14', 'ramona.hale@sakilacustomer.org', 'Ramona', 'Hale', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '513', '2006-02-14', 'milton.howland@sakilacustomer.org', 'Milton', 'Howland', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '384', '2006-02-14', 'carlos.coughlin@sakilacustomer.org', 'Carlos', 'Coughlin', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '514', '2006-02-14', 'raul.fortier@sakilacustomer.org', 'Raul', 'Fortier', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '321', '2006-02-14', 'steven.curley@sakilacustomer.org', 'Steven', 'Curley', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '212', '2006-02-14', 'lucy.wheeler@sakilacustomer.org', 'Lucy', 'Wheeler', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '431', '2006-02-14', 'bradley.motley@sakilacustomer.org', 'Bradley', 'Motley', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '179', '2006-02-14', 'annette.olson@sakilacustomer.org', 'Annette', 'Olson', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '473', '2006-02-14', 'tim.cary@sakilacustomer.org', 'Tim', 'Cary', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '372', '2006-02-14', 'adam.gooch@sakilacustomer.org', 'Adam', 'Gooch', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '417', '2006-02-14', 'allen.butterfield@sakilacustomer.org', 'Allen', 'Butterfield', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '32', '2006-02-14', 'cynthia.young@sakilacustomer.org', 'Cynthia', 'Young', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '190', '2006-02-14', 'holly.fox@sakilacustomer.org', 'Holly', 'Fox', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '302', '2006-02-14', 'sherri.rhodes@sakilacustomer.org', 'Sherri', 'Rhodes', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '235', '2006-02-14', 'georgia.jacobs@sakilacustomer.org', 'Georgia', 'Jacobs', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '222', '2006-02-14', 'vera.mccoy@sakilacustomer.org', 'Vera', 'Mccoy', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '522', '2006-02-14', 'elmer.noe@sakilacustomer.org', 'Elmer', 'Noe', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '232', '2006-02-14', 'allison.stanley@sakilacustomer.org', 'Allison', 'Stanley', '2013-05-26T14:49:45.738000', 2), + (0, TRUE, '411', '2006-02-14', 'nathan.runyon@sakilacustomer.org', 'Nathan', 'Runyon', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '338', '2006-02-14', 'andrew.purdy@sakilacustomer.org', 'Andrew', 'Purdy', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '339', '2006-02-14', 'raymond.mcwhorter@sakilacustomer.org', 'Raymond', 'Mcwhorter', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '443', '2006-02-14', 'barry.lovelace@sakilacustomer.org', 'Barry', 'Lovelace', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '531', '2006-02-14', 'adrian.clary@sakilacustomer.org', 'Adrian', 'Clary', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '504', '2006-02-14', 'marc.outlaw@sakilacustomer.org', 'Marc', 'Outlaw', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '225', '2006-02-14', 'bessie.morrison@sakilacustomer.org', 'Bessie', 'Morrison', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '37', '2006-02-14', 'anna.hill@sakilacustomer.org', 'Anna', 'Hill', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '547', '2006-02-14', 'darren.windham@sakilacustomer.org', 'Darren', 'Windham', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '444', '2006-02-14', 'alexander.fennell@sakilacustomer.org', 'Alexander', 'Fennell', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '314', '2006-02-14', 'christopher.greco@sakilacustomer.org', 'Christopher', 'Greco', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '47', '2006-02-14', 'christine.roberts@sakilacustomer.org', 'Christine', 'Roberts', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '60', '2006-02-14', 'gloria.cook@sakilacustomer.org', 'Gloria', 'Cook', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '386', '2006-02-14', 'bobby.boudreau@sakilacustomer.org', 'Bobby', 'Boudreau', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '349', '2006-02-14', 'henry.billingsley@sakilacustomer.org', 'Henry', 'Billingsley', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '8', '2006-02-14', 'barbara.jones@sakilacustomer.org', 'Barbara', 'Jones', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '261', '2006-02-14', 'mabel.holland@sakilacustomer.org', 'Mabel', 'Holland', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '109', '2006-02-14', 'dawn.sullivan@sakilacustomer.org', 'Dawn', 'Sullivan', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '380', '2006-02-14', 'aaron.selby@sakilacustomer.org', 'Aaron', 'Selby', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '392', '2006-02-14', 'jesse.schilling@sakilacustomer.org', 'Jesse', 'Schilling', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '461', '2006-02-14', 'ronnie.ricketts@sakilacustomer.org', 'Ronnie', 'Ricketts', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '204', '2006-02-14', 'jeanne.lawson@sakilacustomer.org', 'Jeanne', 'Lawson', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '73', '2006-02-14', 'judy.gray@sakilacustomer.org', 'Judy', 'Gray', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '446', '2006-02-14', 'mario.cheatham@sakilacustomer.org', 'Mario', 'Cheatham', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '180', '2006-02-14', 'june.carroll@sakilacustomer.org', 'June', 'Carroll', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '161', '2006-02-14', 'darlene.rose@sakilacustomer.org', 'Darlene', 'Rose', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '368', '2006-02-14', 'roy.whiting@sakilacustomer.org', 'Roy', 'Whiting', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '197', '2006-02-14', 'katie.elliott@sakilacustomer.org', 'Katie', 'Elliott', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '337', '2006-02-14', 'stephen.qualls@sakilacustomer.org', 'Stephen', 'Qualls', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '334', '2006-02-14', 'frank.waggoner@sakilacustomer.org', 'Frank', 'Waggoner', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '25', '2006-02-14', 'michelle.clark@sakilacustomer.org', 'Michelle', 'Clark', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '152', '2006-02-14', 'eleanor.hunt@sakilacustomer.org', 'Eleanor', 'Hunt', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '86', '2006-02-14', 'kathryn.coleman@sakilacustomer.org', 'Kathryn', 'Coleman', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '391', '2006-02-14', 'todd.tan@sakilacustomer.org', 'Todd', 'Tan', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '480', '2006-02-14', 'pedro.chestnut@sakilacustomer.org', 'Pedro', 'Chestnut', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '191', '2006-02-14', 'brittany.riley@sakilacustomer.org', 'Brittany', 'Riley', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '135', '2006-02-14', 'monica.hicks@sakilacustomer.org', 'Monica', 'Hicks', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '551', '2006-02-14', 'julio.noland@sakilacustomer.org', 'Julio', 'Noland', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '466', '2006-02-14', 'derek.blakely@sakilacustomer.org', 'Derek', 'Blakely', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '76', '2006-02-14', 'theresa.watson@sakilacustomer.org', 'Theresa', 'Watson', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '554', '2006-02-14', 'allan.cornish@sakilacustomer.org', 'Allan', 'Cornish', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '248', '2006-02-14', 'viola.hanson@sakilacustomer.org', 'Viola', 'Hanson', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '98', '2006-02-14', 'norma.gonzales@sakilacustomer.org', 'Norma', 'Gonzales', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '240', '2006-02-14', 'marcia.dean@sakilacustomer.org', 'Marcia', 'Dean', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '354', '2006-02-14', 'joe.gilliland@sakilacustomer.org', 'Joe', 'Gilliland', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '439', '2006-02-14', 'eddie.tomlin@sakilacustomer.org', 'Eddie', 'Tomlin', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '528', '2006-02-14', 'arnold.havens@sakilacustomer.org', 'Arnold', 'Havens', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '510', '2006-02-14', 'rafael.abney@sakilacustomer.org', 'Rafael', 'Abney', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '586', '2006-02-14', 'ross.grey@sakilacustomer.org', 'Ross', 'Grey', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '393', '2006-02-14', 'craig.morrell@sakilacustomer.org', 'Craig', 'Morrell', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '268', '2006-02-14', 'hilda.hopkins@sakilacustomer.org', 'Hilda', 'Hopkins', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '376', '2006-02-14', 'billy.poulin@sakilacustomer.org', 'Billy', 'Poulin', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '75', '2006-02-14', 'kathy.james@sakilacustomer.org', 'Kathy', 'James', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '266', '2006-02-14', 'deanna.byrd@sakilacustomer.org', 'Deanna', 'Byrd', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '31', '2006-02-14', 'shirley.allen@sakilacustomer.org', 'Shirley', 'Allen', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '378', '2006-02-14', 'louis.leone@sakilacustomer.org', 'Louis', 'Leone', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '192', '2006-02-14', 'melanie.armstrong@sakilacustomer.org', 'Melanie', 'Armstrong', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '260', '2006-02-14', 'irma.pearson@sakilacustomer.org', 'Irma', 'Pearson', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '400', '2006-02-14', 'johnny.turpin@sakilacustomer.org', 'Johnny', 'Turpin', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '54', '2006-02-14', 'diane.collins@sakilacustomer.org', 'Diane', 'Collins', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '303', '2006-02-14', 'erika.pena@sakilacustomer.org', 'Erika', 'Pena', '2013-05-26T14:49:45.738000', 1) + ) AS data(active, activebool, old_address_id, create_date, email, first_name, last_name, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."address"' + AND map0.old_id = data.old_address_id + RETURNING customer_id + ) + SELECT array_agg(customer_id) INTO v_new_ids_customer FROM inserted; + + FOR i IN 1..array_length(v_new_ids_customer, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."customer"', v_old_ids_customer[i], v_new_ids_customer[i]::TEXT); + END LOOP; + + v_old_ids_customer := ARRAY['137', '474', '415', '341', '184', '571', '572', '558', '318', '128', '270', '380', '501', '342', '443', '216', '183', '229', '551', '77', '325', '314', '398', '310', '544', '354', '206', '374', '178', '130', '254', '92', '246', '126', '307', '74', '427', '591', '362', '47', '39', '99', '237', '88', '536', '245', '160', '393', '17', '376', '295', '567', '46', '301', '191', '351', '44', '397', '346', '179', '430', '222', '106', '428', '48', '55', '487', '100', '462', '127', '510', '350', '447', '311', '81', '257', '97', '433', '258', '418', '437', '431', '455', '335', '513', '239', '203', '328', '506', '450', '542', '116', '372', '458', '411', '473', '524', '153', '500']; + WITH inserted AS ( + INSERT INTO "public"."customer" ("active", "activebool", "address_id", "create_date", "email", "first_name", "last_name", "last_update", "store_id") + SELECT + data.active::integer, + data.activebool::boolean, + map0.new_id::smallint, + data.create_date::date, + data.email::character varying, + data.first_name::character varying, + data.last_name::character varying, + data.last_update::timestamp without time zone, + data.store_id::smallint + FROM (VALUES + (1, TRUE, '141', '2006-02-14', 'rhonda.kennedy@sakilacustomer.org', 'Rhonda', 'Kennedy', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '479', '2006-02-14', 'dustin.gillette@sakilacustomer.org', 'Dustin', 'Gillette', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '420', '2006-02-14', 'glenn.pullen@sakilacustomer.org', 'Glenn', 'Pullen', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '346', '2006-02-14', 'peter.menard@sakilacustomer.org', 'Peter', 'Menard', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '188', '2006-02-14', 'vivian.ruiz@sakilacustomer.org', 'Vivian', 'Ruiz', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '577', '2006-02-14', 'johnnie.chisholm@sakilacustomer.org', 'Johnnie', 'Chisholm', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '578', '2006-02-14', 'sidney.burleson@sakilacustomer.org', 'Sidney', 'Burleson', '2013-05-26T14:49:45.738000', 1), + (0, TRUE, '564', '2006-02-14', 'jimmie.eggleston@sakilacustomer.org', 'Jimmie', 'Eggleston', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '323', '2006-02-14', 'brian.wyman@sakilacustomer.org', 'Brian', 'Wyman', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '132', '2006-02-14', 'marjorie.tucker@sakilacustomer.org', 'Marjorie', 'Tucker', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '275', '2006-02-14', 'leah.curtis@sakilacustomer.org', 'Leah', 'Curtis', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '385', '2006-02-14', 'russell.brinson@sakilacustomer.org', 'Russell', 'Brinson', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '506', '2006-02-14', 'ruben.geary@sakilacustomer.org', 'Ruben', 'Geary', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '347', '2006-02-14', 'harold.martino@sakilacustomer.org', 'Harold', 'Martino', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '448', '2006-02-14', 'francisco.skidmore@sakilacustomer.org', 'Francisco', 'Skidmore', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '220', '2006-02-14', 'natalie.meyer@sakilacustomer.org', 'Natalie', 'Meyer', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '187', '2006-02-14', 'ida.andrews@sakilacustomer.org', 'Ida', 'Andrews', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '233', '2006-02-14', 'tamara.nguyen@sakilacustomer.org', 'Tamara', 'Nguyen', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '557', '2006-02-14', 'clayton.barbee@sakilacustomer.org', 'Clayton', 'Barbee', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '81', '2006-02-14', 'jane.bennett@sakilacustomer.org', 'Jane', 'Bennett', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '330', '2006-02-14', 'timothy.bunn@sakilacustomer.org', 'Timothy', 'Bunn', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '319', '2006-02-14', 'george.linton@sakilacustomer.org', 'George', 'Linton', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '403', '2006-02-14', 'antonio.meek@sakilacustomer.org', 'Antonio', 'Meek', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '315', '2006-02-14', 'daniel.cabral@sakilacustomer.org', 'Daniel', 'Cabral', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '550', '2006-02-14', 'cody.nolen@sakilacustomer.org', 'Cody', 'Nolen', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '359', '2006-02-14', 'justin.ngo@sakilacustomer.org', 'Justin', 'Ngo', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '210', '2006-02-14', 'terri.vasquez@sakilacustomer.org', 'Terri', 'Vasquez', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '379', '2006-02-14', 'jeremy.hurtado@sakilacustomer.org', 'Jeremy', 'Hurtado', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '182', '2006-02-14', 'marion.snyder@sakilacustomer.org', 'Marion', 'Snyder', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '134', '2006-02-14', 'charlotte.hunter@sakilacustomer.org', 'Charlotte', 'Hunter', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '259', '2006-02-14', 'maxine.silva@sakilacustomer.org', 'Maxine', 'Silva', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '96', '2006-02-14', 'tina.simmons@sakilacustomer.org', 'Tina', 'Simmons', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '250', '2006-02-14', 'marian.mendoza@sakilacustomer.org', 'Marian', 'Mendoza', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '130', '2006-02-14', 'ellen.simpson@sakilacustomer.org', 'Ellen', 'Simpson', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '312', '2006-02-14', 'joseph.joy@sakilacustomer.org', 'Joseph', 'Joy', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '78', '2006-02-14', 'denise.kelly@sakilacustomer.org', 'Denise', 'Kelly', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '432', '2006-02-14', 'jesus.mccartney@sakilacustomer.org', 'Jesus', 'Mccartney', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '597', '2006-02-14', 'kent.arsenault@sakilacustomer.org', 'Kent', 'Arsenault', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '367', '2006-02-14', 'nicholas.barfield@sakilacustomer.org', 'Nicholas', 'Barfield', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '51', '2006-02-14', 'frances.parker@sakilacustomer.org', 'Frances', 'Parker', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '43', '2006-02-14', 'debra.nelson@sakilacustomer.org', 'Debra', 'Nelson', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '103', '2006-02-14', 'emily.diaz@sakilacustomer.org', 'Emily', 'Diaz', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '241', '2006-02-14', 'tanya.gilbert@sakilacustomer.org', 'Tanya', 'Gilbert', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '92', '2006-02-14', 'bonnie.hughes@sakilacustomer.org', 'Bonnie', 'Hughes', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '542', '2006-02-14', 'fernando.churchill@sakilacustomer.org', 'Fernando', 'Churchill', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '249', '2006-02-14', 'courtney.day@sakilacustomer.org', 'Courtney', 'Day', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '164', '2006-02-14', 'erin.dunn@sakilacustomer.org', 'Erin', 'Dunn', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '398', '2006-02-14', 'philip.causey@sakilacustomer.org', 'Philip', 'Causey', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '21', '2006-02-14', 'donna.thompson@sakilacustomer.org', 'Donna', 'Thompson', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '381', '2006-02-14', 'randy.gaither@sakilacustomer.org', 'Randy', 'Gaither', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '300', '2006-02-14', 'daisy.bates@sakilacustomer.org', 'Daisy', 'Bates', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '573', '2006-02-14', 'alfredo.mcadams@sakilacustomer.org', 'Alfredo', 'Mcadams', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '50', '2006-02-14', 'catherine.campbell@sakilacustomer.org', 'Catherine', 'Campbell', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '306', '2006-02-14', 'robert.baughman@sakilacustomer.org', 'Robert', 'Baughman', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '195', '2006-02-14', 'jeanette.greene@sakilacustomer.org', 'Jeanette', 'Greene', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '356', '2006-02-14', 'jack.foust@sakilacustomer.org', 'Jack', 'Foust', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '48', '2006-02-14', 'marie.turner@sakilacustomer.org', 'Marie', 'Turner', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '402', '2006-02-14', 'jimmy.schrader@sakilacustomer.org', 'Jimmy', 'Schrader', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '351', '2006-02-14', 'arthur.simpkins@sakilacustomer.org', 'Arthur', 'Simpkins', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '183', '2006-02-14', 'dana.hart@sakilacustomer.org', 'Dana', 'Hart', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '435', '2006-02-14', 'ray.houle@sakilacustomer.org', 'Ray', 'Houle', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '226', '2006-02-14', 'delores.hansen@sakilacustomer.org', 'Delores', 'Hansen', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '110', '2006-02-14', 'connie.wallace@sakilacustomer.org', 'Connie', 'Wallace', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '433', '2006-02-14', 'herbert.kruger@sakilacustomer.org', 'Herbert', 'Kruger', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '52', '2006-02-14', 'ann.evans@sakilacustomer.org', 'Ann', 'Evans', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '59', '2006-02-14', 'doris.reed@sakilacustomer.org', 'Doris', 'Reed', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '492', '2006-02-14', 'hector.poindexter@sakilacustomer.org', 'Hector', 'Poindexter', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '104', '2006-02-14', 'robin.hayes@sakilacustomer.org', 'Robin', 'Hayes', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '467', '2006-02-14', 'warren.sherrod@sakilacustomer.org', 'Warren', 'Sherrod', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '131', '2006-02-14', 'elaine.stevens@sakilacustomer.org', 'Elaine', 'Stevens', '2013-05-26T14:49:45.738000', 2), + (0, TRUE, '515', '2006-02-14', 'ben.easter@sakilacustomer.org', 'Ben', 'Easter', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '355', '2006-02-14', 'juan.fraley@sakilacustomer.org', 'Juan', 'Fraley', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '452', '2006-02-14', 'clifford.bowens@sakilacustomer.org', 'Clifford', 'Bowens', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '316', '2006-02-14', 'paul.trout@sakilacustomer.org', 'Paul', 'Trout', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '85', '2006-02-14', 'andrea.henderson@sakilacustomer.org', 'Andrea', 'Henderson', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '262', '2006-02-14', 'marsha.douglas@sakilacustomer.org', 'Marsha', 'Douglas', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '101', '2006-02-14', 'annie.russell@sakilacustomer.org', 'Annie', 'Russell', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '438', '2006-02-14', 'don.bone@sakilacustomer.org', 'Don', 'Bone', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '263', '2006-02-14', 'myrtle.fleming@sakilacustomer.org', 'Myrtle', 'Fleming', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '423', '2006-02-14', 'jeff.east@sakilacustomer.org', 'Jeff', 'East', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '442', '2006-02-14', 'randall.neumann@sakilacustomer.org', 'Randall', 'Neumann', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '436', '2006-02-14', 'joel.francisco@sakilacustomer.org', 'Joel', 'Francisco', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '460', '2006-02-14', 'jon.wiles@sakilacustomer.org', 'Jon', 'Wiles', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '340', '2006-02-14', 'gregory.mauldin@sakilacustomer.org', 'Gregory', 'Mauldin', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '519', '2006-02-14', 'duane.tubbs@sakilacustomer.org', 'Duane', 'Tubbs', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '243', '2006-02-14', 'minnie.romero@sakilacustomer.org', 'Minnie', 'Romero', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '207', '2006-02-14', 'tara.ryan@sakilacustomer.org', 'Tara', 'Ryan', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '333', '2006-02-14', 'jeffrey.spear@sakilacustomer.org', 'Jeffrey', 'Spear', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '511', '2006-02-14', 'leslie.seward@sakilacustomer.org', 'Leslie', 'Seward', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '455', '2006-02-14', 'jay.robb@sakilacustomer.org', 'Jay', 'Robb', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '548', '2006-02-14', 'lonnie.tirado@sakilacustomer.org', 'Lonnie', 'Tirado', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '120', '2006-02-14', 'victoria.gibson@sakilacustomer.org', 'Victoria', 'Gibson', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '377', '2006-02-14', 'steve.mackenzie@sakilacustomer.org', 'Steve', 'Mackenzie', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '463', '2006-02-14', 'lloyd.dowd@sakilacustomer.org', 'Lloyd', 'Dowd', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '416', '2006-02-14', 'norman.currier@sakilacustomer.org', 'Norman', 'Currier', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '478', '2006-02-14', 'jorge.olivares@sakilacustomer.org', 'Jorge', 'Olivares', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '530', '2006-02-14', 'jared.ely@sakilacustomer.org', 'Jared', 'Ely', '2013-05-26T14:49:45.738000', 1), + (1, TRUE, '157', '2006-02-14', 'suzanne.nichols@sakilacustomer.org', 'Suzanne', 'Nichols', '2013-05-26T14:49:45.738000', 2), + (1, TRUE, '505', '2006-02-14', 'reginald.kinder@sakilacustomer.org', 'Reginald', 'Kinder', '2013-05-26T14:49:45.738000', 1) + ) AS data(active, activebool, old_address_id, create_date, email, first_name, last_name, last_update, store_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."address"' + AND map0.old_id = data.old_address_id + RETURNING customer_id + ) + SELECT array_agg(customer_id) INTO v_new_ids_customer FROM inserted; + + FOR i IN 1..array_length(v_new_ids_customer, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."customer"', v_old_ids_customer[i], v_new_ids_customer[i]::TEXT); + END LOOP; + + -- Table: "public"."staff" (2 records) + v_old_ids_staff := ARRAY['1', '2']; + WITH inserted AS ( + INSERT INTO "public"."staff" ("active", "address_id", "email", "first_name", "last_name", "last_update", "password", "picture", "store_id", "username") + SELECT + data.active::boolean, + map0.new_id::smallint, + data.email::character varying, + data.first_name::character varying, + data.last_name::character varying, + data.last_update::timestamp without time zone, + data.password::character varying, + data.picture::bytea, + data.store_id::smallint, + data.username::character varying + FROM (VALUES + (TRUE, '3', 'Mike.Hillyer@sakilastaff.com', 'Mike', 'Hillyer', '2006-05-16T16:13:11.793280', '8cb2237d0679ca88db6464eac60da96345513964', '\x89504e470d0a5a0a', 1, 'Mike'), + (TRUE, '4', 'Jon.Stephens@sakilastaff.com', 'Jon', 'Stephens', '2006-05-16T16:13:11.793280', '8cb2237d0679ca88db6464eac60da96345513964', NULL, 2, 'Jon') + ) AS data(active, old_address_id, email, first_name, last_name, last_update, password, picture, store_id, username) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."address"' + AND map0.old_id = data.old_address_id + RETURNING staff_id + ) + SELECT array_agg(staff_id) INTO v_new_ids_staff FROM inserted; + + FOR i IN 1..array_length(v_new_ids_staff, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."staff"', v_old_ids_staff[i], v_new_ids_staff[i]::TEXT); + END LOOP; + + -- Table: "public"."rental" (16044 records) + v_old_ids_rental := ARRAY['13531', '7380', '8312', '15149', '11980', '6191', '15229', '4822', '15716', '12513', '4282', '4109', '5798', '5655', '7897', '15042', '4472', '4503', '7064', '9035', '6699', '7553', '16022', '3664', '1948', '12592', '15815', '3713', '7346', '13289', '10133', '7782', '5152', '12134', '4108', '7136', '15477', '13149', '15852', '14032', '3082', '60', '7166', '8983', '908', '3086', '788', '13510', '203', '4364', '7009', '14785', '1547', '4418', '12887', '8162', '12896', '4174', '476', '12265', '9641', '14362', '10621', '2856', '472', '12940', '3120', '1881', '9400', '13179', '9369', '5688', '4579', '63', '2070', '9997', '15269', '13372', '3770', '9309', '1359', '4588', '6435', '9623', '12652', '15066', '379', '447', '11570', '8823', '2176', '9363', '10834', '4488', '6076', '8468', '10871', '10613', '5269', '10904']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('156', '2778', '2006-02-16T02:30:53', '2005-08-20T03:26:10', '2005-08-25T03:41:10', '1'), + ('348', '988', '2006-02-16T02:30:53', '2005-07-27T15:37:01', '2005-08-03T19:24:01', '1'), + ('143', '3996', '2006-02-16T02:30:53', '2005-07-29T03:32:38', '2005-07-31T02:12:38', '1'), + ('537', '3059', '2006-02-16T02:30:53', '2005-08-22T14:08:06', '2005-08-25T08:25:06', '1'), + ('589', '4165', '2006-02-16T02:30:53', '2005-08-17T18:10:18', '2005-08-20T13:28:18', '1'), + ('480', '3448', '2006-02-16T02:30:53', '2005-07-11T11:37:52', '2005-07-17T12:45:52', '1'), + ('63', '320', '2006-02-16T02:30:53', '2005-08-22T17:30:25', '2005-08-23T14:13:25', '1'), + ('185', '3970', '2006-02-16T02:30:53', '2005-07-08T17:28:47', '2005-07-14T13:06:47', '1'), + ('408', '2812', '2006-02-16T02:30:53', '2005-08-23T11:02:00', '2005-08-28T14:46:00', '1'), + ('527', '29', '2006-02-16T02:30:53', '2005-08-18T13:31:45', '2005-08-25T08:26:45', '1'), + ('25', '3134', '2006-02-16T02:30:53', '2005-07-07T15:26:31', '2005-07-11T14:27:31', '1'), + ('517', '532', '2006-02-16T02:30:53', '2005-07-07T06:39:43', '2005-07-10T06:30:43', '1'), + ('107', '331', '2006-02-16T02:30:53', '2005-07-10T14:45:09', '2005-07-16T13:43:09', '1'), + ('113', '3470', '2006-02-16T02:30:53', '2005-07-10T07:31:06', '2005-07-17T08:22:06', '1'), + ('75', '1396', '2006-02-16T02:30:53', '2005-07-28T11:01:51', '2005-07-31T13:13:51', '1'), + ('553', '3796', '2006-02-16T02:30:53', '2005-08-22T09:47:37', '2005-08-31T04:42:37', '1'), + ('343', '2089', '2006-02-16T02:30:53', '2005-07-08T00:22:06', '2005-07-16T20:16:06', '1'), + ('8', '1503', '2006-02-16T02:30:53', '2005-07-08T02:17:12', '2005-07-13T08:12:12', '1'), + ('320', '4204', '2006-02-16T02:30:53', '2005-07-27T03:53:29', '2005-08-03T06:32:29', '1'), + ('243', '3785', '2006-02-16T02:30:53', '2005-07-30T06:16:07', '2005-08-06T09:22:07', '1'), + ('565', '3411', '2006-02-16T02:30:53', '2005-07-12T12:45:21', '2005-07-15T12:59:21', '1'), + ('275', '1643', '2006-02-16T02:30:53', '2005-07-27T22:11:36', '2005-08-03T17:52:36', '1'), + ('504', '2925', '2006-02-16T02:30:53', '2005-08-23T21:44:27', '2005-08-28T01:52:27', '1'), + ('528', '3366', '2006-02-16T02:30:53', '2005-07-06T08:15:57', '2005-07-08T06:11:57', '1'), + ('89', '46', '2006-02-16T02:30:53', '2005-06-17T08:06:53', '2005-06-21T05:00:53', '1'), + ('305', '1618', '2006-02-16T02:30:53', '2005-08-18T16:17:50', '2005-08-25T20:20:50', '1'), + ('444', '316', '2006-02-16T02:30:53', '2005-08-23T14:55:47', '2005-08-24T12:37:47', '1'), + ('504', '1823', '2006-02-16T02:30:53', '2005-07-06T10:49:30', '2005-07-13T10:44:30', '1'), + ('2', '741', '2006-02-16T02:30:53', '2005-07-27T14:30:42', '2005-08-02T16:48:42', '1'), + ('497', '3527', '2006-02-16T02:30:53', '2005-08-19T18:31:30', '2005-08-20T13:43:30', '1'), + ('234', '614', '2006-02-16T02:30:53', '2005-07-31T21:55:07', '2005-08-08T23:04:07', '1'), + ('199', '3770', '2006-02-16T02:30:53', '2005-07-28T07:13:40', '2005-08-05T06:50:40', '1'), + ('331', '4005', '2006-02-16T02:30:53', '2005-07-09T08:34:44', '2005-07-10T05:26:44', '1'), + ('288', '2682', '2006-02-16T02:30:53', '2005-08-17T23:49:43', '2005-08-21T21:00:43', '1'), + ('66', '4535', '2006-02-16T02:30:53', '2005-07-07T06:38:31', '2005-07-08T10:44:31', '1'), + ('6', '1929', '2006-02-16T02:30:53', '2005-07-27T06:38:25', '2005-08-03T05:13:25', '1'), + ('142', '2406', '2006-02-16T02:30:53', '2005-08-23T01:46:35', '2005-08-28T22:12:35', '1'), + ('40', '1436', '2006-02-16T02:30:53', '2005-08-19T13:07:12', '2005-08-28T18:12:12', '1'), + ('140', '1506', '2006-02-16T02:30:53', '2005-08-23T15:47:02', '2005-08-25T19:37:02', '1'), + ('317', '3542', '2006-02-16T02:30:53', '2005-08-20T21:26:55', '2005-08-26T19:19:55', '1'), + ('164', '4431', '2006-02-16T02:30:53', '2005-06-20T15:32:11', '2005-06-28T13:08:11', '1'), + ('470', '330', '2006-02-16T02:30:53', '2005-05-25T08:58:25', '2005-05-30T14:14:25', '1'), + ('562', '1375', '2006-02-16T02:30:53', '2005-07-27T07:36:56', '2005-08-02T03:46:56', '1'), + ('144', '1861', '2006-02-16T02:30:53', '2005-07-30T04:31:08', '2005-07-31T09:28:08', '1'), + ('85', '4427', '2006-02-16T02:30:53', '2005-05-30T10:38:37', '2005-06-03T09:56:37', '1'), + ('377', '4437', '2006-02-16T02:30:53', '2005-06-20T15:42:40', '2005-06-25T19:21:40', '1'), + ('562', '763', '2006-02-16T02:30:53', '2005-05-29T16:13:55', '2005-05-31T16:40:55', '1'), + ('107', '691', '2006-02-16T02:30:53', '2005-08-20T02:18:30', '2005-08-27T01:33:30', '1'), + ('109', '3374', '2006-02-16T02:30:53', '2005-05-26T07:27:57', '2005-06-03T12:52:57', '1'), + ('145', '10', '2006-02-16T02:30:53', '2005-07-07T19:46:51', '2005-07-08T21:55:51', '1'), + ('414', '1585', '2006-02-16T02:30:53', '2005-07-27T01:45:44', '2005-07-28T05:50:44', '1'), + ('560', '1981', '2006-02-16T02:30:53', '2005-08-22T00:24:37', '2005-08-25T04:15:37', '1'), + ('343', '2909', '2006-02-16T02:30:53', '2005-06-16T01:42:24', '2005-06-19T01:13:24', '1'), + ('417', '4368', '2006-02-16T02:30:53', '2005-07-07T22:05:30', '2005-07-11T18:42:30', '1'), + ('150', '1214', '2006-02-16T02:30:53', '2005-08-19T03:38:54', '2005-08-27T08:45:54', '1'), + ('107', '4393', '2006-02-16T02:30:53', '2005-07-28T21:11:46', '2005-08-04T18:26:46', '1'), + ('220', '148', '2006-02-16T02:30:53', '2005-08-19T03:52:44', '2005-08-24T22:27:44', '1'), + ('182', '3814', '2006-02-16T02:30:53', '2005-07-07T09:59:49', '2005-07-11T13:34:49', '1'), + ('543', '2451', '2006-02-16T02:30:53', '2005-05-27T22:31:36', '2005-06-03T19:12:36', '1'), + ('247', '537', '2006-02-16T02:30:53', '2005-08-18T04:22:01', '2005-08-20T03:22:01', '1'), + ('30', '1085', '2006-02-16T02:30:53', '2005-07-31T05:33:48', '2005-08-04T07:43:48', '1'), + ('312', '1992', '2006-02-16T02:30:53', '2005-08-21T09:19:49', '2005-08-26T11:06:49', '1'), + ('172', '1650', '2006-02-16T02:30:53', '2005-08-01T15:10:26', '2005-08-04T10:58:26', '1'), + ('210', '1859', '2006-02-16T02:30:53', '2005-06-19T23:13:04', '2005-06-23T22:47:04', '1'), + ('528', '1338', '2006-02-16T02:30:53', '2005-05-27T21:36:15', '2005-05-29T21:07:15', '1'), + ('340', '2222', '2006-02-16T02:30:53', '2005-08-19T05:38:29', '2005-08-20T08:15:29', '1'), + ('107', '2530', '2006-02-16T02:30:53', '2005-06-20T18:19:29', '2005-06-23T23:40:29', '1'), + ('134', '159', '2006-02-16T02:30:53', '2005-06-17T03:09:56', '2005-06-18T01:49:56', '1'), + ('368', '3910', '2006-02-16T02:30:53', '2005-07-30T20:15:58', '2005-08-03T21:21:58', '1'), + ('104', '1624', '2006-02-16T02:30:53', '2005-08-19T13:59:53', '2005-08-25T12:10:53', '1'), + ('36', '3538', '2006-02-16T02:30:53', '2005-07-30T18:52:19', '2005-08-01T12:53:19', '1'), + ('598', '3036', '2006-02-16T02:30:53', '2005-07-10T09:16:08', '2005-07-15T09:44:08', '1'), + ('585', '4290', '2006-02-16T02:30:53', '2005-07-08T06:01:56', '2005-07-13T11:24:56', '1'), + ('383', '4008', '2006-02-16T02:30:53', '2005-05-25T09:19:16', '2005-05-27T04:24:16', '1'), + ('24', '2609', '2006-02-16T02:30:53', '2005-06-17T16:27:51', '2005-06-20T20:46:51', '1'), + ('579', '640', '2006-02-16T02:30:53', '2005-07-31T17:37:30', '2005-08-02T14:49:30', '1'), + ('275', '524', '2006-02-16T02:30:53', '2005-08-22T18:39:44', '2005-08-24T17:29:44', '1'), + ('150', '3366', '2006-02-16T02:30:53', '2005-08-19T21:23:19', '2005-08-24T22:12:19', '1'), + ('198', '3836', '2006-02-16T02:30:53', '2005-07-06T13:14:28', '2005-07-13T09:23:28', '1'), + ('30', '3616', '2006-02-16T02:30:53', '2005-07-30T16:55:53', '2005-08-07T11:23:53', '1'), + ('353', '3140', '2006-02-16T02:30:53', '2005-06-15T13:30:30', '2005-06-17T14:55:30', '1'), + ('198', '3629', '2006-02-16T02:30:53', '2005-07-08T06:18:01', '2005-07-10T08:59:01', '1'), + ('561', '1957', '2006-02-16T02:30:53', '2005-07-12T00:16:19', '2005-07-17T19:15:19', '1'), + ('360', '113', '2006-02-16T02:30:53', '2005-07-31T04:30:02', '2005-08-06T23:34:02', '1'), + ('9', '2118', '2006-02-16T02:30:53', '2005-08-18T18:48:58', '2005-08-21T14:15:58', '1'), + ('530', '2712', '2006-02-16T02:30:53', '2005-08-22T10:49:06', '2005-08-23T10:25:06', '1'), + ('584', '3462', '2006-02-16T02:30:53', '2005-05-27T09:25:32', '2005-06-02T06:19:32', '1'), + ('133', '3890', '2006-02-16T02:30:53', '2005-05-27T18:57:02', '2005-06-05T18:38:02', '1'), + ('343', '2466', '2006-02-16T02:30:53', '2005-08-17T01:34:32', '2005-08-24T05:47:32', '1'), + ('75', '951', '2006-02-16T02:30:53', '2005-07-29T22:22:12', '2005-08-07T21:03:12', '1'), + ('282', '4201', '2006-02-16T02:30:53', '2005-06-18T00:29:51', '2005-06-21T01:41:51', '1'), + ('323', '873', '2006-02-16T02:30:53', '2005-07-30T18:44:23', '2005-08-04T15:03:23', '1'), + ('252', '2270', '2006-02-16T02:30:53', '2005-08-01T23:28:00', '2005-08-07T01:21:00', '1'), + ('89', '2108', '2006-02-16T02:30:53', '2005-07-08T01:22:23', '2005-07-13T21:17:23', '1'), + ('143', '1792', '2006-02-16T02:30:53', '2005-07-11T05:05:30', '2005-07-18T04:22:30', '1'), + ('282', '1338', '2006-02-16T02:30:53', '2005-07-29T08:26:04', '2005-08-02T07:18:04', '1'), + ('75', '104', '2006-02-16T02:30:53', '2005-08-02T00:27:24', '2005-08-05T06:25:24', '1'), + ('527', '4357', '2006-02-16T02:30:53', '2005-08-01T14:56:14', '2005-08-07T09:33:14', '1'), + ('230', '3886', '2006-02-16T02:30:53', '2005-07-09T14:23:05', '2005-07-17T14:03:05', '1'), + ('593', '3681', '2006-02-16T02:30:53', '2005-08-02T01:43:02', '2005-08-04T04:34:02', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['4719', '1244', '2057', '8020', '7679', '2182', '13885', '14148', '15804', '9577', '10542', '189', '10576', '5910', '2913', '2652', '8125', '7507', '3036', '10625', '4596', '10902', '3062', '242', '8476', '10271', '8734', '15983', '5086', '1594', '12927', '15919', '8773', '4973', '10479', '14700', '12883', '10323', '141', '6730', '14539', '13882', '337', '3098', '10255', '11044', '15733', '11259', '1860', '2705', '7639', '4392', '2832', '15471', '12838', '1477', '4176', '4042', '373', '5365', '2251', '31', '16045', '2467', '7937', '10740', '15176', '5825', '14310', '11821', '7889', '5231', '7202', '10400', '10963', '11736', '7271', '7274', '5334', '9349', '9455', '8524', '6527', '9217', '14258', '12933', '12625', '8200', '9105', '12980', '2042', '11575', '10677', '5880', '3712', '12598', '524', '8639', '221', '8877']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('556', '1315', '2006-02-16T02:30:53', '2005-07-08T12:33:00', '2005-07-15T12:30:00', '1'), + ('515', '1026', '2006-02-16T02:30:53', '2005-06-15T05:08:40', '2005-06-20T10:41:40', '1'), + ('190', '2803', '2006-02-16T02:30:53', '2005-06-17T15:31:58', '2005-06-25T09:39:58', '1'), + ('498', '4459', '2006-02-16T02:30:53', '2005-07-28T15:43:32', '2005-08-05T12:19:32', '1'), + ('444', '1063', '2006-02-16T02:30:53', '2005-07-28T02:58:39', '2005-08-02T04:58:39', '1'), + ('454', '3494', '2006-02-16T02:30:53', '2005-06-18T00:56:18', '2005-06-26T20:01:18', '1'), + ('537', '3195', '2006-02-16T02:30:53', '2005-08-20T15:32:09', '2005-08-26T15:54:09', '1'), + ('528', '1605', '2006-02-16T02:30:53', '2005-08-21T02:17:49', '2005-08-22T00:12:49', '1'), + ('585', '3338', '2006-02-16T02:30:53', '2005-08-23T14:29:16', '2005-08-26T08:41:16', '1'), + ('526', '2423', '2006-02-16T02:30:53', '2005-07-31T02:53:33', '2005-08-07T05:56:33', '1'), + ('465', '1102', '2006-02-16T02:30:53', '2005-08-01T12:32:23', '2005-08-08T16:26:23', '1'), + ('247', '984', '2006-02-16T02:30:53', '2005-05-26T06:01:41', '2005-05-27T06:11:41', '1'), + ('180', '1876', '2006-02-16T02:30:53', '2005-08-01T13:46:02', '2005-08-05T10:19:02', '1'), + ('464', '1039', '2006-02-16T02:30:53', '2005-07-10T20:51:34', '2005-07-19T14:54:34', '1'), + ('402', '3456', '2006-02-16T02:30:53', '2005-06-20T03:42:27', '2005-06-23T04:47:27', '1'), + ('589', '3108', '2006-02-16T02:30:53', '2005-06-19T10:35:26', '2005-06-28T08:03:26', '1'), + ('96', '4330', '2006-02-16T02:30:53', '2005-07-28T19:31:48', '2005-07-30T01:09:48', '1'), + ('512', '3618', '2006-02-16T02:30:53', '2005-07-27T20:31:48', '2005-08-02T17:27:48', '1'), + ('399', '4463', '2006-02-16T02:30:53', '2005-06-20T12:18:31', '2005-06-29T09:52:31', '1'), + ('5', '3022', '2006-02-16T02:30:53', '2005-08-01T15:27:10', '2005-08-02T13:16:10', '1'), + ('306', '2280', '2006-02-16T02:30:53', '2005-07-08T06:41:25', '2005-07-14T01:36:25', '1'), + ('486', '3863', '2006-02-16T02:30:53', '2005-08-02T01:35:46', '2005-08-09T01:59:46', '1'), + ('75', '591', '2006-02-16T02:30:53', '2005-06-20T13:50:00', '2005-06-27T08:18:00', '1'), + ('214', '2095', '2006-02-16T02:30:53', '2005-05-26T13:05:08', '2005-06-02T15:26:08', '1'), + ('470', '3741', '2006-02-16T02:30:53', '2005-07-29T08:39:12', '2005-08-06T03:03:12', '1'), + ('6', '3692', '2006-02-16T02:30:53', '2005-08-01T03:13:39', '2005-08-07T23:40:39', '1'), + ('303', '2374', '2006-02-16T02:30:53', '2005-07-29T18:28:15', '2005-08-05T23:38:15', '1'), + ('464', '3318', '2006-02-16T02:30:53', '2005-08-23T20:13:38', '2005-08-30T18:42:38', '1'), + ('539', '3072', '2006-02-16T02:30:53', '2005-07-09T05:40:04', '2005-07-16T07:51:04', '1'), + ('470', '3858', '2006-02-16T02:30:53', '2005-06-16T05:15:12', '2005-06-25T00:38:12', '1'), + ('223', '1171', '2006-02-16T02:30:53', '2005-08-19T05:02:46', '2005-08-23T01:08:46', '1'), + ('497', '1746', '2006-02-16T02:30:53', '2005-08-23T18:01:31', '2005-08-24T16:27:31', '1'), + ('592', '131', '2006-02-16T02:30:53', '2005-07-29T19:55:34', '2005-07-30T14:11:34', '1'), + ('432', '391', '2006-02-16T02:30:53', '2005-07-08T23:58:18', '2005-07-14T21:42:18', '1'), + ('275', '4580', '2006-02-16T02:30:53', '2005-08-01T10:11:25', '2005-08-06T04:52:25', '1'), + ('360', '3446', '2006-02-16T02:30:53', '2005-08-21T20:53:40', '2005-08-23T22:01:40', '1'), + ('555', '964', '2006-02-16T02:30:53', '2005-08-19T03:33:47', '2005-08-23T21:55:47', '1'), + ('577', '3539', '2006-02-16T02:30:53', '2005-08-01T04:44:58', '2005-08-06T07:56:58', '1'), + ('89', '811', '2006-02-16T02:30:53', '2005-05-25T23:34:53', '2005-06-02T01:57:53', '1'), + ('532', '1552', '2006-02-16T02:30:53', '2005-07-12T13:58:25', '2005-07-20T13:01:25', '1'), + ('41', '3340', '2006-02-16T02:30:53', '2005-08-21T15:29:47', '2005-08-28T19:01:47', '1'), + ('51', '3245', '2006-02-16T02:30:53', '2005-08-20T15:23:26', '2005-08-22T13:03:26', '1'), + ('19', '751', '2006-02-16T02:30:53', '2005-05-27T03:22:30', '2005-06-02T03:27:30', '1'), + ('498', '3409', '2006-02-16T02:30:53', '2005-06-20T16:37:01', '2005-06-22T22:24:01', '1'), + ('459', '4558', '2006-02-16T02:30:53', '2005-08-01T02:46:13', '2005-08-03T05:54:13', '1'), + ('122', '2922', '2006-02-16T02:30:53', '2005-08-02T06:05:27', '2005-08-06T05:15:27', '1'), + ('512', '4185', '2006-02-16T02:30:53', '2005-08-23T11:37:32', '2005-08-28T16:27:32', '1'), + ('330', '896', '2006-02-16T02:30:53', '2005-08-02T13:46:30', '2005-08-07T14:03:30', '1'), + ('293', '1853', '2006-02-16T02:30:53', '2005-06-17T01:17:12', '2005-06-21T22:35:12', '1'), + ('562', '1191', '2006-02-16T02:30:53', '2005-06-19T13:54:30', '2005-06-20T12:31:30', '1'), + ('459', '767', '2006-02-16T02:30:53', '2005-07-28T01:14:36', '2005-07-29T00:19:36', '1'), + ('491', '4236', '2006-02-16T02:30:53', '2005-07-07T21:11:02', '2005-07-13T21:52:02', '1'), + ('593', '828', '2006-02-16T02:30:53', '2005-06-19T21:21:53', '2005-06-28T23:00:53', '1'), + ('139', '2591', '2006-02-16T02:30:53', '2005-08-23T01:38:48', '2005-08-31T19:47:48', '1'), + ('308', '1207', '2006-02-16T02:30:53', '2005-08-19T01:51:50', '2005-08-27T23:12:50', '1'), + ('51', '418', '2006-02-16T02:30:53', '2005-06-15T21:11:18', '2005-06-19T02:05:18', '1'), + ('420', '2745', '2006-02-16T02:30:53', '2005-07-07T10:03:34', '2005-07-16T08:43:34', '1'), + ('10', '50', '2006-02-16T02:30:53', '2005-07-07T03:06:40', '2005-07-10T02:37:40', '1'), + ('464', '1649', '2006-02-16T02:30:53', '2005-05-27T08:16:25', '2005-06-01T11:41:25', '1'), + ('527', '4469', '2006-02-16T02:30:53', '2005-07-09T18:27:00', '2005-07-11T14:18:00', '1'), + ('143', '1458', '2006-02-16T02:30:53', '2005-06-18T05:05:08', '2005-06-23T08:34:08', '1'), + ('369', '4482', '2006-02-16T02:30:53', '2005-05-25T04:05:17', '2005-05-30T07:15:17', '1'), + ('14', '772', '2006-02-16T02:30:53', '2005-08-23T22:25:26', '2005-08-25T23:54:26', '1'), + ('177', '4387', '2006-02-16T02:30:53', '2005-06-18T20:20:05', '2005-06-20T17:01:05', '1'), + ('323', '3944', '2006-02-16T02:30:53', '2005-07-28T12:38:22', '2005-07-29T09:19:22', '1'), + ('144', '3215', '2006-02-16T02:30:53', '2005-08-01T19:50:32', '2005-08-07T23:25:32', '1'), + ('115', '3063', '2006-02-16T02:30:53', '2005-08-22T15:30:25', '2005-08-31T20:00:25', '1'), + ('444', '3843', '2006-02-16T02:30:53', '2005-07-10T16:20:30', '2005-07-11T18:58:30', '1'), + ('177', '95', '2006-02-16T02:30:53', '2005-08-21T07:44:32', '2005-08-22T09:02:32', '1'), + ('20', '2711', '2006-02-16T02:30:53', '2005-08-17T12:27:55', '2005-08-18T07:07:55', '1'), + ('416', '3123', '2006-02-16T02:30:53', '2005-07-28T10:43:21', '2005-07-30T09:11:21', '1'), + ('405', '1275', '2006-02-16T02:30:53', '2005-07-09T12:35:02', '2005-07-10T09:22:02', '1'), + ('560', '109', '2006-02-16T02:30:53', '2005-07-27T09:00:20', '2005-08-04T03:09:20', '1'), + ('132', '3897', '2006-02-16T02:30:53', '2005-08-01T07:18:24', '2005-08-10T08:38:24', '1'), + ('36', '4501', '2006-02-16T02:30:53', '2005-08-02T03:48:17', '2005-08-02T22:15:17', '1'), + ('535', '4217', '2006-02-16T02:30:53', '2005-08-17T08:40:55', '2005-08-26T09:03:55', '1'), + ('469', '858', '2006-02-16T02:30:53', '2005-07-27T11:29:11', '2005-08-05T15:33:11', '1'), + ('180', '4087', '2006-02-16T02:30:53', '2005-07-27T11:35:34', '2005-08-01T07:10:34', '1'), + ('482', '3852', '2006-02-16T02:30:53', '2005-07-09T17:00:13', '2005-07-11T15:50:13', '1'), + ('579', '3739', '2006-02-16T02:30:53', '2005-07-30T18:20:08', '2005-08-08T22:06:08', '1'), + ('220', '2647', '2006-02-16T02:30:53', '2005-07-30T22:20:29', '2005-08-08T20:08:29', '1'), + ('124', '2110', '2006-02-16T02:30:53', '2005-07-29T10:20:07', '2005-08-03T04:30:07', '1'), + ('65', '538', '2006-02-16T02:30:53', '2005-07-12T04:23:06', '2005-07-17T00:20:06', '1'), + ('112', '1561', '2006-02-16T02:30:53', '2005-07-30T13:13:55', '2005-08-05T17:27:55', '1'), + ('359', '752', '2006-02-16T02:30:53', '2005-08-21T05:56:36', '2005-08-26T06:14:36', '1'), + ('589', '4103', '2006-02-16T02:30:53', '2005-08-19T05:18:20', '2005-08-27T00:13:20', '1'), + ('108', '2645', '2006-02-16T02:30:53', '2005-08-18T17:36:19', '2005-08-23T11:42:19', '1'), + ('185', '353', '2006-02-16T02:30:53', '2005-07-28T23:10:46', '2005-07-29T18:35:46', '1'), + ('262', '4443', '2006-02-16T02:30:53', '2005-07-30T08:50:25', '2005-08-05T06:08:25', '1'), + ('144', '1854', '2006-02-16T02:30:53', '2005-08-19T07:03:14', '2005-08-26T05:07:14', '1'), + ('84', '3102', '2006-02-16T02:30:53', '2005-06-17T14:31:02', '2005-06-18T14:43:02', '1'), + ('319', '1725', '2006-02-16T02:30:53', '2005-08-17T01:50:26', '2005-08-18T00:43:26', '1'), + ('483', '4350', '2006-02-16T02:30:53', '2005-08-01T17:24:35', '2005-08-04T20:03:35', '1'), + ('482', '359', '2006-02-16T02:30:53', '2005-07-10T19:14:58', '2005-07-17T01:13:58', '1'), + ('504', '3741', '2006-02-16T02:30:53', '2005-07-06T10:47:35', '2005-07-15T09:39:35', '1'), + ('340', '3159', '2006-02-16T02:30:53', '2005-08-18T16:34:03', '2005-08-22T16:44:03', '1'), + ('223', '1962', '2006-02-16T02:30:53', '2005-05-28T03:57:28', '2005-05-31T05:20:28', '1'), + ('290', '3504', '2006-02-16T02:30:53', '2005-07-29T14:30:31', '2005-08-02T16:04:31', '1'), + ('143', '3578', '2006-02-16T02:30:53', '2005-05-26T10:14:09', '2005-05-29T05:57:09', '1'), + ('417', '1140', '2006-02-16T02:30:53', '2005-07-30T00:15:22', '2005-07-31T00:53:22', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['2168', '3573', '15029', '10266', '3165', '15357', '4628', '4120', '12711', '11064', '3227', '3196', '3525', '10038', '11256', '6380', '13251', '14358', '10101', '1209', '2028', '6995', '11556', '122', '8778', '11789', '762', '10151', '4635', '7737', '9316', '7333', '4133', '2924', '14843', '8353', '7976', '11955', '3793', '6911', '10926', '9514', '4840', '6496', '15651', '187', '7465', '13513', '8978', '13624', '2897', '11590', '1581', '3290', '4437', '11961', '2614', '15521', '3977', '11552', '6820', '3495', '9250', '166', '9347', '5380', '8030', '8050', '14562', '10299', '9139', '12144', '4396', '14567', '7674', '11275', '11133', '11084', '3586', '7836', '1203', '11707', '3923', '13373', '4560', '10626', '7250', '9646', '7883', '14953', '6294', '8513', '1647', '3325', '6432', '10183', '15672', '2244', '833', '16023']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('308', '802', '2006-02-16T02:30:53', '2005-06-17T23:53:24', '2005-06-20T01:11:24', '1'), + ('66', '146', '2006-02-16T02:30:53', '2005-07-06T03:33:48', '2005-07-07T22:39:48', '1'), + ('139', '2234', '2006-02-16T02:30:53', '2005-08-22T09:04:53', '2005-08-25T09:03:53', '1'), + ('49', '476', '2006-02-16T02:30:53', '2005-08-01T03:05:59', '2005-08-06T06:23:59', '1'), + ('85', '796', '2006-02-16T02:30:53', '2005-06-20T21:29:17', '2005-06-22T18:03:17', '1'), + ('24', '727', '2006-02-16T02:30:53', '2005-08-22T21:28:59', '2005-08-25T17:15:59', '1'), + ('540', '1888', '2006-02-16T02:30:53', '2005-07-08T08:25:52', '2005-07-10T11:22:52', '1'), + ('559', '987', '2006-02-16T02:30:53', '2005-07-07T07:07:03', '2005-07-16T04:07:03', '1'), + ('122', '2530', '2006-02-16T02:30:53', '2005-08-18T21:03:32', '2005-08-26T17:31:32', '1'), + ('338', '3012', '2006-02-16T02:30:53', '2005-08-02T06:55:17', '2005-08-06T03:29:17', '1'), + ('568', '1156', '2006-02-16T02:30:53', '2005-06-21T02:18:25', '2005-06-27T00:59:25', '1'), + ('52', '1575', '2006-02-16T02:30:53', '2005-06-21T00:02:28', '2005-06-22T23:08:28', '1'), + ('51', '208', '2006-02-16T02:30:53', '2005-07-06T01:02:39', '2005-07-14T02:27:39', '1'), + ('112', '3727', '2006-02-16T02:30:53', '2005-07-31T18:49:12', '2005-08-01T18:02:12', '1'), + ('2', '2060', '2006-02-16T02:30:53', '2005-08-02T13:44:53', '2005-08-04T16:39:53', '1'), + ('172', '3378', '2006-02-16T02:30:53', '2005-07-11T21:55:40', '2005-07-17T20:42:40', '1'), + ('111', '4216', '2006-02-16T02:30:53', '2005-08-19T16:48:37', '2005-08-20T16:33:37', '1'), + ('112', '861', '2006-02-16T02:30:53', '2005-08-21T09:14:28', '2005-08-24T05:05:28', '1'), + ('119', '2513', '2006-02-16T02:30:53', '2005-07-31T20:47:29', '2005-08-04T21:28:29', '1'), + ('146', '1494', '2006-02-16T02:30:53', '2005-06-15T02:31:12', '2005-06-21T07:39:12', '1'), + ('155', '4451', '2006-02-16T02:30:53', '2005-06-17T13:08:08', '2005-06-23T10:54:08', '1'), + ('66', '1630', '2006-02-16T02:30:53', '2005-07-27T01:12:13', '2005-07-29T21:26:13', '1'), + ('9', '373', '2006-02-16T02:30:53', '2005-08-17T01:11:53', '2005-08-18T23:41:53', '1'), + ('273', '2908', '2006-02-16T02:30:53', '2005-05-25T19:46:21', '2005-06-02T19:07:21', '1'), + ('582', '3654', '2006-02-16T02:30:53', '2005-07-29T20:14:25', '2005-08-04T00:50:25', '1'), + ('150', '851', '2006-02-16T02:30:53', '2005-08-17T10:59:24', '2005-08-26T16:17:24', '1'), + ('146', '3683', '2006-02-16T02:30:53', '2005-05-29T11:15:51', '2005-06-06T07:48:51', '1'), + ('361', '4442', '2006-02-16T02:30:53', '2005-07-31T22:22:37', '2005-08-01T22:20:37', '1'), + ('65', '2434', '2006-02-16T02:30:53', '2005-07-08T08:42:40', '2005-07-14T10:31:40', '1'), + ('494', '1235', '2006-02-16T02:30:53', '2005-07-28T05:15:03', '2005-08-04T01:24:03', '1'), + ('366', '4409', '2006-02-16T02:30:53', '2005-07-30T17:11:58', '2005-08-05T14:36:58', '1'), + ('230', '1331', '2006-02-16T02:30:53', '2005-07-27T13:59:11', '2005-07-30T16:04:11', '1'), + ('488', '3672', '2006-02-16T02:30:53', '2005-07-07T08:12:26', '2005-07-16T03:43:26', '1'), + ('132', '580', '2006-02-16T02:30:53', '2005-06-20T04:20:14', '2005-06-21T01:13:14', '1'), + ('454', '3000', '2006-02-16T02:30:53', '2005-08-22T02:05:25', '2005-08-28T22:11:25', '1'), + ('585', '26', '2006-02-16T02:30:53', '2005-07-29T04:52:10', '2005-07-30T04:01:10', '1'), + ('205', '2296', '2006-02-16T02:30:53', '2005-07-28T14:13:24', '2005-08-05T09:01:24', '1'), + ('319', '1221', '2006-02-16T02:30:53', '2005-08-17T17:21:35', '2005-08-24T22:06:35', '1'), + ('553', '4558', '2006-02-16T02:30:53', '2005-07-06T14:32:44', '2005-07-08T13:55:44', '1'), + ('361', '901', '2006-02-16T02:30:53', '2005-07-12T22:14:34', '2005-07-18T20:17:34', '1'), + ('460', '4016', '2006-02-16T02:30:53', '2005-08-02T02:26:37', '2005-08-09T20:55:37', '1'), + ('243', '1892', '2006-02-16T02:30:53', '2005-07-31T00:29:44', '2005-08-02T23:49:44', '1'), + ('119', '1670', '2006-02-16T02:30:53', '2005-07-08T18:18:16', '2005-07-16T14:59:16', '1'), + ('139', '3550', '2006-02-16T02:30:53', '2005-07-12T02:57:39', '2005-07-20T01:43:39', '1'), + ('451', '3393', '2006-02-16T02:30:53', '2005-08-23T08:31:49', '2005-08-26T02:57:49', '1'), + ('515', '4004', '2006-02-16T02:30:53', '2005-05-26T05:42:37', '2005-06-04T00:38:37', '1'), + ('115', '2357', '2006-02-16T02:30:53', '2005-07-27T18:50:30', '2005-07-30T20:55:30', '1'), + ('454', '1653', '2006-02-16T02:30:53', '2005-08-20T02:27:53', '2005-08-22T06:10:53', '1'), + ('5', '711', '2006-02-16T02:30:53', '2005-07-30T04:14:28', '2005-08-06T09:08:28', '1'), + ('63', '430', '2006-02-16T02:30:53', '2005-08-20T06:51:02', '2005-08-29T02:39:02', '1'), + ('107', '3464', '2006-02-16T02:30:53', '2005-06-20T02:34:23', '2005-06-25T05:29:23', '1'), + ('491', '3600', '2006-02-16T02:30:53', '2005-08-17T02:28:33', '2005-08-20T03:13:33', '1'), + ('109', '4004', '2006-02-16T02:30:53', '2005-06-16T04:28:45', '2005-06-18T07:07:45', '1'), + ('293', '2727', '2006-02-16T02:30:53', '2005-06-21T06:45:34', '2005-06-28T09:44:34', '1'), + ('414', '3578', '2006-02-16T02:30:53', '2005-07-07T22:55:41', '2005-07-13T19:40:41', '1'), + ('276', '2015', '2006-02-16T02:30:53', '2005-08-17T17:28:01', '2005-08-21T20:43:01', '1'), + ('145', '4147', '2006-02-16T02:30:53', '2005-06-19T07:28:11', '2005-06-22T12:33:11', '1'), + ('331', '134', '2006-02-16T02:30:53', '2005-08-23T03:30:51', '2005-08-28T22:09:51', '1'), + ('449', '1284', '2006-02-16T02:30:53', '2005-07-06T23:00:49', '2005-07-15T00:41:49', '1'), + ('230', '1143', '2006-02-16T02:30:53', '2005-08-17T01:04:29', '2005-08-23T23:07:29', '1'), + ('243', '223', '2006-02-16T02:30:53', '2005-07-12T18:21:30', '2005-07-14T15:14:30', '1'), + ('553', '2306', '2006-02-16T02:30:53', '2005-07-05T23:50:04', '2005-07-10T01:06:04', '1'), + ('539', '4544', '2006-02-16T02:30:53', '2005-07-30T14:18:16', '2005-08-04T12:31:16', '1'), + ('322', '3894', '2006-02-16T02:30:53', '2005-05-26T02:49:11', '2005-05-31T01:28:11', '1'), + ('479', '3557', '2006-02-16T02:30:53', '2005-07-30T18:16:03', '2005-08-05T18:35:03', '1'), + ('166', '3047', '2006-02-16T02:30:53', '2005-07-09T19:08:44', '2005-07-11T20:09:44', '1'), + ('30', '2633', '2006-02-16T02:30:53', '2005-07-28T16:12:53', '2005-07-31T17:15:53', '1'), + ('488', '1864', '2006-02-16T02:30:53', '2005-07-28T16:55:47', '2005-08-02T13:20:47', '1'), + ('107', '3501', '2006-02-16T02:30:53', '2005-08-21T16:22:59', '2005-08-22T21:15:59', '1'), + ('369', '1125', '2006-02-16T02:30:53', '2005-08-01T04:08:04', '2005-08-04T08:11:04', '1'), + ('133', '2809', '2006-02-16T02:30:53', '2005-07-30T10:11:52', '2005-08-03T12:44:52', '1'), + ('587', '512', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('275', '750', '2006-02-16T02:30:53', '2005-07-07T21:14:19', '2005-07-10T19:22:19', '1'), + ('214', '3805', '2006-02-16T02:30:53', '2005-08-21T16:27:25', '2005-08-26T10:47:25', '1'), + ('177', '682', '2006-02-16T02:30:53', '2005-07-28T02:54:30', '2005-08-05T23:09:30', '1'), + ('464', '2838', '2006-02-16T02:30:53', '2005-08-02T14:25:58', '2005-08-07T11:20:58', '1'), + ('120', '675', '2006-02-16T02:30:53', '2005-08-02T09:15:45', '2005-08-04T10:39:45', '1'), + ('369', '32', '2006-02-16T02:30:53', '2005-08-02T07:34:19', '2005-08-07T09:30:19', '1'), + ('493', '616', '2006-02-16T02:30:53', '2005-07-06T04:24:42', '2005-07-09T02:37:42', '1'), + ('481', '1770', '2006-02-16T02:30:53', '2005-07-28T08:55:27', '2005-08-05T09:35:27', '1'), + ('452', '2223', '2006-02-16T02:30:53', '2005-06-15T02:09:02', '2005-06-21T00:04:02', '1'), + ('581', '1030', '2006-02-16T02:30:53', '2005-08-17T07:24:59', '2005-08-24T10:40:59', '1'), + ('63', '2039', '2006-02-16T02:30:53', '2005-07-06T20:34:10', '2005-07-13T19:20:10', '1'), + ('7', '4045', '2006-02-16T02:30:53', '2005-08-19T21:23:31', '2005-08-25T22:38:31', '1'), + ('36', '303', '2006-02-16T02:30:53', '2005-07-08T04:58:48', '2005-07-10T04:27:48', '1'), + ('122', '1042', '2006-02-16T02:30:53', '2005-08-01T15:32:41', '2005-08-05T18:08:41', '1'), + ('589', '3410', '2006-02-16T02:30:53', '2005-07-27T10:44:09', '2005-07-28T11:47:09', '1'), + ('89', '3756', '2006-02-16T02:30:53', '2005-07-31T05:43:28', '2005-08-08T04:00:28', '1'), + ('526', '447', '2006-02-16T02:30:53', '2005-07-28T10:37:20', '2005-08-02T05:08:20', '1'), + ('182', '816', '2006-02-16T02:30:53', '2005-08-22T06:23:54', '2005-08-28T03:19:54', '1'), + ('463', '1732', '2006-02-16T02:30:53', '2005-07-11T17:25:55', '2005-07-15T17:48:55', '1'), + ('142', '3156', '2006-02-16T02:30:53', '2005-07-29T09:52:59', '2005-07-31T12:05:59', '1'), + ('454', '1936', '2006-02-16T02:30:53', '2005-06-16T09:14:58', '2005-06-17T10:46:58', '1'), + ('185', '1720', '2006-02-16T02:30:53', '2005-06-21T08:51:44', '2005-06-27T06:16:44', '1'), + ('293', '970', '2006-02-16T02:30:53', '2005-07-12T00:09:41', '2005-07-20T20:06:41', '1'), + ('377', '4319', '2006-02-16T02:30:53', '2005-08-01T00:08:01', '2005-08-09T20:41:01', '1'), + ('210', '701', '2006-02-16T02:30:53', '2005-08-23T09:09:18', '2005-08-27T06:19:18', '1'), + ('233', '3629', '2006-02-16T02:30:53', '2005-06-18T04:46:33', '2005-06-20T04:28:33', '1'), + ('417', '2898', '2006-02-16T02:30:53', '2005-05-29T23:21:56', '2005-06-02T18:40:56', '1'), + ('124', '2347', '2006-02-16T02:30:53', '2005-08-23T21:45:02', '2005-08-24T21:28:02', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['15428', '2870', '6068', '354', '4402', '4280', '13901', '15213', '9026', '11383', '5374', '2493', '2720', '10002', '11274', '11316', '4105', '13233', '4762', '12683', '13963', '7196', '4483', '8542', '11197', '10601', '1109', '15828', '324', '10631', '5715', '1468', '10925', '14817', '2165', '11351', '15089', '11557', '12581', '3452', '14702', '9075', '13715', '1587', '13548', '4020', '12630', '6905', '10495', '4430', '15417', '2845', '2211', '10742', '3', '7386', '200', '1144', '11953', '3572', '8739', '2794', '15236', '13378', '10548', '5124', '12101', '10516', '11520', '4972', '11622', '8620', '12905', '4233', '1888', '13500', '12248', '2457', '1649', '1466', '9834', '13408', '7914', '9733', '7636', '6635', '7194', '12173', '10096', '12950', '7600', '15161', '9713', '6702', '2237', '4135', '7539', '2674', '10919', '11045']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('402', '4379', '2006-02-16T02:30:53', '2005-08-23T00:11:52', '2005-08-24T02:35:52', '1'), + ('467', '214', '2006-02-16T02:30:53', '2005-06-20T00:17:46', '2005-06-28T20:21:46', '1'), + ('265', '2331', '2006-02-16T02:30:53', '2005-07-11T04:41:09', '2005-07-14T04:45:09', '1'), + ('452', '2058', '2006-02-16T02:30:53', '2005-05-27T06:12:26', '2005-06-01T06:48:26', '1'), + ('26', '1198', '2006-02-16T02:30:53', '2005-07-07T21:28:46', '2005-07-08T17:04:46', '1'), + ('593', '1115', '2006-02-16T02:30:53', '2005-07-07T15:09:31', '2005-07-13T14:47:31', '1'), + ('166', '3281', '2006-02-16T02:30:53', '2005-08-20T16:06:53', '2005-08-28T11:30:53', '1'), + ('166', '2002', '2006-02-16T02:30:53', '2005-08-22T16:49:02', '2005-08-31T20:22:02', '1'), + ('423', '1524', '2006-02-16T02:30:53', '2005-07-30T05:55:31', '2005-08-01T03:19:31', '1'), + ('445', '257', '2006-02-16T02:30:53', '2005-08-02T18:22:05', '2005-08-11T17:18:05', '1'), + ('144', '946', '2006-02-16T02:30:53', '2005-07-09T18:52:08', '2005-07-16T16:34:08', '1'), + ('269', '4121', '2006-02-16T02:30:53', '2005-06-18T22:12:09', '2005-06-27T23:44:09', '1'), + ('504', '3597', '2006-02-16T02:30:53', '2005-06-19T14:51:55', '2005-06-27T13:06:55', '1'), + ('323', '1002', '2006-02-16T02:30:53', '2005-07-31T17:48:16', '2005-08-06T16:15:16', '1'), + ('70', '1253', '2006-02-16T02:30:53', '2005-08-02T14:24:08', '2005-08-11T14:56:08', '1'), + ('108', '521', '2006-02-16T02:30:53', '2005-08-02T16:07:49', '2005-08-10T13:22:49', '1'), + ('423', '439', '2006-02-16T02:30:53', '2005-07-07T06:31:00', '2005-07-09T03:52:00', '1'), + ('279', '1057', '2006-02-16T02:30:53', '2005-08-19T16:14:41', '2005-08-24T21:13:41', '1'), + ('36', '390', '2006-02-16T02:30:53', '2005-07-08T14:54:42', '2005-07-12T18:08:42', '1'), + ('166', '1802', '2006-02-16T02:30:53', '2005-08-18T19:50:43', '2005-08-26T00:47:43', '1'), + ('368', '4145', '2006-02-16T02:30:53', '2005-08-20T18:20:18', '2005-08-24T21:26:18', '1'), + ('118', '2998', '2006-02-16T02:30:53', '2005-07-27T08:49:08', '2005-07-29T03:54:08', '1'), + ('425', '1222', '2006-02-16T02:30:53', '2005-07-08T01:03:12', '2005-07-17T00:20:12', '1'), + ('213', '792', '2006-02-16T02:30:53', '2005-07-29T11:01:50', '2005-07-30T08:19:50', '1'), + ('122', '3041', '2006-02-16T02:30:53', '2005-08-02T11:45:07', '2005-08-03T09:07:07', '1'), + ('420', '2843', '2006-02-16T02:30:53', '2005-08-01T14:25:40', '2005-08-10T09:07:40', '1'), + ('481', '2031', '2006-02-16T02:30:53', '2005-05-31T15:12:15', '2005-06-09T16:21:15', '1'), + ('327', '428', '2006-02-16T02:30:53', '2005-08-23T15:16:32', '2005-08-29T12:20:32', '1'), + ('292', '3364', '2006-02-16T02:30:53', '2005-05-27T01:00:04', '2005-05-30T04:27:04', '1'), + ('304', '2712', '2006-02-16T02:30:53', '2005-08-01T15:35:14', '2005-08-03T10:48:14', '1'), + ('132', '1638', '2006-02-16T02:30:53', '2005-07-10T10:48:03', '2005-07-18T11:27:03', '1'), + ('230', '228', '2006-02-16T02:30:53', '2005-06-15T20:48:22', '2005-06-21T19:48:22', '1'), + ('98', '1475', '2006-02-16T02:30:53', '2005-08-02T02:24:38', '2005-08-03T05:06:38', '1'), + ('215', '910', '2006-02-16T02:30:53', '2005-08-22T01:17:16', '2005-08-27T02:43:16', '1'), + ('471', '2392', '2006-02-16T02:30:53', '2005-06-17T23:51:10', '2005-06-21T23:54:10', '1'), + ('198', '242', '2006-02-16T02:30:53', '2005-08-02T17:28:07', '2005-08-09T21:55:07', '1'), + ('61', '3288', '2006-02-16T02:30:53', '2005-08-22T11:34:06', '2005-08-31T12:45:06', '1'), + ('416', '2376', '2006-02-16T02:30:53', '2005-08-17T01:19:20', '2005-08-24T02:25:20', '1'), + ('70', '4309', '2006-02-16T02:30:53', '2005-08-18T15:49:15', '2005-08-23T20:18:15', '1'), + ('293', '2646', '2006-02-16T02:30:53', '2005-06-21T21:11:27', '2005-06-24T16:31:27', '1'), + ('345', '4096', '2006-02-16T02:30:53', '2005-08-21T21:00:03', '2005-08-30T16:59:03', '1'), + ('20', '1931', '2006-02-16T02:30:53', '2005-07-30T07:55:14', '2005-08-02T13:49:14', '1'), + ('292', '1028', '2006-02-16T02:30:53', '2005-08-20T09:43:06', '2005-08-27T10:22:06', '1'), + ('62', '1781', '2006-02-16T02:30:53', '2005-06-16T04:52:28', '2005-06-23T07:36:28', '1'), + ('319', '4389', '2006-02-16T02:30:53', '2005-08-20T03:53:20', '2005-08-27T21:54:20', '1'), + ('471', '3760', '2006-02-16T02:30:53', '2005-07-07T01:42:22', '2005-07-10T00:53:22', '1'), + ('452', '1457', '2006-02-16T02:30:53', '2005-08-18T17:49:28', '2005-08-24T12:23:28', '1'), + ('25', '763', '2006-02-16T02:30:53', '2005-07-12T22:02:18', '2005-07-18T23:30:18', '1'), + ('41', '2232', '2006-02-16T02:30:53', '2005-08-01T10:45:51', '2005-08-06T08:11:51', '1'), + ('278', '3436', '2006-02-16T02:30:53', '2005-07-07T22:35:24', '2005-07-14T23:49:24', '1'), + ('305', '1826', '2006-02-16T02:30:53', '2005-08-22T23:54:04', '2005-08-26T22:25:04', '1'), + ('583', '3948', '2006-02-16T02:30:53', '2005-06-19T22:46:37', '2005-06-23T03:31:37', '1'), + ('166', '4114', '2006-02-16T02:30:53', '2005-06-18T02:29:10', '2005-06-22T02:02:10', '1'), + ('416', '3658', '2006-02-16T02:30:53', '2005-08-01T19:53:13', '2005-08-10T15:05:13', '1'), + ('408', '1711', '2006-02-16T02:30:53', '2005-05-24T23:03:39', '2005-06-01T22:12:39', '1'), + ('190', '3569', '2006-02-16T02:30:53', '2005-07-27T15:52:10', '2005-08-04T15:13:10', '1'), + ('321', '3926', '2006-02-16T02:30:53', '2005-05-26T07:12:21', '2005-05-31T12:07:21', '1'), + ('207', '2450', '2006-02-16T02:30:53', '2005-05-31T20:04:10', '2005-06-09T16:34:10', '1'), + ('399', '2993', '2006-02-16T02:30:53', '2005-08-17T17:16:42', '2005-08-23T18:28:42', '1'), + ('284', '1915', '2006-02-16T02:30:53', '2005-07-06T03:33:23', '2005-07-08T07:54:23', '1'), + ('326', '4310', '2006-02-16T02:30:53', '2005-07-29T18:34:33', '2005-08-02T16:05:33', '1'), + ('85', '1957', '2006-02-16T02:30:53', '2005-06-19T18:53:05', '2005-06-22T13:15:05', '1'), + ('557', '4124', '2006-02-16T02:30:53', '2005-08-22T17:44:27', '2005-08-24T23:25:27', '1'), + ('368', '2708', '2006-02-16T02:30:53', '2005-08-19T21:33:35', '2005-08-20T22:47:35', '1'), + ('85', '1914', '2006-02-16T02:30:53', '2005-08-01T12:44:32', '2005-08-07T09:17:32', '1'), + ('565', '1857', '2006-02-16T02:30:53', '2005-07-09T07:25:19', '2005-07-15T01:51:19', '1'), + ('479', '1556', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('449', '3924', '2006-02-16T02:30:53', '2005-08-01T11:41:55', '2005-08-08T17:16:55', '1'), + ('119', '3536', '2006-02-16T02:30:53', '2005-08-17T00:04:28', '2005-08-26T02:03:28', '1'), + ('498', '2451', '2006-02-16T02:30:53', '2005-07-08T23:56:09', '2005-07-16T19:15:09', '1'), + ('220', '499', '2006-02-16T02:30:53', '2005-08-17T04:15:46', '2005-08-24T04:48:46', '1'), + ('306', '3718', '2006-02-16T02:30:53', '2005-07-29T13:51:20', '2005-08-02T13:05:20', '1'), + ('480', '1043', '2006-02-16T02:30:53', '2005-08-19T04:13:37', '2005-08-26T23:52:37', '1'), + ('488', '1849', '2006-02-16T02:30:53', '2005-07-07T13:00:20', '2005-07-13T16:37:20', '1'), + ('405', '2872', '2006-02-16T02:30:53', '2005-06-17T03:58:36', '2005-06-22T09:28:36', '1'), + ('577', '1353', '2006-02-16T02:30:53', '2005-08-20T01:54:39', '2005-08-25T21:23:39', '1'), + ('562', '2120', '2006-02-16T02:30:53', '2005-08-18T03:53:18', '2005-08-22T04:53:18', '1'), + ('91', '1277', '2006-02-16T02:30:53', '2005-06-18T19:38:20', '2005-06-26T20:48:20', '1'), + ('352', '390', '2006-02-16T02:30:53', '2005-06-16T09:20:33', '2005-06-18T13:42:33', '1'), + ('288', '1057', '2006-02-16T02:30:53', '2005-06-15T20:46:04', '2005-06-24T22:46:04', '1'), + ('340', '2292', '2006-02-16T02:30:53', '2005-07-31T12:05:42', '2005-08-07T15:26:42', '1'), + ('575', '2795', '2006-02-16T02:30:53', '2005-08-19T22:34:51', '2005-08-21T03:30:51', '1'), + ('469', '2796', '2006-02-16T02:30:53', '2005-07-28T11:48:08', '2005-07-30T14:14:08', '1'), + ('575', '1255', '2006-02-16T02:30:53', '2005-07-31T08:57:35', '2005-08-04T04:47:35', '1'), + ('51', '202', '2006-02-16T02:30:53', '2005-07-28T01:08:36', '2005-08-03T21:36:36', '1'), + ('273', '515', '2006-02-16T02:30:53', '2005-07-12T09:47:58', '2005-07-16T15:43:58', '1'), + ('172', '254', '2006-02-16T02:30:53', '2005-07-27T08:39:58', '2005-08-01T03:12:58', '1'), + ('41', '2830', '2006-02-16T02:30:53', '2005-08-18T01:08:34', '2005-08-24T20:52:34', '1'), + ('290', '3606', '2006-02-16T02:30:53', '2005-07-31T20:38:58', '2005-08-06T02:34:58', '1'), + ('463', '1064', '2006-02-16T02:30:53', '2005-08-19T05:55:58', '2005-08-23T08:05:58', '1'), + ('107', '3492', '2006-02-16T02:30:53', '2005-07-27T23:41:18', '2005-08-06T04:40:18', '1'), + ('20', '1445', '2006-02-16T02:30:53', '2005-08-22T14:37:22', '2005-08-27T17:40:22', '1'), + ('158', '929', '2006-02-16T02:30:53', '2005-07-31T08:13:28', '2005-08-07T10:11:28', '1'), + ('164', '233', '2006-02-16T02:30:53', '2005-07-12T12:48:03', '2005-07-13T11:55:03', '1'), + ('205', '1821', '2006-02-16T02:30:53', '2005-06-18T04:17:44', '2005-06-27T09:08:44', '1'), + ('36', '3384', '2006-02-16T02:30:53', '2005-07-07T08:15:03', '2005-07-11T10:56:03', '1'), + ('423', '1849', '2006-02-16T02:30:53', '2005-07-27T21:39:42', '2005-08-06T00:12:42', '1'), + ('585', '3744', '2006-02-16T02:30:53', '2005-06-19T11:47:59', '2005-06-20T08:09:59', '1'), + ('115', '868', '2006-02-16T02:30:53', '2005-08-02T02:11:03', '2005-08-04T01:49:03', '1'), + ('402', '2214', '2006-02-16T02:30:53', '2005-08-02T06:07:54', '2005-08-08T00:37:54', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['12365', '2741', '15280', '8286', '14476', '9177', '3646', '13419', '11239', '9273', '8461', '1589', '1379', '12740', '14612', '12343', '8422', '13735', '603', '2653', '2030', '8929', '15317', '3946', '8270', '14707', '14727', '15601', '850', '6867', '12750', '7599', '5100', '5061', '10679', '1282', '12730', '9592', '6253', '1801', '709', '5881', '3494', '5926', '7558', '1346', '4913', '12366', '12609', '11709', '1376', '9898', '4327', '11941', '4298', '13974', '4431', '5828', '13749', '2429', '874', '14735', '8336', '8045', '11960', '4082', '10021', '12424', '11494', '7930', '4497', '9914', '5711', '10773', '9089', '12264', '14349', '2449', '6091', '12601', '11751', '13171', '15975', '4568', '5774', '1550', '3884', '268', '8048', '8726', '851', '14585', '6811', '7023', '13323', '7063', '10289', '15075', '15372', '8680']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('303', '4350', '2006-02-16T02:30:53', '2005-08-18T07:55:09', '2005-08-24T05:42:09', '1'), + ('36', '1662', '2006-02-16T02:30:53', '2005-06-19T16:05:41', '2005-06-20T20:48:41', '1'), + ('317', '3464', '2006-02-16T02:30:53', '2005-08-22T19:09:52', '2005-08-28T00:39:52', '1'), + ('87', '4092', '2006-02-16T02:30:53', '2005-07-29T02:02:46', '2005-08-06T06:00:46', '1'), + ('101', '2821', '2006-02-16T02:30:53', '2005-08-21T13:31:07', '2005-08-23T17:06:07', '1'), + ('400', '1088', '2006-02-16T02:30:53', '2005-07-30T11:52:40', '2005-08-08T09:35:40', '1'), + ('322', '3591', '2006-02-16T02:30:53', '2005-07-06T07:28:59', '2005-07-11T05:19:59', '1'), + ('537', '3507', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('111', '189', '2006-02-16T02:30:53', '2005-08-02T13:27:11', '2005-08-03T14:36:11', '1'), + ('497', '1867', '2006-02-16T02:30:53', '2005-07-30T15:05:36', '2005-08-08T09:07:36', '1'), + ('399', '3373', '2006-02-16T02:30:53', '2005-07-29T08:11:31', '2005-08-06T09:23:31', '1'), + ('293', '4307', '2006-02-16T02:30:53', '2005-06-16T04:58:03', '2005-06-24T08:36:03', '1'), + ('212', '810', '2006-02-16T02:30:53', '2005-06-15T15:05:10', '2005-06-18T12:11:10', '1'), + ('330', '1157', '2006-02-16T02:30:53', '2005-08-18T22:17:04', '2005-08-23T23:42:04', '1'), + ('445', '4105', '2006-02-16T02:30:53', '2005-08-21T18:03:15', '2005-08-27T13:39:15', '1'), + ('507', '448', '2006-02-16T02:30:53', '2005-08-18T07:15:13', '2005-08-27T11:07:13', '1'), + ('7', '3104', '2006-02-16T02:30:53', '2005-07-29T07:02:55', '2005-08-03T12:35:55', '1'), + ('35', '1813', '2006-02-16T02:30:53', '2005-08-20T10:31:01', '2005-08-26T05:00:01', '1'), + ('537', '3248', '2006-02-16T02:30:53', '2005-05-28T14:27:51', '2005-05-29T13:13:51', '1'), + ('340', '3528', '2006-02-16T02:30:53', '2005-06-19T10:36:53', '2005-06-26T15:15:53', '1'), + ('457', '4024', '2006-02-16T02:30:53', '2005-06-17T13:13:27', '2005-06-19T10:44:27', '1'), + ('472', '3501', '2006-02-16T02:30:53', '2005-07-30T02:28:22', '2005-08-06T06:13:22', '1'), + ('512', '2325', '2006-02-16T02:30:53', '2005-08-22T20:14:13', '2005-08-29T18:32:13', '1'), + ('13', '294', '2006-02-16T02:30:53', '2005-07-06T21:39:24', '2005-07-11T16:10:24', '1'), + ('282', '3565', '2006-02-16T02:30:53', '2005-07-29T01:27:22', '2005-07-29T20:55:22', '1'), + ('530', '2916', '2006-02-16T02:30:53', '2005-08-21T21:06:29', '2005-08-30T23:37:29', '1'), + ('275', '650', '2006-02-16T02:30:53', '2005-08-21T22:12:45', '2005-08-25T00:46:45', '1'), + ('579', '3643', '2006-02-16T02:30:53', '2005-08-23T06:33:26', '2005-08-24T04:10:26', '1'), + ('517', '2390', '2006-02-16T02:30:53', '2005-05-30T01:35:12', '2005-05-31T01:51:12', '1'), + ('190', '3354', '2006-02-16T02:30:53', '2005-07-12T20:06:47', '2005-07-19T16:59:47', '1'), + ('535', '3717', '2006-02-16T02:30:53', '2005-08-18T22:32:39', '2005-08-26T01:54:39', '1'), + ('87', '3272', '2006-02-16T02:30:53', '2005-07-27T23:38:46', '2005-07-28T22:52:46', '1'), + ('101', '3193', '2006-02-16T02:30:53', '2005-07-09T06:16:03', '2005-07-10T10:21:03', '1'), + ('230', '3893', '2006-02-16T02:30:53', '2005-07-09T04:30:50', '2005-07-12T03:24:50', '1'), + ('198', '4437', '2006-02-16T02:30:53', '2005-08-01T17:27:58', '2005-08-08T16:06:58', '1'), + ('539', '186', '2006-02-16T02:30:53', '2005-06-15T08:25:33', '2005-06-21T04:02:33', '1'), + ('7', '75', '2006-02-16T02:30:53', '2005-08-18T21:55:01', '2005-08-22T01:23:01', '1'), + ('14', '1828', '2006-02-16T02:30:53', '2005-07-31T03:21:16', '2005-08-05T08:32:16', '1'), + ('570', '1425', '2006-02-16T02:30:53', '2005-07-11T15:07:19', '2005-07-13T11:00:19', '1'), + ('10', '1015', '2006-02-16T02:30:53', '2005-06-16T20:21:53', '2005-06-18T23:18:53', '1'), + ('479', '2459', '2006-02-16T02:30:53', '2005-05-29T03:48:01', '2005-06-06T05:21:01', '1'), + ('25', '236', '2006-02-16T02:30:53', '2005-07-10T19:19:43', '2005-07-12T20:11:43', '1'), + ('348', '3149', '2006-02-16T02:30:53', '2005-07-05T23:47:30', '2005-07-11T18:10:30', '1'), + ('282', '2840', '2006-02-16T02:30:53', '2005-07-10T21:53:42', '2005-07-20T01:04:42', '1'), + ('80', '550', '2006-02-16T02:30:53', '2005-07-27T22:19:08', '2005-07-30T21:31:08', '1'), + ('585', '4540', '2006-02-16T02:30:53', '2005-06-15T12:39:52', '2005-06-24T17:43:52', '1'), + ('368', '982', '2006-02-16T02:30:53', '2005-07-08T21:27:48', '2005-07-18T02:51:48', '1'), + ('115', '3799', '2006-02-16T02:30:53', '2005-08-18T07:55:14', '2005-08-22T06:12:14', '1'), + ('486', '2327', '2006-02-16T02:30:53', '2005-08-18T17:06:22', '2005-08-20T21:30:22', '1'), + ('330', '1720', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('215', '4271', '2006-02-16T02:30:53', '2005-06-15T14:59:06', '2005-06-19T17:34:06', '1'), + ('359', '2151', '2006-02-16T02:30:53', '2005-07-31T14:12:03', '2005-08-01T12:27:03', '1'), + ('73', '860', '2006-02-16T02:30:53', '2005-07-07T18:01:39', '2005-07-12T22:40:39', '1'), + ('566', '159', '2006-02-16T02:30:53', '2005-08-17T16:56:57', '2005-08-24T16:29:57', '1'), + ('560', '1055', '2006-02-16T02:30:53', '2005-07-07T16:27:25', '2005-07-12T18:20:25', '1'), + ('479', '1912', '2006-02-16T02:30:53', '2005-08-20T18:54:59', '2005-08-28T13:02:59', '1'), + ('26', '936', '2006-02-16T02:30:53', '2005-07-07T22:39:02', '2005-07-16T19:24:02', '1'), + ('156', '2999', '2006-02-16T02:30:53', '2005-07-10T16:27:25', '2005-07-11T18:42:25', '1'), + ('282', '2811', '2006-02-16T02:30:53', '2005-08-20T11:00:37', '2005-08-26T12:04:37', '1'), + ('583', '3238', '2006-02-16T02:30:53', '2005-06-18T17:48:28', '2005-06-27T15:52:28', '1'), + ('52', '363', '2006-02-16T02:30:53', '2005-05-30T05:36:21', '2005-06-01T09:32:21', '1'), + ('35', '950', '2006-02-16T02:30:53', '2005-08-21T22:25:09', '2005-08-23T21:16:09', '1'), + ('210', '2120', '2006-02-16T02:30:53', '2005-07-29T04:20:42', '2005-08-05T10:17:42', '1'), + ('368', '3427', '2006-02-16T02:30:53', '2005-07-28T16:49:38', '2005-08-03T15:42:38', '1'), + ('84', '3924', '2006-02-16T02:30:53', '2005-08-17T17:24:30', '2005-08-18T14:28:30', '1'), + ('108', '2904', '2006-02-16T02:30:53', '2005-07-07T05:11:53', '2005-07-12T00:55:53', '1'), + ('597', '3235', '2006-02-16T02:30:53', '2005-07-31T18:24:39', '2005-08-01T19:16:39', '1'), + ('319', '2055', '2006-02-16T02:30:53', '2005-08-18T10:16:57', '2005-08-27T04:41:57', '1'), + ('579', '3994', '2006-02-16T02:30:53', '2005-08-02T22:51:23', '2005-08-09T01:52:23', '1'), + ('320', '4181', '2006-02-16T02:30:53', '2005-07-28T12:21:08', '2005-07-30T11:56:08', '1'), + ('142', '1995', '2006-02-16T02:30:53', '2005-07-08T01:51:32', '2005-07-15T22:56:32', '1'), + ('530', '3147', '2006-02-16T02:30:53', '2005-07-31T14:51:19', '2005-08-05T09:51:19', '1'), + ('481', '3988', '2006-02-16T02:30:53', '2005-07-10T10:37:20', '2005-07-13T11:20:20', '1'), + ('181', '3854', '2006-02-16T02:30:53', '2005-08-01T20:53:45', '2005-08-07T00:16:45', '1'), + ('369', '490', '2006-02-16T02:30:53', '2005-07-30T08:23:39', '2005-07-31T06:00:39', '1'), + ('87', '3073', '2006-02-16T02:30:53', '2005-08-18T04:17:33', '2005-08-26T08:07:33', '1'), + ('119', '96', '2006-02-16T02:30:53', '2005-08-21T08:54:53', '2005-08-30T14:27:53', '1'), + ('498', '3630', '2006-02-16T02:30:53', '2005-06-18T19:18:36', '2005-06-27T23:49:36', '1'), + ('383', '580', '2006-02-16T02:30:53', '2005-07-11T05:49:18', '2005-07-15T07:26:18', '1'), + ('598', '3099', '2006-02-16T02:30:53', '2005-08-18T16:47:52', '2005-08-24T11:05:52', '1'), + ('51', '3309', '2006-02-16T02:30:53', '2005-08-17T09:07:56', '2005-08-26T13:16:56', '1'), + ('122', '1765', '2006-02-16T02:30:53', '2005-08-19T13:48:54', '2005-08-27T18:57:54', '1'), + ('174', '2723', '2006-02-16T02:30:53', '2005-08-23T20:06:23', '2005-08-27T19:52:23', '1'), + ('122', '2626', '2006-02-16T02:30:53', '2005-07-08T05:23:59', '2005-07-09T06:07:59', '1'), + ('113', '326', '2006-02-16T02:30:53', '2005-07-10T13:31:56', '2005-07-18T07:32:56', '1'), + ('345', '2003', '2006-02-16T02:30:53', '2005-06-16T01:58:35', '2005-06-18T23:56:35', '1'), + ('210', '1806', '2006-02-16T02:30:53', '2005-07-06T18:41:33', '2005-07-07T22:06:33', '1'), + ('75', '1714', '2006-02-16T02:30:53', '2005-05-26T16:19:08', '2005-05-27T14:35:08', '1'), + ('182', '2721', '2006-02-16T02:30:53', '2005-07-28T16:50:26', '2005-08-06T19:20:26', '1'), + ('409', '897', '2006-02-16T02:30:53', '2005-07-29T18:09:22', '2005-08-06T16:24:22', '1'), + ('530', '2780', '2006-02-16T02:30:53', '2005-05-30T01:35:15', '2005-06-06T07:27:15', '1'), + ('30', '82', '2006-02-16T02:30:53', '2005-08-21T17:18:33', '2005-08-26T11:36:33', '1'), + ('107', '1572', '2006-02-16T02:30:53', '2005-07-12T17:54:33', '2005-07-20T17:39:33', '1'), + ('303', '4196', '2006-02-16T02:30:53', '2005-07-27T02:32:44', '2005-08-03T04:06:44', '1'), + ('133', '1055', '2006-02-16T02:30:53', '2005-08-19T19:48:07', '2005-08-23T15:28:07', '1'), + ('58', '2125', '2006-02-16T02:30:53', '2005-07-27T03:52:27', '2005-08-04T07:53:27', '1'), + ('566', '3153', '2006-02-16T02:30:53', '2005-08-01T03:39:48', '2005-08-08T02:56:48', '1'), + ('535', '1938', '2006-02-16T02:30:53', '2005-08-22T11:04:52', '2005-08-30T05:06:52', '1'), + ('273', '3876', '2006-02-16T02:30:53', '2005-08-22T21:59:51', '2005-08-23T17:01:51', '1'), + ('330', '1227', '2006-02-16T02:30:53', '2005-07-29T16:08:03', '2005-07-31T17:26:03', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['10583', '971', '7278', '9796', '7218', '11432', '11506', '13406', '15426', '15173', '2252', '6056', '10226', '6371', '5383', '8871', '11168', '3727', '12156', '4473', '4033', '6424', '14945', '11327', '6945', '14714', '12886', '7581', '12137', '2757', '7319', '15457', '14643', '2780', '4982', '11591', '8771', '13190', '5694', '10671', '15874', '7692', '14769', '132', '13666', '7013', '4724', '15810', '10627', '5508', '6851', '12867', '3539', '11645', '6663', '4257', '32', '2105', '12814', '5739', '14296', '8137', '15106', '3781', '6824', '2522', '12350', '11140', '2753', '8631', '8594', '2107', '9488', '1061', '13594', '3866', '16002', '1865', '11328', '5707', '12586', '1287', '2848', '12160', '2885', '3627', '13261', '13944', '8409', '4283', '230', '12817', '7401', '4805', '6975', '15738', '9029', '7778', '5311', '6934']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('125', '704', '2006-02-16T02:30:53', '2005-08-01T13:54:35', '2005-08-03T18:21:35', '1'), + ('561', '2911', '2006-02-16T02:30:53', '2005-05-30T20:10:52', '2005-06-06T20:47:52', '1'), + ('592', '531', '2006-02-16T02:30:53', '2005-07-27T11:50:34', '2005-08-01T10:22:34', '1'), + ('539', '1038', '2006-02-16T02:30:53', '2005-07-31T10:52:43', '2005-08-09T06:08:43', '1'), + ('530', '2458', '2006-02-16T02:30:53', '2005-07-27T09:34:24', '2005-08-01T07:00:24', '1'), + ('540', '959', '2006-02-16T02:30:53', '2005-08-02T20:10:01', '2005-08-07T01:28:01', '1'), + ('565', '1529', '2006-02-16T02:30:53', '2005-08-16T23:25:48', '2005-08-22T18:17:48', '1'), + ('113', '3031', '2006-02-16T02:30:53', '2005-08-19T22:22:01', '2005-08-22T18:16:01', '1'), + ('347', '3280', '2006-02-16T02:30:53', '2005-08-23T00:07:19', '2005-08-26T23:19:19', '1'), + ('338', '2585', '2006-02-16T02:30:53', '2005-08-22T15:26:29', '2005-08-29T14:03:29', '1'), + ('383', '1987', '2006-02-16T02:30:53', '2005-06-18T05:05:18', '2005-06-21T08:19:18', '1'), + ('145', '3069', '2006-02-16T02:30:53', '2005-07-11T04:01:27', '2005-07-12T04:14:27', '1'), + ('107', '3067', '2006-02-16T02:30:53', '2005-08-01T01:40:04', '2005-08-08T01:02:04', '1'), + ('265', '4297', '2006-02-16T02:30:53', '2005-07-11T21:31:51', '2005-07-16T23:10:51', '1'), + ('14', '573', '2006-02-16T02:30:53', '2005-07-09T19:14:32', '2005-07-11T19:57:32', '1'), + ('382', '4535', '2006-02-16T02:30:53', '2005-07-30T00:12:41', '2005-08-08T03:53:41', '1'), + ('555', '468', '2006-02-16T02:30:53', '2005-08-02T10:19:42', '2005-08-04T08:42:42', '1'), + ('57', '2886', '2006-02-16T02:30:53', '2005-07-06T11:16:43', '2005-07-07T15:39:43', '1'), + ('212', '3270', '2006-02-16T02:30:53', '2005-08-18T00:27:33', '2005-08-26T01:43:33', '1'), + ('481', '1387', '2006-02-16T02:30:53', '2005-07-08T00:22:10', '2005-07-09T21:11:10', '1'), + ('453', '203', '2006-02-16T02:30:53', '2005-07-07T02:35:46', '2005-07-16T01:12:46', '1'), + ('359', '3040', '2006-02-16T02:30:53', '2005-07-11T23:49:37', '2005-07-21T00:53:37', '1'), + ('304', '1567', '2006-02-16T02:30:53', '2005-08-22T06:05:38', '2005-08-29T12:01:38', '1'), + ('361', '773', '2006-02-16T02:30:53', '2005-08-02T16:40:47', '2005-08-03T22:13:47', '1'), + ('560', '1627', '2006-02-16T02:30:53', '2005-07-26T23:35:29', '2005-07-28T00:12:29', '1'), + ('279', '1', '2006-02-16T02:30:53', '2005-08-21T21:27:43', '2005-08-30T22:26:43', '1'), + ('174', '2157', '2006-02-16T02:30:53', '2005-08-19T03:38:32', '2005-08-26T02:17:32', '1'), + ('166', '2051', '2006-02-16T02:30:53', '2005-07-27T23:14:35', '2005-07-29T21:30:35', '1'), + ('109', '3632', '2006-02-16T02:30:53', '2005-08-17T23:52:26', '2005-08-27T00:19:26', '1'), + ('243', '3814', '2006-02-16T02:30:53', '2005-06-19T17:01:14', '2005-06-28T11:38:14', '1'), + ('576', '2370', '2006-02-16T02:30:53', '2005-07-27T13:31:25', '2005-08-04T07:31:25', '1'), + ('306', '4539', '2006-02-16T02:30:53', '2005-08-23T01:07:37', '2005-08-26T19:46:37', '1'), + ('119', '798', '2006-02-16T02:30:53', '2005-08-21T19:11:58', '2005-08-29T19:52:58', '1'), + ('360', '1513', '2006-02-16T02:30:53', '2005-06-19T18:19:33', '2005-06-28T22:29:33', '1'), + ('162', '249', '2006-02-16T02:30:53', '2005-07-09T00:30:52', '2005-07-15T23:50:52', '1'), + ('6', '1670', '2006-02-16T02:30:53', '2005-08-17T02:29:41', '2005-08-23T20:47:41', '1'), + ('347', '3533', '2006-02-16T02:30:53', '2005-07-29T19:54:41', '2005-08-03T20:38:41', '1'), + ('290', '4316', '2006-02-16T02:30:53', '2005-08-19T14:27:59', '2005-08-26T13:45:59', '1'), + ('57', '3476', '2006-02-16T02:30:53', '2005-07-10T09:40:38', '2005-07-14T09:16:38', '1'), + ('10', '4430', '2006-02-16T02:30:53', '2005-08-01T17:09:59', '2005-08-09T21:36:59', '1'), + ('132', '621', '2006-02-16T02:30:53', '2005-08-23T16:30:55', '2005-08-28T20:57:55', '1'), + ('392', '267', '2006-02-16T02:30:53', '2005-07-28T03:30:21', '2005-07-30T22:25:21', '1'), + ('361', '1800', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('479', '3367', '2006-02-16T02:30:53', '2005-05-25T21:46:54', '2005-05-31T21:02:54', '1'), + ('451', '2007', '2006-02-16T02:30:53', '2005-08-20T08:20:19', '2005-08-22T03:22:19', '1'), + ('463', '3919', '2006-02-16T02:30:53', '2005-07-27T02:03:21', '2005-07-31T22:12:21', '1'), + ('18', '3375', '2006-02-16T02:30:53', '2005-07-08T12:46:30', '2005-07-14T12:39:30', '1'), + ('171', '2196', '2006-02-16T02:30:53', '2005-08-23T14:43:15', '2005-08-25T17:41:15', '1'), + ('472', '2026', '2006-02-16T02:30:53', '2005-08-01T15:33:03', '2005-08-02T21:26:03', '1'), + ('345', '2977', '2006-02-16T02:30:53', '2005-07-10T00:50:01', '2005-07-16T19:07:01', '1'), + ('280', '664', '2006-02-16T02:30:53', '2005-07-12T19:32:14', '2005-07-17T21:03:14', '1'), + ('330', '4499', '2006-02-16T02:30:53', '2005-08-19T02:40:11', '2005-08-20T04:01:11', '1'), + ('444', '4081', '2006-02-16T02:30:53', '2005-07-06T01:39:08', '2005-07-07T05:38:08', '1'), + ('35', '4261', '2006-02-16T02:30:53', '2005-08-17T04:50:56', '2005-08-25T23:03:56', '1'), + ('5', '4364', '2006-02-16T02:30:53', '2005-07-12T11:27:35', '2005-07-21T16:35:35', '1'), + ('553', '3927', '2006-02-16T02:30:53', '2005-07-07T14:18:41', '2005-07-08T14:58:41', '1'), + ('230', '3832', '2006-02-16T02:30:53', '2005-05-25T04:06:21', '2005-05-25T23:55:21', '1'), + ('57', '4090', '2006-02-16T02:30:53', '2005-06-17T19:15:45', '2005-06-20T16:00:45', '1'), + ('465', '204', '2006-02-16T02:30:53', '2005-08-19T00:58:24', '2005-08-21T05:46:24', '1'), + ('219', '163', '2006-02-16T02:30:53', '2005-07-10T11:51:50', '2005-07-19T17:40:50', '1'), + ('275', '3813', '2006-02-16T02:30:53', '2005-08-21T07:13:23', '2005-08-26T11:14:23', '1'), + ('312', '3188', '2006-02-16T02:30:53', '2005-07-28T20:07:18', '2005-08-03T17:41:18', '1'), + ('155', '399', '2006-02-16T02:30:53', '2005-08-22T12:01:48', '2005-08-27T16:12:48', '1'), + ('23', '3894', '2006-02-16T02:30:53', '2005-07-06T13:53:41', '2005-07-15T10:03:41', '1'), + ('579', '858', '2006-02-16T02:30:53', '2005-07-12T18:26:46', '2005-07-21T15:23:46', '1'), + ('579', '550', '2006-02-16T02:30:53', '2005-06-19T00:43:42', '2005-06-28T04:26:42', '1'), + ('172', '1333', '2006-02-16T02:30:53', '2005-08-18T07:29:46', '2005-08-21T12:50:46', '1'), + ('132', '3836', '2006-02-16T02:30:53', '2005-08-02T09:27:45', '2005-08-05T04:10:45', '1'), + ('23', '2408', '2006-02-16T02:30:53', '2005-06-19T16:44:35', '2005-06-24T13:45:35', '1'), + ('559', '98', '2006-02-16T02:30:53', '2005-07-29T14:08:06', '2005-08-05T14:57:06', '1'), + ('115', '4155', '2006-02-16T02:30:53', '2005-07-29T12:42:13', '2005-08-02T07:38:13', '1'), + ('104', '1270', '2006-02-16T02:30:53', '2005-06-17T19:31:16', '2005-06-18T23:33:16', '1'), + ('528', '4221', '2006-02-16T02:30:53', '2005-07-30T23:42:42', '2005-08-08T22:15:42', '1'), + ('109', '965', '2006-02-16T02:30:53', '2005-05-31T08:27:58', '2005-06-07T02:34:58', '1'), + ('7', '3424', '2006-02-16T02:30:53', '2005-08-20T05:53:31', '2005-08-23T09:01:31', '1'), + ('409', '194', '2006-02-16T02:30:53', '2005-07-06T17:47:20', '2005-07-15T18:12:20', '1'), + ('73', '2770', '2006-02-16T02:30:53', '2005-08-23T20:47:12', '2005-08-27T23:07:12', '1'), + ('526', '2657', '2006-02-16T02:30:53', '2005-06-17T01:49:36', '2005-06-23T21:13:36', '1'), + ('219', '2031', '2006-02-16T02:30:53', '2005-08-02T16:42:38', '2005-08-04T21:02:38', '1'), + ('581', '708', '2006-02-16T02:30:53', '2005-07-10T10:26:14', '2005-07-18T06:19:14', '1'), + ('460', '4245', '2006-02-16T02:30:53', '2005-08-18T15:54:39', '2005-08-21T19:29:39', '1'), + ('104', '4204', '2006-02-16T02:30:53', '2005-06-15T08:41:38', '2005-06-22T14:02:38', '1'), + ('19', '3449', '2006-02-16T02:30:53', '2005-06-19T22:55:37', '2005-06-25T23:10:37', '1'), + ('481', '1328', '2006-02-16T02:30:53', '2005-08-18T00:37:59', '2005-08-19T20:51:59', '1'), + ('330', '2701', '2006-02-16T02:30:53', '2005-06-20T01:33:42', '2005-06-22T22:23:42', '1'), + ('322', '1087', '2006-02-16T02:30:53', '2005-07-06T06:19:25', '2005-07-11T05:53:25', '1'), + ('417', '3538', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('408', '3685', '2006-02-16T02:30:53', '2005-08-20T17:41:16', '2005-08-23T12:02:16', '1'), + ('303', '4314', '2006-02-16T02:30:53', '2005-07-29T06:41:22', '2005-07-31T11:21:22', '1'), + ('477', '2807', '2006-02-16T02:30:53', '2005-07-07T15:29:35', '2005-07-11T17:12:35', '1'), + ('58', '1085', '2006-02-16T02:30:53', '2005-05-26T11:31:50', '2005-05-30T15:22:50', '1'), + ('113', '1246', '2006-02-16T02:30:53', '2005-08-19T01:04:35', '2005-08-25T21:14:35', '1'), + ('583', '2759', '2006-02-16T02:30:53', '2005-07-27T16:17:55', '2005-08-04T15:48:55', '1'), + ('453', '377', '2006-02-16T02:30:53', '2005-07-08T16:59:12', '2005-07-09T15:02:12', '1'), + ('527', '3328', '2006-02-16T02:30:53', '2005-07-27T00:39:54', '2005-08-02T19:49:54', '1'), + ('38', '556', '2006-02-16T02:30:53', '2005-08-23T11:55:50', '2005-08-30T15:07:50', '1'), + ('52', '2220', '2006-02-16T02:30:53', '2005-07-30T06:03:11', '2005-08-04T01:42:11', '1'), + ('248', '1044', '2006-02-16T02:30:53', '2005-07-28T07:10:11', '2005-08-05T05:09:11', '1'), + ('107', '986', '2006-02-16T02:30:53', '2005-07-09T16:02:54', '2005-07-18T10:44:54', '1'), + ('107', '455', '2006-02-16T02:30:53', '2005-07-26T23:11:03', '2005-08-04T19:18:03', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['11332', '12693', '13762', '8845', '7602', '5861', '7952', '7091', '15550', '1486', '1125', '7455', '14613', '4492', '9174', '5180', '2669', '3968', '15778', '11214', '8148', '11289', '15687', '6969', '9750', '9766', '6897', '11929', '13331', '579', '7769', '12196', '11503', '2694', '14942', '3825', '1364', '15285', '1361', '991', '7958', '13823', '10993', '10321', '2568', '946', '2094', '9999', '1294', '6685', '9066', '9103', '5478', '13234', '618', '15657', '3615', '10275', '7983', '1907', '13851', '1460', '11832', '9328', '6762', '2039', '4228', '1820', '12199', '1521', '15737', '6530', '12061', '8360', '7919', '15190', '8311', '7393', '2309', '5095', '15954', '2058', '9154', '13973', '10945', '12844', '1876', '8897', '12692', '37', '4012', '3752', '2118', '3742', '1524', '15261', '2063', '11476', '7281', '8847']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('467', '2381', '2006-02-16T02:30:53', '2005-08-02T16:52:57', '2005-08-04T14:13:57', '1'), + ('584', '1543', '2006-02-16T02:30:53', '2005-08-18T20:10:19', '2005-08-25T21:11:19', '1'), + ('566', '451', '2006-02-16T02:30:53', '2005-08-20T11:29:32', '2005-08-23T17:25:32', '1'), + ('543', '3036', '2006-02-16T02:30:53', '2005-07-29T23:06:13', '2005-08-02T20:16:13', '1'), + ('366', '2516', '2006-02-16T02:30:53', '2005-07-27T23:48:35', '2005-08-04T17:58:35', '1'), + ('277', '3881', '2006-02-16T02:30:53', '2005-07-10T18:14:22', '2005-07-14T15:32:22', '1'), + ('158', '3313', '2006-02-16T02:30:53', '2005-07-28T13:23:49', '2005-08-01T08:50:49', '1'), + ('322', '2593', '2006-02-16T02:30:53', '2005-07-27T04:44:10', '2005-07-31T07:14:10', '1'), + ('465', '1375', '2006-02-16T02:30:53', '2005-08-23T04:27:54', '2005-08-29T01:29:54', '1'), + ('62', '847', '2006-02-16T02:30:53', '2005-06-15T21:25:30', '2005-06-16T16:36:30', '1'), + ('234', '1172', '2006-02-16T02:30:53', '2005-05-31T17:23:44', '2005-06-01T15:02:44', '1'), + ('405', '3815', '2006-02-16T02:30:53', '2005-07-27T18:34:41', '2005-07-31T17:32:41', '1'), + ('20', '3841', '2006-02-16T02:30:53', '2005-08-21T18:03:20', '2005-08-26T19:46:20', '1'), + ('247', '1152', '2006-02-16T02:30:53', '2005-07-08T01:32:04', '2005-07-10T22:11:04', '1'), + ('144', '2636', '2006-02-16T02:30:53', '2005-07-30T11:42:10', '2005-07-31T09:52:10', '1'), + ('494', '3684', '2006-02-16T02:30:53', '2005-07-09T10:06:53', '2005-07-12T15:25:53', '1'), + ('523', '2734', '2006-02-16T02:30:53', '2005-06-19T11:28:52', '2005-06-20T16:43:52', '1'), + ('235', '558', '2006-02-16T02:30:53', '2005-07-06T22:47:09', '2005-07-12T21:01:09', '1'), + ('234', '1269', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('407', '2722', '2006-02-16T02:30:53', '2005-08-02T12:19:50', '2005-08-11T06:38:50', '1'), + ('347', '537', '2006-02-16T02:30:53', '2005-07-28T20:39:47', '2005-08-02T16:29:47', '1'), + ('10', '2869', '2006-02-16T02:30:53', '2005-08-02T14:55:00', '2005-08-11T13:57:00', '1'), + ('112', '276', '2006-02-16T02:30:53', '2005-08-23T09:46:33', '2005-09-01T06:07:33', '1'), + ('579', '2650', '2006-02-16T02:30:53', '2005-07-27T00:23:54', '2005-08-03T04:34:54', '1'), + ('527', '3174', '2006-02-16T02:30:53', '2005-07-31T09:19:46', '2005-08-06T08:07:46', '1'), + ('570', '4049', '2006-02-16T02:30:53', '2005-07-31T09:46:29', '2005-08-01T05:08:29', '1'), + ('13', '170', '2006-02-16T02:30:53', '2005-07-12T21:30:41', '2005-07-15T03:19:41', '1'), + ('327', '3765', '2006-02-16T02:30:53', '2005-08-17T16:28:51', '2005-08-25T19:36:51', '1'), + ('23', '3867', '2006-02-16T02:30:53', '2005-08-19T20:00:25', '2005-08-21T17:03:25', '1'), + ('181', '3481', '2006-02-16T02:30:53', '2005-05-28T11:19:23', '2005-06-02T13:51:23', '1'), + ('30', '3250', '2006-02-16T02:30:53', '2005-07-28T06:45:23', '2005-07-30T12:18:23', '1'), + ('111', '4302', '2006-02-16T02:30:53', '2005-08-18T02:08:48', '2005-08-26T00:39:48', '1'), + ('526', '1496', '2006-02-16T02:30:53', '2005-08-16T23:10:34', '2005-08-25T03:55:34', '1'), + ('368', '380', '2006-02-16T02:30:53', '2005-06-19T13:17:21', '2005-06-24T15:09:21', '1'), + ('471', '32', '2006-02-16T02:30:53', '2005-08-22T05:58:27', '2005-08-31T10:08:27', '1'), + ('132', '630', '2006-02-16T02:30:53', '2005-07-06T15:50:03', '2005-07-09T19:20:03', '1'), + ('400', '115', '2006-02-16T02:30:53', '2005-06-15T14:05:32', '2005-06-16T15:31:32', '1'), + ('233', '481', '2006-02-16T02:30:53', '2005-08-22T19:17:24', '2005-08-25T00:25:24', '1'), + ('115', '4338', '2006-02-16T02:30:53', '2005-06-15T13:37:38', '2005-06-19T17:08:38', '1'), + ('593', '2863', '2006-02-16T02:30:53', '2005-05-30T23:29:22', '2005-06-07T23:16:22', '1'), + ('593', '421', '2006-02-16T02:30:53', '2005-07-28T13:34:34', '2005-07-29T16:03:34', '1'), + ('89', '3875', '2006-02-16T02:30:53', '2005-08-20T13:42:10', '2005-08-22T18:45:10', '1'), + ('383', '292', '2006-02-16T02:30:53', '2005-08-02T04:45:01', '2005-08-04T03:32:01', '1'), + ('177', '4512', '2006-02-16T02:30:53', '2005-08-01T04:40:02', '2005-08-03T04:18:02', '1'), + ('190', '3032', '2006-02-16T02:30:53', '2005-06-19T04:09:03', '2005-06-24T23:24:03', '1'), + ('486', '1264', '2006-02-16T02:30:53', '2005-05-30T15:35:08', '2005-06-08T11:38:08', '1'), + ('308', '2205', '2006-02-16T02:30:53', '2005-06-17T18:18:56', '2005-06-18T19:36:56', '1'), + ('543', '1438', '2006-02-16T02:30:53', '2005-07-31T17:40:53', '2005-08-01T14:25:53', '1'), + ('327', '339', '2006-02-16T02:30:53', '2005-06-15T09:09:27', '2005-06-19T04:43:27', '1'), + ('5', '1434', '2006-02-16T02:30:53', '2005-07-12T12:16:28', '2005-07-19T17:03:28', '1'), + ('171', '196', '2006-02-16T02:30:53', '2005-07-30T07:28:54', '2005-08-02T05:23:54', '1'), + ('280', '3806', '2006-02-16T02:30:53', '2005-07-30T08:49:26', '2005-07-31T14:15:26', '1'), + ('583', '3213', '2006-02-16T02:30:53', '2005-07-09T23:45:15', '2005-07-15T22:48:15', '1'), + ('559', '976', '2006-02-16T02:30:53', '2005-08-19T16:17:15', '2005-08-27T12:36:15', '1'), + ('248', '4445', '2006-02-16T02:30:53', '2005-05-28T15:50:07', '2005-06-01T19:45:07', '1'), + ('36', '1897', '2006-02-16T02:30:53', '2005-08-23T08:42:40', '2005-09-01T13:08:40', '1'), + ('49', '711', '2006-02-16T02:30:53', '2005-07-06T05:47:47', '2005-07-11T05:01:47', '1'), + ('463', '669', '2006-02-16T02:30:53', '2005-08-01T03:20:08', '2005-08-08T06:48:08', '1'), + ('115', '1836', '2006-02-16T02:30:53', '2005-07-28T14:23:01', '2005-07-29T11:51:01', '1'), + ('66', '988', '2006-02-16T02:30:53', '2005-06-17T05:08:27', '2005-06-23T09:13:27', '1'), + ('80', '3278', '2006-02-16T02:30:53', '2005-08-20T14:44:22', '2005-08-22T18:10:22', '1'), + ('565', '1405', '2006-02-16T02:30:53', '2005-06-15T20:27:02', '2005-06-16T16:21:02', '1'), + ('125', '2331', '2006-02-16T02:30:53', '2005-08-17T12:55:31', '2005-08-19T08:31:31', '1'), + ('89', '1087', '2006-02-16T02:30:53', '2005-07-30T17:32:11', '2005-08-05T13:36:11', '1'), + ('262', '3857', '2006-02-16T02:30:53', '2005-07-12T15:25:33', '2005-07-21T18:57:33', '1'), + ('304', '1514', '2006-02-16T02:30:53', '2005-06-17T14:03:43', '2005-06-24T09:21:43', '1'), + ('38', '1020', '2006-02-16T02:30:53', '2005-07-07T12:42:02', '2005-07-12T10:52:02', '1'), + ('120', '3672', '2006-02-16T02:30:53', '2005-06-16T21:34:50', '2005-06-20T16:50:50', '1'), + ('96', '424', '2006-02-16T02:30:53', '2005-08-18T02:09:23', '2005-08-22T20:33:23', '1'), + ('149', '4299', '2006-02-16T02:30:53', '2005-06-15T23:58:53', '2005-06-18T03:10:53', '1'), + ('83', '996', '2006-02-16T02:30:53', '2005-08-23T11:52:18', '2005-08-28T15:28:18', '1'), + ('75', '3410', '2006-02-16T02:30:53', '2005-07-12T04:33:19', '2005-07-15T08:26:19', '1'), + ('532', '144', '2006-02-16T02:30:53', '2005-08-17T21:13:35', '2005-08-22T19:18:35', '1'), + ('62', '4135', '2006-02-16T02:30:53', '2005-07-29T05:08:00', '2005-08-02T00:40:00', '1'), + ('36', '2138', '2006-02-16T02:30:53', '2005-07-28T11:59:45', '2005-08-06T11:19:45', '1'), + ('84', '2096', '2006-02-16T02:30:53', '2005-08-22T15:57:38', '2005-08-24T13:46:38', '1'), + ('63', '3623', '2006-02-16T02:30:53', '2005-07-29T03:26:07', '2005-08-02T01:46:07', '1'), + ('181', '2369', '2006-02-16T02:30:53', '2005-07-27T16:02:52', '2005-08-02T13:24:52', '1'), + ('576', '611', '2006-02-16T02:30:53', '2005-06-18T08:43:24', '2005-06-20T03:56:24', '1'), + ('292', '2788', '2006-02-16T02:30:53', '2005-07-09T06:08:22', '2005-07-11T10:52:22', '1'), + ('460', '576', '2006-02-16T02:30:53', '2005-08-23T19:14:07', '2005-08-24T20:21:07', '1'), + ('57', '1324', '2006-02-16T02:30:53', '2005-06-17T15:34:41', '2005-06-25T14:50:41', '1'), + ('312', '576', '2006-02-16T02:30:53', '2005-07-30T10:59:54', '2005-08-05T16:47:54', '1'), + ('58', '1181', '2006-02-16T02:30:53', '2005-08-20T18:52:43', '2005-08-21T19:11:43', '1'), + ('532', '3684', '2006-02-16T02:30:53', '2005-08-02T03:20:23', '2005-08-09T03:23:23', '1'), + ('584', '4146', '2006-02-16T02:30:53', '2005-08-19T01:59:08', '2005-08-24T22:21:08', '1'), + ('459', '384', '2006-02-16T02:30:53', '2005-06-17T02:50:51', '2005-06-18T07:21:51', '1'), + ('459', '1964', '2006-02-16T02:30:53', '2005-07-30T01:00:17', '2005-08-01T03:41:17', '1'), + ('273', '2781', '2006-02-16T02:30:53', '2005-08-18T20:09:19', '2005-08-21T00:14:19', '1'), + ('535', '403', '2006-02-16T02:30:53', '2005-05-25T04:44:31', '2005-05-29T01:03:31', '1'), + ('104', '1400', '2006-02-16T02:30:53', '2005-07-07T00:56:09', '2005-07-10T21:49:09', '1'), + ('235', '4561', '2006-02-16T02:30:53', '2005-07-06T12:30:12', '2005-07-13T12:13:12', '1'), + ('103', '1261', '2006-02-16T02:30:53', '2005-06-17T20:28:29', '2005-06-23T22:47:29', '1'), + ('96', '2873', '2006-02-16T02:30:53', '2005-07-06T12:01:38', '2005-07-15T10:46:38', '1'), + ('177', '3439', '2006-02-16T02:30:53', '2005-06-16T00:25:52', '2005-06-19T03:32:52', '1'), + ('140', '2200', '2006-02-16T02:30:53', '2005-08-22T18:24:34', '2005-08-27T19:53:34', '1'), + ('5', '4323', '2006-02-16T02:30:53', '2005-06-17T15:56:53', '2005-06-21T14:19:53', '1'), + ('144', '724', '2006-02-16T02:30:53', '2005-08-02T22:03:47', '2005-08-09T02:19:47', '1'), + ('491', '1350', '2006-02-16T02:30:53', '2005-07-27T11:59:20', '2005-08-04T12:48:20', '1'), + ('480', '4133', '2006-02-16T02:30:53', '2005-07-29T23:13:41', '2005-07-31T23:55:41', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['6312', '15988', '12483', '15414', '10353', '12335', '7820', '9910', '6013', '11278', '2495', '9756', '15247', '14044', '8895', '7552', '10960', '9667', '2953', '14673', '9895', '1979', '12400', '3328', '14218', '5253', '11586', '6912', '11986', '15532', '3892', '3754', '6907', '9351', '9922', '2386', '15953', '14438', '4239', '4268', '1553', '5703', '10396', '9265', '12619', '575', '12703', '12081', '1632', '8356', '9553', '15034', '10600', '12251', '3025', '526', '7690', '12419', '3559', '13975', '2736', '2052', '6383', '10897', '10857', '11370', '5582', '15820', '3033', '5309', '47', '15891', '8046', '4514', '12336', '5921', '6775', '5005', '15057', '10398', '14533', '5680', '9133', '14341', '11515', '11563', '13684', '2417', '10281', '6843', '10340', '3455', '2450', '7431', '11073', '14408', '12260', '14487', '7153', '4046']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('417', '2188', '2006-02-16T02:30:53', '2005-07-11T18:19:02', '2005-07-18T00:00:02', '1'), + ('400', '3932', '2006-02-16T02:30:53', '2005-08-23T20:23:08', '2005-08-28T20:50:08', '1'), + ('488', '1805', '2006-02-16T02:30:53', '2005-08-18T12:38:37', '2005-08-24T13:26:37', '1'), + ('532', '718', '2006-02-16T02:30:53', '2005-08-22T23:43:54', '2005-08-30T18:26:54', '1'), + ('535', '1446', '2006-02-16T02:30:53', '2005-08-01T05:46:33', '2005-08-08T09:14:33', '1'), + ('150', '2776', '2006-02-16T02:30:53', '2005-08-18T06:59:15', '2005-08-20T06:47:15', '1'), + ('459', '4475', '2006-02-16T02:30:53', '2005-07-28T08:28:51', '2005-08-05T10:00:51', '1'), + ('122', '368', '2006-02-16T02:30:53', '2005-07-31T14:47:57', '2005-08-05T18:20:57', '1'), + ('543', '3774', '2006-02-16T02:30:53', '2005-07-11T02:02:03', '2005-07-14T02:07:03', '1'), + ('143', '961', '2006-02-16T02:30:53', '2005-08-02T14:29:43', '2005-08-07T10:13:43', '1'), + ('338', '3826', '2006-02-16T02:30:53', '2005-06-18T22:15:42', '2005-06-21T23:21:42', '1'), + ('400', '207', '2006-02-16T02:30:53', '2005-07-31T09:25:00', '2005-08-02T05:11:00', '1'), + ('250', '4572', '2006-02-16T02:30:53', '2005-08-22T17:52:05', '2005-08-31T21:37:05', '1'), + ('145', '1422', '2006-02-16T02:30:53', '2005-08-20T21:48:38', '2005-08-29T02:56:38', '1'), + ('494', '3217', '2006-02-16T02:30:53', '2005-07-30T00:49:17', '2005-07-31T01:56:17', '1'), + ('16', '2166', '2006-02-16T02:30:53', '2005-07-27T22:03:41', '2005-07-28T22:24:41', '1'), + ('399', '3536', '2006-02-16T02:30:53', '2005-08-02T03:46:18', '2005-08-11T01:29:18', '1'), + ('523', '4289', '2006-02-16T02:30:53', '2005-07-31T06:23:52', '2005-08-09T09:12:52', '1'), + ('540', '1829', '2006-02-16T02:30:53', '2005-06-20T06:39:11', '2005-06-26T06:19:11', '1'), + ('445', '1827', '2006-02-16T02:30:53', '2005-08-21T20:01:18', '2005-08-25T18:55:18', '1'), + ('560', '835', '2006-02-16T02:30:53', '2005-07-31T14:07:56', '2005-08-05T14:56:56', '1'), + ('45', '3470', '2006-02-16T02:30:53', '2005-06-17T09:45:30', '2005-06-20T10:52:30', '1'), + ('10', '1767', '2006-02-16T02:30:53', '2005-08-18T09:19:12', '2005-08-26T06:52:12', '1'), + ('292', '2462', '2006-02-16T02:30:53', '2005-06-21T09:08:44', '2005-06-30T12:28:44', '1'), + ('104', '4087', '2006-02-16T02:30:53', '2005-08-21T04:43:59', '2005-08-27T10:29:59', '1'), + ('532', '2241', '2006-02-16T02:30:53', '2005-07-09T13:41:17', '2005-07-17T17:09:17', '1'), + ('465', '3140', '2006-02-16T02:30:53', '2005-08-17T02:20:42', '2005-08-26T05:01:42', '1'), + ('471', '1701', '2006-02-16T02:30:53', '2005-07-12T22:17:16', '2005-07-19T18:18:16', '1'), + ('352', '1610', '2006-02-16T02:30:53', '2005-08-17T18:21:58', '2005-08-18T13:05:58', '1'), + ('23', '1061', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('549', '778', '2006-02-16T02:30:53', '2005-07-06T18:58:58', '2005-07-10T19:29:58', '1'), + ('83', '4042', '2006-02-16T02:30:53', '2005-07-06T12:35:44', '2005-07-08T16:28:44', '1'), + ('575', '2516', '2006-02-16T02:30:53', '2005-07-12T22:03:49', '2005-07-18T19:18:49', '1'), + ('107', '2063', '2006-02-16T02:30:53', '2005-07-30T18:28:30', '2005-08-02T17:26:30', '1'), + ('25', '3615', '2006-02-16T02:30:53', '2005-07-31T14:59:37', '2005-08-06T14:05:37', '1'), + ('293', '1361', '2006-02-16T02:30:53', '2005-06-18T15:22:51', '2005-06-22T20:01:51', '1'), + ('540', '3727', '2006-02-16T02:30:53', '2005-08-23T19:13:46', '2005-08-28T23:05:46', '1'), + ('392', '1621', '2006-02-16T02:30:53', '2005-08-21T11:51:10', '2005-08-28T17:10:10', '1'), + ('122', '3866', '2006-02-16T02:30:53', '2005-07-07T13:23:17', '2005-07-13T17:49:17', '1'), + ('80', '432', '2006-02-16T02:30:53', '2005-07-07T14:36:05', '2005-07-16T14:36:05', '1'), + ('416', '4026', '2006-02-16T02:30:53', '2005-06-16T02:02:44', '2005-06-19T07:50:44', '1'), + ('132', '1585', '2006-02-16T02:30:53', '2005-07-10T10:04:15', '2005-07-16T07:43:15', '1'), + ('284', '2982', '2006-02-16T02:30:53', '2005-08-01T07:08:46', '2005-08-08T03:47:46', '1'), + ('560', '3700', '2006-02-16T02:30:53', '2005-07-30T14:55:25', '2005-08-02T11:34:25', '1'), + ('592', '980', '2006-02-16T02:30:53', '2005-08-18T17:24:15', '2005-08-21T15:56:15', '1'), + ('142', '4451', '2006-02-16T02:30:53', '2005-05-28T10:56:09', '2005-06-05T15:39:09', '1'), + ('453', '1278', '2006-02-16T02:30:53', '2005-08-18T20:37:13', '2005-08-26T16:13:13', '1'), + ('597', '620', '2006-02-16T02:30:53', '2005-08-17T22:10:46', '2005-08-22T22:37:46', '1'), + ('319', '1518', '2006-02-16T02:30:53', '2005-06-16T08:03:42', '2005-06-17T03:40:42', '1'), + ('483', '2951', '2006-02-16T02:30:53', '2005-07-29T04:58:56', '2005-08-06T03:07:56', '1'), + ('579', '4187', '2006-02-16T02:30:53', '2005-07-31T02:06:34', '2005-08-08T02:20:34', '1'), + ('235', '1331', '2006-02-16T02:30:53', '2005-08-22T09:33:08', '2005-08-29T13:04:08', '1'), + ('294', '3900', '2006-02-16T02:30:53', '2005-08-01T14:25:21', '2005-08-06T18:00:21', '1'), + ('276', '3044', '2006-02-16T02:30:53', '2005-08-18T03:59:02', '2005-08-19T02:38:02', '1'), + ('293', '1309', '2006-02-16T02:30:53', '2005-06-20T11:46:48', '2005-06-22T08:43:48', '1'), + ('408', '1387', '2006-02-16T02:30:53', '2005-05-28T04:27:37', '2005-05-30T07:52:37', '1'), + ('150', '1076', '2006-02-16T02:30:53', '2005-07-28T03:26:21', '2005-07-29T00:08:21', '1'), + ('133', '3111', '2006-02-16T02:30:53', '2005-08-18T10:01:48', '2005-08-19T13:40:48', '1'), + ('483', '2211', '2006-02-16T02:30:53', '2005-07-06T02:49:42', '2005-07-12T04:44:42', '1'), + ('286', '3821', '2006-02-16T02:30:53', '2005-08-20T18:58:23', '2005-08-25T20:58:23', '1'), + ('359', '4510', '2006-02-16T02:30:53', '2005-06-19T15:43:20', '2005-06-21T13:03:20', '1'), + ('172', '1686', '2006-02-16T02:30:53', '2005-06-17T15:14:43', '2005-06-21T11:08:43', '1'), + ('486', '4275', '2006-02-16T02:30:53', '2005-07-11T22:06:53', '2005-07-17T16:09:53', '1'), + ('338', '291', '2006-02-16T02:30:53', '2005-08-02T01:23:42', '2005-08-03T23:27:42', '1'), + ('360', '2961', '2006-02-16T02:30:53', '2005-08-02T00:07:20', '2005-08-04T02:35:20', '1'), + ('146', '3077', '2006-02-16T02:30:53', '2005-08-02T18:06:01', '2005-08-04T15:10:01', '1'), + ('305', '3341', '2006-02-16T02:30:53', '2005-07-10T04:08:25', '2005-07-13T06:04:25', '1'), + ('308', '4553', '2006-02-16T02:30:53', '2005-08-23T15:03:13', '2005-08-25T20:12:13', '1'), + ('107', '4422', '2006-02-16T02:30:53', '2005-06-20T12:02:05', '2005-06-26T15:58:05', '1'), + ('338', '4026', '2006-02-16T02:30:53', '2005-07-09T16:00:16', '2005-07-17T17:56:16', '1'), + ('35', '2211', '2006-02-16T02:30:53', '2005-05-25T06:05:20', '2005-05-30T03:04:20', '1'), + ('52', '2168', '2006-02-16T02:30:53', '2005-08-23T17:00:12', '2005-08-31T21:12:12', '1'), + ('120', '2873', '2006-02-16T02:30:53', '2005-07-28T16:49:41', '2005-07-31T21:33:41', '1'), + ('576', '1938', '2006-02-16T02:30:53', '2005-07-08T02:41:25', '2005-07-15T06:17:25', '1'), + ('75', '2484', '2006-02-16T02:30:53', '2005-08-18T06:59:41', '2005-08-23T01:36:41', '1'), + ('7', '3920', '2006-02-16T02:30:53', '2005-07-10T21:35:12', '2005-07-18T19:59:12', '1'), + ('383', '2909', '2006-02-16T02:30:53', '2005-07-12T16:01:44', '2005-07-19T14:11:44', '1'), + ('451', '3034', '2006-02-16T02:30:53', '2005-07-09T01:21:44', '2005-07-14T20:27:44', '1'), + ('20', '4534', '2006-02-16T02:30:53', '2005-08-22T10:19:58', '2005-08-28T05:12:58', '1'), + ('174', '4306', '2006-02-16T02:30:53', '2005-08-01T07:11:49', '2005-08-04T05:54:49', '1'), + ('586', '2202', '2006-02-16T02:30:53', '2005-08-21T15:15:19', '2005-08-26T12:47:19', '1'), + ('199', '3503', '2006-02-16T02:30:53', '2005-07-10T08:47:36', '2005-07-17T06:10:36', '1'), + ('576', '408', '2006-02-16T02:30:53', '2005-07-30T09:59:00', '2005-08-07T04:24:00', '1'), + ('560', '4498', '2006-02-16T02:30:53', '2005-08-21T08:38:24', '2005-08-26T12:36:24', '1'), + ('279', '1053', '2006-02-16T02:30:53', '2005-08-16T23:54:34', '2005-08-21T19:00:34', '1'), + ('83', '1545', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('348', '2213', '2006-02-16T02:30:53', '2005-08-20T08:55:53', '2005-08-25T08:11:53', '1'), + ('219', '1956', '2006-02-16T02:30:53', '2005-06-18T17:12:01', '2005-06-26T13:32:01', '1'), + ('549', '1047', '2006-02-16T02:30:53', '2005-08-01T03:28:33', '2005-08-02T05:06:33', '1'), + ('561', '746', '2006-02-16T02:30:53', '2005-07-12T19:14:05', '2005-07-20T23:15:05', '1'), + ('568', '3608', '2006-02-16T02:30:53', '2005-08-01T05:07:03', '2005-08-06T01:03:03', '1'), + ('340', '4403', '2006-02-16T02:30:53', '2005-06-21T21:17:51', '2005-06-23T17:22:51', '1'), + ('230', '863', '2006-02-16T02:30:53', '2005-06-18T19:25:47', '2005-06-27T15:54:47', '1'), + ('589', '3931', '2006-02-16T02:30:53', '2005-07-27T17:27:27', '2005-07-31T18:40:27', '1'), + ('234', '4232', '2006-02-16T02:30:53', '2005-08-02T07:13:03', '2005-08-03T05:46:03', '1'), + ('593', '222', '2006-02-16T02:30:53', '2005-08-21T10:47:24', '2005-08-27T08:18:24', '1'), + ('150', '1352', '2006-02-16T02:30:53', '2005-08-18T04:15:43', '2005-08-26T23:31:43', '1'), + ('526', '2578', '2006-02-16T02:30:53', '2005-08-21T13:53:33', '2005-08-29T19:32:33', '1'), + ('41', '2657', '2006-02-16T02:30:53', '2005-07-27T07:15:38', '2005-07-28T09:56:38', '1'), + ('491', '3518', '2006-02-16T02:30:53', '2005-07-07T03:27:59', '2005-07-14T01:14:59', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['1119', '12647', '3964', '3194', '10688', '1085', '1783', '14831', '15888', '4173', '11691', '2077', '14639', '14089', '7538', '10036', '8772', '6901', '1590', '14457', '7159', '1321', '184', '814', '6533', '4940', '7971', '8843', '3092', '13809', '8762', '9463', '1016', '2008', '399', '15514', '620', '11930', '2782', '11774', '2803', '10472', '8815', '11698', '8589', '11037', '14768', '1391', '3408', '9003', '12698', '6106', '9979', '5239', '5475', '5585', '11362', '6696', '9429', '9012', '10077', '3180', '1987', '3080', '3955', '1494', '1498', '5222', '12989', '7438', '15667', '102', '12225', '10205', '8730', '10913', '1617', '4829', '11877', '3145', '7120', '2119', '15408', '7032', '701', '4242', '1665', '2595', '14406', '8218', '15191', '852', '11708', '3767', '13115', '9625', '5091', '7287', '11399', '11034']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('469', '4401', '2006-02-16T02:30:53', '2005-05-31T16:34:27', '2005-06-02T10:54:27', '1'), + ('520', '323', '2006-02-16T02:30:53', '2005-08-18T18:29:51', '2005-08-27T22:51:51', '1'), + ('30', '1853', '2006-02-16T02:30:53', '2005-07-06T22:23:02', '2005-07-07T22:21:02', '1'), + ('432', '1835', '2006-02-16T02:30:53', '2005-06-20T23:59:57', '2005-06-24T19:21:57', '1'), + ('449', '3161', '2006-02-16T02:30:53', '2005-08-01T17:53:43', '2005-08-09T21:50:43', '1'), + ('5', '301', '2006-02-16T02:30:53', '2005-05-31T11:15:43', '2005-06-07T12:02:43', '1'), + ('18', '50', '2006-02-16T02:30:53', '2005-06-16T19:23:23', '2005-06-18T00:57:23', '1'), + ('156', '3370', '2006-02-16T02:30:53', '2005-08-22T01:40:49', '2005-08-23T02:47:49', '1'), + ('321', '2955', '2006-02-16T02:30:53', '2005-08-23T16:56:14', '2005-08-31T14:32:14', '1'), + ('320', '4272', '2006-02-16T02:30:53', '2005-07-07T09:57:26', '2005-07-10T04:05:26', '1'), + ('515', '2529', '2006-02-16T02:30:53', '2005-08-17T06:51:05', '2005-08-24T09:53:05', '1'), + ('113', '4478', '2006-02-16T02:30:53', '2005-06-17T16:46:11', '2005-06-19T15:10:11', '1'), + ('210', '3510', '2006-02-16T02:30:53', '2005-08-21T19:01:39', '2005-08-26T14:08:39', '1'), + ('425', '1400', '2006-02-16T02:30:53', '2005-08-20T23:59:02', '2005-08-27T00:19:02', '1'), + ('361', '2486', '2006-02-16T02:30:53', '2005-07-27T21:38:04', '2005-08-02T03:14:04', '1'), + ('491', '41', '2006-02-16T02:30:53', '2005-07-31T18:47:20', '2005-08-03T22:53:20', '1'), + ('122', '3526', '2006-02-16T02:30:53', '2005-07-29T19:55:25', '2005-08-05T18:48:25', '1'), + ('158', '4574', '2006-02-16T02:30:53', '2005-07-12T21:46:33', '2005-07-16T21:36:33', '1'), + ('98', '3685', '2006-02-16T02:30:53', '2005-06-16T05:11:41', '2005-06-23T10:11:41', '1'), + ('340', '4288', '2006-02-16T02:30:53', '2005-08-21T12:47:38', '2005-08-25T13:07:38', '1'), + ('158', '1220', '2006-02-16T02:30:53', '2005-07-27T07:24:00', '2005-08-05T11:13:00', '1'), + ('204', '3516', '2006-02-16T02:30:53', '2005-06-15T10:49:17', '2005-06-16T15:30:17', '1'), + ('556', '1970', '2006-02-16T02:30:53', '2005-05-26T05:29:49', '2005-05-28T10:10:49', '1'), + ('134', '1572', '2006-02-16T02:30:53', '2005-05-29T20:16:12', '2005-06-07T17:47:12', '1'), + ('366', '3853', '2006-02-16T02:30:53', '2005-07-12T04:39:38', '2005-07-18T05:29:38', '1'), + ('215', '971', '2006-02-16T02:30:53', '2005-07-08T22:36:06', '2005-07-15T04:28:06', '1'), + ('445', '1910', '2006-02-16T02:30:53', '2005-07-28T14:00:47', '2005-08-02T10:01:47', '1'), + ('294', '406', '2006-02-16T02:30:53', '2005-07-29T23:04:25', '2005-08-05T22:12:25', '1'), + ('347', '4344', '2006-02-16T02:30:53', '2005-06-20T16:04:42', '2005-06-27T19:54:42', '1'), + ('207', '1597', '2006-02-16T02:30:53', '2005-08-20T12:56:03', '2005-08-27T11:58:03', '1'), + ('463', '2765', '2006-02-16T02:30:53', '2005-07-29T19:30:02', '2005-08-04T18:38:02', '1'), + ('352', '883', '2006-02-16T02:30:53', '2005-07-30T22:30:57', '2005-08-03T22:53:57', '1'), + ('204', '3423', '2006-02-16T02:30:53', '2005-05-31T02:49:43', '2005-06-04T03:48:43', '1'), + ('570', '2081', '2006-02-16T02:30:53', '2005-06-17T11:48:05', '2005-06-25T13:16:05', '1'), + ('204', '553', '2006-02-16T02:30:53', '2005-05-27T12:48:38', '2005-05-29T15:27:38', '1'), + ('366', '2824', '2006-02-16T02:30:53', '2005-08-23T03:03:40', '2005-08-24T01:06:40', '1'), + ('321', '2444', '2006-02-16T02:30:53', '2005-05-28T15:54:45', '2005-06-04T20:26:45', '1'), + ('5', '1299', '2006-02-16T02:30:53', '2005-08-17T16:28:53', '2005-08-25T10:31:53', '1'), + ('156', '3644', '2006-02-16T02:30:53', '2005-06-19T18:25:07', '2005-06-22T14:10:07', '1'), + ('488', '1679', '2006-02-16T02:30:53', '2005-08-17T10:20:39', '2005-08-23T13:37:39', '1'), + ('120', '103', '2006-02-16T02:30:53', '2005-06-19T19:18:27', '2005-06-27T21:48:27', '1'), + ('405', '506', '2006-02-16T02:30:53', '2005-08-01T09:54:41', '2005-08-04T13:31:41', '1'), + ('230', '3469', '2006-02-16T02:30:53', '2005-07-29T21:51:26', '2005-08-03T22:37:26', '1'), + ('353', '3946', '2006-02-16T02:30:53', '2005-08-17T07:09:59', '2005-08-19T04:31:59', '1'), + ('293', '1628', '2006-02-16T02:30:53', '2005-07-29T12:28:17', '2005-08-05T11:40:17', '1'), + ('220', '4291', '2006-02-16T02:30:53', '2005-08-02T05:58:12', '2005-08-07T11:26:12', '1'), + ('570', '3465', '2006-02-16T02:30:53', '2005-08-21T23:44:53', '2005-08-27T20:33:53', '1'), + ('273', '4213', '2006-02-16T02:30:53', '2005-06-15T16:11:21', '2005-06-22T21:32:21', '1'), + ('282', '3453', '2006-02-16T02:30:53', '2005-06-21T16:15:11', '2005-06-27T14:55:11', '1'), + ('507', '1605', '2006-02-16T02:30:53', '2005-07-30T05:02:52', '2005-07-31T10:33:52', '1'), + ('497', '3657', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('185', '2714', '2006-02-16T02:30:53', '2005-07-11T07:05:06', '2005-07-20T09:27:06', '1'), + ('576', '646', '2006-02-16T02:30:53', '2005-07-31T17:00:07', '2005-08-08T20:40:07', '1'), + ('497', '380', '2006-02-16T02:30:53', '2005-07-09T13:12:35', '2005-07-10T13:37:35', '1'), + ('219', '726', '2006-02-16T02:30:53', '2005-07-09T23:31:38', '2005-07-12T03:51:38', '1'), + ('63', '3524', '2006-02-16T02:30:53', '2005-07-10T04:15:43', '2005-07-15T08:24:43', '1'), + ('331', '2628', '2006-02-16T02:30:53', '2005-08-02T17:47:25', '2005-08-07T20:14:25', '1'), + ('273', '299', '2006-02-16T02:30:53', '2005-07-12T12:44:04', '2005-07-16T14:17:04', '1'), + ('288', '1769', '2006-02-16T02:30:53', '2005-07-30T21:19:26', '2005-08-07T18:39:26', '1'), + ('494', '3604', '2006-02-16T02:30:53', '2005-07-30T05:18:57', '2005-08-06T06:21:57', '1'), + ('19', '2333', '2006-02-16T02:30:53', '2005-07-31T20:01:06', '2005-08-09T16:07:06', '1'), + ('162', '3997', '2006-02-16T02:30:53', '2005-06-20T22:48:44', '2005-06-21T21:25:44', '1'), + ('479', '110', '2006-02-16T02:30:53', '2005-06-17T10:40:36', '2005-06-23T14:23:36', '1'), + ('377', '118', '2006-02-16T02:30:53', '2005-06-20T15:22:32', '2005-06-24T11:08:32', '1'), + ('247', '2523', '2006-02-16T02:30:53', '2005-07-06T21:58:08', '2005-07-08T03:43:08', '1'), + ('575', '244', '2006-02-16T02:30:53', '2005-06-15T21:54:20', '2005-06-19T18:46:20', '1'), + ('352', '3690', '2006-02-16T02:30:53', '2005-06-15T21:58:00', '2005-06-17T21:50:00', '1'), + ('400', '2508', '2006-02-16T02:30:53', '2005-07-09T12:05:45', '2005-07-13T12:11:45', '1'), + ('306', '2929', '2006-02-16T02:30:53', '2005-08-19T07:19:04', '2005-08-21T10:58:04', '1'), + ('52', '1364', '2006-02-16T02:30:53', '2005-07-27T17:40:40', '2005-08-05T15:25:40', '1'), + ('73', '1302', '2006-02-16T02:30:53', '2005-08-23T09:02:03', '2005-08-24T05:47:03', '1'), + ('343', '373', '2006-02-16T02:30:53', '2005-05-25T17:22:10', '2005-05-31T19:47:10', '1'), + ('306', '1876', '2006-02-16T02:30:53', '2005-08-18T03:00:11', '2005-08-24T05:01:11', '1'), + ('87', '33', '2006-02-16T02:30:53', '2005-08-01T00:48:24', '2005-08-06T23:53:24', '1'), + ('592', '4191', '2006-02-16T02:30:53', '2005-07-29T18:23:34', '2005-08-01T19:56:34', '1'), + ('565', '3388', '2006-02-16T02:30:53', '2005-08-02T02:04:03', '2005-08-09T03:21:03', '1'), + ('83', '1382', '2006-02-16T02:30:53', '2005-06-16T07:06:06', '2005-06-25T03:35:06', '1'), + ('133', '2661', '2006-02-16T02:30:53', '2005-07-08T17:54:18', '2005-07-11T23:41:18', '1'), + ('445', '4528', '2006-02-16T02:30:53', '2005-08-17T14:21:11', '2005-08-25T19:46:11', '1'), + ('144', '2211', '2006-02-16T02:30:53', '2005-06-20T20:21:17', '2005-06-22T14:44:17', '1'), + ('98', '416', '2006-02-16T02:30:53', '2005-07-27T05:56:39', '2005-08-04T10:57:39', '1'), + ('561', '2104', '2006-02-16T02:30:53', '2005-06-17T20:34:42', '2005-06-22T00:05:42', '1'), + ('156', '165', '2006-02-16T02:30:53', '2005-08-22T23:26:32', '2005-08-30T20:22:32', '1'), + ('269', '3397', '2006-02-16T02:30:53', '2005-07-27T03:03:09', '2005-07-28T22:57:09', '1'), + ('112', '372', '2006-02-16T02:30:53', '2005-05-29T02:26:27', '2005-06-03T04:59:27', '1'), + ('286', '3626', '2006-02-16T02:30:53', '2005-07-07T13:39:01', '2005-07-12T18:29:01', '1'), + ('490', '2613', '2006-02-16T02:30:53', '2005-06-16T10:16:02', '2005-06-23T09:32:02', '1'), + ('122', '3197', '2006-02-16T02:30:53', '2005-06-19T05:43:55', '2005-06-25T10:20:55', '1'), + ('181', '2741', '2006-02-16T02:30:53', '2005-08-21T10:46:35', '2005-08-28T15:55:35', '1'), + ('578', '2769', '2006-02-16T02:30:53', '2005-07-28T23:45:41', '2005-08-02T00:14:41', '1'), + ('75', '3688', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('549', '1622', '2006-02-16T02:30:53', '2005-05-30T01:36:57', '2005-06-01T22:44:57', '1'), + ('582', '76', '2006-02-16T02:30:53', '2005-08-17T07:26:47', '2005-08-22T04:11:47', '1'), + ('582', '923', '2006-02-16T02:30:53', '2005-07-06T13:07:27', '2005-07-08T18:48:27', '1'), + ('84', '1961', '2006-02-16T02:30:53', '2005-08-19T11:27:43', '2005-08-20T10:58:43', '1'), + ('445', '1703', '2006-02-16T02:30:53', '2005-07-31T04:30:48', '2005-08-03T01:12:48', '1'), + ('149', '4572', '2006-02-16T02:30:53', '2005-07-09T05:52:54', '2005-07-10T02:49:54', '1'), + ('198', '926', '2006-02-16T02:30:53', '2005-07-27T12:24:12', '2005-07-31T15:34:12', '1'), + ('565', '2094', '2006-02-16T02:30:53', '2005-08-02T18:56:28', '2005-08-11T23:19:28', '1'), + ('586', '2939', '2006-02-16T02:30:53', '2005-08-02T05:54:53', '2005-08-09T04:14:53', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['9394', '2389', '6096', '6915', '495', '5189', '4382', '2558', '5877', '15507', '1179', '7487', '8957', '3952', '9150', '7069', '13249', '4764', '2601', '5398', '7707', '10449', '9296', '6102', '14209', '15448', '4066', '1452', '4825', '1362', '8952', '11209', '5246', '14743', '6366', '2651', '4837', '4274', '2078', '15755', '8140', '8582', '6919', '8876', '15440', '933', '12262', '1999', '14070', '6737', '13455', '13930', '125', '3657', '1103', '13726', '9808', '4883', '14883', '15718', '14496', '4205', '7180', '5735', '1933', '4232', '13476', '10860', '5123', '11612', '9212', '13438', '10164', '8502', '7605', '3843', '3262', '1942', '11729', '4516', '12202', '12756', '12758', '5153', '2551', '14191', '1457', '11428', '7146', '7638', '5027', '2055', '12561', '3040', '1226', '7441', '3674', '8294', '12051', '10288']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('204', '161', '2006-02-16T02:30:53', '2005-07-30T20:06:24', '2005-08-06T22:36:24', '1'), + ('382', '731', '2006-02-16T02:30:53', '2005-06-18T15:27:47', '2005-06-21T12:26:47', '1'), + ('420', '2720', '2006-02-16T02:30:53', '2005-07-11T06:18:04', '2005-07-14T01:15:04', '1'), + ('559', '1243', '2006-02-16T02:30:53', '2005-07-12T22:28:09', '2005-07-14T00:53:09', '1'), + ('526', '1007', '2006-02-16T02:30:53', '2005-05-28T00:40:48', '2005-05-29T06:07:48', '1'), + ('113', '2539', '2006-02-16T02:30:53', '2005-07-09T10:23:21', '2005-07-14T08:06:21', '1'), + ('26', '657', '2006-02-16T02:30:53', '2005-07-07T20:41:03', '2005-07-14T15:15:03', '1'), + ('361', '2920', '2006-02-16T02:30:53', '2005-06-19T03:09:16', '2005-06-24T05:29:16', '1'), + ('537', '1520', '2006-02-16T02:30:53', '2005-07-10T19:08:51', '2005-07-19T19:48:51', '1'), + ('563', '3130', '2006-02-16T02:30:53', '2005-08-23T02:48:26', '2005-08-27T01:32:26', '1'), + ('119', '816', '2006-02-16T02:30:53', '2005-06-15T00:36:50', '2005-06-22T22:09:50', '1'), + ('58', '4451', '2006-02-16T02:30:53', '2005-07-27T19:32:45', '2005-07-28T15:11:45', '1'), + ('158', '811', '2006-02-16T02:30:53', '2005-07-30T03:34:10', '2005-08-06T07:05:10', '1'), + ('417', '1719', '2006-02-16T02:30:53', '2005-07-06T21:51:31', '2005-07-13T15:54:31', '1'), + ('213', '2834', '2006-02-16T02:30:53', '2005-07-30T10:49:32', '2005-08-08T15:43:32', '1'), + ('343', '2073', '2006-02-16T02:30:53', '2005-07-27T03:59:35', '2005-08-05T03:33:35', '1'), + ('377', '3084', '2006-02-16T02:30:53', '2005-08-19T16:47:41', '2005-08-20T13:30:41', '1'), + ('89', '1188', '2006-02-16T02:30:53', '2005-07-08T15:01:25', '2005-07-17T15:16:25', '1'), + ('98', '2898', '2006-02-16T02:30:53', '2005-06-19T06:09:44', '2005-06-20T08:03:44', '1'), + ('199', '4352', '2006-02-16T02:30:53', '2005-07-09T19:44:58', '2005-07-17T00:56:58', '1'), + ('232', '2563', '2006-02-16T02:30:53', '2005-07-28T04:07:47', '2005-07-29T02:02:47', '1'), + ('213', '1395', '2006-02-16T02:30:53', '2005-08-01T09:09:59', '2005-08-05T11:25:59', '1'), + ('2', '4088', '2006-02-16T02:30:53', '2005-07-30T16:21:13', '2005-08-08T11:57:13', '1'), + ('146', '4305', '2006-02-16T02:30:53', '2005-07-11T06:53:09', '2005-07-17T07:05:09', '1'), + ('472', '896', '2006-02-16T02:30:53', '2005-08-21T04:17:56', '2005-08-27T06:57:56', '1'), + ('490', '2903', '2006-02-16T02:30:53', '2005-08-23T00:55:24', '2005-08-25T02:20:24', '1'), + ('368', '1975', '2006-02-16T02:30:53', '2005-07-07T04:34:09', '2005-07-10T23:54:09', '1'), + ('243', '4348', '2006-02-16T02:30:53', '2005-06-15T19:32:52', '2005-06-16T13:45:52', '1'), + ('563', '2419', '2006-02-16T02:30:53', '2005-07-08T17:43:01', '2005-07-11T20:58:01', '1'), + ('98', '4524', '2006-02-16T02:30:53', '2005-06-15T13:53:32', '2005-06-19T16:05:32', '1'), + ('36', '4397', '2006-02-16T02:30:53', '2005-07-30T03:20:38', '2005-08-02T02:54:38', '1'), + ('24', '3219', '2006-02-16T02:30:53', '2005-08-02T12:09:45', '2005-08-07T08:52:45', '1'), + ('276', '3548', '2006-02-16T02:30:53', '2005-07-09T13:25:18', '2005-07-13T18:38:18', '1'), + ('2', '4570', '2006-02-16T02:30:53', '2005-08-21T22:41:56', '2005-08-29T00:18:56', '1'), + ('366', '3989', '2006-02-16T02:30:53', '2005-07-11T21:18:16', '2005-07-17T00:21:16', '1'), + ('576', '2181', '2006-02-16T02:30:53', '2005-06-19T10:22:56', '2005-06-27T13:37:56', '1'), + ('149', '1944', '2006-02-16T02:30:53', '2005-07-08T18:09:12', '2005-07-11T16:40:12', '1'), + ('26', '787', '2006-02-16T02:30:53', '2005-07-07T14:42:04', '2005-07-13T20:23:04', '1'), + ('278', '2021', '2006-02-16T02:30:53', '2005-06-17T16:48:55', '2005-06-19T18:01:55', '1'), + ('423', '511', '2006-02-16T02:30:53', '2005-08-23T12:46:38', '2005-08-25T12:59:38', '1'), + ('119', '4270', '2006-02-16T02:30:53', '2005-07-28T20:17:50', '2005-07-30T18:07:50', '1'), + ('162', '841', '2006-02-16T02:30:53', '2005-07-29T12:03:27', '2005-08-03T07:02:27', '1'), + ('540', '1122', '2006-02-16T02:30:53', '2005-07-12T22:32:17', '2005-07-18T20:09:17', '1'), + ('579', '2394', '2006-02-16T02:30:53', '2005-07-30T00:15:09', '2005-08-02T23:56:09', '1'), + ('559', '2254', '2006-02-16T02:30:53', '2005-08-23T00:37:21', '2005-08-24T23:24:21', '1'), + ('66', '3672', '2006-02-16T02:30:53', '2005-05-30T13:08:45', '2005-06-01T18:56:45', '1'), + ('125', '591', '2006-02-16T02:30:53', '2005-08-18T04:16:15', '2005-08-20T09:16:15', '1'), + ('111', '3704', '2006-02-16T02:30:53', '2005-06-17T11:30:08', '2005-06-23T08:36:08', '1'), + ('581', '846', '2006-02-16T02:30:53', '2005-08-20T22:56:34', '2005-08-29T22:02:34', '1'), + ('304', '315', '2006-02-16T02:30:53', '2005-07-12T14:16:52', '2005-07-18T19:48:52', '1'), + ('133', '1315', '2006-02-16T02:30:53', '2005-08-20T00:32:17', '2005-08-26T19:33:17', '1'), + ('58', '3585', '2006-02-16T02:30:53', '2005-08-20T17:15:06', '2005-08-21T14:29:06', '1'), + ('368', '952', '2006-02-16T02:30:53', '2005-05-25T20:48:50', '2005-06-02T21:39:50', '1'), + ('113', '4134', '2006-02-16T02:30:53', '2005-07-06T07:55:30', '2005-07-11T07:18:30', '1'), + ('353', '3154', '2006-02-16T02:30:53', '2005-05-31T14:24:18', '2005-06-09T10:27:18', '1'), + ('214', '2258', '2006-02-16T02:30:53', '2005-08-20T10:08:40', '2005-08-23T14:58:40', '1'), + ('583', '3259', '2006-02-16T02:30:53', '2005-07-31T11:17:22', '2005-08-07T15:54:22', '1'), + ('563', '1366', '2006-02-16T02:30:53', '2005-07-08T19:46:58', '2005-07-10T15:48:58', '1'), + ('177', '1946', '2006-02-16T02:30:53', '2005-08-22T03:55:02', '2005-08-28T02:51:02', '1'), + ('276', '2180', '2006-02-16T02:30:53', '2005-08-23T11:05:17', '2005-08-28T12:50:17', '1'), + ('223', '2185', '2006-02-16T02:30:53', '2005-08-21T14:07:35', '2005-08-24T12:31:35', '1'), + ('486', '3922', '2006-02-16T02:30:53', '2005-07-07T11:25:39', '2005-07-11T06:12:39', '1'), + ('215', '460', '2006-02-16T02:30:53', '2005-07-27T08:14:34', '2005-07-31T05:24:34', '1'), + ('65', '3259', '2006-02-16T02:30:53', '2005-07-10T11:39:15', '2005-07-19T09:52:15', '1'), + ('13', '980', '2006-02-16T02:30:53', '2005-06-17T06:54:42', '2005-06-26T02:00:42', '1'), + ('347', '3841', '2006-02-16T02:30:53', '2005-07-07T12:49:12', '2005-07-15T16:45:12', '1'), + ('7', '2866', '2006-02-16T02:30:53', '2005-08-20T01:06:04', '2005-08-24T23:56:04', '1'), + ('25', '2827', '2006-02-16T02:30:53', '2005-08-02T00:12:32', '2005-08-04T03:50:32', '1'), + ('219', '4278', '2006-02-16T02:30:53', '2005-07-09T07:20:30', '2005-07-14T05:24:30', '1'), + ('526', '375', '2006-02-16T02:30:53', '2005-08-17T03:48:51', '2005-08-20T03:03:51', '1'), + ('73', '2111', '2006-02-16T02:30:53', '2005-07-30T13:03:13', '2005-08-06T09:48:13', '1'), + ('520', '1750', '2006-02-16T02:30:53', '2005-08-19T23:38:02', '2005-08-26T21:36:02', '1'), + ('89', '1405', '2006-02-16T02:30:53', '2005-07-31T23:17:57', '2005-08-05T19:43:57', '1'), + ('457', '2149', '2006-02-16T02:30:53', '2005-07-29T09:15:41', '2005-07-30T10:41:41', '1'), + ('576', '1391', '2006-02-16T02:30:53', '2005-07-27T23:57:01', '2005-08-03T04:11:01', '1'), + ('62', '3844', '2006-02-16T02:30:53', '2005-07-06T16:35:40', '2005-07-07T18:29:40', '1'), + ('9', '3773', '2006-02-16T02:30:53', '2005-06-21T04:08:43', '2005-06-28T02:55:43', '1'), + ('143', '261', '2006-02-16T02:30:53', '2005-06-17T07:43:39', '2005-06-25T02:24:39', '1'), + ('215', '2819', '2006-02-16T02:30:53', '2005-08-17T08:14:41', '2005-08-22T02:54:41', '1'), + ('497', '2314', '2006-02-16T02:30:53', '2005-07-08T02:43:41', '2005-07-14T02:20:41', '1'), + ('563', '672', '2006-02-16T02:30:53', '2005-08-18T02:14:08', '2005-08-24T04:35:08', '1'), + ('89', '1840', '2006-02-16T02:30:53', '2005-08-18T22:52:13', '2005-08-21T17:22:13', '1'), + ('30', '2279', '2006-02-16T02:30:53', '2005-08-18T22:58:34', '2005-08-22T23:33:34', '1'), + ('504', '2826', '2006-02-16T02:30:53', '2005-07-09T08:35:05', '2005-07-18T14:21:05', '1'), + ('444', '2007', '2006-02-16T02:30:53', '2005-06-19T02:51:04', '2005-06-28T05:02:04', '1'), + ('423', '301', '2006-02-16T02:30:53', '2005-08-21T03:35:58', '2005-08-28T00:28:58', '1'), + ('345', '730', '2006-02-16T02:30:53', '2005-06-15T20:05:49', '2005-06-19T15:35:49', '1'), + ('326', '722', '2006-02-16T02:30:53', '2005-08-02T20:03:10', '2005-08-04T01:55:10', '1'), + ('323', '2245', '2006-02-16T02:30:53', '2005-07-27T07:02:30', '2005-08-05T10:29:30', '1'), + ('172', '1890', '2006-02-16T02:30:53', '2005-07-28T01:13:26', '2005-07-28T20:34:26', '1'), + ('109', '2179', '2006-02-16T02:30:53', '2005-07-09T02:32:37', '2005-07-16T23:13:37', '1'), + ('593', '1399', '2006-02-16T02:30:53', '2005-06-17T15:27:03', '2005-06-25T13:44:03', '1'), + ('392', '812', '2006-02-16T02:30:53', '2005-08-18T14:58:51', '2005-08-20T10:53:51', '1'), + ('162', '2568', '2006-02-16T02:30:53', '2005-06-20T12:34:13', '2005-06-21T12:33:13', '1'), + ('409', '2290', '2006-02-16T02:30:53', '2005-06-15T03:46:10', '2005-06-23T02:00:10', '1'), + ('198', '4039', '2006-02-16T02:30:53', '2005-07-27T17:46:53', '2005-07-31T23:05:53', '1'), + ('559', '3686', '2006-02-16T02:30:53', '2005-07-06T09:03:13', '2005-07-13T08:43:13', '1'), + ('520', '1811', '2006-02-16T02:30:53', '2005-07-29T02:32:41', '2005-08-02T06:28:41', '1'), + ('579', '4001', '2006-02-16T02:30:53', '2005-08-17T20:56:15', '2005-08-25T19:08:15', '1'), + ('63', '572', '2006-02-16T02:30:53', '2005-08-01T03:38:42', '2005-08-06T04:34:42', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['7265', '12342', '8584', '5561', '12394', '3032', '3490', '5068', '3384', '3126', '11991', '9422', '7344', '13562', '3235', '14149', '11455', '10951', '4334', '1891', '4081', '13105', '4748', '5757', '8500', '3415', '9028', '3826', '1263', '12042', '7877', '11392', '10466', '962', '13071', '11495', '6874', '13805', '4803', '6896', '8861', '12606', '14123', '4421', '4678', '9102', '1095', '15461', '6360', '3669', '9624', '4993', '64', '4198', '4475', '90', '3418', '8170', '13212', '9675', '14088', '7805', '12863', '14789', '292', '9442', '7024', '14795', '1324', '12138', '4629', '6607', '2186', '7326', '8374', '1879', '1347', '9367', '3535', '3440', '8907', '12347', '11040', '1928', '13559', '5081', '7839', '3221', '8934', '12168', '11181', '14141', '698', '8485', '1019', '9550', '4255', '14739', '15663', '6478']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('290', '3465', '2006-02-16T02:30:53', '2005-07-27T11:19:01', '2005-08-01T09:29:01', '1'), + ('63', '1408', '2006-02-16T02:30:53', '2005-08-18T07:12:46', '2005-08-21T07:44:46', '1'), + ('482', '1656', '2006-02-16T02:30:53', '2005-07-29T12:07:53', '2005-07-31T09:27:53', '1'), + ('369', '1048', '2006-02-16T02:30:53', '2005-07-10T03:15:24', '2005-07-15T06:46:24', '1'), + ('330', '3605', '2006-02-16T02:30:53', '2005-08-18T09:05:15', '2005-08-23T11:10:15', '1'), + ('172', '3734', '2006-02-16T02:30:53', '2005-06-20T11:58:30', '2005-06-24T09:49:30', '1'), + ('369', '3041', '2006-02-16T02:30:53', '2005-07-05T23:37:13', '2005-07-12T22:07:13', '1'), + ('10', '2937', '2006-02-16T02:30:53', '2005-07-09T04:53:18', '2005-07-13T09:21:18', '1'), + ('91', '409', '2006-02-16T02:30:53', '2005-06-21T14:07:35', '2005-06-26T16:34:35', '1'), + ('5', '1183', '2006-02-16T02:30:53', '2005-06-20T18:38:22', '2005-06-26T00:00:22', '1'), + ('361', '940', '2006-02-16T02:30:53', '2005-08-17T18:27:08', '2005-08-25T14:07:08', '1'), + ('470', '1843', '2006-02-16T02:30:53', '2005-07-30T21:08:41', '2005-08-07T15:55:41', '1'), + ('366', '1714', '2006-02-16T02:30:53', '2005-07-27T14:29:28', '2005-07-31T15:36:28', '1'), + ('36', '4547', '2006-02-16T02:30:53', '2005-08-20T04:31:45', '2005-08-25T09:59:45', '1'), + ('49', '212', '2006-02-16T02:30:53', '2005-06-21T02:46:17', '2005-06-22T20:58:17', '1'), + ('518', '3371', '2006-02-16T02:30:53', '2005-08-21T02:22:47', '2005-08-24T02:36:47', '1'), + ('498', '2000', '2006-02-16T02:30:53', '2005-08-02T21:07:06', '2005-08-12T01:21:06', '1'), + ('144', '173', '2006-02-16T02:30:53', '2005-08-02T03:26:35', '2005-08-07T22:03:35', '1'), + ('210', '3021', '2006-02-16T02:30:53', '2005-07-07T18:32:04', '2005-07-08T16:19:04', '1'), + ('109', '3576', '2006-02-16T02:30:53', '2005-06-17T04:16:44', '2005-06-24T07:20:44', '1'), + ('284', '1138', '2006-02-16T02:30:53', '2005-07-07T05:10:08', '2005-07-12T00:47:08', '1'), + ('279', '729', '2006-02-16T02:30:53', '2005-08-19T11:06:16', '2005-08-27T15:21:16', '1'), + ('9', '4279', '2006-02-16T02:30:53', '2005-07-08T13:59:38', '2005-07-15T16:51:38', '1'), + ('101', '1827', '2006-02-16T02:30:53', '2005-07-10T12:40:17', '2005-07-12T14:02:17', '1'), + ('348', '4516', '2006-02-16T02:30:53', '2005-07-29T09:12:01', '2005-07-31T10:15:01', '1'), + ('444', '3540', '2006-02-16T02:30:53', '2005-06-21T16:59:49', '2005-06-27T17:19:49', '1'), + ('119', '2687', '2006-02-16T02:30:53', '2005-07-30T06:00:35', '2005-08-02T01:35:35', '1'), + ('451', '73', '2006-02-16T02:30:53', '2005-07-06T15:51:58', '2005-07-13T12:35:58', '1'), + ('540', '4144', '2006-02-16T02:30:53', '2005-06-15T06:56:39', '2005-06-16T11:08:39', '1'), + ('570', '1772', '2006-02-16T02:30:53', '2005-08-17T20:36:37', '2005-08-21T15:03:37', '1'), + ('65', '2576', '2006-02-16T02:30:53', '2005-07-28T10:25:36', '2005-08-05T12:46:36', '1'), + ('146', '261', '2006-02-16T02:30:53', '2005-08-02T18:41:11', '2005-08-11T21:41:11', '1'), + ('2', '138', '2006-02-16T02:30:53', '2005-08-01T09:45:26', '2005-08-06T06:28:26', '1'), + ('520', '4535', '2006-02-16T02:30:53', '2005-05-30T18:45:17', '2005-06-05T22:47:17', '1'), + ('578', '527', '2006-02-16T02:30:53', '2005-08-19T10:01:07', '2005-08-26T14:26:07', '1'), + ('247', '1265', '2006-02-16T02:30:53', '2005-08-16T22:51:20', '2005-08-23T00:44:20', '1'), + ('539', '4478', '2006-02-16T02:30:53', '2005-07-12T20:20:53', '2005-07-19T19:41:53', '1'), + ('454', '349', '2006-02-16T02:30:53', '2005-08-20T12:53:12', '2005-08-27T15:21:12', '1'), + ('174', '1786', '2006-02-16T02:30:53', '2005-07-08T16:56:34', '2005-07-14T20:16:34', '1'), + ('111', '1266', '2006-02-16T02:30:53', '2005-07-12T21:25:37', '2005-07-20T23:51:37', '1'), + ('560', '759', '2006-02-16T02:30:53', '2005-07-29T23:47:29', '2005-08-07T01:27:29', '1'), + ('275', '359', '2006-02-16T02:30:53', '2005-08-18T17:02:21', '2005-08-24T22:38:21', '1'), + ('66', '143', '2006-02-16T02:30:53', '2005-08-21T01:31:25', '2005-08-23T02:32:25', '1'), + ('417', '4103', '2006-02-16T02:30:53', '2005-07-07T22:07:55', '2005-07-16T20:21:55', '1'), + ('219', '241', '2006-02-16T02:30:53', '2005-07-08T10:30:40', '2005-07-13T11:08:40', '1'), + ('276', '1154', '2006-02-16T02:30:53', '2005-07-30T08:48:20', '2005-08-04T10:19:20', '1'), + ('252', '4546', '2006-02-16T02:30:53', '2005-05-31T13:15:41', '2005-06-05T12:10:41', '1'), + ('103', '4542', '2006-02-16T02:30:53', '2005-08-23T01:13:52', '2005-08-30T00:44:52', '1'), + ('338', '3075', '2006-02-16T02:30:53', '2005-07-11T21:07:40', '2005-07-16T15:11:40', '1'), + ('530', '1299', '2006-02-16T02:30:53', '2005-07-06T08:38:29', '2005-07-10T05:28:29', '1'), + ('7', '3480', '2006-02-16T02:30:53', '2005-07-31T04:30:03', '2005-08-06T09:13:03', '1'), + ('517', '1740', '2006-02-16T02:30:53', '2005-07-09T00:49:47', '2005-07-11T21:19:47', '1'), + ('368', '79', '2006-02-16T02:30:53', '2005-05-25T09:21:29', '2005-06-03T11:31:29', '1'), + ('247', '333', '2006-02-16T02:30:53', '2005-07-07T11:08:11', '2005-07-16T15:29:11', '1'), + ('340', '3466', '2006-02-16T02:30:53', '2005-07-08T00:27:30', '2005-07-09T05:39:30', '1'), + ('25', '2984', '2006-02-16T02:30:53', '2005-05-25T14:31:25', '2005-06-01T10:07:25', '1'), + ('85', '4115', '2006-02-16T02:30:53', '2005-06-21T17:06:38', '2005-06-25T19:43:38', '1'), + ('40', '2495', '2006-02-16T02:30:53', '2005-07-28T21:32:29', '2005-08-03T22:02:29', '1'), + ('158', '3691', '2006-02-16T02:30:53', '2005-08-19T15:24:07', '2005-08-24T21:03:07', '1'), + ('243', '2523', '2006-02-16T02:30:53', '2005-07-31T06:37:07', '2005-08-03T07:03:07', '1'), + ('518', '1184', '2006-02-16T02:30:53', '2005-08-20T23:57:24', '2005-08-28T21:49:24', '1'), + ('366', '3204', '2006-02-16T02:30:53', '2005-07-28T07:56:41', '2005-08-04T06:53:41', '1'), + ('234', '780', '2006-02-16T02:30:53', '2005-08-19T02:35:59', '2005-08-21T21:13:59', '1'), + ('279', '2344', '2006-02-16T02:30:53', '2005-08-22T00:29:39', '2005-08-25T02:25:39', '1'), + ('515', '4264', '2006-02-16T02:30:53', '2005-05-26T20:22:12', '2005-06-05T00:58:12', '1'), + ('75', '44', '2006-02-16T02:30:53', '2005-07-30T21:44:31', '2005-08-04T01:29:31', '1'), + ('252', '3113', '2006-02-16T02:30:53', '2005-07-27T02:36:40', '2005-07-28T06:58:40', '1'), + ('303', '1695', '2006-02-16T02:30:53', '2005-08-22T00:40:22', '2005-08-26T01:37:22', '1'), + ('394', '764', '2006-02-16T02:30:53', '2005-06-15T11:02:45', '2005-06-17T07:14:45', '1'), + ('317', '388', '2006-02-16T02:30:53', '2005-08-17T23:55:54', '2005-08-26T23:32:54', '1'), + ('563', '228', '2006-02-16T02:30:53', '2005-07-08T08:31:26', '2005-07-17T12:07:26', '1'), + ('562', '337', '2006-02-16T02:30:53', '2005-07-12T08:08:50', '2005-07-20T09:17:50', '1'), + ('204', '2050', '2006-02-16T02:30:53', '2005-06-18T01:15:27', '2005-06-21T06:16:27', '1'), + ('432', '2844', '2006-02-16T02:30:53', '2005-07-27T13:50:40', '2005-07-30T08:16:40', '1'), + ('589', '1084', '2006-02-16T02:30:53', '2005-07-29T05:24:02', '2005-08-05T03:55:02', '1'), + ('343', '3983', '2006-02-16T02:30:53', '2005-06-17T02:57:34', '2005-06-19T00:00:34', '1'), + ('190', '374', '2006-02-16T02:30:53', '2005-06-15T12:43:43', '2005-06-16T09:55:43', '1'), + ('557', '793', '2006-02-16T02:30:53', '2005-07-30T18:49:58', '2005-08-08T22:04:58', '1'), + ('65', '4214', '2006-02-16T02:30:53', '2005-07-06T01:32:46', '2005-07-11T03:15:46', '1'), + ('491', '853', '2006-02-16T02:30:53', '2005-06-21T19:58:18', '2005-06-27T22:08:18', '1'), + ('576', '3239', '2006-02-16T02:30:53', '2005-07-30T01:25:03', '2005-08-03T05:41:03', '1'), + ('454', '1788', '2006-02-16T02:30:53', '2005-08-18T07:18:10', '2005-08-19T05:49:10', '1'), + ('223', '2297', '2006-02-16T02:30:53', '2005-08-02T06:03:22', '2005-08-03T07:58:22', '1'), + ('353', '3454', '2006-02-16T02:30:53', '2005-06-17T06:48:31', '2005-06-26T08:17:31', '1'), + ('444', '2413', '2006-02-16T02:30:53', '2005-08-20T04:16:07', '2005-08-24T23:23:07', '1'), + ('420', '1953', '2006-02-16T02:30:53', '2005-07-09T05:25:20', '2005-07-13T23:45:20', '1'), + ('518', '914', '2006-02-16T02:30:53', '2005-07-28T09:01:13', '2005-08-04T11:46:13', '1'), + ('454', '245', '2006-02-16T02:30:53', '2005-06-21T01:49:47', '2005-06-25T06:31:47', '1'), + ('494', '3223', '2006-02-16T02:30:53', '2005-07-30T02:37:05', '2005-08-01T20:42:05', '1'), + ('535', '2859', '2006-02-16T02:30:53', '2005-08-18T01:03:52', '2005-08-18T20:19:52', '1'), + ('557', '3127', '2006-02-16T02:30:53', '2005-08-02T10:55:03', '2005-08-07T10:43:03', '1'), + ('190', '4527', '2006-02-16T02:30:53', '2005-08-21T02:07:22', '2005-08-30T07:32:22', '1'), + ('109', '1412', '2006-02-16T02:30:53', '2005-05-29T02:10:52', '2005-06-01T21:52:52', '1'), + ('420', '3172', '2006-02-16T02:30:53', '2005-07-29T08:53:09', '2005-07-30T11:25:09', '1'), + ('279', '3975', '2006-02-16T02:30:53', '2005-05-31T03:05:07', '2005-06-03T08:34:07', '1'), + ('583', '2233', '2006-02-16T02:30:53', '2005-07-31T01:57:34', '2005-08-08T23:33:34', '1'), + ('10', '749', '2006-02-16T02:30:53', '2005-07-07T14:14:13', '2005-07-12T18:32:13', '1'), + ('226', '4026', '2006-02-16T02:30:53', '2005-08-21T22:33:22', '2005-08-22T19:45:22', '1'), + ('291', '3291', '2006-02-16T02:30:53', '2005-08-23T08:54:26', '2005-08-29T02:56:26', '1'), + ('483', '2589', '2006-02-16T02:30:53', '2005-07-12T01:41:44', '2005-07-15T20:48:44', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['4381', '2376', '11827', '1564', '3803', '10907', '7417', '5684', '2318', '4410', '9049', '1275', '6326', '12541', '7657', '11777', '8480', '4083', '8361', '13631', '7808', '10337', '12999', '11655', '10667', '7131', '10099', '565', '14791', '924', '1411', '4532', '9390', '12291', '5315', '430', '5248', '276', '7454', '188', '14556', '2416', '6131', '8385', '3380', '13635', '6727', '6724', '5853', '12628', '3766', '2221', '7828', '15771', '328', '3055', '6918', '4591', '6399', '12187', '2029', '7398', '11232', '14482', '423', '4666', '294', '5079', '3943', '10484', '8223', '386', '5083', '450', '1133', '12145', '9752', '3388', '11937', '13800', '8623', '1236', '13456', '8588', '4341', '10363', '5300', '8474', '13180', '11806', '2788', '9334', '6238', '1284', '12610', '7516', '2232', '4218', '4326', '7199']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('486', '3727', '2006-02-16T02:30:53', '2005-07-07T20:37:53', '2005-07-10T16:54:53', '1'), + ('479', '3664', '2006-02-16T02:30:53', '2005-06-18T14:55:30', '2005-06-25T17:40:30', '1'), + ('523', '3064', '2006-02-16T02:30:53', '2005-08-17T12:44:27', '2005-08-24T13:31:27', '1'), + ('343', '145', '2006-02-16T02:30:53', '2005-06-16T02:47:07', '2005-06-24T03:12:07', '1'), + ('494', '2062', '2006-02-16T02:30:53', '2005-07-06T15:06:55', '2005-07-08T18:53:55', '1'), + ('561', '1430', '2006-02-16T02:30:53', '2005-08-02T01:51:48', '2005-08-02T19:53:48', '1'), + ('214', '2952', '2006-02-16T02:30:53', '2005-07-27T16:58:33', '2005-07-30T22:17:33', '1'), + ('132', '99', '2006-02-16T02:30:53', '2005-07-10T08:59:03', '2005-07-15T07:21:03', '1'), + ('383', '2328', '2006-02-16T02:30:53', '2005-06-18T09:13:54', '2005-06-23T07:19:54', '1'), + ('584', '2754', '2006-02-16T02:30:53', '2005-07-07T21:48:16', '2005-07-09T03:15:16', '1'), + ('417', '2620', '2006-02-16T02:30:53', '2005-07-30T06:57:28', '2005-08-04T09:02:28', '1'), + ('214', '950', '2006-02-16T02:30:53', '2005-06-15T07:55:43', '2005-06-20T06:30:43', '1'), + ('563', '2137', '2006-02-16T02:30:53', '2005-07-11T19:06:55', '2005-07-12T20:41:55', '1'), + ('584', '4357', '2006-02-16T02:30:53', '2005-08-18T14:18:30', '2005-08-26T10:24:30', '1'), + ('518', '2319', '2006-02-16T02:30:53', '2005-07-28T02:09:00', '2005-08-04T21:44:00', '1'), + ('83', '4065', '2006-02-16T02:30:53', '2005-08-17T10:27:19', '2005-08-26T13:10:19', '1'), + ('467', '3512', '2006-02-16T02:30:53', '2005-07-29T08:44:46', '2005-08-05T13:22:46', '1'), + ('490', '3454', '2006-02-16T02:30:53', '2005-07-07T05:13:15', '2005-07-08T09:11:15', '1'), + ('360', '3404', '2006-02-16T02:30:53', '2005-07-29T05:08:57', '2005-08-03T02:49:57', '1'), + ('535', '1015', '2006-02-16T02:30:53', '2005-08-20T07:07:37', '2005-08-22T04:01:37', '1'), + ('327', '4052', '2006-02-16T02:30:53', '2005-07-28T07:58:56', '2005-08-02T10:49:56', '1'), + ('451', '307', '2006-02-16T02:30:53', '2005-08-01T05:01:46', '2005-08-10T02:41:46', '1'), + ('24', '661', '2006-02-16T02:30:53', '2005-08-19T07:34:53', '2005-08-26T03:57:53', '1'), + ('113', '1699', '2006-02-16T02:30:53', '2005-08-17T05:11:07', '2005-08-26T10:18:07', '1'), + ('340', '3937', '2006-02-16T02:30:53', '2005-08-01T16:58:22', '2005-08-10T15:41:22', '1'), + ('585', '2832', '2006-02-16T02:30:53', '2005-07-27T06:25:06', '2005-07-31T09:07:06', '1'), + ('220', '1960', '2006-02-16T02:30:53', '2005-07-31T20:47:14', '2005-08-02T17:25:14', '1'), + ('288', '1494', '2006-02-16T02:30:53', '2005-05-28T09:26:31', '2005-06-01T07:28:31', '1'), + ('317', '1490', '2006-02-16T02:30:53', '2005-08-22T00:35:55', '2005-08-30T20:23:55', '1'), + ('293', '3279', '2006-02-16T02:30:53', '2005-05-30T12:10:59', '2005-06-04T17:28:59', '1'), + ('520', '2276', '2006-02-16T02:30:53', '2005-06-15T17:05:36', '2005-06-21T14:05:36', '1'), + ('481', '4012', '2006-02-16T02:30:53', '2005-07-08T03:30:39', '2005-07-11T21:49:39', '1'), + ('103', '1794', '2006-02-16T02:30:53', '2005-07-30T19:42:07', '2005-08-01T23:17:07', '1'), + ('73', '4270', '2006-02-16T02:30:53', '2005-08-18T05:08:37', '2005-08-23T09:01:37', '1'), + ('134', '585', '2006-02-16T02:30:53', '2005-07-09T16:09:19', '2005-07-14T21:10:19', '1'), + ('190', '1920', '2006-02-16T02:30:53', '2005-05-27T16:22:10', '2005-06-05T13:10:10', '1'), + ('279', '246', '2006-02-16T02:30:53', '2005-07-09T13:29:44', '2005-07-12T18:12:44', '1'), + ('58', '1221', '2006-02-16T02:30:53', '2005-05-26T17:16:07', '2005-06-03T12:59:07', '1'), + ('75', '3248', '2006-02-16T02:30:53', '2005-07-27T18:27:26', '2005-07-30T23:50:26', '1'), + ('243', '3342', '2006-02-16T02:30:53', '2005-05-26T05:47:12', '2005-05-26T23:48:12', '1'), + ('265', '475', '2006-02-16T02:30:53', '2005-08-21T16:03:27', '2005-08-29T15:49:27', '1'), + ('26', '2868', '2006-02-16T02:30:53', '2005-06-18T17:07:34', '2005-06-24T19:16:34', '1'), + ('107', '3313', '2006-02-16T02:30:53', '2005-07-11T08:22:05', '2005-07-14T07:40:05', '1'), + ('233', '4108', '2006-02-16T02:30:53', '2005-07-29T05:39:16', '2005-08-03T00:30:16', '1'), + ('483', '3212', '2006-02-16T02:30:53', '2005-06-21T13:58:46', '2005-06-30T09:29:46', '1'), + ('286', '669', '2006-02-16T02:30:53', '2005-08-20T07:17:35', '2005-08-29T06:27:35', '1'), + ('407', '3793', '2006-02-16T02:30:53', '2005-07-12T13:54:25', '2005-07-14T17:29:25', '1'), + ('262', '2486', '2006-02-16T02:30:53', '2005-07-12T13:45:15', '2005-07-19T19:18:15', '1'), + ('520', '3026', '2006-02-16T02:30:53', '2005-07-10T17:45:13', '2005-07-17T21:37:13', '1'), + ('520', '3210', '2006-02-16T02:30:53', '2005-08-18T17:40:25', '2005-08-25T13:39:25', '1'), + ('312', '4504', '2006-02-16T02:30:53', '2005-07-06T13:04:35', '2005-07-07T15:46:35', '1'), + ('156', '3905', '2006-02-16T02:30:53', '2005-06-18T03:24:56', '2005-06-22T08:27:56', '1'), + ('212', '1710', '2006-02-16T02:30:53', '2005-07-28T08:40:46', '2005-07-30T14:22:46', '1'), + ('262', '3667', '2006-02-16T02:30:53', '2005-08-23T13:18:46', '2005-08-26T07:29:46', '1'), + ('451', '2524', '2006-02-16T02:30:53', '2005-05-27T01:29:31', '2005-06-01T02:27:31', '1'), + ('23', '1510', '2006-02-16T02:30:53', '2005-06-20T13:19:58', '2005-06-27T14:54:58', '1'), + ('140', '4085', '2006-02-16T02:30:53', '2005-07-12T22:30:29', '2005-07-19T22:51:29', '1'), + ('182', '2276', '2006-02-16T02:30:53', '2005-07-08T06:29:43', '2005-07-17T07:20:43', '1'), + ('288', '2031', '2006-02-16T02:30:53', '2005-07-11T22:39:05', '2005-07-16T01:12:05', '1'), + ('38', '3360', '2006-02-16T02:30:53', '2005-08-18T01:45:50', '2005-08-22T20:12:50', '1'), + ('512', '914', '2006-02-16T02:30:53', '2005-06-17T13:10:59', '2005-06-19T18:15:59', '1'), + ('51', '1572', '2006-02-16T02:30:53', '2005-07-27T16:07:22', '2005-08-05T16:16:22', '1'), + ('8', '971', '2006-02-16T02:30:53', '2005-08-02T13:04:12', '2005-08-10T15:39:12', '1'), + ('23', '2765', '2006-02-16T02:30:53', '2005-08-21T13:42:45', '2005-08-27T11:55:45', '1'), + ('284', '1783', '2006-02-16T02:30:53', '2005-05-27T15:32:57', '2005-06-02T19:03:57', '1'), + ('120', '4576', '2006-02-16T02:30:53', '2005-07-08T10:05:02', '2005-07-16T07:28:02', '1'), + ('369', '2751', '2006-02-16T02:30:53', '2005-05-26T20:29:57', '2005-05-28T17:20:57', '1'), + ('566', '3948', '2006-02-16T02:30:53', '2005-07-09T05:20:40', '2005-07-17T00:06:40', '1'), + ('566', '1816', '2006-02-16T02:30:53', '2005-07-06T21:22:17', '2005-07-07T21:26:17', '1'), + ('400', '1908', '2006-02-16T02:30:53', '2005-08-01T10:19:53', '2005-08-03T05:36:53', '1'), + ('282', '4508', '2006-02-16T02:30:53', '2005-07-28T23:56:01', '2005-08-03T22:27:01', '1'), + ('109', '1288', '2006-02-16T02:30:53', '2005-05-27T10:26:31', '2005-05-30T08:32:31', '1'), + ('494', '148', '2006-02-16T02:30:53', '2005-07-09T05:30:32', '2005-07-11T02:20:32', '1'), + ('247', '1343', '2006-02-16T02:30:53', '2005-05-27T19:18:54', '2005-06-05T23:52:54', '1'), + ('73', '4271', '2006-02-16T02:30:53', '2005-05-31T19:12:21', '2005-06-02T20:12:21', '1'), + ('5', '3482', '2006-02-16T02:30:53', '2005-08-18T00:10:04', '2005-08-26T00:51:04', '1'), + ('199', '249', '2006-02-16T02:30:53', '2005-07-31T09:22:02', '2005-08-02T14:34:02', '1'), + ('119', '556', '2006-02-16T02:30:53', '2005-06-21T14:34:51', '2005-06-28T18:19:51', '1'), + ('515', '2926', '2006-02-16T02:30:53', '2005-08-17T16:48:36', '2005-08-24T19:01:36', '1'), + ('407', '1552', '2006-02-16T02:30:53', '2005-08-20T12:40:48', '2005-08-22T15:06:48', '1'), + ('142', '458', '2006-02-16T02:30:53', '2005-07-29T13:55:11', '2005-08-05T11:16:11', '1'), + ('66', '3182', '2006-02-16T02:30:53', '2005-06-15T04:34:27', '2005-06-18T08:15:27', '1'), + ('13', '1644', '2006-02-16T02:30:53', '2005-08-20T00:33:19', '2005-08-22T01:47:19', '1'), + ('416', '2858', '2006-02-16T02:30:53', '2005-07-29T12:22:20', '2005-07-31T10:49:20', '1'), + ('124', '4523', '2006-02-16T02:30:53', '2005-07-07T18:44:23', '2005-07-15T18:13:23', '1'), + ('174', '320', '2006-02-16T02:30:53', '2005-08-01T06:01:52', '2005-08-05T03:56:52', '1'), + ('8', '2520', '2006-02-16T02:30:53', '2005-07-09T15:40:46', '2005-07-15T13:46:46', '1'), + ('323', '4346', '2006-02-16T02:30:53', '2005-07-29T08:36:56', '2005-08-01T03:07:56', '1'), + ('322', '3443', '2006-02-16T02:30:53', '2005-08-19T14:00:38', '2005-08-20T09:56:38', '1'), + ('125', '3203', '2006-02-16T02:30:53', '2005-08-17T11:49:28', '2005-08-22T15:42:28', '1'), + ('171', '1457', '2006-02-16T02:30:53', '2005-06-19T18:48:11', '2005-06-21T13:32:11', '1'), + ('25', '1499', '2006-02-16T02:30:53', '2005-07-30T17:56:38', '2005-08-03T21:27:38', '1'), + ('23', '3749', '2006-02-16T02:30:53', '2005-07-11T14:20:18', '2005-07-14T18:34:18', '1'), + ('463', '1387', '2006-02-16T02:30:53', '2005-06-15T08:27:33', '2005-06-17T03:58:33', '1'), + ('269', '3181', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('134', '2178', '2006-02-16T02:30:53', '2005-07-27T20:55:28', '2005-07-30T00:50:28', '1'), + ('52', '2463', '2006-02-16T02:30:53', '2005-06-18T03:54:31', '2005-06-22T07:29:31', '1'), + ('497', '152', '2006-02-16T02:30:53', '2005-07-07T12:10:24', '2005-07-15T16:09:24', '1'), + ('331', '4037', '2006-02-16T02:30:53', '2005-07-07T18:01:22', '2005-07-16T15:45:22', '1'), + ('292', '3685', '2006-02-16T02:30:53', '2005-07-27T08:53:23', '2005-08-03T10:01:23', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['11379', '11576', '14272', '5045', '3469', '15472', '11179', '8349', '16048', '10529', '13674', '8157', '2353', '8038', '13394', '657', '12809', '3617', '5869', '5052', '11514', '13998', '11738', '9734', '15539', '10504', '5575', '3562', '14924', '11482', '7270', '3185', '2838', '11788', '14315', '11055', '10004', '10770', '9484', '9786', '3969', '6621', '2821', '15018', '7669', '9256', '3638', '4117', '9911', '4183', '1331', '2556', '3877', '15430', '6525', '10526', '12865', '7157', '13938', '13842', '4752', '8329', '11101', '1142', '6026', '11148', '12104', '2391', '13745', '7506', '6846', '8327', '8746', '2640', '2085', '3112', '7517', '13759', '14023', '532', '6989', '1738', '14564', '14581', '1511', '12662', '12668', '12664', '4019', '9329', '7066', '3162', '2723', '9131', '7367', '1073', '6990', '3215', '13469', '7310']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('61', '251', '2006-02-16T02:30:53', '2005-08-02T18:16:55', '2005-08-07T18:12:55', '1'), + ('293', '327', '2006-02-16T02:30:53', '2005-08-17T01:53:20', '2005-08-19T00:15:20', '1'), + ('243', '3908', '2006-02-16T02:30:53', '2005-08-21T06:24:55', '2005-08-28T02:25:55', '1'), + ('230', '1041', '2006-02-16T02:30:53', '2005-07-09T03:33:32', '2005-07-18T06:15:32', '1'), + ('181', '4087', '2006-02-16T02:30:53', '2005-06-21T22:48:59', '2005-06-28T19:32:59', '1'), + ('226', '4293', '2006-02-16T02:30:53', '2005-08-23T01:39:05', '2005-08-25T04:43:05', '1'), + ('5', '4376', '2006-02-16T02:30:53', '2005-08-02T10:50:06', '2005-08-04T05:24:06', '1'), + ('416', '534', '2006-02-16T02:30:53', '2005-07-29T04:50:22', '2005-08-05T08:50:22', '1'), + ('103', '2019', '2006-02-16T02:30:53', '2005-08-23T22:43:07', '2005-08-31T21:33:07', '1'), + ('444', '851', '2006-02-16T02:30:53', '2005-08-01T12:00:02', '2005-08-08T16:18:02', '1'), + ('36', '3397', '2006-02-16T02:30:53', '2005-08-20T08:30:54', '2005-08-22T02:59:54', '1'), + ('566', '915', '2006-02-16T02:30:53', '2005-07-28T21:06:45', '2005-08-04T16:06:45', '1'), + ('361', '3223', '2006-02-16T02:30:53', '2005-06-18T12:53:25', '2005-06-19T13:53:25', '1'), + ('30', '1225', '2006-02-16T02:30:53', '2005-07-28T16:32:55', '2005-07-30T21:08:55', '1'), + ('45', '2597', '2006-02-16T02:30:53', '2005-08-19T22:05:19', '2005-08-21T23:53:19', '1'), + ('65', '848', '2006-02-16T02:30:53', '2005-05-28T20:23:09', '2005-06-01T02:11:09', '1'), + ('22', '2005', '2006-02-16T02:30:53', '2005-08-19T00:42:24', '2005-08-23T06:06:24', '1'), + ('125', '1337', '2006-02-16T02:30:53', '2005-07-06T05:58:06', '2005-07-13T02:10:06', '1'), + ('40', '2157', '2006-02-16T02:30:53', '2005-07-10T18:40:09', '2005-07-17T18:42:09', '1'), + ('305', '1884', '2006-02-16T02:30:53', '2005-07-09T03:59:43', '2005-07-12T05:48:43', '1'), + ('423', '4240', '2006-02-16T02:30:53', '2005-08-16T23:53:10', '2005-08-23T22:04:10', '1'), + ('530', '3936', '2006-02-16T02:30:53', '2005-08-20T19:52:38', '2005-08-26T14:57:38', '1'), + ('347', '3042', '2006-02-16T02:30:53', '2005-08-17T08:45:55', '2005-08-26T07:09:55', '1'), + ('125', '3320', '2006-02-16T02:30:53', '2005-07-31T08:57:45', '2005-08-05T11:57:45', '1'), + ('582', '2853', '2006-02-16T02:30:53', '2005-08-23T04:09:03', '2005-08-26T04:01:03', '1'), + ('530', '3345', '2006-02-16T02:30:53', '2005-08-01T11:10:55', '2005-08-10T10:16:55', '1'), + ('107', '2316', '2006-02-16T02:30:53', '2005-07-10T03:55:50', '2005-07-12T08:40:50', '1'), + ('587', '1660', '2006-02-16T02:30:53', '2005-07-06T02:54:36', '2005-07-11T05:48:36', '1'), + ('118', '4189', '2006-02-16T02:30:53', '2005-08-22T05:15:17', '2005-08-23T10:11:17', '1'), + ('134', '1400', '2006-02-16T02:30:53', '2005-08-02T22:24:31', '2005-08-04T01:48:31', '1'), + ('526', '1888', '2006-02-16T02:30:53', '2005-07-27T11:29:02', '2005-08-05T08:04:02', '1'), + ('234', '601', '2006-02-16T02:30:53', '2005-06-20T22:58:01', '2005-06-27T00:26:01', '1'), + ('292', '143', '2006-02-16T02:30:53', '2005-06-19T22:06:06', '2005-06-25T22:30:06', '1'), + ('560', '1310', '2006-02-16T02:30:53', '2005-08-17T10:59:18', '2005-08-22T11:12:18', '1'), + ('459', '1164', '2006-02-16T02:30:53', '2005-08-21T07:56:39', '2005-08-27T04:52:39', '1'), + ('182', '3851', '2006-02-16T02:30:53', '2005-08-02T06:36:05', '2005-08-06T00:36:05', '1'), + ('570', '2396', '2006-02-16T02:30:53', '2005-07-31T17:51:23', '2005-08-03T19:12:23', '1'), + ('262', '2567', '2006-02-16T02:30:53', '2005-08-01T20:45:39', '2005-08-04T19:21:39', '1'), + ('26', '3389', '2006-02-16T02:30:53', '2005-07-30T23:31:40', '2005-08-02T18:25:40', '1'), + ('586', '2560', '2006-02-16T02:30:53', '2005-07-31T10:25:21', '2005-08-03T04:28:21', '1'), + ('587', '383', '2006-02-16T02:30:53', '2005-07-06T22:47:59', '2005-07-08T02:11:59', '1'), + ('561', '2229', '2006-02-16T02:30:53', '2005-07-12T08:57:30', '2005-07-14T09:47:30', '1'), + ('532', '2551', '2006-02-16T02:30:53', '2005-06-19T20:26:52', '2005-06-27T23:48:52', '1'), + ('504', '394', '2006-02-16T02:30:53', '2005-08-22T08:52:38', '2005-08-25T08:08:38', '1'), + ('483', '2624', '2006-02-16T02:30:53', '2005-07-28T02:44:07', '2005-07-29T00:54:07', '1'), + ('19', '4021', '2006-02-16T02:30:53', '2005-07-30T14:29:29', '2005-08-05T16:59:29', '1'), + ('452', '190', '2006-02-16T02:30:53', '2005-07-06T07:08:17', '2005-07-13T12:30:17', '1'), + ('158', '780', '2006-02-16T02:30:53', '2005-07-07T06:58:14', '2005-07-16T05:28:14', '1'), + ('112', '3879', '2006-02-16T02:30:53', '2005-07-31T14:48:01', '2005-08-06T11:55:01', '1'), + ('479', '3342', '2006-02-16T02:30:53', '2005-07-07T10:28:33', '2005-07-15T12:29:33', '1'), + ('277', '3089', '2006-02-16T02:30:53', '2005-06-15T11:34:33', '2005-06-21T09:46:33', '1'), + ('377', '125', '2006-02-16T02:30:53', '2005-06-19T03:07:32', '2005-06-23T23:09:32', '1'), + ('576', '2796', '2006-02-16T02:30:53', '2005-07-06T18:22:10', '2005-07-07T23:38:10', '1'), + ('282', '4353', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('103', '1408', '2006-02-16T02:30:53', '2005-07-12T04:17:15', '2005-07-18T23:11:15', '1'), + ('14', '27', '2006-02-16T02:30:53', '2005-08-01T11:55:33', '2005-08-08T16:42:33', '1'), + ('460', '3437', '2006-02-16T02:30:53', '2005-08-19T02:38:50', '2005-08-21T02:33:50', '1'), + ('423', '1353', '2006-02-16T02:30:53', '2005-07-27T07:20:28', '2005-08-02T07:19:28', '1'), + ('463', '3743', '2006-02-16T02:30:53', '2005-08-20T17:24:45', '2005-08-21T18:39:45', '1'), + ('180', '4337', '2006-02-16T02:30:53', '2005-08-20T14:29:37', '2005-08-29T18:19:37', '1'), + ('512', '3250', '2006-02-16T02:30:53', '2005-07-08T14:15:20', '2005-07-12T13:22:20', '1'), + ('108', '3468', '2006-02-16T02:30:53', '2005-07-29T04:06:33', '2005-08-06T01:46:33', '1'), + ('80', '2621', '2006-02-16T02:30:53', '2005-08-02T08:08:24', '2005-08-06T05:55:24', '1'), + ('5', '3998', '2006-02-16T02:30:53', '2005-05-31T19:46:38', '2005-06-05T14:03:38', '1'), + ('409', '3936', '2006-02-16T02:30:53', '2005-07-11T02:21:43', '2005-07-13T03:49:43', '1'), + ('230', '2991', '2006-02-16T02:30:53', '2005-08-02T09:47:08', '2005-08-08T10:57:08', '1'), + ('16', '4551', '2006-02-16T02:30:53', '2005-08-17T22:53:00', '2005-08-23T19:49:00', '1'), + ('491', '2850', '2006-02-16T02:30:53', '2005-06-18T15:33:30', '2005-06-25T14:30:30', '1'), + ('142', '1264', '2006-02-16T02:30:53', '2005-08-20T10:53:49', '2005-08-25T13:25:49', '1'), + ('527', '2091', '2006-02-16T02:30:53', '2005-07-27T20:28:34', '2005-08-05T18:14:34', '1'), + ('18', '1214', '2006-02-16T02:30:53', '2005-07-12T19:20:45', '2005-07-17T00:06:45', '1'), + ('317', '2928', '2006-02-16T02:30:53', '2005-07-29T04:00:52', '2005-07-31T08:27:52', '1'), + ('275', '2179', '2006-02-16T02:30:53', '2005-07-29T19:03:15', '2005-07-30T17:06:15', '1'), + ('540', '721', '2006-02-16T02:30:53', '2005-06-19T09:26:13', '2005-06-20T14:38:13', '1'), + ('214', '2275', '2006-02-16T02:30:53', '2005-06-17T17:30:56', '2005-06-23T12:13:56', '1'), + ('35', '3725', '2006-02-16T02:30:53', '2005-06-20T17:53:30', '2005-06-26T16:03:30', '1'), + ('41', '3177', '2006-02-16T02:30:53', '2005-07-27T20:57:07', '2005-08-04T15:08:07', '1'), + ('269', '595', '2006-02-16T02:30:53', '2005-08-20T11:24:48', '2005-08-29T10:29:48', '1'), + ('304', '2668', '2006-02-16T02:30:53', '2005-08-20T21:10:32', '2005-08-23T20:57:32', '1'), + ('120', '2793', '2006-02-16T02:30:53', '2005-05-28T05:36:58', '2005-06-02T01:50:58', '1'), + ('120', '4036', '2006-02-16T02:30:53', '2005-07-27T01:00:34', '2005-07-30T23:53:34', '1'), + ('177', '3260', '2006-02-16T02:30:53', '2005-06-16T16:07:27', '2005-06-20T15:22:27', '1'), + ('22', '3250', '2006-02-16T02:30:53', '2005-08-21T16:24:43', '2005-08-26T16:58:43', '1'), + ('243', '751', '2006-02-16T02:30:53', '2005-08-21T17:07:08', '2005-08-26T16:02:08', '1'), + ('330', '1135', '2006-02-16T02:30:53', '2005-06-15T22:45:06', '2005-06-22T22:48:06', '1'), + ('75', '1412', '2006-02-16T02:30:53', '2005-08-18T19:10:41', '2005-08-23T16:59:41', '1'), + ('14', '1986', '2006-02-16T02:30:53', '2005-08-18T19:16:47', '2005-08-19T16:31:47', '1'), + ('577', '2732', '2006-02-16T02:30:53', '2005-08-18T19:10:54', '2005-08-25T19:19:54', '1'), + ('294', '3200', '2006-02-16T02:30:53', '2005-07-07T01:27:44', '2005-07-10T21:30:44', '1'), + ('593', '1293', '2006-02-16T02:30:53', '2005-07-30T17:42:38', '2005-08-08T23:17:38', '1'), + ('185', '1862', '2006-02-16T02:30:53', '2005-07-27T03:53:52', '2005-08-05T03:32:52', '1'), + ('113', '3220', '2006-02-16T02:30:53', '2005-06-20T21:21:15', '2005-06-29T18:42:15', '1'), + ('277', '4317', '2006-02-16T02:30:53', '2005-06-19T14:55:23', '2005-06-20T14:28:23', '1'), + ('142', '623', '2006-02-16T02:30:53', '2005-07-30T09:55:57', '2005-08-01T14:21:57', '1'), + ('383', '1738', '2006-02-16T02:30:53', '2005-07-27T15:05:45', '2005-08-02T13:46:45', '1'), + ('146', '522', '2006-02-16T02:30:53', '2005-05-31T09:55:04', '2005-06-07T03:55:04', '1'), + ('146', '4065', '2006-02-16T02:30:53', '2005-07-27T01:02:46', '2005-07-31T00:22:46', '1'), + ('279', '4140', '2006-02-16T02:30:53', '2005-06-21T01:11:32', '2005-06-26T19:42:32', '1'), + ('235', '1410', '2006-02-16T02:30:53', '2005-08-20T00:59:36', '2005-08-24T22:41:36', '1'), + ('103', '3711', '2006-02-16T02:30:53', '2005-07-27T13:00:55', '2005-07-28T17:54:55', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['6177', '11329', '12987', '546', '8035', '4754', '14909', '11019', '11737', '1447', '13392', '12410', '2259', '14363', '7123', '4795', '4412', '7616', '9781', '9739', '11221', '11433', '15274', '7572', '2408', '2834', '2574', '11095', '11276', '2216', '14171', '4359', '15039', '1716', '13860', '12890', '4587', '6898', '8324', '15872', '14301', '9395', '12763', '1996', '1120', '9032', '10342', '2867', '14934', '14820', '2570', '5700', '7512', '16038', '710', '15743', '11500', '7941', '204', '15177', '9719', '1713', '12108', '7575', '13388', '265', '13929', '6639', '12301', '6932', '15131', '14049', '2162', '10967', '688', '5951', '2027', '8224', '3462', '1940', '10366', '8118', '5491', '7062', '3850', '12071', '902', '13840', '14660', '253', '8580', '7573', '2384', '395', '9236', '7267', '12473', '1839', '2071', '4995']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('589', '313', '2006-02-16T02:30:53', '2005-07-11T10:53:49', '2005-07-17T14:54:49', '1'), + ('399', '2677', '2006-02-16T02:30:53', '2005-08-02T16:42:52', '2005-08-08T16:45:52', '1'), + ('134', '3665', '2006-02-16T02:30:53', '2005-08-19T07:11:44', '2005-08-20T04:17:44', '1'), + ('20', '487', '2006-02-16T02:30:53', '2005-05-28T07:16:25', '2005-06-01T08:36:25', '1'), + ('14', '1503', '2006-02-16T02:30:53', '2005-07-28T16:23:01', '2005-08-05T10:52:01', '1'), + ('108', '3177', '2006-02-16T02:30:53', '2005-07-08T14:20:01', '2005-07-11T11:50:01', '1'), + ('155', '1997', '2006-02-16T02:30:53', '2005-08-22T04:48:44', '2005-08-25T04:59:44', '1'), + ('112', '3227', '2006-02-16T02:30:53', '2005-08-02T05:29:31', '2005-08-04T00:42:31', '1'), + ('549', '4128', '2006-02-16T02:30:53', '2005-08-17T08:42:08', '2005-08-19T08:14:08', '1'), + ('471', '984', '2006-02-16T02:30:53', '2005-06-15T19:13:51', '2005-06-21T22:56:51', '1'), + ('409', '692', '2006-02-16T02:30:53', '2005-08-19T22:03:22', '2005-08-28T19:27:22', '1'), + ('210', '1904', '2006-02-16T02:30:53', '2005-08-18T09:45:33', '2005-08-27T08:50:33', '1'), + ('491', '4103', '2006-02-16T02:30:53', '2005-06-18T05:37:45', '2005-06-21T01:51:45', '1'), + ('560', '2579', '2006-02-16T02:30:53', '2005-08-21T09:20:03', '2005-08-23T14:26:03', '1'), + ('232', '134', '2006-02-16T02:30:53', '2005-07-27T06:08:48', '2005-08-04T05:26:48', '1'), + ('497', '3409', '2006-02-16T02:30:53', '2005-07-08T16:32:54', '2005-07-09T14:15:54', '1'), + ('282', '1181', '2006-02-16T02:30:53', '2005-07-07T21:56:53', '2005-07-11T19:28:53', '1'), + ('9', '3790', '2006-02-16T02:30:53', '2005-07-28T00:15:26', '2005-07-30T21:52:26', '1'), + ('155', '2310', '2006-02-16T02:30:53', '2005-07-31T10:13:02', '2005-08-09T14:46:02', '1'), + ('343', '1328', '2006-02-16T02:30:53', '2005-07-31T09:08:03', '2005-08-04T13:57:03', '1'), + ('146', '1689', '2006-02-16T02:30:53', '2005-08-02T12:32:12', '2005-08-03T17:13:12', '1'), + ('518', '1', '2006-02-16T02:30:53', '2005-08-02T20:13:10', '2005-08-11T21:35:10', '1'), + ('515', '3519', '2006-02-16T02:30:53', '2005-08-22T18:55:52', '2005-08-23T20:02:52', '1'), + ('532', '3068', '2006-02-16T02:30:53', '2005-07-27T22:44:29', '2005-08-01T03:04:29', '1'), + ('87', '258', '2006-02-16T02:30:53', '2005-06-18T16:50:44', '2005-06-19T20:11:44', '1'), + ('122', '2876', '2006-02-16T02:30:53', '2005-06-19T21:41:46', '2005-06-24T20:47:46', '1'), + ('143', '3320', '2006-02-16T02:30:53', '2005-06-19T04:23:52', '2005-06-20T05:24:52', '1'), + ('278', '3517', '2006-02-16T02:30:53', '2005-08-02T08:03:20', '2005-08-10T05:20:20', '1'), + ('190', '4226', '2006-02-16T02:30:53', '2005-08-02T14:28:46', '2005-08-04T14:00:46', '1'), + ('320', '1428', '2006-02-16T02:30:53', '2005-06-18T03:08:17', '2005-06-19T08:13:17', '1'), + ('320', '4179', '2006-02-16T02:30:53', '2005-08-21T03:00:42', '2005-08-24T00:54:42', '1'), + ('282', '3222', '2006-02-16T02:30:53', '2005-07-07T19:30:20', '2005-07-09T13:34:20', '1'), + ('180', '895', '2006-02-16T02:30:53', '2005-08-22T09:37:54', '2005-08-28T12:23:54', '1'), + ('24', '20', '2006-02-16T02:30:53', '2005-06-16T14:39:31', '2005-06-19T15:37:31', '1'), + ('275', '558', '2006-02-16T02:30:53', '2005-08-20T14:55:09', '2005-08-22T20:42:09', '1'), + ('150', '3831', '2006-02-16T02:30:53', '2005-08-19T03:42:08', '2005-08-19T23:08:08', '1'), + ('63', '3502', '2006-02-16T02:30:53', '2005-07-08T06:16:26', '2005-07-13T00:59:26', '1'), + ('557', '1725', '2006-02-16T02:30:53', '2005-07-12T21:39:04', '2005-07-15T20:30:04', '1'), + ('98', '1467', '2006-02-16T02:30:53', '2005-07-29T03:56:05', '2005-08-02T01:41:05', '1'), + ('212', '3391', '2006-02-16T02:30:53', '2005-08-23T16:27:24', '2005-08-31T11:57:24', '1'), + ('162', '283', '2006-02-16T02:30:53', '2005-08-21T07:19:48', '2005-08-28T02:06:48', '1'), + ('306', '1298', '2006-02-16T02:30:53', '2005-07-30T20:07:06', '2005-08-08T21:21:06', '1'), + ('472', '393', '2006-02-16T02:30:53', '2005-08-18T23:07:01', '2005-08-21T18:45:01', '1'), + ('149', '3074', '2006-02-16T02:30:53', '2005-06-17T11:17:45', '2005-06-26T09:42:45', '1'), + ('361', '2897', '2006-02-16T02:30:53', '2005-05-31T16:37:14', '2005-06-04T12:53:14', '1'), + ('369', '4448', '2006-02-16T02:30:53', '2005-07-30T06:06:54', '2005-08-01T05:27:54', '1'), + ('140', '332', '2006-02-16T02:30:53', '2005-08-01T05:11:11', '2005-08-10T00:27:11', '1'), + ('483', '95', '2006-02-16T02:30:53', '2005-06-20T00:08:38', '2005-06-23T19:35:38', '1'), + ('226', '815', '2006-02-16T02:30:53', '2005-08-22T05:47:15', '2005-08-26T11:32:15', '1'), + ('52', '1409', '2006-02-16T02:30:53', '2005-08-22T01:18:37', '2005-08-23T19:44:37', '1'), + ('5', '1105', '2006-02-16T02:30:53', '2005-06-19T04:20:13', '2005-06-25T07:00:13', '1'), + ('87', '3961', '2006-02-16T02:30:53', '2005-07-10T09:49:42', '2005-07-19T04:20:42', '1'), + ('352', '1343', '2006-02-16T02:30:53', '2005-07-27T20:40:40', '2005-08-05T01:44:40', '1'), + ('172', '2612', '2006-02-16T02:30:53', '2005-08-23T22:14:31', '2005-08-30T03:28:31', '1'), + ('518', '194', '2006-02-16T02:30:53', '2005-05-29T03:48:36', '2005-06-03T05:03:36', '1'), + ('139', '1625', '2006-02-16T02:30:53', '2005-08-23T12:12:05', '2005-08-26T11:35:05', '1'), + ('584', '4003', '2006-02-16T02:30:53', '2005-08-16T23:01:22', '2005-08-24T22:54:22', '1'), + ('566', '439', '2006-02-16T02:30:53', '2005-07-28T12:47:20', '2005-08-01T08:46:20', '1'), + ('528', '1842', '2006-02-16T02:30:53', '2005-05-26T07:30:37', '2005-05-30T08:11:37', '1'), + ('493', '838', '2006-02-16T02:30:53', '2005-08-22T15:34:49', '2005-08-26T12:54:49', '1'), + ('584', '335', '2006-02-16T02:30:53', '2005-07-31T08:25:13', '2005-08-05T08:22:13', '1'), + ('164', '2580', '2006-02-16T02:30:53', '2005-06-16T14:28:33', '2005-06-18T09:02:33', '1'), + ('207', '1675', '2006-02-16T02:30:53', '2005-08-17T22:56:39', '2005-08-26T19:37:39', '1'), + ('582', '702', '2006-02-16T02:30:53', '2005-07-27T22:53:52', '2005-07-29T02:02:52', '1'), + ('317', '942', '2006-02-16T02:30:53', '2005-08-19T21:46:49', '2005-08-27T16:18:49', '1'), + ('303', '2276', '2006-02-16T02:30:53', '2005-05-26T16:07:38', '2005-06-01T14:20:38', '1'), + ('57', '946', '2006-02-16T02:30:53', '2005-08-20T17:13:48', '2005-08-28T15:19:48', '1'), + ('587', '3385', '2006-02-16T02:30:53', '2005-07-12T10:00:44', '2005-07-19T04:56:44', '1'), + ('317', '2293', '2006-02-16T02:30:53', '2005-08-18T05:36:20', '2005-08-23T03:15:20', '1'), + ('463', '4517', '2006-02-16T02:30:53', '2005-07-26T23:08:04', '2005-08-05T01:35:04', '1'), + ('119', '1930', '2006-02-16T02:30:53', '2005-08-22T13:06:26', '2005-08-30T16:43:26', '1'), + ('112', '1335', '2006-02-16T02:30:53', '2005-08-20T22:08:55', '2005-08-28T20:24:55', '1'), + ('277', '1790', '2006-02-16T02:30:53', '2005-06-17T23:45:47', '2005-06-21T21:03:47', '1'), + ('149', '683', '2006-02-16T02:30:53', '2005-08-02T04:02:16', '2005-08-09T07:57:16', '1'), + ('162', '4135', '2006-02-16T02:30:53', '2005-05-29T00:45:24', '2005-06-02T01:30:24', '1'), + ('589', '2501', '2006-02-16T02:30:53', '2005-07-10T23:14:29', '2005-07-13T01:01:29', '1'), + ('265', '4309', '2006-02-16T02:30:53', '2005-06-17T13:06:56', '2005-06-23T13:46:56', '1'), + ('467', '1995', '2006-02-16T02:30:53', '2005-07-28T23:59:02', '2005-08-02T04:54:02', '1'), + ('568', '547', '2006-02-16T02:30:53', '2005-06-21T21:52:52', '2005-06-28T21:41:52', '1'), + ('451', '105', '2006-02-16T02:30:53', '2005-06-17T07:42:22', '2005-06-22T11:59:22', '1'), + ('119', '2654', '2006-02-16T02:30:53', '2005-08-01T06:09:37', '2005-08-05T03:19:37', '1'), + ('566', '331', '2006-02-16T02:30:53', '2005-07-28T19:22:22', '2005-08-01T22:13:22', '1'), + ('49', '2007', '2006-02-16T02:30:53', '2005-07-10T00:09:45', '2005-07-11T02:25:45', '1'), + ('469', '226', '2006-02-16T02:30:53', '2005-07-27T03:52:01', '2005-08-03T08:26:01', '1'), + ('103', '1700', '2006-02-16T02:30:53', '2005-07-06T16:51:21', '2005-07-12T13:58:21', '1'), + ('507', '1874', '2006-02-16T02:30:53', '2005-08-17T21:49:14', '2005-08-22T18:20:14', '1'), + ('561', '1514', '2006-02-16T02:30:53', '2005-05-30T09:53:36', '2005-06-07T12:10:36', '1'), + ('40', '1211', '2006-02-16T02:30:53', '2005-08-20T14:23:20', '2005-08-28T11:53:20', '1'), + ('452', '3433', '2006-02-16T02:30:53', '2005-08-21T19:43:21', '2005-08-22T20:42:21', '1'), + ('416', '2969', '2006-02-16T02:30:53', '2005-05-26T14:43:14', '2005-05-27T12:21:14', '1'), + ('543', '4040', '2006-02-16T02:30:53', '2005-07-29T12:00:27', '2005-08-04T16:39:27', '1'), + ('467', '314', '2006-02-16T02:30:53', '2005-07-27T22:46:20', '2005-08-04T01:55:20', '1'), + ('132', '3378', '2006-02-16T02:30:53', '2005-06-18T15:18:49', '2005-06-21T18:10:49', '1'), + ('575', '752', '2006-02-16T02:30:53', '2005-05-27T11:45:49', '2005-05-31T13:42:49', '1'), + ('2', '4030', '2006-02-16T02:30:53', '2005-07-30T13:47:43', '2005-08-08T18:52:43', '1'), + ('122', '3661', '2006-02-16T02:30:53', '2005-07-27T11:22:55', '2005-08-01T08:13:55', '1'), + ('303', '1237', '2006-02-16T02:30:53', '2005-08-18T11:59:44', '2005-08-21T13:38:44', '1'), + ('223', '2750', '2006-02-16T02:30:53', '2005-06-16T23:22:22', '2005-06-23T00:33:22', '1'), + ('479', '2867', '2006-02-16T02:30:53', '2005-06-17T16:33:17', '2005-06-23T21:51:17', '1'), + ('247', '2063', '2006-02-16T02:30:53', '2005-07-09T00:57:46', '2005-07-13T03:32:46', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['4357', '10202', '7779', '15907', '3807', '9998', '12553', '15283', '4779', '15658', '735', '6268', '3289', '15662', '1397', '2952', '14193', '6377', '9384', '9926', '11173', '8989', '323', '8995', '5628', '1737', '3961', '1712', '6740', '15995', '6842', '13189', '3449', '180', '1139', '14176', '5121', '11596', '11812', '6103', '7186', '11868', '12985', '4711', '14394', '8654', '12124', '13960', '3584', '10929', '15599', '8399', '4050', '15218', '5990', '1563', '6980', '13441', '3327', '13178', '11100', '14864', '12086', '789', '7019', '14596', '5155', '10243', '3790', '5950', '15929', '769', '14266', '6258', '15529', '8011', '1666', '13650', '7087', '13908', '6466', '14914', '8832', '6112', '5502', '15470', '10053', '1031', '11402', '516', '15562', '9815', '10155', '6540', '11761', '11949', '10145', '11430', '6951', '1163']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('103', '3413', '2006-02-16T02:30:53', '2005-07-07T19:24:39', '2005-07-12T00:11:39', '1'), + ('306', '1099', '2006-02-16T02:30:53', '2005-08-01T00:43:18', '2005-08-08T23:26:18', '1'), + ('414', '3663', '2006-02-16T02:30:53', '2005-07-28T07:11:11', '2005-07-30T11:12:11', '1'), + ('2', '2898', '2006-02-16T02:30:53', '2005-08-23T17:39:35', '2005-08-25T23:23:35', '1'), + ('425', '39', '2006-02-16T02:30:53', '2005-07-06T15:11:44', '2005-07-10T09:20:44', '1'), + ('30', '2549', '2006-02-16T02:30:53', '2005-07-31T17:40:35', '2005-08-04T18:15:35', '1'), + ('454', '2893', '2006-02-16T02:30:53', '2005-08-18T14:46:54', '2005-08-22T13:41:54', '1'), + ('219', '1688', '2006-02-16T02:30:53', '2005-08-22T19:16:04', '2005-08-31T21:05:04', '1'), + ('338', '1321', '2006-02-16T02:30:53', '2005-07-08T15:53:41', '2005-07-15T20:30:41', '1'), + ('22', '3565', '2006-02-16T02:30:53', '2005-08-23T08:48:43', '2005-08-25T05:38:43', '1'), + ('454', '3421', '2006-02-16T02:30:53', '2005-05-29T08:08:13', '2005-06-07T13:35:13', '1'), + ('125', '1154', '2006-02-16T02:30:53', '2005-07-11T15:55:34', '2005-07-19T17:25:34', '1'), + ('115', '2248', '2006-02-16T02:30:53', '2005-06-21T06:41:48', '2005-06-30T00:54:48', '1'), + ('223', '3028', '2006-02-16T02:30:53', '2005-08-23T08:52:50', '2005-08-24T08:08:50', '1'), + ('444', '1830', '2006-02-16T02:30:53', '2005-06-15T16:25:26', '2005-06-21T20:45:26', '1'), + ('13', '3759', '2006-02-16T02:30:53', '2005-06-20T06:26:57', '2005-06-22T11:51:57', '1'), + ('25', '513', '2006-02-16T02:30:53', '2005-08-21T03:38:27', '2005-08-28T09:16:27', '1'), + ('118', '4017', '2006-02-16T02:30:53', '2005-07-11T21:41:16', '2005-07-15T20:05:16', '1'), + ('220', '2313', '2006-02-16T02:30:53', '2005-07-30T19:25:35', '2005-08-08T21:50:35', '1'), + ('472', '3733', '2006-02-16T02:30:53', '2005-07-31T15:11:51', '2005-08-09T18:26:51', '1'), + ('146', '4296', '2006-02-16T02:30:53', '2005-08-02T10:28:00', '2005-08-10T14:53:00', '1'), + ('575', '954', '2006-02-16T02:30:53', '2005-07-30T04:39:19', '2005-08-06T02:11:19', '1'), + ('144', '2362', '2006-02-16T02:30:53', '2005-05-27T00:49:27', '2005-05-30T03:12:27', '1'), + ('331', '3575', '2006-02-16T02:30:53', '2005-07-30T04:53:11', '2005-08-07T00:24:11', '1'), + ('87', '4040', '2006-02-16T02:30:53', '2005-07-10T05:56:40', '2005-07-17T11:13:40', '1'), + ('467', '4029', '2006-02-16T02:30:53', '2005-06-16T15:59:44', '2005-06-23T12:22:44', '1'), + ('364', '4320', '2006-02-16T02:30:53', '2005-07-06T22:11:43', '2005-07-09T03:14:43', '1'), + ('535', '1363', '2006-02-16T02:30:53', '2005-06-16T14:25:09', '2005-06-17T17:55:09', '1'), + ('139', '2431', '2006-02-16T02:30:53', '2005-07-12T14:22:08', '2005-07-14T14:35:08', '1'), + ('377', '1122', '2006-02-16T02:30:53', '2005-08-23T20:29:56', '2005-08-30T18:09:56', '1'), + ('366', '3376', '2006-02-16T02:30:53', '2005-07-12T19:07:55', '2005-07-19T22:47:55', '1'), + ('368', '3444', '2006-02-16T02:30:53', '2005-08-19T14:27:16', '2005-08-28T10:34:16', '1'), + ('181', '210', '2006-02-16T02:30:53', '2005-06-21T21:01:27', '2005-06-27T21:20:27', '1'), + ('75', '2752', '2006-02-16T02:30:53', '2005-05-26T04:46:23', '2005-06-01T09:58:23', '1'), + ('562', '666', '2006-02-16T02:30:53', '2005-05-31T19:34:52', '2005-06-06T17:40:52', '1'), + ('556', '4420', '2006-02-16T02:30:53', '2005-08-21T03:09:23', '2005-08-26T21:26:23', '1'), + ('526', '3321', '2006-02-16T02:30:53', '2005-07-09T07:18:31', '2005-07-15T01:48:31', '1'), + ('290', '1674', '2006-02-16T02:30:53', '2005-08-17T02:53:55', '2005-08-26T02:19:55', '1'), + ('132', '119', '2006-02-16T02:30:53', '2005-08-17T12:00:54', '2005-08-18T16:08:54', '1'), + ('540', '262', '2006-02-16T02:30:53', '2005-07-11T06:59:55', '2005-07-16T09:30:55', '1'), + ('584', '4005', '2006-02-16T02:30:53', '2005-07-27T08:26:12', '2005-07-28T12:21:12', '1'), + ('445', '2909', '2006-02-16T02:30:53', '2005-08-17T14:05:34', '2005-08-19T15:47:34', '1'), + ('83', '4133', '2006-02-16T02:30:53', '2005-08-19T07:08:05', '2005-08-24T02:25:05', '1'), + ('563', '2327', '2006-02-16T02:30:53', '2005-07-08T12:06:58', '2005-07-12T08:37:58', '1'), + ('118', '4555', '2006-02-16T02:30:53', '2005-08-21T10:23:10', '2005-08-28T09:33:10', '1'), + ('84', '3925', '2006-02-16T02:30:53', '2005-07-29T15:04:27', '2005-08-07T18:37:27', '1'), + ('22', '2036', '2006-02-16T02:30:53', '2005-08-17T23:22:46', '2005-08-21T01:40:46', '1'), + ('459', '4177', '2006-02-16T02:30:53', '2005-08-20T18:16:26', '2005-08-29T14:06:26', '1'), + ('207', '367', '2006-02-16T02:30:53', '2005-07-06T04:16:43', '2005-07-13T07:08:43', '1'), + ('305', '913', '2006-02-16T02:30:53', '2005-08-02T02:35:44', '2005-08-05T03:52:44', '1'), + ('103', '4560', '2006-02-16T02:30:53', '2005-08-23T06:25:07', '2005-08-29T00:48:07', '1'), + ('286', '233', '2006-02-16T02:30:53', '2005-07-29T06:20:18', '2005-08-04T01:26:18', '1'), + ('528', '104', '2006-02-16T02:30:53', '2005-07-07T03:35:33', '2005-07-15T03:11:33', '1'), + ('139', '10', '2006-02-16T02:30:53', '2005-08-22T16:59:05', '2005-08-30T17:01:05', '1'), + ('432', '1561', '2006-02-16T02:30:53', '2005-07-11T01:03:14', '2005-07-15T19:32:14', '1'), + ('262', '1516', '2006-02-16T02:30:53', '2005-06-16T02:46:28', '2005-06-18T02:37:28', '1'), + ('164', '1127', '2006-02-16T02:30:53', '2005-07-27T00:50:30', '2005-08-03T23:35:30', '1'), + ('125', '3188', '2006-02-16T02:30:53', '2005-08-19T23:48:23', '2005-08-28T23:47:23', '1'), + ('62', '3083', '2006-02-16T02:30:53', '2005-06-21T09:04:50', '2005-06-30T05:45:50', '1'), + ('394', '693', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('65', '3047', '2006-02-16T02:30:53', '2005-08-02T08:08:00', '2005-08-10T07:19:00', '1'), + ('460', '2872', '2006-02-16T02:30:53', '2005-08-22T02:57:06', '2005-08-22T22:19:06', '1'), + ('140', '3963', '2006-02-16T02:30:53', '2005-08-17T22:20:01', '2005-08-26T02:14:01', '1'), + ('553', '708', '2006-02-16T02:30:53', '2005-05-29T16:17:07', '2005-06-06T18:15:07', '1'), + ('491', '3837', '2006-02-16T02:30:53', '2005-07-27T02:20:26', '2005-08-02T22:48:26', '1'), + ('472', '2010', '2006-02-16T02:30:53', '2005-08-21T17:38:37', '2005-08-30T20:28:37', '1'), + ('523', '988', '2006-02-16T02:30:53', '2005-07-09T08:46:54', '2005-07-14T04:13:54', '1'), + ('132', '2236', '2006-02-16T02:30:53', '2005-08-01T02:18:46', '2005-08-06T21:45:46', '1'), + ('10', '1711', '2006-02-16T02:30:53', '2005-07-06T14:13:45', '2005-07-14T13:35:45', '1'), + ('585', '4319', '2006-02-16T02:30:53', '2005-07-10T23:13:45', '2005-07-13T02:35:45', '1'), + ('477', '1832', '2006-02-16T02:30:53', '2005-08-23T18:23:30', '2005-08-27T17:04:30', '1'), + ('575', '1523', '2006-02-16T02:30:53', '2005-05-29T12:51:44', '2005-06-01T17:43:44', '1'), + ('269', '3543', '2006-02-16T02:30:53', '2005-08-21T06:20:51', '2005-08-23T00:44:51', '1'), + ('417', '632', '2006-02-16T02:30:53', '2005-07-11T15:24:32', '2005-07-18T18:29:32', '1'), + ('19', '4015', '2006-02-16T02:30:53', '2005-08-23T03:46:47', '2005-08-24T00:59:47', '1'), + ('497', '4274', '2006-02-16T02:30:53', '2005-07-28T15:26:39', '2005-07-30T13:59:39', '1'), + ('557', '4019', '2006-02-16T02:30:53', '2005-06-16T10:17:19', '2005-06-21T05:50:19', '1'), + ('322', '2644', '2006-02-16T02:30:53', '2005-08-20T07:49:06', '2005-08-28T10:11:06', '1'), + ('22', '1159', '2006-02-16T02:30:53', '2005-07-27T04:42:08', '2005-08-02T00:53:08', '1'), + ('532', '3661', '2006-02-16T02:30:53', '2005-08-20T16:21:40', '2005-08-29T21:16:40', '1'), + ('235', '3369', '2006-02-16T02:30:53', '2005-07-12T01:21:03', '2005-07-14T04:05:03', '1'), + ('156', '4348', '2006-02-16T02:30:53', '2005-08-22T04:53:35', '2005-08-26T10:35:35', '1'), + ('125', '380', '2006-02-16T02:30:53', '2005-07-29T22:37:49', '2005-08-04T23:32:49', '1'), + ('366', '1311', '2006-02-16T02:30:53', '2005-07-11T07:28:05', '2005-07-18T07:29:05', '1'), + ('243', '3712', '2006-02-16T02:30:53', '2005-07-10T00:34:15', '2005-07-11T21:44:15', '1'), + ('416', '3009', '2006-02-16T02:30:53', '2005-08-23T01:35:12', '2005-09-01T05:33:12', '1'), + ('223', '4102', '2006-02-16T02:30:53', '2005-07-31T19:15:39', '2005-08-07T22:32:39', '1'), + ('416', '917', '2006-02-16T02:30:53', '2005-05-31T04:23:01', '2005-06-06T08:35:01', '1'), + ('561', '3291', '2006-02-16T02:30:53', '2005-08-02T19:07:21', '2005-08-07T20:59:21', '1'), + ('400', '4357', '2006-02-16T02:30:53', '2005-05-28T03:11:47', '2005-06-04T02:19:47', '1'), + ('149', '4238', '2006-02-16T02:30:53', '2005-08-23T05:04:33', '2005-08-27T09:58:33', '1'), + ('540', '2728', '2006-02-16T02:30:53', '2005-07-31T11:30:51', '2005-08-08T12:52:51', '1'), + ('235', '3176', '2006-02-16T02:30:53', '2005-07-31T22:31:43', '2005-08-07T02:43:43', '1'), + ('156', '937', '2006-02-16T02:30:53', '2005-07-12T04:51:13', '2005-07-21T03:38:13', '1'), + ('13', '2230', '2006-02-16T02:30:53', '2005-08-17T09:44:59', '2005-08-25T07:46:59', '1'), + ('198', '854', '2006-02-16T02:30:53', '2005-08-17T17:12:26', '2005-08-23T20:48:26', '1'), + ('361', '2511', '2006-02-16T02:30:53', '2005-07-31T22:15:13', '2005-08-06T23:26:13', '1'), + ('140', '2258', '2006-02-16T02:30:53', '2005-08-02T20:04:36', '2005-08-08T19:43:36', '1'), + ('98', '3348', '2006-02-16T02:30:53', '2005-07-26T23:47:31', '2005-07-31T22:17:31', '1'), + ('592', '4209', '2006-02-16T02:30:53', '2005-06-14T23:12:46', '2005-06-23T21:53:46', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['6819', '2451', '11711', '13565', '8553', '4901', '9044', '10284', '6592', '5916', '7022', '5016', '15769', '5322', '12679', '12546', '15765', '7617', '4952', '778', '15380', '179', '5963', '10972', '2177', '12744', '4067', '11483', '3942', '568', '5221', '9620', '8632', '10478', '7221', '2659', '7726', '5712', '12174', '6741', '4851', '8437', '6378', '14117', '11167', '13518', '2026', '4470', '14876', '9201', '3678', '15679', '11614', '10741', '14509', '5512', '5872', '5013', '10003', '1423', '10753', '2615', '8257', '6986', '10927', '2468', '9055', '10092', '2263', '4692', '6845', '1366', '2321', '6829', '396', '8976', '6283', '15348', '13859', '15349', '7299', '1373', '866', '718', '7872', '12275', '2185', '15681', '11728', '8606', '8459', '2050', '6244', '14372', '2783', '12645', '6318', '14270', '9110', '3687']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('198', '1253', '2006-02-16T02:30:53', '2005-07-12T18:21:01', '2005-07-13T21:14:01', '1'), + ('24', '835', '2006-02-16T02:30:53', '2005-06-18T19:28:02', '2005-06-23T16:41:02', '1'), + ('470', '1503', '2006-02-16T02:30:53', '2005-08-17T07:30:55', '2005-08-18T09:21:55', '1'), + ('214', '3378', '2006-02-16T02:30:53', '2005-08-20T04:38:52', '2005-08-27T07:17:52', '1'), + ('49', '2645', '2006-02-16T02:30:53', '2005-07-29T11:15:36', '2005-08-07T16:37:36', '1'), + ('507', '2187', '2006-02-16T02:30:53', '2005-07-08T20:44:51', '2005-07-10T01:04:51', '1'), + ('319', '3796', '2006-02-16T02:30:53', '2005-07-30T06:35:21', '2005-07-31T10:27:21', '1'), + ('20', '2879', '2006-02-16T02:30:53', '2005-08-01T03:33:19', '2005-08-09T07:58:19', '1'), + ('273', '3481', '2006-02-16T02:30:53', '2005-07-12T07:19:35', '2005-07-19T07:15:35', '1'), + ('35', '2267', '2006-02-16T02:30:53', '2005-07-10T21:26:31', '2005-07-19T20:23:31', '1'), + ('243', '1711', '2006-02-16T02:30:53', '2005-07-27T02:31:15', '2005-07-29T02:52:15', '1'), + ('5', '1871', '2006-02-16T02:30:53', '2005-07-09T01:57:57', '2005-07-09T22:07:57', '1'), + ('276', '2392', '2006-02-16T02:30:53', '2005-08-23T13:16:15', '2005-08-28T18:31:15', '1'), + ('432', '4420', '2006-02-16T02:30:53', '2005-07-09T16:28:13', '2005-07-18T14:53:13', '1'), + ('463', '1535', '2006-02-16T02:30:53', '2005-08-18T19:42:11', '2005-08-25T01:01:11', '1'), + ('30', '610', '2006-02-16T02:30:53', '2005-08-18T14:29:37', '2005-08-26T09:47:37', '1'), + ('408', '1250', '2006-02-16T02:30:53', '2005-08-23T13:06:19', '2005-08-31T12:18:19', '1'), + ('340', '2904', '2006-02-16T02:30:53', '2005-07-28T00:18:40', '2005-08-01T01:17:40', '1'), + ('14', '459', '2006-02-16T02:30:53', '2005-07-08T23:00:07', '2005-07-09T21:47:07', '1'), + ('535', '1816', '2006-02-16T02:30:53', '2005-05-29T14:09:53', '2005-06-05T20:05:53', '1'), + ('423', '3642', '2006-02-16T02:30:53', '2005-08-22T22:28:15', '2005-08-28T23:21:15', '1'), + ('19', '2575', '2006-02-16T02:30:53', '2005-05-26T04:26:06', '2005-06-03T10:06:06', '1'), + ('35', '4434', '2006-02-16T02:30:53', '2005-07-10T23:47:08', '2005-07-12T04:27:08', '1'), + ('348', '1928', '2006-02-16T02:30:53', '2005-08-02T04:08:25', '2005-08-09T23:25:25', '1'), + ('340', '492', '2006-02-16T02:30:53', '2005-06-18T00:34:45', '2005-06-26T18:40:45', '1'), + ('593', '3815', '2006-02-16T02:30:53', '2005-08-18T22:22:36', '2005-08-24T00:26:36', '1'), + ('469', '2945', '2006-02-16T02:30:53', '2005-07-07T04:34:23', '2005-07-16T04:04:23', '1'), + ('45', '1586', '2006-02-16T02:30:53', '2005-08-02T22:28:22', '2005-08-11T18:06:22', '1'), + ('553', '677', '2006-02-16T02:30:53', '2005-07-06T21:21:34', '2005-07-15T02:34:34', '1'), + ('155', '2232', '2006-02-16T02:30:53', '2005-05-28T09:57:36', '2005-05-31T15:44:36', '1'), + ('84', '2339', '2006-02-16T02:30:53', '2005-07-09T12:02:23', '2005-07-16T15:43:23', '1'), + ('576', '2177', '2006-02-16T02:30:53', '2005-07-31T04:19:18', '2005-08-08T09:20:18', '1'), + ('563', '1666', '2006-02-16T02:30:53', '2005-07-29T14:11:25', '2005-08-07T15:32:25', '1'), + ('417', '3885', '2006-02-16T02:30:53', '2005-08-01T10:09:06', '2005-08-06T05:05:06', '1'), + ('579', '3820', '2006-02-16T02:30:53', '2005-07-27T09:37:35', '2005-07-28T11:25:35', '1'), + ('139', '66', '2006-02-16T02:30:53', '2005-06-19T10:47:42', '2005-06-23T14:03:42', '1'), + ('219', '2578', '2006-02-16T02:30:53', '2005-07-28T04:52:19', '2005-08-04T09:05:19', '1'), + ('304', '3480', '2006-02-16T02:30:53', '2005-07-10T10:40:32', '2005-07-12T11:45:32', '1'), + ('101', '1458', '2006-02-16T02:30:53', '2005-08-18T01:08:53', '2005-08-20T03:28:53', '1'), + ('359', '237', '2006-02-16T02:30:53', '2005-07-12T14:24:16', '2005-07-15T08:31:16', '1'), + ('557', '134', '2006-02-16T02:30:53', '2005-07-08T18:40:05', '2005-07-12T21:46:05', '1'), + ('96', '2118', '2006-02-16T02:30:53', '2005-07-29T07:23:43', '2005-08-04T10:52:43', '1'), + ('145', '3170', '2006-02-16T02:30:53', '2005-07-11T21:45:23', '2005-07-14T16:56:23', '1'), + ('493', '573', '2006-02-16T02:30:53', '2005-08-21T01:11:59', '2005-08-22T06:56:59', '1'), + ('451', '148', '2006-02-16T02:30:53', '2005-08-02T10:15:51', '2005-08-09T09:18:51', '1'), + ('528', '352', '2006-02-16T02:30:53', '2005-08-20T02:36:17', '2005-08-24T08:06:17', '1'), + ('491', '3681', '2006-02-16T02:30:53', '2005-06-17T13:05:38', '2005-06-21T17:19:38', '1'), + ('145', '3605', '2006-02-16T02:30:53', '2005-07-08T00:20:57', '2005-07-10T02:31:57', '1'), + ('210', '3669', '2006-02-16T02:30:53', '2005-08-22T03:39:29', '2005-08-23T06:53:29', '1'), + ('291', '4387', '2006-02-16T02:30:53', '2005-07-30T12:42:21', '2005-08-08T06:50:21', '1'), + ('364', '3861', '2006-02-16T02:30:53', '2005-07-06T09:15:15', '2005-07-10T05:01:15', '1'), + ('103', '2945', '2006-02-16T02:30:53', '2005-08-23T09:27:29', '2005-08-28T09:14:29', '1'), + ('2', '805', '2006-02-16T02:30:53', '2005-08-17T03:52:18', '2005-08-20T07:04:18', '1'), + ('469', '3300', '2006-02-16T02:30:53', '2005-08-01T19:52:52', '2005-08-04T19:58:52', '1'), + ('520', '541', '2006-02-16T02:30:53', '2005-08-21T14:39:58', '2005-08-26T13:19:58', '1'), + ('405', '4470', '2006-02-16T02:30:53', '2005-07-10T01:05:38', '2005-07-17T20:47:38', '1'), + ('364', '270', '2006-02-16T02:30:53', '2005-07-10T18:54:05', '2005-07-19T15:41:05', '1'), + ('35', '3000', '2006-02-16T02:30:53', '2005-07-09T01:46:45', '2005-07-16T06:57:45', '1'), + ('13', '1603', '2006-02-16T02:30:53', '2005-07-31T17:48:51', '2005-08-02T14:23:51', '1'), + ('592', '1396', '2006-02-16T02:30:53', '2005-06-15T18:08:12', '2005-06-24T19:13:12', '1'), + ('273', '1557', '2006-02-16T02:30:53', '2005-08-01T20:09:24', '2005-08-09T19:31:24', '1'), + ('578', '3810', '2006-02-16T02:30:53', '2005-06-19T07:29:13', '2005-06-27T12:50:13', '1'), + ('566', '3024', '2006-02-16T02:30:53', '2005-07-29T01:03:20', '2005-08-04T21:54:20', '1'), + ('262', '2104', '2006-02-16T02:30:53', '2005-07-27T00:59:05', '2005-07-29T00:31:05', '1'), + ('288', '4125', '2006-02-16T02:30:53', '2005-08-02T02:31:15', '2005-08-10T20:41:15', '1'), + ('382', '1833', '2006-02-16T02:30:53', '2005-06-18T20:23:52', '2005-06-23T14:34:52', '1'), + ('512', '634', '2006-02-16T02:30:53', '2005-07-30T07:13:07', '2005-08-01T12:18:07', '1'), + ('364', '4151', '2006-02-16T02:30:53', '2005-07-31T20:28:09', '2005-08-01T21:37:09', '1'), + ('452', '3259', '2006-02-16T02:30:53', '2005-06-18T05:57:47', '2005-06-20T06:13:47', '1'), + ('288', '1490', '2006-02-16T02:30:53', '2005-07-08T11:07:06', '2005-07-09T14:08:06', '1'), + ('414', '3833', '2006-02-16T02:30:53', '2005-07-12T19:20:41', '2005-07-14T15:27:41', '1'), + ('576', '4238', '2006-02-16T02:30:53', '2005-06-15T14:21:00', '2005-06-24T17:36:00', '1'), + ('565', '1160', '2006-02-16T02:30:53', '2005-06-18T09:42:42', '2005-06-25T14:28:42', '1'), + ('361', '4184', '2006-02-16T02:30:53', '2005-07-12T18:38:59', '2005-07-16T23:25:59', '1'), + ('112', '1020', '2006-02-16T02:30:53', '2005-05-27T11:47:04', '2005-05-29T10:14:04', '1'), + ('507', '2135', '2006-02-16T02:30:53', '2005-07-30T04:12:32', '2005-08-04T23:08:32', '1'), + ('402', '3319', '2006-02-16T02:30:53', '2005-07-11T16:47:32', '2005-07-17T21:46:32', '1'), + ('587', '3846', '2006-02-16T02:30:53', '2005-08-22T21:13:46', '2005-08-24T17:06:46', '1'), + ('504', '4381', '2006-02-16T02:30:53', '2005-08-20T14:53:43', '2005-08-28T09:50:43', '1'), + ('587', '4055', '2006-02-16T02:30:53', '2005-08-22T21:13:51', '2005-08-23T20:55:51', '1'), + ('286', '3002', '2006-02-16T02:30:53', '2005-07-27T12:49:56', '2005-08-03T12:25:56', '1'), + ('51', '284', '2006-02-16T02:30:53', '2005-06-15T14:48:04', '2005-06-22T09:48:04', '1'), + ('8', '2867', '2006-02-16T02:30:53', '2005-05-30T03:43:54', '2005-06-08T04:28:54', '1'), + ('498', '1736', '2006-02-16T02:30:53', '2005-05-29T04:52:23', '2005-06-02T02:27:23', '1'), + ('66', '826', '2006-02-16T02:30:53', '2005-07-28T10:18:16', '2005-07-31T10:57:16', '1'), + ('507', '1474', '2006-02-16T02:30:53', '2005-08-18T04:42:02', '2005-08-25T00:50:02', '1'), + ('198', '4326', '2006-02-16T02:30:53', '2005-06-18T01:12:22', '2005-06-20T20:41:22', '1'), + ('61', '2813', '2006-02-16T02:30:53', '2005-08-23T09:35:34', '2005-08-27T08:33:34', '1'), + ('444', '726', '2006-02-16T02:30:53', '2005-08-17T08:12:26', '2005-08-18T03:26:26', '1'), + ('340', '4051', '2006-02-16T02:30:53', '2005-07-29T13:14:24', '2005-07-30T14:52:24', '1'), + ('144', '3441', '2006-02-16T02:30:53', '2005-07-29T08:05:40', '2005-08-04T03:24:40', '1'), + ('549', '1963', '2006-02-16T02:30:53', '2005-06-17T15:07:30', '2005-06-18T14:43:30', '1'), + ('383', '1558', '2006-02-16T02:30:53', '2005-07-11T14:53:38', '2005-07-12T16:42:38', '1'), + ('520', '1953', '2006-02-16T02:30:53', '2005-08-21T09:39:50', '2005-08-28T13:36:50', '1'), + ('113', '2778', '2006-02-16T02:30:53', '2005-06-19T18:29:10', '2005-06-21T22:09:10', '1'), + ('457', '1658', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('425', '2048', '2006-02-16T02:30:53', '2005-07-11T18:48:22', '2005-07-12T13:39:22', '1'), + ('171', '4083', '2006-02-16T02:30:53', '2005-08-21T06:22:18', '2005-08-27T08:04:18', '1'), + ('317', '1474', '2006-02-16T02:30:53', '2005-07-30T09:05:42', '2005-08-03T05:15:42', '1'), + ('207', '2040', '2006-02-16T02:30:53', '2005-07-06T09:38:33', '2005-07-14T07:50:33', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['4804', '13225', '11461', '14586', '10661', '5996', '11809', '2447', '1989', '11725', '7744', '10384', '3470', '9477', '9315', '1522', '1894', '424', '8806', '4663', '6097', '4573', '2693', '13044', '7571', '1196', '10341', '4009', '6411', '10146', '7607', '14126', '12058', '3355', '4436', '2855', '5441', '9108', '3048', '5390', '14297', '9700', '4106', '14352', '12313', '11993', '14568', '6752', '8109', '10517', '1545', '1437', '7803', '11047', '3663', '5887', '15134', '467', '11023', '2771', '12600', '8231', '4129', '10828', '14661', '3681', '1398', '11836', '11418', '2743', '11490', '13213', '9770', '8710', '6588', '7107', '1238', '10535', '6823', '10378', '1414', '7409', '15749', '1052', '15860', '8996', '13118', '3606', '6118', '13538', '14761', '4165', '3575', '13094', '9248', '5755', '454', '6836', '13881', '3405']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('269', '3756', '2006-02-16T02:30:53', '2005-07-08T16:57:30', '2005-07-10T18:25:30', '1'), + ('562', '1420', '2006-02-16T02:30:53', '2005-08-19T15:54:33', '2005-08-25T16:40:33', '1'), + ('65', '4343', '2006-02-16T02:30:53', '2005-08-02T21:35:00', '2005-08-05T01:34:00', '1'), + ('182', '3094', '2006-02-16T02:30:53', '2005-08-21T17:19:09', '2005-08-26T17:00:09', '1'), + ('177', '3311', '2006-02-16T02:30:53', '2005-08-01T16:48:31', '2005-08-02T21:02:31', '1'), + ('223', '4263', '2006-02-16T02:30:53', '2005-07-11T01:18:33', '2005-07-17T04:18:33', '1'), + ('305', '1136', '2006-02-16T02:30:53', '2005-08-17T11:51:39', '2005-08-24T17:14:39', '1'), + ('523', '2353', '2006-02-16T02:30:53', '2005-06-18T19:10:55', '2005-06-27T16:35:55', '1'), + ('35', '634', '2006-02-16T02:30:53', '2005-06-17T10:47:24', '2005-06-19T05:12:24', '1'), + ('45', '519', '2006-02-16T02:30:53', '2005-08-17T08:09:00', '2005-08-18T09:50:00', '1'), + ('288', '1863', '2006-02-16T02:30:53', '2005-07-28T05:38:20', '2005-07-31T11:00:20', '1'), + ('366', '2622', '2006-02-16T02:30:53', '2005-08-01T06:39:14', '2005-08-02T03:06:14', '1'), + ('565', '883', '2006-02-16T02:30:53', '2005-07-05T22:49:24', '2005-07-07T19:36:24', '1'), + ('213', '1932', '2006-02-16T02:30:53', '2005-07-30T23:07:22', '2005-08-04T20:54:22', '1'), + ('96', '444', '2006-02-16T02:30:53', '2005-07-30T17:05:29', '2005-08-01T12:47:29', '1'), + ('133', '235', '2006-02-16T02:30:53', '2005-06-16T00:17:39', '2005-06-22T05:38:39', '1'), + ('204', '3707', '2006-02-16T02:30:53', '2005-06-17T04:18:48', '2005-06-26T00:07:48', '1'), + ('35', '2815', '2006-02-16T02:30:53', '2005-05-27T15:34:01', '2005-06-05T09:44:01', '1'), + ('454', '4085', '2006-02-16T02:30:53', '2005-07-29T21:36:34', '2005-08-02T00:58:34', '1'), + ('139', '2959', '2006-02-16T02:30:53', '2005-07-08T09:59:18', '2005-07-10T11:25:18', '1'), + ('416', '297', '2006-02-16T02:30:53', '2005-07-11T06:21:43', '2005-07-16T10:04:43', '1'), + ('400', '2478', '2006-02-16T02:30:53', '2005-07-08T05:38:46', '2005-07-15T07:07:46', '1'), + ('107', '2570', '2006-02-16T02:30:53', '2005-06-19T13:11:47', '2005-06-27T11:17:47', '1'), + ('142', '809', '2006-02-16T02:30:53', '2005-08-19T09:14:31', '2005-08-20T11:16:31', '1'), + ('368', '3850', '2006-02-16T02:30:53', '2005-07-27T22:43:42', '2005-07-30T22:17:42', '1'), + ('52', '994', '2006-02-16T02:30:53', '2005-06-15T01:38:31', '2005-06-18T06:55:31', '1'), + ('445', '3304', '2006-02-16T02:30:53', '2005-08-01T05:10:02', '2005-08-07T11:01:02', '1'), + ('394', '3607', '2006-02-16T02:30:53', '2005-07-07T00:28:55', '2005-07-10T00:37:55', '1'), + ('124', '4347', '2006-02-16T02:30:53', '2005-07-11T23:10:50', '2005-07-19T17:15:50', '1'), + ('559', '1721', '2006-02-16T02:30:53', '2005-07-31T22:17:56', '2005-08-02T21:27:56', '1'), + ('293', '3914', '2006-02-16T02:30:53', '2005-07-28T00:05:53', '2005-07-31T04:13:53', '1'), + ('215', '2738', '2006-02-16T02:30:53', '2005-08-21T01:32:17', '2005-08-23T01:02:17', '1'), + ('540', '2438', '2006-02-16T02:30:53', '2005-08-17T21:07:41', '2005-08-26T16:07:41', '1'), + ('275', '1960', '2006-02-16T02:30:53', '2005-06-21T11:30:47', '2005-06-23T06:04:47', '1'), + ('563', '4326', '2006-02-16T02:30:53', '2005-07-07T22:52:04', '2005-07-10T04:51:04', '1'), + ('483', '3495', '2006-02-16T02:30:53', '2005-06-19T23:11:49', '2005-06-26T21:52:49', '1'), + ('7', '3913', '2006-02-16T02:30:53', '2005-07-09T21:52:05', '2005-07-17T02:54:05', '1'), + ('490', '3977', '2006-02-16T02:30:53', '2005-07-30T08:56:36', '2005-08-04T11:07:36', '1'), + ('482', '4389', '2006-02-16T02:30:53', '2005-06-20T12:49:55', '2005-06-26T11:06:55', '1'), + ('139', '715', '2006-02-16T02:30:53', '2005-07-09T19:26:22', '2005-07-14T22:46:22', '1'), + ('566', '1712', '2006-02-16T02:30:53', '2005-08-21T07:13:46', '2005-08-25T09:07:46', '1'), + ('40', '2678', '2006-02-16T02:30:53', '2005-07-31T07:29:59', '2005-08-02T09:53:59', '1'), + ('563', '4083', '2006-02-16T02:30:53', '2005-07-07T06:33:35', '2005-07-13T04:03:35', '1'), + ('527', '1224', '2006-02-16T02:30:53', '2005-08-21T09:06:29', '2005-08-28T13:36:29', '1'), + ('180', '2053', '2006-02-16T02:30:53', '2005-08-18T06:07:31', '2005-08-27T00:20:31', '1'), + ('303', '295', '2006-02-16T02:30:53', '2005-08-17T18:27:49', '2005-08-21T00:04:49', '1'), + ('582', '3331', '2006-02-16T02:30:53', '2005-08-21T16:30:48', '2005-08-22T13:49:48', '1'), + ('453', '3392', '2006-02-16T02:30:53', '2005-07-12T14:53:15', '2005-07-20T09:23:15', '1'), + ('407', '652', '2006-02-16T02:30:53', '2005-07-28T19:07:44', '2005-07-31T14:59:44', '1'), + ('199', '2299', '2006-02-16T02:30:53', '2005-08-01T11:41:57', '2005-08-05T06:14:57', '1'), + ('563', '762', '2006-02-16T02:30:53', '2005-06-16T01:31:23', '2005-06-24T05:50:23', '1'), + ('96', '3263', '2006-02-16T02:30:53', '2005-06-15T18:37:04', '2005-06-20T12:56:04', '1'), + ('449', '3438', '2006-02-16T02:30:53', '2005-07-28T07:52:13', '2005-08-03T13:35:13', '1'), + ('416', '2267', '2006-02-16T02:30:53', '2005-08-02T06:09:20', '2005-08-11T08:36:20', '1'), + ('566', '2646', '2006-02-16T02:30:53', '2005-07-06T08:15:47', '2005-07-07T08:57:47', '1'), + ('532', '2602', '2006-02-16T02:30:53', '2005-07-10T19:45:47', '2005-07-15T22:15:47', '1'), + ('22', '4442', '2006-02-16T02:30:53', '2005-08-22T13:18:25', '2005-08-29T18:03:25', '1'), + ('557', '339', '2006-02-16T02:30:53', '2005-05-27T21:10:03', '2005-06-01T16:08:03', '1'), + ('6', '3617', '2006-02-16T02:30:53', '2005-08-02T05:36:38', '2005-08-10T05:39:38', '1'), + ('262', '40', '2006-02-16T02:30:53', '2005-06-19T17:54:48', '2005-06-27T17:14:48', '1'), + ('171', '1475', '2006-02-16T02:30:53', '2005-08-18T16:44:24', '2005-08-25T17:28:24', '1'), + ('331', '1083', '2006-02-16T02:30:53', '2005-07-29T00:14:37', '2005-07-31T19:12:37', '1'), + ('592', '1413', '2006-02-16T02:30:53', '2005-07-07T07:37:03', '2005-07-14T13:31:03', '1'), + ('471', '2448', '2006-02-16T02:30:53', '2005-08-01T23:16:10', '2005-08-09T21:17:10', '1'), + ('469', '745', '2006-02-16T02:30:53', '2005-08-21T19:44:21', '2005-08-27T14:35:21', '1'), + ('294', '3325', '2006-02-16T02:30:53', '2005-07-06T09:19:30', '2005-07-11T09:40:30', '1'), + ('527', '4402', '2006-02-16T02:30:53', '2005-06-15T16:28:42', '2005-06-16T12:11:42', '1'), + ('198', '2253', '2006-02-16T02:30:53', '2005-08-17T13:03:36', '2005-08-19T17:15:36', '1'), + ('91', '4490', '2006-02-16T02:30:53', '2005-08-02T19:45:33', '2005-08-06T17:40:33', '1'), + ('35', '2611', '2006-02-16T02:30:53', '2005-06-19T16:15:56', '2005-06-23T12:30:56', '1'), + ('156', '1178', '2006-02-16T02:30:53', '2005-08-02T22:36:00', '2005-08-09T16:36:00', '1'), + ('13', '1546', '2006-02-16T02:30:53', '2005-08-19T15:25:48', '2005-08-22T09:32:48', '1'), + ('317', '1226', '2006-02-16T02:30:53', '2005-07-31T09:52:40', '2005-08-09T06:44:40', '1'), + ('566', '3391', '2006-02-16T02:30:53', '2005-07-29T17:26:03', '2005-07-30T19:51:03', '1'), + ('420', '1257', '2006-02-16T02:30:53', '2005-07-12T06:57:40', '2005-07-16T04:27:40', '1'), + ('104', '1883', '2006-02-16T02:30:53', '2005-07-27T05:22:04', '2005-08-02T06:38:04', '1'), + ('205', '3534', '2006-02-16T02:30:53', '2005-06-15T04:49:08', '2005-06-20T00:06:08', '1'), + ('284', '1838', '2006-02-16T02:30:53', '2005-08-01T12:21:13', '2005-08-09T08:58:13', '1'), + ('557', '795', '2006-02-16T02:30:53', '2005-07-12T18:24:31', '2005-07-17T23:13:31', '1'), + ('113', '4110', '2006-02-16T02:30:53', '2005-08-01T06:30:04', '2005-08-06T09:10:04', '1'), + ('304', '4005', '2006-02-16T02:30:53', '2005-06-15T17:26:32', '2005-06-22T22:30:32', '1'), + ('585', '2352', '2006-02-16T02:30:53', '2005-07-27T16:38:24', '2005-07-30T18:06:24', '1'), + ('575', '4224', '2006-02-16T02:30:53', '2005-08-23T12:33:41', '2005-08-24T10:52:41', '1'), + ('156', '2157', '2006-02-16T02:30:53', '2005-05-31T07:07:03', '2005-06-05T09:38:03', '1'), + ('41', '2583', '2006-02-16T02:30:53', '2005-08-23T16:08:40', '2005-08-28T15:35:40', '1'), + ('579', '1970', '2006-02-16T02:30:53', '2005-07-30T04:53:23', '2005-07-31T06:01:23', '1'), + ('181', '470', '2006-02-16T02:30:53', '2005-08-19T11:39:58', '2005-08-25T14:44:58', '1'), + ('166', '1737', '2006-02-16T02:30:53', '2005-07-06T05:28:02', '2005-07-10T04:51:02', '1'), + ('13', '3013', '2006-02-16T02:30:53', '2005-07-11T07:43:08', '2005-07-20T03:17:08', '1'), + ('279', '581', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('490', '2657', '2006-02-16T02:30:53', '2005-08-21T23:30:28', '2005-08-26T03:26:28', '1'), + ('66', '3845', '2006-02-16T02:30:53', '2005-07-07T09:23:27', '2005-07-15T06:00:27', '1'), + ('49', '3234', '2006-02-16T02:30:53', '2005-07-06T03:36:19', '2005-07-08T06:21:19', '1'), + ('494', '3178', '2006-02-16T02:30:53', '2005-08-19T10:47:58', '2005-08-21T06:20:58', '1'), + ('2', '1382', '2006-02-16T02:30:53', '2005-07-30T14:14:11', '2005-08-05T11:19:11', '1'), + ('2', '2760', '2006-02-16T02:30:53', '2005-07-10T12:38:56', '2005-07-19T17:02:56', '1'), + ('575', '3499', '2006-02-16T02:30:53', '2005-05-27T19:31:36', '2005-05-30T15:46:36', '1'), + ('113', '2744', '2006-02-16T02:30:53', '2005-07-12T18:58:05', '2005-07-15T17:45:05', '1'), + ('144', '2831', '2006-02-16T02:30:53', '2005-08-20T15:18:55', '2005-08-25T11:25:55', '1'), + ('155', '2344', '2006-02-16T02:30:53', '2005-06-21T15:58:25', '2005-06-23T10:58:25', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['10121', '6849', '12136', '7170', '10064', '14910', '12502', '2172', '8174', '6002', '2569', '15047', '6062', '10334', '15881', '12398', '1676', '5256', '1268', '6869', '5154', '15911', '1910', '2137', '8433', '6638', '12743', '11947', '9799', '5795', '7068', '3399', '13227', '14595', '7258', '8401', '2968', '2828', '4839', '9830', '9909', '10300', '3138', '15345', '5503', '14733', '2089', '2422', '13644', '10430', '8974', '14114', '11885', '6079', '7988', '1112', '4661', '1920', '8397', '1690', '14766', '223', '11207', '8747', '310', '4931', '1352', '9749', '15851', '14159', '5363', '15986', '9021', '8150', '14306', '14603', '7290', '2865', '4538', '11377', '3247', '9167', '4802', '14125', '14995', '3862', '3652', '3906', '6407', '1786', '4650', '9578', '8373', '5957', '6286', '2666', '13611', '7433', '13466', '116']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('425', '2969', '2006-02-16T02:30:53', '2005-07-31T21:24:53', '2005-08-03T22:24:53', '1'), + ('479', '4307', '2006-02-16T02:30:53', '2005-07-12T19:29:19', '2005-07-19T22:03:19', '1'), + ('527', '3944', '2006-02-16T02:30:53', '2005-08-17T23:51:30', '2005-08-23T01:35:30', '1'), + ('140', '370', '2006-02-16T02:30:53', '2005-07-27T07:58:26', '2005-07-28T02:30:26', '1'), + ('41', '3140', '2006-02-16T02:30:53', '2005-07-31T19:27:02', '2005-08-06T21:15:02', '1'), + ('540', '1266', '2006-02-16T02:30:53', '2005-08-22T04:50:52', '2005-08-25T04:14:52', '1'), + ('235', '2153', '2006-02-16T02:30:53', '2005-08-18T13:16:31', '2005-08-19T17:47:31', '1'), + ('457', '2912', '2006-02-16T02:30:53', '2005-06-18T00:06:16', '2005-06-26T00:50:16', '1'), + ('359', '465', '2006-02-16T02:30:53', '2005-07-28T21:36:52', '2005-08-04T00:32:52', '1'), + ('45', '4422', '2006-02-16T02:30:53', '2005-07-11T01:27:49', '2005-07-12T06:02:49', '1'), + ('213', '30', '2006-02-16T02:30:53', '2005-06-19T04:19:04', '2005-06-26T04:31:04', '1'), + ('19', '1309', '2006-02-16T02:30:53', '2005-08-22T09:57:16', '2005-08-23T11:39:16', '1'), + ('408', '3301', '2006-02-16T02:30:53', '2005-07-11T04:11:58', '2005-07-15T05:00:58', '1'), + ('445', '3387', '2006-02-16T02:30:53', '2005-08-01T04:58:42', '2005-08-09T02:00:42', '1'), + ('383', '617', '2006-02-16T02:30:53', '2005-08-23T16:44:25', '2005-08-29T13:58:25', '1'), + ('321', '4247', '2006-02-16T02:30:53', '2005-08-18T09:13:24', '2005-08-27T14:58:24', '1'), + ('171', '931', '2006-02-16T02:30:53', '2005-06-16T11:06:09', '2005-06-21T05:17:09', '1'), + ('273', '4226', '2006-02-16T02:30:53', '2005-07-09T13:55:45', '2005-07-15T17:02:45', '1'), + ('142', '3641', '2006-02-16T02:30:53', '2005-06-15T07:29:30', '2005-06-23T12:36:30', '1'), + ('278', '3546', '2006-02-16T02:30:53', '2005-07-12T20:12:06', '2005-07-13T18:37:06', '1'), + ('361', '3785', '2006-02-16T02:30:53', '2005-07-09T08:46:18', '2005-07-14T03:19:18', '1'), + ('582', '3006', '2006-02-16T02:30:53', '2005-08-23T17:44:53', '2005-09-01T19:14:53', '1'), + ('199', '3903', '2006-02-16T02:30:53', '2005-06-17T05:11:27', '2005-06-23T23:16:27', '1'), + ('581', '1158', '2006-02-16T02:30:53', '2005-06-17T21:18:28', '2005-06-20T21:05:28', '1'), + ('125', '1957', '2006-02-16T02:30:53', '2005-07-29T07:19:16', '2005-08-05T03:29:16', '1'), + ('87', '207', '2006-02-16T02:30:53', '2005-07-12T09:58:02', '2005-07-13T09:40:02', '1'), + ('565', '2630', '2006-02-16T02:30:53', '2005-08-18T22:22:31', '2005-08-27T00:31:31', '1'), + ('220', '2928', '2006-02-16T02:30:53', '2005-08-17T17:08:13', '2005-08-23T21:53:13', '1'), + ('494', '3008', '2006-02-16T02:30:53', '2005-07-31T10:58:32', '2005-08-01T12:08:32', '1'), + ('304', '3958', '2006-02-16T02:30:53', '2005-07-10T14:36:29', '2005-07-14T13:26:29', '1'), + ('568', '4465', '2006-02-16T02:30:53', '2005-07-27T03:57:50', '2005-07-30T04:27:50', '1'), + ('98', '619', '2006-02-16T02:30:53', '2005-06-21T15:47:48', '2005-06-26T13:46:48', '1'), + ('288', '2759', '2006-02-16T02:30:53', '2005-08-19T16:05:38', '2005-08-20T21:39:38', '1'), + ('118', '1879', '2006-02-16T02:30:53', '2005-08-21T17:35:17', '2005-08-27T12:11:17', '1'), + ('494', '2079', '2006-02-16T02:30:53', '2005-07-27T11:05:54', '2005-08-02T11:36:54', '1'), + ('232', '3121', '2006-02-16T02:30:53', '2005-07-29T06:25:08', '2005-08-01T06:49:08', '1'), + ('252', '4415', '2006-02-16T02:30:53', '2005-06-20T07:41:47', '2005-06-23T04:27:47', '1'), + ('526', '3230', '2006-02-16T02:30:53', '2005-06-19T20:51:33', '2005-06-25T17:38:33', '1'), + ('556', '1810', '2006-02-16T02:30:53', '2005-07-08T18:13:10', '2005-07-15T12:49:10', '1'), + ('112', '170', '2006-02-16T02:30:53', '2005-07-31T11:59:05', '2005-08-06T10:38:05', '1'), + ('587', '2600', '2006-02-16T02:30:53', '2005-07-31T14:43:34', '2005-08-09T15:31:34', '1'), + ('207', '4334', '2006-02-16T02:30:53', '2005-08-01T04:08:11', '2005-08-04T00:24:11', '1'), + ('570', '2265', '2006-02-16T02:30:53', '2005-06-20T19:43:45', '2005-06-26T20:41:45', '1'), + ('277', '3481', '2006-02-16T02:30:53', '2005-08-22T21:05:50', '2005-08-26T20:30:50', '1'), + ('262', '3892', '2006-02-16T02:30:53', '2005-07-10T00:35:37', '2005-07-12T20:29:37', '1'), + ('408', '398', '2006-02-16T02:30:53', '2005-08-21T22:22:33', '2005-08-26T21:01:33', '1'), + ('156', '4030', '2006-02-16T02:30:53', '2005-06-17T17:45:09', '2005-06-25T16:41:09', '1'), + ('527', '3170', '2006-02-16T02:30:53', '2005-06-18T17:28:57', '2005-06-23T15:22:57', '1'), + ('464', '970', '2006-02-16T02:30:53', '2005-08-20T07:46:30', '2005-08-27T01:54:30', '1'), + ('471', '1150', '2006-02-16T02:30:53', '2005-08-01T08:37:06', '2005-08-03T07:25:06', '1'), + ('425', '3376', '2006-02-16T02:30:53', '2005-07-30T04:09:16', '2005-08-04T06:55:16', '1'), + ('8', '2270', '2006-02-16T02:30:53', '2005-08-21T01:07:11', '2005-08-24T20:33:11', '1'), + ('481', '3931', '2006-02-16T02:30:53', '2005-08-17T14:53:53', '2005-08-22T10:59:53', '1'), + ('119', '1494', '2006-02-16T02:30:53', '2005-07-11T05:07:14', '2005-07-17T08:45:14', '1'), + ('517', '2906', '2006-02-16T02:30:53', '2005-07-28T14:37:18', '2005-08-05T10:53:18', '1'), + ('214', '2453', '2006-02-16T02:30:53', '2005-05-31T15:51:39', '2005-06-03T14:04:39', '1'), + ('518', '2641', '2006-02-16T02:30:53', '2005-07-08T09:55:06', '2005-07-11T08:26:06', '1'), + ('75', '2199', '2006-02-16T02:30:53', '2005-06-17T06:00:23', '2005-06-24T04:49:23', '1'), + ('518', '3542', '2006-02-16T02:30:53', '2005-07-29T06:09:35', '2005-08-01T02:08:35', '1'), + ('286', '1099', '2006-02-16T02:30:53', '2005-06-16T12:24:18', '2005-06-25T15:00:18', '1'), + ('523', '768', '2006-02-16T02:30:53', '2005-08-21T23:42:20', '2005-08-26T03:46:20', '1'), + ('460', '3121', '2006-02-16T02:30:53', '2005-05-26T10:15:23', '2005-05-30T11:43:23', '1'), + ('481', '4470', '2006-02-16T02:30:53', '2005-08-02T12:01:30', '2005-08-05T07:56:30', '1'), + ('70', '2584', '2006-02-16T02:30:53', '2005-07-29T19:07:57', '2005-07-30T16:01:57', '1'), + ('409', '593', '2006-02-16T02:30:53', '2005-05-26T22:41:07', '2005-06-02T04:09:07', '1'), + ('284', '2750', '2006-02-16T02:30:53', '2005-07-08T22:16:18', '2005-07-17T03:42:18', '1'), + ('276', '4352', '2006-02-16T02:30:53', '2005-06-15T12:58:27', '2005-06-18T10:57:27', '1'), + ('52', '658', '2006-02-16T02:30:53', '2005-07-31T09:18:33', '2005-08-06T07:41:33', '1'), + ('469', '2286', '2006-02-16T02:30:53', '2005-08-23T15:46:33', '2005-08-29T15:52:33', '1'), + ('144', '3231', '2006-02-16T02:30:53', '2005-08-21T02:45:58', '2005-08-27T04:53:58', '1'), + ('425', '2180', '2006-02-16T02:30:53', '2005-07-09T18:18:49', '2005-07-14T22:16:49', '1'), + ('226', '3472', '2006-02-16T02:30:53', '2005-08-23T20:20:37', '2005-08-29T20:49:37', '1'), + ('498', '674', '2006-02-16T02:30:53', '2005-07-30T05:34:24', '2005-08-03T04:13:24', '1'), + ('497', '3489', '2006-02-16T02:30:53', '2005-07-28T20:50:41', '2005-08-02T00:43:41', '1'), + ('453', '4027', '2006-02-16T02:30:53', '2005-08-21T07:32:35', '2005-08-30T05:53:35', '1'), + ('26', '94', '2006-02-16T02:30:53', '2005-08-21T17:51:06', '2005-08-28T15:36:06', '1'), + ('423', '3652', '2006-02-16T02:30:53', '2005-07-27T12:28:45', '2005-08-01T16:18:45', '1'), + ('10', '1569', '2006-02-16T02:30:53', '2005-06-20T00:00:55', '2005-06-21T02:20:55', '1'), + ('451', '3638', '2006-02-16T02:30:53', '2005-07-08T03:56:29', '2005-07-15T08:24:29', '1'), + ('119', '3334', '2006-02-16T02:30:53', '2005-08-02T18:16:47', '2005-08-08T13:46:47', '1'), + ('277', '1406', '2006-02-16T02:30:53', '2005-06-21T03:12:15', '2005-06-27T00:44:15', '1'), + ('162', '1785', '2006-02-16T02:30:53', '2005-07-30T11:30:37', '2005-08-08T17:13:37', '1'), + ('562', '22', '2006-02-16T02:30:53', '2005-07-08T16:55:17', '2005-07-15T19:34:17', '1'), + ('265', '2174', '2006-02-16T02:30:53', '2005-08-21T01:32:16', '2005-08-26T00:09:16', '1'), + ('482', '4178', '2006-02-16T02:30:53', '2005-08-22T07:52:31', '2005-08-24T05:16:31', '1'), + ('181', '471', '2006-02-16T02:30:53', '2005-07-06T17:35:22', '2005-07-15T17:13:22', '1'), + ('518', '1231', '2006-02-16T02:30:53', '2005-07-06T07:44:30', '2005-07-08T04:41:30', '1'), + ('293', '1383', '2006-02-16T02:30:53', '2005-07-06T19:35:55', '2005-07-15T22:35:55', '1'), + ('140', '775', '2006-02-16T02:30:53', '2005-07-11T23:02:19', '2005-07-21T00:30:19', '1'), + ('323', '263', '2006-02-16T02:30:53', '2005-06-16T19:30:54', '2005-06-19T14:24:54', '1'), + ('108', '2850', '2006-02-16T02:30:53', '2005-07-08T09:32:08', '2005-07-15T15:20:08', '1'), + ('115', '2965', '2006-02-16T02:30:53', '2005-07-31T02:54:31', '2005-08-02T02:48:31', '1'), + ('457', '2070', '2006-02-16T02:30:53', '2005-07-29T05:19:53', '2005-08-04T04:39:53', '1'), + ('210', '2517', '2006-02-16T02:30:53', '2005-07-10T23:24:02', '2005-07-12T20:28:02', '1'), + ('140', '1070', '2006-02-16T02:30:53', '2005-07-11T16:55:35', '2005-07-13T22:51:35', '1'), + ('454', '1872', '2006-02-16T02:30:53', '2005-06-19T11:17:12', '2005-06-28T12:47:12', '1'), + ('112', '1460', '2006-02-16T02:30:53', '2005-08-20T06:20:42', '2005-08-28T10:07:42', '1'), + ('282', '1748', '2006-02-16T02:30:53', '2005-07-27T17:32:20', '2005-08-01T18:49:20', '1'), + ('262', '3088', '2006-02-16T02:30:53', '2005-08-20T00:55:16', '2005-08-22T22:48:16', '1'), + ('18', '4453', '2006-02-16T02:30:53', '2005-05-25T19:27:51', '2005-05-26T16:23:51', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['6673', '14378', '5237', '4079', '11152', '13464', '8655', '10567', '6694', '14288', '4887', '10225', '7145', '6092', '2564', '877', '7863', '5274', '7611', '15043', '15989', '1719', '2596', '5202', '15', '11670', '9962', '4460', '1319', '6247', '5245', '1205', '2322', '776', '4816', '1554', '2342', '7174', '3360', '11659', '10737', '4237', '8911', '8821', '14541', '10699', '1750', '14246', '13302', '3543', '2679', '7721', '3103', '2346', '12515', '1892', '640', '10254', '3443', '14669', '151', '6330', '983', '1711', '14324', '1017', '12463', '3042', '41', '11349', '2350', '13727', '15151', '7673', '3097', '8880', '14223', '9439', '5500', '4245', '1315', '4321', '14221', '750', '3498', '13771', '1489', '7875', '6295', '4978', '3344', '14354', '7948', '14712', '4422', '9682', '10178', '4584', '849', '5000']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('322', '1997', '2006-02-16T02:30:53', '2005-07-12T11:50:56', '2005-07-13T14:27:56', '1'), + ('515', '810', '2006-02-16T02:30:53', '2005-08-21T09:50:02', '2005-08-30T09:07:02', '1'), + ('84', '2341', '2006-02-16T02:30:53', '2005-07-09T12:56:58', '2005-07-11T15:41:58', '1'), + ('84', '2202', '2006-02-16T02:30:53', '2005-07-07T05:06:27', '2005-07-16T08:46:27', '1'), + ('494', '3887', '2006-02-16T02:30:53', '2005-08-02T09:53:36', '2005-08-11T14:58:36', '1'), + ('576', '4292', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('232', '3986', '2006-02-16T02:30:53', '2005-07-29T15:04:42', '2005-08-04T11:26:42', '1'), + ('212', '2744', '2006-02-16T02:30:53', '2005-08-01T13:16:01', '2005-08-05T14:59:01', '1'), + ('204', '586', '2006-02-16T02:30:53', '2005-07-12T12:39:23', '2005-07-19T14:47:23', '1'), + ('512', '587', '2006-02-16T02:30:53', '2005-08-21T06:57:34', '2005-08-26T11:32:34', '1'), + ('543', '3613', '2006-02-16T02:30:53', '2005-07-08T19:59:14', '2005-07-15T22:53:14', '1'), + ('498', '3131', '2006-02-16T02:30:53', '2005-08-01T01:38:40', '2005-08-06T20:00:40', '1'), + ('109', '3653', '2006-02-16T02:30:53', '2005-07-27T07:01:00', '2005-07-31T02:31:00', '1'), + ('75', '2129', '2006-02-16T02:30:53', '2005-07-11T05:51:31', '2005-07-17T03:42:31', '1'), + ('408', '4008', '2006-02-16T02:30:53', '2005-06-19T03:41:10', '2005-06-24T03:10:10', '1'), + ('9', '886', '2006-02-16T02:30:53', '2005-05-30T05:48:59', '2005-06-02T09:30:59', '1'), + ('182', '1212', '2006-02-16T02:30:53', '2005-07-28T10:05:46', '2005-07-29T14:42:46', '1'), + ('108', '4579', '2006-02-16T02:30:53', '2005-07-09T14:34:09', '2005-07-14T13:02:09', '1'), + ('467', '3347', '2006-02-16T02:30:53', '2005-07-28T00:11:47', '2005-07-28T18:35:47', '1'), + ('182', '3797', '2006-02-16T02:30:53', '2005-08-22T09:49:32', '2005-08-28T13:50:32', '1'), + ('96', '38', '2006-02-16T02:30:53', '2005-08-23T20:24:36', '2005-08-26T20:35:36', '1'), + ('582', '2699', '2006-02-16T02:30:53', '2005-06-16T14:55:53', '2005-06-18T14:12:53', '1'), + ('80', '2229', '2006-02-16T02:30:53', '2005-06-19T05:48:26', '2005-06-24T10:16:26', '1'), + ('321', '3417', '2006-02-16T02:30:53', '2005-07-09T10:53:48', '2005-07-15T13:31:48', '1'), + ('319', '3049', '2006-02-16T02:30:53', '2005-05-25T00:39:22', '2005-06-03T03:30:22', '1'), + ('286', '4437', '2006-02-16T02:30:53', '2005-08-17T05:48:59', '2005-08-19T08:51:59', '1'), + ('576', '1951', '2006-02-16T02:30:53', '2005-07-31T16:10:36', '2005-08-02T17:09:36', '1'), + ('592', '4121', '2006-02-16T02:30:53', '2005-07-07T23:50:14', '2005-07-09T21:55:14', '1'), + ('190', '4296', '2006-02-16T02:30:53', '2005-06-15T10:39:05', '2005-06-18T05:25:05', '1'), + ('589', '2504', '2006-02-16T02:30:53', '2005-07-11T15:00:05', '2005-07-18T13:47:05', '1'), + ('115', '3547', '2006-02-16T02:30:53', '2005-07-09T13:24:14', '2005-07-12T11:16:14', '1'), + ('340', '470', '2006-02-16T02:30:53', '2005-06-15T02:25:56', '2005-06-22T23:19:56', '1'), + ('213', '1893', '2006-02-16T02:30:53', '2005-06-18T09:44:21', '2005-06-25T09:29:21', '1'), + ('113', '4339', '2006-02-16T02:30:53', '2005-05-29T13:35:35', '2005-06-03T17:33:35', '1'), + ('207', '2700', '2006-02-16T02:30:53', '2005-07-08T17:14:14', '2005-07-11T15:03:14', '1'), + ('155', '715', '2006-02-16T02:30:53', '2005-06-16T02:16:47', '2005-06-22T05:15:47', '1'), + ('146', '2169', '2006-02-16T02:30:53', '2005-06-18T11:42:40', '2005-06-20T14:40:40', '1'), + ('570', '46', '2006-02-16T02:30:53', '2005-07-27T08:00:36', '2005-08-01T03:11:36', '1'), + ('498', '2792', '2006-02-16T02:30:53', '2005-06-21T12:12:41', '2005-06-26T06:32:41', '1'), + ('112', '2881', '2006-02-16T02:30:53', '2005-08-17T05:20:45', '2005-08-22T10:18:45', '1'), + ('149', '1773', '2006-02-16T02:30:53', '2005-08-01T19:31:24', '2005-08-10T19:17:24', '1'), + ('477', '3773', '2006-02-16T02:30:53', '2005-07-07T13:16:55', '2005-07-15T16:33:55', '1'), + ('445', '2159', '2006-02-16T02:30:53', '2005-07-30T01:30:57', '2005-08-02T20:01:57', '1'), + ('477', '52', '2006-02-16T02:30:53', '2005-07-29T22:18:12', '2005-08-05T22:00:12', '1'), + ('576', '1275', '2006-02-16T02:30:53', '2005-08-21T15:34:32', '2005-08-25T13:18:32', '1'), + ('125', '1029', '2006-02-16T02:30:53', '2005-08-01T18:24:51', '2005-08-06T20:18:51', '1'), + ('321', '1103', '2006-02-16T02:30:53', '2005-06-16T16:57:36', '2005-06-25T21:51:36', '1'), + ('120', '3499', '2006-02-16T02:30:53', '2005-08-21T05:34:09', '2005-08-26T06:12:09', '1'), + ('51', '4041', '2006-02-16T02:30:53', '2005-08-19T18:54:26', '2005-08-21T23:01:26', '1'), + ('394', '3997', '2006-02-16T02:30:53', '2005-07-06T02:01:08', '2005-07-07T03:14:08', '1'), + ('109', '1994', '2006-02-16T02:30:53', '2005-06-19T12:12:30', '2005-06-27T08:27:30', '1'), + ('83', '2228', '2006-02-16T02:30:53', '2005-07-28T04:42:58', '2005-07-31T07:52:58', '1'), + ('553', '1877', '2006-02-16T02:30:53', '2005-06-20T16:58:19', '2005-06-25T21:18:19', '1'), + ('308', '2575', '2006-02-16T02:30:53', '2005-06-18T12:08:16', '2005-06-27T15:02:16', '1'), + ('63', '2703', '2006-02-16T02:30:53', '2005-08-18T13:39:26', '2005-08-22T09:05:26', '1'), + ('319', '139', '2006-02-16T02:30:53', '2005-06-17T04:17:33', '2005-06-20T00:06:33', '1'), + ('465', '495', '2006-02-16T02:30:53', '2005-05-28T18:43:26', '2005-05-30T13:39:26', '1'), + ('416', '2238', '2006-02-16T02:30:53', '2005-08-01T02:42:03', '2005-08-05T23:31:03', '1'), + ('377', '1639', '2006-02-16T02:30:53', '2005-06-21T20:19:00', '2005-06-30T15:39:00', '1'), + ('317', '3154', '2006-02-16T02:30:53', '2005-08-21T19:54:06', '2005-08-25T23:12:06', '1'), + ('14', '2942', '2006-02-16T02:30:53', '2005-05-26T00:37:28', '2005-05-30T06:28:28', '1'), + ('119', '3917', '2006-02-16T02:30:53', '2005-07-11T19:15:42', '2005-07-17T19:10:42', '1'), + ('115', '63', '2006-02-16T02:30:53', '2005-05-30T22:15:51', '2005-06-02T22:56:51', '1'), + ('347', '273', '2006-02-16T02:30:53', '2005-06-16T14:11:52', '2005-06-25T08:49:52', '1'), + ('155', '1361', '2006-02-16T02:30:53', '2005-08-21T08:10:56', '2005-08-30T12:09:56', '1'), + ('16', '1242', '2006-02-16T02:30:53', '2005-05-31T02:53:36', '2005-06-03T05:04:36', '1'), + ('214', '30', '2006-02-16T02:30:53', '2005-08-18T11:31:34', '2005-08-23T12:04:34', '1'), + ('291', '3103', '2006-02-16T02:30:53', '2005-06-20T12:38:27', '2005-06-26T11:18:27', '1'), + ('174', '1761', '2006-02-16T02:30:53', '2005-05-25T05:12:29', '2005-06-02T00:28:29', '1'), + ('73', '1871', '2006-02-16T02:30:53', '2005-08-02T17:21:49', '2005-08-06T18:40:49', '1'), + ('471', '1179', '2006-02-16T02:30:53', '2005-06-18T12:25:29', '2005-06-23T11:35:29', '1'), + ('85', '4201', '2006-02-16T02:30:53', '2005-08-20T10:08:53', '2005-08-27T09:30:53', '1'), + ('463', '4070', '2006-02-16T02:30:53', '2005-08-22T14:23:11', '2005-08-30T14:01:11', '1'), + ('409', '2368', '2006-02-16T02:30:53', '2005-07-28T02:53:53', '2005-08-06T00:07:53', '1'), + ('280', '4337', '2006-02-16T02:30:53', '2005-06-20T16:26:14', '2005-06-23T14:46:14', '1'), + ('51', '2920', '2006-02-16T02:30:53', '2005-07-30T00:16:55', '2005-08-01T01:05:55', '1'), + ('392', '514', '2006-02-16T02:30:53', '2005-08-21T04:51:51', '2005-08-29T00:37:51', '1'), + ('479', '290', '2006-02-16T02:30:53', '2005-07-30T21:38:12', '2005-08-06T00:03:12', '1'), + ('457', '3380', '2006-02-16T02:30:53', '2005-07-10T00:28:17', '2005-07-15T19:09:17', '1'), + ('91', '3743', '2006-02-16T02:30:53', '2005-07-07T13:48:33', '2005-07-10T09:54:33', '1'), + ('405', '3844', '2006-02-16T02:30:53', '2005-06-15T10:23:08', '2005-06-21T15:06:08', '1'), + ('91', '612', '2006-02-16T02:30:53', '2005-07-07T17:52:38', '2005-07-11T23:37:38', '1'), + ('51', '3824', '2006-02-16T02:30:53', '2005-08-21T04:49:41', '2005-08-29T23:52:41', '1'), + ('269', '730', '2006-02-16T02:30:53', '2005-05-29T09:41:40', '2005-05-30T13:31:40', '1'), + ('444', '1869', '2006-02-16T02:30:53', '2005-07-06T00:02:08', '2005-07-10T00:19:08', '1'), + ('512', '2278', '2006-02-16T02:30:53', '2005-08-20T11:47:21', '2005-08-22T17:09:21', '1'), + ('213', '699', '2006-02-16T02:30:53', '2005-06-15T21:41:38', '2005-06-22T17:00:38', '1'), + ('504', '3693', '2006-02-16T02:30:53', '2005-07-28T10:23:48', '2005-08-02T12:09:48', '1'), + ('7', '1393', '2006-02-16T02:30:53', '2005-07-11T17:30:58', '2005-07-15T15:50:58', '1'), + ('279', '2578', '2006-02-16T02:30:53', '2005-07-09T00:22:02', '2005-07-18T04:37:02', '1'), + ('277', '4401', '2006-02-16T02:30:53', '2005-06-21T10:57:27', '2005-06-28T10:53:27', '1'), + ('382', '1137', '2006-02-16T02:30:53', '2005-08-21T09:08:14', '2005-08-30T05:27:14', '1'), + ('589', '215', '2006-02-16T02:30:53', '2005-07-28T13:06:16', '2005-08-05T08:38:16', '1'), + ('226', '1198', '2006-02-16T02:30:53', '2005-08-21T21:22:56', '2005-08-25T01:53:56', '1'), + ('345', '1741', '2006-02-16T02:30:53', '2005-07-07T22:09:45', '2005-07-10T01:43:45', '1'), + ('425', '2427', '2006-02-16T02:30:53', '2005-07-31T06:47:10', '2005-08-04T09:07:10', '1'), + ('491', '1582', '2006-02-16T02:30:53', '2005-07-31T23:43:04', '2005-08-03T00:43:04', '1'), + ('368', '2322', '2006-02-16T02:30:53', '2005-07-08T06:11:02', '2005-07-11T05:14:02', '1'), + ('449', '2424', '2006-02-16T02:30:53', '2005-05-30T01:23:07', '2005-06-07T01:50:07', '1'), + ('146', '668', '2006-02-16T02:30:53', '2005-07-09T01:16:13', '2005-07-14T21:55:13', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['1012', '11752', '351', '14891', '3300', '11353', '3745', '3922', '14745', '13602', '10995', '14389', '4914', '6025', '11804', '4404', '6619', '6917', '13157', '3890', '10716', '10358', '13830', '4186', '11314', '9077', '5396', '9228', '458', '8818', '13017', '11223', '8001', '6550', '14220', '4103', '10952', '6860', '8232', '2851', '11419', '13522', '14214', '5765', '3124', '7266', '9104', '1776', '13375', '4604', '15854', '3720', '2093', '2', '11366', '2532', '10141', '4991', '15920', '7053', '12420', '10541', '2826', '8705', '10144', '12968', '7447', '4757', '13255', '10760', '10642', '10196', '4361', '8530', '3613', '15493', '1567', '6069', '10054', '9887', '11228', '15415', '10691', '13855', '9554', '4219', '5168', '7205', '4372', '9610', '15603', '500', '10777', '1220', '15123', '14625', '1356', '12091', '6147', '12725']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('291', '688', '2006-02-16T02:30:53', '2005-05-31T02:18:05', '2005-06-03T06:47:05', '1'), + ('481', '1833', '2006-02-16T02:30:53', '2005-08-17T09:10:55', '2005-08-18T06:22:55', '1'), + ('118', '3371', '2006-02-16T02:30:53', '2005-05-27T05:39:03', '2005-06-01T11:10:03', '1'), + ('482', '288', '2006-02-16T02:30:53', '2005-08-22T04:11:02', '2005-08-27T03:22:02', '1'), + ('565', '2505', '2006-02-16T02:30:53', '2005-06-21T07:25:01', '2005-06-25T01:47:01', '1'), + ('444', '1729', '2006-02-16T02:30:53', '2005-08-02T17:34:45', '2005-08-09T16:01:45', '1'), + ('171', '1518', '2006-02-16T02:30:53', '2005-07-06T12:10:32', '2005-07-12T15:20:32', '1'), + ('470', '2878', '2006-02-16T02:30:53', '2005-07-06T20:32:27', '2005-07-14T19:00:27', '1'), + ('277', '4399', '2006-02-16T02:30:53', '2005-08-21T22:53:01', '2005-08-23T23:22:01', '1'), + ('348', '2805', '2006-02-16T02:30:53', '2005-08-20T06:02:02', '2005-08-27T04:51:02', '1'), + ('340', '2891', '2006-02-16T02:30:53', '2005-08-02T04:48:00', '2005-08-07T05:00:00', '1'), + ('145', '2718', '2006-02-16T02:30:53', '2005-08-21T10:15:20', '2005-08-27T05:39:20', '1'), + ('535', '298', '2006-02-16T02:30:53', '2005-07-08T21:30:53', '2005-07-17T01:29:53', '1'), + ('113', '3306', '2006-02-16T02:30:53', '2005-07-11T02:18:13', '2005-07-11T23:30:13', '1'), + ('556', '1040', '2006-02-16T02:30:53', '2005-08-17T11:42:45', '2005-08-25T07:11:45', '1'), + ('25', '944', '2006-02-16T02:30:53', '2005-07-07T21:31:53', '2005-07-13T19:00:53', '1'), + ('305', '4062', '2006-02-16T02:30:53', '2005-07-12T08:50:48', '2005-07-14T11:54:48', '1'), + ('23', '3048', '2006-02-16T02:30:53', '2005-07-12T22:30:15', '2005-07-20T03:20:15', '1'), + ('592', '4391', '2006-02-16T02:30:53', '2005-08-19T13:12:28', '2005-08-20T10:41:28', '1'), + ('553', '2570', '2006-02-16T02:30:53', '2005-07-06T18:58:15', '2005-07-10T18:51:15', '1'), + ('515', '3405', '2006-02-16T02:30:53', '2005-08-01T18:53:48', '2005-08-04T13:49:48', '1'), + ('517', '3039', '2006-02-16T02:30:53', '2005-08-01T05:50:07', '2005-08-03T08:18:07', '1'), + ('61', '2874', '2006-02-16T02:30:53', '2005-08-20T13:57:59', '2005-08-25T11:29:59', '1'), + ('185', '3910', '2006-02-16T02:30:53', '2005-07-07T10:32:25', '2005-07-15T06:22:25', '1'), + ('26', '2790', '2006-02-16T02:30:53', '2005-08-02T16:04:08', '2005-08-04T18:47:08', '1'), + ('471', '4324', '2006-02-16T02:30:53', '2005-07-30T08:00:19', '2005-08-08T11:21:19', '1'), + ('559', '3795', '2006-02-16T02:30:53', '2005-07-09T19:42:52', '2005-07-15T21:45:52', '1'), + ('91', '2325', '2006-02-16T02:30:53', '2005-07-30T13:36:57', '2005-08-05T10:43:57', '1'), + ('565', '3350', '2006-02-16T02:30:53', '2005-05-27T19:58:36', '2005-06-06T00:51:36', '1'), + ('98', '3090', '2006-02-16T02:30:53', '2005-07-29T22:14:04', '2005-08-07T17:26:04', '1'), + ('104', '2160', '2006-02-16T02:30:53', '2005-08-19T08:02:24', '2005-08-26T07:32:24', '1'), + ('597', '1994', '2006-02-16T02:30:53', '2005-08-02T12:34:27', '2005-08-07T14:21:27', '1'), + ('10', '2570', '2006-02-16T02:30:53', '2005-07-28T15:10:55', '2005-08-05T18:23:55', '1'), + ('112', '2184', '2006-02-16T02:30:53', '2005-07-12T05:03:14', '2005-07-19T04:06:14', '1'), + ('162', '2618', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('91', '3632', '2006-02-16T02:30:53', '2005-07-07T06:25:28', '2005-07-12T11:18:28', '1'), + ('111', '3218', '2006-02-16T02:30:53', '2005-08-02T03:28:21', '2005-08-09T01:41:21', '1'), + ('91', '2907', '2006-02-16T02:30:53', '2005-07-12T19:54:17', '2005-07-18T13:59:17', '1'), + ('526', '3255', '2006-02-16T02:30:53', '2005-07-29T00:14:37', '2005-08-06T00:57:37', '1'), + ('361', '2168', '2006-02-16T02:30:53', '2005-06-19T23:07:03', '2005-06-22T17:26:03', '1'), + ('444', '514', '2006-02-16T02:30:53', '2005-08-02T19:46:38', '2005-08-11T14:49:38', '1'), + ('343', '2940', '2006-02-16T02:30:53', '2005-08-20T02:44:06', '2005-08-28T05:30:06', '1'), + ('198', '4510', '2006-02-16T02:30:53', '2005-08-21T04:30:49', '2005-08-26T04:42:49', '1'), + ('293', '2619', '2006-02-16T02:30:53', '2005-07-10T13:03:02', '2005-07-16T09:31:02', '1'), + ('113', '3342', '2006-02-16T02:30:53', '2005-06-20T18:28:19', '2005-06-28T21:08:19', '1'), + ('24', '3379', '2006-02-16T02:30:53', '2005-07-27T11:22:17', '2005-08-04T05:45:17', '1'), + ('322', '3372', '2006-02-16T02:30:53', '2005-07-30T08:49:55', '2005-08-06T12:23:55', '1'), + ('472', '1404', '2006-02-16T02:30:53', '2005-06-16T18:46:58', '2005-06-24T16:01:58', '1'), + ('120', '949', '2006-02-16T02:30:53', '2005-08-19T21:31:31', '2005-08-29T00:17:31', '1'), + ('402', '4230', '2006-02-16T02:30:53', '2005-07-08T06:58:43', '2005-07-14T06:41:43', '1'), + ('464', '1648', '2006-02-16T02:30:53', '2005-08-23T15:58:05', '2005-08-26T19:23:05', '1'), + ('96', '2958', '2006-02-16T02:30:53', '2005-07-06T11:06:57', '2005-07-09T14:16:57', '1'), + ('26', '814', '2006-02-16T02:30:53', '2005-06-17T18:14:08', '2005-06-26T18:10:08', '1'), + ('459', '1525', '2006-02-16T02:30:53', '2005-05-24T22:54:33', '2005-05-28T19:40:33', '1'), + ('280', '3583', '2006-02-16T02:30:53', '2005-08-02T18:01:25', '2005-08-11T15:02:25', '1'), + ('26', '1870', '2006-02-16T02:30:53', '2005-06-19T01:27:46', '2005-06-20T02:15:46', '1'), + ('8', '8', '2006-02-16T02:30:53', '2005-07-31T22:08:29', '2005-08-06T16:59:29', '1'), + ('540', '1856', '2006-02-16T02:30:53', '2005-07-09T00:49:03', '2005-07-13T05:02:03', '1'), + ('212', '243', '2006-02-16T02:30:53', '2005-08-23T18:05:10', '2005-08-26T18:09:10', '1'), + ('408', '149', '2006-02-16T02:30:53', '2005-07-27T03:38:54', '2005-07-31T01:13:54', '1'), + ('477', '452', '2006-02-16T02:30:53', '2005-08-18T10:01:50', '2005-08-22T08:14:50', '1'), + ('234', '1413', '2006-02-16T02:30:53', '2005-08-01T12:24:54', '2005-08-03T16:18:54', '1'), + ('125', '2980', '2006-02-16T02:30:53', '2005-06-19T20:41:35', '2005-06-25T17:23:35', '1'), + ('2', '4038', '2006-02-16T02:30:53', '2005-07-29T17:14:29', '2005-08-02T16:01:29', '1'), + ('49', '3011', '2006-02-16T02:30:53', '2005-07-31T22:13:52', '2005-08-05T19:27:52', '1'), + ('166', '3108', '2006-02-16T02:30:53', '2005-08-19T06:38:18', '2005-08-20T08:29:18', '1'), + ('107', '1795', '2006-02-16T02:30:53', '2005-07-27T18:02:08', '2005-07-29T21:15:08', '1'), + ('504', '1278', '2006-02-16T02:30:53', '2005-07-08T14:36:51', '2005-07-12T15:28:51', '1'), + ('150', '1101', '2006-02-16T02:30:53', '2005-08-19T16:54:12', '2005-08-28T17:00:12', '1'), + ('497', '1311', '2006-02-16T02:30:53', '2005-08-01T20:25:20', '2005-08-09T16:57:20', '1'), + ('294', '2573', '2006-02-16T02:30:53', '2005-08-01T15:45:11', '2005-08-02T20:13:11', '1'), + ('199', '3070', '2006-02-16T02:30:53', '2005-08-01T00:34:51', '2005-08-05T03:43:51', '1'), + ('425', '116', '2006-02-16T02:30:53', '2005-07-07T19:33:23', '2005-07-12T22:36:23', '1'), + ('233', '4528', '2006-02-16T02:30:53', '2005-07-29T10:26:14', '2005-07-31T10:24:14', '1'), + ('331', '3776', '2006-02-16T02:30:53', '2005-07-06T05:45:53', '2005-07-07T10:02:53', '1'), + ('308', '3521', '2006-02-16T02:30:53', '2005-08-23T02:20:53', '2005-08-25T23:02:53', '1'), + ('320', '3098', '2006-02-16T02:30:53', '2005-06-16T03:13:30', '2005-06-21T23:56:30', '1'), + ('553', '256', '2006-02-16T02:30:53', '2005-07-11T04:44:59', '2005-07-13T01:00:59', '1'), + ('598', '2303', '2006-02-16T02:30:53', '2005-07-31T19:15:52', '2005-08-04T19:54:52', '1'), + ('549', '436', '2006-02-16T02:30:53', '2005-07-31T14:00:32', '2005-08-05T19:16:32', '1'), + ('144', '2561', '2006-02-16T02:30:53', '2005-08-02T12:55:23', '2005-08-08T12:31:23', '1'), + ('204', '4176', '2006-02-16T02:30:53', '2005-08-22T23:48:56', '2005-09-01T02:05:56', '1'), + ('276', '4281', '2006-02-16T02:30:53', '2005-08-01T18:09:53', '2005-08-03T16:32:53', '1'), + ('96', '1617', '2006-02-16T02:30:53', '2005-08-20T14:48:55', '2005-08-28T14:45:55', '1'), + ('490', '2581', '2006-02-16T02:30:53', '2005-07-31T02:06:49', '2005-08-01T22:27:49', '1'), + ('16', '2800', '2006-02-16T02:30:53', '2005-07-07T12:11:22', '2005-07-11T11:05:22', '1'), + ('420', '4096', '2006-02-16T02:30:53', '2005-07-09T09:20:01', '2005-07-11T14:42:01', '1'), + ('36', '2828', '2006-02-16T02:30:53', '2005-07-27T09:06:13', '2005-08-05T07:11:13', '1'), + ('252', '2207', '2006-02-16T02:30:53', '2005-07-07T20:09:01', '2005-07-09T18:24:01', '1'), + ('16', '3110', '2006-02-16T02:30:53', '2005-07-31T03:54:05', '2005-08-06T23:11:05', '1'), + ('6', '2565', '2006-02-16T02:30:53', '2005-08-23T06:41:32', '2005-08-28T08:51:32', '1'), + ('145', '4500', '2006-02-16T02:30:53', '2005-05-28T01:05:25', '2005-05-31T20:04:25', '1'), + ('493', '3487', '2006-02-16T02:30:53', '2005-08-01T21:03:50', '2005-08-06T19:29:50', '1'), + ('290', '1621', '2006-02-16T02:30:53', '2005-06-15T03:26:15', '2005-06-23T08:17:15', '1'), + ('445', '1455', '2006-02-16T02:30:53', '2005-08-22T12:48:44', '2005-08-27T11:07:44', '1'), + ('507', '2661', '2006-02-16T02:30:53', '2005-08-21T18:34:21', '2005-08-29T21:41:21', '1'), + ('212', '1318', '2006-02-16T02:30:53', '2005-06-15T13:17:01', '2005-06-19T16:22:01', '1'), + ('555', '2161', '2006-02-16T02:30:53', '2005-08-17T22:22:50', '2005-08-27T03:55:50', '1'), + ('35', '910', '2006-02-16T02:30:53', '2005-07-11T09:13:08', '2005-07-17T03:48:08', '1'), + ('51', '4071', '2006-02-16T02:30:53', '2005-08-18T21:43:09', '2005-08-23T18:50:09', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['11864', '7207', '11193', '1809', '11129', '1771', '15232', '5947', '943', '1164', '14317', '9391', '11865', '505', '2443', '6237', '12517', '13600', '2445', '3305', '9252', '2174', '13676', '12908', '8693', '14744', '1507', '9767', '522', '14834', '1151', '10839', '13580', '14543', '5104', '5268', '8444', '6953', '7057', '12769', '4216', '900', '10463', '804', '13008', '14689', '11715', '5329', '3391', '5021', '2554', '2179', '10211', '14422', '9013', '13694', '8112', '9485', '2726', '12626', '7239', '6402', '6594', '3756', '15243', '12849', '10894', '9933', '2963', '6697', '774', '8826', '13217', '11029', '4966', '12399', '14290', '12939', '7704', '4566', '518', '11452', '8187', '5215', '3511', '5905', '6637', '14456', '3107', '8761', '4452', '9916', '15012', '3009', '9629', '14491', '4454', '10426', '6494', '10914']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('96', '2985', '2006-02-16T02:30:53', '2005-08-17T14:02:01', '2005-08-21T19:54:01', '1'), + ('51', '336', '2006-02-16T02:30:53', '2005-07-27T09:13:26', '2005-08-01T10:24:26', '1'), + ('292', '2246', '2006-02-16T02:30:53', '2005-08-02T11:31:33', '2005-08-04T14:00:33', '1'), + ('517', '1071', '2006-02-16T02:30:53', '2005-06-16T21:00:20', '2005-06-25T20:25:20', '1'), + ('566', '23', '2006-02-16T02:30:53', '2005-08-02T09:08:44', '2005-08-04T04:00:44', '1'), + ('416', '1769', '2006-02-16T02:30:53', '2005-06-16T18:12:17', '2005-06-18T16:11:17', '1'), + ('5', '61', '2006-02-16T02:30:53', '2005-08-22T17:37:02', '2005-08-25T18:45:02', '1'), + ('331', '327', '2006-02-16T02:30:53', '2005-07-10T23:07:42', '2005-07-18T23:13:42', '1'), + ('57', '3737', '2006-02-16T02:30:53', '2005-05-30T15:20:19', '2005-06-06T18:53:19', '1'), + ('49', '3691', '2006-02-16T02:30:53', '2005-06-14T23:16:26', '2005-06-16T21:00:26', '1'), + ('471', '2090', '2006-02-16T02:30:53', '2005-08-21T08:00:40', '2005-08-27T06:52:40', '1'), + ('273', '665', '2006-02-16T02:30:53', '2005-07-30T19:48:41', '2005-08-04T15:27:41', '1'), + ('345', '2577', '2006-02-16T02:30:53', '2005-08-17T14:03:46', '2005-08-19T08:39:46', '1'), + ('111', '71', '2006-02-16T02:30:53', '2005-05-28T02:06:37', '2005-05-29T06:57:37', '1'), + ('233', '1622', '2006-02-16T02:30:53', '2005-06-18T18:52:30', '2005-06-24T21:27:30', '1'), + ('166', '2215', '2006-02-16T02:30:53', '2005-07-11T14:19:12', '2005-07-15T15:05:12', '1'), + ('520', '2908', '2006-02-16T02:30:53', '2005-08-18T13:40:20', '2005-08-27T14:04:20', '1'), + ('528', '431', '2006-02-16T02:30:53', '2005-08-20T06:00:25', '2005-08-28T02:39:25', '1'), + ('98', '2887', '2006-02-16T02:30:53', '2005-06-18T19:02:11', '2005-06-23T22:25:11', '1'), + ('578', '2811', '2006-02-16T02:30:53', '2005-06-21T07:46:57', '2005-06-27T06:16:57', '1'), + ('322', '2350', '2006-02-16T02:30:53', '2005-07-30T14:19:59', '2005-08-07T15:17:59', '1'), + ('520', '3279', '2006-02-16T02:30:53', '2005-06-18T00:09:01', '2005-06-25T23:14:01', '1'), + ('103', '3170', '2006-02-16T02:30:53', '2005-08-20T08:33:21', '2005-08-25T02:51:21', '1'), + ('340', '175', '2006-02-16T02:30:53', '2005-08-19T04:19:05', '2005-08-25T09:50:05', '1'), + ('51', '917', '2006-02-16T02:30:53', '2005-07-29T16:44:13', '2005-08-01T15:56:13', '1'), + ('213', '800', '2006-02-16T02:30:53', '2005-08-21T22:45:21', '2005-08-29T23:57:21', '1'), + ('172', '2514', '2006-02-16T02:30:53', '2005-06-15T22:25:26', '2005-06-19T17:00:26', '1'), + ('89', '3432', '2006-02-16T02:30:53', '2005-07-31T09:46:49', '2005-08-03T11:20:49', '1'), + ('382', '3195', '2006-02-16T02:30:53', '2005-05-28T03:33:20', '2005-05-31T04:23:20', '1'), + ('262', '3105', '2006-02-16T02:30:53', '2005-08-22T01:45:58', '2005-08-28T20:52:58', '1'), + ('581', '1281', '2006-02-16T02:30:53', '2005-05-31T21:29:00', '2005-06-03T23:24:00', '1'), + ('482', '2867', '2006-02-16T02:30:53', '2005-08-01T23:37:39', '2005-08-02T20:18:39', '1'), + ('526', '4419', '2006-02-16T02:30:53', '2005-08-20T05:23:34', '2005-08-23T02:45:34', '1'), + ('579', '709', '2006-02-16T02:30:53', '2005-08-21T15:39:01', '2005-08-28T09:47:01', '1'), + ('14', '2109', '2006-02-16T02:30:53', '2005-07-09T06:37:07', '2005-07-14T12:32:07', '1'), + ('119', '1083', '2006-02-16T02:30:53', '2005-07-09T14:22:43', '2005-07-12T08:27:43', '1'), + ('213', '3329', '2006-02-16T02:30:53', '2005-07-29T07:36:13', '2005-08-05T04:55:13', '1'), + ('306', '2910', '2006-02-16T02:30:53', '2005-07-26T23:52:47', '2005-07-30T23:07:47', '1'), + ('320', '1196', '2006-02-16T02:30:53', '2005-07-27T03:50:03', '2005-08-04T04:36:03', '1'), + ('504', '926', '2006-02-16T02:30:53', '2005-08-18T23:26:40', '2005-08-25T03:03:40', '1'), + ('467', '1216', '2006-02-16T02:30:53', '2005-07-07T12:01:34', '2005-07-08T09:59:34', '1'), + ('586', '3543', '2006-02-16T02:30:53', '2005-05-30T09:38:41', '2005-06-07T11:54:41', '1'), + ('291', '1301', '2006-02-16T02:30:53', '2005-08-01T09:39:43', '2005-08-10T03:42:43', '1'), + ('171', '3909', '2006-02-16T02:30:53', '2005-05-29T18:10:24', '2005-06-06T22:53:24', '1'), + ('181', '1838', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('463', '1124', '2006-02-16T02:30:53', '2005-08-21T20:33:00', '2005-08-22T18:10:00', '1'), + ('452', '1615', '2006-02-16T02:30:53', '2005-08-17T07:40:55', '2005-08-25T11:19:55', '1'), + ('402', '1628', '2006-02-16T02:30:53', '2005-07-09T16:49:46', '2005-07-16T19:05:46', '1'), + ('45', '26', '2006-02-16T02:30:53', '2005-06-21T15:11:02', '2005-06-25T14:12:02', '1'), + ('73', '3445', '2006-02-16T02:30:53', '2005-07-09T02:09:41', '2005-07-13T05:47:41', '1'), + ('322', '3916', '2006-02-16T02:30:53', '2005-06-19T03:05:38', '2005-06-25T23:03:38', '1'), + ('338', '4334', '2006-02-16T02:30:53', '2005-06-18T00:41:36', '2005-06-19T02:17:36', '1'), + ('530', '810', '2006-02-16T02:30:53', '2005-08-01T01:01:16', '2005-08-10T01:31:16', '1'), + ('361', '1382', '2006-02-16T02:30:53', '2005-08-21T11:21:46', '2005-08-25T13:15:46', '1'), + ('347', '2367', '2006-02-16T02:30:53', '2005-07-30T05:19:20', '2005-08-04T01:35:20', '1'), + ('454', '3654', '2006-02-16T02:30:53', '2005-08-20T09:13:23', '2005-08-28T06:10:23', '1'), + ('528', '2444', '2006-02-16T02:30:53', '2005-07-28T19:11:07', '2005-08-03T18:41:07', '1'), + ('338', '3722', '2006-02-16T02:30:53', '2005-07-30T23:32:40', '2005-08-08T17:44:40', '1'), + ('420', '2970', '2006-02-16T02:30:53', '2005-06-19T15:02:20', '2005-06-21T15:38:20', '1'), + ('361', '4230', '2006-02-16T02:30:53', '2005-08-18T17:36:45', '2005-08-26T17:12:45', '1'), + ('278', '1786', '2006-02-16T02:30:53', '2005-07-27T10:20:27', '2005-07-29T10:15:27', '1'), + ('66', '2576', '2006-02-16T02:30:53', '2005-07-11T22:46:10', '2005-07-16T04:02:10', '1'), + ('517', '4458', '2006-02-16T02:30:53', '2005-07-12T07:25:43', '2005-07-13T07:59:43', '1'), + ('320', '30', '2006-02-16T02:30:53', '2005-07-06T12:40:38', '2005-07-11T09:29:38', '1'), + ('308', '4408', '2006-02-16T02:30:53', '2005-08-22T17:48:28', '2005-08-31T13:22:28', '1'), + ('280', '3489', '2006-02-16T02:30:53', '2005-08-19T02:05:37', '2005-08-23T07:00:37', '1'), + ('51', '598', '2006-02-16T02:30:53', '2005-08-02T01:12:35', '2005-08-09T22:55:35', '1'), + ('111', '2349', '2006-02-16T02:30:53', '2005-07-31T15:24:46', '2005-08-01T10:00:46', '1'), + ('24', '1444', '2006-02-16T02:30:53', '2005-06-20T07:33:09', '2005-06-28T09:23:09', '1'), + ('103', '210', '2006-02-16T02:30:53', '2005-07-12T12:44:57', '2005-07-19T13:02:57', '1'), + ('575', '1188', '2006-02-16T02:30:53', '2005-05-29T13:19:43', '2005-06-01T18:51:43', '1'), + ('369', '1800', '2006-02-16T02:30:53', '2005-07-29T22:30:16', '2005-07-30T19:43:16', '1'), + ('565', '616', '2006-02-16T02:30:53', '2005-08-19T15:38:39', '2005-08-21T14:33:39', '1'), + ('45', '1023', '2006-02-16T02:30:53', '2005-08-02T05:51:10', '2005-08-05T04:15:10', '1'), + ('118', '4360', '2006-02-16T02:30:53', '2005-07-08T23:47:25', '2005-07-14T03:35:25', '1'), + ('347', '3950', '2006-02-16T02:30:53', '2005-08-18T09:13:42', '2005-08-27T11:44:42', '1'), + ('366', '790', '2006-02-16T02:30:53', '2005-08-21T07:02:59', '2005-08-28T02:57:59', '1'), + ('181', '3375', '2006-02-16T02:30:53', '2005-08-19T05:38:25', '2005-08-23T23:52:25', '1'), + ('265', '2342', '2006-02-16T02:30:53', '2005-07-28T04:02:13', '2005-08-04T00:51:13', '1'), + ('133', '4302', '2006-02-16T02:30:53', '2005-07-08T05:18:50', '2005-07-15T01:53:50', '1'), + ('480', '4087', '2006-02-16T02:30:53', '2005-05-28T03:18:02', '2005-05-30T05:32:02', '1'), + ('35', '1245', '2006-02-16T02:30:53', '2005-08-02T20:59:52', '2005-08-12T01:16:52', '1'), + ('87', '945', '2006-02-16T02:30:53', '2005-07-28T22:33:53', '2005-08-03T03:54:53', '1'), + ('528', '3888', '2006-02-16T02:30:53', '2005-07-09T11:47:58', '2005-07-18T09:58:58', '1'), + ('494', '2128', '2006-02-16T02:30:53', '2005-07-06T00:42:01', '2005-07-09T23:08:01', '1'), + ('10', '3891', '2006-02-16T02:30:53', '2005-07-10T20:41:09', '2005-07-19T14:49:09', '1'), + ('164', '2852', '2006-02-16T02:30:53', '2005-07-12T09:57:39', '2005-07-19T08:40:39', '1'), + ('125', '2520', '2006-02-16T02:30:53', '2005-08-21T12:38:09', '2005-08-26T08:29:09', '1'), + ('303', '4527', '2006-02-16T02:30:53', '2005-06-20T17:26:05', '2005-06-25T12:36:05', '1'), + ('539', '1317', '2006-02-16T02:30:53', '2005-07-29T19:26:47', '2005-08-08T00:09:47', '1'), + ('460', '2414', '2006-02-16T02:30:53', '2005-07-07T23:31:54', '2005-07-14T04:05:54', '1'), + ('432', '949', '2006-02-16T02:30:53', '2005-07-31T14:54:52', '2005-08-07T13:18:52', '1'), + ('454', '1584', '2006-02-16T02:30:53', '2005-08-22T08:42:32', '2005-08-28T05:04:32', '1'), + ('280', '2721', '2006-02-16T02:30:53', '2005-06-20T10:24:44', '2005-06-23T13:39:44', '1'), + ('8', '2773', '2006-02-16T02:30:53', '2005-07-31T04:54:43', '2005-08-02T08:36:43', '1'), + ('226', '2072', '2006-02-16T02:30:53', '2005-08-21T13:55:39', '2005-08-29T17:51:39', '1'), + ('9', '1395', '2006-02-16T02:30:53', '2005-07-07T23:37:00', '2005-07-11T02:30:00', '1'), + ('305', '1325', '2006-02-16T02:30:53', '2005-08-01T08:26:08', '2005-08-09T04:09:08', '1'), + ('57', '1124', '2006-02-16T02:30:53', '2005-07-12T02:42:51', '2005-07-20T06:57:51', '1'), + ('584', '585', '2006-02-16T02:30:53', '2005-08-02T02:04:43', '2005-08-06T03:00:43', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['3705', '1704', '5004', '7061', '15764', '8972', '2355', '2852', '5480', '1440', '2187', '12538', '5660', '3542', '6284', '11153', '14024', '10936', '3555', '5523', '6393', '8565', '3113', '5751', '1621', '2772', '9033', '12695', '11845', '9803', '1033', '15294', '8161', '4784', '9532', '6904', '13972', '10273', '10890', '5534', '1105', '822', '7387', '6717', '14041', '4088', '12064', '4290', '13498', '12357', '10551', '13285', '14365', '11382', '13943', '3907', '7719', '9119', '3913', '1532', '1157', '2228', '878', '11334', '8993', '152', '13363', '4924', '4672', '1814', '3760', '10710', '10749', '7893', '11510', '2973', '687', '14681', '4003', '9083', '12498', '13754', '8003', '10181', '10068', '5967', '5419', '13341', '14093', '1943', '14065', '9915', '7732', '7458', '8509', '13116', '6774', '6352', '11408', '8070']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('223', '65', '2006-02-16T02:30:53', '2005-07-06T10:17:59', '2005-07-10T15:31:59', '1'), + ('488', '4425', '2006-02-16T02:30:53', '2005-06-16T13:45:56', '2005-06-24T18:12:56', '1'), + ('382', '2637', '2006-02-16T02:30:53', '2005-07-09T01:20:50', '2005-07-09T19:56:50', '1'), + ('145', '880', '2006-02-16T02:30:53', '2005-07-27T03:51:10', '2005-07-31T05:36:10', '1'), + ('8', '2937', '2006-02-16T02:30:53', '2005-08-23T13:05:10', '2005-08-25T16:15:10', '1'), + ('89', '1974', '2006-02-16T02:30:53', '2005-07-30T04:06:25', '2005-08-04T22:49:25', '1'), + ('125', '3613', '2006-02-16T02:30:53', '2005-06-18T12:57:06', '2005-06-26T07:32:06', '1'), + ('453', '2695', '2006-02-16T02:30:53', '2005-06-19T23:08:50', '2005-06-26T04:00:50', '1'), + ('452', '847', '2006-02-16T02:30:53', '2005-07-09T23:49:07', '2005-07-12T00:15:07', '1'), + ('26', '2921', '2006-02-16T02:30:53', '2005-06-15T18:53:14', '2005-06-24T15:28:14', '1'), + ('477', '1385', '2006-02-16T02:30:53', '2005-06-18T01:17:27', '2005-06-20T22:18:27', '1'), + ('118', '1373', '2006-02-16T02:30:53', '2005-08-18T14:09:09', '2005-08-23T19:12:09', '1'), + ('171', '1404', '2006-02-16T02:30:53', '2005-07-10T07:46:12', '2005-07-17T07:48:12', '1'), + ('593', '4391', '2006-02-16T02:30:53', '2005-07-06T01:51:42', '2005-07-11T03:29:42', '1'), + ('177', '2938', '2006-02-16T02:30:53', '2005-07-11T16:51:39', '2005-07-15T19:59:39', '1'), + ('220', '1546', '2006-02-16T02:30:53', '2005-08-02T09:54:19', '2005-08-10T14:57:19', '1'), + ('87', '1492', '2006-02-16T02:30:53', '2005-08-20T21:13:58', '2005-08-29T23:02:58', '1'), + ('445', '463', '2006-02-16T02:30:53', '2005-08-02T02:55:04', '2005-08-11T07:56:04', '1'), + ('537', '869', '2006-02-16T02:30:53', '2005-07-06T02:45:35', '2005-07-10T07:17:35', '1'), + ('125', '2233', '2006-02-16T02:30:53', '2005-07-10T01:47:55', '2005-07-18T22:25:55', '1'), + ('164', '3802', '2006-02-16T02:30:53', '2005-07-11T22:28:12', '2005-07-14T18:03:12', '1'), + ('280', '3211', '2006-02-16T02:30:53', '2005-07-29T11:35:23', '2005-08-06T08:28:23', '1'), + ('517', '3620', '2006-02-16T02:30:53', '2005-06-20T17:56:40', '2005-06-23T14:45:40', '1'), + ('479', '387', '2006-02-16T02:30:53', '2005-07-10T12:25:11', '2005-07-11T15:23:11', '1'), + ('177', '3677', '2006-02-16T02:30:53', '2005-06-16T07:24:12', '2005-06-19T02:35:12', '1'), + ('520', '1221', '2006-02-16T02:30:53', '2005-06-19T17:59:27', '2005-06-23T17:52:27', '1'), + ('35', '3416', '2006-02-16T02:30:53', '2005-07-30T06:07:42', '2005-08-05T01:18:42', '1'), + ('483', '446', '2006-02-16T02:30:53', '2005-08-18T20:11:35', '2005-08-25T18:29:35', '1'), + ('65', '14', '2006-02-16T02:30:53', '2005-08-17T13:16:38', '2005-08-18T11:21:38', '1'), + ('520', '3783', '2006-02-16T02:30:53', '2005-07-31T11:06:02', '2005-08-01T06:25:02', '1'), + ('25', '14', '2006-02-16T02:30:53', '2005-05-31T04:50:07', '2005-06-02T01:53:07', '1'), + ('108', '70', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('555', '848', '2006-02-16T02:30:53', '2005-07-28T21:11:00', '2005-08-03T23:32:00', '1'), + ('182', '549', '2006-02-16T02:30:53', '2005-07-08T16:09:56', '2005-07-09T20:35:56', '1'), + ('488', '1309', '2006-02-16T02:30:53', '2005-07-31T01:16:51', '2005-08-01T20:23:51', '1'), + ('465', '2312', '2006-02-16T02:30:53', '2005-07-12T22:02:09', '2005-07-17T16:42:09', '1'), + ('553', '1687', '2006-02-16T02:30:53', '2005-08-20T18:52:17', '2005-08-28T15:19:17', '1'), + ('212', '1458', '2006-02-16T02:30:53', '2005-08-01T03:14:47', '2005-08-07T03:59:47', '1'), + ('210', '78', '2006-02-16T02:30:53', '2005-08-02T00:58:46', '2005-08-10T02:13:46', '1'), + ('156', '3251', '2006-02-16T02:30:53', '2005-07-10T02:26:49', '2005-07-11T07:13:49', '1'), + ('26', '1708', '2006-02-16T02:30:53', '2005-05-31T14:33:56', '2005-06-07T11:30:56', '1'), + ('480', '2634', '2006-02-16T02:30:53', '2005-05-29T21:36:00', '2005-06-07T17:24:00', '1'), + ('233', '3274', '2006-02-16T02:30:53', '2005-07-27T15:54:19', '2005-08-03T14:46:19', '1'), + ('273', '523', '2006-02-16T02:30:53', '2005-07-12T13:35:02', '2005-07-20T15:03:02', '1'), + ('247', '52', '2006-02-16T02:30:53', '2005-08-20T21:45:23', '2005-08-26T01:42:23', '1'), + ('66', '234', '2006-02-16T02:30:53', '2005-07-07T05:31:55', '2005-07-15T07:35:55', '1'), + ('284', '298', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('277', '4174', '2006-02-16T02:30:53', '2005-07-07T15:47:10', '2005-07-15T15:03:10', '1'), + ('578', '1603', '2006-02-16T02:30:53', '2005-08-20T01:51:23', '2005-08-24T05:32:23', '1'), + ('19', '166', '2006-02-16T02:30:53', '2005-08-18T07:40:52', '2005-08-22T02:51:52', '1'), + ('294', '2974', '2006-02-16T02:30:53', '2005-08-01T12:48:55', '2005-08-10T16:11:55', '1'), + ('182', '2139', '2006-02-16T02:30:53', '2005-08-19T18:18:44', '2005-08-20T12:33:44', '1'), + ('457', '618', '2006-02-16T02:30:53', '2005-08-21T09:25:13', '2005-08-27T11:48:13', '1'), + ('407', '3848', '2006-02-16T02:30:53', '2005-08-02T18:20:52', '2005-08-07T17:06:52', '1'), + ('464', '22', '2006-02-16T02:30:53', '2005-08-20T17:31:18', '2005-08-24T11:33:18', '1'), + ('452', '2507', '2006-02-16T02:30:53', '2005-07-06T19:39:14', '2005-07-11T17:45:14', '1'), + ('286', '2481', '2006-02-16T02:30:53', '2005-07-28T04:39:09', '2005-08-05T03:15:09', '1'), + ('305', '275', '2006-02-16T02:30:53', '2005-07-30T09:25:56', '2005-08-03T03:36:56', '1'), + ('494', '752', '2006-02-16T02:30:53', '2005-07-06T20:11:00', '2005-07-08T14:42:00', '1'), + ('290', '3793', '2006-02-16T02:30:53', '2005-06-16T00:41:31', '2005-06-20T21:36:31', '1'), + ('61', '1449', '2006-02-16T02:30:53', '2005-05-31T22:47:45', '2005-06-02T18:01:45', '1'), + ('383', '490', '2006-02-16T02:30:53', '2005-06-18T03:44:50', '2005-06-23T00:28:50', '1'), + ('323', '4265', '2006-02-16T02:30:53', '2005-05-30T05:49:13', '2005-06-07T04:35:13', '1'), + ('560', '1504', '2006-02-16T02:30:53', '2005-08-02T16:53:20', '2005-08-11T20:47:20', '1'), + ('382', '1891', '2006-02-16T02:30:53', '2005-07-30T04:51:25', '2005-08-01T01:04:25', '1'), + ('57', '2622', '2006-02-16T02:30:53', '2005-05-26T00:41:10', '2005-06-03T06:05:10', '1'), + ('288', '588', '2006-02-16T02:30:53', '2005-08-19T21:07:59', '2005-08-21T17:08:59', '1'), + ('180', '4344', '2006-02-16T02:30:53', '2005-07-08T21:55:25', '2005-07-16T16:52:25', '1'), + ('18', '1922', '2006-02-16T02:30:53', '2005-07-08T10:15:38', '2005-07-16T05:06:38', '1'), + ('144', '39', '2006-02-16T02:30:53', '2005-06-16T21:15:22', '2005-06-23T17:00:22', '1'), + ('330', '1306', '2006-02-16T02:30:53', '2005-07-06T12:49:28', '2005-07-09T16:29:28', '1'), + ('177', '3082', '2006-02-16T02:30:53', '2005-08-01T18:44:36', '2005-08-03T13:17:36', '1'), + ('214', '2953', '2006-02-16T02:30:53', '2005-08-01T20:02:01', '2005-08-03T14:20:01', '1'), + ('479', '3058', '2006-02-16T02:30:53', '2005-07-28T10:49:27', '2005-08-02T06:46:27', '1'), + ('400', '2997', '2006-02-16T02:30:53', '2005-08-16T23:30:07', '2005-08-25T17:35:07', '1'), + ('96', '2626', '2006-02-16T02:30:53', '2005-06-20T07:59:27', '2005-06-24T12:31:27', '1'), + ('250', '1731', '2006-02-16T02:30:53', '2005-05-29T00:32:09', '2005-05-31T23:53:09', '1'), + ('212', '1083', '2006-02-16T02:30:53', '2005-08-21T20:25:13', '2005-08-30T19:48:13', '1'), + ('8', '4054', '2006-02-16T02:30:53', '2005-07-07T00:09:02', '2005-07-08T04:27:02', '1'), + ('488', '456', '2006-02-16T02:30:53', '2005-07-30T08:14:27', '2005-08-07T14:02:27', '1'), + ('408', '1063', '2006-02-16T02:30:53', '2005-08-18T13:01:08', '2005-08-21T13:12:08', '1'), + ('108', '1740', '2006-02-16T02:30:53', '2005-08-20T11:18:08', '2005-08-22T11:55:08', '1'), + ('89', '2775', '2006-02-16T02:30:53', '2005-07-28T15:11:27', '2005-08-04T18:35:27', '1'), + ('113', '3111', '2006-02-16T02:30:53', '2005-08-01T00:00:44', '2005-08-04T19:33:44', '1'), + ('58', '4000', '2006-02-16T02:30:53', '2005-07-31T19:39:38', '2005-08-05T22:49:38', '1'), + ('215', '2125', '2006-02-16T02:30:53', '2005-07-11T00:02:19', '2005-07-18T23:08:19', '1'), + ('226', '1516', '2006-02-16T02:30:53', '2005-07-09T20:47:36', '2005-07-12T01:36:36', '1'), + ('460', '1749', '2006-02-16T02:30:53', '2005-08-19T20:18:53', '2005-08-27T14:36:53', '1'), + ('177', '1176', '2006-02-16T02:30:53', '2005-08-21T00:21:29', '2005-08-22T04:01:29', '1'), + ('144', '4327', '2006-02-16T02:30:53', '2005-06-17T07:49:17', '2005-06-20T03:47:17', '1'), + ('190', '3758', '2006-02-16T02:30:53', '2005-08-20T22:40:47', '2005-08-24T01:47:47', '1'), + ('566', '2933', '2006-02-16T02:30:53', '2005-07-31T14:52:26', '2005-08-03T11:53:26', '1'), + ('158', '3597', '2006-02-16T02:30:53', '2005-07-28T05:03:32', '2005-07-29T10:20:32', '1'), + ('327', '2964', '2006-02-16T02:30:53', '2005-07-27T18:36:17', '2005-07-31T22:43:17', '1'), + ('80', '1332', '2006-02-16T02:30:53', '2005-07-29T09:38:19', '2005-08-04T11:45:19', '1'), + ('150', '1544', '2006-02-16T02:30:53', '2005-08-19T11:31:41', '2005-08-27T16:05:41', '1'), + ('171', '868', '2006-02-16T02:30:53', '2005-07-12T15:56:08', '2005-07-13T18:42:08', '1'), + ('235', '1143', '2006-02-16T02:30:53', '2005-07-11T20:34:13', '2005-07-13T19:49:13', '1'), + ('83', '1779', '2006-02-16T02:30:53', '2005-08-02T19:25:13', '2005-08-06T17:12:13', '1'), + ('89', '1606', '2006-02-16T02:30:53', '2005-07-28T17:26:56', '2005-08-01T17:33:56', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['7529', '7429', '11371', '2298', '15890', '2658', '1299', '4700', '6184', '11147', '2908', '4299', '11525', '2194', '15193', '7691', '622', '10435', '7446', '11240', '11309', '15792', '4259', '4903', '14676', '4707', '14976', '3199', '6830', '6728', '12070', '5535', '2932', '16029', '12450', '5479', '15946', '4445', '15616', '9991', '10968', '11090', '13977', '12589', '9142', '9401', '9671', '4331', '12053', '12705', '9165', '15104', '6703', '1580', '13108', '10918', '1754', '9341', '15707', '15487', '14590', '8884', '12918', '3506', '2079', '12885', '12533', '1727', '11546', '6657', '13405', '11702', '2799', '1273', '12949', '9405', '11553', '1436', '1917', '4338', '6416', '11835', '15598', '8601', '5659', '14906', '1387', '12289', '2437', '10045', '10768', '8378', '14017', '8948', '5516', '15875', '6725', '639', '5288', '4536']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('145', '3644', '2006-02-16T02:30:53', '2005-07-27T21:18:08', '2005-08-06T00:59:08', '1'), + ('515', '2160', '2006-02-16T02:30:53', '2005-07-27T17:24:50', '2005-08-05T23:02:50', '1'), + ('561', '324', '2006-02-16T02:30:53', '2005-08-02T18:07:36', '2005-08-06T17:52:36', '1'), + ('497', '1227', '2006-02-16T02:30:53', '2005-06-18T08:18:29', '2005-06-24T11:51:29', '1'), + ('87', '3625', '2006-02-16T02:30:53', '2005-08-23T16:58:12', '2005-08-24T12:23:12', '1'), + ('156', '3281', '2006-02-16T02:30:53', '2005-06-19T10:43:42', '2005-06-24T16:23:42', '1'), + ('91', '1584', '2006-02-16T02:30:53', '2005-06-15T09:34:50', '2005-06-21T12:07:50', '1'), + ('317', '3889', '2006-02-16T02:30:53', '2005-07-08T11:37:21', '2005-07-12T15:41:21', '1'), + ('146', '1131', '2006-02-16T02:30:53', '2005-07-11T11:19:21', '2005-07-19T07:35:21', '1'), + ('597', '1562', '2006-02-16T02:30:53', '2005-08-02T09:45:54', '2005-08-07T07:28:54', '1'), + ('91', '517', '2006-02-16T02:30:53', '2005-06-20T03:16:52', '2005-06-22T08:46:52', '1'), + ('80', '870', '2006-02-16T02:30:53', '2005-07-07T16:33:48', '2005-07-16T11:48:48', '1'), + ('174', '1107', '2006-02-16T02:30:53', '2005-08-17T00:15:31', '2005-08-20T21:14:31', '1'), + ('149', '1827', '2006-02-16T02:30:53', '2005-06-18T01:41:37', '2005-06-25T04:27:37', '1'), + ('40', '1033', '2006-02-16T02:30:53', '2005-08-22T16:06:49', '2005-08-25T17:23:49', '1'), + ('112', '1579', '2006-02-16T02:30:53', '2005-07-28T03:30:09', '2005-07-29T21:31:09', '1'), + ('109', '2363', '2006-02-16T02:30:53', '2005-05-28T15:58:22', '2005-06-04T10:13:22', '1'), + ('392', '1934', '2006-02-16T02:30:53', '2005-08-01T08:50:51', '2005-08-08T12:23:51', '1'), + ('486', '2337', '2006-02-16T02:30:53', '2005-07-27T18:00:24', '2005-07-29T13:40:24', '1'), + ('597', '2170', '2006-02-16T02:30:53', '2005-08-02T13:28:30', '2005-08-05T11:40:30', '1'), + ('275', '607', '2006-02-16T02:30:53', '2005-08-02T15:50:55', '2005-08-09T18:28:55', '1'), + ('581', '2175', '2006-02-16T02:30:53', '2005-08-23T14:05:37', '2005-08-28T10:54:37', '1'), + ('467', '4378', '2006-02-16T02:30:53', '2005-07-07T14:22:18', '2005-07-11T19:38:18', '1'), + ('132', '1769', '2006-02-16T02:30:53', '2005-07-08T20:50:05', '2005-07-13T15:27:05', '1'), + ('49', '877', '2006-02-16T02:30:53', '2005-08-21T20:02:18', '2005-08-26T21:55:18', '1'), + ('286', '52', '2006-02-16T02:30:53', '2005-07-08T11:57:28', '2005-07-10T17:47:28', '1'), + ('581', '77', '2006-02-16T02:30:53', '2005-08-22T07:10:26', '2005-08-28T07:22:26', '1'), + ('234', '3824', '2006-02-16T02:30:53', '2005-06-21T00:12:40', '2005-06-27T23:26:40', '1'), + ('578', '1943', '2006-02-16T02:30:53', '2005-07-12T18:42:55', '2005-07-17T17:58:55', '1'), + ('414', '2113', '2006-02-16T02:30:53', '2005-07-12T13:56:48', '2005-07-15T18:49:48', '1'), + ('158', '1357', '2006-02-16T02:30:53', '2005-08-17T21:46:47', '2005-08-22T22:59:47', '1'), + ('394', '1623', '2006-02-16T02:30:53', '2005-07-10T02:27:42', '2005-07-12T21:13:42', '1'), + ('526', '4418', '2006-02-16T02:30:53', '2005-06-20T04:51:19', '2005-06-29T08:31:19', '1'), + ('143', '953', '2006-02-16T02:30:53', '2005-08-23T21:54:02', '2005-08-29T23:55:02', '1'), + ('518', '3439', '2006-02-16T02:30:53', '2005-08-18T11:04:04', '2005-08-22T07:24:04', '1'), + ('250', '216', '2006-02-16T02:30:53', '2005-07-09T23:47:33', '2005-07-13T01:09:33', '1'), + ('561', '4549', '2006-02-16T02:30:53', '2005-08-23T18:54:07', '2005-08-28T21:21:07', '1'), + ('327', '3328', '2006-02-16T02:30:53', '2005-07-07T23:08:22', '2005-07-16T03:49:22', '1'), + ('70', '2947', '2006-02-16T02:30:53', '2005-08-23T07:06:38', '2005-08-30T04:16:38', '1'), + ('414', '3662', '2006-02-16T02:30:53', '2005-07-31T17:26:27', '2005-08-03T17:36:27', '1'), + ('234', '888', '2006-02-16T02:30:53', '2005-08-02T04:03:13', '2005-08-11T08:36:13', '1'), + ('89', '2743', '2006-02-16T02:30:53', '2005-08-02T07:56:40', '2005-08-10T07:58:40', '1'), + ('115', '1126', '2006-02-16T02:30:53', '2005-08-20T19:02:34', '2005-08-24T14:14:34', '1'), + ('275', '956', '2006-02-16T02:30:53', '2005-08-18T16:06:31', '2005-08-27T17:20:31', '1'), + ('486', '4467', '2006-02-16T02:30:53', '2005-07-30T10:21:03', '2005-08-04T15:14:03', '1'), + ('331', '2057', '2006-02-16T02:30:53', '2005-07-30T20:18:19', '2005-08-07T15:46:19', '1'), + ('133', '920', '2006-02-16T02:30:53', '2005-07-31T06:33:41', '2005-08-02T07:50:41', '1'), + ('535', '419', '2006-02-16T02:30:53', '2005-07-07T18:22:30', '2005-07-13T18:20:30', '1'), + ('280', '4448', '2006-02-16T02:30:53', '2005-08-17T20:57:27', '2005-08-20T19:51:27', '1'), + ('517', '2342', '2006-02-16T02:30:53', '2005-08-18T20:44:14', '2005-08-23T20:46:14', '1'), + ('291', '4034', '2006-02-16T02:30:53', '2005-07-30T11:24:28', '2005-08-03T09:38:28', '1'), + ('359', '4550', '2006-02-16T02:30:53', '2005-08-22T12:01:16', '2005-08-27T17:48:16', '1'), + ('470', '46', '2006-02-16T02:30:53', '2005-07-12T12:50:19', '2005-07-16T13:41:19', '1'), + ('87', '2479', '2006-02-16T02:30:53', '2005-06-16T04:12:25', '2005-06-20T06:53:25', '1'), + ('73', '3630', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('2', '3418', '2006-02-16T02:30:53', '2005-08-02T02:10:56', '2005-08-02T21:23:56', '1'), + ('25', '4106', '2006-02-16T02:30:53', '2005-06-16T17:13:23', '2005-06-22T20:46:23', '1'), + ('557', '894', '2006-02-16T02:30:53', '2005-07-30T18:07:58', '2005-08-01T17:43:58', '1'), + ('91', '3646', '2006-02-16T02:30:53', '2005-08-23T10:35:45', '2005-08-27T10:57:45', '1'), + ('469', '2636', '2006-02-16T02:30:53', '2005-08-23T02:05:51', '2005-08-25T04:45:51', '1'), + ('526', '2633', '2006-02-16T02:30:53', '2005-08-21T17:29:10', '2005-08-28T20:15:10', '1'), + ('80', '3050', '2006-02-16T02:30:53', '2005-07-30T00:26:22', '2005-08-05T03:24:22', '1'), + ('13', '972', '2006-02-16T02:30:53', '2005-08-19T04:31:36', '2005-08-25T05:50:36', '1'), + ('459', '19', '2006-02-16T02:30:53', '2005-07-06T00:22:29', '2005-07-07T22:15:29', '1'), + ('465', '3853', '2006-02-16T02:30:53', '2005-06-17T16:49:45', '2005-06-18T18:10:45', '1'), + ('185', '883', '2006-02-16T02:30:53', '2005-08-19T03:37:25', '2005-08-20T22:10:25', '1'), + ('331', '795', '2006-02-16T02:30:53', '2005-08-18T14:01:40', '2005-08-20T15:32:40', '1'), + ('457', '2951', '2006-02-16T02:30:53', '2005-06-16T15:21:47', '2005-06-17T14:12:47', '1'), + ('24', '2522', '2006-02-16T02:30:53', '2005-08-17T00:57:36', '2005-08-18T23:16:36', '1'), + ('553', '3697', '2006-02-16T02:30:53', '2005-07-12T11:11:36', '2005-07-16T15:56:36', '1'), + ('181', '1554', '2006-02-16T02:30:53', '2005-08-19T22:20:49', '2005-08-28T21:21:49', '1'), + ('526', '3286', '2006-02-16T02:30:53', '2005-08-17T07:18:56', '2005-08-24T06:33:56', '1'), + ('576', '4579', '2006-02-16T02:30:53', '2005-06-19T19:15:21', '2005-06-21T21:35:21', '1'), + ('530', '361', '2006-02-16T02:30:53', '2005-06-15T07:52:35', '2005-06-21T04:55:35', '1'), + ('279', '4209', '2006-02-16T02:30:53', '2005-08-19T05:55:52', '2005-08-23T00:01:52', '1'), + ('463', '1983', '2006-02-16T02:30:53', '2005-07-30T20:22:17', '2005-08-08T16:55:17', '1'), + ('360', '3317', '2006-02-16T02:30:53', '2005-08-17T01:04:31', '2005-08-24T00:44:31', '1'), + ('584', '924', '2006-02-16T02:30:53', '2005-06-15T18:35:40', '2005-06-21T15:04:40', '1'), + ('400', '2667', '2006-02-16T02:30:53', '2005-06-17T05:36:07', '2005-06-24T01:44:07', '1'), + ('581', '3152', '2006-02-16T02:30:53', '2005-07-07T18:39:56', '2005-07-12T21:03:56', '1'), + ('158', '1063', '2006-02-16T02:30:53', '2005-07-11T23:29:14', '2005-07-13T20:20:14', '1'), + ('479', '2796', '2006-02-16T02:30:53', '2005-08-17T13:03:13', '2005-08-19T10:50:13', '1'), + ('66', '2794', '2006-02-16T02:30:53', '2005-08-23T06:23:26', '2005-09-01T05:43:26', '1'), + ('181', '3247', '2006-02-16T02:30:53', '2005-07-29T13:03:31', '2005-08-06T16:32:31', '1'), + ('9', '4265', '2006-02-16T02:30:53', '2005-07-10T07:45:40', '2005-07-15T05:20:40', '1'), + ('366', '153', '2006-02-16T02:30:53', '2005-08-22T04:38:18', '2005-08-29T23:03:18', '1'), + ('278', '515', '2006-02-16T02:30:53', '2005-06-15T15:40:56', '2005-06-17T10:39:56', '1'), + ('575', '443', '2006-02-16T02:30:53', '2005-08-18T05:05:28', '2005-08-26T09:02:28', '1'), + ('454', '1799', '2006-02-16T02:30:53', '2005-06-18T18:30:26', '2005-06-21T18:36:26', '1'), + ('118', '58', '2006-02-16T02:30:53', '2005-07-31T19:04:35', '2005-08-07T16:53:35', '1'), + ('273', '454', '2006-02-16T02:30:53', '2005-08-01T20:39:32', '2005-08-10T19:41:32', '1'), + ('347', '3500', '2006-02-16T02:30:53', '2005-07-29T05:28:35', '2005-08-02T05:55:35', '1'), + ('230', '920', '2006-02-16T02:30:53', '2005-08-20T20:55:32', '2005-08-23T16:12:32', '1'), + ('597', '948', '2006-02-16T02:30:53', '2005-07-30T03:16:18', '2005-08-04T03:16:18', '1'), + ('581', '1902', '2006-02-16T02:30:53', '2005-07-10T01:13:52', '2005-07-15T22:56:52', '1'), + ('41', '3611', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('213', '831', '2006-02-16T02:30:53', '2005-07-12T13:47:17', '2005-07-17T13:31:17', '1'), + ('198', '4204', '2006-02-16T02:30:53', '2005-05-28T18:25:02', '2005-05-29T18:22:02', '1'), + ('120', '850', '2006-02-16T02:30:53', '2005-07-09T15:13:07', '2005-07-16T12:39:07', '1'), + ('26', '220', '2006-02-16T02:30:53', '2005-07-08T03:43:22', '2005-07-15T08:44:22', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['8881', '13421', '13599', '10730', '12629', '14928', '11965', '11875', '9218', '1343', '10953', '7637', '6937', '6061', '9009', '12292', '14393', '15770', '13561', '15892', '2833', '2005', '11340', '8008', '375', '4979', '2016', '1653', '9543', '7251', '12623', '15561', '12521', '13247', '13655', '13152', '9036', '11112', '1271', '5998', '13370', '5832', '15111', '12018', '3764', '15196', '13352', '8185', '9754', '14930', '15817', '14039', '16003', '4989', '6345', '2910', '12186', '2991', '1083', '525', '5391', '9907', '13617', '15258', '8393', '3832', '6464', '14911', '11439', '2364', '11857', '4333', '10525', '5029', '15401', '9502', '853', '9906', '12523', '915', '9943', '13450', '5235', '15876', '14560', '12055', '11764', '7421', '5565', '9098', '7363', '8032', '11372', '1327', '11863', '6418', '10748', '10738', '9043', '5408']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('118', '2012', '2006-02-16T02:30:53', '2005-07-30T00:22:31', '2005-08-04T19:10:31', '1'), + ('366', '9', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('150', '3333', '2006-02-16T02:30:53', '2005-08-20T06:00:03', '2005-08-29T07:56:03', '1'), + ('368', '1793', '2006-02-16T02:30:53', '2005-08-01T19:21:42', '2005-08-10T21:18:42', '1'), + ('459', '1705', '2006-02-16T02:30:53', '2005-08-18T17:40:33', '2005-08-26T21:09:33', '1'), + ('472', '4375', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('490', '194', '2006-02-16T02:30:53', '2005-08-17T17:39:45', '2005-08-19T12:05:45', '1'), + ('294', '1787', '2006-02-16T02:30:53', '2005-08-17T14:16:48', '2005-08-26T14:20:48', '1'), + ('172', '119', '2006-02-16T02:30:53', '2005-07-30T13:14:35', '2005-08-07T18:03:35', '1'), + ('416', '2393', '2006-02-16T02:30:53', '2005-06-15T12:27:19', '2005-06-21T16:57:19', '1'), + ('483', '1510', '2006-02-16T02:30:53', '2005-08-02T03:28:38', '2005-08-11T03:53:38', '1'), + ('91', '87', '2006-02-16T02:30:53', '2005-07-28T01:12:25', '2005-08-02T03:48:25', '1'), + ('592', '1768', '2006-02-16T02:30:53', '2005-07-26T23:15:50', '2005-07-27T19:14:50', '1'), + ('392', '1859', '2006-02-16T02:30:53', '2005-07-11T04:06:25', '2005-07-11T23:11:25', '1'), + ('166', '4136', '2006-02-16T02:30:53', '2005-07-30T05:12:01', '2005-08-07T10:58:01', '1'), + ('58', '1417', '2006-02-16T02:30:53', '2005-08-18T05:08:54', '2005-08-27T02:51:54', '1'), + ('368', '3937', '2006-02-16T02:30:53', '2005-08-21T10:22:51', '2005-08-29T08:28:51', '1'), + ('113', '1424', '2006-02-16T02:30:53', '2005-08-23T13:18:16', '2005-08-29T11:31:16', '1'), + ('530', '3202', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('174', '1365', '2006-02-16T02:30:53', '2005-08-23T17:01:00', '2005-08-28T12:50:00', '1'), + ('232', '1976', '2006-02-16T02:30:53', '2005-06-19T21:34:54', '2005-06-28T16:21:54', '1'), + ('234', '4177', '2006-02-16T02:30:53', '2005-06-17T11:44:54', '2005-06-19T10:53:54', '1'), + ('366', '1403', '2006-02-16T02:30:53', '2005-08-02T17:05:43', '2005-08-09T13:25:43', '1'), + ('41', '2093', '2006-02-16T02:30:53', '2005-07-28T15:25:55', '2005-08-04T13:16:55', '1'), + ('306', '1815', '2006-02-16T02:30:53', '2005-05-27T08:49:21', '2005-06-04T14:11:21', '1'), + ('204', '3447', '2006-02-16T02:30:53', '2005-07-09T00:24:34', '2005-07-12T20:04:34', '1'), + ('282', '4265', '2006-02-16T02:30:53', '2005-06-17T12:18:36', '2005-06-20T12:13:36', '1'), + ('517', '2294', '2006-02-16T02:30:53', '2005-06-16T09:34:45', '2005-06-18T09:13:45', '1'), + ('369', '956', '2006-02-16T02:30:53', '2005-07-31T01:43:34', '2005-08-01T06:49:34', '1'), + ('360', '1737', '2006-02-16T02:30:53', '2005-07-27T10:44:55', '2005-08-01T16:12:55', '1'), + ('177', '3670', '2006-02-16T02:30:53', '2005-08-18T17:34:19', '2005-08-20T21:30:19', '1'), + ('469', '68', '2006-02-16T02:30:53', '2005-08-23T05:02:31', '2005-09-01T02:51:31', '1'), + ('369', '1022', '2006-02-16T02:30:53', '2005-08-18T13:43:07', '2005-08-21T07:53:07', '1'), + ('24', '1271', '2006-02-16T02:30:53', '2005-08-19T16:45:59', '2005-08-25T15:25:59', '1'), + ('207', '4294', '2006-02-16T02:30:53', '2005-08-20T07:59:13', '2005-08-22T12:04:13', '1'), + ('597', '3571', '2006-02-16T02:30:53', '2005-08-19T13:09:32', '2005-08-25T14:47:32', '1'), + ('18', '790', '2006-02-16T02:30:53', '2005-07-30T06:18:38', '2005-07-31T01:22:38', '1'), + ('207', '526', '2006-02-16T02:30:53', '2005-08-02T08:25:14', '2005-08-03T08:41:14', '1'), + ('560', '379', '2006-02-16T02:30:53', '2005-06-15T07:32:24', '2005-06-21T05:12:24', '1'), + ('250', '1458', '2006-02-16T02:30:53', '2005-07-11T01:20:46', '2005-07-15T21:41:46', '1'), + ('101', '239', '2006-02-16T02:30:53', '2005-08-19T21:20:11', '2005-08-25T22:51:11', '1'), + ('63', '2387', '2006-02-16T02:30:53', '2005-07-10T16:34:48', '2005-07-17T17:25:48', '1'), + ('119', '4101', '2006-02-16T02:30:53', '2005-08-22T12:21:43', '2005-08-24T09:31:43', '1'), + ('319', '1921', '2006-02-16T02:30:53', '2005-08-17T19:44:46', '2005-08-26T20:24:46', '1'), + ('470', '3115', '2006-02-16T02:30:53', '2005-07-06T13:01:03', '2005-07-13T15:26:03', '1'), + ('181', '1413', '2006-02-16T02:30:53', '2005-08-22T16:11:32', '2005-08-30T22:06:32', '1'), + ('80', '2689', '2006-02-16T02:30:53', '2005-08-19T20:51:40', '2005-08-24T01:22:40', '1'), + ('568', '2452', '2006-02-16T02:30:53', '2005-07-28T22:23:49', '2005-07-31T00:07:49', '1'), + ('479', '3751', '2006-02-16T02:30:53', '2005-07-31T09:23:43', '2005-08-08T06:04:43', '1'), + ('584', '2875', '2006-02-16T02:30:53', '2005-08-22T05:38:32', '2005-08-30T07:21:32', '1'), + ('348', '598', '2006-02-16T02:30:53', '2005-08-23T14:59:51', '2005-08-25T15:27:51', '1'), + ('383', '4187', '2006-02-16T02:30:53', '2005-08-20T21:39:43', '2005-08-24T19:03:43', '1'), + ('577', '3413', '2006-02-16T02:30:53', '2005-08-23T20:47:28', '2005-08-31T23:22:28', '1'), + ('210', '3326', '2006-02-16T02:30:53', '2005-07-09T00:46:56', '2005-07-17T06:24:56', '1'), + ('532', '4332', '2006-02-16T02:30:53', '2005-07-11T20:05:18', '2005-07-20T17:28:18', '1'), + ('57', '630', '2006-02-16T02:30:53', '2005-06-20T03:31:18', '2005-06-28T00:35:18', '1'), + ('312', '1342', '2006-02-16T02:30:53', '2005-08-18T01:43:36', '2005-08-23T07:13:36', '1'), + ('472', '4308', '2006-02-16T02:30:53', '2005-06-20T09:10:43', '2005-06-23T13:04:43', '1'), + ('556', '2393', '2006-02-16T02:30:53', '2005-05-31T11:04:48', '2005-06-05T13:32:48', '1'), + ('14', '1817', '2006-02-16T02:30:53', '2005-05-28T04:25:33', '2005-06-06T04:18:33', '1'), + ('132', '402', '2006-02-16T02:30:53', '2005-07-09T19:28:34', '2005-07-18T01:07:34', '1'), + ('120', '4282', '2006-02-16T02:30:53', '2005-07-31T14:39:50', '2005-08-09T09:39:50', '1'), + ('526', '4059', '2006-02-16T02:30:53', '2005-08-20T06:35:30', '2005-08-29T09:03:30', '1'), + ('293', '788', '2006-02-16T02:30:53', '2005-08-22T18:22:44', '2005-08-25T16:54:44', '1'), + ('504', '3369', '2006-02-16T02:30:53', '2005-07-29T06:02:11', '2005-08-07T03:23:11', '1'), + ('233', '4499', '2006-02-16T02:30:53', '2005-07-06T16:12:23', '2005-07-12T21:29:23', '1'), + ('303', '3100', '2006-02-16T02:30:53', '2005-07-12T01:16:40', '2005-07-20T00:53:40', '1'), + ('273', '353', '2006-02-16T02:30:53', '2005-08-22T04:51:42', '2005-08-28T05:37:42', '1'), + ('18', '2897', '2006-02-16T02:30:53', '2005-08-02T20:22:45', '2005-08-04T18:30:45', '1'), + ('512', '2856', '2006-02-16T02:30:53', '2005-06-18T13:37:32', '2005-06-23T14:18:32', '1'), + ('146', '101', '2006-02-16T02:30:53', '2005-08-17T13:48:30', '2005-08-18T15:55:30', '1'), + ('113', '76', '2006-02-16T02:30:53', '2005-07-07T18:31:50', '2005-07-08T21:26:50', '1'), + ('36', '3811', '2006-02-16T02:30:53', '2005-08-01T11:53:17', '2005-08-07T07:24:17', '1'), + ('265', '3938', '2006-02-16T02:30:53', '2005-07-09T02:35:32', '2005-07-17T22:46:32', '1'), + ('103', '1721', '2006-02-16T02:30:53', '2005-08-22T23:13:10', '2005-09-01T03:44:10', '1'), + ('471', '2700', '2006-02-16T02:30:53', '2005-07-31T00:02:10', '2005-08-01T19:47:10', '1'), + ('122', '3693', '2006-02-16T02:30:53', '2005-05-30T01:43:31', '2005-06-01T02:05:31', '1'), + ('204', '4241', '2006-02-16T02:30:53', '2005-07-31T14:38:12', '2005-08-01T13:56:12', '1'), + ('230', '888', '2006-02-16T02:30:53', '2005-08-18T13:45:41', '2005-08-27T10:46:41', '1'), + ('115', '1859', '2006-02-16T02:30:53', '2005-05-30T11:20:27', '2005-06-02T11:55:27', '1'), + ('494', '887', '2006-02-16T02:30:53', '2005-07-31T15:37:29', '2005-08-09T18:25:29', '1'), + ('61', '135', '2006-02-16T02:30:53', '2005-08-20T00:18:15', '2005-08-24T19:36:15', '1'), + ('122', '1044', '2006-02-16T02:30:53', '2005-07-09T12:54:25', '2005-07-18T16:28:25', '1'), + ('87', '1735', '2006-02-16T02:30:53', '2005-08-23T16:32:10', '2005-08-24T18:16:10', '1'), + ('579', '1616', '2006-02-16T02:30:53', '2005-08-21T16:13:47', '2005-08-26T15:19:47', '1'), + ('35', '1481', '2006-02-16T02:30:53', '2005-08-17T21:02:19', '2005-08-18T15:24:19', '1'), + ('252', '4502', '2006-02-16T02:30:53', '2005-08-17T09:51:54', '2005-08-20T07:11:54', '1'), + ('70', '3548', '2006-02-16T02:30:53', '2005-07-27T17:10:05', '2005-08-05T17:55:05', '1'), + ('14', '3368', '2006-02-16T02:30:53', '2005-07-10T03:29:48', '2005-07-17T04:43:48', '1'), + ('144', '1267', '2006-02-16T02:30:53', '2005-07-30T08:44:21', '2005-08-08T12:31:21', '1'), + ('407', '1649', '2006-02-16T02:30:53', '2005-07-27T14:58:29', '2005-08-05T09:02:29', '1'), + ('230', '431', '2006-02-16T02:30:53', '2005-07-28T16:17:00', '2005-07-29T13:32:00', '1'), + ('327', '796', '2006-02-16T02:30:53', '2005-08-02T18:10:50', '2005-08-07T17:58:50', '1'), + ('539', '403', '2006-02-16T02:30:53', '2005-06-15T11:11:39', '2005-06-22T10:45:39', '1'), + ('112', '1003', '2006-02-16T02:30:53', '2005-08-17T13:56:01', '2005-08-23T18:38:01', '1'), + ('185', '3101', '2006-02-16T02:30:53', '2005-07-11T23:36:27', '2005-07-16T18:42:27', '1'), + ('181', '3769', '2006-02-16T02:30:53', '2005-08-01T20:01:24', '2005-08-05T19:55:24', '1'), + ('377', '544', '2006-02-16T02:30:53', '2005-08-01T19:39:08', '2005-08-10T20:37:08', '1'), + ('9', '4127', '2006-02-16T02:30:53', '2005-07-30T06:34:07', '2005-08-02T01:16:07', '1'), + ('144', '3162', '2006-02-16T02:30:53', '2005-07-09T20:16:51', '2005-07-18T22:19:51', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['8809', '4684', '13705', '16001', '15306', '9726', '8667', '8043', '14587', '6304', '7587', '2173', '9634', '2663', '8005', '3031', '772', '8709', '10168', '14280', '4768', '11390', '6572', '1371', '12355', '15992', '13539', '10644', '10410', '13089', '9268', '15481', '4438', '4131', '15859', '12946', '2593', '12942', '1542', '13088', '7944', '897', '10282', '7901', '13714', '9330', '12984', '7917', '10005', '4529', '13326', '10622', '3792', '4051', '5200', '250', '2597', '6618', '6132', '4721', '1075', '13137', '2718', '3507', '10549', '7567', '3903', '15452', '6165', '2213', '11050', '6647', '12229', '6065', '361', '3601', '15499', '128', '6674', '3675', '14866', '15145', '7966', '7031', '7286', '13142', '15600', '12023', '6514', '9820', '15080', '6', '7052', '4600', '15640', '6776', '15326', '6759', '9404', '10922']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('8', '3278', '2006-02-16T02:30:53', '2005-07-29T21:42:49', '2005-08-04T01:13:49', '1'), + ('585', '503', '2006-02-16T02:30:53', '2005-07-08T10:41:06', '2005-07-17T10:35:06', '1'), + ('451', '3663', '2006-02-16T02:30:53', '2005-08-20T09:32:23', '2005-08-21T13:51:23', '1'), + ('108', '245', '2006-02-16T02:30:53', '2005-08-23T20:45:53', '2005-08-27T15:52:53', '1'), + ('340', '521', '2006-02-16T02:30:53', '2005-08-22T19:46:36', '2005-08-27T14:09:36', '1'), + ('162', '1701', '2006-02-16T02:30:53', '2005-07-31T08:37:07', '2005-08-09T06:09:07', '1'), + ('25', '3439', '2006-02-16T02:30:53', '2005-07-29T15:40:57', '2005-07-31T20:59:57', '1'), + ('577', '208', '2006-02-16T02:30:53', '2005-07-28T16:45:44', '2005-08-01T12:26:44', '1'), + ('250', '2329', '2006-02-16T02:30:53', '2005-08-21T17:20:55', '2005-08-26T17:17:55', '1'), + ('579', '4183', '2006-02-16T02:30:53', '2005-07-11T18:02:16', '2005-07-14T14:01:16', '1'), + ('113', '655', '2006-02-16T02:30:53', '2005-07-27T23:23:03', '2005-08-01T17:34:03', '1'), + ('65', '995', '2006-02-16T02:30:53', '2005-06-18T00:08:20', '2005-06-25T05:30:20', '1'), + ('444', '924', '2006-02-16T02:30:53', '2005-07-31T05:06:02', '2005-08-04T06:53:02', '1'), + ('583', '1012', '2006-02-16T02:30:53', '2005-06-19T10:54:00', '2005-06-20T16:48:00', '1'), + ('488', '670', '2006-02-16T02:30:53', '2005-07-28T15:15:11', '2005-07-29T14:54:11', '1'), + ('491', '1184', '2006-02-16T02:30:53', '2005-06-20T11:52:49', '2005-06-22T07:00:49', '1'), + ('556', '3319', '2006-02-16T02:30:53', '2005-05-29T13:08:06', '2005-06-06T08:19:06', '1'), + ('199', '902', '2006-02-16T02:30:53', '2005-07-29T17:25:54', '2005-08-02T22:35:54', '1'), + ('570', '4548', '2006-02-16T02:30:53', '2005-07-31T23:25:24', '2005-08-02T19:03:24', '1'), + ('481', '1561', '2006-02-16T02:30:53', '2005-08-21T06:39:58', '2005-08-23T04:50:58', '1'), + ('482', '2787', '2006-02-16T02:30:53', '2005-07-08T15:28:20', '2005-07-09T11:46:20', '1'), + ('294', '3135', '2006-02-16T02:30:53', '2005-08-02T18:39:16', '2005-08-04T21:43:16', '1'), + ('35', '3121', '2006-02-16T02:30:53', '2005-07-12T05:56:38', '2005-07-16T10:41:38', '1'), + ('491', '760', '2006-02-16T02:30:53', '2005-06-15T14:38:15', '2005-06-23T15:36:15', '1'), + ('452', '4112', '2006-02-16T02:30:53', '2005-08-18T07:36:23', '2005-08-20T08:59:23', '1'), + ('589', '3334', '2006-02-16T02:30:53', '2005-08-23T20:28:32', '2005-08-24T21:35:32', '1'), + ('518', '3110', '2006-02-16T02:30:53', '2005-08-20T03:40:27', '2005-08-27T07:15:27', '1'), + ('7', '4374', '2006-02-16T02:30:53', '2005-08-01T15:52:00', '2005-08-08T16:08:00', '1'), + ('247', '3901', '2006-02-16T02:30:53', '2005-08-01T07:53:29', '2005-08-10T08:56:29', '1'), + ('63', '1783', '2006-02-16T02:30:53', '2005-08-19T10:38:56', '2005-08-24T12:41:56', '1'), + ('592', '3593', '2006-02-16T02:30:53', '2005-07-30T15:02:30', '2005-08-05T12:50:30', '1'), + ('414', '3262', '2006-02-16T02:30:53', '2005-08-23T01:59:14', '2005-08-27T04:38:14', '1'), + ('104', '4371', '2006-02-16T02:30:53', '2005-07-07T22:56:17', '2005-07-16T17:28:17', '1'), + ('58', '2621', '2006-02-16T02:30:53', '2005-07-07T07:53:18', '2005-07-08T04:48:18', '1'), + ('465', '4269', '2006-02-16T02:30:53', '2005-08-23T16:08:15', '2005-08-28T11:08:15', '1'), + ('444', '2066', '2006-02-16T02:30:53', '2005-08-19T05:53:34', '2005-08-20T07:30:34', '1'), + ('556', '2031', '2006-02-16T02:30:53', '2005-06-19T05:40:11', '2005-06-28T08:11:11', '1'), + ('103', '3938', '2006-02-16T02:30:53', '2005-08-19T05:40:36', '2005-08-27T02:04:36', '1'), + ('182', '1714', '2006-02-16T02:30:53', '2005-06-16T01:20:05', '2005-06-22T03:59:05', '1'), + ('457', '4281', '2006-02-16T02:30:53', '2005-08-19T10:36:11', '2005-08-21T09:12:11', '1'), + ('504', '3148', '2006-02-16T02:30:53', '2005-07-28T12:51:22', '2005-07-30T12:19:22', '1'), + ('432', '1334', '2006-02-16T02:30:53', '2005-05-30T09:10:01', '2005-06-08T03:43:01', '1'), + ('472', '617', '2006-02-16T02:30:53', '2005-08-01T03:29:10', '2005-08-07T06:16:10', '1'), + ('280', '4435', '2006-02-16T02:30:53', '2005-07-28T11:12:12', '2005-08-01T08:13:12', '1'), + ('277', '2659', '2006-02-16T02:30:53', '2005-08-20T09:41:09', '2005-08-22T06:28:09', '1'), + ('232', '4227', '2006-02-16T02:30:53', '2005-07-30T17:44:24', '2005-08-08T17:39:24', '1'), + ('537', '4211', '2006-02-16T02:30:53', '2005-08-19T07:06:51', '2005-08-22T04:04:51', '1'), + ('416', '2071', '2006-02-16T02:30:53', '2005-07-28T11:56:57', '2005-07-29T14:06:57', '1'), + ('454', '928', '2006-02-16T02:30:53', '2005-07-31T17:53:51', '2005-08-09T21:39:51', '1'), + ('104', '1361', '2006-02-16T02:30:53', '2005-07-08T03:26:20', '2005-07-16T05:04:20', '1'), + ('576', '429', '2006-02-16T02:30:53', '2005-08-19T19:52:52', '2005-08-20T18:56:52', '1'), + ('171', '3044', '2006-02-16T02:30:53', '2005-08-01T15:12:00', '2005-08-08T14:09:00', '1'), + ('312', '2651', '2006-02-16T02:30:53', '2005-07-06T14:26:38', '2005-07-11T16:34:38', '1'), + ('331', '2715', '2006-02-16T02:30:53', '2005-07-07T03:37:28', '2005-07-09T01:40:28', '1'), + ('125', '4528', '2006-02-16T02:30:53', '2005-07-09T10:52:09', '2005-07-13T15:12:09', '1'), + ('539', '368', '2006-02-16T02:30:53', '2005-05-26T14:30:24', '2005-05-27T08:50:24', '1'), + ('407', '2278', '2006-02-16T02:30:53', '2005-06-19T05:53:46', '2005-06-20T05:14:46', '1'), + ('327', '4266', '2006-02-16T02:30:53', '2005-07-12T08:41:42', '2005-07-14T05:34:42', '1'), + ('319', '3229', '2006-02-16T02:30:53', '2005-07-11T08:24:44', '2005-07-13T06:41:44', '1'), + ('234', '3105', '2006-02-16T02:30:53', '2005-07-08T12:39:31', '2005-07-15T18:07:31', '1'), + ('9', '2279', '2006-02-16T02:30:53', '2005-05-31T10:13:34', '2005-06-09T08:11:34', '1'), + ('20', '4431', '2006-02-16T02:30:53', '2005-08-19T12:26:32', '2005-08-22T13:26:32', '1'), + ('139', '4443', '2006-02-16T02:30:53', '2005-06-19T14:49:42', '2005-06-26T19:37:42', '1'), + ('480', '166', '2006-02-16T02:30:53', '2005-07-06T00:23:43', '2005-07-15T04:19:43', '1'), + ('61', '3719', '2006-02-16T02:30:53', '2005-08-01T12:46:39', '2005-08-06T17:17:39', '1'), + ('504', '1066', '2006-02-16T02:30:53', '2005-07-27T22:38:05', '2005-07-30T17:20:05', '1'), + ('369', '3614', '2006-02-16T02:30:53', '2005-07-06T19:27:32', '2005-07-08T23:27:32', '1'), + ('115', '717', '2006-02-16T02:30:53', '2005-08-23T00:57:12', '2005-08-28T00:19:12', '1'), + ('9', '3540', '2006-02-16T02:30:53', '2005-07-11T10:17:29', '2005-07-17T07:27:29', '1'), + ('98', '949', '2006-02-16T02:30:53', '2005-06-18T02:36:47', '2005-06-23T05:02:47', '1'), + ('234', '2077', '2006-02-16T02:30:53', '2005-08-02T06:17:16', '2005-08-09T05:58:16', '1'), + ('8', '1841', '2006-02-16T02:30:53', '2005-07-12T10:43:53', '2005-07-14T05:37:53', '1'), + ('382', '1123', '2006-02-16T02:30:53', '2005-08-18T03:08:23', '2005-08-22T03:42:23', '1'), + ('562', '1007', '2006-02-16T02:30:53', '2005-07-11T04:25:51', '2005-07-17T08:19:51', '1'), + ('587', '6', '2006-02-16T02:30:53', '2005-05-27T07:03:28', '2005-05-31T08:01:28', '1'), + ('205', '2806', '2006-02-16T02:30:53', '2005-07-06T05:20:25', '2005-07-15T03:13:25', '1'), + ('488', '630', '2006-02-16T02:30:53', '2005-08-23T02:37:19', '2005-08-23T20:57:19', '1'), + ('40', '4322', '2006-02-16T02:30:53', '2005-05-25T21:19:53', '2005-05-29T23:34:53', '1'), + ('399', '2385', '2006-02-16T02:30:53', '2005-07-12T11:51:54', '2005-07-13T16:57:54', '1'), + ('282', '3662', '2006-02-16T02:30:53', '2005-07-06T09:09:19', '2005-07-12T08:51:19', '1'), + ('445', '2607', '2006-02-16T02:30:53', '2005-08-22T03:11:35', '2005-08-30T00:10:35', '1'), + ('2', '2179', '2006-02-16T02:30:53', '2005-08-22T13:53:04', '2005-08-31T15:51:04', '1'), + ('91', '2514', '2006-02-16T02:30:53', '2005-07-28T13:53:54', '2005-08-06T15:32:54', '1'), + ('530', '1435', '2006-02-16T02:30:53', '2005-07-27T03:02:07', '2005-08-02T07:14:07', '1'), + ('498', '3452', '2006-02-16T02:30:53', '2005-07-27T12:23:49', '2005-08-04T07:57:49', '1'), + ('269', '1404', '2006-02-16T02:30:53', '2005-08-19T12:42:28', '2005-08-26T14:52:28', '1'), + ('113', '2260', '2006-02-16T02:30:53', '2005-08-23T06:31:24', '2005-08-28T06:53:24', '1'), + ('22', '247', '2006-02-16T02:30:53', '2005-08-17T19:54:54', '2005-08-26T23:03:54', '1'), + ('73', '3562', '2006-02-16T02:30:53', '2005-07-12T03:47:44', '2005-07-20T00:11:44', '1'), + ('279', '499', '2006-02-16T02:30:53', '2005-07-31T11:46:57', '2005-08-08T13:35:57', '1'), + ('133', '927', '2006-02-16T02:30:53', '2005-08-22T11:11:51', '2005-08-23T13:09:51', '1'), + ('549', '2792', '2006-02-16T02:30:53', '2005-05-24T23:08:07', '2005-05-27T01:32:07', '1'), + ('75', '3798', '2006-02-16T02:30:53', '2005-07-27T03:36:38', '2005-08-03T21:51:38', '1'), + ('457', '1526', '2006-02-16T02:30:53', '2005-07-08T06:48:37', '2005-07-15T10:11:37', '1'), + ('262', '3505', '2006-02-16T02:30:53', '2005-08-23T08:04:40', '2005-08-24T06:38:40', '1'), + ('348', '2398', '2006-02-16T02:30:53', '2005-07-12T16:02:09', '2005-07-20T16:31:09', '1'), + ('58', '3320', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('49', '3624', '2006-02-16T02:30:53', '2005-07-12T15:14:48', '2005-07-15T11:29:48', '1'), + ('140', '3832', '2006-02-16T02:30:53', '2005-07-30T20:21:35', '2005-08-02T15:52:35', '1'), + ('539', '4522', '2006-02-16T02:30:53', '2005-08-02T02:14:40', '2005-08-06T06:04:40', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['7254', '2579', '7627', '12786', '2258', '13592', '3649', '13661', '14616', '5489', '9856', '15917', '5041', '2559', '4585', '3623', '4330', '10031', '14147', '3886', '11226', '4035', '9060', '2205', '13292', '8833', '747', '12981', '12319', '14565', '10994', '9590', '12879', '6804', '5619', '14206', '59', '2304', '596', '11094', '15341', '10912', '153', '12149', '10876', '5030', '8060', '14547', '4880', '764', '202', '15497', '5965', '11861', '7311', '2154', '10136', '10063', '4307', '14351', '3184', '7825', '14653', '1399', '2675', '11410', '15914', '11950', '7197', '1810', '3757', '4263', '4240', '3823', '10399', '7961', '2608', '1512', '12408', '4213', '10819', '800', '10996', '4720', '3761', '7890', '14895', '6506', '3859', '7519', '2482', '10042', '11667', '5664', '2541', '14822', '660', '11610', '529', '13785']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('286', '2697', '2006-02-16T02:30:53', '2005-07-27T10:48:50', '2005-07-28T10:34:50', '1'), + ('493', '3836', '2006-02-16T02:30:53', '2005-06-19T04:40:44', '2005-06-22T09:22:44', '1'), + ('52', '782', '2006-02-16T02:30:53', '2005-07-28T00:56:47', '2005-08-02T04:16:47', '1'), + ('512', '97', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('292', '4573', '2006-02-16T02:30:53', '2005-06-18T05:30:36', '2005-06-24T09:09:36', '1'), + ('470', '1509', '2006-02-16T02:30:53', '2005-08-20T05:50:35', '2005-08-23T04:52:35', '1'), + ('24', '3564', '2006-02-16T02:30:53', '2005-07-06T07:32:42', '2005-07-12T09:37:42', '1'), + ('471', '3996', '2006-02-16T02:30:53', '2005-08-20T08:05:59', '2005-08-29T12:15:59', '1'), + ('532', '4537', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('490', '2319', '2006-02-16T02:30:53', '2005-07-10T00:07:03', '2005-07-15T19:52:03', '1'), + ('347', '723', '2006-02-16T02:30:53', '2005-07-31T13:00:35', '2005-08-07T18:07:35', '1'), + ('589', '2093', '2006-02-16T02:30:53', '2005-08-23T17:57:28', '2005-08-29T20:03:28', '1'), + ('305', '2711', '2006-02-16T02:30:53', '2005-07-09T03:18:51', '2005-07-13T03:08:51', '1'), + ('414', '4433', '2006-02-16T02:30:53', '2005-06-19T03:09:46', '2005-06-28T07:49:46', '1'), + ('143', '1622', '2006-02-16T02:30:53', '2005-07-08T06:11:58', '2005-07-17T01:58:58', '1'), + ('80', '430', '2006-02-16T02:30:53', '2005-07-06T06:05:23', '2005-07-07T05:59:23', '1'), + ('408', '2408', '2006-02-16T02:30:53', '2005-07-07T18:09:41', '2005-07-14T22:05:41', '1'), + ('96', '3048', '2006-02-16T02:30:53', '2005-07-31T18:40:15', '2005-08-03T14:38:15', '1'), + ('366', '1476', '2006-02-16T02:30:53', '2005-08-21T02:14:03', '2005-08-27T22:38:03', '1'), + ('326', '2368', '2006-02-16T02:30:53', '2005-07-06T18:44:24', '2005-07-08T15:11:24', '1'), + ('282', '79', '2006-02-16T02:30:53', '2005-08-02T12:47:30', '2005-08-06T11:24:30', '1'), + ('539', '3611', '2006-02-16T02:30:53', '2005-07-07T02:45:02', '2005-07-14T01:41:02', '1'), + ('87', '4360', '2006-02-16T02:30:53', '2005-07-30T07:20:36', '2005-08-03T10:51:36', '1'), + ('593', '1245', '2006-02-16T02:30:53', '2005-06-18T02:14:34', '2005-06-25T05:11:34', '1'), + ('171', '1336', '2006-02-16T02:30:53', '2005-08-19T18:35:32', '2005-08-22T00:27:32', '1'), + ('101', '1741', '2006-02-16T02:30:53', '2005-07-29T22:39:36', '2005-08-05T21:19:36', '1'), + ('291', '1993', '2006-02-16T02:30:53', '2005-05-29T09:26:34', '2005-06-05T07:28:34', '1'), + ('481', '3925', '2006-02-16T02:30:53', '2005-08-19T07:04:00', '2005-08-21T09:17:00', '1'), + ('368', '999', '2006-02-16T02:30:53', '2005-08-18T06:26:45', '2005-08-23T01:35:45', '1'), + ('250', '4160', '2006-02-16T02:30:53', '2005-08-21T16:24:45', '2005-08-25T14:42:45', '1'), + ('323', '647', '2006-02-16T02:30:53', '2005-08-02T04:46:53', '2005-08-11T10:30:53', '1'), + ('585', '2293', '2006-02-16T02:30:53', '2005-07-31T03:17:16', '2005-08-08T04:24:16', '1'), + ('210', '3556', '2006-02-16T02:30:53', '2005-08-19T03:22:55', '2005-08-24T22:00:55', '1'), + ('269', '1554', '2006-02-16T02:30:53', '2005-07-12T17:22:06', '2005-07-21T11:37:06', '1'), + ('204', '113', '2006-02-16T02:30:53', '2005-07-10T05:29:33', '2005-07-15T00:40:33', '1'), + ('279', '860', '2006-02-16T02:30:53', '2005-08-21T03:59:26', '2005-08-26T03:52:26', '1'), + ('408', '2884', '2006-02-16T02:30:53', '2005-05-25T08:56:42', '2005-06-01T09:52:42', '1'), + ('327', '3543', '2006-02-16T02:30:53', '2005-06-18T08:30:15', '2005-06-23T06:17:15', '1'), + ('589', '821', '2006-02-16T02:30:53', '2005-05-28T14:00:03', '2005-05-29T17:10:03', '1'), + ('18', '3095', '2006-02-16T02:30:53', '2005-08-02T08:03:02', '2005-08-03T11:34:02', '1'), + ('91', '3359', '2006-02-16T02:30:53', '2005-08-22T20:56:31', '2005-08-30T17:25:31', '1'), + ('477', '732', '2006-02-16T02:30:53', '2005-08-02T02:00:03', '2005-08-06T05:55:03', '1'), + ('348', '3888', '2006-02-16T02:30:53', '2005-05-26T00:47:47', '2005-05-27T21:28:47', '1'), + ('277', '3696', '2006-02-16T02:30:53', '2005-08-18T00:13:51', '2005-08-26T19:47:51', '1'), + ('559', '2161', '2006-02-16T02:30:53', '2005-08-02T00:31:58', '2005-08-05T21:45:58', '1'), + ('497', '25', '2006-02-16T02:30:53', '2005-07-09T02:35:43', '2005-07-17T02:05:43', '1'), + ('577', '3765', '2006-02-16T02:30:53', '2005-07-28T17:10:02', '2005-08-05T17:11:02', '1'), + ('265', '1172', '2006-02-16T02:30:53', '2005-08-21T15:51:38', '2005-08-26T15:35:38', '1'), + ('269', '4178', '2006-02-16T02:30:53', '2005-07-08T19:36:17', '2005-07-13T00:01:17', '1'), + ('149', '1069', '2006-02-16T02:30:53', '2005-05-29T11:37:35', '2005-05-31T16:47:35', '1'), + ('20', '674', '2006-02-16T02:30:53', '2005-05-26T07:27:36', '2005-06-02T03:52:36', '1'), + ('107', '363', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('348', '4476', '2006-02-16T02:30:53', '2005-07-10T23:51:52', '2005-07-11T23:29:52', '1'), + ('232', '2674', '2006-02-16T02:30:53', '2005-08-17T13:53:47', '2005-08-21T16:07:47', '1'), + ('582', '2807', '2006-02-16T02:30:53', '2005-07-27T13:02:54', '2005-08-04T09:52:54', '1'), + ('30', '1655', '2006-02-16T02:30:53', '2005-06-17T22:59:42', '2005-06-24T04:11:42', '1'), + ('2', '3142', '2006-02-16T02:30:53', '2005-07-31T21:58:56', '2005-08-03T19:44:56', '1'), + ('517', '3003', '2006-02-16T02:30:53', '2005-07-31T19:25:13', '2005-08-09T15:55:13', '1'), + ('394', '2827', '2006-02-16T02:30:53', '2005-07-07T17:20:39', '2005-07-16T14:42:39', '1'), + ('66', '2037', '2006-02-16T02:30:53', '2005-08-21T09:04:20', '2005-08-25T05:27:20', '1'), + ('457', '3179', '2006-02-16T02:30:53', '2005-06-20T22:57:44', '2005-06-29T20:57:44', '1'), + ('348', '4340', '2006-02-16T02:30:53', '2005-07-28T08:34:57', '2005-08-06T02:45:57', '1'), + ('593', '491', '2006-02-16T02:30:53', '2005-08-21T19:35:59', '2005-08-24T15:31:59', '1'), + ('469', '1435', '2006-02-16T02:30:53', '2005-06-15T16:29:51', '2005-06-18T14:06:51', '1'), + ('230', '3078', '2006-02-16T02:30:53', '2005-06-19T11:52:15', '2005-06-23T16:45:15', '1'), + ('592', '692', '2006-02-16T02:30:53', '2005-08-02T19:29:01', '2005-08-11T16:50:01', '1'), + ('557', '747', '2006-02-16T02:30:53', '2005-08-23T17:49:26', '2005-08-24T12:20:26', '1'), + ('190', '4412', '2006-02-16T02:30:53', '2005-08-17T17:13:16', '2005-08-26T21:25:16', '1'), + ('577', '2109', '2006-02-16T02:30:53', '2005-07-27T08:49:32', '2005-07-31T13:50:32', '1'), + ('7', '2368', '2006-02-16T02:30:53', '2005-06-16T21:06:00', '2005-06-21T21:24:00', '1'), + ('66', '2816', '2006-02-16T02:30:53', '2005-07-06T12:42:26', '2005-07-11T10:30:26', '1'), + ('16', '2975', '2006-02-16T02:30:53', '2005-07-07T14:24:44', '2005-07-13T18:22:44', '1'), + ('65', '1024', '2006-02-16T02:30:53', '2005-07-07T13:33:12', '2005-07-13T12:28:12', '1'), + ('265', '124', '2006-02-16T02:30:53', '2005-07-06T15:41:27', '2005-07-09T09:48:27', '1'), + ('204', '2515', '2006-02-16T02:30:53', '2005-08-01T07:13:39', '2005-08-10T06:56:39', '1'), + ('45', '3284', '2006-02-16T02:30:53', '2005-07-28T13:47:21', '2005-08-01T09:33:21', '1'), + ('132', '1618', '2006-02-16T02:30:53', '2005-06-19T07:10:36', '2005-06-24T13:09:36', '1'), + ('452', '1628', '2006-02-16T02:30:53', '2005-06-15T22:53:03', '2005-06-23T18:56:03', '1'), + ('143', '2360', '2006-02-16T02:30:53', '2005-08-18T09:40:38', '2005-08-19T04:45:38', '1'), + ('103', '705', '2006-02-16T02:30:53', '2005-07-07T11:53:49', '2005-07-13T07:51:49', '1'), + ('308', '983', '2006-02-16T02:30:53', '2005-08-01T22:52:57', '2005-08-06T00:08:57', '1'), + ('472', '441', '2006-02-16T02:30:53', '2005-05-29T17:28:12', '2005-05-30T14:59:12', '1'), + ('26', '2235', '2006-02-16T02:30:53', '2005-08-02T04:48:11', '2005-08-06T08:00:11', '1'), + ('452', '2669', '2006-02-16T02:30:53', '2005-07-08T12:34:34', '2005-07-09T10:28:34', '1'), + ('464', '4304', '2006-02-16T02:30:53', '2005-07-06T12:52:44', '2005-07-08T17:22:44', '1'), + ('553', '3443', '2006-02-16T02:30:53', '2005-07-28T10:43:40', '2005-07-31T06:07:40', '1'), + ('340', '4462', '2006-02-16T02:30:53', '2005-08-22T04:19:23', '2005-08-27T04:02:23', '1'), + ('423', '386', '2006-02-16T02:30:53', '2005-07-12T03:28:22', '2005-07-17T22:43:22', '1'), + ('553', '2548', '2006-02-16T02:30:53', '2005-07-06T17:18:15', '2005-07-09T16:48:15', '1'), + ('124', '4009', '2006-02-16T02:30:53', '2005-07-27T21:01:41', '2005-08-05T19:15:41', '1'), + ('122', '452', '2006-02-16T02:30:53', '2005-06-18T21:10:44', '2005-06-19T20:39:44', '1'), + ('204', '123', '2006-02-16T02:30:53', '2005-07-31T19:01:25', '2005-08-06T14:21:25', '1'), + ('582', '1516', '2006-02-16T02:30:53', '2005-08-17T05:46:55', '2005-08-26T08:19:55', '1'), + ('469', '2375', '2006-02-16T02:30:53', '2005-07-10T08:04:41', '2005-07-17T10:29:41', '1'), + ('360', '129', '2006-02-16T02:30:53', '2005-06-19T02:08:10', '2005-06-23T23:32:10', '1'), + ('52', '2835', '2006-02-16T02:30:53', '2005-08-22T01:21:14', '2005-08-30T03:59:14', '1'), + ('578', '1414', '2006-02-16T02:30:53', '2005-05-28T20:53:31', '2005-05-30T15:26:31', '1'), + ('275', '3048', '2006-02-16T02:30:53', '2005-08-17T03:43:37', '2005-08-20T22:14:37', '1'), + ('469', '2624', '2006-02-16T02:30:53', '2005-05-28T04:34:17', '2005-05-30T00:35:17', '1'), + ('453', '379', '2006-02-16T02:30:53', '2005-08-20T12:11:46', '2005-08-21T06:39:46', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['8316', '8018', '14527', '5884', '7139', '9006', '7414', '8916', '13311', '3492', '5319', '14320', '3917', '12932', '12641', '4911', '8199', '2183', '15416', '2514', '4917', '10000', '13765', '4939', '6534', '950', '15498', '11914', '6866', '6882', '11530', '15259', '14340', '4053', '6225', '9278', '6542', '10423', '13831', '6656', '13883', '14557', '10874', '9230', '13662', '12220', '4124', '14597', '13150', '13642', '12254', '1077', '5187', '4346', '9504', '2730', '11509', '8744', '3414', '3370', '10259', '10470', '7916', '2583', '2890', '11534', '14969', '13192', '4407', '5267', '15902', '1239', '11071', '15383', '4613', '12228', '13316', '4662', '3115', '10733', '13877', '12656', '15026', '9134', '3122', '9362', '7081', '15761', '6650', '4780', '10825', '10118', '12607', '11840', '9693', '3875', '4065', '15885', '7059', '12453']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('549', '4118', '2006-02-16T02:30:53', '2005-07-29T03:38:49', '2005-08-03T07:41:49', '1'), + ('377', '4129', '2006-02-16T02:30:53', '2005-07-28T15:36:48', '2005-08-06T20:04:48', '1'), + ('232', '3496', '2006-02-16T02:30:53', '2005-08-21T15:07:42', '2005-08-23T12:31:42', '1'), + ('498', '916', '2006-02-16T02:30:53', '2005-07-10T19:31:38', '2005-07-11T20:30:38', '1'), + ('575', '846', '2006-02-16T02:30:53', '2005-07-27T06:52:21', '2005-07-30T01:45:21', '1'), + ('49', '3315', '2006-02-16T02:30:53', '2005-07-30T05:06:32', '2005-07-31T08:24:32', '1'), + ('265', '3276', '2006-02-16T02:30:53', '2005-07-27T16:46:07', '2005-08-02T20:04:07', '1'), + ('377', '3852', '2006-02-16T02:30:53', '2005-07-30T01:42:21', '2005-08-03T05:28:21', '1'), + ('520', '3890', '2006-02-16T02:30:53', '2005-08-19T19:07:09', '2005-08-20T23:07:09', '1'), + ('142', '980', '2006-02-16T02:30:53', '2005-07-05T23:44:37', '2005-07-14T03:54:37', '1'), + ('282', '1899', '2006-02-16T02:30:53', '2005-07-09T16:17:44', '2005-07-18T16:35:44', '1'), + ('199', '3121', '2006-02-16T02:30:53', '2005-08-21T08:04:40', '2005-08-22T02:09:40', '1'), + ('471', '2747', '2006-02-16T02:30:53', '2005-07-06T20:19:29', '2005-07-11T00:49:29', '1'), + ('416', '2295', '2006-02-16T02:30:53', '2005-08-19T05:17:30', '2005-08-21T09:24:30', '1'), + ('467', '776', '2006-02-16T02:30:53', '2005-08-18T18:18:08', '2005-08-19T23:17:08', '1'), + ('66', '4479', '2006-02-16T02:30:53', '2005-07-08T21:20:26', '2005-07-15T03:11:26', '1'), + ('471', '404', '2006-02-16T02:30:53', '2005-07-28T23:10:25', '2005-08-04T23:30:25', '1'), + ('340', '1776', '2006-02-16T02:30:53', '2005-06-18T01:06:01', '2005-06-22T01:20:01', '1'), + ('383', '1167', '2006-02-16T02:30:53', '2005-08-22T23:51:23', '2005-08-29T20:03:23', '1'), + ('382', '2559', '2006-02-16T02:30:53', '2005-06-18T23:56:44', '2005-06-23T21:10:44', '1'), + ('104', '3231', '2006-02-16T02:30:53', '2005-07-08T21:32:30', '2005-07-09T15:34:30', '1'), + ('576', '3221', '2006-02-16T02:30:53', '2005-07-31T17:41:05', '2005-08-02T20:51:05', '1'), + ('219', '2104', '2006-02-16T02:30:53', '2005-08-20T11:39:00', '2005-08-21T06:05:00', '1'), + ('425', '3201', '2006-02-16T02:30:53', '2005-07-08T22:35:30', '2005-07-17T22:05:30', '1'), + ('577', '2359', '2006-02-16T02:30:53', '2005-07-12T04:39:43', '2005-07-16T06:33:43', '1'), + ('83', '491', '2006-02-16T02:30:53', '2005-05-30T16:06:08', '2005-06-01T11:43:08', '1'), + ('83', '1583', '2006-02-16T02:30:53', '2005-08-23T02:33:27', '2005-08-23T22:30:27', '1'), + ('230', '1634', '2006-02-16T02:30:53', '2005-08-17T16:04:42', '2005-08-22T19:29:42', '1'), + ('312', '2481', '2006-02-16T02:30:53', '2005-07-12T20:03:44', '2005-07-15T01:55:44', '1'), + ('166', '2469', '2006-02-16T02:30:53', '2005-07-12T20:50:39', '2005-07-14T21:01:39', '1'), + ('400', '365', '2006-02-16T02:30:53', '2005-08-17T00:29:00', '2005-08-22T03:22:00', '1'), + ('488', '3261', '2006-02-16T02:30:53', '2005-08-22T18:23:23', '2005-08-27T13:06:23', '1'), + ('230', '2181', '2006-02-16T02:30:53', '2005-08-21T08:38:21', '2005-08-25T09:25:21', '1'), + ('377', '2889', '2006-02-16T02:30:53', '2005-07-07T03:39:22', '2005-07-09T22:32:22', '1'), + ('204', '2483', '2006-02-16T02:30:53', '2005-07-11T13:45:14', '2005-07-14T10:23:14', '1'), + ('581', '3782', '2006-02-16T02:30:53', '2005-07-30T15:15:19', '2005-08-03T20:21:19', '1'), + ('359', '2421', '2006-02-16T02:30:53', '2005-07-12T04:53:49', '2005-07-13T01:48:49', '1'), + ('7', '739', '2006-02-16T02:30:53', '2005-08-01T08:19:53', '2005-08-08T10:25:53', '1'), + ('480', '570', '2006-02-16T02:30:53', '2005-08-20T13:59:35', '2005-08-24T12:50:35', '1'), + ('330', '2282', '2006-02-16T02:30:53', '2005-07-12T11:09:47', '2005-07-14T05:50:47', '1'), + ('568', '584', '2006-02-16T02:30:53', '2005-08-20T15:28:53', '2005-08-21T13:11:53', '1'), + ('490', '483', '2006-02-16T02:30:53', '2005-08-21T16:05:11', '2005-08-27T16:37:11', '1'), + ('230', '2552', '2006-02-16T02:30:53', '2005-08-02T00:31:00', '2005-08-07T05:04:00', '1'), + ('109', '1199', '2006-02-16T02:30:53', '2005-07-30T13:39:42', '2005-07-31T19:20:42', '1'), + ('592', '3880', '2006-02-16T02:30:53', '2005-08-20T08:11:58', '2005-08-26T13:34:58', '1'), + ('530', '982', '2006-02-16T02:30:53', '2005-08-18T02:50:02', '2005-08-22T00:20:02', '1'), + ('330', '2856', '2006-02-16T02:30:53', '2005-07-07T07:19:54', '2005-07-11T05:54:54', '1'), + ('472', '1160', '2006-02-16T02:30:53', '2005-08-21T17:39:41', '2005-08-25T14:07:41', '1'), + ('457', '1514', '2006-02-16T02:30:53', '2005-08-19T13:08:19', '2005-08-25T18:00:19', '1'), + ('452', '4415', '2006-02-16T02:30:53', '2005-08-20T07:42:17', '2005-08-29T10:49:17', '1'), + ('6', '2858', '2006-02-16T02:30:53', '2005-08-18T04:05:29', '2005-08-23T04:17:29', '1'), + ('24', '1986', '2006-02-16T02:30:53', '2005-05-31T10:22:54', '2005-06-02T12:21:54', '1'), + ('91', '2631', '2006-02-16T02:30:53', '2005-07-09T10:19:51', '2005-07-14T10:35:51', '1'), + ('520', '1906', '2006-02-16T02:30:53', '2005-07-07T18:58:45', '2005-07-10T16:37:45', '1'), + ('125', '91', '2006-02-16T02:30:53', '2005-07-31T00:09:07', '2005-08-02T05:44:07', '1'), + ('30', '1264', '2006-02-16T02:30:53', '2005-06-19T15:10:09', '2005-06-28T13:05:09', '1'), + ('273', '2750', '2006-02-16T02:30:53', '2005-08-16T23:29:53', '2005-08-19T02:09:53', '1'), + ('280', '1086', '2006-02-16T02:30:53', '2005-07-29T18:58:24', '2005-08-05T17:56:24', '1'), + ('226', '2929', '2006-02-16T02:30:53', '2005-06-21T16:58:50', '2005-06-24T17:26:50', '1'), + ('559', '1573', '2006-02-16T02:30:53', '2005-06-21T13:27:01', '2005-06-25T09:27:01', '1'), + ('566', '1881', '2006-02-16T02:30:53', '2005-08-01T02:52:05', '2005-08-03T20:54:05', '1'), + ('523', '82', '2006-02-16T02:30:53', '2005-08-01T09:52:26', '2005-08-05T06:52:26', '1'), + ('13', '3877', '2006-02-16T02:30:53', '2005-07-28T11:49:53', '2005-07-29T15:01:53', '1'), + ('523', '3999', '2006-02-16T02:30:53', '2005-06-19T05:01:40', '2005-06-28T00:04:40', '1'), + ('392', '3437', '2006-02-16T02:30:53', '2005-06-20T02:00:45', '2005-06-27T21:12:45', '1'), + ('144', '2414', '2006-02-16T02:30:53', '2005-08-17T00:35:27', '2005-08-24T01:36:27', '1'), + ('120', '4060', '2006-02-16T02:30:53', '2005-08-22T06:49:15', '2005-08-29T05:52:15', '1'), + ('532', '966', '2006-02-16T02:30:53', '2005-08-19T14:30:06', '2005-08-27T15:20:06', '1'), + ('20', '267', '2006-02-16T02:30:53', '2005-07-07T21:39:45', '2005-07-11T23:40:45', '1'), + ('233', '2242', '2006-02-16T02:30:53', '2005-07-09T14:21:10', '2005-07-15T12:02:10', '1'), + ('172', '4500', '2006-02-16T02:30:53', '2005-08-23T17:28:03', '2005-08-30T18:36:03', '1'), + ('444', '3731', '2006-02-16T02:30:53', '2005-06-15T04:53:01', '2005-06-16T07:03:01', '1'), + ('294', '4264', '2006-02-16T02:30:53', '2005-08-02T07:10:53', '2005-08-07T09:58:53', '1'), + ('405', '686', '2006-02-16T02:30:53', '2005-08-22T22:31:20', '2005-08-28T17:43:20', '1'), + ('581', '476', '2006-02-16T02:30:53', '2005-07-08T07:44:49', '2005-07-09T04:47:49', '1'), + ('9', '2772', '2006-02-16T02:30:53', '2005-08-18T03:08:10', '2005-08-20T02:48:10', '1'), + ('10', '4450', '2006-02-16T02:30:53', '2005-08-19T19:23:30', '2005-08-22T23:37:30', '1'), + ('553', '1370', '2006-02-16T02:30:53', '2005-07-08T09:58:54', '2005-07-10T12:51:54', '1'), + ('457', '2193', '2006-02-16T02:30:53', '2005-06-20T17:59:05', '2005-06-26T13:28:05', '1'), + ('560', '3980', '2006-02-16T02:30:53', '2005-08-01T19:28:01', '2005-08-09T18:41:01', '1'), + ('5', '3387', '2006-02-16T02:30:53', '2005-08-20T15:16:18', '2005-08-22T18:20:18', '1'), + ('286', '3981', '2006-02-16T02:30:53', '2005-08-18T18:58:35', '2005-08-21T00:41:35', '1'), + ('66', '4328', '2006-02-16T02:30:53', '2005-08-22T09:01:52', '2005-08-28T09:21:52', '1'), + ('559', '3797', '2006-02-16T02:30:53', '2005-07-30T10:00:21', '2005-08-01T05:01:21', '1'), + ('87', '2720', '2006-02-16T02:30:53', '2005-06-20T18:25:57', '2005-06-29T16:08:57', '1'), + ('420', '3357', '2006-02-16T02:30:53', '2005-07-30T18:44:16', '2005-08-01T20:14:16', '1'), + ('420', '462', '2006-02-16T02:30:53', '2005-07-27T04:25:59', '2005-08-01T00:14:59', '1'), + ('416', '4362', '2006-02-16T02:30:53', '2005-08-23T12:55:51', '2005-08-26T16:51:51', '1'), + ('526', '1589', '2006-02-16T02:30:53', '2005-07-12T10:57:10', '2005-07-14T07:24:10', '1'), + ('115', '2740', '2006-02-16T02:30:53', '2005-07-08T16:06:51', '2005-07-13T18:34:51', '1'), + ('587', '4386', '2006-02-16T02:30:53', '2005-08-01T23:05:33', '2005-08-04T04:33:33', '1'), + ('143', '1209', '2006-02-16T02:30:53', '2005-07-31T21:16:31', '2005-08-03T02:32:31', '1'), + ('526', '2130', '2006-02-16T02:30:53', '2005-08-18T17:03:49', '2005-08-19T18:29:49', '1'), + ('491', '1824', '2006-02-16T02:30:53', '2005-08-17T13:09:01', '2005-08-19T17:42:01', '1'), + ('273', '1031', '2006-02-16T02:30:53', '2005-07-31T07:11:50', '2005-08-08T09:55:50', '1'), + ('108', '712', '2006-02-16T02:30:53', '2005-07-06T18:15:39', '2005-07-11T17:34:39', '1'), + ('26', '1339', '2006-02-16T02:30:53', '2005-07-07T04:32:28', '2005-07-12T08:30:28', '1'), + ('565', '2116', '2006-02-16T02:30:53', '2005-08-23T16:50:43', '2005-08-29T20:19:43', '1'), + ('578', '129', '2006-02-16T02:30:53', '2005-07-27T03:51:02', '2005-08-02T22:04:02', '1'), + ('104', '2487', '2006-02-16T02:30:53', '2005-08-18T11:17:07', '2005-08-25T12:34:07', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['9194', '7588', '1793', '10602', '14677', '4750', '1122', '2605', '1044', '5590', '13158', '7217', '11588', '13763', '235', '1055', '6309', '6203', '2599', '6519', '11850', '7169', '3647', '11817', '15320', '7117', '4984', '7677', '916', '595', '6900', '4821', '3503', '7795', '11600', '1513', '3419', '815', '14732', '4511', '3612', '3158', '9797', '4797', '8260', '408', '13301', '14500', '15671', '3201', '6133', '13795', '7854', '8367', '13215', '15374', '14552', '5377', '1841', '10992', '12184', '4859', '6652', '6172', '15845', '4324', '13349', '15287', '14946', '10674', '14345', '15433', '6645', '13025', '15685', '6412', '13398', '3659', '15332', '14756', '5636', '4669', '8241', '10974', '135', '15350', '216', '6234', '2860', '5546', '6611', '2402', '206', '6856', '10083', '8636', '8706', '6365', '7445', '3972']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('294', '2467', '2006-02-16T02:30:53', '2005-07-30T12:28:45', '2005-08-06T14:38:45', '1'), + ('360', '4033', '2006-02-16T02:30:53', '2005-07-27T23:23:31', '2005-08-04T02:54:31', '1'), + ('230', '4356', '2006-02-16T02:30:53', '2005-06-16T20:07:27', '2005-06-19T20:55:27', '1'), + ('111', '1506', '2006-02-16T02:30:53', '2005-08-01T14:30:23', '2005-08-07T15:20:23', '1'), + ('26', '4411', '2006-02-16T02:30:53', '2005-08-21T20:12:30', '2005-08-28T15:11:30', '1'), + ('198', '3383', '2006-02-16T02:30:53', '2005-07-08T14:07:03', '2005-07-13T18:05:03', '1'), + ('180', '1392', '2006-02-16T02:30:53', '2005-05-31T16:39:33', '2005-06-04T17:25:33', '1'), + ('38', '2342', '2006-02-16T02:30:53', '2005-06-19T06:48:01', '2005-06-25T07:00:01', '1'), + ('70', '2574', '2006-02-16T02:30:53', '2005-05-31T06:24:44', '2005-06-03T04:51:44', '1'), + ('407', '4442', '2006-02-16T02:30:53', '2005-07-10T04:23:11', '2005-07-19T09:03:11', '1'), + ('327', '944', '2006-02-16T02:30:53', '2005-08-19T13:18:10', '2005-08-25T09:27:10', '1'), + ('20', '2646', '2006-02-16T02:30:53', '2005-07-27T09:31:44', '2005-07-29T10:48:44', '1'), + ('565', '2480', '2006-02-16T02:30:53', '2005-08-17T02:26:23', '2005-08-22T02:32:23', '1'), + ('469', '4171', '2006-02-16T02:30:53', '2005-08-20T11:37:56', '2005-08-26T13:12:56', '1'), + ('119', '3537', '2006-02-16T02:30:53', '2005-05-26T11:51:09', '2005-06-04T09:36:09', '1'), + ('108', '1639', '2006-02-16T02:30:53', '2005-05-31T07:47:18', '2005-06-03T01:57:18', '1'), + ('232', '1054', '2006-02-16T02:30:53', '2005-07-11T18:13:24', '2005-07-13T23:11:24', '1'), + ('408', '1001', '2006-02-16T02:30:53', '2005-07-11T12:28:57', '2005-07-15T14:10:57', '1'), + ('171', '461', '2006-02-16T02:30:53', '2005-06-19T06:06:07', '2005-06-27T01:10:07', '1'), + ('598', '4149', '2006-02-16T02:30:53', '2005-07-12T04:00:36', '2005-07-19T01:15:36', '1'), + ('80', '1437', '2006-02-16T02:30:53', '2005-08-17T13:30:15', '2005-08-21T17:24:15', '1'), + ('559', '735', '2006-02-16T02:30:53', '2005-07-27T07:51:39', '2005-08-01T06:42:39', '1'), + ('145', '3762', '2006-02-16T02:30:53', '2005-07-06T07:29:17', '2005-07-13T08:32:17', '1'), + ('38', '2297', '2006-02-16T02:30:53', '2005-08-17T12:20:01', '2005-08-19T18:06:01', '1'), + ('407', '648', '2006-02-16T02:30:53', '2005-08-22T20:17:49', '2005-08-28T17:31:49', '1'), + ('326', '2772', '2006-02-16T02:30:53', '2005-07-27T05:48:36', '2005-08-01T00:33:36', '1'), + ('214', '1303', '2006-02-16T02:30:53', '2005-07-09T00:35:31', '2005-07-17T03:44:31', '1'), + ('566', '4464', '2006-02-16T02:30:53', '2005-07-28T02:56:37', '2005-07-31T02:21:37', '1'), + ('6', '1290', '2006-02-16T02:30:53', '2005-05-30T11:25:01', '2005-05-31T09:06:01', '1'), + ('294', '595', '2006-02-16T02:30:53', '2005-05-28T13:59:54', '2005-06-05T15:16:54', '1'), + ('292', '129', '2006-02-16T02:30:53', '2005-07-12T21:45:25', '2005-07-19T21:19:25', '1'), + ('172', '1690', '2006-02-16T02:30:53', '2005-07-08T17:28:08', '2005-07-11T17:44:08', '1'), + ('449', '2944', '2006-02-16T02:30:53', '2005-07-06T00:17:24', '2005-07-08T03:47:24', '1'), + ('38', '1278', '2006-02-16T02:30:53', '2005-07-28T07:28:16', '2005-07-31T12:03:16', '1'), + ('400', '1978', '2006-02-16T02:30:53', '2005-08-17T03:12:04', '2005-08-23T07:10:04', '1'), + ('368', '1173', '2006-02-16T02:30:53', '2005-06-15T22:53:30', '2005-06-23T01:00:30', '1'), + ('22', '4022', '2006-02-16T02:30:53', '2005-06-21T17:18:01', '2005-06-22T15:08:01', '1'), + ('14', '3757', '2006-02-16T02:30:53', '2005-05-29T20:24:28', '2005-06-03T15:32:28', '1'), + ('482', '1915', '2006-02-16T02:30:53', '2005-08-21T22:22:29', '2005-08-23T18:34:29', '1'), + ('75', '4438', '2006-02-16T02:30:53', '2005-07-08T02:36:21', '2005-07-15T06:01:21', '1'), + ('402', '2465', '2006-02-16T02:30:53', '2005-07-06T05:37:26', '2005-07-14T01:51:26', '1'), + ('592', '3461', '2006-02-16T02:30:53', '2005-06-20T21:08:19', '2005-06-29T18:59:19', '1'), + ('52', '687', '2006-02-16T02:30:53', '2005-07-31T10:53:44', '2005-08-09T05:51:44', '1'), + ('265', '1389', '2006-02-16T02:30:53', '2005-07-08T16:39:05', '2005-07-09T11:41:05', '1'), + ('366', '4249', '2006-02-16T02:30:53', '2005-07-29T01:11:00', '2005-08-06T00:36:00', '1'), + ('84', '1438', '2006-02-16T02:30:53', '2005-05-27T13:57:39', '2005-05-28T11:57:39', '1'), + ('494', '2261', '2006-02-16T02:30:53', '2005-08-19T18:53:15', '2005-08-26T21:37:15', '1'), + ('451', '2024', '2006-02-16T02:30:53', '2005-08-21T14:11:30', '2005-08-27T12:19:30', '1'), + ('112', '3716', '2006-02-16T02:30:53', '2005-08-23T09:08:16', '2005-08-29T14:01:16', '1'), + ('597', '6', '2006-02-16T02:30:53', '2005-06-21T00:30:26', '2005-06-28T03:42:26', '1'), + ('107', '1992', '2006-02-16T02:30:53', '2005-07-11T08:25:22', '2005-07-13T13:17:22', '1'), + ('331', '2837', '2006-02-16T02:30:53', '2005-08-20T12:32:09', '2005-08-21T17:28:09', '1'), + ('84', '3531', '2006-02-16T02:30:53', '2005-07-28T09:42:31', '2005-08-02T09:25:31', '1'), + ('383', '4551', '2006-02-16T02:30:53', '2005-07-29T05:11:19', '2005-08-02T00:35:19', '1'), + ('460', '3740', '2006-02-16T02:30:53', '2005-08-19T15:35:38', '2005-08-27T12:16:38', '1'), + ('8', '4275', '2006-02-16T02:30:53', '2005-08-22T22:09:09', '2005-08-31T01:10:09', '1'), + ('477', '1991', '2006-02-16T02:30:53', '2005-08-21T15:59:27', '2005-08-27T11:46:27', '1'), + ('578', '3118', '2006-02-16T02:30:53', '2005-07-09T19:04:30', '2005-07-11T14:42:30', '1'), + ('6', '2363', '2006-02-16T02:30:53', '2005-06-16T23:44:13', '2005-06-22T04:09:13', '1'), + ('180', '11', '2006-02-16T02:30:53', '2005-08-02T04:41:17', '2005-08-09T02:13:17', '1'), + ('51', '1723', '2006-02-16T02:30:53', '2005-08-18T01:36:00', '2005-08-21T01:59:00', '1'), + ('369', '1939', '2006-02-16T02:30:53', '2005-07-08T18:54:04', '2005-07-13T13:04:04', '1'), + ('518', '2200', '2006-02-16T02:30:53', '2005-07-12T10:59:38', '2005-07-13T13:52:38', '1'), + ('219', '3514', '2006-02-16T02:30:53', '2005-07-11T10:32:09', '2005-07-14T16:23:09', '1'), + ('89', '4312', '2006-02-16T02:30:53', '2005-08-23T15:38:34', '2005-08-25T10:06:34', '1'), + ('226', '952', '2006-02-16T02:30:53', '2005-07-07T17:57:56', '2005-07-13T22:34:56', '1'), + ('234', '4262', '2006-02-16T02:30:53', '2005-08-19T20:43:16', '2005-08-20T16:21:16', '1'), + ('535', '308', '2006-02-16T02:30:53', '2005-08-22T19:19:37', '2005-08-29T16:05:37', '1'), + ('308', '1395', '2006-02-16T02:30:53', '2005-08-22T06:07:10', '2005-08-28T05:25:10', '1'), + ('340', '1962', '2006-02-16T02:30:53', '2005-08-01T17:11:52', '2005-08-08T19:34:52', '1'), + ('598', '1726', '2006-02-16T02:30:53', '2005-08-21T08:41:15', '2005-08-24T11:59:15', '1'), + ('198', '155', '2006-02-16T02:30:53', '2005-08-23T00:27:18', '2005-08-26T21:36:18', '1'), + ('73', '2858', '2006-02-16T02:30:53', '2005-07-12T10:39:55', '2005-07-17T07:41:55', '1'), + ('269', '4066', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('491', '370', '2006-02-16T02:30:53', '2005-08-23T09:41:28', '2005-08-30T10:11:28', '1'), + ('220', '3797', '2006-02-16T02:30:53', '2005-07-11T23:19:21', '2005-07-16T19:48:21', '1'), + ('405', '3376', '2006-02-16T02:30:53', '2005-08-19T22:08:48', '2005-08-23T03:24:48', '1'), + ('330', '2271', '2006-02-16T02:30:53', '2005-07-06T08:03:14', '2005-07-12T09:50:14', '1'), + ('162', '3368', '2006-02-16T02:30:53', '2005-08-22T20:41:53', '2005-08-24T01:45:53', '1'), + ('288', '564', '2006-02-16T02:30:53', '2005-08-21T23:21:23', '2005-08-24T01:44:23', '1'), + ('2', '4116', '2006-02-16T02:30:53', '2005-07-10T06:31:24', '2005-07-13T02:36:24', '1'), + ('581', '3494', '2006-02-16T02:30:53', '2005-07-08T10:13:08', '2005-07-16T07:52:08', '1'), + ('26', '4297', '2006-02-16T02:30:53', '2005-07-29T00:33:36', '2005-08-03T01:31:36', '1'), + ('491', '690', '2006-02-16T02:30:53', '2005-08-02T04:10:52', '2005-08-09T08:26:52', '1'), + ('304', '103', '2006-02-16T02:30:53', '2005-05-25T21:58:58', '2005-06-03T17:50:58', '1'), + ('488', '1170', '2006-02-16T02:30:53', '2005-08-22T21:15:29', '2005-08-24T02:56:29', '1'), + ('91', '1398', '2006-02-16T02:30:53', '2005-05-26T09:17:43', '2005-06-03T08:21:43', '1'), + ('232', '2911', '2006-02-16T02:30:53', '2005-07-11T14:16:10', '2005-07-19T19:55:10', '1'), + ('107', '3045', '2006-02-16T02:30:53', '2005-06-19T23:20:40', '2005-06-21T04:59:40', '1'), + ('515', '2918', '2006-02-16T02:30:53', '2005-07-10T02:50:37', '2005-07-16T08:22:37', '1'), + ('286', '1604', '2006-02-16T02:30:53', '2005-07-12T08:20:23', '2005-07-16T07:19:23', '1'), + ('360', '2833', '2006-02-16T02:30:53', '2005-06-18T16:24:45', '2005-06-27T14:39:45', '1'), + ('345', '1717', '2006-02-16T02:30:53', '2005-05-26T08:01:54', '2005-05-27T06:26:54', '1'), + ('275', '4338', '2006-02-16T02:30:53', '2005-07-12T19:50:16', '2005-07-14T22:25:16', '1'), + ('449', '2585', '2006-02-16T02:30:53', '2005-07-31T20:10:19', '2005-08-06T23:18:19', '1'), + ('252', '4308', '2006-02-16T02:30:53', '2005-07-29T14:24:13', '2005-08-02T14:39:13', '1'), + ('515', '2886', '2006-02-16T02:30:53', '2005-07-29T17:19:15', '2005-08-03T22:52:15', '1'), + ('566', '4550', '2006-02-16T02:30:53', '2005-07-11T21:17:40', '2005-07-14T20:53:40', '1'), + ('394', '4115', '2006-02-16T02:30:53', '2005-07-27T17:57:15', '2005-07-31T20:24:15', '1'), + ('598', '1895', '2006-02-16T02:30:53', '2005-07-06T22:53:57', '2005-07-11T01:32:57', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['9844', '13222', '5006', '13845', '5431', '15862', '15395', '12385', '15628', '11517', '12003', '10797', '8711', '12211', '4181', '4230', '8557', '696', '2191', '936', '9511', '5198', '4343', '10105', '12416', '4610', '7508', '14134', '1800', '4815', '5190', '15469', '5710', '3050', '12834', '10800', '11899', '160', '6503', '8671', '9493', '10786', '9560', '6274', '11085', '7141', '5133', '6319', '10822', '15058', '11195', '9582', '5376', '690', '13342', '6485', '2231', '2938', '2246', '7647', '2902', '15554', '7373', '15972', '12962', '10665', '4370', '5927', '13875', '949', '9101', '48', '11142', '7968', '14504', '5007', '9580', '980', '10769', '9723', '10050', '3111', '3423', '5940', '3868', '5278', '8000', '3991', '15186', '8313', '15655', '10434', '14305', '9170', '7056', '13380', '12431', '11496', '14027', '7770']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('181', '3930', '2006-02-16T02:30:53', '2005-07-31T12:26:31', '2005-08-05T13:58:31', '1'), + ('91', '1656', '2006-02-16T02:30:53', '2005-08-19T15:47:58', '2005-08-26T12:43:58', '1'), + ('486', '1277', '2006-02-16T02:30:53', '2005-07-09T01:24:07', '2005-07-18T03:56:07', '1'), + ('559', '3993', '2006-02-16T02:30:53', '2005-08-20T14:31:21', '2005-08-29T18:29:21', '1'), + ('213', '2780', '2006-02-16T02:30:53', '2005-07-09T21:21:11', '2005-07-10T21:16:11', '1'), + ('215', '925', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('526', '2880', '2006-02-16T02:30:53', '2005-08-22T23:06:25', '2005-08-30T19:18:25', '1'), + ('146', '3143', '2006-02-16T02:30:53', '2005-08-18T08:39:33', '2005-08-21T14:22:33', '1'), + ('408', '1348', '2006-02-16T02:30:53', '2005-08-23T07:28:04', '2005-08-26T04:23:04', '1'), + ('280', '4266', '2006-02-16T02:30:53', '2005-08-16T23:56:28', '2005-08-21T22:40:28', '1'), + ('70', '3868', '2006-02-16T02:30:53', '2005-08-17T18:56:05', '2005-08-18T23:52:05', '1'), + ('308', '1731', '2006-02-16T02:30:53', '2005-08-01T22:02:51', '2005-08-03T23:07:51', '1'), + ('575', '3471', '2006-02-16T02:30:53', '2005-07-29T17:27:15', '2005-07-31T12:57:15', '1'), + ('19', '1484', '2006-02-16T02:30:53', '2005-08-18T02:31:18', '2005-08-26T02:36:18', '1'), + ('598', '3725', '2006-02-16T02:30:53', '2005-07-07T10:27:54', '2005-07-13T06:09:54', '1'), + ('205', '353', '2006-02-16T02:30:53', '2005-07-07T12:46:47', '2005-07-15T06:52:47', '1'), + ('459', '1481', '2006-02-16T02:30:53', '2005-07-29T11:19:59', '2005-08-07T12:50:59', '1'), + ('19', '2076', '2006-02-16T02:30:53', '2005-05-29T01:59:10', '2005-06-01T02:45:10', '1'), + ('58', '3369', '2006-02-16T02:30:53', '2005-06-18T01:33:09', '2005-06-19T20:18:09', '1'), + ('469', '901', '2006-02-16T02:30:53', '2005-05-30T13:52:49', '2005-06-07T16:56:49', '1'), + ('549', '964', '2006-02-16T02:30:53', '2005-07-31T00:25:05', '2005-08-09T02:46:05', '1'), + ('101', '218', '2006-02-16T02:30:53', '2005-07-09T10:49:10', '2005-07-13T04:52:10', '1'), + ('293', '1926', '2006-02-16T02:30:53', '2005-07-07T18:48:54', '2005-07-12T15:19:54', '1'), + ('286', '112', '2006-02-16T02:30:53', '2005-07-31T20:54:20', '2005-08-09T17:45:20', '1'), + ('515', '3784', '2006-02-16T02:30:53', '2005-08-18T09:56:48', '2005-08-22T12:34:48', '1'), + ('265', '1279', '2006-02-16T02:30:53', '2005-07-08T07:28:05', '2005-07-14T02:10:05', '1'), + ('465', '3401', '2006-02-16T02:30:53', '2005-07-27T20:33:08', '2005-08-01T01:29:08', '1'), + ('497', '2159', '2006-02-16T02:30:53', '2005-08-21T01:45:54', '2005-08-24T01:36:54', '1'), + ('149', '2058', '2006-02-16T02:30:53', '2005-06-16T20:18:46', '2005-06-20T17:12:46', '1'), + ('581', '840', '2006-02-16T02:30:53', '2005-07-08T17:12:51', '2005-07-17T13:14:51', '1'), + ('532', '2213', '2006-02-16T02:30:53', '2005-07-09T10:25:24', '2005-07-18T04:33:24', '1'), + ('597', '1939', '2006-02-16T02:30:53', '2005-08-23T01:29:59', '2005-08-27T04:02:59', '1'), + ('265', '2843', '2006-02-16T02:30:53', '2005-07-10T10:32:52', '2005-07-18T06:28:52', '1'), + ('557', '2397', '2006-02-16T02:30:53', '2005-06-20T13:03:03', '2005-06-29T07:22:03', '1'), + ('133', '757', '2006-02-16T02:30:53', '2005-08-19T01:47:30', '2005-08-24T20:08:30', '1'), + ('583', '507', '2006-02-16T02:30:53', '2005-08-01T22:07:44', '2005-08-05T22:45:44', '1'), + ('84', '3179', '2006-02-16T02:30:53', '2005-08-17T15:29:12', '2005-08-24T17:41:12', '1'), + ('290', '1885', '2006-02-16T02:30:53', '2005-05-26T01:46:20', '2005-06-01T05:45:20', '1'), + ('120', '1319', '2006-02-16T02:30:53', '2005-07-12T03:18:07', '2005-07-15T00:05:07', '1'), + ('577', '1431', '2006-02-16T02:30:53', '2005-07-29T15:49:37', '2005-08-05T18:20:37', '1'), + ('5', '1522', '2006-02-16T02:30:53', '2005-07-30T23:52:30', '2005-08-08T05:22:30', '1'), + ('490', '50', '2006-02-16T02:30:53', '2005-08-01T21:29:34', '2005-08-10T17:27:34', '1'), + ('471', '4236', '2006-02-16T02:30:53', '2005-07-31T02:17:27', '2005-08-07T03:33:27', '1'), + ('472', '2998', '2006-02-16T02:30:53', '2005-07-11T16:09:42', '2005-07-19T20:46:42', '1'), + ('276', '3207', '2006-02-16T02:30:53', '2005-08-02T07:36:44', '2005-08-04T03:32:44', '1'), + ('423', '3579', '2006-02-16T02:30:53', '2005-07-27T06:55:27', '2005-08-01T11:10:27', '1'), + ('469', '3403', '2006-02-16T02:30:53', '2005-07-09T07:43:22', '2005-07-12T04:52:22', '1'), + ('233', '3739', '2006-02-16T02:30:53', '2005-07-11T18:50:45', '2005-07-12T15:26:45', '1'), + ('343', '3895', '2006-02-16T02:30:53', '2005-08-01T22:54:28', '2005-08-02T17:19:28', '1'), + ('288', '3537', '2006-02-16T02:30:53', '2005-08-22T10:20:55', '2005-08-26T12:37:55', '1'), + ('177', '4359', '2006-02-16T02:30:53', '2005-08-02T11:42:23', '2005-08-03T08:29:23', '1'), + ('347', '3913', '2006-02-16T02:30:53', '2005-07-31T03:05:19', '2005-08-04T07:26:19', '1'), + ('104', '1730', '2006-02-16T02:30:53', '2005-07-09T18:54:08', '2005-07-17T22:01:08', '1'), + ('85', '2646', '2006-02-16T02:30:53', '2005-05-29T00:54:53', '2005-06-06T00:45:53', '1'), + ('172', '3476', '2006-02-16T02:30:53', '2005-08-19T20:21:36', '2005-08-21T16:26:36', '1'), + ('319', '1224', '2006-02-16T02:30:53', '2005-07-12T02:07:59', '2005-07-19T22:56:59', '1'), + ('35', '2280', '2006-02-16T02:30:53', '2005-06-18T03:52:14', '2005-06-23T06:52:14', '1'), + ('504', '1795', '2006-02-16T02:30:53', '2005-06-20T05:17:22', '2005-06-26T09:38:22', '1'), + ('414', '4287', '2006-02-16T02:30:53', '2005-06-18T04:54:29', '2005-06-22T09:14:29', '1'), + ('36', '3079', '2006-02-16T02:30:53', '2005-07-28T01:35:17', '2005-08-01T00:14:17', '1'), + ('304', '2787', '2006-02-16T02:30:53', '2005-06-20T02:45:35', '2005-06-26T07:51:35', '1'), + ('280', '198', '2006-02-16T02:30:53', '2005-08-23T04:48:12', '2005-08-29T05:11:12', '1'), + ('488', '3074', '2006-02-16T02:30:53', '2005-07-27T15:19:33', '2005-08-04T10:45:33', '1'), + ('25', '4428', '2006-02-16T02:30:53', '2005-08-23T20:00:30', '2005-08-30T00:25:30', '1'), + ('171', '575', '2006-02-16T02:30:53', '2005-08-19T06:22:48', '2005-08-27T07:47:48', '1'), + ('133', '3594', '2006-02-16T02:30:53', '2005-08-01T16:56:17', '2005-08-03T18:58:17', '1'), + ('559', '1591', '2006-02-16T02:30:53', '2005-07-07T20:05:36', '2005-07-16T23:58:36', '1'), + ('70', '807', '2006-02-16T02:30:53', '2005-07-10T21:57:14', '2005-07-16T19:32:14', '1'), + ('83', '348', '2006-02-16T02:30:53', '2005-08-20T15:13:11', '2005-08-21T13:11:11', '1'), + ('368', '2202', '2006-02-16T02:30:53', '2005-05-30T15:50:39', '2005-06-03T14:25:39', '1'), + ('566', '3165', '2006-02-16T02:30:53', '2005-07-30T08:47:13', '2005-08-02T12:52:13', '1'), + ('282', '1780', '2006-02-16T02:30:53', '2005-05-25T06:20:46', '2005-06-02T05:42:46', '1'), + ('306', '2954', '2006-02-16T02:30:53', '2005-08-02T09:30:11', '2005-08-05T06:52:11', '1'), + ('597', '3865', '2006-02-16T02:30:53', '2005-07-28T13:57:35', '2005-08-04T13:40:35', '1'), + ('312', '4536', '2006-02-16T02:30:53', '2005-08-21T14:23:01', '2005-08-27T13:56:01', '1'), + ('207', '3079', '2006-02-16T02:30:53', '2005-07-09T01:26:22', '2005-07-12T20:48:22', '1'), + ('22', '532', '2006-02-16T02:30:53', '2005-07-31T03:01:11', '2005-08-05T06:01:11', '1'), + ('273', '4169', '2006-02-16T02:30:53', '2005-05-30T21:45:19', '2005-06-01T20:32:19', '1'), + ('348', '3222', '2006-02-16T02:30:53', '2005-08-01T20:43:02', '2005-08-05T02:32:02', '1'), + ('24', '3968', '2006-02-16T02:30:53', '2005-07-31T08:31:18', '2005-08-03T10:25:18', '1'), + ('230', '295', '2006-02-16T02:30:53', '2005-07-31T19:13:29', '2005-08-06T15:44:29', '1'), + ('579', '4494', '2006-02-16T02:30:53', '2005-06-20T17:46:47', '2005-06-29T19:45:47', '1'), + ('19', '3612', '2006-02-16T02:30:53', '2005-06-21T17:38:02', '2005-06-23T19:47:02', '1'), + ('292', '3295', '2006-02-16T02:30:53', '2005-07-10T22:31:01', '2005-07-14T00:52:01', '1'), + ('416', '1606', '2006-02-16T02:30:53', '2005-07-06T17:54:13', '2005-07-10T14:51:13', '1'), + ('532', '2573', '2006-02-16T02:30:53', '2005-07-09T14:44:23', '2005-07-15T10:48:23', '1'), + ('212', '1644', '2006-02-16T02:30:53', '2005-07-28T15:10:25', '2005-08-06T19:15:25', '1'), + ('583', '587', '2006-02-16T02:30:53', '2005-07-06T23:33:41', '2005-07-16T01:31:41', '1'), + ('104', '1323', '2006-02-16T02:30:53', '2005-08-22T15:52:57', '2005-08-24T21:12:57', '1'), + ('91', '2736', '2006-02-16T02:30:53', '2005-07-29T03:34:21', '2005-08-02T01:32:21', '1'), + ('359', '604', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('73', '4073', '2006-02-16T02:30:53', '2005-08-01T08:47:00', '2005-08-06T08:34:00', '1'), + ('58', '2056', '2006-02-16T02:30:53', '2005-08-21T07:29:05', '2005-08-27T08:18:05', '1'), + ('425', '4279', '2006-02-16T02:30:53', '2005-07-30T11:35:24', '2005-08-05T05:36:24', '1'), + ('233', '805', '2006-02-16T02:30:53', '2005-07-27T03:46:27', '2005-08-05T07:46:27', '1'), + ('451', '4250', '2006-02-16T02:30:53', '2005-08-19T21:36:58', '2005-08-22T23:55:58', '1'), + ('89', '4461', '2006-02-16T02:30:53', '2005-08-18T10:34:59', '2005-08-22T14:42:59', '1'), + ('155', '2047', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('432', '284', '2006-02-16T02:30:53', '2005-08-20T21:21:34', '2005-08-28T17:46:34', '1'), + ('507', '1486', '2006-02-16T02:30:53', '2005-07-28T06:49:35', '2005-08-06T08:16:35', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['4912', '8813', '13629', '2217', '5323', '11855', '13387', '6679', '1835', '10157', '14566', '136', '8940', '2470', '4709', '6058', '3013', '6713', '11844', '11208', '12271', '821', '582', '1145', '1320', '10075', '9348', '15249', '3121', '7785', '8101', '14549', '11298', '6772', '7759', '6003', '1202', '277', '12842', '11248', '8695', '10397', '10948', '4271', '13778', '13207', '11869', '10578', '12922', '1339', '9365', '1861', '7566', '616', '7612', '8458', '5445', '13079', '13534', '8764', '4633', '1824', '6507', '8412', '12114', '1862', '3125', '7112', '4894', '4531', '13187', '5364', '14175', '5637', '713', '1974', '12141', '14241', '14501', '3264', '8904', '2797', '3610', '3487', '12162', '7216', '694', '15102', '7725', '953', '12352', '12117', '8831', '5243', '2424', '4772', '9255', '11727', '1706', '1186']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('275', '2012', '2006-02-16T02:30:53', '2005-07-08T21:26:11', '2005-07-18T02:19:11', '1'), + ('497', '3442', '2006-02-16T02:30:53', '2005-07-29T21:47:55', '2005-08-05T01:16:55', '1'), + ('392', '1834', '2006-02-16T02:30:53', '2005-08-20T07:04:07', '2005-08-25T12:36:07', '1'), + ('118', '2260', '2006-02-16T02:30:53', '2005-06-18T03:12:29', '2005-06-20T06:08:29', '1'), + ('35', '1302', '2006-02-16T02:30:53', '2005-07-09T16:34:07', '2005-07-13T21:37:07', '1'), + ('535', '1062', '2006-02-16T02:30:53', '2005-08-17T13:43:07', '2005-08-26T08:07:07', '1'), + ('504', '123', '2006-02-16T02:30:53', '2005-08-19T21:46:10', '2005-08-24T01:16:10', '1'), + ('586', '3664', '2006-02-16T02:30:53', '2005-07-12T12:01:07', '2005-07-14T11:36:07', '1'), + ('112', '1482', '2006-02-16T02:30:53', '2005-06-16T23:05:36', '2005-06-19T04:46:36', '1'), + ('232', '2960', '2006-02-16T02:30:53', '2005-07-31T22:38:48', '2005-08-01T21:38:48', '1'), + ('87', '84', '2006-02-16T02:30:53', '2005-08-21T16:25:05', '2005-08-26T10:31:05', '1'), + ('504', '2296', '2006-02-16T02:30:53', '2005-05-25T22:02:30', '2005-05-31T18:06:30', '1'), + ('212', '1566', '2006-02-16T02:30:53', '2005-07-30T02:57:26', '2005-08-05T22:05:26', '1'), + ('40', '4319', '2006-02-16T02:30:53', '2005-06-18T20:28:31', '2005-06-25T18:48:31', '1'), + ('124', '3964', '2006-02-16T02:30:53', '2005-07-08T12:04:34', '2005-07-15T06:48:34', '1'), + ('498', '3761', '2006-02-16T02:30:53', '2005-07-11T04:03:51', '2005-07-14T03:52:51', '1'), + ('290', '4146', '2006-02-16T02:30:53', '2005-06-20T10:45:09', '2005-06-26T04:55:09', '1'), + ('557', '4218', '2006-02-16T02:30:53', '2005-07-12T13:27:36', '2005-07-16T11:14:36', '1'), + ('368', '3791', '2006-02-16T02:30:53', '2005-08-17T13:16:04', '2005-08-18T10:16:04', '1'), + ('320', '4566', '2006-02-16T02:30:53', '2005-08-02T12:02:37', '2005-08-05T10:56:37', '1'), + ('471', '3866', '2006-02-16T02:30:53', '2005-08-18T04:33:11', '2005-08-20T23:10:11', '1'), + ('348', '3380', '2006-02-16T02:30:53', '2005-05-29T21:31:12', '2005-06-04T22:49:12', '1'), + ('198', '4579', '2006-02-16T02:30:53', '2005-05-28T11:33:46', '2005-05-29T08:33:46', '1'), + ('284', '1133', '2006-02-16T02:30:53', '2005-05-31T20:13:45', '2005-06-08T02:10:45', '1'), + ('84', '4484', '2006-02-16T02:30:53', '2005-06-15T10:42:13', '2005-06-17T13:44:13', '1'), + ('469', '2037', '2006-02-16T02:30:53', '2005-07-31T19:58:42', '2005-08-08T19:49:42', '1'), + ('87', '3128', '2006-02-16T02:30:53', '2005-07-30T18:17:09', '2005-08-07T15:25:09', '1'), + ('444', '121', '2006-02-16T02:30:53', '2005-08-22T17:58:27', '2005-08-30T14:55:27', '1'), + ('132', '797', '2006-02-16T02:30:53', '2005-06-20T18:23:30', '2005-06-21T20:36:30', '1'), + ('460', '4277', '2006-02-16T02:30:53', '2005-07-28T07:16:11', '2005-08-02T03:43:11', '1'), + ('6', '731', '2006-02-16T02:30:53', '2005-07-28T18:47:23', '2005-07-31T16:23:23', '1'), + ('155', '4117', '2006-02-16T02:30:53', '2005-08-21T15:54:21', '2005-08-22T17:22:21', '1'), + ('35', '1663', '2006-02-16T02:30:53', '2005-08-02T15:32:32', '2005-08-06T20:22:32', '1'), + ('89', '3810', '2006-02-16T02:30:53', '2005-07-12T15:55:35', '2005-07-18T10:47:35', '1'), + ('405', '3381', '2006-02-16T02:30:53', '2005-07-28T06:28:45', '2005-08-03T11:38:45', '1'), + ('527', '296', '2006-02-16T02:30:53', '2005-07-11T01:28:33', '2005-07-17T21:24:33', '1'), + ('451', '2821', '2006-02-16T02:30:53', '2005-06-15T02:08:04', '2005-06-16T21:56:04', '1'), + ('45', '1409', '2006-02-16T02:30:53', '2005-05-26T17:32:11', '2005-05-28T22:54:11', '1'), + ('119', '2540', '2006-02-16T02:30:53', '2005-08-19T01:57:21', '2005-08-28T01:10:21', '1'), + ('312', '4139', '2006-02-16T02:30:53', '2005-08-02T13:35:34', '2005-08-03T10:37:34', '1'), + ('280', '694', '2006-02-16T02:30:53', '2005-07-29T16:44:55', '2005-08-07T12:47:55', '1'), + ('504', '4168', '2006-02-16T02:30:53', '2005-08-01T07:11:27', '2005-08-03T07:51:27', '1'), + ('220', '4429', '2006-02-16T02:30:53', '2005-08-02T03:23:23', '2005-08-05T23:18:23', '1'), + ('150', '533', '2006-02-16T02:30:53', '2005-07-07T14:38:52', '2005-07-15T12:05:52', '1'), + ('539', '2385', '2006-02-16T02:30:53', '2005-08-20T12:03:44', '2005-08-28T12:09:44', '1'), + ('58', '674', '2006-02-16T02:30:53', '2005-08-19T15:14:38', '2005-08-27T16:09:38', '1'), + ('19', '3453', '2006-02-16T02:30:53', '2005-08-17T14:10:22', '2005-08-24T18:39:22', '1'), + ('113', '3704', '2006-02-16T02:30:53', '2005-08-01T13:48:02', '2005-08-07T13:40:02', '1'), + ('25', '342', '2006-02-16T02:30:53', '2005-08-19T04:48:48', '2005-08-23T23:32:48', '1'), + ('162', '424', '2006-02-16T02:30:53', '2005-06-15T12:21:56', '2005-06-19T07:46:56', '1'), + ('232', '1539', '2006-02-16T02:30:53', '2005-07-30T18:46:02', '2005-08-03T20:15:02', '1'), + ('454', '135', '2006-02-16T02:30:53', '2005-06-17T01:17:31', '2005-06-25T02:11:31', '1'), + ('144', '1802', '2006-02-16T02:30:53', '2005-07-27T22:34:45', '2005-08-01T22:20:45', '1'), + ('471', '989', '2006-02-16T02:30:53', '2005-05-28T15:45:39', '2005-06-02T09:55:39', '1'), + ('563', '1411', '2006-02-16T02:30:53', '2005-07-28T00:11:55', '2005-07-30T00:47:55', '1'), + ('317', '3857', '2006-02-16T02:30:53', '2005-07-29T08:05:09', '2005-08-02T03:42:09', '1'), + ('578', '565', '2006-02-16T02:30:53', '2005-07-09T21:59:41', '2005-07-15T00:40:41', '1'), + ('107', '733', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('75', '2476', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('303', '2348', '2006-02-16T02:30:53', '2005-07-29T19:39:04', '2005-08-01T13:52:04', '1'), + ('348', '3178', '2006-02-16T02:30:53', '2005-07-08T08:39:39', '2005-07-15T10:23:39', '1'), + ('575', '2269', '2006-02-16T02:30:53', '2005-06-16T21:51:04', '2005-06-18T18:12:04', '1'), + ('118', '2463', '2006-02-16T02:30:53', '2005-07-12T03:33:12', '2005-07-20T03:56:12', '1'), + ('312', '743', '2006-02-16T02:30:53', '2005-07-29T06:44:50', '2005-08-06T05:04:50', '1'), + ('65', '1405', '2006-02-16T02:30:53', '2005-08-17T23:02:00', '2005-08-26T18:02:00', '1'), + ('553', '3299', '2006-02-16T02:30:53', '2005-06-17T01:29:30', '2005-06-25T20:43:30', '1'), + ('382', '3293', '2006-02-16T02:30:53', '2005-06-20T18:31:58', '2005-06-21T15:03:58', '1'), + ('101', '4056', '2006-02-16T02:30:53', '2005-07-27T05:38:42', '2005-08-03T05:35:42', '1'), + ('286', '1028', '2006-02-16T02:30:53', '2005-07-08T20:21:31', '2005-07-11T01:59:31', '1'), + ('142', '3108', '2006-02-16T02:30:53', '2005-07-08T03:27:59', '2005-07-10T22:48:59', '1'), + ('543', '1944', '2006-02-16T02:30:53', '2005-08-19T14:24:48', '2005-08-20T19:37:48', '1'), + ('366', '2746', '2006-02-16T02:30:53', '2005-07-09T18:24:48', '2005-07-10T12:30:48', '1'), + ('452', '2021', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('45', '4436', '2006-02-16T02:30:53', '2005-07-10T06:31:37', '2005-07-17T01:16:37', '1'), + ('507', '3664', '2006-02-16T02:30:53', '2005-05-29T04:10:17', '2005-06-07T07:13:17', '1'), + ('111', '1979', '2006-02-16T02:30:53', '2005-06-17T09:30:05', '2005-06-21T12:10:05', '1'), + ('101', '731', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('291', '2547', '2006-02-16T02:30:53', '2005-08-21T05:24:55', '2005-08-30T03:33:55', '1'), + ('576', '3588', '2006-02-16T02:30:53', '2005-08-21T14:14:38', '2005-08-25T17:58:38', '1'), + ('340', '1666', '2006-02-16T02:30:53', '2005-06-21T04:19:03', '2005-06-23T01:29:03', '1'), + ('575', '3622', '2006-02-16T02:30:53', '2005-07-30T01:08:33', '2005-08-04T02:33:33', '1'), + ('486', '3222', '2006-02-16T02:30:53', '2005-06-19T19:04:32', '2005-06-20T22:43:32', '1'), + ('348', '1509', '2006-02-16T02:30:53', '2005-07-06T05:36:59', '2005-07-13T07:07:59', '1'), + ('586', '1575', '2006-02-16T02:30:53', '2005-07-05T23:30:36', '2005-07-11T04:00:36', '1'), + ('284', '2697', '2006-02-16T02:30:53', '2005-08-18T00:44:30', '2005-08-25T03:34:30', '1'), + ('292', '1812', '2006-02-16T02:30:53', '2005-07-27T09:27:45', '2005-08-03T13:08:45', '1'), + ('399', '592', '2006-02-16T02:30:53', '2005-05-29T01:49:43', '2005-06-05T06:52:43', '1'), + ('555', '2317', '2006-02-16T02:30:53', '2005-08-22T11:58:58', '2005-08-29T08:37:58', '1'), + ('326', '1922', '2006-02-16T02:30:53', '2005-07-28T04:47:14', '2005-08-04T09:03:14', '1'), + ('210', '2194', '2006-02-16T02:30:53', '2005-05-30T16:34:02', '2005-05-31T20:34:02', '1'), + ('155', '643', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('303', '4140', '2006-02-16T02:30:53', '2005-08-17T23:11:12', '2005-08-22T23:56:12', '1'), + ('13', '3520', '2006-02-16T02:30:53', '2005-07-29T22:37:41', '2005-08-08T04:28:41', '1'), + ('587', '122', '2006-02-16T02:30:53', '2005-07-09T13:22:08', '2005-07-16T09:25:08', '1'), + ('233', '1884', '2006-02-16T02:30:53', '2005-06-18T17:35:08', '2005-06-23T15:33:08', '1'), + ('486', '2156', '2006-02-16T02:30:53', '2005-07-08T15:41:11', '2005-07-17T15:25:11', '1'), + ('23', '1596', '2006-02-16T02:30:53', '2005-07-30T14:26:46', '2005-08-07T18:16:46', '1'), + ('6', '98', '2006-02-16T02:30:53', '2005-08-17T08:12:20', '2005-08-19T12:45:20', '1'), + ('26', '2935', '2006-02-16T02:30:53', '2005-06-16T14:01:02', '2005-06-25T19:29:02', '1'), + ('368', '1556', '2006-02-16T02:30:53', '2005-06-15T00:56:45', '2005-06-16T02:23:45', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['14522', '3522', '14369', '15591', '11671', '8410', '11315', '11870', '6248', '9289', '3838', '10354', '3171', '8899', '2448', '5384', '3296', '14952', '3957', '1195', '5482', '13511', '14605', '12207', '6171', '15829', '5678', '5745', '3642', '15542', '13090', '2195', '8685', '7749', '240', '1966', '10694', '11122', '1336', '6001', '10022', '15788', '4818', '5895', '8306', '10186', '7729', '564', '8663', '9448', '4202', '3485', '1063', '10686', '12733', '13446', '13065', '5160', '15238', '1698', '15362', '1678', '5382', '10480', '6521', '11548', '15291', '275', '6050', '7625', '11243', '1079', '9753', '15969', '15212', '8372', '7528', '2261', '14429', '6381', '12201', '13415', '15813', '470', '6128', '163', '170', '12805', '5913', '6459', '2700', '11102', '3118', '5540', '1895', '8678', '6784', '4655', '7879', '2800']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('535', '2101', '2006-02-16T02:30:53', '2005-08-21T15:01:34', '2005-08-25T16:37:34', '1'), + ('469', '4522', '2006-02-16T02:30:53', '2005-07-06T01:00:21', '2005-07-11T01:18:21', '1'), + ('392', '1636', '2006-02-16T02:30:53', '2005-08-21T09:33:44', '2005-08-25T08:56:44', '1'), + ('62', '64', '2006-02-16T02:30:53', '2005-08-23T06:11:52', '2005-08-25T05:34:52', '1'), + ('338', '3569', '2006-02-16T02:30:53', '2005-08-17T05:50:21', '2005-08-20T03:43:21', '1'), + ('277', '3448', '2006-02-16T02:30:53', '2005-07-29T06:41:36', '2005-08-02T08:38:36', '1'), + ('13', '1116', '2006-02-16T02:30:53', '2005-08-02T16:05:17', '2005-08-05T16:33:17', '1'), + ('432', '4251', '2006-02-16T02:30:53', '2005-08-17T14:11:28', '2005-08-24T16:43:28', '1'), + ('6', '2686', '2006-02-16T02:30:53', '2005-07-11T15:01:54', '2005-07-19T16:58:54', '1'), + ('453', '389', '2006-02-16T02:30:53', '2005-07-30T15:57:04', '2005-08-07T18:46:04', '1'), + ('565', '3404', '2006-02-16T02:30:53', '2005-07-06T16:29:43', '2005-07-11T20:50:43', '1'), + ('416', '1680', '2006-02-16T02:30:53', '2005-08-01T05:47:10', '2005-08-06T09:04:10', '1'), + ('140', '2838', '2006-02-16T02:30:53', '2005-06-20T22:15:47', '2005-06-24T18:14:47', '1'), + ('252', '4148', '2006-02-16T02:30:53', '2005-07-30T01:05:30', '2005-08-01T23:32:30', '1'), + ('308', '1642', '2006-02-16T02:30:53', '2005-06-18T19:13:45', '2005-06-27T14:43:45', '1'), + ('180', '1729', '2006-02-16T02:30:53', '2005-07-09T19:17:46', '2005-07-12T13:50:46', '1'), + ('284', '2453', '2006-02-16T02:30:53', '2005-06-21T07:04:53', '2005-06-25T08:36:53', '1'), + ('575', '2950', '2006-02-16T02:30:53', '2005-08-22T06:20:07', '2005-08-28T01:18:07', '1'), + ('414', '443', '2006-02-16T02:30:53', '2005-07-06T22:05:47', '2005-07-16T01:08:47', '1'), + ('84', '2272', '2006-02-16T02:30:53', '2005-06-15T01:37:38', '2005-06-17T21:50:38', '1'), + ('460', '2136', '2006-02-16T02:30:53', '2005-07-09T23:53:04', '2005-07-15T04:59:04', '1'), + ('23', '2973', '2006-02-16T02:30:53', '2005-08-20T02:21:40', '2005-08-21T03:26:40', '1'), + ('394', '476', '2006-02-16T02:30:53', '2005-08-21T17:56:06', '2005-08-24T18:35:06', '1'), + ('265', '3745', '2006-02-16T02:30:53', '2005-08-18T02:24:07', '2005-08-22T07:53:07', '1'), + ('491', '448', '2006-02-16T02:30:53', '2005-07-11T10:29:35', '2005-07-16T12:01:35', '1'), + ('30', '4387', '2006-02-16T02:30:53', '2005-08-23T15:17:14', '2005-08-27T13:04:14', '1'), + ('96', '4366', '2006-02-16T02:30:53', '2005-07-10T08:42:42', '2005-07-19T03:48:42', '1'), + ('305', '41', '2006-02-16T02:30:53', '2005-07-10T12:10:11', '2005-07-19T06:56:11', '1'), + ('166', '4204', '2006-02-16T02:30:53', '2005-07-06T07:18:20', '2005-07-09T01:37:20', '1'), + ('111', '21', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('52', '1447', '2006-02-16T02:30:53', '2005-08-19T10:39:54', '2005-08-28T10:31:54', '1'), + ('286', '2247', '2006-02-16T02:30:53', '2005-06-18T01:44:46', '2005-06-25T20:50:46', '1'), + ('321', '1827', '2006-02-16T02:30:53', '2005-07-29T16:17:05', '2005-08-07T17:44:05', '1'), + ('232', '3585', '2006-02-16T02:30:53', '2005-07-28T05:53:36', '2005-08-01T03:49:36', '1'), + ('103', '3420', '2006-02-16T02:30:53', '2005-05-26T12:40:23', '2005-06-04T07:22:23', '1'), + ('6', '2085', '2006-02-16T02:30:53', '2005-06-17T09:19:45', '2005-06-20T11:19:45', '1'), + ('98', '3429', '2006-02-16T02:30:53', '2005-08-01T18:15:07', '2005-08-10T15:38:07', '1'), + ('383', '3021', '2006-02-16T02:30:53', '2005-08-02T08:49:09', '2005-08-08T04:33:09', '1'), + ('290', '1696', '2006-02-16T02:30:53', '2005-06-15T12:01:34', '2005-06-23T12:05:34', '1'), + ('45', '1779', '2006-02-16T02:30:53', '2005-07-11T01:24:44', '2005-07-11T22:55:44', '1'), + ('115', '1900', '2006-02-16T02:30:53', '2005-07-31T18:25:30', '2005-08-04T13:35:30', '1'), + ('269', '13', '2006-02-16T02:30:53', '2005-08-23T13:54:39', '2005-08-26T10:17:39', '1'), + ('144', '115', '2006-02-16T02:30:53', '2005-07-08T17:18:22', '2005-07-14T14:40:22', '1'), + ('164', '2272', '2006-02-16T02:30:53', '2005-07-10T20:13:19', '2005-07-17T17:51:19', '1'), + ('232', '1708', '2006-02-16T02:30:53', '2005-07-29T03:12:26', '2005-08-01T23:26:26', '1'), + ('294', '4563', '2006-02-16T02:30:53', '2005-08-01T00:12:36', '2005-08-07T05:08:36', '1'), + ('89', '1491', '2006-02-16T02:30:53', '2005-07-28T04:57:57', '2005-07-30T09:38:57', '1'), + ('282', '2973', '2006-02-16T02:30:53', '2005-05-28T09:12:09', '2005-05-29T05:07:09', '1'), + ('214', '1281', '2006-02-16T02:30:53', '2005-07-29T15:33:18', '2005-07-30T18:03:18', '1'), + ('278', '1213', '2006-02-16T02:30:53', '2005-07-30T21:56:13', '2005-08-04T18:03:13', '1'), + ('38', '2274', '2006-02-16T02:30:53', '2005-07-07T11:23:48', '2005-07-16T16:32:48', '1'), + ('111', '117', '2006-02-16T02:30:53', '2005-07-05T23:25:54', '2005-07-09T17:38:54', '1'), + ('7', '2484', '2006-02-16T02:30:53', '2005-05-31T08:44:29', '2005-06-09T08:00:29', '1'), + ('150', '2542', '2006-02-16T02:30:53', '2005-08-01T17:51:21', '2005-08-03T19:01:21', '1'), + ('144', '3243', '2006-02-16T02:30:53', '2005-08-18T21:59:00', '2005-08-24T02:25:00', '1'), + ('488', '3226', '2006-02-16T02:30:53', '2005-08-20T00:06:13', '2005-08-22T19:56:13', '1'), + ('518', '1887', '2006-02-16T02:30:53', '2005-08-19T09:48:52', '2005-08-22T07:12:52', '1'), + ('467', '1925', '2006-02-16T02:30:53', '2005-07-09T08:57:07', '2005-07-18T06:01:07', '1'), + ('70', '403', '2006-02-16T02:30:53', '2005-08-22T17:46:12', '2005-08-29T16:41:12', '1'), + ('407', '1474', '2006-02-16T02:30:53', '2005-06-16T13:04:42', '2005-06-21T15:54:42', '1'), + ('497', '1023', '2006-02-16T02:30:53', '2005-08-22T21:40:20', '2005-08-29T15:55:20', '1'), + ('352', '1856', '2006-02-16T02:30:53', '2005-06-16T11:08:28', '2005-06-19T15:44:28', '1'), + ('586', '78', '2006-02-16T02:30:53', '2005-07-09T19:12:57', '2005-07-14T15:44:57', '1'), + ('560', '553', '2006-02-16T02:30:53', '2005-08-01T10:13:41', '2005-08-03T10:27:41', '1'), + ('49', '3293', '2006-02-16T02:30:53', '2005-07-12T04:06:11', '2005-07-21T05:50:11', '1'), + ('323', '480', '2006-02-16T02:30:53', '2005-08-17T00:59:47', '2005-08-22T05:09:47', '1'), + ('494', '1461', '2006-02-16T02:30:53', '2005-08-22T19:28:04', '2005-08-26T15:07:04', '1'), + ('133', '1718', '2006-02-16T02:30:53', '2005-05-26T17:09:53', '2005-06-04T22:35:53', '1'), + ('527', '825', '2006-02-16T02:30:53', '2005-07-11T03:34:29', '2005-07-15T02:55:29', '1'), + ('382', '3129', '2006-02-16T02:30:53', '2005-07-28T00:47:56', '2005-08-02T23:34:56', '1'), + ('361', '2517', '2006-02-16T02:30:53', '2005-08-02T13:32:48', '2005-08-11T18:55:48', '1'), + ('312', '268', '2006-02-16T02:30:53', '2005-05-31T10:48:17', '2005-06-08T12:30:17', '1'), + ('98', '3529', '2006-02-16T02:30:53', '2005-07-31T09:22:38', '2005-08-01T08:45:38', '1'), + ('327', '1807', '2006-02-16T02:30:53', '2005-08-23T19:51:30', '2005-08-31T23:50:30', '1'), + ('562', '2182', '2006-02-16T02:30:53', '2005-08-22T16:44:26', '2005-08-27T20:26:26', '1'), + ('523', '754', '2006-02-16T02:30:53', '2005-07-29T05:18:08', '2005-08-06T09:39:08', '1'), + ('213', '1218', '2006-02-16T02:30:53', '2005-07-27T21:15:25', '2005-08-03T19:12:25', '1'), + ('570', '1763', '2006-02-16T02:30:53', '2005-06-18T05:46:15', '2005-06-24T05:06:15', '1'), + ('66', '2513', '2006-02-16T02:30:53', '2005-08-21T11:29:43', '2005-08-24T12:05:43', '1'), + ('340', '2584', '2006-02-16T02:30:53', '2005-07-11T21:58:48', '2005-07-16T16:18:48', '1'), + ('540', '3676', '2006-02-16T02:30:53', '2005-08-18T02:14:06', '2005-08-23T04:44:06', '1'), + ('181', '1105', '2006-02-16T02:30:53', '2005-08-19T22:48:09', '2005-08-25T02:09:09', '1'), + ('9', '981', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('504', '1613', '2006-02-16T02:30:53', '2005-05-27T21:17:08', '2005-06-04T17:47:08', '1'), + ('18', '2050', '2006-02-16T02:30:53', '2005-07-11T08:15:08', '2005-07-13T03:36:08', '1'), + ('104', '2306', '2006-02-16T02:30:53', '2005-05-26T02:26:23', '2005-06-04T06:36:23', '1'), + ('107', '3688', '2006-02-16T02:30:53', '2005-05-26T03:11:12', '2005-06-02T03:53:12', '1'), + ('345', '2964', '2006-02-16T02:30:53', '2005-08-19T00:36:34', '2005-08-26T20:38:34', '1'), + ('277', '2767', '2006-02-16T02:30:53', '2005-07-10T20:58:55', '2005-07-13T15:18:55', '1'), + ('557', '4025', '2006-02-16T02:30:53', '2005-07-12T01:12:03', '2005-07-15T23:48:03', '1'), + ('180', '928', '2006-02-16T02:30:53', '2005-06-19T13:31:52', '2005-06-27T19:30:52', '1'), + ('73', '3112', '2006-02-16T02:30:53', '2005-08-02T08:08:30', '2005-08-04T09:16:30', '1'), + ('125', '1258', '2006-02-16T02:30:53', '2005-06-20T18:05:57', '2005-06-23T23:01:57', '1'), + ('250', '132', '2006-02-16T02:30:53', '2005-07-10T02:44:21', '2005-07-11T07:13:21', '1'), + ('30', '680', '2006-02-16T02:30:53', '2005-06-17T04:25:12', '2005-06-26T08:44:12', '1'), + ('210', '3991', '2006-02-16T02:30:53', '2005-07-29T16:04:00', '2005-08-05T12:37:00', '1'), + ('578', '197', '2006-02-16T02:30:53', '2005-07-12T16:28:49', '2005-07-15T17:27:49', '1'), + ('213', '4078', '2006-02-16T02:30:53', '2005-07-08T09:49:22', '2005-07-15T13:08:22', '1'), + ('125', '1969', '2006-02-16T02:30:53', '2005-07-28T10:27:46', '2005-07-31T07:48:46', '1'), + ('146', '183', '2006-02-16T02:30:53', '2005-06-19T19:15:56', '2005-06-23T00:15:56', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['2573', '15378', '10474', '4322', '85', '11793', '15363', '9481', '1669', '3566', '7909', '13060', '9437', '15490', '15560', '12594', '15257', '13994', '15909', '6598', '4713', '336', '3458', '5859', '2883', '17', '6861', '2479', '13657', '5020', '15256', '13665', '12447', '3950', '13278', '6914', '6229', '13937', '15242', '3603', '3910', '14885', '11013', '10808', '2497', '11145', '12358', '14261', '2979', '6701', '11952', '947', '8222', '3632', '4605', '16017', '15017', '4976', '11959', '2918', '13451', '3989', '7603', '11074', '8593', '1405', '4362', '14401', '13448', '15677', '13098', '4786', '13006', '11592', '3316', '9449', '2210', '10387', '7384', '6357', '1004', '11683', '12931', '6145', '13692', '506', '7415', '4962', '941', '10331', '9896', '5108', '3699', '2131', '3232', '11369', '7121', '8541', '4965', '1531']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('563', '3354', '2006-02-16T02:30:53', '2005-06-19T04:23:18', '2005-06-23T06:04:18', '1'), + ('340', '1483', '2006-02-16T02:30:53', '2005-08-22T22:25:17', '2005-08-30T17:04:17', '1'), + ('488', '4482', '2006-02-16T02:30:53', '2005-08-01T10:01:42', '2005-08-08T12:32:42', '1'), + ('568', '1522', '2006-02-16T02:30:53', '2005-07-07T17:54:37', '2005-07-14T13:56:37', '1'), + ('414', '470', '2006-02-16T02:30:53', '2005-05-25T13:05:34', '2005-05-29T16:53:34', '1'), + ('352', '1955', '2006-02-16T02:30:53', '2005-08-17T11:05:53', '2005-08-25T12:25:53', '1'), + ('480', '2326', '2006-02-16T02:30:53', '2005-08-22T21:41:40', '2005-08-23T21:40:40', '1'), + ('481', '613', '2006-02-16T02:30:53', '2005-07-30T23:26:05', '2005-08-04T17:46:05', '1'), + ('73', '360', '2006-02-16T02:30:53', '2005-06-16T10:20:20', '2005-06-18T04:26:20', '1'), + ('392', '2774', '2006-02-16T02:30:53', '2005-07-06T03:08:51', '2005-07-12T05:04:51', '1'), + ('210', '3355', '2006-02-16T02:30:53', '2005-07-28T11:38:08', '2005-07-29T13:54:08', '1'), + ('22', '507', '2006-02-16T02:30:53', '2005-08-19T09:43:25', '2005-08-28T15:22:25', '1'), + ('592', '1230', '2006-02-16T02:30:53', '2005-07-30T21:36:04', '2005-08-08T01:26:04', '1'), + ('493', '3922', '2006-02-16T02:30:53', '2005-08-23T02:08:18', '2005-08-30T06:15:18', '1'), + ('107', '3616', '2006-02-16T02:30:53', '2005-08-23T05:01:13', '2005-09-01T05:02:13', '1'), + ('198', '4421', '2006-02-16T02:30:53', '2005-08-18T16:24:24', '2005-08-25T15:45:24', '1'), + ('223', '915', '2006-02-16T02:30:53', '2005-08-22T18:21:04', '2005-08-30T20:13:04', '1'), + ('180', '142', '2006-02-16T02:30:53', '2005-08-20T19:33:21', '2005-08-24T20:55:21', '1'), + ('452', '404', '2006-02-16T02:30:53', '2005-08-23T17:42:42', '2005-08-26T20:25:42', '1'), + ('532', '2049', '2006-02-16T02:30:53', '2005-07-12T07:38:25', '2005-07-19T07:58:25', '1'), + ('207', '1399', '2006-02-16T02:30:53', '2005-07-08T12:12:33', '2005-07-16T17:13:33', '1'), + ('275', '1811', '2006-02-16T02:30:53', '2005-05-27T03:15:23', '2005-05-29T22:43:23', '1'), + ('338', '2136', '2006-02-16T02:30:53', '2005-06-21T21:42:49', '2005-06-29T01:26:49', '1'), + ('220', '131', '2006-02-16T02:30:53', '2005-07-10T18:02:02', '2005-07-11T23:24:02', '1'), + ('320', '585', '2006-02-16T02:30:53', '2005-06-20T01:29:10', '2005-06-28T06:12:10', '1'), + ('575', '830', '2006-02-16T02:30:53', '2005-05-25T01:06:36', '2005-05-27T00:43:36', '1'), + ('83', '354', '2006-02-16T02:30:53', '2005-07-12T19:56:52', '2005-07-13T16:02:52', '1'), + ('408', '1624', '2006-02-16T02:30:53', '2005-06-18T21:03:08', '2005-06-22T16:49:08', '1'), + ('414', '1752', '2006-02-16T02:30:53', '2005-08-20T08:01:39', '2005-08-23T07:31:39', '1'), + ('565', '4113', '2006-02-16T02:30:53', '2005-07-09T02:07:56', '2005-07-09T23:59:56', '1'), + ('198', '1873', '2006-02-16T02:30:53', '2005-08-22T18:20:07', '2005-08-28T12:57:07', '1'), + ('291', '117', '2006-02-16T02:30:53', '2005-08-20T08:19:20', '2005-08-28T06:26:20', '1'), + ('469', '4084', '2006-02-16T02:30:53', '2005-08-18T10:57:01', '2005-08-27T06:05:01', '1'), + ('598', '4153', '2006-02-16T02:30:53', '2005-07-06T21:48:44', '2005-07-14T02:25:44', '1'), + ('282', '2691', '2006-02-16T02:30:53', '2005-08-19T17:57:53', '2005-08-22T23:16:53', '1'), + ('361', '496', '2006-02-16T02:30:53', '2005-07-12T22:26:56', '2005-07-17T20:03:56', '1'), + ('399', '3137', '2006-02-16T02:30:53', '2005-07-11T13:59:50', '2005-07-20T09:26:50', '1'), + ('172', '1755', '2006-02-16T02:30:53', '2005-08-20T17:22:51', '2005-08-27T15:51:51', '1'), + ('364', '2106', '2006-02-16T02:30:53', '2005-08-22T17:48:10', '2005-08-27T23:32:10', '1'), + ('330', '2442', '2006-02-16T02:30:53', '2005-07-06T05:25:03', '2005-07-12T08:14:03', '1'), + ('248', '2085', '2006-02-16T02:30:53', '2005-07-06T20:05:18', '2005-07-10T18:51:18', '1'), + ('248', '2097', '2006-02-16T02:30:53', '2005-08-22T03:58:29', '2005-08-30T05:26:29', '1'), + ('527', '2993', '2006-02-16T02:30:53', '2005-08-02T05:10:54', '2005-08-10T08:59:54', '1'), + ('480', '596', '2006-02-16T02:30:53', '2005-08-01T22:37:11', '2005-08-09T02:37:11', '1'), + ('171', '2327', '2006-02-16T02:30:53', '2005-06-18T22:50:40', '2005-06-26T22:39:40', '1'), + ('291', '1270', '2006-02-16T02:30:53', '2005-08-02T09:43:24', '2005-08-05T15:29:24', '1'), + ('16', '504', '2006-02-16T02:30:53', '2005-08-18T07:41:43', '2005-08-20T03:46:43', '1'), + ('166', '1426', '2006-02-16T02:30:53', '2005-08-21T06:07:24', '2005-08-26T09:57:24', '1'), + ('589', '3961', '2006-02-16T02:30:53', '2005-06-20T08:31:05', '2005-06-27T12:25:05', '1'), + ('454', '3428', '2006-02-16T02:30:53', '2005-07-12T12:47:59', '2005-07-13T10:28:59', '1'), + ('288', '2411', '2006-02-16T02:30:53', '2005-08-17T17:14:57', '2005-08-19T19:15:57', '1'), + ('62', '4478', '2006-02-16T02:30:53', '2005-05-30T15:36:57', '2005-06-04T18:48:57', '1'), + ('278', '2999', '2006-02-16T02:30:53', '2005-07-28T23:51:53', '2005-08-05T22:48:53', '1'), + ('366', '2583', '2006-02-16T02:30:53', '2005-07-06T06:38:21', '2005-07-11T03:19:21', '1'), + ('523', '1139', '2006-02-16T02:30:53', '2005-07-08T07:00:14', '2005-07-16T08:38:14', '1'), + ('535', '664', '2006-02-16T02:30:53', '2005-08-23T21:27:11', '2005-08-24T23:22:11', '1'), + ('144', '3975', '2006-02-16T02:30:53', '2005-08-22T08:47:44', '2005-08-29T08:16:44', '1'), + ('199', '617', '2006-02-16T02:30:53', '2005-07-09T00:03:30', '2005-07-10T19:05:30', '1'), + ('101', '2694', '2006-02-16T02:30:53', '2005-08-17T17:23:35', '2005-08-20T20:57:35', '1'), + ('215', '1985', '2006-02-16T02:30:53', '2005-06-20T04:09:04', '2005-06-21T10:07:04', '1'), + ('6', '3837', '2006-02-16T02:30:53', '2005-08-20T00:18:25', '2005-08-29T01:08:25', '1'), + ('213', '2366', '2006-02-16T02:30:53', '2005-07-06T23:30:54', '2005-07-12T01:28:54', '1'), + ('497', '124', '2006-02-16T02:30:53', '2005-07-27T23:54:44', '2005-07-29T01:24:44', '1'), + ('277', '1439', '2006-02-16T02:30:53', '2005-08-02T07:21:43', '2005-08-08T05:18:43', '1'), + ('181', '2601', '2006-02-16T02:30:53', '2005-07-29T12:38:14', '2005-08-07T07:04:14', '1'), + ('243', '3184', '2006-02-16T02:30:53', '2005-06-15T16:41:26', '2005-06-21T18:16:26', '1'), + ('425', '3759', '2006-02-16T02:30:53', '2005-07-07T19:35:30', '2005-07-14T14:59:30', '1'), + ('407', '3468', '2006-02-16T02:30:53', '2005-08-21T10:36:20', '2005-08-30T06:45:20', '1'), + ('327', '2870', '2006-02-16T02:30:53', '2005-08-20T00:12:43', '2005-08-25T02:33:43', '1'), + ('109', '2050', '2006-02-16T02:30:53', '2005-08-23T09:23:36', '2005-08-27T05:01:36', '1'), + ('51', '3770', '2006-02-16T02:30:53', '2005-08-19T10:51:59', '2005-08-24T11:27:59', '1'), + ('294', '2724', '2006-02-16T02:30:53', '2005-07-08T16:13:05', '2005-07-16T15:29:05', '1'), + ('134', '3157', '2006-02-16T02:30:53', '2005-08-19T07:47:16', '2005-08-21T06:17:16', '1'), + ('383', '720', '2006-02-16T02:30:53', '2005-08-17T02:36:04', '2005-08-19T00:31:04', '1'), + ('451', '3271', '2006-02-16T02:30:53', '2005-06-21T08:20:18', '2005-06-28T07:44:18', '1'), + ('581', '2', '2006-02-16T02:30:53', '2005-07-30T22:02:34', '2005-08-06T02:09:34', '1'), + ('108', '219', '2006-02-16T02:30:53', '2005-06-18T02:27:01', '2005-06-21T00:45:01', '1'), + ('87', '1651', '2006-02-16T02:30:53', '2005-08-01T06:42:31', '2005-08-08T07:44:31', '1'), + ('585', '3573', '2006-02-16T02:30:53', '2005-07-27T15:49:45', '2005-08-04T15:17:45', '1'), + ('252', '658', '2006-02-16T02:30:53', '2005-07-11T20:58:51', '2005-07-12T15:06:51', '1'), + ('565', '1588', '2006-02-16T02:30:53', '2005-05-31T00:48:36', '2005-06-01T20:56:36', '1'), + ('66', '2603', '2006-02-16T02:30:53', '2005-08-17T06:15:17', '2005-08-26T05:33:17', '1'), + ('407', '3070', '2006-02-16T02:30:53', '2005-08-19T05:11:47', '2005-08-21T00:59:47', '1'), + ('540', '1359', '2006-02-16T02:30:53', '2005-07-11T09:07:01', '2005-07-19T08:21:01', '1'), + ('65', '1928', '2006-02-16T02:30:53', '2005-08-20T09:07:52', '2005-08-21T05:17:52', '1'), + ('469', '667', '2006-02-16T02:30:53', '2005-05-28T02:09:19', '2005-06-05T20:34:19', '1'), + ('294', '4410', '2006-02-16T02:30:53', '2005-07-27T16:50:59', '2005-08-02T11:21:59', '1'), + ('532', '4399', '2006-02-16T02:30:53', '2005-07-08T23:36:13', '2005-07-15T03:39:13', '1'), + ('562', '3630', '2006-02-16T02:30:53', '2005-05-30T15:02:25', '2005-06-01T17:19:25', '1'), + ('575', '4152', '2006-02-16T02:30:53', '2005-08-01T04:57:14', '2005-08-07T06:46:14', '1'), + ('586', '2591', '2006-02-16T02:30:53', '2005-07-31T14:09:48', '2005-08-01T20:02:48', '1'), + ('30', '4229', '2006-02-16T02:30:53', '2005-07-09T06:44:30', '2005-07-17T04:24:30', '1'), + ('262', '418', '2006-02-16T02:30:53', '2005-07-06T10:11:25', '2005-07-14T05:18:25', '1'), + ('85', '4424', '2006-02-16T02:30:53', '2005-06-17T21:02:25', '2005-06-25T18:45:25', '1'), + ('555', '1972', '2006-02-16T02:30:53', '2005-06-21T02:30:37', '2005-06-29T03:10:37', '1'), + ('480', '2480', '2006-02-16T02:30:53', '2005-08-02T18:04:41', '2005-08-09T18:41:41', '1'), + ('252', '1264', '2006-02-16T02:30:53', '2005-07-27T05:58:32', '2005-07-29T06:14:32', '1'), + ('340', '976', '2006-02-16T02:30:53', '2005-07-29T10:55:01', '2005-07-31T10:53:01', '1'), + ('432', '535', '2006-02-16T02:30:53', '2005-07-08T23:46:57', '2005-07-15T18:47:57', '1'), + ('515', '1388', '2006-02-16T02:30:53', '2005-06-16T00:40:34', '2005-06-22T02:44:34', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['3998', '1516', '11474', '5972', '3267', '9352', '4956', '11719', '1703', '6086', '1616', '11355', '15900', '14710', '14101', '6582', '5452', '3446', '6059', '5134', '773', '12118', '748', '12590', '6183', '1492', '3461', '4201', '14659', '13712', '2266', '11416', '14852', '13743', '5776', '14644', '3234', '1115', '3905', '10848', '1620', '9779', '12096', '2657', '10199', '2012', '6495', '13900', '12549', '8797', '6154', '766', '11744', '3203', '10673', '10718', '9901', '15126', '7876', '11103', '15506', '13934', '3556', '9967', '6826', '11344', '15652', '1998', '2409', '11994', '13096', '12222', '8239', '9175', '7135', '5946', '9336', '11981', '11878', '7864', '4732', '7155', '9080', '11120', '7801', '13061', '13604', '10049', '2534', '15024', '12002', '14000', '10236', '12637', '12178', '7970', '3274', '121', '6042', '5848']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('566', '1245', '2006-02-16T02:30:53', '2005-07-06T23:49:20', '2005-07-12T20:39:20', '1'), + ('530', '3702', '2006-02-16T02:30:53', '2005-06-15T23:11:10', '2005-06-17T20:37:10', '1'), + ('214', '574', '2006-02-16T02:30:53', '2005-08-02T21:53:08', '2005-08-05T22:36:08', '1'), + ('30', '4577', '2006-02-16T02:30:53', '2005-07-11T00:08:54', '2005-07-17T21:01:54', '1'), + ('134', '1118', '2006-02-16T02:30:53', '2005-06-21T04:55:21', '2005-06-29T23:46:21', '1'), + ('360', '2619', '2006-02-16T02:30:53', '2005-07-30T18:29:26', '2005-07-31T19:43:26', '1'), + ('477', '1512', '2006-02-16T02:30:53', '2005-07-08T23:17:10', '2005-07-18T00:14:10', '1'), + ('338', '2054', '2006-02-16T02:30:53', '2005-08-17T07:46:05', '2005-08-23T08:52:05', '1'), + ('589', '2346', '2006-02-16T02:30:53', '2005-06-16T13:28:44', '2005-06-17T11:03:44', '1'), + ('420', '1505', '2006-02-16T02:30:53', '2005-07-11T05:29:03', '2005-07-16T01:17:03', '1'), + ('204', '2296', '2006-02-16T02:30:53', '2005-06-16T07:04:52', '2005-06-24T04:06:52', '1'), + ('185', '2673', '2006-02-16T02:30:53', '2005-08-02T17:37:43', '2005-08-05T19:59:43', '1'), + ('562', '1112', '2006-02-16T02:30:53', '2005-08-23T17:16:30', '2005-08-27T18:02:30', '1'), + ('587', '1922', '2006-02-16T02:30:53', '2005-08-21T21:15:23', '2005-08-30T19:45:23', '1'), + ('19', '1892', '2006-02-16T02:30:53', '2005-08-21T00:33:03', '2005-08-24T01:59:03', '1'), + ('420', '2077', '2006-02-16T02:30:53', '2005-07-12T06:28:12', '2005-07-19T06:19:12', '1'), + ('80', '2036', '2006-02-16T02:30:53', '2005-07-09T22:23:21', '2005-07-17T00:20:21', '1'), + ('174', '1817', '2006-02-16T02:30:53', '2005-06-21T20:45:51', '2005-06-26T17:02:51', '1'), + ('394', '1437', '2006-02-16T02:30:53', '2005-07-11T04:03:54', '2005-07-18T01:35:54', '1'), + ('491', '149', '2006-02-16T02:30:53', '2005-07-09T07:53:12', '2005-07-16T05:30:12', '1'), + ('563', '245', '2006-02-16T02:30:53', '2005-05-29T13:18:05', '2005-06-07T17:22:05', '1'), + ('89', '158', '2006-02-16T02:30:53', '2005-08-17T23:14:25', '2005-08-26T22:26:25', '1'), + ('7', '2803', '2006-02-16T02:30:53', '2005-05-29T09:27:00', '2005-06-03T04:25:00', '1'), + ('308', '2624', '2006-02-16T02:30:53', '2005-08-18T16:11:35', '2005-08-23T10:35:35', '1'), + ('402', '856', '2006-02-16T02:30:53', '2005-07-11T11:14:35', '2005-07-16T15:35:35', '1'), + ('360', '4148', '2006-02-16T02:30:53', '2005-06-15T21:48:35', '2005-06-17T17:18:35', '1'), + ('23', '1715', '2006-02-16T02:30:53', '2005-06-21T21:49:18', '2005-06-26T19:51:18', '1'), + ('145', '3682', '2006-02-16T02:30:53', '2005-07-07T11:19:51', '2005-07-16T08:48:51', '1'), + ('119', '928', '2006-02-16T02:30:53', '2005-08-21T19:42:36', '2005-08-26T14:06:36', '1'), + ('581', '1039', '2006-02-16T02:30:53', '2005-08-20T09:38:04', '2005-08-21T06:10:04', '1'), + ('452', '2596', '2006-02-16T02:30:53', '2005-06-18T06:05:02', '2005-06-20T06:54:02', '1'), + ('58', '1848', '2006-02-16T02:30:53', '2005-08-02T19:44:04', '2005-08-11T15:30:04', '1'), + ('352', '2262', '2006-02-16T02:30:53', '2005-08-22T02:25:53', '2005-08-25T04:27:53', '1'), + ('57', '3693', '2006-02-16T02:30:53', '2005-08-20T10:51:27', '2005-08-24T15:54:27', '1'), + ('568', '3592', '2006-02-16T02:30:53', '2005-07-10T13:35:22', '2005-07-12T17:58:22', '1'), + ('453', '3905', '2006-02-16T02:30:53', '2005-08-21T19:12:12', '2005-08-29T17:08:12', '1'), + ('459', '3252', '2006-02-16T02:30:53', '2005-06-21T02:39:44', '2005-06-29T07:27:44', '1'), + ('109', '2140', '2006-02-16T02:30:53', '2005-05-31T16:07:09', '2005-06-04T18:51:09', '1'), + ('526', '3817', '2006-02-16T02:30:53', '2005-07-06T19:33:34', '2005-07-15T17:55:34', '1'), + ('368', '2630', '2006-02-16T02:30:53', '2005-08-01T23:50:22', '2005-08-06T00:52:22', '1'), + ('561', '389', '2006-02-16T02:30:53', '2005-06-16T07:21:30', '2005-06-17T09:46:30', '1'), + ('402', '1280', '2006-02-16T02:30:53', '2005-07-31T10:08:33', '2005-08-03T14:56:33', '1'), + ('463', '44', '2006-02-16T02:30:53', '2005-08-17T22:32:50', '2005-08-25T03:33:50', '1'), + ('19', '3595', '2006-02-16T02:30:53', '2005-06-19T10:42:59', '2005-06-28T12:37:59', '1'), + ('526', '3665', '2006-02-16T02:30:53', '2005-08-01T00:38:55', '2005-08-05T03:41:55', '1'), + ('84', '3588', '2006-02-16T02:30:53', '2005-06-17T11:57:15', '2005-06-24T17:18:15', '1'), + ('19', '2440', '2006-02-16T02:30:53', '2005-07-12T02:57:02', '2005-07-14T08:35:02', '1'), + ('66', '1140', '2006-02-16T02:30:53', '2005-08-20T16:05:41', '2005-08-22T15:13:41', '1'), + ('377', '1010', '2006-02-16T02:30:53', '2005-08-18T14:38:07', '2005-08-21T08:45:07', '1'), + ('566', '2929', '2006-02-16T02:30:53', '2005-07-29T21:10:37', '2005-08-07T21:43:37', '1'), + ('368', '2717', '2006-02-16T02:30:53', '2005-07-11T09:32:19', '2005-07-16T15:10:19', '1'), + ('383', '2154', '2006-02-16T02:30:53', '2005-05-29T11:47:02', '2005-06-06T07:14:02', '1'), + ('26', '297', '2006-02-16T02:30:53', '2005-08-17T08:54:30', '2005-08-25T03:28:30', '1'), + ('158', '442', '2006-02-16T02:30:53', '2005-06-21T00:34:56', '2005-06-29T23:30:56', '1'), + ('528', '2735', '2006-02-16T02:30:53', '2005-08-01T17:11:51', '2005-08-03T13:32:51', '1'), + ('394', '2763', '2006-02-16T02:30:53', '2005-08-01T18:55:38', '2005-08-04T14:45:38', '1'), + ('277', '3332', '2006-02-16T02:30:53', '2005-07-31T14:20:59', '2005-08-03T09:30:59', '1'), + ('459', '1902', '2006-02-16T02:30:53', '2005-08-22T12:53:58', '2005-08-28T07:39:58', '1'), + ('577', '3563', '2006-02-16T02:30:53', '2005-07-28T10:24:22', '2005-08-04T07:15:22', '1'), + ('158', '1879', '2006-02-16T02:30:53', '2005-08-02T08:09:54', '2005-08-07T12:05:54', '1'), + ('553', '1914', '2006-02-16T02:30:53', '2005-08-23T02:48:24', '2005-08-28T04:10:24', '1'), + ('457', '4567', '2006-02-16T02:30:53', '2005-08-20T17:18:48', '2005-08-26T15:31:48', '1'), + ('273', '3142', '2006-02-16T02:30:53', '2005-07-06T02:46:13', '2005-07-06T22:08:13', '1'), + ('537', '958', '2006-02-16T02:30:53', '2005-07-31T16:31:17', '2005-08-06T13:52:17', '1'), + ('408', '1708', '2006-02-16T02:30:53', '2005-07-12T18:32:02', '2005-07-16T23:21:02', '1'), + ('38', '365', '2006-02-16T02:30:53', '2005-08-02T17:13:26', '2005-08-07T16:44:26', '1'), + ('578', '4440', '2006-02-16T02:30:53', '2005-08-23T08:34:10', '2005-08-30T12:31:10', '1'), + ('562', '4365', '2006-02-16T02:30:53', '2005-06-17T11:24:57', '2005-06-26T09:48:57', '1'), + ('84', '656', '2006-02-16T02:30:53', '2005-06-18T16:53:33', '2005-06-20T18:23:33', '1'), + ('319', '3428', '2006-02-16T02:30:53', '2005-08-17T18:29:35', '2005-08-25T23:39:35', '1'), + ('13', '420', '2006-02-16T02:30:53', '2005-08-19T10:49:03', '2005-08-21T05:33:03', '1'), + ('22', '3949', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('549', '3951', '2006-02-16T02:30:53', '2005-07-29T00:31:39', '2005-07-29T19:33:39', '1'), + ('133', '358', '2006-02-16T02:30:53', '2005-07-30T11:47:48', '2005-08-02T08:13:48', '1'), + ('172', '2959', '2006-02-16T02:30:53', '2005-07-27T06:34:32', '2005-07-28T03:01:32', '1'), + ('308', '1629', '2006-02-16T02:30:53', '2005-07-10T22:57:29', '2005-07-12T00:08:29', '1'), + ('557', '1911', '2006-02-16T02:30:53', '2005-07-30T18:01:15', '2005-08-05T23:10:15', '1'), + ('294', '3228', '2006-02-16T02:30:53', '2005-08-17T18:10:40', '2005-08-20T16:56:40', '1'), + ('549', '255', '2006-02-16T02:30:53', '2005-08-17T14:23:52', '2005-08-21T14:23:52', '1'), + ('20', '1238', '2006-02-16T02:30:53', '2005-07-28T10:06:10', '2005-08-04T08:38:10', '1'), + ('562', '308', '2006-02-16T02:30:53', '2005-07-08T13:09:45', '2005-07-14T10:10:45', '1'), + ('23', '171', '2006-02-16T02:30:53', '2005-07-27T07:18:46', '2005-08-04T10:28:46', '1'), + ('276', '94', '2006-02-16T02:30:53', '2005-07-30T08:02:39', '2005-08-06T12:02:39', '1'), + ('322', '4185', '2006-02-16T02:30:53', '2005-08-02T08:47:04', '2005-08-05T05:33:04', '1'), + ('9', '2052', '2006-02-16T02:30:53', '2005-07-28T07:51:56', '2005-07-30T12:18:56', '1'), + ('576', '730', '2006-02-16T02:30:53', '2005-08-19T09:43:39', '2005-08-24T10:03:39', '1'), + ('353', '4352', '2006-02-16T02:30:53', '2005-08-20T06:03:33', '2005-08-21T07:06:33', '1'), + ('457', '854', '2006-02-16T02:30:53', '2005-07-31T19:11:11', '2005-08-03T22:15:11', '1'), + ('517', '2540', '2006-02-16T02:30:53', '2005-06-19T01:38:39', '2005-06-23T00:16:39', '1'), + ('139', '1831', '2006-02-16T02:30:53', '2005-08-22T08:57:10', '2005-08-24T10:39:10', '1'), + ('75', '1386', '2006-02-16T02:30:53', '2005-08-17T18:56:02', '2005-08-20T17:36:02', '1'), + ('276', '3907', '2006-02-16T02:30:53', '2005-08-20T20:06:05', '2005-08-28T17:02:05', '1'), + ('470', '3754', '2006-02-16T02:30:53', '2005-08-01T02:05:34', '2005-08-01T23:40:34', '1'), + ('145', '4005', '2006-02-16T02:30:53', '2005-08-18T18:06:53', '2005-08-19T17:36:53', '1'), + ('276', '1152', '2006-02-16T02:30:53', '2005-08-18T01:17:32', '2005-08-25T19:32:32', '1'), + ('507', '998', '2006-02-16T02:30:53', '2005-07-28T13:58:38', '2005-08-02T12:27:38', '1'), + ('277', '2156', '2006-02-16T02:30:53', '2005-06-21T05:30:36', '2005-06-24T05:12:36', '1'), + ('405', '1053', '2006-02-16T02:30:53', '2005-05-25T19:41:29', '2005-05-29T21:31:29', '1'), + ('5', '2153', '2006-02-16T02:30:53', '2005-07-11T03:17:04', '2005-07-19T07:08:04', '1'), + ('409', '4549', '2006-02-16T02:30:53', '2005-07-10T17:28:14', '2005-07-14T11:54:14', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['7329', '3965', '6443', '860', '4353', '9785', '6596', '11756', '13514', '1995', '7840', '7765', '1407', '6627', '2273', '15684', '4523', '14143', '1832', '14627', '8057', '826', '2441', '7077', '5212', '9050', '3299', '2444', '5456', '14377', '13955', '1168', '1219', '9935', '15555', '10487', '161', '345', '791', '12075', '12456', '3887', '2586', '742', '93', '2961', '882', '11566', '14284', '1850', '15564', '8587', '1252', '8478', '8791', '8380', '2889', '4878', '13545', '11466', '2406', '11297', '3246', '1884', '1794', '2917', '9600', '13100', '11338', '1357', '12773', '15508', '1129', '15935', '14434', '5292', '2148', '9762', '14185', '11624', '2193', '7683', '13585', '1374', '7561', '1172', '4957', '2899', '7422', '6522', '7219', '4380', '3392', '15185', '5230', '11735', '7965', '10724', '5177', '10823']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('226', '906', '2006-02-16T02:30:53', '2005-07-27T13:55:34', '2005-08-04T15:15:34', '1'), + ('243', '2863', '2006-02-16T02:30:53', '2005-07-06T22:36:20', '2005-07-09T17:45:20', '1'), + ('155', '895', '2006-02-16T02:30:53', '2005-07-12T00:35:51', '2005-07-16T04:50:51', '1'), + ('276', '578', '2006-02-16T02:30:53', '2005-05-30T02:45:16', '2005-06-08T07:28:16', '1'), + ('452', '368', '2006-02-16T02:30:53', '2005-07-07T19:19:05', '2005-07-13T13:40:05', '1'), + ('587', '4101', '2006-02-16T02:30:53', '2005-07-31T10:22:15', '2005-08-02T10:02:15', '1'), + ('409', '890', '2006-02-16T02:30:53', '2005-07-12T07:32:59', '2005-07-13T02:47:59', '1'), + ('198', '1798', '2006-02-16T02:30:53', '2005-08-17T09:29:22', '2005-08-21T12:17:22', '1'), + ('96', '3407', '2006-02-16T02:30:53', '2005-08-20T02:28:09', '2005-08-25T00:41:09', '1'), + ('10', '1866', '2006-02-16T02:30:53', '2005-06-17T11:11:14', '2005-06-26T16:37:14', '1'), + ('482', '2899', '2006-02-16T02:30:53', '2005-07-28T09:03:02', '2005-08-06T06:15:02', '1'), + ('294', '4098', '2006-02-16T02:30:53', '2005-07-28T06:40:33', '2005-07-31T01:25:33', '1'), + ('89', '1286', '2006-02-16T02:30:53', '2005-06-15T16:45:07', '2005-06-23T14:01:07', '1'), + ('565', '626', '2006-02-16T02:30:53', '2005-07-12T09:16:46', '2005-07-17T10:58:46', '1'), + ('327', '4456', '2006-02-16T02:30:53', '2005-06-18T06:30:02', '2005-06-20T07:07:02', '1'), + ('586', '3976', '2006-02-16T02:30:53', '2005-08-23T09:40:04', '2005-08-28T15:28:04', '1'), + ('347', '2785', '2006-02-16T02:30:53', '2005-07-08T03:06:59', '2005-07-17T04:44:59', '1'), + ('146', '2549', '2006-02-16T02:30:53', '2005-08-21T02:10:32', '2005-08-23T23:50:32', '1'), + ('220', '500', '2006-02-16T02:30:53', '2005-06-16T22:35:20', '2005-06-19T03:09:20', '1'), + ('49', '2470', '2006-02-16T02:30:53', '2005-08-21T18:35:54', '2005-08-30T21:17:54', '1'), + ('483', '4177', '2006-02-16T02:30:53', '2005-07-28T17:07:13', '2005-08-03T16:25:13', '1'), + ('207', '2263', '2006-02-16T02:30:53', '2005-05-29T21:56:15', '2005-06-08T03:18:15', '1'), + ('593', '3148', '2006-02-16T02:30:53', '2005-06-18T18:45:11', '2005-06-20T00:42:11', '1'), + ('155', '3186', '2006-02-16T02:30:53', '2005-07-27T04:13:02', '2005-07-31T23:15:02', '1'), + ('400', '3240', '2006-02-16T02:30:53', '2005-07-09T11:37:47', '2005-07-15T14:42:47', '1'), + ('40', '106', '2006-02-16T02:30:53', '2005-07-30T06:59:55', '2005-08-06T06:37:55', '1'), + ('199', '3427', '2006-02-16T02:30:53', '2005-06-21T07:23:34', '2005-06-27T04:02:34', '1'), + ('576', '2233', '2006-02-16T02:30:53', '2005-06-18T18:58:12', '2005-06-27T20:48:12', '1'), + ('360', '3003', '2006-02-16T02:30:53', '2005-07-09T22:31:45', '2005-07-12T03:53:45', '1'), + ('6', '1325', '2006-02-16T02:30:53', '2005-08-21T09:49:28', '2005-08-29T13:34:28', '1'), + ('273', '2613', '2006-02-16T02:30:53', '2005-08-20T18:05:12', '2005-08-29T18:25:12', '1'), + ('481', '4368', '2006-02-16T02:30:53', '2005-06-14T23:35:09', '2005-06-19T03:20:09', '1'), + ('330', '3005', '2006-02-16T02:30:53', '2005-06-15T03:25:59', '2005-06-20T00:37:59', '1'), + ('10', '2247', '2006-02-16T02:30:53', '2005-07-31T15:27:07', '2005-08-05T11:23:07', '1'), + ('347', '1869', '2006-02-16T02:30:53', '2005-08-23T04:51:52', '2005-08-24T01:01:52', '1'), + ('577', '1121', '2006-02-16T02:30:53', '2005-08-01T10:26:34', '2005-08-07T16:11:34', '1'), + ('182', '2941', '2006-02-16T02:30:53', '2005-05-26T01:51:48', '2005-05-27T05:42:48', '1'), + ('144', '1396', '2006-02-16T02:30:53', '2005-05-27T04:32:25', '2005-05-31T09:50:25', '1'), + ('284', '1554', '2006-02-16T02:30:53', '2005-05-29T16:30:42', '2005-06-01T19:11:42', '1'), + ('125', '3147', '2006-02-16T02:30:53', '2005-08-17T21:54:55', '2005-08-23T23:04:55', '1'), + ('85', '4578', '2006-02-16T02:30:53', '2005-08-18T11:21:51', '2005-08-21T13:28:51', '1'), + ('530', '1695', '2006-02-16T02:30:53', '2005-07-06T18:46:34', '2005-07-07T13:15:34', '1'), + ('537', '4104', '2006-02-16T02:30:53', '2005-06-19T05:05:11', '2005-06-27T00:23:11', '1'), + ('483', '273', '2006-02-16T02:30:53', '2005-05-29T08:36:30', '2005-06-05T11:30:30', '1'), + ('288', '4360', '2006-02-16T02:30:53', '2005-05-25T15:54:16', '2005-06-03T20:18:16', '1'), + ('399', '4539', '2006-02-16T02:30:53', '2005-06-20T07:29:15', '2005-06-24T08:05:15', '1'), + ('477', '3841', '2006-02-16T02:30:53', '2005-05-30T06:16:06', '2005-06-02T11:57:06', '1'), + ('520', '4020', '2006-02-16T02:30:53', '2005-08-17T01:28:35', '2005-08-20T22:42:35', '1'), + ('486', '633', '2006-02-16T02:30:53', '2005-08-21T06:44:37', '2005-08-28T05:03:37', '1'), + ('517', '761', '2006-02-16T02:30:53', '2005-06-17T00:31:35', '2005-06-25T05:19:35', '1'), + ('353', '1268', '2006-02-16T02:30:53', '2005-08-23T05:10:42', '2005-08-30T03:17:42', '1'), + ('108', '1941', '2006-02-16T02:30:53', '2005-07-29T12:18:40', '2005-08-03T14:01:40', '1'), + ('89', '1147', '2006-02-16T02:30:53', '2005-06-15T06:05:18', '2005-06-24T07:40:18', '1'), + ('162', '3742', '2006-02-16T02:30:53', '2005-07-29T08:40:36', '2005-08-01T10:23:36', '1'), + ('469', '1677', '2006-02-16T02:30:53', '2005-07-29T20:53:23', '2005-07-31T18:14:23', '1'), + ('145', '2279', '2006-02-16T02:30:53', '2005-07-29T05:31:29', '2005-08-02T01:27:29', '1'), + ('213', '151', '2006-02-16T02:30:53', '2005-06-20T01:54:08', '2005-06-23T06:33:08', '1'), + ('172', '4009', '2006-02-16T02:30:53', '2005-07-08T19:33:49', '2005-07-17T17:47:49', '1'), + ('417', '615', '2006-02-16T02:30:53', '2005-08-20T03:50:15', '2005-08-27T22:24:15', '1'), + ('556', '3363', '2006-02-16T02:30:53', '2005-08-02T21:46:46', '2005-08-06T01:42:46', '1'), + ('497', '1321', '2006-02-16T02:30:53', '2005-06-18T16:39:37', '2005-06-23T12:04:37', '1'), + ('62', '2531', '2006-02-16T02:30:53', '2005-08-02T15:22:47', '2005-08-11T18:45:47', '1'), + ('41', '4432', '2006-02-16T02:30:53', '2005-06-21T03:10:01', '2005-06-28T00:46:01', '1'), + ('305', '4567', '2006-02-16T02:30:53', '2005-06-17T03:19:20', '2005-06-21T00:19:20', '1'), + ('452', '497', '2006-02-16T02:30:53', '2005-06-16T20:08:37', '2005-06-22T01:54:37', '1'), + ('451', '647', '2006-02-16T02:30:53', '2005-06-20T04:08:35', '2005-06-24T01:17:35', '1'), + ('464', '3731', '2006-02-16T02:30:53', '2005-07-31T03:35:34', '2005-08-08T22:50:34', '1'), + ('451', '916', '2006-02-16T02:30:53', '2005-08-19T10:55:45', '2005-08-25T12:28:45', '1'), + ('26', '3689', '2006-02-16T02:30:53', '2005-08-02T17:00:12', '2005-08-03T18:54:12', '1'), + ('205', '2285', '2006-02-16T02:30:53', '2005-06-15T13:26:23', '2005-06-23T14:12:23', '1'), + ('360', '4390', '2006-02-16T02:30:53', '2005-08-18T23:32:19', '2005-08-27T04:40:19', '1'), + ('293', '4035', '2006-02-16T02:30:53', '2005-08-23T02:49:04', '2005-08-29T00:58:04', '1'), + ('486', '386', '2006-02-16T02:30:53', '2005-05-31T18:00:48', '2005-06-04T23:05:48', '1'), + ('361', '907', '2006-02-16T02:30:53', '2005-08-23T18:41:11', '2005-08-25T20:59:11', '1'), + ('549', '2085', '2006-02-16T02:30:53', '2005-08-21T11:40:46', '2005-08-24T05:50:46', '1'), + ('62', '3195', '2006-02-16T02:30:53', '2005-07-09T15:16:54', '2005-07-11T15:21:54', '1'), + ('338', '315', '2006-02-16T02:30:53', '2005-06-17T22:44:35', '2005-06-26T19:43:35', '1'), + ('540', '155', '2006-02-16T02:30:53', '2005-07-31T09:32:54', '2005-08-05T04:55:54', '1'), + ('579', '3957', '2006-02-16T02:30:53', '2005-08-21T03:28:37', '2005-08-26T01:15:37', '1'), + ('527', '606', '2006-02-16T02:30:53', '2005-08-17T04:17:42', '2005-08-18T02:46:42', '1'), + ('112', '1013', '2006-02-16T02:30:53', '2005-06-18T01:38:45', '2005-06-22T19:51:45', '1'), + ('73', '1760', '2006-02-16T02:30:53', '2005-07-28T03:11:29', '2005-08-04T00:14:29', '1'), + ('470', '3314', '2006-02-16T02:30:53', '2005-08-20T05:32:23', '2005-08-27T23:36:23', '1'), + ('120', '3353', '2006-02-16T02:30:53', '2005-06-15T14:49:54', '2005-06-22T12:30:54', '1'), + ('291', '3433', '2006-02-16T02:30:53', '2005-07-27T22:21:05', '2005-08-04T01:02:05', '1'), + ('306', '2685', '2006-02-16T02:30:53', '2005-06-14T23:54:34', '2005-06-16T02:26:34', '1'), + ('399', '4082', '2006-02-16T02:30:53', '2005-07-08T23:18:48', '2005-07-09T23:13:48', '1'), + ('459', '1919', '2006-02-16T02:30:53', '2005-06-20T02:39:21', '2005-06-23T06:47:21', '1'), + ('286', '3954', '2006-02-16T02:30:53', '2005-07-27T17:10:42', '2005-08-03T19:32:42', '1'), + ('142', '3916', '2006-02-16T02:30:53', '2005-07-12T04:11:58', '2005-07-15T08:32:58', '1'), + ('512', '4046', '2006-02-16T02:30:53', '2005-07-27T09:35:36', '2005-07-29T04:44:36', '1'), + ('353', '3164', '2006-02-16T02:30:53', '2005-07-07T20:35:00', '2005-07-14T17:06:00', '1'), + ('38', '3343', '2006-02-16T02:30:53', '2005-06-21T15:12:44', '2005-06-29T18:19:44', '1'), + ('472', '2948', '2006-02-16T02:30:53', '2005-08-22T15:52:50', '2005-08-31T20:38:50', '1'), + ('51', '3707', '2006-02-16T02:30:53', '2005-07-09T12:30:23', '2005-07-13T08:41:23', '1'), + ('452', '2555', '2006-02-16T02:30:53', '2005-08-17T08:35:42', '2005-08-26T11:04:42', '1'), + ('134', '3671', '2006-02-16T02:30:53', '2005-07-28T13:52:57', '2005-07-29T14:54:57', '1'), + ('576', '3425', '2006-02-16T02:30:53', '2005-08-01T19:10:59', '2005-08-07T18:44:59', '1'), + ('452', '1675', '2006-02-16T02:30:53', '2005-07-09T09:43:21', '2005-07-13T07:29:21', '1'), + ('405', '3322', '2006-02-16T02:30:53', '2005-08-01T22:59:10', '2005-08-08T23:44:10', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['8896', '10108', '15551', '15850', '7328', '1777', '3029', '1631', '2813', '4476', '695', '11987', '2357', '10892', '10864', '14525', '13166', '8694', '1947', '9186', '8616', '15583', '12239', '5519', '6675', '12986', '4111', '5566', '11397', '1982', '7027', '12112', '5403', '9432', '11954', '12390', '707', '13927', '6841', '14544', '6126', '4123', '5159', '2962', '10218', '7858', '15386', '4210', '13738', '12482', '15072', '1829', '2147', '10850', '11454', '8404', '11303', '9052', '15579', '11388', '5370', '13264', '3660', '8498', '15844', '3255', '1100', '8169', '894', '10232', '11879', '15608', '15100', '9093', '5483', '13494', '3755', '10971', '14665', '15364', '5304', '251', '10878', '3438', '12567', '9267', '9406', '11331', '12699', '6553', '3071', '1176', '12737', '2550', '7913', '9925', '540', '5842', '2580', '14252']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('205', '3560', '2006-02-16T02:30:53', '2005-07-30T00:51:21', '2005-07-31T22:33:21', '1'), + ('326', '3703', '2006-02-16T02:30:53', '2005-07-31T21:02:14', '2005-08-01T18:28:14', '1'), + ('345', '3570', '2006-02-16T02:30:53', '2005-08-23T04:28:25', '2005-08-26T07:19:25', '1'), + ('563', '586', '2006-02-16T02:30:53', '2005-08-23T15:45:42', '2005-08-27T19:24:42', '1'), + ('26', '663', '2006-02-16T02:30:53', '2005-07-27T13:55:18', '2005-08-01T19:52:18', '1'), + ('49', '3325', '2006-02-16T02:30:53', '2005-06-16T18:52:12', '2005-06-25T13:55:12', '1'), + ('317', '327', '2006-02-16T02:30:53', '2005-06-20T11:51:30', '2005-06-25T16:42:30', '1'), + ('5', '2466', '2006-02-16T02:30:53', '2005-06-16T08:01:02', '2005-06-19T09:04:02', '1'), + ('284', '3420', '2006-02-16T02:30:53', '2005-06-19T20:01:47', '2005-06-27T01:51:47', '1'), + ('279', '395', '2006-02-16T02:30:53', '2005-07-08T00:34:25', '2005-07-08T22:55:25', '1'), + ('528', '4276', '2006-02-16T02:30:53', '2005-05-29T01:50:53', '2005-06-03T02:28:53', '1'), + ('494', '1478', '2006-02-16T02:30:53', '2005-08-17T18:21:59', '2005-08-25T19:20:59', '1'), + ('561', '1323', '2006-02-16T02:30:53', '2005-06-18T12:59:41', '2005-06-26T16:40:41', '1'), + ('109', '3243', '2006-02-16T02:30:53', '2005-08-02T01:12:06', '2005-08-09T23:53:06', '1'), + ('134', '1694', '2006-02-16T02:30:53', '2005-08-02T00:18:59', '2005-08-08T22:20:59', '1'), + ('420', '3020', '2006-02-16T02:30:53', '2005-08-21T15:06:49', '2005-08-22T16:30:49', '1'), + ('504', '4386', '2006-02-16T02:30:53', '2005-08-19T13:36:28', '2005-08-22T07:57:28', '1'), + ('345', '503', '2006-02-16T02:30:53', '2005-07-29T16:44:48', '2005-08-06T16:28:48', '1'), + ('479', '3344', '2006-02-16T02:30:53', '2005-06-17T08:02:20', '2005-06-25T10:25:20', '1'), + ('273', '4513', '2006-02-16T02:30:53', '2005-07-30T12:13:48', '2005-07-31T11:59:48', '1'), + ('493', '2583', '2006-02-16T02:30:53', '2005-07-29T13:39:09', '2005-08-01T16:49:09', '1'), + ('215', '4299', '2006-02-16T02:30:53', '2005-08-23T05:47:55', '2005-08-26T01:46:55', '1'), + ('75', '1948', '2006-02-16T02:30:53', '2005-08-18T03:26:42', '2005-08-24T23:48:42', '1'), + ('85', '1312', '2006-02-16T02:30:53', '2005-07-10T01:18:32', '2005-07-11T20:39:32', '1'), + ('523', '2124', '2006-02-16T02:30:53', '2005-07-12T11:53:06', '2005-07-13T06:09:06', '1'), + ('210', '1145', '2006-02-16T02:30:53', '2005-08-19T07:09:36', '2005-08-22T05:01:36', '1'), + ('515', '1009', '2006-02-16T02:30:53', '2005-07-07T06:47:56', '2005-07-13T02:13:56', '1'), + ('124', '1343', '2006-02-16T02:30:53', '2005-07-10T03:30:17', '2005-07-13T06:32:17', '1'), + ('470', '2566', '2006-02-16T02:30:53', '2005-08-02T18:53:14', '2005-08-09T18:09:14', '1'), + ('566', '1091', '2006-02-16T02:30:53', '2005-06-17T10:12:15', '2005-06-20T13:56:15', '1'), + ('61', '3280', '2006-02-16T02:30:53', '2005-07-27T02:50:15', '2005-08-04T02:58:15', '1'), + ('576', '4290', '2006-02-16T02:30:53', '2005-08-17T23:00:31', '2005-08-25T02:05:31', '1'), + ('36', '3991', '2006-02-16T02:30:53', '2005-07-09T20:07:09', '2005-07-12T18:33:09', '1'), + ('570', '2489', '2006-02-16T02:30:53', '2005-07-30T21:26:18', '2005-08-05T00:23:18', '1'), + ('145', '220', '2006-02-16T02:30:53', '2005-08-17T17:18:36', '2005-08-18T19:49:36', '1'), + ('377', '3603', '2006-02-16T02:30:53', '2005-08-18T08:51:42', '2005-08-23T13:06:42', '1'), + ('252', '819', '2006-02-16T02:30:53', '2005-05-29T03:18:19', '2005-05-30T02:45:19', '1'), + ('417', '4284', '2006-02-16T02:30:53', '2005-08-20T17:11:58', '2005-08-24T12:44:58', '1'), + ('108', '2265', '2006-02-16T02:30:53', '2005-07-12T19:04:24', '2005-07-14T23:58:24', '1'), + ('589', '2445', '2006-02-16T02:30:53', '2005-08-21T15:41:01', '2005-08-24T15:20:01', '1'), + ('230', '1069', '2006-02-16T02:30:53', '2005-07-11T08:06:56', '2005-07-16T11:42:56', '1'), + ('469', '2707', '2006-02-16T02:30:53', '2005-07-07T07:16:19', '2005-07-10T05:23:19', '1'), + ('213', '3479', '2006-02-16T02:30:53', '2005-07-09T08:55:52', '2005-07-10T04:32:52', '1'), + ('364', '2978', '2006-02-16T02:30:53', '2005-06-20T07:31:55', '2005-06-26T04:43:55', '1'), + ('101', '3886', '2006-02-16T02:30:53', '2005-08-01T01:09:44', '2005-08-05T20:08:44', '1'), + ('144', '992', '2006-02-16T02:30:53', '2005-07-28T09:50:18', '2005-08-05T14:33:18', '1'), + ('327', '3056', '2006-02-16T02:30:53', '2005-08-22T22:41:14', '2005-08-29T22:29:14', '1'), + ('581', '1972', '2006-02-16T02:30:53', '2005-07-07T11:36:20', '2005-07-16T12:38:20', '1'), + ('273', '2748', '2006-02-16T02:30:53', '2005-08-20T10:42:42', '2005-08-25T09:32:42', '1'), + ('247', '3778', '2006-02-16T02:30:53', '2005-08-18T12:37:36', '2005-08-26T09:53:36', '1'), + ('405', '2871', '2006-02-16T02:30:53', '2005-08-22T10:58:45', '2005-08-30T16:18:45', '1'), + ('293', '617', '2006-02-16T02:30:53', '2005-06-16T22:14:21', '2005-06-21T16:51:21', '1'), + ('279', '2752', '2006-02-16T02:30:53', '2005-06-17T22:28:13', '2005-06-22T20:50:13', '1'), + ('199', '1853', '2006-02-16T02:30:53', '2005-08-01T23:53:45', '2005-08-10T21:11:45', '1'), + ('199', '2901', '2006-02-16T02:30:53', '2005-08-02T21:04:39', '2005-08-05T19:03:39', '1'), + ('65', '2086', '2006-02-16T02:30:53', '2005-07-29T06:27:01', '2005-08-07T04:33:01', '1'), + ('417', '1817', '2006-02-16T02:30:53', '2005-08-02T15:39:18', '2005-08-05T10:59:18', '1'), + ('408', '3351', '2006-02-16T02:30:53', '2005-07-30T07:06:08', '2005-08-03T10:30:08', '1'), + ('480', '3986', '2006-02-16T02:30:53', '2005-08-23T05:38:41', '2005-08-29T09:18:41', '1'), + ('369', '477', '2006-02-16T02:30:53', '2005-08-02T18:35:55', '2005-08-09T21:56:55', '1'), + ('248', '2193', '2006-02-16T02:30:53', '2005-07-09T18:43:19', '2005-07-15T19:59:19', '1'), + ('109', '1881', '2006-02-16T02:30:53', '2005-08-19T17:27:10', '2005-08-27T16:00:10', '1'), + ('507', '1129', '2006-02-16T02:30:53', '2005-07-06T08:07:29', '2005-07-14T08:46:29', '1'), + ('190', '4468', '2006-02-16T02:30:53', '2005-07-29T09:07:38', '2005-08-04T07:01:38', '1'), + ('119', '2027', '2006-02-16T02:30:53', '2005-08-23T15:38:12', '2005-08-26T15:18:12', '1'), + ('482', '2564', '2006-02-16T02:30:53', '2005-06-21T03:39:52', '2005-06-24T04:02:52', '1'), + ('497', '316', '2006-02-16T02:30:53', '2005-05-31T14:03:21', '2005-06-06T16:08:21', '1'), + ('366', '4086', '2006-02-16T02:30:53', '2005-07-28T21:29:46', '2005-08-06T22:29:46', '1'), + ('400', '1118', '2006-02-16T02:30:53', '2005-05-30T08:31:31', '2005-06-07T12:39:31', '1'), + ('512', '586', '2006-02-16T02:30:53', '2005-08-01T01:50:55', '2005-08-03T04:12:55', '1'), + ('312', '2500', '2006-02-16T02:30:53', '2005-08-17T14:25:09', '2005-08-26T09:19:09', '1'), + ('454', '2921', '2006-02-16T02:30:53', '2005-08-23T06:55:26', '2005-08-28T10:24:26', '1'), + ('312', '4489', '2006-02-16T02:30:53', '2005-08-22T11:55:03', '2005-08-25T14:55:03', '1'), + ('96', '2208', '2006-02-16T02:30:53', '2005-07-30T08:33:24', '2005-08-04T11:07:24', '1'), + ('89', '4362', '2006-02-16T02:30:53', '2005-07-09T23:54:09', '2005-07-17T23:36:09', '1'), + ('414', '1632', '2006-02-16T02:30:53', '2005-08-20T01:36:34', '2005-08-21T06:52:34', '1'), + ('402', '3147', '2006-02-16T02:30:53', '2005-07-06T12:37:16', '2005-07-13T07:22:16', '1'), + ('383', '2789', '2006-02-16T02:30:53', '2005-08-02T04:08:17', '2005-08-09T00:02:17', '1'), + ('58', '2896', '2006-02-16T02:30:53', '2005-08-21T19:49:46', '2005-08-30T18:00:46', '1'), + ('204', '4184', '2006-02-16T02:30:53', '2005-08-22T21:41:41', '2005-08-28T00:49:41', '1'), + ('51', '4411', '2006-02-16T02:30:53', '2005-07-09T15:48:06', '2005-07-14T19:29:06', '1'), + ('204', '4352', '2006-02-16T02:30:53', '2005-05-26T14:35:40', '2005-05-29T17:17:40', '1'), + ('45', '3511', '2006-02-16T02:30:53', '2005-08-02T00:33:12', '2005-08-07T06:02:12', '1'), + ('556', '1757', '2006-02-16T02:30:53', '2005-06-21T19:31:40', '2005-06-30T19:08:40', '1'), + ('308', '2931', '2006-02-16T02:30:53', '2005-08-18T15:14:36', '2005-08-26T18:56:36', '1'), + ('409', '645', '2006-02-16T02:30:53', '2005-07-30T14:59:05', '2005-08-04T10:17:05', '1'), + ('453', '3419', '2006-02-16T02:30:53', '2005-07-30T20:24:00', '2005-08-07T19:50:00', '1'), + ('568', '3789', '2006-02-16T02:30:53', '2005-08-02T16:49:01', '2005-08-09T19:15:01', '1'), + ('66', '3695', '2006-02-16T02:30:53', '2005-08-18T20:20:59', '2005-08-22T17:00:59', '1'), + ('265', '1137', '2006-02-16T02:30:53', '2005-07-12T05:06:39', '2005-07-21T10:37:39', '1'), + ('582', '1198', '2006-02-16T02:30:53', '2005-06-20T14:20:42', '2005-06-24T19:01:42', '1'), + ('512', '2715', '2006-02-16T02:30:53', '2005-06-15T00:28:37', '2005-06-21T21:42:37', '1'), + ('204', '736', '2006-02-16T02:30:53', '2005-08-18T22:11:37', '2005-08-26T04:08:37', '1'), + ('38', '1370', '2006-02-16T02:30:53', '2005-06-19T02:49:55', '2005-06-24T01:37:55', '1'), + ('459', '4001', '2006-02-16T02:30:53', '2005-07-28T11:47:23', '2005-08-05T06:36:23', '1'), + ('24', '2351', '2006-02-16T02:30:53', '2005-07-31T15:08:47', '2005-08-02T20:27:47', '1'), + ('119', '3321', '2006-02-16T02:30:53', '2005-05-28T06:40:25', '2005-06-06T00:47:25', '1'), + ('247', '139', '2006-02-16T02:30:53', '2005-07-10T17:11:37', '2005-07-14T21:43:37', '1'), + ('219', '2527', '2006-02-16T02:30:53', '2005-06-19T04:44:30', '2005-06-23T04:15:30', '1'), + ('13', '2660', '2006-02-16T02:30:53', '2005-08-21T05:44:07', '2005-08-29T08:53:07', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['8890', '1057', '15963', '7537', '11028', '9091', '7643', '7829', '1597', '2442', '6571', '5815', '9792', '12182', '731', '5829', '14520', '13013', '15453', '909', '2414', '11001', '1797', '13659', '14430', '5172', '10696', '10727', '15479', '9509', '12595', '3551', '7060', '5747', '5141', '14708', '11186', '9332', '8029', '1028', '7371', '7822', '8939', '14265', '6327', '10766', '15370', '11014', '58', '11227', '6227', '5749', '4862', '7523', '14237', '13748', '4267', '5150', '14298', '11694', '4062', '2400', '2073', '11472', '2255', '6148', '14319', '1514', '11187', '14819', '10402', '5330', '15518', '10837', '5192', '6151', '10346', '3448', '7461', '10617', '11059', '7790', '3813', '1117', '10247', '7469', '3108', '7675', '4203', '9506', '16008', '1834', '3763', '7593', '8097', '12429', '13099', '3851', '8027', '9539']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('470', '3656', '2006-02-16T02:30:53', '2005-07-30T00:42:06', '2005-08-05T21:04:06', '1'), + ('124', '497', '2006-02-16T02:30:53', '2005-05-31T07:58:06', '2005-06-06T03:21:06', '1'), + ('134', '3819', '2006-02-16T02:30:53', '2005-08-23T19:42:46', '2005-08-25T22:12:46', '1'), + ('269', '4456', '2006-02-16T02:30:53', '2005-07-27T21:36:09', '2005-08-01T01:51:09', '1'), + ('66', '2764', '2006-02-16T02:30:53', '2005-08-02T05:48:20', '2005-08-10T11:21:20', '1'), + ('66', '2249', '2006-02-16T02:30:53', '2005-07-30T08:30:45', '2005-08-07T13:28:45', '1'), + ('407', '4369', '2006-02-16T02:30:53', '2005-07-28T01:19:44', '2005-08-04T21:16:44', '1'), + ('5', '111', '2006-02-16T02:30:53', '2005-07-28T08:43:39', '2005-08-04T14:33:39', '1'), + ('432', '743', '2006-02-16T02:30:53', '2005-06-16T05:47:03', '2005-06-18T04:21:03', '1'), + ('364', '4045', '2006-02-16T02:30:53', '2005-06-18T18:49:18', '2005-06-22T16:18:18', '1'), + ('140', '3700', '2006-02-16T02:30:53', '2005-07-12T05:51:47', '2005-07-15T11:31:47', '1'), + ('22', '2934', '2006-02-16T02:30:53', '2005-07-10T15:48:19', '2005-07-13T12:09:19', '1'), + ('292', '3163', '2006-02-16T02:30:53', '2005-07-31T10:43:41', '2005-08-07T10:18:41', '1'), + ('555', '296', '2006-02-16T02:30:53', '2005-08-18T01:30:19', '2005-08-21T05:52:19', '1'), + ('5', '4124', '2006-02-16T02:30:53', '2005-05-29T07:25:16', '2005-05-30T05:21:16', '1'), + ('118', '3405', '2006-02-16T02:30:53', '2005-07-10T16:29:41', '2005-07-14T22:03:41', '1'), + ('150', '4533', '2006-02-16T02:30:53', '2005-08-21T15:00:49', '2005-08-30T19:04:49', '1'), + ('293', '841', '2006-02-16T02:30:53', '2005-08-19T07:55:51', '2005-08-26T05:14:51', '1'), + ('359', '2', '2006-02-16T02:30:53', '2005-08-23T01:01:01', '2005-08-30T20:08:01', '1'), + ('486', '3775', '2006-02-16T02:30:53', '2005-05-30T10:43:38', '2005-06-08T12:07:38', '1'), + ('275', '4500', '2006-02-16T02:30:53', '2005-06-18T17:01:55', '2005-06-20T17:42:55', '1'), + ('5', '3701', '2006-02-16T02:30:53', '2005-08-02T04:56:45', '2005-08-11T08:04:45', '1'), + ('275', '3435', '2006-02-16T02:30:53', '2005-06-16T20:13:03', '2005-06-22T22:56:03', '1'), + ('520', '3610', '2006-02-16T02:30:53', '2005-08-20T08:05:52', '2005-08-24T12:38:52', '1'), + ('5', '2623', '2006-02-16T02:30:53', '2005-08-21T11:31:11', '2005-08-26T06:29:11', '1'), + ('214', '4046', '2006-02-16T02:30:53', '2005-07-09T09:31:27', '2005-07-13T04:03:27', '1'), + ('120', '47', '2006-02-16T02:30:53', '2005-08-01T18:18:13', '2005-08-04T14:09:13', '1'), + ('16', '2049', '2006-02-16T02:30:53', '2005-08-01T19:15:08', '2005-08-03T13:52:08', '1'), + ('149', '4182', '2006-02-16T02:30:53', '2005-08-23T01:50:53', '2005-08-29T00:53:53', '1'), + ('320', '818', '2006-02-16T02:30:53', '2005-07-31T00:22:42', '2005-08-03T23:24:42', '1'), + ('286', '1662', '2006-02-16T02:30:53', '2005-08-18T16:27:08', '2005-08-19T14:53:08', '1'), + ('111', '3602', '2006-02-16T02:30:53', '2005-07-06T02:33:48', '2005-07-13T04:38:48', '1'), + ('479', '3912', '2006-02-16T02:30:53', '2005-07-27T03:51:04', '2005-08-03T07:53:04', '1'), + ('583', '4562', '2006-02-16T02:30:53', '2005-07-10T12:15:33', '2005-07-18T10:11:33', '1'), + ('488', '590', '2006-02-16T02:30:53', '2005-07-09T08:05:14', '2005-07-18T04:36:14', '1'), + ('226', '2828', '2006-02-16T02:30:53', '2005-08-21T21:07:23', '2005-08-28T15:47:23', '1'), + ('353', '733', '2006-02-16T02:30:53', '2005-08-02T11:12:08', '2005-08-03T10:46:08', '1'), + ('480', '1156', '2006-02-16T02:30:53', '2005-07-30T17:53:39', '2005-08-02T12:25:39', '1'), + ('61', '4273', '2006-02-16T02:30:53', '2005-07-28T16:11:21', '2005-08-05T13:52:21', '1'), + ('51', '4479', '2006-02-16T02:30:53', '2005-05-31T03:48:05', '2005-06-01T03:51:05', '1'), + ('577', '1807', '2006-02-16T02:30:53', '2005-07-27T15:18:42', '2005-08-01T09:58:42', '1'), + ('156', '1428', '2006-02-16T02:30:53', '2005-07-28T08:31:45', '2005-07-31T11:06:45', '1'), + ('598', '4175', '2006-02-16T02:30:53', '2005-07-30T02:56:53', '2005-08-01T21:19:53', '1'), + ('134', '3116', '2006-02-16T02:30:53', '2005-08-21T06:20:14', '2005-08-23T09:05:14', '1'), + ('146', '909', '2006-02-16T02:30:53', '2005-07-11T19:07:29', '2005-07-15T16:09:29', '1'), + ('420', '947', '2006-02-16T02:30:53', '2005-08-01T20:36:29', '2005-08-04T00:30:29', '1'), + ('10', '67', '2006-02-16T02:30:53', '2005-08-22T21:59:29', '2005-08-27T16:32:29', '1'), + ('269', '393', '2006-02-16T02:30:53', '2005-08-02T05:12:22', '2005-08-07T09:33:22', '1'), + ('323', '3050', '2006-02-16T02:30:53', '2005-05-25T08:53:14', '2005-05-28T14:40:14', '1'), + ('65', '1101', '2006-02-16T02:30:53', '2005-08-02T12:48:05', '2005-08-11T14:08:05', '1'), + ('210', '1654', '2006-02-16T02:30:53', '2005-07-11T13:56:46', '2005-07-18T12:53:46', '1'), + ('304', '1768', '2006-02-16T02:30:53', '2005-07-10T12:20:36', '2005-07-19T10:39:36', '1'), + ('291', '293', '2006-02-16T02:30:53', '2005-07-08T19:02:46', '2005-07-17T20:17:46', '1'), + ('410', '4153', '2006-02-16T02:30:53', '2005-07-27T21:11:23', '2005-07-28T16:37:23', '1'), + ('410', '3284', '2006-02-16T02:30:53', '2005-08-21T05:15:00', '2005-08-25T10:06:00', '1'), + ('410', '2198', '2006-02-16T02:30:53', '2005-08-20T10:59:54', '2005-08-23T12:33:54', '1'), + ('410', '136', '2006-02-16T02:30:53', '2005-07-07T14:35:30', '2005-07-11T10:41:30', '1'), + ('410', '1961', '2006-02-16T02:30:53', '2005-07-09T08:28:40', '2005-07-16T04:47:40', '1'), + ('410', '4317', '2006-02-16T02:30:53', '2005-08-21T07:17:10', '2005-08-25T10:10:10', '1'), + ('410', '3540', '2006-02-16T02:30:53', '2005-08-17T06:57:30', '2005-08-24T07:52:30', '1'), + ('410', '1323', '2006-02-16T02:30:53', '2005-07-07T04:22:27', '2005-07-09T03:27:27', '1'), + ('410', '3194', '2006-02-16T02:30:53', '2005-06-18T16:10:46', '2005-06-25T20:34:46', '1'), + ('410', '3530', '2006-02-16T02:30:53', '2005-06-17T16:33:59', '2005-06-19T11:57:59', '1'), + ('410', '1829', '2006-02-16T02:30:53', '2005-08-02T21:49:06', '2005-08-11T20:17:06', '1'), + ('410', '24', '2006-02-16T02:30:53', '2005-06-18T05:21:12', '2005-06-26T09:19:12', '1'), + ('410', '4318', '2006-02-16T02:30:53', '2005-07-11T09:14:22', '2005-07-12T08:01:22', '1'), + ('410', '4480', '2006-02-16T02:30:53', '2005-08-21T08:00:55', '2005-08-26T05:04:55', '1'), + ('410', '2937', '2006-02-16T02:30:53', '2005-06-15T22:57:34', '2005-06-19T20:27:34', '1'), + ('410', '3626', '2006-02-16T02:30:53', '2005-08-02T11:16:19', '2005-08-11T06:11:19', '1'), + ('410', '2890', '2006-02-16T02:30:53', '2005-08-22T01:17:19', '2005-08-30T05:54:19', '1'), + ('410', '274', '2006-02-16T02:30:53', '2005-08-01T07:27:19', '2005-08-04T12:30:19', '1'), + ('410', '3812', '2006-02-16T02:30:53', '2005-07-09T16:53:57', '2005-07-18T19:54:57', '1'), + ('410', '3522', '2006-02-16T02:30:53', '2005-08-23T03:19:34', '2005-08-24T02:55:34', '1'), + ('410', '1816', '2006-02-16T02:30:53', '2005-08-01T23:30:22', '2005-08-07T23:02:22', '1'), + ('410', '1225', '2006-02-16T02:30:53', '2005-07-09T10:27:09', '2005-07-10T12:04:09', '1'), + ('476', '352', '2006-02-16T02:30:53', '2005-07-11T09:25:17', '2005-07-12T05:11:17', '1'), + ('476', '4192', '2006-02-16T02:30:53', '2005-08-01T05:19:23', '2005-08-06T01:00:23', '1'), + ('476', '592', '2006-02-16T02:30:53', '2005-06-21T20:59:20', '2005-06-24T15:40:20', '1'), + ('476', '1236', '2006-02-16T02:30:53', '2005-07-27T18:45:15', '2005-07-29T17:19:15', '1'), + ('476', '4344', '2006-02-16T02:30:53', '2005-08-01T15:05:52', '2005-08-09T18:54:52', '1'), + ('189', '428', '2006-02-16T02:30:53', '2005-08-02T06:41:38', '2005-08-09T04:34:38', '1'), + ('189', '2327', '2006-02-16T02:30:53', '2005-07-28T07:22:35', '2005-07-30T02:59:35', '1'), + ('189', '4100', '2006-02-16T02:30:53', '2005-07-06T15:23:34', '2005-07-08T19:03:34', '1'), + ('189', '4125', '2006-02-16T02:30:53', '2005-05-31T16:15:31', '2005-06-04T17:20:31', '1'), + ('189', '4035', '2006-02-16T02:30:53', '2005-08-01T02:34:06', '2005-08-09T02:33:06', '1'), + ('189', '3723', '2006-02-16T02:30:53', '2005-07-27T18:57:40', '2005-07-31T00:17:40', '1'), + ('189', '2218', '2006-02-16T02:30:53', '2005-06-20T17:28:43', '2005-06-27T21:23:43', '1'), + ('189', '153', '2006-02-16T02:30:53', '2005-07-28T02:55:20', '2005-07-31T05:27:20', '1'), + ('189', '2743', '2006-02-16T02:30:53', '2005-07-07T11:24:14', '2005-07-11T16:26:14', '1'), + ('189', '3872', '2006-02-16T02:30:53', '2005-07-31T00:19:01', '2005-08-02T00:20:01', '1'), + ('189', '3273', '2006-02-16T02:30:53', '2005-08-23T21:04:51', '2005-08-31T22:09:51', '1'), + ('189', '4018', '2006-02-16T02:30:53', '2005-06-16T22:49:08', '2005-06-22T21:08:08', '1'), + ('189', '1573', '2006-02-16T02:30:53', '2005-07-06T12:56:31', '2005-07-09T14:49:31', '1'), + ('436', '1158', '2006-02-16T02:30:53', '2005-07-27T23:28:47', '2005-08-02T19:51:47', '1'), + ('436', '2719', '2006-02-16T02:30:53', '2005-07-28T18:32:49', '2005-08-06T16:09:49', '1'), + ('436', '2994', '2006-02-16T02:30:53', '2005-08-18T10:26:46', '2005-08-27T13:23:46', '1'), + ('436', '969', '2006-02-16T02:30:53', '2005-08-19T10:55:19', '2005-08-27T10:54:19', '1'), + ('436', '493', '2006-02-16T02:30:53', '2005-07-06T16:54:12', '2005-07-11T22:49:12', '1'), + ('436', '1335', '2006-02-16T02:30:53', '2005-07-28T16:09:57', '2005-08-05T18:17:57', '1'), + ('436', '3793', '2006-02-16T02:30:53', '2005-07-31T01:36:19', '2005-08-04T23:47:19', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['15766', '13533', '12297', '13382', '13826', '4782', '5959', '848', '9638', '11160', '256', '15346', '12378', '12255', '12715', '5362', '11726', '14080', '15181', '651', '86', '11626', '11233', '9109', '5577', '13468', '14492', '16010', '578', '6021', '15775', '1188', '15483', '4904', '5485', '3224', '12073', '10351', '3336', '5430', '1695', '9132', '9559', '549', '475', '5656', '9151', '16031', '12495', '8186', '15049', '5509', '3630', '9617', '1215', '3520', '13420', '8664', '4777', '2419', '7439', '5109', '7119', '9295', '10841', '9780', '14426', '4992', '5126', '1701', '14106', '11254', '14162', '11838', '10637', '8774', '4187', '539', '15150', '520', '4490', '9421', '10241', '5349', '6873', '3259', '15188', '8488', '2529', '10016', '1708', '2616', '13162', '9665', '10127', '3691', '2358', '7522', '2765', '13413']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('436', '1996', '2006-02-16T02:30:53', '2005-08-23T13:10:16', '2005-08-30T09:27:16', '1'), + ('436', '1801', '2006-02-16T02:30:53', '2005-08-20T03:30:00', '2005-08-27T05:53:00', '1'), + ('436', '903', '2006-02-16T02:30:53', '2005-08-18T05:19:57', '2005-08-21T00:53:57', '1'), + ('436', '3720', '2006-02-16T02:30:53', '2005-08-19T21:38:41', '2005-08-28T15:49:41', '1'), + ('436', '401', '2006-02-16T02:30:53', '2005-08-20T13:46:38', '2005-08-29T13:07:38', '1'), + ('436', '445', '2006-02-16T02:30:53', '2005-07-08T16:08:51', '2005-07-17T17:56:51', '1'), + ('436', '3169', '2006-02-16T02:30:53', '2005-07-10T23:35:36', '2005-07-13T02:19:36', '1'), + ('436', '1363', '2006-02-16T02:30:53', '2005-05-30T01:19:53', '2005-06-05T23:40:53', '1'), + ('436', '1616', '2006-02-16T02:30:53', '2005-07-31T05:30:27', '2005-08-09T02:04:27', '1'), + ('436', '3260', '2006-02-16T02:30:53', '2005-08-02T10:05:30', '2005-08-07T08:30:30', '1'), + ('436', '3194', '2006-02-16T02:30:53', '2005-05-26T15:20:58', '2005-05-31T15:58:58', '1'), + ('266', '3525', '2006-02-16T02:30:53', '2005-08-22T21:06:00', '2005-08-28T22:08:00', '1'), + ('266', '4418', '2006-02-16T02:30:53', '2005-08-18T08:26:13', '2005-08-19T07:21:13', '1'), + ('266', '2100', '2006-02-16T02:30:53', '2005-08-18T04:07:20', '2005-08-21T22:19:20', '1'), + ('266', '3768', '2006-02-16T02:30:53', '2005-08-18T21:09:38', '2005-08-21T20:25:38', '1'), + ('266', '24', '2006-02-16T02:30:53', '2005-07-09T18:16:08', '2005-07-18T18:27:08', '1'), + ('266', '4438', '2006-02-16T02:30:53', '2005-08-17T08:11:10', '2005-08-22T05:45:10', '1'), + ('266', '3962', '2006-02-16T02:30:53', '2005-08-20T23:29:50', '2005-08-26T00:33:50', '1'), + ('266', '3900', '2006-02-16T02:30:53', '2005-08-22T15:46:20', '2005-08-27T09:56:20', '1'), + ('266', '739', '2006-02-16T02:30:53', '2005-05-28T19:46:50', '2005-05-30T16:29:50', '1'), + ('266', '2275', '2006-02-16T02:30:53', '2005-05-25T13:36:12', '2005-05-30T14:53:12', '1'), + ('266', '4279', '2006-02-16T02:30:53', '2005-08-17T04:25:42', '2005-08-23T05:46:42', '1'), + ('266', '2221', '2006-02-16T02:30:53', '2005-08-02T13:06:11', '2005-08-08T15:02:11', '1'), + ('266', '787', '2006-02-16T02:30:53', '2005-07-30T08:58:24', '2005-08-07T06:56:24', '1'), + ('266', '3779', '2006-02-16T02:30:53', '2005-07-10T03:58:40', '2005-07-14T03:36:40', '1'), + ('266', '1851', '2006-02-16T02:30:53', '2005-08-20T00:56:44', '2005-08-29T06:26:44', '1'), + ('266', '1591', '2006-02-16T02:30:53', '2005-08-21T13:59:08', '2005-08-23T11:09:08', '1'), + ('173', '2539', '2006-02-16T02:30:53', '2005-08-23T21:10:24', '2005-08-25T17:58:24', '1'), + ('173', '2938', '2006-02-16T02:30:53', '2005-05-28T11:15:48', '2005-06-02T09:59:48', '1'), + ('173', '3949', '2006-02-16T02:30:53', '2005-07-11T02:10:18', '2005-07-13T05:19:18', '1'), + ('173', '2146', '2006-02-16T02:30:53', '2005-08-23T13:25:44', '2005-09-01T16:56:44', '1'), + ('173', '246', '2006-02-16T02:30:53', '2005-06-15T01:04:07', '2005-06-19T03:48:07', '1'), + ('173', '2970', '2006-02-16T02:30:53', '2005-08-23T02:02:53', '2005-08-26T04:13:53', '1'), + ('173', '2051', '2006-02-16T02:30:53', '2005-07-08T20:53:27', '2005-07-18T01:16:27', '1'), + ('173', '3930', '2006-02-16T02:30:53', '2005-07-09T23:55:25', '2005-07-14T04:08:25', '1'), + ('173', '3318', '2006-02-16T02:30:53', '2005-06-21T02:11:36', '2005-06-23T21:17:36', '1'), + ('173', '2939', '2006-02-16T02:30:53', '2005-08-17T21:50:39', '2005-08-21T02:59:39', '1'), + ('173', '3725', '2006-02-16T02:30:53', '2005-08-01T05:32:13', '2005-08-08T09:48:13', '1'), + ('173', '2122', '2006-02-16T02:30:53', '2005-06-21T10:14:27', '2005-06-22T09:29:27', '1'), + ('173', '1441', '2006-02-16T02:30:53', '2005-07-09T21:19:54', '2005-07-15T22:53:54', '1'), + ('159', '4436', '2006-02-16T02:30:53', '2005-06-16T12:40:28', '2005-06-22T13:41:28', '1'), + ('159', '402', '2006-02-16T02:30:53', '2005-07-30T09:56:00', '2005-08-02T09:22:00', '1'), + ('159', '2882', '2006-02-16T02:30:53', '2005-07-31T02:15:53', '2005-08-08T02:38:53', '1'), + ('159', '1818', '2006-02-16T02:30:53', '2005-05-28T07:35:37', '2005-06-02T09:08:37', '1'), + ('159', '2520', '2006-02-16T02:30:53', '2005-05-27T22:16:26', '2005-05-28T19:58:26', '1'), + ('159', '4138', '2006-02-16T02:30:53', '2005-07-10T07:31:07', '2005-07-15T04:44:07', '1'), + ('102', '3956', '2006-02-16T02:30:53', '2005-07-30T10:50:53', '2005-08-07T08:19:53', '1'), + ('102', '1843', '2006-02-16T02:30:53', '2005-08-23T21:59:26', '2005-08-29T20:15:26', '1'), + ('102', '1225', '2006-02-16T02:30:53', '2005-08-18T12:56:37', '2005-08-22T06:58:37', '1'), + ('102', '4255', '2006-02-16T02:30:53', '2005-07-28T22:30:27', '2005-07-31T21:08:27', '1'), + ('102', '1573', '2006-02-16T02:30:53', '2005-08-22T10:06:28', '2005-08-26T15:12:28', '1'), + ('102', '1142', '2006-02-16T02:30:53', '2005-07-10T00:54:46', '2005-07-16T05:10:46', '1'), + ('102', '2448', '2006-02-16T02:30:53', '2005-07-06T06:27:15', '2005-07-12T10:36:15', '1'), + ('102', '529', '2006-02-16T02:30:53', '2005-07-31T04:15:38', '2005-08-02T04:24:38', '1'), + ('102', '242', '2006-02-16T02:30:53', '2005-06-15T03:21:00', '2005-06-19T03:39:00', '1'), + ('102', '2872', '2006-02-16T02:30:53', '2005-07-06T00:58:27', '2005-07-14T05:56:27', '1'), + ('102', '1796', '2006-02-16T02:30:53', '2005-08-19T22:57:25', '2005-08-28T22:46:25', '1'), + ('102', '198', '2006-02-16T02:30:53', '2005-07-29T15:36:27', '2005-08-04T20:11:27', '1'), + ('102', '449', '2006-02-16T02:30:53', '2005-07-08T15:48:34', '2005-07-16T15:25:34', '1'), + ('102', '1255', '2006-02-16T02:30:53', '2005-06-18T17:21:24', '2005-06-26T18:25:24', '1'), + ('102', '4091', '2006-02-16T02:30:53', '2005-07-27T17:42:31', '2005-08-05T16:34:31', '1'), + ('102', '2373', '2006-02-16T02:30:53', '2005-07-09T06:48:49', '2005-07-14T01:17:49', '1'), + ('102', '1732', '2006-02-16T02:30:53', '2005-07-27T05:55:32', '2005-07-29T03:19:32', '1'), + ('102', '494', '2006-02-16T02:30:53', '2005-07-30T16:18:39', '2005-08-03T12:46:39', '1'), + ('102', '4337', '2006-02-16T02:30:53', '2005-08-01T23:39:21', '2005-08-07T20:47:21', '1'), + ('102', '3241', '2006-02-16T02:30:53', '2005-07-31T10:10:22', '2005-08-02T11:43:22', '1'), + ('315', '2902', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('315', '2081', '2006-02-16T02:30:53', '2005-07-09T00:49:37', '2005-07-16T02:05:37', '1'), + ('315', '3312', '2006-02-16T02:30:53', '2005-07-09T07:25:35', '2005-07-18T05:05:35', '1'), + ('315', '3000', '2006-02-16T02:30:53', '2005-06-16T13:18:48', '2005-06-22T15:00:48', '1'), + ('315', '2673', '2006-02-16T02:30:53', '2005-08-21T00:46:01', '2005-08-27T23:44:01', '1'), + ('315', '56', '2006-02-16T02:30:53', '2005-08-02T13:43:49', '2005-08-08T13:16:49', '1'), + ('315', '3788', '2006-02-16T02:30:53', '2005-08-21T02:55:34', '2005-08-27T00:13:34', '1'), + ('161', '3576', '2006-02-16T02:30:53', '2005-08-17T13:06:00', '2005-08-20T11:44:00', '1'), + ('161', '1243', '2006-02-16T02:30:53', '2005-08-01T15:44:09', '2005-08-04T14:42:09', '1'), + ('161', '315', '2006-02-16T02:30:53', '2005-07-29T20:05:04', '2005-07-31T14:32:04', '1'), + ('161', '2', '2006-02-16T02:30:53', '2005-07-07T10:41:31', '2005-07-11T06:25:31', '1'), + ('161', '3427', '2006-02-16T02:30:53', '2005-05-28T06:26:16', '2005-05-30T02:02:16', '1'), + ('161', '1797', '2006-02-16T02:30:53', '2005-08-22T14:12:05', '2005-08-27T12:47:05', '1'), + ('161', '3845', '2006-02-16T02:30:53', '2005-05-28T03:27:37', '2005-06-04T05:47:37', '1'), + ('161', '2690', '2006-02-16T02:30:53', '2005-07-08T01:26:32', '2005-07-09T01:13:32', '1'), + ('161', '2206', '2006-02-16T02:30:53', '2005-07-30T21:08:32', '2005-08-02T00:43:32', '1'), + ('161', '1526', '2006-02-16T02:30:53', '2005-08-01T02:12:25', '2005-08-08T00:37:25', '1'), + ('161', '3139', '2006-02-16T02:30:53', '2005-07-09T17:35:35', '2005-07-18T14:05:35', '1'), + ('161', '802', '2006-02-16T02:30:53', '2005-07-12T20:20:50', '2005-07-17T01:51:50', '1'), + ('478', '2751', '2006-02-16T02:30:53', '2005-06-21T03:57:15', '2005-06-24T03:32:15', '1'), + ('478', '131', '2006-02-16T02:30:53', '2005-08-22T15:55:48', '2005-08-29T19:10:48', '1'), + ('478', '2176', '2006-02-16T02:30:53', '2005-07-29T08:57:38', '2005-08-02T04:16:38', '1'), + ('478', '2306', '2006-02-16T02:30:53', '2005-06-19T01:18:27', '2005-06-24T00:26:27', '1'), + ('478', '2183', '2006-02-16T02:30:53', '2005-07-31T18:13:06', '2005-08-09T22:11:06', '1'), + ('478', '2259', '2006-02-16T02:30:53', '2005-06-16T14:08:44', '2005-06-19T08:35:44', '1'), + ('478', '581', '2006-02-16T02:30:53', '2005-06-19T07:33:00', '2005-06-28T03:05:00', '1'), + ('478', '1845', '2006-02-16T02:30:53', '2005-08-19T13:28:26', '2005-08-24T17:37:26', '1'), + ('478', '2863', '2006-02-16T02:30:53', '2005-07-31T06:17:33', '2005-08-04T08:53:33', '1'), + ('478', '717', '2006-02-16T02:30:53', '2005-07-31T21:39:48', '2005-08-06T00:10:48', '1'), + ('478', '1937', '2006-02-16T02:30:53', '2005-07-06T09:46:12', '2005-07-07T14:08:12', '1'), + ('478', '1728', '2006-02-16T02:30:53', '2005-06-18T13:00:51', '2005-06-26T12:58:51', '1'), + ('478', '2038', '2006-02-16T02:30:53', '2005-07-27T21:11:03', '2005-08-02T16:40:03', '1'), + ('478', '1017', '2006-02-16T02:30:53', '2005-06-19T17:34:39', '2005-06-27T23:26:39', '1'), + ('390', '1501', '2006-02-16T02:30:53', '2005-08-19T22:46:46', '2005-08-24T22:52:46', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['9314', '10061', '3999', '12803', '4968', '1730', '2330', '9825', '7595', '6215', '4191', '6430', '15376', '15303', '10060', '5517', '5652', '4391', '6925', '5199', '8785', '8095', '10845', '15442', '8499', '14461', '6179', '8049', '635', '12499', '1534', '14122', '5295', '13535', '9376', '15715', '1822', '1924', '7874', '11916', '3207', '6872', '2141', '4571', '3611', '12870', '13374', '13379', '111', '3065', '15406', '3576', '1679', '4340', '4680', '1823', '3959', '12446', '13220', '6985', '3992', '6341', '1313', '2697', '4024', '14580', '3347', '8982', '5979', '1091', '5012', '14107', '10575', '3799', '12047', '15647', '311', '2359', '13076', '2047', '14973', '3708', '756', '13671', '10750', '3144', '2680', '7938', '255', '14158', '8496', '9717', '4025', '8590', '5418', '6188', '15646', '15528', '3094', '5624']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('390', '2358', '2006-02-16T02:30:53', '2005-07-30T17:05:19', '2005-07-31T12:19:19', '1'), + ('390', '1401', '2006-02-16T02:30:53', '2005-07-31T19:23:25', '2005-08-04T19:38:25', '1'), + ('390', '707', '2006-02-16T02:30:53', '2005-07-06T23:50:54', '2005-07-09T22:09:54', '1'), + ('390', '1058', '2006-02-16T02:30:53', '2005-08-19T00:28:21', '2005-08-23T02:02:21', '1'), + ('390', '3204', '2006-02-16T02:30:53', '2005-07-08T23:49:19', '2005-07-14T02:46:19', '1'), + ('390', '1372', '2006-02-16T02:30:53', '2005-06-16T15:30:01', '2005-06-19T12:56:01', '1'), + ('390', '4285', '2006-02-16T02:30:53', '2005-06-18T10:41:19', '2005-06-25T10:48:19', '1'), + ('390', '4322', '2006-02-16T02:30:53', '2005-07-31T11:50:51', '2005-08-02T07:18:51', '1'), + ('390', '4313', '2006-02-16T02:30:53', '2005-07-27T23:32:23', '2005-08-03T05:28:23', '1'), + ('390', '316', '2006-02-16T02:30:53', '2005-07-11T12:52:36', '2005-07-12T08:33:36', '1'), + ('390', '2475', '2006-02-16T02:30:53', '2005-07-07T10:56:14', '2005-07-11T09:56:14', '1'), + ('390', '178', '2006-02-16T02:30:53', '2005-07-12T00:03:34', '2005-07-15T03:11:34', '1'), + ('390', '2963', '2006-02-16T02:30:53', '2005-08-22T22:21:35', '2005-08-28T20:56:35', '1'), + ('390', '1672', '2006-02-16T02:30:53', '2005-08-22T19:44:59', '2005-08-30T21:59:59', '1'), + ('42', '1979', '2006-02-16T02:30:53', '2005-07-31T19:23:00', '2005-08-08T19:07:00', '1'), + ('42', '3689', '2006-02-16T02:30:53', '2005-07-10T01:15:00', '2005-07-19T01:59:00', '1'), + ('42', '927', '2006-02-16T02:30:53', '2005-07-10T07:18:58', '2005-07-19T07:52:58', '1'), + ('42', '2135', '2006-02-16T02:30:53', '2005-07-07T21:09:38', '2005-07-09T17:35:38', '1'), + ('42', '2919', '2006-02-16T02:30:53', '2005-07-26T22:52:32', '2005-07-29T21:22:32', '1'), + ('42', '349', '2006-02-16T02:30:53', '2005-07-09T10:50:56', '2005-07-10T06:43:56', '1'), + ('42', '216', '2006-02-16T02:30:53', '2005-07-29T20:36:26', '2005-07-30T15:06:26', '1'), + ('42', '2685', '2006-02-16T02:30:53', '2005-07-28T18:32:40', '2005-08-06T23:45:40', '1'), + ('42', '2737', '2006-02-16T02:30:53', '2005-08-01T23:47:03', '2005-08-08T01:57:03', '1'), + ('42', '1452', '2006-02-16T02:30:53', '2005-08-23T00:42:49', '2005-08-27T00:35:49', '1'), + ('42', '219', '2006-02-16T02:30:53', '2005-07-29T09:10:41', '2005-08-05T10:01:41', '1'), + ('42', '371', '2006-02-16T02:30:53', '2005-08-21T12:50:33', '2005-08-30T13:35:33', '1'), + ('42', '3665', '2006-02-16T02:30:53', '2005-07-11T10:59:59', '2005-07-17T06:02:59', '1'), + ('42', '673', '2006-02-16T02:30:53', '2005-07-28T16:51:58', '2005-07-31T22:18:58', '1'), + ('42', '1648', '2006-02-16T02:30:53', '2005-05-28T17:46:57', '2005-06-06T18:24:57', '1'), + ('42', '2611', '2006-02-16T02:30:53', '2005-08-18T13:05:37', '2005-08-19T07:41:37', '1'), + ('42', '3124', '2006-02-16T02:30:53', '2005-06-16T00:49:32', '2005-06-18T02:41:32', '1'), + ('86', '3955', '2006-02-16T02:30:53', '2005-08-21T01:29:01', '2005-08-27T05:31:01', '1'), + ('86', '4460', '2006-02-16T02:30:53', '2005-07-09T15:25:06', '2005-07-10T12:40:06', '1'), + ('86', '1563', '2006-02-16T02:30:53', '2005-08-20T03:30:25', '2005-08-28T04:35:25', '1'), + ('86', '451', '2006-02-16T02:30:53', '2005-07-30T19:11:49', '2005-08-04T18:14:49', '1'), + ('86', '3808', '2006-02-16T02:30:53', '2005-08-23T10:57:40', '2005-08-28T12:40:40', '1'), + ('86', '674', '2006-02-16T02:30:53', '2005-06-16T21:43:45', '2005-06-17T21:37:45', '1'), + ('86', '2577', '2006-02-16T02:30:53', '2005-06-17T06:13:34', '2005-06-18T01:51:34', '1'), + ('86', '2981', '2006-02-16T02:30:53', '2005-07-28T10:21:52', '2005-08-06T16:19:52', '1'), + ('86', '2631', '2006-02-16T02:30:53', '2005-08-17T16:05:51', '2005-08-20T10:23:51', '1'), + ('86', '4020', '2006-02-16T02:30:53', '2005-06-21T00:43:16', '2005-06-24T22:13:16', '1'), + ('86', '3246', '2006-02-16T02:30:53', '2005-07-12T20:15:04', '2005-07-18T18:19:04', '1'), + ('86', '2176', '2006-02-16T02:30:53', '2005-06-17T21:41:34', '2005-06-19T00:15:34', '1'), + ('86', '2416', '2006-02-16T02:30:53', '2005-07-08T05:34:41', '2005-07-17T02:15:41', '1'), + ('86', '4502', '2006-02-16T02:30:53', '2005-07-06T05:37:18', '2005-07-10T05:14:18', '1'), + ('86', '991', '2006-02-16T02:30:53', '2005-08-19T02:54:38', '2005-08-27T00:45:38', '1'), + ('227', '2721', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('227', '1623', '2006-02-16T02:30:53', '2005-08-19T21:33:39', '2005-08-22T21:00:39', '1'), + ('227', '3725', '2006-02-16T02:30:53', '2005-05-25T18:45:19', '2005-05-28T17:18:19', '1'), + ('227', '1687', '2006-02-16T02:30:53', '2005-06-20T13:53:53', '2005-06-24T11:31:53', '1'), + ('227', '400', '2006-02-16T02:30:53', '2005-08-22T23:21:22', '2005-08-28T22:21:22', '1'), + ('227', '324', '2006-02-16T02:30:53', '2005-07-06T03:40:01', '2005-07-15T07:22:01', '1'), + ('227', '3959', '2006-02-16T02:30:53', '2005-06-16T11:11:01', '2005-06-23T08:11:01', '1'), + ('227', '3919', '2006-02-16T02:30:53', '2005-07-07T18:41:46', '2005-07-16T21:27:46', '1'), + ('227', '4043', '2006-02-16T02:30:53', '2005-07-08T10:35:28', '2005-07-14T08:42:28', '1'), + ('448', '3871', '2006-02-16T02:30:53', '2005-06-16T21:48:16', '2005-06-22T03:09:16', '1'), + ('448', '40', '2006-02-16T02:30:53', '2005-07-06T22:07:58', '2005-07-13T02:30:58', '1'), + ('448', '2138', '2006-02-16T02:30:53', '2005-08-18T10:56:29', '2005-08-23T05:30:29', '1'), + ('448', '1017', '2006-02-16T02:30:53', '2005-08-19T15:42:32', '2005-08-25T13:37:32', '1'), + ('448', '1834', '2006-02-16T02:30:53', '2005-07-27T00:57:42', '2005-07-31T00:53:42', '1'), + ('448', '3219', '2006-02-16T02:30:53', '2005-07-06T23:36:56', '2005-07-15T03:13:56', '1'), + ('448', '3580', '2006-02-16T02:30:53', '2005-07-11T19:48:02', '2005-07-15T01:31:02', '1'), + ('448', '1657', '2006-02-16T02:30:53', '2005-06-15T10:18:34', '2005-06-23T06:25:34', '1'), + ('448', '2271', '2006-02-16T02:30:53', '2005-06-19T13:29:08', '2005-06-23T13:21:08', '1'), + ('448', '3976', '2006-02-16T02:30:53', '2005-07-07T02:11:23', '2005-07-11T02:00:23', '1'), + ('448', '1440', '2006-02-16T02:30:53', '2005-08-21T16:56:39', '2005-08-28T15:25:39', '1'), + ('448', '4330', '2006-02-16T02:30:53', '2005-06-21T11:08:32', '2005-06-28T09:59:32', '1'), + ('251', '1128', '2006-02-16T02:30:53', '2005-07-30T04:31:02', '2005-07-31T04:22:02', '1'), + ('251', '1736', '2006-02-16T02:30:53', '2005-07-11T00:17:09', '2005-07-14T00:38:09', '1'), + ('251', '3853', '2006-02-16T02:30:53', '2005-05-31T12:11:04', '2005-06-04T11:42:04', '1'), + ('251', '1456', '2006-02-16T02:30:53', '2005-07-09T01:45:04', '2005-07-12T02:13:04', '1'), + ('251', '3998', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('251', '4447', '2006-02-16T02:30:53', '2005-08-01T13:41:41', '2005-08-08T11:30:41', '1'), + ('251', '4532', '2006-02-16T02:30:53', '2005-07-06T15:00:14', '2005-07-10T15:39:14', '1'), + ('251', '3886', '2006-02-16T02:30:53', '2005-08-17T20:48:32', '2005-08-26T00:07:32', '1'), + ('251', '2051', '2006-02-16T02:30:53', '2005-08-23T08:23:56', '2005-08-26T11:00:56', '1'), + ('201', '2830', '2006-02-16T02:30:53', '2005-05-26T22:51:37', '2005-06-01T00:02:37', '1'), + ('201', '3087', '2006-02-16T02:30:53', '2005-06-18T13:04:42', '2005-06-25T11:52:42', '1'), + ('201', '1226', '2006-02-16T02:30:53', '2005-08-19T10:10:26', '2005-08-22T05:41:26', '1'), + ('201', '2371', '2006-02-16T02:30:53', '2005-06-17T14:40:58', '2005-06-21T08:52:58', '1'), + ('201', '2888', '2006-02-16T02:30:53', '2005-08-22T06:59:28', '2005-08-30T02:28:28', '1'), + ('201', '2105', '2006-02-16T02:30:53', '2005-07-06T10:23:27', '2005-07-14T09:26:27', '1'), + ('201', '3152', '2006-02-16T02:30:53', '2005-05-29T10:28:45', '2005-06-04T12:50:45', '1'), + ('201', '1473', '2006-02-16T02:30:53', '2005-08-20T08:27:03', '2005-08-26T03:56:03', '1'), + ('201', '3206', '2006-02-16T02:30:53', '2005-08-01T20:06:00', '2005-08-07T15:48:00', '1'), + ('114', '1300', '2006-02-16T02:30:53', '2005-06-20T20:14:20', '2005-06-30T01:46:20', '1'), + ('114', '865', '2006-02-16T02:30:53', '2005-06-19T12:13:37', '2005-06-27T15:15:37', '1'), + ('114', '2579', '2006-02-16T02:30:53', '2005-07-28T12:39:11', '2005-08-04T16:56:11', '1'), + ('114', '3264', '2006-02-16T02:30:53', '2005-05-26T14:52:15', '2005-05-27T12:45:15', '1'), + ('114', '474', '2006-02-16T02:30:53', '2005-08-21T02:43:20', '2005-08-28T02:19:20', '1'), + ('114', '765', '2006-02-16T02:30:53', '2005-07-29T09:05:33', '2005-08-02T06:32:33', '1'), + ('114', '4207', '2006-02-16T02:30:53', '2005-07-31T08:24:41', '2005-08-04T02:51:41', '1'), + ('114', '3908', '2006-02-16T02:30:53', '2005-07-07T02:13:24', '2005-07-08T00:47:24', '1'), + ('114', '2505', '2006-02-16T02:30:53', '2005-07-29T12:32:20', '2005-08-07T08:00:20', '1'), + ('114', '55', '2006-02-16T02:30:53', '2005-07-09T20:41:35', '2005-07-14T00:15:35', '1'), + ('114', '189', '2006-02-16T02:30:53', '2005-07-11T11:31:47', '2005-07-15T09:28:47', '1'), + ('114', '3217', '2006-02-16T02:30:53', '2005-08-23T08:19:55', '2005-08-29T02:32:55', '1'), + ('114', '3033', '2006-02-16T02:30:53', '2005-08-23T03:45:40', '2005-08-25T01:16:40', '1'), + ('114', '2048', '2006-02-16T02:30:53', '2005-06-20T16:06:51', '2005-06-24T13:23:51', '1'), + ('114', '1015', '2006-02-16T02:30:53', '2005-07-10T05:43:16', '2005-07-12T05:33:16', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['8479', '13741', '9994', '6175', '11787', '4234', '9870', '11201', '3271', '9721', '2912', '1348', '10122', '1053', '5768', '12836', '6857', '5143', '1182', '10191', '8472', '13799', '9804', '4999', '9346', '12430', '11104', '12684', '8266', '4879', '1880', '14087', '7325', '3123', '6007', '5089', '3588', '10297', '13336', '2784', '7162', '13211', '13256', '14729', '13891', '11550', '6425', '6072', '8968', '7244', '4243', '5720', '3335', '4467', '11699', '1536', '1629', '11582', '8151', '9741', '8451', '15984', '2074', '623', '5484', '7191', '13753', '12782', '10783', '3966', '13445', '3129', '741', '6426', '13818', '4060', '8961', '5699', '10928', '7975', '4441', '238', '6438', '12746', '15538', '11076', '14812', '2812', '13979', '14782', '4857', '5668', '2789', '9038', '11675', '3860', '12302', '13344', '14386', '3084']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('195', '1990', '2006-02-16T02:30:53', '2005-07-29T08:42:04', '2005-08-01T03:10:04', '1'), + ('195', '3887', '2006-02-16T02:30:53', '2005-08-20T10:48:47', '2005-08-21T11:19:47', '1'), + ('195', '2155', '2006-02-16T02:30:53', '2005-07-31T17:30:31', '2005-08-01T11:35:31', '1'), + ('195', '3037', '2006-02-16T02:30:53', '2005-07-11T10:44:37', '2005-07-15T08:13:37', '1'), + ('195', '1980', '2006-02-16T02:30:53', '2005-08-17T10:59:00', '2005-08-19T05:56:00', '1'), + ('195', '1179', '2006-02-16T02:30:53', '2005-07-07T13:01:35', '2005-07-15T13:05:35', '1'), + ('195', '442', '2006-02-16T02:30:53', '2005-07-31T13:22:51', '2005-08-05T16:04:51', '1'), + ('195', '1501', '2006-02-16T02:30:53', '2005-08-02T11:49:16', '2005-08-11T08:39:16', '1'), + ('196', '4191', '2006-02-16T02:30:53', '2005-06-21T05:16:10', '2005-06-27T10:46:10', '1'), + ('196', '3942', '2006-02-16T02:30:53', '2005-07-31T08:28:46', '2005-08-05T14:03:46', '1'), + ('196', '1076', '2006-02-16T02:30:53', '2005-06-20T03:32:45', '2005-06-21T23:32:45', '1'), + ('196', '2078', '2006-02-16T02:30:53', '2005-06-15T12:45:30', '2005-06-17T17:12:30', '1'), + ('196', '4229', '2006-02-16T02:30:53', '2005-07-31T21:29:28', '2005-08-09T00:04:28', '1'), + ('196', '3734', '2006-02-16T02:30:53', '2005-05-31T07:12:44', '2005-06-04T12:33:44', '1'), + ('196', '345', '2006-02-16T02:30:53', '2005-07-10T13:15:26', '2005-07-15T09:42:26', '1'), + ('196', '1380', '2006-02-16T02:30:53', '2005-08-19T01:48:33', '2005-08-23T04:46:33', '1'), + ('196', '424', '2006-02-16T02:30:53', '2005-07-12T19:53:30', '2005-07-13T15:22:30', '1'), + ('196', '3803', '2006-02-16T02:30:53', '2005-07-09T08:07:07', '2005-07-18T10:17:07', '1'), + ('196', '1061', '2006-02-16T02:30:53', '2005-06-15T00:45:21', '2005-06-22T03:52:21', '1'), + ('196', '1131', '2006-02-16T02:30:53', '2005-08-01T00:28:38', '2005-08-06T02:23:38', '1'), + ('196', '2975', '2006-02-16T02:30:53', '2005-07-29T08:36:22', '2005-08-02T07:55:22', '1'), + ('196', '4413', '2006-02-16T02:30:53', '2005-08-20T12:36:42', '2005-08-28T08:47:42', '1'), + ('196', '2490', '2006-02-16T02:30:53', '2005-07-31T11:07:39', '2005-08-09T11:57:39', '1'), + ('196', '1797', '2006-02-16T02:30:53', '2005-07-09T01:12:57', '2005-07-17T00:12:57', '1'), + ('196', '2845', '2006-02-16T02:30:53', '2005-07-30T18:13:52', '2005-08-03T17:58:52', '1'), + ('196', '2840', '2006-02-16T02:30:53', '2005-08-18T10:32:41', '2005-08-22T16:16:41', '1'), + ('196', '3042', '2006-02-16T02:30:53', '2005-08-02T08:09:58', '2005-08-05T11:55:58', '1'), + ('196', '978', '2006-02-16T02:30:53', '2005-08-18T19:51:27', '2005-08-19T15:56:27', '1'), + ('196', '1972', '2006-02-16T02:30:53', '2005-07-29T01:20:16', '2005-07-30T04:31:16', '1'), + ('196', '1406', '2006-02-16T02:30:53', '2005-07-08T19:34:55', '2005-07-09T15:53:55', '1'), + ('289', '1133', '2006-02-16T02:30:53', '2005-06-17T03:08:59', '2005-06-19T07:16:59', '1'), + ('289', '2368', '2006-02-16T02:30:53', '2005-08-20T23:53:40', '2005-08-26T20:22:40', '1'), + ('289', '1727', '2006-02-16T02:30:53', '2005-07-27T13:46:55', '2005-07-28T14:21:55', '1'), + ('289', '1656', '2006-02-16T02:30:53', '2005-06-20T18:26:14', '2005-06-29T17:17:14', '1'), + ('289', '4393', '2006-02-16T02:30:53', '2005-07-11T01:43:06', '2005-07-17T04:46:06', '1'), + ('289', '451', '2006-02-16T02:30:53', '2005-07-09T05:45:40', '2005-07-15T05:31:40', '1'), + ('289', '3154', '2006-02-16T02:30:53', '2005-07-06T04:29:13', '2005-07-07T23:49:13', '1'), + ('289', '2795', '2006-02-16T02:30:53', '2005-08-01T04:05:04', '2005-08-09T06:08:04', '1'), + ('289', '1011', '2006-02-16T02:30:53', '2005-08-19T20:03:22', '2005-08-24T23:42:22', '1'), + ('289', '2305', '2006-02-16T02:30:53', '2005-06-19T18:40:29', '2005-06-28T15:27:29', '1'), + ('289', '2251', '2006-02-16T02:30:53', '2005-07-27T07:32:45', '2005-07-30T03:48:45', '1'), + ('289', '1968', '2006-02-16T02:30:53', '2005-08-19T15:23:41', '2005-08-22T16:58:41', '1'), + ('289', '2719', '2006-02-16T02:30:53', '2005-08-19T16:54:12', '2005-08-28T16:54:12', '1'), + ('289', '2483', '2006-02-16T02:30:53', '2005-08-21T22:16:57', '2005-08-27T21:32:57', '1'), + ('289', '2042', '2006-02-16T02:30:53', '2005-08-20T15:42:05', '2005-08-25T13:26:05', '1'), + ('339', '2972', '2006-02-16T02:30:53', '2005-08-17T01:02:06', '2005-08-22T21:44:06', '1'), + ('339', '2487', '2006-02-16T02:30:53', '2005-07-11T23:54:52', '2005-07-13T18:37:52', '1'), + ('339', '1790', '2006-02-16T02:30:53', '2005-07-11T04:52:40', '2005-07-18T01:02:40', '1'), + ('339', '2280', '2006-02-16T02:30:53', '2005-07-30T03:57:32', '2005-07-31T00:09:32', '1'), + ('339', '1329', '2006-02-16T02:30:53', '2005-07-27T10:27:33', '2005-07-30T13:09:33', '1'), + ('339', '4559', '2006-02-16T02:30:53', '2005-07-07T13:39:58', '2005-07-12T19:27:58', '1'), + ('339', '576', '2006-02-16T02:30:53', '2005-07-10T11:09:12', '2005-07-16T07:31:12', '1'), + ('339', '3033', '2006-02-16T02:30:53', '2005-06-21T10:09:08', '2005-06-27T11:33:08', '1'), + ('339', '4466', '2006-02-16T02:30:53', '2005-07-08T00:13:52', '2005-07-09T00:52:52', '1'), + ('339', '3997', '2006-02-16T02:30:53', '2005-08-17T07:11:58', '2005-08-26T12:08:58', '1'), + ('339', '3248', '2006-02-16T02:30:53', '2005-06-16T00:52:22', '2005-06-17T21:43:22', '1'), + ('339', '4375', '2006-02-16T02:30:53', '2005-06-16T07:53:47', '2005-06-22T13:03:47', '1'), + ('339', '2115', '2006-02-16T02:30:53', '2005-08-17T02:03:49', '2005-08-24T03:29:49', '1'), + ('495', '4370', '2006-02-16T02:30:53', '2005-07-28T20:50:52', '2005-07-31T14:50:52', '1'), + ('495', '1971', '2006-02-16T02:30:53', '2005-07-31T09:09:22', '2005-08-07T10:01:22', '1'), + ('495', '3309', '2006-02-16T02:30:53', '2005-07-29T07:44:56', '2005-08-06T02:29:56', '1'), + ('495', '2011', '2006-02-16T02:30:53', '2005-08-23T20:16:27', '2005-08-27T01:43:27', '1'), + ('495', '71', '2006-02-16T02:30:53', '2005-06-17T16:40:03', '2005-06-20T21:34:03', '1'), + ('495', '1222', '2006-02-16T02:30:53', '2005-05-28T16:01:28', '2005-05-30T11:19:28', '1'), + ('495', '3248', '2006-02-16T02:30:53', '2005-07-09T23:54:37', '2005-07-15T02:05:37', '1'), + ('495', '4292', '2006-02-16T02:30:53', '2005-07-27T08:36:15', '2005-08-03T08:54:15', '1'), + ('495', '3746', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('495', '1454', '2006-02-16T02:30:53', '2005-08-18T23:56:23', '2005-08-25T18:47:23', '1'), + ('495', '1192', '2006-02-16T02:30:53', '2005-08-01T21:23:37', '2005-08-09T20:18:37', '1'), + ('495', '556', '2006-02-16T02:30:53', '2005-07-06T22:38:49', '2005-07-07T23:33:49', '1'), + ('495', '1630', '2006-02-16T02:30:53', '2005-08-20T00:05:33', '2005-08-21T21:20:33', '1'), + ('495', '1789', '2006-02-16T02:30:53', '2005-06-20T18:57:48', '2005-06-28T13:45:48', '1'), + ('495', '3189', '2006-02-16T02:30:53', '2005-05-29T08:35:49', '2005-06-04T11:55:49', '1'), + ('495', '498', '2006-02-16T02:30:53', '2005-07-11T23:56:38', '2005-07-21T05:22:38', '1'), + ('495', '1283', '2006-02-16T02:30:53', '2005-08-20T13:20:09', '2005-08-21T18:41:09', '1'), + ('211', '2697', '2006-02-16T02:30:53', '2005-07-07T04:10:13', '2005-07-13T07:44:13', '1'), + ('211', '3679', '2006-02-16T02:30:53', '2005-07-30T03:43:35', '2005-08-06T07:42:35', '1'), + ('211', '958', '2006-02-16T02:30:53', '2005-07-10T09:48:04', '2005-07-17T09:07:04', '1'), + ('211', '2885', '2006-02-16T02:30:53', '2005-08-02T02:34:12', '2005-08-07T21:13:12', '1'), + ('211', '2565', '2006-02-16T02:30:53', '2005-07-28T14:12:47', '2005-08-05T09:18:47', '1'), + ('211', '3680', '2006-02-16T02:30:53', '2005-07-07T23:04:23', '2005-07-13T19:07:23', '1'), + ('211', '503', '2006-02-16T02:30:53', '2005-05-26T12:30:22', '2005-05-27T06:49:22', '1'), + ('211', '412', '2006-02-16T02:30:53', '2005-07-12T00:23:01', '2005-07-17T22:45:01', '1'), + ('211', '1012', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('211', '4226', '2006-02-16T02:30:53', '2005-08-23T04:07:37', '2005-08-28T07:37:37', '1'), + ('211', '837', '2006-02-16T02:30:53', '2005-08-02T07:24:47', '2005-08-10T09:16:47', '1'), + ('211', '4282', '2006-02-16T02:30:53', '2005-08-22T01:10:32', '2005-08-26T05:21:32', '1'), + ('211', '3016', '2006-02-16T02:30:53', '2005-06-19T19:58:16', '2005-06-26T15:26:16', '1'), + ('211', '2998', '2006-02-16T02:30:53', '2005-08-20T19:03:49', '2005-08-24T21:23:49', '1'), + ('211', '1727', '2006-02-16T02:30:53', '2005-08-22T00:17:20', '2005-08-23T01:24:20', '1'), + ('211', '2069', '2006-02-16T02:30:53', '2005-07-08T18:52:07', '2005-07-11T22:06:07', '1'), + ('211', '309', '2006-02-16T02:30:53', '2005-07-10T08:11:05', '2005-07-16T13:15:05', '1'), + ('514', '2398', '2006-02-16T02:30:53', '2005-06-19T18:48:21', '2005-06-21T21:50:21', '1'), + ('514', '217', '2006-02-16T02:30:53', '2005-07-30T06:23:35', '2005-08-06T11:10:35', '1'), + ('514', '1322', '2006-02-16T02:30:53', '2005-08-17T05:57:54', '2005-08-21T23:57:54', '1'), + ('514', '144', '2006-02-16T02:30:53', '2005-07-06T17:20:24', '2005-07-09T22:33:24', '1'), + ('514', '765', '2006-02-16T02:30:53', '2005-08-18T05:41:39', '2005-08-22T06:02:39', '1'), + ('514', '4392', '2006-02-16T02:30:53', '2005-08-19T20:22:44', '2005-08-25T18:39:44', '1'), + ('514', '3402', '2006-02-16T02:30:53', '2005-08-21T10:06:34', '2005-08-25T14:19:34', '1'), + ('514', '3578', '2006-02-16T02:30:53', '2005-06-20T15:35:24', '2005-06-23T19:11:24', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['2362', '12578', '7791', '3668', '12752', '15776', '5158', '11881', '1072', '9787', '13903', '10736', '11597', '7300', '12006', '33', '8221', '11893', '966', '11060', '322', '4269', '13569', '12605', '3569', '14332', '5559', '4261', '15578', '38', '15734', '12126', '9146', '8363', '7183', '14247', '5821', '12516', '10329', '9581', '5709', '13916', '7411', '7542', '6160', '7474', '7570', '3587', '12585', '6287', '15324', '14195', '13950', '5130', '15631', '6586', '4733', '3109', '13904', '13555', '15160', '14285', '11124', '11159', '2129', '13981', '7881', '5639', '11668', '14731', '15721', '7156', '12341', '6048', '10278', '5101', '7055', '10851', '469', '15351', '11296', '978', '4252', '4132', '5760', '15109', '10373', '15209', '7903', '12185', '15158', '8429', '2453', '3628', '13064', '14084', '923', '13493', '15028', '8419']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('514', '2815', '2006-02-16T02:30:53', '2005-06-18T13:31:15', '2005-06-19T12:35:15', '1'), + ('514', '930', '2006-02-16T02:30:53', '2005-08-18T15:47:11', '2005-08-21T10:55:11', '1'), + ('514', '822', '2006-02-16T02:30:53', '2005-07-28T07:22:51', '2005-07-30T03:09:51', '1'), + ('514', '269', '2006-02-16T02:30:53', '2005-07-06T08:36:48', '2005-07-10T11:31:48', '1'), + ('514', '3595', '2006-02-16T02:30:53', '2005-08-18T22:33:36', '2005-08-27T23:55:36', '1'), + ('514', '43', '2006-02-16T02:30:53', '2005-08-23T13:26:01', '2005-08-29T18:17:01', '1'), + ('272', '2825', '2006-02-16T02:30:53', '2005-07-09T08:53:09', '2005-07-10T11:05:09', '1'), + ('272', '3124', '2006-02-16T02:30:53', '2005-08-17T14:31:56', '2005-08-21T11:05:56', '1'), + ('272', '2557', '2006-02-16T02:30:53', '2005-05-31T09:52:50', '2005-06-05T05:39:50', '1'), + ('272', '3559', '2006-02-16T02:30:53', '2005-07-31T10:26:19', '2005-08-09T09:02:19', '1'), + ('272', '1676', '2006-02-16T02:30:53', '2005-08-20T16:07:55', '2005-08-25T18:26:55', '1'), + ('272', '2227', '2006-02-16T02:30:53', '2005-08-01T19:30:21', '2005-08-02T22:37:21', '1'), + ('272', '4073', '2006-02-16T02:30:53', '2005-08-17T03:02:56', '2005-08-26T04:47:56', '1'), + ('272', '4561', '2006-02-16T02:30:53', '2005-07-27T12:50:17', '2005-08-04T18:43:17', '1'), + ('272', '4072', '2006-02-16T02:30:53', '2005-08-17T19:09:12', '2005-08-24T13:50:12', '1'), + ('272', '1681', '2006-02-16T02:30:53', '2005-05-25T04:18:51', '2005-05-27T03:58:51', '1'), + ('496', '3138', '2006-02-16T02:30:53', '2005-07-28T23:47:19', '2005-08-02T20:42:19', '1'), + ('496', '2321', '2006-02-16T02:30:53', '2005-08-17T15:13:29', '2005-08-25T11:09:29', '1'), + ('496', '1294', '2006-02-16T02:30:53', '2005-05-30T19:00:37', '2005-05-31T23:51:37', '1'), + ('496', '3395', '2006-02-16T02:30:53', '2005-08-02T06:48:18', '2005-08-10T11:49:18', '1'), + ('496', '4556', '2006-02-16T02:30:53', '2005-05-27T00:47:35', '2005-06-02T00:32:35', '1'), + ('496', '415', '2006-02-16T02:30:53', '2005-07-07T14:38:33', '2005-07-09T10:27:33', '1'), + ('496', '1934', '2006-02-16T02:30:53', '2005-08-20T05:02:59', '2005-08-28T00:51:59', '1'), + ('496', '1359', '2006-02-16T02:30:53', '2005-08-18T16:59:37', '2005-08-20T18:09:37', '1'), + ('496', '1929', '2006-02-16T02:30:53', '2005-07-06T03:17:23', '2005-07-14T03:58:23', '1'), + ('496', '1388', '2006-02-16T02:30:53', '2005-08-21T08:30:43', '2005-08-29T10:51:43', '1'), + ('496', '4122', '2006-02-16T02:30:53', '2005-07-10T03:13:07', '2005-07-18T08:33:07', '1'), + ('496', '1405', '2006-02-16T02:30:53', '2005-07-07T14:23:56', '2005-07-13T15:26:56', '1'), + ('302', '2829', '2006-02-16T02:30:53', '2005-08-23T05:37:13', '2005-08-27T01:11:13', '1'), + ('302', '2540', '2006-02-16T02:30:53', '2005-05-25T04:47:44', '2005-06-01T00:58:44', '1'), + ('302', '3952', '2006-02-16T02:30:53', '2005-08-23T11:40:08', '2005-08-27T08:16:08', '1'), + ('302', '2304', '2006-02-16T02:30:53', '2005-08-17T23:25:21', '2005-08-23T21:51:21', '1'), + ('302', '483', '2006-02-16T02:30:53', '2005-07-30T10:32:08', '2005-08-08T14:30:08', '1'), + ('302', '1607', '2006-02-16T02:30:53', '2005-07-29T05:10:08', '2005-08-06T00:11:08', '1'), + ('302', '3384', '2006-02-16T02:30:53', '2005-07-27T08:18:38', '2005-08-01T03:24:38', '1'), + ('302', '267', '2006-02-16T02:30:53', '2005-08-21T05:35:17', '2005-08-26T03:22:17', '1'), + ('302', '147', '2006-02-16T02:30:53', '2005-07-10T16:07:16', '2005-07-14T19:48:16', '1'), + ('302', '1332', '2006-02-16T02:30:53', '2005-08-18T13:39:53', '2005-08-20T08:33:53', '1'), + ('302', '2289', '2006-02-16T02:30:53', '2005-08-01T04:56:13', '2005-08-03T03:54:13', '1'), + ('302', '2588', '2006-02-16T02:30:53', '2005-07-31T03:03:07', '2005-08-05T23:01:07', '1'), + ('302', '732', '2006-02-16T02:30:53', '2005-07-10T10:31:52', '2005-07-12T10:47:52', '1'), + ('302', '2971', '2006-02-16T02:30:53', '2005-08-20T16:43:02', '2005-08-25T19:21:02', '1'), + ('302', '515', '2006-02-16T02:30:53', '2005-07-27T16:42:30', '2005-08-05T17:38:30', '1'), + ('110', '1912', '2006-02-16T02:30:53', '2005-07-27T21:43:04', '2005-07-30T00:02:04', '1'), + ('110', '2716', '2006-02-16T02:30:53', '2005-07-11T10:08:13', '2005-07-14T08:18:13', '1'), + ('110', '2971', '2006-02-16T02:30:53', '2005-07-27T19:07:17', '2005-07-30T00:37:17', '1'), + ('110', '3189', '2006-02-16T02:30:53', '2005-07-27T22:40:06', '2005-07-28T23:14:06', '1'), + ('110', '462', '2006-02-16T02:30:53', '2005-07-06T04:27:52', '2005-07-13T08:19:52', '1'), + ('110', '773', '2006-02-16T02:30:53', '2005-08-18T15:52:12', '2005-08-22T21:00:12', '1'), + ('93', '35', '2006-02-16T02:30:53', '2005-07-11T17:00:04', '2005-07-12T13:16:04', '1'), + ('93', '161', '2006-02-16T02:30:53', '2005-08-22T20:23:13', '2005-08-29T18:23:13', '1'), + ('93', '3732', '2006-02-16T02:30:53', '2005-08-21T03:40:35', '2005-08-23T01:22:35', '1'), + ('93', '3978', '2006-02-16T02:30:53', '2005-08-20T17:58:00', '2005-08-29T23:23:00', '1'), + ('93', '3264', '2006-02-16T02:30:53', '2005-07-09T07:29:45', '2005-07-13T05:56:45', '1'), + ('93', '2458', '2006-02-16T02:30:53', '2005-08-23T07:30:23', '2005-08-24T07:23:23', '1'), + ('93', '3860', '2006-02-16T02:30:53', '2005-07-12T06:56:24', '2005-07-17T09:36:24', '1'), + ('93', '2230', '2006-02-16T02:30:53', '2005-07-08T13:12:07', '2005-07-13T07:34:07', '1'), + ('93', '977', '2006-02-16T02:30:53', '2005-06-20T17:33:55', '2005-06-22T23:09:55', '1'), + ('93', '721', '2006-02-16T02:30:53', '2005-08-20T16:11:34', '2005-08-26T12:46:34', '1'), + ('93', '3176', '2006-02-16T02:30:53', '2005-08-20T04:09:50', '2005-08-29T05:20:50', '1'), + ('249', '4321', '2006-02-16T02:30:53', '2005-08-22T14:33:50', '2005-08-28T11:26:50', '1'), + ('249', '402', '2006-02-16T02:30:53', '2005-08-21T06:50:48', '2005-08-28T11:35:48', '1'), + ('249', '698', '2006-02-16T02:30:53', '2005-08-02T08:55:25', '2005-08-10T10:59:25', '1'), + ('249', '4575', '2006-02-16T02:30:53', '2005-08-02T10:00:55', '2005-08-05T10:38:55', '1'), + ('249', '1930', '2006-02-16T02:30:53', '2005-06-17T20:58:32', '2005-06-23T22:22:32', '1'), + ('249', '3342', '2006-02-16T02:30:53', '2005-08-20T19:07:20', '2005-08-23T15:13:20', '1'), + ('249', '533', '2006-02-16T02:30:53', '2005-07-28T10:33:22', '2005-08-02T12:10:22', '1'), + ('249', '2452', '2006-02-16T02:30:53', '2005-07-10T06:33:39', '2005-07-19T07:47:39', '1'), + ('249', '2162', '2006-02-16T02:30:53', '2005-08-17T05:47:32', '2005-08-20T03:11:32', '1'), + ('154', '1351', '2006-02-16T02:30:53', '2005-08-21T22:21:49', '2005-08-24T16:27:49', '1'), + ('154', '685', '2006-02-16T02:30:53', '2005-08-23T11:16:16', '2005-08-28T10:21:16', '1'), + ('154', '34', '2006-02-16T02:30:53', '2005-07-27T07:19:34', '2005-07-31T04:31:34', '1'), + ('154', '130', '2006-02-16T02:30:53', '2005-08-18T07:09:27', '2005-08-21T03:44:27', '1'), + ('154', '975', '2006-02-16T02:30:53', '2005-07-11T03:32:23', '2005-07-14T07:39:23', '1'), + ('154', '2497', '2006-02-16T02:30:53', '2005-08-01T03:25:27', '2005-08-08T07:52:27', '1'), + ('154', '2737', '2006-02-16T02:30:53', '2005-07-09T06:21:29', '2005-07-11T02:58:29', '1'), + ('154', '4305', '2006-02-16T02:30:53', '2005-07-27T03:45:42', '2005-07-30T05:11:42', '1'), + ('154', '1359', '2006-02-16T02:30:53', '2005-08-01T23:58:45', '2005-08-04T00:59:45', '1'), + ('154', '4463', '2006-02-16T02:30:53', '2005-05-27T21:14:26', '2005-06-05T21:51:26', '1'), + ('154', '3260', '2006-02-16T02:30:53', '2005-08-22T21:15:46', '2005-08-23T17:38:46', '1'), + ('154', '247', '2006-02-16T02:30:53', '2005-08-02T15:15:27', '2005-08-11T16:12:27', '1'), + ('154', '407', '2006-02-16T02:30:53', '2005-05-30T21:30:52', '2005-06-07T16:22:52', '1'), + ('154', '474', '2006-02-16T02:30:53', '2005-07-07T14:13:05', '2005-07-09T14:17:05', '1'), + ('154', '993', '2006-02-16T02:30:53', '2005-07-07T08:06:07', '2005-07-10T14:04:07', '1'), + ('154', '1050', '2006-02-16T02:30:53', '2005-07-10T12:44:48', '2005-07-14T12:25:48', '1'), + ('588', '565', '2006-02-16T02:30:53', '2005-08-22T12:12:58', '2005-08-30T07:20:58', '1'), + ('588', '1754', '2006-02-16T02:30:53', '2005-08-01T06:24:26', '2005-08-02T12:07:26', '1'), + ('588', '1620', '2006-02-16T02:30:53', '2005-08-22T16:37:32', '2005-08-25T19:04:32', '1'), + ('588', '2767', '2006-02-16T02:30:53', '2005-07-28T11:20:36', '2005-07-31T09:16:36', '1'), + ('588', '1558', '2006-02-16T02:30:53', '2005-08-18T01:40:14', '2005-08-25T05:04:14', '1'), + ('588', '3614', '2006-02-16T02:30:53', '2005-08-22T14:30:39', '2005-08-27T15:55:39', '1'), + ('588', '2456', '2006-02-16T02:30:53', '2005-07-29T07:11:49', '2005-07-31T02:45:49', '1'), + ('588', '2562', '2006-02-16T02:30:53', '2005-06-18T19:30:53', '2005-06-20T17:22:53', '1'), + ('588', '3509', '2006-02-16T02:30:53', '2005-07-06T06:19:43', '2005-07-07T02:23:43', '1'), + ('588', '4131', '2006-02-16T02:30:53', '2005-08-19T09:46:53', '2005-08-21T08:29:53', '1'), + ('37', '900', '2006-02-16T02:30:53', '2005-08-20T23:42:46', '2005-08-24T20:06:46', '1'), + ('37', '1884', '2006-02-16T02:30:53', '2005-05-30T11:58:50', '2005-06-05T09:57:50', '1'), + ('37', '2927', '2006-02-16T02:30:53', '2005-08-20T01:33:36', '2005-08-24T06:32:36', '1'), + ('37', '4248', '2006-02-16T02:30:53', '2005-08-22T09:03:44', '2005-08-30T11:28:44', '1'), + ('37', '4574', '2006-02-16T02:30:53', '2005-07-29T06:54:48', '2005-08-06T05:02:48', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['16035', '1583', '1854', '13147', '3734', '14025', '398', '12907', '14861', '15272', '2747', '2778', '15316', '10833', '5784', '13722', '4504', '13625', '8206', '4463', '11325', '13709', '7827', '11842', '4424', '2020', '11773', '1961', '5608', '8445', '13521', '14416', '3088', '2510', '5250', '103', '7034', '1485', '14196', '4607', '13641', '650', '8180', '6825', '2786', '360', '3474', '10704', '3546', '1816', '4037', '14999', '3302', '1045', '9802', '9545', '6473', '11966', '3672', '4876', '15837', '4683', '6300', '9478', '2849', '6313', '6075', '3534', '5989', '11637', '3568', '6827', '1796', '2685', '3530', '11551', '4308', '9899', '12781', '1222', '404', '6444', '12545', '6809', '9197', '13811', '9857', '5459', '15894', '13018', '9471', '8194', '11374', '10866', '4512', '15113', '10369', '4696', '15941', '15094']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('37', '549', '2006-02-16T02:30:53', '2005-08-23T22:08:04', '2005-08-28T03:46:04', '1'), + ('37', '270', '2006-02-16T02:30:53', '2005-06-16T04:44:23', '2005-06-18T03:44:23', '1'), + ('37', '119', '2006-02-16T02:30:53', '2005-06-17T00:43:57', '2005-06-23T05:49:57', '1'), + ('37', '3490', '2006-02-16T02:30:53', '2005-08-19T12:55:09', '2005-08-22T18:10:09', '1'), + ('37', '4569', '2006-02-16T02:30:53', '2005-07-06T11:40:27', '2005-07-14T12:08:27', '1'), + ('37', '4521', '2006-02-16T02:30:53', '2005-08-20T21:19:36', '2005-08-29T23:39:36', '1'), + ('422', '1686', '2006-02-16T02:30:53', '2005-05-27T12:44:03', '2005-06-02T08:19:03', '1'), + ('422', '2844', '2006-02-16T02:30:53', '2005-08-19T04:16:13', '2005-08-27T02:43:13', '1'), + ('422', '1806', '2006-02-16T02:30:53', '2005-08-22T02:48:05', '2005-08-27T00:50:05', '1'), + ('422', '1664', '2006-02-16T02:30:53', '2005-08-22T18:49:40', '2005-08-28T21:22:40', '1'), + ('422', '1374', '2006-02-16T02:30:53', '2005-06-19T16:22:07', '2005-06-24T19:28:07', '1'), + ('422', '3357', '2006-02-16T02:30:53', '2005-06-19T18:18:12', '2005-06-28T21:43:12', '1'), + ('422', '1830', '2006-02-16T02:30:53', '2005-08-22T20:07:03', '2005-08-27T18:45:03', '1'), + ('422', '4380', '2006-02-16T02:30:53', '2005-08-01T23:25:55', '2005-08-10T18:01:55', '1'), + ('422', '2323', '2006-02-16T02:30:53', '2005-07-10T14:03:28', '2005-07-16T16:22:28', '1'), + ('422', '1581', '2006-02-16T02:30:53', '2005-08-20T10:03:45', '2005-08-25T04:26:45', '1'), + ('422', '361', '2006-02-16T02:30:53', '2005-07-08T02:19:27', '2005-07-12T21:15:27', '1'), + ('422', '60', '2006-02-16T02:30:53', '2005-08-20T06:52:03', '2005-08-27T07:43:03', '1'), + ('422', '2979', '2006-02-16T02:30:53', '2005-07-28T23:20:31', '2005-08-04T21:36:31', '1'), + ('422', '4356', '2006-02-16T02:30:53', '2005-07-08T00:04:59', '2005-07-16T01:19:59', '1'), + ('422', '4514', '2006-02-16T02:30:53', '2005-08-02T16:33:11', '2005-08-08T13:42:11', '1'), + ('422', '4089', '2006-02-16T02:30:53', '2005-08-20T09:34:51', '2005-08-23T04:13:51', '1'), + ('422', '659', '2006-02-16T02:30:53', '2005-07-28T08:37:22', '2005-07-31T04:27:22', '1'), + ('422', '2680', '2006-02-16T02:30:53', '2005-08-17T13:13:37', '2005-08-20T08:32:37', '1'), + ('384', '662', '2006-02-16T02:30:53', '2005-07-07T22:14:43', '2005-07-11T01:17:43', '1'), + ('384', '1914', '2006-02-16T02:30:53', '2005-06-17T12:39:50', '2005-06-19T14:59:50', '1'), + ('384', '1886', '2006-02-16T02:30:53', '2005-08-17T10:19:51', '2005-08-23T04:30:51', '1'), + ('384', '2851', '2006-02-16T02:30:53', '2005-06-17T09:02:58', '2005-06-20T03:07:58', '1'), + ('384', '3854', '2006-02-16T02:30:53', '2005-07-10T05:08:26', '2005-07-10T23:24:26', '1'), + ('384', '2792', '2006-02-16T02:30:53', '2005-07-29T07:37:48', '2005-08-04T10:43:48', '1'), + ('384', '2586', '2006-02-16T02:30:53', '2005-08-20T02:42:28', '2005-08-22T06:12:28', '1'), + ('384', '3002', '2006-02-16T02:30:53', '2005-08-21T11:11:46', '2005-08-25T12:33:46', '1'), + ('384', '3049', '2006-02-16T02:30:53', '2005-06-20T15:56:05', '2005-06-29T13:02:05', '1'), + ('384', '3827', '2006-02-16T02:30:53', '2005-06-18T23:44:21', '2005-06-24T00:31:21', '1'), + ('384', '2162', '2006-02-16T02:30:53', '2005-07-09T13:35:32', '2005-07-13T12:19:32', '1'), + ('384', '3343', '2006-02-16T02:30:53', '2005-05-25T17:30:42', '2005-06-03T22:36:42', '1'), + ('281', '1712', '2006-02-16T02:30:53', '2005-07-27T03:03:37', '2005-07-28T23:18:37', '1'), + ('281', '194', '2006-02-16T02:30:53', '2005-06-15T21:24:10', '2005-06-24T23:03:10', '1'), + ('281', '4477', '2006-02-16T02:30:53', '2005-08-21T03:40:40', '2005-08-25T05:55:40', '1'), + ('281', '1193', '2006-02-16T02:30:53', '2005-07-08T07:15:14', '2005-07-11T01:32:14', '1'), + ('281', '367', '2006-02-16T02:30:53', '2005-08-20T07:34:42', '2005-08-26T05:18:42', '1'), + ('281', '4384', '2006-02-16T02:30:53', '2005-05-28T19:45:40', '2005-05-29T21:02:40', '1'), + ('281', '3236', '2006-02-16T02:30:53', '2005-07-28T22:05:24', '2005-08-01T19:09:24', '1'), + ('281', '2342', '2006-02-16T02:30:53', '2005-07-12T18:28:12', '2005-07-15T19:24:12', '1'), + ('594', '2255', '2006-02-16T02:30:53', '2005-06-19T18:46:43', '2005-06-22T16:52:43', '1'), + ('594', '3489', '2006-02-16T02:30:53', '2005-05-27T06:51:14', '2005-06-03T01:58:14', '1'), + ('594', '97', '2006-02-16T02:30:53', '2005-07-05T22:59:53', '2005-07-08T20:32:53', '1'), + ('594', '960', '2006-02-16T02:30:53', '2005-08-01T18:38:02', '2005-08-08T20:19:02', '1'), + ('594', '959', '2006-02-16T02:30:53', '2005-07-06T02:17:54', '2005-07-07T00:19:54', '1'), + ('594', '2861', '2006-02-16T02:30:53', '2005-06-16T21:20:41', '2005-06-18T02:21:41', '1'), + ('594', '3903', '2006-02-16T02:30:53', '2005-07-07T02:52:52', '2005-07-16T00:09:52', '1'), + ('594', '3399', '2006-02-16T02:30:53', '2005-08-22T07:54:47', '2005-08-23T08:39:47', '1'), + ('594', '562', '2006-02-16T02:30:53', '2005-06-21T07:33:40', '2005-06-29T06:02:40', '1'), + ('594', '3470', '2006-02-16T02:30:53', '2005-05-31T06:29:01', '2005-06-09T04:31:01', '1'), + ('594', '2156', '2006-02-16T02:30:53', '2005-07-31T11:04:20', '2005-08-03T05:28:20', '1'), + ('594', '3451', '2006-02-16T02:30:53', '2005-07-31T01:46:24', '2005-08-09T06:11:24', '1'), + ('594', '527', '2006-02-16T02:30:53', '2005-07-12T01:35:40', '2005-07-20T20:11:40', '1'), + ('283', '3702', '2006-02-16T02:30:53', '2005-08-17T17:40:04', '2005-08-20T15:45:04', '1'), + ('283', '3883', '2006-02-16T02:30:53', '2005-07-06T09:01:56', '2005-07-11T14:18:56', '1'), + ('283', '1959', '2006-02-16T02:30:53', '2005-07-08T19:27:50', '2005-07-14T15:42:50', '1'), + ('283', '4388', '2006-02-16T02:30:53', '2005-08-23T15:29:41', '2005-08-27T18:17:41', '1'), + ('283', '3464', '2006-02-16T02:30:53', '2005-07-08T10:38:28', '2005-07-09T12:07:28', '1'), + ('283', '1269', '2006-02-16T02:30:53', '2005-07-11T17:50:09', '2005-07-18T13:11:09', '1'), + ('283', '1139', '2006-02-16T02:30:53', '2005-07-30T23:12:53', '2005-08-04T02:41:53', '1'), + ('283', '3628', '2006-02-16T02:30:53', '2005-06-19T23:06:00', '2005-06-25T18:36:00', '1'), + ('283', '2976', '2006-02-16T02:30:53', '2005-07-11T18:29:52', '2005-07-14T21:34:52', '1'), + ('283', '2160', '2006-02-16T02:30:53', '2005-07-11T05:03:03', '2005-07-12T01:28:03', '1'), + ('283', '2055', '2006-02-16T02:30:53', '2005-07-06T01:32:27', '2005-07-08T23:14:27', '1'), + ('283', '696', '2006-02-16T02:30:53', '2005-07-11T00:57:53', '2005-07-15T02:24:53', '1'), + ('283', '479', '2006-02-16T02:30:53', '2005-08-17T04:36:39', '2005-08-18T02:17:39', '1'), + ('283', '2084', '2006-02-16T02:30:53', '2005-07-06T03:11:57', '2005-07-15T03:14:57', '1'), + ('283', '1529', '2006-02-16T02:30:53', '2005-07-12T18:33:45', '2005-07-13T19:09:45', '1'), + ('283', '3229', '2006-02-16T02:30:53', '2005-06-16T20:10:43', '2005-06-20T19:12:43', '1'), + ('283', '1170', '2006-02-16T02:30:53', '2005-06-19T12:35:21', '2005-06-22T16:58:21', '1'), + ('168', '4542', '2006-02-16T02:30:53', '2005-07-06T01:22:45', '2005-07-10T03:23:45', '1'), + ('168', '3356', '2006-02-16T02:30:53', '2005-08-17T01:03:49', '2005-08-18T22:31:49', '1'), + ('168', '1482', '2006-02-16T02:30:53', '2005-07-07T17:29:16', '2005-07-11T21:47:16', '1'), + ('168', '3352', '2006-02-16T02:30:53', '2005-07-31T14:12:36', '2005-08-08T08:59:36', '1'), + ('168', '1187', '2006-02-16T02:30:53', '2005-08-18T23:50:24', '2005-08-21T02:31:24', '1'), + ('168', '2799', '2006-02-16T02:30:53', '2005-06-15T03:38:49', '2005-06-17T22:30:49', '1'), + ('168', '1293', '2006-02-16T02:30:53', '2005-05-27T13:31:51', '2005-05-30T16:58:51', '1'), + ('168', '2214', '2006-02-16T02:30:53', '2005-07-12T00:36:02', '2005-07-18T05:53:02', '1'), + ('168', '1988', '2006-02-16T02:30:53', '2005-08-18T14:28:00', '2005-08-26T14:10:00', '1'), + ('168', '3455', '2006-02-16T02:30:53', '2005-07-12T17:51:54', '2005-07-17T15:10:54', '1'), + ('168', '3214', '2006-02-16T02:30:53', '2005-07-30T12:31:36', '2005-08-03T09:05:36', '1'), + ('168', '1235', '2006-02-16T02:30:53', '2005-08-20T13:00:30', '2005-08-24T10:18:30', '1'), + ('168', '3316', '2006-02-16T02:30:53', '2005-07-31T13:00:53', '2005-08-09T15:56:53', '1'), + ('168', '1847', '2006-02-16T02:30:53', '2005-07-09T22:43:56', '2005-07-12T18:05:56', '1'), + ('168', '4416', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('168', '2122', '2006-02-16T02:30:53', '2005-08-19T08:04:50', '2005-08-26T11:46:50', '1'), + ('424', '2390', '2006-02-16T02:30:53', '2005-07-30T23:02:36', '2005-08-04T17:49:36', '1'), + ('424', '1148', '2006-02-16T02:30:53', '2005-07-28T22:51:44', '2005-07-29T17:13:44', '1'), + ('424', '2805', '2006-02-16T02:30:53', '2005-08-02T18:14:54', '2005-08-04T18:22:54', '1'), + ('424', '117', '2006-02-16T02:30:53', '2005-08-02T00:22:49', '2005-08-07T04:38:49', '1'), + ('424', '1569', '2006-02-16T02:30:53', '2005-07-08T02:38:56', '2005-07-10T20:46:56', '1'), + ('424', '4338', '2006-02-16T02:30:53', '2005-08-22T12:23:59', '2005-08-27T09:59:59', '1'), + ('424', '2534', '2006-02-16T02:30:53', '2005-08-01T06:13:44', '2005-08-07T09:46:44', '1'), + ('424', '1358', '2006-02-16T02:30:53', '2005-07-08T11:12:27', '2005-07-14T05:41:27', '1'), + ('424', '4304', '2006-02-16T02:30:53', '2005-08-23T18:46:44', '2005-08-31T17:31:44', '1'), + ('424', '922', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['10017', '5611', '3044', '12729', '3166', '11562', '7594', '6834', '8786', '190', '11918', '8093', '8471', '8250', '6781', '1859', '10380', '10090', '11524', '16006', '5525', '10447', '2455', '9944', '6245', '15429', '3822', '5981', '7860', '7434', '5017', '5211', '15137', '2478', '9528', '13527', '15170', '14738', '12082', '11967', '9556', '5458', '15329', '4439', '1384', '12855', '11607', '15002', '13646', '108', '283', '3604', '4426', '2691', '10382', '881', '10650', '4895', '11931', '13567', '2942', '8491', '1304', '11258', '14515', '12596', '2713', '8740', '10917', '7888', '3759', '4755', '1662', '14502', '11146', '8614', '7772', '3397', '8192', '4477', '11205', '12433', '2320', '15700', '8894', '11300', '15061', '8024', '3132', '4371', '11516', '14608', '15674', '2033', '14807', '15217', '3729', '13051', '12788', '12019']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('424', '1495', '2006-02-16T02:30:53', '2005-07-31T18:13:22', '2005-08-05T16:03:22', '1'), + ('424', '2832', '2006-02-16T02:30:53', '2005-07-10T05:13:43', '2005-07-16T05:56:43', '1'), + ('424', '3216', '2006-02-16T02:30:53', '2005-06-20T12:38:49', '2005-06-25T07:49:49', '1'), + ('424', '3711', '2006-02-16T02:30:53', '2005-08-18T21:52:59', '2005-08-21T00:02:59', '1'), + ('424', '1850', '2006-02-16T02:30:53', '2005-06-20T21:32:32', '2005-06-27T20:29:32', '1'), + ('424', '2992', '2006-02-16T02:30:53', '2005-08-17T01:23:39', '2005-08-26T06:16:39', '1'), + ('424', '3230', '2006-02-16T02:30:53', '2005-07-27T23:30:41', '2005-08-02T04:29:41', '1'), + ('533', '897', '2006-02-16T02:30:53', '2005-07-12T18:53:37', '2005-07-19T13:42:37', '1'), + ('533', '2404', '2006-02-16T02:30:53', '2005-07-29T20:39:49', '2005-08-03T18:08:49', '1'), + ('533', '3962', '2006-02-16T02:30:53', '2005-05-26T06:11:28', '2005-06-01T09:44:28', '1'), + ('533', '2169', '2006-02-16T02:30:53', '2005-08-17T16:08:42', '2005-08-20T20:12:42', '1'), + ('533', '1427', '2006-02-16T02:30:53', '2005-07-28T18:29:16', '2005-08-05T21:49:16', '1'), + ('533', '1520', '2006-02-16T02:30:53', '2005-07-29T08:32:11', '2005-08-01T13:55:11', '1'), + ('533', '4519', '2006-02-16T02:30:53', '2005-07-29T00:49:15', '2005-08-04T02:53:15', '1'), + ('533', '3783', '2006-02-16T02:30:53', '2005-07-12T16:21:47', '2005-07-15T19:52:47', '1'), + ('533', '3405', '2006-02-16T02:30:53', '2005-06-17T01:13:38', '2005-06-18T03:13:38', '1'), + ('533', '2225', '2006-02-16T02:30:53', '2005-08-01T06:34:36', '2005-08-02T09:08:36', '1'), + ('533', '4023', '2006-02-16T02:30:53', '2005-07-31T20:22:01', '2005-08-04T17:30:01', '1'), + ('533', '317', '2006-02-16T02:30:53', '2005-08-17T00:10:55', '2005-08-23T05:30:55', '1'), + ('533', '240', '2006-02-16T02:30:53', '2005-08-23T21:01:09', '2005-08-25T19:33:09', '1'), + ('241', '3141', '2006-02-16T02:30:53', '2005-07-10T02:03:08', '2005-07-18T07:32:08', '1'), + ('241', '1198', '2006-02-16T02:30:53', '2005-08-01T09:04:58', '2005-08-08T06:24:58', '1'), + ('241', '870', '2006-02-16T02:30:53', '2005-06-18T19:33:06', '2005-06-21T15:21:06', '1'), + ('241', '2540', '2006-02-16T02:30:53', '2005-07-31T15:44:43', '2005-08-08T10:30:43', '1'), + ('241', '512', '2006-02-16T02:30:53', '2005-07-11T14:56:57', '2005-07-16T14:35:57', '1'), + ('241', '740', '2006-02-16T02:30:53', '2005-08-23T00:20:31', '2005-08-23T20:22:31', '1'), + ('241', '1314', '2006-02-16T02:30:53', '2005-07-06T15:41:15', '2005-07-07T16:41:15', '1'), + ('241', '2151', '2006-02-16T02:30:53', '2005-07-11T00:19:04', '2005-07-13T19:10:04', '1'), + ('241', '2400', '2006-02-16T02:30:53', '2005-07-28T09:58:02', '2005-08-05T06:04:02', '1'), + ('241', '2927', '2006-02-16T02:30:53', '2005-07-27T17:34:40', '2005-07-29T15:01:40', '1'), + ('241', '3745', '2006-02-16T02:30:53', '2005-07-09T02:00:16', '2005-07-14T06:28:16', '1'), + ('241', '2216', '2006-02-16T02:30:53', '2005-07-09T11:26:50', '2005-07-16T15:30:50', '1'), + ('241', '856', '2006-02-16T02:30:53', '2005-08-22T13:20:28', '2005-08-26T09:35:28', '1'), + ('241', '2798', '2006-02-16T02:30:53', '2005-06-18T21:01:21', '2005-06-24T00:20:21', '1'), + ('241', '193', '2006-02-16T02:30:53', '2005-07-31T01:05:04', '2005-08-07T01:16:04', '1'), + ('521', '4424', '2006-02-16T02:30:53', '2005-08-20T03:00:47', '2005-08-25T01:03:47', '1'), + ('521', '2123', '2006-02-16T02:30:53', '2005-08-22T15:22:15', '2005-08-23T20:32:15', '1'), + ('521', '3315', '2006-02-16T02:30:53', '2005-08-21T22:29:13', '2005-08-29T21:19:13', '1'), + ('521', '3435', '2006-02-16T02:30:53', '2005-08-17T22:13:15', '2005-08-24T18:30:15', '1'), + ('521', '1151', '2006-02-16T02:30:53', '2005-08-17T17:45:00', '2005-08-22T13:03:00', '1'), + ('521', '3269', '2006-02-16T02:30:53', '2005-07-31T02:13:30', '2005-08-08T06:46:30', '1'), + ('521', '2203', '2006-02-16T02:30:53', '2005-07-09T22:35:49', '2005-07-16T22:55:49', '1'), + ('521', '1900', '2006-02-16T02:30:53', '2005-08-22T20:32:39', '2005-08-23T17:15:39', '1'), + ('521', '2393', '2006-02-16T02:30:53', '2005-07-07T22:57:30', '2005-07-10T18:28:30', '1'), + ('242', '4242', '2006-02-16T02:30:53', '2005-06-15T15:22:03', '2005-06-18T18:11:03', '1'), + ('242', '2900', '2006-02-16T02:30:53', '2005-08-19T02:18:58', '2005-08-19T20:50:58', '1'), + ('242', '4345', '2006-02-16T02:30:53', '2005-08-17T03:36:06', '2005-08-20T01:06:06', '1'), + ('242', '4198', '2006-02-16T02:30:53', '2005-08-22T08:06:00', '2005-08-24T10:48:00', '1'), + ('242', '1347', '2006-02-16T02:30:53', '2005-08-20T07:47:08', '2005-08-29T08:33:08', '1'), + ('242', '3289', '2006-02-16T02:30:53', '2005-05-25T18:30:05', '2005-05-30T19:40:05', '1'), + ('242', '3530', '2006-02-16T02:30:53', '2005-05-26T19:05:05', '2005-05-31T19:19:05', '1'), + ('242', '1380', '2006-02-16T02:30:53', '2005-07-06T05:25:22', '2005-07-07T23:52:22', '1'), + ('242', '364', '2006-02-16T02:30:53', '2005-07-07T22:28:32', '2005-07-16T02:04:32', '1'), + ('242', '3469', '2006-02-16T02:30:53', '2005-06-19T13:06:50', '2005-06-26T15:56:50', '1'), + ('242', '4455', '2006-02-16T02:30:53', '2005-08-01T06:36:45', '2005-08-02T06:06:45', '1'), + ('242', '602', '2006-02-16T02:30:53', '2005-05-30T06:15:36', '2005-06-02T10:21:36', '1'), + ('242', '2306', '2006-02-16T02:30:53', '2005-08-01T16:18:45', '2005-08-09T16:29:45', '1'), + ('242', '2620', '2006-02-16T02:30:53', '2005-07-08T20:22:05', '2005-07-12T20:49:05', '1'), + ('242', '2022', '2006-02-16T02:30:53', '2005-08-17T16:35:14', '2005-08-19T19:16:14', '1'), + ('242', '543', '2006-02-16T02:30:53', '2005-08-20T04:49:21', '2005-08-26T10:27:21', '1'), + ('242', '999', '2006-02-16T02:30:53', '2005-06-20T05:27:31', '2005-06-29T00:35:31', '1'), + ('242', '1806', '2006-02-16T02:30:53', '2005-07-29T09:02:13', '2005-08-03T04:32:13', '1'), + ('242', '1304', '2006-02-16T02:30:53', '2005-06-15T09:56:02', '2005-06-24T07:00:02', '1'), + ('242', '1576', '2006-02-16T02:30:53', '2005-08-02T13:45:39', '2005-08-06T07:57:39', '1'), + ('242', '2215', '2006-02-16T02:30:53', '2005-08-21T14:52:14', '2005-08-27T10:27:14', '1'), + ('378', '3662', '2006-02-16T02:30:53', '2005-08-18T16:29:35', '2005-08-24T16:48:35', '1'), + ('378', '3979', '2006-02-16T02:30:53', '2005-06-19T14:23:09', '2005-06-20T17:55:09', '1'), + ('378', '3781', '2006-02-16T02:30:53', '2005-07-29T18:41:31', '2005-08-01T18:38:31', '1'), + ('378', '3146', '2006-02-16T02:30:53', '2005-08-02T02:06:18', '2005-08-03T22:42:18', '1'), + ('378', '545', '2006-02-16T02:30:53', '2005-07-28T10:40:24', '2005-08-01T16:18:24', '1'), + ('378', '4165', '2006-02-16T02:30:53', '2005-07-06T12:46:38', '2005-07-10T11:31:38', '1'), + ('378', '661', '2006-02-16T02:30:53', '2005-07-08T14:23:41', '2005-07-10T19:35:41', '1'), + ('378', '3552', '2006-02-16T02:30:53', '2005-06-16T10:13:35', '2005-06-23T13:54:35', '1'), + ('378', '2986', '2006-02-16T02:30:53', '2005-08-21T14:22:28', '2005-08-23T10:40:28', '1'), + ('552', '2488', '2006-02-16T02:30:53', '2005-08-02T09:45:32', '2005-08-07T07:33:32', '1'), + ('552', '604', '2006-02-16T02:30:53', '2005-07-29T13:32:05', '2005-08-04T15:26:05', '1'), + ('552', '986', '2006-02-16T02:30:53', '2005-07-28T06:59:09', '2005-08-01T10:49:09', '1'), + ('552', '602', '2006-02-16T02:30:53', '2005-06-21T15:30:11', '2005-06-22T21:12:11', '1'), + ('552', '255', '2006-02-16T02:30:53', '2005-07-28T22:49:11', '2005-07-30T04:13:11', '1'), + ('552', '1602', '2006-02-16T02:30:53', '2005-07-08T00:38:24', '2005-07-13T05:14:24', '1'), + ('552', '4321', '2006-02-16T02:30:53', '2005-08-02T11:56:54', '2005-08-05T08:24:54', '1'), + ('552', '1776', '2006-02-16T02:30:53', '2005-08-18T10:37:49', '2005-08-19T08:00:49', '1'), + ('552', '597', '2006-02-16T02:30:53', '2005-06-18T09:24:50', '2005-06-24T07:59:50', '1'), + ('552', '2935', '2006-02-16T02:30:53', '2005-08-23T10:21:21', '2005-08-24T15:37:21', '1'), + ('552', '2055', '2006-02-16T02:30:53', '2005-07-30T00:48:31', '2005-07-31T05:49:31', '1'), + ('552', '3032', '2006-02-16T02:30:53', '2005-08-02T15:37:42', '2005-08-11T14:25:42', '1'), + ('90', '3436', '2006-02-16T02:30:53', '2005-08-22T10:29:44', '2005-08-24T14:40:44', '1'), + ('90', '1735', '2006-02-16T02:30:53', '2005-07-28T15:55:40', '2005-08-02T09:56:40', '1'), + ('90', '711', '2006-02-16T02:30:53', '2005-06-20T19:09:46', '2005-06-24T19:42:46', '1'), + ('90', '2533', '2006-02-16T02:30:53', '2005-07-07T20:06:45', '2005-07-08T18:50:45', '1'), + ('90', '1860', '2006-02-16T02:30:53', '2005-08-16T23:54:47', '2005-08-17T20:05:47', '1'), + ('90', '3321', '2006-02-16T02:30:53', '2005-08-21T17:57:22', '2005-08-25T13:20:22', '1'), + ('90', '4482', '2006-02-16T02:30:53', '2005-08-23T09:16:39', '2005-09-01T11:57:39', '1'), + ('90', '58', '2006-02-16T02:30:53', '2005-06-17T13:24:43', '2005-06-20T12:34:43', '1'), + ('90', '335', '2006-02-16T02:30:53', '2005-08-22T00:57:43', '2005-08-26T23:40:43', '1'), + ('90', '91', '2006-02-16T02:30:53', '2005-08-22T16:58:31', '2005-08-23T22:33:31', '1'), + ('90', '3156', '2006-02-16T02:30:53', '2005-07-06T11:30:29', '2005-07-12T07:18:29', '1'), + ('90', '4064', '2006-02-16T02:30:53', '2005-08-19T09:31:33', '2005-08-28T06:15:33', '1'), + ('90', '644', '2006-02-16T02:30:53', '2005-08-19T00:15:09', '2005-08-27T21:54:09', '1'), + ('90', '2566', '2006-02-16T02:30:53', '2005-08-17T19:48:55', '2005-08-21T18:20:55', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['5272', '2178', '12852', '2040', '2091', '4054', '2823', '3193', '14035', '8484', '14579', '13685', '13440', '7885', '10970', '1101', '2727', '12728', '10024', '3183', '9983', '4602', '13653', '3689', '14968', '10483', '13961', '8345', '1732', '2795', '4896', '2768', '4256', '15263', '9651', '10212', '5778', '11617', '4368', '4197', '7263', '14262', '7960', '3947', '12543', '563', '6034', '11771', '5702', '7240', '13356', '5220', '9269', '11041', '9655', '3690', '14696', '13208', '757', '3918', '6935', '10998', '14850', '10701', '9307', '15343', '3189', '13770', '12089', '3554', '9939', '5486', '2682', '10732', '6936', '14591', '594', '7694', '9897', '5898', '10962', '13544', '1314', '13558', '11768', '10401', '985', '9929', '10129', '14593', '13701', '4196', '10528', '13324', '14439', '1503', '1605', '903', '730', '8165']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('90', '1547', '2006-02-16T02:30:53', '2005-07-09T14:26:01', '2005-07-12T20:20:01', '1'), + ('260', '2950', '2006-02-16T02:30:53', '2005-06-18T00:38:35', '2005-06-21T02:56:35', '1'), + ('260', '2446', '2006-02-16T02:30:53', '2005-08-19T02:12:40', '2005-08-19T23:42:40', '1'), + ('260', '227', '2006-02-16T02:30:53', '2005-06-17T14:18:37', '2005-06-22T19:08:37', '1'), + ('260', '4033', '2006-02-16T02:30:53', '2005-06-17T18:09:04', '2005-06-26T12:11:04', '1'), + ('260', '3885', '2006-02-16T02:30:53', '2005-07-07T03:42:07', '2005-07-10T03:22:07', '1'), + ('260', '3566', '2006-02-16T02:30:53', '2005-06-19T20:30:21', '2005-06-26T17:58:21', '1'), + ('260', '3176', '2006-02-16T02:30:53', '2005-06-20T23:52:30', '2005-06-22T21:21:30', '1'), + ('260', '2035', '2006-02-16T02:30:53', '2005-08-20T21:31:58', '2005-08-22T16:28:58', '1'), + ('260', '742', '2006-02-16T02:30:53', '2005-07-29T08:51:59', '2005-07-30T09:07:59', '1'), + ('260', '1205', '2006-02-16T02:30:53', '2005-08-21T16:54:47', '2005-08-28T12:35:47', '1'), + ('260', '3336', '2006-02-16T02:30:53', '2005-08-20T08:57:11', '2005-08-27T07:26:11', '1'), + ('260', '2842', '2006-02-16T02:30:53', '2005-08-19T23:42:52', '2005-08-25T19:19:52', '1'), + ('260', '4294', '2006-02-16T02:30:53', '2005-07-28T10:37:41', '2005-08-05T07:56:41', '1'), + ('260', '1202', '2006-02-16T02:30:53', '2005-08-02T04:06:46', '2005-08-10T04:27:46', '1'), + ('260', '1174', '2006-02-16T02:30:53', '2005-05-31T14:13:59', '2005-06-07T15:49:59', '1'), + ('129', '3261', '2006-02-16T02:30:53', '2005-06-19T15:02:39', '2005-06-28T17:49:39', '1'), + ('129', '3156', '2006-02-16T02:30:53', '2005-08-18T21:47:48', '2005-08-25T16:13:48', '1'), + ('129', '265', '2006-02-16T02:30:53', '2005-07-31T18:26:36', '2005-08-09T16:16:36', '1'), + ('129', '4397', '2006-02-16T02:30:53', '2005-06-20T22:55:55', '2005-06-23T17:22:55', '1'), + ('129', '350', '2006-02-16T02:30:53', '2005-07-31T17:09:36', '2005-08-08T20:26:36', '1'), + ('129', '3616', '2006-02-16T02:30:53', '2005-07-08T06:52:40', '2005-07-10T06:30:40', '1'), + ('129', '4029', '2006-02-16T02:30:53', '2005-08-20T07:54:54', '2005-08-29T06:43:54', '1'), + ('129', '3168', '2006-02-16T02:30:53', '2005-07-06T09:43:01', '2005-07-11T09:57:01', '1'), + ('129', '3302', '2006-02-16T02:30:53', '2005-08-22T06:46:59', '2005-08-29T07:36:59', '1'), + ('129', '1521', '2006-02-16T02:30:53', '2005-08-01T10:19:45', '2005-08-04T09:29:45', '1'), + ('129', '2271', '2006-02-16T02:30:53', '2005-08-20T18:16:34', '2005-08-21T16:14:34', '1'), + ('129', '1034', '2006-02-16T02:30:53', '2005-07-29T04:47:37', '2005-08-02T07:25:37', '1'), + ('129', '2287', '2006-02-16T02:30:53', '2005-06-16T15:34:41', '2005-06-18T13:05:41', '1'), + ('129', '3694', '2006-02-16T02:30:53', '2005-06-19T18:58:53', '2005-06-28T18:56:53', '1'), + ('129', '3006', '2006-02-16T02:30:53', '2005-07-08T20:23:15', '2005-07-10T15:38:15', '1'), + ('129', '3018', '2006-02-16T02:30:53', '2005-06-19T17:46:52', '2005-06-25T21:49:52', '1'), + ('129', '1386', '2006-02-16T02:30:53', '2005-07-07T14:14:36', '2005-07-10T09:41:36', '1'), + ('324', '184', '2006-02-16T02:30:53', '2005-08-22T18:27:33', '2005-08-30T14:05:33', '1'), + ('324', '4059', '2006-02-16T02:30:53', '2005-07-31T05:48:49', '2005-08-04T06:53:49', '1'), + ('324', '3728', '2006-02-16T02:30:53', '2005-08-01T01:01:35', '2005-08-02T23:02:35', '1'), + ('324', '4435', '2006-02-16T02:30:53', '2005-07-10T13:41:37', '2005-07-14T16:26:37', '1'), + ('324', '1898', '2006-02-16T02:30:53', '2005-08-17T04:00:40', '2005-08-18T00:36:40', '1'), + ('324', '736', '2006-02-16T02:30:53', '2005-07-07T19:55:19', '2005-07-09T00:11:19', '1'), + ('324', '2515', '2006-02-16T02:30:53', '2005-07-07T11:07:52', '2005-07-10T10:19:52', '1'), + ('324', '725', '2006-02-16T02:30:53', '2005-07-27T11:17:22', '2005-08-04T10:59:22', '1'), + ('324', '1430', '2006-02-16T02:30:53', '2005-08-21T06:08:13', '2005-08-30T10:55:13', '1'), + ('324', '2718', '2006-02-16T02:30:53', '2005-07-28T13:47:08', '2005-08-03T15:17:08', '1'), + ('324', '4188', '2006-02-16T02:30:53', '2005-07-06T21:42:21', '2005-07-08T19:37:21', '1'), + ('324', '330', '2006-02-16T02:30:53', '2005-08-18T14:23:55', '2005-08-20T12:42:55', '1'), + ('324', '53', '2006-02-16T02:30:53', '2005-05-28T09:10:49', '2005-06-06T11:32:49', '1'), + ('324', '1735', '2006-02-16T02:30:53', '2005-07-11T03:00:50', '2005-07-16T06:19:50', '1'), + ('324', '2575', '2006-02-16T02:30:53', '2005-08-17T10:17:09', '2005-08-25T10:58:09', '1'), + ('324', '3349', '2006-02-16T02:30:53', '2005-07-10T10:00:01', '2005-07-11T15:29:01', '1'), + ('324', '4565', '2006-02-16T02:30:53', '2005-07-27T10:21:15', '2005-08-03T05:04:15', '1'), + ('324', '2713', '2006-02-16T02:30:53', '2005-08-19T21:02:21', '2005-08-24T00:31:21', '1'), + ('435', '2577', '2006-02-16T02:30:53', '2005-07-09T11:59:04', '2005-07-15T06:20:04', '1'), + ('435', '548', '2006-02-16T02:30:53', '2005-07-30T15:02:33', '2005-08-02T16:32:33', '1'), + ('435', '1897', '2006-02-16T02:30:53', '2005-08-02T06:03:53', '2005-08-03T11:57:53', '1'), + ('435', '3403', '2006-02-16T02:30:53', '2005-07-31T05:57:54', '2005-08-06T02:00:54', '1'), + ('435', '4405', '2006-02-16T02:30:53', '2005-07-06T09:46:03', '2005-07-07T12:12:03', '1'), + ('435', '3776', '2006-02-16T02:30:53', '2005-08-21T20:48:05', '2005-08-25T14:55:05', '1'), + ('435', '609', '2006-02-16T02:30:53', '2005-08-19T15:18:55', '2005-08-24T11:59:55', '1'), + ('435', '1067', '2006-02-16T02:30:53', '2005-05-29T10:29:47', '2005-06-07T15:27:47', '1'), + ('435', '1111', '2006-02-16T02:30:53', '2005-07-06T20:26:15', '2005-07-15T20:32:15', '1'), + ('435', '2771', '2006-02-16T02:30:53', '2005-07-26T23:13:10', '2005-07-27T18:09:10', '1'), + ('435', '1479', '2006-02-16T02:30:53', '2005-08-02T04:50:55', '2005-08-11T03:43:55', '1'), + ('435', '2405', '2006-02-16T02:30:53', '2005-08-22T02:16:55', '2005-08-26T21:08:55', '1'), + ('538', '3958', '2006-02-16T02:30:53', '2005-08-01T18:28:17', '2005-08-09T21:51:17', '1'), + ('538', '3831', '2006-02-16T02:30:53', '2005-07-30T16:52:43', '2005-08-01T11:58:43', '1'), + ('538', '2589', '2006-02-16T02:30:53', '2005-08-22T21:01:25', '2005-08-28T16:15:25', '1'), + ('538', '1502', '2006-02-16T02:30:53', '2005-06-20T23:19:33', '2005-06-24T17:46:33', '1'), + ('538', '998', '2006-02-16T02:30:53', '2005-08-20T11:45:54', '2005-08-22T17:08:54', '1'), + ('538', '651', '2006-02-16T02:30:53', '2005-08-17T22:20:29', '2005-08-24T02:12:29', '1'), + ('538', '793', '2006-02-16T02:30:53', '2005-07-06T02:37:10', '2005-07-09T01:58:10', '1'), + ('538', '3049', '2006-02-16T02:30:53', '2005-07-31T15:29:00', '2005-08-08T11:09:00', '1'), + ('538', '2864', '2006-02-16T02:30:53', '2005-07-09T23:57:44', '2005-07-14T00:23:44', '1'), + ('538', '3609', '2006-02-16T02:30:53', '2005-06-19T12:18:17', '2005-06-28T14:09:17', '1'), + ('538', '2810', '2006-02-16T02:30:53', '2005-08-01T19:25:18', '2005-08-10T22:26:18', '1'), + ('538', '60', '2006-02-16T02:30:53', '2005-07-26T23:13:34', '2005-07-30T19:14:34', '1'), + ('538', '3410', '2006-02-16T02:30:53', '2005-08-21T17:30:09', '2005-08-24T12:27:09', '1'), + ('538', '2766', '2006-02-16T02:30:53', '2005-05-28T13:41:56', '2005-05-30T12:00:56', '1'), + ('538', '2892', '2006-02-16T02:30:53', '2005-07-28T03:39:25', '2005-07-31T05:47:25', '1'), + ('538', '3945', '2006-02-16T02:30:53', '2005-07-31T14:11:57', '2005-08-02T12:20:57', '1'), + ('538', '3257', '2006-02-16T02:30:53', '2005-07-10T20:18:09', '2005-07-16T14:44:09', '1'), + ('538', '1953', '2006-02-16T02:30:53', '2005-08-02T03:48:13', '2005-08-07T00:04:13', '1'), + ('538', '58', '2006-02-16T02:30:53', '2005-08-20T03:44:26', '2005-08-27T22:11:26', '1'), + ('538', '1359', '2006-02-16T02:30:53', '2005-06-15T10:21:45', '2005-06-21T14:10:45', '1'), + ('564', '1551', '2006-02-16T02:30:53', '2005-08-20T04:13:17', '2005-08-24T06:38:17', '1'), + ('564', '1307', '2006-02-16T02:30:53', '2005-08-17T10:02:29', '2005-08-23T10:26:29', '1'), + ('564', '1560', '2006-02-16T02:30:53', '2005-08-01T07:27:09', '2005-08-02T01:38:09', '1'), + ('564', '1573', '2006-02-16T02:30:53', '2005-05-30T22:18:35', '2005-06-04T23:36:35', '1'), + ('564', '2521', '2006-02-16T02:30:53', '2005-07-31T15:17:24', '2005-08-03T17:27:24', '1'), + ('564', '2848', '2006-02-16T02:30:53', '2005-07-31T21:41:35', '2005-08-05T17:05:35', '1'), + ('564', '1399', '2006-02-16T02:30:53', '2005-08-21T17:33:18', '2005-08-24T22:11:18', '1'), + ('564', '1643', '2006-02-16T02:30:53', '2005-08-20T09:27:05', '2005-08-21T14:54:05', '1'), + ('564', '3407', '2006-02-16T02:30:53', '2005-07-07T11:06:33', '2005-07-14T13:46:33', '1'), + ('564', '4401', '2006-02-16T02:30:53', '2005-08-01T11:56:22', '2005-08-07T07:13:22', '1'), + ('564', '4349', '2006-02-16T02:30:53', '2005-08-19T19:51:00', '2005-08-20T20:26:00', '1'), + ('564', '3903', '2006-02-16T02:30:53', '2005-08-21T11:52:41', '2005-08-30T10:36:41', '1'), + ('197', '763', '2006-02-16T02:30:53', '2005-06-15T22:07:09', '2005-06-20T23:15:09', '1'), + ('197', '593', '2006-02-16T02:30:53', '2005-06-16T06:17:55', '2005-06-25T01:25:55', '1'), + ('197', '2423', '2006-02-16T02:30:53', '2005-05-30T10:11:29', '2005-06-03T09:33:29', '1'), + ('197', '3473', '2006-02-16T02:30:53', '2005-05-29T07:00:59', '2005-06-06T01:17:59', '1'), + ('197', '3460', '2006-02-16T02:30:53', '2005-07-28T21:23:06', '2005-08-01T21:32:06', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['4486', '11018', '11215', '683', '11478', '10743', '2090', '649', '94', '1919', '9378', '15078', '10460', '11643', '15540', '11311', '4739', '8044', '7671', '3661', '10365', '14199', '558', '13004', '6632', '632', '15207', '3545', '1358', '466', '9180', '7754', '9947', '10268', '7208', '6458', '8123', '5679', '14486', '15501', '14194', '3090', '8190', '8572', '1349', '91', '2877', '12320', '15020', '15208', '11373', '11690', '9807', '1030', '13713', '15903', '9059', '6706', '2754', '3817', '2265', '9403', '15227', '7332', '11714', '3017', '15996', '6854', '13230', '164', '10078', '3390', '10662', '10311', '9890', '14922', '2474', '4376', '1037', '9399', '6046', '11255', '14959', '12308', '10884', '624', '11946', '647', '11030', '4204', '14400', '12157', '12958', '16005', '6073', '13884', '11343', '13478', '5048', '1104']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('197', '837', '2006-02-16T02:30:53', '2005-07-08T01:09:09', '2005-07-16T23:40:09', '1'), + ('197', '2988', '2006-02-16T02:30:53', '2005-08-02T05:27:53', '2005-08-07T10:48:53', '1'), + ('197', '379', '2006-02-16T02:30:53', '2005-08-02T12:20:42', '2005-08-06T14:01:42', '1'), + ('197', '2038', '2006-02-16T02:30:53', '2005-05-29T00:09:48', '2005-06-02T04:27:48', '1'), + ('197', '3932', '2006-02-16T02:30:53', '2005-08-02T22:09:05', '2005-08-04T18:02:05', '1'), + ('197', '4206', '2006-02-16T02:30:53', '2005-08-01T19:55:09', '2005-08-03T19:29:09', '1'), + ('197', '17', '2006-02-16T02:30:53', '2005-06-17T18:06:14', '2005-06-22T23:52:14', '1'), + ('197', '1781', '2006-02-16T02:30:53', '2005-05-28T19:35:45', '2005-06-05T16:00:45', '1'), + ('197', '1675', '2006-02-16T02:30:53', '2005-05-25T16:03:42', '2005-05-30T14:23:42', '1'), + ('197', '3855', '2006-02-16T02:30:53', '2005-06-17T05:40:52', '2005-06-23T05:58:52', '1'), + ('197', '2209', '2006-02-16T02:30:53', '2005-07-30T19:12:54', '2005-08-05T18:16:54', '1'), + ('197', '3001', '2006-02-16T02:30:53', '2005-08-22T11:09:31', '2005-08-25T12:16:31', '1'), + ('197', '4504', '2006-02-16T02:30:53', '2005-08-01T09:31:00', '2005-08-09T09:28:00', '1'), + ('197', '1378', '2006-02-16T02:30:53', '2005-08-17T04:49:35', '2005-08-24T07:05:35', '1'), + ('197', '1696', '2006-02-16T02:30:53', '2005-08-23T04:12:52', '2005-08-31T04:25:52', '1'), + ('197', '204', '2006-02-16T02:30:53', '2005-08-02T15:53:48', '2005-08-03T16:32:48', '1'), + ('197', '140', '2006-02-16T02:30:53', '2005-07-08T13:25:57', '2005-07-11T17:36:57', '1'), + ('442', '879', '2006-02-16T02:30:53', '2005-07-28T16:49:12', '2005-08-02T22:41:12', '1'), + ('442', '3464', '2006-02-16T02:30:53', '2005-07-28T02:48:31', '2005-07-30T23:04:31', '1'), + ('442', '2600', '2006-02-16T02:30:53', '2005-07-06T08:10:02', '2005-07-10T10:17:02', '1'), + ('442', '4032', '2006-02-16T02:30:53', '2005-08-01T06:08:44', '2005-08-06T02:07:44', '1'), + ('442', '658', '2006-02-16T02:30:53', '2005-08-21T03:48:43', '2005-08-23T04:01:43', '1'), + ('442', '4163', '2006-02-16T02:30:53', '2005-05-28T08:38:43', '2005-06-06T13:52:43', '1'), + ('442', '771', '2006-02-16T02:30:53', '2005-08-19T07:40:08', '2005-08-20T11:49:08', '1'), + ('442', '2929', '2006-02-16T02:30:53', '2005-07-12T09:33:10', '2005-07-15T11:36:10', '1'), + ('442', '1287', '2006-02-16T02:30:53', '2005-05-28T17:37:50', '2005-06-03T16:04:50', '1'), + ('442', '1149', '2006-02-16T02:30:53', '2005-08-22T16:35:25', '2005-08-23T14:06:25', '1'), + ('442', '3924', '2006-02-16T02:30:53', '2005-07-06T02:16:17', '2005-07-11T00:54:17', '1'), + ('442', '2025', '2006-02-16T02:30:53', '2005-06-15T13:28:48', '2005-06-21T13:40:48', '1'), + ('442', '1786', '2006-02-16T02:30:53', '2005-05-27T20:57:07', '2005-05-29T15:52:07', '1'), + ('442', '3479', '2006-02-16T02:30:53', '2005-07-30T12:03:15', '2005-08-01T14:25:15', '1'), + ('138', '1981', '2006-02-16T02:30:53', '2005-07-28T06:10:55', '2005-07-29T02:46:55', '1'), + ('138', '1173', '2006-02-16T02:30:53', '2005-07-31T15:49:40', '2005-08-08T11:11:40', '1'), + ('138', '2755', '2006-02-16T02:30:53', '2005-08-01T03:08:56', '2005-08-08T02:41:56', '1'), + ('138', '1523', '2006-02-16T02:30:53', '2005-07-27T09:16:28', '2005-07-28T09:40:28', '1'), + ('138', '2809', '2006-02-16T02:30:53', '2005-07-12T01:08:52', '2005-07-16T20:22:52', '1'), + ('138', '2256', '2006-02-16T02:30:53', '2005-07-28T19:28:23', '2005-08-04T19:41:23', '1'), + ('138', '389', '2006-02-16T02:30:53', '2005-07-10T08:44:02', '2005-07-14T05:30:02', '1'), + ('138', '3119', '2006-02-16T02:30:53', '2005-08-21T13:52:54', '2005-08-23T07:58:54', '1'), + ('138', '4468', '2006-02-16T02:30:53', '2005-08-23T02:39:56', '2005-08-25T04:39:56', '1'), + ('138', '2003', '2006-02-16T02:30:53', '2005-08-21T03:40:11', '2005-08-26T07:38:11', '1'), + ('267', '3301', '2006-02-16T02:30:53', '2005-06-20T16:00:19', '2005-06-23T14:55:19', '1'), + ('267', '2290', '2006-02-16T02:30:53', '2005-07-28T22:47:06', '2005-08-04T21:51:06', '1'), + ('267', '2815', '2006-02-16T02:30:53', '2005-07-29T11:51:24', '2005-08-02T11:44:24', '1'), + ('267', '1131', '2006-02-16T02:30:53', '2005-06-15T12:49:02', '2005-06-17T15:20:02', '1'), + ('267', '139', '2006-02-16T02:30:53', '2005-05-25T14:57:22', '2005-06-01T18:32:22', '1'), + ('267', '485', '2006-02-16T02:30:53', '2005-06-20T01:07:16', '2005-06-24T01:05:16', '1'), + ('267', '3248', '2006-02-16T02:30:53', '2005-08-18T06:26:51', '2005-08-20T04:00:51', '1'), + ('267', '3460', '2006-02-16T02:30:53', '2005-08-22T08:54:12', '2005-08-27T04:54:12', '1'), + ('267', '4346', '2006-02-16T02:30:53', '2005-08-22T16:35:47', '2005-08-30T15:16:47', '1'), + ('267', '181', '2006-02-16T02:30:53', '2005-08-02T18:14:12', '2005-08-06T23:37:12', '1'), + ('267', '3934', '2006-02-16T02:30:53', '2005-08-17T06:44:22', '2005-08-24T03:49:22', '1'), + ('267', '2137', '2006-02-16T02:30:53', '2005-07-31T11:13:52', '2005-08-02T07:34:52', '1'), + ('267', '3948', '2006-02-16T02:30:53', '2005-05-31T04:06:47', '2005-06-02T02:59:47', '1'), + ('267', '3075', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('267', '1289', '2006-02-16T02:30:53', '2005-08-23T17:30:40', '2005-08-29T14:12:40', '1'), + ('267', '480', '2006-02-16T02:30:53', '2005-07-30T07:18:44', '2005-08-08T08:39:44', '1'), + ('267', '4552', '2006-02-16T02:30:53', '2005-07-12T12:59:16', '2005-07-19T10:37:16', '1'), + ('267', '1761', '2006-02-16T02:30:53', '2005-06-19T16:55:59', '2005-06-26T18:11:59', '1'), + ('267', '2933', '2006-02-16T02:30:53', '2005-07-06T15:31:45', '2005-07-11T17:11:45', '1'), + ('267', '3069', '2006-02-16T02:30:53', '2005-06-18T06:03:27', '2005-06-20T01:16:27', '1'), + ('267', '3466', '2006-02-16T02:30:53', '2005-07-30T20:18:53', '2005-08-06T19:54:53', '1'), + ('151', '2987', '2006-02-16T02:30:53', '2005-08-22T17:22:41', '2005-08-23T20:59:41', '1'), + ('151', '1761', '2006-02-16T02:30:53', '2005-07-27T13:58:57', '2005-08-02T12:40:57', '1'), + ('151', '17', '2006-02-16T02:30:53', '2005-08-17T07:34:55', '2005-08-18T04:07:55', '1'), + ('151', '2513', '2006-02-16T02:30:53', '2005-06-20T11:08:56', '2005-06-28T16:26:56', '1'), + ('151', '3098', '2006-02-16T02:30:53', '2005-08-23T20:31:38', '2005-08-29T20:58:38', '1'), + ('151', '3173', '2006-02-16T02:30:53', '2005-07-12T19:38:57', '2005-07-16T16:28:57', '1'), + ('151', '3645', '2006-02-16T02:30:53', '2005-08-19T16:12:07', '2005-08-21T12:19:07', '1'), + ('151', '1070', '2006-02-16T02:30:53', '2005-05-26T02:26:49', '2005-05-28T00:32:49', '1'), + ('151', '3198', '2006-02-16T02:30:53', '2005-07-31T20:02:02', '2005-08-04T00:45:02', '1'), + ('151', '2034', '2006-02-16T02:30:53', '2005-06-21T15:10:50', '2005-06-26T12:38:50', '1'), + ('151', '2857', '2006-02-16T02:30:53', '2005-08-01T16:50:57', '2005-08-03T17:19:57', '1'), + ('151', '4211', '2006-02-16T02:30:53', '2005-08-01T04:27:59', '2005-08-02T08:51:59', '1'), + ('151', '1024', '2006-02-16T02:30:53', '2005-07-31T14:04:44', '2005-08-01T11:24:44', '1'), + ('151', '2322', '2006-02-16T02:30:53', '2005-08-22T05:13:05', '2005-08-30T04:59:05', '1'), + ('151', '3450', '2006-02-16T02:30:53', '2005-06-18T20:51:34', '2005-06-25T01:39:34', '1'), + ('151', '1344', '2006-02-16T02:30:53', '2005-07-07T20:24:33', '2005-07-11T18:32:33', '1'), + ('569', '810', '2006-02-16T02:30:53', '2005-05-31T05:22:25', '2005-06-09T04:52:25', '1'), + ('569', '3668', '2006-02-16T02:30:53', '2005-07-30T20:14:50', '2005-08-03T17:30:50', '1'), + ('569', '1935', '2006-02-16T02:30:53', '2005-07-11T03:21:49', '2005-07-19T23:58:49', '1'), + ('569', '3393', '2006-02-16T02:30:53', '2005-08-02T13:44:30', '2005-08-03T12:00:30', '1'), + ('569', '2009', '2006-02-16T02:30:53', '2005-08-22T06:30:28', '2005-08-25T09:48:28', '1'), + ('569', '2877', '2006-02-16T02:30:53', '2005-08-18T05:48:53', '2005-08-22T09:03:53', '1'), + ('569', '3702', '2006-02-16T02:30:53', '2005-08-02T00:47:33', '2005-08-03T04:38:33', '1'), + ('569', '3660', '2006-02-16T02:30:53', '2005-05-28T16:13:22', '2005-06-06T20:35:22', '1'), + ('569', '2953', '2006-02-16T02:30:53', '2005-08-17T17:05:53', '2005-08-19T13:56:53', '1'), + ('569', '3435', '2006-02-16T02:30:53', '2005-05-28T19:22:52', '2005-06-01T00:10:52', '1'), + ('569', '1437', '2006-02-16T02:30:53', '2005-08-02T05:51:20', '2005-08-06T04:20:20', '1'), + ('569', '1513', '2006-02-16T02:30:53', '2005-07-07T11:24:18', '2005-07-15T12:42:18', '1'), + ('569', '3891', '2006-02-16T02:30:53', '2005-08-21T10:33:45', '2005-08-26T12:05:45', '1'), + ('569', '2311', '2006-02-16T02:30:53', '2005-08-18T00:33:45', '2005-08-22T19:33:45', '1'), + ('569', '4214', '2006-02-16T02:30:53', '2005-08-19T06:19:21', '2005-08-20T02:21:21', '1'), + ('466', '3265', '2006-02-16T02:30:53', '2005-08-23T21:00:22', '2005-09-02T02:35:22', '1'), + ('466', '4243', '2006-02-16T02:30:53', '2005-07-11T04:54:31', '2005-07-20T07:23:31', '1'), + ('466', '3182', '2006-02-16T02:30:53', '2005-08-20T15:30:51', '2005-08-26T13:34:51', '1'), + ('466', '564', '2006-02-16T02:30:53', '2005-08-02T17:12:30', '2005-08-09T12:08:30', '1'), + ('466', '2190', '2006-02-16T02:30:53', '2005-08-20T01:07:14', '2005-08-22T03:41:14', '1'), + ('466', '1271', '2006-02-16T02:30:53', '2005-07-09T03:46:33', '2005-07-15T01:14:33', '1'), + ('466', '1619', '2006-02-16T02:30:53', '2005-05-31T14:30:01', '2005-06-05T12:07:01', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['8276', '3343', '1808', '5691', '9257', '5114', '4819', '10185', '10889', '13773', '6744', '494', '2060', '4971', '9832', '6457', '14167', '7074', '9685', '2013', '15834', '15801', '10565', '5973', '12643', '11854', '10933', '10237', '1312', '6384', '2711', '669', '2617', '7294', '8381', '15340', '9836', '781', '5193', '10771', '3899', '9039', '11921', '8984', '6902', '4667', '5343', '10772', '1009', '9565', '1721', '7144', '12261', '12487', '5820', '1684', '9189', '9640', '2542', '13437', '7277', '13791', '11894', '331', '11295', '5952', '7307', '6105', '9826', '9223', '613', '9497', '7490', '3789', '15576', '12235', '15534', '2023', '527', '11687', '7187', '3493', '1087', '14435', '7597', '8558', '1763', '14777', '3527', '2552', '14493', '15462', '7029', '16011', '5626', '6104', '4443', '998', '8887', '10217']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('466', '2451', '2006-02-16T02:30:53', '2005-07-29T01:38:43', '2005-08-03T23:00:43', '1'), + ('466', '2038', '2006-02-16T02:30:53', '2005-06-21T10:56:59', '2005-06-25T16:41:59', '1'), + ('466', '2424', '2006-02-16T02:30:53', '2005-06-16T20:59:35', '2005-06-24T15:31:35', '1'), + ('466', '3526', '2006-02-16T02:30:53', '2005-07-10T09:29:49', '2005-07-16T13:37:49', '1'), + ('466', '2615', '2006-02-16T02:30:53', '2005-07-30T14:30:38', '2005-08-04T17:57:38', '1'), + ('64', '3734', '2006-02-16T02:30:53', '2005-07-09T07:07:05', '2005-07-15T03:06:05', '1'), + ('64', '1342', '2006-02-16T02:30:53', '2005-07-08T17:19:15', '2005-07-16T14:32:15', '1'), + ('64', '1266', '2006-02-16T02:30:53', '2005-08-01T00:12:11', '2005-08-03T03:03:11', '1'), + ('64', '2098', '2006-02-16T02:30:53', '2005-08-02T00:54:33', '2005-08-07T19:42:33', '1'), + ('64', '3389', '2006-02-16T02:30:53', '2005-08-20T11:50:14', '2005-08-26T12:35:14', '1'), + ('64', '2565', '2006-02-16T02:30:53', '2005-07-12T14:30:28', '2005-07-14T16:20:28', '1'), + ('64', '1850', '2006-02-16T02:30:53', '2005-05-28T00:39:31', '2005-06-02T19:35:31', '1'), + ('64', '1523', '2006-02-16T02:30:53', '2005-06-17T15:42:42', '2005-06-22T16:39:42', '1'), + ('64', '460', '2006-02-16T02:30:53', '2005-07-08T23:54:49', '2005-07-16T00:15:49', '1'), + ('64', '3126', '2006-02-16T02:30:53', '2005-07-31T12:01:49', '2005-08-08T09:21:49', '1'), + ('64', '2970', '2006-02-16T02:30:53', '2005-07-12T01:06:35', '2005-07-14T03:27:35', '1'), + ('64', '1005', '2006-02-16T02:30:53', '2005-08-21T02:59:48', '2005-08-29T22:17:48', '1'), + ('165', '1390', '2006-02-16T02:30:53', '2005-07-27T04:06:24', '2005-07-28T02:04:24', '1'), + ('165', '3097', '2006-02-16T02:30:53', '2005-07-31T06:49:18', '2005-08-04T03:19:18', '1'), + ('165', '3256', '2006-02-16T02:30:53', '2005-06-17T12:03:01', '2005-06-24T10:04:01', '1'), + ('165', '217', '2006-02-16T02:30:53', '2005-08-23T15:23:50', '2005-09-01T19:31:50', '1'), + ('165', '1590', '2006-02-16T02:30:53', '2005-08-23T14:26:04', '2005-08-28T15:04:04', '1'), + ('165', '347', '2006-02-16T02:30:53', '2005-08-01T13:08:27', '2005-08-02T10:30:27', '1'), + ('165', '1194', '2006-02-16T02:30:53', '2005-07-11T00:09:17', '2005-07-14T19:18:17', '1'), + ('165', '2245', '2006-02-16T02:30:53', '2005-08-18T18:21:06', '2005-08-24T14:26:06', '1'), + ('313', '137', '2006-02-16T02:30:53', '2005-08-17T13:42:52', '2005-08-26T14:04:52', '1'), + ('313', '3970', '2006-02-16T02:30:53', '2005-08-02T02:50:49', '2005-08-08T04:39:49', '1'), + ('313', '432', '2006-02-16T02:30:53', '2005-08-01T02:07:32', '2005-08-07T03:54:32', '1'), + ('313', '3608', '2006-02-16T02:30:53', '2005-06-15T10:16:27', '2005-06-20T06:53:27', '1'), + ('313', '491', '2006-02-16T02:30:53', '2005-07-11T22:07:26', '2005-07-16T22:39:26', '1'), + ('313', '3944', '2006-02-16T02:30:53', '2005-06-19T14:12:22', '2005-06-21T09:29:22', '1'), + ('313', '3677', '2006-02-16T02:30:53', '2005-05-28T22:03:25', '2005-06-03T03:39:25', '1'), + ('313', '204', '2006-02-16T02:30:53', '2005-06-19T07:48:31', '2005-06-27T11:56:31', '1'), + ('313', '487', '2006-02-16T02:30:53', '2005-07-27T12:38:14', '2005-07-30T13:01:14', '1'), + ('313', '865', '2006-02-16T02:30:53', '2005-07-29T05:31:44', '2005-07-31T09:20:44', '1'), + ('313', '3653', '2006-02-16T02:30:53', '2005-08-22T20:55:56', '2005-08-27T18:52:56', '1'), + ('313', '2870', '2006-02-16T02:30:53', '2005-07-31T12:12:00', '2005-08-09T06:53:00', '1'), + ('313', '88', '2006-02-16T02:30:53', '2005-05-29T14:23:58', '2005-05-30T17:44:58', '1'), + ('485', '2166', '2006-02-16T02:30:53', '2005-07-09T10:28:18', '2005-07-12T12:18:18', '1'), + ('485', '1274', '2006-02-16T02:30:53', '2005-08-01T20:49:35', '2005-08-10T16:58:35', '1'), + ('485', '4020', '2006-02-16T02:30:53', '2005-07-06T19:12:40', '2005-07-13T23:41:40', '1'), + ('485', '4493', '2006-02-16T02:30:53', '2005-07-30T06:24:28', '2005-08-08T00:28:28', '1'), + ('485', '494', '2006-02-16T02:30:53', '2005-08-17T16:12:27', '2005-08-25T22:07:27', '1'), + ('485', '2126', '2006-02-16T02:30:53', '2005-07-30T04:31:50', '2005-08-04T03:24:50', '1'), + ('485', '314', '2006-02-16T02:30:53', '2005-07-12T21:57:16', '2005-07-14T20:56:16', '1'), + ('485', '3348', '2006-02-16T02:30:53', '2005-07-08T10:06:26', '2005-07-14T04:48:26', '1'), + ('485', '92', '2006-02-16T02:30:53', '2005-07-09T17:23:43', '2005-07-18T22:14:43', '1'), + ('485', '132', '2006-02-16T02:30:53', '2005-08-01T20:51:10', '2005-08-10T15:50:10', '1'), + ('485', '2523', '2006-02-16T02:30:53', '2005-05-31T01:47:35', '2005-06-03T20:26:35', '1'), + ('485', '3621', '2006-02-16T02:30:53', '2005-07-31T02:32:00', '2005-08-04T05:45:00', '1'), + ('485', '3521', '2006-02-16T02:30:53', '2005-06-16T15:01:36', '2005-06-23T10:48:36', '1'), + ('485', '4506', '2006-02-16T02:30:53', '2005-07-27T07:00:37', '2005-08-01T06:57:37', '1'), + ('485', '4076', '2006-02-16T02:30:53', '2005-08-18T04:16:06', '2005-08-27T08:04:06', '1'), + ('485', '2554', '2006-02-16T02:30:53', '2005-08-18T12:45:24', '2005-08-22T12:39:24', '1'), + ('485', '1511', '2006-02-16T02:30:53', '2005-07-10T16:04:59', '2005-07-16T12:10:59', '1'), + ('485', '806', '2006-02-16T02:30:53', '2005-06-16T11:57:34', '2005-06-19T09:12:34', '1'), + ('485', '4529', '2006-02-16T02:30:53', '2005-07-30T12:20:59', '2005-08-06T16:15:59', '1'), + ('67', '1067', '2006-02-16T02:30:53', '2005-07-31T05:33:25', '2005-08-09T09:41:25', '1'), + ('67', '1446', '2006-02-16T02:30:53', '2005-06-19T02:08:39', '2005-06-26T20:25:39', '1'), + ('67', '2292', '2006-02-16T02:30:53', '2005-08-19T23:37:52', '2005-08-28T22:17:52', '1'), + ('67', '1544', '2006-02-16T02:30:53', '2005-07-27T11:48:37', '2005-08-03T07:20:37', '1'), + ('67', '1890', '2006-02-16T02:30:53', '2005-08-20T12:21:05', '2005-08-22T17:58:05', '1'), + ('67', '1223', '2006-02-16T02:30:53', '2005-08-17T15:15:01', '2005-08-26T13:49:01', '1'), + ('67', '1872', '2006-02-16T02:30:53', '2005-05-27T02:22:26', '2005-06-05T00:25:26', '1'), + ('67', '423', '2006-02-16T02:30:53', '2005-08-02T15:10:06', '2005-08-10T09:52:06', '1'), + ('595', '3406', '2006-02-16T02:30:53', '2005-07-10T23:18:20', '2005-07-16T17:42:20', '1'), + ('595', '3882', '2006-02-16T02:30:53', '2005-07-27T12:59:10', '2005-07-29T11:35:10', '1'), + ('595', '3501', '2006-02-16T02:30:53', '2005-07-11T07:03:19', '2005-07-19T06:46:19', '1'), + ('595', '2649', '2006-02-16T02:30:53', '2005-07-31T11:51:46', '2005-08-09T17:18:46', '1'), + ('595', '3231', '2006-02-16T02:30:53', '2005-07-30T13:23:20', '2005-08-04T11:24:20', '1'), + ('595', '270', '2006-02-16T02:30:53', '2005-05-28T15:27:22', '2005-06-02T20:01:22', '1'), + ('595', '933', '2006-02-16T02:30:53', '2005-07-30T23:56:54', '2005-08-04T19:52:54', '1'), + ('595', '4503', '2006-02-16T02:30:53', '2005-07-27T19:48:12', '2005-08-04T17:15:12', '1'), + ('595', '3560', '2006-02-16T02:30:53', '2005-07-06T14:02:26', '2005-07-14T18:13:26', '1'), + ('595', '3257', '2006-02-16T02:30:53', '2005-08-23T05:32:03', '2005-08-26T02:31:03', '1'), + ('595', '957', '2006-02-16T02:30:53', '2005-08-18T03:17:50', '2005-08-20T02:49:50', '1'), + ('169', '544', '2006-02-16T02:30:53', '2005-08-23T03:55:54', '2005-08-24T03:54:54', '1'), + ('169', '787', '2006-02-16T02:30:53', '2005-06-17T12:52:58', '2005-06-23T11:07:58', '1'), + ('169', '266', '2006-02-16T02:30:53', '2005-05-28T04:28:38', '2005-06-02T08:19:38', '1'), + ('169', '1977', '2006-02-16T02:30:53', '2005-08-17T06:39:59', '2005-08-23T04:53:59', '1'), + ('169', '2733', '2006-02-16T02:30:53', '2005-07-27T08:27:58', '2005-08-05T09:05:58', '1'), + ('169', '473', '2006-02-16T02:30:53', '2005-07-05T23:46:19', '2005-07-15T02:31:19', '1'), + ('169', '431', '2006-02-16T02:30:53', '2005-05-31T11:18:08', '2005-06-04T08:33:08', '1'), + ('169', '2919', '2006-02-16T02:30:53', '2005-08-21T11:44:37', '2005-08-24T08:04:37', '1'), + ('169', '2856', '2006-02-16T02:30:53', '2005-07-27T23:35:49', '2005-07-30T21:38:49', '1'), + ('169', '1160', '2006-02-16T02:30:53', '2005-07-29T11:24:49', '2005-07-31T15:03:49', '1'), + ('389', '1941', '2006-02-16T02:30:53', '2005-06-16T17:51:01', '2005-06-20T17:27:01', '1'), + ('389', '237', '2006-02-16T02:30:53', '2005-08-21T23:55:50', '2005-08-28T04:31:50', '1'), + ('389', '4537', '2006-02-16T02:30:53', '2005-07-06T01:11:08', '2005-07-08T01:21:08', '1'), + ('389', '664', '2006-02-16T02:30:53', '2005-06-19T03:01:29', '2005-06-28T04:13:29', '1'), + ('389', '2590', '2006-02-16T02:30:53', '2005-08-21T14:01:44', '2005-08-28T17:20:44', '1'), + ('389', '3267', '2006-02-16T02:30:53', '2005-08-23T01:14:01', '2005-08-29T19:52:01', '1'), + ('389', '2862', '2006-02-16T02:30:53', '2005-07-27T02:57:43', '2005-07-30T08:24:43', '1'), + ('389', '1093', '2006-02-16T02:30:53', '2005-08-23T21:11:33', '2005-08-31T17:51:33', '1'), + ('389', '3029', '2006-02-16T02:30:53', '2005-07-10T05:49:35', '2005-07-15T08:05:35', '1'), + ('389', '3531', '2006-02-16T02:30:53', '2005-07-11T07:01:35', '2005-07-17T02:29:35', '1'), + ('389', '72', '2006-02-16T02:30:53', '2005-07-07T23:05:53', '2005-07-16T01:46:53', '1'), + ('389', '3395', '2006-02-16T02:30:53', '2005-05-31T00:16:57', '2005-06-01T22:41:57', '1'), + ('389', '4119', '2006-02-16T02:30:53', '2005-07-30T00:36:54', '2005-08-04T19:07:54', '1'), + ('389', '1193', '2006-02-16T02:30:53', '2005-08-01T01:07:27', '2005-08-09T00:42:27', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['14599', '15725', '11522', '9679', '5065', '14233', '3398', '3429', '2272', '15719', '14719', '14302', '9095', '12110', '5601', '1281', '10429', '2966', '56', '10231', '15172', '3852', '3366', '5164', '14213', '4482', '1883', '15883', '3272', '7030', '11320', '3154', '9748', '12077', '7838', '8838', '1233', '14071', '9616', '7440', '9141', '5977', '727', '1351', '5708', '668', '9769', '7548', '6296', '13956', '6863', '11871', '16026', '13160', '5389', '5629', '6910', '3738', '9626', '14929', '9087', '11352', '2361', '14797', '14926', '6367', '15869', '5896', '8041', '7366', '824', '6839', '8124', '7353', '6288', '3865', '1788', '10503', '10502', '1246', '4180', '7911', '7703', '9443', '13403', '9595', '7724', '1546', '830', '9226', '10597', '15038', '2767', '11852', '11009', '1644', '6197', '10692', '15405', '12560']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('599', '4575', '2006-02-16T02:30:53', '2005-08-21T17:43:42', '2005-08-22T18:53:42', '1'), + ('599', '378', '2006-02-16T02:30:53', '2005-08-23T11:25:00', '2005-08-26T11:46:00', '1'), + ('599', '2033', '2006-02-16T02:30:53', '2005-08-17T00:05:05', '2005-08-24T04:56:05', '1'), + ('599', '3819', '2006-02-16T02:30:53', '2005-07-31T06:41:19', '2005-08-02T07:23:19', '1'), + ('599', '1788', '2006-02-16T02:30:53', '2005-07-09T04:42:00', '2005-07-12T08:55:00', '1'), + ('599', '2943', '2006-02-16T02:30:53', '2005-08-21T05:07:08', '2005-08-28T03:20:08', '1'), + ('599', '221', '2006-02-16T02:30:53', '2005-06-21T15:34:38', '2005-06-29T11:23:38', '1'), + ('599', '456', '2006-02-16T02:30:53', '2005-06-21T18:46:05', '2005-06-30T17:28:05', '1'), + ('599', '1364', '2006-02-16T02:30:53', '2005-06-18T06:29:53', '2005-06-23T10:58:53', '1'), + ('599', '3990', '2006-02-16T02:30:53', '2005-08-23T11:08:46', '2005-08-25T07:25:46', '1'), + ('599', '4091', '2006-02-16T02:30:53', '2005-08-21T21:41:57', '2005-08-25T20:37:57', '1'), + ('511', '1287', '2006-02-16T02:30:53', '2005-08-21T07:19:57', '2005-08-28T02:59:57', '1'), + ('511', '3019', '2006-02-16T02:30:53', '2005-07-30T08:38:36', '2005-07-31T06:14:36', '1'), + ('511', '2984', '2006-02-16T02:30:53', '2005-08-17T22:59:46', '2005-08-23T17:51:46', '1'), + ('511', '3062', '2006-02-16T02:30:53', '2005-07-10T04:56:55', '2005-07-11T00:14:55', '1'), + ('511', '2963', '2006-02-16T02:30:53', '2005-06-15T08:21:39', '2005-06-17T11:03:39', '1'), + ('511', '3894', '2006-02-16T02:30:53', '2005-08-01T08:34:18', '2005-08-10T12:38:18', '1'), + ('511', '3483', '2006-02-16T02:30:53', '2005-06-20T07:39:33', '2005-06-29T07:48:33', '1'), + ('511', '1352', '2006-02-16T02:30:53', '2005-05-25T08:28:11', '2005-05-26T14:21:11', '1'), + ('511', '1056', '2006-02-16T02:30:53', '2005-08-01T01:50:49', '2005-08-06T03:12:49', '1'), + ('511', '2367', '2006-02-16T02:30:53', '2005-08-22T15:25:33', '2005-08-23T17:29:33', '1'), + ('511', '3329', '2006-02-16T02:30:53', '2005-07-06T16:57:49', '2005-07-11T17:11:49', '1'), + ('511', '2584', '2006-02-16T02:30:53', '2005-06-21T13:03:37', '2005-06-26T16:29:37', '1'), + ('511', '1170', '2006-02-16T02:30:53', '2005-07-09T09:03:14', '2005-07-14T04:20:14', '1'), + ('511', '382', '2006-02-16T02:30:53', '2005-08-21T04:30:47', '2005-08-24T23:01:47', '1'), + ('511', '3500', '2006-02-16T02:30:53', '2005-07-08T01:01:18', '2005-07-11T01:18:18', '1'), + ('550', '3504', '2006-02-16T02:30:53', '2005-06-17T03:18:51', '2005-06-18T05:46:51', '1'), + ('550', '2792', '2006-02-16T02:30:53', '2005-08-23T16:44:56', '2005-08-24T22:42:56', '1'), + ('550', '1090', '2006-02-16T02:30:53', '2005-06-21T05:18:27', '2005-06-30T02:51:27', '1'), + ('550', '1277', '2006-02-16T02:30:53', '2005-07-27T03:01:40', '2005-07-31T07:01:40', '1'), + ('550', '3362', '2006-02-16T02:30:53', '2005-08-02T16:13:28', '2005-08-05T21:23:28', '1'), + ('550', '3195', '2006-02-16T02:30:53', '2005-06-20T20:44:40', '2005-06-23T19:10:40', '1'), + ('550', '3308', '2006-02-16T02:30:53', '2005-07-31T09:17:56', '2005-08-02T14:54:56', '1'), + ('550', '3589', '2006-02-16T02:30:53', '2005-08-17T21:59:14', '2005-08-22T03:23:14', '1'), + ('550', '2222', '2006-02-16T02:30:53', '2005-07-28T09:00:21', '2005-07-29T05:52:21', '1'), + ('550', '133', '2006-02-16T02:30:53', '2005-07-29T22:52:23', '2005-08-03T22:49:23', '1'), + ('550', '4214', '2006-02-16T02:30:53', '2005-06-15T04:18:37', '2005-06-22T03:36:37', '1'), + ('550', '2471', '2006-02-16T02:30:53', '2005-08-20T23:01:56', '2005-08-22T02:14:56', '1'), + ('550', '1210', '2006-02-16T02:30:53', '2005-07-31T04:05:01', '2005-08-05T00:10:01', '1'), + ('484', '1476', '2006-02-16T02:30:53', '2005-07-27T17:43:27', '2005-08-03T22:12:27', '1'), + ('484', '3087', '2006-02-16T02:30:53', '2005-07-30T10:16:04', '2005-08-05T08:01:04', '1'), + ('484', '4011', '2006-02-16T02:30:53', '2005-07-11T00:16:38', '2005-07-19T21:00:38', '1'), + ('484', '1629', '2006-02-16T02:30:53', '2005-05-29T06:08:15', '2005-05-30T07:16:15', '1'), + ('484', '2364', '2006-02-16T02:30:53', '2005-06-15T12:51:03', '2005-06-22T07:23:03', '1'), + ('484', '571', '2006-02-16T02:30:53', '2005-07-10T10:29:19', '2005-07-18T06:50:19', '1'), + ('484', '3528', '2006-02-16T02:30:53', '2005-05-28T21:54:45', '2005-05-29T22:32:45', '1'), + ('484', '2958', '2006-02-16T02:30:53', '2005-07-31T09:52:16', '2005-08-06T09:26:16', '1'), + ('484', '2194', '2006-02-16T02:30:53', '2005-07-27T21:53:18', '2005-08-02T17:50:18', '1'), + ('484', '4202', '2006-02-16T02:30:53', '2005-07-11T17:34:04', '2005-07-17T21:12:04', '1'), + ('484', '3757', '2006-02-16T02:30:53', '2005-08-20T18:08:19', '2005-08-29T17:03:19', '1'), + ('484', '229', '2006-02-16T02:30:53', '2005-07-12T19:58:34', '2005-07-21T16:57:34', '1'), + ('484', '3013', '2006-02-16T02:30:53', '2005-08-17T14:11:44', '2005-08-18T17:50:44', '1'), + ('484', '467', '2006-02-16T02:30:53', '2005-08-23T21:49:22', '2005-08-27T00:47:22', '1'), + ('484', '410', '2006-02-16T02:30:53', '2005-08-19T13:21:04', '2005-08-22T18:49:04', '1'), + ('484', '3882', '2006-02-16T02:30:53', '2005-07-09T19:25:45', '2005-07-17T13:31:45', '1'), + ('546', '400', '2006-02-16T02:30:53', '2005-07-10T06:02:25', '2005-07-16T07:33:25', '1'), + ('546', '1290', '2006-02-16T02:30:53', '2005-07-12T22:11:21', '2005-07-21T02:35:21', '1'), + ('546', '578', '2006-02-16T02:30:53', '2005-07-06T11:50:57', '2005-07-09T08:07:57', '1'), + ('546', '2216', '2006-02-16T02:30:53', '2005-07-31T04:37:41', '2005-08-08T04:00:41', '1'), + ('546', '4195', '2006-02-16T02:30:53', '2005-08-22T05:32:38', '2005-08-28T00:02:38', '1'), + ('546', '4048', '2006-02-16T02:30:53', '2005-07-30T08:19:47', '2005-08-02T07:15:47', '1'), + ('546', '2760', '2006-02-16T02:30:53', '2005-08-02T17:29:39', '2005-08-10T15:31:39', '1'), + ('546', '3547', '2006-02-16T02:30:53', '2005-06-18T13:19:05', '2005-06-23T07:59:05', '1'), + ('546', '1131', '2006-02-16T02:30:53', '2005-08-22T00:41:24', '2005-08-23T18:51:24', '1'), + ('357', '2448', '2006-02-16T02:30:53', '2005-08-22T05:18:44', '2005-08-26T02:18:44', '1'), + ('357', '1465', '2006-02-16T02:30:53', '2005-07-11T21:18:29', '2005-07-15T01:05:29', '1'), + ('357', '1344', '2006-02-16T02:30:53', '2005-08-23T16:22:20', '2005-08-27T11:52:20', '1'), + ('357', '731', '2006-02-16T02:30:53', '2005-07-10T20:15:56', '2005-07-12T00:39:56', '1'), + ('357', '763', '2006-02-16T02:30:53', '2005-07-28T16:39:56', '2005-07-30T18:44:56', '1'), + ('357', '461', '2006-02-16T02:30:53', '2005-07-27T15:01:17', '2005-08-04T20:28:17', '1'), + ('357', '3518', '2006-02-16T02:30:53', '2005-05-29T21:45:32', '2005-05-31T19:01:32', '1'), + ('357', '3900', '2006-02-16T02:30:53', '2005-07-12T19:03:19', '2005-07-15T23:48:19', '1'), + ('357', '1187', '2006-02-16T02:30:53', '2005-07-28T19:28:58', '2005-07-31T00:45:58', '1'), + ('357', '1308', '2006-02-16T02:30:53', '2005-07-27T14:38:39', '2005-07-31T19:50:39', '1'), + ('357', '3235', '2006-02-16T02:30:53', '2005-07-11T17:01:52', '2005-07-19T15:11:52', '1'), + ('357', '3579', '2006-02-16T02:30:53', '2005-07-06T17:46:57', '2005-07-12T12:20:57', '1'), + ('357', '3794', '2006-02-16T02:30:53', '2005-06-16T19:47:18', '2005-06-22T23:10:18', '1'), + ('357', '1823', '2006-02-16T02:30:53', '2005-08-01T11:07:44', '2005-08-08T08:22:44', '1'), + ('357', '3193', '2006-02-16T02:30:53', '2005-08-01T11:06:39', '2005-08-05T07:11:39', '1'), + ('357', '431', '2006-02-16T02:30:53', '2005-06-15T05:11:19', '2005-06-21T02:21:19', '1'), + ('3', '1704', '2006-02-16T02:30:53', '2005-07-07T10:23:25', '2005-07-10T13:18:25', '1'), + ('3', '390', '2006-02-16T02:30:53', '2005-07-28T11:46:45', '2005-07-29T07:19:45', '1'), + ('3', '2150', '2006-02-16T02:30:53', '2005-07-28T03:59:21', '2005-08-05T08:52:21', '1'), + ('3', '1675', '2006-02-16T02:30:53', '2005-07-30T21:45:46', '2005-08-05T21:22:46', '1'), + ('3', '3241', '2006-02-16T02:30:53', '2005-08-19T22:18:07', '2005-08-27T19:23:07', '1'), + ('3', '2829', '2006-02-16T02:30:53', '2005-07-31T03:27:58', '2005-08-03T05:58:58', '1'), + ('3', '346', '2006-02-16T02:30:53', '2005-07-28T04:46:30', '2005-08-04T08:41:30', '1'), + ('3', '3913', '2006-02-16T02:30:53', '2005-06-16T01:34:05', '2005-06-24T04:27:05', '1'), + ('3', '3464', '2006-02-16T02:30:53', '2005-05-29T22:43:55', '2005-06-01T17:43:55', '1'), + ('3', '4315', '2006-02-16T02:30:53', '2005-07-30T13:31:20', '2005-08-06T16:42:20', '1'), + ('3', '3292', '2006-02-16T02:30:53', '2005-08-01T14:19:48', '2005-08-08T20:01:48', '1'), + ('3', '1685', '2006-02-16T02:30:53', '2005-08-22T09:37:27', '2005-08-23T14:39:27', '1'), + ('596', '4052', '2006-02-16T02:30:53', '2005-06-19T17:46:35', '2005-06-24T22:42:35', '1'), + ('596', '2358', '2006-02-16T02:30:53', '2005-08-17T13:38:27', '2005-08-24T08:50:27', '1'), + ('596', '2574', '2006-02-16T02:30:53', '2005-08-02T05:06:23', '2005-08-08T03:02:23', '1'), + ('596', '749', '2006-02-16T02:30:53', '2005-06-16T08:58:18', '2005-06-21T06:47:18', '1'), + ('596', '4156', '2006-02-16T02:30:53', '2005-07-11T12:09:51', '2005-07-12T06:15:51', '1'), + ('596', '371', '2006-02-16T02:30:53', '2005-08-01T18:12:35', '2005-08-07T13:06:35', '1'), + ('596', '3263', '2006-02-16T02:30:53', '2005-08-22T23:20:41', '2005-08-25T23:53:41', '1'), + ('596', '829', '2006-02-16T02:30:53', '2005-08-18T14:54:19', '2005-08-27T13:39:19', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['667', '625', '14417', '15423', '12878', '6017', '11713', '2775', '14830', '7665', '9884', '7010', '4685', '8195', '8801', '5165', '2964', '8752', '14086', '986', '566', '10404', '12572', '13126', '7887', '14283', '1606', '3658', '1378', '2081', '14655', '10765', '374', '839', '12369', '13305', '7410', '4093', '8516', '6305', '8919', '11847', '5112', '10628', '5683', '12449', '6644', '1302', '6010', '8466', '6333', '7211', '1161', '4007', '15489', '1488', '14760', '6669', '5210', '3730', '11471', '7477', '3567', '6262', '13821', '1612', '1110', '15531', '7108', '6437', '6127', '5188', '13949', '3150', '7532', '14686', '5643', '3911', '14701', '2257', '10523', '12651', '5918', '7124', '1900', '10615', '13026', '4736', '3641', '10676', '3178', '9845', '3748', '11641', '5205', '9989', '4530', '8849', '9814', '15331']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('596', '797', '2006-02-16T02:30:53', '2005-05-28T21:49:02', '2005-05-31T03:07:02', '1'), + ('596', '2889', '2006-02-16T02:30:53', '2005-05-28T16:35:46', '2005-06-01T14:19:46', '1'), + ('596', '1768', '2006-02-16T02:30:53', '2005-08-21T11:13:35', '2005-08-25T11:27:35', '1'), + ('596', '1786', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('596', '1182', '2006-02-16T02:30:53', '2005-08-19T03:17:08', '2005-08-23T03:44:08', '1'), + ('596', '4088', '2006-02-16T02:30:53', '2005-07-11T02:05:32', '2005-07-14T22:50:32', '1'), + ('590', '1919', '2006-02-16T02:30:53', '2005-08-17T07:34:05', '2005-08-25T07:49:05', '1'), + ('590', '672', '2006-02-16T02:30:53', '2005-06-19T18:14:20', '2005-06-26T19:52:20', '1'), + ('590', '637', '2006-02-16T02:30:53', '2005-08-22T01:37:19', '2005-08-27T20:10:19', '1'), + ('590', '1455', '2006-02-16T02:30:53', '2005-07-28T02:28:30', '2005-07-31T20:42:30', '1'), + ('590', '511', '2006-02-16T02:30:53', '2005-07-31T13:56:24', '2005-08-01T16:59:24', '1'), + ('590', '3016', '2006-02-16T02:30:53', '2005-07-27T01:56:01', '2005-07-30T04:40:01', '1'), + ('590', '602', '2006-02-16T02:30:53', '2005-07-08T10:45:13', '2005-07-12T08:29:13', '1'), + ('590', '3989', '2006-02-16T02:30:53', '2005-07-28T22:52:58', '2005-08-04T02:12:58', '1'), + ('590', '1111', '2006-02-16T02:30:53', '2005-07-29T21:25:22', '2005-08-01T00:02:22', '1'), + ('590', '280', '2006-02-16T02:30:53', '2005-07-09T09:08:53', '2005-07-14T06:01:53', '1'), + ('590', '1201', '2006-02-16T02:30:53', '2005-06-20T07:33:29', '2005-06-29T12:48:29', '1'), + ('253', '4202', '2006-02-16T02:30:53', '2005-07-29T19:15:07', '2005-07-31T13:27:07', '1'), + ('253', '3244', '2006-02-16T02:30:53', '2005-08-20T23:47:54', '2005-08-27T22:49:54', '1'), + ('253', '4045', '2006-02-16T02:30:53', '2005-05-30T22:22:52', '2005-06-01T02:24:52', '1'), + ('253', '4330', '2006-02-16T02:30:53', '2005-05-28T09:51:39', '2005-06-05T09:35:39', '1'), + ('253', '2580', '2006-02-16T02:30:53', '2005-08-01T07:31:25', '2005-08-07T09:23:25', '1'), + ('253', '1366', '2006-02-16T02:30:53', '2005-08-18T15:32:54', '2005-08-21T10:30:54', '1'), + ('253', '1392', '2006-02-16T02:30:53', '2005-08-19T12:00:28', '2005-08-28T17:27:28', '1'), + ('253', '2820', '2006-02-16T02:30:53', '2005-07-28T10:40:12', '2005-08-02T06:09:12', '1'), + ('253', '3052', '2006-02-16T02:30:53', '2005-08-21T06:44:14', '2005-08-24T01:01:14', '1'), + ('253', '4290', '2006-02-16T02:30:53', '2005-06-16T06:18:31', '2005-06-25T09:15:31', '1'), + ('253', '3453', '2006-02-16T02:30:53', '2005-07-06T08:01:08', '2005-07-15T06:36:08', '1'), + ('253', '4372', '2006-02-16T02:30:53', '2005-06-15T15:03:15', '2005-06-19T16:50:15', '1'), + ('253', '917', '2006-02-16T02:30:53', '2005-06-17T17:05:02', '2005-06-26T20:26:02', '1'), + ('253', '785', '2006-02-16T02:30:53', '2005-08-21T19:37:10', '2005-08-22T15:43:10', '1'), + ('337', '566', '2006-02-16T02:30:53', '2005-08-01T20:34:51', '2005-08-04T00:02:51', '1'), + ('337', '4420', '2006-02-16T02:30:53', '2005-05-27T08:26:30', '2005-06-05T07:13:30', '1'), + ('337', '1886', '2006-02-16T02:30:53', '2005-05-30T00:28:12', '2005-06-08T02:43:12', '1'), + ('337', '484', '2006-02-16T02:30:53', '2005-08-18T07:57:43', '2005-08-26T09:36:43', '1'), + ('337', '2386', '2006-02-16T02:30:53', '2005-08-19T18:57:05', '2005-08-28T22:28:05', '1'), + ('337', '1559', '2006-02-16T02:30:53', '2005-07-27T16:41:59', '2005-07-29T22:11:59', '1'), + ('337', '1534', '2006-02-16T02:30:53', '2005-07-07T05:54:50', '2005-07-12T00:34:50', '1'), + ('337', '981', '2006-02-16T02:30:53', '2005-07-29T10:00:03', '2005-08-02T09:34:03', '1'), + ('337', '1544', '2006-02-16T02:30:53', '2005-07-11T18:02:25', '2005-07-20T13:29:25', '1'), + ('337', '4006', '2006-02-16T02:30:53', '2005-07-30T01:57:03', '2005-08-08T05:14:03', '1'), + ('337', '1784', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('285', '3529', '2006-02-16T02:30:53', '2005-07-09T07:04:04', '2005-07-13T08:42:04', '1'), + ('285', '427', '2006-02-16T02:30:53', '2005-08-01T15:33:19', '2005-08-05T17:27:19', '1'), + ('285', '4433', '2006-02-16T02:30:53', '2005-07-10T08:52:13', '2005-07-19T10:25:13', '1'), + ('285', '663', '2006-02-16T02:30:53', '2005-08-18T11:03:04', '2005-08-19T07:34:04', '1'), + ('285', '2667', '2006-02-16T02:30:53', '2005-07-12T10:39:39', '2005-07-14T11:50:39', '1'), + ('285', '324', '2006-02-16T02:30:53', '2005-06-15T09:48:37', '2005-06-22T06:18:37', '1'), + ('285', '771', '2006-02-16T02:30:53', '2005-07-11T01:52:28', '2005-07-13T03:13:28', '1'), + ('285', '4010', '2006-02-16T02:30:53', '2005-07-29T08:24:47', '2005-07-31T03:43:47', '1'), + ('285', '2610', '2006-02-16T02:30:53', '2005-07-11T19:20:16', '2005-07-17T15:33:16', '1'), + ('285', '4445', '2006-02-16T02:30:53', '2005-07-27T09:20:00', '2005-08-02T14:53:00', '1'), + ('285', '1690', '2006-02-16T02:30:53', '2005-06-14T23:07:08', '2005-06-21T17:12:08', '1'), + ('285', '2071', '2006-02-16T02:30:53', '2005-07-07T00:26:05', '2005-07-15T19:53:05', '1'), + ('285', '764', '2006-02-16T02:30:53', '2005-08-23T02:06:41', '2005-08-25T06:50:41', '1'), + ('355', '1081', '2006-02-16T02:30:53', '2005-06-15T21:39:54', '2005-06-16T20:33:54', '1'), + ('355', '1367', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('355', '1420', '2006-02-16T02:30:53', '2005-07-12T11:39:55', '2005-07-20T05:56:55', '1'), + ('355', '4514', '2006-02-16T02:30:53', '2005-07-09T11:24:19', '2005-07-11T06:27:19', '1'), + ('355', '1665', '2006-02-16T02:30:53', '2005-07-06T11:31:24', '2005-07-15T06:53:24', '1'), + ('355', '3378', '2006-02-16T02:30:53', '2005-08-02T21:49:03', '2005-08-08T00:17:03', '1'), + ('355', '2692', '2006-02-16T02:30:53', '2005-07-27T19:11:03', '2005-08-02T19:25:03', '1'), + ('355', '27', '2006-02-16T02:30:53', '2005-07-06T03:09:36', '2005-07-12T02:15:36', '1'), + ('355', '4136', '2006-02-16T02:30:53', '2005-07-11T15:33:24', '2005-07-17T12:40:24', '1'), + ('355', '2402', '2006-02-16T02:30:53', '2005-08-20T13:33:47', '2005-08-25T18:09:47', '1'), + ('355', '3025', '2006-02-16T02:30:53', '2005-06-16T06:52:05', '2005-06-19T01:51:05', '1'), + ('355', '2085', '2006-02-16T02:30:53', '2005-05-31T15:22:51', '2005-06-07T14:32:51', '1'), + ('355', '2410', '2006-02-16T02:30:53', '2005-08-23T03:52:36', '2005-08-25T23:21:36', '1'), + ('355', '2720', '2006-02-16T02:30:53', '2005-07-27T05:28:32', '2005-07-31T07:52:32', '1'), + ('355', '4539', '2006-02-16T02:30:53', '2005-07-12T00:20:29', '2005-07-12T22:26:29', '1'), + ('355', '285', '2006-02-16T02:30:53', '2005-07-11T08:06:59', '2005-07-12T09:01:59', '1'), + ('34', '3265', '2006-02-16T02:30:53', '2005-07-09T10:22:31', '2005-07-13T04:41:31', '1'), + ('34', '1518', '2006-02-16T02:30:53', '2005-08-20T17:55:13', '2005-08-22T20:49:13', '1'), + ('34', '94', '2006-02-16T02:30:53', '2005-06-20T20:35:28', '2005-06-26T01:01:28', '1'), + ('34', '677', '2006-02-16T02:30:53', '2005-07-27T21:20:52', '2005-07-30T21:38:52', '1'), + ('34', '814', '2006-02-16T02:30:53', '2005-08-21T20:32:08', '2005-08-26T18:07:08', '1'), + ('34', '796', '2006-02-16T02:30:53', '2005-07-10T06:49:00', '2005-07-14T01:53:00', '1'), + ('34', '4548', '2006-02-16T02:30:53', '2005-07-06T20:09:11', '2005-07-08T23:53:11', '1'), + ('34', '3034', '2006-02-16T02:30:53', '2005-08-21T20:54:32', '2005-08-30T16:46:32', '1'), + ('34', '2846', '2006-02-16T02:30:53', '2005-06-18T05:29:52', '2005-06-22T00:19:52', '1'), + ('34', '2408', '2006-02-16T02:30:53', '2005-08-01T11:52:32', '2005-08-02T10:47:32', '1'), + ('34', '8', '2006-02-16T02:30:53', '2005-08-18T18:36:16', '2005-08-22T22:01:16', '1'), + ('34', '120', '2006-02-16T02:30:53', '2005-07-10T21:32:06', '2005-07-19T21:35:06', '1'), + ('34', '3449', '2006-02-16T02:30:53', '2005-07-27T06:09:30', '2005-08-02T09:31:30', '1'), + ('34', '1425', '2006-02-16T02:30:53', '2005-06-17T04:29:58', '2005-06-21T05:58:58', '1'), + ('34', '2639', '2006-02-16T02:30:53', '2005-08-01T14:58:14', '2005-08-02T13:38:14', '1'), + ('79', '3026', '2006-02-16T02:30:53', '2005-08-19T08:22:45', '2005-08-21T09:31:45', '1'), + ('79', '3009', '2006-02-16T02:30:53', '2005-07-08T13:22:55', '2005-07-17T07:27:55', '1'), + ('79', '3834', '2006-02-16T02:30:53', '2005-07-06T07:17:09', '2005-07-11T07:25:09', '1'), + ('79', '629', '2006-02-16T02:30:53', '2005-08-01T17:14:15', '2005-08-04T12:34:15', '1'), + ('79', '3517', '2006-02-16T02:30:53', '2005-06-20T22:35:12', '2005-06-23T19:39:12', '1'), + ('79', '2417', '2006-02-16T02:30:53', '2005-07-31T12:28:05', '2005-08-06T06:47:05', '1'), + ('79', '2920', '2006-02-16T02:30:53', '2005-07-06T12:11:22', '2005-07-12T07:22:22', '1'), + ('79', '2717', '2006-02-16T02:30:53', '2005-08-17T04:45:39', '2005-08-20T10:38:39', '1'), + ('79', '161', '2006-02-16T02:30:53', '2005-07-09T10:56:37', '2005-07-13T05:45:37', '1'), + ('79', '1713', '2006-02-16T02:30:53', '2005-07-31T17:22:39', '2005-08-01T18:55:39', '1'), + ('79', '3775', '2006-02-16T02:30:53', '2005-07-08T03:27:05', '2005-07-11T07:44:05', '1'), + ('79', '4300', '2006-02-16T02:30:53', '2005-07-29T23:21:01', '2005-08-03T20:01:01', '1'), + ('79', '136', '2006-02-16T02:30:53', '2005-07-31T11:29:46', '2005-08-08T15:49:46', '1'), + ('147', '146', '2006-02-16T02:30:53', '2005-08-22T20:37:57', '2005-08-25T21:56:57', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['3919', '362', '6753', '10706', '2456', '6343', '12757', '5844', '509', '8893', '2859', '14021', '13062', '8346', '11559', '10636', '917', '5783', '6933', '7776', '12686', '9570', '8518', '3953', '15120', '13572', '11166', '8950', '8014', '987', '11502', '8715', '1470', '3192', '4608', '10812', '13790', '9974', '12370', '4570', '15692', '15077', '15056', '2225', '11075', '6166', '13332', '5465', '2108', '2655', '7453', '3324', '14985', '12615', '4262', '10543', '13777', '5857', '12508', '13832', '13436', '8673', '12488', '4313', '2923', '2735', '2673', '2972', '6876', '10920', '7444', '5587', '3921', '15360', '7753', '8359', '10941', '681', '12923', '3765', '11170', '8828', '14884', '7859', '14510', '13307', '306', '6605', '11361', '2022', '3679', '10980', '443', '10903', '9928', '3140', '1964', '5185', '3591', '13789']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('147', '2695', '2006-02-16T02:30:53', '2005-07-06T20:26:21', '2005-07-15T00:13:21', '1'), + ('147', '2324', '2006-02-16T02:30:53', '2005-05-27T07:10:25', '2005-06-01T08:34:25', '1'), + ('147', '2591', '2006-02-16T02:30:53', '2005-07-12T14:55:42', '2005-07-18T19:16:42', '1'), + ('147', '1183', '2006-02-16T02:30:53', '2005-08-01T18:41:28', '2005-08-10T14:30:28', '1'), + ('147', '553', '2006-02-16T02:30:53', '2005-06-18T19:36:50', '2005-06-23T22:48:50', '1'), + ('147', '513', '2006-02-16T02:30:53', '2005-07-11T19:51:35', '2005-07-12T19:13:35', '1'), + ('147', '1095', '2006-02-16T02:30:53', '2005-08-18T22:57:45', '2005-08-21T22:43:45', '1'), + ('147', '609', '2006-02-16T02:30:53', '2005-07-10T17:14:43', '2005-07-12T19:27:43', '1'), + ('147', '3416', '2006-02-16T02:30:53', '2005-05-28T02:51:12', '2005-05-31T06:27:12', '1'), + ('147', '1048', '2006-02-16T02:30:53', '2005-07-30T00:48:19', '2005-08-01T03:25:19', '1'), + ('147', '126', '2006-02-16T02:30:53', '2005-06-19T23:18:42', '2005-06-20T22:38:42', '1'), + ('147', '4394', '2006-02-16T02:30:53', '2005-08-20T21:02:12', '2005-08-27T22:15:12', '1'), + ('385', '1790', '2006-02-16T02:30:53', '2005-08-19T09:44:17', '2005-08-27T11:42:17', '1'), + ('385', '2475', '2006-02-16T02:30:53', '2005-07-29T04:48:22', '2005-08-01T04:22:22', '1'), + ('385', '1812', '2006-02-16T02:30:53', '2005-08-17T01:20:26', '2005-08-24T03:11:26', '1'), + ('385', '621', '2006-02-16T02:30:53', '2005-08-01T15:40:35', '2005-08-05T18:46:35', '1'), + ('385', '3629', '2006-02-16T02:30:53', '2005-05-30T11:27:06', '2005-06-02T08:31:06', '1'), + ('385', '3331', '2006-02-16T02:30:53', '2005-07-10T13:55:33', '2005-07-16T12:13:33', '1'), + ('385', '1334', '2006-02-16T02:30:53', '2005-07-26T23:09:23', '2005-07-31T20:50:23', '1'), + ('385', '4170', '2006-02-16T02:30:53', '2005-07-28T07:04:36', '2005-08-01T09:32:36', '1'), + ('385', '501', '2006-02-16T02:30:53', '2005-08-18T19:55:09', '2005-08-26T14:17:09', '1'), + ('385', '591', '2006-02-16T02:30:53', '2005-07-31T02:40:37', '2005-08-01T01:59:37', '1'), + ('385', '2311', '2006-02-16T02:30:53', '2005-07-29T10:05:27', '2005-08-02T05:39:27', '1'), + ('385', '3879', '2006-02-16T02:30:53', '2005-07-06T21:54:55', '2005-07-09T18:52:55', '1'), + ('11', '3083', '2006-02-16T02:30:53', '2005-08-22T12:42:47', '2005-08-23T14:21:47', '1'), + ('11', '660', '2006-02-16T02:30:53', '2005-08-20T05:07:27', '2005-08-23T23:33:27', '1'), + ('11', '638', '2006-02-16T02:30:53', '2005-08-02T10:14:58', '2005-08-11T11:43:58', '1'), + ('11', '3015', '2006-02-16T02:30:53', '2005-07-30T03:17:13', '2005-08-07T00:20:13', '1'), + ('11', '2339', '2006-02-16T02:30:53', '2005-07-28T15:32:07', '2005-07-31T20:52:07', '1'), + ('11', '390', '2006-02-16T02:30:53', '2005-05-30T22:59:12', '2005-06-07T20:56:12', '1'), + ('11', '4470', '2006-02-16T02:30:53', '2005-08-16T23:06:30', '2005-08-19T03:49:30', '1'), + ('11', '860', '2006-02-16T02:30:53', '2005-07-29T17:33:45', '2005-08-01T17:30:45', '1'), + ('11', '4044', '2006-02-16T02:30:53', '2005-06-15T20:53:07', '2005-06-25T02:12:07', '1'), + ('11', '3713', '2006-02-16T02:30:53', '2005-06-20T23:49:12', '2005-06-24T03:00:12', '1'), + ('11', '758', '2006-02-16T02:30:53', '2005-07-08T07:19:11', '2005-07-11T01:37:11', '1'), + ('11', '3762', '2006-02-16T02:30:53', '2005-08-01T22:41:16', '2005-08-07T00:50:16', '1'), + ('11', '1385', '2006-02-16T02:30:53', '2005-08-20T12:17:27', '2005-08-25T12:20:27', '1'), + ('503', '430', '2006-02-16T02:30:53', '2005-07-31T16:51:11', '2005-08-05T16:04:11', '1'), + ('503', '3343', '2006-02-16T02:30:53', '2005-08-18T07:57:47', '2005-08-22T11:32:47', '1'), + ('503', '2612', '2006-02-16T02:30:53', '2005-07-08T05:33:59', '2005-07-14T09:27:59', '1'), + ('503', '1852', '2006-02-16T02:30:53', '2005-08-23T10:00:02', '2005-08-24T05:25:02', '1'), + ('503', '3142', '2006-02-16T02:30:53', '2005-08-22T11:09:18', '2005-08-29T08:41:18', '1'), + ('503', '1871', '2006-02-16T02:30:53', '2005-08-22T10:15:54', '2005-08-25T07:21:54', '1'), + ('503', '2829', '2006-02-16T02:30:53', '2005-06-18T03:35:40', '2005-06-23T03:05:40', '1'), + ('503', '3027', '2006-02-16T02:30:53', '2005-08-02T07:24:23', '2005-08-08T04:55:23', '1'), + ('503', '967', '2006-02-16T02:30:53', '2005-07-11T10:19:05', '2005-07-12T14:30:05', '1'), + ('503', '3144', '2006-02-16T02:30:53', '2005-08-19T20:00:51', '2005-08-25T14:30:51', '1'), + ('503', '723', '2006-02-16T02:30:53', '2005-07-09T23:01:13', '2005-07-13T01:03:13', '1'), + ('503', '1395', '2006-02-16T02:30:53', '2005-06-17T19:35:26', '2005-06-25T15:45:26', '1'), + ('29', '1649', '2006-02-16T02:30:53', '2005-06-19T10:38:42', '2005-06-23T14:20:42', '1'), + ('29', '2992', '2006-02-16T02:30:53', '2005-07-27T18:27:13', '2005-07-29T23:52:13', '1'), + ('29', '2830', '2006-02-16T02:30:53', '2005-06-21T08:49:16', '2005-06-22T12:31:16', '1'), + ('29', '2017', '2006-02-16T02:30:53', '2005-08-22T07:35:56', '2005-08-29T13:17:56', '1'), + ('29', '2191', '2006-02-16T02:30:53', '2005-08-18T17:16:07', '2005-08-27T12:57:07', '1'), + ('29', '3122', '2006-02-16T02:30:53', '2005-07-07T14:24:30', '2005-07-14T13:12:30', '1'), + ('29', '624', '2006-02-16T02:30:53', '2005-08-01T12:36:09', '2005-08-07T07:42:09', '1'), + ('29', '3587', '2006-02-16T02:30:53', '2005-08-20T12:03:35', '2005-08-27T10:13:35', '1'), + ('29', '1265', '2006-02-16T02:30:53', '2005-07-10T17:59:29', '2005-07-18T18:13:29', '1'), + ('29', '1059', '2006-02-16T02:30:53', '2005-08-18T13:20:13', '2005-08-22T12:55:13', '1'), + ('29', '3299', '2006-02-16T02:30:53', '2005-08-20T14:00:25', '2005-08-28T10:11:25', '1'), + ('29', '2499', '2006-02-16T02:30:53', '2005-08-19T23:36:25', '2005-08-23T18:38:25', '1'), + ('29', '2167', '2006-02-16T02:30:53', '2005-07-29T15:50:14', '2005-08-03T18:30:14', '1'), + ('29', '3323', '2006-02-16T02:30:53', '2005-08-18T12:48:22', '2005-08-19T16:19:22', '1'), + ('29', '91', '2006-02-16T02:30:53', '2005-07-07T17:36:56', '2005-07-13T12:00:56', '1'), + ('29', '109', '2006-02-16T02:30:53', '2005-06-20T04:16:07', '2005-06-21T05:04:07', '1'), + ('29', '4550', '2006-02-16T02:30:53', '2005-06-19T15:42:07', '2005-06-22T17:28:07', '1'), + ('29', '2487', '2006-02-16T02:30:53', '2005-06-19T11:42:20', '2005-06-23T07:16:20', '1'), + ('531', '2232', '2006-02-16T02:30:53', '2005-06-20T07:57:54', '2005-06-21T12:48:54', '1'), + ('531', '34', '2006-02-16T02:30:53', '2005-07-12T20:32:50', '2005-07-16T21:12:50', '1'), + ('531', '3106', '2006-02-16T02:30:53', '2005-08-02T02:14:10', '2005-08-06T23:36:10', '1'), + ('531', '120', '2006-02-16T02:30:53', '2005-07-27T17:49:16', '2005-07-28T15:05:16', '1'), + ('531', '4485', '2006-02-16T02:30:53', '2005-07-10T04:17:25', '2005-07-15T01:41:25', '1'), + ('531', '949', '2006-02-16T02:30:53', '2005-07-06T20:29:48', '2005-07-14T01:44:48', '1'), + ('531', '1950', '2006-02-16T02:30:53', '2005-08-22T21:36:51', '2005-08-24T16:46:51', '1'), + ('531', '3071', '2006-02-16T02:30:53', '2005-07-28T06:09:19', '2005-08-06T06:17:19', '1'), + ('531', '140', '2006-02-16T02:30:53', '2005-07-29T05:02:12', '2005-08-04T08:52:12', '1'), + ('531', '2132', '2006-02-16T02:30:53', '2005-08-02T03:11:33', '2005-08-10T07:31:33', '1'), + ('531', '3346', '2006-02-16T02:30:53', '2005-05-28T23:39:44', '2005-06-01T01:42:44', '1'), + ('531', '1390', '2006-02-16T02:30:53', '2005-08-19T04:50:20', '2005-08-22T10:42:20', '1'), + ('547', '1805', '2006-02-16T02:30:53', '2005-07-06T13:01:47', '2005-07-09T07:10:47', '1'), + ('547', '1333', '2006-02-16T02:30:53', '2005-08-02T10:21:53', '2005-08-08T11:08:53', '1'), + ('547', '1608', '2006-02-16T02:30:53', '2005-07-29T22:32:54', '2005-07-30T20:41:54', '1'), + ('547', '2957', '2006-02-16T02:30:53', '2005-08-22T03:57:08', '2005-08-23T07:11:08', '1'), + ('547', '3392', '2006-02-16T02:30:53', '2005-07-28T09:57:17', '2005-08-04T06:04:17', '1'), + ('547', '1868', '2006-02-16T02:30:53', '2005-08-21T14:44:41', '2005-08-30T20:19:41', '1'), + ('547', '2242', '2006-02-16T02:30:53', '2005-08-19T18:58:44', '2005-08-22T00:15:44', '1'), + ('547', '2781', '2006-02-16T02:30:53', '2005-05-26T21:31:57', '2005-05-28T19:37:57', '1'), + ('547', '2892', '2006-02-16T02:30:53', '2005-07-12T08:01:07', '2005-07-19T03:12:07', '1'), + ('547', '1124', '2006-02-16T02:30:53', '2005-08-02T17:46:34', '2005-08-03T15:21:34', '1'), + ('547', '3053', '2006-02-16T02:30:53', '2005-06-17T12:44:39', '2005-06-25T12:32:39', '1'), + ('547', '2186', '2006-02-16T02:30:53', '2005-07-06T09:15:57', '2005-07-08T03:20:57', '1'), + ('547', '150', '2006-02-16T02:30:53', '2005-08-02T04:17:32', '2005-08-04T05:12:32', '1'), + ('547', '2021', '2006-02-16T02:30:53', '2005-05-27T18:35:20', '2005-06-04T18:58:20', '1'), + ('547', '2696', '2006-02-16T02:30:53', '2005-08-02T01:41:59', '2005-08-06T23:03:59', '1'), + ('53', '3627', '2006-02-16T02:30:53', '2005-07-31T15:13:57', '2005-08-06T20:39:57', '1'), + ('53', '2936', '2006-02-16T02:30:53', '2005-06-20T19:47:12', '2005-06-24T23:24:12', '1'), + ('53', '3390', '2006-02-16T02:30:53', '2005-06-17T09:10:09', '2005-06-21T15:08:09', '1'), + ('53', '357', '2006-02-16T02:30:53', '2005-07-09T10:14:39', '2005-07-10T13:31:39', '1'), + ('53', '1241', '2006-02-16T02:30:53', '2005-07-06T04:37:10', '2005-07-09T23:32:10', '1'), + ('53', '2523', '2006-02-16T02:30:53', '2005-08-20T12:16:38', '2005-08-25T07:29:38', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['751', '14811', '14091', '378', '14671', '9343', '12054', '7466', '14061', '3898', '856', '2388', '2690', '6302', '870', '10406', '11434', '5599', '4188', '14381', '11602', '6463', '10210', '5583', '891', '1931', '8913', '8908', '14433', '4059', '13024', '10171', '12906', '15927', '8450', '5923', '4292', '167', '8722', '14359', '460', '2264', '12283', '15641', '5262', '8905', '6956', '2872', '6272', '13030', '7870', '9380', '6395', '7006', '12518', '4328', '11539', '4539', '9932', '14243', '3403', '15595', '6391', '13664', '9861', '11533', '11527', '15937', '2347', '14440', '5894', '1430', '5146', '12851', '334', '4231', '14691', '4653', '1840', '9472', '14912', '1081', '8455', '9206', '4495', '10651', '13412', '3927', '14835', '1506', '14838', '8058', '12325', '4350', '3074', '3497', '14898', '7862', '9520', '6853']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('53', '2711', '2006-02-16T02:30:53', '2005-05-29T09:55:43', '2005-06-02T04:54:43', '1'), + ('53', '1613', '2006-02-16T02:30:53', '2005-08-22T01:09:04', '2005-08-26T19:30:04', '1'), + ('53', '3304', '2006-02-16T02:30:53', '2005-08-21T00:11:17', '2005-08-27T18:38:17', '1'), + ('53', '2242', '2006-02-16T02:30:53', '2005-05-27T09:23:22', '2005-05-29T15:20:22', '1'), + ('53', '2622', '2006-02-16T02:30:53', '2005-08-21T19:59:30', '2005-08-22T19:39:30', '1'), + ('53', '3521', '2006-02-16T02:30:53', '2005-07-30T18:13:13', '2005-08-02T13:48:13', '1'), + ('53', '3780', '2006-02-16T02:30:53', '2005-08-17T20:59:56', '2005-08-23T19:57:56', '1'), + ('53', '2791', '2006-02-16T02:30:53', '2005-07-27T18:51:17', '2005-07-31T16:58:17', '1'), + ('53', '73', '2006-02-16T02:30:53', '2005-08-20T22:32:11', '2005-08-22T19:28:11', '1'), + ('53', '3858', '2006-02-16T02:30:53', '2005-07-06T19:12:37', '2005-07-11T15:50:37', '1'), + ('53', '3969', '2006-02-16T02:30:53', '2005-05-30T02:01:21', '2005-06-07T03:25:21', '1'), + ('53', '2923', '2006-02-16T02:30:53', '2005-06-18T15:26:30', '2005-06-20T20:24:30', '1'), + ('391', '1381', '2006-02-16T02:30:53', '2005-06-19T13:00:02', '2005-06-27T14:29:02', '1'), + ('391', '3221', '2006-02-16T02:30:53', '2005-07-11T17:55:38', '2005-07-17T22:11:38', '1'), + ('391', '2903', '2006-02-16T02:30:53', '2005-05-30T04:25:47', '2005-06-06T04:32:47', '1'), + ('391', '2614', '2006-02-16T02:30:53', '2005-08-01T07:37:05', '2005-08-02T06:11:05', '1'), + ('391', '3154', '2006-02-16T02:30:53', '2005-08-02T20:13:14', '2005-08-05T15:01:14', '1'), + ('391', '3054', '2006-02-16T02:30:53', '2005-07-10T04:52:04', '2005-07-13T05:19:04', '1'), + ('391', '3243', '2006-02-16T02:30:53', '2005-07-07T10:45:29', '2005-07-16T09:39:29', '1'), + ('391', '811', '2006-02-16T02:30:53', '2005-08-21T09:55:47', '2005-08-25T08:23:47', '1'), + ('391', '2082', '2006-02-16T02:30:53', '2005-08-17T03:21:19', '2005-08-19T05:23:19', '1'), + ('391', '2930', '2006-02-16T02:30:53', '2005-07-12T01:16:11', '2005-07-13T01:37:11', '1'), + ('391', '49', '2006-02-16T02:30:53', '2005-08-01T00:58:52', '2005-08-10T01:16:52', '1'), + ('391', '1242', '2006-02-16T02:30:53', '2005-07-10T04:08:48', '2005-07-19T07:59:48', '1'), + ('391', '2611', '2006-02-16T02:30:53', '2005-05-30T07:43:12', '2005-06-08T09:21:12', '1'), + ('391', '1411', '2006-02-16T02:30:53', '2005-06-17T06:51:56', '2005-06-22T08:27:56', '1'), + ('391', '429', '2006-02-16T02:30:53', '2005-07-30T01:35:01', '2005-08-06T06:13:01', '1'), + ('391', '4498', '2006-02-16T02:30:53', '2005-07-30T01:26:05', '2005-07-31T20:39:05', '1'), + ('401', '732', '2006-02-16T02:30:53', '2005-08-21T11:36:34', '2005-08-26T08:51:34', '1'), + ('401', '292', '2006-02-16T02:30:53', '2005-07-07T04:04:26', '2005-07-10T22:35:26', '1'), + ('401', '2917', '2006-02-16T02:30:53', '2005-08-19T08:19:21', '2005-08-27T05:18:21', '1'), + ('401', '1367', '2006-02-16T02:30:53', '2005-07-31T23:29:05', '2005-08-03T19:39:05', '1'), + ('401', '2060', '2006-02-16T02:30:53', '2005-08-19T04:13:43', '2005-08-20T04:24:43', '1'), + ('401', '2450', '2006-02-16T02:30:53', '2005-08-23T18:23:11', '2005-08-24T15:09:11', '1'), + ('401', '484', '2006-02-16T02:30:53', '2005-07-29T07:44:05', '2005-08-01T12:23:05', '1'), + ('401', '1817', '2006-02-16T02:30:53', '2005-07-10T21:40:06', '2005-07-13T00:01:06', '1'), + ('401', '3084', '2006-02-16T02:30:53', '2005-07-07T15:48:38', '2005-07-15T17:53:38', '1'), + ('401', '865', '2006-02-16T02:30:53', '2005-05-26T02:50:31', '2005-05-27T03:07:31', '1'), + ('401', '1389', '2006-02-16T02:30:53', '2005-07-29T17:58:58', '2005-08-07T23:40:58', '1'), + ('401', '1841', '2006-02-16T02:30:53', '2005-08-21T09:16:19', '2005-08-22T09:28:19', '1'), + ('240', '4238', '2006-02-16T02:30:53', '2005-05-27T20:02:03', '2005-05-28T16:14:03', '1'), + ('240', '150', '2006-02-16T02:30:53', '2005-06-18T05:58:45', '2005-06-19T00:57:45', '1'), + ('240', '574', '2006-02-16T02:30:53', '2005-08-18T04:54:25', '2005-08-23T04:02:25', '1'), + ('240', '3126', '2006-02-16T02:30:53', '2005-08-23T08:06:49', '2005-08-24T13:17:49', '1'), + ('240', '1092', '2006-02-16T02:30:53', '2005-07-09T14:08:01', '2005-07-12T16:48:01', '1'), + ('240', '2154', '2006-02-16T02:30:53', '2005-07-30T01:11:11', '2005-08-04T22:39:11', '1'), + ('240', '2499', '2006-02-16T02:30:53', '2005-07-26T23:55:57', '2005-08-03T21:41:57', '1'), + ('240', '3779', '2006-02-16T02:30:53', '2005-06-20T00:38:21', '2005-06-26T19:56:21', '1'), + ('240', '3103', '2006-02-16T02:30:53', '2005-07-11T16:03:49', '2005-07-15T19:54:49', '1'), + ('240', '2614', '2006-02-16T02:30:53', '2005-08-19T08:28:11', '2005-08-24T07:20:11', '1'), + ('240', '970', '2006-02-16T02:30:53', '2005-07-28T10:16:03', '2005-07-31T16:06:03', '1'), + ('264', '4403', '2006-02-16T02:30:53', '2005-07-30T19:17:31', '2005-08-01T20:46:31', '1'), + ('264', '3058', '2006-02-16T02:30:53', '2005-07-11T22:29:29', '2005-07-18T00:50:29', '1'), + ('264', '3522', '2006-02-16T02:30:53', '2005-07-27T01:42:20', '2005-08-03T03:19:20', '1'), + ('264', '3860', '2006-02-16T02:30:53', '2005-08-18T13:41:32', '2005-08-23T13:01:32', '1'), + ('264', '2174', '2006-02-16T02:30:53', '2005-07-07T18:03:17', '2005-07-14T16:14:17', '1'), + ('264', '2064', '2006-02-16T02:30:53', '2005-08-17T00:45:41', '2005-08-19T06:03:41', '1'), + ('264', '2450', '2006-02-16T02:30:53', '2005-07-08T04:01:02', '2005-07-14T22:32:02', '1'), + ('264', '1691', '2006-02-16T02:30:53', '2005-07-31T15:19:48', '2005-08-05T21:09:48', '1'), + ('264', '1489', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('264', '1741', '2006-02-16T02:30:53', '2005-06-21T15:55:06', '2005-06-27T12:34:06', '1'), + ('264', '4046', '2006-02-16T02:30:53', '2005-08-23T06:19:12', '2005-08-31T04:52:12', '1'), + ('264', '1745', '2006-02-16T02:30:53', '2005-07-11T22:23:09', '2005-07-15T23:02:09', '1'), + ('264', '3750', '2006-02-16T02:30:53', '2005-08-20T08:18:36', '2005-08-26T11:04:36', '1'), + ('264', '1050', '2006-02-16T02:30:53', '2005-07-31T13:04:14', '2005-08-09T15:22:14', '1'), + ('264', '4252', '2006-02-16T02:30:53', '2005-08-17T00:34:53', '2005-08-22T06:10:53', '1'), + ('264', '162', '2006-02-16T02:30:53', '2005-08-17T00:25:06', '2005-08-22T21:13:06', '1'), + ('194', '2882', '2006-02-16T02:30:53', '2005-08-23T18:43:22', '2005-08-24T22:53:22', '1'), + ('194', '4516', '2006-02-16T02:30:53', '2005-06-18T12:12:29', '2005-06-23T14:03:29', '1'), + ('194', '3495', '2006-02-16T02:30:53', '2005-08-21T11:59:04', '2005-08-23T10:10:04', '1'), + ('194', '2264', '2006-02-16T02:30:53', '2005-07-10T20:09:34', '2005-07-17T15:39:34', '1'), + ('194', '3412', '2006-02-16T02:30:53', '2005-06-15T18:24:55', '2005-06-16T12:26:55', '1'), + ('194', '776', '2006-02-16T02:30:53', '2005-07-09T08:14:58', '2005-07-11T07:04:58', '1'), + ('194', '3311', '2006-02-16T02:30:53', '2005-08-19T02:12:12', '2005-08-25T23:51:12', '1'), + ('194', '3973', '2006-02-16T02:30:53', '2005-05-27T03:03:07', '2005-05-29T03:54:07', '1'), + ('194', '3522', '2006-02-16T02:30:53', '2005-07-07T12:48:19', '2005-07-13T18:45:19', '1'), + ('404', '2131', '2006-02-16T02:30:53', '2005-08-21T20:42:29', '2005-08-24T01:22:29', '1'), + ('404', '2511', '2006-02-16T02:30:53', '2005-07-08T09:48:01', '2005-07-17T05:18:01', '1'), + ('404', '340', '2006-02-16T02:30:53', '2005-06-16T23:39:34', '2005-06-21T23:36:34', '1'), + ('404', '4178', '2006-02-16T02:30:53', '2005-07-30T23:03:32', '2005-08-01T18:02:32', '1'), + ('404', '2658', '2006-02-16T02:30:53', '2005-08-22T04:51:42', '2005-08-23T23:50:42', '1'), + ('404', '4524', '2006-02-16T02:30:53', '2005-05-31T10:56:32', '2005-06-06T11:31:32', '1'), + ('404', '4043', '2006-02-16T02:30:53', '2005-07-29T07:53:06', '2005-08-05T05:29:06', '1'), + ('404', '2021', '2006-02-16T02:30:53', '2005-07-30T12:46:59', '2005-08-03T14:58:59', '1'), + ('404', '3515', '2006-02-16T02:30:53', '2005-07-08T01:43:46', '2005-07-10T07:38:46', '1'), + ('404', '1541', '2006-02-16T02:30:53', '2005-08-01T16:20:22', '2005-08-03T15:53:22', '1'), + ('404', '2806', '2006-02-16T02:30:53', '2005-08-19T22:46:35', '2005-08-26T18:06:35', '1'), + ('404', '2194', '2006-02-16T02:30:53', '2005-07-06T20:48:14', '2005-07-10T15:37:14', '1'), + ('404', '755', '2006-02-16T02:30:53', '2005-08-22T01:49:07', '2005-08-30T04:28:07', '1'), + ('404', '4085', '2006-02-16T02:30:53', '2005-06-15T22:19:37', '2005-06-22T18:28:37', '1'), + ('404', '506', '2006-02-16T02:30:53', '2005-08-22T01:57:34', '2005-08-25T06:34:34', '1'), + ('404', '2148', '2006-02-16T02:30:53', '2005-07-28T17:07:49', '2005-08-03T22:57:49', '1'), + ('404', '1844', '2006-02-16T02:30:53', '2005-08-18T06:41:30', '2005-08-26T02:49:30', '1'), + ('299', '2223', '2006-02-16T02:30:53', '2005-07-07T19:02:41', '2005-07-09T15:27:41', '1'), + ('299', '1441', '2006-02-16T02:30:53', '2005-06-20T14:41:41', '2005-06-21T15:56:41', '1'), + ('299', '1970', '2006-02-16T02:30:53', '2005-07-06T00:00:03', '2005-07-09T01:27:03', '1'), + ('299', '1736', '2006-02-16T02:30:53', '2005-08-22T04:26:34', '2005-08-31T10:04:34', '1'), + ('299', '2507', '2006-02-16T02:30:53', '2005-07-28T10:02:25', '2005-08-05T13:10:25', '1'), + ('299', '1306', '2006-02-16T02:30:53', '2005-07-31T00:50:54', '2005-08-04T20:05:54', '1'), + ('299', '4006', '2006-02-16T02:30:53', '2005-07-12T19:38:11', '2005-07-20T00:14:11', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['14208', '6732', '11998', '7746', '5033', '3288', '5642', '1650', '10245', '8063', '11940', '15282', '2994', '7403', '1265', '15520', '14275', '2000', '15847', '14427', '4126', '8403', '3915', '2536', '2323', '12872', '2647', '10489', '10882', '6813', '12775', '13890', '441', '11182', '13315', '12526', '8992', '11887', '15226', '1571', '198', '3816', '6963', '9231', '219', '513', '15205', '2370', '2201', '11705', '1614', '15981', '14095', '1559', '7093', '8303', '14941', '1636', '4212', '10347', '15214', '6523', '5076', '14076', '7134', '6335', '13355', '8371', '641', '5059', '14792', '1408', '14078', '12895', '14169', '12393', '1385', '7313', '10610', '10124', '8807', '15198', '8116', '8033', '10437', '8074', '7273', '2363', '12250', '573', '14762', '15298', '1476', '5326', '11367', '1725', '3284', '14463', '8856', '8168']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('299', '4180', '2006-02-16T02:30:53', '2005-08-21T04:09:18', '2005-08-22T03:29:18', '1'), + ('299', '1913', '2006-02-16T02:30:53', '2005-07-12T13:58:51', '2005-07-17T17:42:51', '1'), + ('299', '4258', '2006-02-16T02:30:53', '2005-08-17T18:46:21', '2005-08-18T20:29:21', '1'), + ('299', '176', '2006-02-16T02:30:53', '2005-07-28T05:48:56', '2005-08-04T07:33:56', '1'), + ('299', '2841', '2006-02-16T02:30:53', '2005-07-09T02:42:01', '2005-07-14T00:29:01', '1'), + ('299', '1961', '2006-02-16T02:30:53', '2005-06-21T06:36:59', '2005-06-30T06:50:59', '1'), + ('299', '3630', '2006-02-16T02:30:53', '2005-07-10T06:46:08', '2005-07-13T10:03:08', '1'), + ('299', '4125', '2006-02-16T02:30:53', '2005-06-16T09:23:20', '2005-06-23T11:25:20', '1'), + ('163', '2880', '2006-02-16T02:30:53', '2005-08-01T02:24:09', '2005-08-02T02:31:09', '1'), + ('163', '935', '2006-02-16T02:30:53', '2005-07-28T17:15:11', '2005-08-04T16:45:11', '1'), + ('163', '1188', '2006-02-16T02:30:53', '2005-08-17T16:56:28', '2005-08-18T15:09:28', '1'), + ('163', '1932', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('163', '1290', '2006-02-16T02:30:53', '2005-06-20T09:17:05', '2005-06-29T04:41:05', '1'), + ('163', '2551', '2006-02-16T02:30:53', '2005-07-27T16:22:09', '2005-08-01T15:32:09', '1'), + ('163', '982', '2006-02-16T02:30:53', '2005-06-15T07:00:50', '2005-06-19T12:27:50', '1'), + ('163', '1792', '2006-02-16T02:30:53', '2005-08-23T03:30:45', '2005-09-01T00:20:45', '1'), + ('163', '3238', '2006-02-16T02:30:53', '2005-08-21T06:30:30', '2005-08-25T12:28:30', '1'), + ('163', '323', '2006-02-16T02:30:53', '2005-06-17T11:32:30', '2005-06-22T13:37:30', '1'), + ('163', '2287', '2006-02-16T02:30:53', '2005-08-23T15:39:38', '2005-08-24T11:46:38', '1'), + ('163', '2353', '2006-02-16T02:30:53', '2005-08-21T11:26:06', '2005-08-27T10:39:06', '1'), + ('163', '3018', '2006-02-16T02:30:53', '2005-07-07T07:24:11', '2005-07-15T07:31:11', '1'), + ('163', '1360', '2006-02-16T02:30:53', '2005-07-29T06:26:39', '2005-08-02T05:37:39', '1'), + ('163', '125', '2006-02-16T02:30:53', '2005-07-06T20:16:46', '2005-07-10T17:24:46', '1'), + ('163', '4232', '2006-02-16T02:30:53', '2005-06-19T01:41:34', '2005-06-27T03:11:34', '1'), + ('54', '207', '2006-02-16T02:30:53', '2005-06-18T09:55:02', '2005-06-23T07:19:02', '1'), + ('54', '1975', '2006-02-16T02:30:53', '2005-08-19T02:57:37', '2005-08-22T23:23:37', '1'), + ('54', '1954', '2006-02-16T02:30:53', '2005-06-19T09:57:56', '2005-06-22T15:55:56', '1'), + ('54', '4067', '2006-02-16T02:30:53', '2005-08-01T10:27:42', '2005-08-07T12:56:42', '1'), + ('54', '1349', '2006-02-16T02:30:53', '2005-08-02T00:47:16', '2005-08-09T22:11:16', '1'), + ('54', '135', '2006-02-16T02:30:53', '2005-07-12T18:03:50', '2005-07-16T16:30:50', '1'), + ('54', '4374', '2006-02-16T02:30:53', '2005-08-18T23:35:56', '2005-08-26T18:37:56', '1'), + ('54', '2965', '2006-02-16T02:30:53', '2005-08-20T15:41:00', '2005-08-22T16:00:00', '1'), + ('54', '1578', '2006-02-16T02:30:53', '2005-05-27T18:11:05', '2005-05-30T22:45:05', '1'), + ('54', '605', '2006-02-16T02:30:53', '2005-08-02T10:55:14', '2005-08-06T05:58:14', '1'), + ('54', '3151', '2006-02-16T02:30:53', '2005-08-19T19:16:18', '2005-08-21T20:58:18', '1'), + ('54', '3541', '2006-02-16T02:30:53', '2005-08-18T13:48:43', '2005-08-19T10:05:43', '1'), + ('54', '4478', '2006-02-16T02:30:53', '2005-07-30T04:44:18', '2005-08-01T00:29:18', '1'), + ('54', '3290', '2006-02-16T02:30:53', '2005-08-17T15:03:13', '2005-08-19T09:49:13', '1'), + ('54', '318', '2006-02-16T02:30:53', '2005-08-22T17:20:17', '2005-08-31T15:36:17', '1'), + ('54', '1019', '2006-02-16T02:30:53', '2005-06-16T03:22:00', '2005-06-22T23:27:00', '1'), + ('54', '1789', '2006-02-16T02:30:53', '2005-05-26T07:03:49', '2005-06-04T11:45:49', '1'), + ('489', '2941', '2006-02-16T02:30:53', '2005-07-06T15:27:04', '2005-07-14T13:12:04', '1'), + ('489', '4284', '2006-02-16T02:30:53', '2005-07-27T00:13:02', '2005-08-03T18:13:02', '1'), + ('489', '1587', '2006-02-16T02:30:53', '2005-07-30T13:42:15', '2005-08-02T19:27:15', '1'), + ('489', '3074', '2006-02-16T02:30:53', '2005-05-26T09:41:45', '2005-05-28T04:40:45', '1'), + ('489', '225', '2006-02-16T02:30:53', '2005-05-28T03:08:10', '2005-05-29T07:22:10', '1'), + ('489', '3276', '2006-02-16T02:30:53', '2005-08-22T16:32:23', '2005-08-27T16:08:23', '1'), + ('489', '2656', '2006-02-16T02:30:53', '2005-06-18T14:29:54', '2005-06-24T10:23:54', '1'), + ('489', '1864', '2006-02-16T02:30:53', '2005-06-18T02:08:27', '2005-06-23T01:40:27', '1'), + ('489', '4242', '2006-02-16T02:30:53', '2005-08-17T07:22:25', '2005-08-18T06:42:25', '1'), + ('489', '23', '2006-02-16T02:30:53', '2005-06-16T06:58:02', '2005-06-23T11:24:02', '1'), + ('489', '2867', '2006-02-16T02:30:53', '2005-08-23T20:12:17', '2005-08-30T20:43:17', '1'), + ('489', '1550', '2006-02-16T02:30:53', '2005-08-21T00:25:45', '2005-08-28T23:00:45', '1'), + ('574', '716', '2006-02-16T02:30:53', '2005-06-16T02:35:03', '2005-06-19T21:22:03', '1'), + ('574', '3065', '2006-02-16T02:30:53', '2005-07-27T04:47:00', '2005-07-31T10:15:00', '1'), + ('574', '1620', '2006-02-16T02:30:53', '2005-07-29T03:05:56', '2005-08-04T06:13:56', '1'), + ('574', '2328', '2006-02-16T02:30:53', '2005-08-22T05:58:23', '2005-08-28T10:58:23', '1'), + ('574', '2052', '2006-02-16T02:30:53', '2005-06-16T08:28:54', '2005-06-24T09:23:54', '1'), + ('574', '1825', '2006-02-16T02:30:53', '2005-07-07T11:53:14', '2005-07-09T07:12:14', '1'), + ('574', '953', '2006-02-16T02:30:53', '2005-08-01T05:20:03', '2005-08-04T10:03:03', '1'), + ('574', '1500', '2006-02-16T02:30:53', '2005-08-22T16:53:29', '2005-08-24T14:17:29', '1'), + ('574', '1848', '2006-02-16T02:30:53', '2005-07-12T04:14:19', '2005-07-17T00:38:19', '1'), + ('574', '4388', '2006-02-16T02:30:53', '2005-07-09T05:13:22', '2005-07-16T09:11:22', '1'), + ('574', '1070', '2006-02-16T02:30:53', '2005-08-20T23:20:10', '2005-08-24T04:00:10', '1'), + ('574', '1058', '2006-02-16T02:30:53', '2005-07-27T06:33:06', '2005-07-28T06:15:06', '1'), + ('396', '2757', '2006-02-16T02:30:53', '2005-07-11T19:25:15', '2005-07-16T17:02:15', '1'), + ('396', '585', '2006-02-16T02:30:53', '2005-08-19T20:59:19', '2005-08-23T21:44:19', '1'), + ('396', '2466', '2006-02-16T02:30:53', '2005-07-29T05:16:35', '2005-07-31T01:49:35', '1'), + ('396', '3548', '2006-02-16T02:30:53', '2005-05-28T18:45:47', '2005-06-04T15:24:47', '1'), + ('396', '3951', '2006-02-16T02:30:53', '2005-07-09T04:28:01', '2005-07-15T22:57:01', '1'), + ('396', '4436', '2006-02-16T02:30:53', '2005-08-22T00:36:41', '2005-08-30T18:58:41', '1'), + ('396', '2655', '2006-02-16T02:30:53', '2005-06-15T16:57:58', '2005-06-22T21:08:58', '1'), + ('396', '1642', '2006-02-16T02:30:53', '2005-08-20T23:26:40', '2005-08-28T02:30:40', '1'), + ('396', '4372', '2006-02-16T02:30:53', '2005-08-19T03:50:48', '2005-08-26T09:13:48', '1'), + ('396', '3800', '2006-02-16T02:30:53', '2005-08-21T03:00:31', '2005-08-30T01:16:31', '1'), + ('396', '2435', '2006-02-16T02:30:53', '2005-08-18T09:02:41', '2005-08-26T12:47:41', '1'), + ('396', '4073', '2006-02-16T02:30:53', '2005-06-15T15:28:23', '2005-06-18T18:37:23', '1'), + ('396', '1884', '2006-02-16T02:30:53', '2005-07-27T13:11:57', '2005-08-02T07:31:57', '1'), + ('396', '1865', '2006-02-16T02:30:53', '2005-08-01T14:49:41', '2005-08-03T13:07:41', '1'), + ('396', '1956', '2006-02-16T02:30:53', '2005-07-31T21:31:49', '2005-08-04T00:06:49', '1'), + ('396', '2612', '2006-02-16T02:30:53', '2005-07-29T21:36:59', '2005-08-01T17:40:59', '1'), + ('396', '1253', '2006-02-16T02:30:53', '2005-08-22T16:15:33', '2005-08-29T20:49:33', '1'), + ('1', '4497', '2006-02-16T02:30:53', '2005-07-28T19:20:07', '2005-07-29T22:54:07', '1'), + ('1', '4268', '2006-02-16T02:30:53', '2005-07-28T16:18:23', '2005-07-30T17:56:23', '1'), + ('1', '14', '2006-02-16T02:30:53', '2005-08-01T08:51:04', '2005-08-10T12:12:04', '1'), + ('1', '1558', '2006-02-16T02:30:53', '2005-07-28T17:33:39', '2005-07-29T20:17:39', '1'), + ('1', '2465', '2006-02-16T02:30:53', '2005-07-27T11:31:22', '2005-07-31T06:50:22', '1'), + ('1', '3497', '2006-02-16T02:30:53', '2005-06-18T13:33:59', '2005-06-19T17:40:59', '1'), + ('1', '921', '2006-02-16T02:30:53', '2005-08-18T03:57:29', '2005-08-22T23:05:29', '1'), + ('1', '4020', '2006-02-16T02:30:53', '2005-05-28T10:35:23', '2005-06-03T06:32:23', '1'), + ('1', '4249', '2006-02-16T02:30:53', '2005-08-21T23:33:57', '2005-08-23T01:30:57', '1'), + ('1', '1446', '2006-02-16T02:30:53', '2005-08-22T19:41:37', '2005-08-28T22:49:37', '1'), + ('1', '1407', '2006-02-16T02:30:53', '2005-06-15T21:08:46', '2005-06-25T02:26:46', '1'), + ('1', '797', '2006-02-16T02:30:53', '2005-07-09T16:38:01', '2005-07-13T18:02:01', '1'), + ('1', '1440', '2006-02-16T02:30:53', '2005-08-02T18:01:38', '2005-08-04T13:19:38', '1'), + ('1', '726', '2006-02-16T02:30:53', '2005-06-16T15:18:57', '2005-06-17T21:05:57', '1'), + ('1', '4566', '2006-02-16T02:30:53', '2005-06-21T06:24:45', '2005-06-28T03:28:45', '1'), + ('365', '1403', '2006-02-16T02:30:53', '2005-08-21T12:51:49', '2005-08-29T12:17:49', '1'), + ('365', '2942', '2006-02-16T02:30:53', '2005-07-29T23:42:00', '2005-08-07T03:00:00', '1'), + ('365', '1120', '2006-02-16T02:30:53', '2005-07-28T21:28:32', '2005-07-30T02:10:32', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['4583', '7488', '9122', '9540', '10717', '231', '1578', '7634', '1983', '12322', '8782', '4773', '2997', '2505', '10697', '9645', '1941', '12648', '5236', '9886', '10097', '9441', '5547', '9534', '14182', '15347', '12924', '12032', '4656', '5062', '4057', '11412', '3434', '13000', '14112', '12107', '5769', '13470', '12093', '7878', '13169', '10379', '1242', '10798', '12953', '290', '7352', '5868', '844', '3409', '9849', '601', '8143', '799', '11043', '4609', '9837', '5903', '6693', '12791', '3930', '10296', '4085', '2995', '9963', '13113', '4770', '3295', '827', '11912', '12269', '10887', '1613', '5036', '11172', '8357', '10795', '2397', '15169', '8253', '4099', '1791', '2894', '13697', '574', '3809', '6362', '1908', '5023', '12452', '13197', '9062', '10193', '858', '2114', '706', '7494', '1482', '9356', '10680']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('365', '4151', '2006-02-16T02:30:53', '2005-07-08T06:09:44', '2005-07-12T03:44:44', '1'), + ('365', '554', '2006-02-16T02:30:53', '2005-07-27T19:36:15', '2005-08-05T14:14:15', '1'), + ('365', '627', '2006-02-16T02:30:53', '2005-07-30T09:36:52', '2005-08-05T13:20:52', '1'), + ('365', '2200', '2006-02-16T02:30:53', '2005-07-31T01:40:06', '2005-08-01T01:09:06', '1'), + ('365', '2934', '2006-02-16T02:30:53', '2005-08-01T18:53:53', '2005-08-05T21:28:53', '1'), + ('365', '4032', '2006-02-16T02:30:53', '2005-05-26T11:31:59', '2005-05-27T07:27:59', '1'), + ('365', '3397', '2006-02-16T02:30:53', '2005-06-16T04:08:16', '2005-06-23T07:57:16', '1'), + ('365', '4487', '2006-02-16T02:30:53', '2005-07-28T01:07:01', '2005-07-31T05:00:01', '1'), + ('365', '1955', '2006-02-16T02:30:53', '2005-06-17T10:22:13', '2005-06-24T05:04:13', '1'), + ('365', '4235', '2006-02-16T02:30:53', '2005-08-18T06:35:28', '2005-08-23T07:34:28', '1'), + ('365', '4379', '2006-02-16T02:30:53', '2005-07-29T20:29:34', '2005-08-04T02:19:34', '1'), + ('519', '3025', '2006-02-16T02:30:53', '2005-07-08T15:41:39', '2005-07-13T18:16:39', '1'), + ('519', '1449', '2006-02-16T02:30:53', '2005-06-20T09:23:45', '2005-06-29T08:15:45', '1'), + ('519', '1670', '2006-02-16T02:30:53', '2005-06-18T23:28:27', '2005-06-26T01:36:27', '1'), + ('519', '3115', '2006-02-16T02:30:53', '2005-08-01T18:20:23', '2005-08-07T21:18:23', '1'), + ('519', '3413', '2006-02-16T02:30:53', '2005-07-31T05:42:49', '2005-08-04T00:08:49', '1'), + ('519', '1063', '2006-02-16T02:30:53', '2005-06-17T07:42:45', '2005-06-20T07:12:45', '1'), + ('519', '3545', '2006-02-16T02:30:53', '2005-08-18T18:30:21', '2005-08-25T19:17:21', '1'), + ('519', '1215', '2006-02-16T02:30:53', '2005-07-09T12:56:29', '2005-07-13T08:26:29', '1'), + ('519', '1386', '2006-02-16T02:30:53', '2005-07-31T14:00:13', '2005-08-08T19:30:13', '1'), + ('519', '784', '2006-02-16T02:30:53', '2005-07-31T20:39:38', '2005-08-08T22:22:38', '1'), + ('519', '3982', '2006-02-16T02:30:53', '2005-07-30T21:43:28', '2005-08-08T16:57:28', '1'), + ('519', '1432', '2006-02-16T02:30:53', '2005-07-10T02:52:47', '2005-07-16T02:10:47', '1'), + ('519', '4457', '2006-02-16T02:30:53', '2005-07-31T01:18:27', '2005-08-06T00:28:27', '1'), + ('519', '2422', '2006-02-16T02:30:53', '2005-08-21T03:17:10', '2005-08-24T21:46:10', '1'), + ('519', '3764', '2006-02-16T02:30:53', '2005-08-22T21:12:19', '2005-08-24T20:12:19', '1'), + ('519', '3807', '2006-02-16T02:30:53', '2005-08-19T04:51:47', '2005-08-26T07:50:47', '1'), + ('141', '1106', '2006-02-16T02:30:53', '2005-08-17T20:14:26', '2005-08-26T16:01:26', '1'), + ('141', '839', '2006-02-16T02:30:53', '2005-07-08T09:50:10', '2005-07-13T15:00:10', '1'), + ('141', '2190', '2006-02-16T02:30:53', '2005-07-09T04:36:49', '2005-07-10T06:26:49', '1'), + ('141', '2838', '2006-02-16T02:30:53', '2005-07-07T04:00:20', '2005-07-12T08:14:20', '1'), + ('141', '2271', '2006-02-16T02:30:53', '2005-08-02T19:32:51', '2005-08-11T22:16:51', '1'), + ('141', '2295', '2006-02-16T02:30:53', '2005-06-21T19:08:28', '2005-06-23T14:25:28', '1'), + ('141', '2341', '2006-02-16T02:30:53', '2005-08-19T07:36:42', '2005-08-22T08:50:42', '1'), + ('141', '734', '2006-02-16T02:30:53', '2005-08-21T01:00:46', '2005-08-27T03:46:46', '1'), + ('141', '1060', '2006-02-16T02:30:53', '2005-08-17T22:56:24', '2005-08-24T19:36:24', '1'), + ('141', '4052', '2006-02-16T02:30:53', '2005-07-10T13:17:58', '2005-07-11T11:32:58', '1'), + ('141', '3097', '2006-02-16T02:30:53', '2005-08-20T01:01:16', '2005-08-21T03:19:16', '1'), + ('141', '216', '2006-02-16T02:30:53', '2005-08-17T22:28:40', '2005-08-22T02:05:40', '1'), + ('141', '1564', '2006-02-16T02:30:53', '2005-07-28T10:27:10', '2005-07-29T11:22:10', '1'), + ('141', '1709', '2006-02-16T02:30:53', '2005-08-19T13:43:35', '2005-08-26T09:31:35', '1'), + ('141', '3103', '2006-02-16T02:30:53', '2005-08-01T06:34:29', '2005-08-06T07:49:29', '1'), + ('141', '821', '2006-02-16T02:30:53', '2005-06-15T05:05:07', '2005-06-22T04:57:07', '1'), + ('141', '382', '2006-02-16T02:30:53', '2005-08-01T22:03:10', '2005-08-08T01:34:10', '1'), + ('429', '3954', '2006-02-16T02:30:53', '2005-08-19T06:04:07', '2005-08-28T11:05:07', '1'), + ('429', '2776', '2006-02-16T02:30:53', '2005-05-26T20:08:33', '2005-05-30T00:32:33', '1'), + ('429', '35', '2006-02-16T02:30:53', '2005-07-27T14:38:29', '2005-07-28T14:24:29', '1'), + ('429', '452', '2006-02-16T02:30:53', '2005-07-10T18:39:16', '2005-07-15T21:19:16', '1'), + ('429', '536', '2006-02-16T02:30:53', '2005-05-30T00:58:20', '2005-06-01T00:38:20', '1'), + ('429', '3374', '2006-02-16T02:30:53', '2005-06-21T16:17:38', '2005-06-22T14:16:38', '1'), + ('429', '2230', '2006-02-16T02:30:53', '2005-07-31T12:44:34', '2005-08-02T16:49:34', '1'), + ('429', '3225', '2006-02-16T02:30:53', '2005-05-28T14:08:22', '2005-06-04T10:50:22', '1'), + ('429', '3629', '2006-02-16T02:30:53', '2005-07-28T20:23:11', '2005-08-01T18:17:11', '1'), + ('429', '1713', '2006-02-16T02:30:53', '2005-05-29T17:24:48', '2005-06-05T12:25:48', '1'), + ('573', '65', '2006-02-16T02:30:53', '2005-08-02T06:04:44', '2005-08-06T11:37:44', '1'), + ('573', '3711', '2006-02-16T02:30:53', '2005-07-08T07:22:29', '2005-07-10T08:06:29', '1'), + ('573', '3488', '2006-02-16T02:30:53', '2005-07-31T12:14:19', '2005-08-09T17:08:19', '1'), + ('573', '1388', '2006-02-16T02:30:53', '2005-07-10T20:39:04', '2005-07-11T17:41:04', '1'), + ('573', '2014', '2006-02-16T02:30:53', '2005-07-12T12:37:00', '2005-07-20T09:36:00', '1'), + ('573', '3594', '2006-02-16T02:30:53', '2005-08-19T00:17:09', '2005-08-22T23:46:09', '1'), + ('573', '165', '2006-02-16T02:30:53', '2005-07-06T20:54:07', '2005-07-10T18:31:07', '1'), + ('573', '1958', '2006-02-16T02:30:53', '2005-08-01T04:04:37', '2005-08-01T23:59:37', '1'), + ('573', '1683', '2006-02-16T02:30:53', '2005-07-07T05:25:39', '2005-07-12T04:30:39', '1'), + ('573', '4544', '2006-02-16T02:30:53', '2005-06-20T09:18:22', '2005-06-26T14:31:22', '1'), + ('573', '1609', '2006-02-16T02:30:53', '2005-07-31T16:16:46', '2005-08-02T22:00:46', '1'), + ('573', '2393', '2006-02-16T02:30:53', '2005-08-19T11:27:20', '2005-08-23T12:40:20', '1'), + ('573', '2406', '2006-02-16T02:30:53', '2005-07-08T15:29:46', '2005-07-14T13:31:46', '1'), + ('573', '1703', '2006-02-16T02:30:53', '2005-06-21T07:04:17', '2005-06-29T01:52:17', '1'), + ('573', '62', '2006-02-16T02:30:53', '2005-05-29T21:58:43', '2005-06-06T00:54:43', '1'), + ('573', '744', '2006-02-16T02:30:53', '2005-08-17T15:51:49', '2005-08-24T18:48:49', '1'), + ('573', '724', '2006-02-16T02:30:53', '2005-08-18T04:27:54', '2005-08-25T07:03:54', '1'), + ('573', '3450', '2006-02-16T02:30:53', '2005-08-02T00:52:35', '2005-08-03T05:37:35', '1'), + ('573', '4462', '2006-02-16T02:30:53', '2005-06-16T06:55:10', '2005-06-24T12:08:10', '1'), + ('573', '75', '2006-02-16T02:30:53', '2005-07-09T02:58:41', '2005-07-17T04:09:41', '1'), + ('76', '1207', '2006-02-16T02:30:53', '2005-08-02T10:27:52', '2005-08-11T12:47:52', '1'), + ('76', '892', '2006-02-16T02:30:53', '2005-07-29T04:59:44', '2005-08-01T04:26:44', '1'), + ('76', '2748', '2006-02-16T02:30:53', '2005-08-01T21:56:37', '2005-08-03T01:36:37', '1'), + ('76', '2895', '2006-02-16T02:30:53', '2005-06-18T15:51:25', '2005-06-24T15:52:25', '1'), + ('76', '794', '2006-02-16T02:30:53', '2005-08-22T15:21:56', '2005-08-28T09:40:56', '1'), + ('76', '2388', '2006-02-16T02:30:53', '2005-07-29T00:57:06', '2005-08-07T01:46:06', '1'), + ('76', '1930', '2006-02-16T02:30:53', '2005-07-07T06:20:33', '2005-07-16T08:39:33', '1'), + ('76', '301', '2006-02-16T02:30:53', '2005-06-16T20:04:28', '2005-06-23T22:30:28', '1'), + ('76', '4316', '2006-02-16T02:30:53', '2005-06-20T02:22:42', '2005-06-22T00:38:42', '1'), + ('76', '291', '2006-02-16T02:30:53', '2005-08-20T09:21:08', '2005-08-29T12:33:08', '1'), + ('76', '3883', '2006-02-16T02:30:53', '2005-05-28T10:44:28', '2005-06-04T11:42:28', '1'), + ('358', '2932', '2006-02-16T02:30:53', '2005-07-06T15:16:37', '2005-07-09T14:45:37', '1'), + ('358', '4259', '2006-02-16T02:30:53', '2005-07-11T21:09:31', '2005-07-13T23:08:31', '1'), + ('358', '399', '2006-02-16T02:30:53', '2005-06-17T05:10:36', '2005-06-19T03:52:36', '1'), + ('358', '3206', '2006-02-16T02:30:53', '2005-07-09T02:23:16', '2005-07-15T20:37:16', '1'), + ('358', '4260', '2006-02-16T02:30:53', '2005-08-18T11:14:35', '2005-08-27T09:09:35', '1'), + ('358', '3190', '2006-02-16T02:30:53', '2005-08-19T14:44:03', '2005-08-22T10:11:03', '1'), + ('358', '2780', '2006-02-16T02:30:53', '2005-07-30T07:23:17', '2005-08-02T12:07:17', '1'), + ('358', '2036', '2006-02-16T02:30:53', '2005-08-01T00:33:27', '2005-08-07T20:15:27', '1'), + ('358', '1258', '2006-02-16T02:30:53', '2005-05-30T02:10:32', '2005-06-01T04:42:32', '1'), + ('358', '3541', '2006-02-16T02:30:53', '2005-06-17T20:00:25', '2005-06-23T18:51:25', '1'), + ('60', '2278', '2006-02-16T02:30:53', '2005-05-29T03:05:49', '2005-06-04T22:48:49', '1'), + ('60', '2259', '2006-02-16T02:30:53', '2005-07-27T19:56:31', '2005-07-30T14:28:31', '1'), + ('60', '3980', '2006-02-16T02:30:53', '2005-06-15T21:18:16', '2005-06-16T17:07:16', '1'), + ('60', '4188', '2006-02-16T02:30:53', '2005-07-30T18:36:24', '2005-08-03T14:10:24', '1'), + ('60', '2498', '2006-02-16T02:30:53', '2005-08-01T17:28:05', '2005-08-04T19:34:05', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['7331', '7067', '6282', '3849', '15618', '3473', '15649', '15318', '2394', '14379', '2104', '6585', '12287', '15439', '9319', '10027', '15614', '6397', '7777', '1642', '2286', '15127', '11106', '15076', '8994', '10807', '11716', '4877', '2612', '15084', '1247', '12861', '14204', '11194', '14136', '15908', '13035', '8885', '6817', '6461', '13390', '1272', '11704', '12249', '15425', '9282', '15473', '7774', '14170', '13598', '7188', '10510', '722', '1813', '9205', '13109', '6074', '10781', '14966', '15689', '11184', '4199', '13112', '6539', '13366', '901', '7817', '14631', '7116', '4810', '8067', '7752', '15254', '7269', '10811', '2650', '8816', '10646', '7505', '5170', '8439', '4118', '15952', '12492', '9181', '3282', '15225', '14271', '8255', '2277', '8605', '10055', '9306', '2575', '8275', '3204', '2954', '12323', '13066', '2212']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('60', '2090', '2006-02-16T02:30:53', '2005-07-27T13:57:50', '2005-07-31T08:59:50', '1'), + ('60', '870', '2006-02-16T02:30:53', '2005-07-27T03:55:10', '2005-08-01T02:56:10', '1'), + ('60', '4453', '2006-02-16T02:30:53', '2005-07-11T16:46:22', '2005-07-15T13:19:22', '1'), + ('60', '3660', '2006-02-16T02:30:53', '2005-07-06T16:49:43', '2005-07-12T17:20:43', '1'), + ('60', '1903', '2006-02-16T02:30:53', '2005-08-23T07:07:58', '2005-08-29T03:48:58', '1'), + ('60', '2735', '2006-02-16T02:30:53', '2005-07-05T22:57:34', '2005-07-12T23:53:34', '1'), + ('60', '415', '2006-02-16T02:30:53', '2005-08-23T08:28:03', '2005-08-30T05:11:03', '1'), + ('60', '1738', '2006-02-16T02:30:53', '2005-08-22T20:15:16', '2005-08-25T14:17:16', '1'), + ('60', '2669', '2006-02-16T02:30:53', '2005-06-18T15:42:30', '2005-06-26T16:12:30', '1'), + ('136', '3062', '2006-02-16T02:30:53', '2005-08-21T09:53:03', '2005-08-24T14:32:03', '1'), + ('136', '3084', '2006-02-16T02:30:53', '2005-06-17T19:14:30', '2005-06-19T16:26:30', '1'), + ('136', '2064', '2006-02-16T02:30:53', '2005-07-12T06:50:52', '2005-07-21T06:51:52', '1'), + ('136', '2238', '2006-02-16T02:30:53', '2005-08-18T04:58:06', '2005-08-24T00:06:06', '1'), + ('136', '3848', '2006-02-16T02:30:53', '2005-08-23T00:34:28', '2005-08-27T01:07:28', '1'), + ('136', '4066', '2006-02-16T02:30:53', '2005-07-30T17:15:27', '2005-08-03T14:03:27', '1'), + ('287', '525', '2006-02-16T02:30:53', '2005-07-31T18:33:51', '2005-08-09T18:40:51', '1'), + ('287', '1216', '2006-02-16T02:30:53', '2005-08-23T07:05:15', '2005-09-01T11:41:15', '1'), + ('287', '2423', '2006-02-16T02:30:53', '2005-07-11T22:34:02', '2005-07-13T23:01:02', '1'), + ('287', '4422', '2006-02-16T02:30:53', '2005-07-28T07:04:42', '2005-07-29T01:57:42', '1'), + ('287', '3875', '2006-02-16T02:30:53', '2005-06-16T08:54:15', '2005-06-18T12:36:15', '1'), + ('287', '618', '2006-02-16T02:30:53', '2005-06-18T07:02:32', '2005-06-27T12:33:32', '1'), + ('287', '2397', '2006-02-16T02:30:53', '2005-08-22T12:56:29', '2005-08-26T10:58:29', '1'), + ('287', '2307', '2006-02-16T02:30:53', '2005-08-02T08:17:38', '2005-08-03T07:54:38', '1'), + ('287', '4170', '2006-02-16T02:30:53', '2005-08-22T11:05:34', '2005-08-27T14:40:34', '1'), + ('287', '1527', '2006-02-16T02:30:53', '2005-07-30T04:51:32', '2005-08-07T09:41:32', '1'), + ('287', '1673', '2006-02-16T02:30:53', '2005-08-01T22:26:10', '2005-08-05T21:55:10', '1'), + ('287', '3054', '2006-02-16T02:30:53', '2005-08-17T07:40:55', '2005-08-21T05:56:55', '1'), + ('287', '1846', '2006-02-16T02:30:53', '2005-07-08T19:31:02', '2005-07-15T19:05:02', '1'), + ('287', '1691', '2006-02-16T02:30:53', '2005-06-19T07:19:41', '2005-06-25T11:10:41', '1'), + ('287', '821', '2006-02-16T02:30:53', '2005-08-22T11:17:59', '2005-08-23T09:23:59', '1'), + ('287', '4049', '2006-02-16T02:30:53', '2005-06-15T05:16:40', '2005-06-23T11:01:40', '1'), + ('287', '3115', '2006-02-16T02:30:53', '2005-08-19T02:30:24', '2005-08-22T08:23:24', '1'), + ('287', '4334', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('135', '2732', '2006-02-16T02:30:53', '2005-08-02T11:35:53', '2005-08-10T11:28:53', '1'), + ('135', '268', '2006-02-16T02:30:53', '2005-08-21T01:57:26', '2005-08-28T01:11:26', '1'), + ('135', '2453', '2006-02-16T02:30:53', '2005-08-23T17:42:00', '2005-08-31T22:32:00', '1'), + ('135', '4082', '2006-02-16T02:30:53', '2005-08-19T08:46:45', '2005-08-22T11:42:45', '1'), + ('135', '2984', '2006-02-16T02:30:53', '2005-07-30T00:36:26', '2005-08-06T03:05:26', '1'), + ('135', '184', '2006-02-16T02:30:53', '2005-07-12T18:19:57', '2005-07-19T22:53:57', '1'), + ('135', '1799', '2006-02-16T02:30:53', '2005-07-12T01:14:03', '2005-07-19T21:12:03', '1'), + ('135', '2855', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('135', '3128', '2006-02-16T02:30:53', '2005-06-15T07:42:58', '2005-06-18T12:00:58', '1'), + ('135', '1099', '2006-02-16T02:30:53', '2005-08-17T07:21:22', '2005-08-25T06:06:22', '1'), + ('135', '3586', '2006-02-16T02:30:53', '2005-08-18T03:53:34', '2005-08-21T01:14:34', '1'), + ('259', '551', '2006-02-16T02:30:53', '2005-08-23T00:05:57', '2005-09-01T05:08:57', '1'), + ('259', '736', '2006-02-16T02:30:53', '2005-07-30T15:17:31', '2005-08-07T20:46:31', '1'), + ('259', '356', '2006-02-16T02:30:53', '2005-08-23T01:39:10', '2005-08-25T03:48:10', '1'), + ('259', '3483', '2006-02-16T02:30:53', '2005-07-28T07:03:25', '2005-08-03T02:05:25', '1'), + ('259', '894', '2006-02-16T02:30:53', '2005-08-21T03:00:39', '2005-08-27T23:07:39', '1'), + ('259', '2803', '2006-02-16T02:30:53', '2005-08-20T05:59:17', '2005-08-29T01:02:17', '1'), + ('259', '2199', '2006-02-16T02:30:53', '2005-07-27T08:32:08', '2005-07-28T08:02:08', '1'), + ('259', '410', '2006-02-16T02:30:53', '2005-08-01T11:28:30', '2005-08-07T11:37:30', '1'), + ('259', '4540', '2006-02-16T02:30:53', '2005-05-29T05:30:31', '2005-06-06T04:51:31', '1'), + ('259', '1236', '2006-02-16T02:30:53', '2005-06-16T21:11:00', '2005-06-24T15:30:00', '1'), + ('259', '4165', '2006-02-16T02:30:53', '2005-07-30T12:46:40', '2005-08-08T14:58:40', '1'), + ('259', '46', '2006-02-16T02:30:53', '2005-08-19T11:23:20', '2005-08-25T17:05:20', '1'), + ('259', '2876', '2006-02-16T02:30:53', '2005-07-11T04:59:56', '2005-07-13T23:31:56', '1'), + ('259', '1321', '2006-02-16T02:30:53', '2005-08-01T21:22:41', '2005-08-06T01:02:41', '1'), + ('259', '679', '2006-02-16T02:30:53', '2005-08-22T06:45:57', '2005-08-31T10:02:57', '1'), + ('259', '248', '2006-02-16T02:30:53', '2005-08-23T09:52:55', '2005-08-29T11:15:55', '1'), + ('259', '871', '2006-02-16T02:30:53', '2005-08-02T11:01:26', '2005-08-11T06:29:26', '1'), + ('259', '2120', '2006-02-16T02:30:53', '2005-07-07T11:13:07', '2005-07-11T07:17:07', '1'), + ('259', '2074', '2006-02-16T02:30:53', '2005-08-19T11:27:10', '2005-08-22T05:32:10', '1'), + ('259', '2275', '2006-02-16T02:30:53', '2005-07-12T04:50:49', '2005-07-19T03:23:49', '1'), + ('259', '602', '2006-02-16T02:30:53', '2005-08-19T21:14:45', '2005-08-21T03:06:45', '1'), + ('259', '760', '2006-02-16T02:30:53', '2005-05-30T09:40:40', '2005-06-02T10:32:40', '1'), + ('259', '600', '2006-02-16T02:30:53', '2005-07-28T08:20:55', '2005-07-30T11:55:55', '1'), + ('209', '782', '2006-02-16T02:30:53', '2005-08-21T18:47:49', '2005-08-28T16:54:49', '1'), + ('209', '1755', '2006-02-16T02:30:53', '2005-07-27T05:46:43', '2005-08-05T05:54:43', '1'), + ('209', '4056', '2006-02-16T02:30:53', '2005-07-08T17:04:06', '2005-07-09T13:41:06', '1'), + ('209', '3923', '2006-02-16T02:30:53', '2005-07-28T17:20:17', '2005-07-29T21:55:17', '1'), + ('209', '2218', '2006-02-16T02:30:53', '2005-07-28T06:01:00', '2005-08-03T06:09:00', '1'), + ('209', '3762', '2006-02-16T02:30:53', '2005-08-22T18:13:07', '2005-08-24T21:55:07', '1'), + ('209', '2089', '2006-02-16T02:30:53', '2005-07-27T11:23:47', '2005-07-31T13:10:47', '1'), + ('209', '4012', '2006-02-16T02:30:53', '2005-08-01T22:41:15', '2005-08-10T00:10:15', '1'), + ('209', '4211', '2006-02-16T02:30:53', '2005-06-19T10:21:45', '2005-06-21T08:01:45', '1'), + ('209', '3984', '2006-02-16T02:30:53', '2005-07-29T21:53:00', '2005-08-01T21:20:00', '1'), + ('209', '1752', '2006-02-16T02:30:53', '2005-08-01T15:57:55', '2005-08-02T19:08:55', '1'), + ('209', '1342', '2006-02-16T02:30:53', '2005-07-27T20:28:03', '2005-08-03T17:04:03', '1'), + ('209', '66', '2006-02-16T02:30:53', '2005-07-09T09:24:19', '2005-07-18T04:02:19', '1'), + ('224', '182', '2006-02-16T02:30:53', '2005-07-29T07:28:43', '2005-08-04T11:22:43', '1'), + ('224', '355', '2006-02-16T02:30:53', '2005-07-07T07:03:30', '2005-07-08T09:20:30', '1'), + ('224', '1314', '2006-02-16T02:30:53', '2005-08-23T19:11:29', '2005-08-28T14:41:29', '1'), + ('224', '2839', '2006-02-16T02:30:53', '2005-08-18T12:49:04', '2005-08-26T17:55:04', '1'), + ('224', '3953', '2006-02-16T02:30:53', '2005-07-30T12:05:58', '2005-08-02T06:22:58', '1'), + ('224', '1676', '2006-02-16T02:30:53', '2005-06-21T06:18:42', '2005-06-28T09:18:42', '1'), + ('224', '1646', '2006-02-16T02:30:53', '2005-08-22T17:18:32', '2005-08-24T17:25:32', '1'), + ('224', '4506', '2006-02-16T02:30:53', '2005-08-21T06:23:29', '2005-08-27T04:49:29', '1'), + ('224', '3715', '2006-02-16T02:30:53', '2005-07-29T01:02:30', '2005-08-01T22:39:30', '1'), + ('224', '3770', '2006-02-16T02:30:53', '2005-06-18T06:35:03', '2005-06-19T01:26:03', '1'), + ('224', '3805', '2006-02-16T02:30:53', '2005-07-29T13:13:34', '2005-08-07T08:29:34', '1'), + ('336', '2725', '2006-02-16T02:30:53', '2005-07-31T19:15:58', '2005-08-05T20:23:58', '1'), + ('336', '3983', '2006-02-16T02:30:53', '2005-07-30T16:47:17', '2005-08-02T22:15:17', '1'), + ('336', '354', '2006-02-16T02:30:53', '2005-06-19T04:32:52', '2005-06-24T09:37:52', '1'), + ('336', '4432', '2006-02-16T02:30:53', '2005-07-29T01:35:47', '2005-07-30T02:16:47', '1'), + ('336', '2848', '2006-02-16T02:30:53', '2005-06-21T00:37:50', '2005-06-22T23:46:50', '1'), + ('336', '377', '2006-02-16T02:30:53', '2005-06-20T06:45:00', '2005-06-23T11:43:00', '1'), + ('336', '4107', '2006-02-16T02:30:53', '2005-08-18T06:36:22', '2005-08-26T11:36:22', '1'), + ('336', '3730', '2006-02-16T02:30:53', '2005-08-19T09:50:39', '2005-08-22T14:01:39', '1'), + ('336', '2458', '2006-02-16T02:30:53', '2005-06-18T02:36:10', '2005-06-19T21:21:10', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['4595', '8407', '12794', '15073', '14555', '7614', '5731', '7585', '4946', '13384', '15264', '7806', '9195', '13106', '14373', '15183', '9531', '2858', '2133', '11462', '12007', '4626', '1551', '9436', '5793', '12694', '3670', '2324', '13139', '12014', '10612', '2279', '14469', '14015', '5968', '12010', '3278', '11589', '15690', '817', '12793', '3737', '10109', '10547', '11391', '1221', '1249', '2927', '11460', '517', '8013', '3049', '3356', '2633', '12742', '4555', '10115', '11277', '2662', '14242', '3801', '9642', '3864', '2686', '365', '5131', '15003', '8227', '6269', '9563', '13825', '7608', '8864', '15050', '2381', '3518', '280', '10793', '8110', '7347', '8054', '6532', '6317', '7524', '6350', '11384', '4824', '3135', '5074', '9166', '1084', '9708', '11497', '12604', '10392', '5242', '3870', '2500', '5071', '988']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('336', '760', '2006-02-16T02:30:53', '2005-07-08T06:40:25', '2005-07-14T08:54:25', '1'), + ('336', '2985', '2006-02-16T02:30:53', '2005-07-29T06:37:02', '2005-08-04T03:13:02', '1'), + ('336', '1586', '2006-02-16T02:30:53', '2005-08-19T00:20:37', '2005-08-26T01:48:37', '1'), + ('336', '3970', '2006-02-16T02:30:53', '2005-08-22T11:01:15', '2005-08-31T09:23:15', '1'), + ('440', '1926', '2006-02-16T02:30:53', '2005-08-21T16:03:02', '2005-08-23T14:18:02', '1'), + ('440', '3475', '2006-02-16T02:30:53', '2005-07-28T00:14:38', '2005-07-29T18:18:38', '1'), + ('440', '2960', '2006-02-16T02:30:53', '2005-07-10T11:31:52', '2005-07-14T11:44:52', '1'), + ('440', '467', '2006-02-16T02:30:53', '2005-07-27T23:18:22', '2005-07-30T23:08:22', '1'), + ('440', '272', '2006-02-16T02:30:53', '2005-07-08T22:46:23', '2005-07-16T17:19:23', '1'), + ('440', '1462', '2006-02-16T02:30:53', '2005-08-19T21:38:51', '2005-08-23T17:55:51', '1'), + ('440', '4459', '2006-02-16T02:30:53', '2005-08-22T18:27:38', '2005-08-24T12:39:38', '1'), + ('440', '4317', '2006-02-16T02:30:53', '2005-07-28T07:58:17', '2005-08-06T10:15:17', '1'), + ('440', '944', '2006-02-16T02:30:53', '2005-07-30T12:29:43', '2005-08-04T12:35:43', '1'), + ('440', '3212', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('268', '4433', '2006-02-16T02:30:53', '2005-08-21T09:44:53', '2005-08-25T15:37:53', '1'), + ('268', '2696', '2006-02-16T02:30:53', '2005-08-22T15:49:54', '2005-08-25T12:29:54', '1'), + ('268', '4550', '2006-02-16T02:30:53', '2005-07-31T01:11:53', '2005-08-07T02:49:53', '1'), + ('268', '2628', '2006-02-16T02:30:53', '2005-06-19T23:17:11', '2005-06-21T19:07:11', '1'), + ('268', '932', '2006-02-16T02:30:53', '2005-06-17T21:10:05', '2005-06-23T22:41:05', '1'), + ('268', '167', '2006-02-16T02:30:53', '2005-08-02T21:36:46', '2005-08-10T01:48:46', '1'), + ('268', '3007', '2006-02-16T02:30:53', '2005-08-17T19:10:34', '2005-08-24T14:09:34', '1'), + ('268', '37', '2006-02-16T02:30:53', '2005-07-08T08:18:21', '2005-07-10T11:36:21', '1'), + ('268', '4088', '2006-02-16T02:30:53', '2005-06-16T02:01:15', '2005-06-22T07:33:15', '1'), + ('268', '2329', '2006-02-16T02:30:53', '2005-07-30T21:33:01', '2005-08-06T17:38:01', '1'), + ('268', '2927', '2006-02-16T02:30:53', '2005-07-10T14:33:00', '2005-07-13T19:27:00', '1'), + ('268', '1741', '2006-02-16T02:30:53', '2005-08-18T20:10:39', '2005-08-25T20:47:39', '1'), + ('268', '4271', '2006-02-16T02:30:53', '2005-07-06T08:56:43', '2005-07-11T09:11:43', '1'), + ('268', '2987', '2006-02-16T02:30:53', '2005-06-18T10:00:33', '2005-06-23T14:10:33', '1'), + ('554', '2099', '2006-02-16T02:30:53', '2005-08-19T12:32:10', '2005-08-24T12:12:10', '1'), + ('554', '1778', '2006-02-16T02:30:53', '2005-08-17T19:29:44', '2005-08-23T20:40:44', '1'), + ('554', '287', '2006-02-16T02:30:53', '2005-08-01T14:55:31', '2005-08-06T19:01:31', '1'), + ('554', '1953', '2006-02-16T02:30:53', '2005-06-18T06:38:22', '2005-06-27T07:16:22', '1'), + ('554', '1957', '2006-02-16T02:30:53', '2005-08-21T13:07:24', '2005-08-24T10:37:24', '1'), + ('554', '3145', '2006-02-16T02:30:53', '2005-08-20T20:47:43', '2005-08-26T19:37:43', '1'), + ('554', '3273', '2006-02-16T02:30:53', '2005-07-11T00:03:11', '2005-07-19T18:46:11', '1'), + ('554', '1076', '2006-02-16T02:30:53', '2005-08-17T19:17:54', '2005-08-26T00:41:54', '1'), + ('554', '2832', '2006-02-16T02:30:53', '2005-06-21T05:41:30', '2005-06-22T03:43:30', '1'), + ('554', '3480', '2006-02-16T02:30:53', '2005-08-17T02:28:22', '2005-08-25T00:08:22', '1'), + ('554', '2102', '2006-02-16T02:30:53', '2005-08-23T09:53:30', '2005-08-29T10:27:30', '1'), + ('554', '186', '2006-02-16T02:30:53', '2005-05-29T20:39:14', '2005-05-31T18:24:14', '1'), + ('403', '1195', '2006-02-16T02:30:53', '2005-08-19T00:20:36', '2005-08-28T02:43:36', '1'), + ('403', '123', '2006-02-16T02:30:53', '2005-07-06T11:45:53', '2005-07-13T15:27:53', '1'), + ('403', '2852', '2006-02-16T02:30:53', '2005-07-31T21:04:49', '2005-08-08T19:25:49', '1'), + ('403', '1707', '2006-02-16T02:30:53', '2005-08-01T12:44:17', '2005-08-08T06:53:17', '1'), + ('403', '2039', '2006-02-16T02:30:53', '2005-08-02T18:40:12', '2005-08-10T15:55:12', '1'), + ('403', '2124', '2006-02-16T02:30:53', '2005-06-15T03:35:16', '2005-06-18T03:11:16', '1'), + ('403', '2120', '2006-02-16T02:30:53', '2005-06-15T05:38:09', '2005-06-22T10:29:09', '1'), + ('403', '393', '2006-02-16T02:30:53', '2005-06-20T04:41:41', '2005-06-23T01:59:41', '1'), + ('403', '4113', '2006-02-16T02:30:53', '2005-08-02T21:28:03', '2005-08-08T18:24:03', '1'), + ('403', '234', '2006-02-16T02:30:53', '2005-05-28T03:17:57', '2005-05-29T06:33:57', '1'), + ('403', '2074', '2006-02-16T02:30:53', '2005-07-28T15:30:26', '2005-08-05T16:29:26', '1'), + ('403', '518', '2006-02-16T02:30:53', '2005-06-20T12:51:01', '2005-06-29T10:53:01', '1'), + ('403', '4532', '2006-02-16T02:30:53', '2005-06-21T11:38:45', '2005-06-26T17:18:45', '1'), + ('68', '3462', '2006-02-16T02:30:53', '2005-06-19T08:53:10', '2005-06-20T07:56:10', '1'), + ('68', '1742', '2006-02-16T02:30:53', '2005-08-18T22:22:03', '2005-08-22T04:01:03', '1'), + ('68', '1757', '2006-02-16T02:30:53', '2005-07-08T04:48:36', '2005-07-17T07:57:36', '1'), + ('68', '2731', '2006-02-16T02:30:53', '2005-07-31T21:13:47', '2005-08-10T00:44:47', '1'), + ('68', '2050', '2006-02-16T02:30:53', '2005-08-02T14:28:50', '2005-08-04T13:50:50', '1'), + ('68', '3936', '2006-02-16T02:30:53', '2005-06-19T10:53:42', '2005-06-20T11:41:42', '1'), + ('68', '1588', '2006-02-16T02:30:53', '2005-08-21T05:25:59', '2005-08-27T07:22:59', '1'), + ('68', '4209', '2006-02-16T02:30:53', '2005-07-06T15:05:50', '2005-07-12T12:56:50', '1'), + ('68', '3550', '2006-02-16T02:30:53', '2005-07-31T05:33:57', '2005-08-05T04:54:57', '1'), + ('68', '2811', '2006-02-16T02:30:53', '2005-07-06T17:41:42', '2005-07-08T14:17:42', '1'), + ('68', '2686', '2006-02-16T02:30:53', '2005-06-19T12:44:20', '2005-06-20T16:00:20', '1'), + ('167', '2887', '2006-02-16T02:30:53', '2005-05-27T07:31:20', '2005-06-04T04:46:20', '1'), + ('167', '3179', '2006-02-16T02:30:53', '2005-07-09T07:35:03', '2005-07-10T06:05:03', '1'), + ('167', '4009', '2006-02-16T02:30:53', '2005-08-22T08:11:24', '2005-08-28T08:49:24', '1'), + ('167', '269', '2006-02-16T02:30:53', '2005-07-29T00:02:22', '2005-07-31T04:05:22', '1'), + ('167', '3915', '2006-02-16T02:30:53', '2005-07-11T15:58:43', '2005-07-13T13:25:43', '1'), + ('167', '3858', '2006-02-16T02:30:53', '2005-07-31T02:28:39', '2005-08-05T22:10:39', '1'), + ('167', '2135', '2006-02-16T02:30:53', '2005-08-20T13:43:22', '2005-08-29T19:13:22', '1'), + ('167', '1256', '2006-02-16T02:30:53', '2005-07-28T00:08:36', '2005-07-28T18:13:36', '1'), + ('167', '2321', '2006-02-16T02:30:53', '2005-07-29T23:52:12', '2005-07-30T22:12:12', '1'), + ('167', '3961', '2006-02-16T02:30:53', '2005-08-22T10:07:52', '2005-08-23T04:45:52', '1'), + ('167', '1491', '2006-02-16T02:30:53', '2005-06-18T15:00:30', '2005-06-22T11:38:30', '1'), + ('167', '2502', '2006-02-16T02:30:53', '2005-07-06T00:56:03', '2005-07-14T02:27:03', '1'), + ('167', '1896', '2006-02-16T02:30:53', '2005-05-26T18:36:58', '2005-05-27T23:42:58', '1'), + ('225', '3018', '2006-02-16T02:30:53', '2005-08-01T21:48:03', '2005-08-10T19:16:03', '1'), + ('225', '1244', '2006-02-16T02:30:53', '2005-07-28T19:07:45', '2005-08-04T22:12:45', '1'), + ('225', '3779', '2006-02-16T02:30:53', '2005-07-27T14:31:24', '2005-07-31T16:19:24', '1'), + ('225', '1062', '2006-02-16T02:30:53', '2005-07-28T17:02:18', '2005-08-06T11:55:18', '1'), + ('225', '2361', '2006-02-16T02:30:53', '2005-07-12T04:38:32', '2005-07-13T03:54:32', '1'), + ('225', '4206', '2006-02-16T02:30:53', '2005-07-11T18:47:41', '2005-07-14T18:18:41', '1'), + ('225', '4295', '2006-02-16T02:30:53', '2005-07-27T21:11:44', '2005-08-03T02:17:44', '1'), + ('225', '2853', '2006-02-16T02:30:53', '2005-07-11T20:30:15', '2005-07-16T21:30:15', '1'), + ('225', '2840', '2006-02-16T02:30:53', '2005-08-02T18:23:01', '2005-08-05T17:59:01', '1'), + ('225', '1855', '2006-02-16T02:30:53', '2005-07-08T17:37:39', '2005-07-16T18:27:39', '1'), + ('12', '1122', '2006-02-16T02:30:53', '2005-06-20T19:33:52', '2005-06-29T18:20:52', '1'), + ('12', '1379', '2006-02-16T02:30:53', '2005-07-09T05:06:24', '2005-07-12T04:37:24', '1'), + ('12', '308', '2006-02-16T02:30:53', '2005-07-30T11:26:28', '2005-08-04T12:32:28', '1'), + ('12', '4577', '2006-02-16T02:30:53', '2005-05-31T11:10:17', '2005-06-01T11:15:17', '1'), + ('12', '3264', '2006-02-16T02:30:53', '2005-07-31T07:45:33', '2005-08-08T08:56:33', '1'), + ('12', '436', '2006-02-16T02:30:53', '2005-08-16T22:52:30', '2005-08-21T19:52:30', '1'), + ('12', '4127', '2006-02-16T02:30:53', '2005-08-18T16:58:48', '2005-08-19T19:36:48', '1'), + ('12', '3017', '2006-02-16T02:30:53', '2005-08-01T06:50:26', '2005-08-10T10:52:26', '1'), + ('12', '848', '2006-02-16T02:30:53', '2005-07-09T13:20:25', '2005-07-18T07:38:25', '1'), + ('12', '3357', '2006-02-16T02:30:53', '2005-07-06T17:57:54', '2005-07-13T12:30:54', '1'), + ('12', '4241', '2006-02-16T02:30:53', '2005-06-18T23:07:12', '2005-06-26T17:27:12', '1'), + ('12', '4358', '2006-02-16T02:30:53', '2005-07-09T05:00:39', '2005-07-09T23:08:39', '1'), + ('12', '1364', '2006-02-16T02:30:53', '2005-05-30T23:08:03', '2005-06-07T00:22:03', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['3633', '13516', '4000', '7471', '10130', '3426', '9951', '8051', '9831', '7147', '14692', '15855', '14404', '2760', '895', '11385', '13125', '8292', '10238', '6223', '3829', '7079', '9037', '4599', '9883', '11579', '2405', '12913', '15757', '6648', '1410', '6535', '7089', '2710', '12253', '5393', '14', '4358', '5409', '236', '3168', '6510', '15951', '12480', '2520', '6454', '8309', '6734', '700', '14854', '15432', '1755', '12575', '8687', '12618', '6093', '12337', '11467', '1114', '14784', '10558', '3218', '6449', '11141', '2486', '14872', '15897', '8615', '8927', '5975', '13503', '2937', '5717', '12272', '13541', '13339', '9377', '3491', '10200', '7449', '14887', '8268', '931', '15710', '3703', '14742', '11523', '11089', '2160', '4771', '1067', '2891', '4434', '8453', '2624', '6122', '7793', '483', '8914', '7589']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('95', '2978', '2006-02-16T02:30:53', '2005-07-06T06:43:26', '2005-07-10T04:54:26', '1'), + ('95', '4286', '2006-02-16T02:30:53', '2005-08-20T02:32:45', '2005-08-27T04:38:45', '1'), + ('95', '2122', '2006-02-16T02:30:53', '2005-07-06T23:58:37', '2005-07-08T21:43:37', '1'), + ('95', '1776', '2006-02-16T02:30:53', '2005-07-27T19:02:19', '2005-07-30T15:12:19', '1'), + ('95', '3964', '2006-02-16T02:30:53', '2005-07-31T21:44:30', '2005-08-04T17:06:30', '1'), + ('95', '3019', '2006-02-16T02:30:53', '2005-06-21T18:12:10', '2005-06-23T18:22:10', '1'), + ('95', '4412', '2006-02-16T02:30:53', '2005-07-31T15:51:16', '2005-08-03T14:54:16', '1'), + ('192', '4405', '2006-02-16T02:30:53', '2005-07-28T16:56:16', '2005-07-29T22:48:16', '1'), + ('192', '1961', '2006-02-16T02:30:53', '2005-07-31T11:59:32', '2005-08-04T07:14:32', '1'), + ('192', '990', '2006-02-16T02:30:53', '2005-07-27T07:02:34', '2005-08-01T02:16:34', '1'), + ('192', '1908', '2006-02-16T02:30:53', '2005-08-21T20:43:21', '2005-08-28T19:02:21', '1'), + ('192', '2528', '2006-02-16T02:30:53', '2005-08-23T15:59:01', '2005-08-29T20:26:01', '1'), + ('192', '3660', '2006-02-16T02:30:53', '2005-08-21T10:43:04', '2005-08-30T10:00:04', '1'), + ('192', '2602', '2006-02-16T02:30:53', '2005-06-19T17:16:33', '2005-06-26T14:58:33', '1'), + ('192', '2744', '2006-02-16T02:30:53', '2005-05-30T08:50:43', '2005-06-05T10:58:43', '1'), + ('192', '2478', '2006-02-16T02:30:53', '2005-08-02T18:23:11', '2005-08-06T12:37:11', '1'), + ('192', '3722', '2006-02-16T02:30:53', '2005-08-19T11:57:49', '2005-08-26T07:53:49', '1'), + ('192', '4003', '2006-02-16T02:30:53', '2005-07-29T02:29:36', '2005-08-07T08:06:36', '1'), + ('192', '561', '2006-02-16T02:30:53', '2005-08-01T02:08:05', '2005-08-02T01:52:05', '1'), + ('192', '3754', '2006-02-16T02:30:53', '2005-07-11T13:27:09', '2005-07-12T14:02:09', '1'), + ('356', '4126', '2006-02-16T02:30:53', '2005-07-06T15:59:40', '2005-07-11T10:29:40', '1'), + ('356', '4356', '2006-02-16T02:30:53', '2005-07-27T04:21:58', '2005-08-04T08:08:58', '1'), + ('356', '3833', '2006-02-16T02:30:53', '2005-07-30T06:23:14', '2005-08-08T06:25:14', '1'), + ('356', '2098', '2006-02-16T02:30:53', '2005-07-08T06:48:26', '2005-07-11T07:06:26', '1'), + ('356', '4286', '2006-02-16T02:30:53', '2005-07-31T13:53:37', '2005-08-06T15:45:37', '1'), + ('356', '4256', '2006-02-16T02:30:53', '2005-08-17T01:57:49', '2005-08-22T02:42:49', '1'), + ('356', '3604', '2006-02-16T02:30:53', '2005-06-18T16:36:38', '2005-06-21T19:15:38', '1'), + ('356', '3719', '2006-02-16T02:30:53', '2005-08-19T04:25:39', '2005-08-25T07:23:39', '1'), + ('356', '1308', '2006-02-16T02:30:53', '2005-08-23T12:47:16', '2005-08-29T17:19:16', '1'), + ('356', '718', '2006-02-16T02:30:53', '2005-07-12T10:46:30', '2005-07-14T16:15:30', '1'), + ('356', '809', '2006-02-16T02:30:53', '2005-06-15T16:59:46', '2005-06-21T16:38:46', '1'), + ('446', '1921', '2006-02-16T02:30:53', '2005-07-12T04:43:43', '2005-07-17T04:52:43', '1'), + ('446', '1380', '2006-02-16T02:30:53', '2005-07-27T04:43:42', '2005-07-30T10:04:42', '1'), + ('446', '2965', '2006-02-16T02:30:53', '2005-06-19T14:03:56', '2005-06-21T16:15:56', '1'), + ('446', '566', '2006-02-16T02:30:53', '2005-08-18T04:00:50', '2005-08-19T04:43:50', '1'), + ('446', '1417', '2006-02-16T02:30:53', '2005-07-09T19:35:12', '2005-07-11T14:00:12', '1'), + ('446', '2701', '2006-02-16T02:30:53', '2005-05-25T00:31:15', '2005-05-26T02:56:15', '1'), + ('446', '3136', '2006-02-16T02:30:53', '2005-07-07T19:27:04', '2005-07-14T23:46:04', '1'), + ('446', '3538', '2006-02-16T02:30:53', '2005-07-09T20:17:19', '2005-07-13T23:30:19', '1'), + ('446', '1265', '2006-02-16T02:30:53', '2005-05-26T11:53:49', '2005-05-28T13:55:49', '1'), + ('446', '2407', '2006-02-16T02:30:53', '2005-06-20T21:46:01', '2005-06-22T20:40:01', '1'), + ('446', '905', '2006-02-16T02:30:53', '2005-07-12T03:35:39', '2005-07-21T01:41:39', '1'), + ('446', '3018', '2006-02-16T02:30:53', '2005-08-23T19:10:32', '2005-08-29T14:17:32', '1'), + ('446', '3339', '2006-02-16T02:30:53', '2005-08-18T12:26:43', '2005-08-26T13:23:43', '1'), + ('446', '4181', '2006-02-16T02:30:53', '2005-06-19T00:29:00', '2005-06-28T04:36:00', '1'), + ('446', '4028', '2006-02-16T02:30:53', '2005-07-12T01:00:12', '2005-07-16T22:12:12', '1'), + ('446', '2250', '2006-02-16T02:30:53', '2005-07-29T03:22:20', '2005-08-01T06:30:20', '1'), + ('446', '2248', '2006-02-16T02:30:53', '2005-07-12T14:04:24', '2005-07-21T19:47:24', '1'), + ('117', '500', '2006-02-16T02:30:53', '2005-05-29T02:18:54', '2005-05-30T05:54:54', '1'), + ('117', '1989', '2006-02-16T02:30:53', '2005-08-22T02:26:47', '2005-08-23T05:53:47', '1'), + ('117', '1896', '2006-02-16T02:30:53', '2005-08-23T00:26:52', '2005-08-27T06:11:52', '1'), + ('117', '1721', '2006-02-16T02:30:53', '2005-06-16T17:18:44', '2005-06-17T16:54:44', '1'), + ('117', '3441', '2006-02-16T02:30:53', '2005-08-18T15:37:42', '2005-08-25T19:17:42', '1'), + ('117', '222', '2006-02-16T02:30:53', '2005-07-29T16:19:17', '2005-08-01T15:28:17', '1'), + ('117', '302', '2006-02-16T02:30:53', '2005-08-18T17:24:02', '2005-08-19T15:22:02', '1'), + ('117', '1868', '2006-02-16T02:30:53', '2005-07-11T05:52:50', '2005-07-20T11:45:50', '1'), + ('117', '4221', '2006-02-16T02:30:53', '2005-08-18T07:02:24', '2005-08-20T10:11:24', '1'), + ('117', '246', '2006-02-16T02:30:53', '2005-08-02T21:47:07', '2005-08-09T00:50:07', '1'), + ('117', '2287', '2006-02-16T02:30:53', '2005-05-31T16:00:33', '2005-06-01T19:05:33', '1'), + ('117', '441', '2006-02-16T02:30:53', '2005-08-22T00:23:13', '2005-08-28T03:42:13', '1'), + ('117', '4399', '2006-02-16T02:30:53', '2005-08-01T13:00:20', '2005-08-05T16:31:20', '1'), + ('117', '1828', '2006-02-16T02:30:53', '2005-06-21T01:38:09', '2005-06-23T02:00:09', '1'), + ('117', '4395', '2006-02-16T02:30:53', '2005-07-12T00:48:58', '2005-07-21T02:57:58', '1'), + ('15', '1614', '2006-02-16T02:30:53', '2005-08-02T09:29:11', '2005-08-04T07:50:11', '1'), + ('15', '268', '2006-02-16T02:30:53', '2005-06-18T21:26:56', '2005-06-22T23:42:56', '1'), + ('15', '962', '2006-02-16T02:30:53', '2005-08-22T03:23:41', '2005-08-29T23:25:41', '1'), + ('15', '1652', '2006-02-16T02:30:53', '2005-08-23T17:12:31', '2005-08-30T17:22:31', '1'), + ('15', '4453', '2006-02-16T02:30:53', '2005-07-29T13:36:01', '2005-08-03T13:15:01', '1'), + ('15', '272', '2006-02-16T02:30:53', '2005-07-30T02:13:31', '2005-08-01T01:34:31', '1'), + ('15', '2997', '2006-02-16T02:30:53', '2005-07-11T00:14:19', '2005-07-16T04:21:19', '1'), + ('15', '453', '2006-02-16T02:30:53', '2005-08-20T02:00:33', '2005-08-28T21:03:33', '1'), + ('15', '1998', '2006-02-16T02:30:53', '2005-06-20T05:15:37', '2005-06-27T02:45:37', '1'), + ('15', '529', '2006-02-16T02:30:53', '2005-07-10T11:02:03', '2005-07-13T13:00:03', '1'), + ('15', '1964', '2006-02-16T02:30:53', '2005-08-18T04:39:10', '2005-08-24T09:41:10', '1'), + ('15', '1363', '2006-02-16T02:30:53', '2005-08-20T03:41:41', '2005-08-24T23:14:41', '1'), + ('15', '1428', '2006-02-16T02:30:53', '2005-08-19T20:18:36', '2005-08-28T21:34:36', '1'), + ('421', '4164', '2006-02-16T02:30:53', '2005-07-30T19:12:18', '2005-08-05T19:38:18', '1'), + ('421', '1835', '2006-02-16T02:30:53', '2005-07-05T23:41:08', '2005-07-13T21:53:08', '1'), + ('421', '580', '2006-02-16T02:30:53', '2005-08-01T00:39:05', '2005-08-05T01:07:05', '1'), + ('421', '2084', '2006-02-16T02:30:53', '2005-07-27T18:17:41', '2005-08-01T18:52:41', '1'), + ('421', '56', '2006-02-16T02:30:53', '2005-08-22T04:04:31', '2005-08-31T02:30:31', '1'), + ('421', '4239', '2006-02-16T02:30:53', '2005-07-29T01:23:23', '2005-08-05T01:36:23', '1'), + ('421', '3384', '2006-02-16T02:30:53', '2005-05-30T12:53:01', '2005-05-31T14:28:01', '1'), + ('421', '1020', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('421', '4276', '2006-02-16T02:30:53', '2005-07-06T10:15:26', '2005-07-13T13:00:26', '1'), + ('421', '2988', '2006-02-16T02:30:53', '2005-08-21T22:39:01', '2005-08-26T00:17:01', '1'), + ('421', '1329', '2006-02-16T02:30:53', '2005-08-17T00:10:10', '2005-08-24T22:39:10', '1'), + ('421', '825', '2006-02-16T02:30:53', '2005-08-02T07:52:20', '2005-08-07T07:24:20', '1'), + ('32', '1644', '2006-02-16T02:30:53', '2005-06-17T23:39:11', '2005-06-22T20:04:11', '1'), + ('32', '1060', '2006-02-16T02:30:53', '2005-07-08T15:33:32', '2005-07-10T12:38:32', '1'), + ('32', '2345', '2006-02-16T02:30:53', '2005-05-31T09:12:13', '2005-06-01T06:15:13', '1'), + ('32', '343', '2006-02-16T02:30:53', '2005-06-20T02:02:05', '2005-06-25T02:45:05', '1'), + ('32', '1801', '2006-02-16T02:30:53', '2005-07-07T22:48:34', '2005-07-09T18:55:34', '1'), + ('32', '2907', '2006-02-16T02:30:53', '2005-07-29T07:46:29', '2005-07-30T07:07:29', '1'), + ('32', '3071', '2006-02-16T02:30:53', '2005-06-19T08:22:09', '2005-06-27T11:13:09', '1'), + ('32', '2212', '2006-02-16T02:30:53', '2005-07-11T07:58:07', '2005-07-16T09:52:07', '1'), + ('32', '24', '2006-02-16T02:30:53', '2005-07-28T07:26:14', '2005-08-03T07:45:14', '1'), + ('32', '1510', '2006-02-16T02:30:53', '2005-05-27T23:00:25', '2005-05-28T21:30:25', '1'), + ('32', '1347', '2006-02-16T02:30:53', '2005-07-30T01:42:03', '2005-08-04T03:53:03', '1'), + ('32', '1569', '2006-02-16T02:30:53', '2005-07-27T23:23:36', '2005-08-04T00:16:36', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['13736', '4899', '11831', '13499', '1111', '15811', '12644', '3177', '780', '9791', '14674', '15695', '9127', '14709', '6822', '13257', '5562', '8210', '9078', '15051', '8117', '3775', '13797', '13011', '4045', '13946', '8708', '1234', '453', '4553', '12356', '11862', '9375', '5993', '14970', '7128', '12622', '1686', '9310', '10102', '13081', '12706', '4113', '5685', '10481', '5075', '14022', '504', '15549', '211', '9517', '3749', '1656', '6208', '12085', '3701', '15682', '4122', '1838', '2438', '2530', '15816', '6580', '3205', '8997', '3117', '1610', '10796', '14816', '14526', '11180', '7113', '304', '1673', '940', '7662', '13294', '4491', '40', '13010', '3762', '13824', '7731', '8699', '15787', '12360', '7768', '7852', '7969', '7535', '15152', '15621', '10295', '992', '6403', '4143', '3181', '15455', '315', '842']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('32', '3369', '2006-02-16T02:30:53', '2005-08-20T10:31:23', '2005-08-28T06:51:23', '1'), + ('32', '414', '2006-02-16T02:30:53', '2005-07-08T20:37:11', '2005-07-10T21:53:11', '1'), + ('32', '4562', '2006-02-16T02:30:53', '2005-08-17T12:54:47', '2005-08-21T11:21:47', '1'), + ('300', '1893', '2006-02-16T02:30:53', '2005-08-20T01:52:30', '2005-08-28T04:57:30', '1'), + ('300', '1137', '2006-02-16T02:30:53', '2005-05-31T15:24:19', '2005-06-08T21:18:19', '1'), + ('300', '3487', '2006-02-16T02:30:53', '2005-08-23T14:43:46', '2005-08-27T16:43:46', '1'), + ('300', '1511', '2006-02-16T02:30:53', '2005-08-18T18:22:27', '2005-08-26T00:01:27', '1'), + ('300', '2546', '2006-02-16T02:30:53', '2005-06-20T22:32:44', '2005-06-22T23:01:44', '1'), + ('300', '1919', '2006-02-16T02:30:53', '2005-05-29T14:18:32', '2005-06-06T20:14:32', '1'), + ('300', '3642', '2006-02-16T02:30:53', '2005-07-31T10:35:22', '2005-08-03T05:34:22', '1'), + ('300', '572', '2006-02-16T02:30:53', '2005-08-21T20:01:34', '2005-08-27T18:33:34', '1'), + ('300', '2954', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('300', '4114', '2006-02-16T02:30:53', '2005-07-30T09:46:36', '2005-07-31T07:43:36', '1'), + ('300', '1856', '2006-02-16T02:30:53', '2005-08-21T21:07:59', '2005-08-31T02:19:59', '1'), + ('300', '1592', '2006-02-16T02:30:53', '2005-07-12T18:23:39', '2005-07-19T21:06:39', '1'), + ('300', '164', '2006-02-16T02:30:53', '2005-08-19T17:01:20', '2005-08-24T17:26:20', '1'), + ('300', '3604', '2006-02-16T02:30:53', '2005-07-10T03:17:42', '2005-07-12T03:26:42', '1'), + ('300', '3424', '2006-02-16T02:30:53', '2005-07-28T23:31:05', '2005-08-06T17:36:05', '1'), + ('300', '955', '2006-02-16T02:30:53', '2005-07-30T08:01:00', '2005-07-31T10:39:00', '1'), + ('300', '1419', '2006-02-16T02:30:53', '2005-08-22T10:08:50', '2005-08-28T10:23:50', '1'), + ('300', '1502', '2006-02-16T02:30:53', '2005-07-28T19:20:16', '2005-08-05T23:55:16', '1'), + ('300', '3696', '2006-02-16T02:30:53', '2005-07-06T13:27:33', '2005-07-09T10:27:33', '1'), + ('529', '2857', '2006-02-16T02:30:53', '2005-08-20T12:33:36', '2005-08-25T18:03:36', '1'), + ('529', '1998', '2006-02-16T02:30:53', '2005-08-19T07:53:58', '2005-08-24T12:00:58', '1'), + ('529', '1422', '2006-02-16T02:30:53', '2005-07-07T03:26:14', '2005-07-11T06:52:14', '1'), + ('529', '3564', '2006-02-16T02:30:53', '2005-08-20T17:44:32', '2005-08-28T19:19:32', '1'), + ('529', '4054', '2006-02-16T02:30:53', '2005-07-29T17:24:13', '2005-08-04T13:57:13', '1'), + ('529', '709', '2006-02-16T02:30:53', '2005-06-15T04:21:52', '2005-06-22T03:25:52', '1'), + ('529', '4425', '2006-02-16T02:30:53', '2005-05-27T19:31:16', '2005-05-29T23:06:16', '1'), + ('529', '2114', '2006-02-16T02:30:53', '2005-07-08T04:43:41', '2005-07-09T23:55:41', '1'), + ('529', '493', '2006-02-16T02:30:53', '2005-08-18T07:37:05', '2005-08-24T10:49:05', '1'), + ('529', '2604', '2006-02-16T02:30:53', '2005-08-17T13:54:53', '2005-08-19T10:48:53', '1'), + ('529', '3063', '2006-02-16T02:30:53', '2005-07-30T19:10:17', '2005-08-02T23:00:17', '1'), + ('529', '3588', '2006-02-16T02:30:53', '2005-07-11T01:06:41', '2005-07-14T19:19:41', '1'), + ('529', '536', '2006-02-16T02:30:53', '2005-08-22T06:49:29', '2005-08-29T08:47:29', '1'), + ('529', '143', '2006-02-16T02:30:53', '2005-07-27T06:14:36', '2005-08-02T05:18:36', '1'), + ('529', '278', '2006-02-16T02:30:53', '2005-08-18T17:34:11', '2005-08-24T16:10:11', '1'), + ('529', '3883', '2006-02-16T02:30:53', '2005-06-16T12:08:20', '2005-06-20T10:59:20', '1'), + ('529', '2957', '2006-02-16T02:30:53', '2005-07-30T16:57:09', '2005-08-03T18:14:09', '1'), + ('170', '4078', '2006-02-16T02:30:53', '2005-07-31T20:49:10', '2005-08-08T20:15:10', '1'), + ('170', '3077', '2006-02-16T02:30:53', '2005-08-19T10:19:06', '2005-08-20T05:49:06', '1'), + ('170', '1079', '2006-02-16T02:30:53', '2005-08-18T20:44:34', '2005-08-26T21:47:34', '1'), + ('170', '915', '2006-02-16T02:30:53', '2005-07-07T06:49:52', '2005-07-12T04:00:52', '1'), + ('170', '1462', '2006-02-16T02:30:53', '2005-07-10T09:01:38', '2005-07-17T10:58:38', '1'), + ('170', '229', '2006-02-16T02:30:53', '2005-08-01T10:17:26', '2005-08-09T08:50:26', '1'), + ('170', '903', '2006-02-16T02:30:53', '2005-07-09T05:12:07', '2005-07-12T08:29:07', '1'), + ('170', '4068', '2006-02-16T02:30:53', '2005-08-20T21:08:49', '2005-08-29T21:57:49', '1'), + ('170', '2086', '2006-02-16T02:30:53', '2005-05-28T02:05:34', '2005-05-30T23:03:34', '1'), + ('170', '369', '2006-02-16T02:30:53', '2005-08-23T04:27:06', '2005-09-01T06:07:06', '1'), + ('170', '4005', '2006-02-16T02:30:53', '2005-05-26T08:33:10', '2005-05-28T14:09:10', '1'), + ('170', '3299', '2006-02-16T02:30:53', '2005-07-31T00:41:23', '2005-08-02T23:08:23', '1'), + ('170', '1531', '2006-02-16T02:30:53', '2005-07-06T12:18:03', '2005-07-11T07:25:03', '1'), + ('31', '2253', '2006-02-16T02:30:53', '2005-06-16T10:05:40', '2005-06-22T06:26:40', '1'), + ('31', '672', '2006-02-16T02:30:53', '2005-07-11T12:34:56', '2005-07-19T15:17:56', '1'), + ('31', '600', '2006-02-16T02:30:53', '2005-08-17T22:17:09', '2005-08-21T01:45:09', '1'), + ('31', '3679', '2006-02-16T02:30:53', '2005-07-06T10:12:45', '2005-07-09T08:52:45', '1'), + ('31', '3293', '2006-02-16T02:30:53', '2005-08-23T09:37:34', '2005-08-31T06:01:34', '1'), + ('31', '273', '2006-02-16T02:30:53', '2005-07-07T07:15:35', '2005-07-14T12:10:35', '1'), + ('31', '513', '2006-02-16T02:30:53', '2005-06-16T23:20:16', '2005-06-20T02:34:16', '1'), + ('31', '184', '2006-02-16T02:30:53', '2005-06-18T18:34:21', '2005-06-19T16:50:21', '1'), + ('31', '4166', '2006-02-16T02:30:53', '2005-06-19T01:20:00', '2005-06-23T04:10:00', '1'), + ('31', '3628', '2006-02-16T02:30:53', '2005-08-23T14:58:06', '2005-08-28T13:30:06', '1'), + ('31', '1543', '2006-02-16T02:30:53', '2005-07-12T06:26:10', '2005-07-13T06:44:10', '1'), + ('31', '2964', '2006-02-16T02:30:53', '2005-06-21T00:38:47', '2005-06-21T22:49:47', '1'), + ('31', '850', '2006-02-16T02:30:53', '2005-07-30T04:53:56', '2005-08-03T07:10:56', '1'), + ('31', '2184', '2006-02-16T02:30:53', '2005-06-20T18:05:15', '2005-06-26T17:28:15', '1'), + ('534', '3551', '2006-02-16T02:30:53', '2005-06-16T06:36:33', '2005-06-19T07:12:33', '1'), + ('534', '2113', '2006-02-16T02:30:53', '2005-08-01T21:56:41', '2005-08-05T01:09:41', '1'), + ('534', '4086', '2006-02-16T02:30:53', '2005-08-22T01:15:51', '2005-08-28T04:11:51', '1'), + ('534', '1799', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('534', '3632', '2006-02-16T02:30:53', '2005-08-02T10:54:30', '2005-08-11T15:55:30', '1'), + ('534', '1963', '2006-02-16T02:30:53', '2005-07-27T05:41:20', '2005-07-30T04:50:20', '1'), + ('534', '1701', '2006-02-16T02:30:53', '2005-05-26T21:21:28', '2005-06-02T00:05:28', '1'), + ('534', '907', '2006-02-16T02:30:53', '2005-06-16T10:40:17', '2005-06-18T16:13:17', '1'), + ('534', '1278', '2006-02-16T02:30:53', '2005-05-30T15:01:02', '2005-06-01T18:26:02', '1'), + ('534', '1017', '2006-02-16T02:30:53', '2005-07-28T02:16:08', '2005-08-03T21:51:08', '1'), + ('534', '156', '2006-02-16T02:30:53', '2005-08-19T18:36:35', '2005-08-20T13:57:35', '1'), + ('413', '1168', '2006-02-16T02:30:53', '2005-07-08T01:30:46', '2005-07-11T03:12:46', '1'), + ('413', '2638', '2006-02-16T02:30:53', '2005-05-25T05:09:04', '2005-05-27T23:12:04', '1'), + ('413', '825', '2006-02-16T02:30:53', '2005-08-19T07:52:21', '2005-08-27T12:51:21', '1'), + ('413', '1941', '2006-02-16T02:30:53', '2005-07-06T12:52:49', '2005-07-12T11:41:49', '1'), + ('413', '2845', '2006-02-16T02:30:53', '2005-08-20T13:43:12', '2005-08-22T17:26:12', '1'), + ('413', '1533', '2006-02-16T02:30:53', '2005-07-28T05:01:18', '2005-07-29T02:22:18', '1'), + ('123', '4080', '2006-02-16T02:30:53', '2005-07-29T16:53:00', '2005-08-07T20:31:00', '1'), + ('123', '2932', '2006-02-16T02:30:53', '2005-08-23T13:51:57', '2005-08-27T17:06:57', '1'), + ('123', '929', '2006-02-16T02:30:53', '2005-08-18T07:46:35', '2005-08-26T12:01:35', '1'), + ('123', '2450', '2006-02-16T02:30:53', '2005-07-28T06:44:03', '2005-07-29T09:46:03', '1'), + ('123', '3462', '2006-02-16T02:30:53', '2005-07-28T09:34:29', '2005-07-30T05:48:29', '1'), + ('123', '2224', '2006-02-16T02:30:53', '2005-07-28T13:57:37', '2005-08-04T19:31:37', '1'), + ('123', '772', '2006-02-16T02:30:53', '2005-07-27T21:32:39', '2005-08-05T23:42:39', '1'), + ('123', '739', '2006-02-16T02:30:53', '2005-08-22T14:25:21', '2005-08-31T14:28:21', '1'), + ('123', '3832', '2006-02-16T02:30:53', '2005-08-23T07:13:43', '2005-08-29T08:19:43', '1'), + ('123', '2355', '2006-02-16T02:30:53', '2005-08-01T03:53:49', '2005-08-10T03:56:49', '1'), + ('123', '3572', '2006-02-16T02:30:53', '2005-05-30T23:47:56', '2005-06-05T19:01:56', '1'), + ('238', '1019', '2006-02-16T02:30:53', '2005-07-11T22:46:25', '2005-07-13T22:15:25', '1'), + ('238', '597', '2006-02-16T02:30:53', '2005-07-07T08:22:07', '2005-07-13T11:42:07', '1'), + ('238', '3473', '2006-02-16T02:30:53', '2005-06-20T22:51:02', '2005-06-27T21:21:02', '1'), + ('238', '3991', '2006-02-16T02:30:53', '2005-08-23T01:05:00', '2005-08-26T22:56:00', '1'), + ('238', '2847', '2006-02-16T02:30:53', '2005-05-26T23:12:55', '2005-05-29T23:33:55', '1'), + ('238', '2328', '2006-02-16T02:30:53', '2005-05-30T00:32:04', '2005-06-01T02:21:04', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['14343', '8382', '14312', '11632', '9841', '5878', '5922', '6024', '7618', '12219', '1096', '4545', '15260', '8406', '13486', '13129', '474', '10059', '15328', '892', '13549', '4582', '11363', '11058', '12321', '3291', '10855', '208', '2098', '9331', '4148', '1154', '5207', '4891', '14135', '5195', '2921', '15744', '8643', '5830', '13282', '13573', '12833', '1728', '4384', '12801', '5838', '11924', '5297', '4567', '8779', '13528', '13432', '13792', '4227', '7957', '9068', '5604', '7747', '10350', '12653', '10590', '12474', '7926', '12697', '10320', '359', '745', '11848', '4974', '12960', '3786', '14173', '13204', '2882', '6612', '11620', '6414', '7884', '12762', '16034', '11435', '7757', '861', '2911', '5662', '2420', '11317', '6828', '10938', '4142', '5609', '1691', '4128', '5325', '4258', '7203', '15822', '14255', '1956']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('238', '3769', '2006-02-16T02:30:53', '2005-08-21T08:40:21', '2005-08-29T03:06:21', '1'), + ('238', '317', '2006-02-16T02:30:53', '2005-07-29T05:33:21', '2005-08-03T03:38:21', '1'), + ('238', '1090', '2006-02-16T02:30:53', '2005-08-21T07:48:34', '2005-08-23T04:45:34', '1'), + ('238', '2551', '2006-02-16T02:30:53', '2005-08-17T04:29:32', '2005-08-22T03:44:32', '1'), + ('238', '4554', '2006-02-16T02:30:53', '2005-07-31T12:24:19', '2005-08-09T15:31:19', '1'), + ('271', '3805', '2006-02-16T02:30:53', '2005-07-10T19:09:57', '2005-07-16T17:22:57', '1'), + ('271', '1392', '2006-02-16T02:30:53', '2005-07-10T21:36:53', '2005-07-16T02:51:53', '1'), + ('271', '2923', '2006-02-16T02:30:53', '2005-07-11T02:16:47', '2005-07-12T05:54:47', '1'), + ('271', '774', '2006-02-16T02:30:53', '2005-07-28T00:24:14', '2005-08-01T04:35:14', '1'), + ('271', '2249', '2006-02-16T02:30:53', '2005-08-18T02:49:54', '2005-08-23T07:52:54', '1'), + ('271', '1066', '2006-02-16T02:30:53', '2005-05-31T13:30:49', '2005-06-09T13:53:49', '1'), + ('271', '3658', '2006-02-16T02:30:53', '2005-07-08T04:17:47', '2005-07-13T07:19:47', '1'), + ('274', '3135', '2006-02-16T02:30:53', '2005-08-22T18:24:16', '2005-08-24T21:26:16', '1'), + ('274', '2047', '2006-02-16T02:30:53', '2005-07-29T06:34:45', '2005-08-06T02:28:45', '1'), + ('274', '4460', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('274', '4455', '2006-02-16T02:30:53', '2005-08-19T12:05:04', '2005-08-26T10:24:04', '1'), + ('274', '1474', '2006-02-16T02:30:53', '2005-05-27T22:11:56', '2005-05-31T19:07:56', '1'), + ('274', '2020', '2006-02-16T02:30:53', '2005-07-31T19:20:49', '2005-08-03T14:39:49', '1'), + ('274', '4546', '2006-02-16T02:30:53', '2005-08-22T20:31:38', '2005-08-29T20:17:38', '1'), + ('274', '471', '2006-02-16T02:30:53', '2005-05-30T08:02:56', '2005-06-05T12:51:56', '1'), + ('274', '508', '2006-02-16T02:30:53', '2005-08-20T03:58:41', '2005-08-28T22:49:41', '1'), + ('274', '688', '2006-02-16T02:30:53', '2005-07-08T06:09:09', '2005-07-14T02:23:09', '1'), + ('274', '3190', '2006-02-16T02:30:53', '2005-08-02T17:48:39', '2005-08-05T17:20:39', '1'), + ('274', '3270', '2006-02-16T02:30:53', '2005-08-02T06:38:44', '2005-08-06T06:45:44', '1'), + ('274', '516', '2006-02-16T02:30:53', '2005-08-18T06:27:05', '2005-08-24T02:26:05', '1'), + ('274', '3866', '2006-02-16T02:30:53', '2005-06-21T06:55:36', '2005-06-29T03:41:36', '1'), + ('274', '1366', '2006-02-16T02:30:53', '2005-08-02T00:06:37', '2005-08-03T00:39:37', '1'), + ('274', '3669', '2006-02-16T02:30:53', '2005-05-26T08:10:22', '2005-05-27T03:55:22', '1'), + ('274', '3951', '2006-02-16T02:30:53', '2005-06-17T18:42:09', '2005-06-19T20:40:09', '1'), + ('274', '2248', '2006-02-16T02:30:53', '2005-07-30T17:46:50', '2005-08-01T19:03:50', '1'), + ('59', '260', '2006-02-16T02:30:53', '2005-07-07T08:36:58', '2005-07-09T05:51:58', '1'), + ('59', '2732', '2006-02-16T02:30:53', '2005-05-31T21:42:09', '2005-06-08T16:40:09', '1'), + ('59', '3496', '2006-02-16T02:30:53', '2005-07-09T11:15:44', '2005-07-17T06:00:44', '1'), + ('59', '1787', '2006-02-16T02:30:53', '2005-07-08T20:06:19', '2005-07-16T18:52:19', '1'), + ('59', '347', '2006-02-16T02:30:53', '2005-08-21T01:53:54', '2005-08-27T05:57:54', '1'), + ('59', '3399', '2006-02-16T02:30:53', '2005-07-09T10:39:31', '2005-07-18T13:54:31', '1'), + ('59', '1785', '2006-02-16T02:30:53', '2005-06-20T04:13:04', '2005-06-28T01:28:04', '1'), + ('59', '2364', '2006-02-16T02:30:53', '2005-08-23T12:15:51', '2005-08-31T17:19:51', '1'), + ('59', '381', '2006-02-16T02:30:53', '2005-07-29T14:45:23', '2005-08-04T18:42:23', '1'), + ('59', '2358', '2006-02-16T02:30:53', '2005-07-10T16:34:00', '2005-07-18T16:42:00', '1'), + ('59', '4373', '2006-02-16T02:30:53', '2005-08-19T18:08:18', '2005-08-24T14:08:18', '1'), + ('59', '3032', '2006-02-16T02:30:53', '2005-08-20T05:10:14', '2005-08-22T00:59:14', '1'), + ('59', '3723', '2006-02-16T02:30:53', '2005-08-19T01:42:28', '2005-08-26T20:13:28', '1'), + ('59', '1366', '2006-02-16T02:30:53', '2005-06-16T15:29:29', '2005-06-23T12:47:29', '1'), + ('59', '1178', '2006-02-16T02:30:53', '2005-07-07T20:46:45', '2005-07-16T21:54:45', '1'), + ('202', '960', '2006-02-16T02:30:53', '2005-08-19T00:27:19', '2005-08-26T03:10:19', '1'), + ('202', '1627', '2006-02-16T02:30:53', '2005-07-10T17:04:56', '2005-07-11T15:15:56', '1'), + ('202', '1711', '2006-02-16T02:30:53', '2005-08-17T16:22:05', '2005-08-26T12:34:05', '1'), + ('202', '3434', '2006-02-16T02:30:53', '2005-07-09T15:32:29', '2005-07-14T14:58:29', '1'), + ('202', '4073', '2006-02-16T02:30:53', '2005-07-08T05:20:04', '2005-07-10T01:35:04', '1'), + ('202', '3245', '2006-02-16T02:30:53', '2005-07-29T20:15:00', '2005-08-03T21:17:00', '1'), + ('202', '1847', '2006-02-16T02:30:53', '2005-08-20T03:03:31', '2005-08-26T03:09:31', '1'), + ('78', '2216', '2006-02-16T02:30:53', '2005-08-19T23:29:06', '2005-08-23T00:57:06', '1'), + ('78', '4157', '2006-02-16T02:30:53', '2005-08-20T12:21:37', '2005-08-27T14:28:37', '1'), + ('78', '4186', '2006-02-16T02:30:53', '2005-07-07T12:41:36', '2005-07-15T12:33:36', '1'), + ('78', '1623', '2006-02-16T02:30:53', '2005-07-28T13:34:08', '2005-08-05T07:58:08', '1'), + ('78', '2264', '2006-02-16T02:30:53', '2005-07-30T07:31:45', '2005-08-08T06:40:45', '1'), + ('78', '3702', '2006-02-16T02:30:53', '2005-07-10T05:05:00', '2005-07-12T08:04:00', '1'), + ('78', '1775', '2006-02-16T02:30:53', '2005-07-28T05:50:11', '2005-08-03T09:51:11', '1'), + ('78', '2067', '2006-02-16T02:30:53', '2005-08-01T05:30:05', '2005-08-05T09:59:05', '1'), + ('78', '3353', '2006-02-16T02:30:53', '2005-08-18T18:53:17', '2005-08-26T14:08:17', '1'), + ('78', '740', '2006-02-16T02:30:53', '2005-08-01T14:11:53', '2005-08-04T20:04:53', '1'), + ('78', '2240', '2006-02-16T02:30:53', '2005-08-18T12:10:03', '2005-08-27T17:05:03', '1'), + ('78', '180', '2006-02-16T02:30:53', '2005-07-28T12:13:02', '2005-08-05T08:54:02', '1'), + ('152', '2774', '2006-02-16T02:30:53', '2005-08-18T20:14:56', '2005-08-23T21:54:56', '1'), + ('152', '2298', '2006-02-16T02:30:53', '2005-08-01T04:39:26', '2005-08-08T06:01:26', '1'), + ('152', '1156', '2006-02-16T02:30:53', '2005-05-27T06:48:33', '2005-05-29T03:55:33', '1'), + ('152', '581', '2006-02-16T02:30:53', '2005-05-29T09:22:57', '2005-06-01T09:10:57', '1'), + ('152', '3680', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('152', '1071', '2006-02-16T02:30:53', '2005-07-09T00:00:36', '2005-07-13T21:03:36', '1'), + ('152', '3498', '2006-02-16T02:30:53', '2005-08-19T06:21:52', '2005-08-25T04:16:52', '1'), + ('152', '4508', '2006-02-16T02:30:53', '2005-07-06T14:00:41', '2005-07-13T16:49:41', '1'), + ('152', '3175', '2006-02-16T02:30:53', '2005-08-21T03:01:01', '2005-08-22T02:40:01', '1'), + ('152', '4524', '2006-02-16T02:30:53', '2005-08-19T15:02:48', '2005-08-24T18:07:48', '1'), + ('152', '205', '2006-02-16T02:30:53', '2005-06-20T01:26:26', '2005-06-21T19:33:26', '1'), + ('152', '235', '2006-02-16T02:30:53', '2005-07-12T08:28:33', '2005-07-17T06:25:33', '1'), + ('502', '3801', '2006-02-16T02:30:53', '2005-08-17T04:06:22', '2005-08-17T23:53:22', '1'), + ('502', '814', '2006-02-16T02:30:53', '2005-07-11T23:26:13', '2005-07-18T17:29:13', '1'), + ('502', '3871', '2006-02-16T02:30:53', '2005-07-28T10:37:24', '2005-07-31T10:31:24', '1'), + ('502', '3909', '2006-02-16T02:30:53', '2005-08-18T23:06:54', '2005-08-21T18:30:54', '1'), + ('502', '655', '2006-02-16T02:30:53', '2005-08-23T22:06:34', '2005-08-29T18:44:34', '1'), + ('502', '1625', '2006-02-16T02:30:53', '2005-08-02T20:14:23', '2005-08-05T20:40:23', '1'), + ('502', '3445', '2006-02-16T02:30:53', '2005-07-28T06:23:00', '2005-07-30T12:02:00', '1'), + ('502', '3711', '2006-02-16T02:30:53', '2005-05-30T02:48:32', '2005-06-06T05:43:32', '1'), + ('502', '3645', '2006-02-16T02:30:53', '2005-06-20T03:32:37', '2005-06-22T22:06:37', '1'), + ('502', '219', '2006-02-16T02:30:53', '2005-07-10T07:59:24', '2005-07-14T13:06:24', '1'), + ('502', '241', '2006-02-16T02:30:53', '2005-06-18T17:22:28', '2005-06-23T17:45:28', '1'), + ('502', '1889', '2006-02-16T02:30:53', '2005-08-02T16:08:52', '2005-08-08T21:12:52', '1'), + ('502', '874', '2006-02-16T02:30:53', '2005-07-12T18:38:51', '2005-07-14T20:10:51', '1'), + ('502', '3918', '2006-02-16T02:30:53', '2005-08-02T03:05:22', '2005-08-05T08:31:22', '1'), + ('492', '4045', '2006-02-16T02:30:53', '2005-07-07T08:19:45', '2005-07-08T13:55:45', '1'), + ('492', '1553', '2006-02-16T02:30:53', '2005-07-10T05:09:46', '2005-07-12T10:38:46', '1'), + ('492', '4438', '2006-02-16T02:30:53', '2005-06-16T12:24:28', '2005-06-24T08:24:28', '1'), + ('492', '3563', '2006-02-16T02:30:53', '2005-07-07T07:35:25', '2005-07-14T08:13:25', '1'), + ('492', '2703', '2006-02-16T02:30:53', '2005-07-09T16:35:47', '2005-07-10T11:52:47', '1'), + ('492', '1562', '2006-02-16T02:30:53', '2005-07-07T14:20:59', '2005-07-16T10:03:59', '1'), + ('492', '1685', '2006-02-16T02:30:53', '2005-07-27T09:01:23', '2005-08-04T14:14:23', '1'), + ('492', '3602', '2006-02-16T02:30:53', '2005-08-23T15:05:59', '2005-08-24T11:13:59', '1'), + ('492', '3125', '2006-02-16T02:30:53', '2005-08-21T05:51:37', '2005-08-29T10:00:37', '1'), + ('492', '1403', '2006-02-16T02:30:53', '2005-06-17T08:43:32', '2005-06-21T11:08:32', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['84', '15958', '1855', '12734', '12242', '14412', '15114', '7114', '14464', '7185', '8969', '7298', '12881', '1634', '8370', '12428', '15116', '5762', '9159', '11347', '10581', '6570', '8332', '828', '9745', '2076', '9317', '10372', '11313', '11689', '5863', '6173', '12720', '5900', '4224', '11323', '62', '7362', '14786', '7226', '15626', '14602', '7152', '11925', '11540', '10095', '7797', '15368', '11571', '6967', '1659', '11825', '6016', '511', '15023', '7568', '8171', '3486', '14571', '5589', '13991', '9249', '6646', '5978', '7668', '6929', '7283', '9706', '13201', '13095', '11447', '10128', '15930', '14886', '2926', '4740', '14011', '10041', '5402', '209', '13334', '14152', '3788', '10988', '8114', '14994', '2919', '831', '7586', '14226', '8564', '2820', '1065', '2338', '1350', '9903', '2491', '7945', '15840', '3373']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('492', '1829', '2006-02-16T02:30:53', '2005-05-25T12:36:30', '2005-05-29T18:33:30', '1'), + ('492', '4164', '2006-02-16T02:30:53', '2005-08-23T19:22:36', '2005-08-30T01:03:36', '1'), + ('492', '4457', '2006-02-16T02:30:53', '2005-06-17T00:54:58', '2005-06-20T19:29:58', '1'), + ('121', '3619', '2006-02-16T02:30:53', '2005-08-18T22:04:52', '2005-08-25T00:34:52', '1'), + ('121', '2095', '2006-02-16T02:30:53', '2005-08-18T03:37:31', '2005-08-25T06:50:31', '1'), + ('121', '212', '2006-02-16T02:30:53', '2005-08-21T11:02:09', '2005-08-29T06:44:09', '1'), + ('121', '2481', '2006-02-16T02:30:53', '2005-08-22T12:24:55', '2005-08-31T17:06:55', '1'), + ('121', '3892', '2006-02-16T02:30:53', '2005-07-27T05:42:13', '2005-07-29T01:59:13', '1'), + ('121', '2310', '2006-02-16T02:30:53', '2005-08-21T12:52:54', '2005-08-25T16:42:54', '1'), + ('121', '2340', '2006-02-16T02:30:53', '2005-07-27T08:23:54', '2005-07-30T09:50:54', '1'), + ('121', '2043', '2006-02-16T02:30:53', '2005-07-30T04:00:19', '2005-08-06T04:39:19', '1'), + ('121', '1653', '2006-02-16T02:30:53', '2005-07-27T12:45:14', '2005-07-30T07:02:14', '1'), + ('121', '1432', '2006-02-16T02:30:53', '2005-08-19T03:28:13', '2005-08-25T05:25:13', '1'), + ('121', '3990', '2006-02-16T02:30:53', '2005-06-16T08:16:05', '2005-06-17T04:49:05', '1'), + ('121', '1206', '2006-02-16T02:30:53', '2005-07-29T05:16:21', '2005-08-06T23:16:21', '1'), + ('121', '3735', '2006-02-16T02:30:53', '2005-08-18T10:24:21', '2005-08-24T05:12:21', '1'), + ('217', '518', '2006-02-16T02:30:53', '2005-08-22T12:35:40', '2005-08-23T17:58:40', '1'), + ('217', '1815', '2006-02-16T02:30:53', '2005-07-10T12:48:01', '2005-07-18T16:43:01', '1'), + ('217', '1234', '2006-02-16T02:30:53', '2005-07-30T11:16:37', '2005-08-03T10:32:37', '1'), + ('217', '195', '2006-02-16T02:30:53', '2005-08-02T17:18:07', '2005-08-05T12:30:07', '1'), + ('217', '2801', '2006-02-16T02:30:53', '2005-08-01T13:52:30', '2005-08-10T19:11:30', '1'), + ('217', '2082', '2006-02-16T02:30:53', '2005-07-12T05:50:31', '2005-07-13T09:58:31', '1'), + ('217', '1142', '2006-02-16T02:30:53', '2005-07-29T04:16:00', '2005-08-03T03:34:00', '1'), + ('217', '2468', '2006-02-16T02:30:53', '2005-05-29T22:14:55', '2005-05-30T17:22:55', '1'), + ('217', '3610', '2006-02-16T02:30:53', '2005-07-31T09:16:14', '2005-08-07T12:11:14', '1'), + ('217', '2242', '2006-02-16T02:30:53', '2005-06-17T16:43:47', '2005-06-24T11:12:47', '1'), + ('217', '4138', '2006-02-16T02:30:53', '2005-07-30T17:13:37', '2005-08-08T11:33:37', '1'), + ('419', '635', '2006-02-16T02:30:53', '2005-08-01T06:23:48', '2005-08-06T03:47:48', '1'), + ('419', '2689', '2006-02-16T02:30:53', '2005-08-02T16:02:51', '2005-08-03T14:54:51', '1'), + ('419', '2390', '2006-02-16T02:30:53', '2005-08-17T06:42:08', '2005-08-26T06:09:08', '1'), + ('419', '2557', '2006-02-16T02:30:53', '2005-07-10T18:25:23', '2005-07-15T23:49:23', '1'), + ('419', '4252', '2006-02-16T02:30:53', '2005-07-11T10:33:11', '2005-07-15T10:57:11', '1'), + ('419', '2676', '2006-02-16T02:30:53', '2005-08-18T21:28:42', '2005-08-25T18:02:42', '1'), + ('419', '1081', '2006-02-16T02:30:53', '2005-07-10T20:21:54', '2005-07-17T00:26:54', '1'), + ('419', '3659', '2006-02-16T02:30:53', '2005-07-07T12:24:21', '2005-07-10T11:48:21', '1'), + ('419', '3784', '2006-02-16T02:30:53', '2005-08-02T16:29:57', '2005-08-06T16:01:57', '1'), + ('419', '261', '2006-02-16T02:30:53', '2005-05-25T09:18:52', '2005-05-30T10:55:52', '1'), + ('419', '1902', '2006-02-16T02:30:53', '2005-07-27T14:58:27', '2005-08-01T11:51:27', '1'), + ('370', '2959', '2006-02-16T02:30:53', '2005-08-22T00:24:42', '2005-08-25T19:36:42', '1'), + ('370', '3507', '2006-02-16T02:30:53', '2005-07-27T09:47:53', '2005-08-01T08:24:53', '1'), + ('370', '640', '2006-02-16T02:30:53', '2005-08-23T07:25:34', '2005-08-28T11:01:34', '1'), + ('370', '3771', '2006-02-16T02:30:53', '2005-08-21T17:48:49', '2005-08-28T21:38:49', '1'), + ('370', '2338', '2006-02-16T02:30:53', '2005-07-27T07:15:01', '2005-08-05T04:50:01', '1'), + ('370', '1441', '2006-02-16T02:30:53', '2005-08-17T16:23:04', '2005-08-21T11:38:04', '1'), + ('370', '3385', '2006-02-16T02:30:53', '2005-08-17T00:48:03', '2005-08-25T03:46:03', '1'), + ('370', '4062', '2006-02-16T02:30:53', '2005-07-31T20:38:35', '2005-08-02T02:33:35', '1'), + ('370', '4180', '2006-02-16T02:30:53', '2005-07-28T07:41:07', '2005-07-31T04:13:07', '1'), + ('370', '1130', '2006-02-16T02:30:53', '2005-08-22T21:57:15', '2005-08-29T16:28:15', '1'), + ('296', '203', '2006-02-16T02:30:53', '2005-08-17T01:37:51', '2005-08-17T20:30:51', '1'), + ('296', '1145', '2006-02-16T02:30:53', '2005-07-27T00:16:31', '2005-08-03T22:19:31', '1'), + ('296', '1182', '2006-02-16T02:30:53', '2005-06-16T10:11:46', '2005-06-20T13:51:46', '1'), + ('296', '2656', '2006-02-16T02:30:53', '2005-08-17T12:43:30', '2005-08-20T15:25:30', '1'), + ('296', '651', '2006-02-16T02:30:53', '2005-07-11T02:04:45', '2005-07-17T22:22:45', '1'), + ('296', '3827', '2006-02-16T02:30:53', '2005-05-28T03:04:04', '2005-06-03T04:58:04', '1'), + ('296', '358', '2006-02-16T02:30:53', '2005-08-22T08:56:48', '2005-08-29T08:13:48', '1'), + ('296', '1578', '2006-02-16T02:30:53', '2005-07-27T22:38:53', '2005-07-29T00:51:53', '1'), + ('296', '3380', '2006-02-16T02:30:53', '2005-07-28T21:32:57', '2005-07-30T21:19:57', '1'), + ('296', '4067', '2006-02-16T02:30:53', '2005-07-05T23:29:55', '2005-07-13T19:54:55', '1'), + ('296', '2218', '2006-02-16T02:30:53', '2005-08-21T16:40:26', '2005-08-29T17:10:26', '1'), + ('296', '3673', '2006-02-16T02:30:53', '2005-07-10T04:22:58', '2005-07-10T23:13:58', '1'), + ('296', '1971', '2006-02-16T02:30:53', '2005-08-20T19:29:44', '2005-08-24T21:10:44', '1'), + ('296', '2015', '2006-02-16T02:30:53', '2005-07-30T14:15:02', '2005-08-05T13:02:02', '1'), + ('508', '4061', '2006-02-16T02:30:53', '2005-07-12T10:41:34', '2005-07-15T05:31:34', '1'), + ('508', '1720', '2006-02-16T02:30:53', '2005-07-11T00:16:54', '2005-07-19T18:55:54', '1'), + ('508', '3880', '2006-02-16T02:30:53', '2005-07-28T02:41:31', '2005-08-02T06:08:31', '1'), + ('508', '3339', '2006-02-16T02:30:53', '2005-07-26T22:59:19', '2005-08-03T22:40:19', '1'), + ('508', '3101', '2006-02-16T02:30:53', '2005-07-27T12:02:41', '2005-08-05T07:25:41', '1'), + ('508', '142', '2006-02-16T02:30:53', '2005-07-31T07:43:19', '2005-08-05T11:11:19', '1'), + ('508', '111', '2006-02-16T02:30:53', '2005-08-19T14:56:05', '2005-08-25T14:37:05', '1'), + ('508', '520', '2006-02-16T02:30:53', '2005-08-19T10:48:10', '2005-08-28T06:15:10', '1'), + ('508', '3868', '2006-02-16T02:30:53', '2005-08-02T20:36:25', '2005-08-07T18:52:25', '1'), + ('508', '2559', '2006-02-16T02:30:53', '2005-07-31T21:40:04', '2005-08-02T02:21:04', '1'), + ('379', '180', '2006-02-16T02:30:53', '2005-08-23T18:26:51', '2005-08-31T16:12:51', '1'), + ('379', '4330', '2006-02-16T02:30:53', '2005-08-22T03:59:01', '2005-08-23T01:22:01', '1'), + ('379', '1055', '2006-02-16T02:30:53', '2005-06-20T04:37:45', '2005-06-26T02:17:45', '1'), + ('379', '2559', '2006-02-16T02:30:53', '2005-07-08T13:30:35', '2005-07-14T18:43:35', '1'), + ('379', '1212', '2006-02-16T02:30:53', '2005-08-20T20:32:56', '2005-08-28T21:44:56', '1'), + ('379', '2994', '2006-02-16T02:30:53', '2005-07-31T19:01:02', '2005-08-07T21:32:02', '1'), + ('379', '4450', '2006-02-16T02:30:53', '2005-07-09T20:01:58', '2005-07-10T14:07:58', '1'), + ('379', '729', '2006-02-16T02:30:53', '2005-05-26T08:14:01', '2005-05-27T09:00:01', '1'), + ('379', '461', '2006-02-16T02:30:53', '2005-08-19T20:02:33', '2005-08-22T00:45:33', '1'), + ('379', '2561', '2006-02-16T02:30:53', '2005-08-21T02:23:50', '2005-08-25T06:05:50', '1'), + ('379', '1363', '2006-02-16T02:30:53', '2005-07-06T14:02:02', '2005-07-10T18:24:02', '1'), + ('509', '1157', '2006-02-16T02:30:53', '2005-08-02T04:38:17', '2005-08-09T00:09:17', '1'), + ('509', '815', '2006-02-16T02:30:53', '2005-07-28T19:14:06', '2005-08-05T13:16:06', '1'), + ('509', '1601', '2006-02-16T02:30:53', '2005-08-22T07:52:24', '2005-08-26T09:57:24', '1'), + ('509', '2835', '2006-02-16T02:30:53', '2005-06-20T04:10:16', '2005-06-27T06:34:16', '1'), + ('509', '3912', '2006-02-16T02:30:53', '2005-05-29T22:50:25', '2005-06-06T02:27:25', '1'), + ('316', '15', '2006-02-16T02:30:53', '2005-07-27T23:19:29', '2005-07-29T23:04:29', '1'), + ('316', '1793', '2006-02-16T02:30:53', '2005-08-21T04:55:37', '2005-08-24T04:32:37', '1'), + ('316', '2830', '2006-02-16T02:30:53', '2005-07-29T11:33:00', '2005-08-05T15:35:00', '1'), + ('316', '851', '2006-02-16T02:30:53', '2005-06-19T20:20:33', '2005-06-26T20:32:33', '1'), + ('316', '3379', '2006-02-16T02:30:53', '2005-05-31T08:54:56', '2005-06-08T09:21:56', '1'), + ('316', '3165', '2006-02-16T02:30:53', '2005-06-18T11:24:54', '2005-06-19T07:34:54', '1'), + ('316', '4261', '2006-02-16T02:30:53', '2005-06-15T12:50:25', '2005-06-23T11:35:25', '1'), + ('316', '1621', '2006-02-16T02:30:53', '2005-07-31T14:31:44', '2005-08-08T20:03:44', '1'), + ('316', '1779', '2006-02-16T02:30:53', '2005-06-18T22:01:31', '2005-06-26T02:46:31', '1'), + ('316', '3326', '2006-02-16T02:30:53', '2005-07-28T12:53:58', '2005-08-03T14:04:58', '1'), + ('316', '1901', '2006-02-16T02:30:53', '2005-08-23T15:34:49', '2005-08-24T16:54:49', '1'), + ('316', '2219', '2006-02-16T02:30:53', '2005-06-21T13:35:32', '2005-06-30T12:03:32', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['5618', '5544', '1317', '9508', '644', '2032', '13719', '7984', '7861', '10784', '100', '5117', '10762', '1805', '1949', '11819', '8742', '2592', '12822', '4114', '10172', '4398', '11938', '14151', '2204', '12548', '7527', '11876', '13834', '1842', '9185', '3243', '7495', '7789', '5232', '13016', '10229', '7771', '14897', '8440', '3625', '9941', '7448', '13161', '11618', '8817', '14614', '1627', '1229', '8423', '11257', '673', '459', '9598', '16044', '4184', '12026', '4527', '13221', '13417', '8768', '101', '11633', '6392', '3724', '6815', '5490', '939', '14413', '3078', '1089', '6835', '6716', '12373', '9030', '10344', '9912', '12152', '13235', '3292', '8411', '15314', '10381', '14068', '191', '15781', '9881', '11027', '8674', '12359', '5653', '9593', '15445', '11856', '12190', '4704', '12938', '1240', '388', '12708']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('316', '757', '2006-02-16T02:30:53', '2005-07-10T05:28:58', '2005-07-18T01:38:58', '1'), + ('316', '1014', '2006-02-16T02:30:53', '2005-07-10T02:48:07', '2005-07-17T01:08:07', '1'), + ('316', '3696', '2006-02-16T02:30:53', '2005-06-15T10:30:19', '2005-06-24T08:18:19', '1'), + ('316', '1204', '2006-02-16T02:30:53', '2005-07-31T00:22:39', '2005-08-04T05:40:39', '1'), + ('316', '4304', '2006-02-16T02:30:53', '2005-05-28T18:59:12', '2005-06-04T18:06:12', '1'), + ('316', '425', '2006-02-16T02:30:53', '2005-06-17T13:24:07', '2005-06-18T18:18:07', '1'), + ('208', '3547', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('208', '2893', '2006-02-16T02:30:53', '2005-07-28T14:27:51', '2005-08-04T17:34:51', '1'), + ('208', '1781', '2006-02-16T02:30:53', '2005-07-28T10:02:01', '2005-08-06T13:17:01', '1'), + ('208', '3494', '2006-02-16T02:30:53', '2005-08-01T21:24:28', '2005-08-09T19:23:28', '1'), + ('208', '2599', '2006-02-16T02:30:53', '2005-05-25T16:50:28', '2005-06-02T22:11:28', '1'), + ('208', '2284', '2006-02-16T02:30:53', '2005-07-09T07:11:22', '2005-07-15T08:44:22', '1'), + ('208', '1363', '2006-02-16T02:30:53', '2005-08-01T20:28:39', '2005-08-05T17:36:39', '1'), + ('208', '3962', '2006-02-16T02:30:53', '2005-06-16T20:36:00', '2005-06-17T16:27:00', '1'), + ('208', '1478', '2006-02-16T02:30:53', '2005-06-17T08:19:22', '2005-06-25T08:43:22', '1'), + ('208', '656', '2006-02-16T02:30:53', '2005-08-17T12:25:17', '2005-08-19T16:12:17', '1'), + ('208', '918', '2006-02-16T02:30:53', '2005-07-29T18:56:12', '2005-08-03T16:42:12', '1'), + ('208', '282', '2006-02-16T02:30:53', '2005-06-19T05:36:54', '2005-06-21T08:44:54', '1'), + ('426', '419', '2006-02-16T02:30:53', '2005-08-19T01:15:24', '2005-08-20T06:38:24', '1'), + ('426', '4109', '2006-02-16T02:30:53', '2005-07-07T06:51:12', '2005-07-15T01:36:12', '1'), + ('426', '2506', '2006-02-16T02:30:53', '2005-07-31T23:29:51', '2005-08-09T01:57:51', '1'), + ('426', '3628', '2006-02-16T02:30:53', '2005-07-07T21:18:44', '2005-07-10T22:45:44', '1'), + ('426', '3927', '2006-02-16T02:30:53', '2005-08-17T16:54:54', '2005-08-24T19:18:54', '1'), + ('426', '2785', '2006-02-16T02:30:53', '2005-08-21T02:23:25', '2005-08-30T07:08:25', '1'), + ('426', '1137', '2006-02-16T02:30:53', '2005-06-18T02:11:38', '2005-06-24T00:28:38', '1'), + ('426', '750', '2006-02-16T02:30:53', '2005-08-18T14:35:26', '2005-08-27T18:58:26', '1'), + ('426', '2124', '2006-02-16T02:30:53', '2005-07-27T21:14:28', '2005-08-05T21:08:28', '1'), + ('426', '3982', '2006-02-16T02:30:53', '2005-08-17T14:18:21', '2005-08-20T19:48:21', '1'), + ('426', '875', '2006-02-16T02:30:53', '2005-08-20T14:03:08', '2005-08-22T10:12:08', '1'), + ('426', '1472', '2006-02-16T02:30:53', '2005-06-16T23:45:59', '2005-06-26T05:31:59', '1'), + ('426', '2268', '2006-02-16T02:30:53', '2005-07-30T12:10:40', '2005-08-06T07:01:40', '1'), + ('426', '2556', '2006-02-16T02:30:53', '2005-06-21T03:00:11', '2005-06-25T21:53:11', '1'), + ('426', '3446', '2006-02-16T02:30:53', '2005-07-27T20:01:20', '2005-07-30T16:40:20', '1'), + ('426', '2837', '2006-02-16T02:30:53', '2005-07-28T07:22:07', '2005-08-06T10:47:07', '1'), + ('175', '3353', '2006-02-16T02:30:53', '2005-07-09T12:35:08', '2005-07-14T14:55:08', '1'), + ('175', '3095', '2006-02-16T02:30:53', '2005-08-19T07:57:14', '2005-08-23T03:29:14', '1'), + ('175', '3459', '2006-02-16T02:30:53', '2005-08-01T01:45:26', '2005-08-10T06:21:26', '1'), + ('175', '1003', '2006-02-16T02:30:53', '2005-07-28T06:52:12', '2005-07-30T12:48:12', '1'), + ('175', '1607', '2006-02-16T02:30:53', '2005-08-22T04:22:31', '2005-08-26T00:09:31', '1'), + ('175', '489', '2006-02-16T02:30:53', '2005-07-29T07:31:26', '2005-08-04T07:04:26', '1'), + ('175', '1133', '2006-02-16T02:30:53', '2005-07-06T06:12:52', '2005-07-12T07:37:52', '1'), + ('175', '1756', '2006-02-16T02:30:53', '2005-07-31T15:31:25', '2005-08-05T17:23:25', '1'), + ('175', '3584', '2006-02-16T02:30:53', '2005-07-27T18:06:30', '2005-07-29T15:43:30', '1'), + ('175', '986', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('175', '954', '2006-02-16T02:30:53', '2005-08-17T04:01:36', '2005-08-23T01:02:36', '1'), + ('175', '2716', '2006-02-16T02:30:53', '2005-07-29T22:09:08', '2005-08-01T19:07:08', '1'), + ('468', '3053', '2006-02-16T02:30:53', '2005-08-21T18:03:51', '2005-08-30T13:37:51', '1'), + ('468', '4135', '2006-02-16T02:30:53', '2005-06-16T07:51:09', '2005-06-24T02:24:09', '1'), + ('468', '2140', '2006-02-16T02:30:53', '2005-06-15T03:53:13', '2005-06-18T04:09:13', '1'), + ('468', '187', '2006-02-16T02:30:53', '2005-07-29T07:02:57', '2005-08-06T04:59:57', '1'), + ('468', '105', '2006-02-16T02:30:53', '2005-08-02T13:45:05', '2005-08-11T16:37:05', '1'), + ('468', '1769', '2006-02-16T02:30:53', '2005-05-28T22:07:30', '2005-06-01T23:42:30', '1'), + ('468', '597', '2006-02-16T02:30:53', '2005-05-27T20:00:04', '2005-05-29T22:47:04', '1'), + ('468', '1105', '2006-02-16T02:30:53', '2005-07-31T03:30:41', '2005-08-04T03:54:41', '1'), + ('468', '1312', '2006-02-16T02:30:53', '2005-08-23T22:24:39', '2005-08-25T04:08:39', '1'), + ('468', '1022', '2006-02-16T02:30:53', '2005-07-07T10:30:08', '2005-07-14T12:56:08', '1'), + ('468', '1568', '2006-02-16T02:30:53', '2005-08-17T20:00:10', '2005-08-26T01:54:10', '1'), + ('468', '2263', '2006-02-16T02:30:53', '2005-07-08T03:20:10', '2005-07-15T02:21:10', '1'), + ('468', '120', '2006-02-16T02:30:53', '2005-08-19T15:45:47', '2005-08-26T21:10:47', '1'), + ('468', '92', '2006-02-16T02:30:53', '2005-08-19T22:51:39', '2005-08-23T03:34:39', '1'), + ('468', '1601', '2006-02-16T02:30:53', '2005-07-29T19:43:02', '2005-08-03T23:36:02', '1'), + ('468', '617', '2006-02-16T02:30:53', '2005-05-25T17:17:04', '2005-05-31T19:47:04', '1'), + ('468', '1706', '2006-02-16T02:30:53', '2005-08-17T04:30:09', '2005-08-20T06:56:09', '1'), + ('468', '4406', '2006-02-16T02:30:53', '2005-07-11T22:25:19', '2005-07-16T04:24:19', '1'), + ('468', '3622', '2006-02-16T02:30:53', '2005-07-06T11:12:48', '2005-07-14T14:41:48', '1'), + ('468', '3236', '2006-02-16T02:30:53', '2005-07-12T18:14:10', '2005-07-17T14:16:10', '1'), + ('367', '3044', '2006-02-16T02:30:53', '2005-07-10T00:09:11', '2005-07-14T21:23:11', '1'), + ('367', '1314', '2006-02-16T02:30:53', '2005-05-30T14:49:34', '2005-06-01T19:00:34', '1'), + ('367', '50', '2006-02-16T02:30:53', '2005-08-21T11:06:33', '2005-08-29T16:10:33', '1'), + ('367', '3642', '2006-02-16T02:30:53', '2005-06-20T15:09:48', '2005-06-24T16:54:48', '1'), + ('367', '3784', '2006-02-16T02:30:53', '2005-05-31T11:38:29', '2005-06-02T08:06:29', '1'), + ('367', '1444', '2006-02-16T02:30:53', '2005-07-12T18:58:03', '2005-07-18T00:41:03', '1'), + ('367', '2783', '2006-02-16T02:30:53', '2005-07-12T13:34:58', '2005-07-19T15:09:58', '1'), + ('367', '777', '2006-02-16T02:30:53', '2005-08-18T08:07:25', '2005-08-27T03:41:25', '1'), + ('367', '2237', '2006-02-16T02:30:53', '2005-07-30T06:05:38', '2005-08-03T00:19:38', '1'), + ('367', '3673', '2006-02-16T02:30:53', '2005-08-01T05:18:23', '2005-08-06T05:20:23', '1'), + ('367', '3119', '2006-02-16T02:30:53', '2005-07-31T14:49:04', '2005-08-03T15:40:04', '1'), + ('367', '2797', '2006-02-16T02:30:53', '2005-08-18T00:21:35', '2005-08-22T02:51:35', '1'), + ('367', '3902', '2006-02-16T02:30:53', '2005-08-19T16:17:53', '2005-08-27T14:57:53', '1'), + ('412', '3288', '2006-02-16T02:30:53', '2005-06-21T06:59:11', '2005-06-23T07:11:11', '1'), + ('412', '3085', '2006-02-16T02:30:53', '2005-07-29T06:44:23', '2005-08-07T03:56:23', '1'), + ('412', '2754', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('412', '522', '2006-02-16T02:30:53', '2005-08-01T06:36:37', '2005-08-05T11:17:37', '1'), + ('412', '818', '2006-02-16T02:30:53', '2005-08-20T22:50:59', '2005-08-29T00:45:59', '1'), + ('412', '4365', '2006-02-16T02:30:53', '2005-05-26T06:14:06', '2005-05-28T05:33:06', '1'), + ('412', '4449', '2006-02-16T02:30:53', '2005-08-23T13:41:05', '2005-08-31T13:11:05', '1'), + ('412', '4209', '2006-02-16T02:30:53', '2005-07-31T13:50:38', '2005-08-06T08:58:38', '1'), + ('412', '571', '2006-02-16T02:30:53', '2005-08-02T05:47:10', '2005-08-05T23:51:10', '1'), + ('412', '1744', '2006-02-16T02:30:53', '2005-07-29T15:54:22', '2005-07-31T12:15:22', '1'), + ('28', '4172', '2006-02-16T02:30:53', '2005-08-18T07:44:05', '2005-08-19T02:26:05', '1'), + ('28', '919', '2006-02-16T02:30:53', '2005-07-10T07:21:27', '2005-07-16T01:58:27', '1'), + ('28', '1223', '2006-02-16T02:30:53', '2005-07-31T03:22:30', '2005-08-05T08:23:30', '1'), + ('28', '196', '2006-02-16T02:30:53', '2005-08-23T00:48:29', '2005-08-28T00:33:29', '1'), + ('28', '305', '2006-02-16T02:30:53', '2005-08-17T13:44:49', '2005-08-21T17:20:49', '1'), + ('28', '2464', '2006-02-16T02:30:53', '2005-08-18T01:54:44', '2005-08-27T04:32:44', '1'), + ('28', '2291', '2006-02-16T02:30:53', '2005-07-08T11:45:35', '2005-07-10T09:46:35', '1'), + ('28', '3987', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('28', '3841', '2006-02-16T02:30:53', '2005-06-15T04:58:07', '2005-06-17T23:56:07', '1'), + ('28', '434', '2006-02-16T02:30:53', '2005-05-27T10:37:27', '2005-05-30T05:45:27', '1'), + ('28', '3448', '2006-02-16T02:30:53', '2005-08-18T20:59:17', '2005-08-24T22:40:17', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['8901', '868', '4951', '7580', '2299', '12438', '14006', '9303', '14988', '6067', '3039', '14646', '14229', '2132', '14216', '11982', '13853', '10985', '1192', '15596', '8872', '8483', '6064', '15711', '13888', '6156', '11269', '2260', '11780', '11784', '14403', '2339', '12231', '12230', '2423', '5096', '15389', '3839', '6877', '13983', '8949', '11202', '9018', '5737', '7236', '13708', '11939', '6858', '15701', '3431', '1159', '571', '11926', '12535', '8534', '7882', '1200', '12915', '15526', '7628', '7601', '5902', '4909', '12304', '12672', '12952', '13458', '492', '3715', '5320', '8147', '6141', '2934', '1070', '8735', '5558', '8857', '11786', '4907', '967', '14436', '7688', '2306', '6844', '14615', '680', '14424', '1386', '13200', '7855', '14987', '720', '2508', '4089', '7613', '2053', '14814', '3842', '14706', '1540']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('28', '4392', '2006-02-16T02:30:53', '2005-07-30T01:07:12', '2005-08-02T06:34:12', '1'), + ('28', '3604', '2006-02-16T02:30:53', '2005-05-30T04:19:55', '2005-05-31T02:28:55', '1'), + ('28', '2766', '2006-02-16T02:30:53', '2005-07-08T22:58:21', '2005-07-16T18:58:21', '1'), + ('28', '338', '2006-02-16T02:30:53', '2005-07-27T23:07:40', '2005-08-05T02:17:40', '1'), + ('28', '4339', '2006-02-16T02:30:53', '2005-06-18T08:18:52', '2005-06-26T11:48:52', '1'), + ('186', '2043', '2006-02-16T02:30:53', '2005-08-18T10:42:52', '2005-08-25T11:42:52', '1'), + ('186', '2189', '2006-02-16T02:30:53', '2005-08-20T20:21:36', '2005-08-21T15:26:36', '1'), + ('186', '4299', '2006-02-16T02:30:53', '2005-07-30T16:35:59', '2005-08-03T18:31:59', '1'), + ('186', '2114', '2006-02-16T02:30:53', '2005-08-22T07:46:05', '2005-08-29T06:43:05', '1'), + ('186', '2097', '2006-02-16T02:30:53', '2005-07-11T04:34:49', '2005-07-16T09:33:49', '1'), + ('186', '4098', '2006-02-16T02:30:53', '2005-06-20T12:32:30', '2005-06-21T07:38:30', '1'), + ('186', '948', '2006-02-16T02:30:53', '2005-08-21T19:14:48', '2005-08-23T17:15:48', '1'), + ('186', '4479', '2006-02-16T02:30:53', '2005-08-21T04:57:15', '2005-08-26T10:00:15', '1'), + ('186', '2636', '2006-02-16T02:30:53', '2005-06-17T21:05:06', '2005-06-20T18:10:06', '1'), + ('186', '3763', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('186', '118', '2006-02-16T02:30:53', '2005-08-17T18:13:07', '2005-08-18T19:06:07', '1'), + ('186', '1680', '2006-02-16T02:30:53', '2005-08-20T14:47:02', '2005-08-26T20:32:02', '1'), + ('186', '2734', '2006-02-16T02:30:53', '2005-08-02T04:30:19', '2005-08-03T05:18:19', '1'), + ('186', '4134', '2006-02-16T02:30:53', '2005-06-15T01:18:39', '2005-06-19T22:46:39', '1'), + ('186', '3834', '2006-02-16T02:30:53', '2005-08-23T06:19:51', '2005-08-25T03:32:51', '1'), + ('186', '2669', '2006-02-16T02:30:53', '2005-07-30T00:13:54', '2005-08-01T18:34:54', '1'), + ('186', '2786', '2006-02-16T02:30:53', '2005-07-29T08:50:18', '2005-08-03T06:46:18', '1'), + ('297', '265', '2006-02-16T02:30:53', '2005-07-11T04:23:18', '2005-07-19T02:21:18', '1'), + ('297', '789', '2006-02-16T02:30:53', '2005-08-23T10:43:00', '2005-08-29T16:29:00', '1'), + ('297', '1943', '2006-02-16T02:30:53', '2005-08-20T15:39:42', '2005-08-28T13:41:42', '1'), + ('297', '302', '2006-02-16T02:30:53', '2005-07-11T09:45:48', '2005-07-15T04:51:48', '1'), + ('297', '2398', '2006-02-16T02:30:53', '2005-08-02T14:11:41', '2005-08-08T18:53:41', '1'), + ('297', '2773', '2006-02-16T02:30:53', '2005-06-18T05:38:36', '2005-06-20T08:08:36', '1'), + ('297', '2268', '2006-02-16T02:30:53', '2005-08-17T10:34:24', '2005-08-21T04:55:24', '1'), + ('297', '3101', '2006-02-16T02:30:53', '2005-08-17T10:48:05', '2005-08-19T06:47:05', '1'), + ('297', '3581', '2006-02-16T02:30:53', '2005-08-21T10:40:34', '2005-08-29T11:29:34', '1'), + ('297', '313', '2006-02-16T02:30:53', '2005-06-18T11:29:22', '2005-06-21T10:29:22', '1'), + ('231', '1115', '2006-02-16T02:30:53', '2005-08-18T03:11:44', '2005-08-24T03:26:44', '1'), + ('231', '1910', '2006-02-16T02:30:53', '2005-08-18T03:11:04', '2005-08-27T04:06:04', '1'), + ('231', '1744', '2006-02-16T02:30:53', '2005-06-18T17:32:08', '2005-06-21T11:58:08', '1'), + ('231', '490', '2006-02-16T02:30:53', '2005-07-09T06:08:23', '2005-07-14T11:36:23', '1'), + ('231', '2077', '2006-02-16T02:30:53', '2005-08-22T22:51:13', '2005-08-28T23:46:13', '1'), + ('231', '3230', '2006-02-16T02:30:53', '2005-07-06T16:30:30', '2005-07-11T19:00:30', '1'), + ('231', '3968', '2006-02-16T02:30:53', '2005-07-12T20:32:58', '2005-07-18T18:01:58', '1'), + ('231', '457', '2006-02-16T02:30:53', '2005-08-20T19:08:32', '2005-08-29T23:45:32', '1'), + ('231', '2876', '2006-02-16T02:30:53', '2005-07-30T03:17:02', '2005-08-08T07:38:02', '1'), + ('231', '3625', '2006-02-16T02:30:53', '2005-08-02T11:51:57', '2005-08-08T09:41:57', '1'), + ('218', '1982', '2006-02-16T02:30:53', '2005-07-30T05:28:40', '2005-08-07T01:34:40', '1'), + ('218', '1118', '2006-02-16T02:30:53', '2005-07-10T11:50:04', '2005-07-13T10:37:04', '1'), + ('218', '3004', '2006-02-16T02:30:53', '2005-07-27T10:09:39', '2005-08-03T16:05:39', '1'), + ('218', '2236', '2006-02-16T02:30:53', '2005-08-20T09:34:07', '2005-08-26T10:17:07', '1'), + ('516', '3305', '2006-02-16T02:30:53', '2005-08-17T16:55:57', '2005-08-24T21:36:57', '1'), + ('516', '1095', '2006-02-16T02:30:53', '2005-07-12T19:53:51', '2005-07-19T14:12:51', '1'), + ('516', '2942', '2006-02-16T02:30:53', '2005-08-23T10:22:21', '2005-08-24T10:52:21', '1'), + ('516', '133', '2006-02-16T02:30:53', '2005-06-21T18:46:48', '2005-06-26T23:08:48', '1'), + ('516', '4395', '2006-02-16T02:30:53', '2005-06-14T22:55:13', '2005-06-17T02:11:13', '1'), + ('516', '4250', '2006-02-16T02:30:53', '2005-05-28T10:17:41', '2005-06-05T07:56:41', '1'), + ('516', '2111', '2006-02-16T02:30:53', '2005-08-17T16:25:02', '2005-08-22T11:36:02', '1'), + ('516', '2944', '2006-02-16T02:30:53', '2005-08-18T14:05:22', '2005-08-25T16:35:22', '1'), + ('516', '4029', '2006-02-16T02:30:53', '2005-07-29T10:30:13', '2005-08-02T04:47:13', '1'), + ('516', '3922', '2006-02-16T02:30:53', '2005-07-28T10:33:42', '2005-07-29T13:49:42', '1'), + ('516', '3329', '2006-02-16T02:30:53', '2005-06-15T01:59:51', '2005-06-21T21:33:51', '1'), + ('516', '2651', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('516', '2892', '2006-02-16T02:30:53', '2005-08-23T03:44:30', '2005-08-30T08:19:30', '1'), + ('516', '1240', '2006-02-16T02:30:53', '2005-07-28T00:58:04', '2005-08-03T19:16:04', '1'), + ('228', '903', '2006-02-16T02:30:53', '2005-07-27T23:48:15', '2005-07-29T02:45:15', '1'), + ('228', '2727', '2006-02-16T02:30:53', '2005-07-10T20:31:24', '2005-07-11T20:50:24', '1'), + ('228', '1451', '2006-02-16T02:30:53', '2005-07-08T21:07:24', '2005-07-10T22:34:24', '1'), + ('228', '1381', '2006-02-16T02:30:53', '2005-08-18T05:44:29', '2005-08-24T04:31:29', '1'), + ('228', '1722', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('228', '2460', '2006-02-16T02:30:53', '2005-08-19T06:00:52', '2005-08-20T02:17:52', '1'), + ('228', '4223', '2006-02-16T02:30:53', '2005-08-20T00:35:30', '2005-08-21T20:51:30', '1'), + ('228', '1999', '2006-02-16T02:30:53', '2005-05-28T00:24:58', '2005-05-28T22:34:58', '1'), + ('228', '4456', '2006-02-16T02:30:53', '2005-07-06T10:51:48', '2005-07-11T06:08:48', '1'), + ('228', '3140', '2006-02-16T02:30:53', '2005-07-09T16:23:32', '2005-07-18T18:16:32', '1'), + ('228', '628', '2006-02-16T02:30:53', '2005-07-28T20:37:56', '2005-07-30T18:26:56', '1'), + ('228', '2279', '2006-02-16T02:30:53', '2005-07-11T08:52:16', '2005-07-17T03:00:16', '1'), + ('228', '697', '2006-02-16T02:30:53', '2005-06-20T05:05:53', '2005-06-22T02:44:53', '1'), + ('228', '3170', '2006-02-16T02:30:53', '2005-05-31T09:39:56', '2005-06-05T10:23:56', '1'), + ('570', '2881', '2006-02-16T02:30:53', '2005-07-29T18:28:54', '2005-08-03T12:43:54', '2'), + ('96', '1123', '2006-02-16T02:30:53', '2005-07-10T03:12:08', '2005-07-14T03:09:08', '2'), + ('477', '1348', '2006-02-16T02:30:53', '2005-07-29T23:44:22', '2005-07-31T21:32:22', '2'), + ('435', '1487', '2006-02-16T02:30:53', '2005-08-17T10:57:40', '2005-08-24T06:48:40', '2'), + ('209', '1206', '2006-02-16T02:30:53', '2005-07-08T21:01:41', '2005-07-13T02:23:41', '2'), + ('330', '1954', '2006-02-16T02:30:53', '2005-05-30T19:12:06', '2005-06-09T00:02:06', '2'), + ('560', '3473', '2006-02-16T02:30:53', '2005-08-21T11:48:27', '2005-08-25T15:49:27', '2'), + ('491', '1179', '2006-02-16T02:30:53', '2005-07-28T03:20:47', '2005-08-06T06:07:47', '2'), + ('477', '208', '2006-02-16T02:30:53', '2005-06-18T08:33:23', '2005-06-27T10:01:23', '2'), + ('482', '3211', '2006-02-16T02:30:53', '2005-07-12T19:14:53', '2005-07-18T16:07:53', '2'), + ('171', '2332', '2006-02-16T02:30:53', '2005-08-21T18:06:32', '2005-08-30T13:19:32', '2'), + ('482', '4147', '2006-02-16T02:30:53', '2005-05-28T23:27:26', '2005-06-02T02:28:26', '2'), + ('489', '2535', '2006-02-16T02:30:53', '2005-08-21T11:24:11', '2005-08-29T13:13:11', '2'), + ('322', '1296', '2006-02-16T02:30:53', '2005-06-15T15:38:58', '2005-06-20T16:28:58', '2'), + ('577', '2746', '2006-02-16T02:30:53', '2005-08-19T14:55:58', '2005-08-27T11:35:58', '2'), + ('288', '2474', '2006-02-16T02:30:53', '2005-07-28T09:43:02', '2005-07-30T12:57:02', '2'), + ('138', '1513', '2006-02-16T02:30:53', '2005-08-22T07:41:08', '2005-08-24T03:15:08', '2'), + ('480', '3687', '2006-02-16T02:30:53', '2005-05-29T05:17:30', '2005-06-06T02:47:30', '2'), + ('476', '4322', '2006-02-16T02:30:53', '2005-06-18T23:43:58', '2005-06-20T19:26:58', '2'), + ('102', '3431', '2006-02-16T02:30:53', '2005-07-07T05:45:59', '2005-07-16T07:34:59', '2'), + ('202', '4253', '2006-02-16T02:30:53', '2005-07-28T00:13:58', '2005-08-06T05:36:58', '2'), + ('521', '4279', '2006-02-16T02:30:53', '2005-06-17T15:19:34', '2005-06-19T10:06:34', '2'), + ('250', '3109', '2006-02-16T02:30:53', '2005-08-22T01:12:14', '2005-08-27T23:24:14', '2'), + ('583', '3119', '2006-02-16T02:30:53', '2005-07-06T16:34:32', '2005-07-08T11:55:32', '2'), + ('589', '4494', '2006-02-16T02:30:53', '2005-08-21T21:04:42', '2005-08-22T19:55:42', '2'), + ('586', '2707', '2006-02-16T02:30:53', '2005-06-16T01:14:56', '2005-06-20T23:31:56', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['13111', '5505', '2308', '10573', '15441', '1330', '3560', '11111', '3338', '15950', '12305', '6659', '2698', '10899', '675', '3064', '2121', '6273', '9462', '14468', '1623', '13936', '12956', '958', '12034', '10518', '14662', '12926', '9386', '12412', '13304', '8212', '9374', '3298', '7320', '14989', '653', '4104', '13416', '5567', '9470', '44', '3895', '15143', '5178', '9888', '13515', '7335', '10587', '3096', '4986', '3073', '5333', '5518', '4953', '9996', '6226', '5560', '8659', '3128', '10806', '9674', '9567', '8198', '6293', '8354', '8803', '7315', '1050', '12106', '15007', '9587', '16014', '57', '1158', '4480', '4499', '11746', '14018', '13865', '14470', '13131', '3945', '7847', '2752', '13652', '6307', '11776', '7043', '2240', '8750', '15276', '8078', '2706', '7555', '8348', '5435', '6087', '503', '8793']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('26', '580', '2006-02-16T02:30:53', '2005-08-19T11:25:10', '2005-08-21T05:52:10', '2'), + ('253', '896', '2006-02-16T02:30:53', '2005-07-10T00:38:48', '2005-07-12T03:12:48', '2'), + ('1', '197', '2006-02-16T02:30:53', '2005-06-18T08:41:48', '2005-06-22T03:36:48', '2'), + ('585', '4252', '2006-02-16T02:30:53', '2005-08-01T13:27:24', '2005-08-04T15:09:24', '2'), + ('422', '258', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('587', '1219', '2006-02-16T02:30:53', '2005-06-15T11:29:17', '2005-06-24T13:36:17', '2'), + ('592', '888', '2006-02-16T02:30:53', '2005-07-06T02:51:37', '2005-07-10T01:35:37', '2'), + ('378', '334', '2006-02-16T02:30:53', '2005-08-02T08:21:27', '2005-08-06T07:48:27', '2'), + ('171', '2097', '2006-02-16T02:30:53', '2005-06-21T10:27:31', '2005-06-30T14:15:31', '2'), + ('280', '1374', '2006-02-16T02:30:53', '2005-08-23T19:09:39', '2005-08-31T17:03:39', '2'), + ('534', '4463', '2006-02-16T02:30:53', '2005-08-18T05:46:29', '2005-08-22T11:14:29', '2'), + ('134', '2285', '2006-02-16T02:30:53', '2005-07-12T11:18:05', '2005-07-16T16:45:05', '2'), + ('420', '3900', '2006-02-16T02:30:53', '2005-06-19T13:29:11', '2005-06-20T07:31:11', '2'), + ('29', '859', '2006-02-16T02:30:53', '2005-08-02T01:30:21', '2005-08-06T05:01:21', '2'), + ('338', '1273', '2006-02-16T02:30:53', '2005-05-28T22:22:44', '2005-06-01T02:57:44', '2'), + ('276', '2624', '2006-02-16T02:30:53', '2005-06-20T13:53:13', '2005-06-25T16:33:13', '2'), + ('467', '141', '2006-02-16T02:30:53', '2005-06-17T20:38:54', '2005-06-22T23:06:54', '2'), + ('152', '2403', '2006-02-16T02:30:53', '2005-07-11T16:08:41', '2005-07-14T16:41:41', '2'), + ('192', '4090', '2006-02-16T02:30:53', '2005-07-30T22:30:44', '2005-08-09T03:54:44', '2'), + ('224', '4168', '2006-02-16T02:30:53', '2005-08-21T13:07:10', '2005-08-30T19:05:10', '2'), + ('378', '4485', '2006-02-16T02:30:53', '2005-06-16T07:48:50', '2005-06-17T03:53:50', '2'), + ('364', '1731', '2006-02-16T02:30:53', '2005-08-20T17:22:35', '2005-08-23T20:07:35', '2'), + ('241', '3613', '2006-02-16T02:30:53', '2005-08-19T06:06:26', '2005-08-28T08:37:26', '2'), + ('186', '548', '2006-02-16T02:30:53', '2005-05-30T17:58:03', '2005-06-01T19:17:03', '2'), + ('321', '834', '2006-02-16T02:30:53', '2005-08-17T20:15:31', '2005-08-24T15:46:31', '2'), + ('556', '4444', '2006-02-16T02:30:53', '2005-08-01T11:44:08', '2005-08-07T07:58:08', '2'), + ('403', '2969', '2006-02-16T02:30:53', '2005-08-21T19:45:27', '2005-08-23T14:44:27', '2'), + ('336', '23', '2006-02-16T02:30:53', '2005-08-19T05:00:16', '2005-08-26T06:12:16', '2'), + ('189', '1123', '2006-02-16T02:30:53', '2005-07-30T19:26:21', '2005-08-05T21:00:21', '2'), + ('75', '1578', '2006-02-16T02:30:53', '2005-08-18T09:49:52', '2005-08-23T12:32:52', '2'), + ('405', '2979', '2006-02-16T02:30:53', '2005-08-19T18:56:32', '2005-08-23T20:04:32', '2'), + ('159', '1305', '2006-02-16T02:30:53', '2005-07-28T23:37:23', '2005-08-04T04:33:23', '2'), + ('302', '103', '2006-02-16T02:30:53', '2005-07-30T19:10:03', '2005-08-06T21:54:03', '2'), + ('492', '444', '2006-02-16T02:30:53', '2005-06-21T07:09:44', '2005-06-30T11:26:44', '2'), + ('241', '4348', '2006-02-16T02:30:53', '2005-07-27T13:33:35', '2005-07-31T13:22:35', '2'), + ('58', '1431', '2006-02-16T02:30:53', '2005-08-22T07:47:07', '2005-08-26T04:42:07', '2'), + ('327', '126', '2006-02-16T02:30:53', '2005-05-28T20:12:20', '2005-06-04T14:44:20', '2'), + ('338', '1066', '2006-02-16T02:30:53', '2005-07-07T06:25:41', '2005-07-13T04:18:41', '2'), + ('204', '1075', '2006-02-16T02:30:53', '2005-08-19T22:48:48', '2005-08-21T22:09:48', '2'), + ('147', '1616', '2006-02-16T02:30:53', '2005-07-10T03:36:46', '2005-07-15T23:22:46', '2'), + ('566', '3908', '2006-02-16T02:30:53', '2005-07-30T23:01:31', '2005-08-07T01:35:31', '2'), + ('207', '3098', '2006-02-16T02:30:53', '2005-05-25T05:53:23', '2005-05-29T10:56:23', '2'), + ('584', '145', '2006-02-16T02:30:53', '2005-07-06T19:04:24', '2005-07-15T17:48:24', '2'), + ('274', '1519', '2006-02-16T02:30:53', '2005-08-22T13:46:24', '2005-08-25T09:47:24', '2'), + ('167', '1750', '2006-02-16T02:30:53', '2005-07-09T09:59:52', '2005-07-18T13:01:52', '2'), + ('5', '4400', '2006-02-16T02:30:53', '2005-07-31T14:00:53', '2005-08-08T18:51:53', '2'), + ('194', '3438', '2006-02-16T02:30:53', '2005-08-20T02:29:47', '2005-08-23T08:12:47', '2'), + ('219', '1219', '2006-02-16T02:30:53', '2005-07-27T14:06:50', '2005-08-05T18:27:50', '2'), + ('521', '3000', '2006-02-16T02:30:53', '2005-08-01T14:03:38', '2005-08-08T19:59:38', '2'), + ('79', '3851', '2006-02-16T02:30:53', '2005-06-20T16:17:56', '2005-06-24T10:17:56', '2'), + ('589', '3517', '2006-02-16T02:30:53', '2005-07-09T00:44:33', '2005-07-09T19:45:33', '2'), + ('471', '3164', '2006-02-16T02:30:53', '2005-06-20T14:33:26', '2005-06-26T08:42:26', '2'), + ('419', '2142', '2006-02-16T02:30:53', '2005-07-09T16:59:38', '2005-07-16T17:23:38', '2'), + ('451', '3340', '2006-02-16T02:30:53', '2005-07-10T01:15:11', '2005-07-18T19:28:11', '2'), + ('168', '2460', '2006-02-16T02:30:53', '2005-07-08T23:09:48', '2005-07-11T02:08:48', '2'), + ('104', '3271', '2006-02-16T02:30:53', '2005-07-31T17:32:03', '2005-08-06T16:17:03', '2'), + ('134', '2758', '2006-02-16T02:30:53', '2005-07-11T13:48:11', '2005-07-15T17:18:11', '2'), + ('231', '720', '2006-02-16T02:30:53', '2005-07-10T03:13:24', '2005-07-19T06:03:24', '2'), + ('168', '558', '2006-02-16T02:30:53', '2005-07-29T15:26:31', '2005-08-06T19:05:31', '2'), + ('543', '189', '2006-02-16T02:30:53', '2005-06-20T18:41:47', '2005-06-24T20:54:47', '2'), + ('89', '3553', '2006-02-16T02:30:53', '2005-08-01T22:25:29', '2005-08-04T18:46:29', '2'), + ('297', '3213', '2006-02-16T02:30:53', '2005-07-31T06:36:53', '2005-08-06T02:50:53', '2'), + ('37', '3688', '2006-02-16T02:30:53', '2005-07-31T02:36:11', '2005-08-07T01:19:11', '2'), + ('356', '1767', '2006-02-16T02:30:53', '2005-07-28T23:08:05', '2005-08-06T00:43:05', '2'), + ('471', '4260', '2006-02-16T02:30:53', '2005-07-11T17:24:57', '2005-07-13T18:45:57', '2'), + ('579', '4476', '2006-02-16T02:30:53', '2005-07-29T04:56:26', '2005-08-01T08:04:26', '2'), + ('86', '2814', '2006-02-16T02:30:53', '2005-07-29T21:26:24', '2005-08-06T18:05:24', '2'), + ('208', '974', '2006-02-16T02:30:53', '2005-07-27T13:14:56', '2005-08-03T08:44:56', '2'), + ('303', '726', '2006-02-16T02:30:53', '2005-05-31T07:01:27', '2005-06-03T07:50:27', '2'), + ('465', '3234', '2006-02-16T02:30:53', '2005-08-17T22:55:32', '2005-08-19T23:55:32', '2'), + ('165', '3692', '2006-02-16T02:30:53', '2005-08-22T08:21:21', '2005-08-27T04:44:21', '2'), + ('235', '2966', '2006-02-16T02:30:53', '2005-07-31T03:10:30', '2005-08-06T06:54:30', '2'), + ('532', '3322', '2006-02-16T02:30:53', '2005-08-23T21:18:31', '2005-08-31T17:28:31', '2'), + ('6', '3938', '2006-02-16T02:30:53', '2005-05-25T08:43:32', '2005-05-29T06:42:32', '2'), + ('416', '1632', '2006-02-16T02:30:53', '2005-06-14T22:53:33', '2005-06-18T21:37:33', '2'), + ('296', '4457', '2006-02-16T02:30:53', '2005-07-08T00:56:30', '2005-07-10T20:52:30', '2'), + ('199', '851', '2006-02-16T02:30:53', '2005-07-08T02:08:48', '2005-07-10T07:06:48', '2'), + ('299', '4571', '2006-02-16T02:30:53', '2005-08-17T09:03:24', '2005-08-25T06:08:24', '2'), + ('533', '2136', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('275', '3647', '2006-02-16T02:30:53', '2005-08-20T15:04:09', '2005-08-24T10:06:09', '2'), + ('379', '3899', '2006-02-16T02:30:53', '2005-08-21T13:09:41', '2005-08-23T10:20:41', '2'), + ('480', '1466', '2006-02-16T02:30:53', '2005-08-19T12:08:13', '2005-08-27T13:43:13', '2'), + ('86', '754', '2006-02-16T02:30:53', '2005-07-06T21:35:00', '2005-07-08T00:31:00', '2'), + ('323', '3602', '2006-02-16T02:30:53', '2005-07-28T09:23:14', '2005-08-02T11:02:14', '2'), + ('149', '386', '2006-02-16T02:30:53', '2005-06-19T16:44:18', '2005-06-22T12:40:18', '2'), + ('67', '2548', '2006-02-16T02:30:53', '2005-08-20T07:52:34', '2005-08-23T08:58:34', '2'), + ('345', '4029', '2006-02-16T02:30:53', '2005-07-11T18:04:29', '2005-07-17T23:40:29', '2'), + ('306', '2400', '2006-02-16T02:30:53', '2005-08-17T10:27:19', '2005-08-20T14:02:19', '2'), + ('493', '3422', '2006-02-16T02:30:53', '2005-07-27T03:24:23', '2005-08-05T02:55:23', '2'), + ('122', '1409', '2006-02-16T02:30:53', '2005-06-18T04:28:27', '2005-06-22T07:48:27', '2'), + ('158', '3157', '2006-02-16T02:30:53', '2005-07-29T19:14:21', '2005-07-31T17:22:21', '2'), + ('490', '4523', '2006-02-16T02:30:53', '2005-08-22T18:59:01', '2005-08-23T19:49:01', '2'), + ('407', '3839', '2006-02-16T02:30:53', '2005-07-28T17:54:42', '2005-07-30T18:18:42', '2'), + ('559', '373', '2006-02-16T02:30:53', '2005-06-19T13:56:51', '2005-06-21T17:23:51', '2'), + ('533', '3421', '2006-02-16T02:30:53', '2005-07-27T22:17:05', '2005-08-02T02:50:05', '2'), + ('174', '4533', '2006-02-16T02:30:53', '2005-07-29T04:49:26', '2005-08-05T03:26:26', '2'), + ('273', '2884', '2006-02-16T02:30:53', '2005-07-09T21:28:07', '2005-07-18T21:16:07', '2'), + ('155', '198', '2006-02-16T02:30:53', '2005-07-11T05:29:22', '2005-07-12T23:33:22', '2'), + ('288', '3005', '2006-02-16T02:30:53', '2005-05-28T01:35:25', '2005-05-28T22:12:25', '2'), + ('167', '1819', '2006-02-16T02:30:53', '2005-07-29T20:57:22', '2005-08-02T01:40:22', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['1034', '6205', '13582', '3070', '9444', '8258', '6998', '3608', '1505', '3934', '13067', '13270', '12100', '8998', '10073', '11758', '4535', '5467', '9923', '13815', '12285', '8729', '14899', '6359', '11175', '15615', '4659', '12074', '8305', '3457', '4910', '3776', '8225', '4668', '6875', '9163', '12407', '13205', '12351', '12382', '1959', '9794', '14576', '4641', '8154', '5794', '13224', '8036', '1930', '14425', '11441', '10493', '8104', '2106', '12048', '14512', '11805', '8475', '15513', '3558', '930', '12565', '14396', '488', '2566', '8765', '10865', '8852', '15994', '12027', '15784', '10491', '14663', '10893', '4639', '9051', '6871', '12612', '8959', '10780', '3202', '14697', '6346', '14793', '5466', '414', '2850', '6862', '457', '15877', '14918', '11405', '15987', '4845', '3105', '14465', '1953', '8246', '15488', '619']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('293', '4117', '2006-02-16T02:30:53', '2005-05-31T04:53:40', '2005-06-09T08:25:40', '2'), + ('303', '3442', '2006-02-16T02:30:53', '2005-07-11T12:31:24', '2005-07-13T11:31:24', '2'), + ('166', '211', '2006-02-16T02:30:53', '2005-08-20T05:28:11', '2005-08-23T02:06:11', '2'), + ('543', '3860', '2006-02-16T02:30:53', '2005-06-20T14:15:39', '2005-06-25T12:52:39', '2'), + ('259', '1134', '2006-02-16T02:30:53', '2005-07-30T21:48:44', '2005-08-08T22:36:44', '2'), + ('370', '1379', '2006-02-16T02:30:53', '2005-07-29T01:03:42', '2005-08-04T22:08:42', '2'), + ('300', '788', '2006-02-16T02:30:53', '2005-07-27T01:16:29', '2005-07-30T05:50:29', '2'), + ('368', '3095', '2006-02-16T02:30:53', '2005-07-06T05:35:39', '2005-07-10T07:46:39', '2'), + ('561', '2961', '2006-02-16T02:30:53', '2005-06-15T22:12:50', '2005-06-17T21:37:50', '2'), + ('576', '3187', '2006-02-16T02:30:53', '2005-07-06T21:07:23', '2005-07-10T18:20:23', '2'), + ('172', '3825', '2006-02-16T02:30:53', '2005-08-19T09:51:17', '2005-08-25T09:58:17', '2'), + ('159', '405', '2006-02-16T02:30:53', '2005-08-19T17:41:16', '2005-08-23T20:22:16', '2'), + ('391', '4365', '2006-02-16T02:30:53', '2005-08-17T22:41:10', '2005-08-24T21:31:10', '2'), + ('120', '1573', '2006-02-16T02:30:53', '2005-07-30T04:54:14', '2005-08-08T08:18:14', '2'), + ('584', '4246', '2006-02-16T02:30:53', '2005-07-31T19:53:15', '2005-08-05T23:12:15', '2'), + ('533', '11', '2006-02-16T02:30:53', '2005-08-17T09:33:02', '2005-08-24T05:03:02', '2'), + ('29', '561', '2006-02-16T02:30:53', '2005-07-08T03:40:46', '2005-07-13T06:53:46', '2'), + ('543', '374', '2006-02-16T02:30:53', '2005-07-09T23:05:47', '2005-07-16T17:06:47', '2'), + ('209', '1635', '2006-02-16T02:30:53', '2005-07-31T15:00:15', '2005-08-05T11:09:15', '2'), + ('582', '3388', '2006-02-16T02:30:53', '2005-08-20T13:08:53', '2005-08-29T13:11:53', '2'), + ('215', '3531', '2006-02-16T02:30:53', '2005-08-18T04:56:43', '2005-08-19T23:32:43', '2'), + ('83', '3342', '2006-02-16T02:30:53', '2005-07-29T18:23:02', '2005-07-31T16:09:02', '2'), + ('304', '3700', '2006-02-16T02:30:53', '2005-08-22T04:26:38', '2005-08-31T08:36:38', '2'), + ('30', '1656', '2006-02-16T02:30:53', '2005-07-11T21:06:17', '2005-07-16T02:51:17', '2'), + ('164', '85', '2006-02-16T02:30:53', '2005-08-02T10:38:47', '2005-08-07T07:11:47', '2'), + ('584', '899', '2006-02-16T02:30:53', '2005-08-23T07:06:00', '2005-08-30T11:21:00', '2'), + ('425', '4389', '2006-02-16T02:30:53', '2005-07-08T09:53:28', '2005-07-14T14:56:28', '2'), + ('417', '711', '2006-02-16T02:30:53', '2005-08-17T21:50:57', '2005-08-20T00:58:57', '2'), + ('566', '3916', '2006-02-16T02:30:53', '2005-07-29T03:08:47', '2005-08-06T07:49:47', '2'), + ('312', '883', '2006-02-16T02:30:53', '2005-06-21T21:42:33', '2005-06-30T19:54:33', '2'), + ('219', '3675', '2006-02-16T02:30:53', '2005-07-08T21:13:56', '2005-07-18T02:39:56', '2'), + ('278', '4387', '2006-02-16T02:30:53', '2005-07-06T13:31:37', '2005-07-10T10:53:37', '2'), + ('41', '3631', '2006-02-16T02:30:53', '2005-07-28T23:59:29', '2005-07-30T03:27:29', '2'), + ('481', '3971', '2006-02-16T02:30:53', '2005-07-08T10:11:45', '2005-07-17T13:01:45', '2'), + ('172', '3420', '2006-02-16T02:30:53', '2005-07-12T20:23:05', '2005-07-19T00:09:05', '2'), + ('345', '4562', '2006-02-16T02:30:53', '2005-07-30T11:23:22', '2005-07-31T07:34:22', '2'), + ('220', '391', '2006-02-16T02:30:53', '2005-08-18T09:39:26', '2005-08-24T05:19:26', '2'), + ('495', '2616', '2006-02-16T02:30:53', '2005-08-19T15:05:26', '2005-08-25T10:41:26', '2'), + ('95', '2299', '2006-02-16T02:30:53', '2005-08-18T07:32:12', '2005-08-24T04:29:12', '2'), + ('566', '3049', '2006-02-16T02:30:53', '2005-08-18T08:32:33', '2005-08-26T03:45:33', '2'), + ('554', '1464', '2006-02-16T02:30:53', '2005-06-17T08:54:10', '2005-06-20T05:02:10', '2'), + ('403', '1771', '2006-02-16T02:30:53', '2005-07-31T10:47:01', '2005-08-02T06:52:01', '2'), + ('45', '1189', '2006-02-16T02:30:53', '2005-08-21T16:52:03', '2005-08-28T19:43:03', '2'), + ('26', '2436', '2006-02-16T02:30:53', '2005-07-08T09:09:46', '2005-07-17T03:54:46', '2'), + ('285', '1180', '2006-02-16T02:30:53', '2005-07-28T20:56:18', '2005-08-01T21:56:18', '2'), + ('198', '1164', '2006-02-16T02:30:53', '2005-07-10T14:34:53', '2005-07-17T11:50:53', '2'), + ('526', '3086', '2006-02-16T02:30:53', '2005-08-19T15:52:13', '2005-08-28T20:53:13', '2'), + ('412', '2741', '2006-02-16T02:30:53', '2005-07-28T16:27:43', '2005-08-01T13:41:43', '2'), + ('112', '79', '2006-02-16T02:30:53', '2005-06-17T06:50:46', '2005-06-19T08:51:46', '2'), + ('560', '2752', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('389', '1027', '2006-02-16T02:30:53', '2005-08-02T20:25:41', '2005-08-05T00:05:41', '2'), + ('285', '2375', '2006-02-16T02:30:53', '2005-08-01T10:43:12', '2005-08-07T08:13:12', '2'), + ('533', '1080', '2006-02-16T02:30:53', '2005-07-28T18:59:36', '2005-08-03T22:05:36', '2'), + ('66', '643', '2006-02-16T02:30:53', '2005-06-17T19:29:03', '2005-06-23T18:17:03', '2'), + ('466', '3773', '2006-02-16T02:30:53', '2005-08-17T20:49:24', '2005-08-27T02:01:24', '2'), + ('51', '579', '2006-02-16T02:30:53', '2005-08-21T14:47:09', '2005-08-24T18:10:09', '2'), + ('208', '1208', '2006-02-16T02:30:53', '2005-08-17T11:48:47', '2005-08-26T11:06:47', '2'), + ('260', '3695', '2006-02-16T02:30:53', '2005-07-29T08:37:41', '2005-08-04T10:03:41', '2'), + ('147', '3779', '2006-02-16T02:30:53', '2005-08-23T03:01:56', '2005-08-24T23:46:56', '2'), + ('575', '1742', '2006-02-16T02:30:53', '2005-07-06T02:49:06', '2005-07-15T01:38:06', '2'), + ('141', '2835', '2006-02-16T02:30:53', '2005-05-30T12:44:57', '2005-06-04T10:53:57', '2'), + ('211', '1284', '2006-02-16T02:30:53', '2005-08-18T15:12:17', '2005-08-19T12:26:17', '2'), + ('353', '3855', '2006-02-16T02:30:53', '2005-08-21T10:24:54', '2005-08-22T04:49:54', '2'), + ('168', '393', '2006-02-16T02:30:53', '2005-05-28T00:07:50', '2005-06-03T22:30:50', '2'), + ('486', '495', '2006-02-16T02:30:53', '2005-06-19T03:45:39', '2005-06-25T08:43:39', '2'), + ('538', '2631', '2006-02-16T02:30:53', '2005-07-29T19:40:08', '2005-07-31T14:24:08', '2'), + ('201', '1485', '2006-02-16T02:30:53', '2005-08-02T00:22:46', '2005-08-09T05:08:46', '2'), + ('42', '1138', '2006-02-16T02:30:53', '2005-07-29T23:30:03', '2005-08-05T05:22:03', '2'), + ('595', '438', '2006-02-16T02:30:53', '2005-08-23T20:29:10', '2005-08-28T01:41:10', '2'), + ('285', '45', '2006-02-16T02:30:53', '2005-08-17T20:01:12', '2005-08-26T21:08:12', '2'), + ('425', '126', '2006-02-16T02:30:53', '2005-08-23T13:46:00', '2005-08-30T11:49:00', '2'), + ('24', '3091', '2006-02-16T02:30:53', '2005-08-01T10:38:27', '2005-08-04T04:55:27', '2'), + ('150', '2351', '2006-02-16T02:30:53', '2005-08-21T19:47:55', '2005-08-27T17:36:55', '2'), + ('306', '2529', '2006-02-16T02:30:53', '2005-08-02T01:12:13', '2005-08-11T05:53:13', '2'), + ('75', '2459', '2006-02-16T02:30:53', '2005-07-08T08:57:21', '2005-07-14T11:22:21', '2'), + ('337', '1847', '2006-02-16T02:30:53', '2005-07-30T07:05:54', '2005-08-07T09:12:54', '2'), + ('204', '3612', '2006-02-16T02:30:53', '2005-07-12T20:13:49', '2005-07-14T20:11:49', '2'), + ('129', '1035', '2006-02-16T02:30:53', '2005-08-18T17:10:05', '2005-08-26T15:55:05', '2'), + ('550', '3508', '2006-02-16T02:30:53', '2005-07-30T03:35:49', '2005-08-06T02:02:49', '2'), + ('51', '1450', '2006-02-16T02:30:53', '2005-08-01T21:14:24', '2005-08-07T16:32:24', '2'), + ('273', '2725', '2006-02-16T02:30:53', '2005-06-21T00:33:47', '2005-06-24T04:05:47', '2'), + ('409', '48', '2006-02-16T02:30:53', '2005-08-21T20:49:21', '2005-08-26T01:39:21', '2'), + ('445', '4066', '2006-02-16T02:30:53', '2005-07-11T20:08:34', '2005-07-16T16:35:34', '2'), + ('154', '4285', '2006-02-16T02:30:53', '2005-08-22T00:37:57', '2005-08-29T05:44:57', '2'), + ('482', '2302', '2006-02-16T02:30:53', '2005-07-09T23:03:21', '2005-07-10T20:11:21', '2'), + ('219', '1019', '2006-02-16T02:30:53', '2005-05-27T14:48:20', '2005-05-31T14:39:20', '2'), + ('262', '206', '2006-02-16T02:30:53', '2005-06-19T23:06:28', '2005-06-28T03:30:28', '2'), + ('231', '3477', '2006-02-16T02:30:53', '2005-07-12T19:58:09', '2005-07-18T15:48:09', '2'), + ('300', '2368', '2006-02-16T02:30:53', '2005-05-27T19:52:29', '2005-06-02T17:17:29', '2'), + ('559', '2307', '2006-02-16T02:30:53', '2005-08-23T16:33:33', '2005-08-26T10:36:33', '2'), + ('154', '4056', '2006-02-16T02:30:53', '2005-08-22T05:06:38', '2005-08-30T01:44:38', '2'), + ('10', '418', '2006-02-16T02:30:53', '2005-08-02T19:13:39', '2005-08-07T19:19:39', '2'), + ('302', '3150', '2006-02-16T02:30:53', '2005-08-23T20:22:17', '2005-08-31T21:46:17', '2'), + ('553', '2337', '2006-02-16T02:30:53', '2005-07-08T18:28:20', '2005-07-09T14:38:20', '2'), + ('385', '130', '2006-02-16T02:30:53', '2005-06-20T17:11:46', '2005-06-21T11:48:46', '2'), + ('262', '4206', '2006-02-16T02:30:53', '2005-08-21T12:54:22', '2005-08-28T10:46:22', '2'), + ('405', '3549', '2006-02-16T02:30:53', '2005-06-17T08:34:57', '2005-06-24T09:38:57', '2'), + ('146', '1724', '2006-02-16T02:30:53', '2005-07-29T00:38:41', '2005-08-05T06:28:41', '2'), + ('385', '4535', '2006-02-16T02:30:53', '2005-08-23T02:06:01', '2005-08-29T21:35:01', '2'), + ('407', '2482', '2006-02-16T02:30:53', '2005-05-28T15:52:26', '2005-06-06T17:55:26', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['10550', '15724', '11012', '8425', '10082', '10498', '1815', '13078', '15451', '11573', '14444', '2676', '15942', '5273', '333', '10544', '7015', '9905', '12154', '4537', '9379', '471', '358', '13290', '12617', '3133', '885', '5359', '8047', '11499', '2003', '6791', '10950', '4552', '3967', '8153', '4493', '562', '7915', '10161', '14383', '11488', '10944', '4831', '9609', '14370', '1781', '3477', '2936', '9746', '4039', '13919', '11798', '9607', '4094', '6564', '10790', '9353', '8365', '8702', '1702', '9253', '3374', '12979', '15450', '11891', '783', '14905', '612', '12405', '5442', '8308', '7576', '6629', '7228', '4168', '9094', '81', '12191', '106', '8888', '3532', '2527', '14234', '8598', '3146', '8851', '7659', '14479', '9067', '879', '3549', '7530', '6149', '120', '734', '9286', '9046', '8405', '12828']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('129', '1980', '2006-02-16T02:30:53', '2005-08-01T12:46:52', '2005-08-05T16:48:52', '2'), + ('478', '1025', '2006-02-16T02:30:53', '2005-08-23T11:22:09', '2005-08-28T12:56:09', '2'), + ('162', '542', '2006-02-16T02:30:53', '2005-08-02T05:09:42', '2005-08-05T07:22:42', '2'), + ('486', '3491', '2006-02-16T02:30:53', '2005-07-29T07:06:21', '2005-08-05T07:57:21', '2'), + ('76', '1275', '2006-02-16T02:30:53', '2005-07-31T20:09:32', '2005-08-01T15:41:32', '2'), + ('355', '2672', '2006-02-16T02:30:53', '2005-08-01T10:56:48', '2005-08-03T15:46:48', '2'), + ('84', '1551', '2006-02-16T02:30:53', '2005-06-16T21:16:07', '2005-06-17T16:37:07', '2'), + ('479', '4104', '2006-02-16T02:30:53', '2005-08-19T10:16:43', '2005-08-27T11:35:43', '2'), + ('514', '231', '2006-02-16T02:30:53', '2005-08-23T00:56:27', '2005-08-24T00:15:27', '2'), + ('146', '639', '2006-02-16T02:30:53', '2005-08-17T01:38:18', '2005-08-19T05:06:18', '2'), + ('225', '2211', '2006-02-16T02:30:53', '2005-08-21T12:07:25', '2005-08-28T08:36:25', '2'), + ('477', '3938', '2006-02-16T02:30:53', '2005-06-19T11:54:57', '2005-06-24T15:34:57', '2'), + ('210', '1096', '2006-02-16T02:30:53', '2005-08-23T18:48:40', '2005-09-01T18:39:40', '2'), + ('38', '4570', '2006-02-16T02:30:53', '2005-07-09T14:31:24', '2005-07-14T13:27:24', '2'), + ('412', '4001', '2006-02-16T02:30:53', '2005-05-27T02:52:21', '2005-06-01T00:55:21', '2'), + ('589', '3195', '2006-02-16T02:30:53', '2005-08-01T12:36:21', '2005-08-07T12:25:21', '2'), + ('34', '376', '2006-02-16T02:30:53', '2005-07-27T02:15:01', '2005-07-28T07:46:01', '2'), + ('519', '2839', '2006-02-16T02:30:53', '2005-07-31T14:37:03', '2005-08-01T15:55:03', '2'), + ('163', '2491', '2006-02-16T02:30:53', '2005-08-18T00:23:56', '2005-08-21T00:31:56', '2'), + ('448', '1305', '2006-02-16T02:30:53', '2005-07-08T03:48:40', '2005-07-13T22:54:40', '2'), + ('452', '3855', '2006-02-16T02:30:53', '2005-07-30T19:13:01', '2005-08-07T19:18:01', '2'), + ('209', '2872', '2006-02-16T02:30:53', '2005-05-27T21:32:42', '2005-05-31T00:39:42', '2'), + ('102', '1925', '2006-02-16T02:30:53', '2005-05-27T06:43:59', '2005-05-29T11:28:59', '2'), + ('23', '4174', '2006-02-16T02:30:53', '2005-08-19T18:31:50', '2005-08-25T15:49:50', '2'), + ('564', '3573', '2006-02-16T02:30:53', '2005-08-18T17:22:48', '2005-08-24T17:40:48', '2'), + ('120', '4529', '2006-02-16T02:30:53', '2005-06-20T19:18:32', '2005-06-26T17:54:32', '2'), + ('62', '646', '2006-02-16T02:30:53', '2005-05-30T06:54:28', '2005-06-03T07:03:28', '2'), + ('453', '4392', '2006-02-16T02:30:53', '2005-07-09T18:10:52', '2005-07-18T13:34:52', '2'), + ('292', '2936', '2006-02-16T02:30:53', '2005-07-28T16:49:43', '2005-08-03T14:48:43', '2'), + ('172', '3857', '2006-02-16T02:30:53', '2005-08-16T22:54:12', '2005-08-24T03:37:12', '2'), + ('515', '1581', '2006-02-16T02:30:53', '2005-06-17T11:40:35', '2005-06-19T08:30:35', '2'), + ('144', '1495', '2006-02-16T02:30:53', '2005-07-12T16:35:07', '2005-07-20T15:32:07', '2'), + ('451', '707', '2006-02-16T02:30:53', '2005-08-02T03:25:08', '2005-08-07T23:11:08', '2'), + ('313', '2549', '2006-02-16T02:30:53', '2005-07-08T04:36:35', '2005-07-14T05:48:35', '2'), + ('31', '2510', '2006-02-16T02:30:53', '2005-07-06T22:45:10', '2005-07-09T23:54:10', '2'), + ('347', '2173', '2006-02-16T02:30:53', '2005-07-28T20:55:49', '2005-08-01T15:56:49', '2'), + ('167', '1369', '2006-02-16T02:30:53', '2005-07-08T01:40:24', '2005-07-09T02:17:24', '2'), + ('102', '3390', '2006-02-16T02:30:53', '2005-05-28T09:01:21', '2005-06-02T05:26:21', '2'), + ('186', '2088', '2006-02-16T02:30:53', '2005-07-28T11:49:46', '2005-08-04T12:21:46', '2'), + ('120', '2651', '2006-02-16T02:30:53', '2005-07-31T23:09:41', '2005-08-02T20:46:41', '2'), + ('482', '1941', '2006-02-16T02:30:53', '2005-08-21T10:02:05', '2005-08-24T12:21:05', '2'), + ('45', '2520', '2006-02-16T02:30:53', '2005-08-02T22:35:15', '2005-08-09T00:28:15', '2'), + ('470', '2373', '2006-02-16T02:30:53', '2005-08-02T03:20:03', '2005-08-04T04:13:03', '2'), + ('243', '2739', '2006-02-16T02:30:53', '2005-07-08T18:00:14', '2005-07-12T15:54:14', '2'), + ('112', '693', '2006-02-16T02:30:53', '2005-07-31T03:53:24', '2005-08-05T08:32:24', '2'), + ('161', '3520', '2006-02-16T02:30:53', '2005-08-21T09:35:14', '2005-08-27T05:21:14', '2'), + ('429', '2841', '2006-02-16T02:30:53', '2005-06-16T19:20:24', '2005-06-25T17:02:24', '2'), + ('476', '4289', '2006-02-16T02:30:53', '2005-07-05T23:05:17', '2005-07-15T02:20:17', '2'), + ('330', '2675', '2006-02-16T02:30:53', '2005-06-20T05:09:27', '2005-06-26T10:16:27', '2'), + ('308', '1459', '2006-02-16T02:30:53', '2005-07-31T09:16:48', '2005-08-07T06:36:48', '2'), + ('290', '4050', '2006-02-16T02:30:53', '2005-07-07T02:57:59', '2005-07-12T03:44:59', '2'), + ('129', '909', '2006-02-16T02:30:53', '2005-08-20T16:47:34', '2005-08-23T21:27:34', '2'), + ('448', '3974', '2006-02-16T02:30:53', '2005-08-17T11:21:43', '2005-08-25T07:43:43', '2'), + ('294', '3414', '2006-02-16T02:30:53', '2005-07-31T03:51:06', '2005-08-02T00:18:06', '2'), + ('517', '2412', '2006-02-16T02:30:53', '2005-07-07T06:00:21', '2005-07-10T03:24:21', '2'), + ('210', '2320', '2006-02-16T02:30:53', '2005-07-12T05:34:44', '2005-07-18T06:12:44', '2'), + ('274', '3080', '2006-02-16T02:30:53', '2005-08-01T21:38:37', '2005-08-08T17:20:37', '2'), + ('283', '3581', '2006-02-16T02:30:53', '2005-07-30T18:30:37', '2005-08-06T22:32:37', '2'), + ('280', '53', '2006-02-16T02:30:53', '2005-07-29T05:11:00', '2005-07-30T05:30:00', '2'), + ('306', '2215', '2006-02-16T02:30:53', '2005-07-29T17:04:37', '2005-08-05T15:30:37', '2'), + ('242', '1822', '2006-02-16T02:30:53', '2005-06-16T13:21:05', '2005-06-19T10:13:05', '2'), + ('151', '4183', '2006-02-16T02:30:53', '2005-07-30T14:20:12', '2005-07-31T11:31:12', '2'), + ('279', '1067', '2006-02-16T02:30:53', '2005-06-21T13:36:30', '2005-06-23T15:10:30', '2'), + ('267', '1227', '2006-02-16T02:30:53', '2005-08-19T07:00:35', '2005-08-21T06:12:35', '2'), + ('322', '1102', '2006-02-16T02:30:53', '2005-08-23T00:56:01', '2005-08-24T01:00:01', '2'), + ('115', '2619', '2006-02-16T02:30:53', '2005-08-17T15:11:55', '2005-08-22T11:11:55', '2'), + ('53', '3046', '2006-02-16T02:30:53', '2005-05-29T14:41:18', '2005-06-06T10:39:18', '2'), + ('286', '4166', '2006-02-16T02:30:53', '2005-08-22T04:34:22', '2005-08-26T04:00:22', '2'), + ('161', '2180', '2006-02-16T02:30:53', '2005-05-28T15:24:54', '2005-05-30T14:22:54', '2'), + ('266', '228', '2006-02-16T02:30:53', '2005-08-18T09:37:30', '2005-08-27T13:11:30', '2'), + ('29', '3093', '2006-02-16T02:30:53', '2005-07-09T21:55:19', '2005-07-19T01:18:19', '2'), + ('582', '601', '2006-02-16T02:30:53', '2005-07-29T03:22:15', '2005-08-04T21:38:15', '2'), + ('446', '3374', '2006-02-16T02:30:53', '2005-07-27T22:54:35', '2005-08-03T03:53:35', '2'), + ('582', '2855', '2006-02-16T02:30:53', '2005-07-12T09:18:35', '2005-07-20T11:34:35', '2'), + ('481', '1693', '2006-02-16T02:30:53', '2005-07-27T09:55:33', '2005-07-29T04:33:33', '2'), + ('132', '1872', '2006-02-16T02:30:53', '2005-07-07T09:37:24', '2005-07-09T14:32:24', '2'), + ('140', '2699', '2006-02-16T02:30:53', '2005-07-30T08:35:10', '2005-08-07T08:18:10', '2'), + ('286', '2610', '2006-02-16T02:30:53', '2005-05-25T12:15:19', '2005-06-02T14:08:19', '2'), + ('316', '2667', '2006-02-16T02:30:53', '2005-08-18T01:57:11', '2005-08-22T22:53:11', '2'), + ('196', '3627', '2006-02-16T02:30:53', '2005-05-25T18:18:19', '2005-06-04T00:01:19', '2'), + ('284', '2824', '2006-02-16T02:30:53', '2005-07-30T00:39:36', '2005-08-01T02:28:36', '2'), + ('274', '2635', '2006-02-16T02:30:53', '2005-07-06T01:24:38', '2005-07-11T06:42:38', '2'), + ('463', '387', '2006-02-16T02:30:53', '2005-06-19T01:10:31', '2005-06-20T05:37:31', '2'), + ('271', '1439', '2006-02-16T02:30:53', '2005-08-21T05:07:12', '2005-08-23T06:44:12', '2'), + ('2', '626', '2006-02-16T02:30:53', '2005-07-29T12:56:59', '2005-08-01T08:39:59', '2'), + ('339', '2249', '2006-02-16T02:30:53', '2005-06-20T20:21:48', '2005-06-29T22:57:48', '2'), + ('445', '212', '2006-02-16T02:30:53', '2005-07-29T23:26:19', '2005-08-05T03:59:19', '2'), + ('584', '1622', '2006-02-16T02:30:53', '2005-07-28T02:09:45', '2005-08-02T05:34:45', '2'), + ('324', '2235', '2006-02-16T02:30:53', '2005-08-21T13:35:54', '2005-08-29T12:12:54', '2'), + ('382', '3628', '2006-02-16T02:30:53', '2005-07-30T07:31:01', '2005-08-04T11:44:01', '2'), + ('482', '4021', '2006-02-16T02:30:53', '2005-05-30T05:49:42', '2005-06-05T01:45:42', '2'), + ('19', '3921', '2006-02-16T02:30:53', '2005-07-06T02:24:55', '2005-07-06T21:40:55', '2'), + ('98', '3810', '2006-02-16T02:30:53', '2005-07-27T21:18:58', '2005-07-31T01:51:58', '2'), + ('26', '4337', '2006-02-16T02:30:53', '2005-07-11T09:19:31', '2005-07-17T14:45:31', '2'), + ('365', '37', '2006-02-16T02:30:53', '2005-05-25T19:37:47', '2005-06-01T23:29:47', '2'), + ('538', '3084', '2006-02-16T02:30:53', '2005-05-29T07:38:52', '2005-06-03T10:17:52', '2'), + ('154', '2477', '2006-02-16T02:30:53', '2005-07-30T15:32:28', '2005-07-31T20:42:28', '2'), + ('215', '1736', '2006-02-16T02:30:53', '2005-07-30T06:46:55', '2005-08-01T02:21:55', '2'), + ('76', '2164', '2006-02-16T02:30:53', '2005-07-29T06:28:19', '2005-08-07T08:14:19', '2'), + ('378', '4208', '2006-02-16T02:30:53', '2005-08-19T01:37:47', '2005-08-24T22:31:47', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['1599', '6271', '4152', '12467', '3273', '6114', '10216', '1132', '11150', '3317', '8920', '7936', '4069', '2576', '9541', '1010', '15369', '15128', '14871', '15870', '10112', '5348', '6185', '2036', '10940', '602', '15509', '4011', '10609', '10924', '12209', '771', '3359', '12738', '3550', '400', '73', '15866', '11082', '9698', '92', '5416', '3340', '14889', '12164', '4774', '744', '7562', '9984', '1441', '8936', '11972', '7781', '2056', '14823', '8299', '11020', '7954', '5644', '2375', '14548', '3900', '11262', '5371', '1937', '1231', '12167', '2622', '4517', '9631', '14124', '11508', '2756', '1502', '3605', '10084', '1951', '11387', '784', '4225', '15396', '3447', '15063', '2869', '3334', '14778', '11396', '11442', '12025', '15391', '12680', '11425', '4489', '13422', '5506', '3482', '2302', '9961', '1259', '3106']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('215', '1476', '2006-02-16T02:30:53', '2005-06-16T06:03:33', '2005-06-21T07:46:33', '2'), + ('467', '1246', '2006-02-16T02:30:53', '2005-07-11T16:01:35', '2005-07-20T12:07:35', '2'), + ('89', '1761', '2006-02-16T02:30:53', '2005-07-07T08:50:33', '2005-07-14T10:56:33', '2'), + ('212', '1414', '2006-02-16T02:30:53', '2005-08-18T11:40:09', '2005-08-19T13:33:09', '2'), + ('104', '3538', '2006-02-16T02:30:53', '2005-06-21T05:24:17', '2005-06-23T01:21:17', '2'), + ('404', '479', '2006-02-16T02:30:53', '2005-07-11T07:33:48', '2005-07-18T06:13:48', '2'), + ('436', '3603', '2006-02-16T02:30:53', '2005-08-01T01:06:27', '2005-08-08T22:41:27', '2'), + ('198', '1763', '2006-02-16T02:30:53', '2005-05-31T18:44:53', '2005-06-07T22:02:53', '2'), + ('527', '2193', '2006-02-16T02:30:53', '2005-08-02T09:51:46', '2005-08-05T09:03:46', '2'), + ('584', '4095', '2006-02-16T02:30:53', '2005-06-21T08:22:32', '2005-06-26T14:18:32', '2'), + ('78', '4079', '2006-02-16T02:30:53', '2005-07-30T01:59:24', '2005-08-02T22:37:24', '2'), + ('520', '563', '2006-02-16T02:30:53', '2005-07-28T12:33:21', '2005-07-30T13:31:21', '2'), + ('570', '3361', '2006-02-16T02:30:53', '2005-07-07T04:35:06', '2005-07-10T23:59:06', '2'), + ('559', '2928', '2006-02-16T02:30:53', '2005-06-19T04:34:15', '2005-06-28T10:02:15', '2'), + ('422', '1774', '2006-02-16T02:30:53', '2005-07-31T01:40:14', '2005-08-05T06:34:14', '2'), + ('49', '4038', '2006-02-16T02:30:53', '2005-05-31T01:57:32', '2005-06-01T06:50:32', '2'), + ('121', '881', '2006-02-16T02:30:53', '2005-08-22T21:58:06', '2005-08-26T00:27:06', '2'), + ('457', '3229', '2006-02-16T02:30:53', '2005-08-22T12:57:26', '2005-08-30T11:35:26', '2'), + ('204', '3411', '2006-02-16T02:30:53', '2005-08-22T03:23:24', '2005-08-23T22:23:24', '2'), + ('251', '590', '2006-02-16T02:30:53', '2005-08-23T16:23:08', '2005-08-28T20:30:08', '2'), + ('198', '2643', '2006-02-16T02:30:53', '2005-07-31T21:08:56', '2005-08-01T23:35:56', '2'), + ('597', '3495', '2006-02-16T02:30:53', '2005-07-09T17:34:11', '2005-07-15T18:32:11', '2'), + ('294', '4331', '2006-02-16T02:30:53', '2005-07-11T11:25:09', '2005-07-18T12:09:09', '2'), + ('486', '100', '2006-02-16T02:30:53', '2005-06-17T13:46:52', '2005-06-18T15:42:52', '2'), + ('120', '3760', '2006-02-16T02:30:53', '2005-08-02T03:08:29', '2005-08-07T21:28:29', '2'), + ('590', '1300', '2006-02-16T02:30:53', '2005-05-28T14:15:54', '2005-06-05T15:16:54', '2'), + ('6', '1291', '2006-02-16T02:30:53', '2005-08-23T02:51:24', '2005-08-31T06:21:24', '2'), + ('20', '2052', '2006-02-16T02:30:53', '2005-07-07T00:48:25', '2005-07-13T06:30:25', '2'), + ('5', '2587', '2006-02-16T02:30:53', '2005-08-01T14:48:45', '2005-08-04T13:41:45', '2'), + ('540', '589', '2006-02-16T02:30:53', '2005-08-02T02:20:19', '2005-08-11T05:50:19', '2'), + ('243', '279', '2006-02-16T02:30:53', '2005-08-18T02:27:20', '2005-08-21T00:41:20', '2'), + ('476', '353', '2006-02-16T02:30:53', '2005-05-29T12:59:14', '2005-06-01T16:05:14', '2'), + ('67', '3825', '2006-02-16T02:30:53', '2005-06-21T12:08:18', '2005-06-25T16:35:18', '2'), + ('589', '4313', '2006-02-16T02:30:53', '2005-08-18T22:11:47', '2005-08-27T17:55:47', '2'), + ('15', '2417', '2006-02-16T02:30:53', '2005-07-06T02:29:21', '2005-07-13T05:26:21', '2'), + ('249', '258', '2006-02-16T02:30:53', '2005-05-27T12:51:44', '2005-05-31T08:34:44', '2'), + ('391', '517', '2006-02-16T02:30:53', '2005-05-25T11:00:07', '2005-06-01T13:56:07', '2'), + ('296', '3828', '2006-02-16T02:30:53', '2005-08-23T16:19:02', '2005-08-31T12:29:02', '2'), + ('190', '3037', '2006-02-16T02:30:53', '2005-08-02T07:30:19', '2005-08-07T05:20:19', '2'), + ('594', '3477', '2006-02-16T02:30:53', '2005-07-31T07:24:35', '2005-08-09T04:52:35', '2'), + ('302', '775', '2006-02-16T02:30:53', '2005-05-25T15:38:46', '2005-05-31T13:40:46', '2'), + ('219', '568', '2006-02-16T02:30:53', '2005-07-09T20:33:50', '2005-07-14T01:50:50', '2'), + ('540', '2962', '2006-02-16T02:30:53', '2005-06-21T10:37:23', '2005-06-26T07:21:23', '2'), + ('299', '1579', '2006-02-16T02:30:53', '2005-08-22T04:10:10', '2005-08-24T06:23:10', '2'), + ('587', '3849', '2006-02-16T02:30:53', '2005-08-18T00:46:38', '2005-08-19T04:38:38', '2'), + ('489', '673', '2006-02-16T02:30:53', '2005-07-08T15:42:28', '2005-07-16T18:29:28', '2'), + ('420', '3722', '2006-02-16T02:30:53', '2005-05-29T09:13:08', '2005-06-01T07:05:08', '2'), + ('366', '4417', '2006-02-16T02:30:53', '2005-07-27T22:25:15', '2005-08-01T01:21:15', '2'), + ('432', '433', '2006-02-16T02:30:53', '2005-07-31T17:12:23', '2005-08-01T21:04:23', '2'), + ('444', '2095', '2006-02-16T02:30:53', '2005-06-15T18:54:21', '2005-06-22T22:48:21', '2'), + ('227', '1408', '2006-02-16T02:30:53', '2005-07-30T02:47:13', '2005-08-01T02:25:13', '2'), + ('308', '1282', '2006-02-16T02:30:53', '2005-08-17T17:55:46', '2005-08-22T15:31:46', '2'), + ('539', '541', '2006-02-16T02:30:53', '2005-07-28T07:13:20', '2005-08-06T05:43:20', '2'), + ('42', '229', '2006-02-16T02:30:53', '2005-06-17T15:27:33', '2005-06-20T13:04:33', '2'), + ('503', '680', '2006-02-16T02:30:53', '2005-08-22T01:24:42', '2005-08-22T19:45:42', '2'), + ('173', '1797', '2006-02-16T02:30:53', '2005-07-29T02:56:00', '2005-07-30T22:35:00', '2'), + ('242', '1645', '2006-02-16T02:30:53', '2005-08-02T05:29:48', '2005-08-06T05:36:48', '2'), + ('145', '3735', '2006-02-16T02:30:53', '2005-07-28T13:25:05', '2005-07-29T18:50:05', '2'), + ('476', '4069', '2006-02-16T02:30:53', '2005-07-10T06:57:44', '2005-07-15T03:52:44', '2'), + ('259', '2175', '2006-02-16T02:30:53', '2005-06-18T14:47:29', '2005-06-26T13:52:29', '2'), + ('299', '226', '2006-02-16T02:30:53', '2005-08-21T15:53:52', '2005-08-25T15:39:52', '2'), + ('129', '1497', '2006-02-16T02:30:53', '2005-07-06T19:21:28', '2005-07-15T21:06:28', '2'), + ('348', '71', '2006-02-16T02:30:53', '2005-08-02T13:58:55', '2005-08-05T18:09:55', '2'), + ('425', '789', '2006-02-16T02:30:53', '2005-07-09T18:47:48', '2005-07-14T14:39:48', '2'), + ('385', '1266', '2006-02-16T02:30:53', '2005-06-17T07:16:46', '2005-06-21T04:22:46', '2'), + ('302', '3003', '2006-02-16T02:30:53', '2005-06-15T04:04:41', '2005-06-20T23:52:41', '2'), + ('338', '3085', '2006-02-16T02:30:53', '2005-08-18T01:00:02', '2005-08-21T00:04:02', '2'), + ('573', '1393', '2006-02-16T02:30:53', '2005-06-19T08:10:41', '2005-06-28T10:44:41', '2'), + ('16', '453', '2006-02-16T02:30:53', '2005-07-08T02:45:19', '2005-07-12T03:04:19', '2'), + ('595', '321', '2006-02-16T02:30:53', '2005-07-31T05:02:00', '2005-08-02T02:04:00', '2'), + ('35', '311', '2006-02-16T02:30:53', '2005-08-21T01:31:51', '2005-08-24T22:20:51', '2'), + ('19', '2688', '2006-02-16T02:30:53', '2005-08-16T23:27:36', '2005-08-25T01:34:36', '2'), + ('144', '3264', '2006-02-16T02:30:53', '2005-06-19T16:57:42', '2005-06-26T15:30:42', '2'), + ('5', '3277', '2006-02-16T02:30:53', '2005-06-15T22:03:14', '2005-06-23T18:42:14', '2'), + ('347', '384', '2006-02-16T02:30:53', '2005-07-06T05:27:15', '2005-07-10T00:05:15', '2'), + ('528', '524', '2006-02-16T02:30:53', '2005-07-31T20:11:29', '2005-08-06T22:28:29', '2'), + ('123', '955', '2006-02-16T02:30:53', '2005-06-17T08:30:35', '2005-06-20T10:43:35', '2'), + ('481', '2491', '2006-02-16T02:30:53', '2005-08-02T18:32:38', '2005-08-07T19:08:38', '2'), + ('352', '2936', '2006-02-16T02:30:53', '2005-05-29T14:44:22', '2005-06-01T17:28:22', '2'), + ('377', '1766', '2006-02-16T02:30:53', '2005-07-07T12:24:37', '2005-07-12T06:47:37', '2'), + ('319', '4050', '2006-02-16T02:30:53', '2005-08-22T23:07:57', '2005-08-28T19:39:57', '2'), + ('25', '1146', '2006-02-16T02:30:53', '2005-06-21T20:53:31', '2005-06-24T02:20:31', '2'), + ('30', '1159', '2006-02-16T02:30:53', '2005-08-22T10:39:51', '2005-08-25T16:03:51', '2'), + ('155', '1331', '2006-02-16T02:30:53', '2005-06-20T00:09:25', '2005-06-24T04:40:25', '2'), + ('66', '2491', '2006-02-16T02:30:53', '2005-06-21T10:04:33', '2005-06-29T06:09:33', '2'), + ('396', '2152', '2006-02-16T02:30:53', '2005-08-21T23:56:30', '2005-08-26T00:07:30', '2'), + ('59', '1155', '2006-02-16T02:30:53', '2005-08-02T18:48:29', '2005-08-04T16:05:29', '2'), + ('208', '2598', '2006-02-16T02:30:53', '2005-08-02T20:26:19', '2005-08-07T00:33:19', '2'), + ('209', '4019', '2006-02-16T02:30:53', '2005-08-17T19:59:06', '2005-08-23T14:39:06', '2'), + ('482', '3918', '2006-02-16T02:30:53', '2005-08-22T23:01:45', '2005-08-29T02:59:45', '2'), + ('259', '833', '2006-02-16T02:30:53', '2005-08-18T19:43:46', '2005-08-27T00:08:46', '2'), + ('419', '989', '2006-02-16T02:30:53', '2005-08-02T19:58:48', '2005-08-03T19:30:48', '2'), + ('259', '4306', '2006-02-16T02:30:53', '2005-07-08T01:23:58', '2005-07-09T01:35:58', '2'), + ('404', '3835', '2006-02-16T02:30:53', '2005-08-19T23:07:24', '2005-08-28T04:12:24', '2'), + ('117', '2432', '2006-02-16T02:30:53', '2005-07-10T00:45:48', '2005-07-18T20:35:48', '2'), + ('520', '1291', '2006-02-16T02:30:53', '2005-07-05T23:13:22', '2005-07-12T19:02:22', '2'), + ('42', '1852', '2006-02-16T02:30:53', '2005-06-18T08:27:33', '2005-06-22T02:46:33', '2'), + ('40', '1856', '2006-02-16T02:30:53', '2005-07-31T16:07:50', '2005-08-07T18:37:50', '2'), + ('570', '4460', '2006-02-16T02:30:53', '2005-06-15T06:37:55', '2005-06-23T04:02:55', '2'), + ('201', '2637', '2006-02-16T02:30:53', '2005-06-20T17:18:06', '2005-06-24T14:50:06', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['7758', '7098', '5799', '12039', '2086', '4005', '12380', '14604', '12471', '880', '2198', '8922', '10539', '12458', '1130', '14441', '1449', '8633', '15940', '6084', '6413', '10343', '4708', '12381', '9187', '149', '1556', '7168', '13275', '11797', '15087', '13216', '13887', '4285', '2249', '10514', '1201', '14156', '6036', '1322', '10194', '482', '10559', '2842', '5385', '4297', '12827', '8310', '2270', '7327', '10106', '10214', '14075', '6965', '15832', '7632', '8800', '9010', '422', '9777', '1076', '2909', '4513', '7464', '5597', '3740', '7742', '2159', '5631', '6117', '12009', '14263', '11217', '9917', '3182', '1833', '2317', '4352', '6031', '303', '14913', '14102', '12847', '213', '14098', '499', '14825', '1709', '5812', '299', '13354', '2731', '12130', '14894', '181', '9736', '5149', '4409', '438', '6603']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('356', '4333', '2006-02-16T02:30:53', '2005-07-28T06:23:41', '2005-08-03T06:06:41', '2'), + ('359', '2555', '2006-02-16T02:30:53', '2005-07-27T05:01:08', '2005-08-02T07:49:08', '2'), + ('520', '3045', '2006-02-16T02:30:53', '2005-07-10T14:53:35', '2005-07-14T16:18:35', '2'), + ('563', '4404', '2006-02-16T02:30:53', '2005-08-17T20:29:08', '2005-08-23T21:20:08', '2'), + ('326', '898', '2006-02-16T02:30:53', '2005-06-17T17:32:07', '2005-06-21T20:19:07', '2'), + ('190', '3677', '2006-02-16T02:30:53', '2005-07-07T00:22:26', '2005-07-15T04:34:26', '2'), + ('215', '55', '2006-02-16T02:30:53', '2005-08-18T08:27:28', '2005-08-25T02:58:28', '2'), + ('585', '1024', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('101', '242', '2006-02-16T02:30:53', '2005-08-18T11:57:00', '2005-08-26T13:17:00', '2'), + ('460', '1819', '2006-02-16T02:30:53', '2005-05-30T06:12:33', '2005-06-02T04:35:33', '2'), + ('109', '1983', '2006-02-16T02:30:53', '2005-06-18T01:51:22', '2005-06-26T06:57:22', '2'), + ('446', '1696', '2006-02-16T02:30:53', '2005-07-30T02:08:25', '2005-08-08T07:19:25', '2'), + ('232', '3341', '2006-02-16T02:30:53', '2005-08-01T12:23:00', '2005-08-07T10:25:00', '2'), + ('277', '4579', '2006-02-16T02:30:53', '2005-08-18T11:22:53', '2005-08-22T14:30:53', '2'), + ('124', '3186', '2006-02-16T02:30:53', '2005-05-31T18:13:57', '2005-06-06T22:50:57', '2'), + ('260', '1210', '2006-02-16T02:30:53', '2005-08-21T11:59:38', '2005-08-26T11:17:38', '2'), + ('471', '1525', '2006-02-16T02:30:53', '2005-06-15T19:19:16', '2005-06-18T15:24:16', '2'), + ('534', '3436', '2006-02-16T02:30:53', '2005-07-29T14:19:53', '2005-08-01T11:31:53', '2'), + ('86', '1606', '2006-02-16T02:30:53', '2005-08-23T18:45:06', '2005-08-30T13:00:06', '2'), + ('479', '1334', '2006-02-16T02:30:53', '2005-07-11T05:16:20', '2005-07-19T01:38:20', '2'), + ('251', '4446', '2006-02-16T02:30:53', '2005-07-11T23:26:11', '2005-07-17T21:58:11', '2'), + ('267', '2627', '2006-02-16T02:30:53', '2005-08-01T05:15:47', '2005-08-02T04:48:47', '2'), + ('212', '3249', '2006-02-16T02:30:53', '2005-07-08T11:59:19', '2005-07-17T07:11:19', '2'), + ('190', '3651', '2006-02-16T02:30:53', '2005-08-18T08:31:43', '2005-08-23T12:24:43', '2'), + ('469', '4008', '2006-02-16T02:30:53', '2005-07-30T12:14:03', '2005-08-04T13:10:03', '2'), + ('319', '1084', '2006-02-16T02:30:53', '2005-05-26T00:28:05', '2005-06-02T21:30:05', '2'), + ('54', '533', '2006-02-16T02:30:53', '2005-06-16T02:19:02', '2005-06-17T22:36:02', '2'), + ('252', '6', '2006-02-16T02:30:53', '2005-07-27T07:51:11', '2005-08-01T04:08:11', '2'), + ('377', '710', '2006-02-16T02:30:53', '2005-08-19T17:53:38', '2005-08-23T16:29:38', '2'), + ('546', '1142', '2006-02-16T02:30:53', '2005-08-17T11:17:21', '2005-08-18T09:14:21', '2'), + ('404', '233', '2006-02-16T02:30:53', '2005-08-22T11:24:09', '2005-08-27T16:42:09', '2'), + ('422', '4335', '2006-02-16T02:30:53', '2005-08-19T15:36:05', '2005-08-25T19:03:05', '2'), + ('413', '4002', '2006-02-16T02:30:53', '2005-08-20T15:39:00', '2005-08-24T16:17:00', '2'), + ('308', '511', '2006-02-16T02:30:53', '2005-07-07T15:34:35', '2005-07-15T09:43:35', '2'), + ('285', '117', '2006-02-16T02:30:53', '2005-06-18T05:03:08', '2005-06-26T05:43:08', '2'), + ('7', '1512', '2006-02-16T02:30:53', '2005-08-01T11:39:26', '2005-08-03T07:53:26', '2'), + ('209', '2679', '2006-02-16T02:30:53', '2005-06-15T02:06:28', '2005-06-16T21:38:28', '2'), + ('147', '437', '2006-02-16T02:30:53', '2005-08-21T02:35:16', '2005-08-27T01:32:16', '2'), + ('297', '2553', '2006-02-16T02:30:53', '2005-07-11T03:02:28', '2005-07-15T22:12:28', '2'), + ('217', '2076', '2006-02-16T02:30:53', '2005-06-15T10:55:09', '2005-06-18T15:14:09', '2'), + ('290', '1447', '2006-02-16T02:30:53', '2005-08-01T00:33:52', '2005-08-06T04:50:52', '2'), + ('546', '4178', '2006-02-16T02:30:53', '2005-05-27T22:53:02', '2005-06-01T22:53:02', '2'), + ('174', '2861', '2006-02-16T02:30:53', '2005-08-01T13:02:58', '2005-08-09T10:03:58', '2'), + ('217', '4183', '2006-02-16T02:30:53', '2005-06-19T22:34:20', '2005-06-22T03:46:20', '2'), + ('112', '4291', '2006-02-16T02:30:53', '2005-07-09T19:18:11', '2005-07-16T18:50:11', '2'), + ('141', '882', '2006-02-16T02:30:53', '2005-07-07T16:24:09', '2005-07-13T15:08:09', '2'), + ('253', '880', '2006-02-16T02:30:53', '2005-08-19T01:27:23', '2005-08-27T02:22:23', '2'), + ('238', '2637', '2006-02-16T02:30:53', '2005-07-29T03:25:56', '2005-08-06T23:18:56', '2'), + ('588', '3447', '2006-02-16T02:30:53', '2005-06-18T06:29:01', '2005-06-26T07:21:01', '2'), + ('508', '4074', '2006-02-16T02:30:53', '2005-07-27T13:53:26', '2005-08-04T17:58:26', '2'), + ('556', '3444', '2006-02-16T02:30:53', '2005-07-31T21:00:47', '2005-08-02T20:11:47', '2'), + ('597', '648', '2006-02-16T02:30:53', '2005-08-01T01:04:15', '2005-08-01T19:31:15', '2'), + ('32', '3793', '2006-02-16T02:30:53', '2005-08-20T23:18:54', '2005-08-26T21:59:54', '2'), + ('185', '74', '2006-02-16T02:30:53', '2005-07-27T00:15:18', '2005-07-28T04:30:18', '2'), + ('537', '1468', '2006-02-16T02:30:53', '2005-08-23T15:21:35', '2005-08-30T15:01:35', '2'), + ('181', '3233', '2006-02-16T02:30:53', '2005-07-28T01:02:40', '2005-07-30T05:31:40', '2'), + ('207', '2082', '2006-02-16T02:30:53', '2005-07-29T21:18:59', '2005-08-06T19:59:59', '2'), + ('152', '1698', '2006-02-16T02:30:53', '2005-07-30T05:12:04', '2005-08-06T02:54:04', '2'), + ('150', '1152', '2006-02-16T02:30:53', '2005-05-27T15:31:55', '2005-06-01T11:47:55', '2'), + ('539', '225', '2006-02-16T02:30:53', '2005-07-31T10:01:06', '2005-08-08T04:44:06', '2'), + ('214', '2551', '2006-02-16T02:30:53', '2005-05-31T10:14:31', '2005-06-05T10:13:31', '2'), + ('451', '1701', '2006-02-16T02:30:53', '2005-06-20T03:19:10', '2005-06-25T06:06:10', '2'), + ('182', '3704', '2006-02-16T02:30:53', '2005-07-08T02:39:59', '2005-07-14T07:48:59', '2'), + ('31', '845', '2006-02-16T02:30:53', '2005-07-27T18:49:42', '2005-07-28T20:45:42', '2'), + ('576', '4264', '2006-02-16T02:30:53', '2005-07-10T04:47:57', '2005-07-17T01:54:57', '2'), + ('277', '1829', '2006-02-16T02:30:53', '2005-07-06T11:55:35', '2005-07-14T09:44:35', '2'), + ('49', '1808', '2006-02-16T02:30:53', '2005-07-28T05:33:16', '2005-08-06T01:04:16', '2'), + ('465', '3095', '2006-02-16T02:30:53', '2005-06-17T23:37:29', '2005-06-25T00:18:29', '2'), + ('595', '2095', '2006-02-16T02:30:53', '2005-07-10T06:15:45', '2005-07-17T09:53:45', '2'), + ('135', '2613', '2006-02-16T02:30:53', '2005-07-11T07:39:38', '2005-07-18T12:07:38', '2'), + ('296', '2134', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('533', '2595', '2006-02-16T02:30:53', '2005-08-21T06:08:15', '2005-08-29T09:22:15', '2'), + ('417', '1201', '2006-02-16T02:30:53', '2005-08-02T12:26:31', '2005-08-09T09:53:31', '2'), + ('159', '3829', '2006-02-16T02:30:53', '2005-07-31T14:55:11', '2005-08-02T13:58:11', '2'), + ('15', '4017', '2006-02-16T02:30:53', '2005-06-20T22:52:18', '2005-06-21T21:00:18', '2'), + ('121', '1337', '2006-02-16T02:30:53', '2005-06-16T22:45:03', '2005-06-20T22:02:03', '2'), + ('326', '1602', '2006-02-16T02:30:53', '2005-06-18T09:12:18', '2005-06-21T05:50:18', '2'), + ('249', '2636', '2006-02-16T02:30:53', '2005-07-07T19:15:58', '2005-07-16T20:22:58', '2'), + ('224', '1530', '2006-02-16T02:30:53', '2005-07-11T02:42:14', '2005-07-14T03:24:14', '2'), + ('596', '1111', '2006-02-16T02:30:53', '2005-05-26T21:16:52', '2005-05-27T23:41:52', '2'), + ('503', '3609', '2006-02-16T02:30:53', '2005-08-22T04:52:13', '2005-08-23T06:49:13', '2'), + ('584', '3772', '2006-02-16T02:30:53', '2005-08-21T00:35:21', '2005-08-30T04:51:21', '2'), + ('91', '384', '2006-02-16T02:30:53', '2005-08-19T02:04:07', '2005-08-23T20:13:07', '2'), + ('394', '1505', '2006-02-16T02:30:53', '2005-05-26T08:44:08', '2005-05-31T12:33:08', '2'), + ('554', '6', '2006-02-23T09:12:08', '2005-08-21T00:30:32', NULL, '2'), + ('199', '2381', '2006-02-16T02:30:53', '2005-05-28T01:05:07', '2005-06-05T19:54:07', '2'), + ('1', '1449', '2006-02-16T02:30:53', '2005-08-22T01:27:57', '2005-08-27T07:01:57', '2'), + ('426', '3501', '2006-02-16T02:30:53', '2005-06-16T14:10:15', '2005-06-24T16:38:15', '2'), + ('581', '1681', '2006-02-16T02:30:53', '2005-07-10T15:27:56', '2005-07-18T15:37:56', '2'), + ('448', '4376', '2006-02-16T02:30:53', '2005-05-26T20:55:36', '2005-05-28T00:25:36', '2'), + ('213', '1356', '2006-02-16T02:30:53', '2005-08-19T20:55:23', '2005-08-27T20:09:23', '2'), + ('138', '4218', '2006-02-16T02:30:53', '2005-06-19T15:14:55', '2005-06-27T14:30:55', '2'), + ('516', '1358', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('347', '3494', '2006-02-16T02:30:53', '2005-08-22T04:16:56', '2005-08-24T00:30:56', '2'), + ('587', '2417', '2006-02-16T02:30:53', '2005-05-26T04:47:06', '2005-05-29T06:34:06', '2'), + ('13', '2072', '2006-02-16T02:30:53', '2005-07-31T08:58:40', '2005-08-09T08:34:40', '2'), + ('330', '1500', '2006-02-16T02:30:53', '2005-07-09T08:28:23', '2005-07-16T06:19:23', '2'), + ('8', '3153', '2006-02-16T02:30:53', '2005-07-07T21:47:29', '2005-07-11T20:14:29', '2'), + ('249', '4260', '2006-02-16T02:30:53', '2005-05-27T17:52:34', '2005-06-05T22:23:34', '2'), + ('425', '3583', '2006-02-16T02:30:53', '2005-07-12T07:52:55', '2005-07-16T13:19:55', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['7658', '9821', '3513', '12823', '10072', '5078', '8521', '6840', '10233', '9510', '96', '1439', '7910', '3768', '2157', '8277', '13933', '12574', '14181', '6508', '10220', '14414', '4556', '2549', '4509', '12204', '15814', '643', '355', '761', '6816', '5128', '2002', '6063', '3216', '12245', '14274', '5600', '654', '13649', '7096', '979', '13393', '6538', '2584', '6865', '1484', '1722', '2037', '770', '9585', '13321', '3984', '6714', '3472', '14848', '6254', '3251', '3499', '13350', '13484', '15802', '12326', '9599', '4557', '7712', '3536', '11026', '10100', '6709', '5308', '9953', '2092', '9537', '8226', '9354', '753', '11734', '1365', '1020', '13886', '10445', '14845', '7666', '10294', '14997', '1981', '1026', '225', '8026', '1600', '8909', '4377', '5906', '10687', '4310', '12127', '8251', '4623', '2853']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('272', '1798', '2006-02-16T02:30:53', '2005-07-28T02:09:12', '2005-07-30T00:54:12', '2'), + ('271', '386', '2006-02-16T02:30:53', '2005-07-31T11:47:54', '2005-08-08T06:21:54', '2'), + ('223', '4225', '2006-02-16T02:30:53', '2005-07-06T00:45:57', '2005-07-11T19:04:57', '2'), + ('316', '426', '2006-02-16T02:30:53', '2005-08-19T01:15:47', '2005-08-22T05:32:47', '2'), + ('520', '3963', '2006-02-16T02:30:53', '2005-07-31T19:50:37', '2005-08-03T00:25:37', '2'), + ('78', '1994', '2006-02-16T02:30:53', '2005-07-09T05:20:24', '2005-07-13T06:41:24', '2'), + ('402', '2608', '2006-02-16T02:30:53', '2005-07-29T10:12:45', '2005-08-07T04:37:45', '2'), + ('323', '1381', '2006-02-16T02:30:53', '2005-07-12T19:03:22', '2005-07-21T18:34:22', '2'), + ('459', '4571', '2006-02-16T02:30:53', '2005-08-01T01:54:23', '2005-08-10T00:23:23', '2'), + ('494', '2301', '2006-02-16T02:30:53', '2005-07-31T00:24:17', '2005-08-08T18:47:17', '2'), + ('49', '3418', '2006-02-16T02:30:53', '2005-05-25T16:32:19', '2005-05-30T10:47:19', '2'), + ('589', '3155', '2006-02-16T02:30:53', '2005-06-15T18:45:32', '2005-06-22T15:57:32', '2'), + ('480', '2044', '2006-02-16T02:30:53', '2005-07-28T11:44:56', '2005-08-05T14:37:56', '2'), + ('573', '3995', '2006-02-16T02:30:53', '2005-07-06T13:07:30', '2005-07-09T16:26:30', '2'), + ('201', '1619', '2006-02-16T02:30:53', '2005-06-17T23:30:52', '2005-06-24T01:56:52', '2'), + ('13', '1296', '2006-02-16T02:30:53', '2005-07-29T01:38:53', '2005-08-04T07:09:53', '2'), + ('159', '647', '2006-02-16T02:30:53', '2005-08-20T17:17:07', '2005-08-22T18:10:07', '2'), + ('317', '177', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('210', '197', '2006-02-16T02:30:53', '2005-08-21T03:16:30', '2005-08-29T06:25:30', '2'), + ('597', '1474', '2006-02-16T02:30:53', '2005-07-12T03:34:50', '2005-07-17T02:57:50', '2'), + ('294', '3920', '2006-02-16T02:30:53', '2005-08-01T01:13:22', '2005-08-04T22:57:22', '2'), + ('515', '1757', '2006-02-16T02:30:53', '2005-08-21T11:08:17', '2005-08-23T08:37:17', '2'), + ('348', '4099', '2006-02-16T02:30:53', '2005-07-08T04:48:41', '2005-07-16T08:51:41', '2'), + ('495', '3854', '2006-02-16T02:30:53', '2005-06-19T02:46:39', '2005-06-26T22:30:39', '2'), + ('230', '1760', '2006-02-16T02:30:53', '2005-07-08T02:32:38', '2005-07-14T01:05:38', '2'), + ('575', '304', '2006-02-16T02:30:53', '2005-08-18T02:20:35', '2005-08-26T01:27:35', '2'), + ('459', '4361', '2006-02-16T02:30:53', '2005-08-23T14:52:50', '2005-08-27T16:12:50', '2'), + ('240', '3105', '2006-02-16T02:30:53', '2005-05-28T18:52:11', '2005-05-31T15:15:11', '2'), + ('446', '141', '2006-02-16T02:30:53', '2005-05-27T06:15:33', '2005-06-01T02:50:33', '2'), + ('58', '2342', '2006-02-16T02:30:53', '2005-05-29T11:09:01', '2005-06-03T16:18:01', '2'), + ('290', '2963', '2006-02-16T02:30:53', '2005-07-12T18:18:50', '2005-07-18T21:09:50', '2'), + ('155', '3757', '2006-02-16T02:30:53', '2005-07-09T07:25:54', '2005-07-16T04:04:54', '2'), + ('514', '2406', '2006-02-16T02:30:53', '2005-06-17T11:39:58', '2005-06-24T15:41:58', '2'), + ('519', '1715', '2006-02-16T02:30:53', '2005-07-11T04:16:51', '2005-07-13T08:35:51', '2'), + ('534', '719', '2006-02-16T02:30:53', '2005-06-21T01:19:37', '2005-06-29T06:45:37', '2'), + ('576', '2960', '2006-02-16T02:30:53', '2005-08-18T03:46:40', '2005-08-24T22:27:40', '2'), + ('405', '3183', '2006-02-16T02:30:53', '2005-08-21T06:29:20', '2005-08-26T06:25:20', '2'), + ('138', '3713', '2006-02-16T02:30:53', '2005-07-10T04:55:45', '2005-07-18T03:10:45', '2'), + ('23', '2312', '2006-02-16T02:30:53', '2005-05-28T20:15:30', '2005-05-30T22:02:30', '2'), + ('259', '1495', '2006-02-16T02:30:53', '2005-08-20T07:48:38', '2005-08-23T07:43:38', '2'), + ('3', '2575', '2006-02-16T02:30:53', '2005-07-27T04:54:42', '2005-08-03T01:42:42', '2'), + ('279', '3917', '2006-02-16T02:30:53', '2005-05-30T21:37:11', '2005-06-08T00:24:11', '2'), + ('15', '958', '2006-02-16T02:30:53', '2005-08-19T22:03:46', '2005-08-28T19:19:46', '2'), + ('529', '1987', '2006-02-16T02:30:53', '2005-07-12T04:50:26', '2005-07-20T23:44:26', '2'), + ('90', '3733', '2006-02-16T02:30:53', '2005-06-19T05:02:36', '2005-06-28T04:52:36', '2'), + ('175', '1428', '2006-02-16T02:30:53', '2005-07-12T20:02:40', '2005-07-20T00:39:40', '2'), + ('320', '1589', '2006-02-16T02:30:53', '2005-06-15T21:22:35', '2005-06-20T02:27:35', '2'), + ('364', '2142', '2006-02-16T02:30:53', '2005-06-16T15:12:52', '2005-06-19T13:01:52', '2'), + ('308', '2582', '2006-02-16T02:30:53', '2005-06-17T13:54:20', '2005-06-20T14:49:20', '2'), + ('405', '2491', '2006-02-16T02:30:53', '2005-05-29T12:56:50', '2005-06-07T15:54:50', '2'), + ('197', '3249', '2006-02-16T02:30:53', '2005-07-31T03:05:55', '2005-08-02T23:54:55', '2'), + ('280', '4183', '2006-02-16T02:30:53', '2005-08-19T19:40:37', '2005-08-21T19:09:37', '2'), + ('570', '2205', '2006-02-16T02:30:53', '2005-07-06T23:22:36', '2005-07-08T21:40:36', '2'), + ('370', '1947', '2006-02-16T02:30:53', '2005-07-12T13:29:06', '2005-07-18T16:02:06', '2'), + ('37', '841', '2006-02-16T02:30:53', '2005-07-05T22:56:33', '2005-07-13T17:18:33', '2'), + ('218', '395', '2006-02-16T02:30:53', '2005-08-22T02:14:19', '2005-08-26T02:54:19', '2'), + ('20', '2038', '2006-02-16T02:30:53', '2005-07-11T15:10:18', '2005-07-17T14:20:18', '2'), + ('317', '1414', '2006-02-16T02:30:53', '2005-06-21T03:20:37', '2005-06-23T04:54:37', '2'), + ('520', '1850', '2006-02-16T02:30:53', '2005-07-06T00:04:20', '2005-07-14T21:12:20', '2'), + ('214', '3523', '2006-02-16T02:30:53', '2005-08-19T20:44:00', '2005-08-27T01:23:00', '2'), + ('152', '1533', '2006-02-16T02:30:53', '2005-08-20T01:16:52', '2005-08-22T23:47:52', '2'), + ('158', '41', '2006-02-16T02:30:53', '2005-08-23T14:26:51', '2005-08-29T16:28:51', '2'), + ('114', '1865', '2006-02-16T02:30:53', '2005-08-18T06:41:59', '2005-08-19T10:16:59', '2'), + ('502', '3164', '2006-02-16T02:30:53', '2005-07-31T03:32:06', '2005-08-04T07:47:06', '2'), + ('132', '1191', '2006-02-16T02:30:53', '2005-07-08T04:49:15', '2005-07-14T00:00:15', '2'), + ('361', '3256', '2006-02-16T02:30:53', '2005-07-28T04:29:53', '2005-08-02T00:57:53', '2'), + ('339', '2328', '2006-02-16T02:30:53', '2005-07-06T01:36:11', '2005-07-12T20:00:11', '2'), + ('531', '3554', '2006-02-16T02:30:53', '2005-08-02T05:46:05', '2005-08-07T06:27:05', '2'), + ('330', '4050', '2006-02-16T02:30:53', '2005-07-31T20:47:18', '2005-08-03T16:58:18', '2'), + ('322', '4049', '2006-02-16T02:30:53', '2005-07-12T13:20:41', '2005-07-16T10:37:41', '2'), + ('52', '1684', '2006-02-16T02:30:53', '2005-07-09T15:58:38', '2005-07-15T13:55:38', '2'), + ('211', '1646', '2006-02-16T02:30:53', '2005-07-31T15:56:35', '2005-08-02T12:01:35', '2'), + ('556', '4427', '2006-02-16T02:30:53', '2005-06-17T18:12:16', '2005-06-25T15:06:16', '2'), + ('488', '546', '2006-02-16T02:30:53', '2005-07-31T01:23:00', '2005-08-01T01:16:00', '2'), + ('368', '3541', '2006-02-16T02:30:53', '2005-07-29T00:01:04', '2005-08-01T19:08:04', '2'), + ('595', '510', '2006-02-16T02:30:53', '2005-07-30T18:32:51', '2005-08-02T21:28:51', '2'), + ('135', '1021', '2006-02-16T02:30:53', '2005-05-29T10:16:42', '2005-06-05T08:52:42', '2'), + ('337', '4063', '2006-02-16T02:30:53', '2005-08-17T08:34:22', '2005-08-25T11:56:22', '2'), + ('25', '3813', '2006-02-16T02:30:53', '2005-06-15T14:09:55', '2005-06-19T18:11:55', '2'), + ('138', '3402', '2006-02-16T02:30:53', '2005-05-31T03:06:08', '2005-06-02T08:57:08', '2'), + ('73', '2248', '2006-02-16T02:30:53', '2005-08-20T15:34:43', '2005-08-26T11:48:43', '2'), + ('211', '3582', '2006-02-16T02:30:53', '2005-08-01T09:02:15', '2005-08-08T10:26:15', '2'), + ('292', '69', '2006-02-16T02:30:53', '2005-08-22T02:12:44', '2005-08-24T02:36:44', '2'), + ('196', '688', '2006-02-16T02:30:53', '2005-07-28T02:35:12', '2005-08-05T05:43:12', '2'), + ('28', '528', '2006-02-16T02:30:53', '2005-08-01T03:48:12', '2005-08-09T01:19:12', '2'), + ('29', '2724', '2006-02-16T02:30:53', '2005-08-22T07:53:00', '2005-08-28T03:47:00', '2'), + ('526', '3186', '2006-02-16T02:30:53', '2005-06-17T10:03:34', '2005-06-20T13:14:34', '2'), + ('107', '632', '2006-02-16T02:30:53', '2005-05-31T03:45:26', '2005-06-06T22:30:26', '2'), + ('467', '651', '2006-02-16T02:30:53', '2005-05-26T10:27:50', '2005-06-01T07:01:50', '2'), + ('511', '4225', '2006-02-16T02:30:53', '2005-07-28T16:05:38', '2005-07-29T21:28:38', '2'), + ('196', '2264', '2006-02-16T02:30:53', '2005-06-16T06:04:12', '2005-06-19T09:39:12', '2'), + ('556', '2606', '2006-02-16T02:30:53', '2005-07-30T01:28:03', '2005-08-06T04:40:03', '2'), + ('205', '3294', '2006-02-16T02:30:53', '2005-07-07T20:28:57', '2005-07-16T02:13:57', '2'), + ('323', '514', '2006-02-16T02:30:53', '2005-07-10T20:41:41', '2005-07-14T00:12:41', '2'), + ('16', '3191', '2006-02-16T02:30:53', '2005-08-01T17:53:02', '2005-08-05T19:16:02', '2'), + ('390', '3842', '2006-02-16T02:30:53', '2005-07-07T17:30:56', '2005-07-12T13:19:56', '2'), + ('582', '4218', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('408', '2317', '2006-02-16T02:30:53', '2005-07-29T00:50:14', '2005-08-03T23:52:14', '2'), + ('593', '4171', '2006-02-16T02:30:53', '2005-07-08T08:03:22', '2005-07-12T09:11:22', '2'), + ('453', '2578', '2006-02-16T02:30:53', '2005-06-19T23:09:41', '2005-06-28T00:51:41', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['1923', '3054', '5344', '3008', '871', '8086', '6433', '4373', '10201', '5555', '5669', '13892', '11312', '4506', '11615', '5118', '7559', '5077', '8985', '13913', '11759', '2153', '12573', '13895', '5580', '12873', '14511', '4440', '13163', '12527', '6212', '13254', '9973', '1148', '14806', '7880', '1591', '12259', '4559', '5813', '14267', '5673', '15731', '5925', '10921', '308', '10949', '3011', '13395', '934', '6329', '11213', '6239', '2683', '14750', '1107', '9874', '9757', '11636', '1970', '15404', '2602', '49', '12732', '15321', '11162', '1496', '4469', '14794', '13351', '14402', '15373', '8283', '876', '2811', '15543', '10143', '15580', '6142', '1851', '11054', '11444', '11560', '12576', '5576', '8481', '14867', '13926', '9053', '4466', '12830', '7252', '15013', '6279', '14949', '13996', '14092', '6486', '14215', '13253']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('400', '691', '2006-02-16T02:30:53', '2005-06-17T06:06:10', '2005-06-24T04:29:10', '2'), + ('322', '2817', '2006-02-16T02:30:53', '2005-06-20T13:16:41', '2005-06-28T13:45:41', '2'), + ('197', '159', '2006-02-16T02:30:53', '2005-07-09T17:27:05', '2005-07-10T15:51:05', '2'), + ('202', '3383', '2006-02-16T02:30:53', '2005-06-20T10:23:25', '2005-06-26T11:00:25', '2'), + ('303', '4573', '2006-02-16T02:30:53', '2005-05-30T05:01:30', '2005-06-04T06:22:30', '2'), + ('3', '1182', '2006-02-16T02:30:53', '2005-07-28T18:17:14', '2005-07-30T18:22:14', '2'), + ('101', '1357', '2006-02-16T02:30:53', '2005-07-12T00:12:02', '2005-07-21T04:25:02', '2'), + ('470', '3593', '2006-02-16T02:30:53', '2005-07-07T20:10:59', '2005-07-12T21:30:59', '2'), + ('299', '3649', '2006-02-16T02:30:53', '2005-08-01T00:42:18', '2005-08-08T20:49:18', '2'), + ('79', '2551', '2006-02-16T02:30:53', '2005-07-10T03:08:55', '2005-07-11T01:36:55', '2'), + ('323', '1173', '2006-02-16T02:30:53', '2005-07-10T08:12:53', '2005-07-11T05:48:53', '2'), + ('337', '1236', '2006-02-16T02:30:53', '2005-08-20T15:50:17', '2005-08-29T13:33:17', '2'), + ('190', '1093', '2006-02-16T02:30:53', '2005-08-02T15:56:51', '2005-08-07T20:56:51', '2'), + ('133', '1484', '2006-02-16T02:30:53', '2005-07-08T02:22:18', '2005-07-13T04:54:18', '2'), + ('436', '4331', '2006-02-16T02:30:53', '2005-08-17T03:54:35', '2005-08-23T06:54:35', '2'), + ('5', '957', '2006-02-16T02:30:53', '2005-07-09T07:13:52', '2005-07-18T05:18:52', '2'), + ('149', '661', '2006-02-16T02:30:53', '2005-07-27T22:20:03', '2005-08-06T00:26:03', '2'), + ('574', '686', '2006-02-16T02:30:53', '2005-07-09T05:18:01', '2005-07-17T10:39:01', '2'), + ('12', '3179', '2006-02-16T02:30:53', '2005-07-30T04:34:51', '2005-08-06T00:45:51', '2'), + ('197', '4259', '2006-02-16T02:30:53', '2005-08-20T16:37:35', '2005-08-26T13:12:35', '2'), + ('108', '2655', '2006-02-16T02:30:53', '2005-08-17T09:41:23', '2005-08-19T11:58:23', '2'), + ('357', '2440', '2006-02-16T02:30:53', '2005-06-17T22:58:04', '2005-06-24T19:38:04', '2'), + ('182', '1416', '2006-02-16T02:30:53', '2005-08-18T15:32:57', '2005-08-21T18:29:57', '2'), + ('12', '3060', '2006-02-16T02:30:53', '2005-08-20T15:58:28', '2005-08-26T15:07:28', '2'), + ('521', '2753', '2006-02-16T02:30:53', '2005-07-10T04:05:49', '2005-07-18T22:36:49', '2'), + ('138', '2140', '2006-02-16T02:30:53', '2005-08-19T03:05:41', '2005-08-22T06:57:41', '2'), + ('16', '4452', '2006-02-16T02:30:53', '2005-08-21T14:45:34', '2005-08-28T10:36:34', '2'), + ('507', '1236', '2006-02-16T02:30:53', '2005-07-07T23:00:58', '2005-07-08T21:31:58', '2'), + ('57', '3068', '2006-02-16T02:30:53', '2005-08-19T13:29:46', '2005-08-22T07:48:46', '2'), + ('459', '2536', '2006-02-16T02:30:53', '2005-08-18T13:48:46', '2005-08-26T13:31:46', '2'), + ('337', '3962', '2006-02-16T02:30:53', '2005-07-11T12:40:48', '2005-07-15T17:49:48', '2'), + ('532', '3412', '2006-02-16T02:30:53', '2005-08-19T16:54:01', '2005-08-27T19:50:01', '2'), + ('369', '1850', '2006-02-16T02:30:53', '2005-07-31T16:49:31', '2005-08-03T22:03:31', '2'), + ('235', '3307', '2006-02-16T02:30:53', '2005-05-31T20:38:40', '2005-06-02T18:35:40', '2'), + ('231', '2049', '2006-02-16T02:30:53', '2005-08-22T00:53:08', '2005-08-23T06:26:08', '2'), + ('182', '3670', '2006-02-16T02:30:53', '2005-07-28T10:30:37', '2005-08-03T08:05:37', '2'), + ('83', '1648', '2006-02-16T02:30:53', '2005-06-16T05:12:37', '2005-06-25T06:28:37', '2'), + ('429', '2904', '2006-02-16T02:30:53', '2005-08-18T04:14:35', '2005-08-18T22:30:35', '2'), + ('424', '1911', '2006-02-16T02:30:53', '2005-07-08T04:56:49', '2005-07-12T08:56:49', '2'), + ('512', '942', '2006-02-16T02:30:53', '2005-07-10T15:34:37', '2005-07-17T16:14:37', '2'), + ('527', '2199', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('117', '4018', '2006-02-16T02:30:53', '2005-07-10T08:21:54', '2005-07-11T05:54:54', '2'), + ('118', '3403', '2006-02-16T02:30:53', '2005-08-23T11:33:25', '2005-08-24T07:19:25', '2'), + ('503', '3724', '2006-02-16T02:30:53', '2005-07-10T21:41:27', '2005-07-18T18:35:27', '2'), + ('555', '1820', '2006-02-16T02:30:53', '2005-08-02T02:14:33', '2005-08-09T20:58:33', '2'), + ('277', '187', '2006-02-16T02:30:53', '2005-05-26T22:01:39', '2005-06-04T20:24:39', '2'), + ('389', '2309', '2006-02-16T02:30:53', '2005-08-02T03:24:04', '2005-08-06T08:36:04', '2'), + ('147', '4376', '2006-02-16T02:30:53', '2005-06-20T10:39:10', '2005-06-28T07:02:10', '2'), + ('80', '53', '2006-02-16T02:30:53', '2005-08-19T22:05:40', '2005-08-22T01:31:40', '2'), + ('60', '3595', '2006-02-16T02:30:53', '2005-05-30T13:24:46', '2005-06-08T16:44:46', '2'), + ('352', '2763', '2006-02-16T02:30:53', '2005-07-11T19:10:38', '2005-07-19T14:46:38', '2'), + ('584', '1007', '2006-02-16T02:30:53', '2005-08-02T12:18:35', '2005-08-05T08:44:35', '2'), + ('132', '4107', '2006-02-16T02:30:53', '2005-07-11T14:20:48', '2005-07-17T13:41:48', '2'), + ('241', '2860', '2006-02-16T02:30:53', '2005-06-19T12:27:19', '2005-06-21T16:26:19', '2'), + ('303', '918', '2006-02-16T02:30:53', '2005-08-21T23:09:32', '2005-08-30T00:46:32', '2'), + ('53', '3449', '2006-02-16T02:30:53', '2005-05-31T15:04:05', '2005-06-07T16:42:05', '2'), + ('482', '2476', '2006-02-16T02:30:53', '2005-07-31T13:32:31', '2005-08-07T09:50:31', '2'), + ('408', '2596', '2006-02-16T02:30:53', '2005-07-31T09:25:14', '2005-08-01T14:43:14', '2'), + ('276', '791', '2006-02-16T02:30:53', '2005-08-17T04:36:31', '2005-08-24T00:03:31', '2'), + ('303', '1358', '2006-02-16T02:30:53', '2005-06-17T09:23:16', '2005-06-22T09:40:16', '2'), + ('211', '3557', '2006-02-16T02:30:53', '2005-08-22T23:19:44', '2005-08-30T19:58:44', '2'), + ('173', '4124', '2006-02-16T02:30:53', '2005-06-19T06:10:08', '2005-06-24T00:39:08', '2'), + ('498', '2965', '2006-02-16T02:30:53', '2005-05-25T06:39:35', '2005-05-30T10:12:35', '2'), + ('535', '3307', '2006-02-16T02:30:53', '2005-08-18T21:57:50', '2005-08-19T18:28:50', '2'), + ('384', '4152', '2006-02-16T02:30:53', '2005-08-22T20:20:04', '2005-08-24T23:26:04', '2'), + ('277', '1809', '2006-02-16T02:30:53', '2005-08-02T10:07:54', '2005-08-05T11:35:54', '2'), + ('290', '3915', '2006-02-16T02:30:53', '2005-06-15T21:55:58', '2005-06-17T02:28:58', '2'), + ('192', '2173', '2006-02-16T02:30:53', '2005-07-08T00:18:32', '2005-07-12T21:17:32', '2'), + ('156', '413', '2006-02-16T02:30:53', '2005-08-22T00:39:31', '2005-08-28T20:08:31', '2'), + ('42', '4130', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('467', '749', '2006-02-16T02:30:53', '2005-08-21T10:38:17', '2005-08-27T08:36:17', '2'), + ('14', '4439', '2006-02-16T02:30:53', '2005-08-22T22:08:11', '2005-08-24T01:05:11', '2'), + ('300', '2002', '2006-02-16T02:30:53', '2005-07-29T01:52:22', '2005-08-05T03:22:22', '2'), + ('339', '1471', '2006-02-16T02:30:53', '2005-05-30T05:41:22', '2005-06-07T09:06:22', '2'), + ('457', '3890', '2006-02-16T02:30:53', '2005-06-19T19:53:30', '2005-06-22T23:21:30', '2'), + ('282', '3836', '2006-02-16T02:30:53', '2005-08-23T04:15:41', '2005-09-01T05:09:41', '2'), + ('271', '2139', '2006-02-16T02:30:53', '2005-07-31T22:11:43', '2005-08-09T17:48:43', '2'), + ('279', '754', '2006-02-16T02:30:53', '2005-08-23T05:39:06', '2005-09-01T01:14:06', '2'), + ('136', '1722', '2006-02-16T02:30:53', '2005-07-11T08:54:09', '2005-07-18T05:23:09', '2'), + ('451', '1121', '2006-02-16T02:30:53', '2005-06-17T00:32:26', '2005-06-22T19:54:26', '2'), + ('577', '728', '2006-02-16T02:30:53', '2005-08-02T06:33:07', '2005-08-10T02:52:07', '2'), + ('28', '1419', '2006-02-16T02:30:53', '2005-08-02T20:32:55', '2005-08-08T23:21:55', '2'), + ('320', '2316', '2006-02-16T02:30:53', '2005-08-17T01:20:30', '2005-08-18T04:29:30', '2'), + ('119', '329', '2006-02-16T02:30:53', '2005-08-18T15:38:31', '2005-08-22T21:29:31', '2'), + ('217', '1453', '2006-02-16T02:30:53', '2005-07-10T03:57:05', '2005-07-13T02:16:05', '2'), + ('454', '1739', '2006-02-16T02:30:53', '2005-07-29T08:45:57', '2005-08-01T12:50:57', '2'), + ('114', '271', '2006-02-16T02:30:53', '2005-08-22T03:14:46', '2005-08-25T03:53:46', '2'), + ('158', '932', '2006-02-16T02:30:53', '2005-08-20T17:09:27', '2005-08-28T13:42:27', '2'), + ('485', '2535', '2006-02-16T02:30:53', '2005-07-30T07:07:39', '2005-08-01T09:22:39', '2'), + ('304', '3320', '2006-02-16T02:30:53', '2005-07-08T00:12:53', '2005-07-17T03:49:53', '2'), + ('409', '4080', '2006-02-16T02:30:53', '2005-08-19T01:40:25', '2005-08-20T23:49:25', '2'), + ('549', '3107', '2006-02-16T02:30:53', '2005-07-27T10:45:28', '2005-08-04T06:24:28', '2'), + ('141', '141', '2006-02-16T02:30:53', '2005-08-22T08:42:45', '2005-08-24T05:20:45', '2'), + ('49', '1254', '2006-02-16T02:30:53', '2005-07-11T16:26:07', '2005-07-17T21:05:07', '2'), + ('111', '2434', '2006-02-16T02:30:53', '2005-08-22T06:12:16', '2005-08-25T08:25:16', '2'), + ('306', '3341', '2006-02-16T02:30:53', '2005-08-20T19:45:43', '2005-08-22T16:47:43', '2'), + ('273', '1596', '2006-02-16T02:30:53', '2005-08-21T00:14:32', '2005-08-24T22:22:32', '2'), + ('75', '4008', '2006-02-16T02:30:53', '2005-07-12T02:09:36', '2005-07-14T03:04:36', '2'), + ('54', '35', '2006-02-16T02:30:53', '2005-08-21T04:34:11', '2005-08-27T10:30:11', '2'), + ('399', '472', '2006-02-16T02:30:53', '2005-08-19T16:53:56', '2005-08-20T11:38:56', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['12212', '15756', '1729', '4673', '14538', '14355', '12971', '13391', '7894', '11703', '6920', '12754', '249', '7902', '6750', '8943', '8820', '9171', '1415', '13902', '2301', '957', '13496', '2158', '6207', '11437', '15544', '9058', '4726', '12973', '16039', '13460', '8166', '4900', '4464', '14073', '7904', '9801', '8602', '14180', '15906', '15783', '3958', '5084', '2988', '3885', '4647', '13340', '13504', '13385', '6529', '5742', '14309', '12411', '14882', '7192', '11244', '11118', '4303', '922', '10188', '1774', '14109', '2164', '2061', '6760', '9611', '6773', '7462', '10371', '13590', '2874', '14127', '6373', '8452', '10416', '6549', '12804', '305', '6924', '7993', '15503', '15460', '12840', '7237', '4241', '391', '3430', '13804', '13898', '46', '5318', '7810', '13133', '6959', '8235', '418', '13814', '15446', '13564']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('449', '3898', '2006-02-16T02:30:53', '2005-08-18T02:33:29', '2005-08-25T07:10:29', '2'), + ('112', '878', '2006-02-16T02:30:53', '2005-08-23T12:47:05', '2005-08-28T08:34:05', '2'), + ('523', '3364', '2006-02-16T02:30:53', '2005-06-16T15:29:47', '2005-06-25T20:55:47', '2'), + ('91', '2792', '2006-02-16T02:30:53', '2005-07-08T10:16:00', '2005-07-17T10:03:00', '2'), + ('471', '3348', '2006-02-16T02:30:53', '2005-08-21T15:28:15', '2005-08-22T19:55:15', '2'), + ('271', '649', '2006-02-16T02:30:53', '2005-08-21T09:08:29', '2005-08-27T10:08:29', '2'), + ('492', '3504', '2006-02-16T02:30:53', '2005-08-19T06:42:43', '2005-08-23T10:49:43', '2'), + ('16', '4220', '2006-02-16T02:30:53', '2005-08-19T22:01:42', '2005-08-24T22:20:42', '2'), + ('330', '3532', '2006-02-16T02:30:53', '2005-07-28T10:53:58', '2005-08-02T13:42:58', '2'), + ('279', '1692', '2006-02-16T02:30:53', '2005-08-17T07:19:29', '2005-08-20T09:35:29', '2'), + ('109', '2301', '2006-02-16T02:30:53', '2005-07-12T22:32:58', '2005-07-19T20:29:58', '2'), + ('134', '4154', '2006-02-16T02:30:53', '2005-08-18T22:37:41', '2005-08-27T20:17:41', '2'), + ('472', '2428', '2006-02-16T02:30:53', '2005-05-26T14:19:09', '2005-05-28T17:47:09', '2'), + ('356', '3066', '2006-02-16T02:30:53', '2005-07-28T11:14:19', '2005-07-30T09:01:19', '2'), + ('459', '3838', '2006-02-16T02:30:53', '2005-07-12T14:49:39', '2005-07-18T18:43:39', '2'), + ('531', '3698', '2006-02-16T02:30:53', '2005-07-30T03:06:48', '2005-08-02T00:59:48', '2'), + ('594', '481', '2006-02-16T02:30:53', '2005-07-29T22:14:56', '2005-08-05T23:36:56', '2'), + ('189', '1832', '2006-02-16T02:30:53', '2005-07-30T11:36:24', '2005-08-07T06:04:24', '2'), + ('331', '1885', '2006-02-16T02:30:53', '2005-06-15T17:31:57', '2005-06-16T22:22:57', '2'), + ('275', '1165', '2006-02-16T02:30:53', '2005-08-20T16:07:08', '2005-08-24T16:43:08', '2'), + ('273', '869', '2006-02-16T02:30:53', '2005-06-18T08:24:03', '2005-06-25T10:31:03', '2'), + ('440', '4428', '2006-02-16T02:30:53', '2005-05-30T17:53:29', '2005-06-03T15:31:29', '2'), + ('454', '3040', '2006-02-16T02:30:53', '2005-08-20T01:42:29', '2005-08-29T06:47:29', '2'), + ('530', '243', '2006-02-16T02:30:53', '2005-06-17T23:36:27', '2005-06-19T19:25:27', '2'), + ('143', '3226', '2006-02-16T02:30:53', '2005-07-11T12:34:24', '2005-07-14T10:15:24', '2'), + ('225', '2679', '2006-02-16T02:30:53', '2005-08-02T20:20:06', '2005-08-05T22:17:06', '2'), + ('30', '1918', '2006-02-16T02:30:53', '2005-08-23T04:17:56', '2005-09-01T00:43:56', '2'), + ('403', '4214', '2006-02-16T02:30:53', '2005-07-30T07:15:45', '2005-07-31T02:57:45', '2'), + ('144', '4369', '2006-02-16T02:30:53', '2005-07-08T12:50:54', '2005-07-17T07:09:54', '2'), + ('163', '128', '2006-02-16T02:30:53', '2005-08-19T06:48:11', '2005-08-22T07:18:11', '2'), + ('78', '545', '2006-02-16T02:30:53', '2005-08-23T22:18:51', '2005-08-31T19:55:51', '2'), + ('410', '244', '2006-02-16T02:30:53', '2005-08-20T00:48:24', '2005-08-28T04:13:24', '2'), + ('42', '3906', '2006-02-16T02:30:53', '2005-07-28T21:23:33', '2005-08-03T21:07:33', '2'), + ('426', '3487', '2006-02-16T02:30:53', '2005-07-08T20:38:06', '2005-07-09T22:45:06', '2'), + ('583', '4484', '2006-02-16T02:30:53', '2005-07-08T00:07:18', '2005-07-08T22:14:18', '2'), + ('230', '2996', '2006-02-16T02:30:53', '2005-08-20T23:12:57', '2005-08-28T18:47:57', '2'), + ('477', '316', '2006-02-16T02:30:53', '2005-07-28T11:25:39', '2005-08-06T08:22:39', '2'), + ('158', '3033', '2006-02-16T02:30:53', '2005-07-31T11:03:13', '2005-08-04T10:55:13', '2'), + ('64', '4002', '2006-02-16T02:30:53', '2005-07-29T13:04:27', '2005-08-03T12:21:27', '2'), + ('262', '796', '2006-02-16T02:30:53', '2005-08-21T03:16:15', '2005-08-24T22:31:15', '2'), + ('445', '3230', '2006-02-16T02:30:53', '2005-08-23T17:36:00', '2005-08-28T15:32:00', '2'), + ('247', '397', '2006-02-16T02:30:53', '2005-08-23T13:45:44', '2005-08-26T09:18:44', '2'), + ('288', '4117', '2006-02-16T02:30:53', '2005-07-06T22:07:33', '2005-07-10T19:31:33', '2'), + ('87', '3113', '2006-02-16T02:30:53', '2005-07-09T05:33:27', '2005-07-17T08:54:27', '2'), + ('557', '3160', '2006-02-16T02:30:53', '2005-06-20T08:59:08', '2005-06-28T04:31:08', '2'), + ('282', '1820', '2006-02-16T02:30:53', '2005-07-06T18:43:43', '2005-07-12T19:48:43', '2'), + ('312', '674', '2006-02-16T02:30:53', '2005-07-08T09:27:36', '2005-07-16T14:56:36', '2'), + ('45', '4358', '2006-02-16T02:30:53', '2005-08-19T20:18:39', '2005-08-28T21:06:39', '2'), + ('293', '4322', '2006-02-16T02:30:53', '2005-08-20T02:01:48', '2005-08-25T21:52:48', '2'), + ('252', '4323', '2006-02-16T02:30:53', '2005-08-19T21:39:35', '2005-08-22T22:38:35', '2'), + ('503', '1058', '2006-02-16T02:30:53', '2005-07-12T04:31:04', '2005-07-17T07:09:04', '2'), + ('596', '3975', '2006-02-16T02:30:53', '2005-07-10T11:56:18', '2005-07-19T06:59:18', '2'), + ('468', '4447', '2006-02-16T02:30:53', '2005-08-21T07:44:17', '2005-08-30T07:23:17', '2'), + ('181', '1234', '2006-02-16T02:30:53', '2005-08-18T09:47:57', '2005-08-21T05:54:57', '2'), + ('417', '12', '2006-02-16T02:30:53', '2005-08-22T03:52:21', '2005-08-25T04:50:21', '2'), + ('532', '4329', '2006-02-16T02:30:53', '2005-07-27T08:36:55', '2005-07-30T11:58:55', '2'), + ('142', '3423', '2006-02-16T02:30:53', '2005-08-02T13:33:24', '2005-08-10T10:18:24', '2'), + ('15', '2411', '2006-02-16T02:30:53', '2005-08-02T08:44:18', '2005-08-05T08:08:18', '2'), + ('108', '818', '2006-02-16T02:30:53', '2005-07-07T16:57:32', '2005-07-14T17:42:32', '2'), + ('550', '2442', '2006-02-16T02:30:53', '2005-05-30T11:55:55', '2005-06-08T10:12:55', '2'), + ('331', '1221', '2006-02-16T02:30:53', '2005-08-01T00:19:41', '2005-08-08T00:19:41', '2'), + ('442', '3058', '2006-02-16T02:30:53', '2005-06-16T18:27:52', '2005-06-21T13:35:52', '2'), + ('180', '1046', '2006-02-16T02:30:53', '2005-08-21T00:52:58', '2005-08-22T00:09:58', '2'), + ('227', '3442', '2006-02-16T02:30:53', '2005-06-17T23:46:21', '2005-06-24T19:10:21', '2'), + ('108', '4575', '2006-02-16T02:30:53', '2005-06-17T15:47:00', '2005-06-24T16:36:00', '2'), + ('502', '501', '2006-02-16T02:30:53', '2005-07-12T15:16:00', '2005-07-20T13:20:00', '2'), + ('215', '1976', '2006-02-16T02:30:53', '2005-07-31T03:54:43', '2005-08-05T03:54:43', '2'), + ('12', '3346', '2006-02-16T02:30:53', '2005-07-12T15:55:39', '2005-07-18T17:52:39', '2'), + ('114', '878', '2006-02-16T02:30:53', '2005-07-27T18:47:47', '2005-07-29T20:46:47', '2'), + ('327', '923', '2006-02-16T02:30:53', '2005-08-01T06:20:29', '2005-08-04T00:31:29', '2'), + ('264', '4417', '2006-02-16T02:30:53', '2005-08-20T05:48:59', '2005-08-25T00:44:59', '2'), + ('166', '331', '2006-02-16T02:30:53', '2005-06-20T00:42:26', '2005-06-28T01:37:26', '2'), + ('550', '4532', '2006-02-16T02:30:53', '2005-08-21T01:33:32', '2005-08-22T02:47:32', '2'), + ('115', '1042', '2006-02-16T02:30:53', '2005-07-11T21:35:20', '2005-07-13T23:22:20', '2'), + ('16', '4312', '2006-02-16T02:30:53', '2005-07-29T07:45:00', '2005-08-05T09:46:00', '2'), + ('449', '2629', '2006-02-16T02:30:53', '2005-08-01T08:08:39', '2005-08-10T09:26:39', '2'), + ('493', '2688', '2006-02-16T02:30:53', '2005-07-12T05:02:01', '2005-07-20T06:19:01', '2'), + ('365', '147', '2006-02-16T02:30:53', '2005-08-19T00:33:15', '2005-08-28T02:16:15', '2'), + ('464', '2665', '2006-02-16T02:30:53', '2005-05-26T21:22:07', '2005-06-02T22:33:07', '2'), + ('502', '1257', '2006-02-16T02:30:53', '2005-07-26T22:51:53', '2005-08-03T19:04:53', '2'), + ('353', '2926', '2006-02-16T02:30:53', '2005-07-28T14:56:41', '2005-08-01T17:01:41', '2'), + ('582', '4519', '2006-02-16T02:30:53', '2005-08-23T02:44:49', '2005-08-27T06:33:49', '2'), + ('20', '2907', '2006-02-16T02:30:53', '2005-08-23T01:10:42', '2005-08-28T20:49:42', '2'), + ('182', '2098', '2006-02-16T02:30:53', '2005-08-19T01:54:11', '2005-08-28T01:11:11', '2'), + ('29', '1904', '2006-02-16T02:30:53', '2005-07-27T10:12:36', '2005-07-31T08:40:36', '2'), + ('595', '4154', '2006-02-16T02:30:53', '2005-07-07T13:39:00', '2005-07-12T17:49:00', '2'), + ('197', '2193', '2006-02-16T02:30:53', '2005-05-27T11:03:55', '2005-06-01T11:59:55', '2'), + ('503', '1613', '2006-02-16T02:30:53', '2005-06-21T18:46:08', '2005-06-22T13:49:08', '2'), + ('19', '2232', '2006-02-16T02:30:53', '2005-08-20T12:46:32', '2005-08-29T14:04:32', '2'), + ('369', '4007', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('7', '3318', '2006-02-16T02:30:53', '2005-05-25T06:04:08', '2005-06-02T08:18:08', '2'), + ('472', '1738', '2006-02-16T02:30:53', '2005-07-09T16:11:33', '2005-07-14T12:49:33', '2'), + ('537', '30', '2006-02-16T02:30:53', '2005-07-28T08:00:38', '2005-08-02T06:14:38', '2'), + ('523', '1635', '2006-02-16T02:30:53', '2005-08-19T12:11:03', '2005-08-28T12:36:03', '2'), + ('452', '1618', '2006-02-16T02:30:53', '2005-07-27T00:07:51', '2005-07-27T20:45:51', '2'), + ('320', '1581', '2006-02-16T02:30:53', '2005-07-29T00:22:56', '2005-08-03T04:03:56', '2'), + ('151', '3063', '2006-02-16T02:30:53', '2005-05-27T15:13:17', '2005-06-04T12:05:17', '2'), + ('436', '2129', '2006-02-16T02:30:53', '2005-08-20T13:07:23', '2005-08-22T16:23:23', '2'), + ('379', '503', '2006-02-16T02:30:53', '2005-08-23T00:49:24', '2005-08-26T02:09:24', '2'), + ('36', '678', '2006-02-16T02:30:53', '2005-08-20T04:34:46', '2005-08-28T23:18:46', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['8383', '8621', '12043', '7711', '4286', '4807', '11135', '11098', '14116', '14385', '10690', '14066', '8176', '15271', '6665', '12338', '854', '12465', '12079', '4138', '5549', '10891', '15773', '7623', '4423', '4521', '6512', '14238', '15759', '7430', '15203', '6372', '14506', '428', '6837', '2986', '15468', '3577', '968', '13019', '4766', '6189', '4776', '4018', '13124', '2262', '2004', '15292', '12603', '1283', '1723', '14877', '10638', '10414', '8825', '12566', '13156', '9097', '6803', '13868', '11136', '8183', '1416', '195', '5788', '8520', '12346', '1903', '9584', '13453', '12311', '12069', '5342', '12115', '9666', '3354', '8083', '14558', '4221', '2930', '10370', '8536', '10317', '8540', '5701', '11635', '11920', '10856', '9743', '4902', '994', '8392', '15882', '10505', '15750', '15753', '1692', '7583', '15597', '3901']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('495', '3809', '2006-02-16T02:30:53', '2005-07-29T05:36:47', '2005-08-03T05:53:47', '2'), + ('358', '2473', '2006-02-16T02:30:53', '2005-07-29T13:52:42', '2005-07-30T11:42:42', '2'), + ('592', '3706', '2006-02-16T02:30:53', '2005-08-17T20:38:21', '2005-08-22T16:52:21', '2'), + ('426', '2695', '2006-02-16T02:30:53', '2005-07-28T04:26:42', '2005-07-29T07:30:42', '2'), + ('111', '4496', '2006-02-16T02:30:53', '2005-07-07T15:36:44', '2005-07-11T13:04:44', '2'), + ('348', '4511', '2006-02-16T02:30:53', '2005-07-08T17:01:48', '2005-07-16T22:33:48', '2'), + ('32', '799', '2006-02-16T02:30:53', '2005-08-02T09:22:25', '2005-08-04T14:30:25', '2'), + ('570', '158', '2006-02-16T02:30:53', '2005-08-02T08:06:18', '2005-08-11T04:50:18', '2'), + ('142', '2356', '2006-02-16T02:30:53', '2005-08-21T01:11:17', '2005-08-24T23:45:17', '2'), + ('317', '4356', '2006-02-16T02:30:53', '2005-08-21T10:02:55', '2005-08-25T07:19:55', '2'), + ('80', '807', '2006-02-16T02:30:53', '2005-08-01T18:05:54', '2005-08-10T21:43:54', '2'), + ('274', '2444', '2006-02-16T02:30:53', '2005-08-20T22:45:58', '2005-08-29T00:23:58', '2'), + ('347', '3527', '2006-02-16T02:30:53', '2005-07-28T21:42:08', '2005-08-03T22:59:08', '2'), + ('59', '4232', '2006-02-16T02:30:53', '2005-08-22T18:48:48', '2005-08-30T00:45:48', '2'), + ('587', '2912', '2006-02-16T02:30:53', '2005-07-12T11:29:14', '2005-07-19T11:26:14', '2'), + ('408', '274', '2006-02-16T02:30:53', '2005-08-18T07:04:24', '2005-08-19T08:36:24', '2'), + ('369', '921', '2006-02-16T02:30:53', '2005-05-30T01:56:11', '2005-06-01T06:34:11', '2'), + ('486', '1733', '2006-02-16T02:30:53', '2005-08-18T11:35:02', '2005-08-21T11:52:02', '2'), + ('230', '646', '2006-02-16T02:30:53', '2005-08-17T22:04:17', '2005-08-24T20:22:17', '2'), + ('317', '1588', '2006-02-16T02:30:53', '2005-07-07T08:17:13', '2005-07-14T05:18:13', '2'), + ('163', '2685', '2006-02-16T02:30:53', '2005-07-10T02:58:29', '2005-07-17T05:24:29', '2'), + ('201', '1269', '2006-02-16T02:30:53', '2005-08-02T01:09:55', '2005-08-05T05:03:55', '2'), + ('189', '1626', '2006-02-16T02:30:53', '2005-08-23T13:24:57', '2005-08-31T14:16:57', '2'), + ('459', '1146', '2006-02-16T02:30:53', '2005-07-28T00:37:41', '2005-08-04T19:38:41', '2'), + ('526', '2721', '2006-02-16T02:30:53', '2005-07-07T22:11:28', '2005-07-14T18:49:28', '2'), + ('327', '2652', '2006-02-16T02:30:53', '2005-07-08T02:57:56', '2005-07-11T22:49:56', '2'), + ('68', '1703', '2006-02-16T02:30:53', '2005-07-12T03:42:49', '2005-07-13T05:01:49', '2'), + ('192', '3148', '2006-02-16T02:30:53', '2005-08-21T05:16:40', '2005-08-30T02:13:40', '2'), + ('361', '1341', '2006-02-16T02:30:53', '2005-08-23T12:47:37', '2005-09-01T11:28:37', '2'), + ('562', '4205', '2006-02-16T02:30:53', '2005-07-27T17:26:14', '2005-08-01T13:02:14', '2'), + ('568', '743', '2006-02-16T02:30:53', '2005-08-22T16:28:00', '2005-08-26T16:55:00', '2'), + ('64', '741', '2006-02-16T02:30:53', '2005-07-11T21:35:06', '2005-07-15T02:30:06', '2'), + ('537', '4493', '2006-02-16T02:30:53', '2005-08-21T14:32:27', '2005-08-24T19:02:27', '2'), + ('161', '3349', '2006-02-16T02:30:53', '2005-05-27T16:10:58', '2005-05-31T17:24:58', '2'), + ('533', '1203', '2006-02-16T02:30:53', '2005-07-12T18:59:45', '2005-07-21T22:47:45', '2'), + ('556', '478', '2006-02-16T02:30:53', '2005-06-20T08:50:28', '2005-06-26T05:24:28', '2'), + ('399', '2440', '2006-02-16T02:30:53', '2005-08-23T01:25:30', '2005-08-28T01:40:30', '2'), + ('152', '4390', '2006-02-16T02:30:53', '2005-07-06T03:40:36', '2005-07-10T05:54:36', '2'), + ('576', '119', '2006-02-16T02:30:53', '2005-05-30T19:20:03', '2005-05-31T18:17:03', '2'), + ('597', '2827', '2006-02-16T02:30:53', '2005-08-19T08:07:43', '2005-08-20T12:09:43', '2'), + ('149', '1057', '2006-02-16T02:30:53', '2005-07-08T15:16:04', '2005-07-15T11:04:04', '2'), + ('552', '3800', '2006-02-16T02:30:53', '2005-07-11T11:36:03', '2005-07-20T15:33:03', '2'), + ('563', '2598', '2006-02-16T02:30:53', '2005-07-08T15:44:20', '2005-07-17T10:50:20', '2'), + ('207', '906', '2006-02-16T02:30:53', '2005-07-07T01:10:33', '2005-07-12T20:54:33', '2'), + ('78', '2105', '2006-02-16T02:30:53', '2005-08-19T11:55:59', '2005-08-26T06:01:59', '2'), + ('218', '4172', '2006-02-16T02:30:53', '2005-06-18T05:49:46', '2005-06-20T00:25:46', '2'), + ('171', '1342', '2006-02-16T02:30:53', '2005-06-17T11:43:38', '2005-06-24T08:05:38', '2'), + ('337', '3072', '2006-02-16T02:30:53', '2005-08-22T19:28:56', '2005-08-28T22:39:56', '2'), + ('119', '2769', '2006-02-16T02:30:53', '2005-08-18T16:56:20', '2005-08-25T11:50:20', '2'), + ('470', '3177', '2006-02-16T02:30:53', '2005-06-15T08:27:30', '2005-06-16T09:46:30', '2'), + ('259', '2417', '2006-02-16T02:30:53', '2005-06-16T15:14:18', '2005-06-23T15:45:18', '2'), + ('266', '974', '2006-02-16T02:30:53', '2005-08-22T03:39:56', '2005-08-24T03:41:56', '2'), + ('132', '2239', '2006-02-16T02:30:53', '2005-08-01T15:44:20', '2005-08-08T16:05:20', '2'), + ('361', '1271', '2006-02-16T02:30:53', '2005-08-01T08:03:55', '2005-08-04T08:44:55', '2'), + ('101', '881', '2006-02-16T02:30:53', '2005-07-29T22:24:16', '2005-08-05T00:27:16', '2'), + ('407', '1684', '2006-02-16T02:30:53', '2005-08-18T15:13:04', '2005-08-21T19:29:04', '2'), + ('512', '770', '2006-02-16T02:30:53', '2005-08-19T13:10:42', '2005-08-25T15:08:42', '2'), + ('173', '570', '2006-02-16T02:30:53', '2005-07-30T08:40:35', '2005-08-04T11:19:35', '2'), + ('490', '2676', '2006-02-16T02:30:53', '2005-07-12T17:21:49', '2005-07-14T18:01:49', '2'), + ('51', '3173', '2006-02-16T02:30:53', '2005-08-20T15:06:26', '2005-08-22T19:08:26', '2'), + ('559', '1315', '2006-02-16T02:30:53', '2005-08-02T09:22:57', '2005-08-08T14:12:57', '2'), + ('119', '1545', '2006-02-16T02:30:53', '2005-07-28T22:21:07', '2005-08-04T19:20:07', '2'), + ('167', '3816', '2006-02-16T02:30:53', '2005-06-15T17:44:57', '2005-06-22T20:53:57', '2'), + ('564', '506', '2006-02-16T02:30:53', '2005-05-26T06:52:36', '2005-05-31T02:47:36', '2'), + ('63', '1707', '2006-02-16T02:30:53', '2005-07-10T14:10:22', '2005-07-14T19:46:22', '2'), + ('103', '2440', '2006-02-16T02:30:53', '2005-07-29T10:10:02', '2005-08-02T05:25:02', '2'), + ('265', '1200', '2006-02-16T02:30:53', '2005-08-18T07:17:55', '2005-08-21T11:35:55', '2'), + ('588', '1939', '2006-02-16T02:30:53', '2005-06-17T04:37:20', '2005-06-26T09:05:20', '2'), + ('141', '419', '2006-02-16T02:30:53', '2005-07-31T03:05:48', '2005-08-01T05:50:48', '2'), + ('164', '2203', '2006-02-16T02:30:53', '2005-08-20T00:30:51', '2005-08-28T18:43:51', '2'), + ('211', '1650', '2006-02-16T02:30:53', '2005-08-18T06:07:00', '2005-08-21T07:54:00', '2'), + ('389', '631', '2006-02-16T02:30:53', '2005-08-17T21:39:40', '2005-08-22T01:12:40', '2'), + ('289', '3828', '2006-02-16T02:30:53', '2005-07-09T17:20:03', '2005-07-18T12:44:03', '2'), + ('457', '1228', '2006-02-16T02:30:53', '2005-08-17T23:04:15', '2005-08-20T22:25:15', '2'), + ('592', '4318', '2006-02-16T02:30:53', '2005-07-31T06:20:58', '2005-08-06T06:09:58', '2'), + ('529', '1083', '2006-02-16T02:30:53', '2005-06-21T11:29:49', '2005-06-25T07:39:49', '2'), + ('30', '2187', '2006-02-16T02:30:53', '2005-07-28T18:09:48', '2005-08-04T21:47:48', '2'), + ('273', '3958', '2006-02-16T02:30:53', '2005-08-21T16:10:50', '2005-08-28T16:36:50', '2'), + ('143', '4567', '2006-02-16T02:30:53', '2005-07-07T12:18:57', '2005-07-12T09:47:57', '2'), + ('585', '3615', '2006-02-16T02:30:53', '2005-06-20T04:50:29', '2005-06-28T06:00:29', '2'), + ('546', '4358', '2006-02-16T02:30:53', '2005-08-01T06:18:04', '2005-08-05T01:41:04', '2'), + ('219', '4510', '2006-02-16T02:30:53', '2005-07-29T10:37:23', '2005-07-31T07:21:23', '2'), + ('561', '110', '2006-02-16T02:30:53', '2005-08-01T04:35:34', '2005-08-06T02:27:34', '2'), + ('180', '539', '2006-02-16T02:30:53', '2005-07-29T10:52:51', '2005-08-07T11:44:51', '2'), + ('91', '2395', '2006-02-16T02:30:53', '2005-07-10T09:56:24', '2005-07-16T15:11:24', '2'), + ('98', '2642', '2006-02-16T02:30:53', '2005-08-17T04:33:17', '2005-08-21T07:50:17', '2'), + ('402', '4253', '2006-02-16T02:30:53', '2005-08-17T16:10:19', '2005-08-20T13:54:19', '2'), + ('451', '2010', '2006-02-16T02:30:53', '2005-08-02T00:07:14', '2005-08-04T02:48:14', '2'), + ('476', '1740', '2006-02-16T02:30:53', '2005-07-31T09:12:42', '2005-08-06T11:57:42', '2'), + ('554', '2238', '2006-02-16T02:30:53', '2005-07-08T20:49:30', '2005-07-13T16:54:30', '2'), + ('472', '2798', '2006-02-16T02:30:53', '2005-05-30T23:55:36', '2005-06-04T01:00:36', '2'), + ('65', '1323', '2006-02-16T02:30:53', '2005-07-29T06:00:27', '2005-08-02T00:30:27', '2'), + ('312', '2028', '2006-02-16T02:30:53', '2005-08-23T16:44:31', '2005-09-01T15:44:31', '2'), + ('426', '2977', '2006-02-16T02:30:53', '2005-08-01T11:13:59', '2005-08-05T07:20:59', '2'), + ('496', '4474', '2006-02-16T02:30:53', '2005-08-23T12:36:05', '2005-08-24T17:40:05', '2'), + ('144', '3451', '2006-02-16T02:30:53', '2005-08-23T12:43:30', '2005-09-01T09:07:30', '2'), + ('514', '3544', '2006-02-16T02:30:53', '2005-06-16T12:30:19', '2005-06-17T17:31:19', '2'), + ('198', '2890', '2006-02-16T02:30:53', '2005-07-27T23:15:22', '2005-08-04T04:39:22', '2'), + ('420', '3795', '2006-02-16T02:30:53', '2005-08-23T06:21:20', '2005-08-28T02:47:20', '2'), + ('321', '3367', '2006-02-16T02:30:53', '2005-07-06T19:24:55', '2005-07-14T20:30:55', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['3331', '10182', '5455', '3236', '10596', '14300', '6453', '6978', '4927', '15633', '1277', '3323', '4223', '13718', '4943', '4808', '12920', '7184', '5471', '14045', '13284', '9571', '4471', '11115', '4021', '7684', '9512', '2721', '14121', '4722', '8301', '3214', '14647', '3375', '5063', '4817', '7293', '12917', '291', '13243', '15648', '4763', '1693', '5602', '7714', '11988', '4154', '677', '10239', '869', '14668', '215', '3270', '12635', '9643', '5761', '4061', '9370', '6285', '9574', '7633', '7143', '12099', '637', '8417', '12948', '87', '13287', '70', '13087', '14449', '5695', '12551', '1409', '9459', '4070', '442', '8446', '9860', '15467', '2335', '10154', '14183', '2134', '14207', '7243', '10714', '13878', '9398', '16016', '6946', '6831', '9971', '11528', '234', '4450', '8870', '12200', '2656', '5802']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('352', '2913', '2006-02-16T02:30:53', '2005-06-21T09:37:53', '2005-06-26T04:01:53', '2'), + ('578', '4112', '2006-02-16T02:30:53', '2005-08-01T00:08:01', '2005-08-09T18:14:01', '2'), + ('464', '1955', '2006-02-16T02:30:53', '2005-07-09T22:28:45', '2005-07-18T02:50:45', '2'), + ('550', '1492', '2006-02-16T02:30:53', '2005-06-21T02:47:43', '2005-06-29T08:04:43', '2'), + ('112', '803', '2006-02-16T02:30:53', '2005-08-01T14:18:57', '2005-08-07T14:59:57', '2'), + ('382', '690', '2006-02-16T02:30:53', '2005-08-21T07:19:37', '2005-08-25T12:06:37', '2'), + ('169', '2506', '2006-02-16T02:30:53', '2005-07-12T00:59:53', '2005-07-14T19:17:53', '2'), + ('132', '3645', '2006-02-16T02:30:53', '2005-07-27T00:47:40', '2005-07-31T04:32:40', '2'), + ('136', '2566', '2006-02-16T02:30:53', '2005-07-08T22:05:35', '2005-07-14T23:22:35', '2'), + ('497', '882', '2006-02-16T02:30:53', '2005-08-23T07:31:10', '2005-08-26T04:35:10', '2'), + ('464', '76', '2006-02-16T02:30:53', '2005-06-15T08:01:29', '2005-06-22T07:16:29', '2'), + ('272', '2252', '2006-02-16T02:30:53', '2005-06-21T08:45:33', '2005-06-28T08:17:33', '2'), + ('405', '2407', '2006-02-16T02:30:53', '2005-07-07T12:23:54', '2005-07-10T14:46:54', '2'), + ('19', '205', '2006-02-16T02:30:53', '2005-08-20T09:53:44', '2005-08-29T13:46:44', '2'), + ('11', '2732', '2006-02-16T02:30:53', '2005-07-08T22:43:05', '2005-07-15T18:17:05', '2'), + ('563', '2544', '2006-02-16T02:30:53', '2005-07-08T17:02:49', '2005-07-12T22:49:49', '2'), + ('511', '2516', '2006-02-16T02:30:53', '2005-08-19T04:32:32', '2005-08-27T00:44:32', '2'), + ('457', '2324', '2006-02-16T02:30:53', '2005-07-27T08:22:26', '2005-08-02T09:34:26', '2'), + ('347', '4086', '2006-02-16T02:30:53', '2005-07-09T23:11:52', '2005-07-13T02:08:52', '2'), + ('509', '3010', '2006-02-16T02:30:53', '2005-08-20T21:50:11', '2005-08-25T19:03:11', '2'), + ('338', '2128', '2006-02-16T02:30:53', '2005-08-19T18:12:31', '2005-08-25T21:26:31', '2'), + ('1', '2219', '2006-02-16T02:30:53', '2005-07-31T02:42:18', '2005-08-02T23:26:18', '2'), + ('30', '263', '2006-02-16T02:30:53', '2005-07-08T00:21:29', '2005-07-11T18:48:29', '2'), + ('408', '3812', '2006-02-16T02:30:53', '2005-08-02T08:31:06', '2005-08-04T02:36:06', '2'), + ('315', '1676', '2006-02-16T02:30:53', '2005-07-07T01:46:44', '2005-07-12T00:16:44', '2'), + ('40', '3365', '2006-02-16T02:30:53', '2005-07-28T03:11:54', '2005-07-31T04:40:54', '2'), + ('173', '3786', '2006-02-16T02:30:53', '2005-07-31T00:26:30', '2005-08-04T23:43:30', '2'), + ('358', '3786', '2006-02-16T02:30:53', '2005-06-19T14:53:24', '2005-06-21T18:22:24', '2'), + ('417', '4207', '2006-02-16T02:30:53', '2005-08-21T01:26:33', '2005-08-28T22:47:33', '2'), + ('590', '3738', '2006-02-16T02:30:53', '2005-07-08T12:42:27', '2005-07-09T09:14:27', '2'), + ('101', '562', '2006-02-16T02:30:53', '2005-07-29T03:00:08', '2005-08-01T04:26:08', '2'), + ('142', '776', '2006-02-16T02:30:53', '2005-06-21T01:08:26', '2005-06-23T03:24:26', '2'), + ('36', '3854', '2006-02-16T02:30:53', '2005-08-21T19:15:33', '2005-08-30T18:58:33', '2'), + ('279', '912', '2006-02-16T02:30:53', '2005-06-21T13:37:18', '2005-06-22T11:26:18', '2'), + ('133', '1027', '2006-02-16T02:30:53', '2005-07-09T04:37:31', '2005-07-13T09:56:31', '2'), + ('145', '1608', '2006-02-16T02:30:53', '2005-07-08T17:17:31', '2005-07-09T22:32:31', '2'), + ('5', '3333', '2006-02-16T02:30:53', '2005-07-27T12:37:28', '2005-07-30T15:12:28', '2'), + ('152', '107', '2006-02-16T02:30:53', '2005-08-19T04:27:11', '2005-08-20T03:04:11', '2'), + ('577', '485', '2006-02-16T02:30:53', '2005-05-26T20:20:47', '2005-06-03T02:06:47', '2'), + ('251', '355', '2006-02-16T02:30:53', '2005-08-19T16:33:16', '2005-08-25T13:19:16', '2'), + ('80', '4039', '2006-02-16T02:30:53', '2005-08-23T08:27:57', '2005-08-30T08:53:57', '2'), + ('465', '899', '2006-02-16T02:30:53', '2005-07-08T14:57:32', '2005-07-15T10:00:32', '2'), + ('421', '2386', '2006-02-16T02:30:53', '2005-06-16T12:39:51', '2005-06-19T16:19:51', '2'), + ('253', '3544', '2006-02-16T02:30:53', '2005-07-10T05:02:22', '2005-07-14T23:40:22', '2'), + ('70', '940', '2006-02-16T02:30:53', '2005-07-28T04:32:30', '2005-08-02T07:10:30', '2'), + ('62', '3429', '2006-02-16T02:30:53', '2005-08-17T18:23:50', '2005-08-18T22:30:50', '2'), + ('594', '191', '2006-02-16T02:30:53', '2005-07-07T08:58:23', '2005-07-14T03:16:23', '2'), + ('194', '4558', '2006-02-16T02:30:53', '2005-05-28T23:00:08', '2005-06-05T19:11:08', '2'), + ('467', '1232', '2006-02-16T02:30:53', '2005-08-01T02:09:22', '2005-08-04T01:35:22', '2'), + ('296', '3399', '2006-02-16T02:30:53', '2005-05-30T04:22:06', '2005-06-03T09:18:06', '2'), + ('152', '1450', '2006-02-16T02:30:53', '2005-08-21T19:51:30', '2005-08-29T19:38:30', '2'), + ('197', '679', '2006-02-16T02:30:53', '2005-05-26T09:02:47', '2005-05-28T09:45:47', '2'), + ('86', '1578', '2006-02-16T02:30:53', '2005-06-21T05:07:31', '2005-06-22T07:45:31', '2'), + ('15', '331', '2006-02-16T02:30:53', '2005-08-18T18:00:23', '2005-08-23T16:40:23', '2'), + ('538', '3576', '2006-02-16T02:30:53', '2005-07-31T05:35:48', '2005-08-08T04:28:48', '2'), + ('287', '1763', '2006-02-16T02:30:53', '2005-07-10T12:45:36', '2005-07-13T10:05:36', '2'), + ('70', '62', '2006-02-16T02:30:53', '2005-07-07T04:13:35', '2005-07-10T23:58:35', '2'), + ('588', '4433', '2006-02-16T02:30:53', '2005-07-30T18:57:29', '2005-08-01T21:35:29', '2'), + ('444', '2140', '2006-02-16T02:30:53', '2005-07-11T16:52:07', '2005-07-13T21:33:07', '2'), + ('233', '2782', '2006-02-16T02:30:53', '2005-07-31T02:49:20', '2005-08-05T02:36:20', '2'), + ('402', '4171', '2006-02-16T02:30:53', '2005-07-28T01:03:41', '2005-08-01T23:54:41', '2'), + ('91', '2877', '2006-02-16T02:30:53', '2005-07-27T06:56:31', '2005-07-31T04:38:31', '2'), + ('195', '1743', '2006-02-16T02:30:53', '2005-08-17T22:38:54', '2005-08-18T21:29:54', '2'), + ('250', '1581', '2006-02-16T02:30:53', '2005-05-28T18:14:29', '2005-05-29T23:48:29', '2'), + ('227', '750', '2006-02-16T02:30:53', '2005-07-29T06:53:36', '2005-08-06T09:31:36', '2'), + ('442', '4173', '2006-02-16T02:30:53', '2005-08-19T05:55:14', '2005-08-22T01:05:14', '2'), + ('331', '1586', '2006-02-16T02:30:53', '2005-05-25T13:52:43', '2005-05-29T11:12:43', '2'), + ('569', '2716', '2006-02-16T02:30:53', '2005-08-19T18:28:24', '2005-08-26T20:13:24', '2'), + ('73', '2168', '2006-02-16T02:30:53', '2005-05-25T10:15:23', '2005-05-27T05:56:23', '2'), + ('171', '2693', '2006-02-16T02:30:53', '2005-08-19T10:33:52', '2005-08-27T09:15:52', '2'), + ('529', '653', '2006-02-16T02:30:53', '2005-08-21T12:13:18', '2005-08-27T15:41:18', '2'), + ('459', '440', '2006-02-16T02:30:53', '2005-07-10T09:43:40', '2005-07-13T15:04:40', '2'), + ('15', '2195', '2006-02-16T02:30:53', '2005-08-18T14:46:26', '2005-08-19T16:59:26', '2'), + ('297', '1398', '2006-02-16T02:30:53', '2005-06-15T16:58:12', '2005-06-21T11:21:12', '2'), + ('489', '1132', '2006-02-16T02:30:53', '2005-07-30T22:24:46', '2005-08-02T00:44:46', '2'), + ('496', '2926', '2006-02-16T02:30:53', '2005-07-07T04:37:09', '2005-07-08T04:19:09', '2'), + ('403', '1457', '2006-02-16T02:30:53', '2005-05-27T18:12:13', '2005-05-30T12:30:13', '2'), + ('235', '1593', '2006-02-16T02:30:53', '2005-07-29T07:38:10', '2005-08-06T04:39:10', '2'), + ('585', '3266', '2006-02-16T02:30:53', '2005-07-31T13:03:24', '2005-08-07T07:28:24', '2'), + ('103', '3658', '2006-02-16T02:30:53', '2005-08-23T01:22:12', '2005-08-29T23:42:12', '2'), + ('446', '3968', '2006-02-16T02:30:53', '2005-06-18T10:59:36', '2005-06-26T06:42:36', '2'), + ('149', '2745', '2006-02-16T02:30:53', '2005-07-31T22:30:49', '2005-08-07T03:05:49', '2'), + ('26', '1888', '2006-02-16T02:30:53', '2005-08-21T03:24:29', '2005-08-22T07:25:29', '2'), + ('378', '1699', '2006-02-16T02:30:53', '2005-06-17T21:13:44', '2005-06-26T16:28:44', '2'), + ('569', '1327', '2006-02-16T02:30:53', '2005-08-21T04:08:19', '2005-08-29T07:59:19', '2'), + ('238', '1287', '2006-02-16T02:30:53', '2005-07-27T10:26:11', '2005-07-29T11:43:11', '2'), + ('64', '1465', '2006-02-16T02:30:53', '2005-08-01T18:51:29', '2005-08-04T18:49:29', '2'), + ('481', '49', '2006-02-16T02:30:53', '2005-08-20T15:17:38', '2005-08-21T21:11:38', '2'), + ('570', '1175', '2006-02-16T02:30:53', '2005-07-30T20:09:00', '2005-08-01T23:35:00', '2'), + ('595', '3374', '2006-02-16T02:30:53', '2005-08-23T21:26:35', '2005-08-28T16:06:35', '2'), + ('181', '1854', '2006-02-16T02:30:53', '2005-07-26T23:40:07', '2005-08-04T01:18:07', '2'), + ('163', '924', '2006-02-16T02:30:53', '2005-07-12T18:44:04', '2005-07-16T21:39:04', '2'), + ('573', '2674', '2006-02-16T02:30:53', '2005-07-31T16:42:16', '2005-08-09T18:08:16', '2'), + ('14', '893', '2006-02-16T02:30:53', '2005-08-17T00:27:23', '2005-08-22T06:12:23', '2'), + ('566', '1321', '2006-02-16T02:30:53', '2005-05-26T11:47:20', '2005-06-03T10:39:20', '2'), + ('345', '1252', '2006-02-16T02:30:53', '2005-07-07T23:20:05', '2005-07-13T19:50:05', '2'), + ('90', '4104', '2006-02-16T02:30:53', '2005-07-30T00:08:08', '2005-08-08T00:15:08', '2'), + ('52', '840', '2006-02-16T02:30:53', '2005-08-18T02:12:33', '2005-08-18T20:47:33', '2'), + ('280', '559', '2006-02-16T02:30:53', '2005-06-19T10:42:33', '2005-06-24T08:31:33', '2'), + ('520', '2295', '2006-02-16T02:30:53', '2005-07-10T15:02:17', '2005-07-19T15:43:17', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['3253', '7650', '1579', '2627', '10641', '11722', '4794', '14508', '12375', '846', '8254', '1479', '6600', '1123', '15431', '9283', '7546', '8019', '14499', '15522', '10215', '10721', '3022', '14592', '6602', '9878', '11475', '9659', '7071', '9877', '7459', '12386', '7165', '6033', '369', '1258', '15868', '15394', '301', '8467', '2948', '14410', '4796', '11886', '13473', '6099', '7652', '12363', '15064', '12232', '11892', '6344', '10309', '9760', '11706', '13459', '5001', '14771', '385', '15639', '4606', '1069', '12599', '12591', '8608', '12418', '350', '10693', '148', '15696', '15244', '5351', '13048', '13781', '6964', '11440', '11457', '887', '7895', '14675', '2059', '15819', '8351', '6780', '8645', '8319', '15629', '14958', '5307', '6436', '13962', '7037', '9419', '15760', '2120', '12806', '7981', '4893', '14666', '2143']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('405', '1906', '2006-02-16T02:30:53', '2005-06-21T03:25:37', '2005-06-27T02:46:37', '2'), + ('290', '701', '2006-02-16T02:30:53', '2005-07-28T01:47:20', '2005-08-05T06:00:20', '2'), + ('35', '158', '2006-02-16T02:30:53', '2005-06-16T04:09:08', '2005-06-21T05:21:08', '2'), + ('592', '2779', '2006-02-16T02:30:53', '2005-06-19T08:32:00', '2005-06-24T04:31:00', '2'), + ('285', '972', '2006-02-16T02:30:53', '2005-08-01T15:44:57', '2005-08-04T18:15:57', '2'), + ('321', '2430', '2006-02-16T02:30:53', '2005-08-17T07:53:03', '2005-08-22T06:56:03', '2'), + ('451', '2497', '2006-02-16T02:30:53', '2005-07-08T16:30:11', '2005-07-17T12:41:11', '2'), + ('396', '703', '2006-02-16T02:30:53', '2005-08-21T14:33:58', '2005-08-27T10:45:58', '2'), + ('365', '3508', '2006-02-16T02:30:53', '2005-08-18T08:20:08', '2005-08-21T08:50:08', '2'), + ('49', '938', '2006-02-16T02:30:53', '2005-05-30T01:17:45', '2005-06-01T00:56:45', '2'), + ('392', '1787', '2006-02-16T02:30:53', '2005-07-29T00:59:31', '2005-08-03T23:43:31', '2'), + ('592', '172', '2006-02-16T02:30:53', '2005-06-15T21:13:38', '2005-06-17T01:26:38', '2'), + ('389', '3315', '2006-02-16T02:30:53', '2005-07-12T07:41:48', '2005-07-18T12:36:48', '2'), + ('448', '142', '2006-02-16T02:30:53', '2005-05-31T16:48:43', '2005-06-02T19:17:43', '2'), + ('550', '3251', '2006-02-16T02:30:53', '2005-08-23T00:26:47', '2005-08-31T23:26:47', '2'), + ('360', '1858', '2006-02-16T02:30:53', '2005-07-30T15:25:19', '2005-08-01T15:35:19', '2'), + ('494', '3683', '2006-02-16T02:30:53', '2005-07-27T21:50:09', '2005-08-05T03:07:09', '2'), + ('84', '1844', '2006-02-16T02:30:53', '2005-07-28T15:37:43', '2005-08-04T15:40:43', '2'), + ('292', '4109', '2006-02-16T02:30:53', '2005-08-21T14:11:19', '2005-08-23T16:10:19', '2'), + ('468', '2396', '2006-02-16T02:30:53', '2005-08-23T03:32:31', '2005-08-30T02:17:31', '2'), + ('345', '838', '2006-02-16T02:30:53', '2005-08-01T01:04:28', '2005-08-09T21:43:28', '2'), + ('18', '904', '2006-02-16T02:30:53', '2005-08-01T19:05:18', '2005-08-09T20:45:18', '2'), + ('466', '3745', '2006-02-16T02:30:53', '2005-06-20T11:17:20', '2005-06-26T13:15:20', '2'), + ('563', '2681', '2006-02-16T02:30:53', '2005-08-21T17:30:17', '2005-08-22T20:06:17', '2'), + ('214', '2382', '2006-02-16T02:30:53', '2005-07-12T07:50:24', '2005-07-20T03:25:24', '2'), + ('424', '1753', '2006-02-16T02:30:53', '2005-07-31T13:42:02', '2005-08-05T10:15:02', '2'), + ('194', '3687', '2006-02-16T02:30:53', '2005-08-02T21:55:09', '2005-08-09T20:28:09', '2'), + ('360', '4262', '2006-02-16T02:30:53', '2005-07-31T06:02:14', '2005-08-07T00:54:14', '2'), + ('61', '4361', '2006-02-16T02:30:53', '2005-07-27T04:01:15', '2005-08-03T05:18:15', '2'), + ('559', '1299', '2006-02-16T02:30:53', '2005-07-31T13:41:57', '2005-08-06T15:27:57', '2'), + ('2', '2053', '2006-02-16T02:30:53', '2005-07-27T18:40:20', '2005-08-02T21:07:20', '2'), + ('199', '3303', '2006-02-16T02:30:53', '2005-08-18T08:45:57', '2005-08-24T04:50:57', '2'), + ('243', '497', '2006-02-16T02:30:53', '2005-07-27T07:36:46', '2005-07-30T09:22:46', '2'), + ('322', '2819', '2006-02-16T02:30:53', '2005-07-11T02:59:34', '2005-07-16T03:48:34', '2'), + ('508', '944', '2006-02-16T02:30:53', '2005-05-27T07:46:49', '2005-06-01T06:20:49', '2'), + ('320', '4530', '2006-02-16T02:30:53', '2005-06-15T06:21:30', '2005-06-18T05:43:30', '2'), + ('306', '2186', '2006-02-16T02:30:53', '2005-08-23T16:19:14', '2005-08-29T16:14:14', '2'), + ('507', '3455', '2006-02-16T02:30:53', '2005-08-22T23:04:21', '2005-08-25T20:53:21', '2'), + ('274', '3448', '2006-02-16T02:30:53', '2005-05-26T21:06:14', '2005-06-01T01:54:14', '2'), + ('326', '263', '2006-02-16T02:30:53', '2005-07-29T08:25:35', '2005-08-07T03:28:35', '2'), + ('289', '4254', '2006-02-16T02:30:53', '2005-06-20T06:02:35', '2005-06-29T09:12:35', '2'), + ('196', '839', '2006-02-16T02:30:53', '2005-08-21T10:54:49', '2005-08-26T08:28:49', '2'), + ('9', '2484', '2006-02-16T02:30:53', '2005-07-08T16:35:44', '2005-07-13T11:08:44', '2'), + ('204', '608', '2006-02-16T02:30:53', '2005-08-17T14:58:51', '2005-08-19T16:07:51', '2'), + ('390', '381', '2006-02-16T02:30:53', '2005-08-20T01:03:50', '2005-08-22T02:33:50', '2'), + ('469', '3865', '2006-02-16T02:30:53', '2005-07-11T06:24:44', '2005-07-15T08:03:44', '2'), + ('5', '92', '2006-02-16T02:30:53', '2005-07-28T01:50:29', '2005-07-30T22:23:29', '2'), + ('181', '3447', '2006-02-16T02:30:53', '2005-08-18T07:52:49', '2005-08-26T03:20:49', '2'), + ('425', '1233', '2006-02-16T02:30:53', '2005-08-22T10:41:58', '2005-08-28T13:34:58', '2'), + ('87', '2399', '2006-02-16T02:30:53', '2005-08-18T03:14:14', '2005-08-19T05:44:14', '2'), + ('227', '746', '2006-02-16T02:30:53', '2005-08-17T15:13:21', '2005-08-21T09:19:21', '2'), + ('78', '3074', '2006-02-16T02:30:53', '2005-07-11T20:04:43', '2005-07-18T14:35:43', '2'), + ('156', '1505', '2006-02-16T02:30:53', '2005-08-01T04:24:18', '2005-08-09T08:32:18', '2'), + ('511', '426', '2006-02-16T02:30:53', '2005-07-31T09:29:33', '2005-08-09T07:32:33', '2'), + ('414', '4234', '2006-02-16T02:30:53', '2005-08-17T07:23:46', '2005-08-18T10:13:46', '2'), + ('114', '3666', '2006-02-16T02:30:53', '2005-08-20T00:45:40', '2005-08-29T02:53:40', '2'), + ('40', '2025', '2006-02-16T02:30:53', '2005-07-09T01:17:04', '2005-07-16T03:25:04', '2'), + ('149', '2665', '2006-02-16T02:30:53', '2005-08-21T23:50:15', '2005-08-28T22:55:15', '2'), + ('213', '1565', '2006-02-16T02:30:53', '2005-05-27T10:23:25', '2005-05-30T15:27:25', '2'), + ('214', '42', '2006-02-16T02:30:53', '2005-08-23T08:03:25', '2005-08-24T10:21:25', '2'), + ('502', '1946', '2006-02-16T02:30:53', '2005-07-08T07:05:50', '2005-07-16T09:11:50', '2'), + ('251', '3057', '2006-02-16T02:30:53', '2005-05-31T09:32:31', '2005-06-08T10:19:31', '2'), + ('34', '2032', '2006-02-16T02:30:53', '2005-08-18T16:42:45', '2005-08-23T18:27:45', '2'), + ('546', '723', '2006-02-16T02:30:53', '2005-08-18T16:16:41', '2005-08-24T10:29:41', '2'), + ('165', '2976', '2006-02-16T02:30:53', '2005-07-29T13:18:52', '2005-07-30T19:01:52', '2'), + ('241', '4186', '2006-02-16T02:30:53', '2005-08-18T09:59:36', '2005-08-19T11:35:36', '2'), + ('9', '2756', '2006-02-16T02:30:53', '2005-05-27T05:01:28', '2005-06-04T05:01:28', '2'), + ('444', '2387', '2006-02-16T02:30:53', '2005-08-01T18:14:14', '2005-08-03T22:00:14', '2'), + ('142', '4252', '2006-02-16T02:30:53', '2005-05-26T00:25:23', '2005-06-01T19:29:23', '2'), + ('93', '2836', '2006-02-16T02:30:53', '2005-08-23T10:04:17', '2005-08-25T08:47:17', '2'), + ('271', '1486', '2006-02-16T02:30:53', '2005-08-22T17:48:42', '2005-08-28T13:17:42', '2'), + ('112', '3722', '2006-02-16T02:30:53', '2005-07-09T17:40:52', '2005-07-14T16:55:52', '2'), + ('486', '1029', '2006-02-16T02:30:53', '2005-08-19T09:25:06', '2005-08-28T11:18:06', '2'), + ('368', '971', '2006-02-16T02:30:53', '2005-08-20T12:06:45', '2005-08-26T06:50:45', '2'), + ('404', '1537', '2006-02-16T02:30:53', '2005-07-27T00:15:04', '2005-07-31T00:04:04', '2'), + ('306', '2727', '2006-02-16T02:30:53', '2005-08-02T20:24:02', '2005-08-07T16:42:02', '2'), + ('379', '1642', '2006-02-16T02:30:53', '2005-08-02T21:14:16', '2005-08-10T02:39:16', '2'), + ('16', '2727', '2006-02-16T02:30:53', '2005-05-30T07:10:00', '2005-06-01T06:48:00', '2'), + ('67', '900', '2006-02-16T02:30:53', '2005-07-28T10:57:15', '2005-08-02T15:10:15', '2'), + ('170', '328', '2006-02-16T02:30:53', '2005-08-21T20:01:51', '2005-08-26T14:30:51', '2'), + ('114', '739', '2006-02-16T02:30:53', '2005-06-17T15:36:12', '2005-06-18T19:01:12', '2'), + ('274', '3639', '2006-02-16T02:30:53', '2005-08-23T15:01:54', '2005-08-31T20:01:54', '2'), + ('202', '2963', '2006-02-16T02:30:53', '2005-07-29T04:50:53', '2005-07-30T07:28:53', '2'), + ('121', '1255', '2006-02-16T02:30:53', '2005-07-12T16:18:12', '2005-07-13T17:56:12', '2'), + ('535', '2532', '2006-02-16T02:30:53', '2005-07-29T14:47:45', '2005-07-30T14:56:45', '2'), + ('280', '747', '2006-02-16T02:30:53', '2005-07-29T03:44:52', '2005-08-01T00:35:52', '2'), + ('286', '3725', '2006-02-16T02:30:53', '2005-08-23T07:28:22', '2005-08-29T06:29:22', '2'), + ('347', '1710', '2006-02-16T02:30:53', '2005-08-22T06:30:10', '2005-08-28T09:43:10', '2'), + ('32', '2847', '2006-02-16T02:30:53', '2005-07-09T15:57:15', '2005-07-17T13:42:15', '2'), + ('122', '3758', '2006-02-16T02:30:53', '2005-07-12T00:18:42', '2005-07-13T03:57:42', '2'), + ('348', '1434', '2006-02-16T02:30:53', '2005-08-20T18:18:06', '2005-08-24T22:16:06', '2'), + ('171', '3155', '2006-02-16T02:30:53', '2005-07-27T03:06:44', '2005-08-02T04:51:44', '2'), + ('142', '4427', '2006-02-16T02:30:53', '2005-07-30T21:04:59', '2005-08-06T15:47:59', '2'), + ('273', '3050', '2006-02-16T02:30:53', '2005-08-23T12:50:00', '2005-08-29T15:41:00', '2'), + ('182', '1498', '2006-02-16T02:30:53', '2005-06-17T20:36:50', '2005-06-27T01:18:50', '2'), + ('423', '4488', '2006-02-16T02:30:53', '2005-08-19T00:37:26', '2005-08-23T18:49:26', '2'), + ('392', '90', '2006-02-16T02:30:53', '2005-07-28T14:18:25', '2005-08-04T15:21:25', '2'), + ('210', '2060', '2006-02-16T02:30:53', '2005-07-08T20:19:55', '2005-07-15T21:28:55', '2'), + ('122', '2560', '2006-02-16T02:30:53', '2005-08-21T19:51:09', '2005-08-30T22:42:09', '2'), + ('507', '1257', '2006-02-16T02:30:53', '2005-06-17T21:58:13', '2005-06-19T23:59:13', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['14749', '8002', '3894', '11685', '1008', '9107', '14630', '14177', '5855', '5672', '8099', '8860', '1807', '4026', '5646', '8141', '4317', '15166', '8160', '13588', '1575', '15568', '15122', '6220', '9728', '10657', '14715', '11354', '14734', '13796', '7899', '3944', '12226', '4254', '693', '54', '6891', '3873', '10614', '13036', '7041', '14411', '4690', '5588', '11004', '3114', '15085', '3195', '429', '9207', '7977', '3834', '914', '3160', '3619', '2446', '12893', '1444', '4354', '1102', '3537', '3951', '9668', '10592', '1194', '6489', '8094', '1146', '2857', '13360', '10390', '4211', '12690', '9196', '3828', '6080', '335', '11608', '14334', '14277', '13543', '7364', '15768', '10085', '3437', '8135', '1574', '501', '10986', '15412', '10911', '259', '5265', '5716', '9339', '6488', '8653', '14029', '10345', '14356']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('235', '831', '2006-02-16T02:30:53', '2005-08-21T23:08:33', '2005-08-29T20:46:33', '2'), + ('449', '22', '2006-02-16T02:30:53', '2005-07-28T15:11:00', '2005-07-31T15:46:00', '2'), + ('149', '2087', '2006-02-16T02:30:53', '2005-07-06T19:01:39', '2005-07-12T21:35:39', '2'), + ('51', '3552', '2006-02-16T02:30:53', '2005-08-17T06:39:16', '2005-08-22T04:20:16', '2'), + ('599', '914', '2006-02-16T02:30:53', '2005-05-31T01:18:56', '2005-06-01T01:24:56', '2'), + ('531', '1068', '2006-02-16T02:30:53', '2005-07-30T08:52:45', '2005-08-05T08:39:45', '2'), + ('294', '4049', '2006-02-16T02:30:53', '2005-08-21T18:43:44', '2005-08-29T17:08:44', '2'), + ('121', '409', '2006-02-16T02:30:53', '2005-08-21T03:11:33', '2005-08-28T21:41:33', '2'), + ('166', '2457', '2006-02-16T02:30:53', '2005-07-10T17:54:06', '2005-07-18T15:41:06', '2'), + ('158', '2326', '2006-02-16T02:30:53', '2005-07-10T08:19:38', '2005-07-16T06:28:38', '2'), + ('36', '3694', '2006-02-16T02:30:53', '2005-07-28T18:35:12', '2005-07-30T15:44:12', '2'), + ('531', '2841', '2006-02-16T02:30:53', '2005-07-29T23:45:57', '2005-08-06T02:14:57', '2'), + ('338', '1174', '2006-02-16T02:30:53', '2005-06-16T20:58:59', '2005-06-20T21:31:59', '2'), + ('251', '4142', '2006-02-16T02:30:53', '2005-07-07T02:15:48', '2005-07-14T04:15:48', '2'), + ('166', '1471', '2006-02-16T02:30:53', '2005-07-10T07:08:09', '2005-07-14T03:48:09', '2'), + ('523', '361', '2006-02-16T02:30:53', '2005-07-28T20:21:19', '2005-07-30T19:16:19', '2'), + ('110', '2234', '2006-02-16T02:30:53', '2005-07-07T17:44:49', '2005-07-08T21:48:49', '2'), + ('504', '1530', '2006-02-16T02:30:53', '2005-08-22T15:05:37', '2005-08-30T12:22:37', '2'), + ('138', '2446', '2006-02-16T02:30:53', '2005-07-28T21:10:30', '2005-08-05T16:52:30', '2'), + ('279', '702', '2006-02-16T02:30:53', '2005-08-20T05:47:11', '2005-08-28T02:45:11', '2'), + ('6', '3317', '2006-02-16T02:30:53', '2005-06-16T03:41:38', '2005-06-22T03:01:38', '2'), + ('556', '988', '2006-02-16T02:30:53', '2005-08-23T05:24:09', '2005-08-27T08:57:09', '2'), + ('91', '1686', '2006-02-16T02:30:53', '2005-08-22T12:47:45', '2005-08-29T13:18:45', '2'), + ('421', '1717', '2006-02-16T02:30:53', '2005-07-11T13:22:06', '2005-07-12T17:46:06', '2'), + ('399', '3630', '2006-02-16T02:30:53', '2005-07-31T08:40:54', '2005-08-03T04:14:54', '2'), + ('590', '3075', '2006-02-16T02:30:53', '2005-08-01T16:38:44', '2005-08-06T16:05:44', '2'), + ('287', '4453', '2006-02-16T02:30:53', '2005-08-21T21:28:18', '2005-08-26T22:13:18', '2'), + ('569', '1887', '2006-02-16T02:30:53', '2005-08-02T17:35:10', '2005-08-09T12:07:10', '2'), + ('448', '1369', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('209', '28', '2006-02-16T02:30:53', '2005-08-20T12:32:32', '2005-08-29T10:48:32', '2'), + ('452', '4130', '2006-02-16T02:30:53', '2005-07-28T11:10:12', '2005-08-02T13:20:12', '2'), + ('436', '4213', '2006-02-16T02:30:53', '2005-07-06T21:34:11', '2005-07-08T23:46:11', '2'), + ('234', '682', '2006-02-16T02:30:53', '2005-08-18T03:00:48', '2005-08-25T00:43:48', '2'), + ('529', '3957', '2006-02-16T02:30:53', '2005-07-07T14:13:52', '2005-07-12T10:39:52', '2'), + ('190', '635', '2006-02-16T02:30:53', '2005-05-29T01:42:31', '2005-06-03T02:29:31', '2'), + ('291', '2787', '2006-02-16T02:30:53', '2005-05-25T07:23:25', '2005-06-01T05:05:25', '2'), + ('507', '3189', '2006-02-16T02:30:53', '2005-07-12T21:07:35', '2005-07-14T16:59:35', '2'), + ('394', '4148', '2006-02-16T02:30:53', '2005-07-06T18:03:16', '2005-07-15T23:58:16', '2'), + ('533', '232', '2006-02-16T02:30:53', '2005-08-01T14:57:00', '2005-08-10T09:31:00', '2'), + ('20', '1469', '2006-02-16T02:30:53', '2005-08-19T08:48:37', '2005-08-22T04:13:37', '2'), + ('379', '4212', '2006-02-16T02:30:53', '2005-07-27T03:18:32', '2005-07-30T06:40:32', '2'), + ('502', '2125', '2006-02-16T02:30:53', '2005-08-21T10:54:57', '2005-08-22T13:17:57', '2'), + ('64', '3304', '2006-02-16T02:30:53', '2005-07-08T11:04:02', '2005-07-15T10:27:02', '2'), + ('535', '1166', '2006-02-16T02:30:53', '2005-07-10T04:21:10', '2005-07-16T02:58:10', '2'), + ('45', '200', '2006-02-16T02:30:53', '2005-08-02T05:04:18', '2005-08-11T00:03:18', '2'), + ('8', '2388', '2006-02-16T02:30:53', '2005-06-20T17:57:47', '2005-06-21T19:18:47', '2'), + ('67', '1669', '2006-02-16T02:30:53', '2005-08-22T11:19:22', '2005-08-25T09:04:22', '2'), + ('165', '2383', '2006-02-16T02:30:53', '2005-06-21T00:02:10', '2005-06-21T23:11:10', '2'), + ('498', '129', '2006-02-16T02:30:53', '2005-05-27T16:21:26', '2005-06-05T20:23:26', '2'), + ('345', '1346', '2006-02-16T02:30:53', '2005-07-30T12:49:57', '2005-07-31T14:32:57', '2'), + ('389', '3162', '2006-02-16T02:30:53', '2005-07-28T14:15:54', '2005-08-01T18:58:54', '2'), + ('366', '3001', '2006-02-16T02:30:53', '2005-07-06T16:19:56', '2005-07-13T11:38:56', '2'), + ('596', '1393', '2006-02-16T02:30:53', '2005-05-30T11:06:00', '2005-06-04T06:07:00', '2'), + ('561', '4333', '2006-02-16T02:30:53', '2005-06-20T21:20:51', '2005-06-29T18:06:51', '2'), + ('526', '3350', '2006-02-16T02:30:53', '2005-07-06T05:59:44', '2005-07-11T08:58:44', '2'), + ('466', '1283', '2006-02-16T02:30:53', '2005-06-18T19:04:41', '2005-06-27T17:10:41', '2'), + ('498', '168', '2006-02-16T02:30:53', '2005-08-19T03:46:43', '2005-08-20T08:38:43', '2'), + ('539', '1303', '2006-02-16T02:30:53', '2005-06-15T19:08:16', '2005-06-24T15:20:16', '2'), + ('208', '4423', '2006-02-16T02:30:53', '2005-07-07T19:21:02', '2005-07-15T17:03:02', '2'), + ('115', '2052', '2006-02-16T02:30:53', '2005-05-31T14:20:29', '2005-06-04T17:38:29', '2'), + ('479', '4220', '2006-02-16T02:30:53', '2005-07-06T01:36:53', '2005-07-13T07:01:53', '2'), + ('250', '2288', '2006-02-16T02:30:53', '2005-07-06T21:50:41', '2005-07-12T02:09:41', '2'), + ('378', '1647', '2006-02-16T02:30:53', '2005-07-31T06:31:03', '2005-08-07T06:19:03', '2'), + ('265', '829', '2006-02-16T02:30:53', '2005-08-01T14:13:00', '2005-08-09T13:03:00', '2'), + ('402', '3774', '2006-02-16T02:30:53', '2005-06-15T01:25:08', '2005-06-21T01:16:08', '2'), + ('268', '1821', '2006-02-16T02:30:53', '2005-07-12T02:22:46', '2005-07-17T06:16:46', '2'), + ('432', '4276', '2006-02-16T02:30:53', '2005-07-28T18:30:28', '2005-08-05T17:37:28', '2'), + ('250', '3134', '2006-02-16T02:30:53', '2005-05-31T20:34:45', '2005-06-03T18:12:45', '2'), + ('364', '2886', '2006-02-16T02:30:53', '2005-06-19T23:15:15', '2005-06-25T04:24:15', '2'), + ('327', '3396', '2006-02-16T02:30:53', '2005-08-19T21:05:11', '2005-08-24T16:05:11', '2'), + ('502', '1489', '2006-02-16T02:30:53', '2005-08-01T06:46:48', '2005-08-09T02:55:48', '2'), + ('214', '2001', '2006-02-16T02:30:53', '2005-07-07T11:50:41', '2005-07-09T13:58:41', '2'), + ('361', '3574', '2006-02-16T02:30:53', '2005-08-18T20:06:57', '2005-08-24T20:54:57', '2'), + ('251', '4298', '2006-02-16T02:30:53', '2005-07-30T12:30:19', '2005-07-31T18:01:19', '2'), + ('498', '4493', '2006-02-16T02:30:53', '2005-07-06T15:57:30', '2005-07-10T12:17:30', '2'), + ('115', '2682', '2006-02-16T02:30:53', '2005-07-11T05:08:11', '2005-07-16T09:54:11', '2'), + ('16', '1411', '2006-02-16T02:30:53', '2005-05-27T03:07:10', '2005-06-05T00:15:10', '2'), + ('448', '1673', '2006-02-16T02:30:53', '2005-08-17T03:36:52', '2005-08-25T07:17:52', '2'), + ('595', '1448', '2006-02-16T02:30:53', '2005-08-21T08:32:32', '2005-08-25T02:53:32', '2'), + ('566', '2652', '2006-02-16T02:30:53', '2005-08-21T06:34:41', '2005-08-28T10:53:41', '2'), + ('163', '2142', '2006-02-16T02:30:53', '2005-08-20T03:43:13', '2005-08-29T07:14:13', '2'), + ('592', '3046', '2006-02-16T02:30:53', '2005-07-27T14:58:40', '2005-08-03T09:01:40', '2'), + ('267', '662', '2006-02-16T02:30:53', '2005-08-23T13:14:47', '2005-08-29T14:17:47', '2'), + ('392', '2556', '2006-02-16T02:30:53', '2005-07-31T20:12:02', '2005-08-03T00:03:02', '2'), + ('211', '1798', '2006-02-16T02:30:53', '2005-06-21T19:20:17', '2005-07-01T01:09:17', '2'), + ('164', '1339', '2006-02-16T02:30:53', '2005-07-28T20:03:25', '2005-08-03T01:28:25', '2'), + ('305', '161', '2006-02-16T02:30:53', '2005-06-16T03:39:56', '2005-06-22T05:40:56', '2'), + ('162', '601', '2006-02-16T02:30:53', '2005-05-28T01:09:36', '2005-05-30T06:14:36', '2'), + ('597', '555', '2006-02-16T02:30:53', '2005-08-02T04:35:24', '2005-08-09T07:34:24', '2'), + ('199', '1267', '2006-02-16T02:30:53', '2005-08-22T23:37:11', '2005-08-28T23:26:11', '2'), + ('195', '769', '2006-02-16T02:30:53', '2005-08-02T01:58:36', '2005-08-08T07:37:36', '2'), + ('482', '30', '2006-02-16T02:30:53', '2005-05-26T15:32:46', '2005-06-04T15:27:46', '2'), + ('139', '4482', '2006-02-16T02:30:53', '2005-07-09T14:15:01', '2005-07-18T14:43:01', '2'), + ('102', '3416', '2006-02-16T02:30:53', '2005-07-10T10:59:23', '2005-07-16T12:25:23', '2'), + ('68', '3171', '2006-02-16T02:30:53', '2005-07-30T18:03:28', '2005-08-08T19:45:28', '2'), + ('169', '3974', '2006-02-16T02:30:53', '2005-07-12T02:20:09', '2005-07-20T00:53:09', '2'), + ('230', '4440', '2006-02-16T02:30:53', '2005-07-29T15:04:23', '2005-08-02T09:39:23', '2'), + ('219', '2653', '2006-02-16T02:30:53', '2005-08-20T21:23:11', '2005-08-22T18:01:11', '2'), + ('42', '3985', '2006-02-16T02:30:53', '2005-08-01T05:18:56', '2005-08-04T01:34:56', '2'), + ('65', '3169', '2006-02-16T02:30:53', '2005-08-21T09:08:51', '2005-08-24T04:36:51', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['11882', '1596', '12969', '14717', '9001', '4642', '6779', '3476', '6677', '15886', '6299', '6228', '10956', '4898', '6442', '4871', '1697', '7799', '6038', '14318', '5092', '6502', '11625', '14153', '12709', '13873', '4630', '3006', '14519', '928', '4304', '1515', '10114', '11718', '6417', '2383', '15153', '4010', '1658', '6988', '4580', '4090', '11543', '4850', '7402', '9894', '14268', '1372', '10782', '840', '13794', '14333', '550', '3387', '13793', '4127', '2484', '15964', '8548', '3785', '14841', '13899', '3311', '9158', '7891', '3581', '12013', '7592', '7973', '4969', '12143', '1652', '14903', '6052', '12506', '2798', '14110', '15780', '11048', '10653', '1657', '6196', '10702', '805', '13092', '2862', '8085', '10252', '6668', '16040', '7142', '9136', '11404', '4519', '8556', '2523', '4442', '8333', '13320', '7716']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('234', '2401', '2006-02-16T02:30:53', '2005-08-17T14:33:41', '2005-08-26T17:25:41', '2'), + ('416', '2552', '2006-02-16T02:30:53', '2005-06-16T05:30:58', '2005-06-21T04:18:58', '2'), + ('224', '191', '2006-02-16T02:30:53', '2005-08-19T06:38:59', '2005-08-25T09:09:59', '2'), + ('366', '3839', '2006-02-16T02:30:53', '2005-08-21T21:30:39', '2005-08-26T16:58:39', '2'), + ('440', '3682', '2006-02-16T02:30:53', '2005-07-30T04:59:41', '2005-07-31T08:56:41', '2'), + ('30', '1962', '2006-02-16T02:30:53', '2005-07-08T09:13:28', '2005-07-10T06:17:28', '2'), + ('404', '4468', '2006-02-16T02:30:53', '2005-07-12T16:10:50', '2005-07-17T14:51:50', '2'), + ('490', '3011', '2006-02-16T02:30:53', '2005-07-05T23:02:37', '2005-07-10T22:17:37', '2'), + ('516', '2389', '2006-02-16T02:30:53', '2005-07-12T11:58:14', '2005-07-21T06:05:14', '2'), + ('91', '3038', '2006-02-16T02:30:53', '2005-08-23T16:50:53', '2005-08-26T15:38:53', '2'), + ('324', '4125', '2006-02-16T02:30:53', '2005-07-11T17:45:08', '2005-07-13T16:36:08', '2'), + ('367', '2281', '2006-02-16T02:30:53', '2005-07-11T13:58:36', '2005-07-17T19:03:36', '2'), + ('54', '4372', '2006-02-16T02:30:53', '2005-08-02T03:33:14', '2005-08-09T09:20:14', '2'), + ('218', '3212', '2006-02-16T02:30:53', '2005-07-08T20:31:43', '2005-07-15T15:58:43', '2'), + ('360', '1273', '2006-02-16T02:30:53', '2005-07-12T00:29:45', '2005-07-15T19:37:45', '2'), + ('210', '2509', '2006-02-16T02:30:53', '2005-07-08T19:19:52', '2005-07-13T20:27:52', '2'), + ('340', '1801', '2006-02-16T02:30:53', '2005-06-16T12:55:20', '2005-06-23T17:41:20', '2'), + ('384', '2163', '2006-02-16T02:30:53', '2005-07-28T07:42:09', '2005-08-02T10:02:09', '2'), + ('243', '1555', '2006-02-16T02:30:53', '2005-07-11T03:10:37', '2005-07-19T05:14:37', '2'), + ('508', '1042', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('139', '3256', '2006-02-16T02:30:53', '2005-07-09T05:57:39', '2005-07-12T00:45:39', '2'), + ('40', '1641', '2006-02-16T02:30:53', '2005-07-12T03:15:45', '2005-07-17T08:47:45', '2'), + ('521', '712', '2006-02-16T02:30:53', '2005-08-17T04:18:52', '2005-08-25T03:05:52', '2'), + ('120', '1502', '2006-02-16T02:30:53', '2005-08-21T02:24:33', '2005-08-27T05:28:33', '2'), + ('476', '3878', '2006-02-16T02:30:53', '2005-08-18T20:59:51', '2005-08-26T01:21:51', '2'), + ('306', '1683', '2006-02-16T02:30:53', '2005-08-20T15:11:11', '2005-08-22T20:13:11', '2'), + ('319', '3446', '2006-02-16T02:30:53', '2005-07-08T08:33:38', '2005-07-09T13:09:38', '2'), + ('133', '1677', '2006-02-16T02:30:53', '2005-06-20T10:10:29', '2005-06-22T07:26:29', '2'), + ('403', '1541', '2006-02-16T02:30:53', '2005-08-21T14:59:29', '2005-08-22T11:48:29', '2'), + ('79', '246', '2006-02-16T02:30:53', '2005-05-30T12:27:14', '2005-06-05T13:56:14', '2'), + ('165', '3382', '2006-02-16T02:30:53', '2005-07-07T17:01:19', '2005-07-12T22:47:19', '2'), + ('115', '3244', '2006-02-16T02:30:53', '2005-06-15T23:07:50', '2005-06-20T02:33:50', '2'), + ('218', '3881', '2006-02-16T02:30:53', '2005-07-31T21:12:58', '2005-08-02T19:45:58', '2'), + ('555', '3673', '2006-02-16T02:30:53', '2005-08-17T07:44:42', '2005-08-23T03:02:42', '2'), + ('80', '3042', '2006-02-16T02:30:53', '2005-07-11T23:35:11', '2005-07-18T20:00:11', '2'), + ('149', '2459', '2006-02-16T02:30:53', '2005-06-18T15:17:59', '2005-06-26T18:42:59', '2'), + ('512', '1051', '2006-02-16T02:30:53', '2005-08-22T14:26:01', '2005-08-27T14:17:01', '2'), + ('476', '4509', '2006-02-16T02:30:53', '2005-07-07T00:47:00', '2005-07-12T06:23:00', '2'), + ('568', '272', '2006-02-16T02:30:53', '2005-06-16T10:07:10', '2005-06-21T09:23:10', '2'), + ('316', '756', '2006-02-16T02:30:53', '2005-07-27T01:00:08', '2005-07-31T04:35:08', '2'), + ('199', '3512', '2006-02-16T02:30:53', '2005-07-08T06:04:23', '2005-07-15T05:42:23', '2'), + ('67', '3096', '2006-02-16T02:30:53', '2005-07-07T05:47:33', '2005-07-08T04:25:33', '2'), + ('238', '2860', '2006-02-16T02:30:53', '2005-08-17T00:54:28', '2005-08-25T04:31:28', '2'), + ('154', '3039', '2006-02-16T02:30:53', '2005-07-08T18:39:31', '2005-07-13T00:18:31', '2'), + ('287', '2707', '2006-02-16T02:30:53', '2005-07-27T16:19:40', '2005-08-05T14:48:40', '2'), + ('199', '3724', '2006-02-16T02:30:53', '2005-07-31T14:07:44', '2005-08-05T18:01:44', '2'), + ('278', '2442', '2006-02-16T02:30:53', '2005-08-21T06:21:24', '2005-08-23T05:39:24', '2'), + ('108', '3740', '2006-02-16T02:30:53', '2005-06-15T14:45:48', '2005-06-17T18:02:48', '2'), + ('577', '1507', '2006-02-16T02:30:53', '2005-08-01T21:23:25', '2005-08-03T20:15:25', '2'), + ('79', '4049', '2006-02-16T02:30:53', '2005-05-30T00:28:41', '2005-05-31T20:39:41', '2'), + ('557', '2148', '2006-02-16T02:30:53', '2005-08-20T12:25:32', '2005-08-23T06:38:32', '2'), + ('93', '2976', '2006-02-16T02:30:53', '2005-08-21T08:31:03', '2005-08-28T03:39:03', '2'), + ('432', '3632', '2006-02-16T02:30:53', '2005-05-28T07:39:16', '2005-06-06T12:20:16', '2'), + ('305', '2709', '2006-02-16T02:30:53', '2005-06-21T14:21:49', '2005-06-24T16:46:49', '2'), + ('424', '2598', '2006-02-16T02:30:53', '2005-08-20T12:22:04', '2005-08-27T09:51:04', '2'), + ('15', '1774', '2006-02-16T02:30:53', '2005-07-07T07:26:19', '2005-07-14T07:50:19', '2'), + ('515', '1511', '2006-02-16T02:30:53', '2005-06-18T21:25:23', '2005-06-24T16:03:23', '2'), + ('141', '251', '2006-02-16T02:30:53', '2005-08-23T19:45:25', '2005-08-26T22:43:25', '2'), + ('14', '3366', '2006-02-16T02:30:53', '2005-07-29T11:11:33', '2005-08-04T11:52:33', '2'), + ('577', '3279', '2006-02-16T02:30:53', '2005-07-06T14:00:13', '2005-07-14T10:13:13', '2'), + ('384', '4017', '2006-02-16T02:30:53', '2005-08-22T02:03:30', '2005-08-28T02:08:30', '2'), + ('204', '427', '2006-02-16T02:30:53', '2005-08-20T16:05:11', '2005-08-23T15:14:11', '2'), + ('518', '3438', '2006-02-16T02:30:53', '2005-06-21T08:05:27', '2005-06-22T06:51:27', '2'), + ('16', '4017', '2006-02-16T02:30:53', '2005-07-30T11:12:03', '2005-08-02T05:55:03', '2'), + ('560', '3637', '2006-02-16T02:30:53', '2005-07-28T10:43:56', '2005-08-05T14:04:56', '2'), + ('235', '4520', '2006-02-16T02:30:53', '2005-07-06T03:57:35', '2005-07-07T08:07:35', '2'), + ('586', '3530', '2006-02-16T02:30:53', '2005-08-17T19:23:02', '2005-08-23T00:31:02', '2'), + ('316', '4105', '2006-02-16T02:30:53', '2005-07-27T23:26:04', '2005-07-29T23:48:04', '2'), + ('339', '3936', '2006-02-16T02:30:53', '2005-07-28T14:10:06', '2005-07-29T11:26:06', '2'), + ('231', '4563', '2006-02-16T02:30:53', '2005-07-08T23:51:26', '2005-07-12T03:21:26', '2'), + ('117', '2876', '2006-02-16T02:30:53', '2005-08-18T00:06:26', '2005-08-24T02:45:26', '2'), + ('533', '3416', '2006-02-16T02:30:53', '2005-06-16T09:31:37', '2005-06-19T14:02:37', '2'), + ('51', '1795', '2006-02-16T02:30:53', '2005-08-22T04:31:50', '2005-08-25T22:53:50', '2'), + ('75', '881', '2006-02-16T02:30:53', '2005-07-11T03:51:27', '2005-07-16T02:55:27', '2'), + ('114', '1132', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('180', '1343', '2006-02-16T02:30:53', '2005-06-19T19:07:48', '2005-06-23T00:09:48', '2'), + ('35', '2709', '2006-02-16T02:30:53', '2005-08-21T00:53:09', '2005-08-24T05:33:09', '2'), + ('120', '2911', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('491', '206', '2006-02-16T02:30:53', '2005-08-02T06:15:07', '2005-08-04T02:47:07', '2'), + ('75', '1190', '2006-02-16T02:30:53', '2005-08-01T16:28:07', '2005-08-07T21:22:07', '2'), + ('209', '953', '2006-02-16T02:30:53', '2005-06-16T10:06:49', '2005-06-22T10:34:49', '2'), + ('429', '995', '2006-02-16T02:30:53', '2005-07-11T12:05:46', '2005-07-18T08:27:46', '2'), + ('560', '2802', '2006-02-16T02:30:53', '2005-08-01T18:34:59', '2005-08-09T23:44:59', '2'), + ('232', '3132', '2006-02-16T02:30:53', '2005-05-29T18:18:18', '2005-06-07T15:11:18', '2'), + ('480', '4359', '2006-02-16T02:30:53', '2005-08-19T10:41:09', '2005-08-25T05:11:09', '2'), + ('52', '4260', '2006-02-16T02:30:53', '2005-06-19T23:47:24', '2005-06-23T03:39:24', '2'), + ('552', '3059', '2006-02-16T02:30:53', '2005-07-28T18:13:15', '2005-08-04T13:45:15', '2'), + ('86', '2380', '2006-02-16T02:30:53', '2005-08-01T02:39:39', '2005-08-10T00:40:39', '2'), + ('199', '1498', '2006-02-16T02:30:53', '2005-07-12T11:37:45', '2005-07-14T13:28:45', '2'), + ('195', '3524', '2006-02-16T02:30:53', '2005-08-23T22:19:33', '2005-09-02T02:19:33', '2'), + ('396', '1743', '2006-02-16T02:30:53', '2005-07-27T06:55:39', '2005-07-28T01:41:39', '2'), + ('57', '1734', '2006-02-16T02:30:53', '2005-07-30T10:07:20', '2005-07-31T08:20:20', '2'), + ('60', '3285', '2006-02-16T02:30:53', '2005-08-02T19:12:40', '2005-08-11T22:38:40', '2'), + ('459', '4425', '2006-02-16T02:30:53', '2005-07-08T02:51:23', '2005-07-12T06:52:23', '2'), + ('231', '2793', '2006-02-16T02:30:53', '2005-07-29T11:18:27', '2005-07-30T05:21:27', '2'), + ('89', '460', '2006-02-16T02:30:53', '2005-06-19T00:45:56', '2005-06-21T00:54:56', '2'), + ('123', '461', '2006-02-16T02:30:53', '2005-07-07T23:05:30', '2005-07-13T22:20:30', '2'), + ('494', '823', '2006-02-16T02:30:53', '2005-07-29T04:16:40', '2005-08-02T10:10:40', '2'), + ('172', '4522', '2006-02-16T02:30:53', '2005-08-19T19:35:33', '2005-08-24T20:09:33', '2'), + ('284', '1493', '2006-02-16T02:30:53', '2005-07-28T04:33:15', '2005-08-04T00:08:15', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['9483', '14339', '1655', '14775', '8025', '2472', '15838', '13277', '4031', '15812', '9846', '15312', '8188', '7179', '9980', '9639', '15683', '10908', '8990', '8567', '15222', '10037', '4621', '1450', '6386', '8579', '11651', '229', '2796', '820', '16028', '326', '3655', '1389', '6162', '7436', '10159', '12909', '2248', '8776', '11292', '1936', '4853', '7717', '8326', '15899', '10395', '3225', '6761', '3935', '14990', '10531', '11747', '9251', '15081', '5341', '13707', '14043', '2545', '5090', '974', '11794', '3187', '9099', '12214', '4611', '8214', '9839', '14376', '7685', '4698', '15297', '5854', '1487', '7220', '14857', '13260', '4281', '13022', '12556', '3407', '4345', '7739', '11241', '13206', '3167', '4867', '14150', '13601', '15403', '5054', '15634', '14118', '12681', '446', '11119', '11448', '7303', '3979', '15399']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('593', '1136', '2006-02-16T02:30:53', '2005-07-30T23:31:31', '2005-08-09T04:29:31', '2'), + ('30', '1744', '2006-02-16T02:30:53', '2005-08-21T08:37:15', '2005-08-26T03:37:15', '2'), + ('488', '3693', '2006-02-16T02:30:53', '2005-06-16T09:51:39', '2005-06-23T14:53:39', '2'), + ('400', '4044', '2006-02-16T02:30:53', '2005-08-21T23:53:07', '2005-08-22T18:07:07', '2'), + ('421', '2932', '2006-02-16T02:30:53', '2005-07-28T16:03:27', '2005-08-03T21:58:27', '2'), + ('70', '4556', '2006-02-16T02:30:53', '2005-06-18T20:32:40', '2005-06-20T00:40:40', '2'), + ('579', '2194', '2006-02-16T02:30:53', '2005-08-23T15:30:48', '2005-08-31T11:20:48', '2'), + ('316', '3820', '2006-02-16T02:30:53', '2005-08-19T17:57:35', '2005-08-25T15:45:35', '2'), + ('143', '3094', '2006-02-16T02:30:53', '2005-07-07T02:32:07', '2005-07-14T06:01:07', '2'), + ('45', '4457', '2006-02-16T02:30:53', '2005-08-23T14:47:26', '2005-09-01T10:51:26', '2'), + ('573', '4240', '2006-02-16T02:30:53', '2005-07-31T12:30:12', '2005-08-05T08:24:12', '2'), + ('280', '2509', '2006-02-16T02:30:53', '2005-08-22T19:58:15', '2005-08-25T19:21:15', '2'), + ('10', '3826', '2006-02-16T02:30:53', '2005-07-28T22:34:12', '2005-08-01T02:32:12', '2'), + ('537', '2365', '2006-02-16T02:30:53', '2005-07-27T08:10:29', '2005-07-28T12:24:29', '2'), + ('225', '122', '2006-02-16T02:30:53', '2005-07-31T17:02:00', '2005-08-08T11:11:00', '2'), + ('459', '1373', '2006-02-16T02:30:53', '2005-07-31T05:32:10', '2005-08-03T07:04:10', '2'), + ('168', '3787', '2006-02-16T02:30:53', '2005-08-23T09:38:17', '2005-08-30T12:31:17', '2'), + ('269', '1284', '2006-02-16T02:30:53', '2005-08-02T01:53:06', '2005-08-04T02:46:06', '2'), + ('292', '1869', '2006-02-16T02:30:53', '2005-07-30T04:41:42', '2005-08-07T22:50:42', '2'), + ('594', '1612', '2006-02-16T02:30:53', '2005-07-29T11:37:30', '2005-08-03T05:58:30', '2'), + ('390', '1360', '2006-02-16T02:30:53', '2005-08-22T17:12:30', '2005-08-27T15:10:30', '2'), + ('58', '438', '2006-02-16T02:30:53', '2005-07-31T18:48:08', '2005-08-09T19:11:08', '2'), + ('297', '1594', '2006-02-16T02:30:53', '2005-07-08T08:02:18', '2005-07-12T08:53:18', '2'), + ('268', '4132', '2006-02-16T02:30:53', '2005-06-15T19:22:08', '2005-06-16T17:53:08', '2'), + ('593', '633', '2006-02-16T02:30:53', '2005-07-11T22:14:57', '2005-07-15T16:41:57', '2'), + ('250', '4045', '2006-02-16T02:30:53', '2005-07-29T11:59:22', '2005-07-30T11:41:22', '2'), + ('143', '3681', '2006-02-16T02:30:53', '2005-08-17T05:02:25', '2005-08-24T08:15:25', '2'), + ('312', '1131', '2006-02-16T02:30:53', '2005-05-26T11:19:20', '2005-05-31T11:56:20', '2'), + ('209', '2337', '2006-02-16T02:30:53', '2005-06-19T19:00:37', '2005-06-25T17:18:37', '2'), + ('22', '2584', '2006-02-16T02:30:53', '2005-05-29T21:07:22', '2005-06-07T00:22:22', '2'), + ('119', '2515', '2006-02-16T02:30:53', '2005-08-23T21:52:56', '2005-08-30T18:16:56', '2'), + ('432', '3979', '2006-02-16T02:30:53', '2005-05-27T01:10:11', '2005-06-04T20:25:11', '2'), + ('493', '1540', '2006-02-16T02:30:53', '2005-07-06T07:52:54', '2005-07-15T10:49:54', '2'), + ('472', '965', '2006-02-16T02:30:53', '2005-06-15T15:49:01', '2005-06-19T11:08:01', '2'), + ('79', '786', '2006-02-16T02:30:53', '2005-07-11T10:12:30', '2005-07-19T06:02:30', '2'), + ('45', '299', '2006-02-16T02:30:53', '2005-07-27T17:39:12', '2005-08-01T12:40:12', '2'), + ('515', '1174', '2006-02-16T02:30:53', '2005-07-31T22:54:30', '2005-08-03T00:43:30', '2'), + ('210', '4300', '2006-02-16T02:30:53', '2005-08-19T04:20:25', '2005-08-24T06:40:25', '2'), + ('446', '1999', '2006-02-16T02:30:53', '2005-06-18T04:59:48', '2005-06-19T08:51:48', '2'), + ('587', '1565', '2006-02-16T02:30:53', '2005-07-29T20:07:06', '2005-08-06T20:42:06', '2'), + ('13', '210', '2006-02-16T02:30:53', '2005-08-02T14:58:41', '2005-08-06T14:38:41', '2'), + ('213', '3037', '2006-02-16T02:30:53', '2005-06-17T07:15:41', '2005-06-18T11:37:41', '2'), + ('23', '1454', '2006-02-16T02:30:53', '2005-07-08T18:43:18', '2005-07-12T14:28:18', '2'), + ('459', '730', '2006-02-16T02:30:53', '2005-07-28T04:33:54', '2005-07-30T02:46:54', '2'), + ('1', '108', '2006-02-16T02:30:53', '2005-07-29T03:58:49', '2005-08-01T05:16:49', '2'), + ('596', '3851', '2006-02-16T02:30:53', '2005-08-23T17:16:28', '2005-08-29T21:46:28', '2'), + ('129', '279', '2006-02-16T02:30:53', '2005-08-01T07:08:22', '2005-08-05T08:00:22', '2'), + ('448', '1003', '2006-02-16T02:30:53', '2005-06-21T02:16:55', '2005-06-27T05:39:55', '2'), + ('7', '3645', '2006-02-16T02:30:53', '2005-07-12T15:17:42', '2005-07-18T17:59:42', '2'), + ('503', '3402', '2006-02-16T02:30:53', '2005-07-06T21:08:29', '2005-07-15T23:28:29', '2'), + ('198', '4057', '2006-02-16T02:30:53', '2005-08-22T07:48:01', '2005-08-24T06:41:01', '2'), + ('459', '3846', '2006-02-16T02:30:53', '2005-08-01T12:06:30', '2005-08-04T10:23:30', '2'), + ('555', '1041', '2006-02-16T02:30:53', '2005-08-17T09:03:31', '2005-08-19T08:23:31', '2'), + ('390', '2948', '2006-02-16T02:30:53', '2005-07-30T14:19:25', '2005-08-08T11:22:25', '2'), + ('313', '2501', '2006-02-16T02:30:53', '2005-08-22T11:14:31', '2005-08-28T14:23:31', '2'), + ('8', '2522', '2006-02-16T02:30:53', '2005-07-09T17:13:23', '2005-07-14T18:11:23', '2'), + ('232', '826', '2006-02-16T02:30:53', '2005-08-20T09:33:58', '2005-08-23T07:44:58', '2'), + ('586', '1485', '2006-02-16T02:30:53', '2005-08-20T21:46:43', '2005-08-21T18:27:43', '2'), + ('413', '3237', '2006-02-16T02:30:53', '2005-06-19T02:23:36', '2005-06-20T03:17:36', '2'), + ('296', '1728', '2006-02-16T02:30:53', '2005-07-09T05:48:22', '2005-07-11T06:50:22', '2'), + ('596', '2617', '2006-02-16T02:30:53', '2005-05-30T20:28:42', '2005-06-08T23:45:42', '2'), + ('453', '3486', '2006-02-16T02:30:53', '2005-08-17T11:08:48', '2005-08-20T13:36:48', '2'), + ('150', '4357', '2006-02-16T02:30:53', '2005-06-20T23:06:07', '2005-06-27T01:14:07', '2'), + ('250', '594', '2006-02-16T02:30:53', '2005-07-30T08:45:48', '2005-08-01T03:18:48', '2'), + ('231', '2094', '2006-02-16T02:30:53', '2005-08-18T02:34:22', '2005-08-21T07:48:22', '2'), + ('1', '3486', '2006-02-16T02:30:53', '2005-07-08T07:33:56', '2005-07-12T13:25:56', '2'), + ('509', '352', '2006-02-16T02:30:53', '2005-07-28T23:37:57', '2005-08-07T00:29:57', '2'), + ('561', '1591', '2006-02-16T02:30:53', '2005-07-31T12:21:16', '2005-08-09T13:41:16', '2'), + ('582', '1936', '2006-02-16T02:30:53', '2005-08-21T09:48:56', '2005-08-22T12:15:56', '2'), + ('468', '2213', '2006-02-16T02:30:53', '2005-07-28T03:13:00', '2005-08-01T00:29:00', '2'), + ('570', '3963', '2006-02-16T02:30:53', '2005-07-08T11:19:31', '2005-07-13T13:45:31', '2'), + ('327', '3192', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('547', '997', '2006-02-16T02:30:53', '2005-07-10T17:47:34', '2005-07-13T20:14:34', '2'), + ('76', '3791', '2006-02-16T02:30:53', '2005-06-15T21:27:42', '2005-06-22T03:09:42', '2'), + ('79', '3867', '2006-02-16T02:30:53', '2005-07-27T09:35:54', '2005-08-04T06:00:54', '2'), + ('232', '4150', '2006-02-16T02:30:53', '2005-08-22T02:42:39', '2005-08-24T21:26:39', '2'), + ('251', '578', '2006-02-16T02:30:53', '2005-08-19T17:09:22', '2005-08-24T21:31:22', '2'), + ('321', '1182', '2006-02-16T02:30:53', '2005-07-07T15:17:50', '2005-07-08T11:42:50', '2'), + ('336', '2266', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('3', '1984', '2006-02-16T02:30:53', '2005-08-18T14:49:55', '2005-08-24T15:20:55', '2'), + ('343', '3919', '2006-02-16T02:30:53', '2005-06-21T16:14:02', '2005-06-24T15:38:02', '2'), + ('225', '2235', '2006-02-16T02:30:53', '2005-07-07T18:52:57', '2005-07-15T21:24:57', '2'), + ('186', '1554', '2006-02-16T02:30:53', '2005-07-28T05:21:51', '2005-07-30T02:06:51', '2'), + ('543', '3657', '2006-02-16T02:30:53', '2005-08-02T13:29:24', '2005-08-11T11:36:24', '2'), + ('504', '2477', '2006-02-16T02:30:53', '2005-08-19T15:05:34', '2005-08-21T20:37:34', '2'), + ('464', '353', '2006-02-16T02:30:53', '2005-06-20T21:42:29', '2005-06-22T00:36:29', '2'), + ('593', '4090', '2006-02-16T02:30:53', '2005-07-08T19:10:52', '2005-07-09T21:43:52', '2'), + ('161', '2324', '2006-02-16T02:30:53', '2005-08-21T02:23:03', '2005-08-25T22:50:03', '2'), + ('189', '2166', '2006-02-16T02:30:53', '2005-08-20T06:01:15', '2005-08-29T06:14:15', '2'), + ('581', '4315', '2006-02-16T02:30:53', '2005-08-22T23:18:10', '2005-08-23T18:08:10', '2'), + ('135', '4001', '2006-02-16T02:30:53', '2005-07-09T04:01:02', '2005-07-18T05:16:02', '2'), + ('576', '2517', '2006-02-16T02:30:53', '2005-08-23T07:34:18', '2005-08-24T12:00:18', '2'), + ('337', '2605', '2006-02-16T02:30:53', '2005-08-21T01:13:37', '2005-08-28T02:35:37', '2'), + ('518', '1570', '2006-02-16T02:30:53', '2005-08-18T19:48:06', '2005-08-23T15:05:06', '2'), + ('401', '1955', '2006-02-16T02:30:53', '2005-05-27T18:48:41', '2005-06-03T16:42:41', '2'), + ('489', '4307', '2006-02-16T02:30:53', '2005-08-02T08:44:44', '2005-08-10T11:32:44', '2'), + ('496', '1185', '2006-02-16T02:30:53', '2005-08-02T20:44:33', '2005-08-05T22:58:33', '2'), + ('163', '1398', '2006-02-16T02:30:53', '2005-07-27T12:54:39', '2005-07-31T09:26:39', '2'), + ('550', '794', '2006-02-16T02:30:53', '2005-07-06T23:04:35', '2005-07-13T01:38:35', '2'), + ('379', '3858', '2006-02-16T02:30:53', '2005-08-22T23:11:59', '2005-08-26T22:16:59', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['585', '3263', '963', '6450', '3666', '15980', '6230', '1558', '7343', '2588', '11161', '4643', '5186', '14304', '1171', '8868', '13546', '6316', '4860', '6157', '14977', '13862', '14130', '2864', '1170', '7302', '4998', '14063', '6771', '4217', '10863', '13102', '10104', '1733', '5444', '14859', '1463', '6587', '8238', '15355', '2831', '12333', '5411', '3034', '11171', '12853', '13861', '11775', '8289', '12388', '3314', '9851', '10554', '14678', '859', '13194', '8234', '3810', '8339', '13654', '15281', '6895', '2696', '8193', '12425', '15836', '1687', '7257', '4889', '7016', '13591', '11307', '767', '1764', '14295', '8964', '1210', '3066', '7680', '2343', '5135', '10659', '14240', '12815', '6482', '11067', '5553', '5875', '3237', '5948', '5113', '10170', '14281', '9902', '4922', '8686', '5147', '15839', '15723', '1256']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('490', '3544', '2006-02-16T02:30:53', '2005-05-28T11:50:45', '2005-06-03T15:35:45', '2'), + ('118', '3491', '2006-02-16T02:30:53', '2005-06-21T04:15:52', '2005-06-24T02:19:52', '2'), + ('225', '1921', '2006-02-16T02:30:53', '2005-05-30T18:52:53', '2005-06-07T16:19:53', '2'), + ('32', '2413', '2006-02-16T02:30:53', '2005-07-12T00:49:05', '2005-07-13T01:54:05', '2'), + ('347', '4212', '2006-02-16T02:30:53', '2005-07-06T08:27:43', '2005-07-09T07:37:43', '2'), + ('196', '3365', '2006-02-16T02:30:53', '2005-08-23T20:10:13', '2005-08-24T17:44:13', '2'), + ('490', '2260', '2006-02-16T02:30:53', '2005-07-11T14:02:19', '2005-07-17T08:11:19', '2'), + ('20', '4350', '2006-02-16T02:30:53', '2005-06-16T02:33:53', '2005-06-19T20:50:53', '2'), + ('526', '1177', '2006-02-16T02:30:53', '2005-07-27T14:27:13', '2005-07-30T09:27:13', '2'), + ('143', '3626', '2006-02-16T02:30:53', '2005-06-19T05:20:31', '2005-06-22T04:20:31', '2'), + ('503', '3321', '2006-02-16T02:30:53', '2005-08-02T10:05:57', '2005-08-06T05:05:57', '2'), + ('436', '239', '2006-02-16T02:30:53', '2005-07-08T09:13:56', '2005-07-10T12:09:56', '2'), + ('276', '2415', '2006-02-16T02:30:53', '2005-07-09T10:18:40', '2005-07-13T05:05:40', '2'), + ('417', '2650', '2006-02-16T02:30:53', '2005-08-21T07:23:10', '2005-08-26T11:21:10', '2'), + ('284', '4082', '2006-02-16T02:30:53', '2005-06-14T23:50:11', '2005-06-17T21:44:11', '2'), + ('512', '1229', '2006-02-16T02:30:53', '2005-07-30T00:02:26', '2005-08-01T22:28:26', '2'), + ('390', '2492', '2006-02-16T02:30:53', '2005-08-20T03:50:24', '2005-08-28T03:04:24', '2'), + ('526', '1910', '2006-02-16T02:30:53', '2005-07-11T18:44:52', '2005-07-19T23:35:52', '2'), + ('123', '428', '2006-02-16T02:30:53', '2005-07-08T18:54:07', '2005-07-17T15:09:07', '2'), + ('133', '4481', '2006-02-16T02:30:53', '2005-07-11T09:48:16', '2005-07-16T05:00:16', '2'), + ('59', '4093', '2006-02-16T02:30:53', '2005-08-22T07:12:53', '2005-08-30T08:11:53', '2'), + ('170', '3271', '2006-02-16T02:30:53', '2005-08-20T14:57:01', '2005-08-27T10:48:01', '2'), + ('352', '3859', '2006-02-16T02:30:53', '2005-08-21T01:43:11', '2005-08-27T21:16:11', '2'), + ('493', '1056', '2006-02-16T02:30:53', '2005-06-20T00:00:52', '2005-06-26T04:21:52', '2'), + ('595', '2444', '2006-02-16T02:30:53', '2005-06-14T23:47:35', '2005-06-17T05:28:35', '2'), + ('477', '4539', '2006-02-16T02:30:53', '2005-07-27T12:52:13', '2005-07-29T15:13:13', '2'), + ('534', '202', '2006-02-16T02:30:53', '2005-07-09T01:07:21', '2005-07-10T05:48:21', '2'), + ('275', '1215', '2006-02-16T02:30:53', '2005-08-20T22:36:40', '2005-08-25T00:18:40', '2'), + ('396', '1113', '2006-02-16T02:30:53', '2005-07-12T15:54:40', '2005-07-17T15:56:40', '2'), + ('228', '3186', '2006-02-16T02:30:53', '2005-07-07T12:08:59', '2005-07-11T15:07:59', '2'), + ('161', '1170', '2006-02-16T02:30:53', '2005-08-02T00:18:07', '2005-08-10T06:16:07', '2'), + ('285', '2885', '2006-02-16T02:30:53', '2005-08-19T11:02:03', '2005-08-28T13:05:03', '2'), + ('186', '3358', '2006-02-16T02:30:53', '2005-07-31T20:49:14', '2005-08-05T01:11:14', '2'), + ('480', '542', '2006-02-16T02:30:53', '2005-06-16T15:37:07', '2005-06-23T15:53:07', '2'), + ('10', '2968', '2006-02-16T02:30:53', '2005-07-09T21:58:57', '2005-07-11T03:09:57', '2'), + ('463', '2150', '2006-02-16T02:30:53', '2005-08-22T02:46:35', '2005-08-24T22:37:35', '2'), + ('569', '2984', '2006-02-16T02:30:53', '2005-06-15T20:37:51', '2005-06-21T16:46:51', '2'), + ('419', '238', '2006-02-16T02:30:53', '2005-07-12T06:56:26', '2005-07-20T05:53:26', '2'), + ('320', '2941', '2006-02-16T02:30:53', '2005-07-29T00:30:06', '2005-08-02T22:52:06', '2'), + ('493', '3477', '2006-02-16T02:30:53', '2005-08-22T21:19:24', '2005-08-28T20:36:24', '2'), + ('468', '4089', '2006-02-16T02:30:53', '2005-06-19T21:17:06', '2005-06-22T16:56:06', '2'), + ('18', '4370', '2006-02-16T02:30:53', '2005-08-18T06:51:39', '2005-08-21T01:44:39', '2'), + ('304', '4292', '2006-02-16T02:30:53', '2005-07-09T20:23:38', '2005-07-16T01:17:38', '2'), + ('296', '2755', '2006-02-16T02:30:53', '2005-06-20T12:15:50', '2005-06-24T06:21:50', '2'), + ('339', '3117', '2006-02-16T02:30:53', '2005-08-02T10:23:41', '2005-08-04T14:22:41', '2'), + ('232', '3753', '2006-02-16T02:30:53', '2005-08-19T02:15:32', '2005-08-27T21:26:32', '2'), + ('154', '303', '2006-02-16T02:30:53', '2005-08-20T14:56:53', '2005-08-22T18:13:53', '2'), + ('574', '256', '2006-02-16T02:30:53', '2005-08-17T10:25:53', '2005-08-22T08:37:53', '2'), + ('459', '4579', '2006-02-16T02:30:53', '2005-07-29T02:23:24', '2005-08-06T03:23:24', '2'), + ('555', '4016', '2006-02-16T02:30:53', '2005-08-18T08:48:09', '2005-08-26T09:05:09', '2'), + ('185', '4332', '2006-02-16T02:30:53', '2005-06-21T08:17:00', '2005-06-22T06:00:00', '2'), + ('49', '25', '2006-02-16T02:30:53', '2005-07-31T12:50:24', '2005-08-08T08:30:24', '2'), + ('209', '3220', '2006-02-16T02:30:53', '2005-08-01T12:56:19', '2005-08-03T09:44:19', '2'), + ('383', '1911', '2006-02-16T02:30:53', '2005-08-21T20:12:43', '2005-08-31T02:11:43', '2'), + ('79', '3032', '2006-02-16T02:30:53', '2005-05-30T02:36:20', '2005-06-02T07:49:20', '2'), + ('58', '2473', '2006-02-16T02:30:53', '2005-08-19T14:34:12', '2005-08-26T10:18:12', '2'), + ('227', '644', '2006-02-16T02:30:53', '2005-07-29T00:19:20', '2005-08-03T19:16:20', '2'), + ('296', '342', '2006-02-16T02:30:53', '2005-07-06T15:18:44', '2005-07-12T09:52:44', '2'), + ('129', '1870', '2006-02-16T02:30:53', '2005-07-29T04:41:13', '2005-07-30T09:01:13', '2'), + ('469', '1582', '2006-02-16T02:30:53', '2005-08-20T07:58:21', '2005-08-21T09:40:21', '2'), + ('543', '3992', '2006-02-16T02:30:53', '2005-08-22T19:10:26', '2005-08-27T21:55:26', '2'), + ('599', '2935', '2006-02-16T02:30:53', '2005-07-12T21:23:59', '2005-07-19T20:47:59', '2'), + ('597', '2110', '2006-02-16T02:30:53', '2005-06-19T13:28:42', '2005-06-28T14:06:42', '2'), + ('15', '2402', '2006-02-16T02:30:53', '2005-07-28T22:50:50', '2005-08-01T04:14:50', '2'), + ('405', '2000', '2006-02-16T02:30:53', '2005-08-18T10:18:06', '2005-08-27T08:16:06', '2'), + ('468', '260', '2006-02-16T02:30:53', '2005-08-23T15:29:17', '2005-08-26T11:44:17', '2'), + ('140', '3686', '2006-02-16T02:30:53', '2005-06-16T12:09:20', '2005-06-18T06:18:20', '2'), + ('480', '3302', '2006-02-16T02:30:53', '2005-07-27T11:04:17', '2005-08-04T12:32:17', '2'), + ('5', '4463', '2006-02-16T02:30:53', '2005-07-08T20:04:43', '2005-07-13T17:57:43', '2'), + ('423', '1425', '2006-02-16T02:30:53', '2005-07-27T02:15:16', '2005-08-01T23:08:16', '2'), + ('390', '3089', '2006-02-16T02:30:53', '2005-08-20T05:50:05', '2005-08-27T08:43:05', '2'), + ('15', '1490', '2006-02-16T02:30:53', '2005-08-02T15:48:08', '2005-08-06T20:33:08', '2'), + ('67', '687', '2006-02-16T02:30:53', '2005-05-29T12:20:19', '2005-06-02T14:15:19', '2'), + ('392', '705', '2006-02-16T02:30:53', '2005-06-16T17:51:54', '2005-06-21T20:36:54', '2'), + ('336', '2187', '2006-02-16T02:30:53', '2005-08-21T07:09:27', '2005-08-22T01:27:27', '2'), + ('424', '280', '2006-02-16T02:30:53', '2005-07-30T03:49:35', '2005-08-06T23:28:35', '2'), + ('345', '7', '2006-02-16T02:30:53', '2005-06-15T02:57:51', '2005-06-20T01:41:51', '2'), + ('268', '1116', '2006-02-16T02:30:53', '2005-06-20T13:55:41', '2005-06-26T09:38:41', '2'), + ('559', '1784', '2006-02-16T02:30:53', '2005-07-28T02:59:08', '2005-08-03T03:37:08', '2'), + ('20', '4554', '2006-02-16T02:30:53', '2005-06-18T11:46:26', '2005-06-22T11:37:26', '2'), + ('538', '3005', '2006-02-16T02:30:53', '2005-07-09T07:53:22', '2005-07-16T04:50:22', '2'), + ('238', '786', '2006-02-16T02:30:53', '2005-08-01T16:40:34', '2005-08-09T21:00:34', '2'), + ('12', '3294', '2006-02-16T02:30:53', '2005-08-21T05:19:39', '2005-08-22T23:25:39', '2'), + ('588', '435', '2006-02-16T02:30:53', '2005-08-19T00:59:42', '2005-08-25T21:43:42', '2'), + ('57', '4135', '2006-02-16T02:30:53', '2005-07-12T01:50:21', '2005-07-14T06:49:21', '2'), + ('85', '965', '2006-02-16T02:30:53', '2005-08-02T07:03:24', '2005-08-10T08:59:24', '2'), + ('6', '1686', '2006-02-16T02:30:53', '2005-07-10T03:03:35', '2005-07-14T07:49:35', '2'), + ('575', '964', '2006-02-16T02:30:53', '2005-07-10T19:06:47', '2005-07-18T17:33:47', '2'), + ('466', '4399', '2006-02-16T02:30:53', '2005-06-21T02:47:56', '2005-06-27T03:16:56', '2'), + ('57', '3260', '2006-02-16T02:30:53', '2005-07-10T23:12:08', '2005-07-18T19:06:08', '2'), + ('282', '3618', '2006-02-16T02:30:53', '2005-07-09T07:06:18', '2005-07-13T07:10:18', '2'), + ('41', '804', '2006-02-16T02:30:53', '2005-07-31T23:27:31', '2005-08-08T04:53:31', '2'), + ('166', '1848', '2006-02-16T02:30:53', '2005-08-21T06:40:48', '2005-08-26T11:42:48', '2'), + ('218', '486', '2006-02-16T02:30:53', '2005-07-31T14:24:33', '2005-08-09T11:11:33', '2'), + ('577', '2928', '2006-02-16T02:30:53', '2005-07-08T21:44:00', '2005-07-10T02:58:00', '2'), + ('52', '4160', '2006-02-16T02:30:53', '2005-07-29T16:17:49', '2005-08-01T12:50:49', '2'), + ('326', '2270', '2006-02-16T02:30:53', '2005-07-09T08:17:41', '2005-07-18T09:45:41', '2'), + ('294', '3726', '2006-02-16T02:30:53', '2005-08-23T15:34:46', '2005-08-30T21:00:46', '2'), + ('504', '3915', '2006-02-16T02:30:53', '2005-08-23T11:17:26', '2005-08-31T13:58:26', '2'), + ('470', '1437', '2006-02-16T02:30:53', '2005-06-15T06:13:57', '2005-06-16T06:54:57', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['11220', '12557', '6310', '2548', '12116', '15582', '150', '11983', '5904', '12552', '10872', '14388', '143', '11204', '10008', '1432', '9501', '13195', '4075', '12315', '10468', '12638', '4071', '11795', '14009', '9549', '9535', '7908', '8263', '14160', '1944', '4549', '245', '15304', '10262', '13687', '12111', '16041', '10561', '15763', '5040', '13497', '12902', '9321', '13085', '14703', '4716', '1049', '4455', '15673', '1609', '3796', '13711', '4247', '13568', '6847', '15795', '674', '2110', '9017', '14382', '7515', '6758', '15638', '11666', '5507', '4002', '14955', '9304', '10746', '14628', '13288', '13314', '9325', '12783', '12930', '14390', '11948', '12978', '2956', '3250', '7115', '6899', '13857', '2209', '12507', '2496', '6209', '12155', '9445', '1124', '8375', '14462', '5806', '4731', '5718', '5219', '6923', '9057', '3035']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('84', '3777', '2006-02-16T02:30:53', '2005-08-02T12:31:41', '2005-08-05T08:23:41', '2'), + ('364', '313', '2006-02-16T02:30:53', '2005-08-18T14:51:03', '2005-08-19T13:30:03', '2'), + ('537', '3064', '2006-02-16T02:30:53', '2005-07-11T18:14:05', '2005-07-16T15:39:05', '2'), + ('561', '4292', '2006-02-16T02:30:53', '2005-06-19T02:45:35', '2005-06-22T06:52:35', '2'), + ('560', '3082', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('297', '4264', '2006-02-16T02:30:53', '2005-08-23T05:45:44', '2005-08-25T07:54:44', '2'), + ('429', '909', '2006-02-16T02:30:53', '2005-05-26T00:28:39', '2005-06-01T02:10:39', '2'), + ('304', '2580', '2006-02-16T02:30:53', '2005-08-17T18:13:55', '2005-08-23T18:27:55', '2'), + ('531', '350', '2006-02-16T02:30:53', '2005-07-10T20:39:44', '2005-07-13T17:57:44', '2'), + ('413', '4303', '2006-02-16T02:30:53', '2005-08-18T14:46:34', '2005-08-20T11:02:34', '2'), + ('84', '2470', '2006-02-16T02:30:53', '2005-08-02T00:27:50', '2005-08-06T20:34:50', '2'), + ('274', '1078', '2006-02-16T02:30:53', '2005-08-21T10:15:13', '2005-08-30T13:41:13', '2'), + ('297', '847', '2006-02-16T02:30:53', '2005-05-25T23:45:52', '2005-05-27T21:41:52', '2'), + ('247', '3578', '2006-02-16T02:30:53', '2005-08-02T11:56:31', '2005-08-06T14:16:31', '2'), + ('91', '2589', '2006-02-16T02:30:53', '2005-07-31T17:59:36', '2005-08-03T22:43:36', '2'), + ('339', '523', '2006-02-16T02:30:53', '2005-06-15T18:27:24', '2005-06-21T14:03:24', '2'), + ('75', '4398', '2006-02-16T02:30:53', '2005-07-30T23:59:21', '2005-08-05T19:50:21', '2'), + ('565', '2537', '2006-02-16T02:30:53', '2005-08-19T14:39:14', '2005-08-24T10:30:14', '2'), + ('593', '1989', '2006-02-16T02:30:53', '2005-07-07T04:51:44', '2005-07-09T03:07:44', '2'), + ('579', '2012', '2006-02-16T02:30:53', '2005-08-18T06:15:06', '2005-08-24T07:45:06', '2'), + ('129', '2115', '2006-02-16T02:30:53', '2005-08-01T09:48:29', '2005-08-05T09:58:29', '2'), + ('172', '2849', '2006-02-16T02:30:53', '2005-08-18T18:11:39', '2005-08-25T21:54:39', '2'), + ('209', '2883', '2006-02-16T02:30:53', '2005-07-07T04:37:26', '2005-07-13T06:45:26', '2'), + ('565', '2220', '2006-02-16T02:30:53', '2005-08-17T11:13:38', '2005-08-19T14:20:38', '2'), + ('382', '3004', '2006-02-16T02:30:53', '2005-08-20T20:26:53', '2005-08-21T23:32:53', '2'), + ('63', '2409', '2006-02-16T02:30:53', '2005-07-31T01:57:04', '2005-08-07T21:00:04', '2'), + ('485', '2413', '2006-02-16T02:30:53', '2005-07-31T01:18:53', '2005-08-04T03:04:53', '2'), + ('360', '3646', '2006-02-16T02:30:53', '2005-07-28T11:32:57', '2005-08-03T13:30:57', '2'), + ('5', '28', '2006-02-16T02:30:53', '2005-07-29T01:11:23', '2005-07-31T01:53:23', '2'), + ('493', '2428', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('16', '318', '2006-02-16T02:30:53', '2005-06-17T07:50:53', '2005-06-23T02:52:53', '2'), + ('98', '2797', '2006-02-16T02:30:53', '2005-07-08T04:25:03', '2005-07-10T09:01:03', '2'), + ('158', '3045', '2006-02-16T02:30:53', '2005-05-26T13:46:59', '2005-05-27T09:58:59', '2'), + ('112', '4332', '2006-02-16T02:30:53', '2005-08-22T19:45:57', '2005-08-28T00:21:57', '2'), + ('181', '3842', '2006-02-16T02:30:53', '2005-08-01T03:01:26', '2005-08-08T08:03:26', '2'), + ('290', '3629', '2006-02-16T02:30:53', '2005-08-20T08:57:51', '2005-08-22T07:02:51', '2'), + ('317', '2905', '2006-02-16T02:30:53', '2005-08-17T22:59:55', '2005-08-22T19:33:55', '2'), + ('121', '4116', '2006-02-16T02:30:53', '2005-08-23T22:20:26', '2005-08-25T20:14:26', '2'), + ('8', '2195', '2006-02-16T02:30:53', '2005-08-01T13:05:35', '2005-08-04T08:34:35', '2'), + ('158', '124', '2006-02-16T02:30:53', '2005-08-23T13:02:59', '2005-08-24T17:45:59', '2'), + ('405', '2479', '2006-02-16T02:30:53', '2005-07-09T03:16:34', '2005-07-17T01:13:34', '2'), + ('481', '1296', '2006-02-16T02:30:53', '2005-08-20T01:46:38', '2005-08-26T05:37:38', '2'), + ('91', '464', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('112', '3558', '2006-02-16T02:30:53', '2005-07-30T17:19:44', '2005-08-06T22:42:44', '2'), + ('215', '360', '2006-02-16T02:30:53', '2005-08-19T10:28:22', '2005-08-22T07:37:22', '2'), + ('29', '4329', '2006-02-16T02:30:53', '2005-08-21T21:01:19', '2005-08-22T15:13:19', '2'), + ('391', '1923', '2006-02-16T02:30:53', '2005-07-08T12:18:51', '2005-07-11T11:06:51', '2'), + ('312', '3913', '2006-02-16T02:30:53', '2005-05-31T06:57:04', '2005-06-02T11:32:04', '2'), + ('507', '1396', '2006-02-16T02:30:53', '2005-07-07T23:43:46', '2005-07-08T21:34:46', '2'), + ('321', '3096', '2006-02-16T02:30:53', '2005-08-23T09:12:50', '2005-08-29T12:45:50', '2'), + ('174', '2279', '2006-02-16T02:30:53', '2005-06-16T06:34:59', '2005-06-17T09:41:59', '2'), + ('228', '1649', '2006-02-16T02:30:53', '2005-07-06T14:45:22', '2005-07-07T11:01:22', '2'), + ('453', '2318', '2006-02-16T02:30:53', '2005-08-20T09:35:20', '2005-08-28T09:06:20', '2'), + ('539', '808', '2006-02-16T02:30:53', '2005-07-07T13:51:54', '2005-07-10T09:43:54', '2'), + ('151', '1243', '2006-02-16T02:30:53', '2005-08-20T05:02:46', '2005-08-27T03:12:46', '2'), + ('63', '346', '2006-02-16T02:30:53', '2005-07-12T19:22:37', '2005-07-21T18:53:37', '2'), + ('417', '4371', '2006-02-16T02:30:53', '2005-08-23T14:07:56', '2005-08-25T12:10:56', '2'), + ('87', '1150', '2006-02-16T02:30:53', '2005-05-28T22:11:35', '2005-06-01T23:58:35', '2'), + ('163', '3592', '2006-02-16T02:30:53', '2005-06-17T19:45:49', '2005-06-26T18:59:49', '2'), + ('319', '3325', '2006-02-16T02:30:53', '2005-07-30T05:26:20', '2005-08-04T10:00:20', '2'), + ('119', '4119', '2006-02-16T02:30:53', '2005-08-21T10:01:03', '2005-08-22T13:21:03', '2'), + ('390', '1211', '2006-02-16T02:30:53', '2005-07-27T20:52:37', '2005-08-02T20:17:37', '2'), + ('546', '4098', '2006-02-16T02:30:53', '2005-07-12T15:13:49', '2005-07-20T09:31:49', '2'), + ('563', '3358', '2006-02-16T02:30:53', '2005-08-23T07:54:54', '2005-08-30T13:33:54', '2'), + ('531', '250', '2006-02-16T02:30:53', '2005-08-17T05:45:10', '2005-08-19T06:47:10', '2'), + ('399', '716', '2006-02-16T02:30:53', '2005-07-10T00:49:04', '2005-07-15T22:06:04', '2'), + ('308', '2790', '2006-02-16T02:30:53', '2005-07-07T00:08:18', '2005-07-14T01:29:18', '2'), + ('445', '1534', '2006-02-16T02:30:53', '2005-08-22T06:25:52', '2005-08-25T12:13:52', '2'), + ('296', '2937', '2006-02-16T02:30:53', '2005-07-30T16:41:34', '2005-08-02T13:55:34', '2'), + ('508', '305', '2006-02-16T02:30:53', '2005-08-01T19:58:49', '2005-08-10T19:00:49', '2'), + ('331', '3636', '2006-02-16T02:30:53', '2005-08-21T18:37:24', '2005-08-27T20:25:24', '2'), + ('162', '3558', '2006-02-16T02:30:53', '2005-08-19T18:30:10', '2005-08-20T19:20:10', '2'), + ('347', '2899', '2006-02-16T02:30:53', '2005-08-19T19:12:43', '2005-08-27T00:20:43', '2'), + ('476', '1938', '2006-02-16T02:30:53', '2005-07-30T17:29:19', '2005-08-08T12:55:19', '2'), + ('503', '1109', '2006-02-16T02:30:53', '2005-08-19T00:01:14', '2005-08-21T22:02:14', '2'), + ('414', '4410', '2006-02-16T02:30:53', '2005-08-19T05:11:32', '2005-08-22T02:20:32', '2'), + ('366', '3951', '2006-02-16T02:30:53', '2005-08-21T10:15:38', '2005-08-28T05:50:38', '2'), + ('40', '3329', '2006-02-16T02:30:53', '2005-08-17T17:11:05', '2005-08-25T21:16:05', '2'), + ('167', '3252', '2006-02-16T02:30:53', '2005-08-19T06:57:27', '2005-08-20T09:10:27', '2'), + ('533', '2684', '2006-02-16T02:30:53', '2005-06-20T06:47:23', '2005-06-22T07:24:23', '2'), + ('467', '736', '2006-02-16T02:30:53', '2005-06-21T03:16:36', '2005-06-29T00:53:36', '2'), + ('359', '3620', '2006-02-16T02:30:53', '2005-07-27T05:42:58', '2005-08-02T05:35:58', '2'), + ('483', '3565', '2006-02-16T02:30:53', '2005-07-12T21:44:16', '2005-07-21T22:21:16', '2'), + ('366', '2542', '2006-02-16T02:30:53', '2005-08-20T14:50:06', '2005-08-24T10:38:06', '2'), + ('13', '2441', '2006-02-16T02:30:53', '2005-06-18T02:24:01', '2005-06-22T04:13:01', '2'), + ('584', '199', '2006-02-16T02:30:53', '2005-08-18T13:19:13', '2005-08-27T11:48:13', '2'), + ('527', '646', '2006-02-16T02:30:53', '2005-06-18T22:20:11', '2005-06-20T03:08:11', '2'), + ('219', '3091', '2006-02-16T02:30:53', '2005-07-11T12:36:05', '2005-07-17T14:48:05', '2'), + ('315', '2065', '2006-02-16T02:30:53', '2005-08-18T00:24:30', '2005-08-18T19:12:30', '2'), + ('549', '1480', '2006-02-16T02:30:53', '2005-07-30T21:50:42', '2005-08-05T18:34:42', '2'), + ('134', '4560', '2006-02-16T02:30:53', '2005-05-31T16:49:34', '2005-06-04T19:32:34', '2'), + ('125', '3634', '2006-02-16T02:30:53', '2005-07-29T05:25:30', '2005-08-04T01:43:30', '2'), + ('96', '2201', '2006-02-16T02:30:53', '2005-08-21T12:50:57', '2005-08-27T10:42:57', '2'), + ('108', '29', '2006-02-16T02:30:53', '2005-07-10T15:11:54', '2005-07-15T11:51:54', '2'), + ('241', '4124', '2006-02-16T02:30:53', '2005-07-08T13:08:18', '2005-07-09T13:16:18', '2'), + ('20', '3719', '2006-02-16T02:30:53', '2005-07-10T11:03:20', '2005-07-19T15:38:20', '2'), + ('209', '3933', '2006-02-16T02:30:53', '2005-07-09T11:57:55', '2005-07-15T09:43:55', '2'), + ('490', '2642', '2006-02-16T02:30:53', '2005-07-12T22:40:48', '2005-07-19T23:07:48', '2'), + ('202', '3141', '2006-02-16T02:30:53', '2005-07-30T07:14:18', '2005-08-01T05:10:18', '2'), + ('62', '1223', '2006-02-16T02:30:53', '2005-06-20T12:17:03', '2005-06-26T17:42:03', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['9688', '9446', '2567', '1916', '11250', '12704', '5897', '11304', '7008', '12147', '10328', '2804', '7351', '2734', '267', '7125', '11906', '1003', '6670', '4681', '3824', '15905', '4541', '15556', '5661', '9031', '11443', '14120', '2101', '13618', '1663', '676', '964', '2701', '10789', '8129', '12169', '13668', '4177', '5244', '3134', '1483', '9505', '14880', '2049', '4413', '7467', '1535', '5663', '14774', '12496', '4004', '10290', '6879', '10964', '6044', '13037', '14079', '1490', '588', '8233', '704', '5093', '3692', '3217', '10080', '14617', '9243', '6113', '3101', '13070', '13638', '6548', '15511', '4710', '597', '15305', '68', '3466', '7767', '2459', '10981', '1421', '4985', '9873', '7272', '10310', '921', '2758', '8918', '6565', '4351', '6217', '14227', '4400', '11824', '12088', '10530', '6396', '427']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('566', '1304', '2006-02-16T02:30:53', '2005-07-31T06:56:08', '2005-08-08T03:31:08', '2'), + ('477', '1880', '2006-02-16T02:30:53', '2005-07-30T21:53:01', '2005-08-06T19:00:01', '2'), + ('496', '216', '2006-02-16T02:30:53', '2005-06-19T04:04:46', '2005-06-19T23:39:46', '2'), + ('429', '4428', '2006-02-16T02:30:53', '2005-06-17T05:29:59', '2005-06-26T05:35:59', '2'), + ('279', '2223', '2006-02-16T02:30:53', '2005-08-02T13:35:42', '2005-08-10T12:32:42', '2'), + ('93', '51', '2006-02-16T02:30:53', '2005-08-18T20:43:00', '2005-08-21T22:28:00', '2'), + ('413', '740', '2006-02-16T02:30:53', '2005-07-10T20:16:14', '2005-07-19T15:49:14', '2'), + ('413', '2592', '2006-02-16T02:30:53', '2005-08-02T15:40:10', '2005-08-06T16:12:10', '2'), + ('12', '3659', '2006-02-16T02:30:53', '2005-07-27T01:44:03', '2005-07-28T21:19:03', '2'), + ('41', '705', '2006-02-16T02:30:53', '2005-08-18T00:10:20', '2005-08-23T20:36:20', '2'), + ('85', '1191', '2006-02-16T02:30:53', '2005-08-01T04:56:10', '2005-08-01T23:22:10', '2'), + ('426', '88', '2006-02-16T02:30:53', '2005-06-19T19:24:54', '2005-06-25T01:19:54', '2'), + ('445', '2147', '2006-02-16T02:30:53', '2005-07-27T14:37:36', '2005-07-30T09:58:36', '2'), + ('204', '794', '2006-02-16T02:30:53', '2005-06-19T15:36:27', '2005-06-20T13:44:27', '2'), + ('417', '1206', '2006-02-16T02:30:53', '2005-05-26T16:16:21', '2005-05-30T16:53:21', '2'), + ('460', '801', '2006-02-16T02:30:53', '2005-07-27T06:11:00', '2005-08-04T09:41:00', '2'), + ('478', '325', '2006-02-16T02:30:53', '2005-08-17T15:40:46', '2005-08-20T15:20:46', '2'), + ('161', '133', '2006-02-16T02:30:53', '2005-05-31T00:48:20', '2005-06-02T04:53:20', '2'), + ('249', '3106', '2006-02-16T02:30:53', '2005-07-12T11:44:33', '2005-07-19T07:54:33', '2'), + ('133', '1025', '2006-02-16T02:30:53', '2005-07-08T10:36:03', '2005-07-16T09:21:03', '2'), + ('107', '3107', '2006-02-16T02:30:53', '2005-07-06T15:43:15', '2005-07-13T16:05:15', '2'), + ('59', '3631', '2006-02-16T02:30:53', '2005-08-23T17:33:04', '2005-08-26T17:38:04', '2'), + ('248', '1976', '2006-02-16T02:30:53', '2005-07-08T04:04:19', '2005-07-13T07:27:19', '2'), + ('108', '3683', '2006-02-16T02:30:53', '2005-08-23T04:52:16', '2005-09-01T02:05:16', '2'), + ('108', '1878', '2006-02-16T02:30:53', '2005-07-10T07:53:51', '2005-07-14T12:57:51', '2'), + ('2', '2377', '2006-02-16T02:30:53', '2005-07-30T06:06:10', '2005-08-04T10:45:10', '2'), + ('581', '1291', '2006-02-16T02:30:53', '2005-08-02T20:29:30', '2005-08-07T01:08:30', '2'), + ('302', '4069', '2006-02-16T02:30:53', '2005-08-21T01:25:00', '2005-08-24T23:21:00', '2'), + ('581', '2137', '2006-02-16T02:30:53', '2005-06-17T18:57:02', '2005-06-20T15:38:02', '2'), + ('390', '390', '2006-02-16T02:30:53', '2005-08-20T06:36:46', '2005-08-29T05:17:46', '2'), + ('186', '1558', '2006-02-16T02:30:53', '2005-06-16T10:14:15', '2005-06-23T08:34:15', '2'), + ('490', '2329', '2006-02-16T02:30:53', '2005-05-28T22:27:51', '2005-05-29T20:36:51', '2'), + ('287', '657', '2006-02-16T02:30:53', '2005-05-30T18:53:21', '2005-06-04T22:32:21', '2'), + ('29', '1623', '2006-02-16T02:30:53', '2005-06-19T13:33:06', '2005-06-28T15:11:06', '2'), + ('403', '3298', '2006-02-16T02:30:53', '2005-08-01T21:37:55', '2005-08-07T17:01:55', '2'), + ('345', '2546', '2006-02-16T02:30:53', '2005-07-28T19:47:02', '2005-07-31T21:33:02', '2'), + ('323', '2281', '2006-02-16T02:30:53', '2005-08-18T01:05:54', '2005-08-24T02:16:54', '2'), + ('123', '3659', '2006-02-16T02:30:53', '2005-08-20T08:26:06', '2005-08-25T05:52:06', '2'), + ('317', '4106', '2006-02-16T02:30:53', '2005-07-07T10:12:36', '2005-07-15T15:48:36', '2'), + ('1', '3726', '2006-02-16T02:30:53', '2005-07-09T13:24:07', '2005-07-14T14:01:07', '2'), + ('537', '1389', '2006-02-16T02:30:53', '2005-06-20T19:29:09', '2005-06-29T19:31:09', '2'), + ('242', '1926', '2006-02-16T02:30:53', '2005-06-15T21:21:58', '2005-06-24T00:44:58', '2'), + ('543', '4047', '2006-02-16T02:30:53', '2005-07-31T00:11:19', '2005-08-05T18:24:19', '2'), + ('224', '3615', '2006-02-16T02:30:53', '2005-08-22T03:44:36', '2005-08-24T05:45:36', '2'), + ('182', '1053', '2006-02-16T02:30:53', '2005-06-17T14:58:36', '2005-06-22T14:53:36', '2'), + ('565', '1062', '2006-02-16T02:30:53', '2005-07-07T22:00:04', '2005-07-10T18:20:04', '2'), + ('240', '3869', '2006-02-16T02:30:53', '2005-07-27T18:51:54', '2005-08-03T23:27:54', '2'), + ('202', '1096', '2006-02-16T02:30:53', '2005-06-16T00:52:04', '2005-06-20T22:47:04', '2'), + ('530', '3078', '2006-02-16T02:30:53', '2005-07-10T08:01:33', '2005-07-15T03:36:33', '2'), + ('252', '3185', '2006-02-16T02:30:53', '2005-08-21T23:52:32', '2005-08-26T23:42:32', '2'), + ('489', '456', '2006-02-16T02:30:53', '2005-08-18T12:58:25', '2005-08-27T18:43:25', '2'), + ('574', '667', '2006-02-16T02:30:53', '2005-07-07T00:20:51', '2005-07-11T18:55:51', '2'), + ('364', '4542', '2006-02-16T02:30:53', '2005-08-01T03:39:50', '2005-08-08T22:29:50', '2'), + ('416', '1901', '2006-02-16T02:30:53', '2005-07-12T20:37:37', '2005-07-20T15:40:37', '2'), + ('36', '2356', '2006-02-16T02:30:53', '2005-08-02T03:56:23', '2005-08-09T23:11:23', '2'), + ('481', '1270', '2006-02-16T02:30:53', '2005-07-11T03:18:39', '2005-07-13T06:58:39', '2'), + ('275', '65', '2006-02-16T02:30:53', '2005-08-19T08:53:57', '2005-08-28T08:56:57', '2'), + ('348', '3528', '2006-02-16T02:30:53', '2005-08-20T23:29:25', '2005-08-25T04:16:25', '2'), + ('123', '3515', '2006-02-16T02:30:53', '2005-06-15T21:42:17', '2005-06-22T02:01:17', '2'), + ('89', '95', '2006-02-16T02:30:53', '2005-05-28T12:08:37', '2005-05-29T16:25:37', '2'), + ('93', '1640', '2006-02-16T02:30:53', '2005-07-29T00:16:23', '2005-08-03T05:17:23', '2'), + ('330', '2628', '2006-02-16T02:30:53', '2005-05-29T02:44:43', '2005-06-06T01:51:43', '2'), + ('597', '2734', '2006-02-16T02:30:53', '2005-07-09T05:59:12', '2005-07-10T11:45:12', '2'), + ('286', '1237', '2006-02-16T02:30:53', '2005-07-06T09:54:12', '2005-07-11T09:42:12', '2'), + ('463', '1027', '2006-02-16T02:30:53', '2005-06-21T01:28:12', '2005-06-25T02:51:12', '2'), + ('62', '4355', '2006-02-16T02:30:53', '2005-07-31T20:07:10', '2005-08-04T23:07:10', '2'), + ('51', '3562', '2006-02-16T02:30:53', '2005-08-21T18:07:40', '2005-08-24T23:48:40', '2'), + ('516', '876', '2006-02-16T02:30:53', '2005-07-30T14:06:27', '2005-08-06T09:26:27', '2'), + ('115', '4437', '2006-02-16T02:30:53', '2005-07-11T07:31:08', '2005-07-20T11:01:08', '2'), + ('384', '1738', '2006-02-16T02:30:53', '2005-06-20T16:48:58', '2005-06-27T18:13:58', '2'), + ('235', '2214', '2006-02-16T02:30:53', '2005-08-19T09:56:23', '2005-08-24T09:08:23', '2'), + ('493', '3255', '2006-02-16T02:30:53', '2005-08-20T07:21:15', '2005-08-23T11:09:15', '2'), + ('488', '2480', '2006-02-16T02:30:53', '2005-07-12T05:00:46', '2005-07-19T04:40:46', '2'), + ('303', '3327', '2006-02-16T02:30:53', '2005-08-23T02:55:42', '2005-08-31T03:14:42', '2'), + ('590', '248', '2006-02-16T02:30:53', '2005-07-08T12:04:53', '2005-07-13T11:28:53', '2'), + ('249', '4469', '2006-02-16T02:30:53', '2005-05-28T14:01:02', '2005-06-06T19:06:02', '2'), + ('529', '671', '2006-02-16T02:30:53', '2005-08-22T19:46:05', '2005-08-27T19:11:05', '2'), + ('120', '4029', '2006-02-16T02:30:53', '2005-05-25T09:47:31', '2005-05-31T10:20:31', '2'), + ('226', '371', '2006-02-16T02:30:53', '2005-06-21T22:13:33', '2005-06-25T21:01:33', '2'), + ('139', '329', '2006-02-16T02:30:53', '2005-07-28T06:42:02', '2005-08-05T11:19:02', '2'), + ('185', '1024', '2006-02-16T02:30:53', '2005-06-18T19:44:08', '2005-06-23T19:14:08', '2'), + ('305', '3699', '2006-02-16T02:30:53', '2005-08-02T04:17:53', '2005-08-09T03:45:53', '2'), + ('533', '2439', '2006-02-16T02:30:53', '2005-06-15T17:57:04', '2005-06-21T20:38:04', '2'), + ('208', '2146', '2006-02-16T02:30:53', '2005-07-09T00:36:02', '2005-07-14T04:06:02', '2'), + ('442', '667', '2006-02-16T02:30:53', '2005-07-31T13:32:18', '2005-08-06T11:15:18', '2'), + ('364', '250', '2006-02-16T02:30:53', '2005-07-27T11:30:20', '2005-07-29T17:16:20', '2'), + ('271', '9', '2006-02-16T02:30:53', '2005-08-01T04:24:47', '2005-08-04T05:36:47', '2'), + ('508', '1827', '2006-02-16T02:30:53', '2005-05-30T11:53:09', '2005-06-03T10:00:09', '2'), + ('423', '3558', '2006-02-16T02:30:53', '2005-06-19T17:04:35', '2005-06-26T14:45:35', '2'), + ('424', '2544', '2006-02-16T02:30:53', '2005-07-30T01:56:22', '2005-08-04T01:58:22', '2'), + ('35', '2751', '2006-02-16T02:30:53', '2005-07-12T05:39:50', '2005-07-13T01:07:50', '2'), + ('382', '3567', '2006-02-16T02:30:53', '2005-07-07T19:04:24', '2005-07-14T00:03:24', '2'), + ('177', '1090', '2006-02-16T02:30:53', '2005-07-11T13:13:45', '2005-07-19T16:37:45', '2'), + ('277', '4102', '2006-02-16T02:30:53', '2005-08-21T04:56:31', '2005-08-22T05:04:31', '2'), + ('370', '49', '2006-02-16T02:30:53', '2005-07-07T21:22:26', '2005-07-16T00:59:26', '2'), + ('1', '2639', '2006-02-16T02:30:53', '2005-08-17T12:37:54', '2005-08-19T10:11:54', '2'), + ('360', '1754', '2006-02-16T02:30:53', '2005-08-17T22:20:16', '2005-08-25T23:30:16', '2'), + ('520', '3216', '2006-02-16T02:30:53', '2005-08-01T12:01:17', '2005-08-06T09:55:17', '2'), + ('507', '2394', '2006-02-16T02:30:53', '2005-07-11T22:31:08', '2005-07-19T17:19:08', '2'), + ('288', '1677', '2006-02-16T02:30:53', '2005-05-27T16:10:04', '2005-06-05T13:22:04', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['551', '12197', '14113', '13703', '15195', '2348', '1419', '10778', '15230', '12339', '11880', '15273', '13229', '6893', '3410', '15732', '961', '12387', '10234', '768', '3147', '6291', '12675', '4593', '15865', '2297', '2170', '11087', '4365', '12109', '2746', '15504', '15482', '10150', '9464', '3624', '11091', '9410', '12530', '3772', '2313', '6369', '3574', '12171', '9946', '10291', '14902', '113', '95', '1798', '12005', '4295', '10405', '269', '10524', '9809', '5640', '9458', '6927', '9730', '7947', '12712', '514', '14154', '926', '4888', '14437', '9990', '10689', '7460', '5399', '7730', '4687', '13920', '5425', '3982', '7255', '147', '14293', '6678', '4385', '6738', '4049', '8758', '1766', '14578', '4160', '3286', '11403', '951', '10932', '736', '13396', '9735', '10655', '5882', '13607', '6137', '1007', '4207']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('315', '3119', '2006-02-16T02:30:53', '2005-05-28T07:44:18', '2005-06-02T12:55:18', '2'), + ('564', '3687', '2006-02-16T02:30:53', '2005-08-18T02:08:58', '2005-08-26T21:54:58', '2'), + ('288', '931', '2006-02-16T02:30:53', '2005-08-21T01:03:30', '2005-08-23T06:46:30', '2'), + ('356', '2296', '2006-02-16T02:30:53', '2005-08-20T09:29:35', '2005-08-27T08:03:35', '2'), + ('508', '1080', '2006-02-16T02:30:53', '2005-08-22T16:08:23', '2005-08-30T17:56:23', '2'), + ('449', '3622', '2006-02-16T02:30:53', '2005-06-18T12:15:43', '2005-06-24T14:03:43', '2'), + ('312', '1208', '2006-02-16T02:30:53', '2005-06-15T17:54:50', '2005-06-17T19:44:50', '2'), + ('220', '1939', '2006-02-16T02:30:53', '2005-08-01T21:11:39', '2005-08-02T22:59:39', '2'), + ('466', '2572', '2006-02-16T02:30:53', '2005-08-22T17:31:41', '2005-08-25T21:57:41', '2'), + ('370', '1600', '2006-02-16T02:30:53', '2005-08-18T07:05:06', '2005-08-19T02:27:06', '2'), + ('597', '1539', '2006-02-16T02:30:53', '2005-08-17T14:28:28', '2005-08-26T12:32:28', '2'), + ('422', '2558', '2006-02-16T02:30:53', '2005-08-22T18:53:28', '2005-08-30T18:58:28', '2'), + ('283', '634', '2006-02-16T02:30:53', '2005-08-19T16:08:33', '2005-08-22T19:54:33', '2'), + ('377', '2611', '2006-02-16T02:30:53', '2005-07-12T21:20:11', '2005-07-21T18:55:11', '2'), + ('321', '1197', '2006-02-16T02:30:53', '2005-06-21T16:20:47', '2005-06-24T19:09:47', '2'), + ('412', '3247', '2006-02-16T02:30:53', '2005-08-23T11:35:12', '2005-08-26T12:50:12', '2'), + ('588', '3293', '2006-02-16T02:30:53', '2005-05-30T18:16:44', '2005-06-04T23:40:44', '2'), + ('530', '3604', '2006-02-16T02:30:53', '2005-08-18T08:46:24', '2005-08-21T02:56:24', '2'), + ('207', '1641', '2006-02-16T02:30:53', '2005-08-01T01:56:20', '2005-08-09T01:51:20', '2'), + ('566', '2895', '2006-02-16T02:30:53', '2005-05-29T12:30:46', '2005-06-07T09:00:46', '2'), + ('390', '615', '2006-02-16T02:30:53', '2005-06-20T20:25:17', '2005-06-28T20:22:17', '2'), + ('262', '3126', '2006-02-16T02:30:53', '2005-07-11T17:16:40', '2005-07-13T18:24:40', '2'), + ('140', '569', '2006-02-16T02:30:53', '2005-08-18T19:34:02', '2005-08-23T13:36:02', '2'), + ('528', '2897', '2006-02-16T02:30:53', '2005-07-08T06:38:12', '2005-07-16T10:48:12', '2'), + ('482', '2031', '2006-02-16T02:30:53', '2005-08-23T16:18:25', '2005-08-26T10:57:25', '2'), + ('111', '2262', '2006-02-16T02:30:53', '2005-06-18T08:17:41', '2005-06-26T05:08:41', '2'), + ('42', '3989', '2006-02-16T02:30:53', '2005-06-17T23:57:34', '2005-06-22T03:37:34', '2'), + ('2', '654', '2006-02-16T02:30:53', '2005-08-02T07:41:41', '2005-08-10T10:37:41', '2'), + ('442', '3207', '2006-02-16T02:30:53', '2005-07-07T19:47:46', '2005-07-08T23:21:46', '2'), + ('509', '1423', '2006-02-16T02:30:53', '2005-08-17T22:58:35', '2005-08-25T19:44:35', '2'), + ('562', '933', '2006-02-16T02:30:53', '2005-06-19T16:21:40', '2005-06-28T11:56:40', '2'), + ('315', '1967', '2006-02-16T02:30:53', '2005-08-23T02:45:21', '2005-09-01T03:24:21', '2'), + ('181', '3923', '2006-02-16T02:30:53', '2005-08-23T02:01:20', '2005-08-24T03:25:20', '2'), + ('419', '2328', '2006-02-16T02:30:53', '2005-07-31T22:22:00', '2005-08-05T01:17:00', '2'), + ('534', '3904', '2006-02-16T02:30:53', '2005-07-30T22:31:31', '2005-08-07T01:10:31', '2'), + ('115', '1778', '2006-02-16T02:30:53', '2005-07-06T06:06:27', '2005-07-13T08:30:27', '2'), + ('423', '1659', '2006-02-16T02:30:53', '2005-08-02T07:56:41', '2005-08-07T05:35:41', '2'), + ('22', '1789', '2006-02-16T02:30:53', '2005-07-30T20:38:05', '2005-07-31T19:57:05', '2'), + ('521', '1054', '2006-02-16T02:30:53', '2005-08-18T13:54:48', '2005-08-26T08:58:48', '2'), + ('338', '434', '2006-02-16T02:30:53', '2005-07-06T13:22:53', '2005-07-10T11:54:53', '2'), + ('379', '3134', '2006-02-16T02:30:53', '2005-06-18T08:56:45', '2005-06-26T10:30:45', '2'), + ('252', '1086', '2006-02-16T02:30:53', '2005-07-11T21:23:36', '2005-07-13T22:23:36', '2'), + ('225', '2799', '2006-02-16T02:30:53', '2005-07-06T03:36:01', '2005-07-10T01:29:01', '2'), + ('457', '454', '2006-02-16T02:30:53', '2005-08-18T01:06:13', '2005-08-22T19:39:13', '2'), + ('29', '2100', '2006-02-16T02:30:53', '2005-07-31T15:48:54', '2005-08-03T12:42:54', '2'), + ('420', '2056', '2006-02-16T02:30:53', '2005-08-01T03:39:57', '2005-08-05T02:05:57', '2'), + ('423', '866', '2006-02-16T02:30:53', '2005-08-22T04:31:50', '2005-08-23T23:47:50', '2'), + ('93', '2963', '2006-02-16T02:30:53', '2005-05-25T19:07:40', '2005-05-27T22:16:40', '2'), + ('400', '178', '2006-02-16T02:30:53', '2005-05-25T16:12:52', '2005-06-02T18:55:52', '2'), + ('429', '1654', '2006-02-16T02:30:53', '2005-06-16T20:16:15', '2005-06-20T22:23:15', '2'), + ('403', '2062', '2006-02-16T02:30:53', '2005-08-17T18:56:55', '2005-08-25T20:23:55', '2'), + ('319', '2490', '2006-02-16T02:30:53', '2005-07-07T16:08:51', '2005-07-13T13:06:51', '2'), + ('463', '3641', '2006-02-16T02:30:53', '2005-08-01T07:35:25', '2005-08-05T05:38:25', '2'), + ('322', '3501', '2006-02-16T02:30:53', '2005-05-26T16:19:46', '2005-05-27T15:59:46', '2'), + ('38', '4116', '2006-02-16T02:30:53', '2005-08-01T11:53:12', '2005-08-08T10:40:12', '2'), + ('286', '359', '2006-02-16T02:30:53', '2005-07-31T11:19:21', '2005-08-08T12:43:21', '2'), + ('574', '2706', '2006-02-16T02:30:53', '2005-07-10T06:38:00', '2005-07-18T08:56:00', '2'), + ('343', '3105', '2006-02-16T02:30:53', '2005-07-30T22:24:34', '2005-08-04T21:26:34', '2'), + ('470', '4511', '2006-02-16T02:30:53', '2005-07-26T22:56:00', '2005-08-05T03:16:00', '2'), + ('242', '2605', '2006-02-16T02:30:53', '2005-07-31T08:50:08', '2005-08-08T12:21:08', '2'), + ('279', '2504', '2006-02-16T02:30:53', '2005-07-28T13:05:50', '2005-08-02T11:16:50', '2'), + ('444', '2628', '2006-02-16T02:30:53', '2005-08-18T21:04:13', '2005-08-25T18:15:13', '2'), + ('597', '1697', '2006-02-16T02:30:53', '2005-05-28T03:09:28', '2005-06-05T00:49:28', '2'), + ('468', '951', '2006-02-16T02:30:53', '2005-08-21T02:30:00', '2005-08-28T01:41:00', '2'), + ('76', '4327', '2006-02-16T02:30:53', '2005-05-30T12:15:54', '2005-06-01T08:53:54', '2'), + ('527', '1220', '2006-02-16T02:30:53', '2005-07-08T20:04:27', '2005-07-10T14:53:27', '2'), + ('136', '1504', '2006-02-16T02:30:53', '2005-08-21T11:48:32', '2005-08-25T11:06:32', '2'), + ('555', '4481', '2006-02-16T02:30:53', '2005-07-31T17:24:21', '2005-08-09T17:14:21', '2'), + ('568', '1442', '2006-02-16T02:30:53', '2005-08-01T18:04:18', '2005-08-05T21:17:18', '2'), + ('442', '919', '2006-02-16T02:30:53', '2005-07-27T18:41:35', '2005-07-29T15:16:35', '2'), + ('67', '261', '2006-02-16T02:30:53', '2005-07-09T19:52:44', '2005-07-10T18:31:44', '2'), + ('155', '3118', '2006-02-16T02:30:53', '2005-07-28T04:59:48', '2005-08-04T04:35:48', '2'), + ('169', '1156', '2006-02-16T02:30:53', '2005-07-08T10:54:19', '2005-07-10T08:00:19', '2'), + ('460', '3200', '2006-02-16T02:30:53', '2005-08-20T16:51:18', '2005-08-27T16:05:18', '2'), + ('37', '531', '2006-02-16T02:30:53', '2005-07-09T21:02:26', '2005-07-16T23:38:26', '2'), + ('64', '4327', '2006-02-16T02:30:53', '2005-07-06T23:14:16', '2005-07-08T21:21:16', '2'), + ('502', '2101', '2006-02-16T02:30:53', '2005-07-27T10:49:54', '2005-07-31T10:40:54', '2'), + ('274', '633', '2006-02-16T02:30:53', '2005-05-26T00:17:50', '2005-05-29T23:21:50', '2'), + ('364', '3555', '2006-02-16T02:30:53', '2005-08-21T07:06:47', '2005-08-22T05:07:47', '2'), + ('330', '3473', '2006-02-16T02:30:53', '2005-07-12T11:58:36', '2005-07-15T17:50:36', '2'), + ('564', '849', '2006-02-16T02:30:53', '2005-07-07T20:48:38', '2005-07-11T17:03:38', '2'), + ('366', '1197', '2006-02-16T02:30:53', '2005-07-12T14:17:55', '2005-07-21T10:11:55', '2'), + ('79', '4172', '2006-02-16T02:30:53', '2005-07-07T03:34:53', '2005-07-15T04:10:53', '2'), + ('442', '2816', '2006-02-16T02:30:53', '2005-07-29T19:20:49', '2005-08-05T21:57:49', '2'), + ('118', '2041', '2006-02-16T02:30:53', '2005-06-16T17:59:37', '2005-06-18T16:32:37', '2'), + ('389', '3141', '2006-02-16T02:30:53', '2005-08-21T16:53:38', '2005-08-28T20:36:38', '2'), + ('326', '1909', '2006-02-16T02:30:53', '2005-07-07T09:13:17', '2005-07-15T11:50:17', '2'), + ('577', '742', '2006-02-16T02:30:53', '2005-06-21T06:31:29', '2005-06-25T00:46:29', '2'), + ('587', '4072', '2006-02-16T02:30:53', '2005-08-02T19:10:21', '2005-08-04T00:44:21', '2'), + ('59', '1395', '2006-02-16T02:30:53', '2005-05-30T16:10:35', '2005-05-31T19:01:35', '2'), + ('595', '1688', '2006-02-16T02:30:53', '2005-08-02T02:46:22', '2005-08-06T01:49:22', '2'), + ('276', '3689', '2006-02-16T02:30:53', '2005-05-29T08:10:07', '2005-06-05T10:21:07', '2'), + ('517', '4169', '2006-02-16T02:30:53', '2005-08-19T22:06:09', '2005-08-23T23:26:09', '2'), + ('315', '4228', '2006-02-16T02:30:53', '2005-07-31T08:57:49', '2005-08-08T13:51:49', '2'), + ('385', '1399', '2006-02-16T02:30:53', '2005-08-01T16:33:27', '2005-08-08T17:17:27', '2'), + ('319', '2830', '2006-02-16T02:30:53', '2005-07-10T19:20:34', '2005-07-11T18:39:34', '2'), + ('491', '2692', '2006-02-16T02:30:53', '2005-08-20T06:08:42', '2005-08-21T01:59:42', '2'), + ('67', '2029', '2006-02-16T02:30:53', '2005-07-11T08:34:20', '2005-07-13T03:31:20', '2'), + ('24', '3185', '2006-02-16T02:30:53', '2005-05-31T01:02:28', '2005-06-07T01:36:28', '2'), + ('588', '1119', '2006-02-16T02:30:53', '2005-07-07T11:32:45', '2005-07-14T05:49:45', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['1266', '12257', '11199', '10557', '1586', '9299', '9389', '13675', '6100', '4215', '2481', '318', '819', '15806', '7816', '2095', '11956', '3007', '7082', '12921', '13107', '4524', '12555', '1530', '8824', '1493', '8240', '6246', '1191', '661', '8967', '13397', '9019', '15728', '6609', '6301', '3313', '10937', '648', '12090', '2781', '12233', '1211', '9153', '9434', '8717', '12964', '12001', '12193', '2066', '2341', '7560', '14179', '2284', '4444', '10634', '9551', '9416', '2750', '4916', '13581', '13049', '6375', '3330', '2920', '615', '14485', '5944', '3909', '3538', '7756', '35', '4577', '9871', '7314', '3983', '14380', '11963', '6015', '5564', '10442', '15119', '7956', '11002', '2334', '15168', '2250', '13833', '6942', '171', '7189', '3651', '14047', '15794', '9920', '9725', '12685', '10588', '10116', '3349']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('96', '2230', '2006-02-16T02:30:53', '2005-06-15T07:11:39', '2005-06-21T02:59:39', '2'), + ('87', '269', '2006-02-16T02:30:53', '2005-08-18T04:11:03', '2005-08-25T01:20:03', '2'), + ('578', '3926', '2006-02-16T02:30:53', '2005-08-02T11:47:40', '2005-08-10T06:52:40', '2'), + ('385', '240', '2006-02-16T02:30:53', '2005-08-01T12:59:24', '2005-08-04T17:08:24', '2'), + ('140', '769', '2006-02-16T02:30:53', '2005-06-16T04:51:18', '2005-06-21T06:54:18', '2'), + ('555', '1515', '2006-02-16T02:30:53', '2005-07-30T16:32:51', '2005-08-08T15:28:51', '2'), + ('198', '3124', '2006-02-16T02:30:53', '2005-07-30T19:27:59', '2005-08-04T18:25:59', '2'), + ('493', '350', '2006-02-16T02:30:53', '2005-08-20T08:32:51', '2005-08-27T03:52:51', '2'), + ('16', '3485', '2006-02-16T02:30:53', '2005-07-11T06:40:31', '2005-07-14T10:59:31', '2'), + ('22', '1239', '2006-02-16T02:30:53', '2005-07-07T12:00:52', '2005-07-11T15:14:52', '2'), + ('322', '800', '2006-02-16T02:30:53', '2005-06-18T21:08:30', '2005-06-23T02:35:30', '2'), + ('60', '2559', '2006-02-16T02:30:53', '2005-05-26T23:37:39', '2005-06-03T04:31:39', '2'), + ('511', '623', '2006-02-16T02:30:53', '2005-05-29T21:00:32', '2005-06-02T15:15:32', '2'), + ('166', '2683', '2006-02-16T02:30:53', '2005-08-23T14:31:50', '2005-08-27T16:08:50', '2'), + ('283', '1422', '2006-02-16T02:30:53', '2005-07-28T08:14:12', '2005-07-30T08:00:12', '2'), + ('8', '1907', '2006-02-16T02:30:53', '2005-06-17T18:21:35', '2005-06-23T23:49:35', '2'), + ('457', '2533', '2006-02-16T02:30:53', '2005-08-17T17:22:05', '2005-08-25T22:19:05', '2'), + ('7', '1950', '2006-02-16T02:30:53', '2005-06-20T10:11:53', '2005-06-25T04:51:53', '2'), + ('64', '2032', '2006-02-16T02:30:53', '2005-07-27T04:27:32', '2005-07-30T06:06:32', '2'), + ('234', '781', '2006-02-16T02:30:53', '2005-08-19T04:47:48', '2005-08-25T00:07:48', '2'), + ('356', '3870', '2006-02-16T02:30:53', '2005-08-19T11:13:58', '2005-08-20T15:03:58', '2'), + ('185', '2218', '2006-02-16T02:30:53', '2005-07-08T03:10:48', '2005-07-09T07:49:48', '2'), + ('557', '4434', '2006-02-16T02:30:53', '2005-08-18T14:49:22', '2005-08-26T14:11:22', '2'), + ('392', '2421', '2006-02-16T02:30:53', '2005-06-16T00:38:07', '2005-06-24T02:45:07', '2'), + ('164', '3506', '2006-02-16T02:30:53', '2005-07-29T22:22:58', '2005-07-31T21:02:58', '2'), + ('235', '4581', '2006-02-16T02:30:53', '2005-06-15T21:50:32', '2005-06-17T01:02:32', '2'), + ('509', '1975', '2006-02-16T02:30:53', '2005-07-29T00:33:32', '2005-08-05T21:25:32', '2'), + ('172', '2376', '2006-02-16T02:30:53', '2005-07-11T14:57:51', '2005-07-19T19:10:51', '2'), + ('291', '2221', '2006-02-16T02:30:53', '2005-06-15T01:10:35', '2005-06-17T20:36:35', '2'), + ('51', '2247', '2006-02-16T02:30:53', '2005-05-28T21:01:25', '2005-06-02T01:22:25', '2'), + ('480', '1536', '2006-02-16T02:30:53', '2005-07-30T03:56:55', '2005-08-06T05:25:55', '2'), + ('379', '3863', '2006-02-16T02:30:53', '2005-08-19T22:06:35', '2005-08-29T01:11:35', '2'), + ('235', '946', '2006-02-16T02:30:53', '2005-07-30T05:28:53', '2005-08-03T02:16:53', '2'), + ('323', '2567', '2006-02-16T02:30:53', '2005-08-23T11:30:32', '2005-08-28T09:52:32', '2'), + ('133', '3332', '2006-02-16T02:30:53', '2005-07-12T08:19:41', '2005-07-19T08:19:41', '2'), + ('275', '3528', '2006-02-16T02:30:53', '2005-07-11T17:54:09', '2005-07-18T20:42:09', '2'), + ('213', '4267', '2006-02-16T02:30:53', '2005-06-21T08:11:18', '2005-06-23T04:28:18', '2'), + ('416', '1320', '2006-02-16T02:30:53', '2005-08-02T03:00:18', '2005-08-11T03:44:18', '2'), + ('253', '3476', '2006-02-16T02:30:53', '2005-05-28T19:25:54', '2005-06-03T15:57:54', '2'), + ('391', '3392', '2006-02-16T02:30:53', '2005-08-17T22:21:43', '2005-08-20T23:53:43', '2'), + ('197', '1230', '2006-02-16T02:30:53', '2005-06-19T18:24:42', '2005-06-27T17:02:42', '2'), + ('535', '174', '2006-02-16T02:30:53', '2005-08-18T03:16:54', '2005-08-22T04:48:54', '2'), + ('122', '3360', '2006-02-16T02:30:53', '2005-06-15T03:01:20', '2005-06-18T07:52:20', '2'), + ('589', '3743', '2006-02-16T02:30:53', '2005-07-30T10:58:16', '2005-08-03T06:16:16', '2'), + ('13', '3792', '2006-02-16T02:30:53', '2005-07-30T21:29:41', '2005-08-01T16:30:41', '2'), + ('260', '1821', '2006-02-16T02:30:53', '2005-07-29T17:40:45', '2005-08-01T22:38:45', '2'), + ('142', '2854', '2006-02-16T02:30:53', '2005-08-19T06:29:13', '2005-08-22T12:23:13', '2'), + ('52', '4158', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('290', '1086', '2006-02-16T02:30:53', '2005-08-18T02:03:59', '2005-08-25T05:32:59', '2'), + ('248', '2561', '2006-02-16T02:30:53', '2005-06-17T16:07:08', '2005-06-24T15:20:08', '2'), + ('31', '638', '2006-02-16T02:30:53', '2005-06-18T11:35:30', '2005-06-27T11:56:30', '2'), + ('562', '3574', '2006-02-16T02:30:53', '2005-07-27T22:20:17', '2005-08-02T23:00:17', '2'), + ('79', '3956', '2006-02-16T02:30:53', '2005-08-21T03:14:27', '2005-08-26T00:46:27', '2'), + ('228', '2682', '2006-02-16T02:30:53', '2005-06-18T06:59:51', '2005-06-24T04:58:51', '2'), + ('529', '764', '2006-02-16T02:30:53', '2005-07-07T23:07:44', '2005-07-14T02:51:44', '2'), + ('592', '445', '2006-02-16T02:30:53', '2005-08-01T15:37:48', '2005-08-02T12:11:48', '2'), + ('30', '1260', '2006-02-16T02:30:53', '2005-07-31T02:04:58', '2005-08-06T04:07:58', '2'), + ('265', '1470', '2006-02-16T02:30:53', '2005-07-30T20:52:45', '2005-08-02T17:38:45', '2'), + ('197', '3775', '2006-02-16T02:30:53', '2005-06-19T16:37:24', '2005-06-20T13:55:24', '2'), + ('212', '2680', '2006-02-16T02:30:53', '2005-07-08T21:32:17', '2005-07-14T20:55:17', '2'), + ('119', '1753', '2006-02-16T02:30:53', '2005-08-20T05:26:15', '2005-08-21T11:07:15', '2'), + ('53', '4122', '2006-02-16T02:30:53', '2005-08-19T09:25:40', '2005-08-27T10:19:40', '2'), + ('8', '1936', '2006-02-16T02:30:53', '2005-07-11T21:39:46', '2005-07-18T02:12:46', '2'), + ('294', '299', '2006-02-16T02:30:53', '2005-06-21T09:22:37', '2005-06-23T07:16:37', '2'), + ('588', '487', '2006-02-16T02:30:53', '2005-06-20T04:12:46', '2005-06-26T23:34:46', '2'), + ('533', '3397', '2006-02-16T02:30:53', '2005-05-28T15:35:52', '2005-06-03T17:35:52', '2'), + ('241', '1637', '2006-02-16T02:30:53', '2005-08-21T13:52:07', '2005-08-30T13:06:07', '2'), + ('432', '3904', '2006-02-16T02:30:53', '2005-07-10T22:51:44', '2005-07-18T17:54:44', '2'), + ('396', '3423', '2006-02-16T02:30:53', '2005-07-06T19:54:41', '2005-07-15T18:11:41', '2'), + ('228', '4361', '2006-02-16T02:30:53', '2005-07-06T01:37:07', '2005-07-11T06:02:07', '2'), + ('469', '1611', '2006-02-16T02:30:53', '2005-07-28T06:22:52', '2005-08-05T11:55:52', '2'), + ('484', '1286', '2006-02-16T02:30:53', '2005-05-25T04:24:36', '2005-05-27T07:02:36', '2'), + ('442', '1688', '2006-02-16T02:30:53', '2005-07-08T05:59:00', '2005-07-16T06:23:00', '2'), + ('109', '194', '2006-02-16T02:30:53', '2005-07-31T13:25:46', '2005-08-01T13:12:46', '2'), + ('11', '1376', '2006-02-16T02:30:53', '2005-07-27T13:13:32', '2005-08-03T09:24:32', '2'), + ('6', '1261', '2006-02-16T02:30:53', '2005-07-06T23:14:21', '2005-07-12T17:55:21', '2'), + ('198', '1523', '2006-02-16T02:30:53', '2005-08-21T09:53:52', '2005-08-25T05:03:52', '2'), + ('211', '232', '2006-02-16T02:30:53', '2005-08-17T17:35:47', '2005-08-23T16:19:47', '2'), + ('596', '295', '2006-02-16T02:30:53', '2005-07-11T02:04:12', '2005-07-13T02:43:12', '2'), + ('355', '196', '2006-02-16T02:30:53', '2005-07-10T03:23:05', '2005-07-16T07:46:05', '2'), + ('40', '4570', '2006-02-16T02:30:53', '2005-08-01T08:58:08', '2005-08-05T09:07:08', '2'), + ('288', '4526', '2006-02-16T02:30:53', '2005-08-22T12:41:33', '2005-08-23T14:44:33', '2'), + ('118', '4335', '2006-02-16T02:30:53', '2005-07-28T13:32:17', '2005-08-06T14:51:17', '2'), + ('583', '3073', '2006-02-16T02:30:53', '2005-08-02T05:02:56', '2005-08-05T07:04:56', '2'), + ('223', '3076', '2006-02-16T02:30:53', '2005-06-18T10:56:24', '2005-06-22T10:38:24', '2'), + ('526', '3218', '2006-02-16T02:30:53', '2005-08-22T15:14:20', '2005-08-25T20:12:20', '2'), + ('7', '4042', '2006-02-16T02:30:53', '2005-06-18T05:03:36', '2005-06-22T02:25:36', '2'), + ('175', '792', '2006-02-16T02:30:53', '2005-08-20T14:00:29', '2005-08-29T12:01:29', '2'), + ('470', '1203', '2006-02-16T02:30:53', '2005-07-26T23:27:40', '2005-07-31T03:17:40', '2'), + ('400', '4483', '2006-02-16T02:30:53', '2005-05-26T03:14:15', '2005-06-03T00:24:15', '2'), + ('151', '4419', '2006-02-16T02:30:53', '2005-07-27T08:35:02', '2005-07-30T14:00:02', '2'), + ('170', '3323', '2006-02-16T02:30:53', '2005-07-06T07:40:31', '2005-07-08T03:39:31', '2'), + ('579', '186', '2006-02-16T02:30:53', '2005-08-20T22:00:43', '2005-08-24T03:17:43', '2'), + ('579', '3917', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('139', '3108', '2006-02-16T02:30:53', '2005-07-31T14:57:13', '2005-08-03T18:58:13', '2'), + ('503', '3960', '2006-02-16T02:30:53', '2005-07-31T08:35:18', '2005-08-03T03:46:18', '2'), + ('114', '4283', '2006-02-16T02:30:53', '2005-08-18T19:51:29', '2005-08-27T14:58:29', '2'), + ('49', '2384', '2006-02-16T02:30:53', '2005-08-01T14:10:21', '2005-08-03T13:47:21', '2'), + ('28', '738', '2006-02-16T02:30:53', '2005-07-31T21:14:02', '2005-08-03T01:48:02', '2'), + ('336', '3885', '2006-02-16T02:30:53', '2005-06-21T11:17:35', '2005-06-22T12:51:35', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['7644', '12935', '13768', '2744', '10224', '2625', '801', '5299', '10244', '5115', '12426', '13338', '8745', '317', '16019', '479', '11934', '5753', '2382', '15352', '5526', '8146', '14598', '6467', '15420', '8627', '8280', '11944', '9720', '1787', '489', '8604', '7297', '4236', '8244', '1765', '285', '11901', '4453', '9876', '6756', '4945', '3853', '6695', '490', '883', '4147', '10292', '4935', '11748', '7200', '2035', '3835', '14737', '4101', '6961', '8256', '14236', '15129', '10086', '712', '5824', '13371', '3639', '12862', '2827', '8139', '631', '10815', '9233', '7261', '15424', '3063', '893', '8830', '12063', '498', '7213', '14081', '3750', '12955', '7990', '1782', '14573', '4270', '1443', '5648', '22', '4311', '9576', '6661', '12422', '8230', '1495', '15008', '5066', '368', '3484', '9805', '2504']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('173', '882', '2006-02-16T02:30:53', '2005-07-28T01:27:33', '2005-07-31T22:58:33', '2'), + ('279', '193', '2006-02-16T02:30:53', '2005-08-19T05:20:25', '2005-08-21T03:10:25', '2'), + ('198', '3847', '2006-02-16T02:30:53', '2005-08-20T11:43:43', '2005-08-27T07:56:43', '2'), + ('368', '4511', '2006-02-16T02:30:53', '2005-06-19T16:20:40', '2005-06-22T11:44:40', '2'), + ('587', '1443', '2006-02-16T02:30:53', '2005-08-01T01:31:56', '2005-08-05T21:21:56', '2'), + ('25', '3946', '2006-02-16T02:30:53', '2005-06-19T08:23:11', '2005-06-26T09:52:11', '2'), + ('402', '1642', '2006-02-16T02:30:53', '2005-05-29T17:35:50', '2005-06-04T17:05:50', '2'), + ('469', '4416', '2006-02-16T02:30:53', '2005-07-09T15:38:09', '2005-07-15T16:39:09', '2'), + ('51', '567', '2006-02-16T02:30:53', '2005-08-01T02:20:01', '2005-08-06T23:06:01', '2'), + ('212', '2296', '2006-02-16T02:30:53', '2005-07-09T07:07:18', '2005-07-16T03:28:18', '2'), + ('75', '799', '2006-02-16T02:30:53', '2005-08-18T10:24:11', '2005-08-22T15:34:11', '2'), + ('86', '3739', '2006-02-16T02:30:53', '2005-08-19T20:09:59', '2005-08-23T22:59:59', '2'), + ('293', '1766', '2006-02-16T02:30:53', '2005-07-29T19:03:05', '2005-08-06T14:06:05', '2'), + ('391', '26', '2006-02-16T02:30:53', '2005-05-26T23:23:56', '2005-06-01T19:56:56', '2'), + ('278', '3093', '2006-02-16T02:30:53', '2005-08-23T21:30:45', '2005-08-27T23:45:45', '2'), + ('231', '2060', '2006-02-16T02:30:53', '2005-05-27T22:39:10', '2005-06-05T22:46:10', '2'), + ('596', '1230', '2006-02-16T02:30:53', '2005-08-17T16:40:00', '2005-08-20T20:13:00', '2'), + ('444', '3639', '2006-02-16T02:30:53', '2005-07-10T12:29:43', '2005-07-17T12:50:43', '2'), + ('568', '915', '2006-02-16T02:30:53', '2005-06-18T15:03:52', '2005-06-20T10:16:52', '2'), + ('560', '16', '2006-02-16T02:30:53', '2005-08-22T21:16:54', '2005-08-31T00:38:54', '2'), + ('144', '3909', '2006-02-16T02:30:53', '2005-07-10T02:04:03', '2005-07-16T22:15:03', '2'), + ('476', '2430', '2006-02-16T02:30:53', '2005-07-28T20:37:36', '2005-07-31T16:03:36', '2'), + ('359', '1113', '2006-02-16T02:30:53', '2005-08-21T17:40:05', '2005-08-29T18:16:05', '2'), + ('457', '2067', '2006-02-16T02:30:53', '2005-07-12T01:22:03', '2005-07-20T04:37:03', '2'), + ('161', '1396', '2006-02-16T02:30:53', '2005-08-22T23:55:51', '2005-08-31T20:09:51', '2'), + ('226', '4235', '2006-02-16T02:30:53', '2005-07-29T14:05:12', '2005-08-05T16:53:12', '2'), + ('195', '1208', '2006-02-16T02:30:53', '2005-07-29T01:45:51', '2005-08-05T22:51:51', '2'), + ('389', '27', '2006-02-16T02:30:53', '2005-08-17T17:02:42', '2005-08-21T16:40:42', '2'), + ('587', '1282', '2006-02-16T02:30:53', '2005-07-31T08:25:21', '2005-08-07T11:30:21', '2'), + ('546', '3823', '2006-02-16T02:30:53', '2005-06-16T19:30:59', '2005-06-21T18:25:59', '2'), + ('476', '1940', '2006-02-16T02:30:53', '2005-05-28T00:09:12', '2005-05-31T04:44:12', '2'), + ('326', '3909', '2006-02-16T02:30:53', '2005-07-29T13:07:13', '2005-07-31T18:00:13', '2'), + ('135', '1855', '2006-02-16T02:30:53', '2005-07-27T12:39:48', '2005-07-29T17:50:48', '2'), + ('213', '642', '2006-02-16T02:30:53', '2005-07-07T13:12:07', '2005-07-08T15:00:07', '2'), + ('175', '1552', '2006-02-16T02:30:53', '2005-07-29T00:35:34', '2005-08-05T04:18:34', '2'), + ('273', '822', '2006-02-16T02:30:53', '2005-06-16T17:56:10', '2005-06-19T23:40:10', '2'), + ('162', '2486', '2006-02-16T02:30:53', '2005-05-26T19:41:40', '2005-05-31T16:58:40', '2'), + ('70', '4274', '2006-02-16T02:30:53', '2005-08-17T15:35:47', '2005-08-20T10:33:47', '2'), + ('560', '89', '2006-02-16T02:30:53', '2005-07-07T23:32:39', '2005-07-12T01:38:39', '2'), + ('347', '828', '2006-02-16T02:30:53', '2005-07-31T13:37:51', '2005-08-07T18:05:51', '2'), + ('531', '1174', '2006-02-16T02:30:53', '2005-07-12T15:08:28', '2005-07-13T14:25:28', '2'), + ('165', '2079', '2006-02-16T02:30:53', '2005-07-08T22:45:02', '2005-07-11T23:59:02', '2'), + ('537', '1411', '2006-02-16T02:30:53', '2005-07-06T16:59:20', '2005-07-07T12:30:20', '2'), + ('550', '3088', '2006-02-16T02:30:53', '2005-07-12T12:39:39', '2005-07-17T13:36:39', '2'), + ('95', '3524', '2006-02-16T02:30:53', '2005-05-28T00:09:56', '2005-05-30T22:32:56', '2'), + ('399', '2271', '2006-02-16T02:30:53', '2005-05-30T06:21:05', '2005-06-07T04:50:05', '2'), + ('274', '2776', '2006-02-16T02:30:53', '2005-07-07T08:32:12', '2005-07-12T10:10:12', '2'), + ('340', '2562', '2006-02-16T02:30:53', '2005-08-01T03:42:40', '2005-08-01T23:36:40', '2'), + ('230', '2708', '2006-02-16T02:30:53', '2005-07-08T22:20:56', '2005-07-12T01:01:56', '2'), + ('595', '1175', '2006-02-16T02:30:53', '2005-08-17T09:04:02', '2005-08-21T12:22:02', '2'), + ('78', '4406', '2006-02-16T02:30:53', '2005-07-27T08:57:38', '2005-08-02T12:29:38', '2'), + ('158', '4371', '2006-02-16T02:30:53', '2005-06-17T13:45:09', '2005-06-26T15:30:09', '2'), + ('486', '935', '2006-02-16T02:30:53', '2005-07-06T16:22:45', '2005-07-11T17:04:45', '2'), + ('124', '1842', '2006-02-16T02:30:53', '2005-08-21T22:27:11', '2005-08-25T18:51:11', '2'), + ('588', '2891', '2006-02-16T02:30:53', '2005-07-07T06:25:11', '2005-07-12T07:44:11', '2'), + ('38', '2205', '2006-02-16T02:30:53', '2005-07-27T00:10:49', '2005-07-30T00:26:49', '2'), + ('537', '1483', '2006-02-16T02:30:53', '2005-07-29T01:02:42', '2005-07-31T22:29:42', '2'), + ('25', '172', '2006-02-16T02:30:53', '2005-08-21T05:13:16', '2005-08-26T04:03:16', '2'), + ('234', '3782', '2006-02-16T02:30:53', '2005-08-22T13:03:52', '2005-08-29T10:56:52', '2'), + ('205', '2853', '2006-02-16T02:30:53', '2005-07-31T20:14:08', '2005-08-07T01:33:08', '2'), + ('313', '4191', '2006-02-16T02:30:53', '2005-05-29T04:02:24', '2005-05-30T03:09:24', '2'), + ('449', '1980', '2006-02-16T02:30:53', '2005-07-10T16:19:53', '2005-07-12T11:17:53', '2'), + ('34', '3401', '2006-02-16T02:30:53', '2005-08-19T21:21:47', '2005-08-26T16:17:47', '2'), + ('7', '2812', '2006-02-16T02:30:53', '2005-07-06T07:09:17', '2005-07-15T05:12:17', '2'), + ('198', '473', '2006-02-16T02:30:53', '2005-08-19T02:31:59', '2005-08-26T08:16:59', '2'), + ('23', '2745', '2006-02-16T02:30:53', '2005-06-19T20:50:01', '2005-06-20T18:54:01', '2'), + ('177', '3651', '2006-02-16T02:30:53', '2005-07-28T20:16:30', '2005-08-03T18:00:30', '2'), + ('503', '2465', '2006-02-16T02:30:53', '2005-05-28T17:36:32', '2005-06-03T14:56:32', '2'), + ('62', '877', '2006-02-16T02:30:53', '2005-08-01T22:46:21', '2005-08-03T02:43:21', '2'), + ('357', '2320', '2006-02-16T02:30:53', '2005-07-30T13:44:15', '2005-08-07T13:02:15', '2'), + ('172', '942', '2006-02-16T02:30:53', '2005-07-27T11:15:01', '2005-07-28T09:42:01', '2'), + ('138', '3452', '2006-02-16T02:30:53', '2005-08-23T00:03:01', '2005-08-27T23:27:01', '2'), + ('515', '3954', '2006-02-16T02:30:53', '2005-06-20T13:52:03', '2005-06-28T13:36:03', '2'), + ('502', '3260', '2006-02-16T02:30:53', '2005-05-30T08:06:59', '2005-06-07T08:23:59', '2'), + ('202', '1751', '2006-02-16T02:30:53', '2005-07-29T22:34:35', '2005-08-05T20:12:35', '2'), + ('550', '1141', '2006-02-16T02:30:53', '2005-08-17T21:24:48', '2005-08-23T22:10:48', '2'), + ('287', '458', '2006-02-16T02:30:53', '2005-05-28T01:01:21', '2005-05-30T21:20:21', '2'), + ('502', '2836', '2006-02-16T02:30:53', '2005-07-27T09:22:29', '2005-08-03T13:53:29', '2'), + ('392', '589', '2006-02-16T02:30:53', '2005-08-20T23:35:13', '2005-08-28T01:41:13', '2'), + ('103', '2422', '2006-02-16T02:30:53', '2005-07-06T12:19:28', '2005-07-14T13:16:28', '2'), + ('410', '2040', '2006-02-16T02:30:53', '2005-08-19T06:05:58', '2005-08-26T04:24:58', '2'), + ('232', '188', '2006-02-16T02:30:53', '2005-07-28T14:43:08', '2005-08-01T10:51:08', '2'), + ('498', '1820', '2006-02-16T02:30:53', '2005-06-16T19:21:12', '2005-06-22T16:03:12', '2'), + ('240', '2423', '2006-02-16T02:30:53', '2005-08-21T16:44:32', '2005-08-23T14:01:32', '2'), + ('210', '183', '2006-02-16T02:30:53', '2005-07-07T14:38:41', '2005-07-10T19:07:41', '2'), + ('435', '2485', '2006-02-16T02:30:53', '2005-06-15T18:57:51', '2005-06-18T14:18:51', '2'), + ('24', '4359', '2006-02-16T02:30:53', '2005-07-10T07:09:21', '2005-07-16T07:23:21', '2'), + ('509', '727', '2006-02-16T02:30:53', '2005-05-25T02:19:23', '2005-05-26T04:52:23', '2'), + ('498', '2985', '2006-02-16T02:30:53', '2005-07-07T17:31:14', '2005-07-11T19:21:14', '2'), + ('145', '3327', '2006-02-16T02:30:53', '2005-07-31T02:52:59', '2005-08-05T23:35:59', '2'), + ('315', '2367', '2006-02-16T02:30:53', '2005-07-12T11:20:39', '2005-07-16T08:17:39', '2'), + ('451', '1855', '2006-02-16T02:30:53', '2005-08-18T10:13:12', '2005-08-20T14:36:12', '2'), + ('2', '1937', '2006-02-16T02:30:53', '2005-07-29T00:12:59', '2005-08-06T19:52:59', '2'), + ('175', '1842', '2006-02-16T02:30:53', '2005-06-15T21:54:31', '2005-06-19T00:08:31', '2'), + ('277', '961', '2006-02-16T02:30:53', '2005-08-22T08:24:32', '2005-08-31T13:48:32', '2'), + ('169', '1702', '2006-02-16T02:30:53', '2005-07-09T04:48:50', '2005-07-12T22:54:50', '2'), + ('361', '1247', '2006-02-16T02:30:53', '2005-05-27T07:42:29', '2005-06-04T11:20:29', '2'), + ('114', '1934', '2006-02-16T02:30:53', '2005-07-05T23:23:11', '2005-07-11T00:27:11', '2'), + ('36', '4179', '2006-02-16T02:30:53', '2005-07-31T11:11:10', '2005-08-03T07:36:10', '2'), + ('452', '1684', '2006-02-16T02:30:53', '2005-06-18T23:19:53', '2005-06-21T04:43:53', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['12092', '9176', '4273', '739', '13576', '3002', '10533', '11264', '6469', '1528', '5974', '10028', '533', '13689', '5847', '1856', '8243', '3621', '9211', '3598', '8850', '7083', '5151', '1874', '1001', '1635', '1761', '6119', '6146', '10824', '15645', '34', '11183', '14670', '14108', '12912', '1185', '9312', '1946', '13512', '10623', '10776', '12633', '8142', '1224', '10482', '10942', '15392', '6966', '7341', '3416', '2801', '14862', '8563', '3939', '14166', '8607', '13530', '5837', '2974', '10209', '3233', '8092', '7606', '3784', '10885', '3456', '4619', '7842', '5410', '10649', '14217', '2276', '13038', '12875', '13490', '6537', '13293', '5258', '13966', '7045', '10457', '5102', '5988', '5008', '10670', '1696', '14230', '9417', '863', '10729', '15413', '5578', '10756', '11107', '13114', '3333', '2329', '11077', '25']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('38', '3964', '2006-02-16T02:30:53', '2005-08-17T22:28:15', '2005-08-18T16:46:15', '2'), + ('260', '2659', '2006-02-16T02:30:53', '2005-07-30T11:50:54', '2005-08-02T14:25:54', '2'), + ('159', '4163', '2006-02-16T02:30:53', '2005-07-07T14:40:22', '2005-07-13T09:58:22', '2'), + ('84', '1183', '2006-02-16T02:30:53', '2005-05-29T08:28:18', '2005-06-06T09:21:18', '2'), + ('223', '2669', '2006-02-16T02:30:53', '2005-08-20T05:19:56', '2005-08-22T09:08:56', '2'), + ('266', '2749', '2006-02-16T02:30:53', '2005-06-20T09:56:12', '2005-06-24T12:15:12', '2'), + ('593', '1924', '2006-02-16T02:30:53', '2005-08-01T12:14:16', '2005-08-09T17:13:16', '2'), + ('360', '3420', '2006-02-16T02:30:53', '2005-08-02T14:05:18', '2005-08-10T08:46:18', '2'), + ('147', '3830', '2006-02-16T02:30:53', '2005-07-12T01:29:27', '2005-07-16T20:22:27', '2'), + ('110', '4297', '2006-02-16T02:30:53', '2005-06-16T00:32:52', '2005-06-25T01:07:52', '2'), + ('517', '3984', '2006-02-16T02:30:53', '2005-07-11T00:10:37', '2005-07-18T18:48:37', '2'), + ('323', '2305', '2006-02-16T02:30:53', '2005-07-31T18:35:54', '2005-08-01T13:01:54', '2'), + ('528', '4306', '2006-02-16T02:30:53', '2005-05-28T06:14:46', '2005-06-01T06:26:46', '2'), + ('336', '819', '2006-02-16T02:30:53', '2005-08-20T09:04:30', '2005-08-22T05:38:30', '2'), + ('220', '4403', '2006-02-16T02:30:53', '2005-07-10T17:27:42', '2005-07-12T14:51:42', '2'), + ('161', '3034', '2006-02-16T02:30:53', '2005-06-17T01:02:00', '2005-06-19T21:29:00', '2'), + ('481', '1873', '2006-02-16T02:30:53', '2005-07-29T00:35:33', '2005-08-04T06:02:33', '2'), + ('171', '3132', '2006-02-16T02:30:53', '2005-07-06T06:03:55', '2005-07-11T09:25:55', '2'), + ('57', '595', '2006-02-16T02:30:53', '2005-07-30T12:59:45', '2005-08-07T18:17:45', '2'), + ('68', '1317', '2006-02-16T02:30:53', '2005-07-06T05:11:04', '2005-07-09T02:03:04', '2'), + ('86', '355', '2006-02-16T02:30:53', '2005-07-29T23:24:20', '2005-07-31T00:43:20', '2'), + ('575', '2663', '2006-02-16T02:30:53', '2005-07-27T04:28:39', '2005-07-30T04:35:39', '2'), + ('228', '224', '2006-02-16T02:30:53', '2005-07-09T08:31:03', '2005-07-10T08:18:03', '2'), + ('30', '3884', '2006-02-16T02:30:53', '2005-06-17T02:39:20', '2005-06-24T04:41:20', '2'), + ('64', '1498', '2006-02-16T02:30:53', '2005-05-31T00:46:31', '2005-06-06T06:14:31', '2'), + ('566', '1187', '2006-02-16T02:30:53', '2005-06-16T08:26:56', '2005-06-25T06:17:56', '2'), + ('521', '1570', '2006-02-16T02:30:53', '2005-06-16T17:49:57', '2005-06-17T21:03:57', '2'), + ('472', '4281', '2006-02-16T02:30:53', '2005-07-11T07:44:46', '2005-07-20T04:41:46', '2'), + ('11', '3374', '2006-02-16T02:30:53', '2005-07-11T09:09:59', '2005-07-20T11:42:59', '2'), + ('482', '3948', '2006-02-16T02:30:53', '2005-08-01T23:00:22', '2005-08-04T04:14:22', '2'), + ('214', '3838', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('597', '2613', '2006-02-16T02:30:53', '2005-05-25T04:19:28', '2005-05-29T00:10:28', '2'), + ('102', '833', '2006-02-16T02:30:53', '2005-08-02T11:00:32', '2005-08-04T08:59:32', '2'), + ('537', '4324', '2006-02-16T02:30:53', '2005-08-21T19:54:11', '2005-08-27T21:42:11', '2'), + ('243', '4339', '2006-02-16T02:30:53', '2005-08-21T00:52:45', '2005-08-21T19:35:45', '2'), + ('364', '1747', '2006-02-16T02:30:53', '2005-08-19T04:24:35', '2005-08-27T07:13:35', '2'), + ('1', '2785', '2006-02-16T02:30:53', '2005-06-15T00:54:12', '2005-06-23T02:42:12', '2'), + ('76', '2483', '2006-02-16T02:30:53', '2005-07-30T16:59:17', '2005-08-03T17:24:17', '2'), + ('389', '2335', '2006-02-16T02:30:53', '2005-06-17T07:58:39', '2005-06-25T06:49:39', '2'), + ('62', '4508', '2006-02-16T02:30:53', '2005-08-20T02:27:13', '2005-08-28T04:40:13', '2'), + ('494', '4426', '2006-02-16T02:30:53', '2005-08-01T15:22:38', '2005-08-03T11:03:38', '2'), + ('565', '1598', '2006-02-16T02:30:53', '2005-08-01T20:59:58', '2005-08-10T20:33:58', '2'), + ('469', '4341', '2006-02-16T02:30:53', '2005-08-18T17:55:38', '2005-08-23T17:19:38', '2'), + ('322', '1075', '2006-02-16T02:30:53', '2005-07-28T20:21:54', '2005-07-31T18:39:54', '2'), + ('369', '1572', '2006-02-16T02:30:53', '2005-06-15T03:44:25', '2005-06-17T03:49:25', '2'), + ('358', '48', '2006-02-16T02:30:53', '2005-08-01T10:17:47', '2005-08-02T15:04:47', '2'), + ('78', '2304', '2006-02-16T02:30:53', '2005-08-02T03:16:31', '2005-08-11T02:46:31', '2'), + ('410', '538', '2006-02-16T02:30:53', '2005-08-22T23:02:15', '2005-09-01T01:14:15', '2'), + ('45', '1577', '2006-02-16T02:30:53', '2005-07-27T00:15:35', '2005-08-05T03:04:35', '2'), + ('498', '3567', '2006-02-16T02:30:53', '2005-07-27T14:23:55', '2005-07-28T14:11:55', '2'), + ('76', '1215', '2006-02-16T02:30:53', '2005-06-21T17:05:29', '2005-06-23T17:58:29', '2'), + ('29', '4572', '2006-02-16T02:30:53', '2005-06-19T19:18:09', '2005-06-20T20:11:09', '2'), + ('78', '3479', '2006-02-16T02:30:53', '2005-08-22T02:51:41', '2005-08-28T06:30:41', '2'), + ('67', '61', '2006-02-16T02:30:53', '2005-07-29T11:32:58', '2005-08-05T07:21:58', '2'), + ('149', '3627', '2006-02-16T02:30:53', '2005-07-06T21:16:32', '2005-07-11T03:12:32', '2'), + ('190', '2457', '2006-02-16T02:30:53', '2005-08-21T02:59:31', '2005-08-24T23:19:31', '2'), + ('336', '4290', '2006-02-16T02:30:53', '2005-07-29T13:18:00', '2005-07-30T18:51:00', '2'), + ('156', '597', '2006-02-16T02:30:53', '2005-08-20T03:12:43', '2005-08-23T09:01:43', '2'), + ('478', '1648', '2006-02-16T02:30:53', '2005-07-10T16:57:50', '2005-07-18T14:07:50', '2'), + ('472', '2322', '2006-02-16T02:30:53', '2005-06-20T08:00:24', '2005-06-25T05:10:24', '2'), + ('303', '2429', '2006-02-16T02:30:53', '2005-08-01T00:56:47', '2005-08-03T19:58:47', '2'), + ('353', '3542', '2006-02-16T02:30:53', '2005-06-21T02:39:31', '2005-06-28T05:23:31', '2'), + ('167', '2034', '2006-02-16T02:30:53', '2005-07-28T18:28:07', '2005-07-30T19:17:07', '2'), + ('201', '637', '2006-02-16T02:30:53', '2005-07-28T00:02:15', '2005-07-29T03:14:15', '2'), + ('165', '2287', '2006-02-16T02:30:53', '2005-07-06T13:57:56', '2005-07-14T17:24:56', '2'), + ('493', '4223', '2006-02-16T02:30:53', '2005-08-02T00:51:37', '2005-08-09T20:49:37', '2'), + ('150', '1119', '2006-02-16T02:30:53', '2005-06-21T21:19:47', '2005-06-28T18:18:47', '2'), + ('579', '2127', '2006-02-16T02:30:53', '2005-07-08T08:01:09', '2005-07-16T05:52:09', '2'), + ('276', '2447', '2006-02-16T02:30:53', '2005-07-28T09:10:06', '2005-08-04T06:52:06', '2'), + ('281', '2261', '2006-02-16T02:30:53', '2005-07-09T20:21:10', '2005-07-18T21:43:10', '2'), + ('278', '1032', '2006-02-16T02:30:53', '2005-08-01T16:11:40', '2005-08-06T14:09:40', '2'), + ('66', '2847', '2006-02-16T02:30:53', '2005-08-21T04:37:56', '2005-08-26T03:55:56', '2'), + ('594', '1145', '2006-02-16T02:30:53', '2005-06-18T06:33:48', '2005-06-25T00:50:48', '2'), + ('532', '2226', '2006-02-16T02:30:53', '2005-08-19T08:55:16', '2005-08-25T12:23:16', '2'), + ('483', '1708', '2006-02-16T02:30:53', '2005-08-19T03:10:21', '2005-08-26T01:00:21', '2'), + ('18', '238', '2006-02-16T02:30:53', '2005-08-20T01:29:29', '2005-08-21T22:36:29', '2'), + ('207', '3381', '2006-02-16T02:30:53', '2005-07-12T04:46:30', '2005-07-19T03:04:30', '2'), + ('399', '380', '2006-02-16T02:30:53', '2005-08-19T18:35:52', '2005-08-23T17:18:52', '2'), + ('207', '3125', '2006-02-16T02:30:53', '2005-07-09T13:56:56', '2005-07-11T16:01:56', '2'), + ('260', '4520', '2006-02-16T02:30:53', '2005-08-20T18:28:28', '2005-08-22T16:49:28', '2'), + ('64', '1788', '2006-02-16T02:30:53', '2005-07-27T03:27:35', '2005-08-01T06:31:35', '2'), + ('121', '3052', '2006-02-16T02:30:53', '2005-08-01T09:17:34', '2005-08-06T07:28:34', '2'), + ('316', '242', '2006-02-16T02:30:53', '2005-07-09T06:25:48', '2005-07-16T11:32:48', '2'), + ('158', '151', '2006-02-16T02:30:53', '2005-07-11T00:55:38', '2005-07-13T21:36:38', '2'), + ('509', '824', '2006-02-16T02:30:53', '2005-07-09T01:31:42', '2005-07-11T22:34:42', '2'), + ('512', '156', '2006-02-16T02:30:53', '2005-08-01T17:07:16', '2005-08-10T11:46:16', '2'), + ('502', '3928', '2006-02-16T02:30:53', '2005-06-16T12:50:01', '2005-06-24T12:08:01', '2'), + ('584', '844', '2006-02-16T02:30:53', '2005-08-21T04:57:29', '2005-08-27T08:14:29', '2'), + ('519', '2509', '2006-02-16T02:30:53', '2005-07-30T20:54:55', '2005-08-04T00:54:55', '2'), + ('379', '3999', '2006-02-16T02:30:53', '2005-05-30T03:14:59', '2005-06-05T04:34:59', '2'), + ('595', '2918', '2006-02-16T02:30:53', '2005-08-01T19:21:11', '2005-08-07T21:20:11', '2'), + ('476', '2494', '2006-02-16T02:30:53', '2005-08-22T23:38:01', '2005-08-23T19:27:01', '2'), + ('378', '4543', '2006-02-16T02:30:53', '2005-07-10T04:00:31', '2005-07-16T08:06:31', '2'), + ('596', '4247', '2006-02-16T02:30:53', '2005-08-01T20:17:03', '2005-08-08T18:31:03', '2'), + ('410', '2217', '2006-02-16T02:30:53', '2005-08-02T08:19:38', '2005-08-07T08:46:38', '2'), + ('550', '4342', '2006-02-16T02:30:53', '2005-08-19T11:27:32', '2005-08-28T11:21:32', '2'), + ('111', '3688', '2006-02-16T02:30:53', '2005-06-21T10:01:36', '2005-06-25T10:27:36', '2'), + ('587', '4156', '2006-02-16T02:30:53', '2005-06-18T10:22:52', '2005-06-20T12:03:52', '2'), + ('158', '4254', '2006-02-16T02:30:53', '2005-08-02T07:26:43', '2005-08-09T10:34:43', '2'), + ('37', '3961', '2006-02-16T02:30:53', '2005-05-25T03:21:20', '2005-05-27T21:25:20', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['15135', '2984', '15180', '7991', '5911', '7100', '9383', '3833', '1473', '4620', '9387', '7084', '14636', '2971', '15427', '9054', '5208', '609', '10751', '12611', '15069', '3592', '5670', '9203', '5915', '6455', '737', '4153', '67', '7106', '6085', '12413', '8040', '2993', '9678', '5607', '10336', '6379', '13322', '13526', '9064', '12367', '14131', '15384', '8179', '5394', '4820', '5039', '3516', '6832', '1269', '4751', '11498', '7149', '119', '12284', '1504', '8042', '5573', '53', '6798', '13084', '6487', '608', '4562', '8725', '7564', '5337', '2229', '5966', '543', '14190', '6255', '4342', '2661', '14060', '14013', '10018', '5350', '10065', '10475', '1181', '10107', '633', '6427', '5531', '4289', '6500', '9969', '7964', '435', '692', '11598', '10169', '2511', '11935', '5521', '1645', '8743', '2296']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('284', '555', '2006-02-16T02:30:53', '2005-08-22T13:19:19', '2005-08-27T17:09:19', '2'), + ('435', '1819', '2006-02-16T02:30:53', '2005-06-20T08:43:44', '2005-06-22T03:08:44', '2'), + ('532', '234', '2006-02-16T02:30:53', '2005-08-22T15:42:57', '2005-08-24T12:49:57', '2'), + ('59', '1133', '2006-02-16T02:30:53', '2005-07-28T14:45:45', '2005-07-29T15:05:45', '2'), + ('420', '4140', '2006-02-16T02:30:53', '2005-07-10T20:51:42', '2005-07-14T21:58:42', '2'), + ('413', '4224', '2006-02-16T02:30:53', '2005-07-27T05:05:01', '2005-07-28T23:12:01', '2'), + ('416', '2806', '2006-02-16T02:30:53', '2005-07-30T19:24:50', '2005-08-01T21:41:50', '2'), + ('416', '3232', '2006-02-16T02:30:53', '2005-07-06T16:18:28', '2005-07-14T20:09:28', '2'), + ('249', '2377', '2006-02-16T02:30:53', '2005-06-15T20:55:20', '2005-06-21T16:40:20', '2'), + ('210', '3467', '2006-02-16T02:30:53', '2005-07-08T08:01:44', '2005-07-16T07:43:44', '2'), + ('495', '577', '2006-02-16T02:30:53', '2005-07-30T19:27:05', '2005-08-07T21:19:05', '2'), + ('32', '785', '2006-02-16T02:30:53', '2005-07-27T04:34:07', '2005-08-05T00:21:07', '2'), + ('339', '1671', '2006-02-16T02:30:53', '2005-08-21T18:59:17', '2005-08-23T13:19:17', '2'), + ('410', '1585', '2006-02-16T02:30:53', '2005-06-20T07:56:00', '2005-06-27T11:38:00', '2'), + ('448', '2775', '2006-02-16T02:30:53', '2005-08-23T00:07:53', '2005-09-01T02:55:53', '2'), + ('209', '2860', '2006-02-16T02:30:53', '2005-07-30T07:11:44', '2005-08-08T01:55:44', '2'), + ('560', '1881', '2006-02-16T02:30:53', '2005-07-09T11:16:56', '2005-07-10T07:21:56', '2'), + ('150', '2944', '2006-02-16T02:30:53', '2005-05-28T15:04:02', '2005-06-05T14:47:02', '2'), + ('518', '3257', '2006-02-16T02:30:53', '2005-08-01T20:06:10', '2005-08-10T22:36:10', '2'), + ('359', '1925', '2006-02-16T02:30:53', '2005-08-18T17:09:42', '2005-08-24T11:57:42', '2'), + ('568', '592', '2006-02-16T02:30:53', '2005-08-22T10:55:42', '2005-08-28T06:59:42', '2'), + ('286', '1272', '2006-02-16T02:30:53', '2005-07-06T04:38:50', '2005-07-15T06:36:50', '2'), + ('121', '610', '2006-02-16T02:30:53', '2005-07-10T08:14:52', '2005-07-14T04:13:52', '2'), + ('169', '2112', '2006-02-16T02:30:53', '2005-07-30T12:43:40', '2005-08-01T09:31:40', '2'), + ('66', '2464', '2006-02-16T02:30:53', '2005-07-10T21:12:16', '2005-07-15T16:59:16', '2'), + ('277', '4267', '2006-02-16T02:30:53', '2005-07-12T01:01:58', '2005-07-16T02:42:58', '2'), + ('589', '769', '2006-02-16T02:30:53', '2005-05-29T08:11:31', '2005-06-04T11:18:31', '2'), + ('299', '2185', '2006-02-16T02:30:53', '2005-07-07T08:53:08', '2005-07-11T05:09:08', '2'), + ('119', '239', '2006-02-16T02:30:53', '2005-05-25T09:41:01', '2005-05-27T13:46:01', '2'), + ('201', '1415', '2006-02-16T02:30:53', '2005-07-27T05:21:24', '2005-08-02T01:58:24', '2'), + ('155', '312', '2006-02-16T02:30:53', '2005-07-11T05:24:36', '2005-07-16T03:49:36', '2'), + ('366', '3466', '2006-02-16T02:30:53', '2005-08-18T09:50:34', '2005-08-23T05:57:34', '2'), + ('163', '4543', '2006-02-16T02:30:53', '2005-07-28T16:39:43', '2005-08-02T20:00:43', '2'), + ('40', '1527', '2006-02-16T02:30:53', '2005-06-20T09:12:12', '2005-06-22T13:36:12', '2'), + ('383', '3430', '2006-02-16T02:30:53', '2005-07-31T06:40:47', '2005-08-02T00:57:47', '2'), + ('52', '4257', '2006-02-16T02:30:53', '2005-07-10T05:08:10', '2005-07-15T00:40:10', '2'), + ('370', '1091', '2006-02-16T02:30:53', '2005-08-01T04:59:53', '2005-08-03T08:05:53', '2'), + ('287', '522', '2006-02-16T02:30:53', '2005-07-11T21:51:25', '2005-07-17T03:38:25', '2'), + ('559', '2149', '2006-02-16T02:30:53', '2005-08-19T19:43:08', '2005-08-24T16:30:08', '2'), + ('277', '1966', '2006-02-16T02:30:53', '2005-08-20T02:58:42', '2005-08-27T22:36:42', '2'), + ('194', '1417', '2006-02-16T02:30:53', '2005-07-30T07:24:55', '2005-08-07T08:44:55', '2'), + ('7', '1822', '2006-02-16T02:30:53', '2005-08-18T07:57:14', '2005-08-27T07:07:14', '2'), + ('267', '4382', '2006-02-16T02:30:53', '2005-08-21T01:43:40', '2005-08-29T02:00:40', '2'), + ('26', '3208', '2006-02-16T02:30:53', '2005-08-22T22:34:44', '2005-08-23T23:25:44', '2'), + ('578', '2902', '2006-02-16T02:30:53', '2005-07-28T22:05:13', '2005-07-30T21:57:13', '2'), + ('83', '1828', '2006-02-16T02:30:53', '2005-07-09T19:36:15', '2005-07-18T18:10:15', '2'), + ('172', '2672', '2006-02-16T02:30:53', '2005-07-08T17:25:23', '2005-07-17T20:32:23', '2'), + ('268', '2020', '2006-02-16T02:30:53', '2005-07-09T03:14:45', '2005-07-16T06:57:45', '2'), + ('338', '385', '2006-02-16T02:30:53', '2005-07-06T00:50:30', '2005-07-09T19:12:30', '2'), + ('220', '444', '2006-02-16T02:30:53', '2005-07-12T18:51:41', '2005-07-20T13:29:41', '2'), + ('59', '108', '2006-02-16T02:30:53', '2005-06-15T07:29:59', '2005-06-16T13:26:59', '2'), + ('436', '3469', '2006-02-16T02:30:53', '2005-07-08T14:07:52', '2005-07-13T10:37:52', '2'), + ('482', '487', '2006-02-16T02:30:53', '2005-08-16T22:52:54', '2005-08-25T03:27:54', '2'), + ('242', '3902', '2006-02-16T02:30:53', '2005-07-27T07:10:40', '2005-08-03T07:37:40', '2'), + ('51', '1359', '2006-02-16T02:30:53', '2005-05-25T19:37:02', '2005-05-29T23:51:02', '2'), + ('147', '3162', '2006-02-16T02:30:53', '2005-08-18T04:55:49', '2005-08-22T08:45:49', '2'), + ('423', '3621', '2006-02-16T02:30:53', '2005-06-15T22:08:06', '2005-06-24T01:16:06', '2'), + ('14', '4325', '2006-02-16T02:30:53', '2005-07-28T16:45:11', '2005-08-04T17:16:11', '2'), + ('170', '2957', '2006-02-16T02:30:53', '2005-07-10T03:50:47', '2005-07-17T06:40:47', '2'), + ('569', '1255', '2006-02-16T02:30:53', '2005-05-25T07:19:16', '2005-05-27T05:19:16', '2'), + ('115', '275', '2006-02-16T02:30:53', '2005-07-12T16:49:11', '2005-07-19T12:11:11', '2'), + ('204', '3792', '2006-02-16T02:30:53', '2005-08-19T10:27:25', '2005-08-26T07:32:25', '2'), + ('277', '4000', '2006-02-16T02:30:53', '2005-07-12T02:17:00', '2005-07-19T00:57:00', '2'), + ('494', '4254', '2006-02-16T02:30:53', '2005-05-28T15:03:44', '2005-06-04T17:14:44', '2'), + ('454', '963', '2006-02-16T02:30:53', '2005-07-08T05:08:32', '2005-07-12T08:16:32', '2'), + ('421', '2385', '2006-02-16T02:30:53', '2005-07-29T18:08:42', '2005-08-04T16:01:42', '2'), + ('291', '2887', '2006-02-16T02:30:53', '2005-07-27T22:31:17', '2005-08-01T01:05:17', '2'), + ('343', '4168', '2006-02-16T02:30:53', '2005-07-09T17:03:50', '2005-07-16T22:25:50', '2'), + ('35', '2840', '2006-02-16T02:30:53', '2005-06-18T03:50:18', '2005-06-26T07:16:18', '2'), + ('384', '2076', '2006-02-16T02:30:53', '2005-07-10T23:59:27', '2005-07-14T23:38:27', '2'), + ('493', '530', '2006-02-16T02:30:53', '2005-05-28T06:43:34', '2005-06-06T07:16:34', '2'), + ('517', '4203', '2006-02-16T02:30:53', '2005-08-21T03:35:21', '2005-08-29T07:35:21', '2'), + ('319', '1459', '2006-02-16T02:30:53', '2005-07-11T15:11:33', '2005-07-15T19:55:33', '2'), + ('120', '1355', '2006-02-16T02:30:53', '2005-07-07T18:47:03', '2005-07-09T21:59:03', '2'), + ('452', '3652', '2006-02-16T02:30:53', '2005-06-19T10:50:52', '2005-06-25T08:44:52', '2'), + ('175', '3100', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('496', '3941', '2006-02-16T02:30:53', '2005-08-20T20:42:50', '2005-08-25T21:37:50', '2'), + ('481', '3708', '2006-02-16T02:30:53', '2005-07-31T18:15:14', '2005-08-05T14:44:14', '2'), + ('129', '724', '2006-02-16T02:30:53', '2005-07-09T17:39:30', '2005-07-11T16:43:30', '2'), + ('495', '1426', '2006-02-16T02:30:53', '2005-07-31T19:27:34', '2005-08-01T13:45:34', '2'), + ('115', '2931', '2006-02-16T02:30:53', '2005-08-01T10:03:17', '2005-08-10T15:50:17', '2'), + ('546', '2973', '2006-02-16T02:30:53', '2005-06-15T00:42:17', '2005-06-19T03:36:17', '2'), + ('414', '1326', '2006-02-16T02:30:53', '2005-07-31T21:01:46', '2005-08-09T01:33:46', '2'), + ('360', '58', '2006-02-16T02:30:53', '2005-05-28T17:37:59', '2005-06-03T22:49:59', '2'), + ('122', '1043', '2006-02-16T02:30:53', '2005-07-11T23:57:34', '2005-07-14T18:05:34', '2'), + ('173', '2992', '2006-02-16T02:30:53', '2005-07-10T02:13:59', '2005-07-15T00:01:59', '2'), + ('231', '3172', '2006-02-16T02:30:53', '2005-07-07T15:45:58', '2005-07-09T11:11:58', '2'), + ('577', '4521', '2006-02-16T02:30:53', '2005-07-12T03:11:23', '2005-07-13T00:51:23', '2'), + ('151', '938', '2006-02-16T02:30:53', '2005-07-31T16:38:12', '2005-08-05T11:45:12', '2'), + ('574', '2528', '2006-02-16T02:30:53', '2005-07-28T13:49:58', '2005-08-03T10:03:58', '2'), + ('3', '3328', '2006-02-16T02:30:53', '2005-05-27T17:17:09', '2005-06-02T11:20:09', '2'), + ('18', '800', '2006-02-16T02:30:53', '2005-05-29T01:32:10', '2005-06-02T03:54:10', '2'), + ('319', '1949', '2006-02-16T02:30:53', '2005-08-17T03:03:07', '2005-08-22T21:05:07', '2'), + ('57', '2675', '2006-02-16T02:30:53', '2005-07-31T23:27:13', '2005-08-05T20:32:13', '2'), + ('234', '1824', '2006-02-16T02:30:53', '2005-06-18T23:45:30', '2005-06-24T01:21:30', '2'), + ('66', '1640', '2006-02-16T02:30:53', '2005-08-17T16:42:13', '2005-08-22T20:38:13', '2'), + ('182', '1956', '2006-02-16T02:30:53', '2005-07-10T01:31:22', '2005-07-17T05:42:22', '2'), + ('234', '4434', '2006-02-16T02:30:53', '2005-06-16T09:10:06', '2005-06-23T04:36:06', '2'), + ('282', '2664', '2006-02-16T02:30:53', '2005-07-29T18:57:01', '2005-07-31T22:09:01', '2'), + ('481', '4558', '2006-02-16T02:30:53', '2005-06-18T08:10:42', '2005-06-20T12:26:42', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['1013', '10900', '12993', '899', '9981', '13164', '298', '8098', '4592', '13005', '4447', '14967', '9360', '9188', '13426', '10619', '8559', '13296', '3385', '9393', '13552', '13347', '7764', '7697', '11326', '5633', '12198', '12634', '7470', '6575', '10257', '392', '4433', '3600', '4461', '9547', '12903', '1174', '14813', '4058', '8335', '9761', '3444', '13040', '15754', '10286', '3741', '13965', '10880', '10585', '6547', '7807', '13802', '10898', '14353', '9838', '10166', '5796', '9476', '14488', '8065', '14803', '5846', '2547', '7000', '1508', '13524', '6406', '2196', '13647', '8395', '14451', '12995', '13782', '3707', '12510', '530', '3746', '3526', '13724', '1674', '2887', '14094', '10103', '6251', '13978', '10910', '14546', '12797', '12562', '8704', '11337', '14192', '10258', '8760', '13866', '3904', '10303', '11279', '2426']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('384', '4522', '2006-02-16T02:30:53', '2005-05-31T02:37:00', '2005-06-02T06:39:00', '2'), + ('139', '1749', '2006-02-16T02:30:53', '2005-08-02T01:34:26', '2005-08-07T00:52:26', '2'), + ('484', '4225', '2006-02-16T02:30:53', '2005-08-19T07:24:03', '2005-08-26T07:15:03', '2'), + ('156', '1096', '2006-02-16T02:30:53', '2005-05-30T09:29:30', '2005-06-06T12:39:30', '2'), + ('321', '1354', '2006-02-16T02:30:53', '2005-07-31T17:08:31', '2005-08-01T22:46:31', '2'), + ('145', '1104', '2006-02-16T02:30:53', '2005-08-19T13:30:55', '2005-08-26T10:12:55', '2'), + ('460', '1083', '2006-02-16T02:30:53', '2005-05-26T20:52:26', '2005-05-29T22:08:26', '2'), + ('41', '1757', '2006-02-16T02:30:53', '2005-07-28T18:34:20', '2005-07-31T19:07:20', '2'), + ('235', '2141', '2006-02-16T02:30:53', '2005-07-08T06:31:28', '2005-07-10T06:08:28', '2'), + ('104', '3417', '2006-02-16T02:30:53', '2005-08-19T07:45:42', '2005-08-20T12:45:42', '2'), + ('549', '404', '2006-02-16T02:30:53', '2005-07-07T23:15:28', '2005-07-14T22:53:28', '2'), + ('67', '289', '2006-02-16T02:30:53', '2005-08-22T06:46:03', '2005-08-23T01:02:03', '2'), + ('186', '2119', '2006-02-16T02:30:53', '2005-07-30T18:39:43', '2005-08-04T22:41:43', '2'), + ('195', '727', '2006-02-16T02:30:53', '2005-07-30T12:19:54', '2005-08-06T09:12:54', '2'), + ('213', '3409', '2006-02-16T02:30:53', '2005-08-19T23:15:00', '2005-08-21T01:53:00', '2'), + ('132', '2189', '2006-02-16T02:30:53', '2005-08-01T15:07:04', '2005-08-07T11:42:04', '2'), + ('279', '2078', '2006-02-16T02:30:53', '2005-07-29T11:25:54', '2005-08-04T10:16:54', '2'), + ('300', '1728', '2006-02-16T02:30:53', '2005-08-19T18:43:53', '2005-08-21T23:30:53', '2'), + ('514', '2810', '2006-02-16T02:30:53', '2005-06-21T14:16:48', '2005-06-24T10:32:48', '2'), + ('158', '843', '2006-02-16T02:30:53', '2005-07-30T20:04:48', '2005-08-02T15:52:48', '2'), + ('578', '758', '2006-02-16T02:30:53', '2005-08-20T04:03:51', '2005-08-23T02:48:51', '2'), + ('562', '4038', '2006-02-16T02:30:53', '2005-08-19T20:28:48', '2005-08-28T19:33:48', '2'), + ('142', '3537', '2006-02-16T02:30:53', '2005-07-28T06:40:05', '2005-07-30T02:51:05', '2'), + ('377', '3966', '2006-02-16T02:30:53', '2005-07-28T03:43:45', '2005-08-03T07:55:45', '2'), + ('530', '1762', '2006-02-16T02:30:53', '2005-08-02T16:34:29', '2005-08-03T17:40:29', '2'), + ('480', '1056', '2006-02-16T02:30:53', '2005-07-10T06:22:24', '2005-07-11T05:59:24', '2'), + ('86', '1628', '2006-02-16T02:30:53', '2005-08-18T02:09:20', '2005-08-21T21:28:20', '2'), + ('549', '1037', '2006-02-16T02:30:53', '2005-08-18T17:58:14', '2005-08-19T21:08:14', '2'), + ('564', '289', '2006-02-16T02:30:53', '2005-07-27T19:01:03', '2005-08-05T19:16:03', '2'), + ('598', '1414', '2006-02-16T02:30:53', '2005-07-12T06:12:53', '2005-07-18T07:55:53', '2'), + ('543', '2403', '2006-02-16T02:30:53', '2005-08-01T02:49:43', '2005-08-04T04:45:43', '2'), + ('359', '263', '2006-02-16T02:30:53', '2005-05-27T11:14:42', '2005-06-01T14:28:42', '2'), + ('449', '88', '2006-02-16T02:30:53', '2005-07-07T22:45:41', '2005-07-16T23:30:41', '2'), + ('511', '2748', '2006-02-16T02:30:53', '2005-07-06T05:19:42', '2005-07-11T00:34:42', '2'), + ('286', '3656', '2006-02-16T02:30:53', '2005-07-07T23:59:43', '2005-07-16T19:44:43', '2'), + ('440', '2414', '2006-02-16T02:30:53', '2005-07-31T01:52:34', '2005-08-03T23:12:34', '2'), + ('302', '2340', '2006-02-16T02:30:53', '2005-08-19T04:09:38', '2005-08-26T03:24:38', '2'), + ('95', '2653', '2006-02-16T02:30:53', '2005-06-15T00:12:51', '2005-06-21T02:10:51', '2'), + ('142', '3364', '2006-02-16T02:30:53', '2005-08-22T01:11:37', '2005-08-24T05:57:37', '2'), + ('442', '3877', '2006-02-16T02:30:53', '2005-07-07T04:02:50', '2005-07-10T04:30:50', '2'), + ('143', '1719', '2006-02-16T02:30:53', '2005-07-29T04:18:25', '2005-07-31T08:12:25', '2'), + ('60', '3778', '2006-02-16T02:30:53', '2005-07-31T09:31:54', '2005-08-03T11:02:54', '2'), + ('45', '493', '2006-02-16T02:30:53', '2005-06-21T20:39:39', '2005-06-25T23:44:39', '2'), + ('425', '4113', '2006-02-16T02:30:53', '2005-08-19T09:04:24', '2005-08-23T12:36:24', '2'), + ('356', '2306', '2006-02-16T02:30:53', '2005-08-23T12:43:42', '2005-08-27T17:45:42', '2'), + ('532', '498', '2006-02-16T02:30:53', '2005-08-01T03:35:58', '2005-08-10T05:17:58', '2'), + ('584', '1449', '2006-02-16T02:30:53', '2005-07-06T12:00:18', '2005-07-12T09:02:18', '2'), + ('324', '670', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('528', '450', '2006-02-16T02:30:53', '2005-08-02T00:34:12', '2005-08-06T21:15:12', '2'), + ('228', '2670', '2006-02-16T02:30:53', '2005-08-01T14:00:42', '2005-08-09T11:42:42', '2'), + ('262', '2656', '2006-02-16T02:30:53', '2005-07-12T04:57:46', '2005-07-18T08:36:46', '2'), + ('504', '2204', '2006-02-16T02:30:53', '2005-07-28T07:58:27', '2005-08-01T02:48:27', '2'), + ('156', '2079', '2006-02-16T02:30:53', '2005-08-20T12:44:53', '2005-08-22T09:18:53', '2'), + ('23', '3814', '2006-02-16T02:30:53', '2005-08-02T01:29:57', '2005-08-06T00:07:57', '2'), + ('129', '1612', '2006-02-16T02:30:53', '2005-08-21T09:07:50', '2005-08-22T10:31:50', '2'), + ('208', '3866', '2006-02-16T02:30:53', '2005-07-31T12:18:49', '2005-08-03T16:49:49', '2'), + ('484', '4304', '2006-02-16T02:30:53', '2005-07-31T23:22:20', '2005-08-07T18:06:20', '2'), + ('286', '1631', '2006-02-16T02:30:53', '2005-07-10T14:42:54', '2005-07-17T08:47:54', '2'), + ('197', '3599', '2006-02-16T02:30:53', '2005-07-30T23:06:40', '2005-08-04T22:52:40', '2'), + ('75', '4202', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('220', '413', '2006-02-16T02:30:53', '2005-07-28T17:15:48', '2005-08-04T15:49:48', '2'), + ('278', '2525', '2006-02-16T02:30:53', '2005-08-22T00:49:10', '2005-08-22T23:44:10', '2'), + ('233', '938', '2006-02-16T02:30:53', '2005-07-10T17:25:24', '2005-07-12T13:41:24', '2'), + ('162', '4560', '2006-02-16T02:30:53', '2005-06-19T02:44:17', '2005-06-24T08:01:17', '2'), + ('31', '2024', '2006-02-16T02:30:53', '2005-07-27T01:23:24', '2005-08-03T02:10:24', '2'), + ('511', '1141', '2006-02-16T02:30:53', '2005-06-15T22:33:24', '2005-06-18T02:27:24', '2'), + ('593', '4557', '2006-02-16T02:30:53', '2005-08-20T02:48:43', '2005-08-27T03:14:43', '2'), + ('392', '4439', '2006-02-16T02:30:53', '2005-07-11T22:55:27', '2005-07-20T04:50:27', '2'), + ('240', '1925', '2006-02-16T02:30:53', '2005-06-18T01:47:07', '2005-06-26T03:18:07', '2'), + ('519', '3269', '2006-02-16T02:30:53', '2005-08-20T07:48:07', '2005-08-28T07:56:07', '2'), + ('535', '1471', '2006-02-16T02:30:53', '2005-07-29T06:03:30', '2005-07-31T09:08:30', '2'), + ('467', '3967', '2006-02-16T02:30:53', '2005-08-21T12:21:44', '2005-08-22T15:07:44', '2'), + ('566', '2069', '2006-02-16T02:30:53', '2005-08-19T07:26:30', '2005-08-25T12:47:30', '2'), + ('305', '577', '2006-02-16T02:30:53', '2005-08-20T12:09:26', '2005-08-23T08:31:26', '2'), + ('14', '1080', '2006-02-16T02:30:53', '2005-07-06T10:21:49', '2005-07-12T05:14:49', '2'), + ('394', '3051', '2006-02-16T02:30:53', '2005-08-18T13:22:25', '2005-08-27T17:38:25', '2'), + ('312', '3332', '2006-02-16T02:30:53', '2005-05-28T05:13:01', '2005-06-01T10:21:01', '2'), + ('424', '3387', '2006-02-16T02:30:53', '2005-07-06T12:10:51', '2005-07-07T11:36:51', '2'), + ('469', '3871', '2006-02-16T02:30:53', '2005-07-06T01:03:29', '2005-07-15T01:22:29', '2'), + ('80', '200', '2006-02-16T02:30:53', '2005-08-20T10:07:28', '2005-08-24T07:47:28', '2'), + ('234', '3606', '2006-02-16T02:30:53', '2005-06-16T10:57:00', '2005-06-18T07:31:00', '2'), + ('453', '1073', '2006-02-16T02:30:53', '2005-06-20T01:39:43', '2005-06-25T05:22:43', '2'), + ('471', '3674', '2006-02-16T02:30:53', '2005-08-21T00:21:35', '2005-08-23T05:27:35', '2'), + ('25', '77', '2006-02-16T02:30:53', '2005-07-31T20:49:13', '2005-08-05T15:55:13', '2'), + ('230', '3956', '2006-02-16T02:30:53', '2005-07-11T15:06:20', '2005-07-18T20:11:20', '2'), + ('260', '1263', '2006-02-16T02:30:53', '2005-08-20T19:03:25', '2005-08-27T18:02:25', '2'), + ('266', '2428', '2006-02-16T02:30:53', '2005-08-02T01:54:34', '2005-08-10T04:04:34', '2'), + ('466', '1515', '2006-02-16T02:30:53', '2005-08-21T15:50:50', '2005-08-23T11:37:50', '2'), + ('5', '1595', '2006-02-16T02:30:53', '2005-08-19T00:24:08', '2005-08-21T22:53:08', '2'), + ('212', '529', '2006-02-16T02:30:53', '2005-08-18T15:00:03', '2005-08-23T12:55:03', '2'), + ('107', '2117', '2006-02-16T02:30:53', '2005-07-29T17:13:45', '2005-08-03T20:03:45', '2'), + ('366', '3428', '2006-02-16T02:30:53', '2005-08-02T16:59:09', '2005-08-10T20:41:09', '2'), + ('26', '3563', '2006-02-16T02:30:53', '2005-08-21T03:37:42', '2005-08-28T05:31:42', '2'), + ('469', '2062', '2006-02-16T02:30:53', '2005-08-01T02:51:09', '2005-08-08T23:57:09', '2'), + ('118', '3566', '2006-02-16T02:30:53', '2005-07-29T19:22:40', '2005-08-05T01:09:40', '2'), + ('343', '3432', '2006-02-16T02:30:53', '2005-08-20T15:05:29', '2005-08-23T11:27:29', '2'), + ('485', '3600', '2006-02-16T02:30:53', '2005-07-06T19:30:57', '2005-07-11T18:47:57', '2'), + ('479', '936', '2006-02-16T02:30:53', '2005-08-01T04:13:33', '2005-08-06T02:16:33', '2'), + ('125', '151', '2006-02-16T02:30:53', '2005-08-02T14:30:03', '2005-08-10T09:49:03', '2'), + ('543', '474', '2006-02-16T02:30:53', '2005-06-18T17:40:44', '2005-06-22T14:30:44', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['15240', '9855', '515', '13475', '14535', '13906', '1290', '28', '12876', '12266', '8274', '1901', '5340', '6559', '4855', '13912', '7264', '6993', '14507', '2762', '10368', '8878', '4417', '7048', '6614', '4043', '7354', '13283', '10849', '4116', '10167', '15178', '10338', '5667', '12655', '7407', '15675', '4406', '2207', '13165', '12158', '4631', '7225', '11599', '711', '7720', '13663', '13702', '9355', '11815', '4416', '2436', '6465', '2935', '6633', '9597', '10556', '8441', '5026', '13012', '8010', '9847', '11823', '15627', '2905', '12687', '13863', '339', '3104', '13409', '5852', '4250', '10313', '2524', '15918', '15251', '15530', '2399', '6984', '15843', '8318', '6556', '1945', '646', '8511', '11902', '3258', '15342', '448', '11743', '10682', '2365', '11701', '12489', '10635', '12925', '7651', '12016', '13621', '7843']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('11', '2014', '2006-02-16T02:30:53', '2005-08-22T17:46:41', '2005-08-23T15:08:41', '2'), + ('326', '1246', '2006-02-16T02:30:53', '2005-07-31T13:00:33', '2005-08-03T16:18:33', '2'), + ('110', '3369', '2006-02-16T02:30:53', '2005-05-28T03:10:10', '2005-06-04T02:18:10', '2'), + ('68', '3214', '2006-02-16T02:30:53', '2005-08-20T01:05:05', '2005-08-20T20:22:05', '2'), + ('412', '530', '2006-02-16T02:30:53', '2005-08-21T15:22:37', '2005-08-29T19:23:37', '2'), + ('87', '3960', '2006-02-16T02:30:53', '2005-08-20T16:16:03', '2005-08-21T13:29:03', '2'), + ('540', '1921', '2006-02-16T02:30:53', '2005-06-15T08:52:44', '2005-06-24T13:36:44', '2'), + ('232', '4068', '2006-02-16T02:30:53', '2005-05-25T03:42:37', '2005-05-26T09:26:37', '2'), + ('356', '803', '2006-02-16T02:30:53', '2005-08-19T03:12:19', '2005-08-20T02:24:19', '2'), + ('467', '2192', '2006-02-16T02:30:53', '2005-08-18T04:22:31', '2005-08-19T04:25:31', '2'), + ('340', '2634', '2006-02-16T02:30:53', '2005-07-29T01:34:32', '2005-08-01T20:15:32', '2'), + ('292', '2469', '2006-02-16T02:30:53', '2005-06-17T04:35:19', '2005-06-25T06:09:19', '2'), + ('267', '650', '2006-02-16T02:30:53', '2005-07-09T17:11:35', '2005-07-17T17:59:35', '2'), + ('353', '458', '2006-02-16T02:30:53', '2005-07-12T05:20:35', '2005-07-16T08:44:35', '2'), + ('337', '1146', '2006-02-16T02:30:53', '2005-07-08T18:45:50', '2005-07-11T18:23:50', '2'), + ('207', '968', '2006-02-16T02:30:53', '2005-08-20T16:32:10', '2005-08-29T17:37:10', '2'), + ('299', '2391', '2006-02-16T02:30:53', '2005-07-27T11:18:58', '2005-08-03T07:43:58', '2'), + ('154', '3114', '2006-02-16T02:30:53', '2005-07-27T01:05:24', '2005-07-30T06:23:24', '2'), + ('175', '1969', '2006-02-16T02:30:53', '2005-08-21T14:32:45', '2005-08-28T09:50:45', '2'), + ('457', '3431', '2006-02-16T02:30:53', '2005-06-19T17:22:31', '2005-06-25T22:43:31', '2'), + ('593', '3535', '2006-02-16T02:30:53', '2005-08-01T06:13:38', '2005-08-08T04:40:38', '2'), + ('25', '440', '2006-02-16T02:30:53', '2005-07-30T00:15:57', '2005-08-01T00:22:57', '2'), + ('452', '743', '2006-02-16T02:30:53', '2005-07-07T22:05:05', '2005-07-09T16:16:05', '2'), + ('581', '3707', '2006-02-16T02:30:53', '2005-07-27T03:31:48', '2005-08-05T07:30:48', '2'), + ('144', '3004', '2006-02-16T02:30:53', '2005-07-12T08:33:49', '2005-07-18T07:28:49', '2'), + ('204', '3427', '2006-02-16T02:30:53', '2005-07-07T03:09:50', '2005-07-10T07:49:50', '2'), + ('598', '2395', '2006-02-16T02:30:53', '2005-07-27T14:42:11', '2005-08-03T18:19:11', '2'), + ('180', '2602', '2006-02-16T02:30:53', '2005-08-19T18:10:19', '2005-08-23T16:09:19', '2'), + ('278', '1683', '2006-02-16T02:30:53', '2005-08-01T23:51:00', '2005-08-10T19:59:00', '2'), + ('352', '666', '2006-02-16T02:30:53', '2005-07-07T06:56:13', '2005-07-11T11:13:13', '2'), + ('129', '1222', '2006-02-16T02:30:53', '2005-07-31T23:24:31', '2005-08-06T17:42:31', '2'), + ('15', '1745', '2006-02-16T02:30:53', '2005-08-22T15:36:04', '2005-08-26T21:00:04', '2'), + ('339', '1295', '2006-02-16T02:30:53', '2005-08-01T05:03:03', '2005-08-09T05:13:03', '2'), + ('336', '683', '2006-02-16T02:30:53', '2005-07-10T08:11:03', '2005-07-15T08:23:03', '2'), + ('533', '859', '2006-02-16T02:30:53', '2005-08-18T18:57:44', '2005-08-27T22:40:44', '2'), + ('410', '3093', '2006-02-16T02:30:53', '2005-07-27T16:29:04', '2005-08-01T17:47:04', '2'), + ('293', '4153', '2006-02-16T02:30:53', '2005-08-23T09:18:52', '2005-08-30T14:59:52', '2'), + ('448', '438', '2006-02-16T02:30:53', '2005-07-07T21:35:16', '2005-07-15T16:13:16', '2'), + ('78', '182', '2006-02-16T02:30:53', '2005-06-18T02:19:21', '2005-06-24T02:25:21', '2'), + ('289', '138', '2006-02-16T02:30:53', '2005-08-19T13:34:10', '2005-08-21T18:33:10', '2'), + ('289', '4121', '2006-02-16T02:30:53', '2005-08-18T00:34:20', '2005-08-22T20:10:20', '2'), + ('59', '470', '2006-02-16T02:30:53', '2005-07-08T08:38:22', '2005-07-11T03:33:22', '2'), + ('306', '632', '2006-02-16T02:30:53', '2005-07-27T09:47:12', '2005-08-03T13:19:12', '2'), + ('112', '3749', '2006-02-16T02:30:53', '2005-08-17T03:08:10', '2005-08-25T05:01:10', '2'), + ('215', '4581', '2006-02-16T02:30:53', '2005-05-29T03:49:03', '2005-05-31T08:29:03', '2'), + ('520', '185', '2006-02-16T02:30:53', '2005-07-28T04:41:44', '2005-08-04T06:51:44', '2'), + ('240', '3969', '2006-02-16T02:30:53', '2005-08-20T08:12:33', '2005-08-27T03:23:33', '2'), + ('296', '700', '2006-02-16T02:30:53', '2005-08-20T09:27:20', '2005-08-29T15:04:20', '2'), + ('201', '1122', '2006-02-16T02:30:53', '2005-07-30T18:35:25', '2005-08-03T20:33:25', '2'), + ('192', '272', '2006-02-16T02:30:53', '2005-08-17T12:13:26', '2005-08-22T17:15:26', '2'), + ('290', '1247', '2006-02-16T02:30:53', '2005-07-07T22:04:36', '2005-07-09T02:44:36', '2'), + ('534', '3328', '2006-02-16T02:30:53', '2005-06-18T18:13:32', '2005-06-21T13:33:32', '2'), + ('207', '2047', '2006-02-16T02:30:53', '2005-07-12T01:17:11', '2005-07-20T00:29:11', '2'), + ('384', '2735', '2006-02-16T02:30:53', '2005-06-20T05:07:24', '2005-06-28T09:17:24', '2'), + ('150', '2908', '2006-02-16T02:30:53', '2005-07-12T09:35:42', '2005-07-13T12:56:42', '2'), + ('61', '3317', '2006-02-16T02:30:53', '2005-07-31T03:29:07', '2005-08-09T03:33:07', '2'), + ('117', '144', '2006-02-16T02:30:53', '2005-08-01T12:58:42', '2005-08-03T07:18:42', '2'), + ('526', '1000', '2006-02-16T02:30:53', '2005-07-29T07:33:05', '2005-08-04T04:00:05', '2'), + ('463', '989', '2006-02-16T02:30:53', '2005-07-09T02:32:34', '2005-07-13T04:39:34', '2'), + ('145', '1690', '2006-02-16T02:30:53', '2005-08-19T07:54:59', '2005-08-26T09:50:59', '2'), + ('467', '68', '2006-02-16T02:30:53', '2005-07-28T15:26:20', '2005-08-04T18:39:20', '2'), + ('174', '1137', '2006-02-16T02:30:53', '2005-07-31T12:33:43', '2005-08-04T14:15:43', '2'), + ('352', '2626', '2006-02-16T02:30:53', '2005-08-17T12:36:37', '2005-08-22T11:10:37', '2'), + ('453', '1364', '2006-02-16T02:30:53', '2005-08-23T07:25:38', '2005-08-31T02:53:38', '2'), + ('189', '3898', '2006-02-16T02:30:53', '2005-06-20T02:56:16', '2005-06-24T23:51:16', '2'), + ('285', '3092', '2006-02-16T02:30:53', '2005-08-18T19:57:39', '2005-08-27T01:36:39', '2'), + ('563', '2417', '2006-02-16T02:30:53', '2005-08-20T14:57:50', '2005-08-29T15:36:50', '2'), + ('516', '2410', '2006-02-16T02:30:53', '2005-05-27T03:47:18', '2005-06-04T05:46:18', '2'), + ('196', '1490', '2006-02-16T02:30:53', '2005-06-20T17:06:46', '2005-06-28T13:18:46', '2'), + ('214', '873', '2006-02-16T02:30:53', '2005-08-19T22:36:26', '2005-08-22T01:52:26', '2'), + ('484', '3890', '2006-02-16T02:30:53', '2005-07-10T17:43:30', '2005-07-15T15:05:30', '2'), + ('423', '2556', '2006-02-16T02:30:53', '2005-07-07T14:08:11', '2005-07-13T08:09:11', '2'), + ('80', '1194', '2006-02-16T02:30:53', '2005-08-01T04:29:29', '2005-08-04T08:12:29', '2'), + ('465', '441', '2006-02-16T02:30:53', '2005-06-19T00:48:11', '2005-06-25T01:46:11', '2'), + ('262', '1456', '2006-02-16T02:30:53', '2005-08-23T17:57:35', '2005-08-28T14:16:35', '2'), + ('285', '1994', '2006-02-16T02:30:53', '2005-08-22T18:03:57', '2005-08-23T20:56:57', '2'), + ('167', '154', '2006-02-16T02:30:53', '2005-08-23T03:50:48', '2005-08-28T22:17:48', '2'), + ('577', '2492', '2006-02-16T02:30:53', '2005-06-18T16:06:14', '2005-06-26T16:56:14', '2'), + ('297', '2407', '2006-02-16T02:30:53', '2005-07-27T00:56:30', '2005-08-02T01:14:30', '2'), + ('215', '611', '2006-02-16T02:30:53', '2005-08-23T15:37:31', '2005-08-28T18:41:31', '2'), + ('167', '4524', '2006-02-16T02:30:53', '2005-07-29T03:44:30', '2005-07-30T05:03:30', '2'), + ('570', '3901', '2006-02-16T02:30:53', '2005-07-12T05:10:16', '2005-07-13T04:16:16', '2'), + ('207', '3366', '2006-02-16T02:30:53', '2005-06-17T07:51:26', '2005-06-23T13:22:26', '2'), + ('185', '1922', '2006-02-16T02:30:53', '2005-05-28T19:16:14', '2005-05-31T16:50:14', '2'), + ('598', '3667', '2006-02-16T02:30:53', '2005-07-29T09:42:42', '2005-08-06T14:22:42', '2'), + ('63', '1387', '2006-02-16T02:30:53', '2005-08-17T15:37:34', '2005-08-22T17:28:34', '2'), + ('241', '4417', '2006-02-16T02:30:53', '2005-06-21T03:53:58', '2005-06-22T22:49:58', '2'), + ('459', '3287', '2006-02-16T02:30:53', '2005-08-22T20:56:41', '2005-08-26T22:51:41', '2'), + ('247', '2671', '2006-02-16T02:30:53', '2005-05-27T19:03:08', '2005-06-03T20:28:08', '2'), + ('336', '294', '2006-02-16T02:30:53', '2005-08-17T08:49:05', '2005-08-22T08:53:05', '2'), + ('18', '4557', '2006-02-16T02:30:53', '2005-08-01T17:32:53', '2005-08-06T15:49:53', '2'), + ('493', '3109', '2006-02-16T02:30:53', '2005-06-18T13:45:34', '2005-06-21T12:12:34', '2'), + ('34', '993', '2006-02-16T02:30:53', '2005-08-17T07:15:47', '2005-08-19T01:44:47', '2'), + ('60', '387', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('52', '547', '2006-02-16T02:30:53', '2005-08-01T15:37:58', '2005-08-07T11:15:58', '2'), + ('57', '3361', '2006-02-16T02:30:53', '2005-08-19T04:59:01', '2005-08-27T02:03:01', '2'), + ('401', '2753', '2006-02-16T02:30:53', '2005-07-28T01:48:32', '2005-08-03T03:10:32', '2'), + ('327', '2109', '2006-02-16T02:30:53', '2005-08-17T19:33:24', '2005-08-21T19:59:24', '2'), + ('581', '3754', '2006-02-16T02:30:53', '2005-08-20T06:43:44', '2005-08-23T06:25:44', '2'), + ('75', '3962', '2006-02-16T02:30:53', '2005-07-28T09:10:22', '2005-08-01T11:27:22', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['13829', '5790', '7140', '7175', '14570', '1041', '6040', '11308', '9573', '11284', '12501', '5296', '11505', '11681', '6574', '5780', '10034', '1978', '3902', '278', '10452', '14648', '15140', '3880', '6567', '1572', '5622', '6088', '4961', '11330', '487', '10580', '3413', '889', '2886', '9208', '3997', '2238', '3561', '15510', '703', '1812', '796', '7339', '3941', '363', '6751', '347', '11648', '11360', '3478', '3802', '8883', '10409', '15622', '4348', '3043', '5581', '13917', '9022', '8330', '10091', '10668', '9823', '10469', '5835', '2896', '2021', '12789', '6290', '15339', '15575', '4086', '4179', '9415', '1392', '11898', '9833', '10076', '1305', '6976', '7584', '13554', '5259', '4841', '8175', '12475', '7596', '4167', '2577', '11365', '9783', '4543', '3287', '6011', '9650', '754', '2372', '12282', '13429']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('146', '3980', '2006-02-16T02:30:53', '2005-08-20T13:50:17', '2005-08-24T11:30:17', '2'), + ('235', '1696', '2006-02-16T02:30:53', '2005-07-10T14:15:21', '2005-07-14T08:53:21', '2'), + ('35', '2028', '2006-02-16T02:30:53', '2005-07-27T06:54:12', '2005-08-03T10:36:12', '2'), + ('190', '568', '2006-02-16T02:30:53', '2005-07-27T08:03:22', '2005-08-01T02:47:22', '2'), + ('32', '955', '2006-02-16T02:30:53', '2005-08-21T16:32:32', '2005-08-30T12:03:32', '2'), + ('272', '4432', '2006-02-16T02:30:53', '2005-05-31T05:46:23', '2005-06-06T09:50:23', '2'), + ('511', '2161', '2006-02-16T02:30:53', '2005-07-11T03:14:26', '2005-07-14T01:12:26', '2'), + ('16', '699', '2006-02-16T02:30:53', '2005-08-02T15:50:44', '2005-08-05T11:38:44', '2'), + ('59', '3745', '2006-02-16T02:30:53', '2005-07-31T02:45:38', '2005-08-09T04:31:38', '2'), + ('8', '172', '2006-02-16T02:30:53', '2005-08-02T14:42:45', '2005-08-04T11:55:45', '2'), + ('173', '728', '2006-02-16T02:30:53', '2005-08-18T13:13:13', '2005-08-23T07:24:13', '2'), + ('109', '495', '2006-02-16T02:30:53', '2005-07-09T15:26:27', '2005-07-15T10:03:27', '2'), + ('34', '3344', '2006-02-16T02:30:53', '2005-08-16T23:18:47', '2005-08-23T19:52:47', '2'), + ('543', '1260', '2006-02-16T02:30:53', '2005-08-17T06:13:30', '2005-08-26T01:29:30', '2'), + ('115', '621', '2006-02-16T02:30:53', '2005-07-12T06:04:22', '2005-07-18T03:19:22', '2'), + ('516', '168', '2006-02-16T02:30:53', '2005-07-10T13:46:23', '2005-07-14T17:19:23', '2'), + ('442', '354', '2006-02-16T02:30:53', '2005-07-31T18:45:30', '2005-08-04T21:13:30', '2'), + ('278', '1590', '2006-02-16T02:30:53', '2005-06-17T09:42:34', '2005-06-20T09:13:34', '2'), + ('192', '2868', '2006-02-16T02:30:53', '2005-07-06T19:25:18', '2005-07-10T17:42:18', '2'), + ('214', '182', '2006-02-16T02:30:53', '2005-05-26T17:40:58', '2005-06-02T16:43:58', '2'), + ('442', '1973', '2006-02-16T02:30:53', '2005-08-01T09:11:36', '2005-08-04T13:28:36', '2'), + ('284', '2250', '2006-02-16T02:30:53', '2005-08-21T19:18:01', '2005-08-25T14:59:01', '2'), + ('414', '1402', '2006-02-16T02:30:53', '2005-08-22T13:39:20', '2005-08-30T18:19:20', '2'), + ('507', '42', '2006-02-16T02:30:53', '2005-07-06T18:32:49', '2005-07-07T20:46:49', '2'), + ('198', '1336', '2006-02-16T02:30:53', '2005-07-12T05:43:09', '2005-07-19T08:18:09', '2'), + ('560', '4179', '2006-02-16T02:30:53', '2005-06-16T03:23:22', '2005-06-20T06:03:22', '2'), + ('568', '1783', '2006-02-16T02:30:53', '2005-07-10T05:39:37', '2005-07-15T00:48:37', '2'), + ('498', '3796', '2006-02-16T02:30:53', '2005-07-11T05:40:35', '2005-07-17T07:14:35', '2'), + ('96', '3668', '2006-02-16T02:30:53', '2005-07-08T23:35:53', '2005-07-14T22:46:53', '2'), + ('75', '4326', '2006-02-16T02:30:53', '2005-08-02T16:45:33', '2005-08-04T15:15:33', '2'), + ('569', '3774', '2006-02-16T02:30:53', '2005-05-28T00:00:30', '2005-05-28T19:18:30', '2'), + ('234', '590', '2006-02-16T02:30:53', '2005-08-01T13:51:14', '2005-08-08T11:49:14', '2'), + ('322', '666', '2006-02-16T02:30:53', '2005-06-21T16:57:07', '2005-06-30T12:03:07', '2'), + ('114', '1299', '2006-02-16T02:30:53', '2005-05-30T07:14:53', '2005-05-31T07:56:53', '2'), + ('154', '1755', '2006-02-16T02:30:53', '2005-06-20T01:38:39', '2005-06-23T04:28:39', '2'), + ('339', '2751', '2006-02-16T02:30:53', '2005-07-30T12:54:03', '2005-08-06T17:22:03', '2'), + ('52', '3895', '2006-02-16T02:30:53', '2005-07-06T23:46:52', '2005-07-14T05:39:52', '2'), + ('251', '2859', '2006-02-16T02:30:53', '2005-06-18T04:22:06', '2005-06-27T03:29:06', '2'), + ('231', '213', '2006-02-16T02:30:53', '2005-07-06T02:54:33', '2005-07-14T07:44:33', '2'), + ('209', '3239', '2006-02-16T02:30:53', '2005-08-23T02:51:27', '2005-09-01T02:44:27', '2'), + ('269', '1123', '2006-02-16T02:30:53', '2005-05-29T02:29:36', '2005-06-03T04:54:36', '2'), + ('37', '751', '2006-02-16T02:30:53', '2005-06-16T21:08:46', '2005-06-21T15:44:46', '2'), + ('26', '2697', '2006-02-16T02:30:53', '2005-05-29T16:59:44', '2005-06-03T16:22:44', '2'), + ('316', '3343', '2006-02-16T02:30:53', '2005-07-27T14:17:48', '2005-07-31T12:47:48', '2'), + ('560', '382', '2006-02-16T02:30:53', '2005-07-06T21:20:37', '2005-07-09T01:35:37', '2'), + ('345', '4282', '2006-02-16T02:30:53', '2005-05-27T07:14:00', '2005-05-28T12:22:00', '2'), + ('312', '1749', '2006-02-16T02:30:53', '2005-07-12T14:50:34', '2005-07-15T19:39:34', '2'), + ('378', '1625', '2006-02-16T02:30:53', '2005-05-27T04:40:33', '2005-05-28T09:56:33', '2'), + ('465', '3362', '2006-02-16T02:30:53', '2005-08-17T04:56:16', '2005-08-26T00:53:16', '2'), + ('66', '1750', '2006-02-16T02:30:53', '2005-08-02T17:46:04', '2005-08-04T21:02:04', '2'), + ('322', '2528', '2006-02-16T02:30:53', '2005-07-05T23:05:44', '2005-07-07T00:14:44', '2'), + ('91', '1017', '2006-02-16T02:30:53', '2005-07-06T15:06:09', '2005-07-08T09:33:09', '2'), + ('168', '1421', '2006-02-16T02:30:53', '2005-07-30T00:24:48', '2005-08-04T00:24:48', '2'), + ('449', '2804', '2006-02-16T02:30:53', '2005-08-01T07:49:15', '2005-08-02T13:42:15', '2'), + ('302', '3335', '2006-02-16T02:30:53', '2005-08-23T07:22:02', '2005-09-01T06:08:02', '2'), + ('452', '1948', '2006-02-16T02:30:53', '2005-07-07T19:02:05', '2005-07-09T20:51:05', '2'), + ('599', '633', '2006-02-16T02:30:53', '2005-06-20T12:38:35', '2005-06-29T14:16:35', '2'), + ('306', '3450', '2006-02-16T02:30:53', '2005-07-10T04:06:06', '2005-07-15T08:31:06', '2'), + ('10', '4326', '2006-02-16T02:30:53', '2005-08-20T16:43:28', '2005-08-29T16:44:28', '2'), + ('159', '4473', '2006-02-16T02:30:53', '2005-07-30T05:34:45', '2005-08-03T23:57:45', '2'), + ('412', '2294', '2006-02-16T02:30:53', '2005-07-29T04:09:07', '2005-08-05T05:00:07', '2'), + ('135', '1878', '2006-02-16T02:30:53', '2005-07-31T20:23:13', '2005-08-02T21:58:13', '2'), + ('58', '2085', '2006-02-16T02:30:53', '2005-08-01T17:00:27', '2005-08-02T14:49:27', '2'), + ('129', '4423', '2006-02-16T02:30:53', '2005-07-31T11:49:00', '2005-08-07T09:06:00', '2'), + ('466', '3054', '2006-02-16T02:30:53', '2005-08-01T09:51:11', '2005-08-05T06:53:11', '2'), + ('11', '800', '2006-02-16T02:30:53', '2005-07-10T16:44:58', '2005-07-17T16:03:58', '2'), + ('40', '1086', '2006-02-16T02:30:53', '2005-06-20T02:33:42', '2005-06-26T05:29:42', '2'), + ('319', '2852', '2006-02-16T02:30:53', '2005-06-17T12:41:18', '2005-06-23T17:17:18', '2'), + ('557', '2412', '2006-02-16T02:30:53', '2005-08-19T00:16:19', '2005-08-25T00:18:19', '2'), + ('66', '2634', '2006-02-16T02:30:53', '2005-07-11T17:12:42', '2005-07-19T21:53:42', '2'), + ('331', '1660', '2006-02-16T02:30:53', '2005-08-22T20:52:12', '2005-08-26T00:36:12', '2'), + ('218', '3916', '2006-02-16T02:30:53', '2005-08-23T05:30:19', '2005-08-27T05:19:19', '2'), + ('494', '253', '2006-02-16T02:30:53', '2005-07-07T05:26:06', '2005-07-12T00:45:06', '2'), + ('75', '559', '2006-02-16T02:30:53', '2005-07-07T10:17:15', '2005-07-10T05:12:15', '2'), + ('139', '3336', '2006-02-16T02:30:53', '2005-07-30T20:48:31', '2005-08-05T19:45:31', '2'), + ('460', '363', '2006-02-16T02:30:53', '2005-06-15T16:12:27', '2005-06-16T17:30:27', '2'), + ('169', '3163', '2006-02-16T02:30:53', '2005-08-17T15:24:12', '2005-08-24T13:36:12', '2'), + ('368', '4243', '2006-02-16T02:30:53', '2005-07-31T12:05:01', '2005-08-09T09:25:01', '2'), + ('555', '1117', '2006-02-16T02:30:53', '2005-07-31T20:00:34', '2005-08-10T00:37:34', '2'), + ('8', '187', '2006-02-16T02:30:53', '2005-06-15T09:59:16', '2005-06-19T09:48:16', '2'), + ('41', '3096', '2006-02-16T02:30:53', '2005-07-27T00:40:01', '2005-07-31T22:30:01', '2'), + ('338', '4390', '2006-02-16T02:30:53', '2005-07-27T23:15:46', '2005-08-03T02:18:46', '2'), + ('569', '2648', '2006-02-16T02:30:53', '2005-08-20T04:08:39', '2005-08-28T07:11:39', '2'), + ('207', '1310', '2006-02-16T02:30:53', '2005-07-09T14:02:50', '2005-07-11T19:13:50', '2'), + ('248', '518', '2006-02-16T02:30:53', '2005-07-08T18:18:23', '2005-07-11T16:51:23', '2'), + ('429', '641', '2006-02-16T02:30:53', '2005-07-28T21:38:16', '2005-08-07T01:34:16', '2'), + ('401', '3118', '2006-02-16T02:30:53', '2005-08-18T12:14:21', '2005-08-24T14:43:21', '2'), + ('275', '2097', '2006-02-16T02:30:53', '2005-07-27T23:33:57', '2005-08-01T20:46:57', '2'), + ('175', '3771', '2006-02-16T02:30:53', '2005-07-07T09:37:08', '2005-07-16T06:16:08', '2'), + ('66', '447', '2006-02-16T02:30:53', '2005-06-19T04:36:03', '2005-06-28T00:38:03', '2'), + ('508', '1151', '2006-02-16T02:30:53', '2005-08-02T18:00:09', '2005-08-04T13:40:09', '2'), + ('75', '836', '2006-02-16T02:30:53', '2005-07-31T10:15:46', '2005-08-09T13:22:46', '2'), + ('41', '913', '2006-02-16T02:30:53', '2005-07-08T04:06:55', '2005-07-12T23:17:55', '2'), + ('62', '4406', '2006-02-16T02:30:53', '2005-06-21T06:32:39', '2005-06-24T09:29:39', '2'), + ('527', '3899', '2006-02-16T02:30:53', '2005-07-11T01:54:48', '2005-07-18T07:17:48', '2'), + ('414', '2997', '2006-02-16T02:30:53', '2005-07-31T05:47:32', '2005-08-04T00:50:32', '2'), + ('281', '734', '2006-02-16T02:30:53', '2005-05-29T10:18:59', '2005-06-04T05:03:59', '2'), + ('96', '1567', '2006-02-16T02:30:53', '2005-06-18T14:37:37', '2005-06-21T08:40:37', '2'), + ('173', '3623', '2006-02-16T02:30:53', '2005-08-18T04:54:20', '2005-08-23T05:28:20', '2'), + ('23', '3677', '2006-02-16T02:30:53', '2005-08-19T23:25:37', '2005-08-28T01:04:37', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['1180', '10057', '3087', '4864', '15310', '6320', '11911', '10792', '9160', '9440', '3920', '6940', '8910', '6440', '6786', '4781', '6198', '10507', '9337', '8197', '14239', '7841', '2594', '6671', '11271', '13199', '10322', '2184', '10616', '5181', '4288', '13185', '3820', '13967', '13837', '14705', '9662', '8842', '9301', '1337', '7972', '1831', '3858', '14532', '3005', '4826', '2539', '7268', '14292', '6698', '1056', '13046', '3706', '10909', '284', '8495', '10584', '11414', '14052', '1395', '2223', '10934', '6334', '2222', '6055', '13077', '12309', '5353', '5046', '8202', '1300', '6885', '898', '14764', '2739', '14313', '12627', '12558', '5819', '13047', '8882', '6174', '9711', '10722', '11003', '14516', '15668', '5228', '975', '14718', '13947', '630', '9126', '9555', '9272', '8489', '1604', '10858', '9418', '12102']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('432', '3119', '2006-02-16T02:30:53', '2005-06-15T00:39:01', '2005-06-21T22:44:01', '2'), + ('230', '3485', '2006-02-16T02:30:53', '2005-07-31T19:20:18', '2005-08-08T17:59:18', '2'), + ('111', '1305', '2006-02-16T02:30:53', '2005-06-20T15:53:59', '2005-06-27T10:54:59', '2'), + ('281', '2974', '2006-02-16T02:30:53', '2005-07-08T19:05:34', '2005-07-17T15:05:34', '2'), + ('360', '2546', '2006-02-16T02:30:53', '2005-08-22T19:56:41', '2005-08-24T16:32:41', '2'), + ('511', '441', '2006-02-16T02:30:53', '2005-07-11T18:50:55', '2005-07-13T22:46:55', '2'), + ('472', '3578', '2006-02-16T02:30:53', '2005-08-17T15:51:35', '2005-08-26T20:26:35', '2'), + ('264', '1037', '2006-02-16T02:30:53', '2005-08-01T21:44:24', '2005-08-02T19:48:24', '2'), + ('34', '183', '2006-02-16T02:30:53', '2005-07-30T11:17:33', '2005-08-06T15:16:33', '2'), + ('535', '414', '2006-02-16T02:30:53', '2005-07-30T21:40:15', '2005-08-04T15:45:15', '2'), + ('321', '1551', '2006-02-16T02:30:53', '2005-07-06T20:26:40', '2005-07-15T15:00:40', '2'), + ('149', '3876', '2006-02-16T02:30:53', '2005-07-26T23:18:35', '2005-08-05T01:44:35', '2'), + ('569', '1039', '2006-02-16T02:30:53', '2005-07-30T01:29:48', '2005-07-31T21:33:48', '2'), + ('269', '2148', '2006-02-16T02:30:53', '2005-07-12T00:25:04', '2005-07-13T04:52:04', '2'), + ('546', '2011', '2006-02-16T02:30:53', '2005-07-12T16:32:33', '2005-07-16T12:42:33', '2'), + ('593', '1818', '2006-02-16T02:30:53', '2005-07-08T16:06:55', '2005-07-16T11:22:55', '2'), + ('470', '3345', '2006-02-16T02:30:53', '2005-07-11T12:12:17', '2005-07-18T07:40:17', '2'), + ('45', '367', '2006-02-16T02:30:53', '2005-08-01T11:22:20', '2005-08-04T13:18:20', '2'), + ('90', '2363', '2006-02-16T02:30:53', '2005-07-30T18:02:25', '2005-07-31T12:30:25', '2'), + ('407', '4126', '2006-02-16T02:30:53', '2005-07-28T23:04:10', '2005-08-05T00:06:10', '2'), + ('416', '1559', '2006-02-16T02:30:53', '2005-08-21T05:18:57', '2005-08-22T00:12:57', '2'), + ('1', '1092', '2006-02-16T02:30:53', '2005-07-28T09:04:45', '2005-07-30T12:37:45', '2'), + ('123', '829', '2006-02-16T02:30:53', '2005-06-19T05:43:43', '2005-06-25T03:41:43', '2'), + ('526', '955', '2006-02-16T02:30:53', '2005-07-12T11:48:48', '2005-07-19T16:55:48', '2'), + ('93', '4323', '2006-02-16T02:30:53', '2005-08-02T14:18:22', '2005-08-07T09:35:22', '2'), + ('339', '4291', '2006-02-16T02:30:53', '2005-08-19T14:53:22', '2005-08-27T19:03:22', '2'), + ('535', '1543', '2006-02-16T02:30:53', '2005-08-01T04:44:13', '2005-08-08T00:20:13', '2'), + ('537', '3468', '2006-02-16T02:30:53', '2005-06-18T01:10:36', '2005-06-21T05:59:36', '2'), + ('20', '1094', '2006-02-16T02:30:53', '2005-08-01T14:59:50', '2005-08-07T11:38:50', '2'), + ('45', '2569', '2006-02-16T02:30:53', '2005-07-09T10:07:27', '2005-07-17T10:18:27', '2'), + ('64', '1508', '2006-02-16T02:30:53', '2005-07-07T15:38:25', '2005-07-13T16:23:25', '2'), + ('174', '241', '2006-02-16T02:30:53', '2005-08-19T14:22:30', '2005-08-20T10:13:30', '2'), + ('460', '4192', '2006-02-16T02:30:53', '2005-07-06T15:35:26', '2005-07-11T12:22:26', '2'), + ('459', '2751', '2006-02-16T02:30:53', '2005-08-20T18:28:46', '2005-08-26T17:37:46', '2'), + ('67', '3220', '2006-02-16T02:30:53', '2005-08-20T14:19:03', '2005-08-22T16:25:03', '2'), + ('243', '2493', '2006-02-16T02:30:53', '2005-08-21T21:02:55', '2005-08-25T20:20:55', '2'), + ('96', '2757', '2006-02-16T02:30:53', '2005-07-31T06:09:53', '2005-08-08T00:50:53', '2'), + ('292', '4203', '2006-02-16T02:30:53', '2005-07-29T23:03:40', '2005-08-06T23:23:40', '2'), + ('174', '1073', '2006-02-16T02:30:53', '2005-07-30T16:34:29', '2005-07-31T18:41:29', '2'), + ('465', '4014', '2006-02-16T02:30:53', '2005-06-15T12:12:42', '2005-06-20T12:38:42', '2'), + ('269', '2930', '2006-02-16T02:30:53', '2005-07-28T14:07:46', '2005-08-01T11:28:46', '2'), + ('383', '2610', '2006-02-16T02:30:53', '2005-06-16T22:22:17', '2005-06-25T23:23:17', '2'), + ('377', '829', '2006-02-16T02:30:53', '2005-07-06T17:17:57', '2005-07-10T23:10:57', '2'), + ('37', '2057', '2006-02-16T02:30:53', '2005-08-21T15:15:03', '2005-08-25T17:41:03', '2'), + ('598', '286', '2006-02-16T02:30:53', '2005-06-20T10:10:29', '2005-06-28T15:48:29', '2'), + ('180', '911', '2006-02-16T02:30:53', '2005-07-08T17:44:25', '2005-07-16T20:14:25', '2'), + ('527', '4474', '2006-02-16T02:30:53', '2005-06-19T01:58:39', '2005-06-19T22:17:39', '2'), + ('260', '2740', '2006-02-16T02:30:53', '2005-07-27T11:23:09', '2005-08-01T12:42:09', '2'), + ('251', '1959', '2006-02-16T02:30:53', '2005-08-21T07:06:20', '2005-08-22T01:39:20', '2'), + ('64', '4419', '2006-02-16T02:30:53', '2005-07-12T12:45:00', '2005-07-16T11:16:00', '2'), + ('519', '1591', '2006-02-16T02:30:53', '2005-05-31T07:48:07', '2005-06-05T08:51:07', '2'), + ('37', '965', '2006-02-16T02:30:53', '2005-08-19T09:21:10', '2005-08-26T13:00:10', '2'), + ('132', '681', '2006-02-16T02:30:53', '2005-07-06T10:18:01', '2005-07-09T09:07:01', '2'), + ('413', '3516', '2006-02-16T02:30:53', '2005-08-02T01:53:59', '2005-08-03T04:36:59', '2'), + ('359', '350', '2006-02-16T02:30:53', '2005-05-26T19:21:44', '2005-06-04T14:18:44', '2'), + ('51', '344', '2006-02-16T02:30:53', '2005-07-29T09:05:06', '2005-08-06T05:48:06', '2'), + ('86', '715', '2006-02-16T02:30:53', '2005-08-01T13:58:47', '2005-08-06T13:38:47', '2'), + ('353', '1772', '2006-02-16T02:30:53', '2005-08-02T19:43:07', '2005-08-07T15:22:07', '2'), + ('514', '3893', '2006-02-16T02:30:53', '2005-08-20T22:11:46', '2005-08-22T20:26:46', '2'), + ('252', '753', '2006-02-16T02:30:53', '2005-06-15T16:21:04', '2005-06-23T12:52:04', '2'), + ('303', '4068', '2006-02-16T02:30:53', '2005-06-18T03:27:03', '2005-06-27T09:19:03', '2'), + ('142', '4458', '2006-02-16T02:30:53', '2005-08-02T02:52:18', '2005-08-06T01:23:18', '2'), + ('168', '948', '2006-02-16T02:30:53', '2005-07-11T19:20:44', '2005-07-19T18:49:44', '2'), + ('10', '3834', '2006-02-16T02:30:53', '2005-06-18T03:26:23', '2005-06-26T08:50:23', '2'), + ('125', '595', '2006-02-16T02:30:53', '2005-07-11T03:59:08', '2005-07-18T05:35:08', '2'), + ('241', '433', '2006-02-16T02:30:53', '2005-08-19T10:15:19', '2005-08-21T06:51:19', '2'), + ('9', '762', '2006-02-16T02:30:53', '2005-08-18T05:58:40', '2005-08-20T02:20:40', '2'), + ('196', '2994', '2006-02-16T02:30:53', '2005-07-09T18:04:29', '2005-07-15T17:46:29', '2'), + ('227', '1639', '2006-02-16T02:30:53', '2005-07-09T03:34:57', '2005-07-17T22:36:57', '2'), + ('75', '3802', '2006-02-16T02:30:53', '2005-07-28T23:11:45', '2005-08-03T21:57:45', '2'), + ('186', '2524', '2006-02-16T02:30:53', '2005-06-15T09:36:19', '2005-06-17T13:54:19', '2'), + ('159', '3972', '2006-02-16T02:30:53', '2005-07-12T20:56:04', '2005-07-15T19:21:04', '2'), + ('384', '3497', '2006-02-16T02:30:53', '2005-05-30T09:26:19', '2005-06-01T10:45:19', '2'), + ('529', '1270', '2006-02-16T02:30:53', '2005-08-21T23:37:47', '2005-08-24T00:23:47', '2'), + ('212', '213', '2006-02-16T02:30:53', '2005-06-19T15:58:38', '2005-06-27T15:01:38', '2'), + ('468', '3384', '2006-02-16T02:30:53', '2005-08-21T07:49:53', '2005-08-30T05:52:53', '2'), + ('150', '3760', '2006-02-16T02:30:53', '2005-08-18T17:37:11', '2005-08-19T14:59:11', '2'), + ('289', '167', '2006-02-16T02:30:53', '2005-08-18T14:52:35', '2005-08-26T09:45:35', '2'), + ('347', '3439', '2006-02-16T02:30:53', '2005-07-10T15:56:20', '2005-07-12T19:59:20', '2'), + ('394', '2704', '2006-02-16T02:30:53', '2005-08-19T09:24:49', '2005-08-24T11:06:49', '2'), + ('410', '441', '2006-02-16T02:30:53', '2005-07-30T00:24:05', '2005-08-03T19:48:05', '2'), + ('7', '3123', '2006-02-16T02:30:53', '2005-07-11T10:36:28', '2005-07-18T16:19:28', '2'), + ('231', '1525', '2006-02-16T02:30:53', '2005-07-31T08:06:41', '2005-08-02T10:30:41', '2'), + ('90', '2849', '2006-02-16T02:30:53', '2005-08-01T19:07:08', '2005-08-04T14:09:08', '2'), + ('272', '4301', '2006-02-16T02:30:53', '2005-08-02T05:03:05', '2005-08-05T10:48:05', '2'), + ('457', '713', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('38', '1963', '2006-02-16T02:30:53', '2005-08-23T09:02:04', '2005-08-29T03:17:04', '2'), + ('195', '622', '2006-02-16T02:30:53', '2005-07-09T12:26:01', '2005-07-14T13:31:01', '2'), + ('7', '3109', '2006-02-16T02:30:53', '2005-05-30T21:07:15', '2005-06-03T01:48:15', '2'), + ('340', '3618', '2006-02-16T02:30:53', '2005-08-21T21:39:25', '2005-08-26T22:07:25', '2'), + ('218', '2562', '2006-02-16T02:30:53', '2005-08-20T17:46:06', '2005-08-29T23:44:06', '2'), + ('417', '1254', '2006-02-16T02:30:53', '2005-05-28T17:24:51', '2005-06-05T20:05:51', '2'), + ('590', '4495', '2006-02-16T02:30:53', '2005-07-30T09:44:15', '2005-08-02T11:02:15', '2'), + ('382', '2108', '2006-02-16T02:30:53', '2005-07-31T02:11:16', '2005-08-03T06:58:16', '2'), + ('553', '1352', '2006-02-16T02:30:53', '2005-07-30T15:05:22', '2005-08-05T10:02:22', '2'), + ('265', '375', '2006-02-16T02:30:53', '2005-07-29T08:58:03', '2005-08-02T07:50:03', '2'), + ('272', '3226', '2006-02-16T02:30:53', '2005-06-16T06:14:25', '2005-06-17T03:53:25', '2'), + ('312', '852', '2006-02-16T02:30:53', '2005-08-02T00:08:39', '2005-08-05T00:58:39', '2'), + ('168', '241', '2006-02-16T02:30:53', '2005-07-30T21:00:52', '2005-08-08T15:56:52', '2'), + ('392', '4268', '2006-02-16T02:30:53', '2005-08-17T22:45:26', '2005-08-24T01:47:26', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['2434', '4870', '1952', '5752', '9232', '2428', '13672', '3548', '12258', '13619', '7989', '7492', '5615', '7338', '3242', '965', '1843', '14687', '11151', '14932', '15670', '13986', '76', '5056', '15435', '15001', '15496', '1445', '11341', '5255', '1060', '1257', '9482', '7158', '11033', '3622', '3170', '2941', '11189', '3988', '10779', '1770', '5962', '154', '11535', '11246', '5298', '4379', '10177', '3505', '11814', '14574', '4542', '9657', '14132', '13317', '7698', '4425', '3929', '349', '4578', '5011', '12719', '7995', '10500', '2432', '6620', '3060', '13817', '5156', '8875', '3223', '4569', '7105', '10711', '5850', '8122', '3891', '9564', '7282', '14415', '10853', '2724', '7122', '98', '9774', '7551', '5725', '7834', '627', '4981', '14329', '836', '14870', '4742', '11424', '1025', '10419', '538', '10298']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('12', '3739', '2006-02-16T02:30:53', '2005-06-18T18:11:51', '2005-06-23T12:52:51', '2'), + ('260', '3089', '2006-02-16T02:30:53', '2005-07-08T19:14:45', '2005-07-12T18:58:45', '2'), + ('338', '1823', '2006-02-16T02:30:53', '2005-06-17T08:33:02', '2005-06-21T14:00:02', '2'), + ('86', '4444', '2006-02-16T02:30:53', '2005-07-10T12:27:38', '2005-07-18T09:22:38', '2'), + ('502', '1991', '2006-02-16T02:30:53', '2005-07-30T13:43:00', '2005-08-02T11:39:00', '2'), + ('241', '3892', '2006-02-16T02:30:53', '2005-06-18T17:47:34', '2005-06-19T14:39:34', '2'), + ('201', '2068', '2006-02-16T02:30:53', '2005-08-20T08:27:27', '2005-08-22T06:15:27', '2'), + ('16', '4498', '2006-02-16T02:30:53', '2005-07-06T02:23:39', '2005-07-08T07:53:39', '2'), + ('83', '2861', '2006-02-16T02:30:53', '2005-08-18T04:11:13', '2005-08-21T23:40:13', '2'), + ('365', '1068', '2006-02-16T02:30:53', '2005-08-20T06:39:26', '2005-08-23T05:22:26', '2'), + ('149', '3196', '2006-02-16T02:30:53', '2005-07-28T14:39:05', '2005-08-05T13:58:05', '2'), + ('155', '908', '2006-02-16T02:30:53', '2005-07-27T19:54:18', '2005-07-31T15:36:18', '2'), + ('173', '1521', '2006-02-16T02:30:53', '2005-07-10T05:18:51', '2005-07-17T11:05:51', '2'), + ('251', '107', '2006-02-16T02:30:53', '2005-07-27T14:13:34', '2005-08-03T18:36:34', '2'), + ('562', '1421', '2006-02-16T02:30:53', '2005-06-21T02:56:24', '2005-06-29T21:41:24', '2'), + ('502', '3363', '2006-02-16T02:30:53', '2005-05-30T19:00:14', '2005-05-31T17:10:14', '2'), + ('132', '2714', '2006-02-16T02:30:53', '2005-06-16T23:53:42', '2005-06-22T18:33:42', '2'), + ('550', '306', '2006-02-16T02:30:53', '2005-08-21T20:32:16', '2005-08-26T16:17:16', '2'), + ('391', '3939', '2006-02-16T02:30:53', '2005-08-02T09:52:44', '2005-08-05T06:29:44', '2'), + ('516', '2259', '2006-02-16T02:30:53', '2005-08-22T05:40:39', '2005-08-23T11:02:39', '2'), + ('211', '2834', '2006-02-16T02:30:53', '2005-08-23T09:07:11', '2005-08-31T04:32:11', '2'), + ('152', '3701', '2006-02-16T02:30:53', '2005-08-20T19:13:23', '2005-08-22T20:59:23', '2'), + ('1', '3021', '2006-02-16T02:30:53', '2005-05-25T11:30:37', '2005-06-03T12:00:37', '2'), + ('526', '2599', '2006-02-16T02:30:53', '2005-07-09T04:13:45', '2005-07-10T06:17:45', '2'), + ('468', '2103', '2006-02-16T02:30:53', '2005-08-23T00:28:19', '2005-08-26T00:44:19', '2'), + ('186', '2869', '2006-02-16T02:30:53', '2005-08-22T08:00:49', '2005-08-27T05:53:49', '2'), + ('275', '1863', '2006-02-16T02:30:53', '2005-08-23T02:30:23', '2005-08-31T03:31:23', '2'), + ('537', '3189', '2006-02-16T02:30:53', '2005-06-15T19:10:07', '2005-06-19T20:27:07', '2'), + ('15', '3586', '2006-02-16T02:30:53', '2005-08-02T17:09:24', '2005-08-09T19:48:24', '2'), + ('313', '4418', '2006-02-16T02:30:53', '2005-07-09T13:51:08', '2005-07-17T13:58:08', '2'), + ('570', '2676', '2006-02-16T02:30:53', '2005-05-31T08:21:43', '2005-06-09T04:02:43', '2'), + ('267', '1938', '2006-02-16T02:30:53', '2005-06-15T06:15:36', '2005-06-21T01:04:36', '2'), + ('348', '2421', '2006-02-16T02:30:53', '2005-07-30T23:29:16', '2005-08-02T20:37:16', '2'), + ('38', '2432', '2006-02-16T02:30:53', '2005-07-27T07:23:58', '2005-08-03T06:00:58', '2'), + ('155', '3323', '2006-02-16T02:30:53', '2005-08-02T05:54:17', '2005-08-09T10:50:17', '2'), + ('454', '3489', '2006-02-16T02:30:53', '2005-07-06T06:05:04', '2005-07-12T03:14:04', '2'), + ('421', '1306', '2006-02-16T02:30:53', '2005-06-20T22:02:54', '2005-06-29T00:41:54', '2'), + ('135', '3632', '2006-02-16T02:30:53', '2005-06-20T05:22:18', '2005-06-26T07:40:18', '2'), + ('565', '729', '2006-02-16T02:30:53', '2005-08-02T11:17:23', '2005-08-09T16:30:23', '2'), + ('421', '2981', '2006-02-16T02:30:53', '2005-07-06T23:30:42', '2005-07-13T03:06:42', '2'), + ('578', '2092', '2006-02-16T02:30:53', '2005-08-01T21:11:54', '2005-08-09T21:00:54', '2'), + ('359', '1681', '2006-02-16T02:30:53', '2005-06-16T18:07:55', '2005-06-23T23:49:55', '2'), + ('507', '1292', '2006-02-16T02:30:53', '2005-07-10T23:45:22', '2005-07-13T03:49:22', '2'), + ('185', '1354', '2006-02-16T02:30:53', '2005-05-26T00:55:56', '2005-05-29T23:18:56', '2'), + ('356', '1649', '2006-02-16T02:30:53', '2005-08-17T00:39:54', '2005-08-24T20:46:54', '2'), + ('550', '3577', '2006-02-16T02:30:53', '2005-08-02T13:33:56', '2005-08-03T08:52:56', '2'), + ('149', '3491', '2006-02-16T02:30:53', '2005-07-09T15:36:17', '2005-07-18T19:07:17', '2'), + ('316', '2773', '2006-02-16T02:30:53', '2005-07-07T20:32:30', '2005-07-11T20:40:30', '2'), + ('279', '2242', '2006-02-16T02:30:53', '2005-07-31T23:42:33', '2005-08-03T01:30:33', '2'), + ('331', '2630', '2006-02-16T02:30:53', '2005-07-06T00:19:32', '2005-07-14T20:14:32', '2'), + ('509', '3462', '2006-02-16T02:30:53', '2005-08-17T12:09:20', '2005-08-25T16:56:20', '2'), + ('62', '1611', '2006-02-16T02:30:53', '2005-08-21T16:50:34', '2005-08-26T14:24:34', '2'), + ('293', '4169', '2006-02-16T02:30:53', '2005-07-08T04:06:30', '2005-07-16T06:54:30', '2'), + ('402', '2681', '2006-02-16T02:30:53', '2005-07-31T06:00:41', '2005-08-06T06:51:41', '2'), + ('91', '3806', '2006-02-16T02:30:53', '2005-08-21T01:43:58', '2005-08-26T20:16:58', '2'), + ('20', '3349', '2006-02-16T02:30:53', '2005-08-19T19:25:42', '2005-08-20T20:57:42', '2'), + ('561', '3650', '2006-02-16T02:30:53', '2005-07-28T03:44:14', '2005-08-04T03:44:14', '2'), + ('345', '877', '2006-02-16T02:30:53', '2005-07-07T22:22:44', '2005-07-08T22:23:44', '2'), + ('453', '1235', '2006-02-16T02:30:53', '2005-07-06T20:52:39', '2005-07-12T00:27:39', '2'), + ('36', '2920', '2006-02-16T02:30:53', '2005-05-27T04:53:11', '2005-05-28T06:33:11', '2'), + ('497', '1533', '2006-02-16T02:30:53', '2005-07-08T06:00:17', '2005-07-10T06:58:17', '2'), + ('249', '463', '2006-02-16T02:30:53', '2005-07-09T01:44:40', '2005-07-11T00:58:40', '2'), + ('87', '1094', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('89', '536', '2006-02-16T02:30:53', '2005-07-28T15:00:09', '2005-08-01T12:33:09', '2'), + ('477', '469', '2006-02-16T02:30:53', '2005-08-01T11:01:01', '2005-08-06T08:59:01', '2'), + ('250', '4420', '2006-02-16T02:30:53', '2005-06-18T17:59:18', '2005-06-25T15:19:18', '2'), + ('337', '2362', '2006-02-16T02:30:53', '2005-07-12T08:51:03', '2005-07-16T03:59:03', '2'), + ('446', '2075', '2006-02-16T02:30:53', '2005-06-20T13:47:20', '2005-06-25T16:00:20', '2'), + ('293', '1935', '2006-02-16T02:30:53', '2005-08-20T13:15:30', '2005-08-22T18:48:30', '2'), + ('5', '416', '2006-02-16T02:30:53', '2005-07-09T08:51:42', '2005-07-15T03:59:42', '2'), + ('121', '1294', '2006-02-16T02:30:53', '2005-07-30T00:15:09', '2005-08-04T02:54:09', '2'), + ('299', '1033', '2006-02-16T02:30:53', '2005-06-21T02:06:45', '2005-06-22T07:16:45', '2'), + ('366', '2925', '2006-02-16T02:30:53', '2005-07-08T05:30:51', '2005-07-14T04:14:51', '2'), + ('15', '864', '2006-02-16T02:30:53', '2005-07-27T05:15:37', '2005-07-28T05:49:37', '2'), + ('400', '4278', '2006-02-16T02:30:53', '2005-08-01T18:45:09', '2005-08-02T19:47:09', '2'), + ('531', '4015', '2006-02-16T02:30:53', '2005-07-10T17:36:27', '2005-07-15T16:44:27', '2'), + ('18', '2141', '2006-02-16T02:30:53', '2005-07-28T19:27:37', '2005-07-29T19:48:37', '2'), + ('553', '3216', '2006-02-16T02:30:53', '2005-07-06T18:58:25', '2005-07-09T23:20:25', '2'), + ('377', '383', '2006-02-16T02:30:53', '2005-07-31T02:31:37', '2005-08-03T22:57:37', '2'), + ('276', '4418', '2006-02-16T02:30:53', '2005-07-27T12:00:19', '2005-08-04T14:48:19', '2'), + ('561', '2670', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('41', '2682', '2006-02-16T02:30:53', '2005-08-02T00:00:54', '2005-08-10T05:37:54', '2'), + ('103', '3879', '2006-02-16T02:30:53', '2005-06-19T14:57:54', '2005-06-22T16:31:54', '2'), + ('172', '1699', '2006-02-16T02:30:53', '2005-07-27T06:03:18', '2005-08-04T10:43:18', '2'), + ('269', '2970', '2006-02-16T02:30:53', '2005-05-25T16:48:24', '2005-05-27T11:29:24', '2'), + ('306', '4174', '2006-02-16T02:30:53', '2005-07-31T09:57:51', '2005-08-02T09:08:51', '2'), + ('304', '2635', '2006-02-16T02:30:53', '2005-07-27T21:59:15', '2005-07-31T19:54:15', '2'), + ('426', '4293', '2006-02-16T02:30:53', '2005-07-10T11:21:21', '2005-07-14T05:34:21', '2'), + ('278', '4124', '2006-02-16T02:30:53', '2005-07-28T08:46:43', '2005-07-31T07:09:43', '2'), + ('241', '425', '2006-02-16T02:30:53', '2005-05-28T17:04:43', '2005-06-04T19:58:43', '2'), + ('399', '3363', '2006-02-16T02:30:53', '2005-07-09T00:29:29', '2005-07-16T19:06:29', '2'), + ('6', '3544', '2006-02-16T02:30:53', '2005-08-21T08:22:56', '2005-08-28T02:22:56', '2'), + ('368', '3140', '2006-02-16T02:30:53', '2005-05-29T23:56:42', '2005-05-31T04:11:42', '2'), + ('512', '2170', '2006-02-16T02:30:53', '2005-08-22T03:23:20', '2005-08-23T06:50:20', '2'), + ('340', '3022', '2006-02-16T02:30:53', '2005-07-08T13:35:23', '2005-07-11T10:24:23', '2'), + ('84', '1030', '2006-02-16T02:30:53', '2005-08-02T19:57:42', '2005-08-10T16:57:42', '2'), + ('93', '1618', '2006-02-16T02:30:53', '2005-05-31T03:41:37', '2005-06-08T07:05:37', '2'), + ('66', '415', '2006-02-16T02:30:53', '2005-08-01T08:13:22', '2005-08-06T04:45:22', '2'), + ('110', '2262', '2006-02-16T02:30:53', '2005-05-28T06:21:05', '2005-06-02T01:22:05', '2'), + ('323', '1383', '2006-02-16T02:30:53', '2005-08-01T04:06:03', '2005-08-05T05:59:03', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['10383', '5992', '13174', '14654', '12835', '4077', '5049', '15036', '6476', '11642', '12361', '9548', '3508', '6660', '14478', '6516', '5574', '4389', '13856', '14392', '12348', '2462', '12976', '1023', '14031', '7104', '6270', '7848', '13616', '5332', '15797', '1619', '6190', '8691', '4551', '9755', '782', '3582', '4294', '4318', '6233', '5942', '13274', '4456', '15848', '1826', '12008', '8676', '5539', '15365', '9242', '2607', '8935', '6405', '9628', '9518', '11742', '9137', '984', '5658', '7072', '9152', '4558', '8635', '15808', '8690', '3779', '10140', '959', '14254', '3252', '10431', '12829', '14787', '11638', '8970', '7249', '13615', '10593', '3417', '186', '14251', '3897', '12234', '4937', '13029', '3348', '451', '8836', '8262', '12701', '9816', '449', '14684', '15171', '12288', '4139', '4689', '10361', '12824']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('592', '4166', '2006-02-16T02:30:53', '2005-08-01T06:37:16', '2005-08-03T07:36:16', '2'), + ('54', '4216', '2006-02-16T02:30:53', '2005-07-11T01:06:21', '2005-07-13T19:15:21', '2'), + ('482', '2303', '2006-02-16T02:30:53', '2005-08-19T13:52:50', '2005-08-22T14:43:50', '2'), + ('173', '687', '2006-02-16T02:30:53', '2005-08-21T19:36:59', '2005-08-23T22:03:59', '2'), + ('124', '1477', '2006-02-16T02:30:53', '2005-08-19T01:47:45', '2005-08-26T00:58:45', '2'), + ('377', '2445', '2006-02-16T02:30:53', '2005-07-07T04:53:40', '2005-07-09T09:56:40', '2'), + ('144', '3336', '2006-02-16T02:30:53', '2005-07-09T03:54:12', '2005-07-11T22:39:12', '2'), + ('280', '874', '2006-02-16T02:30:53', '2005-08-22T09:36:00', '2005-08-23T08:12:00', '2'), + ('28', '978', '2006-02-16T02:30:53', '2005-07-12T01:37:48', '2005-07-12T20:21:48', '2'), + ('25', '3790', '2006-02-16T02:30:53', '2005-08-17T04:48:05', '2005-08-18T01:53:05', '2'), + ('250', '1418', '2006-02-16T02:30:53', '2005-08-18T07:47:31', '2005-08-22T12:08:31', '2'), + ('576', '3038', '2006-02-16T02:30:53', '2005-07-31T01:54:19', '2005-08-05T00:50:19', '2'), + ('34', '2381', '2006-02-16T02:30:53', '2005-07-06T00:24:25', '2005-07-10T05:38:25', '2'), + ('598', '446', '2006-02-16T02:30:53', '2005-07-12T11:20:12', '2005-07-20T12:58:12', '2'), + ('231', '2990', '2006-02-16T02:30:53', '2005-08-21T13:33:28', '2005-08-25T13:33:28', '2'), + ('291', '863', '2006-02-16T02:30:53', '2005-07-12T03:51:54', '2005-07-14T03:41:54', '2'), + ('163', '2307', '2006-02-16T02:30:53', '2005-07-10T03:54:38', '2005-07-19T07:20:38', '2'), + ('166', '1672', '2006-02-16T02:30:53', '2005-07-07T20:58:58', '2005-07-13T19:57:58', '2'), + ('407', '4196', '2006-02-16T02:30:53', '2005-08-20T14:49:32', '2005-08-29T12:37:32', '2'), + ('586', '847', '2006-02-16T02:30:53', '2005-08-21T10:19:25', '2005-08-28T15:57:25', '2'), + ('186', '434', '2006-02-16T02:30:53', '2005-08-18T07:21:47', '2005-08-25T04:41:47', '2'), + ('468', '2151', '2006-02-16T02:30:53', '2005-06-18T20:00:15', '2005-06-21T21:54:15', '2'), + ('592', '66', '2006-02-16T02:30:53', '2005-08-19T06:52:58', '2005-08-26T11:23:58', '2'), + ('227', '2483', '2006-02-16T02:30:53', '2005-05-31T03:26:50', '2005-06-05T08:19:50', '2'), + ('361', '440', '2006-02-16T02:30:53', '2005-08-20T21:24:24', '2005-08-23T21:47:24', '2'), + ('217', '118', '2006-02-16T02:30:53', '2005-07-27T05:15:25', '2005-08-01T05:36:25', '2'), + ('292', '2308', '2006-02-16T02:30:53', '2005-07-11T15:59:10', '2005-07-18T10:29:10', '2'), + ('509', '162', '2006-02-16T02:30:53', '2005-07-28T09:24:31', '2005-08-05T05:11:31', '2'), + ('194', '1694', '2006-02-16T02:30:53', '2005-08-20T06:30:33', '2005-08-27T09:29:33', '2'), + ('568', '3269', '2006-02-16T02:30:53', '2005-07-09T16:59:23', '2005-07-10T16:01:23', '2'), + ('503', '497', '2006-02-16T02:30:53', '2005-08-23T14:13:47', '2005-08-25T09:16:47', '2'), + ('232', '4258', '2006-02-16T02:30:53', '2005-06-16T07:14:13', '2005-06-19T05:50:13', '2'), + ('321', '2564', '2006-02-16T02:30:53', '2005-07-11T11:36:18', '2005-07-19T17:05:18', '2'), + ('446', '672', '2006-02-16T02:30:53', '2005-07-29T16:41:23', '2005-08-02T12:32:23', '2'), + ('494', '1160', '2006-02-16T02:30:53', '2005-07-08T04:36:21', '2005-07-17T10:23:21', '2'), + ('108', '86', '2006-02-16T02:30:53', '2005-07-31T09:24:55', '2005-08-07T06:00:55', '2'), + ('596', '2255', '2006-02-16T02:30:53', '2005-05-29T14:38:57', '2005-06-02T13:18:57', '2'), + ('297', '1866', '2006-02-16T02:30:53', '2005-07-06T04:10:35', '2005-07-11T01:29:35', '2'), + ('41', '2845', '2006-02-16T02:30:53', '2005-07-07T15:56:23', '2005-07-15T14:50:23', '2'), + ('321', '1607', '2006-02-16T02:30:53', '2005-07-07T17:47:50', '2005-07-14T12:15:50', '2'), + ('378', '3731', '2006-02-16T02:30:53', '2005-07-11T14:10:47', '2005-07-15T15:13:47', '2'), + ('317', '2861', '2006-02-16T02:30:53', '2005-07-10T22:47:17', '2005-07-17T01:54:17', '2'), + ('272', '704', '2006-02-16T02:30:53', '2005-08-19T17:50:03', '2005-08-20T14:39:03', '2'), + ('421', '3395', '2006-02-16T02:30:53', '2005-07-07T23:45:21', '2005-07-13T23:03:21', '2'), + ('336', '2141', '2006-02-16T02:30:53', '2005-08-23T15:41:12', '2005-08-26T10:29:12', '2'), + ('578', '421', '2006-02-16T02:30:53', '2005-06-16T21:53:52', '2005-06-25T18:46:52', '2'), + ('562', '865', '2006-02-16T02:30:53', '2005-08-17T19:16:18', '2005-08-18T14:24:18', '2'), + ('533', '283', '2006-02-16T02:30:53', '2005-07-29T15:59:06', '2005-08-05T19:12:06', '2'), + ('90', '3217', '2006-02-16T02:30:53', '2005-07-10T02:42:58', '2005-07-16T02:27:58', '2'), + ('327', '3382', '2006-02-16T02:30:53', '2005-08-22T21:42:17', '2005-09-01T03:14:17', '2'), + ('306', '755', '2006-02-16T02:30:53', '2005-07-30T14:03:58', '2005-08-02T18:09:58', '2'), + ('340', '3922', '2006-02-16T02:30:53', '2005-06-19T06:55:01', '2005-06-25T03:21:01', '2'), + ('76', '285', '2006-02-16T02:30:53', '2005-07-30T02:38:45', '2005-08-02T07:11:45', '2'), + ('357', '3983', '2006-02-16T02:30:53', '2005-07-11T22:53:12', '2005-07-18T23:02:12', '2'), + ('565', '1387', '2006-02-16T02:30:53', '2005-07-31T04:51:11', '2005-07-31T23:11:11', '2'), + ('215', '2714', '2006-02-16T02:30:53', '2005-07-31T00:43:26', '2005-08-04T19:12:26', '2'), + ('470', '596', '2006-02-16T02:30:53', '2005-08-17T08:48:43', '2005-08-23T07:18:43', '2'), + ('459', '840', '2006-02-16T02:30:53', '2005-07-30T10:09:24', '2005-08-06T04:30:24', '2'), + ('262', '2305', '2006-02-16T02:30:53', '2005-05-30T22:17:17', '2005-06-01T20:15:17', '2'), + ('165', '4402', '2006-02-16T02:30:53', '2005-07-10T07:34:08', '2005-07-19T04:21:08', '2'), + ('260', '3899', '2006-02-16T02:30:53', '2005-07-27T04:02:33', '2005-07-28T09:26:33', '2'), + ('595', '3607', '2006-02-16T02:30:53', '2005-07-30T10:51:27', '2005-07-31T06:38:27', '2'), + ('448', '828', '2006-02-16T02:30:53', '2005-07-08T04:55:26', '2005-07-09T10:53:26', '2'), + ('383', '2894', '2006-02-16T02:30:53', '2005-07-29T14:22:48', '2005-08-01T11:59:48', '2'), + ('446', '1663', '2006-02-16T02:30:53', '2005-08-23T14:38:37', '2005-08-27T14:45:37', '2'), + ('291', '1292', '2006-02-16T02:30:53', '2005-07-29T16:39:28', '2005-08-01T14:03:28', '2'), + ('583', '634', '2006-02-16T02:30:53', '2005-07-06T13:46:36', '2005-07-10T15:49:36', '2'), + ('550', '2494', '2006-02-16T02:30:53', '2005-07-31T22:03:20', '2005-08-07T23:15:20', '2'), + ('535', '3108', '2006-02-16T02:30:53', '2005-05-30T18:07:00', '2005-06-02T14:37:00', '2'), + ('589', '1549', '2006-02-16T02:30:53', '2005-08-21T05:51:28', '2005-08-29T06:05:28', '2'), + ('213', '2009', '2006-02-16T02:30:53', '2005-06-21T03:25:26', '2005-06-24T00:38:26', '2'), + ('138', '1074', '2006-02-16T02:30:53', '2005-08-01T08:41:54', '2005-08-07T09:44:54', '2'), + ('326', '1129', '2006-02-16T02:30:53', '2005-08-19T01:38:18', '2005-08-25T22:23:18', '2'), + ('38', '2634', '2006-02-16T02:30:53', '2005-08-22T00:25:59', '2005-08-28T22:30:59', '2'), + ('152', '3421', '2006-02-16T02:30:53', '2005-08-17T04:39:09', '2005-08-25T06:42:09', '2'), + ('313', '2940', '2006-02-16T02:30:53', '2005-07-30T04:02:05', '2005-08-07T03:40:05', '2'), + ('425', '2441', '2006-02-16T02:30:53', '2005-07-27T10:39:53', '2005-07-28T14:48:53', '2'), + ('539', '1864', '2006-02-16T02:30:53', '2005-08-20T06:28:53', '2005-08-27T11:40:53', '2'), + ('144', '1886', '2006-02-16T02:30:53', '2005-08-01T14:13:19', '2005-08-06T08:48:19', '2'), + ('282', '874', '2006-02-16T02:30:53', '2005-06-21T17:06:20', '2005-06-23T17:00:20', '2'), + ('468', '1799', '2006-02-16T02:30:53', '2005-05-26T05:32:52', '2005-06-03T07:19:52', '2'), + ('486', '139', '2006-02-16T02:30:53', '2005-08-21T05:42:20', '2005-08-26T06:20:20', '2'), + ('277', '14', '2006-02-16T02:30:53', '2005-07-06T19:11:43', '2005-07-11T21:50:43', '2'), + ('352', '3823', '2006-02-16T02:30:53', '2005-08-18T03:17:33', '2005-08-25T04:44:33', '2'), + ('273', '33', '2006-02-16T02:30:53', '2005-07-08T22:29:59', '2005-07-15T21:51:59', '2'), + ('293', '3283', '2006-02-16T02:30:53', '2005-08-19T08:28:04', '2005-08-22T12:25:04', '2'), + ('16', '2945', '2006-02-16T02:30:53', '2005-06-21T11:16:42', '2005-06-27T13:50:42', '2'), + ('87', '205', '2006-02-16T02:30:53', '2005-05-27T19:27:54', '2005-05-29T01:07:54', '2'), + ('14', '3265', '2006-02-16T02:30:53', '2005-07-29T22:46:08', '2005-08-02T19:53:08', '2'), + ('563', '1341', '2006-02-16T02:30:53', '2005-07-29T01:11:18', '2005-08-02T05:17:18', '2'), + ('489', '2337', '2006-02-16T02:30:53', '2005-08-18T20:26:47', '2005-08-26T23:36:47', '2'), + ('3', '4560', '2006-02-16T02:30:53', '2005-07-31T11:32:58', '2005-08-04T17:12:58', '2'), + ('172', '2469', '2006-02-16T02:30:53', '2005-05-27T19:13:15', '2005-06-04T01:08:15', '2'), + ('369', '3593', '2006-02-16T02:30:53', '2005-08-21T20:28:26', '2005-08-28T19:01:26', '2'), + ('119', '1201', '2006-02-16T02:30:53', '2005-08-22T15:23:59', '2005-08-28T12:05:59', '2'), + ('523', '4401', '2006-02-16T02:30:53', '2005-08-18T05:01:20', '2005-08-25T09:51:20', '2'), + ('509', '2094', '2006-02-16T02:30:53', '2005-07-07T08:17:35', '2005-07-14T14:01:35', '2'), + ('364', '2519', '2006-02-16T02:30:53', '2005-07-08T11:03:47', '2005-07-16T06:07:47', '2'), + ('529', '318', '2006-02-16T02:30:53', '2005-08-01T05:53:49', '2005-08-10T00:42:49', '2'), + ('247', '1875', '2006-02-16T02:30:53', '2005-08-19T01:18:00', '2005-08-22T01:12:00', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['13280', '6581', '3721', '13988', '14588', '1714', '15705', '11859', '1717', '9479', '10324', '2015', '4193', '11577', '12377', '6260', '7229', '8928', '3026', '6974', '8891', '10545', '4284', '2256', '15090', '11518', '8777', '12353', '1969', '14256', '12649', '15092', '12172', '6707', '14513', '9892', '11007', '865', '5010', '5064', '4175', '9930', '2606', '4664', '10454', '7316', '14951', '8571', '2489', '8822', '12580', '6078', '4306', '3590', '15211', '370', '2475', '6120', '932', '11321', '6746', '14067', '9718', '13237', '3840', '2538', '1018', '12295', '5986', '1243', '662', '5028', '7133', '7178', '2433', '2681', '4872', '14007', '13924', '10427', '5605', '5876', '129', '8846', '13819', '7399', '5140', '10520', '42', '14688', '672', '239', '3914', '6236', '2034', '6501', '1250', '14751', '6421', '222']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('368', '218', '2006-02-16T02:30:53', '2005-08-19T18:02:51', '2005-08-21T23:17:51', '2'), + ('468', '2121', '2006-02-16T02:30:53', '2005-07-12T06:26:49', '2005-07-14T05:07:49', '2'), + ('226', '2654', '2006-02-16T02:30:53', '2005-07-06T11:10:09', '2005-07-11T07:45:09', '2'), + ('466', '3567', '2006-02-16T02:30:53', '2005-08-20T19:21:28', '2005-08-21T22:20:28', '2'), + ('219', '1350', '2006-02-16T02:30:53', '2005-08-21T17:25:53', '2005-08-28T21:47:53', '2'), + ('477', '535', '2006-02-16T02:30:53', '2005-06-16T14:29:59', '2005-06-24T17:27:59', '2'), + ('356', '936', '2006-02-16T02:30:53', '2005-08-23T10:32:52', '2005-08-29T13:18:52', '2'), + ('144', '423', '2006-02-16T02:30:53', '2005-08-17T13:51:20', '2005-08-21T13:47:20', '2'), + ('277', '3007', '2006-02-16T02:30:53', '2005-06-16T14:47:16', '2005-06-19T10:11:16', '2'), + ('308', '3461', '2006-02-16T02:30:53', '2005-07-30T23:22:09', '2005-07-31T22:26:09', '2'), + ('25', '523', '2006-02-16T02:30:53', '2005-08-01T04:49:06', '2005-08-09T08:04:06', '2'), + ('484', '3776', '2006-02-16T02:30:53', '2005-06-17T12:16:29', '2005-06-18T14:40:29', '2'), + ('445', '3791', '2006-02-16T02:30:53', '2005-07-07T10:57:21', '2005-07-09T07:33:21', '2'), + ('219', '4106', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('31', '4564', '2006-02-16T02:30:53', '2005-08-18T08:26:05', '2005-08-23T02:51:05', '2'), + ('454', '4308', '2006-02-16T02:30:53', '2005-07-11T15:26:29', '2005-07-13T17:37:29', '2'), + ('182', '978', '2006-02-16T02:30:53', '2005-07-27T10:00:54', '2005-07-28T13:58:54', '2'), + ('366', '706', '2006-02-16T02:30:53', '2005-07-30T02:18:19', '2005-08-05T00:49:19', '2'), + ('347', '4032', '2006-02-16T02:30:53', '2005-06-20T11:48:00', '2005-06-21T12:51:00', '2'), + ('122', '2924', '2006-02-16T02:30:53', '2005-07-27T00:39:16', '2005-08-04T01:59:16', '2'), + ('435', '4093', '2006-02-16T02:30:53', '2005-07-30T00:46:55', '2005-08-06T23:32:55', '2'), + ('425', '4230', '2006-02-16T02:30:53', '2005-08-01T12:37:46', '2005-08-04T16:02:46', '2'), + ('521', '1313', '2006-02-16T02:30:53', '2005-07-07T15:31:57', '2005-07-09T10:20:57', '2'), + ('93', '1863', '2006-02-16T02:30:53', '2005-06-18T05:21:56', '2005-06-27T02:06:56', '2'), + ('582', '2918', '2006-02-16T02:30:53', '2005-08-22T11:34:33', '2005-08-31T06:09:33', '2'), + ('407', '3297', '2006-02-16T02:30:53', '2005-08-16T23:59:49', '2005-08-17T22:51:49', '2'), + ('382', '2462', '2006-02-16T02:30:53', '2005-07-29T20:10:21', '2005-07-30T20:32:21', '2'), + ('141', '1594', '2006-02-16T02:30:53', '2005-08-18T07:33:08', '2005-08-21T03:42:08', '2'), + ('337', '4450', '2006-02-16T02:30:53', '2005-06-17T09:22:22', '2005-06-21T05:31:22', '2'), + ('331', '2922', '2006-02-16T02:30:53', '2005-08-21T05:52:27', '2005-08-29T02:10:27', '2'), + ('530', '3201', '2006-02-16T02:30:53', '2005-08-18T18:31:47', '2005-08-22T21:07:47', '2'), + ('464', '2418', '2006-02-16T02:30:53', '2005-08-22T11:36:16', '2005-08-28T09:49:16', '2'), + ('226', '1162', '2006-02-16T02:30:53', '2005-08-18T01:07:00', '2005-08-22T21:01:00', '2'), + ('80', '406', '2006-02-16T02:30:53', '2005-07-12T13:07:55', '2005-07-16T16:26:55', '2'), + ('185', '4265', '2006-02-16T02:30:53', '2005-08-21T14:51:35', '2005-08-24T13:24:35', '2'), + ('251', '1045', '2006-02-16T02:30:53', '2005-07-31T14:06:25', '2005-08-03T18:11:25', '2'), + ('98', '4172', '2006-02-16T02:30:53', '2005-08-02T05:05:53', '2005-08-05T01:56:53', '2'), + ('154', '3183', '2006-02-16T02:30:53', '2005-05-30T03:39:44', '2005-06-07T08:10:44', '2'), + ('574', '1999', '2006-02-16T02:30:53', '2005-07-09T01:33:23', '2005-07-14T04:00:23', '2'), + ('512', '373', '2006-02-16T02:30:53', '2005-07-09T04:38:51', '2005-07-18T00:33:51', '2'), + ('8', '1979', '2006-02-16T02:30:53', '2005-07-07T10:02:03', '2005-07-10T06:09:03', '2'), + ('304', '4491', '2006-02-16T02:30:53', '2005-07-31T15:18:03', '2005-08-01T12:36:03', '2'), + ('364', '4133', '2006-02-16T02:30:53', '2005-06-19T06:51:32', '2005-06-21T03:15:32', '2'), + ('546', '1318', '2006-02-16T02:30:53', '2005-07-08T10:01:28', '2005-07-12T10:37:28', '2'), + ('9', '397', '2006-02-16T02:30:53', '2005-08-01T09:14:00', '2005-08-04T04:52:00', '2'), + ('114', '3344', '2006-02-16T02:30:53', '2005-07-27T13:19:03', '2005-07-28T07:43:03', '2'), + ('197', '2800', '2006-02-16T02:30:53', '2005-08-22T06:19:37', '2005-08-30T05:51:37', '2'), + ('407', '1778', '2006-02-16T02:30:53', '2005-07-29T11:48:39', '2005-08-03T06:35:39', '2'), + ('382', '4012', '2006-02-16T02:30:53', '2005-06-18T22:00:44', '2005-06-22T02:06:44', '2'), + ('35', '744', '2006-02-16T02:30:53', '2005-07-29T22:20:21', '2005-08-06T03:00:21', '2'), + ('53', '1197', '2006-02-16T02:30:53', '2005-08-18T15:49:08', '2005-08-24T11:03:08', '2'), + ('91', '3985', '2006-02-16T02:30:53', '2005-07-11T05:06:52', '2005-07-17T06:13:52', '2'), + ('210', '1219', '2006-02-16T02:30:53', '2005-07-07T17:12:32', '2005-07-16T11:24:32', '2'), + ('283', '1510', '2006-02-16T02:30:53', '2005-07-06T04:35:12', '2005-07-10T05:14:12', '2'), + ('410', '3025', '2006-02-16T02:30:53', '2005-08-22T16:40:21', '2005-08-28T13:33:21', '2'), + ('22', '3347', '2006-02-16T02:30:53', '2005-05-27T07:49:43', '2005-06-05T06:39:43', '2'), + ('336', '889', '2006-02-16T02:30:53', '2005-06-18T20:52:46', '2005-06-21T19:40:46', '2'), + ('268', '3299', '2006-02-16T02:30:53', '2005-07-11T07:49:53', '2005-07-19T04:56:53', '2'), + ('198', '719', '2006-02-16T02:30:53', '2005-05-30T12:55:36', '2005-05-31T10:30:36', '2'), + ('266', '205', '2006-02-16T02:30:53', '2005-08-02T16:15:07', '2005-08-04T20:35:07', '2'), + ('537', '3127', '2006-02-16T02:30:53', '2005-07-12T14:33:01', '2005-07-17T19:52:01', '2'), + ('259', '1376', '2006-02-16T02:30:53', '2005-08-20T22:49:23', '2005-08-29T22:28:23', '2'), + ('23', '2747', '2006-02-16T02:30:53', '2005-07-31T08:25:03', '2005-08-08T04:16:03', '2'), + ('169', '1272', '2006-02-16T02:30:53', '2005-08-19T16:18:36', '2005-08-25T15:22:36', '2'), + ('468', '4384', '2006-02-16T02:30:53', '2005-07-06T16:30:59', '2005-07-15T22:08:59', '2'), + ('472', '1287', '2006-02-16T02:30:53', '2005-06-19T01:56:59', '2005-06-25T00:54:59', '2'), + ('594', '1930', '2006-02-16T02:30:53', '2005-05-31T02:53:42', '2005-06-03T00:47:42', '2'), + ('532', '1651', '2006-02-16T02:30:53', '2005-08-18T05:15:46', '2005-08-26T02:23:46', '2'), + ('171', '1624', '2006-02-16T02:30:53', '2005-07-11T00:54:56', '2005-07-13T22:52:56', '2'), + ('107', '2629', '2006-02-16T02:30:53', '2005-06-15T05:07:32', '2005-06-21T08:17:32', '2'), + ('166', '2968', '2006-02-16T02:30:53', '2005-05-28T21:09:31', '2005-06-01T19:00:31', '2'), + ('30', '4531', '2006-02-16T02:30:53', '2005-07-09T02:34:45', '2005-07-14T20:45:45', '2'), + ('496', '2995', '2006-02-16T02:30:53', '2005-07-27T06:29:23', '2005-07-29T03:20:23', '2'), + ('31', '1899', '2006-02-16T02:30:53', '2005-07-27T08:09:25', '2005-07-29T13:00:25', '2'), + ('356', '937', '2006-02-16T02:30:53', '2005-06-18T18:10:17', '2005-06-23T14:46:17', '2'), + ('196', '2704', '2006-02-16T02:30:53', '2005-06-19T12:15:27', '2005-06-21T16:48:27', '2'), + ('103', '1836', '2006-02-16T02:30:53', '2005-07-08T19:23:16', '2005-07-10T14:17:16', '2'), + ('284', '374', '2006-02-16T02:30:53', '2005-08-20T20:22:47', '2005-08-28T20:40:47', '2'), + ('444', '3066', '2006-02-16T02:30:53', '2005-08-20T17:05:18', '2005-08-23T16:54:18', '2'), + ('356', '2978', '2006-02-16T02:30:53', '2005-08-01T08:30:11', '2005-08-07T06:18:11', '2'), + ('273', '2964', '2006-02-16T02:30:53', '2005-07-10T05:06:45', '2005-07-15T02:51:45', '2'), + ('578', '4445', '2006-02-16T02:30:53', '2005-07-10T19:07:15', '2005-07-14T17:29:15', '2'), + ('23', '4154', '2006-02-16T02:30:53', '2005-05-25T21:20:03', '2005-06-04T01:25:03', '2'), + ('108', '2912', '2006-02-16T02:30:53', '2005-07-29T23:10:28', '2005-08-03T22:07:28', '2'), + ('296', '1459', '2006-02-16T02:30:53', '2005-08-20T13:23:15', '2005-08-22T16:02:15', '2'), + ('526', '1682', '2006-02-16T02:30:53', '2005-07-27T16:16:02', '2005-08-03T18:02:02', '2'), + ('303', '947', '2006-02-16T02:30:53', '2005-07-09T08:04:59', '2005-07-11T08:28:59', '2'), + ('543', '4396', '2006-02-16T02:30:53', '2005-08-01T11:45:58', '2005-08-06T17:28:58', '2'), + ('523', '380', '2006-02-16T02:30:53', '2005-05-25T05:24:58', '2005-05-31T02:47:58', '2'), + ('219', '2573', '2006-02-16T02:30:53', '2005-08-21T20:32:37', '2005-08-27T00:06:37', '2'), + ('306', '697', '2006-02-16T02:30:53', '2005-05-28T22:05:29', '2005-06-06T02:10:29', '2'), + ('49', '131', '2006-02-16T02:30:53', '2005-05-26T12:30:26', '2005-06-01T13:26:26', '2'), + ('159', '4092', '2006-02-16T02:30:53', '2005-07-06T20:11:10', '2005-07-14T14:42:10', '2'), + ('338', '3813', '2006-02-16T02:30:53', '2005-07-11T14:18:17', '2005-07-14T08:47:17', '2'), + ('587', '1512', '2006-02-16T02:30:53', '2005-06-17T13:27:16', '2005-06-22T08:53:16', '2'), + ('219', '2851', '2006-02-16T02:30:53', '2005-07-12T03:11:55', '2005-07-16T02:08:55', '2'), + ('38', '4360', '2006-02-16T02:30:53', '2005-06-15T05:55:40', '2005-06-23T03:11:40', '2'), + ('195', '1156', '2006-02-16T02:30:53', '2005-08-21T23:11:23', '2005-08-30T20:01:23', '2'), + ('479', '4477', '2006-02-16T02:30:53', '2005-07-11T23:45:25', '2005-07-15T20:45:25', '2'), + ('83', '2745', '2006-02-16T02:30:53', '2005-05-26T10:14:38', '2005-05-31T08:36:38', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['5473', '4827', '12037', '1929', '15566', '4967', '8236', '14826', '7437', '7493', '4744', '3148', '4846', '107', '9778', '13435', '12665', '717', '10359', '9867', '1871', '3143', '14962', '2531', '6009', '3046', '4363', '4226', '3015', '78', '3276', '8698', '1451', '2598', '15315', '1637', '13058', '11225', '8338', '14423', '12785', '604', '409', '15925', '11177', '1106', '8656', '11200', '5369', '4056', '5682', '4159', '14119', '3266', '2774', '7766', '11942', '3364', '7427', '12839', '3228', '15136', '6232', '9041', '5568', '15533', '4741', '7232', '14447', '13140', '4648', '5327', '2425', '729', '10831', '10364', '6124', '14348', '10235', '1577', '14936', '9116', '6589', '11796', '1668', '9190', '13404', '5785', '13959', '1094', '13198', '9697', '3307', '15831', '2305', '14863', '14085', '12747', '9919', '4001']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('51', '4283', '2006-02-16T02:30:53', '2005-07-09T23:19:11', '2005-07-19T02:30:11', '2'), + ('110', '4455', '2006-02-16T02:30:53', '2005-07-08T17:46:30', '2005-07-11T14:12:30', '2'), + ('356', '766', '2006-02-16T02:30:53', '2005-08-17T20:21:35', '2005-08-22T17:16:35', '2'), + ('327', '573', '2006-02-16T02:30:53', '2005-06-17T06:49:30', '2005-06-22T12:07:30', '2'), + ('76', '4344', '2006-02-16T02:30:53', '2005-08-23T05:17:23', '2005-09-01T08:09:23', '2'), + ('339', '108', '2006-02-16T02:30:53', '2005-07-08T23:48:03', '2005-07-15T23:51:03', '2'), + ('369', '1901', '2006-02-16T02:30:53', '2005-07-29T00:27:04', '2005-07-31T05:02:04', '2'), + ('426', '4023', '2006-02-16T02:30:53', '2005-08-22T01:32:14', '2005-08-23T03:52:14', '2'), + ('135', '2617', '2006-02-16T02:30:53', '2005-07-27T17:39:18', '2005-07-28T18:33:18', '2'), + ('177', '2868', '2006-02-16T02:30:53', '2005-07-27T19:55:46', '2005-08-02T19:46:46', '2'), + ('507', '2948', '2006-02-16T02:30:53', '2005-07-08T13:43:57', '2005-07-12T09:21:57', '2'), + ('202', '4490', '2006-02-16T02:30:53', '2005-06-20T20:27:18', '2005-06-24T20:30:18', '2'), + ('556', '417', '2006-02-16T02:30:53', '2005-07-08T18:29:05', '2005-07-10T22:33:05', '2'), + ('317', '2833', '2006-02-16T02:30:53', '2005-05-25T18:28:09', '2005-06-03T22:46:09', '2'), + ('230', '304', '2006-02-16T02:30:53', '2005-07-31T10:02:04', '2005-08-04T07:44:04', '2'), + ('30', '3919', '2006-02-16T02:30:53', '2005-08-19T23:35:44', '2005-08-24T18:14:44', '2'), + ('410', '1701', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('412', '1383', '2006-02-16T02:30:53', '2005-05-29T04:37:44', '2005-05-30T05:48:44', '2'), + ('369', '259', '2006-02-16T02:30:53', '2005-08-01T05:52:21', '2005-08-06T05:52:21', '2'), + ('83', '2485', '2006-02-16T02:30:53', '2005-07-31T13:17:04', '2005-08-05T07:17:04', '2'), + ('204', '481', '2006-02-16T02:30:53', '2005-06-17T02:25:12', '2005-06-23T03:16:12', '2'), + ('215', '1355', '2006-02-16T02:30:53', '2005-06-20T20:01:52', '2005-06-26T19:26:52', '2'), + ('449', '3104', '2006-02-16T02:30:53', '2005-08-22T06:37:43', '2005-08-29T03:44:43', '2'), + ('368', '768', '2006-02-16T02:30:53', '2005-06-19T01:20:49', '2005-06-22T01:50:49', '2'), + ('470', '494', '2006-02-16T02:30:53', '2005-07-11T01:51:58', '2005-07-18T07:12:58', '2'), + ('559', '471', '2006-02-16T02:30:53', '2005-06-20T12:42:59', '2005-06-26T17:40:59', '2'), + ('168', '3202', '2006-02-16T02:30:53', '2005-07-07T19:43:28', '2005-07-13T00:15:28', '2'), + ('57', '1692', '2006-02-16T02:30:53', '2005-07-07T12:37:56', '2005-07-09T08:48:56', '2'), + ('23', '1311', '2006-02-16T02:30:53', '2005-06-20T10:48:56', '2005-06-26T11:30:56', '2'), + ('135', '4067', '2006-02-16T02:30:53', '2005-05-25T11:35:18', '2005-05-31T12:48:18', '2'), + ('425', '1890', '2006-02-16T02:30:53', '2005-06-21T05:35:52', '2005-06-29T03:26:52', '2'), + ('324', '2973', '2006-02-16T02:30:53', '2005-07-29T16:52:17', '2005-08-04T13:20:17', '2'), + ('18', '3560', '2006-02-16T02:30:53', '2005-06-15T19:30:18', '2005-06-19T19:22:18', '2'), + ('265', '2079', '2006-02-16T02:30:53', '2005-06-19T05:59:57', '2005-06-24T11:44:57', '2'), + ('1', '312', '2006-02-16T02:30:53', '2005-08-22T20:03:46', '2005-08-30T01:51:46', '2'), + ('212', '906', '2006-02-16T02:30:53', '2005-06-16T08:29:58', '2005-06-23T04:55:58', '2'), + ('24', '2437', '2006-02-16T02:30:53', '2005-08-19T09:40:53', '2005-08-26T05:48:53', '2'), + ('159', '3721', '2006-02-16T02:30:53', '2005-08-02T12:43:27', '2005-08-04T18:41:27', '2'), + ('389', '2257', '2006-02-16T02:30:53', '2005-07-29T04:40:39', '2005-08-07T04:40:39', '2'), + ('521', '2873', '2006-02-16T02:30:53', '2005-08-21T11:23:59', '2005-08-26T11:52:59', '2'), + ('145', '4190', '2006-02-16T02:30:53', '2005-08-19T00:05:49', '2005-08-21T04:39:49', '2'), + ('426', '1585', '2006-02-16T02:30:53', '2005-05-28T14:37:07', '2005-06-03T11:03:07', '2'), + ('220', '3652', '2006-02-16T02:30:53', '2005-05-27T14:10:58', '2005-06-02T10:40:58', '2'), + ('440', '3394', '2006-02-16T02:30:53', '2005-08-23T18:15:06', '2005-08-26T18:09:06', '2'), + ('2', '1149', '2006-02-16T02:30:53', '2005-08-02T10:43:48', '2005-08-10T10:55:48', '2'), + ('109', '4185', '2006-02-16T02:30:53', '2005-05-31T14:36:52', '2005-06-01T14:33:52', '2'), + ('460', '1385', '2006-02-16T02:30:53', '2005-07-29T15:05:52', '2005-07-31T20:57:52', '2'), + ('98', '2730', '2006-02-16T02:30:53', '2005-08-02T11:48:36', '2005-08-07T08:35:36', '2'), + ('538', '1550', '2006-02-16T02:30:53', '2005-07-09T18:42:16', '2005-07-12T18:16:16', '2'), + ('360', '4211', '2006-02-16T02:30:53', '2005-07-07T03:57:36', '2005-07-09T08:53:36', '2'), + ('302', '17', '2006-02-16T02:30:53', '2005-07-10T08:51:39', '2005-07-12T14:44:39', '2'), + ('62', '3625', '2006-02-16T02:30:53', '2005-07-07T09:10:57', '2005-07-09T10:19:57', '2'), + ('53', '129', '2006-02-16T02:30:53', '2005-08-21T01:15:59', '2005-08-27T23:36:59', '2'), + ('175', '2533', '2006-02-16T02:30:53', '2005-06-21T04:49:07', '2005-06-26T05:19:07', '2'), + ('299', '2809', '2006-02-16T02:30:53', '2005-06-19T18:05:11', '2005-06-21T16:21:11', '2'), + ('292', '2774', '2006-02-16T02:30:53', '2005-07-28T06:41:57', '2005-08-06T11:21:57', '2'), + ('576', '4094', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('201', '2329', '2006-02-16T02:30:53', '2005-06-21T12:37:46', '2005-06-28T07:18:46', '2'), + ('442', '2548', '2006-02-16T02:30:53', '2005-07-27T17:20:16', '2005-08-03T20:38:16', '2'), + ('360', '1970', '2006-02-16T02:30:53', '2005-08-19T01:53:43', '2005-08-28T02:27:43', '2'), + ('535', '2489', '2006-02-16T02:30:53', '2005-06-21T02:20:24', '2005-06-29T00:50:24', '2'), + ('435', '2606', '2006-02-16T02:30:53', '2005-08-22T13:19:25', '2005-08-24T07:28:25', '2'), + ('590', '2492', '2006-02-16T02:30:53', '2005-07-11T14:08:27', '2005-07-20T19:34:27', '2'), + ('454', '1103', '2006-02-16T02:30:53', '2005-07-30T06:32:36', '2005-08-01T10:28:36', '2'), + ('424', '1130', '2006-02-16T02:30:53', '2005-07-10T03:36:56', '2005-07-11T08:35:56', '2'), + ('400', '1895', '2006-02-16T02:30:53', '2005-08-23T03:54:39', '2005-08-26T08:27:39', '2'), + ('260', '516', '2006-02-16T02:30:53', '2005-07-08T13:31:23', '2005-07-17T12:02:23', '2'), + ('306', '1147', '2006-02-16T02:30:53', '2005-07-27T10:04:19', '2005-07-28T09:43:19', '2'), + ('584', '1889', '2006-02-16T02:30:53', '2005-08-21T12:12:05', '2005-08-27T14:47:05', '2'), + ('323', '4210', '2006-02-16T02:30:53', '2005-08-19T12:35:56', '2005-08-27T18:24:56', '2'), + ('444', '3490', '2006-02-16T02:30:53', '2005-07-08T09:31:27', '2005-07-13T03:55:27', '2'), + ('547', '3657', '2006-02-16T02:30:53', '2005-07-09T16:39:49', '2005-07-12T18:47:49', '2'), + ('579', '2630', '2006-02-16T02:30:53', '2005-06-18T17:37:45', '2005-06-27T18:40:45', '2'), + ('323', '1688', '2006-02-16T02:30:53', '2005-05-29T06:35:13', '2005-06-04T03:23:13', '2'), + ('78', '1496', '2006-02-16T02:30:53', '2005-08-01T23:22:45', '2005-08-07T01:05:45', '2'), + ('317', '1842', '2006-02-16T02:30:53', '2005-08-01T06:06:49', '2005-08-09T06:05:49', '2'), + ('368', '2022', '2006-02-16T02:30:53', '2005-07-11T08:02:32', '2005-07-12T05:58:32', '2'), + ('496', '885', '2006-02-16T02:30:53', '2005-08-21T08:54:26', '2005-08-24T02:55:26', '2'), + ('30', '2850', '2006-02-16T02:30:53', '2005-08-01T01:57:48', '2005-08-10T07:38:48', '2'), + ('327', '367', '2006-02-16T02:30:53', '2005-06-16T04:03:28', '2005-06-24T22:40:28', '2'), + ('241', '3710', '2006-02-16T02:30:53', '2005-08-22T05:51:26', '2005-08-29T10:21:26', '2'), + ('446', '2917', '2006-02-16T02:30:53', '2005-07-30T09:19:41', '2005-08-03T08:01:41', '2'), + ('424', '1595', '2006-02-16T02:30:53', '2005-07-12T07:06:29', '2005-07-14T12:06:29', '2'), + ('435', '3983', '2006-02-16T02:30:53', '2005-08-17T11:16:47', '2005-08-18T16:55:47', '2'), + ('569', '2483', '2006-02-16T02:30:53', '2005-06-16T10:19:52', '2005-06-23T12:22:52', '2'), + ('177', '4421', '2006-02-16T02:30:53', '2005-07-30T12:24:17', '2005-08-03T07:41:17', '2'), + ('414', '416', '2006-02-16T02:30:53', '2005-08-19T22:18:42', '2005-08-23T16:29:42', '2'), + ('211', '142', '2006-02-16T02:30:53', '2005-07-10T14:06:03', '2005-07-17T17:59:03', '2'), + ('142', '2283', '2006-02-16T02:30:53', '2005-08-20T18:16:21', '2005-08-22T13:56:21', '2'), + ('547', '3810', '2006-02-16T02:30:53', '2005-05-31T13:03:49', '2005-06-05T14:30:49', '2'), + ('169', '4273', '2006-02-16T02:30:53', '2005-08-19T14:47:18', '2005-08-21T18:09:18', '2'), + ('479', '762', '2006-02-16T02:30:53', '2005-07-31T07:23:11', '2005-08-05T08:04:11', '2'), + ('85', '462', '2006-02-16T02:30:53', '2005-06-21T07:52:30', '2005-06-25T02:36:30', '2'), + ('401', '3123', '2006-02-16T02:30:53', '2005-08-23T15:21:19', '2005-08-24T15:47:19', '2'), + ('149', '622', '2006-02-16T02:30:53', '2005-06-18T08:31:18', '2005-06-24T06:18:18', '2'), + ('440', '779', '2006-02-16T02:30:53', '2005-08-22T02:57:04', '2005-08-30T03:24:04', '2'), + ('471', '3506', '2006-02-16T02:30:53', '2005-08-20T23:46:24', '2005-08-29T02:31:24', '2'), + ('549', '4075', '2006-02-16T02:30:53', '2005-08-18T22:28:22', '2005-08-22T22:25:22', '2'), + ('291', '3205', '2006-02-16T02:30:53', '2005-07-31T14:55:46', '2005-08-08T11:43:46', '2'), + ('120', '864', '2006-02-16T02:30:53', '2005-07-07T00:07:00', '2005-07-13T21:27:00', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['10314', '4305', '5038', '13921', '7001', '11290', '7420', '1237', '7590', '3863', '9705', '6971', '2728', '9759', '13896', '2946', '10375', '2048', '927', '9090', '6401', '4272', '9542', '10391', '13318', '7463', '15165', '1747', '12133', '5995', '3648', '13188', '9392', '4369', '8015', '12564', '14210', '13733', '9669', '11629', '3845', '906', '15295', '15821', '4029', '8610', '4760', '6883', '2421', '11079', '9123', '5194', '6492', '2116', '10285', '2360', '1311', '3626', '8055', '6051', '9621', '13744', '5754', '2488', '11038', '13276', '6788', '5693', '1155', '6070', '9522', '8131', '2793', '14133', '10603', '10966', '5448', '2907', '14375', '8622', '1626', '7204', '4759', '15443', '15398', '11853', '1143', '15485', '12539', '1135', '7201', '8930', '5073', '12331', '3119', '7376', '3597', '13835', '4502', '5282']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('252', '1548', '2006-02-16T02:30:53', '2005-08-01T04:31:18', '2005-08-06T01:49:18', '2'), + ('240', '3926', '2006-02-16T02:30:53', '2005-07-07T17:07:11', '2005-07-08T16:15:11', '2'), + ('10', '3086', '2006-02-16T02:30:53', '2005-07-09T03:12:52', '2005-07-17T22:27:52', '2'), + ('59', '3943', '2006-02-16T02:30:53', '2005-08-20T16:57:11', '2005-08-22T19:25:11', '2'), + ('240', '1460', '2006-02-16T02:30:53', '2005-07-27T01:25:34', '2005-07-31T23:30:34', '2'), + ('582', '425', '2006-02-16T02:30:53', '2005-08-02T14:57:44', '2005-08-09T19:36:44', '2'), + ('547', '3505', '2006-02-16T02:30:53', '2005-07-27T17:09:39', '2005-07-30T12:30:39', '2'), + ('49', '3249', '2006-02-16T02:30:53', '2005-06-15T04:44:10', '2005-06-23T07:00:10', '2'), + ('73', '2152', '2006-02-16T02:30:53', '2005-07-27T23:24:24', '2005-07-28T19:53:24', '2'), + ('481', '363', '2006-02-16T02:30:53', '2005-07-06T17:40:18', '2005-07-07T17:58:18', '2'), + ('28', '4158', '2006-02-16T02:30:53', '2005-07-31T07:40:33', '2005-08-01T03:50:33', '2'), + ('366', '3493', '2006-02-16T02:30:53', '2005-07-27T00:26:17', '2005-08-01T03:59:17', '2'), + ('408', '775', '2006-02-16T02:30:53', '2005-06-19T15:04:04', '2005-06-22T12:22:04', '2'), + ('574', '2950', '2006-02-16T02:30:53', '2005-07-31T09:25:57', '2005-08-07T12:56:57', '2'), + ('278', '1338', '2006-02-16T02:30:53', '2005-08-20T15:59:56', '2005-08-21T20:14:56', '2'), + ('213', '3737', '2006-02-16T02:30:53', '2005-06-20T05:50:40', '2005-06-21T00:42:40', '2'), + ('202', '857', '2006-02-16T02:30:53', '2005-08-01T06:26:22', '2005-08-06T02:51:22', '2'), + ('454', '2055', '2006-02-16T02:30:53', '2005-06-17T14:55:29', '2005-06-23T16:29:29', '2'), + ('167', '1158', '2006-02-16T02:30:53', '2005-05-30T12:16:40', '2005-05-31T16:20:40', '2'), + ('104', '3426', '2006-02-16T02:30:53', '2005-07-30T08:24:42', '2005-08-08T06:17:42', '2'), + ('35', '1427', '2006-02-16T02:30:53', '2005-07-11T22:44:34', '2005-07-12T22:18:34', '2'), + ('120', '488', '2006-02-16T02:30:53', '2005-07-07T14:39:20', '2005-07-13T08:57:20', '2'), + ('595', '2243', '2006-02-16T02:30:53', '2005-07-31T01:41:48', '2005-08-01T00:49:48', '2'), + ('357', '2203', '2006-02-16T02:30:53', '2005-08-01T06:49:05', '2005-08-04T01:51:05', '2'), + ('413', '1389', '2006-02-16T02:30:53', '2005-08-19T19:33:57', '2005-08-21T17:52:57', '2'), + ('284', '3676', '2006-02-16T02:30:53', '2005-07-27T18:48:32', '2005-07-29T23:54:32', '2'), + ('168', '3664', '2006-02-16T02:30:53', '2005-08-22T14:59:30', '2005-08-29T15:46:30', '2'), + ('273', '1661', '2006-02-16T02:30:53', '2005-06-16T16:53:33', '2005-06-25T21:48:33', '2'), + ('132', '1958', '2006-02-16T02:30:53', '2005-08-17T23:47:16', '2005-08-19T03:46:16', '2'), + ('360', '4357', '2006-02-16T02:30:53', '2005-07-11T01:15:39', '2005-07-20T05:01:39', '2'), + ('598', '2810', '2006-02-16T02:30:53', '2005-07-06T07:30:41', '2005-07-10T06:00:41', '2'), + ('472', '583', '2006-02-16T02:30:53', '2005-08-19T14:27:03', '2005-08-28T09:15:03', '2'), + ('29', '2797', '2006-02-16T02:30:53', '2005-07-30T19:50:13', '2005-08-03T22:38:13', '2'), + ('517', '3552', '2006-02-16T02:30:53', '2005-07-07T20:01:38', '2005-07-13T01:19:38', '2'), + ('23', '1814', '2006-02-16T02:30:53', '2005-07-28T15:33:03', '2005-07-30T15:32:03', '2'), + ('348', '263', '2006-02-16T02:30:53', '2005-08-18T15:11:35', '2005-08-22T11:45:35', '2'), + ('468', '1867', '2006-02-16T02:30:53', '2005-08-21T04:28:02', '2005-08-24T02:14:02', '2'), + ('85', '3994', '2006-02-16T02:30:53', '2005-08-20T10:25:12', '2005-08-21T10:49:12', '2'), + ('277', '4496', '2006-02-16T02:30:53', '2005-07-31T06:31:36', '2005-08-08T03:05:36', '2'), + ('299', '786', '2006-02-16T02:30:53', '2005-08-17T04:27:24', '2005-08-26T10:25:24', '2'), + ('28', '4495', '2006-02-16T02:30:53', '2005-07-06T16:38:14', '2005-07-09T14:59:14', '2'), + ('549', '1862', '2006-02-16T02:30:53', '2005-05-30T10:30:38', '2005-06-07T06:44:38', '2'), + ('186', '2164', '2006-02-16T02:30:53', '2005-08-22T19:36:21', '2005-08-31T00:07:21', '2'), + ('233', '1714', '2006-02-16T02:30:53', '2005-08-23T15:03:58', '2005-08-24T17:46:58', '2'), + ('518', '4075', '2006-02-16T02:30:53', '2005-07-07T02:19:44', '2005-07-15T02:30:44', '2'), + ('563', '4222', '2006-02-16T02:30:53', '2005-07-29T13:25:02', '2005-08-03T08:10:02', '2'), + ('177', '3718', '2006-02-16T02:30:53', '2005-07-08T14:48:07', '2005-07-10T12:41:07', '2'), + ('596', '468', '2006-02-16T02:30:53', '2005-07-12T20:50:48', '2005-07-19T16:00:48', '2'), + ('26', '3524', '2006-02-16T02:30:53', '2005-06-18T17:25:05', '2005-06-23T21:09:05', '2'), + ('29', '3185', '2006-02-16T02:30:53', '2005-08-02T07:29:10', '2005-08-07T01:59:10', '2'), + ('293', '3748', '2006-02-16T02:30:53', '2005-07-30T09:39:15', '2005-08-02T08:12:15', '2'), + ('202', '3809', '2006-02-16T02:30:53', '2005-07-09T10:31:34', '2005-07-15T08:50:34', '2'), + ('590', '466', '2006-02-16T02:30:53', '2005-07-12T02:28:40', '2005-07-17T05:58:40', '2'), + ('24', '2373', '2006-02-16T02:30:53', '2005-06-17T20:16:12', '2005-06-18T17:03:12', '2'), + ('167', '4523', '2006-02-16T02:30:53', '2005-08-01T03:35:11', '2005-08-05T03:55:11', '2'), + ('57', '37', '2006-02-16T02:30:53', '2005-06-18T13:11:13', '2005-06-23T15:32:13', '2'), + ('326', '3114', '2006-02-16T02:30:53', '2005-06-15T10:11:59', '2005-06-17T08:44:59', '2'), + ('337', '1599', '2006-02-16T02:30:53', '2005-07-06T06:15:35', '2005-07-10T10:18:35', '2'), + ('304', '4162', '2006-02-16T02:30:53', '2005-07-28T17:02:32', '2005-07-31T22:05:32', '2'), + ('435', '2675', '2006-02-16T02:30:53', '2005-07-11T03:46:41', '2005-07-11T22:36:41', '2'), + ('38', '325', '2006-02-16T02:30:53', '2005-07-31T04:21:08', '2005-08-08T03:50:08', '2'), + ('408', '2962', '2006-02-16T02:30:53', '2005-08-20T10:51:45', '2005-08-25T06:42:45', '2'), + ('291', '162', '2006-02-16T02:30:53', '2005-07-10T12:32:43', '2005-07-12T13:11:43', '2'), + ('403', '1338', '2006-02-16T02:30:53', '2005-06-18T21:38:26', '2005-06-24T02:08:26', '2'), + ('403', '4452', '2006-02-16T02:30:53', '2005-08-02T05:59:42', '2005-08-08T04:37:42', '2'), + ('516', '625', '2006-02-16T02:30:53', '2005-08-19T17:53:42', '2005-08-28T20:49:42', '2'), + ('460', '1162', '2006-02-16T02:30:53', '2005-07-12T16:33:44', '2005-07-20T15:38:44', '2'), + ('208', '2167', '2006-02-16T02:30:53', '2005-07-10T09:35:43', '2005-07-12T08:05:43', '2'), + ('251', '2048', '2006-02-16T02:30:53', '2005-05-31T22:17:11', '2005-06-04T20:27:11', '2'), + ('267', '1679', '2006-02-16T02:30:53', '2005-07-11T04:47:42', '2005-07-13T01:49:42', '2'), + ('294', '4266', '2006-02-16T02:30:53', '2005-07-31T00:55:11', '2005-08-03T06:41:11', '2'), + ('281', '437', '2006-02-16T02:30:53', '2005-07-28T19:55:21', '2005-08-02T21:52:21', '2'), + ('419', '732', '2006-02-16T02:30:53', '2005-06-19T18:52:37', '2005-06-25T19:45:37', '2'), + ('453', '2463', '2006-02-16T02:30:53', '2005-08-21T01:44:14', '2005-08-30T02:19:14', '2'), + ('394', '4024', '2006-02-16T02:30:53', '2005-08-01T14:30:35', '2005-08-05T11:13:35', '2'), + ('584', '478', '2006-02-16T02:30:53', '2005-08-02T04:00:47', '2005-08-08T01:58:47', '2'), + ('463', '646', '2006-02-16T02:30:53', '2005-07-09T22:11:14', '2005-07-15T21:08:14', '2'), + ('208', '2516', '2006-02-16T02:30:53', '2005-06-20T03:15:09', '2005-06-20T21:56:09', '2'), + ('550', '2507', '2006-02-16T02:30:53', '2005-08-21T09:46:35', '2005-08-26T10:24:35', '2'), + ('98', '4076', '2006-02-16T02:30:53', '2005-07-29T13:53:28', '2005-07-31T16:12:28', '2'), + ('260', '694', '2006-02-16T02:30:53', '2005-06-16T07:49:47', '2005-06-22T13:32:47', '2'), + ('531', '2512', '2006-02-16T02:30:53', '2005-07-27T09:02:31', '2005-08-03T08:56:31', '2'), + ('284', '3999', '2006-02-16T02:30:53', '2005-07-08T14:39:22', '2005-07-17T15:02:22', '2'), + ('598', '742', '2006-02-16T02:30:53', '2005-08-23T00:44:15', '2005-09-01T05:33:15', '2'), + ('109', '4451', '2006-02-16T02:30:53', '2005-08-22T23:10:49', '2005-08-28T00:49:49', '2'), + ('6', '3888', '2006-02-16T02:30:53', '2005-08-17T13:39:32', '2005-08-23T18:44:32', '2'), + ('209', '2632', '2006-02-16T02:30:53', '2005-05-31T19:53:03', '2005-06-06T20:56:03', '2'), + ('114', '281', '2006-02-16T02:30:53', '2005-08-23T02:04:57', '2005-08-28T07:05:57', '2'), + ('136', '3259', '2006-02-16T02:30:53', '2005-08-18T14:10:09', '2005-08-19T19:44:09', '2'), + ('122', '3118', '2006-02-16T02:30:53', '2005-05-31T19:15:11', '2005-06-01T14:44:11', '2'), + ('598', '482', '2006-02-16T02:30:53', '2005-07-27T08:57:40', '2005-08-04T09:55:40', '2'), + ('202', '1107', '2006-02-16T02:30:53', '2005-07-30T02:28:38', '2005-08-02T01:43:38', '2'), + ('408', '546', '2006-02-16T02:30:53', '2005-07-09T05:02:35', '2005-07-15T01:22:35', '2'), + ('483', '4565', '2006-02-16T02:30:53', '2005-08-18T06:47:19', '2005-08-25T05:51:19', '2'), + ('296', '683', '2006-02-16T02:30:53', '2005-06-20T18:11:44', '2005-06-27T16:14:44', '2'), + ('2', '488', '2006-02-16T02:30:53', '2005-07-27T15:23:02', '2005-08-04T10:35:02', '2'), + ('35', '4080', '2006-02-16T02:30:53', '2005-07-06T05:03:59', '2005-07-13T06:49:59', '2'), + ('143', '3738', '2006-02-16T02:30:53', '2005-08-20T14:06:33', '2005-08-26T12:15:33', '2'), + ('470', '225', '2006-02-16T02:30:53', '2005-07-08T02:12:04', '2005-07-15T02:19:04', '2'), + ('226', '4386', '2006-02-16T02:30:53', '2005-07-09T15:01:23', '2005-07-13T11:06:23', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['9751', '5654', '13053', '591', '6447', '12484', '9694', '6415', '10989', '3318', '7137', '8951', '14222', '11574', '5436', '5724', '9118', '5571', '11458', '11359', '6799', '11280', '4266', '7242', '12990', '1752', '12402', '6259', '13990', '13976', '5279', '12666', '4337', '2316', '1806', '9712', '7783', '7996', '13279', '1566', '117', '15402', '3089', '10536', '15878', '15234', '14842', '3614', '3924', '14758', '11565', '11459', '12050', '1024', '12520', '6768', '3782', '8648', '6886', '12871', '5287', '1846', '8189', '4753', '9987', '9716', '5934', '14330', '16', '2810', '7484', '912', '8555', '15354', '4301', '8177', '14626', '11684', '7723', '10189', '9918', '1641', '13951', '6601', '2571', '1643', '2111', '11985', '5047', '10029', '3704', '2868', '13779', '15059', '8490', '14146', '15569', '2407', '13667', '7670']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('202', '36', '2006-02-16T02:30:53', '2005-07-31T09:20:50', '2005-08-01T05:34:50', '2'), + ('490', '3419', '2006-02-16T02:30:53', '2005-07-10T07:24:46', '2005-07-14T07:39:46', '2'), + ('140', '2044', '2006-02-16T02:30:53', '2005-08-19T09:31:48', '2005-08-28T07:51:48', '2'), + ('19', '377', '2006-02-16T02:30:53', '2005-05-28T13:11:04', '2005-05-29T17:20:04', '2'), + ('482', '3945', '2006-02-16T02:30:53', '2005-07-12T00:45:17', '2005-07-18T05:56:17', '2'), + ('300', '3690', '2006-02-16T02:30:53', '2005-08-18T12:39:37', '2005-08-24T08:47:37', '2'), + ('508', '3447', '2006-02-16T02:30:53', '2005-07-31T07:13:16', '2005-08-06T09:12:16', '2'), + ('84', '4175', '2006-02-16T02:30:53', '2005-07-11T23:27:52', '2005-07-19T22:29:52', '2'), + ('7', '2272', '2006-02-16T02:30:53', '2005-08-02T04:40:54', '2005-08-09T03:39:54', '2'), + ('414', '1111', '2006-02-16T02:30:53', '2005-06-21T08:23:05', '2005-06-27T14:07:05', '2'), + ('483', '3957', '2006-02-16T02:30:53', '2005-07-27T06:40:41', '2005-07-29T09:05:41', '2'), + ('336', '127', '2006-02-16T02:30:53', '2005-07-30T03:18:24', '2005-08-08T08:50:24', '2'), + ('7', '714', '2006-02-16T02:30:53', '2005-08-21T04:49:48', '2005-08-25T05:34:48', '2'), + ('277', '3596', '2006-02-16T02:30:53', '2005-08-17T01:38:19', '2005-08-18T20:30:19', '2'), + ('89', '2364', '2006-02-16T02:30:53', '2005-07-09T21:31:11', '2005-07-13T16:59:11', '2'), + ('289', '3597', '2006-02-16T02:30:53', '2005-07-10T11:18:12', '2005-07-16T14:53:12', '2'), + ('172', '4538', '2006-02-16T02:30:53', '2005-07-30T09:24:18', '2005-08-02T14:46:18', '2'), + ('76', '1084', '2006-02-16T02:30:53', '2005-07-10T03:48:20', '2005-07-11T02:09:20', '2'), + ('575', '3514', '2006-02-16T02:30:53', '2005-08-02T21:24:02', '2005-08-04T01:32:02', '2'), + ('466', '1648', '2006-02-16T02:30:53', '2005-08-02T17:45:55', '2005-08-10T20:53:55', '2'), + ('42', '2778', '2006-02-16T02:30:53', '2005-07-12T16:52:13', '2005-07-14T15:11:13', '2'), + ('134', '1846', '2006-02-16T02:30:53', '2005-08-02T14:34:33', '2005-08-08T15:40:33', '2'), + ('509', '1578', '2006-02-16T02:30:53', '2005-07-07T14:34:50', '2005-07-08T09:23:50', '2'), + ('565', '1966', '2006-02-16T02:30:53', '2005-07-27T10:25:51', '2005-08-04T16:02:51', '2'), + ('360', '1825', '2006-02-16T02:30:53', '2005-08-19T07:20:39', '2005-08-21T12:31:39', '2'), + ('12', '3529', '2006-02-16T02:30:53', '2005-06-16T17:02:55', '2005-06-23T19:09:55', '2'), + ('123', '385', '2006-02-16T02:30:53', '2005-08-18T09:27:34', '2005-08-25T13:10:34', '2'), + ('84', '3007', '2006-02-16T02:30:53', '2005-07-11T15:25:52', '2005-07-13T11:54:52', '2'), + ('481', '2272', '2006-02-16T02:30:53', '2005-08-20T19:29:23', '2005-08-25T18:50:23', '2'), + ('278', '1785', '2006-02-16T02:30:53', '2005-08-20T19:02:16', '2005-08-25T17:58:16', '2'), + ('64', '709', '2006-02-16T02:30:53', '2005-07-09T14:46:36', '2005-07-17T10:04:36', '2'), + ('251', '4156', '2006-02-16T02:30:53', '2005-08-18T19:11:41', '2005-08-21T18:04:41', '2'), + ('464', '2313', '2006-02-16T02:30:53', '2005-07-07T18:36:37', '2005-07-14T14:59:37', '2'), + ('289', '372', '2006-02-16T02:30:53', '2005-06-18T09:04:59', '2005-06-20T09:39:59', '2'), + ('45', '2053', '2006-02-16T02:30:53', '2005-06-16T20:41:57', '2005-06-18T19:25:57', '2'), + ('219', '2487', '2006-02-16T02:30:53', '2005-07-31T08:13:11', '2005-08-08T12:40:11', '2'), + ('581', '3817', '2006-02-16T02:30:53', '2005-07-28T07:14:43', '2005-08-01T05:03:43', '2'), + ('408', '2171', '2006-02-16T02:30:53', '2005-07-28T15:00:49', '2005-08-04T20:58:49', '2'), + ('343', '2472', '2006-02-16T02:30:53', '2005-08-19T18:02:18', '2005-08-24T22:15:18', '2'), + ('174', '3215', '2006-02-16T02:30:53', '2005-06-16T03:13:20', '2005-06-24T01:59:20', '2'), + ('7', '4278', '2006-02-16T02:30:53', '2005-05-25T19:30:46', '2005-05-31T23:59:46', '2'), + ('293', '1575', '2006-02-16T02:30:53', '2005-08-22T23:17:41', '2005-08-30T20:07:41', '2'), + ('151', '539', '2006-02-16T02:30:53', '2005-06-20T15:57:01', '2005-06-25T13:15:01', '2'), + ('86', '1251', '2006-02-16T02:30:53', '2005-08-01T12:21:53', '2005-08-04T13:08:53', '2'), + ('493', '1592', '2006-02-16T02:30:53', '2005-08-23T16:34:31', '2005-08-27T21:51:31', '2'), + ('228', '908', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('467', '2511', '2006-02-16T02:30:53', '2005-08-22T02:04:38', '2005-08-30T06:46:38', '2'), + ('502', '853', '2006-02-16T02:30:53', '2005-07-06T05:46:05', '2005-07-11T01:24:05', '2'), + ('114', '187', '2006-02-16T02:30:53', '2005-07-06T20:38:02', '2005-07-11T23:35:02', '2'), + ('339', '2372', '2006-02-16T02:30:53', '2005-08-21T23:24:52', '2005-08-27T04:25:52', '2'), + ('83', '173', '2006-02-16T02:30:53', '2005-08-17T01:28:05', '2005-08-23T23:33:05', '2'), + ('392', '3730', '2006-02-16T02:30:53', '2005-08-02T21:25:25', '2005-08-04T19:57:25', '2'), + ('405', '2348', '2006-02-16T02:30:53', '2005-08-17T20:55:25', '2005-08-22T20:31:25', '2'), + ('457', '2310', '2006-02-16T02:30:53', '2005-05-31T03:30:19', '2005-06-09T05:52:19', '2'), + ('52', '681', '2006-02-16T02:30:53', '2005-08-18T13:42:45', '2005-08-23T12:54:45', '2'), + ('151', '3418', '2006-02-16T02:30:53', '2005-07-12T15:47:51', '2005-07-19T21:17:51', '2'), + ('515', '3365', '2006-02-16T02:30:53', '2005-07-06T13:57:03', '2005-07-09T11:13:03', '2'), + ('416', '160', '2006-02-16T02:30:53', '2005-07-29T14:56:21', '2005-07-31T16:56:21', '2'), + ('429', '4533', '2006-02-16T02:30:53', '2005-07-12T20:58:04', '2005-07-18T16:56:04', '2'), + ('217', '2625', '2006-02-16T02:30:53', '2005-08-19T02:55:36', '2005-08-22T01:00:36', '2'), + ('523', '3110', '2006-02-16T02:30:53', '2005-07-09T15:11:54', '2005-07-16T16:05:54', '2'), + ('422', '1725', '2006-02-16T02:30:53', '2005-06-17T00:02:44', '2005-06-18T23:47:44', '2'), + ('361', '3515', '2006-02-16T02:30:53', '2005-07-28T22:36:26', '2005-08-04T00:12:26', '2'), + ('391', '1642', '2006-02-16T02:30:53', '2005-07-08T14:18:41', '2005-07-09T10:00:41', '2'), + ('15', '1619', '2006-02-16T02:30:53', '2005-07-31T17:22:35', '2005-08-01T21:19:35', '2'), + ('287', '3385', '2006-02-16T02:30:53', '2005-07-31T08:23:53', '2005-08-08T12:03:53', '2'), + ('576', '3825', '2006-02-16T02:30:53', '2005-07-10T22:07:59', '2005-07-15T21:07:59', '2'), + ('84', '763', '2006-02-16T02:30:53', '2005-08-21T08:29:20', '2005-08-30T03:59:20', '2'), + ('316', '389', '2006-02-16T02:30:53', '2005-05-25T00:43:11', '2005-05-26T04:42:11', '2'), + ('67', '2558', '2006-02-16T02:30:53', '2005-06-19T19:44:12', '2005-06-20T19:41:12', '2'), + ('211', '2746', '2006-02-16T02:30:53', '2005-07-27T19:28:17', '2005-07-31T20:05:17', '2'), + ('390', '3200', '2006-02-16T02:30:53', '2005-05-30T10:58:33', '2005-05-31T09:31:33', '2'), + ('18', '2784', '2006-02-16T02:30:53', '2005-07-29T11:18:01', '2005-07-30T10:47:01', '2'), + ('412', '4212', '2006-02-16T02:30:53', '2005-08-22T21:18:59', '2005-08-27T20:12:59', '2'), + ('440', '1630', '2006-02-16T02:30:53', '2005-07-07T16:37:23', '2005-07-11T18:05:23', '2'), + ('122', '3696', '2006-02-16T02:30:53', '2005-07-28T21:43:54', '2005-08-02T22:38:54', '2'), + ('554', '1038', '2006-02-16T02:30:53', '2005-08-21T18:35:44', '2005-08-25T23:54:44', '2'), + ('517', '4277', '2006-02-16T02:30:53', '2005-08-17T06:27:15', '2005-08-22T02:11:15', '2'), + ('147', '3263', '2006-02-16T02:30:53', '2005-07-28T04:45:37', '2005-07-30T09:03:37', '2'), + ('509', '616', '2006-02-16T02:30:53', '2005-08-01T00:25:00', '2005-08-03T06:01:00', '2'), + ('283', '2519', '2006-02-16T02:30:53', '2005-07-31T14:55:22', '2005-08-04T09:02:22', '2'), + ('259', '2925', '2006-02-16T02:30:53', '2005-06-16T08:46:26', '2005-06-24T14:39:26', '2'), + ('40', '2034', '2006-02-16T02:30:53', '2005-08-20T17:58:11', '2005-08-26T14:50:11', '2'), + ('464', '1640', '2006-02-16T02:30:53', '2005-07-12T07:44:49', '2005-07-20T03:22:49', '2'), + ('66', '1800', '2006-02-16T02:30:53', '2005-06-19T04:20:14', '2005-06-21T07:28:14', '2'), + ('484', '1352', '2006-02-16T02:30:53', '2005-06-16T08:55:35', '2005-06-21T05:36:35', '2'), + ('76', '2108', '2006-02-16T02:30:53', '2005-06-17T19:47:21', '2005-06-19T22:46:21', '2'), + ('198', '2208', '2006-02-16T02:30:53', '2005-08-17T18:19:44', '2005-08-18T19:14:44', '2'), + ('272', '230', '2006-02-16T02:30:53', '2005-07-09T03:44:15', '2005-07-15T09:07:15', '2'), + ('578', '505', '2006-02-16T02:30:53', '2005-07-31T18:37:47', '2005-08-06T14:58:47', '2'), + ('323', '2687', '2006-02-16T02:30:53', '2005-07-06T10:16:45', '2005-07-13T12:44:45', '2'), + ('214', '1213', '2006-02-16T02:30:53', '2005-06-20T00:08:58', '2005-06-25T21:23:58', '2'), + ('440', '63', '2006-02-16T02:30:53', '2005-08-20T12:03:54', '2005-08-28T15:24:54', '2'), + ('564', '4079', '2006-02-16T02:30:53', '2005-08-22T10:22:00', '2005-08-29T07:01:00', '2'), + ('367', '1943', '2006-02-16T02:30:53', '2005-07-29T08:59:25', '2005-08-05T14:02:25', '2'), + ('192', '2151', '2006-02-16T02:30:53', '2005-08-21T02:13:31', '2005-08-24T22:47:31', '2'), + ('313', '1071', '2006-02-16T02:30:53', '2005-08-23T05:24:29', '2005-08-30T08:23:29', '2'), + ('421', '2547', '2006-02-16T02:30:53', '2005-06-18T16:50:41', '2005-06-24T15:29:41', '2'), + ('280', '3856', '2006-02-16T02:30:53', '2005-08-20T08:25:34', '2005-08-24T07:04:34', '2'), + ('252', '1356', '2006-02-16T02:30:53', '2005-07-28T02:44:25', '2005-07-29T21:55:25', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['5214', '6868', '2791', '7092', '10799', '6591', '2271', '13578', '7715', '1957', '11897', '10163', '956', '8442', '4944', '12486', '3753', '5405', '10377', '13623', '5301', '8271', '10302', '13610', '13471', '7127', '9523', '2202', '9680', '803', '11176', '8416', '8126', '3308', '11301', '15275', '5009', '7525', '10195', '14099', '8721', '6805', '4401', '10071', '9992', '3583', '4052', '5203', '11584', '726', '11272', '1422', '12811', '3579', '7509', '11445', '9772', '875', '2352', '12724', '15617', '7830', '4397', '11253', '2970', '9209', '4222', '14799', '1828', '6649', '7428', '11265', '15105', '3735', '12884', '1539', '12066', '8352', '9649', '6410', '12753', '3861', '7322', '920', '3441', '2242', '9850', '10681', '13281', '6336', '5889', '12371', '2632', '6767', '403', '6955', '3644', '5216', '9308', '4787']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('290', '1657', '2006-02-16T02:30:53', '2005-07-09T11:43:08', '2005-07-17T08:58:08', '2'), + ('306', '719', '2006-02-16T02:30:53', '2005-07-12T20:10:17', '2005-07-15T22:34:17', '2'), + ('299', '2174', '2006-02-16T02:30:53', '2005-06-19T18:51:27', '2005-06-22T19:35:27', '2'), + ('345', '1433', '2006-02-16T02:30:53', '2005-07-27T04:46:00', '2005-08-03T07:22:00', '2'), + ('145', '3282', '2006-02-16T02:30:53', '2005-08-01T22:03:31', '2005-08-06T20:19:31', '2'), + ('509', '2846', '2006-02-16T02:30:53', '2005-07-12T07:13:46', '2005-07-16T05:15:46', '2'), + ('145', '2416', '2006-02-16T02:30:53', '2005-06-18T06:29:52', '2005-06-21T09:46:52', '2'), + ('352', '4301', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('512', '3210', '2006-02-16T02:30:53', '2005-07-28T04:32:38', '2005-08-05T00:37:38', '2'), + ('68', '2496', '2006-02-16T02:30:53', '2005-06-17T08:50:58', '2005-06-26T13:39:58', '2'), + ('238', '3904', '2006-02-16T02:30:53', '2005-08-17T15:24:06', '2005-08-23T11:50:06', '2'), + ('425', '2811', '2006-02-16T02:30:53', '2005-07-31T23:12:34', '2005-08-01T22:47:34', '2'), + ('296', '647', '2006-02-16T02:30:53', '2005-05-30T17:30:28', '2005-06-07T13:54:28', '2'), + ('185', '4345', '2006-02-16T02:30:53', '2005-07-29T07:33:07', '2005-08-03T03:09:07', '2'), + ('293', '3648', '2006-02-16T02:30:53', '2005-07-08T22:44:28', '2005-07-17T21:51:28', '2'), + ('515', '2991', '2006-02-16T02:30:53', '2005-08-18T12:42:50', '2005-08-27T13:41:50', '2'), + ('358', '774', '2006-02-16T02:30:53', '2005-07-06T12:34:06', '2005-07-07T14:19:06', '2'), + ('45', '799', '2006-02-16T02:30:53', '2005-07-09T20:11:49', '2005-07-18T18:37:49', '2'), + ('559', '2401', '2006-02-16T02:30:53', '2005-08-01T06:28:28', '2005-08-10T05:45:28', '2'), + ('321', '3948', '2006-02-16T02:30:53', '2005-08-20T06:49:46', '2005-08-25T05:19:46', '2'), + ('459', '245', '2006-02-16T02:30:53', '2005-07-09T15:42:10', '2005-07-16T21:27:10', '2'), + ('481', '83', '2006-02-16T02:30:53', '2005-07-29T01:27:44', '2005-08-07T05:01:44', '2'), + ('144', '1043', '2006-02-16T02:30:53', '2005-08-01T04:12:08', '2005-08-01T22:12:08', '2'), + ('3', '2526', '2006-02-16T02:30:53', '2005-08-20T06:14:12', '2005-08-26T00:44:12', '2'), + ('296', '1391', '2006-02-16T02:30:53', '2005-08-20T01:02:26', '2005-08-25T06:37:26', '2'), + ('486', '273', '2006-02-16T02:30:53', '2005-07-27T06:13:48', '2005-08-01T02:50:48', '2'), + ('356', '891', '2006-02-16T02:30:53', '2005-07-31T00:56:09', '2005-08-05T05:44:09', '2'), + ('297', '815', '2006-02-16T02:30:53', '2005-06-18T02:09:24', '2005-06-26T07:17:24', '2'), + ('84', '3010', '2006-02-16T02:30:53', '2005-07-31T06:41:46', '2005-08-01T11:02:46', '2'), + ('32', '1602', '2006-02-16T02:30:53', '2005-05-29T17:52:30', '2005-05-30T14:35:30', '2'), + ('37', '1448', '2006-02-16T02:30:53', '2005-08-02T10:39:43', '2005-08-09T14:42:43', '2'), + ('315', '1999', '2006-02-16T02:30:53', '2005-07-29T06:52:54', '2005-08-05T09:50:54', '2'), + ('537', '719', '2006-02-16T02:30:53', '2005-07-28T19:32:41', '2005-08-05T00:33:41', '2'), + ('96', '3129', '2006-02-16T02:30:53', '2005-06-21T07:58:36', '2005-06-23T05:23:36', '2'), + ('502', '676', '2006-02-16T02:30:53', '2005-08-02T15:37:59', '2005-08-04T10:57:59', '2'), + ('597', '1522', '2006-02-16T02:30:53', '2005-08-22T18:57:39', '2005-08-23T19:00:39', '2'), + ('102', '1539', '2006-02-16T02:30:53', '2005-07-09T01:32:17', '2005-07-18T03:39:17', '2'), + ('281', '4084', '2006-02-16T02:30:53', '2005-07-27T21:13:28', '2005-08-04T19:44:28', '2'), + ('396', '2691', '2006-02-16T02:30:53', '2005-08-01T00:34:42', '2005-08-08T05:04:42', '2'), + ('224', '2452', '2006-02-16T02:30:53', '2005-08-21T00:31:03', '2005-08-27T03:18:03', '2'), + ('312', '2416', '2006-02-16T02:30:53', '2005-07-29T17:56:21', '2005-08-02T21:30:21', '2'), + ('262', '1758', '2006-02-16T02:30:53', '2005-07-12T17:23:01', '2005-07-21T19:38:01', '2'), + ('405', '2725', '2006-02-16T02:30:53', '2005-07-07T21:26:27', '2005-07-12T17:18:27', '2'), + ('353', '2360', '2006-02-16T02:30:53', '2005-07-31T19:49:35', '2005-08-03T00:00:35', '2'), + ('304', '4242', '2006-02-16T02:30:53', '2005-07-31T17:29:48', '2005-08-09T13:02:48', '2'), + ('574', '204', '2006-02-16T02:30:53', '2005-07-06T04:10:43', '2005-07-14T22:17:43', '2'), + ('442', '206', '2006-02-16T02:30:53', '2005-07-07T03:38:22', '2005-07-13T02:56:22', '2'), + ('588', '3661', '2006-02-16T02:30:53', '2005-07-09T10:53:59', '2005-07-15T09:45:59', '2'), + ('479', '3906', '2006-02-16T02:30:53', '2005-08-17T02:13:26', '2005-08-22T01:24:26', '2'), + ('452', '933', '2006-02-16T02:30:53', '2005-05-29T06:05:29', '2005-06-05T04:40:29', '2'), + ('158', '4111', '2006-02-16T02:30:53', '2005-08-02T14:20:27', '2005-08-07T12:24:27', '2'), + ('1', '1021', '2006-02-16T02:30:53', '2005-06-15T18:02:53', '2005-06-19T15:54:53', '2'), + ('54', '641', '2006-02-16T02:30:53', '2005-08-19T00:51:28', '2005-08-24T01:57:28', '2'), + ('485', '3309', '2006-02-16T02:30:53', '2005-07-06T03:47:47', '2005-07-08T02:16:47', '2'), + ('228', '4134', '2006-02-16T02:30:53', '2005-07-27T20:37:19', '2005-08-04T19:35:19', '2'), + ('108', '3340', '2006-02-16T02:30:53', '2005-08-02T20:33:35', '2005-08-08T16:02:35', '2'), + ('147', '3639', '2006-02-16T02:30:53', '2005-07-31T09:56:07', '2005-08-01T13:50:07', '2'), + ('326', '1428', '2006-02-16T02:30:53', '2005-05-30T05:38:24', '2005-06-06T00:34:24', '2'), + ('590', '2141', '2006-02-16T02:30:53', '2005-06-18T12:40:15', '2005-06-22T07:07:15', '2'), + ('242', '2224', '2006-02-16T02:30:53', '2005-08-18T21:37:20', '2005-08-27T21:56:20', '2'), + ('569', '4085', '2006-02-16T02:30:53', '2005-08-23T07:07:22', '2005-08-27T01:24:22', '2'), + ('144', '4492', '2006-02-16T02:30:53', '2005-07-28T08:43:49', '2005-08-04T09:30:49', '2'), + ('494', '3085', '2006-02-16T02:30:53', '2005-07-07T21:14:54', '2005-07-13T19:24:54', '2'), + ('303', '2898', '2006-02-16T02:30:53', '2005-08-02T13:42:44', '2005-08-09T17:06:44', '2'), + ('449', '1167', '2006-02-16T02:30:53', '2005-06-20T07:51:51', '2005-06-28T10:14:51', '2'), + ('23', '3940', '2006-02-16T02:30:53', '2005-07-30T12:55:36', '2005-08-03T11:31:36', '2'), + ('467', '2053', '2006-02-16T02:30:53', '2005-07-07T12:20:21', '2005-07-11T11:09:21', '2'), + ('454', '1276', '2006-02-16T02:30:53', '2005-08-22T00:44:57', '2005-08-24T20:08:57', '2'), + ('68', '316', '2006-02-16T02:30:53', '2005-06-16T22:04:34', '2005-06-20T21:07:34', '2'), + ('57', '70', '2006-02-16T02:30:53', '2005-07-12T10:51:09', '2005-07-14T16:05:09', '2'), + ('90', '243', '2006-02-16T02:30:53', '2005-07-27T17:21:52', '2005-08-05T17:13:52', '2'), + ('531', '3870', '2006-02-16T02:30:53', '2005-08-02T14:05:42', '2005-08-11T15:27:42', '2'), + ('338', '3965', '2006-02-16T02:30:53', '2005-08-22T12:01:33', '2005-08-26T14:29:33', '2'), + ('534', '2262', '2006-02-16T02:30:53', '2005-07-06T11:42:04', '2005-07-12T14:33:04', '2'), + ('348', '2768', '2006-02-16T02:30:53', '2005-08-19T03:34:04', '2005-08-28T01:00:04', '2'), + ('390', '267', '2006-02-16T02:30:53', '2005-06-16T01:11:25', '2005-06-23T03:43:25', '2'), + ('267', '2474', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('168', '2710', '2006-02-16T02:30:53', '2005-07-29T04:52:01', '2005-08-06T07:39:01', '2'), + ('51', '1588', '2006-02-16T02:30:53', '2005-07-31T05:46:54', '2005-08-04T08:42:54', '2'), + ('560', '1127', '2006-02-16T02:30:53', '2005-07-11T23:08:06', '2005-07-19T19:57:06', '2'), + ('470', '1494', '2006-02-16T02:30:53', '2005-08-18T22:37:39', '2005-08-27T00:21:39', '2'), + ('202', '4506', '2006-02-16T02:30:53', '2005-07-06T17:24:49', '2005-07-15T22:19:49', '2'), + ('508', '1810', '2006-02-16T02:30:53', '2005-07-27T13:37:26', '2005-08-03T18:00:26', '2'), + ('584', '3860', '2006-02-16T02:30:53', '2005-05-30T11:44:01', '2005-06-02T08:19:01', '2'), + ('326', '2863', '2006-02-16T02:30:53', '2005-06-21T20:00:12', '2005-06-24T00:24:12', '2'), + ('146', '1995', '2006-02-16T02:30:53', '2005-06-18T04:32:28', '2005-06-24T03:26:28', '2'), + ('497', '1461', '2006-02-16T02:30:53', '2005-07-31T12:46:52', '2005-08-04T10:52:52', '2'), + ('119', '1468', '2006-02-16T02:30:53', '2005-08-01T17:30:35', '2005-08-02T14:48:35', '2'), + ('220', '113', '2006-02-16T02:30:53', '2005-08-19T18:07:47', '2005-08-20T21:51:47', '2'), + ('471', '1229', '2006-02-16T02:30:53', '2005-07-11T19:30:13', '2005-07-20T21:27:13', '2'), + ('491', '1706', '2006-02-16T02:30:53', '2005-07-10T19:54:41', '2005-07-12T20:08:41', '2'), + ('451', '622', '2006-02-16T02:30:53', '2005-08-18T08:02:46', '2005-08-19T02:50:46', '2'), + ('574', '2274', '2006-02-16T02:30:53', '2005-06-19T08:51:47', '2005-06-23T07:13:47', '2'), + ('208', '1819', '2006-02-16T02:30:53', '2005-07-12T15:46:55', '2005-07-17T17:36:55', '2'), + ('424', '3983', '2006-02-16T02:30:53', '2005-05-27T13:28:52', '2005-05-29T11:47:52', '2'), + ('469', '1104', '2006-02-16T02:30:53', '2005-07-26T23:55:48', '2005-08-02T03:25:48', '2'), + ('403', '4309', '2006-02-16T02:30:53', '2005-07-06T07:20:11', '2005-07-11T10:26:11', '2'), + ('515', '1644', '2006-02-16T02:30:53', '2005-07-09T11:54:58', '2005-07-12T09:46:58', '2'), + ('267', '2202', '2006-02-16T02:30:53', '2005-07-30T16:53:21', '2005-08-08T15:33:21', '2'), + ('7', '3929', '2006-02-16T02:30:53', '2005-07-08T16:16:04', '2005-07-14T18:02:04', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['5324', '15730', '13507', '8053', '3357', '15523', '2915', '1190', '10446', '9516', '10048', '10835', '9020', '9619', '14620', '7163', '6782', '5127', '3401', '5885', '3593', '2884', '11677', '6526', '4925', '15204', '12024', '7501', '2117', '11212', '10079', '2665', '5536', '11790', '377', '807', '5527', '14168', '3367', '4930', '5423', '11398', '9970', '11922', '9632', '12901', '6163', '8362', '5823', '6604', '790', '15156', '9340', '14545', '13297', '1059', '295', '5417', '10647', '14693', '3912', '12332', '15255', '811', '4686', '14716', '13648', '11829', '5773', '8334', '11291', '15027', '4096', '7653', '6243', '15486', '6952', '16025', '13517', '5144', '1638', '10316', '11609', '15779', '13485', '14943', '5378', '5336', '8874', '2044', '11657', '3685', '14821', '309', '10843', '7209', '5593', '5488', '1280', '2895']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('113', '4024', '2006-02-16T02:30:53', '2005-07-09T16:34:18', '2005-07-15T12:35:18', '2'), + ('147', '947', '2006-02-16T02:30:53', '2005-08-23T11:32:35', '2005-08-30T13:46:35', '2'), + ('478', '3324', '2006-02-16T02:30:53', '2005-08-20T02:10:27', '2005-08-23T04:03:27', '2'), + ('526', '1511', '2006-02-16T02:30:53', '2005-07-28T16:59:41', '2005-08-03T22:28:41', '2'), + ('57', '2528', '2006-02-16T02:30:53', '2005-06-21T11:55:42', '2005-06-22T07:19:42', '2'), + ('432', '2570', '2006-02-16T02:30:53', '2005-08-23T03:32:36', '2005-08-26T22:08:36', '2'), + ('262', '1293', '2006-02-16T02:30:53', '2005-06-20T03:57:17', '2005-06-24T05:59:17', '2'), + ('370', '2572', '2006-02-16T02:30:53', '2005-06-15T01:05:32', '2005-06-23T02:34:32', '2'), + ('95', '2671', '2006-02-16T02:30:53', '2005-08-01T09:02:17', '2005-08-04T10:00:17', '2'), + ('424', '3519', '2006-02-16T02:30:53', '2005-07-31T00:40:58', '2005-08-07T02:13:58', '2'), + ('267', '3821', '2006-02-16T02:30:53', '2005-07-31T19:08:56', '2005-08-05T20:15:56', '2'), + ('90', '351', '2006-02-16T02:30:53', '2005-08-01T23:28:49', '2005-08-10T21:28:49', '2'), + ('142', '1700', '2006-02-16T02:30:53', '2005-07-30T05:31:27', '2005-08-08T06:44:27', '2'), + ('138', '1730', '2006-02-16T02:30:53', '2005-07-31T04:17:02', '2005-08-05T06:36:02', '2'), + ('78', '3272', '2006-02-16T02:30:53', '2005-08-21T18:10:43', '2005-08-22T15:19:43', '2'), + ('38', '3666', '2006-02-16T02:30:53', '2005-07-27T07:36:11', '2005-08-04T06:03:11', '2'), + ('199', '2742', '2006-02-16T02:30:53', '2005-07-12T16:23:25', '2005-07-20T18:46:25', '2'), + ('129', '3649', '2006-02-16T02:30:53', '2005-07-09T07:25:47', '2005-07-13T11:44:47', '2'), + ('577', '3423', '2006-02-16T02:30:53', '2005-06-21T15:52:43', '2005-06-30T21:09:43', '2'), + ('331', '3129', '2006-02-16T02:30:53', '2005-07-10T19:33:50', '2005-07-17T00:26:50', '2'), + ('78', '619', '2006-02-16T02:30:53', '2005-07-06T04:39:52', '2005-07-11T23:20:52', '2'), + ('319', '3384', '2006-02-16T02:30:53', '2005-06-20T01:31:16', '2005-06-21T04:03:16', '2'), + ('407', '2206', '2006-02-16T02:30:53', '2005-08-17T06:06:26', '2005-08-20T04:35:26', '2'), + ('225', '1718', '2006-02-16T02:30:53', '2005-07-12T04:21:20', '2005-07-18T23:45:20', '2'), + ('68', '2169', '2006-02-16T02:30:53', '2005-07-08T21:56:00', '2005-07-14T17:17:00', '2'), + ('317', '1471', '2006-02-16T02:30:53', '2005-08-22T16:30:43', '2005-08-26T20:37:43', '2'), + ('484', '2398', '2006-02-16T02:30:53', '2005-08-17T19:57:34', '2005-08-21T23:00:34', '2'), + ('587', '1464', '2006-02-16T02:30:53', '2005-07-27T20:16:59', '2005-08-04T00:11:59', '2'), + ('170', '2', '2006-02-16T02:30:53', '2005-06-17T20:24:00', '2005-06-23T17:45:00', '2'), + ('343', '4007', '2006-02-16T02:30:53', '2005-08-02T12:18:29', '2005-08-05T16:05:29', '2'), + ('486', '4541', '2006-02-16T02:30:53', '2005-07-31T20:05:45', '2005-08-04T16:25:45', '2'), + ('133', '4531', '2006-02-16T02:30:53', '2005-06-19T11:12:35', '2005-06-26T11:55:35', '2'), + ('195', '1919', '2006-02-16T02:30:53', '2005-07-10T02:29:42', '2005-07-13T04:06:42', '2'), + ('451', '2384', '2006-02-16T02:30:53', '2005-08-17T11:00:08', '2005-08-20T05:15:08', '2'), + ('170', '3012', '2006-02-16T02:30:53', '2005-05-27T09:04:05', '2005-06-02T03:36:05', '2'), + ('235', '2195', '2006-02-16T02:30:53', '2005-05-29T18:50:50', '2005-06-03T18:36:50', '2'), + ('554', '4462', '2006-02-16T02:30:53', '2005-07-10T02:06:01', '2005-07-15T00:55:01', '2'), + ('49', '1321', '2006-02-16T02:30:53', '2005-08-21T03:00:03', '2005-08-29T06:04:03', '2'), + ('80', '2442', '2006-02-16T02:30:53', '2005-06-21T13:08:21', '2005-06-26T08:43:21', '2'), + ('451', '2057', '2006-02-16T02:30:53', '2005-07-08T22:15:48', '2005-07-15T21:02:48', '2'), + ('440', '1952', '2006-02-16T02:30:53', '2005-07-09T20:56:48', '2005-07-17T14:58:48', '2'), + ('6', '3952', '2006-02-16T02:30:53', '2005-08-02T18:55:15', '2005-08-10T19:50:15', '2'), + ('578', '2846', '2006-02-16T02:30:53', '2005-07-31T16:38:24', '2005-08-02T12:59:24', '2'), + ('15', '3707', '2006-02-16T02:30:53', '2005-08-17T16:20:37', '2005-08-26T16:53:37', '2'), + ('217', '3368', '2006-02-16T02:30:53', '2005-07-31T05:02:23', '2005-08-06T04:49:23', '2'), + ('180', '2799', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('1', '1330', '2006-02-16T02:30:53', '2005-07-11T10:13:46', '2005-07-19T13:15:46', '2'), + ('223', '2287', '2006-02-16T02:30:53', '2005-07-29T05:09:11', '2005-08-04T00:08:11', '2'), + ('483', '1879', '2006-02-16T02:30:53', '2005-07-10T16:19:52', '2005-07-11T12:33:52', '2'), + ('365', '822', '2006-02-16T02:30:53', '2005-07-12T07:57:45', '2005-07-16T05:41:45', '2'), + ('593', '2858', '2006-02-16T02:30:53', '2005-05-29T16:19:29', '2005-06-02T17:22:29', '2'), + ('494', '1174', '2006-02-16T02:30:53', '2005-08-22T14:29:11', '2005-08-30T17:48:11', '2'), + ('213', '3228', '2006-02-16T02:30:53', '2005-07-30T18:07:16', '2005-08-04T14:33:16', '2'), + ('13', '2459', '2006-02-16T02:30:53', '2005-08-21T15:44:23', '2005-08-29T20:09:23', '2'), + ('359', '3818', '2006-02-16T02:30:53', '2005-08-19T18:45:49', '2005-08-22T14:58:49', '2'), + ('241', '3041', '2006-02-16T02:30:53', '2005-05-31T08:20:43', '2005-06-04T09:05:43', '2'), + ('65', '4030', '2006-02-16T02:30:53', '2005-05-26T20:33:20', '2005-05-27T18:23:20', '2'), + ('265', '3569', '2006-02-16T02:30:53', '2005-07-09T20:34:09', '2005-07-14T00:36:09', '2'), + ('115', '3137', '2006-02-16T02:30:53', '2005-08-01T16:08:46', '2005-08-06T20:37:46', '2'), + ('269', '3454', '2006-02-16T02:30:53', '2005-08-21T20:44:19', '2005-08-29T00:37:19', '2'), + ('154', '2449', '2006-02-16T02:30:53', '2005-07-06T20:10:03', '2005-07-08T18:39:03', '2'), + ('235', '627', '2006-02-16T02:30:53', '2005-08-18T06:51:05', '2005-08-20T04:28:05', '2'), + ('84', '3415', '2006-02-16T02:30:53', '2005-08-22T18:16:50', '2005-08-28T14:14:50', '2'), + ('401', '4419', '2006-02-16T02:30:53', '2005-05-29T19:30:42', '2005-06-02T16:19:42', '2'), + ('234', '1398', '2006-02-16T02:30:53', '2005-07-08T10:53:39', '2005-07-10T05:34:39', '2'), + ('78', '2285', '2006-02-16T02:30:53', '2005-08-21T21:29:55', '2005-08-23T18:34:55', '2'), + ('596', '3921', '2006-02-16T02:30:53', '2005-08-20T07:48:10', '2005-08-22T12:15:10', '2'), + ('563', '2207', '2006-02-16T02:30:53', '2005-08-17T12:52:04', '2005-08-19T10:50:04', '2'), + ('180', '3277', '2006-02-16T02:30:53', '2005-07-10T13:31:09', '2005-07-15T08:21:09', '2'), + ('154', '982', '2006-02-16T02:30:53', '2005-07-29T04:18:25', '2005-08-07T07:18:25', '2'), + ('417', '491', '2006-02-16T02:30:53', '2005-08-02T14:57:58', '2005-08-11T09:04:58', '2'), + ('478', '326', '2006-02-16T02:30:53', '2005-08-22T09:03:04', '2005-08-29T04:03:04', '2'), + ('403', '3911', '2006-02-16T02:30:53', '2005-07-07T06:09:11', '2005-07-08T09:17:11', '2'), + ('232', '814', '2006-02-16T02:30:53', '2005-07-28T01:58:30', '2005-07-28T23:32:30', '2'), + ('26', '3456', '2006-02-16T02:30:53', '2005-07-11T14:53:25', '2005-07-15T09:26:25', '2'), + ('502', '1666', '2006-02-16T02:30:53', '2005-08-23T02:05:20', '2005-08-29T07:52:20', '2'), + ('290', '4288', '2006-02-16T02:30:53', '2005-07-26T23:51:27', '2005-07-30T02:45:27', '2'), + ('569', '1777', '2006-02-16T02:30:53', '2005-08-23T21:48:54', '2005-08-24T22:05:54', '2'), + ('186', '533', '2006-02-16T02:30:53', '2005-08-20T02:33:17', '2005-08-23T22:40:17', '2'), + ('89', '3530', '2006-02-16T02:30:53', '2005-07-09T08:09:53', '2005-07-18T07:11:53', '2'), + ('181', '1905', '2006-02-16T02:30:53', '2005-06-16T08:32:36', '2005-06-18T07:11:36', '2'), + ('469', '1907', '2006-02-16T02:30:53', '2005-08-01T04:34:57', '2005-08-06T02:34:57', '2'), + ('73', '351', '2006-02-16T02:30:53', '2005-08-17T03:41:11', '2005-08-25T01:30:11', '2'), + ('419', '1560', '2006-02-16T02:30:53', '2005-08-23T13:33:46', '2005-08-28T08:40:46', '2'), + ('379', '3802', '2006-02-16T02:30:53', '2005-08-20T01:20:14', '2005-08-22T01:28:14', '2'), + ('265', '3515', '2006-02-16T02:30:53', '2005-08-22T05:59:59', '2005-08-26T10:31:59', '2'), + ('138', '1570', '2006-02-16T02:30:53', '2005-07-09T19:05:56', '2005-07-10T18:03:56', '2'), + ('410', '4144', '2006-02-16T02:30:53', '2005-07-09T17:01:08', '2005-07-11T19:22:08', '2'), + ('564', '459', '2006-02-16T02:30:53', '2005-07-30T00:14:45', '2005-08-02T22:34:45', '2'), + ('484', '2418', '2006-02-16T02:30:53', '2005-06-17T14:37:57', '2005-06-22T17:15:57', '2'), + ('53', '3043', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('58', '2015', '2006-02-16T02:30:53', '2005-07-06T09:30:45', '2005-07-11T15:16:45', '2'), + ('62', '3155', '2006-02-16T02:30:53', '2005-08-22T01:20:19', '2005-08-29T03:06:19', '2'), + ('251', '1946', '2006-02-16T02:30:53', '2005-05-26T22:38:10', '2005-06-02T03:10:10', '2'), + ('192', '1286', '2006-02-16T02:30:53', '2005-08-01T23:43:03', '2005-08-09T23:49:03', '2'), + ('49', '3766', '2006-02-16T02:30:53', '2005-07-27T09:16:53', '2005-07-30T08:09:53', '2'), + ('287', '702', '2006-02-16T02:30:53', '2005-07-10T04:33:13', '2005-07-17T08:44:13', '2'), + ('173', '4262', '2006-02-16T02:30:53', '2005-07-10T00:02:06', '2005-07-15T01:45:06', '2'), + ('266', '2597', '2006-02-16T02:30:53', '2005-06-15T08:16:06', '2005-06-21T04:10:06', '2'), + ('141', '4445', '2006-02-16T02:30:53', '2005-06-20T02:26:31', '2005-06-27T23:42:31', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['9156', '13236', '9544', '10954', '15015', '7533', '8651', '1992', '15045', '6047', '1353', '13843', '197', '3650', '7734', '9561', '1428', '545', '15796', '14554', '9868', '7543', '9738', '1198', '4479', '7284', '10272', '6810', '14540', '15772', '214', '14531', '1911', '14090', '1412', '16033', '14971', '7931', '9498', '8670', '11904', '11411', '13132', '7695', '9744', '6994', '913', '14635', '1241', '2513', '13238', '1014', '7743', '6720', '15977', '7018', '13556', '1975', '15000', '3244', '2648', '185', '1149', '6159', '15307', '9229', '3422', '9293', '12691', '12062', '11222', '9486', '9568', '1383', '3736', '10499', '13935', '9007', '15117', '9270', '12509', '15785', '16037', '1255', '8665', '8424', '394', '9182', '2396', '4235', '1169', '12631', '7', '7804', '7845', '9957', '12957', '296', '14249', '832']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('145', '1747', '2006-02-16T02:30:53', '2005-07-30T11:04:55', '2005-07-31T14:10:55', '2'), + ('267', '4574', '2006-02-16T02:30:53', '2005-08-19T16:18:24', '2005-08-27T17:48:24', '2'), + ('28', '2383', '2006-02-16T02:30:53', '2005-07-31T01:44:51', '2005-08-05T05:25:51', '2'), + ('20', '3406', '2006-02-16T02:30:53', '2005-08-02T03:30:24', '2005-08-08T05:52:24', '2'), + ('14', '3067', '2006-02-16T02:30:53', '2005-08-22T08:43:50', '2005-08-31T06:53:50', '2'), + ('594', '1791', '2006-02-16T02:30:53', '2005-07-27T21:24:33', '2005-08-05T16:33:33', '2'), + ('61', '2095', '2006-02-16T02:30:53', '2005-07-29T15:02:18', '2005-08-07T09:34:18', '2'), + ('233', '636', '2006-02-16T02:30:53', '2005-06-17T10:58:53', '2005-06-19T08:42:53', '2'), + ('161', '3485', '2006-02-16T02:30:53', '2005-08-22T09:53:23', '2005-08-26T10:09:23', '2'), + ('235', '4147', '2006-02-16T02:30:53', '2005-07-11T03:27:01', '2005-07-16T06:42:01', '2'), + ('480', '2711', '2006-02-16T02:30:53', '2005-06-15T13:13:36', '2005-06-21T08:46:36', '2'), + ('308', '3058', '2006-02-16T02:30:53', '2005-08-20T14:30:01', '2005-08-27T10:06:01', '2'), + ('546', '4212', '2006-02-16T02:30:53', '2005-05-26T06:59:21', '2005-06-03T05:04:21', '2'), + ('482', '3606', '2006-02-16T02:30:53', '2005-07-06T07:34:15', '2005-07-08T01:50:15', '2'), + ('135', '2726', '2006-02-16T02:30:53', '2005-07-28T05:08:44', '2005-07-30T09:42:44', '2'), + ('58', '1079', '2006-02-16T02:30:53', '2005-07-31T02:22:13', '2005-08-03T07:00:13', '2'), + ('583', '3689', '2006-02-16T02:30:53', '2005-06-15T18:19:30', '2005-06-22T23:05:30', '2'), + ('54', '1086', '2006-02-16T02:30:53', '2005-05-28T07:10:20', '2005-06-04T01:47:20', '2'), + ('158', '1425', '2006-02-16T02:30:53', '2005-08-23T14:12:22', '2005-08-28T17:03:22', '2'), + ('38', '31', '2006-02-16T02:30:53', '2005-08-21T16:03:01', '2005-08-26T13:09:01', '2'), + ('378', '266', '2006-02-16T02:30:53', '2005-07-31T13:20:08', '2005-08-01T18:17:08', '2'), + ('526', '1289', '2006-02-16T02:30:53', '2005-07-27T21:44:28', '2005-08-04T21:42:28', '2'), + ('568', '2278', '2006-02-16T02:30:53', '2005-07-31T09:04:14', '2005-08-05T14:40:14', '2'), + ('491', '1138', '2006-02-16T02:30:53', '2005-06-15T01:48:58', '2005-06-20T01:07:58', '2'), + ('211', '3516', '2006-02-16T02:30:53', '2005-07-08T00:52:35', '2005-07-09T20:19:35', '2'), + ('52', '2336', '2006-02-16T02:30:53', '2005-07-27T12:12:04', '2005-07-31T11:17:04', '2'), + ('273', '128', '2006-02-16T02:30:53', '2005-08-01T03:14:34', '2005-08-10T05:56:34', '2'), + ('485', '2802', '2006-02-16T02:30:53', '2005-07-12T17:54:19', '2005-07-20T16:58:19', '2'), + ('28', '2362', '2006-02-16T02:30:53', '2005-08-21T15:34:23', '2005-08-27T11:51:23', '2'), + ('202', '4343', '2006-02-16T02:30:53', '2005-08-23T13:22:56', '2005-08-26T10:35:56', '2'), + ('98', '1453', '2006-02-16T02:30:53', '2005-05-26T08:48:49', '2005-05-31T04:06:49', '2'), + ('568', '4296', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('3', '910', '2006-02-16T02:30:53', '2005-06-17T05:15:15', '2005-06-24T11:05:15', '2'), + ('168', '3254', '2006-02-16T02:30:53', '2005-08-21T00:11:16', '2005-08-23T19:48:16', '2'), + ('166', '4236', '2006-02-16T02:30:53', '2005-06-15T17:09:48', '2005-06-18T17:05:48', '2'), + ('226', '760', '2006-02-16T02:30:53', '2005-08-23T22:06:15', '2005-09-01T02:36:15', '2'), + ('378', '1883', '2006-02-16T02:30:53', '2005-08-22T06:52:49', '2005-08-28T06:27:49', '2'), + ('326', '1923', '2006-02-16T02:30:53', '2005-07-28T12:23:41', '2005-08-06T09:49:41', '2'), + ('289', '1035', '2006-02-16T02:30:53', '2005-07-30T23:56:55', '2005-08-03T18:34:55', '2'), + ('446', '2354', '2006-02-16T02:30:53', '2005-07-29T15:49:03', '2005-08-01T20:19:03', '2'), + ('145', '2846', '2006-02-16T02:30:53', '2005-08-17T15:39:26', '2005-08-21T18:24:26', '2'), + ('141', '1497', '2006-02-16T02:30:53', '2005-08-02T19:29:47', '2005-08-09T16:27:47', '2'), + ('529', '1748', '2006-02-16T02:30:53', '2005-08-19T12:10:57', '2005-08-27T12:22:57', '2'), + ('323', '2742', '2006-02-16T02:30:53', '2005-07-28T03:41:13', '2005-08-06T05:06:13', '2'), + ('459', '839', '2006-02-16T02:30:53', '2005-07-31T09:15:38', '2005-08-03T10:31:38', '2'), + ('400', '4316', '2006-02-16T02:30:53', '2005-07-27T01:08:26', '2005-08-04T22:58:26', '2'), + ('369', '3213', '2006-02-16T02:30:53', '2005-05-30T11:04:58', '2005-06-07T13:22:58', '2'), + ('108', '2171', '2006-02-16T02:30:53', '2005-08-21T18:51:43', '2005-08-27T16:30:43', '2'), + ('62', '4377', '2006-02-16T02:30:53', '2005-06-15T04:59:43', '2005-06-24T03:32:43', '2'), + ('515', '3379', '2006-02-16T02:30:53', '2005-06-18T23:53:15', '2005-06-24T21:16:15', '2'), + ('348', '985', '2006-02-16T02:30:53', '2005-08-19T16:20:56', '2005-08-23T15:51:56', '2'), + ('280', '766', '2006-02-16T02:30:53', '2005-05-31T02:39:16', '2005-06-01T06:03:16', '2'), + ('210', '2883', '2006-02-16T02:30:53', '2005-07-28T05:36:13', '2005-08-03T11:28:13', '2'), + ('151', '2704', '2006-02-16T02:30:53', '2005-07-12T13:41:16', '2005-07-13T14:41:16', '2'), + ('550', '1031', '2006-02-16T02:30:53', '2005-08-23T20:07:10', '2005-09-01T22:12:10', '2'), + ('451', '1078', '2006-02-16T02:30:53', '2005-07-27T02:20:22', '2005-08-02T05:04:22', '2'), + ('266', '3914', '2006-02-16T02:30:53', '2005-08-20T04:10:26', '2005-08-26T06:45:26', '2'), + ('468', '2520', '2006-02-16T02:30:53', '2005-06-17T09:32:10', '2005-06-23T03:50:10', '2'), + ('161', '3080', '2006-02-16T02:30:53', '2005-08-22T07:54:58', '2005-08-24T12:46:58', '2'), + ('53', '291', '2006-02-16T02:30:53', '2005-06-21T03:01:10', '2005-06-24T06:59:10', '2'), + ('31', '1620', '2006-02-16T02:30:53', '2005-06-19T10:06:20', '2005-06-21T04:30:20', '2'), + ('125', '2598', '2006-02-16T02:30:53', '2005-05-26T05:30:03', '2005-06-02T09:48:03', '2'), + ('326', '352', '2006-02-16T02:30:53', '2005-05-31T21:03:17', '2005-06-08T19:58:17', '2'), + ('225', '126', '2006-02-16T02:30:53', '2005-07-11T09:55:34', '2005-07-13T10:01:34', '2'), + ('598', '4525', '2006-02-16T02:30:53', '2005-08-22T19:54:26', '2005-08-29T01:38:26', '2'), + ('276', '3780', '2006-02-16T02:30:53', '2005-07-30T13:38:17', '2005-08-08T18:17:17', '2'), + ('251', '2724', '2006-02-16T02:30:53', '2005-06-21T17:24:40', '2005-06-29T13:59:40', '2'), + ('65', '1676', '2006-02-16T02:30:53', '2005-07-30T16:12:28', '2005-08-05T18:34:28', '2'), + ('534', '3744', '2006-02-16T02:30:53', '2005-08-18T20:07:46', '2005-08-26T18:49:46', '2'), + ('330', '1791', '2006-02-16T02:30:53', '2005-08-17T21:24:47', '2005-08-20T20:35:47', '2'), + ('407', '1780', '2006-02-16T02:30:53', '2005-08-02T12:32:28', '2005-08-11T18:15:28', '2'), + ('403', '2787', '2006-02-16T02:30:53', '2005-07-30T23:35:42', '2005-08-09T02:08:42', '2'), + ('358', '1248', '2006-02-16T02:30:53', '2005-07-31T02:37:44', '2005-08-02T07:07:44', '2'), + ('379', '1281', '2006-02-16T02:30:53', '2005-06-15T15:20:06', '2005-06-24T18:42:06', '2'), + ('23', '1515', '2006-02-16T02:30:53', '2005-07-06T11:43:44', '2005-07-13T07:55:44', '2'), + ('459', '3293', '2006-02-16T02:30:53', '2005-08-01T11:00:20', '2005-08-10T11:52:20', '2'), + ('205', '4426', '2006-02-16T02:30:53', '2005-08-20T17:20:49', '2005-08-24T16:52:49', '2'), + ('63', '2813', '2006-02-16T02:30:53', '2005-07-30T05:09:32', '2005-08-02T06:12:32', '2'), + ('292', '2502', '2006-02-16T02:30:53', '2005-08-22T12:38:20', '2005-08-27T07:36:20', '2'), + ('232', '700', '2006-02-16T02:30:53', '2005-07-30T15:03:16', '2005-07-31T16:09:16', '2'), + ('175', '2462', '2006-02-16T02:30:53', '2005-08-18T13:21:52', '2005-08-20T12:14:52', '2'), + ('543', '1758', '2006-02-16T02:30:53', '2005-08-23T13:46:27', '2005-08-27T10:16:27', '2'), + ('45', '341', '2006-02-16T02:30:53', '2005-08-23T22:13:04', '2005-09-01T02:48:04', '2'), + ('526', '1433', '2006-02-16T02:30:53', '2005-06-15T06:13:45', '2005-06-16T03:59:45', '2'), + ('265', '1113', '2006-02-16T02:30:53', '2005-07-29T15:39:29', '2005-08-01T10:33:29', '2'), + ('138', '366', '2006-02-16T02:30:53', '2005-07-29T07:06:03', '2005-08-06T12:00:03', '2'), + ('274', '1890', '2006-02-16T02:30:53', '2005-05-27T11:26:11', '2005-06-03T16:44:11', '2'), + ('165', '2533', '2006-02-16T02:30:53', '2005-07-30T12:06:58', '2005-08-08T11:33:58', '2'), + ('31', '1986', '2006-02-16T02:30:53', '2005-06-18T15:49:48', '2005-06-27T20:31:48', '2'), + ('86', '3525', '2006-02-16T02:30:53', '2005-07-07T13:05:52', '2005-07-10T12:17:52', '2'), + ('139', '1062', '2006-02-16T02:30:53', '2005-06-14T23:42:56', '2005-06-16T04:02:56', '2'), + ('339', '2782', '2006-02-16T02:30:53', '2005-08-18T17:52:51', '2005-08-25T14:40:51', '2'), + ('269', '3995', '2006-02-16T02:30:53', '2005-05-24T23:11:53', '2005-05-29T20:34:53', '2'), + ('249', '592', '2006-02-16T02:30:53', '2005-07-28T07:56:00', '2005-07-30T10:33:00', '2'), + ('352', '38', '2006-02-16T02:30:53', '2005-07-28T09:18:07', '2005-08-04T10:23:07', '2'), + ('85', '1857', '2006-02-16T02:30:53', '2005-07-31T16:03:55', '2005-08-04T15:16:55', '2'), + ('512', '2219', '2006-02-16T02:30:53', '2005-08-19T06:12:44', '2005-08-28T10:49:44', '2'), + ('468', '3878', '2006-02-16T02:30:53', '2005-05-26T20:35:19', '2005-06-04T02:31:19', '2'), + ('268', '695', '2006-02-16T02:30:53', '2005-08-21T05:38:05', '2005-08-28T09:07:05', '2'), + ('159', '1381', '2006-02-16T02:30:53', '2005-05-29T22:51:20', '2005-06-07T17:37:20', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['11754', '12033', '7058', '3564', '13052', '2960', '1453', '1140', '8136', '3047', '52', '4645', '12792', '6796', '5145', '1922', '6814', '5638', '3889', '11065', '8132', '9202', '4921', '7534', '11423', '9663', '5191', '9192', '512', '5414', '724', '1413', '1442', '3475', '8947', '8987', '9687', '15492', '13783', '11468', '3254', '10327', '13532', '6892', '12000', '8718', '8808', '11450', '1742', '8794', '13717', '8912', '10666', '2142', '15887', '11554', '3509', '13678', '9889', '13300', '3544', '12046', '13401', '6558', '12579', '478', '14069', '15880', '5496', '2064', '10935', '1245', '10836', '3791', '162', '16004', '11427', '7419', '13068', '9500', '1726', '7026', '13894', '4697', '8031', '12848', '8052', '15458', '1478', '5175', '15079', '11299', '14466', '4832', '11872', '7394', '15990', '15277', '13874', '8515']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('163', '3747', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('321', '2731', '2006-02-16T02:30:53', '2005-08-17T20:14:34', '2005-08-26T00:22:34', '2'), + ('90', '716', '2006-02-16T02:30:53', '2005-07-27T03:50:46', '2005-08-04T07:40:46', '2'), + ('402', '1096', '2006-02-16T02:30:53', '2005-07-06T03:02:13', '2005-07-13T01:41:13', '2'), + ('502', '3036', '2006-02-16T02:30:53', '2005-08-19T09:31:42', '2005-08-28T15:11:42', '2'), + ('16', '3970', '2006-02-16T02:30:53', '2005-06-20T07:10:09', '2005-06-26T08:14:09', '2'), + ('457', '3274', '2006-02-16T02:30:53', '2005-06-15T19:36:39', '2005-06-19T00:16:39', '2'), + ('10', '3731', '2006-02-16T02:30:53', '2005-05-31T19:36:30', '2005-06-07T18:33:30', '2'), + ('429', '3434', '2006-02-16T02:30:53', '2005-07-28T20:05:48', '2005-08-01T20:31:48', '2'), + ('13', '624', '2006-02-16T02:30:53', '2005-06-20T12:45:33', '2005-06-29T13:09:33', '2'), + ('507', '4017', '2006-02-16T02:30:53', '2005-05-25T06:51:29', '2005-05-31T01:27:29', '2'), + ('400', '687', '2006-02-16T02:30:53', '2005-07-08T09:20:09', '2005-07-09T06:07:09', '2'), + ('405', '1435', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('291', '227', '2006-02-16T02:30:53', '2005-07-12T16:44:16', '2005-07-16T14:48:16', '2'), + ('204', '2397', '2006-02-16T02:30:53', '2005-07-09T08:13:25', '2005-07-10T03:56:25', '2'), + ('343', '2484', '2006-02-16T02:30:53', '2005-06-17T06:04:25', '2005-06-18T09:15:25', '2'), + ('579', '1863', '2006-02-16T02:30:53', '2005-07-12T18:11:58', '2005-07-18T20:37:58', '2'), + ('570', '1528', '2006-02-16T02:30:53', '2005-07-10T06:32:49', '2005-07-13T04:32:49', '2'), + ('576', '2005', '2006-02-16T02:30:53', '2005-07-06T18:56:25', '2005-07-08T21:22:25', '2'), + ('357', '2226', '2006-02-16T02:30:53', '2005-08-02T06:57:55', '2005-08-06T01:31:55', '2'), + ('562', '1303', '2006-02-16T02:30:53', '2005-07-28T19:57:31', '2005-08-02T22:16:31', '2'), + ('466', '4525', '2006-02-16T02:30:53', '2005-07-30T12:43:24', '2005-08-07T10:39:24', '2'), + ('109', '425', '2006-02-16T02:30:53', '2005-07-08T21:43:21', '2005-07-10T16:06:21', '2'), + ('282', '2276', '2006-02-16T02:30:53', '2005-07-27T21:26:17', '2005-08-05T00:23:17', '2'), + ('241', '3431', '2006-02-16T02:30:53', '2005-08-02T19:57:13', '2005-08-06T00:54:13', '2'), + ('339', '2099', '2006-02-16T02:30:53', '2005-07-31T06:10:48', '2005-08-01T11:40:48', '2'), + ('167', '2131', '2006-02-16T02:30:53', '2005-07-09T10:26:48', '2005-07-10T15:52:48', '2'), + ('102', '2372', '2006-02-16T02:30:53', '2005-07-30T12:26:26', '2005-08-04T07:54:26', '2'), + ('231', '2176', '2006-02-16T02:30:53', '2005-05-28T03:07:50', '2005-06-05T02:12:50', '2'), + ('174', '1201', '2006-02-16T02:30:53', '2005-07-09T20:29:36', '2005-07-13T01:55:36', '2'), + ('416', '3770', '2006-02-16T02:30:53', '2005-05-29T05:53:23', '2005-06-05T04:01:23', '2'), + ('96', '3625', '2006-02-16T02:30:53', '2005-06-15T17:25:07', '2005-06-21T17:17:07', '2'), + ('122', '3912', '2006-02-16T02:30:53', '2005-06-15T18:55:34', '2005-06-22T20:41:34', '2'), + ('8', '2189', '2006-02-16T02:30:53', '2005-07-05T23:01:21', '2005-07-13T23:07:21', '2'), + ('24', '341', '2006-02-16T02:30:53', '2005-07-30T03:15:37', '2005-08-04T07:10:37', '2'), + ('135', '1434', '2006-02-16T02:30:53', '2005-07-30T04:37:36', '2005-08-08T10:14:36', '2'), + ('470', '3540', '2006-02-16T02:30:53', '2005-07-31T06:52:54', '2005-08-01T03:40:54', '2'), + ('520', '1298', '2006-02-16T02:30:53', '2005-08-23T02:13:46', '2005-08-26T21:53:46', '2'), + ('28', '2643', '2006-02-16T02:30:53', '2005-08-20T12:11:03', '2005-08-21T15:53:03', '2'), + ('413', '3168', '2006-02-16T02:30:53', '2005-08-02T21:47:26', '2005-08-05T02:30:26', '2'), + ('472', '3893', '2006-02-16T02:30:53', '2005-06-21T03:27:10', '2005-06-22T22:01:10', '2'), + ('382', '328', '2006-02-16T02:30:53', '2005-08-01T04:55:35', '2005-08-07T08:17:35', '2'), + ('168', '1433', '2006-02-16T02:30:53', '2005-08-20T03:29:28', '2005-08-23T22:53:28', '2'), + ('138', '1567', '2006-02-16T02:30:53', '2005-07-12T21:10:04', '2005-07-13T23:03:04', '2'), + ('149', '2256', '2006-02-16T02:30:53', '2005-08-17T18:49:44', '2005-08-24T16:34:44', '2'), + ('23', '137', '2006-02-16T02:30:53', '2005-07-29T17:41:14', '2005-08-01T18:22:14', '2'), + ('173', '593', '2006-02-16T02:30:53', '2005-07-29T21:39:07', '2005-08-03T02:09:07', '2'), + ('214', '2009', '2006-02-16T02:30:53', '2005-08-02T20:45:54', '2005-08-08T17:17:54', '2'), + ('576', '2772', '2006-02-16T02:30:53', '2005-06-16T16:37:48', '2005-06-17T19:47:48', '2'), + ('320', '3509', '2006-02-16T02:30:53', '2005-07-29T20:59:38', '2005-07-31T00:15:38', '2'), + ('300', '1629', '2006-02-16T02:30:53', '2005-08-20T09:50:52', '2005-08-28T11:32:52', '2'), + ('280', '1686', '2006-02-16T02:30:53', '2005-07-30T01:31:25', '2005-08-02T07:14:25', '2'), + ('197', '1945', '2006-02-16T02:30:53', '2005-08-01T16:56:36', '2005-08-07T22:23:36', '2'), + ('253', '1787', '2006-02-16T02:30:53', '2005-06-17T21:55:43', '2005-06-26T19:41:43', '2'), + ('201', '4263', '2006-02-16T02:30:53', '2005-08-23T16:54:09', '2005-08-26T13:20:09', '2'), + ('460', '2212', '2006-02-16T02:30:53', '2005-08-17T01:05:17', '2005-08-20T06:20:17', '2'), + ('182', '4394', '2006-02-16T02:30:53', '2005-07-06T00:24:57', '2005-07-09T18:48:57', '2'), + ('337', '1118', '2006-02-16T02:30:53', '2005-08-20T08:38:24', '2005-08-27T13:54:24', '2'), + ('143', '2842', '2006-02-16T02:30:53', '2005-07-31T14:02:50', '2005-08-05T12:09:50', '2'), + ('531', '842', '2006-02-16T02:30:53', '2005-08-19T18:46:56', '2005-08-28T20:23:56', '2'), + ('115', '3098', '2006-02-16T02:30:53', '2005-07-06T02:06:32', '2005-07-09T04:35:32', '2'), + ('435', '3895', '2006-02-16T02:30:53', '2005-08-17T20:47:46', '2005-08-19T16:09:46', '2'), + ('139', '488', '2006-02-16T02:30:53', '2005-08-19T22:16:16', '2005-08-25T19:01:16', '2'), + ('164', '2195', '2006-02-16T02:30:53', '2005-07-12T05:16:07', '2005-07-13T05:32:07', '2'), + ('547', '3021', '2006-02-16T02:30:53', '2005-08-18T15:47:49', '2005-08-20T18:12:49', '2'), + ('557', '424', '2006-02-16T02:30:53', '2005-05-27T22:38:20', '2005-05-31T18:39:20', '2'), + ('197', '2239', '2006-02-16T02:30:53', '2005-08-20T22:51:25', '2005-08-30T00:30:25', '2'), + ('528', '2538', '2006-02-16T02:30:53', '2005-08-23T16:43:54', '2005-08-31T14:40:54', '2'), + ('369', '3182', '2006-02-16T02:30:53', '2005-07-10T00:20:23', '2005-07-18T21:10:23', '2'), + ('67', '1970', '2006-02-16T02:30:53', '2005-06-17T15:57:56', '2005-06-23T21:04:56', '2'), + ('42', '4373', '2006-02-16T02:30:53', '2005-08-02T02:54:53', '2005-08-10T00:07:53', '2'), + ('234', '1314', '2006-02-16T02:30:53', '2005-06-15T05:09:01', '2005-06-22T06:55:01', '2'), + ('217', '4534', '2006-02-16T02:30:53', '2005-08-01T23:29:58', '2005-08-07T23:03:58', '2'), + ('452', '3426', '2006-02-16T02:30:53', '2005-07-06T14:24:56', '2005-07-14T11:06:56', '2'), + ('296', '1229', '2006-02-16T02:30:53', '2005-05-26T02:02:05', '2005-05-27T03:38:05', '2'), + ('147', '2223', '2006-02-16T02:30:53', '2005-08-23T20:53:20', '2005-08-31T15:15:20', '2'), + ('403', '3287', '2006-02-16T02:30:53', '2005-08-02T20:02:39', '2005-08-04T22:26:39', '2'), + ('352', '3454', '2006-02-16T02:30:53', '2005-07-27T17:04:15', '2005-08-05T21:54:15', '2'), + ('1', '3019', '2006-02-16T02:30:53', '2005-08-19T09:55:16', '2005-08-20T14:44:16', '2'), + ('241', '2808', '2006-02-16T02:30:53', '2005-07-30T23:58:36', '2005-08-07T21:08:36', '2'), + ('3', '116', '2006-02-16T02:30:53', '2005-06-16T15:19:10', '2005-06-25T11:39:10', '2'), + ('493', '3456', '2006-02-16T02:30:53', '2005-07-27T02:48:58', '2005-07-29T03:41:58', '2'), + ('360', '2649', '2006-02-16T02:30:53', '2005-08-20T15:55:20', '2005-08-26T17:26:20', '2'), + ('224', '4143', '2006-02-16T02:30:53', '2005-07-08T11:19:14', '2005-07-12T07:14:14', '2'), + ('40', '2196', '2006-02-16T02:30:53', '2005-07-28T16:15:49', '2005-08-02T18:27:49', '2'), + ('539', '2833', '2006-02-16T02:30:53', '2005-08-19T02:05:11', '2005-08-24T05:27:11', '2'), + ('166', '2460', '2006-02-16T02:30:53', '2005-07-28T16:57:31', '2005-08-03T18:03:31', '2'), + ('590', '25', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('336', '435', '2006-02-16T02:30:53', '2005-06-15T21:12:13', '2005-06-18T21:43:13', '2'), + ('409', '1003', '2006-02-16T02:30:53', '2005-07-09T09:34:28', '2005-07-15T15:19:28', '2'), + ('540', '4552', '2006-02-16T02:30:53', '2005-08-22T11:09:56', '2005-08-24T15:40:56', '2'), + ('1', '3232', '2006-02-16T02:30:53', '2005-08-02T15:36:52', '2005-08-10T16:40:52', '2'), + ('442', '923', '2006-02-16T02:30:53', '2005-08-21T13:03:13', '2005-08-22T15:19:13', '2'), + ('509', '1838', '2006-02-16T02:30:53', '2005-07-08T18:07:05', '2005-07-10T19:37:05', '2'), + ('113', '4306', '2006-02-16T02:30:53', '2005-08-17T14:11:45', '2005-08-21T17:02:45', '2'), + ('30', '2399', '2006-02-16T02:30:53', '2005-07-27T16:03:08', '2005-08-04T11:27:08', '2'), + ('512', '3233', '2006-02-16T02:30:53', '2005-08-23T20:25:11', '2005-08-25T15:01:11', '2'), + ('217', '1780', '2006-02-16T02:30:53', '2005-08-22T19:02:48', '2005-08-31T18:53:48', '2'), + ('86', '72', '2006-02-16T02:30:53', '2005-08-20T15:11:48', '2005-08-21T18:26:48', '2'), + ('477', '1071', '2006-02-16T02:30:53', '2005-07-29T09:55:20', '2005-08-05T07:08:20', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['1525', '346', '4929', '15976', '3045', '2950', '13942', '14164', '13103', '1932', '10007', '11532', '4977', '332', '13639', '3978', '356', '3172', '15197', '3523', '18', '6263', '13540', '12286', '5218', '11031', '1074', '10362', '10098', '491', '1939', '13002', '13589', '9115', '1417', '13444', '329', '484', '4778', '9140', '2226', '338', '13756', '9438', '9937', '8854', '5345', '8389', '6219', '1977', '3072', '8672', '12796', '14203', '5097', '10465', '13925', '8421', '1193', '14016', '8979', '7635', '11021', '2310', '2604', '13803', '7080', '13308', '1206', '6231', '8975', '15573', '13248', '15465', '1459', '2499', '3711', '14640', '8298', '8386', '15055', '6264', '5834', '4798', '15654', '9704', '6351', '1817', '4638', '857', '14139', '7126', '10111', '5817', '8508', '9071', '7005', '12745', '2180', '7504']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('304', '1467', '2006-02-16T02:30:53', '2005-06-16T00:26:07', '2005-06-19T22:37:07', '2'), + ('14', '4319', '2006-02-16T02:30:53', '2005-05-27T04:34:41', '2005-06-05T04:24:41', '2'), + ('297', '734', '2006-02-16T02:30:53', '2005-07-08T22:06:18', '2005-07-17T18:17:18', '2'), + ('227', '835', '2006-02-16T02:30:53', '2005-08-23T20:07:08', '2005-08-25T01:47:08', '2'), + ('459', '3065', '2006-02-16T02:30:53', '2005-06-20T12:42:00', '2005-06-23T10:49:00', '2'), + ('561', '1438', '2006-02-16T02:30:53', '2005-06-20T06:08:36', '2005-06-27T07:45:36', '2'), + ('211', '4403', '2006-02-16T02:30:53', '2005-08-20T17:30:52', '2005-08-25T13:46:52', '2'), + ('274', '2381', '2006-02-16T02:30:53', '2005-08-21T02:58:02', '2005-08-29T23:17:02', '2'), + ('274', '1751', '2006-02-16T02:30:53', '2005-08-19T11:05:51', '2005-08-26T09:16:51', '2'), + ('120', '3185', '2006-02-16T02:30:53', '2005-06-17T06:54:41', '2005-06-19T05:12:41', '2'), + ('445', '293', '2006-02-16T02:30:53', '2005-07-31T17:54:58', '2005-08-05T17:24:58', '2'), + ('413', '1947', '2006-02-16T02:30:53', '2005-08-17T00:34:14', '2005-08-22T19:37:14', '2'), + ('584', '3310', '2006-02-16T02:30:53', '2005-07-09T00:15:50', '2005-07-10T00:34:50', '2'), + ('299', '1529', '2006-02-16T02:30:53', '2005-05-27T02:27:10', '2005-06-03T01:26:10', '2'), + ('562', '2489', '2006-02-16T02:30:53', '2005-08-20T07:22:07', '2005-08-23T11:24:07', '2'), + ('343', '4341', '2006-02-16T02:30:53', '2005-07-06T23:04:33', '2005-07-10T17:45:33', '2'), + ('382', '2868', '2006-02-16T02:30:53', '2005-05-27T06:32:30', '2005-05-30T06:24:30', '2'), + ('31', '1758', '2006-02-16T02:30:53', '2005-06-20T22:19:25', '2005-06-24T17:18:25', '2'), + ('159', '2915', '2006-02-16T02:30:53', '2005-08-22T16:14:25', '2005-08-26T16:22:25', '2'), + ('549', '2171', '2006-02-16T02:30:53', '2005-07-06T01:01:38', '2005-07-10T20:24:38', '2'), + ('19', '3376', '2006-02-16T02:30:53', '2005-05-25T01:10:47', '2005-05-31T06:35:47', '2'), + ('336', '2391', '2006-02-16T02:30:53', '2005-07-11T15:33:50', '2005-07-17T12:49:50', '2'), + ('557', '3785', '2006-02-16T02:30:53', '2005-08-20T03:41:23', '2005-08-27T09:09:23', '2'), + ('34', '3729', '2006-02-16T02:30:53', '2005-08-18T04:57:59', '2005-08-18T23:20:59', '2'), + ('83', '1121', '2006-02-16T02:30:53', '2005-07-09T11:57:12', '2005-07-13T06:34:12', '2'), + ('361', '1205', '2006-02-16T02:30:53', '2005-08-02T05:52:58', '2005-08-07T07:14:58', '2'), + ('503', '2508', '2006-02-16T02:30:53', '2005-05-31T10:04:42', '2005-06-02T15:27:42', '2'), + ('181', '72', '2006-02-16T02:30:53', '2005-08-01T05:55:13', '2005-08-10T10:23:13', '2'), + ('155', '1324', '2006-02-16T02:30:53', '2005-07-31T20:41:17', '2005-08-02T00:06:17', '2'), + ('196', '1326', '2006-02-16T02:30:53', '2005-05-28T00:13:35', '2005-05-29T00:11:35', '2'), + ('11', '605', '2006-02-16T02:30:53', '2005-06-17T07:26:45', '2005-06-25T13:06:45', '2'), + ('477', '3892', '2006-02-16T02:30:53', '2005-08-19T07:37:58', '2005-08-26T11:32:58', '2'), + ('574', '3216', '2006-02-16T02:30:53', '2005-08-20T05:47:25', '2005-08-23T01:29:25', '2'), + ('322', '3750', '2006-02-16T02:30:53', '2005-07-30T09:13:55', '2005-08-04T04:02:55', '2'), + ('570', '1334', '2006-02-16T02:30:53', '2005-06-15T17:45:51', '2005-06-19T14:00:51', '2'), + ('37', '2564', '2006-02-16T02:30:53', '2005-08-20T00:00:24', '2005-08-21T05:59:24', '2'), + ('231', '2659', '2006-02-16T02:30:53', '2005-05-27T01:57:14', '2005-05-31T04:19:14', '2'), + ('491', '3115', '2006-02-16T02:30:53', '2005-05-27T23:26:45', '2005-05-29T21:16:45', '2'), + ('78', '611', '2006-02-16T02:30:53', '2005-07-08T15:51:51', '2005-07-12T16:58:51', '2'), + ('25', '4095', '2006-02-16T02:30:53', '2005-07-30T10:12:01', '2005-08-06T09:16:01', '2'), + ('225', '3487', '2006-02-16T02:30:53', '2005-06-18T03:39:56', '2005-06-24T07:26:56', '2'), + ('165', '2596', '2006-02-16T02:30:53', '2005-05-27T03:42:52', '2005-06-01T05:23:52', '2'), + ('252', '1146', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('14', '121', '2006-02-16T02:30:53', '2005-07-30T21:36:15', '2005-08-07T16:54:15', '2'), + ('521', '3697', '2006-02-16T02:30:53', '2005-07-31T15:28:10', '2005-08-06T21:20:10', '2'), + ('527', '1365', '2006-02-16T02:30:53', '2005-07-29T23:40:07', '2005-08-01T00:35:07', '2'), + ('348', '3055', '2006-02-16T02:30:53', '2005-07-09T17:28:18', '2005-07-11T14:30:18', '2'), + ('133', '1241', '2006-02-16T02:30:53', '2005-07-29T05:50:09', '2005-08-06T05:15:09', '2'), + ('303', '38', '2006-02-16T02:30:53', '2005-07-11T13:18:37', '2005-07-13T13:18:37', '2'), + ('459', '2468', '2006-02-16T02:30:53', '2005-06-17T09:38:22', '2005-06-23T14:19:22', '2'), + ('423', '4131', '2006-02-16T02:30:53', '2005-06-20T14:21:31', '2005-06-27T18:46:31', '2'), + ('495', '405', '2006-02-16T02:30:53', '2005-07-29T15:49:48', '2005-08-06T17:59:48', '2'), + ('368', '1285', '2006-02-16T02:30:53', '2005-08-19T00:22:24', '2005-08-19T22:53:24', '2'), + ('95', '3668', '2006-02-16T02:30:53', '2005-08-21T03:51:52', '2005-08-24T06:13:52', '2'), + ('343', '3252', '2006-02-16T02:30:53', '2005-07-09T06:09:51', '2005-07-10T03:55:51', '2'), + ('534', '4384', '2006-02-16T02:30:53', '2005-08-01T09:45:25', '2005-08-10T09:08:25', '2'), + ('565', '4034', '2006-02-16T02:30:53', '2005-08-20T17:05:34', '2005-08-27T15:32:34', '2'), + ('588', '3399', '2006-02-16T02:30:53', '2005-07-29T07:00:47', '2005-08-02T08:03:47', '2'), + ('561', '4504', '2006-02-16T02:30:53', '2005-06-15T01:24:20', '2005-06-21T02:29:20', '2'), + ('220', '509', '2006-02-16T02:30:53', '2005-08-20T20:52:03', '2005-08-23T18:04:03', '2'), + ('529', '1394', '2006-02-16T02:30:53', '2005-07-30T04:20:25', '2005-08-08T03:39:25', '2'), + ('413', '55', '2006-02-16T02:30:53', '2005-07-28T01:08:11', '2005-08-01T03:32:11', '2'), + ('385', '2069', '2006-02-16T02:30:53', '2005-08-02T05:30:11', '2005-08-05T05:50:11', '2'), + ('409', '2590', '2006-02-16T02:30:53', '2005-06-18T08:45:59', '2005-06-26T05:06:59', '2'), + ('28', '2889', '2006-02-16T02:30:53', '2005-06-19T06:30:10', '2005-06-25T11:16:10', '2'), + ('486', '1084', '2006-02-16T02:30:53', '2005-08-20T12:46:17', '2005-08-24T15:44:17', '2'), + ('466', '710', '2006-02-16T02:30:53', '2005-07-27T04:25:25', '2005-08-04T04:22:25', '2'), + ('414', '3189', '2006-02-16T02:30:53', '2005-08-19T18:59:42', '2005-08-28T13:21:42', '2'), + ('264', '1097', '2006-02-16T02:30:53', '2005-06-15T02:27:07', '2005-06-18T22:46:07', '2'), + ('122', '2526', '2006-02-16T02:30:53', '2005-07-11T14:02:36', '2005-07-13T19:04:36', '2'), + ('356', '3288', '2006-02-16T02:30:53', '2005-07-30T04:10:18', '2005-08-07T01:06:18', '2'), + ('561', '3133', '2006-02-16T02:30:53', '2005-08-23T05:28:36', '2005-08-27T05:37:36', '2'), + ('559', '2864', '2006-02-16T02:30:53', '2005-08-19T16:47:41', '2005-08-28T18:11:41', '2'), + ('520', '362', '2006-02-16T02:30:53', '2005-08-23T01:16:33', '2005-08-28T20:08:33', '2'), + ('218', '1862', '2006-02-16T02:30:53', '2005-06-15T20:25:53', '2005-06-22T23:34:53', '2'), + ('348', '3172', '2006-02-16T02:30:53', '2005-06-18T23:01:36', '2005-06-20T21:50:36', '2'), + ('75', '1914', '2006-02-16T02:30:53', '2005-07-06T10:46:15', '2005-07-07T09:25:15', '2'), + ('253', '1880', '2006-02-16T02:30:53', '2005-08-21T19:03:19', '2005-08-27T00:37:19', '2'), + ('493', '952', '2006-02-16T02:30:53', '2005-07-29T02:47:36', '2005-08-05T07:58:36', '2'), + ('435', '388', '2006-02-16T02:30:53', '2005-07-29T05:45:30', '2005-08-05T03:56:30', '2'), + ('125', '623', '2006-02-16T02:30:53', '2005-08-22T10:14:39', '2005-08-25T07:25:39', '2'), + ('565', '4246', '2006-02-16T02:30:53', '2005-07-11T15:42:35', '2005-07-12T11:29:35', '2'), + ('360', '85', '2006-02-16T02:30:53', '2005-07-10T16:44:12', '2005-07-14T11:34:12', '2'), + ('212', '3874', '2006-02-16T02:30:53', '2005-07-08T16:45:16', '2005-07-16T13:45:16', '2'), + ('471', '4360', '2006-02-16T02:30:53', '2005-08-23T08:34:53', '2005-08-30T04:18:53', '2'), + ('385', '1402', '2006-02-16T02:30:53', '2005-07-31T07:39:32', '2005-08-06T01:50:32', '2'), + ('507', '1852', '2006-02-16T02:30:53', '2005-07-11T20:31:44', '2005-07-18T17:16:44', '2'), + ('574', '1354', '2006-02-16T02:30:53', '2005-06-16T21:20:52', '2005-06-19T16:24:52', '2'), + ('305', '2240', '2006-02-16T02:30:53', '2005-07-08T08:57:20', '2005-07-10T05:08:20', '2'), + ('204', '2569', '2006-02-16T02:30:53', '2005-05-30T02:01:23', '2005-06-02T06:07:23', '2'), + ('561', '2280', '2006-02-16T02:30:53', '2005-08-21T02:04:33', '2005-08-22T04:16:33', '2'), + ('582', '3240', '2006-02-16T02:30:53', '2005-07-27T06:13:13', '2005-07-28T08:22:13', '2'), + ('38', '3474', '2006-02-16T02:30:53', '2005-07-31T21:08:33', '2005-08-06T02:58:33', '2'), + ('28', '2993', '2006-02-16T02:30:53', '2005-07-10T15:49:12', '2005-07-18T19:30:12', '2'), + ('484', '4173', '2006-02-16T02:30:53', '2005-07-29T09:34:38', '2005-08-01T14:52:38', '2'), + ('523', '3151', '2006-02-16T02:30:53', '2005-07-30T07:40:58', '2005-08-01T06:59:58', '2'), + ('446', '2438', '2006-02-16T02:30:53', '2005-07-27T01:38:36', '2005-08-02T05:56:36', '2'), + ('24', '262', '2006-02-16T02:30:53', '2005-08-18T22:22:45', '2005-08-20T01:44:45', '2'), + ('497', '3564', '2006-02-16T02:30:53', '2005-06-18T00:47:43', '2005-06-25T04:12:43', '2'), + ('283', '3354', '2006-02-16T02:30:53', '2005-07-27T20:24:31', '2005-07-30T21:25:31', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['2130', '5808', '7301', '4040', '11039', '6211', '6152', '3467', '11915', '1848', '1736', '4296', '8377', '13480', '11700', '15456', '2985', '6518', '1661', '7288', '5182', '11720', '1845', '13632', '2006', '6870', '11015', '8120', '4788', '3142', '8973', '3275', '66', '4705', '12911', '8443', '8482', '2587', '9976', '14050', '9469', '6590', '16009', '8554', '13519', '5437', '2065', '13196', '10764', '4323', '15678', '9689', '911', '11429', '2017', '14026', '10', '481', '8493', '3427', '15248', '6852', '3618', '10552', '2609', '11765', '11252', '173', '9427', '8077', '1740', '279', '3585', '5932', '10270', '11431', '11099', '13252', '2197', '4047', '5284', '7309', '12491', '13138', '14338', '10763', '1660', '1688', '14947', '2349', '15637', '3245', '12850', '4015', '12529', '8869', '9372', '15606', '4156', '10975']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('413', '1369', '2006-02-16T02:30:53', '2005-06-17T21:00:44', '2005-06-26T00:05:44', '2'), + ('170', '2310', '2006-02-16T02:30:53', '2005-07-10T15:17:33', '2005-07-14T12:14:33', '2'), + ('93', '3367', '2006-02-16T02:30:53', '2005-07-27T12:50:23', '2005-08-01T09:43:23', '2'), + ('103', '3046', '2006-02-16T02:30:53', '2005-07-07T03:02:40', '2005-07-16T06:05:40', '2'), + ('170', '549', '2006-02-16T02:30:53', '2005-08-02T06:00:53', '2005-08-05T06:19:53', '2'), + ('6', '2699', '2006-02-16T02:30:53', '2005-07-11T12:39:01', '2005-07-20T15:59:01', '2'), + ('361', '560', '2006-02-16T02:30:53', '2005-07-11T09:25:52', '2005-07-17T07:40:52', '2'), + ('543', '729', '2006-02-16T02:30:53', '2005-06-21T22:19:25', '2005-06-27T00:03:25', '2'), + ('269', '1557', '2006-02-16T02:30:53', '2005-08-17T16:05:28', '2005-08-25T19:53:28', '2'), + ('526', '3797', '2006-02-16T02:30:53', '2005-06-17T00:07:07', '2005-06-21T21:41:07', '2'), + ('139', '3771', '2006-02-16T02:30:53', '2005-06-16T15:52:32', '2005-06-21T14:39:32', '2'), + ('407', '977', '2006-02-16T02:30:53', '2005-07-07T16:16:03', '2005-07-08T20:16:03', '2'), + ('73', '270', '2006-02-16T02:30:53', '2005-07-29T05:27:40', '2005-07-30T02:52:40', '2'), + ('16', '206', '2006-02-16T02:30:53', '2005-08-20T01:10:27', '2005-08-27T22:18:27', '2'), + ('104', '2365', '2006-02-16T02:30:53', '2005-08-17T07:12:31', '2005-08-18T04:21:31', '2'), + ('262', '2451', '2006-02-16T02:30:53', '2005-08-23T01:07:01', '2005-08-24T23:28:01', '2'), + ('154', '122', '2006-02-16T02:30:53', '2005-06-20T08:45:08', '2005-06-22T04:26:08', '2'), + ('288', '2698', '2006-02-16T02:30:53', '2005-07-12T03:59:42', '2005-07-19T22:21:42', '2'), + ('508', '2403', '2006-02-16T02:30:53', '2005-06-16T10:12:57', '2005-06-24T09:23:57', '2'), + ('226', '45', '2006-02-16T02:30:53', '2005-07-27T12:24:59', '2005-08-02T15:52:59', '2'), + ('197', '725', '2006-02-16T02:30:53', '2005-07-09T10:08:10', '2005-07-16T14:36:10', '2'), + ('121', '1707', '2006-02-16T02:30:53', '2005-08-17T07:46:54', '2005-08-26T04:19:54', '2'), + ('215', '3395', '2006-02-16T02:30:53', '2005-06-16T23:56:11', '2005-06-19T01:41:11', '2'), + ('409', '4008', '2006-02-16T02:30:53', '2005-08-20T07:10:52', '2005-08-29T10:19:52', '2'), + ('215', '992', '2006-02-16T02:30:53', '2005-06-17T11:47:03', '2005-06-19T13:47:03', '2'), + ('13', '3102', '2006-02-16T02:30:53', '2005-07-12T20:13:45', '2005-07-16T22:09:45', '2'), + ('138', '4331', '2006-02-16T02:30:53', '2005-08-02T05:13:00', '2005-08-08T04:18:00', '2'), + ('235', '3993', '2006-02-16T02:30:53', '2005-07-28T19:24:24', '2005-07-31T14:31:24', '2'), + ('533', '691', '2006-02-16T02:30:53', '2005-07-08T16:17:35', '2005-07-11T11:56:35', '2'), + ('9', '3926', '2006-02-16T02:30:53', '2005-06-20T19:59:28', '2005-06-28T19:51:28', '2'), + ('282', '886', '2006-02-16T02:30:53', '2005-07-30T04:09:13', '2005-08-07T22:30:13', '2'), + ('368', '2320', '2006-02-16T02:30:53', '2005-06-21T05:33:04', '2005-06-30T00:37:04', '2'), + ('86', '1162', '2006-02-16T02:30:53', '2005-05-25T09:35:12', '2005-05-29T04:16:12', '2'), + ('85', '3709', '2006-02-16T02:30:53', '2005-07-08T11:50:38', '2005-07-12T15:58:38', '2'), + ('367', '1770', '2006-02-16T02:30:53', '2005-08-19T04:24:10', '2005-08-26T00:35:10', '2'), + ('251', '1059', '2006-02-16T02:30:53', '2005-07-29T07:33:12', '2005-08-02T01:36:12', '2'), + ('405', '2686', '2006-02-16T02:30:53', '2005-07-29T08:46:33', '2005-07-31T11:07:33', '2'), + ('331', '2188', '2006-02-16T02:30:53', '2005-06-19T05:06:14', '2005-06-24T10:50:14', '2'), + ('579', '4219', '2006-02-16T02:30:53', '2005-07-31T16:57:49', '2005-08-03T16:33:49', '2'), + ('596', '1737', '2006-02-16T02:30:53', '2005-08-20T22:09:04', '2005-08-26T01:39:04', '2'), + ('59', '967', '2006-02-16T02:30:53', '2005-07-30T22:56:34', '2005-08-07T03:16:34', '2'), + ('442', '1067', '2006-02-16T02:30:53', '2005-07-12T07:08:21', '2005-07-18T06:16:21', '2'), + ('133', '3055', '2006-02-16T02:30:53', '2005-08-23T21:07:59', '2005-08-29T16:54:59', '2'), + ('582', '1563', '2006-02-16T02:30:53', '2005-07-29T11:16:29', '2005-07-31T06:38:29', '2'), + ('12', '182', '2006-02-16T02:30:53', '2005-08-20T02:37:07', '2005-08-23T01:26:07', '2'), + ('26', '3532', '2006-02-16T02:30:53', '2005-07-09T21:32:29', '2005-07-15T00:27:29', '2'), + ('266', '844', '2006-02-16T02:30:53', '2005-06-17T16:03:46', '2005-06-22T16:41:46', '2'), + ('202', '458', '2006-02-16T02:30:53', '2005-08-19T14:40:32', '2005-08-26T18:15:32', '2'), + ('357', '3808', '2006-02-16T02:30:53', '2005-08-01T20:32:42', '2005-08-03T22:14:42', '2'), + ('336', '1287', '2006-02-16T02:30:53', '2005-07-07T17:55:53', '2005-07-13T16:43:53', '2'), + ('413', '1345', '2006-02-16T02:30:53', '2005-08-23T09:23:45', '2005-08-27T11:38:45', '2'), + ('498', '819', '2006-02-16T02:30:53', '2005-07-31T07:00:08', '2005-08-04T03:33:08', '2'), + ('366', '1404', '2006-02-16T02:30:53', '2005-05-30T10:50:22', '2005-06-07T12:26:22', '2'), + ('348', '1098', '2006-02-16T02:30:53', '2005-08-02T20:03:52', '2005-08-10T16:38:52', '2'), + ('516', '1434', '2006-02-16T02:30:53', '2005-06-17T12:33:30', '2005-06-19T10:08:30', '2'), + ('231', '115', '2006-02-16T02:30:53', '2005-08-20T21:21:08', '2005-08-22T23:19:08', '2'), + ('399', '1824', '2006-02-16T02:30:53', '2005-05-25T00:02:21', '2005-05-31T22:44:21', '2'), + ('445', '72', '2006-02-16T02:30:53', '2005-05-27T22:49:27', '2005-05-30T17:46:27', '2'), + ('390', '664', '2006-02-16T02:30:53', '2005-07-29T09:04:31', '2005-08-04T05:17:31', '2'), + ('561', '560', '2006-02-16T02:30:53', '2005-06-21T18:31:09', '2005-06-22T14:18:09', '2'), + ('20', '977', '2006-02-16T02:30:53', '2005-08-22T17:53:06', '2005-08-25T18:43:06', '2'), + ('75', '2182', '2006-02-16T02:30:53', '2005-07-12T19:33:49', '2005-07-13T20:01:49', '2'), + ('264', '330', '2006-02-16T02:30:53', '2005-07-06T05:58:45', '2005-07-15T09:13:45', '2'), + ('119', '4263', '2006-02-16T02:30:53', '2005-08-01T12:49:44', '2005-08-04T16:20:44', '2'), + ('383', '2254', '2006-02-16T02:30:53', '2005-06-19T07:13:12', '2005-06-28T12:30:12', '2'), + ('308', '4311', '2006-02-16T02:30:53', '2005-08-17T09:55:28', '2005-08-19T15:53:28', '2'), + ('337', '2410', '2006-02-16T02:30:53', '2005-08-02T13:42:13', '2005-08-06T19:04:13', '2'), + ('533', '3596', '2006-02-16T02:30:53', '2005-05-26T03:42:10', '2005-05-28T01:37:10', '2'), + ('85', '1494', '2006-02-16T02:30:53', '2005-07-30T21:16:33', '2005-08-05T17:23:33', '2'), + ('122', '3253', '2006-02-16T02:30:53', '2005-07-28T17:54:35', '2005-07-29T19:28:35', '2'), + ('324', '2282', '2006-02-16T02:30:53', '2005-06-16T16:29:00', '2005-06-20T14:07:00', '2'), + ('384', '661', '2006-02-16T02:30:53', '2005-05-26T18:02:50', '2005-06-03T18:48:50', '2'), + ('266', '2726', '2006-02-16T02:30:53', '2005-07-06T04:22:36', '2005-07-09T06:16:36', '2'), + ('523', '2269', '2006-02-16T02:30:53', '2005-07-10T22:05:15', '2005-07-12T17:04:15', '2'), + ('168', '2025', '2006-02-16T02:30:53', '2005-08-01T03:10:24', '2005-08-07T03:04:24', '2'), + ('271', '1409', '2006-02-16T02:30:53', '2005-08-02T20:05:16', '2005-08-04T00:05:16', '2'), + ('102', '1444', '2006-02-16T02:30:53', '2005-08-02T08:07:12', '2005-08-07T12:11:12', '2'), + ('451', '775', '2006-02-16T02:30:53', '2005-08-19T16:50:50', '2005-08-22T22:09:50', '2'), + ('103', '3350', '2006-02-16T02:30:53', '2005-06-18T01:50:27', '2005-06-19T01:31:27', '2'), + ('364', '3475', '2006-02-16T02:30:53', '2005-07-07T03:28:49', '2005-07-09T02:42:49', '2'), + ('585', '1036', '2006-02-16T02:30:53', '2005-07-09T15:08:21', '2005-07-16T09:53:21', '2'), + ('317', '633', '2006-02-16T02:30:53', '2005-07-27T13:00:29', '2005-07-29T12:15:29', '2'), + ('247', '2354', '2006-02-16T02:30:53', '2005-08-18T12:48:45', '2005-08-22T12:40:45', '2'), + ('214', '3138', '2006-02-16T02:30:53', '2005-08-19T12:30:01', '2005-08-21T06:35:01', '2'), + ('205', '1789', '2006-02-16T02:30:53', '2005-08-21T08:36:03', '2005-08-24T12:31:03', '2'), + ('276', '987', '2006-02-16T02:30:53', '2005-08-01T20:32:27', '2005-08-05T01:24:27', '2'), + ('238', '2374', '2006-02-16T02:30:53', '2005-06-16T10:12:55', '2005-06-18T05:56:55', '2'), + ('49', '383', '2006-02-16T02:30:53', '2005-06-16T12:11:20', '2005-06-18T08:39:20', '2'), + ('68', '3497', '2006-02-16T02:30:53', '2005-08-22T06:07:52', '2005-08-28T01:12:52', '2'), + ('495', '1536', '2006-02-16T02:30:53', '2005-06-18T12:25:14', '2005-06-19T11:24:14', '2'), + ('172', '445', '2006-02-16T02:30:53', '2005-08-23T07:53:38', '2005-08-29T03:16:38', '2'), + ('358', '2057', '2006-02-16T02:30:53', '2005-06-21T03:06:11', '2005-06-25T08:06:11', '2'), + ('440', '1816', '2006-02-16T02:30:53', '2005-08-19T02:08:06', '2005-08-20T21:06:06', '2'), + ('233', '3032', '2006-02-16T02:30:53', '2005-07-07T00:59:46', '2005-07-14T03:16:46', '2'), + ('382', '1956', '2006-02-16T02:30:53', '2005-08-18T13:53:36', '2005-08-19T18:20:36', '2'), + ('308', '4353', '2006-02-16T02:30:53', '2005-07-30T00:06:32', '2005-07-31T20:49:32', '2'), + ('454', '4075', '2006-02-16T02:30:53', '2005-07-30T19:04:30', '2005-08-09T00:18:30', '2'), + ('279', '1811', '2006-02-16T02:30:53', '2005-08-23T06:50:27', '2005-08-28T04:23:27', '2'), + ('585', '1259', '2006-02-16T02:30:53', '2005-07-07T09:03:51', '2005-07-12T09:46:51', '2'), + ('361', '2616', '2006-02-16T02:30:53', '2005-08-02T04:11:25', '2005-08-04T04:39:25', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['8056', '10147', '1904', '9954', '6909', '10955', '12036', '439', '1456', '10319', '497', '4734', '777', '9467', '10287', '3956', '11820', '999', '2525', '12312', '3665', '10110', '12035', '12080', '12330', '2398', '14483', '7950', '8628', '9812', '13586', '8304', '4833', '818', '834', '13069', '11097', '7922', '12761', '1934', '5462', '14328', '4997', '9995', '15904', '9285', '6599', '4572', '3433', '14442', '12031', '5031', '13298', '6006', '3696', '7154', '4856', '13122', '3346', '10174', '6029', '1338', '10658', '3179', '14575', '976', '12368', '13931', '14856', '15842', '11717', '10977', '5666', '15913', '9414', '2636', '12770', '8595', '10256', '12460', '4248', '15896', '12279', '9143', '2947', '12015', '11051', '11730', '9714', '11224', '316', '10726', '7489', '12441', '12132', '9129', '15174', '4073', '13721', '9220']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('589', '4018', '2006-02-16T02:30:53', '2005-07-28T17:04:15', '2005-08-03T19:11:15', '2'), + ('198', '1351', '2006-02-16T02:30:53', '2005-07-31T22:18:43', '2005-08-02T23:08:43', '2'), + ('87', '2472', '2006-02-16T02:30:53', '2005-06-17T04:45:41', '2005-06-17T23:56:41', '2'), + ('463', '1830', '2006-02-16T02:30:53', '2005-07-31T15:57:07', '2005-08-05T12:04:07', '2'), + ('174', '769', '2006-02-16T02:30:53', '2005-07-12T22:09:30', '2005-07-17T02:05:30', '2'), + ('490', '618', '2006-02-16T02:30:53', '2005-08-02T03:32:34', '2005-08-09T21:53:34', '2'), + ('85', '3620', '2006-02-16T02:30:53', '2005-08-17T20:19:06', '2005-08-18T19:57:06', '2'), + ('319', '354', '2006-02-16T02:30:53', '2005-05-27T17:54:48', '2005-06-02T23:01:48', '2'), + ('590', '632', '2006-02-16T02:30:53', '2005-06-15T20:00:11', '2005-06-23T18:03:11', '2'), + ('394', '3120', '2006-02-16T02:30:53', '2005-08-01T04:37:19', '2005-08-05T03:18:19', '2'), + ('20', '2636', '2006-02-16T02:30:53', '2005-05-28T00:54:39', '2005-06-03T20:47:39', '2'), + ('546', '1928', '2006-02-16T02:30:53', '2005-07-08T13:12:12', '2005-07-10T09:01:12', '2'), + ('360', '451', '2006-02-16T02:30:53', '2005-05-29T14:07:58', '2005-06-03T08:41:58', '2'), + ('202', '1905', '2006-02-16T02:30:53', '2005-07-30T22:45:34', '2005-08-08T00:58:34', '2'), + ('141', '125', '2006-02-16T02:30:53', '2005-08-01T03:37:01', '2005-08-05T23:03:01', '2'), + ('147', '15', '2006-02-16T02:30:53', '2005-07-06T22:01:51', '2005-07-12T21:35:51', '2'), + ('401', '2801', '2006-02-16T02:30:53', '2005-08-17T12:25:33', '2005-08-19T07:04:33', '2'), + ('413', '4433', '2006-02-16T02:30:53', '2005-05-31T00:25:10', '2005-06-03T06:05:10', '2'), + ('365', '1307', '2006-02-16T02:30:53', '2005-06-19T00:48:22', '2005-06-24T19:10:22', '2'), + ('185', '80', '2006-02-16T02:30:53', '2005-08-18T06:07:26', '2005-08-21T02:07:26', '2'), + ('102', '922', '2006-02-16T02:30:53', '2005-07-06T08:23:08', '2005-07-13T13:38:08', '2'), + ('138', '4081', '2006-02-16T02:30:53', '2005-07-31T21:06:12', '2005-08-03T02:03:12', '2'), + ('469', '2335', '2006-02-16T02:30:53', '2005-08-17T20:18:06', '2005-08-21T16:41:06', '2'), + ('394', '1491', '2006-02-16T02:30:53', '2005-08-17T22:08:04', '2005-08-19T22:55:04', '2'), + ('587', '889', '2006-02-16T02:30:53', '2005-08-18T06:46:33', '2005-08-26T11:35:33', '2'), + ('526', '3001', '2006-02-16T02:30:53', '2005-06-18T15:56:53', '2005-06-27T14:25:53', '2'), + ('275', '37', '2006-02-16T02:30:53', '2005-08-21T13:43:59', '2005-08-28T16:38:59', '2'), + ('122', '2286', '2006-02-16T02:30:53', '2005-07-28T13:21:00', '2005-08-05T18:47:00', '2'), + ('550', '4484', '2006-02-16T02:30:53', '2005-07-29T14:06:24', '2005-08-06T10:42:24', '2'), + ('57', '1540', '2006-02-16T02:30:53', '2005-07-31T11:28:07', '2005-08-01T12:35:07', '2'), + ('445', '4544', '2006-02-16T02:30:53', '2005-08-20T05:40:33', '2005-08-25T01:32:33', '2'), + ('119', '4431', '2006-02-16T02:30:53', '2005-07-29T03:08:30', '2005-08-02T03:04:30', '2'), + ('581', '2921', '2006-02-16T02:30:53', '2005-07-08T18:07:35', '2005-07-13T15:29:35', '2'), + ('321', '4106', '2006-02-16T02:30:53', '2005-05-29T20:47:53', '2005-06-02T23:18:53', '2'), + ('84', '3628', '2006-02-16T02:30:53', '2005-05-29T23:24:30', '2005-05-30T22:00:30', '2'), + ('299', '368', '2006-02-16T02:30:53', '2005-08-19T09:55:20', '2005-08-24T04:10:20', '2'), + ('575', '2493', '2006-02-16T02:30:53', '2005-08-02T08:05:46', '2005-08-10T12:00:46', '2'), + ('125', '817', '2006-02-16T02:30:53', '2005-07-28T12:05:25', '2005-08-02T12:13:25', '2'), + ('364', '2684', '2006-02-16T02:30:53', '2005-08-18T23:05:22', '2005-08-22T01:08:22', '2'), + ('16', '4000', '2006-02-16T02:30:53', '2005-06-17T07:04:57', '2005-06-25T12:21:57', '2'), + ('583', '871', '2006-02-16T02:30:53', '2005-07-09T22:56:53', '2005-07-11T21:50:53', '2'), + ('489', '3194', '2006-02-16T02:30:53', '2005-08-21T08:18:20', '2005-08-25T03:05:20', '2'), + ('102', '186', '2006-02-16T02:30:53', '2005-07-09T01:06:03', '2005-07-18T04:21:03', '2'), + ('180', '1978', '2006-02-16T02:30:53', '2005-07-31T17:30:47', '2005-08-04T12:20:47', '2'), + ('37', '179', '2006-02-16T02:30:53', '2005-08-23T17:32:19', '2005-08-24T21:05:19', '2'), + ('273', '3686', '2006-02-16T02:30:53', '2005-07-30T15:26:08', '2005-08-06T15:59:08', '2'), + ('519', '4348', '2006-02-16T02:30:53', '2005-07-12T07:41:14', '2005-07-21T02:45:14', '2'), + ('323', '1324', '2006-02-16T02:30:53', '2005-07-08T05:36:59', '2005-07-12T04:46:59', '2'), + ('228', '1077', '2006-02-16T02:30:53', '2005-06-21T19:07:19', '2005-06-29T18:01:19', '2'), + ('205', '122', '2006-02-16T02:30:53', '2005-08-21T12:00:21', '2005-08-23T17:00:21', '2'), + ('10', '2793', '2006-02-16T02:30:53', '2005-08-17T20:11:35', '2005-08-24T23:48:35', '2'), + ('312', '4224', '2006-02-16T02:30:53', '2005-07-09T02:36:37', '2005-07-14T03:09:37', '2'), + ('361', '2133', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('399', '4201', '2006-02-16T02:30:53', '2005-07-11T01:38:42', '2005-07-17T05:18:42', '2'), + ('497', '3244', '2006-02-16T02:30:53', '2005-07-06T10:04:55', '2005-07-11T15:58:55', '2'), + ('518', '2019', '2006-02-16T02:30:53', '2005-07-27T07:16:17', '2005-07-28T04:04:17', '2'), + ('7', '2441', '2006-02-16T02:30:53', '2005-07-08T18:47:38', '2005-07-13T15:02:38', '2'), + ('277', '3319', '2006-02-16T02:30:53', '2005-08-19T11:53:49', '2005-08-26T16:01:49', '2'), + ('189', '4393', '2006-02-16T02:30:53', '2005-06-21T11:06:53', '2005-06-22T15:19:53', '2'), + ('359', '2459', '2006-02-16T02:30:53', '2005-07-31T23:40:08', '2005-08-06T21:08:08', '2'), + ('520', '2030', '2006-02-16T02:30:53', '2005-07-11T02:36:46', '2005-07-14T20:51:46', '2'), + ('25', '1206', '2006-02-16T02:30:53', '2005-06-15T12:17:34', '2005-06-19T07:40:34', '2'), + ('469', '2943', '2006-02-16T02:30:53', '2005-08-01T16:39:18', '2005-08-09T18:17:18', '2'), + ('163', '2214', '2006-02-16T02:30:53', '2005-06-20T22:37:59', '2005-06-26T22:26:59', '2'), + ('159', '3752', '2006-02-16T02:30:53', '2005-08-21T16:51:34', '2005-08-30T20:13:34', '2'), + ('581', '2290', '2006-02-16T02:30:53', '2005-05-30T21:11:19', '2005-06-06T02:16:19', '2'), + ('392', '3777', '2006-02-16T02:30:53', '2005-08-18T07:57:38', '2005-08-25T05:49:38', '2'), + ('32', '3884', '2006-02-16T02:30:53', '2005-08-20T17:16:10', '2005-08-27T12:03:10', '2'), + ('151', '3292', '2006-02-16T02:30:53', '2005-08-22T02:31:51', '2005-08-26T23:41:51', '2'), + ('146', '1850', '2006-02-16T02:30:53', '2005-08-23T15:36:05', '2005-08-30T14:05:05', '2'), + ('566', '1371', '2006-02-16T02:30:53', '2005-08-17T07:44:09', '2005-08-20T09:39:09', '2'), + ('300', '2302', '2006-02-16T02:30:53', '2005-08-02T04:12:17', '2005-08-06T06:52:17', '2'), + ('242', '2225', '2006-02-16T02:30:53', '2005-07-10T08:10:29', '2005-07-17T04:54:29', '2'), + ('93', '3894', '2006-02-16T02:30:53', '2005-08-23T17:48:30', '2005-08-31T21:17:30', '2'), + ('484', '578', '2006-02-16T02:30:53', '2005-07-30T20:46:02', '2005-08-07T21:23:02', '2'), + ('253', '2102', '2006-02-16T02:30:53', '2005-06-19T09:13:06', '2005-06-25T07:47:06', '2'), + ('575', '1654', '2006-02-16T02:30:53', '2005-08-18T23:29:00', '2005-08-26T20:57:00', '2'), + ('423', '3225', '2006-02-16T02:30:53', '2005-07-29T12:47:43', '2005-08-07T13:51:43', '2'), + ('58', '780', '2006-02-16T02:30:53', '2005-08-01T02:47:11', '2005-08-05T05:21:11', '2'), + ('419', '3550', '2006-02-16T02:30:53', '2005-08-18T11:25:13', '2005-08-27T06:27:13', '2'), + ('161', '773', '2006-02-16T02:30:53', '2005-07-07T13:59:20', '2005-07-14T15:18:20', '2'), + ('585', '528', '2006-02-16T02:30:53', '2005-08-23T17:09:56', '2005-08-31T14:51:56', '2'), + ('421', '4159', '2006-02-16T02:30:53', '2005-08-18T04:47:30', '2005-08-19T09:47:30', '2'), + ('511', '2962', '2006-02-16T02:30:53', '2005-07-30T10:22:11', '2005-08-07T06:13:11', '2'), + ('151', '4302', '2006-02-16T02:30:53', '2005-06-20T06:00:21', '2005-06-23T10:04:21', '2'), + ('11', '593', '2006-02-16T02:30:53', '2005-08-17T19:32:44', '2005-08-23T13:36:44', '2'), + ('446', '4189', '2006-02-16T02:30:53', '2005-08-02T06:23:39', '2005-08-06T06:46:39', '2'), + ('98', '3817', '2006-02-16T02:30:53', '2005-08-17T08:22:00', '2005-08-22T05:43:00', '2'), + ('144', '1532', '2006-02-16T02:30:53', '2005-07-31T08:15:32', '2005-08-03T08:33:32', '2'), + ('181', '3938', '2006-02-16T02:30:53', '2005-08-02T12:40:38', '2005-08-04T10:02:38', '2'), + ('249', '3828', '2006-02-16T02:30:53', '2005-05-26T23:22:55', '2005-05-29T23:25:55', '2'), + ('75', '749', '2006-02-16T02:30:53', '2005-08-01T19:14:53', '2005-08-08T23:56:53', '2'), + ('16', '3732', '2006-02-16T02:30:53', '2005-07-27T19:39:38', '2005-07-30T23:10:38', '2'), + ('561', '2163', '2006-02-16T02:30:53', '2005-08-18T10:47:57', '2005-08-26T07:11:57', '2'), + ('403', '2600', '2006-02-16T02:30:53', '2005-08-17T23:37:03', '2005-08-22T04:53:03', '2'), + ('125', '2658', '2006-02-16T02:30:53', '2005-07-30T09:51:21', '2005-08-07T08:50:21', '2'), + ('111', '19', '2006-02-16T02:30:53', '2005-08-22T15:26:36', '2005-08-31T10:47:36', '2'), + ('290', '647', '2006-02-16T02:30:53', '2005-07-07T04:49:13', '2005-07-10T03:20:13', '2'), + ('297', '1444', '2006-02-16T02:30:53', '2005-08-20T10:02:59', '2005-08-24T07:02:59', '2'), + ('569', '2463', '2006-02-16T02:30:53', '2005-07-30T13:17:27', '2005-08-07T11:34:27', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['9938', '2413', '15610', '109', '16047', '7350', '2745', '4688', '6143', '13952', '14632', '14828', '15632', '1767', '15791', '10804', '8259', '4336', '14986', '12967', '6543', '5596', '2171', '11282', '4874', '4484', '2371', '2136', '16012', '8273', '9357', '1898', '9070', '9529', '7361', '12959', '14931', '11456', '793', '8999', '15250', '15619', '10240', '12362', '1912', '13574', '13910', '6110', '7761', '1092', '12771', '13479', '3428', '11783', '10153', '16036', '7476', '4074', '7292', '9515', '6176', '8924', '14269', '13231', '3599', '9546', '1751', '1537', '9579', '1113', '6979', '12741', '14459', '1425', '6195', '10467', '13918', '5439', '15144', '3682', '4388', '10138', '8700', '11807', '4775', '12087', '1199', '13333', '14980', '6193', '1043', '9178', '6684', '9795', '5226', '4679', '8971', '15301', '10330', '11858']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('63', '2871', '2006-02-16T02:30:53', '2005-07-31T15:28:47', '2005-08-09T21:24:47', '2'), + ('170', '1851', '2006-02-16T02:30:53', '2005-06-18T16:59:34', '2005-06-27T16:10:34', '2'), + ('215', '2076', '2006-02-16T02:30:53', '2005-08-23T06:56:15', '2005-08-24T07:37:15', '2'), + ('503', '1044', '2006-02-16T02:30:53', '2005-05-25T18:40:20', '2005-05-29T20:39:20', '2'), + ('114', '2088', '2006-02-16T02:30:53', '2005-08-23T22:42:48', '2005-08-25T02:48:48', '2'), + ('410', '737', '2006-02-16T02:30:53', '2005-07-27T14:34:14', '2005-08-02T19:19:14', '2'), + ('26', '1253', '2006-02-16T02:30:53', '2005-06-19T16:21:19', '2005-06-21T22:07:19', '2'), + ('80', '3574', '2006-02-16T02:30:53', '2005-07-08T11:03:29', '2005-07-17T15:41:29', '2'), + ('169', '1030', '2006-02-16T02:30:53', '2005-07-11T09:02:37', '2005-07-19T05:57:37', '2'), + ('199', '224', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('38', '2807', '2006-02-16T02:30:53', '2005-08-21T18:48:06', '2005-08-25T00:33:06', '2'), + ('319', '4114', '2006-02-16T02:30:53', '2005-08-22T01:34:05', '2005-08-27T06:27:05', '2'), + ('60', '2941', '2006-02-16T02:30:53', '2005-08-23T07:30:26', '2005-08-24T07:53:26', '2'), + ('205', '1162', '2006-02-16T02:30:53', '2005-06-16T18:01:36', '2005-06-18T12:39:36', '2'), + ('445', '4147', '2006-02-16T02:30:53', '2005-08-23T14:02:13', '2005-09-01T09:03:13', '2'), + ('596', '2915', '2006-02-16T02:30:53', '2005-08-01T22:22:11', '2005-08-03T03:42:11', '2'), + ('274', '343', '2006-02-16T02:30:53', '2005-07-29T01:05:16', '2005-08-01T23:27:16', '2'), + ('532', '482', '2006-02-16T02:30:53', '2005-07-07T18:34:36', '2005-07-10T17:58:36', '2'), + ('278', '1493', '2006-02-16T02:30:53', '2005-08-22T07:37:24', '2005-08-23T04:22:24', '2'), + ('170', '3404', '2006-02-16T02:30:53', '2005-08-19T06:37:51', '2005-08-25T06:58:51', '2'), + ('264', '2568', '2006-02-16T02:30:53', '2005-07-12T04:54:32', '2005-07-15T09:50:32', '2'), + ('240', '1662', '2006-02-16T02:30:53', '2005-07-10T04:43:14', '2005-07-11T22:58:14', '2'), + ('147', '1768', '2006-02-16T02:30:53', '2005-06-18T00:06:04', '2005-06-24T18:09:04', '2'), + ('273', '1824', '2006-02-16T02:30:53', '2005-08-02T14:35:03', '2005-08-03T16:02:03', '2'), + ('223', '2386', '2006-02-16T02:30:53', '2005-07-08T19:23:38', '2005-07-13T14:39:38', '2'), + ('306', '2867', '2006-02-16T02:30:53', '2005-07-08T01:05:57', '2005-07-16T00:41:57', '2'), + ('248', '178', '2006-02-16T02:30:53', '2005-06-18T14:35:29', '2005-06-22T09:38:29', '2'), + ('20', '2651', '2006-02-16T02:30:53', '2005-06-17T21:16:41', '2005-06-24T22:42:41', '2'), + ('80', '2421', '2006-02-16T02:30:53', '2005-08-23T21:13:39', '2005-08-30T23:52:39', '2'), + ('532', '4244', '2006-02-16T02:30:53', '2005-07-29T01:33:16', '2005-08-06T04:26:16', '2'), + ('181', '3927', '2006-02-16T02:30:53', '2005-07-30T18:37:00', '2005-08-08T19:57:00', '2'), + ('143', '2873', '2006-02-16T02:30:53', '2005-06-17T04:28:11', '2005-06-25T07:04:11', '2'), + ('276', '3690', '2006-02-16T02:30:53', '2005-07-30T07:40:39', '2005-08-01T04:19:39', '2'), + ('123', '816', '2006-02-16T02:30:53', '2005-07-31T01:05:26', '2005-08-02T22:30:26', '2'), + ('463', '4567', '2006-02-16T02:30:53', '2005-07-27T14:53:55', '2005-07-31T19:48:55', '2'), + ('284', '1540', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('63', '657', '2006-02-16T02:30:53', '2005-08-22T05:38:55', '2005-08-28T04:15:55', '2'), + ('322', '3638', '2006-02-16T02:30:53', '2005-08-02T21:14:04', '2005-08-07T19:49:04', '2'), + ('528', '379', '2006-02-16T02:30:53', '2005-05-29T16:44:08', '2005-06-06T19:21:08', '2'), + ('424', '3458', '2006-02-16T02:30:53', '2005-07-30T04:55:46', '2005-08-01T00:16:46', '2'), + ('143', '2176', '2006-02-16T02:30:53', '2005-08-22T18:03:11', '2005-08-27T12:19:11', '2'), + ('3', '2468', '2006-02-16T02:30:53', '2005-08-23T07:10:14', '2005-08-26T07:21:14', '2'), + ('109', '4494', '2006-02-16T02:30:53', '2005-08-01T02:09:33', '2005-08-07T02:22:33', '2'), + ('367', '3131', '2006-02-16T02:30:53', '2005-08-18T07:48:05', '2005-08-20T05:16:05', '2'), + ('538', '4136', '2006-02-16T02:30:53', '2005-06-17T05:18:32', '2005-06-20T10:01:32', '2'), + ('552', '2383', '2006-02-16T02:30:53', '2005-08-20T05:10:39', '2005-08-21T02:21:39', '2'), + ('133', '252', '2006-02-16T02:30:53', '2005-08-20T16:30:49', '2005-08-24T13:30:49', '2'), + ('405', '541', '2006-02-16T02:30:53', '2005-07-11T07:23:47', '2005-07-20T03:17:47', '2'), + ('112', '3568', '2006-02-16T02:30:53', '2005-07-28T06:31:45', '2005-07-30T01:36:45', '2'), + ('278', '4412', '2006-02-16T02:30:53', '2005-05-31T12:15:57', '2005-06-03T15:39:57', '2'), + ('484', '3076', '2006-02-16T02:30:53', '2005-08-18T23:29:23', '2005-08-22T17:31:23', '2'), + ('87', '1262', '2006-02-16T02:30:53', '2005-08-20T01:09:11', '2005-08-26T05:35:11', '2'), + ('40', '1959', '2006-02-16T02:30:53', '2005-06-21T18:39:34', '2005-06-22T18:23:34', '2'), + ('152', '979', '2006-02-16T02:30:53', '2005-08-17T10:39:24', '2005-08-21T12:43:24', '2'), + ('297', '2945', '2006-02-16T02:30:53', '2005-07-31T22:30:10', '2005-08-06T02:32:10', '2'), + ('425', '1372', '2006-02-16T02:30:53', '2005-08-23T22:12:44', '2005-08-25T17:48:44', '2'), + ('64', '2288', '2006-02-16T02:30:53', '2005-07-27T19:08:56', '2005-07-31T16:36:56', '2'), + ('412', '2347', '2006-02-16T02:30:53', '2005-07-07T04:49:49', '2005-07-12T04:51:49', '2'), + ('468', '795', '2006-02-16T02:30:53', '2005-07-27T12:34:14', '2005-08-01T18:16:14', '2'), + ('264', '3099', '2006-02-16T02:30:53', '2005-07-31T00:35:05', '2005-08-02T23:35:05', '2'), + ('279', '2969', '2006-02-16T02:30:53', '2005-07-11T10:48:21', '2005-07-12T15:54:21', '2'), + ('38', '2291', '2006-02-16T02:30:53', '2005-07-30T02:08:58', '2005-08-05T02:13:58', '2'), + ('241', '531', '2006-02-16T02:30:53', '2005-08-21T06:22:07', '2005-08-30T00:41:07', '2'), + ('280', '2126', '2006-02-16T02:30:53', '2005-08-19T16:12:49', '2005-08-27T17:14:49', '2'), + ('577', '3262', '2006-02-16T02:30:53', '2005-07-06T05:16:36', '2005-07-13T07:14:36', '2'), + ('63', '211', '2006-02-16T02:30:53', '2005-07-31T01:47:40', '2005-08-02T07:25:40', '2'), + ('123', '138', '2006-02-16T02:30:53', '2005-06-16T17:00:14', '2005-06-17T12:12:14', '2'), + ('594', '4577', '2006-02-16T02:30:53', '2005-06-16T00:52:51', '2005-06-20T19:33:51', '2'), + ('35', '3547', '2006-02-16T02:30:53', '2005-07-31T02:59:20', '2005-08-06T03:52:20', '2'), + ('451', '2078', '2006-02-16T02:30:53', '2005-05-31T15:58:44', '2005-06-05T18:05:44', '2'), + ('141', '1001', '2006-02-16T02:30:53', '2005-07-27T00:49:53', '2005-07-31T03:59:53', '2'), + ('435', '2084', '2006-02-16T02:30:53', '2005-08-18T22:17:05', '2005-08-25T20:07:05', '2'), + ('98', '1532', '2006-02-16T02:30:53', '2005-08-21T12:48:08', '2005-08-27T10:50:08', '2'), + ('108', '1308', '2006-02-16T02:30:53', '2005-06-15T18:13:46', '2005-06-18T22:50:46', '2'), + ('319', '4193', '2006-02-16T02:30:53', '2005-07-11T12:00:32', '2005-07-16T15:00:32', '2'), + ('412', '3773', '2006-02-16T02:30:53', '2005-08-01T09:45:58', '2005-08-09T10:17:58', '2'), + ('248', '3301', '2006-02-16T02:30:53', '2005-08-20T16:47:32', '2005-08-21T12:00:32', '2'), + ('58', '1993', '2006-02-16T02:30:53', '2005-07-09T21:39:35', '2005-07-13T17:45:35', '2'), + ('527', '559', '2006-02-16T02:30:53', '2005-08-22T13:49:18', '2005-08-26T11:11:18', '2'), + ('98', '2597', '2006-02-16T02:30:53', '2005-07-06T09:22:48', '2005-07-14T11:17:48', '2'), + ('210', '3150', '2006-02-16T02:30:53', '2005-07-07T20:58:03', '2005-07-16T20:05:03', '2'), + ('225', '179', '2006-02-16T02:30:53', '2005-07-31T22:02:09', '2005-08-07T20:46:09', '2'), + ('196', '3710', '2006-02-16T02:30:53', '2005-07-29T16:56:01', '2005-07-31T16:19:01', '2'), + ('201', '4052', '2006-02-16T02:30:53', '2005-08-17T11:51:15', '2005-08-21T11:47:15', '2'), + ('595', '4277', '2006-02-16T02:30:53', '2005-07-08T15:44:05', '2005-07-11T20:39:05', '2'), + ('144', '324', '2006-02-16T02:30:53', '2005-08-17T22:20:12', '2005-08-20T02:11:12', '2'), + ('238', '253', '2006-02-16T02:30:53', '2005-06-15T01:58:50', '2005-06-16T20:30:50', '2'), + ('64', '1092', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('518', '2701', '2006-02-16T02:30:53', '2005-08-22T07:16:45', '2005-08-26T06:04:45', '2'), + ('189', '465', '2006-02-16T02:30:53', '2005-07-11T11:46:57', '2005-07-19T14:11:57', '2'), + ('412', '2322', '2006-02-16T02:30:53', '2005-05-31T06:11:40', '2005-06-08T09:15:40', '2'), + ('448', '2046', '2006-02-16T02:30:53', '2005-07-30T11:58:50', '2005-08-08T15:24:50', '2'), + ('583', '2817', '2006-02-16T02:30:53', '2005-07-12T12:14:42', '2005-07-21T11:07:42', '2'), + ('63', '2005', '2006-02-16T02:30:53', '2005-07-31T10:47:19', '2005-08-04T09:32:19', '2'), + ('218', '3128', '2006-02-16T02:30:53', '2005-07-09T12:10:44', '2005-07-11T17:32:44', '2'), + ('423', '3610', '2006-02-16T02:30:53', '2005-07-08T10:33:14', '2005-07-15T14:30:14', '2'), + ('35', '3572', '2006-02-16T02:30:53', '2005-07-30T04:03:58', '2005-08-08T04:16:58', '2'), + ('454', '619', '2006-02-16T02:30:53', '2005-08-22T19:44:16', '2005-08-26T22:57:16', '2'), + ('7', '1580', '2006-02-16T02:30:53', '2005-08-01T04:57:04', '2005-08-07T23:00:04', '2'), + ('503', '3483', '2006-02-16T02:30:53', '2005-08-17T13:50:31', '2005-08-19T08:45:31', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['6083', '12716', '10999', '2670', '3371', '3213', '1354', '10451', '2332', '11484', '11969', '13798', '11156', '6218', '15252', '10869', '2888', '4110', '11453', '6340', '9000', '11745', '6770', '342', '8436', '11261', '14542', '10752', '10538', '13433', '758', '13982', '11210', '3342', '2600', '2722', '2345', '12963', '9496', '15830', '8248', '15767', '2288', '6332', '13693', '4575', '5671', '15923', '12798', '178', '3056', '45', '10515', '14917', '12821', '7391', '1165', '10916', '3553', '12123', '14824', '15871', '11032', '8766', '10192', '4518', '4758', '110', '194', '4743', '3778', '12778', '9292', '14059', '74', '6597', '5705', '2344', '14800', '14724', '14753', '1011', '3463', '6954', '10660', '9729', '13563', '8953', '3733', '11791', '6394', '14103', '13063', '9016', '10586', '5843', '837', '2233', '6541', '14551']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('285', '3183', '2006-02-16T02:30:53', '2005-07-11T05:12:49', '2005-07-15T00:46:49', '2'), + ('570', '858', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('227', '2013', '2006-02-16T02:30:53', '2005-08-02T04:53:13', '2005-08-06T04:36:13', '2'), + ('457', '3518', '2006-02-16T02:30:53', '2005-06-19T11:30:16', '2005-06-21T17:25:16', '2'), + ('595', '2526', '2006-02-16T02:30:53', '2005-06-21T13:27:22', '2005-06-29T14:04:22', '2'), + ('534', '3832', '2006-02-16T02:30:53', '2005-06-21T01:05:19', '2005-06-27T21:55:19', '2'), + ('83', '1294', '2006-02-16T02:30:53', '2005-06-15T13:13:49', '2005-06-23T13:08:49', '2'), + ('9', '2435', '2006-02-16T02:30:53', '2005-08-01T09:11:25', '2005-08-03T12:37:25', '2'), + ('140', '2152', '2006-02-16T02:30:53', '2005-06-18T10:53:51', '2005-06-24T12:06:51', '2'), + ('165', '330', '2006-02-16T02:30:53', '2005-08-02T22:28:23', '2005-08-04T20:51:23', '2'), + ('550', '668', '2006-02-16T02:30:53', '2005-08-17T17:49:37', '2005-08-19T19:45:37', '2'), + ('15', '526', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('465', '907', '2006-02-16T02:30:53', '2005-08-02T09:56:06', '2005-08-04T13:36:06', '2'), + ('410', '815', '2006-02-16T02:30:53', '2005-07-11T13:14:58', '2005-07-16T08:13:58', '2'), + ('453', '1821', '2006-02-16T02:30:53', '2005-08-22T18:04:22', '2005-08-25T17:14:22', '2'), + ('568', '2967', '2006-02-16T02:30:53', '2005-08-02T00:26:54', '2005-08-04T03:40:54', '2'), + ('7', '468', '2006-02-16T02:30:53', '2005-06-20T01:50:56', '2005-06-22T05:05:56', '2'), + ('486', '226', '2006-02-16T02:30:53', '2005-07-07T06:44:27', '2005-07-12T05:43:27', '2'), + ('84', '4578', '2006-02-16T02:30:53', '2005-08-02T21:00:05', '2005-08-08T22:03:05', '2'), + ('264', '2374', '2006-02-16T02:30:53', '2005-07-11T19:46:05', '2005-07-20T16:51:05', '2'), + ('290', '3763', '2006-02-16T02:30:53', '2005-07-30T04:58:55', '2005-08-08T04:01:55', '2'), + ('240', '4018', '2006-02-16T02:30:53', '2005-08-17T09:00:01', '2005-08-26T14:29:01', '2'), + ('360', '2080', '2006-02-16T02:30:53', '2005-07-12T15:49:40', '2005-07-20T10:14:40', '2'), + ('539', '4019', '2006-02-16T02:30:53', '2005-05-27T04:11:04', '2005-05-29T01:28:04', '2'), + ('598', '2702', '2006-02-16T02:30:53', '2005-07-29T07:21:20', '2005-07-31T12:56:20', '2'), + ('204', '31', '2006-02-16T02:30:53', '2005-08-02T13:54:26', '2005-08-10T19:04:26', '2'), + ('101', '1247', '2006-02-16T02:30:53', '2005-08-21T15:36:34', '2005-08-27T20:24:34', '2'), + ('147', '3203', '2006-02-16T02:30:53', '2005-08-01T20:08:49', '2005-08-10T15:41:49', '2'), + ('37', '686', '2006-02-16T02:30:53', '2005-08-01T12:22:41', '2005-08-02T10:31:41', '2'), + ('171', '1647', '2006-02-16T02:30:53', '2005-08-19T23:30:53', '2005-08-22T05:18:53', '2'), + ('563', '1191', '2006-02-16T02:30:53', '2005-05-29T10:31:56', '2005-06-01T14:53:56', '2'), + ('448', '2901', '2006-02-16T02:30:53', '2005-08-20T19:08:25', '2005-08-28T15:59:25', '2'), + ('202', '422', '2006-02-16T02:30:53', '2005-08-02T12:15:54', '2005-08-04T16:18:54', '2'), + ('196', '2884', '2006-02-16T02:30:53', '2005-06-21T10:46:36', '2005-06-23T09:46:36', '2'), + ('423', '469', '2006-02-16T02:30:53', '2005-06-19T06:07:25', '2005-06-28T03:37:25', '2'), + ('45', '952', '2006-02-16T02:30:53', '2005-06-19T14:55:17', '2005-06-25T13:11:17', '2'), + ('6', '1818', '2006-02-16T02:30:53', '2005-06-18T12:03:23', '2005-06-22T14:25:23', '2'), + ('2', '1521', '2006-02-16T02:30:53', '2005-08-19T06:26:04', '2005-08-23T11:37:04', '2'), + ('125', '453', '2006-02-16T02:30:53', '2005-07-30T23:55:20', '2005-08-02T02:47:20', '2'), + ('467', '309', '2006-02-16T02:30:53', '2005-08-23T15:19:15', '2005-08-25T18:42:15', '2'), + ('272', '2017', '2006-02-16T02:30:53', '2005-07-29T00:41:56', '2005-08-05T18:53:56', '2'), + ('241', '3492', '2006-02-16T02:30:53', '2005-08-23T13:14:15', '2005-08-27T14:43:15', '2'), + ('247', '877', '2006-02-16T02:30:53', '2005-06-18T07:23:17', '2005-06-26T07:44:17', '2'), + ('538', '1733', '2006-02-16T02:30:53', '2005-07-11T19:19:06', '2005-07-13T13:51:06', '2'), + ('552', '933', '2006-02-16T02:30:53', '2005-08-20T09:11:42', '2005-08-24T15:00:42', '2'), + ('41', '231', '2006-02-16T02:30:53', '2005-07-08T05:49:14', '2005-07-11T04:08:14', '2'), + ('268', '1304', '2006-02-16T02:30:53', '2005-07-10T08:18:22', '2005-07-11T07:03:22', '2'), + ('276', '1693', '2006-02-16T02:30:53', '2005-08-23T18:08:19', '2005-08-26T18:06:19', '2'), + ('534', '4244', '2006-02-16T02:30:53', '2005-08-19T00:24:33', '2005-08-21T23:01:33', '2'), + ('196', '1489', '2006-02-16T02:30:53', '2005-05-26T04:21:46', '2005-06-04T07:09:46', '2'), + ('95', '2010', '2006-02-16T02:30:53', '2005-06-20T13:20:58', '2005-06-26T08:35:58', '2'), + ('436', '1853', '2006-02-16T02:30:53', '2005-05-25T05:59:39', '2005-06-02T09:56:39', '2'), + ('383', '874', '2006-02-16T02:30:53', '2005-08-01T11:41:33', '2005-08-08T06:23:33', '2'), + ('289', '377', '2006-02-16T02:30:53', '2005-08-22T05:03:59', '2005-08-29T04:00:59', '2'), + ('41', '3418', '2006-02-16T02:30:53', '2005-08-19T01:07:02', '2005-08-23T01:22:02', '2'), + ('531', '1153', '2006-02-16T02:30:53', '2005-07-27T16:00:00', '2005-08-04T18:07:00', '2'), + ('264', '2855', '2006-02-16T02:30:53', '2005-06-14T23:16:27', '2005-06-20T02:40:27', '2'), + ('25', '3841', '2006-02-16T02:30:53', '2005-08-02T02:05:59', '2005-08-06T03:46:59', '2'), + ('422', '4510', '2006-02-16T02:30:53', '2005-07-06T02:35:41', '2005-07-08T06:38:41', '2'), + ('497', '361', '2006-02-16T02:30:53', '2005-08-17T23:22:18', '2005-08-19T23:36:18', '2'), + ('594', '4162', '2006-02-16T02:30:53', '2005-08-22T01:27:51', '2005-08-23T03:24:51', '2'), + ('57', '425', '2006-02-16T02:30:53', '2005-08-23T16:24:24', '2005-09-01T13:48:24', '2'), + ('359', '1119', '2006-02-16T02:30:53', '2005-08-02T05:53:35', '2005-08-05T02:58:35', '2'), + ('338', '3888', '2006-02-16T02:30:53', '2005-07-29T19:41:04', '2005-08-02T00:41:04', '2'), + ('569', '1632', '2006-02-16T02:30:53', '2005-08-01T00:33:00', '2005-08-05T03:37:00', '2'), + ('592', '697', '2006-02-16T02:30:53', '2005-07-08T02:48:36', '2005-07-13T04:53:36', '2'), + ('288', '3698', '2006-02-16T02:30:53', '2005-07-08T14:38:02', '2005-07-13T12:09:02', '2'), + ('19', '4108', '2006-02-16T02:30:53', '2005-05-25T18:43:49', '2005-06-03T18:13:49', '2'), + ('29', '1337', '2006-02-16T02:30:53', '2005-05-26T06:52:33', '2005-05-30T04:08:33', '2'), + ('535', '80', '2006-02-16T02:30:53', '2005-07-08T13:42:36', '2005-07-11T18:54:36', '2'), + ('122', '2181', '2006-02-16T02:30:53', '2005-07-06T13:44:48', '2005-07-13T09:31:48', '2'), + ('290', '3626', '2006-02-16T02:30:53', '2005-08-18T23:40:23', '2005-08-19T18:14:23', '2'), + ('11', '1702', '2006-02-16T02:30:53', '2005-07-30T16:08:21', '2005-08-07T10:38:21', '2'), + ('141', '2045', '2006-02-16T02:30:53', '2005-08-20T22:24:44', '2005-08-26T21:25:44', '2'), + ('265', '1744', '2006-02-16T02:30:53', '2005-05-25T11:09:48', '2005-05-26T12:23:48', '2'), + ('479', '979', '2006-02-16T02:30:53', '2005-07-12T07:37:02', '2005-07-16T10:24:02', '2'), + ('300', '4030', '2006-02-16T02:30:53', '2005-07-10T10:09:17', '2005-07-19T07:24:17', '2'), + ('498', '2015', '2006-02-16T02:30:53', '2005-06-18T12:01:47', '2005-06-19T11:56:47', '2'), + ('533', '3554', '2006-02-16T02:30:53', '2005-08-22T00:46:18', '2005-08-26T01:44:18', '2'), + ('552', '3559', '2006-02-16T02:30:53', '2005-08-21T21:53:47', '2005-08-23T20:14:47', '2'), + ('155', '1803', '2006-02-16T02:30:53', '2005-08-21T23:11:43', '2005-08-22T22:25:43', '2'), + ('164', '118', '2006-02-16T02:30:53', '2005-05-31T02:05:39', '2005-06-04T21:27:39', '2'), + ('96', '3436', '2006-02-16T02:30:53', '2005-06-21T22:00:00', '2005-06-22T19:22:00', '2'), + ('584', '1112', '2006-02-16T02:30:53', '2005-07-26T23:55:13', '2005-07-28T19:01:13', '2'), + ('253', '2518', '2006-02-16T02:30:53', '2005-08-01T16:48:01', '2005-08-07T14:42:01', '2'), + ('273', '4199', '2006-02-16T02:30:53', '2005-07-31T08:43:43', '2005-08-01T13:25:43', '2'), + ('366', '599', '2006-02-16T02:30:53', '2005-08-20T04:33:31', '2005-08-24T07:08:31', '2'), + ('278', '535', '2006-02-16T02:30:53', '2005-07-30T03:21:05', '2005-08-02T05:24:05', '2'), + ('586', '3242', '2006-02-16T02:30:53', '2005-07-06T11:33:55', '2005-07-09T10:08:55', '2'), + ('219', '3640', '2006-02-16T02:30:53', '2005-08-17T11:01:11', '2005-08-22T06:31:11', '2'), + ('52', '2574', '2006-02-16T02:30:53', '2005-07-11T22:29:15', '2005-07-20T02:19:15', '2'), + ('409', '1438', '2006-02-16T02:30:53', '2005-08-21T00:37:00', '2005-08-25T22:09:00', '2'), + ('5', '1192', '2006-02-16T02:30:53', '2005-08-19T09:45:41', '2005-08-24T09:11:41', '2'), + ('312', '4309', '2006-02-16T02:30:53', '2005-07-30T05:26:13', '2005-08-04T00:25:13', '2'), + ('583', '3306', '2006-02-16T02:30:53', '2005-08-01T14:00:59', '2005-08-06T10:00:59', '2'), + ('599', '1615', '2006-02-16T02:30:53', '2005-07-10T17:14:27', '2005-07-15T21:18:27', '2'), + ('172', '977', '2006-02-16T02:30:53', '2005-05-30T00:02:08', '2005-06-02T05:31:08', '2'), + ('31', '3063', '2006-02-16T02:30:53', '2005-06-18T03:57:36', '2005-06-21T09:42:36', '2'), + ('529', '1795', '2006-02-16T02:30:53', '2005-07-12T04:53:41', '2005-07-17T23:17:41', '2'), + ('521', '496', '2006-02-16T02:30:53', '2005-08-21T15:57:25', '2005-08-28T11:10:25', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['12846', '3710', '14455', '3697', '4023', '4890', '4830', '6121', '14481', '14008', '11731', '1329', '5163', '8398', '5055', '14260', '7622', '1406', '10725', '4885', '9606', '2387', '5051', '4017', '10767', '15650', '3256', '12150', '455', '15799', '13682', '5955', '8525', '7849', '5386', '12241', '8767', '13219', '4564', '954', '1746', '14001', '7663', '5810', '13677', '5306', '11547', '3386', '12423', '2763', '12787', '5432', '10488', '12028', '11046', '1576', '14847', '3854', '6712', '2983', '4783', '10881', '2267', '6178', '10006', '678', '5554', '11333', '11673', '20', '560', '7070', '9084', '10422', '7866', '4848', '5139', '1893', '3878', '15184', '1749', '5082', '13425', '9521', '137', '10264', '7472', '10149', '11185', '14960', '13746', '8790', '9690', '6004', '176', '6719', '8669', '3365', '11580', '9695']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('305', '286', '2006-02-16T02:30:53', '2005-08-19T02:03:26', '2005-08-25T07:39:26', '2'), + ('228', '2596', '2006-02-16T02:30:53', '2005-07-06T10:28:53', '2005-07-15T06:17:53', '2'), + ('68', '3442', '2006-02-16T02:30:53', '2005-08-21T12:36:11', '2005-08-27T08:12:11', '2'), + ('182', '1223', '2006-02-16T02:30:53', '2005-07-06T10:07:22', '2005-07-13T14:04:22', '2'), + ('573', '274', '2006-02-16T02:30:53', '2005-07-07T01:55:25', '2005-07-08T02:43:25', '2'), + ('574', '3576', '2006-02-16T02:30:53', '2005-07-08T20:05:38', '2005-07-14T14:55:38', '2'), + ('359', '1150', '2006-02-16T02:30:53', '2005-07-08T17:56:23', '2005-07-17T21:40:23', '2'), + ('347', '1613', '2006-02-16T02:30:53', '2005-07-11T07:55:27', '2005-07-16T03:43:27', '2'), + ('367', '4099', '2006-02-16T02:30:53', '2005-08-21T13:41:14', '2005-08-30T07:53:14', '2'), + ('560', '2427', '2006-02-16T02:30:53', '2005-08-20T20:26:00', '2005-08-28T17:23:00', '2'), + ('52', '917', '2006-02-16T02:30:53', '2005-08-17T08:24:35', '2005-08-24T02:54:35', '2'), + ('359', '1154', '2006-02-16T02:30:53', '2005-06-15T11:25:06', '2005-06-17T16:10:06', '2'), + ('103', '1486', '2006-02-16T02:30:53', '2005-07-09T09:00:28', '2005-07-17T08:07:28', '2'), + ('220', '348', '2006-02-16T02:30:53', '2005-07-29T06:12:40', '2005-08-02T05:01:40', '2'), + ('54', '751', '2006-02-16T02:30:53', '2005-07-09T04:05:28', '2005-07-14T04:26:28', '2'), + ('40', '2961', '2006-02-16T02:30:53', '2005-08-21T06:01:08', '2005-08-29T09:01:08', '2'), + ('198', '4014', '2006-02-16T02:30:53', '2005-07-28T00:37:34', '2005-07-31T23:27:34', '2'), + ('199', '3118', '2006-02-16T02:30:53', '2005-06-15T16:44:00', '2005-06-21T11:22:00', '2'), + ('534', '4486', '2006-02-16T02:30:53', '2005-08-01T19:11:04', '2005-08-07T18:16:04', '2'), + ('233', '442', '2006-02-16T02:30:53', '2005-07-08T19:51:17', '2005-07-12T16:02:17', '2'), + ('253', '1357', '2006-02-16T02:30:53', '2005-07-31T03:50:46', '2005-08-01T05:29:46', '2'), + ('289', '692', '2006-02-16T02:30:53', '2005-06-18T15:24:19', '2005-06-25T17:41:19', '2'), + ('85', '4091', '2006-02-16T02:30:53', '2005-07-09T03:57:53', '2005-07-16T08:22:53', '2'), + ('595', '3117', '2006-02-16T02:30:53', '2005-07-07T01:08:18', '2005-07-09T01:47:18', '2'), + ('488', '2875', '2006-02-16T02:30:53', '2005-08-01T20:37:23', '2005-08-04T23:15:23', '2'), + ('353', '2447', '2006-02-16T02:30:53', '2005-08-23T08:29:53', '2005-08-25T07:23:53', '2'), + ('319', '1235', '2006-02-16T02:30:53', '2005-06-21T03:45:42', '2005-06-30T02:51:42', '2'), + ('555', '3781', '2006-02-16T02:30:53', '2005-08-18T00:13:55', '2005-08-20T23:35:55', '2'), + ('343', '3344', '2006-02-16T02:30:53', '2005-05-27T19:43:29', '2005-06-04T23:40:29', '2'), + ('215', '2519', '2006-02-16T02:30:53', '2005-08-23T14:23:23', '2005-08-24T17:15:23', '2'), + ('30', '287', '2006-02-16T02:30:53', '2005-08-20T08:50:39', '2005-08-21T09:05:39', '2'), + ('409', '834', '2006-02-16T02:30:53', '2005-07-10T23:22:10', '2005-07-17T17:55:10', '2'), + ('111', '1322', '2006-02-16T02:30:53', '2005-07-29T10:20:19', '2005-07-30T05:49:19', '2'), + ('423', '996', '2006-02-16T02:30:53', '2005-07-28T09:30:02', '2005-08-06T12:41:02', '2'), + ('594', '721', '2006-02-16T02:30:53', '2005-07-09T19:19:09', '2005-07-13T00:13:09', '2'), + ('248', '1261', '2006-02-16T02:30:53', '2005-08-18T03:33:17', '2005-08-21T03:13:17', '2'), + ('467', '962', '2006-02-16T02:30:53', '2005-07-29T19:42:33', '2005-08-01T20:52:33', '2'), + ('288', '2075', '2006-02-16T02:30:53', '2005-08-19T15:40:28', '2005-08-22T21:20:28', '2'), + ('519', '2494', '2006-02-16T02:30:53', '2005-07-08T05:09:38', '2005-07-11T05:37:38', '2'), + ('297', '1231', '2006-02-16T02:30:53', '2005-05-30T16:57:29', '2005-06-08T13:30:29', '2'), + ('385', '4272', '2006-02-16T02:30:53', '2005-06-16T16:41:19', '2005-06-19T11:28:19', '2'), + ('120', '1318', '2006-02-16T02:30:53', '2005-08-20T20:07:15', '2005-08-27T00:50:15', '2'), + ('470', '832', '2006-02-16T02:30:53', '2005-07-28T02:19:48', '2005-07-30T21:43:48', '2'), + ('482', '1426', '2006-02-16T02:30:53', '2005-07-10T15:22:04', '2005-07-18T21:05:04', '2'), + ('15', '4013', '2006-02-16T02:30:53', '2005-08-20T08:34:41', '2005-08-26T11:51:41', '2'), + ('409', '2221', '2006-02-16T02:30:53', '2005-07-09T15:56:45', '2005-07-15T19:02:45', '2'), + ('114', '737', '2006-02-16T02:30:53', '2005-08-17T00:59:24', '2005-08-20T04:03:24', '2'), + ('190', '1224', '2006-02-16T02:30:53', '2005-06-21T14:21:06', '2005-06-24T08:32:06', '2'), + ('470', '1014', '2006-02-16T02:30:53', '2005-08-18T10:14:52', '2005-08-26T13:16:52', '2'), + ('276', '3096', '2006-02-16T02:30:53', '2005-06-19T17:23:34', '2005-06-21T21:37:34', '2'), + ('278', '2023', '2006-02-16T02:30:53', '2005-08-19T00:07:58', '2005-08-24T00:42:58', '2'), + ('64', '1958', '2006-02-16T02:30:53', '2005-07-09T21:21:25', '2005-07-14T21:34:25', '2'), + ('423', '297', '2006-02-16T02:30:53', '2005-08-01T10:27:27', '2005-08-02T11:05:27', '2'), + ('316', '607', '2006-02-16T02:30:53', '2005-08-17T20:03:47', '2005-08-23T17:09:47', '2'), + ('526', '2105', '2006-02-16T02:30:53', '2005-08-02T06:08:34', '2005-08-06T08:45:34', '2'), + ('442', '1014', '2006-02-16T02:30:53', '2005-06-16T03:54:39', '2005-06-24T21:55:39', '2'), + ('327', '2995', '2006-02-16T02:30:53', '2005-08-22T02:13:51', '2005-08-29T03:42:51', '2'), + ('243', '2054', '2006-02-16T02:30:53', '2005-07-06T17:02:33', '2005-07-12T17:32:33', '2'), + ('226', '4581', '2006-02-16T02:30:53', '2005-07-12T13:24:47', '2005-07-20T09:35:47', '2'), + ('322', '1349', '2006-02-16T02:30:53', '2005-06-20T08:41:42', '2005-06-29T04:02:42', '2'), + ('214', '3952', '2006-02-16T02:30:53', '2005-07-08T16:09:24', '2005-07-16T21:53:24', '2'), + ('253', '781', '2006-02-16T02:30:53', '2005-08-02T00:38:14', '2005-08-09T22:02:14', '2'), + ('218', '2086', '2006-02-16T02:30:53', '2005-06-18T06:10:23', '2005-06-20T00:39:23', '2'), + ('91', '2777', '2006-02-16T02:30:53', '2005-07-11T10:59:09', '2005-07-16T11:19:09', '2'), + ('470', '2538', '2006-02-16T02:30:53', '2005-07-31T17:54:35', '2005-08-02T20:40:35', '2'), + ('269', '3741', '2006-02-16T02:30:53', '2005-05-28T23:15:48', '2005-06-03T04:43:48', '2'), + ('252', '4084', '2006-02-16T02:30:53', '2005-07-10T03:03:38', '2005-07-17T00:00:38', '2'), + ('225', '3335', '2006-02-16T02:30:53', '2005-08-02T16:53:00', '2005-08-07T20:49:00', '2'), + ('303', '823', '2006-02-16T02:30:53', '2005-08-17T05:54:15', '2005-08-21T08:12:15', '2'), + ('185', '3517', '2006-02-16T02:30:53', '2005-05-25T01:48:41', '2005-05-27T02:20:41', '2'), + ('463', '644', '2006-02-16T02:30:53', '2005-05-28T08:53:02', '2005-06-04T12:27:02', '2'), + ('280', '4182', '2006-02-16T02:30:53', '2005-07-27T04:01:08', '2005-07-30T08:10:08', '2'), + ('171', '3950', '2006-02-16T02:30:53', '2005-07-30T08:14:29', '2005-08-03T11:12:29', '2'), + ('166', '37', '2006-02-16T02:30:53', '2005-08-01T08:17:11', '2005-08-10T10:08:11', '2'), + ('101', '1602', '2006-02-16T02:30:53', '2005-07-28T10:08:01', '2005-08-04T09:29:01', '2'), + ('251', '2962', '2006-02-16T02:30:53', '2005-07-08T18:30:16', '2005-07-12T19:53:16', '2'), + ('539', '51', '2006-02-16T02:30:53', '2005-07-09T08:01:51', '2005-07-18T09:16:51', '2'), + ('390', '3346', '2006-02-16T02:30:53', '2005-06-17T04:18:37', '2005-06-23T23:35:37', '2'), + ('385', '4022', '2006-02-16T02:30:53', '2005-07-06T18:27:09', '2005-07-15T20:13:09', '2'), + ('471', '1193', '2006-02-16T02:30:53', '2005-08-22T15:51:12', '2005-08-24T19:23:12', '2'), + ('283', '1554', '2006-02-16T02:30:53', '2005-06-16T16:56:00', '2005-06-21T21:02:00', '2'), + ('470', '1584', '2006-02-16T02:30:53', '2005-07-09T05:28:38', '2005-07-10T02:46:38', '2'), + ('340', '2274', '2006-02-16T02:30:53', '2005-08-19T23:11:44', '2005-08-25T21:19:44', '2'), + ('227', '1423', '2006-02-16T02:30:53', '2005-07-31T00:52:24', '2005-08-06T03:33:24', '2'), + ('560', '2591', '2006-02-16T02:30:53', '2005-05-25T22:25:18', '2005-06-01T02:30:18', '2'), + ('297', '1374', '2006-02-16T02:30:53', '2005-08-01T03:03:12', '2005-08-08T00:34:12', '2'), + ('103', '1535', '2006-02-16T02:30:53', '2005-07-27T19:04:19', '2005-08-03T00:08:19', '2'), + ('276', '890', '2006-02-16T02:30:53', '2005-07-31T22:20:46', '2005-08-07T23:12:46', '2'), + ('469', '1215', '2006-02-16T02:30:53', '2005-08-02T11:04:35', '2005-08-05T13:48:35', '2'), + ('147', '3316', '2006-02-16T02:30:53', '2005-08-22T06:31:36', '2005-08-29T07:10:36', '2'), + ('520', '3742', '2006-02-16T02:30:53', '2005-08-20T10:55:28', '2005-08-25T07:48:28', '2'), + ('323', '751', '2006-02-16T02:30:53', '2005-07-29T20:51:41', '2005-07-30T17:30:41', '2'), + ('468', '4449', '2006-02-16T02:30:53', '2005-07-31T07:06:29', '2005-08-06T09:45:29', '2'), + ('204', '1756', '2006-02-16T02:30:53', '2005-07-11T01:34:25', '2005-07-18T00:48:25', '2'), + ('250', '851', '2006-02-16T02:30:53', '2005-05-26T03:47:39', '2005-06-01T02:36:39', '2'), + ('330', '739', '2006-02-16T02:30:53', '2005-07-12T13:40:37', '2005-07-15T15:23:37', '2'), + ('401', '1667', '2006-02-16T02:30:53', '2005-07-29T15:44:55', '2005-08-01T14:09:55', '2'), + ('133', '657', '2006-02-16T02:30:53', '2005-06-21T12:55:48', '2005-06-23T13:38:48', '2'), + ('436', '1346', '2006-02-16T02:30:53', '2005-08-17T01:59:07', '2005-08-21T06:18:07', '2'), + ('95', '726', '2006-02-16T02:30:53', '2005-07-31T07:13:30', '2005-08-07T05:38:30', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['8088', '9988', '4838', '755', '1790', '15447', '15148', '14957', '14773', '10629', '12503', '3811', '1401', '8652', '6214', '2041', '6691', '7468', '3888', '10713', '5249', '142', '7231', '2528', '15300', '8781', '11686', '15793', '12577', '11932', '8545', '12180', '7132', '10816', '13613', '4866', '9538', '8569', '2454', '11763', '13808', '9630', '4565', '11724', '61', '5406', '10652', '1954', '9864', '11155', '4657', '12084', '4934', '13121', '5225', '462', '8532', '6322', '1232', '12045', '5522', '8016', '11017', '7815', '7750', '11816', '10761', '8447', '5721', '6812', '6613', '659', '8469', '12437', '313', '10301', '507', '5697', '11237', '8208', '14923', '3249', '9696', '10906', '6631', '2460', '5400', '5822', '7003', '8867', '1260', '6973', '14746', '7738', '10594', '12476', '15060', '6949', '5886', '6511']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('343', '2590', '2006-02-16T02:30:53', '2005-07-28T18:23:49', '2005-08-06T23:25:49', '2'), + ('243', '3844', '2006-02-16T02:30:53', '2005-07-31T17:22:36', '2005-08-07T18:35:36', '2'), + ('84', '3733', '2006-02-16T02:30:53', '2005-07-08T18:11:00', '2005-07-17T12:57:00', '2'), + ('576', '3090', '2006-02-16T02:30:53', '2005-05-29T10:26:29', '2005-06-01T10:25:29', '2'), + ('158', '1070', '2006-02-16T02:30:53', '2005-06-16T19:58:40', '2005-06-17T19:31:40', '2'), + ('331', '4090', '2006-02-16T02:30:53', '2005-08-23T00:53:57', '2005-08-29T06:19:57', '2'), + ('359', '3704', '2006-02-16T02:30:53', '2005-08-22T13:59:19', '2005-08-31T13:59:19', '2'), + ('323', '1384', '2006-02-16T02:30:53', '2005-08-22T06:29:34', '2005-08-26T04:52:34', '2'), + ('413', '2541', '2006-02-16T02:30:53', '2005-08-21T23:50:57', '2005-08-26T04:45:57', '2'), + ('575', '997', '2006-02-16T02:30:53', '2005-08-01T15:33:32', '2005-08-08T12:40:32', '2'), + ('379', '3548', '2006-02-16T02:30:53', '2005-08-18T13:16:46', '2005-08-19T10:24:46', '2'), + ('208', '695', '2006-02-16T02:30:53', '2005-07-06T15:20:37', '2005-07-08T16:26:37', '2'), + ('366', '4081', '2006-02-16T02:30:53', '2005-06-15T16:30:22', '2005-06-21T11:07:22', '2'), + ('219', '2729', '2006-02-16T02:30:53', '2005-07-29T15:02:54', '2005-08-07T17:21:54', '2'), + ('49', '1258', '2006-02-16T02:30:53', '2005-07-11T12:49:48', '2005-07-18T07:41:48', '2'), + ('348', '782', '2006-02-16T02:30:53', '2005-06-17T14:19:00', '2005-06-26T08:38:00', '2'), + ('192', '403', '2006-02-16T02:30:53', '2005-07-12T12:26:38', '2005-07-18T13:26:38', '2'), + ('113', '3166', '2006-02-16T02:30:53', '2005-07-27T18:52:27', '2005-08-03T19:29:27', '2'), + ('412', '1945', '2006-02-16T02:30:53', '2005-07-06T18:54:20', '2005-07-12T17:13:20', '2'), + ('369', '2030', '2006-02-16T02:30:53', '2005-08-01T18:50:05', '2005-08-05T00:43:05', '2'), + ('389', '1950', '2006-02-16T02:30:53', '2005-07-09T13:33:53', '2005-07-11T12:55:53', '2'), + ('472', '4407', '2006-02-16T02:30:53', '2005-05-25T23:43:47', '2005-05-29T00:46:47', '2'), + ('86', '1638', '2006-02-16T02:30:53', '2005-07-27T10:01:51', '2005-08-05T13:38:51', '2'), + ('331', '1836', '2006-02-16T02:30:53', '2005-06-19T01:14:12', '2005-06-26T05:08:12', '2'), + ('399', '2319', '2006-02-16T02:30:53', '2005-08-22T19:44:00', '2005-08-25T22:49:00', '2'), + ('235', '3746', '2006-02-16T02:30:53', '2005-07-29T20:20:16', '2005-07-30T16:19:16', '2'), + ('392', '1393', '2006-02-16T02:30:53', '2005-08-17T06:39:30', '2005-08-21T10:19:30', '2'), + ('22', '2863', '2006-02-16T02:30:53', '2005-08-23T14:06:19', '2005-08-24T19:59:19', '2'), + ('16', '4134', '2006-02-16T02:30:53', '2005-08-18T15:39:46', '2005-08-25T18:05:46', '2'), + ('364', '151', '2006-02-16T02:30:53', '2005-08-17T16:36:12', '2005-08-18T19:34:12', '2'), + ('3', '3261', '2006-02-16T02:30:53', '2005-07-29T11:07:04', '2005-08-06T13:30:04', '2'), + ('20', '2276', '2006-02-16T02:30:53', '2005-08-18T01:28:15', '2005-08-20T20:52:15', '2'), + ('227', '3201', '2006-02-16T02:30:53', '2005-07-27T06:28:34', '2005-08-05T06:02:34', '2'), + ('129', '905', '2006-02-16T02:30:53', '2005-08-01T22:48:57', '2005-08-10T04:39:57', '2'), + ('201', '2415', '2006-02-16T02:30:53', '2005-08-20T06:23:53', '2005-08-29T11:40:53', '2'), + ('278', '4036', '2006-02-16T02:30:53', '2005-07-08T19:09:59', '2005-07-15T00:51:59', '2'), + ('68', '3402', '2006-02-16T02:30:53', '2005-07-31T01:25:22', '2005-08-06T00:10:22', '2'), + ('348', '276', '2006-02-16T02:30:53', '2005-07-29T11:39:17', '2005-07-31T07:50:17', '2'), + ('253', '314', '2006-02-16T02:30:53', '2005-06-18T19:32:51', '2005-06-24T20:03:51', '2'), + ('586', '872', '2006-02-16T02:30:53', '2005-08-17T09:51:39', '2005-08-21T10:15:39', '2'), + ('262', '3689', '2006-02-16T02:30:53', '2005-08-20T12:55:43', '2005-08-29T11:01:43', '2'), + ('599', '2008', '2006-02-16T02:30:53', '2005-07-31T04:57:07', '2005-08-07T10:55:07', '2'), + ('563', '3755', '2006-02-16T02:30:53', '2005-07-08T05:12:28', '2005-07-17T03:38:28', '2'), + ('207', '4484', '2006-02-16T02:30:53', '2005-08-17T08:04:44', '2005-08-25T03:25:44', '2'), + ('250', '4210', '2006-02-16T02:30:53', '2005-05-25T09:01:57', '2005-06-02T07:22:57', '2'), + ('563', '1322', '2006-02-16T02:30:53', '2005-07-09T20:13:23', '2005-07-11T22:05:23', '2'), + ('241', '1633', '2006-02-16T02:30:53', '2005-08-01T16:24:08', '2005-08-03T16:00:08', '2'), + ('533', '3203', '2006-02-16T02:30:53', '2005-06-17T08:37:55', '2005-06-20T02:55:55', '2'), + ('394', '3619', '2006-02-16T02:30:53', '2005-07-31T13:06:54', '2005-08-02T11:47:54', '2'), + ('73', '2001', '2006-02-16T02:30:53', '2005-08-02T09:55:28', '2005-08-03T06:00:28', '2'), + ('54', '1002', '2006-02-16T02:30:53', '2005-07-08T09:51:02', '2005-07-09T09:29:02', '2'), + ('60', '2706', '2006-02-16T02:30:53', '2005-08-17T22:16:49', '2005-08-24T17:42:49', '2'), + ('517', '1744', '2006-02-16T02:30:53', '2005-07-08T22:18:42', '2005-07-10T20:44:42', '2'), + ('251', '3517', '2006-02-16T02:30:53', '2005-08-19T11:51:39', '2005-08-22T11:50:39', '2'), + ('445', '703', '2006-02-16T02:30:53', '2005-07-09T12:10:16', '2005-07-12T09:55:16', '2'), + ('364', '2314', '2006-02-16T02:30:53', '2005-05-27T20:10:36', '2005-06-03T21:12:36', '2'), + ('546', '3045', '2006-02-16T02:30:53', '2005-07-29T10:26:56', '2005-08-02T13:23:56', '2'), + ('403', '4115', '2006-02-16T02:30:53', '2005-07-11T18:58:20', '2005-07-14T16:41:20', '2'), + ('391', '2743', '2006-02-16T02:30:53', '2005-06-15T04:18:10', '2005-06-17T06:02:10', '2'), + ('556', '469', '2006-02-16T02:30:53', '2005-08-17T20:40:46', '2005-08-20T18:18:46', '2'), + ('573', '2622', '2006-02-16T02:30:53', '2005-07-10T01:46:29', '2005-07-18T00:41:29', '2'), + ('391', '516', '2006-02-16T02:30:53', '2005-07-28T15:35:41', '2005-07-30T20:06:41', '2'), + ('480', '4140', '2006-02-16T02:30:53', '2005-08-02T05:19:51', '2005-08-09T00:36:51', '2'), + ('300', '3551', '2006-02-16T02:30:53', '2005-07-28T08:14:11', '2005-07-30T02:34:11', '2'), + ('220', '820', '2006-02-16T02:30:53', '2005-07-28T05:55:30', '2005-08-06T04:32:30', '2'), + ('224', '3897', '2006-02-16T02:30:53', '2005-08-17T12:14:16', '2005-08-19T06:15:16', '2'), + ('36', '3967', '2006-02-16T02:30:53', '2005-08-01T20:25:35', '2005-08-08T15:20:35', '2'), + ('11', '930', '2006-02-16T02:30:53', '2005-07-29T07:38:14', '2005-08-05T02:27:14', '2'), + ('5', '2348', '2006-02-16T02:30:53', '2005-07-10T11:09:35', '2005-07-17T16:41:35', '2'), + ('553', '2227', '2006-02-16T02:30:53', '2005-07-12T18:03:25', '2005-07-20T18:33:25', '2'), + ('460', '3421', '2006-02-16T02:30:53', '2005-07-12T08:30:07', '2005-07-14T10:25:07', '2'), + ('207', '1382', '2006-02-16T02:30:53', '2005-05-28T20:27:53', '2005-05-31T01:36:53', '2'), + ('408', '2754', '2006-02-16T02:30:53', '2005-07-29T08:26:27', '2005-08-05T04:26:27', '2'), + ('467', '4036', '2006-02-16T02:30:53', '2005-08-18T10:42:43', '2005-08-26T11:58:43', '2'), + ('594', '4156', '2006-02-16T02:30:53', '2005-05-26T22:56:19', '2005-05-29T01:29:19', '2'), + ('583', '3072', '2006-02-16T02:30:53', '2005-08-01T04:09:37', '2005-08-04T23:14:37', '2'), + ('421', '3621', '2006-02-16T02:30:53', '2005-05-28T02:31:19', '2005-06-02T05:07:19', '2'), + ('515', '934', '2006-02-16T02:30:53', '2005-07-10T09:44:44', '2005-07-12T12:13:44', '2'), + ('426', '2668', '2006-02-16T02:30:53', '2005-08-02T13:24:01', '2005-08-05T11:41:01', '2'), + ('530', '1362', '2006-02-16T02:30:53', '2005-07-28T23:26:35', '2005-08-01T23:00:35', '2'), + ('460', '3434', '2006-02-16T02:30:53', '2005-08-22T05:13:33', '2005-08-28T01:39:33', '2'), + ('410', '703', '2006-02-16T02:30:53', '2005-06-21T03:13:19', '2005-06-29T04:04:19', '2'), + ('156', '2703', '2006-02-16T02:30:53', '2005-07-31T07:13:46', '2005-08-03T10:49:46', '2'), + ('463', '3139', '2006-02-16T02:30:53', '2005-08-02T01:47:04', '2005-08-07T20:41:04', '2'), + ('204', '2340', '2006-02-16T02:30:53', '2005-07-12T09:31:43', '2005-07-15T05:00:43', '2'), + ('553', '3933', '2006-02-16T02:30:53', '2005-06-18T19:54:13', '2005-06-27T22:36:13', '2'), + ('192', '3435', '2006-02-16T02:30:53', '2005-07-09T19:56:40', '2005-07-14T20:43:40', '2'), + ('38', '1385', '2006-02-16T02:30:53', '2005-07-10T16:10:39', '2005-07-13T19:05:39', '2'), + ('161', '636', '2006-02-16T02:30:53', '2005-07-27T01:32:06', '2005-07-30T21:33:06', '2'), + ('497', '1388', '2006-02-16T02:30:53', '2005-07-30T00:02:18', '2005-08-04T00:44:18', '2'), + ('586', '330', '2006-02-16T02:30:53', '2005-06-15T06:42:25', '2005-06-16T10:44:25', '2'), + ('564', '4572', '2006-02-16T02:30:53', '2005-07-27T00:32:04', '2005-07-29T01:05:04', '2'), + ('284', '3197', '2006-02-16T02:30:53', '2005-08-21T22:54:02', '2005-08-27T17:04:02', '2'), + ('10', '80', '2006-02-16T02:30:53', '2005-07-28T05:21:42', '2005-08-03T09:46:42', '2'), + ('53', '1826', '2006-02-16T02:30:53', '2005-08-01T14:14:59', '2005-08-07T10:48:59', '2'), + ('122', '2784', '2006-02-16T02:30:53', '2005-08-18T12:22:40', '2005-08-20T17:29:40', '2'), + ('63', '2740', '2006-02-16T02:30:53', '2005-08-22T10:24:32', '2005-08-31T11:17:32', '2'), + ('103', '1594', '2006-02-16T02:30:53', '2005-07-26T23:44:12', '2005-07-30T05:39:12', '2'), + ('215', '907', '2006-02-16T02:30:53', '2005-07-10T19:36:25', '2005-07-11T22:24:25', '2'), + ('322', '1350', '2006-02-16T02:30:53', '2005-07-12T03:39:29', '2005-07-17T01:01:29', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['5276', '6111', '5696', '7038', '14033', '10433', '7682', '1295', '6584', '10471', '6921', '9313', '679', '15982', '7963', '1720', '6235', '15588', '7676', '6342', '14259', '8712', '12550', '12688', '6722', '8264', '10982', '1683', '593', '11674', '12300', '2109', '7835', '12481', '340', '15478', '12614', '11493', '3068', '13686', '12457', '3948', '5632', '2802', '2031', '12290', '1093', '806', '14004', '2646', '670', '212', '1303', '3163', '13309', '3248', '6130', '2075', '4505', '13757', '15932', '6306', '415', '9618', '14012', '798', '3986', '5088', '2928', '1167', '14948', '3350', '6182', '14849', '7547', '10664', '11581', '15434', '8247', '8795', '2014', '11601', '15278', '7075', '11088', '8064', '7033', '2900', '4812', '15091', '14851', '8802', '6789', '10540', '2287', '7933', '14308', '9238', '7279', '8302']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('521', '2524', '2006-02-16T02:30:53', '2005-07-09T14:35:13', '2005-07-12T14:24:13', '2'), + ('300', '3504', '2006-02-16T02:30:53', '2005-07-11T07:26:57', '2005-07-13T10:43:57', '2'), + ('96', '128', '2006-02-16T02:30:53', '2005-07-10T09:44:32', '2005-07-12T13:38:32', '2'), + ('518', '1909', '2006-02-16T02:30:53', '2005-07-27T03:07:29', '2005-07-31T04:55:29', '2'), + ('243', '525', '2006-02-16T02:30:53', '2005-08-20T21:30:53', '2005-08-23T01:45:53', '2'), + ('517', '1508', '2006-02-16T02:30:53', '2005-08-01T08:45:56', '2005-08-05T09:46:56', '2'), + ('400', '3296', '2006-02-16T02:30:53', '2005-07-28T03:07:29', '2005-08-04T08:48:29', '2'), + ('449', '2897', '2006-02-16T02:30:53', '2005-06-15T09:17:20', '2005-06-18T10:14:20', '2'), + ('472', '1800', '2006-02-16T02:30:53', '2005-07-12T06:43:36', '2005-07-16T12:18:36', '2'), + ('135', '1684', '2006-02-16T02:30:53', '2005-08-01T09:52:37', '2005-08-07T09:40:37', '2'), + ('265', '3322', '2006-02-16T02:30:53', '2005-07-12T22:39:03', '2005-07-21T18:54:03', '2'), + ('41', '4070', '2006-02-16T02:30:53', '2005-07-30T16:59:43', '2005-08-05T14:06:43', '2'), + ('526', '907', '2006-02-16T02:30:53', '2005-05-28T23:24:57', '2005-06-06T21:59:57', '2'), + ('370', '2920', '2006-02-16T02:30:53', '2005-08-23T20:13:31', '2005-09-01T21:51:31', '2'), + ('247', '921', '2006-02-16T02:30:53', '2005-07-28T13:48:38', '2005-08-06T19:37:38', '2'), + ('543', '3500', '2006-02-16T02:30:53', '2005-06-16T15:00:14', '2005-06-21T13:57:14', '2'), + ('379', '2659', '2006-02-16T02:30:53', '2005-07-11T14:17:51', '2005-07-17T11:14:51', '2'), + ('503', '1810', '2006-02-16T02:30:53', '2005-08-23T06:02:35', '2005-08-30T04:01:35', '2'), + ('508', '1110', '2006-02-16T02:30:53', '2005-07-28T02:55:27', '2005-08-01T03:50:27', '2'), + ('403', '1851', '2006-02-16T02:30:53', '2005-07-11T19:48:24', '2005-07-13T14:09:24', '2'), + ('583', '3705', '2006-02-16T02:30:53', '2005-08-21T06:00:22', '2005-08-22T05:38:22', '2'), + ('41', '2800', '2006-02-16T02:30:53', '2005-07-29T17:30:06', '2005-08-03T22:55:06', '2'), + ('138', '4267', '2006-02-16T02:30:53', '2005-08-18T14:40:38', '2005-08-19T13:33:38', '2'), + ('65', '2315', '2006-02-16T02:30:53', '2005-08-18T19:59:54', '2005-08-26T18:52:54', '2'), + ('211', '3124', '2006-02-16T02:30:53', '2005-07-12T13:44:03', '2005-07-19T12:43:03', '2'), + ('175', '2987', '2006-02-16T02:30:53', '2005-07-29T01:18:50', '2005-08-03T05:31:50', '2'), + ('345', '2508', '2006-02-16T02:30:53', '2005-08-02T04:19:11', '2005-08-04T00:20:11', '2'), + ('494', '2361', '2006-02-16T02:30:53', '2005-06-16T11:54:55', '2005-06-18T08:51:55', '2'), + ('16', '1810', '2006-02-16T02:30:53', '2005-05-28T13:33:23', '2005-05-30T17:10:23', '2'), + ('306', '582', '2006-02-16T02:30:53', '2005-08-17T05:56:27', '2005-08-24T08:50:27', '2'), + ('540', '3213', '2006-02-16T02:30:53', '2005-08-18T05:36:14', '2005-08-25T00:20:14', '2'), + ('493', '2292', '2006-02-16T02:30:53', '2005-06-17T19:41:42', '2005-06-25T17:03:42', '2'), + ('547', '43', '2006-02-16T02:30:53', '2005-07-28T08:49:39', '2005-08-02T07:16:39', '2'), + ('218', '2424', '2006-02-16T02:30:53', '2005-08-18T12:31:34', '2005-08-21T16:08:34', '2'), + ('209', '946', '2006-02-16T02:30:53', '2005-05-27T03:55:25', '2005-06-04T07:57:25', '2'), + ('167', '4563', '2006-02-16T02:30:53', '2005-08-23T01:50:31', '2005-08-27T21:40:31', '2'), + ('60', '2233', '2006-02-16T02:30:53', '2005-08-18T17:16:03', '2005-08-26T16:56:03', '2'), + ('124', '3375', '2006-02-16T02:30:53', '2005-08-02T22:47:00', '2005-08-10T20:53:00', '2'), + ('516', '1958', '2006-02-16T02:30:53', '2005-06-20T14:02:22', '2005-06-22T12:52:22', '2'), + ('306', '666', '2006-02-16T02:30:53', '2005-08-20T08:57:28', '2005-08-24T07:21:28', '2'), + ('80', '2145', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('161', '2254', '2006-02-16T02:30:53', '2005-07-06T21:45:53', '2005-07-08T19:24:53', '2'), + ('404', '2632', '2006-02-16T02:30:53', '2005-07-10T06:17:06', '2005-07-17T02:32:06', '2'), + ('489', '4067', '2006-02-16T02:30:53', '2005-06-19T19:18:17', '2005-06-21T17:58:17', '2'), + ('570', '4275', '2006-02-16T02:30:53', '2005-06-17T13:14:03', '2005-06-25T10:06:03', '2'), + ('283', '4100', '2006-02-16T02:30:53', '2005-08-18T05:08:03', '2005-08-23T08:10:03', '2'), + ('214', '2189', '2006-02-16T02:30:53', '2005-05-31T12:32:26', '2005-06-03T07:51:26', '2'), + ('435', '2386', '2006-02-16T02:30:53', '2005-05-29T18:31:30', '2005-05-31T00:18:30', '2'), + ('358', '3445', '2006-02-16T02:30:53', '2005-08-20T20:16:35', '2005-08-28T17:23:35', '2'), + ('275', '3511', '2006-02-16T02:30:53', '2005-06-19T09:56:01', '2005-06-21T04:15:01', '2'), + ('201', '227', '2006-02-16T02:30:53', '2005-05-28T22:04:03', '2005-06-06T22:43:03', '2'), + ('59', '764', '2006-02-16T02:30:53', '2005-05-26T08:34:41', '2005-05-30T12:46:41', '2'), + ('365', '2001', '2006-02-16T02:30:53', '2005-06-15T09:55:57', '2005-06-20T14:26:57', '2'), + ('391', '2632', '2006-02-16T02:30:53', '2005-06-20T21:22:13', '2005-06-26T15:22:13', '2'), + ('91', '2108', '2006-02-16T02:30:53', '2005-08-19T19:04:00', '2005-08-28T23:08:00', '2'), + ('78', '3656', '2006-02-16T02:30:53', '2005-06-21T03:12:21', '2005-06-28T03:54:21', '2'), + ('538', '2547', '2006-02-16T02:30:53', '2005-07-11T08:19:56', '2005-07-16T12:02:56', '2'), + ('459', '2415', '2006-02-16T02:30:53', '2005-06-17T16:40:33', '2005-06-19T13:55:33', '2'), + ('481', '1864', '2006-02-16T02:30:53', '2005-07-08T02:20:04', '2005-07-14T20:28:04', '2'), + ('14', '1147', '2006-02-16T02:30:53', '2005-08-20T11:20:12', '2005-08-23T10:14:12', '2'), + ('405', '4554', '2006-02-16T02:30:53', '2005-08-23T18:31:40', '2005-08-24T16:30:40', '2'), + ('208', '486', '2006-02-16T02:30:53', '2005-07-11T18:04:26', '2005-07-20T14:22:26', '2'), + ('304', '3698', '2006-02-16T02:30:53', '2005-05-27T14:51:45', '2005-05-28T19:07:45', '2'), + ('253', '2688', '2006-02-16T02:30:53', '2005-07-31T04:16:14', '2005-08-07T02:43:14', '2'), + ('274', '1866', '2006-02-16T02:30:53', '2005-08-20T20:42:12', '2005-08-23T23:10:12', '2'), + ('134', '1102', '2006-02-16T02:30:53', '2005-05-29T17:23:43', '2005-06-01T13:06:43', '2'), + ('122', '3737', '2006-02-16T02:30:53', '2005-07-06T23:25:13', '2005-07-09T21:26:13', '2'), + ('454', '3324', '2006-02-16T02:30:53', '2005-07-09T05:45:16', '2005-07-15T00:41:16', '2'), + ('104', '1265', '2006-02-16T02:30:53', '2005-06-20T04:43:45', '2005-06-21T06:58:45', '2'), + ('323', '4021', '2006-02-16T02:30:53', '2005-06-14T23:25:58', '2005-06-18T05:18:58', '2'), + ('488', '2914', '2006-02-16T02:30:53', '2005-08-22T06:10:53', '2005-08-28T11:24:53', '2'), + ('20', '3221', '2006-02-16T02:30:53', '2005-06-21T11:21:38', '2005-06-28T15:37:38', '2'), + ('540', '2562', '2006-02-16T02:30:53', '2005-07-11T11:11:38', '2005-07-17T08:33:38', '2'), + ('177', '3354', '2006-02-16T02:30:53', '2005-08-22T02:15:26', '2005-08-28T00:56:26', '2'), + ('547', '1733', '2006-02-16T02:30:53', '2005-07-27T21:51:48', '2005-08-06T01:05:48', '2'), + ('337', '3167', '2006-02-16T02:30:53', '2005-08-01T16:51:15', '2005-08-04T19:14:15', '2'), + ('231', '1249', '2006-02-16T02:30:53', '2005-08-17T02:03:02', '2005-08-24T03:53:02', '2'), + ('518', '4378', '2006-02-16T02:30:53', '2005-08-23T00:28:16', '2005-08-26T04:27:16', '2'), + ('539', '2607', '2006-02-16T02:30:53', '2005-07-29T00:41:38', '2005-08-06T20:29:38', '2'), + ('302', '1896', '2006-02-16T02:30:53', '2005-07-29T21:04:14', '2005-07-31T02:58:14', '2'), + ('337', '2969', '2006-02-16T02:30:53', '2005-06-17T12:03:28', '2005-06-25T16:00:28', '2'), + ('471', '1098', '2006-02-16T02:30:53', '2005-08-17T03:14:47', '2005-08-20T00:21:47', '2'), + ('472', '2454', '2006-02-16T02:30:53', '2005-08-22T19:06:47', '2005-08-25T01:00:47', '2'), + ('530', '4414', '2006-02-16T02:30:53', '2005-07-27T04:11:40', '2005-08-03T08:16:40', '2'), + ('138', '2739', '2006-02-16T02:30:53', '2005-08-02T07:48:31', '2005-08-05T08:09:31', '2'), + ('488', '3788', '2006-02-16T02:30:53', '2005-07-28T17:15:38', '2005-08-04T18:04:38', '2'), + ('352', '2803', '2006-02-16T02:30:53', '2005-07-27T03:03:25', '2005-07-28T01:57:25', '2'), + ('294', '3407', '2006-02-16T02:30:53', '2005-06-20T02:40:04', '2005-06-27T20:47:04', '2'), + ('304', '3281', '2006-02-16T02:30:53', '2005-07-08T17:07:11', '2005-07-17T21:03:11', '2'), + ('477', '2092', '2006-02-16T02:30:53', '2005-08-22T11:34:43', '2005-08-23T16:52:43', '2'), + ('180', '1139', '2006-02-16T02:30:53', '2005-08-22T02:20:44', '2005-08-26T08:02:44', '2'), + ('407', '296', '2006-02-16T02:30:53', '2005-07-29T21:25:51', '2005-07-30T18:15:51', '2'), + ('76', '1973', '2006-02-16T02:30:53', '2005-07-12T16:34:40', '2005-07-14T17:02:40', '2'), + ('84', '4121', '2006-02-16T02:30:53', '2005-08-01T12:24:42', '2005-08-03T08:39:42', '2'), + ('317', '1473', '2006-02-16T02:30:53', '2005-06-18T07:04:36', '2005-06-27T03:00:36', '2'), + ('297', '3175', '2006-02-16T02:30:53', '2005-07-28T12:27:27', '2005-07-29T10:34:27', '2'), + ('419', '3478', '2006-02-16T02:30:53', '2005-08-21T07:43:21', '2005-08-25T02:39:21', '2'), + ('12', '3356', '2006-02-16T02:30:53', '2005-07-30T13:49:43', '2005-08-08T08:25:43', '2'), + ('12', '1424', '2006-02-16T02:30:53', '2005-07-27T11:50:47', '2005-07-30T11:19:47', '2'), + ('103', '1314', '2006-02-16T02:30:53', '2005-07-29T03:01:24', '2005-07-30T01:08:24', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['9652', '1852', '9817', '15973', '14606', '3136', '9764', '2590', '6355', '2903', '3240', '3481', '587', '4636', '5420', '10840', '15512', '6528', '13954', '2401', '4411', '8144', '10440', '11654', '14650', '3093', '5529', '8127', '7886', '1481', '12462', '14888', '10604', '1780', '5991', '2715', '9456', '8396', '10094', '7540', '556', '2220', '5727', '4487', '11260', '9572', '15666', '12401', '1474', '1972', '3937', '7755', '7296', '15381', '6276', '14490', '3041', '11561', '7275', '5472', '6134', '9993', '4329', '5594', '7368', '7381', '714', '8390', '15553', '9155', '11585', '2435', '7796', '3220', '11833', '15464', '12120', '7727', '15302', '6107', '6109', '4715', '15338', '14053', '4699', '7619', '12525', '9875', '8829', '9430', '13593', '5606', '13870', '14537', '10132', '4375', '1098', '10418', '2990', '6389']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('207', '448', '2006-02-16T02:30:53', '2005-07-31T05:49:53', '2005-08-06T07:38:53', '2'), + ('271', '4122', '2006-02-16T02:30:53', '2005-06-17T00:38:20', '2005-06-22T20:04:20', '2'), + ('170', '4019', '2006-02-16T02:30:53', '2005-07-31T11:33:31', '2005-08-08T14:49:31', '2'), + ('343', '2766', '2006-02-16T02:30:53', '2005-08-23T20:04:41', '2005-09-01T20:08:41', '2'), + ('592', '2291', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('377', '3349', '2006-02-16T02:30:53', '2005-06-20T19:39:08', '2005-06-22T23:35:08', '2'), + ('136', '3761', '2006-02-16T02:30:53', '2005-07-31T09:42:58', '2005-08-07T07:22:58', '2'), + ('324', '3572', '2006-02-16T02:30:53', '2005-06-19T05:31:40', '2005-06-20T07:58:40', '2'), + ('482', '2472', '2006-02-16T02:30:53', '2005-07-11T20:56:29', '2005-07-20T01:50:29', '2'), + ('53', '3580', '2006-02-16T02:30:53', '2005-06-20T02:49:01', '2005-06-25T05:03:01', '2'), + ('405', '2938', '2006-02-16T02:30:53', '2005-06-21T02:53:17', '2005-06-30T03:25:17', '2'), + ('138', '3575', '2006-02-16T02:30:53', '2005-07-05T23:13:07', '2005-07-07T20:36:07', '2'), + ('64', '1413', '2006-02-16T02:30:53', '2005-05-28T12:05:33', '2005-05-30T13:45:33', '2'), + ('228', '1858', '2006-02-16T02:30:53', '2005-07-08T08:44:32', '2005-07-10T08:59:32', '2'), + ('80', '1739', '2006-02-16T02:30:53', '2005-07-09T20:48:42', '2005-07-15T21:35:42', '2'), + ('593', '583', '2006-02-16T02:30:53', '2005-08-01T23:38:34', '2005-08-07T02:36:34', '2'), + ('25', '4336', '2006-02-16T02:30:53', '2005-08-23T02:57:30', '2005-08-25T01:47:30', '2'), + ('598', '3824', '2006-02-16T02:30:53', '2005-07-12T04:29:44', '2005-07-18T02:39:44', '2'), + ('207', '3812', '2006-02-16T02:30:53', '2005-08-20T18:02:41', '2005-08-27T21:52:41', '2'), + ('359', '85', '2006-02-16T02:30:53', '2005-06-18T16:22:03', '2005-06-19T13:49:03', '2'), + ('224', '320', '2006-02-16T02:30:53', '2005-07-07T21:54:58', '2005-07-14T16:14:58', '2'), + ('320', '3556', '2006-02-16T02:30:53', '2005-07-28T20:30:55', '2005-07-31T18:10:55', '2'), + ('299', '842', '2006-02-16T02:30:53', '2005-08-01T08:54:32', '2005-08-02T10:59:32', '2'), + ('218', '1048', '2006-02-16T02:30:53', '2005-08-17T05:06:19', '2005-08-18T04:32:19', '2'), + ('190', '1274', '2006-02-16T02:30:53', '2005-08-21T19:24:51', '2005-08-25T13:58:51', '2'), + ('556', '2534', '2006-02-16T02:30:53', '2005-06-20T16:06:14', '2005-06-22T13:22:14', '2'), + ('590', '1652', '2006-02-16T02:30:53', '2005-07-10T02:11:13', '2005-07-15T06:56:13', '2'), + ('20', '4265', '2006-02-16T02:30:53', '2005-07-28T19:45:19', '2005-07-31T22:07:19', '2'), + ('352', '237', '2006-02-16T02:30:53', '2005-07-28T10:37:55', '2005-08-04T13:22:55', '2'), + ('125', '3041', '2006-02-16T02:30:53', '2005-06-15T21:17:58', '2005-06-18T17:53:58', '2'), + ('574', '890', '2006-02-16T02:30:53', '2005-08-18T11:28:55', '2005-08-20T12:06:55', '2'), + ('91', '3345', '2006-02-16T02:30:53', '2005-08-22T04:09:18', '2005-08-23T07:34:18', '2'), + ('250', '2833', '2006-02-16T02:30:53', '2005-08-01T14:35:08', '2005-08-08T10:19:08', '2'), + ('352', '146', '2006-02-16T02:30:53', '2005-06-16T19:11:45', '2005-06-19T15:34:45', '2'), + ('590', '3623', '2006-02-16T02:30:53', '2005-07-11T01:03:38', '2005-07-12T22:32:38', '2'), + ('404', '2082', '2006-02-16T02:30:53', '2005-06-19T14:29:35', '2005-06-26T08:44:35', '2'), + ('534', '2068', '2006-02-16T02:30:53', '2005-07-30T22:22:16', '2005-08-05T18:56:16', '2'), + ('516', '3911', '2006-02-16T02:30:53', '2005-07-29T06:07:00', '2005-07-30T05:32:00', '2'), + ('596', '2865', '2006-02-16T02:30:53', '2005-07-31T20:31:18', '2005-08-06T18:31:18', '2'), + ('207', '2198', '2006-02-16T02:30:53', '2005-07-27T21:39:55', '2005-08-04T18:10:55', '2'), + ('22', '1814', '2006-02-16T02:30:53', '2005-05-28T08:31:36', '2005-06-06T07:29:36', '2'), + ('587', '320', '2006-02-16T02:30:53', '2005-06-18T03:21:36', '2005-06-21T07:45:36', '2'), + ('550', '3338', '2006-02-16T02:30:53', '2005-07-10T11:25:28', '2005-07-11T11:03:28', '2'), + ('360', '2220', '2006-02-16T02:30:53', '2005-07-08T01:20:22', '2005-07-16T21:23:22', '2'), + ('207', '4015', '2006-02-16T02:30:53', '2005-08-02T13:52:19', '2005-08-06T08:13:19', '2'), + ('283', '1453', '2006-02-16T02:30:53', '2005-07-31T02:44:10', '2005-08-01T03:30:10', '2'), + ('586', '3406', '2006-02-16T02:30:53', '2005-08-23T09:01:10', '2005-08-31T12:32:10', '2'), + ('479', '4314', '2006-02-16T02:30:53', '2005-08-18T09:20:51', '2005-08-21T05:50:51', '2'), + ('202', '164', '2006-02-16T02:30:53', '2005-06-15T20:55:42', '2005-06-19T02:41:42', '2'), + ('526', '2758', '2006-02-16T02:30:53', '2005-06-17T09:25:49', '2005-06-24T09:59:49', '2'), + ('211', '2091', '2006-02-16T02:30:53', '2005-07-06T21:15:38', '2005-07-15T00:01:38', '2'), + ('449', '1247', '2006-02-16T02:30:53', '2005-07-28T06:22:18', '2005-08-06T11:38:18', '2'), + ('400', '1681', '2006-02-16T02:30:53', '2005-07-27T12:39:48', '2005-08-04T18:24:48', '2'), + ('110', '845', '2006-02-16T02:30:53', '2005-08-22T22:28:36', '2005-08-24T19:26:36', '2'), + ('284', '1826', '2006-02-16T02:30:53', '2005-07-11T16:15:50', '2005-07-19T20:50:50', '2'), + ('205', '1771', '2006-02-16T02:30:53', '2005-08-21T13:54:15', '2005-08-28T19:08:15', '2'), + ('459', '2676', '2006-02-16T02:30:53', '2005-06-20T12:35:44', '2005-06-23T18:28:44', '2'), + ('149', '189', '2006-02-16T02:30:53', '2005-08-17T01:23:09', '2005-08-23T21:02:09', '2'), + ('323', '775', '2006-02-16T02:30:53', '2005-07-27T11:39:08', '2005-07-30T13:37:08', '2'), + ('165', '865', '2006-02-16T02:30:53', '2005-07-09T23:16:40', '2005-07-10T18:43:40', '2'), + ('305', '3225', '2006-02-16T02:30:53', '2005-07-11T08:28:19', '2005-07-18T09:20:19', '2'), + ('225', '2503', '2006-02-16T02:30:53', '2005-07-31T17:30:20', '2005-08-01T20:53:20', '2'), + ('504', '638', '2006-02-16T02:30:53', '2005-07-07T18:04:16', '2005-07-15T17:58:16', '2'), + ('440', '61', '2006-02-16T02:30:53', '2005-07-10T04:33:36', '2005-07-12T08:13:36', '2'), + ('286', '2265', '2006-02-16T02:30:53', '2005-07-27T15:06:05', '2005-07-31T14:10:05', '2'), + ('483', '1595', '2006-02-16T02:30:53', '2005-07-27T15:40:26', '2005-08-02T17:26:26', '2'), + ('452', '2010', '2006-02-16T02:30:53', '2005-05-29T04:15:21', '2005-06-01T23:05:21', '2'), + ('32', '581', '2006-02-16T02:30:53', '2005-07-29T05:52:26', '2005-08-04T08:12:26', '2'), + ('232', '1659', '2006-02-16T02:30:53', '2005-08-23T04:33:39', '2005-08-25T07:53:39', '2'), + ('107', '3787', '2006-02-16T02:30:53', '2005-07-30T11:00:00', '2005-08-02T05:24:00', '2'), + ('297', '753', '2006-02-16T02:30:53', '2005-08-17T02:14:36', '2005-08-20T07:37:36', '2'), + ('173', '3548', '2006-02-16T02:30:53', '2005-06-18T18:12:26', '2005-06-22T13:43:26', '2'), + ('419', '622', '2006-02-16T02:30:53', '2005-07-28T07:39:39', '2005-08-02T05:34:39', '2'), + ('574', '1880', '2006-02-16T02:30:53', '2005-06-21T01:46:25', '2005-06-26T07:44:25', '2'), + ('424', '3728', '2006-02-16T02:30:53', '2005-08-17T13:00:33', '2005-08-18T13:45:33', '2'), + ('62', '3235', '2006-02-16T02:30:53', '2005-08-23T01:15:18', '2005-08-29T02:58:18', '2'), + ('323', '2912', '2006-02-16T02:30:53', '2005-08-17T23:16:46', '2005-08-19T00:11:46', '2'), + ('123', '2274', '2006-02-16T02:30:53', '2005-07-28T04:52:43', '2005-08-03T01:12:43', '2'), + ('320', '188', '2006-02-16T02:30:53', '2005-08-22T19:44:53', '2005-08-24T18:13:53', '2'), + ('304', '3798', '2006-02-16T02:30:53', '2005-07-11T07:07:09', '2005-07-14T07:32:09', '2'), + ('163', '3603', '2006-02-16T02:30:53', '2005-07-11T07:20:57', '2005-07-13T07:29:57', '2'), + ('276', '4010', '2006-02-16T02:30:53', '2005-07-08T12:15:37', '2005-07-10T10:37:37', '2'), + ('13', '502', '2006-02-16T02:30:53', '2005-08-22T20:51:24', '2005-08-24T23:41:24', '2'), + ('5', '2177', '2006-02-16T02:30:53', '2005-08-20T22:13:59', '2005-08-26T20:50:59', '2'), + ('348', '2462', '2006-02-16T02:30:53', '2005-07-08T11:36:56', '2005-07-14T11:35:56', '2'), + ('419', '1057', '2006-02-16T02:30:53', '2005-07-28T00:25:41', '2005-07-30T04:35:41', '2'), + ('96', '2357', '2006-02-16T02:30:53', '2005-08-18T13:48:31', '2005-08-23T13:04:31', '2'), + ('421', '2878', '2006-02-16T02:30:53', '2005-07-31T13:37:41', '2005-08-03T15:17:41', '2'), + ('173', '1466', '2006-02-16T02:30:53', '2005-07-29T22:33:34', '2005-08-05T20:23:34', '2'), + ('367', '1529', '2006-02-16T02:30:53', '2005-07-30T21:20:13', '2005-08-04T21:45:13', '2'), + ('585', '261', '2006-02-16T02:30:53', '2005-08-20T05:50:52', '2005-08-27T05:28:52', '2'), + ('51', '2896', '2006-02-16T02:30:53', '2005-07-10T05:07:55', '2005-07-15T00:14:55', '2'), + ('167', '563', '2006-02-16T02:30:53', '2005-08-20T15:09:16', '2005-08-28T10:00:16', '2'), + ('405', '3755', '2006-02-16T02:30:53', '2005-08-21T15:24:24', '2005-08-23T17:14:24', '2'), + ('23', '3934', '2006-02-16T02:30:53', '2005-07-31T21:50:24', '2005-08-07T23:37:24', '2'), + ('560', '3035', '2006-02-16T02:30:53', '2005-07-07T20:20:29', '2005-07-16T19:29:29', '2'), + ('425', '1050', '2006-02-16T02:30:53', '2005-05-31T13:51:48', '2005-06-09T18:42:48', '2'), + ('248', '1692', '2006-02-16T02:30:53', '2005-08-01T08:11:07', '2005-08-04T11:12:07', '2'), + ('18', '4559', '2006-02-16T02:30:53', '2005-06-20T09:02:51', '2005-06-29T13:19:51', '2'), + ('274', '2268', '2006-02-16T02:30:53', '2005-07-11T22:18:20', '2005-07-16T16:57:20', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['13939', '4738', '13465', '11463', '8470', '1097', '13985', '14780', '1963', '2777', '11000', '3717', '7700', '13989', '3028', '7173', '1811', '13159', '607', '8191', '7900', '15367', '5548', '4729', '8931', '13176', '15334', '13361', '4622', '15525', '9014', '7164', '10013', '4399', '7404', '11647', '4238', '13879', '9960', '7099', '2289', '12767', '6090', '330', '11578', '8284', '2169', '10173', '8413', '2940', '9775', '4171', '12707', '12892', '4520', '11400', '6794', '9653', '8503', '11778', '11078', '13386', '12602', '9284', '8449', '6628', '3963', '11049', '9819', '12674', '1090', '15726', '2933', '2563', '7285', '6704', '4405', '15266', '2836', '8314', '4849', '2245', '247', '1509', '5173', '2155', '13780', '13911', '3309', '105', '2637', '10875', '4140', '1396', '808', '4063', '10443', '9214', '14656', '1380']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('585', '2700', '2006-02-16T02:30:53', '2005-08-20T17:28:01', '2005-08-23T14:40:01', '2'), + ('31', '2021', '2006-02-16T02:30:53', '2005-07-08T13:24:58', '2005-07-17T17:44:58', '2'), + ('575', '1305', '2006-02-16T02:30:53', '2005-08-20T00:54:14', '2005-08-21T20:55:14', '2'), + ('138', '1944', '2006-02-16T02:30:53', '2005-08-02T21:37:36', '2005-08-08T03:11:36', '2'), + ('159', '3717', '2006-02-16T02:30:53', '2005-07-29T08:28:50', '2005-07-30T13:40:50', '2'), + ('491', '2285', '2006-02-16T02:30:53', '2005-05-31T13:38:42', '2005-06-01T13:54:42', '2'), + ('339', '1081', '2006-02-16T02:30:53', '2005-08-20T19:13:06', '2005-08-24T21:24:06', '2'), + ('491', '3171', '2006-02-16T02:30:53', '2005-08-22T00:06:33', '2005-08-22T22:02:33', '2'), + ('154', '1943', '2006-02-16T02:30:53', '2005-06-17T09:09:31', '2005-06-24T13:16:31', '2'), + ('230', '4092', '2006-02-16T02:30:53', '2005-06-19T18:16:26', '2005-06-20T13:43:26', '2'), + ('265', '264', '2006-02-16T02:30:53', '2005-08-02T04:56:14', '2005-08-07T01:39:14', '2'), + ('173', '1677', '2006-02-16T02:30:53', '2005-07-06T10:53:34', '2005-07-07T13:43:34', '2'), + ('124', '3546', '2006-02-16T02:30:53', '2005-07-28T03:54:14', '2005-08-05T06:20:14', '2'), + ('252', '1470', '2006-02-16T02:30:53', '2005-08-20T19:27:50', '2005-08-28T15:17:50', '2'), + ('264', '886', '2006-02-16T02:30:53', '2005-06-20T11:50:52', '2005-06-21T11:05:52', '2'), + ('592', '177', '2006-02-16T02:30:53', '2005-07-27T07:59:24', '2005-07-28T02:23:24', '2'), + ('235', '3700', '2006-02-16T02:30:53', '2005-06-16T21:06:20', '2005-06-21T21:59:20', '2'), + ('497', '2300', '2006-02-16T02:30:53', '2005-08-19T13:19:59', '2005-08-21T09:22:59', '2'), + ('554', '2561', '2006-02-16T02:30:53', '2005-05-28T15:02:41', '2005-05-30T12:54:41', '2'), + ('508', '1777', '2006-02-16T02:30:53', '2005-07-28T22:47:14', '2005-07-31T23:13:14', '2'), + ('154', '2781', '2006-02-16T02:30:53', '2005-07-28T11:11:33', '2005-08-05T06:29:33', '2'), + ('355', '160', '2006-02-16T02:30:53', '2005-08-22T21:47:53', '2005-08-27T17:54:53', '2'), + ('317', '2973', '2006-02-16T02:30:53', '2005-07-10T02:56:45', '2005-07-13T01:33:45', '2'), + ('205', '1429', '2006-02-16T02:30:53', '2005-07-08T12:59:40', '2005-07-10T13:35:40', '2'), + ('268', '16', '2006-02-16T02:30:53', '2005-07-30T02:30:07', '2005-08-02T08:24:07', '2'), + ('1', '2269', '2006-02-16T02:30:53', '2005-08-19T13:56:54', '2005-08-23T08:50:54', '2'), + ('407', '3882', '2006-02-16T02:30:53', '2005-08-22T20:44:35', '2005-08-29T23:03:35', '2'), + ('107', '4289', '2006-02-16T02:30:53', '2005-08-19T21:07:22', '2005-08-21T21:26:22', '2'), + ('289', '2710', '2006-02-16T02:30:53', '2005-07-08T08:02:42', '2005-07-10T07:46:42', '2'), + ('123', '3509', '2006-02-16T02:30:53', '2005-08-23T03:43:32', '2005-08-25T07:31:32', '2'), + ('297', '311', '2006-02-16T02:30:53', '2005-07-30T05:19:27', '2005-08-01T01:10:27', '2'), + ('284', '527', '2006-02-16T02:30:53', '2005-07-27T07:36:34', '2005-08-04T05:05:34', '2'), + ('377', '2364', '2006-02-16T02:30:53', '2005-07-31T18:08:21', '2005-08-08T13:22:21', '2'), + ('402', '4515', '2006-02-16T02:30:53', '2005-07-07T21:20:28', '2005-07-12T20:57:28', '2'), + ('190', '2359', '2006-02-16T02:30:53', '2005-07-27T16:24:43', '2005-07-29T11:40:43', '2'), + ('110', '3016', '2006-02-16T02:30:53', '2005-08-17T04:54:14', '2005-08-23T04:16:14', '2'), + ('7', '3024', '2006-02-16T02:30:53', '2005-07-07T13:22:20', '2005-07-10T07:44:20', '2'), + ('112', '4022', '2006-02-16T02:30:53', '2005-08-20T15:18:10', '2005-08-22T19:23:10', '2'), + ('569', '1022', '2006-02-16T02:30:53', '2005-07-31T16:05:52', '2005-08-05T14:15:52', '2'), + ('6', '3136', '2006-02-16T02:30:53', '2005-07-27T05:03:44', '2005-07-29T00:12:44', '2'), + ('392', '2030', '2006-02-16T02:30:53', '2005-06-18T07:29:43', '2005-06-24T11:16:43', '2'), + ('432', '3351', '2006-02-16T02:30:53', '2005-08-18T23:25:49', '2005-08-28T02:40:49', '2'), + ('241', '71', '2006-02-16T02:30:53', '2005-07-11T05:47:08', '2005-07-20T07:52:08', '2'), + ('248', '1536', '2006-02-16T02:30:53', '2005-05-27T02:15:30', '2005-06-04T05:09:30', '2'), + ('590', '192', '2006-02-16T02:30:53', '2005-08-17T01:54:13', '2005-08-26T02:00:13', '2'), + ('446', '4371', '2006-02-16T02:30:53', '2005-07-29T01:56:40', '2005-08-07T07:15:40', '2'), + ('120', '785', '2006-02-16T02:30:53', '2005-06-17T23:57:23', '2005-06-19T20:14:23', '2'), + ('326', '2527', '2006-02-16T02:30:53', '2005-07-31T23:36:59', '2005-08-08T20:20:59', '2'), + ('104', '2762', '2006-02-16T02:30:53', '2005-07-29T06:47:39', '2005-08-02T09:15:39', '2'), + ('73', '2504', '2006-02-16T02:30:53', '2005-06-20T05:20:01', '2005-06-28T06:11:01', '2'), + ('162', '2818', '2006-02-16T02:30:53', '2005-07-31T10:00:00', '2005-08-01T08:57:00', '2'), + ('476', '4199', '2006-02-16T02:30:53', '2005-07-07T09:49:04', '2005-07-14T03:58:04', '2'), + ('426', '1565', '2006-02-16T02:30:53', '2005-08-18T20:52:02', '2005-08-25T19:03:02', '2'), + ('121', '1044', '2006-02-16T02:30:53', '2005-08-19T03:46:34', '2005-08-21T05:11:34', '2'), + ('104', '3505', '2006-02-16T02:30:53', '2005-07-08T02:53:46', '2005-07-08T22:27:46', '2'), + ('9', '3150', '2006-02-16T02:30:53', '2005-08-02T19:00:52', '2005-08-09T19:45:52', '2'), + ('233', '813', '2006-02-16T02:30:53', '2005-07-12T16:38:23', '2005-07-20T17:36:23', '2'), + ('383', '1451', '2006-02-16T02:30:53', '2005-07-31T05:55:38', '2005-08-03T09:35:38', '2'), + ('240', '1164', '2006-02-16T02:30:53', '2005-07-29T09:16:50', '2005-08-04T11:34:50', '2'), + ('213', '1306', '2006-02-16T02:30:53', '2005-08-17T10:31:40', '2005-08-25T13:53:40', '2'), + ('587', '2362', '2006-02-16T02:30:53', '2005-08-02T07:26:58', '2005-08-07T01:59:58', '2'), + ('324', '4476', '2006-02-16T02:30:53', '2005-08-19T21:43:58', '2005-08-24T20:29:58', '2'), + ('533', '2001', '2006-02-16T02:30:53', '2005-08-18T16:49:50', '2005-08-21T11:13:50', '2'), + ('38', '3976', '2006-02-16T02:30:53', '2005-07-30T15:25:19', '2005-08-01T17:45:19', '2'), + ('273', '2610', '2006-02-16T02:30:53', '2005-07-29T07:42:25', '2005-07-30T06:07:25', '2'), + ('211', '2894', '2006-02-16T02:30:53', '2005-07-12T09:18:08', '2005-07-21T04:27:08', '2'), + ('111', '3912', '2006-02-16T02:30:53', '2005-07-06T22:19:17', '2005-07-15T01:22:17', '2'), + ('38', '4352', '2006-02-16T02:30:53', '2005-08-02T06:15:40', '2005-08-11T10:09:40', '2'), + ('292', '1927', '2006-02-16T02:30:53', '2005-07-31T11:39:13', '2005-08-06T09:11:13', '2'), + ('185', '636', '2006-02-16T02:30:53', '2005-08-18T19:24:56', '2005-08-26T22:16:56', '2'), + ('23', '3329', '2006-02-16T02:30:53', '2005-05-31T12:03:44', '2005-06-02T15:54:44', '2'), + ('503', '906', '2006-02-16T02:30:53', '2005-08-23T11:28:26', '2005-08-28T11:23:26', '2'), + ('323', '4483', '2006-02-16T02:30:53', '2005-06-20T04:52:23', '2005-06-26T07:12:23', '2'), + ('41', '1935', '2006-02-16T02:30:53', '2005-06-19T03:24:17', '2005-06-23T04:08:17', '2'), + ('498', '2855', '2006-02-16T02:30:53', '2005-07-27T12:14:06', '2005-08-03T14:57:06', '2'), + ('595', '1590', '2006-02-16T02:30:53', '2005-07-12T12:50:24', '2005-07-20T16:41:24', '2'), + ('145', '2102', '2006-02-16T02:30:53', '2005-07-07T21:33:16', '2005-07-15T00:33:16', '2'), + ('124', '1870', '2006-02-16T02:30:53', '2005-08-22T18:37:24', '2005-08-23T17:34:24', '2'), + ('306', '1453', '2006-02-16T02:30:53', '2005-06-19T21:58:21', '2005-06-27T00:41:21', '2'), + ('118', '2182', '2006-02-16T02:30:53', '2005-07-29T03:35:04', '2005-08-06T08:43:04', '2'), + ('146', '4323', '2006-02-16T02:30:53', '2005-07-08T18:34:34', '2005-07-14T20:27:34', '2'), + ('194', '1496', '2006-02-16T02:30:53', '2005-06-18T04:52:59', '2005-06-24T05:07:59', '2'), + ('102', '4095', '2006-02-16T02:30:53', '2005-05-26T14:01:05', '2005-05-28T13:38:05', '2'), + ('167', '655', '2006-02-16T02:30:53', '2005-06-15T22:35:53', '2005-06-23T17:09:53', '2'), + ('490', '2848', '2006-02-16T02:30:53', '2005-07-09T09:31:44', '2005-07-15T04:20:44', '2'), + ('227', '3640', '2006-02-16T02:30:53', '2005-06-17T23:07:29', '2005-06-25T03:23:29', '2'), + ('14', '1775', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('304', '4400', '2006-02-16T02:30:53', '2005-08-20T16:31:33', '2005-08-28T19:26:33', '2'), + ('463', '248', '2006-02-16T02:30:53', '2005-06-21T08:00:49', '2005-06-29T04:11:49', '2'), + ('108', '794', '2006-02-16T02:30:53', '2005-05-25T17:54:12', '2005-05-30T12:03:12', '2'), + ('327', '2736', '2006-02-16T02:30:53', '2005-06-19T09:20:56', '2005-06-27T10:09:56', '2'), + ('175', '862', '2006-02-16T02:30:53', '2005-08-02T00:31:44', '2005-08-05T22:24:44', '2'), + ('190', '1897', '2006-02-16T02:30:53', '2005-07-07T08:19:10', '2005-07-14T07:27:10', '2'), + ('103', '1007', '2006-02-16T02:30:53', '2005-06-15T16:22:38', '2005-06-17T15:53:38', '2'), + ('104', '1928', '2006-02-16T02:30:53', '2005-05-29T19:08:20', '2005-06-06T20:32:20', '2'), + ('331', '1452', '2006-02-16T02:30:53', '2005-07-07T04:23:57', '2005-07-14T23:35:57', '2'), + ('403', '1965', '2006-02-16T02:30:53', '2005-08-01T09:01:04', '2005-08-04T09:07:04', '2'), + ('181', '2823', '2006-02-16T02:30:53', '2005-07-30T13:10:14', '2005-08-06T14:22:14', '2'), + ('201', '4205', '2006-02-16T02:30:53', '2005-08-21T19:39:28', '2005-08-24T01:36:28', '2'), + ('158', '3376', '2006-02-16T02:30:53', '2005-06-15T15:13:10', '2005-06-18T12:42:10', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['7086', '11828', '9569', '12570', '5335', '12837', '8641', '6382', '14197', '6731', '13725', '11149', '4260', '8612', '1682', '8677', '15010', '2906', '254', '12396', '7370', '4616', '14474', '5493', '14248', '15221', '981', '12485', '2253', '2333', '523', '7382', '13330', '7745', '11158', '2283', '14829', '5750', '12161', '4634', '468', '5275', '9664', '12992', '5413', '9677', '7871', '1897', '312', '531', '15552', '15353', '12810', '3531', '2199', '15680', '11594', '8249', '7701', '7198', '10253', '14327', '1552', '11652', '10020', '8278', '8079', '14494', '205', '9222', '12270', '10654', '4102', '12072', '2038', '5954', '7563', '11345', '13151', '9975', '11896', '3814', '12392', '4963', '10939', '12293', '6610', '14584', '7245', '9985', '1344', '12941', '5908', '9519', '4941', '3326', '14896', '12735', '5446', '13760']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('595', '2938', '2006-02-16T02:30:53', '2005-07-27T04:39:46', '2005-08-05T00:32:46', '2'), + ('268', '2593', '2006-02-16T02:30:53', '2005-08-17T12:48:28', '2005-08-24T09:24:28', '2'), + ('405', '813', '2006-02-16T02:30:53', '2005-07-31T02:39:38', '2005-08-02T05:09:38', '2'), + ('211', '3973', '2006-02-16T02:30:53', '2005-08-18T15:23:31', '2005-08-22T09:59:31', '2'), + ('588', '2353', '2006-02-16T02:30:53', '2005-07-09T17:00:49', '2005-07-12T12:21:49', '2'), + ('495', '2288', '2006-02-16T02:30:53', '2005-08-19T01:51:09', '2005-08-22T07:14:09', '2'), + ('30', '3199', '2006-02-16T02:30:53', '2005-07-29T14:37:30', '2005-08-02T19:32:30', '2'), + ('336', '3223', '2006-02-16T02:30:53', '2005-07-11T21:58:53', '2005-07-17T21:18:53', '2'), + ('469', '340', '2006-02-16T02:30:53', '2005-08-21T03:47:25', '2005-08-30T09:15:25', '2'), + ('593', '844', '2006-02-16T02:30:53', '2005-07-12T13:58:27', '2005-07-15T10:04:27', '2'), + ('306', '3861', '2006-02-16T02:30:53', '2005-08-20T10:08:27', '2005-08-28T06:52:27', '2'), + ('358', '3254', '2006-02-16T02:30:53', '2005-08-02T09:51:43', '2005-08-11T09:40:43', '2'), + ('305', '4575', '2006-02-16T02:30:53', '2005-07-07T14:22:45', '2005-07-08T15:10:45', '2'), + ('392', '3518', '2006-02-16T02:30:53', '2005-07-29T13:28:20', '2005-08-06T14:39:20', '2'), + ('476', '2165', '2006-02-16T02:30:53', '2005-06-16T11:54:25', '2005-06-22T11:09:25', '2'), + ('315', '513', '2006-02-16T02:30:53', '2005-07-29T16:01:13', '2005-08-07T19:21:13', '2'), + ('508', '171', '2006-02-16T02:30:53', '2005-08-22T08:30:17', '2005-08-29T13:24:17', '2'), + ('58', '1087', '2006-02-16T02:30:53', '2005-06-20T03:04:56', '2005-06-23T05:57:56', '2'), + ('390', '1835', '2006-02-16T02:30:53', '2005-05-26T14:43:48', '2005-05-31T09:19:48', '2'), + ('40', '3624', '2006-02-16T02:30:53', '2005-08-18T09:11:23', '2005-08-26T05:35:23', '2'), + ('89', '2022', '2006-02-16T02:30:53', '2005-07-27T15:15:53', '2005-08-03T19:53:53', '2'), + ('280', '2580', '2006-02-16T02:30:53', '2005-07-08T07:48:12', '2005-07-10T08:13:12', '2'), + ('294', '2632', '2006-02-16T02:30:53', '2005-08-21T13:22:48', '2005-08-27T14:13:48', '2'), + ('539', '2037', '2006-02-16T02:30:53', '2005-07-10T00:11:44', '2005-07-15T19:24:44', '2'), + ('293', '725', '2006-02-16T02:30:53', '2005-08-21T05:35:57', '2005-08-28T05:53:57', '2'), + ('253', '110', '2006-02-16T02:30:53', '2005-08-22T17:12:29', '2005-08-24T20:46:29', '2'), + ('326', '2913', '2006-02-16T02:30:53', '2005-05-30T21:52:42', '2005-06-01T03:15:42', '2'), + ('345', '422', '2006-02-16T02:30:53', '2005-08-18T12:41:41', '2005-08-22T16:38:41', '2'), + ('122', '3719', '2006-02-16T02:30:53', '2005-06-18T05:11:43', '2005-06-25T03:30:43', '2'), + ('283', '2323', '2006-02-16T02:30:53', '2005-06-18T10:55:54', '2005-06-25T07:09:54', '2'), + ('138', '1905', '2006-02-16T02:30:53', '2005-05-28T03:53:26', '2005-05-31T05:58:26', '2'), + ('518', '356', '2006-02-16T02:30:53', '2005-07-27T15:43:15', '2005-07-28T11:18:15', '2'), + ('297', '4276', '2006-02-16T02:30:53', '2005-08-19T19:59:21', '2005-08-20T15:34:21', '2'), + ('285', '1014', '2006-02-16T02:30:53', '2005-07-28T05:46:28', '2005-08-06T07:44:28', '2'), + ('190', '530', '2006-02-16T02:30:53', '2005-08-02T09:58:28', '2005-08-10T13:54:28', '2'), + ('507', '2056', '2006-02-16T02:30:53', '2005-06-18T06:56:06', '2005-06-19T05:11:06', '2'), + ('546', '3606', '2006-02-16T02:30:53', '2005-08-22T01:35:37', '2005-08-23T19:55:37', '2'), + ('330', '3855', '2006-02-16T02:30:53', '2005-07-10T12:20:41', '2005-07-17T08:25:41', '2'), + ('444', '2420', '2006-02-16T02:30:53', '2005-08-18T00:41:46', '2005-08-26T22:59:46', '2'), + ('275', '811', '2006-02-16T02:30:53', '2005-07-08T08:40:02', '2005-07-12T04:45:02', '2'), + ('101', '2656', '2006-02-16T02:30:53', '2005-05-27T21:13:10', '2005-06-04T15:26:10', '2'), + ('249', '729', '2006-02-16T02:30:53', '2005-07-09T14:34:18', '2005-07-13T12:56:18', '2'), + ('13', '360', '2006-02-16T02:30:53', '2005-07-31T06:12:08', '2005-08-04T02:19:08', '2'), + ('597', '3022', '2006-02-16T02:30:53', '2005-08-19T07:23:06', '2005-08-23T06:11:06', '2'), + ('167', '2056', '2006-02-16T02:30:53', '2005-07-09T20:28:42', '2005-07-10T19:23:42', '2'), + ('274', '3200', '2006-02-16T02:30:53', '2005-07-31T06:39:45', '2005-08-01T02:37:45', '2'), + ('491', '3990', '2006-02-16T02:30:53', '2005-07-28T10:16:37', '2005-08-05T11:24:37', '2'), + ('422', '4142', '2006-02-16T02:30:53', '2005-06-17T04:26:23', '2005-06-25T09:32:23', '2'), + ('143', '2008', '2006-02-16T02:30:53', '2005-05-26T22:52:19', '2005-06-02T18:14:19', '2'), + ('589', '1113', '2006-02-16T02:30:53', '2005-05-28T05:23:38', '2005-05-29T08:00:38', '2'), + ('527', '4347', '2006-02-16T02:30:53', '2005-08-23T04:33:23', '2005-09-01T10:25:23', '2'), + ('368', '3470', '2006-02-16T02:30:53', '2005-08-22T21:18:08', '2005-08-25T20:29:08', '2'), + ('250', '1340', '2006-02-16T02:30:53', '2005-08-19T00:44:10', '2005-08-22T22:30:10', '2'), + ('165', '1890', '2006-02-16T02:30:53', '2005-07-06T01:24:08', '2005-07-11T22:00:08', '2'), + ('171', '99', '2006-02-16T02:30:53', '2005-06-18T01:57:56', '2005-06-23T20:34:56', '2'), + ('169', '1370', '2006-02-16T02:30:53', '2005-08-23T09:33:22', '2005-08-31T13:29:22', '2'), + ('198', '319', '2006-02-16T02:30:53', '2005-08-17T02:47:02', '2005-08-22T05:14:02', '2'), + ('57', '3331', '2006-02-16T02:30:53', '2005-07-29T00:48:44', '2005-08-07T04:25:44', '2'), + ('306', '1604', '2006-02-16T02:30:53', '2005-07-28T03:54:28', '2005-08-01T08:39:28', '2'), + ('520', '4283', '2006-02-16T02:30:53', '2005-07-27T08:50:07', '2005-08-04T09:46:07', '2'), + ('101', '1406', '2006-02-16T02:30:53', '2005-08-01T02:39:49', '2005-08-08T04:28:49', '2'), + ('457', '553', '2006-02-16T02:30:53', '2005-08-21T08:18:18', '2005-08-30T02:21:18', '2'), + ('518', '819', '2006-02-16T02:30:53', '2005-06-16T02:01:37', '2005-06-21T00:59:37', '2'), + ('597', '1622', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('526', '302', '2006-02-16T02:30:53', '2005-07-31T18:21:08', '2005-08-02T14:03:08', '2'), + ('265', '768', '2006-02-16T02:30:53', '2005-07-29T01:42:55', '2005-08-05T01:55:55', '2'), + ('432', '3564', '2006-02-16T02:30:53', '2005-07-28T17:58:36', '2005-07-29T14:48:36', '2'), + ('5', '169', '2006-02-16T02:30:53', '2005-08-21T14:02:50', '2005-08-22T16:45:50', '2'), + ('114', '303', '2006-02-16T02:30:53', '2005-05-26T07:59:37', '2005-05-29T09:43:37', '2'), + ('95', '3648', '2006-02-16T02:30:53', '2005-07-30T13:21:08', '2005-08-08T10:42:08', '2'), + ('190', '2456', '2006-02-16T02:30:53', '2005-08-18T04:32:05', '2005-08-21T01:37:05', '2'), + ('399', '2522', '2006-02-16T02:30:53', '2005-08-01T16:31:35', '2005-08-05T12:04:35', '2'), + ('135', '3998', '2006-02-16T02:30:53', '2005-07-07T06:25:19', '2005-07-11T00:50:19', '2'), + ('61', '209', '2006-02-16T02:30:53', '2005-08-17T21:50:25', '2005-08-25T22:36:25', '2'), + ('138', '4231', '2006-02-16T02:30:53', '2005-06-17T14:00:51', '2005-06-19T11:54:51', '2'), + ('32', '2627', '2006-02-16T02:30:53', '2005-07-10T23:22:01', '2005-07-14T04:42:01', '2'), + ('453', '2709', '2006-02-16T02:30:53', '2005-07-27T22:25:36', '2005-08-01T03:59:36', '2'), + ('405', '1895', '2006-02-16T02:30:53', '2005-08-02T17:14:19', '2005-08-11T14:02:19', '2'), + ('16', '3045', '2006-02-16T02:30:53', '2005-08-19T13:08:23', '2005-08-20T12:38:23', '2'), + ('40', '2564', '2006-02-16T02:30:53', '2005-07-31T16:53:43', '2005-08-07T20:13:43', '2'), + ('436', '259', '2006-02-16T02:30:53', '2005-08-17T15:19:54', '2005-08-24T18:22:54', '2'), + ('306', '3826', '2006-02-16T02:30:53', '2005-07-06T15:23:56', '2005-07-13T20:51:56', '2'), + ('113', '2695', '2006-02-16T02:30:53', '2005-08-18T08:57:58', '2005-08-25T05:20:58', '2'), + ('404', '737', '2006-02-16T02:30:53', '2005-07-08T23:38:40', '2005-07-12T05:33:40', '2'), + ('161', '2131', '2006-02-16T02:30:53', '2005-08-02T03:06:20', '2005-08-04T01:22:20', '2'), + ('514', '614', '2006-02-16T02:30:53', '2005-08-18T05:13:36', '2005-08-25T04:00:36', '2'), + ('353', '645', '2006-02-16T02:30:53', '2005-07-12T08:20:02', '2005-07-21T09:16:02', '2'), + ('481', '2617', '2006-02-16T02:30:53', '2005-08-21T17:15:33', '2005-08-24T20:24:33', '2'), + ('95', '260', '2006-02-16T02:30:53', '2005-07-27T10:29:06', '2005-08-05T12:09:06', '2'), + ('85', '1831', '2006-02-16T02:30:53', '2005-07-31T17:14:47', '2005-08-01T12:11:47', '2'), + ('585', '1625', '2006-02-16T02:30:53', '2005-06-15T12:29:41', '2005-06-22T12:45:41', '2'), + ('195', '2951', '2006-02-16T02:30:53', '2005-08-19T05:39:26', '2005-08-22T09:50:26', '2'), + ('156', '810', '2006-02-16T02:30:53', '2005-07-10T20:44:14', '2005-07-13T15:05:14', '2'), + ('235', '3767', '2006-02-16T02:30:53', '2005-07-31T00:45:57', '2005-08-06T00:59:57', '2'), + ('553', '3816', '2006-02-16T02:30:53', '2005-07-08T22:39:10', '2005-07-15T17:49:10', '2'), + ('347', '1025', '2006-02-16T02:30:53', '2005-06-21T09:04:50', '2005-06-30T12:10:50', '2'), + ('569', '2508', '2006-02-16T02:30:53', '2005-08-22T04:20:55', '2005-08-29T05:11:55', '2'), + ('383', '3679', '2006-02-16T02:30:53', '2005-08-18T22:04:54', '2005-08-23T21:19:54', '2'), + ('454', '2769', '2006-02-16T02:30:53', '2005-07-09T21:59:55', '2005-07-11T01:45:55', '2'), + ('436', '3459', '2006-02-16T02:30:53', '2005-08-20T11:26:33', '2005-08-27T11:12:33', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['8902', '13670', '217', '11662', '10308', '3596', '3379', '8434', '5939', '4789', '9658', '4496', '15103', '3521', '10854', '13173', '14776', '14832', '6686', '12880', '8034', '11052', '1694', '12389', '15536', '357', '11381', '8738', '14137', '15706', '14391', '12751', '12671', '2875', '2080', '5901', '1541', '2628', '5070', '3230', '14810', '2509', '4022', '1178', '12414', '15093', '6769', '11873', '10591', '3841', '11283', '6356', '11350', '685', '11324', '15037', '1147', '6477', '6888', '13980', '4884', '5328', '2916', '8229', '2562', '14489', '15939', '11464', '15358', '13893', '8753', '11616', '10747', '7503', '572', '9005', '3076', '1775', '1866', '14289', '6484', '5805', '11531', '2949', '5183', '14619', '12364', '2805', '13042', '7312', '10438', '1885', '8873', '11785', '13551', '8812', '3677', '5438', '577', '2749']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('408', '2983', '2006-02-16T02:30:53', '2005-07-30T01:08:06', '2005-08-05T00:00:06', '2'), + ('147', '1951', '2006-02-16T02:30:53', '2005-08-20T08:27:01', '2005-08-29T05:59:01', '2'), + ('121', '4395', '2006-02-16T02:30:53', '2005-05-26T09:24:26', '2005-05-31T03:24:26', '2'), + ('177', '2730', '2006-02-16T02:30:53', '2005-08-17T05:27:37', '2005-08-26T09:56:37', '2'), + ('240', '588', '2006-02-16T02:30:53', '2005-08-01T04:22:49', '2005-08-09T04:39:49', '2'), + ('419', '594', '2006-02-16T02:30:53', '2005-07-06T05:03:11', '2005-07-07T05:30:11', '2'), + ('566', '2022', '2006-02-16T02:30:53', '2005-06-21T13:54:58', '2005-06-23T13:43:58', '2'), + ('141', '40', '2006-02-16T02:30:53', '2005-07-29T07:20:14', '2005-07-30T08:50:14', '2'), + ('207', '4491', '2006-02-16T02:30:53', '2005-07-10T22:30:05', '2005-07-14T00:02:05', '2'), + ('73', '20', '2006-02-16T02:30:53', '2005-07-08T16:22:01', '2005-07-15T18:29:01', '2'), + ('282', '2332', '2006-02-16T02:30:53', '2005-07-31T06:00:52', '2005-08-09T04:47:52', '2'), + ('578', '150', '2006-02-16T02:30:53', '2005-07-08T01:44:19', '2005-07-08T20:34:19', '2'), + ('101', '853', '2006-02-16T02:30:53', '2005-08-22T12:01:06', '2005-08-25T14:40:06', '2'), + ('262', '1440', '2006-02-16T02:30:53', '2005-07-06T01:00:11', '2005-07-11T19:15:11', '2'), + ('356', '3295', '2006-02-16T02:30:53', '2005-08-02T00:02:06', '2005-08-02T21:55:06', '2'), + ('29', '1304', '2006-02-16T02:30:53', '2005-08-19T13:50:36', '2005-08-26T12:34:36', '2'), + ('15', '3488', '2006-02-16T02:30:53', '2005-08-21T23:53:35', '2005-08-24T02:00:35', '2'), + ('494', '1828', '2006-02-16T02:30:53', '2005-08-22T01:43:29', '2005-08-29T07:19:29', '2'), + ('6', '3804', '2006-02-16T02:30:53', '2005-07-12T12:18:38', '2005-07-13T17:56:38', '2'), + ('552', '3386', '2006-02-16T02:30:53', '2005-08-19T03:27:17', '2005-08-28T06:16:17', '2'), + ('502', '1997', '2006-02-16T02:30:53', '2005-07-28T16:20:26', '2005-08-04T19:11:26', '2'), + ('331', '1089', '2006-02-16T02:30:53', '2005-08-02T06:26:19', '2005-08-06T04:20:19', '2'), + ('532', '147', '2006-02-16T02:30:53', '2005-06-16T12:40:23', '2005-06-20T09:18:23', '2'), + ('394', '1891', '2006-02-16T02:30:53', '2005-08-18T08:48:36', '2005-08-22T08:59:36', '2'), + ('98', '4004', '2006-02-16T02:30:53', '2005-08-23T03:58:28', '2005-08-31T03:28:28', '2'), + ('198', '4417', '2006-02-16T02:30:53', '2005-05-27T06:37:15', '2005-05-30T07:04:15', '2'), + ('451', '993', '2006-02-16T02:30:53', '2005-08-02T18:19:29', '2005-08-08T20:39:29', '2'), + ('210', '3893', '2006-02-16T02:30:53', '2005-07-29T18:32:47', '2005-08-02T13:05:47', '2'), + ('53', '2346', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('220', '4486', '2006-02-16T02:30:53', '2005-08-23T10:32:52', '2005-08-24T07:03:52', '2'), + ('205', '3117', '2006-02-16T02:30:53', '2005-08-21T10:16:27', '2005-08-23T07:00:27', '2'), + ('352', '2791', '2006-02-16T02:30:53', '2005-08-18T22:33:22', '2005-08-20T20:28:22', '2'), + ('577', '1734', '2006-02-16T02:30:53', '2005-08-18T19:19:59', '2005-08-23T17:53:59', '2'), + ('186', '3012', '2006-02-16T02:30:53', '2005-06-20T00:47:18', '2005-06-25T18:54:18', '2'), + ('476', '1231', '2006-02-16T02:30:53', '2005-06-17T16:59:40', '2005-06-21T11:28:40', '2'), + ('165', '86', '2006-02-16T02:30:53', '2005-07-10T20:22:12', '2005-07-19T16:43:12', '2'), + ('189', '1911', '2006-02-16T02:30:53', '2005-06-16T01:15:59', '2005-06-22T21:26:59', '2'), + ('3', '3917', '2006-02-16T02:30:53', '2005-06-19T08:34:53', '2005-06-28T04:19:53', '2'), + ('407', '2305', '2006-02-16T02:30:53', '2005-07-09T04:58:26', '2005-07-09T23:00:26', '2'), + ('83', '215', '2006-02-16T02:30:53', '2005-06-21T02:23:16', '2005-06-22T01:37:16', '2'), + ('78', '1982', '2006-02-16T02:30:53', '2005-08-22T01:08:34', '2005-08-25T07:00:34', '2'), + ('213', '4469', '2006-02-16T02:30:53', '2005-06-18T23:44:08', '2005-06-20T01:36:08', '2'), + ('390', '3914', '2006-02-16T02:30:53', '2005-07-07T01:50:06', '2005-07-09T21:47:06', '2'), + ('279', '2553', '2006-02-16T02:30:53', '2005-06-15T00:36:40', '2005-06-21T00:27:40', '2'), + ('32', '4454', '2006-02-16T02:30:53', '2005-08-18T09:50:40', '2005-08-26T06:45:40', '2'), + ('60', '3534', '2006-02-16T02:30:53', '2005-08-22T11:39:03', '2005-08-23T06:16:03', '2'), + ('63', '1687', '2006-02-16T02:30:53', '2005-07-12T15:48:54', '2005-07-21T14:39:54', '2'), + ('554', '4021', '2006-02-16T02:30:53', '2005-08-17T14:14:39', '2005-08-18T17:20:39', '2'), + ('52', '3360', '2006-02-16T02:30:53', '2005-08-01T14:12:29', '2005-08-04T08:46:29', '2'), + ('470', '4228', '2006-02-16T02:30:53', '2005-07-06T16:34:00', '2005-07-08T15:12:00', '2'), + ('134', '312', '2006-02-16T02:30:53', '2005-08-02T14:39:46', '2005-08-05T10:19:46', '2'), + ('149', '2645', '2006-02-16T02:30:53', '2005-07-11T20:57:48', '2005-07-12T22:40:48', '2'), + ('598', '1265', '2006-02-16T02:30:53', '2005-08-02T17:22:59', '2005-08-09T19:56:59', '2'), + ('172', '1385', '2006-02-16T02:30:53', '2005-05-29T00:17:51', '2005-06-05T05:32:51', '2'), + ('540', '2900', '2006-02-16T02:30:53', '2005-08-02T16:31:17', '2005-08-08T15:38:17', '2'), + ('234', '4517', '2006-02-16T02:30:53', '2005-08-22T09:36:33', '2005-08-31T11:20:33', '2'), + ('259', '622', '2006-02-16T02:30:53', '2005-05-31T20:37:52', '2005-06-06T19:23:52', '2'), + ('181', '804', '2006-02-16T02:30:53', '2005-07-12T01:38:42', '2005-07-17T05:19:42', '2'), + ('490', '1896', '2006-02-16T02:30:53', '2005-07-12T21:01:11', '2005-07-17T21:49:11', '2'), + ('391', '1067', '2006-02-16T02:30:53', '2005-08-20T19:04:40', '2005-08-21T18:36:40', '2'), + ('425', '3543', '2006-02-16T02:30:53', '2005-07-08T19:49:17', '2005-07-15T23:14:17', '2'), + ('247', '2444', '2006-02-16T02:30:53', '2005-07-09T16:48:29', '2005-07-17T20:20:29', '2'), + ('590', '3086', '2006-02-16T02:30:53', '2005-06-20T04:01:04', '2005-06-27T22:40:04', '2'), + ('498', '4272', '2006-02-16T02:30:53', '2005-07-29T00:09:08', '2005-07-31T19:29:08', '2'), + ('265', '51', '2006-02-16T02:30:53', '2005-06-19T03:15:05', '2005-06-21T08:26:05', '2'), + ('9', '2312', '2006-02-16T02:30:53', '2005-08-21T13:53:59', '2005-08-30T15:45:59', '2'), + ('382', '3209', '2006-02-16T02:30:53', '2005-08-23T18:44:21', '2005-09-01T17:25:21', '2'), + ('577', '538', '2006-02-16T02:30:53', '2005-08-02T21:42:07', '2005-08-03T21:44:07', '2'), + ('448', '822', '2006-02-16T02:30:53', '2005-08-22T21:29:14', '2005-08-31T00:10:14', '2'), + ('390', '3503', '2006-02-16T02:30:53', '2005-08-20T15:52:52', '2005-08-27T16:21:52', '2'), + ('560', '1345', '2006-02-16T02:30:53', '2005-07-29T19:15:50', '2005-07-31T19:13:50', '2'), + ('36', '2588', '2006-02-16T02:30:53', '2005-08-17T04:00:01', '2005-08-20T23:03:01', '2'), + ('266', '4527', '2006-02-16T02:30:53', '2005-08-01T19:59:41', '2005-08-10T00:00:41', '2'), + ('3', '579', '2006-02-16T02:30:53', '2005-07-27T20:23:12', '2005-08-05T18:46:12', '2'), + ('337', '1899', '2006-02-16T02:30:53', '2005-05-28T10:30:13', '2005-06-02T05:04:13', '2'), + ('204', '157', '2006-02-16T02:30:53', '2005-07-30T05:04:58', '2005-08-03T07:41:58', '2'), + ('109', '1344', '2006-02-16T02:30:53', '2005-06-20T15:01:19', '2005-06-28T16:53:19', '2'), + ('123', '1922', '2006-02-16T02:30:53', '2005-06-16T18:28:19', '2005-06-25T13:09:19', '2'), + ('575', '2579', '2006-02-16T02:30:53', '2005-06-17T01:53:19', '2005-06-19T06:14:19', '2'), + ('103', '1185', '2006-02-16T02:30:53', '2005-08-21T06:58:49', '2005-08-25T11:29:49', '2'), + ('556', '4093', '2006-02-16T02:30:53', '2005-07-12T02:04:10', '2005-07-17T23:18:10', '2'), + ('532', '3553', '2006-02-16T02:30:53', '2005-07-10T15:08:41', '2005-07-19T16:35:41', '2'), + ('278', '1817', '2006-02-16T02:30:53', '2005-08-17T00:30:04', '2005-08-20T01:12:04', '2'), + ('78', '375', '2006-02-16T02:30:53', '2005-06-20T06:05:53', '2005-06-29T03:19:53', '2'), + ('394', '2866', '2006-02-16T02:30:53', '2005-07-09T10:13:45', '2005-07-16T15:55:45', '2'), + ('338', '1589', '2006-02-16T02:30:53', '2005-08-21T18:10:03', '2005-08-23T13:40:03', '2'), + ('84', '3398', '2006-02-16T02:30:53', '2005-08-18T07:55:09', '2005-08-19T05:29:09', '2'), + ('80', '2153', '2006-02-16T02:30:53', '2005-06-19T19:29:17', '2005-06-27T23:14:17', '2'), + ('414', '1047', '2006-02-16T02:30:53', '2005-08-19T09:06:08', '2005-08-22T13:46:08', '2'), + ('543', '228', '2006-02-16T02:30:53', '2005-07-27T13:03:14', '2005-07-31T07:56:14', '2'), + ('316', '4217', '2006-02-16T02:30:53', '2005-08-01T08:53:04', '2005-08-09T06:39:04', '2'), + ('588', '740', '2006-02-16T02:30:53', '2005-06-17T03:35:59', '2005-06-21T05:57:59', '2'), + ('91', '3498', '2006-02-16T02:30:53', '2005-07-30T00:14:32', '2005-08-04T20:42:32', '2'), + ('182', '2760', '2006-02-16T02:30:53', '2005-08-17T10:54:46', '2005-08-23T14:15:46', '2'), + ('503', '1049', '2006-02-16T02:30:53', '2005-08-20T04:00:30', '2005-08-21T06:26:30', '2'), + ('563', '1172', '2006-02-16T02:30:53', '2005-07-29T21:47:40', '2005-08-04T01:18:40', '2'), + ('5', '600', '2006-02-16T02:30:53', '2005-07-06T09:11:58', '2005-07-08T10:50:58', '2'), + ('241', '487', '2006-02-16T02:30:53', '2005-07-09T21:34:32', '2005-07-16T02:21:32', '2'), + ('6', '375', '2006-02-16T02:30:53', '2005-05-28T11:09:14', '2005-06-01T13:27:14', '2'), + ('358', '1540', '2006-02-16T02:30:53', '2005-06-19T16:27:35', '2005-06-25T21:06:35', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['5157', '9034', '8965', '10599', '8323', '11549', '3471', '9413', '9298', '2672', '15676', '13055', '7939', '7085', '14569', '9900', '8107', '15751', '8551', '13992', '3174', '14805', '5184', '11957', '918', '11131', '1360', '11036', '4799', '3806', '10739', '7412', '5612', '13449', '12689', '7355', '13852', '1640', '5213', '9086', '11611', '2254', '3303', '2738', '589', '1875', '9627', '12928', '15915', '7545', '5949', '4249', '15999', '12722', '7227', '8727', '4660', '13209', '6361', '6790', '5782', '11658', '88', '14634', '8497', '9423', '10352', '510', '9461', '7452', '2770', '7423', '8568', '2463', '5657', '13872', '5584', '210', '11984', '13462', '425', '13362', '12165', '2001', '9790', '7151', '13135', '7377', '6339', '8426', '15722', '3231', '9246', '12650', '15290', '13182', '11501', '5513', '14342', '13291']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('463', '637', '2006-02-16T02:30:53', '2005-07-09T08:52:12', '2005-07-12T04:32:12', '2'), + ('144', '3847', '2006-02-16T02:30:53', '2005-07-30T06:10:58', '2005-08-08T05:00:58', '2'), + ('599', '2419', '2006-02-16T02:30:53', '2005-07-30T03:52:37', '2005-08-05T01:28:37', '2'), + ('271', '2422', '2006-02-16T02:30:53', '2005-08-01T14:23:58', '2005-08-06T10:45:58', '2'), + ('87', '2766', '2006-02-16T02:30:53', '2005-07-29T03:52:59', '2005-08-06T01:49:59', '2'), + ('402', '945', '2006-02-16T02:30:53', '2005-08-17T01:01:48', '2005-08-19T21:24:48', '2'), + ('242', '1724', '2006-02-16T02:30:53', '2005-07-05T22:51:44', '2005-07-13T01:38:44', '2'), + ('290', '2618', '2006-02-16T02:30:53', '2005-07-30T20:44:39', '2005-08-01T01:56:39', '2'), + ('208', '2106', '2006-02-16T02:30:53', '2005-07-30T16:27:53', '2005-08-07T12:32:53', '2'), + ('420', '1164', '2006-02-16T02:30:53', '2005-06-19T11:42:04', '2005-06-25T09:14:04', '2'), + ('353', '3874', '2006-02-16T02:30:53', '2005-08-23T09:23:08', '2005-08-30T06:19:08', '2'), + ('485', '3580', '2006-02-16T02:30:53', '2005-08-19T09:36:28', '2005-08-24T05:53:28', '2'), + ('37', '2004', '2006-02-16T02:30:53', '2005-07-28T12:45:47', '2005-07-30T18:32:47', '2'), + ('223', '2603', '2006-02-16T02:30:53', '2005-07-27T04:35:44', '2005-08-05T07:10:44', '2'), + ('15', '884', '2006-02-16T02:30:53', '2005-08-21T16:31:22', '2005-08-25T21:27:22', '2'), + ('453', '3132', '2006-02-16T02:30:53', '2005-07-31T14:15:05', '2005-08-07T11:58:05', '2'), + ('518', '1318', '2006-02-16T02:30:53', '2005-07-28T19:03:16', '2005-08-05T17:18:16', '2'), + ('199', '697', '2006-02-16T02:30:53', '2005-08-23T12:41:07', '2005-08-29T07:03:07', '2'), + ('340', '2083', '2006-02-16T02:30:53', '2005-07-29T11:13:11', '2005-08-05T05:17:11', '2'), + ('136', '2798', '2006-02-16T02:30:53', '2005-08-20T19:30:35', '2005-08-24T19:09:35', '2'), + ('107', '3331', '2006-02-16T02:30:53', '2005-06-20T22:24:00', '2005-06-22T21:22:00', '2'), + ('169', '783', '2006-02-16T02:30:53', '2005-08-22T00:52:01', '2005-08-23T03:28:01', '2'), + ('166', '1101', '2006-02-16T02:30:53', '2005-07-09T10:14:34', '2005-07-14T16:05:34', '2'), + ('198', '1924', '2006-02-16T02:30:53', '2005-08-17T17:22:29', '2005-08-23T21:47:29', '2'), + ('197', '818', '2006-02-16T02:30:53', '2005-05-30T11:32:24', '2005-05-31T07:55:24', '2'), + ('293', '1860', '2006-02-16T02:30:53', '2005-08-02T09:10:04', '2005-08-08T09:59:04', '2'), + ('14', '4107', '2006-02-16T02:30:53', '2005-06-15T13:32:15', '2005-06-18T10:59:15', '2'), + ('502', '2054', '2006-02-16T02:30:53', '2005-08-02T05:56:29', '2005-08-05T05:00:29', '2'), + ('512', '4112', '2006-02-16T02:30:53', '2005-07-08T16:49:27', '2005-07-12T19:58:27', '2'), + ('154', '3555', '2006-02-16T02:30:53', '2005-07-06T15:09:41', '2005-07-14T09:14:41', '2'), + ('197', '3160', '2006-02-16T02:30:53', '2005-08-01T19:46:11', '2005-08-06T21:08:11', '2'), + ('582', '950', '2006-02-16T02:30:53', '2005-07-27T16:44:34', '2005-08-04T15:06:34', '2'), + ('472', '2363', '2006-02-16T02:30:53', '2005-07-10T05:15:12', '2005-07-17T09:50:12', '2'), + ('400', '1297', '2006-02-16T02:30:53', '2005-08-20T00:17:01', '2005-08-23T20:42:01', '2'), + ('296', '1066', '2006-02-16T02:30:53', '2005-08-18T20:06:34', '2005-08-22T20:11:34', '2'), + ('115', '3803', '2006-02-16T02:30:53', '2005-07-27T14:45:59', '2005-08-02T17:23:59', '2'), + ('535', '85', '2006-02-16T02:30:53', '2005-08-20T14:45:23', '2005-08-22T16:47:23', '2'), + ('86', '443', '2006-02-16T02:30:53', '2005-06-16T08:35:39', '2005-06-17T05:37:39', '2'), + ('552', '3708', '2006-02-16T02:30:53', '2005-07-09T11:39:43', '2005-07-18T16:20:43', '2'), + ('57', '2779', '2006-02-16T02:30:53', '2005-07-30T08:18:46', '2005-08-06T06:10:46', '2'), + ('192', '1857', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('281', '1084', '2006-02-16T02:30:53', '2005-06-18T05:15:14', '2005-06-27T04:10:14', '2'), + ('361', '1565', '2006-02-16T02:30:53', '2005-06-21T07:34:14', '2005-06-26T13:18:14', '2'), + ('75', '350', '2006-02-16T02:30:53', '2005-06-19T15:56:30', '2005-06-20T16:14:30', '2'), + ('308', '4231', '2006-02-16T02:30:53', '2005-05-28T12:27:50', '2005-06-03T07:15:50', '2'), + ('528', '1652', '2006-02-16T02:30:53', '2005-06-17T02:45:10', '2005-06-22T22:54:10', '2'), + ('12', '471', '2006-02-16T02:30:53', '2005-07-31T04:42:46', '2005-08-08T00:42:46', '2'), + ('353', '4531', '2006-02-16T02:30:53', '2005-08-19T05:04:09', '2005-08-24T09:09:09', '2'), + ('167', '3566', '2006-02-16T02:30:53', '2005-08-23T17:52:01', '2005-08-24T20:40:01', '2'), + ('292', '2541', '2006-02-16T02:30:53', '2005-07-27T21:48:03', '2005-08-01T22:23:03', '2'), + ('496', '4397', '2006-02-16T02:30:53', '2005-07-10T23:13:00', '2005-07-14T01:10:00', '2'), + ('111', '4185', '2006-02-16T02:30:53', '2005-07-07T14:05:17', '2005-07-10T09:21:17', '2'), + ('377', '2584', '2006-02-16T02:30:53', '2005-08-23T20:44:10', '2005-08-31T02:38:10', '2'), + ('416', '913', '2006-02-16T02:30:53', '2005-08-18T21:33:53', '2005-08-27T23:47:53', '2'), + ('164', '791', '2006-02-16T02:30:53', '2005-07-27T09:53:43', '2005-08-05T09:36:43', '2'), + ('528', '3031', '2006-02-16T02:30:53', '2005-07-29T18:09:57', '2005-08-03T13:41:57', '2'), + ('139', '1208', '2006-02-16T02:30:53', '2005-07-08T09:54:47', '2005-07-11T15:19:47', '2'), + ('5', '1574', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('561', '2903', '2006-02-16T02:30:53', '2005-07-11T21:09:14', '2005-07-14T18:26:14', '2'), + ('400', '4486', '2006-02-16T02:30:53', '2005-07-12T16:34:59', '2005-07-17T21:43:59', '2'), + ('440', '2514', '2006-02-16T02:30:53', '2005-07-10T13:52:56', '2005-07-15T09:32:56', '2'), + ('422', '2008', '2006-02-16T02:30:53', '2005-08-17T05:19:17', '2005-08-24T07:03:17', '2'), + ('53', '2221', '2006-02-16T02:30:53', '2005-05-25T14:13:54', '2005-05-29T09:32:54', '2'), + ('494', '486', '2006-02-16T02:30:53', '2005-08-21T18:51:28', '2005-08-29T19:30:28', '2'), + ('593', '1837', '2006-02-16T02:30:53', '2005-07-29T09:07:03', '2005-08-02T09:18:03', '2'), + ('242', '3145', '2006-02-16T02:30:53', '2005-07-30T21:10:14', '2005-08-07T16:34:14', '2'), + ('564', '1288', '2006-02-16T02:30:53', '2005-08-01T05:44:36', '2005-08-05T07:15:36', '2'), + ('113', '4338', '2006-02-16T02:30:53', '2005-05-28T02:52:14', '2005-05-30T21:20:14', '2'), + ('377', '1679', '2006-02-16T02:30:53', '2005-07-30T22:29:13', '2005-08-05T20:55:13', '2'), + ('285', '3482', '2006-02-16T02:30:53', '2005-07-27T18:26:39', '2005-08-04T17:35:39', '2'), + ('533', '3042', '2006-02-16T02:30:53', '2005-06-19T17:54:22', '2005-06-26T23:09:22', '2'), + ('277', '666', '2006-02-16T02:30:53', '2005-07-27T17:11:47', '2005-07-29T12:29:47', '2'), + ('583', '1599', '2006-02-16T02:30:53', '2005-07-29T11:38:22', '2005-08-04T13:22:22', '2'), + ('194', '1186', '2006-02-16T02:30:53', '2005-06-18T20:01:43', '2005-06-25T15:04:43', '2'), + ('508', '4342', '2006-02-16T02:30:53', '2005-07-10T07:33:43', '2005-07-18T01:55:43', '2'), + ('421', '2416', '2006-02-16T02:30:53', '2005-08-20T15:10:30', '2005-08-24T10:14:30', '2'), + ('289', '2606', '2006-02-16T02:30:53', '2005-07-10T04:15:25', '2005-07-16T22:54:25', '2'), + ('391', '1801', '2006-02-16T02:30:53', '2005-05-26T08:14:15', '2005-05-27T12:12:15', '2'), + ('96', '3577', '2006-02-16T02:30:53', '2005-08-17T18:16:30', '2005-08-24T21:09:30', '2'), + ('489', '3865', '2006-02-16T02:30:53', '2005-08-20T00:49:19', '2005-08-26T06:21:19', '2'), + ('182', '1518', '2006-02-16T02:30:53', '2005-05-27T15:51:30', '2005-06-03T16:52:30', '2'), + ('565', '869', '2006-02-16T02:30:53', '2005-08-19T21:07:54', '2005-08-20T17:29:54', '2'), + ('24', '4215', '2006-02-16T02:30:53', '2005-08-18T00:53:37', '2005-08-27T00:09:37', '2'), + ('260', '2069', '2006-02-16T02:30:53', '2005-06-17T11:35:09', '2005-06-21T14:52:09', '2'), + ('284', '3643', '2006-02-16T02:30:53', '2005-07-31T10:34:08', '2005-08-04T11:19:08', '2'), + ('289', '1259', '2006-02-16T02:30:53', '2005-07-27T07:14:31', '2005-08-01T01:35:31', '2'), + ('361', '1585', '2006-02-16T02:30:53', '2005-08-19T12:22:52', '2005-08-21T14:04:52', '2'), + ('588', '1369', '2006-02-16T02:30:53', '2005-07-27T15:31:28', '2005-08-02T19:59:28', '2'), + ('145', '2401', '2006-02-16T02:30:53', '2005-07-11T19:45:32', '2005-07-18T22:34:32', '2'), + ('564', '1840', '2006-02-16T02:30:53', '2005-07-29T07:07:48', '2005-08-07T08:56:48', '2'), + ('26', '2809', '2006-02-16T02:30:53', '2005-08-23T11:16:29', '2005-09-01T13:24:29', '2'), + ('28', '237', '2006-02-16T02:30:53', '2005-06-21T02:25:00', '2005-06-23T05:46:00', '2'), + ('185', '3390', '2006-02-16T02:30:53', '2005-07-30T14:12:31', '2005-08-02T14:25:31', '2'), + ('276', '3237', '2006-02-16T02:30:53', '2005-08-18T18:33:20', '2005-08-21T17:45:20', '2'), + ('404', '270', '2006-02-16T02:30:53', '2005-08-22T19:28:02', '2005-08-31T20:04:02', '2'), + ('496', '364', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('23', '2147', '2006-02-16T02:30:53', '2005-08-16T23:04:53', '2005-08-19T20:57:53', '2'), + ('356', '2558', '2006-02-16T02:30:53', '2005-07-10T01:05:41', '2005-07-11T02:05:41', '2'), + ('559', '2749', '2006-02-16T02:30:53', '2005-08-21T08:39:26', '2005-08-23T11:40:26', '2'), + ('243', '1631', '2006-02-16T02:30:53', '2005-08-19T18:32:11', '2005-08-20T18:22:11', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['5422', '7502', '6404', '5541', '4501', '2719', '15216', '4918', '9342', '10698', '1064', '8915', '3003', '7953', '11302', '8062', '4091', '3973', '9451', '12056', '10190', '9221', '5816', '6101', '11646', '14038', '8834', '11757', '3156', '5204', '7481', '5368', '4651', '3293', '9965', '658', '3404', '9829', '6623', '9358', '2161', '7998', '12900', '1753', '3528', '5627', '1394', '5686', '7036', '6066', '6653', '11572', '3635', '10566', '2703', '5044', '15965', '4428', '9065', '14432', '14572', '12129', '8504', '541', '945', '9258', '4987', '3714', '3411', '13880', '7999', '3557', '15944', '8220', '9959', '15095', '14641', '14005', '14652', '3453', '4933', '5346', '15727', '174', '8906', '11348', '2067', '4478', '3563', '11420', '8134', '11451', '8061', '6754', '14765', '606', '2300', '8944', '6593', '9063']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('409', '436', '2006-02-16T02:30:53', '2005-07-09T20:55:47', '2005-07-15T15:15:47', '2'), + ('303', '3229', '2006-02-16T02:30:53', '2005-07-27T20:19:08', '2005-07-28T18:32:08', '2'), + ('526', '1183', '2006-02-16T02:30:53', '2005-07-11T22:49:50', '2005-07-14T18:29:50', '2'), + ('135', '1211', '2006-02-16T02:30:53', '2005-07-10T02:44:27', '2005-07-13T04:13:27', '2'), + ('262', '1412', '2006-02-16T02:30:53', '2005-07-08T02:12:00', '2005-07-10T02:16:00', '2'), + ('336', '1200', '2006-02-16T02:30:53', '2005-06-19T14:50:19', '2005-06-20T14:33:19', '2'), + ('166', '1633', '2006-02-16T02:30:53', '2005-08-22T16:57:02', '2005-08-24T16:11:02', '2'), + ('220', '3819', '2006-02-16T02:30:53', '2005-07-08T21:37:31', '2005-07-11T20:16:31', '2'), + ('552', '2318', '2006-02-16T02:30:53', '2005-07-30T18:09:56', '2005-08-08T13:54:56', '2'), + ('135', '2738', '2006-02-16T02:30:53', '2005-08-01T18:24:41', '2005-08-08T18:59:41', '2'), + ('460', '2373', '2006-02-16T02:30:53', '2005-05-31T08:50:07', '2005-06-02T14:47:07', '2'), + ('42', '3030', '2006-02-16T02:30:53', '2005-07-30T01:42:09', '2005-08-04T23:29:09', '2'), + ('38', '616', '2006-02-16T02:30:53', '2005-06-20T10:00:51', '2005-06-22T06:28:51', '2'), + ('319', '4471', '2006-02-16T02:30:53', '2005-07-28T13:24:32', '2005-08-05T16:09:32', '2'), + ('51', '1918', '2006-02-16T02:30:53', '2005-08-02T15:38:03', '2005-08-09T10:33:03', '2'), + ('317', '1384', '2006-02-16T02:30:53', '2005-07-28T17:15:06', '2005-07-30T16:56:06', '2'), + ('337', '3928', '2006-02-16T02:30:53', '2005-07-07T05:53:38', '2005-07-14T03:12:38', '2'), + ('592', '2625', '2006-02-16T02:30:53', '2005-07-06T22:58:31', '2005-07-16T03:27:31', '2'), + ('584', '685', '2006-02-16T02:30:53', '2005-07-30T22:10:17', '2005-08-07T02:53:17', '2'), + ('460', '1091', '2006-02-16T02:30:53', '2005-08-17T21:03:48', '2005-08-21T22:42:48', '2'), + ('138', '4411', '2006-02-16T02:30:53', '2005-08-01T00:27:53', '2005-08-01T20:32:53', '2'), + ('113', '2496', '2006-02-16T02:30:53', '2005-07-30T13:20:06', '2005-08-06T13:58:06', '2'), + ('382', '1746', '2006-02-16T02:30:53', '2005-07-10T15:48:47', '2005-07-13T11:51:47', '2'), + ('508', '2618', '2006-02-16T02:30:53', '2005-07-11T06:50:33', '2005-07-18T01:52:33', '2'), + ('11', '478', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('589', '1069', '2006-02-16T02:30:53', '2005-08-20T21:39:23', '2005-08-27T23:57:23', '2'), + ('243', '4477', '2006-02-16T02:30:53', '2005-07-29T22:41:48', '2005-08-05T03:21:48', '2'), + ('550', '1295', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('365', '2217', '2006-02-16T02:30:53', '2005-06-20T21:03:46', '2005-06-21T23:32:46', '2'), + ('432', '1791', '2006-02-16T02:30:53', '2005-07-09T10:54:14', '2005-07-12T14:29:14', '2'), + ('240', '1804', '2006-02-16T02:30:53', '2005-07-27T19:20:25', '2005-07-29T19:07:25', '2'), + ('502', '4429', '2006-02-16T02:30:53', '2005-07-09T18:41:59', '2005-07-16T00:32:59', '2'), + ('557', '4064', '2006-02-16T02:30:53', '2005-07-08T09:39:39', '2005-07-09T12:14:39', '2'), + ('481', '4407', '2006-02-16T02:30:53', '2005-06-21T06:59:33', '2005-06-25T06:54:33', '2'), + ('101', '3946', '2006-02-16T02:30:53', '2005-07-31T16:19:32', '2005-08-05T20:18:32', '2'), + ('103', '3226', '2006-02-16T02:30:53', '2005-05-28T20:23:23', '2005-06-06T19:31:23', '2'), + ('424', '2005', '2006-02-16T02:30:53', '2005-06-21T15:57:52', '2005-06-24T20:58:52', '2'), + ('435', '231', '2006-02-16T02:30:53', '2005-07-31T11:58:38', '2005-08-07T08:11:38', '2'), + ('302', '4412', '2006-02-16T02:30:53', '2005-07-12T09:05:34', '2005-07-19T13:54:34', '2'), + ('302', '712', '2006-02-16T02:30:53', '2005-07-30T18:37:24', '2005-08-07T23:34:24', '2'), + ('75', '3149', '2006-02-16T02:30:53', '2005-06-17T23:39:50', '2005-06-26T23:28:50', '2'), + ('598', '1397', '2006-02-16T02:30:53', '2005-07-28T15:08:48', '2005-07-31T16:14:48', '2'), + ('408', '849', '2006-02-16T02:30:53', '2005-08-19T04:03:49', '2005-08-24T22:11:49', '2'), + ('249', '3817', '2006-02-16T02:30:53', '2005-06-16T17:08:17', '2005-06-21T21:47:17', '2'), + ('201', '1954', '2006-02-16T02:30:53', '2005-07-06T01:13:27', '2005-07-06T23:45:27', '2'), + ('136', '244', '2006-02-16T02:30:53', '2005-07-10T05:51:12', '2005-07-17T09:56:12', '2'), + ('268', '2802', '2006-02-16T02:30:53', '2005-06-15T16:17:21', '2005-06-21T20:44:21', '2'), + ('521', '717', '2006-02-16T02:30:53', '2005-07-10T09:06:03', '2005-07-11T10:59:03', '2'), + ('70', '2569', '2006-02-16T02:30:53', '2005-07-27T03:06:12', '2005-07-28T23:26:12', '2'), + ('155', '1877', '2006-02-16T02:30:53', '2005-07-11T04:32:42', '2005-07-15T03:56:42', '2'), + ('25', '614', '2006-02-16T02:30:53', '2005-07-12T11:06:17', '2005-07-19T16:52:17', '2'), + ('515', '3512', '2006-02-16T02:30:53', '2005-08-17T01:37:55', '2005-08-19T06:22:55', '2'), + ('250', '421', '2006-02-16T02:30:53', '2005-07-06T06:55:36', '2005-07-09T07:57:36', '2'), + ('269', '3988', '2006-02-16T02:30:53', '2005-08-01T13:12:11', '2005-08-05T11:16:11', '2'), + ('319', '4080', '2006-02-16T02:30:53', '2005-06-19T13:36:06', '2005-06-28T08:26:06', '2'), + ('147', '1625', '2006-02-16T02:30:53', '2005-07-09T03:30:25', '2005-07-11T02:32:25', '2'), + ('509', '3449', '2006-02-16T02:30:53', '2005-08-23T19:46:39', '2005-08-24T20:08:39', '2'), + ('181', '2575', '2006-02-16T02:30:53', '2005-07-07T22:29:40', '2005-07-11T02:46:40', '2'), + ('238', '349', '2006-02-16T02:30:53', '2005-07-30T07:25:09', '2005-07-31T05:18:09', '2'), + ('138', '2294', '2006-02-16T02:30:53', '2005-08-21T11:36:15', '2005-08-24T08:02:15', '2'), + ('538', '1397', '2006-02-16T02:30:53', '2005-08-21T16:44:31', '2005-08-26T16:35:31', '2'), + ('146', '891', '2006-02-16T02:30:53', '2005-08-17T23:31:25', '2005-08-26T19:10:25', '2'), + ('561', '2295', '2006-02-16T02:30:53', '2005-07-29T09:20:16', '2005-08-07T04:27:16', '2'), + ('535', '1662', '2006-02-16T02:30:53', '2005-05-28T06:41:58', '2005-06-02T09:12:58', '2'), + ('357', '1441', '2006-02-16T02:30:53', '2005-05-30T15:33:17', '2005-06-02T15:02:17', '2'), + ('275', '2007', '2006-02-16T02:30:53', '2005-07-30T14:31:31', '2005-08-05T16:29:31', '2'), + ('277', '996', '2006-02-16T02:30:53', '2005-07-09T00:45:41', '2005-07-14T03:32:41', '2'), + ('276', '1985', '2006-02-16T02:30:53', '2005-07-06T10:51:28', '2005-07-09T13:57:28', '2'), + ('12', '4250', '2006-02-16T02:30:53', '2005-06-21T16:31:27', '2005-06-28T12:27:27', '2'), + ('268', '3911', '2006-02-16T02:30:53', '2005-08-20T15:18:20', '2005-08-24T18:03:20', '2'), + ('170', '2750', '2006-02-16T02:30:53', '2005-07-28T15:10:14', '2005-08-06T17:08:14', '2'), + ('292', '3832', '2006-02-16T02:30:53', '2005-07-06T02:48:39', '2005-07-08T22:52:39', '2'), + ('348', '4559', '2006-02-16T02:30:53', '2005-08-23T18:50:54', '2005-08-25T18:04:54', '2'), + ('360', '1061', '2006-02-16T02:30:53', '2005-07-28T23:46:41', '2005-07-31T22:14:41', '2'), + ('199', '340', '2006-02-16T02:30:53', '2005-07-31T16:04:22', '2005-08-03T21:51:22', '2'), + ('202', '489', '2006-02-16T02:30:53', '2005-08-22T11:41:35', '2005-08-25T16:44:35', '2'), + ('147', '2205', '2006-02-16T02:30:53', '2005-08-21T19:05:23', '2005-08-22T22:30:23', '2'), + ('135', '1415', '2006-02-16T02:30:53', '2005-08-20T20:19:05', '2005-08-26T01:42:05', '2'), + ('453', '4163', '2006-02-16T02:30:53', '2005-08-21T19:32:05', '2005-08-23T23:33:05', '2'), + ('278', '842', '2006-02-16T02:30:53', '2005-06-21T21:12:11', '2005-06-23T17:39:11', '2'), + ('579', '322', '2006-02-16T02:30:53', '2005-07-08T22:18:29', '2005-07-13T03:47:29', '2'), + ('287', '2488', '2006-02-16T02:30:53', '2005-07-09T17:29:01', '2005-07-14T12:47:01', '2'), + ('416', '2184', '2006-02-16T02:30:53', '2005-08-23T11:28:49', '2005-08-24T06:24:49', '2'), + ('552', '3954', '2006-02-16T02:30:53', '2005-05-26T03:44:10', '2005-05-28T07:13:10', '2'), + ('560', '2667', '2006-02-16T02:30:53', '2005-07-30T01:21:39', '2005-08-07T02:14:39', '2'), + ('389', '1704', '2006-02-16T02:30:53', '2005-08-02T17:18:38', '2005-08-06T16:11:38', '2'), + ('297', '1711', '2006-02-16T02:30:53', '2005-06-17T16:11:08', '2005-06-22T13:01:08', '2'), + ('357', '1764', '2006-02-16T02:30:53', '2005-07-08T00:39:08', '2005-07-11T21:57:08', '2'), + ('210', '4261', '2006-02-16T02:30:53', '2005-07-06T02:57:01', '2005-07-14T02:25:01', '2'), + ('158', '3928', '2006-02-16T02:30:53', '2005-08-02T19:47:56', '2005-08-05T21:48:56', '2'), + ('41', '1695', '2006-02-16T02:30:53', '2005-07-28T20:01:23', '2005-08-03T01:00:23', '2'), + ('515', '776', '2006-02-16T02:30:53', '2005-08-02T20:45:56', '2005-08-06T21:42:56', '2'), + ('467', '650', '2006-02-16T02:30:53', '2005-07-28T17:12:53', '2005-08-05T13:56:53', '2'), + ('114', '1460', '2006-02-16T02:30:53', '2005-07-12T14:59:24', '2005-07-14T11:04:24', '2'), + ('435', '2817', '2006-02-16T02:30:53', '2005-08-21T23:40:28', '2005-08-25T04:55:28', '2'), + ('299', '3509', '2006-02-16T02:30:53', '2005-05-28T14:48:39', '2005-06-04T09:44:39', '2'), + ('291', '1617', '2006-02-16T02:30:53', '2005-06-18T08:22:34', '2005-06-24T04:51:34', '2'), + ('172', '3513', '2006-02-16T02:30:53', '2005-07-30T03:11:44', '2005-08-06T23:15:44', '2'), + ('356', '3441', '2006-02-16T02:30:53', '2005-07-12T07:21:17', '2005-07-14T02:35:17', '2'), + ('564', '2851', '2006-02-16T02:30:53', '2005-07-30T07:24:34', '2005-08-05T01:28:34', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['8408', '10093', '3654', '3301', '11068', '4906', '989', '1902', '11231', '7342', '14374', '7654', '10279', '7360', '7906', '10574', '2863', '10066', '258', '6445', '1086', '10826', '1588', '8754', '7432', '6249', '2582', '14961', '14916', '4615', '15557', '812', '15926', '12888', '8756', '5060', '11587', '13039', '10809', '12799', '15241', '8736', '6977', '13080', '9111', '12569', '15565', '15873', '9701', '6800', '9524', '977', '8697', '15062', '6194', '4374', '11631', '4747', '5781', '12951', '420', '6213', '1071', '9732', '13854', '557', '8369', '14874', '8384', '1267', '1381', '15480', '14174', '14187', '4975', '11251', '1099', '12554', '7544', '4278', '11951', '13056', '14019', '8865', '10486', '4349', '12642', '4315', '8400', '10656', '8600', '3116', '11376', '11818', '775', '6950', '4200', '7850', '1177', '9345']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('90', '1841', '2006-02-16T02:30:53', '2005-07-29T06:40:40', '2005-07-30T10:02:40', '2'), + ('162', '3943', '2006-02-16T02:30:53', '2005-07-31T20:30:32', '2005-08-04T00:04:32', '2'), + ('528', '1621', '2006-02-16T02:30:53', '2005-07-06T07:45:31', '2005-07-12T09:59:31', '2'), + ('444', '503', '2006-02-16T02:30:53', '2005-06-21T07:32:25', '2005-06-28T06:26:25', '2'), + ('52', '1262', '2006-02-16T02:30:53', '2005-08-02T07:08:07', '2005-08-09T11:15:07', '2'), + ('490', '1527', '2006-02-16T02:30:53', '2005-07-08T20:59:13', '2005-07-15T01:12:13', '2'), + ('83', '4388', '2006-02-16T02:30:53', '2005-05-30T23:11:51', '2005-06-03T20:36:51', '2'), + ('479', '2905', '2006-02-16T02:30:53', '2005-06-17T04:35:52', '2005-06-20T06:52:52', '2'), + ('90', '1100', '2006-02-16T02:30:53', '2005-08-02T13:02:11', '2005-08-07T10:05:11', '2'), + ('504', '4083', '2006-02-16T02:30:53', '2005-07-27T14:25:17', '2005-08-04T10:02:17', '2'), + ('213', '236', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('360', '1009', '2006-02-16T02:30:53', '2005-07-28T02:00:14', '2005-07-31T20:50:14', '2'), + ('247', '3794', '2006-02-16T02:30:53', '2005-08-01T03:26:44', '2005-08-07T22:35:44', '2'), + ('467', '1312', '2006-02-16T02:30:53', '2005-07-27T14:52:06', '2005-08-02T12:24:06', '2'), + ('85', '1216', '2006-02-16T02:30:53', '2005-07-28T11:31:42', '2005-08-01T11:56:42', '2'), + ('287', '679', '2006-02-16T02:30:53', '2005-08-01T13:36:51', '2005-08-10T13:25:51', '2'), + ('228', '2410', '2006-02-16T02:30:53', '2005-06-19T23:58:38', '2005-06-23T23:27:38', '2'), + ('123', '4285', '2006-02-16T02:30:53', '2005-07-31T19:30:01', '2005-08-01T14:45:01', '2'), + ('502', '3534', '2006-02-16T02:30:53', '2005-05-26T15:28:14', '2005-05-30T18:38:14', '2'), + ('385', '582', '2006-02-16T02:30:53', '2005-07-12T00:37:02', '2005-07-17T22:05:02', '2'), + ('549', '2909', '2006-02-16T02:30:53', '2005-05-31T11:17:37', '2005-06-06T13:58:37', '2'), + ('476', '1228', '2006-02-16T02:30:53', '2005-08-01T23:07:56', '2005-08-08T04:10:56', '2'), + ('322', '4472', '2006-02-16T02:30:53', '2005-06-16T04:53:21', '2005-06-25T07:29:21', '2'), + ('174', '1678', '2006-02-16T02:30:53', '2005-07-29T19:18:30', '2005-08-05T18:39:30', '2'), + ('132', '3169', '2006-02-16T02:30:53', '2005-07-27T17:31:40', '2005-07-28T17:44:40', '2'), + ('30', '4334', '2006-02-16T02:30:53', '2005-07-11T15:02:02', '2005-07-14T11:37:02', '2'), + ('267', '201', '2006-02-16T02:30:53', '2005-06-19T04:56:27', '2005-06-26T08:56:27', '2'), + ('52', '3274', '2006-02-16T02:30:53', '2005-08-22T06:35:50', '2005-08-31T04:07:50', '2'), + ('80', '2110', '2006-02-16T02:30:53', '2005-08-22T04:56:57', '2005-08-24T06:36:57', '2'), + ('404', '1200', '2006-02-16T02:30:53', '2005-07-08T07:46:53', '2005-07-16T12:43:53', '2'), + ('444', '3641', '2006-02-16T02:30:53', '2005-08-23T04:52:17', '2005-08-30T02:15:17', '2'), + ('225', '1099', '2006-02-16T02:30:53', '2005-05-29T20:00:30', '2005-05-30T19:43:30', '2'), + ('151', '2231', '2006-02-16T02:30:53', '2005-08-23T18:20:56', '2005-08-24T18:20:56', '2'), + ('146', '4398', '2006-02-16T02:30:53', '2005-08-19T03:41:09', '2005-08-24T07:09:09', '2'), + ('120', '4146', '2006-02-16T02:30:53', '2005-07-29T19:18:57', '2005-08-02T20:07:57', '2'), + ('57', '4317', '2006-02-16T02:30:53', '2005-07-09T04:28:03', '2005-07-12T07:41:03', '2'), + ('156', '1319', '2006-02-16T02:30:53', '2005-08-17T02:21:03', '2005-08-25T21:02:03', '2'), + ('370', '1952', '2006-02-16T02:30:53', '2005-08-19T08:55:19', '2005-08-20T07:39:19', '2'), + ('340', '1167', '2006-02-16T02:30:53', '2005-08-01T22:39:27', '2005-08-03T03:44:27', '2'), + ('197', '3885', '2006-02-16T02:30:53', '2005-08-19T00:27:01', '2005-08-22T03:30:01', '2'), + ('337', '832', '2006-02-16T02:30:53', '2005-08-22T17:47:40', '2005-08-29T15:28:40', '2'), + ('530', '1726', '2006-02-16T02:30:53', '2005-07-29T18:31:15', '2005-07-30T16:24:15', '2'), + ('429', '3545', '2006-02-16T02:30:53', '2005-07-27T00:40:50', '2005-08-02T19:08:50', '2'), + ('452', '4222', '2006-02-16T02:30:53', '2005-08-19T10:18:00', '2005-08-22T06:37:00', '2'), + ('211', '166', '2006-02-16T02:30:53', '2005-07-30T09:05:44', '2005-08-04T14:27:44', '2'), + ('29', '1009', '2006-02-16T02:30:53', '2005-08-18T15:20:46', '2005-08-24T12:38:46', '2'), + ('546', '71', '2006-02-16T02:30:53', '2005-08-23T05:13:09', '2005-08-30T08:58:09', '2'), + ('577', '4548', '2006-02-16T02:30:53', '2005-08-23T16:27:59', '2005-08-26T11:11:59', '2'), + ('401', '4581', '2006-02-16T02:30:53', '2005-07-31T07:32:21', '2005-08-01T05:07:21', '2'), + ('599', '3742', '2006-02-16T02:30:53', '2005-07-12T17:03:56', '2005-07-21T20:32:56', '2'), + ('535', '1796', '2006-02-16T02:30:53', '2005-07-31T01:01:06', '2005-08-04T04:06:06', '2'), + ('394', '2029', '2006-02-16T02:30:53', '2005-05-30T21:22:26', '2005-06-04T22:32:26', '2'), + ('291', '443', '2006-02-16T02:30:53', '2005-07-29T16:46:07', '2005-08-02T19:27:07', '2'), + ('139', '4393', '2006-02-16T02:30:53', '2005-08-22T10:34:39', '2005-08-26T13:09:39', '2'), + ('83', '1049', '2006-02-16T02:30:53', '2005-07-11T11:51:00', '2005-07-15T12:34:00', '2'), + ('517', '4377', '2006-02-16T02:30:53', '2005-07-07T20:13:58', '2005-07-11T18:11:58', '2'), + ('168', '59', '2006-02-16T02:30:53', '2005-08-17T04:28:56', '2005-08-24T00:42:56', '2'), + ('383', '3942', '2006-02-16T02:30:53', '2005-07-08T13:53:01', '2005-07-12T17:10:01', '2'), + ('167', '3191', '2006-02-16T02:30:53', '2005-07-10T13:49:30', '2005-07-11T12:11:30', '2'), + ('70', '2143', '2006-02-16T02:30:53', '2005-08-19T05:56:44', '2005-08-24T11:28:44', '2'), + ('93', '619', '2006-02-16T02:30:53', '2005-05-27T15:19:38', '2005-06-03T15:07:38', '2'), + ('23', '485', '2006-02-16T02:30:53', '2005-07-11T12:43:07', '2005-07-16T07:23:07', '2'), + ('174', '469', '2006-02-16T02:30:53', '2005-05-31T09:48:56', '2005-06-02T03:52:56', '2'), + ('288', '3262', '2006-02-16T02:30:53', '2005-07-31T08:56:08', '2005-08-07T11:05:08', '2'), + ('158', '4192', '2006-02-16T02:30:53', '2005-08-20T14:48:42', '2005-08-21T14:55:42', '2'), + ('444', '158', '2006-02-16T02:30:53', '2005-05-28T08:36:22', '2005-06-03T10:42:22', '2'), + ('507', '1456', '2006-02-16T02:30:53', '2005-07-29T05:15:42', '2005-08-01T03:36:42', '2'), + ('268', '1782', '2006-02-16T02:30:53', '2005-08-22T03:32:05', '2005-08-24T07:02:05', '2'), + ('227', '3807', '2006-02-16T02:30:53', '2005-07-29T05:38:43', '2005-08-01T07:31:43', '2'), + ('509', '4246', '2006-02-16T02:30:53', '2005-06-15T07:21:21', '2005-06-17T08:12:21', '2'), + ('300', '3262', '2006-02-16T02:30:53', '2005-06-15T15:17:21', '2005-06-20T17:07:21', '2'), + ('577', '3298', '2006-02-16T02:30:53', '2005-08-23T01:57:20', '2005-08-26T04:43:20', '2'), + ('29', '1862', '2006-02-16T02:30:53', '2005-08-21T03:01:45', '2005-08-22T07:19:45', '2'), + ('275', '4031', '2006-02-16T02:30:53', '2005-08-21T03:32:03', '2005-08-25T03:29:03', '2'), + ('101', '3730', '2006-02-16T02:30:53', '2005-07-09T00:02:46', '2005-07-14T18:05:46', '2'), + ('532', '2181', '2006-02-16T02:30:53', '2005-08-02T13:40:49', '2005-08-09T14:16:49', '2'), + ('269', '924', '2006-02-16T02:30:53', '2005-05-31T13:54:48', '2005-06-05T13:04:48', '2'), + ('404', '715', '2006-02-16T02:30:53', '2005-08-18T14:47:28', '2005-08-25T14:34:28', '2'), + ('249', '766', '2006-02-16T02:30:53', '2005-07-27T21:47:37', '2005-08-05T02:29:37', '2'), + ('6', '3693', '2006-02-16T02:30:53', '2005-07-07T14:53:24', '2005-07-13T14:21:24', '2'), + ('155', '1394', '2006-02-16T02:30:53', '2005-08-17T17:14:02', '2005-08-26T12:04:02', '2'), + ('115', '3751', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('202', '1929', '2006-02-16T02:30:53', '2005-08-20T20:59:15', '2005-08-28T17:29:15', '2'), + ('305', '1835', '2006-02-16T02:30:53', '2005-07-29T23:54:54', '2005-07-31T05:10:54', '2'), + ('527', '2454', '2006-02-16T02:30:53', '2005-08-01T10:23:43', '2005-08-05T07:11:43', '2'), + ('182', '3430', '2006-02-16T02:30:53', '2005-07-07T19:02:37', '2005-07-09T17:25:37', '2'), + ('167', '2080', '2006-02-16T02:30:53', '2005-08-18T18:19:16', '2005-08-20T17:30:16', '2'), + ('195', '1472', '2006-02-16T02:30:53', '2005-07-07T17:40:26', '2005-07-09T22:58:26', '2'), + ('573', '3680', '2006-02-16T02:30:53', '2005-07-29T06:23:56', '2005-07-31T02:41:56', '2'), + ('80', '2571', '2006-02-16T02:30:53', '2005-08-01T16:38:04', '2005-08-09T19:37:04', '2'), + ('226', '1488', '2006-02-16T02:30:53', '2005-07-29T13:01:19', '2005-07-31T15:40:19', '2'), + ('108', '276', '2006-02-16T02:30:53', '2005-06-20T18:04:55', '2005-06-21T12:12:55', '2'), + ('177', '2530', '2006-02-16T02:30:53', '2005-08-02T18:16:00', '2005-08-11T23:38:00', '2'), + ('512', '213', '2006-02-16T02:30:53', '2005-08-17T12:22:04', '2005-08-25T15:59:04', '2'), + ('124', '1197', '2006-02-16T02:30:53', '2005-05-29T13:23:26', '2005-05-30T07:53:26', '2'), + ('503', '197', '2006-02-16T02:30:53', '2005-07-26T23:45:33', '2005-07-31T04:40:33', '2'), + ('292', '1097', '2006-02-16T02:30:53', '2005-07-07T11:15:11', '2005-07-11T11:46:11', '2'), + ('118', '2913', '2006-02-16T02:30:53', '2005-07-28T09:31:13', '2005-08-02T14:06:13', '2'), + ('210', '1897', '2006-02-16T02:30:53', '2005-06-15T00:33:04', '2005-06-16T03:47:04', '2'), + ('436', '2042', '2006-02-16T02:30:53', '2005-07-30T18:13:51', '2005-08-07T13:45:51', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['2166', '3694', '9768', '11874', '581', '9364', '5067', '12864', '6267', '8585', '12832', '5260', '15713', '6409', '9235', '10025', '8519', '11318', '6908', '5630', '282', '405', '7396', '353', '8720', '14163', '5257', '4990', '6968', '8075', '12177', '8684', '5105', '13997', '3464', '15088', '4942', '14698', '15410', '13508', '4112', '6855', '11992', '4309', '14010', '2958', '11035', '3361', '4276', '4725', '77', '10943', '6552', '1393', '14610', '445', '1909', '1039', '4717', '15857', '7400', '2807', '12218', '838', '13766', '716', '7699', '1253', '7392', '7323', '14725', '4137', '7389', '2589', '3059', '2099', '12409', '1718', '10791', '11623', '12613', '13193', '5481', '263', '13075', '13864', '10039', '4548', '4658', '15849', '15233', '8245', '281', '11263', '12170', '3798', '15309', '3004', '2578', '4098']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('305', '4343', '2006-02-16T02:30:53', '2005-06-17T23:51:21', '2005-06-27T01:06:21', '2'), + ('419', '3848', '2006-02-16T02:30:53', '2005-07-06T10:01:23', '2005-07-08T11:44:23', '2'), + ('582', '2656', '2006-02-16T02:30:53', '2005-07-31T09:48:41', '2005-08-08T11:40:41', '2'), + ('467', '2637', '2006-02-16T02:30:53', '2005-08-17T14:16:40', '2005-08-18T15:51:40', '2'), + ('186', '1380', '2006-02-16T02:30:53', '2005-05-28T11:20:29', '2005-06-04T12:37:29', '2'), + ('87', '306', '2006-02-16T02:30:53', '2005-07-30T18:44:44', '2005-08-08T23:55:44', '2'), + ('225', '1480', '2006-02-16T02:30:53', '2005-07-09T04:52:35', '2005-07-11T23:33:35', '2'), + ('465', '4481', '2006-02-16T02:30:53', '2005-08-19T02:38:26', '2005-08-22T21:42:26', '2'), + ('20', '2152', '2006-02-16T02:30:53', '2005-07-11T15:53:00', '2005-07-17T18:09:00', '2'), + ('516', '512', '2006-02-16T02:30:53', '2005-07-29T12:14:18', '2005-08-03T08:31:18', '2'), + ('563', '2820', '2006-02-16T02:30:53', '2005-08-19T01:41:44', '2005-08-24T23:15:44', '2'), + ('75', '3143', '2006-02-16T02:30:53', '2005-07-09T14:05:45', '2005-07-14T08:41:45', '2'), + ('432', '337', '2006-02-16T02:30:53', '2005-08-23T10:56:15', '2005-08-29T09:14:15', '2'), + ('537', '3859', '2006-02-16T02:30:53', '2005-07-11T23:05:49', '2005-07-13T00:13:49', '2'), + ('181', '984', '2006-02-16T02:30:53', '2005-07-30T13:47:17', '2005-08-06T17:15:17', '2'), + ('565', '475', '2006-02-16T02:30:53', '2005-07-31T18:29:09', '2005-08-07T14:20:09', '2'), + ('588', '1163', '2006-02-16T02:30:53', '2005-07-29T10:09:43', '2005-08-03T08:14:43', '2'), + ('532', '2386', '2006-02-16T02:30:53', '2005-08-02T16:09:11', '2005-08-07T11:28:11', '2'), + ('529', '3161', '2006-02-16T02:30:53', '2005-07-12T22:08:46', '2005-07-21T00:21:46', '2'), + ('537', '1151', '2006-02-16T02:30:53', '2005-07-10T06:08:14', '2005-07-14T03:37:14', '2'), + ('282', '4486', '2006-02-16T02:30:53', '2005-05-26T18:56:26', '2005-06-01T16:32:26', '2'), + ('272', '4090', '2006-02-16T02:30:53', '2005-05-27T13:32:39', '2005-06-05T18:53:39', '2'), + ('595', '3346', '2006-02-16T02:30:53', '2005-07-27T16:03:53', '2005-08-05T10:36:53', '2'), + ('503', '3989', '2006-02-16T02:30:53', '2005-05-27T06:03:39', '2005-06-03T04:39:39', '2'), + ('180', '152', '2006-02-16T02:30:53', '2005-07-29T17:48:32', '2005-08-04T14:30:32', '2'), + ('204', '1007', '2006-02-16T02:30:53', '2005-08-21T02:56:52', '2005-08-21T21:03:52', '2'), + ('292', '286', '2006-02-16T02:30:53', '2005-07-09T13:56:43', '2005-07-10T14:26:43', '2'), + ('35', '3305', '2006-02-16T02:30:53', '2005-07-09T00:48:49', '2005-07-10T06:36:49', '2'), + ('370', '1662', '2006-02-16T02:30:53', '2005-07-27T00:16:45', '2005-07-30T23:16:45', '2'), + ('61', '2175', '2006-02-16T02:30:53', '2005-07-28T17:37:28', '2005-07-29T11:56:28', '2'), + ('470', '522', '2006-02-16T02:30:53', '2005-08-18T01:15:47', '2005-08-24T23:23:47', '2'), + ('185', '2457', '2006-02-16T02:30:53', '2005-07-29T16:16:33', '2005-08-07T12:27:33', '2'), + ('290', '2555', '2006-02-16T02:30:53', '2005-07-09T06:38:59', '2005-07-17T03:06:59', '2'), + ('175', '2330', '2006-02-16T02:30:53', '2005-08-20T19:51:28', '2005-08-26T01:29:28', '2'), + ('251', '2698', '2006-02-16T02:30:53', '2005-06-21T22:08:58', '2005-06-26T16:23:58', '2'), + ('377', '4199', '2006-02-16T02:30:53', '2005-08-22T11:28:26', '2005-08-24T15:46:26', '2'), + ('120', '4467', '2006-02-16T02:30:53', '2005-07-08T22:42:47', '2005-07-15T04:36:47', '2'), + ('196', '4255', '2006-02-16T02:30:53', '2005-08-21T20:49:58', '2005-08-29T20:13:58', '2'), + ('403', '2052', '2006-02-16T02:30:53', '2005-08-22T23:27:43', '2005-08-29T05:12:43', '2'), + ('408', '4120', '2006-02-16T02:30:53', '2005-08-20T02:12:54', '2005-08-28T21:47:54', '2'), + ('533', '3284', '2006-02-16T02:30:53', '2005-07-07T06:49:09', '2005-07-16T06:53:09', '2'), + ('24', '2657', '2006-02-16T02:30:53', '2005-07-12T19:46:29', '2005-07-15T16:56:29', '2'), + ('136', '4132', '2006-02-16T02:30:53', '2005-08-17T18:27:22', '2005-08-26T22:38:22', '2'), + ('209', '3549', '2006-02-16T02:30:53', '2005-07-07T17:29:41', '2005-07-14T22:22:41', '2'), + ('537', '934', '2006-02-16T02:30:53', '2005-08-20T20:29:46', '2005-08-26T17:37:46', '2'), + ('260', '1380', '2006-02-16T02:30:53', '2005-06-20T06:56:20', '2005-06-29T02:33:20', '2'), + ('305', '3776', '2006-02-16T02:30:53', '2005-08-02T05:55:39', '2005-08-08T06:46:39', '2'), + ('268', '2671', '2006-02-16T02:30:53', '2005-06-21T12:14:23', '2005-06-26T10:01:23', '2'), + ('366', '221', '2006-02-16T02:30:53', '2005-07-07T14:50:59', '2005-07-09T15:42:59', '2'), + ('3', '2058', '2006-02-16T02:30:53', '2005-07-08T12:47:11', '2005-07-15T09:08:11', '2'), + ('451', '1303', '2006-02-16T02:30:53', '2005-05-25T11:31:59', '2005-05-26T16:53:59', '2'), + ('377', '1036', '2006-02-16T02:30:53', '2005-08-02T03:17:29', '2005-08-03T00:50:29', '2'), + ('493', '766', '2006-02-16T02:30:53', '2005-07-12T05:05:06', '2005-07-13T05:12:06', '2'), + ('177', '2767', '2006-02-16T02:30:53', '2005-06-15T16:12:50', '2005-06-19T10:40:50', '2'), + ('260', '1894', '2006-02-16T02:30:53', '2005-08-21T17:59:09', '2005-08-29T21:36:09', '2'), + ('293', '1757', '2006-02-16T02:30:53', '2005-05-27T18:42:57', '2005-05-30T22:35:57', '2'), + ('269', '2599', '2006-02-16T02:30:53', '2005-06-17T05:11:04', '2005-06-19T04:33:04', '2'), + ('124', '2479', '2006-02-16T02:30:53', '2005-05-31T05:32:29', '2005-06-01T06:04:29', '2'), + ('453', '1491', '2006-02-16T02:30:53', '2005-07-08T12:22:43', '2005-07-11T10:24:43', '2'), + ('575', '2733', '2006-02-16T02:30:53', '2005-08-23T15:59:51', '2005-08-26T12:01:51', '2'), + ('133', '2874', '2006-02-16T02:30:53', '2005-07-27T16:16:37', '2005-07-31T12:34:37', '2'), + ('194', '2825', '2006-02-16T02:30:53', '2005-06-19T19:32:53', '2005-06-25T00:30:53', '2'), + ('70', '1933', '2006-02-16T02:30:53', '2005-08-18T02:48:14', '2005-08-21T01:52:14', '2'), + ('504', '2859', '2006-02-16T02:30:53', '2005-05-30T00:27:57', '2005-06-06T22:19:57', '2'), + ('189', '1313', '2006-02-16T02:30:53', '2005-08-20T11:42:01', '2005-08-27T13:44:01', '2'), + ('36', '85', '2006-02-16T02:30:53', '2005-05-29T04:35:29', '2005-06-01T07:42:29', '2'), + ('53', '4332', '2006-02-16T02:30:53', '2005-07-28T03:52:21', '2005-08-01T05:00:21', '2'), + ('498', '3242', '2006-02-16T02:30:53', '2005-06-15T06:06:33', '2005-06-21T04:13:33', '2'), + ('204', '3159', '2006-02-16T02:30:53', '2005-07-27T16:01:05', '2005-08-01T17:23:05', '2'), + ('125', '3830', '2006-02-16T02:30:53', '2005-07-27T13:39:40', '2005-07-29T08:45:40', '2'), + ('403', '4427', '2006-02-16T02:30:53', '2005-08-21T22:02:08', '2005-08-23T03:59:08', '2'), + ('485', '2065', '2006-02-16T02:30:53', '2005-07-07T08:17:06', '2005-07-11T10:52:06', '2'), + ('156', '3822', '2006-02-16T02:30:53', '2005-07-27T15:56:15', '2005-07-30T21:28:15', '2'), + ('164', '225', '2006-02-16T02:30:53', '2005-06-19T05:21:27', '2005-06-21T09:55:27', '2'), + ('266', '2911', '2006-02-16T02:30:53', '2005-06-20T13:38:41', '2005-06-21T10:13:41', '2'), + ('146', '3660', '2006-02-16T02:30:53', '2005-06-17T18:47:26', '2005-06-24T22:31:26', '2'), + ('64', '2568', '2006-02-16T02:30:53', '2005-08-18T09:43:58', '2005-08-19T15:02:58', '2'), + ('516', '288', '2006-02-16T02:30:53', '2005-06-16T14:52:02', '2005-06-25T10:53:02', '2'), + ('338', '2061', '2006-02-16T02:30:53', '2005-08-01T21:41:52', '2005-08-04T03:28:52', '2'), + ('163', '759', '2006-02-16T02:30:53', '2005-08-17T04:15:47', '2005-08-19T04:11:47', '2'), + ('8', '3877', '2006-02-16T02:30:53', '2005-08-18T17:16:01', '2005-08-23T18:40:01', '2'), + ('118', '523', '2006-02-16T02:30:53', '2005-08-19T14:33:45', '2005-08-28T08:46:45', '2'), + ('479', '562', '2006-02-16T02:30:53', '2005-07-09T23:51:57', '2005-07-11T05:28:57', '2'), + ('449', '1160', '2006-02-16T02:30:53', '2005-05-26T15:47:40', '2005-05-30T10:07:40', '2'), + ('224', '4125', '2006-02-16T02:30:53', '2005-08-19T10:10:10', '2005-08-21T08:44:10', '2'), + ('214', '3935', '2006-02-16T02:30:53', '2005-08-20T14:59:55', '2005-08-22T09:30:55', '2'), + ('111', '4391', '2006-02-16T02:30:53', '2005-07-31T18:50:40', '2005-08-01T18:49:40', '2'), + ('164', '765', '2006-02-16T02:30:53', '2005-07-08T04:21:54', '2005-07-14T23:16:54', '2'), + ('166', '3131', '2006-02-16T02:30:53', '2005-07-08T09:51:11', '2005-07-10T12:30:11', '2'), + ('482', '4077', '2006-02-16T02:30:53', '2005-08-23T15:41:20', '2005-08-27T15:47:20', '2'), + ('197', '4405', '2006-02-16T02:30:53', '2005-08-22T17:41:53', '2005-08-24T12:59:53', '2'), + ('555', '3330', '2006-02-16T02:30:53', '2005-07-29T00:37:09', '2005-08-05T05:48:09', '2'), + ('582', '1208', '2006-02-16T02:30:53', '2005-05-26T18:49:35', '2005-05-27T18:11:35', '2'), + ('421', '1189', '2006-02-16T02:30:53', '2005-08-02T14:02:19', '2005-08-07T14:03:19', '2'), + ('289', '1125', '2006-02-16T02:30:53', '2005-08-18T01:06:10', '2005-08-25T02:40:10', '2'), + ('479', '1942', '2006-02-16T02:30:53', '2005-07-06T14:57:53', '2005-07-07T10:48:53', '2'), + ('141', '2743', '2006-02-16T02:30:53', '2005-08-22T19:54:52', '2005-08-24T23:00:52', '2'), + ('113', '2836', '2006-02-16T02:30:53', '2005-06-20T10:04:36', '2005-06-23T07:38:36', '2'), + ('267', '1695', '2006-02-16T02:30:53', '2005-06-19T04:40:06', '2005-06-26T09:37:06', '2'), + ('35', '2865', '2006-02-16T02:30:53', '2005-07-07T06:14:51', '2005-07-14T06:51:51', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['15948', '9703', '9263', '14711', '9407', '4875', '11733', '8682', '15901', '7826', '6561', '3815', '8596', '11839', '5361', '9683', '4718', '7946', '6864', '9843', '3504', '1921', '12105', '13723', '3339', '536', '8265', '477', '7090', '393', '3019', '6338', '366', '15418', '7811', '4319', '12125', '8006', '8492', '4041', '2282', '11413', '1088', '1080', '15570', '5767', '1804', '3827', '6201', '9147', '10206', '10611', '6328', '2274', '320', '11813', '3077', '2980', '15454', '10901', '11113', '4843', '12017', '3219', '9924', '8646', '15974', '8517', '12889', '6982', '2695', '13993', '6398', '7482', '233', '15167', '4030', '15052', '4300', '9225', '13123', '12678', '15559', '3640', '2337', '8100', '7138', '13272', '5866', '6368', '12443', '4468', '11092', '2814', '8853', '14779', '5460', '1175', '2664', '15612']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('520', '432', '2006-02-16T02:30:53', '2005-08-23T18:59:33', '2005-08-31T13:02:33', '2'), + ('57', '2708', '2006-02-16T02:30:53', '2005-07-31T07:34:52', '2005-08-03T13:33:52', '2'), + ('410', '73', '2006-02-16T02:30:53', '2005-07-30T14:48:24', '2005-08-04T19:06:24', '2'), + ('448', '1973', '2006-02-16T02:30:53', '2005-08-21T21:22:07', '2005-08-30T16:24:07', '2'), + ('585', '2594', '2006-02-16T02:30:53', '2005-07-30T20:25:24', '2005-08-08T22:51:24', '2'), + ('555', '843', '2006-02-16T02:30:53', '2005-07-08T19:24:17', '2005-07-11T19:15:17', '2'), + ('251', '439', '2006-02-16T02:30:53', '2005-08-17T08:31:03', '2005-08-21T05:44:03', '2'), + ('348', '4328', '2006-02-16T02:30:53', '2005-07-29T16:15:26', '2005-08-03T20:15:26', '2'), + ('226', '2761', '2006-02-16T02:30:53', '2005-08-23T17:19:17', '2005-08-30T14:24:17', '2'), + ('214', '1473', '2006-02-16T02:30:53', '2005-07-28T08:35:51', '2005-08-05T07:57:51', '2'), + ('528', '4568', '2006-02-16T02:30:53', '2005-07-12T05:24:02', '2005-07-16T03:43:02', '2'), + ('472', '4038', '2006-02-16T02:30:53', '2005-07-06T15:26:36', '2005-07-11T17:07:36', '2'), + ('233', '59', '2006-02-16T02:30:53', '2005-07-29T12:48:54', '2005-08-04T07:19:54', '2'), + ('80', '2282', '2006-02-16T02:30:53', '2005-08-17T13:08:45', '2005-08-18T15:05:45', '2'), + ('279', '2045', '2006-02-16T02:30:53', '2005-07-09T18:15:32', '2005-07-17T23:32:32', '2'), + ('141', '856', '2006-02-16T02:30:53', '2005-07-31T06:47:13', '2005-08-04T05:52:13', '2'), + ('535', '1653', '2006-02-16T02:30:53', '2005-07-08T12:32:08', '2005-07-17T17:34:08', '2'), + ('90', '99', '2006-02-16T02:30:53', '2005-07-28T13:01:22', '2005-08-03T15:27:22', '2'), + ('38', '2252', '2006-02-16T02:30:53', '2005-07-12T19:59:25', '2005-07-19T15:52:25', '2'), + ('532', '2923', '2006-02-16T02:30:53', '2005-07-31T12:25:28', '2005-08-01T09:51:28', '2'), + ('209', '268', '2006-02-16T02:30:53', '2005-07-06T00:18:29', '2005-07-10T00:24:29', '2'), + ('417', '4369', '2006-02-16T02:30:53', '2005-06-17T06:04:16', '2005-06-23T05:26:16', '2'), + ('390', '2848', '2006-02-16T02:30:53', '2005-08-17T22:54:45', '2005-08-21T00:33:45', '2'), + ('110', '411', '2006-02-16T02:30:53', '2005-08-20T10:05:30', '2005-08-27T07:43:30', '2'), + ('526', '312', '2006-02-16T02:30:53', '2005-06-21T10:37:11', '2005-06-30T05:04:11', '2'), + ('514', '2962', '2006-02-16T02:30:53', '2005-05-28T06:17:33', '2005-06-03T10:02:33', '2'), + ('409', '2389', '2006-02-16T02:30:53', '2005-07-29T01:20:15', '2005-08-06T19:32:15', '2'), + ('161', '2437', '2006-02-16T02:30:53', '2005-05-27T22:33:33', '2005-06-02T18:35:33', '2'), + ('218', '3495', '2006-02-16T02:30:53', '2005-07-27T04:43:53', '2005-07-29T07:33:53', '2'), + ('251', '145', '2006-02-16T02:30:53', '2005-05-27T11:18:25', '2005-05-28T07:10:25', '2'), + ('144', '491', '2006-02-16T02:30:53', '2005-06-20T11:11:52', '2005-06-27T08:30:52', '2'), + ('54', '1691', '2006-02-16T02:30:53', '2005-07-11T19:39:41', '2005-07-18T01:13:41', '2'), + ('134', '360', '2006-02-16T02:30:53', '2005-05-27T07:33:54', '2005-06-04T01:55:54', '2'), + ('205', '808', '2006-02-16T02:30:53', '2005-08-22T23:54:14', '2005-08-28T04:23:14', '2'), + ('347', '3891', '2006-02-16T02:30:53', '2005-07-28T08:06:01', '2005-07-30T10:08:01', '2'), + ('25', '3389', '2006-02-16T02:30:53', '2005-07-07T17:50:27', '2005-07-10T13:53:27', '2'), + ('573', '136', '2006-02-16T02:30:53', '2005-08-17T23:24:25', '2005-08-25T03:08:25', '2'), + ('109', '3959', '2006-02-16T02:30:53', '2005-07-28T15:15:41', '2005-08-05T19:29:41', '2'), + ('266', '4553', '2006-02-16T02:30:53', '2005-07-29T09:04:17', '2005-08-02T08:48:17', '2'), + ('445', '2217', '2006-02-16T02:30:53', '2005-07-07T03:03:33', '2005-07-09T07:57:33', '2'), + ('113', '4388', '2006-02-16T02:30:53', '2005-06-18T06:48:23', '2005-06-24T11:04:23', '2'), + ('297', '1115', '2006-02-16T02:30:53', '2005-08-02T19:35:19', '2005-08-05T21:33:19', '2'), + ('356', '3988', '2006-02-16T02:30:53', '2005-05-31T11:35:13', '2005-06-06T16:01:13', '2'), + ('215', '3491', '2006-02-16T02:30:53', '2005-05-31T10:55:26', '2005-06-03T13:13:26', '2'), + ('557', '4014', '2006-02-16T02:30:53', '2005-08-23T05:24:55', '2005-08-31T07:06:55', '2'), + ('32', '2871', '2006-02-16T02:30:53', '2005-07-10T13:13:18', '2005-07-17T14:41:18', '2'), + ('570', '1152', '2006-02-16T02:30:53', '2005-06-16T20:33:15', '2005-06-18T02:31:15', '2'), + ('41', '2072', '2006-02-16T02:30:53', '2005-07-06T15:52:03', '2005-07-08T21:43:03', '2'), + ('559', '4530', '2006-02-16T02:30:53', '2005-07-11T12:18:07', '2005-07-12T12:11:07', '2'), + ('394', '4167', '2006-02-16T02:30:53', '2005-07-30T10:38:59', '2005-08-02T11:45:59', '2'), + ('90', '4479', '2006-02-16T02:30:53', '2005-08-01T00:52:40', '2005-08-10T02:36:40', '2'), + ('135', '957', '2006-02-16T02:30:53', '2005-08-01T14:53:52', '2005-08-07T09:15:52', '2'), + ('260', '999', '2006-02-16T02:30:53', '2005-07-11T19:09:33', '2005-07-12T20:16:33', '2'), + ('347', '3021', '2006-02-16T02:30:53', '2005-06-18T06:31:15', '2005-06-21T01:24:15', '2'), + ('2', '1090', '2006-02-16T02:30:53', '2005-05-27T00:09:24', '2005-05-28T04:30:24', '2'), + ('36', '1074', '2006-02-16T02:30:53', '2005-08-17T12:06:54', '2005-08-21T17:52:54', '2'), + ('303', '1675', '2006-02-16T02:30:53', '2005-06-20T15:05:18', '2005-06-26T20:52:18', '2'), + ('343', '310', '2006-02-16T02:30:53', '2005-06-20T08:35:03', '2005-06-29T07:57:03', '2'), + ('142', '2946', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('290', '3813', '2006-02-16T02:30:53', '2005-08-02T01:35:44', '2005-08-04T21:20:44', '2'), + ('231', '1654', '2006-02-16T02:30:53', '2005-08-02T08:26:24', '2005-08-07T09:24:24', '2'), + ('45', '3640', '2006-02-16T02:30:53', '2005-07-08T18:27:28', '2005-07-15T00:26:28', '2'), + ('573', '344', '2006-02-16T02:30:53', '2005-08-17T19:33:49', '2005-08-22T01:16:49', '2'), + ('129', '3024', '2006-02-16T02:30:53', '2005-06-21T01:43:26', '2005-06-28T23:50:26', '2'), + ('64', '1986', '2006-02-16T02:30:53', '2005-07-31T15:04:57', '2005-08-05T20:07:57', '2'), + ('302', '89', '2006-02-16T02:30:53', '2005-07-29T14:48:48', '2005-08-03T18:11:48', '2'), + ('201', '3518', '2006-02-16T02:30:53', '2005-08-23T20:06:04', '2005-08-27T17:33:04', '2'), + ('274', '2064', '2006-02-16T02:30:53', '2005-07-29T10:00:48', '2005-08-06T14:37:48', '2'), + ('515', '4376', '2006-02-16T02:30:53', '2005-08-19T03:41:31', '2005-08-27T00:46:31', '2'), + ('284', '3843', '2006-02-16T02:30:53', '2005-07-27T00:53:41', '2005-07-31T06:19:41', '2'), + ('208', '190', '2006-02-16T02:30:53', '2005-06-19T13:25:53', '2005-06-24T17:12:53', '2'), + ('93', '1158', '2006-02-16T02:30:53', '2005-08-20T19:32:29', '2005-08-26T16:59:29', '2'), + ('296', '1409', '2006-02-16T02:30:53', '2005-07-11T22:34:49', '2005-07-17T17:58:49', '2'), + ('348', '485', '2006-02-16T02:30:53', '2005-07-27T19:24:16', '2005-08-05T18:49:16', '2'), + ('531', '715', '2006-02-16T02:30:53', '2005-05-26T11:43:44', '2005-05-28T17:28:44', '2'), + ('190', '973', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('300', '1734', '2006-02-16T02:30:53', '2005-07-07T02:25:42', '2005-07-08T22:53:42', '2'), + ('147', '2349', '2006-02-16T02:30:53', '2005-08-22T10:09:19', '2005-08-31T09:27:19', '2'), + ('38', '1189', '2006-02-16T02:30:53', '2005-07-07T16:36:16', '2005-07-10T13:59:16', '2'), + ('391', '1992', '2006-02-16T02:30:53', '2005-07-30T13:29:47', '2005-08-02T17:08:47', '2'), + ('220', '2804', '2006-02-16T02:30:53', '2005-08-19T11:55:13', '2005-08-21T05:55:13', '2'), + ('181', '2504', '2006-02-16T02:30:53', '2005-08-18T19:41:27', '2005-08-23T15:14:27', '2'), + ('517', '1773', '2006-02-16T02:30:53', '2005-08-23T04:55:05', '2005-08-30T09:01:05', '2'), + ('271', '3432', '2006-02-16T02:30:53', '2005-07-06T07:12:26', '2005-07-10T04:54:26', '2'), + ('582', '4522', '2006-02-16T02:30:53', '2005-06-18T11:15:27', '2005-06-26T06:59:27', '2'), + ('11', '2859', '2006-02-16T02:30:53', '2005-07-28T18:43:11', '2005-08-02T15:56:11', '2'), + ('31', '1418', '2006-02-16T02:30:53', '2005-07-27T06:47:13', '2005-08-03T01:12:13', '2'), + ('145', '2531', '2006-02-16T02:30:53', '2005-08-19T17:49:13', '2005-08-23T15:49:13', '2'), + ('484', '457', '2006-02-16T02:30:53', '2005-07-10T18:35:14', '2005-07-19T19:41:14', '2'), + ('588', '3666', '2006-02-16T02:30:53', '2005-07-11T21:19:01', '2005-07-13T17:56:01', '2'), + ('233', '2048', '2006-02-16T02:30:53', '2005-08-18T10:50:59', '2005-08-26T07:48:59', '2'), + ('170', '3302', '2006-02-16T02:30:53', '2005-07-08T00:17:59', '2005-07-12T05:51:59', '2'), + ('60', '569', '2006-02-16T02:30:53', '2005-08-02T07:58:50', '2005-08-04T03:23:50', '2'), + ('10', '1783', '2006-02-16T02:30:53', '2005-06-19T20:01:59', '2005-06-26T01:28:59', '2'), + ('58', '2323', '2006-02-16T02:30:53', '2005-07-29T23:34:21', '2005-07-31T21:20:21', '2'), + ('279', '1087', '2006-02-16T02:30:53', '2005-08-22T00:00:56', '2005-08-31T00:01:56', '2'), + ('38', '2410', '2006-02-16T02:30:53', '2005-07-09T22:46:14', '2005-07-12T21:26:14', '2'), + ('197', '3255', '2006-02-16T02:30:53', '2005-06-15T00:15:15', '2005-06-20T19:23:15', '2'), + ('299', '3496', '2006-02-16T02:30:53', '2005-06-19T11:11:23', '2005-06-28T08:30:23', '2'), + ('305', '3367', '2006-02-16T02:30:53', '2005-08-23T06:59:07', '2005-09-01T11:26:07', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['12717', '6199', '8145', '4627', '3131', '69', '15571', '8603', '5132', '13242', '12608', '1403', '2490', '5538', '8788', '1307', '3424', '4996', '8178', '10976', '14607', '13948', '293', '5285', '2326', '14418', '8219', '3856', '5890', '14064', '12937', '14316', '10720', '5291', '1844', '12421', '2699', '4676', '1654', '4119', '14594', '2818', '7554', '5494', '14563', '14042', '15265', '1261', '6617', '13680', '138', '13968', '14250', '7579', '14991', '11480', '5003', '9880', '6434', '3960', '12444', '2208', '9776', '3480', '2572', '9280', '14475', '2645', '5777', '2668', '3871', '14357', '6257', '8552', '10669', '2623', '12278', '8898', '2766', '2516', '2546', '8759', '10367', '6210', '8082', '4459', '13250', '1724', '3021', '12795', '12540', '740', '10643', '4792', '7867', '15086', '12945', '2112', '16043', '15040']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('167', '3551', '2006-02-16T02:30:53', '2005-08-18T21:15:40', '2005-08-20T00:59:40', '2'), + ('80', '4329', '2006-02-16T02:30:53', '2005-07-11T12:16:03', '2005-07-18T15:33:03', '2'), + ('198', '937', '2006-02-16T02:30:53', '2005-07-28T20:34:41', '2005-08-05T15:28:41', '2'), + ('78', '2383', '2006-02-16T02:30:53', '2005-07-08T08:24:39', '2005-07-13T11:04:39', '2'), + ('146', '3678', '2006-02-16T02:30:53', '2005-06-20T19:08:00', '2005-06-24T20:59:00', '2'), + ('305', '3207', '2006-02-16T02:30:53', '2005-05-25T10:10:14', '2005-05-27T14:02:14', '2'), + ('57', '716', '2006-02-16T02:30:53', '2005-08-23T05:26:30', '2005-08-29T00:54:30', '2'), + ('594', '3007', '2006-02-16T02:30:53', '2005-07-29T13:07:07', '2005-08-04T18:32:07', '2'), + ('101', '4158', '2006-02-16T02:30:53', '2005-07-09T07:40:32', '2005-07-16T02:16:32', '2'), + ('414', '230', '2006-02-16T02:30:53', '2005-08-19T16:28:47', '2005-08-24T22:13:47', '2'), + ('366', '624', '2006-02-16T02:30:53', '2005-08-18T17:05:15', '2005-08-23T17:00:15', '2'), + ('546', '3380', '2006-02-16T02:30:53', '2005-06-15T16:31:59', '2005-06-22T14:23:59', '2'), + ('402', '1934', '2006-02-16T02:30:53', '2005-06-18T22:00:50', '2005-06-19T23:45:50', '2'), + ('367', '2119', '2006-02-16T02:30:53', '2005-07-10T02:39:40', '2005-07-12T01:39:40', '2'), + ('121', '3412', '2006-02-16T02:30:53', '2005-07-29T20:46:44', '2005-08-03T02:25:44', '2'), + ('507', '368', '2006-02-16T02:30:53', '2005-06-15T10:06:15', '2005-06-20T04:50:15', '2'), + ('583', '1279', '2006-02-16T02:30:53', '2005-06-21T17:42:51', '2005-06-24T23:22:51', '2'), + ('129', '4440', '2006-02-16T02:30:53', '2005-07-09T00:59:46', '2005-07-16T01:30:46', '2'), + ('503', '2825', '2006-02-16T02:30:53', '2005-07-28T21:54:31', '2005-08-02T23:56:31', '2'), + ('326', '2418', '2006-02-16T02:30:53', '2005-08-02T04:11:48', '2005-08-06T06:30:48', '2'), + ('417', '4518', '2006-02-16T02:30:53', '2005-08-21T17:56:50', '2005-08-22T17:44:50', '2'), + ('410', '4033', '2006-02-16T02:30:53', '2005-08-20T17:50:48', '2005-08-25T20:56:48', '2'), + ('158', '1828', '2006-02-16T02:30:53', '2005-05-26T20:27:02', '2005-06-03T16:45:02', '2'), + ('468', '676', '2006-02-16T02:30:53', '2005-07-09T15:10:44', '2005-07-16T13:02:44', '2'), + ('174', '3829', '2006-02-16T02:30:53', '2005-06-18T10:14:22', '2005-06-24T07:01:22', '2'), + ('442', '89', '2006-02-16T02:30:53', '2005-08-21T11:14:26', '2005-08-28T08:34:26', '2'), + ('227', '3609', '2006-02-16T02:30:53', '2005-07-28T23:46:31', '2005-08-03T00:11:31', '2'), + ('498', '3083', '2006-02-16T02:30:53', '2005-07-06T17:04:46', '2005-07-14T19:23:46', '2'), + ('535', '1463', '2006-02-16T02:30:53', '2005-07-10T20:00:25', '2005-07-18T17:57:25', '2'), + ('103', '2938', '2006-02-16T02:30:53', '2005-08-20T22:39:16', '2005-08-22T00:45:16', '2'), + ('348', '3826', '2006-02-16T02:30:53', '2005-08-19T05:25:30', '2005-08-22T10:40:30', '2'), + ('64', '386', '2006-02-16T02:30:53', '2005-08-21T07:59:47', '2005-08-23T02:20:47', '2'), + ('326', '3712', '2006-02-16T02:30:53', '2005-08-01T19:04:33', '2005-08-06T23:12:33', '2'), + ('194', '1367', '2006-02-16T02:30:53', '2005-07-09T15:15:02', '2005-07-15T10:22:02', '2'), + ('454', '2307', '2006-02-16T02:30:53', '2005-06-16T23:53:53', '2005-06-22T02:19:53', '2'), + ('158', '4067', '2006-02-16T02:30:53', '2005-08-18T10:04:06', '2005-08-24T08:45:06', '2'), + ('267', '72', '2006-02-16T02:30:53', '2005-06-19T13:29:28', '2005-06-24T11:15:28', '2'), + ('302', '2590', '2006-02-16T02:30:53', '2005-07-08T10:26:02', '2005-07-10T13:38:02', '2'), + ('348', '1039', '2006-02-16T02:30:53', '2005-06-16T09:42:48', '2005-06-20T14:28:48', '2'), + ('319', '2078', '2006-02-16T02:30:53', '2005-07-07T07:06:03', '2005-07-13T01:56:03', '2'), + ('62', '2978', '2006-02-16T02:30:53', '2005-08-21T17:34:24', '2005-08-26T22:04:24', '2'), + ('497', '2376', '2006-02-16T02:30:53', '2005-06-19T20:05:52', '2005-06-22T01:01:52', '2'), + ('135', '1805', '2006-02-16T02:30:53', '2005-07-27T22:12:41', '2005-08-04T01:34:41', '2'), + ('139', '3087', '2006-02-16T02:30:53', '2005-07-10T00:15:00', '2005-07-17T01:12:00', '2'), + ('212', '3984', '2006-02-16T02:30:53', '2005-08-21T16:23:53', '2005-08-25T11:30:53', '2'), + ('322', '505', '2006-02-16T02:30:53', '2005-08-20T21:45:51', '2005-08-23T19:57:51', '2'), + ('512', '1763', '2006-02-16T02:30:53', '2005-08-22T18:35:59', '2005-08-28T21:18:59', '2'), + ('95', '2447', '2006-02-16T02:30:53', '2005-06-15T06:52:57', '2005-06-21T01:47:57', '2'), + ('248', '2292', '2006-02-16T02:30:53', '2005-07-12T08:39:56', '2005-07-14T09:32:56', '2'), + ('70', '2822', '2006-02-16T02:30:53', '2005-08-20T08:44:06', '2005-08-27T09:58:06', '2'), + ('586', '4134', '2006-02-16T02:30:53', '2005-05-25T22:48:22', '2005-05-29T20:21:22', '2'), + ('15', '3715', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('313', '3008', '2006-02-16T02:30:53', '2005-08-21T05:39:35', '2005-08-28T10:06:35', '2'), + ('352', '501', '2006-02-16T02:30:53', '2005-07-27T23:06:41', '2005-07-31T20:08:41', '2'), + ('172', '708', '2006-02-16T02:30:53', '2005-08-22T07:50:44', '2005-08-30T06:32:44', '2'), + ('14', '4161', '2006-02-16T02:30:53', '2005-08-02T22:18:24', '2005-08-04T21:22:24', '2'), + ('569', '3438', '2006-02-16T02:30:53', '2005-07-09T01:19:03', '2005-07-10T04:28:03', '2'), + ('64', '3590', '2006-02-16T02:30:53', '2005-07-31T13:49:02', '2005-08-08T10:31:02', '2'), + ('102', '1478', '2006-02-16T02:30:53', '2005-07-12T00:14:25', '2005-07-20T19:54:25', '2'), + ('594', '2090', '2006-02-16T02:30:53', '2005-07-06T22:08:53', '2005-07-07T23:21:53', '2'), + ('285', '1639', '2006-02-16T02:30:53', '2005-08-18T10:53:12', '2005-08-19T13:54:12', '2'), + ('132', '2345', '2006-02-16T02:30:53', '2005-06-18T02:22:07', '2005-06-23T07:24:07', '2'), + ('73', '2524', '2006-02-16T02:30:53', '2005-07-31T10:01:03', '2005-08-03T07:20:03', '2'), + ('382', '1488', '2006-02-16T02:30:53', '2005-07-05T23:11:43', '2005-07-12T02:01:43', '2'), + ('159', '2449', '2006-02-16T02:30:53', '2005-06-19T04:21:26', '2005-06-23T09:22:26', '2'), + ('286', '4103', '2006-02-16T02:30:53', '2005-07-30T15:15:38', '2005-08-05T19:20:38', '2'), + ('2', '3164', '2006-02-16T02:30:53', '2005-08-21T13:24:32', '2005-08-27T08:59:32', '2'), + ('181', '2284', '2006-02-16T02:30:53', '2005-06-19T09:50:35', '2005-06-28T06:47:35', '2'), + ('40', '3959', '2006-02-16T02:30:53', '2005-07-10T13:38:41', '2005-07-17T15:48:41', '2'), + ('568', '3127', '2006-02-16T02:30:53', '2005-06-19T11:28:47', '2005-06-24T10:12:47', '2'), + ('331', '3114', '2006-02-16T02:30:53', '2005-07-06T17:58:51', '2005-07-15T22:18:51', '2'), + ('233', '2906', '2006-02-16T02:30:53', '2005-08-21T09:13:09', '2005-08-22T05:41:09', '2'), + ('492', '3253', '2006-02-16T02:30:53', '2005-07-11T15:23:46', '2005-07-14T17:26:46', '2'), + ('490', '1987', '2006-02-16T02:30:53', '2005-07-29T11:14:02', '2005-08-05T14:13:02', '2'), + ('559', '2121', '2006-02-16T02:30:53', '2005-08-01T17:03:28', '2005-08-08T21:34:28', '2'), + ('12', '4477', '2006-02-16T02:30:53', '2005-06-19T08:11:51', '2005-06-26T12:28:51', '2'), + ('294', '3205', '2006-02-16T02:30:53', '2005-08-18T04:46:45', '2005-08-24T08:59:45', '2'), + ('452', '3961', '2006-02-16T02:30:53', '2005-07-30T01:02:20', '2005-08-05T22:02:20', '2'), + ('345', '3421', '2006-02-16T02:30:53', '2005-06-19T17:45:15', '2005-06-23T20:11:15', '2'), + ('87', '2678', '2006-02-16T02:30:53', '2005-06-19T00:03:28', '2005-06-21T00:30:28', '2'), + ('272', '971', '2006-02-16T02:30:53', '2005-06-19T02:39:39', '2005-06-23T03:56:39', '2'), + ('209', '844', '2006-02-16T02:30:53', '2005-07-29T19:22:37', '2005-08-07T15:36:37', '2'), + ('242', '3408', '2006-02-16T02:30:53', '2005-08-01T06:12:19', '2005-08-04T12:11:19', '2'), + ('209', '931', '2006-02-16T02:30:53', '2005-07-11T12:36:43', '2005-07-17T17:45:43', '2'), + ('423', '3089', '2006-02-16T02:30:53', '2005-07-28T18:08:02', '2005-08-04T14:33:02', '2'), + ('227', '3987', '2006-02-16T02:30:53', '2005-07-07T23:48:52', '2005-07-13T19:37:52', '2'), + ('448', '2524', '2006-02-16T02:30:53', '2005-08-19T16:47:55', '2005-08-26T16:54:55', '2'), + ('146', '61', '2006-02-16T02:30:53', '2005-06-16T15:15:43', '2005-06-23T10:14:43', '2'), + ('62', '120', '2006-02-16T02:30:53', '2005-06-20T11:13:01', '2005-06-28T16:15:01', '2'), + ('360', '2745', '2006-02-16T02:30:53', '2005-08-19T00:21:52', '2005-08-22T22:13:52', '2'), + ('304', '2826', '2006-02-16T02:30:53', '2005-08-18T14:17:30', '2005-08-26T15:33:30', '2'), + ('89', '600', '2006-02-16T02:30:53', '2005-05-29T08:30:36', '2005-06-04T12:47:36', '2'), + ('495', '3853', '2006-02-16T02:30:53', '2005-08-01T15:48:33', '2005-08-06T20:24:33', '2'), + ('147', '2132', '2006-02-16T02:30:53', '2005-07-08T16:29:38', '2005-07-10T16:31:38', '2'), + ('297', '713', '2006-02-16T02:30:53', '2005-07-28T10:08:54', '2005-07-30T10:26:54', '2'), + ('494', '264', '2006-02-16T02:30:53', '2005-08-22T11:21:08', '2005-08-30T08:18:08', '2'), + ('312', '3638', '2006-02-16T02:30:53', '2005-08-19T05:51:46', '2005-08-23T11:22:46', '2'), + ('18', '1629', '2006-02-16T02:30:53', '2005-06-17T19:52:42', '2005-06-25T00:00:42', '2'), + ('526', '3869', '2006-02-16T02:30:53', '2005-08-23T22:21:03', '2005-08-31T03:09:03', '2'), + ('523', '3207', '2006-02-16T02:30:53', '2005-08-22T09:41:09', '2005-08-23T12:49:09', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['14138', '6387', '12877', '15356', '10355', '6748', '14454', '6626', '12310', '1593', '4214', '1510', '12468', '6022', '12140', '6470', '13971', '201', '7681', '261', '937', '6859', '6308', '14347', '12739', '6764', '8879', '7035', '12514', '13461', '8550', '2518', '896', '144', '5971', '3061', '8315', '10386', '9259', '13525', '7372', '7736', '12974', '598', '995', '5313', '2234', '5982', '12943', '13501', '14028', '6960', '12568', '7390', '4948', '10571', '14325', '8660', '12673', '13812', '11750', '7405', '13941', '5510', '3395', '7103', '5860', '1827', '13850', '13923', '6682', '14937', '10774', '10703', '1680', '7896', '3051', '9824', '1744', '13119', '11999', '3091', '10563', '8769', '39', '5732', '10403', '2009', '6265', '1818', '11123', '11285', '2879', '7642', '576', '12616', '11649', '1015', '1424', '6999']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('121', '1238', '2006-02-16T02:30:53', '2005-08-21T01:59:37', '2005-08-30T01:17:37', '2'), + ('384', '1726', '2006-02-16T02:30:53', '2005-07-11T22:15:56', '2005-07-14T20:20:56', '2'), + ('40', '1016', '2006-02-16T02:30:53', '2005-08-19T03:16:58', '2005-08-25T02:10:58', '2'), + ('539', '4507', '2006-02-16T02:30:53', '2005-08-22T21:24:19', '2005-08-25T22:32:19', '2'), + ('161', '2158', '2006-02-16T02:30:53', '2005-08-01T05:47:37', '2005-08-02T09:28:37', '2'), + ('540', '3655', '2006-02-16T02:30:53', '2005-07-12T14:39:27', '2005-07-18T13:40:27', '2'), + ('150', '2475', '2006-02-16T02:30:53', '2005-08-21T12:35:49', '2005-08-22T16:28:49', '2'), + ('269', '2418', '2006-02-16T02:30:53', '2005-07-12T09:16:24', '2005-07-17T04:06:24', '2'), + ('385', '3814', '2006-02-16T02:30:53', '2005-08-18T06:02:34', '2005-08-24T01:08:34', '2'), + ('111', '766', '2006-02-16T02:30:53', '2005-06-16T05:14:52', '2005-06-24T08:00:52', '2'), + ('484', '2534', '2006-02-16T02:30:53', '2005-07-07T11:54:33', '2005-07-08T10:49:33', '2'), + ('338', '989', '2006-02-16T02:30:53', '2005-06-15T22:39:34', '2005-06-24T19:21:34', '2'), + ('80', '1689', '2006-02-16T02:30:53', '2005-08-18T11:41:47', '2005-08-24T16:43:47', '2'), + ('469', '2435', '2006-02-16T02:30:53', '2005-07-11T02:15:53', '2005-07-13T03:40:53', '2'), + ('408', '322', '2006-02-16T02:30:53', '2005-08-17T23:57:55', '2005-08-21T20:09:55', '2'), + ('240', '1680', '2006-02-16T02:30:53', '2005-07-12T01:29:41', '2005-07-15T21:33:41', '2'), + ('64', '1678', '2006-02-16T02:30:53', '2005-08-20T18:44:53', '2005-08-22T16:25:53', '2'), + ('444', '776', '2006-02-16T02:30:53', '2005-05-26T07:13:45', '2005-06-04T02:02:45', '2'), + ('432', '1176', '2006-02-16T02:30:53', '2005-07-28T03:07:09', '2005-07-29T08:30:09', '2'), + ('414', '1369', '2006-02-16T02:30:53', '2005-05-26T15:44:23', '2005-06-02T09:47:23', '2'), + ('304', '1054', '2006-02-16T02:30:53', '2005-05-30T14:47:31', '2005-06-05T09:53:31', '2'), + ('321', '4108', '2006-02-16T02:30:53', '2005-07-12T19:53:57', '2005-07-17T19:48:57', '2'), + ('472', '3155', '2006-02-16T02:30:53', '2005-07-11T18:08:41', '2005-07-19T15:48:41', '2'), + ('214', '3862', '2006-02-16T02:30:53', '2005-08-21T08:42:31', '2005-08-25T07:11:31', '2'), + ('292', '4129', '2006-02-16T02:30:53', '2005-08-18T22:15:18', '2005-08-27T00:37:18', '2'), + ('396', '4407', '2006-02-16T02:30:53', '2005-07-12T15:29:27', '2005-07-21T20:00:27', '2'), + ('584', '2956', '2006-02-16T02:30:53', '2005-07-30T00:16:02', '2005-08-06T20:10:02', '2'), + ('90', '2439', '2006-02-16T02:30:53', '2005-07-27T03:06:09', '2005-08-02T21:59:09', '2'), + ('400', '3310', '2006-02-16T02:30:53', '2005-08-18T13:33:55', '2005-08-23T12:50:55', '2'), + ('421', '2621', '2006-02-16T02:30:53', '2005-08-20T00:49:04', '2005-08-28T02:49:04', '2'), + ('70', '1340', '2006-02-16T02:30:53', '2005-07-29T11:12:37', '2005-07-30T15:05:37', '2'), + ('86', '3503', '2006-02-16T02:30:53', '2005-06-19T00:16:23', '2005-06-25T19:28:23', '2'), + ('207', '2817', '2006-02-16T02:30:53', '2005-05-30T09:03:52', '2005-06-05T07:37:52', '2'), + ('357', '1689', '2006-02-16T02:30:53', '2005-05-25T23:49:56', '2005-06-01T21:41:56', '2'), + ('84', '2191', '2006-02-16T02:30:53', '2005-07-11T00:05:58', '2005-07-19T04:50:58', '2'), + ('330', '4202', '2006-02-16T02:30:53', '2005-06-20T13:48:21', '2005-06-22T17:36:21', '2'), + ('135', '1420', '2006-02-16T02:30:53', '2005-07-29T03:37:07', '2005-07-29T23:22:07', '2'), + ('26', '1568', '2006-02-16T02:30:53', '2005-08-01T06:42:20', '2005-08-07T06:12:20', '2'), + ('138', '97', '2006-02-16T02:30:53', '2005-07-30T14:37:44', '2005-08-06T18:05:44', '2'), + ('111', '3514', '2006-02-16T02:30:53', '2005-08-20T02:50:44', '2005-08-26T22:58:44', '2'), + ('584', '3202', '2006-02-16T02:30:53', '2005-07-27T15:18:42', '2005-08-01T15:18:42', '2'), + ('205', '4466', '2006-02-16T02:30:53', '2005-07-28T05:12:04', '2005-08-05T02:28:04', '2'), + ('218', '3599', '2006-02-16T02:30:53', '2005-08-19T06:51:02', '2005-08-25T11:48:02', '2'), + ('159', '599', '2006-02-16T02:30:53', '2005-05-28T14:04:50', '2005-06-03T18:00:50', '2'), + ('150', '17', '2006-02-16T02:30:53', '2005-05-31T00:06:02', '2005-06-06T02:30:02', '2'), + ('52', '1885', '2006-02-16T02:30:53', '2005-07-09T16:04:45', '2005-07-17T18:53:45', '2'), + ('182', '234', '2006-02-16T02:30:53', '2005-06-18T04:01:28', '2005-06-24T04:55:28', '2'), + ('403', '2329', '2006-02-16T02:30:53', '2005-07-11T00:24:44', '2005-07-14T04:42:44', '2'), + ('547', '3930', '2006-02-16T02:30:53', '2005-08-19T05:46:26', '2005-08-22T03:26:26', '2'), + ('390', '4369', '2006-02-16T02:30:53', '2005-08-20T01:56:20', '2005-08-22T23:07:20', '2'), + ('158', '4061', '2006-02-16T02:30:53', '2005-08-20T21:23:03', '2005-08-25T17:29:03', '2'), + ('421', '192', '2006-02-16T02:30:53', '2005-07-27T00:08:33', '2005-08-03T20:58:33', '2'), + ('569', '2654', '2006-02-16T02:30:53', '2005-08-18T15:15:44', '2005-08-22T19:32:44', '2'), + ('230', '1723', '2006-02-16T02:30:53', '2005-07-27T15:59:19', '2005-08-04T10:09:19', '2'), + ('518', '2972', '2006-02-16T02:30:53', '2005-07-08T22:54:21', '2005-07-17T03:52:21', '2'), + ('308', '3660', '2006-02-16T02:30:53', '2005-08-01T13:25:30', '2005-08-02T16:43:30', '2'), + ('313', '4432', '2006-02-16T02:30:53', '2005-08-21T08:15:38', '2005-08-23T08:08:38', '2'), + ('566', '3122', '2006-02-16T02:30:53', '2005-07-29T15:26:59', '2005-08-05T21:04:59', '2'), + ('535', '4204', '2006-02-16T02:30:53', '2005-08-18T19:21:56', '2005-08-26T22:44:56', '2'), + ('122', '2788', '2006-02-16T02:30:53', '2005-08-20T13:01:43', '2005-08-22T16:32:43', '2'), + ('190', '665', '2006-02-16T02:30:53', '2005-08-17T09:07:00', '2005-08-23T08:16:00', '2'), + ('42', '2312', '2006-02-16T02:30:53', '2005-07-27T16:25:11', '2005-08-01T12:33:11', '2'), + ('476', '2727', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('67', '1298', '2006-02-16T02:30:53', '2005-07-10T00:58:37', '2005-07-17T22:02:37', '2'), + ('66', '3764', '2006-02-16T02:30:53', '2005-06-21T15:19:19', '2005-06-29T14:23:19', '2'), + ('403', '1697', '2006-02-16T02:30:53', '2005-07-27T05:08:59', '2005-07-29T03:42:59', '2'), + ('180', '3897', '2006-02-16T02:30:53', '2005-07-10T18:08:49', '2005-07-16T16:43:49', '2'), + ('423', '3804', '2006-02-16T02:30:53', '2005-06-16T21:54:40', '2005-06-19T21:28:40', '2'), + ('546', '3030', '2006-02-16T02:30:53', '2005-08-20T14:43:03', '2005-08-27T11:41:03', '2'), + ('588', '3129', '2006-02-16T02:30:53', '2005-08-20T17:05:02', '2005-08-27T11:22:02', '2'), + ('339', '1984', '2006-02-16T02:30:53', '2005-07-12T12:12:43', '2005-07-21T10:49:43', '2'), + ('348', '1241', '2006-02-16T02:30:53', '2005-08-22T05:51:59', '2005-08-31T01:45:59', '2'), + ('407', '4231', '2006-02-16T02:30:53', '2005-08-01T20:54:33', '2005-08-08T20:59:33', '2'), + ('181', '1818', '2006-02-16T02:30:53', '2005-08-01T18:37:39', '2005-08-07T23:50:39', '2'), + ('469', '4441', '2006-02-16T02:30:53', '2005-06-16T11:17:22', '2005-06-25T15:55:22', '2'), + ('389', '3561', '2006-02-16T02:30:53', '2005-07-28T11:00:58', '2005-08-04T14:30:58', '2'), + ('65', '1408', '2006-02-16T02:30:53', '2005-06-20T13:06:52', '2005-06-25T13:03:52', '2'), + ('404', '4368', '2006-02-16T02:30:53', '2005-07-31T11:49:55', '2005-08-07T16:54:55', '2'), + ('230', '3075', '2006-02-16T02:30:53', '2005-06-16T16:39:58', '2005-06-18T19:50:58', '2'), + ('240', '1401', '2006-02-16T02:30:53', '2005-08-19T11:44:59', '2005-08-20T12:30:59', '2'), + ('125', '4333', '2006-02-16T02:30:53', '2005-08-17T18:47:07', '2005-08-20T23:26:07', '2'), + ('383', '854', '2006-02-16T02:30:53', '2005-06-20T16:02:59', '2005-06-22T21:30:59', '2'), + ('214', '1885', '2006-02-16T02:30:53', '2005-08-01T13:06:03', '2005-08-09T08:39:03', '2'), + ('588', '2180', '2006-02-16T02:30:53', '2005-07-29T19:45:33', '2005-08-05T22:09:33', '2'), + ('207', '4466', '2006-02-16T02:30:53', '2005-05-25T04:51:46', '2005-05-31T03:14:46', '2'), + ('597', '2833', '2006-02-16T02:30:53', '2005-07-10T11:36:32', '2005-07-12T13:09:32', '2'), + ('494', '1968', '2006-02-16T02:30:53', '2005-08-01T07:30:45', '2005-08-03T03:03:45', '2'), + ('119', '1902', '2006-02-16T02:30:53', '2005-06-17T11:48:31', '2005-06-18T09:34:31', '2'), + ('477', '3931', '2006-02-16T02:30:53', '2005-07-11T15:43:51', '2005-07-12T12:51:51', '2'), + ('63', '1218', '2006-02-16T02:30:53', '2005-06-16T21:30:34', '2005-06-20T03:27:34', '2'), + ('150', '1926', '2006-02-16T02:30:53', '2005-08-02T08:54:17', '2005-08-09T11:11:17', '2'), + ('585', '3849', '2006-02-16T02:30:53', '2005-08-02T14:44:02', '2005-08-11T16:45:02', '2'), + ('583', '1920', '2006-02-16T02:30:53', '2005-06-20T01:24:10', '2005-06-28T20:12:10', '2'), + ('523', '3995', '2006-02-16T02:30:53', '2005-07-28T01:16:51', '2005-08-02T00:45:51', '2'), + ('588', '1866', '2006-02-16T02:30:53', '2005-05-28T10:56:10', '2005-06-04T13:15:10', '2'), + ('476', '2952', '2006-02-16T02:30:53', '2005-08-18T17:22:41', '2005-08-25T18:52:41', '2'), + ('217', '3222', '2006-02-16T02:30:53', '2005-08-17T04:59:26', '2005-08-20T04:02:26', '2'), + ('526', '3702', '2006-02-16T02:30:53', '2005-05-31T02:44:57', '2005-06-07T23:01:57', '2'), + ('224', '887', '2006-02-16T02:30:53', '2005-06-15T18:08:14', '2005-06-24T23:16:14', '2'), + ('224', '12', '2006-02-16T02:30:53', '2005-07-27T01:21:19', '2005-07-29T20:33:19', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['14460', '5206', '10829', '12403', '15546', '10847', '9074', '8955', '4835', '11306', '11', '6733', '4378', '4534', '3261', '3321', '9366', '15577', '11286', '13003', '1078', '10120', '1705', '6206', '11846', '9722', '1335', '13271', '1251', '6348', '15032', '13606', '14224', '5289', '5294', '13700', '11096', '8625', '4451', '15333', '9986', '13167', '1543', '11025', '2045', '9157', '9396', '5649', '13557', '325', '2291', '4955', '6462', '11962', '12067', '13410', '1038', '4244', '4526', '4550', '671', '6005', '243', '2461', '12954', '5286', '6948', '8592', '1370', '5907', '13575', '11672', '50', '3085', '4644', '246', '15790', '15407', '1993', '12195', '9260', '14736', '996', '15491', '11010', '6032', '6903', '3175', '1821', '11395', '11236', '537', '3500', '10148', '6144', '5310', '2102', '9373', '11198', '9601']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('120', '4137', '2006-02-16T02:30:53', '2005-08-21T12:48:48', '2005-08-30T16:34:48', '2'), + ('517', '692', '2006-02-16T02:30:53', '2005-07-09T11:11:01', '2005-07-17T07:23:01', '2'), + ('554', '168', '2006-02-16T02:30:53', '2005-08-01T23:17:06', '2005-08-09T17:22:06', '2'), + ('440', '2124', '2006-02-16T02:30:53', '2005-08-18T09:31:05', '2005-08-23T09:54:05', '2'), + ('223', '2087', '2006-02-16T02:30:53', '2005-08-23T04:20:38', '2005-09-01T09:57:38', '2'), + ('280', '1200', '2006-02-16T02:30:53', '2005-08-01T23:49:33', '2005-08-10T05:37:33', '2'), + ('84', '3244', '2006-02-16T02:30:53', '2005-07-30T07:50:10', '2005-08-01T11:21:10', '2'), + ('405', '4532', '2006-02-16T02:30:53', '2005-07-30T03:28:27', '2005-08-04T04:56:27', '2'), + ('95', '2499', '2006-02-16T02:30:53', '2005-07-08T18:08:13', '2005-07-17T16:51:13', '2'), + ('247', '13', '2006-02-16T02:30:53', '2005-08-02T15:45:10', '2005-08-03T21:14:10', '2'), + ('142', '4443', '2006-02-16T02:30:53', '2005-05-25T00:09:02', '2005-06-02T20:56:02', '2'), + ('585', '1476', '2006-02-16T02:30:53', '2005-07-12T14:04:01', '2005-07-21T18:57:01', '2'), + ('24', '1244', '2006-02-16T02:30:53', '2005-07-07T20:29:08', '2005-07-12T19:17:08', '2'), + ('132', '2518', '2006-02-16T02:30:53', '2005-07-08T03:36:55', '2005-07-16T00:49:55', '2'), + ('169', '2029', '2006-02-16T02:30:53', '2005-06-21T04:07:41', '2005-06-24T06:25:41', '2'), + ('144', '1750', '2006-02-16T02:30:53', '2005-06-21T08:33:26', '2005-06-24T10:09:26', '2'), + ('557', '4013', '2006-02-16T02:30:53', '2005-07-30T18:48:57', '2005-08-03T15:17:57', '2'), + ('29', '539', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('207', '1319', '2006-02-16T02:30:53', '2005-08-02T14:44:22', '2005-08-10T09:01:22', '2'), + ('451', '3431', '2006-02-16T02:30:53', '2005-08-19T07:39:29', '2005-08-23T05:48:29', '2'), + ('230', '3682', '2006-02-16T02:30:53', '2005-05-31T10:28:33', '2005-06-03T14:45:33', '2'), + ('396', '1709', '2006-02-16T02:30:53', '2005-07-31T21:24:24', '2005-08-03T17:44:24', '2'), + ('564', '123', '2006-02-16T02:30:53', '2005-06-16T13:59:42', '2005-06-18T19:54:42', '2'), + ('459', '1368', '2006-02-16T02:30:53', '2005-07-11T12:32:14', '2005-07-15T15:01:14', '2'), + ('283', '3306', '2006-02-16T02:30:53', '2005-08-17T13:18:29', '2005-08-22T18:05:29', '2'), + ('125', '4260', '2006-02-16T02:30:53', '2005-07-31T08:29:48', '2005-08-07T07:52:48', '2'), + ('64', '1713', '2006-02-16T02:30:53', '2005-06-15T11:51:30', '2005-06-16T16:42:30', '2'), + ('242', '3872', '2006-02-16T02:30:53', '2005-08-19T17:42:06', '2005-08-27T18:39:06', '2'), + ('442', '3307', '2006-02-16T02:30:53', '2005-06-15T05:58:55', '2005-06-23T02:45:55', '2'), + ('66', '21', '2006-02-16T02:30:53', '2005-07-11T20:21:18', '2005-07-19T15:56:18', '2'), + ('467', '3414', '2006-02-16T02:30:53', '2005-08-22T09:14:09', '2005-08-25T09:50:09', '2'), + ('146', '83', '2006-02-16T02:30:53', '2005-08-20T06:07:01', '2005-08-27T04:59:01', '2'), + ('323', '3634', '2006-02-16T02:30:53', '2005-08-21T04:53:08', '2005-08-27T04:12:08', '2'), + ('30', '4336', '2006-02-16T02:30:53', '2005-07-09T15:14:08', '2005-07-12T12:51:08', '2'), + ('22', '3237', '2006-02-16T02:30:53', '2005-07-09T15:23:42', '2005-07-15T15:28:42', '2'), + ('265', '4229', '2006-02-16T02:30:53', '2005-08-20T09:26:17', '2005-08-27T05:49:17', '2'), + ('34', '1436', '2006-02-16T02:30:53', '2005-08-02T08:05:19', '2005-08-04T07:28:19', '2'), + ('410', '884', '2006-02-16T02:30:53', '2005-07-29T13:59:13', '2005-08-07T17:56:13', '2'), + ('85', '179', '2006-02-16T02:30:53', '2005-07-07T23:29:54', '2005-07-10T23:29:54', '2'), + ('142', '1839', '2006-02-16T02:30:53', '2005-08-22T20:44:06', '2005-08-29T22:34:06', '2'), + ('124', '1242', '2006-02-16T02:30:53', '2005-07-31T17:16:50', '2005-08-05T18:34:50', '2'), + ('120', '557', '2006-02-16T02:30:53', '2005-08-19T13:36:41', '2005-08-23T15:29:41', '2'), + ('28', '1188', '2006-02-16T02:30:53', '2005-06-16T01:24:08', '2005-06-18T06:24:08', '2'), + ('419', '2253', '2006-02-16T02:30:53', '2005-08-02T05:39:12', '2005-08-08T00:09:12', '2'), + ('391', '561', '2006-02-16T02:30:53', '2005-06-17T14:38:11', '2005-06-26T13:44:11', '2'), + ('19', '146', '2006-02-16T02:30:53', '2005-07-30T11:06:23', '2005-08-05T05:29:23', '2'), + ('91', '1250', '2006-02-16T02:30:53', '2005-07-30T20:07:24', '2005-08-03T21:20:24', '2'), + ('336', '1349', '2006-02-16T02:30:53', '2005-07-10T07:15:07', '2005-07-12T11:57:07', '2'), + ('23', '2290', '2006-02-16T02:30:53', '2005-08-20T04:12:41', '2005-08-21T02:33:41', '2'), + ('449', '2510', '2006-02-16T02:30:53', '2005-05-27T01:09:55', '2005-05-31T07:01:55', '2'), + ('436', '3949', '2006-02-16T02:30:53', '2005-06-18T07:36:46', '2005-06-26T04:57:46', '2'), + ('225', '1103', '2006-02-16T02:30:53', '2005-07-08T23:16:21', '2005-07-14T02:09:21', '2'), + ('414', '4534', '2006-02-16T02:30:53', '2005-07-12T01:15:24', '2005-07-19T05:11:24', '2'), + ('29', '4384', '2006-02-16T02:30:53', '2005-08-17T17:34:38', '2005-08-21T12:59:38', '2'), + ('514', '2013', '2006-02-16T02:30:53', '2005-08-17T21:36:47', '2005-08-22T01:10:47', '2'), + ('104', '1421', '2006-02-16T02:30:53', '2005-08-19T22:41:44', '2005-08-26T18:05:44', '2'), + ('385', '1253', '2006-02-16T02:30:53', '2005-05-31T05:23:47', '2005-06-02T03:57:47', '2'), + ('581', '592', '2006-02-16T02:30:53', '2005-07-07T13:41:58', '2005-07-09T15:32:58', '2'), + ('1', '1443', '2006-02-16T02:30:53', '2005-07-08T03:17:05', '2005-07-14T01:19:05', '2'), + ('409', '615', '2006-02-16T02:30:53', '2005-07-08T04:34:00', '2005-07-14T23:45:00', '2'), + ('14', '1027', '2006-02-16T02:30:53', '2005-05-28T22:04:30', '2005-06-03T01:21:30', '2'), + ('78', '809', '2006-02-16T02:30:53', '2005-07-11T01:36:42', '2005-07-14T04:47:42', '2'), + ('543', '1721', '2006-02-16T02:30:53', '2005-05-26T13:06:05', '2005-06-03T17:28:05', '2'), + ('343', '78', '2006-02-16T02:30:53', '2005-06-18T19:58:12', '2005-06-28T01:35:12', '2'), + ('63', '3592', '2006-02-16T02:30:53', '2005-08-19T06:04:34', '2005-08-28T02:12:34', '2'), + ('498', '483', '2006-02-16T02:30:53', '2005-07-09T15:11:41', '2005-07-10T19:19:41', '2'), + ('228', '3088', '2006-02-16T02:30:53', '2005-07-26T23:43:49', '2005-07-27T21:24:49', '2'), + ('271', '1952', '2006-02-16T02:30:53', '2005-07-29T12:33:58', '2005-08-04T07:14:58', '2'), + ('396', '644', '2006-02-16T02:30:53', '2005-06-15T14:31:05', '2005-06-22T19:23:05', '2'), + ('168', '4432', '2006-02-16T02:30:53', '2005-07-10T20:41:41', '2005-07-15T21:18:41', '2'), + ('339', '2729', '2006-02-16T02:30:53', '2005-08-20T05:15:20', '2005-08-28T07:36:20', '2'), + ('521', '3947', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('18', '1983', '2006-02-16T02:30:53', '2005-05-25T06:44:53', '2005-05-28T11:28:53', '2'), + ('166', '4282', '2006-02-16T02:30:53', '2005-06-20T15:42:33', '2005-06-21T16:51:33', '2'), + ('38', '3239', '2006-02-16T02:30:53', '2005-07-08T09:14:29', '2005-07-10T07:20:29', '2'), + ('240', '2829', '2006-02-16T02:30:53', '2005-05-26T13:57:07', '2005-05-29T10:12:07', '2'), + ('233', '2887', '2006-02-16T02:30:53', '2005-08-23T14:01:07', '2005-08-30T10:32:07', '2'), + ('42', '3330', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('234', '168', '2006-02-16T02:30:53', '2005-06-17T10:59:24', '2005-06-23T07:30:24', '2'), + ('347', '943', '2006-02-16T02:30:53', '2005-08-18T02:07:49', '2005-08-19T23:54:49', '2'), + ('13', '3969', '2006-02-16T02:30:53', '2005-07-30T14:38:22', '2005-08-07T18:47:22', '2'), + ('139', '207', '2006-02-16T02:30:53', '2005-08-21T22:25:53', '2005-08-25T19:01:53', '2'), + ('331', '2075', '2006-02-16T02:30:53', '2005-05-31T00:06:20', '2005-05-31T21:29:20', '2'), + ('28', '2059', '2006-02-16T02:30:53', '2005-08-23T02:08:40', '2005-08-23T20:23:40', '2'), + ('326', '869', '2006-02-16T02:30:53', '2005-08-02T05:06:27', '2005-08-03T23:47:27', '2'), + ('28', '3792', '2006-02-16T02:30:53', '2005-07-11T02:49:01', '2005-07-18T05:05:01', '2'), + ('517', '3690', '2006-02-16T02:30:53', '2005-07-12T21:58:15', '2005-07-14T01:38:15', '2'), + ('249', '4093', '2006-02-16T02:30:53', '2005-06-20T22:30:23', '2005-06-30T03:28:23', '2'), + ('468', '3207', '2006-02-16T02:30:53', '2005-06-16T21:42:49', '2005-06-20T16:25:49', '2'), + ('225', '4234', '2006-02-16T02:30:53', '2005-08-02T18:47:44', '2005-08-10T17:07:44', '2'), + ('420', '145', '2006-02-16T02:30:53', '2005-08-02T13:17:21', '2005-08-09T09:53:21', '2'), + ('315', '3095', '2006-02-16T02:30:53', '2005-05-28T06:20:55', '2005-06-05T11:48:55', '2'), + ('32', '2447', '2006-02-16T02:30:53', '2005-07-06T00:11:13', '2005-07-13T19:01:13', '2'), + ('63', '1381', '2006-02-16T02:30:53', '2005-07-31T22:19:16', '2005-08-05T00:15:16', '2'), + ('554', '1077', '2006-02-16T02:30:53', '2005-07-11T09:02:53', '2005-07-15T10:58:53', '2'), + ('24', '1565', '2006-02-16T02:30:53', '2005-07-09T16:00:34', '2005-07-12T12:45:34', '2'), + ('486', '2316', '2006-02-16T02:30:53', '2005-06-17T19:05:22', '2005-06-23T23:21:22', '2'), + ('180', '3478', '2006-02-16T02:30:53', '2005-07-30T19:05:36', '2005-08-05T16:16:36', '2'), + ('540', '2908', '2006-02-16T02:30:53', '2005-08-02T11:45:15', '2005-08-10T11:42:15', '2'), + ('553', '1592', '2006-02-16T02:30:53', '2005-07-31T03:42:17', '2005-08-04T02:02:17', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['10407', '15805', '7349', '15099', '12221', '433', '12858', '6894', '43', '11542', '12542', '13367', '8933', '628', '4714', '10582', '14278', '12859', '13698', '13915', '5111', '6766', '3018', '5498', '9465', '11653', '6094', '5839', '12281', '15387', '1150', '8037', '1316', '7369', '14921', '15590', '14495', '5722', '1950', '3075', '10814', '10187', '8464', '655', '11188', '10117', '3362', '1958', '8923', '15625', '626', '12479', '9266', '11627', '12472', '11958', '2951', '7247', '1971', '9385', '8527', '10990', '9589', '1863', '11919', '9073', '9473', '15916', '1141', '7451', '1887', '3312', '7177', '5625', '5616', '15717', '7569', '9168', '5043', '11974', '7306', '14788', '6568', '12344', '5317', '11558', '9344', '8391', '11569', '12240', '11109', '3932', '10176', '15235', '12818', '4251', '15993', '8465', '2671', '8430']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('101', '543', '2006-02-16T02:30:53', '2005-08-01T07:38:07', '2005-08-02T05:38:07', '2'), + ('8', '4511', '2006-02-16T02:30:53', '2005-08-23T14:31:19', '2005-08-25T19:01:19', '2'), + ('195', '861', '2006-02-16T02:30:53', '2005-07-27T14:33:00', '2005-08-01T15:01:00', '2'), + ('86', '1940', '2006-02-16T02:30:53', '2005-08-22T11:49:16', '2005-08-26T06:38:16', '2'), + ('98', '2488', '2006-02-16T02:30:53', '2005-08-18T02:50:51', '2005-08-27T06:22:51', '2'), + ('574', '4364', '2006-02-16T02:30:53', '2005-05-27T16:40:40', '2005-05-30T19:55:40', '2'), + ('144', '3024', '2006-02-16T02:30:53', '2005-08-19T02:22:16', '2005-08-26T07:25:16', '2'), + ('315', '1347', '2006-02-16T02:30:53', '2005-07-12T21:20:50', '2005-07-20T23:42:50', '2'), + ('532', '2578', '2006-02-16T02:30:53', '2005-05-25T05:39:25', '2005-05-26T06:54:25', '2'), + ('7', '2155', '2006-02-16T02:30:53', '2005-08-17T00:51:32', '2005-08-24T20:29:32', '2'), + ('230', '1920', '2006-02-16T02:30:53', '2005-08-18T14:21:11', '2005-08-20T16:06:11', '2'), + ('290', '4569', '2006-02-16T02:30:53', '2005-08-19T21:19:27', '2005-08-24T15:22:27', '2'), + ('260', '1664', '2006-02-16T02:30:53', '2005-07-30T02:36:06', '2005-08-02T23:37:06', '2'), + ('173', '2513', '2006-02-16T02:30:53', '2005-05-28T17:05:46', '2005-06-06T16:29:46', '2'), + ('385', '1932', '2006-02-16T02:30:53', '2005-07-08T12:12:48', '2005-07-17T08:43:48', '2'), + ('233', '2536', '2006-02-16T02:30:53', '2005-08-01T13:54:22', '2005-08-05T16:46:22', '2'), + ('557', '2334', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('139', '2289', '2006-02-16T02:30:53', '2005-08-19T02:23:23', '2005-08-28T04:55:23', '2'), + ('364', '3829', '2006-02-16T02:30:53', '2005-08-20T09:24:26', '2005-08-22T05:04:26', '2'), + ('129', '1180', '2006-02-16T02:30:53', '2005-08-20T16:42:53', '2005-08-23T20:30:53', '2'), + ('12', '2875', '2006-02-16T02:30:53', '2005-07-09T07:02:19', '2005-07-10T06:27:19', '2'), + ('171', '3615', '2006-02-16T02:30:53', '2005-07-12T15:32:01', '2005-07-18T14:03:01', '2'), + ('112', '4150', '2006-02-16T02:30:53', '2005-06-20T11:10:35', '2005-06-25T07:17:35', '2'), + ('302', '63', '2006-02-16T02:30:53', '2005-07-10T00:27:21', '2005-07-13T20:11:21', '2'), + ('2', '3084', '2006-02-16T02:30:53', '2005-07-30T22:39:53', '2005-08-06T16:43:53', '2'), + ('358', '4475', '2006-02-16T02:30:53', '2005-08-17T05:06:10', '2005-08-24T03:09:10', '2'), + ('285', '2684', '2006-02-16T02:30:53', '2005-07-11T05:54:42', '2005-07-18T08:19:42', '2'), + ('367', '252', '2006-02-16T02:30:53', '2005-07-10T17:08:30', '2005-07-13T21:21:30', '2'), + ('417', '4576', '2006-02-16T02:30:53', '2005-08-18T04:50:32', '2005-08-21T00:14:32', '2'), + ('323', '3879', '2006-02-16T02:30:53', '2005-08-22T22:49:13', '2005-08-29T01:49:13', '2'), + ('136', '1632', '2006-02-16T02:30:53', '2005-05-31T21:20:09', '2005-06-03T19:15:09', '2'), + ('409', '3973', '2006-02-16T02:30:53', '2005-07-28T16:31:20', '2005-07-31T12:18:20', '2'), + ('138', '3891', '2006-02-16T02:30:53', '2005-06-15T10:26:23', '2005-06-21T09:25:23', '2'), + ('139', '3889', '2006-02-16T02:30:53', '2005-07-27T15:07:58', '2005-07-30T09:16:58', '2'), + ('284', '3724', '2006-02-16T02:30:53', '2005-08-22T05:12:24', '2005-08-26T08:20:24', '2'), + ('599', '4048', '2006-02-16T02:30:53', '2005-08-23T06:09:44', '2005-09-01T06:53:44', '2'), + ('429', '3215', '2006-02-16T02:30:53', '2005-08-21T14:04:39', '2005-08-22T16:53:39', '2'), + ('556', '2890', '2006-02-16T02:30:53', '2005-07-10T11:10:04', '2005-07-12T16:31:04', '2'), + ('594', '723', '2006-02-16T02:30:53', '2005-06-17T08:26:52', '2005-06-22T08:08:52', '2'), + ('161', '4346', '2006-02-16T02:30:53', '2005-06-20T14:52:19', '2005-06-28T18:48:19', '2'), + ('49', '2758', '2006-02-16T02:30:53', '2005-08-01T22:43:12', '2005-08-05T02:35:12', '2'), + ('400', '1629', '2006-02-16T02:30:53', '2005-08-01T00:15:49', '2005-08-05T01:00:49', '2'), + ('28', '2343', '2006-02-16T02:30:53', '2005-07-29T08:18:20', '2005-08-03T04:50:20', '2'), + ('287', '331', '2006-02-16T02:30:53', '2005-05-28T20:16:20', '2005-05-31T16:46:20', '2'), + ('485', '1372', '2006-02-16T02:30:53', '2005-08-02T11:17:11', '2005-08-08T16:46:11', '2'), + ('459', '1894', '2006-02-16T02:30:53', '2005-07-31T21:14:31', '2005-08-01T15:59:31', '2'), + ('454', '1284', '2006-02-16T02:30:53', '2005-06-21T12:19:54', '2005-06-23T06:59:54', '2'), + ('581', '1843', '2006-02-16T02:30:53', '2005-06-17T08:52:01', '2005-06-23T07:55:01', '2'), + ('446', '2425', '2006-02-16T02:30:53', '2005-07-30T02:08:49', '2005-08-03T23:45:49', '2'), + ('207', '4200', '2006-02-16T02:30:53', '2005-08-23T07:25:29', '2005-08-27T13:17:29', '2'), + ('584', '452', '2006-02-16T02:30:53', '2005-05-28T16:58:09', '2005-06-01T14:02:09', '2'), + ('401', '1119', '2006-02-16T02:30:53', '2005-08-18T12:26:37', '2005-08-21T18:08:37', '2'), + ('364', '1705', '2006-02-16T02:30:53', '2005-07-30T14:59:01', '2005-07-31T17:01:01', '2'), + ('168', '3945', '2006-02-16T02:30:53', '2005-08-17T04:25:47', '2005-08-26T02:54:47', '2'), + ('297', '4458', '2006-02-16T02:30:53', '2005-08-18T11:58:48', '2005-08-27T16:37:48', '2'), + ('217', '2061', '2006-02-16T02:30:53', '2005-08-17T17:23:20', '2005-08-24T14:47:20', '2'), + ('404', '2903', '2006-02-16T02:30:53', '2005-06-20T06:23:01', '2005-06-24T00:26:01', '2'), + ('102', '1445', '2006-02-16T02:30:53', '2005-07-27T10:32:58', '2005-07-29T05:00:58', '2'), + ('357', '2870', '2006-02-16T02:30:53', '2005-06-17T09:23:59', '2005-06-25T13:20:59', '2'), + ('570', '3453', '2006-02-16T02:30:53', '2005-07-30T19:25:49', '2005-08-08T17:08:49', '2'), + ('168', '709', '2006-02-16T02:30:53', '2005-07-29T10:21:00', '2005-08-05T16:05:00', '2'), + ('111', '262', '2006-02-16T02:30:53', '2005-08-02T04:41:06', '2005-08-10T05:02:06', '2'), + ('574', '2604', '2006-02-16T02:30:53', '2005-07-31T03:13:29', '2005-08-09T01:51:29', '2'), + ('550', '4466', '2006-02-16T02:30:53', '2005-06-17T01:31:46', '2005-06-26T02:09:46', '2'), + ('40', '4497', '2006-02-16T02:30:53', '2005-08-17T16:08:49', '2005-08-20T16:59:49', '2'), + ('141', '2185', '2006-02-16T02:30:53', '2005-07-30T07:49:56', '2005-08-05T06:25:56', '2'), + ('185', '1717', '2006-02-16T02:30:53', '2005-07-30T23:04:13', '2005-08-04T21:48:13', '2'), + ('327', '4580', '2006-02-16T02:30:53', '2005-08-23T17:56:01', '2005-08-31T21:49:01', '2'), + ('217', '4128', '2006-02-16T02:30:53', '2005-05-31T19:42:02', '2005-06-07T00:59:02', '2'), + ('29', '2382', '2006-02-16T02:30:53', '2005-07-27T18:18:41', '2005-08-03T13:55:41', '2'), + ('32', '3591', '2006-02-16T02:30:53', '2005-06-17T03:53:18', '2005-06-25T07:37:18', '2'), + ('554', '1008', '2006-02-16T02:30:53', '2005-06-21T08:05:32', '2005-06-27T03:34:32', '2'), + ('133', '3818', '2006-02-16T02:30:53', '2005-07-27T08:07:39', '2005-07-30T03:17:39', '2'), + ('114', '1751', '2006-02-16T02:30:53', '2005-07-10T05:44:02', '2005-07-12T00:03:02', '2'), + ('238', '4014', '2006-02-16T02:30:53', '2005-07-10T05:21:11', '2005-07-18T08:42:11', '2'), + ('208', '902', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('528', '2315', '2006-02-16T02:30:53', '2005-07-27T22:38:53', '2005-08-05T19:03:53', '2'), + ('75', '2035', '2006-02-16T02:30:53', '2005-07-30T11:31:17', '2005-08-08T16:56:17', '2'), + ('369', '2979', '2006-02-16T02:30:53', '2005-07-09T03:25:18', '2005-07-13T00:57:18', '2'), + ('485', '1609', '2006-02-16T02:30:53', '2005-08-17T17:56:48', '2005-08-21T19:14:48', '2'), + ('207', '2269', '2006-02-16T02:30:53', '2005-07-27T12:57:26', '2005-08-03T09:35:26', '2'), + ('139', '1917', '2006-02-16T02:30:53', '2005-08-22T00:27:59', '2005-08-29T23:54:59', '2'), + ('13', '4203', '2006-02-16T02:30:53', '2005-07-12T05:45:47', '2005-07-15T05:18:47', '2'), + ('269', '3675', '2006-02-16T02:30:53', '2005-08-18T07:15:19', '2005-08-24T04:58:19', '2'), + ('14', '2693', '2006-02-16T02:30:53', '2005-07-09T16:10:25', '2005-07-18T17:10:25', '2'), + ('403', '1681', '2006-02-16T02:30:53', '2005-08-17T01:19:52', '2005-08-19T00:47:52', '2'), + ('396', '1005', '2006-02-16T02:30:53', '2005-07-30T18:13:45', '2005-08-07T15:23:45', '2'), + ('36', '2134', '2006-02-16T02:30:53', '2005-07-29T05:52:50', '2005-08-03T04:45:50', '2'), + ('504', '2592', '2006-02-16T02:30:53', '2005-08-17T01:31:04', '2005-08-24T03:36:04', '2'), + ('30', '1168', '2006-02-16T02:30:53', '2005-08-18T03:27:11', '2005-08-26T04:34:11', '2'), + ('479', '2683', '2006-02-16T02:30:53', '2005-08-02T08:20:29', '2005-08-09T11:35:29', '2'), + ('490', '4396', '2006-02-16T02:30:53', '2005-07-06T21:06:17', '2005-07-07T19:25:17', '2'), + ('19', '1181', '2006-02-16T02:30:53', '2005-07-31T23:40:35', '2005-08-09T00:46:35', '2'), + ('416', '2726', '2006-02-16T02:30:53', '2005-08-22T17:43:12', '2005-08-29T23:03:12', '2'), + ('528', '3069', '2006-02-16T02:30:53', '2005-08-19T01:04:59', '2005-08-26T21:39:59', '2'), + ('367', '3541', '2006-02-16T02:30:53', '2005-07-07T14:11:55', '2005-07-16T14:01:55', '2'), + ('12', '1638', '2006-02-16T02:30:53', '2005-08-23T20:28:44', '2005-08-27T16:23:44', '2'), + ('238', '4109', '2006-02-16T02:30:53', '2005-07-29T08:20:49', '2005-07-31T04:02:49', '2'), + ('451', '2164', '2006-02-16T02:30:53', '2005-06-19T11:33:11', '2005-06-26T14:30:11', '2'), + ('219', '3377', '2006-02-16T02:30:53', '2005-07-29T07:12:17', '2005-08-03T09:53:17', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['6030', '15475', '15270', '7851', '12478', '2019', '6536', '4394', '14741', '9409', '11485', '5929', '6889', '14637', '12583', '10040', '13168', '2379', '9468', '13488', '10348', '5791', '15879', '5025', '2654', '15033', '264', '7321', '14072', '5161', '2901', '2835', '6504', '15703', '7378', '2764', '3519', '528', '14963', '1618', '10731', '4125', '6560', '9121', '10712', '9583', '2214', '11481', '8012', '9326', '7631', '9114', '12898', '1519', '10421', '4145', '10509', '1784', '8435', '14704', '2367', '6019', '1455', '12210', '436', '10312', '7689', '2336', '5797', '1685', '10198', '14622', '480', '9216', '3936', '843', '5050', '6681', '5867', '15607', '15524', '168', '5613', '14881', '1671', '13155', '14056', '1334', '10868', '3285', '4206', '5827', '12011', '9513', '1938', '13117', '14165', '4923', '7478', '3226']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('36', '95', '2006-02-16T02:30:53', '2005-07-11T02:37:51', '2005-07-16T22:34:51', '2'), + ('562', '4503', '2006-02-16T02:30:53', '2005-08-23T01:44:43', '2005-08-23T23:53:43', '2'), + ('262', '4123', '2006-02-16T02:30:53', '2005-08-22T18:48:42', '2005-08-28T15:38:42', '2'), + ('253', '3596', '2006-02-16T02:30:53', '2005-07-28T09:31:58', '2005-08-04T09:58:58', '2'), + ('42', '4512', '2006-02-16T02:30:53', '2005-08-18T12:25:16', '2005-08-22T06:27:16', '2'), + ('528', '2314', '2006-02-16T02:30:53', '2005-06-17T12:38:44', '2005-06-23T17:38:44', '2'), + ('289', '3521', '2006-02-16T02:30:53', '2005-07-12T04:44:25', '2005-07-18T01:52:25', '2'), + ('156', '563', '2006-02-16T02:30:53', '2005-07-07T21:12:45', '2005-07-16T18:24:45', '2'), + ('60', '612', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('156', '3053', '2006-02-16T02:30:53', '2005-07-30T20:33:53', '2005-08-05T18:32:53', '2'), + ('326', '1872', '2006-02-16T02:30:53', '2005-08-02T22:33:25', '2005-08-04T23:26:25', '2'), + ('54', '4303', '2006-02-16T02:30:53', '2005-07-10T21:59:29', '2005-07-14T20:20:29', '2'), + ('198', '2919', '2006-02-16T02:30:53', '2005-07-12T21:01:22', '2005-07-20T20:16:22', '2'), + ('76', '1846', '2006-02-16T02:30:53', '2005-08-21T19:01:00', '2005-08-26T23:03:00', '2'), + ('108', '3090', '2006-02-16T02:30:53', '2005-08-18T15:51:36', '2005-08-20T18:47:36', '2'), + ('268', '2281', '2006-02-16T02:30:53', '2005-07-31T18:54:15', '2005-08-05T17:33:15', '2'), + ('186', '2210', '2006-02-16T02:30:53', '2005-08-19T13:37:28', '2005-08-27T17:54:28', '2'), + ('597', '2708', '2006-02-16T02:30:53', '2005-06-18T14:59:39', '2005-06-24T13:26:39', '2'), + ('20', '4366', '2006-02-16T02:30:53', '2005-07-30T22:53:52', '2005-08-07T00:22:52', '2'), + ('444', '867', '2006-02-16T02:30:53', '2005-08-20T01:28:42', '2005-08-25T06:17:42', '2'), + ('14', '2076', '2006-02-16T02:30:53', '2005-08-01T05:23:00', '2005-08-04T01:12:00', '2'), + ('319', '2795', '2006-02-16T02:30:53', '2005-07-10T14:16:22', '2005-07-19T13:38:22', '2'), + ('482', '235', '2006-02-16T02:30:53', '2005-08-23T16:42:53', '2005-08-29T16:21:53', '2'), + ('91', '153', '2006-02-16T02:30:53', '2005-07-09T02:28:24', '2005-07-12T04:43:24', '2'), + ('405', '3697', '2006-02-16T02:30:53', '2005-06-19T10:37:54', '2005-06-27T11:44:54', '2'), + ('168', '2431', '2006-02-16T02:30:53', '2005-08-22T09:25:24', '2005-08-28T09:56:24', '2'), + ('251', '2069', '2006-02-16T02:30:53', '2005-05-26T16:00:49', '2005-05-27T10:12:49', '2'), + ('38', '3525', '2006-02-16T02:30:53', '2005-07-27T13:33:38', '2005-08-03T07:35:38', '2'), + ('515', '2387', '2006-02-16T02:30:53', '2005-08-20T23:07:10', '2005-08-23T03:38:10', '2'), + ('284', '2617', '2006-02-16T02:30:53', '2005-07-09T08:57:56', '2005-07-18T07:41:56', '2'), + ('25', '667', '2006-02-16T02:30:53', '2005-06-20T02:41:28', '2005-06-23T04:43:28', '2'), + ('89', '4411', '2006-02-16T02:30:53', '2005-06-19T21:44:11', '2005-06-26T16:46:11', '2'), + ('535', '3786', '2006-02-16T02:30:53', '2005-07-12T03:19:14', '2005-07-17T01:13:14', '2'), + ('322', '2883', '2006-02-16T02:30:53', '2005-08-23T10:23:48', '2005-09-01T06:54:48', '2'), + ('144', '3297', '2006-02-16T02:30:53', '2005-07-27T15:31:33', '2005-08-03T17:15:33', '2'), + ('479', '1718', '2006-02-16T02:30:53', '2005-06-19T17:27:25', '2005-06-28T17:18:25', '2'), + ('320', '4314', '2006-02-16T02:30:53', '2005-07-06T00:57:29', '2005-07-10T21:12:29', '2'), + ('359', '1655', '2006-02-16T02:30:53', '2005-05-28T04:30:05', '2005-06-03T10:01:05', '2'), + ('384', '2672', '2006-02-16T02:30:53', '2005-08-22T06:38:10', '2005-08-31T05:35:10', '2'), + ('134', '3741', '2006-02-16T02:30:53', '2005-06-16T07:08:38', '2005-06-25T05:26:38', '2'), + ('278', '4248', '2006-02-16T02:30:53', '2005-08-01T19:21:48', '2005-08-08T22:01:48', '2'), + ('269', '4131', '2006-02-16T02:30:53', '2005-07-07T07:20:29', '2005-07-15T06:41:29', '2'), + ('54', '433', '2006-02-16T02:30:53', '2005-07-12T05:22:06', '2005-07-15T00:04:06', '2'), + ('150', '3098', '2006-02-16T02:30:53', '2005-07-30T09:36:26', '2005-08-05T15:17:26', '2'), + ('532', '1188', '2006-02-16T02:30:53', '2005-08-01T18:47:56', '2005-08-07T19:26:56', '2'), + ('568', '3543', '2006-02-16T02:30:53', '2005-07-31T03:05:21', '2005-08-06T00:14:21', '2'), + ('366', '2430', '2006-02-16T02:30:53', '2005-06-18T02:44:37', '2005-06-18T23:37:37', '2'), + ('234', '4028', '2006-02-16T02:30:53', '2005-08-02T22:18:41', '2005-08-09T23:43:41', '2'), + ('343', '1513', '2006-02-16T02:30:53', '2005-07-28T15:29:00', '2005-08-05T12:28:00', '2'), + ('588', '3772', '2006-02-16T02:30:53', '2005-07-30T17:30:03', '2005-08-01T13:41:03', '2'), + ('132', '2437', '2006-02-16T02:30:53', '2005-07-28T01:01:15', '2005-08-01T06:16:15', '2'), + ('18', '893', '2006-02-16T02:30:53', '2005-07-30T09:13:21', '2005-08-05T06:00:21', '2'), + ('586', '1555', '2006-02-16T02:30:53', '2005-08-19T03:54:34', '2005-08-23T08:14:34', '2'), + ('155', '1553', '2006-02-16T02:30:53', '2005-06-15T23:55:27', '2005-06-21T04:06:27', '2'), + ('262', '925', '2006-02-16T02:30:53', '2005-08-01T08:14:10', '2005-08-03T05:56:10', '2'), + ('592', '3050', '2006-02-16T02:30:53', '2005-07-07T08:26:39', '2005-07-16T12:54:39', '2'), + ('504', '96', '2006-02-16T02:30:53', '2005-08-01T11:25:28', '2005-08-10T09:19:28', '2'), + ('134', '3792', '2006-02-16T02:30:53', '2005-06-16T19:25:32', '2005-06-20T00:00:32', '2'), + ('520', '4462', '2006-02-16T02:30:53', '2005-07-29T07:20:16', '2005-08-02T09:54:16', '2'), + ('248', '4062', '2006-02-16T02:30:53', '2005-08-21T21:02:22', '2005-08-27T23:10:22', '2'), + ('566', '4086', '2006-02-16T02:30:53', '2005-06-18T14:00:31', '2005-06-22T14:45:31', '2'), + ('9', '3483', '2006-02-16T02:30:53', '2005-07-11T02:08:29', '2005-07-13T02:19:29', '2'), + ('358', '2194', '2006-02-16T02:30:53', '2005-06-15T19:51:06', '2005-06-18T21:54:06', '2'), + ('217', '3035', '2006-02-16T02:30:53', '2005-08-18T02:27:29', '2005-08-20T23:32:29', '2'), + ('267', '4317', '2006-02-16T02:30:53', '2005-05-27T17:21:04', '2005-05-30T21:26:04', '2'), + ('172', '4389', '2006-02-16T02:30:53', '2005-08-01T04:29:06', '2005-08-08T04:52:06', '2'), + ('253', '1803', '2006-02-16T02:30:53', '2005-07-28T03:21:24', '2005-07-31T08:01:24', '2'), + ('124', '3888', '2006-02-16T02:30:53', '2005-06-18T11:00:05', '2005-06-25T06:02:05', '2'), + ('384', '1880', '2006-02-16T02:30:53', '2005-07-10T14:43:52', '2005-07-13T16:12:52', '2'), + ('85', '2754', '2006-02-16T02:30:53', '2005-06-16T12:06:57', '2005-06-21T16:53:57', '2'), + ('366', '1297', '2006-02-16T02:30:53', '2005-08-01T00:36:15', '2005-08-07T06:18:15', '2'), + ('559', '2702', '2006-02-16T02:30:53', '2005-08-21T18:25:59', '2005-08-31T00:11:59', '2'), + ('220', '2108', '2006-02-16T02:30:53', '2005-05-27T22:47:39', '2005-06-04T21:17:39', '2'), + ('38', '2783', '2006-02-16T02:30:53', '2005-07-30T13:11:19', '2005-07-31T11:27:19', '2'), + ('129', '4258', '2006-02-16T02:30:53', '2005-07-06T21:15:03', '2005-07-08T17:45:03', '2'), + ('313', '2214', '2006-02-16T02:30:53', '2005-05-30T00:44:24', '2005-05-31T00:58:24', '2'), + ('337', '3876', '2006-02-16T02:30:53', '2005-07-09T03:54:38', '2005-07-10T02:23:38', '2'), + ('368', '854', '2006-02-16T02:30:53', '2005-07-12T12:04:12', '2005-07-19T11:01:12', '2'), + ('321', '730', '2006-02-16T02:30:53', '2005-07-10T18:39:01', '2005-07-19T21:56:01', '2'), + ('484', '4118', '2006-02-16T02:30:53', '2005-08-23T06:54:06', '2005-08-26T05:03:06', '2'), + ('68', '2886', '2006-02-16T02:30:53', '2005-08-23T03:36:26', '2005-08-26T06:28:26', '2'), + ('469', '2714', '2006-02-16T02:30:53', '2005-05-26T03:07:43', '2005-06-02T02:09:43', '2'), + ('220', '4517', '2006-02-16T02:30:53', '2005-07-10T05:15:43', '2005-07-13T05:17:43', '2'), + ('425', '210', '2006-02-16T02:30:53', '2005-08-22T03:47:39', '2005-08-26T05:58:39', '2'), + ('135', '3805', '2006-02-16T02:30:53', '2005-06-16T10:30:22', '2005-06-22T11:08:22', '2'), + ('442', '290', '2006-02-16T02:30:53', '2005-08-19T13:10:23', '2005-08-25T19:07:23', '2'), + ('22', '1300', '2006-02-16T02:30:53', '2005-08-20T22:18:53', '2005-08-27T01:05:53', '2'), + ('269', '1242', '2006-02-16T02:30:53', '2005-06-15T11:43:09', '2005-06-20T15:45:09', '2'), + ('562', '2443', '2006-02-16T02:30:53', '2005-08-02T00:25:15', '2005-08-10T02:31:15', '2'), + ('481', '948', '2006-02-16T02:30:53', '2005-06-21T06:30:13', '2005-06-23T10:31:13', '2'), + ('448', '1557', '2006-02-16T02:30:53', '2005-07-07T11:32:16', '2005-07-14T13:07:16', '2'), + ('290', '1296', '2006-02-16T02:30:53', '2005-07-10T16:22:20', '2005-07-15T21:13:20', '2'), + ('313', '495', '2006-02-16T02:30:53', '2005-08-17T19:19:44', '2005-08-23T00:56:44', '2'), + ('317', '396', '2006-02-16T02:30:53', '2005-07-31T00:28:30', '2005-08-01T00:22:30', '2'), + ('454', '570', '2006-02-16T02:30:53', '2005-06-17T07:18:36', '2005-06-19T01:43:36', '2'), + ('385', '3430', '2006-02-16T02:30:53', '2005-08-19T11:33:20', '2005-08-20T11:55:20', '2'), + ('150', '4151', '2006-02-16T02:30:53', '2005-08-21T02:59:17', '2005-08-24T23:09:17', '2'), + ('18', '932', '2006-02-16T02:30:53', '2005-07-08T21:44:39', '2005-07-17T15:50:39', '2'), + ('521', '3791', '2006-02-16T02:30:53', '2005-07-27T19:16:02', '2005-08-04T22:30:02', '2'), + ('576', '4079', '2006-02-16T02:30:53', '2005-06-21T02:18:14', '2005-06-26T22:32:14', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['15928', '960', '6957', '15567', '8418', '1363', '13577', '7044', '7705', '5360', '11710', '2378', '15437', '9135', '2366', '9184', '3722', '14140', '14699', '13442', '6797', '2707', '5176', '5933', '14405', '8650', '2709', '5367', '13376', '1204', '5743', '9247', '2543', '10754', '3210', '7940', '15589', '7565', '5888', '2128', '2716', '3512', '13542', '664', '2113', '4264', '9487', '11603', '7171', '3306', '855', '7259', '9660', '14421', '5766', '3186', '8903', '2150', '8630', '7604', '8080', '7109', '8962', '10632', '12505', '5263', '5098', '9224', '8295', '2241', '2585', '14205', '14601', '9291', '6439', '2325', '5032', '7076', '14740', '10062', '10035', '9148', '2149', '8719', '5892', '6931', '2929', '4', '15313', '1667', '14057', '12661', '3110', '10844', '15253', '9338', '6958', '12427', '5645', '7246']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('75', '2086', '2006-02-16T02:30:53', '2005-08-23T18:23:24', '2005-09-01T23:43:24', '2'), + ('445', '1966', '2006-02-16T02:30:53', '2005-05-30T18:13:23', '2005-06-04T00:12:23', '2'), + ('518', '2231', '2006-02-16T02:30:53', '2005-07-27T00:00:00', '2005-07-29T19:32:00', '2'), + ('54', '2506', '2006-02-16T02:30:53', '2005-08-23T05:20:36', '2005-08-24T10:09:36', '2'), + ('355', '3081', '2006-02-16T02:30:53', '2005-07-29T06:54:21', '2005-08-05T06:50:21', '2'), + ('197', '771', '2006-02-16T02:30:53', '2005-06-15T14:05:11', '2005-06-17T19:53:11', '2'), + ('448', '3844', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('147', '88', '2006-02-16T02:30:53', '2005-07-27T03:27:29', '2005-08-01T07:00:29', '2'), + ('22', '1072', '2006-02-16T02:30:53', '2005-07-28T04:02:58', '2005-08-05T01:19:58', '2'), + ('562', '679', '2006-02-16T02:30:53', '2005-07-09T18:14:03', '2005-07-10T15:17:03', '2'), + ('553', '613', '2006-02-16T02:30:53', '2005-08-17T07:29:44', '2005-08-19T02:06:44', '2'), + ('384', '2796', '2006-02-16T02:30:53', '2005-06-18T14:57:49', '2005-06-26T18:23:49', '2'), + ('368', '4236', '2006-02-16T02:30:53', '2005-08-23T00:31:09', '2005-08-30T06:17:09', '2'), + ('161', '821', '2006-02-16T02:30:53', '2005-07-30T10:06:53', '2005-08-03T13:57:53', '2'), + ('162', '1413', '2006-02-16T02:30:53', '2005-06-18T13:46:39', '2005-06-23T18:49:39', '2'), + ('365', '51', '2006-02-16T02:30:53', '2005-07-30T12:10:19', '2005-08-01T07:35:19', '2'), + ('83', '604', '2006-02-16T02:30:53', '2005-07-06T11:10:27', '2005-07-13T12:56:27', '2'), + ('65', '2070', '2006-02-16T02:30:53', '2005-08-21T02:04:57', '2005-08-29T06:41:57', '2'), + ('3', '1427', '2006-02-16T02:30:53', '2005-08-21T20:50:48', '2005-08-29T18:08:48', '2'), + ('356', '2432', '2006-02-16T02:30:53', '2005-08-19T23:50:45', '2005-08-27T22:01:45', '2'), + ('469', '1536', '2006-02-16T02:30:53', '2005-07-12T16:47:06', '2005-07-14T14:38:06', '2'), + ('589', '4486', '2006-02-16T02:30:53', '2005-06-19T13:57:08', '2005-06-27T11:09:08', '2'), + ('119', '328', '2006-02-16T02:30:53', '2005-07-09T09:39:31', '2005-07-17T11:56:31', '2'), + ('419', '4372', '2006-02-16T02:30:53', '2005-07-10T22:06:48', '2005-07-12T23:58:48', '2'), + ('470', '2777', '2006-02-16T02:30:53', '2005-08-21T10:45:01', '2005-08-30T04:48:01', '2'), + ('134', '1272', '2006-02-16T02:30:53', '2005-07-29T14:59:04', '2005-08-04T13:13:04', '2'), + ('7', '2877', '2006-02-16T02:30:53', '2005-06-19T14:00:26', '2005-06-23T14:56:26', '2'), + ('485', '1446', '2006-02-16T02:30:53', '2005-07-09T18:39:15', '2005-07-16T14:19:15', '2'), + ('40', '898', '2006-02-16T02:30:53', '2005-08-19T21:31:45', '2005-08-22T01:14:45', '2'), + ('249', '2450', '2006-02-16T02:30:53', '2005-06-15T02:21:46', '2005-06-20T07:14:46', '2'), + ('297', '593', '2006-02-16T02:30:53', '2005-07-10T11:57:38', '2005-07-19T15:38:38', '2'), + ('426', '4106', '2006-02-16T02:30:53', '2005-07-30T14:13:56', '2005-08-02T16:34:56', '2'), + ('58', '1729', '2006-02-16T02:30:53', '2005-06-19T02:14:11', '2005-06-21T00:40:11', '2'), + ('460', '2122', '2006-02-16T02:30:53', '2005-08-01T20:12:33', '2005-08-10T01:07:33', '2'), + ('75', '467', '2006-02-16T02:30:53', '2005-06-21T01:00:25', '2005-06-23T06:10:25', '2'), + ('409', '901', '2006-02-16T02:30:53', '2005-07-28T12:46:47', '2005-07-29T06:46:47', '2'), + ('22', '2379', '2006-02-16T02:30:53', '2005-08-23T06:03:31', '2005-08-30T07:44:31', '2'), + ('114', '1028', '2006-02-16T02:30:53', '2005-07-27T22:33:59', '2005-07-30T03:03:59', '2'), + ('268', '1620', '2006-02-16T02:30:53', '2005-07-10T19:52:17', '2005-07-18T20:32:17', '2'), + ('2', '352', '2006-02-16T02:30:53', '2005-06-17T20:54:58', '2005-06-24T00:41:58', '2'), + ('252', '944', '2006-02-16T02:30:53', '2005-06-19T14:40:17', '2005-06-27T17:45:17', '2'), + ('291', '371', '2006-02-16T02:30:53', '2005-07-06T00:43:06', '2005-07-12T06:18:06', '2'), + ('147', '4543', '2006-02-16T02:30:53', '2005-08-20T03:41:57', '2005-08-29T03:21:57', '2'), + ('523', '87', '2006-02-16T02:30:53', '2005-05-28T21:31:08', '2005-06-02T20:56:08', '2'), + ('406', '1509', '2006-02-16T02:30:53', '2005-06-17T19:57:46', '2005-06-24T00:22:46', '1'), + ('406', '3499', '2006-02-16T02:30:53', '2005-07-07T14:25:28', '2005-07-08T08:49:28', '2'), + ('406', '2165', '2006-02-16T02:30:53', '2005-07-30T23:40:22', '2005-08-01T22:29:22', '1'), + ('406', '3910', '2006-02-16T02:30:53', '2005-08-17T03:22:10', '2005-08-18T06:48:10', '1'), + ('406', '4381', '2006-02-16T02:30:53', '2005-07-27T07:58:35', '2005-08-03T07:45:35', '1'), + ('406', '1669', '2006-02-16T02:30:53', '2005-06-21T07:46:58', '2005-06-26T11:22:58', '2'), + ('406', '2527', '2006-02-16T02:30:53', '2005-05-30T02:00:28', '2005-06-03T20:16:28', '2'), + ('406', '2345', '2006-02-16T02:30:53', '2005-07-27T11:06:00', '2005-08-02T06:44:00', '2'), + ('406', '1090', '2006-02-16T02:30:53', '2005-07-31T06:03:17', '2005-08-07T06:59:17', '2'), + ('406', '4402', '2006-02-16T02:30:53', '2005-08-21T11:20:21', '2005-08-24T06:26:21', '1'), + ('406', '7', '2006-02-16T02:30:53', '2005-07-10T13:07:31', '2005-07-16T13:03:31', '1'), + ('406', '3198', '2006-02-16T02:30:53', '2005-06-20T23:04:20', '2005-06-29T02:56:20', '2'), + ('406', '4546', '2006-02-16T02:30:53', '2005-07-30T01:08:06', '2005-07-30T21:47:06', '2'), + ('406', '1910', '2006-02-16T02:30:53', '2005-06-17T22:50:36', '2005-06-21T19:33:36', '1'), + ('406', '1378', '2006-02-16T02:30:53', '2005-07-29T14:07:59', '2005-08-03T13:18:59', '2'), + ('406', '3720', '2006-02-16T02:30:53', '2005-07-27T23:54:52', '2005-08-05T03:04:52', '2'), + ('406', '3035', '2006-02-16T02:30:53', '2005-07-28T18:05:06', '2005-07-29T22:44:06', '2'), + ('406', '1658', '2006-02-16T02:30:53', '2005-07-27T05:28:57', '2005-08-04T10:41:57', '2'), + ('406', '4439', '2006-02-16T02:30:53', '2005-07-30T03:43:45', '2005-08-07T00:33:45', '1'), + ('406', '1290', '2006-02-16T02:30:53', '2005-08-01T15:36:56', '2005-08-05T17:32:56', '1'), + ('406', '3741', '2006-02-16T02:30:53', '2005-08-18T13:17:30', '2005-08-23T18:03:30', '1'), + ('406', '119', '2006-02-16T02:30:53', '2005-07-09T14:10:36', '2005-07-12T15:07:36', '1'), + ('406', '1772', '2006-02-16T02:30:53', '2005-07-09T06:13:54', '2005-07-10T04:27:54', '1'), + ('406', '2260', '2006-02-16T02:30:53', '2005-07-30T13:25:37', '2005-08-01T15:13:37', '2'), + ('406', '2065', '2006-02-16T02:30:53', '2005-07-29T02:42:14', '2005-07-30T22:22:14', '1'), + ('406', '921', '2006-02-16T02:30:53', '2005-06-18T04:31:41', '2005-06-24T22:34:41', '2'), + ('406', '91', '2006-02-16T02:30:53', '2005-06-19T05:05:03', '2005-06-20T09:28:03', '1'), + ('406', '315', '2006-02-16T02:30:53', '2005-08-21T03:57:15', '2005-08-30T08:46:15', '2'), + ('406', '548', '2006-02-16T02:30:53', '2005-08-21T17:45:52', '2005-08-29T15:10:52', '1'), + ('406', '2884', '2006-02-16T02:30:53', '2005-07-30T16:03:39', '2005-08-05T11:11:39', '2'), + ('406', '3463', '2006-02-16T02:30:53', '2005-07-12T00:23:48', '2005-07-13T00:54:48', '2'), + ('406', '752', '2006-02-16T02:30:53', '2005-06-18T10:08:07', '2005-06-21T15:07:07', '1'), + ('333', '2257', '2006-02-16T02:30:53', '2005-07-09T02:39:47', '2005-07-10T07:45:47', '1'), + ('333', '2821', '2006-02-16T02:30:53', '2005-07-27T04:12:14', '2005-08-05T00:44:14', '1'), + ('333', '1717', '2006-02-16T02:30:53', '2005-08-21T22:35:33', '2005-08-26T17:49:33', '1'), + ('333', '1815', '2006-02-16T02:30:53', '2005-07-31T19:24:55', '2005-08-03T22:51:55', '2'), + ('333', '2694', '2006-02-16T02:30:53', '2005-07-31T18:46:46', '2005-08-04T20:33:46', '1'), + ('333', '1407', '2006-02-16T02:30:53', '2005-07-30T10:39:10', '2005-08-04T07:17:10', '2'), + ('333', '3365', '2006-02-16T02:30:53', '2005-06-17T22:50:00', '2005-06-26T18:40:00', '1'), + ('333', '995', '2006-02-16T02:30:53', '2005-07-29T17:45:45', '2005-08-01T13:53:45', '1'), + ('333', '4322', '2006-02-16T02:30:53', '2005-07-10T20:02:42', '2005-07-11T20:02:42', '1'), + ('333', '2794', '2006-02-16T02:30:53', '2005-07-26T23:02:57', '2005-07-28T04:48:57', '2'), + ('333', '3389', '2006-02-16T02:30:53', '2005-06-20T04:47:39', '2005-06-25T23:16:39', '2'), + ('333', '2452', '2006-02-16T02:30:53', '2005-05-24T23:04:41', '2005-06-03T01:43:41', '2'), + ('333', '2587', '2006-02-16T02:30:53', '2005-08-22T19:59:42', '2005-08-24T15:03:42', '2'), + ('333', '2362', '2006-02-16T02:30:53', '2005-06-16T10:18:59', '2005-06-22T14:45:59', '2'), + ('333', '1526', '2006-02-16T02:30:53', '2005-08-20T22:22:59', '2005-08-25T16:58:59', '2'), + ('333', '1547', '2006-02-16T02:30:53', '2005-08-18T19:10:10', '2005-08-22T20:30:10', '1'), + ('333', '2008', '2006-02-16T02:30:53', '2005-06-20T17:40:12', '2005-06-24T17:09:12', '1'), + ('333', '1516', '2006-02-16T02:30:53', '2005-08-01T23:46:58', '2005-08-09T19:42:58', '2'), + ('333', '4143', '2006-02-16T02:30:53', '2005-08-22T18:05:21', '2005-08-23T18:06:21', '2'), + ('333', '1482', '2006-02-16T02:30:53', '2005-07-30T18:03:13', '2005-08-08T23:57:13', '2'), + ('333', '657', '2006-02-16T02:30:53', '2005-07-27T00:02:41', '2005-07-28T00:53:41', '2'), + ('333', '1759', '2006-02-16T02:30:53', '2005-08-18T10:24:17', '2005-08-27T14:22:17', '1'), + ('333', '1586', '2006-02-16T02:30:53', '2005-07-10T06:58:21', '2005-07-18T04:19:21', '2'), + ('333', '2003', '2006-02-16T02:30:53', '2005-07-27T10:30:41', '2005-07-30T05:44:41', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['13710', '6275', '13579', '6749', '8977', '1298', '14645', '4603', '10997', '10879', '13325', '15656', '1187', '15548', '5818', '12677', '431', '13876', '14219', '5014', '10408', '3662', '14984', '10207', '2476', '10492', '6987', '9633', '13', '15669', '5845', '5434', '6641', '7598', '2206', '23', '1779', '10607', '12654', '1036', '3315', '11644', '3368', '6138', '1138', '2591', '4355', '1431', '5426', '9082', '10512', '12524', '14582', '6563', '9782', '5316', '15893', '13414', '5870', '7374', '8547', '7357', '11933', '13319', '6615', '4446', '7337', '6388', '15623', '3993', '11660', '6098', '7591', '8960', '8007', '10496', '9702', '437', '14954', '15159', '9507', '6689', '5841', '11406', '1772', '89', '7898', '7831', '15587', '12947', '11978', '12004', '1355', '11513', '5022', '13822', '1526', '8130', '3794', '14858']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('333', '756', '2006-02-16T02:30:53', '2005-08-20T09:35:20', '2005-08-21T05:29:20', '2'), + ('333', '3599', '2006-02-16T02:30:53', '2005-07-11T16:12:11', '2005-07-17T20:19:11', '2'), + ('333', '4237', '2006-02-16T02:30:53', '2005-08-20T05:22:06', '2005-08-28T02:33:06', '2'), + ('334', '2895', '2006-02-16T02:30:53', '2005-07-12T14:43:05', '2005-07-21T15:13:05', '2'), + ('334', '4099', '2006-02-16T02:30:53', '2005-07-30T04:14:07', '2005-08-05T23:45:07', '2'), + ('334', '4163', '2006-02-16T02:30:53', '2005-06-15T09:32:53', '2005-06-16T12:40:53', '2'), + ('334', '2369', '2006-02-16T02:30:53', '2005-08-21T19:12:47', '2005-08-25T21:42:47', '1'), + ('334', '755', '2006-02-16T02:30:53', '2005-07-08T06:57:07', '2005-07-17T04:32:07', '1'), + ('334', '300', '2006-02-16T02:30:53', '2005-08-02T04:49:02', '2005-08-10T08:13:02', '2'), + ('334', '4415', '2006-02-16T02:30:53', '2005-08-02T00:33:20', '2005-08-09T04:13:20', '2'), + ('334', '2388', '2006-02-16T02:30:53', '2005-08-19T19:52:02', '2005-08-22T21:14:02', '1'), + ('334', '4239', '2006-02-16T02:30:53', '2005-08-23T08:38:58', '2005-08-24T04:08:58', '2'), + ('334', '1108', '2006-02-16T02:30:53', '2005-06-15T00:58:50', '2005-06-23T02:19:50', '1'), + ('334', '2350', '2006-02-16T02:30:53', '2005-08-23T04:26:20', '2005-08-28T01:27:20', '1'), + ('334', '3940', '2006-02-16T02:30:53', '2005-07-10T15:51:12', '2005-07-14T14:10:12', '2'), + ('334', '1311', '2006-02-16T02:30:53', '2005-08-18T19:36:05', '2005-08-22T21:23:05', '2'), + ('334', '4507', '2006-02-16T02:30:53', '2005-05-27T16:31:05', '2005-06-05T11:29:05', '1'), + ('334', '3137', '2006-02-16T02:30:53', '2005-08-20T15:15:28', '2005-08-23T12:42:28', '2'), + ('334', '3718', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('334', '4095', '2006-02-16T02:30:53', '2005-07-09T01:51:49', '2005-07-10T04:48:49', '1'), + ('334', '4144', '2006-02-16T02:30:53', '2005-08-01T07:42:10', '2005-08-09T02:29:10', '2'), + ('334', '3827', '2006-02-16T02:30:53', '2005-07-06T08:11:48', '2005-07-09T12:25:48', '2'), + ('334', '1704', '2006-02-16T02:30:53', '2005-08-22T07:35:31', '2005-08-30T02:32:31', '1'), + ('334', '2925', '2006-02-16T02:30:53', '2005-08-01T00:53:01', '2005-08-05T05:51:01', '2'), + ('334', '3998', '2006-02-16T02:30:53', '2005-06-18T20:57:12', '2005-06-20T15:42:12', '1'), + ('334', '1669', '2006-02-16T02:30:53', '2005-08-01T10:42:28', '2005-08-02T07:05:28', '1'), + ('334', '3134', '2006-02-16T02:30:53', '2005-07-27T00:59:50', '2005-07-28T01:47:50', '1'), + ('334', '1141', '2006-02-16T02:30:53', '2005-07-31T05:04:08', '2005-08-06T00:52:08', '2'), + ('334', '2294', '2006-02-16T02:30:53', '2005-05-25T00:22:55', '2005-05-30T04:28:55', '1'), + ('334', '1542', '2006-02-16T02:30:53', '2005-08-23T09:06:17', '2005-08-30T08:10:17', '2'), + ('334', '2882', '2006-02-16T02:30:53', '2005-07-10T17:23:14', '2005-07-12T16:29:14', '2'), + ('334', '3790', '2006-02-16T02:30:53', '2005-07-09T21:25:20', '2005-07-15T03:12:20', '2'), + ('334', '2165', '2006-02-16T02:30:53', '2005-07-12T10:33:14', '2005-07-20T08:24:14', '2'), + ('438', '4545', '2006-02-16T02:30:53', '2005-07-27T23:36:01', '2005-07-29T23:35:01', '2'), + ('438', '3651', '2006-02-16T02:30:53', '2005-06-18T02:14:45', '2005-06-24T23:20:45', '2'), + ('438', '4441', '2006-02-16T02:30:53', '2005-05-25T02:40:21', '2005-05-29T06:34:21', '1'), + ('438', '1044', '2006-02-16T02:30:53', '2005-06-16T18:55:11', '2005-06-17T20:11:11', '1'), + ('438', '3999', '2006-02-16T02:30:53', '2005-08-01T14:44:43', '2005-08-02T16:39:43', '2'), + ('438', '2217', '2006-02-16T02:30:53', '2005-08-18T18:56:40', '2005-08-20T17:51:40', '2'), + ('438', '2164', '2006-02-16T02:30:53', '2005-05-31T05:21:10', '2005-06-04T04:19:10', '1'), + ('438', '4108', '2006-02-16T02:30:53', '2005-06-21T08:17:04', '2005-06-24T11:04:04', '1'), + ('438', '1760', '2006-02-16T02:30:53', '2005-08-17T04:49:46', '2005-08-24T08:49:46', '1'), + ('438', '548', '2006-02-16T02:30:53', '2005-06-21T13:18:38', '2005-06-23T11:13:38', '1'), + ('438', '1808', '2006-02-16T02:30:53', '2005-07-11T08:36:04', '2005-07-13T10:30:04', '2'), + ('438', '3944', '2006-02-16T02:30:53', '2005-05-31T19:30:27', '2005-06-05T21:42:27', '1'), + ('438', '4481', '2006-02-16T02:30:53', '2005-06-19T05:32:22', '2005-06-25T23:42:22', '1'), + ('438', '4557', '2006-02-16T02:30:53', '2005-07-07T19:21:19', '2005-07-09T00:55:19', '2'), + ('438', '3193', '2006-02-16T02:30:53', '2005-06-15T18:26:29', '2005-06-21T17:33:29', '1'), + ('438', '251', '2006-02-16T02:30:53', '2005-07-09T21:04:47', '2005-07-17T00:55:47', '1'), + ('438', '4042', '2006-02-16T02:30:53', '2005-07-30T08:11:22', '2005-08-06T09:26:22', '2'), + ('438', '3294', '2006-02-16T02:30:53', '2005-08-01T11:36:19', '2005-08-09T06:52:19', '2'), + ('438', '857', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('438', '1004', '2006-02-16T02:30:53', '2005-08-21T17:08:33', '2005-08-29T18:04:33', '2'), + ('438', '87', '2006-02-16T02:30:53', '2005-07-12T05:34:09', '2005-07-21T07:37:09', '1'), + ('438', '2397', '2006-02-16T02:30:53', '2005-07-31T10:14:26', '2005-08-06T16:11:26', '1'), + ('438', '3856', '2006-02-16T02:30:53', '2005-07-09T16:09:42', '2005-07-11T15:20:42', '1'), + ('438', '2571', '2006-02-16T02:30:53', '2005-08-23T17:02:00', '2005-08-30T12:45:00', '2'), + ('438', '4126', '2006-02-16T02:30:53', '2005-08-19T22:47:34', '2005-08-21T02:50:34', '1'), + ('438', '1524', '2006-02-16T02:30:53', '2005-07-10T18:40:25', '2005-07-12T15:39:25', '2'), + ('438', '3184', '2006-02-16T02:30:53', '2005-07-27T15:20:57', '2005-08-05T13:09:57', '2'), + ('438', '875', '2006-02-16T02:30:53', '2005-07-29T11:10:15', '2005-08-03T12:50:15', '1'), + ('438', '1917', '2006-02-16T02:30:53', '2005-07-27T14:48:31', '2005-08-02T18:07:31', '2'), + ('438', '2574', '2006-02-16T02:30:53', '2005-08-17T16:38:20', '2005-08-22T14:31:20', '1'), + ('438', '2496', '2006-02-16T02:30:53', '2005-08-19T19:35:13', '2005-08-27T17:59:13', '1'), + ('438', '23', '2006-02-16T02:30:53', '2005-07-12T08:36:22', '2005-07-20T09:03:22', '1'), + ('438', '2629', '2006-02-16T02:30:53', '2005-07-07T23:12:16', '2005-07-13T19:42:16', '1'), + ('525', '3314', '2006-02-16T02:30:53', '2005-07-27T14:12:04', '2005-08-03T14:57:04', '2'), + ('525', '3506', '2006-02-16T02:30:53', '2005-07-11T22:17:16', '2005-07-19T23:50:16', '2'), + ('525', '3003', '2006-02-16T02:30:53', '2005-08-23T07:23:29', '2005-08-31T01:47:29', '1'), + ('525', '1061', '2006-02-16T02:30:53', '2005-07-06T23:37:06', '2005-07-14T19:31:06', '1'), + ('525', '4081', '2006-02-16T02:30:53', '2005-08-17T05:22:42', '2005-08-23T01:03:42', '1'), + ('525', '3016', '2006-02-16T02:30:53', '2005-07-11T06:23:28', '2005-07-17T04:05:28', '1'), + ('525', '651', '2006-02-16T02:30:53', '2005-07-27T23:25:54', '2005-08-02T22:54:54', '1'), + ('525', '391', '2006-02-16T02:30:53', '2005-07-30T03:36:31', '2005-08-01T23:46:31', '2'), + ('525', '1942', '2006-02-16T02:30:53', '2005-07-28T15:22:27', '2005-07-30T13:06:27', '2'), + ('525', '411', '2006-02-16T02:30:53', '2005-08-01T10:53:16', '2005-08-08T10:34:16', '2'), + ('525', '3353', '2006-02-16T02:30:53', '2005-07-31T07:34:07', '2005-08-02T06:13:07', '2'), + ('525', '1800', '2006-02-16T02:30:53', '2005-05-27T17:47:22', '2005-06-05T14:22:22', '2'), + ('525', '3608', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('525', '4355', '2006-02-16T02:30:53', '2005-08-22T14:32:25', '2005-08-24T11:19:25', '2'), + ('525', '387', '2006-02-16T02:30:53', '2005-07-31T00:22:29', '2005-08-07T05:59:29', '2'), + ('525', '1568', '2006-02-16T02:30:53', '2005-07-12T12:22:13', '2005-07-16T07:44:13', '1'), + ('525', '1230', '2006-02-16T02:30:53', '2005-07-10T17:11:31', '2005-07-18T15:50:31', '2'), + ('525', '2502', '2006-02-16T02:30:53', '2005-08-02T19:16:10', '2005-08-04T20:51:10', '2'), + ('525', '1269', '2006-02-16T02:30:53', '2005-06-16T18:12:54', '2005-06-24T19:55:54', '1'), + ('499', '2181', '2006-02-16T02:30:53', '2005-05-25T14:28:29', '2005-05-29T14:33:29', '1'), + ('499', '2680', '2006-02-16T02:30:53', '2005-07-28T11:08:22', '2005-08-03T12:28:22', '1'), + ('499', '4436', '2006-02-16T02:30:53', '2005-07-28T08:44:21', '2005-07-30T03:25:21', '2'), + ('499', '2510', '2006-02-16T02:30:53', '2005-08-23T06:00:28', '2005-08-29T10:15:28', '1'), + ('499', '935', '2006-02-16T02:30:53', '2005-08-19T05:54:21', '2005-08-22T09:17:21', '1'), + ('499', '4380', '2006-02-16T02:30:53', '2005-08-17T18:02:10', '2005-08-18T20:40:10', '2'), + ('499', '2690', '2006-02-16T02:30:53', '2005-08-17T18:56:53', '2005-08-26T14:56:53', '1'), + ('499', '4203', '2006-02-16T02:30:53', '2005-06-15T13:13:59', '2005-06-20T12:23:59', '1'), + ('499', '4473', '2006-02-16T02:30:53', '2005-08-16T23:51:33', '2005-08-24T01:37:33', '2'), + ('499', '928', '2006-02-16T02:30:53', '2005-07-09T02:10:54', '2005-07-17T08:07:54', '2'), + ('499', '807', '2006-02-16T02:30:53', '2005-08-20T13:39:28', '2005-08-24T07:40:28', '1'), + ('499', '1940', '2006-02-16T02:30:53', '2005-06-16T00:27:51', '2005-06-19T00:19:51', '1'), + ('499', '4055', '2006-02-16T02:30:53', '2005-07-28T19:48:15', '2005-08-05T14:18:15', '2'), + ('499', '584', '2006-02-16T02:30:53', '2005-07-06T14:35:26', '2005-07-11T14:40:26', '2'), + ('499', '366', '2006-02-16T02:30:53', '2005-08-22T02:46:18', '2005-08-30T08:22:18', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['3241', '10497', '7800', '12354', '12587', '5956', '6723', '10333', '5392', '11606', '5427', '8770', '1830', '12436', '9588', '8486', '3200', '7129', '2331', '226', '14322', '15125', '11680', '12620', '12324', '4649', '11693', '5058', '13434', '4293', '7531', '9853', '5920', '1369', '4693', '7101', '9453', '14419', '2473', '14371', '11802', '2660', '9320', '10335', '12277', '13958', '14623', '4095', '9040', '9085', '5723', '15096', '1301', '13241', '165', '10870', '7992', '9254', '5421', '6280', '3173', '15115', '13858', '14002', '6468', '1021', '1986', '1066', '15141', '12306', '11273', '5197', '8113', '12395', '10306', '14938', '15071', '15421', '13239', '6718', '15924', '2708', '5018', '13640', '15223', '9603', '8322', '12894', '16018', '8343', '15162', '8624', '2621', '1557', '6672', '9275', '5893', '13358', '11989', '12826']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('499', '1442', '2006-02-16T02:30:53', '2005-06-21T02:54:32', '2005-06-26T21:56:32', '2'), + ('499', '1060', '2006-02-16T02:30:53', '2005-08-01T10:55:59', '2005-08-07T11:15:59', '1'), + ('499', '3386', '2006-02-16T02:30:53', '2005-07-28T07:50:59', '2005-07-29T07:31:59', '2'), + ('499', '2913', '2006-02-16T02:30:53', '2005-08-18T07:34:07', '2005-08-26T05:56:07', '1'), + ('499', '3081', '2006-02-16T02:30:53', '2005-08-18T16:03:13', '2005-08-25T19:30:13', '1'), + ('499', '2536', '2006-02-16T02:30:53', '2005-07-10T23:23:08', '2005-07-13T17:36:08', '1'), + ('499', '2678', '2006-02-16T02:30:53', '2005-07-12T13:44:57', '2005-07-14T15:57:57', '2'), + ('499', '3955', '2006-02-16T02:30:53', '2005-08-01T04:58:32', '2005-08-04T00:51:32', '2'), + ('499', '2552', '2006-02-16T02:30:53', '2005-07-09T19:32:30', '2005-07-16T15:01:30', '1'), + ('499', '4138', '2006-02-16T02:30:53', '2005-08-17T03:32:43', '2005-08-18T04:30:43', '1'), + ('499', '3197', '2006-02-16T02:30:53', '2005-07-09T21:12:26', '2005-07-14T01:02:26', '1'), + ('499', '4025', '2006-02-16T02:30:53', '2005-07-29T19:53:50', '2005-08-05T14:22:50', '1'), + ('499', '4010', '2006-02-16T02:30:53', '2005-06-16T22:18:43', '2005-06-23T21:14:43', '2'), + ('499', '3761', '2006-02-16T02:30:53', '2005-08-18T10:41:05', '2005-08-23T07:36:05', '2'), + ('499', '1368', '2006-02-16T02:30:53', '2005-07-31T03:13:13', '2005-08-02T04:06:13', '1'), + ('221', '1759', '2006-02-16T02:30:53', '2005-07-29T08:53:38', '2005-08-01T14:12:38', '2'), + ('221', '4117', '2006-02-16T02:30:53', '2005-06-21T00:22:47', '2005-06-27T05:52:47', '2'), + ('221', '1930', '2006-02-16T02:30:53', '2005-07-27T06:18:01', '2005-07-28T02:38:01', '1'), + ('221', '1546', '2006-02-16T02:30:53', '2005-06-18T10:50:09', '2005-06-25T14:30:09', '1'), + ('221', '4181', '2006-02-16T02:30:53', '2005-05-26T10:44:04', '2005-05-31T13:26:04', '2'), + ('221', '2818', '2006-02-16T02:30:53', '2005-08-21T08:06:30', '2005-08-29T10:12:30', '2'), + ('221', '3942', '2006-02-16T02:30:53', '2005-08-22T12:53:22', '2005-08-29T18:44:22', '1'), + ('221', '4538', '2006-02-16T02:30:53', '2005-08-17T06:12:27', '2005-08-23T08:54:27', '1'), + ('221', '2663', '2006-02-16T02:30:53', '2005-08-18T17:26:38', '2005-08-25T13:24:38', '1'), + ('221', '2436', '2006-02-16T02:30:53', '2005-08-18T06:38:20', '2005-08-20T02:28:20', '2'), + ('221', '1116', '2006-02-16T02:30:53', '2005-07-08T09:32:05', '2005-07-15T08:37:05', '2'), + ('221', '793', '2006-02-16T02:30:53', '2005-08-17T06:56:56', '2005-08-24T06:20:56', '2'), + ('221', '917', '2006-02-16T02:30:53', '2005-07-09T04:20:35', '2005-07-18T08:09:35', '2'), + ('221', '2073', '2006-02-16T02:30:53', '2005-08-19T23:34:26', '2005-08-23T18:33:26', '1'), + ('221', '984', '2006-02-16T02:30:53', '2005-07-07T15:53:47', '2005-07-10T18:11:47', '1'), + ('221', '2393', '2006-02-16T02:30:53', '2005-07-27T21:19:34', '2005-08-06T01:07:34', '2'), + ('221', '1782', '2006-02-16T02:30:53', '2005-07-31T12:58:20', '2005-08-04T10:47:20', '1'), + ('221', '1893', '2006-02-16T02:30:53', '2005-07-10T21:33:58', '2005-07-17T19:41:58', '2'), + ('221', '679', '2006-02-16T02:30:53', '2005-06-15T14:29:14', '2005-06-16T13:01:14', '1'), + ('221', '1694', '2006-02-16T02:30:53', '2005-07-08T11:07:36', '2005-07-14T08:40:36', '1'), + ('221', '2006', '2006-02-16T02:30:53', '2005-07-27T05:06:34', '2005-07-29T06:12:34', '1'), + ('221', '1988', '2006-02-16T02:30:53', '2005-07-30T22:20:04', '2005-08-08T02:27:04', '1'), + ('221', '3146', '2006-02-16T02:30:53', '2005-08-21T11:15:46', '2005-08-30T16:37:46', '1'), + ('221', '3876', '2006-02-16T02:30:53', '2005-06-18T20:42:45', '2005-06-19T20:17:45', '1'), + ('221', '2197', '2006-02-16T02:30:53', '2005-08-21T09:37:16', '2005-08-27T13:50:16', '2'), + ('221', '2815', '2006-02-16T02:30:53', '2005-08-17T11:32:51', '2005-08-22T10:56:51', '1'), + ('221', '4341', '2006-02-16T02:30:53', '2005-06-19T10:50:02', '2005-06-28T12:49:02', '1'), + ('221', '909', '2006-02-16T02:30:53', '2005-07-30T17:16:39', '2005-08-06T18:43:39', '2'), + ('33', '323', '2006-02-16T02:30:53', '2005-08-01T04:59:30', '2005-08-05T02:26:30', '1'), + ('33', '407', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('33', '2380', '2006-02-16T02:30:53', '2005-08-20T18:11:44', '2005-08-28T14:59:44', '1'), + ('33', '901', '2006-02-16T02:30:53', '2005-08-21T18:29:13', '2005-08-26T20:48:13', '2'), + ('33', '2900', '2006-02-16T02:30:53', '2005-07-07T06:01:48', '2005-07-15T02:52:48', '2'), + ('33', '392', '2006-02-16T02:30:53', '2005-07-30T06:31:45', '2005-08-03T12:20:45', '1'), + ('33', '3400', '2006-02-16T02:30:53', '2005-07-30T08:17:24', '2005-08-03T09:35:24', '2'), + ('33', '605', '2006-02-16T02:30:53', '2005-07-10T11:14:48', '2005-07-11T15:46:48', '2'), + ('33', '1983', '2006-02-16T02:30:53', '2005-08-22T11:43:04', '2005-08-29T12:16:04', '2'), + ('33', '1484', '2006-02-16T02:30:53', '2005-06-15T09:46:33', '2005-06-24T08:56:33', '2'), + ('33', '3106', '2006-02-16T02:30:53', '2005-08-19T16:25:00', '2005-08-26T12:27:00', '2'), + ('33', '2735', '2006-02-16T02:30:53', '2005-05-26T02:28:36', '2005-06-02T03:21:36', '1'), + ('33', '1509', '2006-02-16T02:30:53', '2005-08-02T00:27:12', '2005-08-02T20:00:12', '2'), + ('33', '1851', '2006-02-16T02:30:53', '2005-07-28T14:53:06', '2005-07-29T18:17:06', '1'), + ('33', '495', '2006-02-16T02:30:53', '2005-07-30T14:26:11', '2005-08-04T16:12:11', '1'), + ('33', '2437', '2006-02-16T02:30:53', '2005-07-09T20:49:12', '2005-07-10T16:30:12', '1'), + ('33', '4055', '2006-02-16T02:30:53', '2005-07-11T16:36:17', '2005-07-13T14:04:17', '2'), + ('33', '4306', '2006-02-16T02:30:53', '2005-06-20T22:21:10', '2005-06-27T19:41:10', '2'), + ('33', '1739', '2006-02-16T02:30:53', '2005-08-22T12:28:01', '2005-08-26T16:12:01', '1'), + ('33', '2167', '2006-02-16T02:30:53', '2005-08-20T14:50:57', '2005-08-23T12:10:57', '2'), + ('33', '87', '2006-02-16T02:30:53', '2005-08-20T20:12:19', '2005-08-23T00:23:19', '1'), + ('541', '4560', '2006-02-16T02:30:53', '2005-07-12T01:27:09', '2005-07-20T00:37:09', '2'), + ('541', '2724', '2006-02-16T02:30:53', '2005-05-31T03:16:15', '2005-06-08T06:43:15', '2'), + ('541', '2894', '2006-02-16T02:30:53', '2005-06-17T10:34:59', '2005-06-24T04:57:59', '2'), + ('541', '2383', '2006-02-16T02:30:53', '2005-05-31T09:07:33', '2005-06-09T05:34:33', '2'), + ('541', '227', '2006-02-16T02:30:53', '2005-08-22T13:41:49', '2005-08-28T15:25:49', '2'), + ('541', '3853', '2006-02-16T02:30:53', '2005-08-18T05:47:55', '2005-08-21T01:56:55', '1'), + ('541', '3383', '2006-02-16T02:30:53', '2005-08-02T14:20:55', '2005-08-07T12:57:55', '1'), + ('541', '1571', '2006-02-16T02:30:53', '2005-07-09T10:43:54', '2005-07-16T10:19:54', '1'), + ('541', '4269', '2006-02-16T02:30:53', '2005-07-28T19:14:00', '2005-08-06T00:05:00', '2'), + ('541', '2020', '2006-02-16T02:30:53', '2005-08-18T09:06:30', '2005-08-21T12:09:30', '2'), + ('541', '2819', '2006-02-16T02:30:53', '2005-08-01T04:19:18', '2005-08-09T02:16:18', '1'), + ('541', '408', '2006-02-16T02:30:53', '2005-08-22T05:52:39', '2005-08-31T11:43:39', '1'), + ('541', '417', '2006-02-16T02:30:53', '2005-08-22T10:58:43', '2005-08-31T14:53:43', '1'), + ('541', '3', '2006-02-16T02:30:53', '2005-08-22T23:56:37', '2005-08-25T18:58:37', '2'), + ('541', '3296', '2006-02-16T02:30:53', '2005-08-19T16:22:13', '2005-08-23T19:26:13', '1'), + ('541', '2283', '2006-02-16T02:30:53', '2005-07-12T13:38:06', '2005-07-18T09:05:06', '1'), + ('541', '1114', '2006-02-16T02:30:53', '2005-08-23T18:08:59', '2005-08-27T12:20:59', '2'), + ('541', '2659', '2006-02-16T02:30:53', '2005-06-19T13:59:05', '2005-06-24T10:02:05', '2'), + ('541', '2317', '2006-02-16T02:30:53', '2005-07-09T02:01:05', '2005-07-10T04:09:05', '1'), + ('541', '3427', '2006-02-16T02:30:53', '2005-08-20T07:22:53', '2005-08-21T11:54:53', '2'), + ('541', '2263', '2006-02-16T02:30:53', '2005-08-22T17:13:39', '2005-08-27T11:17:39', '2'), + ('541', '2266', '2006-02-16T02:30:53', '2005-07-31T03:43:43', '2005-08-02T00:11:43', '2'), + ('541', '301', '2006-02-16T02:30:53', '2005-07-29T03:52:49', '2005-08-02T22:53:49', '1'), + ('541', '4581', '2006-02-16T02:30:53', '2005-08-19T03:49:28', '2005-08-25T01:51:28', '2'), + ('439', '897', '2006-02-16T02:30:53', '2005-08-23T21:27:35', '2005-08-30T00:36:35', '1'), + ('439', '4267', '2006-02-16T02:30:53', '2005-07-29T04:45:16', '2005-08-02T03:37:16', '1'), + ('439', '1756', '2006-02-16T02:30:53', '2005-08-22T14:41:05', '2005-08-27T20:23:05', '2'), + ('439', '4402', '2006-02-16T02:30:53', '2005-07-29T13:55:36', '2005-08-02T12:23:36', '2'), + ('439', '1746', '2006-02-16T02:30:53', '2005-06-19T08:07:31', '2005-06-28T05:36:31', '1'), + ('439', '2617', '2006-02-16T02:30:53', '2005-06-16T02:28:35', '2005-06-16T22:11:35', '2'), + ('439', '375', '2006-02-16T02:30:53', '2005-07-12T11:49:16', '2005-07-13T07:03:16', '2'), + ('439', '1916', '2006-02-16T02:30:53', '2005-07-30T15:09:15', '2005-07-31T10:23:15', '2'), + ('439', '1689', '2006-02-16T02:30:53', '2005-07-10T20:05:30', '2005-07-14T23:05:30', '1'), + ('439', '1510', '2006-02-16T02:30:53', '2005-08-19T21:04:20', '2005-08-24T20:49:20', '2'), + ('439', '3686', '2006-02-16T02:30:53', '2005-08-17T18:23:58', '2005-08-20T20:31:58', '2'), + ('439', '1277', '2006-02-16T02:30:53', '2005-08-19T01:25:11', '2005-08-27T01:22:11', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['11544', '5801', '15044', '10905', '8703', '367', '786', '14730', '4813', '3774', '2097', '1264', '15653', '10744', '126', '15818', '12621', '12755', '2992', '11042', '9322', '3294', '4528', '6577', '3896', '2560', '10728', '14846', '2688', '10458', '8917', '7722', '4540', '5305', '3837', '218', '1837', '6480', '13021', '13502', '7846', '10818', '4172', '13909', '2644', '723', '9945', '8681', '5980', '15422', '7214', '8501', '8341', '9949', '11964', '5162', '15644', '7868', '8376', '14837', '652', '14244', '9204', '15745', '15945', '1544', '4498', '6474', '7348', '15155', '5831', '5401', '3683', '5941', '14649', '123', '11753', '15800', '6680', '13769', '3718', '10356', '15714', '14534', '5142', '3771', '130', '12713', '4097', '10946', '7942', '7385', '496', '10678', '12537', '11358', '2485', '1795', '569', '11656']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('439', '836', '2006-02-16T02:30:53', '2005-08-17T00:55:07', '2005-08-22T19:25:07', '1'), + ('439', '3511', '2006-02-16T02:30:53', '2005-07-10T14:59:05', '2005-07-14T17:55:05', '2'), + ('439', '4513', '2006-02-16T02:30:53', '2005-08-22T09:51:54', '2005-08-31T12:45:54', '1'), + ('439', '2835', '2006-02-16T02:30:53', '2005-08-02T01:45:59', '2005-08-04T22:28:59', '1'), + ('439', '1065', '2006-02-16T02:30:53', '2005-07-29T17:12:44', '2005-07-30T19:38:44', '1'), + ('439', '3437', '2006-02-16T02:30:53', '2005-05-27T07:37:02', '2005-05-30T05:43:02', '2'), + ('439', '2637', '2006-02-16T02:30:53', '2005-05-29T15:17:28', '2005-06-07T10:07:28', '2'), + ('439', '2949', '2006-02-16T02:30:53', '2005-08-21T22:21:11', '2005-08-30T03:02:11', '1'), + ('439', '2752', '2006-02-16T02:30:53', '2005-07-08T17:09:56', '2005-07-09T22:29:56', '1'), + ('439', '4044', '2006-02-16T02:30:53', '2005-07-06T13:25:07', '2005-07-15T12:56:07', '2'), + ('439', '569', '2006-02-16T02:30:53', '2005-06-17T18:40:04', '2005-06-23T13:49:04', '1'), + ('439', '4176', '2006-02-16T02:30:53', '2005-06-15T06:59:39', '2005-06-18T08:10:39', '2'), + ('439', '2736', '2006-02-16T02:30:53', '2005-08-23T08:34:42', '2005-09-01T03:07:42', '1'), + ('439', '565', '2006-02-16T02:30:53', '2005-08-01T19:56:49', '2005-08-09T16:33:49', '2'), + ('439', '2047', '2006-02-16T02:30:53', '2005-05-25T21:07:59', '2005-05-28T18:51:59', '1'), + ('439', '2620', '2006-02-16T02:30:53', '2005-08-23T14:59:58', '2005-08-27T13:13:58', '2'), + ('439', '4566', '2006-02-16T02:30:53', '2005-08-18T17:31:36', '2005-08-24T16:43:36', '2'), + ('439', '105', '2006-02-16T02:30:53', '2005-08-18T22:38:47', '2005-08-22T23:58:47', '1'), + ('439', '3347', '2006-02-16T02:30:53', '2005-06-20T09:11:51', '2005-06-24T05:59:51', '1'), + ('439', '4149', '2006-02-16T02:30:53', '2005-08-02T06:04:33', '2005-08-11T01:30:33', '1'), + ('439', '223', '2006-02-16T02:30:53', '2005-07-30T17:21:39', '2005-08-06T16:58:39', '2'), + ('439', '2390', '2006-02-16T02:30:53', '2005-06-21T07:03:23', '2005-06-30T02:22:23', '2'), + ('439', '3209', '2006-02-16T02:30:53', '2005-07-08T03:24:54', '2005-07-09T03:50:54', '2'), + ('439', '4191', '2006-02-16T02:30:53', '2005-07-12T06:15:05', '2005-07-15T06:23:05', '1'), + ('309', '1755', '2006-02-16T02:30:53', '2005-07-06T19:09:15', '2005-07-16T00:52:15', '2'), + ('309', '3340', '2006-02-16T02:30:53', '2005-06-19T03:12:42', '2005-06-28T02:28:42', '1'), + ('309', '3133', '2006-02-16T02:30:53', '2005-08-01T19:15:09', '2005-08-04T19:35:09', '1'), + ('309', '3840', '2006-02-16T02:30:53', '2005-08-22T02:13:48', '2005-08-30T05:39:48', '1'), + ('309', '4281', '2006-02-16T02:30:53', '2005-06-19T12:50:56', '2005-06-28T17:58:56', '2'), + ('309', '1500', '2006-02-16T02:30:53', '2005-08-01T09:19:48', '2005-08-02T10:16:48', '1'), + ('309', '4460', '2006-02-16T02:30:53', '2005-07-30T01:47:02', '2005-08-05T21:10:02', '2'), + ('309', '3828', '2006-02-16T02:30:53', '2005-07-28T04:44:58', '2005-07-30T01:29:58', '1'), + ('309', '4160', '2006-02-16T02:30:53', '2005-07-08T04:03:28', '2005-07-13T03:31:28', '2'), + ('309', '625', '2006-02-16T02:30:53', '2005-07-09T15:55:36', '2005-07-18T15:59:36', '1'), + ('309', '3166', '2006-02-16T02:30:53', '2005-07-06T16:27:43', '2005-07-07T18:02:43', '1'), + ('309', '2291', '2006-02-16T02:30:53', '2005-05-26T09:27:09', '2005-06-04T11:53:09', '2'), + ('309', '1259', '2006-02-16T02:30:53', '2005-06-16T23:16:15', '2005-06-21T21:54:15', '1'), + ('309', '3076', '2006-02-16T02:30:53', '2005-07-12T01:49:29', '2005-07-17T01:00:29', '1'), + ('309', '1242', '2006-02-16T02:30:53', '2005-08-19T08:08:04', '2005-08-26T12:04:04', '2'), + ('309', '1324', '2006-02-16T02:30:53', '2005-08-20T01:58:15', '2005-08-21T20:21:15', '1'), + ('309', '4201', '2006-02-16T02:30:53', '2005-07-28T09:21:18', '2005-08-06T07:10:18', '2'), + ('309', '4549', '2006-02-16T02:30:53', '2005-08-01T22:52:45', '2005-08-06T04:07:45', '1'), + ('309', '1158', '2006-02-16T02:30:53', '2005-07-07T09:49:09', '2005-07-11T15:14:09', '2'), + ('309', '1508', '2006-02-16T02:30:53', '2005-08-20T16:26:36', '2005-08-21T20:59:36', '2'), + ('309', '1923', '2006-02-16T02:30:53', '2005-06-19T09:42:30', '2005-06-27T07:23:30', '2'), + ('309', '3407', '2006-02-16T02:30:53', '2005-05-29T05:34:44', '2005-05-30T05:50:44', '1'), + ('309', '2075', '2006-02-16T02:30:53', '2005-07-31T15:47:51', '2005-08-02T19:06:51', '1'), + ('309', '4004', '2006-02-16T02:30:53', '2005-07-29T16:12:01', '2005-08-01T18:14:01', '2'), + ('309', '1777', '2006-02-16T02:30:53', '2005-07-11T00:18:21', '2005-07-14T21:26:21', '1'), + ('309', '2601', '2006-02-16T02:30:53', '2005-08-22T23:58:09', '2005-08-30T19:03:09', '2'), + ('309', '802', '2006-02-16T02:30:53', '2005-07-27T09:23:33', '2005-08-03T13:14:33', '2'), + ('309', '1052', '2006-02-16T02:30:53', '2005-07-29T09:12:51', '2005-07-30T11:19:51', '2'), + ('309', '4208', '2006-02-16T02:30:53', '2005-07-29T04:42:01', '2005-08-04T00:58:01', '1'), + ('309', '3258', '2006-02-16T02:30:53', '2005-07-31T15:50:10', '2005-08-01T17:53:10', '2'), + ('309', '2225', '2006-02-16T02:30:53', '2005-08-17T17:37:03', '2005-08-25T11:55:03', '2'), + ('43', '2765', '2006-02-16T02:30:53', '2005-07-09T09:00:11', '2005-07-17T07:26:11', '1'), + ('43', '3139', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('43', '3589', '2006-02-16T02:30:53', '2005-07-28T10:08:55', '2005-07-30T11:52:55', '1'), + ('43', '3588', '2006-02-16T02:30:53', '2005-07-29T05:25:32', '2005-08-01T07:42:32', '2'), + ('43', '2251', '2006-02-16T02:30:53', '2005-08-22T01:54:52', '2005-08-29T02:24:52', '1'), + ('43', '1201', '2006-02-16T02:30:53', '2005-05-28T20:08:47', '2005-05-29T14:57:47', '2'), + ('43', '1150', '2006-02-16T02:30:53', '2005-08-21T05:29:55', '2005-08-24T01:06:55', '1'), + ('43', '4378', '2006-02-16T02:30:53', '2005-07-30T12:43:58', '2005-08-03T16:26:58', '2'), + ('43', '2737', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('43', '3633', '2006-02-16T02:30:53', '2005-08-23T18:51:41', '2005-08-28T18:42:41', '1'), + ('43', '269', '2006-02-16T02:30:53', '2005-06-16T01:28:22', '2005-06-17T06:57:22', '2'), + ('43', '4299', '2006-02-16T02:30:53', '2005-07-08T02:07:50', '2005-07-12T23:54:50', '2'), + ('43', '310', '2006-02-16T02:30:53', '2005-07-12T01:36:46', '2005-07-16T07:24:46', '2'), + ('43', '3238', '2006-02-16T02:30:53', '2005-07-27T14:32:32', '2005-07-28T17:05:32', '1'), + ('43', '2641', '2006-02-16T02:30:53', '2005-08-22T14:27:46', '2005-08-23T17:46:46', '2'), + ('43', '830', '2006-02-16T02:30:53', '2005-07-10T16:34:02', '2005-07-11T14:27:02', '2'), + ('43', '431', '2006-02-16T02:30:53', '2005-07-09T19:59:10', '2005-07-11T23:21:10', '2'), + ('43', '3020', '2006-02-16T02:30:53', '2005-07-06T09:25:56', '2005-07-14T12:10:56', '1'), + ('43', '492', '2006-02-16T02:30:53', '2005-07-10T22:40:47', '2005-07-17T00:19:47', '2'), + ('43', '4074', '2006-02-16T02:30:53', '2005-08-21T19:19:21', '2005-08-22T17:23:21', '1'), + ('43', '1795', '2006-02-16T02:30:53', '2005-05-25T20:26:42', '2005-05-26T19:41:42', '1'), + ('43', '2599', '2006-02-16T02:30:53', '2005-08-17T09:11:52', '2005-08-25T05:03:52', '2'), + ('43', '963', '2006-02-16T02:30:53', '2005-08-23T14:23:44', '2005-08-29T17:04:44', '2'), + ('43', '2887', '2006-02-16T02:30:53', '2005-07-12T12:01:56', '2005-07-16T17:32:56', '1'), + ('56', '2868', '2006-02-16T02:30:53', '2005-08-20T11:43:52', '2005-08-28T13:19:52', '1'), + ('56', '2624', '2006-02-16T02:30:53', '2005-07-06T10:57:56', '2005-07-12T12:54:56', '1'), + ('56', '313', '2006-02-16T02:30:53', '2005-08-01T05:49:17', '2005-08-10T05:57:17', '1'), + ('56', '2083', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('56', '2514', '2006-02-16T02:30:53', '2005-08-21T15:16:29', '2005-08-26T16:18:29', '1'), + ('56', '369', '2006-02-16T02:30:53', '2005-07-09T08:05:23', '2005-07-13T12:37:23', '2'), + ('56', '1373', '2006-02-16T02:30:53', '2005-07-06T13:19:34', '2005-07-10T10:27:34', '2'), + ('56', '3990', '2006-02-16T02:30:53', '2005-05-25T21:21:56', '2005-05-30T22:41:56', '2'), + ('56', '1505', '2006-02-16T02:30:53', '2005-08-18T21:07:28', '2005-08-24T17:46:28', '1'), + ('56', '2454', '2006-02-16T02:30:53', '2005-07-07T06:10:55', '2005-07-11T02:45:55', '1'), + ('56', '4271', '2006-02-16T02:30:53', '2005-08-02T03:20:39', '2005-08-05T02:59:39', '1'), + ('56', '1636', '2006-02-16T02:30:53', '2005-07-28T12:49:44', '2005-07-31T18:07:44', '2'), + ('56', '2996', '2006-02-16T02:30:53', '2005-07-27T15:49:46', '2005-07-28T13:50:46', '2'), + ('56', '1785', '2006-02-16T02:30:53', '2005-05-28T00:43:41', '2005-06-04T03:56:41', '1'), + ('56', '4438', '2006-02-16T02:30:53', '2005-08-01T17:26:24', '2005-08-05T22:55:24', '1'), + ('56', '57', '2006-02-16T02:30:53', '2005-08-18T14:06:39', '2005-08-25T09:36:39', '2'), + ('56', '2361', '2006-02-16T02:30:53', '2005-08-02T17:45:02', '2005-08-11T18:16:02', '1'), + ('56', '1562', '2006-02-16T02:30:53', '2005-06-18T21:26:03', '2005-06-21T22:09:03', '2'), + ('56', '536', '2006-02-16T02:30:53', '2005-06-16T20:09:01', '2005-06-24T17:50:01', '2'), + ('56', '4534', '2006-02-16T02:30:53', '2005-05-28T10:12:41', '2005-06-03T10:08:41', '2'), + ('56', '1451', '2006-02-16T02:30:53', '2005-08-17T05:11:09', '2005-08-25T07:51:09', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['14291', '15702', '8285', '2140', '2989', '341', '4702', '13560', '7696', '2410', '406', '10705', '13202', '1402', '12135', '12632', '15747', '15299', '3425', '9144', '7375', '3812', '2418', '7645', '9822', '10608', '12237', '3970', '6451', '6116', '1878', '14198', '9173', '13614', '8688', '4735', '835', '6778', '10033', '169', '11519', '5689', '13430', '13995', '14621', '1341', '15215', '4028', '9788', '12183', '7480', '14624', '13014', '13033', '157', '1731', '11116', '1475', '6363', '8561', '4347', '813', '9371', '1297', '13807', '12294', '11110', '13704', '2642', '1633', '12856', '11529', '11069', '2043', '7718', '1707', '8741', '1735', '15147', '12151', '14225', '15635', '7660', '9100', '1965', '935', '14458', '15609', '4182', '1973', '14036', '15861', '4130', '10759', '15864', '2380', '2839', '13457', '738', '13651']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('56', '3988', '2006-02-16T02:30:53', '2005-08-21T07:03:05', '2005-08-26T12:56:05', '2'), + ('56', '1602', '2006-02-16T02:30:53', '2005-08-23T10:23:28', '2005-08-29T11:08:28', '2'), + ('56', '678', '2006-02-16T02:30:53', '2005-07-29T02:00:18', '2005-08-03T20:43:18', '2'), + ('56', '2395', '2006-02-16T02:30:53', '2005-06-17T21:40:29', '2005-06-19T00:42:29', '1'), + ('56', '1586', '2006-02-16T02:30:53', '2005-06-20T08:59:37', '2005-06-22T03:27:37', '2'), + ('56', '4168', '2006-02-16T02:30:53', '2005-05-27T04:01:42', '2005-06-05T08:51:42', '1'), + ('56', '2593', '2006-02-16T02:30:53', '2005-07-08T11:41:36', '2005-07-10T06:55:36', '1'), + ('56', '820', '2006-02-16T02:30:53', '2005-08-20T04:17:16', '2005-08-28T08:38:16', '1'), + ('56', '3463', '2006-02-16T02:30:53', '2005-07-28T03:41:35', '2005-08-06T05:48:35', '2'), + ('381', '265', '2006-02-16T02:30:53', '2005-06-18T16:55:08', '2005-06-20T12:40:08', '2'), + ('381', '2136', '2006-02-16T02:30:53', '2005-05-27T13:46:46', '2005-05-30T12:43:46', '1'), + ('381', '4338', '2006-02-16T02:30:53', '2005-08-01T18:38:54', '2005-08-04T18:00:54', '1'), + ('381', '3546', '2006-02-16T02:30:53', '2005-08-19T14:58:30', '2005-08-27T17:10:30', '1'), + ('381', '1951', '2006-02-16T02:30:53', '2005-06-15T16:31:08', '2005-06-24T19:31:08', '1'), + ('381', '1019', '2006-02-16T02:30:53', '2005-08-17T23:50:24', '2005-08-23T18:01:24', '2'), + ('381', '827', '2006-02-16T02:30:53', '2005-08-18T17:54:21', '2005-08-22T18:58:21', '1'), + ('381', '1517', '2006-02-16T02:30:53', '2005-08-23T12:29:24', '2005-08-31T08:27:24', '2'), + ('381', '767', '2006-02-16T02:30:53', '2005-08-22T19:42:57', '2005-08-23T15:29:57', '2'), + ('381', '4548', '2006-02-16T02:30:53', '2005-06-21T18:07:07', '2005-06-27T22:59:07', '2'), + ('381', '718', '2006-02-16T02:30:53', '2005-07-30T10:22:15', '2005-08-05T08:14:15', '1'), + ('381', '2970', '2006-02-16T02:30:53', '2005-07-27T15:22:33', '2005-08-01T20:06:33', '1'), + ('381', '4490', '2006-02-16T02:30:53', '2005-07-06T15:22:19', '2005-07-08T13:04:19', '1'), + ('381', '2756', '2006-02-16T02:30:53', '2005-06-18T17:14:42', '2005-06-26T16:33:42', '1'), + ('381', '830', '2006-02-16T02:30:53', '2005-07-28T01:27:42', '2005-08-03T07:16:42', '2'), + ('381', '2469', '2006-02-16T02:30:53', '2005-07-31T11:48:25', '2005-08-05T15:52:25', '2'), + ('381', '3835', '2006-02-16T02:30:53', '2005-08-01T14:48:41', '2005-08-04T17:32:41', '2'), + ('381', '4422', '2006-02-16T02:30:53', '2005-08-18T03:24:38', '2005-08-25T09:05:38', '1'), + ('381', '701', '2006-02-16T02:30:53', '2005-07-06T22:48:17', '2005-07-15T19:07:17', '1'), + ('381', '1008', '2006-02-16T02:30:53', '2005-07-12T00:52:19', '2005-07-16T21:30:19', '2'), + ('381', '247', '2006-02-16T02:30:53', '2005-07-11T07:37:38', '2005-07-14T11:53:38', '2'), + ('381', '3319', '2006-02-16T02:30:53', '2005-06-17T02:55:32', '2005-06-21T03:44:32', '1'), + ('381', '465', '2006-02-16T02:30:53', '2005-08-21T03:48:31', '2005-08-24T07:10:31', '2'), + ('381', '2103', '2006-02-16T02:30:53', '2005-07-30T11:40:10', '2005-08-04T05:40:10', '2'), + ('381', '3736', '2006-02-16T02:30:53', '2005-08-20T06:28:37', '2005-08-22T07:54:37', '2'), + ('381', '2263', '2006-02-16T02:30:53', '2005-07-29T16:31:32', '2005-07-30T12:39:32', '1'), + ('381', '4324', '2006-02-16T02:30:53', '2005-07-08T13:12:27', '2005-07-13T10:06:27', '2'), + ('381', '299', '2006-02-16T02:30:53', '2005-05-29T23:37:00', '2005-06-02T23:38:00', '1'), + ('381', '4503', '2006-02-16T02:30:53', '2005-07-12T16:06:00', '2005-07-14T21:57:00', '2'), + ('381', '4480', '2006-02-16T02:30:53', '2005-07-31T18:44:29', '2005-08-04T19:52:29', '1'), + ('381', '1758', '2006-02-16T02:30:53', '2005-05-26T03:09:30', '2005-05-27T01:37:30', '2'), + ('381', '1034', '2006-02-16T02:30:53', '2005-08-17T00:01:27', '2005-08-19T04:54:27', '2'), + ('381', '1731', '2006-02-16T02:30:53', '2005-07-10T09:24:17', '2005-07-15T05:36:17', '1'), + ('381', '2852', '2006-02-16T02:30:53', '2005-08-19T23:25:43', '2005-08-22T18:41:43', '1'), + ('381', '3789', '2006-02-16T02:30:53', '2005-08-20T19:34:43', '2005-08-25T22:25:43', '2'), + ('344', '3622', '2006-02-16T02:30:53', '2005-08-21T18:17:59', '2005-08-23T14:16:59', '1'), + ('344', '3363', '2006-02-16T02:30:53', '2005-06-15T12:26:18', '2005-06-21T07:26:18', '2'), + ('344', '1906', '2006-02-16T02:30:53', '2005-08-22T16:55:26', '2005-08-25T20:19:26', '1'), + ('344', '1651', '2006-02-16T02:30:53', '2005-07-07T02:19:14', '2005-07-15T08:09:14', '2'), + ('344', '4367', '2006-02-16T02:30:53', '2005-07-31T10:28:21', '2005-08-09T13:45:21', '1'), + ('344', '3153', '2006-02-16T02:30:53', '2005-08-18T01:34:13', '2005-08-24T04:38:13', '1'), + ('344', '452', '2006-02-16T02:30:53', '2005-07-27T19:19:53', '2005-08-02T01:01:53', '1'), + ('344', '4', '2006-02-16T02:30:53', '2005-08-21T18:32:42', '2005-08-23T21:09:42', '1'), + ('344', '3400', '2006-02-16T02:30:53', '2005-08-19T07:56:08', '2005-08-21T10:20:08', '2'), + ('344', '1682', '2006-02-16T02:30:53', '2005-08-19T08:34:39', '2005-08-28T10:13:39', '1'), + ('344', '887', '2006-02-16T02:30:53', '2005-05-26T01:25:21', '2005-05-26T21:17:21', '2'), + ('344', '3698', '2006-02-16T02:30:53', '2005-06-16T15:32:12', '2005-06-19T18:58:12', '2'), + ('344', '434', '2006-02-16T02:30:53', '2005-08-02T08:34:40', '2005-08-09T04:56:40', '1'), + ('344', '1834', '2006-02-16T02:30:53', '2005-06-15T21:08:01', '2005-06-18T22:33:01', '2'), + ('344', '4167', '2006-02-16T02:30:53', '2005-07-11T21:13:19', '2005-07-20T15:44:19', '1'), + ('344', '2207', '2006-02-16T02:30:53', '2005-07-29T11:29:12', '2005-08-05T09:17:12', '1'), + ('344', '1964', '2006-02-16T02:30:53', '2005-07-07T18:58:57', '2005-07-14T16:35:57', '2'), + ('344', '4554', '2006-02-16T02:30:53', '2005-05-29T20:14:34', '2005-06-05T20:56:34', '1'), + ('4', '2980', '2006-02-16T02:30:53', '2005-07-30T18:58:00', '2005-08-03T15:14:00', '1'), + ('4', '1075', '2006-02-16T02:30:53', '2005-06-15T09:31:28', '2005-06-19T04:33:28', '1'), + ('4', '3822', '2006-02-16T02:30:53', '2005-08-20T12:55:40', '2005-08-28T09:06:40', '2'), + ('4', '2479', '2006-02-16T02:30:53', '2005-08-18T05:14:44', '2005-08-27T01:32:44', '2'), + ('4', '4311', '2006-02-16T02:30:53', '2005-08-02T08:20:31', '2005-08-04T05:06:31', '2'), + ('4', '3373', '2006-02-16T02:30:53', '2005-08-20T09:32:04', '2005-08-23T14:29:04', '2'), + ('4', '2065', '2006-02-16T02:30:53', '2005-06-19T09:39:01', '2005-06-25T08:33:01', '1'), + ('4', '280', '2006-02-16T02:30:53', '2005-06-16T08:08:40', '2005-06-17T11:12:40', '1'), + ('4', '132', '2006-02-16T02:30:53', '2005-08-19T02:19:13', '2005-08-23T07:49:13', '2'), + ('4', '3071', '2006-02-16T02:30:53', '2005-08-17T00:28:01', '2005-08-19T04:47:01', '2'), + ('4', '57', '2006-02-16T02:30:53', '2005-08-02T07:09:34', '2005-08-08T08:39:34', '1'), + ('4', '2495', '2006-02-16T02:30:53', '2005-06-17T14:31:12', '2005-06-19T11:04:12', '2'), + ('4', '3587', '2006-02-16T02:30:53', '2005-07-28T04:37:59', '2005-07-29T09:20:59', '2'), + ('4', '185', '2006-02-16T02:30:53', '2005-06-16T14:01:27', '2005-06-18T09:35:27', '1'), + ('4', '165', '2006-02-16T02:30:53', '2005-07-29T18:44:57', '2005-08-03T18:25:57', '2'), + ('4', '97', '2006-02-16T02:30:53', '2005-06-16T15:51:52', '2005-06-20T13:27:52', '1'), + ('4', '2553', '2006-02-16T02:30:53', '2005-08-22T13:58:23', '2005-08-28T14:33:23', '2'), + ('4', '1976', '2006-02-16T02:30:53', '2005-08-18T00:14:03', '2005-08-18T23:52:03', '2'), + ('4', '984', '2006-02-16T02:30:53', '2005-08-21T04:53:37', '2005-08-25T23:39:37', '2'), + ('4', '3308', '2006-02-16T02:30:53', '2005-08-23T07:43:00', '2005-08-27T10:47:00', '1'), + ('4', '4385', '2006-02-16T02:30:53', '2005-07-28T02:10:10', '2005-07-30T04:29:10', '2'), + ('4', '4117', '2006-02-16T02:30:53', '2005-07-30T08:46:09', '2005-08-05T10:34:09', '1'), + ('256', '480', '2006-02-16T02:30:53', '2005-06-17T09:17:39', '2005-06-18T12:35:39', '2'), + ('256', '2421', '2006-02-16T02:30:53', '2005-05-30T13:29:36', '2005-06-02T11:08:36', '1'), + ('256', '1769', '2006-02-16T02:30:53', '2005-08-21T12:47:53', '2005-08-30T17:09:53', '2'), + ('256', '1730', '2006-02-16T02:30:53', '2005-08-23T06:56:04', '2005-09-01T03:25:04', '1'), + ('256', '3080', '2006-02-16T02:30:53', '2005-07-07T10:28:00', '2005-07-08T12:50:00', '1'), + ('256', '3669', '2006-02-16T02:30:53', '2005-06-17T09:26:15', '2005-06-21T10:18:15', '1'), + ('256', '202', '2006-02-16T02:30:53', '2005-08-20T21:35:27', '2005-08-23T03:29:27', '1'), + ('256', '1859', '2006-02-16T02:30:53', '2005-08-23T16:15:45', '2005-09-01T11:37:45', '2'), + ('256', '4170', '2006-02-16T02:30:53', '2005-07-07T07:51:53', '2005-07-11T12:41:53', '2'), + ('256', '3528', '2006-02-16T02:30:53', '2005-08-01T20:22:51', '2005-08-07T22:07:51', '1'), + ('256', '3014', '2006-02-16T02:30:53', '2005-08-23T16:18:12', '2005-08-29T17:10:12', '2'), + ('256', '4413', '2006-02-16T02:30:53', '2005-06-18T15:00:04', '2005-06-24T13:29:04', '2'), + ('256', '3856', '2006-02-16T02:30:53', '2005-06-19T22:07:24', '2005-06-23T16:37:24', '2'), + ('256', '1220', '2006-02-16T02:30:53', '2005-08-20T00:33:22', '2005-08-26T21:37:22', '2'), + ('256', '2284', '2006-02-16T02:30:53', '2005-05-29T08:20:08', '2005-06-06T08:59:08', '2'), + ('256', '1082', '2006-02-16T02:30:53', '2005-08-20T07:50:08', '2005-08-21T07:11:08', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['51', '2230', '11628', '11011', '14003', '1555', '2561', '1116', '14445', '5179', '7661', '232', '6298', '9424', '15803', '779', '485', '5429', '12899', '327', '473', '13751', '5542', '15624', '1991', '14048', '5261', '9198', '1789', '7442', '9124', '2635', '10513', '6546', '5677', '12217', '9210', '15688', '13057', '8980', '1499', '11008', '10859', '10589', '3981', '307', '2236', '10672', '873', '4335', '15505', '1404', '12663', '12122', '7856', '8900', '10961', '5474', '412', '10274', '10640', '15004', '749', '13836', '6216', '6456', '841', '7497', '13034', '11682', '302', '12153', '14279', '10838', '697', '1465', '13645', '2981', '8090', '10564', '1464', '6517', '14979', '13082', '1127', '2068', '3378', '2100', '12936', '13772', '10519', '3881', '13348', '1288', '7248', '2103', '3743', '12188', '2192', '2146']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('256', '1257', '2006-02-16T02:30:53', '2005-05-25T06:49:10', '2005-05-26T06:42:10', '1'), + ('256', '833', '2006-02-16T02:30:53', '2005-06-18T03:50:49', '2005-06-25T01:12:49', '2'), + ('256', '3656', '2006-02-16T02:30:53', '2005-08-17T04:27:18', '2005-08-25T01:12:18', '2'), + ('256', '3981', '2006-02-16T02:30:53', '2005-08-02T05:07:07', '2005-08-09T07:16:07', '1'), + ('256', '3165', '2006-02-16T02:30:53', '2005-08-20T20:16:06', '2005-08-28T14:36:06', '1'), + ('256', '4168', '2006-02-16T02:30:53', '2005-06-16T02:17:07', '2005-06-22T06:28:07', '1'), + ('256', '4128', '2006-02-16T02:30:53', '2005-06-19T03:14:52', '2005-06-21T02:42:52', '2'), + ('256', '1356', '2006-02-16T02:30:53', '2005-05-31T16:10:46', '2005-06-01T20:27:46', '2'), + ('256', '3186', '2006-02-16T02:30:53', '2005-08-21T12:07:42', '2005-08-22T17:51:42', '2'), + ('256', '2995', '2006-02-16T02:30:53', '2005-07-09T10:00:44', '2005-07-11T06:52:44', '1'), + ('256', '3060', '2006-02-16T02:30:53', '2005-07-28T02:10:27', '2005-08-05T03:45:27', '2'), + ('256', '2945', '2006-02-16T02:30:53', '2005-05-26T11:38:05', '2005-05-27T08:42:05', '2'), + ('256', '3906', '2006-02-16T02:30:53', '2005-07-11T17:42:33', '2005-07-13T18:14:33', '2'), + ('256', '4499', '2006-02-16T02:30:53', '2005-07-30T21:10:56', '2005-08-05T00:01:56', '1'), + ('105', '500', '2006-02-16T02:30:53', '2005-08-23T14:27:07', '2005-08-28T12:01:07', '2'), + ('105', '533', '2006-02-16T02:30:53', '2005-05-29T14:17:17', '2005-06-06T16:46:17', '1'), + ('105', '2392', '2006-02-16T02:30:53', '2005-05-27T23:40:52', '2005-05-28T22:40:52', '2'), + ('105', '2467', '2006-02-16T02:30:53', '2005-07-09T21:14:03', '2005-07-18T01:33:03', '1'), + ('105', '830', '2006-02-16T02:30:53', '2005-08-19T04:03:34', '2005-08-20T08:34:34', '2'), + ('105', '2678', '2006-02-16T02:30:53', '2005-05-27T01:18:57', '2005-06-04T04:06:57', '1'), + ('105', '802', '2006-02-16T02:30:53', '2005-05-27T21:36:34', '2005-06-05T17:02:34', '1'), + ('105', '185', '2006-02-16T02:30:53', '2005-08-20T11:17:03', '2005-08-22T14:12:03', '2'), + ('105', '1713', '2006-02-16T02:30:53', '2005-07-10T02:45:53', '2005-07-15T23:23:53', '2'), + ('105', '396', '2006-02-16T02:30:53', '2005-08-23T07:24:27', '2005-08-29T12:36:27', '2'), + ('105', '3963', '2006-02-16T02:30:53', '2005-06-17T10:49:23', '2005-06-25T10:48:23', '1'), + ('105', '3475', '2006-02-16T02:30:53', '2005-08-20T22:03:18', '2005-08-25T02:57:18', '2'), + ('105', '2899', '2006-02-16T02:30:53', '2005-07-09T14:06:56', '2005-07-11T14:21:56', '2'), + ('105', '2371', '2006-02-16T02:30:53', '2005-07-30T12:37:08', '2005-08-07T16:37:08', '2'), + ('105', '4264', '2006-02-16T02:30:53', '2005-06-16T19:49:18', '2005-06-23T17:07:18', '2'), + ('105', '2471', '2006-02-16T02:30:53', '2005-07-27T17:47:00', '2005-07-28T21:37:00', '1'), + ('105', '4552', '2006-02-16T02:30:53', '2005-07-30T09:43:12', '2005-08-06T06:17:12', '1'), + ('105', '3332', '2006-02-16T02:30:53', '2005-06-19T09:08:45', '2005-06-26T09:20:45', '1'), + ('105', '4057', '2006-02-16T02:30:53', '2005-08-01T11:37:34', '2005-08-02T17:15:34', '2'), + ('105', '393', '2006-02-16T02:30:53', '2005-07-12T04:57:17', '2005-07-17T09:29:17', '2'), + ('105', '2647', '2006-02-16T02:30:53', '2005-07-10T08:41:28', '2005-07-12T09:05:28', '2'), + ('105', '2556', '2006-02-16T02:30:53', '2005-08-18T02:44:44', '2005-08-24T03:27:44', '1'), + ('105', '101', '2006-02-16T02:30:53', '2005-07-30T12:56:44', '2005-08-08T09:41:44', '2'), + ('105', '2851', '2006-02-16T02:30:53', '2005-08-23T09:48:45', '2005-08-30T10:28:45', '2'), + ('105', '876', '2006-02-16T02:30:53', '2005-08-19T09:40:05', '2005-08-28T13:22:05', '2'), + ('105', '3061', '2006-02-16T02:30:53', '2005-07-30T04:22:15', '2005-08-04T08:16:15', '1'), + ('375', '165', '2006-02-16T02:30:53', '2005-06-15T21:58:07', '2005-06-22T19:37:07', '2'), + ('375', '2831', '2006-02-16T02:30:53', '2005-08-02T05:06:17', '2005-08-10T01:22:17', '2'), + ('375', '277', '2006-02-16T02:30:53', '2005-08-02T00:11:39', '2005-08-08T19:52:39', '1'), + ('375', '4280', '2006-02-16T02:30:53', '2005-08-01T14:11:09', '2005-08-09T09:28:09', '2'), + ('375', '842', '2006-02-16T02:30:53', '2005-07-06T23:12:12', '2005-07-13T01:47:12', '2'), + ('375', '1097', '2006-02-16T02:30:53', '2005-05-26T21:48:13', '2005-06-04T22:24:13', '1'), + ('375', '4001', '2006-02-16T02:30:53', '2005-06-18T04:12:33', '2005-06-23T04:07:33', '1'), + ('375', '3674', '2006-02-16T02:30:53', '2005-08-01T17:10:54', '2005-08-07T12:19:54', '2'), + ('375', '4568', '2006-02-16T02:30:53', '2005-05-30T05:15:20', '2005-06-07T00:49:20', '2'), + ('375', '1332', '2006-02-16T02:30:53', '2005-07-07T18:33:57', '2005-07-11T13:23:57', '1'), + ('375', '1144', '2006-02-16T02:30:53', '2005-08-23T02:46:13', '2005-08-26T23:34:13', '2'), + ('375', '2776', '2006-02-16T02:30:53', '2005-06-15T16:38:53', '2005-06-16T20:37:53', '1'), + ('375', '1163', '2006-02-16T02:30:53', '2005-08-18T19:10:52', '2005-08-19T15:46:52', '1'), + ('375', '4030', '2006-02-16T02:30:53', '2005-08-17T23:20:45', '2005-08-25T04:23:45', '2'), + ('375', '2376', '2006-02-16T02:30:53', '2005-07-28T09:48:24', '2005-07-29T09:49:24', '2'), + ('375', '3057', '2006-02-16T02:30:53', '2005-07-30T01:07:03', '2005-08-06T04:07:03', '1'), + ('375', '1416', '2006-02-16T02:30:53', '2005-08-02T03:47:55', '2005-08-09T02:03:55', '1'), + ('375', '3608', '2006-02-16T02:30:53', '2005-07-09T23:23:57', '2005-07-15T03:11:57', '1'), + ('375', '1400', '2006-02-16T02:30:53', '2005-05-27T14:17:23', '2005-05-29T15:07:23', '2'), + ('375', '2916', '2006-02-16T02:30:53', '2005-08-01T03:16:51', '2005-08-04T22:22:51', '2'), + ('375', '3020', '2006-02-16T02:30:53', '2005-08-01T15:44:51', '2005-08-06T15:52:51', '1'), + ('375', '4464', '2006-02-16T02:30:53', '2005-08-22T08:15:21', '2005-08-28T10:35:21', '1'), + ('375', '1146', '2006-02-16T02:30:53', '2005-05-29T09:33:33', '2005-05-31T11:45:33', '2'), + ('375', '4271', '2006-02-16T02:30:53', '2005-08-20T14:18:16', '2005-08-21T18:13:16', '2'), + ('387', '3571', '2006-02-16T02:30:53', '2005-07-11T12:57:05', '2005-07-13T12:31:05', '1'), + ('387', '259', '2006-02-16T02:30:53', '2005-07-12T01:05:11', '2005-07-20T23:26:11', '2'), + ('387', '4318', '2006-02-16T02:30:53', '2005-05-30T00:31:17', '2005-06-02T19:14:17', '1'), + ('387', '286', '2006-02-16T02:30:53', '2005-07-27T20:05:27', '2005-07-30T22:47:27', '1'), + ('387', '990', '2006-02-16T02:30:53', '2005-08-19T08:41:29', '2005-08-20T07:36:29', '2'), + ('387', '2544', '2006-02-16T02:30:53', '2005-08-17T06:13:40', '2005-08-18T06:11:40', '1'), + ('387', '2921', '2006-02-16T02:30:53', '2005-05-26T21:13:46', '2005-06-03T15:49:46', '2'), + ('387', '3929', '2006-02-16T02:30:53', '2005-08-18T00:22:30', '2005-08-23T04:13:30', '2'), + ('387', '3325', '2006-02-16T02:30:53', '2005-08-21T06:39:08', '2005-08-29T11:01:08', '2'), + ('387', '69', '2006-02-16T02:30:53', '2005-08-01T23:36:10', '2005-08-05T04:55:10', '2'), + ('387', '3949', '2006-02-16T02:30:53', '2005-05-29T02:04:04', '2005-06-04T00:47:04', '2'), + ('387', '609', '2006-02-16T02:30:53', '2005-06-15T20:43:08', '2005-06-18T23:00:08', '1'), + ('387', '157', '2006-02-16T02:30:53', '2005-08-20T07:47:05', '2005-08-23T02:58:05', '1'), + ('387', '522', '2006-02-16T02:30:53', '2005-06-20T08:35:17', '2005-06-28T09:14:17', '1'), + ('387', '1336', '2006-02-16T02:30:53', '2005-07-28T18:27:29', '2005-08-02T14:08:29', '2'), + ('387', '4469', '2006-02-16T02:30:53', '2005-08-01T13:07:34', '2005-08-06T15:14:34', '2'), + ('387', '4113', '2006-02-16T02:30:53', '2005-06-15T20:38:14', '2005-06-17T14:52:14', '2'), + ('387', '185', '2006-02-16T02:30:53', '2005-07-12T03:52:39', '2005-07-20T08:00:39', '1'), + ('387', '2320', '2006-02-16T02:30:53', '2005-08-22T07:16:36', '2005-08-24T02:29:36', '2'), + ('387', '2117', '2006-02-16T02:30:53', '2005-08-19T10:19:19', '2005-08-28T05:02:19', '1'), + ('387', '2412', '2006-02-16T02:30:53', '2005-05-31T17:45:49', '2005-06-08T22:41:49', '2'), + ('387', '4252', '2006-02-16T02:30:53', '2005-06-17T16:11:46', '2005-06-20T11:28:46', '1'), + ('387', '35', '2006-02-16T02:30:53', '2005-06-21T13:51:28', '2005-06-25T09:21:28', '1'), + ('387', '2267', '2006-02-16T02:30:53', '2005-06-17T18:53:21', '2005-06-19T21:49:21', '2'), + ('387', '654', '2006-02-16T02:30:53', '2005-08-19T05:25:06', '2005-08-28T08:21:06', '1'), + ('387', '2038', '2006-02-16T02:30:53', '2005-08-20T11:47:52', '2005-08-28T05:50:52', '2'), + ('456', '1967', '2006-02-16T02:30:53', '2005-08-01T11:44:13', '2005-08-09T16:57:13', '1'), + ('456', '143', '2006-02-16T02:30:53', '2005-07-06T18:35:37', '2005-07-10T00:06:37', '2'), + ('456', '275', '2006-02-16T02:30:53', '2005-08-19T20:31:48', '2005-08-21T21:01:48', '1'), + ('456', '830', '2006-02-16T02:30:53', '2005-06-15T08:41:52', '2005-06-19T05:30:52', '2'), + ('456', '4256', '2006-02-16T02:30:53', '2005-07-27T10:37:45', '2005-08-01T13:13:45', '1'), + ('456', '1469', '2006-02-16T02:30:53', '2005-06-17T19:13:10', '2005-06-21T21:32:10', '2'), + ('456', '1012', '2006-02-16T02:30:53', '2005-07-06T12:03:54', '2005-07-13T10:56:54', '2'), + ('456', '2989', '2006-02-16T02:30:53', '2005-08-18T01:51:43', '2005-08-18T22:23:43', '1'), + ('456', '1886', '2006-02-16T02:30:53', '2005-06-18T01:35:47', '2005-06-23T23:38:47', '2'), + ('456', '326', '2006-02-16T02:30:53', '2005-06-17T22:26:23', '2005-06-26T17:10:23', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['1700', '2404', '13547', '19', '2581', '13144', '4141', '14690', '6023', '15720', '8749', '15910', '10813', '5964', '14253', '11356', '11866', '8462', '5110', '270', '2717', '1296', '15961', '3580', '14034', '14521', '6181', '10685', '6167', '2667', '7574', '2227', '15742', '15691', '9527', '1309', '13737', '6947', '3190', '8368', '6123', '1899', '14767', '15547', '11943', '4265', '12121', '11995', '13023', '9193', '5569', '14685', '6785', '3358', '10074', '14311', '9612', '3883', '12012', '6385', '4427', '765', '584', '12966', '6297', '1549', '8649', '10139', '9854', '11247', '14796', '8617', '3629', '4208', '8427', '13932', '8575', '8281', '823', '2328', '14878', '3695', '1602', '13739', '15070', '5811', '10846', '8237', '4084', '9644', '6642', '5129', '13483', '6636', '6941', '9145', '2503', '8279', '1062', '1291']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('456', '4251', '2006-02-16T02:30:53', '2005-06-16T13:18:23', '2005-06-21T16:46:23', '2'), + ('456', '4138', '2006-02-16T02:30:53', '2005-06-18T16:33:48', '2005-06-23T20:39:48', '2'), + ('456', '3122', '2006-02-16T02:30:53', '2005-08-20T03:53:16', '2005-08-25T04:02:16', '1'), + ('456', '1941', '2006-02-16T02:30:53', '2005-05-25T01:17:24', '2005-05-31T06:00:24', '1'), + ('456', '376', '2006-02-16T02:30:53', '2005-06-19T04:54:13', '2005-06-23T23:28:13', '2'), + ('456', '3766', '2006-02-16T02:30:53', '2005-08-19T12:45:55', '2005-08-27T10:37:55', '2'), + ('456', '1904', '2006-02-16T02:30:53', '2005-07-07T08:19:20', '2005-07-11T06:54:20', '1'), + ('456', '3649', '2006-02-16T02:30:53', '2005-08-21T20:42:25', '2005-08-29T18:42:25', '2'), + ('456', '3794', '2006-02-16T02:30:53', '2005-07-11T02:15:57', '2005-07-15T21:30:57', '2'), + ('456', '2490', '2006-02-16T02:30:53', '2005-08-23T11:15:20', '2005-08-31T09:49:20', '1'), + ('456', '2252', '2006-02-16T02:30:53', '2005-07-29T19:13:15', '2005-08-01T15:02:15', '1'), + ('456', '254', '2006-02-16T02:30:53', '2005-08-23T17:43:16', '2005-08-24T21:55:16', '2'), + ('456', '3580', '2006-02-16T02:30:53', '2005-08-01T22:43:00', '2005-08-03T21:43:00', '1'), + ('456', '3981', '2006-02-16T02:30:53', '2005-07-10T23:47:18', '2005-07-12T03:55:18', '2'), + ('456', '4246', '2006-02-16T02:30:53', '2005-08-21T05:47:52', '2005-08-25T04:28:52', '1'), + ('200', '303', '2006-02-16T02:30:53', '2005-08-02T17:42:40', '2005-08-11T23:29:40', '1'), + ('200', '2758', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('200', '3633', '2006-02-16T02:30:53', '2005-07-29T08:15:42', '2005-08-04T03:57:42', '1'), + ('200', '195', '2006-02-16T02:30:53', '2005-07-09T06:57:25', '2005-07-12T05:39:25', '2'), + ('200', '207', '2006-02-16T02:30:53', '2005-05-26T16:20:56', '2005-06-03T12:40:56', '2'), + ('200', '140', '2006-02-16T02:30:53', '2005-06-19T14:46:10', '2005-06-22T20:17:10', '1'), + ('200', '1760', '2006-02-16T02:30:53', '2005-06-15T09:23:59', '2005-06-19T03:44:59', '2'), + ('200', '4006', '2006-02-16T02:30:53', '2005-08-23T19:35:42', '2005-08-30T22:52:42', '1'), + ('200', '3837', '2006-02-16T02:30:53', '2005-07-06T03:48:44', '2005-07-13T01:15:44', '2'), + ('200', '3484', '2006-02-16T02:30:53', '2005-08-20T21:31:52', '2005-08-29T00:13:52', '1'), + ('200', '1538', '2006-02-16T02:30:53', '2005-08-21T15:01:32', '2005-08-28T19:12:32', '1'), + ('200', '4398', '2006-02-16T02:30:53', '2005-07-11T11:10:11', '2005-07-15T09:33:11', '1'), + ('200', '2029', '2006-02-16T02:30:53', '2005-08-01T17:49:38', '2005-08-07T21:04:38', '2'), + ('200', '3255', '2006-02-16T02:30:53', '2005-07-11T10:21:21', '2005-07-14T15:38:21', '1'), + ('200', '1028', '2006-02-16T02:30:53', '2005-06-19T11:28:46', '2005-06-27T11:48:46', '2'), + ('200', '298', '2006-02-16T02:30:53', '2005-07-27T22:53:00', '2005-07-29T18:39:00', '2'), + ('200', '3623', '2006-02-16T02:30:53', '2005-06-18T03:43:23', '2005-06-19T05:55:23', '2'), + ('200', '1339', '2006-02-16T02:30:53', '2005-08-23T12:11:37', '2005-08-31T07:28:37', '2'), + ('200', '784', '2006-02-16T02:30:53', '2005-08-23T09:53:54', '2005-08-27T10:14:54', '1'), + ('200', '2539', '2006-02-16T02:30:53', '2005-07-31T01:02:24', '2005-08-09T02:08:24', '2'), + ('200', '2356', '2006-02-16T02:30:53', '2005-06-15T10:10:49', '2005-06-16T12:44:49', '1'), + ('200', '4319', '2006-02-16T02:30:53', '2005-08-20T10:41:50', '2005-08-25T14:33:50', '2'), + ('200', '760', '2006-02-16T02:30:53', '2005-07-26T23:42:03', '2005-08-02T05:06:03', '2'), + ('200', '351', '2006-02-16T02:30:53', '2005-06-20T23:27:15', '2005-06-28T01:22:15', '2'), + ('200', '1410', '2006-02-16T02:30:53', '2005-07-29T05:15:41', '2005-08-07T01:35:41', '1'), + ('200', '1354', '2006-02-16T02:30:53', '2005-07-11T08:02:27', '2005-07-15T08:58:27', '2'), + ('200', '858', '2006-02-16T02:30:53', '2005-06-17T04:29:15', '2005-06-26T08:39:15', '1'), + ('69', '1232', '2006-02-16T02:30:53', '2005-08-21T23:43:00', '2005-08-29T05:26:00', '1'), + ('69', '1488', '2006-02-16T02:30:53', '2005-08-23T04:25:50', '2005-08-26T00:57:50', '1'), + ('69', '4466', '2006-02-16T02:30:53', '2005-08-17T17:00:42', '2005-08-26T22:07:42', '1'), + ('69', '1685', '2006-02-16T02:30:53', '2005-07-07T14:27:51', '2005-07-12T19:55:51', '2'), + ('69', '3423', '2006-02-16T02:30:53', '2005-08-17T23:20:40', '2005-08-22T21:30:40', '2'), + ('69', '3953', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('69', '1566', '2006-02-16T02:30:53', '2005-08-19T08:13:54', '2005-08-27T13:18:54', '1'), + ('69', '3470', '2006-02-16T02:30:53', '2005-07-30T12:28:42', '2005-08-02T12:17:42', '2'), + ('69', '2835', '2006-02-16T02:30:53', '2005-07-10T03:38:32', '2005-07-16T00:02:32', '2'), + ('69', '1320', '2006-02-16T02:30:53', '2005-08-21T20:31:25', '2005-08-22T21:02:25', '1'), + ('69', '4448', '2006-02-16T02:30:53', '2005-07-12T16:30:57', '2005-07-18T20:46:57', '1'), + ('69', '1772', '2006-02-16T02:30:53', '2005-06-21T11:56:40', '2005-06-26T08:28:40', '2'), + ('69', '1268', '2006-02-16T02:30:53', '2005-07-31T19:57:16', '2005-08-04T00:54:16', '1'), + ('69', '1761', '2006-02-16T02:30:53', '2005-08-21T07:45:47', '2005-08-27T02:23:47', '2'), + ('69', '2142', '2006-02-16T02:30:53', '2005-07-31T03:58:31', '2005-08-04T07:34:31', '2'), + ('69', '3238', '2006-02-16T02:30:53', '2005-07-06T18:39:38', '2005-07-14T15:59:38', '2'), + ('69', '2698', '2006-02-16T02:30:53', '2005-08-17T19:20:48', '2005-08-22T16:50:48', '1'), + ('69', '1830', '2006-02-16T02:30:53', '2005-07-11T22:07:32', '2005-07-20T16:57:32', '1'), + ('69', '1021', '2006-02-16T02:30:53', '2005-07-07T22:28:51', '2005-07-11T21:37:51', '2'), + ('69', '515', '2006-02-16T02:30:53', '2005-05-29T11:38:34', '2005-06-02T17:04:34', '1'), + ('69', '1833', '2006-02-16T02:30:53', '2005-05-28T11:49:00', '2005-06-01T11:54:00', '1'), + ('69', '3196', '2006-02-16T02:30:53', '2005-08-19T06:37:48', '2005-08-26T03:59:48', '2'), + ('69', '2738', '2006-02-16T02:30:53', '2005-07-11T17:37:22', '2005-07-19T13:54:22', '2'), + ('69', '266', '2006-02-16T02:30:53', '2005-06-16T01:57:15', '2005-06-18T23:30:15', '1'), + ('69', '789', '2006-02-16T02:30:53', '2005-07-29T14:57:33', '2005-08-07T09:43:33', '2'), + ('441', '407', '2006-02-16T02:30:53', '2005-07-31T22:02:20', '2005-08-04T02:09:20', '1'), + ('441', '1049', '2006-02-16T02:30:53', '2005-07-31T12:59:34', '2005-08-03T07:20:34', '2'), + ('441', '1661', '2006-02-16T02:30:53', '2005-08-02T13:34:08', '2005-08-06T16:23:08', '2'), + ('441', '941', '2006-02-16T02:30:53', '2005-08-22T00:40:49', '2005-08-30T03:59:49', '1'), + ('441', '385', '2006-02-16T02:30:53', '2005-07-29T13:46:14', '2005-08-06T13:26:14', '2'), + ('441', '4019', '2006-02-16T02:30:53', '2005-07-06T06:23:22', '2005-07-08T09:32:22', '2'), + ('441', '3617', '2006-02-16T02:30:53', '2005-07-07T11:34:22', '2005-07-09T08:25:22', '1'), + ('441', '1624', '2006-02-16T02:30:53', '2005-07-29T07:08:36', '2005-07-30T11:54:36', '2'), + ('441', '471', '2006-02-16T02:30:53', '2005-08-20T17:17:00', '2005-08-24T14:06:00', '1'), + ('441', '1668', '2006-02-16T02:30:53', '2005-07-29T11:52:47', '2005-08-03T08:14:47', '2'), + ('441', '899', '2006-02-16T02:30:53', '2005-07-29T01:46:00', '2005-08-04T23:09:00', '1'), + ('441', '3249', '2006-02-16T02:30:53', '2005-05-29T21:39:37', '2005-05-30T22:06:37', '1'), + ('441', '2304', '2006-02-16T02:30:53', '2005-06-18T10:17:21', '2005-06-21T04:18:21', '1'), + ('441', '1202', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('441', '2823', '2006-02-16T02:30:53', '2005-07-06T10:02:08', '2005-07-09T15:43:08', '1'), + ('441', '1777', '2006-02-16T02:30:53', '2005-06-16T06:12:40', '2005-06-19T03:50:40', '2'), + ('441', '3027', '2006-02-16T02:30:53', '2005-08-20T10:45:10', '2005-08-28T08:46:10', '2'), + ('441', '2687', '2006-02-16T02:30:53', '2005-08-22T10:55:45', '2005-08-26T09:23:45', '1'), + ('441', '4007', '2006-02-16T02:30:53', '2005-07-10T15:27:04', '2005-07-12T17:20:04', '1'), + ('441', '2277', '2006-02-16T02:30:53', '2005-08-01T23:47:54', '2005-08-08T01:10:54', '1'), + ('441', '608', '2006-02-16T02:30:53', '2005-07-29T00:29:56', '2005-08-06T03:10:56', '1'), + ('441', '2588', '2006-02-16T02:30:53', '2005-07-07T05:16:00', '2005-07-15T09:23:00', '1'), + ('441', '4577', '2006-02-16T02:30:53', '2005-07-31T05:40:35', '2005-08-09T08:18:35', '1'), + ('441', '201', '2006-02-16T02:30:53', '2005-07-12T10:37:52', '2005-07-13T15:13:52', '1'), + ('441', '4516', '2006-02-16T02:30:53', '2005-07-09T07:28:33', '2005-07-14T05:12:33', '2'), + ('441', '2550', '2006-02-16T02:30:53', '2005-08-20T01:16:38', '2005-08-21T20:43:38', '2'), + ('441', '3270', '2006-02-16T02:30:53', '2005-07-12T09:49:46', '2005-07-14T12:15:46', '1'), + ('441', '1575', '2006-02-16T02:30:53', '2005-07-26T23:18:49', '2005-07-31T00:23:49', '2'), + ('176', '559', '2006-02-16T02:30:53', '2005-07-30T10:27:55', '2005-08-07T14:41:55', '2'), + ('176', '2486', '2006-02-16T02:30:53', '2005-06-18T23:17:19', '2005-06-23T03:57:19', '2'), + ('176', '3838', '2006-02-16T02:30:53', '2005-07-29T01:43:37', '2005-08-03T02:36:37', '1'), + ('176', '2223', '2006-02-16T02:30:53', '2005-05-31T08:38:20', '2005-06-09T08:23:20', '2'), + ('176', '3090', '2006-02-16T02:30:53', '2005-06-15T08:55:01', '2005-06-24T04:22:01', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['11678', '7521', '10441', '12299', '6354', '13186', '7210', '15311', '663', '7025', '380', '2922', '3643', '2181', '14083', '1741', '4121', '553', '12718', '2218', '172', '15933', '7751', '14232', '13170', '1836', '6035', '2427', '3931', '10862', '10277', '7017', '12916', '8163', '9958', '642', '8347', '11249', '13214', '9237', '8576', '7110', '7499', '13481', '9264', '4435', '8827', '3739', '352', '11335', '10203', '8337', '4919', '13097', '8707', '4253', '13728', '2340', '12213', '5862', '7195', '14974', '12464', '15335', '14983', '9968', '6878', '733', '14694', '9977', '6705', '1569', '7708', '12189', '7256', '1426', '5687', '8522', '3281', '10339', '8841', '3726', '6140', '13706', '8804', '5758', '15279', '12760', '1847', '6821', '2540', '8121', '464', '8379', '12384', '8431', '15344', '9079', '13608', '14679']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('176', '3511', '2006-02-16T02:30:53', '2005-08-17T06:07:39', '2005-08-21T10:51:39', '2'), + ('176', '3144', '2006-02-16T02:30:53', '2005-07-27T21:04:42', '2005-08-03T16:06:42', '1'), + ('176', '4122', '2006-02-16T02:30:53', '2005-08-01T08:55:56', '2005-08-03T10:26:56', '2'), + ('176', '892', '2006-02-16T02:30:53', '2005-08-18T05:32:32', '2005-08-22T08:14:32', '2'), + ('176', '3203', '2006-02-16T02:30:53', '2005-07-11T20:54:27', '2005-07-18T23:46:27', '2'), + ('176', '2802', '2006-02-16T02:30:53', '2005-08-19T14:23:19', '2005-08-28T11:26:19', '1'), + ('176', '1984', '2006-02-16T02:30:53', '2005-07-27T09:19:05', '2005-07-28T04:35:05', '1'), + ('176', '3612', '2006-02-16T02:30:53', '2005-08-22T19:56:52', '2005-08-31T20:15:52', '2'), + ('176', '3997', '2006-02-16T02:30:53', '2005-05-28T21:23:02', '2005-06-02T17:39:02', '2'), + ('176', '3530', '2006-02-16T02:30:53', '2005-07-27T02:40:29', '2005-07-29T23:02:29', '2'), + ('176', '1777', '2006-02-16T02:30:53', '2005-05-27T09:34:39', '2005-06-04T11:45:39', '1'), + ('176', '1671', '2006-02-16T02:30:53', '2005-06-20T04:13:47', '2005-06-22T04:38:47', '2'), + ('176', '845', '2006-02-16T02:30:53', '2005-07-06T07:20:08', '2005-07-11T07:01:08', '1'), + ('176', '3481', '2006-02-16T02:30:53', '2005-06-18T00:48:31', '2005-06-25T06:43:31', '2'), + ('176', '1823', '2006-02-16T02:30:53', '2005-08-20T23:42:31', '2005-08-28T21:44:31', '1'), + ('176', '3722', '2006-02-16T02:30:53', '2005-06-16T16:31:37', '2005-06-25T21:38:37', '1'), + ('176', '2429', '2006-02-16T02:30:53', '2005-07-07T07:13:50', '2005-07-13T04:32:50', '2'), + ('176', '1349', '2006-02-16T02:30:53', '2005-05-28T08:14:44', '2005-06-02T03:01:44', '2'), + ('176', '3221', '2006-02-16T02:30:53', '2005-08-18T21:21:44', '2005-08-20T01:01:44', '1'), + ('176', '3577', '2006-02-16T02:30:53', '2005-06-18T03:13:13', '2005-06-18T21:16:13', '1'), + ('176', '2873', '2006-02-16T02:30:53', '2005-05-26T03:17:42', '2005-05-29T04:11:42', '2'), + ('176', '3493', '2006-02-16T02:30:53', '2005-08-23T18:36:44', '2005-08-26T12:41:44', '2'), + ('176', '4425', '2006-02-16T02:30:53', '2005-07-28T05:56:13', '2005-08-05T08:08:13', '1'), + ('176', '2710', '2006-02-16T02:30:53', '2005-08-21T05:07:02', '2005-08-29T06:57:02', '1'), + ('176', '1072', '2006-02-16T02:30:53', '2005-08-19T13:45:48', '2005-08-27T11:00:48', '2'), + ('176', '2753', '2006-02-16T02:30:53', '2005-06-16T23:13:05', '2005-06-24T01:40:05', '2'), + ('176', '3474', '2006-02-16T02:30:53', '2005-07-11T03:01:45', '2005-07-14T01:04:45', '2'), + ('176', '4278', '2006-02-16T02:30:53', '2005-06-18T17:45:00', '2005-06-27T20:07:00', '2'), + ('176', '182', '2006-02-16T02:30:53', '2005-07-06T21:03:46', '2005-07-16T01:32:46', '1'), + ('176', '1077', '2006-02-16T02:30:53', '2005-08-02T00:17:34', '2005-08-08T00:31:34', '2'), + ('176', '1472', '2006-02-16T02:30:53', '2005-08-01T03:22:41', '2005-08-05T05:07:41', '1'), + ('176', '753', '2006-02-16T02:30:53', '2005-07-27T02:16:03', '2005-07-31T07:49:03', '1'), + ('157', '2277', '2006-02-16T02:30:53', '2005-08-19T04:27:05', '2005-08-21T02:33:05', '2'), + ('157', '1919', '2006-02-16T02:30:53', '2005-07-28T21:11:48', '2005-07-31T18:30:48', '1'), + ('157', '4142', '2006-02-16T02:30:53', '2005-07-31T16:03:56', '2005-08-04T15:21:56', '2'), + ('157', '140', '2006-02-16T02:30:53', '2005-05-28T18:49:12', '2005-06-01T20:50:12', '2'), + ('157', '4407', '2006-02-16T02:30:53', '2005-07-29T04:49:25', '2005-07-31T00:57:25', '2'), + ('157', '3394', '2006-02-16T02:30:53', '2005-08-02T13:35:40', '2005-08-07T11:22:40', '1'), + ('157', '2675', '2006-02-16T02:30:53', '2005-08-19T15:31:06', '2005-08-20T19:58:06', '2'), + ('157', '2777', '2006-02-16T02:30:53', '2005-07-30T13:48:17', '2005-07-31T13:57:17', '2'), + ('157', '3552', '2006-02-16T02:30:53', '2005-07-29T11:55:01', '2005-08-03T08:41:01', '2'), + ('157', '3289', '2006-02-16T02:30:53', '2005-07-27T05:30:48', '2005-07-28T01:43:48', '1'), + ('157', '3503', '2006-02-16T02:30:53', '2005-07-27T20:10:28', '2005-07-30T16:24:28', '1'), + ('157', '2678', '2006-02-16T02:30:53', '2005-08-20T01:11:12', '2005-08-26T23:07:12', '2'), + ('157', '4071', '2006-02-16T02:30:53', '2005-07-30T14:51:36', '2005-08-02T10:06:36', '1'), + ('157', '3815', '2006-02-16T02:30:53', '2005-07-07T22:51:04', '2005-07-14T23:15:04', '2'), + ('157', '1517', '2006-02-16T02:30:53', '2005-07-29T22:31:24', '2005-08-06T21:05:24', '2'), + ('157', '4333', '2006-02-16T02:30:53', '2005-07-06T11:54:18', '2005-07-09T10:48:18', '1'), + ('157', '4369', '2006-02-16T02:30:53', '2005-05-27T05:48:19', '2005-05-29T09:05:19', '1'), + ('157', '2968', '2006-02-16T02:30:53', '2005-08-02T16:57:37', '2005-08-09T19:43:37', '1'), + ('157', '1096', '2006-02-16T02:30:53', '2005-08-01T00:45:27', '2005-08-04T22:45:27', '2'), + ('157', '752', '2006-02-16T02:30:53', '2005-07-29T04:31:55', '2005-08-02T02:38:55', '2'), + ('157', '2106', '2006-02-16T02:30:53', '2005-07-08T21:41:54', '2005-07-11T23:14:54', '1'), + ('157', '4194', '2006-02-16T02:30:53', '2005-08-19T10:50:43', '2005-08-24T11:10:43', '2'), + ('157', '2525', '2006-02-16T02:30:53', '2005-07-29T17:21:58', '2005-08-02T14:47:58', '2'), + ('157', '3355', '2006-02-16T02:30:53', '2005-07-07T14:13:13', '2005-07-16T18:55:13', '2'), + ('157', '1962', '2006-02-16T02:30:53', '2005-08-20T10:11:07', '2005-08-23T10:32:07', '1'), + ('157', '1913', '2006-02-16T02:30:53', '2005-06-18T11:30:56', '2005-06-23T06:00:56', '1'), + ('157', '4058', '2006-02-16T02:30:53', '2005-08-18T02:33:55', '2005-08-24T03:14:55', '1'), + ('157', '2075', '2006-02-16T02:30:53', '2005-07-10T18:20:48', '2005-07-17T00:09:48', '1'), + ('157', '721', '2006-02-16T02:30:53', '2005-07-27T08:47:01', '2005-07-30T08:40:01', '2'), + ('157', '2596', '2006-02-16T02:30:53', '2005-08-22T07:04:25', '2005-08-27T12:39:25', '1'), + ('157', '1954', '2006-02-16T02:30:53', '2005-08-18T11:33:34', '2005-08-27T14:33:34', '1'), + ('363', '1593', '2006-02-16T02:30:53', '2005-08-22T20:44:55', '2005-08-28T21:43:55', '1'), + ('363', '3579', '2006-02-16T02:30:53', '2005-08-22T07:32:23', '2005-08-30T11:39:23', '2'), + ('363', '2666', '2006-02-16T02:30:53', '2005-07-31T16:32:16', '2005-08-08T12:23:16', '1'), + ('363', '2428', '2006-02-16T02:30:53', '2005-07-12T20:37:13', '2005-07-19T20:13:13', '2'), + ('363', '2951', '2006-02-16T02:30:53', '2005-05-29T07:35:21', '2005-06-05T09:14:21', '1'), + ('363', '2767', '2006-02-16T02:30:53', '2005-08-21T20:46:42', '2005-08-23T16:18:42', '1'), + ('363', '2300', '2006-02-16T02:30:53', '2005-07-31T16:58:42', '2005-08-09T13:34:42', '1'), + ('363', '4268', '2006-02-16T02:30:53', '2005-07-12T12:53:11', '2005-07-13T07:17:11', '1'), + ('363', '3927', '2006-02-16T02:30:53', '2005-06-16T03:19:09', '2005-06-18T21:55:09', '2'), + ('363', '398', '2006-02-16T02:30:53', '2005-07-28T04:19:15', '2005-08-04T04:41:15', '1'), + ('363', '1764', '2006-02-16T02:30:53', '2005-08-18T01:51:44', '2005-08-26T01:01:44', '1'), + ('363', '4275', '2006-02-16T02:30:53', '2005-07-27T10:58:32', '2005-07-29T08:58:32', '2'), + ('363', '4412', '2006-02-16T02:30:53', '2005-06-15T18:16:24', '2005-06-18T22:15:24', '2'), + ('363', '2170', '2006-02-16T02:30:53', '2005-07-10T09:07:19', '2005-07-16T11:17:19', '2'), + ('363', '3636', '2006-02-16T02:30:53', '2005-07-29T10:16:19', '2005-08-06T14:58:19', '1'), + ('363', '4006', '2006-02-16T02:30:53', '2005-06-21T06:08:47', '2005-06-24T11:22:47', '1'), + ('363', '615', '2006-02-16T02:30:53', '2005-08-01T05:05:50', '2005-08-10T07:15:50', '2'), + ('363', '3935', '2006-02-16T02:30:53', '2005-07-29T22:56:07', '2005-08-01T21:21:07', '2'), + ('363', '742', '2006-02-16T02:30:53', '2005-07-06T11:15:49', '2005-07-11T05:54:49', '2'), + ('363', '2749', '2006-02-16T02:30:53', '2005-07-11T08:40:47', '2005-07-14T07:26:47', '1'), + ('363', '3005', '2006-02-16T02:30:53', '2005-08-20T09:32:56', '2005-08-28T05:22:56', '2'), + ('363', '4461', '2006-02-16T02:30:53', '2005-07-29T21:28:19', '2005-08-01T20:15:19', '2'), + ('363', '502', '2006-02-16T02:30:53', '2005-07-10T12:42:43', '2005-07-16T10:18:43', '2'), + ('363', '1088', '2006-02-16T02:30:53', '2005-08-22T19:08:49', '2005-08-30T00:38:49', '2'), + ('363', '4188', '2006-02-16T02:30:53', '2005-08-18T23:03:19', '2005-08-24T17:53:19', '1'), + ('363', '1189', '2006-02-16T02:30:53', '2005-06-17T00:05:22', '2005-06-20T21:09:22', '1'), + ('363', '623', '2006-02-16T02:30:53', '2005-07-12T18:22:10', '2005-07-14T13:25:10', '2'), + ('363', '4305', '2006-02-16T02:30:53', '2005-06-19T02:04:48', '2005-06-20T22:42:48', '2'), + ('363', '2229', '2006-02-16T02:30:53', '2005-07-28T19:25:45', '2005-08-02T13:30:45', '2'), + ('193', '1313', '2006-02-16T02:30:53', '2005-05-27T20:42:44', '2005-05-30T00:49:44', '2'), + ('193', '3907', '2006-02-16T02:30:53', '2005-07-29T05:29:40', '2005-08-06T05:56:40', '2'), + ('193', '2557', '2006-02-16T02:30:53', '2005-08-18T08:36:58', '2005-08-23T05:08:58', '1'), + ('193', '1583', '2006-02-16T02:30:53', '2005-07-29T07:12:48', '2005-08-01T10:03:48', '1'), + ('193', '3560', '2006-02-16T02:30:53', '2005-08-22T21:01:48', '2005-08-27T15:47:48', '1'), + ('193', '2143', '2006-02-16T02:30:53', '2005-07-30T08:02:00', '2005-07-31T04:02:00', '2'), + ('193', '4110', '2006-02-16T02:30:53', '2005-08-20T06:10:44', '2005-08-24T07:08:44', '1'), + ('193', '1520', '2006-02-16T02:30:53', '2005-08-21T20:14:58', '2005-08-23T23:39:58', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['14927', '15495', '12658', '9575', '10462', '4892', '13529', '3297', '15729', '1325', '8211', '2841', '273', '2880', '2846', '15164', '2377', '7049', '4100', '9388', '15210', '13673', '5381', '5440', '11229', '10026', '7578', '14783', '1000', '7934', '4302', '10307', '7577', '5388', '5277', '11564', '9324', '15194', '7418', '5116', '8173', '9921', '600', '12318', '10439', '9827', '9024', '4674', '1183', '4415', '7980', '9219', '10490', '8941', '12659', '11130', '4076', '10473', '4465', '9381', '3976', '8460', '3053', '2024', '14900', '11169', '2010', '2151', '2702', '13627', '11697', '2303', '3268', '15308', '15011', '8172', '3052', '3212', '11970', '14869', '260', '11072', '14446', '570', '10734', '9149', '2393', '2268', '13463', '13740', '12774', '10570', '14077', '12131', '2830', '13399', '7994', '2235', '14161', '463']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('193', '952', '2006-02-16T02:30:53', '2005-08-22T05:31:53', '2005-08-27T07:04:53', '1'), + ('193', '4310', '2006-02-16T02:30:53', '2005-08-23T02:26:10', '2005-08-30T01:07:10', '2'), + ('193', '4320', '2006-02-16T02:30:53', '2005-08-18T19:05:42', '2005-08-19T19:08:42', '1'), + ('193', '3971', '2006-02-16T02:30:53', '2005-07-31T02:51:53', '2005-08-03T20:54:53', '2'), + ('193', '4526', '2006-02-16T02:30:53', '2005-08-01T09:38:28', '2005-08-02T09:52:28', '2'), + ('193', '3566', '2006-02-16T02:30:53', '2005-07-08T20:06:25', '2005-07-14T20:04:25', '1'), + ('193', '1979', '2006-02-16T02:30:53', '2005-08-20T03:07:47', '2005-08-21T21:50:47', '1'), + ('193', '3969', '2006-02-16T02:30:53', '2005-06-21T07:08:19', '2005-06-28T11:53:19', '2'), + ('193', '2699', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('193', '52', '2006-02-16T02:30:53', '2005-06-15T11:03:24', '2005-06-20T10:54:24', '1'), + ('193', '1859', '2006-02-16T02:30:53', '2005-07-28T23:34:22', '2005-08-04T21:18:22', '1'), + ('193', '614', '2006-02-16T02:30:53', '2005-06-19T22:21:06', '2005-06-28T00:56:06', '1'), + ('193', '1590', '2006-02-16T02:30:53', '2005-05-26T16:29:36', '2005-05-29T18:49:36', '2'), + ('193', '1700', '2006-02-16T02:30:53', '2005-06-20T01:24:54', '2005-06-23T02:42:54', '2'), + ('193', '651', '2006-02-16T02:30:53', '2005-06-19T22:52:14', '2005-06-22T17:12:14', '1'), + ('193', '997', '2006-02-16T02:30:53', '2005-08-22T14:47:53', '2005-08-25T16:05:53', '1'), + ('193', '3568', '2006-02-16T02:30:53', '2005-06-18T14:56:23', '2005-06-27T12:36:23', '1'), + ('332', '3043', '2006-02-16T02:30:53', '2005-07-27T03:32:41', '2005-08-04T08:32:41', '2'), + ('332', '2346', '2006-02-16T02:30:53', '2005-07-07T06:20:52', '2005-07-15T05:58:52', '2'), + ('332', '2116', '2006-02-16T02:30:53', '2005-07-30T19:27:22', '2005-08-08T15:31:22', '2'), + ('332', '3811', '2006-02-16T02:30:53', '2005-08-22T16:37:36', '2005-08-29T11:54:36', '1'), + ('332', '343', '2006-02-16T02:30:53', '2005-08-20T08:27:30', '2005-08-26T05:14:30', '1'), + ('332', '3033', '2006-02-16T02:30:53', '2005-07-09T19:11:11', '2005-07-13T17:10:11', '2'), + ('332', '138', '2006-02-16T02:30:53', '2005-07-09T21:45:17', '2005-07-11T22:43:17', '2'), + ('332', '941', '2006-02-16T02:30:53', '2005-08-02T12:56:37', '2005-08-11T11:13:37', '2'), + ('332', '39', '2006-02-16T02:30:53', '2005-07-31T18:31:51', '2005-08-03T21:14:51', '2'), + ('332', '4210', '2006-02-16T02:30:53', '2005-07-27T22:58:17', '2005-07-29T23:14:17', '1'), + ('332', '3419', '2006-02-16T02:30:53', '2005-08-22T00:21:57', '2005-08-28T01:27:57', '2'), + ('332', '1774', '2006-02-16T02:30:53', '2005-05-31T00:25:56', '2005-06-08T19:42:56', '2'), + ('332', '2642', '2006-02-16T02:30:53', '2005-07-28T12:33:10', '2005-08-04T07:40:10', '2'), + ('332', '3669', '2006-02-16T02:30:53', '2005-07-07T16:47:53', '2005-07-16T22:22:53', '2'), + ('332', '975', '2006-02-16T02:30:53', '2005-08-01T04:21:54', '2005-08-04T09:24:54', '2'), + ('332', '2723', '2006-02-16T02:30:53', '2005-07-27T22:56:07', '2005-08-05T21:23:07', '2'), + ('332', '1546', '2006-02-16T02:30:53', '2005-07-09T19:25:25', '2005-07-14T19:51:25', '2'), + ('332', '2026', '2006-02-16T02:30:53', '2005-07-09T14:40:42', '2005-07-16T14:18:42', '2'), + ('332', '2237', '2006-02-16T02:30:53', '2005-08-17T01:27:49', '2005-08-19T22:07:49', '1'), + ('332', '1231', '2006-02-16T02:30:53', '2005-07-30T17:28:52', '2005-08-06T19:02:52', '1'), + ('332', '1217', '2006-02-16T02:30:53', '2005-08-22T16:07:34', '2005-08-26T19:16:34', '1'), + ('332', '3029', '2006-02-16T02:30:53', '2005-07-27T16:59:09', '2005-07-29T15:08:09', '2'), + ('332', '2491', '2006-02-16T02:30:53', '2005-07-09T07:10:12', '2005-07-14T09:16:12', '2'), + ('332', '4377', '2006-02-16T02:30:53', '2005-07-28T21:35:44', '2005-08-06T19:15:44', '2'), + ('332', '1004', '2006-02-16T02:30:53', '2005-07-31T14:59:21', '2005-08-01T12:40:21', '2'), + ('332', '1567', '2006-02-16T02:30:53', '2005-05-28T14:08:19', '2005-06-03T11:57:19', '2'), + ('332', '3694', '2006-02-16T02:30:53', '2005-08-18T06:21:56', '2005-08-27T06:07:56', '1'), + ('332', '2711', '2006-02-16T02:30:53', '2005-08-01T08:54:26', '2005-08-08T14:04:26', '1'), + ('329', '3840', '2006-02-16T02:30:53', '2005-07-31T11:56:55', '2005-08-09T16:29:55', '1'), + ('329', '164', '2006-02-16T02:30:53', '2005-07-30T05:44:42', '2005-08-05T03:15:42', '2'), + ('329', '1617', '2006-02-16T02:30:53', '2005-07-08T10:19:28', '2005-07-12T12:54:28', '2'), + ('329', '706', '2006-02-16T02:30:53', '2005-06-15T00:49:19', '2005-06-20T04:33:19', '1'), + ('329', '1403', '2006-02-16T02:30:53', '2005-07-07T22:01:43', '2005-07-13T03:09:43', '2'), + ('329', '1019', '2006-02-16T02:30:53', '2005-07-28T14:16:49', '2005-08-05T09:20:49', '1'), + ('329', '771', '2006-02-16T02:30:53', '2005-07-30T13:15:21', '2005-08-01T11:39:21', '1'), + ('329', '4365', '2006-02-16T02:30:53', '2005-08-01T10:37:11', '2005-08-03T10:01:11', '2'), + ('329', '4147', '2006-02-16T02:30:53', '2005-07-30T02:59:21', '2005-08-02T05:18:21', '2'), + ('329', '336', '2006-02-16T02:30:53', '2005-08-18T19:05:49', '2005-08-24T22:12:49', '2'), + ('329', '684', '2006-02-16T02:30:53', '2005-08-02T09:08:59', '2005-08-09T07:50:59', '2'), + ('329', '3148', '2006-02-16T02:30:53', '2005-07-07T04:52:15', '2005-07-13T23:22:15', '1'), + ('329', '3034', '2006-02-16T02:30:53', '2005-08-01T09:56:24', '2005-08-10T12:36:24', '2'), + ('329', '2877', '2006-02-16T02:30:53', '2005-07-08T00:07:45', '2005-07-13T18:08:45', '2'), + ('329', '4064', '2006-02-16T02:30:53', '2005-07-30T19:23:04', '2005-07-31T23:37:04', '2'), + ('329', '2424', '2006-02-16T02:30:53', '2005-07-06T23:00:20', '2005-07-07T21:51:20', '2'), + ('329', '2826', '2006-02-16T02:30:53', '2005-07-29T08:08:03', '2005-08-07T06:53:03', '2'), + ('329', '818', '2006-02-16T02:30:53', '2005-06-20T13:10:30', '2005-06-25T17:22:30', '2'), + ('329', '2566', '2006-02-16T02:30:53', '2005-06-17T13:00:51', '2005-06-22T07:03:51', '1'), + ('329', '3420', '2006-02-16T02:30:53', '2005-08-22T04:27:48', '2005-08-25T03:50:48', '2'), + ('329', '2392', '2006-02-16T02:30:53', '2005-08-02T10:19:42', '2005-08-07T05:45:42', '1'), + ('329', '2845', '2006-02-16T02:30:53', '2005-06-17T11:54:15', '2005-06-21T05:55:15', '1'), + ('329', '407', '2006-02-16T02:30:53', '2005-06-17T22:52:37', '2005-06-20T22:00:37', '1'), + ('329', '1736', '2006-02-16T02:30:53', '2005-06-19T13:35:56', '2005-06-20T14:07:56', '2'), + ('329', '603', '2006-02-16T02:30:53', '2005-08-20T06:59:00', '2005-08-29T11:43:00', '2'), + ('329', '383', '2006-02-16T02:30:53', '2005-08-17T07:09:19', '2005-08-19T02:02:19', '1'), + ('329', '1524', '2006-02-16T02:30:53', '2005-06-18T08:27:59', '2005-06-22T10:58:59', '1'), + ('329', '4366', '2006-02-16T02:30:53', '2005-06-21T04:55:49', '2005-06-30T00:23:49', '2'), + ('329', '987', '2006-02-16T02:30:53', '2005-08-22T19:54:31', '2005-08-26T23:09:31', '1'), + ('329', '2722', '2006-02-16T02:30:53', '2005-08-22T08:31:07', '2005-08-24T04:47:07', '1'), + ('329', '1237', '2006-02-16T02:30:53', '2005-07-28T21:34:36', '2005-08-06T23:53:36', '1'), + ('329', '2359', '2006-02-16T02:30:53', '2005-06-20T13:09:19', '2005-06-29T11:55:19', '2'), + ('21', '4178', '2006-02-16T02:30:53', '2005-06-21T01:04:35', '2005-06-30T00:10:35', '2'), + ('21', '1779', '2006-02-16T02:30:53', '2005-08-17T17:53:09', '2005-08-24T14:41:09', '1'), + ('21', '455', '2006-02-16T02:30:53', '2005-08-22T03:20:26', '2005-08-23T05:25:26', '2'), + ('21', '435', '2006-02-16T02:30:53', '2005-05-26T15:42:20', '2005-05-31T13:21:20', '2'), + ('21', '3078', '2006-02-16T02:30:53', '2005-08-02T07:10:57', '2005-08-04T07:42:57', '1'), + ('21', '4367', '2006-02-16T02:30:53', '2005-08-21T12:10:41', '2005-08-26T14:42:41', '1'), + ('21', '1122', '2006-02-16T02:30:53', '2005-05-28T10:15:04', '2005-05-30T08:32:04', '1'), + ('21', '1130', '2006-02-16T02:30:53', '2005-08-01T19:28:47', '2005-08-03T00:41:47', '2'), + ('21', '2632', '2006-02-16T02:30:53', '2005-07-30T10:45:12', '2005-08-01T09:40:12', '1'), + ('21', '3143', '2006-02-16T02:30:53', '2005-06-18T15:37:55', '2005-06-25T17:11:55', '1'), + ('21', '4380', '2006-02-16T02:30:53', '2005-06-18T06:13:41', '2005-06-22T08:53:41', '2'), + ('21', '510', '2006-02-16T02:30:53', '2005-08-20T00:50:54', '2005-08-28T23:00:54', '1'), + ('21', '4366', '2006-02-16T02:30:53', '2005-08-20T10:48:43', '2005-08-29T15:30:43', '1'), + ('21', '3601', '2006-02-16T02:30:53', '2005-08-18T23:34:22', '2005-08-28T05:00:22', '2'), + ('21', '369', '2006-02-16T02:30:53', '2005-08-01T13:23:06', '2005-08-05T15:30:06', '2'), + ('21', '3184', '2006-02-16T02:30:53', '2005-08-20T23:24:07', '2005-08-29T02:53:07', '1'), + ('21', '3380', '2006-02-16T02:30:53', '2005-08-17T23:34:16', '2005-08-26T01:18:16', '1'), + ('21', '2080', '2006-02-16T02:30:53', '2005-06-19T21:14:33', '2005-06-21T17:46:33', '1'), + ('21', '2309', '2006-02-16T02:30:53', '2005-08-19T22:09:28', '2005-08-25T20:25:28', '2'), + ('21', '2431', '2006-02-16T02:30:53', '2005-07-28T14:56:54', '2005-07-30T09:56:54', '2'), + ('21', '3463', '2006-02-16T02:30:53', '2005-06-18T04:08:50', '2005-06-27T07:58:50', '1'), + ('21', '2744', '2006-02-16T02:30:53', '2005-08-21T02:51:59', '2005-08-28T21:38:59', '2'), + ('21', '826', '2006-02-16T02:30:53', '2005-05-27T20:11:47', '2005-06-04T21:18:47', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['13381', '5961', '9699', '12660', '13411', '5772', '8862', '13699', '14933', '5107', '6943', '8196', '14713', '4746', '6793', '10067', '4080', '6169', '1517', '1501', '14965', '682', '2751', '15541', '15237', '8394', '2843', '12029', '5372', '6640', '4950', '3653', '14629', '7693', '7865', '7656', '9594', '8331', '8578', '10830', '14055', '8111', '9023', '11357', '2847', '14184', '9106', '12038', '12512', '8626', '9530', '14155', '12944', '15379', '14879', '5034', '12983', '15586', '9305', '7873', '8487', '11688', '2819', '14518', '4598', '145', '3680', '13847', '12470', '11093', '2506', '9277', '3332', '9447', '15516', '14892', '13032', '5746', '1570', '288', '1438', '6708', '6082', '7733', '9686', '8340', '6261', '2732', '13716', '1819', '9602', '6715', '13764', '15949', '5953', '6324', '1585', '11128', '12961', '3783']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('21', '2823', '2006-02-16T02:30:53', '2005-08-19T21:37:57', '2005-08-21T18:07:57', '2'), + ('21', '3537', '2006-02-16T02:30:53', '2005-07-10T23:43:23', '2005-07-15T05:21:23', '2'), + ('21', '199', '2006-02-16T02:30:53', '2005-07-31T07:29:25', '2005-08-06T01:35:25', '1'), + ('21', '414', '2006-02-16T02:30:53', '2005-08-18T19:07:23', '2005-08-27T17:20:23', '2'), + ('21', '4425', '2006-02-16T02:30:53', '2005-08-19T22:43:38', '2005-08-26T18:29:38', '2'), + ('21', '3635', '2006-02-16T02:30:53', '2005-07-10T13:27:40', '2005-07-17T08:24:40', '1'), + ('21', '916', '2006-02-16T02:30:53', '2005-07-29T23:49:23', '2005-08-04T20:11:23', '1'), + ('21', '3913', '2006-02-16T02:30:53', '2005-08-20T09:26:14', '2005-08-29T08:16:14', '2'), + ('21', '1186', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('21', '1697', '2006-02-16T02:30:53', '2005-07-09T06:42:32', '2005-07-10T08:21:32', '2'), + ('21', '2436', '2006-02-16T02:30:53', '2005-07-26T23:28:13', '2005-07-30T02:22:13', '2'), + ('21', '3435', '2006-02-16T02:30:53', '2005-07-28T22:56:11', '2005-08-06T04:53:11', '1'), + ('148', '3350', '2006-02-16T02:30:53', '2005-08-21T21:27:24', '2005-08-23T20:26:24', '1'), + ('148', '173', '2006-02-16T02:30:53', '2005-07-08T13:47:55', '2005-07-11T09:06:55', '2'), + ('148', '103', '2006-02-16T02:30:53', '2005-07-12T16:37:55', '2005-07-21T16:04:55', '2'), + ('148', '1940', '2006-02-16T02:30:53', '2005-07-31T19:37:58', '2005-08-04T17:32:58', '2'), + ('148', '1364', '2006-02-16T02:30:53', '2005-07-07T05:09:54', '2005-07-11T23:58:54', '1'), + ('148', '2781', '2006-02-16T02:30:53', '2005-07-11T10:25:56', '2005-07-19T07:18:56', '2'), + ('148', '3728', '2006-02-16T02:30:53', '2005-06-15T23:20:26', '2005-06-23T23:23:26', '1'), + ('148', '1780', '2006-02-16T02:30:53', '2005-06-15T22:02:35', '2005-06-23T18:59:35', '1'), + ('148', '1036', '2006-02-16T02:30:53', '2005-08-22T06:45:53', '2005-08-27T10:05:53', '1'), + ('148', '3160', '2006-02-16T02:30:53', '2005-05-28T23:53:18', '2005-05-29T19:14:18', '2'), + ('148', '1291', '2006-02-16T02:30:53', '2005-06-19T16:39:23', '2005-06-25T13:57:23', '1'), + ('148', '2762', '2006-02-16T02:30:53', '2005-08-23T04:13:53', '2005-08-29T05:51:53', '1'), + ('148', '4485', '2006-02-16T02:30:53', '2005-08-22T17:44:30', '2005-08-24T12:51:30', '1'), + ('148', '3933', '2006-02-16T02:30:53', '2005-07-29T06:02:14', '2005-08-03T08:15:14', '1'), + ('148', '1520', '2006-02-16T02:30:53', '2005-06-19T22:36:39', '2005-06-26T22:33:39', '2'), + ('148', '3516', '2006-02-16T02:30:53', '2005-08-17T20:07:01', '2005-08-19T19:36:01', '2'), + ('148', '3551', '2006-02-16T02:30:53', '2005-07-09T18:48:39', '2005-07-11T17:40:39', '1'), + ('148', '2794', '2006-02-16T02:30:53', '2005-07-12T10:27:19', '2005-07-21T06:28:19', '2'), + ('148', '3291', '2006-02-16T02:30:53', '2005-07-08T22:58:07', '2005-07-09T20:41:07', '2'), + ('148', '2513', '2006-02-16T02:30:53', '2005-07-06T07:45:13', '2005-07-10T11:51:13', '2'), + ('148', '761', '2006-02-16T02:30:53', '2005-08-21T18:39:52', '2005-08-25T19:14:52', '2'), + ('148', '2479', '2006-02-16T02:30:53', '2005-07-28T03:31:22', '2005-07-31T06:42:22', '2'), + ('148', '2334', '2006-02-16T02:30:53', '2005-07-28T10:07:04', '2005-08-06T08:16:04', '2'), + ('148', '178', '2006-02-16T02:30:53', '2005-07-28T02:07:19', '2005-07-31T04:05:19', '1'), + ('148', '4382', '2006-02-16T02:30:53', '2005-07-31T03:23:52', '2005-08-04T23:06:52', '1'), + ('148', '18', '2006-02-16T02:30:53', '2005-07-29T04:13:29', '2005-08-04T07:09:29', '1'), + ('148', '3737', '2006-02-16T02:30:53', '2005-07-29T11:58:14', '2005-08-03T06:25:14', '1'), + ('148', '4176', '2006-02-16T02:30:53', '2005-08-01T23:18:06', '2005-08-06T23:15:06', '2'), + ('148', '1571', '2006-02-16T02:30:53', '2005-08-20T22:18:00', '2005-08-22T02:09:00', '2'), + ('148', '3226', '2006-02-16T02:30:53', '2005-07-28T19:10:03', '2005-07-29T22:25:03', '1'), + ('148', '2911', '2006-02-16T02:30:53', '2005-07-30T05:36:40', '2005-08-07T06:20:40', '1'), + ('148', '2644', '2006-02-16T02:30:53', '2005-08-02T17:42:49', '2005-08-11T18:14:49', '1'), + ('148', '1247', '2006-02-16T02:30:53', '2005-06-19T22:54:01', '2005-06-27T23:05:01', '2'), + ('148', '3759', '2006-02-16T02:30:53', '2005-08-21T03:24:50', '2005-08-29T01:46:50', '2'), + ('148', '2935', '2006-02-16T02:30:53', '2005-07-30T08:52:34', '2005-08-02T07:38:34', '2'), + ('148', '3794', '2006-02-16T02:30:53', '2005-08-17T20:28:26', '2005-08-20T23:09:26', '2'), + ('148', '3959', '2006-02-16T02:30:53', '2005-08-18T13:28:27', '2005-08-26T19:08:27', '2'), + ('148', '3092', '2006-02-16T02:30:53', '2005-07-29T14:03:20', '2005-08-02T09:05:20', '1'), + ('148', '1718', '2006-02-16T02:30:53', '2005-07-31T01:09:06', '2005-08-04T23:47:06', '2'), + ('148', '769', '2006-02-16T02:30:53', '2005-08-21T02:31:35', '2005-08-27T06:00:35', '2'), + ('148', '2956', '2006-02-16T02:30:53', '2005-08-19T05:48:12', '2005-08-28T10:10:12', '1'), + ('148', '1899', '2006-02-16T02:30:53', '2005-08-22T22:26:13', '2005-08-31T18:19:13', '1'), + ('148', '2154', '2006-02-16T02:30:53', '2005-08-22T03:42:12', '2005-08-27T06:14:12', '1'), + ('148', '340', '2006-02-16T02:30:53', '2005-07-09T02:48:15', '2005-07-11T23:13:15', '2'), + ('148', '406', '2006-02-16T02:30:53', '2005-08-19T07:06:51', '2005-08-28T10:35:51', '2'), + ('148', '3232', '2006-02-16T02:30:53', '2005-08-23T05:57:04', '2005-08-31T01:59:04', '1'), + ('82', '1224', '2006-02-16T02:30:53', '2005-07-30T16:45:56', '2005-08-08T21:15:56', '2'), + ('82', '2947', '2006-02-16T02:30:53', '2005-07-28T10:19:46', '2005-07-31T04:43:46', '2'), + ('82', '1893', '2006-02-16T02:30:53', '2005-07-29T08:53:49', '2005-07-31T09:10:49', '2'), + ('82', '2229', '2006-02-16T02:30:53', '2005-08-17T06:41:58', '2005-08-25T04:38:58', '1'), + ('82', '4100', '2006-02-16T02:30:53', '2005-06-19T20:13:33', '2005-06-26T16:44:33', '1'), + ('82', '2734', '2006-02-16T02:30:53', '2005-08-21T14:58:58', '2005-08-24T13:19:58', '2'), + ('82', '258', '2006-02-16T02:30:53', '2005-07-08T06:46:26', '2005-07-16T01:21:26', '1'), + ('82', '3905', '2006-02-16T02:30:53', '2005-05-25T23:59:03', '2005-05-31T02:56:03', '1'), + ('82', '2427', '2006-02-16T02:30:53', '2005-07-06T09:16:10', '2005-07-08T07:52:10', '2'), + ('82', '2647', '2006-02-16T02:30:53', '2005-08-20T14:33:59', '2005-08-25T08:49:59', '1'), + ('82', '1290', '2006-02-16T02:30:53', '2005-08-18T11:55:42', '2005-08-24T08:27:42', '2'), + ('82', '239', '2006-02-16T02:30:53', '2005-08-02T07:59:49', '2005-08-11T06:01:49', '1'), + ('82', '2308', '2006-02-16T02:30:53', '2005-06-18T23:29:53', '2005-06-25T18:11:53', '2'), + ('82', '3734', '2006-02-16T02:30:53', '2005-07-30T15:13:45', '2005-08-05T10:25:45', '2'), + ('82', '1975', '2006-02-16T02:30:53', '2005-06-21T09:55:12', '2005-06-25T08:32:12', '2'), + ('82', '1053', '2006-02-16T02:30:53', '2005-07-30T21:54:22', '2005-08-09T01:07:22', '2'), + ('82', '219', '2006-02-16T02:30:53', '2005-08-23T03:12:54', '2005-08-30T04:02:54', '1'), + ('82', '3061', '2006-02-16T02:30:53', '2005-08-22T04:15:05', '2005-08-31T06:07:05', '1'), + ('82', '3699', '2006-02-16T02:30:53', '2005-08-19T08:31:50', '2005-08-23T04:00:50', '2'), + ('82', '3071', '2006-02-16T02:30:53', '2005-07-10T12:15:12', '2005-07-16T07:02:12', '1'), + ('82', '3711', '2006-02-16T02:30:53', '2005-06-16T03:21:33', '2005-06-22T22:03:33', '2'), + ('82', '3546', '2006-02-16T02:30:53', '2005-05-26T19:47:49', '2005-06-03T20:53:49', '2'), + ('82', '1816', '2006-02-16T02:30:53', '2005-06-15T18:38:51', '2005-06-17T23:50:51', '1'), + ('82', '372', '2006-02-16T02:30:53', '2005-07-12T13:10:55', '2005-07-21T07:36:55', '1'), + ('82', '1091', '2006-02-16T02:30:53', '2005-07-11T05:12:41', '2005-07-16T03:40:41', '2'), + ('82', '10', '2006-02-16T02:30:53', '2005-07-28T05:04:47', '2005-08-05T05:12:47', '2'), + ('386', '3825', '2006-02-16T02:30:53', '2005-07-31T06:50:06', '2005-08-06T08:41:06', '1'), + ('386', '1553', '2006-02-16T02:30:53', '2005-07-29T04:41:44', '2005-08-07T10:33:44', '1'), + ('386', '694', '2006-02-16T02:30:53', '2005-07-11T15:28:34', '2005-07-14T17:54:34', '1'), + ('386', '610', '2006-02-16T02:30:53', '2005-06-19T15:19:39', '2005-06-25T19:39:39', '2'), + ('386', '86', '2006-02-16T02:30:53', '2005-08-20T09:48:32', '2005-08-26T07:20:32', '2'), + ('386', '1689', '2006-02-16T02:30:53', '2005-06-16T21:32:50', '2005-06-26T01:11:50', '1'), + ('386', '3173', '2006-02-16T02:30:53', '2005-07-31T03:42:51', '2005-08-01T08:39:51', '1'), + ('386', '643', '2006-02-16T02:30:53', '2005-07-12T13:32:28', '2005-07-15T17:01:28', '2'), + ('386', '989', '2006-02-16T02:30:53', '2005-08-20T11:38:16', '2005-08-27T08:01:16', '1'), + ('386', '1199', '2006-02-16T02:30:53', '2005-08-23T19:06:04', '2005-08-26T18:39:04', '2'), + ('386', '992', '2006-02-16T02:30:53', '2005-07-10T23:21:35', '2005-07-14T20:48:35', '2'), + ('386', '655', '2006-02-16T02:30:53', '2005-07-11T19:02:34', '2005-07-17T15:57:34', '1'), + ('386', '1708', '2006-02-16T02:30:53', '2005-06-16T04:51:13', '2005-06-24T00:23:13', '2'), + ('386', '3472', '2006-02-16T02:30:53', '2005-08-02T09:03:25', '2005-08-09T04:36:25', '1'), + ('386', '4529', '2006-02-16T02:30:53', '2005-08-19T06:22:37', '2005-08-23T00:49:37', '1'), + ('386', '2345', '2006-02-16T02:30:53', '2005-07-06T13:57:31', '2005-07-14T10:44:31', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['13869', '583', '4189', '3351', '1608', '6037', '10715', '10618', '10572', '5524', '11695', '8751', '6222', '9737', '5469', '9183', '7775', '11770', '15097', '702', '5407', '7641', '5415', '3980', '14303', '11293', '5379', '4617', '10162', '10357', '9647', '417', '10633', '4013', '15288', '6224', '8207', '7289', '5366', '9241', '7844', '3709', '15971', '1462', '3402', '14855', '1592', '5833', '252', '11843', '2127', '5738', '2742', '13940', '12307', '4429', '7967', '12534', '2533', '15231', '12490', '6428', '6057', '15517', '1323', '12216', '10861', '5610', '55', '12372', '1768', '83', '9323', '13346', '1646', '944', '15659', '5874', '10459', '5233', '5395', '16042', '5726', '11971', '13050', '13407', '12263', '8071', '7557', '8570', '13353', '3515', '8267', '10179', '11973', '9810', '9942', '12349', '15998', '7078']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('386', '1990', '2006-02-16T02:30:53', '2005-08-20T15:08:57', '2005-08-29T13:13:57', '2'), + ('386', '2679', '2006-02-16T02:30:53', '2005-05-28T11:48:55', '2005-06-04T07:09:55', '2'), + ('386', '1492', '2006-02-16T02:30:53', '2005-07-07T10:51:07', '2005-07-14T14:46:07', '2'), + ('386', '1591', '2006-02-16T02:30:53', '2005-06-21T11:21:39', '2005-06-23T07:23:39', '2'), + ('386', '2581', '2006-02-16T02:30:53', '2005-06-16T06:28:57', '2005-06-24T05:20:57', '2'), + ('386', '1886', '2006-02-16T02:30:53', '2005-07-11T03:06:54', '2005-07-12T22:46:54', '2'), + ('386', '1054', '2006-02-16T02:30:53', '2005-08-01T18:51:48', '2005-08-06T14:44:48', '1'), + ('386', '3729', '2006-02-16T02:30:53', '2005-08-01T15:06:38', '2005-08-06T15:52:38', '2'), + ('386', '1239', '2006-02-16T02:30:53', '2005-08-01T13:26:53', '2005-08-07T18:47:53', '2'), + ('386', '3596', '2006-02-16T02:30:53', '2005-07-10T01:49:24', '2005-07-14T22:55:24', '1'), + ('386', '1110', '2006-02-16T02:30:53', '2005-08-17T07:01:08', '2005-08-21T09:21:08', '1'), + ('386', '3467', '2006-02-16T02:30:53', '2005-07-29T19:14:39', '2005-07-31T23:11:39', '1'), + ('386', '2066', '2006-02-16T02:30:53', '2005-07-11T13:25:49', '2005-07-13T14:32:49', '1'), + ('475', '1720', '2006-02-16T02:30:53', '2005-07-31T08:59:18', '2005-08-03T12:19:18', '2'), + ('475', '2201', '2006-02-16T02:30:53', '2005-07-09T23:08:07', '2005-07-13T19:13:07', '1'), + ('475', '4320', '2006-02-16T02:30:53', '2005-07-30T12:09:56', '2005-08-06T11:50:56', '2'), + ('475', '3795', '2006-02-16T02:30:53', '2005-07-28T07:04:36', '2005-08-03T06:36:36', '2'), + ('475', '2862', '2006-02-16T02:30:53', '2005-08-17T10:05:05', '2005-08-20T15:59:05', '1'), + ('475', '2838', '2006-02-16T02:30:53', '2005-08-22T11:43:42', '2005-08-27T10:25:42', '1'), + ('475', '2556', '2006-02-16T02:30:53', '2005-05-29T02:27:30', '2005-05-30T01:52:30', '2'), + ('475', '3641', '2006-02-16T02:30:53', '2005-07-09T20:16:07', '2005-07-14T21:41:07', '2'), + ('475', '1868', '2006-02-16T02:30:53', '2005-07-28T01:15:45', '2005-08-04T23:50:45', '1'), + ('475', '4413', '2006-02-16T02:30:53', '2005-07-09T20:30:03', '2005-07-18T00:20:03', '1'), + ('475', '1845', '2006-02-16T02:30:53', '2005-07-06T23:11:11', '2005-07-14T18:22:11', '1'), + ('475', '992', '2006-02-16T02:30:53', '2005-08-21T07:22:43', '2005-08-24T11:52:43', '1'), + ('475', '1514', '2006-02-16T02:30:53', '2005-08-02T15:00:43', '2005-08-11T17:49:43', '1'), + ('475', '2110', '2006-02-16T02:30:53', '2005-07-09T19:08:03', '2005-07-10T17:58:03', '1'), + ('475', '3784', '2006-02-16T02:30:53', '2005-07-08T07:55:08', '2005-07-17T02:49:08', '2'), + ('475', '1327', '2006-02-16T02:30:53', '2005-07-31T23:11:01', '2005-08-07T01:52:01', '2'), + ('475', '3102', '2006-02-16T02:30:53', '2005-08-01T05:49:49', '2005-08-04T02:34:49', '2'), + ('475', '3415', '2006-02-16T02:30:53', '2005-07-31T05:45:15', '2005-08-06T08:54:15', '1'), + ('475', '2253', '2006-02-16T02:30:53', '2005-05-27T15:07:27', '2005-05-29T20:01:27', '2'), + ('475', '3125', '2006-02-16T02:30:53', '2005-08-01T15:37:17', '2005-08-10T14:30:17', '2'), + ('475', '2344', '2006-02-16T02:30:53', '2005-07-07T00:58:00', '2005-07-15T19:42:00', '2'), + ('475', '1999', '2006-02-16T02:30:53', '2005-08-22T19:23:58', '2005-08-26T23:28:58', '1'), + ('475', '3274', '2006-02-16T02:30:53', '2005-07-11T13:42:18', '2005-07-16T09:28:18', '1'), + ('475', '1195', '2006-02-16T02:30:53', '2005-07-28T23:26:31', '2005-08-06T03:26:31', '1'), + ('187', '2157', '2006-02-16T02:30:53', '2005-07-27T12:26:51', '2005-08-02T18:20:51', '2'), + ('187', '886', '2006-02-16T02:30:53', '2005-07-09T18:28:37', '2005-07-13T20:45:37', '1'), + ('187', '4145', '2006-02-16T02:30:53', '2005-07-30T13:58:41', '2005-08-04T09:44:41', '2'), + ('187', '4220', '2006-02-16T02:30:53', '2005-07-28T09:16:19', '2005-08-05T14:06:19', '2'), + ('187', '4033', '2006-02-16T02:30:53', '2005-07-06T10:26:56', '2005-07-15T13:51:56', '2'), + ('187', '3456', '2006-02-16T02:30:53', '2005-08-23T19:59:33', '2005-09-02T01:28:33', '1'), + ('187', '653', '2006-02-16T02:30:53', '2005-06-15T20:37:40', '2005-06-18T19:36:40', '2'), + ('187', '596', '2006-02-16T02:30:53', '2005-06-21T15:54:37', '2005-06-30T13:43:37', '1'), + ('187', '1668', '2006-02-16T02:30:53', '2005-08-22T02:27:32', '2005-08-31T03:35:32', '1'), + ('187', '3798', '2006-02-16T02:30:53', '2005-06-16T05:14:37', '2005-06-20T10:52:37', '2'), + ('187', '3829', '2006-02-16T02:30:53', '2005-07-10T16:39:24', '2005-07-17T12:52:24', '1'), + ('187', '1203', '2006-02-16T02:30:53', '2005-05-26T14:39:53', '2005-06-02T14:48:53', '1'), + ('187', '3091', '2006-02-16T02:30:53', '2005-08-17T13:14:50', '2005-08-22T11:31:50', '2'), + ('187', '3757', '2006-02-16T02:30:53', '2005-06-17T20:54:48', '2005-06-18T16:28:48', '2'), + ('187', '200', '2006-02-16T02:30:53', '2005-07-10T11:50:51', '2005-07-19T17:46:51', '1'), + ('187', '4154', '2006-02-16T02:30:53', '2005-06-19T16:05:47', '2005-06-26T21:34:47', '1'), + ('187', '2638', '2006-02-16T02:30:53', '2005-08-20T17:28:57', '2005-08-27T22:07:57', '1'), + ('187', '2679', '2006-02-16T02:30:53', '2005-08-18T05:48:23', '2005-08-26T02:32:23', '1'), + ('187', '2949', '2006-02-16T02:30:53', '2005-07-07T22:32:47', '2005-07-15T03:10:47', '2'), + ('187', '2040', '2006-02-16T02:30:53', '2005-07-28T13:56:51', '2005-08-03T19:38:51', '1'), + ('187', '995', '2006-02-16T02:30:53', '2005-08-18T14:04:41', '2005-08-25T16:57:41', '1'), + ('187', '4564', '2006-02-16T02:30:53', '2005-06-19T01:34:26', '2005-06-22T20:19:26', '1'), + ('187', '2980', '2006-02-16T02:30:53', '2005-08-22T17:32:57', '2005-08-25T13:06:57', '1'), + ('187', '1577', '2006-02-16T02:30:53', '2005-08-18T12:48:45', '2005-08-27T15:53:45', '1'), + ('187', '4365', '2006-02-16T02:30:53', '2005-07-12T00:01:51', '2005-07-20T22:02:51', '2'), + ('187', '1340', '2006-02-16T02:30:53', '2005-07-11T04:03:40', '2005-07-17T01:34:40', '2'), + ('187', '2221', '2006-02-16T02:30:53', '2005-08-23T03:13:01', '2005-08-25T21:14:01', '2'), + ('187', '3273', '2006-02-16T02:30:53', '2005-06-15T10:55:17', '2005-06-24T09:51:17', '1'), + ('131', '4139', '2006-02-16T02:30:53', '2005-08-18T02:37:07', '2005-08-19T02:09:07', '2'), + ('131', '2162', '2006-02-16T02:30:53', '2005-08-02T00:12:46', '2005-08-09T04:09:46', '2'), + ('131', '481', '2006-02-16T02:30:53', '2005-07-10T05:09:52', '2005-07-13T07:08:52', '2'), + ('131', '1139', '2006-02-16T02:30:53', '2005-05-25T08:26:13', '2005-05-30T10:57:13', '1'), + ('131', '2982', '2006-02-16T02:30:53', '2005-08-18T08:04:35', '2005-08-27T08:13:35', '2'), + ('131', '2131', '2006-02-16T02:30:53', '2005-06-16T18:02:06', '2005-06-23T17:19:06', '2'), + ('131', '466', '2006-02-16T02:30:53', '2005-05-25T12:30:15', '2005-05-27T15:40:15', '1'), + ('131', '3749', '2006-02-16T02:30:53', '2005-07-30T17:21:44', '2005-08-03T16:28:44', '1'), + ('131', '4541', '2006-02-16T02:30:53', '2005-08-19T20:28:21', '2005-08-28T00:28:21', '2'), + ('131', '4037', '2006-02-16T02:30:53', '2005-06-16T09:12:53', '2005-06-24T08:03:53', '2'), + ('131', '151', '2006-02-16T02:30:53', '2005-05-30T15:26:24', '2005-06-07T18:09:24', '2'), + ('131', '4573', '2006-02-16T02:30:53', '2005-08-23T08:48:43', '2005-08-27T14:19:43', '2'), + ('131', '2255', '2006-02-16T02:30:53', '2005-07-10T19:02:51', '2005-07-16T13:14:51', '1'), + ('131', '201', '2006-02-16T02:30:53', '2005-08-01T09:20:09', '2005-08-03T11:36:09', '1'), + ('131', '1401', '2006-02-16T02:30:53', '2005-07-09T12:44:26', '2005-07-15T12:31:26', '1'), + ('131', '4428', '2006-02-16T02:30:53', '2005-07-09T19:42:37', '2005-07-10T15:39:37', '1'), + ('131', '629', '2006-02-16T02:30:53', '2005-08-23T22:20:40', '2005-08-24T17:54:40', '1'), + ('131', '3582', '2006-02-16T02:30:53', '2005-07-10T11:22:08', '2005-07-13T05:55:08', '1'), + ('131', '2756', '2006-02-16T02:30:53', '2005-08-17T17:53:42', '2005-08-18T12:11:42', '2'), + ('131', '3682', '2006-02-16T02:30:53', '2005-08-19T09:31:23', '2005-08-26T06:56:23', '2'), + ('131', '2512', '2006-02-16T02:30:53', '2005-08-19T22:26:26', '2005-08-22T16:34:26', '1'), + ('131', '4053', '2006-02-16T02:30:53', '2005-08-18T04:16:18', '2005-08-21T07:22:18', '1'), + ('131', '2582', '2006-02-16T02:30:53', '2005-07-28T17:27:48', '2005-08-03T11:48:48', '2'), + ('131', '3152', '2006-02-16T02:30:53', '2005-07-27T22:18:19', '2005-07-29T00:24:19', '1'), + ('131', '3094', '2006-02-16T02:30:53', '2005-07-29T11:40:08', '2005-08-06T10:23:08', '1'), + ('131', '2790', '2006-02-16T02:30:53', '2005-08-19T20:53:43', '2005-08-25T01:25:43', '1'), + ('131', '3220', '2006-02-16T02:30:53', '2005-07-06T00:48:55', '2005-07-09T00:15:55', '1'), + ('131', '4107', '2006-02-16T02:30:53', '2005-07-29T01:21:02', '2005-08-04T19:34:02', '2'), + ('131', '2136', '2006-02-16T02:30:53', '2005-07-31T23:49:54', '2005-08-01T20:46:54', '2'), + ('131', '1472', '2006-02-16T02:30:53', '2005-08-17T17:55:58', '2005-08-21T19:55:58', '2'), + ('545', '2066', '2006-02-16T02:30:53', '2005-07-31T11:22:41', '2005-08-01T09:40:41', '2'), + ('545', '4573', '2006-02-16T02:30:53', '2005-07-31T15:35:43', '2005-08-07T17:37:43', '2'), + ('545', '4191', '2006-02-16T02:30:53', '2005-08-18T07:23:42', '2005-08-19T04:25:42', '1'), + ('545', '1229', '2006-02-16T02:30:53', '2005-08-23T20:41:09', '2005-08-27T00:20:09', '1'), + ('545', '4518', '2006-02-16T02:30:53', '2005-07-27T04:16:37', '2005-08-05T02:34:37', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['5264', '2123', '12800', '13595', '12098', '248', '8848', '3975', '15585', '4597', '12667', '715', '8599', '10931', '11760', '3693', '11063', '15613', '12022', '14893', '15336', '8133', '7334', '684', '9885', '13269', '7664', '13223', '15187', '15449', '15067', '3127', '8164', '3698', '5650', '15411', '10113', '10260', '9499', '11219', '5809', '4586', '3319', '14186', '5840', '15146', '5223', '9027', '8228', '13660', '12020', '785', '11630', '1047', '13597', '11679', '11422', '5302', '845', '14020', '12448', '15110', '3700', '12593', '13327', '6081', '13145', '2294', '11923', '5424', '10267', '11206', '9420', '9648', '9614', '743', '3686', '177', '1326', '3777', '13691', '4155', '6490', '14723', '10318', '13730', '14188', '12860', '2280', '872', '13584', '5138', '2978', '5779', '10684', '13774', '13928', '11157', '5692', '13630']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('545', '3307', '2006-02-16T02:30:53', '2005-07-09T14:11:28', '2005-07-12T18:24:28', '2'), + ('545', '2497', '2006-02-16T02:30:53', '2005-06-17T20:48:30', '2005-06-18T19:17:30', '2'), + ('545', '257', '2006-02-16T02:30:53', '2005-08-19T00:27:11', '2005-08-22T01:08:11', '1'), + ('545', '673', '2006-02-16T02:30:53', '2005-08-20T05:54:27', '2005-08-29T01:25:27', '1'), + ('545', '534', '2006-02-16T02:30:53', '2005-08-17T22:38:31', '2005-08-20T01:56:31', '1'), + ('545', '1913', '2006-02-16T02:30:53', '2005-05-26T14:07:58', '2005-05-31T14:03:58', '2'), + ('545', '2972', '2006-02-16T02:30:53', '2005-07-29T23:20:58', '2005-08-03T17:28:58', '2'), + ('545', '4343', '2006-02-16T02:30:53', '2005-07-06T23:00:09', '2005-07-10T01:39:09', '2'), + ('545', '1177', '2006-02-16T02:30:53', '2005-08-23T05:55:22', '2005-08-24T11:45:22', '2'), + ('545', '3767', '2006-02-16T02:30:53', '2005-07-08T06:43:42', '2005-07-13T01:32:42', '1'), + ('545', '104', '2006-02-16T02:30:53', '2005-08-18T19:11:45', '2005-08-27T13:34:45', '2'), + ('545', '2030', '2006-02-16T02:30:53', '2005-05-29T04:22:41', '2005-06-05T09:28:41', '1'), + ('545', '1169', '2006-02-16T02:30:53', '2005-07-29T12:58:52', '2005-08-03T08:19:52', '1'), + ('545', '3268', '2006-02-16T02:30:53', '2005-08-02T02:44:59', '2005-08-04T02:02:59', '1'), + ('545', '626', '2006-02-16T02:30:53', '2005-08-17T09:44:22', '2005-08-24T14:39:22', '2'), + ('545', '2989', '2006-02-16T02:30:53', '2005-07-06T09:56:09', '2005-07-15T06:50:09', '2'), + ('461', '2261', '2006-02-16T02:30:53', '2005-08-02T06:53:48', '2005-08-05T03:38:48', '2'), + ('461', '307', '2006-02-16T02:30:53', '2005-08-23T07:03:19', '2005-08-31T07:50:19', '2'), + ('461', '2067', '2006-02-16T02:30:53', '2005-08-17T19:52:45', '2005-08-18T18:26:45', '2'), + ('461', '2336', '2006-02-16T02:30:53', '2005-08-22T04:15:48', '2005-08-30T08:05:48', '1'), + ('461', '490', '2006-02-16T02:30:53', '2005-08-22T20:47:48', '2005-08-31T18:17:48', '2'), + ('461', '849', '2006-02-16T02:30:53', '2005-07-28T20:01:06', '2005-08-01T20:01:06', '1'), + ('461', '3006', '2006-02-16T02:30:53', '2005-07-27T13:59:58', '2005-07-29T11:33:58', '1'), + ('461', '3242', '2006-02-16T02:30:53', '2005-05-29T00:13:15', '2005-06-04T21:26:15', '2'), + ('461', '3600', '2006-02-16T02:30:53', '2005-07-31T13:59:32', '2005-08-07T12:30:32', '2'), + ('461', '2382', '2006-02-16T02:30:53', '2005-08-19T17:34:00', '2005-08-20T15:17:00', '2'), + ('461', '1989', '2006-02-16T02:30:53', '2005-07-28T02:24:23', '2005-07-29T23:01:23', '1'), + ('461', '332', '2006-02-16T02:30:53', '2005-08-19T15:52:04', '2005-08-22T16:27:04', '1'), + ('461', '2338', '2006-02-16T02:30:53', '2005-08-22T15:53:32', '2005-08-27T14:21:32', '1'), + ('461', '2856', '2006-02-16T02:30:53', '2005-08-23T00:55:43', '2005-08-28T03:41:43', '1'), + ('461', '3684', '2006-02-16T02:30:53', '2005-08-22T10:49:21', '2005-08-24T09:01:21', '1'), + ('461', '1292', '2006-02-16T02:30:53', '2005-06-20T18:39:43', '2005-06-28T17:55:43', '1'), + ('461', '1674', '2006-02-16T02:30:53', '2005-07-28T21:17:19', '2005-07-30T21:12:19', '2'), + ('461', '1263', '2006-02-16T02:30:53', '2005-07-06T10:09:20', '2005-07-08T15:49:20', '1'), + ('461', '2793', '2006-02-16T02:30:53', '2005-07-10T07:17:01', '2005-07-15T11:59:01', '1'), + ('461', '4423', '2006-02-16T02:30:53', '2005-08-22T23:35:41', '2005-08-26T00:51:41', '1'), + ('461', '3974', '2006-02-16T02:30:53', '2005-07-31T21:10:03', '2005-08-02T21:13:03', '2'), + ('461', '2864', '2006-02-16T02:30:53', '2005-08-01T02:58:07', '2005-08-05T02:06:07', '2'), + ('461', '602', '2006-02-16T02:30:53', '2005-07-30T23:58:30', '2005-08-01T00:55:30', '2'), + ('461', '2889', '2006-02-16T02:30:53', '2005-08-02T12:30:20', '2005-08-08T13:42:20', '2'), + ('461', '1748', '2006-02-16T02:30:53', '2005-07-10T15:19:30', '2005-07-13T12:31:30', '2'), + ('461', '1374', '2006-02-16T02:30:53', '2005-07-08T06:12:33', '2005-07-13T11:06:33', '2'), + ('461', '2482', '2006-02-16T02:30:53', '2005-06-21T08:25:46', '2005-06-27T03:54:46', '2'), + ('461', '3158', '2006-02-16T02:30:53', '2005-08-21T03:31:07', '2005-08-28T07:29:07', '2'), + ('72', '1073', '2006-02-16T02:30:53', '2005-07-10T17:09:09', '2005-07-15T22:52:09', '1'), + ('72', '3102', '2006-02-16T02:30:53', '2005-08-22T13:57:55', '2005-08-28T12:57:55', '2'), + ('72', '2335', '2006-02-16T02:30:53', '2005-07-09T12:06:03', '2005-07-17T15:50:03', '1'), + ('72', '449', '2006-02-16T02:30:53', '2005-07-30T05:58:27', '2005-08-03T03:02:27', '1'), + ('72', '1955', '2006-02-16T02:30:53', '2005-07-29T00:08:58', '2005-08-03T00:12:58', '2'), + ('72', '3972', '2006-02-16T02:30:53', '2005-08-20T08:05:56', '2005-08-22T13:22:56', '1'), + ('72', '3258', '2006-02-16T02:30:53', '2005-08-17T19:50:33', '2005-08-25T17:54:33', '1'), + ('72', '39', '2006-02-16T02:30:53', '2005-05-29T15:08:41', '2005-05-30T15:51:41', '1'), + ('72', '688', '2006-02-16T02:30:53', '2005-08-17T04:27:46', '2005-08-19T09:58:46', '2'), + ('72', '1366', '2006-02-16T02:30:53', '2005-05-31T06:45:57', '2005-06-04T09:49:57', '2'), + ('72', '3697', '2006-02-16T02:30:53', '2005-08-20T05:59:05', '2005-08-24T05:38:05', '2'), + ('72', '3337', '2006-02-16T02:30:53', '2005-08-17T06:08:54', '2005-08-21T07:50:54', '1'), + ('72', '342', '2006-02-16T02:30:53', '2005-08-02T19:52:08', '2005-08-11T18:40:08', '2'), + ('72', '4270', '2006-02-16T02:30:53', '2005-07-09T15:42:36', '2005-07-10T21:04:36', '2'), + ('72', '2001', '2006-02-16T02:30:53', '2005-05-30T01:17:25', '2005-06-07T02:00:25', '1'), + ('72', '2257', '2006-02-16T02:30:53', '2005-08-20T20:59:43', '2005-08-23T17:11:43', '2'), + ('72', '3889', '2006-02-16T02:30:53', '2005-08-18T10:59:04', '2005-08-21T06:45:04', '2'), + ('72', '1379', '2006-02-16T02:30:53', '2005-08-22T12:16:46', '2005-08-26T13:36:46', '1'), + ('72', '343', '2006-02-16T02:30:53', '2005-07-06T10:12:19', '2005-07-07T14:21:19', '2'), + ('72', '4092', '2006-02-16T02:30:53', '2005-08-18T16:17:54', '2005-08-21T18:02:54', '2'), + ('72', '1808', '2006-02-16T02:30:53', '2005-08-19T19:55:45', '2005-08-22T15:05:45', '2'), + ('72', '2286', '2006-02-16T02:30:53', '2005-07-11T05:11:09', '2005-07-13T05:33:09', '2'), + ('72', '1383', '2006-02-16T02:30:53', '2005-08-19T12:53:53', '2005-08-23T08:06:53', '1'), + ('72', '2096', '2006-02-16T02:30:53', '2005-06-18T07:46:34', '2005-06-22T12:34:34', '2'), + ('72', '1907', '2006-02-16T02:30:53', '2005-08-17T16:21:47', '2005-08-18T14:26:47', '2'), + ('72', '3694', '2006-02-16T02:30:53', '2005-07-09T20:59:09', '2005-07-12T00:05:09', '2'), + ('72', '3883', '2006-02-16T02:30:53', '2005-08-01T03:07:26', '2005-08-07T22:49:26', '1'), + ('72', '4131', '2006-02-16T02:30:53', '2005-08-02T11:58:03', '2005-08-07T12:36:03', '2'), + ('72', '147', '2006-02-16T02:30:53', '2005-07-30T21:05:18', '2005-08-05T23:52:18', '2'), + ('72', '4063', '2006-02-16T02:30:53', '2005-07-31T05:46:03', '2005-08-09T04:36:03', '2'), + ('548', '2955', '2006-02-16T02:30:53', '2005-07-31T03:59:31', '2005-08-08T04:19:31', '1'), + ('548', '2528', '2006-02-16T02:30:53', '2005-05-29T08:39:02', '2005-06-06T08:42:02', '2'), + ('548', '376', '2006-02-16T02:30:53', '2005-07-06T09:37:50', '2005-07-09T10:15:50', '2'), + ('548', '3545', '2006-02-16T02:30:53', '2005-05-26T04:14:29', '2005-06-01T08:16:29', '2'), + ('548', '59', '2006-02-16T02:30:53', '2005-06-15T11:07:39', '2005-06-22T05:55:39', '2'), + ('548', '2470', '2006-02-16T02:30:53', '2005-07-06T13:36:48', '2005-07-11T14:26:48', '1'), + ('548', '676', '2006-02-16T02:30:53', '2005-08-20T09:07:39', '2005-08-28T15:03:39', '1'), + ('548', '212', '2006-02-16T02:30:53', '2005-07-07T09:00:49', '2005-07-13T10:59:49', '2'), + ('548', '2249', '2006-02-16T02:30:53', '2005-07-12T02:28:03', '2005-07-19T03:06:03', '2'), + ('548', '2755', '2006-02-16T02:30:53', '2005-08-21T21:52:32', '2005-08-31T00:03:32', '2'), + ('548', '885', '2006-02-16T02:30:53', '2005-08-01T04:36:53', '2005-08-04T00:54:53', '1'), + ('548', '1330', '2006-02-16T02:30:53', '2005-08-20T10:17:09', '2005-08-28T10:45:09', '1'), + ('548', '4492', '2006-02-16T02:30:53', '2005-08-21T03:32:04', '2005-08-22T07:26:04', '1'), + ('548', '778', '2006-02-16T02:30:53', '2005-08-19T02:24:41', '2005-08-25T07:43:41', '1'), + ('548', '4568', '2006-02-16T02:30:53', '2005-06-18T06:46:54', '2005-06-26T09:48:54', '2'), + ('548', '3904', '2006-02-16T02:30:53', '2005-05-30T05:03:04', '2005-06-06T10:35:04', '1'), + ('548', '3966', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('548', '1283', '2006-02-16T02:30:53', '2005-07-09T08:00:46', '2005-07-12T09:31:46', '2'), + ('548', '4364', '2006-02-16T02:30:53', '2005-06-20T08:25:16', '2005-06-23T05:42:16', '1'), + ('244', '3266', '2006-02-16T02:30:53', '2005-07-10T13:45:54', '2005-07-15T18:13:54', '1'), + ('244', '1985', '2006-02-16T02:30:53', '2005-08-01T17:47:00', '2005-08-09T15:00:00', '2'), + ('244', '735', '2006-02-16T02:30:53', '2005-08-20T11:54:01', '2005-08-22T13:25:01', '2'), + ('244', '1121', '2006-02-16T02:30:53', '2005-08-20T17:12:28', '2005-08-21T13:33:28', '1'), + ('244', '1313', '2006-02-16T02:30:53', '2005-08-02T09:58:15', '2005-08-06T04:23:15', '2'), + ('244', '59', '2006-02-16T02:30:53', '2005-07-10T09:32:22', '2005-07-15T15:20:22', '2'), + ('244', '3346', '2006-02-16T02:30:53', '2005-08-20T07:05:56', '2005-08-29T04:15:56', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['2955', '5461', '1189', '1595', '5803', '6608', '5387', '14919', '14657', '10152', '10969', '6683', '8844', '6374', '797', '14975', '12736', '11762', '8454', '14367', '4814', '11267', '10001', '10047', '592', '1734', '4287', '15693', '127', '629', '5719', '13786', '4044', '7979', '2816', '1213', '14978', '15371', '12316', '5970', '9605', '14865', '2620', '14804', '1367', '7809', '6996', '11895', '5545', '6303', '7792', '2311', '7780', '14364', '4959', '11507', '262', '12988', '11486', '4749', '12975', '8657', '1308', '7798', '5404', '7047', '3857', '13364', '10137', '3645', '3460', '9934', '6049', '2840', '1262', '344', '13443', '5938', '6281', '11139', '3353', '2630', '14321', '1032', '9011', '2139', '7253', '14722', '3067', '5433', '10987', '8297', '14200', '3488', '11192', '13636', '1523', '2987', '9670', '890']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('244', '2312', '2006-02-16T02:30:53', '2005-06-20T06:46:35', '2005-06-25T05:34:35', '2'), + ('244', '53', '2006-02-16T02:30:53', '2005-07-09T22:48:04', '2005-07-10T17:56:04', '2'), + ('244', '142', '2006-02-16T02:30:53', '2005-06-15T01:04:22', '2005-06-24T06:48:22', '1'), + ('244', '1481', '2006-02-16T02:30:53', '2005-06-16T05:23:46', '2005-06-20T00:37:46', '1'), + ('244', '1982', '2006-02-16T02:30:53', '2005-07-10T15:05:42', '2005-07-15T10:19:42', '1'), + ('244', '3577', '2006-02-16T02:30:53', '2005-07-12T08:16:50', '2005-07-18T07:08:50', '2'), + ('244', '4452', '2006-02-16T02:30:53', '2005-07-09T19:25:14', '2005-07-11T21:00:14', '1'), + ('244', '1587', '2006-02-16T02:30:53', '2005-08-22T05:07:17', '2005-08-30T06:41:17', '2'), + ('244', '477', '2006-02-16T02:30:53', '2005-08-21T19:39:43', '2005-08-26T22:39:43', '2'), + ('244', '1114', '2006-02-16T02:30:53', '2005-07-31T22:28:05', '2005-08-08T22:39:05', '2'), + ('244', '1898', '2006-02-16T02:30:53', '2005-08-02T04:04:32', '2005-08-09T23:18:32', '1'), + ('244', '3433', '2006-02-16T02:30:53', '2005-07-12T12:14:05', '2005-07-17T14:02:05', '2'), + ('244', '327', '2006-02-16T02:30:53', '2005-07-29T23:05:08', '2005-08-06T00:24:08', '2'), + ('244', '266', '2006-02-16T02:30:53', '2005-07-11T21:36:10', '2005-07-17T15:50:10', '2'), + ('244', '1446', '2006-02-16T02:30:53', '2005-05-29T17:12:17', '2005-06-03T16:06:17', '1'), + ('244', '924', '2006-02-16T02:30:53', '2005-08-22T07:07:50', '2005-08-28T07:23:50', '2'), + ('244', '3591', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('244', '1204', '2006-02-16T02:30:53', '2005-08-17T09:48:06', '2005-08-26T13:12:06', '2'), + ('244', '159', '2006-02-16T02:30:53', '2005-07-29T07:49:04', '2005-08-03T04:43:04', '2'), + ('244', '870', '2006-02-16T02:30:53', '2005-08-21T09:31:44', '2005-08-26T03:54:44', '2'), + ('244', '3497', '2006-02-16T02:30:53', '2005-07-08T17:11:09', '2005-07-17T12:43:09', '2'), + ('244', '2045', '2006-02-16T02:30:53', '2005-08-02T14:09:08', '2005-08-10T12:33:08', '1'), + ('244', '2188', '2006-02-16T02:30:53', '2005-07-31T17:46:18', '2005-08-07T20:38:18', '1'), + ('244', '4195', '2006-02-16T02:30:53', '2005-07-31T19:07:43', '2005-08-07T00:20:43', '2'), + ('244', '638', '2006-02-16T02:30:53', '2005-05-28T13:21:08', '2005-05-29T16:55:08', '1'), + ('94', '1113', '2006-02-16T02:30:53', '2005-06-16T15:49:30', '2005-06-22T13:52:30', '2'), + ('94', '3558', '2006-02-16T02:30:53', '2005-07-07T15:37:31', '2005-07-16T19:59:31', '2'), + ('94', '748', '2006-02-16T02:30:53', '2005-08-23T10:00:24', '2005-08-25T08:23:24', '1'), + ('94', '2026', '2006-02-16T02:30:53', '2005-05-25T21:10:40', '2005-06-02T21:38:40', '1'), + ('94', '1527', '2006-02-16T02:30:53', '2005-05-28T17:19:15', '2005-06-02T20:01:15', '2'), + ('94', '2100', '2006-02-16T02:30:53', '2005-07-10T11:07:40', '2005-07-15T14:14:40', '2'), + ('94', '515', '2006-02-16T02:30:53', '2005-08-20T12:13:24', '2005-08-28T07:24:24', '2'), + ('94', '3263', '2006-02-16T02:30:53', '2005-07-07T03:22:23', '2005-07-13T03:23:23', '1'), + ('94', '3303', '2006-02-16T02:30:53', '2005-07-28T14:16:30', '2005-08-03T09:39:30', '2'), + ('94', '2180', '2006-02-16T02:30:53', '2005-06-19T20:04:23', '2005-06-20T21:09:23', '2'), + ('94', '3191', '2006-02-16T02:30:53', '2005-06-15T03:14:05', '2005-06-15T21:41:05', '2'), + ('94', '699', '2006-02-16T02:30:53', '2005-08-22T07:13:15', '2005-08-25T12:26:15', '1'), + ('94', '3672', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('94', '4325', '2006-02-16T02:30:53', '2005-08-18T06:16:09', '2005-08-27T05:54:09', '2'), + ('94', '1514', '2006-02-16T02:30:53', '2005-07-11T00:04:50', '2005-07-19T03:36:50', '1'), + ('94', '1477', '2006-02-16T02:30:53', '2005-07-31T03:50:07', '2005-08-07T09:15:07', '2'), + ('94', '3775', '2006-02-16T02:30:53', '2005-08-22T03:06:38', '2005-08-23T04:26:38', '1'), + ('94', '3183', '2006-02-16T02:30:53', '2005-06-19T08:06:29', '2005-06-24T11:42:29', '1'), + ('94', '372', '2006-02-16T02:30:53', '2005-08-22T00:51:25', '2005-08-26T21:15:25', '1'), + ('94', '1505', '2006-02-16T02:30:53', '2005-06-15T14:25:17', '2005-06-21T19:15:17', '1'), + ('94', '4150', '2006-02-16T02:30:53', '2005-07-28T07:59:46', '2005-08-02T02:56:46', '1'), + ('236', '3237', '2006-02-16T02:30:53', '2005-07-27T01:13:45', '2005-07-28T20:43:45', '1'), + ('236', '2156', '2006-02-16T02:30:53', '2005-08-17T15:15:07', '2005-08-18T11:00:07', '2'), + ('236', '118', '2006-02-16T02:30:53', '2005-07-10T02:50:29', '2005-07-16T02:11:29', '1'), + ('236', '846', '2006-02-16T02:30:53', '2005-07-11T17:55:43', '2005-07-13T12:50:43', '1'), + ('236', '3736', '2006-02-16T02:30:53', '2005-07-28T07:24:02', '2005-08-04T11:13:02', '1'), + ('236', '4506', '2006-02-16T02:30:53', '2005-06-18T08:51:29', '2005-06-25T07:51:29', '1'), + ('236', '3069', '2006-02-16T02:30:53', '2005-07-28T07:11:55', '2005-08-06T05:41:55', '1'), + ('236', '3513', '2006-02-16T02:30:53', '2005-08-21T09:25:11', '2005-08-29T09:04:11', '1'), + ('236', '3898', '2006-02-16T02:30:53', '2005-07-08T23:22:23', '2005-07-10T03:17:23', '2'), + ('236', '4197', '2006-02-16T02:30:53', '2005-08-16T23:26:43', '2005-08-24T22:48:43', '2'), + ('236', '4261', '2006-02-16T02:30:53', '2005-05-26T15:46:56', '2005-05-28T15:49:56', '2'), + ('236', '81', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('236', '1610', '2006-02-16T02:30:53', '2005-08-02T22:34:06', '2005-08-09T00:46:06', '2'), + ('236', '1190', '2006-02-16T02:30:53', '2005-07-08T14:05:58', '2005-07-10T18:35:58', '2'), + ('236', '3300', '2006-02-16T02:30:53', '2005-08-19T06:51:19', '2005-08-25T04:22:19', '1'), + ('236', '3194', '2006-02-16T02:30:53', '2005-07-29T15:09:25', '2005-07-31T19:10:25', '1'), + ('236', '220', '2006-02-16T02:30:53', '2005-06-15T10:07:48', '2005-06-24T15:24:48', '1'), + ('236', '3281', '2006-02-16T02:30:53', '2005-07-28T07:41:59', '2005-07-31T12:36:59', '1'), + ('236', '3685', '2006-02-16T02:30:53', '2005-07-09T20:10:43', '2005-07-13T15:16:43', '1'), + ('236', '2866', '2006-02-16T02:30:53', '2005-07-27T03:31:11', '2005-08-03T23:40:11', '1'), + ('236', '1135', '2006-02-16T02:30:53', '2005-07-06T17:07:54', '2005-07-07T13:28:54', '1'), + ('236', '2773', '2006-02-16T02:30:53', '2005-08-19T21:09:30', '2005-08-25T18:37:30', '1'), + ('236', '612', '2006-02-16T02:30:53', '2005-07-31T22:01:41', '2005-08-07T22:24:41', '1'), + ('236', '3390', '2006-02-16T02:30:53', '2005-07-06T07:22:09', '2005-07-10T11:45:09', '1'), + ('236', '1765', '2006-02-16T02:30:53', '2005-06-21T21:46:56', '2005-06-29T20:08:56', '1'), + ('236', '2492', '2006-02-16T02:30:53', '2005-07-31T15:25:26', '2005-08-05T17:13:26', '1'), + ('236', '2582', '2006-02-16T02:30:53', '2005-07-11T03:32:32', '2005-07-15T06:57:32', '2'), + ('236', '1102', '2006-02-16T02:30:53', '2005-06-19T22:17:44', '2005-06-26T00:36:44', '2'), + ('236', '4495', '2006-02-16T02:30:53', '2005-06-15T06:54:53', '2005-06-22T08:09:53', '2'), + ('236', '2327', '2006-02-16T02:30:53', '2005-05-27T04:30:22', '2005-05-29T10:13:22', '2'), + ('236', '3161', '2006-02-16T02:30:53', '2005-08-19T23:53:42', '2005-08-28T05:37:42', '1'), + ('236', '2834', '2006-02-16T02:30:53', '2005-07-10T22:17:42', '2005-07-16T22:38:42', '2'), + ('236', '835', '2006-02-16T02:30:53', '2005-07-11T16:38:16', '2005-07-13T10:57:16', '2'), + ('236', '1011', '2006-02-16T02:30:53', '2005-08-02T09:27:36', '2005-08-08T14:07:36', '2'), + ('236', '3984', '2006-02-16T02:30:53', '2005-06-21T11:29:23', '2005-06-27T15:06:23', '1'), + ('236', '3904', '2006-02-16T02:30:53', '2005-06-19T08:47:21', '2005-06-25T09:31:21', '1'), + ('236', '967', '2006-02-16T02:30:53', '2005-08-21T08:05:12', '2005-08-23T02:17:12', '1'), + ('236', '2937', '2006-02-16T02:30:53', '2005-05-31T04:28:43', '2005-06-02T02:00:43', '2'), + ('236', '2799', '2006-02-16T02:30:53', '2005-07-30T05:16:29', '2005-08-05T06:57:29', '1'), + ('236', '807', '2006-02-16T02:30:53', '2005-06-17T21:29:34', '2005-06-26T21:05:34', '1'), + ('236', '1950', '2006-02-16T02:30:53', '2005-07-27T10:46:37', '2005-07-28T11:18:37', '1'), + ('236', '2930', '2006-02-16T02:30:53', '2005-08-21T21:50:53', '2005-08-30T03:13:53', '1'), + ('349', '3094', '2006-02-16T02:30:53', '2005-06-20T13:59:21', '2005-06-28T19:09:21', '2'), + ('349', '2679', '2006-02-16T02:30:53', '2005-07-09T21:22:00', '2005-07-10T21:18:00', '2'), + ('349', '968', '2006-02-16T02:30:53', '2005-08-02T04:36:52', '2005-08-04T00:03:52', '1'), + ('349', '3774', '2006-02-16T02:30:53', '2005-07-29T02:45:46', '2005-07-31T20:49:46', '1'), + ('349', '2339', '2006-02-16T02:30:53', '2005-08-21T03:51:27', '2005-08-29T22:00:27', '1'), + ('349', '898', '2006-02-16T02:30:53', '2005-07-05T23:32:49', '2005-07-15T02:01:49', '2'), + ('349', '1998', '2006-02-16T02:30:53', '2005-08-02T11:29:41', '2005-08-07T06:01:41', '2'), + ('349', '1467', '2006-02-16T02:30:53', '2005-08-20T07:20:09', '2005-08-23T09:58:09', '1'), + ('349', '681', '2006-02-16T02:30:53', '2005-06-16T00:18:40', '2005-06-17T02:50:40', '2'), + ('349', '1531', '2006-02-16T02:30:53', '2005-06-20T08:55:50', '2005-06-28T13:02:50', '2'), + ('349', '3709', '2006-02-16T02:30:53', '2005-07-31T06:33:33', '2005-08-07T04:51:33', '1'), + ('349', '1464', '2006-02-16T02:30:53', '2005-05-30T07:43:04', '2005-06-01T11:26:04', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['4881', '4190', '13258', '11492', '14915', '11905', '14721', '14908', '4494', '7002', '9262', '15955', '7046', '15833', '1197', '9731', '7702', '9350', '15016', '8205', '508', '2415', '15385', '12624', '12030', '11867', '5464', '14553', '4960', '7260', '12146', '2430', '13359', '4654', '4414', '3014', '7479', '13383', '11242', '1225', '1584', '6972', '3037', '2494', '9412', '12494', '9533', '10223', '11830', '7955', '3102', '9047', '9335', '4701', '8966', '10411', '5532', '3191', '4078', '1289', '7262', '15921', '11696', '5936', '9227', '10821', '14467', '13605', '4563', '3188', '3594', '5514', '10675', '8642', '426', '5271', '8181', '10896', '14398', '11907', '4507', '7784', '13612', '10219', '15867', '645', '3137', '1886', '1799', '4008', '2773', '5976', '11163', '6292', '6441', '15436', '14802', '159', '4590', '11164']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('349', '4346', '2006-02-16T02:30:53', '2005-07-08T19:40:34', '2005-07-09T17:08:34', '2'), + ('349', '826', '2006-02-16T02:30:53', '2005-07-07T10:52:39', '2005-07-11T13:19:39', '1'), + ('349', '2246', '2006-02-16T02:30:53', '2005-08-19T17:05:37', '2005-08-24T17:36:37', '2'), + ('349', '4037', '2006-02-16T02:30:53', '2005-08-02T22:46:47', '2005-08-09T19:54:47', '2'), + ('349', '112', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('349', '2725', '2006-02-16T02:30:53', '2005-08-17T15:40:18', '2005-08-26T15:14:18', '2'), + ('349', '4257', '2006-02-16T02:30:53', '2005-08-21T21:50:51', '2005-08-30T19:21:51', '1'), + ('349', '102', '2006-02-16T02:30:53', '2005-08-22T04:44:10', '2005-08-25T05:09:10', '2'), + ('349', '1655', '2006-02-16T02:30:53', '2005-07-08T01:42:45', '2005-07-16T22:29:45', '2'), + ('349', '4157', '2006-02-16T02:30:53', '2005-07-27T01:26:14', '2005-08-01T20:10:14', '1'), + ('349', '2322', '2006-02-16T02:30:53', '2005-07-30T14:45:02', '2005-08-05T15:18:02', '2'), + ('349', '2247', '2006-02-16T02:30:53', '2005-08-23T19:19:06', '2005-08-31T23:34:06', '1'), + ('349', '3740', '2006-02-16T02:30:53', '2005-07-27T03:27:56', '2005-07-30T00:54:56', '2'), + ('349', '801', '2006-02-16T02:30:53', '2005-08-23T15:22:15', '2005-08-31T14:54:15', '1'), + ('349', '3812', '2006-02-16T02:30:53', '2005-06-15T01:42:46', '2005-06-20T00:22:46', '1'), + ('349', '3713', '2006-02-16T02:30:53', '2005-07-31T08:54:47', '2005-08-05T03:47:47', '1'), + ('349', '253', '2006-02-16T02:30:53', '2005-07-28T03:56:05', '2005-07-31T03:29:05', '1'), + ('434', '798', '2006-02-16T02:30:53', '2005-07-30T18:24:30', '2005-08-02T15:34:30', '2'), + ('434', '879', '2006-02-16T02:30:53', '2005-08-22T08:47:35', '2005-08-28T14:23:35', '2'), + ('434', '2944', '2006-02-16T02:30:53', '2005-07-28T23:18:48', '2005-07-30T00:37:48', '2'), + ('434', '4179', '2006-02-16T02:30:53', '2005-05-28T02:40:50', '2005-06-05T03:05:50', '1'), + ('434', '3105', '2006-02-16T02:30:53', '2005-06-18T17:02:42', '2005-06-25T13:16:42', '2'), + ('434', '140', '2006-02-16T02:30:53', '2005-08-22T22:37:34', '2005-08-26T00:36:34', '2'), + ('434', '1135', '2006-02-16T02:30:53', '2005-08-18T17:35:00', '2005-08-27T12:18:00', '2'), + ('434', '449', '2006-02-16T02:30:53', '2005-08-17T20:10:48', '2005-08-19T00:32:48', '1'), + ('434', '938', '2006-02-16T02:30:53', '2005-08-17T14:04:28', '2005-08-21T10:08:28', '1'), + ('434', '3692', '2006-02-16T02:30:53', '2005-07-09T22:58:14', '2005-07-15T02:48:14', '1'), + ('434', '3160', '2006-02-16T02:30:53', '2005-08-21T15:59:40', '2005-08-23T11:54:40', '2'), + ('434', '2176', '2006-02-16T02:30:53', '2005-07-08T23:27:16', '2005-07-18T02:01:16', '1'), + ('434', '3827', '2006-02-16T02:30:53', '2005-07-27T11:09:28', '2005-08-03T09:41:28', '1'), + ('434', '3833', '2006-02-16T02:30:53', '2005-08-18T00:10:04', '2005-08-25T19:18:04', '2'), + ('434', '1984', '2006-02-16T02:30:53', '2005-06-18T17:51:46', '2005-06-23T19:17:46', '1'), + ('434', '4175', '2006-02-16T02:30:53', '2005-08-19T21:04:49', '2005-08-27T01:46:49', '1'), + ('434', '4210', '2006-02-16T02:30:53', '2005-07-08T09:48:03', '2005-07-17T13:17:03', '1'), + ('434', '991', '2006-02-16T02:30:53', '2005-07-07T22:00:21', '2005-07-12T02:51:21', '1'), + ('434', '2179', '2006-02-16T02:30:53', '2005-06-20T10:45:20', '2005-06-23T06:29:20', '1'), + ('434', '218', '2006-02-16T02:30:53', '2005-07-27T19:18:17', '2005-07-30T18:55:17', '1'), + ('434', '3193', '2006-02-16T02:30:53', '2005-08-19T21:38:44', '2005-08-28T23:22:44', '2'), + ('434', '1041', '2006-02-16T02:30:53', '2005-08-02T13:32:00', '2005-08-10T19:24:00', '2'), + ('434', '1929', '2006-02-16T02:30:53', '2005-06-15T03:45:35', '2005-06-19T02:03:35', '1'), + ('434', '3545', '2006-02-16T02:30:53', '2005-06-16T04:50:50', '2005-06-21T22:51:50', '2'), + ('434', '1716', '2006-02-16T02:30:53', '2005-07-27T00:31:25', '2005-07-28T22:15:25', '2'), + ('434', '2033', '2006-02-16T02:30:53', '2005-06-20T12:28:03', '2005-06-21T08:21:03', '1'), + ('434', '1313', '2006-02-16T02:30:53', '2005-06-18T22:15:09', '2005-06-25T17:23:09', '1'), + ('522', '2482', '2006-02-16T02:30:53', '2005-07-30T20:44:10', '2005-08-06T21:13:10', '2'), + ('522', '3845', '2006-02-16T02:30:53', '2005-08-18T12:53:49', '2005-08-26T15:52:49', '1'), + ('522', '4156', '2006-02-16T02:30:53', '2005-07-31T01:18:10', '2005-08-07T19:58:10', '1'), + ('522', '1370', '2006-02-16T02:30:53', '2005-08-01T01:23:15', '2005-08-02T19:39:15', '1'), + ('522', '3713', '2006-02-16T02:30:53', '2005-08-17T12:53:15', '2005-08-25T08:08:15', '1'), + ('522', '1519', '2006-02-16T02:30:53', '2005-07-28T13:31:36', '2005-07-30T10:03:36', '1'), + ('522', '1144', '2006-02-16T02:30:53', '2005-06-20T16:55:55', '2005-06-29T13:49:55', '1'), + ('522', '256', '2006-02-16T02:30:53', '2005-07-30T06:56:33', '2005-08-08T06:40:33', '2'), + ('522', '1006', '2006-02-16T02:30:53', '2005-07-30T18:00:53', '2005-08-01T16:05:53', '1'), + ('522', '3012', '2006-02-16T02:30:53', '2005-07-08T11:38:48', '2005-07-13T15:59:48', '2'), + ('522', '1903', '2006-02-16T02:30:53', '2005-07-30T03:54:12', '2005-07-31T04:51:12', '1'), + ('522', '1946', '2006-02-16T02:30:53', '2005-08-01T07:56:32', '2005-08-10T04:58:32', '2'), + ('522', '983', '2006-02-16T02:30:53', '2005-07-10T02:17:31', '2005-07-16T02:57:31', '2'), + ('522', '4358', '2006-02-16T02:30:53', '2005-06-20T23:46:39', '2005-06-25T03:21:39', '2'), + ('522', '1671', '2006-02-16T02:30:53', '2005-07-07T05:05:05', '2005-07-10T05:39:05', '1'), + ('522', '3154', '2006-02-16T02:30:53', '2005-06-15T08:44:09', '2005-06-21T06:04:09', '1'), + ('522', '4097', '2006-02-16T02:30:53', '2005-07-27T11:15:36', '2005-07-30T10:49:36', '2'), + ('522', '223', '2006-02-16T02:30:53', '2005-08-23T18:06:54', '2005-08-30T20:19:54', '2'), + ('522', '3816', '2006-02-16T02:30:53', '2005-08-17T07:01:09', '2005-08-21T09:12:09', '2'), + ('522', '1951', '2006-02-16T02:30:53', '2005-07-10T22:14:30', '2005-07-15T01:32:30', '1'), + ('522', '2353', '2006-02-16T02:30:53', '2005-07-30T13:36:13', '2005-08-07T17:39:13', '1'), + ('522', '2016', '2006-02-16T02:30:53', '2005-08-01T22:54:27', '2005-08-07T02:15:27', '2'), + ('522', '1498', '2006-02-16T02:30:53', '2005-08-21T13:03:33', '2005-08-28T15:28:33', '1'), + ('522', '4446', '2006-02-16T02:30:53', '2005-08-20T06:06:17', '2005-08-26T00:53:17', '2'), + ('522', '287', '2006-02-16T02:30:53', '2005-07-08T05:08:55', '2005-07-16T05:44:55', '2'), + ('522', '2471', '2006-02-16T02:30:53', '2005-06-20T23:10:27', '2005-06-25T19:37:27', '2'), + ('522', '4566', '2006-02-16T02:30:53', '2005-07-06T04:42:47', '2005-07-10T00:49:47', '1'), + ('522', '1824', '2006-02-16T02:30:53', '2005-07-10T01:09:42', '2005-07-17T05:47:42', '1'), + ('522', '649', '2006-02-16T02:30:53', '2005-08-01T17:11:57', '2005-08-10T17:18:57', '1'), + ('522', '3947', '2006-02-16T02:30:53', '2005-07-29T14:38:17', '2005-08-03T14:41:17', '1'), + ('522', '1103', '2006-02-16T02:30:53', '2005-05-27T15:56:57', '2005-06-05T11:45:57', '1'), + ('522', '2691', '2006-02-16T02:30:53', '2005-07-09T14:25:01', '2005-07-16T17:28:01', '1'), + ('522', '357', '2006-02-16T02:30:53', '2005-07-28T22:18:38', '2005-08-06T02:43:38', '2'), + ('505', '2283', '2006-02-16T02:30:53', '2005-08-02T01:19:33', '2005-08-08T06:54:33', '1'), + ('505', '357', '2006-02-16T02:30:53', '2005-08-21T10:27:21', '2005-08-23T10:46:21', '2'), + ('505', '3928', '2006-02-16T02:30:53', '2005-08-17T15:40:47', '2005-08-20T19:55:47', '2'), + ('505', '819', '2006-02-16T02:30:53', '2005-07-08T02:22:45', '2005-07-14T20:53:45', '1'), + ('505', '3611', '2006-02-16T02:30:53', '2005-07-28T07:15:32', '2005-08-06T05:00:32', '1'), + ('505', '675', '2006-02-16T02:30:53', '2005-08-20T06:22:08', '2005-08-28T02:22:08', '1'), + ('505', '2262', '2006-02-16T02:30:53', '2005-08-01T01:10:33', '2005-08-10T02:45:33', '2'), + ('505', '837', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('505', '3128', '2006-02-16T02:30:53', '2005-05-28T19:14:09', '2005-06-05T14:01:09', '1'), + ('505', '786', '2006-02-16T02:30:53', '2005-06-20T19:41:28', '2005-06-28T00:32:28', '1'), + ('505', '2367', '2006-02-16T02:30:53', '2005-06-17T03:36:02', '2005-06-19T08:12:02', '2'), + ('505', '2847', '2006-02-16T02:30:53', '2005-06-16T20:17:20', '2005-06-20T23:55:20', '1'), + ('505', '1107', '2006-02-16T02:30:53', '2005-07-07T00:26:43', '2005-07-16T03:58:43', '2'), + ('505', '4155', '2006-02-16T02:30:53', '2005-06-19T18:04:18', '2005-06-28T23:52:18', '1'), + ('505', '1693', '2006-02-16T02:30:53', '2005-07-11T00:16:35', '2005-07-20T01:30:35', '2'), + ('505', '1925', '2006-02-16T02:30:53', '2005-08-02T10:08:40', '2005-08-05T14:59:40', '1'), + ('505', '4375', '2006-02-16T02:30:53', '2005-07-11T17:23:33', '2005-07-12T16:27:33', '2'), + ('505', '2489', '2006-02-16T02:30:53', '2005-07-12T00:27:08', '2005-07-14T03:12:08', '1'), + ('505', '1527', '2006-02-16T02:30:53', '2005-08-23T00:30:26', '2005-08-28T06:29:26', '1'), + ('505', '707', '2006-02-16T02:30:53', '2005-08-22T00:48:23', '2005-08-28T01:02:23', '1'), + ('505', '3453', '2006-02-16T02:30:53', '2005-05-26T01:34:28', '2005-05-29T04:00:28', '1'), + ('580', '4233', '2006-02-16T02:30:53', '2005-07-08T06:27:48', '2005-07-14T07:46:48', '1'), + ('580', '4450', '2006-02-16T02:30:53', '2005-08-02T10:10:56', '2005-08-10T11:20:56', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['9604', '9239', '9199', '10723', '7620', '8784', '12670', '6089', '3571', '15630', '1469', '611', '13313', '8839', '14818', '3867', '9460', '10965', '13742', '4169', '9865', '6170', '15157', '15947', '5937', '6321', '4947', '9368', '5899', '14853', '14273', '6452', '21', '12068', '9213', '2537', '9940', '10044', '9840', '15660', '3159', '411', '8456', '1276', '12267', '11604', '12977', '12646', '12044', '12497', '2692', '7985', '12891', '2145', '12749', '11822', '6808', '7425', '266', '12057', '7706', '7833', '6483', '3578', '10476', '14335', '10775', '11339', '7291', '12432', '3257', '4682', '6376', '2126', '15322', '12919', '3773', '97', '14448', '5254', '15293', '5125', '4637', '15922', '15786', '825', '4115', '13191', '3176', '1573', '9008', '6460', '7408', '14384', '13028', '12397', '384', '8138', '11086', '9117']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('580', '4342', '2006-02-16T02:30:53', '2005-07-31T03:47:12', '2005-08-03T06:48:12', '1'), + ('580', '1728', '2006-02-16T02:30:53', '2005-07-30T13:50:52', '2005-08-06T16:28:52', '1'), + ('580', '4336', '2006-02-16T02:30:53', '2005-07-30T12:38:00', '2005-08-01T07:09:00', '1'), + ('580', '2526', '2006-02-16T02:30:53', '2005-08-01T19:10:49', '2005-08-08T19:21:49', '2'), + ('580', '931', '2006-02-16T02:30:53', '2005-07-28T00:27:17', '2005-07-31T02:04:17', '1'), + ('580', '2308', '2006-02-16T02:30:53', '2005-07-29T20:35:37', '2005-07-30T17:22:37', '1'), + ('580', '1716', '2006-02-16T02:30:53', '2005-08-18T19:17:58', '2005-08-23T20:54:58', '2'), + ('580', '3298', '2006-02-16T02:30:53', '2005-07-11T05:45:59', '2005-07-17T11:04:59', '2'), + ('580', '4166', '2006-02-16T02:30:53', '2005-07-06T03:32:31', '2005-07-11T06:15:31', '1'), + ('580', '3590', '2006-02-16T02:30:53', '2005-08-23T07:29:13', '2005-08-31T04:33:13', '2'), + ('580', '2451', '2006-02-16T02:30:53', '2005-06-15T20:52:36', '2005-06-21T19:55:36', '1'), + ('580', '1230', '2006-02-16T02:30:53', '2005-05-28T15:18:18', '2005-05-31T20:15:18', '2'), + ('580', '3709', '2006-02-16T02:30:53', '2005-08-19T19:11:41', '2005-08-21T23:53:41', '2'), + ('580', '3440', '2006-02-16T02:30:53', '2005-07-29T22:52:34', '2005-08-05T03:24:34', '2'), + ('580', '1619', '2006-02-16T02:30:53', '2005-08-22T01:17:18', '2005-08-26T05:40:18', '1'), + ('580', '3620', '2006-02-16T02:30:53', '2005-07-06T17:52:19', '2005-07-13T21:48:19', '1'), + ('580', '4463', '2006-02-16T02:30:53', '2005-07-30T22:25:39', '2005-08-08T20:56:39', '2'), + ('580', '2192', '2006-02-16T02:30:53', '2005-08-02T04:00:19', '2005-08-09T03:27:19', '1'), + ('580', '1377', '2006-02-16T02:30:53', '2005-08-20T10:49:15', '2005-08-21T11:05:15', '2'), + ('580', '3360', '2006-02-16T02:30:53', '2005-07-07T09:39:18', '2005-07-11T13:43:18', '1'), + ('580', '1355', '2006-02-16T02:30:53', '2005-07-31T13:10:45', '2005-08-02T09:19:45', '2'), + ('580', '278', '2006-02-16T02:30:53', '2005-07-11T10:29:21', '2005-07-16T05:13:21', '2'), + ('580', '1909', '2006-02-16T02:30:53', '2005-08-22T14:30:09', '2005-08-29T18:28:09', '1'), + ('580', '1877', '2006-02-16T02:30:53', '2005-08-23T18:54:32', '2005-08-24T22:39:32', '2'), + ('580', '1579', '2006-02-16T02:30:53', '2005-07-10T22:16:08', '2005-07-16T03:08:08', '2'), + ('388', '2655', '2006-02-16T02:30:53', '2005-07-11T18:51:02', '2005-07-14T20:57:02', '2'), + ('388', '3905', '2006-02-16T02:30:53', '2005-07-08T22:49:37', '2005-07-17T21:03:37', '1'), + ('388', '3026', '2006-02-16T02:30:53', '2005-07-30T18:50:53', '2005-08-05T17:56:53', '2'), + ('388', '1391', '2006-02-16T02:30:53', '2005-07-10T20:21:52', '2005-07-13T00:46:52', '1'), + ('388', '3575', '2006-02-16T02:30:53', '2005-08-22T02:26:33', '2005-08-31T02:49:33', '2'), + ('388', '2640', '2006-02-16T02:30:53', '2005-08-21T06:26:48', '2005-08-30T10:34:48', '1'), + ('388', '109', '2006-02-16T02:30:53', '2005-07-12T00:57:31', '2005-07-14T20:41:31', '1'), + ('388', '146', '2006-02-16T02:30:53', '2005-05-25T01:59:46', '2005-05-26T01:01:46', '2'), + ('388', '4327', '2006-02-16T02:30:53', '2005-08-17T21:37:08', '2005-08-26T00:10:08', '1'), + ('388', '184', '2006-02-16T02:30:53', '2005-07-30T13:07:11', '2005-08-01T15:30:11', '1'), + ('388', '3499', '2006-02-16T02:30:53', '2005-06-19T01:52:21', '2005-06-26T02:09:21', '1'), + ('388', '3975', '2006-02-16T02:30:53', '2005-07-31T15:29:06', '2005-08-06T14:26:06', '2'), + ('388', '3349', '2006-02-16T02:30:53', '2005-07-31T19:02:33', '2005-08-05T13:24:33', '2'), + ('388', '364', '2006-02-16T02:30:53', '2005-07-31T12:23:18', '2005-08-06T15:59:18', '1'), + ('388', '3223', '2006-02-16T02:30:53', '2005-08-23T08:51:21', '2005-08-28T06:26:21', '2'), + ('388', '33', '2006-02-16T02:30:53', '2005-06-20T21:11:50', '2005-06-29T19:35:50', '2'), + ('388', '1434', '2006-02-16T02:30:53', '2005-05-27T14:14:14', '2005-06-03T17:39:14', '1'), + ('388', '671', '2006-02-16T02:30:53', '2005-07-29T07:58:31', '2005-08-05T07:17:31', '2'), + ('388', '1508', '2006-02-16T02:30:53', '2005-06-15T08:00:13', '2005-06-24T02:55:13', '2'), + ('388', '652', '2006-02-16T02:30:53', '2005-08-18T04:24:30', '2005-08-26T03:01:30', '2'), + ('388', '1820', '2006-02-16T02:30:53', '2005-08-17T03:28:27', '2005-08-19T05:38:27', '2'), + ('388', '2004', '2006-02-16T02:30:53', '2005-08-19T06:55:33', '2005-08-27T07:38:33', '2'), + ('388', '3103', '2006-02-16T02:30:53', '2005-08-18T18:25:06', '2005-08-24T18:45:06', '1'), + ('388', '3377', '2006-02-16T02:30:53', '2005-08-17T20:39:37', '2005-08-19T18:34:37', '1'), + ('388', '824', '2006-02-16T02:30:53', '2005-08-18T12:58:40', '2005-08-24T08:24:40', '1'), + ('388', '3162', '2006-02-16T02:30:53', '2005-06-19T13:08:19', '2005-06-21T16:45:19', '1'), + ('388', '4022', '2006-02-16T02:30:53', '2005-07-28T14:29:01', '2005-08-03T17:20:01', '2'), + ('388', '2764', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('388', '238', '2006-02-16T02:30:53', '2005-06-17T22:10:36', '2005-06-18T21:07:36', '2'), + ('388', '828', '2006-02-16T02:30:53', '2005-08-18T22:31:21', '2005-08-20T22:53:21', '1'), + ('263', '1317', '2006-02-16T02:30:53', '2005-08-17T12:32:39', '2005-08-18T12:30:39', '2'), + ('263', '362', '2006-02-16T02:30:53', '2005-07-12T17:36:42', '2005-07-18T23:33:42', '2'), + ('263', '435', '2006-02-16T02:30:53', '2005-07-27T17:18:35', '2005-08-02T11:18:35', '1'), + ('263', '3303', '2006-02-16T02:30:53', '2005-05-26T16:08:05', '2005-05-27T10:55:05', '2'), + ('263', '1878', '2006-02-16T02:30:53', '2005-08-17T21:04:35', '2005-08-25T00:17:35', '1'), + ('263', '994', '2006-02-16T02:30:53', '2005-07-28T04:03:17', '2005-07-29T22:16:17', '2'), + ('263', '1166', '2006-02-16T02:30:53', '2005-07-28T08:46:14', '2005-08-04T06:13:14', '1'), + ('263', '1053', '2006-02-16T02:30:53', '2005-07-12T01:59:20', '2005-07-12T22:22:20', '2'), + ('263', '2954', '2006-02-16T02:30:53', '2005-07-06T03:47:05', '2005-07-08T02:26:05', '1'), + ('263', '1993', '2006-02-16T02:30:53', '2005-08-01T10:03:20', '2005-08-10T06:52:20', '1'), + ('263', '2610', '2006-02-16T02:30:53', '2005-08-21T08:33:07', '2005-08-26T14:16:07', '1'), + ('263', '4190', '2006-02-16T02:30:53', '2005-08-01T20:59:52', '2005-08-04T19:31:52', '2'), + ('263', '705', '2006-02-16T02:30:53', '2005-08-02T17:02:06', '2005-08-08T21:12:06', '1'), + ('263', '310', '2006-02-16T02:30:53', '2005-07-27T12:30:47', '2005-08-01T12:45:47', '1'), + ('263', '2543', '2006-02-16T02:30:53', '2005-08-18T10:35:13', '2005-08-26T08:20:13', '2'), + ('263', '3975', '2006-02-16T02:30:53', '2005-06-21T03:47:19', '2005-06-28T01:24:19', '2'), + ('263', '873', '2006-02-16T02:30:53', '2005-07-08T10:38:27', '2005-07-11T06:29:27', '2'), + ('263', '1834', '2006-02-16T02:30:53', '2005-07-11T21:40:23', '2005-07-13T23:16:23', '1'), + ('263', '4276', '2006-02-16T02:30:53', '2005-06-17T20:54:36', '2005-06-27T02:16:36', '1'), + ('263', '3553', '2006-02-16T02:30:53', '2005-08-22T20:20:30', '2005-08-25T01:26:30', '2'), + ('263', '2121', '2006-02-16T02:30:53', '2005-08-19T04:32:15', '2005-08-24T05:56:15', '2'), + ('263', '2034', '2006-02-16T02:30:53', '2005-07-06T13:23:34', '2005-07-08T17:23:34', '2'), + ('263', '1283', '2006-02-16T02:30:53', '2005-05-25T16:34:24', '2005-05-28T12:13:24', '2'), + ('263', '1937', '2006-02-16T02:30:53', '2005-08-21T12:13:10', '2005-08-30T08:46:10', '1'), + ('263', '654', '2006-02-16T02:30:53', '2005-07-09T13:50:11', '2005-07-13T09:07:11', '1'), + ('263', '1219', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('263', '990', '2006-02-16T02:30:53', '2005-07-09T07:25:28', '2005-07-12T12:34:28', '1'), + ('263', '1917', '2006-02-16T02:30:53', '2005-07-08T08:49:54', '2005-07-11T13:12:54', '2'), + ('263', '1702', '2006-02-16T02:30:53', '2005-08-23T18:07:31', '2005-09-01T22:27:31', '1'), + ('371', '3132', '2006-02-16T02:30:53', '2005-08-23T13:48:34', '2005-08-27T15:59:34', '1'), + ('371', '712', '2006-02-16T02:30:53', '2005-05-29T21:49:41', '2005-06-04T20:27:41', '2'), + ('371', '102', '2006-02-16T02:30:53', '2005-07-07T06:52:23', '2005-07-14T06:12:23', '2'), + ('371', '2753', '2006-02-16T02:30:53', '2005-08-19T14:28:48', '2005-08-23T12:53:48', '2'), + ('371', '1982', '2006-02-16T02:30:53', '2005-06-20T22:31:54', '2005-06-25T02:58:54', '1'), + ('371', '4536', '2006-02-16T02:30:53', '2005-06-16T03:31:39', '2005-06-25T04:04:39', '1'), + ('371', '3592', '2006-02-16T02:30:53', '2005-07-30T05:10:26', '2005-07-31T08:13:26', '1'), + ('371', '2402', '2006-02-16T02:30:53', '2005-07-12T01:13:44', '2005-07-17T04:51:44', '2'), + ('371', '625', '2006-02-16T02:30:53', '2005-07-27T16:31:40', '2005-07-31T11:56:40', '2'), + ('371', '2429', '2006-02-16T02:30:53', '2005-08-21T10:02:37', '2005-08-26T08:20:37', '1'), + ('371', '2165', '2006-02-16T02:30:53', '2005-08-19T08:27:23', '2005-08-24T03:46:23', '1'), + ('371', '1872', '2006-02-16T02:30:53', '2005-08-18T09:12:52', '2005-08-27T10:44:52', '2'), + ('371', '910', '2006-02-16T02:30:53', '2005-05-27T10:18:20', '2005-06-02T09:21:20', '2'), + ('371', '1258', '2006-02-16T02:30:53', '2005-07-28T20:12:17', '2005-08-01T15:21:17', '2'), + ('371', '552', '2006-02-16T02:30:53', '2005-08-02T07:38:44', '2005-08-11T06:30:44', '1'), + ('371', '3055', '2006-02-16T02:30:53', '2005-07-30T09:20:59', '2005-08-07T08:47:59', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['829', '5171', '12584', '13143', '1218', '13953', '286', '2837', '1212', '6000', '3396', '9635', '6922', '15824', '5614', '381', '1675', '4612', '26', '5543', '1873', '5281', '8128', '7550', '2374', '14781', '6020', '5814', '14228', '3345', '16000', '5770', '14105', '8789', '272', '8783', '199', '7982', '8574', '8293', '15704', '6739', '4614', '8668', '8956', '7160', '5358', '14904', '12417', '792', '6743', '1877', '10246', '9842', '1760', '5449', '2392', '11928', '3363', '11834', '13849', '15397', '2072', '9552', '542', '465', '13245', '12', '1988', '12327', '6515', '5122', '9869', '13506', '13669', '2815', '3038', '1699', '11740', '12531', '6658', '4510', '9636', '6115', '1960', '10852', '7927', '11661', '1480', '1310', '12021', '2512', '4038', '787', '3420', '9673', '5552', '9908', '13816', '10794']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('371', '1684', '2006-02-16T02:30:53', '2005-05-29T22:16:42', '2005-06-06T01:38:42', '1'), + ('371', '2099', '2006-02-16T02:30:53', '2005-07-09T09:26:55', '2005-07-10T10:34:55', '1'), + ('371', '4487', '2006-02-16T02:30:53', '2005-08-18T15:51:36', '2005-08-25T19:21:36', '1'), + ('371', '1655', '2006-02-16T02:30:53', '2005-08-19T12:44:38', '2005-08-25T10:59:38', '2'), + ('371', '239', '2006-02-16T02:30:53', '2005-06-15T03:24:44', '2005-06-21T22:45:44', '2'), + ('371', '1818', '2006-02-16T02:30:53', '2005-08-20T18:00:37', '2005-08-28T14:52:37', '1'), + ('371', '314', '2006-02-16T02:30:53', '2005-05-26T19:44:51', '2005-06-04T18:00:51', '2'), + ('371', '417', '2006-02-16T02:30:53', '2005-06-19T22:03:50', '2005-06-20T21:24:50', '1'), + ('371', '3611', '2006-02-16T02:30:53', '2005-06-15T03:03:33', '2005-06-17T06:31:33', '1'), + ('371', '1986', '2006-02-16T02:30:53', '2005-07-11T01:23:06', '2005-07-12T04:39:06', '2'), + ('371', '2744', '2006-02-16T02:30:53', '2005-06-21T15:23:08', '2005-06-23T10:25:08', '1'), + ('371', '1687', '2006-02-16T02:30:53', '2005-07-31T05:12:27', '2005-08-02T00:24:27', '2'), + ('371', '1114', '2006-02-16T02:30:53', '2005-07-12T22:39:48', '2005-07-14T18:35:48', '1'), + ('371', '2933', '2006-02-16T02:30:53', '2005-08-23T15:09:17', '2005-08-28T15:14:17', '2'), + ('371', '133', '2006-02-16T02:30:53', '2005-07-10T05:16:56', '2005-07-13T02:03:56', '1'), + ('371', '2748', '2006-02-16T02:30:53', '2005-05-27T09:43:25', '2005-05-31T12:00:25', '1'), + ('371', '3048', '2006-02-16T02:30:53', '2005-06-16T11:04:47', '2005-06-24T06:56:47', '2'), + ('371', '82', '2006-02-16T02:30:53', '2005-07-08T07:40:44', '2005-07-12T03:48:44', '1'), + ('371', '4371', '2006-02-16T02:30:53', '2005-05-25T03:36:50', '2005-05-31T00:34:50', '1'), + ('71', '1496', '2006-02-16T02:30:53', '2005-07-10T02:48:03', '2005-07-17T05:49:03', '2'), + ('71', '2933', '2006-02-16T02:30:53', '2005-06-17T02:38:28', '2005-06-23T04:39:28', '1'), + ('71', '1966', '2006-02-16T02:30:53', '2005-07-09T14:55:07', '2005-07-13T15:24:07', '2'), + ('71', '2872', '2006-02-16T02:30:53', '2005-07-28T19:46:06', '2005-08-06T16:10:06', '2'), + ('71', '4488', '2006-02-16T02:30:53', '2005-07-27T21:55:07', '2005-07-28T23:34:07', '2'), + ('71', '2634', '2006-02-16T02:30:53', '2005-06-18T14:44:06', '2005-06-22T17:14:06', '1'), + ('71', '3458', '2006-02-16T02:30:53', '2005-08-22T00:15:12', '2005-08-29T21:02:12', '1'), + ('71', '1974', '2006-02-16T02:30:53', '2005-07-11T02:08:55', '2005-07-16T22:07:55', '1'), + ('71', '2537', '2006-02-16T02:30:53', '2005-07-10T15:46:50', '2005-07-13T15:28:50', '2'), + ('71', '2016', '2006-02-16T02:30:53', '2005-08-21T04:57:08', '2005-08-25T00:06:08', '2'), + ('71', '4442', '2006-02-16T02:30:53', '2005-06-21T11:05:07', '2005-06-26T15:14:07', '2'), + ('71', '282', '2006-02-16T02:30:53', '2005-08-23T20:44:36', '2005-08-25T02:29:36', '1'), + ('71', '914', '2006-02-16T02:30:53', '2005-07-10T13:21:28', '2005-07-11T08:59:28', '2'), + ('71', '1111', '2006-02-16T02:30:53', '2005-08-21T00:44:34', '2005-08-29T19:00:34', '1'), + ('71', '3062', '2006-02-16T02:30:53', '2005-07-29T20:47:27', '2005-08-05T18:36:27', '1'), + ('71', '971', '2006-02-16T02:30:53', '2005-05-26T16:27:11', '2005-06-03T13:10:11', '2'), + ('71', '2316', '2006-02-16T02:30:53', '2005-07-29T20:31:28', '2005-08-02T19:33:28', '2'), + ('71', '2135', '2006-02-16T02:30:53', '2005-05-26T07:11:58', '2005-05-28T09:06:58', '1'), + ('71', '668', '2006-02-16T02:30:53', '2005-07-28T14:19:59', '2005-07-29T14:09:59', '2'), + ('71', '2949', '2006-02-16T02:30:53', '2005-07-29T11:51:53', '2005-08-03T05:59:53', '2'), + ('71', '831', '2006-02-16T02:30:53', '2005-07-29T02:30:50', '2005-08-04T03:09:50', '2'), + ('71', '738', '2006-02-16T02:30:53', '2005-08-23T10:25:45', '2005-08-29T16:06:45', '2'), + ('71', '1221', '2006-02-16T02:30:53', '2005-07-12T14:22:08', '2005-07-18T16:57:08', '2'), + ('71', '2579', '2006-02-16T02:30:53', '2005-07-08T07:45:17', '2005-07-12T02:10:17', '2'), + ('71', '4531', '2006-02-16T02:30:53', '2005-07-29T15:41:31', '2005-08-01T16:20:31', '2'), + ('71', '2129', '2006-02-16T02:30:53', '2005-07-30T03:32:29', '2005-08-01T03:08:29', '2'), + ('71', '3905', '2006-02-16T02:30:53', '2005-07-27T07:26:06', '2005-07-31T04:54:06', '2'), + ('71', '3764', '2006-02-16T02:30:53', '2005-07-09T18:09:21', '2005-07-14T23:59:21', '2'), + ('71', '722', '2006-02-16T02:30:53', '2005-08-22T04:32:01', '2005-08-29T05:21:01', '1'), + ('71', '3500', '2006-02-16T02:30:53', '2005-08-18T09:57:00', '2005-08-19T08:56:00', '1'), + ('261', '2841', '2006-02-16T02:30:53', '2005-05-29T16:32:10', '2005-05-31T18:01:10', '1'), + ('261', '158', '2006-02-16T02:30:53', '2005-07-12T14:29:25', '2005-07-13T13:13:25', '1'), + ('261', '3404', '2006-02-16T02:30:53', '2005-06-17T02:54:16', '2005-06-25T21:51:16', '2'), + ('261', '3598', '2006-02-16T02:30:53', '2005-08-01T02:29:50', '2005-08-09T01:17:50', '2'), + ('261', '2896', '2006-02-16T02:30:53', '2005-07-31T12:24:58', '2005-08-02T11:01:58', '2'), + ('261', '3929', '2006-02-16T02:30:53', '2005-06-16T17:48:37', '2005-06-18T16:01:37', '2'), + ('261', '921', '2006-02-16T02:30:53', '2005-07-09T22:12:01', '2005-07-18T01:18:01', '2'), + ('261', '2213', '2006-02-16T02:30:53', '2005-06-18T15:34:18', '2005-06-19T16:22:18', '1'), + ('261', '79', '2006-02-16T02:30:53', '2005-08-17T16:28:24', '2005-08-23T17:50:24', '2'), + ('261', '538', '2006-02-16T02:30:53', '2005-06-21T12:25:07', '2005-06-27T11:52:07', '2'), + ('261', '2407', '2006-02-16T02:30:53', '2005-08-17T13:00:40', '2005-08-22T12:50:40', '1'), + ('261', '3774', '2006-02-16T02:30:53', '2005-08-20T14:42:34', '2005-08-24T13:09:34', '2'), + ('261', '1482', '2006-02-16T02:30:53', '2005-08-22T23:08:46', '2005-08-25T20:58:46', '1'), + ('261', '86', '2006-02-16T02:30:53', '2005-06-17T16:33:32', '2005-06-23T13:22:32', '1'), + ('261', '3544', '2006-02-16T02:30:53', '2005-07-31T02:05:32', '2005-08-01T06:59:32', '1'), + ('261', '4444', '2006-02-16T02:30:53', '2005-05-28T06:42:13', '2005-06-03T09:05:13', '1'), + ('261', '20', '2006-02-16T02:30:53', '2005-05-27T20:44:36', '2005-06-02T02:43:36', '1'), + ('261', '1001', '2006-02-16T02:30:53', '2005-08-19T16:43:41', '2005-08-20T21:17:41', '1'), + ('261', '1584', '2006-02-16T02:30:53', '2005-05-25T00:19:27', '2005-05-30T05:44:27', '2'), + ('261', '3054', '2006-02-16T02:30:53', '2005-06-17T10:42:34', '2005-06-25T11:47:34', '2'), + ('261', '2425', '2006-02-16T02:30:53', '2005-08-18T06:43:22', '2005-08-25T10:50:22', '2'), + ('261', '706', '2006-02-16T02:30:53', '2005-07-12T03:50:32', '2005-07-15T03:54:32', '2'), + ('261', '1423', '2006-02-16T02:30:53', '2005-07-09T07:19:35', '2005-07-16T03:04:35', '2'), + ('261', '783', '2006-02-16T02:30:53', '2005-07-31T13:21:54', '2005-08-07T09:09:54', '1'), + ('261', '1334', '2006-02-16T02:30:53', '2005-08-20T02:07:06', '2005-08-26T08:06:06', '1'), + ('261', '4504', '2006-02-16T02:30:53', '2005-08-20T08:26:32', '2005-08-27T08:10:32', '2'), + ('27', '3046', '2006-02-16T02:30:53', '2005-06-19T20:03:29', '2005-06-25T22:50:29', '2'), + ('27', '2919', '2006-02-16T02:30:53', '2005-06-20T12:28:59', '2005-06-25T07:48:59', '1'), + ('27', '4507', '2006-02-16T02:30:53', '2005-06-16T13:05:09', '2005-06-17T09:53:09', '2'), + ('27', '2441', '2006-02-16T02:30:53', '2005-08-17T08:48:31', '2005-08-24T07:47:31', '2'), + ('27', '2771', '2006-02-16T02:30:53', '2005-08-18T13:57:50', '2005-08-22T09:46:50', '2'), + ('27', '172', '2006-02-16T02:30:53', '2005-07-12T11:13:21', '2005-07-17T09:10:21', '2'), + ('27', '1085', '2006-02-16T02:30:53', '2005-07-08T02:34:51', '2005-07-17T06:03:51', '2'), + ('27', '1725', '2006-02-16T02:30:53', '2005-07-31T05:12:59', '2005-08-09T07:31:59', '2'), + ('27', '3415', '2006-02-16T02:30:53', '2005-07-11T07:36:50', '2005-07-13T11:30:50', '1'), + ('27', '2202', '2006-02-16T02:30:53', '2005-06-17T08:59:57', '2005-06-23T14:38:57', '2'), + ('27', '3862', '2006-02-16T02:30:53', '2005-08-02T00:00:33', '2005-08-03T23:09:33', '1'), + ('27', '1263', '2006-02-16T02:30:53', '2005-07-28T12:13:42', '2005-08-05T12:02:42', '1'), + ('27', '1008', '2006-02-16T02:30:53', '2005-08-17T05:25:57', '2005-08-25T04:37:57', '1'), + ('27', '2598', '2006-02-16T02:30:53', '2005-06-15T21:17:17', '2005-06-23T22:01:17', '1'), + ('27', '2045', '2006-02-16T02:30:53', '2005-06-15T10:11:42', '2005-06-16T15:00:42', '1'), + ('27', '3977', '2006-02-16T02:30:53', '2005-08-17T19:52:43', '2005-08-23T21:49:43', '1'), + ('27', '4515', '2006-02-16T02:30:53', '2005-06-18T23:48:47', '2005-06-21T04:58:47', '2'), + ('27', '1264', '2006-02-16T02:30:53', '2005-07-07T02:52:53', '2005-07-11T22:32:53', '2'), + ('27', '3919', '2006-02-16T02:30:53', '2005-05-29T16:03:03', '2005-06-07T11:07:03', '2'), + ('27', '2523', '2006-02-16T02:30:53', '2005-06-21T17:22:36', '2005-06-28T12:34:36', '1'), + ('27', '339', '2006-02-16T02:30:53', '2005-07-31T06:34:55', '2005-08-09T09:15:55', '2'), + ('27', '2879', '2006-02-16T02:30:53', '2005-07-10T03:01:19', '2005-07-13T06:53:19', '2'), + ('27', '4408', '2006-02-16T02:30:53', '2005-07-31T14:39:52', '2005-08-09T09:46:52', '2'), + ('27', '273', '2006-02-16T02:30:53', '2005-08-20T13:13:56', '2005-08-25T09:46:56', '1'), + ('27', '889', '2006-02-16T02:30:53', '2005-08-01T21:51:15', '2005-08-10T18:51:15', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['9244', '5736', '11234', '12461', '15048', '6562', '10221', '13329', '6202', '13467', '12748', '257', '6944', '8611', '7206', '11663', '3667', '15014', '4325', '12536', '1472', '9397', '3609', '11976', '3161', '11739', '11512', '12780', '10758', '11066', '6311', '12142', '9966', '9480', '7094', '7615', '10010', '5120', '15068', '9327', '13299', '11378', '2515', '10494', '7556', '15409', '2733', '10453', '3848', '1527', '5356', '13570', '14399', '13787', '14809', '15319', '15474', '14503', '10757', '10719', '6555', '9613', '1927', '4150', '5729', '7042', '7646', '11979', '13758', '5943', '3442', '13268', '13154', '8562', '7475', '14600', '12176', '5706', '9061', '13683', '1420', '1681', '1235', '4547', '11889', '4185', '1603', '4393', '5087', '5136', '15970', '14471', '3389', '1270', '3310', '3684', '7986', '3030', '15856', '1562']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('27', '3640', '2006-02-16T02:30:53', '2005-07-30T14:06:53', '2005-08-03T19:46:53', '1'), + ('27', '1172', '2006-02-16T02:30:53', '2005-07-10T11:45:48', '2005-07-13T16:40:48', '1'), + ('27', '1020', '2006-02-16T02:30:53', '2005-08-02T13:12:17', '2005-08-05T17:37:17', '1'), + ('27', '1569', '2006-02-16T02:30:53', '2005-08-18T11:28:14', '2005-08-21T09:47:14', '1'), + ('27', '2895', '2006-02-16T02:30:53', '2005-08-22T10:00:04', '2005-08-26T08:26:04', '1'), + ('27', '3969', '2006-02-16T02:30:53', '2005-07-12T05:26:26', '2005-07-16T05:10:26', '2'), + ('373', '3051', '2006-02-16T02:30:53', '2005-08-01T01:16:50', '2005-08-03T05:35:50', '2'), + ('373', '3136', '2006-02-16T02:30:53', '2005-08-19T19:56:55', '2005-08-25T01:19:55', '2'), + ('373', '1424', '2006-02-16T02:30:53', '2005-07-11T12:24:25', '2005-07-18T08:13:25', '1'), + ('373', '696', '2006-02-16T02:30:53', '2005-08-20T00:56:44', '2005-08-20T20:16:44', '1'), + ('373', '3249', '2006-02-16T02:30:53', '2005-08-18T22:29:05', '2005-08-24T18:25:05', '2'), + ('373', '2570', '2006-02-16T02:30:53', '2005-05-26T15:27:05', '2005-05-29T16:25:05', '2'), + ('373', '1168', '2006-02-16T02:30:53', '2005-07-26T23:34:02', '2005-08-05T01:27:02', '1'), + ('373', '610', '2006-02-16T02:30:53', '2005-07-29T13:26:21', '2005-08-07T18:20:21', '2'), + ('373', '3752', '2006-02-16T02:30:53', '2005-07-27T09:07:05', '2005-07-31T03:13:05', '2'), + ('373', '3798', '2006-02-16T02:30:53', '2005-08-17T05:30:19', '2005-08-25T08:14:19', '1'), + ('373', '447', '2006-02-16T02:30:53', '2005-07-06T08:36:34', '2005-07-15T04:25:34', '2'), + ('373', '3678', '2006-02-16T02:30:53', '2005-08-22T08:43:11', '2005-08-31T02:55:11', '1'), + ('373', '3728', '2006-02-16T02:30:53', '2005-07-07T17:59:24', '2005-07-16T17:10:24', '2'), + ('373', '2343', '2006-02-16T02:30:53', '2005-08-18T14:06:06', '2005-08-25T14:21:06', '1'), + ('373', '4233', '2006-02-16T02:30:53', '2005-06-15T20:54:55', '2005-06-24T21:52:55', '2'), + ('373', '1550', '2006-02-16T02:30:53', '2005-07-30T20:07:29', '2005-08-05T00:36:29', '1'), + ('373', '1064', '2006-02-16T02:30:53', '2005-07-06T05:36:22', '2005-07-10T05:55:22', '1'), + ('373', '498', '2006-02-16T02:30:53', '2005-08-17T17:59:19', '2005-08-23T14:51:19', '2'), + ('373', '1326', '2006-02-16T02:30:53', '2005-06-20T21:21:01', '2005-06-21T18:22:01', '2'), + ('373', '4568', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('373', '1248', '2006-02-16T02:30:53', '2005-08-16T23:51:06', '2005-08-26T02:06:06', '2'), + ('373', '54', '2006-02-16T02:30:53', '2005-08-18T23:48:16', '2005-08-20T18:13:16', '2'), + ('373', '191', '2006-02-16T02:30:53', '2005-08-01T20:22:51', '2005-08-10T16:11:51', '1'), + ('373', '4213', '2006-02-16T02:30:53', '2005-08-02T06:58:32', '2005-08-10T01:27:32', '2'), + ('373', '1789', '2006-02-16T02:30:53', '2005-07-11T18:18:52', '2005-07-16T17:52:52', '2'), + ('373', '3748', '2006-02-16T02:30:53', '2005-08-18T00:04:12', '2005-08-24T01:24:12', '2'), + ('373', '4137', '2006-02-16T02:30:53', '2005-07-31T16:26:46', '2005-08-03T14:29:46', '1'), + ('373', '597', '2006-02-16T02:30:53', '2005-07-30T23:26:03', '2005-08-04T21:18:03', '2'), + ('373', '867', '2006-02-16T02:30:53', '2005-07-27T04:47:33', '2005-07-31T04:07:33', '2'), + ('373', '3884', '2006-02-16T02:30:53', '2005-07-28T00:15:24', '2005-07-31T02:00:24', '1'), + ('373', '2655', '2006-02-16T02:30:53', '2005-07-31T18:01:36', '2005-08-07T20:27:36', '2'), + ('373', '4431', '2006-02-16T02:30:53', '2005-07-09T07:14:23', '2005-07-14T04:00:23', '2'), + ('373', '3268', '2006-02-16T02:30:53', '2005-08-22T10:50:13', '2005-08-26T05:04:13', '2'), + ('373', '345', '2006-02-16T02:30:53', '2005-07-30T17:31:03', '2005-08-08T19:16:03', '1'), + ('373', '4385', '2006-02-16T02:30:53', '2005-08-19T18:46:33', '2005-08-22T20:45:33', '1'), + ('188', '3824', '2006-02-16T02:30:53', '2005-08-02T18:16:52', '2005-08-03T14:25:52', '1'), + ('188', '3213', '2006-02-16T02:30:53', '2005-06-18T23:57:31', '2005-06-22T05:31:31', '2'), + ('188', '847', '2006-02-16T02:30:53', '2005-08-01T10:45:21', '2005-08-02T12:34:21', '1'), + ('188', '794', '2006-02-16T02:30:53', '2005-07-27T22:17:17', '2005-07-28T19:17:17', '2'), + ('188', '560', '2006-02-16T02:30:53', '2005-08-22T23:26:32', '2005-08-24T22:44:32', '1'), + ('188', '1535', '2006-02-16T02:30:53', '2005-06-19T15:21:53', '2005-06-23T11:58:53', '2'), + ('188', '1531', '2006-02-16T02:30:53', '2005-08-01T09:13:27', '2005-08-08T11:34:27', '2'), + ('188', '2906', '2006-02-16T02:30:53', '2005-07-06T16:47:32', '2005-07-14T15:00:32', '1'), + ('188', '296', '2006-02-16T02:30:53', '2005-06-16T00:31:40', '2005-06-21T05:20:40', '1'), + ('188', '2905', '2006-02-16T02:30:53', '2005-07-09T18:08:28', '2005-07-14T14:11:28', '2'), + ('188', '2808', '2006-02-16T02:30:53', '2005-08-20T05:04:57', '2005-08-24T06:19:57', '2'), + ('188', '3582', '2006-02-16T02:30:53', '2005-08-21T10:33:23', '2005-08-27T08:00:23', '1'), + ('188', '253', '2006-02-16T02:30:53', '2005-08-20T12:15:23', '2005-08-27T06:24:23', '2'), + ('188', '1077', '2006-02-16T02:30:53', '2005-08-22T01:00:42', '2005-08-29T19:55:42', '1'), + ('188', '3041', '2006-02-16T02:30:53', '2005-08-22T20:17:17', '2005-08-25T01:06:17', '2'), + ('188', '3015', '2006-02-16T02:30:53', '2005-08-23T01:39:10', '2005-08-23T21:46:10', '2'), + ('188', '2144', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('188', '102', '2006-02-16T02:30:53', '2005-08-01T20:22:44', '2005-08-04T19:48:44', '2'), + ('188', '3861', '2006-02-16T02:30:53', '2005-08-01T19:00:28', '2005-08-07T17:04:28', '1'), + ('188', '1282', '2006-02-16T02:30:53', '2005-07-12T05:08:16', '2005-07-14T04:09:16', '1'), + ('188', '3251', '2006-02-16T02:30:53', '2005-07-31T03:58:53', '2005-08-02T00:10:53', '1'), + ('188', '3304', '2006-02-16T02:30:53', '2005-06-17T06:48:19', '2005-06-21T03:23:19', '1'), + ('188', '4424', '2006-02-16T02:30:53', '2005-07-07T08:43:22', '2005-07-08T05:21:22', '2'), + ('188', '4137', '2006-02-16T02:30:53', '2005-07-10T11:27:25', '2005-07-15T06:13:25', '2'), + ('188', '399', '2006-02-16T02:30:53', '2005-07-27T03:20:18', '2005-08-01T02:23:18', '1'), + ('255', '1615', '2006-02-16T02:30:53', '2005-07-28T01:31:45', '2005-07-31T07:16:45', '1'), + ('255', '568', '2006-02-16T02:30:53', '2005-08-17T18:07:13', '2005-08-19T23:12:13', '1'), + ('255', '864', '2006-02-16T02:30:53', '2005-08-20T11:21:26', '2005-08-29T14:37:26', '2'), + ('255', '3019', '2006-02-16T02:30:53', '2005-07-10T22:48:13', '2005-07-16T01:33:13', '1'), + ('255', '1896', '2006-02-16T02:30:53', '2005-06-21T20:06:51', '2005-06-25T17:35:51', '2'), + ('255', '1166', '2006-02-16T02:30:53', '2005-08-19T17:33:50', '2005-08-25T17:15:50', '2'), + ('255', '2465', '2006-02-16T02:30:53', '2005-08-19T13:09:54', '2005-08-26T16:40:54', '1'), + ('255', '3595', '2006-02-16T02:30:53', '2005-07-29T11:32:13', '2005-07-30T08:23:13', '2'), + ('255', '1670', '2006-02-16T02:30:53', '2005-07-27T19:07:43', '2005-08-04T22:12:43', '2'), + ('255', '3532', '2006-02-16T02:30:53', '2005-08-21T17:45:21', '2005-08-28T19:03:21', '1'), + ('255', '3873', '2006-02-16T02:30:53', '2005-08-18T01:10:33', '2005-08-24T02:45:33', '2'), + ('255', '3701', '2006-02-16T02:30:53', '2005-07-10T10:21:46', '2005-07-16T04:37:46', '2'), + ('255', '1933', '2006-02-16T02:30:53', '2005-07-30T07:21:52', '2005-08-08T10:52:52', '1'), + ('255', '1729', '2006-02-16T02:30:53', '2005-08-20T08:54:55', '2005-08-24T14:10:55', '2'), + ('255', '4149', '2006-02-16T02:30:53', '2005-06-15T17:56:14', '2005-06-24T15:45:14', '2'), + ('255', '530', '2006-02-16T02:30:53', '2005-06-16T11:38:17', '2005-06-19T13:05:17', '1'), + ('255', '1000', '2006-02-16T02:30:53', '2005-06-15T04:31:28', '2005-06-22T10:08:28', '1'), + ('255', '3386', '2006-02-16T02:30:53', '2005-07-08T04:20:19', '2005-07-09T00:28:19', '2'), + ('395', '293', '2006-02-16T02:30:53', '2005-08-17T15:08:27', '2005-08-18T17:10:27', '1'), + ('395', '2425', '2006-02-16T02:30:53', '2005-07-07T10:31:05', '2005-07-13T05:30:05', '2'), + ('395', '3308', '2006-02-16T02:30:53', '2005-06-16T06:14:03', '2005-06-17T06:04:03', '2'), + ('395', '4034', '2006-02-16T02:30:53', '2005-07-07T21:12:36', '2005-07-09T22:41:36', '2'), + ('395', '3716', '2006-02-16T02:30:53', '2005-07-09T05:44:28', '2005-07-10T02:25:28', '2'), + ('395', '3498', '2006-02-16T02:30:53', '2005-07-09T07:55:01', '2005-07-11T05:26:01', '2'), + ('395', '4509', '2006-02-16T02:30:53', '2005-08-23T19:54:24', '2005-08-24T18:07:24', '1'), + ('395', '1254', '2006-02-16T02:30:53', '2005-08-21T13:10:40', '2005-08-26T16:49:40', '1'), + ('395', '727', '2006-02-16T02:30:53', '2005-06-21T14:37:55', '2005-06-28T18:13:55', '1'), + ('395', '62', '2006-02-16T02:30:53', '2005-06-15T07:30:22', '2005-06-18T11:31:22', '2'), + ('395', '1717', '2006-02-16T02:30:53', '2005-06-21T08:04:51', '2005-06-22T04:20:51', '2'), + ('395', '3261', '2006-02-16T02:30:53', '2005-07-06T09:29:22', '2005-07-12T08:19:22', '1'), + ('395', '1283', '2006-02-16T02:30:53', '2005-07-28T14:30:13', '2005-08-05T09:35:13', '1'), + ('395', '1543', '2006-02-16T02:30:53', '2005-06-20T11:51:59', '2005-06-24T10:51:59', '1'), + ('395', '3379', '2006-02-16T02:30:53', '2005-08-23T15:59:12', '2005-08-25T15:36:12', '1'), + ('395', '595', '2006-02-16T02:30:53', '2005-06-16T02:46:27', '2005-06-23T00:56:27', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['15698', '14720', '7740', '9691', '12766', '11053', '6667', '6634', '4149', '10261', '10046', '3169', '1785', '5681', '13136', '1029', '7383', '905', '15138', '9615', '8261', '3000', '1136', '5641', '763', '10485', '5928', '5290', '16015', '8619', '9179', '14054', '1223', '10180', '794', '10165', '15388', '8089', '4291', '12076', '3095', '6802', '13244', '383', '13172', '12765', '10248', '14473', '2385', '5247', '3728', '7869', '15245', '4936', '11288', '7802', '5166', '11070', '15643', '1454', '8737', '3400', '15262', '3479', '9200', '8028', '4332', '3589', '3676', '9002', '10175', '5106', '5443', '15537', '14754', '10842', '3436', '5804', '6039', '12078', '3058', '3874', '11732', '15082', '2785', '4474', '9709', '925', '15133', '13148', '6200', '2469', '9466', '8954', '11281', '8106', '10595', '16030', '15889', '9789']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('395', '4465', '2006-02-16T02:30:53', '2005-08-23T10:11:40', '2005-08-28T08:50:40', '2'), + ('395', '3617', '2006-02-16T02:30:53', '2005-08-21T21:43:53', '2005-08-25T18:21:53', '1'), + ('395', '3613', '2006-02-16T02:30:53', '2005-07-28T05:23:36', '2005-08-01T02:20:36', '2'), + ('50', '2626', '2006-02-16T02:30:53', '2005-07-31T07:09:55', '2005-08-09T02:29:55', '1'), + ('50', '3737', '2006-02-16T02:30:53', '2005-08-18T23:25:20', '2005-08-27T04:43:20', '1'), + ('50', '2599', '2006-02-16T02:30:53', '2005-08-02T06:27:13', '2005-08-09T11:24:13', '2'), + ('50', '215', '2006-02-16T02:30:53', '2005-07-12T11:36:22', '2005-07-19T12:53:22', '1'), + ('50', '2943', '2006-02-16T02:30:53', '2005-07-12T09:37:18', '2005-07-13T09:28:18', '1'), + ('50', '3028', '2006-02-16T02:30:53', '2005-07-07T08:40:17', '2005-07-10T02:58:17', '2'), + ('50', '2346', '2006-02-16T02:30:53', '2005-08-01T02:58:27', '2005-08-01T21:55:27', '2'), + ('50', '4302', '2006-02-16T02:30:53', '2005-07-31T19:07:11', '2005-08-03T13:25:11', '1'), + ('50', '2437', '2006-02-16T02:30:53', '2005-06-20T21:55:54', '2005-06-25T19:45:54', '1'), + ('50', '3413', '2006-02-16T02:30:53', '2005-06-16T19:27:12', '2005-06-24T19:25:12', '1'), + ('50', '4176', '2006-02-16T02:30:53', '2005-07-10T08:48:39', '2005-07-18T07:17:39', '1'), + ('50', '2532', '2006-02-16T02:30:53', '2005-08-19T12:24:23', '2005-08-28T08:37:23', '2'), + ('50', '2082', '2006-02-16T02:30:53', '2005-05-31T03:52:02', '2005-06-06T08:10:02', '1'), + ('50', '3860', '2006-02-16T02:30:53', '2005-07-27T15:46:53', '2005-08-03T11:10:53', '1'), + ('50', '4372', '2006-02-16T02:30:53', '2005-05-30T10:25:00', '2005-06-06T06:23:00', '1'), + ('50', '2467', '2006-02-16T02:30:53', '2005-08-22T13:36:30', '2005-08-27T15:35:30', '1'), + ('50', '3370', '2006-02-16T02:30:53', '2005-07-31T03:59:56', '2005-08-02T00:46:56', '2'), + ('50', '1915', '2006-02-16T02:30:53', '2005-07-29T01:11:05', '2005-08-04T03:13:05', '2'), + ('50', '549', '2006-02-16T02:30:53', '2005-06-20T09:32:33', '2005-06-22T07:45:33', '1'), + ('50', '3963', '2006-02-16T02:30:53', '2005-05-31T19:19:36', '2005-06-09T16:04:36', '2'), + ('50', '3568', '2006-02-16T02:30:53', '2005-07-10T06:43:43', '2005-07-15T06:33:43', '1'), + ('50', '2022', '2006-02-16T02:30:53', '2005-05-29T11:32:15', '2005-05-31T17:31:15', '1'), + ('50', '29', '2006-02-16T02:30:53', '2005-08-01T10:20:34', '2005-08-09T09:20:34', '1'), + ('50', '4132', '2006-02-16T02:30:53', '2005-07-10T21:58:30', '2005-07-15T19:41:30', '1'), + ('50', '277', '2006-02-16T02:30:53', '2005-07-09T15:14:47', '2005-07-11T20:30:47', '2'), + ('50', '3113', '2006-02-16T02:30:53', '2005-08-23T21:25:03', '2005-08-24T20:05:03', '2'), + ('50', '2169', '2006-02-16T02:30:53', '2005-07-29T13:50:08', '2005-08-06T13:15:08', '1'), + ('50', '62', '2006-02-16T02:30:53', '2005-07-30T12:02:41', '2005-08-05T15:23:41', '2'), + ('50', '338', '2006-02-16T02:30:53', '2005-08-20T22:17:01', '2005-08-21T21:34:01', '1'), + ('50', '1299', '2006-02-16T02:30:53', '2005-06-15T03:38:53', '2005-06-20T01:00:53', '2'), + ('50', '757', '2006-02-16T02:30:53', '2005-07-31T23:57:43', '2005-08-09T04:04:43', '2'), + ('50', '1995', '2006-02-16T02:30:53', '2005-05-29T16:44:11', '2005-06-05T16:11:11', '1'), + ('50', '3476', '2006-02-16T02:30:53', '2005-07-31T23:21:23', '2005-08-06T18:06:23', '1'), + ('50', '3995', '2006-02-16T02:30:53', '2005-08-22T22:49:23', '2005-09-01T03:50:23', '2'), + ('50', '1414', '2006-02-16T02:30:53', '2005-07-28T18:26:47', '2005-08-03T21:28:47', '1'), + ('298', '2074', '2006-02-16T02:30:53', '2005-07-07T15:47:47', '2005-07-10T11:45:47', '1'), + ('298', '4278', '2006-02-16T02:30:53', '2005-08-17T21:58:19', '2005-08-20T22:10:19', '1'), + ('298', '3937', '2006-02-16T02:30:53', '2005-06-20T16:16:53', '2005-06-22T10:35:53', '2'), + ('298', '2942', '2006-02-16T02:30:53', '2005-07-12T17:14:17', '2005-07-17T11:54:17', '2'), + ('298', '3246', '2006-02-16T02:30:53', '2005-08-19T16:43:04', '2005-08-22T15:21:04', '2'), + ('298', '955', '2006-02-16T02:30:53', '2005-05-27T10:12:20', '2005-06-03T10:37:20', '1'), + ('298', '1301', '2006-02-16T02:30:53', '2005-08-19T13:49:07', '2005-08-20T19:39:07', '2'), + ('298', '2244', '2006-02-16T02:30:53', '2005-08-18T23:21:50', '2005-08-28T04:42:50', '2'), + ('298', '2146', '2006-02-16T02:30:53', '2005-08-01T02:35:28', '2005-08-08T02:24:28', '2'), + ('298', '2747', '2006-02-16T02:30:53', '2005-08-21T13:19:03', '2005-08-23T15:12:03', '1'), + ('298', '1641', '2006-02-16T02:30:53', '2005-06-18T15:22:40', '2005-06-26T10:02:40', '1'), + ('298', '1186', '2006-02-16T02:30:53', '2005-07-09T13:26:28', '2005-07-12T14:00:28', '2'), + ('298', '1798', '2006-02-16T02:30:53', '2005-07-06T11:29:00', '2005-07-11T06:28:00', '1'), + ('298', '3005', '2006-02-16T02:30:53', '2005-07-28T10:13:15', '2005-08-03T12:58:15', '1'), + ('298', '2545', '2006-02-16T02:30:53', '2005-08-22T17:49:35', '2005-08-26T18:25:35', '2'), + ('298', '2033', '2006-02-16T02:30:53', '2005-07-08T22:24:50', '2005-07-15T03:14:50', '2'), + ('298', '1478', '2006-02-16T02:30:53', '2005-08-02T14:54:08', '2005-08-11T12:22:08', '1'), + ('298', '1108', '2006-02-16T02:30:53', '2005-07-28T07:51:57', '2005-07-29T09:32:57', '1'), + ('298', '2771', '2006-02-16T02:30:53', '2005-07-09T09:15:48', '2005-07-16T06:04:48', '1'), + ('298', '4020', '2006-02-16T02:30:53', '2005-08-02T07:10:39', '2005-08-03T07:43:39', '1'), + ('298', '103', '2006-02-16T02:30:53', '2005-08-23T08:13:26', '2005-08-25T05:18:26', '2'), + ('298', '102', '2006-02-16T02:30:53', '2005-06-15T19:49:41', '2005-06-17T15:17:41', '2'), + ('298', '4154', '2006-02-16T02:30:53', '2005-07-29T18:32:13', '2005-08-05T21:07:13', '2'), + ('298', '1697', '2006-02-16T02:30:53', '2005-06-21T15:50:30', '2005-06-25T18:07:30', '1'), + ('298', '2534', '2006-02-16T02:30:53', '2005-08-22T18:25:21', '2005-08-28T22:19:21', '1'), + ('298', '2277', '2006-02-16T02:30:53', '2005-07-05T23:08:53', '2005-07-11T21:42:53', '1'), + ('137', '3277', '2006-02-16T02:30:53', '2005-07-30T12:39:52', '2005-08-08T09:43:52', '2'), + ('137', '2715', '2006-02-16T02:30:53', '2005-07-28T16:11:15', '2005-08-05T15:11:15', '1'), + ('137', '1714', '2006-02-16T02:30:53', '2005-07-07T18:25:26', '2005-07-16T15:05:26', '1'), + ('137', '3740', '2006-02-16T02:30:53', '2005-07-06T04:30:18', '2005-07-10T09:18:18', '1'), + ('137', '1967', '2006-02-16T02:30:53', '2005-07-06T09:10:37', '2005-07-14T08:24:37', '1'), + ('137', '1936', '2006-02-16T02:30:53', '2005-07-30T05:02:21', '2005-07-31T04:58:21', '1'), + ('137', '3672', '2006-02-16T02:30:53', '2005-07-31T23:40:11', '2005-08-09T02:22:11', '1'), + ('137', '110', '2006-02-16T02:30:53', '2005-07-09T06:40:24', '2005-07-13T10:28:24', '1'), + ('137', '2951', '2006-02-16T02:30:53', '2005-07-09T21:56:09', '2005-07-16T00:33:09', '2'), + ('137', '2958', '2006-02-16T02:30:53', '2005-08-23T04:00:30', '2005-08-24T01:45:30', '2'), + ('137', '2355', '2006-02-16T02:30:53', '2005-08-21T23:17:26', '2005-08-29T18:55:26', '2'), + ('137', '1300', '2006-02-16T02:30:53', '2005-08-01T23:41:24', '2005-08-11T03:48:24', '1'), + ('137', '2740', '2006-02-16T02:30:53', '2005-06-21T19:16:09', '2005-06-30T13:58:09', '2'), + ('137', '2168', '2006-02-16T02:30:53', '2005-07-10T15:06:31', '2005-07-14T11:00:31', '1'), + ('137', '1776', '2006-02-16T02:30:53', '2005-07-11T03:12:19', '2005-07-19T05:46:19', '1'), + ('137', '684', '2006-02-16T02:30:53', '2005-08-17T22:00:22', '2005-08-24T02:54:22', '2'), + ('137', '938', '2006-02-16T02:30:53', '2005-06-20T13:28:35', '2005-06-28T13:57:35', '2'), + ('137', '1870', '2006-02-16T02:30:53', '2005-07-06T18:06:12', '2005-07-12T16:55:12', '1'), + ('137', '460', '2006-02-16T02:30:53', '2005-08-17T08:29:46', '2005-08-23T14:21:46', '2'), + ('137', '2046', '2006-02-16T02:30:53', '2005-08-22T11:17:06', '2005-08-28T06:40:06', '1'), + ('137', '826', '2006-02-16T02:30:53', '2005-06-19T18:43:57', '2005-06-24T15:36:57', '2'), + ('137', '4474', '2006-02-16T02:30:53', '2005-07-08T00:26:56', '2005-07-12T23:07:56', '1'), + ('137', '2096', '2006-02-16T02:30:53', '2005-07-31T08:04:55', '2005-08-07T08:58:55', '1'), + ('137', '3203', '2006-02-16T02:30:53', '2005-05-30T12:13:52', '2005-06-02T14:41:52', '2'), + ('137', '3408', '2006-02-16T02:30:53', '2005-08-22T13:17:43', '2005-08-26T08:40:43', '1'), + ('137', '1762', '2006-02-16T02:30:53', '2005-08-19T12:55:30', '2005-08-21T11:01:30', '1'), + ('137', '3258', '2006-02-16T02:30:53', '2005-07-11T12:16:42', '2005-07-17T09:27:42', '2'), + ('137', '1993', '2006-02-16T02:30:53', '2005-06-18T20:24:23', '2005-06-27T15:39:23', '1'), + ('137', '2595', '2006-02-16T02:30:53', '2005-07-30T22:44:36', '2005-08-07T02:35:36', '2'), + ('137', '991', '2006-02-16T02:30:53', '2005-07-30T03:25:51', '2005-08-06T05:10:51', '2'), + ('137', '2210', '2006-02-16T02:30:53', '2005-08-02T14:35:01', '2005-08-07T17:28:01', '1'), + ('137', '963', '2006-02-16T02:30:53', '2005-07-28T19:02:46', '2005-07-30T20:48:46', '2'), + ('137', '966', '2006-02-16T02:30:53', '2005-08-01T14:16:28', '2005-08-03T10:37:28', '1'), + ('137', '4161', '2006-02-16T02:30:53', '2005-08-23T21:56:04', '2005-08-31T01:24:04', '2'), + ('137', '787', '2006-02-16T02:30:53', '2005-08-23T16:57:43', '2005-08-27T22:14:43', '1'), + ('137', '619', '2006-02-16T02:30:53', '2005-07-31T10:30:25', '2005-08-03T14:58:25', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['13776', '13472', '11057', '14728', '11909', '816', '2944', '4481', '12597', '8991', '5251', '12702', '4785', '11537', '12440', '1758', '15558', '11117', '6499', '12236', '4886', '4809', '15046', '10376', '4048', '11489', '4533', '12083', '3787', '12128', '5665', '10553', '12588', '13729', '6505', '15959', '3211', '7379', '11310', '9586', '7748', '15121', '5733', '7624', '8317', '6491', '10263', '1867', '14992', '4926', '9852', '665', '3130', '2829', '13074', '5487', '11723', '3382', '10605', '8728', '1318', '14344', '1778', '1520', '15030', '4624', '5931', '7473', '13806', '1849', '13059', '3938', '8661', '15938', '11305', '6493', '196', '13303', '14801', '13134', '7686', '13262', '5891', '4882', '6700', '2312', '12532', '567', '7051', '1976', '12454', '14472', '12166', '534', '4314', '15611', '9162', '8892', '1400', '9408']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('137', '2439', '2006-02-16T02:30:53', '2005-08-20T11:57:06', '2005-08-26T10:55:06', '1'), + ('137', '3074', '2006-02-16T02:30:53', '2005-08-20T01:03:31', '2005-08-28T02:54:31', '1'), + ('137', '3143', '2006-02-16T02:30:53', '2005-08-02T06:38:19', '2005-08-11T03:43:19', '1'), + ('474', '2671', '2006-02-16T02:30:53', '2005-08-21T22:15:36', '2005-08-25T17:14:36', '2'), + ('474', '871', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('474', '630', '2006-02-16T02:30:53', '2005-05-29T20:26:39', '2005-06-06T22:31:39', '2'), + ('474', '1550', '2006-02-16T02:30:53', '2005-06-20T05:43:42', '2005-06-29T09:40:42', '2'), + ('474', '1669', '2006-02-16T02:30:53', '2005-07-08T00:58:15', '2005-07-11T23:22:15', '2'), + ('474', '3804', '2006-02-16T02:30:53', '2005-08-18T16:34:02', '2005-08-25T17:30:02', '2'), + ('474', '4540', '2006-02-16T02:30:53', '2005-07-30T04:42:54', '2005-08-01T23:51:54', '1'), + ('474', '478', '2006-02-16T02:30:53', '2005-07-09T13:36:10', '2005-07-15T11:40:10', '1'), + ('474', '1884', '2006-02-16T02:30:53', '2005-08-18T20:30:33', '2005-08-27T01:22:33', '2'), + ('474', '58', '2006-02-16T02:30:53', '2005-07-08T16:10:19', '2005-07-11T18:52:19', '1'), + ('474', '190', '2006-02-16T02:30:53', '2005-08-17T00:41:08', '2005-08-19T00:25:08', '2'), + ('474', '2779', '2006-02-16T02:30:53', '2005-08-18T10:47:35', '2005-08-21T11:10:35', '2'), + ('474', '2654', '2006-02-16T02:30:53', '2005-06-16T17:39:39', '2005-06-25T13:06:39', '1'), + ('474', '638', '2006-02-16T02:30:53', '2005-08-23T04:52:22', '2005-09-01T02:26:22', '1'), + ('474', '1613', '2006-02-16T02:30:53', '2005-08-02T08:36:03', '2005-08-05T06:56:03', '2'), + ('474', '3165', '2006-02-16T02:30:53', '2005-07-12T03:11:18', '2005-07-21T07:50:18', '2'), + ('474', '1190', '2006-02-16T02:30:53', '2005-08-18T03:19:29', '2005-08-23T07:39:29', '2'), + ('474', '3393', '2006-02-16T02:30:53', '2005-07-08T19:53:22', '2005-07-09T17:05:22', '1'), + ('474', '4251', '2006-02-16T02:30:53', '2005-07-08T17:03:22', '2005-07-17T22:39:22', '1'), + ('474', '1536', '2006-02-16T02:30:53', '2005-08-22T09:54:54', '2005-08-26T07:34:54', '1'), + ('474', '4194', '2006-02-16T02:30:53', '2005-08-01T06:27:13', '2005-08-07T06:11:13', '2'), + ('474', '659', '2006-02-16T02:30:53', '2005-07-07T03:30:52', '2005-07-14T05:05:52', '2'), + ('474', '3001', '2006-02-16T02:30:53', '2005-08-02T22:35:28', '2005-08-04T00:29:28', '2'), + ('474', '1105', '2006-02-16T02:30:53', '2005-07-08T03:32:01', '2005-07-10T21:57:01', '1'), + ('474', '1985', '2006-02-16T02:30:53', '2005-08-17T22:13:37', '2005-08-19T19:01:37', '2'), + ('474', '288', '2006-02-16T02:30:53', '2005-07-06T14:02:01', '2005-07-09T19:09:01', '2'), + ('415', '2252', '2006-02-16T02:30:53', '2005-08-17T23:31:09', '2005-08-24T05:07:09', '2'), + ('415', '1175', '2006-02-16T02:30:53', '2005-07-10T08:10:08', '2005-07-11T05:22:08', '2'), + ('415', '2768', '2006-02-16T02:30:53', '2005-08-01T12:54:06', '2005-08-06T15:27:06', '1'), + ('415', '694', '2006-02-16T02:30:53', '2005-08-18T16:04:45', '2005-08-23T20:30:45', '1'), + ('415', '4108', '2006-02-16T02:30:53', '2005-08-20T10:17:08', '2005-08-28T15:35:08', '1'), + ('415', '3986', '2006-02-16T02:30:53', '2005-07-12T03:27:37', '2005-07-17T22:42:37', '2'), + ('415', '547', '2006-02-16T02:30:53', '2005-08-23T19:27:04', '2005-08-24T15:24:04', '1'), + ('415', '1150', '2006-02-16T02:30:53', '2005-06-21T01:01:29', '2005-06-23T04:05:29', '1'), + ('415', '424', '2006-02-16T02:30:53', '2005-07-27T15:36:43', '2005-07-30T16:37:43', '2'), + ('415', '3601', '2006-02-16T02:30:53', '2005-08-02T15:51:58', '2005-08-07T12:34:58', '1'), + ('415', '3987', '2006-02-16T02:30:53', '2005-07-31T03:07:16', '2005-08-04T00:39:16', '1'), + ('415', '3523', '2006-02-16T02:30:53', '2005-07-28T05:52:23', '2005-07-31T01:35:23', '2'), + ('415', '2981', '2006-02-16T02:30:53', '2005-08-22T12:46:37', '2005-08-25T17:42:37', '1'), + ('415', '3806', '2006-02-16T02:30:53', '2005-07-10T11:37:24', '2005-07-11T12:34:24', '2'), + ('415', '2756', '2006-02-16T02:30:53', '2005-07-28T00:37:44', '2005-07-30T21:26:44', '1'), + ('415', '3898', '2006-02-16T02:30:53', '2005-07-29T03:39:07', '2005-08-03T00:14:07', '1'), + ('415', '2803', '2006-02-16T02:30:53', '2005-07-12T02:28:31', '2005-07-21T00:38:31', '1'), + ('415', '2420', '2006-02-16T02:30:53', '2005-08-01T03:02:48', '2005-08-08T02:16:48', '2'), + ('415', '3537', '2006-02-16T02:30:53', '2005-06-17T02:01:37', '2005-06-25T04:52:37', '2'), + ('415', '4430', '2006-02-16T02:30:53', '2005-08-22T07:51:47', '2005-08-25T08:17:47', '2'), + ('415', '4155', '2006-02-16T02:30:53', '2005-07-08T22:01:48', '2005-07-18T03:27:48', '1'), + ('415', '4257', '2006-02-16T02:30:53', '2005-07-31T12:52:17', '2005-08-05T07:59:17', '2'), + ('415', '1012', '2006-02-16T02:30:53', '2005-05-28T21:38:39', '2005-05-29T21:37:39', '1'), + ('341', '2569', '2006-02-16T02:30:53', '2005-06-20T19:03:22', '2005-06-29T18:05:22', '2'), + ('341', '2047', '2006-02-16T02:30:53', '2005-06-19T21:11:30', '2005-06-24T18:10:30', '1'), + ('341', '3266', '2006-02-16T02:30:53', '2005-08-19T10:06:53', '2005-08-28T09:56:53', '2'), + ('341', '1144', '2006-02-16T02:30:53', '2005-07-10T00:01:50', '2005-07-10T20:43:50', '1'), + ('341', '1665', '2006-02-16T02:30:53', '2005-08-17T07:56:22', '2005-08-22T03:49:22', '1'), + ('341', '131', '2006-02-16T02:30:53', '2005-06-21T14:05:23', '2005-06-29T19:13:23', '2'), + ('341', '680', '2006-02-16T02:30:53', '2005-08-01T14:36:26', '2005-08-06T12:04:26', '2'), + ('341', '973', '2006-02-16T02:30:53', '2005-07-29T18:12:49', '2005-08-06T22:45:49', '1'), + ('341', '2760', '2006-02-16T02:30:53', '2005-06-15T10:34:26', '2005-06-20T16:20:26', '1'), + ('341', '1562', '2006-02-16T02:30:53', '2005-08-21T08:40:56', '2005-08-27T12:40:56', '1'), + ('341', '2512', '2006-02-16T02:30:53', '2005-06-16T18:54:48', '2005-06-22T16:08:48', '2'), + ('341', '3419', '2006-02-16T02:30:53', '2005-06-15T23:57:20', '2005-06-24T23:46:20', '1'), + ('341', '3168', '2006-02-16T02:30:53', '2005-08-22T09:10:21', '2005-08-24T06:00:21', '2'), + ('341', '1548', '2006-02-16T02:30:53', '2005-07-08T08:12:17', '2005-07-15T12:24:17', '2'), + ('341', '2259', '2006-02-16T02:30:53', '2005-07-10T22:04:19', '2005-07-13T00:45:19', '2'), + ('341', '401', '2006-02-16T02:30:53', '2005-07-27T19:05:40', '2005-08-05T14:47:40', '1'), + ('341', '444', '2006-02-16T02:30:53', '2005-08-20T12:53:46', '2005-08-21T10:36:46', '1'), + ('341', '2507', '2006-02-16T02:30:53', '2005-06-17T00:13:19', '2005-06-23T18:37:19', '2'), + ('341', '3810', '2006-02-16T02:30:53', '2005-08-19T09:42:01', '2005-08-21T12:07:01', '1'), + ('341', '1991', '2006-02-16T02:30:53', '2005-07-06T21:15:45', '2005-07-13T20:02:45', '2'), + ('341', '3409', '2006-02-16T02:30:53', '2005-07-29T15:28:24', '2005-08-05T20:04:24', '2'), + ('341', '2884', '2006-02-16T02:30:53', '2005-08-23T18:43:31', '2005-08-31T00:26:31', '2'), + ('341', '1690', '2006-02-16T02:30:53', '2005-08-02T15:44:55', '2005-08-08T16:42:55', '2'), + ('184', '16', '2006-02-16T02:30:53', '2005-07-12T02:40:41', '2005-07-16T04:56:41', '1'), + ('184', '190', '2006-02-16T02:30:53', '2005-05-26T06:55:58', '2005-05-27T10:54:58', '1'), + ('184', '34', '2006-02-16T02:30:53', '2005-08-19T18:55:21', '2005-08-23T18:49:21', '2'), + ('184', '1677', '2006-02-16T02:30:53', '2005-08-22T00:46:54', '2005-08-30T19:03:54', '1'), + ('184', '1354', '2006-02-16T02:30:53', '2005-08-19T12:14:14', '2005-08-20T11:52:14', '1'), + ('184', '2144', '2006-02-16T02:30:53', '2005-07-28T03:19:23', '2005-08-04T05:17:23', '2'), + ('184', '4483', '2006-02-16T02:30:53', '2005-08-19T17:20:15', '2005-08-26T18:28:15', '2'), + ('184', '4355', '2006-02-16T02:30:53', '2005-07-10T20:01:17', '2005-07-12T00:15:17', '1'), + ('184', '4540', '2006-02-16T02:30:53', '2005-07-08T19:42:03', '2005-07-16T22:24:03', '1'), + ('184', '3063', '2006-02-16T02:30:53', '2005-07-12T12:47:22', '2005-07-21T16:04:22', '1'), + ('184', '402', '2006-02-16T02:30:53', '2005-06-18T08:55:46', '2005-06-24T04:34:46', '2'), + ('184', '114', '2006-02-16T02:30:53', '2005-08-18T13:57:58', '2005-08-24T14:58:58', '2'), + ('184', '3308', '2006-02-16T02:30:53', '2005-05-28T09:56:20', '2005-06-01T06:41:20', '2'), + ('184', '1310', '2006-02-16T02:30:53', '2005-07-27T03:34:37', '2005-07-31T03:48:37', '2'), + ('184', '3631', '2006-02-16T02:30:53', '2005-06-17T09:38:08', '2005-06-23T07:23:08', '2'), + ('184', '4219', '2006-02-16T02:30:53', '2005-08-18T11:19:02', '2005-08-19T12:00:02', '2'), + ('184', '4097', '2006-02-16T02:30:53', '2005-08-21T13:13:57', '2005-08-23T14:04:57', '2'), + ('184', '3627', '2006-02-16T02:30:53', '2005-08-18T00:57:06', '2005-08-26T03:13:06', '2'), + ('184', '992', '2006-02-16T02:30:53', '2005-05-28T06:15:25', '2005-06-06T07:51:25', '1'), + ('184', '539', '2006-02-16T02:30:53', '2005-07-07T17:38:31', '2005-07-09T20:24:31', '1'), + ('184', '1713', '2006-02-16T02:30:53', '2005-08-23T06:56:18', '2005-08-25T06:10:18', '1'), + ('184', '4198', '2006-02-16T02:30:53', '2005-07-30T11:21:56', '2005-08-02T15:32:56', '1'), + ('184', '1584', '2006-02-16T02:30:53', '2005-07-30T00:47:03', '2005-08-06T03:23:03', '2'), + ('571', '230', '2006-02-16T02:30:53', '2005-06-15T16:29:56', '2005-06-21T14:43:56', '2'), + ('571', '4383', '2006-02-16T02:30:53', '2005-07-30T20:32:09', '2005-08-04T20:14:09', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['11080', '15841', '3616', '6792', '6676', '1990', '2977', '13266', '8638', '228', '10227', '2327', '14956', '11191', '13228', '4162', '5789', '8084', '1756', '9300', '689', '1254', '13688', '11426', '7161', '4601', '11526', '9081', '11121', '6108', '11114', '12256', '11415', '5595', '13377', '559', '2007', '2458', '8342', '10204', '1889', '5713', '7713', '9950', '7345', '13523', '8432', '11268', '5375', '8889', '13566', '2544', '4932', '4192', '3451', '8523', '5492', '2411', '3731', '11567', '10707', '8858', '14235', '12194', '6479', '7424', '3016', '1967', '12040', '6742', '3990', '6757', '6278', '3954', '14286', '3337', '3376', '10023', '7853', '3974', '14276', '2643', '3732', '224', '4356', '2634', '7649', '3995', '6687', '13027', '9433', '5647', '12910', '1131', '14925', '15835', '9234', '3751', '9952', '2565']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('571', '4303', '2006-02-16T02:30:53', '2005-08-02T07:29:56', '2005-08-08T05:58:56', '1'), + ('571', '2865', '2006-02-16T02:30:53', '2005-08-23T15:35:59', '2005-08-30T19:30:59', '2'), + ('571', '557', '2006-02-16T02:30:53', '2005-07-06T05:52:13', '2005-07-10T10:24:13', '1'), + ('571', '510', '2006-02-16T02:30:53', '2005-07-12T16:37:28', '2005-07-20T11:20:28', '2'), + ('571', '2294', '2006-02-16T02:30:53', '2005-07-12T11:53:40', '2005-07-19T09:15:40', '1'), + ('571', '1471', '2006-02-16T02:30:53', '2005-06-17T10:48:44', '2005-06-24T08:11:44', '1'), + ('571', '2645', '2006-02-16T02:30:53', '2005-06-20T08:15:27', '2005-06-29T04:30:27', '2'), + ('571', '1326', '2006-02-16T02:30:53', '2005-08-19T17:31:20', '2005-08-21T11:41:20', '2'), + ('571', '4060', '2006-02-16T02:30:53', '2005-07-29T14:30:23', '2005-08-01T10:32:23', '1'), + ('571', '511', '2006-02-16T02:30:53', '2005-05-26T10:54:28', '2005-06-04T09:39:28', '1'), + ('571', '872', '2006-02-16T02:30:53', '2005-08-01T01:42:22', '2005-08-09T23:45:22', '2'), + ('571', '1351', '2006-02-16T02:30:53', '2005-06-18T10:16:40', '2005-06-20T15:06:40', '1'), + ('571', '3650', '2006-02-16T02:30:53', '2005-08-22T06:26:16', '2005-08-25T11:06:16', '2'), + ('571', '1097', '2006-02-16T02:30:53', '2005-08-02T11:24:07', '2005-08-10T10:39:07', '1'), + ('571', '2497', '2006-02-16T02:30:53', '2005-08-19T16:08:16', '2005-08-20T18:55:16', '1'), + ('571', '745', '2006-02-16T02:30:53', '2005-07-07T09:17:26', '2005-07-15T10:15:26', '2'), + ('571', '2601', '2006-02-16T02:30:53', '2005-07-10T14:11:26', '2005-07-18T16:19:26', '1'), + ('571', '911', '2006-02-16T02:30:53', '2005-07-28T18:11:58', '2005-08-03T23:41:58', '2'), + ('571', '1401', '2006-02-16T02:30:53', '2005-06-16T17:22:33', '2005-06-21T16:52:33', '1'), + ('571', '1639', '2006-02-16T02:30:53', '2005-07-30T16:33:12', '2005-08-05T15:56:12', '1'), + ('571', '742', '2006-02-16T02:30:53', '2005-05-29T00:46:53', '2005-06-03T23:48:53', '2'), + ('571', '3986', '2006-02-16T02:30:53', '2005-06-15T06:11:16', '2005-06-21T06:40:16', '2'), + ('572', '1116', '2006-02-16T02:30:53', '2005-08-20T08:59:38', '2005-08-28T04:54:38', '2'), + ('572', '130', '2006-02-16T02:30:53', '2005-08-02T20:00:09', '2005-08-09T01:30:09', '2'), + ('572', '378', '2006-02-16T02:30:53', '2005-07-27T07:26:32', '2005-08-03T01:26:32', '2'), + ('572', '3184', '2006-02-16T02:30:53', '2005-07-08T06:49:10', '2005-07-09T07:43:10', '1'), + ('572', '2419', '2006-02-16T02:30:53', '2005-08-17T00:17:38', '2005-08-18T03:59:38', '2'), + ('572', '3040', '2006-02-16T02:30:53', '2005-07-30T08:09:58', '2005-08-03T13:27:58', '1'), + ('572', '1025', '2006-02-16T02:30:53', '2005-08-02T08:48:31', '2005-08-04T05:08:31', '2'), + ('572', '4296', '2006-02-16T02:30:53', '2005-07-11T07:19:24', '2005-07-13T12:38:24', '2'), + ('572', '1273', '2006-02-16T02:30:53', '2005-08-02T08:26:45', '2005-08-03T08:41:45', '2'), + ('572', '2975', '2006-02-16T02:30:53', '2005-08-18T04:09:39', '2005-08-22T01:53:39', '2'), + ('572', '2197', '2006-02-16T02:30:53', '2005-08-02T19:43:38', '2005-08-10T15:13:38', '1'), + ('572', '264', '2006-02-16T02:30:53', '2005-07-10T04:33:45', '2005-07-16T04:04:45', '1'), + ('572', '1316', '2006-02-16T02:30:53', '2005-08-19T21:32:23', '2005-08-25T22:24:23', '1'), + ('572', '1227', '2006-02-16T02:30:53', '2005-05-28T08:39:02', '2005-06-05T08:38:02', '2'), + ('572', '1123', '2006-02-16T02:30:53', '2005-06-17T11:47:17', '2005-06-21T07:19:17', '1'), + ('572', '599', '2006-02-16T02:30:53', '2005-06-18T19:39:05', '2005-06-21T13:54:05', '2'), + ('572', '3301', '2006-02-16T02:30:53', '2005-07-29T04:45:05', '2005-08-01T07:20:05', '1'), + ('572', '764', '2006-02-16T02:30:53', '2005-08-01T00:47:39', '2005-08-05T01:11:39', '1'), + ('572', '3909', '2006-02-16T02:30:53', '2005-06-17T04:05:12', '2005-06-26T04:13:12', '1'), + ('572', '1213', '2006-02-16T02:30:53', '2005-07-10T10:46:15', '2005-07-19T14:34:15', '1'), + ('572', '2018', '2006-02-16T02:30:53', '2005-07-28T04:32:14', '2005-08-03T04:30:14', '2'), + ('572', '1657', '2006-02-16T02:30:53', '2005-07-31T15:50:22', '2005-08-08T19:10:22', '2'), + ('572', '2434', '2006-02-16T02:30:53', '2005-07-27T14:29:53', '2005-08-03T18:38:53', '2'), + ('572', '163', '2006-02-16T02:30:53', '2005-08-20T02:47:03', '2005-08-28T07:43:03', '1'), + ('572', '3896', '2006-02-16T02:30:53', '2005-07-29T07:13:33', '2005-07-30T03:14:33', '1'), + ('558', '3275', '2006-02-16T02:30:53', '2005-08-02T14:10:39', '2005-08-04T14:35:39', '1'), + ('558', '1407', '2006-02-16T02:30:53', '2005-07-09T18:52:55', '2005-07-16T15:32:55', '2'), + ('558', '3457', '2006-02-16T02:30:53', '2005-07-30T00:39:43', '2005-08-02T23:22:43', '1'), + ('558', '4397', '2006-02-16T02:30:53', '2005-08-20T04:45:32', '2005-08-28T02:12:32', '2'), + ('558', '1465', '2006-02-16T02:30:53', '2005-06-19T02:16:17', '2005-06-22T21:45:17', '1'), + ('558', '4237', '2006-02-16T02:30:53', '2005-07-08T22:17:40', '2005-07-15T22:13:40', '2'), + ('558', '624', '2006-02-16T02:30:53', '2005-07-07T10:57:06', '2005-07-13T16:30:06', '1'), + ('558', '3489', '2006-02-16T02:30:53', '2005-06-21T21:10:39', '2005-06-30T19:03:39', '2'), + ('558', '3614', '2006-02-16T02:30:53', '2005-07-29T10:18:27', '2005-08-04T09:31:27', '1'), + ('558', '4524', '2006-02-16T02:30:53', '2005-07-10T00:11:09', '2005-07-14T01:27:09', '1'), + ('558', '3302', '2006-02-16T02:30:53', '2005-06-18T16:55:54', '2005-06-25T12:44:54', '1'), + ('558', '4133', '2006-02-16T02:30:53', '2005-07-06T11:33:36', '2005-07-15T12:23:36', '2'), + ('558', '567', '2006-02-16T02:30:53', '2005-08-17T01:28:43', '2005-08-24T20:20:43', '2'), + ('558', '1165', '2006-02-16T02:30:53', '2005-08-01T18:41:34', '2005-08-06T12:41:34', '1'), + ('558', '2378', '2006-02-16T02:30:53', '2005-07-29T23:44:35', '2005-08-01T05:25:35', '2'), + ('558', '125', '2006-02-16T02:30:53', '2005-08-21T05:08:42', '2005-08-29T23:36:42', '1'), + ('558', '292', '2006-02-16T02:30:53', '2005-08-18T02:04:47', '2005-08-25T20:45:47', '2'), + ('558', '2587', '2006-02-16T02:30:53', '2005-07-12T01:49:00', '2005-07-21T04:26:00', '1'), + ('558', '660', '2006-02-16T02:30:53', '2005-07-27T17:14:19', '2005-08-01T19:21:19', '2'), + ('558', '3514', '2006-02-16T02:30:53', '2005-06-20T10:55:08', '2005-06-24T14:05:08', '1'), + ('558', '3225', '2006-02-16T02:30:53', '2005-06-17T09:19:52', '2005-06-21T03:35:52', '1'), + ('558', '1288', '2006-02-16T02:30:53', '2005-08-17T20:29:56', '2005-08-26T22:17:56', '1'), + ('558', '4242', '2006-02-16T02:30:53', '2005-07-12T14:25:31', '2005-07-17T08:50:31', '2'), + ('558', '2009', '2006-02-16T02:30:53', '2005-07-06T23:32:44', '2005-07-14T01:35:44', '2'), + ('558', '547', '2006-02-16T02:30:53', '2005-07-12T15:09:48', '2005-07-17T15:04:48', '2'), + ('558', '2232', '2006-02-16T02:30:53', '2005-07-11T16:20:02', '2005-07-19T19:29:02', '2'), + ('558', '4250', '2006-02-16T02:30:53', '2005-07-06T21:57:44', '2005-07-08T02:37:44', '2'), + ('558', '2377', '2006-02-16T02:30:53', '2005-08-21T06:53:53', '2005-08-27T11:37:53', '2'), + ('318', '1176', '2006-02-16T02:30:53', '2005-06-21T10:24:35', '2005-06-22T13:51:35', '1'), + ('318', '3055', '2006-02-16T02:30:53', '2005-06-21T13:43:02', '2005-06-28T18:07:02', '1'), + ('318', '384', '2006-02-16T02:30:53', '2005-07-31T18:25:51', '2005-08-09T18:00:51', '1'), + ('318', '4053', '2006-02-16T02:30:53', '2005-07-28T09:36:38', '2005-07-29T15:01:38', '1'), + ('318', '4282', '2006-02-16T02:30:53', '2005-07-06T22:59:16', '2005-07-11T22:30:16', '1'), + ('318', '3637', '2006-02-16T02:30:53', '2005-08-21T06:34:05', '2005-08-28T10:13:05', '2'), + ('318', '1928', '2006-02-16T02:30:53', '2005-06-19T09:39:27', '2005-06-26T10:27:27', '2'), + ('318', '106', '2006-02-16T02:30:53', '2005-07-06T11:33:37', '2005-07-08T08:31:37', '1'), + ('318', '4285', '2006-02-16T02:30:53', '2005-05-26T10:18:27', '2005-06-04T06:59:27', '1'), + ('318', '1907', '2006-02-16T02:30:53', '2005-07-07T19:21:22', '2005-07-16T15:57:22', '1'), + ('318', '3687', '2006-02-16T02:30:53', '2005-06-19T08:55:17', '2005-06-20T11:44:17', '2'), + ('318', '2704', '2006-02-16T02:30:53', '2005-07-28T01:37:26', '2005-07-28T21:18:26', '1'), + ('128', '3990', '2006-02-16T02:30:53', '2005-07-06T23:43:03', '2005-07-13T04:13:03', '2'), + ('128', '2736', '2006-02-16T02:30:53', '2005-07-12T12:19:23', '2005-07-19T17:12:23', '1'), + ('128', '3756', '2006-02-16T02:30:53', '2005-08-19T08:25:16', '2005-08-25T13:42:16', '1'), + ('128', '1082', '2006-02-16T02:30:53', '2005-07-30T21:28:17', '2005-08-08T18:20:17', '2'), + ('128', '1466', '2006-02-16T02:30:53', '2005-07-10T07:08:40', '2005-07-13T05:19:40', '2'), + ('128', '3968', '2006-02-16T02:30:53', '2005-08-19T04:23:13', '2005-08-20T22:27:13', '1'), + ('128', '2654', '2006-02-16T02:30:53', '2005-05-31T18:44:19', '2005-06-01T20:13:19', '1'), + ('128', '442', '2006-02-16T02:30:53', '2005-08-22T05:16:16', '2005-08-30T02:47:16', '2'), + ('128', '1362', '2006-02-16T02:30:53', '2005-08-23T15:25:27', '2005-09-01T16:14:27', '2'), + ('128', '1660', '2006-02-16T02:30:53', '2005-07-30T13:45:54', '2005-08-02T15:33:54', '1'), + ('128', '3652', '2006-02-16T02:30:53', '2005-07-06T12:23:41', '2005-07-10T06:58:41', '1'), + ('128', '1634', '2006-02-16T02:30:53', '2005-07-31T15:52:37', '2005-08-06T10:50:37', '2'), + ('128', '2347', '2006-02-16T02:30:53', '2005-06-19T03:44:03', '2005-06-24T01:26:03', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['12731', '888', '9215', '7582', '12843', '5997', '6481', '10011', '8415', '6186', '13181', '9858', '14157', '13964', '5270', '2519', '10394', '15220', '13509', '3987', '15620', '1345', '3501', '10579', '8618', '1896', '10461', '193', '5533', '10069', '14618', '13945', '11917', '11389', '2115', '6520', '10648', '3164', '12442', '12192', '11841', '8355', '1040', '11810', '2440', '7021', '10983', '15697', '15636', '2018', '10450', '15175', '4675', '11945', '5339', '9710', '9056', '7167', '2998', '15361', '1868', '847', '3637', '7443', '14529', '7974', '14935', '12996', '11936', '12636', '15748', '3688', '7773', '3099', '3260', '7435', '9261', '2464', '1984', '4706', '4769', '605', '7456', '15699', '8529', '8021', '493', '3222', '15239', '9359', '3723', '3541', '12914', '6095', '11799', '5520', '11393', '10817', '3412', '11640']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('128', '1719', '2006-02-16T02:30:53', '2005-08-18T21:55:38', '2005-08-23T20:30:38', '1'), + ('128', '387', '2006-02-16T02:30:53', '2005-05-30T07:13:14', '2005-06-06T09:50:14', '1'), + ('128', '3591', '2006-02-16T02:30:53', '2005-07-30T13:11:11', '2005-08-06T13:06:11', '1'), + ('128', '3941', '2006-02-16T02:30:53', '2005-07-27T23:15:14', '2005-07-29T03:18:14', '2'), + ('128', '3279', '2006-02-16T02:30:53', '2005-08-19T01:58:54', '2005-08-20T00:20:54', '2'), + ('128', '3542', '2006-02-16T02:30:53', '2005-07-11T01:19:50', '2005-07-16T06:29:50', '1'), + ('128', '2392', '2006-02-16T02:30:53', '2005-07-12T01:50:15', '2005-07-20T03:03:15', '1'), + ('128', '606', '2006-02-16T02:30:53', '2005-07-31T18:02:41', '2005-08-08T17:04:41', '1'), + ('128', '2903', '2006-02-16T02:30:53', '2005-07-29T06:52:27', '2005-08-02T10:40:27', '1'), + ('128', '2086', '2006-02-16T02:30:53', '2005-07-11T11:26:41', '2005-07-17T12:02:41', '2'), + ('128', '1256', '2006-02-16T02:30:53', '2005-08-19T14:00:56', '2005-08-24T13:52:56', '2'), + ('128', '252', '2006-02-16T02:30:53', '2005-07-31T13:02:07', '2005-08-03T15:14:07', '2'), + ('128', '4471', '2006-02-16T02:30:53', '2005-08-21T02:43:15', '2005-08-24T02:47:15', '1'), + ('128', '108', '2006-02-16T02:30:53', '2005-08-20T18:24:26', '2005-08-21T21:19:26', '2'), + ('128', '1523', '2006-02-16T02:30:53', '2005-07-09T14:23:46', '2005-07-13T15:04:46', '1'), + ('128', '1172', '2006-02-16T02:30:53', '2005-06-19T00:19:21', '2005-06-25T01:46:21', '1'), + ('128', '1655', '2006-02-16T02:30:53', '2005-08-01T06:58:17', '2005-08-05T02:09:17', '1'), + ('128', '187', '2006-02-16T02:30:53', '2005-08-22T17:02:23', '2005-08-28T21:02:23', '1'), + ('128', '3698', '2006-02-16T02:30:53', '2005-08-20T02:14:16', '2005-08-22T06:36:16', '2'), + ('270', '3104', '2006-02-16T02:30:53', '2005-07-06T23:28:24', '2005-07-15T00:52:24', '1'), + ('270', '1173', '2006-02-16T02:30:53', '2005-08-23T07:10:22', '2005-08-28T06:51:22', '2'), + ('270', '1041', '2006-02-16T02:30:53', '2005-06-15T12:32:13', '2005-06-24T14:02:13', '1'), + ('270', '2219', '2006-02-16T02:30:53', '2005-07-06T00:11:28', '2005-07-10T20:32:28', '2'), + ('270', '4068', '2006-02-16T02:30:53', '2005-08-01T13:48:22', '2005-08-07T11:51:22', '1'), + ('270', '985', '2006-02-16T02:30:53', '2005-07-29T13:48:20', '2005-08-06T14:12:20', '2'), + ('270', '2077', '2006-02-16T02:30:53', '2005-06-17T04:25:46', '2005-06-26T09:37:46', '1'), + ('270', '3212', '2006-02-16T02:30:53', '2005-08-01T09:32:53', '2005-08-09T10:19:53', '1'), + ('270', '3900', '2006-02-16T02:30:53', '2005-05-26T06:41:48', '2005-05-30T06:21:48', '2'), + ('270', '2567', '2006-02-16T02:30:53', '2005-07-10T02:19:28', '2005-07-11T01:37:28', '1'), + ('270', '2168', '2006-02-16T02:30:53', '2005-07-31T19:43:18', '2005-08-06T19:40:18', '2'), + ('270', '4490', '2006-02-16T02:30:53', '2005-08-21T18:09:51', '2005-08-28T22:47:51', '1'), + ('270', '3328', '2006-02-16T02:30:53', '2005-08-20T17:43:56', '2005-08-26T19:19:56', '1'), + ('270', '1608', '2006-02-16T02:30:53', '2005-08-17T16:08:17', '2005-08-20T20:01:17', '1'), + ('270', '3267', '2006-02-16T02:30:53', '2005-08-02T18:39:12', '2005-08-03T23:23:12', '2'), + ('270', '3448', '2006-02-16T02:30:53', '2005-06-17T20:02:16', '2005-06-25T16:56:16', '2'), + ('270', '1535', '2006-02-16T02:30:53', '2005-07-12T04:05:16', '2005-07-15T08:26:16', '1'), + ('270', '691', '2006-02-16T02:30:53', '2005-08-01T16:08:52', '2005-08-05T20:17:52', '1'), + ('270', '155', '2006-02-16T02:30:53', '2005-06-20T21:29:00', '2005-06-27T15:50:00', '1'), + ('270', '78', '2006-02-16T02:30:53', '2005-08-18T10:50:07', '2005-08-21T08:06:07', '1'), + ('270', '3450', '2006-02-16T02:30:53', '2005-08-18T02:01:40', '2005-08-21T05:45:40', '1'), + ('270', '1524', '2006-02-16T02:30:53', '2005-08-17T13:12:20', '2005-08-21T11:16:20', '2'), + ('270', '4569', '2006-02-16T02:30:53', '2005-07-29T04:57:43', '2005-08-03T06:25:43', '1'), + ('270', '2546', '2006-02-16T02:30:53', '2005-05-31T05:35:16', '2005-06-09T04:14:16', '1'), + ('270', '1548', '2006-02-16T02:30:53', '2005-08-17T11:56:48', '2005-08-20T17:39:48', '1'), + ('380', '2866', '2006-02-16T02:30:53', '2005-06-18T18:41:09', '2005-06-22T12:46:09', '1'), + ('380', '2690', '2006-02-16T02:30:53', '2005-07-27T02:26:38', '2005-08-05T01:18:38', '1'), + ('380', '4502', '2006-02-16T02:30:53', '2005-08-02T04:24:23', '2005-08-09T08:05:23', '2'), + ('380', '1987', '2006-02-16T02:30:53', '2005-08-23T10:04:36', '2005-08-24T05:00:36', '2'), + ('380', '1169', '2006-02-16T02:30:53', '2005-08-23T07:50:46', '2005-08-26T07:59:46', '2'), + ('380', '1278', '2006-02-16T02:30:53', '2005-06-17T12:35:58', '2005-06-26T13:16:58', '2'), + ('380', '234', '2006-02-16T02:30:53', '2005-08-01T09:10:03', '2005-08-08T12:34:03', '1'), + ('380', '4318', '2006-02-16T02:30:53', '2005-08-22T15:29:15', '2005-08-27T15:11:15', '2'), + ('380', '1309', '2006-02-16T02:30:53', '2005-07-08T10:24:22', '2005-07-14T11:09:22', '1'), + ('380', '1108', '2006-02-16T02:30:53', '2005-08-17T17:05:33', '2005-08-20T18:37:33', '2'), + ('380', '698', '2006-02-16T02:30:53', '2005-07-09T17:09:17', '2005-07-10T21:07:17', '2'), + ('380', '3486', '2006-02-16T02:30:53', '2005-07-31T08:05:31', '2005-08-09T03:29:31', '2'), + ('380', '4363', '2006-02-16T02:30:53', '2005-07-30T07:13:20', '2005-08-03T07:36:20', '1'), + ('380', '238', '2006-02-16T02:30:53', '2005-07-27T07:37:26', '2005-08-03T06:39:26', '1'), + ('380', '1288', '2006-02-16T02:30:53', '2005-06-20T09:30:22', '2005-06-24T06:31:22', '2'), + ('380', '1407', '2006-02-16T02:30:53', '2005-08-22T21:39:45', '2005-08-23T17:32:45', '2'), + ('380', '2412', '2006-02-16T02:30:53', '2005-06-17T02:03:22', '2005-06-25T04:38:22', '1'), + ('380', '4387', '2006-02-16T02:30:53', '2005-05-30T01:18:15', '2005-06-06T20:20:15', '2'), + ('380', '3823', '2006-02-16T02:30:53', '2005-07-06T07:06:31', '2005-07-10T02:11:31', '2'), + ('380', '703', '2006-02-16T02:30:53', '2005-07-27T17:47:43', '2005-07-29T13:15:43', '1'), + ('380', '1774', '2006-02-16T02:30:53', '2005-08-21T15:08:31', '2005-08-29T17:15:31', '1'), + ('380', '2442', '2006-02-16T02:30:53', '2005-07-28T14:11:57', '2005-08-02T19:25:57', '2'), + ('380', '2025', '2006-02-16T02:30:53', '2005-08-22T05:47:31', '2005-08-29T00:33:31', '2'), + ('380', '4445', '2006-02-16T02:30:53', '2005-08-19T07:31:32', '2005-08-25T11:59:32', '1'), + ('380', '1127', '2006-02-16T02:30:53', '2005-08-17T16:45:34', '2005-08-21T13:33:34', '2'), + ('380', '1645', '2006-02-16T02:30:53', '2005-08-18T18:00:29', '2005-08-26T20:08:29', '2'), + ('380', '2757', '2006-02-16T02:30:53', '2005-08-23T12:33:00', '2005-08-25T15:15:00', '2'), + ('380', '1102', '2006-02-16T02:30:53', '2005-07-06T09:41:53', '2005-07-14T10:30:53', '2'), + ('380', '4143', '2006-02-16T02:30:53', '2005-07-28T07:02:17', '2005-07-30T04:16:17', '2'), + ('380', '3756', '2006-02-16T02:30:53', '2005-06-20T16:44:33', '2005-06-27T12:17:33', '2'), + ('380', '3627', '2006-02-16T02:30:53', '2005-06-21T03:59:13', '2005-06-23T03:29:13', '1'), + ('380', '1574', '2006-02-16T02:30:53', '2005-07-27T17:38:44', '2005-07-30T16:57:44', '1'), + ('380', '372', '2006-02-16T02:30:53', '2005-07-30T14:39:35', '2005-08-08T11:26:35', '1'), + ('380', '463', '2006-02-16T02:30:53', '2005-06-18T20:06:05', '2005-06-20T19:22:05', '1'), + ('380', '3417', '2006-02-16T02:30:53', '2005-06-17T10:25:28', '2005-06-23T08:18:28', '2'), + ('380', '2512', '2006-02-16T02:30:53', '2005-07-08T11:51:41', '2005-07-17T12:58:41', '1'), + ('501', '3462', '2006-02-16T02:30:53', '2005-07-08T15:29:16', '2005-07-09T18:42:16', '2'), + ('501', '4232', '2006-02-16T02:30:53', '2005-05-28T14:39:10', '2005-06-01T09:28:10', '2'), + ('501', '1959', '2006-02-16T02:30:53', '2005-07-27T18:34:53', '2005-07-29T17:46:53', '2'), + ('501', '4155', '2006-02-16T02:30:53', '2005-08-23T10:20:35', '2005-08-30T13:56:35', '1'), + ('501', '1055', '2006-02-16T02:30:53', '2005-07-29T10:24:31', '2005-08-01T16:06:31', '1'), + ('501', '1920', '2006-02-16T02:30:53', '2005-07-28T15:45:24', '2005-08-04T10:49:24', '1'), + ('501', '184', '2006-02-16T02:30:53', '2005-05-28T00:34:11', '2005-05-30T18:40:11', '1'), + ('501', '4023', '2006-02-16T02:30:53', '2005-06-21T01:50:29', '2005-06-27T00:52:29', '2'), + ('501', '1809', '2006-02-16T02:30:53', '2005-08-22T17:46:17', '2005-08-26T19:03:17', '1'), + ('501', '21', '2006-02-16T02:30:53', '2005-07-30T18:39:28', '2005-07-31T15:39:28', '1'), + ('501', '4554', '2006-02-16T02:30:53', '2005-07-06T11:12:02', '2005-07-14T16:45:02', '2'), + ('501', '1204', '2006-02-16T02:30:53', '2005-07-06T01:50:11', '2005-07-12T03:24:11', '1'), + ('501', '4396', '2006-02-16T02:30:53', '2005-08-19T04:25:59', '2005-08-23T08:04:59', '2'), + ('501', '727', '2006-02-16T02:30:53', '2005-07-11T06:06:41', '2005-07-19T06:14:41', '1'), + ('501', '40', '2006-02-16T02:30:53', '2005-08-17T11:25:25', '2005-08-25T13:03:25', '2'), + ('501', '2527', '2006-02-16T02:30:53', '2005-07-10T01:30:41', '2005-07-15T21:37:41', '2'), + ('501', '1033', '2006-02-16T02:30:53', '2005-08-02T18:44:29', '2005-08-11T23:58:29', '1'), + ('501', '3056', '2006-02-16T02:30:53', '2005-08-01T22:51:08', '2005-08-10T16:55:08', '2'), + ('501', '3036', '2006-02-16T02:30:53', '2005-06-21T16:44:31', '2005-06-28T16:15:31', '2'), + ('501', '1718', '2006-02-16T02:30:53', '2005-08-17T04:44:33', '2005-08-21T09:29:33', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['13889', '6736', '11178', '7280', '12522', '6429', '9955', '11446', '13368', '15895', '6060', '2190', '12816', '2914', '10242', '13637', '9948', '14096', '15484', '9956', '14683', '6787', '9526', '13827', '9164', '13755', '3081', '12139', '14299', '5617', '11568', '12404', '6997', '10081', '6625', '15519', '9740', '11449', '14611', '15182', '10360', '15393', '12857', '6983', '3510', '2871', '7987', '12415', '6913', '7317', '7667', '13489', '10014', '1068', '14561', '11005', '8068', '3432', '997', '15199', '6008', '13424', '9096', '15192', '11676', '11621', '1672', '6349', '14638', '4161', '12970', '15934', '2351', '10506', '1461', '1664', '8859', '14726', '1279', '6472', '4134', '13482', '10620', '2471', '13536', '2188', '12831', '3869', '6569', '11386', '12451', '12764', '9931', '7359', '4157', '3381', '382', '5756', '9672', '9818']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('501', '4406', '2006-02-16T02:30:53', '2005-08-20T15:40:06', '2005-08-22T14:09:06', '2'), + ('342', '530', '2006-02-16T02:30:53', '2005-07-12T14:16:50', '2005-07-15T16:26:50', '1'), + ('342', '2613', '2006-02-16T02:30:53', '2005-08-02T10:48:10', '2005-08-06T06:07:10', '1'), + ('342', '236', '2006-02-16T02:30:53', '2005-07-27T11:50:52', '2005-07-30T15:53:52', '2'), + ('342', '4435', '2006-02-16T02:30:53', '2005-08-18T13:45:40', '2005-08-27T17:05:40', '1'), + ('342', '141', '2006-02-16T02:30:53', '2005-07-12T00:02:50', '2005-07-21T02:08:50', '1'), + ('342', '1745', '2006-02-16T02:30:53', '2005-07-31T16:01:26', '2005-08-04T11:15:26', '2'), + ('342', '748', '2006-02-16T02:30:53', '2005-08-02T20:33:37', '2005-08-03T18:22:37', '1'), + ('342', '1073', '2006-02-16T02:30:53', '2005-08-19T21:19:35', '2005-08-21T16:12:35', '2'), + ('342', '2275', '2006-02-16T02:30:53', '2005-08-23T17:09:31', '2005-08-30T17:15:31', '1'), + ('342', '3146', '2006-02-16T02:30:53', '2005-07-11T04:06:17', '2005-07-12T03:05:17', '1'), + ('342', '4398', '2006-02-16T02:30:53', '2005-06-18T01:29:51', '2005-06-26T04:31:51', '2'), + ('342', '4051', '2006-02-16T02:30:53', '2005-08-19T01:04:05', '2005-08-24T01:25:05', '1'), + ('342', '2419', '2006-02-16T02:30:53', '2005-06-20T03:43:18', '2005-06-25T03:44:18', '2'), + ('342', '1825', '2006-02-16T02:30:53', '2005-08-01T02:18:12', '2005-08-02T22:32:12', '2'), + ('342', '2298', '2006-02-16T02:30:53', '2005-08-20T07:21:15', '2005-08-24T10:13:15', '2'), + ('342', '806', '2006-02-16T02:30:53', '2005-07-31T15:49:41', '2005-08-06T12:36:41', '1'), + ('342', '2089', '2006-02-16T02:30:53', '2005-08-21T00:27:46', '2005-08-22T22:53:46', '1'), + ('342', '642', '2006-02-16T02:30:53', '2005-08-23T02:04:49', '2005-08-24T05:46:49', '1'), + ('342', '4485', '2006-02-16T02:30:53', '2005-07-31T16:03:47', '2005-08-01T16:40:47', '2'), + ('342', '3850', '2006-02-16T02:30:53', '2005-08-21T20:27:44', '2005-08-29T16:54:44', '1'), + ('342', '1481', '2006-02-16T02:30:53', '2005-07-12T16:33:28', '2005-07-18T21:48:28', '2'), + ('342', '417', '2006-02-16T02:30:53', '2005-07-31T01:02:22', '2005-08-04T03:00:22', '1'), + ('342', '1103', '2006-02-16T02:30:53', '2005-08-20T13:47:19', '2005-08-28T09:13:19', '1'), + ('342', '4434', '2006-02-16T02:30:53', '2005-07-30T11:24:14', '2005-08-08T16:24:14', '1'), + ('342', '1927', '2006-02-16T02:30:53', '2005-08-20T11:18:53', '2005-08-27T06:51:53', '2'), + ('342', '2071', '2006-02-16T02:30:53', '2005-06-20T15:29:13', '2005-06-24T21:00:13', '2'), + ('342', '1537', '2006-02-16T02:30:53', '2005-08-17T23:57:13', '2005-08-24T19:13:13', '1'), + ('342', '4028', '2006-02-16T02:30:53', '2005-08-21T07:18:57', '2005-08-24T01:28:57', '1'), + ('342', '2324', '2006-02-16T02:30:53', '2005-07-10T05:28:50', '2005-07-12T00:02:50', '2'), + ('342', '183', '2006-02-16T02:30:53', '2005-08-17T01:30:01', '2005-08-18T22:21:01', '2'), + ('342', '1097', '2006-02-16T02:30:53', '2005-08-18T09:36:34', '2005-08-23T10:12:34', '2'), + ('342', '2130', '2006-02-16T02:30:53', '2005-07-27T01:14:02', '2005-07-29T01:12:02', '2'), + ('443', '3183', '2006-02-16T02:30:53', '2005-07-31T20:07:44', '2005-08-06T20:04:44', '1'), + ('443', '735', '2006-02-16T02:30:53', '2005-07-12T09:06:40', '2005-07-21T04:57:40', '2'), + ('443', '542', '2006-02-16T02:30:53', '2005-08-23T03:23:32', '2005-08-25T03:48:32', '1'), + ('443', '3497', '2006-02-16T02:30:53', '2005-07-31T09:08:03', '2005-08-06T04:48:03', '2'), + ('443', '3279', '2006-02-16T02:30:53', '2005-08-02T20:44:43', '2005-08-07T23:47:43', '2'), + ('443', '4078', '2006-02-16T02:30:53', '2005-08-21T18:01:41', '2005-08-26T12:34:41', '1'), + ('443', '645', '2006-02-16T02:30:53', '2005-08-22T15:47:05', '2005-08-25T11:55:05', '1'), + ('443', '1129', '2006-02-16T02:30:53', '2005-08-01T05:52:53', '2005-08-05T10:55:53', '1'), + ('443', '2924', '2006-02-16T02:30:53', '2005-08-22T23:04:09', '2005-08-27T02:23:09', '2'), + ('443', '4307', '2006-02-16T02:30:53', '2005-08-19T02:20:13', '2005-08-20T20:20:13', '1'), + ('443', '1758', '2006-02-16T02:30:53', '2005-07-27T00:55:03', '2005-08-01T21:19:03', '2'), + ('443', '2250', '2006-02-16T02:30:53', '2005-07-06T00:27:41', '2005-07-14T23:20:41', '2'), + ('443', '1731', '2006-02-16T02:30:53', '2005-06-20T00:27:49', '2005-06-29T01:36:49', '1'), + ('443', '288', '2006-02-16T02:30:53', '2005-07-28T14:36:52', '2005-08-05T16:49:52', '2'), + ('443', '392', '2006-02-16T02:30:53', '2005-08-18T09:54:01', '2005-08-24T15:41:01', '1'), + ('443', '569', '2006-02-16T02:30:53', '2005-07-12T22:18:12', '2005-07-14T23:03:12', '2'), + ('443', '1518', '2006-02-16T02:30:53', '2005-07-27T13:19:41', '2005-07-29T16:16:41', '2'), + ('443', '2415', '2006-02-16T02:30:53', '2005-07-28T02:37:22', '2005-08-05T21:37:22', '1'), + ('443', '2934', '2006-02-16T02:30:53', '2005-08-20T01:29:06', '2005-08-27T21:11:06', '1'), + ('443', '2344', '2006-02-16T02:30:53', '2005-07-31T18:10:56', '2005-08-02T23:36:56', '1'), + ('443', '150', '2006-02-16T02:30:53', '2005-05-31T09:32:15', '2005-06-01T11:20:15', '1'), + ('443', '2498', '2006-02-16T02:30:53', '2005-08-21T16:20:43', '2005-08-27T16:48:43', '1'), + ('216', '1547', '2006-02-16T02:30:53', '2005-08-02T05:05:23', '2005-08-07T23:28:23', '2'), + ('216', '209', '2006-02-16T02:30:53', '2005-07-28T17:22:28', '2005-07-29T12:24:28', '2'), + ('216', '1814', '2006-02-16T02:30:53', '2005-06-21T19:02:03', '2005-06-25T00:57:03', '2'), + ('216', '4243', '2006-02-16T02:30:53', '2005-05-31T00:08:25', '2005-06-02T00:17:25', '2'), + ('216', '18', '2006-02-16T02:30:53', '2005-08-22T16:17:49', '2005-08-25T20:12:49', '1'), + ('216', '1227', '2006-02-16T02:30:53', '2005-07-11T01:51:29', '2005-07-18T01:39:29', '1'), + ('216', '4340', '2006-02-16T02:30:53', '2005-08-19T23:10:09', '2005-08-23T02:25:09', '1'), + ('216', '540', '2006-02-16T02:30:53', '2005-07-30T08:39:23', '2005-08-01T03:33:23', '1'), + ('216', '4213', '2006-02-16T02:30:53', '2005-08-22T16:06:23', '2005-08-27T13:12:23', '1'), + ('216', '4496', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('216', '3708', '2006-02-16T02:30:53', '2005-08-17T04:13:45', '2005-08-26T01:00:45', '1'), + ('216', '4206', '2006-02-16T02:30:53', '2005-06-16T10:37:34', '2005-06-23T05:30:34', '1'), + ('216', '1581', '2006-02-16T02:30:53', '2005-07-11T20:25:05', '2005-07-21T00:35:05', '2'), + ('216', '3583', '2006-02-16T02:30:53', '2005-08-21T19:01:36', '2005-08-22T15:09:36', '2'), + ('216', '4021', '2006-02-16T02:30:53', '2005-07-07T09:15:11', '2005-07-15T06:59:11', '1'), + ('216', '3999', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('216', '994', '2006-02-16T02:30:53', '2005-08-23T18:40:41', '2005-08-25T00:18:41', '2'), + ('216', '2942', '2006-02-16T02:30:53', '2005-06-18T12:27:57', '2005-06-23T16:14:57', '1'), + ('216', '1171', '2006-02-16T02:30:53', '2005-08-01T11:16:05', '2005-08-03T05:37:05', '2'), + ('216', '4479', '2006-02-16T02:30:53', '2005-06-15T20:32:08', '2005-06-23T01:08:08', '1'), + ('216', '2464', '2006-02-16T02:30:53', '2005-06-16T10:15:20', '2005-06-18T12:11:20', '2'), + ('216', '603', '2006-02-16T02:30:53', '2005-07-29T23:44:43', '2005-08-07T18:14:43', '2'), + ('216', '4556', '2006-02-16T02:30:53', '2005-08-21T22:08:52', '2005-08-22T18:28:52', '1'), + ('183', '698', '2006-02-16T02:30:53', '2005-06-15T08:13:57', '2005-06-18T09:36:57', '2'), + ('183', '3780', '2006-02-16T02:30:53', '2005-07-12T01:33:25', '2005-07-15T20:26:25', '1'), + ('183', '2917', '2006-02-16T02:30:53', '2005-07-07T08:14:24', '2005-07-09T10:42:24', '1'), + ('183', '1627', '2006-02-16T02:30:53', '2005-08-20T01:14:30', '2005-08-24T04:57:30', '1'), + ('183', '3064', '2006-02-16T02:30:53', '2005-08-01T15:09:17', '2005-08-09T13:58:17', '1'), + ('183', '3399', '2006-02-16T02:30:53', '2005-06-18T20:31:00', '2005-06-24T18:01:00', '2'), + ('183', '667', '2006-02-16T02:30:53', '2005-08-20T03:35:16', '2005-08-25T04:06:16', '2'), + ('183', '712', '2006-02-16T02:30:53', '2005-06-18T01:19:04', '2005-06-25T03:59:04', '2'), + ('183', '1916', '2006-02-16T02:30:53', '2005-08-19T01:40:43', '2005-08-28T05:22:43', '1'), + ('183', '2540', '2006-02-16T02:30:53', '2005-07-06T17:56:46', '2005-07-10T20:44:46', '1'), + ('183', '759', '2006-02-16T02:30:53', '2005-07-12T05:47:40', '2005-07-20T06:23:40', '2'), + ('183', '519', '2006-02-16T02:30:53', '2005-08-02T18:24:03', '2005-08-06T21:22:03', '1'), + ('183', '2780', '2006-02-16T02:30:53', '2005-08-18T11:04:42', '2005-08-20T08:20:42', '1'), + ('183', '26', '2006-02-16T02:30:53', '2005-08-18T23:14:15', '2005-08-22T20:23:15', '1'), + ('183', '3455', '2006-02-16T02:30:53', '2005-07-31T15:18:19', '2005-08-04T14:23:19', '2'), + ('183', '174', '2006-02-16T02:30:53', '2005-07-27T14:51:04', '2005-07-31T16:03:04', '2'), + ('183', '304', '2006-02-16T02:30:53', '2005-07-07T09:04:26', '2005-07-08T09:55:26', '1'), + ('183', '1373', '2006-02-16T02:30:53', '2005-06-21T14:02:59', '2005-06-29T18:11:59', '2'), + ('183', '4358', '2006-02-16T02:30:53', '2005-05-27T10:12:00', '2005-05-31T15:03:00', '1'), + ('183', '130', '2006-02-16T02:30:53', '2005-07-10T12:39:28', '2005-07-11T14:08:28', '2'), + ('183', '4394', '2006-02-16T02:30:53', '2005-07-31T06:34:06', '2005-08-08T10:29:06', '2'), + ('183', '1254', '2006-02-16T02:30:53', '2005-07-31T11:34:32', '2005-08-04T08:20:32', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['5069', '7629', '9913', '3277', '6880', '13295', '7308', '11521', '13431', '15912', '4694', '2200', '6578', '3933', '4458', '3280', '7640', '13679', '7305', '6155', '5623', '12866', '4515', '3208', '13306', '15740', '8986', '5528', '2776', '5201', '3996', '728', '13439', '14633', '6041', '15377', '969', '155', '11883', '14609', '795', '11380', '14420', '9765', '14833', '7095', '9287', '12208', '15390', '1005', '2069', '12868', '3151', '2354', '1710', '419', '10991', '11767', '6168', '8942', '12328', '10184', '10886', '7406', '7710', '6390', '586', '15359', '11469', '760', '4928', '561', '319', '10895', '3238', '9811', '2452', '12065', '13752', '14530', '5775', '10070', '8539', '2507', '15009', '10326', '5740', '2502', '7687', '13054', '5470', '10030', '14672', '6135', '6622', '14452', '12779', '10412', '2808', '12097']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('183', '4417', '2006-02-16T02:30:53', '2005-07-09T04:56:30', '2005-07-13T23:53:30', '2'), + ('229', '2453', '2006-02-16T02:30:53', '2005-07-28T01:00:09', '2005-07-30T06:49:09', '1'), + ('229', '3744', '2006-02-16T02:30:53', '2005-07-31T14:51:04', '2005-08-06T12:12:04', '1'), + ('229', '1330', '2006-02-16T02:30:53', '2005-06-21T05:36:37', '2005-06-29T10:54:37', '1'), + ('229', '1473', '2006-02-16T02:30:53', '2005-07-12T20:41:35', '2005-07-17T02:22:35', '1'), + ('229', '2408', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('229', '1452', '2006-02-16T02:30:53', '2005-07-27T13:00:25', '2005-08-03T16:04:25', '1'), + ('229', '463', '2006-02-16T02:30:53', '2005-08-17T00:04:54', '2005-08-21T00:57:54', '1'), + ('229', '1700', '2006-02-16T02:30:53', '2005-08-19T23:28:15', '2005-08-25T04:44:15', '1'), + ('229', '3079', '2006-02-16T02:30:53', '2005-08-23T17:47:40', '2005-08-31T14:43:40', '2'), + ('229', '3637', '2006-02-16T02:30:53', '2005-07-08T11:07:37', '2005-07-12T06:53:37', '2'), + ('229', '1085', '2006-02-16T02:30:53', '2005-06-18T01:59:16', '2005-06-26T23:25:16', '2'), + ('229', '2304', '2006-02-16T02:30:53', '2005-07-12T06:15:41', '2005-07-15T10:43:41', '1'), + ('229', '1202', '2006-02-16T02:30:53', '2005-07-06T21:06:37', '2005-07-08T20:23:37', '1'), + ('229', '1307', '2006-02-16T02:30:53', '2005-07-07T23:47:47', '2005-07-09T19:17:47', '2'), + ('229', '661', '2006-02-16T02:30:53', '2005-06-21T06:08:12', '2005-06-24T09:34:12', '1'), + ('229', '3014', '2006-02-16T02:30:53', '2005-07-28T01:14:49', '2005-08-03T21:50:49', '1'), + ('229', '2878', '2006-02-16T02:30:53', '2005-08-20T08:39:34', '2005-08-29T10:06:34', '2'), + ('229', '2464', '2006-02-16T02:30:53', '2005-07-27T12:57:06', '2005-07-30T13:13:06', '2'), + ('229', '785', '2006-02-16T02:30:53', '2005-07-11T09:45:31', '2005-07-18T08:09:31', '1'), + ('229', '4464', '2006-02-16T02:30:53', '2005-07-10T05:41:38', '2005-07-14T01:01:38', '2'), + ('229', '1766', '2006-02-16T02:30:53', '2005-08-19T02:39:47', '2005-08-27T02:14:47', '1'), + ('229', '1998', '2006-02-16T02:30:53', '2005-07-08T02:42:03', '2005-07-10T07:22:03', '2'), + ('229', '3169', '2006-02-16T02:30:53', '2005-06-21T00:50:03', '2005-06-24T06:15:03', '2'), + ('229', '2742', '2006-02-16T02:30:53', '2005-08-19T18:57:29', '2005-08-20T20:09:29', '2'), + ('229', '100', '2006-02-16T02:30:53', '2005-08-23T12:07:51', '2005-08-24T13:23:51', '2'), + ('551', '3992', '2006-02-16T02:30:53', '2005-07-30T04:37:20', '2005-07-31T23:54:20', '1'), + ('551', '680', '2006-02-16T02:30:53', '2005-07-10T02:09:21', '2005-07-17T06:22:21', '2'), + ('551', '1726', '2006-02-16T02:30:53', '2005-06-19T18:16:24', '2005-06-26T14:43:24', '2'), + ('551', '2453', '2006-02-16T02:30:53', '2005-07-09T10:52:53', '2005-07-16T12:41:53', '2'), + ('551', '2857', '2006-02-16T02:30:53', '2005-07-06T23:46:43', '2005-07-14T22:34:43', '2'), + ('551', '242', '2006-02-16T02:30:53', '2005-05-29T06:12:38', '2005-06-03T07:41:38', '1'), + ('551', '3535', '2006-02-16T02:30:53', '2005-08-19T23:42:16', '2005-08-26T21:24:16', '2'), + ('551', '2137', '2006-02-16T02:30:53', '2005-08-21T18:51:10', '2005-08-25T13:07:10', '1'), + ('551', '2815', '2006-02-16T02:30:53', '2005-07-11T03:14:58', '2005-07-13T00:48:58', '2'), + ('551', '3405', '2006-02-16T02:30:53', '2005-08-22T22:22:33', '2005-08-29T18:41:33', '1'), + ('551', '443', '2006-02-16T02:30:53', '2005-05-30T19:23:48', '2005-05-31T21:14:48', '1'), + ('551', '288', '2006-02-16T02:30:53', '2005-05-26T01:15:05', '2005-06-01T00:03:05', '1'), + ('551', '221', '2006-02-16T02:30:53', '2005-08-17T14:41:28', '2005-08-19T09:54:28', '1'), + ('551', '1206', '2006-02-16T02:30:53', '2005-08-21T17:57:26', '2005-08-25T14:04:26', '2'), + ('551', '609', '2006-02-16T02:30:53', '2005-05-29T16:57:39', '2005-06-01T11:33:39', '2'), + ('551', '1046', '2006-02-16T02:30:53', '2005-08-02T18:17:32', '2005-08-03T19:26:32', '2'), + ('551', '2495', '2006-02-16T02:30:53', '2005-08-21T11:16:15', '2005-08-24T06:06:15', '2'), + ('551', '472', '2006-02-16T02:30:53', '2005-07-31T09:44:40', '2005-08-05T10:57:40', '1'), + ('551', '1960', '2006-02-16T02:30:53', '2005-08-22T01:45:18', '2005-08-28T21:24:18', '1'), + ('551', '1008', '2006-02-16T02:30:53', '2005-07-27T04:51:15', '2005-08-05T10:25:15', '2'), + ('551', '2048', '2006-02-16T02:30:53', '2005-07-30T15:35:39', '2005-08-02T10:15:39', '1'), + ('551', '2039', '2006-02-16T02:30:53', '2005-08-18T02:25:25', '2005-08-20T04:53:25', '2'), + ('551', '462', '2006-02-16T02:30:53', '2005-08-22T22:57:25', '2005-08-31T18:06:25', '1'), + ('551', '4006', '2006-02-16T02:30:53', '2005-05-31T00:53:25', '2005-06-04T01:21:25', '2'), + ('551', '2746', '2006-02-16T02:30:53', '2005-06-17T16:19:39', '2005-06-26T16:48:39', '1'), + ('551', '4054', '2006-02-16T02:30:53', '2005-08-19T02:47:19', '2005-08-20T00:30:19', '2'), + ('77', '2976', '2006-02-16T02:30:53', '2005-06-20T20:36:53', '2005-06-25T18:56:53', '1'), + ('77', '2793', '2006-02-16T02:30:53', '2005-06-18T12:54:18', '2005-06-26T07:23:18', '2'), + ('77', '144', '2006-02-16T02:30:53', '2005-06-16T14:11:24', '2005-06-22T15:26:24', '1'), + ('77', '2514', '2006-02-16T02:30:53', '2005-05-27T15:15:11', '2005-06-02T11:53:11', '1'), + ('77', '2854', '2006-02-16T02:30:53', '2005-08-02T04:41:12', '2005-08-05T05:36:12', '2'), + ('77', '2374', '2006-02-16T02:30:53', '2005-08-17T10:00:40', '2005-08-25T04:14:40', '2'), + ('77', '284', '2006-02-16T02:30:53', '2005-07-11T10:21:38', '2005-07-14T09:55:38', '2'), + ('77', '4375', '2006-02-16T02:30:53', '2005-07-30T03:01:07', '2005-08-06T22:50:07', '2'), + ('77', '1355', '2006-02-16T02:30:53', '2005-08-18T06:43:56', '2005-08-23T10:19:56', '2'), + ('77', '2785', '2006-02-16T02:30:53', '2005-08-01T00:09:33', '2005-08-05T04:12:33', '2'), + ('77', '943', '2006-02-16T02:30:53', '2005-08-02T00:52:34', '2005-08-08T00:30:34', '1'), + ('77', '1412', '2006-02-16T02:30:53', '2005-07-27T16:25:45', '2005-08-05T20:39:45', '1'), + ('77', '3716', '2006-02-16T02:30:53', '2005-07-28T04:24:07', '2005-08-03T22:49:07', '2'), + ('77', '3057', '2006-02-16T02:30:53', '2005-07-11T22:19:23', '2005-07-15T20:10:23', '2'), + ('77', '898', '2006-02-16T02:30:53', '2005-05-28T12:03:00', '2005-05-29T13:16:00', '1'), + ('77', '4505', '2006-02-16T02:30:53', '2005-08-22T21:34:00', '2005-08-29T18:59:00', '1'), + ('77', '230', '2006-02-16T02:30:53', '2005-08-02T21:48:09', '2005-08-06T18:37:09', '1'), + ('77', '3250', '2006-02-16T02:30:53', '2005-05-29T11:07:25', '2005-06-02T14:16:25', '1'), + ('77', '4363', '2006-02-16T02:30:53', '2005-07-08T22:05:41', '2005-07-09T23:09:41', '2'), + ('77', '928', '2006-02-16T02:30:53', '2005-05-28T08:54:06', '2005-06-05T05:54:06', '1'), + ('77', '3024', '2006-02-16T02:30:53', '2005-05-26T23:52:13', '2005-05-30T18:55:13', '1'), + ('77', '93', '2006-02-16T02:30:53', '2005-08-02T01:16:59', '2005-08-03T02:41:59', '2'), + ('77', '2732', '2006-02-16T02:30:53', '2005-06-21T02:48:21', '2005-06-23T04:43:21', '1'), + ('77', '3305', '2006-02-16T02:30:53', '2005-07-31T11:23:45', '2005-08-06T15:51:45', '1'), + ('77', '4318', '2006-02-16T02:30:53', '2005-06-18T19:29:21', '2005-06-26T22:27:21', '1'), + ('77', '3644', '2006-02-16T02:30:53', '2005-08-17T21:31:46', '2005-08-26T02:26:46', '2'), + ('77', '1794', '2006-02-16T02:30:53', '2005-08-20T11:17:45', '2005-08-29T13:25:45', '2'), + ('77', '1905', '2006-02-16T02:30:53', '2005-08-21T15:10:50', '2005-08-26T09:20:50', '2'), + ('325', '2175', '2006-02-16T02:30:53', '2005-07-10T13:34:26', '2005-07-15T10:01:26', '1'), + ('325', '1010', '2006-02-16T02:30:53', '2005-07-31T19:46:29', '2005-08-03T22:21:29', '1'), + ('325', '599', '2006-02-16T02:30:53', '2005-07-29T10:48:24', '2005-07-30T06:29:24', '2'), + ('325', '3121', '2006-02-16T02:30:53', '2005-06-18T23:39:22', '2005-06-21T19:23:22', '1'), + ('325', '4025', '2006-02-16T02:30:53', '2005-08-22T08:27:27', '2005-08-26T05:57:27', '2'), + ('325', '3856', '2006-02-16T02:30:53', '2005-08-01T04:55:34', '2005-08-02T05:18:34', '1'), + ('325', '2147', '2006-02-16T02:30:53', '2005-07-10T11:51:58', '2005-07-12T07:53:58', '2'), + ('325', '2622', '2006-02-16T02:30:53', '2005-06-18T23:12:13', '2005-06-20T04:19:13', '2'), + ('325', '689', '2006-02-16T02:30:53', '2005-07-28T03:20:26', '2005-08-02T05:48:26', '2'), + ('325', '2983', '2006-02-16T02:30:53', '2005-08-19T09:34:02', '2005-08-23T05:25:02', '2'), + ('325', '3254', '2006-02-16T02:30:53', '2005-07-09T23:10:49', '2005-07-18T04:30:49', '1'), + ('325', '1392', '2006-02-16T02:30:53', '2005-07-31T18:39:36', '2005-08-03T15:29:36', '2'), + ('325', '4144', '2006-02-16T02:30:53', '2005-08-21T19:59:33', '2005-08-30T19:40:33', '1'), + ('325', '833', '2006-02-16T02:30:53', '2005-07-11T08:32:23', '2005-07-17T08:43:23', '1'), + ('325', '4350', '2006-02-16T02:30:53', '2005-07-12T09:04:11', '2005-07-13T04:27:11', '1'), + ('325', '4231', '2006-02-16T02:30:53', '2005-08-21T12:23:20', '2005-08-27T06:26:20', '1'), + ('325', '1814', '2006-02-16T02:30:53', '2005-08-18T23:44:00', '2005-08-26T05:27:00', '2'), + ('325', '1555', '2006-02-16T02:30:53', '2005-08-01T07:57:16', '2005-08-04T11:44:16', '2'), + ('325', '65', '2006-02-16T02:30:53', '2005-06-19T19:34:45', '2005-06-27T14:49:45', '1'), + ('325', '4135', '2006-02-16T02:30:53', '2005-08-17T22:35:24', '2005-08-18T20:31:24', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['7223', '131', '3517', '14815', '440', '6666', '13265', '80', '13120', '13553', '3808', '16021', '6192', '8644', '9191', '7004', '1624', '11908', '12434', '14873', '6763', '14682', '9318', '8073', '14409', '4386', '1598', '14145', '8022', '8328', '7276', '5856', '5241', '3656', '8105', '8428', '15189', '12528', '2087', '8204', '9771', '11132', '3141', '5234', '1228', '9281', '8119', '9042', '10230', '486', '13643', '3830', '5836', '12710', '9536', '12500', '2618', '1918', '14972', '1162', '104', '2480', '8981', '4072', '7648', '11137', '1333', '8637', '12929', '2088', '5621', '14498', '10735', '4703', '4847', '4395', '864', '2395', '11401', '11766', '2373', '15605', '8937', '397', '8963', '14651', '1248', '14981', '14142', '15219', '12640', '8566', '1434', '7241', '7148', '12998', '6926', '5556', '12544', '9130']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('325', '2623', '2006-02-16T02:30:53', '2005-07-27T09:42:27', '2005-08-04T04:02:27', '1'), + ('325', '815', '2006-02-16T02:30:53', '2005-05-25T21:42:46', '2005-05-30T23:25:46', '2'), + ('314', '2762', '2006-02-16T02:30:53', '2005-07-06T00:52:35', '2005-07-08T20:10:35', '2'), + ('314', '1183', '2006-02-16T02:30:53', '2005-08-22T01:12:44', '2005-08-24T01:42:44', '2'), + ('314', '4452', '2006-02-16T02:30:53', '2005-05-27T18:00:35', '2005-05-29T16:15:35', '1'), + ('314', '3194', '2006-02-16T02:30:53', '2005-07-12T11:32:15', '2005-07-14T16:09:15', '2'), + ('314', '3933', '2006-02-16T02:30:53', '2005-08-19T17:29:00', '2005-08-20T12:59:00', '2'), + ('314', '2478', '2006-02-16T02:30:53', '2005-05-25T12:12:07', '2005-05-31T17:46:07', '2'), + ('314', '2273', '2006-02-16T02:30:53', '2005-08-19T11:47:38', '2005-08-26T08:20:38', '2'), + ('314', '4407', '2006-02-16T02:30:53', '2005-08-20T04:07:21', '2005-08-28T09:55:21', '1'), + ('314', '4339', '2006-02-16T02:30:53', '2005-07-06T15:15:35', '2005-07-07T16:10:35', '1'), + ('314', '3057', '2006-02-16T02:30:53', '2005-08-23T21:37:59', '2005-08-31T01:52:59', '1'), + ('314', '4573', '2006-02-16T02:30:53', '2005-07-11T11:44:41', '2005-07-19T10:12:41', '1'), + ('314', '4507', '2006-02-16T02:30:53', '2005-07-29T14:45:45', '2005-08-03T20:10:45', '2'), + ('314', '500', '2006-02-16T02:30:53', '2005-07-30T12:25:51', '2005-08-05T16:13:51', '1'), + ('314', '4416', '2006-02-16T02:30:53', '2005-07-27T01:36:05', '2005-08-03T23:46:05', '1'), + ('314', '1066', '2006-02-16T02:30:53', '2005-06-16T07:48:57', '2005-06-17T05:52:57', '1'), + ('314', '3390', '2006-02-16T02:30:53', '2005-08-17T15:43:09', '2005-08-24T14:32:09', '2'), + ('314', '3078', '2006-02-16T02:30:53', '2005-08-18T10:38:08', '2005-08-22T16:14:08', '2'), + ('314', '3533', '2006-02-16T02:30:53', '2005-08-22T03:31:06', '2005-08-31T05:34:06', '1'), + ('314', '3364', '2006-02-16T02:30:53', '2005-07-12T15:26:34', '2005-07-18T16:38:34', '2'), + ('314', '2974', '2006-02-16T02:30:53', '2005-08-21T20:25:57', '2005-08-28T00:42:57', '2'), + ('314', '2426', '2006-02-16T02:30:53', '2005-07-30T17:14:30', '2005-08-06T16:53:30', '1'), + ('314', '630', '2006-02-16T02:30:53', '2005-07-28T17:29:02', '2005-08-01T22:17:02', '2'), + ('314', '1161', '2006-02-16T02:30:53', '2005-08-21T10:53:35', '2005-08-25T10:40:35', '2'), + ('314', '499', '2006-02-16T02:30:53', '2005-07-07T20:55:19', '2005-07-10T21:51:19', '1'), + ('314', '4171', '2006-02-16T02:30:53', '2005-06-16T06:02:39', '2005-06-23T09:09:39', '1'), + ('314', '150', '2006-02-16T02:30:53', '2005-08-21T02:11:38', '2005-08-22T22:19:38', '2'), + ('314', '294', '2006-02-16T02:30:53', '2005-07-28T15:48:56', '2005-08-06T13:40:56', '1'), + ('314', '4454', '2006-02-16T02:30:53', '2005-07-29T04:06:24', '2005-08-03T22:24:24', '1'), + ('314', '1665', '2006-02-16T02:30:53', '2005-07-27T11:41:57', '2005-08-01T10:39:57', '1'), + ('314', '497', '2006-02-16T02:30:53', '2005-07-10T17:57:32', '2005-07-11T13:57:32', '1'), + ('314', '4079', '2006-02-16T02:30:53', '2005-07-09T13:19:14', '2005-07-11T14:32:14', '1'), + ('314', '4544', '2006-02-16T02:30:53', '2005-07-06T07:55:22', '2005-07-13T10:36:22', '2'), + ('314', '1316', '2006-02-16T02:30:53', '2005-07-28T18:59:46', '2005-07-29T22:51:46', '1'), + ('398', '2545', '2006-02-16T02:30:53', '2005-07-29T07:10:14', '2005-08-06T02:29:14', '2'), + ('398', '2559', '2006-02-16T02:30:53', '2005-08-22T15:56:42', '2005-08-29T12:20:42', '1'), + ('398', '3381', '2006-02-16T02:30:53', '2005-08-18T13:52:41', '2005-08-27T09:09:41', '2'), + ('398', '466', '2006-02-16T02:30:53', '2005-06-17T17:35:10', '2005-06-26T13:52:10', '1'), + ('398', '2472', '2006-02-16T02:30:53', '2005-07-28T23:18:29', '2005-08-02T04:49:29', '1'), + ('398', '4123', '2006-02-16T02:30:53', '2005-07-31T09:55:36', '2005-08-04T10:11:36', '2'), + ('398', '2212', '2006-02-16T02:30:53', '2005-08-02T09:14:09', '2005-08-08T06:39:09', '1'), + ('398', '1806', '2006-02-16T02:30:53', '2005-06-20T19:55:47', '2005-06-30T00:31:47', '1'), + ('398', '4182', '2006-02-16T02:30:53', '2005-07-09T12:44:47', '2005-07-17T10:02:47', '1'), + ('398', '4473', '2006-02-16T02:30:53', '2005-06-15T03:50:36', '2005-06-17T22:41:36', '1'), + ('398', '3086', '2006-02-16T02:30:53', '2005-07-30T15:15:51', '2005-08-05T12:58:51', '1'), + ('398', '1542', '2006-02-16T02:30:53', '2005-07-28T19:23:15', '2005-08-04T15:53:15', '2'), + ('398', '2770', '2006-02-16T02:30:53', '2005-07-30T06:33:55', '2005-08-04T09:31:55', '2'), + ('398', '76', '2006-02-16T02:30:53', '2005-08-01T01:49:36', '2005-08-05T01:29:36', '2'), + ('398', '1822', '2006-02-16T02:30:53', '2005-05-27T23:51:12', '2005-05-28T20:26:12', '1'), + ('398', '2443', '2006-02-16T02:30:53', '2005-08-20T07:42:24', '2005-08-26T09:13:24', '2'), + ('310', '553', '2006-02-16T02:30:53', '2005-07-06T16:01:16', '2005-07-15T19:35:16', '2'), + ('310', '1842', '2006-02-16T02:30:53', '2005-07-10T16:49:02', '2005-07-11T22:35:02', '2'), + ('310', '3011', '2006-02-16T02:30:53', '2005-08-18T21:02:50', '2005-08-26T15:07:50', '2'), + ('310', '2547', '2006-02-16T02:30:53', '2005-07-31T01:19:02', '2005-08-02T19:38:02', '1'), + ('310', '36', '2006-02-16T02:30:53', '2005-08-18T13:05:51', '2005-08-19T14:54:51', '2'), + ('310', '2465', '2006-02-16T02:30:53', '2005-06-19T08:03:01', '2005-06-24T03:23:01', '2'), + ('310', '3749', '2006-02-16T02:30:53', '2005-06-17T05:40:14', '2005-06-21T08:53:14', '2'), + ('310', '3422', '2006-02-16T02:30:53', '2005-08-22T06:53:21', '2005-08-29T02:25:21', '1'), + ('310', '987', '2006-02-16T02:30:53', '2005-06-14T23:09:38', '2005-06-23T22:00:38', '1'), + ('310', '4281', '2006-02-16T02:30:53', '2005-05-25T17:46:33', '2005-05-27T15:20:33', '1'), + ('310', '4078', '2006-02-16T02:30:53', '2005-06-18T21:04:09', '2005-06-22T16:24:09', '1'), + ('310', '4413', '2006-02-16T02:30:53', '2005-07-30T04:25:30', '2005-08-06T02:37:30', '1'), + ('310', '3130', '2006-02-16T02:30:53', '2005-07-07T04:48:02', '2005-07-12T10:32:02', '2'), + ('310', '797', '2006-02-16T02:30:53', '2005-07-28T01:35:33', '2005-08-04T06:21:33', '2'), + ('310', '2500', '2006-02-16T02:30:53', '2005-08-02T09:25:31', '2005-08-08T08:10:31', '1'), + ('310', '448', '2006-02-16T02:30:53', '2005-06-15T11:37:08', '2005-06-16T10:13:08', '2'), + ('310', '1069', '2006-02-16T02:30:53', '2005-07-29T14:30:11', '2005-08-04T14:00:11', '1'), + ('310', '1531', '2006-02-16T02:30:53', '2005-08-19T05:05:23', '2005-08-25T04:37:23', '1'), + ('310', '506', '2006-02-16T02:30:53', '2005-06-17T17:35:30', '2005-06-23T20:13:30', '2'), + ('310', '552', '2006-02-16T02:30:53', '2005-07-10T05:34:10', '2005-07-14T02:49:10', '1'), + ('544', '3971', '2006-02-16T02:30:53', '2005-08-21T14:10:44', '2005-08-23T08:29:44', '1'), + ('544', '4061', '2006-02-16T02:30:53', '2005-08-01T19:29:45', '2005-08-02T19:50:45', '2'), + ('544', '2859', '2006-02-16T02:30:53', '2005-07-08T11:44:56', '2005-07-13T09:17:56', '1'), + ('544', '3397', '2006-02-16T02:30:53', '2005-07-08T18:29:13', '2005-07-15T18:12:13', '2'), + ('544', '360', '2006-02-16T02:30:53', '2005-07-07T21:13:22', '2005-07-08T22:59:22', '2'), + ('544', '2777', '2006-02-16T02:30:53', '2005-05-30T03:27:17', '2005-06-06T08:28:17', '1'), + ('544', '899', '2006-02-16T02:30:53', '2005-06-18T15:45:15', '2005-06-27T19:11:15', '2'), + ('544', '1799', '2006-02-16T02:30:53', '2005-08-02T19:05:06', '2005-08-09T22:34:06', '1'), + ('544', '2999', '2006-02-16T02:30:53', '2005-08-17T09:58:40', '2005-08-21T04:59:40', '1'), + ('544', '2780', '2006-02-16T02:30:53', '2005-06-18T14:37:57', '2005-06-23T19:29:57', '2'), + ('544', '3152', '2006-02-16T02:30:53', '2005-08-23T06:48:47', '2005-08-28T06:09:47', '1'), + ('544', '2406', '2006-02-16T02:30:53', '2005-07-30T02:53:21', '2005-08-08T03:33:21', '2'), + ('544', '4193', '2006-02-16T02:30:53', '2005-05-27T12:29:02', '2005-05-28T17:36:02', '2'), + ('544', '100', '2006-02-16T02:30:53', '2005-07-30T03:46:26', '2005-08-08T06:12:26', '1'), + ('544', '4037', '2006-02-16T02:30:53', '2005-08-21T19:31:09', '2005-08-28T14:26:09', '2'), + ('544', '3878', '2006-02-16T02:30:53', '2005-06-15T05:33:52', '2005-06-19T06:56:52', '2'), + ('544', '1239', '2006-02-16T02:30:53', '2005-08-22T07:19:05', '2005-08-26T03:08:05', '2'), + ('544', '1479', '2006-02-16T02:30:53', '2005-08-21T02:07:43', '2005-08-23T02:37:43', '2'), + ('544', '3313', '2006-02-16T02:30:53', '2005-08-22T17:00:31', '2005-08-31T20:16:31', '1'), + ('544', '1715', '2006-02-16T02:30:53', '2005-08-18T18:14:49', '2005-08-24T21:25:49', '1'), + ('544', '2011', '2006-02-16T02:30:53', '2005-07-29T11:35:46', '2005-07-30T13:50:46', '1'), + ('544', '4228', '2006-02-16T02:30:53', '2005-06-15T18:30:46', '2005-06-24T17:51:46', '1'), + ('354', '2433', '2006-02-16T02:30:53', '2005-07-27T10:25:49', '2005-07-28T05:30:49', '2'), + ('354', '1783', '2006-02-16T02:30:53', '2005-07-27T07:04:09', '2005-08-03T10:20:09', '2'), + ('354', '2301', '2006-02-16T02:30:53', '2005-08-19T07:32:16', '2005-08-24T01:56:16', '2'), + ('354', '1276', '2006-02-16T02:30:53', '2005-07-26T22:52:45', '2005-07-28T18:32:45', '1'), + ('354', '4483', '2006-02-16T02:30:53', '2005-07-10T03:10:17', '2005-07-14T02:47:17', '1'), + ('354', '3783', '2006-02-16T02:30:53', '2005-08-18T14:25:51', '2005-08-26T18:42:51', '1'), + ('354', '1715', '2006-02-16T02:30:53', '2005-07-30T09:55:10', '2005-08-04T08:57:10', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['12243', '402', '11782', '4449', '14245', '14840', '140', '5873', '6054', '8477', '8321', '4034', '15956', '1491', '12759', '8921', '3139', '5354', '4745', '10420', '2275', '158', '6939', '2769', '7235', '8609', '6838', '14212', '3821', '13128', '3831', '4107', '4823', '6139', '7222', '3012', '8217', '9474', '11634', '15709', '13550', '13696', '11022', '14695', '1872', '3847', '13232', '7541', '13263', '3533', '8549', '2477', '15686', '6420', '4068', '10930', '521', '15366', '12696', '14524', '10695', '3797', '1548', '15966', '13337', '6315', '11619', '15053', '2046', '9866', '2641', '2487', '5945', '919', '13734', '8586', '5591', '9113', '7837', '910', '5570', '5463', '15200', '15202', '10802', '1292', '13127', '7959', '12897', '6606', '8069', '1458', '6347', '14257', '8388', '10562', '1745', '2898', '8696', '4915']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('354', '1829', '2006-02-16T02:30:53', '2005-08-18T03:38:54', '2005-08-27T06:56:54', '2'), + ('354', '461', '2006-02-16T02:30:53', '2005-05-27T13:17:18', '2005-05-30T08:53:18', '2'), + ('354', '4098', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('354', '2813', '2006-02-16T02:30:53', '2005-07-07T23:18:58', '2005-07-15T20:40:58', '2'), + ('354', '975', '2006-02-16T02:30:53', '2005-08-21T05:30:54', '2005-08-26T07:02:54', '1'), + ('354', '1240', '2006-02-16T02:30:53', '2005-08-22T01:58:42', '2005-08-29T22:32:42', '2'), + ('354', '655', '2006-02-16T02:30:53', '2005-05-25T23:34:22', '2005-05-27T01:10:22', '1'), + ('354', '3151', '2006-02-16T02:30:53', '2005-07-10T19:02:10', '2005-07-14T19:13:10', '2'), + ('354', '1176', '2006-02-16T02:30:53', '2005-07-11T03:58:39', '2005-07-13T23:08:39', '1'), + ('354', '3571', '2006-02-16T02:30:53', '2005-07-29T08:40:36', '2005-08-06T08:28:36', '2'), + ('354', '1875', '2006-02-16T02:30:53', '2005-07-29T03:50:54', '2005-08-01T02:08:54', '1'), + ('354', '1666', '2006-02-16T02:30:53', '2005-07-07T02:36:33', '2005-07-09T08:32:33', '2'), + ('354', '2763', '2006-02-16T02:30:53', '2005-08-23T19:19:21', '2005-08-25T22:15:21', '2'), + ('354', '848', '2006-02-16T02:30:53', '2005-06-15T21:48:18', '2005-06-20T16:40:18', '1'), + ('354', '4193', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('354', '1016', '2006-02-16T02:30:53', '2005-07-30T02:04:02', '2005-07-31T06:18:02', '1'), + ('354', '3474', '2006-02-16T02:30:53', '2005-06-20T19:44:45', '2005-06-23T16:24:45', '1'), + ('354', '951', '2006-02-16T02:30:53', '2005-07-09T18:04:33', '2005-07-15T18:19:33', '1'), + ('354', '1351', '2006-02-16T02:30:53', '2005-07-08T13:45:09', '2005-07-12T18:54:09', '1'), + ('354', '3490', '2006-02-16T02:30:53', '2005-08-01T08:13:53', '2005-08-06T08:05:53', '2'), + ('354', '2805', '2006-02-16T02:30:53', '2005-06-18T06:31:29', '2005-06-24T10:04:29', '2'), + ('354', '2395', '2006-02-16T02:30:53', '2005-05-26T01:27:11', '2005-06-03T00:30:11', '2'), + ('354', '278', '2006-02-16T02:30:53', '2005-07-26T23:17:51', '2005-08-03T21:12:51', '2'), + ('354', '1222', '2006-02-16T02:30:53', '2005-06-19T17:52:14', '2005-06-26T20:30:14', '2'), + ('354', '1261', '2006-02-16T02:30:53', '2005-07-27T10:09:30', '2005-08-05T11:44:30', '2'), + ('354', '3997', '2006-02-16T02:30:53', '2005-07-29T13:19:25', '2005-08-06T08:33:25', '2'), + ('354', '3492', '2006-02-16T02:30:53', '2005-07-12T19:01:30', '2005-07-17T23:42:30', '1'), + ('354', '4540', '2006-02-16T02:30:53', '2005-08-21T04:29:26', '2005-08-24T00:46:26', '2'), + ('354', '4385', '2006-02-16T02:30:53', '2005-07-06T15:36:20', '2005-07-11T20:04:20', '1'), + ('206', '485', '2006-02-16T02:30:53', '2005-08-19T12:04:16', '2005-08-26T16:06:16', '2'), + ('206', '1338', '2006-02-16T02:30:53', '2005-07-06T16:06:35', '2005-07-08T15:14:35', '2'), + ('206', '4232', '2006-02-16T02:30:53', '2005-07-07T06:36:32', '2005-07-14T03:36:32', '1'), + ('206', '155', '2006-02-16T02:30:53', '2005-07-08T17:28:54', '2005-07-11T23:10:54', '1'), + ('206', '3065', '2006-02-16T02:30:53', '2005-07-11T08:39:33', '2005-07-17T08:00:33', '2'), + ('206', '2330', '2006-02-16T02:30:53', '2005-07-27T09:38:43', '2005-07-28T06:25:43', '1'), + ('206', '1392', '2006-02-16T02:30:53', '2005-06-20T10:43:13', '2005-06-28T10:07:13', '2'), + ('206', '3747', '2006-02-16T02:30:53', '2005-07-28T23:44:13', '2005-08-03T21:27:13', '2'), + ('206', '3771', '2006-02-16T02:30:53', '2005-07-30T23:05:44', '2005-08-05T23:46:44', '1'), + ('206', '2576', '2006-02-16T02:30:53', '2005-08-17T04:31:49', '2005-08-21T02:51:49', '1'), + ('206', '346', '2006-02-16T02:30:53', '2005-08-23T10:36:00', '2005-08-28T06:18:00', '2'), + ('206', '208', '2006-02-16T02:30:53', '2005-08-20T03:58:51', '2005-08-28T00:45:51', '2'), + ('206', '1279', '2006-02-16T02:30:53', '2005-08-20T09:16:15', '2005-08-21T03:33:15', '1'), + ('206', '827', '2006-02-16T02:30:53', '2005-08-02T05:35:03', '2005-08-09T10:20:03', '2'), + ('206', '412', '2006-02-16T02:30:53', '2005-08-21T20:46:47', '2005-08-22T22:25:47', '2'), + ('206', '3596', '2006-02-16T02:30:53', '2005-06-17T02:27:03', '2005-06-20T22:41:03', '2'), + ('206', '782', '2006-02-16T02:30:53', '2005-07-06T16:44:41', '2005-07-07T21:54:41', '2'), + ('206', '2370', '2006-02-16T02:30:53', '2005-08-19T16:13:32', '2005-08-28T14:42:32', '2'), + ('206', '4100', '2006-02-16T02:30:53', '2005-07-27T21:40:05', '2005-07-29T16:13:05', '1'), + ('206', '214', '2006-02-16T02:30:53', '2005-08-19T17:26:55', '2005-08-28T20:07:55', '2'), + ('206', '2028', '2006-02-16T02:30:53', '2005-07-06T01:26:44', '2005-07-14T21:37:44', '1'), + ('206', '1866', '2006-02-16T02:30:53', '2005-07-29T11:12:13', '2005-08-06T06:04:13', '2'), + ('206', '2510', '2006-02-16T02:30:53', '2005-06-18T20:58:46', '2005-06-22T21:49:46', '1'), + ('206', '2041', '2006-02-16T02:30:53', '2005-08-23T09:42:21', '2005-08-29T12:22:21', '1'), + ('206', '4443', '2006-02-16T02:30:53', '2005-07-11T23:38:49', '2005-07-17T17:46:49', '2'), + ('206', '4152', '2006-02-16T02:30:53', '2005-07-07T04:34:38', '2005-07-11T09:16:38', '2'), + ('206', '2027', '2006-02-16T02:30:53', '2005-08-02T02:38:07', '2005-08-08T05:15:07', '2'), + ('374', '2397', '2006-02-16T02:30:53', '2005-05-28T03:32:22', '2005-05-28T22:37:22', '1'), + ('374', '1453', '2006-02-16T02:30:53', '2005-08-22T21:45:57', '2005-08-30T16:35:57', '1'), + ('374', '3989', '2006-02-16T02:30:53', '2005-08-18T20:13:08', '2005-08-19T18:02:08', '2'), + ('374', '4409', '2006-02-16T02:30:53', '2005-08-21T15:05:27', '2005-08-29T12:07:27', '2'), + ('374', '3612', '2006-02-16T02:30:53', '2005-08-01T18:16:20', '2005-08-03T12:21:20', '2'), + ('374', '1047', '2006-02-16T02:30:53', '2005-07-06T14:54:52', '2005-07-10T09:50:52', '2'), + ('374', '2094', '2006-02-16T02:30:53', '2005-06-16T01:43:33', '2005-06-23T22:04:33', '2'), + ('374', '4472', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('374', '3584', '2006-02-16T02:30:53', '2005-08-19T20:06:57', '2005-08-20T16:31:57', '1'), + ('374', '608', '2006-02-16T02:30:53', '2005-07-11T18:42:49', '2005-07-12T23:19:49', '2'), + ('374', '3652', '2006-02-16T02:30:53', '2005-08-17T04:03:26', '2005-08-22T03:07:26', '1'), + ('374', '1065', '2006-02-16T02:30:53', '2005-08-22T10:13:09', '2005-08-28T12:42:09', '2'), + ('374', '872', '2006-02-16T02:30:53', '2005-06-17T14:39:50', '2005-06-24T16:02:50', '1'), + ('374', '3555', '2006-02-16T02:30:53', '2005-07-31T13:13:50', '2005-08-07T15:11:50', '1'), + ('374', '231', '2006-02-16T02:30:53', '2005-06-19T09:38:33', '2005-06-22T09:55:33', '1'), + ('374', '3683', '2006-02-16T02:30:53', '2005-06-18T21:32:54', '2005-06-23T21:11:54', '2'), + ('374', '427', '2006-02-16T02:30:53', '2005-07-10T22:52:42', '2005-07-11T21:52:42', '1'), + ('374', '4052', '2006-02-16T02:30:53', '2005-05-30T11:35:06', '2005-06-02T13:16:06', '2'), + ('374', '4561', '2006-02-16T02:30:53', '2005-08-20T10:29:57', '2005-08-25T14:41:57', '2'), + ('374', '2752', '2006-02-16T02:30:53', '2005-07-29T12:16:34', '2005-08-07T06:48:34', '1'), + ('374', '378', '2006-02-16T02:30:53', '2005-07-10T04:25:03', '2005-07-16T04:21:03', '1'), + ('374', '3903', '2006-02-16T02:30:53', '2005-07-30T09:09:03', '2005-07-31T03:13:03', '1'), + ('374', '115', '2006-02-16T02:30:53', '2005-07-28T08:58:32', '2005-07-29T14:11:32', '1'), + ('374', '2601', '2006-02-16T02:30:53', '2005-05-30T10:46:16', '2005-06-04T13:32:16', '1'), + ('374', '2013', '2006-02-16T02:30:53', '2005-07-10T03:46:47', '2005-07-17T09:28:47', '1'), + ('374', '601', '2006-02-16T02:30:53', '2005-07-09T22:57:02', '2005-07-11T03:10:02', '1'), + ('374', '1000', '2006-02-16T02:30:53', '2005-08-22T16:22:53', '2005-08-24T10:25:53', '2'), + ('374', '2119', '2006-02-16T02:30:53', '2005-08-22T16:26:53', '2005-08-23T13:49:53', '2'), + ('178', '3998', '2006-02-16T02:30:53', '2005-08-01T22:18:32', '2005-08-10T18:41:32', '2'), + ('178', '4535', '2006-02-16T02:30:53', '2005-06-15T09:03:52', '2005-06-21T07:53:52', '1'), + ('178', '2582', '2006-02-16T02:30:53', '2005-08-19T12:04:03', '2005-08-27T13:56:03', '1'), + ('178', '1549', '2006-02-16T02:30:53', '2005-07-28T13:43:20', '2005-08-02T12:13:20', '2'), + ('178', '1512', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('178', '2805', '2006-02-16T02:30:53', '2005-07-12T08:03:40', '2005-07-13T09:05:40', '1'), + ('178', '2822', '2006-02-16T02:30:53', '2005-07-28T17:23:46', '2005-07-30T16:19:46', '1'), + ('178', '3546', '2006-02-16T02:30:53', '2005-06-15T20:24:05', '2005-06-21T01:22:05', '1'), + ('178', '3160', '2006-02-16T02:30:53', '2005-07-11T20:18:53', '2005-07-16T20:45:53', '1'), + ('178', '3830', '2006-02-16T02:30:53', '2005-08-21T05:52:57', '2005-08-29T03:18:57', '2'), + ('178', '770', '2006-02-16T02:30:53', '2005-07-29T05:48:15', '2005-08-05T06:24:15', '2'), + ('178', '1947', '2006-02-16T02:30:53', '2005-08-01T13:05:52', '2005-08-02T17:05:52', '1'), + ('178', '2812', '2006-02-16T02:30:53', '2005-06-16T16:41:16', '2005-06-23T21:02:16', '2'), + ('178', '3106', '2006-02-16T02:30:53', '2005-06-20T02:38:06', '2005-06-29T08:18:06', '2'), + ('178', '2553', '2006-02-16T02:30:53', '2005-07-29T16:45:18', '2005-08-07T18:51:18', '1'), + ('178', '2772', '2006-02-16T02:30:53', '2005-07-08T21:31:22', '2005-07-13T16:45:22', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['1568', '2124', '15323', '9311', '2844', '6554', '11319', '11884', '8287', '14314', '9879', '5094', '14104', '6566', '12049', '10125', '9004', '11927', '2293', '5057', '12727', '5984', '5015', '4339', '2163', '746', '9452', '1864', '10645', '7181', '9637', '2535', '14111', '2292', '11811', '6353', '15777', '1', '12094', '7728', '2982', '9724', '10568', '12777', '15574', '1630', '4485', '13001', '5072', '10522', '12206', '9494', '3882', '7413', '5042', '11190', '5826', '1108', '7011', '15774', '2138', '14497', '2687', '183', '5537', '8581', '13130', '12874', '12247', '13045', '5930', '2082', '8216', '12148', '1390', '1285', '5550', '5080', '11665', '4360', '6277', '4828', '2740', '7832', '7073', '5620', '14998', '456', '5792', '13495', '8938', '271', '11203', '3595', '5497', '5919', '6158', '2521', '11245', '8494']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('178', '635', '2006-02-16T02:30:53', '2005-06-16T03:14:01', '2005-06-19T21:17:01', '2'), + ('178', '1273', '2006-02-16T02:30:53', '2005-06-17T20:49:14', '2005-06-23T17:44:14', '1'), + ('178', '1153', '2006-02-16T02:30:53', '2005-08-22T20:22:40', '2005-08-26T00:35:40', '1'), + ('178', '1432', '2006-02-16T02:30:53', '2005-07-30T16:58:31', '2005-08-07T15:23:31', '1'), + ('178', '4452', '2006-02-16T02:30:53', '2005-06-19T22:40:12', '2005-06-24T03:58:12', '2'), + ('178', '2741', '2006-02-16T02:30:53', '2005-07-12T05:07:26', '2005-07-21T06:06:26', '2'), + ('178', '4069', '2006-02-16T02:30:53', '2005-08-02T16:10:09', '2005-08-09T11:21:09', '2'), + ('178', '797', '2006-02-16T02:30:53', '2005-08-17T14:43:23', '2005-08-25T15:38:23', '1'), + ('178', '812', '2006-02-16T02:30:53', '2005-07-29T02:03:58', '2005-08-07T02:11:58', '1'), + ('178', '4115', '2006-02-16T02:30:53', '2005-08-21T07:50:14', '2005-08-24T10:47:14', '2'), + ('178', '1935', '2006-02-16T02:30:53', '2005-07-31T13:45:32', '2005-08-07T17:12:32', '1'), + ('178', '4451', '2006-02-16T02:30:53', '2005-07-09T05:59:47', '2005-07-18T05:34:47', '2'), + ('178', '912', '2006-02-16T02:30:53', '2005-08-21T00:37:44', '2005-08-21T22:55:44', '2'), + ('178', '1822', '2006-02-16T02:30:53', '2005-07-12T05:42:53', '2005-07-19T01:23:53', '2'), + ('178', '2433', '2006-02-16T02:30:53', '2005-08-17T20:53:27', '2005-08-26T19:45:27', '2'), + ('178', '493', '2006-02-16T02:30:53', '2005-07-31T21:33:03', '2005-08-01T19:10:03', '1'), + ('178', '3775', '2006-02-16T02:30:53', '2005-07-30T05:04:27', '2005-07-31T00:49:27', '1'), + ('178', '3134', '2006-02-16T02:30:53', '2005-08-17T16:25:03', '2005-08-23T16:41:03', '1'), + ('178', '3209', '2006-02-16T02:30:53', '2005-06-18T07:45:03', '2005-06-24T08:12:03', '1'), + ('178', '1076', '2006-02-16T02:30:53', '2005-07-09T04:20:29', '2005-07-14T23:59:29', '1'), + ('178', '15', '2006-02-16T02:30:53', '2005-08-18T21:45:15', '2005-08-24T15:52:15', '1'), + ('178', '2801', '2006-02-16T02:30:53', '2005-07-11T00:44:36', '2005-07-15T00:04:36', '1'), + ('178', '1564', '2006-02-16T02:30:53', '2005-07-09T01:54:24', '2005-07-12T20:07:24', '1'), + ('130', '3215', '2006-02-16T02:30:53', '2005-07-07T18:41:42', '2005-07-08T13:00:42', '1'), + ('130', '2600', '2006-02-16T02:30:53', '2005-06-17T23:46:16', '2005-06-22T22:48:16', '2'), + ('130', '4272', '2006-02-16T02:30:53', '2005-05-29T09:25:10', '2005-06-02T04:20:10', '2'), + ('130', '3178', '2006-02-16T02:30:53', '2005-07-30T22:19:16', '2005-08-04T19:26:16', '1'), + ('130', '1815', '2006-02-16T02:30:53', '2005-06-17T01:39:47', '2005-06-24T19:39:47', '2'), + ('130', '3864', '2006-02-16T02:30:53', '2005-08-01T15:52:01', '2005-08-09T18:58:01', '1'), + ('130', '2788', '2006-02-16T02:30:53', '2005-07-27T08:14:34', '2005-07-28T03:09:34', '1'), + ('130', '3013', '2006-02-16T02:30:53', '2005-07-31T05:18:54', '2005-08-03T01:23:54', '2'), + ('130', '901', '2006-02-16T02:30:53', '2005-06-19T01:39:04', '2005-06-28T01:33:04', '2'), + ('130', '1294', '2006-02-16T02:30:53', '2005-08-21T00:59:01', '2005-08-22T20:43:01', '2'), + ('130', '173', '2006-02-16T02:30:53', '2005-06-18T07:37:48', '2005-06-20T02:45:48', '2'), + ('130', '195', '2006-02-16T02:30:53', '2005-08-17T11:59:18', '2005-08-18T09:13:18', '2'), + ('130', '699', '2006-02-16T02:30:53', '2005-07-11T20:48:56', '2005-07-21T00:11:56', '1'), + ('130', '4241', '2006-02-16T02:30:53', '2005-08-23T13:29:08', '2005-08-27T18:50:08', '2'), + ('130', '367', '2006-02-15T21:30:53', '2005-05-24T22:53:30', '2005-05-26T22:04:30', '1'), + ('130', '1050', '2006-02-16T02:30:53', '2005-08-17T22:31:04', '2005-08-23T22:45:04', '1'), + ('130', '492', '2006-02-16T02:30:53', '2005-07-28T04:56:33', '2005-07-31T07:54:33', '1'), + ('130', '2574', '2006-02-16T02:30:53', '2005-06-20T08:38:29', '2005-06-28T13:21:29', '1'), + ('130', '518', '2006-02-16T02:30:53', '2005-07-31T08:33:08', '2005-08-08T04:50:08', '1'), + ('130', '3009', '2006-02-16T02:30:53', '2005-08-01T13:17:28', '2005-08-08T17:04:28', '1'), + ('130', '3467', '2006-02-16T02:30:53', '2005-08-18T23:39:22', '2005-08-27T20:28:22', '1'), + ('130', '3253', '2006-02-16T02:30:53', '2005-08-23T05:29:32', '2005-09-01T01:25:32', '2'), + ('130', '2413', '2006-02-16T02:30:53', '2005-06-16T07:55:01', '2005-06-19T06:38:01', '1'), + ('130', '2614', '2006-02-16T02:30:53', '2005-07-08T01:07:54', '2005-07-16T03:19:54', '2'), + ('254', '2505', '2006-02-16T02:30:53', '2005-08-19T07:36:44', '2005-08-22T13:06:44', '1'), + ('254', '94', '2006-02-16T02:30:53', '2005-07-09T05:01:58', '2005-07-18T08:17:58', '2'), + ('254', '4159', '2006-02-16T02:30:53', '2005-08-01T11:48:51', '2005-08-05T12:40:51', '1'), + ('254', '3275', '2006-02-16T02:30:53', '2005-08-18T02:22:20', '2005-08-23T05:36:20', '1'), + ('254', '3799', '2006-02-16T02:30:53', '2005-07-30T23:52:46', '2005-08-05T23:13:46', '2'), + ('254', '788', '2006-02-16T02:30:53', '2005-07-06T18:38:21', '2005-07-09T14:55:21', '1'), + ('254', '2909', '2006-02-16T02:30:53', '2005-07-27T16:45:40', '2005-07-31T12:02:40', '1'), + ('254', '3609', '2006-02-16T02:30:53', '2005-07-09T03:20:30', '2005-07-15T07:22:30', '1'), + ('254', '922', '2006-02-16T02:30:53', '2005-08-02T11:21:34', '2005-08-05T05:23:34', '1'), + ('254', '4104', '2006-02-16T02:30:53', '2005-07-10T16:21:02', '2005-07-17T21:08:02', '1'), + ('254', '2562', '2006-02-16T02:30:53', '2005-05-31T15:05:12', '2005-06-09T19:48:12', '2'), + ('254', '4082', '2006-02-16T02:30:53', '2005-07-27T01:58:34', '2005-07-28T06:11:34', '1'), + ('254', '1273', '2006-02-16T02:30:53', '2005-08-23T13:25:08', '2005-08-28T10:08:08', '2'), + ('254', '512', '2006-02-16T02:30:53', '2005-06-17T21:28:14', '2005-06-22T01:16:14', '2'), + ('254', '3240', '2006-02-16T02:30:53', '2005-08-21T14:09:47', '2005-08-22T11:10:47', '2'), + ('254', '3152', '2006-02-16T02:30:53', '2005-06-19T12:46:52', '2005-06-23T06:58:52', '2'), + ('254', '2877', '2006-02-16T02:30:53', '2005-05-26T05:01:18', '2005-06-01T09:04:18', '1'), + ('254', '1781', '2006-02-16T02:30:53', '2005-07-10T02:35:41', '2005-07-13T07:11:41', '2'), + ('254', '2102', '2006-02-16T02:30:53', '2005-07-29T12:02:06', '2005-08-02T10:32:06', '2'), + ('254', '2006', '2006-02-16T02:30:53', '2005-08-19T12:06:42', '2005-08-23T12:08:42', '1'), + ('254', '848', '2006-02-16T02:30:53', '2005-08-19T03:07:57', '2005-08-22T22:42:57', '2'), + ('254', '2264', '2006-02-16T02:30:53', '2005-08-18T03:51:51', '2005-08-24T05:36:51', '2'), + ('254', '389', '2006-02-16T02:30:53', '2005-08-19T09:17:35', '2005-08-23T12:04:35', '1'), + ('254', '2338', '2006-02-16T02:30:53', '2005-07-10T21:59:32', '2005-07-11T18:40:32', '2'), + ('254', '434', '2006-02-16T02:30:53', '2005-06-17T17:13:32', '2005-06-19T16:16:32', '1'), + ('254', '2211', '2006-02-16T02:30:53', '2005-07-28T23:43:59', '2005-08-06T05:05:59', '1'), + ('254', '2409', '2006-02-16T02:30:53', '2005-08-18T00:13:15', '2005-08-20T01:27:15', '2'), + ('254', '4502', '2006-02-16T02:30:53', '2005-06-15T16:06:29', '2005-06-19T13:11:29', '1'), + ('254', '1054', '2006-02-16T02:30:53', '2005-06-15T08:33:06', '2005-06-19T07:36:06', '1'), + ('254', '1905', '2006-02-16T02:30:53', '2005-07-10T02:58:35', '2005-07-16T02:38:35', '2'), + ('254', '635', '2006-02-16T02:30:53', '2005-07-09T05:23:55', '2005-07-11T05:56:55', '2'), + ('254', '334', '2006-02-16T02:30:53', '2005-08-17T05:36:57', '2005-08-23T01:38:57', '1'), + ('92', '1811', '2006-02-16T02:30:53', '2005-07-07T19:31:12', '2005-07-10T23:11:12', '2'), + ('92', '4023', '2006-02-16T02:30:53', '2005-07-11T16:19:01', '2005-07-18T21:00:01', '2'), + ('92', '1100', '2006-02-16T02:30:53', '2005-07-08T17:52:29', '2005-07-11T14:35:29', '1'), + ('92', '1534', '2006-02-16T02:30:53', '2005-06-19T15:59:04', '2005-06-28T12:18:04', '2'), + ('92', '284', '2006-02-16T02:30:53', '2005-07-28T08:46:11', '2005-08-04T06:55:11', '1'), + ('92', '3859', '2006-02-16T02:30:53', '2005-07-27T04:03:26', '2005-08-03T05:50:26', '1'), + ('92', '2980', '2006-02-16T02:30:53', '2005-07-10T05:30:52', '2005-07-16T04:13:52', '1'), + ('92', '3852', '2006-02-16T02:30:53', '2005-08-22T07:53:14', '2005-08-24T03:46:14', '2'), + ('92', '1699', '2006-02-16T02:30:53', '2005-05-27T19:50:06', '2005-06-02T22:14:06', '1'), + ('92', '4234', '2006-02-16T02:30:53', '2005-07-10T14:22:19', '2005-07-19T09:08:19', '1'), + ('92', '3881', '2006-02-16T02:30:53', '2005-08-20T01:40:25', '2005-08-23T06:32:25', '2'), + ('92', '4031', '2006-02-16T02:30:53', '2005-07-30T02:56:08', '2005-07-31T23:08:08', '2'), + ('92', '2388', '2006-02-16T02:30:53', '2005-05-26T16:22:01', '2005-06-03T17:30:01', '2'), + ('92', '4520', '2006-02-16T02:30:53', '2005-08-02T11:52:41', '2005-08-10T15:52:41', '2'), + ('92', '1431', '2006-02-16T02:30:53', '2005-07-06T04:59:49', '2005-07-15T06:26:49', '2'), + ('92', '4473', '2006-02-16T02:30:53', '2005-07-10T00:23:23', '2005-07-16T03:54:23', '1'), + ('92', '164', '2006-02-16T02:30:53', '2005-07-10T21:32:14', '2005-07-12T16:47:14', '1'), + ('92', '3954', '2006-02-16T02:30:53', '2005-07-11T09:50:24', '2005-07-13T04:49:24', '2'), + ('92', '132', '2006-02-16T02:30:53', '2005-06-19T00:41:08', '2005-06-22T00:40:08', '1'), + ('92', '2609', '2006-02-16T02:30:53', '2005-08-02T13:33:50', '2005-08-04T10:20:50', '2'), + ('92', '3524', '2006-02-16T02:30:53', '2005-07-29T09:04:32', '2005-07-31T10:30:32', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['11849', '13020', '14798', '2084', '3716', '13620', '9240', '1051', '13750', '6688', '10683', '4092', '13418', '13987', '699', '1968', '124', '3152', '9525', '14360', '2704', '4994', '10208', '2725', '4905', '434', '5347', '15746', '421', '1448', '3725', '11613', '11801', '3450', '5865', '8091', '3804', '14477', '1054', '3502', '7962', '14577', '752', '11196', '12991', '5137', '6755', '15741', '9492', '6747', '9', '4730', '13177', '10032', '16007', '11779', '4691', '13015', '2167', '535', '7536', '10135', '6125', '2787', '6991', '7760', '5871', '14231', '413', '614', '11491', '4522', '7929', '970', '2152', '15515', '2881', '10374', '3962', '10745', '3057', '12391', '3209', '6256', '3985', '13365', '8647', '4868', '2517', '10051', '16046', '8796', '13335', '12477', '6241', '3819', '15739', '3445', '13583', '13520']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('92', '1191', '2006-02-16T02:30:53', '2005-08-17T13:24:55', '2005-08-22T12:50:55', '2'), + ('92', '4501', '2006-02-16T02:30:53', '2005-08-19T08:07:50', '2005-08-28T11:42:50', '1'), + ('92', '7', '2006-02-16T02:30:53', '2005-08-22T00:44:08', '2005-08-27T02:18:08', '2'), + ('92', '428', '2006-02-16T02:30:53', '2005-06-17T17:17:19', '2005-06-22T14:57:19', '1'), + ('92', '3271', '2006-02-16T02:30:53', '2005-07-06T10:52:32', '2005-07-14T08:45:32', '2'), + ('92', '2361', '2006-02-16T02:30:53', '2005-08-20T06:41:27', '2005-08-24T11:02:27', '1'), + ('92', '587', '2006-02-16T02:30:53', '2005-07-30T13:57:54', '2005-08-03T12:23:54', '2'), + ('246', '1025', '2006-02-16T02:30:53', '2005-05-31T07:02:09', '2005-06-03T01:32:09', '1'), + ('246', '3363', '2006-02-16T02:30:53', '2005-08-20T11:11:42', '2005-08-29T16:16:42', '2'), + ('246', '2377', '2006-02-16T02:30:53', '2005-07-12T12:22:12', '2005-07-14T14:05:12', '1'), + ('246', '244', '2006-02-16T02:30:53', '2005-08-01T17:33:03', '2005-08-04T23:12:03', '1'), + ('246', '1721', '2006-02-16T02:30:53', '2005-07-07T05:54:18', '2005-07-16T09:14:18', '1'), + ('246', '2113', '2006-02-16T02:30:53', '2005-08-19T22:53:56', '2005-08-28T02:05:56', '2'), + ('246', '1443', '2006-02-16T02:30:53', '2005-08-20T19:19:30', '2005-08-23T15:37:30', '2'), + ('246', '130', '2006-02-16T02:30:53', '2005-05-29T02:11:44', '2005-06-04T20:23:44', '2'), + ('246', '1139', '2006-02-16T02:30:53', '2005-06-17T09:20:36', '2005-06-18T11:06:36', '2'), + ('246', '212', '2006-02-16T02:30:53', '2005-05-25T20:46:11', '2005-05-30T00:47:11', '2'), + ('246', '1022', '2006-02-16T02:30:53', '2005-06-20T20:42:41', '2005-06-28T21:12:41', '1'), + ('246', '2990', '2006-02-16T02:30:53', '2005-07-31T01:02:18', '2005-08-06T21:31:18', '1'), + ('246', '2677', '2006-02-16T02:30:53', '2005-08-21T09:16:40', '2005-08-29T11:43:40', '2'), + ('246', '2026', '2006-02-16T02:30:53', '2005-06-19T13:50:10', '2005-06-26T18:25:10', '2'), + ('246', '2546', '2006-02-16T02:30:53', '2005-07-09T00:54:13', '2005-07-09T21:02:13', '1'), + ('246', '3324', '2006-02-16T02:30:53', '2005-08-01T00:54:51', '2005-08-04T22:39:51', '2'), + ('246', '63', '2006-02-16T02:30:53', '2005-06-19T15:01:23', '2005-06-22T09:08:23', '1'), + ('246', '4101', '2006-02-16T02:30:53', '2005-07-08T20:56:00', '2005-07-12T00:19:00', '2'), + ('246', '3360', '2006-02-16T02:30:53', '2005-05-27T16:54:27', '2005-06-04T22:26:27', '1'), + ('246', '1293', '2006-02-16T02:30:53', '2005-07-09T17:31:32', '2005-07-10T21:06:32', '2'), + ('246', '2241', '2006-02-16T02:30:53', '2005-08-23T12:26:19', '2005-08-26T09:51:19', '2'), + ('246', '2985', '2006-02-16T02:30:53', '2005-05-27T15:30:13', '2005-06-04T13:19:13', '2'), + ('246', '2781', '2006-02-16T02:30:53', '2005-06-15T19:17:16', '2005-06-23T21:56:16', '2'), + ('126', '2789', '2006-02-16T02:30:53', '2005-07-06T11:15:04', '2005-07-09T06:39:04', '1'), + ('126', '2486', '2006-02-16T02:30:53', '2005-08-17T03:50:33', '2005-08-25T00:37:33', '2'), + ('126', '659', '2006-02-16T02:30:53', '2005-08-17T11:30:11', '2005-08-23T09:54:11', '1'), + ('126', '2268', '2006-02-16T02:30:53', '2005-06-21T21:01:57', '2005-06-25T23:57:57', '1'), + ('126', '1382', '2006-02-16T02:30:53', '2005-07-10T18:31:05', '2005-07-12T18:29:05', '2'), + ('126', '3025', '2006-02-16T02:30:53', '2005-07-28T18:27:29', '2005-08-01T19:45:29', '2'), + ('126', '537', '2006-02-16T02:30:53', '2005-07-06T15:08:08', '2005-07-15T14:01:08', '2'), + ('126', '1564', '2006-02-16T02:30:53', '2005-08-21T13:32:38', '2005-08-25T18:02:38', '2'), + ('126', '1575', '2006-02-16T02:30:53', '2005-05-31T07:33:25', '2005-06-02T01:40:25', '2'), + ('126', '1026', '2006-02-16T02:30:53', '2005-07-06T00:15:06', '2005-07-13T01:35:06', '1'), + ('126', '1746', '2006-02-16T02:30:53', '2005-07-28T13:48:09', '2005-08-03T19:21:09', '1'), + ('126', '1965', '2006-02-16T02:30:53', '2005-08-21T16:52:29', '2005-08-26T12:30:29', '1'), + ('126', '1720', '2006-02-16T02:30:53', '2005-05-29T10:14:15', '2005-06-04T06:30:15', '1'), + ('126', '2648', '2006-02-16T02:30:53', '2005-08-02T11:42:40', '2005-08-10T11:58:40', '2'), + ('126', '2227', '2006-02-16T02:30:53', '2005-08-19T07:21:24', '2005-08-21T04:31:24', '2'), + ('126', '409', '2006-02-16T02:30:53', '2005-07-09T08:00:34', '2005-07-12T05:34:34', '1'), + ('126', '2542', '2006-02-16T02:30:53', '2005-07-12T15:07:49', '2005-07-21T18:43:49', '2'), + ('126', '4243', '2006-02-16T02:30:53', '2005-08-23T12:10:54', '2005-08-24T10:08:54', '2'), + ('126', '639', '2006-02-16T02:30:53', '2005-07-30T23:52:21', '2005-08-08T20:50:21', '2'), + ('126', '3651', '2006-02-16T02:30:53', '2005-07-12T14:33:21', '2005-07-13T09:59:21', '2'), + ('126', '2580', '2006-02-16T02:30:53', '2005-05-25T00:00:40', '2005-05-28T00:22:40', '1'), + ('126', '1619', '2006-02-16T02:30:53', '2005-07-08T12:59:49', '2005-07-14T16:15:49', '2'), + ('126', '3172', '2006-02-16T02:30:53', '2005-08-19T13:56:58', '2005-08-23T13:13:58', '2'), + ('126', '2331', '2006-02-16T02:30:53', '2005-07-31T18:41:55', '2005-08-04T22:45:55', '1'), + ('126', '3236', '2006-02-16T02:30:53', '2005-08-23T21:02:43', '2005-08-30T23:37:43', '2'), + ('126', '181', '2006-02-16T02:30:53', '2005-08-17T10:31:58', '2005-08-24T15:28:58', '2'), + ('126', '596', '2006-02-16T02:30:53', '2005-07-08T11:04:53', '2005-07-09T07:48:53', '1'), + ('126', '3461', '2006-02-16T02:30:53', '2005-08-19T07:56:51', '2005-08-28T07:05:51', '2'), + ('307', '3796', '2006-02-16T02:30:53', '2005-06-17T23:51:28', '2005-06-21T00:43:28', '2'), + ('307', '4209', '2006-02-16T02:30:53', '2005-05-28T06:16:32', '2005-05-31T02:48:32', '1'), + ('307', '3417', '2006-02-16T02:30:53', '2005-07-27T21:34:09', '2005-08-02T03:26:09', '1'), + ('307', '4193', '2006-02-16T02:30:53', '2005-07-31T21:57:32', '2005-08-05T22:23:32', '1'), + ('307', '2439', '2006-02-16T02:30:53', '2005-07-11T08:03:35', '2005-07-18T12:46:35', '1'), + ('307', '3371', '2006-02-16T02:30:53', '2005-06-19T18:47:00', '2005-06-22T20:22:00', '2'), + ('307', '319', '2006-02-16T02:30:53', '2005-07-27T01:03:06', '2005-08-05T04:18:06', '2'), + ('307', '409', '2006-02-16T02:30:53', '2005-07-28T06:29:45', '2005-08-03T01:36:45', '1'), + ('307', '3288', '2006-02-16T02:30:53', '2005-07-10T18:46:08', '2005-07-16T17:32:08', '1'), + ('307', '1244', '2006-02-16T02:30:53', '2005-08-21T05:04:34', '2005-08-23T04:58:34', '1'), + ('307', '3516', '2006-02-16T02:30:53', '2005-05-27T14:45:37', '2005-06-03T11:11:37', '1'), + ('307', '280', '2006-02-16T02:30:53', '2005-05-28T15:33:28', '2005-06-04T12:27:28', '2'), + ('307', '268', '2006-02-16T02:30:53', '2005-08-02T22:44:50', '2005-08-11T01:55:50', '2'), + ('307', '4114', '2006-02-16T02:30:53', '2005-07-08T03:03:12', '2005-07-10T04:49:12', '1'), + ('307', '2652', '2006-02-16T02:30:53', '2005-07-28T12:16:40', '2005-07-31T13:09:40', '2'), + ('307', '1520', '2006-02-16T02:30:53', '2005-05-30T19:50:28', '2005-06-09T01:19:28', '1'), + ('307', '2665', '2006-02-16T02:30:53', '2005-06-17T22:53:27', '2005-06-23T19:19:27', '1'), + ('307', '3940', '2006-02-16T02:30:53', '2005-08-23T03:03:53', '2005-08-25T08:27:53', '2'), + ('307', '1391', '2006-02-16T02:30:53', '2005-06-20T01:26:18', '2005-06-26T23:42:18', '1'), + ('307', '4351', '2006-02-16T02:30:53', '2005-08-01T06:25:27', '2005-08-07T05:44:27', '2'), + ('307', '379', '2006-02-16T02:30:53', '2005-07-06T22:13:45', '2005-07-15T00:22:45', '2'), + ('307', '446', '2006-02-16T02:30:53', '2005-08-01T19:57:06', '2005-08-07T18:04:06', '1'), + ('307', '1101', '2006-02-16T02:30:53', '2005-06-20T13:22:48', '2005-06-26T17:22:48', '2'), + ('307', '1507', '2006-02-16T02:30:53', '2005-08-18T08:52:53', '2005-08-22T12:15:53', '2'), + ('307', '287', '2006-02-16T02:30:53', '2005-06-21T00:51:06', '2005-06-22T21:49:06', '2'), + ('307', '480', '2006-02-16T02:30:53', '2005-07-11T15:19:22', '2005-07-13T12:43:22', '1'), + ('307', '2096', '2006-02-16T02:30:53', '2005-07-06T23:24:03', '2005-07-10T00:20:03', '2'), + ('307', '4136', '2006-02-16T02:30:53', '2005-08-19T21:12:37', '2005-08-25T19:56:37', '2'), + ('307', '556', '2006-02-16T02:30:53', '2005-07-29T14:52:59', '2005-08-06T11:09:59', '2'), + ('307', '1157', '2006-02-16T02:30:53', '2005-07-08T19:13:50', '2005-07-14T20:59:50', '2'), + ('74', '53', '2006-02-16T02:30:53', '2005-06-19T00:11:26', '2005-06-25T02:19:26', '1'), + ('74', '163', '2006-02-16T02:30:53', '2005-07-31T19:14:20', '2005-08-05T19:45:20', '1'), + ('74', '4364', '2006-02-16T02:30:53', '2005-08-23T22:26:47', '2005-08-27T18:02:47', '2'), + ('74', '2234', '2006-02-16T02:30:53', '2005-07-29T21:09:11', '2005-08-04T22:55:11', '1'), + ('74', '1861', '2006-02-16T02:30:53', '2005-08-19T20:03:18', '2005-08-24T20:09:18', '2'), + ('74', '4516', '2006-02-16T02:30:53', '2005-08-18T12:25:01', '2005-08-25T17:25:01', '2'), + ('74', '4449', '2006-02-16T02:30:53', '2005-07-11T14:40:48', '2005-07-18T09:51:48', '1'), + ('74', '1814', '2006-02-16T02:30:53', '2005-07-06T15:35:06', '2005-07-14T19:08:06', '1'), + ('74', '266', '2006-02-16T02:30:53', '2005-08-23T11:56:22', '2005-08-29T16:10:22', '2'), + ('74', '2381', '2006-02-16T02:30:53', '2005-06-21T20:40:28', '2005-06-29T00:47:28', '2'), + ('74', '176', '2006-02-16T02:30:53', '2005-08-20T05:29:45', '2005-08-26T06:49:45', '1'), + ('74', '3326', '2006-02-16T02:30:53', '2005-08-20T02:41:46', '2005-08-22T01:53:46', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['3020', '15286', '7304', '12374', '1121', '13747', '9112', '5917', '5530', '15500', '6475', '5603', '2498', '15325', '10624', '8658', '82', '1628', '8531', '10560', '6423', '1342', '13720', '1648', '10464', '1857', '10417', '15330', '11024', '14201', '8182', '2466', '9978', '4793', '6938', '5586', '5476', '14287', '6509', '13343', '13867', '7511', '3636', '7997', '12934', '8666', '12227', '4383', '4581', '13104', '5759', '7212', '8819', '12547', '7118', '12203', '7549', '3435', '7741', '9684', '1418', '5704', '12571', '10415', '3341', '8149', '6576', '14759', '7485', '14752', '5227', '14051', '4646', '8364', '1429', '8662', '10546', '14336', '14950', '12244', '1615', '1035', '14808', '8714', '5690', '9784', '6204', '7172', '3197', '14129', '1529', '13603', '12854', '6981', '8081', '3393', '8325', '5563', '8402', '175']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('74', '4363', '2006-02-16T02:30:53', '2005-06-20T11:12:04', '2005-06-27T07:31:04', '2'), + ('74', '3731', '2006-02-16T02:30:53', '2005-08-22T19:17:56', '2005-08-29T16:08:56', '2'), + ('74', '1162', '2006-02-16T02:30:53', '2005-07-27T12:56:56', '2005-08-05T09:19:56', '2'), + ('74', '939', '2006-02-16T02:30:53', '2005-08-18T08:07:45', '2005-08-26T10:42:45', '2'), + ('74', '1691', '2006-02-16T02:30:53', '2005-05-31T16:37:36', '2005-06-06T21:02:36', '1'), + ('74', '3332', '2006-02-16T02:30:53', '2005-08-20T10:56:06', '2005-08-29T10:29:06', '1'), + ('74', '395', '2006-02-16T02:30:53', '2005-07-30T09:06:31', '2005-08-04T05:12:31', '2'), + ('74', '2910', '2006-02-16T02:30:53', '2005-07-10T21:30:22', '2005-07-12T18:54:22', '2'), + ('74', '2701', '2006-02-16T02:30:53', '2005-07-10T02:13:49', '2005-07-18T08:01:49', '2'), + ('74', '886', '2006-02-16T02:30:53', '2005-08-23T02:39:37', '2005-08-27T06:42:37', '1'), + ('74', '2035', '2006-02-16T02:30:53', '2005-07-12T01:36:57', '2005-07-17T21:22:57', '1'), + ('74', '1308', '2006-02-16T02:30:53', '2005-07-10T05:04:54', '2005-07-12T01:54:54', '2'), + ('74', '2291', '2006-02-16T02:30:53', '2005-06-18T22:56:26', '2005-06-22T20:02:26', '1'), + ('74', '3549', '2006-02-16T02:30:53', '2005-08-22T20:27:38', '2005-08-23T15:24:38', '1'), + ('74', '3801', '2006-02-16T02:30:53', '2005-08-01T15:27:05', '2005-08-05T19:50:05', '1'), + ('427', '2033', '2006-02-16T02:30:53', '2005-07-29T15:16:37', '2005-08-07T20:45:37', '2'), + ('427', '1388', '2006-02-16T02:30:53', '2005-05-25T12:17:46', '2005-06-01T10:48:46', '1'), + ('427', '868', '2006-02-16T02:30:53', '2005-06-16T07:52:55', '2005-06-25T11:09:55', '1'), + ('427', '1631', '2006-02-16T02:30:53', '2005-07-29T10:26:15', '2005-08-06T09:28:15', '1'), + ('427', '1534', '2006-02-16T02:30:53', '2005-08-01T13:04:57', '2005-08-05T18:25:57', '2'), + ('427', '892', '2006-02-16T02:30:53', '2005-07-11T23:47:31', '2005-07-19T18:16:31', '1'), + ('427', '4429', '2006-02-16T02:30:53', '2005-06-15T12:26:21', '2005-06-22T11:23:21', '1'), + ('427', '813', '2006-02-16T02:30:53', '2005-08-20T10:01:39', '2005-08-27T08:26:39', '1'), + ('427', '457', '2006-02-16T02:30:53', '2005-06-16T09:17:07', '2005-06-24T06:31:07', '2'), + ('427', '464', '2006-02-16T02:30:53', '2005-08-01T09:43:14', '2005-08-06T09:01:14', '1'), + ('427', '4257', '2006-02-16T02:30:53', '2005-06-17T01:12:58', '2005-06-21T04:49:58', '1'), + ('427', '3675', '2006-02-16T02:30:53', '2005-08-01T08:10:36', '2005-08-02T03:42:36', '2'), + ('427', '689', '2006-02-16T02:30:53', '2005-08-22T20:35:30', '2005-08-30T21:54:30', '1'), + ('427', '2284', '2006-02-16T02:30:53', '2005-08-02T05:38:31', '2005-08-11T04:47:31', '1'), + ('427', '314', '2006-02-16T02:30:53', '2005-08-21T03:51:34', '2005-08-30T03:42:34', '2'), + ('427', '4120', '2006-02-16T02:30:53', '2005-07-28T22:19:12', '2005-08-01T22:40:12', '2'), + ('427', '1356', '2006-02-16T02:30:53', '2005-06-18T20:18:42', '2005-06-20T01:32:42', '1'), + ('427', '2812', '2006-02-16T02:30:53', '2005-07-31T16:59:51', '2005-08-06T16:48:51', '2'), + ('427', '3090', '2006-02-16T02:30:53', '2005-07-08T16:30:01', '2005-07-15T17:56:01', '1'), + ('427', '2058', '2006-02-16T02:30:53', '2005-07-26T23:16:04', '2005-08-05T00:59:04', '2'), + ('427', '2965', '2006-02-16T02:30:53', '2005-07-10T04:17:06', '2005-07-18T07:11:06', '1'), + ('427', '1199', '2006-02-16T02:30:53', '2005-07-09T23:37:09', '2005-07-15T23:57:09', '1'), + ('427', '2426', '2006-02-16T02:30:53', '2005-08-21T06:53:59', '2005-08-25T03:10:59', '2'), + ('427', '2468', '2006-02-16T02:30:53', '2005-07-12T03:35:01', '2005-07-13T06:50:01', '2'), + ('591', '1032', '2006-02-16T02:30:53', '2005-08-19T20:22:08', '2005-08-27T17:21:08', '1'), + ('591', '4514', '2006-02-16T02:30:53', '2005-08-20T15:05:42', '2005-08-29T10:48:42', '2'), + ('591', '4044', '2006-02-16T02:30:53', '2005-07-27T20:38:40', '2005-08-04T22:36:40', '2'), + ('591', '3379', '2006-02-16T02:30:53', '2005-07-06T07:03:52', '2005-07-08T03:14:52', '2'), + ('591', '1845', '2006-02-16T02:30:53', '2005-07-28T15:02:25', '2005-08-04T14:35:25', '1'), + ('591', '3242', '2006-02-16T02:30:53', '2005-08-19T05:18:42', '2005-08-24T10:42:42', '1'), + ('591', '3669', '2006-02-16T02:30:53', '2005-07-29T15:39:38', '2005-08-06T17:12:38', '1'), + ('591', '3671', '2006-02-16T02:30:53', '2005-08-18T03:04:28', '2005-08-21T08:52:28', '2'), + ('591', '2649', '2006-02-16T02:30:53', '2005-07-07T20:45:51', '2005-07-17T00:52:51', '2'), + ('591', '887', '2006-02-16T02:30:53', '2005-07-08T06:05:06', '2005-07-16T00:54:06', '1'), + ('591', '310', '2006-02-16T02:30:53', '2005-08-19T11:06:06', '2005-08-21T13:50:06', '2'), + ('591', '816', '2006-02-16T02:30:53', '2005-07-10T12:43:22', '2005-07-16T16:42:22', '1'), + ('591', '2905', '2006-02-16T02:30:53', '2005-07-27T09:21:22', '2005-08-01T04:47:22', '2'), + ('591', '3100', '2006-02-16T02:30:53', '2005-07-29T22:14:26', '2005-08-06T23:02:26', '2'), + ('591', '3046', '2006-02-16T02:30:53', '2005-08-18T14:29:39', '2005-08-22T16:52:39', '2'), + ('591', '582', '2006-02-16T02:30:53', '2005-07-27T05:53:50', '2005-08-05T04:19:50', '2'), + ('591', '4228', '2006-02-16T02:30:53', '2005-08-18T02:18:52', '2005-08-22T21:01:52', '1'), + ('591', '1765', '2006-02-16T02:30:53', '2005-07-27T21:53:21', '2005-08-05T18:53:21', '1'), + ('591', '451', '2006-02-16T02:30:53', '2005-06-21T19:14:58', '2005-06-24T19:58:58', '1'), + ('591', '3917', '2006-02-16T02:30:53', '2005-07-28T05:25:55', '2005-08-02T02:40:55', '1'), + ('591', '362', '2006-02-16T02:30:53', '2005-07-31T06:48:33', '2005-08-01T07:07:33', '2'), + ('591', '2974', '2006-02-16T02:30:53', '2005-06-15T17:51:27', '2005-06-18T23:20:27', '2'), + ('591', '2104', '2006-02-16T02:30:53', '2005-07-10T10:06:29', '2005-07-17T10:48:29', '1'), + ('591', '1013', '2006-02-16T02:30:53', '2005-08-18T15:31:18', '2005-08-23T15:20:18', '2'), + ('591', '2597', '2006-02-16T02:30:53', '2005-08-01T08:05:59', '2005-08-04T13:46:59', '1'), + ('591', '2189', '2006-02-16T02:30:53', '2005-06-21T10:37:25', '2005-06-26T15:38:25', '1'), + ('591', '1790', '2006-02-16T02:30:53', '2005-07-28T20:48:12', '2005-08-01T20:07:12', '2'), + ('362', '339', '2006-02-16T02:30:53', '2005-07-12T06:13:41', '2005-07-16T03:22:41', '1'), + ('362', '3871', '2006-02-16T02:30:53', '2005-08-21T23:28:58', '2005-08-31T00:35:58', '2'), + ('362', '631', '2006-02-16T02:30:53', '2005-07-27T19:29:09', '2005-07-30T16:28:09', '1'), + ('362', '1252', '2006-02-16T02:30:53', '2005-08-21T23:11:42', '2005-08-28T22:12:42', '1'), + ('362', '1862', '2006-02-16T02:30:53', '2005-07-09T12:16:39', '2005-07-18T15:38:39', '2'), + ('362', '4012', '2006-02-16T02:30:53', '2005-08-20T22:09:51', '2005-08-29T04:04:51', '2'), + ('362', '618', '2006-02-16T02:30:53', '2005-07-08T09:23:26', '2005-07-16T04:03:26', '1'), + ('362', '1361', '2006-02-16T02:30:53', '2005-07-29T05:10:31', '2005-07-30T04:02:31', '2'), + ('362', '4116', '2006-02-16T02:30:53', '2005-06-15T18:24:10', '2005-06-18T16:30:10', '1'), + ('362', '3758', '2006-02-16T02:30:53', '2005-07-29T15:31:33', '2005-07-30T09:39:33', '2'), + ('362', '1589', '2006-02-16T02:30:53', '2005-08-01T12:44:17', '2005-08-06T16:26:17', '2'), + ('362', '3166', '2006-02-16T02:30:53', '2005-08-21T08:33:42', '2005-08-23T03:27:42', '1'), + ('362', '635', '2006-02-16T02:30:53', '2005-08-22T06:17:12', '2005-08-27T08:48:12', '2'), + ('362', '4441', '2006-02-16T02:30:53', '2005-08-18T03:39:11', '2005-08-21T02:57:11', '2'), + ('362', '3894', '2006-02-16T02:30:53', '2005-06-16T07:00:28', '2005-06-25T08:53:28', '1'), + ('362', '949', '2006-02-16T02:30:53', '2005-05-31T05:01:09', '2005-06-02T03:59:09', '1'), + ('362', '1657', '2006-02-16T02:30:53', '2005-08-22T00:58:35', '2005-08-29T20:16:35', '2'), + ('362', '4547', '2006-02-16T02:30:53', '2005-07-29T17:31:40', '2005-08-04T16:12:40', '2'), + ('362', '1326', '2006-02-16T02:30:53', '2005-07-10T09:26:49', '2005-07-19T07:17:49', '2'), + ('362', '2761', '2006-02-16T02:30:53', '2005-07-31T10:21:32', '2005-08-07T09:20:32', '2'), + ('362', '2572', '2006-02-16T02:30:53', '2005-07-11T12:29:22', '2005-07-13T10:41:22', '2'), + ('362', '2405', '2006-02-16T02:30:53', '2005-07-27T07:59:16', '2005-08-01T04:46:16', '1'), + ('362', '1811', '2006-02-16T02:30:53', '2005-06-21T00:07:23', '2005-06-23T00:53:23', '2'), + ('362', '3572', '2006-02-16T02:30:53', '2005-08-21T01:42:15', '2005-08-23T20:04:15', '2'), + ('362', '1688', '2006-02-16T02:30:53', '2005-06-16T00:37:35', '2005-06-22T18:58:35', '2'), + ('362', '937', '2006-02-16T02:30:53', '2005-08-20T06:02:48', '2005-08-29T09:39:48', '1'), + ('362', '4577', '2006-02-16T02:30:53', '2005-08-19T02:18:51', '2005-08-24T04:16:51', '2'), + ('362', '154', '2006-02-16T02:30:53', '2005-07-27T00:51:38', '2005-07-28T01:06:38', '2'), + ('362', '4404', '2006-02-16T02:30:53', '2005-07-28T18:06:46', '2005-08-04T18:54:46', '1'), + ('362', '1631', '2006-02-16T02:30:53', '2005-06-21T15:14:27', '2005-06-25T19:54:27', '2'), + ('362', '932', '2006-02-16T02:30:53', '2005-07-29T03:57:27', '2005-08-06T22:30:27', '1'), + ('362', '2258', '2006-02-16T02:30:53', '2005-07-10T03:21:02', '2005-07-14T07:40:02', '1'), + ('47', '186', '2006-02-16T02:30:53', '2005-07-29T06:25:45', '2005-08-07T10:48:45', '1'), + ('47', '4346', '2006-02-16T02:30:53', '2005-05-26T03:46:26', '2005-06-03T06:01:26', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['11126', '14397', '3631', '6153', '8863', '6164', '12215', '2307', '207', '5174', '300', '1882', '11477', '15846', '9274', '3320', '6337', '8159', '4064', '12274', '8805', '5515', '10639', '1905', '10269', '2135', '4727', '4419', '4695', '9431', '2439', '1625', '8723', '8366', '15124', '9656', '10630', '2876', '12459', '12268', '4712', '10251', '2631', '10052', '13101', '8307', '10126', '6045', '5451', '6289', '3780', '4954', '11266', '5748', '4800', '11593', '4589', '8514', '1858', '4170', '6662', '8242', '6370', '7039', '10388', '12379', '5035', '2368', '10455', '4344', '8072', '867', '12869', '1500', '9661', '2156', '4844', '7812', '8799', '8835', '7193', '7951', '1518', '8102', '11125', '6053', '3069', '13969', '10056', '9276', '13922', '10058', '11479', '2492', '182', '8748', '15337', '133', '15139', '14453']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('47', '3310', '2006-02-16T02:30:53', '2005-08-02T08:59:04', '2005-08-04T11:00:04', '1'), + ('47', '3883', '2006-02-16T02:30:53', '2005-08-21T10:25:56', '2005-08-24T07:48:56', '1'), + ('47', '4068', '2006-02-16T02:30:53', '2005-07-06T06:36:53', '2005-07-07T10:32:53', '1'), + ('47', '105', '2006-02-16T02:30:53', '2005-07-11T09:31:04', '2005-07-19T03:41:04', '1'), + ('47', '75', '2006-02-16T02:30:53', '2005-07-29T23:52:01', '2005-08-04T20:28:01', '1'), + ('47', '2755', '2006-02-16T02:30:53', '2005-07-11T10:16:23', '2005-07-14T11:21:23', '1'), + ('47', '4095', '2006-02-16T02:30:53', '2005-08-18T02:35:39', '2005-08-24T00:36:39', '1'), + ('47', '4576', '2006-02-16T02:30:53', '2005-06-18T08:34:59', '2005-06-23T04:42:59', '1'), + ('47', '102', '2006-02-16T02:30:53', '2005-05-26T08:04:38', '2005-05-27T09:32:38', '2'), + ('47', '3621', '2006-02-16T02:30:53', '2005-07-09T09:31:59', '2005-07-15T03:49:59', '1'), + ('47', '249', '2006-02-16T02:30:53', '2005-05-26T20:57:00', '2005-06-05T01:34:00', '2'), + ('47', '1400', '2006-02-16T02:30:53', '2005-06-17T03:17:21', '2005-06-19T22:23:21', '2'), + ('47', '1671', '2006-02-16T02:30:53', '2005-08-02T22:09:01', '2005-08-07T03:46:01', '2'), + ('47', '3635', '2006-02-16T02:30:53', '2005-08-23T15:39:18', '2005-08-27T14:28:18', '2'), + ('47', '4424', '2006-02-16T02:30:53', '2005-07-30T15:07:04', '2005-08-06T11:17:04', '2'), + ('47', '860', '2006-02-16T02:30:53', '2005-06-21T08:29:41', '2005-06-29T13:54:41', '2'), + ('47', '3967', '2006-02-16T02:30:53', '2005-07-11T19:30:47', '2005-07-19T20:27:47', '2'), + ('47', '1118', '2006-02-16T02:30:53', '2005-07-28T21:09:28', '2005-08-04T15:34:28', '1'), + ('47', '1402', '2006-02-16T02:30:53', '2005-07-07T04:29:20', '2005-07-14T05:48:20', '2'), + ('47', '265', '2006-02-16T02:30:53', '2005-08-18T04:41:47', '2005-08-27T07:00:47', '1'), + ('39', '4041', '2006-02-16T02:30:53', '2005-07-29T21:29:58', '2005-08-04T23:12:58', '1'), + ('39', '3772', '2006-02-16T02:30:53', '2005-07-10T01:12:44', '2005-07-13T00:39:44', '1'), + ('39', '1015', '2006-02-16T02:30:53', '2005-08-01T15:44:43', '2005-08-10T13:51:43', '1'), + ('39', '1043', '2006-02-16T02:30:53', '2005-06-17T04:51:43', '2005-06-24T09:35:43', '1'), + ('39', '2537', '2006-02-16T02:30:53', '2005-08-01T03:09:26', '2005-08-02T00:01:26', '1'), + ('39', '4091', '2006-02-16T02:30:53', '2005-06-17T21:14:02', '2005-06-19T00:59:02', '1'), + ('39', '1251', '2006-02-16T02:30:53', '2005-07-08T12:54:15', '2005-07-17T14:32:15', '2'), + ('39', '783', '2006-02-16T02:30:53', '2005-07-07T22:06:24', '2005-07-15T23:59:24', '1'), + ('39', '805', '2006-02-16T02:30:53', '2005-07-08T11:07:59', '2005-07-17T16:35:59', '1'), + ('39', '3364', '2006-02-16T02:30:53', '2005-07-30T21:24:22', '2005-08-03T01:22:22', '2'), + ('39', '909', '2006-02-16T02:30:53', '2005-06-18T18:35:04', '2005-06-21T19:47:04', '2'), + ('39', '3367', '2006-02-16T02:30:53', '2005-06-16T07:49:08', '2005-06-24T09:08:08', '2'), + ('39', '224', '2006-02-16T02:30:53', '2005-07-29T18:03:47', '2005-08-06T18:53:47', '1'), + ('39', '479', '2006-02-16T02:30:53', '2005-07-29T05:11:14', '2005-08-05T01:48:14', '1'), + ('39', '1598', '2006-02-16T02:30:53', '2005-08-22T12:51:38', '2005-08-26T09:05:38', '1'), + ('39', '4215', '2006-02-16T02:30:53', '2005-07-31T06:00:21', '2005-08-05T04:36:21', '1'), + ('39', '2335', '2006-02-16T02:30:53', '2005-08-01T15:34:46', '2005-08-03T10:50:46', '1'), + ('39', '3117', '2006-02-16T02:30:53', '2005-06-20T01:06:34', '2005-06-23T04:55:34', '1'), + ('39', '421', '2006-02-16T02:30:53', '2005-08-18T11:25:11', '2005-08-22T06:13:11', '1'), + ('39', '93', '2006-02-16T02:30:53', '2005-08-18T04:26:54', '2005-08-23T06:40:54', '2'), + ('39', '2371', '2006-02-16T02:30:53', '2005-07-08T12:10:50', '2005-07-17T14:54:50', '2'), + ('39', '2986', '2006-02-16T02:30:53', '2005-08-01T02:39:12', '2005-08-06T03:51:12', '1'), + ('39', '3471', '2006-02-16T02:30:53', '2005-06-19T08:49:53', '2005-06-26T03:25:53', '1'), + ('39', '3307', '2006-02-16T02:30:53', '2005-07-31T19:15:13', '2005-08-07T22:47:13', '2'), + ('39', '1804', '2006-02-16T02:30:53', '2005-08-19T11:01:54', '2005-08-27T16:06:54', '2'), + ('39', '3197', '2006-02-16T02:30:53', '2005-07-29T03:18:34', '2005-08-06T05:51:34', '2'), + ('39', '3', '2006-02-16T02:30:53', '2005-07-31T21:36:07', '2005-08-03T23:59:07', '1'), + ('39', '2003', '2006-02-16T02:30:53', '2005-07-11T03:21:05', '2005-07-17T23:10:05', '1'), + ('39', '3484', '2006-02-16T02:30:53', '2005-07-09T22:22:10', '2005-07-11T02:43:10', '1'), + ('99', '3185', '2006-02-16T02:30:53', '2005-07-11T17:06:39', '2005-07-12T15:54:39', '2'), + ('99', '1209', '2006-02-16T02:30:53', '2005-07-06T13:52:02', '2005-07-15T08:41:02', '2'), + ('99', '627', '2006-02-16T02:30:53', '2005-07-08T23:14:16', '2005-07-14T23:23:16', '2'), + ('99', '3972', '2006-02-16T02:30:53', '2005-08-02T14:07:35', '2005-08-04T13:31:35', '1'), + ('99', '1618', '2006-02-16T02:30:53', '2005-07-10T12:19:59', '2005-07-12T12:59:59', '1'), + ('99', '1940', '2006-02-16T02:30:53', '2005-07-08T16:51:08', '2005-07-13T14:16:08', '2'), + ('99', '817', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('99', '1192', '2006-02-16T02:30:53', '2005-07-08T06:26:04', '2005-07-09T10:31:04', '2'), + ('99', '3755', '2006-02-16T02:30:53', '2005-07-29T09:53:33', '2005-07-30T06:34:33', '2'), + ('99', '3200', '2006-02-16T02:30:53', '2005-06-17T01:13:11', '2005-06-18T21:33:11', '2'), + ('99', '2665', '2006-02-16T02:30:53', '2005-07-07T09:44:36', '2005-07-13T14:10:36', '1'), + ('99', '1464', '2006-02-16T02:30:53', '2005-07-12T11:21:06', '2005-07-13T13:00:06', '1'), + ('99', '509', '2006-02-16T02:30:53', '2005-07-29T00:34:27', '2005-08-05T23:13:27', '2'), + ('99', '1410', '2006-02-16T02:30:53', '2005-07-11T21:28:32', '2005-07-20T02:51:32', '2'), + ('99', '1906', '2006-02-16T02:30:53', '2005-07-27T03:11:48', '2005-08-01T23:55:48', '1'), + ('99', '3180', '2006-02-16T02:30:53', '2005-08-01T06:42:44', '2005-08-09T11:43:44', '2'), + ('99', '2879', '2006-02-16T02:30:53', '2005-08-18T08:26:48', '2005-08-19T10:08:48', '2'), + ('99', '3699', '2006-02-16T02:30:53', '2005-07-09T02:51:34', '2005-07-16T21:38:34', '1'), + ('99', '1058', '2006-02-16T02:30:53', '2005-06-18T14:10:27', '2005-06-23T10:49:27', '1'), + ('99', '4197', '2006-02-16T02:30:53', '2005-08-01T09:15:00', '2005-08-05T13:35:00', '1'), + ('99', '1185', '2006-02-16T02:30:53', '2005-07-07T18:50:47', '2005-07-12T16:38:47', '2'), + ('99', '2347', '2006-02-16T02:30:53', '2005-07-28T17:27:59', '2005-07-30T19:08:59', '1'), + ('99', '3389', '2006-02-16T02:30:53', '2005-05-30T03:54:43', '2005-06-01T22:59:43', '1'), + ('99', '3939', '2006-02-16T02:30:53', '2005-08-19T02:50:36', '2005-08-26T21:38:36', '2'), + ('237', '2652', '2006-02-16T02:30:53', '2005-06-15T22:00:45', '2005-06-18T16:19:45', '2'), + ('237', '2693', '2006-02-16T02:30:53', '2005-07-31T06:06:37', '2005-08-04T07:37:37', '1'), + ('237', '623', '2006-02-16T02:30:53', '2005-06-17T23:08:12', '2005-06-22T19:44:12', '2'), + ('237', '4057', '2006-02-16T02:30:53', '2005-07-08T18:28:13', '2005-07-09T21:17:13', '2'), + ('237', '4556', '2006-02-16T02:30:53', '2005-07-28T08:06:52', '2005-07-31T09:57:52', '2'), + ('237', '326', '2006-02-16T02:30:53', '2005-07-29T21:16:47', '2005-08-07T22:09:47', '2'), + ('237', '2653', '2006-02-16T02:30:53', '2005-07-29T22:44:35', '2005-08-05T23:28:35', '1'), + ('237', '1801', '2006-02-16T02:30:53', '2005-07-27T08:37:00', '2005-07-30T12:51:00', '2'), + ('237', '3979', '2006-02-16T02:30:53', '2005-07-28T13:21:16', '2005-08-06T08:21:16', '1'), + ('237', '4537', '2006-02-16T02:30:53', '2005-06-15T23:36:37', '2005-06-16T18:24:37', '2'), + ('237', '4505', '2006-02-16T02:30:53', '2005-07-28T18:49:43', '2005-08-03T23:04:43', '2'), + ('237', '2081', '2006-02-16T02:30:53', '2005-08-02T08:55:35', '2005-08-03T09:12:35', '1'), + ('237', '2836', '2006-02-16T02:30:53', '2005-07-11T03:51:59', '2005-07-19T09:13:59', '2'), + ('237', '1952', '2006-02-16T02:30:53', '2005-06-20T14:13:00', '2005-06-28T10:57:00', '1'), + ('237', '1836', '2006-02-16T02:30:53', '2005-08-20T18:42:40', '2005-08-27T17:33:40', '2'), + ('237', '281', '2006-02-16T02:30:53', '2005-07-31T19:19:13', '2005-08-01T16:09:13', '2'), + ('237', '1528', '2006-02-16T02:30:53', '2005-07-30T15:09:28', '2005-08-06T19:39:28', '1'), + ('237', '1398', '2006-02-16T02:30:53', '2005-08-20T17:02:37', '2005-08-29T19:28:37', '1'), + ('237', '758', '2006-02-16T02:30:53', '2005-07-31T19:20:21', '2005-08-04T00:41:21', '2'), + ('237', '4077', '2006-02-16T02:30:53', '2005-08-02T22:18:13', '2005-08-12T00:43:13', '1'), + ('237', '2858', '2006-02-16T02:30:53', '2005-06-18T22:04:15', '2005-06-23T21:58:15', '1'), + ('237', '4396', '2006-02-16T02:30:53', '2005-05-26T04:49:17', '2005-06-01T05:43:17', '2'), + ('237', '2184', '2006-02-16T02:30:53', '2005-07-29T19:08:37', '2005-08-01T16:24:37', '1'), + ('237', '280', '2006-02-16T02:30:53', '2005-08-22T20:49:51', '2005-08-26T23:27:51', '1'), + ('237', '399', '2006-02-16T02:30:53', '2005-05-25T21:48:30', '2005-05-30T00:26:30', '2'), + ('237', '2018', '2006-02-16T02:30:53', '2005-08-22T13:38:11', '2005-08-30T09:00:11', '1'), + ('237', '3312', '2006-02-16T02:30:53', '2005-08-21T12:33:34', '2005-08-27T11:10:34', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['12469', '7330', '15931', '11772', '9715', '13914', '15898', '15098', '8296', '7621', '2483', '3673', '36', '3524', '3620', '10424', '14827', '6643', '14097', '8526', '3846', '2878', '1433', '11056', '8692', '6916', '7088', '12052', '2403', '1582', '7065', '9727', '929', '237', '3483', '9411', '8958', '3514', '8535', '11826', '8679', '4448', '15130', '15978', '5196', '11977', '11473', '10019', '6400', '13505', '1962', '15979', '15782', '8811', '241', '719', '519', '7358', '13286', '7230', '12303', '8701', '9088', '3634', '2122', '6795', '1377', '3157', '11211', '725', '9813', '948', '11061', '9169', '7233', '5321', '79', '7397', '11105', '6242', '5764', '6962', '12682', '10087', '9758', '4908', '11803', '10089', '11154', '15962', '10788', '7500', '10305', '9681', '2873', '11888', '8184', '2465', '12334', '2314']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('237', '2395', '2006-02-16T02:30:53', '2005-08-18T11:53:07', '2005-08-24T16:00:07', '1'), + ('237', '3705', '2006-02-16T02:30:53', '2005-07-27T13:56:46', '2005-08-04T07:56:46', '1'), + ('237', '1128', '2006-02-16T02:30:53', '2005-08-23T18:28:09', '2005-08-28T23:08:09', '1'), + ('237', '1021', '2006-02-16T02:30:53', '2005-08-17T10:18:57', '2005-08-26T12:48:57', '2'), + ('237', '3319', '2006-02-16T02:30:53', '2005-07-31T08:16:58', '2005-08-04T11:13:58', '1'), + ('237', '3037', '2006-02-16T02:30:53', '2005-08-20T16:38:57', '2005-08-26T14:53:57', '2'), + ('88', '3502', '2006-02-16T02:30:53', '2005-08-23T17:13:01', '2005-08-29T11:22:01', '2'), + ('88', '4414', '2006-02-16T02:30:53', '2005-08-22T11:48:19', '2005-08-31T11:07:19', '2'), + ('88', '2543', '2006-02-16T02:30:53', '2005-07-29T02:43:25', '2005-08-01T00:23:25', '1'), + ('88', '1833', '2006-02-16T02:30:53', '2005-07-28T00:34:06', '2005-08-06T00:13:06', '1'), + ('88', '4225', '2006-02-16T02:30:53', '2005-06-18T21:22:23', '2005-06-25T01:14:23', '1'), + ('88', '1837', '2006-02-16T02:30:53', '2005-07-06T09:02:09', '2005-07-15T06:45:09', '2'), + ('88', '1308', '2006-02-16T02:30:53', '2005-05-25T04:36:26', '2005-05-29T00:31:26', '1'), + ('88', '1626', '2006-02-16T02:30:53', '2005-07-06T01:01:51', '2005-07-11T19:52:51', '2'), + ('88', '1661', '2006-02-16T02:30:53', '2005-07-06T06:01:50', '2005-07-08T05:04:50', '1'), + ('88', '1921', '2006-02-16T02:30:53', '2005-08-01T08:22:54', '2005-08-06T13:44:54', '1'), + ('88', '2267', '2006-02-16T02:30:53', '2005-08-22T01:32:32', '2005-08-31T06:21:32', '2'), + ('88', '174', '2006-02-16T02:30:53', '2005-07-12T10:39:22', '2005-07-18T13:52:22', '1'), + ('88', '4351', '2006-02-16T02:30:53', '2005-08-21T00:28:48', '2005-08-29T22:15:48', '1'), + ('88', '575', '2006-02-16T02:30:53', '2005-07-29T10:20:48', '2005-08-03T14:15:48', '1'), + ('88', '2829', '2006-02-16T02:30:53', '2005-07-06T16:43:10', '2005-07-14T11:09:10', '2'), + ('88', '4120', '2006-02-16T02:30:53', '2005-06-20T01:09:14', '2005-06-21T21:40:14', '2'), + ('88', '2310', '2006-02-16T02:30:53', '2005-06-15T18:30:00', '2005-06-16T15:14:00', '1'), + ('88', '1404', '2006-02-16T02:30:53', '2005-08-02T06:36:27', '2005-08-10T06:02:27', '1'), + ('88', '3192', '2006-02-16T02:30:53', '2005-07-29T16:43:39', '2005-08-01T15:54:39', '2'), + ('88', '3311', '2006-02-16T02:30:53', '2005-07-12T22:29:18', '2005-07-19T16:46:18', '1'), + ('88', '373', '2006-02-16T02:30:53', '2005-07-27T04:42:28', '2005-08-04T07:09:28', '2'), + ('536', '99', '2006-02-16T02:30:53', '2005-08-17T20:57:02', '2005-08-25T19:04:02', '1'), + ('536', '2697', '2006-02-16T02:30:53', '2005-06-18T16:33:22', '2005-06-23T19:25:22', '1'), + ('536', '163', '2006-02-16T02:30:53', '2005-06-16T04:31:57', '2005-06-22T01:25:57', '1'), + ('536', '3570', '2006-02-16T02:30:53', '2005-07-27T03:53:43', '2005-07-30T23:41:43', '2'), + ('536', '3076', '2006-02-16T02:30:53', '2005-07-31T08:39:13', '2005-08-03T07:54:13', '1'), + ('536', '4296', '2006-02-16T02:30:53', '2005-05-30T12:32:39', '2005-06-06T12:17:39', '1'), + ('536', '241', '2006-02-16T02:30:53', '2005-05-26T12:15:13', '2005-05-29T18:10:13', '1'), + ('536', '79', '2006-02-16T02:30:53', '2005-07-05T23:13:51', '2005-07-13T18:31:51', '1'), + ('536', '3484', '2006-02-16T02:30:53', '2005-07-30T20:38:22', '2005-08-06T01:23:22', '2'), + ('536', '1556', '2006-02-16T02:30:53', '2005-07-30T03:34:26', '2005-08-06T08:14:26', '1'), + ('536', '4546', '2006-02-16T02:30:53', '2005-07-06T00:46:54', '2005-07-09T05:47:54', '1'), + ('536', '4489', '2006-02-16T02:30:53', '2005-07-29T10:32:33', '2005-07-31T05:46:33', '1'), + ('536', '1837', '2006-02-16T02:30:53', '2005-08-17T12:43:46', '2005-08-19T16:59:46', '2'), + ('536', '3549', '2006-02-16T02:30:53', '2005-07-29T16:07:47', '2005-08-02T18:37:47', '1'), + ('536', '2768', '2006-02-16T02:30:53', '2005-07-07T23:17:12', '2005-07-13T18:26:12', '1'), + ('536', '2375', '2006-02-16T02:30:53', '2005-08-22T13:04:32', '2005-08-30T17:24:32', '1'), + ('536', '4444', '2006-02-16T02:30:53', '2005-08-23T20:08:18', '2005-08-31T17:35:18', '2'), + ('536', '2278', '2006-02-16T02:30:53', '2005-07-09T10:43:34', '2005-07-13T12:10:34', '2'), + ('536', '1528', '2006-02-16T02:30:53', '2005-08-17T18:01:15', '2005-08-23T23:03:15', '1'), + ('536', '620', '2006-02-16T02:30:53', '2005-08-02T21:52:03', '2005-08-09T02:01:03', '1'), + ('536', '2114', '2006-02-16T02:30:53', '2005-07-31T18:20:56', '2005-08-07T14:25:56', '1'), + ('536', '3289', '2006-02-16T02:30:53', '2005-07-11T22:43:44', '2005-07-19T03:58:44', '2'), + ('536', '914', '2006-02-16T02:30:53', '2005-08-20T02:05:57', '2005-08-23T05:52:57', '1'), + ('536', '4386', '2006-02-16T02:30:53', '2005-06-17T09:08:58', '2005-06-23T14:55:58', '1'), + ('536', '3733', '2006-02-16T02:30:53', '2005-08-23T20:08:26', '2005-08-26T19:19:26', '1'), + ('245', '3282', '2006-02-16T02:30:53', '2005-08-23T13:43:26', '2005-08-30T14:03:26', '1'), + ('245', '2041', '2006-02-16T02:30:53', '2005-07-29T21:46:21', '2005-08-07T16:51:21', '2'), + ('245', '4438', '2006-02-16T02:30:53', '2005-05-26T12:49:01', '2005-05-28T11:43:01', '2'), + ('245', '267', '2006-02-16T02:30:53', '2005-05-29T05:16:05', '2005-06-01T07:53:05', '2'), + ('245', '3564', '2006-02-16T02:30:53', '2005-05-28T03:22:33', '2005-06-03T05:06:33', '1'), + ('245', '175', '2006-02-16T02:30:53', '2005-07-27T14:49:44', '2005-07-28T20:00:44', '1'), + ('245', '2685', '2006-02-16T02:30:53', '2005-08-19T18:28:07', '2005-08-22T17:23:07', '2'), + ('245', '1152', '2006-02-16T02:30:53', '2005-07-27T10:01:41', '2005-08-02T11:00:41', '1'), + ('245', '1604', '2006-02-16T02:30:53', '2005-08-18T05:43:22', '2005-08-27T08:54:22', '2'), + ('245', '3158', '2006-02-16T02:30:53', '2005-07-29T17:02:35', '2005-08-07T19:55:35', '2'), + ('245', '3407', '2006-02-16T02:30:53', '2005-07-30T08:21:02', '2005-08-01T09:55:02', '1'), + ('245', '3688', '2006-02-16T02:30:53', '2005-07-06T06:51:14', '2005-07-10T02:30:14', '1'), + ('245', '2932', '2006-02-16T02:30:53', '2005-06-17T20:48:27', '2005-06-23T00:58:27', '2'), + ('245', '1489', '2006-02-16T02:30:53', '2005-07-12T16:41:00', '2005-07-21T20:52:00', '1'), + ('245', '3410', '2006-02-16T02:30:53', '2005-06-15T15:02:03', '2005-06-22T14:54:03', '2'), + ('245', '1899', '2006-02-16T02:30:53', '2005-06-20T21:07:54', '2005-06-23T16:01:54', '1'), + ('245', '1722', '2006-02-16T02:30:53', '2005-08-02T12:16:48', '2005-08-03T10:40:48', '1'), + ('245', '4088', '2006-02-16T02:30:53', '2005-05-29T06:03:41', '2005-06-03T08:52:41', '2'), + ('245', '1706', '2006-02-16T02:30:53', '2005-07-31T11:29:23', '2005-08-07T08:01:23', '2'), + ('245', '585', '2006-02-16T02:30:53', '2005-05-30T15:44:27', '2005-06-08T17:30:27', '2'), + ('245', '809', '2006-02-16T02:30:53', '2005-08-02T06:50:18', '2005-08-07T07:41:18', '2'), + ('245', '1567', '2006-02-16T02:30:53', '2005-07-30T11:35:00', '2005-08-06T16:16:00', '2'), + ('245', '213', '2006-02-16T02:30:53', '2005-07-27T10:08:36', '2005-07-31T16:00:36', '1'), + ('245', '3347', '2006-02-16T02:30:53', '2005-07-09T16:26:33', '2005-07-15T15:05:33', '2'), + ('245', '3299', '2006-02-16T02:30:53', '2005-05-25T12:11:07', '2005-06-03T10:54:07', '2'), + ('245', '4474', '2006-02-16T02:30:53', '2005-07-27T16:05:00', '2005-08-01T20:29:00', '1'), + ('245', '3170', '2006-02-16T02:30:53', '2005-08-02T08:13:31', '2005-08-03T11:08:31', '1'), + ('245', '670', '2006-02-16T02:30:53', '2005-07-11T14:45:04', '2005-07-12T18:34:04', '2'), + ('245', '1556', '2006-02-16T02:30:53', '2005-07-10T12:58:16', '2005-07-19T07:28:16', '1'), + ('245', '4500', '2006-02-16T02:30:53', '2005-07-27T00:10:58', '2005-07-30T02:11:58', '2'), + ('245', '1148', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('245', '1393', '2006-02-16T02:30:53', '2005-07-31T20:15:22', '2005-08-07T01:33:22', '1'), + ('160', '1307', '2006-02-16T02:30:53', '2005-07-31T09:25:38', '2005-08-03T14:16:38', '1'), + ('160', '1963', '2006-02-16T02:30:53', '2005-07-08T21:05:44', '2005-07-17T21:33:44', '2'), + ('160', '3648', '2006-02-16T02:30:53', '2005-08-17T11:42:08', '2005-08-22T07:45:08', '2'), + ('160', '248', '2006-02-16T02:30:53', '2005-07-31T20:17:09', '2005-08-01T19:14:09', '2'), + ('160', '697', '2006-02-16T02:30:53', '2005-08-02T09:54:50', '2005-08-06T14:48:50', '2'), + ('160', '3491', '2006-02-16T02:30:53', '2005-08-23T19:42:04', '2005-08-25T23:53:04', '1'), + ('160', '3350', '2006-02-16T02:30:53', '2005-08-01T21:37:10', '2005-08-03T01:33:10', '1'), + ('160', '609', '2006-02-16T02:30:53', '2005-07-27T20:16:03', '2005-07-29T18:50:03', '1'), + ('160', '2946', '2006-02-16T02:30:53', '2005-08-01T04:16:16', '2005-08-07T23:47:16', '1'), + ('160', '64', '2006-02-16T02:30:53', '2005-07-31T06:42:09', '2005-08-06T08:21:09', '1'), + ('160', '3321', '2006-02-16T02:30:53', '2005-06-20T00:41:25', '2005-06-25T02:06:25', '1'), + ('160', '1100', '2006-02-16T02:30:53', '2005-08-17T15:04:05', '2005-08-25T18:52:05', '2'), + ('160', '1249', '2006-02-16T02:30:53', '2005-07-28T22:22:35', '2005-07-31T19:30:35', '1'), + ('160', '3783', '2006-02-16T02:30:53', '2005-06-18T20:07:02', '2005-06-25T20:55:02', '1'), + ('160', '2629', '2006-02-16T02:30:53', '2005-08-18T06:52:36', '2005-08-25T12:06:36', '1'), + ('160', '2157', '2006-02-16T02:30:53', '2005-06-18T09:03:19', '2005-06-19T12:14:19', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['10979', '13093', '12435', '6448', '15642', '15112', '10958', '6364', '14868', '4842', '16027', '4632', '6513', '8448', '13357', '4275', '12563', '4791', '8004', '15527', '2219', '16049', '6930', '13184', '7486', '4546', '10158', '9763', '12059', '12676', '5099', '1915', '599', '1611', '15284', '3001', '15132', '12113', '6221', '886', '13788', '2319', '6884', '14326', '14346', '287', '8213', '2684', '14040', '9092', '9382', '884', '580', '2175', '5714', '8076', '5883', '9489', '3269', '11990', '15752', '13732', '9138', '4320', '10810', '4869', '11144', '8269', '10413', '13009', '5675', '6807', '1208', '2779', '6545', '15107', '9872', '4163', '9828', '11851', '8420', '3719', '9773', '6524', '4554', '554', '4166', '13761', '11792', '13141', '15382', '3876', '5994', '12041', '2999', '1935', '9692', '10349', '1184', '2054']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('160', '2625', '2006-02-16T02:30:53', '2005-08-02T04:16:37', '2005-08-06T00:01:37', '2'), + ('160', '1667', '2006-02-16T02:30:53', '2005-08-19T10:46:16', '2005-08-26T08:05:16', '1'), + ('160', '3211', '2006-02-16T02:30:53', '2005-08-18T10:38:31', '2005-08-26T15:18:31', '1'), + ('160', '2663', '2006-02-16T02:30:53', '2005-07-12T00:45:59', '2005-07-17T00:34:59', '1'), + ('160', '2627', '2006-02-16T02:30:53', '2005-08-23T08:09:11', '2005-08-28T05:57:11', '1'), + ('160', '2832', '2006-02-16T02:30:53', '2005-08-22T12:21:49', '2005-08-27T11:03:49', '1'), + ('160', '2174', '2006-02-16T02:30:53', '2005-08-02T03:37:13', '2005-08-04T23:28:13', '2'), + ('160', '4146', '2006-02-16T02:30:53', '2005-07-11T21:14:48', '2005-07-20T23:20:48', '2'), + ('160', '4383', '2006-02-16T02:30:53', '2005-08-22T03:15:01', '2005-08-25T01:24:01', '1'), + ('160', '1438', '2006-02-16T02:30:53', '2005-07-08T18:21:30', '2005-07-10T22:25:30', '2'), + ('160', '1724', '2006-02-16T02:30:53', '2005-08-23T21:49:33', '2005-08-30T16:19:33', '2'), + ('393', '4330', '2006-02-16T02:30:53', '2005-07-08T08:38:57', '2005-07-15T09:33:57', '1'), + ('393', '2671', '2006-02-16T02:30:53', '2005-07-12T03:44:43', '2005-07-13T05:54:43', '1'), + ('393', '4349', '2006-02-16T02:30:53', '2005-07-29T07:41:54', '2005-08-02T13:12:54', '1'), + ('393', '3295', '2006-02-16T02:30:53', '2005-08-19T21:02:59', '2005-08-25T23:46:59', '2'), + ('393', '1167', '2006-02-16T02:30:53', '2005-07-07T14:43:51', '2005-07-15T18:04:51', '2'), + ('393', '2552', '2006-02-16T02:30:53', '2005-08-18T15:08:29', '2005-08-27T15:15:29', '1'), + ('393', '2505', '2006-02-16T02:30:53', '2005-07-08T16:27:24', '2005-07-14T21:50:24', '2'), + ('393', '4428', '2006-02-16T02:30:53', '2005-07-28T15:14:07', '2005-07-30T19:32:07', '2'), + ('393', '88', '2006-02-16T02:30:53', '2005-08-23T03:44:51', '2005-08-25T03:09:51', '1'), + ('393', '1881', '2006-02-16T02:30:53', '2005-06-18T03:16:54', '2005-06-22T01:29:54', '1'), + ('393', '2666', '2006-02-16T02:30:53', '2005-08-23T22:50:12', '2005-08-30T01:01:12', '2'), + ('393', '2989', '2006-02-16T02:30:53', '2005-07-26T23:00:01', '2005-08-04T01:57:01', '2'), + ('393', '4395', '2006-02-16T02:30:53', '2005-08-19T14:16:18', '2005-08-20T08:44:18', '1'), + ('393', '4362', '2006-02-16T02:30:53', '2005-07-27T19:29:24', '2005-08-02T20:46:24', '2'), + ('393', '4507', '2006-02-16T02:30:53', '2005-07-08T04:18:36', '2005-07-17T08:23:36', '1'), + ('393', '1626', '2006-02-16T02:30:53', '2005-07-31T22:40:31', '2005-08-08T18:25:31', '2'), + ('393', '126', '2006-02-16T02:30:53', '2005-07-31T09:34:03', '2005-08-08T05:30:03', '1'), + ('393', '4111', '2006-02-16T02:30:53', '2005-08-17T21:09:23', '2005-08-25T23:09:23', '1'), + ('393', '2581', '2006-02-16T02:30:53', '2005-08-18T19:34:40', '2005-08-20T18:03:40', '2'), + ('393', '768', '2006-02-16T02:30:53', '2005-07-09T06:14:30', '2005-07-12T08:23:30', '2'), + ('393', '2620', '2006-02-16T02:30:53', '2005-06-17T05:28:28', '2005-06-21T07:12:28', '2'), + ('393', '4136', '2006-02-16T02:30:53', '2005-05-28T14:05:57', '2005-06-01T16:41:57', '2'), + ('393', '1739', '2006-02-16T02:30:53', '2005-06-16T06:41:35', '2005-06-25T06:13:35', '2'), + ('393', '2265', '2006-02-16T02:30:53', '2005-08-22T19:17:08', '2005-08-29T13:28:08', '2'), + ('393', '2941', '2006-02-16T02:30:53', '2005-06-20T09:50:16', '2005-06-28T05:13:16', '2'), + ('393', '3474', '2006-02-16T02:30:53', '2005-08-22T13:11:25', '2005-08-27T17:04:25', '2'), + ('393', '2707', '2006-02-16T02:30:53', '2005-08-17T23:01:00', '2005-08-25T03:57:00', '2'), + ('393', '1699', '2006-02-16T02:30:53', '2005-07-11T13:24:27', '2005-07-15T17:51:27', '1'), + ('393', '4356', '2006-02-16T02:30:53', '2005-05-30T06:54:51', '2005-06-01T06:04:51', '2'), + ('393', '3177', '2006-02-16T02:30:53', '2005-08-20T12:15:41', '2005-08-28T16:28:41', '2'), + ('393', '1521', '2006-02-16T02:30:53', '2005-06-18T09:24:22', '2005-06-26T14:12:22', '2'), + ('17', '3642', '2006-02-16T02:30:53', '2005-07-12T20:52:41', '2005-07-20T23:13:41', '1'), + ('17', '1052', '2006-02-16T02:30:53', '2005-08-21T08:15:41', '2005-08-27T05:22:41', '1'), + ('17', '109', '2006-02-16T02:30:53', '2005-08-21T08:42:26', '2005-08-23T09:18:26', '2'), + ('17', '3631', '2006-02-16T02:30:53', '2005-05-26T19:44:54', '2005-06-02T01:10:54', '1'), + ('17', '3816', '2006-02-16T02:30:53', '2005-07-28T23:37:33', '2005-07-31T00:32:33', '2'), + ('17', '1225', '2006-02-16T02:30:53', '2005-06-19T12:29:08', '2005-06-28T08:50:08', '2'), + ('17', '905', '2006-02-16T02:30:53', '2005-08-20T21:43:44', '2005-08-25T16:30:44', '1'), + ('17', '1877', '2006-02-16T02:30:53', '2005-07-30T08:30:56', '2005-08-06T08:09:56', '2'), + ('17', '2127', '2006-02-16T02:30:53', '2005-07-30T19:23:44', '2005-08-06T16:20:44', '2'), + ('17', '4079', '2006-02-16T02:30:53', '2005-05-30T06:41:32', '2005-05-31T07:39:32', '1'), + ('17', '3515', '2006-02-16T02:30:53', '2005-05-28T11:19:53', '2005-06-01T10:44:53', '2'), + ('17', '4038', '2006-02-16T02:30:53', '2005-06-18T00:17:58', '2005-06-22T23:18:58', '2'), + ('17', '3706', '2006-02-16T02:30:53', '2005-07-10T10:46:57', '2005-07-18T14:07:57', '1'), + ('17', '214', '2006-02-16T02:30:53', '2005-07-28T17:45:58', '2005-08-04T18:07:58', '2'), + ('17', '2820', '2006-02-16T02:30:53', '2005-07-10T19:25:21', '2005-07-16T20:50:21', '2'), + ('17', '4011', '2006-02-16T02:30:53', '2005-07-30T23:43:32', '2005-07-31T20:45:32', '2'), + ('17', '3828', '2006-02-16T02:30:53', '2005-06-21T05:06:30', '2005-06-27T09:26:30', '2'), + ('17', '3012', '2006-02-16T02:30:53', '2005-08-17T18:26:22', '2005-08-19T14:34:22', '2'), + ('17', '2112', '2006-02-16T02:30:53', '2005-08-23T12:41:38', '2005-09-01T14:06:38', '1'), + ('17', '1138', '2006-02-16T02:30:53', '2005-08-20T10:24:41', '2005-08-22T04:44:41', '1'), + ('17', '2550', '2006-02-16T02:30:53', '2005-07-30T10:11:52', '2005-07-31T07:05:52', '2'), + ('376', '3437', '2006-02-16T02:30:53', '2005-07-07T17:51:59', '2005-07-13T18:39:59', '1'), + ('376', '2314', '2006-02-16T02:30:53', '2005-08-01T22:40:39', '2005-08-06T19:47:39', '1'), + ('376', '2860', '2006-02-16T02:30:53', '2005-07-08T19:14:05', '2005-07-15T22:27:05', '1'), + ('376', '2724', '2006-02-16T02:30:53', '2005-08-02T09:39:17', '2005-08-03T11:53:17', '2'), + ('376', '2778', '2006-02-16T02:30:53', '2005-07-29T01:26:54', '2005-08-04T22:42:54', '1'), + ('376', '1018', '2006-02-16T02:30:53', '2005-08-01T07:59:39', '2005-08-08T03:55:39', '1'), + ('376', '677', '2006-02-16T02:30:53', '2005-08-19T07:50:35', '2005-08-21T06:04:35', '1'), + ('376', '2134', '2006-02-16T02:30:53', '2005-07-10T08:31:06', '2005-07-17T11:48:06', '1'), + ('376', '669', '2006-02-16T02:30:53', '2005-07-12T17:33:53', '2005-07-18T16:28:53', '2'), + ('376', '750', '2006-02-16T02:30:53', '2005-06-15T02:30:03', '2005-06-18T00:04:03', '1'), + ('376', '1020', '2006-02-16T02:30:53', '2005-06-19T18:19:07', '2005-06-23T18:25:07', '2'), + ('376', '4447', '2006-02-16T02:30:53', '2005-07-12T04:56:30', '2005-07-20T05:41:30', '1'), + ('376', '2378', '2006-02-16T02:30:53', '2005-08-22T12:05:02', '2005-08-23T11:09:02', '1'), + ('376', '1021', '2006-02-16T02:30:53', '2005-07-31T13:27:55', '2005-08-04T14:33:55', '1'), + ('376', '3176', '2006-02-16T02:30:53', '2005-07-07T09:19:28', '2005-07-10T06:47:28', '2'), + ('376', '3845', '2006-02-16T02:30:53', '2005-07-31T11:56:57', '2005-08-02T17:05:57', '1'), + ('376', '3225', '2006-02-16T02:30:53', '2005-08-17T13:30:27', '2005-08-20T15:34:27', '2'), + ('376', '4184', '2006-02-16T02:30:53', '2005-07-29T07:00:45', '2005-08-06T02:20:45', '1'), + ('376', '3573', '2006-02-16T02:30:53', '2005-07-06T11:05:55', '2005-07-11T08:10:55', '2'), + ('376', '4555', '2006-02-16T02:30:53', '2005-07-31T09:56:56', '2005-08-04T09:38:56', '1'), + ('376', '1467', '2006-02-16T02:30:53', '2005-07-12T04:14:35', '2005-07-17T03:59:35', '2'), + ('376', '3878', '2006-02-16T02:30:53', '2005-07-08T04:48:03', '2005-07-16T04:34:03', '1'), + ('376', '1951', '2006-02-16T02:30:53', '2005-05-28T08:23:16', '2005-05-31T03:29:16', '2'), + ('376', '3267', '2006-02-16T02:30:53', '2005-07-07T09:33:30', '2005-07-16T06:06:30', '1'), + ('376', '3149', '2006-02-16T02:30:53', '2005-08-20T11:28:50', '2005-08-21T12:05:50', '2'), + ('376', '3703', '2006-02-16T02:30:53', '2005-08-17T11:03:53', '2005-08-26T06:34:53', '1'), + ('376', '4545', '2006-02-16T02:30:53', '2005-08-19T12:41:41', '2005-08-21T08:17:41', '2'), + ('376', '333', '2006-02-16T02:30:53', '2005-08-22T22:30:50', '2005-08-24T04:07:50', '2'), + ('295', '4039', '2006-02-16T02:30:53', '2005-07-06T18:21:13', '2005-07-14T16:57:13', '2'), + ('295', '4287', '2006-02-16T02:30:53', '2005-07-11T01:14:10', '2005-07-12T00:42:10', '2'), + ('295', '2389', '2006-02-16T02:30:53', '2005-08-17T20:34:33', '2005-08-19T00:47:33', '1'), + ('295', '735', '2006-02-16T02:30:53', '2005-06-20T09:30:34', '2005-06-26T05:51:34', '2'), + ('295', '1962', '2006-02-16T02:30:53', '2005-06-17T07:14:15', '2005-06-20T05:59:15', '1'), + ('295', '3481', '2006-02-16T02:30:53', '2005-07-31T07:11:04', '2005-08-07T06:34:04', '2'), + ('295', '114', '2006-02-16T02:30:53', '2005-08-01T05:27:13', '2005-08-08T10:15:13', '1'), + ('295', '473', '2006-02-16T02:30:53', '2005-06-15T00:49:36', '2005-06-22T23:39:36', '2'), + ('295', '1588', '2006-02-16T02:30:53', '2005-06-17T15:26:37', '2005-06-26T14:22:37', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['3394', '15735', '3198', '5283', '11913', '14514', '3496', '1328', '2638', '14387', '5053', '6331', '14264', '5019', '371', '2431', '4432', '8087', '9793', '11083', '4164', '9425', '12383', '8840', '8932', '10222', '10160', '6252', '8108', '4949', '12119', '8629', '9279', '10708', '4576', '6551', '3010', '7340', '8201', '2689', '13031', '3769', '6358', '14839', '9475', '15594', '15074', '11749', '4457', '15758', '9045', '1214', '12280', '3916', '14940', '14144', '5698', '13226', '12455', '3855', '2203', '12095', '8152', '7336', '10827', '15708', '10428', '401', '10088', '9806', '12238', '11721', '14528', '2144', '1166', '10803', '2965', '12298', '938', '3439', '432', '2975', '15438', '6833', '5511', '7818', '7318', '15268', '10883', '15201', '5119', '4834', '5807', '227', '955', '4316', '2611', '5730', '1853', '27']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('295', '3393', '2006-02-16T02:30:53', '2005-06-21T15:17:39', '2005-06-30T13:55:39', '2'), + ('295', '3167', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('295', '1626', '2006-02-16T02:30:53', '2005-06-21T00:08:54', '2005-06-29T02:11:54', '2'), + ('295', '644', '2006-02-16T02:30:53', '2005-07-09T15:07:17', '2005-07-17T09:52:17', '2'), + ('295', '741', '2006-02-16T02:30:53', '2005-08-17T15:53:17', '2005-08-24T18:50:17', '2'), + ('295', '1259', '2006-02-16T02:30:53', '2005-08-21T14:51:52', '2005-08-30T10:40:52', '2'), + ('295', '2430', '2006-02-16T02:30:53', '2005-07-05T23:59:15', '2005-07-09T19:39:15', '2'), + ('295', '3665', '2006-02-16T02:30:53', '2005-06-15T11:23:27', '2005-06-19T12:42:27', '2'), + ('295', '2944', '2006-02-16T02:30:53', '2005-06-19T09:23:30', '2005-06-26T14:56:30', '1'), + ('295', '1286', '2006-02-16T02:30:53', '2005-08-21T10:10:01', '2005-08-28T14:16:01', '2'), + ('295', '570', '2006-02-16T02:30:53', '2005-07-09T03:59:46', '2005-07-09T23:53:46', '2'), + ('295', '1356', '2006-02-16T02:30:53', '2005-07-11T19:17:21', '2005-07-18T18:35:21', '2'), + ('295', '3426', '2006-02-16T02:30:53', '2005-08-21T06:18:22', '2005-08-25T08:08:22', '1'), + ('295', '3534', '2006-02-16T02:30:53', '2005-07-09T02:04:32', '2005-07-15T07:01:32', '2'), + ('295', '1235', '2006-02-16T02:30:53', '2005-05-27T08:08:18', '2005-06-05T03:05:18', '2'), + ('295', '1383', '2006-02-16T02:30:53', '2005-06-18T17:53:03', '2005-06-25T15:08:03', '2'), + ('295', '2779', '2006-02-16T02:30:53', '2005-07-07T22:40:02', '2005-07-15T01:46:02', '1'), + ('295', '1913', '2006-02-16T02:30:53', '2005-07-28T18:21:16', '2005-08-03T12:38:16', '2'), + ('295', '4576', '2006-02-16T02:30:53', '2005-07-31T10:45:11', '2005-08-03T14:29:11', '1'), + ('295', '4395', '2006-02-16T02:30:53', '2005-08-02T07:32:01', '2005-08-08T02:23:01', '1'), + ('295', '3133', '2006-02-16T02:30:53', '2005-07-07T09:20:11', '2005-07-14T09:35:11', '1'), + ('295', '271', '2006-02-16T02:30:53', '2005-07-30T21:11:21', '2005-08-05T19:00:21', '1'), + ('295', '1641', '2006-02-16T02:30:53', '2005-08-18T08:36:03', '2005-08-23T03:30:03', '2'), + ('295', '1484', '2006-02-16T02:30:53', '2005-07-29T22:55:38', '2005-08-06T02:11:38', '1'), + ('295', '4537', '2006-02-16T02:30:53', '2005-07-30T02:31:26', '2005-08-04T02:17:26', '2'), + ('295', '1214', '2006-02-16T02:30:53', '2005-08-01T01:17:42', '2005-08-08T02:45:42', '1'), + ('295', '863', '2006-02-16T02:30:53', '2005-07-31T23:07:40', '2005-08-05T23:34:40', '1'), + ('295', '1294', '2006-02-16T02:30:53', '2005-07-11T15:06:29', '2005-07-16T14:07:29', '1'), + ('295', '1600', '2006-02-16T02:30:53', '2005-07-28T19:07:38', '2005-08-03T15:13:38', '2'), + ('567', '1184', '2006-02-16T02:30:53', '2005-07-08T22:57:10', '2005-07-11T01:26:10', '2'), + ('567', '4298', '2006-02-16T02:30:53', '2005-08-17T23:16:44', '2005-08-20T02:13:44', '2'), + ('567', '853', '2006-02-16T02:30:53', '2005-07-29T14:06:35', '2005-08-03T16:59:35', '2'), + ('567', '1070', '2006-02-16T02:30:53', '2005-07-30T15:15:21', '2005-08-07T18:46:21', '1'), + ('567', '3978', '2006-02-16T02:30:53', '2005-08-01T18:43:28', '2005-08-09T15:24:28', '1'), + ('567', '1920', '2006-02-16T02:30:53', '2005-07-08T05:51:19', '2005-07-10T11:36:19', '1'), + ('567', '282', '2006-02-16T02:30:53', '2005-07-12T05:03:43', '2005-07-13T10:44:43', '1'), + ('567', '1298', '2006-02-16T02:30:53', '2005-06-20T10:29:59', '2005-06-27T06:52:59', '1'), + ('567', '1344', '2006-02-16T02:30:53', '2005-07-27T14:18:10', '2005-07-30T09:57:10', '1'), + ('567', '220', '2006-02-16T02:30:53', '2005-07-28T23:10:48', '2005-08-01T00:50:48', '2'), + ('567', '2478', '2006-02-16T02:30:53', '2005-06-19T12:58:53', '2005-06-24T17:35:53', '1'), + ('567', '1525', '2006-02-16T02:30:53', '2005-08-19T08:30:04', '2005-08-23T09:35:04', '2'), + ('567', '467', '2006-02-16T02:30:53', '2005-07-06T13:11:33', '2005-07-14T17:54:33', '2'), + ('567', '4527', '2006-02-16T02:30:53', '2005-07-11T21:03:12', '2005-07-15T20:06:12', '2'), + ('567', '3440', '2006-02-16T02:30:53', '2005-08-22T01:58:15', '2005-08-24T05:24:15', '2'), + ('567', '2186', '2006-02-16T02:30:53', '2005-07-30T23:06:33', '2005-08-04T23:23:33', '1'), + ('567', '4227', '2006-02-16T02:30:53', '2005-08-23T06:18:43', '2005-09-01T09:09:43', '2'), + ('567', '3112', '2006-02-16T02:30:53', '2005-08-22T11:02:52', '2005-08-28T07:59:52', '2'), + ('567', '4141', '2006-02-16T02:30:53', '2005-08-17T09:04:03', '2005-08-19T09:32:03', '2'), + ('567', '407', '2006-02-16T02:30:53', '2005-07-07T23:45:38', '2005-07-09T20:02:38', '1'), + ('46', '152', '2006-02-16T02:30:53', '2005-08-23T12:47:26', '2005-08-29T11:05:26', '2'), + ('46', '4521', '2006-02-16T02:30:53', '2005-07-30T06:36:57', '2005-08-08T01:51:57', '1'), + ('46', '4482', '2006-02-16T02:30:53', '2005-06-15T03:18:40', '2005-06-20T07:32:40', '1'), + ('46', '4032', '2006-02-16T02:30:53', '2005-08-18T04:49:27', '2005-08-21T03:39:27', '2'), + ('46', '3198', '2006-02-16T02:30:53', '2005-07-06T20:18:50', '2005-07-12T21:56:50', '1'), + ('46', '2635', '2006-02-16T02:30:53', '2005-08-22T05:54:03', '2005-08-24T05:52:03', '2'), + ('46', '2366', '2006-02-16T02:30:53', '2005-08-21T02:10:57', '2005-08-28T01:02:57', '1'), + ('46', '639', '2006-02-16T02:30:53', '2005-07-10T09:47:00', '2005-07-16T06:26:00', '1'), + ('46', '2850', '2006-02-16T02:30:53', '2005-08-19T16:05:36', '2005-08-21T10:07:36', '2'), + ('46', '4478', '2006-02-16T02:30:53', '2005-08-18T11:19:47', '2005-08-22T16:08:47', '2'), + ('46', '2931', '2006-02-16T02:30:53', '2005-07-06T17:03:48', '2005-07-12T14:32:48', '1'), + ('46', '1347', '2006-02-16T02:30:53', '2005-06-18T02:10:42', '2005-06-22T06:25:42', '2'), + ('46', '1089', '2006-02-16T02:30:53', '2005-08-17T22:32:37', '2005-08-20T04:00:37', '1'), + ('46', '2557', '2006-02-16T02:30:53', '2005-07-28T20:53:05', '2005-08-06T20:03:05', '2'), + ('46', '2706', '2006-02-16T02:30:53', '2005-07-27T14:11:45', '2005-07-28T11:00:45', '2'), + ('46', '1590', '2006-02-16T02:30:53', '2005-08-01T23:13:00', '2005-08-08T02:51:00', '1'), + ('46', '1974', '2006-02-16T02:30:53', '2005-08-23T10:35:51', '2005-08-27T16:02:51', '1'), + ('46', '4245', '2006-02-16T02:30:53', '2005-08-01T08:30:11', '2005-08-02T09:30:11', '2'), + ('46', '2179', '2006-02-16T02:30:53', '2005-05-27T12:57:55', '2005-05-29T17:55:55', '2'), + ('46', '4293', '2006-02-16T02:30:53', '2005-07-31T20:16:21', '2005-08-01T22:47:21', '2'), + ('46', '245', '2006-02-16T02:30:53', '2005-07-31T11:13:49', '2005-08-04T06:18:49', '1'), + ('46', '4043', '2006-02-16T02:30:53', '2005-08-18T03:25:08', '2005-08-20T02:41:08', '2'), + ('46', '1923', '2006-02-16T02:30:53', '2005-08-17T07:49:17', '2005-08-18T04:08:17', '1'), + ('46', '4305', '2006-02-16T02:30:53', '2005-08-21T15:08:05', '2005-08-26T15:58:05', '2'), + ('46', '3303', '2006-02-16T02:30:53', '2005-06-17T22:05:40', '2005-06-21T02:53:40', '1'), + ('46', '2508', '2006-02-16T02:30:53', '2005-06-14T23:17:03', '2005-06-15T20:43:03', '1'), + ('46', '3318', '2006-02-16T02:30:53', '2005-08-01T22:22:07', '2005-08-08T02:37:07', '2'), + ('46', '27', '2006-02-16T02:30:53', '2005-06-20T07:33:38', '2005-06-29T11:45:38', '1'), + ('46', '904', '2006-02-16T02:30:53', '2005-08-18T05:30:31', '2005-08-27T07:33:31', '1'), + ('46', '1521', '2006-02-16T02:30:53', '2005-05-30T14:47:31', '2005-06-04T10:10:31', '2'), + ('46', '1529', '2006-02-16T02:30:53', '2005-06-21T19:36:15', '2005-06-23T14:54:15', '2'), + ('46', '1119', '2006-02-16T02:30:53', '2005-05-27T16:40:29', '2005-05-29T16:20:29', '1'), + ('46', '4534', '2006-02-16T02:30:53', '2005-06-20T08:06:18', '2005-06-21T08:01:18', '1'), + ('46', '2030', '2006-02-16T02:30:53', '2005-08-23T00:31:57', '2005-08-26T20:02:57', '1'), + ('301', '912', '2006-02-16T02:30:53', '2005-07-12T18:53:34', '2005-07-19T22:21:34', '2'), + ('301', '3678', '2006-02-16T02:30:53', '2005-07-10T01:00:00', '2005-07-12T20:44:00', '1'), + ('301', '1672', '2006-02-16T02:30:53', '2005-07-28T08:25:00', '2005-07-29T14:07:00', '1'), + ('301', '1954', '2006-02-16T02:30:53', '2005-07-27T13:25:31', '2005-07-31T11:44:31', '2'), + ('301', '1245', '2006-02-16T02:30:53', '2005-08-22T18:39:11', '2005-08-26T21:46:11', '1'), + ('301', '4', '2006-02-16T02:30:53', '2005-08-02T00:47:19', '2005-08-03T00:02:19', '1'), + ('301', '4456', '2006-02-16T02:30:53', '2005-08-22T16:24:42', '2005-08-31T17:54:42', '1'), + ('301', '2996', '2006-02-16T02:30:53', '2005-07-09T07:14:18', '2005-07-18T04:07:18', '1'), + ('301', '1288', '2006-02-16T02:30:53', '2005-07-08T18:07:45', '2005-07-14T15:27:45', '1'), + ('301', '2092', '2006-02-16T02:30:53', '2005-07-10T15:16:30', '2005-07-11T14:02:30', '2'), + ('301', '214', '2006-02-16T02:30:53', '2005-05-26T10:51:46', '2005-05-30T07:24:46', '1'), + ('301', '4140', '2006-02-16T02:30:53', '2005-05-30T16:59:03', '2005-05-31T11:58:03', '2'), + ('301', '517', '2006-02-16T02:30:53', '2005-07-07T17:44:22', '2005-07-14T15:12:22', '2'), + ('301', '3682', '2006-02-16T02:30:53', '2005-06-19T07:18:17', '2005-06-21T10:19:17', '1'), + ('301', '1903', '2006-02-16T02:30:53', '2005-07-10T11:28:32', '2005-07-11T11:45:32', '2'), + ('301', '2949', '2006-02-16T02:30:53', '2005-06-17T00:39:54', '2005-06-19T00:22:54', '2'), + ('301', '1225', '2006-02-16T02:30:53', '2005-05-25T03:41:50', '2005-05-30T01:13:50', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['2925', '13633', '13183', '9435', '2051', '2555', '7520', '5397', '9297', '10532', '1278', '1173', '1677', '14361', '5924', '1870', '7450', '9964', '1134', '5338', '1152', '7150', '8583', '15375', '4761', '5280', '8512', '6777', '1792', '6180', '15762', '7630', '10119', '15142', '15712', '6664', '14368', '9707', '4544', '11127', '15664', '4756', '3836', '10501', '2759', '1137', '1869', '5912', '5909', '4390', '5849', '1497', '15054', '5787', '2866', '12982', '2809', '12504', '8866', '12790', '7526', '29', '407', '5551', '7514', '11364', '13428', '99', '904', '12345', '4723', '2369', '721', '8775', '12772', '10785', '6266', '11511', '6471', '14790', '12700', '1002', '5598', '7356', '12726', '7892', '10534', '3489', '8103', '10598', '15083', '12329', '12223', '14100', '12276', '4036', '9608', '1769', '5763', '9495']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('301', '804', '2006-02-16T02:30:53', '2005-06-20T04:23:49', '2005-06-22T04:37:49', '2'), + ('301', '3227', '2006-02-16T02:30:53', '2005-08-20T07:13:47', '2005-08-24T11:25:47', '1'), + ('301', '2404', '2006-02-16T02:30:53', '2005-08-19T14:09:26', '2005-08-28T08:44:26', '2'), + ('301', '3116', '2006-02-16T02:30:53', '2005-07-30T21:31:02', '2005-08-05T22:34:02', '1'), + ('191', '2366', '2006-02-16T02:30:53', '2005-06-17T15:10:16', '2005-06-19T20:45:16', '1'), + ('191', '260', '2006-02-16T02:30:53', '2005-06-19T03:07:02', '2005-06-25T05:25:02', '2'), + ('191', '3875', '2006-02-16T02:30:53', '2005-07-27T21:02:02', '2005-07-28T18:18:02', '1'), + ('191', '4376', '2006-02-16T02:30:53', '2005-07-09T19:43:51', '2005-07-17T00:11:51', '1'), + ('191', '3502', '2006-02-16T02:30:53', '2005-07-30T16:26:29', '2005-08-03T13:51:29', '1'), + ('191', '746', '2006-02-16T02:30:53', '2005-08-01T12:06:35', '2005-08-07T16:04:35', '2'), + ('191', '4471', '2006-02-16T02:30:53', '2005-06-15T08:09:12', '2005-06-17T04:05:12', '2'), + ('191', '1050', '2006-02-16T02:30:53', '2005-06-14T23:54:46', '2005-06-19T23:26:46', '2'), + ('191', '240', '2006-02-16T02:30:53', '2005-06-16T11:07:11', '2005-06-23T10:50:11', '1'), + ('191', '1231', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('191', '629', '2006-02-16T02:30:53', '2005-07-10T21:41:23', '2005-07-16T21:33:23', '1'), + ('191', '895', '2006-02-16T02:30:53', '2005-06-17T02:24:36', '2005-06-17T23:04:36', '2'), + ('191', '3496', '2006-02-16T02:30:53', '2005-07-27T18:18:35', '2005-08-04T15:18:35', '1'), + ('191', '3149', '2006-02-16T02:30:53', '2005-07-31T16:17:39', '2005-08-03T15:03:39', '1'), + ('191', '143', '2006-02-16T02:30:53', '2005-05-31T19:14:15', '2005-06-02T17:13:15', '2'), + ('191', '3449', '2006-02-16T02:30:53', '2005-07-09T17:07:07', '2005-07-14T11:15:07', '1'), + ('191', '210', '2006-02-16T02:30:53', '2005-05-31T21:32:17', '2005-06-04T21:07:17', '2'), + ('191', '457', '2006-02-16T02:30:53', '2005-07-27T07:11:14', '2005-08-05T06:55:14', '2'), + ('191', '3130', '2006-02-16T02:30:53', '2005-07-29T12:04:50', '2005-08-04T17:21:50', '1'), + ('191', '3864', '2006-02-16T02:30:53', '2005-08-22T22:12:02', '2005-08-24T00:50:02', '2'), + ('351', '3556', '2006-02-16T02:30:53', '2005-07-08T14:51:45', '2005-07-14T20:28:45', '1'), + ('351', '1177', '2006-02-16T02:30:53', '2005-07-09T14:55:07', '2005-07-12T10:05:07', '2'), + ('351', '4132', '2006-02-16T02:30:53', '2005-07-29T09:48:03', '2005-07-31T13:40:03', '1'), + ('351', '4089', '2006-02-16T02:30:53', '2005-07-12T16:04:40', '2005-07-20T15:05:40', '2'), + ('351', '3800', '2006-02-16T02:30:53', '2005-06-16T20:04:50', '2005-06-26T00:57:50', '1'), + ('351', '4401', '2006-02-16T02:30:53', '2005-07-11T11:06:50', '2005-07-19T09:03:50', '2'), + ('351', '887', '2006-02-16T02:30:53', '2005-08-23T13:01:43', '2005-08-26T16:35:43', '1'), + ('351', '2798', '2006-02-16T02:30:53', '2005-07-28T01:01:03', '2005-07-31T01:08:03', '2'), + ('351', '54', '2006-02-16T02:30:53', '2005-07-31T21:20:59', '2005-08-02T23:14:59', '2'), + ('351', '1337', '2006-02-16T02:30:53', '2005-08-22T13:44:32', '2005-08-29T14:19:32', '1'), + ('351', '1882', '2006-02-16T02:30:53', '2005-08-23T10:43:56', '2005-08-29T15:35:56', '2'), + ('351', '4578', '2006-02-16T02:30:53', '2005-07-12T11:28:22', '2005-07-15T09:30:22', '1'), + ('351', '2063', '2006-02-16T02:30:53', '2005-08-21T09:31:47', '2005-08-30T04:17:47', '1'), + ('351', '203', '2006-02-16T02:30:53', '2005-07-31T07:44:18', '2005-08-08T12:45:18', '1'), + ('351', '4471', '2006-02-16T02:30:53', '2005-07-08T04:11:04', '2005-07-09T22:48:04', '1'), + ('351', '1106', '2006-02-16T02:30:53', '2005-08-02T09:00:59', '2005-08-05T11:54:59', '2'), + ('351', '2029', '2006-02-16T02:30:53', '2005-08-23T08:57:11', '2005-08-31T14:19:11', '2'), + ('351', '3068', '2006-02-16T02:30:53', '2005-07-08T14:24:00', '2005-07-12T16:16:00', '1'), + ('351', '1148', '2006-02-16T02:30:53', '2005-07-06T16:26:04', '2005-07-10T15:08:04', '1'), + ('351', '1792', '2006-02-16T02:30:53', '2005-08-01T11:04:46', '2005-08-02T12:10:46', '2'), + ('351', '687', '2006-02-16T02:30:53', '2005-06-19T17:10:24', '2005-06-24T21:56:24', '2'), + ('351', '3259', '2006-02-16T02:30:53', '2005-05-31T19:20:14', '2005-06-07T16:10:14', '1'), + ('351', '871', '2006-02-16T02:30:53', '2005-06-17T02:08:00', '2005-06-19T21:43:00', '1'), + ('351', '1187', '2006-02-16T02:30:53', '2005-07-10T20:58:22', '2005-07-17T01:15:22', '2'), + ('44', '2333', '2006-02-16T02:30:53', '2005-07-10T20:46:13', '2005-07-14T18:01:13', '2'), + ('44', '6', '2006-02-16T02:30:53', '2005-07-07T20:59:06', '2005-07-09T00:04:06', '2'), + ('44', '1632', '2006-02-16T02:30:53', '2005-07-10T17:32:33', '2005-07-19T22:39:33', '1'), + ('44', '2958', '2006-02-16T02:30:53', '2005-06-15T21:56:39', '2005-06-20T20:32:39', '1'), + ('44', '2314', '2006-02-16T02:30:53', '2005-08-22T10:14:33', '2005-08-25T15:07:33', '1'), + ('44', '1075', '2006-02-16T02:30:53', '2005-07-10T14:08:49', '2005-07-19T18:29:49', '1'), + ('44', '2718', '2006-02-16T02:30:53', '2005-06-20T00:01:36', '2005-06-20T21:39:36', '1'), + ('44', '1258', '2006-02-16T02:30:53', '2005-08-19T07:06:34', '2005-08-21T06:53:34', '1'), + ('44', '1786', '2006-02-16T02:30:53', '2005-06-19T19:40:27', '2005-06-27T15:28:27', '2'), + ('44', '4429', '2006-02-16T02:30:53', '2005-08-18T13:17:07', '2005-08-24T09:13:07', '2'), + ('44', '1530', '2006-02-16T02:30:53', '2005-07-29T23:58:19', '2005-08-01T05:19:19', '2'), + ('44', '1281', '2006-02-16T02:30:53', '2005-08-19T00:16:54', '2005-08-26T02:00:54', '1'), + ('44', '696', '2006-02-16T02:30:53', '2005-07-27T21:13:47', '2005-08-05T15:23:47', '2'), + ('44', '611', '2006-02-16T02:30:53', '2005-05-25T03:47:12', '2005-05-30T00:31:12', '2'), + ('44', '1077', '2006-02-16T02:30:53', '2005-05-27T13:57:38', '2005-05-31T18:23:38', '1'), + ('44', '4238', '2006-02-16T02:30:53', '2005-07-10T03:01:09', '2005-07-18T02:04:09', '2'), + ('44', '400', '2006-02-16T02:30:53', '2005-07-27T20:51:49', '2005-07-29T18:21:49', '2'), + ('44', '4515', '2006-02-16T02:30:53', '2005-08-02T17:53:36', '2005-08-03T14:16:36', '1'), + ('44', '106', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('44', '535', '2006-02-16T02:30:53', '2005-05-25T16:50:20', '2005-05-28T18:52:20', '1'), + ('44', '2466', '2006-02-16T02:30:53', '2005-05-30T10:19:42', '2005-06-05T04:58:42', '2'), + ('44', '2359', '2006-02-16T02:30:53', '2005-08-18T07:16:58', '2005-08-25T05:50:58', '1'), + ('44', '965', '2006-02-16T02:30:53', '2005-07-08T12:44:59', '2005-07-17T07:22:59', '2'), + ('44', '1515', '2006-02-16T02:30:53', '2005-06-18T14:25:29', '2005-06-23T18:45:29', '2'), + ('44', '1116', '2006-02-16T02:30:53', '2005-05-29T05:28:47', '2005-05-31T11:24:47', '1'), + ('44', '1358', '2006-02-16T02:30:53', '2005-07-29T20:05:38', '2005-07-30T21:13:38', '1'), + ('397', '1179', '2006-02-16T02:30:53', '2005-08-18T23:29:25', '2005-08-23T20:32:25', '1'), + ('397', '2282', '2006-02-16T02:30:53', '2005-08-01T21:24:55', '2005-08-06T17:47:55', '1'), + ('397', '941', '2006-02-16T02:30:53', '2005-07-11T15:45:39', '2005-07-15T18:29:39', '1'), + ('397', '2127', '2006-02-16T02:30:53', '2005-08-16T23:39:59', '2005-08-18T18:04:59', '1'), + ('397', '2253', '2006-02-16T02:30:53', '2005-07-12T01:31:06', '2005-07-13T05:26:06', '1'), + ('397', '1002', '2006-02-16T02:30:53', '2005-08-22T00:34:17', '2005-08-31T02:27:17', '1'), + ('397', '540', '2006-02-16T02:30:53', '2005-08-18T20:24:46', '2005-08-23T21:50:46', '1'), + ('397', '709', '2006-02-16T02:30:53', '2005-05-31T00:47:56', '2005-06-06T19:51:56', '1'), + ('397', '3412', '2006-02-16T02:30:53', '2005-07-10T04:48:29', '2005-07-18T10:33:29', '2'), + ('397', '309', '2006-02-16T02:30:53', '2005-07-27T14:47:35', '2005-07-28T18:10:35', '2'), + ('397', '20', '2006-02-16T02:30:53', '2005-08-18T21:44:46', '2005-08-19T21:58:46', '2'), + ('397', '2717', '2006-02-16T02:30:53', '2005-07-28T10:46:58', '2005-07-30T16:03:58', '1'), + ('397', '4354', '2006-02-16T02:30:53', '2005-08-01T12:15:11', '2005-08-04T17:06:11', '1'), + ('397', '2936', '2006-02-16T02:30:53', '2005-07-05T23:33:40', '2005-07-15T02:15:40', '2'), + ('397', '4472', '2006-02-16T02:30:53', '2005-07-28T18:50:14', '2005-08-04T16:53:14', '1'), + ('397', '2341', '2006-02-16T02:30:53', '2005-08-01T14:23:36', '2005-08-10T14:07:36', '2'), + ('397', '1691', '2006-02-16T02:30:53', '2005-08-22T11:17:37', '2005-08-28T06:27:37', '2'), + ('397', '3127', '2006-02-16T02:30:53', '2005-08-18T06:44:30', '2005-08-25T04:05:30', '1'), + ('397', '4142', '2006-02-16T02:30:53', '2005-08-18T02:58:40', '2005-08-23T23:30:40', '2'), + ('397', '4295', '2006-02-16T02:30:53', '2005-08-21T00:31:07', '2005-08-25T05:31:07', '2'), + ('397', '4491', '2006-02-16T02:30:53', '2005-08-18T04:43:22', '2005-08-22T01:49:22', '2'), + ('397', '500', '2006-02-16T02:30:53', '2005-07-07T02:48:00', '2005-07-07T22:46:00', '1'), + ('397', '363', '2006-02-16T02:30:53', '2005-07-31T03:51:52', '2005-08-06T05:38:52', '2'), + ('397', '1229', '2006-02-16T02:30:53', '2005-06-16T18:07:48', '2005-06-22T12:39:48', '1'), + ('397', '753', '2006-02-16T02:30:53', '2005-07-10T12:58:12', '2005-07-14T08:52:12', '1'), + ('397', '2128', '2006-02-16T02:30:53', '2005-07-30T23:54:26', '2005-08-01T22:02:26', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['6014', '3027', '5103', '5428', '15825', '1994', '10521', '14890', '5557', '9927', '8543', '6136', '8505', '8732', '3372', '6881', '3421', '7943', '10389', '810', '15661', '9848', '11470', '10304', '8272', '4958', '15535', '9566', '15827', '11062', '6323', '65', '11375', '15459', '4420', '10156', '13240', '13400', '14589', '3844', '10569', '4618', '6806', '13957', '7054', '1286', '9893', '8573', '8731', '6071', '15985', '1046', '7609', '11342', '2613', '14082', '7028', '502', '10385', '9491', '13844', '3671', '6616', '759', '13452', '3153', '15031', '12965', '1274', '5958', '9450', '5217', '8560', '13454', '13007', '1759', '5002', '5879', '6043', '364', '12723', '1538', '2892', '1207', '30', '14058', '416', '6129', '6497', '134', '7786', '1006', '10043', '14350', '2603', '5635', '5592', '5266', '13477', '5']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('397', '3748', '2006-02-16T02:30:53', '2005-07-11T02:02:55', '2005-07-12T23:49:55', '1'), + ('397', '4028', '2006-02-16T02:30:53', '2005-06-20T11:50:30', '2005-06-25T15:58:30', '2'), + ('397', '2390', '2006-02-16T02:30:53', '2005-07-09T06:34:40', '2005-07-10T03:44:40', '2'), + ('346', '3109', '2006-02-16T02:30:53', '2005-07-09T21:12:50', '2005-07-14T16:25:50', '2'), + ('346', '149', '2006-02-16T02:30:53', '2005-08-23T15:10:42', '2005-08-29T09:28:42', '2'), + ('346', '2203', '2006-02-16T02:30:53', '2005-06-17T11:07:06', '2005-06-25T08:32:06', '2'), + ('346', '662', '2006-02-16T02:30:53', '2005-08-01T11:46:17', '2005-08-05T11:06:17', '2'), + ('346', '517', '2006-02-16T02:30:53', '2005-08-22T04:10:49', '2005-08-30T23:23:49', '1'), + ('346', '1433', '2006-02-16T02:30:53', '2005-07-10T03:10:21', '2005-07-11T21:34:21', '1'), + ('346', '999', '2006-02-16T02:30:53', '2005-07-31T15:12:13', '2005-08-01T11:37:13', '1'), + ('346', '403', '2006-02-16T02:30:53', '2005-07-29T11:01:57', '2005-08-03T06:03:57', '1'), + ('346', '205', '2006-02-16T02:30:53', '2005-07-11T08:34:09', '2005-07-14T06:11:09', '1'), + ('346', '1454', '2006-02-16T02:30:53', '2005-07-29T09:22:52', '2005-08-06T05:23:52', '1'), + ('346', '1143', '2006-02-16T02:30:53', '2005-07-29T18:25:03', '2005-08-07T18:56:03', '2'), + ('346', '4169', '2006-02-16T02:30:53', '2005-06-21T13:34:19', '2005-06-27T08:41:19', '2'), + ('346', '2496', '2006-02-16T02:30:53', '2005-07-12T20:46:35', '2005-07-21T00:26:35', '2'), + ('346', '3930', '2006-02-16T02:30:53', '2005-06-21T17:22:58', '2005-06-24T18:57:58', '1'), + ('346', '2914', '2006-02-16T02:30:53', '2005-07-28T12:50:55', '2005-08-04T11:29:55', '2'), + ('346', '3534', '2006-02-16T02:30:53', '2005-08-01T06:46:43', '2005-08-08T07:07:43', '2'), + ('346', '2533', '2006-02-16T02:30:53', '2005-05-29T19:12:04', '2005-06-04T21:12:04', '2'), + ('346', '1599', '2006-02-16T02:30:53', '2005-08-23T08:52:03', '2005-08-30T08:17:03', '2'), + ('346', '3290', '2006-02-16T02:30:53', '2005-07-31T12:44:33', '2005-08-07T13:49:33', '2'), + ('346', '2379', '2006-02-16T02:30:53', '2005-08-02T21:48:28', '2005-08-05T23:58:28', '2'), + ('346', '1538', '2006-02-16T02:30:53', '2005-08-01T04:14:12', '2005-08-07T22:38:12', '1'), + ('346', '70', '2006-02-16T02:30:53', '2005-07-29T01:29:51', '2005-08-03T21:56:51', '2'), + ('346', '2354', '2006-02-16T02:30:53', '2005-07-08T23:19:52', '2005-07-17T20:31:52', '1'), + ('346', '2371', '2006-02-16T02:30:53', '2005-08-23T03:58:02', '2005-08-25T05:06:02', '2'), + ('346', '643', '2006-02-16T02:30:53', '2005-07-31T02:32:10', '2005-08-02T23:54:10', '2'), + ('346', '1732', '2006-02-16T02:30:53', '2005-08-23T15:15:19', '2005-08-24T10:50:19', '2'), + ('346', '2014', '2006-02-16T02:30:53', '2005-08-02T06:52:54', '2005-08-07T10:59:54', '1'), + ('346', '1352', '2006-02-16T02:30:53', '2005-07-11T19:02:19', '2005-07-14T15:54:19', '1'), + ('346', '3552', '2006-02-16T02:30:53', '2005-05-25T09:32:03', '2005-05-29T14:21:03', '1'), + ('346', '1064', '2006-02-16T02:30:53', '2005-08-02T18:14:56', '2005-08-08T23:29:56', '1'), + ('346', '2058', '2006-02-16T02:30:53', '2005-08-23T01:09:48', '2005-08-24T04:52:48', '1'), + ('346', '4427', '2006-02-16T02:30:53', '2005-07-07T22:07:31', '2005-07-12T19:14:31', '2'), + ('179', '141', '2006-02-16T02:30:53', '2005-07-31T22:36:00', '2005-08-02T00:03:00', '2'), + ('179', '1411', '2006-02-16T02:30:53', '2005-08-19T16:22:14', '2005-08-20T13:24:14', '1'), + ('179', '2173', '2006-02-16T02:30:53', '2005-08-19T22:11:44', '2005-08-20T23:27:44', '2'), + ('179', '2810', '2006-02-16T02:30:53', '2005-08-21T17:28:55', '2005-08-22T23:06:55', '1'), + ('179', '2814', '2006-02-16T02:30:53', '2005-07-06T16:37:58', '2005-07-09T19:54:58', '2'), + ('179', '611', '2006-02-16T02:30:53', '2005-08-01T13:18:23', '2005-08-10T13:33:23', '1'), + ('179', '3691', '2006-02-16T02:30:53', '2005-07-08T08:00:20', '2005-07-14T05:59:20', '1'), + ('179', '656', '2006-02-16T02:30:53', '2005-07-12T17:31:43', '2005-07-17T14:36:43', '1'), + ('179', '2889', '2006-02-16T02:30:53', '2005-08-20T18:09:04', '2005-08-23T16:52:04', '1'), + ('179', '2661', '2006-02-16T02:30:53', '2005-07-27T03:43:28', '2005-08-04T09:15:28', '1'), + ('179', '774', '2006-02-16T02:30:53', '2005-06-15T08:41:13', '2005-06-23T13:13:13', '2'), + ('179', '2445', '2006-02-16T02:30:53', '2005-07-31T14:07:21', '2005-08-01T09:20:21', '2'), + ('179', '1637', '2006-02-16T02:30:53', '2005-07-29T11:51:25', '2005-08-07T08:53:25', '1'), + ('179', '2638', '2006-02-16T02:30:53', '2005-07-29T18:23:57', '2005-08-05T19:38:57', '1'), + ('179', '889', '2006-02-16T02:30:53', '2005-07-11T04:50:03', '2005-07-19T23:52:03', '1'), + ('179', '2646', '2006-02-16T02:30:53', '2005-08-23T20:20:23', '2005-08-26T20:55:23', '1'), + ('179', '468', '2006-02-16T02:30:53', '2005-05-31T06:42:30', '2005-06-03T04:33:30', '2'), + ('179', '3655', '2006-02-16T02:30:53', '2005-07-28T00:11:00', '2005-07-31T03:04:00', '1'), + ('179', '4251', '2006-02-16T02:30:53', '2005-08-02T17:11:35', '2005-08-07T15:04:35', '1'), + ('179', '3830', '2006-02-16T02:30:53', '2005-06-19T07:25:50', '2005-06-21T03:04:50', '1'), + ('179', '3767', '2006-02-16T02:30:53', '2005-08-20T23:42:00', '2005-08-27T00:59:00', '1'), + ('179', '834', '2006-02-16T02:30:53', '2005-07-27T02:54:25', '2005-08-02T06:16:25', '2'), + ('179', '3131', '2006-02-16T02:30:53', '2005-05-28T01:34:43', '2005-05-31T01:02:43', '2'), + ('179', '778', '2006-02-16T02:30:53', '2005-08-01T06:39:55', '2005-08-06T02:16:55', '1'), + ('179', '3624', '2006-02-16T02:30:53', '2005-07-30T23:45:23', '2005-08-01T00:33:23', '2'), + ('179', '983', '2006-02-16T02:30:53', '2005-08-20T14:30:26', '2005-08-29T17:08:26', '1'), + ('179', '2821', '2006-02-16T02:30:53', '2005-07-06T09:01:29', '2005-07-15T08:08:29', '1'), + ('179', '1833', '2006-02-16T02:30:53', '2005-07-12T08:37:30', '2005-07-20T10:33:30', '1'), + ('179', '2367', '2006-02-16T02:30:53', '2005-05-29T10:57:57', '2005-06-07T16:23:57', '2'), + ('430', '2449', '2006-02-16T02:30:53', '2005-08-20T00:20:07', '2005-08-25T05:43:07', '1'), + ('430', '659', '2006-02-16T02:30:53', '2005-06-20T20:44:15', '2005-06-23T16:04:15', '1'), + ('430', '3926', '2006-02-16T02:30:53', '2005-08-22T09:11:48', '2005-08-27T06:11:48', '1'), + ('430', '4308', '2006-02-16T02:30:53', '2005-08-19T06:33:00', '2005-08-22T02:02:00', '1'), + ('430', '2765', '2006-02-16T02:30:53', '2005-06-15T07:52:52', '2005-06-20T10:01:52', '1'), + ('430', '3468', '2006-02-16T02:30:53', '2005-07-10T23:31:51', '2005-07-19T00:36:51', '2'), + ('430', '1371', '2006-02-16T02:30:53', '2005-07-30T22:04:04', '2005-08-05T18:39:04', '2'), + ('430', '4150', '2006-02-16T02:30:53', '2005-07-09T11:56:50', '2005-07-17T07:10:50', '1'), + ('430', '3499', '2006-02-16T02:30:53', '2005-07-29T11:27:27', '2005-08-01T12:05:27', '2'), + ('430', '1553', '2006-02-16T02:30:53', '2005-08-20T00:30:52', '2005-08-27T19:45:52', '2'), + ('430', '4280', '2006-02-16T02:30:53', '2005-08-19T07:47:43', '2005-08-26T02:48:43', '2'), + ('430', '1402', '2006-02-16T02:30:53', '2005-06-16T17:46:37', '2005-06-24T19:40:37', '2'), + ('430', '2388', '2006-02-16T02:30:53', '2005-07-09T01:17:08', '2005-07-15T21:53:08', '1'), + ('430', '3851', '2006-02-16T02:30:53', '2005-07-10T19:12:47', '2005-07-16T16:32:47', '1'), + ('430', '3303', '2006-02-16T02:30:53', '2005-07-11T03:18:10', '2005-07-12T05:50:10', '1'), + ('430', '833', '2006-02-16T02:30:53', '2005-05-27T07:20:12', '2005-05-31T10:44:12', '2'), + ('430', '4167', '2006-02-16T02:30:53', '2005-08-18T21:34:16', '2005-08-22T22:37:16', '1'), + ('430', '708', '2006-02-16T02:30:53', '2005-06-16T01:05:50', '2005-06-18T19:48:50', '1'), + ('430', '2993', '2006-02-16T02:30:53', '2005-06-20T02:06:39', '2005-06-21T02:50:39', '2'), + ('430', '2277', '2006-02-16T02:30:53', '2005-06-15T02:27:08', '2005-06-19T08:18:08', '2'), + ('430', '3744', '2006-02-16T02:30:53', '2005-05-25T04:01:32', '2005-05-30T03:12:32', '1'), + ('430', '178', '2006-02-16T02:30:53', '2005-08-20T22:24:35', '2005-08-30T02:26:35', '1'), + ('222', '2371', '2006-02-16T02:30:53', '2005-05-27T15:02:10', '2005-05-29T10:34:10', '2'), + ('222', '3875', '2006-02-16T02:30:53', '2005-07-11T08:15:09', '2005-07-18T13:00:09', '1'), + ('222', '933', '2006-02-16T02:30:53', '2005-07-12T03:04:29', '2005-07-17T21:36:29', '2'), + ('222', '2272', '2006-02-16T02:30:53', '2005-05-25T21:48:41', '2005-06-02T18:28:41', '1'), + ('222', '2285', '2006-02-16T02:30:53', '2005-07-28T07:18:26', '2005-07-29T03:00:26', '1'), + ('222', '3461', '2006-02-16T02:30:53', '2005-05-31T00:57:08', '2005-06-02T22:35:08', '1'), + ('222', '2558', '2006-02-16T02:30:53', '2005-07-31T19:02:07', '2005-08-07T17:58:07', '1'), + ('222', '3174', '2006-02-16T02:30:53', '2005-08-21T08:58:38', '2005-08-30T03:29:38', '2'), + ('222', '587', '2006-02-16T02:30:53', '2005-06-19T06:21:25', '2005-06-26T03:19:25', '1'), + ('222', '1457', '2006-02-16T02:30:53', '2005-07-10T06:28:39', '2005-07-17T08:35:39', '2'), + ('222', '2471', '2006-02-16T02:30:53', '2005-07-10T04:26:13', '2005-07-19T02:32:13', '2'), + ('222', '2409', '2006-02-16T02:30:53', '2005-07-09T14:17:40', '2005-07-16T10:42:40', '1'), + ('222', '1442', '2006-02-16T02:30:53', '2005-08-20T01:07:00', '2005-08-26T02:47:00', '1'), + ('222', '2079', '2006-02-16T02:30:53', '2005-05-24T23:05:21', '2005-06-02T04:33:21', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['809', '5209', '12179', '1368', '8597', '8787', '8300', '10444', '12845', '7224', '10228', '552', '11436', '14920', '14431', '10213', '1156', '5453', '4229', '15154', '6992', '4277', '2295', '4665', '7483', '3023', '9072', '12159', '9747', '8115', '3702', '10888', '5373', '634', '3377', '1471', '3925', '9982', '10577', '8387', '4151', '6735', '7823', '9904', '8528', '8155', '1227', '1601', '2677', '11536', '9742', '14450', '5148', '72', '6498', '4367', '10276', '9402', '1689', '7920', '3758', '14536', '8716', '390', '297', '2822', '15228', '7050', '12776', '1027', '12972', '1825', '2904', '12808', '4671', '2976', '15296', '11287', '2062', '1048', '9798', '9596', '14667', '13345', '3149', '8288', '555', '9302', '6314', '11890', '8689', '8510', '3994', '13658', '3100', '9490', '7097', '15665', '11669', '10511']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('222', '2114', '2006-02-16T02:30:53', '2005-05-29T19:10:20', '2005-06-05T19:05:20', '2'), + ('222', '4441', '2006-02-16T02:30:53', '2005-07-09T11:22:39', '2005-07-17T09:31:39', '1'), + ('222', '1499', '2006-02-16T02:30:53', '2005-08-18T01:21:21', '2005-08-19T00:59:21', '1'), + ('222', '2020', '2006-02-16T02:30:53', '2005-06-15T14:27:47', '2005-06-23T18:07:47', '2'), + ('222', '4218', '2006-02-16T02:30:53', '2005-07-29T12:55:55', '2005-08-05T18:54:55', '1'), + ('222', '2366', '2006-02-16T02:30:53', '2005-07-29T20:43:49', '2005-07-31T15:15:49', '1'), + ('222', '4364', '2006-02-16T02:30:53', '2005-07-29T02:57:59', '2005-08-05T01:12:59', '2'), + ('106', '3242', '2006-02-16T02:30:53', '2005-08-01T09:01:40', '2005-08-09T11:31:40', '1'), + ('106', '1698', '2006-02-16T02:30:53', '2005-08-19T02:02:37', '2005-08-22T01:08:37', '1'), + ('106', '2701', '2006-02-16T02:30:53', '2005-07-27T09:44:26', '2005-08-05T12:46:26', '2'), + ('106', '1742', '2006-02-16T02:30:53', '2005-08-01T01:43:18', '2005-08-06T22:10:18', '2'), + ('106', '23', '2006-02-16T02:30:53', '2005-05-28T07:53:38', '2005-06-04T12:45:38', '2'), + ('106', '3834', '2006-02-16T02:30:53', '2005-08-02T20:16:06', '2005-08-05T20:40:06', '2'), + ('106', '3357', '2006-02-16T02:30:53', '2005-08-22T05:08:58', '2005-08-23T02:51:58', '1'), + ('106', '1572', '2006-02-16T02:30:53', '2005-08-21T11:31:15', '2005-08-26T11:22:15', '2'), + ('106', '1462', '2006-02-16T02:30:53', '2005-08-01T01:03:18', '2005-08-09T20:07:18', '1'), + ('106', '460', '2006-02-16T02:30:53', '2005-05-31T22:37:34', '2005-06-01T23:02:34', '2'), + ('106', '1780', '2006-02-16T02:30:53', '2005-07-09T22:24:11', '2005-07-19T04:08:11', '1'), + ('106', '953', '2006-02-16T02:30:53', '2005-07-07T12:43:23', '2005-07-13T15:00:23', '2'), + ('106', '3395', '2006-02-16T02:30:53', '2005-08-22T14:27:37', '2005-08-29T20:04:37', '2'), + ('106', '3411', '2006-02-16T02:30:53', '2005-07-27T01:04:45', '2005-07-28T02:34:45', '2'), + ('106', '1983', '2006-02-16T02:30:53', '2005-07-07T14:52:12', '2005-07-09T13:10:12', '1'), + ('106', '3250', '2006-02-16T02:30:53', '2005-06-18T07:56:18', '2005-06-21T07:10:18', '1'), + ('106', '575', '2006-02-16T02:30:53', '2005-07-08T10:04:24', '2005-07-14T15:13:24', '1'), + ('106', '3678', '2006-02-16T02:30:53', '2005-07-27T19:25:00', '2005-07-29T21:19:00', '2'), + ('106', '4304', '2006-02-16T02:30:53', '2005-06-20T11:18:11', '2005-06-21T12:43:11', '1'), + ('106', '4536', '2006-02-16T02:30:53', '2005-07-30T07:45:49', '2005-08-04T10:00:49', '1'), + ('106', '2243', '2006-02-16T02:30:53', '2005-08-18T00:36:09', '2005-08-27T06:31:09', '1'), + ('106', '2455', '2006-02-16T02:30:53', '2005-07-31T09:16:57', '2005-08-08T06:47:57', '2'), + ('106', '2080', '2006-02-16T02:30:53', '2005-07-28T19:14:17', '2005-08-03T14:58:17', '2'), + ('428', '2204', '2006-02-16T02:30:53', '2005-07-06T10:13:56', '2005-07-10T08:12:56', '1'), + ('428', '2412', '2006-02-16T02:30:53', '2005-08-02T00:52:45', '2005-08-03T03:07:45', '1'), + ('428', '950', '2006-02-16T02:30:53', '2005-07-09T18:48:57', '2005-07-10T16:34:57', '1'), + ('428', '2630', '2006-02-16T02:30:53', '2005-05-28T17:40:35', '2005-06-05T16:18:35', '2'), + ('428', '1845', '2006-02-16T02:30:53', '2005-06-21T13:51:12', '2005-06-22T18:16:12', '1'), + ('428', '565', '2006-02-16T02:30:53', '2005-06-15T20:53:26', '2005-06-24T18:25:26', '2'), + ('428', '2653', '2006-02-16T02:30:53', '2005-07-06T20:41:44', '2005-07-15T21:05:44', '2'), + ('428', '2698', '2006-02-16T02:30:53', '2005-07-31T17:09:02', '2005-08-02T13:02:02', '2'), + ('428', '2240', '2006-02-16T02:30:53', '2005-08-01T13:46:38', '2005-08-06T11:35:38', '2'), + ('428', '910', '2006-02-16T02:30:53', '2005-07-29T05:47:27', '2005-07-31T06:26:27', '1'), + ('428', '4564', '2006-02-16T02:30:53', '2005-07-07T08:49:02', '2005-07-11T05:19:02', '1'), + ('428', '276', '2006-02-16T02:30:53', '2005-07-12T14:08:20', '2005-07-18T09:41:20', '2'), + ('428', '84', '2006-02-16T02:30:53', '2005-07-28T08:32:53', '2005-08-06T11:59:53', '1'), + ('428', '4089', '2006-02-16T02:30:53', '2005-07-31T14:34:17', '2005-08-08T17:19:17', '1'), + ('428', '2107', '2006-02-16T02:30:53', '2005-07-29T10:24:22', '2005-08-07T10:34:22', '1'), + ('428', '3023', '2006-02-16T02:30:53', '2005-07-28T20:57:06', '2005-08-02T18:40:06', '2'), + ('428', '654', '2006-02-16T02:30:53', '2005-06-15T03:50:03', '2005-06-21T23:48:03', '2'), + ('428', '3115', '2006-02-16T02:30:53', '2005-06-16T06:11:13', '2005-06-21T08:57:13', '2'), + ('428', '4384', '2006-02-16T02:30:53', '2005-06-19T12:01:59', '2005-06-21T06:15:59', '2'), + ('428', '2735', '2006-02-16T02:30:53', '2005-08-17T00:40:03', '2005-08-21T19:11:03', '1'), + ('48', '4058', '2006-02-16T02:30:53', '2005-07-31T09:10:20', '2005-08-08T10:07:20', '1'), + ('48', '1194', '2006-02-16T02:30:53', '2005-08-21T12:21:25', '2005-08-26T14:35:25', '2'), + ('48', '456', '2006-02-16T02:30:53', '2005-07-09T08:22:46', '2005-07-18T04:36:46', '1'), + ('48', '2260', '2006-02-16T02:30:53', '2005-05-25T10:52:13', '2005-05-28T05:52:13', '2'), + ('48', '243', '2006-02-16T02:30:53', '2005-07-12T03:05:38', '2005-07-19T07:12:38', '1'), + ('48', '4529', '2006-02-16T02:30:53', '2005-07-07T19:52:01', '2005-07-13T19:41:01', '2'), + ('48', '2201', '2006-02-16T02:30:53', '2005-08-01T03:22:23', '2005-08-03T07:59:23', '1'), + ('48', '2424', '2006-02-16T02:30:53', '2005-07-30T20:18:27', '2005-08-07T21:29:27', '2'), + ('48', '4036', '2006-02-16T02:30:53', '2005-06-16T12:18:41', '2005-06-24T13:33:41', '2'), + ('48', '66', '2006-02-16T02:30:53', '2005-07-28T12:01:19', '2005-08-05T07:08:19', '1'), + ('48', '2498', '2006-02-16T02:30:53', '2005-07-06T12:43:11', '2005-07-14T12:52:11', '2'), + ('48', '2615', '2006-02-16T02:30:53', '2005-08-21T15:22:50', '2005-08-27T17:03:50', '1'), + ('48', '2123', '2006-02-16T02:30:53', '2005-07-29T17:39:09', '2005-08-03T20:26:09', '2'), + ('48', '3759', '2006-02-16T02:30:53', '2005-05-27T11:02:26', '2005-06-02T16:09:26', '2'), + ('48', '1594', '2006-02-16T02:30:53', '2005-05-26T20:48:48', '2005-05-27T19:52:48', '2'), + ('48', '3599', '2006-02-16T02:30:53', '2005-06-19T20:29:24', '2005-06-23T02:21:24', '1'), + ('48', '2485', '2006-02-16T02:30:53', '2005-08-22T17:27:23', '2005-08-29T11:38:23', '2'), + ('55', '1135', '2006-02-16T02:30:53', '2005-07-27T03:33:17', '2005-08-02T03:12:17', '1'), + ('55', '2345', '2006-02-16T02:30:53', '2005-08-18T23:37:33', '2005-08-23T03:07:33', '1'), + ('55', '2718', '2006-02-16T02:30:53', '2005-05-31T03:46:19', '2005-06-09T03:50:19', '1'), + ('55', '1218', '2006-02-16T02:30:53', '2005-08-19T06:43:28', '2005-08-27T11:30:28', '1'), + ('55', '2908', '2006-02-16T02:30:53', '2005-06-16T21:53:05', '2005-06-20T17:22:05', '2'), + ('55', '2195', '2006-02-16T02:30:53', '2005-06-20T02:54:06', '2005-06-21T06:57:06', '2'), + ('55', '3920', '2006-02-16T02:30:53', '2005-08-19T00:40:41', '2005-08-21T06:39:41', '2'), + ('55', '2139', '2006-02-16T02:30:53', '2005-07-08T10:15:32', '2005-07-14T08:19:32', '2'), + ('55', '4210', '2006-02-16T02:30:53', '2005-06-20T08:09:11', '2005-06-21T10:45:11', '1'), + ('55', '2715', '2006-02-16T02:30:53', '2005-08-22T19:37:20', '2005-08-24T15:16:20', '1'), + ('55', '927', '2006-02-16T02:30:53', '2005-08-02T14:49:51', '2005-08-09T09:19:51', '2'), + ('55', '1749', '2006-02-16T02:30:53', '2005-06-17T15:56:43', '2005-06-20T21:37:43', '2'), + ('55', '2811', '2006-02-16T02:30:53', '2005-05-31T06:49:53', '2005-06-02T11:33:53', '1'), + ('55', '3759', '2006-02-16T02:30:53', '2005-07-31T10:55:18', '2005-08-01T07:37:18', '2'), + ('55', '2847', '2006-02-16T02:30:53', '2005-07-31T03:28:47', '2005-08-04T03:43:47', '2'), + ('55', '2608', '2006-02-16T02:30:53', '2005-08-21T19:51:11', '2005-08-23T17:37:11', '1'), + ('55', '47', '2006-02-16T02:30:53', '2005-08-19T20:25:24', '2005-08-27T20:38:24', '1'), + ('55', '3295', '2006-02-16T02:30:53', '2005-06-20T20:34:55', '2005-06-21T18:51:55', '1'), + ('55', '1822', '2006-02-16T02:30:53', '2005-07-29T02:04:22', '2005-08-05T04:21:22', '2'), + ('55', '4397', '2006-02-16T02:30:53', '2005-05-28T08:31:14', '2005-05-30T07:34:14', '2'), + ('55', '2326', '2006-02-16T02:30:53', '2005-07-30T16:34:57', '2005-07-31T11:08:57', '2'), + ('55', '4128', '2006-02-16T02:30:53', '2005-07-11T18:32:44', '2005-07-17T23:58:44', '1'), + ('487', '3023', '2006-02-16T02:30:53', '2005-08-17T15:08:43', '2005-08-26T14:56:43', '2'), + ('487', '824', '2006-02-16T02:30:53', '2005-07-29T16:38:58', '2005-08-01T17:09:58', '2'), + ('487', '7', '2006-02-16T02:30:53', '2005-07-29T09:41:38', '2005-08-05T05:30:38', '2'), + ('487', '902', '2006-02-16T02:30:53', '2005-07-06T23:39:01', '2005-07-14T00:33:01', '1'), + ('487', '3827', '2006-02-16T02:30:53', '2005-08-20T08:02:22', '2005-08-28T06:00:22', '1'), + ('487', '2428', '2006-02-16T02:30:53', '2005-06-20T16:47:57', '2005-06-26T16:59:57', '1'), + ('487', '1302', '2006-02-16T02:30:53', '2005-07-30T23:45:09', '2005-08-07T18:50:09', '1'), + ('487', '258', '2006-02-16T02:30:53', '2005-07-27T04:56:09', '2005-07-31T05:47:09', '1'), + ('487', '3471', '2006-02-16T02:30:53', '2005-08-23T08:59:12', '2005-08-24T12:50:12', '2'), + ('487', '3224', '2006-02-16T02:30:53', '2005-08-17T05:48:51', '2005-08-22T01:22:51', '1'), + ('487', '3874', '2006-02-16T02:30:53', '2005-08-01T11:32:16', '2005-08-04T09:38:16', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['8988', '6928', '4854', '10123', '5634', '10555', '7788', '7949', '10877', '10832', '12493', '13210', '9457', '10978', '8814', '12657', '3468', '4980', '7921', '5238', '6655', '71', '15163', '4970', '5355', '11346', '9048', '11143', '9271', '1216', '4209', '8203', '1427', '15246', '3800', '15021', '7819', '1340', '3602', '8282', '12582', '8066', '7295', '8290', '15943', '16013', '3279', '11808', '7932', '13492', '12466', '6721', '13041', '8757', '6710', '7324', '1773', '6583', '1926', '4500', '10283', '6630', '4728', '11639', '9891', '156', '13328', '12802', '7762', '7935', '590', '15581', '8209', '1803', '7912', '452', '13043', '13091', '14189', '5983', '11235', '10787', '4652', '14030', '10197', '1293', '15463', '2412', '9859', '15736', '5499', '12060', '708', '4811', '10973', '12820', '4014', '75', '12317', '2729']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('487', '777', '2006-02-16T02:30:53', '2005-07-30T04:38:49', '2005-08-07T07:00:49', '2'), + ('487', '3605', '2006-02-16T02:30:53', '2005-07-26T22:56:21', '2005-07-30T04:46:21', '1'), + ('487', '3644', '2006-02-16T02:30:53', '2005-07-08T18:44:44', '2005-07-13T13:37:44', '1'), + ('487', '4564', '2006-02-16T02:30:53', '2005-07-31T21:30:46', '2005-08-06T16:28:46', '1'), + ('487', '323', '2006-02-16T02:30:53', '2005-07-10T06:25:48', '2005-07-17T09:07:48', '2'), + ('487', '377', '2006-02-16T02:30:53', '2005-08-01T12:56:38', '2005-08-10T18:19:38', '1'), + ('487', '95', '2006-02-16T02:30:53', '2005-07-28T07:21:55', '2005-08-03T06:33:55', '1'), + ('487', '2145', '2006-02-16T02:30:53', '2005-07-28T13:07:24', '2005-08-02T09:41:24', '1'), + ('487', '3337', '2006-02-16T02:30:53', '2005-08-02T00:32:04', '2005-08-07T19:44:04', '2'), + ('487', '4096', '2006-02-16T02:30:53', '2005-08-01T23:24:53', '2005-08-06T23:18:53', '1'), + ('487', '3029', '2006-02-16T02:30:53', '2005-08-18T12:53:38', '2005-08-27T13:15:38', '2'), + ('487', '2789', '2006-02-16T02:30:53', '2005-08-19T15:23:38', '2005-08-21T11:57:38', '1'), + ('487', '2172', '2006-02-16T02:30:53', '2005-07-30T22:23:05', '2005-07-31T23:07:05', '2'), + ('487', '1597', '2006-02-16T02:30:53', '2005-08-02T04:12:27', '2005-08-10T08:19:27', '2'), + ('487', '1492', '2006-02-16T02:30:53', '2005-07-29T21:49:43', '2005-08-01T19:56:43', '1'), + ('100', '3621', '2006-02-16T02:30:53', '2005-08-18T19:02:16', '2005-08-21T14:59:16', '1'), + ('100', '2899', '2006-02-16T02:30:53', '2005-06-21T22:43:45', '2005-06-30T01:49:45', '1'), + ('100', '2638', '2006-02-16T02:30:53', '2005-07-09T00:26:59', '2005-07-14T19:42:59', '1'), + ('100', '116', '2006-02-16T02:30:53', '2005-07-28T12:02:46', '2005-08-01T12:08:46', '2'), + ('100', '3297', '2006-02-16T02:30:53', '2005-07-09T13:11:14', '2005-07-10T07:27:14', '2'), + ('100', '3937', '2006-02-16T02:30:53', '2005-07-12T11:08:32', '2005-07-15T15:17:32', '1'), + ('100', '2408', '2006-02-16T02:30:53', '2005-05-25T10:26:39', '2005-05-28T04:59:39', '1'), + ('100', '3597', '2006-02-16T02:30:53', '2005-08-22T14:43:13', '2005-08-26T14:26:13', '1'), + ('100', '2983', '2006-02-16T02:30:53', '2005-07-08T23:54:29', '2005-07-16T22:47:29', '1'), + ('100', '2458', '2006-02-16T02:30:53', '2005-07-09T18:07:17', '2005-07-16T20:33:17', '2'), + ('100', '584', '2006-02-16T02:30:53', '2005-08-02T17:15:38', '2005-08-04T13:31:38', '2'), + ('100', '3929', '2006-02-16T02:30:53', '2005-07-30T06:57:07', '2005-08-05T00:57:07', '1'), + ('100', '3382', '2006-02-16T02:30:53', '2005-08-02T09:32:54', '2005-08-05T12:04:54', '2'), + ('100', '2660', '2006-02-16T02:30:53', '2005-07-30T15:04:31', '2005-07-31T20:33:31', '1'), + ('100', '3973', '2006-02-16T02:30:53', '2005-06-15T03:23:48', '2005-06-18T03:35:48', '1'), + ('100', '2010', '2006-02-16T02:30:53', '2005-07-07T11:35:08', '2005-07-10T10:58:08', '1'), + ('100', '3878', '2006-02-16T02:30:53', '2005-07-28T23:14:56', '2005-07-31T04:19:56', '2'), + ('100', '14', '2006-02-16T02:30:53', '2005-06-15T18:17:28', '2005-06-16T15:47:28', '1'), + ('100', '3786', '2006-02-16T02:30:53', '2005-08-22T17:50:49', '2005-08-30T22:21:49', '1'), + ('100', '4004', '2006-02-16T02:30:53', '2005-07-06T15:01:27', '2005-07-15T11:12:27', '2'), + ('100', '418', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('100', '3182', '2006-02-16T02:30:53', '2005-07-28T08:27:14', '2005-08-02T12:34:14', '2'), + ('100', '251', '2006-02-16T02:30:53', '2005-06-15T12:24:15', '2005-06-22T13:02:15', '1'), + ('100', '2192', '2006-02-16T02:30:53', '2005-07-06T05:23:10', '2005-07-15T03:22:10', '2'), + ('462', '980', '2006-02-16T02:30:53', '2005-07-29T01:49:04', '2005-08-05T01:51:04', '2'), + ('462', '4467', '2006-02-16T02:30:53', '2005-08-18T15:51:12', '2005-08-20T12:05:12', '1'), + ('462', '3208', '2006-02-16T02:30:53', '2005-07-28T17:20:09', '2005-07-31T18:36:09', '2'), + ('462', '3396', '2006-02-16T02:30:53', '2005-07-27T12:38:47', '2005-08-05T10:12:47', '1'), + ('462', '3823', '2006-02-16T02:30:53', '2005-07-29T02:24:08', '2005-08-03T01:02:08', '2'), + ('462', '706', '2006-02-16T02:30:53', '2005-08-23T18:49:32', '2005-08-27T19:20:32', '1'), + ('462', '561', '2006-02-16T02:30:53', '2005-08-23T21:17:17', '2005-08-26T21:15:17', '1'), + ('462', '1672', '2006-02-16T02:30:53', '2005-06-21T06:05:53', '2005-06-25T09:40:53', '1'), + ('462', '4042', '2006-02-16T02:30:53', '2005-08-17T11:51:16', '2005-08-18T14:01:16', '2'), + ('462', '3738', '2006-02-16T02:30:53', '2005-07-28T12:24:54', '2005-07-30T11:33:54', '1'), + ('462', '1155', '2006-02-16T02:30:53', '2005-08-20T01:32:04', '2005-08-29T02:14:04', '2'), + ('462', '2686', '2006-02-16T02:30:53', '2005-08-18T11:36:55', '2005-08-23T13:46:55', '1'), + ('462', '2798', '2006-02-16T02:30:53', '2005-07-12T13:42:58', '2005-07-19T16:39:58', '2'), + ('462', '1576', '2006-02-16T02:30:53', '2005-08-19T09:05:38', '2005-08-27T06:34:38', '1'), + ('462', '3473', '2006-02-16T02:30:53', '2005-07-29T19:19:10', '2005-08-02T13:47:10', '2'), + ('462', '806', '2006-02-16T02:30:53', '2005-07-12T13:23:09', '2005-07-20T10:10:09', '2'), + ('462', '2572', '2006-02-16T02:30:53', '2005-07-27T13:42:39', '2005-08-04T10:33:39', '2'), + ('462', '4396', '2006-02-16T02:30:53', '2005-06-16T18:13:43', '2005-06-24T17:43:43', '2'), + ('462', '2343', '2006-02-16T02:30:53', '2005-07-12T06:42:31', '2005-07-15T07:51:31', '1'), + ('462', '3509', '2006-02-16T02:30:53', '2005-06-17T06:24:30', '2005-06-25T03:39:30', '2'), + ('462', '398', '2006-02-16T02:30:53', '2005-07-08T02:10:01', '2005-07-15T05:49:01', '2'), + ('462', '4237', '2006-02-16T02:30:53', '2005-08-01T03:29:45', '2005-08-07T04:19:45', '1'), + ('462', '1843', '2006-02-16T02:30:53', '2005-07-12T09:30:05', '2005-07-14T08:29:05', '2'), + ('462', '3687', '2006-02-16T02:30:53', '2005-07-08T12:59:01', '2005-07-13T13:00:01', '1'), + ('462', '3985', '2006-02-16T02:30:53', '2005-08-17T04:43:29', '2005-08-25T01:04:29', '2'), + ('462', '3359', '2006-02-16T02:30:53', '2005-07-31T14:05:44', '2005-08-02T16:21:44', '2'), + ('462', '3193', '2006-02-16T02:30:53', '2005-05-26T01:19:05', '2005-05-27T23:43:05', '1'), + ('462', '605', '2006-02-16T02:30:53', '2005-08-19T19:56:01', '2005-08-20T22:16:01', '2'), + ('462', '2461', '2006-02-16T02:30:53', '2005-08-19T00:27:41', '2005-08-28T03:24:41', '1'), + ('462', '3234', '2006-02-16T02:30:53', '2005-07-28T06:34:23', '2005-08-05T09:55:23', '2'), + ('462', '3664', '2006-02-16T02:30:53', '2005-07-28T12:33:17', '2005-08-04T14:40:17', '2'), + ('462', '473', '2006-02-16T02:30:53', '2005-05-28T13:06:50', '2005-06-02T09:18:50', '1'), + ('462', '4010', '2006-02-16T02:30:53', '2005-08-23T05:42:13', '2005-08-28T00:03:13', '1'), + ('127', '2484', '2006-02-16T02:30:53', '2005-07-28T23:29:28', '2005-08-07T04:22:28', '2'), + ('127', '3784', '2006-02-16T02:30:53', '2005-06-16T20:32:47', '2005-06-21T02:03:47', '1'), + ('127', '745', '2006-02-16T02:30:53', '2005-07-28T11:46:58', '2005-08-05T12:50:58', '1'), + ('127', '2993', '2006-02-16T02:30:53', '2005-05-27T19:30:33', '2005-05-30T20:53:33', '2'), + ('127', '24', '2006-02-16T02:30:53', '2005-08-19T09:07:13', '2005-08-27T07:49:13', '1'), + ('127', '1815', '2006-02-16T02:30:53', '2005-08-19T10:40:10', '2005-08-23T09:03:10', '1'), + ('127', '2209', '2006-02-16T02:30:53', '2005-08-21T03:32:17', '2005-08-22T04:46:17', '2'), + ('127', '351', '2006-02-16T02:30:53', '2005-07-11T00:34:11', '2005-07-15T05:37:11', '1'), + ('127', '2501', '2006-02-16T02:30:53', '2005-08-02T13:13:21', '2005-08-03T07:17:21', '1'), + ('127', '3246', '2006-02-16T02:30:53', '2005-08-01T21:35:01', '2005-08-10T23:30:01', '1'), + ('127', '4198', '2006-02-16T02:30:53', '2005-07-08T09:47:51', '2005-07-16T04:09:51', '2'), + ('127', '1027', '2006-02-16T02:30:53', '2005-08-20T21:23:54', '2005-08-27T01:19:54', '1'), + ('127', '1186', '2006-02-16T02:30:53', '2005-08-01T00:35:25', '2005-08-07T06:04:25', '2'), + ('127', '2882', '2006-02-16T02:30:53', '2005-06-15T09:06:24', '2005-06-18T06:58:24', '1'), + ('127', '863', '2006-02-16T02:30:53', '2005-08-23T01:15:07', '2005-08-29T06:50:07', '1'), + ('127', '1946', '2006-02-16T02:30:53', '2005-06-18T16:58:58', '2005-06-27T22:57:58', '1'), + ('127', '4094', '2006-02-16T02:30:53', '2005-07-31T13:02:55', '2005-08-05T11:04:55', '1'), + ('127', '4272', '2006-02-16T02:30:53', '2005-08-23T11:40:30', '2005-08-30T12:40:30', '1'), + ('127', '1525', '2006-02-16T02:30:53', '2005-07-10T00:27:45', '2005-07-17T06:11:45', '1'), + ('127', '2373', '2006-02-16T02:30:53', '2005-08-17T21:11:57', '2005-08-21T01:42:57', '1'), + ('127', '3133', '2006-02-16T02:30:53', '2005-05-29T03:23:47', '2005-05-31T21:27:47', '2'), + ('127', '4032', '2006-02-16T02:30:53', '2005-07-08T17:04:24', '2005-07-12T16:41:24', '2'), + ('127', '3562', '2006-02-16T02:30:53', '2005-08-02T04:09:42', '2005-08-08T05:24:42', '2'), + ('127', '2936', '2006-02-16T02:30:53', '2005-08-19T01:05:08', '2005-08-21T05:37:08', '2'), + ('510', '583', '2006-02-16T02:30:53', '2005-07-07T00:58:54', '2005-07-12T02:40:54', '1'), + ('510', '3393', '2006-02-16T02:30:53', '2005-05-25T11:13:34', '2005-06-03T12:58:34', '1'), + ('510', '90', '2006-02-16T02:30:53', '2005-08-18T06:17:06', '2005-08-22T08:56:06', '1'), + ('510', '4449', '2006-02-16T02:30:53', '2005-06-19T15:06:15', '2005-06-27T17:58:15', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['10131', '3352', '11996', '10265', '15065', '8926', '7457', '372', '1435', '7794', '3744', '1925', '2806', '7678', '8763', '3465', '1757', '1118', '12406', '2817', '5851', '6531', '15789', '11595', '4767', '3893', '11692', '24', '2619', '2011', '11504', '12445', '13086', '3079', '3529', '12252', '3206', '7416', '11800', '5786', '15807', '802', '5303', '6408', '5240', '15997', '15108', '8537', '8945', '1890', '461', '14443', '5331', '4403', '5734', '6651', '16032', '2025', '4858', '13848', '13072', '1230', '9076', '12511', '10425', '9288', '5987', '13110', '2285', '11108', '732', '6690', '11465', '10957', '952', '15826', '10448', '8167', '5224', '13310', '1128', '16020', '13423', '544', '2967', '8473', '9882', '9503', '6419', '4836', '14517', '12997', '990', '1955', '10134', '274', '1622', '10456', '15858', '13820']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('510', '4169', '2006-02-16T02:30:53', '2005-07-31T21:45:28', '2005-08-04T00:19:28', '2'), + ('510', '578', '2006-02-16T02:30:53', '2005-06-21T11:26:29', '2005-06-28T07:26:29', '1'), + ('510', '2720', '2006-02-16T02:30:53', '2005-08-17T18:34:37', '2005-08-20T22:25:37', '2'), + ('510', '3338', '2006-02-16T02:30:53', '2005-08-01T03:05:04', '2005-08-08T08:09:04', '1'), + ('510', '468', '2006-02-16T02:30:53', '2005-08-22T10:46:44', '2005-08-27T09:40:44', '2'), + ('510', '3677', '2006-02-16T02:30:53', '2005-07-30T02:10:31', '2005-08-03T23:56:31', '1'), + ('510', '3635', '2006-02-16T02:30:53', '2005-07-27T18:35:17', '2005-07-30T12:41:17', '2'), + ('510', '4089', '2006-02-16T02:30:53', '2005-05-27T08:13:58', '2005-06-04T03:50:58', '2'), + ('510', '2769', '2006-02-16T02:30:53', '2005-06-15T18:32:30', '2005-06-24T12:44:30', '2'), + ('510', '4509', '2006-02-16T02:30:53', '2005-07-28T07:28:03', '2005-08-06T12:32:03', '2'), + ('510', '3343', '2006-02-16T02:30:53', '2005-07-06T12:10:02', '2005-07-08T11:49:02', '2'), + ('510', '3995', '2006-02-16T02:30:53', '2005-06-17T06:16:47', '2005-06-21T06:03:47', '1'), + ('510', '2114', '2006-02-16T02:30:53', '2005-06-19T19:30:48', '2005-06-20T19:42:48', '2'), + ('510', '3398', '2006-02-16T02:30:53', '2005-07-28T02:58:16', '2005-08-06T04:22:16', '1'), + ('510', '374', '2006-02-16T02:30:53', '2005-07-29T19:38:24', '2005-08-04T16:51:24', '1'), + ('510', '1488', '2006-02-16T02:30:53', '2005-06-21T22:10:01', '2005-06-30T21:35:01', '1'), + ('510', '4491', '2006-02-16T02:30:53', '2005-06-16T17:32:24', '2005-06-18T13:12:24', '1'), + ('510', '213', '2006-02-16T02:30:53', '2005-05-31T16:23:02', '2005-06-03T20:00:02', '1'), + ('510', '4368', '2006-02-16T02:30:53', '2005-08-18T09:38:02', '2005-08-22T12:56:02', '1'), + ('510', '3476', '2006-02-16T02:30:53', '2005-06-19T20:05:22', '2005-06-24T23:29:22', '1'), + ('510', '3944', '2006-02-16T02:30:53', '2005-07-10T17:40:47', '2005-07-11T19:24:47', '2'), + ('510', '4231', '2006-02-16T02:30:53', '2005-07-12T04:35:24', '2005-07-16T05:37:24', '2'), + ('350', '1213', '2006-02-16T02:30:53', '2005-08-23T13:56:40', '2005-08-27T15:25:40', '1'), + ('350', '466', '2006-02-16T02:30:53', '2005-08-17T02:53:14', '2005-08-26T02:05:14', '1'), + ('350', '3744', '2006-02-16T02:30:53', '2005-07-08T15:18:53', '2005-07-13T15:48:53', '1'), + ('350', '1281', '2006-02-16T02:30:53', '2005-07-06T18:59:31', '2005-07-12T19:21:31', '1'), + ('350', '1222', '2006-02-16T02:30:53', '2005-08-17T06:52:41', '2005-08-24T12:17:41', '2'), + ('350', '3273', '2006-02-16T02:30:53', '2005-05-25T02:53:02', '2005-05-27T01:15:02', '1'), + ('350', '1848', '2006-02-16T02:30:53', '2005-06-19T08:03:12', '2005-06-21T05:02:12', '2'), + ('350', '734', '2006-02-16T02:30:53', '2005-06-17T11:56:09', '2005-06-24T06:47:09', '2'), + ('350', '2132', '2006-02-16T02:30:53', '2005-08-16T23:16:46', '2005-08-18T20:49:46', '2'), + ('350', '3347', '2006-02-16T02:30:53', '2005-08-18T10:56:20', '2005-08-21T16:46:20', '1'), + ('350', '3712', '2006-02-16T02:30:53', '2005-08-19T10:32:28', '2005-08-26T07:57:28', '2'), + ('350', '2135', '2006-02-16T02:30:53', '2005-06-20T15:13:40', '2005-06-21T12:03:40', '1'), + ('350', '4316', '2006-02-16T02:30:53', '2005-07-06T01:15:26', '2005-07-07T04:28:26', '1'), + ('350', '127', '2006-02-16T02:30:53', '2005-08-18T03:59:51', '2005-08-25T08:54:51', '2'), + ('350', '2196', '2006-02-16T02:30:53', '2005-06-21T00:39:39', '2005-06-22T05:12:39', '1'), + ('350', '653', '2006-02-16T02:30:53', '2005-07-27T16:55:25', '2005-07-29T11:27:25', '1'), + ('350', '2284', '2006-02-16T02:30:53', '2005-08-17T11:29:52', '2005-08-21T08:37:52', '1'), + ('350', '2290', '2006-02-16T02:30:53', '2005-07-10T14:06:44', '2005-07-14T19:55:44', '2'), + ('350', '2705', '2006-02-16T02:30:53', '2005-08-23T14:35:10', '2005-08-29T19:06:10', '2'), + ('350', '785', '2006-02-16T02:30:53', '2005-05-29T17:38:59', '2005-05-31T22:42:59', '2'), + ('350', '3572', '2006-02-16T02:30:53', '2005-07-09T15:44:09', '2005-07-15T18:09:09', '2'), + ('350', '2008', '2006-02-16T02:30:53', '2005-07-11T23:03:02', '2005-07-19T23:09:02', '2'), + ('350', '1378', '2006-02-16T02:30:53', '2005-07-09T13:14:48', '2005-07-10T18:47:48', '2'), + ('447', '2843', '2006-02-16T02:30:53', '2005-08-23T20:40:31', '2005-08-26T19:47:31', '1'), + ('447', '3463', '2006-02-16T02:30:53', '2005-08-22T12:10:07', '2005-08-26T14:46:07', '2'), + ('447', '1012', '2006-02-16T02:30:53', '2005-07-29T10:44:54', '2005-08-06T14:55:54', '2'), + ('447', '1441', '2006-02-16T02:30:53', '2005-07-30T03:11:48', '2005-08-07T07:53:48', '2'), + ('447', '1764', '2006-02-16T02:30:53', '2005-06-17T04:06:13', '2005-06-22T07:46:13', '2'), + ('447', '2077', '2006-02-16T02:30:53', '2005-05-27T20:08:55', '2005-06-01T14:32:55', '1'), + ('447', '376', '2006-02-16T02:30:53', '2005-08-21T12:06:32', '2005-08-29T13:44:32', '2'), + ('447', '4181', '2006-02-16T02:30:53', '2005-07-09T16:54:06', '2005-07-10T19:04:06', '1'), + ('447', '3973', '2006-02-16T02:30:53', '2005-07-07T21:29:40', '2005-07-09T17:58:40', '1'), + ('447', '399', '2006-02-16T02:30:53', '2005-07-10T11:37:28', '2005-07-16T11:10:28', '1'), + ('447', '98', '2006-02-16T02:30:53', '2005-07-12T10:57:28', '2005-07-15T06:06:28', '2'), + ('447', '2527', '2006-02-16T02:30:53', '2005-08-23T21:59:57', '2005-08-31T22:46:57', '2'), + ('447', '1203', '2006-02-16T02:30:53', '2005-06-17T13:04:00', '2005-06-18T18:45:00', '2'), + ('447', '3424', '2006-02-16T02:30:53', '2005-07-08T18:53:24', '2005-07-17T20:32:24', '2'), + ('447', '802', '2006-02-16T02:30:53', '2005-08-20T14:37:49', '2005-08-25T13:15:49', '1'), + ('447', '2313', '2006-02-16T02:30:53', '2005-08-19T10:03:30', '2005-08-22T14:27:30', '2'), + ('447', '2324', '2006-02-16T02:30:53', '2005-06-15T04:04:09', '2005-06-16T02:21:09', '1'), + ('447', '496', '2006-02-16T02:30:53', '2005-07-30T07:58:12', '2005-08-08T06:04:12', '1'), + ('447', '919', '2006-02-16T02:30:53', '2005-08-18T13:23:19', '2005-08-22T11:43:19', '2'), + ('447', '322', '2006-02-16T02:30:53', '2005-08-01T08:23:25', '2005-08-05T04:29:25', '1'), + ('447', '2640', '2006-02-16T02:30:53', '2005-07-30T15:56:39', '2005-08-04T13:25:39', '2'), + ('447', '1000', '2006-02-16T02:30:53', '2005-07-11T00:55:31', '2005-07-16T06:28:31', '2'), + ('447', '62', '2006-02-16T02:30:53', '2005-08-19T11:24:37', '2005-08-21T05:48:37', '1'), + ('447', '755', '2006-02-16T02:30:53', '2005-06-18T07:00:54', '2005-06-25T08:58:54', '2'), + ('447', '560', '2006-02-16T02:30:53', '2005-08-02T08:20:01', '2005-08-03T13:22:01', '2'), + ('447', '2530', '2006-02-16T02:30:53', '2005-05-29T07:32:51', '2005-05-30T10:08:51', '2'), + ('447', '4254', '2006-02-16T02:30:53', '2005-07-12T12:23:02', '2005-07-16T15:39:02', '2'), + ('447', '2190', '2006-02-16T02:30:53', '2005-08-02T21:43:52', '2005-08-10T22:24:52', '1'), + ('447', '1652', '2006-02-16T02:30:53', '2005-08-02T03:33:30', '2005-08-10T06:19:30', '2'), + ('311', '4389', '2006-02-16T02:30:53', '2005-05-30T16:28:07', '2005-06-02T16:12:07', '2'), + ('311', '215', '2006-02-16T02:30:53', '2005-08-23T15:15:02', '2005-08-31T20:39:02', '2'), + ('311', '2254', '2006-02-16T02:30:53', '2005-08-01T09:09:31', '2005-08-02T09:55:31', '2'), + ('311', '3181', '2006-02-16T02:30:53', '2005-07-28T21:25:45', '2005-08-04T18:04:45', '1'), + ('311', '279', '2006-02-16T02:30:53', '2005-07-09T12:07:27', '2005-07-17T08:59:27', '1'), + ('311', '2563', '2006-02-16T02:30:53', '2005-08-19T19:05:16', '2005-08-23T22:47:16', '1'), + ('311', '1496', '2006-02-16T02:30:53', '2005-05-31T17:49:26', '2005-06-05T19:51:26', '2'), + ('311', '277', '2006-02-16T02:30:53', '2005-08-23T21:34:33', '2005-09-01T18:17:33', '1'), + ('311', '546', '2006-02-16T02:30:53', '2005-08-19T23:07:42', '2005-08-26T20:45:42', '1'), + ('311', '2964', '2006-02-16T02:30:53', '2005-05-28T07:03:00', '2005-06-06T06:23:00', '1'), + ('311', '4243', '2006-02-16T02:30:53', '2005-06-20T07:40:35', '2005-06-29T05:50:35', '2'), + ('311', '4141', '2006-02-16T02:30:53', '2005-07-29T08:36:53', '2005-07-31T12:14:53', '1'), + ('311', '1429', '2006-02-16T02:30:53', '2005-07-31T13:53:33', '2005-08-09T15:55:33', '1'), + ('311', '1013', '2006-02-16T02:30:53', '2005-07-31T00:02:38', '2005-08-06T06:01:38', '1'), + ('311', '3683', '2006-02-16T02:30:53', '2005-07-11T23:36:38', '2005-07-13T03:23:38', '1'), + ('311', '2756', '2006-02-16T02:30:53', '2005-07-08T18:09:08', '2005-07-15T20:19:08', '1'), + ('311', '3568', '2006-02-16T02:30:53', '2005-08-21T14:57:03', '2005-08-24T13:52:03', '2'), + ('311', '1661', '2006-02-16T02:30:53', '2005-08-19T07:31:46', '2005-08-24T09:20:46', '2'), + ('311', '4171', '2006-02-16T02:30:53', '2005-05-30T23:25:14', '2005-06-06T18:41:14', '2'), + ('311', '811', '2006-02-16T02:30:53', '2005-06-17T08:40:22', '2005-06-19T10:47:22', '1'), + ('311', '4483', '2006-02-16T02:30:53', '2005-07-31T21:56:10', '2005-08-06T21:20:10', '1'), + ('311', '656', '2006-02-16T02:30:53', '2005-05-26T16:48:51', '2005-06-03T18:17:51', '1'), + ('311', '1774', '2006-02-16T02:30:53', '2005-06-16T07:33:18', '2005-06-21T07:23:18', '1'), + ('81', '4339', '2006-02-16T02:30:53', '2005-08-01T09:17:21', '2005-08-06T10:30:21', '1'), + ('81', '4515', '2006-02-16T02:30:53', '2005-08-23T16:07:15', '2005-08-25T19:36:15', '2'), + ('81', '3191', '2006-02-16T02:30:53', '2005-08-20T13:26:37', '2005-08-27T14:05:37', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['4983', '9454', '7709', '3229', '14642', '14128', '289', '2854', '5468', '3879', '7130', '15224', '15823', '12181', '2714', '14748', '15602', '11837', '15884', '13846', '3083', '10142', '11545', '11394', '4462', '8252', '12841', '7518', '8344', '5858', '8640', '705', '15967', '15968', '244', '6711', '7007', '139', '4574', '8946', '13218', '5495', '11230', '8156', '14115', '7510', '13389', '7496', '9800', '11860', '2557', '6422', '12904', '15025', '7176', '13203', '15006', '7924', '3459', '3540', '5454', '3565', '7182', '2083', '2790', '6726', '10820', '4508', '8438', '3818', '9591', '14323', '4312', '6544', '6850', '11664', '4087', '15502', '5457', '5969', '146', '14523', '13273', '6848', '10663', '9161', '6765', '9294', '7907', '7821', '4158', '4988', '13801', '691', '8414', '8713', '15476', '14559', '12669', '12296']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('81', '1469', '2006-02-16T02:30:53', '2005-07-09T00:34:16', '2005-07-17T03:21:16', '2'), + ('81', '3028', '2006-02-16T02:30:53', '2005-07-30T22:20:09', '2005-08-04T01:33:09', '2'), + ('81', '3800', '2006-02-16T02:30:53', '2005-07-28T04:22:14', '2005-07-31T09:18:14', '2'), + ('81', '2301', '2006-02-16T02:30:53', '2005-06-21T02:20:41', '2005-06-26T00:39:41', '1'), + ('81', '1280', '2006-02-16T02:30:53', '2005-08-21T19:09:40', '2005-08-30T13:25:40', '2'), + ('81', '2594', '2006-02-16T02:30:53', '2005-08-21T01:35:58', '2005-08-21T21:23:58', '2'), + ('81', '2449', '2006-02-16T02:30:53', '2005-05-26T20:01:09', '2005-05-28T15:09:09', '1'), + ('81', '4453', '2006-02-16T02:30:53', '2005-06-19T23:11:48', '2005-06-23T19:37:48', '2'), + ('81', '2196', '2006-02-16T02:30:53', '2005-07-09T23:06:09', '2005-07-13T00:48:09', '1'), + ('81', '1376', '2006-02-16T02:30:53', '2005-07-06T18:31:20', '2005-07-09T19:03:20', '2'), + ('81', '420', '2006-02-16T02:30:53', '2005-07-27T06:23:36', '2005-07-28T10:23:36', '1'), + ('81', '33', '2006-02-16T02:30:53', '2005-08-22T17:18:05', '2005-08-29T14:35:05', '2'), + ('81', '3047', '2006-02-16T02:30:53', '2005-08-23T15:08:00', '2005-08-24T17:52:00', '2'), + ('81', '532', '2006-02-16T02:30:53', '2005-08-18T01:28:18', '2005-08-23T21:17:18', '2'), + ('81', '2853', '2006-02-16T02:30:53', '2005-06-19T14:26:09', '2005-06-23T17:24:09', '2'), + ('81', '1697', '2006-02-16T02:30:53', '2005-08-21T23:02:02', '2005-08-28T05:01:02', '2'), + ('81', '1429', '2006-02-16T02:30:53', '2005-08-23T06:41:07', '2005-08-24T07:16:07', '1'), + ('81', '1085', '2006-02-16T02:30:53', '2005-08-17T13:04:41', '2005-08-26T14:19:41', '1'), + ('81', '2255', '2006-02-16T02:30:53', '2005-08-23T16:45:28', '2005-08-27T20:18:28', '1'), + ('257', '3289', '2006-02-16T02:30:53', '2005-08-20T14:32:31', '2005-08-28T16:58:31', '1'), + ('257', '2896', '2006-02-16T02:30:53', '2005-06-20T15:33:47', '2005-06-26T16:14:47', '2'), + ('257', '1839', '2006-02-16T02:30:53', '2005-07-31T22:10:54', '2005-08-09T19:04:54', '2'), + ('257', '3198', '2006-02-16T02:30:53', '2005-08-17T00:56:06', '2005-08-25T22:47:06', '1'), + ('257', '2087', '2006-02-16T02:30:53', '2005-08-02T18:44:45', '2005-08-06T22:51:45', '2'), + ('257', '4120', '2006-02-16T02:30:53', '2005-07-08T00:02:49', '2005-07-15T20:48:49', '2'), + ('257', '3312', '2006-02-16T02:30:53', '2005-07-29T00:54:17', '2005-07-31T20:34:17', '1'), + ('257', '4233', '2006-02-16T02:30:53', '2005-08-19T01:55:55', '2005-08-24T02:56:55', '1'), + ('257', '2676', '2006-02-16T02:30:53', '2005-07-27T21:01:16', '2005-08-03T15:26:16', '1'), + ('257', '221', '2006-02-16T02:30:53', '2005-07-29T04:45:25', '2005-08-06T01:53:25', '1'), + ('257', '2913', '2006-02-16T02:30:53', '2005-07-10T18:00:07', '2005-07-11T20:01:07', '2'), + ('257', '1874', '2006-02-16T02:30:53', '2005-07-29T14:34:17', '2005-08-01T13:09:17', '2'), + ('257', '2809', '2006-02-16T02:30:53', '2005-05-29T02:48:52', '2005-05-30T06:21:52', '1'), + ('257', '321', '2006-02-16T02:30:53', '2005-08-23T19:50:06', '2005-08-29T14:51:06', '1'), + ('257', '3598', '2006-02-16T02:30:53', '2005-08-23T19:51:29', '2005-08-24T15:07:29', '1'), + ('257', '1041', '2006-02-16T02:30:53', '2005-05-26T13:40:40', '2005-05-31T11:58:40', '1'), + ('257', '2247', '2006-02-16T02:30:53', '2005-07-12T13:23:40', '2005-07-20T11:45:40', '2'), + ('257', '4186', '2006-02-16T02:30:53', '2005-07-27T01:43:39', '2005-07-31T21:04:39', '1'), + ('257', '327', '2006-02-16T02:30:53', '2005-05-25T23:00:21', '2005-05-29T17:12:21', '1'), + ('257', '536', '2006-02-16T02:30:53', '2005-07-08T05:39:42', '2005-07-08T23:44:42', '2'), + ('257', '3510', '2006-02-16T02:30:53', '2005-07-30T03:14:53', '2005-08-04T00:50:53', '1'), + ('257', '4148', '2006-02-16T02:30:53', '2005-08-19T15:39:39', '2005-08-22T17:28:39', '1'), + ('257', '2199', '2006-02-16T02:30:53', '2005-07-10T00:16:54', '2005-07-19T01:22:54', '2'), + ('257', '1463', '2006-02-16T02:30:53', '2005-08-02T12:59:08', '2005-08-04T13:42:08', '1'), + ('257', '1977', '2006-02-16T02:30:53', '2005-07-28T20:59:04', '2005-08-01T01:52:04', '1'), + ('257', '1945', '2006-02-16T02:30:53', '2005-08-21T01:10:29', '2005-08-24T01:21:29', '1'), + ('257', '1617', '2006-02-16T02:30:53', '2005-07-27T20:37:57', '2005-08-01T17:14:57', '2'), + ('257', '3352', '2006-02-16T02:30:53', '2005-08-19T21:52:51', '2005-08-25T02:38:51', '1'), + ('257', '2449', '2006-02-16T02:30:53', '2005-07-27T20:04:05', '2005-08-02T20:12:05', '1'), + ('257', '2153', '2006-02-16T02:30:53', '2005-07-31T11:00:58', '2005-08-02T10:13:58', '2'), + ('257', '4354', '2006-02-16T02:30:53', '2005-08-17T13:52:26', '2005-08-24T14:47:26', '1'), + ('257', '4546', '2006-02-16T02:30:53', '2005-06-19T03:08:51', '2005-06-20T07:59:51', '1'), + ('257', '762', '2006-02-16T02:30:53', '2005-07-11T23:46:19', '2005-07-20T22:12:19', '1'), + ('257', '459', '2006-02-16T02:30:53', '2005-08-19T04:10:50', '2005-08-27T23:24:50', '1'), + ('257', '2107', '2006-02-16T02:30:53', '2005-08-22T08:57:24', '2005-08-24T06:09:24', '2'), + ('257', '227', '2006-02-16T02:30:53', '2005-07-27T08:04:28', '2005-07-29T14:00:28', '2'), + ('257', '804', '2006-02-16T02:30:53', '2005-08-19T15:00:58', '2005-08-27T15:38:58', '2'), + ('97', '2967', '2006-02-16T02:30:53', '2005-08-22T08:20:15', '2005-08-23T11:57:15', '1'), + ('97', '656', '2006-02-16T02:30:53', '2005-07-28T12:08:53', '2005-07-30T06:45:53', '2'), + ('97', '3080', '2006-02-16T02:30:53', '2005-06-21T21:45:47', '2005-06-25T00:46:47', '1'), + ('97', '1295', '2006-02-16T02:30:53', '2005-07-06T01:47:20', '2005-07-08T23:48:20', '2'), + ('97', '3049', '2006-02-16T02:30:53', '2005-07-09T22:24:25', '2005-07-11T01:52:25', '1'), + ('97', '599', '2006-02-16T02:30:53', '2005-07-06T03:02:58', '2005-07-13T21:31:58', '2'), + ('97', '3209', '2006-02-16T02:30:53', '2005-07-27T08:15:38', '2005-08-03T12:48:38', '2'), + ('97', '2423', '2006-02-16T02:30:53', '2005-06-17T17:14:00', '2005-06-18T18:31:00', '2'), + ('97', '202', '2006-02-16T02:30:53', '2005-06-19T18:49:45', '2005-06-21T00:13:45', '1'), + ('97', '4494', '2006-02-16T02:30:53', '2005-07-12T13:48:14', '2005-07-16T11:11:14', '1'), + ('97', '1487', '2006-02-16T02:30:53', '2005-08-01T22:53:40', '2005-08-02T17:59:40', '2'), + ('97', '3996', '2006-02-16T02:30:53', '2005-07-08T02:28:41', '2005-07-16T23:59:41', '1'), + ('97', '720', '2006-02-16T02:30:53', '2005-07-29T07:25:42', '2005-08-04T07:39:42', '1'), + ('97', '653', '2006-02-16T02:30:53', '2005-07-06T15:33:31', '2005-07-11T16:35:31', '1'), + ('97', '504', '2006-02-16T02:30:53', '2005-07-31T03:19:28', '2005-08-01T07:30:28', '1'), + ('97', '1257', '2006-02-16T02:30:53', '2005-08-21T08:08:43', '2005-08-25T10:44:43', '1'), + ('97', '3870', '2006-02-16T02:30:53', '2005-07-07T17:34:59', '2005-07-09T17:45:59', '2'), + ('97', '1218', '2006-02-16T02:30:53', '2005-07-12T04:56:15', '2005-07-17T08:28:15', '1'), + ('433', '1145', '2006-02-16T02:30:53', '2005-07-12T19:30:42', '2005-07-17T21:26:42', '2'), + ('433', '1343', '2006-02-16T02:30:53', '2005-08-17T05:35:52', '2005-08-18T02:40:52', '1'), + ('433', '3066', '2006-02-16T02:30:53', '2005-07-07T05:30:56', '2005-07-16T10:20:56', '1'), + ('433', '3219', '2006-02-16T02:30:53', '2005-08-23T02:40:04', '2005-08-31T00:36:04', '2'), + ('433', '4179', '2006-02-16T02:30:53', '2005-07-09T22:33:14', '2005-07-12T02:30:14', '1'), + ('433', '4177', '2006-02-16T02:30:53', '2005-07-11T00:03:22', '2005-07-18T01:28:22', '2'), + ('433', '1431', '2006-02-16T02:30:53', '2005-05-26T00:07:11', '2005-06-04T00:20:11', '2'), + ('433', '345', '2006-02-16T02:30:53', '2005-08-21T15:03:45', '2005-08-22T18:06:45', '2'), + ('433', '4181', '2006-02-16T02:30:53', '2005-08-19T17:49:13', '2005-08-21T14:15:13', '1'), + ('433', '1782', '2006-02-16T02:30:53', '2005-07-12T19:24:07', '2005-07-14T17:03:07', '1'), + ('433', '4258', '2006-02-16T02:30:53', '2005-08-01T16:51:08', '2005-08-08T21:17:08', '2'), + ('433', '969', '2006-02-16T02:30:53', '2005-07-30T11:19:18', '2005-08-02T05:32:18', '1'), + ('433', '2571', '2006-02-16T02:30:53', '2005-07-12T15:30:47', '2005-07-19T14:19:47', '2'), + ('433', '2468', '2006-02-16T02:30:53', '2005-07-30T16:14:37', '2005-08-07T18:49:37', '1'), + ('433', '3252', '2006-02-16T02:30:53', '2005-07-28T11:32:00', '2005-07-30T15:27:00', '1'), + ('433', '1184', '2006-02-16T02:30:53', '2005-07-28T08:31:23', '2005-08-03T05:08:23', '2'), + ('433', '291', '2006-02-16T02:30:53', '2005-07-07T09:05:42', '2005-07-09T04:28:42', '1'), + ('433', '2718', '2006-02-16T02:30:53', '2005-07-09T00:46:14', '2005-07-16T01:45:14', '2'), + ('433', '1464', '2006-02-16T02:30:53', '2005-08-20T12:40:53', '2005-08-21T16:29:53', '1'), + ('433', '4034', '2006-02-16T02:30:53', '2005-05-29T01:01:26', '2005-06-07T06:21:26', '1'), + ('433', '1337', '2006-02-16T02:30:53', '2005-07-29T06:48:35', '2005-08-06T10:54:35', '2'), + ('433', '473', '2006-02-16T02:30:53', '2005-07-29T17:31:19', '2005-08-02T16:37:19', '2'), + ('433', '2478', '2006-02-16T02:30:53', '2005-08-23T01:45:07', '2005-08-26T21:07:07', '2'), + ('433', '3842', '2006-02-16T02:30:53', '2005-08-21T16:11:35', '2005-08-30T15:26:35', '1'), + ('433', '4530', '2006-02-16T02:30:53', '2005-08-18T19:17:47', '2005-08-24T14:55:47', '1'), + ('258', '2091', '2006-02-16T02:30:53', '2005-08-18T05:16:28', '2005-08-22T10:32:28', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['10393', '10315', '4677', '2931', '5312', '10325', '6012', '9069', '12246', '10332', '4897', '5935', '7814', '13695', '5674', '4408', '13897', '13491', '2678', '14901', '8675', '1743', '10293', '8591', '9558', '14836', '8546', '10915', '14484', '11910', '11769', '6970', '11650', '11270', '13537', '15466', '8886', '2825', '11409', '4938', '4865', '2969', '10537', '14860', '10709', '3805', '2943', '6150', '13312', '15957', '11322', '4852', '13970', '5864', '13839', '11417', '10009', '13838', '5085', '2239', '656', '9333', '9172', '8215', '2792', '5744', '3265', '13905', '4765', '192', '5167', '12205', '666', '10249', '14993', '3747', '8810', '13153', '10959', '4801', '15809', '13784', '15960', '2761', '1126', '13587', '10508', '2281', '10527', '3304', '2096', '12273', '7978', '4863', '4144', '11538', '1561', '3369', '2269', '1906']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('258', '808', '2006-02-16T02:30:53', '2005-08-01T06:52:50', '2005-08-05T08:45:50', '1'), + ('258', '895', '2006-02-16T02:30:53', '2005-08-01T04:34:45', '2005-08-07T05:27:45', '1'), + ('258', '1226', '2006-02-16T02:30:53', '2005-07-08T10:30:36', '2005-07-14T12:40:36', '1'), + ('258', '3122', '2006-02-16T02:30:53', '2005-06-20T04:50:45', '2005-06-29T09:18:45', '1'), + ('258', '2123', '2006-02-16T02:30:53', '2005-07-09T16:03:09', '2005-07-13T16:41:09', '2'), + ('258', '2749', '2006-02-16T02:30:53', '2005-08-01T04:52:12', '2005-08-08T09:31:12', '1'), + ('258', '2609', '2006-02-16T02:30:53', '2005-07-11T02:00:12', '2005-07-17T02:49:12', '2'), + ('258', '1852', '2006-02-16T02:30:53', '2005-07-30T07:39:59', '2005-08-02T04:10:59', '1'), + ('258', '3199', '2006-02-16T02:30:53', '2005-08-18T03:48:41', '2005-08-25T05:12:41', '1'), + ('258', '642', '2006-02-16T02:30:53', '2005-08-01T04:57:32', '2005-08-10T02:42:32', '2'), + ('258', '2950', '2006-02-16T02:30:53', '2005-07-08T20:25:11', '2005-07-09T17:16:11', '1'), + ('258', '3371', '2006-02-16T02:30:53', '2005-07-10T22:11:04', '2005-07-19T18:12:04', '2'), + ('258', '2662', '2006-02-16T02:30:53', '2005-07-28T08:09:48', '2005-08-01T13:14:48', '2'), + ('258', '3114', '2006-02-16T02:30:53', '2005-08-20T09:13:25', '2005-08-27T11:51:25', '2'), + ('258', '548', '2006-02-16T02:30:53', '2005-07-10T08:26:26', '2005-07-16T02:43:26', '1'), + ('258', '2482', '2006-02-16T02:30:53', '2005-07-07T21:41:06', '2005-07-11T00:32:06', '1'), + ('258', '628', '2006-02-16T02:30:53', '2005-08-20T16:02:28', '2005-08-23T14:29:28', '1'), + ('258', '2503', '2006-02-16T02:30:53', '2005-08-20T01:30:56', '2005-08-28T23:26:56', '2'), + ('258', '4230', '2006-02-16T02:30:53', '2005-06-19T12:12:23', '2005-06-21T16:28:23', '2'), + ('258', '4297', '2006-02-16T02:30:53', '2005-08-22T04:31:37', '2005-08-29T08:24:37', '1'), + ('258', '1026', '2006-02-16T02:30:53', '2005-07-29T15:56:18', '2005-07-30T18:50:18', '1'), + ('258', '2777', '2006-02-16T02:30:53', '2005-06-16T16:38:10', '2005-06-17T13:13:10', '1'), + ('258', '1570', '2006-02-16T02:30:53', '2005-08-01T03:44:26', '2005-08-05T04:16:26', '2'), + ('418', '2568', '2006-02-16T02:30:53', '2005-07-29T12:32:33', '2005-08-01T16:19:33', '2'), + ('418', '1161', '2006-02-16T02:30:53', '2005-07-31T02:14:35', '2005-08-06T03:00:35', '1'), + ('418', '4287', '2006-02-16T02:30:53', '2005-08-22T01:52:26', '2005-08-22T23:39:26', '1'), + ('418', '3224', '2006-02-16T02:30:53', '2005-07-29T11:08:48', '2005-08-03T16:50:48', '2'), + ('418', '4568', '2006-02-16T02:30:53', '2005-08-02T02:05:04', '2005-08-10T21:58:04', '2'), + ('418', '3714', '2006-02-16T02:30:53', '2005-08-21T13:47:29', '2005-08-23T18:25:29', '1'), + ('418', '4254', '2006-02-16T02:30:53', '2005-08-17T15:44:37', '2005-08-19T10:58:37', '2'), + ('418', '1406', '2006-02-16T02:30:53', '2005-08-17T10:04:49', '2005-08-20T09:22:49', '1'), + ('418', '17', '2006-02-16T02:30:53', '2005-07-27T00:26:14', '2005-08-03T20:00:14', '2'), + ('418', '3979', '2006-02-16T02:30:53', '2005-08-17T05:00:03', '2005-08-22T01:45:03', '2'), + ('418', '1882', '2006-02-16T02:30:53', '2005-08-02T14:18:07', '2005-08-03T08:20:07', '1'), + ('418', '2521', '2006-02-16T02:30:53', '2005-08-20T03:39:15', '2005-08-23T22:03:15', '2'), + ('418', '571', '2006-02-16T02:30:53', '2005-08-23T01:16:55', '2005-08-29T22:57:55', '1'), + ('418', '1469', '2006-02-16T02:30:53', '2005-07-30T00:36:31', '2005-08-08T06:18:31', '1'), + ('418', '2601', '2006-02-16T02:30:53', '2005-06-19T20:32:19', '2005-06-22T22:32:19', '1'), + ('418', '3691', '2006-02-16T02:30:53', '2005-08-02T19:26:51', '2005-08-07T19:55:51', '1'), + ('418', '2164', '2006-02-16T02:30:53', '2005-07-08T22:32:53', '2005-07-14T16:48:53', '2'), + ('418', '1614', '2006-02-16T02:30:53', '2005-07-08T19:09:04', '2005-07-13T21:25:04', '2'), + ('418', '1748', '2006-02-16T02:30:53', '2005-06-20T07:44:27', '2005-06-22T06:12:27', '2'), + ('418', '2140', '2006-02-16T02:30:53', '2005-08-01T12:22:28', '2005-08-08T07:27:28', '1'), + ('418', '1368', '2006-02-16T02:30:53', '2005-08-22T02:47:07', '2005-08-28T00:00:07', '1'), + ('418', '282', '2006-02-16T02:30:53', '2005-08-01T18:43:57', '2005-08-06T13:17:57', '2'), + ('418', '1716', '2006-02-16T02:30:53', '2005-07-06T15:08:42', '2005-07-07T14:34:42', '1'), + ('418', '2591', '2006-02-16T02:30:53', '2005-06-20T05:43:05', '2005-06-25T04:31:05', '1'), + ('418', '1110', '2006-02-16T02:30:53', '2005-07-11T09:23:56', '2005-07-15T10:56:56', '2'), + ('418', '2891', '2006-02-16T02:30:53', '2005-08-19T19:09:14', '2005-08-23T00:50:14', '2'), + ('418', '74', '2006-02-16T02:30:53', '2005-08-23T19:21:22', '2005-08-31T16:42:22', '1'), + ('418', '761', '2006-02-16T02:30:53', '2005-08-02T16:23:17', '2005-08-09T19:55:17', '2'), + ('418', '3545', '2006-02-16T02:30:53', '2005-07-08T18:43:15', '2005-07-15T18:48:15', '2'), + ('418', '1942', '2006-02-16T02:30:53', '2005-08-20T18:43:34', '2005-08-22T15:17:34', '2'), + ('437', '4380', '2006-02-16T02:30:53', '2005-07-10T18:29:57', '2005-07-19T14:27:57', '2'), + ('437', '1056', '2006-02-16T02:30:53', '2005-08-20T14:23:16', '2005-08-26T19:11:16', '2'), + ('437', '3083', '2006-02-16T02:30:53', '2005-08-02T19:44:46', '2005-08-11T21:43:46', '2'), + ('437', '4441', '2006-02-16T02:30:53', '2005-07-31T18:00:28', '2005-08-08T22:24:28', '2'), + ('437', '1134', '2006-02-16T02:30:53', '2005-08-20T14:22:46', '2005-08-29T12:28:46', '2'), + ('437', '4164', '2006-02-16T02:30:53', '2005-07-09T05:36:49', '2005-07-13T09:26:49', '1'), + ('437', '4419', '2006-02-16T02:30:53', '2005-06-18T04:23:54', '2005-06-26T00:12:54', '2'), + ('437', '2846', '2006-02-16T02:30:53', '2005-05-28T20:18:24', '2005-05-30T16:19:24', '1'), + ('437', '1377', '2006-02-16T02:30:53', '2005-07-30T17:53:45', '2005-07-31T22:35:45', '2'), + ('437', '695', '2006-02-16T02:30:53', '2005-07-30T11:36:38', '2005-08-04T09:39:38', '1'), + ('437', '2921', '2006-02-16T02:30:53', '2005-07-28T23:43:56', '2005-08-03T19:30:56', '2'), + ('437', '3057', '2006-02-16T02:30:53', '2005-06-19T18:52:25', '2005-06-23T17:39:25', '1'), + ('437', '1372', '2006-02-16T02:30:53', '2005-07-10T12:08:33', '2005-07-14T12:34:33', '2'), + ('437', '3637', '2006-02-16T02:30:53', '2005-06-21T04:23:13', '2005-06-28T03:37:13', '1'), + ('437', '2714', '2006-02-16T02:30:53', '2005-08-20T16:12:48', '2005-08-28T16:05:48', '1'), + ('437', '469', '2006-02-16T02:30:53', '2005-07-08T15:08:45', '2005-07-13T10:44:45', '1'), + ('437', '1897', '2006-02-16T02:30:53', '2005-05-26T06:20:37', '2005-06-02T10:57:37', '1'), + ('437', '2485', '2006-02-16T02:30:53', '2005-07-09T09:18:43', '2005-07-14T12:59:43', '2'), + ('437', '774', '2006-02-16T02:30:53', '2005-08-18T02:21:08', '2005-08-27T00:08:08', '2'), + ('437', '3075', '2006-02-16T02:30:53', '2005-05-28T21:48:51', '2005-06-05T16:45:51', '2'), + ('437', '135', '2006-02-16T02:30:53', '2005-08-01T02:35:39', '2005-08-06T06:50:39', '1'), + ('437', '3416', '2006-02-16T02:30:53', '2005-08-22T07:52:18', '2005-08-27T02:13:18', '1'), + ('437', '1093', '2006-02-16T02:30:53', '2005-07-06T12:11:14', '2005-07-09T17:14:14', '2'), + ('431', '1233', '2006-02-16T02:30:53', '2005-07-29T21:45:19', '2005-08-08T01:45:19', '2'), + ('431', '3896', '2006-02-16T02:30:53', '2005-08-19T13:09:47', '2005-08-23T17:35:47', '2'), + ('431', '4233', '2006-02-16T02:30:53', '2005-08-02T03:39:39', '2005-08-11T07:20:39', '1'), + ('431', '761', '2006-02-16T02:30:53', '2005-07-08T16:51:36', '2005-07-13T17:23:36', '1'), + ('431', '1885', '2006-02-16T02:30:53', '2005-08-23T14:42:07', '2005-08-27T15:00:07', '2'), + ('431', '3087', '2006-02-16T02:30:53', '2005-08-20T12:11:28', '2005-08-25T08:11:28', '1'), + ('431', '1497', '2006-02-16T02:30:53', '2005-08-23T19:35:42', '2005-08-26T17:36:42', '2'), + ('431', '2134', '2006-02-16T02:30:53', '2005-06-19T17:22:17', '2005-06-20T20:20:17', '2'), + ('431', '2765', '2006-02-16T02:30:53', '2005-05-31T17:27:45', '2005-06-04T20:06:45', '2'), + ('431', '2455', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('431', '3890', '2006-02-16T02:30:53', '2005-08-01T11:23:27', '2005-08-02T10:17:27', '1'), + ('431', '4212', '2006-02-16T02:30:53', '2005-06-18T06:47:29', '2005-06-20T10:27:29', '2'), + ('431', '4530', '2006-02-16T02:30:53', '2005-08-01T11:55:54', '2005-08-05T15:56:54', '2'), + ('431', '2154', '2006-02-16T02:30:53', '2005-06-21T07:43:40', '2005-06-27T08:06:40', '2'), + ('431', '1069', '2006-02-16T02:30:53', '2005-06-17T18:33:04', '2005-06-21T17:29:04', '2'), + ('431', '3539', '2006-02-16T02:30:53', '2005-08-18T04:40:50', '2005-08-25T01:44:50', '2'), + ('431', '508', '2006-02-16T02:30:53', '2005-07-28T14:16:14', '2005-08-01T12:53:14', '2'), + ('431', '1', '2006-02-16T02:30:53', '2005-07-08T19:03:15', '2005-07-11T21:29:15', '2'), + ('431', '550', '2006-02-16T02:30:53', '2005-07-07T08:25:44', '2005-07-16T13:10:44', '2'), + ('431', '554', '2006-02-16T02:30:53', '2005-08-17T00:44:04', '2005-08-18T03:43:04', '2'), + ('431', '2263', '2006-02-16T02:30:53', '2005-06-16T02:41:30', '2005-06-22T05:19:30', '1'), + ('431', '303', '2006-02-16T02:30:53', '2005-06-21T13:20:31', '2005-06-30T13:45:31', '2'), + ('431', '3088', '2006-02-16T02:30:53', '2005-06-18T06:20:54', '2005-06-25T04:51:54', '2'), + ('455', '1049', '2006-02-16T02:30:53', '2005-06-17T04:53:35', '2005-06-21T01:16:35', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['14294', '4195', '15494', '10436', '13813', '115', '12163', '12314', '6729', '1382', '343', '1802', '7388', '14583', '7905', '11605', '13083', '4861', '8291', '7498', '2356', '4964', '5504', '15101', '8855', '13622', '13267', '3607', '3329', '10606', '4387', '8634', '4016', '5024', '11541', '9361', '5728', '6906', '15005', '4279', '6624', '9428', '4032', '9125', '5252', '14014', '9862', '15545', '8683', '8320', '13596', '11755', '2290', '8350', '4178', '4055', '7655', '2737', '1607', '12784', '8798', '6027', '11165', '10012', '4220', '3872', '14844', '15035', '13690', '5741', '11081', '15289', '11407', '14875', '12807', '993', '12559', '636', '13175', '11487', '9863', '13427', '7491', '11900', '10923', '444', '3552', '13999', '12721', '2215', '3383', '7426', '1082', '7012', '9676', '3547', '12340', '8', '6573', '5651']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('455', '354', '2006-02-16T02:30:53', '2005-08-21T07:07:26', '2005-08-22T02:20:26', '2'), + ('455', '450', '2006-02-16T02:30:53', '2005-07-07T11:00:02', '2005-07-14T16:54:02', '1'), + ('455', '2968', '2006-02-16T02:30:53', '2005-08-23T02:25:09', '2005-08-27T00:18:09', '1'), + ('455', '4026', '2006-02-16T02:30:53', '2005-08-01T08:50:59', '2005-08-04T05:23:59', '1'), + ('455', '601', '2006-02-16T02:30:53', '2005-08-20T13:03:26', '2005-08-25T08:42:26', '1'), + ('455', '749', '2006-02-16T02:30:53', '2005-05-25T19:13:25', '2005-05-29T20:17:25', '1'), + ('455', '1349', '2006-02-16T02:30:53', '2005-08-18T00:46:01', '2005-08-22T06:16:01', '1'), + ('455', '2204', '2006-02-16T02:30:53', '2005-08-18T06:10:02', '2005-08-25T02:48:02', '1'), + ('455', '2495', '2006-02-16T02:30:53', '2005-07-12T13:58:23', '2005-07-19T09:34:23', '2'), + ('455', '3133', '2006-02-16T02:30:53', '2005-06-15T15:18:08', '2005-06-22T09:22:08', '2'), + ('455', '3301', '2006-02-16T02:30:53', '2005-05-27T04:13:41', '2005-05-28T08:34:41', '1'), + ('455', '4174', '2006-02-16T02:30:53', '2005-06-16T20:23:30', '2005-06-21T20:02:30', '1'), + ('455', '4559', '2006-02-16T02:30:53', '2005-07-27T15:54:19', '2005-08-01T17:02:19', '2'), + ('455', '1203', '2006-02-16T02:30:53', '2005-08-21T17:11:47', '2005-08-24T16:16:47', '2'), + ('455', '4287', '2006-02-16T02:30:53', '2005-07-28T11:26:57', '2005-08-02T06:14:57', '1'), + ('455', '1292', '2006-02-16T02:30:53', '2005-08-17T03:30:57', '2005-08-24T07:02:57', '2'), + ('455', '3469', '2006-02-16T02:30:53', '2005-08-19T10:26:45', '2005-08-23T05:31:45', '2'), + ('455', '2984', '2006-02-16T02:30:53', '2005-07-08T18:57:30', '2005-07-16T15:12:30', '2'), + ('455', '2817', '2006-02-16T02:30:53', '2005-07-29T02:28:25', '2005-08-03T20:57:25', '2'), + ('455', '1144', '2006-02-16T02:30:53', '2005-07-27T20:09:31', '2005-07-29T23:38:31', '1'), + ('455', '2207', '2006-02-16T02:30:53', '2005-06-18T12:59:23', '2005-06-21T10:12:23', '2'), + ('455', '1033', '2006-02-16T02:30:53', '2005-07-08T23:46:38', '2005-07-09T22:19:38', '2'), + ('455', '3053', '2006-02-16T02:30:53', '2005-07-10T00:36:38', '2005-07-16T19:36:38', '1'), + ('335', '683', '2006-02-16T02:30:53', '2005-08-22T11:56:02', '2005-08-28T13:08:02', '2'), + ('335', '4388', '2006-02-16T02:30:53', '2005-07-29T23:40:10', '2005-08-02T18:07:10', '2'), + ('335', '3355', '2006-02-16T02:30:53', '2005-08-20T06:45:32', '2005-08-25T02:40:32', '1'), + ('335', '550', '2006-02-16T02:30:53', '2005-08-19T17:31:36', '2005-08-21T13:47:36', '1'), + ('335', '542', '2006-02-16T02:30:53', '2005-07-06T05:30:09', '2005-07-08T01:36:09', '2'), + ('335', '3506', '2006-02-16T02:30:53', '2005-06-21T09:20:31', '2005-06-22T10:00:31', '2'), + ('335', '81', '2006-02-16T02:30:53', '2005-08-01T14:39:15', '2005-08-08T11:31:15', '1'), + ('335', '591', '2006-02-16T02:30:53', '2005-07-07T20:56:47', '2005-07-16T00:51:47', '1'), + ('335', '2023', '2006-02-16T02:30:53', '2005-07-29T14:19:57', '2005-08-07T13:44:57', '1'), + ('335', '3318', '2006-02-16T02:30:53', '2005-07-07T01:05:50', '2005-07-09T05:59:50', '1'), + ('335', '2987', '2006-02-16T02:30:53', '2005-07-09T02:25:12', '2005-07-12T03:15:12', '1'), + ('335', '2026', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), + ('335', '4163', '2006-02-16T02:30:53', '2005-07-30T18:43:49', '2005-08-06T21:24:49', '1'), + ('335', '636', '2006-02-16T02:30:53', '2005-07-10T11:26:14', '2005-07-15T12:55:14', '1'), + ('335', '1435', '2006-02-16T02:30:53', '2005-07-12T22:03:02', '2005-07-15T00:35:02', '1'), + ('335', '2897', '2006-02-16T02:30:53', '2005-08-22T08:15:44', '2005-08-24T09:52:44', '2'), + ('335', '581', '2006-02-16T02:30:53', '2005-07-07T15:01:53', '2005-07-08T09:43:53', '1'), + ('335', '3946', '2006-02-16T02:30:53', '2005-07-12T09:05:50', '2005-07-18T13:59:50', '2'), + ('335', '1948', '2006-02-16T02:30:53', '2005-07-30T21:18:37', '2005-08-05T16:09:37', '1'), + ('335', '2628', '2006-02-16T02:30:53', '2005-07-07T02:34:13', '2005-07-14T22:43:13', '1'), + ('335', '333', '2006-02-16T02:30:53', '2005-07-30T09:43:39', '2005-08-07T14:02:39', '1'), + ('335', '2581', '2006-02-16T02:30:53', '2005-07-09T13:40:44', '2005-07-14T09:41:44', '1'), + ('335', '2188', '2006-02-16T02:30:53', '2005-08-20T20:47:09', '2005-08-21T22:08:09', '2'), + ('513', '474', '2006-02-16T02:30:53', '2005-07-31T13:05:03', '2005-08-01T09:05:03', '2'), + ('513', '843', '2006-02-16T02:30:53', '2005-08-23T04:20:16', '2005-08-29T08:22:16', '1'), + ('513', '3915', '2006-02-16T02:30:53', '2005-07-29T16:15:43', '2005-08-07T19:19:43', '1'), + ('513', '1285', '2006-02-16T02:30:53', '2005-07-29T03:49:58', '2005-08-03T01:00:58', '1'), + ('513', '482', '2006-02-16T02:30:53', '2005-08-20T05:58:58', '2005-08-27T08:35:58', '1'), + ('513', '3457', '2006-02-16T02:30:53', '2005-08-17T09:15:35', '2005-08-23T06:28:35', '2'), + ('513', '200', '2006-02-16T02:30:53', '2005-06-18T07:34:37', '2005-06-26T11:45:37', '1'), + ('513', '3726', '2006-02-16T02:30:53', '2005-07-29T04:50:39', '2005-07-31T05:36:39', '2'), + ('513', '2898', '2006-02-16T02:30:53', '2005-07-07T10:14:31', '2005-07-12T09:38:31', '2'), + ('513', '2561', '2006-02-16T02:30:53', '2005-07-07T03:49:13', '2005-07-11T03:15:13', '2'), + ('513', '2665', '2006-02-16T02:30:53', '2005-07-28T02:01:11', '2005-07-30T23:12:11', '2'), + ('513', '3131', '2006-02-16T02:30:53', '2005-06-19T15:48:33', '2005-06-26T18:44:33', '2'), + ('513', '3289', '2006-02-16T02:30:53', '2005-06-16T06:25:35', '2005-06-20T02:50:35', '2'), + ('513', '447', '2006-02-16T02:30:53', '2005-08-19T00:02:46', '2005-08-20T04:39:46', '1'), + ('513', '800', '2006-02-16T02:30:53', '2005-07-29T21:15:38', '2005-08-05T02:46:38', '2'), + ('513', '4536', '2006-02-16T02:30:53', '2005-07-11T02:26:29', '2005-07-18T23:05:29', '1'), + ('513', '2059', '2006-02-16T02:30:53', '2005-08-02T10:12:17', '2005-08-04T11:09:17', '1'), + ('513', '2554', '2006-02-16T02:30:53', '2005-07-31T18:06:06', '2005-08-09T16:47:06', '2'), + ('513', '821', '2006-02-16T02:30:53', '2005-07-07T12:12:36', '2005-07-10T13:37:36', '1'), + ('513', '1785', '2006-02-16T02:30:53', '2005-07-06T18:00:19', '2005-07-07T17:26:19', '1'), + ('513', '145', '2006-02-16T02:30:53', '2005-08-22T02:09:12', '2005-08-31T05:43:12', '1'), + ('513', '339', '2006-02-16T02:30:53', '2005-08-22T09:34:32', '2005-08-28T10:23:32', '1'), + ('513', '3721', '2006-02-16T02:30:53', '2005-08-20T09:07:27', '2005-08-23T08:03:27', '2'), + ('513', '2041', '2006-02-16T02:30:53', '2005-07-10T11:55:40', '2005-07-16T15:02:40', '2'), + ('513', '3804', '2006-02-16T02:30:53', '2005-08-02T07:30:14', '2005-08-09T08:50:14', '1'), + ('513', '1026', '2006-02-16T02:30:53', '2005-08-22T19:27:24', '2005-08-30T22:21:24', '1'), + ('513', '3437', '2006-02-16T02:30:53', '2005-08-02T19:18:43', '2005-08-08T16:15:43', '2'), + ('513', '3912', '2006-02-16T02:30:53', '2005-08-22T03:34:39', '2005-08-26T03:40:39', '1'), + ('513', '2323', '2006-02-16T02:30:53', '2005-08-19T00:38:46', '2005-08-28T03:37:46', '2'), + ('513', '2080', '2006-02-16T02:30:53', '2005-05-30T23:54:19', '2005-06-04T21:27:19', '1'), + ('513', '39', '2006-02-16T02:30:53', '2005-08-18T14:53:58', '2005-08-25T20:22:58', '1'), + ('239', '4213', '2006-02-16T02:30:53', '2005-05-28T17:47:58', '2005-06-04T16:32:58', '1'), + ('239', '3187', '2006-02-16T02:30:53', '2005-08-19T13:54:53', '2005-08-20T16:25:53', '2'), + ('239', '734', '2006-02-16T02:30:53', '2005-08-02T22:35:05', '2005-08-08T00:54:05', '2'), + ('239', '19', '2006-02-16T02:30:53', '2005-07-31T13:05:29', '2005-08-08T12:33:29', '1'), + ('239', '3120', '2006-02-16T02:30:53', '2005-08-19T23:19:02', '2005-08-21T18:30:02', '1'), + ('239', '4261', '2006-02-16T02:30:53', '2005-07-27T19:53:23', '2005-07-28T23:25:23', '2'), + ('239', '1931', '2006-02-16T02:30:53', '2005-08-17T15:30:44', '2005-08-19T16:12:44', '1'), + ('239', '2602', '2006-02-16T02:30:53', '2005-08-02T02:15:01', '2005-08-03T04:18:01', '1'), + ('239', '723', '2006-02-16T02:30:53', '2005-05-27T18:39:15', '2005-06-01T15:56:15', '1'), + ('239', '1099', '2006-02-16T02:30:53', '2005-07-06T02:34:09', '2005-07-12T05:31:09', '1'), + ('239', '4149', '2006-02-16T02:30:53', '2005-08-20T19:53:32', '2005-08-26T19:01:32', '1'), + ('239', '1045', '2006-02-16T02:30:53', '2005-08-18T21:30:12', '2005-08-22T22:45:12', '1'), + ('239', '2060', '2006-02-16T02:30:53', '2005-06-18T02:48:21', '2005-06-22T01:03:21', '2'), + ('239', '2968', '2006-02-16T02:30:53', '2005-06-21T14:07:19', '2005-06-29T17:00:19', '2'), + ('239', '4420', '2006-02-16T02:30:53', '2005-07-27T17:19:46', '2005-07-29T21:41:46', '1'), + ('239', '4510', '2006-02-16T02:30:53', '2005-05-31T11:02:01', '2005-06-05T08:43:01', '1'), + ('239', '779', '2006-02-16T02:30:53', '2005-07-27T02:01:03', '2005-08-05T07:34:03', '2'), + ('239', '681', '2006-02-16T02:30:53', '2005-07-31T06:39:13', '2005-08-05T09:31:13', '2'), + ('239', '2730', '2006-02-16T02:30:53', '2005-07-06T02:18:06', '2005-07-08T05:24:06', '1'), + ('239', '3561', '2006-02-16T02:30:53', '2005-08-18T07:07:01', '2005-08-20T05:06:01', '1'), + ('239', '2346', '2006-02-16T02:30:53', '2005-05-24T23:31:46', '2005-05-27T23:33:46', '2'), + ('239', '3308', '2006-02-16T02:30:53', '2005-07-12T06:03:40', '2005-07-13T11:49:40', '2'), + ('239', '301', '2006-02-16T02:30:53', '2005-07-10T07:17:13', '2005-07-15T12:13:13', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['1560', '14062', '621', '10755', '1022', '4920', '1160', '11968', '5960', '2390', '8457', '15991', '2939', '1715', '12519', '8792', '7787', '11712', '10700', '10805', '8039', '5579', '15798', '14505', '9015', '314', '3406', '13841', '1217', '4136', '8463', '13609', '3239', '12825', '8780', '11174', '5450', '3024', '8017', '14755', '2243', '9835', '12175', '13681', '1980', '15863', '1670', '15179', '14939', '9557', '14307', '862', '8577', '13907', '5985', '15694', '2755', '6783', '9972', '1467', '1153', '10873', '14337', '387', '15022', '11781', '2824', '13767', '9654', '11238', '410', '15572', '14395', '14074', '8096', '8506', '1446', '7020', '114', '547', '12994', '1042', '10477', '4640', '907', '4594', '13073', '1565', '4806', '13810', '13828', '13731', '5999', '7365', '14172', '15419', '3155', '10432', '6028', '548']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('239', '3418', '2006-02-16T02:30:53', '2005-06-16T02:36:43', '2005-06-24T23:10:43', '2'), + ('239', '2841', '2006-02-16T02:30:53', '2005-08-20T22:34:34', '2005-08-25T17:11:34', '2'), + ('239', '1144', '2006-02-16T02:30:53', '2005-05-28T15:58:12', '2005-05-30T21:54:12', '1'), + ('239', '1217', '2006-02-16T02:30:53', '2005-08-01T20:14:14', '2005-08-07T01:04:14', '1'), + ('239', '842', '2006-02-16T02:30:53', '2005-05-31T03:16:45', '2005-06-08T09:04:45', '1'), + ('239', '4285', '2006-02-16T02:30:53', '2005-07-08T21:42:10', '2005-07-15T03:08:10', '1'), + ('239', '2795', '2006-02-16T02:30:53', '2005-06-14T23:00:34', '2005-06-18T01:58:34', '2'), + ('239', '698', '2006-02-16T02:30:53', '2005-08-17T17:47:34', '2005-08-18T19:40:34', '1'), + ('239', '3884', '2006-02-16T02:30:53', '2005-07-10T23:38:34', '2005-07-11T19:21:34', '1'), + ('239', '2748', '2006-02-16T02:30:53', '2005-06-18T15:29:26', '2005-06-23T17:50:26', '1'), + ('239', '3371', '2006-02-16T02:30:53', '2005-07-29T07:59:03', '2005-08-04T08:42:03', '1'), + ('203', '2078', '2006-02-16T02:30:53', '2005-08-23T20:27:34', '2005-08-28T16:48:34', '2'), + ('203', '2638', '2006-02-16T02:30:53', '2005-06-20T05:18:16', '2005-06-26T06:56:16', '1'), + ('203', '1594', '2006-02-16T02:30:53', '2005-06-16T14:37:12', '2005-06-20T19:36:12', '1'), + ('203', '2394', '2006-02-16T02:30:53', '2005-08-18T13:42:14', '2005-08-24T16:44:14', '1'), + ('203', '3764', '2006-02-16T02:30:53', '2005-07-29T20:56:14', '2005-08-07T16:44:14', '2'), + ('203', '2191', '2006-02-16T02:30:53', '2005-07-28T07:19:02', '2005-08-06T02:38:02', '2'), + ('203', '3607', '2006-02-16T02:30:53', '2005-08-17T07:32:51', '2005-08-21T09:18:51', '2'), + ('203', '4259', '2006-02-16T02:30:53', '2005-08-01T18:26:31', '2005-08-07T19:51:31', '2'), + ('203', '557', '2006-02-16T02:30:53', '2005-08-01T22:23:37', '2005-08-05T01:22:37', '2'), + ('203', '1996', '2006-02-16T02:30:53', '2005-07-28T16:35:16', '2005-07-30T14:49:16', '1'), + ('203', '945', '2006-02-16T02:30:53', '2005-07-10T04:04:29', '2005-07-14T04:31:29', '1'), + ('203', '3803', '2006-02-16T02:30:53', '2005-08-23T14:23:03', '2005-08-30T17:39:03', '2'), + ('203', '2172', '2006-02-16T02:30:53', '2005-08-21T14:26:28', '2005-08-29T17:34:28', '1'), + ('203', '4128', '2006-02-16T02:30:53', '2005-07-30T05:21:32', '2005-08-08T07:03:32', '2'), + ('203', '2851', '2006-02-16T02:30:53', '2005-05-26T23:09:41', '2005-05-28T22:49:41', '2'), + ('203', '2049', '2006-02-16T02:30:53', '2005-06-21T16:00:18', '2005-06-23T18:25:18', '1'), + ('203', '3277', '2006-02-16T02:30:53', '2005-08-20T14:25:18', '2005-08-29T15:49:18', '1'), + ('203', '600', '2006-02-16T02:30:53', '2005-06-15T03:24:14', '2005-06-18T22:37:14', '2'), + ('203', '3461', '2006-02-16T02:30:53', '2005-07-07T08:15:52', '2005-07-10T04:22:52', '2'), + ('203', '466', '2006-02-16T02:30:53', '2005-07-29T08:17:51', '2005-08-03T13:41:51', '1'), + ('328', '299', '2006-02-16T02:30:53', '2005-08-20T06:11:51', '2005-08-23T04:13:51', '2'), + ('328', '3402', '2006-02-16T02:30:53', '2005-06-21T02:48:40', '2005-06-22T02:49:40', '2'), + ('328', '4495', '2006-02-16T02:30:53', '2005-08-19T01:23:58', '2005-08-20T00:19:58', '2'), + ('328', '1095', '2006-02-16T02:30:53', '2005-07-29T20:19:45', '2005-08-03T22:22:45', '2'), + ('328', '1551', '2006-02-16T02:30:53', '2005-08-02T10:32:11', '2005-08-09T12:30:11', '1'), + ('328', '2356', '2006-02-16T02:30:53', '2005-07-09T22:13:25', '2005-07-13T23:28:25', '1'), + ('328', '1966', '2006-02-16T02:30:53', '2005-06-20T11:29:17', '2005-06-27T12:51:17', '2'), + ('328', '1764', '2006-02-16T02:30:53', '2005-07-28T15:35:41', '2005-08-01T19:12:41', '1'), + ('328', '862', '2006-02-16T02:30:53', '2005-08-21T23:18:08', '2005-08-27T01:06:08', '2'), + ('328', '1254', '2006-02-16T02:30:53', '2005-06-18T04:33:03', '2005-06-23T04:14:03', '2'), + ('328', '1051', '2006-02-16T02:30:53', '2005-07-31T12:07:35', '2005-08-04T07:32:35', '2'), + ('328', '4558', '2006-02-16T02:30:53', '2005-08-18T01:10:17', '2005-08-19T05:25:17', '2'), + ('328', '3039', '2006-02-16T02:30:53', '2005-08-20T08:47:37', '2005-08-27T09:47:37', '1'), + ('328', '2985', '2006-02-16T02:30:53', '2005-06-17T09:48:05', '2005-06-23T14:43:05', '1'), + ('328', '2783', '2006-02-16T02:30:53', '2005-08-23T16:17:09', '2005-08-28T16:10:09', '2'), + ('328', '2066', '2006-02-16T02:30:53', '2005-06-16T10:26:33', '2005-06-19T07:15:33', '1'), + ('328', '450', '2006-02-16T02:30:53', '2005-08-22T15:36:22', '2005-08-31T19:57:22', '1'), + ('328', '719', '2006-02-16T02:30:53', '2005-08-22T05:53:52', '2005-08-27T06:20:52', '1'), + ('328', '708', '2006-02-16T02:30:53', '2005-07-31T02:14:01', '2005-08-05T23:55:01', '1'), + ('328', '2894', '2006-02-16T02:30:53', '2005-08-21T07:34:52', '2005-08-29T09:45:52', '1'), + ('328', '1186', '2006-02-16T02:30:53', '2005-05-30T03:09:11', '2005-06-03T21:27:11', '1'), + ('328', '520', '2006-02-16T02:30:53', '2005-07-29T11:56:30', '2005-08-07T15:41:30', '1'), + ('328', '806', '2006-02-16T02:30:53', '2005-08-20T16:17:27', '2005-08-24T20:14:27', '2'), + ('506', '1108', '2006-02-16T02:30:53', '2005-07-11T00:51:58', '2005-07-14T22:02:58', '2'), + ('506', '3017', '2006-02-16T02:30:53', '2005-08-23T10:02:46', '2005-08-31T05:46:46', '2'), + ('506', '946', '2006-02-16T02:30:53', '2005-06-19T16:56:31', '2005-06-27T12:02:31', '2'), + ('506', '3633', '2006-02-16T02:30:53', '2005-07-12T16:27:56', '2005-07-13T12:11:56', '2'), + ('506', '190', '2006-02-16T02:30:53', '2005-07-31T16:42:43', '2005-08-02T11:05:43', '2'), + ('506', '688', '2006-02-16T02:30:53', '2005-06-15T20:47:10', '2005-06-22T00:30:10', '1'), + ('506', '2725', '2006-02-16T02:30:53', '2005-05-31T21:36:44', '2005-06-10T01:26:44', '2'), + ('506', '169', '2006-02-16T02:30:53', '2005-08-02T00:30:34', '2005-08-07T00:16:34', '2'), + ('506', '3529', '2006-02-16T02:30:53', '2005-08-21T08:34:26', '2005-08-24T11:31:26', '1'), + ('506', '2684', '2006-02-16T02:30:53', '2005-05-27T10:35:27', '2005-06-01T13:37:27', '2'), + ('506', '249', '2006-02-16T02:30:53', '2005-08-22T08:55:43', '2005-08-31T05:35:43', '2'), + ('506', '1853', '2006-02-16T02:30:53', '2005-08-17T10:37:00', '2005-08-21T12:03:00', '2'), + ('506', '2878', '2006-02-16T02:30:53', '2005-06-19T20:31:45', '2005-06-29T00:40:45', '2'), + ('506', '2739', '2006-02-16T02:30:53', '2005-08-20T11:43:36', '2005-08-22T17:10:36', '1'), + ('506', '3286', '2006-02-16T02:30:53', '2005-07-31T05:57:42', '2005-08-06T04:19:42', '1'), + ('506', '2705', '2006-02-16T02:30:53', '2005-08-02T13:25:50', '2005-08-08T19:12:50', '2'), + ('506', '4010', '2006-02-16T02:30:53', '2005-05-27T14:11:22', '2005-06-02T20:06:22', '2'), + ('506', '2816', '2006-02-16T02:30:53', '2005-08-23T05:28:01', '2005-08-27T00:14:01', '2'), + ('506', '632', '2006-02-16T02:30:53', '2005-08-21T10:24:00', '2005-08-28T12:23:00', '2'), + ('506', '1303', '2006-02-16T02:30:53', '2005-08-20T23:16:07', '2005-08-26T04:45:07', '1'), + ('506', '502', '2006-02-16T02:30:53', '2005-07-28T18:32:46', '2005-08-06T15:00:46', '1'), + ('506', '3714', '2006-02-16T02:30:53', '2005-07-29T09:23:52', '2005-07-31T04:42:52', '1'), + ('506', '1989', '2006-02-16T02:30:53', '2005-06-15T19:13:45', '2005-06-23T19:43:45', '2'), + ('506', '3965', '2006-02-16T02:30:53', '2005-07-27T02:24:27', '2005-07-29T01:27:27', '2'), + ('506', '4502', '2006-02-16T02:30:53', '2005-05-25T19:12:42', '2005-06-01T23:10:42', '1'), + ('506', '2065', '2006-02-16T02:30:53', '2005-05-28T07:24:28', '2005-06-06T01:31:28', '2'), + ('506', '3809', '2006-02-16T02:30:53', '2005-08-19T07:26:10', '2005-08-20T07:02:10', '2'), + ('506', '3155', '2006-02-16T02:30:53', '2005-05-31T05:53:00', '2005-06-01T05:24:00', '1'), + ('506', '235', '2006-02-16T02:30:53', '2005-08-01T10:04:17', '2005-08-06T11:32:17', '2'), + ('506', '1147', '2006-02-16T02:30:53', '2005-07-08T08:59:34', '2005-07-15T03:31:34', '1'), + ('506', '3320', '2006-02-16T02:30:53', '2005-05-30T10:37:27', '2005-06-02T09:51:27', '1'), + ('506', '26', '2006-02-16T02:30:53', '2005-07-08T06:40:06', '2005-07-16T05:51:06', '2'), + ('506', '855', '2006-02-16T02:30:53', '2005-08-19T10:05:38', '2005-08-26T07:37:38', '2'), + ('506', '3833', '2006-02-16T02:30:53', '2005-06-16T03:13:09', '2005-06-16T22:42:09', '2'), + ('506', '214', '2006-02-16T02:30:53', '2005-07-08T17:01:02', '2005-07-15T21:41:02', '1'), + ('450', '2228', '2006-02-16T02:30:53', '2005-08-20T12:59:38', '2005-08-21T17:40:38', '1'), + ('450', '2391', '2006-02-16T02:30:53', '2005-08-20T13:49:52', '2005-08-25T07:49:52', '2'), + ('450', '1133', '2006-02-16T02:30:53', '2005-08-20T10:22:08', '2005-08-21T12:04:08', '2'), + ('450', '211', '2006-02-16T02:30:53', '2005-07-11T01:21:22', '2005-07-19T01:35:22', '1'), + ('450', '3283', '2006-02-16T02:30:53', '2005-07-27T15:00:20', '2005-07-30T12:58:20', '1'), + ('450', '2158', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('450', '1120', '2006-02-16T02:30:53', '2005-08-22T23:54:36', '2005-08-25T00:52:36', '1'), + ('450', '458', '2006-02-16T02:30:53', '2005-06-20T21:02:38', '2005-06-27T19:34:38', '1'), + ('450', '4238', '2006-02-16T02:30:53', '2005-08-01T08:43:21', '2005-08-08T13:09:21', '2'), + ('450', '784', '2006-02-16T02:30:53', '2005-07-11T02:31:44', '2005-07-14T03:18:44', '1'), + ('450', '3704', '2006-02-16T02:30:53', '2005-05-28T07:34:56', '2005-06-05T03:14:56', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['7626', '2501', '15019', '15327', '2278', '7610', '1639', '1914', '10984', '14282', '3570', '8733', '2626', '1739', '12812', '8533', '2610', '13447', '5477', '8544', '14982', '6325', '376', '5293', '220', '6887', '10280', '11583', '6077', '12819', '11903', '2957', '7672', '10250', '14907', '11016', '1913', '6557', '1533', '2861', '3908', '3940', '13146', '1058', '10801', '2639', '7238', '14763', '13369', '7763', '9562', '12376', '1332', '1762', '4737', '13474', '9245', '4027', '5169', '13775', '8059', '5914', '8358', '617', '7190', '2315', '2959', '13871', '15041', '14037', '8837', '14331', '13402', '5352', '11555', '5501', '5229', '14770', '8009', '12224', '9128', '8724', '638', '5314', '12714', '11438', '3283', '6692', '7735', '14211', '8755', '15563', '11134', '7234', '5412', '6654', '6595', '6250', '14428', '11975']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('450', '4200', '2006-02-16T02:30:53', '2005-07-28T00:49:01', '2005-07-31T00:43:01', '1'), + ('450', '1185', '2006-02-16T02:30:53', '2005-06-18T23:10:11', '2005-06-24T18:40:11', '2'), + ('450', '3425', '2006-02-16T02:30:53', '2005-08-22T08:52:53', '2005-08-25T13:07:53', '2'), + ('450', '1018', '2006-02-16T02:30:53', '2005-08-22T20:31:24', '2005-08-30T23:52:24', '1'), + ('450', '1166', '2006-02-16T02:30:53', '2005-06-18T06:37:57', '2005-06-22T10:57:57', '1'), + ('450', '1279', '2006-02-16T02:30:53', '2005-07-28T00:11:35', '2005-07-31T00:33:35', '1'), + ('450', '176', '2006-02-16T02:30:53', '2005-06-16T08:33:39', '2005-06-25T07:51:39', '1'), + ('450', '3406', '2006-02-16T02:30:53', '2005-06-17T05:25:54', '2005-06-24T04:25:54', '2'), + ('450', '1813', '2006-02-16T02:30:53', '2005-08-02T04:30:02', '2005-08-10T02:51:02', '1'), + ('450', '3107', '2006-02-16T02:30:53', '2005-08-21T06:41:29', '2005-08-22T12:37:29', '1'), + ('450', '1300', '2006-02-16T02:30:53', '2005-07-06T03:23:43', '2005-07-14T07:28:43', '2'), + ('450', '3187', '2006-02-16T02:30:53', '2005-07-29T18:26:34', '2005-08-03T15:06:34', '1'), + ('450', '2816', '2006-02-16T02:30:53', '2005-06-19T08:28:44', '2005-06-24T03:58:44', '1'), + ('450', '2557', '2006-02-16T02:30:53', '2005-06-16T16:09:38', '2005-06-22T18:04:38', '2'), + ('450', '4024', '2006-02-16T02:30:53', '2005-08-19T00:54:02', '2005-08-22T20:35:02', '2'), + ('542', '551', '2006-02-16T02:30:53', '2005-07-29T10:29:16', '2005-08-01T06:52:16', '1'), + ('542', '3845', '2006-02-16T02:30:53', '2005-06-19T07:16:20', '2005-06-25T09:39:20', '2'), + ('542', '285', '2006-02-16T02:30:53', '2005-08-20T00:09:36', '2005-08-25T01:22:36', '1'), + ('542', '994', '2006-02-16T02:30:53', '2005-07-09T23:43:49', '2005-07-15T05:03:49', '2'), + ('542', '412', '2006-02-16T02:30:53', '2005-07-29T11:02:08', '2005-08-06T15:06:08', '2'), + ('542', '2333', '2006-02-16T02:30:53', '2005-08-22T07:20:55', '2005-08-31T04:35:55', '2'), + ('542', '4556', '2006-02-16T02:30:53', '2005-07-11T19:06:01', '2005-07-18T18:25:01', '2'), + ('542', '3197', '2006-02-16T02:30:53', '2005-05-27T08:58:15', '2005-06-02T04:48:15', '1'), + ('542', '2880', '2006-02-16T02:30:53', '2005-07-09T15:17:23', '2005-07-11T11:23:23', '2'), + ('542', '1259', '2006-02-16T02:30:53', '2005-05-26T10:06:49', '2005-06-01T07:43:49', '1'), + ('542', '4487', '2006-02-16T02:30:53', '2005-07-12T21:00:23', '2005-07-21T17:46:23', '1'), + ('542', '1457', '2006-02-16T02:30:53', '2005-08-01T03:27:15', '2005-08-07T23:01:15', '2'), + ('542', '133', '2006-02-16T02:30:53', '2005-08-17T02:08:13', '2005-08-20T23:13:13', '2'), + ('542', '2154', '2006-02-16T02:30:53', '2005-07-11T05:06:08', '2005-07-16T10:29:08', '1'), + ('542', '1117', '2006-02-16T02:30:53', '2005-08-19T01:05:05', '2005-08-22T05:50:05', '1'), + ('542', '1196', '2006-02-16T02:30:53', '2005-08-17T15:37:45', '2005-08-23T18:31:45', '2'), + ('542', '4034', '2006-02-16T02:30:53', '2005-06-20T06:53:47', '2005-06-29T09:21:47', '2'), + ('542', '573', '2006-02-16T02:30:53', '2005-07-28T02:49:41', '2005-08-04T02:38:41', '1'), + ('116', '3706', '2006-02-16T02:30:53', '2005-08-01T02:38:42', '2005-08-07T03:59:42', '2'), + ('116', '2469', '2006-02-16T02:30:53', '2005-08-22T04:44:09', '2005-08-25T09:53:09', '1'), + ('116', '4446', '2006-02-16T02:30:53', '2005-08-02T05:19:13', '2005-08-05T05:31:13', '1'), + ('116', '1825', '2006-02-16T02:30:53', '2005-06-17T05:19:47', '2005-06-21T03:39:47', '1'), + ('116', '1442', '2006-02-16T02:30:53', '2005-07-12T05:12:03', '2005-07-20T06:49:03', '1'), + ('116', '2452', '2006-02-16T02:30:53', '2005-06-16T00:46:02', '2005-06-17T20:11:02', '1'), + ('116', '1489', '2006-02-16T02:30:53', '2005-06-19T23:21:34', '2005-06-26T17:32:34', '1'), + ('116', '3980', '2006-02-16T02:30:53', '2005-07-06T19:47:26', '2005-07-13T19:59:26', '1'), + ('116', '1502', '2006-02-16T02:30:53', '2005-07-06T21:16:59', '2005-07-07T19:17:59', '2'), + ('116', '1463', '2006-02-16T02:30:53', '2005-08-19T12:54:42', '2005-08-26T07:31:42', '1'), + ('116', '40', '2006-02-16T02:30:53', '2005-05-31T08:04:17', '2005-06-03T11:12:17', '2'), + ('116', '3757', '2006-02-16T02:30:53', '2005-08-01T22:09:35', '2005-08-08T22:23:35', '1'), + ('116', '3971', '2006-02-16T02:30:53', '2005-06-19T09:24:02', '2005-06-21T14:16:02', '2'), + ('116', '1197', '2006-02-16T02:30:53', '2005-07-27T10:13:41', '2005-07-29T11:07:41', '1'), + ('116', '1480', '2006-02-16T02:30:53', '2005-08-21T23:34:00', '2005-08-31T03:58:00', '2'), + ('116', '2728', '2006-02-16T02:30:53', '2005-08-19T21:19:47', '2005-08-24T23:25:47', '1'), + ('116', '2461', '2006-02-16T02:30:53', '2005-07-28T06:35:16', '2005-08-03T02:46:16', '2'), + ('116', '1571', '2006-02-16T02:30:53', '2005-07-31T02:23:20', '2005-08-06T21:01:20', '2'), + ('116', '852', '2006-02-16T02:30:53', '2005-08-18T08:20:29', '2005-08-20T13:20:29', '1'), + ('116', '1412', '2006-02-16T02:30:53', '2005-06-15T11:36:01', '2005-06-17T14:29:01', '1'), + ('116', '3050', '2006-02-16T02:30:53', '2005-06-16T17:50:19', '2005-06-19T21:35:19', '2'), + ('116', '4286', '2006-02-16T02:30:53', '2005-07-08T13:23:53', '2005-07-12T18:49:53', '1'), + ('116', '1209', '2006-02-16T02:30:53', '2005-08-20T01:04:32', '2005-08-21T20:26:32', '2'), + ('116', '2586', '2006-02-16T02:30:53', '2005-07-30T14:07:50', '2005-08-06T17:59:50', '2'), + ('116', '56', '2006-02-16T02:30:53', '2005-07-07T02:19:01', '2005-07-10T01:12:01', '1'), + ('116', '2608', '2006-02-16T02:30:53', '2005-07-09T09:22:25', '2005-07-10T03:48:25', '1'), + ('116', '1858', '2006-02-16T02:30:53', '2005-08-20T11:56:30', '2005-08-28T12:48:30', '2'), + ('372', '2611', '2006-02-16T02:30:53', '2005-07-28T17:09:59', '2005-07-31T15:42:59', '2'), + ('372', '2639', '2006-02-16T02:30:53', '2005-07-10T21:01:12', '2005-07-16T18:27:12', '2'), + ('372', '1449', '2006-02-16T02:30:53', '2005-07-29T05:00:58', '2005-08-01T02:49:58', '2'), + ('372', '4142', '2006-02-16T02:30:53', '2005-05-28T15:49:14', '2005-05-31T14:29:14', '2'), + ('372', '1330', '2006-02-16T02:30:53', '2005-07-27T08:36:01', '2005-07-30T08:32:01', '2'), + ('372', '2766', '2006-02-16T02:30:53', '2005-06-18T09:03:39', '2005-06-22T11:18:39', '1'), + ('372', '4185', '2006-02-16T02:30:53', '2005-06-20T07:07:54', '2005-06-27T03:31:54', '1'), + ('372', '3206', '2006-02-16T02:30:53', '2005-08-20T15:10:13', '2005-08-29T19:43:13', '2'), + ('372', '1913', '2006-02-16T02:30:53', '2005-08-22T09:43:18', '2005-08-23T11:04:18', '2'), + ('372', '3655', '2006-02-16T02:30:53', '2005-08-20T21:35:58', '2005-08-29T23:06:58', '2'), + ('372', '42', '2006-02-16T02:30:53', '2005-07-29T22:49:00', '2005-08-07T21:56:00', '2'), + ('372', '3128', '2006-02-16T02:30:53', '2005-08-21T08:29:38', '2005-08-29T13:18:38', '2'), + ('372', '3264', '2006-02-16T02:30:53', '2005-08-19T22:16:53', '2005-08-22T22:28:53', '1'), + ('372', '908', '2006-02-16T02:30:53', '2005-07-09T17:54:58', '2005-07-15T16:20:58', '1'), + ('372', '2569', '2006-02-16T02:30:53', '2005-08-17T01:08:59', '2005-08-18T06:09:59', '2'), + ('372', '3979', '2006-02-16T02:30:53', '2005-07-10T00:33:48', '2005-07-17T02:58:48', '1'), + ('372', '4472', '2006-02-16T02:30:53', '2005-07-09T12:30:18', '2005-07-14T15:31:18', '2'), + ('372', '2977', '2006-02-16T02:30:53', '2005-08-21T23:47:16', '2005-08-25T04:48:16', '1'), + ('372', '337', '2006-02-16T02:30:53', '2005-07-28T15:25:58', '2005-08-04T10:16:58', '2'), + ('372', '1781', '2006-02-16T02:30:53', '2005-08-18T02:59:09', '2005-08-19T06:22:09', '1'), + ('372', '3647', '2006-02-16T02:30:53', '2005-07-30T09:51:14', '2005-08-07T06:23:14', '1'), + ('372', '898', '2006-02-16T02:30:53', '2005-07-29T18:05:21', '2005-08-01T15:41:21', '1'), + ('372', '2685', '2006-02-16T02:30:53', '2005-05-28T18:24:43', '2005-06-02T19:03:43', '2'), + ('372', '3770', '2006-02-16T02:30:53', '2005-07-09T16:05:28', '2005-07-10T18:18:28', '1'), + ('372', '868', '2006-02-16T02:30:53', '2005-08-18T21:08:01', '2005-08-27T17:09:01', '2'), + ('372', '1040', '2006-02-16T02:30:53', '2005-08-02T20:21:08', '2005-08-10T22:12:08', '1'), + ('372', '3988', '2006-02-16T02:30:53', '2005-06-21T06:19:07', '2005-06-26T10:59:07', '2'), + ('372', '2837', '2006-02-16T02:30:53', '2005-07-12T12:35:39', '2005-07-20T11:20:39', '2'), + ('372', '3949', '2006-02-16T02:30:53', '2005-07-28T05:09:56', '2005-07-31T23:34:56', '2'), + ('372', '300', '2006-02-16T02:30:53', '2005-08-21T04:29:11', '2005-08-24T02:50:11', '2'), + ('372', '1498', '2006-02-16T02:30:53', '2005-07-29T19:18:31', '2005-07-31T19:20:31', '2'), + ('372', '170', '2006-02-16T02:30:53', '2005-08-23T05:08:58', '2005-08-24T04:24:58', '1'), + ('372', '2641', '2006-02-16T02:30:53', '2005-08-02T09:19:22', '2005-08-11T03:56:22', '1'), + ('372', '3873', '2006-02-16T02:30:53', '2005-07-27T10:08:45', '2005-07-31T13:58:45', '1'), + ('458', '3174', '2006-02-16T02:30:53', '2005-07-09T20:23:52', '2005-07-18T18:40:52', '1'), + ('458', '2870', '2006-02-16T02:30:53', '2005-07-12T11:06:28', '2005-07-20T10:27:28', '1'), + ('458', '1286', '2006-02-16T02:30:53', '2005-07-12T07:25:48', '2005-07-20T02:24:48', '2'), + ('458', '4087', '2006-02-16T02:30:53', '2005-07-11T15:02:04', '2005-07-17T10:54:04', '1'), + ('458', '1614', '2006-02-16T02:30:53', '2005-08-21T11:27:07', '2005-08-29T09:50:07', '1'), + ('458', '3843', '2006-02-16T02:30:53', '2005-08-17T17:58:39', '2005-08-20T19:11:39', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['7923', '12768', '4525', '11138', '3322', '13571', '6431', '13259', '2629', '5572', '8158', '13487', '15604', '3928', '8613', '5800', '13634', '5357', '14772', '972', '7513', '13246', '7395', '4246', '1985', '2712', '9622', '686', '1997', '7102', '8023', '14480', '11997', '4146', '13656', '7813', '15936', '14996', '11294', '11421', '11741', '13984', '7928', '7215', '9120', '7111', '973', '14202', '4873', '7918', '2748', '2553', '4006', '1748', '14757', '6890', '9025', '4625', '15118', '6446', '11336', '2125', '5447', '14550', '10867', '14658', '15400', '11216', '348', '11006', '16024', '942', '3971', '15206', '3454', '1306', '6240', '7040', '1651', '14680', '5037', '7014', '14178', '118', '14046', '6745', '8507', '6161', '4366', '982', '13626', '14366', '9936', '2649', '7824', '15267', '4670', '14747', '2893', '2945']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('458', '2273', '2006-02-16T02:30:53', '2005-07-28T12:08:29', '2005-08-04T12:30:29', '1'), + ('458', '1993', '2006-02-16T02:30:53', '2005-08-18T23:26:11', '2005-08-19T20:31:11', '2'), + ('458', '3631', '2006-02-16T02:30:53', '2005-07-08T03:15:00', '2005-07-11T04:53:00', '1'), + ('458', '4250', '2006-02-16T02:30:53', '2005-08-02T09:26:16', '2005-08-11T07:50:16', '2'), + ('458', '4324', '2006-02-16T02:30:53', '2005-06-21T08:42:37', '2005-06-22T13:17:37', '1'), + ('458', '1251', '2006-02-16T02:30:53', '2005-08-20T05:05:14', '2005-08-25T03:59:14', '2'), + ('458', '3471', '2006-02-16T02:30:53', '2005-07-12T00:03:57', '2005-07-20T03:47:57', '1'), + ('458', '2518', '2006-02-16T02:30:53', '2005-08-19T17:08:53', '2005-08-23T14:14:53', '1'), + ('458', '1810', '2006-02-16T02:30:53', '2005-06-19T08:42:12', '2005-06-28T03:38:12', '2'), + ('458', '2709', '2006-02-16T02:30:53', '2005-07-10T03:49:00', '2005-07-14T01:25:00', '1'), + ('458', '4327', '2006-02-16T02:30:53', '2005-07-28T21:08:46', '2005-08-01T21:50:46', '2'), + ('458', '2609', '2006-02-16T02:30:53', '2005-08-20T01:27:05', '2005-08-24T00:41:05', '2'), + ('458', '4000', '2006-02-16T02:30:53', '2005-08-23T06:44:19', '2005-08-29T07:17:19', '1'), + ('411', '1960', '2006-02-16T02:30:53', '2005-07-06T20:52:09', '2005-07-08T18:51:09', '1'), + ('411', '394', '2006-02-16T02:30:53', '2005-07-29T13:30:58', '2005-08-05T16:21:58', '2'), + ('411', '2466', '2006-02-16T02:30:53', '2005-07-10T14:58:36', '2005-07-11T19:50:36', '2'), + ('411', '850', '2006-02-16T02:30:53', '2005-08-20T07:16:45', '2005-08-22T03:38:45', '1'), + ('411', '1988', '2006-02-16T02:30:53', '2005-07-09T18:08:59', '2005-07-16T17:28:59', '2'), + ('411', '4047', '2006-02-16T02:30:53', '2005-08-21T23:50:39', '2005-08-30T20:44:39', '2'), + ('411', '2', '2006-02-16T02:30:53', '2005-05-30T20:21:07', '2005-06-06T00:36:07', '1'), + ('411', '939', '2006-02-16T02:30:53', '2005-07-27T20:51:04', '2005-08-03T20:15:04', '2'), + ('411', '1849', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), + ('411', '2888', '2006-02-16T02:30:53', '2005-07-27T16:03:11', '2005-07-31T20:26:11', '2'), + ('411', '1141', '2006-02-16T02:30:53', '2005-07-07T13:49:03', '2005-07-09T13:01:03', '1'), + ('411', '87', '2006-02-16T02:30:53', '2005-06-17T10:31:37', '2005-06-22T11:17:37', '1'), + ('411', '3132', '2006-02-16T02:30:53', '2005-06-19T14:20:13', '2005-06-22T19:08:13', '1'), + ('411', '2255', '2006-02-16T02:30:53', '2005-07-31T04:21:45', '2005-08-02T09:20:45', '1'), + ('411', '2441', '2006-02-16T02:30:53', '2005-05-29T00:27:10', '2005-05-30T02:29:10', '1'), + ('411', '846', '2006-02-16T02:30:53', '2005-06-17T11:19:43', '2005-06-19T14:18:43', '1'), + ('411', '1081', '2006-02-16T02:30:53', '2005-07-27T05:07:21', '2005-08-01T09:41:21', '2'), + ('411', '2133', '2006-02-16T02:30:53', '2005-07-28T15:53:29', '2005-07-31T12:26:29', '1'), + ('411', '229', '2006-02-16T02:30:53', '2005-08-21T13:36:40', '2005-08-26T08:39:40', '1'), + ('411', '2193', '2006-02-16T02:30:53', '2005-08-17T18:34:38', '2005-08-26T00:12:38', '2'), + ('411', '176', '2006-02-16T02:30:53', '2005-07-07T08:30:16', '2005-07-12T07:52:16', '1'), + ('411', '3180', '2006-02-16T02:30:53', '2005-08-20T08:01:07', '2005-08-28T13:16:07', '2'), + ('411', '4216', '2006-02-16T02:30:53', '2005-07-28T08:08:27', '2005-07-30T03:08:27', '2'), + ('411', '1293', '2006-02-16T02:30:53', '2005-08-23T18:43:11', '2005-08-26T00:19:11', '1'), + ('411', '1178', '2006-02-16T02:30:53', '2005-08-22T07:52:41', '2005-08-29T02:35:41', '1'), + ('411', '855', '2006-02-16T02:30:53', '2005-08-02T15:08:27', '2005-08-03T18:28:27', '1'), + ('473', '3361', '2006-02-16T02:30:53', '2005-08-02T19:51:53', '2005-08-12T00:50:53', '2'), + ('473', '1819', '2006-02-16T02:30:53', '2005-08-17T08:48:39', '2005-08-20T07:37:39', '1'), + ('473', '2183', '2006-02-16T02:30:53', '2005-08-20T19:12:30', '2005-08-29T22:04:30', '1'), + ('473', '912', '2006-02-16T02:30:53', '2005-07-28T12:15:51', '2005-08-05T06:34:51', '1'), + ('473', '2713', '2006-02-16T02:30:53', '2005-07-27T09:24:00', '2005-08-05T07:37:00', '2'), + ('473', '139', '2006-02-16T02:30:53', '2005-07-30T09:26:08', '2005-08-08T09:52:08', '1'), + ('473', '1252', '2006-02-16T02:30:53', '2005-07-27T05:38:16', '2005-07-29T04:28:16', '2'), + ('473', '1914', '2006-02-16T02:30:53', '2005-05-30T20:27:45', '2005-06-08T22:47:45', '2'), + ('473', '1995', '2006-02-16T02:30:53', '2005-08-21T03:51:52', '2005-08-22T09:35:52', '1'), + ('473', '4500', '2006-02-16T02:30:53', '2005-07-08T19:23:32', '2005-07-11T15:24:32', '1'), + ('473', '63', '2006-02-16T02:30:53', '2005-07-28T11:58:53', '2005-08-04T12:08:53', '2'), + ('473', '511', '2006-02-16T02:30:53', '2005-06-19T16:22:26', '2005-06-21T21:55:26', '1'), + ('473', '923', '2006-02-16T02:30:53', '2005-06-19T03:04:59', '2005-06-26T02:36:59', '2'), + ('473', '397', '2006-02-16T02:30:53', '2005-07-07T00:25:29', '2005-07-08T05:30:29', '2'), + ('473', '2434', '2006-02-16T02:30:53', '2005-06-16T16:54:03', '2005-06-18T20:11:03', '1'), + ('473', '1154', '2006-02-16T02:30:53', '2005-08-21T23:23:37', '2005-08-26T23:24:37', '2'), + ('473', '2538', '2006-02-16T02:30:53', '2005-07-12T21:03:03', '2005-07-14T00:47:03', '1'), + ('473', '2244', '2006-02-16T02:30:53', '2005-07-30T05:50:08', '2005-07-31T09:58:08', '1'), + ('473', '318', '2006-02-16T02:30:53', '2005-07-08T08:14:26', '2005-07-09T03:45:26', '1'), + ('473', '2081', '2006-02-16T02:30:53', '2005-08-22T12:38:37', '2005-08-29T14:01:37', '2'), + ('473', '3634', '2006-02-16T02:30:53', '2005-07-12T00:44:08', '2005-07-14T20:39:08', '2'), + ('473', '1949', '2006-02-16T02:30:53', '2005-08-02T16:58:56', '2005-08-06T16:56:56', '1'), + ('473', '4303', '2006-02-16T02:30:53', '2005-06-17T20:53:42', '2005-06-19T01:53:42', '2'), + ('473', '2530', '2006-02-16T02:30:53', '2005-07-09T22:09:28', '2005-07-18T20:03:28', '2'), + ('473', '2814', '2006-02-16T02:30:53', '2005-08-21T15:56:39', '2005-08-23T21:40:39', '1'), + ('473', '2577', '2006-02-16T02:30:53', '2005-08-02T00:24:15', '2005-08-05T21:09:15', '1'), + ('473', '1465', '2006-02-16T02:30:53', '2005-08-21T19:41:50', '2005-08-25T16:11:50', '1'), + ('473', '2664', '2006-02-16T02:30:53', '2005-08-22T23:13:03', '2005-08-28T18:34:03', '1'), + ('473', '1109', '2006-02-16T02:30:53', '2005-08-02T12:23:43', '2005-08-03T13:19:43', '1'), + ('473', '1825', '2006-02-16T02:30:53', '2005-05-27T04:50:56', '2005-06-01T04:43:56', '1'), + ('473', '2776', '2006-02-16T02:30:53', '2005-08-02T05:05:52', '2005-08-05T03:33:52', '1'), + ('473', '2910', '2006-02-16T02:30:53', '2005-08-23T21:46:47', '2005-08-27T02:06:47', '1'), + ('473', '4279', '2006-02-16T02:30:53', '2005-05-30T15:05:47', '2005-06-08T15:59:47', '2'), + ('473', '4415', '2006-02-16T02:30:53', '2005-07-06T22:50:40', '2005-07-08T01:02:40', '1'), + ('524', '3901', '2006-02-16T02:30:53', '2005-08-22T16:33:39', '2005-08-31T11:41:39', '1'), + ('524', '3009', '2006-02-16T02:30:53', '2005-06-21T21:12:13', '2005-06-25T23:23:13', '1'), + ('524', '2132', '2006-02-16T02:30:53', '2005-06-15T09:59:24', '2005-06-19T09:37:24', '2'), + ('524', '640', '2006-02-16T02:30:53', '2005-07-11T14:32:41', '2005-07-20T18:38:41', '1'), + ('524', '470', '2006-02-16T02:30:53', '2005-07-27T03:17:19', '2005-07-29T07:03:19', '2'), + ('524', '4444', '2006-02-16T02:30:53', '2005-06-16T09:24:38', '2005-06-17T09:50:38', '2'), + ('524', '4469', '2006-02-16T02:30:53', '2005-08-21T20:19:52', '2005-08-28T17:10:52', '1'), + ('524', '435', '2006-02-16T02:30:53', '2005-07-09T02:59:10', '2005-07-15T07:54:10', '2'), + ('524', '714', '2006-02-16T02:30:53', '2005-07-27T02:14:40', '2005-08-03T00:32:40', '2'), + ('524', '2178', '2006-02-16T02:30:53', '2005-08-21T03:13:45', '2005-08-22T01:50:45', '1'), + ('524', '872', '2006-02-16T02:30:53', '2005-05-25T19:31:18', '2005-05-31T15:00:18', '1'), + ('524', '2352', '2006-02-16T02:30:53', '2005-08-20T21:53:21', '2005-08-23T17:51:21', '2'), + ('524', '1331', '2006-02-16T02:30:53', '2005-07-12T14:30:51', '2005-07-13T13:42:51', '2'), + ('524', '3273', '2006-02-16T02:30:53', '2005-07-29T09:29:44', '2005-08-07T05:48:44', '2'), + ('524', '3681', '2006-02-16T02:30:53', '2005-07-11T10:11:54', '2005-07-15T12:12:54', '2'), + ('524', '2961', '2006-02-16T02:30:53', '2005-07-07T19:48:36', '2005-07-14T01:14:36', '1'), + ('524', '3560', '2006-02-16T02:30:53', '2005-05-30T22:15:24', '2005-06-02T16:18:24', '1'), + ('524', '594', '2006-02-16T02:30:53', '2005-08-20T06:55:24', '2005-08-29T12:32:24', '1'), + ('524', '4011', '2006-02-16T02:30:53', '2005-08-21T09:31:39', '2005-08-26T11:55:39', '2'), + ('153', '979', '2006-02-16T02:30:53', '2005-07-31T15:27:41', '2005-08-06T16:25:41', '1'), + ('153', '98', '2006-02-16T02:30:53', '2005-06-19T10:20:09', '2005-06-21T10:05:09', '1'), + ('153', '2241', '2006-02-16T02:30:53', '2005-07-28T08:34:47', '2005-08-05T09:43:47', '2'), + ('153', '2966', '2006-02-16T02:30:53', '2005-08-22T18:37:48', '2005-08-24T00:22:48', '1'), + ('153', '3317', '2006-02-16T02:30:53', '2005-07-08T10:14:18', '2005-07-16T15:10:18', '2'), + ('153', '201', '2006-02-16T02:30:53', '2005-08-21T23:00:02', '2005-08-26T18:58:02', '2'), + ('153', '397', '2006-02-16T02:30:53', '2005-06-20T02:22:08', '2005-06-26T21:01:08', '2'), + ('153', '4193', '2006-02-16T02:30:53', '2005-06-20T05:49:27', '2005-06-26T09:48:27', '1') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + v_old_ids_rental := ARRAY['6818', '3949', '15593', '14944', '12439', '12103', '12882', '4194', '10015', '5676', '14664', '15444', '3795', '11368', '5771', '2224', '6018', '8538', '15584', '2996', '2526', '610', '15853', '3926', '8925', '1388', '389', '4561', '12639', '4790', '6801', '7925', '7857', '13628', '112', '11218', '9290', '14964', '1375', '2189', '10947', '6187', '12813', '14407']; + WITH inserted AS ( + INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") + SELECT + map0.new_id::smallint, + map1.new_id::integer, + data.last_update::timestamp without time zone, + data.rental_date::timestamp without time zone, + data.return_date::timestamp without time zone, + map2.new_id::smallint + FROM (VALUES + ('153', '1013', '2006-02-16T02:30:53', '2005-07-12T18:20:54', '2005-07-21T00:03:54', '2'), + ('153', '1765', '2006-02-16T02:30:53', '2005-07-06T21:46:36', '2005-07-11T03:18:36', '1'), + ('153', '3734', '2006-02-16T02:30:53', '2005-08-23T06:15:09', '2005-08-27T07:47:09', '2'), + ('153', '535', '2006-02-16T02:30:53', '2005-08-22T06:01:26', '2005-08-24T10:33:26', '2'), + ('153', '3204', '2006-02-16T02:30:53', '2005-08-18T10:44:57', '2005-08-22T06:51:57', '1'), + ('153', '4363', '2006-02-16T02:30:53', '2005-08-17T22:49:09', '2005-08-24T21:53:09', '1'), + ('153', '911', '2006-02-16T02:30:53', '2005-08-19T03:33:46', '2005-08-21T22:49:46', '1'), + ('153', '1753', '2006-02-16T02:30:53', '2005-07-07T10:59:39', '2005-07-15T09:34:39', '1'), + ('153', '67', '2006-02-16T02:30:53', '2005-07-31T18:11:17', '2005-08-03T15:48:17', '2'), + ('153', '3595', '2006-02-16T02:30:53', '2005-07-10T08:38:32', '2005-07-13T10:11:32', '1'), + ('153', '4377', '2006-02-16T02:30:53', '2005-08-21T19:48:47', '2005-08-27T16:47:47', '1'), + ('153', '959', '2006-02-16T02:30:53', '2005-08-23T00:46:52', '2005-08-29T20:37:52', '2'), + ('153', '240', '2006-02-16T02:30:53', '2005-07-06T14:37:41', '2005-07-11T20:27:41', '2'), + ('153', '866', '2006-02-16T02:30:53', '2005-08-02T18:03:05', '2005-08-07T20:40:05', '1'), + ('153', '3275', '2006-02-16T02:30:53', '2005-07-10T13:26:45', '2005-07-14T15:43:45', '1'), + ('153', '1336', '2006-02-16T02:30:53', '2005-06-18T03:33:58', '2005-06-18T22:10:58', '1'), + ('500', '4555', '2006-02-16T02:30:53', '2005-07-11T02:06:36', '2005-07-12T02:16:36', '2'), + ('500', '3768', '2006-02-16T02:30:53', '2005-07-29T10:45:17', '2005-08-04T15:12:17', '1'), + ('500', '3526', '2006-02-16T02:30:53', '2005-08-23T05:49:21', '2005-08-27T04:49:21', '1'), + ('500', '4064', '2006-02-16T02:30:53', '2005-06-20T09:20:29', '2005-06-27T09:18:29', '1'), + ('500', '3309', '2006-02-16T02:30:53', '2005-06-19T01:03:07', '2005-06-28T06:57:07', '1'), + ('500', '3642', '2006-02-16T02:30:53', '2005-05-28T15:15:25', '2005-06-02T12:30:25', '2'), + ('500', '225', '2006-02-16T02:30:53', '2005-08-23T15:54:20', '2005-08-24T18:53:20', '2'), + ('500', '4241', '2006-02-16T02:30:53', '2005-07-06T20:42:35', '2005-07-09T16:30:35', '2'), + ('500', '3753', '2006-02-16T02:30:53', '2005-07-30T02:09:14', '2005-07-30T21:39:14', '1'), + ('500', '3987', '2006-02-16T02:30:53', '2005-06-15T15:48:41', '2005-06-22T17:51:41', '1'), + ('500', '691', '2006-02-16T02:30:53', '2005-05-27T10:45:41', '2005-06-05T06:22:41', '2'), + ('500', '1643', '2006-02-16T02:30:53', '2005-07-08T05:02:43', '2005-07-11T04:56:43', '1'), + ('500', '562', '2006-02-16T02:30:53', '2005-08-18T18:13:05', '2005-08-27T16:00:05', '2'), + ('500', '100', '2006-02-16T02:30:53', '2005-07-08T16:25:27', '2005-07-11T11:35:27', '1'), + ('500', '872', '2006-02-16T02:30:53', '2005-07-12T17:09:08', '2005-07-21T22:25:08', '1'), + ('500', '1763', '2006-02-16T02:30:53', '2005-07-28T12:10:02', '2005-08-02T15:50:02', '1'), + ('500', '4027', '2006-02-16T02:30:53', '2005-07-28T09:49:40', '2005-08-01T05:34:40', '2'), + ('500', '1006', '2006-02-16T02:30:53', '2005-08-20T07:03:53', '2005-08-22T11:27:53', '2'), + ('500', '2153', '2006-02-16T02:30:53', '2005-05-25T18:57:24', '2005-06-02T20:44:24', '1'), + ('500', '1126', '2006-02-16T02:30:53', '2005-08-02T12:29:12', '2005-08-10T16:13:12', '2'), + ('500', '2275', '2006-02-16T02:30:53', '2005-07-30T15:59:08', '2005-08-06T21:49:08', '2'), + ('500', '2302', '2006-02-16T02:30:53', '2005-08-22T06:39:24', '2005-08-26T06:05:24', '1'), + ('500', '3555', '2006-02-16T02:30:53', '2005-06-15T14:54:56', '2005-06-21T14:48:56', '2'), + ('500', '249', '2006-02-16T02:30:53', '2005-06-18T01:20:26', '2005-06-25T00:30:26', '1'), + ('500', '2510', '2006-02-16T02:30:53', '2005-08-02T03:23:17', '2005-08-07T05:25:17', '1'), + ('500', '3344', '2006-02-16T02:30:53', '2005-07-11T11:28:51', '2005-07-12T15:44:51', '1'), + ('500', '3285', '2006-02-16T02:30:53', '2005-08-19T00:54:22', '2005-08-19T21:17:22', '2'), + ('500', '2403', '2006-02-16T02:30:53', '2005-08-21T10:46:51', '2005-08-25T09:28:51', '2') + ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."inventory"' + AND map1.old_id = data.old_inventory_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING rental_id + ) + SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; + + FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); + END LOOP; + + -- Table: "public"."store" (2 records) + v_old_ids_store := ARRAY['1', '2']; + WITH inserted AS ( + INSERT INTO "public"."store" ("address_id", "last_update", "manager_staff_id") + SELECT + map0.new_id::smallint, + data.last_update::timestamp without time zone, + map1.new_id::smallint + FROM (VALUES + ('1', '2006-02-15T09:57:12', '1'), + ('2', '2006-02-15T09:57:12', '2') + ) AS data(old_address_id, last_update, old_manager_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."address"' + AND map0.old_id = data.old_address_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."staff"' + AND map1.old_id = data.old_manager_staff_id + RETURNING store_id + ) + SELECT array_agg(store_id) INTO v_new_ids_store FROM inserted; + + FOR i IN 1..array_length(v_new_ids_store, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."store"', v_old_ids_store[i], v_new_ids_store[i]::TEXT); + END LOOP; + + -- Table: "public"."payment" (14596 records) + v_old_ids_payment := ARRAY['24185', '26093', '30616', '22080', '22538', '27559', '23294', '31098', '20859', '21980', '29246', '27969', '30203', '30266', '29829', '22216', '26027', '29077', '25766', '31671', '28492', '25238', '21779', '28107', '18850', '19890', '21199', '27838', '29007', '21703', '31554', '31238', '25887', '19731', '29722', '29060', '24031', '23076', '24004', '19995', '19134', '28456', '30633', '17641', '23678', '30640', '26840', '22283', '17512', '26867', '24123', '30210', '24735', '31066', '24964', '29325', '19954', '24329', '19294', '20193', '18916', '19023', '26335', '23655', '29397', '28891', '28732', '18584', '28667', '19618', '24127', '31216', '29323', '17553', '31217', '28445', '26234', '22771', '22010', '20228', '29831', '25807', '24999', '29974', '30614', '25313', '23403', '21975', '31503', '22571', '28386', '18167', '19236', '27776', '27181', '17942', '22076', '21989', '22509', '28094']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('2.99', '156', '2007-03-20T01:54:36.996577', '13531', '2'), + ('2.99', '348', '2007-04-27T14:05:27.996577', '7380', '2'), + ('0.99', '143', '2007-04-29T02:01:04.996577', '8312', '1'), + ('2.99', '537', '2007-03-22T12:36:32.996577', '15149', '1'), + ('4.99', '589', '2007-03-17T16:38:44.996577', '11980', '1'), + ('2.99', '480', '2007-04-11T10:06:18.996577', '6191', '1'), + ('2.99', '63', '2007-03-22T15:58:51.996577', '15229', '1'), + ('7.99', '185', '2007-04-08T15:57:13.996577', '4822', '2'), + ('1.99', '408', '2007-03-23T09:30:26.996577', '15716', '2'), + ('6.99', '527', '2007-03-18T12:00:11.996577', '12513', '1'), + ('2.99', '25', '2007-04-07T13:54:57.996577', '4282', '1'), + ('4.99', '517', '2007-04-07T05:08:09.996577', '4109', '1'), + ('3.99', '107', '2007-04-10T13:13:35.996577', '5798', '2'), + ('4.99', '113', '2007-04-10T05:59:32.996577', '5655', '2'), + ('2.99', '75', '2007-04-28T09:30:17.996577', '7897', '2'), + ('4.99', '553', '2007-03-22T08:16:03.996577', '15042', '1'), + ('7.99', '343', '2007-04-07T22:50:32.996577', '4472', '1'), + ('3.99', '8', '2007-04-08T00:45:38.996577', '4503', '1'), + ('3.99', '320', '2007-04-27T02:21:55.996577', '7064', '2'), + ('2.99', '243', '2007-04-30T04:44:33.996577', '9035', '2'), + ('0.99', '565', '2007-04-12T11:13:47.996577', '6699', '1'), + ('2.99', '275', '2007-04-27T20:40:02.996577', '7553', '1'), + ('4.99', '504', '2007-03-23T20:12:53.996577', '16022', '2'), + ('0.99', '528', '2007-04-06T06:44:23.996577', '3664', '1'), + ('4.99', '89', '2007-02-17T06:35:19.996577', '1948', '1'), + ('3.99', '305', '2007-03-18T14:46:16.996577', '12592', '2'), + ('4.99', '444', '2007-03-23T13:24:13.996577', '15815', '2'), + ('6.99', '504', '2007-04-06T09:17:56.996577', '3713', '1'), + ('4.99', '2', '2007-04-27T12:59:08.996577', '7346', '2'), + ('2.99', '497', '2007-03-19T16:59:56.996577', '13289', '1'), + ('5.99', '234', '2007-04-30T20:23:33.996577', '10133', '2'), + ('4.99', '199', '2007-04-28T05:42:06.996577', '7782', '1'), + ('2.99', '331', '2007-04-09T07:03:10.996577', '5152', '1'), + ('1.99', '288', '2007-03-17T22:18:09.996577', '12134', '1'), + ('4.99', '66', '2007-04-07T05:06:57.996577', '4108', '1'), + ('2.99', '6', '2007-04-27T05:06:51.996577', '7136', '2'), + ('1.99', '142', '2007-03-23T00:15:01.996577', '15477', '1'), + ('6.99', '40', '2007-03-19T11:35:38.996577', '13149', '1'), + ('2.99', '140', '2007-03-23T14:15:28.996577', '15852', '1'), + ('5.99', '317', '2007-03-20T19:55:21.996577', '14032', '1'), + ('8.99', '164', '2007-02-20T14:00:37.996577', '3082', '1'), + ('3.99', '562', '2007-04-27T06:05:22.996577', '7166', '2'), + ('0.99', '144', '2007-04-30T02:59:34.996577', '8983', '1'), + ('0.99', '377', '2007-02-20T14:11:06.996577', '3086', '2'), + ('6.99', '107', '2007-03-20T00:46:56.996577', '13510', '1'), + ('4.99', '145', '2007-04-07T18:15:17.996577', '4364', '1'), + ('0.99', '414', '2007-04-27T00:14:10.996577', '7009', '1'), + ('2.99', '560', '2007-03-21T22:53:03.996577', '14785', '2'), + ('4.99', '343', '2007-02-16T00:10:50.996577', '1547', '2'), + ('2.99', '417', '2007-04-07T20:33:56.996577', '4418', '1'), + ('1.99', '150', '2007-03-19T02:07:20.996577', '12887', '1'), + ('4.99', '107', '2007-04-28T19:40:12.996577', '8162', '1'), + ('4.99', '220', '2007-03-19T02:21:10.996577', '12896', '1'), + ('2.99', '182', '2007-04-07T08:28:15.996577', '4174', '1'), + ('4.99', '247', '2007-03-18T02:50:27.996577', '12265', '2'), + ('0.99', '30', '2007-04-30T04:02:14.996577', '9641', '1'), + ('2.99', '312', '2007-03-21T07:48:15.996577', '14362', '2'), + ('0.99', '172', '2007-03-01T13:38:52.996577', '10621', '2'), + ('0.99', '210', '2007-02-19T21:41:30.996577', '2856', '2'), + ('2.99', '340', '2007-03-19T04:06:55.996577', '12940', '2'), + ('0.99', '107', '2007-02-20T16:47:55.996577', '3120', '2'), + ('0.99', '134', '2007-02-17T01:38:22.996577', '1881', '2'), + ('5.99', '368', '2007-04-30T18:44:24.996577', '9400', '1'), + ('4.99', '104', '2007-03-19T12:28:19.996577', '13179', '1'), + ('2.99', '36', '2007-04-30T17:20:45.996577', '9369', '1'), + ('5.99', '598', '2007-04-10T07:44:34.996577', '5688', '2'), + ('4.99', '585', '2007-04-08T04:30:22.996577', '4579', '2'), + ('2.99', '24', '2007-02-17T14:56:17.996577', '2070', '1'), + ('4.99', '579', '2007-04-30T16:05:56.996577', '9997', '2'), + ('2.99', '275', '2007-03-22T17:08:10.996577', '15269', '2'), + ('2.99', '150', '2007-03-19T19:51:45.996577', '13372', '1'), + ('2.99', '198', '2007-04-06T11:42:54.996577', '3770', '2'), + ('2.99', '30', '2007-04-30T15:24:19.996577', '9309', '2'), + ('2.99', '353', '2007-02-15T11:58:56.996577', '1359', '2'), + ('2.99', '198', '2007-04-08T04:46:27.996577', '4588', '2'), + ('0.99', '561', '2007-04-11T22:44:45.996577', '6435', '1'), + ('2.99', '360', '2007-04-30T02:58:28.996577', '9623', '1'), + ('4.99', '9', '2007-03-18T17:17:24.996577', '12652', '2'), + ('0.99', '530', '2007-03-22T09:17:32.996577', '15066', '2'), + ('2.99', '343', '2007-03-17T00:02:58.996577', '11570', '2'), + ('6.99', '75', '2007-04-29T20:50:38.996577', '8823', '1'), + ('2.99', '323', '2007-04-30T17:12:49.996577', '9363', '1'), + ('2.99', '252', '2007-03-01T21:56:26.996577', '10834', '2'), + ('0.99', '89', '2007-04-07T23:50:49.996577', '4488', '1'), + ('6.99', '143', '2007-04-11T03:33:56.996577', '6076', '2'), + ('1.99', '282', '2007-04-29T06:54:30.996577', '8468', '2'), + ('4.99', '75', '2007-03-01T22:55:50.996577', '10871', '1'), + ('0.99', '527', '2007-03-01T13:24:40.996577', '10613', '2'), + ('2.99', '230', '2007-04-09T12:51:31.996577', '5269', '2'), + ('4.99', '593', '2007-03-02T00:11:28.996577', '10904', '2'), + ('2.99', '556', '2007-04-08T11:01:26.996577', '4719', '2'), + ('4.99', '515', '2007-02-15T03:37:06.996577', '1244', '1'), + ('4.99', '190', '2007-02-17T14:00:24.996577', '2057', '1'), + ('4.99', '498', '2007-04-28T14:11:58.996577', '8020', '2'), + ('3.99', '444', '2007-04-28T01:27:05.996577', '7679', '2'), + ('5.99', '454', '2007-02-17T23:24:44.996577', '2182', '2'), + ('4.99', '537', '2007-03-20T14:00:35.996577', '13885', '2'), + ('2.99', '528', '2007-03-21T00:46:15.996577', '14148', '2'), + ('4.99', '585', '2007-03-23T12:57:42.996577', '15804', '1'), + ('6.99', '526', '2007-04-30T01:21:59.996577', '9577', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['21404', '24411', '27385', '17745', '18430', '30065', '27930', '17739', '22721', '25612', '21608', '18788', '27455', '22733', '25585', '21403', '28239', '18011', '24754', '21707', '28824', '27027', '19604', '20380', '22238', '22432', '28163', '23087', '23173', '18107', '21339', '23818', '21841', '20095', '18332', '27326', '27689', '18449', '23996', '19922', '18708', '26896', '29095', '28098', '19051', '22814', '19182', '25804', '24040', '23747', '27179', '24386', '22867', '26860', '26732', '28437', '23918', '23031', '22054', '27437', '31047', '27580', '28664', '31392', '30393', '29714', '30256', '20366', '22540', '23685', '31103', '31864', '24049', '18825', '20002', '21587', '27583', '27837', '20191', '25418', '26871', '29719', '23993', '23147', '18830', '22920', '28249', '28419', '23821', '20167', '18350', '18712', '29567', '30261', '22695', '30949', '23705', '23717', '30339', '19062']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('3.99', '465', '2007-03-01T11:00:49.996577', '10542', '1'), + ('5.99', '180', '2007-03-01T12:14:28.996577', '10576', '1'), + ('4.99', '464', '2007-04-10T19:20:00.996577', '5910', '1'), + ('2.99', '402', '2007-02-20T02:10:53.996577', '2913', '2'), + ('8.99', '589', '2007-02-19T09:03:52.996577', '2652', '2'), + ('4.99', '96', '2007-04-28T18:00:14.996577', '8125', '2'), + ('0.99', '512', '2007-04-27T19:00:14.996577', '7507', '1'), + ('5.99', '399', '2007-02-20T10:46:57.996577', '3036', '1'), + ('0.99', '5', '2007-03-01T13:55:36.996577', '10625', '1'), + ('1.99', '306', '2007-04-08T05:09:51.996577', '4596', '2'), + ('4.99', '486', '2007-03-02T00:04:12.996577', '10902', '2'), + ('6.99', '75', '2007-02-20T12:18:26.996577', '3062', '2'), + ('8.99', '470', '2007-04-29T07:07:38.996577', '8476', '2'), + ('2.99', '6', '2007-03-01T01:42:05.996577', '10271', '1'), + ('6.99', '303', '2007-04-29T16:56:41.996577', '8734', '2'), + ('4.99', '464', '2007-03-23T18:42:04.996577', '15983', '1'), + ('4.99', '539', '2007-04-09T04:08:30.996577', '5086', '2'), + ('7.99', '470', '2007-02-16T03:43:38.996577', '1594', '2'), + ('5.99', '223', '2007-03-19T03:31:12.996577', '12927', '1'), + ('0.99', '497', '2007-03-23T16:29:57.996577', '15919', '1'), + ('0.99', '592', '2007-04-29T18:24:00.996577', '8773', '2'), + ('4.99', '432', '2007-04-08T22:26:44.996577', '4973', '1'), + ('6.99', '275', '2007-03-01T08:39:51.996577', '10479', '1'), + ('4.99', '360', '2007-03-21T19:22:06.996577', '14700', '1'), + ('4.99', '555', '2007-03-19T02:02:13.996577', '12883', '1'), + ('4.99', '577', '2007-03-01T03:13:24.996577', '10323', '2'), + ('3.99', '532', '2007-04-12T12:26:51.996577', '6730', '1'), + ('7.99', '41', '2007-03-21T13:58:13.996577', '14539', '2'), + ('2.99', '51', '2007-03-20T13:51:52.996577', '13882', '2'), + ('0.99', '498', '2007-02-20T15:05:27.996577', '3098', '1'), + ('4.99', '459', '2007-03-01T01:14:39.996577', '10255', '2'), + ('3.99', '122', '2007-03-02T04:33:53.996577', '11044', '2'), + ('4.99', '512', '2007-03-23T10:05:58.996577', '15733', '2'), + ('3.99', '330', '2007-03-02T12:14:56.996577', '11259', '2'), + ('4.99', '562', '2007-02-19T12:22:56.996577', '2705', '1'), + ('4.99', '459', '2007-04-27T23:43:02.996577', '7639', '2'), + ('2.99', '491', '2007-04-07T19:39:28.996577', '4392', '1'), + ('4.99', '593', '2007-02-19T19:50:19.996577', '2832', '1'), + ('3.99', '139', '2007-03-23T00:07:14.996577', '15471', '1'), + ('6.99', '308', '2007-03-19T00:20:16.996577', '12838', '2'), + ('0.99', '51', '2007-02-15T19:39:44.996577', '1477', '1'), + ('4.99', '420', '2007-04-07T08:32:00.996577', '4176', '1'), + ('4.99', '10', '2007-04-07T01:35:06.996577', '4042', '2'), + ('0.99', '527', '2007-04-09T16:55:26.996577', '5365', '1'), + ('3.99', '143', '2007-02-18T03:33:34.996577', '2251', '2'), + ('0.99', '14', '2007-03-23T20:53:52.996577', '16045', '1'), + ('2.99', '177', '2007-02-18T18:48:31.996577', '2467', '2'), + ('4.99', '323', '2007-04-28T11:06:48.996577', '7937', '2'), + ('5.99', '144', '2007-03-01T18:18:58.996577', '10740', '1'), + ('6.99', '115', '2007-03-22T13:58:51.996577', '15176', '1'), + ('2.99', '444', '2007-04-10T14:48:56.996577', '5825', '2'), + ('0.99', '177', '2007-03-21T06:12:58.996577', '14310', '2'), + ('0.99', '20', '2007-03-17T10:56:21.996577', '11821', '1'), + ('0.99', '416', '2007-04-28T09:11:47.996577', '7889', '1'), + ('0.99', '405', '2007-04-09T11:03:28.996577', '5231', '1'), + ('4.99', '560', '2007-04-27T07:28:46.996577', '7202', '2'), + ('6.99', '132', '2007-03-01T05:46:50.996577', '10400', '1'), + ('0.99', '36', '2007-03-02T02:16:43.996577', '10963', '1'), + ('8.99', '535', '2007-03-17T07:09:21.996577', '11736', '2'), + ('6.99', '469', '2007-04-27T09:57:37.996577', '7271', '2'), + ('2.99', '180', '2007-04-27T10:04:00.996577', '7274', '1'), + ('4.99', '482', '2007-04-09T15:28:39.996577', '5334', '1'), + ('9.99', '579', '2007-04-30T16:48:34.996577', '9349', '2'), + ('10.99', '220', '2007-04-30T20:48:55.996577', '9455', '2'), + ('0.99', '124', '2007-04-29T08:48:33.996577', '8524', '2'), + ('0.99', '65', '2007-04-12T02:51:32.996577', '6527', '2'), + ('4.99', '112', '2007-04-30T11:42:21.996577', '9217', '1'), + ('1.99', '359', '2007-03-21T04:25:02.996577', '14258', '1'), + ('8.99', '589', '2007-03-19T03:46:46.996577', '12933', '2'), + ('6.99', '108', '2007-03-18T16:04:45.996577', '12625', '2'), + ('2.99', '185', '2007-04-28T21:39:12.996577', '8200', '1'), + ('6.99', '262', '2007-04-30T07:18:51.996577', '9105', '1'), + ('6.99', '144', '2007-03-19T05:31:40.996577', '12980', '2'), + ('0.99', '84', '2007-02-17T12:59:28.996577', '2042', '2'), + ('0.99', '319', '2007-03-17T00:18:52.996577', '11575', '1'), + ('0.99', '483', '2007-03-01T15:53:01.996577', '10677', '2'), + ('2.99', '482', '2007-04-10T17:43:24.996577', '5880', '2'), + ('9.99', '504', '2007-04-06T09:16:01.996577', '3712', '2'), + ('4.99', '340', '2007-03-18T15:02:29.996577', '12598', '2'), + ('4.99', '290', '2007-04-29T12:58:57.996577', '8639', '1'), + ('2.99', '417', '2007-04-29T22:43:48.996577', '8877', '1'), + ('4.99', '66', '2007-04-06T02:02:14.996577', '3573', '1'), + ('2.99', '139', '2007-03-22T07:33:19.996577', '15029', '2'), + ('0.99', '49', '2007-03-01T01:34:25.996577', '10266', '1'), + ('4.99', '85', '2007-02-20T19:57:43.996577', '3165', '1'), + ('4.99', '24', '2007-03-22T19:57:25.996577', '15357', '2'), + ('4.99', '540', '2007-04-08T06:54:18.996577', '4628', '2'), + ('4.99', '559', '2007-04-07T05:35:29.996577', '4120', '1'), + ('4.99', '122', '2007-03-18T19:31:58.996577', '12711', '2'), + ('4.99', '338', '2007-03-02T05:23:43.996577', '11064', '2'), + ('4.99', '568', '2007-02-21T00:46:51.996577', '3227', '1'), + ('4.99', '52', '2007-02-20T22:30:54.996577', '3196', '2'), + ('9.99', '51', '2007-04-05T23:31:05.996577', '3525', '1'), + ('2.99', '112', '2007-04-30T17:17:38.996577', '10038', '1'), + ('2.99', '2', '2007-03-02T12:13:19.996577', '11256', '2'), + ('0.99', '172', '2007-04-11T20:24:06.996577', '6380', '1'), + ('2.99', '111', '2007-03-19T15:17:03.996577', '13251', '2'), + ('0.99', '112', '2007-03-21T07:42:54.996577', '14358', '1'), + ('0.99', '119', '2007-04-30T19:15:55.996577', '10101', '1'), + ('7.99', '146', '2007-02-15T00:59:38.996577', '1209', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['19102', '29729', '22768', '28705', '24119', '26245', '29712', '27724', '26312', '31506', '27658', '19015', '21298', '28740', '28949', '20004', '28361', '26239', '21351', '31672', '30330', '30577', '21272', '30299', '21294', '29050', '23291', '18914', '21654', '18923', '26836', '19624', '19061', '20108', '27232', '24804', '31667', '28360', '28246', '27553', '30874', '29319', '27664', '23679', '20463', '30507', '32005', '25233', '24684', '31007', '21398', '23795', '20466', '27706', '27573', '17927', '22470', '29676', '22753', '29387', '23817', '28778', '29987', '28090', '24442', '27375', '30606', '17937', '19211', '25456', '26443', '24642', '19370', '23837', '20791', '17999', '31896', '29261', '28830', '24272', '24275', '26939', '21203', '30623', '18126', '25808', '23348', '23681', '26927', '19662', '29388', '24269', '20459', '30323', '26959', '31325', '23819', '20983', '20071', '19878']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('7.99', '155', '2007-02-17T11:36:34.996577', '2028', '1'), + ('2.99', '66', '2007-04-26T23:40:39.996577', '6995', '1'), + ('0.99', '9', '2007-03-16T23:40:19.996577', '11556', '1'), + ('6.99', '582', '2007-04-29T18:42:51.996577', '8778', '1'), + ('6.99', '150', '2007-03-17T09:27:50.996577', '11789', '2'), + ('4.99', '361', '2007-04-30T20:51:03.996577', '10151', '1'), + ('3.99', '65', '2007-04-08T07:11:06.996577', '4635', '2'), + ('1.99', '494', '2007-04-28T03:43:29.996577', '7737', '2'), + ('6.99', '366', '2007-04-30T15:40:24.996577', '9316', '1'), + ('4.99', '230', '2007-04-27T12:27:37.996577', '7333', '2'), + ('6.99', '488', '2007-04-07T06:40:52.996577', '4133', '2'), + ('4.99', '132', '2007-02-20T02:48:40.996577', '2924', '2'), + ('2.99', '454', '2007-03-22T00:33:51.996577', '14843', '2'), + ('2.99', '585', '2007-04-29T03:20:36.996577', '8353', '2'), + ('7.99', '205', '2007-04-28T12:41:50.996577', '7976', '2'), + ('6.99', '319', '2007-03-17T15:50:01.996577', '11955', '1'), + ('4.99', '553', '2007-04-06T13:01:10.996577', '3793', '2'), + ('0.99', '361', '2007-04-12T20:43:00.996577', '6911', '2'), + ('1.99', '460', '2007-03-02T00:55:03.996577', '10926', '1'), + ('4.99', '243', '2007-04-30T22:58:10.996577', '9514', '2'), + ('8.99', '119', '2007-04-08T16:46:42.996577', '4840', '2'), + ('6.99', '139', '2007-04-12T01:26:05.996577', '6496', '1'), + ('4.99', '451', '2007-03-23T07:00:15.996577', '15651', '1'), + ('4.99', '115', '2007-04-27T17:18:56.996577', '7465', '2'), + ('2.99', '454', '2007-03-20T00:56:19.996577', '13513', '2'), + ('1.99', '5', '2007-04-30T02:42:54.996577', '8978', '1'), + ('8.99', '63', '2007-03-20T05:19:28.996577', '13624', '1'), + ('3.99', '107', '2007-02-20T01:02:49.996577', '2897', '2'), + ('0.99', '491', '2007-03-17T00:56:59.996577', '11590', '1'), + ('2.99', '109', '2007-02-16T02:57:11.996577', '1581', '2'), + ('3.99', '414', '2007-04-07T21:24:07.996577', '4437', '1'), + ('3.99', '276', '2007-03-17T15:56:27.996577', '11961', '2'), + ('0.99', '145', '2007-02-19T05:56:37.996577', '2614', '2'), + ('2.99', '331', '2007-03-23T01:59:17.996577', '15521', '1'), + ('8.99', '449', '2007-04-06T21:29:15.996577', '3977', '1'), + ('5.99', '230', '2007-03-16T23:32:55.996577', '11552', '1'), + ('2.99', '243', '2007-04-12T16:49:56.996577', '6820', '2'), + ('6.99', '553', '2007-04-05T22:18:30.996577', '3495', '1'), + ('0.99', '539', '2007-04-30T12:46:42.996577', '9250', '2'), + ('5.99', '479', '2007-04-30T16:44:29.996577', '9347', '1'), + ('4.99', '166', '2007-04-09T17:37:10.996577', '5380', '2'), + ('4.99', '30', '2007-04-28T14:41:19.996577', '8030', '1'), + ('0.99', '488', '2007-04-28T15:24:13.996577', '8050', '2'), + ('4.99', '107', '2007-03-21T14:51:25.996577', '14562', '1'), + ('0.99', '369', '2007-03-01T02:36:30.996577', '10299', '1'), + ('2.99', '133', '2007-04-30T08:40:18.996577', '9139', '2'), + ('0.99', '587', '2007-05-14T13:44:29.996577', '12144', '1'), + ('0.99', '275', '2007-04-07T19:42:45.996577', '4396', '2'), + ('0.99', '214', '2007-03-21T14:55:51.996577', '14567', '1'), + ('1.99', '177', '2007-04-28T01:22:56.996577', '7674', '2'), + ('1.99', '464', '2007-03-02T12:54:24.996577', '11275', '2'), + ('0.99', '120', '2007-03-02T07:44:11.996577', '11133', '2'), + ('4.99', '369', '2007-03-02T06:02:45.996577', '11084', '1'), + ('4.99', '493', '2007-04-06T02:53:08.996577', '3586', '2'), + ('7.99', '481', '2007-04-28T07:23:53.996577', '7836', '2'), + ('4.99', '452', '2007-02-15T00:37:28.996577', '1203', '2'), + ('2.99', '581', '2007-03-17T05:53:25.996577', '11707', '2'), + ('8.99', '63', '2007-04-06T19:02:36.996577', '3923', '2'), + ('2.99', '7', '2007-03-19T19:51:57.996577', '13373', '2'), + ('4.99', '36', '2007-04-08T03:27:14.996577', '4560', '2'), + ('1.99', '122', '2007-03-01T14:01:07.996577', '10626', '1'), + ('0.99', '589', '2007-04-27T09:12:35.996577', '7250', '2'), + ('2.99', '89', '2007-04-30T04:11:54.996577', '9646', '2'), + ('2.99', '526', '2007-04-28T09:05:46.996577', '7883', '2'), + ('6.99', '182', '2007-03-22T04:52:20.996577', '14953', '1'), + ('0.99', '463', '2007-04-11T15:54:21.996577', '6294', '2'), + ('2.99', '142', '2007-04-29T08:21:25.996577', '8513', '2'), + ('4.99', '454', '2007-02-16T07:43:24.996577', '1647', '2'), + ('4.99', '185', '2007-02-21T07:20:10.996577', '3325', '1'), + ('9.99', '293', '2007-04-11T22:38:07.996577', '6432', '1'), + ('8.99', '377', '2007-04-30T22:36:27.996577', '10183', '1'), + ('0.99', '210', '2007-03-23T07:37:44.996577', '15672', '2'), + ('2.99', '233', '2007-02-18T03:14:59.996577', '2244', '2'), + ('0.99', '124', '2007-03-23T20:13:28.996577', '16023', '2'), + ('4.99', '402', '2007-03-22T22:40:18.996577', '15428', '1'), + ('9.99', '467', '2007-02-19T22:46:12.996577', '2870', '2'), + ('4.99', '265', '2007-04-11T03:09:35.996577', '6068', '1'), + ('0.99', '26', '2007-04-07T19:57:12.996577', '4402', '2'), + ('3.99', '593', '2007-04-07T13:37:57.996577', '4280', '2'), + ('7.99', '166', '2007-03-20T14:35:19.996577', '13901', '2'), + ('5.99', '166', '2007-03-22T15:17:28.996577', '15213', '1'), + ('2.99', '423', '2007-04-30T04:23:57.996577', '9026', '2'), + ('7.99', '445', '2007-03-02T16:50:31.996577', '11383', '1'), + ('8.99', '144', '2007-04-09T17:20:34.996577', '5374', '2'), + ('1.99', '504', '2007-02-19T13:20:21.996577', '2720', '1'), + ('4.99', '323', '2007-04-30T16:16:42.996577', '10002', '2'), + ('9.99', '70', '2007-03-02T12:52:34.996577', '11274', '1'), + ('5.99', '108', '2007-03-02T14:36:15.996577', '11316', '1'), + ('0.99', '423', '2007-04-07T04:59:26.996577', '4105', '2'), + ('2.99', '279', '2007-03-19T14:43:07.996577', '13233', '1'), + ('4.99', '36', '2007-04-08T13:23:08.996577', '4762', '2'), + ('4.99', '166', '2007-03-18T18:19:09.996577', '12683', '2'), + ('1.99', '368', '2007-03-20T16:48:44.996577', '13963', '2'), + ('2.99', '118', '2007-04-27T07:17:34.996577', '7196', '1'), + ('8.99', '425', '2007-04-07T23:31:38.996577', '4483', '2'), + ('4.99', '213', '2007-04-29T09:30:16.996577', '8542', '2'), + ('2.99', '122', '2007-03-02T10:13:33.996577', '11197', '2'), + ('10.99', '420', '2007-03-01T12:54:06.996577', '10601', '2'), + ('5.99', '327', '2007-03-23T13:44:58.996577', '15828', '1'), + ('0.99', '304', '2007-03-01T14:03:40.996577', '10631', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['30492', '19360', '23607', '24691', '18014', '24579', '23274', '20934', '23352', '20244', '29206', '19765', '18746', '20008', '27461', '21276', '29251', '23082', '25266', '19893', '18408', '19138', '20931', '31149', '20764', '25334', '25841', '18829', '22251', '20457', '23501', '28489', '31974', '21243', '23779', '27768', '24732', '25619', '21558', '27659', '17757', '22440', '22295', '18857', '17549', '26006', '22419', '27439', '28614', '29574', '25214', '30953', '23085', '25421', '21393', '30209', '22874', '30798', '30852', '18485', '29386', '26935', '18415', '23743', '20788', '19873', '18651', '20000', '29956', '23631', '26678', '25785', '31991', '23703', '27763', '26668', '19298', '20098', '21207', '21802', '29071', '23025', '17960', '27476', '21840', '29129', '25312', '22009', '19617', '22457', '31147', '22060', '29954', '30121', '31502', '24578', '18254', '22752', '29153', '28545']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('1.99', '132', '2007-04-10T09:16:29.996577', '5715', '2'), + ('3.99', '230', '2007-02-15T19:16:48.996577', '1468', '2'), + ('2.99', '98', '2007-03-02T00:53:04.996577', '10925', '1'), + ('4.99', '215', '2007-03-21T23:45:42.996577', '14817', '2'), + ('2.99', '471', '2007-02-17T22:19:36.996577', '2165', '2'), + ('3.99', '198', '2007-03-02T15:56:33.996577', '11351', '1'), + ('6.99', '61', '2007-03-22T10:02:32.996577', '15089', '2'), + ('6.99', '416', '2007-03-16T23:47:46.996577', '11557', '1'), + ('6.99', '70', '2007-03-18T14:17:41.996577', '12581', '1'), + ('10.99', '345', '2007-03-21T19:28:29.996577', '14702', '1'), + ('4.99', '20', '2007-04-30T06:23:40.996577', '9075', '2'), + ('2.99', '292', '2007-03-20T08:11:32.996577', '13715', '1'), + ('0.99', '62', '2007-02-16T03:20:54.996577', '1587', '1'), + ('3.99', '319', '2007-03-20T02:21:46.996577', '13548', '1'), + ('2.99', '471', '2007-04-07T00:10:48.996577', '4020', '1'), + ('4.99', '452', '2007-03-18T16:17:54.996577', '12630', '1'), + ('2.99', '25', '2007-04-12T20:30:44.996577', '6905', '2'), + ('4.99', '41', '2007-03-01T09:14:17.996577', '10495', '2'), + ('4.99', '278', '2007-04-07T21:03:50.996577', '4430', '1'), + ('2.99', '305', '2007-03-22T22:22:30.996577', '15417', '2'), + ('5.99', '583', '2007-02-19T21:15:03.996577', '2845', '2'), + ('3.99', '166', '2007-02-18T00:57:36.996577', '2211', '1'), + ('6.99', '416', '2007-03-01T18:21:39.996577', '10742', '1'), + ('5.99', '190', '2007-04-27T14:20:36.996577', '7386', '1'), + ('3.99', '399', '2007-03-17T15:45:08.996577', '11953', '1'), + ('0.99', '284', '2007-04-06T02:01:49.996577', '3572', '1'), + ('2.99', '326', '2007-04-29T17:02:59.996577', '8739', '2'), + ('0.99', '85', '2007-02-19T17:21:31.996577', '2794', '2'), + ('0.99', '557', '2007-03-22T16:12:53.996577', '15236', '2'), + ('0.99', '368', '2007-03-19T20:02:01.996577', '13378', '2'), + ('0.99', '85', '2007-03-01T11:12:58.996577', '10548', '1'), + ('4.99', '565', '2007-04-09T05:53:45.996577', '5124', '1'), + ('0.99', '479', '2007-05-14T13:44:29.996577', '12101', '1'), + ('6.99', '449', '2007-03-01T10:10:21.996577', '10516', '1'), + ('5.99', '119', '2007-03-16T22:32:54.996577', '11520', '1'), + ('2.99', '498', '2007-04-08T22:24:35.996577', '4972', '2'), + ('4.99', '220', '2007-03-17T02:44:12.996577', '11622', '1'), + ('0.99', '306', '2007-04-29T12:19:46.996577', '8620', '2'), + ('4.99', '480', '2007-03-19T02:42:03.996577', '12905', '2'), + ('5.99', '488', '2007-04-07T11:28:46.996577', '4233', '2'), + ('0.99', '405', '2007-02-17T02:27:02.996577', '1888', '1'), + ('3.99', '577', '2007-03-20T00:23:05.996577', '13500', '2'), + ('5.99', '562', '2007-03-18T02:21:44.996577', '12248', '1'), + ('3.99', '91', '2007-02-18T18:06:46.996577', '2457', '1'), + ('4.99', '352', '2007-02-16T07:48:59.996577', '1649', '1'), + ('2.99', '340', '2007-04-30T10:34:08.996577', '9834', '1'), + ('4.99', '575', '2007-03-19T21:03:17.996577', '13408', '2'), + ('4.99', '469', '2007-04-28T10:16:34.996577', '7914', '1'), + ('4.99', '575', '2007-04-30T07:26:01.996577', '9733', '1'), + ('5.99', '51', '2007-04-27T23:37:02.996577', '7636', '1'), + ('1.99', '273', '2007-04-12T08:16:24.996577', '6635', '1'), + ('3.99', '172', '2007-04-27T07:08:24.996577', '7194', '1'), + ('3.99', '41', '2007-03-17T23:37:00.996577', '12173', '2'), + ('3.99', '290', '2007-04-30T19:07:24.996577', '10096', '2'), + ('2.99', '463', '2007-03-19T04:24:24.996577', '12950', '1'), + ('7.99', '107', '2007-04-27T22:09:44.996577', '7600', '1'), + ('1.99', '20', '2007-03-22T13:05:48.996577', '15161', '1'), + ('1.99', '158', '2007-04-30T06:41:54.996577', '9713', '1'), + ('0.99', '164', '2007-04-12T11:16:29.996577', '6702', '2'), + ('5.99', '205', '2007-02-18T02:46:10.996577', '2237', '2'), + ('0.99', '36', '2007-04-07T06:43:29.996577', '4135', '2'), + ('9.99', '423', '2007-04-27T20:08:08.996577', '7539', '2'), + ('0.99', '585', '2007-02-19T10:16:25.996577', '2674', '1'), + ('0.99', '115', '2007-03-02T00:39:29.996577', '10919', '2'), + ('0.99', '402', '2007-03-02T04:36:20.996577', '11045', '2'), + ('0.99', '303', '2007-03-18T06:23:35.996577', '12365', '1'), + ('0.99', '36', '2007-02-19T14:34:07.996577', '2741', '2'), + ('4.99', '317', '2007-03-22T17:38:18.996577', '15280', '1'), + ('5.99', '87', '2007-04-29T00:31:12.996577', '8286', '1'), + ('0.99', '101', '2007-03-21T11:59:33.996577', '14476', '1'), + ('5.99', '400', '2007-04-30T10:21:06.996577', '9177', '2'), + ('4.99', '322', '2007-04-06T05:57:25.996577', '3646', '1'), + ('4.99', '537', '2007-05-14T13:44:29.996577', '13419', '1'), + ('2.99', '111', '2007-03-02T11:55:37.996577', '11239', '2'), + ('9.99', '497', '2007-04-30T13:34:02.996577', '9273', '1'), + ('5.99', '399', '2007-04-29T06:39:57.996577', '8461', '2'), + ('0.99', '212', '2007-02-15T13:33:36.996577', '1379', '2'), + ('4.99', '330', '2007-03-18T20:45:30.996577', '12740', '1'), + ('6.99', '445', '2007-03-21T16:31:41.996577', '14612', '1'), + ('4.99', '507', '2007-03-18T05:43:39.996577', '12343', '1'), + ('5.99', '7', '2007-04-29T05:31:21.996577', '8422', '2'), + ('2.99', '35', '2007-03-20T08:59:27.996577', '13735', '1'), + ('0.99', '457', '2007-02-17T11:41:53.996577', '2030', '1'), + ('5.99', '472', '2007-04-30T00:56:48.996577', '8929', '2'), + ('3.99', '512', '2007-03-22T18:42:39.996577', '15317', '1'), + ('2.99', '13', '2007-04-06T20:07:50.996577', '3946', '2'), + ('4.99', '282', '2007-04-28T23:55:48.996577', '8270', '2'), + ('5.99', '530', '2007-03-21T19:34:55.996577', '14707', '2'), + ('4.99', '275', '2007-03-21T20:41:11.996577', '14727', '2'), + ('0.99', '579', '2007-03-23T05:01:52.996577', '15601', '2'), + ('3.99', '190', '2007-04-12T18:35:13.996577', '6867', '2'), + ('1.99', '535', '2007-03-18T21:01:05.996577', '12750', '2'), + ('2.99', '87', '2007-04-27T22:07:12.996577', '7599', '2'), + ('2.99', '101', '2007-04-09T04:44:29.996577', '5100', '2'), + ('0.99', '230', '2007-04-09T02:59:16.996577', '5061', '1'), + ('0.99', '198', '2007-03-01T15:56:24.996577', '10679', '1'), + ('3.99', '539', '2007-02-15T06:53:59.996577', '1282', '2'), + ('2.99', '7', '2007-03-18T20:23:27.996577', '12730', '1'), + ('2.99', '14', '2007-04-30T01:49:42.996577', '9592', '1'), + ('4.99', '570', '2007-04-11T13:35:45.996577', '6253', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['18532', '29249', '26084', '25308', '29889', '18414', '26328', '23745', '21610', '31934', '19313', '26217', '29796', '22340', '28431', '21554', '29262', '30762', '19686', '18406', '23028', '31291', '26333', '23494', '30215', '28885', '20007', '22450', '25767', '30602', '28138', '27570', '24424', '26346', '23523', '23784', '18106', '26497', '22612', '23167', '23822', '24356', '30365', '30267', '17524', '31277', '31075', '26794', '22985', '30206', '25582', '23928', '29640', '22337', '22064', '19586', '25879', '23838', '28821', '28248', '28135', '22099', '22327', '23728', '20264', '20174', '17671', '30644', '23676', '31897', '29146', '26492', '22231', '29622', '24660', '27566', '27267', '26211', '19884', '20386', '28436', '19665', '24353', '30879', '23692', '19420', '28621', '19906', '23786', '17582', '30829', '22736', '26079', '19755', '29625', '22773', '23924', '26594', '31946', '21269']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('4.99', '10', '2007-02-16T18:50:19.996577', '1801', '1'), + ('2.99', '25', '2007-04-10T17:48:09.996577', '5881', '1'), + ('4.99', '348', '2007-04-05T22:15:56.996577', '3494', '2'), + ('6.99', '282', '2007-04-10T20:22:08.996577', '5926', '1'), + ('0.99', '80', '2007-04-27T20:47:34.996577', '7558', '2'), + ('7.99', '585', '2007-02-15T11:08:18.996577', '1346', '2'), + ('8.99', '368', '2007-04-08T19:56:14.996577', '4913', '2'), + ('0.99', '115', '2007-03-18T06:23:40.996577', '12366', '2'), + ('2.99', '486', '2007-03-18T15:34:48.996577', '12609', '2'), + ('2.99', '330', '2007-05-14T13:44:29.996577', '11709', '2'), + ('4.99', '215', '2007-02-15T13:27:32.996577', '1376', '2'), + ('4.99', '359', '2007-04-30T12:40:29.996577', '9898', '1'), + ('2.99', '73', '2007-04-07T16:30:05.996577', '4327', '2'), + ('1.99', '566', '2007-03-17T15:25:23.996577', '11941', '1'), + ('2.99', '560', '2007-04-07T14:55:51.996577', '4298', '1'), + ('2.99', '479', '2007-03-20T17:23:25.996577', '13974', '1'), + ('6.99', '26', '2007-04-07T21:07:28.996577', '4431', '1'), + ('2.99', '156', '2007-04-10T14:55:51.996577', '5828', '1'), + ('2.99', '282', '2007-03-20T09:29:03.996577', '13749', '2'), + ('9.99', '583', '2007-02-18T16:16:54.996577', '2429', '1'), + ('4.99', '35', '2007-03-21T20:53:35.996577', '14735', '2'), + ('8.99', '210', '2007-04-29T02:49:08.996577', '8336', '2'), + ('0.99', '368', '2007-04-28T15:18:04.996577', '8045', '1'), + ('4.99', '84', '2007-03-17T15:52:56.996577', '11960', '2'), + ('2.99', '108', '2007-04-07T03:40:19.996577', '4082', '2'), + ('4.99', '597', '2007-04-30T16:53:05.996577', '10021', '2'), + ('8.99', '319', '2007-03-18T08:45:23.996577', '12424', '2'), + ('3.99', '579', '2007-03-02T21:19:49.996577', '11494', '1'), + ('4.99', '320', '2007-04-28T10:49:34.996577', '7930', '2'), + ('4.99', '142', '2007-04-08T00:19:58.996577', '4497', '2'), + ('4.99', '530', '2007-04-30T13:19:45.996577', '9914', '1'), + ('2.99', '481', '2007-04-10T09:05:46.996577', '5711', '2'), + ('6.99', '181', '2007-03-01T19:22:11.996577', '10773', '1'), + ('0.99', '369', '2007-04-30T06:52:05.996577', '9089', '1'), + ('5.99', '87', '2007-03-18T02:45:59.996577', '12264', '1'), + ('3.99', '119', '2007-03-21T07:23:19.996577', '14349', '2'), + ('4.99', '498', '2007-02-18T17:47:02.996577', '2449', '1'), + ('4.99', '383', '2007-04-11T04:17:44.996577', '6091', '2'), + ('2.99', '598', '2007-03-18T15:16:18.996577', '12601', '2'), + ('6.99', '51', '2007-03-17T07:36:22.996577', '11751', '2'), + ('2.99', '122', '2007-03-19T12:17:20.996577', '13171', '1'), + ('4.99', '174', '2007-03-23T18:34:49.996577', '15975', '1'), + ('4.99', '122', '2007-04-08T03:52:25.996577', '4568', '1'), + ('5.99', '113', '2007-04-10T12:00:22.996577', '5774', '1'), + ('0.99', '345', '2007-02-16T00:27:01.996577', '1550', '2'), + ('4.99', '210', '2007-04-06T17:09:59.996577', '3884', '2'), + ('8.99', '182', '2007-04-28T15:18:52.996577', '8048', '2'), + ('1.99', '409', '2007-04-29T16:37:48.996577', '8726', '1'), + ('2.99', '30', '2007-03-21T15:46:59.996577', '14585', '1'), + ('5.99', '107', '2007-04-12T16:22:59.996577', '6811', '1'), + ('4.99', '303', '2007-04-27T01:01:10.996577', '7023', '1'), + ('2.99', '133', '2007-03-19T18:16:33.996577', '13323', '2'), + ('9.99', '58', '2007-04-27T02:20:53.996577', '7063', '1'), + ('6.99', '566', '2007-03-01T02:08:14.996577', '10289', '2'), + ('5.99', '535', '2007-03-22T09:33:18.996577', '15075', '2'), + ('2.99', '273', '2007-03-22T20:28:17.996577', '15372', '2'), + ('4.99', '330', '2007-04-29T14:36:29.996577', '8680', '1'), + ('2.99', '125', '2007-03-01T12:23:01.996577', '10583', '1'), + ('3.99', '592', '2007-04-27T10:19:00.996577', '7278', '1'), + ('4.99', '539', '2007-04-30T09:21:09.996577', '9796', '1'), + ('4.99', '530', '2007-04-27T08:02:50.996577', '7218', '1'), + ('6.99', '540', '2007-03-02T18:38:27.996577', '11432', '2'), + ('4.99', '565', '2007-03-16T21:54:14.996577', '11506', '2'), + ('2.99', '113', '2007-03-19T20:50:27.996577', '13406', '2'), + ('2.99', '347', '2007-03-22T22:35:45.996577', '15426', '2'), + ('6.99', '338', '2007-03-22T13:54:55.996577', '15173', '2'), + ('2.99', '383', '2007-02-18T03:33:44.996577', '2252', '1'), + ('2.99', '145', '2007-04-11T02:29:53.996577', '6056', '2'), + ('4.99', '107', '2007-03-01T00:08:30.996577', '10226', '1'), + ('4.99', '265', '2007-04-11T20:00:17.996577', '6371', '2'), + ('4.99', '14', '2007-04-09T17:42:58.996577', '5383', '1'), + ('9.99', '382', '2007-04-29T22:41:07.996577', '8871', '1'), + ('4.99', '555', '2007-03-02T08:48:08.996577', '11168', '1'), + ('4.99', '57', '2007-04-06T09:45:09.996577', '3727', '1'), + ('7.99', '212', '2007-03-17T22:55:59.996577', '12156', '1'), + ('2.99', '481', '2007-04-07T22:50:36.996577', '4473', '1'), + ('8.99', '453', '2007-04-07T01:04:12.996577', '4033', '2'), + ('9.99', '359', '2007-04-11T22:18:03.996577', '6424', '2'), + ('4.99', '304', '2007-03-22T04:34:04.996577', '14945', '1'), + ('2.99', '361', '2007-03-02T15:09:13.996577', '11327', '1'), + ('2.99', '560', '2007-04-26T22:03:55.996577', '6945', '1'), + ('3.99', '279', '2007-03-21T19:56:09.996577', '14714', '1'), + ('5.99', '174', '2007-03-19T02:06:58.996577', '12886', '2'), + ('2.99', '166', '2007-04-27T21:43:01.996577', '7581', '1'), + ('6.99', '109', '2007-03-17T22:20:52.996577', '12137', '2'), + ('5.99', '243', '2007-02-19T15:29:40.996577', '2757', '2'), + ('1.99', '576', '2007-04-27T11:59:51.996577', '7319', '2'), + ('2.99', '306', '2007-03-22T23:36:03.996577', '15457', '1'), + ('6.99', '119', '2007-03-21T17:40:24.996577', '14643', '2'), + ('6.99', '360', '2007-02-19T16:47:59.996577', '2780', '2'), + ('2.99', '162', '2007-04-08T22:59:18.996577', '4982', '2'), + ('6.99', '6', '2007-03-17T00:58:07.996577', '11591', '1'), + ('2.99', '347', '2007-04-29T18:23:07.996577', '8771', '2'), + ('1.99', '290', '2007-03-19T12:56:25.996577', '13190', '2'), + ('0.99', '57', '2007-04-10T08:09:04.996577', '5694', '1'), + ('8.99', '10', '2007-03-01T15:38:25.996577', '10671', '2'), + ('4.99', '132', '2007-03-23T14:59:21.996577', '15874', '1'), + ('2.99', '392', '2007-04-28T01:58:47.996577', '7692', '1'), + ('0.00', '361', '2007-05-14T13:44:29.996577', '14769', '1'), + ('2.99', '451', '2007-03-20T06:48:45.996577', '13666', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['27377', '29184', '24327', '21487', '26044', '25284', '20099', '27176', '23023', '29044', '28366', '18732', '21409', '31372', '19615', '25682', '24180', '29225', '28658', '18396', '24331', '23921', '18578', '28426', '30301', '18903', '28115', '22755', '26781', '23388', '18208', '24721', '28691', '21354', '18902', '18566', '21568', '25784', '31957', '20856', '25584', '27526', '23727', '28715', '27269', '28102', '23062', '29588', '31724', '30201', '30207', '21424', '22498', '22343', '28278', '26307', '25257', '30794', '25790', '21411', '18745', '26735', '22872', '31714', '30636', '27721', '18201', '31557', '32091', '20837', '26075', '22774', '23720', '28659', '28105', '28552', '29133', '20063', '22907', '29318', '23704', '21962', '17613', '21483', '30484', '17740', '24833', '18949', '28836', '23541', '20611', '24378', '19237', '28280', '29045', '30943', '25293', '28712', '22266', '23039']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('0.99', '463', '2007-04-27T00:31:47.996577', '7013', '1'), + ('3.99', '18', '2007-04-08T11:14:56.996577', '4724', '2'), + ('0.99', '171', '2007-03-23T13:11:41.996577', '15810', '2'), + ('0.99', '472', '2007-03-01T14:01:29.996577', '10627', '1'), + ('3.99', '345', '2007-04-09T23:18:27.996577', '5508', '2'), + ('0.99', '280', '2007-04-12T18:00:40.996577', '6851', '2'), + ('0.99', '330', '2007-03-19T01:08:37.996577', '12867', '1'), + ('0.99', '444', '2007-04-06T00:07:34.996577', '3539', '1'), + ('4.99', '35', '2007-03-17T03:19:22.996577', '11645', '1'), + ('3.99', '5', '2007-04-12T09:56:01.996577', '6663', '1'), + ('4.99', '553', '2007-04-07T12:47:07.996577', '4257', '1'), + ('0.99', '57', '2007-02-17T17:44:11.996577', '2105', '1'), + ('4.99', '465', '2007-03-18T23:26:50.996577', '12814', '1'), + ('7.99', '219', '2007-04-10T10:20:16.996577', '5739', '2'), + ('2.99', '275', '2007-03-21T05:41:49.996577', '14296', '1'), + ('4.99', '312', '2007-04-28T18:35:44.996577', '8137', '1'), + ('0.99', '155', '2007-03-22T10:30:14.996577', '15106', '1'), + ('2.99', '23', '2007-04-06T12:22:07.996577', '3781', '2'), + ('6.99', '579', '2007-04-12T16:55:12.996577', '6824', '2'), + ('3.99', '579', '2007-02-18T23:12:08.996577', '2522', '1'), + ('4.99', '172', '2007-03-18T05:58:12.996577', '12350', '2'), + ('0.99', '132', '2007-03-02T07:56:11.996577', '11140', '2'), + ('1.99', '23', '2007-02-19T15:13:01.996577', '2753', '1'), + ('1.99', '559', '2007-04-29T12:36:32.996577', '8631', '1'), + ('4.99', '115', '2007-04-29T11:10:39.996577', '8594', '1'), + ('0.99', '104', '2007-02-17T17:59:42.996577', '2107', '1'), + ('8.99', '528', '2007-04-30T22:11:08.996577', '9488', '2'), + ('0.99', '7', '2007-03-20T04:21:57.996577', '13594', '1'), + ('5.99', '409', '2007-04-06T16:15:46.996577', '3866', '1'), + ('2.99', '73', '2007-03-23T19:15:38.996577', '16002', '2'), + ('7.99', '526', '2007-02-17T00:18:02.996577', '1865', '2'), + ('2.99', '219', '2007-03-02T15:11:04.996577', '11328', '1'), + ('4.99', '581', '2007-04-10T08:54:40.996577', '5707', '1'), + ('4.99', '460', '2007-03-18T14:23:05.996577', '12586', '2'), + ('3.99', '104', '2007-02-15T07:10:04.996577', '1287', '2'), + ('2.99', '19', '2007-02-19T21:24:03.996577', '2848', '1'), + ('2.99', '481', '2007-03-17T23:06:25.996577', '12160', '2'), + ('1.99', '322', '2007-04-06T04:47:51.996577', '3627', '2'), + ('2.99', '417', '2007-05-14T13:44:29.996577', '13261', '2'), + ('2.99', '408', '2007-03-20T16:09:42.996577', '13944', '1'), + ('0.99', '303', '2007-04-29T05:09:48.996577', '8409', '1'), + ('2.99', '477', '2007-04-07T13:58:01.996577', '4283', '1'), + ('3.99', '113', '2007-03-18T23:33:01.996577', '12817', '2'), + ('5.99', '583', '2007-04-27T14:46:21.996577', '7401', '1'), + ('2.99', '453', '2007-04-08T15:27:38.996577', '4805', '2'), + ('1.99', '527', '2007-04-26T23:08:20.996577', '6975', '2'), + ('5.99', '38', '2007-03-23T10:24:16.996577', '15738', '1'), + ('4.99', '52', '2007-04-30T04:31:37.996577', '9029', '1'), + ('5.99', '248', '2007-04-28T05:38:37.996577', '7778', '2'), + ('4.99', '107', '2007-04-09T14:31:20.996577', '5311', '2'), + ('6.99', '107', '2007-04-26T21:39:29.996577', '6934', '2'), + ('2.99', '467', '2007-03-02T15:21:23.996577', '11332', '2'), + ('5.99', '584', '2007-03-18T18:38:45.996577', '12693', '2'), + ('4.99', '566', '2007-03-20T09:57:58.996577', '13762', '2'), + ('4.99', '543', '2007-04-29T21:34:39.996577', '8845', '2'), + ('4.99', '366', '2007-04-27T22:17:01.996577', '7602', '2'), + ('0.99', '277', '2007-04-10T16:42:48.996577', '5861', '1'), + ('2.99', '158', '2007-04-28T11:52:15.996577', '7952', '2'), + ('4.99', '322', '2007-04-27T03:12:36.996577', '7091', '1'), + ('3.99', '465', '2007-03-23T02:56:20.996577', '15550', '1'), + ('0.99', '62', '2007-02-15T19:53:56.996577', '1486', '1'), + ('2.99', '405', '2007-04-27T17:03:07.996577', '7455', '1'), + ('2.99', '20', '2007-03-21T16:31:46.996577', '14613', '2'), + ('2.99', '247', '2007-04-08T00:00:30.996577', '4492', '1'), + ('4.99', '144', '2007-04-30T10:10:36.996577', '9174', '2'), + ('2.99', '494', '2007-04-09T08:35:19.996577', '5180', '1'), + ('0.99', '523', '2007-02-19T09:57:18.996577', '2669', '2'), + ('4.99', '235', '2007-04-06T21:15:35.996577', '3968', '1'), + ('0.99', '234', '2007-05-14T13:44:29.996577', '15778', '1'), + ('8.99', '407', '2007-03-02T10:48:16.996577', '11214', '1'), + ('4.99', '347', '2007-04-28T19:08:13.996577', '8148', '2'), + ('2.99', '10', '2007-03-02T13:23:26.996577', '11289', '2'), + ('8.99', '112', '2007-03-23T08:14:59.996577', '15687', '1'), + ('8.99', '579', '2007-04-26T22:52:20.996577', '6969', '2'), + ('0.99', '527', '2007-04-30T07:48:12.996577', '9750', '2'), + ('4.99', '570', '2007-04-30T08:14:55.996577', '9766', '1'), + ('2.99', '13', '2007-04-12T19:59:07.996577', '6897', '1'), + ('6.99', '327', '2007-03-17T14:57:17.996577', '11929', '2'), + ('4.99', '23', '2007-03-19T18:28:51.996577', '13331', '2'), + ('4.99', '30', '2007-04-28T05:13:49.996577', '7769', '2'), + ('3.99', '111', '2007-03-18T00:37:14.996577', '12196', '2'), + ('10.99', '526', '2007-03-16T21:39:00.996577', '11503', '1'), + ('4.99', '368', '2007-02-19T11:45:47.996577', '2694', '1'), + ('7.99', '471', '2007-03-22T04:26:53.996577', '14942', '2'), + ('2.99', '132', '2007-04-06T14:18:29.996577', '3825', '2'), + ('0.99', '400', '2007-02-15T12:33:58.996577', '1364', '2'), + ('2.99', '233', '2007-03-22T17:45:50.996577', '15285', '2'), + ('0.99', '115', '2007-02-15T12:06:04.996577', '1361', '2'), + ('4.99', '593', '2007-04-28T12:03:00.996577', '7958', '2'), + ('2.99', '89', '2007-03-20T12:10:36.996577', '13823', '1'), + ('0.99', '383', '2007-03-02T03:13:27.996577', '10993', '2'), + ('4.99', '177', '2007-03-01T03:08:28.996577', '10321', '2'), + ('3.99', '190', '2007-02-19T02:37:29.996577', '2568', '1'), + ('0.99', '543', '2007-04-30T16:09:19.996577', '9999', '1'), + ('4.99', '5', '2007-04-12T10:44:54.996577', '6685', '2'), + ('4.99', '171', '2007-04-30T05:57:20.996577', '9066', '2'), + ('0.99', '280', '2007-04-30T07:17:52.996577', '9103', '2'), + ('5.99', '583', '2007-04-09T22:13:41.996577', '5478', '1'), + ('1.99', '559', '2007-03-19T14:45:41.996577', '13234', '1'), + ('4.99', '36', '2007-03-23T07:11:06.996577', '15657', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['29538', '21388', '30300', '18757', '23456', '18338', '23842', '29986', '31861', '29406', '18967', '23597', '19078', '23487', '29824', '22024', '29674', '29393', '23498', '29683', '31056', '18384', '25437', '21361', '18731', '25686', '23245', '22021', '22499', '17969', '27332', '19580', '30169', '31556', '18899', '30060', '19179', '24003', '18515', '24043', '27694', '27562', '26870', '20778', '21629', '22031', '22053', '24121', '27328', '30376', '28275', '24032', '26679', '24987', '24062', '27726', '29170', '20762', '28057', '18260', '21208', '28443', '18682', '22777', '23657', '28157', '21406', '27464', '20310', '32018', '28324', '29910', '28608', '30213', '29256', '22105', '20707', '30364', '29881', '17795', '30491', '19694', '28442', '22564', '21282', '22605', '27598', '28665', '24854', '19781', '19626', '30708', '23926', '27590', '19716', '17578', '19157', '27638', '20166', '20371']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('0.99', '49', '2007-04-06T04:16:13.996577', '3615', '2'), + ('3.99', '463', '2007-03-01T01:48:34.996577', '10275', '1'), + ('4.99', '115', '2007-04-28T12:51:27.996577', '7983', '1'), + ('2.99', '66', '2007-02-17T03:36:53.996577', '1907', '1'), + ('0.99', '80', '2007-03-20T13:12:48.996577', '13851', '2'), + ('4.99', '565', '2007-02-15T18:55:28.996577', '1460', '2'), + ('4.99', '125', '2007-03-17T11:23:57.996577', '11832', '1'), + ('2.99', '89', '2007-04-30T16:00:37.996577', '9328', '1'), + ('7.99', '262', '2007-04-12T13:53:59.996577', '6762', '2'), + ('1.99', '38', '2007-04-07T11:10:28.996577', '4228', '2'), + ('4.99', '120', '2007-02-16T20:03:16.996577', '1820', '1'), + ('4.99', '96', '2007-03-18T00:37:49.996577', '12199', '1'), + ('2.99', '149', '2007-02-15T22:27:19.996577', '1521', '2'), + ('5.99', '83', '2007-03-23T10:20:44.996577', '15737', '2'), + ('0.99', '75', '2007-04-12T03:01:45.996577', '6530', '2'), + ('3.99', '532', '2007-03-17T19:42:01.996577', '12061', '2'), + ('4.99', '62', '2007-04-29T03:36:26.996577', '8360', '2'), + ('6.99', '36', '2007-04-28T10:28:11.996577', '7919', '2'), + ('4.99', '84', '2007-03-22T14:26:04.996577', '15190', '1'), + ('5.99', '63', '2007-04-29T01:54:33.996577', '8311', '2'), + ('0.99', '181', '2007-04-27T14:31:18.996577', '7393', '1'), + ('0.99', '576', '2007-02-18T07:11:50.996577', '2309', '1'), + ('4.99', '292', '2007-04-09T04:36:48.996577', '5095', '2'), + ('2.99', '460', '2007-03-23T17:42:33.996577', '15954', '2'), + ('5.99', '57', '2007-02-17T14:03:07.996577', '2058', '1'), + ('3.99', '312', '2007-04-30T09:28:20.996577', '9154', '1'), + ('4.99', '58', '2007-03-20T17:21:09.996577', '13973', '2'), + ('5.99', '532', '2007-03-02T01:48:49.996577', '10945', '1'), + ('2.99', '584', '2007-03-19T00:27:34.996577', '12844', '1'), + ('0.99', '459', '2007-02-17T01:19:17.996577', '1876', '2'), + ('2.99', '459', '2007-04-29T23:28:43.996577', '8897', '1'), + ('0.99', '273', '2007-03-18T18:37:45.996577', '12692', '1'), + ('4.99', '104', '2007-04-06T23:24:35.996577', '4012', '2'), + ('6.99', '235', '2007-04-06T10:58:38.996577', '3752', '1'), + ('0.99', '103', '2007-02-17T18:56:55.996577', '2118', '1'), + ('2.99', '96', '2007-04-06T10:30:04.996577', '3742', '2'), + ('2.99', '177', '2007-02-15T22:54:18.996577', '1524', '1'), + ('2.99', '140', '2007-03-22T16:53:00.996577', '15261', '1'), + ('4.99', '5', '2007-02-17T14:25:19.996577', '2063', '2'), + ('6.99', '144', '2007-03-02T20:32:13.996577', '11476', '2'), + ('6.99', '491', '2007-04-27T10:27:46.996577', '7281', '2'), + ('4.99', '480', '2007-04-29T21:42:07.996577', '8847', '2'), + ('4.99', '417', '2007-04-11T16:47:28.996577', '6312', '1'), + ('4.99', '400', '2007-03-23T18:51:34.996577', '15988', '2'), + ('5.99', '488', '2007-03-18T11:07:03.996577', '12483', '2'), + ('1.99', '532', '2007-03-22T22:12:20.996577', '15414', '2'), + ('3.99', '535', '2007-03-01T04:14:59.996577', '10353', '2'), + ('2.99', '150', '2007-03-18T05:27:41.996577', '12335', '2'), + ('5.99', '459', '2007-04-28T06:57:17.996577', '7820', '1'), + ('4.99', '122', '2007-04-30T13:16:23.996577', '9910', '2'), + ('4.99', '543', '2007-04-11T00:30:29.996577', '6013', '2'), + ('6.99', '143', '2007-03-02T12:58:09.996577', '11278', '1'), + ('4.99', '400', '2007-04-30T07:53:26.996577', '9756', '2'), + ('6.99', '250', '2007-03-22T16:20:31.996577', '15247', '2'), + ('5.99', '145', '2007-03-20T20:17:04.996577', '14044', '2'), + ('2.99', '494', '2007-04-29T23:17:43.996577', '8895', '2'), + ('2.99', '16', '2007-04-27T20:32:07.996577', '7552', '2'), + ('5.99', '399', '2007-03-02T02:14:44.996577', '10960', '2'), + ('6.99', '523', '2007-04-30T04:52:18.996577', '9667', '2'), + ('3.99', '540', '2007-02-20T05:07:37.996577', '2953', '1'), + ('2.99', '445', '2007-03-21T18:29:44.996577', '14673', '2'), + ('5.99', '560', '2007-04-30T12:36:22.996577', '9895', '2'), + ('2.99', '45', '2007-02-17T08:13:56.996577', '1979', '2'), + ('2.99', '10', '2007-03-18T07:47:38.996577', '12400', '2'), + ('3.99', '104', '2007-03-21T03:12:25.996577', '14218', '1'), + ('7.99', '532', '2007-04-09T12:09:43.996577', '5253', '1'), + ('4.99', '465', '2007-03-17T00:49:08.996577', '11586', '1'), + ('5.99', '471', '2007-04-12T20:45:42.996577', '6912', '1'), + ('0.99', '352', '2007-03-17T16:50:24.996577', '11986', '2'), + ('2.99', '23', '2007-05-14T13:44:29.996577', '15532', '2'), + ('4.99', '549', '2007-04-06T17:27:24.996577', '3892', '2'), + ('2.99', '83', '2007-04-06T11:04:10.996577', '3754', '1'), + ('2.99', '575', '2007-04-12T20:32:15.996577', '6907', '2'), + ('2.99', '107', '2007-04-30T16:56:56.996577', '9351', '2'), + ('2.99', '25', '2007-04-30T13:28:03.996577', '9922', '2'), + ('3.99', '540', '2007-03-23T17:42:12.996577', '15953', '2'), + ('5.99', '392', '2007-03-21T10:19:36.996577', '14438', '2'), + ('7.99', '122', '2007-04-07T11:51:43.996577', '4239', '1'), + ('8.99', '80', '2007-04-07T13:04:31.996577', '4268', '2'), + ('0.99', '416', '2007-02-16T00:31:10.996577', '1553', '2'), + ('0.99', '132', '2007-04-10T08:32:41.996577', '5703', '1'), + ('7.99', '284', '2007-03-01T05:37:12.996577', '10396', '1'), + ('0.99', '560', '2007-04-30T13:23:51.996577', '9265', '1'), + ('0.99', '592', '2007-03-18T15:52:41.996577', '12619', '2'), + ('2.99', '453', '2007-03-18T19:05:39.996577', '12703', '1'), + ('4.99', '597', '2007-03-17T20:39:12.996577', '12081', '1'), + ('4.99', '483', '2007-04-29T03:27:22.996577', '8356', '1'), + ('5.99', '579', '2007-04-30T00:35:00.996577', '9553', '2'), + ('6.99', '235', '2007-03-22T08:01:34.996577', '15034', '1'), + ('2.99', '294', '2007-03-01T12:53:47.996577', '10600', '2'), + ('4.99', '276', '2007-03-18T02:27:28.996577', '12251', '2'), + ('4.99', '150', '2007-04-28T01:54:47.996577', '7690', '2'), + ('4.99', '133', '2007-03-18T08:30:14.996577', '12419', '1'), + ('4.99', '483', '2007-04-06T01:18:08.996577', '3559', '2'), + ('4.99', '286', '2007-03-20T17:26:49.996577', '13975', '1'), + ('4.99', '359', '2007-02-19T14:11:46.996577', '2736', '1'), + ('0.99', '172', '2007-02-17T13:43:09.996577', '2052', '1'), + ('4.99', '486', '2007-04-11T20:35:19.996577', '6383', '2'), + ('0.99', '338', '2007-03-01T23:52:08.996577', '10897', '1'), + ('2.99', '360', '2007-03-01T22:35:46.996577', '10857', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['24066', '25604', '19927', '18915', '25979', '23188', '30348', '28618', '23407', '29067', '26499', '27250', '22873', '24350', '22517', '31235', '28624', '22280', '19657', '32042', '20275', '19330', '22175', '28447', '22353', '19363', '28779', '24840', '22574', '24120', '21969', '29454', '27688', '21914', '29308', '17856', '21244', '18562', '24188', '20021', '25764', '21871', '18939', '24640', '21028', '26241', '27697', '30375', '30791', '18885', '20195', '30792', '18476', '26301', '31337', '27188', '25467', '17532', '22676', '27379', '26141', '18357', '20441', '22724', '19108', '21628', '18970', '20818', '31510', '20317', '25458', '24730', '22379', '27879', '31978', '31099', '28628', '27757', '31371', '29678', '20101', '25215', '25394', '27728', '29196', '19125', '18045', '17640', '31712', '18379', '17548', '26673', '19901', '29585', '23387', '19900', '29961', '28823', '22324', '18819']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('0.99', '146', '2007-03-02T16:34:27.996577', '11370', '2'), + ('4.99', '305', '2007-04-10T02:36:51.996577', '5582', '2'), + ('2.99', '308', '2007-03-23T13:31:39.996577', '15820', '2'), + ('3.99', '107', '2007-02-20T10:30:31.996577', '3033', '1'), + ('4.99', '338', '2007-04-09T14:28:42.996577', '5309', '1'), + ('5.99', '52', '2007-03-23T15:28:38.996577', '15891', '2'), + ('0.99', '120', '2007-04-28T15:18:07.996577', '8046', '2'), + ('4.99', '576', '2007-04-08T01:09:51.996577', '4514', '1'), + ('1.99', '75', '2007-03-18T05:28:07.996577', '12336', '1'), + ('7.99', '7', '2007-04-10T20:03:38.996577', '5921', '1'), + ('4.99', '383', '2007-04-12T14:30:10.996577', '6775', '1'), + ('3.99', '451', '2007-04-08T23:50:10.996577', '5005', '1'), + ('6.99', '20', '2007-03-22T08:48:24.996577', '15057', '2'), + ('4.99', '174', '2007-03-01T05:40:15.996577', '10398', '2'), + ('2.99', '586', '2007-03-21T13:43:45.996577', '14533', '2'), + ('5.99', '199', '2007-04-10T07:16:02.996577', '5680', '2'), + ('5.99', '576', '2007-04-30T08:27:26.996577', '9133', '1'), + ('1.99', '560', '2007-03-21T07:06:50.996577', '14341', '1'), + ('2.99', '279', '2007-03-16T22:23:00.996577', '11515', '1'), + ('4.99', '83', '2007-05-14T13:44:29.996577', '11563', '2'), + ('0.99', '348', '2007-03-20T07:24:19.996577', '13684', '2'), + ('3.99', '219', '2007-02-18T15:40:27.996577', '2417', '2'), + ('0.99', '549', '2007-03-01T01:56:59.996577', '10281', '2'), + ('4.99', '561', '2007-04-12T17:42:31.996577', '6843', '1'), + ('2.99', '568', '2007-03-01T03:35:29.996577', '10340', '1'), + ('8.99', '230', '2007-02-18T17:54:13.996577', '2450', '2'), + ('3.99', '589', '2007-04-27T15:55:53.996577', '7431', '2'), + ('0.99', '234', '2007-03-02T05:41:29.996577', '11073', '1'), + ('5.99', '593', '2007-03-21T09:15:50.996577', '14408', '1'), + ('6.99', '150', '2007-03-18T02:44:09.996577', '12260', '2'), + ('6.99', '526', '2007-03-21T12:21:59.996577', '14487', '2'), + ('4.99', '41', '2007-04-27T05:44:04.996577', '7153', '2'), + ('8.99', '491', '2007-04-07T01:56:25.996577', '4046', '1'), + ('5.99', '520', '2007-03-18T16:58:17.996577', '12647', '1'), + ('4.99', '30', '2007-04-06T20:51:28.996577', '3964', '1'), + ('4.99', '432', '2007-02-20T22:28:23.996577', '3194', '2'), + ('6.99', '449', '2007-03-01T16:22:09.996577', '10688', '2'), + ('4.99', '18', '2007-02-16T17:51:49.996577', '1783', '2'), + ('4.99', '156', '2007-03-22T00:09:15.996577', '14831', '2'), + ('5.99', '321', '2007-03-23T15:24:40.996577', '15888', '2'), + ('2.99', '320', '2007-04-07T08:25:52.996577', '4173', '2'), + ('3.99', '515', '2007-03-17T05:19:31.996577', '11691', '1'), + ('4.99', '113', '2007-02-17T15:14:37.996577', '2077', '2'), + ('6.99', '210', '2007-03-21T17:30:05.996577', '14639', '2'), + ('5.99', '425', '2007-03-20T22:27:28.996577', '14089', '2'), + ('2.99', '361', '2007-04-27T20:06:30.996577', '7538', '1'), + ('2.99', '491', '2007-04-30T17:15:46.996577', '10036', '2'), + ('5.99', '122', '2007-04-29T18:23:51.996577', '8772', '1'), + ('5.99', '158', '2007-04-12T20:14:59.996577', '6901', '2'), + ('5.99', '98', '2007-02-16T03:40:07.996577', '1590', '2'), + ('4.99', '340', '2007-03-21T11:16:04.996577', '14457', '1'), + ('2.99', '158', '2007-04-27T05:52:26.996577', '7159', '2'), + ('2.99', '204', '2007-02-15T09:17:43.996577', '1321', '1'), + ('6.99', '366', '2007-04-12T03:08:04.996577', '6533', '2'), + ('8.99', '215', '2007-04-08T21:04:32.996577', '4940', '2'), + ('4.99', '445', '2007-04-28T12:29:13.996577', '7971', '2'), + ('4.99', '294', '2007-04-29T21:32:51.996577', '8843', '2'), + ('8.99', '347', '2007-02-20T14:33:08.996577', '3092', '1'), + ('8.99', '207', '2007-03-20T11:24:29.996577', '13809', '2'), + ('2.99', '463', '2007-04-29T17:58:28.996577', '8762', '1'), + ('0.99', '352', '2007-04-30T20:59:23.996577', '9463', '1'), + ('5.99', '570', '2007-02-17T10:16:31.996577', '2008', '2'), + ('2.99', '366', '2007-03-23T01:32:06.996577', '15514', '1'), + ('3.99', '5', '2007-03-17T14:57:19.996577', '11930', '2'), + ('0.99', '156', '2007-02-19T16:53:33.996577', '2782', '1'), + ('3.99', '488', '2007-03-17T08:49:05.996577', '11774', '1'), + ('9.99', '120', '2007-02-19T17:46:53.996577', '2803', '1'), + ('4.99', '405', '2007-03-01T08:23:07.996577', '10472', '1'), + ('2.99', '230', '2007-04-29T20:19:52.996577', '8815', '1'), + ('4.99', '353', '2007-03-17T05:38:25.996577', '11698', '2'), + ('4.99', '293', '2007-04-29T10:56:43.996577', '8589', '1'), + ('0.99', '220', '2007-03-02T04:26:38.996577', '11037', '1'), + ('3.99', '570', '2007-03-21T22:13:19.996577', '14768', '2'), + ('2.99', '507', '2007-04-30T03:31:18.996577', '9003', '1'), + ('4.99', '497', '2007-05-14T13:44:29.996577', '12698', '1'), + ('2.99', '185', '2007-04-11T05:33:32.996577', '6106', '2'), + ('2.99', '576', '2007-04-30T15:28:33.996577', '9979', '1'), + ('4.99', '497', '2007-04-09T11:41:01.996577', '5239', '1'), + ('4.99', '219', '2007-04-09T22:00:04.996577', '5475', '2'), + ('6.99', '63', '2007-04-10T02:44:09.996577', '5585', '1'), + ('2.99', '331', '2007-03-02T16:15:51.996577', '11362', '1'), + ('2.99', '273', '2007-04-12T11:12:30.996577', '6696', '2'), + ('2.99', '288', '2007-04-30T19:47:52.996577', '9429', '2'), + ('4.99', '494', '2007-04-30T03:47:23.996577', '9012', '2'), + ('9.99', '19', '2007-04-30T18:29:32.996577', '10077', '2'), + ('0.99', '162', '2007-02-20T21:17:10.996577', '3180', '2'), + ('2.99', '479', '2007-02-17T09:09:02.996577', '1987', '2'), + ('1.99', '377', '2007-02-20T13:50:58.996577', '3080', '1'), + ('2.99', '247', '2007-04-06T20:26:34.996577', '3955', '2'), + ('2.99', '575', '2007-02-15T20:22:46.996577', '1494', '2'), + ('0.99', '352', '2007-02-15T20:26:26.996577', '1498', '1'), + ('5.99', '400', '2007-04-09T10:34:11.996577', '5222', '2'), + ('2.99', '306', '2007-03-19T05:47:30.996577', '12989', '1'), + ('5.99', '52', '2007-04-27T16:09:06.996577', '7438', '2'), + ('0.99', '73', '2007-03-23T07:30:29.996577', '15667', '1'), + ('7.99', '306', '2007-03-18T01:28:37.996577', '12225', '1'), + ('4.99', '87', '2007-04-30T23:16:50.996577', '10205', '2'), + ('2.99', '592', '2007-04-29T16:52:00.996577', '8730', '1'), + ('3.99', '565', '2007-03-02T00:32:29.996577', '10913', '2'), + ('3.99', '83', '2007-02-16T05:34:32.996577', '1617', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['30500', '21205', '19058', '30086', '18325', '24190', '25183', '25361', '18077', '18979', '24433', '28650', '32040', '22479', '28697', '23496', '27191', '30699', '31223', '22326', '22511', '28941', '17664', '26901', '28423', '30264', '29260', '17584', '28214', '22308', '18963', '29641', '30796', '26866', '31326', '26030', '20553', '29975', '18888', '31234', '31529', '24667', '29016', '30655', '21491', '21651', '26326', '19419', '28467', '18884', '29396', '22913', '25245', '22699', '26300', '18386', '30698', '29259', '21016', '30335', '30831', '28255', '28662', '22272', '23845', '18931', '22473', '25595', '23929', '23244', '30262', '24681', '28718', '28468', '24388', '19629', '24756', '27634', '31340', '29713', '18546', '26069', '22754', '22922', '31369', '21963', '29804', '21916', '29989', '27308', '28622', '29671', '18531', '19050', '24686', '27753', '22304', '23540', '22981', '27841']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('2.99', '133', '2007-04-08T16:22:44.996577', '4829', '2'), + ('3.99', '445', '2007-03-17T12:49:37.996577', '11877', '1'), + ('2.99', '144', '2007-02-20T18:49:43.996577', '3145', '1'), + ('3.99', '98', '2007-04-27T04:25:05.996577', '7120', '2'), + ('4.99', '561', '2007-02-17T19:03:08.996577', '2119', '1'), + ('6.99', '156', '2007-03-22T21:54:58.996577', '15408', '1'), + ('4.99', '269', '2007-04-27T01:31:35.996577', '7032', '1'), + ('6.99', '286', '2007-04-07T12:07:27.996577', '4242', '2'), + ('3.99', '490', '2007-02-16T08:44:28.996577', '1665', '1'), + ('4.99', '122', '2007-02-19T04:12:21.996577', '2595', '2'), + ('3.99', '181', '2007-03-21T09:15:01.996577', '14406', '2'), + ('2.99', '578', '2007-04-28T22:14:07.996577', '8218', '1'), + ('0.00', '75', '2007-05-14T13:44:29.996577', '15191', '2'), + ('2.99', '582', '2007-03-17T05:55:13.996577', '11708', '1'), + ('0.99', '582', '2007-04-06T11:35:53.996577', '3767', '1'), + ('2.99', '84', '2007-03-19T09:56:09.996577', '13115', '2'), + ('4.99', '445', '2007-04-30T02:59:14.996577', '9625', '2'), + ('2.99', '149', '2007-04-09T04:21:20.996577', '5091', '1'), + ('0.99', '198', '2007-04-27T10:52:38.996577', '7287', '1'), + ('3.99', '565', '2007-03-02T17:24:54.996577', '11399', '1'), + ('2.99', '586', '2007-03-02T04:23:19.996577', '11034', '1'), + ('5.99', '204', '2007-04-30T18:34:50.996577', '9394', '1'), + ('0.99', '382', '2007-02-18T13:56:13.996577', '2389', '1'), + ('4.99', '420', '2007-04-11T04:46:30.996577', '6096', '2'), + ('2.99', '559', '2007-04-12T20:56:35.996577', '6915', '1'), + ('2.99', '113', '2007-04-09T08:51:47.996577', '5189', '2'), + ('4.99', '26', '2007-04-07T19:09:29.996577', '4382', '1'), + ('1.99', '361', '2007-02-19T01:37:42.996577', '2558', '2'), + ('5.99', '537', '2007-04-10T17:37:17.996577', '5877', '2'), + ('0.99', '563', '2007-03-23T01:16:52.996577', '15507', '2'), + ('7.99', '119', '2007-02-14T23:05:16.996577', '1179', '1'), + ('4.99', '58', '2007-04-27T18:01:11.996577', '7487', '2'), + ('1.99', '158', '2007-04-30T02:02:36.996577', '8957', '1'), + ('4.99', '417', '2007-04-06T20:19:57.996577', '3952', '1'), + ('6.99', '213', '2007-04-30T09:17:58.996577', '9150', '2'), + ('6.99', '343', '2007-04-27T02:28:01.996577', '7069', '1'), + ('2.99', '377', '2007-03-19T15:16:07.996577', '13249', '1'), + ('8.99', '89', '2007-04-08T13:29:51.996577', '4764', '1'), + ('4.99', '98', '2007-02-19T04:38:10.996577', '2601', '2'), + ('2.99', '199', '2007-04-09T18:13:24.996577', '5398', '2'), + ('0.99', '232', '2007-04-28T02:36:13.996577', '7707', '2'), + ('2.99', '213', '2007-03-01T07:38:25.996577', '10449', '1'), + ('6.99', '2', '2007-04-30T14:49:39.996577', '9296', '2'), + ('7.99', '146', '2007-04-11T05:21:35.996577', '6102', '1'), + ('4.99', '472', '2007-03-21T02:46:22.996577', '14209', '1'), + ('2.99', '490', '2007-03-22T23:23:50.996577', '15448', '1'), + ('0.99', '368', '2007-04-07T03:02:35.996577', '4066', '2'), + ('0.99', '243', '2007-02-15T18:01:18.996577', '1452', '1'), + ('4.99', '563', '2007-04-08T16:11:27.996577', '4825', '2'), + ('3.99', '98', '2007-02-15T12:21:58.996577', '1362', '1'), + ('4.99', '36', '2007-04-30T01:49:04.996577', '8952', '1'), + ('2.99', '24', '2007-03-02T10:38:11.996577', '11209', '1'), + ('4.99', '276', '2007-04-09T11:53:44.996577', '5246', '2'), + ('5.99', '2', '2007-03-21T21:10:22.996577', '14743', '2'), + ('4.99', '366', '2007-04-11T19:46:42.996577', '6366', '1'), + ('3.99', '576', '2007-02-19T08:51:22.996577', '2651', '1'), + ('0.99', '149', '2007-04-08T16:37:38.996577', '4837', '1'), + ('4.99', '26', '2007-04-07T13:10:30.996577', '4274', '1'), + ('4.99', '423', '2007-03-23T11:15:04.996577', '15755', '1'), + ('4.99', '119', '2007-04-28T18:46:16.996577', '8140', '2'), + ('4.99', '162', '2007-04-29T10:31:53.996577', '8582', '1'), + ('0.99', '540', '2007-04-12T21:00:43.996577', '6919', '1'), + ('0.99', '579', '2007-04-29T22:43:35.996577', '8876', '1'), + ('4.99', '559', '2007-03-22T23:05:47.996577', '15440', '2'), + ('2.99', '125', '2007-03-18T02:44:41.996577', '12262', '2'), + ('1.99', '111', '2007-02-17T09:58:34.996577', '1999', '2'), + ('8.99', '581', '2007-03-20T21:25:00.996577', '14070', '2'), + ('4.99', '304', '2007-04-12T12:45:18.996577', '6737', '1'), + ('1.99', '133', '2007-03-19T23:00:43.996577', '13455', '1'), + ('2.99', '58', '2007-03-20T15:43:32.996577', '13930', '1'), + ('5.99', '113', '2007-04-06T06:23:56.996577', '3657', '2'), + ('0.99', '214', '2007-03-20T08:37:06.996577', '13726', '1'), + ('1.99', '583', '2007-04-30T09:45:48.996577', '9808', '2'), + ('0.99', '563', '2007-04-08T18:15:24.996577', '4883', '1'), + ('0.99', '177', '2007-03-22T02:23:28.996577', '14883', '2'), + ('2.99', '276', '2007-03-23T09:33:43.996577', '15718', '2'), + ('4.99', '223', '2007-03-21T12:36:01.996577', '14496', '2'), + ('4.99', '486', '2007-04-07T09:54:05.996577', '4205', '1'), + ('1.99', '215', '2007-04-27T06:43:00.996577', '7180', '1'), + ('3.99', '65', '2007-04-10T10:07:41.996577', '5735', '1'), + ('2.99', '13', '2007-02-17T05:23:08.996577', '1933', '1'), + ('5.99', '347', '2007-04-07T11:17:38.996577', '4232', '1'), + ('2.99', '7', '2007-03-19T23:34:30.996577', '13476', '1'), + ('2.99', '25', '2007-03-01T22:40:58.996577', '10860', '2'), + ('0.99', '219', '2007-04-09T05:48:56.996577', '5123', '2'), + ('2.99', '526', '2007-03-17T02:17:17.996577', '11612', '1'), + ('2.99', '73', '2007-04-30T11:31:39.996577', '9212', '1'), + ('2.99', '520', '2007-03-19T22:06:28.996577', '13438', '2'), + ('4.99', '89', '2007-04-30T21:46:23.996577', '10164', '2'), + ('2.99', '457', '2007-04-29T07:44:07.996577', '8502', '1'), + ('3.99', '576', '2007-04-27T22:25:27.996577', '7605', '1'), + ('2.99', '62', '2007-04-06T15:04:06.996577', '3843', '2'), + ('4.99', '9', '2007-02-21T02:37:09.996577', '3262', '2'), + ('4.99', '143', '2007-02-17T06:12:05.996577', '1942', '1'), + ('2.99', '215', '2007-03-17T06:43:07.996577', '11729', '1'), + ('4.99', '497', '2007-04-08T01:12:07.996577', '4516', '1'), + ('1.99', '563', '2007-03-18T00:42:34.996577', '12202', '1'), + ('2.99', '89', '2007-03-18T21:20:39.996577', '12756', '1'), + ('0.99', '30', '2007-03-18T21:27:00.996577', '12758', '2'), + ('6.99', '504', '2007-04-09T07:03:31.996577', '5153', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['17892', '21013', '17523', '20058', '25800', '30955', '30228', '18446', '20702', '19124', '17774', '31224', '28418', '28016', '22451', '23285', '25416', '23287', '27588', '26342', '20097', '19158', '26337', '29098', '18859', '18517', '20387', '27457', '26305', '23035', '18702', '21901', '21709', '24041', '31280', '18924', '25335', '19661', '29086', '30124', '26096', '17894', '30338', '27246', '18257', '22378', '29715', '24067', '22691', '22446', '24963', '28242', '21296', '30973', '30247', '28440', '19608', '23318', '26868', '31367', '25250', '23646', '25981', '28130', '29072', '27973', '31713', '25998', '18832', '29444', '24207', '31673', '21900', '26308', '24844', '19667', '29833', '31755', '19876', '17723', '19992', '28463', '28455', '18480', '27032', '28782', '17514', '19235', '28402', '29710', '18084', '28623', '21291', '24753', '17554', '21195', '26897', '27990', '17945', '27727']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('4.99', '444', '2007-02-19T01:19:30.996577', '2551', '1'), + ('6.99', '423', '2007-03-21T02:04:24.996577', '14191', '2'), + ('4.99', '345', '2007-02-15T18:34:15.996577', '1457', '1'), + ('2.99', '326', '2007-03-02T18:31:36.996577', '11428', '2'), + ('7.99', '323', '2007-04-27T05:30:56.996577', '7146', '2'), + ('4.99', '172', '2007-04-27T23:41:52.996577', '7638', '1'), + ('2.99', '109', '2007-04-09T01:01:03.996577', '5027', '1'), + ('5.99', '593', '2007-02-17T13:55:29.996577', '2055', '2'), + ('0.99', '392', '2007-03-18T13:27:17.996577', '12561', '2'), + ('0.99', '162', '2007-02-20T11:02:39.996577', '3040', '1'), + ('5.99', '409', '2007-02-15T02:14:36.996577', '1226', '2'), + ('5.99', '198', '2007-04-27T16:15:19.996577', '7441', '1'), + ('5.99', '559', '2007-04-06T07:31:39.996577', '3674', '1'), + ('2.99', '520', '2007-04-29T01:01:07.996577', '8294', '1'), + ('6.99', '579', '2007-03-17T19:24:41.996577', '12051', '2'), + ('6.99', '63', '2007-03-01T02:07:08.996577', '10288', '1'), + ('2.99', '290', '2007-04-27T09:47:27.996577', '7265', '2'), + ('2.99', '63', '2007-03-18T05:41:12.996577', '12342', '2'), + ('2.99', '482', '2007-04-29T10:36:19.996577', '8584', '2'), + ('2.99', '369', '2007-04-10T01:43:50.996577', '5561', '2'), + ('2.99', '330', '2007-03-18T07:33:41.996577', '12394', '1'), + ('1.99', '172', '2007-02-20T10:26:56.996577', '3032', '2'), + ('6.99', '369', '2007-04-05T22:05:39.996577', '3490', '1'), + ('2.99', '10', '2007-04-09T03:21:44.996577', '5068', '2'), + ('2.99', '91', '2007-02-21T12:36:01.996577', '3384', '2'), + ('4.99', '5', '2007-02-20T17:06:48.996577', '3126', '2'), + ('3.99', '361', '2007-03-17T16:55:34.996577', '11991', '1'), + ('5.99', '470', '2007-04-30T19:37:07.996577', '9422', '1'), + ('1.99', '366', '2007-04-27T12:57:54.996577', '7344', '1'), + ('2.99', '36', '2007-03-20T03:00:11.996577', '13562', '2'), + ('4.99', '49', '2007-02-21T01:14:43.996577', '3235', '2'), + ('4.99', '518', '2007-03-21T00:51:13.996577', '14149', '1'), + ('6.99', '498', '2007-03-02T19:35:32.996577', '11455', '1'), + ('4.99', '144', '2007-03-02T01:55:01.996577', '10951', '1'), + ('0.99', '210', '2007-04-07T17:00:30.996577', '4334', '1'), + ('3.99', '109', '2007-02-17T02:45:10.996577', '1891', '2'), + ('2.99', '284', '2007-04-07T03:38:34.996577', '4081', '2'), + ('7.99', '279', '2007-03-19T09:34:42.996577', '13105', '1'), + ('0.99', '9', '2007-04-08T12:28:04.996577', '4748', '2'), + ('2.99', '101', '2007-04-10T11:08:43.996577', '5757', '1'), + ('2.99', '348', '2007-04-29T07:40:27.996577', '8500', '1'), + ('5.99', '444', '2007-02-21T15:28:15.996577', '3415', '2'), + ('2.99', '119', '2007-04-30T04:29:01.996577', '9028', '2'), + ('4.99', '451', '2007-04-06T14:20:24.996577', '3826', '2'), + ('2.99', '540', '2007-02-15T05:25:05.996577', '1263', '2'), + ('4.99', '570', '2007-03-17T19:05:03.996577', '12042', '2'), + ('6.99', '65', '2007-04-28T08:54:02.996577', '7877', '1'), + ('5.99', '146', '2007-03-02T17:09:37.996577', '11392', '2'), + ('0.99', '2', '2007-03-01T08:13:52.996577', '10466', '1'), + ('5.99', '578', '2007-03-19T08:29:33.996577', '13071', '2'), + ('0.99', '247', '2007-03-16T21:19:46.996577', '11495', '1'), + ('5.99', '539', '2007-04-12T18:49:19.996577', '6874', '2'), + ('6.99', '454', '2007-03-20T11:21:38.996577', '13805', '1'), + ('1.99', '174', '2007-04-08T15:25:00.996577', '4803', '2'), + ('2.99', '111', '2007-04-12T19:54:03.996577', '6896', '1'), + ('5.99', '560', '2007-04-29T22:15:55.996577', '8861', '2'), + ('1.99', '275', '2007-03-18T15:30:47.996577', '12606', '1'), + ('2.99', '66', '2007-03-20T23:59:51.996577', '14123', '2'), + ('9.99', '417', '2007-04-07T20:36:21.996577', '4421', '1'), + ('0.99', '219', '2007-04-08T08:59:06.996577', '4678', '2'), + ('4.99', '276', '2007-04-30T07:16:46.996577', '9102', '1'), + ('5.99', '103', '2007-03-22T23:42:18.996577', '15461', '1'), + ('4.99', '338', '2007-04-11T19:36:06.996577', '6360', '1'), + ('2.99', '530', '2007-04-06T07:06:55.996577', '3669', '2'), + ('7.99', '7', '2007-04-30T02:58:29.996577', '9624', '2'), + ('2.99', '517', '2007-04-08T23:18:13.996577', '4993', '1'), + ('6.99', '247', '2007-04-07T09:36:37.996577', '4198', '2'), + ('2.99', '340', '2007-04-07T22:55:56.996577', '4475', '2'), + ('3.99', '85', '2007-02-21T15:35:04.996577', '3418', '2'), + ('3.99', '40', '2007-04-28T20:00:55.996577', '8170', '2'), + ('1.99', '158', '2007-03-19T13:52:33.996577', '13212', '2'), + ('2.99', '243', '2007-04-30T05:05:33.996577', '9675', '2'), + ('6.99', '518', '2007-03-20T22:25:50.996577', '14088', '1'), + ('6.99', '366', '2007-04-28T06:25:07.996577', '7805', '1'), + ('4.99', '234', '2007-03-19T01:04:25.996577', '12863', '2'), + ('4.99', '279', '2007-03-21T22:58:05.996577', '14789', '1'), + ('4.99', '75', '2007-04-30T20:12:57.996577', '9442', '2'), + ('4.99', '252', '2007-04-27T01:05:06.996577', '7024', '1'), + ('4.99', '303', '2007-03-21T23:08:48.996577', '14795', '2'), + ('4.99', '394', '2007-02-15T09:31:11.996577', '1324', '2'), + ('7.99', '317', '2007-03-17T22:24:20.996577', '12138', '2'), + ('6.99', '563', '2007-04-08T06:59:52.996577', '4629', '2'), + ('8.99', '562', '2007-04-12T06:37:16.996577', '6607', '1'), + ('2.99', '204', '2007-02-17T23:43:53.996577', '2186', '2'), + ('4.99', '432', '2007-04-27T12:19:06.996577', '7326', '2'), + ('3.99', '589', '2007-04-29T03:52:28.996577', '8374', '1'), + ('0.99', '343', '2007-02-17T01:26:00.996577', '1879', '2'), + ('2.99', '190', '2007-02-15T11:12:09.996577', '1347', '1'), + ('6.99', '557', '2007-04-30T17:18:24.996577', '9367', '2'), + ('4.99', '65', '2007-04-06T00:01:12.996577', '3535', '1'), + ('3.99', '491', '2007-02-21T18:26:44.996577', '3440', '1'), + ('4.99', '576', '2007-04-29T23:53:29.996577', '8907', '1'), + ('0.99', '454', '2007-03-18T05:46:36.996577', '12347', '2'), + ('4.99', '223', '2007-03-02T04:31:48.996577', '11040', '2'), + ('7.99', '353', '2007-02-17T05:16:57.996577', '1928', '2'), + ('2.99', '444', '2007-03-20T02:44:33.996577', '13559', '2'), + ('4.99', '420', '2007-04-09T03:53:46.996577', '5081', '2'), + ('6.99', '518', '2007-04-28T07:29:39.996577', '7839', '2'), + ('2.99', '454', '2007-02-21T00:18:13.996577', '3221', '1'), + ('4.99', '494', '2007-04-30T01:05:31.996577', '8934', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['22056', '22246', '24515', '26905', '28717', '29096', '24780', '19762', '27592', '27635', '18047', '21945', '17513', '27715', '22286', '31334', '30490', '17672', '28721', '26872', '19310', '28470', '22497', '27989', '23482', '27409', '27676', '26231', '22061', '25849', '21257', '22917', '23724', '20187', '28737', '31393', '19998', '18189', '27568', '30168', '23385', '30510', '25276', '29827', '25143', '18597', '30204', '31548', '18059', '19715', '26761', '31860', '28011', '21913', '25676', '19106', '31314', '25115', '18581', '30586', '25162', '31834', '31069', '19518', '29163', '25390', '23057', '18156', '29573', '22758', '22911', '30343', '28499', '28497', '20769', '25311', '27720', '22725', '31240', '18965', '21872', '20844', '30607', '18756', '22802', '26863', '30387', '24349', '29078', '25805', '20024', '23841', '19154', '29255', '29228', '17982', '31920', '30513', '18710', '27752']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('2.99', '535', '2007-03-17T23:32:18.996577', '12168', '2'), + ('0.99', '557', '2007-03-02T09:23:29.996577', '11181', '1'), + ('4.99', '190', '2007-03-21T00:35:48.996577', '14141', '2'), + ('0.99', '420', '2007-04-29T07:21:35.996577', '8485', '2'), + ('7.99', '583', '2007-04-30T00:26:00.996577', '9550', '1'), + ('1.99', '10', '2007-04-07T12:42:39.996577', '4255', '1'), + ('0.99', '226', '2007-03-21T21:01:48.996577', '14739', '2'), + ('3.99', '291', '2007-03-23T07:22:52.996577', '15663', '2'), + ('4.99', '483', '2007-04-12T00:10:10.996577', '6478', '2'), + ('2.99', '486', '2007-04-07T19:06:19.996577', '4381', '1'), + ('2.99', '479', '2007-02-18T13:23:56.996577', '2376', '2'), + ('4.99', '523', '2007-03-17T11:12:53.996577', '11827', '1'), + ('6.99', '343', '2007-02-16T01:15:33.996577', '1564', '1'), + ('2.99', '494', '2007-04-06T13:35:21.996577', '3803', '2'), + ('4.99', '561', '2007-03-02T00:20:14.996577', '10907', '1'), + ('4.99', '214', '2007-04-27T15:26:59.996577', '7417', '2'), + ('5.99', '132', '2007-04-10T07:27:29.996577', '5684', '2'), + ('2.99', '383', '2007-02-18T07:42:20.996577', '2318', '2'), + ('0.99', '584', '2007-04-07T20:16:42.996577', '4410', '1'), + ('2.99', '417', '2007-04-30T05:25:54.996577', '9049', '2'), + ('4.99', '214', '2007-02-15T06:24:09.996577', '1275', '2'), + ('2.99', '563', '2007-04-11T17:35:21.996577', '6326', '2'), + ('2.99', '584', '2007-03-18T12:46:56.996577', '12541', '2'), + ('2.99', '518', '2007-04-28T00:37:26.996577', '7657', '1'), + ('4.99', '83', '2007-03-17T08:55:45.996577', '11777', '2'), + ('8.99', '467', '2007-04-29T07:13:12.996577', '8480', '2'), + ('2.99', '490', '2007-04-07T03:41:41.996577', '4083', '1'), + ('2.99', '360', '2007-04-29T03:37:23.996577', '8361', '2'), + ('4.99', '535', '2007-03-20T05:36:03.996577', '13631', '1'), + ('1.99', '327', '2007-04-28T06:27:22.996577', '7808', '2'), + ('8.99', '451', '2007-03-01T03:30:12.996577', '10337', '2'), + ('1.99', '24', '2007-03-19T06:03:19.996577', '12999', '1'), + ('7.99', '113', '2007-03-17T03:39:33.996577', '11655', '2'), + ('8.99', '340', '2007-03-01T15:26:48.996577', '10667', '1'), + ('2.99', '585', '2007-04-27T04:53:32.996577', '7131', '1'), + ('2.99', '220', '2007-04-30T19:15:40.996577', '10099', '1'), + ('4.99', '317', '2007-03-21T23:04:21.996577', '14791', '1'), + ('0.99', '520', '2007-02-15T15:34:02.996577', '1411', '1'), + ('0.99', '481', '2007-04-08T01:59:05.996577', '4532', '1'), + ('4.99', '103', '2007-04-30T18:10:33.996577', '9390', '2'), + ('4.99', '73', '2007-03-18T03:37:03.996577', '12291', '2'), + ('4.99', '134', '2007-04-09T14:37:45.996577', '5315', '1'), + ('2.99', '279', '2007-04-09T11:58:10.996577', '5248', '2'), + ('4.99', '75', '2007-04-27T16:55:52.996577', '7454', '1'), + ('6.99', '265', '2007-03-21T14:31:53.996577', '14556', '2'), + ('3.99', '26', '2007-02-18T15:36:00.996577', '2416', '2'), + ('2.99', '107', '2007-04-11T06:50:31.996577', '6131', '2'), + ('5.99', '233', '2007-04-29T04:07:42.996577', '8385', '2'), + ('8.99', '483', '2007-02-21T12:27:12.996577', '3380', '1'), + ('5.99', '286', '2007-03-20T05:46:01.996577', '13635', '2'), + ('0.99', '407', '2007-04-12T12:22:51.996577', '6727', '1'), + ('3.99', '262', '2007-04-12T12:13:41.996577', '6724', '1'), + ('3.99', '520', '2007-04-10T16:13:39.996577', '5853', '1'), + ('5.99', '520', '2007-03-18T16:08:51.996577', '12628', '1'), + ('2.99', '312', '2007-04-06T11:33:01.996577', '3766', '1'), + ('0.99', '156', '2007-02-18T01:53:22.996577', '2221', '2'), + ('2.99', '212', '2007-04-28T07:09:12.996577', '7828', '2'), + ('4.99', '262', '2007-03-23T11:47:12.996577', '15771', '2'), + ('4.99', '23', '2007-02-20T11:48:24.996577', '3055', '1'), + ('2.99', '140', '2007-04-12T20:58:55.996577', '6918', '1'), + ('1.99', '259', '2007-03-23T04:41:42.996577', '4591', '2'), + ('3.99', '546', '2007-04-30T19:44:46.996577', '4591', '1'), + ('3.99', '182', '2007-04-08T04:58:09.996577', '4591', '2'), + ('1.99', '16', '2007-02-18T03:24:38.996577', '4591', '1'), + ('0.99', '401', '2007-04-12T04:54:36.996577', '4591', '1'), + ('2.99', '288', '2007-04-11T21:07:31.996577', '6399', '1'), + ('1.99', '38', '2007-03-18T00:14:16.996577', '12187', '2'), + ('4.99', '512', '2007-02-17T11:39:25.996577', '2029', '2'), + ('6.99', '51', '2007-04-27T14:35:48.996577', '7398', '1'), + ('9.99', '8', '2007-03-02T11:32:38.996577', '11232', '1'), + ('2.99', '23', '2007-03-21T12:11:11.996577', '14482', '2'), + ('9.99', '120', '2007-04-08T08:33:28.996577', '4666', '2'), + ('9.99', '566', '2007-04-09T03:49:06.996577', '5079', '1'), + ('0.99', '566', '2007-04-06T19:50:43.996577', '3943', '1'), + ('2.99', '400', '2007-03-01T08:48:19.996577', '10484', '2'), + ('6.99', '282', '2007-04-28T22:24:27.996577', '8223', '1'), + ('4.99', '494', '2007-04-09T03:58:58.996577', '5083', '2'), + ('9.99', '5', '2007-03-17T22:38:30.996577', '12145', '1'), + ('2.99', '199', '2007-04-30T07:50:28.996577', '9752', '1'), + ('5.99', '119', '2007-02-21T13:03:17.996577', '3388', '2'), + ('6.99', '515', '2007-03-17T15:17:02.996577', '11937', '2'), + ('0.99', '407', '2007-03-20T11:09:14.996577', '13800', '1'), + ('4.99', '142', '2007-04-29T12:23:37.996577', '8623', '2'), + ('2.99', '66', '2007-02-15T03:02:53.996577', '1236', '1'), + ('0.99', '13', '2007-03-19T23:01:45.996577', '13456', '1'), + ('2.99', '416', '2007-04-29T10:50:46.996577', '8588', '2'), + ('7.99', '124', '2007-04-07T17:12:49.996577', '4341', '1'), + ('2.99', '174', '2007-03-01T04:30:18.996577', '10363', '1'), + ('2.99', '8', '2007-04-09T14:09:12.996577', '5300', '1'), + ('0.99', '323', '2007-04-29T07:05:22.996577', '8474', '2'), + ('4.99', '322', '2007-03-19T12:29:04.996577', '13180', '2'), + ('4.99', '125', '2007-03-17T10:17:54.996577', '11806', '1'), + ('2.99', '171', '2007-02-19T17:16:37.996577', '2788', '2'), + ('2.99', '25', '2007-04-30T16:25:04.996577', '9334', '2'), + ('2.99', '23', '2007-04-11T12:48:44.996577', '6238', '1'), + ('2.99', '463', '2007-02-15T06:55:59.996577', '1284', '1'), + ('0.00', '269', '2007-05-14T13:44:29.996577', '12610', '2'), + ('2.99', '134', '2007-04-27T19:23:54.996577', '7516', '2'), + ('0.99', '52', '2007-02-18T02:22:57.996577', '2232', '2'), + ('7.99', '497', '2007-04-07T10:38:50.996577', '4218', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['25886', '25442', '23270', '19770', '24932', '31501', '19198', '24782', '22723', '26862', '23650', '21186', '23037', '28504', '17583', '29320', '23117', '22896', '30395', '29440', '25603', '21011', '22008', '20258', '30410', '22485', '22003', '30202', '28750', '23773', '23936', '28086', '19379', '22278', '21346', '24436', '28553', '25106', '29270', '28748', '28751', '28446', '18229', '21776', '27596', '29195', '27253', '30787', '30260', '27544', '17639', '28615', '31923', '30161', '22807', '21355', '26933', '21394', '24415', '27925', '30223', '23449', '26788', '24803', '22836', '18082', '24026', '28103', '29187', '25739', '25240', '18259', '19311', '18650', '29455', '19545', '19882', '30347', '19181', '22899', '24933', '23410', '22810', '22437', '25462', '28838', '31102', '18944', '30609', '26500', '30658', '24852', '30164', '28776', '20763', '23938', '29148', '30218', '24179', '23710']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('10.99', '331', '2007-04-07T16:29:48.996577', '4326', '1'), + ('5.99', '292', '2007-04-27T07:21:49.996577', '7199', '2'), + ('2.99', '61', '2007-03-02T16:45:21.996577', '11379', '2'), + ('2.99', '293', '2007-03-17T00:21:46.996577', '11576', '1'), + ('3.99', '243', '2007-03-21T04:53:21.996577', '14272', '1'), + ('4.99', '230', '2007-04-09T02:01:58.996577', '5045', '1'), + ('4.99', '181', '2007-02-21T21:17:25.996577', '3469', '2'), + ('2.99', '226', '2007-03-23T00:07:31.996577', '15472', '2'), + ('4.99', '5', '2007-03-02T09:18:32.996577', '11179', '1'), + ('5.99', '416', '2007-04-29T03:18:48.996577', '8349', '2'), + ('8.99', '103', '2007-03-23T21:11:33.996577', '16048', '2'), + ('4.99', '444', '2007-03-01T10:28:28.996577', '10529', '1'), + ('4.99', '36', '2007-03-20T06:59:20.996577', '13674', '1'), + ('6.99', '566', '2007-04-28T19:35:11.996577', '8157', '1'), + ('4.99', '361', '2007-02-18T11:21:51.996577', '2353', '2'), + ('4.99', '30', '2007-04-28T15:01:21.996577', '8038', '2'), + ('4.99', '45', '2007-03-19T20:33:45.996577', '13394', '2'), + ('0.99', '22', '2007-03-18T23:10:50.996577', '12809', '2'), + ('4.99', '125', '2007-04-06T04:26:32.996577', '3617', '1'), + ('5.99', '40', '2007-04-10T17:08:35.996577', '5869', '1'), + ('2.99', '305', '2007-04-09T02:28:09.996577', '5052', '1'), + ('4.99', '423', '2007-03-16T22:21:36.996577', '11514', '2'), + ('5.99', '530', '2007-03-20T18:21:04.996577', '13998', '1'), + ('8.99', '347', '2007-03-17T07:14:21.996577', '11738', '2'), + ('2.99', '125', '2007-04-30T07:26:11.996577', '9734', '2'), + ('0.99', '582', '2007-03-23T02:37:29.996577', '15539', '1'), + ('4.99', '530', '2007-03-01T09:39:21.996577', '10504', '2'), + ('2.99', '107', '2007-04-10T02:24:16.996577', '5575', '2'), + ('2.99', '587', '2007-04-06T01:23:02.996577', '3562', '2'), + ('2.99', '118', '2007-03-22T03:43:43.996577', '14924', '1'), + ('4.99', '134', '2007-03-02T20:52:57.996577', '11482', '2'), + ('7.99', '526', '2007-04-27T09:57:28.996577', '7270', '2'), + ('6.99', '234', '2007-02-20T21:26:27.996577', '3185', '2'), + ('4.99', '560', '2007-03-17T09:27:44.996577', '11788', '1'), + ('3.99', '459', '2007-03-21T06:25:05.996577', '14315', '1'), + ('4.99', '182', '2007-03-02T05:04:31.996577', '11055', '1'), + ('0.99', '570', '2007-04-30T16:19:49.996577', '10004', '1'), + ('0.99', '262', '2007-03-01T19:14:05.996577', '10770', '2'), + ('0.99', '26', '2007-04-30T22:00:06.996577', '9484', '1'), + ('2.99', '586', '2007-04-30T08:53:47.996577', '9786', '2'), + ('0.99', '587', '2007-04-06T21:16:25.996577', '3969', '2'), + ('0.99', '561', '2007-04-12T07:25:56.996577', '6621', '1'), + ('3.99', '532', '2007-02-19T18:55:18.996577', '2821', '2'), + ('4.99', '504', '2007-03-22T07:21:04.996577', '15018', '2'), + ('4.99', '483', '2007-04-28T01:12:33.996577', '7669', '1'), + ('0.99', '19', '2007-04-30T12:57:55.996577', '9256', '1'), + ('3.99', '452', '2007-04-06T05:36:43.996577', '3638', '2'), + ('8.99', '158', '2007-04-07T05:26:40.996577', '4117', '1'), + ('3.99', '112', '2007-04-30T13:16:27.996577', '9911', '2'), + ('8.99', '479', '2007-04-07T08:56:59.996577', '4183', '2'), + ('3.99', '377', '2007-02-19T01:35:58.996577', '2556', '2'), + ('4.99', '576', '2007-04-06T16:50:36.996577', '3877', '1'), + ('0.99', '282', '2007-05-14T13:44:29.996577', '15430', '2'), + ('5.99', '103', '2007-04-12T02:45:41.996577', '6525', '1'), + ('6.99', '14', '2007-03-01T10:23:59.996577', '10526', '2'), + ('0.99', '460', '2007-03-19T01:07:16.996577', '12865', '1'), + ('4.99', '423', '2007-04-27T05:48:54.996577', '7157', '1'), + ('4.99', '463', '2007-03-20T15:53:11.996577', '13938', '2'), + ('4.99', '180', '2007-03-20T12:58:03.996577', '13842', '2'), + ('5.99', '512', '2007-04-08T12:43:46.996577', '4752', '1'), + ('5.99', '108', '2007-04-29T02:34:59.996577', '8329', '2'), + ('5.99', '80', '2007-03-02T06:36:50.996577', '11101', '2'), + ('4.99', '409', '2007-04-11T00:50:09.996577', '6026', '2'), + ('5.99', '230', '2007-03-02T08:15:34.996577', '11148', '2'), + ('2.99', '16', '2007-03-17T21:21:26.996577', '12104', '2'), + ('4.99', '491', '2007-02-18T14:01:56.996577', '2391', '2'), + ('0.99', '142', '2007-03-20T09:22:15.996577', '13745', '2'), + ('8.99', '527', '2007-04-27T18:57:00.996577', '7506', '1'), + ('0.99', '18', '2007-04-12T17:49:11.996577', '6846', '1'), + ('2.99', '317', '2007-04-29T02:29:18.996577', '8327', '1'), + ('2.99', '275', '2007-04-29T17:31:41.996577', '8746', '1'), + ('2.99', '540', '2007-02-19T07:54:39.996577', '2640', '2'), + ('2.99', '214', '2007-02-17T15:59:22.996577', '2085', '2'), + ('4.99', '35', '2007-02-20T16:21:56.996577', '3112', '2'), + ('1.99', '41', '2007-04-27T19:25:33.996577', '7517', '1'), + ('2.99', '269', '2007-03-20T09:53:14.996577', '13759', '2'), + ('0.99', '304', '2007-03-20T19:38:58.996577', '14023', '1'), + ('4.99', '120', '2007-04-26T23:29:00.996577', '6989', '1'), + ('0.99', '177', '2007-02-16T14:35:53.996577', '1738', '1'), + ('6.99', '22', '2007-03-21T14:53:09.996577', '14564', '1'), + ('1.99', '243', '2007-03-21T15:35:34.996577', '14581', '2'), + ('0.99', '75', '2007-03-18T17:39:07.996577', '12662', '1'), + ('2.99', '14', '2007-03-18T17:45:13.996577', '12668', '1'), + ('4.99', '577', '2007-03-18T17:39:20.996577', '12664', '1'), + ('4.99', '294', '2007-04-06T23:56:10.996577', '4019', '2'), + ('6.99', '593', '2007-04-30T16:11:04.996577', '9329', '2'), + ('4.99', '185', '2007-04-27T02:22:18.996577', '7066', '1'), + ('6.99', '113', '2007-02-20T19:49:41.996577', '3162', '1'), + ('2.99', '142', '2007-04-30T08:24:23.996577', '9131', '1'), + ('3.99', '383', '2007-04-27T13:34:11.996577', '7367', '1'), + ('0.99', '146', '2007-04-26T23:31:12.996577', '6990', '1'), + ('0.99', '235', '2007-03-19T23:28:02.996577', '13469', '1'), + ('0.99', '103', '2007-04-27T11:29:21.996577', '7310', '1'), + ('4.99', '589', '2007-04-11T09:22:15.996577', '6177', '2'), + ('4.99', '399', '2007-03-02T15:11:18.996577', '11329', '1'), + ('2.99', '134', '2007-03-19T05:40:10.996577', '12987', '2'), + ('6.99', '14', '2007-04-28T14:51:27.996577', '8035', '1'), + ('0.99', '108', '2007-04-08T12:48:27.996577', '4754', '1'), + ('0.99', '155', '2007-03-22T03:17:10.996577', '14909', '2'), + ('2.99', '112', '2007-03-02T03:57:57.996577', '11019', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['22176', '18012', '20862', '24635', '18081', '22281', '31527', '27755', '25305', '29091', '30758', '26034', '24065', '21895', '21879', '28165', '18842', '18980', '19052', '19647', '24508', '20013', '25304', '24419', '18583', '19610', '24124', '29677', '28398', '30088', '24665', '24248', '25622', '21489', '19080', '26345', '23998', '18058', '24781', '23185', '18516', '29952', '26137', '24340', '23997', '22495', '28502', '21668', '28729', '19132', '22674', '28702', '19994', '23235', '28753', '19993', '27376', '23789', '23716', '24111', '28775', '19502', '27408', '18351', '17922', '23775', '28503', '29539', '27436', '30155', '21800', '23078', '21279', '28277', '27404', '19013', '29014', '30371', '19874', '19340', '18046', '31715', '30158', '25624', '26841', '22701', '26956', '29326', '21292', '24727', '25978', '22902', '30399', '18951', '24759', '17890', '18548', '22926', '30321', '31391']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('4.99', '549', '2007-03-17T07:10:34.996577', '11737', '2'), + ('4.99', '471', '2007-02-15T17:42:17.996577', '1447', '1'), + ('8.99', '409', '2007-03-19T20:31:48.996577', '13392', '1'), + ('8.99', '210', '2007-03-18T08:13:59.996577', '12410', '2'), + ('4.99', '491', '2007-02-18T04:06:11.996577', '2259', '1'), + ('4.99', '560', '2007-03-21T07:48:29.996577', '14363', '2'), + ('5.99', '232', '2007-04-27T04:37:14.996577', '7123', '1'), + ('0.99', '497', '2007-04-08T15:01:20.996577', '4795', '2'), + ('4.99', '282', '2007-04-07T20:25:19.996577', '4412', '2'), + ('0.99', '9', '2007-04-27T22:43:52.996577', '7616', '2'), + ('7.99', '155', '2007-04-30T08:41:28.996577', '9781', '2'), + ('2.99', '343', '2007-04-30T07:36:29.996577', '9739', '2'), + ('2.99', '146', '2007-03-02T11:00:38.996577', '11221', '1'), + ('3.99', '518', '2007-03-02T18:41:36.996577', '11433', '2'), + ('4.99', '515', '2007-03-22T17:24:18.996577', '15274', '2'), + ('2.99', '532', '2007-04-27T21:12:55.996577', '7572', '2'), + ('2.99', '87', '2007-02-18T15:19:10.996577', '2408', '2'), + ('1.99', '122', '2007-02-19T20:10:12.996577', '2834', '2'), + ('0.99', '143', '2007-02-19T02:52:18.996577', '2574', '1'), + ('5.99', '278', '2007-03-02T06:31:46.996577', '11095', '1'), + ('4.99', '190', '2007-03-02T12:57:12.996577', '11276', '2'), + ('0.99', '320', '2007-03-21T01:29:08.996577', '14171', '2'), + ('2.99', '282', '2007-04-07T17:58:46.996577', '4359', '1'), + ('4.99', '180', '2007-03-22T08:06:20.996577', '15039', '1'), + ('2.99', '24', '2007-02-16T13:07:57.996577', '1716', '1'), + ('2.99', '275', '2007-03-20T13:23:35.996577', '13860', '2'), + ('0.99', '150', '2007-03-19T02:10:34.996577', '12890', '2'), + ('4.99', '63', '2007-04-08T04:44:52.996577', '4587', '1'), + ('0.99', '557', '2007-04-12T20:07:30.996577', '6898', '2'), + ('5.99', '98', '2007-04-29T02:24:31.996577', '8324', '1'), + ('4.99', '212', '2007-03-23T14:55:50.996577', '15872', '1'), + ('1.99', '162', '2007-03-21T05:48:14.996577', '14301', '2'), + ('4.99', '306', '2007-04-30T18:35:32.996577', '9395', '2'), + ('4.99', '472', '2007-03-18T21:35:27.996577', '12763', '2'), + ('6.99', '149', '2007-02-17T09:46:11.996577', '1996', '2'), + ('4.99', '369', '2007-04-30T04:35:20.996577', '9032', '2'), + ('6.99', '140', '2007-03-01T03:39:37.996577', '10342', '1'), + ('0.99', '483', '2007-02-19T22:37:04.996577', '2867', '2'), + ('4.99', '226', '2007-03-22T04:15:41.996577', '14934', '2'), + ('2.99', '52', '2007-03-21T23:47:03.996577', '14820', '2'), + ('2.99', '5', '2007-02-19T02:48:39.996577', '2570', '2'), + ('4.99', '87', '2007-04-10T08:18:08.996577', '5700', '2'), + ('6.99', '352', '2007-04-27T19:09:06.996577', '7512', '2'), + ('3.99', '172', '2007-03-23T20:42:57.996577', '16038', '2'), + ('0.99', '139', '2007-03-23T10:40:31.996577', '15743', '1'), + ('6.99', '584', '2007-03-16T21:29:48.996577', '11500', '2'), + ('0.99', '566', '2007-04-28T11:15:46.996577', '7941', '2'), + ('4.99', '493', '2007-03-22T14:03:15.996577', '15177', '2'), + ('5.99', '584', '2007-04-30T06:53:39.996577', '9719', '1'), + ('4.99', '164', '2007-02-16T12:56:59.996577', '1713', '2'), + ('6.99', '207', '2007-03-17T21:25:05.996577', '12108', '2'), + ('2.99', '582', '2007-04-27T21:22:18.996577', '7575', '1'), + ('4.99', '317', '2007-03-19T20:15:15.996577', '13388', '1'), + ('9.99', '57', '2007-03-20T15:42:14.996577', '13929', '2'), + ('0.99', '587', '2007-04-12T08:29:10.996577', '6639', '1'), + ('2.99', '317', '2007-03-18T04:04:46.996577', '12301', '2'), + ('6.99', '463', '2007-04-26T21:36:30.996577', '6932', '1'), + ('3.99', '119', '2007-03-22T11:34:52.996577', '15131', '2'), + ('5.99', '112', '2007-03-20T20:37:21.996577', '14049', '2'), + ('0.99', '149', '2007-03-02T02:30:42.996577', '10967', '2'), + ('0.99', '589', '2007-04-10T21:42:55.996577', '5951', '1'), + ('7.99', '265', '2007-02-17T11:35:22.996577', '2027', '2'), + ('2.99', '467', '2007-04-28T22:27:28.996577', '8224', '2'), + ('1.99', '568', '2007-02-21T20:21:18.996577', '3462', '2'), + ('6.99', '451', '2007-02-17T06:10:48.996577', '1940', '1'), + ('3.99', '119', '2007-03-01T04:38:03.996577', '10366', '1'), + ('2.99', '566', '2007-04-28T17:50:48.996577', '8118', '2'), + ('2.99', '49', '2007-04-09T22:38:11.996577', '5491', '1'), + ('6.99', '469', '2007-04-27T02:20:27.996577', '7062', '2'), + ('4.99', '103', '2007-04-06T15:19:47.996577', '3850', '1'), + ('6.99', '507', '2007-03-17T20:17:40.996577', '12071', '2'), + ('5.99', '40', '2007-03-20T12:51:46.996577', '13840', '1'), + ('0.99', '452', '2007-03-21T18:11:47.996577', '14660', '1'), + ('2.99', '543', '2007-04-29T10:28:53.996577', '8580', '1'), + ('5.99', '467', '2007-04-27T21:14:46.996577', '7573', '2'), + ('0.99', '132', '2007-02-18T13:47:15.996577', '2384', '1'), + ('10.99', '2', '2007-04-30T12:16:09.996577', '9236', '2'), + ('2.99', '122', '2007-04-27T09:51:21.996577', '7267', '1'), + ('2.99', '303', '2007-03-18T10:28:10.996577', '12473', '2'), + ('5.99', '223', '2007-02-16T21:50:48.996577', '1839', '2'), + ('3.99', '479', '2007-02-17T15:01:43.996577', '2071', '2'), + ('2.99', '247', '2007-04-08T23:26:12.996577', '4995', '2'), + ('1.99', '103', '2007-04-07T17:53:05.996577', '4357', '1'), + ('6.99', '306', '2007-04-30T23:11:44.996577', '10202', '1'), + ('2.99', '414', '2007-04-28T05:39:37.996577', '7779', '1'), + ('4.99', '2', '2007-03-23T16:08:01.996577', '15907', '2'), + ('4.99', '425', '2007-04-06T13:40:10.996577', '3807', '1'), + ('2.99', '30', '2007-04-30T16:09:01.996577', '9998', '1'), + ('0.99', '454', '2007-03-18T13:15:20.996577', '12553', '1'), + ('4.99', '219', '2007-03-22T17:44:30.996577', '15283', '1'), + ('4.99', '338', '2007-04-08T14:22:07.996577', '4779', '2'), + ('4.99', '22', '2007-03-23T07:17:09.996577', '15658', '1'), + ('6.99', '125', '2007-04-11T14:24:00.996577', '6268', '2'), + ('6.99', '115', '2007-02-21T05:10:14.996577', '3289', '1'), + ('2.99', '223', '2007-03-23T07:21:16.996577', '15662', '1'), + ('3.99', '444', '2007-02-15T14:53:52.996577', '1397', '2'), + ('2.99', '13', '2007-02-20T04:55:23.996577', '2952', '1'), + ('4.99', '25', '2007-03-21T02:06:53.996577', '14193', '1'), + ('0.99', '118', '2007-04-11T20:09:42.996577', '6377', '1'), + ('7.99', '220', '2007-04-30T17:54:01.996577', '9384', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['27477', '24064', '28613', '25891', '29951', '17997', '26277', '18241', '30578', '20556', '26303', '20455', '19197', '22244', '28081', '19752', '23922', '28251', '28724', '21204', '23484', '28464', '23771', '29927', '22895', '21344', '28965', '19886', '23648', '25372', '28108', '23995', '27031', '19492', '30853', '23846', '18750', '31952', '23302', '21359', '24000', '27693', '21492', '28049', '23917', '29094', '28735', '21541', '19546', '26869', '22863', '27759', '18308', '20025', '29220', '22029', '31562', '24189', '30405', '26299', '31665', '20939', '31423', '22288', '24116', '28257', '31569', '30764', '22798', '24583', '26244', '23999', '30085', '18441', '31221', '18586', '21466', '24680', '29546', '27870', '25761', '22864', '25213', '29375', '31668', '29039', '19630', '27029', '21392', '22980', '20860', '26001', '29143', '21015', '29376', '20267', '22572', '27427', '23113', '28365']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('6.99', '472', '2007-04-30T13:40:17.996577', '9926', '2'), + ('7.99', '146', '2007-03-02T08:56:26.996577', '11173', '2'), + ('4.99', '575', '2007-04-30T03:07:45.996577', '8989', '2'), + ('4.99', '331', '2007-04-30T03:21:37.996577', '8995', '2'), + ('3.99', '87', '2007-04-10T04:25:06.996577', '5628', '1'), + ('8.99', '467', '2007-02-16T14:28:10.996577', '1737', '1'), + ('4.99', '364', '2007-04-06T20:40:09.996577', '3961', '2'), + ('4.99', '535', '2007-02-16T12:53:35.996577', '1712', '1'), + ('0.99', '139', '2007-04-12T12:50:34.996577', '6740', '2'), + ('0.99', '377', '2007-03-23T18:58:22.996577', '15995', '1'), + ('0.99', '366', '2007-04-12T17:36:21.996577', '6842', '1'), + ('8.99', '368', '2007-03-19T12:55:42.996577', '13189', '2'), + ('5.99', '181', '2007-02-21T19:29:53.996577', '3449', '2'), + ('2.99', '556', '2007-03-21T01:37:49.996577', '14176', '1'), + ('3.99', '526', '2007-04-09T05:46:57.996577', '5121', '2'), + ('6.99', '290', '2007-03-17T01:22:21.996577', '11596', '1'), + ('0.99', '132', '2007-03-17T10:29:20.996577', '11812', '2'), + ('2.99', '540', '2007-04-11T05:28:21.996577', '6103', '1'), + ('2.99', '584', '2007-04-27T06:54:38.996577', '7186', '1'), + ('4.99', '445', '2007-03-17T12:34:00.996577', '11868', '1'), + ('5.99', '83', '2007-03-19T05:36:31.996577', '12985', '2'), + ('2.99', '563', '2007-04-08T10:35:24.996577', '4711', '2'), + ('5.99', '118', '2007-03-21T08:51:36.996577', '14394', '2'), + ('8.99', '84', '2007-04-29T13:32:53.996577', '8654', '1'), + ('2.99', '22', '2007-03-17T21:51:12.996577', '12124', '1'), + ('10.99', '459', '2007-03-20T16:44:52.996577', '13960', '2'), + ('2.99', '207', '2007-04-06T02:45:09.996577', '3584', '2'), + ('4.99', '305', '2007-03-02T01:04:10.996577', '10929', '2'), + ('5.99', '103', '2007-03-23T04:53:33.996577', '15599', '1'), + ('0.99', '286', '2007-04-29T04:48:44.996577', '8399', '2'), + ('9.99', '528', '2007-04-07T02:03:59.996577', '4050', '2'), + ('9.99', '139', '2007-03-22T15:27:31.996577', '15218', '1'), + ('4.99', '432', '2007-04-10T23:31:40.996577', '5990', '1'), + ('2.99', '262', '2007-02-16T01:14:54.996577', '1563', '1'), + ('3.99', '164', '2007-04-26T23:18:56.996577', '6980', '1'), + ('6.99', '125', '2007-03-19T22:16:49.996577', '13441', '2'), + ('3.99', '62', '2007-02-21T07:33:16.996577', '3327', '1'), + ('4.99', '394', '2007-05-14T13:44:29.996577', '13178', '2'), + ('5.99', '65', '2007-03-02T06:36:26.996577', '11100', '2'), + ('0.99', '460', '2007-03-22T01:25:32.996577', '14864', '2'), + ('4.99', '140', '2007-03-17T20:48:27.996577', '12086', '1'), + ('3.99', '491', '2007-04-27T00:48:52.996577', '7019', '2'), + ('4.99', '472', '2007-03-21T16:07:03.996577', '14596', '2'), + ('2.99', '523', '2007-04-09T07:15:20.996577', '5155', '2'), + ('4.99', '132', '2007-03-01T00:47:12.996577', '10243', '2'), + ('3.99', '10', '2007-04-06T12:42:11.996577', '3790', '2'), + ('4.99', '585', '2007-04-10T21:42:11.996577', '5950', '2'), + ('2.99', '477', '2007-03-23T16:51:56.996577', '15929', '1'), + ('4.99', '269', '2007-03-21T04:49:17.996577', '14266', '1'), + ('6.99', '417', '2007-04-11T13:52:58.996577', '6258', '2'), + ('0.99', '19', '2007-03-23T02:15:13.996577', '15529', '2'), + ('2.99', '497', '2007-04-28T13:55:05.996577', '8011', '2'), + ('0.99', '557', '2007-02-16T08:45:45.996577', '1666', '1'), + ('9.99', '322', '2007-03-20T06:17:32.996577', '13650', '1'), + ('4.99', '22', '2007-04-27T03:10:34.996577', '7087', '1'), + ('4.99', '532', '2007-03-20T14:50:06.996577', '13908', '1'), + ('4.99', '235', '2007-04-11T23:49:29.996577', '6466', '2'), + ('0.99', '156', '2007-03-22T03:22:01.996577', '14914', '1'), + ('4.99', '125', '2007-04-29T21:06:15.996577', '8832', '1'), + ('6.99', '366', '2007-04-11T05:56:31.996577', '6112', '1'), + ('0.99', '243', '2007-04-09T23:02:41.996577', '5502', '1'), + ('4.99', '416', '2007-03-23T00:03:38.996577', '15470', '2'), + ('7.99', '223', '2007-04-30T17:44:05.996577', '10053', '2'), + ('2.99', '561', '2007-03-02T17:35:47.996577', '11402', '2'), + ('2.99', '149', '2007-03-23T03:32:59.996577', '15562', '2'), + ('2.99', '540', '2007-04-30T09:59:17.996577', '9815', '2'), + ('0.99', '235', '2007-04-30T21:00:09.996577', '10155', '2'), + ('6.99', '156', '2007-04-12T03:19:39.996577', '6540', '2'), + ('5.99', '13', '2007-03-17T08:13:25.996577', '11761', '2'), + ('2.99', '198', '2007-03-17T15:40:52.996577', '11949', '2'), + ('1.99', '361', '2007-04-30T20:43:39.996577', '10145', '1'), + ('3.99', '140', '2007-03-02T18:33:02.996577', '11430', '2'), + ('2.99', '98', '2007-04-26T22:15:57.996577', '6951', '2'), + ('6.99', '592', '2007-02-14T21:41:12.996577', '1163', '2'), + ('4.99', '198', '2007-04-12T16:49:27.996577', '6819', '1'), + ('5.99', '24', '2007-02-18T17:56:28.996577', '2451', '1'), + ('2.99', '470', '2007-03-17T05:59:21.996577', '11711', '2'), + ('0.99', '214', '2007-03-20T03:07:18.996577', '13565', '1'), + ('10.99', '49', '2007-04-29T09:44:02.996577', '8553', '2'), + ('2.99', '507', '2007-04-08T19:13:17.996577', '4901', '2'), + ('0.99', '319', '2007-04-30T05:03:47.996577', '9044', '2'), + ('4.99', '20', '2007-03-01T02:01:45.996577', '10284', '2'), + ('8.99', '273', '2007-04-12T05:48:01.996577', '6592', '1'), + ('5.99', '35', '2007-04-10T19:54:57.996577', '5916', '1'), + ('2.99', '243', '2007-04-27T00:59:41.996577', '7022', '2'), + ('4.99', '5', '2007-04-09T00:26:23.996577', '5016', '1'), + ('3.99', '276', '2007-03-23T11:44:41.996577', '15769', '1'), + ('6.99', '432', '2007-04-09T14:56:39.996577', '5322', '1'), + ('6.99', '463', '2007-03-18T18:10:37.996577', '12679', '2'), + ('2.99', '30', '2007-03-18T12:58:03.996577', '12546', '1'), + ('6.99', '408', '2007-03-23T11:34:45.996577', '15765', '1'), + ('2.99', '340', '2007-04-27T22:47:06.996577', '7617', '2'), + ('0.99', '14', '2007-04-08T21:28:33.996577', '4952', '1'), + ('0.99', '423', '2007-03-22T20:56:41.996577', '15380', '1'), + ('0.99', '35', '2007-04-10T22:15:34.996577', '5963', '1'), + ('2.99', '348', '2007-03-02T02:36:51.996577', '10972', '2'), + ('2.99', '593', '2007-03-18T20:51:02.996577', '12744', '2'), + ('3.99', '469', '2007-04-07T03:02:49.996577', '4067', '2'), + ('2.99', '45', '2007-03-02T20:56:48.996577', '11483', '2'), + ('4.99', '553', '2007-04-06T19:50:00.996577', '3942', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['29920', '28626', '28474', '20942', '28660', '19038', '31377', '25591', '23628', '26213', '28394', '30066', '30646', '21667', '21260', '21987', '18080', '30642', '24641', '25433', '26276', '23649', '22696', '21451', '21920', '26733', '26280', '29373', '29141', '18442', '19576', '18393', '28505', '31863', '19729', '17665', '27933', '26283', '17930', '25388', '26839', '18382', '18339', '26238', '27878', '26698', '22527', '21775', '22528', '25368', '18707', '29730', '21801', '19273', '23275', '21190', '26005', '30632', '18284', '26498', '21919', '18941', '31969', '26965', '24325', '25741', '28966', '25178', '22296', '23304', '24441', '24379', '31420', '19889', '18199', '18646', '23115', '25392', '20429', '28485', '31328', '30068', '19017', '18479', '27283', '30572', '26858', '26670', '18912', '24025', '26332', '18709', '21201', '26614', '30390', '28429', '25457', '24690', '22100', '28461']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('5.99', '84', '2007-04-09T10:30:49.996577', '5221', '1'), + ('8.99', '576', '2007-04-30T02:47:44.996577', '9620', '2'), + ('6.99', '563', '2007-04-29T12:39:51.996577', '8632', '2'), + ('0.99', '417', '2007-03-01T08:37:32.996577', '10478', '1'), + ('2.99', '579', '2007-04-27T08:06:01.996577', '7221', '2'), + ('0.99', '139', '2007-02-19T09:16:08.996577', '2659', '1'), + ('5.99', '219', '2007-04-28T03:20:45.996577', '7726', '1'), + ('4.99', '304', '2007-04-10T09:08:58.996577', '5712', '1'), + ('2.99', '101', '2007-03-17T23:37:19.996577', '12174', '2'), + ('0.99', '359', '2007-04-12T12:52:42.996577', '6741', '2'), + ('1.99', '557', '2007-04-08T17:08:31.996577', '4851', '1'), + ('6.99', '96', '2007-04-29T05:52:09.996577', '8437', '1'), + ('0.99', '145', '2007-04-11T20:13:49.996577', '6378', '2'), + ('4.99', '493', '2007-03-20T23:40:25.996577', '14117', '1'), + ('6.99', '451', '2007-03-02T08:44:17.996577', '11167', '2'), + ('2.99', '528', '2007-03-20T01:04:43.996577', '13518', '2'), + ('4.99', '491', '2007-02-17T11:34:04.996577', '2026', '2'), + ('2.99', '145', '2007-04-07T22:49:23.996577', '4470', '1'), + ('4.99', '210', '2007-03-22T02:07:55.996577', '14876', '2'), + ('5.99', '291', '2007-04-30T11:10:47.996577', '9201', '2'), + ('4.99', '364', '2007-04-06T07:43:41.996577', '3678', '1'), + ('0.99', '103', '2007-03-23T07:55:55.996577', '15679', '2'), + ('2.99', '2', '2007-03-17T02:20:44.996577', '11614', '1'), + ('2.99', '469', '2007-03-01T18:21:18.996577', '10741', '1'), + ('0.99', '520', '2007-03-21T13:08:24.996577', '14509', '1'), + ('1.99', '405', '2007-04-09T23:34:04.996577', '5512', '2'), + ('10.99', '364', '2007-04-10T17:22:31.996577', '5872', '1'), + ('2.99', '35', '2007-04-09T00:15:11.996577', '5013', '1'), + ('4.99', '13', '2007-04-30T16:17:17.996577', '10003', '1'), + ('5.99', '592', '2007-02-15T16:36:38.996577', '1423', '2'), + ('3.99', '273', '2007-03-01T18:37:50.996577', '10753', '1'), + ('4.99', '578', '2007-02-19T05:57:39.996577', '2615', '2'), + ('2.99', '566', '2007-04-28T23:31:46.996577', '8257', '1'), + ('4.99', '262', '2007-04-26T23:27:31.996577', '6986', '1'), + ('9.99', '288', '2007-03-02T00:59:41.996577', '10927', '1'), + ('4.99', '382', '2007-02-18T18:52:18.996577', '2468', '1'), + ('2.99', '512', '2007-04-30T05:41:33.996577', '9055', '1'), + ('0.99', '364', '2007-04-30T18:56:35.996577', '10092', '1'), + ('0.99', '452', '2007-02-18T04:26:13.996577', '2263', '1'), + ('2.99', '288', '2007-04-08T09:35:32.996577', '4692', '1'), + ('0.99', '414', '2007-04-12T17:49:07.996577', '6845', '2'), + ('4.99', '576', '2007-02-15T12:49:26.996577', '1366', '1'), + ('5.99', '565', '2007-02-18T08:11:08.996577', '2321', '1'), + ('4.99', '361', '2007-04-12T17:07:25.996577', '6829', '2'), + ('2.99', '507', '2007-04-30T02:40:58.996577', '8976', '2'), + ('3.99', '402', '2007-04-11T15:15:58.996577', '6283', '1'), + ('2.99', '587', '2007-03-22T19:42:12.996577', '15348', '2'), + ('5.99', '504', '2007-03-20T13:22:09.996577', '13859', '2'), + ('0.99', '587', '2007-03-22T19:42:17.996577', '15349', '2'), + ('2.99', '286', '2007-04-27T11:18:22.996577', '7299', '1'), + ('1.99', '51', '2007-02-15T13:16:30.996577', '1373', '2'), + ('2.99', '66', '2007-04-28T08:46:42.996577', '7872', '1'), + ('4.99', '507', '2007-03-18T03:10:28.996577', '12275', '2'), + ('0.99', '198', '2007-02-17T23:40:48.996577', '2185', '2'), + ('1.99', '61', '2007-03-23T08:04:00.996577', '15681', '1'), + ('4.99', '444', '2007-03-17T06:40:52.996577', '11728', '1'), + ('4.99', '340', '2007-04-29T11:42:50.996577', '8606', '1'), + ('5.99', '144', '2007-04-29T06:34:06.996577', '8459', '2'), + ('2.99', '549', '2007-02-17T13:35:56.996577', '2050', '1'), + ('0.99', '383', '2007-04-11T13:22:04.996577', '6244', '2'), + ('4.99', '520', '2007-03-21T08:08:16.996577', '14372', '1'), + ('2.99', '113', '2007-02-19T16:57:36.996577', '2783', '1'), + ('3.98', '457', '2007-05-14T13:44:29.996577', '12645', '1'), + ('2.99', '425', '2007-04-11T17:16:48.996577', '6318', '2'), + ('1.99', '171', '2007-03-21T04:50:44.996577', '14270', '1'), + ('2.99', '317', '2007-04-30T07:34:08.996577', '9110', '1'), + ('9.99', '207', '2007-04-06T08:06:59.996577', '3687', '2'), + ('0.99', '269', '2007-04-08T15:25:56.996577', '4804', '2'), + ('2.99', '562', '2007-03-19T14:22:59.996577', '13225', '2'), + ('4.99', '65', '2007-03-02T20:03:26.996577', '11461', '2'), + ('5.99', '182', '2007-03-21T15:47:35.996577', '14586', '1'), + ('2.99', '177', '2007-03-01T15:16:57.996577', '10661', '1'), + ('2.99', '223', '2007-04-10T23:46:59.996577', '5996', '2'), + ('3.99', '305', '2007-03-17T10:20:05.996577', '11809', '2'), + ('8.99', '523', '2007-02-18T17:39:21.996577', '2447', '1'), + ('2.99', '35', '2007-02-17T09:15:50.996577', '1989', '1'), + ('2.99', '45', '2007-03-17T06:37:26.996577', '11725', '1'), + ('0.99', '288', '2007-04-28T04:06:46.996577', '7744', '2'), + ('4.99', '366', '2007-03-01T05:07:40.996577', '10384', '1'), + ('0.99', '565', '2007-04-05T21:17:50.996577', '3470', '2'), + ('4.99', '213', '2007-04-30T21:35:48.996577', '9477', '1'), + ('4.99', '96', '2007-04-30T15:33:55.996577', '9315', '1'), + ('3.99', '133', '2007-02-15T22:46:05.996577', '1522', '2'), + ('7.99', '204', '2007-02-17T02:47:14.996577', '1894', '2'), + ('0.99', '454', '2007-04-29T20:05:00.996577', '8806', '1'), + ('2.99', '139', '2007-04-08T08:27:44.996577', '4663', '2'), + ('2.99', '416', '2007-04-11T04:50:09.996577', '6097', '1'), + ('6.99', '400', '2007-04-08T04:07:12.996577', '4573', '1'), + ('6.99', '107', '2007-02-19T11:40:13.996577', '2693', '2'), + ('0.99', '142', '2007-03-19T07:42:57.996577', '13044', '1'), + ('4.99', '368', '2007-04-27T21:12:08.996577', '7571', '2'), + ('4.99', '52', '2007-02-15T00:06:57.996577', '1196', '1'), + ('0.99', '445', '2007-03-01T03:38:28.996577', '10341', '2'), + ('2.99', '394', '2007-04-06T22:57:21.996577', '4009', '2'), + ('2.99', '124', '2007-04-11T21:39:16.996577', '6411', '1'), + ('2.99', '559', '2007-04-30T20:46:22.996577', '10146', '2'), + ('4.99', '293', '2007-04-27T22:34:19.996577', '7607', '2'), + ('0.99', '215', '2007-03-21T00:00:43.996577', '14126', '2'), + ('8.99', '540', '2007-03-17T19:36:07.996577', '12058', '2'), + ('0.99', '563', '2007-04-07T21:20:30.996577', '4436', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['18057', '29066', '27686', '18055', '30575', '22345', '29446', '28460', '21981', '24413', '19871', '22482', '27271', '26765', '24594', '18335', '18876', '27236', '20933', '28496', '28160', '22900', '22734', '19493', '24320', '25890', '28815', '21475', '21459', '25461', '18215', '24582', '23555', '18649', '24182', '22801', '25743', '28508', '26903', '30175', '18482', '19695', '28397', '23722', '28739', '22422', '23088', '28663', '24430', '30869', '29130', '31922', '21649', '29723', '29537', '21676', '29015', '29006', '30269', '24050', '19104', '26971', '27550', '21979', '30587', '29462', '22103', '24850', '17961', '26216', '29507', '19305', '22862', '26771', '21200', '20618', '20018', '19149', '25210', '19047', '25268', '26236', '22486', '19275', '18401', '30404', '29953', '22330', '24733', '27730', '25593', '28529', '18889', '19733', '23772', '27722', '31533', '19446', '18212', '28387']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('4.99', '483', '2007-02-19T21:40:15.996577', '2855', '1'), + ('8.99', '7', '2007-04-09T20:20:31.996577', '5441', '1'), + ('4.99', '490', '2007-04-30T07:25:02.996577', '9108', '2'), + ('2.99', '482', '2007-02-20T11:18:21.996577', '3048', '2'), + ('6.99', '139', '2007-04-09T17:54:48.996577', '5390', '1'), + ('2.99', '566', '2007-03-21T05:42:12.996577', '14297', '1'), + ('4.99', '40', '2007-04-30T05:58:25.996577', '9700', '2'), + ('1.99', '563', '2007-04-07T05:02:01.996577', '4106', '1'), + ('6.99', '527', '2007-03-21T07:34:55.996577', '14352', '1'), + ('8.99', '180', '2007-03-18T04:35:57.996577', '12313', '1'), + ('2.99', '303', '2007-03-17T16:56:15.996577', '11993', '2'), + ('0.99', '582', '2007-03-21T14:59:14.996577', '14568', '1'), + ('4.99', '453', '2007-04-12T13:21:41.996577', '6752', '1'), + ('4.99', '407', '2007-04-28T17:36:10.996577', '8109', '1'), + ('4.99', '199', '2007-03-01T10:10:23.996577', '10517', '2'), + ('4.99', '563', '2007-02-15T23:59:49.996577', '1545', '2'), + ('0.99', '96', '2007-02-15T17:05:30.996577', '1437', '2'), + ('3.99', '449', '2007-04-28T06:20:39.996577', '7803', '2'), + ('5.99', '416', '2007-03-02T04:37:46.996577', '11047', '2'), + ('4.99', '566', '2007-04-06T06:44:13.996577', '3663', '2'), + ('2.99', '532', '2007-04-10T18:14:13.996577', '5887', '1'), + ('7.99', '22', '2007-03-22T11:46:51.996577', '15134', '1'), + ('2.99', '6', '2007-03-02T04:05:04.996577', '11023', '1'), + ('6.99', '262', '2007-02-19T16:23:14.996577', '2771', '1'), + ('4.99', '171', '2007-03-18T15:12:50.996577', '12600', '1'), + ('0.99', '331', '2007-04-28T22:43:03.996577', '8231', '1'), + ('1.99', '592', '2007-04-07T06:05:29.996577', '4129', '1'), + ('3.99', '471', '2007-03-01T21:44:36.996577', '10828', '2'), + ('2.99', '469', '2007-03-21T18:12:47.996577', '14661', '2'), + ('4.99', '294', '2007-04-06T07:47:56.996577', '3681', '1'), + ('2.99', '527', '2007-02-15T14:57:08.996577', '1398', '1'), + ('4.99', '198', '2007-03-17T11:32:02.996577', '11836', '1'), + ('0.99', '91', '2007-03-02T18:13:59.996577', '11418', '2'), + ('2.99', '35', '2007-02-19T14:44:22.996577', '2743', '1'), + ('2.99', '156', '2007-03-02T21:04:26.996577', '11490', '2'), + ('0.99', '13', '2007-03-19T13:54:14.996577', '13213', '2'), + ('8.99', '317', '2007-04-30T08:21:06.996577', '9770', '1'), + ('0.99', '566', '2007-04-29T15:54:29.996577', '8710', '1'), + ('4.99', '420', '2007-04-12T05:26:06.996577', '6588', '1'), + ('2.99', '104', '2007-04-27T03:50:30.996577', '7107', '2'), + ('2.99', '205', '2007-02-15T03:17:34.996577', '1238', '1'), + ('4.99', '284', '2007-03-01T10:49:39.996577', '10535', '1'), + ('4.99', '557', '2007-04-12T16:52:57.996577', '6823', '2'), + ('0.99', '113', '2007-03-01T04:58:30.996577', '10378', '1'), + ('4.99', '585', '2007-04-27T15:06:50.996577', '7409', '2'), + ('4.99', '575', '2007-03-23T11:02:07.996577', '15749', '2'), + ('4.99', '41', '2007-03-23T14:37:06.996577', '15860', '2'), + ('0.99', '579', '2007-04-30T03:21:49.996577', '8996', '1'), + ('4.99', '181', '2007-03-19T10:08:24.996577', '13118', '2'), + ('2.99', '166', '2007-04-06T03:56:28.996577', '3606', '2'), + ('8.99', '13', '2007-04-11T06:11:34.996577', '6118', '1'), + ('4.99', '279', '2007-05-14T13:44:29.996577', '13538', '2'), + ('6.99', '490', '2007-03-21T21:58:54.996577', '14761', '2'), + ('6.99', '66', '2007-04-07T07:51:53.996577', '4165', '2'), + ('4.99', '49', '2007-04-06T02:04:45.996577', '3575', '2'), + ('0.99', '494', '2007-03-19T09:16:24.996577', '13094', '2'), + ('0.99', '2', '2007-04-30T12:42:37.996577', '9248', '2'), + ('6.99', '2', '2007-04-10T11:07:22.996577', '5755', '1'), + ('0.99', '113', '2007-04-12T17:26:31.996577', '6836', '1'), + ('2.99', '144', '2007-03-20T13:47:21.996577', '13881', '2'), + ('4.99', '155', '2007-02-21T14:26:51.996577', '3405', '2'), + ('0.99', '425', '2007-04-30T19:53:19.996577', '10121', '1'), + ('8.99', '479', '2007-04-12T17:57:45.996577', '6849', '2'), + ('7.99', '527', '2007-03-17T22:19:56.996577', '12136', '1'), + ('4.99', '140', '2007-04-27T06:26:52.996577', '7170', '1'), + ('2.99', '41', '2007-04-30T17:55:28.996577', '10064', '1'), + ('0.99', '540', '2007-03-22T03:19:18.996577', '14910', '2'), + ('4.99', '235', '2007-03-18T11:44:57.996577', '12502', '1'), + ('7.99', '457', '2007-02-17T22:34:42.996577', '2172', '1'), + ('4.99', '359', '2007-04-28T20:05:18.996577', '8174', '1'), + ('2.99', '45', '2007-04-10T23:56:15.996577', '6002', '2'), + ('6.99', '213', '2007-02-19T02:47:30.996577', '2569', '2'), + ('2.99', '19', '2007-03-22T08:25:42.996577', '15047', '1'), + ('0.99', '408', '2007-04-11T02:40:24.996577', '6062', '1'), + ('1.99', '445', '2007-03-01T03:27:08.996577', '10334', '2'), + ('6.99', '383', '2007-03-23T15:12:51.996577', '15881', '1'), + ('4.99', '321', '2007-03-18T07:41:50.996577', '12398', '1'), + ('0.99', '171', '2007-02-16T09:34:35.996577', '1676', '2'), + ('7.99', '273', '2007-04-09T12:24:11.996577', '5256', '1'), + ('1.99', '142', '2007-02-15T05:57:56.996577', '1268', '1'), + ('4.99', '278', '2007-04-12T18:40:32.996577', '6869', '2'), + ('2.99', '361', '2007-04-09T07:14:44.996577', '5154', '2'), + ('4.99', '582', '2007-03-23T16:13:19.996577', '15911', '2'), + ('2.99', '199', '2007-02-17T03:39:53.996577', '1910', '1'), + ('4.99', '581', '2007-02-17T19:46:54.996577', '2137', '1'), + ('2.99', '125', '2007-04-29T05:47:42.996577', '8433', '1'), + ('4.99', '87', '2007-04-12T08:26:28.996577', '6638', '1'), + ('5.99', '565', '2007-03-18T20:50:57.996577', '12743', '2'), + ('2.99', '220', '2007-03-17T15:36:39.996577', '11947', '2'), + ('2.99', '494', '2007-04-30T09:26:58.996577', '9799', '1'), + ('0.99', '304', '2007-04-10T13:04:55.996577', '5795', '2'), + ('2.99', '568', '2007-04-27T02:26:16.996577', '7068', '2'), + ('4.99', '98', '2007-02-21T14:16:14.996577', '3399', '2'), + ('0.99', '288', '2007-03-19T14:34:04.996577', '13227', '1'), + ('7.99', '118', '2007-03-21T16:03:43.996577', '14595', '2'), + ('3.99', '494', '2007-04-27T09:34:20.996577', '7258', '2'), + ('4.99', '232', '2007-04-29T04:53:34.996577', '8401', '2'), + ('0.99', '252', '2007-02-20T06:10:13.996577', '2968', '1'), + ('2.99', '526', '2007-02-19T19:19:59.996577', '2828', '1'), + ('3.99', '556', '2007-04-08T16:41:36.996577', '4839', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['30259', '28759', '22669', '18360', '19643', '31857', '20857', '19105', '18216', '21399', '21474', '26968', '22761', '21567', '30333', '27978', '27982', '18785', '27992', '21948', '21564', '29767', '25337', '29589', '21462', '24051', '26963', '24784', '27778', '27760', '21286', '22938', '26934', '18536', '27247', '23778', '30832', '28452', '25141', '21582', '31052', '27980', '25451', '30584', '30217', '30302', '27307', '31286', '30583', '17944', '23714', '25309', '25107', '25788', '21877', '29921', '29918', '21674', '32001', '31534', '24659', '28937', '21836', '28273', '21708', '30231', '29822', '17772', '31073', '30219', '27405', '24443', '23602', '18402', '18806', '25777', '19712', '28627', '28817', '19234', '28777', '30292', '19303', '28969', '19101', '19066', '28547', '18108', '23712', '24110', '27525', '27190', '27532', '22430', '23839', '23800', '23171', '26612', '18926', '29915']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('5.99', '112', '2007-04-30T10:27:31.996577', '9830', '1'), + ('5.99', '587', '2007-04-30T13:12:00.996577', '9909', '2'), + ('0.99', '207', '2007-03-01T02:36:37.996577', '10300', '2'), + ('2.99', '570', '2007-02-20T18:12:11.996577', '3138', '2'), + ('5.99', '277', '2007-03-22T19:34:16.996577', '15345', '1'), + ('0.99', '262', '2007-04-09T23:04:03.996577', '5503', '2'), + ('4.99', '408', '2007-03-21T20:50:59.996577', '14733', '2'), + ('9.99', '156', '2007-02-17T16:13:35.996577', '2089', '2'), + ('0.99', '527', '2007-02-18T15:57:23.996577', '2422', '1'), + ('8.99', '464', '2007-03-20T06:14:56.996577', '13644', '1'), + ('2.99', '471', '2007-03-01T07:05:32.996577', '10430', '1'), + ('0.99', '425', '2007-04-30T02:37:42.996577', '8974', '1'), + ('0.99', '8', '2007-03-20T23:35:37.996577', '14114', '1'), + ('4.99', '481', '2007-03-17T13:22:19.996577', '11885', '1'), + ('7.99', '119', '2007-04-11T03:35:40.996577', '6079', '1'), + ('3.99', '517', '2007-04-28T13:05:44.996577', '7988', '2'), + ('4.99', '518', '2007-04-08T08:23:32.996577', '4661', '2'), + ('4.99', '75', '2007-02-17T04:28:49.996577', '1920', '1'), + ('2.99', '518', '2007-04-29T04:38:01.996577', '8397', '1'), + ('4.99', '523', '2007-03-21T22:10:46.996577', '14766', '1'), + ('0.99', '481', '2007-03-02T10:29:56.996577', '11207', '2'), + ('2.99', '70', '2007-04-29T17:36:23.996577', '8747', '1'), + ('7.99', '284', '2007-04-08T20:44:44.996577', '4931', '2'), + ('3.99', '52', '2007-04-30T07:46:59.996577', '9749', '2'), + ('2.99', '469', '2007-03-23T14:14:59.996577', '15851', '1'), + ('2.99', '144', '2007-03-21T01:14:24.996577', '14159', '2'), + ('2.99', '425', '2007-04-09T16:47:15.996577', '5363', '2'), + ('2.99', '226', '2007-03-23T18:49:03.996577', '15986', '1'), + ('0.99', '498', '2007-04-30T04:02:50.996577', '9021', '2'), + ('6.99', '497', '2007-04-28T19:19:07.996577', '8150', '1'), + ('5.99', '453', '2007-03-21T06:01:01.996577', '14306', '2'), + ('1.99', '26', '2007-03-21T16:19:32.996577', '14603', '2'), + ('0.99', '423', '2007-04-27T10:57:11.996577', '7290', '1'), + ('0.99', '10', '2007-02-19T22:29:21.996577', '2865', '1'), + ('2.99', '451', '2007-04-08T02:24:55.996577', '4538', '1'), + ('2.99', '119', '2007-03-02T16:45:13.996577', '11377', '2'), + ('4.99', '162', '2007-04-30T09:59:03.996577', '9167', '2'), + ('4.99', '562', '2007-04-08T15:23:43.996577', '4802', '1'), + ('4.99', '265', '2007-03-21T00:00:42.996577', '14125', '2'), + ('4.99', '482', '2007-03-22T06:20:57.996577', '14995', '2'), + ('6.99', '181', '2007-04-06T16:03:48.996577', '3862', '1'), + ('0.99', '518', '2007-04-06T06:12:56.996577', '3652', '1'), + ('3.99', '293', '2007-04-06T18:04:21.996577', '3906', '1'), + ('9.99', '140', '2007-04-11T21:30:45.996577', '6407', '1'), + ('4.99', '108', '2007-04-08T08:00:34.996577', '4650', '1'), + ('0.99', '115', '2007-04-30T01:22:57.996577', '9578', '2'), + ('4.99', '457', '2007-04-29T03:48:19.996577', '8373', '2'), + ('0.99', '210', '2007-04-10T21:52:28.996577', '5957', '2'), + ('4.99', '140', '2007-04-11T15:24:01.996577', '6286', '1'), + ('9.99', '454', '2007-02-19T09:45:38.996577', '2666', '2'), + ('8.99', '112', '2007-03-20T04:49:08.996577', '13611', '2'), + ('2.99', '282', '2007-04-27T16:00:46.996577', '7433', '1'), + ('2.99', '262', '2007-03-19T23:23:42.996577', '13466', '2'), + ('0.99', '322', '2007-04-12T10:19:22.996577', '6673', '2'), + ('3.99', '515', '2007-03-21T08:18:28.996577', '14378', '2'), + ('0.99', '84', '2007-04-09T11:25:24.996577', '5237', '1'), + ('6.99', '84', '2007-04-07T03:34:53.996577', '4079', '2'), + ('3.99', '494', '2007-03-02T08:22:02.996577', '11152', '2'), + ('0.00', '576', '2007-05-14T13:44:29.996577', '13464', '1'), + ('4.99', '232', '2007-04-29T13:33:08.996577', '8655', '2'), + ('0.99', '212', '2007-03-01T11:44:27.996577', '10567', '2'), + ('6.99', '204', '2007-04-12T11:07:49.996577', '6694', '1'), + ('4.99', '512', '2007-03-21T05:26:00.996577', '14288', '1'), + ('2.99', '543', '2007-04-08T18:27:40.996577', '4887', '1'), + ('0.99', '498', '2007-03-01T00:07:06.996577', '10225', '1'), + ('0.99', '109', '2007-04-27T05:29:26.996577', '7145', '2'), + ('3.99', '75', '2007-04-11T04:19:57.996577', '6092', '1'), + ('2.99', '408', '2007-02-19T02:09:36.996577', '2564', '1'), + ('0.99', '182', '2007-04-28T08:34:12.996577', '7863', '2'), + ('6.99', '108', '2007-04-09T13:02:35.996577', '5274', '2'), + ('2.99', '467', '2007-04-27T22:40:13.996577', '7611', '1'), + ('1.99', '182', '2007-03-22T08:17:58.996577', '15043', '1'), + ('4.99', '96', '2007-03-23T18:53:02.996577', '15989', '2'), + ('2.99', '582', '2007-02-16T13:24:19.996577', '1719', '1'), + ('2.99', '80', '2007-02-19T04:16:52.996577', '2596', '1'), + ('2.99', '321', '2007-04-09T09:22:14.996577', '5202', '2'), + ('0.99', '286', '2007-03-17T04:17:25.996577', '11670', '2'), + ('0.99', '576', '2007-04-30T14:39:02.996577', '9962', '2'), + ('0.99', '592', '2007-04-07T22:18:40.996577', '4460', '1'), + ('2.99', '190', '2007-02-15T09:07:31.996577', '1319', '1'), + ('3.99', '589', '2007-04-11T13:28:31.996577', '6247', '2'), + ('4.99', '115', '2007-04-09T11:52:40.996577', '5245', '1'), + ('5.99', '213', '2007-02-18T08:12:47.996577', '2322', '1'), + ('0.99', '207', '2007-04-08T15:42:40.996577', '4816', '1'), + ('7.99', '155', '2007-02-16T00:45:13.996577', '1554', '1'), + ('2.99', '146', '2007-02-18T10:11:06.996577', '2342', '1'), + ('4.99', '570', '2007-04-27T06:29:02.996577', '7174', '2'), + ('0.99', '498', '2007-02-21T10:41:07.996577', '3360', '2'), + ('4.99', '112', '2007-03-17T03:49:11.996577', '11659', '2'), + ('7.99', '149', '2007-03-01T17:59:50.996577', '10737', '2'), + ('5.99', '477', '2007-04-07T11:45:21.996577', '4237', '2'), + ('0.99', '445', '2007-04-29T23:59:23.996577', '8911', '2'), + ('5.99', '477', '2007-04-29T20:46:38.996577', '8821', '1'), + ('0.99', '576', '2007-03-21T14:02:58.996577', '14541', '1'), + ('2.99', '125', '2007-03-01T16:53:17.996577', '10699', '1'), + ('4.99', '120', '2007-03-21T04:02:35.996577', '14246', '1'), + ('2.99', '51', '2007-03-19T17:22:52.996577', '13302', '1'), + ('0.99', '394', '2007-04-06T00:29:34.996577', '3543', '2'), + ('5.99', '109', '2007-02-19T10:40:56.996577', '2679', '2'), + ('0.99', '83', '2007-04-28T03:11:24.996577', '7721', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['18297', '23288', '20929', '17643', '19997', '30334', '17529', '24176', '24676', '23383', '18015', '23505', '21397', '26790', '29577', '20705', '27554', '27304', '30005', '17756', '30006', '23174', '27175', '21835', '19301', '27845', '29069', '25275', '20607', '28780', '24779', '26041', '26970', '27698', '26327', '30654', '21566', '21581', '18340', '21188', '30937', '27445', '19641', '20274', '20190', '24063', '28191', '30268', '22242', '29248', '25607', '29229', '22566', '28363', '21868', '21887', '23273', '31096', '22932', '27466', '28421', '30019', '30090', '23654', '22602', '29102', '30253', '32061', '30004', '23701', '30013', '28092', '17585', '21189', '20230', '24589', '25455', '18943', '29242', '25792', '18018', '23797', '26695', '21402', '30059', '18596', '19671', '18599', '29084', '28250', '24666', '26774', '21537', '24836', '18989', '29012', '29549', '24270', '30208', '27840']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('6.99', '553', '2007-02-20T15:26:45.996577', '3103', '2'), + ('0.99', '63', '2007-03-18T12:07:52.996577', '12515', '2'), + ('3.99', '416', '2007-03-01T01:10:29.996577', '10254', '1'), + ('4.99', '377', '2007-02-21T18:47:26.996577', '3443', '2'), + ('2.99', '317', '2007-03-21T18:22:32.996577', '14669', '2'), + ('0.99', '119', '2007-04-11T17:44:08.996577', '6330', '2'), + ('8.99', '347', '2007-02-16T12:40:18.996577', '1711', '2'), + ('8.99', '155', '2007-03-21T06:39:22.996577', '14324', '1'), + ('4.99', '214', '2007-03-18T10:00:00.996577', '12463', '2'), + ('4.99', '73', '2007-03-02T15:50:15.996577', '11349', '2'), + ('4.99', '471', '2007-02-18T10:53:55.996577', '2350', '2'), + ('3.99', '85', '2007-03-20T08:37:19.996577', '13727', '1'), + ('7.99', '463', '2007-03-22T12:51:37.996577', '15151', '2'), + ('2.99', '409', '2007-04-28T01:22:19.996577', '7673', '2'), + ('0.99', '51', '2007-04-29T22:45:21.996577', '8880', '1'), + ('5.99', '392', '2007-03-21T03:20:17.996577', '14223', '1'), + ('8.99', '479', '2007-04-30T20:06:38.996577', '9439', '1'), + ('0.99', '457', '2007-04-09T22:56:43.996577', '5500', '1'), + ('4.99', '91', '2007-04-07T12:16:59.996577', '4245', '1'), + ('4.99', '405', '2007-02-15T08:51:34.996577', '1315', '2'), + ('4.99', '91', '2007-04-07T16:21:04.996577', '4321', '1'), + ('6.99', '51', '2007-03-21T03:18:07.996577', '14221', '2'), + ('4.99', '444', '2007-04-05T22:30:34.996577', '3498', '2'), + ('0.99', '512', '2007-03-20T10:15:47.996577', '13771', '2'), + ('0.99', '213', '2007-02-15T20:10:04.996577', '1489', '1'), + ('1.99', '504', '2007-04-28T08:52:14.996577', '7875', '2'), + ('2.99', '7', '2007-04-11T15:59:24.996577', '6295', '1'), + ('7.99', '279', '2007-04-08T22:50:28.996577', '4978', '1'), + ('5.99', '382', '2007-03-21T07:36:40.996577', '14354', '2'), + ('9.99', '589', '2007-04-28T11:34:42.996577', '7948', '2'), + ('0.99', '226', '2007-03-21T19:51:22.996577', '14712', '1'), + ('2.99', '345', '2007-04-07T20:38:11.996577', '4422', '2'), + ('2.99', '425', '2007-04-30T05:15:36.996577', '9682', '2'), + ('4.99', '491', '2007-04-30T22:11:30.996577', '10178', '2'), + ('0.99', '368', '2007-04-08T04:39:28.996577', '4584', '1'), + ('4.99', '146', '2007-04-08T23:44:39.996577', '5000', '2'), + ('4.99', '481', '2007-03-17T07:39:21.996577', '11752', '1'), + ('6.99', '482', '2007-03-22T02:39:28.996577', '14891', '2'), + ('5.99', '565', '2007-02-21T05:53:27.996577', '3300', '1'), + ('0.99', '444', '2007-03-02T16:03:11.996577', '11353', '2'), + ('2.99', '171', '2007-04-06T10:38:58.996577', '3745', '2'), + ('4.99', '470', '2007-04-06T19:00:53.996577', '3922', '1'), + ('4.99', '277', '2007-03-21T21:21:27.996577', '14745', '2'), + ('5.99', '348', '2007-03-20T04:30:28.996577', '13602', '2'), + ('0.99', '340', '2007-03-02T03:16:26.996577', '10995', '1'), + ('6.99', '145', '2007-03-21T08:43:46.996577', '14389', '2'), + ('6.99', '535', '2007-04-08T19:59:19.996577', '4914', '2'), + ('0.99', '113', '2007-04-11T00:46:39.996577', '6025', '1'), + ('3.99', '556', '2007-03-17T10:11:11.996577', '11804', '2'), + ('2.99', '25', '2007-04-07T20:00:19.996577', '4404', '2'), + ('0.99', '305', '2007-04-12T07:19:14.996577', '6619', '2'), + ('5.99', '23', '2007-04-12T20:58:41.996577', '6917', '2'), + ('2.99', '592', '2007-03-19T11:40:54.996577', '13157', '1'), + ('4.99', '553', '2007-04-06T17:26:41.996577', '3890', '1'), + ('0.99', '515', '2007-03-01T17:22:14.996577', '10716', '2'), + ('4.99', '517', '2007-03-01T04:18:33.996577', '10358', '2'), + ('0.99', '61', '2007-03-20T12:26:25.996577', '13830', '1'), + ('9.99', '185', '2007-04-07T09:00:51.996577', '4186', '1'), + ('2.99', '26', '2007-03-02T14:32:34.996577', '11314', '2'), + ('2.99', '471', '2007-04-30T06:28:45.996577', '9077', '1'), + ('1.99', '559', '2007-04-09T18:11:18.996577', '5396', '2'), + ('2.99', '91', '2007-04-30T12:05:23.996577', '9228', '2'), + ('5.99', '98', '2007-04-29T20:42:30.996577', '8818', '2'), + ('1.99', '104', '2007-03-19T06:30:50.996577', '13017', '1'), + ('2.99', '597', '2007-03-02T11:02:53.996577', '11223', '2'), + ('6.99', '10', '2007-04-28T13:39:21.996577', '8001', '2'), + ('2.99', '112', '2007-04-12T03:31:40.996577', '6550', '2'), + ('0.99', '162', '2007-05-14T13:44:29.996577', '14220', '1'), + ('2.99', '91', '2007-04-07T04:53:54.996577', '4103', '2'), + ('4.99', '111', '2007-03-02T01:56:47.996577', '10952', '1'), + ('2.99', '91', '2007-04-12T18:22:43.996577', '6860', '2'), + ('4.99', '526', '2007-04-28T22:43:03.996577', '8232', '1'), + ('2.99', '361', '2007-02-19T21:35:29.996577', '2851', '1'), + ('6.99', '444', '2007-03-02T18:15:04.996577', '11419', '2'), + ('3.99', '343', '2007-03-20T01:12:32.996577', '13522', '2'), + ('5.99', '198', '2007-03-21T02:59:15.996577', '14214', '1'), + ('3.99', '293', '2007-04-10T11:31:28.996577', '5765', '2'), + ('8.99', '113', '2007-02-20T16:56:45.996577', '3124', '1'), + ('1.99', '24', '2007-04-27T09:50:43.996577', '7266', '1'), + ('7.99', '322', '2007-04-30T07:18:21.996577', '9104', '1'), + ('6.99', '472', '2007-02-16T17:15:24.996577', '1776', '2'), + ('7.99', '120', '2007-03-19T19:59:57.996577', '13375', '2'), + ('3.99', '402', '2007-04-08T05:27:09.996577', '4604', '2'), + ('0.99', '464', '2007-03-23T14:26:31.996577', '15854', '2'), + ('2.99', '96', '2007-04-06T09:35:23.996577', '3720', '1'), + ('9.99', '26', '2007-02-17T16:42:34.996577', '2093', '1'), + ('4.99', '280', '2007-03-02T16:29:51.996577', '11366', '1'), + ('4.99', '26', '2007-02-18T23:56:12.996577', '2532', '1'), + ('0.99', '8', '2007-04-30T20:36:55.996577', '10141', '2'), + ('4.99', '540', '2007-04-08T23:17:29.996577', '4991', '2'), + ('2.99', '212', '2007-03-23T16:33:36.996577', '15920', '2'), + ('4.99', '408', '2007-04-27T02:07:20.996577', '7053', '1'), + ('4.99', '477', '2007-03-18T08:30:16.996577', '12420', '2'), + ('0.99', '234', '2007-03-01T10:53:20.996577', '10541', '2'), + ('7.99', '125', '2007-02-19T19:10:01.996577', '2826', '1'), + ('5.99', '2', '2007-04-29T15:42:55.996577', '8705', '2'), + ('4.99', '49', '2007-04-30T20:42:18.996577', '10144', '1'), + ('4.99', '166', '2007-03-19T05:06:44.996577', '12968', '1'), + ('4.99', '107', '2007-04-27T16:30:34.996577', '7447', '2'), + ('0.99', '504', '2007-04-08T13:05:17.996577', '4757', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['24126', '21700', '19782', '31243', '26957', '31549', '25882', '19926', '28370', '28902', '28331', '24042', '22650', '19620', '23600', '27687', '29165', '26898', '29391', '31751', '29173', '22744', '21663', '21211', '21803', '19297', '22234', '29377', '23169', '23595', '29572', '19763', '18180', '22338', '17797', '22732', '25889', '18698', '21481', '25220', '20241', '19372', '30877', '21912', '21988', '18887', '18394', '25794', '18190', '23642', '20192', '29576', '24671', '19156', '29988', '25111', '21576', '21967', '22455', '29144', '30332', '31324', '25615', '25765', '21771', '27398', '19758', '32069', '21395', '21273', '26696', '18684', '29798', '28139', '20392', '26080', '21295', '28113', '25984', '17805', '20388', '25269', '29728', '27976', '25763', '19925', '19674', '23164', '30249', '18587', '30162', '26344', '22332', '23112', '30319', '20260', '20437', '24429', '31901', '30498']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('8.99', '150', '2007-03-19T15:22:38.996577', '13255', '2'), + ('7.99', '497', '2007-03-01T18:53:46.996577', '10760', '2'), + ('4.99', '294', '2007-03-01T14:13:37.996577', '10642', '2'), + ('2.99', '199', '2007-04-30T23:03:17.996577', '10196', '1'), + ('2.99', '425', '2007-04-07T18:01:49.996577', '4361', '2'), + ('2.99', '233', '2007-04-29T08:54:40.996577', '8530', '2'), + ('4.99', '331', '2007-04-06T04:14:19.996577', '3613', '1'), + ('4.99', '308', '2007-03-23T00:49:19.996577', '15493', '2'), + ('2.99', '553', '2007-04-11T03:13:25.996577', '6069', '1'), + ('4.99', '598', '2007-04-30T17:44:18.996577', '10054', '1'), + ('0.99', '549', '2007-04-30T12:28:58.996577', '9887', '2'), + ('2.99', '144', '2007-03-02T11:23:49.996577', '11228', '1'), + ('11.99', '204', '2007-03-22T22:17:22.996577', '15415', '2'), + ('0.99', '276', '2007-03-01T16:38:19.996577', '10691', '2'), + ('4.99', '96', '2007-03-20T13:17:21.996577', '13855', '1'), + ('0.99', '490', '2007-04-30T00:35:15.996577', '9554', '1'), + ('2.99', '16', '2007-04-07T10:39:48.996577', '4219', '2'), + ('4.99', '420', '2007-04-09T07:48:27.996577', '5168', '1'), + ('6.99', '36', '2007-04-27T07:34:39.996577', '7205', '1'), + ('0.99', '252', '2007-04-07T18:37:27.996577', '4372', '2'), + ('5.99', '16', '2007-04-30T02:22:31.996577', '9610', '2'), + ('0.99', '6', '2007-03-23T05:09:58.996577', '15603', '2'), + ('6.99', '493', '2007-03-01T19:32:16.996577', '10777', '1'), + ('3.99', '445', '2007-03-22T11:17:10.996577', '15123', '1'), + ('4.99', '507', '2007-03-21T17:02:47.996577', '14625', '2'), + ('0.99', '212', '2007-02-15T11:45:27.996577', '1356', '1'), + ('4.99', '555', '2007-03-17T20:51:16.996577', '12091', '2'), + ('5.99', '35', '2007-04-11T07:41:34.996577', '6147', '1'), + ('4.99', '51', '2007-03-18T20:11:35.996577', '12725', '1'), + ('4.99', '96', '2007-03-17T12:30:27.996577', '11864', '2'), + ('5.99', '51', '2007-04-27T07:41:52.996577', '7207', '1'), + ('4.99', '292', '2007-03-02T09:59:59.996577', '11193', '1'), + ('8.99', '517', '2007-02-16T19:28:46.996577', '1809', '1'), + ('2.99', '566', '2007-03-02T07:37:10.996577', '11129', '2'), + ('0.99', '416', '2007-02-16T16:40:43.996577', '1771', '2'), + ('0.99', '5', '2007-03-22T16:05:28.996577', '15232', '2'), + ('5.99', '331', '2007-04-10T21:36:08.996577', '5947', '1'), + ('0.99', '49', '2007-02-14T21:44:52.996577', '1164', '1'), + ('5.99', '471', '2007-03-21T06:29:06.996577', '14317', '1'), + ('0.99', '273', '2007-04-30T18:17:07.996577', '9391', '2'), + ('2.99', '345', '2007-03-17T12:32:12.996577', '11865', '1'), + ('4.99', '233', '2007-02-18T17:20:56.996577', '2443', '2'), + ('0.99', '166', '2007-04-11T12:47:38.996577', '6237', '2'), + ('4.99', '520', '2007-03-18T12:08:46.996577', '12517', '1'), + ('7.99', '528', '2007-03-20T04:28:51.996577', '13600', '1'), + ('0.99', '98', '2007-02-18T17:30:37.996577', '2445', '1'), + ('2.99', '578', '2007-02-21T06:15:23.996577', '3305', '1'), + ('1.99', '322', '2007-04-30T12:48:25.996577', '9252', '1'), + ('6.99', '520', '2007-02-17T22:37:27.996577', '2174', '2'), + ('0.99', '103', '2007-03-20T07:01:47.996577', '13676', '1'), + ('1.99', '340', '2007-03-19T02:47:31.996577', '12908', '2'), + ('0.99', '51', '2007-04-29T15:12:39.996577', '8693', '1'), + ('6.99', '213', '2007-03-21T21:13:47.996577', '14744', '1'), + ('0.99', '172', '2007-02-15T20:53:52.996577', '1507', '2'), + ('0.99', '89', '2007-04-30T08:15:15.996577', '9767', '2'), + ('6.99', '262', '2007-03-22T00:14:24.996577', '14834', '2'), + ('2.99', '482', '2007-03-01T22:06:05.996577', '10839', '2'), + ('0.99', '526', '2007-03-20T03:52:00.996577', '13580', '2'), + ('1.99', '579', '2007-03-21T14:07:27.996577', '14543', '1'), + ('0.99', '14', '2007-04-09T05:05:33.996577', '5104', '1'), + ('0.99', '119', '2007-04-09T12:51:09.996577', '5268', '1'), + ('2.99', '213', '2007-04-29T06:04:39.996577', '8444', '2'), + ('4.99', '306', '2007-04-26T22:21:13.996577', '6953', '1'), + ('4.99', '320', '2007-04-27T02:18:29.996577', '7057', '2'), + ('1.99', '504', '2007-03-18T21:55:06.996577', '12769', '1'), + ('0.99', '467', '2007-04-07T10:30:00.996577', '4216', '1'), + ('4.99', '291', '2007-03-01T08:08:09.996577', '10463', '1'), + ('2.99', '181', '2007-05-14T13:44:29.996577', '13008', '2'), + ('0.99', '463', '2007-03-21T19:01:26.996577', '14689', '1'), + ('4.99', '452', '2007-03-17T06:09:21.996577', '11715', '2'), + ('4.99', '402', '2007-04-09T15:18:12.996577', '5329', '2'), + ('3.99', '45', '2007-02-21T13:39:28.996577', '3391', '1'), + ('4.99', '73', '2007-04-09T00:38:07.996577', '5021', '2'), + ('3.99', '530', '2007-04-30T23:29:42.996577', '10211', '2'), + ('0.99', '361', '2007-03-21T09:50:12.996577', '14422', '1'), + ('4.99', '347', '2007-04-30T03:47:46.996577', '9013', '1'), + ('8.99', '454', '2007-03-20T07:41:49.996577', '13694', '2'), + ('4.99', '528', '2007-04-28T17:39:33.996577', '8112', '2'), + ('7.99', '338', '2007-04-30T22:01:06.996577', '9485', '1'), + ('0.99', '420', '2007-02-19T13:30:46.996577', '2726', '1'), + ('5.99', '361', '2007-03-18T16:05:11.996577', '12626', '2'), + ('0.99', '278', '2007-04-27T08:48:53.996577', '7239', '1'), + ('3.99', '66', '2007-04-11T21:14:36.996577', '6402', '1'), + ('4.99', '517', '2007-04-12T05:54:09.996577', '6594', '2'), + ('4.99', '320', '2007-04-06T11:09:04.996577', '3756', '2'), + ('4.99', '308', '2007-03-22T16:16:54.996577', '15243', '1'), + ('5.99', '280', '2007-03-19T00:34:03.996577', '12849', '1'), + ('0.99', '51', '2007-03-01T23:41:01.996577', '10894', '1'), + ('0.99', '111', '2007-04-30T13:53:12.996577', '9933', '2'), + ('7.99', '24', '2007-02-20T06:01:35.996577', '2963', '2'), + ('6.99', '103', '2007-04-12T11:13:23.996577', '6697', '2'), + ('2.99', '369', '2007-04-29T20:58:42.996577', '8826', '2'), + ('4.99', '565', '2007-03-19T14:07:05.996577', '13217', '2'), + ('4.99', '45', '2007-03-02T04:19:36.996577', '11029', '1'), + ('0.99', '118', '2007-04-08T22:15:51.996577', '4966', '1'), + ('10.99', '347', '2007-03-18T07:42:08.996577', '12399', '2'), + ('4.99', '366', '2007-03-21T05:31:25.996577', '14290', '1'), + ('2.99', '181', '2007-03-19T04:06:51.996577', '12939', '2'), + ('2.99', '265', '2007-04-28T02:30:39.996577', '7704', '1'), + ('2.99', '133', '2007-04-08T03:47:16.996577', '4566', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['23022', '29955', '28110', '27714', '29100', '30851', '23847', '28245', '27338', '27036', '21299', '29083', '24777', '29085', '19885', '29628', '22492', '31418', '18072', '26488', '30647', '22763', '29985', '18988', '17934', '27261', '18594', '18034', '23769', '30938', '28828', '31005', '24731', '23526', '21202', '28211', '30397', '30849', '25289', '18183', '27546', '19180', '18191', '29384', '21590', '23305', '28018', '32051', '28381', '31070', '27667', '27389', '22215', '24658', '24634', '30761', '31547', '25216', '24968', '29721', '31924', '25255', '22447', '22858', '19780', '24440', '21328', '20839', '21400', '27255', '25371', '25609', '27716', '17670', '22277', '26493', '19734', '31043', '29183', '19054', '25871', '24380', '24673', '27552', '20771', '18878', '24664', '29074', '27666', '20852', '23686', '29983', '30273', '29645', '31339', '31453', '21357', '24385', '19055', '24514']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('7.99', '35', '2007-03-02T19:28:18.996577', '11452', '1'), + ('7.99', '87', '2007-04-28T21:02:19.996577', '8187', '2'), + ('3.99', '528', '2007-04-09T10:16:24.996577', '5215', '2'), + ('0.99', '494', '2007-04-05T23:10:27.996577', '3511', '1'), + ('2.99', '10', '2007-04-10T19:09:35.996577', '5905', '1'), + ('4.99', '164', '2007-04-12T08:26:05.996577', '6637', '1'), + ('2.99', '125', '2007-03-21T11:06:35.996577', '14456', '2'), + ('5.99', '539', '2007-04-29T17:55:13.996577', '8761', '2'), + ('7.99', '460', '2007-04-07T22:00:20.996577', '4452', '1'), + ('4.99', '432', '2007-04-30T13:23:18.996577', '9916', '2'), + ('4.99', '454', '2007-03-22T07:10:58.996577', '15012', '2'), + ('2.99', '8', '2007-04-30T03:23:09.996577', '9629', '2'), + ('6.99', '226', '2007-03-21T12:24:05.996577', '14491', '1'), + ('2.99', '9', '2007-04-07T22:05:26.996577', '4454', '1'), + ('4.99', '305', '2007-03-01T06:54:34.996577', '10426', '2'), + ('1.99', '57', '2007-04-12T01:11:17.996577', '6494', '1'), + ('4.99', '584', '2007-03-02T00:33:09.996577', '10914', '1'), + ('0.99', '223', '2007-04-06T08:46:25.996577', '3705', '1'), + ('5.99', '488', '2007-02-16T12:14:22.996577', '1704', '2'), + ('4.99', '382', '2007-04-08T23:49:16.996577', '5004', '1'), + ('2.99', '145', '2007-04-27T02:19:36.996577', '7061', '2'), + ('2.99', '8', '2007-03-23T11:33:36.996577', '15764', '1'), + ('0.99', '89', '2007-04-30T02:34:51.996577', '8972', '2'), + ('3.99', '125', '2007-02-18T11:25:32.996577', '2355', '1'), + ('5.99', '453', '2007-02-19T21:37:16.996577', '2852', '2'), + ('0.99', '452', '2007-04-09T22:17:33.996577', '5480', '2'), + ('5.99', '26', '2007-02-15T17:21:40.996577', '1440', '1'), + ('2.99', '477', '2007-02-17T23:45:53.996577', '2187', '1'), + ('2.99', '118', '2007-03-18T12:37:35.996577', '12538', '2'), + ('5.99', '171', '2007-04-10T06:14:38.996577', '5660', '1'), + ('2.99', '593', '2007-04-06T00:20:08.996577', '3542', '2'), + ('2.99', '177', '2007-04-11T15:20:05.996577', '6284', '1'), + ('3.99', '220', '2007-03-02T08:22:45.996577', '11153', '1'), + ('10.99', '87', '2007-03-20T19:42:24.996577', '14024', '2'), + ('9.99', '445', '2007-03-02T01:23:30.996577', '10936', '2'), + ('0.99', '537', '2007-04-06T01:14:01.996577', '3555', '1'), + ('7.99', '125', '2007-04-10T00:16:21.996577', '5523', '2'), + ('0.99', '164', '2007-04-11T20:56:38.996577', '6393', '1'), + ('7.99', '280', '2007-04-29T10:03:49.996577', '8565', '1'), + ('0.99', '517', '2007-02-20T16:25:06.996577', '3113', '1'), + ('4.99', '479', '2007-04-10T10:53:37.996577', '5751', '1'), + ('4.99', '177', '2007-02-16T05:52:38.996577', '1621', '2'), + ('4.99', '520', '2007-02-19T16:27:53.996577', '2772', '1'), + ('2.99', '35', '2007-04-30T04:36:08.996577', '9033', '2'), + ('2.99', '483', '2007-03-18T18:40:01.996577', '12695', '2'), + ('2.99', '65', '2007-03-17T11:45:04.996577', '11845', '2'), + ('2.99', '520', '2007-04-30T09:34:28.996577', '9803', '1'), + ('4.99', '108', '2007-05-14T13:44:29.996577', '15294', '1'), + ('0.99', '555', '2007-04-28T19:39:26.996577', '8161', '1'), + ('0.99', '182', '2007-04-08T14:38:22.996577', '4784', '2'), + ('2.99', '488', '2007-04-30T23:45:17.996577', '9532', '1'), + ('3.99', '465', '2007-04-12T20:30:35.996577', '6904', '2'), + ('2.99', '553', '2007-03-20T17:20:43.996577', '13972', '1'), + ('4.99', '212', '2007-03-01T01:43:13.996577', '10273', '2'), + ('4.99', '210', '2007-03-01T23:27:12.996577', '10890', '2'), + ('4.99', '156', '2007-04-10T00:55:15.996577', '5534', '2'), + ('4.99', '233', '2007-04-27T14:22:45.996577', '7387', '2'), + ('5.99', '273', '2007-04-12T12:03:28.996577', '6717', '1'), + ('4.99', '247', '2007-03-20T20:13:49.996577', '14041', '1'), + ('2.99', '66', '2007-04-07T04:00:21.996577', '4088', '2'), + ('5.98', '284', '2007-05-14T13:44:29.996577', '12064', '1'), + ('4.99', '277', '2007-04-07T14:15:36.996577', '4290', '1'), + ('5.99', '578', '2007-03-20T00:19:49.996577', '13498', '2'), + ('2.99', '19', '2007-03-18T06:09:18.996577', '12357', '2'), + ('6.99', '294', '2007-03-01T11:17:21.996577', '10551', '1'), + ('2.99', '182', '2007-03-19T16:47:10.996577', '13285', '1'), + ('6.99', '457', '2007-03-21T07:53:39.996577', '14365', '1'), + ('5.99', '407', '2007-03-02T16:49:18.996577', '11382', '2'), + ('2.99', '464', '2007-03-20T15:59:44.996577', '13943', '2'), + ('6.99', '452', '2007-04-06T18:07:40.996577', '3907', '2'), + ('6.99', '286', '2007-04-28T03:07:35.996577', '7719', '1'), + ('4.99', '305', '2007-04-30T07:54:22.996577', '9119', '2'), + ('0.99', '494', '2007-04-06T18:39:26.996577', '3913', '2'), + ('2.99', '383', '2007-02-18T02:13:16.996577', '2228', '2'), + ('7.99', '560', '2007-03-02T15:21:46.996577', '11334', '1'), + ('4.99', '382', '2007-04-30T03:19:51.996577', '8993', '1'), + ('2.99', '288', '2007-03-19T19:36:25.996577', '13363', '2'), + ('9.99', '180', '2007-04-08T20:23:51.996577', '4924', '1'), + ('3.99', '18', '2007-04-08T08:44:04.996577', '4672', '2'), + ('5.99', '144', '2007-02-16T19:43:48.996577', '1814', '1'), + ('2.99', '330', '2007-04-06T11:17:54.996577', '3760', '2'), + ('0.99', '177', '2007-03-01T17:13:02.996577', '10710', '1'), + ('4.99', '214', '2007-03-01T18:30:27.996577', '10749', '2'), + ('2.99', '479', '2007-04-28T09:17:53.996577', '7893', '2'), + ('6.99', '400', '2007-03-16T21:58:33.996577', '11510', '2'), + ('5.99', '96', '2007-02-20T06:27:53.996577', '2973', '2'), + ('5.99', '212', '2007-03-21T18:53:39.996577', '14681', '2'), + ('0.99', '8', '2007-04-06T22:37:28.996577', '4003', '1'), + ('5.99', '488', '2007-04-30T06:42:53.996577', '9083', '2'), + ('2.99', '408', '2007-03-18T11:29:34.996577', '12498', '1'), + ('2.99', '108', '2007-03-20T09:46:34.996577', '13754', '2'), + ('2.99', '89', '2007-04-28T13:39:53.996577', '8003', '1'), + ('4.99', '113', '2007-04-30T22:29:10.996577', '10181', '2'), + ('4.99', '58', '2007-04-30T18:08:04.996577', '10068', '1'), + ('8.99', '215', '2007-04-10T22:30:45.996577', '5967', '2'), + ('2.99', '226', '2007-04-09T19:16:02.996577', '5419', '1'), + ('3.99', '460', '2007-03-19T18:47:19.996577', '13341', '1'), + ('0.99', '177', '2007-03-20T22:49:55.996577', '14093', '2'), + ('0.99', '144', '2007-02-17T06:17:43.996577', '1943', '1'), + ('0.99', '190', '2007-03-20T21:09:13.996577', '14065', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['28513', '30793', '25848', '29890', '24125', '30941', '31561', '23480', '29984', '30648', '27956', '22287', '18100', '23529', '19107', '18856', '25734', '30656', '22601', '18858', '29882', '24352', '19081', '23081', '30254', '20697', '27640', '22603', '19605', '22476', '27400', '30488', '23152', '25363', '22474', '19380', '28647', '26838', '24205', '26617', '18213', '24037', '21896', '31735', '22292', '25845', '23356', '26843', '24838', '23537', '23746', '19607', '27642', '25892', '30509', '28188', '19673', '21890', '25432', '20368', '27451', '18840', '32037', '22692', '18590', '28400', '23563', '21460', '21970', '29891', '22799', '27319', '17989', '24463', '20102', '17959', '22914', '28371', '24431', '21964', '18387', '18224', '19660', '27380', '20373', '18411', '17741', '28685', '30790', '21551', '23323', '31059', '29088', '20440', '22417', '17943', '30329', '19577', '26078', '24809']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('2.99', '566', '2007-04-30T13:20:52.996577', '9915', '2'), + ('0.99', '158', '2007-04-28T03:31:58.996577', '7732', '1'), + ('1.99', '327', '2007-04-27T17:04:43.996577', '7458', '2'), + ('5.99', '80', '2007-04-29T08:06:45.996577', '8509', '1'), + ('6.99', '150', '2007-03-19T10:00:07.996577', '13116', '1'), + ('0.99', '171', '2007-04-12T14:24:34.996577', '6774', '2'), + ('4.99', '235', '2007-04-11T19:02:39.996577', '6352', '2'), + ('0.99', '83', '2007-03-02T17:53:39.996577', '11408', '1'), + ('2.99', '89', '2007-04-28T15:55:22.996577', '8070', '2'), + ('7.99', '145', '2007-04-27T19:46:34.996577', '7529', '1'), + ('3.99', '515', '2007-04-27T15:53:16.996577', '7429', '2'), + ('2.99', '561', '2007-03-02T16:36:02.996577', '11371', '1'), + ('5.99', '497', '2007-02-18T06:46:55.996577', '2298', '1'), + ('4.99', '87', '2007-03-23T15:26:38.996577', '15890', '2'), + ('4.99', '156', '2007-02-19T09:12:08.996577', '2658', '1'), + ('4.99', '91', '2007-02-15T08:03:16.996577', '1299', '1'), + ('0.99', '317', '2007-04-08T10:05:47.996577', '4700', '2'), + ('6.99', '146', '2007-04-11T09:47:47.996577', '6184', '2'), + ('4.99', '597', '2007-03-02T08:14:20.996577', '11147', '2'), + ('0.99', '91', '2007-02-20T01:45:18.996577', '2908', '1'), + ('3.99', '80', '2007-04-07T15:02:14.996577', '4299', '2'), + ('0.99', '174', '2007-03-16T22:43:57.996577', '11525', '1'), + ('4.99', '149', '2007-02-18T00:10:03.996577', '2194', '2'), + ('2.99', '40', '2007-03-22T14:35:15.996577', '15193', '1'), + ('4.99', '112', '2007-04-28T01:58:35.996577', '7691', '2'), + ('4.99', '392', '2007-03-01T07:19:17.996577', '10435', '1'), + ('4.99', '486', '2007-04-27T16:28:50.996577', '7446', '2'), + ('2.99', '597', '2007-03-02T11:56:56.996577', '11240', '1'), + ('1.99', '275', '2007-03-02T14:19:21.996577', '11309', '2'), + ('4.99', '581', '2007-03-23T12:34:03.996577', '15792', '2'), + ('4.99', '467', '2007-04-07T12:50:44.996577', '4259', '1'), + ('0.99', '132', '2007-04-08T19:18:31.996577', '4903', '2'), + ('2.99', '49', '2007-03-21T18:30:44.996577', '14676', '1'), + ('4.99', '286', '2007-04-08T10:25:54.996577', '4707', '1'), + ('2.99', '581', '2007-03-22T05:38:52.996577', '14976', '1'), + ('4.99', '234', '2007-02-20T22:41:06.996577', '3199', '2'), + ('0.99', '578', '2007-04-12T17:11:21.996577', '6830', '1'), + ('0.99', '414', '2007-04-12T12:25:14.996577', '6728', '2'), + ('1.99', '158', '2007-03-17T20:15:13.996577', '12070', '2'), + ('4.99', '394', '2007-04-10T00:56:08.996577', '5535', '1'), + ('6.99', '526', '2007-02-20T03:19:45.996577', '2932', '2'), + ('4.99', '143', '2007-03-23T20:22:28.996577', '16029', '1'), + ('2.99', '518', '2007-03-18T09:32:30.996577', '12450', '2'), + ('2.99', '250', '2007-04-09T22:15:59.996577', '5479', '1'), + ('2.99', '561', '2007-03-23T17:22:33.996577', '15946', '1'), + ('4.99', '327', '2007-04-07T21:36:48.996577', '4445', '1'), + ('3.99', '70', '2007-03-23T05:35:04.996577', '15616', '1'), + ('2.99', '414', '2007-04-30T15:54:53.996577', '9991', '2'), + ('7.99', '234', '2007-03-02T02:31:39.996577', '10968', '2'), + ('3.99', '89', '2007-03-02T06:25:06.996577', '11090', '1'), + ('0.99', '115', '2007-03-20T17:31:00.996577', '13977', '2'), + ('5.99', '275', '2007-03-18T14:34:57.996577', '12589', '2'), + ('0.99', '486', '2007-04-30T08:49:29.996577', '9142', '2'), + ('5.99', '331', '2007-04-30T18:46:45.996577', '9401', '1'), + ('0.99', '133', '2007-04-30T05:02:07.996577', '9671', '2'), + ('4.99', '535', '2007-04-07T16:50:56.996577', '4331', '1'), + ('4.99', '280', '2007-03-17T19:25:53.996577', '12053', '1'), + ('0.99', '517', '2007-03-18T19:12:40.996577', '12705', '2'), + ('5.99', '291', '2007-04-30T09:52:54.996577', '9165', '1'), + ('2.99', '359', '2007-03-22T10:29:42.996577', '15104', '1'), + ('4.99', '470', '2007-04-12T11:18:45.996577', '6703', '2'), + ('4.99', '87', '2007-02-16T02:40:51.996577', '1580', '2'), + ('2.99', '73', '2007-05-14T13:44:29.996577', '13108', '2'), + ('0.99', '2', '2007-03-02T00:39:22.996577', '10918', '1'), + ('6.99', '25', '2007-02-16T15:41:49.996577', '1754', '2'), + ('2.99', '557', '2007-04-30T16:36:24.996577', '9341', '1'), + ('1.99', '91', '2007-03-23T09:04:11.996577', '15707', '1'), + ('4.99', '469', '2007-03-23T00:34:17.996577', '15487', '1'), + ('7.99', '526', '2007-03-21T15:57:36.996577', '14590', '1'), + ('6.99', '80', '2007-04-29T22:54:48.996577', '8884', '1'), + ('7.99', '13', '2007-03-19T03:00:02.996577', '12918', '2'), + ('2.99', '459', '2007-04-05T22:50:55.996577', '3506', '1'), + ('4.99', '465', '2007-02-17T15:18:11.996577', '2079', '1'), + ('0.99', '185', '2007-03-19T02:05:51.996577', '12885', '1'), + ('4.99', '331', '2007-03-18T12:30:06.996577', '12533', '2'), + ('0.99', '457', '2007-02-16T13:50:13.996577', '1727', '2'), + ('2.99', '24', '2007-03-16T23:26:02.996577', '11546', '2'), + ('0.99', '553', '2007-04-12T09:40:02.996577', '6657', '2'), + ('4.99', '181', '2007-03-19T20:49:15.996577', '13405', '2'), + ('4.99', '526', '2007-03-17T05:47:22.996577', '11702', '2'), + ('4.99', '576', '2007-02-19T17:43:47.996577', '2799', '2'), + ('1.99', '530', '2007-02-15T06:21:01.996577', '1273', '2'), + ('4.99', '279', '2007-03-19T04:24:18.996577', '12949', '1'), + ('7.99', '463', '2007-04-30T18:50:43.996577', '9405', '2'), + ('4.99', '360', '2007-03-16T23:32:57.996577', '11553', '2'), + ('3.99', '584', '2007-02-15T17:04:06.996577', '1436', '2'), + ('3.99', '400', '2007-02-17T04:04:33.996577', '1917', '1'), + ('4.99', '581', '2007-04-07T17:08:22.996577', '4338', '1'), + ('2.99', '158', '2007-04-11T21:57:40.996577', '6416', '1'), + ('4.99', '479', '2007-03-17T11:31:39.996577', '11835', '2'), + ('8.99', '66', '2007-03-23T04:51:52.996577', '15598', '1'), + ('9.99', '181', '2007-04-29T11:31:57.996577', '8601', '1'), + ('2.99', '9', '2007-04-10T06:14:06.996577', '5659', '1'), + ('6.99', '366', '2007-03-22T03:06:44.996577', '14906', '1'), + ('8.99', '575', '2007-03-18T03:33:54.996577', '12289', '2'), + ('2.99', '454', '2007-02-18T16:58:52.996577', '2437', '1'), + ('1.99', '118', '2007-04-30T17:33:01.996577', '10045', '2'), + ('6.99', '273', '2007-03-01T19:07:58.996577', '10768', '1'), + ('4.99', '347', '2007-04-29T03:57:01.996577', '8378', '2'), + ('0.99', '230', '2007-03-20T19:23:58.996577', '14017', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['28884', '28690', '32022', '31322', '30345', '29263', '30328', '31947', '24128', '20450', '21343', '31971', '21647', '19785', '30958', '17794', '21588', '30015', '28819', '26592', '30881', '23241', '20460', '23730', '31987', '24355', '19368', '19377', '20431', '29456', '28931', '18179', '26347', '26226', '24384', '21461', '20468', '22919', '22675', '22608', '29190', '22670', '18320', '31737', '23630', '29680', '23788', '20006', '27443', '24434', '23453', '28530', '27556', '22503', '20279', '20615', '22443', '31285', '28161', '18734', '19952', '18021', '30489', '30351', '21968', '19776', '27847', '31539', '25581', '19585', '22852', '18157', '24069', '30263', '23029', '31893', '23645', '27467', '28942', '24807', '27731', '23272', '30366', '23528', '22456', '23024', '25000', '29764', '29147', '30635', '26762', '31508', '20062', '18255', '23713', '31100', '24423', '20549', '29093', '30624']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('4.99', '597', '2007-04-30T01:44:44.996577', '8948', '2'), + ('4.99', '581', '2007-04-09T23:42:18.996577', '5516', '1'), + ('2.99', '41', '2007-05-14T13:44:29.996577', '15875', '1'), + ('2.99', '213', '2007-04-12T12:15:43.996577', '6725', '2'), + ('1.99', '120', '2007-04-09T13:41:33.996577', '5288', '2'), + ('3.99', '26', '2007-04-08T02:11:48.996577', '4536', '1'), + ('4.99', '118', '2007-04-29T22:50:57.996577', '8881', '1'), + ('4.99', '366', '2007-05-14T13:44:29.996577', '13421', '1'), + ('5.99', '150', '2007-03-20T04:28:29.996577', '13599', '2'), + ('8.99', '368', '2007-03-01T17:50:08.996577', '10730', '2'), + ('7.99', '459', '2007-03-18T16:08:59.996577', '12629', '1'), + ('4.99', '472', '2007-05-14T13:44:29.996577', '14928', '2'), + ('2.99', '490', '2007-03-17T16:08:11.996577', '11965', '2'), + ('4.99', '294', '2007-03-17T12:45:14.996577', '11875', '2'), + ('5.99', '172', '2007-04-30T11:43:01.996577', '9218', '2'), + ('4.99', '416', '2007-02-15T10:55:45.996577', '1343', '1'), + ('6.99', '483', '2007-03-02T01:57:04.996577', '10953', '1'), + ('0.99', '91', '2007-04-27T23:40:51.996577', '7637', '2'), + ('0.99', '592', '2007-04-26T21:44:16.996577', '6937', '1'), + ('0.99', '392', '2007-04-11T02:34:51.996577', '6061', '2'), + ('8.99', '166', '2007-04-30T03:40:27.996577', '9009', '1'), + ('8.99', '58', '2007-03-18T03:37:20.996577', '12292', '2'), + ('7.99', '368', '2007-03-21T08:51:17.996577', '14393', '1'), + ('2.99', '113', '2007-03-23T11:46:42.996577', '15770', '1'), + ('2.99', '530', '2007-05-14T13:44:29.996577', '13561', '1'), + ('1.99', '174', '2007-03-23T15:29:26.996577', '15892', '1'), + ('8.99', '232', '2007-02-19T20:03:20.996577', '2833', '1'), + ('4.99', '234', '2007-02-17T10:13:20.996577', '2005', '1'), + ('5.99', '366', '2007-03-02T15:34:09.996577', '11340', '2'), + ('6.99', '41', '2007-04-28T13:54:21.996577', '8008', '2'), + ('4.99', '204', '2007-04-08T22:53:00.996577', '4979', '1'), + ('4.99', '517', '2007-02-16T08:03:11.996577', '1653', '2'), + ('0.99', '369', '2007-04-30T00:12:00.996577', '9543', '2'), + ('2.99', '360', '2007-04-27T09:13:21.996577', '7251', '1'), + ('4.99', '177', '2007-03-18T16:02:45.996577', '12623', '1'), + ('9.99', '469', '2007-03-23T03:30:57.996577', '15561', '1'), + ('0.99', '369', '2007-03-18T12:11:33.996577', '12521', '1'), + ('0.99', '24', '2007-03-19T15:14:25.996577', '13247', '1'), + ('2.99', '207', '2007-03-20T06:27:39.996577', '13655', '2'), + ('6.99', '597', '2007-03-19T11:37:58.996577', '13152', '1'), + ('4.99', '18', '2007-04-30T04:47:04.996577', '9036', '1'), + ('2.99', '207', '2007-03-02T06:53:40.996577', '11112', '1'), + ('4.99', '560', '2007-02-15T06:00:50.996577', '1271', '1'), + ('2.99', '250', '2007-04-10T23:49:12.996577', '5998', '1'), + ('1.99', '101', '2007-03-19T19:48:37.996577', '13370', '2'), + ('4.99', '63', '2007-04-10T15:03:14.996577', '5832', '2'), + ('4.99', '119', '2007-03-22T10:50:09.996577', '15111', '1'), + ('4.99', '319', '2007-03-17T18:13:12.996577', '12018', '1'), + ('5.99', '470', '2007-04-06T11:29:29.996577', '3764', '1'), + ('2.99', '181', '2007-03-22T14:39:58.996577', '15196', '2'), + ('4.99', '80', '2007-03-19T19:20:06.996577', '13352', '1'), + ('0.99', '568', '2007-04-28T20:52:15.996577', '8185', '2'), + ('7.99', '479', '2007-04-30T07:52:09.996577', '9754', '2'), + ('1.99', '584', '2007-03-22T04:06:58.996577', '14930', '1'), + ('0.99', '348', '2007-03-23T13:28:17.996577', '15817', '2'), + ('4.99', '383', '2007-03-20T20:08:09.996577', '14039', '2'), + ('4.99', '577', '2007-03-23T19:15:54.996577', '16003', '2'), + ('3.99', '210', '2007-04-08T23:15:22.996577', '4989', '1'), + ('7.99', '532', '2007-04-11T18:33:44.996577', '6345', '2'), + ('7.99', '57', '2007-02-20T01:59:44.996577', '2910', '2'), + ('2.99', '312', '2007-03-18T00:12:02.996577', '12186', '1'), + ('4.99', '472', '2007-02-20T07:39:09.996577', '2991', '1'), + ('2.99', '132', '2007-04-09T17:57:00.996577', '5391', '1'), + ('6.99', '120', '2007-04-30T13:08:16.996577', '9907', '2'), + ('8.99', '526', '2007-03-20T05:03:56.996577', '13617', '1'), + ('4.99', '293', '2007-03-22T16:51:10.996577', '15258', '1'), + ('9.99', '504', '2007-04-29T04:30:37.996577', '8393', '1'), + ('2.99', '233', '2007-04-06T14:40:49.996577', '3832', '1'), + ('4.99', '303', '2007-04-11T23:45:06.996577', '6464', '1'), + ('2.99', '273', '2007-03-22T03:20:08.996577', '14911', '2'), + ('4.99', '18', '2007-03-02T18:51:11.996577', '11439', '2'), + ('2.99', '512', '2007-02-18T12:05:58.996577', '2364', '1'), + ('4.99', '146', '2007-03-17T12:16:56.996577', '11857', '1'), + ('2.99', '113', '2007-04-07T17:00:16.996577', '4333', '1'), + ('2.99', '36', '2007-03-01T10:21:43.996577', '10525', '2'), + ('7.99', '265', '2007-04-09T01:03:58.996577', '5029', '2'), + ('8.99', '103', '2007-03-22T21:41:36.996577', '15401', '2'), + ('0.99', '471', '2007-04-30T22:30:36.996577', '9502', '1'), + ('4.99', '204', '2007-04-30T13:06:38.996577', '9906', '2'), + ('7.99', '230', '2007-03-18T12:14:07.996577', '12523', '2'), + ('7.99', '494', '2007-04-30T14:05:55.996577', '9943', '2'), + ('0.99', '61', '2007-03-19T22:46:41.996577', '13450', '1'), + ('6.99', '122', '2007-04-09T11:22:51.996577', '5235', '2'), + ('2.99', '87', '2007-03-23T15:00:36.996577', '15876', '1'), + ('2.99', '579', '2007-03-21T14:42:13.996577', '14560', '2'), + ('4.99', '35', '2007-03-17T19:30:45.996577', '12055', '1'), + ('0.99', '252', '2007-03-17T08:20:20.996577', '11764', '2'), + ('7.99', '70', '2007-04-27T15:38:31.996577', '7421', '2'), + ('7.99', '14', '2007-04-10T01:58:14.996577', '5565', '1'), + ('3.99', '144', '2007-04-30T07:12:47.996577', '9098', '1'), + ('5.99', '407', '2007-04-27T13:26:55.996577', '7363', '1'), + ('4.99', '230', '2007-04-28T14:45:26.996577', '8032', '2'), + ('4.99', '327', '2007-03-02T16:39:16.996577', '11372', '1'), + ('0.99', '539', '2007-02-15T09:40:05.996577', '1327', '1'), + ('3.99', '112', '2007-03-17T12:24:27.996577', '11863', '2'), + ('1.99', '185', '2007-04-11T22:04:53.996577', '6418', '1'), + ('4.99', '181', '2007-03-01T18:29:50.996577', '10748', '1'), + ('3.99', '377', '2007-03-01T18:07:34.996577', '10738', '1'), + ('4.99', '9', '2007-04-30T05:02:33.996577', '9043', '1'), + ('7.99', '144', '2007-04-09T18:45:17.996577', '5408', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['29082', '28733', '21270', '23689', '20198', '30833', '29252', '28639', '24985', '28656', '30271', '18754', '27182', '18407', '27663', '18083', '31239', '28554', '21573', '27579', '19784', '29380', '18079', '21275', '22546', '21899', '22748', '24960', '23290', '28825', '20919', '30170', '29638', '21412', '21193', '18304', '23641', '19199', '21324', '27846', '21486', '25286', '19639', '31536', '22075', '26861', '27286', '30172', '22428', '24319', '25677', '25884', '30396', '17770', '25847', '25755', '31553', '22870', '19039', '27557', '23269', '27843', '26338', '23748', '29090', '18886', '24839', '29081', '20603', '28454', '28944', '21634', '26667', '25302', '21209', '22700', '30016', '28133', '27774', '19544', '23729', '22894', '29799', '25281', '23931', '29826', '27303', '25114', '26092', '32032', '29543', '30589', '22091', '25367', '18091', '29586', '31981', '21472', '29237', '21478']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('1.99', '8', '2007-04-29T20:11:15.996577', '8809', '1'), + ('9.99', '585', '2007-04-08T09:09:32.996577', '4684', '1'), + ('2.99', '451', '2007-03-20T08:00:49.996577', '13705', '1'), + ('2.99', '108', '2007-03-23T19:14:19.996577', '16001', '1'), + ('2.99', '340', '2007-03-22T18:15:02.996577', '15306', '2'), + ('7.99', '162', '2007-04-30T07:05:33.996577', '9726', '1'), + ('2.99', '25', '2007-04-29T14:09:23.996577', '8667', '2'), + ('5.99', '577', '2007-04-28T15:14:10.996577', '8043', '1'), + ('5.99', '250', '2007-03-21T15:49:21.996577', '14587', '1'), + ('4.99', '579', '2007-04-11T16:30:42.996577', '6304', '1'), + ('2.99', '113', '2007-04-27T21:51:29.996577', '7587', '2'), + ('7.99', '65', '2007-02-17T22:36:46.996577', '2173', '1'), + ('1.99', '444', '2007-04-30T03:34:28.996577', '9634', '2'), + ('4.99', '583', '2007-02-19T09:22:26.996577', '2663', '2'), + ('2.99', '488', '2007-04-28T13:43:37.996577', '8005', '1'), + ('4.99', '491', '2007-02-20T10:21:15.996577', '3031', '2'), + ('0.99', '199', '2007-04-29T15:54:20.996577', '8709', '1'), + ('2.99', '570', '2007-04-30T21:53:50.996577', '10168', '2'), + ('4.99', '481', '2007-03-21T05:08:24.996577', '14280', '2'), + ('4.99', '482', '2007-04-08T13:56:46.996577', '4768', '1'), + ('2.99', '294', '2007-03-02T17:07:42.996577', '11390', '1'), + ('4.99', '35', '2007-04-12T04:25:04.996577', '6572', '1'), + ('4.99', '491', '2007-02-15T13:06:41.996577', '1371', '1'), + ('0.99', '452', '2007-03-18T06:04:49.996577', '12355', '1'), + ('0.99', '589', '2007-03-23T18:56:58.996577', '15992', '2'), + ('6.99', '518', '2007-03-20T02:08:53.996577', '13539', '1'), + ('4.99', '7', '2007-03-01T14:20:26.996577', '10644', '2'), + ('6.99', '247', '2007-03-01T06:21:55.996577', '10410', '1'), + ('0.99', '63', '2007-03-19T09:07:22.996577', '13089', '1'), + ('4.99', '592', '2007-04-30T13:30:56.996577', '9268', '1'), + ('0.99', '414', '2007-03-23T00:27:40.996577', '15481', '2'), + ('6.99', '104', '2007-04-07T21:24:43.996577', '4438', '2'), + ('4.99', '58', '2007-04-07T06:21:44.996577', '4131', '2'), + ('4.99', '465', '2007-03-23T14:36:41.996577', '15859', '2'), + ('2.99', '444', '2007-03-19T04:22:00.996577', '12946', '2'), + ('5.99', '556', '2007-02-19T04:08:37.996577', '2593', '2'), + ('7.99', '103', '2007-03-19T04:09:02.996577', '12942', '2'), + ('3.99', '182', '2007-02-15T23:48:31.996577', '1542', '2'), + ('0.99', '457', '2007-03-19T09:04:37.996577', '13088', '1'), + ('4.99', '504', '2007-04-28T11:19:48.996577', '7944', '2'), + ('6.99', '472', '2007-03-01T01:57:36.996577', '10282', '1'), + ('0.99', '280', '2007-04-28T09:40:38.996577', '7901', '2'), + ('4.99', '277', '2007-03-20T08:09:35.996577', '13714', '1'), + ('10.99', '232', '2007-04-30T16:12:50.996577', '9330', '2'), + ('4.99', '537', '2007-03-19T05:35:17.996577', '12984', '2'), + ('2.99', '416', '2007-04-28T10:25:23.996577', '7917', '1'), + ('3.99', '454', '2007-04-30T16:22:17.996577', '10005', '1'), + ('7.99', '104', '2007-04-08T01:54:46.996577', '4529', '1'), + ('4.99', '576', '2007-03-19T18:21:18.996577', '13326', '1'), + ('4.99', '171', '2007-03-01T13:40:26.996577', '10622', '2'), + ('1.99', '312', '2007-04-06T12:55:04.996577', '3792', '1'), + ('4.99', '331', '2007-04-07T02:05:54.996577', '4051', '1'), + ('2.99', '125', '2007-04-09T09:20:35.996577', '5200', '1'), + ('0.99', '407', '2007-02-19T04:22:12.996577', '2597', '2'), + ('2.99', '327', '2007-04-12T07:10:08.996577', '6618', '1'), + ('2.99', '319', '2007-04-11T06:53:10.996577', '6132', '2'), + ('7.99', '234', '2007-04-08T11:07:57.996577', '4721', '1'), + ('4.99', '20', '2007-03-19T10:54:58.996577', '13137', '1'), + ('7.99', '139', '2007-02-19T13:18:08.996577', '2718', '2'), + ('7.99', '480', '2007-04-05T22:52:09.996577', '3507', '2'), + ('0.99', '61', '2007-03-01T11:15:05.996577', '10549', '2'), + ('2.99', '504', '2007-04-27T21:06:31.996577', '7567', '1'), + ('2.99', '369', '2007-04-06T17:55:58.996577', '3903', '2'), + ('0.99', '115', '2007-03-22T23:25:38.996577', '15452', '2'), + ('5.99', '9', '2007-04-11T08:45:55.996577', '6165', '1'), + ('4.99', '98', '2007-02-18T01:05:13.996577', '2213', '1'), + ('4.99', '234', '2007-03-02T04:45:42.996577', '11050', '1'), + ('0.99', '8', '2007-04-12T09:12:19.996577', '6647', '1'), + ('0.99', '382', '2007-03-18T01:36:49.996577', '12229', '2'), + ('6.99', '562', '2007-04-11T02:54:17.996577', '6065', '2'), + ('7.99', '205', '2007-04-06T03:48:51.996577', '3601', '1'), + ('2.99', '488', '2007-03-23T01:05:45.996577', '15499', '2'), + ('4.99', '399', '2007-04-12T10:20:20.996577', '6674', '2'), + ('2.99', '282', '2007-04-06T07:37:45.996577', '3675', '2'), + ('6.99', '445', '2007-03-22T01:40:01.996577', '14866', '1'), + ('4.99', '2', '2007-03-22T12:21:30.996577', '15145', '2'), + ('4.99', '91', '2007-04-28T12:22:20.996577', '7966', '1'), + ('3.99', '530', '2007-04-27T01:30:33.996577', '7031', '1'), + ('6.99', '498', '2007-04-27T10:52:15.996577', '7286', '1'), + ('5.99', '269', '2007-03-19T11:10:54.996577', '13142', '2'), + ('1.99', '113', '2007-03-23T04:59:50.996577', '15600', '1'), + ('5.99', '22', '2007-03-17T18:23:20.996577', '12023', '1'), + ('9.99', '73', '2007-04-12T02:16:10.996577', '6514', '1'), + ('5.99', '279', '2007-04-30T10:15:23.996577', '9820', '2'), + ('0.99', '133', '2007-03-22T09:40:17.996577', '15080', '2'), + ('2.99', '75', '2007-04-27T02:05:04.996577', '7052', '1'), + ('5.99', '457', '2007-04-08T05:17:03.996577', '4600', '2'), + ('4.99', '262', '2007-03-23T06:33:06.996577', '15640', '1'), + ('2.99', '348', '2007-04-12T14:30:35.996577', '6776', '2'), + ('0.99', '58', '2007-05-14T13:44:29.996577', '15326', '2'), + ('4.99', '49', '2007-04-12T13:43:14.996577', '6759', '2'), + ('0.99', '140', '2007-04-30T18:50:01.996577', '9404', '1'), + ('3.99', '539', '2007-03-02T00:43:06.996577', '10922', '2'), + ('2.99', '286', '2007-04-27T09:17:16.996577', '7254', '1'), + ('0.99', '493', '2007-02-19T03:09:10.996577', '2579', '1'), + ('4.99', '52', '2007-04-27T23:25:13.996577', '7627', '2'), + ('0.99', '512', '2007-05-14T13:44:29.996577', '12786', '1'), + ('4.99', '470', '2007-03-20T04:19:01.996577', '13592', '1'), + ('7.99', '24', '2007-04-06T06:01:08.996577', '3649', '2'), + ('5.99', '471', '2007-03-20T06:34:25.996577', '13661', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['31988', '27679', '26082', '22545', '25602', '17789', '30613', '29880', '26769', '30070', '20436', '25833', '19684', '28237', '29958', '18447', '24323', '30130', '21569', '20453', '24984', '20030', '28742', '24636', '25182', '28933', '19664', '22851', '23562', '21536', '19635', '22264', '27756', '28640', '25142', '25179', '32050', '26091', '24824', '28700', '18623', '29018', '27979', '26615', '23320', '17966', '26095', '22575', '18007', '19364', '22562', '22253', '24511', '28636', '18522', '29720', '29166', '29711', '31890', '22640', '29510', '19014', '17928', '24034', '30157', '19917', '22931', '27259', '27382', '28373', '20197', '26930', '28362', '30391', '18978', '28943', '22478', '27431', '17581', '23186', '19606', '21284', '28328', '26438', '24827', '27770', '28610', '29547', '31900', '26439', '21915', '30601', '25307', '24598', '27460', '20936', '21428', '29724', '27465', '20617']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('0.99', '532', '2007-05-14T13:44:29.996577', '14616', '1'), + ('0.99', '490', '2007-04-09T22:35:29.996577', '5489', '2'), + ('3.99', '347', '2007-04-30T11:29:01.996577', '9856', '1'), + ('5.99', '589', '2007-03-23T16:25:54.996577', '15917', '2'), + ('0.99', '305', '2007-04-09T01:47:17.996577', '5041', '2'), + ('9.99', '414', '2007-02-19T01:38:12.996577', '2559', '1'), + ('7.99', '143', '2007-04-08T04:40:24.996577', '4585', '1'), + ('4.99', '80', '2007-04-06T04:33:49.996577', '3623', '2'), + ('3.99', '408', '2007-04-07T16:38:07.996577', '4330', '2'), + ('4.99', '96', '2007-04-30T17:08:41.996577', '10031', '2'), + ('4.99', '366', '2007-03-21T00:42:29.996577', '14147', '1'), + ('0.99', '326', '2007-04-06T17:12:50.996577', '3886', '2'), + ('2.99', '282', '2007-03-02T11:15:56.996577', '11226', '2'), + ('2.99', '539', '2007-04-07T01:13:28.996577', '4035', '1'), + ('0.99', '87', '2007-04-30T05:49:02.996577', '9060', '2'), + ('4.99', '593', '2007-02-18T00:43:00.996577', '2205', '2'), + ('0.99', '171', '2007-03-19T17:03:58.996577', '13292', '2'), + ('4.99', '101', '2007-04-29T21:08:02.996577', '8833', '2'), + ('4.99', '481', '2007-03-19T05:32:26.996577', '12981', '1'), + ('2.99', '368', '2007-03-18T04:55:11.996577', '12319', '2'), + ('4.99', '250', '2007-03-21T14:53:11.996577', '14565', '2'), + ('3.99', '323', '2007-03-02T03:15:19.996577', '10994', '1'), + ('3.99', '585', '2007-04-30T01:45:42.996577', '9590', '1'), + ('4.99', '210', '2007-03-19T01:51:21.996577', '12879', '1'), + ('4.99', '269', '2007-04-12T15:50:32.996577', '6804', '2'), + ('2.99', '204', '2007-04-10T03:57:59.996577', '5619', '1'), + ('2.99', '279', '2007-03-21T02:27:52.996577', '14206', '2'), + ('4.99', '18', '2007-03-02T06:31:28.996577', '11094', '2'), + ('4.99', '91', '2007-03-22T19:24:57.996577', '15341', '1'), + ('0.99', '477', '2007-03-02T00:28:29.996577', '10912', '2'), + ('3.99', '277', '2007-03-17T22:42:17.996577', '12149', '2'), + ('0.99', '559', '2007-03-01T23:00:24.996577', '10876', '2'), + ('4.99', '497', '2007-04-09T01:04:09.996577', '5030', '1'), + ('6.99', '577', '2007-04-28T15:38:28.996577', '8060', '1'), + ('6.99', '265', '2007-03-21T14:20:04.996577', '14547', '1'), + ('6.99', '269', '2007-04-08T18:04:43.996577', '4880', '2'), + ('0.00', '107', '2007-05-14T13:44:29.996577', '15497', '1'), + ('0.99', '348', '2007-04-10T22:20:18.996577', '5965', '2'), + ('0.99', '232', '2007-03-17T12:22:13.996577', '11861', '2'), + ('6.99', '582', '2007-04-27T11:31:20.996577', '7311', '2'), + ('4.99', '30', '2007-02-17T21:28:08.996577', '2154', '2'), + ('2.99', '2', '2007-04-30T20:27:22.996577', '10136', '1'), + ('4.99', '517', '2007-04-30T17:53:39.996577', '10063', '1'), + ('6.99', '394', '2007-04-07T15:49:05.996577', '4307', '1'), + ('2.99', '66', '2007-03-21T07:32:46.996577', '14351', '2'), + ('2.99', '457', '2007-02-20T21:26:10.996577', '3184', '2'), + ('4.99', '348', '2007-04-28T07:03:23.996577', '7825', '2'), + ('0.99', '593', '2007-03-21T18:04:25.996577', '14653', '1'), + ('0.99', '469', '2007-02-15T14:58:17.996577', '1399', '2'), + ('0.99', '230', '2007-02-19T10:20:41.996577', '2675', '2'), + ('8.99', '592', '2007-03-02T17:57:27.996577', '11410', '1'), + ('0.99', '557', '2007-03-23T16:17:52.996577', '15914', '2'), + ('9.99', '190', '2007-03-17T15:41:42.996577', '11950', '2'), + ('0.99', '577', '2007-04-27T07:17:58.996577', '7197', '2'), + ('0.99', '7', '2007-02-16T19:34:26.996577', '1810', '2'), + ('2.99', '66', '2007-04-06T11:10:52.996577', '3757', '2'), + ('3.99', '16', '2007-04-07T12:53:10.996577', '4263', '2'), + ('4.99', '65', '2007-04-07T12:01:38.996577', '4240', '1'), + ('2.99', '265', '2007-04-06T14:09:53.996577', '3823', '1'), + ('5.99', '204', '2007-03-01T05:42:05.996577', '10399', '2'), + ('3.99', '45', '2007-04-28T12:15:47.996577', '7961', '1'), + ('2.99', '132', '2007-02-19T05:39:02.996577', '2608', '2'), + ('5.99', '452', '2007-02-15T21:21:29.996577', '1512', '1'), + ('2.99', '143', '2007-03-18T08:09:04.996577', '12408', '1'), + ('2.99', '103', '2007-04-07T10:22:15.996577', '4213', '1'), + ('4.99', '308', '2007-03-01T21:21:23.996577', '10819', '1'), + ('3.99', '26', '2007-03-02T03:16:37.996577', '10996', '1'), + ('0.99', '452', '2007-04-08T11:03:00.996577', '4720', '1'), + ('4.99', '464', '2007-04-06T11:21:10.996577', '3761', '1'), + ('4.99', '553', '2007-04-28T09:12:06.996577', '7890', '1'), + ('2.99', '340', '2007-03-22T02:47:49.996577', '14895', '1'), + ('1.99', '423', '2007-04-12T01:56:48.996577', '6506', '1'), + ('2.99', '553', '2007-04-06T15:46:41.996577', '3859', '2'), + ('6.99', '124', '2007-04-27T19:30:07.996577', '7519', '1'), + ('4.99', '122', '2007-02-18T19:39:10.996577', '2482', '1'), + ('2.99', '204', '2007-04-30T17:29:51.996577', '10042', '2'), + ('5.99', '582', '2007-03-17T04:15:21.996577', '11667', '1'), + ('6.99', '469', '2007-04-10T06:33:07.996577', '5664', '2'), + ('3.99', '360', '2007-02-19T00:36:36.996577', '2541', '2'), + ('5.99', '52', '2007-03-21T23:49:40.996577', '14822', '1'), + ('4.99', '275', '2007-03-17T02:12:03.996577', '11610', '1'), + ('4.99', '453', '2007-03-20T10:40:12.996577', '13785', '1'), + ('4.99', '549', '2007-04-29T02:07:15.996577', '8316', '1'), + ('10.99', '377', '2007-04-28T14:05:14.996577', '8018', '2'), + ('0.99', '232', '2007-03-21T13:36:08.996577', '14527', '2'), + ('0.99', '498', '2007-04-10T18:00:04.996577', '5884', '2'), + ('2.99', '575', '2007-04-27T05:20:47.996577', '7139', '1'), + ('0.99', '49', '2007-04-30T03:34:58.996577', '9006', '2'), + ('1.99', '265', '2007-04-27T15:14:33.996577', '7414', '2'), + ('4.99', '377', '2007-04-30T00:10:47.996577', '8916', '2'), + ('0.99', '520', '2007-03-19T17:35:35.996577', '13311', '1'), + ('2.99', '142', '2007-04-05T22:13:03.996577', '3492', '2'), + ('8.99', '282', '2007-04-09T14:46:10.996577', '5319', '2'), + ('4.99', '199', '2007-03-21T06:33:06.996577', '14320', '2'), + ('0.99', '471', '2007-04-06T18:47:55.996577', '3917', '1'), + ('4.99', '416', '2007-03-19T03:45:56.996577', '12932', '1'), + ('2.99', '467', '2007-03-18T16:46:34.996577', '12641', '1'), + ('5.99', '66', '2007-04-08T19:48:52.996577', '4911', '2'), + ('0.99', '471', '2007-04-28T21:38:51.996577', '8199', '1'), + ('1.99', '383', '2007-03-22T22:19:49.996577', '15416', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['17667', '30173', '28629', '24723', '26962', '28635', '23486', '24805', '25681', '30878', '20772', '21632', '24811', '26433', '28935', '28695', '26212', '22746', '21561', '25875', '22357', '21648', '24802', '30233', '22567', '22005', '25872', '21493', '21325', '21278', '22739', '30009', '28008', '30408', '18624', '19579', '25291', '19346', '18319', '22336', '21944', '29134', '18200', '17717', '24044', '23802', '22027', '29199', '31542', '24339', '17889', '19783', '20828', '28686', '22769', '22778', '28367', '17965', '22276', '22728', '19714', '23322', '28427', '18844', '26906', '26904', '20941', '28084', '30291', '22521', '30619', '21965', '21655', '25221', '30214', '29258', '22335', '28648', '23652', '25468', '26227', '19362', '23700', '22939', '31218', '18657', '26760', '20065', '29203', '22328', '21457', '31526', '26772', '19153', '28892', '23451', '28424', '30638', '23055', '20847']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('2.99', '382', '2007-02-18T22:25:10.996577', '2514', '1'), + ('2.99', '104', '2007-04-08T20:00:56.996577', '4917', '1'), + ('2.99', '576', '2007-04-30T16:09:31.996577', '10000', '1'), + ('4.99', '219', '2007-03-20T10:07:26.996577', '13765', '1'), + ('7.99', '425', '2007-04-08T21:03:56.996577', '4939', '1'), + ('2.99', '577', '2007-04-12T03:08:09.996577', '6534', '2'), + ('4.99', '83', '2007-03-23T01:01:53.996577', '15498', '2'), + ('2.99', '230', '2007-03-17T14:33:08.996577', '11914', '2'), + ('2.99', '312', '2007-04-12T18:32:10.996577', '6866', '1'), + ('2.99', '166', '2007-04-12T19:19:05.996577', '6882', '2'), + ('2.99', '400', '2007-03-16T22:57:26.996577', '11530', '2'), + ('0.99', '488', '2007-03-22T16:51:49.996577', '15259', '2'), + ('2.99', '230', '2007-03-21T07:06:47.996577', '14340', '1'), + ('0.99', '377', '2007-04-07T02:07:48.996577', '4053', '2'), + ('2.99', '204', '2007-04-11T12:13:40.996577', '6225', '2'), + ('2.99', '581', '2007-04-30T13:43:45.996577', '9278', '1'), + ('2.99', '359', '2007-04-12T03:22:15.996577', '6542', '1'), + ('5.99', '7', '2007-03-01T06:48:19.996577', '10423', '1'), + ('4.99', '480', '2007-03-20T12:28:01.996577', '13831', '1'), + ('0.99', '330', '2007-04-12T09:38:13.996577', '6656', '1'), + ('4.99', '568', '2007-03-20T13:57:19.996577', '13883', '1'), + ('4.99', '490', '2007-03-21T14:33:37.996577', '14557', '2'), + ('2.99', '230', '2007-03-01T22:59:26.996577', '10874', '2'), + ('0.99', '109', '2007-04-30T12:08:08.996577', '9230', '1'), + ('3.99', '592', '2007-03-20T06:40:24.996577', '13662', '2'), + ('4.99', '530', '2007-03-18T01:18:28.996577', '12220', '1'), + ('1.99', '330', '2007-04-07T05:48:20.996577', '4124', '1'), + ('4.99', '472', '2007-03-21T16:08:07.996577', '14597', '1'), + ('2.99', '457', '2007-03-19T11:36:45.996577', '13150', '1'), + ('3.99', '452', '2007-03-20T06:10:43.996577', '13642', '1'), + ('2.99', '6', '2007-03-18T02:33:55.996577', '12254', '2'), + ('1.99', '91', '2007-04-09T08:48:17.996577', '5187', '2'), + ('2.99', '520', '2007-04-07T17:27:11.996577', '4346', '2'), + ('0.99', '125', '2007-04-30T22:37:33.996577', '9504', '2'), + ('2.99', '30', '2007-02-19T13:38:35.996577', '2730', '2'), + ('4.99', '273', '2007-03-16T21:58:19.996577', '11509', '2'), + ('3.99', '280', '2007-04-29T17:26:50.996577', '8744', '2'), + ('2.99', '226', '2007-02-21T15:27:16.996577', '3414', '2'), + ('1.99', '559', '2007-02-21T11:55:27.996577', '3370', '1'), + ('2.99', '566', '2007-03-01T01:20:31.996577', '10259', '2'), + ('1.99', '523', '2007-03-01T08:20:52.996577', '10470', '2'), + ('2.99', '13', '2007-04-28T10:18:19.996577', '7916', '1'), + ('7.99', '523', '2007-02-19T03:30:06.996577', '2583', '1'), + ('4.99', '392', '2007-02-20T00:29:11.996577', '2890', '2'), + ('7.99', '144', '2007-03-16T23:03:53.996577', '11534', '1'), + ('6.99', '120', '2007-03-22T05:17:41.996577', '14969', '2'), + ('8.99', '532', '2007-03-19T12:58:32.996577', '13192', '1'), + ('2.99', '20', '2007-04-07T20:08:11.996577', '4407', '1'), + ('5.99', '233', '2007-04-09T12:49:36.996577', '5267', '2'), + ('3.99', '172', '2007-03-23T15:56:29.996577', '15902', '1'), + ('0.99', '444', '2007-02-15T03:21:27.996577', '1239', '1'), + ('2.99', '294', '2007-03-02T05:39:19.996577', '11071', '2'), + ('2.99', '405', '2007-03-22T20:59:46.996577', '15383', '2'), + ('0.99', '581', '2007-04-08T06:13:15.996577', '4613', '2'), + ('2.99', '9', '2007-03-18T01:36:36.996577', '12228', '1'), + ('4.99', '10', '2007-03-19T17:51:56.996577', '13316', '2'), + ('0.99', '553', '2007-04-08T08:27:20.996577', '4662', '2'), + ('2.99', '457', '2007-02-20T16:27:31.996577', '3115', '2'), + ('7.99', '560', '2007-03-01T17:56:27.996577', '10733', '1'), + ('0.99', '5', '2007-03-20T13:44:44.996577', '13877', '2'), + ('0.99', '286', '2007-03-18T17:27:01.996577', '12656', '1'), + ('4.99', '66', '2007-03-22T07:30:18.996577', '15026', '2'), + ('0.99', '559', '2007-04-30T08:28:47.996577', '9134', '2'), + ('9.99', '87', '2007-02-20T16:54:23.996577', '3122', '2'), + ('0.99', '420', '2007-04-30T17:12:42.996577', '9362', '1'), + ('2.99', '420', '2007-04-27T02:54:25.996577', '7081', '2'), + ('0.99', '416', '2007-03-23T11:24:17.996577', '15761', '2'), + ('2.99', '526', '2007-04-12T09:25:36.996577', '6650', '2'), + ('1.99', '115', '2007-04-08T14:35:17.996577', '4780', '1'), + ('2.99', '587', '2007-03-01T21:33:59.996577', '10825', '1'), + ('0.99', '143', '2007-04-30T19:44:57.996577', '10118', '1'), + ('0.99', '526', '2007-03-18T15:32:15.996577', '12607', '1'), + ('4.99', '491', '2007-03-17T11:37:27.996577', '11840', '1'), + ('3.99', '273', '2007-04-30T05:40:16.996577', '9693', '2'), + ('0.99', '108', '2007-04-06T16:44:05.996577', '3875', '1'), + ('2.99', '26', '2007-04-07T03:00:54.996577', '4065', '1'), + ('2.99', '565', '2007-03-23T15:19:09.996577', '15885', '1'), + ('5.99', '578', '2007-04-27T02:19:28.996577', '7059', '2'), + ('3.99', '104', '2007-03-18T09:45:33.996577', '12453', '1'), + ('2.99', '294', '2007-04-30T10:57:11.996577', '9194', '2'), + ('9.99', '360', '2007-04-27T21:51:57.996577', '7588', '2'), + ('0.99', '230', '2007-02-16T18:35:53.996577', '1793', '2'), + ('4.99', '111', '2007-03-01T12:58:49.996577', '10602', '2'), + ('7.99', '26', '2007-03-21T18:40:56.996577', '14677', '1'), + ('0.99', '198', '2007-04-08T12:35:29.996577', '4750', '2'), + ('1.99', '38', '2007-02-19T05:16:27.996577', '2605', '2'), + ('9.99', '407', '2007-04-10T02:51:37.996577', '5590', '2'), + ('2.99', '327', '2007-03-19T11:46:36.996577', '13158', '2'), + ('4.99', '20', '2007-04-27T08:00:10.996577', '7217', '2'), + ('3.99', '565', '2007-03-17T00:54:49.996577', '11588', '1'), + ('2.99', '469', '2007-03-20T10:06:22.996577', '13763', '1'), + ('2.99', '232', '2007-04-11T16:41:50.996577', '6309', '1'), + ('4.99', '408', '2007-04-11T10:57:23.996577', '6203', '2'), + ('5.99', '171', '2007-02-19T04:34:33.996577', '2599', '2'), + ('4.99', '598', '2007-04-12T02:29:02.996577', '6519', '1'), + ('1.99', '80', '2007-03-17T11:58:41.996577', '11850', '1'), + ('1.99', '559', '2007-04-27T06:20:05.996577', '7169', '1'), + ('5.99', '145', '2007-04-06T05:57:43.996577', '3647', '1'), + ('4.99', '38', '2007-03-17T10:48:27.996577', '11817', '1'), + ('0.99', '407', '2007-03-22T18:46:15.996577', '15320', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['25836', '31331', '28501', '25441', '30946', '27231', '29417', '20773', '17611', '18577', '21580', '29818', '26692', '18445', '29590', '31892', '26310', '21677', '21271', '23719', '18462', '30205', '20103', '29925', '26501', '21356', '22762', '21539', '28643', '18519', '24412', '23168', '26339', '27984', '31373', '23542', '31451', '24846', '22065', '19924', '20188', '22613', '24593', '29800', '31919', '21658', '31386', '20824', '25870', '24249', '19736', '29005', '28687', '29269', '21652', '21633', '31525', '18913', '27954', '25366', '17580', '25237', '27238', '31759', '27957', '28500', '26619', '28889', '31063', '23557', '27637', '22269', '31321', '32083', '21972', '24071', '20858', '19672', '23350', '19916', '28611', '22857', '28890', '28945', '27331', '18736', '28330', '30123', '25452', '25375', '21873', '31891', '27390', '21704', '19079', '28688', '28156', '22610', '31895', '18310']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('2.99', '326', '2007-04-27T04:17:02.996577', '7117', '1'), + ('3.99', '214', '2007-04-08T23:03:57.996577', '4984', '2'), + ('2.99', '566', '2007-04-28T01:25:03.996577', '7677', '1'), + ('6.99', '292', '2007-04-12T20:13:51.996577', '6900', '1'), + ('4.99', '172', '2007-04-08T15:56:34.996577', '4821', '1'), + ('0.99', '449', '2007-04-05T22:45:50.996577', '3503', '1'), + ('0.99', '38', '2007-04-28T05:56:42.996577', '7795', '1'), + ('5.99', '400', '2007-03-17T01:40:30.996577', '11600', '1'), + ('9.99', '368', '2007-02-15T21:21:56.996577', '1513', '1'), + ('2.99', '22', '2007-02-21T15:46:27.996577', '3419', '1'), + ('0.99', '482', '2007-03-21T20:50:55.996577', '14732', '2'), + ('0.99', '75', '2007-04-08T01:04:47.996577', '4511', '2'), + ('3.99', '402', '2007-04-06T04:05:52.996577', '3612', '2'), + ('7.99', '592', '2007-02-20T19:36:45.996577', '3158', '1'), + ('4.99', '52', '2007-04-30T09:22:10.996577', '9797', '2'), + ('2.99', '265', '2007-04-08T15:07:31.996577', '4797', '1'), + ('1.99', '366', '2007-04-28T23:39:26.996577', '8260', '2'), + ('3.99', '494', '2007-03-19T17:21:41.996577', '13301', '2'), + ('0.99', '451', '2007-03-21T12:39:56.996577', '14500', '2'), + ('0.99', '112', '2007-03-23T07:36:42.996577', '15671', '1'), + ('1.99', '597', '2007-02-20T22:58:52.996577', '3201', '1'), + ('0.99', '107', '2007-04-11T06:53:48.996577', '6133', '2'), + ('0.99', '331', '2007-03-20T11:00:35.996577', '13795', '1'), + ('2.99', '84', '2007-04-28T08:10:57.996577', '7854', '1'), + ('2.99', '383', '2007-04-29T03:39:45.996577', '8367', '2'), + ('8.99', '460', '2007-03-19T14:04:04.996577', '13215', '2'), + ('7.99', '8', '2007-03-22T20:37:35.996577', '15374', '1'), + ('3.99', '477', '2007-03-21T14:27:53.996577', '14552', '2'), + ('4.99', '578', '2007-04-09T17:32:56.996577', '5377', '1'), + ('2.99', '6', '2007-02-16T22:12:39.996577', '1841', '2'), + ('8.99', '180', '2007-03-02T03:09:43.996577', '10992', '1'), + ('0.99', '51', '2007-03-18T00:04:26.996577', '12184', '1'), + ('4.99', '369', '2007-04-08T17:22:30.996577', '4859', '2'), + ('2.99', '518', '2007-04-12T09:28:04.996577', '6652', '1'), + ('4.99', '219', '2007-04-11T09:00:35.996577', '6172', '2'), + ('2.99', '89', '2007-03-23T14:07:00.996577', '15845', '1'), + ('4.99', '226', '2007-04-07T16:26:22.996577', '4324', '1'), + ('2.99', '234', '2007-03-19T19:11:42.996577', '13349', '2'), + ('6.99', '535', '2007-03-22T17:48:03.996577', '15287', '1'), + ('2.99', '308', '2007-03-22T04:35:36.996577', '14946', '2'), + ('3.99', '340', '2007-03-01T15:40:18.996577', '10674', '2'), + ('0.99', '598', '2007-03-21T07:09:41.996577', '14345', '2'), + ('4.99', '198', '2007-03-22T22:55:44.996577', '15433', '1'), + ('2.99', '73', '2007-04-12T09:08:21.996577', '6645', '1'), + ('3.98', '269', '2007-05-14T13:44:29.996577', '13025', '1'), + ('5.99', '491', '2007-03-23T08:09:54.996577', '15685', '2'), + ('0.99', '220', '2007-04-11T21:47:47.996577', '6412', '2'), + ('0.99', '405', '2007-03-19T20:37:14.996577', '13398', '1'), + ('2.99', '330', '2007-04-06T06:31:40.996577', '3659', '2'), + ('4.99', '162', '2007-03-22T19:10:19.996577', '15332', '1'), + ('0.99', '288', '2007-03-21T21:49:49.996577', '14756', '2'), + ('2.99', '2', '2007-04-10T04:59:50.996577', '5636', '1'), + ('5.99', '581', '2007-04-08T08:41:34.996577', '4669', '1'), + ('4.99', '26', '2007-04-28T23:02:02.996577', '8241', '1'), + ('6.99', '491', '2007-03-02T02:39:18.996577', '10974', '2'), + ('2.99', '488', '2007-03-22T19:43:55.996577', '15350', '1'), + ('5.99', '232', '2007-04-11T12:44:36.996577', '6234', '2'), + ('4.99', '107', '2007-02-19T21:49:06.996577', '2860', '2'), + ('2.99', '515', '2007-04-10T01:19:03.996577', '5546', '2'), + ('2.99', '286', '2007-04-12T06:48:49.996577', '6611', '2'), + ('6.99', '360', '2007-02-18T14:53:11.996577', '2402', '2'), + ('0.99', '275', '2007-04-12T18:18:42.996577', '6856', '2'), + ('5.99', '449', '2007-04-30T18:38:45.996577', '10083', '2'), + ('5.99', '252', '2007-04-29T12:52:39.996577', '8636', '1'), + ('4.99', '515', '2007-04-29T15:47:41.996577', '8706', '1'), + ('2.99', '566', '2007-04-11T19:46:06.996577', '6365', '2'), + ('3.99', '394', '2007-04-27T16:25:41.996577', '7445', '2'), + ('4.99', '598', '2007-04-06T21:22:23.996577', '3972', '1'), + ('4.99', '181', '2007-04-30T10:54:57.996577', '9844', '1'), + ('4.99', '91', '2007-03-19T14:16:24.996577', '13222', '2'), + ('4.99', '486', '2007-04-08T23:52:33.996577', '5006', '2'), + ('5.99', '559', '2007-03-20T12:59:47.996577', '13845', '1'), + ('0.99', '213', '2007-04-09T19:49:37.996577', '5431', '1'), + ('0.99', '215', '2007-05-14T13:44:29.996577', '15862', '2'), + ('4.99', '526', '2007-03-22T21:34:51.996577', '15395', '1'), + ('2.99', '146', '2007-03-18T07:07:59.996577', '12385', '1'), + ('2.99', '408', '2007-03-23T05:56:30.996577', '15628', '1'), + ('2.99', '280', '2007-03-16T22:24:54.996577', '11517', '1'), + ('4.99', '70', '2007-03-17T17:24:31.996577', '12003', '1'), + ('0.99', '308', '2007-03-01T20:31:17.996577', '10797', '2'), + ('2.99', '575', '2007-04-29T15:55:41.996577', '8711', '2'), + ('9.99', '19', '2007-03-18T00:59:44.996577', '12211', '1'), + ('4.99', '598', '2007-04-07T08:56:20.996577', '4181', '1'), + ('3.99', '205', '2007-04-07T11:15:13.996577', '4230', '2'), + ('10.99', '459', '2007-04-29T09:48:25.996577', '8557', '2'), + ('4.99', '58', '2007-02-18T00:01:35.996577', '2191', '1'), + ('9.99', '549', '2007-04-30T22:53:31.996577', '9511', '2'), + ('2.99', '101', '2007-04-09T09:17:36.996577', '5198', '2'), + ('0.99', '293', '2007-04-07T17:17:20.996577', '4343', '2'), + ('5.99', '286', '2007-04-30T19:22:46.996577', '10105', '2'), + ('2.99', '515', '2007-03-18T08:25:14.996577', '12416', '2'), + ('0.99', '265', '2007-04-08T05:56:31.996577', '4610', '1'), + ('2.99', '465', '2007-04-27T19:01:34.996577', '7508', '2'), + ('0.99', '497', '2007-03-21T00:14:20.996577', '14134', '2'), + ('2.99', '149', '2007-02-16T18:47:12.996577', '1800', '1'), + ('8.99', '581', '2007-04-08T15:41:17.996577', '4815', '1'), + ('2.99', '532', '2007-04-09T08:53:50.996577', '5190', '2'), + ('4.99', '597', '2007-03-22T23:58:25.996577', '15469', '1'), + ('9.99', '265', '2007-04-10T09:01:18.996577', '5710', '1'), + ('3.99', '557', '2007-02-20T11:31:29.996577', '3050', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['23927', '22489', '23493', '30346', '28641', '29051', '21645', '27468', '27473', '19622', '26932', '27429', '31544', '20226', '19737', '24381', '26081', '30174', '24335', '25758', '18648', '18127', '17788', '29392', '19680', '27662', '22929', '24321', '23925', '28420', '29762', '23485', '28510', '19896', '28883', '19955', '28970', '29223', '20266', '29244', '31512', '18397', '18567', '25439', '26857', '28158', '31315', '28709', '23658', '30017', '31944', '23380', '23246', '26969', '31546', '21268', '23539', '32059', '21075', '27875', '25235', '27761', '20703', '18961', '29374', '22055', '21774', '28747', '18935', '31538', '23527', '31316', '18666', '30388', '27771', '28396', '20452', '20011', '21477', '18822', '27442', '29959', '21197', '19016', '27343', '29061', '24177', '23021', '29979', '26736', '28099', '17920', '23782', '19950', '25290', '21768', '24729', '30706', '22094', '23243']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('4.99', '133', '2007-03-19T00:15:56.996577', '12834', '1'), + ('4.99', '583', '2007-03-01T20:36:10.996577', '10800', '2'), + ('0.99', '84', '2007-03-17T13:57:38.996577', '11899', '2'), + ('0.99', '120', '2007-04-12T01:46:33.996577', '6503', '2'), + ('6.99', '577', '2007-04-29T14:18:03.996577', '8671', '2'), + ('4.99', '5', '2007-04-30T22:20:56.996577', '9493', '1'), + ('7.99', '490', '2007-03-01T19:58:00.996577', '10786', '1'), + ('2.99', '471', '2007-04-30T00:45:53.996577', '9560', '2'), + ('5.99', '472', '2007-04-11T14:38:08.996577', '6274', '2'), + ('2.99', '276', '2007-03-02T06:05:10.996577', '11085', '2'), + ('2.99', '423', '2007-04-27T05:23:53.996577', '7141', '2'), + ('0.99', '469', '2007-04-09T06:11:48.996577', '5133', '1'), + ('4.99', '233', '2007-04-11T17:19:11.996577', '6319', '1'), + ('0.99', '343', '2007-03-01T21:22:54.996577', '10822', '1'), + ('2.99', '288', '2007-03-22T08:49:21.996577', '15058', '2'), + ('0.99', '177', '2007-03-02T10:10:49.996577', '11195', '1'), + ('4.99', '347', '2007-04-30T01:33:45.996577', '9582', '1'), + ('1.99', '104', '2007-04-09T17:22:34.996577', '5376', '1'), + ('0.99', '172', '2007-03-19T18:50:02.996577', '13342', '1'), + ('6.99', '319', '2007-04-12T00:36:25.996577', '6485', '1'), + ('0.99', '35', '2007-02-18T02:20:40.996577', '2231', '1'), + ('6.99', '504', '2007-02-20T03:45:48.996577', '2938', '1'), + ('4.99', '414', '2007-02-18T03:22:55.996577', '2246', '1'), + ('0.99', '36', '2007-04-28T00:03:43.996577', '7647', '1'), + ('5.99', '280', '2007-03-23T03:16:38.996577', '15554', '2'), + ('5.99', '488', '2007-04-27T13:47:59.996577', '7373', '1'), + ('5.99', '25', '2007-03-23T18:28:56.996577', '15972', '1'), + ('5.99', '171', '2007-03-19T04:51:14.996577', '12962', '1'), + ('0.99', '133', '2007-03-01T15:24:43.996577', '10665', '1'), + ('7.99', '559', '2007-04-07T18:34:02.996577', '4370', '1'), + ('5.99', '70', '2007-04-10T20:25:40.996577', '5927', '1'), + ('4.99', '83', '2007-03-20T13:41:37.996577', '13875', '1'), + ('4.99', '566', '2007-04-30T07:15:39.996577', '9101', '2'), + ('4.99', '306', '2007-03-02T07:58:37.996577', '11142', '2'), + ('4.99', '597', '2007-04-28T12:26:01.996577', '7968', '2'), + ('3.99', '312', '2007-03-21T12:51:27.996577', '14504', '1'), + ('0.99', '207', '2007-04-08T23:54:48.996577', '5007', '2'), + ('4.99', '22', '2007-04-30T01:29:37.996577', '9580', '1'), + ('2.99', '348', '2007-03-01T19:11:28.996577', '10769', '1'), + ('0.99', '24', '2007-04-30T06:59:44.996577', '9723', '1'), + ('3.99', '230', '2007-04-30T17:41:55.996577', '10050', '2'), + ('2.99', '579', '2007-02-20T16:15:13.996577', '3111', '1'), + ('2.99', '19', '2007-02-21T16:06:28.996577', '3423', '2'), + ('4.99', '292', '2007-04-10T20:59:27.996577', '5940', '1'), + ('2.99', '416', '2007-04-06T16:22:39.996577', '3868', '1'), + ('4.99', '532', '2007-04-09T13:12:49.996577', '5278', '2'), + ('4.99', '212', '2007-04-28T13:38:51.996577', '8000', '2'), + ('9.99', '583', '2007-04-06T22:02:07.996577', '3991', '2'), + ('0.99', '104', '2007-03-22T14:21:23.996577', '15186', '2'), + ('0.99', '91', '2007-04-29T02:02:47.996577', '8313', '1'), + ('4.99', '359', '2007-05-14T13:44:29.996577', '15655', '2'), + ('4.99', '73', '2007-03-01T07:15:26.996577', '10434', '2'), + ('5.99', '58', '2007-03-21T05:57:31.996577', '14305', '2'), + ('0.99', '425', '2007-04-30T10:03:50.996577', '9170', '1'), + ('8.99', '233', '2007-04-27T02:14:53.996577', '7056', '1'), + ('0.99', '451', '2007-03-19T20:05:24.996577', '13380', '2'), + ('2.99', '89', '2007-03-18T09:03:25.996577', '12431', '2'), + ('7.98', '155', '2007-05-14T13:44:29.996577', '11496', '2'), + ('2.99', '432', '2007-03-20T19:50:00.996577', '14027', '1'), + ('5.99', '507', '2007-04-28T05:18:01.996577', '7770', '2'), + ('9.99', '275', '2007-04-08T19:54:37.996577', '4912', '2'), + ('6.99', '497', '2007-04-29T20:16:21.996577', '8813', '2'), + ('4.99', '392', '2007-03-20T05:32:33.996577', '13629', '1'), + ('0.99', '118', '2007-02-18T01:40:55.996577', '2217', '2'), + ('0.99', '35', '2007-04-09T15:02:33.996577', '5323', '2'), + ('7.99', '535', '2007-03-17T12:11:33.996577', '11855', '1'), + ('2.99', '504', '2007-03-19T20:14:36.996577', '13387', '2'), + ('2.99', '586', '2007-04-12T10:29:33.996577', '6679', '1'), + ('4.99', '112', '2007-02-16T21:34:02.996577', '1835', '1'), + ('2.99', '232', '2007-04-30T21:07:14.996577', '10157', '2'), + ('2.99', '87', '2007-03-21T14:53:31.996577', '14566', '1'), + ('3.99', '212', '2007-04-30T01:25:52.996577', '8940', '1'), + ('7.99', '40', '2007-02-18T18:56:57.996577', '2470', '2'), + ('2.99', '124', '2007-04-08T10:33:00.996577', '4709', '2'), + ('2.99', '498', '2007-04-11T02:32:17.996577', '6058', '1'), + ('3.99', '557', '2007-04-12T11:56:02.996577', '6713', '2'), + ('0.99', '368', '2007-03-17T11:44:30.996577', '11844', '1'), + ('0.99', '320', '2007-03-02T10:31:03.996577', '11208', '1'), + ('4.99', '471', '2007-03-18T03:01:37.996577', '12271', '1'), + ('4.99', '84', '2007-02-15T09:10:39.996577', '1320', '2'), + ('4.99', '469', '2007-04-30T18:27:08.996577', '10075', '2'), + ('2.99', '87', '2007-04-30T16:45:35.996577', '9348', '1'), + ('4.99', '444', '2007-03-22T16:26:53.996577', '15249', '1'), + ('4.99', '132', '2007-02-20T16:51:56.996577', '3121', '1'), + ('3.99', '460', '2007-04-28T05:44:37.996577', '7785', '1'), + ('0.99', '6', '2007-04-28T17:15:49.996577', '8101', '1'), + ('2.99', '155', '2007-03-21T14:22:47.996577', '14549', '2'), + ('1.99', '35', '2007-03-02T14:00:58.996577', '11298', '1'), + ('2.99', '89', '2007-04-12T14:24:01.996577', '6772', '1'), + ('0.99', '405', '2007-04-28T04:57:11.996577', '7759', '1'), + ('3.99', '527', '2007-04-10T23:56:59.996577', '6003', '2'), + ('0.99', '451', '2007-02-15T00:36:30.996577', '1202', '1'), + ('6.99', '119', '2007-03-19T00:25:47.996577', '12842', '2'), + ('0.99', '312', '2007-03-02T12:04:00.996577', '11248', '2'), + ('6.99', '280', '2007-04-29T15:13:21.996577', '8695', '2'), + ('0.99', '504', '2007-03-01T05:39:53.996577', '10397', '2'), + ('4.99', '220', '2007-03-02T01:51:49.996577', '10948', '1'), + ('6.99', '150', '2007-04-07T13:07:18.996577', '4271', '1'), + ('5.99', '539', '2007-03-20T10:32:10.996577', '13778', '2'), + ('3.99', '58', '2007-03-19T13:43:04.996577', '13207', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['22856', '23723', '22925', '19121', '31537', '17939', '30629', '28471', '25740', '28644', '32049', '32038', '25586', '26087', '18380', '30322', '25683', '23306', '18295', '17668', '30126', '25364', '30603', '22129', '26298', '31968', '29505', '18930', '32048', '19761', '22429', '28612', '18069', '26085', '28744', '19696', '25443', '22239', '25837', '32060', '19872', '29136', '28752', '19371', '27636', '29234', '22737', '18595', '17610', '22063', '27425', '20706', '23284', '20168', '25262', '22797', '21073', '29057', '27273', '28486', '20930', '19043', '31760', '31044', '22421', '26835', '18821', '27339', '22909', '20726', '25138', '27692', '22988', '30063', '25605', '30870', '32052', '23184', '25781', '31530', '18520', '23606', '20612', '29506', '30303', '19548', '30621', '30848', '31532', '25471', '29981', '31336', '25273', '29405', '30242', '24117', '24047', '21630', '21898', '27401']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('5.99', '19', '2007-03-17T12:38:48.996577', '11869', '1'), + ('1.99', '113', '2007-03-01T12:16:28.996577', '10578', '2'), + ('0.99', '25', '2007-03-19T03:17:14.996577', '12922', '1'), + ('4.99', '162', '2007-02-15T10:50:22.996577', '1339', '2'), + ('2.99', '232', '2007-04-30T17:14:28.996577', '9365', '2'), + ('1.99', '454', '2007-02-16T23:45:57.996577', '1861', '1'), + ('2.99', '144', '2007-04-27T21:03:11.996577', '7566', '2'), + ('0.99', '563', '2007-04-27T22:40:21.996577', '7612', '2'), + ('4.99', '317', '2007-04-29T06:33:35.996577', '8458', '1'), + ('0.99', '578', '2007-04-09T20:28:07.996577', '5445', '1'), + ('1.98', '107', '2007-05-14T13:44:29.996577', '13079', '1'), + ('8.97', '75', '2007-05-14T13:44:29.996577', '13534', '2'), + ('0.99', '303', '2007-04-29T18:07:30.996577', '8764', '2'), + ('0.99', '348', '2007-04-08T07:08:05.996577', '4633', '2'), + ('2.99', '575', '2007-02-16T20:19:30.996577', '1824', '1'), + ('1.99', '118', '2007-04-12T02:01:38.996577', '6507', '1'), + ('6.99', '312', '2007-04-29T05:13:16.996577', '8412', '1'), + ('7.99', '65', '2007-03-17T21:30:26.996577', '12114', '1'), + ('3.99', '553', '2007-02-16T23:57:56.996577', '1862', '2'), + ('4.99', '382', '2007-02-20T17:00:24.996577', '3125', '2'), + ('5.99', '101', '2007-04-27T04:07:08.996577', '7112', '2'), + ('2.99', '286', '2007-04-08T18:49:57.996577', '4894', '1'), + ('4.99', '142', '2007-04-08T01:56:25.996577', '4531', '1'), + ('0.99', '543', '2007-03-19T12:53:14.996577', '13187', '1'), + ('0.99', '366', '2007-04-09T16:53:14.996577', '5364', '2'), + ('4.99', '452', '2007-05-14T13:44:29.996577', '14175', '1'), + ('0.99', '45', '2007-04-10T05:00:03.996577', '5637', '1'), + ('2.99', '111', '2007-02-17T07:58:31.996577', '1974', '2'), + ('0.99', '101', '2007-05-14T13:44:29.996577', '12141', '2'), + ('4.99', '291', '2007-03-21T03:53:21.996577', '14241', '2'), + ('4.99', '576', '2007-03-21T12:43:04.996577', '14501', '1'), + ('0.99', '575', '2007-04-29T23:36:59.996577', '8904', '2'), + ('2.99', '486', '2007-02-19T17:32:58.996577', '2797', '2'), + ('4.99', '348', '2007-04-06T04:05:25.996577', '3610', '2'), + ('6.99', '586', '2007-04-05T21:59:02.996577', '3487', '2'), + ('3.99', '284', '2007-03-17T23:12:56.996577', '12162', '2'), + ('2.99', '292', '2007-04-27T07:56:11.996577', '7216', '1'), + ('6.99', '555', '2007-03-22T10:27:24.996577', '15102', '2'), + ('2.99', '326', '2007-04-28T03:15:40.996577', '7725', '2'), + ('0.00', '155', '2007-05-14T13:44:29.996577', '12352', '1'), + ('0.99', '303', '2007-03-17T21:39:38.996577', '12117', '2'), + ('11.99', '13', '2007-04-29T21:06:07.996577', '8831', '2'), + ('3.99', '587', '2007-04-09T11:50:34.996577', '5243', '2'), + ('2.99', '233', '2007-02-18T16:03:34.996577', '2424', '1'), + ('7.99', '486', '2007-04-08T14:09:37.996577', '4772', '1'), + ('9.99', '23', '2007-04-30T12:55:12.996577', '9255', '2'), + ('0.99', '6', '2007-03-17T06:40:46.996577', '11727', '1'), + ('4.99', '26', '2007-02-16T12:29:28.996577', '1706', '2'), + ('0.99', '368', '2007-02-14T23:25:11.996577', '1186', '1'), + ('4.99', '535', '2007-03-21T13:30:00.996577', '14522', '1'), + ('4.99', '469', '2007-04-05T23:28:47.996577', '3522', '2'), + ('0.99', '392', '2007-03-21T08:02:10.996577', '14369', '2'), + ('0.99', '62', '2007-03-23T04:40:18.996577', '15591', '1'), + ('4.99', '338', '2007-03-17T04:18:47.996577', '11671', '2'), + ('2.99', '277', '2007-04-29T05:10:02.996577', '8410', '2'), + ('0.99', '13', '2007-03-02T14:33:43.996577', '11315', '2'), + ('0.99', '432', '2007-03-17T12:39:54.996577', '11870', '2'), + ('7.99', '6', '2007-04-11T13:30:20.996577', '6248', '1'), + ('6.99', '453', '2007-04-30T14:25:30.996577', '9289', '2'), + ('2.99', '565', '2007-04-06T14:58:09.996577', '3838', '1'), + ('2.99', '416', '2007-03-01T04:15:36.996577', '10354', '1'), + ('0.99', '140', '2007-02-20T20:44:13.996577', '3171', '2'), + ('0.99', '252', '2007-04-29T23:33:56.996577', '8899', '1'), + ('0.99', '180', '2007-04-09T17:46:12.996577', '5384', '2'), + ('2.99', '575', '2007-03-22T04:48:33.996577', '14952', '2'), + ('10.99', '414', '2007-04-06T20:34:13.996577', '3957', '1'), + ('0.99', '84', '2007-02-15T00:06:04.996577', '1195', '2'), + ('3.99', '460', '2007-04-09T22:21:30.996577', '5482', '2'), + ('0.99', '23', '2007-03-20T00:50:06.996577', '13511', '2'), + ('0.99', '394', '2007-03-21T16:24:32.996577', '14605', '1'), + ('1.99', '265', '2007-03-18T00:52:33.996577', '12207', '1'), + ('2.99', '491', '2007-04-11T08:58:01.996577', '6171', '2'), + ('2.99', '30', '2007-03-23T13:45:40.996577', '15829', '2'), + ('4.99', '96', '2007-04-10T07:11:08.996577', '5678', '1'), + ('8.99', '305', '2007-04-10T10:38:37.996577', '5745', '1'), + ('2.99', '166', '2007-04-06T05:46:46.996577', '3642', '1'), + ('2.99', '111', '2007-05-14T13:44:29.996577', '15542', '2'), + ('5.99', '52', '2007-03-19T09:08:20.996577', '13090', '2'), + ('6.99', '321', '2007-04-29T14:45:31.996577', '8685', '2'), + ('2.99', '232', '2007-04-28T04:22:02.996577', '7749', '1'), + ('0.99', '6', '2007-02-17T07:48:11.996577', '1966', '1'), + ('3.99', '98', '2007-03-01T16:43:33.996577', '10694', '2'), + ('0.99', '383', '2007-03-02T07:17:35.996577', '11122', '2'), + ('0.99', '45', '2007-04-10T23:53:10.996577', '6001', '2'), + ('3.99', '115', '2007-04-30T16:53:56.996577', '10022', '2'), + ('2.99', '269', '2007-03-23T12:23:05.996577', '15788', '2'), + ('3.99', '144', '2007-04-08T15:46:48.996577', '4818', '2'), + ('3.99', '164', '2007-04-10T18:41:45.996577', '5895', '1'), + ('2.99', '232', '2007-04-29T01:40:52.996577', '8306', '1'), + ('0.99', '294', '2007-04-30T22:41:02.996577', '10186', '2'), + ('4.99', '89', '2007-04-28T03:26:23.996577', '7729', '2'), + ('4.99', '214', '2007-04-29T14:01:44.996577', '8663', '1'), + ('2.99', '278', '2007-04-30T20:24:39.996577', '9448', '2'), + ('5.99', '38', '2007-04-07T09:52:14.996577', '4202', '1'), + ('1.99', '111', '2007-04-05T21:54:20.996577', '3485', '2'), + ('2.99', '150', '2007-03-01T16:19:47.996577', '10686', '1'), + ('2.99', '144', '2007-03-18T20:27:26.996577', '12733', '2'), + ('4.99', '488', '2007-03-19T22:34:39.996577', '13446', '2'), + ('4.99', '518', '2007-03-19T08:17:18.996577', '13065', '1'), + ('4.99', '467', '2007-04-09T07:25:33.996577', '5160', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['23355', '17769', '21705', '17550', '28746', '22274', '29542', '20031', '21682', '28101', '26490', '20385', '30091', '20073', '22299', '28055', '31323', '18359', '23321', '26000', '22101', '24432', '32011', '29186', '20243', '25258', '28395', '19193', '23381', '18990', '31736', '18622', '31292', '28646', '31319', '30401', '19067', '18336', '20199', '21626', '28525', '20308', '21562', '27576', '18779', '26591', '31290', '22897', '28826', '21670', '23680', '24586', '24757', '24416', '21280', '28162', '28968', '31385', '29914', '17771', '20917', '28488', '24592', '19760', '21454', '28888', '19685', '26240', '26666', '24336', '20422', '25869', '31719', '24974', '21976', '21555', '19152', '19759', '22837', '24273', '18432', '27281', '19730', '25271', '26294', '28048', '22066', '24052', '31233', '23627', '19317', '22740', '31317', '27758', '19632', '31058', '19418', '26958', '20846', '20067']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('0.99', '70', '2007-03-22T16:14:38.996577', '15238', '2'), + ('2.99', '407', '2007-02-16T11:33:08.996577', '1698', '1'), + ('5.99', '497', '2007-03-22T20:08:46.996577', '15362', '1'), + ('4.99', '352', '2007-02-16T09:36:54.996577', '1678', '1'), + ('2.99', '586', '2007-04-09T17:41:23.996577', '5382', '2'), + ('4.99', '560', '2007-03-01T08:42:07.996577', '10480', '2'), + ('7.99', '49', '2007-04-12T02:34:37.996577', '6521', '1'), + ('0.99', '323', '2007-03-16T23:28:13.996577', '11548', '2'), + ('4.99', '494', '2007-03-22T17:56:30.996577', '15291', '2'), + ('2.99', '527', '2007-04-11T02:02:55.996577', '6050', '1'), + ('0.99', '382', '2007-04-27T23:16:22.996577', '7625', '2'), + ('5.99', '361', '2007-03-02T12:01:14.996577', '11243', '2'), + ('2.99', '98', '2007-04-30T07:51:04.996577', '9753', '1'), + ('7.99', '327', '2007-03-23T18:19:56.996577', '15969', '2'), + ('2.99', '562', '2007-03-22T15:12:52.996577', '15212', '1'), + ('5.99', '523', '2007-04-29T03:46:34.996577', '8372', '1'), + ('0.99', '213', '2007-04-27T19:43:51.996577', '7528', '2'), + ('3.99', '570', '2007-02-18T04:14:41.996577', '2261', '2'), + ('0.99', '66', '2007-03-21T09:58:09.996577', '14429', '2'), + ('4.99', '340', '2007-04-11T20:27:14.996577', '6381', '2'), + ('4.99', '540', '2007-03-18T00:42:32.996577', '12201', '2'), + ('2.99', '181', '2007-03-19T21:16:35.996577', '13415', '2'), + ('4.99', '9', '2007-05-14T13:44:29.996577', '15813', '1'), + ('2.99', '18', '2007-04-11T06:43:34.996577', '6128', '2'), + ('4.99', '345', '2007-03-18T23:05:00.996577', '12805', '2'), + ('2.99', '277', '2007-04-10T19:27:21.996577', '5913', '1'), + ('0.99', '557', '2007-04-11T23:40:29.996577', '6459', '1'), + ('2.99', '180', '2007-02-19T12:00:18.996577', '2700', '2'), + ('4.99', '73', '2007-03-02T06:36:56.996577', '11102', '1'), + ('4.99', '125', '2007-02-20T16:34:23.996577', '3118', '1'), + ('0.99', '250', '2007-04-10T01:12:47.996577', '5540', '1'), + ('2.99', '30', '2007-02-17T02:53:38.996577', '1895', '2'), + ('3.99', '210', '2007-04-29T14:32:26.996577', '8678', '2'), + ('4.99', '578', '2007-04-12T14:57:15.996577', '6784', '1'), + ('8.99', '213', '2007-04-08T08:17:48.996577', '4655', '1'), + ('0.99', '125', '2007-04-28T08:56:12.996577', '7879', '2'), + ('0.99', '146', '2007-02-19T17:44:22.996577', '2800', '1'), + ('0.99', '563', '2007-02-19T02:51:44.996577', '2573', '2'), + ('9.99', '340', '2007-03-22T20:53:43.996577', '15378', '1'), + ('5.99', '488', '2007-03-01T08:30:08.996577', '10474', '2'), + ('2.99', '568', '2007-04-07T16:23:03.996577', '4322', '1'), + ('5.99', '352', '2007-03-17T09:34:19.996577', '11793', '1'), + ('2.99', '480', '2007-03-22T20:10:06.996577', '15363', '2'), + ('4.99', '481', '2007-04-30T21:54:31.996577', '9481', '1'), + ('0.99', '73', '2007-02-16T08:48:46.996577', '1669', '1'), + ('2.99', '392', '2007-04-06T01:37:17.996577', '3566', '1'), + ('0.99', '210', '2007-04-28T10:06:34.996577', '7909', '2'), + ('9.99', '22', '2007-03-19T08:11:51.996577', '13060', '2'), + ('3.99', '592', '2007-04-30T20:04:30.996577', '9437', '1'), + ('6.99', '493', '2007-03-23T00:36:44.996577', '15490', '1'), + ('3.99', '107', '2007-03-23T03:29:39.996577', '15560', '1'), + ('4.99', '198', '2007-03-18T14:52:50.996577', '12594', '2'), + ('7.99', '223', '2007-03-22T16:49:30.996577', '15257', '1'), + ('2.99', '180', '2007-03-20T18:01:47.996577', '13994', '1'), + ('0.99', '452', '2007-03-23T16:11:08.996577', '15909', '1'), + ('4.99', '532', '2007-04-12T06:06:51.996577', '6598', '2'), + ('5.99', '207', '2007-04-08T10:40:59.996577', '4713', '2'), + ('0.99', '220', '2007-04-10T16:30:28.996577', '5859', '2'), + ('2.99', '83', '2007-04-12T18:25:18.996577', '6861', '2'), + ('4.99', '408', '2007-02-18T19:31:34.996577', '2479', '2'), + ('4.99', '414', '2007-03-20T06:30:05.996577', '13657', '2'), + ('0.99', '565', '2007-04-09T00:36:22.996577', '5020', '2'), + ('6.99', '198', '2007-03-22T16:48:33.996577', '15256', '1'), + ('5.99', '291', '2007-03-20T06:47:46.996577', '13665', '1'), + ('4.99', '469', '2007-03-18T09:25:27.996577', '12447', '1'), + ('6.99', '598', '2007-04-06T20:17:10.996577', '3950', '2'), + ('2.99', '282', '2007-03-19T16:26:19.996577', '13278', '1'), + ('1.99', '361', '2007-04-12T20:55:22.996577', '6914', '1'), + ('6.99', '399', '2007-04-11T12:28:16.996577', '6229', '2'), + ('4.99', '172', '2007-03-20T15:51:17.996577', '13937', '2'), + ('0.99', '364', '2007-03-22T16:16:36.996577', '15242', '1'), + ('4.99', '330', '2007-04-06T03:53:29.996577', '3603', '2'), + ('0.99', '248', '2007-04-06T18:33:44.996577', '3910', '1'), + ('5.99', '248', '2007-03-22T02:26:55.996577', '14885', '2'), + ('5.99', '527', '2007-03-02T03:39:20.996577', '11013', '1'), + ('1.99', '480', '2007-03-01T21:05:37.996577', '10808', '2'), + ('4.99', '171', '2007-02-18T21:19:06.996577', '2497', '1'), + ('0.99', '291', '2007-03-02T08:11:50.996577', '11145', '2'), + ('4.99', '16', '2007-03-18T06:10:09.996577', '12358', '1'), + ('5.99', '166', '2007-03-21T04:35:50.996577', '14261', '2'), + ('2.99', '589', '2007-02-20T06:59:31.996577', '2979', '1'), + ('0.99', '454', '2007-04-12T11:16:25.996577', '6701', '2'), + ('2.99', '288', '2007-03-17T15:43:23.996577', '11952', '2'), + ('5.99', '278', '2007-04-28T22:20:19.996577', '8222', '2'), + ('4.99', '366', '2007-04-06T05:06:47.996577', '3632', '2'), + ('4.99', '523', '2007-04-08T05:28:40.996577', '4605', '1'), + ('0.99', '535', '2007-03-23T19:55:37.996577', '16017', '1'), + ('1.99', '144', '2007-03-22T07:16:10.996577', '15017', '1'), + ('4.99', '199', '2007-04-08T22:31:56.996577', '4976', '1'), + ('4.99', '101', '2007-03-17T15:52:01.996577', '11959', '2'), + ('2.99', '215', '2007-02-20T02:37:30.996577', '2918', '2'), + ('6.99', '6', '2007-03-19T22:46:51.996577', '13451', '2'), + ('4.99', '213', '2007-04-06T21:59:20.996577', '3989', '2'), + ('2.99', '497', '2007-04-27T22:23:10.996577', '7603', '2'), + ('3.99', '277', '2007-03-02T05:50:09.996577', '11074', '2'), + ('5.99', '181', '2007-04-29T11:06:40.996577', '8593', '1'), + ('5.99', '243', '2007-02-15T15:09:52.996577', '1405', '1'), + ('5.99', '425', '2007-04-07T18:03:56.996577', '4362', '2'), + ('6.99', '407', '2007-03-21T09:04:46.996577', '14401', '2'), + ('0.99', '327', '2007-03-19T22:41:09.996577', '13448', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['23695', '23170', '25463', '23939', '20613', '17926', '28696', '18921', '23520', '28738', '31753', '23314', '20843', '28252', '23308', '25465', '28155', '22412', '28749', '29312', '31855', '18828', '18302', '21557', '31756', '26003', '27026', '18168', '28498', '18225', '24675', '29314', '19024', '26233', '27527', '20169', '18429', '26900', '18477', '24460', '22301', '22526', '22861', '26902', '29885', '19167', '26618', '27690', '23538', '19921', '26697', '17579', '18582', '30639', '23787', '22472', '17931', '23240', '20314', '23234', '28528', '21287', '17975', '28078', '20451', '18324', '26702', '21391', '18565', '28096', '18824', '29193', '23317', '20552', '28509', '26330', '22934', '19113', '21984', '20721', '25264', '21347', '28638', '24202', '22217', '21326', '25208', '28222', '26773', '23054', '22449', '18331', '18826', '20005', '22800', '32017', '28327', '30508', '30952', '25640']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('2.99', '109', '2007-03-23T07:52:02.996577', '15677', '2'), + ('2.99', '51', '2007-03-19T09:20:25.996577', '13098', '2'), + ('7.99', '294', '2007-04-08T14:41:31.996577', '4786', '1'), + ('2.99', '134', '2007-03-19T06:15:42.996577', '13006', '2'), + ('2.99', '383', '2007-03-17T01:04:30.996577', '11592', '1'), + ('6.99', '451', '2007-02-21T06:48:44.996577', '3316', '1'), + ('1.99', '581', '2007-04-30T20:31:00.996577', '9449', '1'), + ('2.99', '108', '2007-02-18T00:55:27.996577', '2210', '1'), + ('4.99', '87', '2007-03-01T05:10:57.996577', '10387', '1'), + ('4.99', '585', '2007-04-27T14:18:11.996577', '7384', '1'), + ('0.99', '252', '2007-04-11T19:27:17.996577', '6357', '1'), + ('5.99', '66', '2007-03-17T04:43:43.996577', '11683', '1'), + ('2.99', '407', '2007-03-19T03:40:13.996577', '12931', '2'), + ('7.99', '540', '2007-04-11T07:35:27.996577', '6145', '2'), + ('0.99', '65', '2007-03-20T07:36:18.996577', '13692', '2'), + ('6.99', '294', '2007-04-27T15:19:25.996577', '7415', '2'), + ('4.99', '532', '2007-04-08T22:04:39.996577', '4962', '2'), + ('4.99', '575', '2007-03-01T03:25:40.996577', '10331', '1'), + ('2.99', '586', '2007-04-30T12:38:14.996577', '9896', '2'), + ('9.99', '30', '2007-04-09T05:12:56.996577', '5108', '1'), + ('3.99', '262', '2007-04-06T08:39:51.996577', '3699', '1'), + ('5.99', '85', '2007-02-17T19:30:51.996577', '2131', '1'), + ('1.99', '555', '2007-02-21T00:59:03.996577', '3232', '2'), + ('5.99', '480', '2007-03-02T16:33:07.996577', '11369', '1'), + ('0.99', '252', '2007-04-27T04:26:58.996577', '7121', '2'), + ('0.99', '340', '2007-04-29T09:23:27.996577', '8541', '1'), + ('5.99', '432', '2007-04-08T22:15:23.996577', '4965', '1'), + ('5.99', '515', '2007-02-15T23:09:00.996577', '1531', '2'), + ('3.99', '566', '2007-04-06T22:17:46.996577', '3998', '1'), + ('0.99', '530', '2007-02-15T21:39:36.996577', '1516', '1'), + ('4.99', '214', '2007-03-02T20:21:34.996577', '11474', '2'), + ('7.99', '30', '2007-04-10T22:37:20.996577', '5972', '2'), + ('5.99', '134', '2007-02-21T03:23:47.996577', '3267', '1'), + ('0.99', '360', '2007-04-30T16:57:52.996577', '9352', '2'), + ('7.99', '477', '2007-04-08T21:45:36.996577', '4956', '2'), + ('5.99', '338', '2007-03-17T06:14:31.996577', '11719', '2'), + ('4.99', '589', '2007-02-16T11:57:10.996577', '1703', '2'), + ('3.99', '420', '2007-04-11T03:57:29.996577', '6086', '2'), + ('7.99', '204', '2007-02-16T05:33:18.996577', '1616', '1'), + ('0.99', '185', '2007-03-02T16:06:09.996577', '11355', '2'), + ('1.99', '562', '2007-03-23T15:44:56.996577', '15900', '1'), + ('4.99', '587', '2007-03-21T19:43:49.996577', '14710', '2'), + ('4.99', '19', '2007-03-20T23:01:29.996577', '14101', '1'), + ('4.99', '420', '2007-04-12T04:56:38.996577', '6582', '2'), + ('4.99', '80', '2007-04-09T20:51:47.996577', '5452', '2'), + ('1.99', '174', '2007-02-21T19:14:17.996577', '3446', '2'), + ('4.99', '394', '2007-04-11T02:32:20.996577', '6059', '2'), + ('6.99', '491', '2007-04-09T06:21:38.996577', '5134', '2'), + ('3.99', '89', '2007-03-17T21:42:51.996577', '12118', '1'), + ('6.99', '308', '2007-03-18T14:40:01.996577', '12590', '1'), + ('2.99', '402', '2007-04-11T09:43:01.996577', '6183', '2'), + ('0.99', '360', '2007-02-15T20:17:01.996577', '1492', '2'), + ('2.99', '23', '2007-02-21T20:17:44.996577', '3461', '1'), + ('8.99', '145', '2007-04-07T09:48:17.996577', '4201', '2'), + ('0.99', '119', '2007-03-21T18:11:02.996577', '14659', '2'), + ('2.99', '581', '2007-03-20T08:06:30.996577', '13712', '2'), + ('4.99', '452', '2007-02-18T04:33:28.996577', '2266', '2'), + ('6.99', '58', '2007-03-02T18:12:30.996577', '11416', '1'), + ('0.99', '352', '2007-03-22T00:54:19.996577', '14852', '2'), + ('0.99', '57', '2007-03-20T09:19:53.996577', '13743', '2'), + ('4.99', '568', '2007-04-10T12:03:48.996577', '5776', '1'), + ('4.99', '453', '2007-03-21T17:40:38.996577', '14644', '2'), + ('9.99', '459', '2007-02-21T01:08:10.996577', '3234', '2'), + ('5.99', '526', '2007-04-06T18:02:00.996577', '3905', '2'), + ('1.99', '368', '2007-03-01T22:18:48.996577', '10848', '2'), + ('4.99', '561', '2007-02-16T05:49:56.996577', '1620', '2'), + ('0.99', '402', '2007-04-30T08:36:59.996577', '9779', '2'), + ('7.99', '463', '2007-03-17T21:01:16.996577', '12096', '2'), + ('2.99', '19', '2007-02-19T09:11:25.996577', '2657', '1'), + ('2.99', '526', '2007-04-30T23:07:21.996577', '10199', '2'), + ('5.99', '84', '2007-02-17T10:25:41.996577', '2012', '1'), + ('4.99', '19', '2007-04-12T01:25:28.996577', '6495', '2'), + ('2.99', '66', '2007-03-20T14:34:07.996577', '13900', '1'), + ('4.99', '377', '2007-03-18T13:06:33.996577', '12549', '1'), + ('4.99', '566', '2007-04-29T19:39:03.996577', '8797', '1'), + ('5.99', '368', '2007-04-11T08:00:45.996577', '6154', '1'), + ('5.99', '26', '2007-03-17T07:22:56.996577', '11744', '1'), + ('8.99', '158', '2007-02-20T23:03:22.996577', '3203', '2'), + ('0.99', '528', '2007-03-01T15:40:17.996577', '10673', '1'), + ('0.99', '394', '2007-03-01T17:24:04.996577', '10718', '1'), + ('0.99', '277', '2007-04-30T12:49:25.996577', '9901', '1'), + ('5.99', '459', '2007-03-22T11:22:24.996577', '15126', '1'), + ('8.99', '577', '2007-04-28T08:52:48.996577', '7876', '2'), + ('6.99', '158', '2007-03-02T06:38:20.996577', '11103', '1'), + ('0.99', '553', '2007-03-23T01:16:50.996577', '15506', '1'), + ('0.99', '457', '2007-03-20T15:47:14.996577', '13934', '2'), + ('2.99', '273', '2007-04-06T01:14:39.996577', '3556', '2'), + ('2.99', '537', '2007-04-30T14:59:43.996577', '9967', '1'), + ('2.99', '408', '2007-04-12T17:00:28.996577', '6826', '2'), + ('2.99', '38', '2007-03-02T15:41:52.996577', '11344', '1'), + ('0.99', '578', '2007-03-23T07:02:36.996577', '15652', '1'), + ('3.99', '562', '2007-02-17T09:53:23.996577', '1998', '1'), + ('0.99', '84', '2007-02-18T15:21:59.996577', '2409', '2'), + ('2.99', '319', '2007-03-17T16:58:01.996577', '11994', '2'), + ('4.99', '13', '2007-03-19T09:17:29.996577', '13096', '2'), + ('4.99', '22', '2007-05-14T13:44:29.996577', '12222', '1'), + ('0.99', '549', '2007-04-28T23:00:05.996577', '8239', '2'), + ('0.99', '133', '2007-04-30T10:16:14.996577', '9175', '1'), + ('2.99', '172', '2007-04-27T05:02:58.996577', '7135', '1'), + ('2.99', '308', '2007-04-10T21:25:55.996577', '5946', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['28399', '19786', '22177', '29204', '28451', '29230', '25249', '20022', '29092', '22427', '20319', '27309', '18182', '23992', '23405', '19628', '21463', '24057', '19625', '27876', '29043', '26786', '31456', '31663', '30754', '27257', '28758', '26789', '24581', '23599', '18533', '27587', '25466', '18849', '28491', '22519', '26070', '24075', '19332', '23151', '27597', '18448', '30755', '26672', '29445', '19276', '18385', '26221', '22742', '19582', '18051', '29104', '20265', '22433', '23844', '23504', '28131', '18248', '17738', '21911', '21614', '18181', '20321', '30224', '18848', '30830', '27440', '30650', '19306', '30947', '20948', '22241', '18101', '23277', '18671', '17929', '17925', '27387', '21266', '22933', '18483', '20375', '19778', '20394', '22180', '29673', '28256', '22454', '21978', '18937', '29802', '21471', '18966', '25428', '26662', '17972', '25370', '30604', '27929', '26142']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('0.99', '557', '2007-04-30T16:29:41.996577', '9336', '1'), + ('2.99', '294', '2007-03-17T16:39:06.996577', '11981', '2'), + ('2.99', '549', '2007-03-17T12:52:18.996577', '11878', '2'), + ('5.99', '20', '2007-04-28T08:34:36.996577', '7864', '2'), + ('5.99', '562', '2007-04-08T11:38:11.996577', '4732', '2'), + ('7.99', '23', '2007-04-27T05:47:12.996577', '7155', '1'), + ('1.99', '276', '2007-04-30T06:31:05.996577', '9080', '1'), + ('4.99', '322', '2007-03-02T07:15:30.996577', '11120', '2'), + ('2.99', '9', '2007-04-28T06:20:22.996577', '7801', '1'), + ('4.99', '576', '2007-03-19T08:12:05.996577', '13061', '1'), + ('0.99', '353', '2007-03-20T04:31:59.996577', '13604', '2'), + ('2.99', '457', '2007-04-30T17:39:37.996577', '10049', '1'), + ('2.99', '517', '2007-02-19T00:07:05.996577', '2534', '2'), + ('2.99', '139', '2007-03-22T07:25:36.996577', '15024', '1'), + ('2.99', '75', '2007-03-17T17:24:28.996577', '12002', '1'), + ('4.99', '276', '2007-03-20T18:34:31.996577', '14000', '1'), + ('0.99', '470', '2007-03-01T00:34:00.996577', '10236', '1'), + ('2.99', '145', '2007-03-18T16:35:19.996577', '12637', '1'), + ('5.99', '276', '2007-03-17T23:45:58.996577', '12178', '2'), + ('5.99', '507', '2007-04-28T12:27:04.996577', '7970', '1'), + ('8.99', '5', '2007-04-11T01:45:30.996577', '6042', '1'), + ('2.99', '409', '2007-04-10T15:56:40.996577', '5848', '1'), + ('3.99', '226', '2007-04-27T12:24:00.996577', '7329', '1'), + ('4.99', '243', '2007-04-06T21:04:46.996577', '3965', '1'), + ('2.99', '155', '2007-04-11T23:04:17.996577', '6443', '1'), + ('4.99', '452', '2007-04-07T17:47:31.996577', '4353', '2'), + ('4.99', '587', '2007-04-30T08:50:41.996577', '9785', '2'), + ('2.99', '409', '2007-04-12T06:01:25.996577', '6596', '1'), + ('2.99', '198', '2007-03-17T07:57:48.996577', '11756', '1'), + ('0.99', '96', '2007-03-20T00:56:35.996577', '13514', '1'), + ('4.99', '10', '2007-02-17T09:39:40.996577', '1995', '1'), + ('6.99', '482', '2007-04-28T07:31:28.996577', '7840', '2'), + ('4.99', '294', '2007-04-28T05:08:59.996577', '7765', '1'), + ('7.99', '89', '2007-02-15T15:13:33.996577', '1407', '2'), + ('2.99', '565', '2007-04-12T07:45:12.996577', '6627', '1'), + ('0.99', '586', '2007-03-23T08:08:30.996577', '15684', '2'), + ('6.99', '347', '2007-04-08T01:35:25.996577', '4523', '1'), + ('2.99', '146', '2007-03-21T00:38:58.996577', '14143', '2'), + ('0.99', '220', '2007-02-16T21:03:46.996577', '1832', '1'), + ('6.99', '49', '2007-03-21T17:04:20.996577', '14627', '1'), + ('7.99', '483', '2007-04-28T15:35:39.996577', '8057', '1'), + ('4.99', '593', '2007-02-18T17:13:37.996577', '2441', '1'), + ('3.99', '155', '2007-04-27T02:41:28.996577', '7077', '1'), + ('6.99', '400', '2007-04-09T10:06:13.996577', '5212', '2'), + ('8.99', '40', '2007-04-30T05:28:21.996577', '9050', '1'), + ('0.99', '199', '2007-02-21T05:52:00.996577', '3299', '1'), + ('8.99', '576', '2007-02-18T17:26:38.996577', '2444', '2'), + ('2.99', '360', '2007-04-09T21:00:11.996577', '5456', '2'), + ('4.99', '6', '2007-03-21T08:17:54.996577', '14377', '1'), + ('5.99', '273', '2007-03-20T16:33:38.996577', '13955', '1'), + ('2.99', '481', '2007-02-14T22:03:35.996577', '1168', '2'), + ('4.99', '10', '2007-04-30T13:55:33.996577', '9935', '1'), + ('4.99', '347', '2007-03-23T03:20:18.996577', '15555', '2'), + ('0.99', '577', '2007-03-01T08:55:00.996577', '10487', '1'), + ('4.99', '125', '2007-03-17T20:23:21.996577', '12075', '1'), + ('4.99', '85', '2007-03-18T09:50:17.996577', '12456', '1'), + ('4.99', '530', '2007-04-06T17:15:00.996577', '3887', '2'), + ('8.99', '537', '2007-02-19T03:33:37.996577', '2586', '1'), + ('2.99', '399', '2007-02-20T05:57:41.996577', '2961', '2'), + ('0.99', '520', '2007-03-16T23:57:01.996577', '11566', '1'), + ('4.99', '486', '2007-03-21T05:13:03.996577', '14284', '2'), + ('4.99', '517', '2007-02-16T23:00:01.996577', '1850', '1'), + ('1.99', '353', '2007-03-23T03:39:08.996577', '15564', '1'), + ('4.99', '108', '2007-04-29T10:47:06.996577', '8587', '2'), + ('8.99', '89', '2007-02-15T04:33:44.996577', '1252', '1'), + ('4.99', '162', '2007-04-29T07:09:02.996577', '8478', '2'), + ('0.99', '469', '2007-04-29T19:21:49.996577', '8791', '2'), + ('0.99', '145', '2007-04-29T03:59:55.996577', '8380', '1'), + ('4.99', '213', '2007-02-20T00:22:34.996577', '2889', '1'), + ('6.99', '172', '2007-04-08T18:02:15.996577', '4878', '2'), + ('4.99', '417', '2007-03-20T02:18:41.996577', '13545', '1'), + ('1.99', '556', '2007-03-02T20:15:12.996577', '11466', '1'), + ('2.99', '497', '2007-02-18T15:08:03.996577', '2406', '1'), + ('5.99', '62', '2007-03-02T13:51:13.996577', '11297', '1'), + ('7.99', '41', '2007-02-21T01:38:27.996577', '3246', '2'), + ('3.99', '452', '2007-02-16T18:37:03.996577', '1794', '1'), + ('0.99', '451', '2007-02-20T02:37:01.996577', '2917', '2'), + ('5.99', '464', '2007-04-30T02:04:00.996577', '9600', '1'), + ('2.99', '451', '2007-03-19T09:24:11.996577', '13100', '2'), + ('0.99', '26', '2007-03-02T15:28:38.996577', '11338', '1'), + ('4.99', '205', '2007-02-15T11:54:49.996577', '1357', '1'), + ('5.99', '360', '2007-03-18T22:00:45.996577', '12773', '1'), + ('7.99', '293', '2007-03-23T01:17:30.996577', '15508', '1'), + ('2.99', '361', '2007-03-23T17:09:37.996577', '15935', '2'), + ('0.99', '549', '2007-03-21T10:09:12.996577', '14434', '1'), + ('2.99', '62', '2007-04-09T13:45:20.996577', '5292', '2'), + ('4.99', '540', '2007-04-30T08:01:20.996577', '9762', '2'), + ('0.99', '579', '2007-03-21T01:57:03.996577', '14185', '1'), + ('0.99', '527', '2007-03-17T02:46:08.996577', '11624', '1'), + ('4.99', '112', '2007-02-18T00:07:11.996577', '2193', '1'), + ('4.99', '73', '2007-04-28T01:39:55.996577', '7683', '1'), + ('4.99', '470', '2007-03-20T04:00:49.996577', '13585', '2'), + ('3.99', '120', '2007-02-15T13:18:20.996577', '1374', '1'), + ('5.99', '291', '2007-04-27T20:49:31.996577', '7561', '1'), + ('0.99', '399', '2007-04-08T21:47:14.996577', '4957', '2'), + ('0.99', '459', '2007-02-20T01:07:47.996577', '2899', '1'), + ('2.99', '286', '2007-04-27T15:39:08.996577', '7422', '1'), + ('0.99', '142', '2007-04-12T02:40:24.996577', '6522', '1'), + ('2.99', '512', '2007-04-27T08:04:02.996577', '7219', '1'), + ('5.99', '353', '2007-04-07T19:03:26.996577', '4380', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['18659', '21494', '29568', '21274', '30514', '22424', '27260', '20819', '28950', '25843', '20245', '22310', '29268', '18701', '18514', '25274', '21675', '18326', '23691', '23933', '20986', '21772', '26048', '18044', '25218', '27713', '24692', '23406', '29933', '28052', '24638', '27952', '30389', '21465', '18342', '29665', '22425', '29389', '28551', '24056', '20551', '20949', '30222', '22543', '31504', '27428', '31320', '17601', '30132', '30631', '20070', '28683', '19581', '24965', '20827', '24595', '24596', '29717', '20945', '26779', '21563', '20467', '31722', '23693', '27865', '31151', '23791', '18056', '26309', '21830', '19951', '21301', '19956', '30067', '29978', '20916', '26693', '20610', '23247', '22649', '29569', '23110', '18307', '19920', '26795', '27274', '22356', '23316', '31898', '18404', '18155', '22643', '18656', '27329', '29245', '31717', '19331', '22803', '27456', '23941']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('3.99', '38', '2007-02-21T13:41:10.996577', '3392', '2'), + ('5.99', '472', '2007-03-22T14:21:16.996577', '15185', '2'), + ('2.99', '51', '2007-04-09T10:58:49.996577', '5230', '1'), + ('3.99', '452', '2007-03-17T07:04:08.996577', '11735', '1'), + ('4.99', '134', '2007-04-28T12:21:23.996577', '7965', '2'), + ('3.99', '576', '2007-03-01T17:39:25.996577', '10724', '2'), + ('1.99', '452', '2007-04-09T08:11:47.996577', '5177', '1'), + ('4.99', '405', '2007-03-01T21:27:36.996577', '10823', '2'), + ('4.99', '205', '2007-04-29T23:19:47.996577', '8896', '2'), + ('0.99', '326', '2007-04-30T19:30:40.996577', '10108', '1'), + ('4.99', '345', '2007-03-23T02:56:51.996577', '15551', '1'), + ('4.99', '563', '2007-03-23T14:14:08.996577', '15850', '1'), + ('0.99', '26', '2007-04-27T12:23:44.996577', '7328', '2'), + ('6.99', '49', '2007-02-16T17:20:38.996577', '1777', '2'), + ('2.99', '5', '2007-02-16T06:29:28.996577', '1631', '2'), + ('4.99', '279', '2007-04-07T23:02:51.996577', '4476', '1'), + ('5.99', '494', '2007-03-17T16:50:25.996577', '11987', '1'), + ('5.99', '561', '2007-02-18T11:28:07.996577', '2357', '1'), + ('3.99', '109', '2007-03-01T23:40:32.996577', '10892', '2'), + ('6.99', '134', '2007-03-01T22:47:25.996577', '10864', '1'), + ('0.99', '420', '2007-03-21T13:35:15.996577', '14525', '2'), + ('2.99', '504', '2007-03-19T12:04:54.996577', '13166', '1'), + ('8.99', '345', '2007-04-29T15:13:14.996577', '8694', '2'), + ('3.99', '479', '2007-02-17T06:30:46.996577', '1947', '2'), + ('4.99', '273', '2007-04-30T10:42:14.996577', '9186', '1'), + ('2.99', '493', '2007-04-29T12:07:35.996577', '8616', '1'), + ('2.99', '215', '2007-03-23T04:16:21.996577', '15583', '1'), + ('0.99', '75', '2007-03-18T01:55:08.996577', '12239', '2'), + ('0.99', '85', '2007-04-09T23:46:58.996577', '5519', '1'), + ('4.99', '523', '2007-04-12T10:21:32.996577', '6675', '2'), + ('4.99', '210', '2007-03-19T05:38:02.996577', '12986', '2'), + ('6.99', '515', '2007-04-07T05:16:22.996577', '4111', '2'), + ('2.99', '124', '2007-04-10T01:58:43.996577', '5566', '1'), + ('1.99', '470', '2007-03-02T17:21:40.996577', '11397', '2'), + ('4.99', '566', '2007-02-17T08:40:41.996577', '1982', '2'), + ('7.99', '61', '2007-04-27T01:18:41.996577', '7027', '1'), + ('5.99', '576', '2007-03-17T21:28:57.996577', '12112', '2'), + ('0.99', '36', '2007-04-09T18:35:35.996577', '5403', '1'), + ('2.99', '570', '2007-04-30T19:54:44.996577', '9432', '2'), + ('2.99', '145', '2007-03-17T15:47:02.996577', '11954', '2'), + ('1.99', '377', '2007-03-18T07:20:08.996577', '12390', '1'), + ('1.99', '417', '2007-03-20T15:40:24.996577', '13927', '1'), + ('0.99', '108', '2007-04-12T17:32:50.996577', '6841', '1'), + ('0.99', '589', '2007-03-21T14:09:27.996577', '14544', '1'), + ('4.99', '230', '2007-04-11T06:35:22.996577', '6126', '2'), + ('0.99', '469', '2007-04-07T05:44:45.996577', '4123', '2'), + ('4.99', '213', '2007-04-09T07:24:18.996577', '5159', '2'), + ('3.99', '364', '2007-02-20T06:00:21.996577', '2962', '2'), + ('0.99', '101', '2007-04-30T23:38:10.996577', '10218', '2'), + ('3.99', '144', '2007-04-28T08:18:44.996577', '7858', '1'), + ('2.99', '327', '2007-03-22T21:09:40.996577', '15386', '1'), + ('2.99', '581', '2007-04-07T10:04:46.996577', '4210', '2'), + ('4.99', '273', '2007-03-20T09:11:08.996577', '13738', '2'), + ('7.99', '247', '2007-03-18T11:06:02.996577', '12482', '1'), + ('1.99', '405', '2007-03-22T09:27:11.996577', '15072', '1'), + ('8.99', '199', '2007-03-01T22:22:11.996577', '10850', '1'), + ('2.99', '199', '2007-03-02T19:33:05.996577', '11454', '1'), + ('5.99', '65', '2007-04-29T04:55:27.996577', '8404', '2'), + ('0.99', '417', '2007-03-02T14:07:44.996577', '11303', '2'), + ('0.99', '408', '2007-04-30T05:34:34.996577', '9052', '1'), + ('4.99', '480', '2007-03-23T04:07:07.996577', '15579', '2'), + ('1.99', '369', '2007-03-02T17:04:21.996577', '11388', '2'), + ('2.99', '248', '2007-04-09T17:11:45.996577', '5370', '1'), + ('3.99', '109', '2007-03-19T15:55:36.996577', '13264', '1'), + ('4.99', '507', '2007-04-06T06:35:55.996577', '3660', '1'), + ('0.99', '190', '2007-04-29T07:36:04.996577', '8498', '1'), + ('2.99', '119', '2007-03-23T14:06:38.996577', '15844', '1'), + ('0.99', '482', '2007-02-21T02:08:18.996577', '3255', '2'), + ('4.99', '366', '2007-04-28T19:58:12.996577', '8169', '2'), + ('4.99', '512', '2007-03-01T00:19:21.996577', '10232', '2'), + ('5.99', '312', '2007-03-17T12:53:35.996577', '11879', '2'), + ('1.99', '454', '2007-03-23T05:23:52.996577', '15608', '2'), + ('4.99', '312', '2007-03-22T10:23:29.996577', '15100', '1'), + ('3.99', '96', '2007-04-30T07:01:50.996577', '9093', '2'), + ('2.99', '89', '2007-04-09T22:22:35.996577', '5483', '1'), + ('2.99', '414', '2007-03-20T00:05:00.996577', '13494', '2'), + ('5.99', '402', '2007-04-06T11:05:42.996577', '3755', '2'), + ('4.99', '383', '2007-03-02T02:36:43.996577', '10971', '1'), + ('6.99', '58', '2007-03-21T18:18:12.996577', '14665', '1'), + ('4.99', '204', '2007-03-22T20:10:07.996577', '15364', '1'), + ('5.99', '51', '2007-04-09T14:16:32.996577', '5304', '2'), + ('6.99', '45', '2007-03-01T23:01:38.996577', '10878', '2'), + ('6.99', '556', '2007-02-21T18:00:06.996577', '3438', '2'), + ('3.99', '308', '2007-03-18T13:43:02.996577', '12567', '2'), + ('0.99', '409', '2007-04-30T13:27:31.996577', '9267', '2'), + ('6.99', '453', '2007-04-30T18:52:26.996577', '9406', '2'), + ('2.99', '568', '2007-03-02T15:17:27.996577', '11331', '1'), + ('0.99', '66', '2007-03-18T18:49:25.996577', '12699', '1'), + ('5.99', '265', '2007-04-12T03:35:05.996577', '6553', '2'), + ('0.99', '582', '2007-02-20T12:49:08.996577', '3071', '2'), + ('6.99', '512', '2007-02-14T22:57:03.996577', '1176', '1'), + ('6.99', '204', '2007-03-18T20:40:03.996577', '12737', '1'), + ('1.99', '38', '2007-02-19T01:18:21.996577', '2550', '1'), + ('6.99', '459', '2007-04-28T10:15:49.996577', '7913', '1'), + ('0.99', '24', '2007-04-30T13:37:13.996577', '9925', '2'), + ('4.99', '247', '2007-04-10T15:40:03.996577', '5842', '1'), + ('0.99', '219', '2007-02-19T03:12:56.996577', '2580', '2'), + ('9.99', '13', '2007-03-21T04:12:33.996577', '14252', '1'), + ('6.99', '470', '2007-04-29T23:10:32.996577', '8890', '1'), + ('2.99', '134', '2007-03-23T18:11:12.996577', '15963', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['25184', '23312', '29731', '26763', '29048', '17855', '17598', '30585', '29219', '25449', '22236', '30320', '24131', '19771', '20370', '22722', '21917', '22730', '31332', '23793', '22834', '24115', '25772', '19713', '30243', '27551', '28713', '27660', '24778', '20315', '27564', '29667', '28637', '30766', '28901', '23940', '30657', '20984', '22780', '19541', '23303', '31287', '25592', '25424', '26806', '20876', '20874', '26797', '26798', '20877', '20871', '26796', '17779', '17777', '20870', '17778', '26802', '20878', '17776', '20869', '20879', '20866', '26800', '20882', '20867', '26799', '27520', '21529', '18032', '27521', '21530', '24501', '31141', '31136', '24500', '31139', '19232', '31140', '31137', '31144', '24505', '19230', '31135', '27077', '27079', '21113', '21114', '27071', '27078', '27081', '21120', '21116', '21112', '21115', '21119', '27075', '27076', '27082', '21108', '25161']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('6.99', '269', '2007-04-27T20:04:35.996577', '7537', '1'), + ('5.99', '66', '2007-03-02T04:16:46.996577', '11028', '2'), + ('5.99', '66', '2007-04-30T06:59:11.996577', '9091', '1'), + ('4.99', '407', '2007-04-27T23:48:10.996577', '7643', '2'), + ('3.99', '5', '2007-04-28T07:12:05.996577', '7829', '2'), + ('2.99', '432', '2007-02-16T04:15:29.996577', '1597', '2'), + ('2.99', '364', '2007-02-18T17:17:44.996577', '2442', '2'), + ('0.99', '140', '2007-04-12T04:20:13.996577', '6571', '2'), + ('2.99', '22', '2007-04-10T14:16:45.996577', '5815', '1'), + ('5.99', '292', '2007-04-30T09:12:07.996577', '9792', '1'), + ('2.99', '555', '2007-03-17T23:58:45.996577', '12182', '2'), + ('1.99', '118', '2007-04-10T14:58:07.996577', '5829', '1'), + ('9.99', '150', '2007-03-21T13:29:15.996577', '14520', '2'), + ('6.99', '293', '2007-03-19T06:24:17.996577', '13013', '2'), + ('1.99', '359', '2007-03-22T23:29:27.996577', '15453', '1'), + ('4.99', '5', '2007-03-02T03:25:11.996577', '11001', '2'), + ('2.99', '520', '2007-03-20T06:34:18.996577', '13659', '2'), + ('6.99', '5', '2007-03-21T09:59:37.996577', '14430', '1'), + ('2.99', '214', '2007-04-09T07:59:53.996577', '5172', '2'), + ('4.99', '120', '2007-03-01T16:46:39.996577', '10696', '2'), + ('2.99', '16', '2007-03-01T17:43:34.996577', '10727', '2'), + ('4.99', '149', '2007-03-23T00:19:19.996577', '15479', '2'), + ('0.99', '320', '2007-04-30T22:51:08.996577', '9509', '1'), + ('0.99', '286', '2007-03-18T14:55:34.996577', '12595', '2'), + ('3.99', '111', '2007-04-06T01:02:14.996577', '3551', '1'), + ('7.99', '479', '2007-04-27T02:19:30.996577', '7060', '1'), + ('7.99', '583', '2007-04-10T10:43:59.996577', '5747', '2'), + ('8.99', '488', '2007-04-09T06:33:40.996577', '5141', '1'), + ('4.99', '226', '2007-03-21T19:35:49.996577', '14708', '1'), + ('0.99', '353', '2007-03-02T09:40:34.996577', '11186', '1'), + ('4.99', '480', '2007-04-30T16:22:05.996577', '9332', '2'), + ('6.99', '61', '2007-04-28T14:39:47.996577', '8029', '2'), + ('4.99', '577', '2007-04-27T13:47:08.996577', '7371', '1'), + ('4.99', '156', '2007-04-28T07:00:11.996577', '7822', '2'), + ('4.99', '598', '2007-04-30T01:25:19.996577', '8939', '1'), + ('2.99', '134', '2007-03-21T04:48:40.996577', '14265', '2'), + ('4.99', '146', '2007-04-11T17:35:55.996577', '6327', '1'), + ('4.99', '420', '2007-03-01T19:04:55.996577', '10766', '1'), + ('5.99', '10', '2007-03-22T20:27:55.996577', '15370', '1'), + ('4.99', '269', '2007-03-02T03:40:48.996577', '11014', '1'), + ('8.99', '65', '2007-03-02T11:16:31.996577', '11227', '1'), + ('4.99', '210', '2007-04-11T12:25:12.996577', '6227', '2'), + ('3.99', '304', '2007-04-10T10:49:02.996577', '5749', '2'), + ('3.99', '291', '2007-04-08T17:31:12.996577', '4862', '2'), + ('4.99', '410', '2007-04-27T19:39:49.996577', '7523', '1'), + ('3.99', '410', '2007-03-21T03:43:26.996577', '14237', '1'), + ('2.99', '410', '2007-03-20T09:28:20.996577', '13748', '2'), + ('0.99', '410', '2007-04-07T13:03:56.996577', '4267', '1'), + ('3.99', '410', '2007-04-09T06:57:06.996577', '5150', '1'), + ('4.99', '410', '2007-03-21T05:45:36.996577', '14298', '2'), + ('6.99', '410', '2007-03-17T05:25:56.996577', '11694', '1'), + ('0.99', '410', '2007-04-07T02:50:53.996577', '4062', '2'), + ('5.99', '410', '2007-02-18T14:39:12.996577', '2400', '2'), + ('2.99', '410', '2007-02-17T15:02:25.996577', '2073', '1'), + ('6.99', '410', '2007-03-02T20:17:32.996577', '11472', '1'), + ('4.99', '410', '2007-02-18T03:49:38.996577', '2255', '1'), + ('4.99', '410', '2007-04-11T07:42:48.996577', '6148', '1'), + ('4.99', '410', '2007-03-21T06:29:21.996577', '14319', '1'), + ('2.99', '410', '2007-02-15T21:26:00.996577', '1514', '1'), + ('10.99', '410', '2007-03-02T09:44:45.996577', '11187', '1'), + ('2.99', '410', '2007-03-21T23:45:45.996577', '14819', '2'), + ('4.99', '410', '2007-03-01T05:55:45.996577', '10402', '1'), + ('5.99', '410', '2007-04-09T15:22:23.996577', '5330', '2'), + ('4.99', '410', '2007-03-23T01:48:00.996577', '15518', '1'), + ('2.99', '410', '2007-03-01T21:58:48.996577', '10837', '1'), + ('4.99', '410', '2007-04-09T08:55:35.996577', '5192', '1'), + ('2.99', '476', '2007-04-11T07:53:43.996577', '6151', '1'), + ('4.99', '476', '2007-03-01T03:47:49.996577', '10346', '1'), + ('2.99', '476', '2007-02-21T19:27:46.996577', '3448', '2'), + ('0.99', '476', '2007-04-27T17:13:41.996577', '7461', '1'), + ('9.99', '476', '2007-03-01T13:34:18.996577', '10617', '1'), + ('6.99', '189', '2007-03-02T05:10:04.996577', '11059', '2'), + ('2.99', '189', '2007-04-28T05:51:01.996577', '7790', '2'), + ('4.99', '189', '2007-04-06T13:52:00.996577', '3813', '2'), + ('9.99', '189', '2007-03-01T01:02:32.996577', '10247', '1'), + ('4.99', '189', '2007-04-27T17:26:06.996577', '7469', '1'), + ('6.99', '189', '2007-02-20T15:57:09.996577', '3108', '1'), + ('4.99', '189', '2007-04-28T01:23:46.996577', '7675', '1'), + ('0.99', '189', '2007-04-07T09:52:40.996577', '4203', '2'), + ('4.99', '189', '2007-04-30T22:47:27.996577', '9506', '1'), + ('5.99', '189', '2007-03-23T19:33:17.996577', '16008', '1'), + ('0.99', '189', '2007-02-16T21:17:34.996577', '1834', '1'), + ('0.99', '189', '2007-04-06T11:24:57.996577', '3763', '1'), + ('4.99', '436', '2007-04-27T21:57:13.996577', '7593', '1'), + ('9.99', '436', '2007-04-28T17:01:15.996577', '8097', '2'), + ('6.99', '436', '2007-03-18T08:55:12.996577', '12429', '2'), + ('9.99', '436', '2007-03-19T09:23:45.996577', '13099', '2'), + ('1.99', '436', '2007-04-06T15:22:38.996577', '3851', '2'), + ('5.99', '436', '2007-04-28T14:38:23.996577', '8027', '2'), + ('0.99', '436', '2007-04-30T00:04:45.996577', '9539', '1'), + ('4.99', '436', '2007-03-23T11:38:42.996577', '15766', '2'), + ('3.99', '436', '2007-03-20T01:58:26.996577', '13533', '1'), + ('0.99', '436', '2007-03-18T03:48:23.996577', '12297', '2'), + ('7.99', '436', '2007-03-19T20:07:07.996577', '13382', '2'), + ('2.99', '436', '2007-03-20T12:15:04.996577', '13826', '2'), + ('4.99', '436', '2007-04-08T14:37:17.996577', '4782', '1'), + ('0.99', '436', '2007-04-10T22:04:02.996577', '5959', '1'), + ('5.99', '436', '2007-04-30T03:58:53.996577', '9638', '1'), + ('0.99', '436', '2007-03-02T08:33:56.996577', '11160', '2'), + ('4.99', '266', '2007-03-22T19:34:26.996577', '15346', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['25152', '25151', '25154', '31907', '25150', '25157', '25160', '25149', '25147', '31910', '31908', '25155', '25158', '24348', '30966', '24347', '19159', '24346', '30960', '30962', '19162', '24342', '24341', '19163', '30961', '19114', '30807', '30808', '30802', '30149', '23640', '23637', '30147', '23639', '30141', '30134', '30152', '18896', '30133', '23638', '30148', '30137', '18897', '30146', '30140', '30144', '30151', '23634', '30153', '31930', '25713', '25714', '19980', '19978', '19981', '24239', '24236', '30826', '30820', '24244', '30822', '30828', '24234', '30823', '30824', '18042', '21546', '27538', '18039', '27540', '18037', '18040', '21543', '27539', '27541', '27535', '18038', '27537', '18041', '20679', '26576', '26578', '26565', '20678', '26569', '17705', '17707', '26577', '26573', '26570', '26567', '26571', '20688', '20687', '29479', '29466', '29467', '29464', '29470', '29465']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('0.99', '266', '2007-03-18T06:54:39.996577', '12378', '2'), + ('4.99', '266', '2007-03-18T02:35:46.996577', '12255', '1'), + ('4.99', '266', '2007-03-18T19:38:04.996577', '12715', '1'), + ('5.99', '266', '2007-04-09T16:44:34.996577', '5362', '2'), + ('0.99', '266', '2007-03-17T06:39:36.996577', '11726', '1'), + ('1.99', '266', '2007-03-20T21:58:16.996577', '14080', '1'), + ('2.99', '266', '2007-03-22T14:14:46.996577', '15181', '1'), + ('0.99', '266', '2007-03-17T02:54:08.996577', '11626', '2'), + ('5.99', '266', '2007-03-02T11:34:37.996577', '11233', '2'), + ('5.99', '266', '2007-04-30T07:26:50.996577', '9109', '2'), + ('4.99', '266', '2007-04-10T02:27:06.996577', '5577', '1'), + ('8.99', '266', '2007-03-19T23:25:10.996577', '13468', '1'), + ('2.99', '266', '2007-03-21T12:27:34.996577', '14492', '1'), + ('2.99', '173', '2007-03-23T19:38:50.996577', '16010', '1'), + ('4.99', '173', '2007-04-11T00:38:44.996577', '6021', '2'), + ('8.99', '173', '2007-03-23T11:54:10.996577', '15775', '1'), + ('2.99', '173', '2007-02-14T23:32:33.996577', '1188', '2'), + ('0.99', '173', '2007-03-23T00:31:19.996577', '15483', '2'), + ('7.99', '173', '2007-04-08T19:21:53.996577', '4904', '1'), + ('4.99', '173', '2007-04-09T22:23:51.996577', '5485', '2'), + ('0.99', '173', '2007-02-21T00:40:02.996577', '3224', '2'), + ('2.99', '173', '2007-03-17T20:19:05.996577', '12073', '2'), + ('5.99', '173', '2007-03-01T04:00:39.996577', '10351', '1'), + ('4.99', '173', '2007-02-21T08:42:53.996577', '3336', '1'), + ('2.99', '173', '2007-04-09T19:48:20.996577', '5430', '2'), + ('0.99', '159', '2007-02-16T11:08:54.996577', '1695', '1'), + ('0.99', '159', '2007-04-30T08:24:26.996577', '9132', '2'), + ('7.99', '159', '2007-04-30T00:44:19.996577', '9559', '1'), + ('0.99', '159', '2007-04-10T05:59:33.996577', '5656', '2'), + ('3.99', '102', '2007-04-30T09:19:19.996577', '9151', '2'), + ('3.99', '102', '2007-03-23T20:27:52.996577', '16031', '2'), + ('4.99', '102', '2007-03-18T11:25:03.996577', '12495', '2'), + ('0.99', '102', '2007-04-28T20:58:53.996577', '8186', '1'), + ('1.99', '102', '2007-03-22T08:34:54.996577', '15049', '1'), + ('5.99', '102', '2007-04-09T23:23:12.996577', '5509', '2'), + ('1.99', '102', '2007-04-06T04:55:41.996577', '3630', '2'), + ('2.99', '102', '2007-04-30T02:44:04.996577', '9617', '2'), + ('2.99', '102', '2007-02-15T01:49:26.996577', '1215', '2'), + ('1.99', '102', '2007-04-05T23:26:53.996577', '3520', '2'), + ('9.99', '102', '2007-03-19T21:25:51.996577', '13420', '1'), + ('5.99', '102', '2007-04-29T14:04:53.996577', '8664', '1'), + ('3.99', '102', '2007-04-08T14:17:00.996577', '4777', '2'), + ('8.99', '102', '2007-02-18T15:49:50.996577', '2419', '2'), + ('6.99', '102', '2007-04-27T16:10:57.996577', '7439', '2'), + ('4.99', '102', '2007-04-09T05:17:15.996577', '5109', '1'), + ('0.99', '102', '2007-04-27T04:23:58.996577', '7119', '2'), + ('0.99', '102', '2007-04-30T14:47:05.996577', '9295', '2'), + ('1.99', '102', '2007-03-01T22:07:47.996577', '10841', '2'), + ('4.99', '102', '2007-04-30T08:38:48.996577', '9780', '1'), + ('2.99', '315', '2007-05-14T13:44:29.996577', '14426', '2'), + ('4.99', '315', '2007-04-08T23:18:03.996577', '4992', '1'), + ('6.99', '315', '2007-04-09T05:54:01.996577', '5126', '2'), + ('2.99', '315', '2007-03-20T23:14:27.996577', '14106', '1'), + ('0.99', '315', '2007-03-02T12:12:15.996577', '11254', '2'), + ('2.99', '315', '2007-03-21T01:24:00.996577', '14162', '2'), + ('2.99', '161', '2007-03-17T11:34:26.996577', '11838', '1'), + ('2.99', '161', '2007-03-01T14:12:35.996577', '10637', '1'), + ('4.99', '161', '2007-04-29T18:33:30.996577', '8774', '2'), + ('0.99', '161', '2007-04-07T09:09:57.996577', '4187', '2'), + ('2.99', '161', '2007-03-22T12:40:31.996577', '15150', '2'), + ('2.99', '161', '2007-04-07T23:54:58.996577', '4490', '1'), + ('0.99', '161', '2007-04-30T19:36:58.996577', '9421', '2'), + ('5.99', '161', '2007-03-01T00:40:51.996577', '10241', '1'), + ('6.99', '161', '2007-04-09T16:04:01.996577', '5349', '2'), + ('4.99', '161', '2007-04-12T18:49:16.996577', '6873', '2'), + ('4.99', '478', '2007-02-21T02:25:41.996577', '3259', '2'), + ('4.99', '478', '2007-03-22T14:24:14.996577', '15188', '2'), + ('4.99', '478', '2007-04-29T07:26:04.996577', '8488', '2'), + ('6.99', '478', '2007-02-18T23:46:53.996577', '2529', '1'), + ('4.99', '478', '2007-04-30T16:41:32.996577', '10016', '2'), + ('0.99', '478', '2007-02-16T12:37:10.996577', '1708', '1'), + ('8.99', '478', '2007-02-19T06:01:26.996577', '2616', '2'), + ('2.99', '478', '2007-03-19T11:56:52.996577', '13162', '2'), + ('4.99', '478', '2007-04-30T04:45:59.996577', '9665', '1'), + ('0.99', '478', '2007-04-30T20:08:14.996577', '10127', '2'), + ('4.99', '478', '2007-04-06T08:14:38.996577', '3691', '1'), + ('4.99', '478', '2007-02-18T11:29:17.996577', '2358', '2'), + ('2.99', '478', '2007-04-27T19:39:29.996577', '7522', '1'), + ('4.99', '478', '2007-02-19T16:03:05.996577', '2765', '2'), + ('3.99', '390', '2007-03-19T21:15:12.996577', '13413', '1'), + ('2.99', '390', '2007-04-30T15:33:45.996577', '9314', '2'), + ('4.99', '390', '2007-04-30T17:51:51.996577', '10061', '1'), + ('2.99', '390', '2007-04-06T22:19:20.996577', '3999', '1'), + ('2.99', '390', '2007-03-18T22:56:47.996577', '12803', '2'), + ('5.99', '390', '2007-04-08T22:17:45.996577', '4968', '1'), + ('2.99', '390', '2007-02-16T13:58:27.996577', '1730', '2'), + ('7.99', '390', '2007-02-18T09:09:45.996577', '2330', '1'), + ('4.99', '390', '2007-04-30T10:19:17.996577', '9825', '1'), + ('5.99', '390', '2007-04-27T22:00:49.996577', '7595', '1'), + ('4.99', '390', '2007-04-11T11:21:02.996577', '6215', '1'), + ('3.99', '390', '2007-04-07T09:24:40.996577', '4191', '2'), + ('0.99', '390', '2007-04-11T22:32:00.996577', '6430', '1'), + ('4.99', '390', '2007-03-22T20:50:01.996577', '15376', '2'), + ('8.99', '390', '2007-03-22T18:13:25.996577', '15303', '2'), + ('6.99', '42', '2007-04-30T17:51:26.996577', '10060', '2'), + ('5.99', '42', '2007-04-09T23:43:26.996577', '5517', '2'), + ('3.99', '42', '2007-04-10T05:47:24.996577', '5652', '2'), + ('2.99', '42', '2007-04-07T19:38:04.996577', '4391', '2'), + ('0.99', '42', '2007-04-26T21:20:58.996577', '6925', '1'), + ('4.99', '42', '2007-04-09T09:19:22.996577', '5199', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['29476', '29473', '23090', '23095', '29475', '23094', '29468', '29472', '23093', '18672', '23516', '29942', '23514', '29949', '23518', '18834', '18835', '29946', '23510', '18838', '29944', '18836', '29941', '29938', '23512', '32087', '24788', '19351', '24789', '31459', '19348', '31460', '31462', '17906', '27221', '21233', '21234', '27229', '27222', '27228', '17905', '17907', '27223', '21237', '17909', '31748', '31744', '31743', '32095', '24988', '31740', '24990', '24996', '19286', '24613', '19284', '24618', '31255', '24615', '24609', '18948', '18946', '30285', '23735', '30286', '30288', '30276', '30287', '30277', '30280', '23739', '23738', '18947', '30278', '31189', '24551', '31192', '31186', '24548', '31182', '31191', '24547', '19263', '31204', '19261', '19258', '31206', '31197', '24557', '31198', '31195', '19257', '31207', '31201', '24558', '31205', '31194', '31203', '24555', '24554']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('2.99', '42', '2007-04-29T19:04:52.996577', '8785', '2'), + ('6.99', '42', '2007-04-28T17:01:06.996577', '8095', '1'), + ('2.99', '42', '2007-03-01T22:15:29.996577', '10845', '2'), + ('2.99', '42', '2007-03-22T23:11:15.996577', '15442', '1'), + ('3.99', '42', '2007-04-29T07:39:07.996577', '8499', '1'), + ('7.99', '42', '2007-03-21T11:18:59.996577', '14461', '1'), + ('2.99', '42', '2007-04-11T09:28:25.996577', '6179', '1'), + ('0.99', '42', '2007-04-28T15:20:24.996577', '8049', '1'), + ('2.99', '42', '2007-03-18T11:34:03.996577', '12499', '2'), + ('0.99', '42', '2007-02-15T23:17:58.996577', '1534', '2'), + ('1.99', '86', '2007-03-20T23:57:27.996577', '14122', '2'), + ('0.99', '86', '2007-04-09T13:53:32.996577', '5295', '2'), + ('4.99', '86', '2007-03-20T01:58:51.996577', '13535', '1'), + ('4.99', '86', '2007-04-30T17:40:15.996577', '9376', '2'), + ('1.99', '86', '2007-03-23T09:26:06.996577', '15715', '1'), + ('0.99', '86', '2007-02-16T20:12:11.996577', '1822', '2'), + ('2.99', '86', '2007-02-17T04:42:00.996577', '1924', '2'), + ('10.99', '86', '2007-04-28T08:50:18.996577', '7874', '1'), + ('0.99', '86', '2007-03-17T14:34:17.996577', '11916', '2'), + ('0.99', '86', '2007-02-20T23:11:42.996577', '3207', '1'), + ('7.99', '86', '2007-04-12T18:43:30.996577', '6872', '2'), + ('4.99', '86', '2007-02-17T20:10:00.996577', '2141', '1'), + ('9.99', '86', '2007-04-08T04:03:07.996577', '4571', '1'), + ('0.99', '86', '2007-04-06T04:05:44.996577', '3611', '1'), + ('3.99', '86', '2007-03-19T01:23:04.996577', '12870', '2'), + ('4.99', '227', '2007-05-14T13:44:29.996577', '13374', '2'), + ('4.99', '227', '2007-03-19T20:02:05.996577', '13379', '2'), + ('0.99', '227', '2007-02-20T12:22:19.996577', '3065', '2'), + ('0.99', '227', '2007-03-22T21:49:48.996577', '15406', '2'), + ('5.99', '227', '2007-04-06T02:08:27.996577', '3576', '1'), + ('2.99', '227', '2007-02-16T09:39:27.996577', '1679', '1'), + ('2.99', '227', '2007-04-07T17:10:12.996577', '4340', '2'), + ('2.99', '227', '2007-04-08T09:03:54.996577', '4680', '1'), + ('7.99', '448', '2007-02-16T20:16:42.996577', '1823', '2'), + ('5.99', '448', '2007-04-06T20:36:24.996577', '3959', '2'), + ('2.99', '448', '2007-03-18T09:24:55.996577', '12446', '1'), + ('2.99', '448', '2007-03-19T14:10:58.996577', '13220', '1'), + ('4.99', '448', '2007-04-26T23:26:08.996577', '6985', '2'), + ('6.99', '448', '2007-04-06T22:05:22.996577', '3992', '2'), + ('2.99', '448', '2007-04-11T18:16:28.996577', '6341', '2'), + ('5.99', '448', '2007-02-15T08:47:00.996577', '1313', '1'), + ('0.99', '448', '2007-02-19T11:57:34.996577', '2697', '2'), + ('0.99', '448', '2007-04-07T00:39:49.996577', '4024', '2'), + ('3.99', '448', '2007-03-21T15:25:05.996577', '14580', '1'), + ('5.99', '448', '2007-02-21T09:36:58.996577', '3347', '2'), + ('0.99', '251', '2007-04-30T02:59:28.996577', '8982', '2'), + ('2.99', '251', '2007-04-10T22:45:35.996577', '5979', '2'), + ('2.99', '251', '2007-04-09T00:13:30.996577', '5012', '2'), + ('0.99', '251', '2007-05-14T13:44:29.996577', '14107', '1'), + ('7.99', '251', '2007-03-01T12:10:07.996577', '10575', '1'), + ('4.99', '251', '2007-04-06T13:28:40.996577', '3799', '1'), + ('3.99', '251', '2007-03-17T19:16:58.996577', '12047', '2'), + ('2.99', '251', '2007-03-23T06:52:22.996577', '15647', '2'), + ('6.99', '201', '2007-02-18T11:33:08.996577', '2359', '2'), + ('4.99', '201', '2007-03-19T08:38:52.996577', '13076', '2'), + ('1.99', '201', '2007-02-17T13:09:24.996577', '2047', '1'), + ('2.99', '201', '2007-03-22T05:27:54.996577', '14973', '1'), + ('6.99', '201', '2007-04-06T08:51:53.996577', '3708', '2'), + ('3.99', '201', '2007-03-20T06:55:29.996577', '13671', '2'), + ('5.99', '201', '2007-03-01T18:34:26.996577', '10750', '2'), + ('5.99', '114', '2007-02-20T18:42:46.996577', '3144', '2'), + ('7.99', '114', '2007-02-19T10:42:03.996577', '2680', '2'), + ('5.99', '114', '2007-04-28T11:07:37.996577', '7938', '2'), + ('5.99', '114', '2007-03-21T01:11:46.996577', '14158', '2'), + ('4.99', '114', '2007-04-29T07:33:59.996577', '8496', '2'), + ('4.99', '114', '2007-04-30T06:53:07.996577', '9717', '1'), + ('0.99', '114', '2007-04-07T00:41:50.996577', '4025', '1'), + ('10.99', '114', '2007-04-29T11:00:46.996577', '8590', '1'), + ('0.99', '114', '2007-04-09T19:10:01.996577', '5418', '1'), + ('2.99', '114', '2007-04-11T10:00:13.996577', '6188', '1'), + ('3.99', '114', '2007-03-23T06:48:21.996577', '15646', '2'), + ('2.99', '114', '2007-03-23T02:14:06.996577', '15528', '1'), + ('2.99', '114', '2007-02-20T14:35:17.996577', '3094', '1'), + ('4.99', '114', '2007-04-10T04:11:42.996577', '5624', '2'), + ('0.99', '195', '2007-04-29T07:10:30.996577', '8479', '2'), + ('0.99', '195', '2007-03-20T09:17:13.996577', '13741', '2'), + ('4.99', '195', '2007-04-30T15:58:57.996577', '9994', '1'), + ('4.99', '195', '2007-04-11T09:13:03.996577', '6175', '2'), + ('2.99', '195', '2007-03-17T09:27:26.996577', '11787', '2'), + ('6.99', '195', '2007-04-07T11:30:01.996577', '4234', '1'), + ('5.99', '195', '2007-04-30T11:51:17.996577', '9870', '1'), + ('7.99', '195', '2007-03-02T10:17:42.996577', '11201', '1'), + ('5.99', '196', '2007-02-21T03:44:36.996577', '3271', '2'), + ('6.99', '196', '2007-04-30T06:57:12.996577', '9721', '1'), + ('4.99', '196', '2007-02-20T02:01:11.996577', '2912', '2'), + ('2.99', '196', '2007-02-15T11:13:56.996577', '1348', '1'), + ('10.99', '196', '2007-04-30T19:57:54.996577', '10122', '2'), + ('4.99', '196', '2007-04-10T11:43:52.996577', '5768', '2'), + ('0.99', '196', '2007-03-19T00:16:59.996577', '12836', '2'), + ('4.99', '196', '2007-04-12T18:21:56.996577', '6857', '2'), + ('4.99', '196', '2007-04-09T06:35:33.996577', '5143', '2'), + ('5.99', '196', '2007-02-14T23:13:47.996577', '1182', '1'), + ('4.99', '196', '2007-04-30T22:57:04.996577', '10191', '1'), + ('1.99', '196', '2007-04-29T07:04:48.996577', '8472', '2'), + ('8.99', '196', '2007-03-20T11:05:08.996577', '13799', '1'), + ('4.99', '196', '2007-04-30T09:36:05.996577', '9804', '1'), + ('4.99', '196', '2007-04-08T23:41:23.996577', '4999', '2'), + ('5.99', '196', '2007-04-30T16:42:18.996577', '9346', '1'), + ('0.99', '196', '2007-03-18T09:01:07.996577', '12430', '2'), + ('2.99', '196', '2007-03-02T06:38:24.996577', '11104', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['24556', '31200', '31193', '19748', '25406', '25402', '25398', '25396', '19739', '19746', '25405', '19744', '19745', '19749', '19747', '20177', '25991', '25990', '25995', '25993', '25986', '25989', '25987', '20179', '20178', '27736', '27741', '27738', '21690', '18094', '27733', '27735', '31976', '21685', '21684', '27732', '21688', '18097', '27734', '21689', '31295', '31307', '31300', '24645', '31306', '31296', '31302', '32080', '24656', '24646', '24654', '19295', '24652', '24653', '31298', '31299', '18164', '27950', '21857', '27948', '21860', '21863', '21865', '18165', '18163', '21861', '27949', '27947', '21862', '21867', '25203', '19571', '25207', '19574', '19568', '19570', '25204', '19572', '27750', '21693', '21691', '27746', '21695', '21694', '27743', '21697', '27747', '27745', '19865', '19867', '19859', '25574', '25571', '25569', '19864', '25567', '19860', '19858', '25577', '25566']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('0.99', '196', '2007-03-18T18:19:53.996577', '12684', '2'), + ('0.99', '196', '2007-04-28T23:48:42.996577', '8266', '2'), + ('2.99', '196', '2007-04-08T18:03:21.996577', '4879', '1'), + ('0.99', '289', '2007-03-20T22:22:06.996577', '14087', '1'), + ('0.99', '289', '2007-04-27T12:15:21.996577', '7325', '2'), + ('3.99', '289', '2007-04-11T00:11:32.996577', '6007', '2'), + ('4.99', '289', '2007-04-09T04:14:06.996577', '5089', '1'), + ('2.99', '289', '2007-04-06T02:57:39.996577', '3588', '1'), + ('7.99', '289', '2007-03-01T02:33:30.996577', '10297', '2'), + ('5.99', '289', '2007-03-19T18:31:48.996577', '13336', '2'), + ('4.99', '289', '2007-04-27T06:01:11.996577', '7162', '1'), + ('0.99', '289', '2007-03-19T13:52:07.996577', '13211', '2'), + ('9.99', '289', '2007-03-19T15:22:38.996577', '13256', '2'), + ('4.99', '289', '2007-03-21T20:45:23.996577', '14729', '2'), + ('6.99', '289', '2007-03-20T14:10:31.996577', '13891', '2'), + ('2.99', '339', '2007-03-16T23:30:32.996577', '11550', '1'), + ('0.99', '339', '2007-04-11T22:23:18.996577', '6425', '1'), + ('6.99', '339', '2007-04-11T03:21:06.996577', '6072', '1'), + ('0.99', '339', '2007-04-30T02:25:58.996577', '8968', '1'), + ('2.99', '339', '2007-04-27T08:55:59.996577', '7244', '2'), + ('4.99', '339', '2007-04-07T12:08:24.996577', '4243', '1'), + ('3.99', '339', '2007-04-10T09:37:38.996577', '5720', '1'), + ('0.99', '339', '2007-04-07T22:42:18.996577', '4467', '1'), + ('5.99', '339', '2007-03-17T05:40:24.996577', '11699', '2'), + ('3.99', '339', '2007-03-17T00:32:15.996577', '11582', '2'), + ('0.99', '495', '2007-04-28T19:19:18.996577', '8151', '1'), + ('4.99', '495', '2007-04-30T07:37:48.996577', '9741', '1'), + ('5.99', '495', '2007-04-29T06:13:22.996577', '8451', '1'), + ('2.99', '495', '2007-03-23T18:44:53.996577', '15984', '1'), + ('2.99', '495', '2007-02-17T15:08:29.996577', '2074', '2'), + ('7.99', '495', '2007-04-09T22:23:03.996577', '5484', '2'), + ('2.99', '495', '2007-04-27T07:04:41.996577', '7191', '2'), + ('0.99', '495', '2007-05-14T13:44:29.996577', '13753', '2'), + ('5.99', '495', '2007-03-18T22:24:49.996577', '12782', '1'), + ('4.99', '495', '2007-03-01T19:52:03.996577', '10783', '1'), + ('2.99', '495', '2007-04-06T21:07:15.996577', '3966', '2'), + ('2.99', '495', '2007-03-19T22:33:59.996577', '13445', '2'), + ('3.99', '495', '2007-02-20T17:26:14.996577', '3129', '1'), + ('7.99', '495', '2007-04-11T22:25:04.996577', '6426', '2'), + ('4.99', '495', '2007-03-20T11:48:35.996577', '13818', '2'), + ('2.99', '211', '2007-04-07T02:38:39.996577', '4060', '2'), + ('6.99', '211', '2007-04-30T02:12:01.996577', '8961', '2'), + ('3.99', '211', '2007-04-10T08:16:30.996577', '5699', '2'), + ('4.99', '211', '2007-03-02T01:02:38.996577', '10928', '2'), + ('2.99', '211', '2007-04-28T12:41:13.996577', '7975', '1'), + ('5.99', '211', '2007-04-07T21:32:49.996577', '4441', '2'), + ('0.99', '211', '2007-04-11T22:51:27.996577', '6438', '2'), + ('4.99', '211', '2007-05-14T13:44:29.996577', '12746', '2'), + ('6.99', '211', '2007-03-23T02:36:03.996577', '15538', '2'), + ('8.99', '211', '2007-03-02T05:53:13.996577', '11076', '2'), + ('1.99', '211', '2007-03-21T23:38:58.996577', '14812', '2'), + ('8.99', '211', '2007-02-19T18:26:42.996577', '2812', '2'), + ('2.99', '211', '2007-03-20T17:32:15.996577', '13979', '1'), + ('0.99', '211', '2007-03-21T22:45:46.996577', '14782', '2'), + ('2.99', '211', '2007-04-08T17:20:33.996577', '4857', '1'), + ('5.99', '211', '2007-04-10T06:39:31.996577', '5668', '1'), + ('0.99', '514', '2007-02-19T17:16:47.996577', '2789', '1'), + ('3.99', '514', '2007-04-30T04:52:01.996577', '9038', '1'), + ('1.99', '514', '2007-03-17T04:26:20.996577', '11675', '1'), + ('2.99', '514', '2007-04-06T15:48:50.996577', '3860', '2'), + ('4.99', '514', '2007-03-18T04:10:05.996577', '12302', '1'), + ('3.99', '514', '2007-03-19T18:51:10.996577', '13344', '2'), + ('1.99', '514', '2007-03-21T08:35:00.996577', '14386', '1'), + ('2.99', '514', '2007-02-20T14:03:50.996577', '3084', '2'), + ('0.99', '514', '2007-02-18T11:59:41.996577', '2362', '2'), + ('0.99', '514', '2007-03-18T14:15:37.996577', '12578', '2'), + ('4.99', '514', '2007-04-28T05:51:17.996577', '7791', '1'), + ('5.99', '514', '2007-04-06T07:05:14.996577', '3668', '2'), + ('2.99', '514', '2007-03-18T21:02:02.996577', '12752', '1'), + ('5.99', '514', '2007-03-23T11:54:27.996577', '15776', '1'), + ('2.99', '272', '2007-04-09T07:21:35.996577', '5158', '2'), + ('0.99', '272', '2007-03-17T13:00:22.996577', '11881', '1'), + ('10.99', '272', '2007-04-30T08:54:45.996577', '9787', '2'), + ('2.99', '272', '2007-03-20T14:36:21.996577', '13903', '1'), + ('2.99', '272', '2007-03-01T17:58:47.996577', '10736', '1'), + ('8.99', '272', '2007-03-17T01:31:22.996577', '11597', '2'), + ('7.99', '272', '2007-04-27T11:18:43.996577', '7300', '2'), + ('6.99', '272', '2007-03-17T17:37:38.996577', '12006', '2'), + ('2.99', '496', '2007-04-28T22:15:45.996577', '8221', '2'), + ('3.99', '496', '2007-03-17T13:41:55.996577', '11893', '1'), + ('7.99', '496', '2007-03-02T05:16:44.996577', '11060', '1'), + ('0.99', '496', '2007-04-07T13:06:59.996577', '4269', '1'), + ('5.99', '496', '2007-03-20T03:31:25.996577', '13569', '1'), + ('4.99', '496', '2007-03-18T15:28:03.996577', '12605', '2'), + ('3.99', '496', '2007-04-06T01:45:49.996577', '3569', '2'), + ('7.99', '496', '2007-03-21T06:59:09.996577', '14332', '1'), + ('5.99', '496', '2007-04-10T01:41:33.996577', '5559', '1'), + ('4.99', '496', '2007-04-07T12:52:22.996577', '4261', '1'), + ('2.99', '302', '2007-03-23T04:05:39.996577', '15578', '2'), + ('0.99', '302', '2007-03-23T10:08:34.996577', '15734', '2'), + ('7.99', '302', '2007-03-17T21:53:47.996577', '12126', '1'), + ('7.99', '302', '2007-04-30T09:00:34.996577', '9146', '1'), + ('6.99', '302', '2007-04-29T03:38:34.996577', '8363', '1'), + ('0.99', '302', '2007-04-27T06:47:04.996577', '7183', '1'), + ('3.99', '302', '2007-03-21T04:03:43.996577', '14247', '2'), + ('4.99', '302', '2007-04-10T14:35:42.996577', '5821', '2'), + ('4.99', '302', '2007-03-18T12:08:19.996577', '12516', '2'), + ('0.99', '302', '2007-03-01T03:24:39.996577', '10329', '2'), + ('5.99', '302', '2007-04-30T01:31:33.996577', '9581', '2'), + ('0.99', '302', '2007-04-10T09:00:18.996577', '5709', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['19862', '25570', '30240', '30238', '30239', '30241', '30235', '23697', '30039', '23581', '23579', '23577', '30038', '23582', '30040', '30037', '18864', '23576', '23575', '24980', '24979', '24975', '24976', '19438', '24978', '31732', '31728', '24977', '24169', '24173', '30746', '24167', '30743', '24164', '30741', '30745', '24165', '24172', '24166', '30739', '30738', '30742', '22534', '22529', '22536', '28767', '22530', '22535', '28769', '18426', '28760', '22532', '23047', '23045', '23049', '29403', '23051', '18652', '18654', '23043', '29400', '23046', '21000', '21005', '21006', '17811', '17812', '21008', '20996', '26923', '21004', '26922', '21002', '26925', '26921', '20997', '21003', '26924', '20999', '26505', '17676', '20619', '17675', '26507', '26512', '20620', '20621', '17680', '17678', '26506', '25298', '19683', '25294', '19682', '25301', '25297', '18454', '28840', '22576', '28841']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('2.99', '302', '2007-03-20T15:11:28.996577', '13916', '1'), + ('6.99', '302', '2007-04-27T15:10:56.996577', '7411', '1'), + ('0.99', '110', '2007-04-27T20:11:30.996577', '7542', '2'), + ('4.99', '110', '2007-04-11T08:36:39.996577', '6160', '1'), + ('0.99', '110', '2007-04-27T17:35:43.996577', '7474', '1'), + ('2.99', '110', '2007-04-27T21:08:32.996577', '7570', '1'), + ('4.99', '110', '2007-04-06T02:56:18.996577', '3587', '1'), + ('3.99', '110', '2007-03-18T14:20:38.996577', '12585', '2'), + ('4.99', '93', '2007-04-11T15:28:30.996577', '6287', '2'), + ('5.99', '93', '2007-03-22T18:51:39.996577', '15324', '2'), + ('0.99', '93', '2007-03-21T02:09:01.996577', '14195', '1'), + ('8.99', '93', '2007-03-20T16:26:26.996577', '13950', '1'), + ('4.99', '93', '2007-04-09T05:58:11.996577', '5130', '2'), + ('2.99', '93', '2007-03-23T05:58:49.996577', '15631', '2'), + ('4.99', '93', '2007-04-12T05:24:50.996577', '6586', '1'), + ('2.99', '93', '2007-04-08T11:40:33.996577', '4733', '1'), + ('0.99', '93', '2007-02-20T16:02:21.996577', '3109', '1'), + ('2.99', '93', '2007-03-20T14:40:00.996577', '13904', '2'), + ('2.99', '93', '2007-03-20T02:38:16.996577', '13555', '1'), + ('6.99', '249', '2007-03-22T13:02:16.996577', '15160', '1'), + ('0.99', '249', '2007-03-21T05:19:14.996577', '14285', '2'), + ('1.99', '249', '2007-03-02T07:23:51.996577', '11124', '1'), + ('4.99', '249', '2007-03-02T08:29:21.996577', '11159', '1'), + ('1.99', '249', '2007-02-17T19:26:58.996577', '2129', '2'), + ('4.99', '249', '2007-03-20T17:35:46.996577', '13981', '2'), + ('4.99', '249', '2007-04-28T09:01:48.996577', '7881', '2'), + ('3.99', '249', '2007-04-10T05:02:05.996577', '5639', '2'), + ('0.99', '249', '2007-03-17T04:15:58.996577', '11668', '2'), + ('2.99', '154', '2007-03-21T20:50:15.996577', '14731', '2'), + ('2.99', '154', '2007-03-23T09:44:42.996577', '15721', '1'), + ('4.99', '154', '2007-04-27T05:48:00.996577', '7156', '1'), + ('0.99', '154', '2007-03-18T05:37:53.996577', '12341', '1'), + ('0.99', '154', '2007-04-11T02:00:49.996577', '6048', '1'), + ('6.99', '154', '2007-03-01T01:53:53.996577', '10278', '1'), + ('0.99', '154', '2007-04-09T04:49:55.996577', '5101', '1'), + ('4.99', '154', '2007-04-27T02:14:08.996577', '7055', '1'), + ('4.99', '154', '2007-03-01T22:27:11.996577', '10851', '1'), + ('0.99', '154', '2007-03-22T19:44:12.996577', '15351', '1'), + ('5.99', '154', '2007-03-02T13:43:53.996577', '11296', '1'), + ('2.99', '154', '2007-04-07T12:41:31.996577', '4252', '1'), + ('4.99', '154', '2007-04-07T06:34:33.996577', '4132', '2'), + ('2.99', '154', '2007-04-10T11:13:14.996577', '5760', '2'), + ('1.99', '588', '2007-03-22T10:41:24.996577', '15109', '1'), + ('4.99', '588', '2007-03-01T04:52:52.996577', '10373', '2'), + ('4.99', '588', '2007-03-22T15:05:58.996577', '15209', '1'), + ('2.99', '588', '2007-04-28T09:49:02.996577', '7903', '2'), + ('2.99', '588', '2007-03-18T00:08:40.996577', '12185', '1'), + ('2.99', '588', '2007-03-22T12:59:05.996577', '15158', '1'), + ('2.99', '588', '2007-04-29T05:40:15.996577', '8429', '1'), + ('2.99', '588', '2007-02-18T17:59:19.996577', '2453', '1'), + ('4.99', '588', '2007-04-06T04:48:09.996577', '3628', '1'), + ('4.99', '588', '2007-03-19T08:15:19.996577', '13064', '1'), + ('0.99', '37', '2007-03-20T22:11:12.996577', '14084', '1'), + ('3.99', '37', '2007-03-20T00:02:02.996577', '13493', '2'), + ('3.99', '37', '2007-03-22T07:32:10.996577', '15028', '1'), + ('9.99', '37', '2007-04-29T05:23:14.996577', '8419', '1'), + ('0.99', '37', '2007-03-23T20:36:30.996577', '16035', '2'), + ('4.99', '37', '2007-02-16T03:12:49.996577', '1583', '1'), + ('3.99', '37', '2007-02-16T23:12:23.996577', '1854', '2'), + ('4.99', '37', '2007-03-19T11:23:35.996577', '13147', '2'), + ('5.99', '37', '2007-04-06T10:08:53.996577', '3734', '1'), + ('8.99', '37', '2007-03-20T19:48:02.996577', '14025', '2'), + ('9.99', '422', '2007-03-19T02:44:39.996577', '12907', '1'), + ('4.99', '422', '2007-03-22T01:16:31.996577', '14861', '1'), + ('3.99', '422', '2007-03-22T17:18:06.996577', '15272', '1'), + ('2.99', '422', '2007-02-19T14:50:33.996577', '2747', '2'), + ('5.99', '422', '2007-02-19T16:46:38.996577', '2778', '1'), + ('2.99', '422', '2007-03-22T18:35:29.996577', '15316', '2'), + ('6.99', '422', '2007-03-01T21:54:21.996577', '10833', '2'), + ('1.99', '422', '2007-04-10T12:31:54.996577', '5784', '1'), + ('4.99', '422', '2007-03-20T08:32:11.996577', '13722', '2'), + ('0.99', '422', '2007-04-08T00:47:53.996577', '4504', '2'), + ('1.99', '422', '2007-03-20T05:20:29.996577', '13625', '2'), + ('4.99', '422', '2007-04-28T21:48:57.996577', '8206', '2'), + ('2.99', '422', '2007-04-07T22:33:25.996577', '4463', '2'), + ('6.99', '422', '2007-03-02T15:01:37.996577', '11325', '2'), + ('0.99', '422', '2007-03-20T08:03:17.996577', '13709', '2'), + ('0.99', '422', '2007-04-28T07:05:48.996577', '7827', '2'), + ('4.99', '422', '2007-03-17T11:42:03.996577', '11842', '1'), + ('0.99', '384', '2007-04-07T20:43:09.996577', '4424', '2'), + ('0.99', '384', '2007-02-17T11:08:16.996577', '2020', '2'), + ('5.99', '384', '2007-03-17T08:48:17.996577', '11773', '2'), + ('0.99', '384', '2007-02-17T07:31:24.996577', '1961', '1'), + ('4.99', '384', '2007-04-10T03:36:52.996577', '5608', '1'), + ('1.99', '384', '2007-04-29T06:06:14.996577', '8445', '1'), + ('2.99', '384', '2007-03-20T01:10:54.996577', '13521', '2'), + ('2.99', '384', '2007-03-21T09:40:12.996577', '14416', '2'), + ('9.99', '384', '2007-02-20T14:24:31.996577', '3088', '1'), + ('5.99', '384', '2007-02-18T22:12:47.996577', '2510', '2'), + ('0.99', '384', '2007-04-09T12:03:58.996577', '5250', '2'), + ('2.99', '281', '2007-04-27T01:32:03.996577', '7034', '2'), + ('1.99', '281', '2007-03-21T02:09:06.996577', '14196', '1'), + ('0.99', '281', '2007-04-08T05:43:40.996577', '4607', '1'), + ('2.99', '281', '2007-03-20T06:03:08.996577', '13641', '1'), + ('4.99', '281', '2007-04-28T20:33:50.996577', '8180', '2'), + ('0.99', '281', '2007-04-12T16:56:38.996577', '6825', '2'), + ('0.99', '594', '2007-02-19T17:15:09.996577', '2786', '2'), + ('0.99', '594', '2007-04-05T21:28:19.996577', '3474', '2'), + ('8.99', '594', '2007-03-01T17:06:28.996577', '10704', '2'), + ('4.99', '594', '2007-04-06T00:46:20.996577', '3546', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['18451', '28843', '22578', '18455', '28853', '28851', '28846', '19690', '25320', '25322', '19693', '25321', '25325', '25331', '25326', '25324', '25317', '25323', '19688', '25318', '25327', '30897', '24290', '30898', '30913', '24294', '19144', '30904', '24293', '30905', '30910', '24297', '30912', '30901', '32064', '24295', '26952', '26948', '21019', '21018', '26941', '21024', '21017', '26943', '21025', '31960', '26955', '26945', '17818', '21022', '17819', '21020', '26947', '28171', '28179', '22037', '28174', '28177', '28176', '28170', '18232', '22033', '28180', '22035', '22042', '31643', '24902', '19408', '31652', '31646', '24912', '31638', '31644', '31649', '31648', '31640', '31641', '24911', '19409', '31651', '21929', '21933', '21932', '21927', '21926', '28027', '28023', '21934', '28021', '19413', '24922', '24919', '24927', '24925', '31654', '31655', '19416', '24915', '24916', '31656']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('4.99', '594', '2007-02-16T19:49:07.996577', '1816', '1'), + ('5.99', '594', '2007-04-07T01:21:18.996577', '4037', '1'), + ('4.99', '594', '2007-03-22T06:23:13.996577', '14999', '1'), + ('1.99', '594', '2007-02-21T06:02:06.996577', '3302', '2'), + ('4.99', '594', '2007-04-30T09:32:46.996577', '9802', '2'), + ('7.99', '594', '2007-04-30T00:14:50.996577', '9545', '1'), + ('6.99', '594', '2007-04-12T00:04:06.996577', '6473', '1'), + ('0.99', '283', '2007-03-17T16:08:30.996577', '11966', '2'), + ('0.99', '283', '2007-04-06T07:30:22.996577', '3672', '2'), + ('1.99', '283', '2007-04-08T17:56:16.996577', '4876', '2'), + ('2.99', '283', '2007-03-23T13:58:07.996577', '15837', '1'), + ('2.99', '283', '2007-04-08T09:06:54.996577', '4683', '2'), + ('1.99', '283', '2007-04-11T16:18:35.996577', '6300', '1'), + ('2.99', '283', '2007-04-30T21:41:19.996577', '9478', '2'), + ('0.99', '283', '2007-04-11T16:58:18.996577', '6313', '2'), + ('0.99', '283', '2007-04-11T03:31:29.996577', '6075', '1'), + ('4.99', '283', '2007-04-06T00:00:53.996577', '3534', '1'), + ('2.99', '283', '2007-04-10T23:26:19.996577', '5989', '2'), + ('0.99', '283', '2007-03-17T03:05:05.996577', '11637', '1'), + ('6.99', '283', '2007-04-06T01:40:23.996577', '3568', '1'), + ('4.99', '283', '2007-04-12T17:02:11.996577', '6827', '1'), + ('2.99', '168', '2007-04-05T23:51:11.996577', '3530', '1'), + ('0.99', '168', '2007-03-16T23:32:15.996577', '11551', '1'), + ('5.99', '168', '2007-04-07T15:57:42.996577', '4308', '1'), + ('4.99', '168', '2007-04-30T12:41:02.996577', '9899', '2'), + ('2.99', '168', '2007-03-18T22:18:50.996577', '12781', '1'), + ('4.99', '168', '2007-02-15T02:07:15.996577', '1222', '2'), + ('0.99', '168', '2007-04-11T23:04:28.996577', '6444', '2'), + ('6.99', '168', '2007-03-18T12:56:26.996577', '12545', '1'), + ('3.99', '168', '2007-04-12T16:20:20.996577', '6809', '2'), + ('4.99', '168', '2007-04-30T11:00:02.996577', '9197', '2'), + ('0.99', '168', '2007-03-20T11:28:56.996577', '13811', '2'), + ('6.99', '168', '2007-04-30T11:29:19.996577', '9857', '2'), + ('0.99', '168', '2007-04-09T21:12:22.996577', '5459', '1'), + ('0.99', '168', '2007-05-14T13:44:29.996577', '15894', '1'), + ('8.99', '168', '2007-03-19T06:33:16.996577', '13018', '1'), + ('4.99', '424', '2007-04-30T21:31:02.996577', '9471', '1'), + ('2.99', '424', '2007-04-28T21:20:10.996577', '8194', '2'), + ('2.99', '424', '2007-03-02T16:43:20.996577', '11374', '2'), + ('2.99', '424', '2007-03-01T22:51:15.996577', '10866', '1'), + ('0.99', '424', '2007-04-08T01:07:22.996577', '4512', '2'), + ('0.99', '424', '2007-03-22T10:52:25.996577', '15113', '2'), + ('4.99', '424', '2007-03-01T04:42:10.996577', '10369', '2'), + ('5.99', '424', '2007-04-08T09:40:53.996577', '4696', '2'), + ('9.99', '424', '2007-03-23T17:15:10.996577', '15941', '2'), + ('0.99', '424', '2007-05-14T13:44:29.996577', '15094', '1'), + ('6.99', '424', '2007-04-30T16:41:48.996577', '10017', '1'), + ('3.99', '424', '2007-04-10T03:42:09.996577', '5611', '1'), + ('4.99', '424', '2007-02-20T11:07:15.996577', '3044', '2'), + ('0.99', '424', '2007-03-18T20:21:25.996577', '12729', '2'), + ('6.99', '424', '2007-02-20T20:00:58.996577', '3166', '1'), + ('6.99', '424', '2007-03-16T23:52:05.996577', '11562', '2'), + ('2.99', '424', '2007-04-27T21:59:07.996577', '7594', '1'), + ('0.99', '533', '2007-04-12T17:22:03.996577', '6834', '2'), + ('1.99', '533', '2007-04-29T19:08:15.996577', '8786', '2'), + ('2.99', '533', '2007-03-17T14:37:08.996577', '11918', '1'), + ('8.99', '533', '2007-04-28T16:57:42.996577', '8093', '1'), + ('2.99', '533', '2007-04-29T07:00:37.996577', '8471', '1'), + ('2.99', '533', '2007-04-28T23:17:41.996577', '8250', '2'), + ('2.99', '533', '2007-04-12T14:50:13.996577', '6781', '2'), + ('0.99', '533', '2007-02-16T23:42:04.996577', '1859', '1'), + ('2.99', '533', '2007-03-01T05:03:02.996577', '10380', '1'), + ('3.99', '533', '2007-04-30T18:50:27.996577', '10090', '2'), + ('7.99', '533', '2007-03-16T22:39:21.996577', '11524', '2'), + ('0.99', '533', '2007-03-23T19:29:35.996577', '16006', '2'), + ('3.99', '241', '2007-04-10T00:31:34.996577', '5525', '2'), + ('3.99', '241', '2007-03-01T07:33:24.996577', '10447', '2'), + ('0.99', '241', '2007-02-18T18:01:32.996577', '2455', '1'), + ('5.99', '241', '2007-04-30T14:13:09.996577', '9944', '1'), + ('2.99', '241', '2007-04-11T13:25:23.996577', '6245', '2'), + ('2.99', '241', '2007-03-22T22:48:57.996577', '15429', '1'), + ('0.99', '241', '2007-04-06T14:09:41.996577', '3822', '2'), + ('4.99', '241', '2007-04-10T22:47:30.996577', '5981', '1'), + ('2.99', '241', '2007-04-28T08:26:28.996577', '7860', '1'), + ('2.99', '241', '2007-04-27T16:03:06.996577', '7434', '1'), + ('2.99', '241', '2007-04-09T00:28:42.996577', '5017', '2'), + ('0.99', '241', '2007-04-09T09:55:16.996577', '5211', '1'), + ('2.99', '241', '2007-03-22T11:48:54.996577', '15137', '2'), + ('5.99', '241', '2007-02-18T19:29:47.996577', '2478', '2'), + ('3.99', '241', '2007-04-30T23:33:30.996577', '9528', '1'), + ('2.99', '521', '2007-03-20T01:29:13.996577', '13527', '1'), + ('4.99', '521', '2007-03-22T13:50:41.996577', '15170', '2'), + ('5.99', '521', '2007-03-21T20:57:39.996577', '14738', '2'), + ('4.99', '521', '2007-03-17T20:41:41.996577', '12082', '2'), + ('3.99', '521', '2007-03-17T16:13:26.996577', '11967', '1'), + ('7.99', '521', '2007-04-30T00:41:56.996577', '9556', '1'), + ('4.99', '521', '2007-04-09T21:04:15.996577', '5458', '2'), + ('2.99', '521', '2007-03-22T19:01:05.996577', '15329', '2'), + ('2.99', '521', '2007-04-07T21:25:56.996577', '4439', '2'), + ('4.99', '242', '2007-02-15T13:50:29.996577', '1384', '1'), + ('4.99', '242', '2007-03-19T00:47:24.996577', '12855', '1'), + ('0.99', '242', '2007-03-17T02:04:32.996577', '11607', '2'), + ('0.99', '242', '2007-03-22T06:34:26.996577', '15002', '1'), + ('5.99', '242', '2007-03-20T06:15:34.996577', '13646', '2'), + ('0.99', '242', '2007-04-06T03:53:48.996577', '3604', '2'), + ('4.99', '242', '2007-04-07T20:56:58.996577', '4426', '1'), + ('4.99', '242', '2007-02-19T11:35:16.996577', '2691', '1'), + ('4.99', '242', '2007-03-01T05:05:11.996577', '10382', '2'), + ('9.99', '242', '2007-03-01T14:47:11.996577', '10650', '2'), + ('1.99', '242', '2007-04-08T18:50:31.996577', '4895', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['24920', '24924', '19417', '31659', '19412', '24918', '24926', '20560', '17647', '26449', '20558', '26448', '26444', '26445', '17645', '20562', '22205', '28357', '28354', '18294', '28356', '28351', '22206', '22208', '18293', '22213', '28358', '22207', '23552', '29998', '18855', '29991', '23546', '23550', '23554', '18853', '23551', '23553', '29990', '23549', '23548', '23547', '29992', '19482', '25087', '19480', '19481', '31835', '19483', '19485', '25092', '31843', '25094', '25089', '25088', '31841', '25086', '18998', '23889', '30461', '19001', '30460', '30452', '23890', '30448', '23895', '23885', '23893', '30458', '18997', '19000', '30453', '18999', '30451', '20046', '25821', '25822', '25814', '20039', '25812', '25811', '25818', '20044', '25819', '25810', '20041', '25815', '20040', '25813', '25817', '20042', '27063', '27068', '21098', '27069', '27061', '21104', '21103', '27062', '27065']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('4.99', '242', '2007-03-17T15:03:40.996577', '11931', '1'), + ('0.99', '242', '2007-03-20T03:17:47.996577', '13567', '2'), + ('4.99', '242', '2007-02-20T03:55:57.996577', '2942', '2'), + ('4.99', '242', '2007-04-29T07:30:39.996577', '8491', '1'), + ('4.99', '242', '2007-02-15T08:24:28.996577', '1304', '2'), + ('4.99', '242', '2007-03-02T12:14:05.996577', '11258', '1'), + ('0.99', '242', '2007-03-21T13:20:40.996577', '14515', '1'), + ('2.99', '378', '2007-03-18T14:58:01.996577', '12596', '1'), + ('4.99', '378', '2007-02-19T12:51:35.996577', '2713', '2'), + ('2.99', '378', '2007-04-29T17:09:57.996577', '8740', '2'), + ('4.99', '378', '2007-03-02T00:34:44.996577', '10917', '1'), + ('0.99', '378', '2007-04-28T09:08:50.996577', '7888', '1'), + ('4.99', '378', '2007-04-06T11:15:04.996577', '3759', '1'), + ('0.99', '378', '2007-04-08T12:52:07.996577', '4755', '2'), + ('5.99', '378', '2007-02-16T08:42:01.996577', '1662', '1'), + ('4.99', '378', '2007-03-21T12:50:54.996577', '14502', '2'), + ('1.99', '552', '2007-03-02T08:13:58.996577', '11146', '1'), + ('5.99', '552', '2007-04-29T12:00:31.996577', '8614', '2'), + ('2.99', '552', '2007-04-28T05:27:35.996577', '7772', '1'), + ('4.99', '552', '2007-02-21T13:58:37.996577', '3397', '2'), + ('2.99', '552', '2007-04-28T21:17:37.996577', '8192', '2'), + ('6.99', '552', '2007-04-07T23:06:50.996577', '4477', '1'), + ('4.99', '552', '2007-03-02T10:25:20.996577', '11205', '2'), + ('4.99', '552', '2007-03-18T09:06:15.996577', '12433', '2'), + ('0.99', '552', '2007-02-18T07:53:16.996577', '2320', '2'), + ('2.99', '552', '2007-03-23T08:49:47.996577', '15700', '2'), + ('4.99', '552', '2007-04-29T23:16:57.996577', '8894', '2'), + ('7.99', '552', '2007-03-02T14:06:08.996577', '11300', '2'), + ('0.99', '90', '2007-03-22T08:58:10.996577', '15061', '2'), + ('2.99', '90', '2007-04-28T14:24:06.996577', '8024', '1'), + ('0.99', '90', '2007-02-20T17:38:12.996577', '3132', '2'), + ('4.99', '90', '2007-04-07T18:35:11.996577', '4371', '2'), + ('0.99', '90', '2007-03-16T22:23:13.996577', '11516', '1'), + ('1.99', '90', '2007-03-21T16:25:48.996577', '14608', '1'), + ('7.99', '90', '2007-03-23T07:45:05.996577', '15674', '1'), + ('0.99', '90', '2007-02-17T11:53:09.996577', '2033', '2'), + ('4.99', '90', '2007-03-21T23:26:09.996577', '14807', '1'), + ('0.99', '90', '2007-03-22T15:26:57.996577', '15217', '2'), + ('3.99', '90', '2007-04-06T09:58:55.996577', '3729', '2'), + ('4.99', '90', '2007-03-19T07:59:59.996577', '13051', '1'), + ('2.99', '90', '2007-03-18T22:43:35.996577', '12788', '1'), + ('0.99', '90', '2007-03-17T18:17:21.996577', '12019', '2'), + ('0.99', '90', '2007-04-09T12:54:27.996577', '5272', '2'), + ('0.99', '260', '2007-02-17T23:07:01.996577', '2178', '1'), + ('0.99', '260', '2007-03-19T00:41:06.996577', '12852', '1'), + ('2.99', '260', '2007-02-17T12:47:03.996577', '2040', '2'), + ('10.99', '260', '2007-02-17T16:37:30.996577', '2091', '1'), + ('0.99', '260', '2007-04-07T02:10:33.996577', '4054', '2'), + ('7.99', '260', '2007-02-19T18:58:47.996577', '2823', '1'), + ('0.99', '260', '2007-02-20T22:20:56.996577', '3193', '1'), + ('2.99', '260', '2007-03-20T20:00:24.996577', '14035', '2'), + ('2.99', '260', '2007-04-29T07:20:25.996577', '8484', '1'), + ('7.99', '260', '2007-03-21T15:23:13.996577', '14579', '1'), + ('3.99', '260', '2007-03-20T07:25:37.996577', '13685', '1'), + ('2.99', '260', '2007-03-19T22:11:18.996577', '13440', '2'), + ('7.99', '260', '2007-04-28T09:06:07.996577', '7885', '1'), + ('8.99', '260', '2007-03-02T02:35:12.996577', '10970', '2'), + ('3.99', '129', '2007-02-19T13:31:05.996577', '2727', '1'), + ('4.99', '129', '2007-03-18T20:16:14.996577', '12728', '2'), + ('7.99', '129', '2007-04-30T16:55:02.996577', '10024', '1'), + ('4.99', '129', '2007-02-20T21:24:21.996577', '3183', '1'), + ('7.99', '129', '2007-04-30T15:38:02.996577', '9983', '1'), + ('0.99', '129', '2007-04-08T05:21:06.996577', '4602', '1'), + ('10.99', '129', '2007-03-20T06:23:20.996577', '13653', '2'), + ('0.99', '129', '2007-04-06T08:11:27.996577', '3689', '1'), + ('1.99', '129', '2007-03-22T05:15:25.996577', '14968', '2'), + ('2.99', '129', '2007-03-01T08:48:11.996577', '10483', '1'), + ('0.99', '129', '2007-03-20T16:45:00.996577', '13961', '1'), + ('2.99', '129', '2007-04-29T03:16:03.996577', '8345', '1'), + ('0.99', '129', '2007-02-16T14:03:07.996577', '1732', '2'), + ('4.99', '129', '2007-02-19T17:27:19.996577', '2795', '2'), + ('2.99', '129', '2007-04-08T18:51:41.996577', '4896', '1'), + ('0.99', '129', '2007-02-19T16:15:18.996577', '2768', '2'), + ('2.99', '129', '2007-04-07T12:43:02.996577', '4256', '2'), + ('4.99', '324', '2007-03-22T16:55:59.996577', '15263', '1'), + ('4.99', '324', '2007-04-30T04:17:15.996577', '9651', '1'), + ('2.99', '324', '2007-04-30T23:30:01.996577', '10212', '2'), + ('0.99', '324', '2007-04-10T12:10:03.996577', '5778', '1'), + ('2.99', '324', '2007-03-17T02:29:06.996577', '11617', '1'), + ('4.99', '324', '2007-04-07T18:23:45.996577', '4368', '2'), + ('0.99', '324', '2007-04-07T09:36:18.996577', '4197', '1'), + ('7.99', '324', '2007-04-27T09:45:48.996577', '7263', '1'), + ('8.99', '324', '2007-03-21T04:36:39.996577', '14262', '1'), + ('6.99', '324', '2007-04-28T12:15:34.996577', '7960', '2'), + ('4.99', '324', '2007-04-06T20:10:47.996577', '3947', '1'), + ('2.99', '324', '2007-03-18T12:52:21.996577', '12543', '2'), + ('2.99', '324', '2007-04-11T01:29:16.996577', '6034', '1'), + ('6.99', '324', '2007-03-17T08:45:35.996577', '11771', '1'), + ('2.99', '324', '2007-04-10T08:28:27.996577', '5702', '2'), + ('3.99', '324', '2007-04-27T08:49:41.996577', '7240', '2'), + ('0.99', '324', '2007-03-19T19:30:47.996577', '13356', '2'), + ('4.99', '435', '2007-04-09T10:27:30.996577', '5220', '2'), + ('0.99', '435', '2007-04-30T13:30:59.996577', '9269', '2'), + ('2.99', '435', '2007-03-02T04:32:19.996577', '11041', '1'), + ('3.99', '435', '2007-04-30T04:26:20.996577', '9655', '1'), + ('0.99', '435', '2007-04-06T08:14:29.996577', '3690', '1'), + ('4.99', '435', '2007-03-21T19:16:31.996577', '14696', '1'), + ('0.99', '435', '2007-03-19T13:47:21.996577', '13208', '2'), + ('8.99', '435', '2007-04-06T18:54:41.996577', '3918', '1'), + ('2.99', '435', '2007-04-26T21:41:36.996577', '6935', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['21097', '21106', '22082', '28233', '22090', '18253', '22087', '22085', '28223', '28236', '28226', '18252', '22083', '28230', '22089', '28231', '28235', '28227', '22084', '22086', '18250', '22318', '22314', '22312', '28483', '28484', '22321', '22319', '28476', '22313', '22317', '22320', '19267', '19268', '31212', '31208', '24566', '24567', '24569', '24565', '19270', '19269', '31213', '24575', '24562', '24570', '24577', '24568', '31209', '27160', '27159', '27150', '21167', '21172', '21170', '27156', '21175', '27149', '17885', '27162', '30562', '30568', '23974', '30561', '30559', '30563', '30558', '23983', '23986', '23981', '19517', '31915', '31916', '19510', '19516', '19522', '19526', '19527', '19520', '19521', '25163', '31918', '19529', '26684', '31914', '19515', '31911', '19511', '28630', '24140', '30715', '24135', '19089', '24142', '30713', '24136', '30719', '19091', '24134', '24133']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('6.99', '435', '2007-03-02T03:19:21.996577', '10998', '1'), + ('0.99', '435', '2007-03-22T00:45:21.996577', '14850', '1'), + ('3.99', '538', '2007-03-01T16:56:43.996577', '10701', '2'), + ('0.99', '538', '2007-04-30T15:21:09.996577', '9307', '1'), + ('6.99', '538', '2007-03-22T19:29:51.996577', '15343', '1'), + ('2.99', '538', '2007-02-20T21:47:59.996577', '3189', '2'), + ('4.99', '538', '2007-03-20T10:14:20.996577', '13770', '2'), + ('5.99', '538', '2007-03-17T20:48:55.996577', '12089', '2'), + ('4.99', '538', '2007-04-06T01:05:36.996577', '3554', '2'), + ('8.99', '538', '2007-04-30T13:57:26.996577', '9939', '2'), + ('2.99', '538', '2007-04-09T22:26:10.996577', '5486', '1'), + ('4.99', '538', '2007-02-19T10:46:43.996577', '2682', '1'), + ('5.99', '538', '2007-03-01T17:53:44.996577', '10732', '1'), + ('0.99', '538', '2007-04-26T21:42:00.996577', '6936', '2'), + ('0.99', '538', '2007-03-21T15:58:35.996577', '14591', '1'), + ('0.99', '538', '2007-04-28T02:07:51.996577', '7694', '1'), + ('4.99', '538', '2007-04-30T12:40:23.996577', '9897', '2'), + ('2.99', '538', '2007-04-10T18:46:35.996577', '5898', '1'), + ('4.99', '538', '2007-03-02T02:16:39.996577', '10962', '1'), + ('1.99', '538', '2007-03-20T02:12:52.996577', '13544', '1'), + ('5.99', '538', '2007-02-15T08:50:11.996577', '1314', '1'), + ('0.99', '564', '2007-03-20T02:41:43.996577', '13558', '2'), + ('2.99', '564', '2007-03-17T08:30:55.996577', '11768', '2'), + ('4.99', '564', '2007-03-01T05:55:35.996577', '10401', '2'), + ('2.99', '564', '2007-04-30T13:45:50.996577', '9929', '2'), + ('6.99', '564', '2007-04-30T20:10:01.996577', '10129', '1'), + ('0.99', '564', '2007-03-21T16:01:44.996577', '14593', '1'), + ('0.99', '564', '2007-03-20T07:55:31.996577', '13701', '1'), + ('2.99', '564', '2007-04-07T09:34:59.996577', '4196', '1'), + ('2.99', '564', '2007-03-01T10:24:48.996577', '10528', '1'), + ('0.99', '564', '2007-03-19T18:19:26.996577', '13324', '2'), + ('5.99', '564', '2007-03-21T10:21:07.996577', '14439', '2'), + ('2.99', '197', '2007-02-15T20:35:35.996577', '1503', '1'), + ('8.99', '197', '2007-02-16T04:46:21.996577', '1605', '2'), + ('2.99', '197', '2007-04-28T19:51:32.996577', '8165', '1'), + ('8.99', '197', '2007-04-07T23:37:35.996577', '4486', '1'), + ('4.99', '197', '2007-03-02T03:56:19.996577', '11018', '1'), + ('4.99', '197', '2007-03-02T10:49:08.996577', '11215', '1'), + ('2.99', '197', '2007-03-02T20:37:31.996577', '11478', '1'), + ('2.99', '197', '2007-03-01T18:23:35.996577', '10743', '1'), + ('2.99', '197', '2007-02-17T16:34:40.996577', '2090', '1'), + ('4.99', '197', '2007-02-17T04:09:18.996577', '1919', '2'), + ('4.99', '197', '2007-04-30T17:41:20.996577', '9378', '2'), + ('2.99', '197', '2007-03-22T09:37:57.996577', '15078', '1'), + ('3.99', '197', '2007-03-01T07:59:26.996577', '10460', '2'), + ('1.99', '197', '2007-03-17T03:18:01.996577', '11643', '1'), + ('8.99', '197', '2007-03-23T02:41:18.996577', '15540', '1'), + ('4.99', '197', '2007-03-02T14:22:14.996577', '11311', '1'), + ('4.99', '197', '2007-04-08T11:54:23.996577', '4739', '2'), + ('2.99', '442', '2007-04-28T15:17:38.996577', '8044', '1'), + ('2.99', '442', '2007-04-28T01:16:57.996577', '7671', '1'), + ('2.99', '442', '2007-04-06T06:38:28.996577', '3661', '1'), + ('6.99', '442', '2007-03-01T04:37:10.996577', '10365', '2'), + ('0.99', '442', '2007-03-21T02:17:09.996577', '14199', '2'), + ('0.99', '442', '2007-03-19T06:08:34.996577', '13004', '2'), + ('2.99', '442', '2007-04-12T08:01:36.996577', '6632', '2'), + ('2.99', '442', '2007-03-22T15:03:51.996577', '15207', '2'), + ('4.99', '442', '2007-04-06T00:44:43.996577', '3545', '2'), + ('0.99', '442', '2007-02-15T11:57:14.996577', '1358', '2'), + ('4.99', '442', '2007-04-30T10:31:41.996577', '9180', '1'), + ('2.99', '138', '2007-04-28T04:39:21.996577', '7754', '1'), + ('9.99', '138', '2007-04-30T14:18:06.996577', '9947', '1'), + ('3.99', '138', '2007-03-01T01:37:22.996577', '10268', '1'), + ('2.99', '138', '2007-04-27T07:44:54.996577', '7208', '1'), + ('2.99', '138', '2007-04-11T23:37:18.996577', '6458', '1'), + ('4.99', '138', '2007-04-28T17:56:49.996577', '8123', '2'), + ('4.99', '138', '2007-04-10T07:12:28.996577', '5679', '1'), + ('4.99', '138', '2007-03-21T12:21:20.996577', '14486', '2'), + ('0.99', '138', '2007-03-23T01:08:22.996577', '15501', '1'), + ('1.99', '138', '2007-03-21T02:08:37.996577', '14194', '1'), + ('0.99', '267', '2007-02-20T14:28:45.996577', '3090', '2'), + ('4.99', '267', '2007-04-28T21:15:32.996577', '8190', '1'), + ('1.99', '267', '2007-04-29T10:19:50.996577', '8572', '1'), + ('4.99', '267', '2007-02-15T11:17:28.996577', '1349', '2'), + ('1.99', '267', '2007-02-19T23:35:42.996577', '2877', '1'), + ('4.99', '267', '2007-03-18T04:55:17.996577', '12320', '1'), + ('3.99', '267', '2007-03-22T07:22:38.996577', '15020', '2'), + ('3.99', '267', '2007-03-22T15:04:13.996577', '15208', '1'), + ('0.99', '267', '2007-03-02T16:42:38.996577', '11373', '2'), + ('6.99', '267', '2007-03-17T05:12:48.996577', '11690', '1'), + ('2.99', '267', '2007-04-30T09:42:18.996577', '9807', '2'), + ('0.00', '267', '2007-05-14T13:44:29.996577', '13713', '2'), + ('3.99', '267', '2007-03-23T15:59:06.996577', '15903', '1'), + ('3.99', '267', '2007-04-30T05:47:10.996577', '9059', '2'), + ('3.99', '267', '2007-04-12T11:27:42.996577', '6706', '1'), + ('4.99', '267', '2007-02-19T15:24:25.996577', '2754', '2'), + ('2.99', '267', '2007-04-06T14:00:11.996577', '3817', '1'), + ('2.99', '267', '2007-02-18T04:31:53.996577', '2265', '2'), + ('4.99', '267', '2007-04-30T18:47:19.996577', '9403', '2'), + ('4.99', '151', '2007-03-22T15:51:07.996577', '15227', '1'), + ('3.99', '151', '2007-04-27T12:27:23.996577', '7332', '2'), + ('2.99', '151', '2007-03-17T06:03:21.996577', '11714', '2'), + ('3.99', '151', '2007-02-20T09:37:22.996577', '3017', '1'), + ('2.99', '151', '2007-03-23T19:00:04.996577', '15996', '2'), + ('0.99', '151', '2007-04-12T18:07:23.996577', '6854', '2'), + ('0.99', '151', '2007-03-19T14:40:33.996577', '13230', '2'), + ('2.99', '151', '2007-04-30T18:30:28.996577', '10078', '1'), + ('2.99', '151', '2007-02-21T13:39:16.996577', '3390', '2'), + ('2.99', '151', '2007-03-01T15:19:23.996577', '10662', '1'), + ('4.99', '151', '2007-03-01T02:56:25.996577', '10311', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['30717', '24139', '19087', '30710', '28538', '28535', '22362', '22374', '22366', '22360', '22364', '22361', '28533', '22372', '22365', '22368', '21422', '27393', '21418', '21414', '21417', '27391', '27395', '17996', '17992', '27392', '27397', '29695', '29693', '29709', '23296', '23298', '29701', '18753', '29694', '29706', '29699', '23300', '30865', '30868', '19135', '24267', '24266', '24262', '30864', '24264', '19960', '19959', '19958', '25689', '25690', '25691', '19965', '25693', '27619', '21600', '27615', '27627', '21603', '27626', '27624', '27618', '27620', '21601', '27631', '18065', '27625', '21605', '21606', '27622', '18064', '27629', '29739', '18764', '23326', '29736', '23328', '23325', '23324', '28859', '28863', '28860', '28872', '28867', '28869', '28865', '28854', '22584', '22582', '24308', '19145', '24302', '30920', '30914', '24306', '30921', '30922', '17701', '20674', '26553']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('4.99', '151', '2007-04-30T12:33:10.996577', '9890', '1'), + ('3.99', '151', '2007-03-22T03:41:31.996577', '14922', '2'), + ('2.99', '151', '2007-02-18T19:20:00.996577', '2474', '2'), + ('2.99', '151', '2007-04-07T18:52:59.996577', '4376', '1'), + ('4.99', '569', '2007-04-30T18:43:16.996577', '9399', '1'), + ('5.99', '569', '2007-04-11T01:50:15.996577', '6046', '2'), + ('4.99', '569', '2007-03-02T12:12:56.996577', '11255', '2'), + ('2.99', '569', '2007-03-22T04:58:54.996577', '14959', '1'), + ('0.99', '569', '2007-03-18T04:17:19.996577', '12308', '2'), + ('0.99', '569', '2007-03-01T23:15:59.996577', '10884', '2'), + ('4.99', '569', '2007-03-17T15:34:19.996577', '11946', '1'), + ('1.99', '569', '2007-03-02T04:19:46.996577', '11030', '1'), + ('5.99', '569', '2007-04-07T09:52:44.996577', '4204', '1'), + ('0.99', '569', '2007-03-21T09:02:11.996577', '14400', '2'), + ('2.99', '569', '2007-03-17T23:02:11.996577', '12157', '1'), + ('2.99', '569', '2007-03-19T04:47:47.996577', '12958', '2'), + ('7.99', '466', '2007-03-23T19:28:48.996577', '16005', '1'), + ('6.99', '466', '2007-04-11T03:22:57.996577', '6073', '1'), + ('5.99', '466', '2007-03-20T13:59:17.996577', '13884', '1'), + ('0.99', '466', '2007-03-02T15:40:56.996577', '11343', '2'), + ('2.99', '466', '2007-03-19T23:35:40.996577', '13478', '1'), + ('0.99', '466', '2007-04-09T02:14:59.996577', '5048', '2'), + ('0.99', '466', '2007-04-29T00:07:09.996577', '8276', '2'), + ('2.99', '466', '2007-02-21T09:25:25.996577', '3343', '2'), + ('7.99', '466', '2007-02-16T19:28:01.996577', '1808', '2'), + ('4.99', '466', '2007-04-10T07:58:15.996577', '5691', '1'), + ('2.99', '466', '2007-04-30T12:59:04.996577', '9257', '1'), + ('3.99', '64', '2007-04-09T05:35:31.996577', '5114', '1'), + ('5.99', '64', '2007-04-08T15:47:41.996577', '4819', '2'), + ('0.99', '64', '2007-04-30T22:40:37.996577', '10185', '2'), + ('4.99', '64', '2007-03-01T23:22:59.996577', '10889', '1'), + ('2.99', '64', '2007-03-20T10:18:40.996577', '13773', '1'), + ('0.99', '64', '2007-04-12T12:58:54.996577', '6744', '2'), + ('2.99', '64', '2007-02-17T14:11:08.996577', '2060', '1'), + ('5.99', '64', '2007-04-08T22:23:15.996577', '4971', '2'), + ('2.99', '64', '2007-04-30T10:30:15.996577', '9832', '1'), + ('0.99', '64', '2007-04-11T23:35:01.996577', '6457', '2'), + ('5.99', '64', '2007-03-21T01:28:14.996577', '14167', '1'), + ('2.99', '165', '2007-04-27T02:34:50.996577', '7074', '1'), + ('4.99', '165', '2007-04-30T05:17:44.996577', '9685', '2'), + ('3.99', '165', '2007-02-17T10:31:27.996577', '2013', '1'), + ('5.99', '165', '2007-03-23T13:52:16.996577', '15834', '2'), + ('3.99', '165', '2007-03-23T12:54:30.996577', '15801', '1'), + ('4.99', '165', '2007-03-01T11:36:53.996577', '10565', '1'), + ('0.99', '165', '2007-04-10T22:37:43.996577', '5973', '1'), + ('4.99', '165', '2007-03-18T16:49:32.996577', '12643', '2'), + ('2.99', '313', '2007-03-17T12:11:18.996577', '11854', '2'), + ('7.99', '313', '2007-03-02T01:19:15.996577', '10933', '2'), + ('5.99', '313', '2007-03-01T00:35:58.996577', '10237', '2'), + ('2.99', '313', '2007-04-11T20:35:52.996577', '6384', '1'), + ('0.99', '313', '2007-04-27T11:06:40.996577', '7294', '2'), + ('4.99', '313', '2007-04-29T04:00:10.996577', '8381', '2'), + ('0.99', '313', '2007-03-22T19:24:22.996577', '15340', '1'), + ('2.99', '313', '2007-04-30T10:40:26.996577', '9836', '2'), + ('2.99', '485', '2007-04-09T08:56:44.996577', '5193', '1'), + ('4.99', '485', '2007-03-01T19:18:01.996577', '10771', '1'), + ('1.99', '485', '2007-04-06T17:41:06.996577', '3899', '1'), + ('2.99', '485', '2007-04-30T04:52:54.996577', '9039', '2'), + ('4.99', '485', '2007-03-17T14:40:53.996577', '11921', '1'), + ('6.99', '485', '2007-04-30T03:00:16.996577', '8984', '2'), + ('4.99', '485', '2007-04-12T20:25:42.996577', '6902', '2'), + ('2.99', '485', '2007-04-08T08:34:52.996577', '4667', '2'), + ('3.99', '485', '2007-04-09T15:52:09.996577', '5343', '1'), + ('6.99', '485', '2007-03-01T19:19:36.996577', '10772', '2'), + ('0.99', '485', '2007-04-30T01:00:26.996577', '9565', '1'), + ('8.99', '485', '2007-02-16T13:30:02.996577', '1721', '1'), + ('4.99', '485', '2007-04-27T05:29:03.996577', '7144', '1'), + ('8.99', '485', '2007-03-18T02:44:32.996577', '12261', '2'), + ('0.99', '485', '2007-03-18T11:13:50.996577', '12487', '2'), + ('4.99', '485', '2007-04-10T14:33:25.996577', '5820', '1'), + ('2.99', '485', '2007-02-16T10:26:00.996577', '1684', '2'), + ('2.99', '485', '2007-04-30T10:49:25.996577', '9189', '2'), + ('7.99', '67', '2007-04-30T04:01:51.996577', '9640', '1'), + ('3.99', '67', '2007-02-19T00:37:05.996577', '2542', '1'), + ('4.99', '67', '2007-03-19T22:06:18.996577', '13437', '2'), + ('5.99', '67', '2007-04-27T10:17:03.996577', '7277', '2'), + ('4.99', '67', '2007-03-20T10:49:31.996577', '13791', '2'), + ('8.99', '67', '2007-03-17T13:43:27.996577', '11894', '1'), + ('8.99', '67', '2007-03-02T13:38:32.996577', '11295', '1'), + ('1.99', '595', '2007-04-10T21:46:46.996577', '5952', '1'), + ('0.99', '595', '2007-04-27T11:27:36.996577', '7307', '2'), + ('6.99', '595', '2007-04-11T05:31:45.996577', '6105', '1'), + ('10.99', '595', '2007-04-30T10:20:12.996577', '9826', '2'), + ('2.99', '595', '2007-04-30T11:51:46.996577', '9223', '2'), + ('0.99', '595', '2007-04-30T22:25:20.996577', '9497', '2'), + ('3.99', '595', '2007-04-27T18:16:38.996577', '7490', '2'), + ('9.99', '595', '2007-04-06T12:30:52.996577', '3789', '1'), + ('2.99', '595', '2007-03-23T04:00:29.996577', '15576', '2'), + ('0.99', '595', '2007-03-18T01:46:16.996577', '12235', '1'), + ('0.99', '169', '2007-03-23T02:24:20.996577', '15534', '2'), + ('4.99', '169', '2007-02-17T11:21:24.996577', '2023', '1'), + ('5.99', '169', '2007-03-17T05:08:25.996577', '11687', '2'), + ('6.99', '169', '2007-04-27T06:56:24.996577', '7187', '2'), + ('8.99', '169', '2007-04-05T22:14:45.996577', '3493', '1'), + ('0.99', '169', '2007-03-21T10:13:03.996577', '14435', '2'), + ('0.99', '169', '2007-04-27T22:04:15.996577', '7597', '1'), + ('4.99', '169', '2007-04-29T09:53:15.996577', '8558', '2'), + ('4.99', '389', '2007-02-16T16:19:27.996577', '1763', '1'), + ('2.99', '389', '2007-03-21T22:24:16.996577', '14777', '1'), + ('0.99', '389', '2007-04-05T23:39:34.996577', '3527', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['17703', '20672', '20675', '26559', '20676', '26556', '26557', '26554', '26563', '26564', '22618', '22622', '22616', '28910', '28903', '22617', '18466', '18467', '18464', '22621', '22619', '21828', '27922', '21825', '27918', '18151', '21824', '18153', '21823', '21829', '27915', '18154', '27917', '21827', '27916', '18287', '22192', '18290', '28335', '22182', '18288', '28341', '22185', '28336', '28338', '18285', '22187', '28340', '27607', '27610', '27604', '18060', '27601', '27612', '27608', '27605', '21597', '27606', '21592', '21599', '21596', '27600', '28299', '28302', '28296', '28306', '22158', '28304', '22152', '18279', '22156', '20355', '26194', '20356', '26192', '26199', '26198', '26196', '26200', '26197', '26193', '26190', '17566', '20352', '20351', '17565', '29019', '29025', '29023', '29029', '22704', '29030', '29024', '18503', '29028', '22702', '22707', '18459', '22591', '22590']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('3.99', '389', '2007-02-19T01:29:55.996577', '2552', '1'), + ('7.99', '389', '2007-03-21T12:30:10.996577', '14493', '2'), + ('5.99', '389', '2007-03-22T23:42:27.996577', '15462', '1'), + ('4.99', '389', '2007-04-27T01:26:09.996577', '7029', '1'), + ('9.99', '389', '2007-03-23T19:39:59.996577', '16011', '2'), + ('3.99', '389', '2007-04-10T04:18:01.996577', '5626', '2'), + ('2.99', '389', '2007-04-11T05:30:01.996577', '6104', '2'), + ('6.99', '389', '2007-04-07T21:34:19.996577', '4443', '1'), + ('4.99', '389', '2007-04-29T23:05:20.996577', '8887', '1'), + ('4.99', '389', '2007-04-30T23:35:53.996577', '10217', '1'), + ('4.99', '599', '2007-03-21T16:12:08.996577', '14599', '1'), + ('2.99', '599', '2007-03-23T09:53:26.996577', '15725', '2'), + ('3.99', '599', '2007-03-16T22:33:31.996577', '11522', '2'), + ('2.99', '599', '2007-04-30T05:09:45.996577', '9679', '2'), + ('0.99', '599', '2007-04-09T03:10:26.996577', '5065', '1'), + ('1.99', '599', '2007-03-21T03:35:34.996577', '14233', '1'), + ('4.99', '599', '2007-02-21T14:03:04.996577', '3398', '2'), + ('6.99', '599', '2007-02-21T17:14:31.996577', '3429', '1'), + ('1.99', '599', '2007-02-18T04:58:19.996577', '2272', '1'), + ('2.99', '599', '2007-03-23T09:37:12.996577', '15719', '2'), + ('1.99', '599', '2007-03-21T20:10:23.996577', '14719', '1'), + ('6.99', '511', '2007-03-21T05:48:23.996577', '14302', '1'), + ('0.99', '511', '2007-04-30T07:07:02.996577', '9095', '1'), + ('6.99', '511', '2007-03-17T21:28:12.996577', '12110', '2'), + ('0.99', '511', '2007-04-10T03:25:21.996577', '5601', '1'), + ('2.99', '511', '2007-02-15T06:50:05.996577', '1281', '2'), + ('2.99', '511', '2007-03-01T07:02:44.996577', '10429', '2'), + ('10.99', '511', '2007-02-20T06:07:59.996577', '2966', '2'), + ('2.99', '511', '2007-03-01T00:19:15.996577', '10231', '1'), + ('4.99', '511', '2007-03-22T13:53:59.996577', '15172', '1'), + ('0.99', '511', '2007-04-06T15:26:15.996577', '3852', '1'), + ('4.99', '511', '2007-02-21T11:32:03.996577', '3366', '2'), + ('3.99', '511', '2007-04-09T07:31:40.996577', '5164', '2'), + ('4.99', '511', '2007-03-21T02:59:13.996577', '14213', '1'), + ('4.99', '511', '2007-04-07T23:29:44.996577', '4482', '1'), + ('4.99', '550', '2007-02-17T01:47:17.996577', '1883', '2'), + ('0.99', '550', '2007-03-23T15:13:22.996577', '15883', '1'), + ('10.99', '550', '2007-02-21T03:46:53.996577', '3272', '1'), + ('0.99', '550', '2007-04-27T01:30:06.996577', '7030', '1'), + ('0.99', '550', '2007-03-02T14:41:54.996577', '11320', '2'), + ('2.99', '550', '2007-02-20T19:13:06.996577', '3154', '1'), + ('0.99', '550', '2007-04-30T07:46:22.996577', '9748', '1'), + ('4.99', '550', '2007-03-17T20:27:40.996577', '12077', '2'), + ('2.99', '550', '2007-04-28T07:28:47.996577', '7838', '2'), + ('2.99', '550', '2007-04-29T21:20:49.996577', '8838', '2'), + ('6.99', '550', '2007-02-15T02:47:03.996577', '1233', '1'), + ('2.99', '550', '2007-03-20T21:30:22.996577', '14071', '2'), + ('2.99', '550', '2007-04-30T02:33:27.996577', '9616', '1'), + ('4.99', '484', '2007-04-27T16:11:53.996577', '7440', '2'), + ('5.99', '484', '2007-04-30T08:44:30.996577', '9141', '2'), + ('5.99', '484', '2007-04-10T22:45:04.996577', '5977', '2'), + ('3.99', '484', '2007-02-15T11:19:29.996577', '1351', '1'), + ('6.99', '484', '2007-04-10T08:57:45.996577', '5708', '2'), + ('4.99', '484', '2007-04-30T08:20:42.996577', '9769', '1'), + ('2.99', '484', '2007-04-27T20:21:44.996577', '7548', '2'), + ('2.99', '484', '2007-04-11T16:02:30.996577', '6296', '2'), + ('3.99', '484', '2007-03-20T16:36:45.996577', '13956', '2'), + ('6.99', '484', '2007-04-12T18:27:00.996577', '6863', '1'), + ('4.99', '484', '2007-03-17T12:40:10.996577', '11871', '2'), + ('4.99', '484', '2007-03-23T20:17:48.996577', '16026', '1'), + ('0.99', '484', '2007-03-19T11:49:30.996577', '13160', '2'), + ('2.99', '484', '2007-04-09T17:54:11.996577', '5389', '1'), + ('0.99', '546', '2007-04-10T04:30:51.996577', '5629', '1'), + ('6.99', '546', '2007-04-12T20:39:47.996577', '6910', '2'), + ('4.99', '546', '2007-04-06T10:19:23.996577', '3738', '1'), + ('1.99', '546', '2007-04-30T03:06:07.996577', '9626', '2'), + ('3.99', '546', '2007-03-22T04:01:04.996577', '14929', '1'), + ('4.99', '546', '2007-04-30T06:48:13.996577', '9087', '1'), + ('5.99', '546', '2007-03-02T15:58:05.996577', '11352', '2'), + ('5.99', '546', '2007-02-18T11:47:31.996577', '2361', '1'), + ('4.99', '546', '2007-03-21T23:09:50.996577', '14797', '1'), + ('0.99', '357', '2007-03-22T03:47:10.996577', '14926', '1'), + ('4.99', '357', '2007-04-11T19:46:55.996577', '6367', '2'), + ('2.99', '357', '2007-03-23T14:50:46.996577', '15869', '2'), + ('0.99', '357', '2007-04-10T18:44:22.996577', '5896', '1'), + ('2.99', '357', '2007-04-28T15:08:22.996577', '8041', '2'), + ('5.99', '357', '2007-04-27T13:29:43.996577', '7366', '1'), + ('0.99', '357', '2007-04-12T17:31:45.996577', '6839', '1'), + ('2.99', '357', '2007-04-28T17:57:24.996577', '8124', '1'), + ('2.99', '357', '2007-04-27T13:07:05.996577', '7353', '1'), + ('8.99', '357', '2007-04-11T15:30:18.996577', '6288', '1'), + ('3.99', '357', '2007-04-06T16:15:23.996577', '3865', '1'), + ('1.99', '357', '2007-02-16T18:15:44.996577', '1788', '1'), + ('6.99', '357', '2007-03-01T09:36:10.996577', '10503', '1'), + ('2.99', '357', '2007-03-01T09:35:05.996577', '10502', '1'), + ('5.99', '357', '2007-02-15T03:39:45.996577', '1246', '2'), + ('4.99', '3', '2007-04-07T08:51:51.996577', '4180', '1'), + ('4.99', '3', '2007-04-28T10:15:11.996577', '7911', '1'), + ('7.99', '3', '2007-04-28T02:27:47.996577', '7703', '2'), + ('3.99', '3', '2007-04-30T20:14:12.996577', '9443', '2'), + ('8.99', '3', '2007-03-19T20:46:33.996577', '13403', '1'), + ('2.99', '3', '2007-04-30T01:56:24.996577', '9595', '1'), + ('6.99', '3', '2007-04-28T03:14:56.996577', '7724', '2'), + ('8.99', '3', '2007-02-16T00:02:31.996577', '1546', '1'), + ('1.99', '3', '2007-04-30T11:59:46.996577', '9226', '1'), + ('5.99', '3', '2007-03-01T12:48:14.996577', '10597', '2'), + ('0.99', '3', '2007-03-22T08:05:53.996577', '15038', '2'), + ('1.99', '596', '2007-02-19T16:15:01.996577', '2767', '1'), + ('3.99', '596', '2007-03-17T12:06:53.996577', '11852', '2'), + ('4.99', '596', '2007-03-02T03:34:49.996577', '11009', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['18458', '28876', '22587', '22598', '22593', '22597', '32008', '22594', '28875', '22549', '18435', '22550', '28793', '28797', '28792', '28784', '28794', '28795', '28787', '18437', '31767', '25010', '25004', '25007', '25009', '31766', '25011', '19448', '31761', '19447', '19449', '25013', '20155', '20158', '20159', '25971', '25965', '25972', '25969', '25973', '31938', '25347', '19703', '25348', '19707', '25353', '25349', '25358', '25352', '25354', '25346', '19711', '17560', '31943', '26173', '26168', '26167', '20333', '26175', '26166', '26171', '20334', '17561', '20336', '26174', '26172', '26170', '29363', '23018', '18644', '29368', '23019', '29364', '29362', '23020', '18643', '23009', '23016', '29365', '29367', '18642', '23010', '23444', '29871', '29867', '23442', '18805', '29878', '29868', '23443', '29872', '29879', '29870', '29876', '29877', '24088', '30660', '30668', '24077', '19070']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('1.99', '596', '2007-02-16T07:26:44.996577', '1644', '1'), + ('4.99', '596', '2007-04-11T10:38:17.996577', '6197', '1'), + ('4.99', '596', '2007-03-01T16:41:01.996577', '10692', '2'), + ('0.99', '596', '2007-03-22T21:49:07.996577', '15405', '1'), + ('4.99', '596', '2007-03-18T13:22:45.996577', '12560', '2'), + ('0.99', '596', '2007-03-21T09:42:01.996577', '14417', '1'), + ('0.99', '596', '2007-05-14T13:44:29.996577', '15423', '1'), + ('4.99', '596', '2007-03-19T01:45:34.996577', '12878', '1'), + ('0.99', '596', '2007-04-11T00:33:58.996577', '6017', '1'), + ('3.99', '590', '2007-03-17T06:02:31.996577', '11713', '2'), + ('2.99', '590', '2007-02-19T16:42:46.996577', '2775', '2'), + ('2.99', '590', '2007-03-22T00:05:45.996577', '14830', '1'), + ('2.99', '590', '2007-04-28T00:56:56.996577', '7665', '2'), + ('4.99', '590', '2007-04-30T12:24:50.996577', '9884', '1'), + ('4.99', '590', '2007-04-27T00:24:27.996577', '7010', '1'), + ('4.99', '590', '2007-04-08T09:13:39.996577', '4685', '2'), + ('5.99', '590', '2007-04-28T21:21:24.996577', '8195', '1'), + ('4.99', '590', '2007-04-29T19:53:48.996577', '8801', '1'), + ('0.99', '590', '2007-04-09T07:37:19.996577', '5165', '1'), + ('9.99', '590', '2007-02-20T06:01:55.996577', '2964', '1'), + ('2.99', '253', '2007-04-29T17:43:33.996577', '8752', '2'), + ('3.99', '253', '2007-03-20T22:16:20.996577', '14086', '2'), + ('4.99', '253', '2007-03-01T05:59:51.996577', '10404', '2'), + ('0.99', '253', '2007-03-18T14:01:20.996577', '12572', '1'), + ('5.99', '253', '2007-03-19T10:28:54.996577', '13126', '1'), + ('2.99', '253', '2007-04-28T09:08:38.996577', '7887', '2'), + ('4.99', '253', '2007-03-21T05:12:40.996577', '14283', '2'), + ('6.99', '253', '2007-02-16T04:46:57.996577', '1606', '2'), + ('7.99', '253', '2007-04-06T06:29:34.996577', '3658', '1'), + ('1.99', '253', '2007-02-15T13:31:41.996577', '1378', '2'), + ('5.99', '253', '2007-02-17T15:33:28.996577', '2081', '2'), + ('4.99', '253', '2007-03-21T18:05:36.996577', '14655', '2'), + ('0.99', '337', '2007-03-01T19:03:17.996577', '10765', '2'), + ('6.99', '337', '2007-03-18T06:26:09.996577', '12369', '1'), + ('6.99', '337', '2007-03-19T17:25:31.996577', '13305', '2'), + ('4.99', '337', '2007-04-27T15:10:25.996577', '7410', '1'), + ('4.99', '337', '2007-04-07T04:23:16.996577', '4093', '2'), + ('4.99', '337', '2007-04-29T08:28:29.996577', '8516', '1'), + ('7.99', '337', '2007-04-11T16:30:51.996577', '6305', '2'), + ('8.99', '337', '2007-04-30T00:25:29.996577', '8919', '2'), + ('0.99', '337', '2007-05-14T13:44:29.996577', '11847', '2'), + ('2.99', '285', '2007-04-09T05:32:30.996577', '5112', '2'), + ('2.99', '285', '2007-03-01T14:01:45.996577', '10628', '2'), + ('9.99', '285', '2007-04-10T07:20:39.996577', '5683', '1'), + ('0.99', '285', '2007-03-18T09:31:30.996577', '12449', '1'), + ('0.99', '285', '2007-04-12T09:08:05.996577', '6644', '2'), + ('0.99', '285', '2007-04-11T00:20:54.996577', '6010', '1'), + ('0.99', '285', '2007-04-29T06:53:13.996577', '8466', '2'), + ('4.99', '285', '2007-04-11T17:48:42.996577', '6333', '2'), + ('6.99', '285', '2007-04-27T07:48:26.996577', '7211', '1'), + ('6.99', '285', '2007-04-06T22:54:31.996577', '4007', '2'), + ('4.99', '285', '2007-03-23T00:35:07.996577', '15489', '1'), + ('0.99', '355', '2007-02-15T20:08:20.996577', '1488', '2'), + ('0.99', '355', '2007-05-14T13:44:29.996577', '14760', '1'), + ('4.99', '355', '2007-04-12T10:08:21.996577', '6669', '2'), + ('4.99', '355', '2007-04-09T09:52:45.996577', '5210', '1'), + ('6.99', '355', '2007-04-06T09:59:50.996577', '3730', '1'), + ('0.99', '355', '2007-03-02T20:17:29.996577', '11471', '2'), + ('5.99', '355', '2007-04-27T17:39:29.996577', '7477', '2'), + ('5.99', '355', '2007-04-06T01:38:02.996577', '3567', '1'), + ('6.99', '355', '2007-04-11T14:01:50.996577', '6262', '2'), + ('1.99', '355', '2007-03-20T12:02:13.996577', '13821', '2'), + ('2.99', '355', '2007-02-16T05:20:31.996577', '1612', '1'), + ('2.99', '355', '2007-03-23T02:21:02.996577', '15531', '2'), + ('4.99', '355', '2007-04-27T03:56:58.996577', '7108', '2'), + ('2.99', '355', '2007-04-11T22:48:55.996577', '6437', '1'), + ('0.99', '355', '2007-04-11T06:35:25.996577', '6127', '1'), + ('4.99', '34', '2007-04-09T08:50:57.996577', '5188', '1'), + ('2.99', '34', '2007-03-20T16:23:39.996577', '13949', '2'), + ('0.99', '34', '2007-02-20T19:03:54.996577', '3150', '1'), + ('0.99', '34', '2007-04-27T19:49:18.996577', '7532', '1'), + ('5.99', '34', '2007-03-21T19:00:34.996577', '14686', '1'), + ('4.99', '34', '2007-04-10T05:17:26.996577', '5643', '2'), + ('2.99', '34', '2007-04-06T18:37:37.996577', '3911', '1'), + ('7.99', '34', '2007-03-21T19:22:58.996577', '14701', '2'), + ('5.99', '34', '2007-02-18T03:58:18.996577', '2257', '2'), + ('0.99', '34', '2007-03-01T10:20:58.996577', '10523', '1'), + ('0.99', '34', '2007-03-18T17:04:42.996577', '12651', '1'), + ('5.99', '34', '2007-04-10T20:00:32.996577', '5918', '2'), + ('2.99', '34', '2007-04-27T04:37:56.996577', '7124', '2'), + ('4.99', '34', '2007-02-17T02:58:24.996577', '1900', '1'), + ('4.99', '34', '2007-03-01T13:26:40.996577', '10615', '1'), + ('2.99', '79', '2007-03-19T06:51:11.996577', '13026', '2'), + ('4.99', '79', '2007-04-08T11:51:21.996577', '4736', '2'), + ('0.99', '79', '2007-04-06T05:45:35.996577', '3641', '1'), + ('2.99', '79', '2007-03-01T15:42:41.996577', '10676', '1'), + ('2.99', '79', '2007-02-20T21:03:38.996577', '3178', '2'), + ('6.99', '79', '2007-04-30T10:56:31.996577', '9845', '2'), + ('2.99', '79', '2007-04-06T10:39:48.996577', '3748', '1'), + ('4.99', '79', '2007-03-17T03:14:05.996577', '11641', '2'), + ('2.99', '79', '2007-04-09T09:25:03.996577', '5205', '2'), + ('0.99', '79', '2007-04-30T15:51:05.996577', '9989', '1'), + ('4.99', '79', '2007-04-08T01:55:31.996577', '4530', '1'), + ('2.99', '79', '2007-04-29T21:49:27.996577', '8849', '1'), + ('1.99', '79', '2007-04-30T09:58:12.996577', '9814', '1'), + ('4.99', '147', '2007-03-22T19:06:23.996577', '15331', '2'), + ('7.99', '147', '2007-04-06T18:54:47.996577', '3919', '2'), + ('2.99', '147', '2007-04-12T13:24:08.996577', '6753', '2'), + ('7.99', '147', '2007-03-01T17:09:54.996577', '10706', '1'), + ('6.99', '147', '2007-02-18T18:05:16.996577', '2456', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['30666', '24080', '30665', '30671', '19071', '24083', '20632', '26520', '20629', '20626', '26516', '26518', '26519', '20631', '26522', '26521', '26514', '22787', '22785', '22782', '29114', '29110', '22783', '29113', '18537', '18539', '29105', '22781', '22786', '27836', '21756', '27828', '21765', '21763', '21762', '18124', '21753', '27831', '21758', '27829', '18123', '18614', '29304', '18620', '22976', '22969', '29297', '22962', '22972', '29301', '22967', '22973', '22971', '29305', '22966', '29298', '18619', '18617', '18615', '18227', '28145', '22011', '28148', '28141', '28140', '22018', '28149', '28150', '22012', '22016', '28308', '22162', '28316', '22168', '28315', '22167', '22166', '28311', '22163', '18280', '28307', '22161', '22160', '29597', '18716', '18713', '29593', '29591', '23193', '23198', '23195', '23197', '29596', '23190', '29594', '23194', '29592', '18714', '17712', '26584']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('0.99', '147', '2007-04-11T18:20:01.996577', '6343', '2'), + ('4.99', '147', '2007-03-18T21:26:11.996577', '12757', '1'), + ('0.99', '147', '2007-04-10T15:43:09.996577', '5844', '1'), + ('2.99', '147', '2007-04-29T23:16:45.996577', '8893', '1'), + ('2.99', '147', '2007-02-19T21:47:08.996577', '2859', '2'), + ('4.99', '147', '2007-03-20T19:30:38.996577', '14021', '2'), + ('7.99', '385', '2007-03-19T08:12:43.996577', '13062', '2'), + ('2.99', '385', '2007-04-29T03:16:48.996577', '8346', '1'), + ('2.99', '385', '2007-03-16T23:48:52.996577', '11559', '1'), + ('3.99', '385', '2007-03-01T14:09:01.996577', '10636', '1'), + ('2.99', '385', '2007-04-10T12:23:59.996577', '5783', '1'), + ('4.99', '385', '2007-04-26T21:37:49.996577', '6933', '2'), + ('0.99', '385', '2007-04-28T05:33:02.996577', '7776', '2'), + ('8.99', '385', '2007-03-18T18:23:35.996577', '12686', '2'), + ('2.99', '385', '2007-04-30T01:09:03.996577', '9570', '1'), + ('2.99', '385', '2007-04-29T08:33:53.996577', '8518', '1'), + ('0.99', '385', '2007-04-06T20:23:21.996577', '3953', '2'), + ('0.99', '11', '2007-03-22T11:11:13.996577', '15120', '1'), + ('0.99', '11', '2007-03-20T03:35:53.996577', '13572', '2'), + ('6.99', '11', '2007-03-02T08:43:24.996577', '11166', '2'), + ('9.99', '11', '2007-04-30T01:45:39.996577', '8950', '1'), + ('4.99', '11', '2007-04-28T14:00:33.996577', '8014', '1'), + ('0.99', '11', '2007-03-16T21:34:56.996577', '11502', '2'), + ('0.99', '11', '2007-04-29T16:02:11.996577', '8715', '1'), + ('6.99', '11', '2007-02-15T19:21:33.996577', '1470', '1'), + ('0.99', '11', '2007-02-20T22:17:38.996577', '3192', '1'), + ('2.99', '11', '2007-04-08T05:47:37.996577', '4608', '2'), + ('4.99', '11', '2007-03-01T21:09:42.996577', '10812', '1'), + ('4.99', '11', '2007-03-20T10:45:53.996577', '13790', '1'), + ('4.99', '503', '2007-04-30T15:19:37.996577', '9974', '1'), + ('2.99', '503', '2007-03-18T06:26:13.996577', '12370', '2'), + ('2.99', '503', '2007-04-08T04:02:25.996577', '4570', '2'), + ('4.99', '503', '2007-03-23T08:28:28.996577', '15692', '1'), + ('2.99', '503', '2007-03-22T09:37:44.996577', '15077', '2'), + ('4.99', '503', '2007-03-22T08:44:20.996577', '15056', '2'), + ('2.99', '503', '2007-02-18T02:04:06.996577', '2225', '1'), + ('2.99', '503', '2007-03-02T05:52:49.996577', '11075', '2'), + ('4.99', '503', '2007-04-11T08:47:31.996577', '6166', '1'), + ('2.99', '503', '2007-03-19T18:29:17.996577', '13332', '1'), + ('2.99', '503', '2007-04-09T21:29:39.996577', '5465', '2'), + ('4.99', '503', '2007-02-17T18:03:52.996577', '2108', '2'), + ('0.99', '29', '2007-02-19T09:07:08.996577', '2655', '1'), + ('0.99', '29', '2007-04-27T16:55:39.996577', '7453', '1'), + ('2.99', '29', '2007-02-21T07:17:42.996577', '3324', '1'), + ('7.99', '29', '2007-03-22T06:04:22.996577', '14985', '1'), + ('6.99', '29', '2007-03-18T15:44:33.996577', '12615', '2'), + ('6.99', '29', '2007-04-07T12:52:56.996577', '4262', '2'), + ('5.99', '29', '2007-03-01T11:04:35.996577', '10543', '1'), + ('2.99', '29', '2007-03-20T10:32:01.996577', '13777', '2'), + ('1.99', '29', '2007-04-10T16:27:55.996577', '5857', '1'), + ('2.99', '29', '2007-03-18T11:48:39.996577', '12508', '1'), + ('3.99', '29', '2007-03-20T12:28:51.996577', '13832', '1'), + ('0.99', '29', '2007-03-19T22:04:51.996577', '13436', '1'), + ('2.99', '29', '2007-04-29T14:18:40.996577', '8673', '2'), + ('4.99', '29', '2007-03-18T11:16:48.996577', '12488', '1'), + ('0.99', '29', '2007-04-07T16:05:22.996577', '4313', '1'), + ('2.99', '29', '2007-02-20T02:44:33.996577', '2923', '2'), + ('2.99', '29', '2007-02-19T14:10:33.996577', '2735', '1'), + ('0.99', '29', '2007-02-19T10:10:46.996577', '2673', '1'), + ('2.99', '531', '2007-02-20T06:26:20.996577', '2972', '2'), + ('4.99', '531', '2007-04-12T19:01:16.996577', '6876', '1'), + ('4.99', '531', '2007-03-02T00:42:36.996577', '10920', '2'), + ('2.99', '531', '2007-04-27T16:17:42.996577', '7444', '2'), + ('5.99', '531', '2007-04-10T02:45:51.996577', '5587', '1'), + ('5.99', '531', '2007-04-06T18:58:14.996577', '3921', '2'), + ('0.99', '531', '2007-03-22T20:05:17.996577', '15360', '2'), + ('6.99', '531', '2007-04-28T04:37:45.996577', '7753', '2'), + ('5.99', '531', '2007-04-29T03:30:38.996577', '8359', '2'), + ('5.99', '531', '2007-03-02T01:39:59.996577', '10941', '1'), + ('2.99', '531', '2007-03-19T03:18:46.996577', '12923', '1'), + ('4.99', '547', '2007-04-06T11:30:13.996577', '3765', '1'), + ('5.99', '547', '2007-03-02T08:50:19.996577', '11170', '2'), + ('2.99', '547', '2007-04-29T21:01:20.996577', '8828', '1'), + ('4.99', '547', '2007-03-22T02:25:34.996577', '14884', '2'), + ('3.99', '547', '2007-04-28T08:25:43.996577', '7859', '1'), + ('9.99', '547', '2007-03-21T13:13:07.996577', '14510', '1'), + ('2.99', '547', '2007-03-19T17:27:10.996577', '13307', '2'), + ('0.99', '547', '2007-04-12T06:29:33.996577', '6605', '1'), + ('0.99', '547', '2007-03-02T16:15:00.996577', '11361', '2'), + ('8.99', '547', '2007-02-17T11:13:05.996577', '2022', '2'), + ('4.99', '547', '2007-04-06T07:44:23.996577', '3679', '2'), + ('4.99', '547', '2007-03-02T02:45:58.996577', '10980', '1'), + ('2.99', '547', '2007-03-02T00:10:25.996577', '10903', '1'), + ('7.99', '53', '2007-04-30T13:42:23.996577', '9928', '1'), + ('2.99', '53', '2007-02-20T18:15:38.996577', '3140', '2'), + ('0.99', '53', '2007-02-17T07:38:35.996577', '1964', '1'), + ('2.99', '53', '2007-04-09T08:43:05.996577', '5185', '2'), + ('2.99', '53', '2007-04-06T03:05:36.996577', '3591', '2'), + ('2.99', '53', '2007-03-20T10:45:04.996577', '13789', '2'), + ('0.99', '53', '2007-03-21T23:37:30.996577', '14811', '2'), + ('0.99', '53', '2007-03-20T22:39:43.996577', '14091', '2'), + ('4.99', '53', '2007-03-21T18:27:56.996577', '14671', '1'), + ('4.99', '53', '2007-04-30T16:41:39.996577', '9343', '1'), + ('5.99', '53', '2007-03-17T19:28:22.996577', '12054', '1'), + ('2.99', '53', '2007-04-27T17:19:43.996577', '7466', '2'), + ('2.99', '53', '2007-03-20T21:00:37.996577', '14061', '1'), + ('4.99', '53', '2007-04-06T17:41:03.996577', '3898', '2'), + ('2.99', '53', '2007-02-18T13:54:56.996577', '2388', '1'), + ('2.99', '391', '2007-02-19T11:28:28.996577', '2690', '1'), + ('3.99', '391', '2007-04-11T16:24:04.996577', '6302', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['20689', '20691', '26583', '26579', '20696', '20692', '26585', '26590', '26582', '17710', '26588', '26587', '20785', '26681', '20783', '26690', '20782', '20787', '26686', '26683', '26682', '26688', '20784', '19405', '24896', '24901', '31627', '31637', '31631', '19406', '31629', '24897', '31635', '31886', '31883', '31885', '25132', '31879', '25131', '31880', '31889', '32098', '19501', '25135', '31882', '25134', '31888', '25130', '25129', '24545', '19254', '24544', '31180', '19252', '31178', '24541', '31177', '20812', '26718', '17753', '26727', '20815', '26725', '26726', '26716', '20807', '20810', '26715', '20813', '17752', '20814', '26724', '20808', '25529', '25527', '19841', '25536', '25537', '25533', '19838', '25532', '19836', '25535', '25530', '25531', '24250', '30845', '24252', '32063', '19130', '30843', '19126', '24258', '24256', '19127', '24259', '24257', '30837', '30846', '30836']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('2.99', '391', '2007-03-01T06:05:31.996577', '10406', '2'), + ('2.99', '391', '2007-03-02T18:41:40.996577', '11434', '2'), + ('4.99', '391', '2007-04-10T03:20:30.996577', '5599', '1'), + ('5.99', '391', '2007-04-07T09:13:55.996577', '4188', '1'), + ('0.99', '391', '2007-03-21T08:24:13.996577', '14381', '1'), + ('4.99', '391', '2007-03-17T01:49:45.996577', '11602', '1'), + ('2.99', '391', '2007-04-11T23:44:37.996577', '6463', '1'), + ('7.99', '391', '2007-04-30T23:27:18.996577', '10210', '1'), + ('7.99', '391', '2007-04-10T02:37:14.996577', '5583', '2'), + ('0.99', '391', '2007-02-17T05:20:22.996577', '1931', '2'), + ('6.99', '391', '2007-04-30T00:03:27.996577', '8913', '2'), + ('0.99', '391', '2007-04-29T23:54:31.996577', '8908', '1'), + ('1.99', '401', '2007-03-21T10:05:00.996577', '14433', '2'), + ('0.99', '401', '2007-04-07T02:32:52.996577', '4059', '1'), + ('4.99', '401', '2007-03-19T06:47:47.996577', '13024', '1'), + ('0.99', '401', '2007-04-30T21:57:31.996577', '10171', '2'), + ('2.99', '401', '2007-03-19T02:42:09.996577', '12906', '1'), + ('0.99', '401', '2007-03-23T16:51:37.996577', '15927', '1'), + ('2.99', '401', '2007-04-29T06:12:31.996577', '8450', '1'), + ('0.99', '401', '2007-04-10T20:08:32.996577', '5923', '2'), + ('7.99', '401', '2007-04-07T14:17:04.996577', '4292', '2'), + ('8.99', '401', '2007-04-29T16:27:24.996577', '8722', '1'), + ('0.99', '401', '2007-03-21T07:44:45.996577', '14359', '1'), + ('4.99', '240', '2007-02-18T04:27:11.996577', '2264', '1'), + ('6.99', '240', '2007-03-18T03:22:51.996577', '12283', '2'), + ('0.99', '240', '2007-03-23T06:35:15.996577', '15641', '2'), + ('4.99', '240', '2007-04-09T12:36:27.996577', '5262', '2'), + ('5.99', '240', '2007-04-29T23:39:37.996577', '8905', '2'), + ('4.99', '240', '2007-04-26T22:24:23.996577', '6956', '1'), + ('5.99', '240', '2007-02-19T23:06:47.996577', '2872', '2'), + ('0.99', '240', '2007-04-11T14:32:15.996577', '6272', '1'), + ('2.99', '240', '2007-03-19T06:56:37.996577', '13030', '2'), + ('4.99', '240', '2007-04-28T08:44:29.996577', '7870', '1'), + ('2.99', '264', '2007-04-30T17:45:57.996577', '9380', '2'), + ('2.99', '264', '2007-04-11T20:57:55.996577', '6395', '1'), + ('8.99', '264', '2007-04-27T00:10:46.996577', '7006', '1'), + ('4.99', '264', '2007-03-18T12:09:58.996577', '12518', '1'), + ('4.99', '264', '2007-04-07T16:31:43.996577', '4328', '1'), + ('2.99', '264', '2007-03-16T23:14:07.996577', '11539', '1'), + ('0.99', '264', '2007-04-08T02:29:28.996577', '4539', '1'), + ('5.99', '264', '2007-04-30T13:48:14.996577', '9932', '1'), + ('2.99', '264', '2007-05-14T13:44:29.996577', '14243', '2'), + ('3.99', '264', '2007-02-21T14:23:32.996577', '3403', '1'), + ('4.99', '264', '2007-03-23T04:47:38.996577', '15595', '1'), + ('0.99', '264', '2007-04-11T20:51:35.996577', '6391', '2'), + ('5.99', '264', '2007-03-20T06:47:02.996577', '13664', '1'), + ('5.99', '264', '2007-04-30T11:32:40.996577', '9861', '1'), + ('0.99', '264', '2007-03-16T23:03:19.996577', '11533', '2'), + ('3.99', '264', '2007-03-16T22:53:32.996577', '11527', '1'), + ('4.99', '194', '2007-03-23T17:11:48.996577', '15937', '2'), + ('2.99', '194', '2007-02-18T10:40:55.996577', '2347', '1'), + ('4.99', '194', '2007-03-21T10:27:30.996577', '14440', '1'), + ('3.99', '194', '2007-04-10T18:38:00.996577', '5894', '2'), + ('0.99', '194', '2007-02-15T16:53:21.996577', '1430', '1'), + ('2.99', '194', '2007-04-09T06:43:24.996577', '5146', '2'), + ('3.99', '194', '2007-03-19T00:40:38.996577', '12851', '2'), + ('7.99', '194', '2007-04-07T11:16:45.996577', '4231', '2'), + ('0.99', '404', '2007-03-21T19:10:55.996577', '14691', '1'), + ('4.99', '404', '2007-04-08T08:16:27.996577', '4653', '1'), + ('4.99', '404', '2007-02-16T22:08:00.996577', '1840', '2'), + ('4.99', '404', '2007-04-30T21:31:58.996577', '9472', '1'), + ('4.99', '404', '2007-03-22T03:20:08.996577', '14912', '2'), + ('3.99', '404', '2007-04-29T06:21:32.996577', '8455', '1'), + ('4.99', '404', '2007-04-30T11:15:25.996577', '9206', '1'), + ('2.99', '404', '2007-04-08T00:12:12.996577', '4495', '1'), + ('2.99', '404', '2007-03-01T14:48:48.996577', '10651', '1'), + ('5.99', '404', '2007-03-19T21:15:01.996577', '13412', '2'), + ('2.99', '404', '2007-04-06T19:16:40.996577', '3927', '1'), + ('5.99', '404', '2007-03-22T00:17:33.996577', '14835', '2'), + ('2.99', '404', '2007-02-15T20:48:03.996577', '1506', '2'), + ('4.99', '404', '2007-03-22T00:26:00.996577', '14838', '2'), + ('5.99', '404', '2007-04-28T15:36:15.996577', '8058', '1'), + ('5.99', '404', '2007-03-18T05:09:56.996577', '12325', '1'), + ('2.99', '299', '2007-04-07T17:31:07.996577', '4350', '1'), + ('0.99', '299', '2007-04-05T22:28:29.996577', '3497', '2'), + ('6.99', '299', '2007-03-22T02:55:00.996577', '14898', '2'), + ('9.99', '299', '2007-04-28T08:30:51.996577', '7862', '2'), + ('2.99', '299', '2007-04-30T23:19:20.996577', '9520', '1'), + ('7.99', '299', '2007-04-12T18:06:37.996577', '6853', '1'), + ('0.99', '299', '2007-03-21T02:37:44.996577', '14208', '2'), + ('0.99', '299', '2007-04-12T12:27:17.996577', '6732', '2'), + ('0.99', '299', '2007-03-17T17:14:47.996577', '11998', '1'), + ('2.99', '299', '2007-04-28T04:17:22.996577', '7746', '1'), + ('1.99', '299', '2007-04-09T01:10:27.996577', '5033', '2'), + ('2.99', '299', '2007-04-10T05:14:34.996577', '5642', '1'), + ('0.99', '163', '2007-03-01T00:52:35.996577', '10245', '2'), + ('4.99', '163', '2007-04-28T15:43:37.996577', '8063', '2'), + ('4.99', '163', '2007-03-17T15:24:54.996577', '11940', '2'), + ('0.00', '163', '2007-05-14T13:44:29.996577', '15282', '1'), + ('6.99', '163', '2007-02-20T07:45:31.996577', '2994', '1'), + ('2.99', '163', '2007-04-27T14:50:35.996577', '7403', '1'), + ('4.99', '163', '2007-02-15T05:29:16.996577', '1265', '2'), + ('8.99', '163', '2007-03-23T01:59:11.996577', '15520', '1'), + ('4.99', '163', '2007-03-21T04:58:56.996577', '14275', '2'), + ('2.99', '163', '2007-02-17T10:00:56.996577', '2000', '2'), + ('0.99', '163', '2007-03-23T14:08:04.996577', '15847', '1'), + ('5.99', '163', '2007-03-21T09:54:32.996577', '14427', '2'), + ('1.99', '163', '2007-04-07T05:52:37.996577', '4126', '1'), + ('4.99', '163', '2007-04-29T04:55:05.996577', '8403', '2'), + ('3.99', '163', '2007-04-06T18:45:12.996577', '3915', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['19129', '18720', '23207', '18721', '23199', '23200', '29604', '23205', '23209', '23202', '23208', '23204', '29605', '23203', '23211', '18719', '27669', '27671', '27672', '21643', '18075', '18074', '21636', '18073', '21644', '21640', '18374', '28600', '28603', '22410', '18375', '28593', '22405', '22411', '28599', '28596', '22409', '28601', '26631', '20736', '26636', '26630', '20741', '17732', '20737', '20735', '20738', '20734', '17731', '26635', '20733', '26640', '26637', '20742', '29002', '29000', '22680', '29001', '28998', '18500', '22684', '22687', '22689', '18497', '28996', '22682', '18498', '18501', '20428', '26290', '26288', '26284', '26286', '26291', '26293', '20423', '17603', '26287', '17604', '20424', '26289', '27994', '18188', '18187', '21904', '28002', '18186', '21905', '27995', '28003', '28005', '28000', '27996', '28001', '21908', '21909', '21906', '24010', '30592', '30593']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('5.99', '163', '2007-02-19T00:10:00.996577', '2536', '2'), + ('6.99', '54', '2007-02-18T08:23:28.996577', '2323', '2'), + ('0.99', '54', '2007-03-19T01:26:03.996577', '12872', '2'), + ('4.99', '54', '2007-02-19T08:26:22.996577', '2647', '1'), + ('5.99', '54', '2007-03-01T08:56:08.996577', '10489', '2'), + ('5.99', '54', '2007-03-01T23:15:42.996577', '10882', '2'), + ('0.99', '54', '2007-04-12T16:32:16.996577', '6813', '1'), + ('5.99', '54', '2007-03-18T22:04:22.996577', '12775', '2'), + ('0.99', '54', '2007-03-20T14:09:26.996577', '13890', '1'), + ('4.99', '54', '2007-03-02T09:23:40.996577', '11182', '1'), + ('2.99', '54', '2007-03-19T17:44:44.996577', '13315', '2'), + ('2.99', '54', '2007-03-18T12:17:09.996577', '12526', '1'), + ('4.99', '54', '2007-04-30T03:12:44.996577', '8992', '2'), + ('2.99', '54', '2007-03-17T13:31:39.996577', '11887', '2'), + ('10.99', '54', '2007-03-22T15:48:43.996577', '15226', '1'), + ('2.99', '54', '2007-02-16T01:50:26.996577', '1571', '1'), + ('2.99', '489', '2007-04-06T13:55:30.996577', '3816', '2'), + ('4.99', '489', '2007-04-26T22:41:28.996577', '6963', '1'), + ('0.99', '489', '2007-04-30T12:10:41.996577', '9231', '2'), + ('0.99', '489', '2007-03-22T15:00:49.996577', '15205', '1'), + ('7.99', '489', '2007-02-18T12:58:20.996577', '2370', '1'), + ('0.99', '489', '2007-02-18T00:36:53.996577', '2201', '1'), + ('4.99', '489', '2007-03-17T05:50:51.996577', '11705', '1'), + ('3.99', '489', '2007-02-16T05:26:28.996577', '1614', '2'), + ('4.99', '489', '2007-03-23T18:40:43.996577', '15981', '1'), + ('5.99', '489', '2007-03-20T22:54:11.996577', '14095', '2'), + ('0.99', '574', '2007-02-16T01:03:29.996577', '1559', '1'), + ('1.99', '574', '2007-04-27T03:15:26.996577', '7093', '1'), + ('4.99', '574', '2007-04-29T01:34:22.996577', '8303', '1'), + ('2.99', '574', '2007-03-22T04:26:49.996577', '14941', '2'), + ('5.99', '574', '2007-02-16T06:57:20.996577', '1636', '2'), + ('4.99', '574', '2007-04-07T10:21:40.996577', '4212', '1'), + ('4.99', '574', '2007-03-01T03:48:29.996577', '10347', '1'), + ('2.99', '574', '2007-03-22T15:21:55.996577', '15214', '2'), + ('2.99', '574', '2007-04-12T02:42:45.996577', '6523', '1'), + ('3.99', '574', '2007-04-09T03:41:48.996577', '5076', '1'), + ('4.99', '574', '2007-03-20T21:48:36.996577', '14076', '1'), + ('2.99', '574', '2007-04-27T05:01:32.996577', '7134', '1'), + ('2.99', '396', '2007-04-11T17:53:41.996577', '6335', '2'), + ('4.99', '396', '2007-03-19T19:27:45.996577', '13355', '2'), + ('2.99', '396', '2007-04-29T03:45:01.996577', '8371', '2'), + ('1.99', '396', '2007-04-09T02:56:27.996577', '5059', '1'), + ('1.99', '396', '2007-03-21T23:05:07.996577', '14792', '1'), + ('6.99', '396', '2007-02-15T15:26:24.996577', '1408', '2'), + ('3.99', '396', '2007-03-20T21:55:06.996577', '14078', '1'), + ('4.99', '396', '2007-03-19T02:19:14.996577', '12895', '1'), + ('4.99', '396', '2007-03-21T01:28:57.996577', '14169', '1'), + ('5.99', '396', '2007-03-18T07:31:07.996577', '12393', '2'), + ('4.99', '396', '2007-02-15T13:56:49.996577', '1385', '2'), + ('2.99', '396', '2007-04-27T11:40:23.996577', '7313', '2'), + ('0.99', '396', '2007-03-01T13:18:07.996577', '10610', '2'), + ('0.99', '396', '2007-04-30T20:00:15.996577', '10124', '2'), + ('2.99', '396', '2007-04-29T20:05:25.996577', '8807', '2'), + ('7.99', '396', '2007-03-22T14:43:59.996577', '15198', '2'), + ('0.99', '1', '2007-04-28T17:48:33.996577', '8116', '2'), + ('4.99', '1', '2007-04-28T14:46:49.996577', '8033', '2'), + ('4.99', '1', '2007-03-01T07:19:30.996577', '10437', '2'), + ('0.99', '1', '2007-04-28T16:02:05.996577', '8074', '1'), + ('2.99', '1', '2007-04-27T09:59:48.996577', '7273', '2'), + ('0.99', '1', '2007-02-18T12:02:25.996577', '2363', '2'), + ('0.99', '1', '2007-03-18T02:25:55.996577', '12250', '1'), + ('0.99', '1', '2007-03-21T22:02:23.996577', '14762', '1'), + ('2.99', '1', '2007-03-22T18:10:03.996577', '15298', '2'), + ('9.99', '1', '2007-02-15T19:37:12.996577', '1476', '2'), + ('4.99', '1', '2007-04-09T15:06:27.996577', '5326', '1'), + ('0.99', '1', '2007-03-02T16:30:04.996577', '11367', '1'), + ('4.99', '1', '2007-02-16T13:47:23.996577', '1725', '1'), + ('3.99', '1', '2007-02-21T04:53:11.996577', '3284', '1'), + ('6.99', '365', '2007-03-21T11:20:15.996577', '14463', '2'), + ('3.99', '365', '2007-04-29T22:10:26.996577', '8856', '1'), + ('4.99', '365', '2007-04-28T19:56:58.996577', '8168', '1'), + ('1.99', '365', '2007-04-08T04:38:10.996577', '4583', '1'), + ('7.99', '365', '2007-04-27T18:04:41.996577', '7488', '1'), + ('2.99', '365', '2007-04-30T08:05:18.996577', '9122', '1'), + ('2.99', '365', '2007-04-30T00:08:32.996577', '9540', '2'), + ('2.99', '365', '2007-03-01T17:22:19.996577', '10717', '2'), + ('6.99', '365', '2007-02-16T02:36:42.996577', '1578', '1'), + ('4.99', '365', '2007-04-27T23:35:27.996577', '7634', '2'), + ('4.99', '365', '2007-02-17T08:50:39.996577', '1983', '1'), + ('2.99', '365', '2007-03-18T05:03:54.996577', '12322', '2'), + ('4.99', '365', '2007-04-29T18:58:00.996577', '8782', '2'), + ('2.99', '519', '2007-04-08T14:10:05.996577', '4773', '2'), + ('5.99', '519', '2007-02-20T07:52:11.996577', '2997', '2'), + ('8.99', '519', '2007-02-18T21:56:53.996577', '2505', '2'), + ('4.99', '519', '2007-03-01T16:48:49.996577', '10697', '2'), + ('0.99', '519', '2007-04-30T04:11:15.996577', '9645', '2'), + ('2.99', '519', '2007-02-17T06:11:11.996577', '1941', '1'), + ('7.99', '519', '2007-03-18T16:58:47.996577', '12648', '2'), + ('0.99', '519', '2007-04-09T11:24:55.996577', '5236', '2'), + ('7.99', '519', '2007-04-30T12:28:39.996577', '9886', '2'), + ('5.99', '519', '2007-04-30T19:08:04.996577', '10097', '1'), + ('4.99', '519', '2007-04-30T20:11:54.996577', '9441', '2'), + ('5.99', '519', '2007-04-10T01:21:13.996577', '5547', '2'), + ('7.99', '519', '2007-04-30T23:46:53.996577', '9534', '2'), + ('2.99', '519', '2007-03-21T01:45:36.996577', '14182', '1'), + ('2.99', '519', '2007-03-22T19:40:45.996577', '15347', '2'), + ('2.99', '519', '2007-03-19T03:20:13.996577', '12924', '2'), + ('5.99', '141', '2007-03-17T18:42:52.996577', '12032', '1'), + ('5.99', '141', '2007-04-08T08:18:36.996577', '4656', '1'), + ('2.99', '141', '2007-04-09T03:05:15.996577', '5062', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['30590', '24009', '19046', '24014', '24018', '24012', '30594', '24016', '24011', '30596', '24015', '24006', '19044', '24007', '21055', '27009', '27005', '17840', '27013', '27011', '22398', '28580', '28587', '28584', '28585', '22403', '28577', '22396', '28579', '18372', '28589', '22404', '28581', '18373', '22399', '22402', '22397', '18370', '28582', '23413', '29840', '23412', '18793', '23416', '29839', '29836', '18791', '18794', '23414', '26203', '26205', '17570', '26204', '20360', '20361', '26207', '26209', '17571', '29662', '18742', '29663', '23259', '29661', '29660', '29659', '29658', '23266', '29657', '23268', '23265', '18743', '23956', '19028', '30533', '23953', '23958', '30534', '25386', '19728', '25381', '25383', '19727', '19721', '19725', '25384', '19720', '19722', '25376', '19726', '19723', '31926', '23945', '23950', '23951', '23948', '30527', '30521', '30520', '32056', '19025']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('1.99', '141', '2007-04-07T02:28:46.996577', '4057', '1'), + ('5.99', '141', '2007-03-02T18:01:17.996577', '11412', '1'), + ('4.99', '141', '2007-02-21T17:36:54.996577', '3434', '1'), + ('0.99', '141', '2007-03-19T06:05:08.996577', '13000', '1'), + ('2.99', '141', '2007-03-20T23:29:12.996577', '14112', '1'), + ('3.99', '141', '2007-03-17T21:24:50.996577', '12107', '2'), + ('0.99', '141', '2007-04-10T11:46:24.996577', '5769', '1'), + ('4.99', '141', '2007-03-19T23:29:42.996577', '13470', '2'), + ('2.99', '141', '2007-03-17T20:57:06.996577', '12093', '1'), + ('2.99', '141', '2007-04-28T08:55:36.996577', '7878', '2'), + ('2.99', '141', '2007-03-19T12:12:01.996577', '13169', '2'), + ('1.99', '141', '2007-03-01T05:02:55.996577', '10379', '1'), + ('7.99', '141', '2007-02-15T03:33:33.996577', '1242', '2'), + ('4.99', '141', '2007-03-01T20:31:36.996577', '10798', '1'), + ('4.99', '429', '2007-03-19T04:32:33.996577', '12953', '1'), + ('4.99', '429', '2007-04-27T13:06:55.996577', '7352', '2'), + ('4.99', '429', '2007-04-10T17:07:42.996577', '5868', '2'), + ('2.99', '429', '2007-02-21T14:46:04.996577', '3409', '1'), + ('0.99', '429', '2007-04-30T11:13:00.996577', '9849', '1'), + ('2.99', '429', '2007-04-28T18:51:37.996577', '8143', '2'), + ('0.99', '573', '2007-03-02T04:33:10.996577', '11043', '1'), + ('0.99', '573', '2007-04-08T05:50:55.996577', '4609', '1'), + ('10.99', '573', '2007-04-30T10:42:45.996577', '9837', '2'), + ('2.99', '573', '2007-04-10T19:07:30.996577', '5903', '2'), + ('7.99', '573', '2007-04-12T11:05:26.996577', '6693', '1'), + ('0.99', '573', '2007-03-18T22:45:35.996577', '12791', '1'), + ('2.99', '573', '2007-04-06T19:22:33.996577', '3930', '1'), + ('0.99', '573', '2007-03-01T02:33:03.996577', '10296', '1'), + ('0.99', '573', '2007-04-07T03:54:05.996577', '4085', '1'), + ('1.99', '573', '2007-02-20T07:46:48.996577', '2995', '1'), + ('2.99', '573', '2007-04-30T14:45:12.996577', '9963', '2'), + ('2.99', '573', '2007-03-19T09:55:46.996577', '13113', '2'), + ('2.99', '573', '2007-04-08T13:58:12.996577', '4770', '1'), + ('7.99', '573', '2007-02-21T05:32:43.996577', '3295', '1'), + ('5.99', '573', '2007-03-17T14:20:15.996577', '11912', '2'), + ('6.99', '573', '2007-03-18T02:56:20.996577', '12269', '1'), + ('2.99', '573', '2007-03-01T23:21:01.996577', '10887', '1'), + ('4.99', '573', '2007-02-16T05:23:36.996577', '1613', '1'), + ('5.99', '573', '2007-04-09T01:27:07.996577', '5036', '1'), + ('7.99', '76', '2007-03-02T08:56:18.996577', '11172', '2'), + ('2.99', '76', '2007-04-29T03:28:10.996577', '8357', '2'), + ('4.99', '76', '2007-03-01T20:25:03.996577', '10795', '2'), + ('1.99', '76', '2007-02-18T14:19:51.996577', '2397', '2'), + ('4.99', '76', '2007-03-22T13:50:22.996577', '15169', '2'), + ('6.99', '76', '2007-04-28T23:25:32.996577', '8253', '2'), + ('4.99', '76', '2007-04-07T04:48:59.996577', '4099', '2'), + ('6.99', '76', '2007-02-16T18:32:54.996577', '1791', '1'), + ('0.99', '76', '2007-02-20T00:51:08.996577', '2894', '1'), + ('3.99', '76', '2007-03-20T07:49:34.996577', '13697', '2'), + ('2.99', '358', '2007-04-06T13:45:03.996577', '3809', '1'), + ('2.99', '358', '2007-04-11T19:37:57.996577', '6362', '1'), + ('0.99', '358', '2007-02-17T03:39:02.996577', '1908', '2'), + ('5.99', '358', '2007-04-09T00:51:42.996577', '5023', '2'), + ('6.99', '358', '2007-03-18T09:43:01.996577', '12452', '1'), + ('2.99', '358', '2007-03-19T13:12:29.996577', '13197', '1'), + ('0.99', '358', '2007-04-30T05:51:43.996577', '9062', '2'), + ('2.99', '358', '2007-04-30T23:01:53.996577', '10193', '1'), + ('5.99', '358', '2007-02-17T18:28:51.996577', '2114', '1'), + ('0.99', '60', '2007-04-27T18:24:57.996577', '7494', '1'), + ('4.99', '60', '2007-02-15T19:46:42.996577', '1482', '2'), + ('4.99', '60', '2007-04-30T17:04:50.996577', '9356', '1'), + ('0.99', '60', '2007-03-01T15:56:31.996577', '10680', '2'), + ('3.99', '60', '2007-04-27T12:26:16.996577', '7331', '1'), + ('0.99', '60', '2007-04-27T02:23:36.996577', '7067', '2'), + ('5.99', '60', '2007-04-11T15:14:48.996577', '6282', '1'), + ('2.99', '60', '2007-04-06T15:18:09.996577', '3849', '1'), + ('5.99', '60', '2007-03-23T05:36:24.996577', '15618', '1'), + ('2.99', '60', '2007-04-05T21:26:00.996577', '3473', '2'), + ('2.99', '60', '2007-03-23T06:56:29.996577', '15649', '1'), + ('2.99', '60', '2007-03-22T18:43:42.996577', '15318', '1'), + ('4.99', '60', '2007-02-18T14:10:56.996577', '2394', '2'), + ('0.99', '136', '2007-03-21T08:21:29.996577', '14379', '2'), + ('2.99', '136', '2007-02-17T17:42:56.996577', '2104', '2'), + ('8.99', '136', '2007-04-12T05:19:18.996577', '6585', '1'), + ('5.99', '136', '2007-03-18T03:26:32.996577', '12287', '1'), + ('4.99', '136', '2007-03-22T23:02:54.996577', '15439', '1'), + ('0.99', '136', '2007-04-30T15:43:53.996577', '9319', '2'), + ('6.99', '287', '2007-04-30T17:02:17.996577', '10027', '1'), + ('2.99', '287', '2007-03-23T05:33:41.996577', '15614', '1'), + ('2.99', '287', '2007-04-11T21:02:28.996577', '6397', '1'), + ('2.99', '287', '2007-04-28T05:33:08.996577', '7777', '2'), + ('0.99', '287', '2007-03-22T11:24:55.996577', '15127', '2'), + ('4.99', '287', '2007-03-02T06:46:04.996577', '11106', '2'), + ('1.99', '287', '2007-03-22T09:34:00.996577', '15076', '2'), + ('6.99', '287', '2007-04-30T03:19:58.996577', '8994', '2'), + ('4.99', '287', '2007-03-01T20:54:36.996577', '10807', '2'), + ('4.99', '287', '2007-03-17T06:09:21.996577', '11716', '1'), + ('4.99', '287', '2007-04-08T17:59:28.996577', '4877', '2'), + ('4.99', '287', '2007-03-22T09:46:25.996577', '15084', '1'), + ('2.99', '287', '2007-03-19T00:58:50.996577', '12861', '2'), + ('0.99', '287', '2007-05-14T13:44:29.996577', '14204', '2'), + ('5.99', '135', '2007-03-02T10:04:19.996577', '11194', '2'), + ('5.99', '135', '2007-03-21T00:25:52.996577', '14136', '2'), + ('2.99', '135', '2007-03-23T16:10:26.996577', '15908', '2'), + ('0.99', '135', '2007-03-19T07:15:11.996577', '13035', '1'), + ('7.99', '135', '2007-04-29T23:04:52.996577', '8885', '2'), + ('3.99', '135', '2007-04-12T16:48:23.996577', '6817', '1'), + ('3.99', '135', '2007-04-11T23:42:29.996577', '6461', '1'), + ('0.99', '135', '2007-05-14T13:44:29.996577', '13390', '1'), + ('0.99', '135', '2007-02-15T06:11:24.996577', '1272', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['23946', '23947', '25083', '31832', '25084', '31829', '25081', '25078', '31828', '25071', '19476', '31831', '25075', '31826', '25072', '25082', '25085', '25073', '31824', '25076', '31827', '25077', '31830', '24631', '31267', '31262', '31271', '31270', '24632', '31268', '24628', '19291', '31273', '24627', '31269', '31264', '31430', '31424', '24769', '24761', '31432', '19344', '24768', '24765', '31429', '19343', '31431', '25962', '25961', '25957', '20146', '20149', '25952', '25958', '20147', '20152', '21156', '27127', '27124', '27126', '27121', '21154', '21158', '27128', '27130', '31963', '19536', '19538', '25175', '19530', '19532', '25166', '25174', '25169', '19533', '25165', '22224', '22223', '22218', '18299', '22227', '22225', '28378', '22222', '18300', '22220', '22229', '20802', '26704', '26714', '20793', '20796', '17746', '17747', '17749', '20798', '26710', '17750', '17751', '18769']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('7.99', '135', '2007-03-17T05:49:48.996577', '11704', '1'), + ('2.99', '135', '2007-03-18T02:22:00.996577', '12249', '1'), + ('10.99', '259', '2007-03-22T22:34:23.996577', '15425', '1'), + ('6.99', '259', '2007-04-30T13:45:57.996577', '9282', '1'), + ('2.99', '259', '2007-03-23T00:07:36.996577', '15473', '1'), + ('7.99', '259', '2007-04-28T05:31:51.996577', '7774', '2'), + ('4.99', '259', '2007-03-21T01:29:05.996577', '14170', '2'), + ('5.99', '259', '2007-03-20T04:27:43.996577', '13598', '1'), + ('2.99', '259', '2007-04-27T07:00:34.996577', '7188', '2'), + ('3.99', '259', '2007-03-01T09:56:56.996577', '10510', '1'), + ('2.99', '259', '2007-02-16T19:39:26.996577', '1813', '2'), + ('6.99', '259', '2007-04-30T11:15:06.996577', '9205', '2'), + ('4.99', '259', '2007-03-19T09:51:46.996577', '13109', '1'), + ('0.99', '259', '2007-04-11T03:28:22.996577', '6074', '1'), + ('2.99', '259', '2007-03-01T19:51:07.996577', '10781', '1'), + ('2.99', '259', '2007-03-22T05:14:23.996577', '14966', '2'), + ('2.99', '259', '2007-03-23T08:21:21.996577', '15689', '1'), + ('3.99', '259', '2007-03-02T09:29:52.996577', '11184', '1'), + ('5.99', '259', '2007-04-07T09:41:33.996577', '4199', '2'), + ('2.99', '259', '2007-03-19T09:55:36.996577', '13112', '2'), + ('3.99', '259', '2007-04-12T03:19:15.996577', '6539', '2'), + ('4.99', '259', '2007-03-19T19:43:11.996577', '13366', '2'), + ('4.99', '259', '2007-04-28T06:49:21.996577', '7817', '1'), + ('6.99', '209', '2007-03-21T17:16:15.996577', '14631', '2'), + ('6.99', '209', '2007-04-27T04:15:09.996577', '7116', '1'), + ('4.99', '209', '2007-04-08T15:32:32.996577', '4810', '2'), + ('4.99', '209', '2007-04-28T15:48:43.996577', '8067', '1'), + ('5.99', '209', '2007-04-28T04:29:26.996577', '7752', '2'), + ('2.99', '209', '2007-03-22T16:41:33.996577', '15254', '1'), + ('3.99', '209', '2007-04-27T09:52:13.996577', '7269', '1'), + ('6.99', '209', '2007-03-01T21:09:41.996577', '10811', '2'), + ('4.99', '209', '2007-02-19T08:50:11.996577', '2650', '1'), + ('2.99', '209', '2007-04-29T20:21:26.996577', '8816', '2'), + ('4.99', '209', '2007-03-01T14:26:21.996577', '10646', '1'), + ('4.99', '209', '2007-04-27T18:56:29.996577', '7505', '1'), + ('3.99', '209', '2007-04-09T07:52:45.996577', '5170', '2'), + ('2.99', '224', '2007-04-29T05:57:09.996577', '8439', '2'), + ('2.99', '224', '2007-04-07T05:31:56.996577', '4118', '1'), + ('1.99', '224', '2007-03-23T17:39:55.996577', '15952', '1'), + ('4.99', '224', '2007-03-18T11:17:30.996577', '12492', '1'), + ('0.99', '224', '2007-04-30T10:34:24.996577', '9181', '1'), + ('4.99', '224', '2007-02-21T04:47:08.996577', '3282', '2'), + ('0.99', '224', '2007-03-22T15:46:58.996577', '15225', '1'), + ('5.99', '224', '2007-03-21T04:51:55.996577', '14271', '2'), + ('0.99', '224', '2007-04-28T23:30:56.996577', '8255', '2'), + ('2.99', '224', '2007-02-18T05:03:29.996577', '2277', '1'), + ('4.99', '224', '2007-04-29T11:42:00.996577', '8605', '1'), + ('0.99', '336', '2007-04-30T17:44:24.996577', '10055', '1'), + ('0.99', '336', '2007-04-30T15:15:43.996577', '9306', '2'), + ('4.99', '336', '2007-04-29T00:04:13.996577', '8275', '2'), + ('8.99', '336', '2007-03-18T05:04:48.996577', '12323', '1'), + ('0.99', '336', '2007-03-19T08:19:05.996577', '13066', '2'), + ('2.99', '336', '2007-04-08T05:08:51.996577', '4595', '1'), + ('6.99', '336', '2007-04-29T05:05:28.996577', '8407', '1'), + ('0.99', '336', '2007-03-18T22:49:03.996577', '12794', '2'), + ('10.99', '336', '2007-03-22T09:29:41.996577', '15073', '1'), + ('0.99', '440', '2007-03-21T14:31:28.996577', '14555', '1'), + ('0.99', '440', '2007-04-27T22:43:04.996577', '7614', '1'), + ('2.99', '440', '2007-04-10T10:00:18.996577', '5731', '2'), + ('4.99', '440', '2007-04-27T21:46:48.996577', '7585', '2'), + ('7.99', '440', '2007-04-08T21:14:49.996577', '4946', '1'), + ('4.99', '440', '2007-03-19T20:07:17.996577', '13384', '2'), + ('0.99', '440', '2007-03-22T16:56:04.996577', '15264', '2'), + ('9.99', '440', '2007-04-28T06:26:43.996577', '7806', '1'), + ('2.99', '440', '2007-04-30T10:58:09.996577', '9195', '1'), + ('4.99', '440', '2007-05-14T13:44:29.996577', '13106', '1'), + ('4.99', '268', '2007-03-21T08:13:19.996577', '14373', '2'), + ('2.99', '268', '2007-03-22T14:18:20.996577', '15183', '2'), + ('3.99', '268', '2007-04-30T23:40:19.996577', '9531', '2'), + ('7.99', '268', '2007-03-02T20:05:12.996577', '11462', '2'), + ('2.99', '268', '2007-03-17T17:39:00.996577', '12007', '2'), + ('4.99', '268', '2007-04-08T06:46:47.996577', '4626', '2'), + ('7.99', '268', '2007-04-30T20:01:27.996577', '9436', '2'), + ('2.99', '268', '2007-04-10T13:01:26.996577', '5793', '2'), + ('4.99', '268', '2007-03-18T18:39:05.996577', '12694', '2'), + ('4.99', '268', '2007-04-06T07:25:09.996577', '3670', '2'), + ('4.99', '554', '2007-03-19T11:00:36.996577', '13139', '2'), + ('0.99', '554', '2007-03-17T17:58:10.996577', '12014', '1'), + ('6.99', '554', '2007-03-01T13:23:57.996577', '10612', '1'), + ('6.99', '554', '2007-02-18T05:06:48.996577', '2279', '1'), + ('0.99', '554', '2007-03-21T11:35:50.996577', '14469', '1'), + ('2.99', '554', '2007-03-20T19:16:09.996577', '14015', '2'), + ('5.99', '554', '2007-04-10T22:31:37.996577', '5968', '1'), + ('8.99', '554', '2007-03-17T17:46:20.996577', '12010', '1'), + ('2.99', '554', '2007-02-21T04:09:56.996577', '3278', '2'), + ('9.99', '554', '2007-03-17T00:56:48.996577', '11589', '2'), + ('4.99', '554', '2007-03-23T08:21:56.996577', '15690', '2'), + ('5.99', '403', '2007-03-18T22:49:02.996577', '12793', '1'), + ('3.99', '403', '2007-04-06T10:14:19.996577', '3737', '2'), + ('5.99', '403', '2007-04-30T19:33:15.996577', '10109', '2'), + ('6.99', '403', '2007-03-01T11:12:43.996577', '10547', '1'), + ('9.99', '403', '2007-03-02T17:08:38.996577', '11391', '2'), + ('4.99', '403', '2007-02-15T02:03:42.996577', '1221', '2'), + ('8.99', '403', '2007-02-15T04:06:35.996577', '1249', '1'), + ('4.99', '403', '2007-02-20T03:10:07.996577', '2927', '1'), + ('0.99', '403', '2007-03-02T19:56:29.996577', '11460', '2'), + ('5.99', '403', '2007-04-28T13:58:52.996577', '8013', '2'), + ('6.99', '403', '2007-02-20T11:19:27.996577', '3049', '2'), + ('5.99', '403', '2007-02-21T10:07:11.996577', '3356', '1'), + ('2.99', '68', '2007-02-19T07:21:36.996577', '2633', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['23333', '29743', '29749', '23332', '18770', '23335', '29741', '29748', '29742', '18771', '30884', '24284', '30892', '30889', '30896', '24282', '30890', '30895', '24285', '19143', '30882', '24770', '31446', '31443', '31445', '31442', '31439', '31444', '31440', '24772', '31435', '18544', '29118', '29125', '29128', '22790', '22791', '22789', '29120', '29116', '18542', '29117', '30050', '23593', '30051', '30054', '30058', '18873', '30057', '31167', '31170', '31166', '24528', '24529', '24527', '19245', '24522', '24524', '31168', '24520', '31164', '26177', '26182', '26187', '26178', '26189', '20340', '17563', '20343', '20349', '26181', '17562', '27198', '27201', '17898', '21215', '27194', '27193', '27195', '17900', '27197', '21218', '21216', '17897', '27196', '27204', '27199', '23767', '23768', '18958', '23764', '30318', '23765', '30316', '23763', '23761', '23766', '23760', '18959', '30317']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('2.99', '68', '2007-03-18T20:50:29.996577', '12742', '2'), + ('6.99', '68', '2007-04-08T03:17:02.996577', '4555', '2'), + ('7.99', '68', '2007-04-30T19:42:13.996577', '10115', '1'), + ('2.99', '68', '2007-03-02T12:57:16.996577', '11277', '1'), + ('4.99', '68', '2007-02-19T09:22:08.996577', '2662', '2'), + ('0.99', '68', '2007-03-21T03:54:25.996577', '14242', '2'), + ('4.99', '68', '2007-04-06T13:34:16.996577', '3801', '2'), + ('4.99', '68', '2007-04-30T04:02:23.996577', '9642', '2'), + ('0.99', '68', '2007-04-06T16:10:08.996577', '3864', '1'), + ('2.99', '68', '2007-02-19T11:12:46.996577', '2686', '1'), + ('0.99', '167', '2007-04-09T06:03:29.996577', '5131', '2'), + ('3.99', '167', '2007-03-22T06:39:50.996577', '15003', '1'), + ('4.99', '167', '2007-04-28T22:30:48.996577', '8227', '2'), + ('4.99', '167', '2007-04-11T14:27:09.996577', '6269', '2'), + ('4.99', '167', '2007-04-30T00:57:05.996577', '9563', '2'), + ('6.99', '167', '2007-03-20T12:11:48.996577', '13825', '1'), + ('4.99', '167', '2007-04-27T22:37:02.996577', '7608', '1'), + ('0.99', '167', '2007-04-29T22:20:38.996577', '8864', '2'), + ('0.99', '167', '2007-03-22T08:36:18.996577', '15050', '1'), + ('5.99', '167', '2007-02-18T13:28:56.996577', '2381', '2'), + ('4.99', '167', '2007-04-05T23:24:29.996577', '3518', '2'), + ('2.99', '225', '2007-03-01T20:16:29.996577', '10793', '1'), + ('4.99', '225', '2007-04-28T17:36:11.996577', '8110', '2'), + ('4.99', '225', '2007-04-27T12:59:50.996577', '7347', '2'), + ('7.99', '225', '2007-04-28T15:30:44.996577', '8054', '1'), + ('2.99', '225', '2007-04-12T03:06:58.996577', '6532', '2'), + ('2.99', '225', '2007-04-11T17:16:07.996577', '6317', '1'), + ('6.99', '225', '2007-04-27T19:40:10.996577', '7524', '1'), + ('2.99', '225', '2007-04-11T18:58:41.996577', '6350', '2'), + ('0.99', '225', '2007-03-02T16:51:27.996577', '11384', '2'), + ('7.99', '225', '2007-04-08T16:06:05.996577', '4824', '1'), + ('2.99', '12', '2007-02-20T18:02:18.996577', '3135', '2'), + ('0.99', '12', '2007-04-09T03:34:50.996577', '5074', '1'), + ('4.99', '12', '2007-04-30T09:54:54.996577', '9166', '2'), + ('5.99', '12', '2007-04-30T06:13:59.996577', '9708', '2'), + ('0.99', '12', '2007-03-16T21:20:56.996577', '11497', '2'), + ('4.99', '12', '2007-03-18T15:27:14.996577', '12604', '1'), + ('10.99', '12', '2007-03-01T05:18:52.996577', '10392', '2'), + ('3.99', '12', '2007-04-09T11:48:51.996577', '5242', '2'), + ('3.99', '12', '2007-04-06T16:26:20.996577', '3870', '1'), + ('5.99', '12', '2007-02-18T21:35:38.996577', '2500', '2'), + ('0.99', '12', '2007-04-09T03:29:05.996577', '5071', '1'), + ('1.99', '95', '2007-04-06T05:11:52.996577', '3633', '1'), + ('7.99', '95', '2007-03-20T01:01:11.996577', '13516', '2'), + ('4.99', '95', '2007-04-06T22:27:03.996577', '4000', '2'), + ('4.99', '95', '2007-04-27T17:30:45.996577', '7471', '1'), + ('0.99', '95', '2007-04-30T20:12:56.996577', '10130', '1'), + ('0.99', '95', '2007-02-21T16:40:36.996577', '3426', '2'), + ('4.99', '95', '2007-04-30T14:19:42.996577', '9951', '1'), + ('0.99', '192', '2007-04-28T15:24:42.996577', '8051', '2'), + ('2.99', '192', '2007-04-30T10:27:58.996577', '9831', '1'), + ('2.99', '192', '2007-04-27T05:31:00.996577', '7147', '2'), + ('6.99', '192', '2007-03-21T19:11:47.996577', '14692', '2'), + ('2.99', '192', '2007-03-23T14:27:27.996577', '15855', '2'), + ('4.99', '192', '2007-03-21T09:11:30.996577', '14404', '1'), + ('3.99', '192', '2007-02-19T15:44:59.996577', '2760', '1'), + ('4.99', '192', '2007-03-02T16:51:37.996577', '11385', '1'), + ('5.99', '192', '2007-03-19T10:26:15.996577', '13125', '1'), + ('7.99', '192', '2007-04-29T00:58:02.996577', '8292', '2'), + ('0.99', '192', '2007-03-01T00:36:31.996577', '10238', '2'), + ('0.99', '192', '2007-04-11T11:55:35.996577', '6223', '2'), + ('6.99', '356', '2007-04-06T14:28:06.996577', '3829', '2'), + ('2.99', '356', '2007-04-27T02:50:24.996577', '7079', '1'), + ('4.99', '356', '2007-04-30T04:51:40.996577', '9037', '2'), + ('4.99', '356', '2007-04-08T05:16:52.996577', '4599', '2'), + ('6.99', '356', '2007-04-30T12:22:03.996577', '9883', '2'), + ('2.99', '356', '2007-03-17T00:26:15.996577', '11579', '2'), + ('2.99', '356', '2007-02-18T15:05:04.996577', '2405', '1'), + ('0.99', '356', '2007-03-19T02:54:05.996577', '12913', '1'), + ('2.99', '356', '2007-03-23T11:15:42.996577', '15757', '1'), + ('0.99', '356', '2007-04-12T09:14:56.996577', '6648', '1'), + ('0.99', '356', '2007-02-15T15:28:12.996577', '1410', '1'), + ('0.99', '446', '2007-04-12T03:12:09.996577', '6535', '1'), + ('0.99', '446', '2007-04-27T03:12:08.996577', '7089', '2'), + ('0.99', '446', '2007-02-19T12:32:22.996577', '2710', '2'), + ('0.99', '446', '2007-03-18T02:29:16.996577', '12253', '2'), + ('4.99', '446', '2007-04-09T18:03:38.996577', '5393', '2'), + ('4.99', '446', '2007-04-07T17:55:30.996577', '4358', '2'), + ('2.99', '446', '2007-04-09T18:45:45.996577', '5409', '2'), + ('0.99', '446', '2007-02-20T20:14:27.996577', '3168', '2'), + ('4.99', '446', '2007-04-12T02:04:05.996577', '6510', '1'), + ('0.99', '446', '2007-03-23T17:38:58.996577', '15951', '2'), + ('8.99', '446', '2007-03-18T10:55:09.996577', '12480', '2'), + ('6.99', '446', '2007-02-18T22:57:26.996577', '2520', '2'), + ('0.99', '446', '2007-04-11T23:28:38.996577', '6454', '2'), + ('4.99', '446', '2007-04-29T01:50:46.996577', '8309', '1'), + ('6.99', '446', '2007-04-12T12:32:50.996577', '6734', '1'), + ('2.99', '117', '2007-03-22T00:55:13.996577', '14854', '2'), + ('2.99', '117', '2007-03-22T22:55:18.996577', '15432', '1'), + ('2.99', '117', '2007-02-16T15:47:10.996577', '1755', '1'), + ('6.99', '117', '2007-03-18T14:06:08.996577', '12575', '1'), + ('2.99', '117', '2007-04-29T14:47:43.996577', '8687', '1'), + ('4.99', '117', '2007-03-18T15:52:28.996577', '12618', '1'), + ('9.99', '117', '2007-04-11T04:21:16.996577', '6093', '1'), + ('2.99', '117', '2007-03-18T05:30:50.996577', '12337', '1'), + ('3.99', '117', '2007-03-02T20:15:33.996577', '11467', '2'), + ('0.99', '117', '2007-03-21T22:51:39.996577', '14784', '1'), + ('4.99', '117', '2007-03-01T11:28:46.996577', '10558', '1'), + ('2.99', '117', '2007-02-21T00:06:35.996577', '3218', '2'), + ('6.99', '117', '2007-04-11T23:17:24.996577', '6449', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['22816', '18551', '22830', '22832', '29160', '29161', '29157', '22825', '18552', '29156', '22820', '22826', '22823', '26917', '26907', '26919', '26913', '20995', '26915', '31958', '26908', '20994', '20990', '20988', '18637', '29340', '18639', '29339', '29351', '18638', '29345', '29349', '29352', '29348', '22996', '29341', '22994', '19847', '19852', '19844', '25552', '19849', '31929', '25551', '19850', '25544', '19845', '25541', '25548', '25550', '19851', '25547', '25539', '21997', '21995', '28117', '21998', '28126', '18221', '28120', '21993', '21992', '28129', '28121', '22001', '28125', '21994', '18222', '28128', '30935', '24314', '24312', '30926', '30930', '24310', '30928', '24316', '24318', '30933', '30925', '18625', '29331', '22989', '29327', '22991', '29329', '18626', '18630', '18631', '22992', '29332', '18635', '29337', '18633', '18236', '22045', '22051', '31990', '22046', '28183']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('2.99', '15', '2007-03-02T07:57:37.996577', '11141', '1'), + ('2.99', '15', '2007-02-18T19:55:22.996577', '2486', '1'), + ('8.99', '15', '2007-03-22T01:52:07.996577', '14872', '2'), + ('4.99', '15', '2007-03-23T15:40:57.996577', '15897', '1'), + ('6.99', '15', '2007-04-29T12:04:27.996577', '8615', '2'), + ('4.99', '15', '2007-04-30T00:41:57.996577', '8927', '2'), + ('2.99', '15', '2007-04-10T22:42:45.996577', '5975', '2'), + ('5.99', '15', '2007-03-20T00:28:59.996577', '13503', '2'), + ('5.99', '15', '2007-02-20T03:44:03.996577', '2937', '1'), + ('2.99', '15', '2007-04-10T09:30:29.996577', '5717', '1'), + ('2.99', '15', '2007-03-18T03:07:36.996577', '12272', '2'), + ('4.99', '15', '2007-03-20T02:10:07.996577', '13541', '1'), + ('8.99', '15', '2007-03-19T18:47:02.996577', '13339', '2'), + ('4.99', '421', '2007-04-30T17:40:44.996577', '9377', '2'), + ('7.99', '421', '2007-04-05T22:09:34.996577', '3491', '1'), + ('4.99', '421', '2007-04-30T23:07:31.996577', '10200', '1'), + ('4.99', '421', '2007-04-27T16:46:07.996577', '7449', '2'), + ('3.99', '421', '2007-03-22T02:32:57.996577', '14887', '1'), + ('4.99', '421', '2007-04-28T23:51:49.996577', '8268', '1'), + ('0.99', '421', '2007-05-14T13:44:29.996577', '15710', '2'), + ('5.99', '421', '2007-04-06T08:43:52.996577', '3703', '2'), + ('4.99', '421', '2007-03-21T21:07:27.996577', '14742', '1'), + ('3.99', '421', '2007-03-16T22:38:36.996577', '11523', '1'), + ('2.99', '421', '2007-03-02T06:20:46.996577', '11089', '2'), + ('0.99', '32', '2007-02-17T22:07:37.996577', '2160', '2'), + ('2.99', '32', '2007-04-08T14:01:58.996577', '4771', '2'), + ('1.99', '32', '2007-02-20T00:30:31.996577', '2891', '2'), + ('2.99', '32', '2007-04-07T21:17:00.996577', '4434', '1'), + ('2.99', '32', '2007-04-29T06:14:55.996577', '8453', '2'), + ('5.99', '32', '2007-02-19T06:50:35.996577', '2624', '2'), + ('3.99', '32', '2007-04-11T06:26:33.996577', '6122', '1'), + ('2.99', '32', '2007-04-28T05:54:40.996577', '7793', '1'), + ('2.99', '32', '2007-04-30T00:10:29.996577', '8914', '2'), + ('5.99', '32', '2007-04-27T21:52:02.996577', '7589', '1'), + ('8.99', '32', '2007-03-20T08:59:49.996577', '13736', '1'), + ('0.99', '32', '2007-04-08T19:05:37.996577', '4899', '2'), + ('4.99', '32', '2007-03-17T11:23:13.996577', '11831', '2'), + ('6.99', '300', '2007-03-20T00:20:56.996577', '13499', '2'), + ('5.99', '300', '2007-03-23T13:12:12.996577', '15811', '2'), + ('5.99', '300', '2007-03-18T16:50:53.996577', '12644', '2'), + ('0.99', '300', '2007-04-30T09:03:48.996577', '9791', '2'), + ('7.99', '300', '2007-03-21T18:30:00.996577', '14674', '1'), + ('4.99', '300', '2007-05-14T13:44:29.996577', '15695', '1'), + ('2.99', '300', '2007-04-30T08:15:02.996577', '9127', '2'), + ('9.99', '300', '2007-03-21T19:36:25.996577', '14709', '1'), + ('5.99', '300', '2007-04-12T16:52:05.996577', '6822', '1'), + ('3.99', '300', '2007-03-19T15:29:46.996577', '13257', '2'), + ('2.99', '300', '2007-04-10T01:46:08.996577', '5562', '2'), + ('6.99', '300', '2007-04-28T21:59:31.996577', '8210', '1'), + ('0.99', '300', '2007-04-30T06:29:26.996577', '9078', '1'), + ('2.99', '300', '2007-03-22T08:37:16.996577', '15051', '2'), + ('6.99', '300', '2007-04-28T17:48:42.996577', '8117', '1'), + ('0.99', '300', '2007-04-06T11:55:59.996577', '3775', '1'), + ('2.99', '529', '2007-03-20T11:02:02.996577', '13797', '1'), + ('4.99', '529', '2007-03-19T06:22:24.996577', '13011', '1'), + ('0.99', '529', '2007-04-07T01:54:40.996577', '4045', '2'), + ('9.99', '529', '2007-03-20T16:12:58.996577', '13946', '2'), + ('2.99', '529', '2007-04-29T15:52:39.996577', '8708', '2'), + ('1.99', '529', '2007-02-15T02:50:18.996577', '1234', '1'), + ('0.99', '529', '2007-04-08T03:12:07.996577', '4553', '1'), + ('2.99', '529', '2007-03-18T06:05:31.996577', '12356', '2'), + ('2.99', '529', '2007-03-17T12:23:19.996577', '11862', '1'), + ('0.99', '529', '2007-04-30T17:38:43.996577', '9375', '2'), + ('4.99', '529', '2007-04-10T23:35:07.996577', '5993', '1'), + ('5.99', '529', '2007-03-22T05:17:55.996577', '14970', '1'), + ('3.99', '529', '2007-04-27T04:43:02.996577', '7128', '1'), + ('3.99', '529', '2007-03-18T16:02:37.996577', '12622', '1'), + ('0.99', '529', '2007-02-16T10:36:46.996577', '1686', '2'), + ('4.99', '529', '2007-04-30T15:25:35.996577', '9310', '2'), + ('9.99', '170', '2007-04-30T19:17:36.996577', '10102', '1'), + ('0.99', '170', '2007-03-19T08:47:32.996577', '13081', '1'), + ('3.99', '170', '2007-03-18T19:13:00.996577', '12706', '2'), + ('4.99', '170', '2007-04-07T05:18:18.996577', '4113', '2'), + ('7.99', '170', '2007-04-10T07:30:04.996577', '5685', '2'), + ('5.99', '170', '2007-03-01T08:45:52.996577', '10481', '2'), + ('0.99', '170', '2007-04-09T03:40:33.996577', '5075', '2'), + ('8.99', '170', '2007-03-20T19:37:15.996577', '14022', '2'), + ('7.99', '170', '2007-03-23T02:55:32.996577', '15549', '1'), + ('2.99', '170', '2007-04-30T23:09:49.996577', '9517', '2'), + ('4.99', '170', '2007-04-06T10:46:29.996577', '3749', '1'), + ('4.99', '31', '2007-02-16T08:34:06.996577', '1656', '2'), + ('3.99', '31', '2007-04-11T11:03:22.996577', '6208', '1'), + ('4.99', '31', '2007-03-17T20:45:35.996577', '12085', '2'), + ('4.99', '31', '2007-04-06T08:41:11.996577', '3701', '1'), + ('6.99', '31', '2007-03-23T08:06:00.996577', '15682', '2'), + ('6.99', '31', '2007-04-07T05:44:01.996577', '4122', '1'), + ('1.99', '31', '2007-02-16T21:48:42.996577', '1838', '1'), + ('0.99', '31', '2007-02-18T17:02:47.996577', '2438', '2'), + ('0.99', '31', '2007-02-18T23:48:26.996577', '2530', '1'), + ('6.99', '31', '2007-03-23T13:26:32.996577', '15816', '2'), + ('4.99', '31', '2007-04-12T04:54:36.996577', '6580', '2'), + ('0.99', '31', '2007-02-20T23:07:13.996577', '3205', '1'), + ('0.99', '31', '2007-04-30T03:22:22.996577', '8997', '2'), + ('2.99', '31', '2007-02-20T16:33:41.996577', '3117', '2'), + ('4.99', '534', '2007-02-16T05:04:59.996577', '1610', '1'), + ('0.99', '534', '2007-03-01T20:25:07.996577', '10796', '1'), + ('1.99', '534', '2007-03-21T23:44:17.996577', '14816', '2'), + ('2.99', '534', '2007-05-14T13:44:29.996577', '14526', '1'), + ('5.99', '534', '2007-03-02T09:22:56.996577', '11180', '2'), + ('2.99', '534', '2007-04-27T04:09:46.996577', '7113', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['18237', '28184', '22050', '26830', '20904', '26829', '20906', '26834', '30384', '23832', '23826', '30381', '30382', '30383', '30379', '23829', '23831', '23825', '31607', '31605', '19398', '24882', '24881', '31610', '24880', '24878', '31613', '25195', '25196', '25197', '25198', '19564', '25194', '19601', '25228', '31921', '19594', '25232', '19602', '19595', '25225', '19591', '19590', '19592', '19589', '25230', '29646', '29651', '29649', '23254', '29650', '18741', '23257', '29654', '29652', '23251', '23252', '23250', '18740', '29647', '22626', '28914', '22625', '28913', '28911', '28917', '22628', '23435', '23436', '29854', '29864', '29866', '29858', '29862', '23428', '23433', '23429', '23432', '29863', '24146', '24143', '32058', '30722', '24148', '30721', '24152', '24149', '19092', '30724', '21747', '27816', '27823', '21748', '21752', '21746', '27822', '18122', '27815', '18121', '21745']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('2.99', '534', '2007-02-16T09:08:43.996577', '1673', '1'), + ('2.99', '534', '2007-04-28T00:44:34.996577', '7662', '1'), + ('0.99', '534', '2007-03-19T17:05:01.996577', '13294', '2'), + ('0.99', '413', '2007-04-07T23:59:12.996577', '4491', '2'), + ('3.99', '413', '2007-03-19T06:20:47.996577', '13010', '1'), + ('4.99', '413', '2007-04-06T11:21:15.996577', '3762', '1'), + ('4.99', '413', '2007-03-20T12:11:38.996577', '13824', '2'), + ('0.99', '413', '2007-04-28T03:29:44.996577', '7731', '2'), + ('4.99', '123', '2007-04-29T15:21:26.996577', '8699', '2'), + ('2.99', '123', '2007-03-23T12:20:23.996577', '15787', '2'), + ('2.99', '123', '2007-03-18T06:15:01.996577', '12360', '1'), + ('0.99', '123', '2007-04-28T05:12:29.996577', '7768', '2'), + ('2.99', '123', '2007-04-28T08:02:55.996577', '7852', '1'), + ('5.99', '123', '2007-04-28T12:26:03.996577', '7969', '1'), + ('4.99', '123', '2007-04-27T20:01:05.996577', '7535', '2'), + ('7.99', '123', '2007-03-22T12:53:47.996577', '15152', '2'), + ('1.99', '123', '2007-03-23T05:42:09.996577', '15621', '1'), + ('8.99', '123', '2007-03-01T02:22:15.996577', '10295', '2'), + ('0.99', '238', '2007-04-11T21:14:51.996577', '6403', '2'), + ('0.99', '238', '2007-04-07T06:50:33.996577', '4143', '1'), + ('2.99', '238', '2007-02-20T21:19:28.996577', '3181', '1'), + ('0.99', '238', '2007-03-22T23:33:26.996577', '15455', '1'), + ('8.99', '238', '2007-03-21T07:08:47.996577', '14343', '1'), + ('6.99', '238', '2007-04-29T04:01:47.996577', '8382', '1'), + ('4.99', '238', '2007-03-21T06:17:00.996577', '14312', '1'), + ('2.99', '238', '2007-03-17T02:57:58.996577', '11632', '2'), + ('7.99', '238', '2007-04-30T10:52:45.996577', '9841', '2'), + ('1.99', '271', '2007-04-10T17:38:23.996577', '5878', '2'), + ('2.99', '271', '2007-04-10T20:05:19.996577', '5922', '1'), + ('2.99', '271', '2007-04-11T00:45:13.996577', '6024', '1'), + ('3.99', '271', '2007-04-27T22:52:40.996577', '7618', '1'), + ('4.99', '271', '2007-03-18T01:18:20.996577', '12219', '1'), + ('2.99', '271', '2007-04-08T02:46:13.996577', '4545', '2'), + ('2.99', '274', '2007-03-22T16:52:42.996577', '15260', '1'), + ('5.99', '274', '2007-04-29T05:03:11.996577', '8406', '2'), + ('0.99', '274', '2007-05-14T13:44:29.996577', '13486', '1'), + ('8.99', '274', '2007-03-19T10:33:30.996577', '13129', '2'), + ('4.99', '274', '2007-04-30T17:49:15.996577', '10059', '2'), + ('2.99', '274', '2007-03-22T19:00:04.996577', '15328', '2'), + ('8.99', '274', '2007-03-20T02:27:07.996577', '13549', '1'), + ('2.99', '274', '2007-04-08T04:37:35.996577', '4582', '2'), + ('2.99', '274', '2007-03-02T16:17:05.996577', '11363', '2'), + ('3.99', '274', '2007-03-02T05:07:10.996577', '11058', '1'), + ('3.99', '274', '2007-03-18T04:55:31.996577', '12321', '1'), + ('0.99', '274', '2007-03-01T22:35:03.996577', '10855', '2'), + ('4.99', '274', '2007-04-30T16:15:16.996577', '9331', '1'), + ('2.99', '59', '2007-04-07T07:05:24.996577', '4148', '2'), + ('3.99', '59', '2007-04-09T09:44:10.996577', '5207', '1'), + ('3.99', '59', '2007-04-08T18:34:45.996577', '4891', '1'), + ('5.99', '59', '2007-03-21T00:22:20.996577', '14135', '1'), + ('8.99', '59', '2007-04-09T09:07:57.996577', '5195', '2'), + ('3.99', '59', '2007-02-20T02:41:30.996577', '2921', '1'), + ('4.99', '59', '2007-03-23T10:44:17.996577', '15744', '2'), + ('4.99', '59', '2007-04-29T13:13:49.996577', '8643', '2'), + ('4.99', '59', '2007-04-10T15:02:26.996577', '5830', '1'), + ('2.99', '59', '2007-03-19T16:36:44.996577', '13282', '2'), + ('2.99', '59', '2007-03-20T03:38:40.996577', '13573', '1'), + ('5.99', '59', '2007-03-19T00:10:54.996577', '12833', '1'), + ('3.99', '59', '2007-02-16T13:57:55.996577', '1728', '1'), + ('4.99', '59', '2007-04-07T19:15:11.996577', '4384', '1'), + ('8.99', '202', '2007-03-18T22:55:45.996577', '12801', '2'), + ('2.99', '202', '2007-04-10T15:33:22.996577', '5838', '2'), + ('4.99', '202', '2007-03-17T14:50:31.996577', '11924', '2'), + ('2.99', '202', '2007-04-09T14:00:55.996577', '5297', '1'), + ('4.99', '202', '2007-04-08T03:48:30.996577', '4567', '2'), + ('2.99', '202', '2007-04-29T18:43:26.996577', '8779', '1'), + ('3.99', '202', '2007-03-20T01:31:57.996577', '13528', '1'), + ('0.99', '78', '2007-03-19T21:57:32.996577', '13432', '1'), + ('5.99', '78', '2007-03-20T10:50:03.996577', '13792', '2'), + ('5.99', '78', '2007-04-07T11:10:02.996577', '4227', '2'), + ('6.99', '78', '2007-04-28T12:02:34.996577', '7957', '1'), + ('5.99', '78', '2007-04-30T06:00:11.996577', '9068', '1'), + ('0.99', '78', '2007-04-10T03:33:26.996577', '5604', '2'), + ('4.99', '78', '2007-04-28T04:18:37.996577', '7747', '2'), + ('3.99', '78', '2007-03-01T03:58:31.996577', '10350', '2'), + ('4.99', '78', '2007-03-18T17:21:43.996577', '12653', '2'), + ('2.99', '78', '2007-03-01T12:40:19.996577', '10590', '1'), + ('8.99', '78', '2007-03-18T10:38:29.996577', '12474', '2'), + ('3.99', '78', '2007-04-28T10:41:28.996577', '7926', '2'), + ('2.99', '152', '2007-03-18T18:43:22.996577', '12697', '1'), + ('6.99', '152', '2007-03-01T03:07:52.996577', '10320', '1'), + ('4.99', '152', '2007-05-14T13:44:29.996577', '11848', '2'), + ('4.99', '152', '2007-04-08T22:29:02.996577', '4974', '1'), + ('1.99', '152', '2007-03-19T04:50:18.996577', '12960', '2'), + ('7.99', '152', '2007-04-06T12:29:07.996577', '3786', '1'), + ('0.99', '152', '2007-03-21T01:29:27.996577', '14173', '1'), + ('4.99', '152', '2007-03-19T13:31:14.996577', '13204', '1'), + ('4.99', '152', '2007-02-19T23:54:52.996577', '2882', '1'), + ('2.99', '152', '2007-04-12T06:56:59.996577', '6612', '1'), + ('0.99', '502', '2007-03-17T02:34:48.996577', '11620', '1'), + ('7.99', '502', '2007-04-11T21:54:39.996577', '6414', '2'), + ('4.99', '502', '2007-04-28T09:05:50.996577', '7884', '1'), + ('4.99', '502', '2007-03-18T21:35:20.996577', '12762', '1'), + ('3.99', '502', '2007-03-23T20:35:00.996577', '16034', '1'), + ('0.99', '502', '2007-03-02T18:42:49.996577', '11435', '1'), + ('4.99', '502', '2007-04-28T04:51:26.996577', '7757', '1'), + ('0.99', '502', '2007-02-20T02:01:03.996577', '2911', '1'), + ('2.99', '502', '2007-04-10T06:27:50.996577', '5662', '2'), + ('0.99', '502', '2007-02-18T15:50:54.996577', '2420', '2'), + ('4.99', '502', '2007-03-02T14:37:18.996577', '11317', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['27818', '21742', '27700', '27703', '18085', '27699', '27702', '27701', '27705', '21661', '21660', '18087', '21662', '18086', '23807', '23805', '23812', '23814', '30355', '23813', '30356', '30361', '30357', '23808', '18972', '30358', '23806', '24712', '31351', '31355', '24707', '24705', '31352', '31354', '31358', '19325', '31356', '20972', '20974', '20977', '26887', '26890', '20979', '26888', '26885', '20975', '26892', '20476', '26353', '20478', '20475', '26352', '20472', '20471', '26356', '26354', '20477', '19799', '25499', '19800', '25497', '19807', '25500', '25501', '25492', '19806', '25496', '19805', '25502', '27883', '27881', '27888', '27884', '27885', '27892', '21809', '21808', '21807', '27893', '20575', '20572', '17650', '26453', '20569', '26457', '26454', '20566', '20570', '26452', '21812', '27900', '21816', '18142', '25726', '19988', '25729', '25731', '25728', '19989', '25723']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('2.99', '502', '2007-04-12T17:07:17.996577', '6828', '2'), + ('0.99', '502', '2007-03-02T01:33:48.996577', '10938', '1'), + ('2.99', '492', '2007-04-07T06:48:11.996577', '4142', '1'), + ('0.99', '492', '2007-04-10T03:38:12.996577', '5609', '1'), + ('1.99', '492', '2007-02-16T10:52:54.996577', '1691', '2'), + ('8.99', '492', '2007-04-07T06:03:51.996577', '4128', '2'), + ('0.99', '492', '2007-04-09T15:04:13.996577', '5325', '2'), + ('6.99', '492', '2007-04-07T12:49:25.996577', '4258', '2'), + ('2.99', '492', '2007-04-27T07:29:49.996577', '7203', '2'), + ('0.99', '492', '2007-03-23T13:34:25.996577', '15822', '2'), + ('2.99', '492', '2007-03-21T04:20:03.996577', '14255', '1'), + ('4.99', '492', '2007-02-17T07:11:58.996577', '1956', '2'), + ('4.99', '492', '2007-03-23T17:51:02.996577', '15958', '1'), + ('4.99', '492', '2007-02-16T23:23:24.996577', '1855', '2'), + ('1.99', '121', '2007-03-18T20:33:18.996577', '12734', '2'), + ('1.99', '121', '2007-03-18T02:05:57.996577', '12242', '2'), + ('9.99', '121', '2007-03-21T09:30:35.996577', '14412', '2'), + ('7.99', '121', '2007-03-22T10:53:21.996577', '15114', '2'), + ('0.99', '121', '2007-04-27T04:10:39.996577', '7114', '2'), + ('2.99', '121', '2007-03-21T11:21:20.996577', '14464', '1'), + ('0.99', '121', '2007-04-27T06:52:20.996577', '7185', '1'), + ('8.99', '121', '2007-04-30T02:28:45.996577', '8969', '2'), + ('2.99', '121', '2007-04-27T11:13:40.996577', '7298', '2'), + ('5.99', '121', '2007-03-19T01:56:39.996577', '12881', '1'), + ('2.99', '121', '2007-02-16T06:44:31.996577', '1634', '1'), + ('6.99', '121', '2007-04-29T03:44:47.996577', '8370', '1'), + ('3.99', '121', '2007-03-18T08:52:47.996577', '12428', '2'), + ('0.99', '217', '2007-03-22T11:04:06.996577', '15116', '2'), + ('3.99', '217', '2007-04-10T11:16:27.996577', '5762', '2'), + ('0.99', '217', '2007-04-30T09:45:03.996577', '9159', '1'), + ('2.99', '217', '2007-03-02T15:46:33.996577', '11347', '1'), + ('5.99', '217', '2007-03-01T12:20:56.996577', '10581', '1'), + ('4.99', '217', '2007-04-12T04:18:57.996577', '6570', '2'), + ('4.99', '217', '2007-04-29T02:44:26.996577', '8332', '2'), + ('2.99', '217', '2007-04-30T07:44:40.996577', '9745', '2'), + ('6.99', '217', '2007-02-17T15:12:13.996577', '2076', '1'), + ('2.99', '217', '2007-04-30T15:42:03.996577', '9317', '2'), + ('2.99', '419', '2007-03-01T04:52:14.996577', '10372', '1'), + ('2.99', '419', '2007-03-02T14:31:17.996577', '11313', '1'), + ('6.99', '419', '2007-03-17T05:10:34.996577', '11689', '2'), + ('0.99', '419', '2007-04-10T16:53:49.996577', '5863', '2'), + ('0.99', '419', '2007-04-11T09:01:37.996577', '6173', '2'), + ('5.99', '419', '2007-03-18T19:57:08.996577', '12720', '1'), + ('3.99', '419', '2007-04-10T18:50:20.996577', '5900', '1'), + ('0.99', '419', '2007-04-07T10:52:47.996577', '4224', '1'), + ('2.99', '419', '2007-03-02T14:58:23.996577', '11323', '2'), + ('4.99', '419', '2007-04-27T13:26:53.996577', '7362', '1'), + ('2.99', '370', '2007-03-21T22:53:08.996577', '14786', '2'), + ('6.99', '370', '2007-04-27T08:16:19.996577', '7226', '1'), + ('4.99', '370', '2007-03-23T05:54:00.996577', '15626', '1'), + ('3.99', '370', '2007-03-21T16:17:15.996577', '14602', '1'), + ('7.99', '370', '2007-04-27T05:43:27.996577', '7152', '2'), + ('0.99', '370', '2007-03-17T14:51:30.996577', '11925', '2'), + ('1.99', '370', '2007-03-16T23:16:29.996577', '11540', '1'), + ('0.99', '370', '2007-04-30T19:07:01.996577', '10095', '2'), + ('0.99', '370', '2007-04-28T06:09:33.996577', '7797', '2'), + ('3.99', '370', '2007-03-22T20:25:41.996577', '15368', '2'), + ('4.99', '296', '2007-03-17T00:06:17.996577', '11571', '2'), + ('6.99', '296', '2007-04-26T22:44:57.996577', '6967', '1'), + ('4.99', '296', '2007-03-17T11:11:56.996577', '11825', '2'), + ('4.99', '296', '2007-04-11T00:33:11.996577', '6016', '2'), + ('2.99', '296', '2007-03-22T07:25:14.996577', '15023', '2'), + ('4.99', '296', '2007-04-27T21:07:19.996577', '7568', '2'), + ('0.99', '296', '2007-04-28T20:01:23.996577', '8171', '2'), + ('7.99', '296', '2007-04-05T21:58:21.996577', '3486', '2'), + ('7.99', '296', '2007-03-21T15:08:52.996577', '14571', '2'), + ('4.99', '296', '2007-04-10T02:51:24.996577', '5589', '1'), + ('1.99', '296', '2007-03-20T17:58:10.996577', '13991', '1'), + ('5.99', '296', '2007-04-30T12:43:28.996577', '9249', '1'), + ('0.99', '508', '2007-04-12T09:10:00.996577', '6646', '2'), + ('6.99', '508', '2007-04-10T22:45:20.996577', '5978', '2'), + ('2.99', '508', '2007-04-28T01:09:57.996577', '7668', '2'), + ('8.99', '508', '2007-04-26T21:27:45.996577', '6929', '2'), + ('5.99', '508', '2007-04-27T10:31:07.996577', '7283', '1'), + ('2.99', '508', '2007-04-30T06:11:45.996577', '9706', '1'), + ('2.99', '508', '2007-03-19T13:24:31.996577', '13201', '2'), + ('6.99', '508', '2007-03-19T09:16:36.996577', '13095', '1'), + ('6.99', '508', '2007-03-02T19:04:51.996577', '11447', '2'), + ('2.99', '508', '2007-04-30T20:08:30.996577', '10128', '2'), + ('3.99', '379', '2007-03-23T16:55:17.996577', '15930', '2'), + ('4.99', '379', '2007-03-22T02:27:27.996577', '14886', '1'), + ('2.99', '379', '2007-02-20T03:06:11.996577', '2926', '1'), + ('2.99', '379', '2007-04-08T11:59:01.996577', '4740', '2'), + ('5.99', '379', '2007-03-20T19:01:22.996577', '14011', '1'), + ('4.99', '379', '2007-04-30T17:29:28.996577', '10041', '1'), + ('4.99', '379', '2007-04-09T18:30:24.996577', '5402', '1'), + ('0.99', '379', '2007-03-19T18:30:59.996577', '13334', '1'), + ('2.99', '379', '2007-03-21T00:52:16.996577', '14152', '2'), + ('4.99', '379', '2007-04-06T12:30:28.996577', '3788', '1'), + ('5.99', '509', '2007-03-02T03:06:43.996577', '10988', '2'), + ('8.99', '509', '2007-04-28T17:42:32.996577', '8114', '1'), + ('5.99', '509', '2007-03-22T06:20:50.996577', '14994', '2'), + ('4.99', '509', '2007-02-20T02:38:42.996577', '2919', '2'), + ('2.99', '316', '2007-04-27T21:47:55.996577', '7586', '2'), + ('2.99', '316', '2007-03-21T03:24:03.996577', '14226', '1'), + ('4.99', '316', '2007-04-29T10:01:26.996577', '8564', '1'), + ('6.99', '316', '2007-04-30T13:00:10.996577', '9903', '2'), + ('1.99', '316', '2007-04-28T11:22:24.996577', '7945', '1'), + ('2.99', '316', '2007-03-23T14:03:15.996577', '15840', '2'), + ('5.99', '316', '2007-04-10T03:57:24.996577', '5618', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['25722', '25730', '32078', '28989', '28988', '24622', '28983', '24621', '18490', '18491', '24625', '28990', '18492', '21039', '26973', '26983', '26974', '21036', '21041', '17824', '21037', '26978', '21035', '21040', '17823', '26981', '17826', '26977', '26980', '30982', '24361', '24357', '30985', '24365', '30988', '30980', '30990', '30984', '32066', '24359', '30989', '21443', '18002', '18001', '27421', '21434', '27423', '21447', '27413', '21436', '27414', '21437', '21438', '27422', '21435', '27416', '27411', '27418', '26315', '20448', '17609', '26320', '26319', '20445', '26322', '20442', '26324', '20443', '20447', '17785', '26826', '31956', '20891', '20894', '20898', '26828', '20893', '26827', '22956', '29286', '29294', '22960', '22954', '22955', '29284', '32019', '18609', '22957', '29292', '29285', '29290', '18611', '24468', '24472', '31113', '24475', '31108', '19217', '24474', '24473']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('7.99', '316', '2007-04-10T01:16:33.996577', '5544', '2'), + ('4.99', '316', '2007-04-30T22:51:05.996577', '9508', '1'), + ('5.98', '208', '2007-05-14T13:44:29.996577', '13719', '1'), + ('2.99', '208', '2007-04-28T12:56:17.996577', '7984', '2'), + ('2.99', '208', '2007-04-28T08:30:27.996577', '7861', '1'), + ('5.99', '208', '2007-03-01T19:52:54.996577', '10784', '2'), + ('2.99', '208', '2007-04-09T05:39:48.996577', '5117', '1'), + ('4.99', '208', '2007-03-01T18:57:05.996577', '10762', '2'), + ('0.99', '208', '2007-02-16T19:04:26.996577', '1805', '1'), + ('5.99', '208', '2007-02-17T06:47:48.996577', '1949', '1'), + ('0.99', '208', '2007-03-17T10:53:43.996577', '11819', '2'), + ('1.99', '208', '2007-04-29T17:24:38.996577', '8742', '1'), + ('0.99', '208', '2007-02-19T04:05:20.996577', '2592', '2'), + ('4.99', '426', '2007-03-18T23:43:50.996577', '12822', '1'), + ('2.99', '426', '2007-04-07T05:19:38.996577', '4114', '2'), + ('10.99', '426', '2007-04-30T21:58:17.996577', '10172', '2'), + ('4.99', '426', '2007-04-07T19:47:10.996577', '4398', '2'), + ('6.99', '426', '2007-03-17T15:23:20.996577', '11938', '2'), + ('6.99', '426', '2007-03-21T00:51:51.996577', '14151', '2'), + ('2.99', '426', '2007-02-18T00:40:04.996577', '2204', '1'), + ('5.99', '426', '2007-03-18T13:03:52.996577', '12548', '2'), + ('10.99', '426', '2007-04-27T19:42:54.996577', '7527', '1'), + ('0.99', '426', '2007-03-17T12:46:47.996577', '11876', '2'), + ('2.99', '426', '2007-03-20T12:31:34.996577', '13834', '2'), + ('7.99', '426', '2007-02-16T22:14:25.996577', '1842', '1'), + ('5.99', '426', '2007-04-30T10:39:06.996577', '9185', '1'), + ('0.99', '426', '2007-02-21T01:28:37.996577', '3243', '1'), + ('4.99', '426', '2007-04-27T18:29:46.996577', '7495', '1'), + ('5.99', '426', '2007-04-28T05:50:33.996577', '7789', '1'), + ('1.99', '175', '2007-04-09T11:03:34.996577', '5232', '1'), + ('4.99', '175', '2007-03-19T06:25:40.996577', '13016', '1'), + ('7.99', '175', '2007-03-01T00:13:52.996577', '10229', '2'), + ('0.99', '175', '2007-04-28T05:20:38.996577', '7771', '1'), + ('2.99', '175', '2007-03-22T02:50:57.996577', '14897', '2'), + ('3.99', '175', '2007-04-29T05:59:52.996577', '8440', '1'), + ('4.99', '175', '2007-04-06T04:41:18.996577', '3625', '1'), + ('4.99', '175', '2007-04-30T13:59:51.996577', '9941', '2'), + ('2.99', '175', '2007-04-27T16:34:56.996577', '7448', '1'), + ('0.00', '175', '2007-05-14T13:44:29.996577', '13161', '2'), + ('4.99', '175', '2007-03-17T02:30:02.996577', '11618', '2'), + ('4.99', '175', '2007-04-29T20:37:34.996577', '8817', '1'), + ('9.99', '468', '2007-03-21T16:32:17.996577', '14614', '1'), + ('8.99', '468', '2007-02-16T06:19:35.996577', '1627', '1'), + ('2.99', '468', '2007-02-15T02:21:39.996577', '1229', '2'), + ('5.99', '468', '2007-04-29T05:31:23.996577', '8423', '2'), + ('10.99', '468', '2007-03-02T12:13:31.996577', '11257', '2'), + ('0.99', '468', '2007-04-30T01:59:07.996577', '9598', '1'), + ('0.99', '468', '2007-03-23T20:53:05.996577', '16044', '2'), + ('3.99', '468', '2007-04-07T08:58:34.996577', '4184', '2'), + ('6.99', '468', '2007-03-17T18:28:36.996577', '12026', '2'), + ('3.99', '468', '2007-04-08T01:48:36.996577', '4527', '2'), + ('3.99', '468', '2007-03-19T14:14:13.996577', '13221', '2'), + ('0.99', '468', '2007-03-19T21:20:05.996577', '13417', '1'), + ('6.99', '468', '2007-04-29T18:11:28.996577', '8768', '2'), + ('4.99', '468', '2007-03-17T02:58:35.996577', '11633', '2'), + ('0.99', '468', '2007-04-11T20:53:45.996577', '6392', '1'), + ('2.99', '468', '2007-04-06T09:41:14.996577', '3724', '2'), + ('5.99', '468', '2007-04-12T16:42:36.996577', '6815', '2'), + ('4.99', '367', '2007-04-09T22:37:37.996577', '5490', '2'), + ('6.99', '367', '2007-03-21T09:34:59.996577', '14413', '1'), + ('0.99', '367', '2007-02-20T13:38:14.996577', '3078', '1'), + ('5.99', '367', '2007-04-12T17:26:29.996577', '6835', '2'), + ('0.99', '367', '2007-04-12T12:03:24.996577', '6716', '1'), + ('8.99', '367', '2007-03-18T06:35:51.996577', '12373', '2'), + ('3.99', '367', '2007-04-30T04:34:04.996577', '9030', '1'), + ('4.99', '367', '2007-03-01T03:46:49.996577', '10344', '2'), + ('4.99', '367', '2007-04-30T13:17:30.996577', '9912', '1'), + ('4.99', '367', '2007-03-17T22:50:01.996577', '12152', '1'), + ('4.99', '367', '2007-03-19T14:46:19.996577', '13235', '2'), + ('2.99', '412', '2007-02-21T05:27:37.996577', '3292', '1'), + ('8.99', '412', '2007-04-29T05:12:49.996577', '8411', '1'), + ('0.99', '412', '2007-05-14T13:44:29.996577', '15314', '1'), + ('2.99', '412', '2007-03-01T05:05:03.996577', '10381', '2'), + ('3.99', '412', '2007-03-20T21:19:25.996577', '14068', '1'), + ('8.99', '412', '2007-03-23T12:09:31.996577', '15781', '1'), + ('4.99', '412', '2007-04-30T12:19:04.996577', '9881', '1'), + ('4.99', '412', '2007-03-02T04:15:36.996577', '11027', '2'), + ('0.99', '412', '2007-04-29T14:22:48.996577', '8674', '1'), + ('0.99', '28', '2007-03-18T06:12:31.996577', '12359', '1'), + ('2.99', '28', '2007-04-10T05:49:53.996577', '5653', '2'), + ('4.99', '28', '2007-04-30T01:50:56.996577', '9593', '2'), + ('4.99', '28', '2007-03-22T23:16:55.996577', '15445', '1'), + ('3.99', '28', '2007-03-17T12:13:15.996577', '11856', '1'), + ('2.99', '28', '2007-03-18T00:23:10.996577', '12190', '2'), + ('0.99', '28', '2007-04-08T10:14:01.996577', '4704', '2'), + ('2.99', '28', '2007-05-14T13:44:29.996577', '12938', '2'), + ('2.99', '28', '2007-02-15T03:26:33.996577', '1240', '2'), + ('2.99', '28', '2007-03-18T19:27:43.996577', '12708', '1'), + ('2.99', '28', '2007-04-29T23:35:38.996577', '8901', '1'), + ('4.99', '28', '2007-04-08T21:26:47.996577', '4951', '2'), + ('9.99', '28', '2007-04-27T21:36:06.996577', '7580', '1'), + ('3.99', '28', '2007-02-18T06:47:18.996577', '2299', '2'), + ('8.99', '186', '2007-03-18T09:11:18.996577', '12438', '1'), + ('2.99', '186', '2007-03-20T18:50:02.996577', '14006', '1'), + ('2.99', '186', '2007-04-30T15:04:25.996577', '9303', '2'), + ('3.99', '186', '2007-03-22T06:14:31.996577', '14988', '2'), + ('4.99', '186', '2007-04-11T03:03:15.996577', '6067', '2'), + ('4.99', '186', '2007-02-20T11:00:56.996577', '3039', '1'), + ('4.99', '186', '2007-03-21T17:43:14.996577', '14646', '2'), + ('4.99', '186', '2007-03-21T03:25:41.996577', '14229', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['19215', '32070', '24466', '24471', '24465', '19212', '24478', '31112', '31111', '25509', '19821', '19818', '25510', '19810', '19813', '19814', '19819', '24817', '24816', '19366', '31518', '24822', '31515', '31521', '24818', '31523', '24813', '31364', '31361', '31363', '24717', '21881', '27961', '21886', '18178', '18173', '21880', '21882', '27965', '27963', '18174', '31983', '21885', '27962', '31484', '31480', '31477', '24792', '32088', '24793', '24794', '31473', '31479', '31485', '31481', '19354', '28548', '30062', '27533', '21099', '31263', '22282', '27695', '18035', '27586', '24326', '21642', '22439', '25393', '23984', '18031', '30136', '28915', '18193', '24986', '28708', '22544', '18418', '22935', '31762', '18499', '22505', '31959', '18419', '28813', '20559', '19155', '19681', '22047', '30512', '17804', '22963', '17998', '30723', '31169', '24766', '17644', '20420', '24906', '20017']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('4.99', '186', '2007-02-17T19:33:32.996577', '2132', '2'), + ('2.99', '186', '2007-05-14T13:44:29.996577', '14216', '1'), + ('0.99', '186', '2007-03-17T16:41:33.996577', '11982', '1'), + ('3.99', '186', '2007-03-20T13:15:28.996577', '13853', '1'), + ('0.99', '186', '2007-03-02T02:58:45.996577', '10985', '1'), + ('4.99', '186', '2007-02-14T23:47:05.996577', '1192', '1'), + ('0.99', '186', '2007-03-23T04:48:17.996577', '15596', '1'), + ('0.99', '186', '2007-04-29T22:42:20.996577', '8872', '2'), + ('4.99', '186', '2007-04-29T07:18:44.996577', '8483', '1'), + ('6.99', '297', '2007-04-11T02:51:44.996577', '6064', '1'), + ('4.99', '297', '2007-03-23T09:11:26.996577', '15711', '1'), + ('1.99', '297', '2007-03-20T14:08:08.996577', '13888', '1'), + ('4.99', '297', '2007-04-11T08:14:14.996577', '6156', '1'), + ('0.99', '297', '2007-03-02T12:40:07.996577', '11269', '2'), + ('2.99', '297', '2007-03-17T09:02:50.996577', '11780', '1'), + ('0.99', '297', '2007-03-17T09:16:31.996577', '11784', '1'), + ('5.99', '297', '2007-03-21T09:09:00.996577', '14403', '1'), + ('3.99', '231', '2007-03-18T01:40:10.996577', '12231', '1'), + ('8.99', '231', '2007-03-18T01:39:30.996577', '12230', '2'), + ('0.99', '231', '2007-02-18T16:00:34.996577', '2423', '2'), + ('2.99', '231', '2007-04-09T04:36:49.996577', '5096', '1'), + ('3.99', '231', '2007-03-22T21:19:39.996577', '15389', '1'), + ('2.99', '231', '2007-04-06T14:58:56.996577', '3839', '1'), + ('1.99', '231', '2007-04-12T19:01:24.996577', '6877', '1'), + ('6.99', '231', '2007-03-20T17:36:58.996577', '13983', '2'), + ('5.99', '231', '2007-04-30T01:45:28.996577', '8949', '2'), + ('7.99', '231', '2007-03-02T10:20:23.996577', '11202', '1'), + ('6.99', '218', '2007-04-30T03:57:06.996577', '9018', '2'), + ('0.99', '218', '2007-04-10T10:18:30.996577', '5737', '2'), + ('8.99', '218', '2007-04-27T08:38:05.996577', '7236', '1'), + ('5.99', '218', '2007-03-20T08:02:33.996577', '13708', '2'), + ('1.99', '516', '2007-03-17T15:24:23.996577', '11939', '2'), + ('6.99', '516', '2007-04-12T18:22:17.996577', '6858', '1'), + ('0.99', '516', '2007-03-23T08:50:47.996577', '15701', '1'), + ('2.99', '516', '2007-02-21T17:15:14.996577', '3431', '1'), + ('4.99', '516', '2007-02-14T21:23:39.996577', '1159', '2'), + ('0.99', '516', '2007-03-17T14:53:28.996577', '11926', '2'), + ('1.99', '516', '2007-03-18T12:33:48.996577', '12535', '1'), + ('5.99', '516', '2007-04-29T08:58:39.996577', '8534', '2'), + ('4.99', '516', '2007-04-28T09:02:08.996577', '7882', '1'), + ('1.99', '516', '2007-02-15T00:28:17.996577', '1200', '1'), + ('0.00', '516', '2007-05-14T13:44:29.996577', '12915', '1'), + ('0.99', '516', '2007-03-23T02:12:56.996577', '15526', '1'), + ('4.99', '516', '2007-04-27T23:26:30.996577', '7628', '1'), + ('0.99', '228', '2007-04-27T22:16:41.996577', '7601', '1'), + ('0.99', '228', '2007-04-10T18:59:50.996577', '5902', '2'), + ('0.99', '228', '2007-04-08T19:35:50.996577', '4909', '1'), + ('0.99', '228', '2007-03-18T04:12:55.996577', '12304', '1'), + ('3.98', '228', '2007-05-14T13:44:29.996577', '12672', '2'), + ('2.99', '228', '2007-03-19T04:29:18.996577', '12952', '2'), + ('4.99', '228', '2007-03-19T23:03:56.996577', '13458', '2'), + ('6.99', '228', '2007-04-06T09:20:14.996577', '3715', '1'), + ('4.99', '228', '2007-04-09T14:51:58.996577', '5320', '1'), + ('2.99', '228', '2007-04-28T19:06:22.996577', '8147', '1'), + ('1.99', '228', '2007-04-11T07:20:42.996577', '6141', '2'), + ('2.99', '228', '2007-02-20T03:34:19.996577', '2934', '2'), + ('4.99', '570', '2007-04-29T16:57:20.996577', '8735', '2'), + ('0.99', '96', '2007-04-10T01:40:34.996577', '5558', '1'), + ('2.99', '477', '2007-04-29T22:12:48.996577', '8857', '2'), + ('3.99', '435', '2007-03-17T09:26:06.996577', '11786', '1'), + ('4.99', '209', '2007-04-08T19:30:07.996577', '4907', '1'), + ('2.99', '560', '2007-03-21T10:16:53.996577', '14436', '1'), + ('7.99', '491', '2007-04-28T01:49:13.996577', '7688', '2'), + ('10.99', '477', '2007-02-18T07:01:49.996577', '2306', '1'), + ('5.99', '482', '2007-04-12T17:43:19.996577', '6844', '2'), + ('9.99', '171', '2007-03-21T16:34:58.996577', '14615', '2'), + ('6.99', '489', '2007-03-21T09:52:37.996577', '14424', '2'), + ('3.99', '577', '2007-03-19T13:24:24.996577', '13200', '2'), + ('2.99', '288', '2007-04-28T08:11:28.996577', '7855', '2'), + ('4.99', '138', '2007-03-22T06:09:34.996577', '14987', '1'), + ('4.99', '476', '2007-02-18T22:12:24.996577', '2508', '2'), + ('6.99', '102', '2007-04-07T04:14:25.996577', '4089', '1'), + ('2.99', '202', '2007-04-27T22:42:24.996577', '7613', '1'), + ('0.99', '521', '2007-02-17T13:48:00.996577', '2053', '2'), + ('4.99', '250', '2007-03-21T23:40:40.996577', '14814', '2'), + ('4.99', '583', '2007-04-06T15:02:58.996577', '3842', '1'), + ('0.99', '589', '2007-03-21T19:33:08.996577', '14706', '2'), + ('0.99', '586', '2007-02-15T23:43:22.996577', '1540', '2'), + ('4.99', '26', '2007-03-19T09:53:36.996577', '13111', '2'), + ('2.99', '253', '2007-04-09T23:07:14.996577', '5505', '1'), + ('4.99', '1', '2007-02-18T07:10:14.996577', '2308', '1'), + ('0.99', '585', '2007-03-01T11:55:50.996577', '10573', '2'), + ('2.99', '422', '2007-05-14T13:44:29.996577', '15441', '2'), + ('2.99', '587', '2007-02-15T09:57:43.996577', '1330', '2'), + ('2.99', '592', '2007-04-06T01:20:03.996577', '3560', '2'), + ('4.99', '378', '2007-03-02T06:49:53.996577', '11111', '1'), + ('6.99', '171', '2007-02-21T08:55:57.996577', '3338', '2'), + ('5.99', '280', '2007-03-23T17:38:05.996577', '15950', '2'), + ('2.99', '534', '2007-03-18T04:14:55.996577', '12305', '2'), + ('0.99', '134', '2007-04-12T09:46:31.996577', '6659', '1'), + ('0.99', '420', '2007-02-19T11:57:37.996577', '2698', '1'), + ('1.99', '29', '2007-03-01T23:58:47.996577', '10899', '2'), + ('4.99', '467', '2007-02-17T19:07:20.996577', '2121', '2'), + ('0.99', '152', '2007-04-11T14:37:07.996577', '6273', '1'), + ('7.99', '192', '2007-04-30T20:59:10.996577', '9462', '1'), + ('5.99', '224', '2007-03-21T11:35:36.996577', '14468', '2'), + ('4.99', '378', '2007-02-16T06:17:16.996577', '1623', '2'), + ('0.99', '364', '2007-03-20T15:51:01.996577', '13936', '2'), + ('4.99', '241', '2007-03-19T04:34:52.996577', '12956', '1'), + ('7.99', '321', '2007-03-17T18:43:57.996577', '12034', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['22240', '20804', '20148', '31143', '23408', '20823', '30804', '25576', '18088', '31647', '23248', '25977', '22645', '30664', '28511', '28720', '19600', '30885', '29052', '24542', '31376', '21924', '18804', '28774', '18016', '26886', '27251', '30900', '30178', '30511', '31519', '30908', '18269', '23536', '25515', '29404', '26185', '27462', '28661', '29947', '28987', '21408', '24265', '31568', '22032', '17793', '25494', '31231', '19835', '31989', '19611', '20571', '21560', '29939', '25803', '19084', '23327', '26045', '19899', '27711', '18976', '30795', '21650', '26764', '18317', '28173', '30976', '25211', '30753', '30894', '25579', '24271', '18268', '31833', '26355', '25545', '26325', '18323', '28617', '24333', '24215', '20694', '30350', '28730', '22036', '29299', '28274', '31275', '22480', '24687', '29916', '19883', '29316', '24260', '22504', '26960', '20946', '28506', '31368', '25265']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('6.99', '556', '2007-03-01T10:12:34.996577', '10518', '2'), + ('0.99', '403', '2007-03-21T18:13:53.996577', '14662', '1'), + ('3.99', '336', '2007-03-19T03:28:42.996577', '12926', '2'), + ('0.99', '189', '2007-04-30T17:54:47.996577', '9386', '2'), + ('5.99', '75', '2007-03-18T08:18:18.996577', '12412', '1'), + ('1.99', '405', '2007-03-19T17:24:58.996577', '13304', '1'), + ('2.99', '159', '2007-04-28T22:05:49.996577', '8212', '2'), + ('8.99', '302', '2007-04-30T17:38:29.996577', '9374', '1'), + ('9.99', '492', '2007-02-21T05:38:10.996577', '3298', '1'), + ('0.99', '241', '2007-04-27T12:02:01.996577', '7320', '1'), + ('4.99', '58', '2007-03-22T06:15:33.996577', '14989', '1'), + ('5.99', '338', '2007-04-07T04:54:07.996577', '4104', '2'), + ('4.99', '204', '2007-03-19T21:17:14.996577', '13416', '1'), + ('2.99', '147', '2007-04-10T02:05:12.996577', '5567', '1'), + ('4.99', '566', '2007-04-30T21:29:57.996577', '9470', '2'), + ('7.99', '584', '2007-04-06T17:32:50.996577', '3895', '2'), + ('2.99', '274', '2007-03-22T12:14:50.996577', '15143', '2'), + ('4.99', '167', '2007-04-09T08:28:18.996577', '5178', '1'), + ('3.99', '5', '2007-04-30T12:29:19.996577', '9888', '1'), + ('0.99', '194', '2007-03-20T00:58:13.996577', '13515', '1'), + ('2.99', '219', '2007-04-27T12:35:16.996577', '7335', '2'), + ('2.99', '521', '2007-03-01T12:32:04.996577', '10587', '1'), + ('4.99', '79', '2007-02-20T14:46:22.996577', '3096', '2'), + ('2.99', '589', '2007-04-08T23:12:59.996577', '4986', '2'), + ('4.99', '471', '2007-02-20T13:01:52.996577', '3073', '2'), + ('5.99', '419', '2007-04-09T15:28:04.996577', '5333', '2'), + ('8.99', '451', '2007-04-09T23:43:37.996577', '5518', '2'), + ('2.99', '168', '2007-04-08T21:38:14.996577', '4953', '2'), + ('5.99', '104', '2007-04-30T16:00:29.996577', '9996', '2'), + ('2.99', '134', '2007-04-11T12:16:37.996577', '6226', '2'), + ('5.99', '231', '2007-04-10T01:41:50.996577', '5560', '1'), + ('6.99', '168', '2007-04-29T13:54:57.996577', '8659', '2'), + ('2.99', '543', '2007-02-20T17:10:13.996577', '3128', '1'), + ('4.99', '89', '2007-03-01T20:53:55.996577', '10806', '2'), + ('5.99', '297', '2007-04-30T05:05:19.996577', '9674', '2'), + ('5.99', '37', '2007-04-30T01:04:37.996577', '9567', '1'), + ('3.99', '356', '2007-04-28T21:36:31.996577', '8198', '1'), + ('2.99', '471', '2007-04-11T15:53:23.996577', '6293', '2'), + ('0.99', '579', '2007-04-29T03:24:52.996577', '8354', '1'), + ('5.99', '86', '2007-04-29T19:54:50.996577', '8803', '2'), + ('0.99', '208', '2007-04-27T11:43:22.996577', '7315', '1'), + ('4.99', '465', '2007-03-17T21:23:58.996577', '12106', '2'), + ('1.99', '165', '2007-03-22T06:49:47.996577', '15007', '2'), + ('3.99', '235', '2007-04-30T01:38:56.996577', '9587', '1'), + ('5.99', '532', '2007-03-23T19:46:57.996577', '16014', '1'), + ('2.99', '416', '2007-02-14T21:21:59.996577', '1158', '2'), + ('4.99', '296', '2007-04-07T23:24:56.996577', '4480', '1'), + ('2.99', '199', '2007-04-08T00:37:14.996577', '4499', '1'), + ('5.99', '299', '2007-03-17T07:31:50.996577', '11746', '1'), + ('2.99', '533', '2007-05-14T13:44:29.996577', '14018', '2'), + ('1.99', '275', '2007-03-20T13:32:35.996577', '13865', '2'), + ('0.99', '379', '2007-03-21T11:38:07.996577', '14470', '1'), + ('9.99', '480', '2007-03-19T10:36:39.996577', '13131', '2'), + ('4.99', '86', '2007-04-06T20:03:26.996577', '3945', '2'), + ('1.99', '323', '2007-04-28T07:51:40.996577', '7847', '1'), + ('0.99', '149', '2007-02-19T15:12:44.996577', '2752', '1'), + ('2.99', '67', '2007-03-20T06:21:00.996577', '13652', '1'), + ('7.99', '345', '2007-04-11T16:32:55.996577', '6307', '1'), + ('0.99', '306', '2007-03-17T08:55:45.996577', '11776', '2'), + ('7.99', '493', '2007-04-27T01:52:49.996577', '7043', '2'), + ('3.99', '122', '2007-02-18T02:56:53.996577', '2240', '2'), + ('2.99', '158', '2007-04-29T17:42:47.996577', '8750', '1'), + ('2.99', '490', '2007-03-22T17:27:27.996577', '15276', '2'), + ('2.99', '407', '2007-04-28T16:23:08.996577', '8078', '1'), + ('0.99', '559', '2007-02-19T12:25:17.996577', '2706', '1'), + ('4.99', '533', '2007-04-27T20:45:31.996577', '7555', '2'), + ('7.99', '174', '2007-04-29T03:17:52.996577', '8348', '2'), + ('7.99', '273', '2007-04-09T19:56:33.996577', '5435', '2'), + ('4.99', '155', '2007-04-11T03:57:48.996577', '6087', '2'), + ('0.99', '167', '2007-04-29T19:25:48.996577', '8793', '1'), + ('4.99', '303', '2007-04-11T10:59:50.996577', '6205', '1'), + ('4.99', '166', '2007-03-20T03:56:37.996577', '13582', '2'), + ('4.99', '543', '2007-02-20T12:44:05.996577', '3070', '2'), + ('7.99', '259', '2007-04-30T20:17:10.996577', '9444', '1'), + ('0.99', '370', '2007-04-28T23:32:08.996577', '8258', '2'), + ('4.99', '300', '2007-04-26T23:44:55.996577', '6998', '1'), + ('4.99', '368', '2007-04-06T04:04:05.996577', '3608', '2'), + ('2.99', '561', '2007-02-15T20:41:16.996577', '1505', '2'), + ('4.99', '576', '2007-04-06T19:35:49.996577', '3934', '2'), + ('5.99', '172', '2007-03-19T08:19:43.996577', '13067', '2'), + ('1.99', '159', '2007-03-19T16:09:42.996577', '13270', '2'), + ('1.99', '391', '2007-03-17T21:09:36.996577', '12100', '1'), + ('6.99', '120', '2007-04-30T03:22:40.996577', '8998', '1'), + ('2.99', '584', '2007-04-30T18:21:41.996577', '10073', '2'), + ('8.99', '533', '2007-03-17T08:01:28.996577', '11758', '1'), + ('0.99', '29', '2007-04-08T02:09:12.996577', '4535', '2'), + ('4.99', '543', '2007-04-09T21:34:13.996577', '5467', '2'), + ('0.99', '209', '2007-04-30T13:28:41.996577', '9923', '1'), + ('5.99', '582', '2007-03-20T11:37:19.996577', '13815', '2'), + ('2.99', '215', '2007-03-18T03:25:09.996577', '12285', '2'), + ('4.99', '83', '2007-04-29T16:51:28.996577', '8729', '2'), + ('4.99', '304', '2007-03-22T02:55:04.996577', '14899', '1'), + ('2.99', '30', '2007-04-11T19:34:43.996577', '6359', '2'), + ('2.99', '164', '2007-03-02T09:07:13.996577', '11175', '2'), + ('0.99', '584', '2007-03-23T05:34:26.996577', '15615', '1'), + ('2.99', '425', '2007-04-08T08:21:54.996577', '4659', '1'), + ('0.99', '417', '2007-03-17T20:19:23.996577', '12074', '2'), + ('1.99', '566', '2007-04-29T01:37:13.996577', '8305', '2'), + ('7.99', '219', '2007-04-08T19:42:22.996577', '4910', '2'), + ('2.99', '278', '2007-04-06T12:00:03.996577', '3776', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['29459', '27569', '30950', '26049', '24734', '21687', '23592', '22341', '18298', '26713', '23118', '29264', '25357', '31219', '21966', '26824', '18936', '31996', '20669', '19702', '28175', '18758', '21416', '23175', '24624', '31842', '24089', '28606', '24649', '20320', '18068', '28232', '24610', '29477', '22585', '19705', '21031', '22912', '24132', '19895', '29819', '25974', '28938', '23888', '28339', '23163', '20865', '27186', '24170', '27581', '19494', '31520', '22273', '24171', '22775', '19868', '28368', '17684', '25110', '17758', '30659', '20634', '23886', '21547', '24246', '27641', '29844', '20332', '18823', '21553', '21866', '24068', '24775', '18036', '24643', '29409', '22537', '29366', '28004', '24253', '27226', '27265', '22906', '22316', '18971', '27270', '25446', '24330', '18169', '30627', '21259', '25687', '29328', '26076', '30883', '31110', '30352', '21579', '23114', '21464']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('2.99', '41', '2007-04-28T22:27:55.996577', '8225', '2'), + ('10.99', '481', '2007-04-08T08:40:11.996577', '4668', '1'), + ('5.99', '172', '2007-04-12T18:51:31.996577', '6875', '1'), + ('4.99', '345', '2007-04-30T09:51:48.996577', '9163', '1'), + ('4.99', '220', '2007-03-18T08:07:52.996577', '12407', '1'), + ('3.99', '495', '2007-03-19T13:33:52.996577', '13205', '2'), + ('5.99', '95', '2007-03-18T06:00:38.996577', '12351', '2'), + ('8.99', '566', '2007-03-18T07:00:59.996577', '12382', '2'), + ('4.99', '554', '2007-02-17T07:22:36.996577', '1959', '1'), + ('4.99', '403', '2007-04-30T09:15:27.996577', '9794', '2'), + ('6.99', '45', '2007-03-21T15:20:29.996577', '14576', '1'), + ('6.99', '26', '2007-04-08T07:38:12.996577', '4641', '1'), + ('4.99', '285', '2007-04-28T19:24:44.996577', '8154', '1'), + ('4.99', '198', '2007-04-10T13:03:19.996577', '5794', '2'), + ('8.99', '526', '2007-03-19T14:20:39.996577', '13224', '2'), + ('0.99', '412', '2007-04-28T14:56:09.996577', '8036', '1'), + ('2.99', '112', '2007-02-17T05:19:12.996577', '1930', '2'), + ('0.00', '560', '2007-05-14T13:44:29.996577', '14425', '2'), + ('2.99', '389', '2007-03-02T18:54:07.996577', '11441', '2'), + ('5.99', '285', '2007-03-01T09:11:38.996577', '10493', '1'), + ('2.99', '533', '2007-04-28T17:28:02.996577', '8104', '2'), + ('4.99', '66', '2007-02-17T17:57:29.996577', '2106', '1'), + ('7.99', '466', '2007-03-17T19:17:50.996577', '12048', '1'), + ('4.99', '51', '2007-03-21T13:15:35.996577', '14512', '2'), + ('6.99', '208', '2007-03-17T10:17:13.996577', '11805', '2'), + ('1.99', '260', '2007-04-29T07:06:07.996577', '8475', '1'), + ('4.99', '147', '2007-03-23T01:30:22.996577', '15513', '2'), + ('6.99', '575', '2007-04-06T01:17:32.996577', '3558', '1'), + ('4.99', '211', '2007-03-18T13:40:43.996577', '12565', '2'), + ('4.99', '353', '2007-03-21T08:53:20.996577', '14396', '1'), + ('2.99', '486', '2007-02-19T02:14:05.996577', '2566', '2'), + ('0.99', '538', '2007-04-29T18:08:34.996577', '8765', '1'), + ('3.99', '201', '2007-03-01T22:51:12.996577', '10865', '2'), + ('3.99', '42', '2007-04-29T21:58:29.996577', '8852', '2'), + ('0.99', '595', '2007-03-23T18:57:36.996577', '15994', '2'), + ('8.99', '285', '2007-03-17T18:29:38.996577', '12027', '1'), + ('6.99', '425', '2007-03-23T12:14:26.996577', '15784', '2'), + ('2.99', '24', '2007-03-01T09:06:53.996577', '10491', '2'), + ('0.99', '150', '2007-03-21T18:16:21.996577', '14663', '1'), + ('5.99', '306', '2007-03-01T23:40:39.996577', '10893', '2'), + ('5.99', '75', '2007-04-08T07:25:47.996577', '4639', '1'), + ('5.99', '337', '2007-04-30T05:34:20.996577', '9051', '2'), + ('2.99', '204', '2007-04-12T18:42:15.996577', '6871', '2'), + ('3.99', '129', '2007-03-18T15:38:31.996577', '12612', '2'), + ('8.99', '550', '2007-04-30T02:04:15.996577', '8959', '1'), + ('2.99', '51', '2007-03-01T19:42:50.996577', '10780', '1'), + ('4.99', '409', '2007-03-21T19:17:47.996577', '14697', '1'), + ('0.99', '445', '2007-04-11T18:37:00.996577', '6346', '1'), + ('7.99', '154', '2007-03-21T23:06:23.996577', '14793', '2'), + ('4.99', '482', '2007-04-09T21:31:47.996577', '5466', '1'), + ('8.99', '262', '2007-02-19T21:34:54.996577', '2850', '2'), + ('0.99', '231', '2007-04-12T18:26:35.996577', '6862', '1'), + ('4.99', '559', '2007-03-23T15:01:59.996577', '15877', '1'), + ('6.99', '154', '2007-03-22T03:35:04.996577', '14918', '1'), + ('0.99', '10', '2007-03-02T17:42:05.996577', '11405', '1'), + ('6.99', '302', '2007-03-23T18:50:43.996577', '15987', '2'), + ('4.99', '553', '2007-04-08T16:56:46.996577', '4845', '2'), + ('0.99', '385', '2007-02-20T15:40:12.996577', '3105', '1'), + ('3.99', '262', '2007-03-21T11:22:48.996577', '14465', '2'), + ('5.99', '405', '2007-02-17T07:03:23.996577', '1953', '2'), + ('3.99', '146', '2007-04-28T23:07:07.996577', '8246', '2'), + ('6.99', '385', '2007-03-23T00:34:27.996577', '15488', '1'), + ('2.99', '129', '2007-03-01T11:15:18.996577', '10550', '2'), + ('4.99', '478', '2007-03-23T09:50:35.996577', '15724', '1'), + ('0.99', '162', '2007-03-02T03:38:08.996577', '11012', '2'), + ('8.99', '486', '2007-04-29T05:34:47.996577', '8425', '2'), + ('0.99', '76', '2007-04-30T18:37:58.996577', '10082', '2'), + ('0.99', '355', '2007-03-01T09:25:14.996577', '10498', '1'), + ('0.99', '84', '2007-02-16T19:44:33.996577', '1815', '2'), + ('8.99', '479', '2007-03-19T08:45:09.996577', '13078', '2'), + ('2.99', '514', '2007-03-22T23:24:53.996577', '15451', '1'), + ('4.99', '146', '2007-03-17T00:06:44.996577', '11573', '1'), + ('5.99', '225', '2007-03-21T10:35:51.996577', '14444', '2'), + ('4.99', '477', '2007-02-19T10:23:23.996577', '2676', '2'), + ('8.99', '210', '2007-03-23T17:17:06.996577', '15942', '2'), + ('2.99', '38', '2007-04-09T12:59:50.996577', '5273', '1'), + ('4.99', '589', '2007-03-01T11:04:47.996577', '10544', '2'), + ('2.99', '34', '2007-04-27T00:43:27.996577', '7015', '2'), + ('0.99', '519', '2007-04-30T13:05:29.996577', '9905', '1'), + ('2.99', '163', '2007-03-17T22:52:22.996577', '12154', '1'), + ('2.99', '448', '2007-04-08T02:17:06.996577', '4537', '2'), + ('6.99', '452', '2007-04-30T17:41:27.996577', '9379', '2'), + ('2.99', '23', '2007-03-19T17:00:16.996577', '13290', '2'), + ('2.99', '564', '2007-03-18T15:51:14.996577', '12617', '2'), + ('2.99', '120', '2007-02-20T17:46:58.996577', '3133', '1'), + ('6.99', '453', '2007-04-09T16:39:18.996577', '5359', '2'), + ('2.99', '292', '2007-04-28T15:18:09.996577', '8047', '1'), + ('6.99', '172', '2007-03-16T21:22:38.996577', '11499', '2'), + ('4.99', '515', '2007-02-17T10:09:01.996577', '2003', '2'), + ('9.99', '144', '2007-04-12T15:03:33.996577', '6791', '2'), + ('2.99', '451', '2007-03-02T01:53:34.996577', '10950', '2'), + ('2.99', '313', '2007-04-08T03:05:01.996577', '4552', '2'), + ('4.99', '31', '2007-04-06T21:13:36.996577', '3967', '2'), + ('4.99', '347', '2007-04-28T19:24:15.996577', '8153', '2'), + ('0.99', '167', '2007-04-08T00:08:50.996577', '4493', '2'), + ('3.99', '186', '2007-04-28T10:18:12.996577', '7915', '1'), + ('0.99', '120', '2007-04-30T21:38:07.996577', '10161', '2'), + ('4.99', '482', '2007-03-21T08:30:31.996577', '14383', '2'), + ('3.99', '45', '2007-03-02T21:03:41.996577', '11488', '2'), + ('4.99', '470', '2007-03-02T01:48:29.996577', '10944', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['31664', '30258', '24241', '17837', '27516', '25643', '25408', '23892', '21232', '25470', '27968', '31288', '19588', '25330', '25288', '25620', '19415', '30716', '19523', '20027', '23744', '19717', '25153', '29300', '28703', '27202', '28698', '27572', '30485', '30588', '19985', '25344', '25223', '17983', '19565', '29011', '27189', '28726', '20045', '26494', '29192', '30087', '29266', '30749', '31341', '29841', '20561', '19314', '27402', '29973', '24661', '18905', '26721', '27083', '21977', '18412', '29865', '28015', '28542', '18316', '26926', '23815', '21329', '22648', '24997', '31229', '28880', '25464', '18066', '23794', '22743', '29198', '22720', '22096', '24928', '18766', '22539', '29154', '19808', '24506', '28852', '31370', '18261', '19840', '22524', '27670', '26306', '27037', '17891', '31469', '19919', '28243', '18673', '21760', '30968', '24917', '30649', '27519', '19477', '19839']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('0.99', '243', '2007-04-08T16:28:40.996577', '4831', '1'), + ('4.99', '112', '2007-04-30T02:21:50.996577', '9609', '2'), + ('7.99', '161', '2007-03-21T08:03:40.996577', '14370', '1'), + ('5.99', '429', '2007-02-16T17:48:50.996577', '1781', '2'), + ('7.99', '476', '2007-04-05T21:33:43.996577', '3477', '2'), + ('7.99', '308', '2007-04-30T07:45:14.996577', '9746', '1'), + ('4.99', '290', '2007-04-07T01:26:25.996577', '4039', '2'), + ('4.99', '129', '2007-03-20T15:16:00.996577', '13919', '1'), + ('9.99', '448', '2007-03-17T09:50:09.996577', '11798', '1'), + ('0.99', '294', '2007-04-30T02:19:32.996577', '9607', '2'), + ('2.99', '517', '2007-04-07T04:28:47.996577', '4094', '2'), + ('1.99', '210', '2007-04-12T04:03:10.996577', '6564', '1'), + ('1.99', '274', '2007-03-01T20:07:03.996577', '10790', '1'), + ('4.99', '283', '2007-04-30T16:59:03.996577', '9353', '2'), + ('0.99', '280', '2007-04-29T03:39:26.996577', '8365', '1'), + ('0.99', '306', '2007-04-29T15:33:03.996577', '8702', '1'), + ('4.99', '242', '2007-02-16T11:49:31.996577', '1702', '2'), + ('4.99', '151', '2007-04-30T12:48:38.996577', '9253', '1'), + ('4.99', '267', '2007-03-19T05:29:01.996577', '12979', '1'), + ('0.99', '322', '2007-03-22T23:24:27.996577', '15450', '1'), + ('2.99', '115', '2007-03-17T13:40:21.996577', '11891', '1'), + ('0.99', '286', '2007-03-22T03:02:48.996577', '14905', '1'), + ('6.99', '266', '2007-03-18T08:05:56.996577', '12405', '1'), + ('10.99', '29', '2007-04-09T20:23:45.996577', '5442', '2'), + ('5.99', '582', '2007-04-29T01:50:41.996577', '8308', '2'), + ('4.99', '446', '2007-04-27T21:23:01.996577', '7576', '1'), + ('5.99', '582', '2007-04-12T07:47:01.996577', '6629', '2'), + ('4.99', '481', '2007-04-27T08:23:59.996577', '7228', '1'), + ('4.99', '132', '2007-04-07T08:05:50.996577', '4168', '1'), + ('4.99', '140', '2007-04-30T07:03:36.996577', '9094', '1'), + ('0.99', '316', '2007-03-18T00:25:37.996577', '12191', '2'), + ('2.99', '284', '2007-04-29T23:08:02.996577', '8888', '1'), + ('5.99', '274', '2007-04-05T23:53:04.996577', '3532', '2'), + ('4.99', '463', '2007-02-18T23:38:57.996577', '2527', '2'), + ('0.99', '271', '2007-03-21T03:35:38.996577', '14234', '2'), + ('2.99', '2', '2007-04-29T11:25:25.996577', '8598', '1'), + ('8.99', '445', '2007-04-29T21:54:45.996577', '8851', '1'), + ('4.99', '584', '2007-04-28T00:38:11.996577', '7659', '1'), + ('7.99', '324', '2007-03-21T12:04:20.996577', '14479', '2'), + ('6.99', '382', '2007-04-30T05:59:27.996577', '9067', '1'), + ('4.99', '19', '2007-04-06T00:53:21.996577', '3549', '2'), + ('0.99', '98', '2007-04-27T19:47:24.996577', '7530', '1'), + ('1.99', '26', '2007-04-11T07:47:57.996577', '6149', '1'), + ('2.99', '154', '2007-04-30T14:00:54.996577', '9286', '2'), + ('2.99', '215', '2007-04-30T05:15:21.996577', '9046', '2'), + ('3.99', '76', '2007-04-29T04:56:45.996577', '8405', '2'), + ('4.99', '378', '2007-03-19T00:06:13.996577', '12828', '1'), + ('4.99', '215', '2007-02-16T04:31:59.996577', '1599', '2'), + ('6.99', '467', '2007-04-11T14:30:01.996577', '6271', '2'), + ('4.99', '89', '2007-04-07T07:18:59.996577', '4152', '2'), + ('0.99', '212', '2007-03-18T10:08:35.996577', '12467', '2'), + ('2.99', '104', '2007-02-21T03:52:43.996577', '3273', '2'), + ('1.99', '404', '2007-04-11T06:02:14.996577', '6114', '1'), + ('3.99', '436', '2007-04-30T23:34:53.996577', '10216', '2'), + ('2.99', '527', '2007-03-02T08:20:12.996577', '11150', '1'), + ('6.99', '584', '2007-02-21T06:50:58.996577', '3317', '2'), + ('4.99', '78', '2007-04-30T00:27:50.996577', '8920', '2'), + ('0.99', '520', '2007-04-28T11:01:47.996577', '7936', '1'), + ('0.99', '570', '2007-04-07T03:03:32.996577', '4069', '1'), + ('4.99', '559', '2007-02-19T03:02:41.996577', '2576', '2'), + ('4.99', '422', '2007-04-30T00:08:40.996577', '9541', '2'), + ('0.99', '121', '2007-03-22T20:26:32.996577', '15369', '1'), + ('3.99', '457', '2007-03-22T11:25:52.996577', '15128', '1'), + ('0.99', '204', '2007-03-22T01:51:50.996577', '14871', '1'), + ('4.99', '251', '2007-03-23T14:51:34.996577', '15870', '2'), + ('4.99', '198', '2007-04-30T19:37:22.996577', '10112', '1'), + ('4.99', '597', '2007-04-09T16:02:37.996577', '5348', '1'), + ('5.99', '294', '2007-04-11T09:53:35.996577', '6185', '2'), + ('4.99', '486', '2007-02-17T12:15:18.996577', '2036', '1'), + ('3.99', '120', '2007-03-02T01:36:55.996577', '10940', '1'), + ('5.99', '6', '2007-03-23T01:19:50.996577', '15509', '1'), + ('3.99', '20', '2007-04-06T23:16:51.996577', '4011', '2'), + ('4.99', '5', '2007-03-01T13:17:11.996577', '10609', '2'), + ('8.99', '540', '2007-03-02T00:48:45.996577', '10924', '1'), + ('2.99', '243', '2007-03-18T00:55:46.996577', '12209', '1'), + ('4.99', '67', '2007-02-21T10:36:44.996577', '3359', '1'), + ('7.99', '589', '2007-03-18T20:40:13.996577', '12738', '1'), + ('7.99', '15', '2007-04-06T00:57:47.996577', '3550', '1'), + ('7.99', '296', '2007-03-23T14:47:28.996577', '15866', '2'), + ('5.99', '190', '2007-03-02T05:58:45.996577', '11082', '1'), + ('3.99', '594', '2007-04-30T05:53:01.996577', '9698', '1'), + ('4.99', '219', '2007-04-09T19:02:16.996577', '5416', '2'), + ('3.99', '540', '2007-02-21T09:05:49.996577', '3340', '1'), + ('4.99', '299', '2007-03-22T02:38:36.996577', '14889', '2'), + ('4.99', '587', '2007-03-17T23:15:04.996577', '12164', '2'), + ('3.99', '489', '2007-04-08T14:10:54.996577', '4774', '1'), + ('2.99', '366', '2007-04-27T20:53:41.996577', '7562', '1'), + ('2.99', '432', '2007-04-30T15:40:49.996577', '9984', '2'), + ('1.99', '444', '2007-02-15T17:22:47.996577', '1441', '2'), + ('2.99', '227', '2007-04-30T01:15:39.996577', '8936', '1'), + ('4.99', '308', '2007-03-17T16:24:12.996577', '11972', '1'), + ('2.99', '539', '2007-04-28T05:41:46.996577', '7781', '1'), + ('2.99', '42', '2007-02-17T13:55:59.996577', '2056', '2'), + ('0.99', '503', '2007-03-21T23:53:08.996577', '14823', '1'), + ('2.99', '173', '2007-04-29T01:24:26.996577', '8299', '2'), + ('0.99', '242', '2007-03-02T03:58:14.996577', '11020', '2'), + ('0.99', '145', '2007-04-28T11:53:31.996577', '7954', '2'), + ('4.99', '476', '2007-04-10T05:26:10.996577', '5644', '2'), + ('5.99', '259', '2007-02-18T13:15:55.996577', '2375', '2'), + ('3.99', '299', '2007-03-21T14:22:18.996577', '14548', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['30449', '20268', '26964', '17683', '20170', '18371', '29167', '28871', '23027', '22855', '19056', '18513', '26067', '28116', '18984', '21565', '26435', '20010', '18593', '22986', '19103', '18761', '20740', '23249', '24623', '24629', '21583', '25074', '20976', '31825', '20811', '30314', '28006', '18675', '29447', '18354', '19287', '26183', '26214', '28009', '22303', '31145', '24688', '32004', '23629', '18925', '27207', '24823', '19636', '25093', '18013', '28185', '23519', '27547', '31745', '19519', '31310', '24513', '27441', '18718', '31757', '20554', '22153', '20816', '21001', '20907', '25639', '22747', '19289', '24084', '25508', '19324', '25422', '24351', '19326', '30252', '30591', '25008', '31609', '18425', '27887', '28392', '28886', '22998', '31101', '22081', '31057', '28978', '30725', '28247', '17924', '31068', '29336', '28619', '25253', '29545', '17990', '28858', '30519', '31928']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('4.99', '129', '2007-04-06T17:49:54.996577', '3900', '2'), + ('2.99', '348', '2007-03-02T12:27:21.996577', '11262', '1'), + ('4.99', '425', '2007-04-09T17:16:14.996577', '5371', '1'), + ('0.99', '385', '2007-02-17T05:45:12.996577', '1937', '1'), + ('2.99', '338', '2007-03-17T23:28:28.996577', '12167', '1'), + ('5.99', '573', '2007-02-19T06:39:07.996577', '2622', '2'), + ('4.99', '16', '2007-04-08T01:13:45.996577', '4517', '2'), + ('2.99', '595', '2007-04-30T03:30:26.996577', '9631', '1'), + ('2.99', '35', '2007-03-21T00:00:17.996577', '14124', '2'), + ('8.99', '19', '2007-03-16T21:56:02.996577', '11508', '2'), + ('4.99', '144', '2007-02-19T15:26:08.996577', '2756', '1'), + ('3.99', '5', '2007-02-15T20:31:40.996577', '1502', '1'), + ('0.99', '347', '2007-04-06T03:55:41.996577', '3605', '2'), + ('3.99', '528', '2007-04-30T18:39:55.996577', '10084', '1'), + ('0.99', '123', '2007-02-17T06:59:01.996577', '1951', '2'), + ('2.99', '481', '2007-03-02T17:01:04.996577', '11387', '2'), + ('0.99', '377', '2007-04-07T10:53:03.996577', '4225', '1'), + ('5.99', '319', '2007-03-22T21:36:23.996577', '15396', '2'), + ('4.99', '25', '2007-02-21T19:21:57.996577', '3447', '1'), + ('4.99', '30', '2007-03-22T09:08:17.996577', '15063', '1'), + ('4.99', '155', '2007-02-19T22:37:51.996577', '2869', '1'), + ('3.99', '66', '2007-02-21T08:32:59.996577', '3334', '1'), + ('5.99', '396', '2007-03-21T22:24:56.996577', '14778', '2'), + ('4.99', '59', '2007-03-02T17:16:55.996577', '11396', '2'), + ('2.99', '208', '2007-03-02T18:54:45.996577', '11442', '2'), + ('0.99', '209', '2007-03-17T18:27:32.996577', '12025', '1'), + ('0.99', '482', '2007-03-22T21:30:11.996577', '15391', '1'), + ('6.99', '259', '2007-03-18T18:12:12.996577', '12680', '2'), + ('2.99', '419', '2007-03-02T18:27:14.996577', '11425', '1'), + ('4.99', '259', '2007-04-07T23:52:24.996577', '4489', '2'), + ('4.99', '404', '2007-03-19T21:35:50.996577', '13422', '1'), + ('5.99', '117', '2007-04-09T23:14:14.996577', '5506', '2'), + ('4.99', '520', '2007-04-05T21:41:48.996577', '3482', '2'), + ('4.99', '42', '2007-02-18T06:55:59.996577', '2302', '1'), + ('6.99', '40', '2007-04-30T14:36:16.996577', '9961', '2'), + ('4.99', '570', '2007-02-15T05:06:21.996577', '1259', '1'), + ('4.99', '201', '2007-02-20T15:46:32.996577', '3106', '1'), + ('1.99', '356', '2007-04-28T04:52:07.996577', '7758', '1'), + ('0.99', '359', '2007-04-27T03:29:34.996577', '7098', '2'), + ('4.99', '520', '2007-04-10T13:22:01.996577', '5799', '2'), + ('1.99', '563', '2007-03-17T18:57:34.996577', '12039', '1'), + ('5.99', '190', '2007-04-06T22:50:52.996577', '4005', '2'), + ('1.99', '215', '2007-03-18T06:55:54.996577', '12380', '1'), + ('4.99', '585', '2007-05-14T13:44:29.996577', '14604', '2'), + ('4.99', '101', '2007-03-18T10:25:26.996577', '12471', '1'), + ('6.99', '109', '2007-02-18T00:19:48.996577', '2198', '2'), + ('9.99', '446', '2007-04-30T00:36:51.996577', '8922', '2'), + ('6.99', '232', '2007-03-01T10:51:26.996577', '10539', '1'), + ('5.99', '277', '2007-03-18T09:51:19.996577', '12458', '1'), + ('2.99', '260', '2007-03-21T10:28:04.996577', '14441', '2'), + ('2.99', '471', '2007-02-15T17:47:42.996577', '1449', '2'), + ('0.99', '534', '2007-04-29T12:48:19.996577', '8633', '2'), + ('5.99', '86', '2007-03-23T17:13:32.996577', '15940', '2'), + ('7.99', '479', '2007-04-11T03:44:46.996577', '6084', '2'), + ('6.99', '251', '2007-04-11T21:54:37.996577', '6413', '2'), + ('2.99', '267', '2007-03-01T03:44:13.996577', '10343', '1'), + ('10.99', '212', '2007-04-08T10:27:45.996577', '4708', '2'), + ('0.99', '190', '2007-03-18T07:00:09.996577', '12381', '2'), + ('2.99', '469', '2007-04-30T10:42:29.996577', '9187', '1'), + ('4.99', '54', '2007-02-16T00:47:28.996577', '1556', '1'), + ('0.99', '252', '2007-04-27T06:19:37.996577', '7168', '2'), + ('0.99', '377', '2007-03-19T16:22:04.996577', '13275', '1'), + ('4.99', '546', '2007-03-17T09:45:47.996577', '11797', '1'), + ('0.99', '404', '2007-03-22T09:52:35.996577', '15087', '2'), + ('1.99', '422', '2007-03-19T14:04:31.996577', '13216', '2'), + ('4.99', '413', '2007-03-20T14:07:26.996577', '13887', '2'), + ('8.99', '308', '2007-04-07T14:03:01.996577', '4285', '1'), + ('4.99', '7', '2007-03-01T10:07:52.996577', '10514', '1'), + ('4.99', '209', '2007-02-15T00:34:54.996577', '1201', '2'), + ('0.99', '147', '2007-03-21T01:03:42.996577', '14156', '1'), + ('2.99', '297', '2007-04-11T01:30:54.996577', '6036', '2'), + ('2.99', '217', '2007-02-15T09:23:35.996577', '1322', '1'), + ('1.99', '290', '2007-04-30T23:02:18.996577', '10194', '1'), + ('8.99', '174', '2007-03-01T11:31:24.996577', '10559', '1'), + ('4.99', '217', '2007-02-19T21:02:46.996577', '2842', '1'), + ('2.99', '112', '2007-04-09T17:46:37.996577', '5385', '1'), + ('0.99', '141', '2007-04-07T14:52:35.996577', '4297', '2'), + ('5.99', '253', '2007-03-18T23:55:49.996577', '12827', '2'), + ('8.99', '238', '2007-04-29T01:54:22.996577', '8310', '1'), + ('7.99', '588', '2007-02-18T04:57:27.996577', '2270', '2'), + ('7.99', '508', '2007-04-27T12:21:52.996577', '7327', '2'), + ('4.99', '556', '2007-04-30T19:29:13.996577', '10106', '2'), + ('0.99', '597', '2007-04-30T23:32:41.996577', '10214', '1'), + ('0.99', '32', '2007-03-20T21:47:20.996577', '14075', '1'), + ('2.99', '185', '2007-04-26T22:43:44.996577', '6965', '1'), + ('8.99', '537', '2007-03-23T13:50:01.996577', '15832', '1'), + ('4.99', '181', '2007-04-27T23:31:06.996577', '7632', '1'), + ('5.99', '207', '2007-04-29T19:47:25.996577', '8800', '1'), + ('5.99', '152', '2007-04-30T03:40:30.996577', '9010', '1'), + ('7.99', '539', '2007-04-30T08:29:32.996577', '9777', '1'), + ('3.99', '451', '2007-02-20T01:47:36.996577', '2909', '1'), + ('1.99', '182', '2007-04-08T01:08:25.996577', '4513', '2'), + ('2.99', '31', '2007-04-27T17:18:08.996577', '7464', '2'), + ('3.99', '576', '2007-04-10T03:16:23.996577', '5597', '2'), + ('5.99', '277', '2007-04-06T10:24:01.996577', '3740', '2'), + ('8.99', '49', '2007-04-28T04:01:42.996577', '7742', '2'), + ('8.99', '465', '2007-02-17T22:05:55.996577', '2159', '1'), + ('1.99', '595', '2007-04-10T04:44:11.996577', '5631', '1'), + ('3.99', '135', '2007-04-11T06:08:04.996577', '6117', '1'), + ('2.99', '296', '2007-05-14T13:44:29.996577', '12009', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['22040', '20943', '30809', '18553', '18973', '31725', '31427', '21761', '22500', '23556', '22226', '22688', '17822', '28692', '24669', '19035', '31982', '20262', '29140', '25873', '29076', '26966', '25205', '25200', '31417', '19986', '28019', '29857', '26700', '25799', '21338', '27729', '18428', '27561', '28576', '19285', '29135', '24216', '31931', '24639', '28882', '25472', '21878', '26086', '18096', '31499', '22416', '21349', '25414', '30750', '18162', '27997', '18240', '22426', '20825', '30557', '25079', '29021', '22824', '28122', '18854', '30983', '17597', '31215', '19676', '28541', '26350', '29399', '24719', '29201', '28007', '24678', '24150', '24213', '23732', '27826', '30487', '26242', '25985', '22013', '25880', '25789', '29580', '31309', '18303', '27668', '26334', '28868', '20157', '18589', '23386', '24644', '19767', '31199', '22952', '22977', '18210', '27921', '19259', '28391']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('7.99', '533', '2007-03-21T04:36:41.996577', '14263', '1'), + ('7.99', '417', '2007-03-02T10:54:57.996577', '11217', '1'), + ('4.99', '159', '2007-04-30T13:23:37.996577', '9917', '1'), + ('0.99', '15', '2007-02-20T21:20:44.996577', '3182', '2'), + ('1.99', '121', '2007-02-16T21:13:29.996577', '1833', '1'), + ('9.99', '249', '2007-04-07T17:44:24.996577', '4352', '1'), + ('4.99', '224', '2007-04-11T01:10:40.996577', '6031', '1'), + ('2.99', '503', '2007-03-22T03:20:39.996577', '14913', '1'), + ('5.99', '584', '2007-03-20T23:03:47.996577', '14102', '2'), + ('0.99', '91', '2007-03-19T00:32:33.996577', '12847', '1'), + ('3.99', '554', '2007-03-20T22:58:58.996577', '14098', '1'), + ('1.99', '1', '2007-03-21T23:56:23.996577', '14825', '1'), + ('6.99', '426', '2007-02-16T12:38:41.996577', '1709', '1'), + ('2.99', '581', '2007-04-10T13:56:22.996577', '5812', '2'), + ('4.99', '213', '2007-03-19T19:23:49.996577', '13354', '1'), + ('7.99', '138', '2007-02-19T13:43:21.996577', '2731', '1'), + ('5.98', '516', '2007-05-14T13:44:29.996577', '12130', '1'), + ('4.99', '347', '2007-03-22T02:45:22.996577', '14894', '2'), + ('7.99', '13', '2007-04-30T07:27:06.996577', '9736', '1'), + ('2.99', '330', '2007-04-09T06:56:49.996577', '5149', '2'), + ('3.99', '8', '2007-04-07T20:15:55.996577', '4409', '2'), + ('2.99', '425', '2007-04-12T06:21:21.996577', '6603', '1'), + ('2.99', '272', '2007-04-28T00:37:38.996577', '7658', '2'), + ('4.99', '271', '2007-04-30T10:16:20.996577', '9821', '1'), + ('5.99', '223', '2007-04-05T23:14:23.996577', '3513', '1'), + ('2.99', '316', '2007-03-18T23:44:13.996577', '12823', '2'), + ('0.99', '520', '2007-04-30T18:19:03.996577', '10072', '1'), + ('1.99', '78', '2007-04-09T03:48:50.996577', '5078', '1'), + ('7.99', '402', '2007-04-29T08:41:11.996577', '8521', '2'), + ('3.99', '323', '2007-04-12T17:31:48.996577', '6840', '1'), + ('6.99', '459', '2007-03-01T00:22:49.996577', '10233', '1'), + ('7.99', '494', '2007-04-30T22:52:43.996577', '9510', '2'), + ('4.99', '589', '2007-02-15T17:13:58.996577', '1439', '1'), + ('9.99', '480', '2007-04-28T10:13:22.996577', '7910', '2'), + ('0.99', '573', '2007-04-06T11:35:56.996577', '3768', '2'), + ('3.99', '201', '2007-02-17T21:59:18.996577', '2157', '1'), + ('2.99', '13', '2007-04-29T00:07:19.996577', '8277', '1'), + ('0.99', '159', '2007-03-20T15:45:33.996577', '13933', '1'), + ('0.99', '317', '2007-05-14T13:44:29.996577', '12574', '1'), + ('7.99', '210', '2007-03-21T01:44:56.996577', '14181', '1'), + ('2.99', '597', '2007-04-12T02:03:16.996577', '6508', '1'), + ('4.99', '294', '2007-04-30T23:41:48.996577', '10220', '2'), + ('0.99', '515', '2007-03-21T09:36:43.996577', '14414', '2'), + ('9.99', '348', '2007-04-08T03:17:07.996577', '4556', '2'), + ('7.99', '495', '2007-02-19T01:15:05.996577', '2549', '1'), + ('3.99', '230', '2007-04-08T01:01:04.996577', '4509', '1'), + ('7.99', '575', '2007-03-18T00:49:01.996577', '12204', '1'), + ('0.99', '459', '2007-03-23T13:21:16.996577', '15814', '1'), + ('4.99', '290', '2007-04-12T16:47:16.996577', '6816', '2'), + ('1.99', '155', '2007-04-09T05:54:20.996577', '5128', '1'), + ('3.99', '514', '2007-02-17T10:08:24.996577', '2002', '1'), + ('0.99', '519', '2007-04-11T02:45:17.996577', '6063', '2'), + ('4.99', '534', '2007-02-20T23:48:03.996577', '3216', '1'), + ('4.99', '576', '2007-03-18T02:15:06.996577', '12245', '1'), + ('4.99', '405', '2007-03-21T04:57:46.996577', '14274', '1'), + ('1.99', '138', '2007-04-10T03:24:11.996577', '5600', '1'), + ('4.99', '259', '2007-03-20T06:17:04.996577', '13649', '2'), + ('5.99', '3', '2007-04-27T03:23:08.996577', '7096', '1'), + ('5.99', '15', '2007-03-19T20:32:12.996577', '13393', '1'), + ('6.99', '529', '2007-04-12T03:18:52.996577', '6538', '2'), + ('6.99', '90', '2007-02-19T03:31:02.996577', '2584', '2'), + ('7.99', '175', '2007-04-12T18:31:06.996577', '6865', '2'), + ('2.99', '364', '2007-02-16T13:41:18.996577', '1722', '1'), + ('4.99', '197', '2007-04-30T01:34:21.996577', '9585', '2'), + ('4.99', '280', '2007-03-19T18:09:03.996577', '13321', '1'), + ('0.99', '570', '2007-04-06T21:51:02.996577', '3984', '2'), + ('0.99', '370', '2007-04-12T11:57:32.996577', '6714', '2'), + ('7.99', '37', '2007-04-05T21:24:59.996577', '3472', '2'), + ('4.99', '218', '2007-03-22T00:42:45.996577', '14848', '2'), + ('2.99', '20', '2007-04-11T13:38:44.996577', '6254', '1'), + ('7.99', '520', '2007-04-05T22:32:46.996577', '3499', '1'), + ('9.99', '214', '2007-03-19T19:12:26.996577', '13350', '2'), + ('0.99', '152', '2007-03-19T23:45:18.996577', '13484', '2'), + ('5.99', '158', '2007-03-23T12:55:17.996577', '15802', '1'), + ('0.99', '114', '2007-03-18T05:10:25.996577', '12326', '2'), + ('4.99', '502', '2007-04-30T02:00:32.996577', '9599', '1'), + ('5.99', '132', '2007-04-08T03:17:41.996577', '4557', '1'), + ('2.99', '361', '2007-04-28T02:58:19.996577', '7712', '2'), + ('2.99', '339', '2007-04-06T00:04:37.996577', '3536', '2'), + ('4.99', '531', '2007-03-02T04:14:31.996577', '11026', '2'), + ('4.99', '330', '2007-04-30T19:15:44.996577', '10100', '2'), + ('4.99', '322', '2007-04-12T11:49:07.996577', '6709', '2'), + ('0.99', '52', '2007-04-09T14:27:04.996577', '5308', '1'), + ('0.99', '211', '2007-04-30T14:25:01.996577', '9953', '1'), + ('6.99', '556', '2007-02-17T16:40:42.996577', '2092', '1'), + ('0.99', '488', '2007-04-30T23:51:26.996577', '9537', '1'), + ('2.99', '368', '2007-04-28T22:29:30.996577', '8226', '2'), + ('4.99', '595', '2007-04-30T17:01:17.996577', '9354', '1'), + ('3.99', '337', '2007-03-17T07:02:48.996577', '11734', '1'), + ('2.99', '25', '2007-02-15T12:38:21.996577', '1365', '1'), + ('4.99', '73', '2007-03-20T14:03:09.996577', '13886', '1'), + ('2.99', '211', '2007-03-01T07:30:41.996577', '10445', '1'), + ('4.99', '292', '2007-03-22T00:41:10.996577', '14845', '2'), + ('3.99', '196', '2007-04-28T01:03:38.996577', '7666', '2'), + ('6.99', '28', '2007-03-01T02:16:38.996577', '10294', '2'), + ('5.99', '29', '2007-03-22T06:21:26.996577', '14997', '1'), + ('2.99', '526', '2007-02-17T08:32:00.996577', '1981', '1'), + ('4.99', '511', '2007-04-28T14:34:04.996577', '8026', '1'), + ('0.99', '196', '2007-02-16T04:32:38.996577', '1600', '2'), + ('5.99', '556', '2007-04-29T23:56:29.996577', '8909', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['28946', '25798', '22833', '26568', '32003', '26776', '28831', '17935', '17742', '31211', '18470', '29026', '30125', '27446', '25538', '29873', '25797', '20161', '24509', '30497', '21110', '29040', '30703', '28597', '29124', '24572', '23683', '17568', '24438', '22793', '28024', '23980', '22842', '27867', '23233', '21342', '25968', '22028', '26348', '24821', '31074', '18818', '21054', '26942', '27928', '31986', '30315', '23774', '27830', '22230', '20667', '19072', '23454', '26134', '22494', '30493', '19410', '19875', '27589', '26780', '19623', '24655', '19161', '22059', '20624', '19633', '31162', '24187', '32023', '21429', '22813', '25549', '17964', '19687', '25201', '19668', '30532', '17921', '22435', '22953', '20012', '23780', '31350', '27282', '23736', '24209', '27628', '25588', '20861', '28326', '24019', '29541', '23707', '19905', '19583', '29823', '23210', '20765', '21245', '23721']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('7.99', '205', '2007-04-07T18:57:23.996577', '4377', '2'), + ('1.99', '323', '2007-04-10T19:10:07.996577', '5906', '2'), + ('2.99', '16', '2007-03-01T16:21:28.996577', '10687', '2'), + ('2.99', '390', '2007-04-07T15:59:22.996577', '4310', '2'), + ('2.99', '582', '2007-05-14T13:44:29.996577', '12127', '2'), + ('4.99', '408', '2007-04-28T23:18:40.996577', '8251', '2'), + ('0.99', '593', '2007-04-08T06:31:48.996577', '4623', '2'), + ('7.99', '453', '2007-02-19T21:38:07.996577', '2853', '1'), + ('6.99', '400', '2007-02-17T04:34:36.996577', '1923', '2'), + ('0.99', '197', '2007-04-09T15:55:31.996577', '5344', '2'), + ('0.99', '202', '2007-02-20T08:51:51.996577', '3008', '1'), + ('4.99', '3', '2007-04-28T16:45:40.996577', '8086', '2'), + ('5.99', '101', '2007-04-11T22:40:28.996577', '6433', '2'), + ('4.99', '470', '2007-04-07T18:39:25.996577', '4373', '1'), + ('0.99', '299', '2007-04-30T23:10:44.996577', '10201', '1'), + ('2.99', '79', '2007-04-10T01:37:21.996577', '5555', '1'), + ('4.99', '323', '2007-04-10T06:41:19.996577', '5669', '2'), + ('3.99', '337', '2007-03-20T14:18:43.996577', '13892', '2'), + ('6.99', '190', '2007-03-02T14:25:17.996577', '11312', '2'), + ('6.99', '133', '2007-04-08T00:50:44.996577', '4506', '2'), + ('4.99', '436', '2007-03-17T02:23:01.996577', '11615', '2'), + ('5.99', '5', '2007-04-09T05:42:18.996577', '5118', '2'), + ('4.99', '149', '2007-04-27T20:48:29.996577', '7559', '2'), + ('3.99', '574', '2007-04-09T03:46:27.996577', '5077', '1'), + ('0.99', '12', '2007-04-30T03:03:17.996577', '8985', '2'), + ('3.99', '197', '2007-03-20T15:06:01.996577', '13913', '2'), + ('2.99', '108', '2007-03-17T08:09:49.996577', '11759', '2'), + ('6.99', '357', '2007-02-17T21:26:30.996577', '2153', '2'), + ('4.99', '182', '2007-03-18T14:01:23.996577', '12573', '1'), + ('2.99', '12', '2007-03-20T14:26:54.996577', '13895', '2'), + ('6.99', '521', '2007-04-10T02:34:15.996577', '5580', '2'), + ('2.99', '138', '2007-03-19T01:34:07.996577', '12873', '2'), + ('8.99', '16', '2007-03-21T13:14:00.996577', '14511', '1'), + ('0.99', '507', '2007-04-07T21:29:24.996577', '4440', '2'), + ('0.99', '57', '2007-03-19T11:58:12.996577', '13163', '2'), + ('6.99', '459', '2007-03-18T12:17:12.996577', '12527', '1'), + ('0.99', '337', '2007-04-11T11:09:14.996577', '6212', '1'), + ('4.99', '532', '2007-03-19T15:22:27.996577', '13254', '1'), + ('4.99', '369', '2007-04-30T15:17:57.996577', '9973', '1'), + ('2.99', '231', '2007-03-21T23:21:34.996577', '14806', '2'), + ('4.99', '182', '2007-04-28T08:59:03.996577', '7880', '2'), + ('5.99', '83', '2007-02-16T03:41:03.996577', '1591', '1'), + ('2.99', '429', '2007-03-18T02:43:01.996577', '12259', '1'), + ('0.99', '424', '2007-04-08T03:25:15.996577', '4559', '2'), + ('3.99', '512', '2007-04-10T14:03:03.996577', '5813', '2'), + ('2.99', '527', '2007-05-14T13:44:29.996577', '14267', '1'), + ('0.99', '117', '2007-04-10T06:50:20.996577', '5673', '1'), + ('0.99', '118', '2007-03-23T10:01:51.996577', '15731', '1'), + ('6.99', '503', '2007-04-10T20:09:53.996577', '5925', '1'), + ('3.99', '555', '2007-03-02T00:42:59.996577', '10921', '1'), + ('2.99', '389', '2007-03-02T01:52:30.996577', '10949', '1'), + ('5.99', '147', '2007-02-20T09:07:36.996577', '3011', '2'), + ('0.99', '80', '2007-03-19T20:34:06.996577', '13395', '2'), + ('5.99', '352', '2007-04-11T17:39:04.996577', '6329', '2'), + ('4.99', '584', '2007-03-02T10:47:01.996577', '11213', '1'), + ('6.99', '132', '2007-04-11T12:49:14.996577', '6239', '1'), + ('2.99', '241', '2007-02-19T10:55:45.996577', '2683', '2'), + ('5.99', '303', '2007-03-21T21:37:58.996577', '14750', '1'), + ('6.99', '482', '2007-04-30T12:00:57.996577', '9874', '2'), + ('4.99', '408', '2007-04-30T07:53:40.996577', '9757', '2'), + ('4.99', '276', '2007-03-17T03:04:57.996577', '11636', '1'), + ('7.99', '211', '2007-03-22T21:48:10.996577', '15404', '1'), + ('2.99', '173', '2007-02-19T04:38:34.996577', '2602', '1'), + ('0.99', '535', '2007-03-18T20:26:16.996577', '12732', '1'), + ('4.99', '384', '2007-03-22T18:48:30.996577', '15321', '2'), + ('4.99', '277', '2007-03-02T08:36:20.996577', '11162', '2'), + ('4.99', '192', '2007-04-07T22:46:58.996577', '4469', '1'), + ('1.99', '156', '2007-03-21T23:07:57.996577', '14794', '1'), + ('5.98', '42', '2007-05-14T13:44:29.996577', '13351', '1'), + ('2.99', '467', '2007-03-21T09:06:43.996577', '14402', '1'), + ('0.99', '14', '2007-03-22T20:36:37.996577', '15373', '1'), + ('3.99', '300', '2007-04-29T00:20:48.996577', '8283', '1'), + ('0.99', '457', '2007-02-19T18:21:56.996577', '2811', '1'), + ('4.99', '282', '2007-03-23T02:44:07.996577', '15543', '2'), + ('7.99', '271', '2007-04-30T20:40:09.996577', '10143', '2'), + ('6.99', '279', '2007-03-23T04:07:32.996577', '15580', '2'), + ('3.99', '136', '2007-04-11T07:22:35.996577', '6142', '2'), + ('0.99', '451', '2007-02-16T23:00:52.996577', '1851', '1'), + ('7.99', '577', '2007-03-02T05:01:33.996577', '11054', '1'), + ('2.99', '28', '2007-03-02T19:01:21.996577', '11444', '1'), + ('2.99', '320', '2007-03-16T23:48:56.996577', '11560', '2'), + ('2.99', '119', '2007-03-18T14:06:57.996577', '12576', '2'), + ('2.99', '217', '2007-04-10T02:25:31.996577', '5576', '2'), + ('2.99', '454', '2007-04-29T07:14:23.996577', '8481', '2'), + ('4.99', '114', '2007-03-22T01:43:12.996577', '14867', '1'), + ('2.99', '158', '2007-03-20T15:37:53.996577', '13926', '1'), + ('4.99', '485', '2007-04-30T05:36:05.996577', '9053', '1'), + ('6.99', '304', '2007-04-07T22:41:19.996577', '4466', '1'), + ('0.99', '409', '2007-03-19T00:08:51.996577', '12830', '2'), + ('7.99', '549', '2007-04-27T09:13:54.996577', '7252', '1'), + ('4.99', '141', '2007-03-22T07:11:11.996577', '15013', '1'), + ('6.99', '49', '2007-04-11T14:54:33.996577', '6279', '1'), + ('0.99', '111', '2007-03-22T04:40:42.996577', '14949', '1'), + ('4.99', '306', '2007-03-20T18:14:09.996577', '13996', '1'), + ('4.99', '273', '2007-03-20T22:42:58.996577', '14092', '2'), + ('0.99', '75', '2007-04-12T00:38:02.996577', '6486', '1'), + ('4.99', '54', '2007-03-21T03:02:37.996577', '14215', '1'), + ('4.99', '399', '2007-03-19T15:22:22.996577', '13253', '1'), + ('4.99', '449', '2007-03-18T01:01:55.996577', '12212', '1'), + ('2.99', '112', '2007-03-23T11:15:31.996577', '15756', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['18198', '30007', '21482', '19566', '21659', '22840', '25878', '19658', '30230', '23937', '26184', '27324', '28152', '28850', '31142', '19612', '21293', '18226', '30615', '24774', '22987', '26711', '30620', '24254', '23441', '20873', '29474', '26975', '28710', '24810', '27530', '30799', '29705', '25109', '21213', '24969', '25387', '29950', '18309', '25303', '25678', '23116', '19773', '25001', '27832', '28873', '21441', '24427', '20953', '28164', '24023', '22815', '30216', '25893', '17887', '24417', '19350', '18920', '27817', '31343', '29121', '30283', '20061', '25133', '19139', '22188', '30295', '29171', '21242', '27708', '20426', '27819', '26145', '22484', '22876', '24439', '29302', '28856', '18125', '22860', '31948', '27470', '28219', '21947', '27262', '25769', '21118', '20574', '23036', '27737', '26206', '22563', '26979', '30246', '26089', '22993', '22377', '24028', '19996', '23448']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('6.99', '523', '2007-02-16T13:58:13.996577', '1729', '2'), + ('4.99', '91', '2007-04-08T08:44:26.996577', '4673', '1'), + ('2.99', '471', '2007-03-21T13:56:41.996577', '14538', '2'), + ('4.99', '271', '2007-03-21T07:36:55.996577', '14355', '2'), + ('4.99', '492', '2007-03-19T05:11:09.996577', '12971', '2'), + ('4.99', '16', '2007-03-19T20:30:08.996577', '13391', '1'), + ('2.99', '330', '2007-04-28T09:22:24.996577', '7894', '2'), + ('4.99', '279', '2007-03-17T05:47:55.996577', '11703', '1'), + ('6.99', '109', '2007-04-12T21:01:24.996577', '6920', '2'), + ('7.99', '134', '2007-03-18T21:06:07.996577', '12754', '1'), + ('0.99', '356', '2007-04-28T09:42:45.996577', '7902', '1'), + ('3.99', '459', '2007-04-12T13:18:05.996577', '6750', '2'), + ('0.99', '531', '2007-04-30T01:35:14.996577', '8943', '2'), + ('5.99', '594', '2007-04-29T20:43:22.996577', '8820', '2'), + ('5.99', '189', '2007-04-30T10:04:50.996577', '9171', '2'), + ('0.99', '275', '2007-03-20T14:35:34.996577', '13902', '2'), + ('8.99', '454', '2007-03-20T00:10:55.996577', '13496', '2'), + ('2.99', '530', '2007-02-17T22:04:53.996577', '2158', '1'), + ('4.99', '143', '2007-04-11T11:02:50.996577', '6207', '2'), + ('4.99', '225', '2007-03-02T18:48:32.996577', '11437', '2'), + ('4.99', '30', '2007-03-23T02:46:22.996577', '15544', '1'), + ('2.99', '403', '2007-04-30T05:44:11.996577', '9058', '1'), + ('6.99', '144', '2007-04-08T11:19:20.996577', '4726', '1'), + ('2.99', '163', '2007-03-19T05:16:37.996577', '12973', '2'), + ('2.99', '78', '2007-03-23T20:47:17.996577', '16039', '2'), + ('4.99', '410', '2007-03-19T23:16:50.996577', '13460', '1'), + ('2.99', '42', '2007-04-28T19:51:59.996577', '8166', '1'), + ('4.99', '426', '2007-04-08T19:06:32.996577', '4900', '1'), + ('4.99', '583', '2007-04-07T22:35:44.996577', '4464', '1'), + ('5.99', '230', '2007-03-20T21:41:23.996577', '14073', '1'), + ('10.99', '477', '2007-04-28T09:54:05.996577', '7904', '2'), + ('2.99', '158', '2007-04-30T09:31:39.996577', '9801', '1'), + ('4.99', '64', '2007-04-29T11:32:53.996577', '8602', '2'), + ('4.99', '262', '2007-03-21T01:44:41.996577', '14180', '1'), + ('2.99', '445', '2007-03-23T16:04:26.996577', '15906', '2'), + ('4.99', '247', '2007-03-23T12:14:10.996577', '15783', '1'), + ('3.99', '288', '2007-04-06T20:35:59.996577', '3958', '1'), + ('7.99', '87', '2007-04-09T04:01:53.996577', '5084', '1'), + ('6.99', '557', '2007-02-20T07:27:34.996577', '2988', '2'), + ('2.99', '282', '2007-04-06T17:12:09.996577', '3885', '1'), + ('3.99', '312', '2007-04-08T07:56:02.996577', '4647', '1'), + ('3.99', '45', '2007-03-19T18:47:05.996577', '13340', '1'), + ('5.99', '293', '2007-03-20T00:30:14.996577', '13504', '2'), + ('4.99', '252', '2007-03-19T20:08:01.996577', '13385', '1'), + ('2.99', '503', '2007-04-12T02:59:30.996577', '6529', '1'), + ('3.99', '596', '2007-04-10T10:24:44.996577', '5742', '2'), + ('9.99', '468', '2007-03-21T06:12:43.996577', '14309', '1'), + ('0.99', '181', '2007-03-18T08:16:23.996577', '12411', '1'), + ('2.99', '417', '2007-03-22T02:20:47.996577', '14882', '2'), + ('4.99', '532', '2007-04-27T07:05:21.996577', '7192', '1'), + ('5.99', '142', '2007-03-02T12:01:50.996577', '11244', '2'), + ('2.99', '15', '2007-03-02T07:12:44.996577', '11118', '1'), + ('1.99', '108', '2007-04-07T15:25:58.996577', '4303', '1'), + ('6.99', '331', '2007-04-30T22:48:07.996577', '10188', '2'), + ('2.99', '442', '2007-02-16T16:56:18.996577', '1774', '1'), + ('0.99', '180', '2007-03-20T23:21:24.996577', '14109', '1'), + ('6.99', '227', '2007-02-17T22:14:47.996577', '2164', '1'), + ('8.99', '108', '2007-02-17T14:15:26.996577', '2061', '1'), + ('8.99', '502', '2007-04-12T13:44:26.996577', '6760', '1'), + ('4.99', '215', '2007-04-30T02:23:09.996577', '9611', '2'), + ('2.99', '12', '2007-04-12T14:24:05.996577', '6773', '1'), + ('2.99', '114', '2007-04-27T17:16:13.996577', '7462', '2'), + ('0.99', '327', '2007-03-01T04:48:55.996577', '10371', '1'), + ('2.99', '264', '2007-03-20T04:17:25.996577', '13590', '2'), + ('5.99', '166', '2007-02-19T23:10:52.996577', '2874', '1'), + ('4.99', '550', '2007-03-21T00:01:58.996577', '14127', '2'), + ('0.99', '115', '2007-04-11T20:03:46.996577', '6373', '1'), + ('5.99', '16', '2007-04-29T06:13:26.996577', '8452', '2'), + ('4.99', '449', '2007-03-01T06:37:05.996577', '10416', '1'), + ('7.99', '493', '2007-04-12T03:30:27.996577', '6549', '1'), + ('8.99', '365', '2007-03-18T23:01:41.996577', '12804', '1'), + ('8.99', '502', '2007-04-26T21:20:19.996577', '6924', '2'), + ('3.99', '353', '2007-04-28T13:25:07.996577', '7993', '2'), + ('2.99', '582', '2007-03-23T01:13:15.996577', '15503', '1'), + ('2.99', '20', '2007-03-22T23:39:08.996577', '15460', '1'), + ('6.99', '182', '2007-03-19T00:22:37.996577', '12840', '1'), + ('3.99', '29', '2007-04-27T08:41:02.996577', '7237', '2'), + ('4.99', '595', '2007-04-07T12:07:26.996577', '4241', '1'), + ('0.99', '503', '2007-02-21T17:14:34.996577', '3430', '2'), + ('8.99', '19', '2007-03-20T11:14:58.996577', '13804', '2'), + ('0.99', '369', '2007-05-14T13:44:29.996577', '13898', '1'), + ('2.99', '472', '2007-04-09T14:39:59.996577', '5318', '2'), + ('4.99', '537', '2007-04-28T06:29:04.996577', '7810', '2'), + ('2.99', '523', '2007-03-19T10:39:29.996577', '13133', '1'), + ('2.99', '452', '2007-04-26T22:36:17.996577', '6959', '2'), + ('4.99', '320', '2007-04-28T22:51:22.996577', '8235', '2'), + ('0.99', '436', '2007-03-20T11:35:49.996577', '13814', '1'), + ('4.99', '379', '2007-03-22T23:17:50.996577', '15446', '1'), + ('1.99', '36', '2007-03-20T03:03:12.996577', '13564', '2'), + ('1.99', '495', '2007-04-29T04:05:13.996577', '8383', '1'), + ('2.99', '358', '2007-04-29T12:21:08.996577', '8621', '1'), + ('0.99', '592', '2007-03-17T19:06:47.996577', '12043', '2'), + ('4.99', '426', '2007-04-28T02:55:08.996577', '7711', '1'), + ('0.99', '111', '2007-04-07T14:05:10.996577', '4286', '2'), + ('8.99', '348', '2007-04-08T15:30:14.996577', '4807', '1'), + ('4.99', '32', '2007-03-02T07:50:51.996577', '11135', '1'), + ('3.99', '570', '2007-03-02T06:34:44.996577', '11098', '1'), + ('4.99', '142', '2007-03-20T23:39:43.996577', '14116', '2'), + ('0.99', '317', '2007-03-21T08:31:21.996577', '14385', '2'), + ('8.99', '80', '2007-03-01T16:34:20.996577', '10690', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['19597', '26077', '23256', '28754', '20851', '21609', '24806', '25732', '30838', '24611', '24504', '27325', '28079', '25846', '29745', '24526', '20393', '28457', '22359', '29698', '22078', '28172', '18305', '20768', '30720', '22607', '30697', '28353', '28465', '28967', '23434', '19328', '19150', '20164', '23781', '18010', '19475', '25159', '23920', '20382', '30129', '20842', '21834', '30971', '27682', '23172', '22265', '30336', '19141', '29679', '30167', '25139', '18424', '30599', '24261', '24648', '20671', '25399', '21322', '28827', '18223', '29321', '19584', '30612', '18416', '22151', '31379', '22285', '31048', '30010', '23610', '20790', '21258', '27524', '28376', '29716', '19957', '21033', '21699', '24053', '18161', '31225', '20987', '25773', '17552', '28653', '27384', '18289', '23709', '20606', '30918', '30494', '30530', '21706', '17986', '26729', '22859', '29106', '28466', '21826']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('7.99', '274', '2007-03-20T21:14:24.996577', '14066', '1'), + ('4.99', '347', '2007-04-28T20:10:34.996577', '8176', '2'), + ('5.99', '59', '2007-03-22T17:17:14.996577', '15271', '2'), + ('6.99', '587', '2007-04-12T09:57:40.996577', '6665', '2'), + ('4.99', '408', '2007-03-18T05:32:50.996577', '12338', '1'), + ('0.99', '486', '2007-03-18T10:03:28.996577', '12465', '1'), + ('1.99', '230', '2007-03-17T20:32:43.996577', '12079', '1'), + ('0.99', '317', '2007-04-07T06:45:39.996577', '4138', '1'), + ('4.99', '163', '2007-04-10T01:26:55.996577', '5549', '2'), + ('0.99', '201', '2007-03-01T23:38:21.996577', '10891', '1'), + ('1.99', '189', '2007-03-23T11:53:23.996577', '15773', '1'), + ('6.99', '459', '2007-04-27T23:06:07.996577', '7623', '1'), + ('6.99', '526', '2007-04-07T20:39:54.996577', '4423', '1'), + ('0.99', '327', '2007-04-08T01:26:22.996577', '4521', '1'), + ('4.99', '68', '2007-04-12T02:11:15.996577', '6512', '1'), + ('7.99', '192', '2007-03-21T03:45:06.996577', '14238', '2'), + ('6.99', '361', '2007-03-23T11:16:03.996577', '15759', '1'), + ('2.99', '562', '2007-04-27T15:54:40.996577', '7430', '1'), + ('2.99', '568', '2007-03-22T14:56:26.996577', '15203', '1'), + ('2.99', '64', '2007-04-11T20:03:32.996577', '6372', '2'), + ('0.99', '537', '2007-03-21T13:00:53.996577', '14506', '2'), + ('9.99', '533', '2007-04-12T17:28:11.996577', '6837', '2'), + ('0.99', '556', '2007-02-20T07:18:54.996577', '2986', '2'), + ('4.99', '399', '2007-03-22T23:53:56.996577', '15468', '1'), + ('2.99', '152', '2007-04-06T02:09:02.996577', '3577', '2'), + ('2.99', '597', '2007-03-19T06:36:09.996577', '13019', '2'), + ('3.99', '149', '2007-04-08T13:44:30.996577', '4766', '1'), + ('4.99', '552', '2007-04-11T10:04:29.996577', '6189', '2'), + ('5.99', '563', '2007-04-08T14:12:46.996577', '4776', '2'), + ('2.99', '207', '2007-04-06T23:38:59.996577', '4018', '1'), + ('5.99', '78', '2007-03-19T10:24:25.996577', '13124', '2'), + ('0.99', '218', '2007-02-18T04:18:12.996577', '2262', '1'), + ('4.99', '171', '2007-02-17T10:12:04.996577', '2004', '2'), + ('4.99', '337', '2007-03-22T17:57:22.996577', '15292', '1'), + ('3.99', '119', '2007-03-18T15:24:46.996577', '12603', '2'), + ('0.99', '470', '2007-02-15T06:55:56.996577', '1283', '1'), + ('7.99', '259', '2007-02-16T13:42:44.996577', '1723', '2'), + ('0.99', '266', '2007-03-22T02:08:22.996577', '14877', '1'), + ('6.99', '132', '2007-03-01T14:12:46.996577', '10638', '1'), + ('0.99', '361', '2007-03-01T06:32:21.996577', '10414', '1'), + ('1.99', '101', '2007-04-29T20:52:42.996577', '8825', '2'), + ('0.99', '407', '2007-03-18T13:41:30.996577', '12566', '2'), + ('4.99', '512', '2007-03-19T11:39:08.996577', '13156', '2'), + ('4.99', '173', '2007-04-30T07:09:01.996577', '9097', '1'), + ('4.99', '490', '2007-04-12T15:50:15.996577', '6803', '1'), + ('0.99', '51', '2007-03-20T13:34:52.996577', '13868', '1'), + ('1.99', '559', '2007-03-02T07:51:23.996577', '11136', '2'), + ('5.99', '119', '2007-04-28T20:49:33.996577', '8183', '1'), + ('3.99', '167', '2007-02-15T16:13:23.996577', '1416', '1'), + ('4.99', '63', '2007-04-10T12:38:48.996577', '5788', '2'), + ('4.99', '103', '2007-04-29T08:38:28.996577', '8520', '1'), + ('4.99', '265', '2007-03-18T05:46:21.996577', '12346', '2'), + ('6.99', '588', '2007-02-17T03:05:46.996577', '1903', '2'), + ('4.99', '141', '2007-04-30T01:34:14.996577', '9584', '1'), + ('5.99', '164', '2007-03-19T22:59:17.996577', '13453', '2'), + ('0.99', '211', '2007-03-18T04:35:26.996577', '12311', '2'), + ('4.99', '389', '2007-03-17T20:08:06.996577', '12069', '2'), + ('8.99', '289', '2007-04-09T15:48:29.996577', '5342', '2'), + ('4.99', '457', '2007-03-17T21:32:41.996577', '12115', '1'), + ('6.99', '592', '2007-04-30T04:49:24.996577', '9666', '2'), + ('0.99', '529', '2007-02-21T09:58:15.996577', '3354', '2'), + ('4.99', '30', '2007-04-28T16:38:14.996577', '8083', '1'), + ('2.99', '273', '2007-03-21T14:39:16.996577', '14558', '2'), + ('0.99', '143', '2007-04-07T10:47:23.996577', '4221', '2'), + ('3.99', '585', '2007-02-20T03:18:55.996577', '2930', '1'), + ('0.99', '546', '2007-03-01T04:46:30.996577', '10370', '2'), + ('4.99', '219', '2007-04-29T09:05:49.996577', '8536', '2'), + ('2.99', '561', '2007-03-01T03:04:00.996577', '10317', '2'), + ('2.99', '180', '2007-04-29T09:21:17.996577', '8540', '2'), + ('0.99', '91', '2007-04-10T08:24:50.996577', '5701', '2'), + ('5.99', '98', '2007-03-17T03:01:43.996577', '11635', '1'), + ('0.99', '402', '2007-03-17T14:38:45.996577', '11920', '2'), + ('2.99', '451', '2007-03-01T22:35:40.996577', '10856', '1'), + ('3.99', '476', '2007-04-30T07:41:08.996577', '9743', '2'), + ('4.99', '554', '2007-04-08T19:17:56.996577', '4902', '2'), + ('1.99', '65', '2007-04-29T04:28:53.996577', '8392', '2'), + ('6.99', '312', '2007-03-23T15:12:57.996577', '15882', '1'), + ('1.99', '426', '2007-03-01T09:42:25.996577', '10505', '1'), + ('2.99', '496', '2007-03-23T11:04:31.996577', '15750', '2'), + ('7.99', '144', '2007-03-23T11:11:56.996577', '15753', '1'), + ('4.99', '514', '2007-02-16T10:58:45.996577', '1692', '2'), + ('2.99', '198', '2007-04-27T21:43:48.996577', '7583', '1'), + ('0.99', '420', '2007-03-23T04:49:46.996577', '15597', '2'), + ('5.99', '321', '2007-04-06T17:53:21.996577', '3901', '2'), + ('4.99', '352', '2007-02-21T08:06:19.996577', '3331', '2'), + ('2.99', '578', '2007-04-30T22:36:27.996577', '10182', '2'), + ('6.99', '464', '2007-04-09T20:57:11.996577', '5455', '2'), + ('9.99', '550', '2007-02-21T01:16:09.996577', '3236', '2'), + ('5.99', '112', '2007-03-01T12:47:23.996577', '10596', '2'), + ('4.99', '382', '2007-03-21T05:48:03.996577', '14300', '2'), + ('4.99', '169', '2007-04-11T23:28:19.996577', '6453', '2'), + ('1.99', '132', '2007-04-26T23:16:06.996577', '6978', '1'), + ('0.99', '136', '2007-04-08T20:34:01.996577', '4927', '1'), + ('0.99', '497', '2007-03-23T05:59:36.996577', '15633', '2'), + ('4.99', '464', '2007-02-15T06:29:55.996577', '1277', '2'), + ('0.99', '405', '2007-04-07T10:52:20.996577', '4223', '2'), + ('8.99', '19', '2007-03-20T08:22:10.996577', '13718', '1'), + ('4.99', '11', '2007-04-08T21:11:31.996577', '4943', '1'), + ('3.99', '563', '2007-04-08T15:31:15.996577', '4808', '2'), + ('4.99', '511', '2007-03-19T03:00:58.996577', '12920', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['27306', '26071', '21815', '20171', '29004', '29309', '20849', '25712', '29442', '30972', '17572', '20950', '28786', '30128', '19048', '23038', '30501', '30643', '29046', '24147', '24993', '23458', '27388', '17806', '31763', '29765', '23278', '28844', '21423', '24153', '18839', '22822', '28234', '25379', '29761', '28773', '27180', '31551', '26699', '30014', '24549', '31468', '21169', '22369', '24322', '21999', '27322', '22821', '27673', '27744', '31564', '28743', '23647', '17896', '30705', '22936', '17646', '22371', '31608', '23295', '21571', '28550', '22586', '31055', '30841', '28590', '22809', '26043', '30000', '23182', '28010', '17761', '25417', '18645', '18444', '19704', '20015', '27248', '20739', '20425', '26596', '18443', '26558', '22191', '26232', '27723', '29926', '19766', '21445', '26051', '22850', '17994', '22307', '31333', '26954', '24540', '26235', '29666', '28428', '29009']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('1.99', '457', '2007-04-27T06:50:52.996577', '7184', '1'), + ('0.99', '347', '2007-04-09T21:40:18.996577', '5471', '2'), + ('4.99', '509', '2007-03-20T20:18:37.996577', '14045', '2'), + ('3.99', '338', '2007-03-19T16:40:57.996577', '13284', '1'), + ('2.99', '1', '2007-04-30T01:10:44.996577', '9571', '2'), + ('2.99', '30', '2007-04-07T22:49:55.996577', '4471', '2'), + ('2.99', '408', '2007-03-02T06:59:32.996577', '11115', '2'), + ('2.99', '315', '2007-04-07T00:15:10.996577', '4021', '1'), + ('0.99', '40', '2007-04-28T01:40:20.996577', '7684', '2'), + ('2.99', '173', '2007-04-30T22:54:56.996577', '9512', '2'), + ('2.99', '358', '2007-02-19T13:21:50.996577', '2721', '1'), + ('4.99', '417', '2007-03-20T23:54:59.996577', '14121', '2'), + ('4.99', '590', '2007-04-08T11:10:53.996577', '4722', '2'), + ('0.99', '101', '2007-04-29T01:28:34.996577', '8301', '1'), + ('2.99', '142', '2007-02-20T23:36:52.996577', '3214', '1'), + ('9.99', '36', '2007-03-21T17:43:59.996577', '14647', '1'), + ('2.99', '133', '2007-04-09T03:05:57.996577', '5063', '2'), + ('2.99', '145', '2007-04-08T15:45:57.996577', '4817', '2'), + ('0.99', '5', '2007-04-27T11:05:54.996577', '7293', '2'), + ('4.99', '152', '2007-03-19T02:55:37.996577', '12917', '1'), + ('2.99', '251', '2007-03-19T15:01:42.996577', '13243', '1'), + ('8.99', '80', '2007-03-23T06:56:23.996577', '15648', '1'), + ('0.99', '465', '2007-04-08T13:25:58.996577', '4763', '1'), + ('4.99', '421', '2007-02-16T11:08:17.996577', '1693', '1'), + ('4.99', '253', '2007-04-10T03:30:48.996577', '5602', '1'), + ('2.99', '70', '2007-04-28T03:00:56.996577', '7714', '1'), + ('0.99', '62', '2007-03-17T16:52:16.996577', '11988', '1'), + ('3.99', '594', '2007-04-07T07:26:49.996577', '4154', '1'), + ('0.99', '467', '2007-03-01T00:37:48.996577', '10239', '2'), + ('4.99', '152', '2007-03-21T18:19:56.996577', '14668', '2'), + ('4.99', '86', '2007-02-21T03:35:57.996577', '3270', '2'), + ('2.99', '15', '2007-03-18T16:28:49.996577', '12635', '1'), + ('4.99', '538', '2007-04-30T04:04:14.996577', '9643', '1'), + ('0.99', '287', '2007-04-10T11:14:02.996577', '5761', '2'), + ('0.99', '70', '2007-04-07T02:42:01.996577', '4061', '1'), + ('4.99', '588', '2007-04-30T17:25:55.996577', '9370', '2'), + ('2.99', '444', '2007-04-11T15:20:33.996577', '6285', '2'), + ('0.99', '233', '2007-04-30T01:17:46.996577', '9574', '1'), + ('0.99', '402', '2007-04-27T23:32:07.996577', '7633', '1'), + ('0.99', '91', '2007-04-27T05:24:57.996577', '7143', '2'), + ('0.99', '195', '2007-03-17T21:07:20.996577', '12099', '2'), + ('4.99', '227', '2007-04-29T05:22:02.996577', '8417', '2'), + ('0.99', '442', '2007-03-19T04:23:40.996577', '12948', '1'), + ('7.99', '569', '2007-03-19T16:56:50.996577', '13287', '1'), + ('6.99', '171', '2007-03-19T09:02:18.996577', '13087', '2'), + ('4.99', '529', '2007-03-21T10:41:44.996577', '14449', '2'), + ('0.99', '459', '2007-04-10T08:12:06.996577', '5695', '1'), + ('2.99', '15', '2007-03-18T13:14:52.996577', '12551', '2'), + ('4.99', '489', '2007-04-30T20:53:12.996577', '9459', '1'), + ('2.99', '496', '2007-04-07T03:05:35.996577', '4070', '1'), + ('6.99', '235', '2007-04-29T06:06:36.996577', '8446', '2'), + ('6.99', '585', '2007-04-30T11:31:50.996577', '9860', '1'), + ('3.99', '103', '2007-03-22T23:50:38.996577', '15467', '1'), + ('3.99', '446', '2007-02-18T09:28:02.996577', '2335', '2'), + ('2.99', '149', '2007-04-30T20:59:15.996577', '10154', '2'), + ('4.99', '26', '2007-03-21T01:52:55.996577', '14183', '2'), + ('7.99', '378', '2007-02-17T19:42:10.996577', '2134', '2'), + ('4.99', '569', '2007-03-21T02:36:45.996577', '14207', '2'), + ('4.99', '238', '2007-04-27T08:54:37.996577', '7243', '2'), + ('4.99', '64', '2007-03-01T17:19:55.996577', '10714', '2'), + ('4.99', '481', '2007-03-20T13:46:04.996577', '13878', '2'), + ('0.99', '570', '2007-04-30T18:37:26.996577', '9398', '1'), + ('2.99', '595', '2007-03-23T19:55:01.996577', '16016', '2'), + ('8.99', '181', '2007-04-26T22:08:33.996577', '6946', '1'), + ('1.99', '163', '2007-04-12T17:12:30.996577', '6831', '1'), + ('5.99', '573', '2007-04-30T15:10:42.996577', '9971', '2'), + ('3.99', '14', '2007-03-16T22:55:49.996577', '11528', '2'), + ('4.99', '345', '2007-04-07T21:48:31.996577', '4450', '2'), + ('9.99', '90', '2007-04-29T22:36:34.996577', '8870', '2'), + ('2.99', '52', '2007-03-18T00:40:59.996577', '12200', '2'), + ('10.99', '520', '2007-04-10T13:30:43.996577', '5802', '1'), + ('5.99', '405', '2007-02-21T01:54:03.996577', '3253', '1'), + ('1.99', '290', '2007-04-28T00:15:46.996577', '7650', '1'), + ('0.99', '35', '2007-02-16T02:37:34.996577', '1579', '1'), + ('0.99', '592', '2007-02-19T07:00:26.996577', '2627', '1'), + ('4.99', '285', '2007-03-01T14:13:23.996577', '10641', '1'), + ('2.99', '321', '2007-03-17T06:21:29.996577', '11722', '1'), + ('8.99', '451', '2007-04-08T14:58:37.996577', '4794', '1'), + ('2.99', '396', '2007-03-21T13:02:24.996577', '14508', '1'), + ('4.99', '365', '2007-03-18T06:48:34.996577', '12375', '2'), + ('0.99', '392', '2007-04-28T23:27:57.996577', '8254', '1'), + ('2.99', '592', '2007-02-15T19:42:04.996577', '1479', '1'), + ('3.99', '389', '2007-04-12T06:10:14.996577', '6600', '1'), + ('9.99', '550', '2007-03-22T22:55:13.996577', '15431', '2'), + ('4.99', '360', '2007-04-30T13:53:45.996577', '9283', '1'), + ('8.99', '494', '2007-04-27T20:18:35.996577', '7546', '2'), + ('4.99', '84', '2007-04-28T14:06:09.996577', '8019', '2'), + ('0.99', '292', '2007-03-21T12:39:45.996577', '14499', '1'), + ('1.99', '468', '2007-03-23T02:00:57.996577', '15522', '1'), + ('8.99', '345', '2007-04-30T23:32:54.996577', '10215', '2'), + ('1.99', '18', '2007-03-01T17:33:44.996577', '10721', '2'), + ('3.99', '466', '2007-02-20T09:45:46.996577', '3022', '1'), + ('4.99', '563', '2007-03-21T15:58:43.996577', '14592', '2'), + ('7.99', '214', '2007-04-12T06:18:50.996577', '6602', '1'), + ('4.99', '424', '2007-04-30T12:10:28.996577', '9878', '2'), + ('5.99', '194', '2007-03-02T20:23:35.996577', '11475', '2'), + ('3.99', '360', '2007-04-30T04:30:40.996577', '9659', '2'), + ('1.99', '61', '2007-04-27T02:29:41.996577', '7071', '2'), + ('2.99', '559', '2007-04-30T12:10:23.996577', '9877', '1'), + ('5.99', '2', '2007-04-27T17:08:46.996577', '7459', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['24597', '31669', '25786', '19907', '21804', '25839', '24559', '29087', '22642', '20680', '27433', '29047', '24426', '21030', '23521', '24787', '29860', '24181', '27924', '20910', '23734', '29438', '24114', '24685', '27813', '23015', '22154', '30866', '24905', '21187', '23583', '19567', '30251', '21611', '20458', '26723', '19897', '20564', '29737', '24317', '18945', '19603', '28916', '30354', '28196', '25287', '19718', '20263', '29342', '30369', '20276', '30942', '30610', '19587', '19201', '21012', '26595', '31284', '23824', '18138', '24853', '27237', '30695', '23166', '28153', '19789', '23811', '30876', '30788', '29394', '28151', '31741', '30875', '28054', '30236', '21777', '30564', '19663', '18518', '22245', '23561', '26911', '26669', '22547', '19724', '22363', '31965', '24630', '27263', '27072', '24843', '28118', '27874', '26613', '22034', '22869', '26456', '21750', '29692', '28192']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('0.99', '199', '2007-03-18T07:14:23.996577', '12386', '1'), + ('0.99', '243', '2007-04-27T06:05:12.996577', '7165', '2'), + ('2.99', '322', '2007-04-11T01:28:00.996577', '6033', '2'), + ('7.99', '306', '2007-03-23T14:47:40.996577', '15868', '2'), + ('2.99', '507', '2007-03-22T21:32:47.996577', '15394', '1'), + ('5.99', '326', '2007-04-29T06:54:01.996577', '8467', '1'), + ('5.99', '196', '2007-03-21T09:23:15.996577', '14410', '2'), + ('1.99', '9', '2007-04-08T15:04:10.996577', '4796', '1'), + ('0.99', '204', '2007-03-17T13:27:17.996577', '11886', '2'), + ('4.99', '390', '2007-03-19T23:32:16.996577', '13473', '1'), + ('4.99', '469', '2007-04-11T04:53:10.996577', '6099', '2'), + ('0.99', '5', '2007-04-28T00:18:55.996577', '7652', '2'), + ('7.99', '181', '2007-03-18T06:21:15.996577', '12363', '1'), + ('0.99', '425', '2007-03-22T09:10:24.996577', '15064', '1'), + ('0.99', '87', '2007-03-18T01:42:40.996577', '12232', '1'), + ('0.99', '227', '2007-03-17T13:41:47.996577', '11892', '2'), + ('4.99', '78', '2007-04-11T18:33:09.996577', '6344', '1'), + ('6.99', '156', '2007-03-01T02:52:44.996577', '10309', '2'), + ('4.99', '511', '2007-04-30T07:57:59.996577', '9760', '1'), + ('0.99', '414', '2007-03-17T05:52:12.996577', '11706', '1'), + ('6.99', '114', '2007-03-19T23:14:06.996577', '13459', '2'), + ('1.99', '40', '2007-04-08T23:45:30.996577', '5001', '2'), + ('3.99', '149', '2007-03-21T22:18:41.996577', '14771', '1'), + ('2.99', '214', '2007-03-23T06:31:51.996577', '15639', '2'), + ('2.99', '502', '2007-04-08T05:34:16.996577', '4606', '1'), + ('2.99', '34', '2007-03-18T15:11:11.996577', '12599', '1'), + ('2.99', '546', '2007-03-18T14:45:07.996577', '12591', '2'), + ('0.99', '165', '2007-04-29T11:47:18.996577', '8608', '1'), + ('4.99', '241', '2007-03-18T08:28:02.996577', '12418', '2'), + ('4.99', '444', '2007-03-01T16:42:40.996577', '10693', '1'), + ('0.99', '93', '2007-03-23T08:32:43.996577', '15696', '1'), + ('2.99', '271', '2007-03-22T16:17:08.996577', '15244', '1'), + ('4.99', '112', '2007-04-09T16:09:18.996577', '5351', '1'), + ('4.99', '486', '2007-03-19T07:53:32.996577', '13048', '1'), + ('7.99', '368', '2007-03-20T10:35:11.996577', '13781', '2'), + ('4.99', '404', '2007-04-26T22:43:30.996577', '6964', '1'), + ('0.99', '306', '2007-03-02T18:52:28.996577', '11440', '1'), + ('3.99', '379', '2007-03-02T19:42:42.996577', '11457', '2'), + ('0.99', '67', '2007-04-28T09:25:41.996577', '7895', '2'), + ('2.99', '170', '2007-03-21T18:30:17.996577', '14675', '2'), + ('2.99', '114', '2007-02-17T14:04:38.996577', '2059', '1'), + ('3.99', '274', '2007-03-23T13:30:20.996577', '15819', '2'), + ('2.99', '202', '2007-04-29T03:19:19.996577', '8351', '1'), + ('4.99', '121', '2007-04-12T14:46:38.996577', '6780', '2'), + ('4.99', '535', '2007-04-29T13:16:11.996577', '8645', '1'), + ('0.99', '280', '2007-04-29T02:13:18.996577', '8319', '2'), + ('4.99', '286', '2007-03-23T05:56:48.996577', '15629', '2'), + ('2.99', '347', '2007-03-22T04:58:36.996577', '14958', '2'), + ('9.99', '32', '2007-04-09T14:25:41.996577', '5307', '1'), + ('0.99', '122', '2007-04-11T22:47:08.996577', '6436', '1'), + ('1.99', '348', '2007-03-20T16:46:32.996577', '13962', '1'), + ('3.99', '171', '2007-04-27T01:35:10.996577', '7037', '1'), + ('5.99', '142', '2007-04-30T19:33:25.996577', '9419', '1'), + ('6.99', '273', '2007-03-23T11:18:26.996577', '15760', '1'), + ('5.99', '182', '2007-02-17T19:05:16.996577', '2120', '2'), + ('4.99', '423', '2007-03-18T23:05:52.996577', '12806', '2'), + ('1.99', '392', '2007-04-28T12:46:51.996577', '7981', '1'), + ('4.99', '210', '2007-04-08T18:48:21.996577', '4893', '1'), + ('5.99', '122', '2007-03-21T18:19:35.996577', '14666', '2'), + ('4.99', '507', '2007-02-17T20:26:39.996577', '2143', '1'), + ('3.99', '235', '2007-03-21T21:36:59.996577', '14749', '2'), + ('2.99', '449', '2007-04-28T13:39:26.996577', '8002', '2'), + ('2.99', '149', '2007-04-06T17:30:05.996577', '3894', '1'), + ('4.99', '51', '2007-03-17T05:07:42.996577', '11685', '2'), + ('4.99', '531', '2007-04-30T07:21:11.996577', '9107', '2'), + ('7.99', '294', '2007-03-21T17:12:10.996577', '14630', '2'), + ('4.99', '121', '2007-03-21T01:39:59.996577', '14177', '1'), + ('7.99', '166', '2007-04-10T16:22:32.996577', '5855', '1'), + ('2.99', '158', '2007-04-10T06:48:04.996577', '5672', '1'), + ('0.99', '36', '2007-04-28T17:03:38.996577', '8099', '2'), + ('4.99', '531', '2007-04-29T22:14:23.996577', '8860', '2'), + ('3.99', '251', '2007-04-07T00:44:14.996577', '4026', '2'), + ('2.99', '166', '2007-04-10T05:36:35.996577', '5646', '1'), + ('0.99', '523', '2007-04-28T18:49:45.996577', '8141', '2'), + ('2.99', '110', '2007-04-07T16:13:15.996577', '4317', '1'), + ('6.99', '504', '2007-03-22T13:34:03.996577', '15166', '1'), + ('3.99', '138', '2007-04-28T19:38:56.996577', '8160', '2'), + ('4.99', '279', '2007-03-20T04:15:37.996577', '13588', '2'), + ('3.99', '6', '2007-02-16T02:10:04.996577', '1575', '1'), + ('2.99', '556', '2007-03-23T03:52:35.996577', '15568', '1'), + ('1.99', '91', '2007-03-22T11:16:11.996577', '15122', '1'), + ('0.99', '421', '2007-04-11T11:50:32.996577', '6220', '1'), + ('2.99', '399', '2007-04-30T07:09:20.996577', '9728', '2'), + ('4.99', '590', '2007-03-01T15:07:10.996577', '10657', '1'), + ('6.99', '287', '2007-03-21T19:56:44.996577', '14715', '2'), + ('6.99', '569', '2007-03-02T16:03:36.996577', '11354', '1'), + ('3.98', '448', '2007-05-14T13:44:29.996577', '14734', '2'), + ('8.99', '209', '2007-03-20T11:00:58.996577', '13796', '1'), + ('6.99', '452', '2007-04-28T09:38:38.996577', '7899', '2'), + ('2.99', '436', '2007-04-06T20:02:37.996577', '3944', '2'), + ('0.99', '234', '2007-03-18T01:29:14.996577', '12226', '1'), + ('0.99', '529', '2007-04-07T12:42:18.996577', '4254', '2'), + ('2.99', '507', '2007-04-12T19:36:01.996577', '6891', '1'), + ('6.99', '394', '2007-04-06T16:31:42.996577', '3873', '1'), + ('6.99', '533', '2007-03-01T13:25:26.996577', '10614', '1'), + ('4.99', '20', '2007-03-19T07:17:03.996577', '13036', '2'), + ('4.99', '379', '2007-04-27T01:46:58.996577', '7041', '2'), + ('4.99', '502', '2007-03-21T09:23:23.996577', '14411', '1'), + ('1.99', '64', '2007-04-08T09:32:28.996577', '4690', '1'), + ('0.99', '535', '2007-04-10T02:49:36.996577', '5588', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['23111', '18529', '23331', '19136', '26050', '26561', '26295', '18329', '28077', '17993', '21710', '18256', '28981', '27542', '31734', '26450', '25136', '17743', '25172', '27035', '17600', '20066', '21741', '31329', '20389', '31749', '27765', '30293', '21231', '22583', '22344', '24255', '28822', '19528', '26598', '19296', '30855', '22600', '24599', '24546', '30574', '30142', '29746', '30919', '31509', '24724', '23089', '23310', '24842', '17796', '24762', '20439', '27129', '29310', '26722', '27674', '27960', '23564', '25816', '26318', '23201', '31359', '26224', '31283', '26511', '31666', '31980', '30573', '29441', '21925', '23799', '21533', '19904', '25752', '19019', '20803', '30859', '18950', '31366', '22232', '29887', '19083', '21838', '27517', '18347', '25724', '31232', '29732', '24877', '30740', '25382', '31241', '19652', '18918', '22434', '22250', '23580', '21023', '29155', '18170']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('8.99', '45', '2007-03-02T03:32:44.996577', '11004', '1'), + ('4.99', '8', '2007-02-20T16:26:13.996577', '3114', '2'), + ('2.99', '67', '2007-03-22T09:47:48.996577', '15085', '2'), + ('2.99', '165', '2007-02-20T22:30:36.996577', '3195', '2'), + ('2.99', '345', '2007-04-30T11:18:23.996577', '9207', '2'), + ('4.99', '389', '2007-04-28T12:44:20.996577', '7977', '2'), + ('2.99', '366', '2007-04-06T14:48:22.996577', '3834', '1'), + ('4.99', '561', '2007-02-20T19:49:17.996577', '3160', '1'), + ('1.99', '526', '2007-04-06T04:28:10.996577', '3619', '1'), + ('8.99', '466', '2007-02-18T17:33:07.996577', '2446', '2'), + ('2.99', '498', '2007-03-19T02:15:09.996577', '12893', '1'), + ('4.99', '539', '2007-02-15T17:36:42.996577', '1444', '2'), + ('5.99', '208', '2007-04-07T17:49:28.996577', '4354', '1'), + ('6.99', '479', '2007-04-06T00:05:19.996577', '3537', '2'), + ('3.99', '250', '2007-04-06T20:19:07.996577', '3951', '1'), + ('3.99', '378', '2007-04-30T04:59:29.996577', '9668', '2'), + ('3.99', '265', '2007-03-01T12:41:26.996577', '10592', '2'), + ('4.99', '402', '2007-02-14T23:53:34.996577', '1194', '2'), + ('1.99', '268', '2007-04-12T00:51:12.996577', '6489', '2'), + ('6.99', '432', '2007-04-28T16:58:54.996577', '8094', '2'), + ('4.99', '364', '2007-02-19T21:43:41.996577', '2857', '2'), + ('4.99', '327', '2007-03-19T19:33:37.996577', '13360', '1'), + ('4.99', '502', '2007-03-01T05:15:14.996577', '10390', '2'), + ('0.99', '214', '2007-04-07T10:19:07.996577', '4211', '2'), + ('2.99', '361', '2007-03-18T18:35:23.996577', '12690', '2'), + ('2.99', '251', '2007-04-30T10:58:45.996577', '9196', '1'), + ('0.99', '498', '2007-04-06T14:25:56.996577', '3828', '2'), + ('2.99', '115', '2007-04-11T03:36:37.996577', '6080', '1'), + ('8.99', '448', '2007-03-17T02:05:18.996577', '11608', '2'), + ('0.99', '595', '2007-03-21T07:00:58.996577', '14334', '1'), + ('3.99', '566', '2007-03-21T05:03:07.996577', '14277', '1'), + ('7.99', '163', '2007-03-20T02:11:39.996577', '13543', '2'), + ('4.99', '592', '2007-04-27T13:27:06.996577', '7364', '2'), + ('0.99', '267', '2007-03-23T11:43:13.996577', '15768', '1'), + ('0.99', '392', '2007-04-30T18:40:28.996577', '10085', '2'), + ('6.99', '211', '2007-02-21T17:48:43.996577', '3437', '2'), + ('3.99', '164', '2007-04-28T18:31:51.996577', '8135', '2'), + ('5.99', '597', '2007-03-02T03:03:50.996577', '10986', '2'), + ('0.99', '199', '2007-03-22T22:05:37.996577', '15412', '2'), + ('4.99', '195', '2007-03-02T00:27:02.996577', '10911', '2'), + ('7.99', '139', '2007-04-09T12:43:27.996577', '5265', '2'), + ('2.99', '102', '2007-04-10T09:27:49.996577', '5716', '1'), + ('3.99', '68', '2007-04-30T16:31:54.996577', '9339', '2'), + ('9.99', '169', '2007-04-12T00:48:35.996577', '6488', '2'), + ('0.99', '230', '2007-04-29T13:32:49.996577', '8653', '2'), + ('0.99', '219', '2007-03-20T19:51:37.996577', '14029', '2'), + ('2.99', '42', '2007-03-01T03:47:22.996577', '10345', '2'), + ('0.99', '65', '2007-03-21T07:37:17.996577', '14356', '1'), + ('3.99', '234', '2007-03-17T13:02:07.996577', '11882', '1'), + ('2.99', '416', '2007-02-16T03:59:24.996577', '1596', '2'), + ('2.99', '224', '2007-03-19T05:07:25.996577', '12969', '1'), + ('2.99', '366', '2007-03-21T19:59:05.996577', '14717', '1'), + ('4.99', '440', '2007-04-30T03:28:07.996577', '9001', '1'), + ('2.99', '30', '2007-04-08T07:41:54.996577', '4642', '2'), + ('0.99', '404', '2007-04-12T14:39:16.996577', '6779', '2'), + ('4.99', '490', '2007-04-05T21:31:03.996577', '3476', '1'), + ('6.99', '516', '2007-04-12T10:26:40.996577', '6677', '2'), + ('4.99', '91', '2007-03-23T15:19:19.996577', '15886', '2'), + ('4.99', '324', '2007-04-11T16:13:34.996577', '6299', '2'), + ('2.99', '367', '2007-04-11T12:27:02.996577', '6228', '2'), + ('4.99', '54', '2007-03-02T02:01:40.996577', '10956', '1'), + ('6.99', '218', '2007-04-08T19:00:09.996577', '4898', '1'), + ('0.99', '360', '2007-04-11T22:58:11.996577', '6442', '1'), + ('6.99', '210', '2007-04-08T17:48:18.996577', '4871', '1'), + ('0.99', '384', '2007-04-28T06:10:35.996577', '7799', '2'), + ('3.99', '243', '2007-04-11T01:39:03.996577', '6038', '2'), + ('0.99', '508', '2007-05-14T13:44:29.996577', '14318', '1'), + ('2.99', '139', '2007-04-09T04:26:05.996577', '5092', '2'), + ('0.99', '40', '2007-04-12T01:44:11.996577', '6502', '1'), + ('2.99', '521', '2007-03-17T02:47:18.996577', '11625', '2'), + ('4.99', '120', '2007-03-21T00:52:59.996577', '14153', '1'), + ('5.99', '476', '2007-03-18T19:28:17.996577', '12709', '2'), + ('0.99', '306', '2007-03-20T13:39:37.996577', '13873', '1'), + ('4.99', '319', '2007-04-08T07:02:04.996577', '4630', '1'), + ('0.99', '133', '2007-02-20T08:38:55.996577', '3006', '1'), + ('2.99', '403', '2007-03-21T13:27:55.996577', '14519', '1'), + ('0.99', '165', '2007-04-07T15:29:45.996577', '4304', '2'), + ('2.99', '115', '2007-02-15T21:36:16.996577', '1515', '2'), + ('0.99', '218', '2007-04-30T19:41:24.996577', '10114', '1'), + ('4.99', '555', '2007-03-17T06:13:08.996577', '11718', '1'), + ('6.99', '80', '2007-04-11T22:03:37.996577', '6417', '2'), + ('7.99', '149', '2007-02-18T13:46:25.996577', '2383', '2'), + ('2.99', '512', '2007-03-22T12:54:27.996577', '15153', '1'), + ('5.99', '476', '2007-04-06T23:15:26.996577', '4010', '1'), + ('4.99', '568', '2007-02-16T08:35:36.996577', '1658', '2'), + ('4.99', '316', '2007-04-26T23:28:34.996577', '6988', '2'), + ('8.99', '199', '2007-04-08T04:32:49.996577', '4580', '2'), + ('4.99', '67', '2007-04-07T04:15:59.996577', '4090', '2'), + ('5.99', '238', '2007-03-16T23:22:54.996577', '11543', '2'), + ('5.99', '154', '2007-04-08T17:07:57.996577', '4850', '1'), + ('2.99', '287', '2007-04-27T14:48:06.996577', '7402', '2'), + ('4.99', '199', '2007-04-30T12:36:10.996577', '9894', '2'), + ('2.99', '278', '2007-03-21T04:49:50.996577', '14268', '1'), + ('4.99', '108', '2007-02-15T13:14:14.996577', '1372', '2'), + ('4.99', '577', '2007-03-01T19:51:51.996577', '10782', '1'), + ('2.99', '557', '2007-03-20T10:53:58.996577', '13794', '2'), + ('4.99', '93', '2007-03-21T06:59:29.996577', '14333', '2'), + ('3.99', '424', '2007-03-20T10:50:30.996577', '13793', '2'), + ('5.99', '15', '2007-04-07T05:54:45.996577', '4127', '1'), + ('4.99', '515', '2007-02-18T19:53:49.996577', '2484', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['24021', '29150', '28632', '20622', '22646', '18185', '29172', '28438', '31555', '22513', '25727', '25994', '31517', '23762', '18231', '23177', '29821', '32053', '19194', '23026', '32055', '21653', '23401', '19290', '27006', '22275', '21559', '18711', '28355', '23507', '31236', '24553', '26634', '29632', '23261', '27320', '31522', '18851', '30377', '27725', '24334', '25343', '28839', '22984', '18071', '20776', '26914', '18774', '22458', '19987', '30611', '23119', '28588', '19679', '29103', '28218', '31447', '27334', '24301', '19540', '25448', '28848', '20686', '29644', '25505', '28834', '31738', '24033', '19292', '23792', '27707', '18017', '29874', '29509', '27958', '24637', '17895', '28756', '22796', '19302', '29226', '27327', '29003', '22599', '23883', '17908', '29070', '27827', '24591', '21341', '22233', '26575', '19964', '29079', '24826', '22515', '17787', '25495', '21281', '19085']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('2.99', '141', '2007-03-23T18:13:51.996577', '15964', '1'), + ('3.99', '14', '2007-04-29T09:39:59.996577', '8548', '1'), + ('7.99', '577', '2007-04-06T12:28:39.996577', '3785', '1'), + ('0.99', '384', '2007-03-22T00:31:56.996577', '14841', '1'), + ('2.99', '204', '2007-03-20T14:33:37.996577', '13899', '2'), + ('0.99', '518', '2007-02-21T06:33:53.996577', '3311', '2'), + ('0.99', '16', '2007-04-30T09:40:29.996577', '9158', '2'), + ('3.99', '560', '2007-04-28T09:12:22.996577', '7891', '1'), + ('2.99', '235', '2007-04-06T02:26:01.996577', '3581', '2'), + ('4.99', '586', '2007-03-17T17:51:28.996577', '12013', '1'), + ('4.99', '316', '2007-04-27T21:54:30.996577', '7592', '1'), + ('4.99', '339', '2007-04-28T12:38:32.996577', '7973', '2'), + ('0.99', '231', '2007-04-08T22:19:52.996577', '4969', '2'), + ('2.99', '117', '2007-03-17T22:34:52.996577', '12143', '1'), + ('0.99', '533', '2007-02-16T08:00:03.996577', '1652', '1'), + ('4.99', '51', '2007-03-22T03:00:16.996577', '14903', '1'), + ('0.99', '75', '2007-04-11T02:19:53.996577', '6052', '2'), + ('4.99', '114', '2007-05-14T13:44:29.996577', '12506', '2'), + ('2.99', '180', '2007-02-19T17:36:14.996577', '2798', '1'), + ('0.99', '35', '2007-03-20T23:21:35.996577', '14110', '1'), + ('4.99', '120', '2007-05-14T13:44:29.996577', '15780', '1'), + ('4.99', '491', '2007-03-02T04:43:33.996577', '11048', '1'), + ('5.99', '75', '2007-03-01T14:56:33.996577', '10653', '2'), + ('4.99', '209', '2007-02-16T08:35:15.996577', '1657', '1'), + ('7.99', '429', '2007-04-11T10:34:12.996577', '6196', '2'), + ('4.99', '560', '2007-03-01T17:03:25.996577', '10702', '1'), + ('0.99', '480', '2007-03-19T09:09:35.996577', '13092', '2'), + ('2.99', '52', '2007-02-19T22:15:50.996577', '2862', '1'), + ('2.99', '552', '2007-04-28T16:41:41.996577', '8085', '1'), + ('8.99', '86', '2007-03-01T01:08:05.996577', '10252', '2'), + ('2.99', '199', '2007-04-12T10:06:11.996577', '6668', '2'), + ('11.99', '195', '2007-03-23T20:47:59.996577', '16040', '2'), + ('0.99', '396', '2007-04-27T05:24:05.996577', '7142', '2'), + ('0.99', '57', '2007-04-30T08:35:46.996577', '9136', '2'), + ('8.99', '60', '2007-03-02T17:41:06.996577', '11404', '1'), + ('2.99', '459', '2007-04-08T01:19:49.996577', '4519', '2'), + ('0.99', '231', '2007-04-29T09:46:53.996577', '8556', '1'), + ('0.99', '89', '2007-02-18T23:14:22.996577', '2523', '1'), + ('3.99', '123', '2007-04-07T21:33:56.996577', '4442', '1'), + ('2.99', '494', '2007-04-29T02:45:06.996577', '8333', '2'), + ('4.99', '172', '2007-03-19T18:03:59.996577', '13320', '2'), + ('8.99', '284', '2007-04-28T03:01:41.996577', '7716', '2'), + ('6.99', '593', '2007-04-30T21:59:57.996577', '9483', '1'), + ('0.99', '30', '2007-03-21T07:05:41.996577', '14339', '1'), + ('3.99', '488', '2007-02-16T08:20:05.996577', '1655', '2'), + ('2.99', '400', '2007-03-21T22:21:33.996577', '14775', '1'), + ('2.99', '421', '2007-04-28T14:31:53.996577', '8025', '2'), + ('4.99', '70', '2007-02-18T19:01:06.996577', '2472', '1'), + ('4.99', '579', '2007-03-23T13:59:14.996577', '15838', '1'), + ('5.99', '316', '2007-03-19T16:26:01.996577', '13277', '2'), + ('7.99', '143', '2007-04-07T01:00:33.996577', '4031', '1'), + ('10.99', '45', '2007-03-23T13:15:52.996577', '15812', '1'), + ('4.99', '573', '2007-04-30T10:58:38.996577', '9846', '2'), + ('4.99', '280', '2007-03-22T18:26:41.996577', '15312', '1'), + ('4.99', '10', '2007-04-28T21:02:38.996577', '8188', '2'), + ('2.99', '537', '2007-04-27T06:38:55.996577', '7179', '1'), + ('4.99', '225', '2007-04-30T15:30:26.996577', '9980', '1'), + ('2.99', '459', '2007-04-30T04:00:36.996577', '9639', '2'), + ('2.99', '168', '2007-03-23T08:06:43.996577', '15683', '2'), + ('4.99', '269', '2007-03-02T00:21:32.996577', '10908', '1'), + ('8.99', '292', '2007-04-30T03:10:08.996577', '8990', '1'), + ('1.99', '594', '2007-04-29T10:05:56.996577', '8567', '1'), + ('4.99', '390', '2007-03-22T15:40:56.996577', '15222', '2'), + ('2.99', '58', '2007-04-30T17:16:34.996577', '10037', '2'), + ('2.99', '297', '2007-04-08T06:30:44.996577', '4621', '2'), + ('2.99', '593', '2007-04-11T20:43:23.996577', '6386', '1'), + ('2.99', '250', '2007-04-29T10:27:48.996577', '8579', '1'), + ('6.99', '143', '2007-03-17T03:30:51.996577', '11651', '2'), + ('4.99', '209', '2007-02-19T17:29:03.996577', '2796', '1'), + ('3.99', '119', '2007-03-23T20:21:22.996577', '16028', '2'), + ('5.99', '493', '2007-04-06T06:21:20.996577', '3655', '1'), + ('4.99', '472', '2007-02-15T14:17:27.996577', '1389', '1'), + ('5.99', '79', '2007-04-11T08:40:56.996577', '6162', '2'), + ('2.99', '45', '2007-04-27T16:07:38.996577', '7436', '1'), + ('4.99', '515', '2007-04-30T21:22:56.996577', '10159', '1'), + ('2.99', '210', '2007-03-19T02:48:51.996577', '12909', '2'), + ('4.99', '446', '2007-02-18T03:28:14.996577', '2248', '1'), + ('5.99', '587', '2007-04-29T18:35:32.996577', '8776', '2'), + ('4.99', '13', '2007-03-02T13:27:07.996577', '11292', '1'), + ('4.99', '213', '2007-02-17T05:44:07.996577', '1936', '2'), + ('2.99', '23', '2007-04-08T17:11:44.996577', '4853', '2'), + ('4.99', '459', '2007-04-28T03:02:20.996577', '7717', '1'), + ('2.99', '1', '2007-04-29T02:27:15.996577', '8326', '2'), + ('6.99', '596', '2007-03-23T15:44:54.996577', '15899', '1'), + ('2.99', '129', '2007-03-01T05:36:48.996577', '10395', '2'), + ('3.99', '448', '2007-02-21T00:45:21.996577', '3225', '2'), + ('3.99', '7', '2007-04-12T13:46:08.996577', '6761', '2'), + ('6.99', '503', '2007-04-06T19:36:55.996577', '3935', '2'), + ('4.99', '198', '2007-03-22T06:16:27.996577', '14990', '2'), + ('2.99', '459', '2007-03-01T10:34:56.996577', '10531', '1'), + ('2.99', '555', '2007-03-17T07:31:57.996577', '11747', '2'), + ('5.99', '390', '2007-04-30T12:47:51.996577', '9251', '1'), + ('2.99', '313', '2007-03-22T09:42:57.996577', '15081', '2'), + ('2.99', '8', '2007-04-09T15:41:49.996577', '5341', '2'), + ('2.99', '232', '2007-03-20T08:02:24.996577', '13707', '2'), + ('2.99', '586', '2007-03-20T20:15:09.996577', '14043', '2'), + ('4.99', '413', '2007-02-19T00:52:02.996577', '2545', '2'), + ('0.99', '296', '2007-04-09T04:16:48.996577', '5090', '2'), + ('4.99', '453', '2007-03-17T09:37:14.996577', '11794', '1'), + ('1.99', '150', '2007-02-20T21:34:33.996577', '3187', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['31739', '24815', '28994', '27901', '28450', '22481', '27420', '28543', '31933', '28310', '18790', '29875', '24828', '24994', '25775', '31937', '22703', '17518', '31434', '31109', '22127', '21773', '17987', '28833', '24240', '24502', '22475', '30517', '22431', '20162', '21897', '21635', '21692', '30842', '28332', '20573', '18962', '29346', '26068', '24561', '27681', '18568', '28087', '19053', '21754', '27073', '25244', '20951', '27932', '20682', '28082', '30378', '30502', '23255', '24315', '20313', '18092', '18456', '27529', '28182', '19613', '26633', '31475', '24237', '19709', '31115', '18050', '29099', '21396', '18352', '26891', '25770', '21669', '18006', '22853', '25590', '20176', '24825', '24168', '22406', '27330', '22237', '19210', '29548', '24626', '20616', '23242', '31466', '25493', '30457', '21456', '22130', '28906', '18461', '29159', '20822', '21446', '19041', '27560', '29038']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('0.99', '250', '2007-04-30T07:14:14.996577', '9099', '2'), + ('0.99', '231', '2007-03-18T01:02:48.996577', '12214', '1'), + ('5.99', '1', '2007-04-08T06:02:22.996577', '4611', '1'), + ('5.99', '509', '2007-04-28T22:06:23.996577', '8214', '1'), + ('7.99', '561', '2007-04-30T10:49:42.996577', '9839', '2'), + ('4.99', '582', '2007-03-21T08:17:22.996577', '14376', '1'), + ('0.99', '468', '2007-04-28T01:41:26.996577', '7685', '1'), + ('0.99', '570', '2007-04-08T09:47:57.996577', '4698', '1'), + ('2.99', '327', '2007-05-14T13:44:29.996577', '15297', '1'), + ('4.99', '547', '2007-04-10T16:16:00.996577', '5854', '2'), + ('0.99', '76', '2007-02-15T19:56:08.996577', '1487', '2'), + ('9.99', '79', '2007-04-27T08:04:20.996577', '7220', '1'), + ('0.99', '232', '2007-03-22T01:11:05.996577', '14857', '2'), + ('6.99', '251', '2007-03-19T15:37:48.996577', '13260', '2'), + ('4.99', '321', '2007-04-07T13:46:16.996577', '4281', '2'), + ('0.99', '336', '2007-05-14T13:44:29.996577', '13022', '1'), + ('4.99', '3', '2007-03-18T13:18:21.996577', '12556', '2'), + ('0.99', '343', '2007-02-21T14:42:28.996577', '3407', '1'), + ('7.99', '225', '2007-04-07T17:21:23.996577', '4345', '1'), + ('0.99', '186', '2007-04-28T03:50:17.996577', '7739', '2'), + ('9.99', '543', '2007-03-02T11:57:50.996577', '11241', '2'), + ('2.99', '504', '2007-03-19T13:34:00.996577', '13206', '2'), + ('2.99', '464', '2007-02-20T20:10:55.996577', '3167', '1'), + ('0.99', '593', '2007-04-08T17:39:18.996577', '4867', '2'), + ('0.99', '161', '2007-03-21T00:51:29.996577', '14150', '2'), + ('6.99', '189', '2007-03-20T04:29:41.996577', '13601', '2'), + ('0.99', '581', '2007-03-22T21:46:36.996577', '15403', '1'), + ('7.99', '135', '2007-04-09T02:29:28.996577', '5054', '2'), + ('0.99', '576', '2007-03-23T06:02:44.996577', '15634', '1'), + ('5.99', '337', '2007-03-20T23:42:03.996577', '14118', '2'), + ('2.99', '518', '2007-03-18T18:16:32.996577', '12681', '2'), + ('9.99', '489', '2007-03-02T07:13:10.996577', '11119', '2'), + ('4.99', '496', '2007-03-02T19:12:59.996577', '11448', '2'), + ('1.99', '163', '2007-04-27T11:23:05.996577', '7303', '1'), + ('4.99', '550', '2007-04-06T21:33:01.996577', '3979', '1'), + ('4.99', '379', '2007-03-22T21:40:25.996577', '15399', '2'), + ('4.99', '118', '2007-02-21T02:44:18.996577', '3263', '1'), + ('2.99', '32', '2007-04-11T23:17:31.996577', '6450', '2'), + ('4.99', '347', '2007-04-06T06:56:09.996577', '3666', '2'), + ('0.99', '196', '2007-03-23T18:38:39.996577', '15980', '2'), + ('2.99', '490', '2007-04-11T12:30:45.996577', '6230', '2'), + ('0.99', '20', '2007-02-16T01:02:19.996577', '1558', '2'), + ('0.99', '526', '2007-04-27T12:55:39.996577', '7343', '2'), + ('4.99', '143', '2007-02-19T03:48:57.996577', '2588', '1'), + ('1.99', '503', '2007-03-02T08:34:23.996577', '11161', '1'), + ('0.99', '436', '2007-04-08T07:42:22.996577', '4643', '2'), + ('4.99', '276', '2007-04-09T08:47:06.996577', '5186', '2'), + ('6.99', '417', '2007-03-21T05:51:36.996577', '14304', '1'), + ('4.99', '512', '2007-04-29T22:30:52.996577', '8868', '2'), + ('3.99', '390', '2007-03-20T02:18:50.996577', '13546', '2'), + ('7.99', '526', '2007-04-11T17:13:18.996577', '6316', '1'), + ('8.99', '123', '2007-04-08T17:22:33.996577', '4860', '1'), + ('4.99', '133', '2007-04-11T08:16:42.996577', '6157', '1'), + ('5.99', '59', '2007-03-22T05:41:19.996577', '14977', '1'), + ('6.99', '170', '2007-03-20T13:25:27.996577', '13862', '2'), + ('4.99', '352', '2007-03-21T00:11:37.996577', '14130', '1'), + ('2.99', '493', '2007-02-19T22:29:18.996577', '2864', '1'), + ('2.99', '595', '2007-02-14T22:16:01.996577', '1170', '2'), + ('2.99', '477', '2007-04-27T11:20:39.996577', '7302', '2'), + ('4.99', '534', '2007-04-08T23:35:47.996577', '4998', '2'), + ('0.99', '275', '2007-03-20T21:05:06.996577', '14063', '2'), + ('2.99', '396', '2007-04-12T14:23:06.996577', '6771', '2'), + ('3.99', '228', '2007-04-07T10:37:25.996577', '4217', '1'), + ('6.99', '161', '2007-03-01T22:46:33.996577', '10863', '1'), + ('7.99', '285', '2007-03-19T09:30:29.996577', '13102', '2'), + ('1.99', '186', '2007-04-30T19:17:40.996577', '10104', '1'), + ('0.99', '480', '2007-02-16T14:05:33.996577', '1733', '1'), + ('0.99', '10', '2007-04-09T20:27:23.996577', '5444', '1'), + ('2.99', '463', '2007-03-22T01:15:01.996577', '14859', '1'), + ('6.99', '569', '2007-02-15T19:06:17.996577', '1463', '1'), + ('3.99', '419', '2007-04-12T05:24:52.996577', '6587', '2'), + ('0.99', '320', '2007-04-28T22:58:32.996577', '8238', '1'), + ('0.99', '493', '2007-03-22T19:47:50.996577', '15355', '1'), + ('0.99', '468', '2007-02-19T19:45:32.996577', '2831', '1'), + ('0.99', '18', '2007-03-18T05:20:05.996577', '12333', '2'), + ('2.99', '304', '2007-04-09T18:52:04.996577', '5411', '1'), + ('4.99', '339', '2007-03-02T08:52:07.996577', '11171', '2'), + ('2.99', '232', '2007-03-19T00:43:58.996577', '12853', '2'), + ('4.99', '154', '2007-03-20T13:25:19.996577', '13861', '2'), + ('3.99', '574', '2007-03-17T08:54:19.996577', '11775', '2'), + ('9.99', '459', '2007-04-29T00:51:50.996577', '8289', '1'), + ('2.99', '555', '2007-03-18T07:16:35.996577', '12388', '1'), + ('4.99', '185', '2007-02-21T06:45:26.996577', '3314', '1'), + ('4.99', '49', '2007-04-30T11:18:50.996577', '9851', '1'), + ('2.99', '209', '2007-03-01T11:24:45.996577', '10554', '2'), + ('4.99', '383', '2007-03-21T18:41:09.996577', '14678', '2'), + ('6.99', '58', '2007-03-19T13:02:38.996577', '13194', '1'), + ('0.99', '227', '2007-04-28T22:47:46.996577', '8234', '1'), + ('2.99', '296', '2007-04-06T13:47:10.996577', '3810', '1'), + ('4.99', '129', '2007-04-29T03:09:39.996577', '8339', '1'), + ('4.99', '469', '2007-03-20T06:26:47.996577', '13654', '1'), + ('1.99', '543', '2007-03-22T17:38:52.996577', '15281', '2'), + ('2.99', '599', '2007-04-12T19:52:25.996577', '6895', '2'), + ('4.99', '597', '2007-02-19T11:57:08.996577', '2696', '1'), + ('0.99', '15', '2007-04-28T21:19:16.996577', '8193', '1'), + ('5.99', '405', '2007-03-18T08:46:32.996577', '12425', '2'), + ('2.99', '468', '2007-03-23T13:57:43.996577', '15836', '1'), + ('2.99', '140', '2007-02-16T10:37:46.996577', '1687', '1'), + ('2.99', '480', '2007-04-27T09:32:43.996577', '7257', '1'), + ('2.99', '5', '2007-04-08T18:33:09.996577', '4889', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['26931', '20683', '22817', '17715', '20151', '26950', '17522', '28425', '18570', '28224', '24876', '22794', '22531', '29627', '23502', '29055', '28607', '17995', '29626', '25306', '29463', '24274', '31365', '28633', '29587', '25835', '19790', '21778', '18009', '23490', '20416', '28215', '18327', '31995', '19820', '19879', '28143', '20903', '23489', '19599', '24961', '30021', '29834', '22331', '28829', '22452', '23884', '24332', '31260', '22329', '20605', '29686', '27630', '26229', '29049', '31975', '18555', '30084', '23718', '24420', '19757', '19991', '23816', '22757', '24211', '26731', '21570', '32044', '30257', '24689', '22975', '26580', '27868', '20020', '19165', '31474', '21283', '28238', '24137', '29682', '20954', '19128', '25760', '23785', '26572', '28300', '22309', '22015', '26664', '25638', '21210', '25503', '21805', '20105', '24247', '20261', '27523', '21757', '20911', '20438']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('5.99', '423', '2007-04-27T00:43:42.996577', '7016', '1'), + ('3.99', '390', '2007-03-20T04:18:31.996577', '13591', '2'), + ('2.99', '15', '2007-03-02T14:16:34.996577', '11307', '2'), + ('2.99', '392', '2007-02-16T16:20:20.996577', '1764', '2'), + ('2.99', '336', '2007-03-21T05:37:53.996577', '14295', '1'), + ('1.99', '424', '2007-04-30T02:18:01.996577', '8964', '2'), + ('0.99', '345', '2007-02-15T01:26:17.996577', '1210', '2'), + ('1.99', '559', '2007-04-28T01:27:34.996577', '7680', '1'), + ('4.99', '20', '2007-02-18T10:14:52.996577', '2343', '2'), + ('8.99', '538', '2007-04-09T06:21:48.996577', '5135', '2'), + ('5.99', '238', '2007-03-01T15:09:00.996577', '10659', '1'), + ('4.99', '12', '2007-03-21T03:48:05.996577', '14240', '2'), + ('4.99', '588', '2007-03-18T23:28:08.996577', '12815', '2'), + ('4.99', '57', '2007-04-12T00:18:47.996577', '6482', '2'), + ('8.99', '85', '2007-03-02T05:31:50.996577', '11067', '2'), + ('0.99', '6', '2007-04-10T01:32:01.996577', '5553', '1'), + ('8.99', '575', '2007-04-10T17:35:13.996577', '5875', '2'), + ('4.99', '466', '2007-02-21T01:16:22.996577', '3237', '2'), + ('2.99', '57', '2007-04-10T21:40:34.996577', '5948', '2'), + ('0.99', '282', '2007-04-09T05:34:44.996577', '5113', '1'), + ('7.99', '41', '2007-04-30T21:55:57.996577', '10170', '1'), + ('2.99', '166', '2007-03-21T05:09:14.996577', '14281', '2'), + ('6.99', '218', '2007-04-30T12:52:59.996577', '9902', '2'), + ('2.99', '577', '2007-04-08T20:12:26.996577', '4922', '1'), + ('4.99', '52', '2007-04-29T14:46:15.996577', '8686', '1'), + ('5.99', '326', '2007-04-09T06:46:07.996577', '5147', '1'), + ('5.99', '294', '2007-03-23T14:03:12.996577', '15839', '1'), + ('8.99', '504', '2007-03-23T09:45:52.996577', '15723', '1'), + ('0.99', '470', '2007-02-15T04:42:23.996577', '1256', '2'), + ('4.99', '84', '2007-03-02T11:00:07.996577', '11220', '2'), + ('4.99', '364', '2007-03-18T13:19:29.996577', '12557', '1'), + ('2.99', '537', '2007-04-11T16:42:31.996577', '6310', '2'), + ('0.99', '561', '2007-02-19T01:14:01.996577', '2548', '1'), + ('5.98', '560', '2007-05-14T13:44:29.996577', '12116', '2'), + ('2.99', '297', '2007-03-23T04:14:10.996577', '15582', '2'), + ('4.99', '304', '2007-03-17T16:42:21.996577', '11983', '2'), + ('4.99', '531', '2007-04-10T19:08:10.996577', '5904', '2'), + ('2.99', '413', '2007-03-18T13:15:00.996577', '12552', '2'), + ('2.99', '84', '2007-03-01T22:56:16.996577', '10872', '1'), + ('4.99', '274', '2007-03-21T08:43:39.996577', '14388', '1'), + ('2.99', '247', '2007-03-02T10:24:57.996577', '11204', '2'), + ('4.99', '91', '2007-04-30T16:28:02.996577', '10008', '2'), + ('4.99', '75', '2007-04-30T22:27:47.996577', '9501', '2'), + ('4.99', '565', '2007-03-19T13:07:40.996577', '13195', '2'), + ('2.99', '593', '2007-04-07T03:20:10.996577', '4075', '2'), + ('5.99', '579', '2007-03-18T04:43:32.996577', '12315', '2'), + ('0.99', '129', '2007-03-01T08:16:55.996577', '10468', '1'), + ('8.99', '172', '2007-03-18T16:40:05.996577', '12638', '2'), + ('5.99', '209', '2007-04-07T03:05:52.996577', '4071', '2'), + ('2.99', '565', '2007-03-17T09:42:04.996577', '11795', '1'), + ('4.99', '382', '2007-03-20T18:55:19.996577', '14009', '1'), + ('3.99', '63', '2007-04-30T00:25:30.996577', '9549', '2'), + ('2.99', '485', '2007-04-30T23:47:19.996577', '9535', '1'), + ('3.99', '360', '2007-04-28T10:01:23.996577', '7908', '2'), + ('2.99', '5', '2007-04-28T23:39:49.996577', '8263', '1'), + ('2.99', '493', '2007-05-14T13:44:29.996577', '14160', '2'), + ('7.99', '16', '2007-02-17T06:19:19.996577', '1944', '1'), + ('4.99', '98', '2007-04-08T02:53:29.996577', '4549', '1'), + ('4.99', '112', '2007-03-22T18:14:23.996577', '15304', '2'), + ('4.99', '181', '2007-03-01T01:29:52.996577', '10262', '2'), + ('2.99', '290', '2007-03-20T07:26:17.996577', '13687', '2'), + ('2.99', '317', '2007-03-17T21:28:21.996577', '12111', '2'), + ('2.99', '121', '2007-03-23T20:48:52.996577', '16041', '1'), + ('2.99', '8', '2007-03-01T11:34:01.996577', '10561', '2'), + ('2.99', '158', '2007-03-23T11:31:25.996577', '15763', '1'), + ('7.99', '405', '2007-04-09T01:45:00.996577', '5040', '2'), + ('2.99', '481', '2007-03-20T00:15:04.996577', '13497', '2'), + ('4.99', '91', '2007-05-14T13:44:29.996577', '12902', '1'), + ('6.99', '112', '2007-04-30T15:48:10.996577', '9321', '2'), + ('0.99', '215', '2007-03-19T08:56:48.996577', '13085', '2'), + ('4.99', '29', '2007-03-21T19:29:45.996577', '14703', '1'), + ('0.99', '391', '2007-04-08T10:47:17.996577', '4716', '1'), + ('2.99', '507', '2007-04-07T22:12:12.996577', '4455', '2'), + ('6.99', '321', '2007-03-23T07:41:16.996577', '15673', '1'), + ('0.99', '174', '2007-02-16T05:03:25.996577', '1609', '1'), + ('0.99', '228', '2007-04-06T13:13:48.996577', '3796', '2'), + ('7.99', '453', '2007-03-20T08:03:46.996577', '13711', '1'), + ('0.99', '539', '2007-04-07T12:20:20.996577', '4247', '1'), + ('5.99', '151', '2007-03-20T03:31:12.996577', '13568', '1'), + ('8.99', '63', '2007-04-12T17:51:03.996577', '6847', '2'), + ('0.99', '417', '2007-03-23T12:36:22.996577', '15795', '1'), + ('7.99', '163', '2007-02-17T18:14:15.996577', '2110', '2'), + ('4.99', '319', '2007-04-30T03:54:46.996577', '9017', '2'), + ('2.99', '119', '2007-03-21T08:29:29.996577', '14382', '2'), + ('3.99', '390', '2007-04-27T19:21:03.996577', '7515', '2'), + ('9.99', '546', '2007-04-12T13:42:15.996577', '6758', '2'), + ('3.99', '563', '2007-03-23T06:23:20.996577', '15638', '2'), + ('2.99', '531', '2007-03-17T04:13:36.996577', '11666', '1'), + ('0.99', '399', '2007-04-09T23:17:30.996577', '5507', '1'), + ('3.99', '308', '2007-04-06T22:36:44.996577', '4002', '1'), + ('4.99', '445', '2007-03-22T04:54:18.996577', '14955', '1'), + ('2.99', '296', '2007-04-30T15:10:00.996577', '9304', '1'), + ('8.99', '508', '2007-03-01T18:27:15.996577', '10746', '1'), + ('1.99', '331', '2007-03-21T17:05:50.996577', '14628', '1'), + ('4.99', '162', '2007-03-19T16:58:36.996577', '13288', '1'), + ('5.99', '347', '2007-03-19T17:41:09.996577', '13314', '2'), + ('6.99', '476', '2007-04-30T15:57:45.996577', '9325', '2'), + ('4.99', '503', '2007-03-18T22:29:40.996577', '12783', '2'), + ('4.99', '414', '2007-03-19T03:39:58.996577', '12930', '2'), + ('2.99', '366', '2007-03-21T08:44:04.996577', '14390', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['23073', '24281', '18235', '18000', '26215', '27593', '20435', '18547', '22496', '18217', '31374', '19979', '28329', '30403', '23601', '30221', '31639', '29200', '31265', '27684', '28920', '18748', '28512', '27534', '18098', '17839', '19656', '23574', '26831', '20900', '29122', '23084', '23500', '17825', '27187', '18481', '27342', '21542', '31729', '30499', '30200', '23258', '31720', '23688', '30220', '29013', '22469', '19863', '18400', '20684', '19214', '18616', '20794', '26047', '20033', '23828', '25733', '28995', '18249', '19414', '28279', '24767', '19200', '28487', '31633', '18469', '28132', '25003', '21637', '28592', '20414', '26859', '23032', '27571', '19609', '20277', '18981', '30042', '28879', '25360', '17984', '29675', '23176', '27967', '30294', '17681', '24851', '21665', '27661', '19877', '28785', '22002', '19347', '30580', '19209', '19887', '18230', '28982', '27163', '26281']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('3.99', '40', '2007-03-17T15:39:31.996577', '11948', '2'), + ('4.99', '167', '2007-03-19T05:25:53.996577', '12978', '1'), + ('0.99', '533', '2007-02-20T05:15:49.996577', '2956', '1'), + ('6.99', '467', '2007-02-21T01:45:02.996577', '3250', '1'), + ('0.99', '359', '2007-04-27T04:11:24.996577', '7115', '1'), + ('9.99', '483', '2007-04-12T20:12:42.996577', '6899', '2'), + ('2.99', '366', '2007-03-20T13:18:32.996577', '13857', '1'), + ('4.99', '13', '2007-02-18T00:52:27.996577', '2209', '1'), + ('8.99', '584', '2007-03-18T11:47:39.996577', '12507', '2'), + ('0.99', '527', '2007-02-18T20:48:37.996577', '2496', '2'), + ('2.99', '219', '2007-04-11T11:04:31.996577', '6209', '1'), + ('2.99', '315', '2007-03-17T22:52:56.996577', '12155', '2'), + ('7.99', '549', '2007-04-30T20:19:08.996577', '9445', '2'), + ('2.99', '125', '2007-04-29T03:53:56.996577', '8375', '2'), + ('3.99', '96', '2007-03-21T11:19:23.996577', '14462', '1'), + ('4.99', '108', '2007-04-10T13:40:20.996577', '5806', '2'), + ('0.99', '241', '2007-04-08T11:36:44.996577', '4731', '1'), + ('2.99', '20', '2007-04-10T09:31:46.996577', '5718', '1'), + ('5.99', '209', '2007-04-09T10:26:21.996577', '5219', '2'), + ('8.99', '490', '2007-04-12T21:09:14.996577', '6923', '2'), + ('2.99', '202', '2007-04-30T05:42:44.996577', '9057', '2'), + ('5.99', '62', '2007-02-20T10:45:29.996577', '3035', '1'), + ('3.99', '566', '2007-04-30T05:24:34.996577', '9688', '1'), + ('8.99', '477', '2007-04-30T20:21:27.996577', '9446', '2'), + ('2.99', '496', '2007-02-19T02:33:12.996577', '2567', '1'), + ('7.99', '429', '2007-02-17T03:58:25.996577', '1916', '2'), + ('6.99', '279', '2007-03-02T12:04:08.996577', '11250', '2'), + ('4.99', '93', '2007-03-18T19:11:26.996577', '12704', '1'), + ('7.99', '413', '2007-04-10T18:44:40.996577', '5897', '1'), + ('2.99', '413', '2007-03-02T14:08:36.996577', '11304', '2'), + ('0.99', '12', '2007-04-27T00:12:29.996577', '7008', '2'), + ('2.99', '41', '2007-03-17T22:38:46.996577', '12147', '2'), + ('4.99', '85', '2007-03-01T03:24:36.996577', '10328', '1'), + ('0.99', '426', '2007-02-19T17:53:20.996577', '2804', '1'), + ('2.99', '445', '2007-04-27T13:06:02.996577', '7351', '2'), + ('4.99', '204', '2007-02-19T14:04:53.996577', '2734', '2'), + ('6.99', '460', '2007-04-27T04:39:26.996577', '7125', '1'), + ('2.99', '478', '2007-03-17T14:09:12.996577', '11906', '1'), + ('7.99', '249', '2007-04-12T10:12:59.996577', '6670', '2'), + ('6.99', '133', '2007-04-08T09:04:29.996577', '4681', '1'), + ('6.99', '107', '2007-04-06T14:11:41.996577', '3824', '2'), + ('2.99', '59', '2007-03-23T16:01:30.996577', '15905', '2'), + ('4.99', '248', '2007-04-08T02:32:45.996577', '4541', '2'), + ('8.99', '108', '2007-03-23T03:20:42.996577', '15556', '2'), + ('5.99', '108', '2007-04-10T06:22:17.996577', '5661', '1'), + ('4.99', '2', '2007-04-30T04:34:36.996577', '9031', '1'), + ('2.99', '581', '2007-03-02T18:57:56.996577', '11443', '2'), + ('4.99', '302', '2007-03-20T23:53:26.996577', '14120', '1'), + ('2.99', '581', '2007-02-17T17:25:28.996577', '2101', '2'), + ('7.99', '390', '2007-03-20T05:05:12.996577', '13618', '2'), + ('2.99', '186', '2007-02-16T08:42:41.996577', '1663', '1'), + ('7.99', '29', '2007-02-19T12:01:32.996577', '2701', '1'), + ('2.99', '403', '2007-03-01T20:06:21.996577', '10789', '2'), + ('2.99', '345', '2007-04-28T18:15:28.996577', '8129', '2'), + ('2.99', '323', '2007-03-17T23:34:20.996577', '12169', '1'), + ('2.99', '123', '2007-03-20T06:54:32.996577', '13668', '1'), + ('8.99', '317', '2007-04-07T08:41:02.996577', '4177', '1'), + ('4.99', '1', '2007-04-09T11:52:33.996577', '5244', '1'), + ('8.99', '537', '2007-02-20T17:57:35.996577', '3134', '2'), + ('4.99', '242', '2007-02-15T19:50:24.996577', '1483', '1'), + ('2.99', '543', '2007-04-30T22:39:45.996577', '9505', '1'), + ('2.99', '224', '2007-03-22T02:13:02.996577', '14880', '2'), + ('2.99', '182', '2007-02-17T13:27:02.996577', '2049', '1'), + ('2.99', '565', '2007-04-07T20:28:30.996577', '4413', '1'), + ('8.99', '240', '2007-04-27T17:20:20.996577', '7467', '1'), + ('4.99', '202', '2007-02-15T23:20:30.996577', '1535', '1'), + ('0.99', '530', '2007-04-10T06:29:59.996577', '5663', '2'), + ('4.99', '252', '2007-03-21T22:20:58.996577', '14774', '1'), + ('6.99', '489', '2007-03-18T11:26:51.996577', '12496', '1'), + ('4.99', '574', '2007-04-06T22:49:17.996577', '4004', '1'), + ('5.99', '364', '2007-03-01T02:08:16.996577', '10290', '2'), + ('7.99', '416', '2007-04-12T19:06:03.996577', '6879', '1'), + ('6.99', '36', '2007-03-02T02:24:49.996577', '10964', '2'), + ('0.99', '481', '2007-04-11T01:47:05.996577', '6044', '1'), + ('3.99', '275', '2007-03-19T07:22:23.996577', '13037', '1'), + ('3.99', '348', '2007-03-20T21:57:51.996577', '14079', '2'), + ('4.99', '123', '2007-02-15T20:10:43.996577', '1490', '2'), + ('0.99', '93', '2007-04-28T22:44:49.996577', '8233', '1'), + ('0.99', '597', '2007-04-09T04:27:38.996577', '5093', '1'), + ('3.99', '286', '2007-04-06T08:22:38.996577', '3692', '2'), + ('2.99', '463', '2007-02-20T23:56:38.996577', '3217', '1'), + ('0.99', '62', '2007-04-30T18:35:36.996577', '10080', '2'), + ('4.99', '51', '2007-03-21T16:36:06.996577', '14617', '1'), + ('4.99', '516', '2007-04-30T12:34:53.996577', '9243', '2'), + ('2.99', '115', '2007-04-11T05:59:34.996577', '6113', '2'), + ('4.99', '384', '2007-02-20T15:17:24.996577', '3101', '2'), + ('0.99', '235', '2007-03-19T08:24:49.996577', '13070', '2'), + ('2.99', '493', '2007-03-20T05:49:41.996577', '13638', '1'), + ('5.99', '488', '2007-04-12T03:29:12.996577', '6548', '2'), + ('3.99', '303', '2007-03-23T01:24:08.996577', '15511', '1'), + ('2.99', '590', '2007-04-08T10:33:19.996577', '4710', '1'), + ('2.99', '529', '2007-03-22T18:14:31.996577', '15305', '2'), + ('4.99', '226', '2007-02-21T20:41:59.996577', '3466', '1'), + ('5.99', '139', '2007-04-28T05:10:28.996577', '7767', '2'), + ('4.99', '185', '2007-02-18T18:12:34.996577', '2459', '1'), + ('2.99', '305', '2007-03-02T02:46:19.996577', '10981', '1'), + ('5.99', '533', '2007-02-15T16:25:30.996577', '1421', '1'), + ('4.99', '208', '2007-04-08T23:04:28.996577', '4985', '2'), + ('5.99', '442', '2007-04-30T12:00:44.996577', '9873', '2'), + ('2.99', '364', '2007-04-27T09:58:46.996577', '7272', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['19561', '17816', '26949', '29379', '26487', '31004', '19640', '26349', '22683', '20374', '21910', '27873', '22315', '19735', '20346', '21811', '17911', '24728', '21421', '20473', '22604', '21007', '19692', '26436', '20897', '22006', '22668', '17708', '31858', '24001', '28109', '21585', '18932', '18674', '22693', '27153', '21814', '18333', '19982', '24435', '26895', '28187', '30290', '21010', '29222', '21928', '25976', '17649', '31754', '31433', '21323', '29307', '20982', '21014', '17838', '20800', '25751', '21389', '23052', '25374', '28598', '26033', '27452', '31661', '25279', '21192', '21439', '28097', '23957', '28384', '22354', '27158', '29733', '30757', '30915', '21358', '29401', '29690', '27821', '20421', '25876', '28477', '26302', '29869', '27161', '18960', '20673', '25834', '18390', '22523', '22580', '21891', '25719', '20627', '25754', '21656', '29735', '28762', '18874', '23522']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('4.99', '271', '2007-03-01T02:53:13.996577', '10310', '2'), + ('6.99', '423', '2007-02-19T15:33:01.996577', '2758', '2'), + ('4.99', '424', '2007-04-30T00:24:48.996577', '8918', '1'), + ('4.99', '35', '2007-04-12T04:08:16.996577', '6565', '1'), + ('4.99', '382', '2007-04-07T17:32:50.996577', '4351', '2'), + ('9.99', '177', '2007-04-11T11:42:11.996577', '6217', '2'), + ('4.99', '277', '2007-03-21T03:24:57.996577', '14227', '2'), + ('7.99', '370', '2007-04-07T19:50:52.996577', '4400', '2'), + ('4.99', '1', '2007-03-17T11:06:20.996577', '11824', '2'), + ('5.99', '360', '2007-03-17T20:48:42.996577', '12088', '2'), + ('4.99', '520', '2007-03-01T10:29:43.996577', '10530', '2'), + ('1.99', '507', '2007-04-11T20:59:34.996577', '6396', '1'), + ('6.99', '564', '2007-03-18T00:37:24.996577', '12197', '2'), + ('0.99', '288', '2007-03-20T23:31:56.996577', '14113', '2'), + ('6.99', '356', '2007-03-20T07:58:01.996577', '13703', '2'), + ('4.99', '508', '2007-03-22T14:36:49.996577', '15195', '1'), + ('0.99', '449', '2007-02-18T10:44:09.996577', '2348', '1'), + ('4.99', '220', '2007-03-01T19:40:05.996577', '10778', '2'), + ('4.99', '466', '2007-03-22T16:00:07.996577', '15230', '2'), + ('4.99', '370', '2007-03-18T05:33:32.996577', '12339', '1'), + ('5.99', '597', '2007-03-17T12:56:54.996577', '11880', '1'), + ('2.99', '422', '2007-03-22T17:21:54.996577', '15273', '1'), + ('2.99', '283', '2007-03-19T14:36:59.996577', '13229', '1'), + ('7.99', '377', '2007-04-12T19:48:37.996577', '6893', '2'), + ('4.99', '412', '2007-03-23T10:03:38.996577', '15732', '2'), + ('2.99', '530', '2007-03-18T07:14:50.996577', '12387', '1'), + ('3.99', '207', '2007-03-01T00:24:46.996577', '10234', '2'), + ('5.99', '390', '2007-02-20T18:53:43.996577', '3147', '1'), + ('0.99', '262', '2007-04-11T15:45:06.996577', '6291', '1'), + ('4.99', '140', '2007-03-18T18:02:28.996577', '12675', '1'), + ('5.99', '528', '2007-04-08T05:06:38.996577', '4593', '1'), + ('2.99', '482', '2007-03-23T14:46:51.996577', '15865', '2'), + ('4.99', '111', '2007-02-18T06:46:07.996577', '2297', '2'), + ('3.99', '42', '2007-02-17T22:26:00.996577', '2170', '1'), + ('5.99', '2', '2007-03-02T06:10:07.996577', '11087', '1'), + ('2.99', '442', '2007-04-07T18:16:12.996577', '4365', '2'), + ('4.99', '509', '2007-03-17T21:27:01.996577', '12109', '2'), + ('3.99', '562', '2007-02-19T14:50:06.996577', '2746', '1'), + ('6.99', '315', '2007-03-23T01:13:47.996577', '15504', '1'), + ('4.99', '181', '2007-03-23T00:29:46.996577', '15482', '2'), + ('2.99', '419', '2007-04-30T20:50:26.996577', '10150', '1'), + ('4.99', '534', '2007-04-30T20:59:57.996577', '9464', '2'), + ('0.99', '115', '2007-04-06T04:34:53.996577', '3624', '1'), + ('2.99', '423', '2007-03-02T06:25:07.996577', '11091', '1'), + ('0.99', '22', '2007-04-30T19:06:31.996577', '9410', '2'), + ('4.99', '521', '2007-03-18T12:23:14.996577', '12530', '1'), + ('2.99', '338', '2007-04-06T11:51:19.996577', '3772', '2'), + ('5.99', '379', '2007-02-18T07:25:11.996577', '2313', '1'), + ('0.99', '252', '2007-04-11T19:52:02.996577', '6369', '2'), + ('4.99', '225', '2007-04-06T02:04:27.996577', '3574', '2'), + ('4.99', '457', '2007-03-17T23:34:39.996577', '12171', '1'), + ('4.99', '29', '2007-04-30T14:17:20.996577', '9946', '1'), + ('4.99', '420', '2007-03-01T02:08:23.996577', '10291', '2'), + ('4.99', '423', '2007-03-22T03:00:16.996577', '14902', '2'), + ('2.99', '429', '2007-02-16T18:44:41.996577', '1798', '2'), + ('5.99', '403', '2007-03-17T17:25:21.996577', '12005', '2'), + ('2.99', '319', '2007-04-07T14:37:17.996577', '4295', '2'), + ('0.99', '463', '2007-03-01T06:03:51.996577', '10405', '2'), + ('6.99', '38', '2007-03-01T10:21:38.996577', '10524', '2'), + ('3.99', '286', '2007-04-30T09:47:47.996577', '9809', '1'), + ('2.99', '574', '2007-04-10T05:06:26.996577', '5640', '1'), + ('5.99', '343', '2007-04-30T20:53:00.996577', '9458', '2'), + ('10.99', '470', '2007-04-26T21:24:26.996577', '6927', '1'), + ('6.99', '242', '2007-04-30T07:18:34.996577', '9730', '1'), + ('2.99', '279', '2007-04-28T11:34:16.996577', '7947', '1'), + ('2.99', '444', '2007-03-18T19:32:39.996577', '12712', '2'), + ('4.99', '468', '2007-03-21T00:58:26.996577', '14154', '2'), + ('0.99', '527', '2007-04-08T18:32:53.996577', '4888', '1'), + ('2.99', '136', '2007-03-21T10:16:58.996577', '14437', '1'), + ('7.99', '555', '2007-04-30T15:52:47.996577', '9990', '2'), + ('0.99', '568', '2007-03-01T16:32:44.996577', '10689', '2'), + ('0.99', '442', '2007-04-27T17:10:01.996577', '7460', '1'), + ('2.99', '67', '2007-04-09T18:21:10.996577', '5399', '2'), + ('5.99', '155', '2007-04-28T03:28:14.996577', '7730', '2'), + ('4.99', '169', '2007-04-08T09:22:45.996577', '4687', '1'), + ('5.99', '460', '2007-03-20T15:19:44.996577', '13920', '2'), + ('5.99', '37', '2007-04-09T19:30:52.996577', '5425', '1'), + ('0.99', '64', '2007-04-06T21:42:42.996577', '3982', '2'), + ('4.99', '502', '2007-04-27T09:18:20.996577', '7255', '1'), + ('4.99', '364', '2007-03-21T05:35:13.996577', '14293', '2'), + ('2.99', '330', '2007-04-12T10:27:02.996577', '6678', '2'), + ('0.99', '564', '2007-04-07T19:17:04.996577', '4385', '2'), + ('5.99', '366', '2007-04-12T12:46:21.996577', '6738', '2'), + ('4.99', '79', '2007-04-07T02:03:19.996577', '4049', '2'), + ('4.99', '442', '2007-04-29T17:49:15.996577', '8758', '1'), + ('4.99', '118', '2007-02-16T16:28:03.996577', '1766', '2'), + ('2.99', '389', '2007-03-21T15:22:04.996577', '14578', '1'), + ('7.99', '326', '2007-04-07T07:41:43.996577', '4160', '1'), + ('2.99', '577', '2007-02-21T04:59:55.996577', '3286', '2'), + ('4.99', '587', '2007-03-02T17:38:47.996577', '11403', '2'), + ('2.99', '595', '2007-03-02T01:14:48.996577', '10932', '1'), + ('0.99', '517', '2007-03-19T20:34:35.996577', '13396', '1'), + ('9.99', '315', '2007-04-30T07:26:15.996577', '9735', '2'), + ('4.99', '385', '2007-03-01T15:01:53.996577', '10655', '1'), + ('2.99', '319', '2007-04-10T17:49:00.996577', '5882', '1'), + ('2.99', '491', '2007-03-20T04:37:08.996577', '13607', '2'), + ('2.99', '67', '2007-04-11T07:02:46.996577', '6137', '1'), + ('5.99', '588', '2007-04-07T10:01:11.996577', '4207', '2'), + ('3.99', '96', '2007-02-15T05:40:05.996577', '1266', '1'), + ('8.99', '87', '2007-03-18T02:39:29.996577', '12257', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['22445', '20625', '19040', '28383', '31228', '21666', '29168', '29217', '24277', '25329', '18528', '21321', '18526', '29703', '24845', '20344', '31097', '22247', '17714', '30856', '19381', '27902', '30948', '27563', '20567', '31566', '20038', '30503', '25236', '19309', '20932', '20693', '19272', '22057', '18974', '28783', '29138', '31844', '24024', '32028', '19753', '19433', '18628', '28458', '23445', '19352', '28119', '22561', '29324', '31905', '19271', '31312', '23783', '23192', '29080', '18427', '24909', '27030', '26629', '31471', '27438', '27154', '30234', '29109', '29053', '24590', '24647', '28874', '26169', '23071', '19738', '30325', '22490', '19341', '21971', '18523', '24362', '27453', '30714', '30924', '22453', '32002', '30582', '27835', '23733', '23148', '29296', '30967', '19659', '24588', '17614', '22520', '18591', '27430', '23162', '31313', '23409', '23513', '25459', '19655']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('7.99', '578', '2007-03-02T10:16:06.996577', '11199', '1'), + ('0.99', '385', '2007-03-01T11:27:50.996577', '10557', '1'), + ('4.99', '140', '2007-02-16T03:19:44.996577', '1586', '1'), + ('5.99', '555', '2007-04-30T15:01:17.996577', '9299', '1'), + ('0.99', '198', '2007-04-30T17:56:25.996577', '9389', '2'), + ('6.99', '493', '2007-03-20T07:01:17.996577', '13675', '2'), + ('4.99', '16', '2007-04-11T05:08:57.996577', '6100', '1'), + ('2.99', '22', '2007-04-07T10:29:18.996577', '4215', '2'), + ('1.99', '166', '2007-03-23T13:00:16.996577', '15806', '2'), + ('0.99', '283', '2007-04-28T06:42:38.996577', '7816', '1'), + ('5.99', '8', '2007-02-17T16:50:01.996577', '2095', '1'), + ('6.99', '457', '2007-03-17T15:50:31.996577', '11956', '2'), + ('0.99', '7', '2007-02-20T08:40:19.996577', '3007', '1'), + ('2.99', '64', '2007-04-27T02:55:58.996577', '7082', '1'), + ('5.99', '234', '2007-03-19T03:16:14.996577', '12921', '1'), + ('4.99', '356', '2007-03-19T09:42:24.996577', '13107', '2'), + ('2.99', '185', '2007-04-08T01:39:14.996577', '4524', '1'), + ('1.99', '557', '2007-03-18T13:17:48.996577', '12555', '1'), + ('6.99', '392', '2007-02-15T23:06:33.996577', '1530', '2'), + ('4.99', '164', '2007-04-29T20:51:24.996577', '8824', '2'), + ('4.99', '235', '2007-02-15T20:18:58.996577', '1493', '1'), + ('0.99', '509', '2007-04-28T23:01:58.996577', '8240', '2'), + ('7.99', '172', '2007-04-11T13:26:17.996577', '6246', '2'), + ('6.99', '480', '2007-04-30T02:25:21.996577', '8967', '1'), + ('7.99', '379', '2007-03-19T20:35:01.996577', '13397', '2'), + ('5.99', '235', '2007-04-30T03:57:19.996577', '9019', '1'), + ('0.99', '323', '2007-03-23T09:58:58.996577', '15728', '1'), + ('3.99', '133', '2007-04-12T06:48:07.996577', '6609', '1'), + ('5.99', '275', '2007-04-11T16:22:35.996577', '6301', '2'), + ('2.99', '213', '2007-02-21T06:39:44.996577', '3313', '1'), + ('6.99', '416', '2007-03-02T01:28:44.996577', '10937', '1'), + ('0.99', '391', '2007-03-17T20:50:09.996577', '12090', '1'), + ('2.99', '197', '2007-02-19T16:53:08.996577', '2781', '2'), + ('0.99', '535', '2007-03-18T01:45:20.996577', '12233', '1'), + ('0.99', '122', '2007-02-15T01:29:46.996577', '1211', '1'), + ('4.99', '589', '2007-04-30T09:26:42.996577', '9153', '1'), + ('0.99', '13', '2007-04-30T19:58:07.996577', '9434', '2'), + ('0.99', '260', '2007-04-29T16:09:11.996577', '8717', '1'), + ('0.99', '142', '2007-03-19T04:57:39.996577', '12964', '1'), + ('4.99', '52', '2007-05-14T13:44:29.996577', '12001', '1'), + ('3.99', '290', '2007-03-18T00:32:25.996577', '12193', '2'), + ('3.99', '248', '2007-02-17T14:35:34.996577', '2066', '1'), + ('6.99', '31', '2007-02-18T10:03:56.996577', '2341', '2'), + ('2.99', '562', '2007-04-27T20:48:43.996577', '7560', '2'), + ('0.99', '79', '2007-03-21T01:42:53.996577', '14179', '1'), + ('3.99', '228', '2007-02-18T05:28:17.996577', '2284', '2'), + ('5.99', '529', '2007-04-07T21:36:10.996577', '4444', '2'), + ('2.99', '592', '2007-03-01T14:06:14.996577', '10634', '2'), + ('0.99', '30', '2007-04-30T00:33:24.996577', '9551', '2'), + ('2.99', '265', '2007-04-30T19:21:11.996577', '9416', '1'), + ('4.99', '197', '2007-02-19T15:05:50.996577', '2750', '1'), + ('6.99', '212', '2007-04-08T20:00:43.996577', '4916', '2'), + ('4.99', '119', '2007-03-20T03:54:41.996577', '13581', '1'), + ('5.99', '53', '2007-03-19T07:54:06.996577', '13049', '1'), + ('4.99', '8', '2007-04-11T20:08:12.996577', '6375', '1'), + ('3.99', '588', '2007-02-20T02:41:12.996577', '2920', '2'), + ('2.99', '241', '2007-03-21T12:20:33.996577', '14485', '2'), + ('4.99', '432', '2007-04-10T21:20:10.996577', '5944', '1'), + ('6.99', '396', '2007-04-06T18:23:07.996577', '3909', '2'), + ('0.99', '228', '2007-04-06T00:05:33.996577', '3538', '2'), + ('4.99', '469', '2007-04-28T04:51:18.996577', '7756', '2'), + ('3.99', '442', '2007-04-08T04:27:26.996577', '4577', '2'), + ('2.99', '109', '2007-04-30T11:54:12.996577', '9871', '1'), + ('4.99', '11', '2007-04-27T11:41:58.996577', '7314', '1'), + ('0.99', '6', '2007-04-06T21:42:47.996577', '3983', '2'), + ('2.99', '198', '2007-03-21T08:22:18.996577', '14380', '2'), + ('3.99', '211', '2007-03-17T16:04:13.996577', '11963', '2'), + ('2.99', '596', '2007-04-11T00:32:38.996577', '6015', '1'), + ('5.99', '355', '2007-04-10T01:51:31.996577', '5564', '1'), + ('2.99', '40', '2007-03-01T07:26:34.996577', '10442', '1'), + ('2.99', '288', '2007-03-22T11:09:59.996577', '15119', '1'), + ('4.99', '118', '2007-04-28T12:00:43.996577', '7956', '2'), + ('4.99', '583', '2007-03-02T03:31:22.996577', '11002', '2'), + ('4.99', '223', '2007-02-18T09:24:50.996577', '2334', '1'), + ('2.99', '526', '2007-03-22T13:42:46.996577', '15168', '1'), + ('2.99', '7', '2007-02-18T03:32:02.996577', '2250', '1'), + ('6.99', '175', '2007-03-20T12:28:55.996577', '13833', '2'), + ('5.99', '470', '2007-04-26T21:56:06.996577', '6942', '1'), + ('0.99', '151', '2007-04-27T07:03:28.996577', '7189', '1'), + ('4.99', '170', '2007-04-06T06:08:57.996577', '3651', '2'), + ('2.99', '579', '2007-03-20T20:29:09.996577', '14047', '2'), + ('0.99', '579', '2007-05-14T13:44:29.996577', '15794', '2'), + ('4.99', '139', '2007-04-30T13:25:39.996577', '9920', '2'), + ('0.99', '503', '2007-04-30T07:03:44.996577', '9725', '2'), + ('6.99', '114', '2007-03-18T18:19:55.996577', '12685', '1'), + ('2.99', '49', '2007-03-01T12:38:47.996577', '10588', '1'), + ('2.99', '28', '2007-04-30T19:42:28.996577', '10116', '2'), + ('0.99', '173', '2007-04-27T23:55:59.996577', '7644', '1'), + ('2.99', '279', '2007-03-19T03:48:51.996577', '12935', '2'), + ('5.99', '198', '2007-03-20T10:12:09.996577', '13768', '1'), + ('4.99', '368', '2007-02-19T14:49:06.996577', '2744', '1'), + ('4.99', '587', '2007-03-01T00:00:22.996577', '10224', '2'), + ('8.99', '25', '2007-02-19T06:51:37.996577', '2625', '2'), + ('3.99', '469', '2007-04-09T14:06:35.996577', '5299', '1'), + ('4.99', '51', '2007-03-01T00:48:27.996577', '10244', '2'), + ('6.99', '212', '2007-04-09T05:35:44.996577', '5115', '1'), + ('4.99', '75', '2007-03-18T08:52:37.996577', '12426', '1'), + ('4.99', '86', '2007-03-19T18:38:25.996577', '13338', '2'), + ('2.99', '293', '2007-04-29T17:31:31.996577', '8745', '1'), + ('4.99', '278', '2007-03-23T19:59:11.996577', '16019', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['22592', '27178', '18348', '22284', '30625', '27522', '20367', '27305', '24245', '31458', '31188', '20670', '28757', '18278', '25840', '30522', '31318', '30986', '23349', '28433', '26083', '28144', '30860', '28212', '28334', '25224', '20186', '31500', '22581', '29861', '19112', '27632', '23835', '28761', '29413', '28221', '22927', '24848', '28951', '27234', '23017', '29062', '24587', '18579', '31008', '23276', '26201', '30954', '23985', '18172', '28918', '22184', '27820', '20704', '30154', '20872', '31531', '18104', '24900', '31278', '17864', '29240', '27767', '30652', '25715', '21264', '29010', '19168', '19642', '30916', '30274', '29398', '17932', '23056', '31846', '30801', '24755', '19507', '22569', '20372', '30667', '18928', '27975', '25809', '20150', '31384', '19119', '27574', '30936', '29633', '29740', '29948', '28609', '31478', '18621', '18341', '18192', '27472', '29108', '21575']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('0.99', '596', '2007-03-17T15:08:26.996577', '11934', '1'), + ('2.99', '444', '2007-04-10T10:58:09.996577', '5753', '1'), + ('4.99', '568', '2007-02-18T13:32:18.996577', '2382', '2'), + ('6.99', '560', '2007-03-22T19:45:20.996577', '15352', '1'), + ('7.99', '144', '2007-04-10T00:32:29.996577', '5526', '2'), + ('0.99', '476', '2007-04-28T19:06:02.996577', '8146', '1'), + ('5.99', '359', '2007-03-21T16:08:31.996577', '14598', '2'), + ('7.99', '457', '2007-04-11T23:50:29.996577', '6467', '1'), + ('5.99', '161', '2007-03-22T22:24:17.996577', '15420', '1'), + ('2.99', '226', '2007-04-29T12:33:38.996577', '8627', '1'), + ('4.99', '195', '2007-04-29T00:14:17.996577', '8280', '2'), + ('3.99', '389', '2007-03-17T15:31:08.996577', '11944', '2'), + ('6.99', '587', '2007-04-30T06:53:47.996577', '9720', '2'), + ('3.99', '546', '2007-02-16T17:59:25.996577', '1787', '1'), + ('4.99', '326', '2007-04-29T11:35:39.996577', '8604', '1'), + ('4.99', '135', '2007-04-27T11:08:14.996577', '7297', '2'), + ('4.99', '213', '2007-04-07T11:40:33.996577', '4236', '2'), + ('2.99', '175', '2007-04-28T23:04:00.996577', '8244', '1'), + ('2.99', '70', '2007-03-17T14:04:13.996577', '11901', '1'), + ('0.99', '560', '2007-04-07T22:01:05.996577', '4453', '1'), + ('2.99', '347', '2007-04-30T12:06:17.996577', '9876', '1'), + ('4.99', '531', '2007-04-12T13:36:54.996577', '6756', '1'), + ('2.99', '165', '2007-04-08T21:13:28.996577', '4945', '2'), + ('0.99', '537', '2007-04-06T15:27:46.996577', '3853', '2'), + ('2.99', '550', '2007-04-12T11:08:05.996577', '6695', '1'), + ('2.99', '274', '2007-04-07T07:00:38.996577', '4147', '1'), + ('2.99', '340', '2007-03-01T02:11:06.996577', '10292', '1'), + ('0.99', '230', '2007-04-08T20:49:22.996577', '4935', '1'), + ('0.99', '595', '2007-03-17T07:32:28.996577', '11748', '2'), + ('1.99', '78', '2007-04-27T07:26:04.996577', '7200', '2'), + ('6.99', '158', '2007-02-17T12:13:35.996577', '2035', '2'), + ('4.99', '486', '2007-04-06T14:51:11.996577', '3835', '1'), + ('0.99', '124', '2007-03-21T20:55:37.996577', '14737', '2'), + ('0.99', '588', '2007-04-07T04:53:37.996577', '4101', '1'), + ('0.99', '38', '2007-04-26T22:39:15.996577', '6961', '1'), + ('4.99', '537', '2007-04-28T23:31:08.996577', '8256', '2'), + ('4.99', '25', '2007-03-21T03:41:42.996577', '14236', '1'), + ('2.99', '234', '2007-03-22T11:32:18.996577', '15129', '1'), + ('4.99', '205', '2007-04-30T18:42:34.996577', '10086', '2'), + ('2.99', '449', '2007-04-10T14:48:19.996577', '5824', '1'), + ('4.99', '34', '2007-03-19T19:50:13.996577', '13371', '1'), + ('5.99', '7', '2007-04-06T05:37:43.996577', '3639', '2'), + ('5.99', '198', '2007-03-19T01:00:25.996577', '12862', '1'), + ('0.99', '23', '2007-02-19T19:18:27.996577', '2827', '1'), + ('0.99', '177', '2007-04-28T18:44:56.996577', '8139', '1'), + ('2.99', '62', '2007-03-01T21:14:47.996577', '10815', '1'), + ('3.99', '357', '2007-04-30T12:12:41.996577', '9233', '2'), + ('2.99', '172', '2007-04-27T09:43:27.996577', '7261', '2'), + ('2.99', '138', '2007-03-22T22:31:27.996577', '15424', '1'), + ('3.99', '515', '2007-02-20T12:20:29.996577', '3063', '2'), + ('2.99', '202', '2007-04-29T21:03:01.996577', '8830', '1'), + ('2.99', '550', '2007-03-17T19:53:14.996577', '12063', '1'), + ('3.99', '502', '2007-04-27T07:50:55.996577', '7213', '2'), + ('7.99', '392', '2007-03-20T22:03:39.996577', '14081', '2'), + ('6.99', '103', '2007-04-06T10:47:54.996577', '3750', '2'), + ('8.99', '410', '2007-03-19T04:34:24.996577', '12955', '2'), + ('2.99', '232', '2007-04-28T13:11:34.996577', '7990', '1'), + ('2.99', '498', '2007-02-16T17:49:38.996577', '1782', '1'), + ('2.99', '240', '2007-03-21T15:12:58.996577', '14573', '2'), + ('0.99', '210', '2007-04-07T13:07:07.996577', '4270', '2'), + ('0.99', '435', '2007-02-15T17:26:17.996577', '1443', '2'), + ('0.99', '24', '2007-04-10T05:37:47.996577', '5648', '2'), + ('4.99', '498', '2007-04-07T15:59:40.996577', '4311', '1'), + ('0.99', '145', '2007-04-30T01:21:25.996577', '9576', '2'), + ('4.99', '315', '2007-04-12T09:49:05.996577', '6661', '1'), + ('4.99', '451', '2007-03-18T08:41:38.996577', '12422', '1'), + ('5.99', '2', '2007-04-28T22:41:25.996577', '8230', '2'), + ('0.99', '175', '2007-02-15T20:22:57.996577', '1495', '2'), + ('10.99', '277', '2007-03-22T06:52:58.996577', '15008', '1'), + ('2.99', '169', '2007-04-09T03:17:16.996577', '5066', '1'), + ('4.99', '114', '2007-04-05T21:51:37.996577', '3484', '1'), + ('0.99', '36', '2007-04-30T09:39:36.996577', '9805', '2'), + ('0.99', '452', '2007-02-18T21:48:19.996577', '2504', '1'), + ('0.99', '38', '2007-03-17T20:56:41.996577', '12092', '2'), + ('4.99', '260', '2007-04-30T10:19:20.996577', '9176', '2'), + ('4.99', '159', '2007-04-07T13:08:48.996577', '4273', '2'), + ('0.99', '223', '2007-03-20T03:48:22.996577', '13576', '1'), + ('4.99', '266', '2007-02-20T08:24:38.996577', '3002', '2'), + ('3.99', '593', '2007-03-01T10:42:42.996577', '10533', '2'), + ('6.99', '360', '2007-03-02T12:33:44.996577', '11264', '2'), + ('4.99', '147', '2007-04-11T23:57:53.996577', '6469', '2'), + ('8.99', '110', '2007-02-15T23:01:18.996577', '1528', '2'), + ('5.99', '517', '2007-04-10T22:39:03.996577', '5974', '2'), + ('4.99', '323', '2007-04-30T17:04:20.996577', '10028', '1'), + ('4.99', '336', '2007-03-20T07:32:56.996577', '13689', '2'), + ('2.99', '220', '2007-04-10T15:56:08.996577', '5847', '2'), + ('2.99', '161', '2007-02-16T23:30:26.996577', '1856', '1'), + ('6.99', '481', '2007-04-28T23:03:59.996577', '8243', '1'), + ('0.99', '171', '2007-04-06T04:32:21.996577', '3621', '1'), + ('1.99', '57', '2007-04-30T11:28:11.996577', '9211', '1'), + ('0.99', '68', '2007-04-06T03:39:30.996577', '3598', '1'), + ('2.99', '86', '2007-04-29T21:52:46.996577', '8850', '1'), + ('0.99', '575', '2007-04-27T02:57:05.996577', '7083', '1'), + ('2.99', '228', '2007-04-09T06:59:29.996577', '5151', '1'), + ('1.99', '30', '2007-02-17T01:07:46.996577', '1874', '2'), + ('5.99', '566', '2007-02-16T06:55:22.996577', '1635', '1'), + ('0.99', '521', '2007-02-16T16:18:23.996577', '1761', '1'), + ('6.99', '472', '2007-04-11T06:13:12.996577', '6119', '1'), + ('6.99', '11', '2007-04-11T07:38:25.996577', '6146', '2'), + ('4.99', '482', '2007-03-01T21:28:48.996577', '10824', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['32082', '23636', '22079', '24931', '20418', '18495', '29843', '17702', '23279', '21673', '22323', '21455', '25791', '17616', '20357', '23431', '20881', '29508', '27775', '18795', '18618', '23440', '29738', '30696', '24516', '25959', '24184', '27536', '18020', '25587', '17555', '30891', '31257', '30858', '21664', '19086', '28654', '25247', '25296', '19644', '23319', '18453', '22026', '21591', '22854', '28975', '20766', '28971', '25090', '29702', '23803', '25721', '30789', '27897', '21831', '18120', '22501', '27999', '22579', '21534', '26446', '22588', '20868', '22186', '18934', '18422', '24201', '19701', '17865', '22030', '29653', '26899', '26832', '26865', '26856', '19436', '31282', '27740', '29347', '20184', '17780', '21240', '31274', '28434', '21894', '20364', '22358', '25359', '30353', '30923', '29725', '25259', '25528', '31256', '30752', '20432', '30844', '18668', '26504', '29582']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('2.99', '214', '2007-05-14T13:44:29.996577', '15645', '2'), + ('4.99', '102', '2007-03-02T09:28:58.996577', '11183', '1'), + ('0.99', '537', '2007-03-21T18:22:37.996577', '14670', '1'), + ('0.99', '243', '2007-03-20T23:21:11.996577', '14108', '1'), + ('3.99', '364', '2007-03-19T02:53:01.996577', '12912', '2'), + ('5.99', '1', '2007-02-14T23:22:38.996577', '1185', '1'), + ('2.99', '76', '2007-04-30T15:27:43.996577', '9312', '2'), + ('4.99', '389', '2007-02-17T06:27:05.996577', '1946', '1'), + ('8.99', '62', '2007-03-20T00:55:39.996577', '13512', '2'), + ('2.99', '494', '2007-03-01T13:51:04.996577', '10623', '1'), + ('10.99', '565', '2007-03-01T19:28:24.996577', '10776', '2'), + ('6.99', '469', '2007-03-18T16:24:04.996577', '12633', '1'), + ('4.99', '322', '2007-04-28T18:50:20.996577', '8142', '2'), + ('0.99', '369', '2007-02-15T02:12:51.996577', '1224', '1'), + ('4.99', '358', '2007-03-01T08:46:13.996577', '10482', '1'), + ('10.99', '78', '2007-03-02T01:44:57.996577', '10942', '1'), + ('3.99', '410', '2007-03-22T21:30:41.996577', '15392', '2'), + ('9.99', '45', '2007-04-26T22:44:01.996577', '6966', '1'), + ('4.99', '498', '2007-04-27T12:52:21.996577', '7341', '1'), + ('0.99', '76', '2007-02-21T15:33:55.996577', '3416', '2'), + ('2.99', '29', '2007-02-19T17:46:35.996577', '2801', '2'), + ('7.99', '78', '2007-03-22T01:20:07.996577', '14862', '2'), + ('1.99', '67', '2007-04-29T10:01:24.996577', '8563', '2'), + ('6.99', '149', '2007-04-06T19:44:58.996577', '3939', '1'), + ('2.99', '190', '2007-03-21T01:27:57.996577', '14166', '2'), + ('4.99', '336', '2007-04-29T11:46:26.996577', '8607', '2'), + ('0.99', '156', '2007-03-20T01:41:09.996577', '13530', '2'), + ('4.99', '478', '2007-04-10T15:26:16.996577', '5837', '1'), + ('0.99', '472', '2007-02-20T06:28:50.996577', '2974', '1'), + ('2.99', '303', '2007-04-30T23:25:13.996577', '10209', '2'), + ('6.99', '353', '2007-02-21T01:07:57.996577', '3233', '2'), + ('2.99', '167', '2007-04-28T16:56:33.996577', '8092', '1'), + ('2.99', '201', '2007-04-27T22:30:41.996577', '7606', '2'), + ('5.99', '165', '2007-04-06T12:26:22.996577', '3784', '1'), + ('7.99', '493', '2007-03-01T23:20:03.996577', '10885', '2'), + ('5.99', '150', '2007-02-21T19:48:13.996577', '3456', '1'), + ('9.99', '579', '2007-04-08T06:29:35.996577', '4619', '1'), + ('2.99', '276', '2007-04-28T07:38:32.996577', '7842', '2'), + ('5.99', '281', '2007-04-09T18:49:36.996577', '5410', '2'), + ('2.99', '278', '2007-03-01T14:40:06.996577', '10649', '1'), + ('6.99', '66', '2007-03-21T03:06:22.996577', '14217', '1'), + ('6.99', '594', '2007-02-18T05:02:14.996577', '2276', '1'), + ('4.99', '532', '2007-03-19T07:23:42.996577', '13038', '2'), + ('2.99', '483', '2007-03-19T01:38:47.996577', '12875', '2'), + ('0.99', '18', '2007-03-19T23:57:55.996577', '13490', '2'), + ('0.99', '207', '2007-04-12T03:14:56.996577', '6537', '1'), + ('4.99', '399', '2007-03-19T17:04:18.996577', '13293', '2'), + ('0.99', '207', '2007-04-09T12:25:22.996577', '5258', '1'), + ('2.99', '260', '2007-03-20T16:56:54.996577', '13966', '1'), + ('0.99', '64', '2007-04-27T01:56:01.996577', '7045', '2'), + ('5.99', '121', '2007-03-01T07:46:00.996577', '10457', '2'), + ('3.99', '316', '2007-04-09T04:54:14.996577', '5102', '2'), + ('4.99', '158', '2007-04-10T23:24:04.996577', '5988', '1'), + ('2.99', '509', '2007-04-09T00:00:08.996577', '5008', '2'), + ('3.99', '512', '2007-03-01T15:35:42.996577', '10670', '2'), + ('7.99', '502', '2007-02-16T11:18:27.996577', '1696', '2'), + ('5.99', '584', '2007-03-21T03:25:55.996577', '14230', '2'), + ('6.99', '519', '2007-04-30T19:23:21.996577', '9417', '1'), + ('2.99', '595', '2007-03-01T17:49:37.996577', '10729', '1'), + ('0.99', '476', '2007-03-22T22:06:27.996577', '15413', '1'), + ('1.99', '378', '2007-04-10T02:28:57.996577', '5578', '1'), + ('2.99', '596', '2007-03-01T18:45:29.996577', '10756', '1'), + ('0.99', '410', '2007-03-02T06:48:04.996577', '11107', '1'), + ('10.99', '550', '2007-03-19T09:55:58.996577', '13114', '1'), + ('2.99', '111', '2007-02-21T08:30:02.996577', '3333', '2'), + ('4.99', '587', '2007-02-18T08:51:18.996577', '2329', '1'), + ('4.99', '158', '2007-03-02T05:55:09.996577', '11077', '2'), + ('3.99', '284', '2007-03-22T11:47:45.996577', '15135', '2'), + ('0.99', '435', '2007-02-20T07:12:10.996577', '2984', '1'), + ('0.99', '532', '2007-03-22T14:11:23.996577', '15180', '2'), + ('4.99', '59', '2007-04-28T13:14:11.996577', '7991', '1'), + ('0.99', '420', '2007-04-10T19:20:08.996577', '5911', '2'), + ('4.99', '413', '2007-04-27T03:33:27.996577', '7100', '2'), + ('2.99', '416', '2007-04-30T17:53:16.996577', '9383', '2'), + ('3.99', '416', '2007-04-06T14:46:54.996577', '3833', '1'), + ('5.99', '249', '2007-02-15T19:23:46.996577', '1473', '1'), + ('5.99', '210', '2007-04-08T06:30:10.996577', '4620', '1'), + ('9.99', '495', '2007-04-30T17:55:31.996577', '9387', '1'), + ('6.99', '32', '2007-04-27T03:02:33.996577', '7084', '1'), + ('4.99', '339', '2007-03-21T17:27:43.996577', '14636', '1'), + ('0.99', '410', '2007-02-20T06:24:26.996577', '2971', '2'), + ('4.99', '448', '2007-03-22T22:36:19.996577', '15427', '1'), + ('6.99', '209', '2007-04-30T05:40:10.996577', '9054', '2'), + ('2.99', '560', '2007-04-09T09:45:22.996577', '5208', '2'), + ('5.99', '518', '2007-03-01T18:34:36.996577', '10751', '1'), + ('1.99', '359', '2007-03-18T15:38:08.996577', '12611', '1'), + ('5.99', '568', '2007-03-22T09:24:08.996577', '15069', '2'), + ('4.99', '286', '2007-04-06T03:07:16.996577', '3592', '2'), + ('0.99', '121', '2007-04-10T06:43:18.996577', '5670', '2'), + ('0.99', '169', '2007-04-30T11:12:06.996577', '9203', '2'), + ('0.99', '66', '2007-04-10T19:40:42.996577', '5915', '2'), + ('2.99', '277', '2007-04-11T23:30:24.996577', '6455', '2'), + ('5.99', '299', '2007-04-07T07:21:34.996577', '4153', '2'), + ('0.99', '201', '2007-04-27T03:49:50.996577', '7106', '1'), + ('4.99', '155', '2007-04-11T03:53:02.996577', '6085', '1'), + ('2.99', '366', '2007-03-18T08:19:00.996577', '12413', '2'), + ('0.99', '163', '2007-04-28T15:08:09.996577', '8040', '2'), + ('4.99', '40', '2007-02-20T07:40:38.996577', '2993', '1'), + ('0.99', '383', '2007-04-30T05:09:13.996577', '9678', '1'), + ('2.99', '52', '2007-04-10T03:36:36.996577', '5607', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['20470', '25380', '22268', '19638', '31181', '22751', '19525', '22940', '28649', '29912', '30945', '25167', '25975', '31387', '18739', '27074', '21577', '31658', '24079', '17813', '29149', '30929', '30297', '22644', '25260', '27277', '26916', '25429', '26029', '18647', '26509', '21892', '25757', '30342', '17933', '32065', '21696', '27577', '30456', '27742', '23741', '18276', '26844', '30368', '30964', '31516', '28634', '30718', '28602', '20003', '29636', '19378', '23315', '31071', '19374', '25314', '18052', '23987', '21595', '25782', '24060', '29457', '31558', '23653', '28325', '23330', '31114', '31190', '24670', '23919', '25280', '19846', '18166', '30797', '22448', '22297', '30605', '26437', '22004', '27558', '23511', '22178', '28479', '28894', '22125', '27233', '27914', '25362', '27131', '19861', '18870', '24029', '27152', '30617', '29664', '18685', '21027', '20348', '22019', '28719']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('4.99', '370', '2007-03-01T03:28:19.996577', '10336', '1'), + ('3.99', '287', '2007-04-11T20:19:51.996577', '6379', '2'), + ('4.99', '559', '2007-03-19T18:11:34.996577', '13322', '2'), + ('4.99', '277', '2007-03-20T01:27:08.996577', '13526', '2'), + ('7.99', '194', '2007-04-30T05:53:21.996577', '9064', '1'), + ('8.99', '7', '2007-03-18T06:25:40.996577', '12367', '1'), + ('5.99', '267', '2007-03-21T00:12:06.996577', '14131', '1'), + ('2.99', '26', '2007-03-22T21:03:10.996577', '15384', '1'), + ('2.99', '578', '2007-04-28T20:33:39.996577', '8179', '1'), + ('6.99', '83', '2007-04-09T18:04:41.996577', '5394', '2'), + ('5.99', '172', '2007-04-08T15:53:49.996577', '4820', '1'), + ('7.99', '268', '2007-04-09T01:43:11.996577', '5039', '1'), + ('0.99', '338', '2007-04-05T23:18:56.996577', '3516', '1'), + ('8.99', '220', '2007-04-12T17:20:07.996577', '6832', '2'), + ('2.99', '59', '2007-02-15T05:58:25.996577', '1269', '1'), + ('2.99', '436', '2007-04-08T12:36:18.996577', '4751', '2'), + ('6.99', '482', '2007-03-16T21:21:20.996577', '11498', '2'), + ('3.99', '242', '2007-04-27T05:39:06.996577', '7149', '2'), + ('4.99', '147', '2007-03-18T03:24:15.996577', '12284', '1'), + ('3.99', '423', '2007-02-15T20:36:32.996577', '1504', '1'), + ('0.99', '14', '2007-04-28T15:13:37.996577', '8042', '1'), + ('4.99', '170', '2007-04-10T02:19:13.996577', '5573', '1'), + ('6.99', '115', '2007-04-12T15:17:37.996577', '6798', '1'), + ('0.99', '204', '2007-03-19T08:55:51.996577', '13084', '1'), + ('5.99', '277', '2007-04-12T00:45:26.996577', '6487', '1'), + ('4.99', '454', '2007-04-08T03:36:58.996577', '4562', '2'), + ('4.99', '421', '2007-04-29T16:37:08.996577', '8725', '1'), + ('0.99', '291', '2007-04-27T20:59:43.996577', '7564', '2'), + ('3.99', '343', '2007-04-09T15:32:16.996577', '5337', '1'), + ('4.99', '35', '2007-02-18T02:18:44.996577', '2229', '1'), + ('2.99', '384', '2007-04-10T22:27:53.996577', '5966', '2'), + ('4.99', '517', '2007-03-21T02:03:47.996577', '14190', '2'), + ('4.99', '319', '2007-04-11T13:39:59.996577', '6255', '1'), + ('0.99', '120', '2007-04-07T17:15:29.996577', '4342', '2'), + ('0.99', '452', '2007-02-19T09:19:18.996577', '2661', '2'), + ('3.98', '175', '2007-05-14T13:44:29.996577', '14060', '2'), + ('6.99', '496', '2007-03-20T19:11:16.996577', '14013', '2'), + ('3.99', '481', '2007-04-30T16:43:40.996577', '10018', '1'), + ('4.99', '129', '2007-04-09T16:07:56.996577', '5350', '2'), + ('4.99', '495', '2007-04-30T17:56:00.996577', '10065', '2'), + ('4.99', '115', '2007-03-01T08:31:43.996577', '10475', '2'), + ('1.99', '546', '2007-02-14T23:10:43.996577', '1181', '1'), + ('5.99', '414', '2007-04-30T19:30:12.996577', '10107', '2'), + ('0.99', '122', '2007-04-11T22:26:00.996577', '6427', '1'), + ('2.99', '173', '2007-04-10T00:42:25.996577', '5531', '2'), + ('0.99', '231', '2007-04-07T14:14:24.996577', '4289', '2'), + ('2.99', '577', '2007-04-12T01:39:49.996577', '6500', '1'), + ('2.99', '151', '2007-04-30T15:06:38.996577', '9969', '1'), + ('2.99', '574', '2007-04-28T12:18:24.996577', '7964', '1'), + ('0.99', '319', '2007-03-17T01:31:33.996577', '11598', '2'), + ('4.99', '57', '2007-04-30T21:55:39.996577', '10169', '2'), + ('5.99', '234', '2007-02-18T22:13:56.996577', '2511', '2'), + ('0.99', '66', '2007-03-17T15:10:39.996577', '11935', '1'), + ('2.99', '182', '2007-04-09T23:59:48.996577', '5521', '1'), + ('0.99', '234', '2007-02-16T07:38:32.996577', '1645', '2'), + ('0.99', '282', '2007-04-29T17:25:27.996577', '8743', '2'), + ('4.99', '481', '2007-02-18T06:39:08.996577', '2296', '2'), + ('2.99', '139', '2007-03-02T00:02:52.996577', '10900', '1'), + ('7.99', '484', '2007-03-19T05:52:29.996577', '12993', '1'), + ('0.99', '321', '2007-04-30T15:36:57.996577', '9981', '1'), + ('3.99', '145', '2007-03-19T11:59:21.996577', '13164', '1'), + ('0.99', '41', '2007-04-28T17:02:46.996577', '8098', '1'), + ('2.99', '235', '2007-04-08T04:59:54.996577', '4592', '2'), + ('0.99', '104', '2007-03-19T06:14:08.996577', '13005', '1'), + ('0.99', '549', '2007-04-07T21:43:54.996577', '4447', '1'), + ('4.99', '67', '2007-03-22T05:14:29.996577', '14967', '2'), + ('5.99', '186', '2007-04-30T17:08:09.996577', '9360', '2'), + ('6.99', '195', '2007-04-30T10:48:20.996577', '9188', '2'), + ('0.99', '213', '2007-03-19T21:43:26.996577', '13426', '2'), + ('3.99', '132', '2007-03-01T13:35:30.996577', '10619', '2'), + ('3.99', '279', '2007-04-29T09:54:20.996577', '8559', '2'), + ('0.99', '300', '2007-03-19T17:12:19.996577', '13296', '1'), + ('0.99', '514', '2007-02-21T12:45:14.996577', '3385', '1'), + ('2.99', '158', '2007-04-30T18:33:14.996577', '9393', '1'), + ('2.99', '578', '2007-03-20T02:32:17.996577', '13552', '2'), + ('10.99', '562', '2007-03-19T18:57:14.996577', '13347', '2'), + ('2.99', '142', '2007-04-28T05:08:31.996577', '7764', '1'), + ('1.99', '377', '2007-04-28T02:12:11.996577', '7697', '1'), + ('0.99', '530', '2007-03-02T15:02:55.996577', '11326', '1'), + ('2.99', '480', '2007-04-10T04:50:50.996577', '5633', '2'), + ('2.99', '86', '2007-03-18T00:37:46.996577', '12198', '1'), + ('2.99', '549', '2007-03-18T16:26:40.996577', '12634', '2'), + ('10.99', '564', '2007-04-27T17:29:29.996577', '7470', '2'), + ('0.99', '598', '2007-04-12T04:41:19.996577', '6575', '2'), + ('0.99', '543', '2007-03-01T01:18:09.996577', '10257', '2'), + ('3.99', '449', '2007-04-07T21:14:07.996577', '4433', '2'), + ('4.99', '511', '2007-04-06T03:48:08.996577', '3600', '2'), + ('9.99', '286', '2007-04-07T22:28:09.996577', '4461', '2'), + ('4.99', '440', '2007-04-30T00:21:00.996577', '9547', '1'), + ('2.99', '302', '2007-03-19T02:38:04.996577', '12903', '1'), + ('2.99', '95', '2007-02-14T22:41:17.996577', '1174', '2'), + ('0.99', '142', '2007-03-21T23:40:03.996577', '14813', '2'), + ('2.99', '442', '2007-04-07T02:31:16.996577', '4058', '1'), + ('0.99', '143', '2007-04-29T02:46:51.996577', '8335', '1'), + ('4.99', '60', '2007-04-30T08:00:20.996577', '9761', '1'), + ('0.99', '45', '2007-02-21T19:08:05.996577', '3444', '2'), + ('0.99', '425', '2007-03-19T07:32:50.996577', '13040', '2'), + ('5.99', '356', '2007-03-23T11:12:08.996577', '15754', '2'), + ('6.99', '532', '2007-03-01T02:04:24.996577', '10286', '2'), + ('2.99', '584', '2007-04-06T10:28:44.996577', '3741', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['31932', '21985', '24791', '31859', '27844', '24186', '22904', '23894', '28992', '27613', '25365', '31214', '32039', '31389', '19653', '31543', '19123', '29333', '18152', '22573', '26593', '19404', '21907', '28195', '21430', '22342', '19892', '29142', '20724', '26940', '27426', '23455', '19375', '17936', '21480', '29257', '31505', '25091', '25146', '21420', '22726', '24662', '30211', '20430', '22937', '21448', '30327', '20231', '27616', '21548', '23840', '18267', '22788', '25842', '23334', '20895', '23525', '18258', '20342', '21426', '26002', '31912', '26143', '25966', '22677', '25534', '30744', '24364', '17963', '22568', '29253', '27258', '28693', '30626', '28930', '28897', '24414', '19646', '26133', '30462', '22831', '20175', '25954', '22039', '26805', '19779', '27225', '18801', '19743', '19740', '29648', '25616', '23711', '28014', '24899', '19803', '31258', '24523', '25410', '18238']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('2.99', '324', '2007-05-14T13:44:29.996577', '13965', '2'), + ('2.99', '528', '2007-03-01T23:02:38.996577', '10880', '1'), + ('4.99', '228', '2007-03-01T12:29:08.996577', '10585', '1'), + ('7.99', '262', '2007-04-12T03:26:12.996577', '6547', '2'), + ('2.99', '504', '2007-04-28T06:26:53.996577', '7807', '2'), + ('2.99', '156', '2007-03-20T11:13:19.996577', '13802', '2'), + ('2.99', '23', '2007-03-01T23:58:23.996577', '10898', '1'), + ('0.99', '129', '2007-03-21T07:36:16.996577', '14353', '1'), + ('4.99', '208', '2007-04-30T10:47:15.996577', '9838', '1'), + ('8.99', '484', '2007-04-30T21:50:46.996577', '10166', '2'), + ('4.99', '286', '2007-04-10T13:11:20.996577', '5796', '1'), + ('0.99', '197', '2007-04-30T21:35:06.996577', '9476', '1'), + ('0.00', '75', '2007-05-14T13:44:29.996577', '14488', '1'), + ('2.99', '220', '2007-04-28T15:44:14.996577', '8065', '1'), + ('0.99', '278', '2007-03-21T23:17:36.996577', '14803', '2'), + ('2.99', '233', '2007-04-10T15:53:50.996577', '5846', '1'), + ('4.99', '162', '2007-02-19T01:12:43.996577', '2547', '1'), + ('1.99', '31', '2007-04-26T23:51:50.996577', '7000', '1'), + ('2.99', '511', '2007-02-15T21:01:50.996577', '1508', '1'), + ('6.99', '593', '2007-03-20T01:17:09.996577', '13524', '1'), + ('2.99', '392', '2007-04-11T21:23:53.996577', '6406', '2'), + ('3.99', '240', '2007-02-18T00:15:33.996577', '2196', '2'), + ('7.99', '519', '2007-03-20T06:16:33.996577', '13647', '1'), + ('2.99', '535', '2007-04-29T04:31:56.996577', '8395', '1'), + ('0.99', '467', '2007-03-21T10:50:10.996577', '14451', '1'), + ('4.99', '566', '2007-03-19T05:54:56.996577', '12995', '2'), + ('4.99', '305', '2007-03-20T10:37:52.996577', '13782', '1'), + ('2.99', '14', '2007-04-06T08:50:15.996577', '3707', '1'), + ('9.99', '394', '2007-03-18T11:50:51.996577', '12510', '2'), + ('0.99', '424', '2007-04-06T10:39:17.996577', '3746', '2'), + ('10.99', '469', '2007-04-05T23:31:55.996577', '3526', '1'), + ('4.99', '80', '2007-03-20T08:35:54.996577', '13724', '1'), + ('2.99', '234', '2007-02-16T09:25:26.996577', '1674', '1'), + ('4.99', '453', '2007-02-20T00:08:09.996577', '2887', '2'), + ('4.99', '471', '2007-03-20T22:50:01.996577', '14094', '1'), + ('2.99', '25', '2007-04-30T19:17:39.996577', '10103', '2'), + ('2.99', '230', '2007-04-11T13:34:46.996577', '6251', '1'), + ('0.99', '260', '2007-03-20T17:31:51.996577', '13978', '2'), + ('5.99', '266', '2007-03-02T00:23:00.996577', '10910', '2'), + ('2.99', '466', '2007-03-21T14:19:16.996577', '14546', '2'), + ('2.99', '5', '2007-03-18T22:52:34.996577', '12797', '1'), + ('3.99', '212', '2007-03-18T13:28:29.996577', '12562', '2'), + ('1.99', '107', '2007-04-29T15:42:11.996577', '8704', '2'), + ('2.99', '366', '2007-03-02T15:27:35.996577', '11337', '2'), + ('8.99', '26', '2007-03-21T02:06:08.996577', '14192', '2'), + ('4.99', '469', '2007-03-01T01:19:35.996577', '10258', '1'), + ('7.99', '118', '2007-04-29T17:51:06.996577', '8760', '2'), + ('0.99', '343', '2007-03-20T13:33:55.996577', '13866', '2'), + ('0.99', '485', '2007-04-06T17:59:23.996577', '3904', '1'), + ('4.99', '479', '2007-03-01T02:41:59.996577', '10303', '2'), + ('7.99', '125', '2007-03-02T12:58:29.996577', '11279', '2'), + ('2.99', '543', '2007-02-18T16:09:10.996577', '2426', '1'), + ('2.99', '11', '2007-03-22T16:15:07.996577', '15240', '2'), + ('0.99', '326', '2007-04-30T11:28:59.996577', '9855', '2'), + ('4.99', '68', '2007-03-19T23:33:31.996577', '13475', '2'), + ('6.99', '412', '2007-03-21T13:51:03.996577', '14535', '1'), + ('0.99', '87', '2007-03-20T14:44:29.996577', '13906', '1'), + ('4.99', '540', '2007-02-15T07:21:10.996577', '1290', '2'), + ('2.99', '356', '2007-03-19T01:40:45.996577', '12876', '2'), + ('2.99', '467', '2007-03-18T02:50:57.996577', '12266', '1'), + ('4.99', '340', '2007-04-29T00:02:58.996577', '8274', '2'), + ('6.99', '267', '2007-04-09T15:40:01.996577', '5340', '1'), + ('1.99', '353', '2007-04-12T03:49:01.996577', '6559', '2'), + ('4.99', '337', '2007-04-08T17:14:16.996577', '4855', '2'), + ('9.99', '207', '2007-03-20T15:00:36.996577', '13912', '2'), + ('4.99', '299', '2007-04-27T09:47:24.996577', '7264', '1'), + ('4.99', '154', '2007-04-26T23:33:50.996577', '6993', '2'), + ('4.99', '175', '2007-03-21T13:01:11.996577', '14507', '2'), + ('3.99', '457', '2007-02-19T15:50:57.996577', '2762', '1'), + ('3.99', '593', '2007-03-01T04:42:04.996577', '10368', '1'), + ('0.99', '25', '2007-04-29T22:44:23.996577', '8878', '2'), + ('2.99', '452', '2007-04-07T20:33:31.996577', '4417', '2'), + ('7.99', '581', '2007-04-27T02:00:14.996577', '7048', '2'), + ('7.99', '144', '2007-04-12T07:02:15.996577', '6614', '2'), + ('0.99', '204', '2007-04-07T01:38:16.996577', '4043', '1'), + ('0.99', '598', '2007-04-27T13:10:37.996577', '7354', '2'), + ('2.99', '180', '2007-03-19T16:38:45.996577', '13283', '1'), + ('3.99', '278', '2007-03-01T22:19:26.996577', '10849', '2'), + ('4.99', '352', '2007-04-07T05:24:39.996577', '4116', '2'), + ('5.99', '129', '2007-04-30T21:52:57.996577', '10167', '2'), + ('0.99', '15', '2007-03-22T14:04:30.996577', '15178', '1'), + ('3.99', '339', '2007-03-01T03:31:29.996577', '10338', '2'), + ('0.99', '336', '2007-04-10T06:39:29.996577', '5667', '2'), + ('6.99', '533', '2007-03-18T17:26:10.996577', '12655', '1'), + ('5.99', '410', '2007-04-27T14:57:30.996577', '7407', '2'), + ('5.99', '293', '2007-03-23T07:47:18.996577', '15675', '2'), + ('1.99', '448', '2007-04-07T20:03:42.996577', '4406', '1'), + ('2.99', '78', '2007-02-18T00:47:47.996577', '2207', '1'), + ('0.99', '289', '2007-03-19T12:02:36.996577', '13165', '2'), + ('1.99', '289', '2007-03-17T23:02:46.996577', '12158', '1'), + ('4.99', '59', '2007-04-08T07:06:48.996577', '4631', '1'), + ('6.99', '306', '2007-04-27T08:15:38.996577', '7225', '1'), + ('7.99', '112', '2007-03-17T01:36:36.996577', '11599', '1'), + ('4.99', '520', '2007-04-28T03:10:10.996577', '7720', '1'), + ('8.99', '240', '2007-03-20T06:40:59.996577', '13663', '1'), + ('2.99', '296', '2007-03-20T07:55:46.996577', '13702', '1'), + ('0.99', '201', '2007-04-30T17:03:51.996577', '9355', '2'), + ('4.99', '192', '2007-03-17T10:41:52.996577', '11815', '1'), + ('0.99', '290', '2007-04-07T20:33:02.996577', '4416', '2'), + ('0.99', '534', '2007-02-18T16:41:58.996577', '2436', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['28974', '17679', '30707', '29670', '23759', '28093', '27372', '24059', '27406', '30979', '20309', '21290', '19231', '19708', '22306', '19262', '24679', '27602', '26928', '23446', '17991', '25116', '19710', '24287', '18389', '25511', '24695', '30893', '28546', '18489', '28900', '23286', '19411', '21348', '20145', '22849', '18090', '23013', '32033', '23179', '23232', '26685', '20064', '22471', '29828', '24074', '31559', '29381', '31148', '22999', '27919', '22835', '29656', '22759', '24344', '30229', '23012', '22128', '30296', '27959', '27164', '31161', '21168', '19698', '20918', '27866', '31220', '18321', '28527', '27772', '30061', '23404', '24837', '19098', '25996', '29579', '19441', '31514', '24633', '18653', '25725', '28430', '25680', '21407', '23313', '25783', '30003', '30909', '21241', '19866', '27256', '18465', '25613', '22779', '30806', '26825', '30529', '23239', '30459', '21413']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('5.99', '207', '2007-04-11T23:45:37.996577', '6465', '2'), + ('3.99', '384', '2007-02-20T03:35:50.996577', '2935', '2'), + ('2.99', '150', '2007-04-12T08:04:08.996577', '6633', '1'), + ('6.99', '61', '2007-04-30T01:57:33.996577', '9597', '2'), + ('2.99', '117', '2007-03-01T11:27:08.996577', '10556', '2'), + ('2.99', '526', '2007-04-29T06:01:31.996577', '8441', '1'), + ('2.99', '463', '2007-04-09T01:01:00.996577', '5026', '1'), + ('7.99', '145', '2007-03-19T06:23:25.996577', '13012', '2'), + ('7.99', '467', '2007-04-28T13:54:46.996577', '8010', '1'), + ('2.99', '174', '2007-04-30T11:02:09.996577', '9847', '1'), + ('6.99', '352', '2007-03-17T11:05:03.996577', '11823', '1'), + ('4.99', '453', '2007-03-23T05:54:04.996577', '15627', '2'), + ('1.99', '189', '2007-02-20T01:24:42.996577', '2905', '2'), + ('9.99', '285', '2007-03-18T18:26:05.996577', '12687', '2'), + ('9.99', '563', '2007-03-20T13:26:16.996577', '13863', '2'), + ('4.99', '196', '2007-02-20T15:35:12.996577', '3104', '1'), + ('2.99', '214', '2007-03-19T21:04:52.996577', '13409', '1'), + ('0.99', '484', '2007-04-10T16:11:56.996577', '5852', '1'), + ('0.99', '423', '2007-04-07T12:36:37.996577', '4250', '1'), + ('0.99', '80', '2007-03-01T02:57:55.996577', '10313', '1'), + ('0.99', '465', '2007-02-18T23:16:37.996577', '2524', '2'), + ('3.99', '262', '2007-03-23T16:26:01.996577', '15918', '1'), + ('0.99', '285', '2007-03-22T16:32:23.996577', '15251', '2'), + ('4.99', '167', '2007-03-23T02:19:14.996577', '15530', '2'), + ('3.99', '577', '2007-02-18T14:34:40.996577', '2399', '2'), + ('2.99', '297', '2007-04-26T23:24:56.996577', '6984', '1'), + ('0.99', '215', '2007-03-23T14:05:57.996577', '15843', '1'), + ('2.99', '167', '2007-04-29T02:12:56.996577', '8318', '1'), + ('0.99', '570', '2007-04-12T03:38:42.996577', '6556', '1'), + ('3.99', '207', '2007-02-17T06:19:52.996577', '1945', '2'), + ('5.99', '598', '2007-04-29T08:11:08.996577', '8511', '1'), + ('4.99', '63', '2007-03-17T14:06:00.996577', '11902', '1'), + ('0.99', '241', '2007-02-21T02:22:24.996577', '3258', '2'), + ('2.99', '459', '2007-03-22T19:25:07.996577', '15342', '2'), + ('2.99', '336', '2007-03-17T07:17:31.996577', '11743', '2'), + ('4.99', '18', '2007-03-01T16:01:19.996577', '10682', '1'), + ('4.99', '493', '2007-02-18T12:14:00.996577', '2365', '1'), + ('4.99', '34', '2007-03-17T05:44:13.996577', '11701', '2'), + ('9.98', '60', '2007-05-14T13:44:29.996577', '12489', '2'), + ('0.99', '52', '2007-03-01T14:06:24.996577', '10635', '1'), + ('5.99', '57', '2007-03-19T03:27:27.996577', '12925', '2'), + ('4.99', '401', '2007-04-28T00:16:58.996577', '7651', '2'), + ('0.99', '327', '2007-03-17T18:01:50.996577', '12016', '1'), + ('0.99', '581', '2007-03-20T05:12:10.996577', '13621', '2'), + ('0.99', '75', '2007-04-28T07:38:48.996577', '7843', '1'), + ('4.99', '146', '2007-03-20T12:18:43.996577', '13829', '2'), + ('4.99', '235', '2007-04-10T12:43:47.996577', '5790', '1'), + ('4.99', '35', '2007-04-27T05:22:38.996577', '7140', '1'), + ('4.99', '190', '2007-04-27T06:31:48.996577', '7175', '1'), + ('5.99', '32', '2007-03-21T15:00:58.996577', '14570', '2'), + ('0.99', '511', '2007-04-11T01:42:52.996577', '6040', '2'), + ('0.99', '16', '2007-03-02T14:19:10.996577', '11308', '2'), + ('6.99', '59', '2007-04-30T01:14:04.996577', '9573', '2'), + ('2.99', '8', '2007-03-02T13:11:11.996577', '11284', '2'), + ('4.99', '173', '2007-03-18T11:41:39.996577', '12501', '2'), + ('2.99', '109', '2007-04-09T13:54:53.996577', '5296', '2'), + ('2.99', '34', '2007-03-16T21:47:13.996577', '11505', '1'), + ('2.99', '543', '2007-03-17T04:41:56.996577', '11681', '1'), + ('5.99', '115', '2007-04-12T04:32:48.996577', '6574', '1'), + ('3.99', '516', '2007-04-10T12:14:49.996577', '5780', '2'), + ('2.99', '442', '2007-04-30T17:13:56.996577', '10034', '1'), + ('2.99', '192', '2007-04-06T17:53:44.996577', '3902', '1'), + ('0.99', '442', '2007-03-01T07:40:02.996577', '10452', '2'), + ('4.99', '284', '2007-03-21T17:46:27.996577', '14648', '1'), + ('6.99', '414', '2007-03-22T12:07:46.996577', '15140', '1'), + ('2.99', '507', '2007-04-06T17:01:15.996577', '3880', '1'), + ('4.99', '198', '2007-04-12T04:11:35.996577', '6567', '2'), + ('1.99', '560', '2007-02-16T01:51:48.996577', '1572', '2'), + ('0.99', '568', '2007-04-10T04:08:03.996577', '5622', '1'), + ('1.99', '498', '2007-04-11T04:09:01.996577', '6088', '1'), + ('4.99', '96', '2007-04-08T22:04:19.996577', '4961', '1'), + ('0.99', '75', '2007-03-02T15:13:59.996577', '11330', '1'), + ('6.99', '234', '2007-03-01T12:19:40.996577', '10580', '2'), + ('4.99', '154', '2007-02-20T00:07:05.996577', '2886', '1'), + ('5.99', '339', '2007-04-30T11:22:29.996577', '9208', '2'), + ('1.99', '52', '2007-04-06T22:15:18.996577', '3997', '1'), + ('6.99', '251', '2007-02-18T02:50:32.996577', '2238', '1'), + ('9.99', '231', '2007-04-06T01:22:59.996577', '3561', '2'), + ('9.99', '209', '2007-03-23T01:19:53.996577', '15510', '2'), + ('1.99', '37', '2007-02-16T19:37:12.996577', '1812', '2'), + ('2.99', '316', '2007-04-27T12:46:14.996577', '7339', '2'), + ('4.99', '560', '2007-04-06T19:49:03.996577', '3941', '1'), + ('2.99', '312', '2007-04-12T13:19:00.996577', '6751', '2'), + ('6.99', '465', '2007-03-17T03:24:42.996577', '11648', '2'), + ('2.99', '66', '2007-03-02T16:14:30.996577', '11360', '2'), + ('0.99', '322', '2007-04-05T21:34:10.996577', '3478', '1'), + ('0.99', '91', '2007-04-06T13:34:35.996577', '3802', '2'), + ('1.99', '168', '2007-04-29T22:53:14.996577', '8883', '2'), + ('2.99', '449', '2007-03-01T06:17:41.996577', '10409', '2'), + ('5.99', '302', '2007-03-23T05:50:28.996577', '15622', '1'), + ('0.99', '452', '2007-04-07T17:30:31.996577', '4348', '1'), + ('6.99', '599', '2007-02-20T11:07:01.996577', '3043', '2'), + ('2.99', '306', '2007-04-10T02:34:32.996577', '5581', '2'), + ('2.99', '10', '2007-03-20T15:11:54.996577', '13917', '2'), + ('3.99', '159', '2007-04-30T04:03:11.996577', '9022', '2'), + ('8.99', '412', '2007-04-29T02:37:33.996577', '8330', '2'), + ('4.99', '135', '2007-04-30T18:51:39.996577', '10091', '2'), + ('0.99', '58', '2007-03-01T15:28:53.996577', '10668', '1'), + ('4.99', '129', '2007-04-30T10:17:26.996577', '9823', '2'), + ('4.99', '466', '2007-03-01T08:19:37.996577', '10469', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['29107', '18667', '22248', '29726', '20106', '24720', '27717', '29817', '30581', '17976', '24303', '26336', '28385', '18527', '29453', '25982', '22370', '28972', '31721', '27012', '20780', '25239', '30981', '18760', '21806', '29835', '29451', '18749', '28100', '26842', '18877', '24343', '22908', '17854', '31513', '18933', '25295', '20381', '27920', '21488', '25128', '29369', '28197', '25774', '30702', '28536', '25180', '28301', '28832', '27450', '23109', '30001', '26766', '20937', '28999', '18985', '28085', '23573', '20181', '22052', '18247', '22865', '29503', '29691', '24354', '27337', '21345', '23329', '24934', '30069', '25447', '30978', '17988', '25185', '17669', '26432', '23048', '18463', '31042', '18218', '31840', '24995', '29700', '23042', '30483', '20899', '29575', '23509', '20316', '21864', '19444', '24022', '30903', '18534', '30398', '24907', '22770', '31196', '31463', '29830']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('5.99', '11', '2007-04-10T15:13:24.996577', '5835', '2'), + ('2.99', '40', '2007-02-20T01:02:08.996577', '2896', '2'), + ('2.99', '557', '2007-03-18T22:44:45.996577', '12789', '1'), + ('8.99', '66', '2007-04-11T15:41:08.996577', '6290', '1'), + ('2.99', '331', '2007-03-22T19:20:38.996577', '15339', '1'), + ('0.99', '218', '2007-03-23T03:58:45.996577', '15575', '2'), + ('3.99', '494', '2007-04-07T03:54:32.996577', '4086', '1'), + ('2.99', '75', '2007-04-07T08:45:41.996577', '4179', '2'), + ('2.99', '139', '2007-04-30T19:16:57.996577', '9415', '2'), + ('0.99', '460', '2007-02-15T14:40:53.996577', '1392', '2'), + ('5.99', '169', '2007-03-17T13:52:38.996577', '11898', '1'), + ('6.99', '368', '2007-04-30T10:33:27.996577', '9833', '1'), + ('7.99', '555', '2007-04-30T18:29:00.996577', '10076', '2'), + ('2.99', '8', '2007-02-15T08:27:42.996577', '1305', '2'), + ('4.99', '41', '2007-04-26T23:08:27.996577', '6976', '1'), + ('3.99', '338', '2007-04-27T21:44:12.996577', '7584', '2'), + ('9.99', '569', '2007-03-20T02:37:05.996577', '13554', '2'), + ('4.99', '207', '2007-04-09T12:31:16.996577', '5259', '1'), + ('0.99', '248', '2007-04-08T16:46:49.996577', '4841', '1'), + ('7.99', '429', '2007-04-28T20:06:42.996577', '8175', '2'), + ('4.99', '401', '2007-03-18T10:42:47.996577', '12475', '1'), + ('4.99', '275', '2007-04-27T22:02:23.996577', '7596', '2'), + ('5.99', '175', '2007-04-07T08:05:34.996577', '4167', '2'), + ('4.99', '66', '2007-02-19T03:04:29.996577', '2577', '1'), + ('2.99', '508', '2007-03-02T16:28:35.996577', '11365', '1'), + ('9.99', '75', '2007-04-30T08:44:12.996577', '9783', '1'), + ('4.99', '41', '2007-04-08T02:35:21.996577', '4543', '1'), + ('0.99', '62', '2007-02-21T05:01:05.996577', '3287', '1'), + ('4.99', '527', '2007-04-11T00:23:14.996577', '6011', '2'), + ('2.99', '414', '2007-04-30T04:15:58.996577', '9650', '1'), + ('0.99', '96', '2007-02-18T13:06:03.996577', '2372', '1'), + ('6.99', '173', '2007-03-18T03:22:46.996577', '12282', '1'), + ('6.99', '23', '2007-03-19T21:54:03.996577', '13429', '2'), + ('5.99', '432', '2007-02-14T23:07:27.996577', '1180', '2'), + ('9.99', '230', '2007-04-30T17:48:44.996577', '10057', '1'), + ('2.99', '111', '2007-02-20T14:22:25.996577', '3087', '2'), + ('6.99', '281', '2007-04-08T17:34:00.996577', '4864', '2'), + ('2.99', '360', '2007-03-22T18:25:07.996577', '15310', '1'), + ('0.99', '511', '2007-04-11T17:19:21.996577', '6320', '1'), + ('6.99', '472', '2007-03-17T14:20:01.996577', '11911', '1'), + ('2.99', '264', '2007-03-01T20:12:50.996577', '10792', '2'), + ('3.99', '34', '2007-04-30T09:45:59.996577', '9160', '1'), + ('0.99', '535', '2007-04-30T20:08:41.996577', '9440', '2'), + ('4.99', '321', '2007-04-06T18:55:06.996577', '3920', '1'), + ('5.99', '149', '2007-04-26T21:47:01.996577', '6940', '2'), + ('2.99', '569', '2007-04-29T23:58:14.996577', '8910', '1'), + ('2.99', '269', '2007-04-11T22:53:30.996577', '6440', '1'), + ('2.99', '546', '2007-04-12T15:00:59.996577', '6786', '1'), + ('4.99', '593', '2007-04-08T14:35:21.996577', '4781', '2'), + ('2.99', '470', '2007-04-11T10:40:43.996577', '6198', '1'), + ('2.99', '45', '2007-03-01T09:50:46.996577', '10507', '1'), + ('2.99', '90', '2007-04-30T16:30:51.996577', '9337', '2'), + ('9.99', '407', '2007-04-28T21:32:36.996577', '8197', '1'), + ('4.99', '416', '2007-03-21T03:47:23.996577', '14239', '1'), + ('4.99', '1', '2007-04-28T07:33:11.996577', '7841', '1'), + ('2.99', '123', '2007-02-19T04:12:09.996577', '2594', '1'), + ('3.99', '526', '2007-04-12T10:17:14.996577', '6671', '1'), + ('5.99', '93', '2007-03-02T12:46:48.996577', '11271', '2'), + ('3.99', '339', '2007-03-19T13:21:48.996577', '13199', '1'), + ('5.99', '535', '2007-03-01T03:12:39.996577', '10322', '2'), + ('2.99', '537', '2007-02-17T23:39:02.996577', '2184', '2'), + ('7.99', '20', '2007-03-01T13:28:16.996577', '10616', '1'), + ('6.99', '45', '2007-04-09T08:35:53.996577', '5181', '1'), + ('4.99', '64', '2007-04-07T14:06:51.996577', '4288', '1'), + ('0.99', '174', '2007-03-19T12:50:56.996577', '13185', '1'), + ('4.99', '460', '2007-04-06T14:03:52.996577', '3820', '2'), + ('4.99', '459', '2007-03-20T16:57:12.996577', '13967', '1'), + ('2.99', '67', '2007-03-20T12:47:29.996577', '13837', '2'), + ('2.99', '243', '2007-03-21T19:31:21.996577', '14705', '2'), + ('3.99', '96', '2007-04-30T04:38:19.996577', '9662', '1'), + ('4.99', '292', '2007-04-29T21:32:06.996577', '8842', '2'), + ('4.99', '174', '2007-04-30T15:02:55.996577', '9301', '1'), + ('2.99', '465', '2007-02-15T10:41:08.996577', '1337', '1'), + ('2.99', '269', '2007-04-28T12:36:12.996577', '7972', '1'), + ('7.99', '383', '2007-02-16T20:50:43.996577', '1831', '1'), + ('2.99', '377', '2007-04-06T15:46:23.996577', '3858', '1'), + ('2.99', '37', '2007-03-21T13:43:29.996577', '14532', '2'), + ('2.99', '598', '2007-02-20T08:38:55.996577', '3005', '1'), + ('7.99', '180', '2007-04-08T16:12:51.996577', '4826', '2'), + ('2.99', '527', '2007-02-19T00:27:05.996577', '2539', '1'), + ('1.99', '260', '2007-04-27T09:51:35.996577', '7268', '1'), + ('0.99', '251', '2007-03-21T05:34:46.996577', '14292', '1'), + ('1.99', '64', '2007-04-12T11:13:26.996577', '6698', '2'), + ('7.99', '37', '2007-03-19T07:49:36.996577', '13046', '1'), + ('0.99', '132', '2007-04-06T08:46:27.996577', '3706', '1'), + ('2.99', '413', '2007-03-02T00:22:25.996577', '10909', '1'), + ('4.99', '51', '2007-04-29T07:33:32.996577', '8495', '1'), + ('6.99', '86', '2007-03-01T12:27:13.996577', '10584', '2'), + ('4.99', '353', '2007-03-02T18:11:33.996577', '11414', '2'), + ('0.99', '514', '2007-03-20T20:40:12.996577', '14052', '1'), + ('5.99', '252', '2007-02-15T14:49:30.996577', '1395', '1'), + ('5.99', '142', '2007-03-02T01:20:44.996577', '10934', '2'), + ('5.99', '168', '2007-04-11T17:49:10.996577', '6334', '1'), + ('3.99', '10', '2007-02-18T01:54:49.996577', '2222', '2'), + ('0.99', '125', '2007-04-11T02:27:34.996577', '6055', '1'), + ('2.99', '241', '2007-03-19T08:43:45.996577', '13077', '2'), + ('2.99', '9', '2007-03-18T04:27:06.996577', '12309', '1'), + ('3.99', '196', '2007-04-09T16:32:55.996577', '5353', '2'), + ('3.99', '227', '2007-04-09T02:03:23.996577', '5046', '1'), + ('1.99', '75', '2007-04-28T21:40:11.996577', '8202', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['19213', '30803', '22000', '19300', '21442', '24122', '19742', '26072', '20725', '26808', '29068', '31524', '23543', '19569', '31970', '23061', '31184', '20196', '24718', '28796', '26495', '28374', '31903', '19949', '30911', '20700', '18541', '31837', '29943', '27825', '19407', '24616', '29164', '23483', '20427', '30704', '30756', '30965', '31746', '18334', '19011', '22190', '20690', '21884', '24657', '24151', '28080', '21444', '24476', '19619', '18246', '22818', '25688', '19509', '26099', '29414', '24174', '27276', '17808', '19027', '22325', '26909', '22444', '17576', '27871', '20339', '22181', '30700', '25720', '25282', '25881', '21813', '23280', '25453', '26701', '23559', '22871', '28448', '26042', '27266', '27754', '31726', '32043', '29982', '21535', '19440', '25970', '17899', '19774', '29041', '30360', '26297', '29158', '20770', '28142', '29188', '28364', '26441', '25246', '31997']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('2.99', '186', '2007-02-15T08:04:45.996577', '1300', '1'), + ('4.99', '159', '2007-04-12T19:24:30.996577', '6885', '2'), + ('0.99', '529', '2007-03-21T22:06:13.996577', '14764', '2'), + ('9.99', '212', '2007-02-19T14:27:04.996577', '2739', '2'), + ('2.99', '468', '2007-03-21T06:18:19.996577', '14313', '1'), + ('2.99', '150', '2007-03-18T16:05:37.996577', '12627', '2'), + ('7.99', '289', '2007-03-18T13:21:01.996577', '12558', '2'), + ('2.99', '347', '2007-04-10T14:24:46.996577', '5819', '1'), + ('0.99', '394', '2007-03-19T07:53:15.996577', '13047', '2'), + ('0.99', '410', '2007-04-29T22:52:31.996577', '8882', '1'), + ('1.99', '7', '2007-04-11T09:04:54.996577', '6174', '1'), + ('2.99', '231', '2007-04-30T06:35:07.996577', '9711', '2'), + ('4.99', '90', '2007-03-01T17:35:34.996577', '10722', '1'), + ('2.99', '272', '2007-03-02T03:31:31.996577', '11003', '2'), + ('0.00', '457', '2007-05-14T13:44:29.996577', '14516', '2'), + ('2.99', '38', '2007-03-23T07:30:30.996577', '15668', '1'), + ('4.99', '195', '2007-04-09T10:54:27.996577', '5228', '1'), + ('0.99', '340', '2007-03-21T20:07:51.996577', '14718', '2'), + ('5.99', '218', '2007-03-20T16:14:32.996577', '13947', '2'), + ('0.99', '590', '2007-04-30T08:12:41.996577', '9126', '2'), + ('0.99', '382', '2007-04-30T00:39:42.996577', '9555', '2'), + ('4.99', '553', '2007-04-30T13:33:48.996577', '9272', '2'), + ('2.99', '265', '2007-04-29T07:26:29.996577', '8489', '2'), + ('2.99', '312', '2007-03-01T22:37:05.996577', '10858', '2'), + ('4.99', '168', '2007-04-30T19:29:18.996577', '9418', '1'), + ('6.99', '392', '2007-03-17T21:13:52.996577', '12102', '2'), + ('5.99', '12', '2007-02-18T16:40:17.996577', '2434', '2'), + ('2.99', '260', '2007-04-08T17:43:11.996577', '4870', '1'), + ('8.99', '86', '2007-04-10T10:56:04.996577', '5752', '1'), + ('0.99', '502', '2007-04-30T12:11:26.996577', '9232', '2'), + ('0.99', '241', '2007-02-18T16:16:00.996577', '2428', '2'), + ('2.99', '201', '2007-03-20T06:55:53.996577', '13672', '2'), + ('0.99', '16', '2007-04-06T00:52:05.996577', '3548', '1'), + ('4.99', '83', '2007-03-18T02:39:39.996577', '12258', '1'), + ('2.99', '365', '2007-03-20T05:07:52.996577', '13619', '1'), + ('6.99', '149', '2007-04-28T13:07:31.996577', '7989', '1'), + ('2.99', '155', '2007-04-27T18:22:44.996577', '7492', '1'), + ('3.99', '173', '2007-04-10T03:47:17.996577', '5615', '1'), + ('8.99', '251', '2007-04-27T12:42:00.996577', '7338', '2'), + ('4.99', '562', '2007-02-21T01:24:50.996577', '3242', '2'), + ('0.99', '132', '2007-02-16T22:22:08.996577', '1843', '1'), + ('4.99', '550', '2007-03-21T19:00:42.996577', '14687', '1'), + ('4.99', '391', '2007-03-02T08:21:10.996577', '11151', '1'), + ('0.99', '516', '2007-03-22T04:09:05.996577', '14932', '1'), + ('5.99', '211', '2007-03-23T07:35:37.996577', '15670', '2'), + ('0.99', '152', '2007-03-20T17:41:49.996577', '13986', '1'), + ('2.99', '526', '2007-04-09T02:42:11.996577', '5056', '2'), + ('4.99', '468', '2007-03-22T22:56:45.996577', '15435', '2'), + ('0.99', '186', '2007-03-22T06:29:15.996577', '15001', '2'), + ('3.99', '275', '2007-03-23T00:58:49.996577', '15496', '2'), + ('2.99', '537', '2007-02-15T17:38:33.996577', '1445', '1'), + ('2.99', '15', '2007-03-02T15:37:50.996577', '11341', '2'), + ('5.99', '313', '2007-04-09T12:19:34.996577', '5255', '1'), + ('4.99', '267', '2007-02-15T04:44:02.996577', '1257', '2'), + ('2.99', '348', '2007-04-30T21:57:42.996577', '9482', '2'), + ('4.99', '38', '2007-04-27T05:52:24.996577', '7158', '2'), + ('4.99', '155', '2007-03-02T04:22:43.996577', '11033', '1'), + ('7.99', '454', '2007-04-06T04:33:30.996577', '3622', '1'), + ('4.99', '421', '2007-02-20T20:31:20.996577', '3170', '1'), + ('2.99', '135', '2007-02-20T03:50:44.996577', '2941', '2'), + ('6.99', '565', '2007-03-02T09:45:49.996577', '11189', '2'), + ('8.99', '421', '2007-04-06T21:59:08.996577', '3988', '1'), + ('7.99', '578', '2007-03-01T19:40:20.996577', '10779', '1'), + ('1.99', '359', '2007-02-16T16:36:21.996577', '1770', '2'), + ('0.99', '507', '2007-04-10T22:13:48.996577', '5962', '1'), + ('3.99', '356', '2007-03-16T23:08:20.996577', '11535', '1'), + ('2.99', '550', '2007-03-02T12:02:22.996577', '11246', '1'), + ('10.99', '149', '2007-04-09T14:04:43.996577', '5298', '1'), + ('2.99', '316', '2007-04-07T19:00:56.996577', '4379', '1'), + ('2.99', '279', '2007-04-30T22:10:59.996577', '10177', '2'), + ('4.99', '331', '2007-04-05T22:47:58.996577', '3505', '1'), + ('6.99', '509', '2007-03-17T10:37:46.996577', '11814', '1'), + ('1.99', '62', '2007-03-21T15:19:00.996577', '14574', '2'), + ('4.99', '293', '2007-04-08T02:34:56.996577', '4542', '2'), + ('6.99', '402', '2007-04-30T04:29:07.996577', '9657', '1'), + ('0.99', '91', '2007-03-21T00:12:24.996577', '14132', '1'), + ('2.99', '20', '2007-03-19T17:54:08.996577', '13317', '2'), + ('0.99', '561', '2007-04-28T02:12:40.996577', '7698', '1'), + ('2.99', '345', '2007-04-07T20:51:10.996577', '4425', '1'), + ('0.99', '453', '2007-04-06T19:21:05.996577', '3929', '2'), + ('0.99', '497', '2007-04-08T04:28:43.996577', '4578', '1'), + ('4.99', '249', '2007-04-09T00:13:06.996577', '5011', '1'), + ('4.99', '87', '2007-05-14T13:44:29.996577', '12719', '2'), + ('4.99', '89', '2007-04-28T13:28:35.996577', '7995', '2'), + ('4.99', '477', '2007-03-01T09:29:27.996577', '10500', '1'), + ('4.99', '250', '2007-02-18T16:27:44.996577', '2432', '1'), + ('2.99', '337', '2007-04-12T07:19:29.996577', '6620', '1'), + ('2.99', '446', '2007-02-20T12:15:46.996577', '3060', '1'), + ('4.99', '293', '2007-03-20T11:43:56.996577', '13817', '1'), + ('1.99', '5', '2007-04-09T07:20:08.996577', '5156', '2'), + ('2.99', '121', '2007-04-29T22:43:35.996577', '8875', '2'), + ('5.99', '366', '2007-04-08T03:59:17.996577', '4569', '1'), + ('4.99', '15', '2007-04-27T03:44:03.996577', '7105', '1'), + ('0.99', '400', '2007-03-01T17:13:35.996577', '10711', '1'), + ('0.99', '531', '2007-04-10T16:04:53.996577', '5850', '2'), + ('2.99', '18', '2007-04-28T17:56:03.996577', '8122', '2'), + ('4.99', '553', '2007-04-06T17:26:51.996577', '3891', '2'), + ('0.99', '377', '2007-04-30T01:00:03.996577', '9564', '1'), + ('5.99', '276', '2007-04-27T10:28:45.996577', '7282', '2'), + ('0.99', '561', '2007-05-14T13:44:29.996577', '14415', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['23083', '18901', '30951', '25623', '25596', '26976', '25270', '26663', '22741', '21837', '25999', '23491', '23311', '20029', '22560', '29601', '21578', '24345', '23834', '26434', '30622', '19678', '29289', '22924', '24982', '28625', '29361', '28895', '24820', '25426', '30839', '30871', '20845', '22516', '24467', '18005', '22565', '20391', '31353', '25440', '27899', '24543', '28526', '21767', '19367', '25779', '27206', '27719', '30226', '25504', '29450', '25776', '26447', '25736', '19573', '26910', '20153', '18392', '22294', '28178', '29993', '20069', '25621', '29842', '26195', '28494', '31342', '21467', '27333', '30862', '31839', '28866', '27227', '26502', '21217', '25430', '28707', '28342', '22542', '19308', '23975', '20060', '23060', '24144', '25692', '26967', '22093', '24039', '21613', '25254', '20311', '25209', '19772', '18557', '29151', '28472', '21638', '29031', '20469', '23790']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('5.99', '41', '2007-03-01T22:29:20.996577', '10853', '1'), + ('0.99', '103', '2007-02-19T13:26:20.996577', '2724', '1'), + ('6.99', '172', '2007-04-27T04:31:44.996577', '7122', '1'), + ('0.99', '306', '2007-04-30T08:26:17.996577', '9774', '1'), + ('4.99', '304', '2007-04-27T20:27:41.996577', '7551', '2'), + ('3.99', '426', '2007-04-10T09:49:47.996577', '5725', '1'), + ('0.99', '278', '2007-04-28T07:15:09.996577', '7834', '2'), + ('4.99', '399', '2007-04-08T22:57:55.996577', '4981', '2'), + ('7.99', '6', '2007-03-21T06:51:22.996577', '14329', '1'), + ('2.99', '512', '2007-03-22T01:51:46.996577', '14870', '1'), + ('0.99', '340', '2007-04-08T12:03:49.996577', '4742', '1'), + ('3.99', '84', '2007-03-02T18:26:08.996577', '11424', '2'), + ('0.99', '66', '2007-03-01T06:41:48.996577', '10419', '1'), + ('0.99', '323', '2007-03-01T02:34:29.996577', '10298', '1'), + ('0.99', '592', '2007-03-01T05:05:42.996577', '10383', '2'), + ('2.99', '54', '2007-04-10T23:34:47.996577', '5992', '1'), + ('4.99', '482', '2007-03-19T12:21:16.996577', '13174', '1'), + ('2.99', '173', '2007-03-21T18:05:25.996577', '14654', '1'), + ('4.99', '124', '2007-03-19T00:16:11.996577', '12835', '1'), + ('0.99', '377', '2007-04-07T03:22:06.996577', '4077', '1'), + ('0.99', '144', '2007-04-09T02:22:38.996577', '5049', '2'), + ('2.99', '280', '2007-03-22T08:04:26.996577', '15036', '2'), + ('0.99', '28', '2007-04-12T00:06:14.996577', '6476', '2'), + ('0.99', '25', '2007-03-17T03:16:31.996577', '11642', '1'), + ('0.99', '250', '2007-03-18T06:15:57.996577', '12361', '1'), + ('5.99', '576', '2007-04-30T00:22:45.996577', '9548', '2'), + ('3.99', '34', '2007-04-05T22:52:51.996577', '3508', '2'), + ('3.99', '598', '2007-04-12T09:48:38.996577', '6660', '2'), + ('4.99', '231', '2007-03-21T12:01:54.996577', '14478', '1'), + ('4.99', '291', '2007-04-12T02:20:20.996577', '6516', '2'), + ('10.99', '163', '2007-04-10T02:23:04.996577', '5574', '1'), + ('6.99', '166', '2007-04-07T19:27:24.996577', '4389', '2'), + ('6.99', '407', '2007-03-20T13:17:58.996577', '13856', '2'), + ('1.99', '586', '2007-03-21T08:47:51.996577', '14392', '1'), + ('5.99', '186', '2007-03-18T05:50:13.996577', '12348', '1'), + ('4.99', '468', '2007-02-18T18:28:41.996577', '2462', '2'), + ('1.99', '592', '2007-03-19T05:21:24.996577', '12976', '1'), + ('0.99', '361', '2007-03-20T19:52:50.996577', '14031', '2'), + ('2.99', '217', '2007-04-27T03:43:51.996577', '7104', '2'), + ('8.99', '292', '2007-04-11T14:27:36.996577', '6270', '1'), + ('6.99', '509', '2007-04-28T07:52:57.996577', '7848', '1'), + ('7.99', '194', '2007-03-20T04:58:59.996577', '13616', '2'), + ('2.99', '568', '2007-04-09T15:27:49.996577', '5332', '2'), + ('0.99', '503', '2007-03-23T12:42:13.996577', '15797', '1'), + ('0.99', '232', '2007-02-16T05:42:39.996577', '1619', '2'), + ('2.99', '321', '2007-04-11T10:04:44.996577', '6190', '2'), + ('0.99', '446', '2007-04-29T15:09:49.996577', '8691', '2'), + ('7.99', '494', '2007-04-08T03:04:47.996577', '4551', '2'), + ('4.99', '108', '2007-04-30T07:53:21.996577', '9755', '2'), + ('0.99', '297', '2007-04-06T02:39:01.996577', '3582', '1'), + ('9.99', '41', '2007-04-07T14:24:49.996577', '4294', '2'), + ('5.99', '321', '2007-04-07T16:16:16.996577', '4318', '1'), + ('1.99', '378', '2007-04-11T12:39:13.996577', '6233', '2'), + ('7.99', '317', '2007-04-10T21:15:43.996577', '5942', '2'), + ('2.99', '272', '2007-03-19T16:18:29.996577', '13274', '2'), + ('5.99', '421', '2007-04-07T22:13:47.996577', '4456', '2'), + ('2.99', '336', '2007-03-23T14:09:38.996577', '15848', '2'), + ('6.99', '578', '2007-02-16T20:22:18.996577', '1826', '2'), + ('4.99', '562', '2007-03-17T17:44:44.996577', '12008', '2'), + ('1.99', '533', '2007-04-29T14:27:32.996577', '8676', '1'), + ('3.99', '90', '2007-04-10T01:11:24.996577', '5539', '2'), + ('3.99', '327', '2007-03-22T20:10:43.996577', '15365', '2'), + ('4.99', '306', '2007-04-30T12:32:24.996577', '9242', '2'), + ('0.99', '76', '2007-04-30T01:07:11.996577', '8935', '1'), + ('2.99', '357', '2007-04-11T21:21:38.996577', '6405', '2'), + ('2.99', '565', '2007-04-30T03:19:37.996577', '9628', '1'), + ('0.99', '215', '2007-04-30T23:11:52.996577', '9518', '1'), + ('0.99', '470', '2007-03-17T07:17:09.996577', '11742', '1'), + ('6.99', '459', '2007-04-30T08:37:50.996577', '9137', '1'), + ('4.99', '165', '2007-04-10T06:02:34.996577', '5658', '2'), + ('0.99', '260', '2007-04-27T02:30:59.996577', '7072', '2'), + ('2.99', '595', '2007-04-30T09:19:53.996577', '9152', '1'), + ('2.99', '448', '2007-04-08T03:23:52.996577', '4558', '2'), + ('0.99', '383', '2007-04-29T12:51:14.996577', '8635', '1'), + ('1.99', '446', '2007-03-23T13:07:03.996577', '15808', '1'), + ('0.99', '291', '2007-04-29T15:07:54.996577', '8690', '1'), + ('2.99', '583', '2007-04-06T12:15:02.996577', '3779', '1'), + ('4.99', '550', '2007-04-30T20:31:46.996577', '10140', '2'), + ('6.99', '589', '2007-03-21T04:19:54.996577', '14254', '1'), + ('2.99', '213', '2007-02-21T01:53:52.996577', '3252', '1'), + ('5.99', '138', '2007-03-01T07:10:20.996577', '10431', '1'), + ('2.99', '326', '2007-03-19T00:06:44.996577', '12829', '2'), + ('6.99', '38', '2007-03-21T22:54:25.996577', '14787', '1'), + ('6.99', '152', '2007-03-17T03:07:35.996577', '11638', '2'), + ('3.99', '313', '2007-04-30T02:30:31.996577', '8970', '1'), + ('4.99', '425', '2007-04-27T09:08:19.996577', '7249', '1'), + ('2.99', '539', '2007-03-20T04:57:19.996577', '13615', '2'), + ('4.99', '144', '2007-03-01T12:41:45.996577', '10593', '1'), + ('4.99', '486', '2007-03-21T04:10:46.996577', '14251', '2'), + ('2.99', '277', '2007-04-06T17:40:09.996577', '3897', '2'), + ('5.99', '352', '2007-03-18T01:45:59.996577', '12234', '2'), + ('5.99', '273', '2007-04-08T20:58:25.996577', '4937', '1'), + ('2.99', '293', '2007-03-19T06:56:30.996577', '13029', '1'), + ('0.99', '16', '2007-02-21T09:45:08.996577', '3348', '2'), + ('4.99', '14', '2007-04-29T21:14:34.996577', '8836', '2'), + ('1.99', '563', '2007-04-28T23:39:44.996577', '8262', '1'), + ('6.99', '489', '2007-03-18T18:55:13.996577', '12701', '2'), + ('4.99', '3', '2007-04-30T10:01:24.996577', '9816', '2'), + ('5.99', '369', '2007-03-21T18:56:52.996577', '14684', '2'), + ('6.99', '119', '2007-03-22T13:52:25.996577', '15171', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['21946', '27894', '26279', '21991', '24967', '20456', '27417', '31450', '21419', '24725', '18033', '20347', '24045', '25642', '22921', '18062', '27184', '32086', '22990', '27280', '31072', '26311', '17531', '30370', '27067', '21026', '28020', '18863', '22483', '20840', '26491', '24013', '20104', '22007', '21401', '24776', '29888', '24464', '31750', '23608', '28595', '27927', '29075', '25598', '17599', '28297', '22766', '30282', '24574', '26767', '17666', '29382', '23191', '30011', '31279', '25319', '20880', '25171', '25148', '28217', '25080', '29235', '24305', '27412', '18019', '22025', '30939', '18911', '29311', '27749', '29335', '17564', '19260', '30159', '19697', '21196', '20337', '25212', '28645', '30225', '19804', '28088', '25578', '22126', '24726', '30800', '25980', '18420', '31375', '18655', '24552', '27548', '29570', '30237', '20341', '23417', '25988', '26343', '21042', '30523']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('2.99', '523', '2007-03-18T03:29:46.996577', '12288', '1'), + ('1.99', '509', '2007-04-07T06:46:01.996577', '4139', '2'), + ('4.99', '364', '2007-04-08T09:32:13.996577', '4689', '2'), + ('10.99', '529', '2007-03-01T04:22:15.996577', '10361', '2'), + ('4.99', '247', '2007-03-18T23:46:26.996577', '12824', '1'), + ('2.99', '368', '2007-03-19T16:31:17.996577', '13280', '2'), + ('4.99', '468', '2007-04-12T04:55:15.996577', '6581', '1'), + ('4.99', '226', '2007-04-06T09:38:35.996577', '3721', '1'), + ('4.99', '466', '2007-03-20T17:49:54.996577', '13988', '1'), + ('5.99', '219', '2007-03-21T15:54:19.996577', '14588', '1'), + ('6.99', '477', '2007-02-16T12:58:25.996577', '1714', '1'), + ('4.99', '356', '2007-03-23T09:01:18.996577', '15705', '1'), + ('4.99', '144', '2007-03-17T12:19:46.996577', '11859', '1'), + ('2.99', '308', '2007-04-30T21:50:35.996577', '9479', '1'), + ('5.99', '25', '2007-03-01T03:17:32.996577', '10324', '1'), + ('4.99', '484', '2007-02-17T10:44:55.996577', '2015', '1'), + ('0.99', '445', '2007-04-07T09:25:47.996577', '4193', '1'), + ('4.99', '219', '2007-05-14T13:44:29.996577', '11577', '1'), + ('0.99', '31', '2007-03-18T06:54:31.996577', '12377', '1'), + ('4.99', '454', '2007-04-11T13:54:55.996577', '6260', '2'), + ('0.99', '182', '2007-04-27T08:29:20.996577', '7229', '2'), + ('2.99', '366', '2007-04-30T00:46:45.996577', '8928', '2'), + ('4.99', '347', '2007-02-20T10:16:26.996577', '3026', '1'), + ('7.99', '122', '2007-04-26T23:07:42.996577', '6974', '2'), + ('4.99', '435', '2007-04-29T23:15:21.996577', '8891', '2'), + ('0.99', '425', '2007-03-01T11:06:12.996577', '10545', '1'), + ('0.99', '521', '2007-04-07T14:00:23.996577', '4284', '2'), + ('4.99', '93', '2007-02-18T03:50:22.996577', '2256', '2'), + ('5.99', '582', '2007-03-22T10:02:59.996577', '15090', '1'), + ('4.99', '407', '2007-03-16T22:28:15.996577', '11518', '2'), + ('0.99', '382', '2007-04-29T18:38:47.996577', '8777', '2'), + ('2.99', '141', '2007-03-18T06:01:34.996577', '12353', '2'), + ('7.99', '331', '2007-03-21T04:20:53.996577', '14256', '1'), + ('4.99', '530', '2007-03-18T17:00:13.996577', '12649', '1'), + ('6.99', '464', '2007-03-22T10:04:42.996577', '15092', '1'), + ('1.99', '226', '2007-03-17T23:35:26.996577', '12172', '1'), + ('1.99', '80', '2007-04-12T11:36:21.996577', '6707', '2'), + ('2.99', '185', '2007-03-21T13:20:01.996577', '14513', '2'), + ('0.99', '251', '2007-04-30T12:34:51.996577', '9892', '1'), + ('0.99', '98', '2007-03-02T03:34:19.996577', '11007', '2'), + ('4.99', '574', '2007-04-09T00:01:49.996577', '5010', '2'), + ('6.99', '512', '2007-04-09T03:07:17.996577', '5064', '1'), + ('2.99', '8', '2007-04-07T08:30:29.996577', '4175', '2'), + ('0.99', '304', '2007-04-30T13:46:29.996577', '9930', '1'), + ('4.99', '364', '2007-02-19T05:19:58.996577', '2606', '2'), + ('0.99', '546', '2007-04-08T08:29:54.996577', '4664', '2'), + ('4.99', '9', '2007-03-01T07:42:26.996577', '10454', '1'), + ('2.99', '114', '2007-04-27T11:47:29.996577', '7316', '2'), + ('4.99', '197', '2007-03-22T04:48:03.996577', '14951', '2'), + ('0.99', '407', '2007-04-29T10:17:05.996577', '8571', '2'), + ('1.99', '382', '2007-02-18T20:29:10.996577', '2489', '1'), + ('6.99', '35', '2007-04-29T20:48:47.996577', '8822', '1'), + ('2.99', '53', '2007-03-18T14:17:34.996577', '12580', '1'), + ('4.99', '91', '2007-04-11T03:35:18.996577', '6078', '1'), + ('2.99', '210', '2007-04-07T15:40:58.996577', '4306', '1'), + ('4.99', '283', '2007-04-06T03:03:38.996577', '3590', '2'), + ('2.99', '410', '2007-03-22T15:08:47.996577', '15211', '1'), + ('3.99', '268', '2007-04-11T06:18:19.996577', '6120', '1'), + ('4.99', '266', '2007-03-02T14:43:33.996577', '11321', '1'), + ('0.99', '537', '2007-04-12T13:01:27.996577', '6746', '1'), + ('6.99', '259', '2007-03-20T21:17:49.996577', '14067', '2'), + ('3.99', '23', '2007-04-30T06:53:29.996577', '9718', '2'), + ('1.99', '169', '2007-03-19T14:47:02.996577', '13237', '2'), + ('5.99', '468', '2007-04-06T14:59:25.996577', '3840', '1'), + ('5.99', '472', '2007-02-19T00:25:25.996577', '2538', '1'), + ('5.99', '532', '2007-03-18T03:44:12.996577', '12295', '2'), + ('4.99', '171', '2007-04-10T23:23:22.996577', '5986', '1'), + ('2.99', '107', '2007-02-15T03:35:58.996577', '1243', '2'), + ('5.99', '30', '2007-04-09T01:03:11.996577', '5028', '2'), + ('2.99', '496', '2007-04-27T04:57:49.996577', '7133', '1'), + ('2.99', '31', '2007-04-27T06:37:51.996577', '7178', '2'), + ('4.99', '356', '2007-02-18T16:38:43.996577', '2433', '1'), + ('0.99', '196', '2007-02-19T10:43:53.996577', '2681', '1'), + ('4.99', '103', '2007-04-08T17:51:42.996577', '4872', '2'), + ('5.99', '284', '2007-03-20T18:51:13.996577', '14007', '1'), + ('0.99', '444', '2007-03-20T15:33:44.996577', '13924', '1'), + ('3.99', '356', '2007-03-01T06:58:37.996577', '10427', '1'), + ('2.99', '273', '2007-04-10T03:35:11.996577', '5605', '1'), + ('4.99', '578', '2007-04-10T17:35:41.996577', '5876', '2'), + ('4.99', '108', '2007-04-29T21:38:54.996577', '8846', '1'), + ('4.99', '296', '2007-03-20T11:51:41.996577', '13819', '1'), + ('1.99', '526', '2007-04-27T14:44:28.996577', '7399', '2'), + ('4.99', '303', '2007-04-09T06:33:25.996577', '5140', '1'), + ('4.99', '543', '2007-03-01T10:14:24.996577', '10520', '1'), + ('4.99', '219', '2007-03-21T19:01:03.996577', '14688', '1'), + ('5.99', '159', '2007-04-06T18:39:36.996577', '3914', '2'), + ('2.99', '338', '2007-04-11T12:46:43.996577', '6236', '1'), + ('4.99', '587', '2007-02-17T11:55:42.996577', '2034', '2'), + ('1.99', '219', '2007-04-12T01:40:21.996577', '6501', '2'), + ('2.99', '38', '2007-02-15T04:24:06.996577', '1250', '2'), + ('7.99', '195', '2007-03-21T21:39:49.996577', '14751', '2'), + ('1.99', '479', '2007-04-11T22:13:51.996577', '6421', '1'), + ('7.99', '51', '2007-04-09T21:47:37.996577', '5473', '1'), + ('4.99', '110', '2007-04-08T16:14:56.996577', '4827', '2'), + ('4.99', '356', '2007-03-17T18:50:01.996577', '12037', '2'), + ('10.99', '76', '2007-03-23T03:45:49.996577', '15566', '1'), + ('3.99', '339', '2007-04-08T22:16:29.996577', '4967', '2'), + ('2.99', '369', '2007-04-28T22:55:30.996577', '8236', '1'), + ('2.99', '426', '2007-03-22T00:00:40.996577', '14826', '2'), + ('0.99', '135', '2007-04-27T16:07:44.996577', '7437', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['31006', '27869', '18471', '28388', '31511', '22982', '31954', '20464', '29917', '18478', '19318', '21246', '17612', '27449', '18318', '30899', '29623', '18580', '17821', '25820', '18561', '19504', '22690', '19299', '22918', '24214', '26562', '21930', '24058', '21159', '22694', '27344', '23609', '28225', '26219', '25565', '29672', '23196', '19169', '25445', '32000', '19288', '27157', '20377', '18242', '21107', '28790', '27284', '26944', '20777', '31836', '25617', '22502', '20034', '27177', '28309', '18395', '23430', '19990', '26329', '21698', '22978', '24910', '27209', '26946', '21100', '18353', '31009', '20915', '31301', '24027', '24304', '27555', '18831', '20786', '19082', '21157', '21479', '22179', '25434', '30340', '24998', '31626', '29097', '23253', '31632', '22477', '28312', '18699', '29801', '27565', '29295', '26304', '17773', '28605', '19650', '19307', '22623', '17941', '30177']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('3.99', '177', '2007-04-27T18:24:12.996577', '7493', '1'), + ('0.99', '507', '2007-04-08T12:12:23.996577', '4744', '2'), + ('0.99', '202', '2007-02-20T18:55:44.996577', '3148', '2'), + ('0.99', '556', '2007-04-08T16:57:31.996577', '4846', '1'), + ('3.99', '230', '2007-04-30T08:30:30.996577', '9778', '2'), + ('0.99', '30', '2007-03-19T22:04:10.996577', '13435', '1'), + ('2.99', '410', '2007-05-14T13:44:29.996577', '12665', '1'), + ('3.99', '369', '2007-03-01T04:20:47.996577', '10359', '2'), + ('1.99', '83', '2007-04-30T11:45:30.996577', '9867', '1'), + ('4.99', '204', '2007-02-17T00:53:38.996577', '1871', '1'), + ('2.99', '215', '2007-02-20T18:30:18.996577', '3143', '1'), + ('7.99', '449', '2007-03-22T05:06:09.996577', '14962', '2'), + ('4.99', '368', '2007-02-18T23:49:15.996577', '2531', '1'), + ('3.99', '470', '2007-04-11T00:20:24.996577', '6009', '1'), + ('4.99', '559', '2007-02-20T11:11:25.996577', '3046', '2'), + ('5.99', '168', '2007-04-07T18:11:54.996577', '4363', '2'), + ('4.99', '57', '2007-04-07T11:06:22.996577', '4226', '2'), + ('5.99', '23', '2007-02-20T09:17:22.996577', '3015', '1'), + ('6.99', '425', '2007-02-21T04:04:18.996577', '3276', '1'), + ('3.99', '324', '2007-04-29T15:20:43.996577', '8698', '1'), + ('5.99', '18', '2007-02-15T17:58:44.996577', '1451', '2'), + ('2.99', '265', '2007-02-19T04:28:23.996577', '2598', '1'), + ('5.99', '1', '2007-03-22T18:32:12.996577', '15315', '1'), + ('2.99', '212', '2007-02-16T06:58:24.996577', '1637', '1'), + ('4.99', '24', '2007-03-19T08:09:19.996577', '13058', '2'), + ('4.99', '159', '2007-03-02T11:11:53.996577', '11225', '2'), + ('6.99', '389', '2007-04-29T03:09:05.996577', '8338', '1'), + ('0.99', '521', '2007-03-21T09:52:25.996577', '14423', '1'), + ('2.99', '145', '2007-03-18T22:34:15.996577', '12785', '2'), + ('4.99', '440', '2007-03-23T16:43:32.996577', '15925', '1'), + ('6.99', '2', '2007-03-02T09:12:14.996577', '11177', '1'), + ('2.99', '460', '2007-04-29T13:34:18.996577', '8656', '2'), + ('2.99', '98', '2007-03-02T10:17:02.996577', '11200', '2'), + ('4.99', '538', '2007-04-09T17:10:42.996577', '5369', '1'), + ('4.99', '360', '2007-04-07T02:26:02.996577', '4056', '1'), + ('2.99', '302', '2007-04-10T07:20:05.996577', '5682', '2'), + ('4.99', '62', '2007-04-07T07:39:23.996577', '4159', '2'), + ('5.99', '53', '2007-03-20T23:44:25.996577', '14119', '2'), + ('4.99', '175', '2007-02-21T03:17:33.996577', '3266', '2'), + ('4.99', '292', '2007-04-28T05:10:23.996577', '7766', '1'), + ('5.98', '576', '2007-05-14T13:44:29.996577', '11942', '2'), + ('7.99', '201', '2007-02-21T11:06:12.996577', '3364', '1'), + ('2.99', '442', '2007-04-27T15:48:42.996577', '7427', '2'), + ('6.99', '360', '2007-03-19T00:22:09.996577', '12839', '1'), + ('4.99', '535', '2007-02-21T00:48:50.996577', '3228', '1'), + ('2.99', '435', '2007-03-22T11:47:51.996577', '15136', '1'), + ('4.99', '590', '2007-04-11T12:36:53.996577', '6232', '2'), + ('0.99', '454', '2007-04-30T05:01:02.996577', '9041', '2'), + ('0.99', '424', '2007-04-10T02:05:22.996577', '5568', '1'), + ('4.99', '400', '2007-03-23T02:23:05.996577', '15533', '2'), + ('6.99', '260', '2007-04-08T11:59:49.996577', '4741', '2'), + ('4.99', '306', '2007-04-27T08:32:45.996577', '7232', '1'), + ('4.99', '584', '2007-03-21T10:40:31.996577', '14447', '2'), + ('5.99', '323', '2007-03-19T11:04:22.996577', '13140', '1'), + ('6.99', '444', '2007-04-08T07:59:53.996577', '4648', '2'), + ('4.99', '547', '2007-04-09T15:08:15.996577', '5327', '2'), + ('5.99', '579', '2007-02-18T16:06:11.996577', '2425', '2'), + ('7.99', '78', '2007-03-01T21:51:11.996577', '10831', '1'), + ('2.99', '317', '2007-03-01T04:35:15.996577', '10364', '1'), + ('4.99', '368', '2007-04-11T06:30:58.996577', '6124', '1'), + ('0.99', '496', '2007-03-21T07:22:52.996577', '14348', '1'), + ('6.99', '30', '2007-03-01T00:26:14.996577', '10235', '1'), + ('0.99', '241', '2007-03-22T04:19:52.996577', '14936', '1'), + ('0.99', '446', '2007-04-30T07:48:07.996577', '9116', '1'), + ('2.99', '424', '2007-04-12T05:34:55.996577', '6589', '1'), + ('0.99', '435', '2007-03-17T09:45:13.996577', '11796', '1'), + ('5.99', '569', '2007-02-16T08:48:18.996577', '1668', '2'), + ('1.99', '177', '2007-04-30T10:52:43.996577', '9190', '2'), + ('0.99', '414', '2007-03-19T20:47:08.996577', '13404', '1'), + ('4.99', '211', '2007-04-10T12:34:29.996577', '5785', '2'), + ('0.99', '142', '2007-03-20T16:44:47.996577', '13959', '1'), + ('2.99', '169', '2007-03-19T13:15:44.996577', '13198', '2'), + ('2.99', '479', '2007-04-30T05:51:37.996577', '9697', '2'), + ('1.99', '85', '2007-02-21T06:20:56.996577', '3307', '1'), + ('0.99', '401', '2007-03-23T13:49:45.996577', '15831', '1'), + ('5.99', '149', '2007-02-18T06:59:44.996577', '2305', '1'), + ('7.99', '440', '2007-03-22T01:25:30.996577', '14863', '2'), + ('7.99', '471', '2007-03-20T22:14:50.996577', '14085', '1'), + ('4.99', '549', '2007-03-18T20:56:48.996577', '12747', '2'), + ('7.99', '291', '2007-04-30T13:24:12.996577', '9919', '2'), + ('5.99', '120', '2007-04-06T22:35:26.996577', '4001', '1'), + ('0.99', '252', '2007-03-01T02:59:44.996577', '10314', '2'), + ('4.99', '240', '2007-04-07T15:35:37.996577', '4305', '2'), + ('7.99', '10', '2007-04-09T01:41:18.996577', '5038', '1'), + ('4.99', '59', '2007-03-20T15:25:37.996577', '13921', '2'), + ('4.99', '240', '2007-04-26T23:54:00.996577', '7001', '1'), + ('7.99', '582', '2007-03-02T13:26:10.996577', '11290', '2'), + ('4.99', '547', '2007-04-27T15:38:05.996577', '7420', '2'), + ('9.99', '49', '2007-02-15T03:12:36.996577', '1237', '2'), + ('4.99', '73', '2007-04-27T21:52:50.996577', '7590', '1'), + ('0.99', '481', '2007-04-06T16:08:44.996577', '3863', '1'), + ('4.99', '28', '2007-04-30T06:08:59.996577', '9705', '2'), + ('4.99', '366', '2007-04-26T22:54:43.996577', '6971', '2'), + ('2.99', '408', '2007-02-19T13:32:30.996577', '2728', '2'), + ('3.99', '574', '2007-04-30T07:54:23.996577', '9759', '1'), + ('0.99', '278', '2007-03-20T14:28:22.996577', '13896', '1'), + ('4.99', '213', '2007-02-20T04:19:06.996577', '2946', '2'), + ('2.99', '202', '2007-03-01T04:54:48.996577', '10375', '1'), + ('5.99', '454', '2007-02-17T13:23:55.996577', '2048', '2'), + ('3.99', '104', '2007-04-30T06:53:08.996577', '9090', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['29378', '30341', '28870', '20350', '20905', '25342', '24300', '23923', '26223', '28887', '21490', '29306', '27970', '29231', '20270', '21440', '23506', '25263', '19834', '29283', '24477', '24835', '27981', '28473', '31003', '28877', '18598', '22964', '25460', '28912', '28791', '18585', '24278', '18733', '25963', '25597', '27064', '29421', '20855', '25425', '17748', '20795', '21883', '27341', '28984', '31913', '25469', '25300', '17802', '21285', '20720', '22493', '27374', '18494', '22189', '30089', '19478', '28146', '25336', '22615', '23694', '22738', '23737', '23954', '28896', '28919', '26770', '21589', '29008', '29370', '24035', '27447', '31452', '28922', '27680', '24002', '27585', '19843', '27891', '29924', '22749', '17790', '27594', '25960', '22756', '19634', '29977', '25401', '30957', '29837', '22415', '21415', '29469', '23934', '27895', '28493', '20378', '18540', '23827', '29923']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('4.99', '35', '2007-04-11T21:13:00.996577', '6401', '1'), + ('3.99', '120', '2007-04-07T13:07:46.996577', '4272', '2'), + ('4.99', '595', '2007-04-30T00:10:14.996577', '9542', '2'), + ('2.99', '357', '2007-03-01T05:17:31.996577', '10391', '2'), + ('2.99', '413', '2007-03-19T18:02:23.996577', '13318', '1'), + ('4.99', '284', '2007-04-27T17:16:58.996577', '7463', '1'), + ('2.99', '168', '2007-03-22T13:27:56.996577', '15165', '1'), + ('0.99', '132', '2007-03-17T22:15:42.996577', '12133', '2'), + ('3.99', '360', '2007-04-10T23:44:05.996577', '5995', '1'), + ('0.99', '598', '2007-04-06T05:59:07.996577', '3648', '1'), + ('8.99', '472', '2007-03-19T12:55:29.996577', '13188', '2'), + ('4.99', '29', '2007-04-30T18:18:39.996577', '9392', '2'), + ('4.99', '517', '2007-04-07T18:30:04.996577', '4369', '1'), + ('2.99', '23', '2007-04-28T14:01:29.996577', '8015', '1'), + ('2.99', '348', '2007-03-18T13:40:01.996577', '12564', '2'), + ('4.99', '468', '2007-03-21T02:56:28.996577', '14210', '2'), + ('0.99', '85', '2007-03-20T08:53:38.996577', '13733', '2'), + ('4.99', '277', '2007-04-30T05:00:02.996577', '9669', '2'), + ('6.99', '299', '2007-03-17T02:55:50.996577', '11629', '1'), + ('0.99', '28', '2007-04-06T15:06:40.996577', '3845', '1'), + ('3.99', '186', '2007-03-22T18:04:47.996577', '15295', '2'), + ('0.99', '233', '2007-03-23T13:32:24.996577', '15821', '2'), + ('7.99', '518', '2007-04-07T00:48:10.996577', '4029', '2'), + ('5.99', '563', '2007-04-29T11:53:28.996577', '8610', '1'), + ('0.99', '177', '2007-04-08T13:16:33.996577', '4760', '1'), + ('4.99', '596', '2007-04-12T19:19:14.996577', '6883', '2'), + ('6.99', '26', '2007-02-18T15:53:31.996577', '2421', '2'), + ('4.99', '29', '2007-03-02T05:57:36.996577', '11079', '1'), + ('2.99', '293', '2007-04-30T08:07:41.996577', '9123', '2'), + ('2.99', '202', '2007-04-09T09:00:00.996577', '5194', '2'), + ('4.99', '590', '2007-04-12T00:57:06.996577', '6492', '2'), + ('4.99', '24', '2007-02-17T18:44:38.996577', '2116', '2'), + ('3.99', '167', '2007-03-01T02:03:37.996577', '10285', '2'), + ('4.99', '57', '2007-02-18T11:39:39.996577', '2360', '1'), + ('5.99', '337', '2007-04-06T04:44:01.996577', '3626', '1'), + ('4.99', '304', '2007-04-28T15:30:58.996577', '8055', '2'), + ('4.99', '435', '2007-04-11T02:15:07.996577', '6051', '2'), + ('4.99', '38', '2007-04-30T02:49:34.996577', '9621', '1'), + ('3.99', '408', '2007-03-20T09:20:11.996577', '13744', '2'), + ('2.99', '291', '2007-04-10T11:01:09.996577', '5754', '2'), + ('3.99', '403', '2007-02-18T20:06:52.996577', '2488', '2'), + ('7.99', '403', '2007-03-02T04:28:08.996577', '11038', '1'), + ('8.99', '516', '2007-03-19T16:22:08.996577', '13276', '1'), + ('5.99', '460', '2007-04-12T15:02:10.996577', '6788', '1'), + ('2.99', '208', '2007-04-10T08:04:09.996577', '5693', '2'), + ('0.99', '267', '2007-04-11T03:16:08.996577', '6070', '1'), + ('2.99', '294', '2007-04-30T23:23:37.996577', '9522', '1'), + ('0.99', '281', '2007-04-28T18:23:47.996577', '8131', '2'), + ('2.99', '419', '2007-02-19T17:21:03.996577', '2793', '2'), + ('2.99', '453', '2007-03-21T00:12:40.996577', '14133', '1'), + ('0.99', '394', '2007-03-01T12:59:01.996577', '10603', '1'), + ('0.99', '584', '2007-03-02T02:29:13.996577', '10966', '2'), + ('0.99', '463', '2007-04-09T20:39:40.996577', '5448', '1'), + ('0.99', '208', '2007-02-20T01:43:35.996577', '2907', '2'), + ('6.99', '550', '2007-03-21T08:15:01.996577', '14375', '2'), + ('4.99', '98', '2007-04-29T12:21:54.996577', '8622', '2'), + ('3.99', '260', '2007-02-16T06:18:13.996577', '1626', '1'), + ('2.99', '531', '2007-04-27T07:30:57.996577', '7204', '2'), + ('7.99', '284', '2007-04-08T13:07:48.996577', '4759', '1'), + ('7.99', '598', '2007-03-22T23:12:41.996577', '15443', '1'), + ('7.99', '109', '2007-03-22T21:39:15.996577', '15398', '2'), + ('0.99', '6', '2007-03-17T12:07:58.996577', '11853', '1'), + ('0.99', '114', '2007-03-23T00:33:23.996577', '15485', '1'), + ('0.99', '136', '2007-03-18T12:38:35.996577', '12539', '2'), + ('6.99', '598', '2007-04-27T07:26:06.996577', '7201', '2'), + ('0.99', '202', '2007-04-30T00:57:04.996577', '8930', '2'), + ('0.99', '408', '2007-04-09T03:31:01.996577', '5073', '2'), + ('3.99', '483', '2007-03-18T05:15:45.996577', '12331', '2'), + ('5.99', '2', '2007-04-27T13:51:28.996577', '7376', '1'), + ('2.99', '35', '2007-04-06T03:32:25.996577', '3597', '2'), + ('4.99', '143', '2007-03-20T12:34:59.996577', '13835', '2'), + ('6.99', '470', '2007-04-08T00:40:30.996577', '4502', '2'), + ('2.99', '226', '2007-04-09T13:29:49.996577', '5282', '1'), + ('4.99', '202', '2007-04-30T07:49:16.996577', '9751', '2'), + ('4.99', '490', '2007-04-10T05:53:12.996577', '5654', '1'), + ('10.99', '140', '2007-03-19T08:00:14.996577', '13053', '2'), + ('7.99', '482', '2007-04-11T23:13:43.996577', '6447', '2'), + ('2.99', '300', '2007-03-18T11:08:03.996577', '12484', '2'), + ('5.99', '508', '2007-04-30T05:41:42.996577', '9694', '2'), + ('9.99', '84', '2007-04-11T21:56:18.996577', '6415', '2'), + ('3.99', '7', '2007-03-02T03:09:20.996577', '10989', '2'), + ('5.99', '414', '2007-02-21T06:51:31.996577', '3318', '1'), + ('0.99', '483', '2007-04-27T05:09:07.996577', '7137', '2'), + ('8.99', '336', '2007-04-30T01:46:50.996577', '8951', '2'), + ('5.99', '7', '2007-03-21T03:18:14.996577', '14222', '1'), + ('0.99', '277', '2007-03-17T00:06:45.996577', '11574', '2'), + ('2.99', '89', '2007-04-09T19:59:37.996577', '5436', '2'), + ('0.99', '289', '2007-04-10T09:46:38.996577', '5724', '2'), + ('2.99', '172', '2007-04-30T07:52:44.996577', '9118', '1'), + ('0.99', '76', '2007-04-10T02:16:46.996577', '5571', '2'), + ('4.99', '575', '2007-03-02T19:52:28.996577', '11458', '1'), + ('4.99', '466', '2007-03-02T16:14:21.996577', '11359', '1'), + ('2.99', '42', '2007-04-12T15:20:39.996577', '6799', '1'), + ('3.99', '134', '2007-03-02T13:02:59.996577', '11280', '1'), + ('4.99', '509', '2007-04-07T13:03:16.996577', '4266', '2'), + ('5.99', '565', '2007-04-27T08:54:17.996577', '7242', '2'), + ('4.99', '360', '2007-03-19T05:49:05.996577', '12990', '1'), + ('5.99', '12', '2007-02-16T15:31:21.996577', '1752', '2'), + ('3.99', '123', '2007-03-18T07:56:00.996577', '12402', '1'), + ('2.99', '84', '2007-04-11T13:54:18.996577', '6259', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['21572', '19651', '29696', '24991', '27383', '18681', '31381', '28694', '26775', '20229', '19164', '19777', '19090', '23508', '21671', '32089', '21431', '27812', '30275', '20185', '23481', '20698', '20821', '23183', '30712', '27951', '26864', '27007', '24711', '28050', '17809', '26243', '26581', '29162', '25385', '28620', '23497', '18765', '31305', '29189', '20896', '27120', '30374', '22228', '21889', '30670', '27903', '25333', '19474', '23079', '27386', '18759', '18061', '18792', '24585', '25202', '28652', '25795', '19312', '21155', '22322', '26321', '24525', '19966', '17807', '19677', '31758', '25412', '25614', '26046', '24054', '27898', '19060', '31940', '27931', '18768', '24879', '26972', '31104', '25454', '21874', '26202', '29504', '22262', '20019', '27321', '27575', '24038', '22705', '19802', '27639', '26188', '29929', '23041', '25717', '28220', '18879', '21744', '22609', '30139']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('1.99', '481', '2007-03-20T17:57:49.996577', '13990', '1'), + ('0.99', '278', '2007-03-20T17:30:42.996577', '13976', '2'), + ('2.99', '64', '2007-04-09T13:15:02.996577', '5279', '2'), + ('4.99', '251', '2007-03-18T17:40:07.996577', '12666', '2'), + ('5.99', '464', '2007-04-07T17:05:03.996577', '4337', '1'), + ('4.99', '45', '2007-02-16T19:10:23.996577', '1806', '1'), + ('4.99', '219', '2007-04-30T06:41:37.996577', '9712', '1'), + ('2.99', '581', '2007-04-28T05:43:09.996577', '7783', '1'), + ('4.99', '408', '2007-04-28T13:29:15.996577', '7996', '2'), + ('4.99', '343', '2007-03-19T16:30:44.996577', '13279', '2'), + ('7.99', '174', '2007-02-16T01:41:46.996577', '1566', '2'), + ('8.99', '293', '2007-03-22T21:46:07.996577', '15402', '1'), + ('0.99', '151', '2007-02-20T14:25:27.996577', '3089', '2'), + ('4.99', '86', '2007-03-01T10:50:19.996577', '10536', '2'), + ('2.99', '493', '2007-03-23T15:02:57.996577', '15878', '2'), + ('0.00', '228', '2007-05-14T13:44:29.996577', '15234', '1'), + ('3.99', '467', '2007-03-22T00:33:04.996577', '14842', '1'), + ('2.99', '502', '2007-04-06T04:14:31.996577', '3614', '2'), + ('2.99', '114', '2007-04-06T19:06:28.996577', '3924', '1'), + ('3.99', '339', '2007-03-21T21:53:18.996577', '14758', '2'), + ('5.99', '83', '2007-03-16T23:56:31.996577', '11565', '1'), + ('0.99', '392', '2007-03-02T19:53:51.996577', '11459', '1'), + ('0.99', '405', '2007-03-17T19:23:51.996577', '12050', '1'), + ('0.99', '52', '2007-03-18T12:11:11.996577', '12520', '2'), + ('3.99', '151', '2007-04-12T14:16:17.996577', '6768', '2'), + ('0.99', '515', '2007-04-06T12:25:29.996577', '3782', '2'), + ('2.99', '416', '2007-04-29T13:24:47.996577', '8648', '2'), + ('6.99', '429', '2007-04-12T19:26:30.996577', '6886', '2'), + ('4.99', '217', '2007-03-19T01:24:02.996577', '12871', '1'), + ('6.99', '523', '2007-04-09T13:40:20.996577', '5287', '1'), + ('0.99', '422', '2007-02-16T22:31:10.996577', '1846', '1'), + ('4.99', '361', '2007-04-28T21:04:52.996577', '8189', '2'), + ('0.99', '391', '2007-04-08T12:47:07.996577', '4753', '2'), + ('2.99', '15', '2007-04-30T15:51:01.996577', '9987', '1'), + ('1.99', '287', '2007-04-30T06:52:19.996577', '9716', '2'), + ('4.99', '576', '2007-04-10T20:36:25.996577', '5934', '1'), + ('5.99', '84', '2007-03-21T06:57:46.996577', '14330', '1'), + ('0.99', '67', '2007-02-19T18:12:38.996577', '2810', '2'), + ('0.99', '211', '2007-04-27T17:56:43.996577', '7484', '2'), + ('4.99', '18', '2007-04-29T09:46:27.996577', '8555', '1'), + ('4.99', '412', '2007-03-22T19:47:25.996577', '15354', '2'), + ('2.99', '440', '2007-04-07T15:05:49.996577', '4301', '1'), + ('0.99', '122', '2007-04-28T20:12:20.996577', '8177', '2'), + ('2.99', '554', '2007-03-21T17:04:10.996577', '14626', '1'), + ('3.99', '517', '2007-03-17T04:55:41.996577', '11684', '1'), + ('0.99', '147', '2007-04-28T03:14:03.996577', '7723', '1'), + ('4.99', '509', '2007-04-30T22:53:26.996577', '10189', '1'), + ('2.99', '283', '2007-04-30T13:23:48.996577', '9918', '2'), + ('7.99', '259', '2007-02-16T07:14:52.996577', '1641', '1'), + ('2.99', '40', '2007-03-20T16:26:37.996577', '13951', '1'), + ('3.99', '464', '2007-04-12T06:13:15.996577', '6601', '2'), + ('2.99', '66', '2007-02-19T02:48:40.996577', '2571', '2'), + ('3.99', '484', '2007-02-16T07:24:01.996577', '1643', '2'), + ('0.99', '76', '2007-02-17T18:15:47.996577', '2111', '2'), + ('2.99', '198', '2007-03-17T16:48:10.996577', '11985', '2'), + ('3.99', '272', '2007-04-09T02:12:41.996577', '5047', '2'), + ('6.99', '578', '2007-04-30T17:06:13.996577', '10029', '1'), + ('6.99', '323', '2007-04-06T08:45:11.996577', '3704', '2'), + ('2.99', '214', '2007-02-19T22:37:24.996577', '2868', '2'), + ('2.99', '440', '2007-03-20T10:32:20.996577', '13779', '2'), + ('8.99', '564', '2007-03-22T08:50:26.996577', '15059', '2'), + ('0.99', '367', '2007-04-29T07:27:51.996577', '8490', '2'), + ('4.99', '192', '2007-03-21T00:41:57.996577', '14146', '2'), + ('6.99', '313', '2007-03-23T03:52:55.996577', '15569', '2'), + ('2.99', '421', '2007-02-18T15:19:07.996577', '2407', '2'), + ('4.99', '280', '2007-03-20T06:54:00.996577', '13667', '1'), + ('0.99', '252', '2007-04-28T01:12:51.996577', '7670', '1'), + ('5.99', '290', '2007-04-09T10:11:34.996577', '5214', '2'), + ('2.99', '306', '2007-04-12T18:38:43.996577', '6868', '2'), + ('6.99', '345', '2007-04-27T03:14:26.996577', '7092', '1'), + ('4.99', '145', '2007-03-01T20:31:57.996577', '10799', '2'), + ('5.99', '509', '2007-04-12T05:42:12.996577', '6591', '1'), + ('4.99', '145', '2007-02-18T04:58:18.996577', '2271', '2'), + ('2.99', '352', '2007-05-14T13:44:29.996577', '13578', '2'), + ('6.99', '512', '2007-04-28T03:01:04.996577', '7715', '1'), + ('8.99', '68', '2007-02-17T07:19:24.996577', '1957', '2'), + ('2.99', '238', '2007-03-17T13:52:32.996577', '11897', '1'), + ('0.99', '425', '2007-04-30T21:41:00.996577', '10163', '2'), + ('0.99', '185', '2007-04-29T06:01:33.996577', '8442', '2'), + ('6.99', '293', '2007-04-08T21:12:54.996577', '4944', '2'), + ('8.99', '515', '2007-03-18T11:11:16.996577', '12486', '1'), + ('2.99', '358', '2007-04-06T11:02:32.996577', '3753', '1'), + ('7.99', '45', '2007-04-09T18:40:15.996577', '5405', '1'), + ('3.99', '559', '2007-03-01T04:56:54.996577', '10377', '1'), + ('6.99', '321', '2007-03-20T05:18:12.996577', '13623', '2'), + ('3.99', '459', '2007-04-09T14:10:36.996577', '5301', '1'), + ('6.99', '481', '2007-04-28T23:56:10.996577', '8271', '2'), + ('0.99', '144', '2007-03-01T02:40:34.996577', '10302', '1'), + ('2.99', '3', '2007-03-20T04:42:38.996577', '13610', '2'), + ('2.99', '296', '2007-03-19T23:30:52.996577', '13471', '2'), + ('4.99', '486', '2007-04-27T04:42:14.996577', '7127', '2'), + ('3.99', '356', '2007-04-30T23:24:35.996577', '9523', '2'), + ('4.99', '84', '2007-04-30T05:10:12.996577', '9680', '2'), + ('3.99', '37', '2007-03-02T09:08:09.996577', '11176', '1'), + ('5.99', '315', '2007-04-29T05:21:20.996577', '8416', '1'), + ('4.99', '537', '2007-04-28T18:01:07.996577', '8126', '2'), + ('0.99', '96', '2007-02-21T06:27:02.996577', '3308', '1'), + ('0.99', '502', '2007-03-02T14:06:25.996577', '11301', '1'), + ('2.99', '597', '2007-03-22T17:26:05.996577', '15275', '2'), + ('5.99', '102', '2007-04-09T00:00:43.996577', '5009', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['25299', '26641', '24764', '25684', '31862', '26730', '26146', '25599', '28591', '27151', '28763', '21550', '24203', '18496', '23206', '27614', '31483', '23682', '30672', '18434', '24921', '22375', '30630', '27718', '19869', '17912', '29233', '27399', '21297', '18767', '29629', '29996', '22014', '20173', '28181', '20271', '17704', '31917', '30906', '29578', '28435', '21470', '28909', '27886', '19065', '27764', '23777', '24737', '27463', '27691', '21263', '18377', '28986', '27435', '26703', '27953', '28305', '29064', '30265', '24090', '21544', '28091', '18735', '21076', '19495', '17617', '23591', '26953', '25164', '23544', '30608', '30567', '23437', '29415', '31237', '30455', '18391', '25888', '29853', '20841', '31441', '29744', '19999', '21593', '28755', '19147', '20227', '27643', '19018', '31185', '21262', '28377', '23150', '18808', '27249', '27122', '22735', '28651', '22819', '31357']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('3.99', '281', '2007-04-27T19:41:54.996577', '7525', '1'), + ('6.99', '396', '2007-04-30T23:03:08.996577', '10195', '2'), + ('0.99', '224', '2007-03-20T22:59:29.996577', '14099', '2'), + ('4.99', '312', '2007-04-29T16:24:47.996577', '8721', '1'), + ('6.99', '262', '2007-04-12T15:51:27.996577', '6805', '1'), + ('0.99', '405', '2007-04-07T19:54:53.996577', '4401', '2'), + ('2.99', '353', '2007-04-30T18:18:01.996577', '10071', '2'), + ('6.99', '304', '2007-04-30T15:58:14.996577', '9992', '1'), + ('7.99', '574', '2007-04-06T02:39:09.996577', '3583', '1'), + ('5.99', '442', '2007-04-07T02:06:48.996577', '4052', '1'), + ('2.99', '588', '2007-04-09T09:22:25.996577', '5203', '2'), + ('1.99', '479', '2007-03-17T00:41:52.996577', '11584', '2'), + ('0.99', '158', '2007-03-02T12:48:53.996577', '11272', '1'), + ('0.99', '1', '2007-02-15T16:31:19.996577', '1422', '2'), + ('4.99', '54', '2007-03-18T23:19:54.996577', '12811', '1'), + ('0.99', '485', '2007-04-06T02:16:13.996577', '3579', '2'), + ('8.99', '228', '2007-04-27T19:05:45.996577', '7509', '2'), + ('6.99', '108', '2007-03-02T19:02:01.996577', '11445', '2'), + ('0.99', '147', '2007-04-30T08:24:33.996577', '9772', '2'), + ('2.99', '590', '2007-02-18T11:08:41.996577', '2352', '2'), + ('7.99', '242', '2007-03-18T20:05:46.996577', '12724', '2'), + ('0.99', '569', '2007-03-23T05:35:48.996577', '15617', '2'), + ('0.99', '144', '2007-04-28T07:12:15.996577', '7830', '1'), + ('5.99', '494', '2007-04-07T19:43:20.996577', '4397', '2'), + ('4.99', '303', '2007-03-02T12:11:10.996577', '11253', '1'), + ('2.99', '449', '2007-02-20T06:20:17.996577', '2970', '2'), + ('5.99', '23', '2007-04-30T11:24:02.996577', '9209', '2'), + ('4.99', '467', '2007-04-07T10:48:47.996577', '4222', '2'), + ('0.99', '454', '2007-03-21T23:13:23.996577', '14799', '1'), + ('5.99', '68', '2007-02-16T20:33:00.996577', '1828', '2'), + ('4.99', '57', '2007-04-12T09:19:35.996577', '6649', '2'), + ('5.99', '90', '2007-04-27T15:50:18.996577', '7428', '1'), + ('10.99', '531', '2007-03-02T12:34:08.996577', '11265', '1'), + ('0.99', '338', '2007-03-22T10:29:59.996577', '15105', '2'), + ('2.99', '534', '2007-04-06T10:10:30.996577', '3735', '1'), + ('5.99', '348', '2007-03-19T02:02:30.996577', '12884', '2'), + ('5.99', '390', '2007-02-15T23:39:51.996577', '1539', '2'), + ('7.98', '267', '2007-05-14T13:44:29.996577', '12066', '2'), + ('1.99', '168', '2007-04-29T03:20:27.996577', '8352', '2'), + ('0.99', '51', '2007-04-30T04:15:20.996577', '9649', '2'), + ('4.99', '560', '2007-04-11T21:36:32.996577', '6410', '1'), + ('10.99', '470', '2007-03-18T21:06:05.996577', '12753', '1'), + ('8.99', '202', '2007-04-06T15:53:15.996577', '3861', '1'), + ('3.99', '508', '2007-04-27T12:05:52.996577', '7322', '2'), + ('3.99', '146', '2007-02-18T03:00:54.996577', '2242', '1'), + ('4.99', '497', '2007-04-30T11:15:18.996577', '9850', '2'), + ('4.99', '119', '2007-03-01T15:59:01.996577', '10681', '1'), + ('2.99', '220', '2007-03-19T16:36:13.996577', '13281', '1'), + ('8.99', '471', '2007-04-11T17:58:39.996577', '6336', '1'), + ('4.99', '491', '2007-04-10T18:23:07.996577', '5889', '1'), + ('2.99', '451', '2007-03-18T06:31:12.996577', '12371', '2'), + ('0.99', '574', '2007-02-19T07:20:13.996577', '2632', '1'), + ('1.99', '208', '2007-04-12T14:15:21.996577', '6767', '1'), + ('3.99', '469', '2007-04-26T22:24:14.996577', '6955', '1'), + ('6.99', '403', '2007-04-06T05:48:37.996577', '3644', '1'), + ('0.99', '515', '2007-04-09T10:23:24.996577', '5216', '2'), + ('6.99', '267', '2007-04-30T15:21:47.996577', '9308', '1'), + ('5.99', '7', '2007-04-08T14:44:30.996577', '4787', '2'), + ('2.99', '113', '2007-04-09T15:02:44.996577', '5324', '2'), + ('8.99', '147', '2007-03-23T10:01:01.996577', '15730', '1'), + ('4.99', '478', '2007-03-20T00:38:53.996577', '13507', '2'), + ('4.99', '526', '2007-04-28T15:28:07.996577', '8053', '1'), + ('0.99', '57', '2007-02-21T10:24:08.996577', '3357', '1'), + ('4.99', '432', '2007-03-23T02:01:02.996577', '15523', '1'), + ('1.99', '262', '2007-02-20T02:25:43.996577', '2915', '1'), + ('6.99', '370', '2007-02-14T23:33:58.996577', '1190', '2'), + ('0.99', '95', '2007-03-01T07:30:43.996577', '10446', '2'), + ('8.99', '424', '2007-04-30T23:09:24.996577', '9516', '1'), + ('4.99', '267', '2007-04-30T17:37:22.996577', '10048', '2'), + ('4.99', '90', '2007-03-01T21:57:15.996577', '10835', '1'), + ('7.99', '142', '2007-04-30T03:59:53.996577', '9020', '1'), + ('0.99', '138', '2007-04-30T02:45:28.996577', '9619', '1'), + ('2.99', '78', '2007-03-21T16:39:09.996577', '14620', '2'), + ('5.99', '38', '2007-04-27T06:04:37.996577', '7163', '2'), + ('4.99', '199', '2007-04-12T14:51:51.996577', '6782', '2'), + ('0.99', '129', '2007-04-09T05:54:13.996577', '5127', '1'), + ('6.99', '577', '2007-02-21T14:21:09.996577', '3401', '2'), + ('1.99', '331', '2007-04-10T18:02:16.996577', '5885', '1'), + ('4.99', '78', '2007-04-06T03:08:18.996577', '3593', '1'), + ('0.99', '407', '2007-03-17T04:34:52.996577', '11677', '1'), + ('3.99', '225', '2007-04-12T02:49:46.996577', '6526', '1'), + ('3.99', '68', '2007-04-08T20:24:26.996577', '4925', '1'), + ('2.99', '317', '2007-03-22T14:59:09.996577', '15204', '1'), + ('0.99', '484', '2007-03-17T18:26:00.996577', '12024', '1'), + ('8.99', '587', '2007-04-27T18:45:25.996577', '7501', '1'), + ('0.99', '170', '2007-02-17T18:52:26.996577', '2117', '2'), + ('0.99', '343', '2007-03-02T10:46:55.996577', '11212', '1'), + ('2.99', '486', '2007-04-30T18:34:11.996577', '10079', '1'), + ('7.99', '133', '2007-02-19T09:41:01.996577', '2665', '2'), + ('0.99', '195', '2007-04-10T00:58:08.996577', '5536', '1'), + ('2.99', '451', '2007-03-17T09:28:34.996577', '11790', '1'), + ('2.99', '554', '2007-04-10T00:34:27.996577', '5527', '1'), + ('5.99', '49', '2007-03-21T01:28:29.996577', '14168', '2'), + ('3.99', '80', '2007-02-21T11:36:47.996577', '3367', '1'), + ('4.99', '451', '2007-04-08T20:44:14.996577', '4930', '2'), + ('2.99', '440', '2007-04-09T19:25:14.996577', '5423', '2'), + ('3.99', '6', '2007-03-02T17:23:41.996577', '11398', '1'), + ('4.99', '578', '2007-04-30T15:06:50.996577', '9970', '2'), + ('7.99', '15', '2007-03-17T14:49:03.996577', '11922', '1'), + ('6.99', '217', '2007-04-30T03:30:49.996577', '9632', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['32068', '28997', '31422', '27591', '26285', '21681', '31327', '22804', '20365', '31894', '23742', '19547', '30737', '24849', '23499', '31552', '23438', '22595', '22302', '31045', '30748', '20944', '21545', '26705', '31528', '29267', '21751', '25415', '22376', '24470', '29976', '19195', '21449', '23384', '20981', '20568', '25144', '30556', '26801', '28481', '18063', '32029', '29637', '23282', '24521', '29544', '25378', '30963', '19505', '19045', '30651', '19524', '29293', '22866', '22812', '28847', '29669', '19369', '24243', '31560', '18049', '19923', '27578', '30525', '29643', '18405', '24212', '23058', '26451', '28089', '28532', '18078', '31297', '29584', '19575', '27623', '22959', '22631', '31998', '18505', '24298', '19137', '24785', '20563', '25838', '25407', '27205', '24055', '24008', '21996', '25802', '27335', '26675', '23687', '18744', '18171', '20273', '31289', '30711', '22193']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('4.99', '180', '2007-05-14T13:44:29.996577', '12901', '1'), + ('7.99', '1', '2007-04-11T08:42:12.996577', '6163', '1'), + ('3.99', '223', '2007-04-29T03:37:37.996577', '8362', '2'), + ('4.99', '483', '2007-04-10T14:48:18.996577', '5823', '1'), + ('4.99', '365', '2007-04-12T06:26:11.996577', '6604', '1'), + ('9.99', '494', '2007-03-22T12:57:37.996577', '15156', '2'), + ('2.99', '213', '2007-04-30T16:35:42.996577', '9340', '2'), + ('7.99', '13', '2007-03-21T14:12:49.996577', '14545', '2'), + ('2.99', '359', '2007-03-19T17:14:15.996577', '13297', '2'), + ('4.99', '265', '2007-04-09T19:02:35.996577', '5417', '1'), + ('2.99', '115', '2007-03-01T14:37:12.996577', '10647', '2'), + ('6.99', '269', '2007-03-21T19:12:45.996577', '14693', '2'), + ('0.99', '154', '2007-04-06T18:38:29.996577', '3912', '2'), + ('2.99', '235', '2007-03-18T05:19:31.996577', '12332', '2'), + ('2.99', '84', '2007-03-22T16:45:16.996577', '15255', '1'), + ('0.99', '234', '2007-04-08T09:22:05.996577', '4686', '2'), + ('0.99', '78', '2007-03-21T19:58:21.996577', '14716', '1'), + ('4.99', '596', '2007-03-20T06:16:36.996577', '13648', '1'), + ('0.99', '563', '2007-03-17T11:20:30.996577', '11829', '2'), + ('0.99', '180', '2007-04-10T11:59:35.996577', '5773', '2'), + ('7.99', '154', '2007-04-29T02:46:51.996577', '8334', '2'), + ('6.99', '417', '2007-03-02T13:26:24.996577', '11291', '1'), + ('4.99', '478', '2007-03-22T07:31:30.996577', '15027', '1'), + ('4.99', '403', '2007-04-07T04:37:37.996577', '4096', '2'), + ('4.99', '232', '2007-04-28T00:26:56.996577', '7653', '2'), + ('2.99', '26', '2007-04-11T13:21:51.996577', '6243', '2'), + ('3.99', '502', '2007-03-23T00:33:46.996577', '15486', '1'), + ('4.99', '290', '2007-04-26T22:19:53.996577', '6952', '1'), + ('4.99', '569', '2007-03-23T20:17:20.996577', '16025', '2'), + ('4.99', '186', '2007-03-20T01:01:43.996577', '13517', '2'), + ('7.99', '89', '2007-04-09T06:38:19.996577', '5144', '2'), + ('2.99', '181', '2007-02-16T07:01:02.996577', '1638', '1'), + ('4.99', '469', '2007-03-01T03:03:23.996577', '10316', '1'), + ('3.99', '73', '2007-03-17T02:09:37.996577', '11609', '2'), + ('4.99', '419', '2007-03-23T12:02:12.996577', '15779', '2'), + ('0.99', '379', '2007-03-19T23:48:40.996577', '13485', '1'), + ('2.99', '265', '2007-03-22T04:28:25.996577', '14943', '1'), + ('0.99', '138', '2007-04-09T17:34:22.996577', '5378', '1'), + ('2.99', '410', '2007-04-09T15:29:34.996577', '5336', '1'), + ('0.99', '564', '2007-04-29T22:43:11.996577', '8874', '1'), + ('5.99', '484', '2007-02-17T13:06:23.996577', '2044', '1'), + ('7.98', '53', '2007-05-14T13:44:29.996577', '11657', '2'), + ('4.99', '58', '2007-04-06T07:59:11.996577', '3685', '1'), + ('4.99', '62', '2007-03-21T23:48:45.996577', '14821', '2'), + ('7.99', '192', '2007-03-01T22:11:29.996577', '10843', '1'), + ('4.99', '49', '2007-04-27T07:45:19.996577', '7209', '2'), + ('3.99', '287', '2007-04-10T03:01:39.996577', '5593', '1'), + ('2.99', '173', '2007-04-09T22:30:32.996577', '5488', '1'), + ('5.99', '266', '2007-02-15T06:44:32.996577', '1280', '2'), + ('7.99', '141', '2007-02-20T00:54:57.996577', '2895', '2'), + ('2.99', '145', '2007-04-30T09:33:21.996577', '9156', '1'), + ('9.99', '267', '2007-03-19T14:46:50.996577', '13236', '2'), + ('2.99', '28', '2007-04-30T00:13:17.996577', '9544', '2'), + ('1.99', '20', '2007-03-02T01:58:50.996577', '10954', '1'), + ('6.99', '14', '2007-03-22T07:12:16.996577', '15015', '2'), + ('8.99', '594', '2007-04-27T19:52:59.996577', '7533', '1'), + ('3.99', '61', '2007-04-29T13:30:44.996577', '8651', '1'), + ('2.99', '233', '2007-02-17T09:27:19.996577', '1992', '2'), + ('5.99', '161', '2007-03-22T08:21:49.996577', '15045', '2'), + ('2.99', '235', '2007-04-11T01:55:27.996577', '6047', '1'), + ('0.99', '480', '2007-02-15T11:42:02.996577', '1353', '1'), + ('2.99', '308', '2007-03-20T12:58:27.996577', '13843', '1'), + ('2.99', '482', '2007-04-06T06:02:41.996577', '3650', '2'), + ('0.99', '135', '2007-04-28T03:37:10.996577', '7734', '1'), + ('2.99', '58', '2007-04-30T00:50:39.996577', '9561', '2'), + ('3.99', '583', '2007-02-15T16:47:56.996577', '1428', '1'), + ('5.99', '158', '2007-03-23T12:40:48.996577', '15796', '1'), + ('4.99', '38', '2007-03-21T14:31:27.996577', '14554', '1'), + ('2.99', '378', '2007-04-30T11:48:34.996577', '9868', '1'), + ('5.99', '526', '2007-04-27T20:12:54.996577', '7543', '2'), + ('0.99', '568', '2007-04-30T07:32:40.996577', '9738', '1'), + ('2.99', '491', '2007-02-15T00:17:24.996577', '1198', '2'), + ('2.99', '211', '2007-04-07T23:21:01.996577', '4479', '2'), + ('0.99', '52', '2007-04-27T10:40:30.996577', '7284', '2'), + ('8.99', '273', '2007-03-01T01:43:00.996577', '10272', '1'), + ('4.99', '485', '2007-04-12T16:22:45.996577', '6810', '2'), + ('2.99', '28', '2007-03-21T14:02:49.996577', '14540', '2'), + ('4.99', '202', '2007-03-23T11:51:22.996577', '15772', '2'), + ('2.99', '568', '2007-05-14T13:44:29.996577', '14531', '2'), + ('6.99', '3', '2007-02-17T03:43:41.996577', '1911', '2'), + ('2.99', '168', '2007-03-20T22:39:42.996577', '14090', '1'), + ('2.99', '166', '2007-02-15T15:38:14.996577', '1412', '2'), + ('5.99', '226', '2007-03-23T20:34:41.996577', '16033', '1'), + ('2.99', '378', '2007-03-22T05:21:15.996577', '14971', '1'), + ('4.99', '326', '2007-04-28T10:52:07.996577', '7931', '2'), + ('2.99', '289', '2007-04-30T22:25:21.996577', '9498', '1'), + ('4.99', '446', '2007-04-29T14:17:29.996577', '8670', '2'), + ('5.99', '145', '2007-03-17T14:07:52.996577', '11904', '2'), + ('2.99', '141', '2007-03-02T17:58:13.996577', '11411', '1'), + ('3.99', '529', '2007-03-19T10:39:23.996577', '13132', '2'), + ('5.99', '323', '2007-04-28T02:09:39.996577', '7695', '2'), + ('4.99', '459', '2007-04-30T07:44:04.996577', '9744', '1'), + ('2.99', '400', '2007-04-26T23:36:52.996577', '6994', '2'), + ('3.99', '108', '2007-03-21T17:20:09.996577', '14635', '2'), + ('6.99', '62', '2007-02-15T03:28:09.996577', '1241', '2'), + ('0.99', '515', '2007-02-18T22:21:41.996577', '2513', '2'), + ('2.99', '348', '2007-03-19T14:49:22.996577', '13238', '2'), + ('5.99', '210', '2007-04-28T04:04:39.996577', '7743', '1'), + ('0.99', '151', '2007-04-12T12:09:42.996577', '6720', '2'), + ('4.99', '550', '2007-03-23T18:35:36.996577', '15977', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['27252', '25156', '18004', '24242', '18717', '18632', '31438', '22614', '25251', '19442', '29718', '22048', '20096', '20838', '26712', '26208', '17648', '29224', '21340', '22651', '29684', '19768', '31535', '24360', '22131', '23120', '18206', '31904', '30565', '30867', '18629', '29940', '19036', '20180', '31731', '26139', '29936', '21833', '19535', '32062', '20016', '29995', '26691', '21749', '18556', '17958', '27010', '18549', '26671', '31953', '25427', '28932', '17515', '28657', '28544', '28616', '20354', '28459', '27396', '30227', '25310', '24904', '25997', '30886', '30150', '30974', '18875', '18975', '29073', '29243', '30528', '27458', '21922', '22958', '20901', '18022', '20602', '24296', '30560', '24113', '29232', '30969', '24674', '18383', '25771', '19848', '25292', '24563', '19450', '24619', '21352', '31064', '20160', '30618', '22017', '30289', '21101', '23989', '30850', '22164']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('2.99', '451', '2007-04-27T00:48:48.996577', '7018', '1'), + ('6.99', '266', '2007-03-20T02:38:52.996577', '13556', '1'), + ('2.99', '468', '2007-02-17T08:00:36.996577', '1975', '1'), + ('0.99', '161', '2007-03-22T06:23:24.996577', '15000', '1'), + ('0.99', '53', '2007-02-21T01:29:36.996577', '3244', '2'), + ('4.99', '31', '2007-02-19T08:34:46.996577', '2648', '2'), + ('2.99', '225', '2007-04-11T08:24:00.996577', '6159', '1'), + ('2.99', '598', '2007-03-22T18:22:52.996577', '15307', '2'), + ('8.99', '276', '2007-04-30T12:06:43.996577', '9229', '1'), + ('7.99', '251', '2007-02-21T15:53:06.996577', '3422', '2'), + ('3.99', '65', '2007-04-30T14:40:54.996577', '9293', '1'), + ('5.99', '534', '2007-03-18T18:36:12.996577', '12691', '1'), + ('2.99', '330', '2007-03-17T19:53:13.996577', '12062', '1'), + ('2.99', '407', '2007-03-02T11:00:54.996577', '11222', '1'), + ('7.99', '403', '2007-04-30T22:04:08.996577', '9486', '2'), + ('0.99', '358', '2007-04-30T01:06:10.996577', '9568', '1'), + ('8.99', '379', '2007-02-15T13:48:32.996577', '1383', '1'), + ('3.99', '23', '2007-04-06T10:12:10.996577', '3736', '2'), + ('7.99', '459', '2007-03-01T09:28:46.996577', '10499', '1'), + ('2.99', '205', '2007-03-20T15:49:15.996577', '13935', '1'), + ('0.99', '63', '2007-04-30T03:37:58.996577', '9007', '2'), + ('2.99', '292', '2007-03-22T11:06:46.996577', '15117', '1'), + ('0.99', '232', '2007-04-30T13:31:42.996577', '9270', '2'), + ('0.99', '175', '2007-03-18T11:50:18.996577', '12509', '1'), + ('1.99', '543', '2007-03-23T12:14:53.996577', '15785', '1'), + ('7.99', '45', '2007-03-23T20:41:30.996577', '16037', '2'), + ('4.99', '526', '2007-02-15T04:42:11.996577', '1255', '1'), + ('0.99', '265', '2007-04-29T14:07:55.996577', '8665', '2'), + ('3.99', '138', '2007-04-29T05:34:29.996577', '8424', '1'), + ('7.99', '165', '2007-04-30T10:35:24.996577', '9182', '2'), + ('7.99', '31', '2007-02-18T14:18:14.996577', '2396', '1'), + ('2.99', '86', '2007-04-07T11:34:18.996577', '4235', '1'), + ('2.99', '139', '2007-02-14T22:11:22.996577', '1169', '2'), + ('0.99', '339', '2007-03-18T16:21:17.996577', '12631', '1'), + ('2.99', '249', '2007-04-28T06:24:26.996577', '7804', '1'), + ('5.99', '352', '2007-04-28T07:46:33.996577', '7845', '1'), + ('4.99', '85', '2007-04-30T14:32:21.996577', '9957', '2'), + ('8.99', '512', '2007-03-19T04:41:10.996577', '12957', '2'), + ('4.99', '268', '2007-03-21T04:06:31.996577', '14249', '2'), + ('7.98', '163', '2007-05-14T13:44:29.996577', '11754', '2'), + ('6.99', '321', '2007-03-17T18:43:00.996577', '12033', '1'), + ('1.99', '90', '2007-04-27T02:19:12.996577', '7058', '2'), + ('6.99', '402', '2007-04-06T01:30:39.996577', '3564', '2'), + ('9.99', '502', '2007-03-19T08:00:08.996577', '13052', '1'), + ('7.99', '16', '2007-02-20T05:38:35.996577', '2960', '1'), + ('4.99', '457', '2007-02-15T18:05:05.996577', '1453', '2'), + ('1.99', '429', '2007-04-28T18:34:14.996577', '8136', '2'), + ('8.99', '13', '2007-02-20T11:13:59.996577', '3047', '1'), + ('2.99', '400', '2007-04-08T07:48:35.996577', '4645', '1'), + ('0.99', '405', '2007-05-14T13:44:29.996577', '12792', '1'), + ('2.99', '291', '2007-04-12T15:12:42.996577', '6796', '1'), + ('0.99', '204', '2007-04-09T06:41:51.996577', '5145', '2'), + ('0.99', '343', '2007-02-17T04:32:51.996577', '1922', '2'), + ('1.99', '579', '2007-04-12T16:40:24.996577', '6814', '2'), + ('4.99', '570', '2007-04-10T05:01:15.996577', '5638', '2'), + ('0.99', '576', '2007-04-06T17:24:51.996577', '3889', '2'), + ('2.99', '357', '2007-03-02T05:26:21.996577', '11065', '2'), + ('0.99', '562', '2007-04-28T18:25:57.996577', '8132', '2'), + ('3.99', '466', '2007-04-30T11:11:50.996577', '9202', '1'), + ('4.99', '109', '2007-04-08T20:11:47.996577', '4921', '1'), + ('3.99', '282', '2007-04-27T19:54:43.996577', '7534', '2'), + ('1.99', '241', '2007-03-02T18:25:39.996577', '11423', '1'), + ('4.99', '339', '2007-04-30T04:39:14.996577', '9663', '1'), + ('0.99', '167', '2007-04-09T08:55:14.996577', '5191', '1'), + ('2.99', '102', '2007-04-30T10:54:52.996577', '9192', '1'), + ('4.99', '174', '2007-04-09T18:58:02.996577', '5414', '2'), + ('7.99', '96', '2007-02-15T15:53:33.996577', '1413', '2'), + ('7.99', '122', '2007-02-15T17:24:00.996577', '1442', '2'), + ('5.99', '8', '2007-04-05T21:29:47.996577', '3475', '1'), + ('4.99', '24', '2007-04-30T01:44:03.996577', '8947', '1'), + ('6.99', '135', '2007-04-30T03:06:02.996577', '8987', '1'), + ('2.99', '470', '2007-04-30T05:21:20.996577', '9687', '1'), + ('2.99', '520', '2007-03-23T00:42:12.996577', '15492', '2'), + ('4.99', '28', '2007-03-20T10:39:29.996577', '13783', '2'), + ('0.99', '413', '2007-03-02T20:15:52.996577', '11468', '1'), + ('0.99', '472', '2007-02-21T01:55:36.996577', '3254', '1'), + ('3.99', '382', '2007-03-01T03:24:01.996577', '10327', '2'), + ('4.99', '168', '2007-03-20T01:57:54.996577', '13532', '2'), + ('0.99', '138', '2007-04-12T19:38:30.996577', '6892', '1'), + ('4.99', '149', '2007-03-17T17:18:10.996577', '12000', '1'), + ('0.99', '23', '2007-04-29T16:09:40.996577', '8718', '2'), + ('4.99', '173', '2007-04-29T20:07:33.996577', '8808', '2'), + ('2.99', '214', '2007-03-02T19:14:20.996577', '11450', '2'), + ('2.99', '576', '2007-02-16T15:06:14.996577', '1742', '2'), + ('4.99', '320', '2007-04-29T19:28:04.996577', '8794', '2'), + ('5.99', '300', '2007-03-20T08:19:18.996577', '13717', '1'), + ('0.99', '280', '2007-04-29T23:59:51.996577', '8912', '1'), + ('0.99', '197', '2007-03-01T15:25:02.996577', '10666', '2'), + ('4.99', '253', '2007-02-17T20:24:09.996577', '2142', '1'), + ('2.99', '201', '2007-03-23T15:22:35.996577', '15887', '1'), + ('2.99', '460', '2007-03-16T23:33:43.996577', '11554', '2'), + ('2.99', '182', '2007-04-05T22:53:23.996577', '3509', '1'), + ('4.99', '337', '2007-03-20T07:06:50.996577', '13678', '1'), + ('1.99', '143', '2007-04-30T12:31:16.996577', '9889', '2'), + ('8.99', '531', '2007-03-19T17:15:22.996577', '13300', '2'), + ('0.99', '115', '2007-04-06T00:34:58.996577', '3544', '2'), + ('0.99', '435', '2007-03-17T19:16:12.996577', '12046', '2'), + ('3.99', '139', '2007-03-19T20:44:42.996577', '13401', '2'), + ('2.99', '164', '2007-04-12T03:44:33.996577', '6558', '2'), + ('0.99', '547', '2007-03-18T14:16:15.996577', '12579', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['24573', '21990', '26341', '18763', '23091', '19373', '24706', '27254', '24091', '20797', '26136', '22685', '31650', '18504', '27710', '20379', '31426', '29443', '22092', '30880', '32006', '26783', '22104', '22681', '21174', '27896', '23725', '29317', '21842', '24713', '23515', '27531', '25506', '24790', '17974', '18328', '24651', '19598', '19593', '18968', '27192', '20902', '28722', '22298', '26026', '18634', '24218', '28323', '25955', '22249', '23014', '29911', '20384', '24421', '30759', '18538', '21538', '22408', '25793', '18355', '23044', '29856', '29254', '19345', '32096', '29152', '28028', '28104', '26090', '30506', '25580', '17970', '17817', '27739', '20454', '23594', '26028', '22043', '22334', '28768', '18322', '24738', '28127', '26833', '20628', '17775', '18612', '21612', '27394', '20914', '19499', '30367', '26186', '22291', '22267', '21921', '19327', '17536', '29816', '25012']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('9.99', '197', '2007-03-20T21:19:51.996577', '14069', '1'), + ('6.99', '528', '2007-03-23T15:12:20.996577', '15880', '2'), + ('7.99', '369', '2007-04-09T22:48:49.996577', '5496', '2'), + ('3.99', '67', '2007-02-17T14:26:22.996577', '2064', '1'), + ('5.99', '42', '2007-03-02T01:23:19.996577', '10935', '1'), + ('3.99', '234', '2007-02-15T03:37:27.996577', '1245', '2'), + ('6.99', '217', '2007-03-01T21:58:24.996577', '10836', '1'), + ('2.99', '452', '2007-04-06T12:53:22.996577', '3791', '1'), + ('6.99', '147', '2007-03-23T19:21:46.996577', '16004', '2'), + ('2.99', '403', '2007-03-02T18:31:05.996577', '11427', '2'), + ('7.99', '352', '2007-04-27T15:32:41.996577', '7419', '1'), + ('0.99', '1', '2007-03-19T08:23:42.996577', '13068', '2'), + ('6.99', '241', '2007-04-30T22:27:02.996577', '9500', '1'), + ('6.99', '3', '2007-02-16T13:47:36.996577', '1726', '1'), + ('2.99', '493', '2007-04-27T01:17:24.996577', '7026', '1'), + ('7.99', '360', '2007-03-20T14:23:46.996577', '13894', '2'), + ('2.99', '224', '2007-04-08T09:47:40.996577', '4697', '1'), + ('0.99', '40', '2007-04-28T14:44:15.996577', '8031', '2'), + ('2.99', '539', '2007-03-19T00:33:37.996577', '12848', '1'), + ('5.99', '166', '2007-04-28T15:25:57.996577', '8052', '1'), + ('2.99', '590', '2007-05-14T13:44:29.996577', '15458', '2'), + ('3.99', '409', '2007-04-09T08:02:54.996577', '5175', '1'), + ('2.99', '540', '2007-03-22T09:38:22.996577', '15079', '2'), + ('3.99', '1', '2007-03-02T14:05:18.996577', '11299', '2'), + ('0.99', '442', '2007-03-21T11:31:39.996577', '14466', '1'), + ('2.99', '509', '2007-04-08T16:35:31.996577', '4832', '2'), + ('5.99', '113', '2007-03-17T12:40:11.996577', '11872', '1'), + ('2.99', '30', '2007-04-27T14:31:34.996577', '7394', '2'), + ('4.99', '512', '2007-03-23T18:53:37.996577', '15990', '2'), + ('2.99', '217', '2007-03-22T17:31:14.996577', '15277', '2'), + ('2.99', '86', '2007-03-20T13:40:14.996577', '13874', '1'), + ('6.99', '477', '2007-04-29T08:23:46.996577', '8515', '1'), + ('5.99', '297', '2007-04-08T20:34:44.996577', '4929', '1'), + ('4.99', '227', '2007-03-23T18:35:34.996577', '15976', '2'), + ('0.99', '459', '2007-02-20T11:10:26.996577', '3045', '2'), + ('4.99', '561', '2007-02-20T04:37:02.996577', '2950', '1'), + ('2.99', '211', '2007-03-20T15:59:18.996577', '13942', '2'), + ('7.99', '274', '2007-03-21T01:26:28.996577', '14164', '2'), + ('2.99', '274', '2007-03-19T09:34:17.996577', '13103', '1'), + ('2.99', '120', '2007-02-17T05:23:07.996577', '1932', '2'), + ('0.99', '445', '2007-04-30T16:23:24.996577', '10007', '1'), + ('0.99', '413', '2007-03-16T23:02:40.996577', '11532', '1'), + ('0.99', '584', '2007-04-08T22:44:16.996577', '4977', '1'), + ('0.99', '562', '2007-03-20T05:50:33.996577', '13639', '2'), + ('5.99', '343', '2007-04-06T21:32:59.996577', '3978', '1'), + ('1.99', '31', '2007-02-20T20:47:51.996577', '3172', '2'), + ('0.99', '159', '2007-03-22T14:42:51.996577', '15197', '1'), + ('2.99', '549', '2007-04-05T23:30:04.996577', '3523', '2'), + ('4.99', '336', '2007-04-11T14:02:16.996577', '6263', '2'), + ('2.99', '557', '2007-03-20T02:09:49.996577', '13540', '1'), + ('2.99', '34', '2007-03-18T03:26:25.996577', '12286', '2'), + ('0.99', '83', '2007-04-09T10:25:38.996577', '5218', '1'), + ('5.99', '361', '2007-03-02T04:21:24.996577', '11031', '2'), + ('6.99', '181', '2007-03-01T04:23:39.996577', '10362', '2'), + ('0.99', '155', '2007-04-30T19:09:43.996577', '10098', '1'), + ('7.99', '11', '2007-02-17T05:55:11.996577', '1939', '1'), + ('0.99', '477', '2007-03-19T06:06:24.996577', '13002', '1'), + ('4.99', '574', '2007-03-20T04:15:51.996577', '13589', '1'), + ('4.99', '322', '2007-04-30T07:42:21.996577', '9115', '1'), + ('4.99', '570', '2007-02-15T16:14:17.996577', '1417', '2'), + ('0.99', '37', '2007-03-19T22:28:50.996577', '13444', '2'), + ('0.99', '78', '2007-04-08T14:20:17.996577', '4778', '2'), + ('8.99', '25', '2007-04-30T08:40:27.996577', '9140', '1'), + ('7.99', '225', '2007-02-18T02:08:22.996577', '2226', '2'), + ('4.99', '252', '2007-05-14T13:44:29.996577', '13756', '2'), + ('4.99', '14', '2007-04-30T20:04:41.996577', '9438', '2'), + ('1.99', '521', '2007-04-30T13:56:36.996577', '9937', '2'), + ('0.99', '527', '2007-04-29T22:08:33.996577', '8854', '1'), + ('4.99', '348', '2007-04-09T15:56:44.996577', '5345', '1'), + ('6.99', '133', '2007-04-29T04:18:35.996577', '8389', '2'), + ('4.99', '303', '2007-04-11T11:47:03.996577', '6219', '2'), + ('2.99', '459', '2007-02-17T08:06:48.996577', '1977', '2'), + ('8.99', '423', '2007-02-20T12:49:57.996577', '3072', '1'), + ('5.99', '495', '2007-04-29T14:18:14.996577', '8672', '1'), + ('4.99', '368', '2007-03-18T22:50:50.996577', '12796', '1'), + ('4.99', '95', '2007-03-21T02:20:18.996577', '14203', '2'), + ('4.99', '343', '2007-04-09T04:38:17.996577', '5097', '2'), + ('5.99', '534', '2007-03-01T08:13:51.996577', '10465', '2'), + ('8.99', '565', '2007-03-20T15:34:00.996577', '13925', '1'), + ('4.99', '588', '2007-04-29T05:29:13.996577', '8421', '1'), + ('2.99', '561', '2007-02-14T23:52:46.996577', '1193', '2'), + ('4.99', '220', '2007-03-20T19:20:29.996577', '14016', '2'), + ('5.99', '529', '2007-04-30T02:48:51.996577', '8979', '1'), + ('0.99', '413', '2007-04-27T23:36:37.996577', '7635', '1'), + ('2.99', '385', '2007-03-02T03:58:37.996577', '11021', '1'), + ('8.99', '409', '2007-02-18T07:14:25.996577', '2310', '2'), + ('0.99', '28', '2007-02-19T04:58:36.996577', '2604', '2'), + ('0.99', '486', '2007-03-20T11:14:43.996577', '13803', '2'), + ('2.99', '466', '2007-04-27T02:53:51.996577', '7080', '2'), + ('7.99', '414', '2007-03-19T17:28:08.996577', '13308', '1'), + ('4.99', '264', '2007-02-15T00:55:33.996577', '1206', '1'), + ('0.99', '122', '2007-04-11T12:31:02.996577', '6231', '2'), + ('5.99', '356', '2007-04-30T02:38:44.996577', '8975', '1'), + ('0.99', '561', '2007-03-23T03:57:02.996577', '15573', '1'), + ('6.99', '559', '2007-03-19T15:16:07.996577', '13248', '2'), + ('0.99', '520', '2007-03-22T23:44:59.996577', '15465', '1'), + ('2.99', '218', '2007-02-15T18:54:19.996577', '1459', '1'), + ('0.99', '348', '2007-02-18T21:30:02.996577', '2499', '2'), + ('0.99', '75', '2007-04-06T09:14:41.996577', '3711', '1'), + ('7.99', '253', '2007-03-21T17:31:45.996577', '14640', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['27712', '27066', '23848', '28490', '26222', '31311', '21485', '26523', '27872', '18376', '25601', '22290', '28699', '29422', '29287', '27609', '28056', '27200', '22916', '18099', '25328', '17786', '30931', '30041', '30156', '24311', '29056', '26237', '18270', '19542', '18207', '19037', '26758', '29803', '22841', '23651', '25113', '19099', '25391', '18140', '31455', '31210', '23804', '19315', '20863', '19316', '29132', '23976', '31563', '28169', '18530', '25315', '17615', '29931', '20446', '31747', '26737', '28666', '22596', '29655', '27155', '23932', '28704', '22792', '29265', '19506', '22627', '20353', '25951', '20909', '27779', '20269', '18176', '24819', '26574', '18330', '22875', '29825', '31878', '23776', '17673', '19918', '20156', '29935', '30373', '31906', '28051', '24289', '19563', '23635', '21267', '18900', '26278', '28734', '25737', '24966', '24677', '22652', '19621', '19397']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('4.99', '493', '2007-04-29T01:16:02.996577', '8298', '1'), + ('5.99', '435', '2007-04-29T04:13:56.996577', '8386', '1'), + ('2.99', '125', '2007-03-22T08:43:05.996577', '15055', '1'), + ('2.99', '565', '2007-04-11T14:11:01.996577', '6264', '1'), + ('1.99', '360', '2007-04-10T15:12:38.996577', '5834', '1'), + ('3.99', '212', '2007-04-08T15:13:42.996577', '4798', '2'), + ('1.99', '471', '2007-03-23T07:03:19.996577', '15654', '1'), + ('4.99', '385', '2007-04-30T06:07:58.996577', '9704', '1'), + ('6.99', '507', '2007-04-11T19:00:10.996577', '6351', '1'), + ('0.99', '574', '2007-02-16T19:49:18.996577', '1817', '1'), + ('2.99', '305', '2007-04-08T07:25:46.996577', '4638', '1'), + ('0.99', '561', '2007-03-21T00:32:59.996577', '14139', '2'), + ('4.99', '582', '2007-04-27T04:41:39.996577', '7126', '2'), + ('2.99', '38', '2007-04-30T19:36:59.996577', '10111', '2'), + ('5.99', '28', '2007-04-10T14:17:38.996577', '5817', '1'), + ('0.99', '484', '2007-04-29T08:03:04.996577', '8508', '2'), + ('2.99', '523', '2007-04-30T06:09:24.996577', '9071', '1'), + ('5.99', '446', '2007-04-27T00:07:02.996577', '7005', '1'), + ('2.99', '24', '2007-03-18T20:51:11.996577', '12745', '1'), + ('8.99', '497', '2007-02-17T23:16:09.996577', '2180', '2'), + ('0.99', '283', '2007-04-27T18:52:57.996577', '7504', '1'), + ('5.99', '413', '2007-02-17T19:29:10.996577', '2130', '2'), + ('2.99', '170', '2007-04-10T13:45:59.996577', '5808', '2'), + ('2.99', '93', '2007-04-27T11:18:49.996577', '7301', '1'), + ('6.99', '103', '2007-04-07T01:31:06.996577', '4040', '2'), + ('0.99', '170', '2007-03-02T04:29:19.996577', '11039', '1'), + ('5.99', '6', '2007-04-11T11:07:27.996577', '6211', '2'), + ('0.99', '361', '2007-04-11T07:54:18.996577', '6152', '1'), + ('5.99', '543', '2007-02-21T20:47:51.996577', '3467', '2'), + ('3.99', '269', '2007-03-17T14:33:54.996577', '11915', '1'), + ('0.99', '526', '2007-02-16T22:35:33.996577', '1848', '2'), + ('2.99', '139', '2007-02-16T14:20:58.996577', '1736', '1'), + ('0.99', '407', '2007-04-07T14:44:29.996577', '4296', '1'), + ('4.99', '73', '2007-04-29T03:56:06.996577', '8377', '1'), + ('6.99', '16', '2007-03-19T23:38:53.996577', '13480', '1'), + ('2.99', '104', '2007-03-17T05:40:57.996577', '11700', '1'), + ('0.99', '262', '2007-03-22T23:35:27.996577', '15456', '1'), + ('2.99', '154', '2007-02-20T07:13:34.996577', '2985', '1'), + ('3.99', '288', '2007-04-12T02:28:08.996577', '6518', '2'), + ('4.99', '508', '2007-02-16T08:41:23.996577', '1661', '2'), + ('5.99', '226', '2007-04-27T10:53:25.996577', '7288', '2'), + ('6.99', '197', '2007-04-09T08:36:36.996577', '5182', '2'), + ('8.99', '121', '2007-03-17T06:15:20.996577', '11720', '2'), + ('4.99', '215', '2007-02-16T22:24:37.996577', '1845', '2'), + ('6.99', '409', '2007-03-20T05:39:18.996577', '13632', '2'), + ('2.99', '215', '2007-02-17T10:15:29.996577', '2006', '2'), + ('0.99', '13', '2007-04-12T18:42:11.996577', '6870', '1'), + ('4.99', '138', '2007-03-02T03:41:26.996577', '11015', '1'), + ('0.99', '235', '2007-04-28T17:52:50.996577', '8120', '1'), + ('4.99', '533', '2007-04-08T14:46:01.996577', '4788', '1'), + ('7.99', '9', '2007-02-20T18:27:54.996577', '3142', '2'), + ('1.99', '282', '2007-04-30T02:37:39.996577', '8973', '2'), + ('4.99', '368', '2007-02-21T04:01:30.996577', '3275', '2'), + ('2.99', '85', '2007-04-08T10:19:04.996577', '4705', '1'), + ('6.99', '367', '2007-03-19T02:52:36.996577', '12911', '2'), + ('2.99', '251', '2007-04-29T06:01:38.996577', '8443', '2'), + ('2.99', '405', '2007-04-29T07:14:59.996577', '8482', '2'), + ('2.99', '579', '2007-04-30T15:26:15.996577', '9976', '2'), + ('3.99', '596', '2007-03-20T20:37:30.996577', '14050', '1'), + ('8.99', '59', '2007-04-30T21:25:00.996577', '9469', '1'), + ('4.99', '442', '2007-04-12T05:36:47.996577', '6590', '2'), + ('6.99', '133', '2007-03-23T19:36:25.996577', '16009', '1'), + ('2.99', '582', '2007-04-29T09:44:55.996577', '8554', '1'), + ('0.99', '12', '2007-03-20T01:05:33.996577', '13519', '2'), + ('2.99', '26', '2007-04-09T20:00:55.996577', '5437', '1'), + ('4.99', '266', '2007-02-17T14:32:12.996577', '2065', '2'), + ('4.99', '202', '2007-03-19T13:08:58.996577', '13196', '1'), + ('0.99', '357', '2007-03-01T19:01:08.996577', '10764', '2'), + ('5.99', '336', '2007-04-07T16:24:19.996577', '4323', '2'), + ('2.99', '413', '2007-03-23T07:52:11.996577', '15678', '1'), + ('4.99', '498', '2007-04-30T05:28:34.996577', '9689', '2'), + ('7.99', '348', '2007-03-02T18:32:18.996577', '11429', '1'), + ('0.99', '516', '2007-02-17T11:01:56.996577', '2017', '1'), + ('0.99', '231', '2007-03-20T19:49:34.996577', '14026', '1'), + ('0.99', '390', '2007-04-29T07:32:57.996577', '8493', '1'), + ('0.99', '561', '2007-02-21T16:59:35.996577', '3427', '1'), + ('0.99', '20', '2007-03-22T16:21:32.996577', '15248', '2'), + ('2.99', '75', '2007-04-12T18:02:15.996577', '6852', '2'), + ('6.99', '264', '2007-04-06T04:27:11.996577', '3618', '1'), + ('2.99', '119', '2007-03-01T11:18:10.996577', '10552', '2'), + ('7.99', '383', '2007-02-19T05:41:38.996577', '2609', '1'), + ('2.99', '308', '2007-03-17T08:23:54.996577', '11765', '1'), + ('2.99', '337', '2007-03-02T12:10:39.996577', '11252', '2'), + ('7.99', '85', '2007-04-30T19:44:59.996577', '9427', '2'), + ('2.99', '122', '2007-04-28T16:23:01.996577', '8077', '1'), + ('0.99', '266', '2007-04-06T02:51:02.996577', '3585', '2'), + ('2.99', '523', '2007-04-10T20:33:41.996577', '5932', '2'), + ('0.99', '168', '2007-03-01T01:38:50.996577', '10270', '2'), + ('2.99', '271', '2007-03-02T18:33:42.996577', '11431', '1'), + ('4.99', '102', '2007-03-02T06:35:38.996577', '11099', '2'), + ('2.99', '451', '2007-03-19T15:19:16.996577', '13252', '2'), + ('0.99', '103', '2007-02-18T00:18:53.996577', '2197', '1'), + ('0.99', '364', '2007-04-07T01:57:15.996577', '4047', '1'), + ('2.99', '585', '2007-04-09T13:36:47.996577', '5284', '2'), + ('2.99', '317', '2007-04-27T11:28:55.996577', '7309', '1'), + ('4.99', '247', '2007-03-18T11:17:11.996577', '12491', '1'), + ('2.99', '214', '2007-03-19T10:58:27.996577', '13138', '2'), + ('0.99', '205', '2007-03-21T07:04:29.996577', '14338', '1'), + ('2.99', '276', '2007-03-01T19:00:53.996577', '10763', '1'), + ('4.99', '238', '2007-02-16T08:41:21.996577', '1660', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['18700', '23337', '18095', '24338', '17574', '21153', '31540', '20604', '25641', '27285', '19669', '28731', '20383', '28781', '31230', '18841', '27381', '30975', '21646', '23503', '18433', '20719', '28298', '28921', '24005', '30661', '20779', '17605', '24461', '30135', '30569', '21453', '20722', '22525', '18211', '19616', '30372', '28337', '29635', '21206', '30337', '28689', '19837', '22414', '30402', '20417', '18554', '28711', '21641', '30138', '31051', '23050', '25219', '27998', '25796', '19355', '22654', '22776', '25679', '31945', '26665', '27751', '27987', '29065', '19637', '19233', '26218', '28012', '18588', '21450', '19131', '24217', '20701', '22997', '24138', '24076', '22339', '19842', '31657', '23584', '27611', '19452', '22418', '26938', '23238', '20978', '30821', '22510', '20991', '27923', '19088', '22784', '21214', '23611', '30637', '24425', '23402', '29169', '22289', '20801']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('0.99', '49', '2007-02-16T10:39:46.996577', '1688', '2'), + ('1.99', '68', '2007-03-22T04:36:18.996577', '14947', '1'), + ('4.99', '495', '2007-02-18T10:53:40.996577', '2349', '1'), + ('2.99', '172', '2007-03-23T06:22:04.996577', '15637', '2'), + ('2.99', '358', '2007-02-21T01:34:37.996577', '3245', '1'), + ('0.99', '440', '2007-03-19T00:36:32.996577', '12850', '1'), + ('5.99', '233', '2007-04-06T23:28:12.996577', '4015', '1'), + ('0.99', '382', '2007-03-18T12:22:02.996577', '12529', '2'), + ('0.99', '308', '2007-04-29T22:34:58.996577', '8869', '2'), + ('9.99', '454', '2007-04-30T17:32:56.996577', '9372', '1'), + ('2.99', '279', '2007-03-23T05:18:53.996577', '15606', '1'), + ('4.99', '585', '2007-04-07T07:32:17.996577', '4156', '2'), + ('0.99', '361', '2007-03-02T02:39:51.996577', '10975', '2'), + ('0.99', '589', '2007-04-28T15:32:41.996577', '8056', '2'), + ('2.99', '198', '2007-04-30T20:47:09.996577', '10147', '1'), + ('2.99', '87', '2007-02-17T03:14:07.996577', '1904', '1'), + ('2.99', '463', '2007-04-30T14:25:33.996577', '9954', '1'), + ('4.99', '174', '2007-04-12T20:37:56.996577', '6909', '1'), + ('7.99', '490', '2007-03-02T02:01:00.996577', '10955', '1'), + ('0.99', '85', '2007-03-17T18:47:32.996577', '12036', '2'), + ('7.99', '590', '2007-02-15T18:28:37.996577', '1456', '2'), + ('4.99', '394', '2007-03-01T03:05:45.996577', '10319', '1'), + ('0.99', '546', '2007-04-08T11:40:38.996577', '4734', '1'), + ('8.99', '202', '2007-04-30T21:14:00.996577', '9467', '2'), + ('3.99', '141', '2007-03-01T02:05:27.996577', '10287', '1'), + ('2.99', '147', '2007-04-06T20:30:17.996577', '3956', '2'), + ('2.99', '401', '2007-03-17T10:53:59.996577', '11820', '1'), + ('2.99', '365', '2007-02-18T23:16:48.996577', '2525', '1'), + ('2.99', '185', '2007-03-18T04:35:52.996577', '12312', '1'), + ('4.99', '102', '2007-04-06T06:51:34.996577', '3665', '2'), + ('0.99', '138', '2007-04-30T19:34:38.996577', '10110', '1'), + ('0.99', '469', '2007-03-17T18:46:32.996577', '12035', '2'), + ('4.99', '394', '2007-03-17T20:36:30.996577', '12080', '1'), + ('6.99', '587', '2007-03-18T05:14:59.996577', '12330', '2'), + ('4.99', '526', '2007-02-18T14:25:19.996577', '2398', '2'), + ('5.99', '275', '2007-03-21T12:12:25.996577', '14483', '2'), + ('4.99', '122', '2007-04-28T11:49:26.996577', '7950', '2'), + ('6.99', '550', '2007-04-29T12:34:50.996577', '8628', '1'), + ('2.99', '57', '2007-04-30T09:56:33.996577', '9812', '2'), + ('0.99', '445', '2007-03-20T04:08:59.996577', '13586', '2'), + ('4.99', '119', '2007-04-29T01:36:56.996577', '8304', '1'), + ('1.99', '581', '2007-04-08T16:36:01.996577', '4833', '1'), + ('4.99', '299', '2007-03-19T08:23:46.996577', '13069', '1'), + ('3.99', '575', '2007-03-02T06:34:12.996577', '11097', '1'), + ('0.99', '125', '2007-04-28T10:33:51.996577', '7922', '2'), + ('1.99', '364', '2007-03-18T21:33:48.996577', '12761', '1'), + ('6.99', '16', '2007-02-17T05:33:23.996577', '1934', '2'), + ('0.99', '583', '2007-04-09T21:25:19.996577', '5462', '1'), + ('2.99', '489', '2007-03-21T06:46:46.996577', '14328', '2'), + ('6.99', '102', '2007-04-08T23:34:29.996577', '4997', '1'), + ('3.99', '180', '2007-04-30T15:59:13.996577', '9995', '2'), + ('0.99', '37', '2007-03-23T16:00:45.996577', '15904', '1'), + ('5.99', '273', '2007-04-30T13:54:34.996577', '9285', '2'), + ('3.99', '519', '2007-04-12T06:09:40.996577', '6599', '1'), + ('1.99', '323', '2007-04-08T04:05:25.996577', '4572', '2'), + ('3.99', '228', '2007-02-21T17:35:45.996577', '3433', '2'), + ('2.99', '205', '2007-03-21T10:28:47.996577', '14442', '1'), + ('2.99', '10', '2007-03-17T18:40:01.996577', '12031', '2'), + ('5.99', '312', '2007-04-09T01:05:03.996577', '5031', '1'), + ('3.98', '361', '2007-05-14T13:44:29.996577', '13298', '1'), + ('2.99', '399', '2007-04-11T00:07:08.996577', '6006', '2'), + ('2.99', '497', '2007-04-06T08:33:21.996577', '3696', '1'), + ('4.99', '518', '2007-04-27T05:44:43.996577', '7154', '2'), + ('4.99', '7', '2007-04-08T17:16:04.996577', '4856', '1'), + ('4.99', '277', '2007-03-19T10:22:15.996577', '13122', '1'), + ('2.99', '189', '2007-02-21T09:35:19.996577', '3346', '1'), + ('5.99', '359', '2007-04-30T22:08:34.996577', '10174', '2'), + ('2.99', '520', '2007-04-11T01:05:12.996577', '6029', '1'), + ('4.99', '25', '2007-02-15T10:46:00.996577', '1338', '1'), + ('2.99', '469', '2007-03-01T15:07:44.996577', '10658', '1'), + ('0.99', '163', '2007-02-20T21:06:25.996577', '3179', '1'), + ('8.99', '159', '2007-03-21T15:20:00.996577', '14575', '2'), + ('6.99', '392', '2007-03-18T06:26:04.996577', '12368', '1'), + ('1.99', '32', '2007-03-20T15:44:36.996577', '13931', '1'), + ('4.99', '151', '2007-03-22T01:00:17.996577', '14856', '1'), + ('6.99', '146', '2007-03-23T14:04:31.996577', '15842', '1'), + ('0.99', '566', '2007-03-17T06:12:35.996577', '11717', '1'), + ('4.99', '300', '2007-03-02T02:40:43.996577', '10977', '1'), + ('5.99', '242', '2007-04-10T06:38:55.996577', '5666', '2'), + ('1.99', '93', '2007-03-23T16:16:56.996577', '15913', '2'), + ('9.99', '484', '2007-04-30T19:14:28.996577', '9414', '2'), + ('4.99', '253', '2007-02-19T07:41:32.996577', '2636', '2'), + ('5.99', '575', '2007-03-18T21:57:26.996577', '12770', '2'), + ('9.99', '423', '2007-04-29T11:16:09.996577', '8595', '2'), + ('4.99', '58', '2007-03-01T01:15:37.996577', '10256', '2'), + ('7.99', '419', '2007-03-18T09:53:39.996577', '12460', '1'), + ('6.99', '161', '2007-04-07T12:27:46.996577', '4248', '2'), + ('6.99', '585', '2007-03-23T15:38:22.996577', '15896', '1'), + ('4.99', '421', '2007-03-18T03:15:56.996577', '12279', '1'), + ('6.99', '511', '2007-04-30T08:50:37.996577', '9143', '1'), + ('2.99', '151', '2007-02-20T04:28:47.996577', '2947', '2'), + ('5.99', '11', '2007-03-17T18:01:10.996577', '12015', '2'), + ('3.99', '446', '2007-03-02T04:52:05.996577', '11051', '1'), + ('2.99', '98', '2007-03-17T06:50:26.996577', '11730', '1'), + ('0.99', '144', '2007-04-30T06:43:58.996577', '9714', '2'), + ('4.99', '181', '2007-03-02T11:09:04.996577', '11224', '2'), + ('3.99', '75', '2007-03-01T17:43:19.996577', '10726', '1'), + ('0.99', '16', '2007-04-27T18:08:04.996577', '7489', '2'), + ('2.99', '561', '2007-03-18T09:16:23.996577', '12441', '2'), + ('2.99', '403', '2007-03-17T22:05:29.996577', '12132', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['30406', '23708', '25409', '19817', '28537', '29688', '19148', '24693', '23740', '26804', '18600', '29883', '30917', '32076', '23059', '20009', '23267', '18484', '21212', '22589', '25227', '28154', '19654', '24313', '31884', '31628', '19069', '19578', '31419', '25611', '19434', '18569', '23459', '28166', '31062', '19049', '25248', '30385', '27378', '31925', '23292', '20023', '26951', '24036', '22708', '23690', '20444', '18251', '22210', '23930', '26734', '30255', '21594', '23524', '18669', '24145', '25516', '21032', '29704', '26823', '27419', '31887', '25278', '29418', '24908', '19675', '28631', '29685', '18982', '18450', '29385', '30595', '21102', '23613', '18919', '25756', '20892', '24972', '29639', '21982', '30083', '31281', '31449', '31202', '24612', '28857', '24046', '19396', '32035', '21902', '31138', '27230', '28714', '29687', '31360', '26929', '29383', '21300', '22745', '21755']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('9.99', '125', '2007-04-30T08:19:47.996577', '9129', '1'), + ('6.99', '111', '2007-03-22T13:55:02.996577', '15174', '2'), + ('0.99', '290', '2007-04-07T03:17:39.996577', '4073', '1'), + ('4.99', '297', '2007-03-20T08:31:25.996577', '13721', '2'), + ('1.99', '569', '2007-04-30T11:45:53.996577', '9220', '2'), + ('2.99', '63', '2007-04-30T13:57:13.996577', '9938', '2'), + ('8.99', '170', '2007-02-18T15:28:00.996577', '2413', '2'), + ('2.99', '215', '2007-03-23T05:24:41.996577', '15610', '2'), + ('0.99', '114', '2007-03-23T21:11:14.996577', '16047', '1'), + ('4.99', '410', '2007-04-27T13:02:40.996577', '7350', '2'), + ('4.99', '26', '2007-02-19T14:49:45.996577', '2745', '1'), + ('5.99', '80', '2007-04-08T09:31:55.996577', '4688', '1'), + ('3.99', '169', '2007-04-11T07:31:03.996577', '6143', '1'), + ('2.99', '199', '2007-05-14T13:44:29.996577', '13952', '2'), + ('2.99', '38', '2007-03-21T17:16:32.996577', '14632', '2'), + ('4.99', '319', '2007-03-22T00:02:31.996577', '14828', '2'), + ('0.99', '60', '2007-03-23T05:58:52.996577', '15632', '1'), + ('0.99', '205', '2007-02-16T16:30:02.996577', '1767', '1'), + ('6.99', '445', '2007-03-23T12:30:39.996577', '15791', '1'), + ('0.99', '596', '2007-03-01T20:50:37.996577', '10804', '2'), + ('0.99', '274', '2007-04-28T23:33:42.996577', '8259', '2'), + ('2.99', '532', '2007-04-07T17:03:02.996577', '4336', '1'), + ('4.99', '278', '2007-03-22T06:05:50.996577', '14986', '1'), + ('3.99', '170', '2007-03-19T05:06:17.996577', '12967', '1'), + ('0.99', '264', '2007-04-12T03:22:58.996577', '6543', '1'), + ('0.99', '240', '2007-04-10T03:11:40.996577', '5596', '1'), + ('0.99', '147', '2007-02-17T22:34:30.996577', '2171', '1'), + ('4.99', '273', '2007-03-02T13:03:29.996577', '11282', '1'), + ('4.99', '223', '2007-04-08T17:52:04.996577', '4874', '1'), + ('5.99', '306', '2007-04-07T23:34:23.996577', '4484', '2'), + ('0.99', '248', '2007-02-18T13:03:55.996577', '2371', '2'), + ('3.99', '20', '2007-02-17T19:45:07.996577', '2136', '2'), + ('5.99', '80', '2007-03-23T19:42:05.996577', '16012', '1'), + ('5.99', '532', '2007-04-29T00:01:42.996577', '8273', '1'), + ('8.99', '181', '2007-04-30T17:05:26.996577', '9357', '1'), + ('1.99', '143', '2007-02-17T02:56:37.996577', '1898', '2'), + ('0.99', '276', '2007-04-30T06:09:05.996577', '9070', '1'), + ('4.99', '123', '2007-04-30T23:33:52.996577', '9529', '2'), + ('0.99', '463', '2007-04-27T13:22:21.996577', '7361', '1'), + ('0.00', '284', '2007-05-14T13:44:29.996577', '12959', '2'), + ('3.99', '63', '2007-03-22T04:07:21.996577', '14931', '1'), + ('0.99', '322', '2007-03-02T19:42:30.996577', '11456', '2'), + ('2.99', '424', '2007-04-30T03:24:12.996577', '8999', '2'), + ('5.99', '143', '2007-03-22T16:31:37.996577', '15250', '1'), + ('2.99', '3', '2007-03-23T05:38:40.996577', '15619', '1'), + ('0.99', '109', '2007-03-01T00:37:59.996577', '10240', '2'), + ('0.99', '367', '2007-03-18T06:16:31.996577', '12362', '2'), + ('4.99', '538', '2007-02-17T03:46:58.996577', '1912', '1'), + ('2.99', '552', '2007-03-20T03:39:05.996577', '13574', '2'), + ('2.99', '133', '2007-03-20T14:59:15.996577', '13910', '2'), + ('2.99', '405', '2007-04-11T05:52:13.996577', '6110', '1'), + ('4.99', '112', '2007-04-28T05:00:11.996577', '7761', '2'), + ('4.99', '484', '2007-03-18T21:57:49.996577', '12771', '1'), + ('0.99', '87', '2007-03-19T23:37:37.996577', '13479', '1'), + ('0.99', '40', '2007-02-21T17:08:00.996577', '3428', '1'), + ('0.99', '152', '2007-03-17T09:07:50.996577', '11783', '2'), + ('0.99', '297', '2007-04-30T20:58:36.996577', '10153', '1'), + ('2.99', '425', '2007-03-23T20:41:10.996577', '16036', '2'), + ('1.99', '64', '2007-04-27T17:37:22.996577', '7476', '1'), + ('0.99', '412', '2007-04-07T03:18:15.996577', '4074', '2'), + ('4.99', '468', '2007-04-27T11:02:40.996577', '7292', '2'), + ('0.99', '264', '2007-04-30T23:03:31.996577', '9515', '2'), + ('0.99', '279', '2007-04-11T09:16:47.996577', '6176', '1'), + ('3.99', '38', '2007-04-30T00:37:24.996577', '8924', '2'), + ('7.99', '241', '2007-03-21T04:50:33.996577', '14269', '2'), + ('9.99', '280', '2007-03-19T14:41:15.996577', '13231', '2'), + ('0.99', '577', '2007-04-06T03:45:02.996577', '3599', '2'), + ('4.99', '63', '2007-04-30T00:16:06.996577', '9546', '1'), + ('0.99', '123', '2007-02-16T15:28:40.996577', '1751', '1'), + ('5.99', '594', '2007-02-15T23:21:17.996577', '1537', '2'), + ('6.99', '35', '2007-04-30T01:27:46.996577', '9579', '1'), + ('4.99', '141', '2007-04-26T23:18:19.996577', '6979', '2'), + ('4.99', '435', '2007-03-18T20:45:31.996577', '12741', '1'), + ('1.99', '98', '2007-03-21T11:16:34.996577', '14459', '2'), + ('2.99', '108', '2007-02-15T16:42:12.996577', '1425', '1'), + ('4.99', '319', '2007-04-11T10:28:58.996577', '6195', '1'), + ('5.99', '412', '2007-03-01T08:14:24.996577', '10467', '1'), + ('0.99', '248', '2007-03-20T15:15:58.996577', '13918', '1'), + ('1.99', '58', '2007-04-09T20:08:01.996577', '5439', '2'), + ('2.99', '527', '2007-03-22T12:17:44.996577', '15144', '1'), + ('7.99', '98', '2007-04-06T07:51:14.996577', '3682', '2'), + ('7.99', '210', '2007-04-07T19:26:29.996577', '4388', '2'), + ('2.99', '225', '2007-04-30T20:30:35.996577', '10138', '2'), + ('0.99', '196', '2007-04-29T15:24:27.996577', '8700', '2'), + ('0.99', '201', '2007-03-17T10:19:41.996577', '11807', '2'), + ('2.99', '595', '2007-04-08T14:12:31.996577', '4775', '2'), + ('2.99', '144', '2007-03-17T20:48:38.996577', '12087', '2'), + ('2.99', '238', '2007-02-15T00:27:16.996577', '1199', '1'), + ('4.99', '64', '2007-05-14T13:44:29.996577', '13333', '2'), + ('0.99', '518', '2007-03-22T05:45:11.996577', '14980', '2'), + ('5.99', '189', '2007-04-11T10:15:23.996577', '6193', '1'), + ('10.99', '448', '2007-04-30T10:27:16.996577', '9178', '1'), + ('6.99', '583', '2007-04-12T10:43:08.996577', '6684', '2'), + ('0.99', '63', '2007-04-30T09:15:45.996577', '9795', '1'), + ('0.99', '218', '2007-04-09T10:39:10.996577', '5226', '1'), + ('2.99', '423', '2007-04-08T09:01:40.996577', '4679', '1'), + ('5.99', '35', '2007-04-30T02:32:24.996577', '8971', '1'), + ('3.99', '454', '2007-03-22T18:12:42.996577', '15301', '1'), + ('6.99', '7', '2007-03-01T03:25:30.996577', '10330', '2'), + ('4.99', '503', '2007-03-17T12:18:57.996577', '11858', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['25350', '31999', '24786', '17962', '18457', '18239', '18817', '22765', '19042', '24263', '22183', '32014', '21405', '26803', '21289', '22355', '18525', '27633', '23492', '31881', '25419', '24895', '26225', '28899', '22641', '23632', '24078', '23040', '24324', '21236', '22624', '19264', '17815', '18683', '18521', '22697', '30407', '21433', '25206', '24913', '19432', '28229', '22211', '29452', '25168', '19631', '22049', '18872', '20609', '19750', '23086', '28147', '19498', '22923', '26920', '21701', '22577', '23237', '20363', '25983', '28540', '28818', '25389', '28190', '30362', '19754', '29115', '24017', '27549', '25542', '18105', '22041', '22212', '24178', '18880', '28723', '25005', '25222', '20434', '25272', '28745', '24722', '29583', '20864', '22727', '25685', '22488', '28904', '18627', '28123', '21931', '19891', '31472', '23336', '31065', '28578', '28594', '26210', '26073', '20449']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('3.99', '285', '2007-04-11T03:41:15.996577', '6083', '2'), + ('0.99', '570', '2007-05-14T13:44:29.996577', '12716', '1'), + ('3.99', '227', '2007-03-02T03:21:39.996577', '10999', '2'), + ('4.99', '457', '2007-02-19T09:58:42.996577', '2670', '1'), + ('4.99', '595', '2007-02-21T11:55:48.996577', '3371', '2'), + ('1.99', '534', '2007-02-20T23:33:45.996577', '3213', '2'), + ('5.99', '83', '2007-02-15T11:42:15.996577', '1354', '1'), + ('0.99', '9', '2007-03-01T07:39:51.996577', '10451', '1'), + ('6.99', '140', '2007-02-18T09:22:17.996577', '2332', '2'), + ('2.99', '165', '2007-03-02T20:56:49.996577', '11484', '1'), + ('4.99', '550', '2007-03-17T16:18:03.996577', '11969', '1'), + ('3.98', '15', '2007-05-14T13:44:29.996577', '13798', '1'), + ('2.99', '465', '2007-03-02T08:24:32.996577', '11156', '1'), + ('5.99', '410', '2007-04-11T11:43:24.996577', '6218', '2'), + ('0.99', '453', '2007-03-22T16:32:48.996577', '15252', '1'), + ('0.99', '568', '2007-03-01T22:55:20.996577', '10869', '2'), + ('4.99', '7', '2007-02-20T00:19:22.996577', '2888', '1'), + ('4.99', '486', '2007-04-07T05:12:53.996577', '4110', '2'), + ('7.99', '84', '2007-03-02T19:28:31.996577', '11453', '2'), + ('8.99', '264', '2007-04-11T18:14:31.996577', '6340', '1'), + ('7.99', '290', '2007-04-30T03:27:21.996577', '9000', '1'), + ('3.99', '240', '2007-03-17T07:28:27.996577', '11745', '1'), + ('5.99', '360', '2007-04-12T14:18:06.996577', '6770', '2'), + ('0.99', '598', '2007-04-29T05:49:46.996577', '8436', '2'), + ('7.99', '204', '2007-03-02T12:22:52.996577', '11261', '1'), + ('3.99', '101', '2007-03-21T14:05:00.996577', '14542', '2'), + ('8.99', '147', '2007-03-01T18:37:15.996577', '10752', '2'), + ('2.99', '37', '2007-03-01T10:51:07.996577', '10538', '1'), + ('0.99', '171', '2007-03-19T21:59:19.996577', '13433', '2'), + ('3.99', '448', '2007-03-20T17:36:51.996577', '13982', '1'), + ('4.99', '202', '2007-03-02T10:44:20.996577', '11210', '1'), + ('4.99', '196', '2007-02-21T09:15:02.996577', '3342', '2'), + ('6.99', '423', '2007-02-19T04:35:51.996577', '2600', '1'), + ('4.99', '45', '2007-02-19T13:23:43.996577', '2722', '2'), + ('0.99', '6', '2007-02-18T10:31:49.996577', '2345', '1'), + ('2.99', '2', '2007-03-19T04:54:30.996577', '12963', '1'), + ('4.99', '125', '2007-04-30T22:23:46.996577', '9496', '1'), + ('2.99', '467', '2007-03-23T13:47:41.996577', '15830', '2'), + ('7.99', '272', '2007-04-28T23:10:22.996577', '8248', '1'), + ('4.99', '241', '2007-03-23T11:42:41.996577', '15767', '1'), + ('5.99', '247', '2007-02-18T05:51:43.996577', '2288', '1'), + ('0.99', '538', '2007-04-11T17:47:32.996577', '6332', '1'), + ('0.99', '552', '2007-03-20T07:40:08.996577', '13693', '1'), + ('2.99', '41', '2007-04-08T04:17:40.996577', '4575', '1'), + ('2.99', '268', '2007-04-10T06:46:48.996577', '5671', '2'), + ('4.99', '276', '2007-03-23T16:36:45.996577', '15923', '2'), + ('4.99', '534', '2007-03-18T22:52:59.996577', '12798', '2'), + ('2.99', '95', '2007-02-20T11:49:24.996577', '3056', '2'), + ('4.99', '383', '2007-03-01T10:09:59.996577', '10515', '2'), + ('4.99', '289', '2007-03-22T03:32:25.996577', '14917', '2'), + ('0.99', '41', '2007-03-18T23:35:28.996577', '12821', '2'), + ('6.99', '531', '2007-04-27T14:28:26.996577', '7391', '1'), + ('3.99', '264', '2007-02-14T21:44:53.996577', '1165', '2'), + ('2.99', '25', '2007-03-02T00:34:25.996577', '10916', '1'), + ('4.99', '422', '2007-04-06T01:04:07.996577', '3553', '1'), + ('0.99', '497', '2007-03-17T21:50:44.996577', '12123', '1'), + ('4.99', '594', '2007-03-21T23:56:17.996577', '14824', '2'), + ('9.99', '57', '2007-03-23T14:52:50.996577', '15871', '2'), + ('4.99', '359', '2007-03-02T04:22:01.996577', '11032', '1'), + ('0.99', '338', '2007-04-29T18:09:30.996577', '8766', '1'), + ('2.99', '569', '2007-04-30T23:01:26.996577', '10192', '2'), + ('2.99', '592', '2007-04-08T01:17:02.996577', '4518', '1'), + ('0.99', '288', '2007-04-08T13:06:28.996577', '4758', '2'), + ('2.99', '535', '2007-04-08T12:11:02.996577', '4743', '1'), + ('2.99', '122', '2007-04-06T12:13:14.996577', '3778', '1'), + ('4.99', '290', '2007-03-18T22:08:49.996577', '12778', '2'), + ('6.99', '11', '2007-04-30T14:36:47.996577', '9292', '2'), + ('7.99', '141', '2007-03-20T20:53:10.996577', '14059', '2'), + ('0.99', '479', '2007-04-12T06:05:28.996577', '6597', '1'), + ('10.99', '300', '2007-04-10T08:37:43.996577', '5705', '1'), + ('2.99', '498', '2007-02-18T10:30:13.996577', '2344', '1'), + ('4.99', '533', '2007-03-21T23:14:44.996577', '14800', '1'), + ('4.99', '552', '2007-03-21T20:22:13.996577', '14724', '2'), + ('2.99', '155', '2007-03-21T21:40:09.996577', '14753', '1'), + ('0.99', '96', '2007-02-21T20:28:26.996577', '3463', '2'), + ('0.99', '584', '2007-04-26T22:23:39.996577', '6954', '2'), + ('2.99', '253', '2007-03-01T15:16:27.996577', '10660', '1'), + ('0.99', '273', '2007-04-30T07:12:09.996577', '9729', '2'), + ('0.99', '366', '2007-03-20T03:01:57.996577', '13563', '2'), + ('4.99', '278', '2007-04-30T01:49:31.996577', '8953', '1'), + ('4.99', '586', '2007-04-06T10:02:21.996577', '3733', '2'), + ('0.99', '219', '2007-03-17T09:29:37.996577', '11791', '2'), + ('7.99', '52', '2007-04-11T20:57:41.996577', '6394', '1'), + ('1.99', '409', '2007-03-20T23:05:26.996577', '14103', '1'), + ('1.99', '5', '2007-03-19T08:14:07.996577', '13063', '1'), + ('6.99', '312', '2007-04-30T03:54:39.996577', '9016', '1'), + ('2.99', '583', '2007-03-01T12:29:25.996577', '10586', '2'), + ('2.99', '599', '2007-04-10T15:42:53.996577', '5843', '1'), + ('0.99', '31', '2007-02-18T02:26:02.996577', '2233', '1'), + ('5.99', '529', '2007-04-12T03:22:07.996577', '6541', '2'), + ('3.99', '521', '2007-03-21T14:25:51.996577', '14551', '2'), + ('0.99', '305', '2007-03-19T00:31:52.996577', '12846', '2'), + ('8.99', '228', '2007-04-06T08:57:19.996577', '3710', '2'), + ('5.99', '68', '2007-03-21T11:04:37.996577', '14455', '2'), + ('6.99', '182', '2007-04-06T08:35:48.996577', '3697', '1'), + ('4.99', '573', '2007-04-07T00:23:51.996577', '4023', '2'), + ('2.99', '574', '2007-04-08T18:34:04.996577', '4890', '2'), + ('7.99', '359', '2007-04-08T16:24:49.996577', '4830', '2'), + ('1.99', '347', '2007-04-11T06:23:53.996577', '6121', '2'), + ('10.99', '367', '2007-03-21T12:09:40.996577', '14481', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['22279', '23181', '17575', '30160', '31390', '29599', '23080', '31226', '19274', '22044', '31541', '31768', '29932', '28855', '21627', '20322', '22235', '24694', '22983', '26787', '30248', '26936', '28845', '24971', '27410', '19732', '27993', '17682', '23798', '27454', '27582', '22827', '26784', '23731', '19238', '21469', '19649', '29697', '21009', '19984', '21961', '17886', '20068', '31662', '31454', '31330', '25006', '19329', '30012', '27459', '31752', '24771', '19870', '25285', '30944', '24268', '30127', '31742', '28240', '17706', '26513', '21484', '27448', '20194', '31470', '19809', '30165', '25252', '21452', '24086', '21918', '25806', '27424', '28934', '25877', '26687', '19020', '21109', '30056', '26032', '31674', '29919', '19111', '20107', '20369', '20036', '20908', '22413', '20565', '28980', '17607', '31380', '29540', '17535', '31165', '30270', '26822', '20465', '26555', '29945']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('5.99', '560', '2007-03-20T18:54:26.996577', '14008', '2'), + ('3.99', '52', '2007-03-17T06:53:01.996577', '11731', '1'), + ('4.99', '359', '2007-02-15T09:53:32.996577', '1329', '2'), + ('4.99', '103', '2007-04-09T07:28:54.996577', '5163', '2'), + ('4.99', '220', '2007-04-29T04:41:06.996577', '8398', '1'), + ('1.99', '54', '2007-04-09T02:33:54.996577', '5055', '2'), + ('6.99', '40', '2007-03-21T04:29:34.996577', '14260', '1'), + ('0.99', '198', '2007-04-27T23:06:00.996577', '7622', '2'), + ('4.99', '199', '2007-02-15T15:12:26.996577', '1406', '1'), + ('6.99', '534', '2007-03-01T17:39:30.996577', '10725', '2'), + ('4.99', '233', '2007-04-08T18:19:43.996577', '4885', '1'), + ('0.99', '253', '2007-04-30T02:19:12.996577', '9606', '2'), + ('4.99', '85', '2007-04-09T02:26:19.996577', '5051', '1'), + ('4.99', '595', '2007-04-06T23:36:44.996577', '4017', '1'), + ('0.99', '488', '2007-03-01T19:05:49.996577', '10767', '1'), + ('0.99', '353', '2007-03-23T06:58:19.996577', '15650', '2'), + ('2.99', '555', '2007-03-17T22:42:21.996577', '12150', '2'), + ('2.99', '215', '2007-03-23T12:51:49.996577', '15799', '2'), + ('4.99', '30', '2007-03-20T07:19:05.996577', '13682', '1'), + ('7.99', '409', '2007-04-10T21:50:36.996577', '5955', '1'), + ('0.99', '111', '2007-04-29T08:48:45.996577', '8525', '2'), + ('9.99', '423', '2007-04-28T07:58:28.996577', '7849', '1'), + ('2.99', '594', '2007-04-09T17:47:35.996577', '5386', '2'), + ('0.99', '248', '2007-03-18T02:01:43.996577', '12241', '1'), + ('4.99', '467', '2007-04-29T18:10:59.996577', '8767', '1'), + ('2.99', '288', '2007-03-19T14:08:54.996577', '13219', '1'), + ('0.99', '519', '2007-04-08T03:38:04.996577', '4564', '2'), + ('2.99', '385', '2007-02-16T15:09:45.996577', '1746', '1'), + ('2.99', '120', '2007-03-20T18:35:41.996577', '14001', '1'), + ('4.99', '470', '2007-04-28T00:48:14.996577', '7663', '1'), + ('8.99', '482', '2007-04-10T13:50:30.996577', '5810', '2'), + ('3.99', '15', '2007-03-20T07:03:07.996577', '13677', '2'), + ('5.99', '409', '2007-04-09T14:25:11.996577', '5306', '2'), + ('4.99', '114', '2007-03-16T23:27:50.996577', '11547', '1'), + ('4.99', '190', '2007-02-21T12:49:32.996577', '3386', '1'), + ('8.99', '470', '2007-03-18T08:43:18.996577', '12423', '2'), + ('0.99', '278', '2007-03-18T22:36:24.996577', '12787', '1'), + ('0.99', '64', '2007-04-09T19:49:51.996577', '5432', '1'), + ('2.99', '423', '2007-03-01T08:55:53.996577', '10488', '1'), + ('0.99', '316', '2007-03-17T18:32:13.996577', '12028', '1'), + ('4.99', '526', '2007-03-02T04:37:00.996577', '11046', '2'), + ('8.99', '442', '2007-02-16T02:23:05.996577', '1576', '2'), + ('4.99', '327', '2007-03-22T00:42:17.996577', '14847', '1'), + ('5.99', '243', '2007-04-06T15:30:59.996577', '3854', '2'), + ('9.99', '226', '2007-04-12T11:53:13.996577', '6712', '1'), + ('3.99', '214', '2007-04-08T14:37:50.996577', '4783', '1'), + ('6.99', '253', '2007-03-01T23:06:40.996577', '10881', '2'), + ('0.99', '218', '2007-02-18T04:38:49.996577', '2267', '1'), + ('2.99', '91', '2007-04-11T09:27:35.996577', '6178', '1'), + ('4.99', '470', '2007-04-30T16:23:01.996577', '10006', '1'), + ('2.99', '252', '2007-04-10T01:32:04.996577', '5554', '2'), + ('1.99', '225', '2007-03-02T15:21:26.996577', '11333', '2'), + ('2.99', '303', '2007-03-17T04:22:41.996577', '11673', '2'), + ('4.99', '280', '2007-04-27T02:29:34.996577', '7070', '1'), + ('5.99', '171', '2007-04-30T06:42:55.996577', '9084', '2'), + ('7.99', '166', '2007-03-01T06:45:37.996577', '10422', '2'), + ('8.99', '101', '2007-04-28T08:36:27.996577', '7866', '2'), + ('2.99', '251', '2007-04-08T16:58:42.996577', '4848', '2'), + ('7.99', '539', '2007-04-09T06:30:17.996577', '5139', '2'), + ('2.99', '390', '2007-02-17T02:47:03.996577', '1893', '2'), + ('8.99', '385', '2007-04-06T16:55:35.996577', '3878', '2'), + ('0.99', '471', '2007-03-22T14:19:38.996577', '15184', '2'), + ('4.99', '470', '2007-04-09T03:57:04.996577', '5082', '2'), + ('2.99', '340', '2007-03-19T21:40:10.996577', '13425', '1'), + ('2.99', '227', '2007-04-30T23:20:50.996577', '9521', '2'), + ('4.99', '297', '2007-03-01T01:31:38.996577', '10264', '2'), + ('6.99', '103', '2007-04-27T17:32:45.996577', '7472', '2'), + ('5.99', '276', '2007-04-30T20:49:12.996577', '10149', '2'), + ('0.99', '469', '2007-03-02T09:33:01.996577', '11185', '2'), + ('4.99', '147', '2007-03-22T05:00:02.996577', '14960', '2'), + ('5.99', '520', '2007-03-20T09:23:54.996577', '13746', '2'), + ('0.99', '323', '2007-04-29T19:20:07.996577', '8790', '1'), + ('6.99', '468', '2007-04-30T05:34:55.996577', '9690', '1'), + ('4.99', '204', '2007-04-11T00:02:51.996577', '6004', '2'), + ('2.99', '330', '2007-04-12T12:09:03.996577', '6719', '1'), + ('2.99', '401', '2007-04-29T14:13:21.996577', '8669', '2'), + ('0.99', '133', '2007-02-21T11:24:14.996577', '3365', '2'), + ('2.99', '436', '2007-03-17T00:27:33.996577', '11580', '1'), + ('6.99', '95', '2007-04-30T05:41:56.996577', '9695', '1'), + ('9.99', '343', '2007-04-28T16:52:15.996577', '8088', '2'), + ('5.99', '243', '2007-04-30T15:51:02.996577', '9988', '2'), + ('6.99', '84', '2007-04-08T16:39:26.996577', '4838', '2'), + ('4.99', '158', '2007-02-16T18:27:06.996577', '1790', '2'), + ('3.99', '331', '2007-03-22T23:22:23.996577', '15447', '2'), + ('4.99', '359', '2007-03-22T12:27:45.996577', '15148', '1'), + ('3.99', '323', '2007-03-22T04:58:00.996577', '14957', '1'), + ('2.99', '413', '2007-03-21T22:19:23.996577', '14773', '1'), + ('7.99', '575', '2007-03-01T14:01:58.996577', '10629', '2'), + ('4.99', '379', '2007-03-18T11:45:12.996577', '12503', '1'), + ('2.99', '208', '2007-04-06T13:49:03.996577', '3811', '2'), + ('1.99', '366', '2007-02-15T14:58:48.996577', '1401', '2'), + ('6.99', '219', '2007-04-29T13:31:20.996577', '8652', '1'), + ('4.99', '49', '2007-04-11T11:18:14.996577', '6214', '1'), + ('8.99', '348', '2007-02-17T12:47:26.996577', '2041', '1'), + ('0.99', '192', '2007-04-12T10:55:04.996577', '6691', '2'), + ('5.99', '113', '2007-04-27T17:20:53.996577', '7468', '2'), + ('0.99', '412', '2007-04-06T17:22:46.996577', '3888', '2'), + ('2.99', '369', '2007-03-01T17:18:31.996577', '10713', '2'), + ('0.99', '389', '2007-04-09T12:02:19.996577', '5249', '1'), + ('2.99', '86', '2007-04-27T08:30:17.996577', '7231', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['20767', '31565', '20699', '22903', '22838', '20415', '29027', '22868', '31464', '23887', '24614', '25267', '29747', '26097', '19451', '22512', '25108', '28908', '28462', '22673', '28469', '24903', '18233', '26621', '23382', '29598', '23262', '27972', '24992', '27185', '28303', '26707', '17709', '22243', '28583', '26586', '21556', '25546', '31388', '24760', '23030', '29112', '29042', '28372', '27340', '26777', '21427', '22487', '27955', '21034', '28136', '21360', '17781', '30768', '21390', '28936', '18296', '31163', '29411', '30825', '27762', '18417', '28478', '19699', '29101', '23189', '23820', '23293', '30163', '31338', '25787', '28022', '25543', '30064', '27986', '24930', '21888', '26677', '17910', '27475', '23942', '31899', '29461', '20479', '31718', '18266', '26455', '21764', '27889', '26708', '22491', '29460', '23979', '23307', '31304', '30987', '20240', '18093', '19898', '22102']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('0.99', '399', '2007-03-22T18:12:26.996577', '15300', '1'), + ('0.99', '235', '2007-04-29T18:48:42.996577', '8781', '2'), + ('2.99', '392', '2007-03-17T05:07:56.996577', '11686', '1'), + ('4.99', '22', '2007-03-23T12:34:45.996577', '15793', '1'), + ('7.99', '16', '2007-03-18T14:08:12.996577', '12577', '1'), + ('4.99', '364', '2007-03-17T15:04:38.996577', '11932', '2'), + ('2.99', '3', '2007-04-29T09:35:30.996577', '8545', '1'), + ('0.99', '20', '2007-03-17T23:56:41.996577', '12180', '1'), + ('7.99', '227', '2007-04-27T04:57:00.996577', '7132', '1'), + ('4.99', '129', '2007-03-01T21:17:23.996577', '10816', '2'), + ('9.99', '201', '2007-03-20T04:52:19.996577', '13613', '2'), + ('8.99', '278', '2007-04-08T17:38:25.996577', '4866', '2'), + ('3.99', '68', '2007-04-30T23:53:48.996577', '9538', '1'), + ('4.99', '348', '2007-04-29T10:07:43.996577', '8569', '1'), + ('4.99', '253', '2007-02-18T18:01:17.996577', '2454', '1'), + ('0.99', '586', '2007-03-17T08:20:05.996577', '11763', '1'), + ('5.99', '262', '2007-03-20T11:24:09.996577', '13808', '1'), + ('2.99', '599', '2007-04-30T03:25:33.996577', '9630', '2'), + ('3.99', '563', '2007-04-08T03:40:54.996577', '4565', '1'), + ('6.99', '207', '2007-03-17T06:33:10.996577', '11724', '1'), + ('0.99', '563', '2007-04-09T18:41:49.996577', '5406', '1'), + ('2.99', '241', '2007-03-01T14:52:34.996577', '10652', '1'), + ('2.99', '533', '2007-02-17T07:06:21.996577', '1954', '1'), + ('0.99', '394', '2007-04-30T11:35:20.996577', '9864', '2'), + ('0.99', '73', '2007-03-02T08:23:54.996577', '11155', '2'), + ('4.99', '54', '2007-04-08T08:19:28.996577', '4657', '2'), + ('1.99', '60', '2007-03-17T20:45:15.996577', '12084', '1'), + ('0.99', '517', '2007-04-08T20:47:08.996577', '4934', '2'), + ('2.99', '251', '2007-03-19T10:20:05.996577', '13121', '2'), + ('2.99', '445', '2007-04-09T10:38:42.996577', '5225', '2'), + ('4.99', '546', '2007-04-29T08:55:22.996577', '8532', '1'), + ('2.99', '403', '2007-04-11T17:26:46.996577', '6322', '2'), + ('0.99', '391', '2007-02-15T02:46:36.996577', '1232', '2'), + ('4.99', '556', '2007-03-17T19:09:12.996577', '12045', '1'), + ('9.99', '573', '2007-04-10T00:14:55.996577', '5522', '2'), + ('0.99', '391', '2007-04-28T14:04:07.996577', '8016', '2'), + ('0.99', '480', '2007-03-02T03:48:17.996577', '11017', '2'), + ('4.99', '300', '2007-04-28T06:42:37.996577', '7815', '1'), + ('9.99', '220', '2007-04-28T04:23:56.996577', '7750', '2'), + ('0.99', '224', '2007-03-17T10:42:42.996577', '11816', '1'), + ('2.99', '36', '2007-03-01T18:54:01.996577', '10761', '2'), + ('1.99', '11', '2007-04-29T06:06:40.996577', '8447', '2'), + ('0.99', '5', '2007-04-10T09:38:01.996577', '5721', '2'), + ('6.99', '553', '2007-04-12T16:31:51.996577', '6812', '1'), + ('4.99', '460', '2007-04-12T06:58:33.996577', '6613', '1'), + ('3.99', '408', '2007-04-29T06:54:53.996577', '8469', '2'), + ('9.99', '467', '2007-03-18T09:11:09.996577', '12437', '1'), + ('4.99', '583', '2007-03-01T02:38:03.996577', '10301', '2'), + ('4.99', '515', '2007-04-10T08:13:10.996577', '5697', '2'), + ('0.99', '426', '2007-03-02T11:52:27.996577', '11237', '2'), + ('4.99', '530', '2007-04-28T21:55:01.996577', '8208', '2'), + ('3.99', '460', '2007-03-22T03:41:59.996577', '14923', '1'), + ('4.99', '410', '2007-02-21T01:41:45.996577', '3249', '1'), + ('0.99', '156', '2007-04-30T05:42:12.996577', '9696', '1'), + ('2.99', '463', '2007-03-02T00:15:30.996577', '10906', '2'), + ('0.99', '204', '2007-04-12T08:00:09.996577', '6631', '2'), + ('8.99', '553', '2007-02-18T18:22:39.996577', '2460', '1'), + ('2.99', '192', '2007-04-09T18:25:06.996577', '5400', '1'), + ('2.99', '38', '2007-04-10T14:39:05.996577', '5822', '1'), + ('2.99', '161', '2007-04-27T00:00:32.996577', '7003', '1'), + ('4.99', '497', '2007-04-29T22:30:44.996577', '8867', '2'), + ('2.99', '586', '2007-02-15T05:10:51.996577', '1260', '1'), + ('2.99', '564', '2007-04-26T23:00:30.996577', '6973', '1'), + ('4.99', '284', '2007-03-21T21:22:28.996577', '14746', '2'), + ('2.99', '10', '2007-04-28T03:50:08.996577', '7738', '1'), + ('3.99', '53', '2007-03-01T12:43:25.996577', '10594', '1'), + ('4.99', '122', '2007-03-18T10:51:06.996577', '12476', '2'), + ('5.99', '63', '2007-03-22T08:52:58.996577', '15060', '1'), + ('2.99', '103', '2007-04-26T22:12:38.996577', '6949', '2'), + ('2.99', '215', '2007-04-10T18:04:51.996577', '5886', '1'), + ('3.99', '322', '2007-04-12T02:07:55.996577', '6511', '1'), + ('2.99', '521', '2007-04-09T13:03:39.996577', '5276', '1'), + ('4.99', '300', '2007-04-11T05:55:23.996577', '6111', '2'), + ('2.99', '96', '2007-04-10T08:12:58.996577', '5696', '1'), + ('3.99', '518', '2007-04-27T01:35:55.996577', '7038', '2'), + ('2.99', '243', '2007-03-20T19:59:19.996577', '14033', '1'), + ('4.99', '517', '2007-03-01T07:14:22.996577', '10433', '2'), + ('5.99', '400', '2007-04-28T01:35:55.996577', '7682', '1'), + ('4.99', '449', '2007-02-15T07:45:46.996577', '1295', '2'), + ('2.99', '472', '2007-04-12T05:12:02.996577', '6584', '1'), + ('0.99', '135', '2007-03-01T08:21:03.996577', '10471', '2'), + ('6.99', '265', '2007-04-12T21:07:29.996577', '6921', '2'), + ('5.99', '41', '2007-04-30T15:28:09.996577', '9313', '2'), + ('5.99', '370', '2007-03-23T18:41:57.996577', '15982', '1'), + ('5.99', '247', '2007-04-28T12:17:04.996577', '7963', '1'), + ('4.99', '543', '2007-02-16T13:28:40.996577', '1720', '2'), + ('7.99', '379', '2007-04-11T12:46:17.996577', '6235', '1'), + ('3.99', '503', '2007-03-23T04:31:01.996577', '15588', '1'), + ('4.99', '508', '2007-04-28T01:23:53.996577', '7676', '2'), + ('4.99', '403', '2007-04-11T18:16:50.996577', '6342', '1'), + ('0.99', '583', '2007-03-21T04:28:48.996577', '14259', '1'), + ('2.99', '41', '2007-04-29T15:58:32.996577', '8712', '1'), + ('2.99', '138', '2007-03-18T13:09:04.996577', '12550', '2'), + ('6.99', '65', '2007-03-18T18:28:20.996577', '12688', '1'), + ('1.99', '211', '2007-04-12T12:12:29.996577', '6722', '1'), + ('4.99', '175', '2007-04-28T23:47:16.996577', '8264', '1'), + ('4.99', '345', '2007-03-02T02:47:37.996577', '10982', '2'), + ('2.99', '494', '2007-02-16T10:23:21.996577', '1683', '1'), + ('6.99', '306', '2007-03-17T04:24:53.996577', '11674', '2'), + ('6.99', '540', '2007-03-18T04:04:40.996577', '12300', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['18089', '28314', '24715', '24286', '23263', '23833', '18177', '19902', '32041', '30819', '26720', '18076', '18358', '19691', '20362', '17602', '17713', '23558', '18803', '28228', '17971', '27567', '22811', '20829', '28985', '31769', '19596', '30363', '27278', '18904', '21631', '18571', '28253', '24387', '28313', '20154', '24814', '21903', '28244', '25573', '21476', '21495', '28134', '23977', '27665', '26135', '25589', '21540', '24418', '26768', '29838', '23488', '25513', '20980', '29126', '29123', '30166', '28979', '30934', '20232', '32007', '17642', '30535', '27584', '18715', '17760', '30555', '31476', '29884', '22570', '22928', '28893', '22678', '17577', '31425', '25768', '19833', '24714', '24517', '18306', '28788', '29205', '26140', '18987', '22407', '23560', '24981', '17551', '28789', '17754', '28186', '27964', '28878', '28977', '18421', '28333', '26220', '22671', '25332', '22518']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('3.99', '493', '2007-02-17T18:10:08.996577', '2109', '2'), + ('4.99', '547', '2007-04-28T07:18:05.996577', '7835', '1'), + ('2.99', '218', '2007-03-18T11:00:00.996577', '12481', '2'), + ('0.99', '167', '2007-03-23T00:18:57.996577', '15478', '2'), + ('7.99', '60', '2007-03-18T15:44:29.996577', '12614', '2'), + ('5.99', '124', '2007-03-02T21:15:26.996577', '11493', '2'), + ('0.99', '516', '2007-02-20T12:30:48.996577', '3068', '2'), + ('4.99', '306', '2007-03-20T07:25:54.996577', '13686', '1'), + ('2.99', '80', '2007-05-14T13:44:29.996577', '12457', '2'), + ('4.99', '161', '2007-04-06T20:14:19.996577', '3948', '1'), + ('3.99', '404', '2007-04-10T04:45:32.996577', '5632', '1'), + ('4.99', '489', '2007-02-19T17:46:43.996577', '2802', '1'), + ('6.99', '570', '2007-02-17T11:42:29.996577', '2031', '2'), + ('6.99', '283', '2007-03-18T03:36:29.996577', '12290', '1'), + ('7.99', '358', '2007-03-20T18:45:01.996577', '14004', '1'), + ('1.99', '365', '2007-02-15T08:24:23.996577', '1303', '1'), + ('2.99', '391', '2007-02-20T19:50:39.996577', '3163', '2'), + ('4.99', '91', '2007-03-19T17:32:26.996577', '13309', '2'), + ('7.99', '78', '2007-02-21T01:40:47.996577', '3248', '2'), + ('2.99', '538', '2007-04-11T06:48:22.996577', '6130', '2'), + ('4.99', '459', '2007-02-17T15:08:59.996577', '2075', '2'), + ('1.99', '481', '2007-04-08T00:48:30.996577', '4505', '1'), + ('4.99', '14', '2007-03-20T09:48:38.996577', '13757', '1'), + ('4.99', '405', '2007-03-23T17:00:06.996577', '15932', '1'), + ('6.99', '208', '2007-04-11T16:32:52.996577', '6306', '2'), + ('6.99', '253', '2007-04-30T02:44:40.996577', '9618', '2'), + ('0.99', '274', '2007-03-20T19:10:38.996577', '14012', '1'), + ('4.99', '122', '2007-04-06T21:53:39.996577', '3986', '2'), + ('4.99', '454', '2007-04-09T04:13:42.996577', '5088', '2'), + ('0.99', '104', '2007-02-20T03:12:11.996577', '2928', '2'), + ('5.99', '488', '2007-03-22T04:39:19.996577', '14948', '2'), + ('4.99', '20', '2007-02-21T09:50:04.996577', '3350', '1'), + ('2.99', '540', '2007-04-11T09:40:04.996577', '6182', '2'), + ('2.99', '177', '2007-03-22T00:43:52.996577', '14849', '2'), + ('3.99', '547', '2007-04-27T20:20:14.996577', '7547', '2'), + ('0.99', '337', '2007-03-01T15:19:41.996577', '10664', '1'), + ('5.99', '231', '2007-03-17T00:31:28.996577', '11581', '1'), + ('4.99', '518', '2007-03-22T22:56:42.996577', '15434', '2'), + ('6.99', '539', '2007-04-28T23:10:04.996577', '8247', '2'), + ('2.99', '302', '2007-04-29T19:32:40.996577', '8795', '1'), + ('4.99', '471', '2007-03-17T01:43:13.996577', '11601', '2'), + ('2.99', '472', '2007-03-22T17:35:13.996577', '15278', '2'), + ('1.99', '530', '2007-04-27T02:40:06.996577', '7075', '2'), + ('0.99', '138', '2007-03-02T06:16:57.996577', '11088', '1'), + ('2.99', '488', '2007-04-28T15:44:04.996577', '8064', '2'), + ('2.99', '352', '2007-04-27T01:31:51.996577', '7033', '1'), + ('8.99', '304', '2007-04-08T15:35:37.996577', '4812', '2'), + ('2.99', '477', '2007-03-22T10:03:09.996577', '15091', '2'), + ('2.99', '180', '2007-03-22T00:49:10.996577', '14851', '1'), + ('2.99', '407', '2007-04-29T19:54:17.996577', '8802', '1'), + ('0.99', '76', '2007-04-12T15:03:06.996577', '6789', '2'), + ('0.99', '84', '2007-03-01T10:53:08.996577', '10540', '2'), + ('0.99', '297', '2007-04-28T10:55:53.996577', '7933', '1'), + ('0.99', '419', '2007-03-21T06:11:47.996577', '14308', '2'), + ('5.99', '12', '2007-04-30T12:18:09.996577', '9238', '2'), + ('0.99', '12', '2007-04-27T10:19:13.996577', '7279', '2'), + ('0.99', '103', '2007-04-29T01:29:50.996577', '8302', '1'), + ('2.99', '207', '2007-04-30T04:18:19.996577', '9652', '2'), + ('2.99', '170', '2007-04-30T10:01:57.996577', '9817', '1'), + ('5.99', '343', '2007-03-23T18:33:07.996577', '15973', '2'), + ('0.99', '592', '2007-05-14T13:44:29.996577', '14606', '2'), + ('2.99', '377', '2007-02-20T18:07:34.996577', '3136', '2'), + ('5.99', '136', '2007-04-30T08:11:24.996577', '9764', '2'), + ('8.99', '482', '2007-04-11T19:24:55.996577', '6355', '1'), + ('2.99', '53', '2007-02-20T01:17:27.996577', '2903', '1'), + ('4.99', '405', '2007-02-21T01:21:43.996577', '3240', '1'), + ('2.99', '138', '2007-04-05T21:41:33.996577', '3481', '2'), + ('4.99', '228', '2007-04-08T07:12:58.996577', '4636', '1'), + ('3.99', '80', '2007-04-09T19:17:08.996577', '5420', '2'), + ('5.99', '593', '2007-03-01T22:07:00.996577', '10840', '1'), + ('0.99', '25', '2007-03-23T01:25:56.996577', '15512', '1'), + ('4.99', '598', '2007-04-12T02:58:10.996577', '6528', '2'), + ('3.99', '207', '2007-03-20T16:31:07.996577', '13954', '2'), + ('0.99', '359', '2007-02-18T14:50:29.996577', '2401', '1'), + ('3.99', '224', '2007-04-07T20:23:24.996577', '4411', '2'), + ('4.99', '320', '2007-04-28T18:59:21.996577', '8144', '2'), + ('2.99', '299', '2007-03-01T07:22:58.996577', '10440', '2'), + ('2.99', '218', '2007-03-17T03:34:45.996577', '11654', '1'), + ('0.99', '190', '2007-03-21T17:53:17.996577', '14650', '2'), + ('4.99', '556', '2007-02-20T14:34:40.996577', '3093', '1'), + ('2.99', '590', '2007-04-10T00:39:39.996577', '5529', '1'), + ('2.99', '20', '2007-04-28T18:13:45.996577', '8127', '2'), + ('2.99', '352', '2007-04-28T09:06:21.996577', '7886', '1'), + ('2.99', '125', '2007-02-15T19:46:24.996577', '1481', '1'), + ('2.99', '574', '2007-03-18T09:57:21.996577', '12462', '1'), + ('2.99', '91', '2007-03-22T02:37:44.996577', '14888', '2'), + ('4.99', '250', '2007-03-01T13:03:34.996577', '10604', '2'), + ('4.99', '352', '2007-02-16T17:40:11.996577', '1780', '1'), + ('4.99', '590', '2007-04-10T23:32:04.996577', '5991', '1'), + ('4.99', '404', '2007-02-19T12:58:01.996577', '2715', '1'), + ('5.99', '534', '2007-04-30T20:50:42.996577', '9456', '1'), + ('4.99', '516', '2007-04-29T04:35:26.996577', '8396', '2'), + ('3.99', '596', '2007-04-30T18:59:44.996577', '10094', '1'), + ('5.99', '207', '2007-04-27T20:08:21.996577', '7540', '1'), + ('2.99', '587', '2007-02-18T01:50:02.996577', '2220', '1'), + ('4.99', '550', '2007-04-10T09:53:54.996577', '5727', '1'), + ('7.99', '360', '2007-04-07T23:48:48.996577', '4487', '1'), + ('0.99', '207', '2007-03-02T12:20:45.996577', '11260', '2'), + ('2.99', '283', '2007-04-30T01:12:36.996577', '9572', '2'), + ('3.99', '586', '2007-03-23T07:29:36.996577', '15666', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['21552', '18468', '18209', '31294', '27235', '26676', '23699', '25339', '22655', '17973', '24112', '25801', '30861', '25606', '31448', '27839', '27123', '25369', '27595', '29350', '24829', '30212', '19812', '19160', '26894', '18378', '21021', '23283', '20032', '30380', '20014', '25594', '30840', '25243', '22805', '22729', '26088', '26893', '23598', '26918', '30970', '26323', '22507', '29571', '24283', '20826', '29236', '28432', '24970', '18564', '25226', '22508', '29330', '22420', '23978', '30805', '20183', '21657', '19097', '19365', '25137', '30959', '30392', '25002', '19500', '28820', '19382', '21702', '27890', '30747', '20335', '25735', '28947', '25173', '22686', '20848', '23677', '25397', '23830', '25514', '25341', '26442', '26694', '31150', '23696', '29063', '23715', '28539', '29059', '17716', '21074', '31645', '22548', '27203', '18969', '25844', '30176', '18780', '30834', '27518']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('0.99', '479', '2007-03-18T07:49:17.996577', '12401', '2'), + ('2.99', '202', '2007-02-15T19:24:08.996577', '1474', '1'), + ('2.99', '526', '2007-02-17T07:54:15.996577', '1972', '2'), + ('8.99', '211', '2007-04-06T19:44:04.996577', '3937', '2'), + ('6.99', '449', '2007-04-28T04:50:44.996577', '7755', '2'), + ('2.99', '400', '2007-04-27T11:08:14.996577', '7296', '2'), + ('2.99', '110', '2007-03-22T20:57:02.996577', '15381', '2'), + ('5.99', '284', '2007-04-11T14:44:16.996577', '6276', '1'), + ('6.99', '205', '2007-03-21T12:22:41.996577', '14490', '2'), + ('4.99', '459', '2007-02-20T11:04:10.996577', '3041', '2'), + ('2.99', '149', '2007-03-16T23:51:35.996577', '11561', '1'), + ('2.99', '323', '2007-04-27T10:07:34.996577', '7275', '2'), + ('4.99', '165', '2007-04-09T21:45:06.996577', '5472', '1'), + ('7.99', '305', '2007-04-11T06:56:45.996577', '6134', '1'), + ('2.99', '225', '2007-04-30T15:58:46.996577', '9993', '2'), + ('5.99', '504', '2007-04-07T16:32:42.996577', '4329', '1'), + ('0.99', '440', '2007-04-10T03:02:02.996577', '5594', '2'), + ('0.99', '286', '2007-04-27T13:34:31.996577', '7368', '1'), + ('4.99', '483', '2007-04-27T14:08:52.996577', '7381', '1'), + ('5.99', '32', '2007-04-29T04:20:52.996577', '8390', '2'), + ('2.99', '232', '2007-03-23T03:02:05.996577', '15553', '2'), + ('2.99', '107', '2007-04-30T09:28:26.996577', '9155', '1'), + ('4.99', '297', '2007-03-17T00:43:02.996577', '11585', '2'), + ('4.99', '173', '2007-02-18T16:40:52.996577', '2435', '2'), + ('4.99', '419', '2007-04-28T06:08:05.996577', '7796', '1'), + ('6.99', '574', '2007-02-21T00:14:51.996577', '3220', '1'), + ('2.99', '424', '2007-03-17T11:28:59.996577', '11833', '2'), + ('6.99', '62', '2007-03-22T23:43:44.996577', '15464', '1'), + ('4.99', '323', '2007-03-17T21:45:12.996577', '12120', '1'), + ('2.99', '123', '2007-04-28T03:21:09.996577', '7727', '1'), + ('2.99', '320', '2007-03-22T18:13:19.996577', '15302', '1'), + ('0.99', '304', '2007-04-11T05:35:35.996577', '6107', '2'), + ('0.99', '163', '2007-04-11T05:49:23.996577', '6109', '1'), + ('0.99', '276', '2007-04-08T10:44:03.996577', '4715', '1'), + ('4.99', '13', '2007-03-22T19:19:50.996577', '15338', '1'), + ('6.99', '5', '2007-03-20T20:42:25.996577', '14053', '2'), + ('0.99', '348', '2007-04-08T10:05:22.996577', '4699', '1'), + ('2.99', '419', '2007-04-27T22:54:07.996577', '7619', '1'), + ('4.99', '96', '2007-03-18T12:16:57.996577', '12525', '2'), + ('0.99', '421', '2007-04-30T12:06:07.996577', '9875', '2'), + ('8.99', '173', '2007-04-29T21:02:00.996577', '8829', '2'), + ('4.99', '367', '2007-04-30T19:48:39.996577', '9430', '1'), + ('3.99', '585', '2007-03-20T04:19:18.996577', '13593', '2'), + ('4.99', '51', '2007-04-10T03:36:21.996577', '5606', '1'), + ('1.99', '167', '2007-03-20T13:37:42.996577', '13870', '1'), + ('0.99', '405', '2007-03-21T13:52:50.996577', '14537', '2'), + ('6.99', '23', '2007-04-30T20:18:50.996577', '10132', '1'), + ('9.99', '560', '2007-04-07T18:48:55.996577', '4375', '2'), + ('4.99', '248', '2007-03-01T06:39:33.996577', '10418', '2'), + ('8.99', '18', '2007-02-20T07:31:17.996577', '2990', '1'), + ('3.99', '274', '2007-04-11T20:46:46.996577', '6389', '2'), + ('0.99', '585', '2007-03-20T15:56:27.996577', '13939', '2'), + ('9.99', '31', '2007-04-08T11:53:24.996577', '4738', '2'), + ('2.99', '575', '2007-03-19T23:22:40.996577', '13465', '2'), + ('0.99', '138', '2007-03-02T20:06:02.996577', '11463', '1'), + ('0.99', '159', '2007-04-29T06:57:16.996577', '8470', '1'), + ('0.99', '339', '2007-03-20T17:41:32.996577', '13985', '1'), + ('0.99', '491', '2007-03-21T22:34:59.996577', '14780', '1'), + ('0.99', '154', '2007-02-17T07:37:57.996577', '1963', '1'), + ('0.99', '230', '2007-02-19T16:44:52.996577', '2777', '1'), + ('3.99', '265', '2007-03-02T03:24:40.996577', '11000', '2'), + ('0.99', '173', '2007-04-06T09:22:00.996577', '3717', '2'), + ('8.99', '124', '2007-04-28T02:22:40.996577', '7700', '2'), + ('5.99', '252', '2007-03-20T17:56:16.996577', '13989', '2'), + ('0.99', '264', '2007-02-20T10:19:18.996577', '3028', '1'), + ('0.99', '592', '2007-04-27T06:27:50.996577', '7173', '2'), + ('0.99', '235', '2007-02-16T19:34:46.996577', '1811', '2'), + ('4.99', '497', '2007-03-19T11:48:25.996577', '13159', '1'), + ('4.99', '508', '2007-04-28T21:15:40.996577', '8191', '2'), + ('1.99', '154', '2007-04-28T09:39:59.996577', '7900', '2'), + ('3.99', '355', '2007-03-22T20:16:19.996577', '15367', '1'), + ('0.99', '317', '2007-04-10T01:25:11.996577', '5548', '1'), + ('4.99', '205', '2007-04-08T11:28:06.996577', '4729', '1'), + ('2.99', '268', '2007-04-30T00:58:33.996577', '8931', '1'), + ('2.99', '1', '2007-03-19T12:25:20.996577', '13176', '2'), + ('1.99', '407', '2007-03-22T19:13:01.996577', '15334', '2'), + ('4.99', '107', '2007-03-19T19:35:48.996577', '13361', '2'), + ('0.99', '289', '2007-04-08T06:31:08.996577', '4622', '2'), + ('4.99', '123', '2007-03-23T02:11:58.996577', '15525', '2'), + ('2.99', '297', '2007-04-30T03:47:53.996577', '9014', '2'), + ('6.99', '284', '2007-04-27T06:05:00.996577', '7164', '1'), + ('4.99', '377', '2007-04-30T16:36:47.996577', '10013', '1'), + ('2.99', '402', '2007-04-07T19:48:54.996577', '4399', '1'), + ('2.99', '190', '2007-04-27T14:53:09.996577', '7404', '2'), + ('7.99', '110', '2007-03-17T03:22:40.996577', '11647', '1'), + ('2.99', '7', '2007-04-07T11:50:46.996577', '4238', '2'), + ('2.99', '112', '2007-03-20T13:46:36.996577', '13879', '2'), + ('1.99', '569', '2007-04-30T14:34:18.996577', '9960', '2'), + ('2.99', '6', '2007-04-27T03:32:10.996577', '7099', '2'), + ('2.99', '392', '2007-02-18T05:58:09.996577', '2289', '2'), + ('6.99', '432', '2007-03-18T21:54:15.996577', '12767', '1'), + ('6.99', '241', '2007-04-11T04:15:34.996577', '6090', '2'), + ('5.99', '590', '2007-03-17T00:22:39.996577', '11578', '2'), + ('6.99', '446', '2007-04-29T00:25:06.996577', '8284', '2'), + ('4.99', '120', '2007-02-17T22:25:49.996577', '2169', '1'), + ('4.99', '326', '2007-04-30T22:05:25.996577', '10173', '2'), + ('1.99', '104', '2007-04-29T05:16:05.996577', '8413', '1'), + ('4.99', '73', '2007-02-20T03:48:27.996577', '2940', '2'), + ('0.99', '162', '2007-04-30T08:28:26.996577', '9775', '1'), + ('4.99', '476', '2007-04-07T08:17:30.996577', '4171', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['21038', '23809', '30171', '22767', '31545', '26503', '31636', '24668', '22522', '20043', '22038', '29420', '25217', '31303', '30244', '23053', '25450', '24462', '21766', '18670', '27773', '28861', '30641', '23836', '30326', '30653', '19253', '19142', '27678', '19349', '32013', '19881', '17985', '24358', '31146', '18898', '25885', '20792', '31060', '24617', '19110', '28862', '19531', '26739', '24650', '28764', '21686', '29322', '25956', '21458', '28835', '19903', '20358', '25600', '26597', '18029', '25718', '21810', '18738', '23074', '29980', '25283', '19788', '28241', '19775', '25014', '20242', '18977', '27988', '19816', '25356', '24507', '18139', '22157', '25874', '21191', '25234', '31727', '29139', '22606', '30887', '25231', '27696', '17810', '21983', '20461', '24983', '30857', '19151', '24309', '24580', '29630', '25618', '28013', '23625', '21327', '18184', '32009', '28095', '31902']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('4.99', '426', '2007-03-18T19:20:28.996577', '12707', '2'), + ('0.99', '121', '2007-03-19T02:15:00.996577', '12892', '2'), + ('4.99', '104', '2007-04-08T01:22:12.996577', '4520', '2'), + ('5.99', '9', '2007-03-02T17:29:18.996577', '11400', '2'), + ('2.99', '233', '2007-04-12T15:06:49.996577', '6794', '1'), + ('0.99', '383', '2007-04-30T04:24:04.996577', '9653', '1'), + ('3.99', '240', '2007-04-29T07:45:16.996577', '8503', '2'), + ('3.99', '213', '2007-03-17T09:00:06.996577', '11778', '2'), + ('2.99', '587', '2007-03-02T05:55:24.996577', '11078', '1'), + ('2.99', '324', '2007-03-19T20:12:24.996577', '13386', '1'), + ('0.99', '533', '2007-03-18T15:18:16.996577', '12602', '1'), + ('0.99', '38', '2007-04-30T13:53:45.996577', '9284', '1'), + ('2.99', '273', '2007-04-29T06:10:51.996577', '8449', '1'), + ('4.99', '211', '2007-04-12T07:46:34.996577', '6628', '1'), + ('9.99', '111', '2007-04-06T20:47:43.996577', '3963', '2'), + ('3.99', '38', '2007-03-02T04:44:06.996577', '11049', '2'), + ('1.99', '292', '2007-04-30T10:07:39.996577', '9819', '2'), + ('5.99', '185', '2007-03-18T17:53:22.996577', '12674', '1'), + ('2.99', '503', '2007-03-23T09:56:52.996577', '15726', '1'), + ('4.99', '41', '2007-02-19T01:52:43.996577', '2563', '1'), + ('4.99', '498', '2007-04-27T10:42:32.996577', '7285', '1'), + ('6.99', '595', '2007-04-12T11:18:50.996577', '6704', '1'), + ('6.99', '145', '2007-04-07T20:01:42.996577', '4405', '2'), + ('4.99', '124', '2007-03-22T17:05:50.996577', '15266', '2'), + ('3.99', '118', '2007-04-29T02:03:30.996577', '8314', '1'), + ('6.99', '146', '2007-04-08T17:03:00.996577', '4849', '1'), + ('7.99', '194', '2007-02-18T03:21:25.996577', '2245', '1'), + ('5.99', '167', '2007-02-15T21:04:19.996577', '1509', '1'), + ('7.99', '490', '2007-04-09T08:00:10.996577', '5173', '2'), + ('1.99', '227', '2007-02-17T21:35:55.996577', '2155', '2'), + ('4.99', '14', '2007-05-14T13:44:29.996577', '13780', '1'), + ('3.99', '304', '2007-03-20T14:59:59.996577', '13911', '2'), + ('4.99', '463', '2007-02-21T06:29:15.996577', '3309', '1'), + ('0.99', '175', '2007-03-01T23:00:10.996577', '10875', '1'), + ('2.99', '190', '2007-04-07T06:47:36.996577', '4140', '1'), + ('4.99', '103', '2007-02-15T14:51:04.996577', '1396', '2'), + ('5.99', '331', '2007-04-07T02:52:23.996577', '4063', '2'), + ('2.99', '403', '2007-03-01T07:29:30.996577', '10443', '1'), + ('4.99', '181', '2007-04-30T11:38:40.996577', '9214', '2'), + ('2.99', '201', '2007-03-21T18:07:54.996577', '14656', '2'), + ('0.99', '158', '2007-02-15T13:41:36.996577', '1380', '1'), + ('4.99', '595', '2007-04-27T03:08:12.996577', '7086', '1'), + ('6.99', '268', '2007-03-17T11:16:54.996577', '11828', '2'), + ('0.99', '405', '2007-04-30T01:08:04.996577', '9569', '1'), + ('5.99', '211', '2007-03-18T13:51:57.996577', '12570', '2'), + ('4.99', '588', '2007-04-09T15:29:15.996577', '5335', '1'), + ('0.99', '495', '2007-03-19T00:19:35.996577', '12837', '2'), + ('2.99', '30', '2007-04-29T13:05:56.996577', '8641', '1'), + ('6.99', '336', '2007-04-11T20:27:19.996577', '6382', '2'), + ('7.99', '469', '2007-03-21T02:15:51.996577', '14197', '2'), + ('2.99', '593', '2007-04-12T12:26:53.996577', '6731', '1'), + ('5.99', '306', '2007-03-20T08:36:53.996577', '13725', '2'), + ('5.99', '358', '2007-03-02T08:20:09.996577', '11149', '2'), + ('4.99', '305', '2007-04-07T12:51:11.996577', '4260', '2'), + ('9.99', '392', '2007-04-29T11:56:46.996577', '8612', '2'), + ('3.99', '476', '2007-02-16T10:22:51.996577', '1682', '1'), + ('6.99', '315', '2007-04-29T14:29:39.996577', '8677', '2'), + ('6.99', '508', '2007-03-22T06:58:43.996577', '15010', '1'), + ('0.99', '58', '2007-02-20T01:33:22.996577', '2906', '1'), + ('9.99', '40', '2007-03-18T07:39:49.996577', '12396', '2'), + ('7.99', '89', '2007-04-27T13:44:19.996577', '7370', '2'), + ('4.99', '280', '2007-04-08T06:16:38.996577', '4616', '1'), + ('2.99', '294', '2007-03-21T11:51:14.996577', '14474', '1'), + ('2.99', '539', '2007-04-09T22:40:10.996577', '5493', '2'), + ('6.99', '293', '2007-03-21T04:04:23.996577', '14248', '1'), + ('2.99', '253', '2007-03-22T15:40:55.996577', '15221', '2'), + ('4.99', '345', '2007-03-18T11:10:07.996577', '12485', '1'), + ('0.99', '122', '2007-02-18T03:40:09.996577', '2253', '1'), + ('2.99', '518', '2007-04-27T14:11:41.996577', '7382', '2'), + ('2.99', '297', '2007-03-19T18:27:47.996577', '13330', '1'), + ('9.99', '285', '2007-04-28T04:14:54.996577', '7745', '1'), + ('6.99', '190', '2007-03-02T08:26:54.996577', '11158', '2'), + ('4.99', '507', '2007-02-18T05:24:32.996577', '2283', '2'), + ('2.99', '546', '2007-03-22T00:04:03.996577', '14829', '1'), + ('5.99', '330', '2007-04-10T10:49:07.996577', '5750', '1'), + ('6.99', '444', '2007-03-17T23:10:12.996577', '12161', '1'), + ('0.99', '275', '2007-04-08T07:08:28.996577', '4634', '1'), + ('4.99', '249', '2007-04-09T13:02:44.996577', '5275', '1'), + ('0.99', '13', '2007-04-30T04:40:34.996577', '9664', '1'), + ('0.99', '597', '2007-03-19T05:51:32.996577', '12992', '1'), + ('4.99', '167', '2007-04-09T18:57:08.996577', '5413', '1'), + ('4.99', '274', '2007-04-30T05:08:11.996577', '9677', '1'), + ('6.99', '491', '2007-04-28T08:45:03.996577', '7871', '1'), + ('4.99', '422', '2007-02-17T02:54:49.996577', '1897', '1'), + ('3.99', '527', '2007-03-23T03:01:49.996577', '15552', '1'), + ('2.99', '368', '2007-03-22T19:46:34.996577', '15353', '1'), + ('0.99', '250', '2007-03-18T23:12:36.996577', '12810', '1'), + ('4.99', '165', '2007-04-05T23:52:34.996577', '3531', '2'), + ('5.99', '171', '2007-02-18T00:26:22.996577', '2199', '2'), + ('4.99', '169', '2007-03-23T08:01:48.996577', '15680', '2'), + ('6.99', '198', '2007-03-17T01:15:28.996577', '11594', '1'), + ('5.99', '57', '2007-04-28T23:17:10.996577', '8249', '2'), + ('2.99', '306', '2007-04-28T02:22:54.996577', '7701', '2'), + ('5.99', '520', '2007-04-27T07:18:33.996577', '7198', '2'), + ('6.99', '101', '2007-03-01T01:08:15.996577', '10253', '1'), + ('10.99', '457', '2007-03-21T06:46:44.996577', '14327', '2'), + ('5.99', '518', '2007-02-16T00:30:03.996577', '1552', '2'), + ('4.99', '597', '2007-05-14T13:44:29.996577', '11652', '1'), + ('4.99', '526', '2007-04-30T16:49:34.996577', '10020', '2'), + ('5.99', '265', '2007-04-29T00:11:21.996577', '8278', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['27034', '22731', '30055', '24512', '20761', '30516', '23271', '19034', '29344', '27272', '20820', '22839', '29448', '21111', '25610', '23726', '26719', '24238', '21859', '26144', '21574', '30053', '29937', '18413', '24550', '30763', '31567', '28369', '17533', '22373', '20614', '27279', '21117', '26778', '24082', '24383', '24894', '26883', '18344', '30597', '28973', '29797', '25316', '28642', '23633', '31854', '20338', '22970', '22829', '21679', '29058', '22209', '27824', '20100', '18228', '20723', '23614', '21261', '31293', '32030', '24739', '22653', '20312', '22438', '19216', '18030', '30863', '19229', '18506', '26759', '18820', '23439', '19304', '26566', '22995', '23264', '29681', '22221', '23178', '27444', '23935', '30701', '22611', '22098', '24847', '31054', '27683', '20695', '26961', '31716', '18436', '27777', '19503', '22772', '20608', '22436', '21239', '20685', '28439', '23033']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('4.99', '432', '2007-04-28T16:27:02.996577', '8079', '2'), + ('2.99', '5', '2007-03-21T12:31:16.996577', '14494', '2'), + ('6.99', '95', '2007-04-30T11:49:34.996577', '9222', '1'), + ('2.99', '190', '2007-03-18T03:00:31.996577', '12270', '1'), + ('2.99', '399', '2007-03-01T15:00:01.996577', '10654', '2'), + ('0.99', '135', '2007-04-07T04:53:45.996577', '4102', '1'), + ('9.99', '61', '2007-03-17T20:18:51.996577', '12072', '1'), + ('0.99', '138', '2007-02-17T12:29:17.996577', '2038', '2'), + ('2.99', '32', '2007-04-10T21:50:27.996577', '5954', '1'), + ('0.99', '453', '2007-04-27T20:54:02.996577', '7563', '1'), + ('7.99', '405', '2007-03-02T15:42:45.996577', '11345', '1'), + ('4.99', '16', '2007-03-19T11:36:49.996577', '13151', '2'), + ('1.99', '40', '2007-04-30T15:22:09.996577', '9975', '1'), + ('5.99', '436', '2007-03-17T13:48:20.996577', '11896', '2'), + ('6.99', '306', '2007-04-06T13:52:22.996577', '3814', '1'), + ('5.99', '113', '2007-03-18T07:26:24.996577', '12392', '1'), + ('4.99', '404', '2007-04-08T22:07:06.996577', '4963', '1'), + ('0.99', '161', '2007-03-02T01:34:46.996577', '10939', '2'), + ('4.99', '514', '2007-03-18T03:42:02.996577', '12293', '1'), + ('3.99', '353', '2007-04-12T06:48:28.996577', '6610', '1'), + ('0.99', '481', '2007-03-21T15:43:59.996577', '14584', '2'), + ('5.99', '95', '2007-04-27T08:57:32.996577', '7245', '2'), + ('2.99', '85', '2007-04-30T15:43:13.996577', '9985', '1'), + ('0.99', '585', '2007-02-15T10:58:07.996577', '1344', '1'), + ('0.99', '195', '2007-03-19T04:07:52.996577', '12941', '2'), + ('0.99', '156', '2007-04-10T19:12:40.996577', '5908', '2'), + ('6.99', '235', '2007-04-30T23:14:23.996577', '9519', '2'), + ('3.99', '553', '2007-04-08T21:07:36.996577', '4941', '2'), + ('7.99', '347', '2007-02-21T07:33:16.996577', '3326', '1'), + ('8.99', '569', '2007-03-22T02:49:21.996577', '14896', '1'), + ('4.99', '383', '2007-03-18T20:33:20.996577', '12735', '1'), + ('2.99', '454', '2007-04-09T20:28:21.996577', '5446', '2'), + ('5.99', '436', '2007-03-20T09:54:59.996577', '13760', '1'), + ('6.99', '408', '2007-04-29T23:36:32.996577', '8902', '2'), + ('3.99', '147', '2007-03-20T06:55:27.996577', '13670', '2'), + ('6.99', '177', '2007-03-17T03:56:03.996577', '11662', '2'), + ('7.99', '240', '2007-03-01T02:51:15.996577', '10308', '1'), + ('0.99', '419', '2007-04-06T03:31:37.996577', '3596', '1'), + ('4.99', '566', '2007-02-21T12:23:24.996577', '3379', '1'), + ('4.99', '141', '2007-04-29T05:48:40.996577', '8434', '1'), + ('0.99', '207', '2007-04-10T20:58:31.996577', '5939', '2'), + ('4.99', '73', '2007-04-08T14:50:27.996577', '4789', '1'), + ('9.99', '282', '2007-04-30T04:29:18.996577', '9658', '2'), + ('4.99', '578', '2007-04-08T00:12:45.996577', '4496', '2'), + ('2.99', '101', '2007-03-22T10:29:32.996577', '15103', '2'), + ('1.99', '262', '2007-04-05T23:28:37.996577', '3521', '1'), + ('4.99', '356', '2007-03-01T22:30:32.996577', '10854', '1'), + ('2.99', '29', '2007-03-19T12:19:02.996577', '13173', '2'), + ('4.99', '15', '2007-03-21T22:22:01.996577', '14776', '2'), + ('4.99', '494', '2007-03-22T00:11:55.996577', '14832', '1'), + ('0.99', '6', '2007-04-12T10:47:04.996577', '6686', '2'), + ('2.99', '552', '2007-03-19T01:55:43.996577', '12880', '2'), + ('4.99', '502', '2007-04-28T14:48:52.996577', '8034', '2'), + ('5.99', '331', '2007-03-02T04:54:45.996577', '11052', '1'), + ('4.99', '532', '2007-02-16T11:08:49.996577', '1694', '1'), + ('4.99', '394', '2007-03-18T07:17:02.996577', '12389', '1'), + ('7.99', '98', '2007-03-23T02:26:54.996577', '15536', '1'), + ('6.99', '451', '2007-03-02T16:47:55.996577', '11381', '2'), + ('0.99', '210', '2007-04-29T17:01:13.996577', '8738', '2'), + ('0.00', '53', '2007-05-14T13:44:29.996577', '14137', '1'), + ('4.99', '220', '2007-03-23T09:01:18.996577', '15706', '2'), + ('4.99', '205', '2007-03-21T08:44:53.996577', '14391', '2'), + ('2.99', '352', '2007-03-18T21:01:48.996577', '12751', '1'), + ('0.99', '577', '2007-03-18T17:48:25.996577', '12671', '2'), + ('4.99', '186', '2007-02-19T23:15:44.996577', '2875', '2'), + ('0.99', '476', '2007-02-17T15:28:06.996577', '2080', '1'), + ('6.99', '165', '2007-04-10T18:50:38.996577', '5901', '2'), + ('0.99', '189', '2007-02-15T23:44:25.996577', '1541', '1'), + ('2.99', '3', '2007-02-19T07:03:19.996577', '2628', '1'), + ('4.99', '407', '2007-04-09T03:26:52.996577', '5070', '1'), + ('4.99', '83', '2007-02-21T00:51:42.996577', '3230', '2'), + ('2.99', '78', '2007-03-21T23:37:00.996577', '14810', '1'), + ('0.99', '213', '2007-02-18T22:12:34.996577', '2509', '1'), + ('4.99', '390', '2007-04-07T00:18:32.996577', '4022', '1'), + ('9.99', '32', '2007-03-18T08:19:06.996577', '12414', '2'), + ('2.99', '60', '2007-03-22T10:07:29.996577', '15093', '1'), + ('3.99', '63', '2007-04-12T14:17:20.996577', '6769', '2'), + ('0.99', '554', '2007-03-17T12:43:05.996577', '11873', '1'), + ('0.99', '52', '2007-03-01T12:40:55.996577', '10591', '2'), + ('4.99', '470', '2007-04-06T15:02:26.996577', '3841', '1'), + ('4.99', '134', '2007-03-02T13:08:12.996577', '11283', '1'), + ('4.99', '149', '2007-04-11T19:26:14.996577', '6356', '1'), + ('0.99', '598', '2007-03-02T15:51:25.996577', '11350', '2'), + ('4.99', '540', '2007-03-02T14:59:43.996577', '11324', '2'), + ('5.99', '234', '2007-03-22T08:04:59.996577', '15037', '2'), + ('4.99', '181', '2007-04-12T00:07:08.996577', '6477', '2'), + ('2.99', '490', '2007-04-12T19:29:37.996577', '6888', '2'), + ('2.99', '391', '2007-03-20T17:33:06.996577', '13980', '1'), + ('7.99', '425', '2007-04-08T18:17:43.996577', '4884', '1'), + ('6.99', '247', '2007-04-09T15:16:55.996577', '5328', '1'), + ('6.99', '590', '2007-02-20T02:29:30.996577', '2916', '1'), + ('2.99', '498', '2007-04-28T22:37:34.996577', '8229', '1'), + ('4.99', '265', '2007-02-19T01:43:31.996577', '2562', '2'), + ('7.99', '9', '2007-03-21T12:22:25.996577', '14489', '2'), + ('7.99', '382', '2007-03-23T17:12:47.996577', '15939', '2'), + ('0.99', '577', '2007-03-02T20:10:33.996577', '11464', '2'), + ('9.99', '448', '2007-03-22T19:57:40.996577', '15358', '2'), + ('5.99', '390', '2007-03-20T14:21:18.996577', '13893', '2'), + ('2.99', '560', '2007-04-29T17:44:16.996577', '8753', '1'), + ('4.99', '36', '2007-03-17T02:28:27.996577', '11616', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['25145', '29022', '28940', '18927', '18983', '18381', '23644', '28390', '28159', '19648', '18802', '26616', '20172', '23495', '18807', '20912', '28276', '19983', '18423', '30018', '24437', '21759', '28475', '29037', '31642', '17573', '27373', '30634', '28907', '19562', '29957', '20789', '31653', '25420', '28991', '17803', '20323', '21607', '29402', '31421', '22828', '27275', '27991', '24600', '26004', '23955', '18917', '24307', '30873', '24584', '19769', '18550', '21743', '27926', '30736', '24564', '28701', '27471', '20775', '19801', '30298', '22062', '18833', '28352', '29631', '32074', '17586', '18787', '18219', '29127', '20318', '24288', '25444', '27748', '30245', '20557', '20935', '30854', '28114', '30571', '32010', '28444', '26674', '27125', '20998', '21678', '28837', '31660', '22311', '26440', '25355', '18234', '25261', '28716', '19255', '27880', '20993', '25400', '23596', '21639']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('4.99', '266', '2007-03-01T18:28:07.996577', '10747', '2'), + ('10.99', '3', '2007-04-27T18:51:38.996577', '7503', '2'), + ('0.99', '204', '2007-04-30T03:33:24.996577', '9005', '2'), + ('5.99', '109', '2007-02-20T13:29:45.996577', '3076', '2'), + ('4.99', '123', '2007-02-16T16:56:45.996577', '1775', '2'), + ('4.99', '575', '2007-02-17T00:21:45.996577', '1866', '2'), + ('4.99', '103', '2007-03-21T05:27:15.996577', '14289', '2'), + ('2.99', '556', '2007-04-12T00:32:36.996577', '6484', '2'), + ('8.99', '532', '2007-04-10T13:37:07.996577', '5805', '2'), + ('0.99', '278', '2007-03-16T22:58:30.996577', '11531', '2'), + ('6.99', '78', '2007-02-20T04:34:19.996577', '2949', '2'), + ('4.99', '394', '2007-04-09T08:42:11.996577', '5183', '2'), + ('2.99', '338', '2007-03-21T16:38:29.996577', '14619', '1'), + ('4.99', '84', '2007-03-18T06:23:35.996577', '12364', '2'), + ('8.99', '80', '2007-02-19T17:57:43.996577', '2805', '2'), + ('0.99', '414', '2007-03-19T07:34:34.996577', '13042', '1'), + ('2.99', '543', '2007-04-27T11:31:40.996577', '7312', '2'), + ('7.99', '316', '2007-03-01T07:21:30.996577', '10438', '1'), + ('2.99', '588', '2007-02-17T02:04:25.996577', '1885', '2'), + ('0.99', '91', '2007-04-29T22:42:58.996577', '8873', '2'), + ('3.99', '182', '2007-03-17T09:23:12.996577', '11785', '2'), + ('2.99', '503', '2007-03-20T02:28:56.996577', '13551', '1'), + ('7.99', '563', '2007-04-29T20:16:06.996577', '8812', '2'), + ('4.99', '5', '2007-04-06T07:40:24.996577', '3677', '2'), + ('4.99', '241', '2007-04-09T20:02:58.996577', '5438', '1'), + ('2.99', '358', '2007-02-19T14:56:01.996577', '2749', '1'), + ('2.99', '463', '2007-04-09T07:20:38.996577', '5157', '1'), + ('7.99', '144', '2007-04-30T04:39:24.996577', '9034', '1'), + ('6.99', '599', '2007-04-30T02:21:03.996577', '8965', '1'), + ('3.99', '271', '2007-03-01T12:52:24.996577', '10599', '1'), + ('4.99', '87', '2007-04-29T02:21:25.996577', '8323', '2'), + ('4.99', '402', '2007-03-16T23:30:14.996577', '11549', '2'), + ('4.99', '242', '2007-04-05T21:20:10.996577', '3471', '1'), + ('0.99', '290', '2007-04-30T19:13:05.996577', '9413', '1'), + ('3.99', '208', '2007-04-30T14:56:19.996577', '9298', '2'), + ('3.99', '420', '2007-02-19T10:10:30.996577', '2672', '2'), + ('2.99', '353', '2007-03-23T07:51:34.996577', '15676', '2'), + ('2.99', '485', '2007-03-19T08:04:54.996577', '13055', '2'), + ('0.99', '37', '2007-04-28T11:14:13.996577', '7939', '2'), + ('5.99', '223', '2007-04-27T03:04:10.996577', '7085', '2'), + ('0.99', '15', '2007-03-21T14:59:48.996577', '14569', '2'), + ('1.99', '453', '2007-04-30T12:43:31.996577', '9900', '2'), + ('3.99', '518', '2007-04-28T17:31:42.996577', '8107', '1'), + ('3.99', '199', '2007-03-23T11:09:33.996577', '15751', '2'), + ('4.99', '340', '2007-04-29T09:41:37.996577', '8551', '2'), + ('4.99', '136', '2007-03-20T17:59:01.996577', '13992', '2'), + ('0.99', '107', '2007-02-20T20:52:26.996577', '3174', '2'), + ('4.99', '169', '2007-03-21T23:20:27.996577', '14805', '2'), + ('4.99', '166', '2007-04-09T08:43:00.996577', '5184', '1'), + ('1.99', '198', '2007-03-17T15:50:55.996577', '11957', '1'), + ('1.99', '293', '2007-03-02T07:38:30.996577', '11131', '2'), + ('4.99', '14', '2007-02-15T12:00:41.996577', '1360', '2'), + ('4.99', '502', '2007-03-02T04:24:55.996577', '11036', '2'), + ('0.99', '512', '2007-04-08T15:17:53.996577', '4799', '1'), + ('7.99', '154', '2007-04-06T13:38:07.996577', '3806', '2'), + ('4.99', '197', '2007-03-01T18:14:37.996577', '10739', '2'), + ('5.99', '582', '2007-04-27T15:13:00.996577', '7412', '2'), + ('3.99', '472', '2007-04-10T03:43:38.996577', '5612', '1'), + ('2.99', '400', '2007-03-19T22:45:27.996577', '13449', '2'), + ('3.99', '296', '2007-03-18T18:35:00.996577', '12689', '2'), + ('1.99', '115', '2007-04-27T13:14:25.996577', '7355', '2'), + ('0.99', '535', '2007-03-20T13:13:49.996577', '13852', '1'), + ('4.99', '86', '2007-02-16T07:04:05.996577', '1640', '2'), + ('7.99', '552', '2007-04-09T10:08:09.996577', '5213', '1'), + ('0.99', '57', '2007-04-30T06:47:12.996577', '9086', '1'), + ('4.99', '192', '2007-05-14T13:44:29.996577', '11611', '1'), + ('2.99', '361', '2007-02-21T06:02:40.996577', '3303', '2'), + ('4.99', '75', '2007-02-19T14:24:56.996577', '2738', '2'), + ('2.99', '528', '2007-02-17T01:13:36.996577', '1875', '2'), + ('5.99', '12', '2007-04-30T03:11:12.996577', '9627', '1'), + ('5.99', '353', '2007-03-19T03:32:35.996577', '12928', '1'), + ('4.99', '167', '2007-03-23T16:20:27.996577', '15915', '2'), + ('2.99', '292', '2007-04-27T20:16:29.996577', '7545', '1'), + ('4.99', '496', '2007-04-10T21:41:26.996577', '5949', '2'), + ('4.99', '111', '2007-04-07T12:33:43.996577', '4249', '1'), + ('7.99', '377', '2007-03-23T19:12:36.996577', '15999', '1'), + ('8.99', '416', '2007-03-18T20:02:19.996577', '12722', '1'), + ('6.99', '164', '2007-04-27T08:22:09.996577', '7227', '1'), + ('3.99', '528', '2007-04-29T16:38:23.996577', '8727', '1'), + ('0.99', '139', '2007-04-08T08:23:13.996577', '4660', '2'), + ('0.99', '5', '2007-05-14T13:44:29.996577', '13209', '2'), + ('2.99', '561', '2007-04-11T19:37:40.996577', '6361', '2'), + ('5.99', '400', '2007-04-12T15:03:25.996577', '6790', '2'), + ('0.99', '440', '2007-04-10T12:21:22.996577', '5782', '2'), + ('2.99', '422', '2007-03-17T03:47:43.996577', '11658', '1'), + ('5.99', '494', '2007-03-21T17:19:54.996577', '14634', '2'), + ('2.99', '593', '2007-04-29T07:35:29.996577', '8497', '1'), + ('3.99', '242', '2007-04-30T19:38:40.996577', '9423', '1'), + ('1.99', '564', '2007-03-01T04:13:02.996577', '10352', '2'), + ('3.99', '377', '2007-04-30T20:57:39.996577', '9461', '2'), + ('9.99', '285', '2007-04-27T16:55:05.996577', '7452', '1'), + ('6.99', '533', '2007-02-19T16:22:48.996577', '2770', '2'), + ('4.99', '277', '2007-04-27T15:40:13.996577', '7423', '2'), + ('7.99', '583', '2007-04-29T10:06:48.996577', '8568', '2'), + ('3.99', '194', '2007-02-18T18:30:09.996577', '2463', '1'), + ('9.99', '508', '2007-04-10T06:02:09.996577', '5657', '2'), + ('4.99', '421', '2007-03-20T13:38:56.996577', '13872', '1'), + ('4.99', '289', '2007-04-10T02:43:51.996577', '5584', '2'), + ('3.99', '96', '2007-03-17T16:44:56.996577', '11984', '1'), + ('4.99', '489', '2007-03-19T23:17:45.996577', '13462', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['22333', '22915', '19479', '25345', '25404', '20390', '28766', '30645', '28480', '22941', '18613', '31106', '19627', '20817', '31977', '22905', '26179', '22270', '24929', '26785', '25583', '28083', '30518', '31856', '24276', '31382', '28359', '23944', '29478', '18658', '25759', '23165', '25738', '25964', '28814', '28728', '21353', '30570', '30272', '26489', '27882', '32012', '22541', '31670', '31993', '17606', '27028', '31634', '27814', '28393', '18054', '30131', '17820', '27070', '25568', '25575', '18786', '28898', '20853', '19437', '31254', '30531', '28025', '29763', '30751', '29250', '21870', '31733', '19539', '30663', '21817', '31053', '31612', '23982', '22088', '24070', '28449', '25241', '25256', '25242', '18545', '19534', '30932', '25435', '20280', '26230', '31242', '22630', '24085', '23949', '21288', '28655', '25377', '20940', '28441', '20668', '26191', '31276', '24204', '29458']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('0.99', '565', '2007-03-19T19:36:20.996577', '13362', '1'), + ('8.99', '24', '2007-03-17T23:22:03.996577', '12165', '2'), + ('2.99', '260', '2007-02-17T10:03:35.996577', '2001', '2'), + ('0.99', '284', '2007-04-30T09:02:34.996577', '9790', '1'), + ('4.99', '289', '2007-04-27T05:42:57.996577', '7151', '1'), + ('0.99', '361', '2007-03-19T10:51:18.996577', '13135', '1'), + ('2.99', '588', '2007-04-27T13:59:54.996577', '7377', '2'), + ('1.99', '145', '2007-04-11T18:13:58.996577', '6339', '1'), + ('4.99', '564', '2007-04-29T05:36:14.996577', '8426', '2'), + ('7.99', '26', '2007-03-23T09:44:55.996577', '15722', '1'), + ('0.99', '28', '2007-02-21T00:53:26.996577', '3231', '1'), + ('0.99', '185', '2007-04-30T12:40:57.996577', '9246', '2'), + ('4.99', '276', '2007-03-18T17:01:46.996577', '12650', '1'), + ('10.99', '404', '2007-03-22T17:56:28.996577', '15290', '2'), + ('2.99', '496', '2007-05-14T13:44:29.996577', '13182', '1'), + ('2.99', '23', '2007-03-16T21:33:19.996577', '11501', '2'), + ('0.99', '356', '2007-04-09T23:34:07.996577', '5513', '1'), + ('4.99', '559', '2007-03-21T07:07:52.996577', '14342', '1'), + ('2.99', '243', '2007-03-19T17:00:37.996577', '13291', '1'), + ('0.99', '409', '2007-04-09T19:24:13.996577', '5422', '1'), + ('2.99', '303', '2007-04-27T18:47:34.996577', '7502', '2'), + ('4.99', '526', '2007-04-11T21:18:16.996577', '6404', '1'), + ('0.99', '135', '2007-04-10T01:12:53.996577', '5541', '1'), + ('0.99', '262', '2007-04-08T00:40:26.996577', '4501', '1'), + ('2.99', '166', '2007-03-22T15:25:28.996577', '15216', '2'), + ('2.99', '220', '2007-04-08T20:05:57.996577', '4918', '2'), + ('8.99', '552', '2007-04-30T16:38:22.996577', '9342', '1'), + ('3.99', '135', '2007-03-01T16:53:07.996577', '10698', '1'), + ('3.99', '42', '2007-04-30T00:10:35.996577', '8915', '2'), + ('4.99', '38', '2007-02-20T08:29:17.996577', '3003', '2'), + ('2.99', '319', '2007-04-28T11:52:58.996577', '7953', '2'), + ('2.99', '51', '2007-03-02T14:06:29.996577', '11302', '1'), + ('2.99', '317', '2007-04-28T15:43:32.996577', '8062', '2'), + ('6.99', '337', '2007-04-07T04:22:04.996577', '4091', '1'), + ('11.99', '592', '2007-04-06T21:26:57.996577', '3973', '1'), + ('3.99', '584', '2007-04-30T20:38:43.996577', '9451', '2'), + ('5.99', '460', '2007-03-17T19:32:14.996577', '12056', '1'), + ('4.99', '138', '2007-04-30T22:56:19.996577', '10190', '2'), + ('6.99', '113', '2007-04-30T11:48:32.996577', '9221', '2'), + ('0.99', '382', '2007-04-10T14:17:13.996577', '5816', '1'), + ('4.99', '508', '2007-04-11T05:18:59.996577', '6101', '1'), + ('0.99', '11', '2007-05-14T13:44:29.996577', '11646', '1'), + ('6.99', '589', '2007-03-20T20:07:49.996577', '14038', '1'), + ('4.99', '243', '2007-04-29T21:10:14.996577', '8834', '1'), + ('2.99', '550', '2007-05-14T13:44:29.996577', '11757', '2'), + ('0.99', '365', '2007-02-20T19:32:12.996577', '3156', '2'), + ('2.99', '432', '2007-04-09T09:22:40.996577', '5204', '1'), + ('4.99', '240', '2007-04-27T17:48:51.996577', '7481', '2'), + ('5.99', '502', '2007-04-09T17:10:25.996577', '5368', '2'), + ('0.99', '557', '2007-04-08T08:08:05.996577', '4651', '1'), + ('0.99', '481', '2007-02-21T05:27:59.996577', '3293', '2'), + ('6.99', '101', '2007-04-30T14:47:58.996577', '9965', '2'), + ('0.99', '424', '2007-02-21T14:26:18.996577', '3404', '2'), + ('4.99', '435', '2007-04-30T10:27:04.996577', '9829', '2'), + ('7.99', '302', '2007-04-12T07:34:00.996577', '6623', '2'), + ('2.99', '302', '2007-04-30T17:05:50.996577', '9358', '2'), + ('7.99', '75', '2007-02-17T22:08:16.996577', '2161', '1'), + ('0.99', '598', '2007-04-28T13:37:14.996577', '7998', '1'), + ('0.99', '408', '2007-03-19T02:32:15.996577', '12900', '2'), + ('2.99', '249', '2007-02-16T15:36:43.996577', '1753', '2'), + ('4.99', '201', '2007-04-05T23:41:53.996577', '3528', '2'), + ('3.99', '136', '2007-04-10T04:19:38.996577', '5627', '1'), + ('0.99', '521', '2007-04-10T07:34:29.996577', '5686', '2'), + ('4.99', '70', '2007-04-27T01:34:38.996577', '7036', '2'), + ('5.99', '155', '2007-04-11T03:01:08.996577', '6066', '1'), + ('4.99', '25', '2007-04-12T09:34:43.996577', '6653', '1'), + ('4.99', '515', '2007-03-17T00:06:21.996577', '11572', '2'), + ('4.99', '250', '2007-04-06T05:24:02.996577', '3635', '1'), + ('2.99', '269', '2007-03-01T11:40:37.996577', '10566', '2'), + ('0.99', '147', '2007-04-09T01:58:51.996577', '5044', '2'), + ('2.99', '509', '2007-03-23T18:15:05.996577', '15965', '1'), + ('4.99', '181', '2007-04-07T20:58:06.996577', '4428', '2'), + ('4.99', '238', '2007-04-30T05:53:35.996577', '9065', '1'), + ('4.99', '138', '2007-03-21T10:04:41.996577', '14432', '2'), + ('2.99', '538', '2007-03-21T15:12:57.996577', '14572', '2'), + ('7.99', '146', '2007-03-17T21:59:51.996577', '12129', '1'), + ('10.99', '561', '2007-04-29T07:48:42.996577', '8504', '1'), + ('2.99', '275', '2007-04-30T12:59:57.996577', '9258', '2'), + ('5.99', '277', '2007-04-08T23:14:07.996577', '4987', '2'), + ('2.99', '276', '2007-04-06T09:19:54.996577', '3714', '2'), + ('0.99', '12', '2007-02-21T14:59:53.996577', '3411', '1'), + ('5.99', '268', '2007-03-20T13:46:46.996577', '13880', '2'), + ('7.99', '170', '2007-04-28T13:38:40.996577', '7999', '1'), + ('0.99', '292', '2007-04-06T01:17:05.996577', '3557', '2'), + ('4.99', '348', '2007-03-23T17:19:20.996577', '15944', '1'), + ('2.99', '360', '2007-04-28T22:15:07.996577', '8220', '1'), + ('4.99', '199', '2007-04-30T14:32:48.996577', '9959', '1'), + ('0.99', '202', '2007-03-22T10:10:01.996577', '15095', '1'), + ('0.99', '147', '2007-03-21T17:33:49.996577', '14641', '2'), + ('0.99', '135', '2007-03-20T18:47:31.996577', '14005', '1'), + ('4.99', '453', '2007-03-21T18:00:31.996577', '14652', '1'), + ('2.99', '579', '2007-04-08T20:46:55.996577', '4933', '1'), + ('1.99', '287', '2007-04-09T15:57:27.996577', '5346', '2'), + ('2.99', '416', '2007-03-23T09:57:15.996577', '15727', '1'), + ('4.99', '560', '2007-04-29T23:50:05.996577', '8906', '2'), + ('4.99', '389', '2007-03-02T15:47:04.996577', '11348', '2'), + ('0.99', '357', '2007-04-07T23:07:34.996577', '4478', '1'), + ('4.99', '210', '2007-04-06T01:25:27.996577', '3563', '2'), + ('2.99', '158', '2007-03-02T18:16:22.996577', '11420', '1'), + ('6.99', '41', '2007-04-28T18:29:49.996577', '8134', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['21869', '27407', '30281', '21105', '30956', '26180', '28482', '29999', '30835', '28106', '17893', '23180', '27677', '18043', '23545', '27842', '32081', '26228', '24959', '27403', '29934', '19719', '19353', '30386', '26517', '21531', '30977', '30495', '29315', '19513', '23187', '23457', '26717', '21198', '24141', '24072', '30349', '29624', '24183', '20474', '20189', '24571', '20163', '28137', '27008', '21277', '31308', '22968', '22159', '22442', '26689', '28905', '28198', '25431', '23994', '29913', '27971', '24292', '26496', '30888', '23353', '29227', '25395', '24208', '27877', '19537', '31467', '18141', '22441', '22974', '19614', '30120', '22022', '20809', '31730', '29054', '24175', '32054', '22629', '25608', '21974', '31067', '24279', '31183', '28586', '23447', '31457', '18922', '24382', '21832', '27833', '25436', '30324', '19293', '27080', '26884', '28706', '21425', '29960', '31437']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('3.99', '515', '2007-03-02T19:14:22.996577', '11451', '1'), + ('6.99', '467', '2007-04-28T15:41:19.996577', '8061', '2'), + ('4.99', '114', '2007-04-12T13:27:50.996577', '6754', '1'), + ('1.99', '435', '2007-03-21T22:08:54.996577', '14765', '1'), + ('6.99', '172', '2007-04-30T01:40:10.996577', '8944', '2'), + ('4.99', '356', '2007-04-12T05:49:43.996577', '6593', '1'), + ('3.99', '564', '2007-04-30T05:53:00.996577', '9063', '2'), + ('0.99', '90', '2007-04-29T05:09:06.996577', '8408', '1'), + ('5.99', '162', '2007-04-30T18:58:58.996577', '10093', '2'), + ('4.99', '528', '2007-04-06T06:13:57.996577', '3654', '2'), + ('7.99', '444', '2007-02-21T06:00:51.996577', '3301', '2'), + ('0.99', '52', '2007-03-02T05:36:33.996577', '11068', '1'), + ('5.99', '490', '2007-04-08T19:27:39.996577', '4906', '1'), + ('2.99', '479', '2007-02-17T03:04:18.996577', '1902', '1'), + ('4.99', '90', '2007-03-02T11:30:37.996577', '11231', '2'), + ('3.99', '504', '2007-04-27T12:53:43.996577', '7342', '2'), + ('2.99', '213', '2007-05-14T13:44:29.996577', '14374', '2'), + ('4.99', '360', '2007-04-28T00:28:40.996577', '7654', '1'), + ('1.99', '247', '2007-03-01T01:55:10.996577', '10279', '1'), + ('2.99', '467', '2007-04-27T13:20:32.996577', '7360', '2'), + ('0.99', '85', '2007-04-28T10:00:08.996577', '7906', '2'), + ('2.99', '287', '2007-03-01T12:05:17.996577', '10574', '2'), + ('2.99', '228', '2007-02-19T22:27:04.996577', '2863', '2'), + ('4.99', '123', '2007-04-30T17:58:27.996577', '10066', '1'), + ('4.99', '385', '2007-04-11T23:05:28.996577', '6445', '1'), + ('6.99', '476', '2007-03-01T21:36:22.996577', '10826', '1'), + ('4.99', '174', '2007-04-29T17:46:56.996577', '8754', '1'), + ('0.99', '132', '2007-04-27T16:00:06.996577', '7432', '2'), + ('0.99', '30', '2007-04-11T13:30:28.996577', '6249', '1'), + ('6.99', '267', '2007-02-19T03:24:53.996577', '2582', '1'), + ('6.99', '52', '2007-03-22T05:04:16.996577', '14961', '2'), + ('0.99', '80', '2007-03-22T03:25:23.996577', '14916', '1'), + ('8.99', '404', '2007-04-08T06:15:19.996577', '4615', '2'), + ('0.99', '444', '2007-03-23T03:20:43.996577', '15557', '1'), + ('2.99', '151', '2007-03-23T16:49:22.996577', '15926', '1'), + ('4.99', '146', '2007-03-19T02:09:35.996577', '12888', '1'), + ('1.99', '120', '2007-04-29T17:47:23.996577', '8756', '2'), + ('4.99', '57', '2007-04-09T02:56:29.996577', '5060', '1'), + ('5.99', '156', '2007-03-17T00:49:29.996577', '11587', '1'), + ('0.99', '370', '2007-03-19T07:23:45.996577', '13039', '1'), + ('0.99', '340', '2007-03-01T21:07:53.996577', '10809', '1'), + ('0.99', '197', '2007-03-18T22:55:27.996577', '12799', '1'), + ('4.99', '337', '2007-03-22T16:16:06.996577', '15241', '2'), + ('0.99', '530', '2007-04-29T16:59:41.996577', '8736', '1'), + ('6.99', '429', '2007-04-26T23:09:16.996577', '6977', '1'), + ('4.99', '452', '2007-03-19T08:46:26.996577', '13080', '1'), + ('3.99', '211', '2007-04-30T07:34:10.996577', '9111', '1'), + ('6.99', '29', '2007-03-18T13:49:12.996577', '12569', '2'), + ('4.99', '546', '2007-03-23T03:41:35.996577', '15565', '2'), + ('2.99', '577', '2007-03-23T14:56:25.996577', '15873', '2'), + ('4.99', '401', '2007-04-30T06:00:47.996577', '9701', '2'), + ('9.99', '599', '2007-04-12T15:32:22.996577', '6800', '2'), + ('4.99', '535', '2007-04-30T23:29:32.996577', '9524', '1'), + ('4.99', '291', '2007-04-29T15:14:33.996577', '8697', '2'), + ('2.99', '139', '2007-03-22T09:03:05.996577', '15062', '1'), + ('2.99', '83', '2007-04-11T10:19:26.996577', '6194', '2'), + ('4.99', '517', '2007-04-07T18:42:24.996577', '4374', '2'), + ('1.99', '168', '2007-03-17T02:57:22.996577', '11631', '1'), + ('5.99', '383', '2007-04-08T12:21:27.996577', '4747', '2'), + ('2.99', '167', '2007-04-10T12:17:56.996577', '5781', '1'), + ('3.99', '70', '2007-03-19T04:25:10.996577', '12951', '1'), + ('2.99', '23', '2007-04-11T11:11:33.996577', '6213', '1'), + ('0.99', '288', '2007-04-30T07:24:34.996577', '9732', '1'), + ('2.99', '158', '2007-03-20T13:17:08.996577', '13854', '2'), + ('2.99', '507', '2007-04-29T03:44:08.996577', '8369', '2'), + ('0.99', '268', '2007-03-22T02:00:31.996577', '14874', '1'), + ('0.99', '227', '2007-04-29T04:07:09.996577', '8384', '1'), + ('2.99', '509', '2007-02-15T05:49:47.996577', '1267', '1'), + ('2.99', '577', '2007-03-23T00:25:46.996577', '15480', '2'), + ('0.99', '29', '2007-03-21T01:30:11.996577', '14174', '1'), + ('5.99', '275', '2007-03-21T02:00:29.996577', '14187', '1'), + ('2.99', '101', '2007-04-08T22:31:12.996577', '4975', '1'), + ('2.99', '532', '2007-03-02T12:09:15.996577', '11251', '2'), + ('8.99', '404', '2007-03-18T13:15:54.996577', '12554', '1'), + ('7.99', '249', '2007-04-27T20:16:03.996577', '7544', '1'), + ('2.99', '6', '2007-04-07T13:21:50.996577', '4278', '2'), + ('5.99', '155', '2007-03-17T15:42:28.996577', '11951', '2'), + ('2.99', '115', '2007-05-14T13:44:29.996577', '13056', '2'), + ('3.99', '202', '2007-03-20T19:27:41.996577', '14019', '1'), + ('4.99', '305', '2007-04-29T22:23:20.996577', '8865', '2'), + ('3.99', '527', '2007-03-01T08:52:09.996577', '10486', '2'), + ('0.99', '182', '2007-04-07T17:31:03.996577', '4349', '1'), + ('4.99', '167', '2007-03-18T16:47:42.996577', '12642', '1'), + ('2.99', '195', '2007-04-07T16:08:52.996577', '4315', '1'), + ('4.99', '573', '2007-04-29T04:52:22.996577', '8400', '1'), + ('6.99', '80', '2007-03-01T15:06:30.996577', '10656', '1'), + ('2.99', '226', '2007-04-29T11:29:45.996577', '8600', '2'), + ('4.99', '108', '2007-02-20T16:33:21.996577', '3116', '2'), + ('5.99', '177', '2007-03-02T16:44:26.996577', '11376', '1'), + ('9.99', '512', '2007-03-17T10:50:30.996577', '11818', '2'), + ('4.99', '503', '2007-04-26T22:13:59.996577', '6950', '2'), + ('4.99', '292', '2007-04-07T09:43:37.996577', '4200', '1'), + ('4.99', '118', '2007-04-28T07:59:39.996577', '7850', '1'), + ('2.99', '210', '2007-02-14T23:01:30.996577', '1177', '2'), + ('9.99', '436', '2007-04-30T16:42:17.996577', '9345', '1'), + ('4.99', '419', '2007-04-06T08:29:49.996577', '3694', '1'), + ('9.99', '582', '2007-04-30T08:17:07.996577', '9768', '1'), + ('4.99', '467', '2007-03-17T12:45:06.996577', '11874', '1'), + ('8.99', '87', '2007-04-30T17:13:10.996577', '9364', '2'), + ('4.99', '225', '2007-04-09T03:21:01.996577', '5067', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['21410', '29202', '27966', '22305', '29820', '21077', '28216', '31061', '28495', '28770', '22023', '28124', '28213', '28864', '31049', '22647', '25438', '29372', '26351', '29668', '21468', '31105', '25411', '24363', '19443', '20555', '30344', '24560', '20806', '20854', '28168', '29241', '23952', '31261', '22077', '19484', '19888', '26296', '29020', '20550', '27709', '19178', '25095', '27268', '22423', '30505', '19256', '23351', '24503', '29595', '18103', '28939', '30400', '20805', '27617', '30765', '19133', '19508', '19064', '23297', '18175', '20165', '24251', '22760', '23770', '27545', '24763', '24682', '30250', '30847', '30872', '21584', '24576', '28382', '20989', '19741', '27543', '24020', '18942', '19512', '29371', '21923', '29634', '26809', '21238', '28741', '28380', '24989', '26098', '24783', '31335', '28111', '27469', '31550', '23450', '25277', '30600', '28189', '29997', '29412']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('4.99', '465', '2007-03-19T01:06:52.996577', '12864', '1'), + ('6.99', '20', '2007-04-11T14:21:26.996577', '6267', '2'), + ('2.99', '516', '2007-04-29T10:42:44.996577', '8585', '2'), + ('2.99', '563', '2007-03-19T00:10:10.996577', '12832', '1'), + ('2.99', '75', '2007-04-09T12:34:11.996577', '5260', '2'), + ('6.99', '432', '2007-03-23T09:24:41.996577', '15713', '1'), + ('4.99', '537', '2007-04-11T21:34:15.996577', '6409', '1'), + ('5.99', '181', '2007-04-30T12:15:43.996577', '9235', '2'), + ('5.99', '565', '2007-04-30T16:57:35.996577', '10025', '1'), + ('2.99', '588', '2007-04-29T08:38:09.996577', '8519', '2'), + ('4.99', '532', '2007-03-02T14:37:37.996577', '11318', '2'), + ('7.99', '529', '2007-04-12T20:37:12.996577', '6908', '1'), + ('2.99', '537', '2007-04-10T04:36:40.996577', '5630', '1'), + ('4.99', '595', '2007-04-27T14:32:19.996577', '7396', '1'), + ('5.99', '180', '2007-04-29T16:16:58.996577', '8720', '2'), + ('4.99', '204', '2007-03-21T01:25:18.996577', '14163', '2'), + ('0.99', '292', '2007-04-09T12:25:09.996577', '5257', '2'), + ('0.99', '35', '2007-04-08T23:17:15.996577', '4990', '2'), + ('0.99', '370', '2007-04-26T22:45:11.996577', '6968', '1'), + ('4.99', '61', '2007-04-28T16:05:54.996577', '8075', '2'), + ('3.99', '470', '2007-03-17T23:44:13.996577', '12177', '2'), + ('8.99', '185', '2007-04-29T14:44:59.996577', '8684', '1'), + ('2.99', '290', '2007-04-09T05:07:25.996577', '5105', '1'), + ('6.99', '175', '2007-03-20T18:19:54.996577', '13997', '2'), + ('2.99', '251', '2007-02-21T20:37:24.996577', '3464', '1'), + ('0.99', '377', '2007-03-22T09:56:52.996577', '15088', '2'), + ('1.99', '120', '2007-04-08T21:11:13.996577', '4942', '1'), + ('5.99', '196', '2007-03-21T19:18:24.996577', '14698', '1'), + ('4.99', '403', '2007-03-22T21:56:09.996577', '15410', '1'), + ('7.99', '408', '2007-03-20T00:41:20.996577', '13508', '1'), + ('8.99', '533', '2007-04-07T05:17:35.996577', '4112', '1'), + ('4.99', '24', '2007-04-12T18:14:55.996577', '6855', '1'), + ('10.99', '136', '2007-03-17T16:55:48.996577', '11992', '2'), + ('5.99', '209', '2007-04-07T15:58:07.996577', '4309', '1'), + ('4.99', '537', '2007-03-20T18:58:12.996577', '14010', '1'), + ('3.99', '260', '2007-02-20T05:24:46.996577', '2958', '2'), + ('5.99', '305', '2007-03-02T04:24:05.996577', '11035', '2'), + ('2.99', '366', '2007-04-07T13:19:25.996577', '4276', '2'), + ('4.99', '3', '2007-04-08T11:15:37.996577', '4725', '1'), + ('2.99', '377', '2007-03-02T01:45:55.996577', '10943', '1'), + ('4.99', '493', '2007-04-12T03:33:32.996577', '6552', '1'), + ('2.99', '177', '2007-02-15T14:41:16.996577', '1393', '1'), + ('6.99', '260', '2007-03-21T16:27:35.996577', '14610', '1'), + ('4.99', '453', '2007-04-08T10:51:09.996577', '4717', '1'), + ('0.99', '575', '2007-03-23T14:28:17.996577', '15857', '2'), + ('0.99', '133', '2007-04-27T14:45:03.996577', '7400', '1'), + ('3.99', '194', '2007-02-19T18:01:19.996577', '2807', '1'), + ('4.99', '70', '2007-03-18T01:16:40.996577', '12218', '2'), + ('3.99', '189', '2007-03-20T10:10:27.996577', '13766', '1'), + ('4.99', '53', '2007-04-28T02:20:47.996577', '7699', '1'), + ('6.99', '498', '2007-02-15T04:34:59.996577', '1253', '1'), + ('4.99', '204', '2007-04-27T14:29:31.996577', '7392', '1'), + ('4.99', '125', '2007-04-27T12:08:06.996577', '7323', '1'), + ('4.99', '403', '2007-03-21T20:30:34.996577', '14725', '2'), + ('3.99', '485', '2007-04-07T06:45:32.996577', '4137', '2'), + ('2.99', '156', '2007-04-27T14:24:41.996577', '7389', '2'), + ('2.99', '164', '2007-02-19T03:49:53.996577', '2589', '2'), + ('4.99', '266', '2007-02-20T12:07:07.996577', '3059', '1'), + ('2.99', '146', '2007-02-17T17:15:52.996577', '2099', '2'), + ('0.99', '64', '2007-03-18T08:12:24.996577', '12409', '1'), + ('10.99', '516', '2007-02-16T13:20:28.996577', '1718', '1'), + ('2.99', '338', '2007-03-01T20:10:18.996577', '10791', '2'), + ('2.99', '163', '2007-03-17T02:44:13.996577', '11623', '2'), + ('2.99', '8', '2007-03-18T15:44:27.996577', '12613', '1'), + ('6.99', '118', '2007-03-19T13:02:11.996577', '13193', '2'), + ('0.99', '479', '2007-04-09T22:20:23.996577', '5481', '1'), + ('4.99', '224', '2007-03-19T08:38:36.996577', '13075', '2'), + ('4.99', '214', '2007-03-20T13:28:21.996577', '13864', '1'), + ('2.99', '111', '2007-04-30T17:19:06.996577', '10039', '2'), + ('4.99', '164', '2007-04-08T02:50:20.996577', '4548', '2'), + ('0.99', '166', '2007-04-08T08:19:37.996577', '4658', '1'), + ('5.99', '482', '2007-03-23T14:09:46.996577', '15849', '1'), + ('0.99', '197', '2007-03-22T16:10:19.996577', '15233', '2'), + ('3.99', '555', '2007-04-28T23:05:35.996577', '8245', '1'), + ('4.99', '421', '2007-03-02T12:30:45.996577', '11263', '1'), + ('0.99', '289', '2007-03-17T23:34:36.996577', '12170', '1'), + ('0.99', '479', '2007-04-06T13:26:19.996577', '3798', '1'), + ('0.99', '141', '2007-03-22T18:23:18.996577', '15309', '1'), + ('0.99', '113', '2007-02-20T08:33:02.996577', '3004', '2'), + ('7.99', '267', '2007-02-19T03:08:32.996577', '2578', '2'), + ('4.99', '35', '2007-04-07T04:43:17.996577', '4098', '2'), + ('7.99', '520', '2007-03-23T17:27:59.996577', '15948', '1'), + ('0.99', '57', '2007-04-30T06:03:18.996577', '9703', '1'), + ('2.99', '410', '2007-04-30T13:16:50.996577', '9263', '1'), + ('2.99', '448', '2007-03-21T19:50:33.996577', '14711', '1'), + ('8.99', '585', '2007-04-30T18:53:50.996577', '9407', '2'), + ('2.99', '555', '2007-04-08T17:52:43.996577', '4875', '2'), + ('0.99', '251', '2007-03-17T06:59:29.996577', '11733', '1'), + ('4.99', '348', '2007-04-29T14:43:52.996577', '8682', '2'), + ('4.99', '226', '2007-03-23T15:47:43.996577', '15901', '1'), + ('5.99', '214', '2007-04-28T07:04:17.996577', '7826', '2'), + ('0.99', '528', '2007-04-12T03:52:28.996577', '6561', '2'), + ('6.99', '472', '2007-04-06T13:55:02.996577', '3815', '2'), + ('0.99', '233', '2007-04-29T11:17:20.996577', '8596', '2'), + ('0.99', '80', '2007-03-17T11:37:11.996577', '11839', '2'), + ('9.99', '279', '2007-04-09T16:43:58.996577', '5361', '1'), + ('2.99', '141', '2007-04-30T05:15:39.996577', '9683', '2'), + ('6.99', '535', '2007-04-08T11:00:34.996577', '4718', '1'), + ('6.99', '90', '2007-04-28T11:29:48.996577', '7946', '1'), + ('5.99', '38', '2007-04-12T18:27:51.996577', '6864', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['28167', '31259', '17798', '20677', '23698', '18214', '26793', '31362', '19057', '29602', '22656', '26074', '29247', '22401', '30232', '31909', '27183', '18940', '19811', '22252', '29343', '18356', '29449', '28422', '26620', '30002', '23943', '31838', '17530', '23034', '17517', '32057', '19751', '24812', '29502', '22400', '19002', '29708', '25572', '24620', '25229', '21875', '25340', '18493', '23578', '25498', '26094', '32072', '25540', '24087', '29407', '26589', '24736', '24428', '21893', '25193', '18403', '29111', '29334', '24061', '27603', '28765', '24831', '30927', '23260', '18535', '29642', '19666', '29410', '19265', '19894', '24280', '29886', '31227', '29855', '19068', '23236', '28849', '30122', '20913', '20433', '18277', '17744', '26316', '30359', '18137', '18410', '30454', '27834', '20056', '20952', '20875', '27415', '19166', '21173', '31465', '27766', '28193', '23643', '20272']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('2.99', '532', '2007-04-30T10:53:54.996577', '9843', '1'), + ('2.99', '209', '2007-04-05T22:46:55.996577', '3504', '2'), + ('3.99', '417', '2007-02-17T04:32:42.996577', '1921', '1'), + ('5.99', '390', '2007-03-17T21:23:11.996577', '12105', '1'), + ('2.99', '110', '2007-03-20T08:33:56.996577', '13723', '1'), + ('6.99', '526', '2007-02-21T09:05:37.996577', '3339', '1'), + ('5.99', '409', '2007-04-28T23:48:41.996577', '8265', '2'), + ('4.99', '218', '2007-04-27T03:12:19.996577', '7090', '2'), + ('4.99', '144', '2007-02-20T09:40:18.996577', '3019', '2'), + ('7.99', '54', '2007-04-11T18:08:07.996577', '6338', '1'), + ('0.99', '205', '2007-03-22T22:22:40.996577', '15418', '2'), + ('0.99', '347', '2007-04-28T06:34:27.996577', '7811', '1'), + ('0.99', '25', '2007-04-07T16:18:53.996577', '4319', '1'), + ('1.99', '573', '2007-03-17T21:52:51.996577', '12125', '1'), + ('3.99', '109', '2007-04-28T13:44:07.996577', '8006', '1'), + ('2.99', '266', '2007-04-29T07:32:43.996577', '8492', '1'), + ('0.99', '445', '2007-04-07T01:31:59.996577', '4041', '1'), + ('2.99', '113', '2007-02-18T05:16:49.996577', '2282', '1'), + ('0.99', '297', '2007-03-02T18:03:45.996577', '11413', '2'), + ('5.99', '557', '2007-03-23T03:53:21.996577', '15570', '2'), + ('0.99', '32', '2007-04-10T11:41:44.996577', '5767', '1'), + ('2.99', '570', '2007-02-16T19:01:41.996577', '1804', '2'), + ('2.99', '41', '2007-04-06T14:20:29.996577', '3827', '2'), + ('4.99', '559', '2007-04-11T10:46:33.996577', '6201', '1'), + ('0.99', '394', '2007-04-30T09:07:25.996577', '9147', '1'), + ('7.99', '90', '2007-04-30T23:21:06.996577', '10206', '2'), + ('2.99', '135', '2007-03-01T13:22:18.996577', '10611', '1'), + ('2.99', '260', '2007-04-11T17:37:59.996577', '6328', '2'), + ('0.99', '347', '2007-02-18T04:59:41.996577', '2274', '2'), + ('4.99', '36', '2007-03-17T10:35:20.996577', '11813', '1'), + ('8.99', '343', '2007-02-20T07:03:29.996577', '2980', '1'), + ('0.99', '142', '2007-05-14T13:44:29.996577', '15454', '1'), + ('2.99', '290', '2007-03-02T00:04:10.996577', '10901', '1'), + ('2.99', '231', '2007-03-02T06:54:50.996577', '11113', '2'), + ('0.99', '45', '2007-04-08T16:55:54.996577', '4843', '1'), + ('1.99', '573', '2007-03-17T18:02:15.996577', '12017', '1'), + ('3.99', '129', '2007-02-21T00:11:52.996577', '3219', '1'), + ('3.99', '64', '2007-04-30T13:33:23.996577', '9924', '1'), + ('0.99', '302', '2007-04-29T13:17:14.996577', '8646', '2'), + ('5.99', '201', '2007-03-23T18:34:30.996577', '15974', '2'), + ('7.99', '274', '2007-04-29T08:29:14.996577', '8517', '2'), + ('5.99', '515', '2007-03-19T02:09:57.996577', '12889', '1'), + ('2.99', '284', '2007-04-26T23:22:07.996577', '6982', '2'), + ('2.99', '208', '2007-02-19T11:54:19.996577', '2695', '1'), + ('4.99', '93', '2007-03-20T18:00:55.996577', '13993', '1'), + ('5.99', '296', '2007-04-11T21:03:15.996577', '6398', '1'), + ('6.99', '348', '2007-04-27T17:52:42.996577', '7482', '1'), + ('4.99', '190', '2007-05-14T13:44:29.996577', '15167', '2'), + ('0.99', '300', '2007-04-07T00:54:08.996577', '4030', '1'), + ('2.99', '147', '2007-03-22T08:37:45.996577', '15052', '1'), + ('4.99', '38', '2007-04-07T15:04:42.996577', '4300', '1'), + ('0.99', '391', '2007-04-30T11:58:13.996577', '9225', '1'), + ('2.99', '220', '2007-03-19T10:23:39.996577', '13123', '2'), + ('2.99', '181', '2007-03-18T18:09:53.996577', '12678', '1'), + ('5.99', '517', '2007-03-23T03:23:31.996577', '15559', '1'), + ('1.99', '271', '2007-04-06T05:40:52.996577', '3640', '1'), + ('7.99', '582', '2007-02-18T09:43:53.996577', '2337', '1'), + ('2.99', '11', '2007-04-28T17:11:37.996577', '8100', '2'), + ('3.99', '31', '2007-04-27T05:15:39.996577', '7138', '2'), + ('0.99', '145', '2007-03-19T16:17:39.996577', '13272', '2'), + ('6.99', '484', '2007-04-10T17:03:40.996577', '5866', '2'), + ('4.99', '588', '2007-04-11T19:47:27.996577', '6368', '1'), + ('5.99', '233', '2007-03-18T09:19:25.996577', '12443', '1'), + ('0.99', '170', '2007-04-07T22:46:25.996577', '4468', '2'), + ('4.99', '60', '2007-03-02T06:27:16.996577', '11092', '1'), + ('0.99', '10', '2007-02-19T18:30:25.996577', '2814', '1'), + ('0.99', '58', '2007-04-29T22:02:47.996577', '8853', '1'), + ('5.99', '279', '2007-03-21T22:29:22.996577', '14779', '1'), + ('2.99', '38', '2007-04-09T21:14:40.996577', '5460', '2'), + ('2.99', '197', '2007-02-14T22:43:41.996577', '1175', '2'), + ('6.99', '305', '2007-03-23T05:27:33.996577', '15612', '1'), + ('4.99', '167', '2007-03-18T19:44:06.996577', '12717', '2'), + ('5.99', '80', '2007-04-11T10:44:29.996577', '6199', '1'), + ('5.99', '198', '2007-04-28T19:03:07.996577', '8145', '1'), + ('2.99', '78', '2007-04-08T06:53:05.996577', '4627', '2'), + ('4.99', '146', '2007-02-20T17:36:26.996577', '3131', '1'), + ('0.99', '57', '2007-03-23T03:54:56.996577', '15571', '2'), + ('2.99', '594', '2007-04-29T11:35:33.996577', '8603', '1'), + ('5.99', '101', '2007-04-09T06:08:58.996577', '5132', '1'), + ('2.99', '414', '2007-03-19T14:57:13.996577', '13242', '1'), + ('4.99', '366', '2007-03-18T15:33:41.996577', '12608', '1'), + ('0.99', '546', '2007-02-15T15:00:25.996577', '1403', '2'), + ('4.99', '402', '2007-02-18T20:29:16.996577', '2490', '2'), + ('4.99', '367', '2007-04-10T01:08:06.996577', '5538', '2'), + ('1.99', '121', '2007-04-29T19:15:10.996577', '8788', '2'), + ('4.99', '507', '2007-02-15T08:34:41.996577', '1307', '2'), + ('0.99', '583', '2007-02-21T16:11:17.996577', '3424', '1'), + ('0.99', '129', '2007-04-08T23:28:12.996577', '4996', '1'), + ('2.99', '503', '2007-04-28T20:22:57.996577', '8178', '1'), + ('4.99', '326', '2007-03-02T02:40:14.996577', '10976', '2'), + ('2.99', '417', '2007-03-21T16:25:16.996577', '14607', '1'), + ('6.99', '410', '2007-03-20T16:19:14.996577', '13948', '2'), + ('2.99', '468', '2007-04-09T13:39:10.996577', '5285', '1'), + ('5.99', '174', '2007-02-18T08:42:48.996577', '2326', '1'), + ('1.99', '442', '2007-03-21T09:42:52.996577', '14418', '1'), + ('2.99', '227', '2007-04-28T22:14:57.996577', '8219', '1'), + ('2.99', '498', '2007-04-06T15:33:12.996577', '3856', '2'), + ('8.99', '535', '2007-04-10T18:28:51.996577', '5890', '2'), + ('2.99', '103', '2007-03-20T21:07:42.996577', '14064', '2'), + ('4.99', '348', '2007-03-19T03:53:56.996577', '12937', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['23301', '20055', '31179', '17938', '24206', '19514', '25563', '17534', '25750', '23281', '18102', '30524', '30576', '24663', '20026', '21839', '18871', '31723', '23354', '32015', '19962', '26138', '24337', '22808', '28534', '29707', '30143', '28842', '19706', '19012', '29805', '26486', '19115', '25373', '22698', '19196', '29439', '18349', '25883', '24832', '27704', '27685', '22263', '18543', '19787', '27264', '17525', '18843', '31272', '24914', '31266', '26937', '31461', '21235', '19063', '18747', '20376', '19880', '21683', '30662', '25512', '21680', '19953', '18563', '21973', '21949', '23810', '26510', '23075', '22095', '24235', '28254', '24130', '25181', '20630', '18929', '27599', '23452', '27432', '20850', '31630', '23299', '27033', '25780', '27474', '24683', '19764', '26632', '28727', '29994', '20774', '20992', '29766', '18837', '29922', '30526', '22930', '30566', '23706', '28725']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('0.99', '64', '2007-03-21T06:28:13.996577', '14316', '2'), + ('0.99', '326', '2007-03-01T17:32:59.996577', '10720', '2'), + ('2.99', '194', '2007-04-09T13:43:28.996577', '5291', '1'), + ('7.99', '454', '2007-02-16T22:22:19.996577', '1844', '2'), + ('5.99', '158', '2007-03-18T08:32:32.996577', '12421', '2'), + ('2.99', '267', '2007-02-19T11:57:54.996577', '2699', '2'), + ('4.99', '302', '2007-04-08T08:54:28.996577', '4676', '2'), + ('2.99', '348', '2007-02-16T08:11:14.996577', '1654', '1'), + ('3.99', '319', '2007-04-07T05:34:29.996577', '4119', '2'), + ('2.99', '62', '2007-03-21T16:02:50.996577', '14594', '2'), + ('4.99', '497', '2007-02-19T18:34:18.996577', '2818', '2'), + ('7.99', '135', '2007-04-27T20:41:07.996577', '7554', '1'), + ('6.99', '139', '2007-04-09T22:43:26.996577', '5494', '1'), + ('2.99', '212', '2007-03-21T14:52:19.996577', '14563', '1'), + ('4.99', '322', '2007-03-20T20:14:17.996577', '14042', '2'), + ('3.99', '512', '2007-03-22T17:04:25.996577', '15265', '2'), + ('1.99', '95', '2007-02-15T05:21:23.996577', '1261', '2'), + ('2.99', '248', '2007-04-12T07:08:22.996577', '6617', '2'), + ('4.99', '70', '2007-03-20T07:12:32.996577', '13680', '2'), + ('0.00', '15', '2007-05-14T13:44:29.996577', '13968', '2'), + ('2.99', '313', '2007-03-21T04:08:01.996577', '14250', '2'), + ('4.99', '352', '2007-04-27T21:35:07.996577', '7579', '1'), + ('4.99', '172', '2007-03-22T06:19:10.996577', '14991', '1'), + ('4.99', '14', '2007-03-02T20:46:50.996577', '11480', '1'), + ('0.99', '569', '2007-04-08T23:47:29.996577', '5003', '2'), + ('6.99', '64', '2007-04-30T12:17:28.996577', '9880', '1'), + ('5.99', '102', '2007-04-11T22:42:51.996577', '6434', '2'), + ('2.99', '594', '2007-04-06T20:37:19.996577', '3960', '2'), + ('0.99', '285', '2007-03-18T09:21:38.996577', '12444', '1'), + ('4.99', '132', '2007-02-18T00:50:33.996577', '2208', '1'), + ('2.99', '73', '2007-04-30T08:29:29.996577', '9776', '1'), + ('3.99', '382', '2007-04-05T21:40:09.996577', '3480', '2'), + ('0.99', '159', '2007-02-19T02:49:52.996577', '2572', '1'), + ('6.99', '286', '2007-04-30T13:44:04.996577', '9280', '2'), + ('4.99', '2', '2007-03-21T11:52:58.996577', '14475', '1'), + ('5.99', '181', '2007-02-19T08:19:01.996577', '2645', '1'), + ('2.99', '40', '2007-04-10T12:07:07.996577', '5777', '2'), + ('0.99', '568', '2007-02-19T09:57:13.996577', '2668', '2'), + ('8.99', '331', '2007-04-06T16:27:17.996577', '3871', '2'), + ('2.99', '233', '2007-03-21T07:41:35.996577', '14357', '2'), + ('2.99', '492', '2007-04-11T13:52:12.996577', '6257', '1'), + ('5.99', '490', '2007-04-29T09:42:28.996577', '8552', '1'), + ('8.99', '559', '2007-03-01T15:31:54.996577', '10669', '1'), + ('4.99', '12', '2007-02-19T06:40:17.996577', '2623', '2'), + ('5.99', '294', '2007-03-18T03:15:11.996577', '12278', '1'), + ('1.99', '452', '2007-04-29T23:30:46.996577', '8898', '1'), + ('4.99', '345', '2007-02-19T16:13:41.996577', '2766', '2'), + ('4.99', '87', '2007-02-18T22:31:54.996577', '2516', '1'), + ('8.99', '209', '2007-04-29T17:51:03.996577', '8759', '2'), + ('0.99', '242', '2007-03-01T04:40:45.996577', '10367', '2'), + ('0.99', '209', '2007-04-11T11:05:09.996577', '6210', '1'), + ('3.99', '423', '2007-04-28T16:36:28.996577', '8082', '2'), + ('4.99', '227', '2007-04-07T22:17:18.996577', '4459', '2'), + ('3.99', '448', '2007-03-19T15:16:21.996577', '13250', '2'), + ('1.99', '146', '2007-02-16T13:44:09.996577', '1724', '2'), + ('4.99', '62', '2007-02-20T09:41:27.996577', '3021', '2'), + ('0.99', '360', '2007-03-18T22:50:18.996577', '12795', '2'), + ('5.99', '304', '2007-03-18T12:45:56.996577', '12540', '1'), + ('5.99', '495', '2007-03-01T14:16:59.996577', '10643', '2'), + ('0.99', '147', '2007-04-08T14:58:04.996577', '4792', '2'), + ('0.99', '297', '2007-04-28T08:37:20.996577', '7867', '2'), + ('6.99', '494', '2007-03-22T09:49:34.996577', '15086', '1'), + ('0.99', '312', '2007-03-19T04:20:12.996577', '12945', '1'), + ('5.99', '18', '2007-02-17T18:21:08.996577', '2112', '2'), + ('9.99', '526', '2007-03-23T20:49:29.996577', '16043', '1'), + ('2.99', '523', '2007-03-22T08:09:35.996577', '15040', '1'), + ('7.99', '121', '2007-03-21T00:28:03.996577', '14138', '1'), + ('0.99', '384', '2007-04-11T20:44:22.996577', '6387', '2'), + ('2.99', '40', '2007-03-19T01:45:24.996577', '12877', '2'), + ('2.99', '539', '2007-03-22T19:52:45.996577', '15356', '1'), + ('0.99', '161', '2007-03-01T04:16:03.996577', '10355', '1'), + ('6.99', '540', '2007-04-12T13:07:53.996577', '6748', '1'), + ('2.99', '150', '2007-03-21T11:04:15.996577', '14454', '2'), + ('5.99', '269', '2007-04-12T07:44:50.996577', '6626', '1'), + ('2.99', '385', '2007-03-18T04:31:00.996577', '12310', '2'), + ('6.99', '111', '2007-02-16T03:43:18.996577', '1593', '1'), + ('4.99', '484', '2007-04-07T10:22:59.996577', '4214', '1'), + ('2.99', '80', '2007-03-18T10:10:13.996577', '12468', '2'), + ('0.99', '469', '2007-04-11T00:44:19.996577', '6022', '2'), + ('2.99', '408', '2007-03-17T22:26:21.996577', '12140', '1'), + ('0.99', '240', '2007-04-11T23:58:07.996577', '6470', '2'), + ('0.99', '64', '2007-03-20T17:13:19.996577', '13971', '1'), + ('0.99', '432', '2007-04-28T01:35:35.996577', '7681', '2'), + ('5.99', '321', '2007-04-12T18:22:23.996577', '6859', '1'), + ('5.99', '472', '2007-04-11T16:37:07.996577', '6308', '1'), + ('4.99', '214', '2007-03-21T07:10:57.996577', '14347', '2'), + ('10.99', '292', '2007-03-18T20:43:44.996577', '12739', '1'), + ('4.99', '396', '2007-04-12T13:57:53.996577', '6764', '2'), + ('4.99', '584', '2007-04-29T22:44:28.996577', '8879', '2'), + ('5.99', '90', '2007-04-27T01:34:35.996577', '7035', '2'), + ('2.99', '400', '2007-03-18T12:02:21.996577', '12514', '1'), + ('9.99', '421', '2007-03-19T23:17:30.996577', '13461', '2'), + ('0.99', '70', '2007-04-29T09:41:03.996577', '8550', '2'), + ('4.99', '86', '2007-02-18T22:44:49.996577', '2518', '1'), + ('5.99', '84', '2007-04-10T22:34:24.996577', '5971', '1'), + ('0.99', '135', '2007-04-29T02:05:33.996577', '8315', '1'), + ('3.99', '26', '2007-03-01T05:10:46.996577', '10386', '1'), + ('1.99', '138', '2007-04-30T13:06:10.996577', '9259', '2'), + ('5.99', '111', '2007-03-20T01:19:10.996577', '13525', '2'), + ('4.99', '584', '2007-04-27T13:47:08.996577', '7372', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['28948', '24716', '29581', '19202', '26706', '22165', '20681', '24210', '26912', '22367', '31507', '27983', '19915', '19963', '28507', '22058', '23823', '24510', '29471', '31973', '29734', '18762', '26709', '31046', '17814', '22155', '22533', '25992', '20278', '20836', '24422', '18008', '26560', '18755', '26728', '19361', '24898', '23843', '17674', '24672', '28771', '28881', '21672', '18964', '27528', '18751', '24118', '22506', '18409', '28053', '21532', '24708', '19342', '31428', '23801', '27974', '22219', '21152', '24758', '19670', '29928', '26738', '30052', '24962', '28736', '29238', '30486', '19146', '19059', '28401', '32020', '22672', '21265', '26639', '18337', '27323', '19689', '30409', '18752', '24923', '17884', '29727', '21432', '24073', '20035', '29313', '29218', '25140', '23011', '26807', '29930', '24030', '30394', '23796', '18610', '20973', '17711', '29194', '30020', '25953']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('2.99', '205', '2007-04-28T03:40:30.996577', '7736', '1'), + ('0.99', '218', '2007-03-19T05:19:28.996577', '12974', '1'), + ('3.99', '52', '2007-04-09T14:33:11.996577', '5313', '2'), + ('0.99', '182', '2007-02-18T02:29:54.996577', '2234', '1'), + ('4.99', '403', '2007-04-10T22:53:10.996577', '5982', '1'), + ('2.99', '547', '2007-03-19T04:14:52.996577', '12943', '2'), + ('0.99', '390', '2007-03-20T00:24:46.996577', '13501', '1'), + ('0.99', '158', '2007-03-20T19:51:29.996577', '14028', '2'), + ('3.99', '421', '2007-04-26T22:36:59.996577', '6960', '2'), + ('3.99', '569', '2007-03-18T13:44:10.996577', '12568', '1'), + ('4.99', '230', '2007-04-27T14:27:45.996577', '7390', '2'), + ('6.99', '518', '2007-04-08T21:22:47.996577', '4948', '2'), + ('2.99', '308', '2007-03-01T11:53:56.996577', '10571', '1'), + ('4.99', '313', '2007-03-21T06:44:04.996577', '14325', '1'), + ('6.99', '566', '2007-04-29T13:55:25.996577', '8660', '2'), + ('4.99', '535', '2007-03-18T17:50:22.996577', '12673', '2'), + ('4.99', '122', '2007-03-20T11:30:09.996577', '13812', '1'), + ('0.99', '190', '2007-03-17T07:35:26.996577', '11750', '2'), + ('3.99', '42', '2007-04-27T14:53:37.996577', '7405', '1'), + ('0.99', '476', '2007-05-14T13:44:29.996577', '13941', '1'), + ('2.99', '67', '2007-04-09T23:27:03.996577', '5510', '2'), + ('6.99', '66', '2007-02-21T13:47:45.996577', '3395', '2'), + ('4.99', '403', '2007-04-27T03:37:25.996577', '7103', '1'), + ('3.99', '180', '2007-04-10T16:37:15.996577', '5860', '1'), + ('0.99', '423', '2007-02-16T20:23:06.996577', '1827', '2'), + ('5.99', '546', '2007-03-20T13:11:29.996577', '13850', '2'), + ('1.99', '588', '2007-03-20T15:33:28.996577', '13923', '1'), + ('7.99', '339', '2007-04-12T10:41:09.996577', '6682', '2'), + ('7.99', '348', '2007-03-22T04:20:25.996577', '14937', '2'), + ('4.99', '407', '2007-03-01T19:22:59.996577', '10774', '2'), + ('2.99', '181', '2007-03-01T17:06:05.996577', '10703', '2'), + ('9.99', '469', '2007-02-16T09:45:48.996577', '1680', '1'), + ('8.99', '389', '2007-04-28T09:29:24.996577', '7896', '1'), + ('4.99', '65', '2007-02-20T11:35:18.996577', '3051', '1'), + ('2.99', '404', '2007-04-30T10:18:21.996577', '9824', '2'), + ('4.99', '230', '2007-02-16T15:08:24.996577', '1744', '1'), + ('4.99', '240', '2007-03-19T10:13:25.996577', '13119', '2'), + ('0.99', '125', '2007-03-17T17:15:33.996577', '11999', '1'), + ('2.99', '383', '2007-02-20T14:31:25.996577', '3091', '1'), + ('3.99', '214', '2007-03-01T11:34:29.996577', '10563', '1'), + ('2.99', '588', '2007-04-29T18:13:59.996577', '8769', '1'), + ('2.99', '597', '2007-04-10T10:04:58.996577', '5732', '2'), + ('0.99', '494', '2007-03-01T05:59:11.996577', '10403', '1'), + ('2.99', '119', '2007-02-17T10:16:57.996577', '2009', '2'), + ('2.99', '477', '2007-04-11T14:12:17.996577', '6265', '2'), + ('0.99', '63', '2007-02-16T19:59:00.996577', '1818', '2'), + ('2.99', '150', '2007-03-02T07:22:43.996577', '11123', '2'), + ('9.99', '585', '2007-03-02T13:12:28.996577', '11285', '1'), + ('3.99', '583', '2007-02-19T23:52:36.996577', '2879', '2'), + ('1.99', '523', '2007-04-27T23:45:17.996577', '7642', '2'), + ('4.99', '476', '2007-03-18T15:51:07.996577', '12616', '1'), + ('2.99', '217', '2007-03-17T03:27:52.996577', '11649', '1'), + ('7.99', '224', '2007-02-15T16:36:40.996577', '1424', '1'), + ('2.99', '224', '2007-04-26T23:49:45.996577', '6999', '2'), + ('9.99', '120', '2007-03-21T11:17:14.996577', '14460', '2'), + ('7.99', '517', '2007-04-09T09:39:27.996577', '5206', '1'), + ('7.99', '554', '2007-03-01T21:45:32.996577', '10829', '2'), + ('6.99', '440', '2007-03-18T07:59:31.996577', '12403', '2'), + ('5.99', '223', '2007-03-23T02:49:04.996577', '15546', '2'), + ('9.99', '280', '2007-03-01T22:17:59.996577', '10847', '1'), + ('2.99', '84', '2007-04-30T06:18:36.996577', '9074', '2'), + ('5.99', '405', '2007-04-30T01:56:53.996577', '8955', '1'), + ('5.99', '95', '2007-04-08T16:36:39.996577', '4835', '1'), + ('2.99', '247', '2007-03-02T14:13:36.996577', '11306', '2'), + ('6.99', '585', '2007-04-12T12:32:27.996577', '6733', '2'), + ('2.99', '24', '2007-04-07T18:57:34.996577', '4378', '2'), + ('4.99', '132', '2007-04-08T02:05:21.996577', '4534', '1'), + ('2.99', '169', '2007-02-21T02:36:07.996577', '3261', '1'), + ('2.99', '144', '2007-02-21T07:01:52.996577', '3321', '1'), + ('1.99', '557', '2007-04-30T17:17:23.996577', '9366', '2'), + ('0.99', '29', '2007-05-14T13:44:29.996577', '15577', '2'), + ('5.99', '207', '2007-03-02T13:12:48.996577', '11286', '2'), + ('1.99', '451', '2007-03-19T06:07:55.996577', '13003', '2'), + ('2.99', '396', '2007-04-30T19:52:50.996577', '10120', '2'), + ('2.99', '564', '2007-02-16T12:28:08.996577', '1705', '2'), + ('0.99', '459', '2007-04-11T11:00:40.996577', '6206', '1'), + ('2.99', '283', '2007-03-17T11:46:55.996577', '11846', '2'), + ('4.99', '125', '2007-04-30T06:58:14.996577', '9722', '1'), + ('0.99', '64', '2007-02-15T10:19:56.996577', '1335', '2'), + ('9.99', '242', '2007-03-19T16:10:32.996577', '13271', '1'), + ('5.99', '442', '2007-02-15T04:27:21.996577', '1251', '1'), + ('5.99', '66', '2007-04-11T18:49:44.996577', '6348', '2'), + ('0.99', '467', '2007-03-22T07:42:35.996577', '15032', '1'), + ('4.99', '146', '2007-03-20T04:35:27.996577', '13606', '1'), + ('2.99', '323', '2007-03-21T03:21:34.996577', '14224', '1'), + ('0.99', '30', '2007-04-09T13:42:34.996577', '5289', '1'), + ('6.99', '22', '2007-04-09T13:52:08.996577', '5294', '1'), + ('8.99', '265', '2007-03-20T07:54:43.996577', '13700', '2'), + ('0.99', '34', '2007-03-02T06:33:45.996577', '11096', '2'), + ('3.99', '410', '2007-04-29T12:27:39.996577', '8625', '2'), + ('0.99', '85', '2007-04-07T21:58:20.996577', '4451', '2'), + ('2.99', '142', '2007-03-22T19:12:32.996577', '15333', '2'), + ('3.99', '124', '2007-04-30T15:45:16.996577', '9986', '1'), + ('2.99', '120', '2007-03-19T12:05:07.996577', '13167', '2'), + ('4.99', '28', '2007-02-15T23:52:34.996577', '1543', '1'), + ('4.99', '419', '2007-03-02T04:07:38.996577', '11025', '2'), + ('2.99', '391', '2007-02-17T13:06:37.996577', '2045', '1'), + ('5.99', '19', '2007-04-30T09:34:49.996577', '9157', '1'), + ('4.99', '91', '2007-04-30T18:35:50.996577', '9396', '2'), + ('2.99', '336', '2007-04-10T05:43:33.996577', '5649', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['22910', '17866', '31436', '26837', '22965', '21858', '23656', '28684', '28993', '26782', '29859', '17516', '23289', '27769', '31482', '25199', '17730', '30902', '20182', '31984', '19140', '29408', '24834', '32024', '19376', '20259', '29137', '23990', '22961', '20057', '29288', '27977', '19439', '18003', '24773', '20985', '29338', '29689', '28379', '29239', '18067', '31050', '22097', '28375', '23626', '22764', '31187', '23517', '23612', '24048', '25716', '22750', '24808', '19756', '31845', '26515', '24830', '31994', '23988', '20419', '23891', '29119', '30940', '18938', '25564', '29017', '20359', '25351', '26317', '20947', '20037', '26792', '19033', '30579', '19700', '22620', '21056', '28389', '18452', '19120', '23149', '26680', '29291', '21602', '27336', '17946', '18399', '27208', '22679', '20781', '26282', '24291', '19815', '24709', '17755', '30145', '17567', '28549', '30907', '23702']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('0.99', '23', '2007-03-20T02:41:07.996577', '13557', '2'), + ('9.99', '436', '2007-02-18T06:05:12.996577', '2291', '1'), + ('2.99', '225', '2007-04-08T21:44:47.996577', '4955', '2'), + ('7.99', '414', '2007-04-11T23:43:50.996577', '6462', '2'), + ('2.99', '29', '2007-03-17T16:03:04.996577', '11962', '2'), + ('4.99', '514', '2007-03-17T20:05:13.996577', '12067', '2'), + ('3.99', '104', '2007-03-19T21:10:10.996577', '13410', '1'), + ('2.99', '581', '2007-04-07T12:10:24.996577', '4244', '2'), + ('5.99', '1', '2007-04-08T01:45:31.996577', '4526', '2'), + ('4.99', '409', '2007-04-08T03:02:26.996577', '4550', '2'), + ('0.99', '78', '2007-04-11T00:05:08.996577', '6005', '1'), + ('6.99', '343', '2007-02-18T18:26:38.996577', '2461', '2'), + ('7.99', '63', '2007-03-19T04:33:00.996577', '12954', '1'), + ('2.99', '498', '2007-04-09T13:40:07.996577', '5286', '1'), + ('2.99', '228', '2007-04-26T22:12:15.996577', '6948', '1'), + ('0.99', '271', '2007-04-29T11:02:24.996577', '8592', '1'), + ('1.99', '396', '2007-02-15T12:59:31.996577', '1370', '2'), + ('5.99', '168', '2007-04-10T19:10:07.996577', '5907', '1'), + ('5.99', '339', '2007-03-20T03:43:46.996577', '13575', '1'), + ('4.99', '521', '2007-05-14T13:44:29.996577', '11672', '2'), + ('0.99', '166', '2007-02-20T14:10:59.996577', '3085', '1'), + ('4.99', '38', '2007-04-08T07:42:55.996577', '4644', '2'), + ('1.99', '233', '2007-03-23T12:29:33.996577', '15790', '1'), + ('0.00', '42', '2007-05-14T13:44:29.996577', '15407', '1'), + ('5.99', '234', '2007-02-17T09:27:50.996577', '1993', '2'), + ('2.99', '347', '2007-03-18T00:36:15.996577', '12195', '1'), + ('9.99', '13', '2007-04-30T13:06:48.996577', '9260', '2'), + ('5.99', '139', '2007-03-21T20:54:19.996577', '14736', '2'), + ('2.99', '28', '2007-03-23T00:37:06.996577', '15491', '1'), + ('0.99', '326', '2007-03-02T03:34:53.996577', '11010', '2'), + ('0.99', '28', '2007-04-11T01:17:27.996577', '6032', '2'), + ('0.99', '517', '2007-04-12T20:26:41.996577', '6903', '2'), + ('7.99', '249', '2007-02-20T20:58:49.996577', '3175', '2'), + ('2.99', '468', '2007-02-16T20:11:15.996577', '1821', '1'), + ('5.99', '225', '2007-03-02T17:16:10.996577', '11395', '2'), + ('5.99', '420', '2007-03-02T11:45:47.996577', '11236', '2'), + ('2.99', '32', '2007-04-05T22:39:39.996577', '3500', '1'), + ('0.99', '63', '2007-04-30T20:47:42.996577', '10148', '2'), + ('2.99', '554', '2007-04-11T07:31:19.996577', '6144', '1'), + ('0.99', '24', '2007-04-09T14:29:00.996577', '5310', '1'), + ('5.99', '486', '2007-02-17T17:33:48.996577', '2102', '1'), + ('0.99', '180', '2007-04-30T17:34:02.996577', '9373', '1'), + ('3.99', '540', '2007-03-02T10:13:41.996577', '11198', '1'), + ('2.99', '553', '2007-04-30T02:10:43.996577', '9601', '2'), + ('0.99', '101', '2007-03-01T06:06:33.996577', '10407', '1'), + ('4.99', '8', '2007-03-23T12:59:45.996577', '15805', '1'), + ('2.99', '195', '2007-04-27T13:01:26.996577', '7349', '1'), + ('4.99', '86', '2007-03-22T10:17:42.996577', '15099', '2'), + ('5.99', '98', '2007-03-18T01:19:17.996577', '12221', '2'), + ('3.99', '144', '2007-03-19T00:50:42.996577', '12858', '1'), + ('4.99', '315', '2007-04-12T19:49:16.996577', '6894', '1'), + ('7.99', '7', '2007-03-16T23:19:58.996577', '11542', '2'), + ('0.99', '230', '2007-03-18T12:49:37.996577', '12542', '2'), + ('2.99', '290', '2007-03-19T19:47:53.996577', '13367', '1'), + ('0.99', '260', '2007-04-30T01:04:32.996577', '8933', '1'), + ('6.99', '385', '2007-04-08T10:41:14.996577', '4714', '1'), + ('4.99', '233', '2007-03-01T12:22:48.996577', '10582', '1'), + ('4.99', '557', '2007-05-14T13:44:29.996577', '14278', '1'), + ('6.99', '139', '2007-03-19T00:51:49.996577', '12859', '1'), + ('4.99', '364', '2007-03-20T07:52:52.996577', '13698', '1'), + ('4.99', '129', '2007-03-20T15:11:19.996577', '13915', '1'), + ('0.99', '12', '2007-04-09T05:30:45.996577', '5111', '2'), + ('2.99', '171', '2007-04-12T14:00:27.996577', '6766', '1'), + ('2.99', '112', '2007-02-20T09:39:01.996577', '3018', '2'), + ('0.99', '302', '2007-04-09T22:55:47.996577', '5498', '2'), + ('6.99', '2', '2007-04-30T21:08:19.996577', '9465', '2'), + ('4.99', '358', '2007-03-17T03:34:36.996577', '11653', '2'), + ('4.99', '285', '2007-04-11T04:23:08.996577', '6094', '1'), + ('2.99', '367', '2007-04-10T15:36:56.996577', '5839', '2'), + ('4.99', '417', '2007-03-18T03:18:58.996577', '12281', '2'), + ('4.99', '323', '2007-03-22T21:17:39.996577', '15387', '1'), + ('4.99', '409', '2007-04-28T14:59:46.996577', '8037', '1'), + ('0.99', '138', '2007-02-15T08:54:49.996577', '1316', '2'), + ('0.99', '139', '2007-04-27T13:36:24.996577', '7369', '1'), + ('4.99', '284', '2007-03-22T03:40:50.996577', '14921', '1'), + ('8.99', '599', '2007-03-23T04:38:10.996577', '15590', '2'), + ('4.99', '429', '2007-03-21T12:33:05.996577', '14495', '2'), + ('0.99', '556', '2007-04-10T09:38:30.996577', '5722', '2'), + ('2.99', '594', '2007-02-17T06:55:18.996577', '1950', '1'), + ('3.99', '161', '2007-02-20T13:20:45.996577', '3075', '1'), + ('2.99', '49', '2007-03-01T21:11:38.996577', '10814', '1'), + ('2.99', '400', '2007-04-30T22:44:15.996577', '10187', '1'), + ('4.99', '28', '2007-04-29T06:46:46.996577', '8464', '1'), + ('3.99', '485', '2007-03-02T09:45:37.996577', '11188', '2'), + ('4.99', '459', '2007-04-30T19:42:57.996577', '10117', '2'), + ('4.99', '454', '2007-02-21T10:48:20.996577', '3362', '1'), + ('3.99', '581', '2007-02-17T07:20:27.996577', '1958', '2'), + ('3.99', '446', '2007-04-30T00:37:15.996577', '8923', '1'), + ('1.99', '207', '2007-03-23T05:53:55.996577', '15625', '1'), + ('4.99', '401', '2007-03-18T10:55:03.996577', '12479', '2'), + ('4.99', '364', '2007-04-30T13:27:27.996577', '9266', '2'), + ('10.99', '168', '2007-03-17T02:54:13.996577', '11627', '1'), + ('10.99', '297', '2007-03-18T10:27:14.996577', '12472', '1'), + ('4.99', '217', '2007-03-17T15:51:46.996577', '11958', '1'), + ('2.99', '404', '2007-02-20T04:51:27.996577', '2951', '1'), + ('0.99', '102', '2007-04-27T09:01:24.996577', '7247', '2'), + ('1.99', '357', '2007-02-17T07:52:25.996577', '1971', '2'), + ('7.99', '570', '2007-04-30T17:54:15.996577', '9385', '1'), + ('1.99', '168', '2007-04-29T08:49:26.996577', '8527', '1'), + ('4.99', '111', '2007-03-02T03:09:32.996577', '10990', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['28604', '18286', '23072', '30598', '31107', '20072', '29303', '18636', '18301', '30504', '30279', '31606', '32079', '28112', '29832', '26340', '21604', '28976', '23991', '29131', '19543', '29145', '20799', '26638', '29395', '21770', '22979', '21549', '27675', '29197', '20938', '21986', '26314', '22795', '31611', '17923', '31378', '29390', '22300', '25112', '31765', '23092', '18220', '25403', '30760', '32034', '30767', '20059', '29600', '31222', '23415', '23684', '25176', '24469', '18460', '29207', '21194', '22806', '25753', '21586', '30008', '17759', '24299', '29416', '21876', '25338', '18592', '18852', '28194', '20028', '30628', '18048', '25762', '20623', '19021', '19645', '25177', '29603', '30709', '22020', '28531', '17608', '24841', '26031', '28772', '30496', '29191', '22514', '19100', '25105', '28816', '21769', '19022', '28017', '24973', '18343', '29089', '17569', '24710', '24328']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('7.99', '574', '2007-04-30T01:41:55.996577', '9589', '1'), + ('3.99', '550', '2007-02-17T00:00:12.996577', '1863', '1'), + ('0.99', '40', '2007-03-17T14:37:15.996577', '11919', '2'), + ('7.99', '141', '2007-04-30T06:18:22.996577', '9073', '2'), + ('2.99', '185', '2007-04-30T21:32:39.996577', '9473', '2'), + ('9.99', '327', '2007-03-23T16:24:27.996577', '15916', '1'), + ('6.99', '29', '2007-04-27T16:47:07.996577', '7451', '1'), + ('6.99', '32', '2007-02-17T02:21:44.996577', '1887', '2'), + ('6.99', '554', '2007-02-21T06:33:58.996577', '3312', '1'), + ('2.99', '133', '2007-04-27T06:36:05.996577', '7177', '1'), + ('2.99', '114', '2007-04-10T04:12:28.996577', '5625', '1'), + ('5.99', '238', '2007-04-10T03:49:37.996577', '5616', '1'), + ('0.00', '208', '2007-05-14T13:44:29.996577', '15717', '1'), + ('7.99', '528', '2007-04-27T21:07:19.996577', '7569', '1'), + ('5.99', '75', '2007-04-30T09:59:43.996577', '9168', '2'), + ('1.99', '369', '2007-04-09T01:53:44.996577', '5043', '1'), + ('2.99', '485', '2007-03-17T16:25:14.996577', '11974', '1'), + ('5.99', '207', '2007-04-27T11:25:52.996577', '7306', '2'), + ('2.99', '139', '2007-03-21T22:56:25.996577', '14788', '1'), + ('2.99', '13', '2007-04-12T04:14:13.996577', '6568', '1'), + ('4.99', '269', '2007-03-18T05:43:45.996577', '12344', '1'), + ('7.99', '14', '2007-04-09T14:38:51.996577', '5317', '2'), + ('0.99', '403', '2007-03-16T23:48:18.996577', '11558', '2'), + ('5.99', '396', '2007-04-30T16:42:11.996577', '9344', '1'), + ('2.99', '36', '2007-04-29T04:21:16.996577', '8391', '1'), + ('2.99', '504', '2007-03-16T23:59:30.996577', '11569', '2'), + ('2.99', '30', '2007-03-18T01:55:37.996577', '12240', '1'), + ('4.99', '479', '2007-03-02T06:48:55.996577', '11109', '2'), + ('4.99', '490', '2007-04-06T19:34:43.996577', '3932', '2'), + ('7.99', '19', '2007-04-30T22:09:01.996577', '10176', '1'), + ('1.99', '416', '2007-03-22T16:11:38.996577', '15235', '1'), + ('3.99', '528', '2007-03-18T23:33:25.996577', '12818', '1'), + ('8.99', '367', '2007-04-07T12:40:21.996577', '4251', '1'), + ('0.99', '12', '2007-03-23T18:57:10.996577', '15993', '1'), + ('0.99', '238', '2007-04-29T06:49:15.996577', '8465', '1'), + ('1.99', '451', '2007-02-19T10:01:37.996577', '2671', '1'), + ('0.99', '219', '2007-04-29T05:40:43.996577', '8430', '1'), + ('0.99', '36', '2007-04-11T01:06:17.996577', '6030', '2'), + ('2.99', '562', '2007-03-23T00:13:09.996577', '15475', '2'), + ('3.99', '262', '2007-03-22T17:17:08.996577', '15270', '2'), + ('0.99', '253', '2007-04-28T08:00:24.996577', '7851', '2'), + ('4.99', '42', '2007-03-18T10:53:42.996577', '12478', '1'), + ('4.99', '528', '2007-02-17T11:07:10.996577', '2019', '1'), + ('7.99', '289', '2007-04-12T03:12:51.996577', '6536', '2'), + ('2.99', '156', '2007-04-07T19:41:11.996577', '4394', '2'), + ('0.00', '60', '2007-05-14T13:44:29.996577', '14741', '2'), + ('6.99', '156', '2007-04-30T19:02:19.996577', '9409', '1'), + ('4.99', '326', '2007-03-02T21:01:51.996577', '11485', '2'), + ('2.99', '54', '2007-04-10T20:27:55.996577', '5929', '1'), + ('4.99', '198', '2007-04-12T19:29:48.996577', '6889', '2'), + ('2.99', '76', '2007-03-21T17:29:26.996577', '14637', '1'), + ('2.99', '108', '2007-03-18T14:20:02.996577', '12583', '1'), + ('1.99', '268', '2007-04-30T17:22:41.996577', '10040', '1'), + ('6.99', '186', '2007-03-19T12:05:54.996577', '13168', '1'), + ('0.99', '597', '2007-02-18T13:28:05.996577', '2379', '1'), + ('3.99', '20', '2007-04-30T21:22:18.996577', '9468', '2'), + ('0.99', '444', '2007-03-19T23:57:08.996577', '13488', '1'), + ('2.99', '14', '2007-03-01T03:51:26.996577', '10348', '1'), + ('8.99', '319', '2007-04-10T12:44:48.996577', '5791', '1'), + ('3.99', '482', '2007-03-23T15:11:19.996577', '15879', '1'), + ('4.99', '91', '2007-04-09T00:56:50.996577', '5025', '2'), + ('3.99', '405', '2007-02-19T09:06:20.996577', '2654', '2'), + ('3.99', '168', '2007-03-22T07:53:50.996577', '15033', '1'), + ('5.99', '38', '2007-04-27T12:02:04.996577', '7321', '2'), + ('4.99', '515', '2007-03-20T21:35:36.996577', '14072', '2'), + ('6.99', '284', '2007-04-09T07:26:22.996577', '5161', '1'), + ('4.99', '25', '2007-02-20T01:09:54.996577', '2901', '1'), + ('7.99', '89', '2007-02-19T20:12:37.996577', '2835', '1'), + ('2.99', '535', '2007-04-12T01:47:40.996577', '6504', '1'), + ('8.99', '322', '2007-03-23T08:52:14.996577', '15703', '2'), + ('5.99', '144', '2007-04-27T13:59:59.996577', '7378', '2'), + ('6.99', '479', '2007-02-19T15:55:51.996577', '2764', '2'), + ('0.99', '320', '2007-04-05T23:25:55.996577', '3519', '2'), + ('5.99', '384', '2007-03-22T05:06:36.996577', '14963', '1'), + ('9.99', '134', '2007-02-16T05:37:04.996577', '1618', '1'), + ('2.99', '278', '2007-03-01T17:50:14.996577', '10731', '1'), + ('9.99', '269', '2007-04-07T05:48:55.996577', '4125', '1'), + ('2.99', '54', '2007-04-12T03:50:32.996577', '6560', '2'), + ('2.99', '150', '2007-04-30T08:04:52.996577', '9121', '1'), + ('5.99', '532', '2007-03-01T17:16:22.996577', '10712', '2'), + ('6.99', '568', '2007-04-30T01:33:47.996577', '9583', '2'), + ('0.99', '366', '2007-02-18T01:13:03.996577', '2214', '2'), + ('3.99', '234', '2007-03-02T20:47:07.996577', '11481', '1'), + ('5.99', '343', '2007-04-28T13:57:26.996577', '8012', '2'), + ('2.99', '588', '2007-04-30T15:58:29.996577', '9326', '2'), + ('1.99', '132', '2007-04-27T23:29:41.996577', '7631', '1'), + ('4.99', '18', '2007-04-30T07:41:47.996577', '9114', '2'), + ('0.99', '586', '2007-03-19T02:23:00.996577', '12898', '1'), + ('1.99', '155', '2007-02-15T22:23:53.996577', '1519', '2'), + ('0.99', '262', '2007-03-01T06:42:36.996577', '10421', '2'), + ('9.99', '592', '2007-04-07T06:55:05.996577', '4145', '1'), + ('3.99', '504', '2007-03-01T09:53:54.996577', '10509', '2'), + ('0.99', '134', '2007-02-16T17:53:58.996577', '1784', '2'), + ('2.99', '520', '2007-04-29T05:48:42.996577', '8435', '2'), + ('0.99', '248', '2007-03-21T19:30:48.996577', '14704', '2'), + ('0.99', '566', '2007-02-18T12:28:57.996577', '2367', '1'), + ('4.99', '9', '2007-04-11T00:36:55.996577', '6019', '2'), + ('2.99', '358', '2007-02-15T18:19:32.996577', '1455', '1'), + ('4.99', '217', '2007-03-18T00:55:55.996577', '12210', '2'), + ('3.99', '172', '2007-03-01T02:57:32.996577', '10312', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['31764', '18986', '26508', '18827', '26313', '22271', '29419', '30450', '25967', '26331', '25778', '21598', '23338', '31383', '21029', '19026', '21171', '22898', '22293', '18053', '27224', '25413', '19961', '25742', '17940', '20633', '24129', '29185', '28026', '18388', '23411', '27985', '23212', '26176', '19266', '31966', '30669', '29221', '28453', '22214', '17677', '20462', '30827', '19122', '26292', '29909', '23309', '22706', '20345', '27434', '18431', '30331', '26889', '21473', '30515', '18524', '27621', '23077', '19435', '25507', '26982', '18737', '21350', '18789', '26791', '22901', '30284', '25170', '18502', '19445', '25423', '24081', '17762', '26740', '26756', '20831', '26746', '17768', '26747', '26757', '20834', '26743', '17767', '26752', '17763', '26751', '26748', '26749', '26745', '26753', '20830', '20832', '26742', '26741', '26754', '26750', '17764', '17766', '20833', '20835']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('2.99', '253', '2007-04-28T01:49:50.996577', '7689', '2'), + ('1.99', '124', '2007-02-18T09:28:31.996577', '2336', '2'), + ('4.99', '384', '2007-04-10T13:12:18.996577', '5797', '2'), + ('1.99', '85', '2007-02-16T10:35:23.996577', '1685', '1'), + ('2.99', '366', '2007-04-30T23:04:41.996577', '10198', '1'), + ('4.99', '559', '2007-03-21T16:54:25.996577', '14622', '2'), + ('0.99', '38', '2007-04-30T11:39:45.996577', '9216', '2'), + ('0.99', '129', '2007-04-06T19:43:29.996577', '3936', '2'), + ('2.99', '337', '2007-04-09T02:23:04.996577', '5050', '1'), + ('2.99', '368', '2007-04-12T10:32:38.996577', '6681', '1'), + ('8.99', '321', '2007-04-10T17:07:27.996577', '5867', '2'), + ('2.99', '484', '2007-03-23T05:22:32.996577', '15607', '1'), + ('4.99', '68', '2007-03-23T02:04:52.996577', '15524', '1'), + ('2.99', '220', '2007-04-10T03:44:09.996577', '5613', '2'), + ('4.99', '425', '2007-03-22T02:16:05.996577', '14881', '2'), + ('1.99', '135', '2007-02-16T08:58:48.996577', '1671', '2'), + ('7.99', '442', '2007-03-19T11:38:49.996577', '13155', '1'), + ('2.99', '22', '2007-03-20T20:47:19.996577', '14056', '1'), + ('6.99', '562', '2007-03-01T22:53:41.996577', '10868', '2'), + ('4.99', '481', '2007-02-21T04:58:39.996577', '3285', '2'), + ('2.99', '448', '2007-04-07T10:00:42.996577', '4206', '2'), + ('2.99', '290', '2007-04-10T14:50:46.996577', '5827', '2'), + ('2.99', '313', '2007-03-17T17:48:10.996577', '12011', '2'), + ('4.99', '317', '2007-04-30T22:56:56.996577', '9513', '2'), + ('4.99', '454', '2007-02-17T05:47:02.996577', '1938', '1'), + ('0.99', '385', '2007-03-19T10:01:46.996577', '13117', '1'), + ('0.99', '150', '2007-03-21T01:27:43.996577', '14165', '2'), + ('3.99', '18', '2007-04-08T20:13:05.996577', '4923', '2'), + ('1.99', '521', '2007-04-27T17:44:28.996577', '7478', '1'), + ('6.99', '576', '2007-02-21T00:46:40.996577', '3226', '2'), + ('5.99', '75', '2007-03-23T16:51:50.996577', '15928', '2'), + ('2.99', '518', '2007-04-26T22:28:26.996577', '6957', '1'), + ('4.99', '54', '2007-03-23T03:49:02.996577', '15567', '1'), + ('1.99', '355', '2007-04-29T05:22:47.996577', '8418', '2'), + ('0.99', '197', '2007-02-15T12:33:37.996577', '1363', '1'), + ('0.00', '448', '2007-05-14T13:44:29.996577', '13577', '1'), + ('0.99', '147', '2007-04-27T01:55:55.996577', '7044', '2'), + ('7.99', '22', '2007-04-28T02:31:24.996577', '7705', '1'), + ('0.99', '562', '2007-04-09T16:42:29.996577', '5360', '2'), + ('4.99', '553', '2007-03-17T05:58:10.996577', '11710', '2'), + ('7.99', '384', '2007-02-18T13:26:15.996577', '2378', '1'), + ('2.99', '368', '2007-03-22T22:59:35.996577', '15437', '1'), + ('4.99', '161', '2007-04-30T08:35:19.996577', '9135', '1'), + ('0.99', '162', '2007-02-18T12:15:05.996577', '2366', '1'), + ('4.99', '365', '2007-04-30T10:38:45.996577', '9184', '2'), + ('6.99', '83', '2007-04-06T09:38:53.996577', '3722', '2'), + ('6.99', '65', '2007-03-21T00:33:23.996577', '14140', '2'), + ('8.99', '3', '2007-03-21T19:19:14.996577', '14699', '2'), + ('5.99', '356', '2007-03-19T22:19:11.996577', '13442', '2'), + ('4.99', '469', '2007-04-12T15:15:32.996577', '6797', '1'), + ('8.99', '589', '2007-02-19T12:25:34.996577', '2707', '1'), + ('5.99', '119', '2007-04-09T08:07:57.996577', '5176', '1'), + ('0.99', '419', '2007-04-10T20:35:14.996577', '5933', '2'), + ('4.99', '470', '2007-03-21T09:13:27.996577', '14405', '2'), + ('1.99', '134', '2007-04-29T13:27:30.996577', '8650', '2'), + ('0.99', '7', '2007-02-19T12:28:52.996577', '2709', '1'), + ('3.99', '485', '2007-04-09T17:07:41.996577', '5367', '1'), + ('0.99', '40', '2007-03-19T20:00:11.996577', '13376', '1'), + ('0.99', '249', '2007-02-15T00:50:12.996577', '1204', '1'), + ('8.99', '297', '2007-04-10T10:26:04.996577', '5743', '1'), + ('4.99', '426', '2007-04-30T12:42:22.996577', '9247', '2'), + ('0.99', '58', '2007-02-19T00:42:37.996577', '2543', '2'), + ('10.99', '460', '2007-03-01T18:40:59.996577', '10754', '2'), + ('4.99', '75', '2007-02-20T23:28:51.996577', '3210', '1'), + ('0.99', '409', '2007-04-28T11:15:13.996577', '7940', '2'), + ('6.99', '22', '2007-03-23T04:31:57.996577', '15589', '1'), + ('2.99', '114', '2007-04-27T21:02:25.996577', '7565', '2'), + ('6.99', '268', '2007-04-10T18:20:43.996577', '5888', '2'), + ('2.99', '2', '2007-02-17T19:23:24.996577', '2128', '1'), + ('4.99', '252', '2007-02-19T13:08:43.996577', '2716', '2'), + ('4.99', '291', '2007-04-05T23:11:32.996577', '3512', '2'), + ('4.99', '147', '2007-03-20T02:10:23.996577', '13542', '2'), + ('4.99', '406', '2007-02-17T18:26:12.996577', '2113', '1'), + ('4.99', '406', '2007-04-07T12:53:54.996577', '4264', '2'), + ('2.99', '406', '2007-04-30T22:08:48.996577', '9487', '2'), + ('4.99', '406', '2007-03-17T01:50:36.996577', '11603', '1'), + ('4.99', '406', '2007-04-27T06:27:01.996577', '7171', '1'), + ('4.99', '406', '2007-02-21T06:15:24.996577', '3306', '1'), + ('4.99', '406', '2007-04-27T09:34:26.996577', '7259', '1'), + ('8.99', '406', '2007-04-30T04:31:43.996577', '9660', '1'), + ('2.99', '406', '2007-03-21T09:48:47.996577', '14421', '2'), + ('0.99', '406', '2007-04-10T11:35:57.996577', '5766', '1'), + ('7.99', '406', '2007-02-20T21:32:46.996577', '3186', '1'), + ('0.99', '406', '2007-04-29T23:36:32.996577', '8903', '1'), + ('3.99', '406', '2007-02-17T21:19:02.996577', '2150', '2'), + ('0.99', '406', '2007-04-29T12:36:25.996577', '8630', '2'), + ('7.99', '406', '2007-04-27T22:23:18.996577', '7604', '2'), + ('4.99', '406', '2007-04-28T16:33:32.996577', '8080', '2'), + ('5.99', '406', '2007-04-27T03:57:23.996577', '7109', '2'), + ('1.99', '406', '2007-04-30T02:12:11.996577', '8962', '2'), + ('1.99', '406', '2007-03-01T14:05:22.996577', '10632', '1'), + ('5.99', '406', '2007-03-18T11:45:56.996577', '12505', '2'), + ('0.99', '406', '2007-04-09T12:39:02.996577', '5263', '2'), + ('4.99', '406', '2007-04-09T04:42:20.996577', '5098', '2'), + ('0.99', '406', '2007-04-30T11:54:03.996577', '9224', '2'), + ('2.99', '406', '2007-04-29T01:10:40.996577', '8295', '2'), + ('2.99', '406', '2007-02-18T03:00:07.996577', '2241', '1'), + ('0.99', '406', '2007-02-19T03:33:29.996577', '2585', '2'), + ('6.99', '406', '2007-03-21T02:25:41.996577', '14205', '2'), + ('2.99', '406', '2007-03-21T16:14:18.996577', '14601', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['26755', '26744', '17765', '25911', '25917', '20124', '25923', '25922', '25920', '25919', '25913', '25915', '20126', '20123', '20120', '20118', '20125', '25921', '25916', '20119', '25912', '25918', '20122', '25914', '20121', '25931', '25933', '20134', '25925', '20130', '20129', '20132', '20137', '20136', '25928', '20131', '20133', '31935', '25926', '20127', '25924', '20135', '25935', '20128', '25932', '25934', '20138', '25929', '25927', '25930', '27104', '17872', '17871', '21129', '21132', '17874', '21130', '17875', '27099', '17873', '27094', '17870', '27097', '27106', '21128', '31962', '21135', '27100', '27107', '27096', '21136', '21134', '27098', '27103', '27105', '27102', '21131', '21133', '27101', '27095', '28071', '28069', '21960', '28066', '21958', '28068', '28072', '28074', '28073', '21956', '28076', '31985', '21959', '28075', '28070', '28067', '21957', '18205', '27788', '27787']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('4.99', '406', '2007-04-30T14:32:05.996577', '9291', '1'), + ('2.99', '406', '2007-04-11T22:52:14.996577', '6439', '2'), + ('0.99', '406', '2007-02-18T08:36:33.996577', '2325', '2'), + ('0.99', '333', '2007-04-09T01:08:13.996577', '5032', '2'), + ('6.99', '333', '2007-04-27T02:40:40.996577', '7076', '2'), + ('2.99', '333', '2007-03-21T21:03:59.996577', '14740', '1'), + ('2.99', '333', '2007-04-30T17:53:21.996577', '10062', '1'), + ('4.99', '333', '2007-04-30T17:15:12.996577', '10035', '2'), + ('4.99', '333', '2007-04-30T09:07:36.996577', '9148', '2'), + ('4.99', '333', '2007-04-29T16:14:11.996577', '8719', '1'), + ('4.99', '333', '2007-04-10T18:31:08.996577', '5892', '2'), + ('4.99', '333', '2007-04-26T21:31:23.996577', '6931', '2'), + ('4.99', '333', '2007-03-22T18:28:08.996577', '15313', '1'), + ('4.99', '333', '2007-03-20T20:51:25.996577', '14057', '1'), + ('0.99', '333', '2007-03-18T17:38:36.996577', '12661', '2'), + ('4.99', '333', '2007-03-01T22:15:24.996577', '10844', '2'), + ('2.99', '333', '2007-03-22T16:33:47.996577', '15253', '2'), + ('10.99', '333', '2007-04-30T16:31:39.996577', '9338', '2'), + ('0.99', '333', '2007-04-26T22:31:07.996577', '6958', '2'), + ('6.99', '333', '2007-03-18T08:52:43.996577', '12427', '1'), + ('1.99', '333', '2007-04-10T05:26:47.996577', '5645', '1'), + ('0.99', '333', '2007-04-27T08:59:07.996577', '7246', '2'), + ('4.99', '333', '2007-03-20T08:03:46.996577', '13710', '2'), + ('0.99', '333', '2007-04-11T14:40:37.996577', '6275', '2'), + ('3.99', '333', '2007-03-20T03:50:32.996577', '13579', '1'), + ('4.99', '334', '2007-04-12T13:11:31.996577', '6749', '2'), + ('7.99', '334', '2007-04-30T02:42:33.996577', '8977', '1'), + ('0.99', '334', '2007-03-21T17:41:13.996577', '14645', '1'), + ('6.99', '334', '2007-04-08T05:25:33.996577', '4603', '1'), + ('7.99', '334', '2007-03-02T03:17:28.996577', '10997', '2'), + ('1.99', '334', '2007-03-01T23:01:46.996577', '10879', '1'), + ('4.99', '334', '2007-03-19T18:20:28.996577', '13325', '2'), + ('4.99', '334', '2007-03-23T07:07:24.996577', '15656', '2'), + ('0.99', '334', '2007-03-23T02:54:46.996577', '15548', '2'), + ('5.99', '334', '2007-04-10T14:19:38.996577', '5818', '2'), + ('4.99', '334', '2007-03-18T18:04:31.996577', '12677', '2'), + ('2.99', '334', '2007-03-20T13:43:54.996577', '13876', '1'), + ('0.99', '334', '2007-05-14T13:44:29.996577', '14219', '1'), + ('4.99', '334', '2007-04-09T00:20:15.996577', '5014', '2'), + ('4.99', '334', '2007-03-01T06:10:36.996577', '10408', '1'), + ('4.99', '334', '2007-04-06T06:40:14.996577', '3662', '1'), + ('7.99', '334', '2007-03-22T06:03:57.996577', '14984', '1'), + ('3.99', '334', '2007-04-30T23:21:27.996577', '10207', '1'), + ('2.99', '334', '2007-03-01T09:10:54.996577', '10492', '1'), + ('2.99', '334', '2007-04-26T23:28:16.996577', '6987', '1'), + ('2.99', '334', '2007-04-30T03:32:34.996577', '9633', '1'), + ('3.99', '334', '2007-03-23T07:34:43.996577', '15669', '1'), + ('4.99', '334', '2007-04-10T15:51:40.996577', '5845', '1'), + ('0.99', '334', '2007-04-09T19:53:46.996577', '5434', '2'), + ('5.99', '334', '2007-04-12T09:01:40.996577', '6641', '2'), + ('0.99', '438', '2007-04-27T22:04:27.996577', '7598', '1'), + ('0.99', '438', '2007-02-18T00:43:11.996577', '2206', '2'), + ('0.99', '438', '2007-02-16T17:23:37.996577', '1779', '2'), + ('4.99', '438', '2007-03-01T13:13:09.996577', '10607', '1'), + ('0.99', '438', '2007-03-18T17:25:06.996577', '12654', '2'), + ('4.99', '438', '2007-02-21T06:45:30.996577', '3315', '1'), + ('4.99', '438', '2007-03-17T03:18:12.996577', '11644', '2'), + ('0.99', '438', '2007-02-21T11:47:04.996577', '3368', '2'), + ('4.99', '438', '2007-04-11T07:04:30.996577', '6138', '2'), + ('4.99', '438', '2007-02-19T04:00:48.996577', '2591', '1'), + ('4.99', '438', '2007-04-07T17:49:45.996577', '4355', '1'), + ('4.99', '438', '2007-02-15T16:54:55.996577', '1431', '1'), + ('4.99', '438', '2007-04-09T19:33:13.996577', '5426', '2'), + ('3.99', '438', '2007-04-30T06:39:48.996577', '9082', '1'), + ('6.99', '438', '2007-03-01T10:04:45.996577', '10512', '1'), + ('0.99', '438', '2007-05-14T13:44:29.996577', '12524', '2'), + ('5.99', '438', '2007-03-21T15:36:59.996577', '14582', '2'), + ('3.99', '438', '2007-04-12T04:02:35.996577', '6563', '1'), + ('0.99', '438', '2007-04-30T08:42:52.996577', '9782', '2'), + ('4.99', '438', '2007-04-09T14:38:08.996577', '5316', '2'), + ('5.99', '438', '2007-03-23T15:30:26.996577', '15893', '2'), + ('4.99', '438', '2007-03-19T21:16:00.996577', '13414', '1'), + ('2.99', '438', '2007-04-10T17:08:51.996577', '5870', '1'), + ('8.99', '438', '2007-04-27T13:49:23.996577', '7374', '2'), + ('2.99', '438', '2007-04-29T09:38:41.996577', '8547', '2'), + ('1.99', '438', '2007-04-27T13:16:57.996577', '7357', '2'), + ('4.99', '438', '2007-03-17T15:06:46.996577', '11933', '2'), + ('7.99', '438', '2007-03-19T18:03:39.996577', '13319', '2'), + ('4.99', '438', '2007-04-12T07:04:48.996577', '6615', '2'), + ('2.99', '438', '2007-04-07T21:40:42.996577', '4446', '2'), + ('4.99', '525', '2007-04-27T12:40:30.996577', '7337', '2'), + ('6.99', '525', '2007-04-11T20:45:42.996577', '6388', '2'), + ('3.99', '525', '2007-03-23T05:51:55.996577', '15623', '2'), + ('6.99', '525', '2007-04-06T22:05:32.996577', '3993', '1'), + ('1.99', '525', '2007-03-17T03:51:08.996577', '11660', '1'), + ('7.99', '525', '2007-04-11T04:51:54.996577', '6098', '2'), + ('4.99', '525', '2007-04-27T21:54:20.996577', '7591', '2'), + ('4.99', '525', '2007-04-30T02:04:57.996577', '8960', '1'), + ('0.99', '525', '2007-04-28T13:50:53.996577', '8007', '1'), + ('2.99', '525', '2007-03-01T09:21:42.996577', '10496', '1'), + ('0.99', '525', '2007-04-30T06:02:33.996577', '9702', '1'), + ('2.99', '525', '2007-05-14T13:44:29.996577', '14954', '1'), + ('0.99', '525', '2007-03-22T13:00:51.996577', '15159', '1'), + ('5.99', '525', '2007-04-30T22:50:55.996577', '9507', '2'), + ('1.99', '525', '2007-04-12T10:50:39.996577', '6689', '1'), + ('2.99', '525', '2007-04-10T15:39:57.996577', '5841', '1'), + ('2.99', '525', '2007-03-02T17:44:36.996577', '11406', '2'), + ('2.99', '525', '2007-02-16T16:41:20.996577', '1772', '2'), + ('6.99', '499', '2007-04-28T09:36:48.996577', '7898', '1'), + ('0.99', '499', '2007-04-28T07:12:47.996577', '7831', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['21723', '21720', '21715', '21716', '18109', '21713', '27781', '21721', '18110', '27789', '27780', '21722', '18112', '21712', '27786', '21717', '21719', '27784', '27785', '21711', '27782', '21714', '27783', '27790', '18111', '21718', '27791', '31402', '19337', '31400', '19334', '24746', '24749', '24740', '24744', '24743', '31395', '24741', '31397', '24745', '31394', '31401', '31405', '31398', '19333', '31396', '31399', '31404', '24748', '19335', '24747', '24742', '19336', '31403', '23000', '32021', '23004', '23006', '29353', '29358', '29359', '29355', '23007', '18640', '23002', '23001', '29357', '29360', '29354', '29356', '18641', '23008', '23003', '23005', '28260', '18262', '22115', '22108', '22107', '28259', '28262', '22109', '22106', '22113', '22114', '22117', '22111', '28261', '22118', '18263', '28258', '22112', '22116', '28264', '28263', '22110', '21151', '27115', '21148', '27116']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('7.99', '499', '2007-03-23T04:28:54.996577', '15587', '1'), + ('4.99', '499', '2007-03-19T04:22:47.996577', '12947', '2'), + ('4.99', '499', '2007-03-17T16:30:36.996577', '11978', '2'), + ('8.99', '499', '2007-03-17T17:25:19.996577', '12004', '1'), + ('2.99', '499', '2007-02-15T11:42:25.996577', '1355', '1'), + ('7.99', '499', '2007-03-16T22:19:59.996577', '11513', '1'), + ('2.99', '499', '2007-04-09T00:39:20.996577', '5022', '1'), + ('3.99', '499', '2007-03-20T12:07:54.996577', '13822', '2'), + ('4.99', '499', '2007-02-15T22:56:17.996577', '1526', '2'), + ('4.99', '499', '2007-04-28T18:16:41.996577', '8130', '2'), + ('4.99', '499', '2007-04-06T13:03:52.996577', '3794', '1'), + ('3.99', '499', '2007-03-22T01:14:44.996577', '14858', '1'), + ('1.99', '499', '2007-02-21T01:22:58.996577', '3241', '2'), + ('2.99', '499', '2007-03-01T09:24:25.996577', '10497', '2'), + ('0.99', '499', '2007-04-28T06:19:25.996577', '7800', '1'), + ('7.99', '499', '2007-03-18T06:02:33.996577', '12354', '1'), + ('1.99', '499', '2007-03-18T14:31:39.996577', '12587', '1'), + ('4.99', '499', '2007-04-10T21:51:34.996577', '5956', '1'), + ('4.99', '499', '2007-04-12T12:13:23.996577', '6723', '2'), + ('0.99', '499', '2007-03-01T03:26:58.996577', '10333', '2'), + ('2.99', '499', '2007-04-09T18:00:56.996577', '5392', '2'), + ('0.99', '499', '2007-03-17T02:01:09.996577', '11606', '2'), + ('3.99', '499', '2007-04-09T19:40:52.996577', '5427', '2'), + ('3.99', '499', '2007-04-29T18:22:16.996577', '8770', '1'), + ('4.99', '499', '2007-02-16T20:47:09.996577', '1830', '2'), + ('3.99', '499', '2007-03-18T09:09:31.996577', '12436', '1'), + ('0.99', '499', '2007-04-30T01:41:39.996577', '9588', '1'), + ('0.99', '221', '2007-04-29T07:22:04.996577', '8486', '2'), + ('5.99', '221', '2007-02-20T22:51:13.996577', '3200', '1'), + ('0.99', '221', '2007-04-27T04:46:27.996577', '7129', '1'), + ('2.99', '221', '2007-02-18T09:18:35.996577', '2331', '1'), + ('5.99', '221', '2007-03-21T06:34:56.996577', '14322', '2'), + ('8.99', '221', '2007-03-22T11:21:48.996577', '15125', '1'), + ('4.99', '221', '2007-03-17T04:40:53.996577', '11680', '2'), + ('3.99', '221', '2007-03-18T15:55:04.996577', '12620', '2'), + ('0.99', '221', '2007-03-18T05:06:46.996577', '12324', '1'), + ('4.99', '221', '2007-04-08T08:00:31.996577', '4649', '2'), + ('4.99', '221', '2007-03-17T05:25:22.996577', '11693', '1'), + ('5.99', '221', '2007-04-09T02:49:01.996577', '5058', '1'), + ('2.99', '221', '2007-03-19T22:02:52.996577', '13434', '2'), + ('4.99', '221', '2007-04-07T14:22:13.996577', '4293', '1'), + ('8.99', '221', '2007-04-27T19:48:00.996577', '7531', '2'), + ('0.99', '221', '2007-04-30T11:26:46.996577', '9853', '2'), + ('5.99', '221', '2007-04-10T20:02:24.996577', '5920', '2'), + ('0.99', '221', '2007-02-15T12:57:40.996577', '1369', '1'), + ('6.99', '221', '2007-04-08T09:36:02.996577', '4693', '1'), + ('2.99', '221', '2007-04-27T03:35:00.996577', '7101', '1'), + ('7.99', '221', '2007-04-30T20:48:30.996577', '9453', '1'), + ('7.99', '221', '2007-03-21T09:44:12.996577', '14419', '1'), + ('2.99', '221', '2007-02-18T19:11:11.996577', '2473', '2'), + ('0.99', '221', '2007-03-21T08:05:42.996577', '14371', '2'), + ('2.99', '221', '2007-03-17T10:01:17.996577', '11802', '1'), + ('10.99', '221', '2007-02-19T09:18:28.996577', '2660', '1'), + ('6.99', '221', '2007-04-30T15:45:05.996577', '9320', '1'), + ('2.99', '33', '2007-03-01T03:27:56.996577', '10335', '2'), + ('0.99', '33', '2007-05-14T13:44:29.996577', '12277', '1'), + ('7.99', '33', '2007-03-20T16:40:10.996577', '13958', '1'), + ('0.99', '33', '2007-03-21T16:57:39.996577', '14623', '1'), + ('5.99', '33', '2007-04-07T04:30:14.996577', '4095', '1'), + ('4.99', '33', '2007-04-30T05:00:11.996577', '9040', '1'), + ('4.99', '33', '2007-04-30T06:45:50.996577', '9085', '2'), + ('4.99', '33', '2007-04-10T09:43:14.996577', '5723', '1'), + ('5.99', '33', '2007-03-22T10:11:30.996577', '15096', '1'), + ('10.99', '33', '2007-02-15T08:14:59.996577', '1301', '1'), + ('7.99', '33', '2007-03-19T14:53:26.996577', '13241', '1'), + ('4.99', '33', '2007-03-01T22:55:38.996577', '10870', '1'), + ('4.99', '33', '2007-04-28T13:21:32.996577', '7992', '1'), + ('1.99', '33', '2007-04-30T12:54:37.996577', '9254', '1'), + ('0.99', '33', '2007-04-09T19:17:38.996577', '5421', '1'), + ('0.99', '33', '2007-04-11T15:04:43.996577', '6280', '2'), + ('8.99', '33', '2007-02-20T20:49:36.996577', '3173', '2'), + ('2.99', '33', '2007-03-22T10:56:27.996577', '15115', '2'), + ('2.99', '33', '2007-03-20T13:19:23.996577', '13858', '1'), + ('0.99', '33', '2007-03-20T18:40:45.996577', '14002', '1'), + ('7.99', '541', '2007-04-11T23:55:35.996577', '6468', '2'), + ('2.99', '541', '2007-02-17T09:03:25.996577', '1986', '2'), + ('3.99', '541', '2007-03-22T12:10:15.996577', '15141', '2'), + ('4.99', '541', '2007-03-18T04:16:21.996577', '12306', '1'), + ('0.99', '541', '2007-03-02T12:49:21.996577', '11273', '2'), + ('4.99', '541', '2007-04-09T09:12:20.996577', '5197', '2'), + ('8.99', '541', '2007-04-28T17:42:26.996577', '8113', '1'), + ('4.99', '541', '2007-03-18T07:34:56.996577', '12395', '2'), + ('5.99', '541', '2007-03-01T02:47:44.996577', '10306', '1'), + ('6.99', '541', '2007-03-22T04:21:05.996577', '14938', '2'), + ('4.99', '541', '2007-03-22T09:27:09.996577', '15071', '1'), + ('0.99', '541', '2007-03-22T22:25:03.996577', '15421', '1'), + ('4.99', '541', '2007-03-19T14:50:39.996577', '13239', '2'), + ('2.99', '541', '2007-04-12T12:06:32.996577', '6718', '2'), + ('1.99', '541', '2007-03-23T16:37:25.996577', '15924', '2'), + ('6.99', '541', '2007-02-19T12:27:31.996577', '2708', '1'), + ('2.99', '541', '2007-04-09T00:29:31.996577', '5018', '1'), + ('0.99', '541', '2007-03-20T05:51:19.996577', '13640', '2'), + ('1.99', '541', '2007-03-22T15:42:05.996577', '15223', '1'), + ('0.99', '541', '2007-04-30T02:12:09.996577', '9603', '2'), + ('4.99', '541', '2007-04-29T02:21:15.996577', '8322', '1'), + ('7.99', '541', '2007-03-19T02:17:54.996577', '12894', '1'), + ('0.99', '439', '2007-03-23T19:56:01.996577', '16018', '1'), + ('2.99', '439', '2007-04-29T03:13:42.996577', '8343', '1'), + ('4.99', '439', '2007-03-22T13:09:31.996577', '15162', '2'), + ('2.99', '439', '2007-04-29T12:24:02.996577', '8624', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['17879', '17877', '27114', '27118', '27112', '21145', '21141', '21144', '21140', '27111', '21147', '21138', '27117', '21146', '27110', '27108', '17878', '17876', '21149', '21137', '21150', '21142', '21143', '17880', '21139', '27119', '17881', '27109', '27113', '25645', '19929', '19935', '19928', '25657', '25652', '25647', '25648', '25644', '25650', '19932', '19933', '25653', '19930', '25646', '19934', '25658', '25656', '25649', '19936', '25651', '25655', '25654', '25659', '19931', '29482', '32025', '29489', '29490', '23099', '23097', '29491', '32026', '23102', '18676', '29481', '29486', '29488', '23100', '29484', '29483', '29480', '29485', '23098', '23096', '23101', '29487', '23228', '29613', '23220', '32031', '23230', '29617', '29614', '23226', '29615', '23222', '29620', '29618', '23221', '23225', '23223', '18729', '18727', '23224', '23229', '23231', '29621', '18728', '18730', '29616']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('2.99', '439', '2007-02-19T06:35:57.996577', '2621', '1'), + ('0.99', '439', '2007-02-16T00:57:01.996577', '1557', '2'), + ('2.99', '439', '2007-04-12T10:17:42.996577', '6672', '2'), + ('0.99', '439', '2007-04-30T13:37:41.996577', '9275', '1'), + ('2.99', '439', '2007-04-10T18:33:56.996577', '5893', '1'), + ('4.99', '439', '2007-03-19T19:32:46.996577', '13358', '2'), + ('2.99', '439', '2007-03-17T16:52:24.996577', '11989', '1'), + ('3.99', '439', '2007-03-18T23:53:37.996577', '12826', '2'), + ('5.99', '439', '2007-03-16T23:23:33.996577', '11544', '2'), + ('5.99', '439', '2007-04-10T13:27:31.996577', '5801', '2'), + ('9.99', '439', '2007-03-22T08:20:20.996577', '15044', '2'), + ('2.99', '439', '2007-03-02T00:14:25.996577', '10905', '1'), + ('2.99', '439', '2007-04-29T15:41:10.996577', '8703', '2'), + ('5.99', '439', '2007-03-21T20:49:37.996577', '14730', '2'), + ('4.99', '439', '2007-04-08T15:38:22.996577', '4813', '1'), + ('5.99', '439', '2007-04-06T11:53:33.996577', '3774', '2'), + ('4.99', '439', '2007-02-17T17:08:30.996577', '2097', '2'), + ('4.99', '439', '2007-02-15T05:28:05.996577', '1264', '1'), + ('4.99', '439', '2007-03-23T07:03:08.996577', '15653', '2'), + ('1.99', '439', '2007-03-01T18:25:15.996577', '10744', '2'), + ('1.99', '439', '2007-03-23T13:28:24.996577', '15818', '1'), + ('2.99', '439', '2007-03-18T16:00:02.996577', '12621', '1'), + ('5.99', '439', '2007-03-18T21:07:13.996577', '12755', '2'), + ('2.99', '439', '2007-02-20T07:40:17.996577', '2992', '1'), + ('6.99', '439', '2007-03-02T04:32:59.996577', '11042', '2'), + ('6.99', '439', '2007-04-30T15:50:05.996577', '9322', '1'), + ('6.99', '439', '2007-02-21T05:31:49.996577', '3294', '1'), + ('2.99', '439', '2007-04-08T01:53:20.996577', '4528', '1'), + ('2.99', '439', '2007-04-12T04:43:31.996577', '6577', '1'), + ('7.99', '309', '2007-04-06T17:37:41.996577', '3896', '2'), + ('0.99', '309', '2007-03-01T17:43:35.996577', '10728', '1'), + ('5.99', '309', '2007-03-22T00:42:14.996577', '14846', '2'), + ('2.99', '309', '2007-03-01T07:48:14.996577', '10458', '1'), + ('2.99', '309', '2007-04-30T00:15:28.996577', '8917', '1'), + ('4.99', '309', '2007-04-28T03:13:24.996577', '7722', '2'), + ('4.99', '309', '2007-04-08T02:31:54.996577', '4540', '1'), + ('8.99', '309', '2007-04-09T14:24:02.996577', '5305', '2'), + ('4.99', '309', '2007-04-06T14:56:09.996577', '3837', '2'), + ('4.99', '309', '2007-04-12T00:17:55.996577', '6480', '2'), + ('5.99', '309', '2007-03-19T06:36:30.996577', '13021', '2'), + ('0.99', '309', '2007-03-20T00:26:41.996577', '13502', '2'), + ('5.99', '309', '2007-04-28T07:49:44.996577', '7846', '1'), + ('2.99', '309', '2007-03-01T21:21:11.996577', '10818', '1'), + ('4.99', '309', '2007-04-07T08:17:35.996577', '4172', '2'), + ('4.99', '309', '2007-03-20T14:55:02.996577', '13909', '2'), + ('2.99', '309', '2007-04-30T14:16:17.996577', '9945', '2'), + ('2.99', '309', '2007-04-29T14:40:27.996577', '8681', '1'), + ('4.99', '309', '2007-04-10T22:46:47.996577', '5980', '1'), + ('4.99', '309', '2007-03-22T22:26:35.996577', '15422', '2'), + ('5.99', '309', '2007-04-27T07:51:59.996577', '7214', '2'), + ('2.99', '309', '2007-04-29T07:41:17.996577', '8501', '1'), + ('4.99', '309', '2007-04-29T03:10:27.996577', '8341', '1'), + ('0.99', '309', '2007-04-30T14:18:36.996577', '9949', '1'), + ('6.99', '309', '2007-03-17T16:05:29.996577', '11964', '2'), + ('4.99', '43', '2007-04-09T07:28:37.996577', '5162', '1'), + ('3.98', '43', '2007-05-14T13:44:29.996577', '15644', '2'), + ('4.99', '43', '2007-04-28T08:37:21.996577', '7868', '2'), + ('4.99', '43', '2007-04-29T03:53:58.996577', '8376', '2'), + ('4.99', '43', '2007-03-22T00:23:18.996577', '14837', '2'), + ('2.99', '43', '2007-03-21T03:58:21.996577', '14244', '1'), + ('4.99', '43', '2007-04-30T11:12:24.996577', '9204', '1'), + ('0.00', '43', '2007-05-14T13:44:29.996577', '15745', '1'), + ('2.99', '43', '2007-03-23T17:20:07.996577', '15945', '2'), + ('4.99', '43', '2007-02-15T23:56:48.996577', '1544', '2'), + ('2.99', '43', '2007-04-08T00:36:16.996577', '4498', '1'), + ('3.99', '43', '2007-04-12T00:05:12.996577', '6474', '1'), + ('4.99', '43', '2007-04-27T13:00:58.996577', '7348', '1'), + ('4.99', '43', '2007-03-22T12:56:12.996577', '15155', '2'), + ('2.99', '43', '2007-04-10T15:02:28.996577', '5831', '1'), + ('4.99', '43', '2007-04-09T18:27:36.996577', '5401', '1'), + ('1.99', '43', '2007-04-06T07:54:22.996577', '3683', '2'), + ('4.99', '43', '2007-04-10T21:09:13.996577', '5941', '2'), + ('4.99', '43', '2007-03-21T17:47:47.996577', '14649', '1'), + ('4.99', '43', '2007-03-17T07:40:18.996577', '11753', '1'), + ('6.99', '43', '2007-03-23T12:52:10.996577', '15800', '2'), + ('0.99', '43', '2007-04-12T10:30:22.996577', '6680', '2'), + ('5.99', '56', '2007-03-20T10:12:18.996577', '13769', '1'), + ('7.99', '56', '2007-04-06T09:26:22.996577', '3718', '1'), + ('6.99', '56', '2007-03-01T04:17:43.996577', '10356', '2'), + ('4.99', '56', '2007-05-14T13:44:29.996577', '15714', '2'), + ('0.99', '56', '2007-03-21T13:44:55.996577', '14534', '2'), + ('4.99', '56', '2007-04-09T06:33:49.996577', '5142', '1'), + ('2.99', '56', '2007-04-06T11:48:00.996577', '3771', '2'), + ('4.99', '56', '2007-03-18T19:35:54.996577', '12713', '2'), + ('3.99', '56', '2007-04-07T04:39:21.996577', '4097', '1'), + ('4.99', '56', '2007-03-02T01:49:05.996577', '10946', '1'), + ('0.99', '56', '2007-04-28T11:18:10.996577', '7942', '2'), + ('2.99', '56', '2007-04-27T14:18:12.996577', '7385', '1'), + ('0.99', '56', '2007-03-01T15:54:50.996577', '10678', '2'), + ('1.99', '56', '2007-03-18T12:35:05.996577', '12537', '2'), + ('5.99', '56', '2007-03-02T16:13:28.996577', '11358', '1'), + ('4.99', '56', '2007-02-18T19:54:29.996577', '2485', '1'), + ('6.99', '56', '2007-02-16T18:37:27.996577', '1795', '2'), + ('4.99', '56', '2007-03-17T03:39:35.996577', '11656', '1'), + ('3.99', '56', '2007-03-21T05:31:31.996577', '14291', '2'), + ('7.99', '56', '2007-03-23T08:51:54.996577', '15702', '2'), + ('0.99', '56', '2007-04-29T00:28:44.996577', '8285', '1'), + ('0.99', '56', '2007-02-17T20:08:55.996577', '2140', '1'), + ('0.99', '56', '2007-02-20T07:28:03.996577', '2989', '1'), + ('4.99', '56', '2007-04-08T10:10:02.996577', '4702', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['23227', '29619', '17661', '20590', '20595', '17659', '20592', '20594', '20601', '20600', '17663', '26482', '26479', '26472', '17662', '26480', '26484', '20589', '20593', '26473', '26477', '26476', '17660', '20599', '26483', '20597', '26481', '26474', '26478', '26485', '20591', '26475', '20596', '20598', '20237', '17519', '20239', '26035', '26040', '20234', '26038', '20238', '20235', '20236', '17521', '20233', '17520', '26037', '26039', '26036', '29036', '18507', '22716', '22713', '22710', '22715', '18512', '18508', '22714', '22711', '22709', '18511', '29033', '18509', '29034', '18510', '22718', '22712', '22717', '22719', '29032', '29035', '19463', '25042', '25043', '31791', '19464', '25040', '25044', '31790', '25034', '25045', '19466', '19468', '25037', '25038', '19465', '25036', '25035', '25039', '19462', '19467', '25041', '31792', '31794', '31793', '31795', '23667', '30180', '23661']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('8.99', '56', '2007-03-20T02:45:42.996577', '13560', '2'), + ('7.99', '56', '2007-04-28T02:10:01.996577', '7696', '1'), + ('2.99', '381', '2007-02-18T15:23:34.996577', '2410', '2'), + ('0.99', '381', '2007-03-01T17:07:20.996577', '10705', '2'), + ('8.99', '381', '2007-03-19T13:26:56.996577', '13202', '2'), + ('3.99', '381', '2007-02-15T14:59:34.996577', '1402', '1'), + ('2.99', '381', '2007-03-17T22:18:50.996577', '12135', '2'), + ('2.99', '381', '2007-03-18T16:22:47.996577', '12632', '2'), + ('4.99', '381', '2007-03-23T10:57:50.996577', '15747', '1'), + ('4.99', '381', '2007-03-22T18:11:23.996577', '15299', '2'), + ('2.99', '381', '2007-02-21T16:35:33.996577', '3425', '2'), + ('0.99', '381', '2007-04-30T08:50:41.996577', '9144', '2'), + ('2.99', '381', '2007-04-27T13:50:59.996577', '7375', '1'), + ('0.99', '381', '2007-04-06T13:50:45.996577', '3812', '2'), + ('4.99', '381', '2007-02-18T15:43:08.996577', '2418', '1'), + ('2.99', '381', '2007-04-27T23:56:08.996577', '7645', '1'), + ('2.99', '381', '2007-04-30T10:16:51.996577', '9822', '1'), + ('0.99', '381', '2007-03-01T13:17:07.996577', '10608', '1'), + ('4.99', '381', '2007-03-18T01:53:04.996577', '12237', '2'), + ('2.99', '381', '2007-04-06T21:16:43.996577', '3970', '2'), + ('4.99', '381', '2007-04-11T23:20:45.996577', '6451', '2'), + ('2.99', '381', '2007-04-11T06:06:04.996577', '6116', '2'), + ('1.99', '381', '2007-02-17T01:23:58.996577', '1878', '1'), + ('4.99', '381', '2007-03-21T02:16:57.996577', '14198', '1'), + ('4.99', '381', '2007-04-30T10:08:36.996577', '9173', '2'), + ('0.99', '381', '2007-03-20T04:57:03.996577', '13614', '1'), + ('0.99', '381', '2007-04-29T14:59:58.996577', '8688', '2'), + ('0.99', '381', '2007-04-08T11:40:53.996577', '4735', '1'), + ('2.99', '381', '2007-04-12T14:34:26.996577', '6778', '2'), + ('4.99', '381', '2007-04-30T17:12:55.996577', '10033', '2'), + ('2.99', '381', '2007-03-16T22:29:53.996577', '11519', '1'), + ('0.99', '381', '2007-04-10T07:52:43.996577', '5689', '2'), + ('0.99', '381', '2007-03-19T21:54:09.996577', '13430', '2'), + ('2.99', '381', '2007-03-20T18:03:09.996577', '13995', '2'), + ('0.99', '344', '2007-03-21T16:46:25.996577', '14621', '1'), + ('3.99', '344', '2007-02-15T10:54:44.996577', '1341', '1'), + ('2.99', '344', '2007-03-22T15:23:52.996577', '15215', '1'), + ('5.99', '344', '2007-04-07T00:47:40.996577', '4028', '2'), + ('4.99', '344', '2007-04-30T08:56:47.996577', '9788', '2'), + ('5.99', '344', '2007-03-18T00:02:39.996577', '12183', '2'), + ('4.99', '344', '2007-04-27T17:48:19.996577', '7480', '2'), + ('0.99', '344', '2007-03-21T17:01:08.996577', '14624', '2'), + ('4.99', '344', '2007-03-19T06:24:34.996577', '13014', '2'), + ('3.99', '344', '2007-03-19T07:03:05.996577', '13033', '1'), + ('0.99', '344', '2007-02-16T14:00:38.996577', '1731', '1'), + ('5.99', '344', '2007-03-02T07:03:06.996577', '11116', '2'), + ('4.99', '344', '2007-02-15T19:36:27.996577', '1475', '2'), + ('5.99', '344', '2007-04-11T19:41:45.996577', '6363', '2'), + ('2.99', '344', '2007-04-29T09:57:38.996577', '8561', '2'), + ('3.99', '344', '2007-04-07T17:27:23.996577', '4347', '2'), + ('5.99', '4', '2007-04-30T17:26:26.996577', '9371', '1'), + ('4.99', '4', '2007-02-15T07:59:54.996577', '1297', '1'), + ('6.99', '4', '2007-03-20T11:24:06.996577', '13807', '1'), + ('8.99', '4', '2007-03-18T03:43:10.996577', '12294', '2'), + ('2.99', '4', '2007-03-02T06:48:57.996577', '11110', '1'), + ('2.99', '4', '2007-03-20T08:00:30.996577', '13704', '1'), + ('5.99', '4', '2007-02-19T08:07:27.996577', '2642', '1'), + ('0.99', '4', '2007-02-16T06:37:06.996577', '1633', '1'), + ('1.99', '4', '2007-03-19T00:47:39.996577', '12856', '2'), + ('4.99', '4', '2007-03-16T22:56:27.996577', '11529', '2'), + ('0.99', '4', '2007-03-02T05:38:00.996577', '11069', '2'), + ('0.99', '4', '2007-02-17T12:59:38.996577', '2043', '2'), + ('2.99', '4', '2007-04-28T03:06:25.996577', '7718', '2'), + ('2.99', '4', '2007-02-16T12:29:53.996577', '1707', '2'), + ('3.99', '4', '2007-04-29T17:13:23.996577', '8741', '1'), + ('0.99', '4', '2007-02-16T14:20:18.996577', '1735', '2'), + ('2.99', '4', '2007-03-22T12:26:49.996577', '15147', '1'), + ('2.99', '4', '2007-03-17T22:42:29.996577', '12151', '1'), + ('4.99', '4', '2007-03-21T03:22:03.996577', '14225', '2'), + ('1.99', '4', '2007-03-23T06:11:26.996577', '15635', '2'), + ('2.99', '4', '2007-04-28T00:38:36.996577', '7660', '1'), + ('5.99', '4', '2007-04-30T07:14:35.996577', '9100', '1'), + ('0.99', '256', '2007-02-17T07:46:05.996577', '1965', '2'), + ('3.99', '256', '2007-03-21T11:16:19.996577', '14458', '2'), + ('2.99', '256', '2007-03-23T05:24:30.996577', '15609', '2'), + ('0.99', '256', '2007-04-07T08:56:26.996577', '4182', '2'), + ('4.99', '256', '2007-02-17T07:54:41.996577', '1973', '2'), + ('4.99', '256', '2007-03-20T20:03:53.996577', '14036', '2'), + ('4.99', '256', '2007-03-23T14:44:11.996577', '15861', '2'), + ('0.99', '256', '2007-04-07T06:20:19.996577', '4130', '1'), + ('4.99', '256', '2007-03-01T18:51:17.996577', '10759', '2'), + ('7.99', '256', '2007-03-23T14:46:38.996577', '15864', '1'), + ('6.99', '256', '2007-02-18T13:28:30.996577', '2380', '1'), + ('4.99', '256', '2007-02-19T20:35:50.996577', '2839', '1'), + ('0.99', '256', '2007-03-19T23:01:48.996577', '13457', '2'), + ('0.99', '256', '2007-03-20T06:18:34.996577', '13651', '1'), + ('4.99', '256', '2007-02-18T02:19:15.996577', '2230', '2'), + ('8.99', '256', '2007-03-17T02:55:44.996577', '11628', '2'), + ('2.99', '256', '2007-03-02T03:35:33.996577', '11011', '2'), + ('6.99', '256', '2007-03-20T18:44:32.996577', '14003', '1'), + ('2.99', '256', '2007-02-16T00:45:33.996577', '1555', '1'), + ('4.99', '256', '2007-02-19T01:43:18.996577', '2561', '2'), + ('2.99', '256', '2007-03-21T10:36:08.996577', '14445', '2'), + ('2.99', '256', '2007-04-09T08:29:10.996577', '5179', '1'), + ('3.99', '256', '2007-04-28T00:38:53.996577', '7661', '1'), + ('0.99', '256', '2007-04-11T16:10:59.996577', '6298', '1'), + ('2.99', '256', '2007-04-30T19:39:22.996577', '9424', '2'), + ('2.99', '105', '2007-03-23T12:55:33.996577', '15803', '2'), + ('4.99', '105', '2007-04-09T19:42:29.996577', '5429', '1'), + ('2.99', '105', '2007-03-19T02:32:00.996577', '12899', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['23663', '30181', '23665', '18907', '23664', '30179', '30187', '18906', '30184', '30186', '18908', '23659', '30183', '30182', '23660', '30188', '23666', '23662', '30185', '17635', '20533', '20531', '20528', '26412', '17636', '20530', '26413', '20538', '17634', '20535', '20534', '26415', '26416', '20532', '26414', '20527', '20529', '20537', '20536', '26537', '26538', '26540', '20650', '20647', '20648', '20654', '20646', '17691', '20652', '17694', '26541', '20645', '17690', '26539', '20655', '20651', '17692', '17695', '17693', '20649', '20653', '21311', '27297', '21315', '17951', '27301', '17953', '27296', '21313', '17955', '17954', '17952', '17956', '21316', '17957', '21314', '27298', '21318', '27300', '21319', '27302', '21320', '21312', '27299', '21317', '24602', '32077', '31252', '31245', '19282', '19277', '24608', '31244', '24604', '24605', '31248', '24601', '31247', '19281', '31250']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('2.99', '105', '2007-03-20T09:45:29.996577', '13751', '1'), + ('2.99', '105', '2007-04-10T01:14:19.996577', '5542', '2'), + ('4.99', '105', '2007-03-23T05:52:53.996577', '15624', '2'), + ('3.99', '105', '2007-02-17T09:17:49.996577', '1991', '2'), + ('0.99', '105', '2007-03-20T20:31:44.996577', '14048', '2'), + ('4.99', '105', '2007-04-09T12:35:22.996577', '5261', '2'), + ('5.99', '105', '2007-04-30T11:05:34.996577', '9198', '2'), + ('3.99', '105', '2007-02-16T18:17:44.996577', '1789', '2'), + ('2.99', '105', '2007-04-27T16:15:26.996577', '7442', '1'), + ('3.99', '105', '2007-04-30T08:11:38.996577', '9124', '2'), + ('3.99', '105', '2007-02-19T07:37:11.996577', '2635', '2'), + ('4.99', '105', '2007-03-01T10:06:00.996577', '10513', '1'), + ('4.99', '105', '2007-04-12T03:25:43.996577', '6546', '2'), + ('4.99', '105', '2007-04-10T07:09:54.996577', '5677', '2'), + ('0.99', '105', '2007-03-18T01:13:10.996577', '12217', '1'), + ('9.99', '105', '2007-04-30T11:25:10.996577', '9210', '2'), + ('4.99', '105', '2007-03-23T08:17:11.996577', '15688', '2'), + ('6.99', '105', '2007-03-19T08:08:31.996577', '13057', '1'), + ('2.99', '105', '2007-04-30T02:50:41.996577', '8980', '2'), + ('5.99', '375', '2007-02-15T20:26:33.996577', '1499', '1'), + ('5.99', '375', '2007-03-02T03:34:43.996577', '11008', '2'), + ('5.99', '375', '2007-03-01T22:40:05.996577', '10859', '1'), + ('1.99', '375', '2007-03-01T12:39:35.996577', '10589', '2'), + ('6.99', '375', '2007-04-06T21:40:38.996577', '3981', '1'), + ('4.99', '375', '2007-02-18T02:40:59.996577', '2236', '1'), + ('4.99', '375', '2007-03-01T15:39:20.996577', '10672', '1'), + ('4.99', '375', '2007-04-07T17:02:23.996577', '4335', '2'), + ('4.99', '375', '2007-03-23T01:14:39.996577', '15505', '1'), + ('2.99', '375', '2007-02-15T15:07:19.996577', '1404', '2'), + ('0.99', '375', '2007-03-18T17:39:18.996577', '12663', '2'), + ('9.99', '375', '2007-03-17T21:49:11.996577', '12122', '2'), + ('4.99', '375', '2007-04-28T08:16:50.996577', '7856', '1'), + ('2.99', '375', '2007-04-29T23:35:29.996577', '8900', '2'), + ('6.99', '375', '2007-03-02T02:16:21.996577', '10961', '1'), + ('2.99', '375', '2007-04-09T21:52:23.996577', '5474', '2'), + ('0.99', '375', '2007-03-01T01:45:17.996577', '10274', '1'), + ('0.99', '375', '2007-03-01T14:13:17.996577', '10640', '1'), + ('2.99', '375', '2007-03-22T06:43:47.996577', '15004', '1'), + ('4.99', '375', '2007-03-20T12:46:42.996577', '13836', '1'), + ('4.99', '387', '2007-04-11T11:25:31.996577', '6216', '2'), + ('6.99', '387', '2007-04-11T23:33:37.996577', '6456', '2'), + ('0.99', '387', '2007-04-27T18:33:53.996577', '7497', '1'), + ('2.99', '387', '2007-03-19T07:09:55.996577', '13034', '2'), + ('2.99', '387', '2007-03-17T04:42:06.996577', '11682', '2'), + ('4.99', '387', '2007-03-17T22:50:56.996577', '12153', '2'), + ('5.99', '387', '2007-03-21T05:07:34.996577', '14279', '2'), + ('4.99', '387', '2007-03-01T22:04:36.996577', '10838', '1'), + ('0.99', '387', '2007-02-15T19:11:34.996577', '1465', '2'), + ('0.99', '387', '2007-03-20T06:15:31.996577', '13645', '2'), + ('5.99', '387', '2007-02-20T07:03:43.996577', '2981', '2'), + ('2.99', '387', '2007-04-28T16:55:55.996577', '8090', '1'), + ('0.99', '387', '2007-03-01T11:36:00.996577', '10564', '1'), + ('0.99', '387', '2007-02-15T19:06:40.996577', '1464', '1'), + ('5.99', '387', '2007-04-12T02:21:05.996577', '6517', '1'), + ('0.99', '387', '2007-03-22T05:45:02.996577', '14979', '2'), + ('5.99', '387', '2007-03-19T08:47:45.996577', '13082', '1'), + ('0.99', '387', '2007-02-17T14:40:12.996577', '2068', '1'), + ('4.99', '387', '2007-02-21T12:19:54.996577', '3378', '2'), + ('0.99', '387', '2007-02-17T17:21:47.996577', '2100', '2'), + ('6.99', '387', '2007-03-19T03:53:32.996577', '12936', '1'), + ('4.99', '387', '2007-03-20T10:16:18.996577', '13772', '2'), + ('5.99', '456', '2007-03-01T10:12:39.996577', '10519', '2'), + ('2.99', '456', '2007-04-06T17:04:03.996577', '3881', '2'), + ('4.99', '456', '2007-03-19T19:00:14.996577', '13348', '1'), + ('2.99', '456', '2007-02-15T07:10:18.996577', '1288', '1'), + ('2.99', '456', '2007-04-27T09:06:11.996577', '7248', '2'), + ('5.99', '456', '2007-02-17T17:41:36.996577', '2103', '2'), + ('7.99', '456', '2007-04-06T10:32:20.996577', '3743', '1'), + ('4.99', '456', '2007-03-18T00:20:09.996577', '12188', '1'), + ('4.99', '456', '2007-02-18T00:04:13.996577', '2192', '1'), + ('6.99', '456', '2007-02-17T20:54:49.996577', '2146', '2'), + ('0.99', '456', '2007-02-16T11:46:49.996577', '1700', '1'), + ('0.99', '456', '2007-02-18T15:02:14.996577', '2404', '1'), + ('4.99', '456', '2007-03-20T02:21:42.996577', '13547', '1'), + ('2.99', '456', '2007-02-19T03:22:39.996577', '2581', '1'), + ('8.99', '456', '2007-03-19T11:14:21.996577', '13144', '1'), + ('3.99', '456', '2007-04-07T06:47:46.996577', '4141', '1'), + ('1.99', '456', '2007-03-21T19:10:51.996577', '14690', '2'), + ('0.99', '456', '2007-04-11T00:44:23.996577', '6023', '2'), + ('3.99', '456', '2007-03-23T09:43:46.996577', '15720', '1'), + ('4.99', '456', '2007-04-29T17:41:41.996577', '8749', '1'), + ('2.99', '456', '2007-03-23T16:11:42.996577', '15910', '1'), + ('2.99', '456', '2007-03-01T21:11:26.996577', '10813', '1'), + ('0.99', '456', '2007-04-10T22:15:44.996577', '5964', '2'), + ('2.99', '456', '2007-03-21T04:16:18.996577', '14253', '2'), + ('8.99', '200', '2007-03-02T16:11:06.996577', '11356', '1'), + ('2.99', '200', '2007-05-14T13:44:29.996577', '11866', '2'), + ('2.99', '200', '2007-04-29T06:44:08.996577', '8462', '2'), + ('2.99', '200', '2007-04-09T05:25:51.996577', '5110', '1'), + ('4.99', '200', '2007-02-19T13:14:36.996577', '2717', '2'), + ('1.99', '200', '2007-02-15T07:52:25.996577', '1296', '2'), + ('6.99', '200', '2007-03-23T18:04:08.996577', '15961', '1'), + ('4.99', '200', '2007-04-06T02:17:10.996577', '3580', '1'), + ('10.99', '200', '2007-03-20T20:00:18.996577', '14034', '1'), + ('6.99', '200', '2007-03-21T13:29:58.996577', '14521', '2'), + ('4.99', '200', '2007-04-11T09:38:37.996577', '6181', '1'), + ('2.99', '200', '2007-03-01T16:18:04.996577', '10685', '1'), + ('2.99', '200', '2007-04-11T08:49:47.996577', '6167', '2'), + ('3.99', '200', '2007-02-19T09:57:12.996577', '2667', '2'), + ('2.99', '200', '2007-04-27T21:21:26.996577', '7574', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['19280', '24607', '24606', '31253', '19278', '24603', '31249', '19283', '31251', '31246', '19279', '23346', '23347', '23339', '29751', '23341', '32036', '23343', '29758', '29753', '23345', '29756', '18773', '29760', '23344', '29759', '29750', '23340', '29755', '29752', '23342', '29754', '18772', '29757', '27148', '27147', '21161', '21165', '27145', '27132', '27135', '27143', '21164', '27144', '27142', '17883', '31964', '27133', '17882', '21163', '21166', '27137', '21160', '27141', '27134', '27146', '27139', '27136', '21162', '27138', '27140', '31002', '19176', '31001', '19170', '24369', '30999', '24367', '24370', '30995', '24373', '30998', '24376', '30997', '19177', '30991', '19173', '24374', '19171', '30993', '24371', '19174', '24377', '31000', '24375', '24372', '19172', '30994', '19175', '30992', '24368', '24366', '30996', '24195', '30777', '30785', '30779', '24191', '24197', '30783']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('4.99', '200', '2007-02-18T02:11:49.996577', '2227', '1'), + ('5.99', '200', '2007-03-23T10:40:03.996577', '15742', '2'), + ('4.99', '200', '2007-03-23T08:22:20.996577', '15691', '2'), + ('6.99', '200', '2007-04-30T23:30:50.996577', '9527', '1'), + ('4.99', '200', '2007-02-15T08:39:15.996577', '1309', '2'), + ('5.99', '200', '2007-03-20T09:10:16.996577', '13737', '1'), + ('3.99', '200', '2007-04-26T22:10:29.996577', '6947', '1'), + ('3.99', '200', '2007-02-20T21:55:41.996577', '3190', '1'), + ('3.99', '200', '2007-04-29T03:44:07.996577', '8368', '2'), + ('0.99', '200', '2007-04-11T06:30:53.996577', '6123', '1'), + ('6.99', '200', '2007-02-17T02:57:41.996577', '1899', '2'), + ('2.99', '69', '2007-03-21T22:11:26.996577', '14767', '2'), + ('2.99', '69', '2007-03-23T02:54:16.996577', '15547', '1'), + ('3.99', '69', '2007-03-17T15:29:08.996577', '11943', '1'), + ('0.99', '69', '2007-04-07T12:56:17.996577', '4265', '1'), + ('2.99', '69', '2007-03-17T21:49:06.996577', '12121', '1'), + ('0.99', '69', '2007-05-14T13:44:29.996577', '11995', '2'), + ('5.99', '69', '2007-03-19T06:42:20.996577', '13023', '1'), + ('2.99', '69', '2007-04-30T10:57:08.996577', '9193', '2'), + ('3.99', '69', '2007-04-10T02:06:58.996577', '5569', '2'), + ('0.99', '69', '2007-03-21T18:59:51.996577', '14685', '2'), + ('6.99', '69', '2007-04-12T14:59:23.996577', '6785', '2'), + ('4.99', '69', '2007-02-21T10:25:06.996577', '3358', '1'), + ('0.99', '69', '2007-04-30T18:25:42.996577', '10074', '2'), + ('3.99', '69', '2007-03-21T06:14:13.996577', '14311', '2'), + ('2.99', '69', '2007-04-30T02:26:57.996577', '9612', '1'), + ('8.99', '69', '2007-04-06T17:08:04.996577', '3883', '1'), + ('2.99', '69', '2007-03-17T17:49:14.996577', '12012', '1'), + ('6.99', '69', '2007-04-11T20:35:58.996577', '6385', '1'), + ('0.99', '69', '2007-04-07T20:57:17.996577', '4427', '1'), + ('5.99', '69', '2007-03-19T05:06:14.996577', '12966', '1'), + ('4.99', '69', '2007-04-11T16:05:48.996577', '6297', '2'), + ('2.99', '69', '2007-02-16T00:25:41.996577', '1549', '1'), + ('6.99', '69', '2007-04-29T13:25:59.996577', '8649', '2'), + ('1.99', '441', '2007-04-30T20:30:46.996577', '10139', '2'), + ('2.99', '441', '2007-04-30T11:28:00.996577', '9854', '2'), + ('1.99', '441', '2007-03-02T12:02:34.996577', '11247', '2'), + ('4.99', '441', '2007-03-21T23:09:15.996577', '14796', '2'), + ('4.99', '441', '2007-04-29T12:14:40.996577', '8617', '2'), + ('0.99', '441', '2007-04-06T04:51:48.996577', '3629', '2'), + ('0.99', '441', '2007-04-07T10:02:48.996577', '4208', '2'), + ('4.99', '441', '2007-04-29T05:37:02.996577', '8427', '1'), + ('4.99', '441', '2007-03-20T15:45:26.996577', '13932', '1'), + ('4.99', '441', '2007-04-29T10:21:13.996577', '8575', '1'), + ('0.99', '441', '2007-04-29T00:14:26.996577', '8281', '1'), + ('4.99', '441', '2007-02-18T08:45:47.996577', '2328', '2'), + ('4.99', '441', '2007-05-14T13:44:29.996577', '14878', '1'), + ('2.99', '441', '2007-04-06T08:30:34.996577', '3695', '2'), + ('4.99', '441', '2007-02-16T04:41:06.996577', '1602', '1'), + ('4.99', '441', '2007-03-20T09:13:36.996577', '13739', '2'), + ('3.99', '441', '2007-03-22T09:24:11.996577', '15070', '2'), + ('0.99', '441', '2007-04-10T13:55:30.996577', '5811', '1'), + ('1.99', '441', '2007-03-01T22:16:20.996577', '10846', '1'), + ('2.99', '441', '2007-04-28T22:58:22.996577', '8237', '2'), + ('8.99', '441', '2007-04-07T03:44:26.996577', '4084', '1'), + ('10.99', '441', '2007-04-30T04:09:01.996577', '9644', '2'), + ('4.99', '441', '2007-04-12T09:06:18.996577', '6642', '1'), + ('2.99', '441', '2007-04-09T05:56:59.996577', '5129', '2'), + ('2.99', '441', '2007-03-19T23:45:04.996577', '13483', '2'), + ('2.99', '441', '2007-04-12T08:18:12.996577', '6636', '2'), + ('5.99', '441', '2007-04-26T21:47:15.996577', '6941', '1'), + ('6.99', '176', '2007-04-30T08:56:21.996577', '9145', '2'), + ('1.99', '176', '2007-02-18T21:45:45.996577', '2503', '2'), + ('2.99', '176', '2007-04-29T00:12:03.996577', '8279', '1'), + ('5.99', '176', '2007-02-15T07:23:27.996577', '1291', '1'), + ('5.99', '176', '2007-03-17T04:36:05.996577', '11678', '1'), + ('2.99', '176', '2007-04-27T19:33:08.996577', '7521', '2'), + ('0.99', '176', '2007-03-01T07:24:22.996577', '10441', '2'), + ('2.99', '176', '2007-03-18T04:00:58.996577', '12299', '1'), + ('6.99', '176', '2007-04-11T19:22:53.996577', '6354', '1'), + ('5.99', '176', '2007-03-19T12:51:45.996577', '13186', '2'), + ('2.99', '176', '2007-04-27T07:47:31.996577', '7210', '1'), + ('4.99', '176', '2007-03-22T18:25:18.996577', '15311', '2'), + ('2.99', '176', '2007-04-27T01:08:55.996577', '7025', '1'), + ('4.99', '176', '2007-02-20T02:42:13.996577', '2922', '1'), + ('4.99', '176', '2007-04-06T05:48:34.996577', '3643', '1'), + ('8.99', '176', '2007-02-17T23:16:57.996577', '2181', '1'), + ('7.99', '176', '2007-03-20T22:10:57.996577', '14083', '1'), + ('7.99', '176', '2007-02-16T15:00:03.996577', '1741', '1'), + ('3.99', '176', '2007-04-07T05:42:16.996577', '4121', '2'), + ('2.99', '176', '2007-03-18T19:50:10.996577', '12718', '1'), + ('2.99', '176', '2007-02-18T01:41:39.996577', '2218', '1'), + ('4.99', '176', '2007-03-23T17:05:10.996577', '15933', '1'), + ('5.99', '176', '2007-04-28T04:24:39.996577', '7751', '1'), + ('1.99', '176', '2007-03-21T03:35:28.996577', '14232', '2'), + ('7.99', '176', '2007-03-19T12:14:14.996577', '13170', '1'), + ('6.99', '176', '2007-02-16T21:41:31.996577', '1836', '1'), + ('2.99', '176', '2007-04-11T01:30:11.996577', '6035', '1'), + ('2.99', '176', '2007-02-18T16:13:26.996577', '2427', '2'), + ('6.99', '176', '2007-04-06T19:32:12.996577', '3931', '2'), + ('2.99', '176', '2007-03-01T22:46:00.996577', '10862', '1'), + ('2.99', '176', '2007-03-01T01:51:07.996577', '10277', '1'), + ('4.99', '176', '2007-04-27T00:44:29.996577', '7017', '1'), + ('0.99', '157', '2007-03-19T02:55:31.996577', '12916', '1'), + ('0.99', '157', '2007-04-28T19:40:14.996577', '8163', '2'), + ('2.99', '157', '2007-04-30T14:32:22.996577', '9958', '1'), + ('0.99', '157', '2007-04-29T03:17:51.996577', '8347', '2'), + ('4.99', '157', '2007-03-02T12:04:06.996577', '11249', '2'), + ('4.99', '157', '2007-03-19T13:59:32.996577', '13214', '1'), + ('2.99', '157', '2007-04-30T12:16:43.996577', '9237', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['30780', '30774', '30776', '24198', '30784', '30771', '30782', '30769', '24192', '30786', '30778', '30772', '24196', '30781', '30770', '24199', '19109', '24193', '30773', '30775', '24200', '24194', '20413', '20411', '26274', '26267', '20410', '26275', '26265', '17593', '26269', '20407', '26268', '17592', '26262', '26271', '17596', '20406', '26273', '26261', '26264', '20409', '26272', '26263', '20412', '20408', '17594', '26266', '17595', '26270', '31173', '24531', '31174', '24538', '31175', '24534', '24535', '24536', '24539', '24532', '31176', '24530', '31171', '24533', '19251', '32075', '19246', '31172', '19248', '19250', '19249', '24537', '19247', '25901', '25894', '25908', '20117', '20114', '25898', '25900', '20111', '25910', '25904', '20115', '25905', '25895', '20109', '25903', '25899', '25897', '20112', '25907', '20116', '25902', '25896', '25906', '25909', '20113', '20110', '25868']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('4.99', '157', '2007-04-29T10:23:27.996577', '8576', '2'), + ('2.99', '157', '2007-04-27T03:59:14.996577', '7110', '1'), + ('4.99', '157', '2007-04-27T18:38:54.996577', '7499', '2'), + ('6.99', '157', '2007-03-19T23:39:38.996577', '13481', '1'), + ('4.99', '157', '2007-04-30T13:20:02.996577', '9264', '2'), + ('3.99', '157', '2007-04-07T21:19:30.996577', '4435', '2'), + ('4.99', '157', '2007-04-29T20:59:50.996577', '8827', '1'), + ('0.99', '157', '2007-04-06T10:22:44.996577', '3739', '1'), + ('4.99', '157', '2007-03-02T15:26:03.996577', '11335', '2'), + ('4.99', '157', '2007-04-30T23:13:53.996577', '10203', '1'), + ('0.99', '157', '2007-04-29T03:00:21.996577', '8337', '2'), + ('0.99', '157', '2007-04-08T20:10:20.996577', '4919', '1'), + ('4.99', '157', '2007-03-19T09:19:09.996577', '13097', '1'), + ('0.99', '157', '2007-04-29T15:50:24.996577', '8707', '1'), + ('5.99', '157', '2007-04-07T12:41:39.996577', '4253', '1'), + ('2.99', '157', '2007-03-20T08:39:33.996577', '13728', '1'), + ('0.99', '157', '2007-02-18T09:59:22.996577', '2340', '2'), + ('5.99', '157', '2007-03-18T01:02:21.996577', '12213', '1'), + ('4.99', '157', '2007-04-10T16:49:14.996577', '5862', '1'), + ('2.99', '157', '2007-04-27T07:15:27.996577', '7195', '2'), + ('4.99', '157', '2007-03-22T05:32:51.996577', '14974', '2'), + ('6.99', '157', '2007-03-18T10:02:00.996577', '12464', '1'), + ('4.99', '363', '2007-03-22T19:13:21.996577', '15335', '1'), + ('5.99', '363', '2007-03-22T06:00:49.996577', '14983', '1'), + ('4.99', '363', '2007-04-30T15:00:42.996577', '9968', '1'), + ('4.99', '363', '2007-04-12T19:05:39.996577', '6878', '2'), + ('2.99', '363', '2007-03-21T19:15:08.996577', '14694', '1'), + ('8.99', '363', '2007-04-30T15:27:08.996577', '9977', '1'), + ('4.99', '363', '2007-04-12T11:21:37.996577', '6705', '2'), + ('4.99', '363', '2007-02-16T01:47:35.996577', '1569', '2'), + ('4.99', '363', '2007-04-28T02:47:41.996577', '7708', '2'), + ('5.99', '363', '2007-03-18T00:20:10.996577', '12189', '2'), + ('2.99', '363', '2007-04-27T09:26:58.996577', '7256', '1'), + ('4.99', '363', '2007-02-15T16:44:50.996577', '1426', '2'), + ('3.99', '363', '2007-04-10T07:35:45.996577', '5687', '2'), + ('3.99', '363', '2007-04-29T08:44:45.996577', '8522', '2'), + ('2.99', '363', '2007-02-21T04:37:13.996577', '3281', '2'), + ('6.99', '363', '2007-03-01T03:34:16.996577', '10339', '1'), + ('4.99', '363', '2007-04-29T21:24:33.996577', '8841', '2'), + ('3.99', '363', '2007-04-06T09:44:15.996577', '3726', '1'), + ('4.99', '363', '2007-04-11T07:09:13.996577', '6140', '2'), + ('9.99', '363', '2007-03-20T08:01:22.996577', '13706', '1'), + ('2.99', '363', '2007-04-29T19:56:45.996577', '8804', '2'), + ('6.99', '363', '2007-04-10T11:11:09.996577', '5758', '1'), + ('4.99', '363', '2007-03-22T17:37:15.996577', '15279', '2'), + ('4.99', '363', '2007-03-18T21:31:45.996577', '12760', '2'), + ('4.99', '363', '2007-02-16T22:33:48.996577', '1847', '1'), + ('2.99', '363', '2007-04-12T16:50:36.996577', '6821', '2'), + ('4.99', '363', '2007-02-19T00:33:14.996577', '2540', '1'), + ('2.99', '363', '2007-04-28T17:54:11.996577', '8121', '2'), + ('4.99', '193', '2007-04-29T03:58:06.996577', '8379', '1'), + ('0.99', '193', '2007-03-18T07:05:24.996577', '12384', '2'), + ('4.99', '193', '2007-04-29T05:41:14.996577', '8431', '1'), + ('6.99', '193', '2007-03-22T19:30:14.996577', '15344', '2'), + ('2.99', '193', '2007-04-30T06:30:26.996577', '9079', '1'), + ('0.99', '193', '2007-03-20T04:39:10.996577', '13608', '1'), + ('2.99', '193', '2007-03-21T18:43:24.996577', '14679', '1'), + ('4.99', '193', '2007-03-22T04:00:19.996577', '14927', '1'), + ('5.99', '193', '2007-03-23T00:54:36.996577', '15495', '2'), + ('4.99', '193', '2007-03-18T17:34:08.996577', '12658', '2'), + ('4.99', '193', '2007-04-30T01:20:19.996577', '9575', '1'), + ('2.99', '193', '2007-03-01T08:06:54.996577', '10462', '2'), + ('6.99', '193', '2007-04-08T18:34:51.996577', '4892', '1'), + ('2.99', '193', '2007-03-20T01:36:13.996577', '13529', '1'), + ('8.99', '193', '2007-02-21T05:36:45.996577', '3297', '1'), + ('2.99', '193', '2007-05-14T13:44:29.996577', '15729', '2'), + ('4.99', '193', '2007-02-15T09:31:50.996577', '1325', '1'), + ('2.99', '193', '2007-04-28T22:02:48.996577', '8211', '1'), + ('6.99', '193', '2007-02-19T20:49:32.996577', '2841', '2'), + ('2.99', '193', '2007-02-19T23:53:20.996577', '2880', '2'), + ('4.99', '193', '2007-02-19T21:20:40.996577', '2846', '2'), + ('4.99', '193', '2007-03-22T13:16:19.996577', '15164', '2'), + ('6.99', '193', '2007-02-18T13:24:49.996577', '2377', '2'), + ('7.99', '332', '2007-04-27T02:01:07.996577', '7049', '2'), + ('6.99', '332', '2007-04-07T04:49:18.996577', '4100', '1'), + ('5.99', '332', '2007-04-30T17:55:48.996577', '9388', '1'), + ('3.99', '332', '2007-03-22T15:06:02.996577', '15210', '1'), + ('2.99', '332', '2007-03-20T06:55:56.996577', '13673', '2'), + ('2.99', '332', '2007-04-09T17:39:37.996577', '5381', '2'), + ('0.99', '332', '2007-04-09T20:13:43.996577', '5440', '1'), + ('5.99', '332', '2007-03-02T11:25:03.996577', '11229', '1'), + ('4.99', '332', '2007-04-30T17:00:17.996577', '10026', '1'), + ('4.99', '332', '2007-04-27T21:26:43.996577', '7578', '2'), + ('4.99', '332', '2007-03-21T22:50:23.996577', '14783', '2'), + ('8.99', '332', '2007-04-28T11:01:36.996577', '7934', '2'), + ('6.99', '332', '2007-04-07T15:16:19.996577', '4302', '1'), + ('0.99', '332', '2007-03-01T02:50:20.996577', '10307', '1'), + ('8.99', '332', '2007-04-27T21:24:33.996577', '7577', '2'), + ('0.99', '332', '2007-04-09T17:53:51.996577', '5388', '2'), + ('1.99', '332', '2007-04-09T13:09:08.996577', '5277', '1'), + ('2.99', '332', '2007-03-16T23:56:15.996577', '11564', '2'), + ('1.99', '332', '2007-04-30T15:57:18.996577', '9324', '1'), + ('0.99', '332', '2007-03-22T14:36:00.996577', '15194', '2'), + ('2.99', '332', '2007-04-27T15:27:35.996577', '7418', '2'), + ('2.99', '332', '2007-04-09T05:38:38.996577', '5116', '2'), + ('6.99', '332', '2007-04-28T20:04:10.996577', '8173', '2'), + ('0.99', '332', '2007-04-30T13:27:47.996577', '9921', '1'), + ('4.99', '332', '2007-03-18T04:50:22.996577', '12318', '2'), + ('0.99', '332', '2007-03-01T07:22:52.996577', '10439', '2'), + ('6.99', '329', '2007-04-30T10:25:21.996577', '9827', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['25865', '25860', '25858', '25861', '25866', '20086', '25864', '20090', '20087', '25857', '20085', '25859', '25867', '25856', '25863', '20092', '20088', '20091', '20089', '20094', '20093', '25862', '18576', '22880', '22893', '22879', '22892', '22878', '29215', '18574', '18573', '22887', '22889', '22883', '22877', '22890', '22881', '18575', '22885', '29212', '18572', '22891', '22884', '29210', '29216', '22882', '22886', '29209', '29214', '22888', '32016', '29208', '29211', '29213', '24103', '30675', '30681', '30694', '30674', '30679', '19074', '19073', '24105', '19075', '24108', '24106', '30687', '19076', '24094', '30678', '30680', '30676', '30673', '24102', '30683', '30684', '30682', '30693', '30686', '30688', '24092', '24099', '30685', '30690', '24093', '19077', '24101', '30691', '24095', '24096', '30689', '30692', '24100', '24097', '24107', '24104', '30677', '24098', '24109', '29907']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('4.99', '329', '2007-04-30T04:13:08.996577', '9024', '2'), + ('2.99', '329', '2007-04-08T08:47:54.996577', '4674', '2'), + ('4.99', '329', '2007-04-07T20:30:09.996577', '4415', '1'), + ('4.99', '329', '2007-04-28T12:45:15.996577', '7980', '1'), + ('0.99', '329', '2007-04-30T11:43:47.996577', '9219', '2'), + ('0.99', '329', '2007-03-01T09:05:37.996577', '10490', '2'), + ('0.99', '329', '2007-04-30T01:27:47.996577', '8941', '2'), + ('6.99', '329', '2007-03-18T17:34:15.996577', '12659', '1'), + ('2.99', '329', '2007-03-02T07:37:25.996577', '11130', '1'), + ('4.99', '329', '2007-04-07T03:20:41.996577', '4076', '2'), + ('7.99', '329', '2007-03-01T08:24:50.996577', '10473', '1'), + ('1.99', '329', '2007-04-07T22:36:11.996577', '4465', '1'), + ('0.99', '329', '2007-04-30T17:51:30.996577', '9381', '1'), + ('2.99', '329', '2007-04-06T21:28:46.996577', '3976', '2'), + ('6.99', '329', '2007-04-29T06:36:29.996577', '8460', '1'), + ('4.99', '329', '2007-03-22T02:56:14.996577', '14900', '1'), + ('3.99', '329', '2007-03-02T08:48:08.996577', '11169', '2'), + ('8.99', '329', '2007-03-20T05:27:26.996577', '13627', '1'), + ('0.99', '329', '2007-03-17T05:37:45.996577', '11697', '2'), + ('2.99', '329', '2007-03-22T18:22:57.996577', '15308', '1'), + ('4.99', '329', '2007-03-22T06:59:33.996577', '15011', '2'), + ('7.99', '329', '2007-04-28T20:03:02.996577', '8172', '2'), + ('10.99', '21', '2007-02-20T23:33:01.996577', '3212', '1'), + ('0.99', '21', '2007-03-17T16:21:35.996577', '11970', '2'), + ('4.99', '21', '2007-03-22T01:48:52.996577', '14869', '1'), + ('0.99', '21', '2007-03-02T05:39:23.996577', '11072', '2'), + ('2.99', '21', '2007-03-21T10:39:07.996577', '14446', '2'), + ('0.99', '21', '2007-03-01T17:57:13.996577', '10734', '1'), + ('0.99', '21', '2007-04-30T09:13:38.996577', '9149', '2'), + ('2.99', '21', '2007-02-18T14:06:21.996577', '2393', '1'), + ('4.99', '21', '2007-02-18T04:42:07.996577', '2268', '1'), + ('8.99', '21', '2007-03-19T23:19:20.996577', '13463', '1'), + ('4.99', '21', '2007-03-20T09:17:09.996577', '13740', '1'), + ('6.99', '21', '2007-03-18T22:02:48.996577', '12774', '1'), + ('4.99', '21', '2007-03-01T11:51:32.996577', '10570', '2'), + ('8.99', '21', '2007-03-20T21:52:33.996577', '14077', '2'), + ('2.99', '21', '2007-03-17T22:02:42.996577', '12131', '2'), + ('4.99', '21', '2007-02-19T19:42:59.996577', '2830', '2'), + ('4.99', '21', '2007-03-19T20:37:54.996577', '13399', '2'), + ('0.99', '21', '2007-04-28T13:25:20.996577', '7994', '1'), + ('7.99', '21', '2007-02-18T02:37:16.996577', '2235', '2'), + ('2.99', '21', '2007-03-21T01:20:25.996577', '14161', '2'), + ('2.99', '21', '2007-03-19T20:06:23.996577', '13381', '1'), + ('2.99', '21', '2007-04-10T22:11:49.996577', '5961', '1'), + ('5.99', '21', '2007-04-30T05:57:51.996577', '9699', '1'), + ('4.99', '21', '2007-03-18T17:35:49.996577', '12660', '2'), + ('4.99', '21', '2007-03-19T21:12:04.996577', '13411', '1'), + ('3.99', '21', '2007-04-10T11:56:06.996577', '5772', '1'), + ('2.99', '21', '2007-04-29T22:17:49.996577', '8862', '2'), + ('9.99', '21', '2007-03-20T07:54:40.996577', '13699', '1'), + ('2.99', '21', '2007-05-14T13:44:29.996577', '14933', '1'), + ('4.99', '21', '2007-04-09T05:10:58.996577', '5107', '2'), + ('1.99', '21', '2007-04-26T21:56:39.996577', '6943', '2'), + ('6.99', '21', '2007-04-28T21:24:37.996577', '8196', '2'), + ('0.99', '148', '2007-03-21T19:55:50.996577', '14713', '2'), + ('2.99', '148', '2007-04-08T12:16:21.996577', '4746', '1'), + ('10.99', '148', '2007-04-12T15:06:21.996577', '6793', '2'), + ('4.99', '148', '2007-04-30T18:06:24.996577', '10067', '2'), + ('0.99', '148', '2007-04-07T03:38:20.996577', '4080', '1'), + ('1.99', '148', '2007-04-11T08:54:22.996577', '6169', '1'), + ('6.99', '148', '2007-02-15T21:48:52.996577', '1517', '2'), + ('1.99', '148', '2007-02-15T20:31:01.996577', '1501', '1'), + ('2.99', '148', '2007-03-22T05:14:19.996577', '14965', '2'), + ('3.99', '148', '2007-02-19T15:07:49.996577', '2751', '2'), + ('3.99', '148', '2007-03-23T02:42:19.996577', '15541', '1'), + ('4.99', '148', '2007-03-22T16:12:56.996577', '15237', '2'), + ('4.99', '148', '2007-04-29T04:30:40.996577', '8394', '1'), + ('3.99', '148', '2007-02-19T21:05:05.996577', '2843', '2'), + ('2.99', '148', '2007-03-17T18:35:27.996577', '12029', '1'), + ('4.99', '148', '2007-04-09T17:17:05.996577', '5372', '1'), + ('8.99', '148', '2007-04-12T08:55:45.996577', '6640', '1'), + ('2.99', '148', '2007-04-08T21:26:33.996577', '4950', '1'), + ('0.99', '148', '2007-04-06T06:13:39.996577', '3653', '1'), + ('2.99', '148', '2007-03-21T17:08:18.996577', '14629', '2'), + ('4.99', '148', '2007-04-28T01:59:48.996577', '7693', '2'), + ('9.99', '148', '2007-04-28T08:35:30.996577', '7865', '1'), + ('0.99', '148', '2007-04-28T00:35:45.996577', '7656', '1'), + ('4.99', '148', '2007-04-30T01:52:18.996577', '9594', '1'), + ('3.99', '148', '2007-04-29T02:41:55.996577', '8331', '2'), + ('4.99', '148', '2007-04-29T10:26:40.996577', '8578', '2'), + ('6.99', '148', '2007-03-01T21:46:32.996577', '10830', '2'), + ('0.99', '148', '2007-03-20T20:46:26.996577', '14055', '1'), + ('4.99', '148', '2007-04-28T17:38:29.996577', '8111', '2'), + ('5.99', '148', '2007-04-30T04:05:06.996577', '9023', '1'), + ('10.99', '148', '2007-03-02T16:11:15.996577', '11357', '1'), + ('5.99', '148', '2007-02-19T21:22:27.996577', '2847', '2'), + ('6.99', '148', '2007-03-21T01:53:16.996577', '14184', '2'), + ('2.99', '148', '2007-04-30T07:21:00.996577', '9106', '1'), + ('0.99', '148', '2007-03-17T18:56:52.996577', '12038', '2'), + ('3.99', '148', '2007-03-18T11:56:53.996577', '12512', '2'), + ('4.99', '148', '2007-04-29T12:31:46.996577', '8626', '2'), + ('1.99', '148', '2007-04-30T23:37:32.996577', '9530', '1'), + ('4.99', '148', '2007-03-21T01:00:01.996577', '14155', '1'), + ('6.99', '148', '2007-03-19T04:16:38.996577', '12944', '1'), + ('8.99', '148', '2007-03-22T20:54:39.996577', '15379', '2'), + ('5.99', '148', '2007-03-22T02:10:38.996577', '14879', '2'), + ('4.99', '148', '2007-04-09T01:16:41.996577', '5034', '1'), + ('6.99', '148', '2007-03-19T05:35:17.996577', '12983', '1'), + ('3.99', '148', '2007-03-23T04:25:30.996577', '15586', '2'), + ('8.99', '82', '2007-04-30T15:14:22.996577', '9305', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['29904', '29905', '23473', '18815', '23477', '29899', '29898', '23476', '23474', '23472', '18814', '29906', '18816', '29908', '23479', '23478', '23475', '29900', '18813', '18812', '29902', '29901', '29903', '26536', '26533', '26530', '17688', '20641', '17687', '26535', '26532', '20642', '20644', '26527', '26531', '17685', '20638', '20640', '26524', '20643', '26525', '17689', '17686', '26528', '20637', '20636', '20635', '26526', '20639', '26534', '26529', '27514', '27507', '27512', '27510', '21525', '21527', '27505', '27509', '27506', '27501', '21526', '21524', '27504', '27503', '27515', '21522', '27513', '21523', '27502', '21528', '27508', '27511', '31123', '31118', '31126', '31124', '31116', '24487', '19219', '19224', '24484', '19220', '31120', '24479', '19221', '31119', '19223', '24483', '24480', '31117', '31125', '24482', '19222', '24485', '24481', '31122', '31121', '24486', '19218']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('0.99', '82', '2007-04-28T08:48:12.996577', '7873', '2'), + ('4.99', '82', '2007-04-29T07:22:15.996577', '8487', '1'), + ('5.99', '82', '2007-03-17T05:10:24.996577', '11688', '2'), + ('8.99', '82', '2007-02-19T18:41:59.996577', '2819', '1'), + ('0.99', '82', '2007-03-21T13:27:24.996577', '14518', '2'), + ('6.99', '82', '2007-04-08T05:14:52.996577', '4598', '1'), + ('2.99', '82', '2007-04-06T07:44:36.996577', '3680', '1'), + ('6.99', '82', '2007-03-20T13:02:25.996577', '13847', '2'), + ('3.99', '82', '2007-03-18T10:24:08.996577', '12470', '1'), + ('4.99', '82', '2007-03-02T06:28:15.996577', '11093', '1'), + ('8.99', '82', '2007-02-18T21:58:19.996577', '2506', '1'), + ('3.99', '82', '2007-04-30T13:42:11.996577', '9277', '2'), + ('0.99', '82', '2007-02-21T08:23:38.996577', '3332', '2'), + ('6.99', '82', '2007-04-30T20:22:48.996577', '9447', '1'), + ('3.99', '82', '2007-03-23T01:41:20.996577', '15516', '2'), + ('4.99', '82', '2007-03-22T02:43:31.996577', '14892', '2'), + ('0.99', '82', '2007-03-19T07:00:16.996577', '13032', '1'), + ('4.99', '82', '2007-04-10T10:43:38.996577', '5746', '2'), + ('0.99', '82', '2007-02-16T01:49:59.996577', '1570', '2'), + ('0.99', '82', '2007-02-15T17:07:17.996577', '1438', '1'), + ('6.99', '82', '2007-04-12T11:39:21.996577', '6708', '2'), + ('6.99', '82', '2007-04-11T03:41:07.996577', '6082', '2'), + ('9.99', '82', '2007-04-28T03:33:13.996577', '7733', '2'), + ('5.99', '386', '2007-04-30T05:18:32.996577', '9686', '1'), + ('4.99', '386', '2007-04-29T03:10:10.996577', '8340', '2'), + ('2.99', '386', '2007-04-11T13:57:00.996577', '6261', '2'), + ('0.99', '386', '2007-02-19T13:48:05.996577', '2732', '1'), + ('3.99', '386', '2007-03-20T08:16:58.996577', '13716', '1'), + ('5.99', '386', '2007-02-16T20:01:16.996577', '1819', '2'), + ('0.99', '386', '2007-04-30T02:11:17.996577', '9602', '2'), + ('4.99', '386', '2007-04-12T12:00:54.996577', '6715', '2'), + ('2.99', '386', '2007-03-20T10:06:42.996577', '13764', '1'), + ('0.99', '386', '2007-03-23T17:34:30.996577', '15949', '1'), + ('2.99', '386', '2007-04-10T21:50:01.996577', '5953', '1'), + ('3.99', '386', '2007-04-11T17:31:00.996577', '6324', '1'), + ('3.99', '386', '2007-02-16T03:19:39.996577', '1585', '2'), + ('2.99', '386', '2007-03-02T07:31:51.996577', '11128', '2'), + ('2.99', '386', '2007-03-19T04:51:03.996577', '12961', '2'), + ('6.99', '386', '2007-04-06T12:25:57.996577', '3783', '2'), + ('6.99', '386', '2007-03-20T13:37:23.996577', '13869', '2'), + ('8.99', '386', '2007-04-07T09:19:33.996577', '4189', '1'), + ('2.99', '386', '2007-02-21T09:50:05.996577', '3351', '1'), + ('2.99', '386', '2007-02-16T04:57:23.996577', '1608', '1'), + ('4.99', '386', '2007-04-11T01:35:20.996577', '6037', '1'), + ('2.99', '386', '2007-03-01T17:20:14.996577', '10715', '1'), + ('3.99', '386', '2007-03-01T13:35:04.996577', '10618', '2'), + ('4.99', '386', '2007-03-01T11:55:19.996577', '10572', '1'), + ('0.99', '386', '2007-04-10T00:17:50.996577', '5524', '1'), + ('4.99', '386', '2007-03-17T05:29:34.996577', '11695', '2'), + ('2.99', '386', '2007-04-29T17:43:05.996577', '8751', '1'), + ('2.99', '386', '2007-04-11T11:54:15.996577', '6222', '1'), + ('2.99', '475', '2007-04-30T07:27:44.996577', '9737', '1'), + ('2.99', '475', '2007-04-09T21:36:33.996577', '5469', '2'), + ('7.99', '475', '2007-04-30T10:38:22.996577', '9183', '1'), + ('1.99', '475', '2007-04-28T05:33:02.996577', '7775', '1'), + ('4.99', '475', '2007-03-17T08:33:31.996577', '11770', '1'), + ('1.99', '475', '2007-03-22T10:12:08.996577', '15097', '1'), + ('0.99', '475', '2007-04-09T18:44:33.996577', '5407', '1'), + ('7.99', '475', '2007-04-27T23:44:11.996577', '7641', '1'), + ('9.99', '475', '2007-04-09T18:58:29.996577', '5415', '2'), + ('5.99', '475', '2007-04-06T21:39:37.996577', '3980', '2'), + ('2.99', '475', '2007-03-21T05:51:09.996577', '14303', '2'), + ('5.99', '475', '2007-03-02T13:29:09.996577', '11293', '1'), + ('0.99', '475', '2007-04-09T17:36:29.996577', '5379', '2'), + ('4.99', '475', '2007-04-08T06:23:34.996577', '4617', '1'), + ('3.99', '475', '2007-04-30T21:39:27.996577', '10162', '2'), + ('0.99', '475', '2007-03-01T04:18:15.996577', '10357', '1'), + ('2.99', '475', '2007-04-30T04:13:41.996577', '9647', '1'), + ('3.99', '475', '2007-03-01T14:05:43.996577', '10633', '1'), + ('6.99', '475', '2007-04-06T23:26:26.996577', '4013', '1'), + ('4.99', '475', '2007-03-22T17:52:24.996577', '15288', '1'), + ('4.99', '475', '2007-04-11T12:10:44.996577', '6224', '1'), + ('5.99', '475', '2007-04-28T21:54:57.996577', '8207', '2'), + ('4.99', '187', '2007-04-27T10:55:17.996577', '7289', '2'), + ('0.99', '187', '2007-04-09T16:57:03.996577', '5366', '2'), + ('2.99', '187', '2007-04-30T12:27:07.996577', '9241', '1'), + ('7.99', '187', '2007-04-28T07:44:45.996577', '7844', '2'), + ('10.99', '187', '2007-04-06T08:55:22.996577', '3709', '2'), + ('7.99', '187', '2007-03-23T18:27:59.996577', '15971', '2'), + ('4.99', '187', '2007-02-15T19:06:06.996577', '1462', '2'), + ('2.99', '187', '2007-02-21T14:23:03.996577', '3402', '1'), + ('8.99', '187', '2007-03-22T00:55:58.996577', '14855', '2'), + ('0.99', '187', '2007-02-16T03:43:03.996577', '1592', '2'), + ('6.99', '187', '2007-04-10T15:07:50.996577', '5833', '2'), + ('2.99', '187', '2007-03-17T11:43:16.996577', '11843', '1'), + ('0.99', '187', '2007-02-17T19:23:14.996577', '2127', '2'), + ('8.99', '187', '2007-04-10T10:19:17.996577', '5738', '1'), + ('5.99', '187', '2007-02-19T14:34:13.996577', '2742', '1'), + ('8.99', '187', '2007-03-20T15:57:23.996577', '13940', '2'), + ('8.99', '187', '2007-03-18T04:16:49.996577', '12307', '2'), + ('4.99', '187', '2007-04-07T21:01:13.996577', '4429', '1'), + ('7.99', '187', '2007-04-28T12:25:17.996577', '7967', '2'), + ('7.99', '187', '2007-03-18T12:33:07.996577', '12534', '1'), + ('0.99', '187', '2007-02-19T00:02:52.996577', '2533', '2'), + ('4.99', '187', '2007-03-22T16:01:23.996577', '15231', '2'), + ('9.99', '187', '2007-03-18T11:17:11.996577', '12490', '2'), + ('2.99', '187', '2007-04-11T22:30:17.996577', '6428', '2'), + ('3.99', '187', '2007-04-11T02:32:06.996577', '6057', '1'), + ('2.99', '187', '2007-03-23T01:41:27.996577', '15517', '2'), + ('6.99', '187', '2007-02-15T09:23:43.996577', '1323', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['23908', '23905', '30474', '23910', '19010', '30481', '23912', '19009', '23915', '30476', '23904', '30472', '30473', '23916', '30475', '23906', '23911', '23914', '23909', '30478', '30477', '30480', '23913', '30471', '30479', '30482', '23907', '28294', '28295', '22145', '22150', '28291', '28290', '18275', '22147', '22148', '22144', '28293', '28288', '22149', '28289', '22146', '28292', '22142', '22143', '28287', '21363', '21375', '21365', '21369', '21372', '27351', '27349', '27354', '21367', '27350', '21366', '21371', '21374', '21370', '17977', '27352', '27345', '27347', '21373', '27355', '21362', '27353', '21364', '27348', '27346', '17978', '21368', '29790', '23379', '29787', '29793', '29792', '23376', '23370', '23367', '23375', '23368', '23366', '29788', '23377', '23371', '23378', '29786', '23372', '23374', '29791', '23373', '18778', '23369', '29789', '23364', '23365', '29794', '29795']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('0.99', '131', '2007-03-18T01:05:33.996577', '12216', '1'), + ('1.99', '131', '2007-03-01T22:41:12.996577', '10861', '1'), + ('2.99', '131', '2007-04-10T03:38:18.996577', '5610', '1'), + ('9.99', '131', '2007-03-18T06:33:01.996577', '12372', '1'), + ('4.99', '131', '2007-02-16T16:30:32.996577', '1768', '2'), + ('3.99', '131', '2007-04-30T15:50:10.996577', '9323', '1'), + ('7.99', '131', '2007-03-19T18:56:47.996577', '13346', '2'), + ('9.99', '131', '2007-02-16T07:41:19.996577', '1646', '1'), + ('2.99', '131', '2007-03-23T07:17:09.996577', '15659', '2'), + ('3.99', '131', '2007-04-10T17:31:17.996577', '5874', '1'), + ('4.99', '131', '2007-03-01T07:48:35.996577', '10459', '1'), + ('4.99', '131', '2007-04-09T11:12:52.996577', '5233', '1'), + ('4.99', '131', '2007-04-09T18:11:03.996577', '5395', '1'), + ('2.99', '131', '2007-03-23T20:49:06.996577', '16042', '1'), + ('2.99', '131', '2007-04-10T09:50:34.996577', '5726', '2'), + ('0.99', '131', '2007-03-17T16:22:08.996577', '11971', '2'), + ('6.99', '131', '2007-03-19T07:59:49.996577', '13050', '2'), + ('0.99', '131', '2007-03-19T20:54:52.996577', '13407', '1'), + ('0.99', '131', '2007-03-18T02:44:44.996577', '12263', '2'), + ('0.99', '131', '2007-04-28T15:56:14.996577', '8071', '2'), + ('2.99', '131', '2007-04-27T20:46:45.996577', '7557', '1'), + ('8.99', '131', '2007-04-29T10:08:34.996577', '8570', '1'), + ('2.99', '131', '2007-03-19T19:22:09.996577', '13353', '2'), + ('2.99', '131', '2007-04-05T23:17:21.996577', '3515', '1'), + ('6.99', '131', '2007-04-28T23:49:28.996577', '8267', '1'), + ('2.99', '131', '2007-04-30T22:18:20.996577', '10179', '1'), + ('2.99', '131', '2007-03-17T16:24:24.996577', '11973', '1'), + ('2.99', '545', '2007-04-30T09:51:07.996577', '9810', '2'), + ('4.99', '545', '2007-04-30T14:04:09.996577', '9942', '2'), + ('2.99', '545', '2007-03-18T05:52:08.996577', '12349', '1'), + ('4.99', '545', '2007-03-23T19:09:35.996577', '15998', '2'), + ('5.99', '545', '2007-04-27T02:45:03.996577', '7078', '1'), + ('0.99', '545', '2007-04-09T12:39:54.996577', '5264', '1'), + ('2.99', '545', '2007-02-17T19:16:56.996577', '2123', '1'), + ('2.99', '545', '2007-03-18T22:55:37.996577', '12800', '1'), + ('4.99', '545', '2007-03-20T04:22:53.996577', '13595', '1'), + ('4.99', '545', '2007-03-17T21:06:57.996577', '12098', '1'), + ('2.99', '545', '2007-04-29T21:49:24.996577', '8848', '2'), + ('5.99', '545', '2007-04-06T21:28:35.996577', '3975', '1'), + ('0.99', '545', '2007-03-23T04:23:48.996577', '15585', '1'), + ('5.99', '545', '2007-04-08T05:12:08.996577', '4597', '1'), + ('10.99', '545', '2007-03-18T17:40:11.996577', '12667', '2'), + ('3.99', '545', '2007-04-29T11:27:18.996577', '8599', '2'), + ('2.99', '545', '2007-03-02T01:13:25.996577', '10931', '2'), + ('2.99', '545', '2007-03-17T08:12:48.996577', '11760', '2'), + ('8.99', '545', '2007-04-06T08:24:35.996577', '3693', '2'), + ('0.99', '461', '2007-03-02T05:22:14.996577', '11063', '2'), + ('7.99', '461', '2007-03-23T05:31:45.996577', '15613', '2'), + ('2.99', '461', '2007-03-17T18:21:11.996577', '12022', '2'), + ('4.99', '461', '2007-03-22T02:44:14.996577', '14893', '1'), + ('6.99', '461', '2007-03-22T19:16:14.996577', '15336', '1'), + ('0.99', '461', '2007-04-28T18:29:32.996577', '8133', '2'), + ('2.99', '461', '2007-04-27T12:28:24.996577', '7334', '2'), + ('0.99', '461', '2007-04-30T12:27:58.996577', '9885', '1'), + ('2.99', '461', '2007-03-19T16:02:26.996577', '13269', '1'), + ('2.99', '461', '2007-04-28T00:52:49.996577', '7664', '2'), + ('2.99', '461', '2007-03-19T14:20:30.996577', '13223', '1'), + ('4.99', '461', '2007-03-22T14:21:58.996577', '15187', '2'), + ('2.99', '461', '2007-03-22T23:24:09.996577', '15449', '2'), + ('2.99', '461', '2007-03-22T09:17:47.996577', '15067', '1'), + ('5.99', '461', '2007-02-20T17:08:09.996577', '3127', '2'), + ('0.99', '461', '2007-04-28T19:45:45.996577', '8164', '2'), + ('0.99', '461', '2007-04-06T08:37:46.996577', '3698', '2'), + ('0.99', '461', '2007-04-10T05:45:27.996577', '5650', '1'), + ('2.99', '461', '2007-03-22T22:04:07.996577', '15411', '2'), + ('4.99', '461', '2007-04-30T19:38:29.996577', '10113', '2'), + ('2.99', '461', '2007-03-01T01:26:33.996577', '10260', '1'), + ('4.99', '461', '2007-04-30T22:26:56.996577', '9499', '2'), + ('0.99', '461', '2007-03-02T10:58:46.996577', '11219', '2'), + ('2.99', '461', '2007-04-10T13:47:56.996577', '5809', '1'), + ('2.99', '461', '2007-04-08T04:40:59.996577', '4586', '2'), + ('4.99', '461', '2007-02-21T06:54:12.996577', '3319', '2'), + ('4.99', '461', '2007-03-21T01:59:33.996577', '14186', '1'), + ('4.99', '72', '2007-04-10T15:37:35.996577', '5840', '1'), + ('2.99', '72', '2007-03-22T12:26:21.996577', '15146', '2'), + ('4.99', '72', '2007-04-09T10:34:29.996577', '5223', '2'), + ('2.99', '72', '2007-04-30T04:26:53.996577', '9027', '1'), + ('4.99', '72', '2007-04-28T22:37:24.996577', '8228', '2'), + ('4.99', '72', '2007-03-20T06:34:22.996577', '13660', '2'), + ('2.99', '72', '2007-03-17T18:18:59.996577', '12020', '2'), + ('2.99', '72', '2007-03-17T02:56:12.996577', '11630', '1'), + ('0.99', '72', '2007-03-20T04:27:31.996577', '13597', '2'), + ('4.99', '72', '2007-03-17T04:37:20.996577', '11679', '1'), + ('5.99', '72', '2007-03-02T18:20:34.996577', '11422', '2'), + ('4.99', '72', '2007-04-09T14:11:02.996577', '5302', '1'), + ('0.99', '72', '2007-03-20T19:28:09.996577', '14020', '1'), + ('0.99', '72', '2007-03-18T09:27:30.996577', '12448', '1'), + ('0.99', '72', '2007-03-22T10:45:12.996577', '15110', '2'), + ('0.99', '72', '2007-04-06T08:40:45.996577', '3700', '1'), + ('0.99', '72', '2007-03-18T14:46:20.996577', '12593', '2'), + ('4.99', '72', '2007-03-19T18:24:11.996577', '13327', '2'), + ('0.99', '72', '2007-04-11T03:39:35.996577', '6081', '2'), + ('0.99', '72', '2007-03-19T11:22:19.996577', '13145', '1'), + ('4.99', '72', '2007-02-18T06:15:00.996577', '2294', '2'), + ('2.99', '72', '2007-03-17T14:50:13.996577', '11923', '1'), + ('0.99', '72', '2007-04-09T19:27:35.996577', '5424', '1'), + ('0.99', '72', '2007-03-01T01:35:52.996577', '10267', '2'), + ('6.99', '72', '2007-03-02T10:26:29.996577', '11206', '2'), + ('5.99', '72', '2007-04-30T19:33:44.996577', '9420', '2'), + ('4.99', '72', '2007-04-30T04:14:29.996577', '9648', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['28322', '28317', '18281', '28318', '22171', '28319', '28321', '22174', '22169', '22172', '22173', '22170', '18282', '31992', '28320', '18283', '31679', '24935', '24941', '24942', '24937', '31678', '24940', '19423', '31677', '19421', '19422', '31680', '31682', '31676', '24945', '24944', '31688', '24936', '31683', '31685', '31681', '24946', '32093', '24939', '31684', '24943', '31675', '24938', '31686', '31687', '18867', '30044', '23590', '30045', '23586', '30043', '30048', '18869', '18865', '23589', '32045', '23585', '30046', '30049', '23588', '18868', '23587', '18866', '30047', '31580', '24858', '31575', '31579', '31584', '19386', '31583', '24863', '31573', '24857', '32092', '24856', '31572', '24859', '31586', '19384', '31585', '31574', '31581', '31571', '24860', '31589', '31570', '19390', '31588', '31577', '19388', '19383', '24861', '31576', '31578', '24855', '19389', '19387', '24862']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('5.99', '548', '2007-04-30T02:27:57.996577', '9614', '1'), + ('2.99', '548', '2007-04-06T08:06:16.996577', '3686', '1'), + ('1.99', '548', '2007-02-15T09:36:05.996577', '1326', '1'), + ('2.99', '548', '2007-04-06T12:05:14.996577', '3777', '2'), + ('3.99', '548', '2007-03-20T07:36:05.996577', '13691', '1'), + ('7.99', '548', '2007-04-07T07:29:15.996577', '4155', '1'), + ('4.99', '548', '2007-04-12T00:56:29.996577', '6490', '2'), + ('6.99', '548', '2007-03-21T20:20:58.996577', '14723', '2'), + ('0.99', '548', '2007-03-01T03:05:19.996577', '10318', '2'), + ('7.99', '548', '2007-03-20T08:45:35.996577', '13730', '2'), + ('0.99', '548', '2007-03-21T02:00:30.996577', '14188', '2'), + ('5.99', '548', '2007-03-19T00:53:07.996577', '12860', '1'), + ('2.99', '548', '2007-02-18T05:15:20.996577', '2280', '1'), + ('0.99', '548', '2007-05-14T13:44:29.996577', '13584', '1'), + ('4.99', '548', '2007-04-09T06:29:12.996577', '5138', '2'), + ('0.99', '548', '2007-02-20T06:53:42.996577', '2978', '2'), + ('4.99', '244', '2007-04-10T12:14:20.996577', '5779', '1'), + ('6.99', '244', '2007-03-01T16:15:26.996577', '10684', '2'), + ('0.99', '244', '2007-03-20T10:22:27.996577', '13774', '2'), + ('0.99', '244', '2007-03-20T15:40:54.996577', '13928', '1'), + ('0.99', '244', '2007-03-02T08:26:41.996577', '11157', '2'), + ('0.99', '244', '2007-04-10T08:00:48.996577', '5692', '2'), + ('4.99', '244', '2007-03-20T05:34:22.996577', '13630', '1'), + ('3.99', '244', '2007-02-20T05:15:01.996577', '2955', '2'), + ('0.99', '244', '2007-04-09T21:16:30.996577', '5461', '2'), + ('6.99', '244', '2007-02-14T23:32:48.996577', '1189', '2'), + ('5.99', '244', '2007-02-16T03:52:12.996577', '1595', '1'), + ('3.99', '244', '2007-04-10T13:34:08.996577', '5803', '1'), + ('2.99', '244', '2007-04-12T06:45:16.996577', '6608', '2'), + ('4.99', '244', '2007-04-09T17:53:40.996577', '5387', '2'), + ('1.99', '244', '2007-03-22T03:35:43.996577', '14919', '1'), + ('0.99', '244', '2007-03-21T18:08:09.996577', '14657', '2'), + ('5.99', '244', '2007-04-30T20:56:31.996577', '10152', '1'), + ('2.99', '244', '2007-03-02T02:32:58.996577', '10969', '2'), + ('2.99', '244', '2007-04-12T10:42:31.996577', '6683', '2'), + ('5.99', '244', '2007-04-29T21:33:34.996577', '8844', '2'), + ('4.99', '244', '2007-04-11T20:04:36.996577', '6374', '2'), + ('3.99', '244', '2007-03-22T05:36:16.996577', '14975', '1'), + ('4.99', '244', '2007-05-14T13:44:29.996577', '12736', '2'), + ('9.99', '244', '2007-03-17T08:16:32.996577', '11762', '1'), + ('0.99', '244', '2007-04-29T06:17:30.996577', '8454', '2'), + ('0.99', '244', '2007-03-21T08:00:10.996577', '14367', '1'), + ('4.99', '244', '2007-04-08T15:39:35.996577', '4814', '1'), + ('9.99', '244', '2007-03-02T12:37:34.996577', '11267', '1'), + ('4.99', '244', '2007-04-30T16:14:44.996577', '10001', '1'), + ('4.99', '244', '2007-04-30T17:36:09.996577', '10047', '2'), + ('3.99', '94', '2007-02-16T14:17:56.996577', '1734', '2'), + ('8.99', '94', '2007-04-07T14:05:57.996577', '4287', '1'), + ('0.99', '94', '2007-03-23T08:28:50.996577', '15693', '1'), + ('4.99', '94', '2007-04-10T09:36:06.996577', '5719', '2'), + ('5.99', '94', '2007-03-20T10:41:50.996577', '13786', '1'), + ('0.99', '94', '2007-04-07T01:50:49.996577', '4044', '2'), + ('0.99', '94', '2007-04-28T12:44:56.996577', '7979', '2'), + ('2.99', '94', '2007-02-19T18:32:49.996577', '2816', '1'), + ('2.99', '94', '2007-02-15T01:42:31.996577', '1213', '2'), + ('0.99', '94', '2007-03-22T05:41:41.996577', '14978', '1'), + ('4.99', '94', '2007-05-14T13:44:29.996577', '15371', '1'), + ('2.99', '94', '2007-03-18T04:44:35.996577', '12316', '1'), + ('4.99', '94', '2007-04-10T22:33:16.996577', '5970', '2'), + ('4.99', '94', '2007-04-30T02:18:33.996577', '9605', '1'), + ('4.99', '94', '2007-03-22T01:35:04.996577', '14865', '1'), + ('4.99', '94', '2007-02-19T06:34:55.996577', '2620', '2'), + ('1.99', '94', '2007-03-21T23:19:51.996577', '14804', '2'), + ('4.99', '94', '2007-02-15T12:53:43.996577', '1367', '1'), + ('2.99', '94', '2007-04-28T06:28:12.996577', '7809', '2'), + ('4.99', '236', '2007-04-26T23:42:11.996577', '6996', '2'), + ('4.99', '236', '2007-03-17T13:43:33.996577', '11895', '1'), + ('3.99', '236', '2007-04-10T01:18:55.996577', '5545', '1'), + ('2.99', '236', '2007-04-11T16:24:09.996577', '6303', '1'), + ('4.99', '236', '2007-04-28T05:52:28.996577', '7792', '1'), + ('6.99', '236', '2007-02-18T07:19:55.996577', '2311', '2'), + ('5.99', '236', '2007-04-28T05:40:21.996577', '7780', '1'), + ('7.99', '236', '2007-03-21T07:53:37.996577', '14364', '1'), + ('0.99', '236', '2007-04-08T21:50:49.996577', '4959', '1'), + ('5.99', '236', '2007-03-16T21:55:09.996577', '11507', '2'), + ('0.99', '236', '2007-05-14T13:44:29.996577', '12988', '1'), + ('3.99', '236', '2007-03-02T21:02:32.996577', '11486', '2'), + ('4.99', '236', '2007-04-08T12:34:24.996577', '4749', '2'), + ('2.99', '236', '2007-03-19T05:19:45.996577', '12975', '1'), + ('2.99', '236', '2007-04-29T13:37:51.996577', '8657', '1'), + ('5.99', '236', '2007-02-15T08:36:14.996577', '1308', '2'), + ('2.99', '236', '2007-04-28T06:10:25.996577', '7798', '2'), + ('2.99', '236', '2007-04-09T18:39:09.996577', '5404', '1'), + ('4.99', '236', '2007-04-27T01:59:37.996577', '7047', '2'), + ('4.99', '236', '2007-04-06T15:36:20.996577', '3857', '2'), + ('2.99', '236', '2007-03-19T19:37:56.996577', '13364', '1'), + ('4.99', '236', '2007-04-30T20:30:07.996577', '10137', '2'), + ('0.99', '236', '2007-04-06T05:50:35.996577', '3645', '1'), + ('2.99', '236', '2007-02-21T20:15:22.996577', '3460', '2'), + ('2.99', '236', '2007-04-30T13:53:52.996577', '9934', '1'), + ('0.99', '236', '2007-04-11T02:00:58.996577', '6049', '2'), + ('3.99', '236', '2007-02-19T20:46:10.996577', '2840', '2'), + ('0.99', '236', '2007-02-15T05:23:19.996577', '1262', '1'), + ('7.99', '236', '2007-03-19T22:22:08.996577', '13443', '1'), + ('3.99', '236', '2007-04-10T20:46:08.996577', '5938', '2'), + ('4.99', '236', '2007-04-11T15:06:42.996577', '6281', '2'), + ('6.99', '236', '2007-03-02T07:56:02.996577', '11139', '2'), + ('4.99', '236', '2007-02-21T09:57:49.996577', '3353', '1'), + ('2.99', '236', '2007-02-19T07:15:47.996577', '2630', '1'), + ('4.99', '236', '2007-03-21T06:33:38.996577', '14321', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['31587', '19385', '31582', '24864', '17540', '26104', '20281', '26108', '20287', '26100', '20282', '20286', '17538', '17539', '26110', '26103', '26101', '20285', '20283', '31939', '20284', '20288', '20289', '26102', '26105', '26109', '20291', '26106', '20290', '17537', '26111', '26107', '27060', '21095', '27059', '17859', '21096', '21091', '21089', '21088', '27055', '21094', '27054', '27057', '21090', '17860', '21092', '27053', '27052', '17862', '27058', '21093', '21087', '17857', '17858', '27056', '17863', '17861', '28045', '21940', '28046', '28047', '21939', '28038', '18195', '28042', '28044', '28032', '28041', '21935', '28035', '18197', '28030', '18194', '28037', '21943', '21938', '28036', '28043', '21937', '21942', '21941', '28031', '18196', '28029', '28034', '21936', '28040', '28033', '28039', '21780', '21784', '21782', '27849', '27853', '21783', '27854', '31979', '18131', '18129']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('5.99', '236', '2007-04-30T03:44:55.996577', '9011', '1'), + ('8.99', '236', '2007-02-17T19:58:00.996577', '2139', '2'), + ('0.99', '236', '2007-04-27T09:15:03.996577', '7253', '2'), + ('4.99', '236', '2007-03-21T20:19:19.996577', '14722', '2'), + ('8.99', '349', '2007-02-20T12:27:47.996577', '3067', '1'), + ('4.99', '349', '2007-04-09T19:50:26.996577', '5433', '1'), + ('4.99', '349', '2007-03-02T03:05:18.996577', '10987', '1'), + ('4.99', '349', '2007-04-29T01:14:12.996577', '8297', '2'), + ('6.99', '349', '2007-03-21T02:19:53.996577', '14200', '2'), + ('3.99', '349', '2007-04-05T22:01:15.996577', '3488', '2'), + ('4.99', '349', '2007-03-02T09:58:07.996577', '11192', '2'), + ('4.99', '349', '2007-03-20T05:48:35.996577', '13636', '2'), + ('0.99', '349', '2007-02-15T22:47:06.996577', '1523', '1'), + ('6.99', '349', '2007-02-20T07:24:16.996577', '2987', '2'), + ('5.99', '349', '2007-04-30T05:01:59.996577', '9670', '1'), + ('0.99', '349', '2007-04-08T18:09:00.996577', '4881', '1'), + ('2.99', '349', '2007-04-07T09:21:05.996577', '4190', '1'), + ('4.99', '349', '2007-03-19T15:34:03.996577', '13258', '1'), + ('8.99', '349', '2007-03-02T21:15:13.996577', '11492', '2'), + ('2.99', '349', '2007-05-14T13:44:29.996577', '14915', '1'), + ('3.99', '349', '2007-03-17T14:08:44.996577', '11905', '1'), + ('6.99', '349', '2007-03-21T20:19:17.996577', '14721', '2'), + ('4.99', '349', '2007-03-22T03:12:36.996577', '14908', '2'), + ('5.99', '349', '2007-04-08T00:11:11.996577', '4494', '2'), + ('4.99', '349', '2007-04-26T23:54:40.996577', '7002', '1'), + ('1.99', '349', '2007-04-30T13:13:28.996577', '9262', '1'), + ('5.99', '349', '2007-03-23T17:47:32.996577', '15955', '1'), + ('4.99', '349', '2007-04-27T01:56:22.996577', '7046', '1'), + ('6.99', '349', '2007-03-23T13:50:41.996577', '15833', '1'), + ('2.99', '349', '2007-02-15T00:11:12.996577', '1197', '1'), + ('0.99', '349', '2007-04-30T07:23:13.996577', '9731', '1'), + ('2.99', '349', '2007-04-28T02:24:31.996577', '7702', '2'), + ('4.99', '434', '2007-04-30T16:52:56.996577', '9350', '1'), + ('3.99', '434', '2007-03-22T07:16:01.996577', '15016', '2'), + ('0.99', '434', '2007-04-28T21:47:14.996577', '8205', '1'), + ('7.99', '434', '2007-02-18T15:31:08.996577', '2415', '2'), + ('4.99', '434', '2007-03-22T21:06:00.996577', '15385', '2'), + ('7.99', '434', '2007-03-18T16:03:26.996577', '12624', '2'), + ('2.99', '434', '2007-03-17T18:39:14.996577', '12030', '2'), + ('2.99', '434', '2007-03-17T12:32:54.996577', '11867', '1'), + ('2.99', '434', '2007-04-09T21:26:40.996577', '5464', '2'), + ('4.99', '434', '2007-03-21T14:28:06.996577', '14553', '2'), + ('10.99', '434', '2007-04-08T21:55:42.996577', '4960', '2'), + ('6.99', '434', '2007-04-27T09:37:54.996577', '7260', '1'), + ('2.99', '434', '2007-03-17T22:38:30.996577', '12146', '2'), + ('3.99', '434', '2007-02-18T16:20:12.996577', '2430', '1'), + ('9.99', '434', '2007-03-19T19:33:15.996577', '13359', '2'), + ('6.99', '434', '2007-04-08T08:16:29.996577', '4654', '2'), + ('2.99', '434', '2007-04-07T20:28:47.996577', '4414', '1'), + ('2.99', '434', '2007-02-20T09:13:46.996577', '3014', '1'), + ('2.99', '434', '2007-04-27T17:46:43.996577', '7479', '2'), + ('7.99', '434', '2007-03-19T20:07:10.996577', '13383', '1'), + ('3.99', '434', '2007-03-02T12:00:26.996577', '11242', '1'), + ('0.99', '434', '2007-02-15T02:14:01.996577', '1225', '1'), + ('5.99', '434', '2007-02-16T03:19:16.996577', '1584', '2'), + ('0.99', '434', '2007-04-26T22:59:51.996577', '6972', '2'), + ('2.99', '434', '2007-02-20T10:56:29.996577', '3037', '2'), + ('3.99', '434', '2007-02-18T20:43:35.996577', '2494', '1'), + ('5.99', '522', '2007-04-30T19:12:36.996577', '9412', '1'), + ('6.99', '522', '2007-03-18T11:22:15.996577', '12494', '2'), + ('5.99', '522', '2007-04-30T23:46:36.996577', '9533', '2'), + ('0.99', '522', '2007-04-30T23:51:41.996577', '10223', '2'), + ('1.99', '522', '2007-03-17T11:21:41.996577', '11830', '2'), + ('2.99', '522', '2007-04-28T12:00:02.996577', '7955', '1'), + ('8.99', '522', '2007-02-20T15:24:21.996577', '3102', '2'), + ('7.99', '522', '2007-04-30T05:24:59.996577', '9047', '1'), + ('4.99', '522', '2007-04-30T16:29:19.996577', '9335', '1'), + ('4.99', '522', '2007-04-08T10:07:14.996577', '4701', '2'), + ('2.99', '522', '2007-04-30T02:22:38.996577', '8966', '1'), + ('3.99', '522', '2007-03-01T06:24:58.996577', '10411', '1'), + ('4.99', '522', '2007-04-10T00:45:57.996577', '5532', '2'), + ('0.99', '522', '2007-02-20T22:15:05.996577', '3191', '2'), + ('4.99', '522', '2007-04-07T03:33:31.996577', '4078', '2'), + ('3.99', '522', '2007-02-15T07:12:35.996577', '1289', '1'), + ('4.99', '522', '2007-04-27T09:44:02.996577', '7262', '2'), + ('6.99', '522', '2007-03-23T16:35:20.996577', '15921', '1'), + ('2.99', '522', '2007-03-17T05:29:35.996577', '11696', '2'), + ('0.99', '522', '2007-04-10T20:42:56.996577', '5936', '2'), + ('7.99', '522', '2007-04-30T12:04:39.996577', '9227', '2'), + ('5.99', '522', '2007-03-01T21:22:53.996577', '10821', '2'), + ('2.99', '522', '2007-03-21T11:31:59.996577', '14467', '2'), + ('6.99', '522', '2007-03-20T04:34:43.996577', '13605', '2'), + ('9.99', '522', '2007-04-08T03:37:21.996577', '4563', '2'), + ('2.99', '522', '2007-02-20T21:38:53.996577', '3188', '1'), + ('0.99', '522', '2007-04-06T03:11:13.996577', '3594', '1'), + ('6.99', '522', '2007-04-09T23:38:08.996577', '5514', '2'), + ('7.99', '522', '2007-03-01T15:40:23.996577', '10675', '1'), + ('6.99', '522', '2007-04-29T13:06:43.996577', '8642', '1'), + ('6.99', '522', '2007-04-09T12:53:27.996577', '5271', '2'), + ('4.99', '522', '2007-04-28T20:47:04.996577', '8181', '2'), + ('2.99', '505', '2007-03-01T23:47:59.996577', '10896', '1'), + ('2.99', '505', '2007-03-21T08:55:47.996577', '14398', '1'), + ('2.99', '505', '2007-03-17T14:09:13.996577', '11907', '1'), + ('6.99', '505', '2007-04-08T00:51:11.996577', '4507', '1'), + ('4.99', '505', '2007-04-28T05:43:58.996577', '7784', '1'), + ('3.99', '505', '2007-03-20T04:50:34.996577', '13612', '2'), + ('5.99', '505', '2007-04-30T23:38:59.996577', '10219', '2'), + ('4.99', '505', '2007-05-14T13:44:29.996577', '15867', '2'), + ('5.99', '505', '2007-02-20T18:09:54.996577', '3137', '1'), + ('4.99', '505', '2007-02-17T02:04:28.996577', '1886', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['18128', '27848', '18130', '27850', '21781', '27851', '27852', '21786', '21785', '28671', '22461', '28681', '28679', '28678', '22459', '28675', '28676', '22462', '28673', '28668', '22467', '18398', '22463', '28677', '22465', '28669', '28680', '22460', '22464', '28670', '28682', '28674', '22466', '22468', '28672', '26544', '26542', '26549', '26543', '20665', '20664', '26545', '20658', '26548', '17698', '26551', '26552', '26550', '20666', '17700', '26547', '17696', '20659', '20656', '20663', '20661', '20657', '20660', '17699', '26546', '31951', '17697', '20662', '25120', '31873', '31875', '25121', '31876', '31877', '31872', '31865', '25117', '25124', '25118', '25119', '31874', '25122', '19497', '31868', '31871', '19496', '25126', '25123', '31866', '25125', '31870', '32097', '31869', '31867', '25127', '20488', '26357', '20485', '17623', '17620', '26366', '26362', '26364', '20487', '20483']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('5.99', '505', '2007-02-16T18:45:46.996577', '1799', '2'), + ('5.99', '505', '2007-04-06T22:55:09.996577', '4008', '2'), + ('7.99', '505', '2007-02-19T16:32:44.996577', '2773', '1'), + ('9.99', '505', '2007-04-10T22:45:01.996577', '5976', '2'), + ('0.99', '505', '2007-03-02T08:37:06.996577', '11163', '1'), + ('4.99', '505', '2007-04-11T15:51:59.996577', '6292', '2'), + ('0.99', '505', '2007-04-11T22:55:34.996577', '6441', '1'), + ('4.99', '505', '2007-03-22T22:58:52.996577', '15436', '1'), + ('2.99', '505', '2007-03-21T23:16:49.996577', '14802', '1'), + ('3.99', '580', '2007-04-08T04:56:14.996577', '4590', '2'), + ('8.99', '580', '2007-03-02T08:39:22.996577', '11164', '1'), + ('4.99', '580', '2007-04-30T02:15:38.996577', '9604', '2'), + ('3.99', '580', '2007-04-30T12:19:18.996577', '9239', '1'), + ('0.99', '580', '2007-04-30T11:06:26.996577', '9199', '1'), + ('3.99', '580', '2007-03-01T17:39:15.996577', '10723', '1'), + ('0.99', '580', '2007-04-27T22:55:43.996577', '7620', '1'), + ('4.99', '580', '2007-04-29T19:04:03.996577', '8784', '2'), + ('2.99', '580', '2007-03-18T17:46:24.996577', '12670', '2'), + ('2.99', '580', '2007-04-11T04:14:25.996577', '6089', '1'), + ('1.99', '580', '2007-04-06T02:00:57.996577', '3571', '2'), + ('6.99', '580', '2007-03-23T05:57:39.996577', '15630', '1'), + ('0.99', '580', '2007-02-15T19:21:02.996577', '1469', '1'), + ('2.99', '580', '2007-03-19T17:40:07.996577', '13313', '2'), + ('3.99', '580', '2007-04-29T21:21:00.996577', '8839', '1'), + ('2.99', '580', '2007-03-21T23:45:44.996577', '14818', '2'), + ('1.99', '580', '2007-04-06T16:20:45.996577', '3867', '2'), + ('5.99', '580', '2007-04-30T20:54:05.996577', '9460', '1'), + ('3.99', '580', '2007-03-02T02:28:45.996577', '10965', '2'), + ('2.99', '580', '2007-03-20T09:17:41.996577', '13742', '2'), + ('1.99', '580', '2007-04-07T08:07:44.996577', '4169', '2'), + ('0.99', '580', '2007-04-30T11:39:11.996577', '9865', '2'), + ('2.99', '580', '2007-04-11T08:57:47.996577', '6170', '2'), + ('6.99', '580', '2007-03-22T12:58:35.996577', '15157', '1'), + ('4.99', '580', '2007-03-23T17:22:58.996577', '15947', '1'), + ('6.99', '580', '2007-04-10T20:44:34.996577', '5937', '1'), + ('2.99', '388', '2007-04-11T17:19:28.996577', '6321', '2'), + ('5.99', '388', '2007-04-08T21:18:03.996577', '4947', '2'), + ('2.99', '388', '2007-04-30T17:19:19.996577', '9368', '2'), + ('2.99', '388', '2007-04-10T18:50:18.996577', '5899', '2'), + ('5.99', '388', '2007-03-22T00:54:59.996577', '14853', '2'), + ('10.99', '388', '2007-03-21T04:55:14.996577', '14273', '1'), + ('2.99', '388', '2007-04-11T23:25:57.996577', '6452', '1'), + ('2.99', '388', '2007-03-17T20:05:34.996577', '12068', '1'), + ('0.99', '388', '2007-04-30T11:35:37.996577', '9213', '2'), + ('5.99', '388', '2007-02-19T00:20:47.996577', '2537', '1'), + ('0.99', '388', '2007-04-30T13:57:32.996577', '9940', '2'), + ('2.99', '388', '2007-04-30T17:30:59.996577', '10044', '2'), + ('2.99', '388', '2007-04-30T10:51:44.996577', '9840', '2'), + ('5.99', '388', '2007-03-23T07:19:47.996577', '15660', '2'), + ('7.99', '388', '2007-02-20T19:40:16.996577', '3159', '2'), + ('3.99', '388', '2007-04-29T06:26:57.996577', '8456', '2'), + ('6.99', '388', '2007-02-15T06:28:39.996577', '1276', '2'), + ('6.99', '388', '2007-03-18T02:52:56.996577', '12267', '2'), + ('0.99', '388', '2007-03-17T01:56:53.996577', '11604', '2'), + ('4.99', '388', '2007-03-19T05:23:59.996577', '12977', '1'), + ('2.99', '388', '2007-03-18T16:53:32.996577', '12646', '2'), + ('0.99', '388', '2007-03-17T19:08:03.996577', '12044', '2'), + ('4.99', '388', '2007-03-18T11:27:06.996577', '12497', '2'), + ('4.99', '388', '2007-02-19T11:36:45.996577', '2692', '1'), + ('5.99', '388', '2007-04-28T12:57:27.996577', '7985', '2'), + ('0.99', '388', '2007-05-14T13:44:29.996577', '12891', '1'), + ('0.99', '388', '2007-02-17T20:39:02.996577', '2145', '1'), + ('2.99', '388', '2007-03-18T20:59:47.996577', '12749', '1'), + ('0.99', '263', '2007-03-17T11:01:05.996577', '11822', '1'), + ('1.99', '263', '2007-04-12T16:05:08.996577', '6808', '1'), + ('4.99', '263', '2007-04-27T15:47:01.996577', '7425', '1'), + ('9.99', '263', '2007-03-17T19:33:01.996577', '12057', '2'), + ('4.99', '263', '2007-04-28T02:31:43.996577', '7706', '1'), + ('1.99', '263', '2007-04-28T07:14:40.996577', '7833', '2'), + ('2.99', '263', '2007-04-12T00:27:46.996577', '6483', '1'), + ('4.99', '263', '2007-04-06T02:15:31.996577', '3578', '1'), + ('6.99', '263', '2007-03-01T08:31:46.996577', '10476', '1'), + ('3.99', '263', '2007-03-21T07:01:33.996577', '14335', '1'), + ('2.99', '263', '2007-03-01T19:28:18.996577', '10775', '1'), + ('2.99', '263', '2007-03-02T15:30:32.996577', '11339', '1'), + ('4.99', '263', '2007-04-27T10:59:13.996577', '7291', '2'), + ('5.99', '263', '2007-03-18T09:03:39.996577', '12432', '2'), + ('1.99', '263', '2007-02-21T02:15:45.996577', '3257', '2'), + ('2.99', '263', '2007-04-08T09:06:53.996577', '4682', '2'), + ('4.99', '263', '2007-04-11T20:08:49.996577', '6376', '2'), + ('8.99', '263', '2007-02-17T19:23:02.996577', '2126', '2'), + ('4.99', '263', '2007-03-22T18:48:56.996577', '15322', '1'), + ('6.99', '263', '2007-03-19T03:00:41.996577', '12919', '2'), + ('2.99', '263', '2007-04-06T11:52:00.996577', '3773', '2'), + ('6.99', '263', '2007-03-21T10:41:36.996577', '14448', '2'), + ('1.99', '263', '2007-04-09T12:18:37.996577', '5254', '2'), + ('0.99', '263', '2007-05-14T13:44:29.996577', '15293', '1'), + ('2.99', '263', '2007-04-09T05:53:54.996577', '5125', '2'), + ('0.99', '263', '2007-04-08T07:18:20.996577', '4637', '2'), + ('7.99', '263', '2007-03-23T16:35:57.996577', '15922', '2'), + ('0.99', '371', '2007-03-23T12:17:00.996577', '15786', '1'), + ('8.99', '371', '2007-04-07T05:20:49.996577', '4115', '2'), + ('4.99', '371', '2007-03-19T12:57:14.996577', '13191', '1'), + ('3.99', '371', '2007-02-20T21:00:20.996577', '3176', '1'), + ('6.99', '371', '2007-02-16T02:00:05.996577', '1573', '1'), + ('4.99', '371', '2007-04-30T03:38:52.996577', '9008', '1'), + ('1.99', '371', '2007-04-11T23:42:10.996577', '6460', '1'), + ('3.99', '371', '2007-04-27T15:00:06.996577', '7408', '1'), + ('2.99', '371', '2007-03-21T08:31:03.996577', '14384', '1'), + ('2.99', '371', '2007-03-19T06:55:49.996577', '13028', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['20481', '26365', '20480', '26367', '26359', '20482', '20484', '17619', '20486', '17622', '17618', '26361', '17624', '26368', '26363', '20489', '26360', '17621', '26358', '29771', '18775', '29769', '29779', '29777', '18776', '23360', '29774', '29773', '23359', '18777', '23363', '29772', '23358', '29784', '29783', '29778', '29781', '29780', '23362', '29775', '29768', '29782', '29785', '29776', '29770', '23361', '23357', '31850', '19487', '25096', '31852', '19486', '31848', '19490', '25098', '19491', '25097', '25103', '25104', '19489', '31851', '25100', '19488', '25099', '31849', '31847', '31853', '25101', '25102', '18606', '18607', '18603', '22946', '22949', '29277', '29272', '29280', '29275', '18604', '22943', '29278', '22945', '18602', '18601', '22947', '18605', '29271', '18608', '29281', '29273', '29282', '22950', '22942', '29279', '29274', '22944', '22948', '22951', '29276', '26401']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('9.99', '371', '2007-03-18T07:41:18.996577', '12397', '2'), + ('4.99', '371', '2007-04-28T18:40:43.996577', '8138', '1'), + ('10.99', '371', '2007-03-02T06:07:10.996577', '11086', '1'), + ('8.99', '371', '2007-04-30T07:49:25.996577', '9117', '1'), + ('4.99', '371', '2007-04-09T07:55:21.996577', '5171', '1'), + ('7.99', '371', '2007-03-18T14:20:02.996577', '12584', '2'), + ('3.99', '371', '2007-03-19T11:13:04.996577', '13143', '2'), + ('1.99', '371', '2007-02-15T01:53:10.996577', '1218', '1'), + ('4.99', '371', '2007-03-20T16:29:03.996577', '13953', '2'), + ('0.99', '371', '2007-02-19T20:32:16.996577', '2837', '2'), + ('2.99', '371', '2007-02-15T01:31:59.996577', '1212', '2'), + ('2.99', '371', '2007-04-10T23:51:32.996577', '6000', '1'), + ('0.99', '371', '2007-02-21T13:51:34.996577', '3396', '2'), + ('0.99', '371', '2007-04-30T03:40:53.996577', '9635', '1'), + ('0.99', '371', '2007-04-12T21:08:14.996577', '6922', '1'), + ('2.99', '371', '2007-03-23T13:37:43.996577', '15824', '1'), + ('0.99', '371', '2007-04-10T03:45:22.996577', '5614', '2'), + ('5.99', '371', '2007-02-16T09:33:13.996577', '1675', '2'), + ('1.99', '371', '2007-04-08T06:09:10.996577', '4612', '1'), + ('8.99', '71', '2007-04-10T01:16:29.996577', '5543', '1'), + ('2.99', '71', '2007-02-17T01:06:54.996577', '1873', '2'), + ('1.99', '71', '2007-04-09T13:23:33.996577', '5281', '2'), + ('2.99', '71', '2007-04-28T18:14:32.996577', '8128', '2'), + ('4.99', '71', '2007-04-27T20:23:33.996577', '7550', '1'), + ('4.99', '71', '2007-02-18T13:12:32.996577', '2374', '1'), + ('4.99', '71', '2007-03-21T22:43:38.996577', '14781', '2'), + ('0.99', '71', '2007-04-11T00:37:21.996577', '6020', '2'), + ('4.99', '71', '2007-04-10T14:15:16.996577', '5814', '2'), + ('3.99', '71', '2007-03-21T03:25:34.996577', '14228', '1'), + ('5.99', '71', '2007-02-21T09:33:33.996577', '3345', '2'), + ('0.99', '71', '2007-03-23T19:13:02.996577', '16000', '1'), + ('4.99', '71', '2007-04-10T11:49:54.996577', '5770', '1'), + ('7.99', '71', '2007-03-20T23:13:00.996577', '14105', '1'), + ('4.99', '71', '2007-04-29T19:15:53.996577', '8789', '1'), + ('3.99', '71', '2007-04-29T18:59:54.996577', '8783', '1'), + ('4.99', '71', '2007-04-28T12:48:25.996577', '7982', '2'), + ('1.99', '71', '2007-04-29T10:20:19.996577', '8574', '1'), + ('2.99', '71', '2007-04-29T00:59:16.996577', '8293', '1'), + ('4.99', '71', '2007-03-23T08:54:11.996577', '15704', '1'), + ('5.99', '71', '2007-04-12T12:50:34.996577', '6739', '1'), + ('4.99', '71', '2007-04-08T06:13:43.996577', '4614', '2'), + ('4.99', '71', '2007-04-29T14:09:57.996577', '8668', '1'), + ('0.99', '71', '2007-04-30T02:00:55.996577', '8956', '1'), + ('0.99', '71', '2007-04-27T05:54:32.996577', '7160', '2'), + ('3.99', '71', '2007-04-09T16:37:47.996577', '5358', '2'), + ('3.99', '71', '2007-03-22T03:00:27.996577', '14904', '2'), + ('4.99', '71', '2007-03-18T08:25:26.996577', '12417', '1'), + ('0.99', '261', '2007-04-12T12:57:51.996577', '6743', '1'), + ('5.99', '261', '2007-02-17T01:22:42.996577', '1877', '1'), + ('1.99', '261', '2007-03-01T00:58:16.996577', '10246', '2'), + ('4.99', '261', '2007-04-30T10:53:24.996577', '9842', '1'), + ('2.99', '261', '2007-02-16T16:17:03.996577', '1760', '1'), + ('5.99', '261', '2007-04-09T20:40:27.996577', '5449', '1'), + ('0.99', '261', '2007-02-18T14:02:44.996577', '2392', '2'), + ('2.99', '261', '2007-03-17T14:56:50.996577', '11928', '2'), + ('0.99', '261', '2007-02-21T10:53:33.996577', '3363', '1'), + ('1.99', '261', '2007-03-17T11:29:06.996577', '11834', '1'), + ('4.99', '261', '2007-03-20T13:11:00.996577', '13849', '1'), + ('4.99', '261', '2007-03-22T21:37:12.996577', '15397', '2'), + ('3.99', '261', '2007-02-17T15:01:58.996577', '2072', '2'), + ('4.99', '261', '2007-04-30T00:33:58.996577', '9552', '2'), + ('4.99', '261', '2007-03-19T15:12:07.996577', '13245', '2'), + ('8.99', '261', '2007-02-17T09:11:00.996577', '1988', '2'), + ('6.99', '261', '2007-03-18T05:11:48.996577', '12327', '1'), + ('2.99', '261', '2007-04-12T02:18:58.996577', '6515', '2'), + ('3.99', '261', '2007-04-09T05:48:01.996577', '5122', '1'), + ('4.99', '261', '2007-04-30T11:50:20.996577', '9869', '1'), + ('5.99', '261', '2007-03-20T00:35:32.996577', '13506', '2'), + ('2.99', '261', '2007-03-20T06:54:58.996577', '13669', '1'), + ('4.99', '27', '2007-02-19T18:31:55.996577', '2815', '1'), + ('1.99', '27', '2007-02-20T10:57:25.996577', '3038', '1'), + ('2.99', '27', '2007-02-16T11:33:35.996577', '1699', '2'), + ('6.99', '27', '2007-03-17T07:16:57.996577', '11740', '2'), + ('2.99', '27', '2007-03-18T12:26:16.996577', '12531', '1'), + ('4.99', '27', '2007-04-12T09:41:47.996577', '6658', '2'), + ('5.99', '27', '2007-04-08T01:03:17.996577', '4510', '1'), + ('5.99', '27', '2007-04-30T03:41:25.996577', '9636', '2'), + ('0.99', '27', '2007-04-11T06:05:16.996577', '6115', '2'), + ('3.99', '27', '2007-02-17T07:28:23.996577', '1960', '2'), + ('4.99', '27', '2007-03-01T22:28:59.996577', '10852', '1'), + ('1.99', '27', '2007-04-28T10:42:08.996577', '7927', '1'), + ('8.99', '27', '2007-03-17T03:54:23.996577', '11661', '1'), + ('4.99', '27', '2007-02-15T19:45:43.996577', '1480', '2'), + ('4.99', '27', '2007-02-15T08:40:08.996577', '1310', '1'), + ('5.99', '27', '2007-03-17T18:21:09.996577', '12021', '2'), + ('2.99', '27', '2007-02-18T22:17:13.996577', '2512', '2'), + ('0.99', '27', '2007-04-07T01:21:19.996577', '4038', '2'), + ('3.99', '27', '2007-02-21T15:51:02.996577', '3420', '2'), + ('7.99', '27', '2007-04-30T05:03:21.996577', '9673', '1'), + ('0.99', '27', '2007-04-10T01:29:45.996577', '5552', '1'), + ('4.99', '27', '2007-04-30T13:08:18.996577', '9908', '1'), + ('4.99', '27', '2007-03-20T11:42:22.996577', '13816', '2'), + ('7.99', '27', '2007-03-01T20:19:41.996577', '10794', '1'), + ('0.99', '27', '2007-04-30T12:35:19.996577', '9244', '2'), + ('4.99', '27', '2007-04-10T10:14:14.996577', '5736', '1'), + ('0.99', '27', '2007-03-02T11:40:43.996577', '11234', '1'), + ('0.99', '27', '2007-03-18T09:56:40.996577', '12461', '2'), + ('0.99', '27', '2007-03-22T08:28:30.996577', '15048', '1'), + ('5.99', '27', '2007-04-12T03:54:52.996577', '6562', '2'), + ('4.99', '373', '2007-04-30T23:45:16.996577', '10221', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['20513', '26389', '20514', '20510', '26391', '26395', '26393', '20506', '26386', '20515', '26387', '20509', '17628', '26397', '26385', '20507', '17629', '31949', '20505', '20511', '20503', '20504', '26390', '20508', '26399', '26398', '26392', '26394', '26400', '26388', '20516', '26396', '20512', '24492', '19227', '24489', '31133', '24498', '19228', '24488', '31127', '19225', '31129', '24493', '24495', '24494', '24496', '24497', '24499', '32071', '24491', '24490', '31131', '31134', '19226', '31128', '31130', '31132', '31787', '25027', '25032', '31785', '19461', '25030', '25029', '31788', '31786', '25033', '25028', '31784', '31789', '25031', '19459', '19460', '19458', '31783', '20727', '26623', '17726', '26624', '26625', '26626', '20732', '20728', '17729', '17724', '17728', '26622', '26628', '17727', '20731', '17725', '20730', '20729', '26627', '29563', '23156', '23155', '29556', '29555']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('3.99', '373', '2007-03-19T18:25:21.996577', '13329', '1'), + ('3.99', '373', '2007-04-11T10:52:51.996577', '6202', '1'), + ('2.99', '373', '2007-03-19T23:25:10.996577', '13467', '2'), + ('7.99', '373', '2007-03-18T20:57:31.996577', '12748', '1'), + ('4.99', '373', '2007-04-26T22:02:28.996577', '6944', '1'), + ('3.99', '373', '2007-04-29T11:54:47.996577', '8611', '1'), + ('3.99', '373', '2007-04-27T07:35:31.996577', '7206', '2'), + ('3.99', '373', '2007-03-17T03:58:45.996577', '11663', '2'), + ('4.99', '373', '2007-04-06T07:05:00.996577', '3667', '2'), + ('6.99', '373', '2007-03-22T07:11:37.996577', '15014', '2'), + ('7.99', '373', '2007-04-07T16:27:50.996577', '4325', '1'), + ('5.99', '373', '2007-03-18T12:34:32.996577', '12536', '2'), + ('6.99', '373', '2007-02-15T19:23:21.996577', '1472', '1'), + ('4.99', '373', '2007-04-30T18:35:55.996577', '9397', '1'), + ('2.99', '373', '2007-04-06T04:04:48.996577', '3609', '2'), + ('3.99', '373', '2007-03-17T16:27:45.996577', '11976', '2'), + ('2.99', '373', '2007-02-20T19:49:27.996577', '3161', '1'), + ('0.99', '373', '2007-05-14T13:44:29.996577', '11739', '1'), + ('7.99', '373', '2007-03-16T22:19:32.996577', '11512', '2'), + ('0.99', '373', '2007-03-18T22:16:42.996577', '12780', '2'), + ('5.99', '373', '2007-03-01T18:51:17.996577', '10758', '1'), + ('7.99', '373', '2007-03-02T05:26:58.996577', '11066', '2'), + ('0.99', '373', '2007-04-11T16:47:18.996577', '6311', '2'), + ('5.99', '373', '2007-03-17T22:32:38.996577', '12142', '1'), + ('4.99', '373', '2007-04-30T14:55:12.996577', '9966', '1'), + ('0.99', '373', '2007-04-30T21:54:29.996577', '9480', '2'), + ('0.99', '373', '2007-04-27T03:15:59.996577', '7094', '1'), + ('0.99', '373', '2007-04-27T22:43:50.996577', '7615', '1'), + ('6.99', '373', '2007-04-30T16:30:02.996577', '10010', '1'), + ('5.99', '373', '2007-04-09T05:42:49.996577', '5120', '1'), + ('3.99', '373', '2007-03-22T09:18:39.996577', '15068', '1'), + ('8.99', '373', '2007-04-30T15:59:29.996577', '9327', '2'), + ('2.99', '373', '2007-03-19T17:14:59.996577', '13299', '2'), + ('2.99', '188', '2007-03-02T16:45:18.996577', '11378', '2'), + ('4.99', '188', '2007-02-18T22:25:57.996577', '2515', '1'), + ('0.99', '188', '2007-03-01T09:13:47.996577', '10494', '1'), + ('4.99', '188', '2007-04-27T20:45:43.996577', '7556', '1'), + ('0.99', '188', '2007-03-22T21:54:58.996577', '15409', '2'), + ('4.99', '188', '2007-02-19T13:50:19.996577', '2733', '2'), + ('5.99', '188', '2007-03-01T07:41:53.996577', '10453', '2'), + ('3.99', '188', '2007-04-06T15:15:58.996577', '3848', '2'), + ('2.99', '188', '2007-02-15T23:00:06.996577', '1527', '2'), + ('2.99', '188', '2007-04-09T16:36:54.996577', '5356', '2'), + ('2.99', '188', '2007-03-20T03:33:23.996577', '13570', '1'), + ('2.99', '188', '2007-03-21T09:01:49.996577', '14399', '1'), + ('5.99', '188', '2007-03-20T10:43:49.996577', '13787', '1'), + ('2.99', '188', '2007-03-21T23:29:08.996577', '14809', '2'), + ('2.99', '188', '2007-03-22T18:45:43.996577', '15319', '2'), + ('4.99', '188', '2007-03-23T00:07:36.996577', '15474', '2'), + ('2.99', '188', '2007-05-14T13:44:29.996577', '14503', '1'), + ('4.99', '188', '2007-03-01T18:51:10.996577', '10757', '2'), + ('4.99', '188', '2007-03-01T17:28:54.996577', '10719', '2'), + ('4.99', '188', '2007-04-12T03:36:42.996577', '6555', '2'), + ('4.99', '188', '2007-04-30T02:27:19.996577', '9613', '2'), + ('0.99', '188', '2007-02-17T05:16:45.996577', '1927', '2'), + ('2.99', '188', '2007-04-07T07:11:48.996577', '4150', '2'), + ('5.99', '188', '2007-04-10T09:55:51.996577', '5729', '2'), + ('0.99', '188', '2007-04-27T01:48:44.996577', '7042', '2'), + ('2.99', '255', '2007-04-28T00:00:11.996577', '7646', '1'), + ('4.99', '255', '2007-03-17T16:35:39.996577', '11979', '2'), + ('8.99', '255', '2007-03-20T09:49:52.996577', '13758', '1'), + ('0.99', '255', '2007-04-10T21:16:39.996577', '5943', '1'), + ('2.99', '255', '2007-02-21T18:35:17.996577', '3442', '2'), + ('0.99', '255', '2007-03-19T16:02:16.996577', '13268', '1'), + ('2.99', '255', '2007-03-19T11:38:20.996577', '13154', '2'), + ('0.99', '255', '2007-04-29T10:00:39.996577', '8562', '1'), + ('8.99', '255', '2007-04-27T17:36:09.996577', '7475', '2'), + ('3.99', '255', '2007-03-21T16:13:47.996577', '14600', '2'), + ('7.99', '255', '2007-03-17T23:38:59.996577', '12176', '2'), + ('1.99', '255', '2007-04-10T08:50:12.996577', '5706', '1'), + ('6.99', '255', '2007-04-30T05:50:18.996577', '9061', '1'), + ('0.99', '255', '2007-03-20T07:23:21.996577', '13683', '2'), + ('6.99', '255', '2007-02-15T16:24:40.996577', '1420', '1'), + ('2.99', '255', '2007-02-16T10:06:43.996577', '1681', '2'), + ('2.99', '255', '2007-02-15T02:59:54.996577', '1235', '1'), + ('0.99', '255', '2007-04-08T02:48:45.996577', '4547', '1'), + ('0.99', '395', '2007-03-17T13:36:53.996577', '11889', '1'), + ('5.99', '395', '2007-04-07T08:59:31.996577', '4185', '1'), + ('0.99', '395', '2007-02-16T04:42:29.996577', '1603', '2'), + ('4.99', '395', '2007-04-07T19:41:02.996577', '4393', '1'), + ('0.99', '395', '2007-04-09T04:12:54.996577', '5087', '1'), + ('0.99', '395', '2007-04-09T06:23:27.996577', '5136', '2'), + ('4.99', '395', '2007-03-23T18:22:50.996577', '15970', '1'), + ('5.99', '395', '2007-03-21T11:39:06.996577', '14471', '1'), + ('6.99', '395', '2007-02-21T13:06:21.996577', '3389', '1'), + ('0.99', '395', '2007-02-15T05:58:48.996577', '1270', '1'), + ('0.99', '395', '2007-02-21T06:33:17.996577', '3310', '1'), + ('0.99', '395', '2007-04-06T07:57:48.996577', '3684', '2'), + ('7.99', '395', '2007-04-28T12:58:39.996577', '7986', '2'), + ('4.99', '395', '2007-02-20T10:20:25.996577', '3030', '1'), + ('0.99', '395', '2007-03-23T14:27:38.996577', '15856', '1'), + ('0.99', '395', '2007-02-16T01:14:53.996577', '1562', '1'), + ('2.99', '395', '2007-03-23T08:40:06.996577', '15698', '1'), + ('0.99', '395', '2007-03-21T20:12:19.996577', '14720', '2'), + ('2.99', '395', '2007-04-28T03:52:02.996577', '7740', '1'), + ('10.99', '50', '2007-04-30T05:38:21.996577', '9691', '2'), + ('6.99', '50', '2007-03-18T21:53:46.996577', '12766', '1'), + ('3.99', '50', '2007-03-02T04:55:39.996577', '11053', '2'), + ('8.99', '50', '2007-04-12T10:04:48.996577', '6667', '1'), + ('0.99', '50', '2007-04-12T08:05:44.996577', '6634', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['29550', '23153', '29564', '18706', '18704', '29553', '23157', '29557', '23159', '29562', '29559', '18705', '29552', '23154', '29554', '29551', '23161', '29560', '29561', '23158', '18703', '29566', '29565', '23160', '29558', '25519', '19825', '25523', '19828', '19827', '19826', '19822', '19829', '25522', '25518', '25525', '19830', '25520', '19824', '25524', '25521', '19823', '19832', '25526', '19831', '25517', '30550', '30546', '30539', '30536', '30537', '30549', '30554', '30541', '30542', '23971', '23968', '23960', '19032', '30543', '30544', '23964', '19031', '30538', '23963', '23969', '19030', '30540', '30552', '23970', '23965', '30545', '19029', '30551', '30548', '23962', '30547', '23959', '23973', '23972', '30553', '23967', '23966', '23961', '21519', '31972', '18028', '27493', '21517', '27500', '27498', '21518', '27495', '21513', '21516', '18027', '21521', '21511', '27499', '21515']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('2.99', '50', '2007-04-07T07:08:43.996577', '4149', '2'), + ('4.99', '50', '2007-03-01T01:26:53.996577', '10261', '2'), + ('2.99', '50', '2007-04-30T17:35:37.996577', '10046', '2'), + ('2.99', '50', '2007-02-20T20:24:20.996577', '3169', '2'), + ('4.99', '50', '2007-02-16T17:55:38.996577', '1785', '1'), + ('9.99', '50', '2007-04-10T07:17:05.996577', '5681', '2'), + ('7.99', '50', '2007-03-19T10:52:49.996577', '13136', '2'), + ('4.99', '50', '2007-04-27T14:15:19.996577', '7383', '1'), + ('2.99', '50', '2007-03-22T12:04:56.996577', '15138', '2'), + ('4.99', '50', '2007-04-30T02:28:22.996577', '9615', '1'), + ('0.99', '50', '2007-04-28T23:39:31.996577', '8261', '1'), + ('0.99', '50', '2007-02-20T08:00:59.996577', '3000', '2'), + ('4.99', '50', '2007-04-10T05:12:09.996577', '5641', '2'), + ('7.99', '50', '2007-03-01T08:49:00.996577', '10485', '2'), + ('6.99', '50', '2007-04-10T20:26:56.996577', '5928', '1'), + ('4.99', '50', '2007-04-09T13:43:13.996577', '5290', '2'), + ('4.99', '50', '2007-03-23T19:53:29.996577', '16015', '1'), + ('5.99', '50', '2007-04-29T12:18:34.996577', '8619', '1'), + ('0.99', '50', '2007-04-30T10:31:07.996577', '9179', '2'), + ('4.99', '50', '2007-03-20T20:45:27.996577', '14054', '1'), + ('2.99', '50', '2007-02-15T02:07:19.996577', '1223', '1'), + ('6.99', '50', '2007-04-30T22:26:09.996577', '10180', '2'), + ('0.99', '50', '2007-04-30T21:49:49.996577', '10165', '2'), + ('6.99', '50', '2007-03-22T21:17:49.996577', '15388', '2'), + ('0.99', '50', '2007-04-28T16:55:13.996577', '8089', '1'), + ('2.99', '298', '2007-04-07T14:16:13.996577', '4291', '2'), + ('0.99', '298', '2007-03-17T20:26:45.996577', '12076', '2'), + ('0.99', '298', '2007-04-12T15:42:43.996577', '6802', '2'), + ('4.99', '298', '2007-03-19T15:11:30.996577', '13244', '1'), + ('0.99', '298', '2007-03-19T12:17:33.996577', '13172', '1'), + ('8.99', '298', '2007-03-18T21:50:16.996577', '12765', '1'), + ('6.99', '298', '2007-03-01T01:03:54.996577', '10248', '2'), + ('0.99', '298', '2007-03-21T11:47:29.996577', '14473', '2'), + ('2.99', '298', '2007-04-09T11:54:54.996577', '5247', '1'), + ('2.99', '298', '2007-04-06T09:57:26.996577', '3728', '1'), + ('7.99', '298', '2007-04-28T08:41:41.996577', '7869', '1'), + ('3.99', '298', '2007-03-22T16:18:01.996577', '15245', '1'), + ('3.99', '298', '2007-04-08T20:53:16.996577', '4936', '1'), + ('6.99', '298', '2007-03-02T13:22:34.996577', '11288', '2'), + ('0.99', '298', '2007-04-28T06:20:23.996577', '7802', '2'), + ('2.99', '298', '2007-04-09T07:44:14.996577', '5166', '2'), + ('0.99', '298', '2007-03-02T05:39:05.996577', '11070', '1'), + ('4.99', '298', '2007-03-23T06:41:52.996577', '15643', '1'), + ('5.99', '298', '2007-04-29T17:00:39.996577', '8737', '2'), + ('4.99', '298', '2007-03-22T16:53:47.996577', '15262', '2'), + ('0.99', '298', '2007-04-05T21:37:19.996577', '3479', '2'), + ('4.99', '137', '2007-04-30T11:08:18.996577', '9200', '2'), + ('8.99', '137', '2007-04-28T14:39:41.996577', '8028', '1'), + ('6.99', '137', '2007-04-07T16:53:52.996577', '4332', '1'), + ('4.99', '137', '2007-04-06T02:58:44.996577', '3589', '2'), + ('5.99', '137', '2007-04-06T07:39:03.996577', '3676', '2'), + ('4.99', '137', '2007-04-30T03:30:47.996577', '9002', '1'), + ('6.99', '137', '2007-04-30T22:08:37.996577', '10175', '1'), + ('2.99', '137', '2007-04-09T05:08:50.996577', '5106', '1'), + ('3.99', '137', '2007-04-09T20:24:35.996577', '5443', '1'), + ('2.99', '137', '2007-03-23T02:28:56.996577', '15537', '2'), + ('7.99', '137', '2007-03-21T21:45:52.996577', '14754', '1'), + ('5.99', '137', '2007-03-01T22:09:50.996577', '10842', '2'), + ('5.99', '137', '2007-02-21T17:44:35.996577', '3436', '1'), + ('2.99', '137', '2007-04-10T13:34:57.996577', '5804', '1'), + ('6.99', '137', '2007-04-11T01:40:45.996577', '6039', '1'), + ('2.99', '137', '2007-03-17T20:28:48.996577', '12078', '1'), + ('3.99', '137', '2007-02-20T11:57:01.996577', '3058', '2'), + ('6.99', '137', '2007-04-06T16:34:38.996577', '3874', '2'), + ('3.99', '137', '2007-03-17T06:58:12.996577', '11732', '2'), + ('7.99', '137', '2007-03-22T09:45:32.996577', '15082', '2'), + ('2.99', '137', '2007-02-19T17:12:23.996577', '2785', '1'), + ('3.99', '137', '2007-04-07T22:55:22.996577', '4474', '2'), + ('4.99', '137', '2007-04-30T06:33:21.996577', '9709', '1'), + ('0.99', '137', '2007-03-22T11:46:09.996577', '15133', '1'), + ('0.99', '137', '2007-03-19T11:23:56.996577', '13148', '1'), + ('0.99', '137', '2007-04-11T10:45:08.996577', '6200', '2'), + ('6.99', '137', '2007-02-18T18:52:49.996577', '2469', '1'), + ('7.99', '137', '2007-04-30T21:13:02.996577', '9466', '2'), + ('2.99', '137', '2007-04-30T01:54:17.996577', '8954', '2'), + ('3.99', '137', '2007-03-02T13:03:27.996577', '11281', '1'), + ('4.99', '137', '2007-04-28T17:31:12.996577', '8106', '1'), + ('4.99', '137', '2007-03-01T12:44:54.996577', '10595', '2'), + ('9.99', '137', '2007-03-23T20:24:30.996577', '16030', '1'), + ('4.99', '137', '2007-03-23T15:26:09.996577', '15889', '2'), + ('2.99', '137', '2007-04-30T08:58:51.996577', '9789', '1'), + ('5.99', '137', '2007-03-20T10:25:32.996577', '13776', '1'), + ('5.99', '137', '2007-03-19T23:31:57.996577', '13472', '1'), + ('4.99', '137', '2007-03-02T05:06:45.996577', '11057', '2'), + ('0.99', '474', '2007-03-21T20:44:02.996577', '14728', '1'), + ('0.99', '474', '2007-05-14T13:44:29.996577', '11909', '1'), + ('7.99', '474', '2007-02-20T04:12:08.996577', '2944', '2'), + ('2.99', '474', '2007-04-07T23:26:41.996577', '4481', '1'), + ('2.99', '474', '2007-03-18T15:02:28.996577', '12597', '2'), + ('2.99', '474', '2007-04-30T03:11:20.996577', '8991', '1'), + ('0.99', '474', '2007-04-09T12:04:36.996577', '5251', '1'), + ('4.99', '474', '2007-03-18T18:58:59.996577', '12702', '1'), + ('0.99', '474', '2007-04-08T14:38:45.996577', '4785', '2'), + ('2.99', '474', '2007-03-16T23:09:34.996577', '11537', '2'), + ('0.99', '474', '2007-03-18T09:16:01.996577', '12440', '1'), + ('8.99', '474', '2007-02-16T16:08:05.996577', '1758', '1'), + ('6.99', '474', '2007-03-23T03:20:48.996577', '15558', '1'), + ('0.99', '474', '2007-03-02T07:04:29.996577', '11117', '2'), + ('7.99', '474', '2007-04-12T01:39:44.996577', '6499', '1'), + ('4.99', '474', '2007-03-18T01:47:55.996577', '12236', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['27497', '27496', '21520', '21510', '27492', '21512', '27494', '21514', '27491', '20923', '26846', '20921', '20924', '20925', '26849', '20928', '17792', '26850', '20922', '26854', '26852', '20927', '26847', '26851', '26853', '26848', '20920', '17791', '20926', '26845', '26855', '17507', '17506', '20204', '26009', '20202', '17508', '20200', '26013', '20206', '17504', '17503', '20207', '26008', '26010', '26011', '20205', '17505', '20203', '26007', '26012', '20208', '20201', '31090', '24456', '24458', '24454', '31093', '24455', '31089', '31088', '31091', '19208', '24453', '31092', '19207', '24452', '24457', '24451', '31087', '24459', '31095', '31094', '18362', '28563', '22381', '22386', '28555', '28559', '28558', '18364', '18366', '22384', '28561', '22380', '18365', '22385', '22382', '22383', '28556', '28557', '28560', '18363', '28562', '18361', '22395', '22390', '28568', '28564', '22391']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('4.99', '474', '2007-04-08T18:21:48.996577', '4886', '2'), + ('2.99', '474', '2007-04-08T15:31:48.996577', '4809', '1'), + ('4.99', '474', '2007-03-22T08:23:20.996577', '15046', '2'), + ('5.99', '474', '2007-03-01T04:55:39.996577', '10376', '2'), + ('1.99', '474', '2007-04-07T01:59:18.996577', '4048', '2'), + ('2.99', '474', '2007-03-02T21:03:54.996577', '11489', '1'), + ('0.99', '474', '2007-04-08T02:00:27.996577', '4533', '1'), + ('2.99', '474', '2007-03-17T20:42:03.996577', '12083', '1'), + ('4.99', '474', '2007-04-06T12:30:27.996577', '3787', '2'), + ('5.99', '415', '2007-03-17T21:59:35.996577', '12128', '2'), + ('0.99', '415', '2007-04-10T06:38:34.996577', '5665', '2'), + ('2.99', '415', '2007-03-01T11:22:32.996577', '10553', '1'), + ('2.99', '415', '2007-03-18T14:33:11.996577', '12588', '2'), + ('8.99', '415', '2007-03-20T08:45:34.996577', '13729', '2'), + ('3.99', '415', '2007-04-12T01:56:03.996577', '6505', '1'), + ('0.99', '415', '2007-03-23T17:55:30.996577', '15959', '1'), + ('2.99', '415', '2007-02-20T23:29:55.996577', '3211', '1'), + ('4.99', '415', '2007-04-27T14:05:09.996577', '7379', '1'), + ('1.99', '415', '2007-03-02T14:20:24.996577', '11310', '2'), + ('2.99', '415', '2007-04-30T01:35:42.996577', '9586', '2'), + ('4.99', '415', '2007-04-28T04:20:49.996577', '7748', '1'), + ('4.99', '415', '2007-03-22T11:15:03.996577', '15121', '2'), + ('0.99', '415', '2007-04-10T10:05:50.996577', '5733', '2'), + ('0.99', '415', '2007-04-27T23:06:10.996577', '7624', '2'), + ('2.99', '415', '2007-04-29T02:07:33.996577', '8317', '2'), + ('5.99', '415', '2007-04-12T00:56:57.996577', '6491', '2'), + ('5.99', '415', '2007-03-01T01:31:14.996577', '10263', '1'), + ('4.99', '415', '2007-02-17T00:30:03.996577', '1867', '2'), + ('4.99', '415', '2007-03-22T06:20:13.996577', '14992', '1'), + ('8.99', '415', '2007-04-08T20:30:14.996577', '4926', '2'), + ('2.99', '415', '2007-04-30T11:20:43.996577', '9852', '1'), + ('7.99', '341', '2007-02-20T17:31:48.996577', '3130', '2'), + ('2.99', '341', '2007-02-19T19:39:56.996577', '2829', '2'), + ('8.99', '341', '2007-03-19T08:35:19.996577', '13074', '2'), + ('4.99', '341', '2007-04-09T22:30:16.996577', '5487', '2'), + ('2.99', '341', '2007-03-17T06:24:48.996577', '11723', '1'), + ('5.99', '341', '2007-02-21T12:33:49.996577', '3382', '1'), + ('0.99', '341', '2007-03-01T13:04:52.996577', '10605', '2'), + ('9.99', '341', '2007-04-29T16:41:15.996577', '8728', '1'), + ('4.99', '341', '2007-03-21T07:09:22.996577', '14344', '2'), + ('1.99', '341', '2007-02-16T17:23:14.996577', '1778', '1'), + ('7.99', '341', '2007-02-15T22:25:46.996577', '1520', '2'), + ('0.99', '341', '2007-03-22T07:38:47.996577', '15030', '2'), + ('2.99', '341', '2007-04-08T06:40:43.996577', '4624', '1'), + ('0.99', '341', '2007-04-10T20:32:45.996577', '5931', '2'), + ('2.99', '341', '2007-04-27T17:34:06.996577', '7473', '2'), + ('4.99', '341', '2007-03-20T11:22:12.996577', '13806', '2'), + ('7.99', '341', '2007-02-16T22:41:45.996577', '1849', '1'), + ('0.99', '341', '2007-03-19T08:10:27.996577', '13059', '2'), + ('4.99', '341', '2007-04-06T19:44:11.996577', '3938', '2'), + ('2.99', '341', '2007-04-29T13:56:50.996577', '8661', '1'), + ('6.99', '341', '2007-03-23T17:11:57.996577', '15938', '2'), + ('6.99', '341', '2007-03-02T14:13:21.996577', '11305', '1'), + ('2.99', '184', '2007-04-12T01:09:07.996577', '6493', '2'), + ('4.99', '184', '2007-03-19T17:23:47.996577', '13303', '1'), + ('5.99', '184', '2007-03-21T23:15:20.996577', '14801', '1'), + ('0.99', '184', '2007-03-19T10:42:40.996577', '13134', '1'), + ('6.99', '184', '2007-04-28T01:47:49.996577', '7686', '2'), + ('5.99', '184', '2007-03-19T15:48:41.996577', '13262', '1'), + ('0.99', '184', '2007-04-10T18:29:43.996577', '5891', '1'), + ('6.99', '184', '2007-04-08T18:10:29.996577', '4882', '2'), + ('6.99', '184', '2007-04-12T11:15:48.996577', '6700', '2'), + ('0.99', '184', '2007-02-18T07:24:12.996577', '2312', '1'), + ('2.99', '184', '2007-03-18T12:26:24.996577', '12532', '1'), + ('4.99', '184', '2007-04-27T02:03:03.996577', '7051', '2'), + ('2.99', '184', '2007-02-17T08:06:34.996577', '1976', '2'), + ('2.99', '184', '2007-03-18T09:47:28.996577', '12454', '2'), + ('4.99', '184', '2007-03-21T11:42:23.996577', '14472', '2'), + ('9.99', '184', '2007-03-17T23:25:32.996577', '12166', '2'), + ('0.99', '184', '2007-04-07T16:06:57.996577', '4314', '1'), + ('0.99', '184', '2007-03-23T05:24:44.996577', '15611', '2'), + ('0.99', '184', '2007-04-30T09:50:22.996577', '9162', '1'), + ('4.99', '184', '2007-04-29T23:15:29.996577', '8892', '1'), + ('3.99', '571', '2007-02-15T14:58:22.996577', '1400', '2'), + ('4.99', '571', '2007-04-30T19:00:35.996577', '9408', '1'), + ('2.99', '571', '2007-03-02T05:58:22.996577', '11080', '2'), + ('4.99', '571', '2007-03-23T14:04:25.996577', '15841', '1'), + ('2.99', '571', '2007-04-06T04:20:39.996577', '3616', '2'), + ('8.99', '571', '2007-04-12T15:05:54.996577', '6792', '1'), + ('8.99', '571', '2007-04-12T10:22:06.996577', '6676', '2'), + ('4.99', '571', '2007-02-17T09:17:10.996577', '1990', '2'), + ('10.99', '571', '2007-02-20T06:43:53.996577', '2977', '1'), + ('2.99', '571', '2007-03-19T15:59:46.996577', '13266', '2'), + ('4.99', '571', '2007-04-29T12:58:49.996577', '8638', '1'), + ('2.99', '571', '2007-03-01T00:10:48.996577', '10227', '1'), + ('2.99', '571', '2007-02-18T08:45:06.996577', '2327', '1'), + ('0.99', '571', '2007-03-22T04:54:42.996577', '14956', '1'), + ('7.99', '571', '2007-03-02T09:52:33.996577', '11191', '2'), + ('2.99', '571', '2007-03-19T14:36:42.996577', '13228', '1'), + ('4.99', '571', '2007-04-07T07:45:52.996577', '4162', '1'), + ('4.99', '571', '2007-04-10T12:39:52.996577', '5789', '2'), + ('5.99', '571', '2007-04-28T16:40:24.996577', '8084', '1'), + ('4.99', '571', '2007-02-16T15:50:59.996577', '1756', '1'), + ('1.99', '571', '2007-04-30T15:01:38.996577', '9300', '2'), + ('4.99', '571', '2007-02-15T04:39:42.996577', '1254', '1'), + ('5.99', '572', '2007-03-20T07:28:04.996577', '13688', '1'), + ('4.99', '572', '2007-03-02T18:28:35.996577', '11426', '1'), + ('4.99', '572', '2007-04-27T05:54:58.996577', '7161', '1'), + ('2.99', '572', '2007-04-08T05:17:36.996577', '4601', '1'), + ('4.99', '572', '2007-03-16T22:46:04.996577', '11526', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['28573', '22388', '28567', '22387', '22392', '22389', '28565', '22393', '18368', '18369', '28571', '28575', '18367', '28566', '28570', '28574', '28569', '22394', '28572', '22255', '28408', '28417', '22259', '18313', '28407', '28406', '18315', '28415', '28409', '18312', '28403', '22256', '22254', '28416', '22260', '22258', '28411', '28414', '18314', '18311', '22257', '28412', '28405', '28413', '28410', '28404', '22261', '25749', '25748', '25745', '20001', '25744', '25746', '25747', '30433', '30439', '23875', '30444', '30435', '23874', '23880', '23882', '30443', '30432', '30446', '18996', '23872', '30442', '30440', '23873', '30436', '30438', '30447', '30441', '30437', '23876', '30445', '23879', '23878', '30434', '18995', '23871', '23881', '23877', '25187', '19560', '25186', '19550', '25191', '19549', '25188', '25192', '19559', '19558', '19555', '19552', '25189', '19551', '19557', '19556']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('3.99', '572', '2007-04-30T06:38:24.996577', '9081', '1'), + ('4.99', '572', '2007-03-02T07:16:57.996577', '11121', '1'), + ('2.99', '572', '2007-04-11T05:47:50.996577', '6108', '2'), + ('0.99', '572', '2007-03-02T06:55:11.996577', '11114', '1'), + ('1.99', '572', '2007-03-18T02:38:05.996577', '12256', '1'), + ('2.99', '572', '2007-03-02T18:12:04.996577', '11415', '2'), + ('4.99', '572', '2007-04-10T03:02:11.996577', '5595', '1'), + ('1.99', '572', '2007-03-19T20:00:49.996577', '13377', '2'), + ('0.99', '572', '2007-02-17T10:15:43.996577', '2007', '1'), + ('0.99', '572', '2007-02-18T18:07:31.996577', '2458', '1'), + ('0.99', '572', '2007-04-29T03:13:31.996577', '8342', '2'), + ('4.99', '572', '2007-04-30T23:16:05.996577', '10204', '2'), + ('10.99', '572', '2007-02-17T02:33:38.996577', '1889', '2'), + ('6.99', '572', '2007-04-10T09:14:41.996577', '5713', '1'), + ('6.99', '572', '2007-04-28T03:00:40.996577', '7713', '2'), + ('5.99', '572', '2007-04-30T14:18:48.996577', '9950', '2'), + ('4.99', '572', '2007-04-27T12:58:19.996577', '7345', '1'), + ('6.99', '572', '2007-03-20T01:15:29.996577', '13523', '2'), + ('0.99', '572', '2007-04-29T05:41:59.996577', '8432', '1'), + ('0.99', '558', '2007-03-02T12:39:05.996577', '11268', '1'), + ('6.99', '558', '2007-04-09T17:21:21.996577', '5375', '2'), + ('2.99', '558', '2007-04-29T23:08:09.996577', '8889', '1'), + ('5.99', '558', '2007-03-20T03:13:58.996577', '13566', '2'), + ('4.99', '558', '2007-02-19T00:44:43.996577', '2544', '2'), + ('2.99', '558', '2007-04-08T20:46:06.996577', '4932', '1'), + ('5.99', '558', '2007-04-07T09:25:32.996577', '4192', '1'), + ('10.99', '558', '2007-02-21T19:39:05.996577', '3451', '2'), + ('2.99', '558', '2007-04-29T08:46:53.996577', '8523', '1'), + ('3.99', '558', '2007-04-09T22:39:35.996577', '5492', '1'), + ('1.99', '558', '2007-02-18T15:24:20.996577', '2411', '1'), + ('9.99', '558', '2007-04-06T10:02:02.996577', '3731', '1'), + ('5.99', '558', '2007-03-16T23:57:09.996577', '11567', '2'), + ('0.99', '558', '2007-03-01T17:10:00.996577', '10707', '2'), + ('4.99', '558', '2007-04-29T22:13:01.996577', '8858', '1'), + ('7.99', '558', '2007-03-21T03:37:08.996577', '14235', '2'), + ('1.99', '558', '2007-03-18T00:33:13.996577', '12194', '1'), + ('9.99', '558', '2007-04-12T00:17:26.996577', '6479', '2'), + ('0.99', '558', '2007-04-27T15:42:45.996577', '7424', '1'), + ('4.99', '558', '2007-02-20T09:23:34.996577', '3016', '2'), + ('4.99', '558', '2007-02-17T07:48:18.996577', '1967', '2'), + ('6.99', '558', '2007-03-17T18:58:22.996577', '12040', '2'), + ('4.99', '558', '2007-04-12T12:53:57.996577', '6742', '2'), + ('3.99', '558', '2007-04-06T22:01:10.996577', '3990', '1'), + ('0.99', '558', '2007-04-12T13:38:14.996577', '6757', '1'), + ('7.99', '558', '2007-04-11T14:48:28.996577', '6278', '2'), + ('0.99', '558', '2007-04-06T20:26:10.996577', '3954', '1'), + ('5.99', '558', '2007-03-21T05:22:19.996577', '14286', '1'), + ('5.99', '318', '2007-04-30T16:54:17.996577', '10023', '2'), + ('0.99', '318', '2007-04-28T08:05:04.996577', '7853', '2'), + ('2.99', '318', '2007-04-06T21:27:42.996577', '3974', '2'), + ('2.99', '318', '2007-03-21T05:02:31.996577', '14276', '1'), + ('4.99', '318', '2007-04-06T10:02:03.996577', '3732', '1'), + ('8.99', '318', '2007-04-07T17:49:48.996577', '4356', '1'), + ('0.99', '318', '2007-04-28T00:05:52.996577', '7649', '1'), + ('5.99', '128', '2007-04-06T22:11:29.996577', '3995', '2'), + ('2.99', '128', '2007-04-12T10:47:49.996577', '6687', '2'), + ('0.99', '128', '2007-03-19T06:53:42.996577', '13027', '2'), + ('5.99', '128', '2007-04-30T19:56:43.996577', '9433', '1'), + ('4.99', '128', '2007-04-10T05:37:06.996577', '5647', '1'), + ('0.99', '128', '2007-03-19T02:51:39.996577', '12910', '2'), + ('8.99', '128', '2007-03-22T03:44:42.996577', '14925', '1'), + ('8.99', '128', '2007-03-23T13:53:53.996577', '15835', '1'), + ('2.99', '128', '2007-04-30T12:14:20.996577', '9234', '2'), + ('0.99', '128', '2007-04-06T10:52:07.996577', '3751', '1'), + ('3.99', '128', '2007-04-30T14:21:03.996577', '9952', '1'), + ('0.99', '128', '2007-02-19T02:12:29.996577', '2565', '1'), + ('2.99', '128', '2007-03-18T20:24:04.996577', '12731', '2'), + ('5.99', '128', '2007-04-30T11:39:37.996577', '9215', '2'), + ('4.99', '128', '2007-04-27T21:43:40.996577', '7582', '2'), + ('2.99', '128', '2007-03-19T00:27:20.996577', '12843', '2'), + ('4.99', '128', '2007-04-10T23:48:16.996577', '5997', '2'), + ('6.99', '128', '2007-04-12T00:18:41.996577', '6481', '2'), + ('2.99', '128', '2007-04-30T16:31:07.996577', '10011', '1'), + ('2.99', '128', '2007-04-29T05:20:53.996577', '8415', '2'), + ('2.99', '128', '2007-04-11T09:55:07.996577', '6186', '2'), + ('5.99', '128', '2007-03-19T12:29:22.996577', '13181', '2'), + ('2.99', '128', '2007-04-30T11:30:33.996577', '9858', '2'), + ('0.99', '128', '2007-03-21T01:11:41.996577', '14157', '2'), + ('2.99', '128', '2007-03-20T16:52:52.996577', '13964', '2'), + ('2.99', '128', '2007-04-09T12:52:12.996577', '5270', '1'), + ('7.99', '128', '2007-02-18T22:47:47.996577', '2519', '2'), + ('2.99', '128', '2007-03-01T05:26:43.996577', '10394', '1'), + ('3.99', '128', '2007-03-22T15:30:49.996577', '15220', '1'), + ('0.99', '128', '2007-03-20T00:42:42.996577', '13509', '1'), + ('9.99', '270', '2007-04-06T21:56:50.996577', '3987', '1'), + ('6.99', '270', '2007-03-23T05:38:48.996577', '15620', '2'), + ('3.99', '270', '2007-04-05T22:39:54.996577', '3501', '1'), + ('5.99', '270', '2007-03-01T12:16:48.996577', '10579', '2'), + ('3.99', '270', '2007-04-29T12:16:46.996577', '8618', '2'), + ('7.99', '270', '2007-03-01T08:01:19.996577', '10461', '1'), + ('0.99', '270', '2007-04-10T00:47:54.996577', '5533', '2'), + ('3.99', '270', '2007-04-30T18:11:44.996577', '10069', '1'), + ('0.99', '270', '2007-03-21T16:38:17.996577', '14618', '1'), + ('1.99', '270', '2007-03-20T16:12:22.996577', '13945', '2'), + ('2.99', '270', '2007-03-17T14:36:43.996577', '11917', '1'), + ('2.99', '270', '2007-03-02T17:07:38.996577', '11389', '1'), + ('4.99', '270', '2007-04-12T02:33:42.996577', '6520', '2'), + ('4.99', '270', '2007-03-01T14:37:18.996577', '10648', '2'), + ('2.99', '270', '2007-03-18T09:18:33.996577', '12442', '1'), + ('2.99', '270', '2007-03-18T00:30:06.996577', '12192', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['19554', '25190', '19553', '17654', '26463', '20577', '20587', '20586', '17653', '20576', '20584', '26460', '20579', '26462', '26471', '26469', '26464', '17656', '20585', '17651', '26458', '26466', '20582', '26468', '20583', '20581', '20578', '20580', '20588', '26459', '26467', '17657', '17658', '26465', '26470', '17655', '17652', '26461', '27805', '27808', '21740', '27810', '27809', '18118', '21739', '27811', '27804', '27803', '21737', '27807', '21736', '27806', '21734', '21733', '18119', '21735', '21738', '26017', '20210', '26020', '20215', '26016', '26024', '20211', '20217', '20225', '26015', '17509', '20216', '17510', '20209', '20218', '26023', '20221', '20224', '26025', '20223', '26018', '26022', '20220', '26021', '20219', '17511', '20213', '20222', '26014', '20212', '20214', '26019', '27174', '27166', '21185', '27172', '21177', '21182', '21183', '21176', '21184', '21179', '27168']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('2.99', '270', '2007-03-17T11:40:46.996577', '11841', '2'), + ('2.99', '270', '2007-04-29T03:26:09.996577', '8355', '1'), + ('0.99', '270', '2007-03-17T10:25:14.996577', '11810', '1'), + ('2.99', '380', '2007-02-18T17:09:35.996577', '2440', '1'), + ('8.99', '380', '2007-04-27T00:55:04.996577', '7021', '2'), + ('3.99', '380', '2007-03-02T02:52:49.996577', '10983', '1'), + ('2.99', '380', '2007-03-23T08:33:02.996577', '15697', '1'), + ('2.99', '380', '2007-03-23T06:19:12.996577', '15636', '2'), + ('3.99', '380', '2007-02-17T11:04:24.996577', '2018', '1'), + ('1.99', '380', '2007-03-01T07:38:29.996577', '10450', '2'), + ('5.99', '380', '2007-03-22T13:57:41.996577', '15175', '2'), + ('2.99', '380', '2007-04-08T08:52:48.996577', '4675', '1'), + ('0.99', '380', '2007-03-17T15:33:59.996577', '11945', '2'), + ('0.99', '380', '2007-04-09T15:37:43.996577', '5339', '2'), + ('10.99', '380', '2007-04-30T06:33:57.996577', '9710', '1'), + ('0.99', '380', '2007-04-30T05:41:46.996577', '9056', '1'), + ('2.99', '380', '2007-04-27T06:05:52.996577', '7167', '2'), + ('1.99', '380', '2007-02-20T07:58:48.996577', '2998', '2'), + ('2.99', '380', '2007-03-22T20:08:11.996577', '15361', '1'), + ('3.99', '380', '2007-02-17T00:31:48.996577', '1868', '1'), + ('2.99', '380', '2007-04-06T05:34:57.996577', '3637', '1'), + ('2.99', '380', '2007-04-27T16:16:09.996577', '7443', '2'), + ('6.99', '380', '2007-03-21T13:36:57.996577', '14529', '1'), + ('3.99', '380', '2007-04-28T12:40:23.996577', '7974', '1'), + ('1.99', '380', '2007-03-22T04:15:57.996577', '14935', '1'), + ('6.99', '380', '2007-03-19T05:59:58.996577', '12996', '1'), + ('0.99', '380', '2007-03-17T15:14:00.996577', '11936', '1'), + ('3.99', '380', '2007-03-18T16:28:55.996577', '12636', '1'), + ('2.99', '380', '2007-03-23T11:01:26.996577', '15748', '2'), + ('4.99', '380', '2007-04-06T08:10:19.996577', '3688', '1'), + ('2.99', '380', '2007-04-28T05:30:43.996577', '7773', '1'), + ('1.99', '380', '2007-02-20T15:12:59.996577', '3099', '2'), + ('4.99', '380', '2007-02-21T02:27:39.996577', '3260', '1'), + ('0.99', '380', '2007-04-27T16:07:10.996577', '7435', '2'), + ('6.99', '380', '2007-04-30T13:08:01.996577', '9261', '1'), + ('4.99', '380', '2007-02-18T18:34:31.996577', '2464', '1'), + ('2.99', '380', '2007-02-17T08:53:54.996577', '1984', '1'), + ('4.99', '380', '2007-04-08T10:20:07.996577', '4706', '2'), + ('2.99', '501', '2007-04-08T13:57:42.996577', '4769', '2'), + ('0.99', '501', '2007-04-27T17:03:19.996577', '7456', '1'), + ('5.99', '501', '2007-03-23T08:49:01.996577', '15699', '1'), + ('2.99', '501', '2007-04-29T08:52:57.996577', '8529', '2'), + ('2.99', '501', '2007-04-28T14:13:50.996577', '8021', '1'), + ('5.99', '501', '2007-02-21T00:18:55.996577', '3222', '2'), + ('4.99', '501', '2007-03-22T16:14:43.996577', '15239', '1'), + ('2.99', '501', '2007-04-30T17:07:54.996577', '9359', '1'), + ('6.99', '501', '2007-04-06T09:40:28.996577', '3723', '2'), + ('6.99', '501', '2007-04-06T00:18:37.996577', '3541', '2'), + ('4.99', '501', '2007-03-19T02:54:25.996577', '12914', '1'), + ('7.99', '501', '2007-04-11T04:35:07.996577', '6095', '2'), + ('6.99', '501', '2007-03-17T09:53:51.996577', '11799', '2'), + ('1.99', '501', '2007-04-09T23:59:07.996577', '5520', '2'), + ('4.99', '501', '2007-03-02T17:12:55.996577', '11393', '2'), + ('4.99', '501', '2007-03-01T21:19:34.996577', '10817', '1'), + ('7.99', '501', '2007-02-21T15:12:57.996577', '3412', '1'), + ('1.99', '501', '2007-03-17T03:12:59.996577', '11640', '1'), + ('0.99', '501', '2007-03-20T14:08:32.996577', '13889', '2'), + ('2.99', '342', '2007-04-12T12:45:16.996577', '6736', '1'), + ('2.99', '342', '2007-03-02T09:16:36.996577', '11178', '2'), + ('2.99', '342', '2007-04-27T10:19:18.996577', '7280', '2'), + ('2.99', '342', '2007-03-18T12:14:06.996577', '12522', '1'), + ('8.99', '342', '2007-04-11T22:31:16.996577', '6429', '2'), + ('0.99', '342', '2007-04-30T14:29:52.996577', '9955', '1'), + ('0.99', '342', '2007-03-02T19:02:03.996577', '11446', '2'), + ('4.99', '342', '2007-03-19T19:48:01.996577', '13368', '2'), + ('3.99', '342', '2007-03-23T15:37:57.996577', '15895', '1'), + ('4.99', '342', '2007-04-11T02:34:43.996577', '6060', '2'), + ('5.99', '342', '2007-02-17T23:58:17.996577', '2190', '2'), + ('4.99', '342', '2007-03-18T23:32:31.996577', '12816', '2'), + ('5.99', '342', '2007-02-20T02:11:44.996577', '2914', '1'), + ('4.99', '342', '2007-03-01T00:46:38.996577', '10242', '1'), + ('4.99', '342', '2007-03-20T05:49:41.996577', '13637', '2'), + ('5.99', '342', '2007-04-30T14:18:07.996577', '9948', '2'), + ('2.99', '342', '2007-03-20T22:56:12.996577', '14096', '2'), + ('4.99', '342', '2007-03-23T00:33:15.996577', '15484', '1'), + ('4.99', '342', '2007-04-30T14:32:13.996577', '9956', '2'), + ('8.99', '342', '2007-03-21T18:56:10.996577', '14683', '2'), + ('7.99', '342', '2007-04-12T15:01:54.996577', '6787', '2'), + ('0.99', '342', '2007-04-30T23:30:48.996577', '9526', '1'), + ('4.99', '342', '2007-03-20T12:15:45.996577', '13827', '2'), + ('2.99', '342', '2007-04-30T09:52:40.996577', '9164', '1'), + ('2.99', '342', '2007-03-20T09:47:19.996577', '13755', '1'), + ('2.99', '342', '2007-02-20T13:57:39.996577', '3081', '1'), + ('6.99', '342', '2007-03-17T22:25:39.996577', '12139', '1'), + ('0.99', '342', '2007-03-21T05:47:23.996577', '14299', '2'), + ('0.99', '342', '2007-04-10T03:57:16.996577', '5617', '1'), + ('0.99', '342', '2007-03-16T23:58:27.996577', '11568', '1'), + ('4.99', '342', '2007-03-18T08:05:00.996577', '12404', '1'), + ('0.99', '342', '2007-04-26T23:42:28.996577', '6997', '2'), + ('5.99', '443', '2007-04-30T18:36:10.996577', '10081', '2'), + ('5.99', '443', '2007-04-12T07:35:06.996577', '6625', '2'), + ('0.99', '443', '2007-03-23T01:51:58.996577', '15519', '1'), + ('1.99', '443', '2007-04-30T07:36:29.996577', '9740', '2'), + ('4.99', '443', '2007-03-02T19:13:09.996577', '11449', '1'), + ('6.99', '443', '2007-03-21T16:30:07.996577', '14611', '2'), + ('0.99', '443', '2007-03-22T14:15:31.996577', '15182', '1'), + ('0.99', '443', '2007-03-01T04:21:19.996577', '10360', '2'), + ('4.99', '443', '2007-03-22T21:32:35.996577', '15393', '2'), + ('4.99', '443', '2007-03-19T00:48:39.996577', '12857', '2'), + ('2.99', '443', '2007-04-26T23:23:29.996577', '6983', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['27165', '17888', '27171', '21178', '27167', '27169', '27170', '21180', '27173', '21181', '24697', '31347', '19323', '24703', '31345', '24699', '31349', '24702', '32085', '24698', '19321', '31346', '24700', '31344', '32084', '24704', '19322', '24696', '19319', '19320', '31348', '24701', '19203', '31081', '31077', '24449', '24444', '19205', '24450', '19204', '24448', '31076', '31082', '24445', '24446', '24447', '31086', '31083', '31078', '19206', '31080', '31084', '31085', '31079', '31496', '31498', '19358', '31493', '32090', '31495', '24795', '24798', '24801', '31489', '19356', '31492', '31486', '31487', '19359', '31497', '24799', '31494', '31491', '31490', '24796', '31488', '19357', '24797', '24800', '28348', '28345', '18292', '28344', '28343', '22198', '22201', '28346', '22203', '22195', '22200', '22194', '22199', '28350', '22202', '28347', '28349', '22196', '22204', '18291', '22197']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('5.99', '443', '2007-04-05T22:56:07.996577', '3510', '2'), + ('2.99', '443', '2007-02-19T22:56:15.996577', '2871', '1'), + ('9.99', '443', '2007-04-28T13:05:18.996577', '7987', '1'), + ('4.99', '443', '2007-03-18T08:22:27.996577', '12415', '1'), + ('4.99', '443', '2007-04-12T20:46:38.996577', '6913', '1'), + ('2.99', '443', '2007-04-27T11:48:07.996577', '7317', '1'), + ('8.99', '443', '2007-04-28T01:05:48.996577', '7667', '1'), + ('2.99', '443', '2007-03-19T23:57:32.996577', '13489', '1'), + ('4.99', '443', '2007-04-30T16:39:22.996577', '10014', '1'), + ('2.99', '443', '2007-03-21T14:49:09.996577', '14561', '1'), + ('0.99', '216', '2007-03-02T03:33:49.996577', '11005', '1'), + ('4.99', '216', '2007-04-28T15:50:54.996577', '8068', '1'), + ('2.99', '216', '2007-02-21T17:30:29.996577', '3432', '1'), + ('2.99', '216', '2007-03-22T14:46:15.996577', '15199', '2'), + ('6.99', '216', '2007-04-11T00:19:55.996577', '6008', '1'), + ('0.99', '216', '2007-03-19T21:38:35.996577', '13424', '2'), + ('0.99', '216', '2007-04-30T07:07:49.996577', '9096', '1'), + ('4.99', '216', '2007-03-22T14:34:49.996577', '15192', '1'), + ('0.00', '216', '2007-05-14T13:44:29.996577', '11676', '1'), + ('7.99', '216', '2007-03-17T02:42:11.996577', '11621', '2'), + ('3.99', '216', '2007-02-16T09:06:00.996577', '1672', '1'), + ('7.99', '216', '2007-04-11T18:53:31.996577', '6349', '2'), + ('2.99', '216', '2007-03-21T17:30:02.996577', '14638', '2'), + ('2.99', '216', '2007-04-07T07:43:37.996577', '4161', '2'), + ('5.98', '216', '2007-05-14T13:44:29.996577', '12970', '1'), + ('4.99', '216', '2007-03-23T17:09:07.996577', '15934', '2'), + ('0.99', '216', '2007-02-18T10:56:23.996577', '2351', '2'), + ('4.99', '216', '2007-03-01T09:44:31.996577', '10506', '1'), + ('6.99', '216', '2007-02-15T19:00:34.996577', '1461', '2'), + ('0.99', '216', '2007-02-16T08:43:46.996577', '1664', '1'), + ('8.99', '216', '2007-04-29T22:13:09.996577', '8859', '2'), + ('4.99', '216', '2007-03-21T20:37:18.996577', '14726', '2'), + ('0.99', '183', '2007-02-15T06:42:23.996577', '1279', '1'), + ('4.99', '183', '2007-04-12T00:01:51.996577', '6472', '1'), + ('0.99', '183', '2007-04-07T06:42:50.996577', '4134', '2'), + ('2.99', '183', '2007-03-19T23:42:56.996577', '13482', '1'), + ('5.99', '183', '2007-03-01T13:37:43.996577', '10620', '2'), + ('5.99', '183', '2007-02-18T18:59:26.996577', '2471', '2'), + ('4.99', '183', '2007-03-20T02:03:42.996577', '13536', '1'), + ('1.99', '183', '2007-02-17T23:47:30.996577', '2188', '2'), + ('3.99', '183', '2007-03-19T00:09:09.996577', '12831', '2'), + ('2.99', '183', '2007-04-06T16:25:12.996577', '3869', '1'), + ('4.99', '183', '2007-04-12T04:16:06.996577', '6569', '1'), + ('2.99', '183', '2007-03-02T16:52:29.996577', '11386', '2'), + ('0.99', '183', '2007-03-18T09:33:08.996577', '12451', '2'), + ('3.99', '183', '2007-03-18T21:42:41.996577', '12764', '2'), + ('2.99', '183', '2007-04-30T13:46:45.996577', '9931', '2'), + ('0.99', '183', '2007-04-27T13:19:30.996577', '7359', '2'), + ('2.99', '183', '2007-04-07T07:32:52.996577', '4157', '2'), + ('5.99', '183', '2007-02-21T12:31:25.996577', '3381', '1'), + ('0.99', '183', '2007-04-10T11:07:54.996577', '5756', '2'), + ('5.99', '183', '2007-04-30T05:02:32.996577', '9672', '2'), + ('4.99', '183', '2007-04-30T10:02:58.996577', '9818', '1'), + ('1.99', '183', '2007-04-09T03:24:56.996577', '5069', '1'), + ('0.99', '229', '2007-04-27T23:28:35.996577', '7629', '2'), + ('3.99', '229', '2007-04-30T13:19:30.996577', '9913', '2'), + ('7.99', '229', '2007-02-21T04:05:03.996577', '3277', '1'), + ('2.99', '229', '2007-04-12T19:10:01.996577', '6880', '1'), + ('0.99', '229', '2007-05-14T13:44:29.996577', '13295', '2'), + ('5.99', '229', '2007-04-27T11:28:51.996577', '7308', '2'), + ('4.99', '229', '2007-03-16T22:33:20.996577', '11521', '1'), + ('4.99', '229', '2007-03-19T21:56:41.996577', '13431', '2'), + ('2.99', '229', '2007-03-23T16:16:06.996577', '15912', '2'), + ('0.99', '229', '2007-04-08T09:36:03.996577', '4694', '2'), + ('4.99', '229', '2007-02-18T00:27:42.996577', '2200', '1'), + ('4.99', '229', '2007-04-12T04:44:07.996577', '6578', '2'), + ('4.99', '229', '2007-04-06T19:35:03.996577', '3933', '2'), + ('2.99', '229', '2007-04-07T22:16:13.996577', '4458', '2'), + ('0.99', '229', '2007-02-21T04:36:38.996577', '3280', '2'), + ('7.99', '229', '2007-04-27T23:43:15.996577', '7640', '2'), + ('5.99', '229', '2007-03-20T07:08:00.996577', '13679', '1'), + ('0.99', '229', '2007-04-27T11:25:32.996577', '7305', '2'), + ('4.99', '229', '2007-04-11T08:13:57.996577', '6155', '2'), + ('2.99', '229', '2007-04-10T04:10:04.996577', '5623', '1'), + ('2.99', '229', '2007-03-19T01:08:13.996577', '12866', '1'), + ('4.99', '229', '2007-04-08T01:10:29.996577', '4515', '1'), + ('0.99', '229', '2007-02-20T23:18:29.996577', '3208', '1'), + ('0.99', '229', '2007-03-19T17:25:55.996577', '13306', '2'), + ('4.99', '229', '2007-03-23T10:36:17.996577', '15740', '1'), + ('0.99', '551', '2007-04-30T03:05:46.996577', '8986', '1'), + ('0.99', '551', '2007-04-10T00:37:47.996577', '5528', '2'), + ('3.99', '551', '2007-02-19T16:44:50.996577', '2776', '1'), + ('1.99', '551', '2007-04-09T09:21:19.996577', '5201', '1'), + ('5.99', '551', '2007-04-06T22:15:09.996577', '3996', '2'), + ('3.99', '551', '2007-03-19T22:10:42.996577', '13439', '1'), + ('2.99', '551', '2007-03-21T17:19:36.996577', '14633', '2'), + ('0.99', '551', '2007-04-11T01:43:24.996577', '6041', '1'), + ('4.99', '551', '2007-03-22T20:50:59.996577', '15377', '1'), + ('2.99', '551', '2007-03-17T13:09:54.996577', '11883', '2'), + ('4.99', '551', '2007-03-21T16:25:52.996577', '14609', '2'), + ('0.99', '551', '2007-03-02T16:45:58.996577', '11380', '2'), + ('0.99', '551', '2007-03-21T09:44:41.996577', '14420', '1'), + ('4.99', '551', '2007-04-30T08:13:06.996577', '9765', '2'), + ('2.99', '551', '2007-03-22T00:13:44.996577', '14833', '1'), + ('9.99', '551', '2007-04-27T03:19:41.996577', '7095', '2'), + ('2.99', '551', '2007-04-30T14:04:05.996577', '9287', '1'), + ('4.99', '551', '2007-03-18T00:53:51.996577', '12208', '2'), + ('6.99', '551', '2007-03-22T21:25:51.996577', '15390', '2'), + ('4.99', '551', '2007-02-17T14:48:05.996577', '2069', '2'), + ('0.99', '551', '2007-03-19T01:15:45.996577', '12868', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['18799', '18797', '18796', '23420', '23422', '29846', '29850', '23424', '29852', '23418', '29848', '29849', '29847', '23427', '23421', '29845', '23419', '18800', '29851', '18798', '23423', '23425', '23426', '25825', '25832', '25830', '20054', '20047', '25824', '25829', '20051', '25823', '25831', '20053', '25826', '25827', '20052', '20050', '20048', '20049', '25828', '25694', '19975', '25701', '19970', '19969', '19971', '25696', '19977', '25700', '25709', '25710', '25703', '19967', '19968', '19976', '25702', '19974', '25711', '25706', '19973', '25697', '19972', '25705', '25708', '25704', '25699', '25698', '25695', '25707', '26658', '20760', '20758', '17736', '26657', '26661', '20757', '17737', '26655', '17735', '26660', '26656', '26659', '20756', '20759', '25660', '25663', '19939', '25667', '19938', '19941', '25666', '25661', '25664', '19937', '25665', '19940', '25662', '22137', '22132']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('2.99', '77', '2007-02-20T19:05:19.996577', '3151', '1'), + ('3.99', '77', '2007-02-18T11:22:44.996577', '2354', '1'), + ('4.99', '77', '2007-02-16T12:39:50.996577', '1710', '1'), + ('0.99', '77', '2007-03-02T03:09:38.996577', '10991', '2'), + ('7.99', '77', '2007-03-17T08:29:06.996577', '11767', '2'), + ('0.99', '77', '2007-04-11T08:50:04.996577', '6168', '2'), + ('4.99', '77', '2007-04-30T01:29:33.996577', '8942', '2'), + ('1.99', '77', '2007-03-18T05:12:22.996577', '12328', '2'), + ('4.99', '77', '2007-04-30T22:37:59.996577', '10184', '2'), + ('2.99', '77', '2007-03-01T23:21:00.996577', '10886', '1'), + ('3.99', '77', '2007-04-27T14:54:11.996577', '7406', '1'), + ('0.99', '77', '2007-04-28T02:52:33.996577', '7710', '1'), + ('2.99', '77', '2007-04-11T20:47:49.996577', '6390', '2'), + ('2.99', '77', '2007-03-22T20:02:26.996577', '15359', '2'), + ('2.99', '77', '2007-03-02T20:16:35.996577', '11469', '1'), + ('0.99', '77', '2007-04-08T20:34:07.996577', '4928', '2'), + ('0.99', '77', '2007-03-01T23:45:25.996577', '10895', '1'), + ('0.99', '77', '2007-02-21T01:16:47.996577', '3238', '2'), + ('0.99', '77', '2007-04-30T09:52:11.996577', '9811', '1'), + ('8.99', '77', '2007-02-18T17:57:47.996577', '2452', '2'), + ('6.99', '77', '2007-03-17T20:00:12.996577', '12065', '1'), + ('9.99', '77', '2007-03-20T09:46:11.996577', '13752', '2'), + ('4.99', '77', '2007-03-21T13:39:16.996577', '14530', '2'), + ('4.99', '325', '2007-04-10T12:02:52.996577', '5775', '1'), + ('4.99', '325', '2007-04-30T18:14:55.996577', '10070', '1'), + ('0.99', '325', '2007-04-29T09:16:50.996577', '8539', '2'), + ('0.99', '325', '2007-03-22T06:55:53.996577', '15009', '2'), + ('4.99', '325', '2007-03-01T03:24:00.996577', '10326', '2'), + ('2.99', '325', '2007-04-10T10:20:24.996577', '5740', '2'), + ('2.99', '325', '2007-04-28T01:48:52.996577', '7687', '2'), + ('4.99', '325', '2007-03-19T08:02:28.996577', '13054', '2'), + ('5.99', '325', '2007-04-09T21:39:15.996577', '5470', '1'), + ('2.99', '325', '2007-04-30T17:08:02.996577', '10030', '2'), + ('5.99', '325', '2007-03-21T18:27:59.996577', '14672', '1'), + ('4.99', '325', '2007-04-11T07:00:49.996577', '6135', '2'), + ('0.99', '325', '2007-04-12T07:32:37.996577', '6622', '2'), + ('3.99', '325', '2007-03-21T10:51:46.996577', '14452', '2'), + ('3.99', '325', '2007-03-18T22:12:26.996577', '12779', '1'), + ('0.99', '325', '2007-03-01T06:25:42.996577', '10412', '1'), + ('4.99', '325', '2007-03-17T21:03:50.996577', '12097', '2'), + ('9.99', '325', '2007-04-27T08:10:53.996577', '7223', '2'), + ('0.99', '314', '2007-04-05T23:21:01.996577', '3517', '1'), + ('4.99', '314', '2007-03-21T23:41:10.996577', '14815', '2'), + ('2.99', '314', '2007-04-12T10:00:41.996577', '6666', '1'), + ('2.99', '314', '2007-03-19T15:57:26.996577', '13265', '1'), + ('3.99', '314', '2007-03-19T10:16:04.996577', '13120', '2'), + ('3.99', '314', '2007-03-20T02:35:47.996577', '13553', '2'), + ('0.99', '314', '2007-04-06T13:44:01.996577', '3808', '1'), + ('3.99', '314', '2007-03-23T20:06:25.996577', '16021', '2'), + ('5.99', '314', '2007-04-11T10:13:07.996577', '6192', '1'), + ('4.99', '314', '2007-04-29T13:14:11.996577', '8644', '2'), + ('3.99', '314', '2007-04-30T10:54:17.996577', '9191', '2'), + ('4.99', '314', '2007-04-27T00:04:31.996577', '7004', '2'), + ('3.99', '314', '2007-03-17T14:11:35.996577', '11908', '2'), + ('0.99', '314', '2007-03-18T09:06:34.996577', '12434', '1'), + ('5.99', '314', '2007-03-22T01:59:32.996577', '14873', '2'), + ('3.99', '314', '2007-04-12T13:55:00.996577', '6763', '1'), + ('4.99', '314', '2007-03-21T18:54:23.996577', '14682', '2'), + ('6.99', '314', '2007-04-30T15:42:56.996577', '9318', '2'), + ('3.99', '314', '2007-04-28T15:57:28.996577', '8073', '1'), + ('4.99', '314', '2007-03-21T09:22:01.996577', '14409', '1'), + ('0.99', '314', '2007-04-07T19:23:45.996577', '4386', '2'), + ('4.99', '314', '2007-03-21T00:40:04.996577', '14145', '2'), + ('6.99', '314', '2007-04-28T14:17:22.996577', '8022', '2'), + ('6.99', '314', '2007-04-29T02:34:50.996577', '8328', '2'), + ('2.99', '314', '2007-04-27T10:10:23.996577', '7276', '1'), + ('0.99', '314', '2007-04-10T16:25:58.996577', '5856', '2'), + ('4.99', '314', '2007-04-09T11:47:40.996577', '5241', '2'), + ('2.99', '314', '2007-04-06T06:23:48.996577', '3656', '1'), + ('0.99', '314', '2007-04-28T17:28:12.996577', '8105', '2'), + ('7.99', '398', '2007-04-29T05:38:40.996577', '8428', '1'), + ('3.99', '398', '2007-03-22T14:25:08.996577', '15189', '1'), + ('2.99', '398', '2007-03-18T12:21:07.996577', '12528', '2'), + ('6.99', '398', '2007-02-17T16:03:36.996577', '2087', '1'), + ('4.99', '398', '2007-04-28T21:46:55.996577', '8204', '2'), + ('1.99', '398', '2007-04-30T08:24:02.996577', '9771', '1'), + ('4.99', '398', '2007-03-02T07:42:35.996577', '11132', '2'), + ('9.99', '398', '2007-02-20T18:24:13.996577', '3141', '2'), + ('5.99', '398', '2007-04-09T11:13:13.996577', '5234', '2'), + ('2.99', '398', '2007-02-15T02:19:02.996577', '1228', '2'), + ('5.99', '398', '2007-04-30T13:44:17.996577', '9281', '2'), + ('3.99', '398', '2007-04-28T17:51:41.996577', '8119', '2'), + ('2.99', '398', '2007-04-30T05:02:21.996577', '9042', '1'), + ('2.99', '398', '2007-03-01T00:18:02.996577', '10230', '1'), + ('4.99', '398', '2007-03-20T06:10:50.996577', '13643', '2'), + ('10.99', '310', '2007-04-06T14:29:42.996577', '3830', '2'), + ('0.99', '310', '2007-04-10T15:17:28.996577', '5836', '2'), + ('7.99', '310', '2007-03-18T19:31:16.996577', '12710', '2'), + ('2.99', '310', '2007-04-30T23:47:28.996577', '9536', '1'), + ('4.99', '310', '2007-03-18T11:34:17.996577', '12500', '2'), + ('5.99', '310', '2007-03-22T05:21:47.996577', '14972', '1'), + ('7.99', '310', '2007-04-30T02:53:56.996577', '8981', '1'), + ('0.99', '310', '2007-04-07T03:16:28.996577', '4072', '1'), + ('5.99', '310', '2007-04-28T00:03:59.996577', '7648', '1'), + ('2.99', '310', '2007-03-02T07:53:57.996577', '11137', '2'), + ('5.99', '310', '2007-04-29T12:58:37.996577', '8637', '2'), + ('4.99', '310', '2007-03-19T03:33:49.996577', '12929', '1'), + ('5.99', '310', '2007-04-10T04:02:36.996577', '5621', '1'), + ('4.99', '544', '2007-03-21T12:39:10.996577', '14498', '1'), + ('0.99', '544', '2007-03-01T17:58:11.996577', '10735', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['28282', '28283', '28281', '18274', '22133', '22134', '18273', '22141', '28285', '28286', '22138', '18271', '22139', '22136', '22140', '22135', '28284', '18272', '26160', '26158', '20327', '26156', '26152', '20326', '26165', '20325', '31942', '26149', '20329', '20330', '26153', '26154', '26162', '26161', '26148', '20331', '17556', '31941', '26164', '17559', '26151', '26150', '20324', '17557', '26157', '17558', '26159', '26163', '26155', '20328', '26147', '22660', '28953', '28956', '28957', '28958', '28960', '18488', '28962', '28964', '22659', '22667', '22663', '22664', '22658', '22665', '18486', '28954', '22661', '28961', '22662', '28952', '28963', '18487', '22666', '28959', '28955', '22657', '20526', '20519', '20522', '20517', '26402', '17630', '31950', '20520', '26407', '20518', '20523', '17631', '26411', '17633', '17632', '26406', '20521', '26409', '26405', '26410', '26408', '26404']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('2.99', '544', '2007-04-08T10:13:22.996577', '4703', '1'), + ('6.99', '544', '2007-04-08T16:57:39.996577', '4847', '2'), + ('0.99', '544', '2007-04-07T19:41:48.996577', '4395', '1'), + ('2.99', '544', '2007-02-18T14:13:41.996577', '2395', '1'), + ('3.99', '544', '2007-03-02T17:33:32.996577', '11401', '1'), + ('2.99', '544', '2007-03-17T08:27:06.996577', '11766', '2'), + ('0.99', '544', '2007-02-18T13:06:23.996577', '2373', '1'), + ('4.99', '544', '2007-03-23T05:17:13.996577', '15605', '1'), + ('5.99', '544', '2007-04-30T01:21:47.996577', '8937', '1'), + ('9.99', '544', '2007-04-30T02:14:52.996577', '8963', '1'), + ('8.99', '544', '2007-03-21T17:59:35.996577', '14651', '2'), + ('1.99', '544', '2007-02-15T04:02:18.996577', '1248', '1'), + ('2.99', '544', '2007-03-22T05:47:31.996577', '14981', '1'), + ('4.99', '544', '2007-03-21T00:36:09.996577', '14142', '2'), + ('6.99', '544', '2007-03-22T15:28:57.996577', '15219', '1'), + ('3.99', '544', '2007-03-18T16:43:15.996577', '12640', '2'), + ('2.99', '544', '2007-04-29T10:04:12.996577', '8566', '2'), + ('10.99', '544', '2007-02-15T16:59:12.996577', '1434', '2'), + ('0.99', '354', '2007-04-27T08:54:15.996577', '7241', '2'), + ('0.99', '354', '2007-04-27T05:32:35.996577', '7148', '2'), + ('4.99', '354', '2007-03-19T06:00:42.996577', '12998', '1'), + ('0.99', '354', '2007-04-26T21:21:11.996577', '6926', '1'), + ('4.99', '354', '2007-04-10T01:38:43.996577', '5556', '2'), + ('3.99', '354', '2007-03-18T12:54:17.996577', '12544', '1'), + ('2.99', '354', '2007-04-30T08:23:36.996577', '9130', '1'), + ('6.99', '354', '2007-03-18T02:07:20.996577', '12243', '2'), + ('0.00', '354', '2007-05-14T13:44:29.996577', '11782', '1'), + ('5.99', '354', '2007-04-07T21:47:24.996577', '4449', '1'), + ('0.99', '354', '2007-03-21T03:59:20.996577', '14245', '2'), + ('5.99', '354', '2007-03-22T00:27:08.996577', '14840', '1'), + ('3.99', '354', '2007-04-10T17:30:36.996577', '5873', '1'), + ('0.99', '354', '2007-04-11T02:27:05.996577', '6054', '1'), + ('8.99', '354', '2007-04-29T07:09:02.996577', '8477', '2'), + ('4.99', '354', '2007-04-29T02:19:20.996577', '8321', '2'), + ('0.99', '354', '2007-04-07T01:04:59.996577', '4034', '2'), + ('0.99', '354', '2007-03-23T17:47:47.996577', '15956', '2'), + ('0.99', '354', '2007-02-15T20:16:44.996577', '1491', '1'), + ('7.98', '354', '2007-05-14T13:44:29.996577', '12759', '1'), + ('0.99', '354', '2007-04-30T00:32:28.996577', '8921', '2'), + ('2.99', '354', '2007-02-20T18:13:11.996577', '3139', '1'), + ('4.99', '354', '2007-04-09T16:32:59.996577', '5354', '1'), + ('2.99', '354', '2007-04-08T12:13:35.996577', '4745', '2'), + ('6.99', '354', '2007-03-01T06:42:19.996577', '10420', '1'), + ('4.99', '354', '2007-02-18T04:59:55.996577', '2275', '1'), + ('5.99', '354', '2007-04-26T21:46:17.996577', '6939', '1'), + ('6.99', '354', '2007-02-19T16:20:40.996577', '2769', '1'), + ('2.99', '354', '2007-04-27T08:37:56.996577', '7235', '2'), + ('4.99', '354', '2007-04-29T11:47:51.996577', '8609', '1'), + ('4.99', '354', '2007-04-12T17:29:56.996577', '6838', '1'), + ('2.99', '354', '2007-03-21T02:57:52.996577', '14212', '2'), + ('2.99', '354', '2007-04-06T14:04:46.996577', '3821', '2'), + ('4.99', '206', '2007-03-19T10:32:42.996577', '13128', '1'), + ('0.99', '206', '2007-04-06T14:35:01.996577', '3831', '2'), + ('4.99', '206', '2007-04-07T05:04:58.996577', '4107', '2'), + ('4.99', '206', '2007-04-08T15:57:20.996577', '4823', '2'), + ('3.99', '206', '2007-04-11T07:07:59.996577', '6139', '1'), + ('4.99', '206', '2007-04-27T08:07:09.996577', '7222', '1'), + ('4.99', '206', '2007-02-20T09:11:39.996577', '3012', '2'), + ('5.99', '206', '2007-04-28T22:12:39.996577', '8217', '1'), + ('2.99', '206', '2007-04-30T21:34:10.996577', '9474', '2'), + ('2.99', '206', '2007-03-17T03:00:15.996577', '11634', '2'), + ('4.99', '206', '2007-03-23T09:04:26.996577', '15709', '1'), + ('9.99', '206', '2007-03-20T02:27:17.996577', '13550', '2'), + ('0.99', '206', '2007-03-20T07:44:41.996577', '13696', '2'), + ('2.99', '206', '2007-03-02T04:03:29.996577', '11022', '1'), + ('0.99', '206', '2007-03-21T19:15:13.996577', '14695', '2'), + ('0.99', '206', '2007-02-17T00:55:29.996577', '1872', '2'), + ('4.99', '206', '2007-04-06T15:13:07.996577', '3847', '1'), + ('2.99', '206', '2007-03-19T14:41:58.996577', '13232', '2'), + ('4.99', '206', '2007-04-27T20:08:31.996577', '7541', '2'), + ('10.99', '206', '2007-03-19T15:55:21.996577', '13263', '2'), + ('5.99', '206', '2007-04-05T23:55:10.996577', '3533', '1'), + ('3.99', '206', '2007-04-29T09:40:39.996577', '8549', '1'), + ('5.99', '206', '2007-02-18T19:27:12.996577', '2477', '2'), + ('7.99', '206', '2007-03-23T08:10:47.996577', '15686', '2'), + ('6.99', '206', '2007-04-11T22:07:15.996577', '6420', '1'), + ('4.99', '206', '2007-04-07T03:03:04.996577', '4068', '2'), + ('3.99', '206', '2007-03-02T01:06:33.996577', '10930', '2'), + ('6.99', '374', '2007-03-22T20:14:23.996577', '15366', '2'), + ('2.99', '374', '2007-03-18T18:41:34.996577', '12696', '2'), + ('8.99', '374', '2007-03-21T13:33:53.996577', '14524', '2'), + ('2.99', '374', '2007-03-01T16:44:46.996577', '10695', '1'), + ('1.99', '374', '2007-04-06T13:23:18.996577', '3797', '1'), + ('1.99', '374', '2007-02-16T00:11:59.996577', '1548', '1'), + ('2.99', '374', '2007-05-14T13:44:29.996577', '15966', '2'), + ('2.99', '374', '2007-03-19T18:35:23.996577', '13337', '1'), + ('0.99', '374', '2007-04-11T17:11:15.996577', '6315', '2'), + ('0.99', '374', '2007-03-17T02:31:52.996577', '11619', '1'), + ('5.99', '374', '2007-03-22T08:41:35.996577', '15053', '2'), + ('1.99', '374', '2007-02-17T13:08:16.996577', '2046', '2'), + ('6.99', '374', '2007-04-30T11:42:16.996577', '9866', '1'), + ('2.99', '374', '2007-02-19T08:06:59.996577', '2641', '2'), + ('4.99', '374', '2007-02-18T20:01:20.996577', '2487', '2'), + ('2.99', '374', '2007-04-10T21:21:08.996577', '5945', '2'), + ('4.99', '374', '2007-03-20T08:58:23.996577', '13734', '2'), + ('7.99', '374', '2007-04-29T10:45:00.996577', '8586', '2'), + ('3.99', '374', '2007-04-10T02:53:29.996577', '5591', '2'), + ('0.99', '374', '2007-04-30T07:37:29.996577', '9113', '2'), + ('0.99', '374', '2007-04-28T07:26:58.996577', '7837', '2'), + ('6.99', '374', '2007-04-10T02:15:13.996577', '5570', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['26403', '20524', '20525', '24390', '19183', '24396', '31019', '32067', '31018', '31020', '19184', '31015', '24398', '31022', '24389', '19186', '19190', '31023', '31010', '19185', '19187', '24400', '31025', '19189', '31016', '24391', '24392', '31021', '24399', '31026', '31013', '24397', '31017', '24394', '31027', '31024', '24393', '19188', '31012', '24395', '31014', '31011', '30463', '19005', '30468', '19004', '23897', '30466', '30469', '19007', '23901', '19006', '23898', '30465', '23903', '23899', '30467', '19008', '30470', '23896', '23900', '23902', '19003', '30464', '25022', '31772', '25015', '25019', '31782', '31770', '31779', '31771', '25016', '31776', '31778', '25026', '19456', '25025', '19457', '31774', '31781', '25024', '25021', '25020', '25023', '31777', '19455', '31780', '25018', '19454', '19453', '31775', '31773', '25017', '30024', '30031', '30025', '18862', '30033', '30032']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('4.99', '374', '2007-04-09T21:25:28.996577', '5463', '1'), + ('2.99', '374', '2007-03-22T14:51:19.996577', '15200', '1'), + ('4.99', '374', '2007-03-22T14:55:19.996577', '15202', '2'), + ('5.99', '178', '2007-03-01T20:46:58.996577', '10802', '1'), + ('6.99', '178', '2007-02-15T07:32:18.996577', '1292', '1'), + ('2.99', '178', '2007-03-19T10:32:29.996577', '13127', '1'), + ('4.99', '178', '2007-04-28T12:11:46.996577', '7959', '1'), + ('4.99', '178', '2007-05-14T13:44:29.996577', '12897', '1'), + ('2.99', '178', '2007-04-12T06:32:06.996577', '6606', '2'), + ('0.99', '178', '2007-04-28T15:52:12.996577', '8069', '2'), + ('6.99', '178', '2007-02-15T18:52:31.996577', '1458', '2'), + ('4.99', '178', '2007-04-11T18:47:19.996577', '6347', '2'), + ('7.99', '178', '2007-03-21T04:21:23.996577', '14257', '1'), + ('5.99', '178', '2007-04-29T04:16:41.996577', '8388', '2'), + ('0.99', '178', '2007-03-01T11:34:18.996577', '10562', '2'), + ('3.99', '178', '2007-02-16T15:09:42.996577', '1745', '2'), + ('9.99', '178', '2007-02-20T01:06:32.996577', '2898', '1'), + ('4.99', '178', '2007-04-29T15:13:44.996577', '8696', '2'), + ('2.99', '178', '2007-04-08T19:59:48.996577', '4915', '1'), + ('2.99', '178', '2007-02-16T01:42:27.996577', '1568', '2'), + ('1.99', '178', '2007-02-17T19:17:40.996577', '2124', '2'), + ('4.99', '178', '2007-03-22T18:51:06.996577', '15323', '1'), + ('7.99', '178', '2007-04-30T15:26:57.996577', '9311', '1'), + ('6.99', '178', '2007-02-19T21:08:38.996577', '2844', '2'), + ('5.99', '178', '2007-04-12T03:35:52.996577', '6554', '1'), + ('6.99', '178', '2007-03-02T14:38:35.996577', '11319', '2'), + ('6.99', '178', '2007-03-17T13:11:49.996577', '11884', '2'), + ('3.99', '178', '2007-04-29T00:32:24.996577', '8287', '1'), + ('2.99', '178', '2007-03-21T06:18:40.996577', '14314', '2'), + ('4.99', '178', '2007-04-30T12:13:58.996577', '9879', '2'), + ('10.99', '178', '2007-04-09T04:28:13.996577', '5094', '1'), + ('4.99', '178', '2007-03-20T23:06:10.996577', '14104', '1'), + ('6.99', '178', '2007-04-12T04:11:19.996577', '6566', '1'), + ('6.99', '178', '2007-03-17T19:21:53.996577', '12049', '2'), + ('0.99', '178', '2007-04-30T20:01:29.996577', '10125', '2'), + ('4.99', '178', '2007-04-30T03:32:53.996577', '9004', '2'), + ('3.99', '178', '2007-03-17T14:53:29.996577', '11927', '2'), + ('4.99', '178', '2007-02-18T06:13:29.996577', '2293', '1'), + ('4.99', '178', '2007-04-09T02:48:55.996577', '5057', '1'), + ('2.99', '178', '2007-03-18T20:13:41.996577', '12727', '2'), + ('2.99', '178', '2007-04-10T23:13:02.996577', '5984', '1'), + ('2.99', '178', '2007-04-09T00:22:50.996577', '5015', '1'), + ('4.99', '130', '2007-04-07T17:10:08.996577', '4339', '2'), + ('2.99', '130', '2007-02-17T22:14:42.996577', '2163', '2'), + ('0.99', '130', '2007-04-30T20:47:42.996577', '9452', '1'), + ('2.99', '130', '2007-02-17T00:08:13.996577', '1864', '2'), + ('5.99', '130', '2007-03-01T14:20:27.996577', '10645', '2'), + ('4.99', '130', '2007-04-27T06:43:00.996577', '7181', '1'), + ('4.99', '130', '2007-04-30T03:47:20.996577', '9637', '2'), + ('2.99', '130', '2007-02-19T00:07:30.996577', '2535', '1'), + ('0.99', '130', '2007-03-20T23:27:27.996577', '14111', '2'), + ('2.99', '130', '2007-02-18T06:06:14.996577', '2292', '2'), + ('2.99', '130', '2007-03-17T10:27:44.996577', '11811', '1'), + ('3.99', '130', '2007-04-11T19:17:22.996577', '6353', '1'), + ('4.99', '130', '2007-03-23T11:57:34.996577', '15777', '1'), + ('2.99', '130', '2007-03-17T20:59:30.996577', '12094', '1'), + ('0.99', '130', '2007-04-28T03:24:59.996577', '7728', '1'), + ('6.99', '130', '2007-02-20T07:06:55.996577', '2982', '1'), + ('5.99', '130', '2007-04-30T07:01:34.996577', '9724', '2'), + ('2.99', '130', '2007-03-01T11:45:54.996577', '10568', '2'), + ('6.99', '130', '2007-03-18T22:07:48.996577', '12777', '1'), + ('5.99', '130', '2007-03-23T03:57:58.996577', '15574', '2'), + ('2.99', '130', '2007-02-16T06:23:27.996577', '1630', '1'), + ('4.99', '130', '2007-04-07T23:36:20.996577', '4485', '2'), + ('4.99', '254', '2007-03-19T06:05:10.996577', '13001', '2'), + ('3.99', '254', '2007-04-09T03:30:24.996577', '5072', '1'), + ('4.99', '254', '2007-03-01T10:17:17.996577', '10522', '1'), + ('0.99', '254', '2007-03-18T00:50:46.996577', '12206', '1'), + ('1.99', '254', '2007-04-30T22:21:12.996577', '9494', '2'), + ('4.99', '254', '2007-04-06T17:06:47.996577', '3882', '1'), + ('4.99', '254', '2007-04-27T15:14:06.996577', '7413', '1'), + ('2.99', '254', '2007-04-09T01:48:56.996577', '5042', '2'), + ('0.99', '254', '2007-03-02T09:50:00.996577', '11190', '1'), + ('7.99', '254', '2007-04-10T14:49:28.996577', '5826', '1'), + ('0.99', '254', '2007-04-27T00:27:00.996577', '7011', '2'), + ('0.99', '254', '2007-03-23T11:53:34.996577', '15774', '1'), + ('2.99', '254', '2007-02-17T19:56:40.996577', '2138', '1'), + ('4.99', '254', '2007-03-21T12:38:13.996577', '14497', '2'), + ('3.99', '254', '2007-02-19T11:15:18.996577', '2687', '2'), + ('0.99', '254', '2007-04-10T01:04:07.996577', '5537', '1'), + ('4.99', '254', '2007-04-29T10:30:32.996577', '8581', '2'), + ('2.99', '254', '2007-03-19T10:35:08.996577', '13130', '2'), + ('0.99', '254', '2007-03-19T01:36:23.996577', '12874', '1'), + ('2.99', '254', '2007-03-18T02:20:17.996577', '12247', '1'), + ('4.99', '254', '2007-03-19T07:46:01.996577', '13045', '1'), + ('4.99', '254', '2007-04-10T20:27:58.996577', '5930', '2'), + ('2.99', '254', '2007-02-17T15:41:58.996577', '2082', '1'), + ('7.99', '254', '2007-04-28T22:12:25.996577', '8216', '2'), + ('0.99', '254', '2007-03-17T22:41:41.996577', '12148', '2'), + ('0.99', '254', '2007-02-15T14:34:55.996577', '1390', '2'), + ('2.99', '254', '2007-02-15T07:01:32.996577', '1285', '1'), + ('5.99', '254', '2007-04-10T01:27:01.996577', '5550', '1'), + ('2.99', '254', '2007-04-09T03:52:21.996577', '5080', '2'), + ('6.99', '254', '2007-03-17T04:05:23.996577', '11665', '1'), + ('2.99', '92', '2007-04-07T17:59:38.996577', '4360', '1'), + ('6.99', '92', '2007-04-11T14:47:27.996577', '6277', '2'), + ('4.99', '92', '2007-04-08T16:20:55.996577', '4828', '2'), + ('8.99', '92', '2007-02-19T14:27:30.996577', '2740', '1'), + ('1.99', '92', '2007-04-28T07:14:37.996577', '7832', '1'), + ('4.99', '92', '2007-04-27T02:31:52.996577', '7073', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['30027', '23572', '30028', '23569', '30035', '23565', '30022', '30026', '30029', '30030', '18861', '23566', '30034', '23567', '23568', '23571', '18860', '30023', '23570', '30036', '24955', '31709', '24953', '31705', '24954', '24956', '19428', '19431', '31710', '24957', '19429', '31707', '31711', '19430', '31706', '31708', '24958', '19427', '30412', '23850', '23852', '18991', '30417', '30421', '30413', '23856', '30411', '30420', '23857', '23849', '23853', '30416', '30419', '23858', '30422', '30418', '30415', '23855', '30423', '23859', '23851', '30414', '23854', '25633', '25637', '25630', '25632', '25634', '25629', '19913', '19910', '25627', '25635', '19914', '19908', '25625', '19909', '19911', '25631', '25626', '19912', '25636', '25628', '18782', '29815', '23400', '29813', '23392', '23391', '29810', '29806', '23399', '18784', '23394', '23393', '18783', '23396', '29812', '23390', '23395']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('7.99', '92', '2007-04-10T03:59:18.996577', '5620', '2'), + ('4.99', '92', '2007-03-22T06:21:40.996577', '14998', '2'), + ('6.99', '92', '2007-04-10T12:50:45.996577', '5792', '1'), + ('0.99', '92', '2007-03-20T00:08:51.996577', '13495', '1'), + ('4.99', '92', '2007-04-30T01:24:34.996577', '8938', '1'), + ('4.99', '92', '2007-03-02T10:21:07.996577', '11203', '2'), + ('8.99', '92', '2007-04-06T03:28:15.996577', '3595', '2'), + ('5.99', '92', '2007-04-09T22:51:49.996577', '5497', '2'), + ('2.99', '92', '2007-04-10T20:00:40.996577', '5919', '2'), + ('0.99', '92', '2007-04-11T08:18:50.996577', '6158', '1'), + ('0.99', '92', '2007-02-18T23:09:34.996577', '2521', '1'), + ('2.99', '92', '2007-03-02T12:02:16.996577', '11245', '2'), + ('4.99', '92', '2007-04-29T07:32:58.996577', '8494', '1'), + ('4.99', '92', '2007-03-17T11:53:21.996577', '11849', '1'), + ('5.99', '92', '2007-03-19T06:36:16.996577', '13020', '2'), + ('0.99', '92', '2007-03-21T23:12:34.996577', '14798', '1'), + ('4.99', '92', '2007-02-17T15:45:45.996577', '2084', '2'), + ('7.99', '92', '2007-04-06T09:20:58.996577', '3716', '2'), + ('2.99', '92', '2007-03-20T05:09:53.996577', '13620', '1'), + ('4.99', '92', '2007-04-30T12:26:20.996577', '9240', '1'), + ('6.99', '246', '2007-03-20T09:40:08.996577', '13750', '1'), + ('4.99', '246', '2007-04-12T10:50:38.996577', '6688', '1'), + ('2.99', '246', '2007-03-01T16:01:29.996577', '10683', '2'), + ('7.99', '246', '2007-04-07T04:22:44.996577', '4092', '1'), + ('5.99', '246', '2007-03-19T21:22:22.996577', '13418', '2'), + ('4.99', '246', '2007-03-20T17:47:56.996577', '13987', '1'), + ('2.99', '246', '2007-02-17T07:49:02.996577', '1968', '1'), + ('4.99', '246', '2007-02-20T19:11:07.996577', '3152', '1'), + ('5.99', '246', '2007-04-30T23:30:44.996577', '9525', '2'), + ('6.99', '246', '2007-03-21T07:45:06.996577', '14360', '1'), + ('1.99', '246', '2007-02-19T12:18:36.996577', '2704', '2'), + ('2.99', '246', '2007-04-08T23:22:39.996577', '4994', '2'), + ('4.99', '246', '2007-04-30T23:23:17.996577', '10208', '2'), + ('0.99', '246', '2007-02-19T13:29:49.996577', '2725', '1'), + ('4.99', '246', '2007-04-08T19:24:26.996577', '4905', '2'), + ('0.99', '246', '2007-04-09T15:59:58.996577', '5347', '2'), + ('2.99', '246', '2007-03-23T10:54:45.996577', '15746', '1'), + ('1.99', '246', '2007-02-15T17:45:42.996577', '1448', '2'), + ('4.99', '126', '2007-04-06T09:43:30.996577', '3725', '1'), + ('4.99', '126', '2007-03-17T02:18:59.996577', '11613', '2'), + ('0.99', '126', '2007-03-17T09:58:37.996577', '11801', '1'), + ('2.99', '126', '2007-02-21T19:30:23.996577', '3450', '1'), + ('0.99', '126', '2007-04-10T16:59:31.996577', '5865', '1'), + ('2.99', '126', '2007-04-28T16:55:55.996577', '8091', '1'), + ('7.99', '126', '2007-04-06T13:36:34.996577', '3804', '1'), + ('2.99', '126', '2007-03-21T12:01:04.996577', '14477', '2'), + ('5.99', '126', '2007-04-05T22:43:32.996577', '3502', '2'), + ('0.99', '126', '2007-04-28T12:16:35.996577', '7962', '1'), + ('2.99', '126', '2007-03-21T15:20:55.996577', '14577', '2'), + ('9.99', '126', '2007-03-02T10:11:06.996577', '11196', '1'), + ('2.99', '126', '2007-03-19T05:49:50.996577', '12991', '2'), + ('0.99', '126', '2007-04-09T06:29:00.996577', '5137', '2'), + ('6.99', '126', '2007-04-12T13:36:15.996577', '6755', '2'), + ('4.99', '126', '2007-03-23T10:39:20.996577', '15741', '2'), + ('6.99', '126', '2007-04-30T22:20:47.996577', '9492', '1'), + ('0.99', '126', '2007-04-12T13:01:47.996577', '6747', '1'), + ('2.99', '126', '2007-04-08T11:28:15.996577', '4730', '2'), + ('0.99', '126', '2007-03-19T12:25:24.996577', '13177', '2'), + ('4.99', '126', '2007-04-30T17:10:21.996577', '10032', '2'), + ('7.99', '126', '2007-03-23T19:31:09.996577', '16007', '1'), + ('3.99', '126', '2007-03-17T09:00:24.996577', '11779', '1'), + ('0.99', '126', '2007-04-08T09:33:19.996577', '4691', '1'), + ('7.99', '126', '2007-03-19T06:25:17.996577', '13015', '2'), + ('2.99', '307', '2007-04-27T20:02:35.996577', '7536', '1'), + ('4.99', '307', '2007-04-30T20:25:58.996577', '10135', '1'), + ('6.99', '307', '2007-04-11T06:32:01.996577', '6125', '2'), + ('10.99', '307', '2007-04-26T23:31:32.996577', '6991', '1'), + ('3.99', '307', '2007-04-28T04:58:11.996577', '7760', '1'), + ('3.99', '307', '2007-04-10T17:14:34.996577', '5871', '1'), + ('0.99', '307', '2007-03-21T03:33:00.996577', '14231', '1'), + ('7.99', '307', '2007-03-02T21:13:16.996577', '11491', '1'), + ('2.99', '307', '2007-04-08T01:31:38.996577', '4522', '1'), + ('0.99', '307', '2007-04-28T10:45:06.996577', '7929', '1'), + ('4.99', '307', '2007-03-23T01:32:19.996577', '15515', '2'), + ('0.99', '307', '2007-03-01T04:53:53.996577', '10374', '1'), + ('6.99', '307', '2007-04-06T20:42:11.996577', '3962', '1'), + ('2.99', '307', '2007-03-01T18:25:32.996577', '10745', '1'), + ('4.99', '307', '2007-03-18T07:21:19.996577', '12391', '2'), + ('0.99', '307', '2007-04-11T13:47:48.996577', '6256', '1'), + ('4.99', '307', '2007-04-06T21:52:29.996577', '3985', '1'), + ('6.99', '307', '2007-03-19T19:41:03.996577', '13365', '2'), + ('6.99', '307', '2007-04-29T13:21:25.996577', '8647', '1'), + ('4.99', '307', '2007-04-08T17:42:16.996577', '4868', '1'), + ('0.99', '74', '2007-02-18T22:39:52.996577', '2517', '2'), + ('3.99', '74', '2007-04-30T17:42:46.996577', '10051', '2'), + ('0.99', '74', '2007-03-23T20:55:13.996577', '16046', '1'), + ('5.99', '74', '2007-04-29T19:37:37.996577', '8796', '2'), + ('0.99', '74', '2007-03-19T18:31:44.996577', '13335', '2'), + ('3.99', '74', '2007-03-18T10:53:27.996577', '12477', '2'), + ('7.99', '74', '2007-04-11T13:09:14.996577', '6241', '1'), + ('3.99', '74', '2007-04-06T14:03:32.996577', '3819', '2'), + ('4.99', '74', '2007-03-23T10:24:48.996577', '15739', '2'), + ('7.99', '74', '2007-02-21T19:08:54.996577', '3445', '2'), + ('1.99', '74', '2007-03-20T03:58:11.996577', '13583', '1'), + ('0.99', '74', '2007-03-20T01:10:12.996577', '13520', '2'), + ('1.99', '74', '2007-02-20T09:40:30.996577', '3020', '1'), + ('4.99', '74', '2007-03-22T17:46:22.996577', '15286', '1'), + ('6.99', '74', '2007-04-27T11:25:22.996577', '7304', '1'), + ('3.99', '74', '2007-03-18T06:36:11.996577', '12374', '2'), + ('5.99', '74', '2007-03-20T09:24:32.996577', '13747', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['29814', '29809', '29807', '23398', '29811', '29808', '18781', '23397', '23389', '26992', '17828', '26991', '21045', '26987', '17827', '21047', '17829', '21044', '17830', '21043', '21050', '21046', '21048', '26990', '17831', '26993', '26984', '26989', '26986', '26985', '21049', '26988', '22558', '22559', '28805', '28798', '28808', '22556', '28810', '22553', '28799', '28800', '22557', '28802', '28804', '28811', '22554', '28803', '22552', '28806', '18440', '28807', '28812', '18438', '28801', '22555', '22551', '18439', '28809', '26251', '20403', '26254', '20402', '26247', '20399', '26246', '26257', '17587', '26258', '20395', '20401', '20405', '20396', '17589', '20404', '26259', '26249', '26260', '26250', '26253', '17590', '20400', '17588', '20398', '20397', '26252', '26255', '17591', '26256', '26248', '29526', '23137', '23141', '29519', '29522', '29527', '29523', '23139', '18694', '29521']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('4.99', '74', '2007-04-30T07:34:57.996577', '9112', '2'), + ('4.99', '74', '2007-04-10T19:58:48.996577', '5917', '2'), + ('2.99', '74', '2007-04-10T00:42:15.996577', '5530', '1'), + ('0.99', '74', '2007-03-23T01:08:03.996577', '15500', '2'), + ('2.99', '74', '2007-04-12T00:05:23.996577', '6475', '1'), + ('2.99', '74', '2007-04-10T03:33:20.996577', '5603', '2'), + ('1.99', '74', '2007-02-18T21:24:52.996577', '2498', '1'), + ('4.99', '74', '2007-03-22T18:56:04.996577', '15325', '2'), + ('0.99', '74', '2007-03-01T13:55:31.996577', '10624', '1'), + ('5.99', '427', '2007-04-29T13:45:03.996577', '8658', '2'), + ('3.99', '427', '2007-02-16T06:21:21.996577', '1628', '2'), + ('5.99', '427', '2007-04-29T08:54:41.996577', '8531', '1'), + ('4.99', '427', '2007-03-01T11:33:23.996577', '10560', '2'), + ('6.99', '427', '2007-04-11T22:15:57.996577', '6423', '1'), + ('5.99', '427', '2007-02-15T10:54:47.996577', '1342', '1'), + ('1.99', '427', '2007-03-20T08:30:05.996577', '13720', '1'), + ('5.99', '427', '2007-02-16T07:45:33.996577', '1648', '1'), + ('5.99', '427', '2007-03-01T08:11:40.996577', '10464', '1'), + ('1.99', '427', '2007-02-16T23:41:24.996577', '1857', '1'), + ('4.99', '427', '2007-03-01T06:39:02.996577', '10417', '1'), + ('3.99', '427', '2007-03-22T19:03:56.996577', '15330', '1'), + ('5.99', '427', '2007-03-02T04:06:57.996577', '11024', '1'), + ('6.99', '427', '2007-03-21T02:20:00.996577', '14201', '2'), + ('3.99', '427', '2007-04-28T20:47:38.996577', '8182', '2'), + ('0.99', '427', '2007-02-18T18:47:08.996577', '2466', '2'), + ('2.99', '427', '2007-04-30T15:28:17.996577', '9978', '2'), + ('3.99', '427', '2007-04-08T14:58:27.996577', '4793', '1'), + ('7.99', '427', '2007-04-26T21:44:30.996577', '6938', '2'), + ('5.99', '427', '2007-04-10T02:45:32.996577', '5586', '2'), + ('2.99', '427', '2007-04-09T22:05:35.996577', '5476', '2'), + ('3.99', '427', '2007-03-21T05:22:25.996577', '14287', '1'), + ('2.99', '427', '2007-04-12T02:03:27.996577', '6509', '1'), + ('3.99', '591', '2007-03-19T18:50:34.996577', '13343', '2'), + ('9.99', '591', '2007-03-20T13:34:08.996577', '13867', '1'), + ('4.99', '591', '2007-04-27T19:07:06.996577', '7511', '2'), + ('0.99', '591', '2007-04-06T05:32:18.996577', '3636', '1'), + ('4.99', '591', '2007-04-28T13:30:51.996577', '7997', '1'), + ('5.99', '591', '2007-03-19T03:47:08.996577', '12934', '1'), + ('5.99', '591', '2007-04-29T14:08:04.996577', '8666', '2'), + ('4.99', '591', '2007-03-18T01:32:54.996577', '12227', '2'), + ('11.99', '591', '2007-04-07T19:14:17.996577', '4383', '2'), + ('6.99', '591', '2007-04-08T04:33:32.996577', '4581', '1'), + ('2.99', '591', '2007-03-19T09:34:32.996577', '13104', '2'), + ('6.99', '591', '2007-04-10T11:11:48.996577', '5759', '1'), + ('2.99', '591', '2007-04-27T07:49:48.996577', '7212', '1'), + ('4.99', '591', '2007-04-29T20:42:52.996577', '8819', '2'), + ('4.99', '591', '2007-03-18T12:58:05.996577', '12547', '1'), + ('8.99', '591', '2007-04-27T04:22:16.996577', '7118', '1'), + ('5.99', '591', '2007-03-18T00:47:18.996577', '12203', '2'), + ('3.99', '591', '2007-04-27T20:21:47.996577', '7549', '1'), + ('4.99', '591', '2007-02-21T17:43:24.996577', '3435', '2'), + ('0.99', '591', '2007-04-28T03:54:21.996577', '7741', '2'), + ('0.99', '591', '2007-04-30T05:16:59.996577', '9684', '1'), + ('0.99', '591', '2007-02-15T16:19:53.996577', '1418', '1'), + ('5.99', '591', '2007-04-10T08:34:55.996577', '5704', '1'), + ('5.99', '591', '2007-03-18T13:59:44.996577', '12571', '1'), + ('4.99', '591', '2007-03-01T06:34:25.996577', '10415', '1'), + ('2.99', '591', '2007-02-21T09:05:51.996577', '3341', '2'), + ('3.99', '591', '2007-04-28T19:16:38.996577', '8149', '1'), + ('4.99', '362', '2007-04-12T04:42:07.996577', '6576', '2'), + ('11.99', '362', '2007-03-21T21:57:24.996577', '14759', '1'), + ('2.99', '362', '2007-04-27T17:57:35.996577', '7485', '1'), + ('5.99', '362', '2007-03-21T21:40:08.996577', '14752', '1'), + ('4.99', '362', '2007-04-09T10:45:05.996577', '5227', '1'), + ('6.99', '362', '2007-03-20T20:38:17.996577', '14051', '2'), + ('8.99', '362', '2007-04-08T07:51:52.996577', '4646', '2'), + ('4.99', '362', '2007-04-29T03:38:57.996577', '8364', '2'), + ('2.99', '362', '2007-02-15T16:52:36.996577', '1429', '1'), + ('0.99', '362', '2007-04-29T13:59:59.996577', '8662', '1'), + ('3.99', '362', '2007-03-01T11:12:43.996577', '10546', '2'), + ('4.99', '362', '2007-03-21T07:02:08.996577', '14336', '2'), + ('2.99', '362', '2007-03-22T04:45:38.996577', '14950', '1'), + ('4.99', '362', '2007-03-18T02:07:37.996577', '12244', '2'), + ('2.99', '362', '2007-02-16T05:28:54.996577', '1615', '1'), + ('4.99', '362', '2007-03-21T23:27:01.996577', '14808', '1'), + ('2.99', '362', '2007-04-29T16:00:06.996577', '8714', '1'), + ('5.99', '362', '2007-04-10T07:55:15.996577', '5690', '2'), + ('4.99', '362', '2007-04-30T08:49:58.996577', '9784', '1'), + ('4.99', '362', '2007-04-11T10:57:48.996577', '6204', '1'), + ('1.99', '362', '2007-04-27T06:27:42.996577', '7172', '1'), + ('2.99', '362', '2007-02-20T22:35:49.996577', '3197', '2'), + ('2.99', '362', '2007-03-21T00:10:41.996577', '14129', '2'), + ('2.99', '362', '2007-02-15T23:06:01.996577', '1529', '1'), + ('6.99', '362', '2007-03-20T04:31:14.996577', '13603', '1'), + ('6.99', '362', '2007-03-19T00:47:17.996577', '12854', '1'), + ('4.99', '362', '2007-04-26T23:20:04.996577', '6981', '1'), + ('2.99', '362', '2007-04-28T16:35:12.996577', '8081', '1'), + ('2.99', '362', '2007-02-21T13:42:53.996577', '3393', '2'), + ('2.99', '362', '2007-04-29T02:25:53.996577', '8325', '2'), + ('1.99', '362', '2007-04-10T01:49:28.996577', '5563', '2'), + ('6.99', '47', '2007-04-29T04:54:11.996577', '8402', '2'), + ('0.99', '47', '2007-03-02T07:27:30.996577', '11126', '1'), + ('0.99', '47', '2007-03-21T08:54:22.996577', '14397', '1'), + ('4.99', '47', '2007-04-06T05:05:19.996577', '3631', '1'), + ('9.99', '47', '2007-04-11T07:59:30.996577', '6153', '2'), + ('3.99', '47', '2007-04-29T22:20:27.996577', '8863', '1'), + ('0.99', '47', '2007-04-11T08:44:49.996577', '6164', '2'), + ('7.99', '47', '2007-03-18T01:04:05.996577', '12215', '1'), + ('6.99', '47', '2007-02-18T07:03:25.996577', '2307', '1'), + ('0.99', '47', '2007-04-09T08:00:25.996577', '5174', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['18693', '23138', '23142', '29528', '18695', '29524', '29525', '29520', '23140', '29433', '29428', '23066', '18661', '23064', '18662', '29426', '29423', '29424', '29434', '18663', '18660', '29432', '29431', '23070', '29435', '23065', '18665', '23068', '23067', '29425', '23063', '18664', '29436', '23069', '29430', '29437', '29429', '29427', '30100', '30092', '30097', '23617', '30099', '30096', '32046', '30095', '30106', '18890', '30093', '30102', '30105', '30101', '30103', '23615', '23618', '30098', '18891', '23616', '30094', '30104', '23619', '19391', '31601', '19393', '31590', '31594', '31598', '31599', '31592', '31595', '19392', '31596', '24865', '31591', '19395', '24871', '31603', '31600', '24870', '31604', '24866', '19394', '31597', '24874', '24873', '24872', '24868', '31593', '24875', '24867', '31602', '24869', '23535', '23534', '29970', '29969', '18846', '29964', '29962', '29963']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('4.99', '47', '2007-02-17T01:45:47.996577', '1882', '1'), + ('5.99', '47', '2007-03-02T20:37:27.996577', '11477', '2'), + ('2.99', '47', '2007-03-23T14:07:44.996577', '15846', '2'), + ('4.99', '47', '2007-04-30T13:35:30.996577', '9274', '2'), + ('5.99', '47', '2007-02-21T06:58:07.996577', '3320', '2'), + ('3.99', '47', '2007-04-11T17:59:13.996577', '6337', '1'), + ('4.99', '47', '2007-04-28T19:37:54.996577', '8159', '2'), + ('5.99', '47', '2007-04-07T02:57:46.996577', '4064', '2'), + ('7.99', '47', '2007-03-18T03:10:13.996577', '12274', '2'), + ('2.99', '39', '2007-04-29T19:58:24.996577', '8805', '1'), + ('2.99', '39', '2007-04-09T23:41:10.996577', '5515', '2'), + ('9.99', '39', '2007-03-01T14:13:09.996577', '10639', '1'), + ('4.99', '39', '2007-02-17T03:20:09.996577', '1905', '1'), + ('4.99', '39', '2007-03-01T01:37:52.996577', '10269', '2'), + ('0.99', '39', '2007-02-17T19:42:28.996577', '2135', '2'), + ('7.99', '39', '2007-04-08T11:22:41.996577', '4727', '2'), + ('5.99', '39', '2007-04-07T20:34:50.996577', '4419', '1'), + ('8.99', '39', '2007-04-08T09:36:25.996577', '4695', '2'), + ('1.99', '39', '2007-04-30T19:52:48.996577', '9431', '1'), + ('4.99', '39', '2007-02-18T17:03:30.996577', '2439', '2'), + ('5.99', '39', '2007-02-16T06:17:34.996577', '1625', '1'), + ('7.99', '39', '2007-04-29T16:32:13.996577', '8723', '2'), + ('1.99', '39', '2007-04-29T03:39:40.996577', '8366', '2'), + ('5.99', '39', '2007-03-22T11:20:04.996577', '15124', '2'), + ('4.99', '39', '2007-04-30T04:28:47.996577', '9656', '1'), + ('0.99', '39', '2007-03-01T14:03:12.996577', '10630', '2'), + ('4.99', '39', '2007-02-19T23:35:00.996577', '2876', '1'), + ('4.99', '39', '2007-03-18T09:53:37.996577', '12459', '2'), + ('0.99', '39', '2007-03-18T02:55:20.996577', '12268', '2'), + ('6.99', '39', '2007-04-08T10:39:16.996577', '4712', '2'), + ('4.99', '39', '2007-03-01T01:07:38.996577', '10251', '1'), + ('4.99', '39', '2007-02-19T07:18:19.996577', '2631', '1'), + ('4.99', '39', '2007-04-30T17:43:39.996577', '10052', '2'), + ('7.99', '39', '2007-03-19T09:30:20.996577', '13101', '2'), + ('6.99', '39', '2007-04-29T01:47:00.996577', '8307', '2'), + ('0.99', '39', '2007-04-30T20:04:33.996577', '10126', '1'), + ('2.99', '39', '2007-04-11T01:49:31.996577', '6045', '1'), + ('4.99', '39', '2007-04-09T20:50:36.996577', '5451', '1'), + ('2.99', '99', '2007-04-11T15:35:05.996577', '6289', '1'), + ('6.99', '99', '2007-04-06T12:20:28.996577', '3780', '2'), + ('2.99', '99', '2007-04-08T21:42:42.996577', '4954', '2'), + ('4.99', '99', '2007-03-02T12:36:01.996577', '11266', '2'), + ('2.99', '99', '2007-04-10T10:48:25.996577', '5748', '1'), + ('4.99', '99', '2007-04-08T15:19:34.996577', '4800', '2'), + ('0.99', '99', '2007-05-14T13:44:29.996577', '11593', '1'), + ('0.99', '99', '2007-04-08T04:54:30.996577', '4589', '1'), + ('0.99', '99', '2007-04-29T08:21:59.996577', '8514', '2'), + ('4.99', '99', '2007-02-16T23:41:37.996577', '1858', '1'), + ('2.99', '99', '2007-04-07T08:13:02.996577', '4170', '2'), + ('4.99', '99', '2007-04-12T09:49:32.996577', '6662', '2'), + ('7.99', '99', '2007-04-28T23:02:53.996577', '8242', '2'), + ('3.99', '99', '2007-04-11T19:56:58.996577', '6370', '1'), + ('4.99', '99', '2007-04-27T01:40:14.996577', '7039', '1'), + ('7.99', '99', '2007-03-01T05:11:10.996577', '10388', '2'), + ('0.99', '99', '2007-03-18T06:55:14.996577', '12379', '2'), + ('2.99', '99', '2007-04-09T01:20:00.996577', '5035', '2'), + ('2.99', '99', '2007-02-18T12:38:53.996577', '2368', '1'), + ('1.99', '99', '2007-03-01T07:43:26.996577', '10455', '1'), + ('4.99', '99', '2007-04-07T17:19:13.996577', '4344', '2'), + ('0.99', '99', '2007-04-28T15:56:25.996577', '8072', '1'), + ('8.99', '99', '2007-03-19T01:19:02.996577', '12869', '2'), + ('0.99', '237', '2007-02-15T20:29:11.996577', '1500', '1'), + ('4.99', '237', '2007-04-30T04:35:03.996577', '9661', '1'), + ('4.99', '237', '2007-02-17T21:36:38.996577', '2156', '1'), + ('4.99', '237', '2007-04-08T16:56:39.996577', '4844', '1'), + ('4.99', '237', '2007-04-28T06:35:18.996577', '7812', '1'), + ('6.99', '237', '2007-04-29T19:45:13.996577', '8799', '2'), + ('3.99', '237', '2007-04-29T21:13:01.996577', '8835', '1'), + ('2.99', '237', '2007-04-27T07:05:26.996577', '7193', '1'), + ('8.99', '237', '2007-04-28T11:49:42.996577', '7951', '2'), + ('0.99', '237', '2007-02-15T22:05:03.996577', '1518', '2'), + ('2.99', '237', '2007-04-28T17:18:09.996577', '8102', '2'), + ('4.99', '237', '2007-03-02T07:24:01.996577', '11125', '2'), + ('4.99', '237', '2007-04-11T02:20:25.996577', '6053', '2'), + ('2.99', '237', '2007-02-20T12:41:26.996577', '3069', '2'), + ('6.99', '237', '2007-03-20T17:11:06.996577', '13969', '2'), + ('0.99', '237', '2007-04-30T17:47:39.996577', '10056', '2'), + ('5.99', '237', '2007-04-30T13:37:54.996577', '9276', '1'), + ('6.99', '237', '2007-03-20T15:31:03.996577', '13922', '2'), + ('2.99', '237', '2007-04-30T17:48:47.996577', '10058', '2'), + ('11.99', '237', '2007-03-02T20:46:39.996577', '11479', '2'), + ('2.99', '237', '2007-02-18T20:32:41.996577', '2492', '1'), + ('2.99', '237', '2007-04-29T17:37:03.996577', '8748', '2'), + ('0.99', '237', '2007-03-22T19:18:17.996577', '15337', '1'), + ('8.99', '237', '2007-03-22T12:06:37.996577', '15139', '2'), + ('3.99', '237', '2007-03-21T11:02:00.996577', '14453', '2'), + ('0.99', '237', '2007-03-18T10:21:33.996577', '12469', '1'), + ('3.99', '237', '2007-04-27T12:25:12.996577', '7330', '2'), + ('1.99', '237', '2007-03-23T16:56:35.996577', '15931', '2'), + ('5.99', '237', '2007-03-17T08:47:23.996577', '11772', '2'), + ('1.99', '237', '2007-04-30T06:45:24.996577', '9715', '2'), + ('6.99', '237', '2007-03-20T15:07:23.996577', '13914', '2'), + ('4.99', '88', '2007-03-23T15:41:27.996577', '15898', '1'), + ('3.99', '88', '2007-03-22T10:16:45.996577', '15098', '2'), + ('2.99', '88', '2007-04-29T01:11:51.996577', '8296', '1'), + ('8.99', '88', '2007-04-27T23:02:32.996577', '7621', '1'), + ('7.99', '88', '2007-02-18T19:50:49.996577', '2483', '1'), + ('5.99', '88', '2007-04-06T07:30:35.996577', '3673', '2'), + ('0.99', '88', '2007-04-05T23:30:17.996577', '3524', '2'), + ('0.99', '88', '2007-04-06T04:30:16.996577', '3620', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['23530', '23533', '29966', '23532', '29971', '29965', '18847', '18845', '23531', '29972', '29967', '29968', '22070', '18245', '18243', '28204', '28209', '28199', '28208', '28207', '28200', '28205', '22068', '28206', '28201', '22072', '22073', '28202', '22069', '22067', '28210', '28203', '22071', '18244', '22074', '24952', '31700', '31697', '24951', '31695', '24950', '31699', '31701', '31689', '19425', '31693', '19424', '19426', '24949', '31703', '24947', '31702', '31696', '31690', '31698', '24948', '31692', '31691', '31694', '32094', '31704', '30817', '30811', '24224', '30818', '24223', '24232', '24220', '30814', '24219', '30816', '19118', '24225', '30815', '19117', '24226', '19116', '24222', '24228', '24227', '30813', '24231', '24230', '24221', '30812', '24229', '30810', '24233', '26601', '26605', '26609', '20713', '26599', '20710', '26602', '26608', '20717', '17720', '20718', '26606']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('0.99', '88', '2007-03-01T06:51:20.996577', '10424', '1'), + ('5.99', '88', '2007-03-22T00:00:58.996577', '14827', '2'), + ('1.99', '88', '2007-04-12T09:07:48.996577', '6643', '1'), + ('2.99', '88', '2007-03-20T22:57:14.996577', '14097', '2'), + ('2.99', '88', '2007-04-29T08:49:14.996577', '8526', '2'), + ('5.99', '88', '2007-04-06T15:11:36.996577', '3846', '1'), + ('2.99', '88', '2007-02-19T23:37:40.996577', '2878', '1'), + ('2.99', '88', '2007-02-15T16:58:26.996577', '1433', '1'), + ('6.99', '88', '2007-03-02T05:04:53.996577', '11056', '1'), + ('2.99', '88', '2007-04-29T15:12:05.996577', '8692', '1'), + ('4.99', '88', '2007-04-12T20:57:44.996577', '6916', '1'), + ('5.99', '88', '2007-04-27T03:10:54.996577', '7088', '1'), + ('8.99', '536', '2007-03-17T19:25:28.996577', '12052', '2'), + ('2.99', '536', '2007-02-18T15:01:48.996577', '2403', '2'), + ('4.99', '536', '2007-02-16T03:00:23.996577', '1582', '1'), + ('4.99', '536', '2007-04-27T02:22:09.996577', '7065', '1'), + ('4.99', '536', '2007-04-30T07:07:39.996577', '9727', '1'), + ('4.99', '536', '2007-04-05T21:42:17.996577', '3483', '1'), + ('8.99', '536', '2007-04-30T19:06:48.996577', '9411', '1'), + ('2.99', '536', '2007-04-30T02:02:52.996577', '8958', '1'), + ('0.99', '536', '2007-04-05T23:15:20.996577', '3514', '1'), + ('4.99', '536', '2007-04-29T09:00:59.996577', '8535', '2'), + ('2.99', '536', '2007-03-17T11:12:12.996577', '11826', '1'), + ('4.99', '536', '2007-04-29T14:36:13.996577', '8679', '1'), + ('2.99', '536', '2007-04-07T21:45:38.996577', '4448', '1'), + ('7.99', '536', '2007-03-22T11:32:58.996577', '15130', '1'), + ('8.99', '536', '2007-03-23T18:36:44.996577', '15978', '1'), + ('0.99', '536', '2007-04-09T09:12:00.996577', '5196', '2'), + ('4.99', '536', '2007-03-17T16:29:41.996577', '11977', '2'), + ('6.99', '536', '2007-03-02T20:20:29.996577', '11473', '1'), + ('3.99', '536', '2007-04-30T16:49:22.996577', '10019', '2'), + ('5.99', '536', '2007-04-11T21:12:10.996577', '6400', '1'), + ('4.99', '536', '2007-03-20T00:34:23.996577', '13505', '2'), + ('2.99', '536', '2007-02-17T07:37:24.996577', '1962', '2'), + ('0.99', '536', '2007-03-23T18:36:52.996577', '15979', '1'), + ('6.99', '245', '2007-03-23T12:11:52.996577', '15782', '1'), + ('10.99', '245', '2007-04-29T20:14:47.996577', '8811', '1'), + ('0.99', '245', '2007-04-27T13:18:10.996577', '7358', '1'), + ('0.99', '245', '2007-03-19T16:56:33.996577', '13286', '1'), + ('4.99', '245', '2007-04-27T08:30:07.996577', '7230', '1'), + ('7.99', '245', '2007-03-18T04:11:48.996577', '12303', '1'), + ('6.99', '245', '2007-04-29T15:31:01.996577', '8701', '2'), + ('0.99', '245', '2007-04-30T06:49:28.996577', '9088', '2'), + ('2.99', '245', '2007-04-06T05:19:40.996577', '3634', '1'), + ('2.99', '245', '2007-02-17T19:16:53.996577', '2122', '1'), + ('5.99', '245', '2007-04-12T15:09:26.996577', '6795', '1'), + ('2.99', '245', '2007-02-15T13:30:29.996577', '1377', '1'), + ('2.99', '245', '2007-02-20T19:36:20.996577', '3157', '1'), + ('0.99', '245', '2007-03-02T10:45:14.996577', '11211', '1'), + ('6.99', '245', '2007-04-30T09:57:49.996577', '9813', '1'), + ('0.99', '245', '2007-03-02T05:18:44.996577', '11061', '2'), + ('4.99', '245', '2007-04-30T10:03:26.996577', '9169', '2'), + ('5.99', '245', '2007-04-27T08:37:02.996577', '7233', '2'), + ('2.99', '245', '2007-04-09T14:54:59.996577', '5321', '2'), + ('4.99', '245', '2007-04-27T14:33:26.996577', '7397', '2'), + ('0.99', '245', '2007-03-02T06:41:57.996577', '11105', '1'), + ('2.99', '245', '2007-04-11T13:13:30.996577', '6242', '2'), + ('4.99', '245', '2007-04-10T11:26:42.996577', '5764', '1'), + ('0.99', '245', '2007-04-26T22:39:24.996577', '6962', '2'), + ('2.99', '245', '2007-05-14T13:44:29.996577', '12682', '2'), + ('3.99', '245', '2007-04-30T18:43:48.996577', '10087', '1'), + ('2.99', '160', '2007-04-30T07:54:04.996577', '9758', '2'), + ('5.99', '160', '2007-04-08T19:34:10.996577', '4908', '1'), + ('2.99', '160', '2007-03-17T10:10:34.996577', '11803', '1'), + ('2.99', '160', '2007-04-30T18:45:35.996577', '10089', '2'), + ('2.99', '160', '2007-03-02T08:23:16.996577', '11154', '2'), + ('4.99', '160', '2007-03-23T18:10:30.996577', '15962', '1'), + ('0.99', '160', '2007-03-01T20:05:36.996577', '10788', '2'), + ('0.99', '160', '2007-04-27T18:44:29.996577', '7500', '2'), + ('2.99', '160', '2007-03-01T02:44:42.996577', '10305', '1'), + ('0.99', '160', '2007-04-30T05:10:35.996577', '9681', '1'), + ('2.99', '160', '2007-02-19T23:09:51.996577', '2873', '2'), + ('7.99', '160', '2007-03-17T13:32:31.996577', '11888', '1'), + ('4.99', '160', '2007-04-28T20:51:01.996577', '8184', '1'), + ('2.99', '160', '2007-02-18T18:35:28.996577', '2465', '1'), + ('2.99', '160', '2007-03-18T05:21:02.996577', '12334', '2'), + ('4.99', '160', '2007-02-18T07:31:45.996577', '2314', '2'), + ('5.99', '160', '2007-03-02T02:45:03.996577', '10979', '2'), + ('6.99', '160', '2007-03-19T09:14:42.996577', '13093', '2'), + ('7.99', '160', '2007-03-18T09:06:57.996577', '12435', '1'), + ('1.99', '160', '2007-04-11T23:14:25.996577', '6448', '2'), + ('2.99', '160', '2007-03-23T06:37:37.996577', '15642', '2'), + ('2.99', '160', '2007-03-22T10:50:15.996577', '15112', '1'), + ('4.99', '160', '2007-03-02T02:05:39.996577', '10958', '2'), + ('6.99', '160', '2007-04-11T19:43:14.996577', '6364', '2'), + ('4.99', '160', '2007-03-22T01:43:27.996577', '14868', '1'), + ('0.99', '160', '2007-04-08T16:49:56.996577', '4842', '1'), + ('3.99', '160', '2007-03-23T20:17:59.996577', '16027', '1'), + ('5.99', '393', '2007-04-08T07:07:23.996577', '4632', '2'), + ('0.99', '393', '2007-04-12T02:13:09.996577', '6513', '2'), + ('0.99', '393', '2007-04-29T06:10:20.996577', '8448', '2'), + ('4.99', '393', '2007-03-19T19:31:25.996577', '13357', '2'), + ('2.99', '393', '2007-04-07T13:12:17.996577', '4275', '2'), + ('4.99', '393', '2007-03-18T13:36:55.996577', '12563', '1'), + ('7.99', '393', '2007-04-08T14:55:50.996577', '4791', '2'), + ('4.99', '393', '2007-04-28T13:42:33.996577', '8004', '2'), + ('0.99', '393', '2007-03-23T02:13:17.996577', '15527', '2'), + ('2.99', '393', '2007-02-18T01:45:20.996577', '2219', '2'), + ('3.99', '393', '2007-03-23T21:18:38.996577', '16049', '2'), + ('8.99', '393', '2007-04-26T21:28:27.996577', '6930', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['20712', '26607', '26600', '26611', '26610', '20708', '20711', '26603', '17719', '17718', '20716', '17722', '20715', '20709', '26604', '20714', '17721', '29176', '22846', '22847', '29178', '18559', '22845', '29179', '29181', '18558', '29174', '29177', '29175', '29182', '18560', '22843', '22848', '22844', '29180', '26420', '20540', '26422', '20541', '26427', '20539', '20544', '26423', '26426', '17637', '17638', '26425', '20547', '26431', '26418', '26430', '20543', '26428', '26417', '26429', '26424', '26421', '26419', '20546', '20542', '20545', '20548', '25474', '25480', '19794', '25488', '19791', '31927', '25479', '19793', '19798', '25473', '19797', '25478', '25482', '19796', '25477', '25476', '25483', '25489', '19792', '25475', '25487', '19795', '25485', '25486', '25491', '25490', '25481', '25484', '28517', '22348', '28522', '28523', '22346', '28516', '28519', '18346', '28520', '28521']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('4.99', '393', '2007-03-19T12:44:44.996577', '13184', '1'), + ('0.99', '393', '2007-04-27T17:57:50.996577', '7486', '2'), + ('8.99', '393', '2007-04-08T02:47:02.996577', '4546', '2'), + ('1.99', '393', '2007-04-30T21:08:57.996577', '10158', '1'), + ('7.99', '393', '2007-04-30T08:02:29.996577', '9763', '2'), + ('2.99', '393', '2007-03-17T19:37:49.996577', '12059', '2'), + ('0.99', '393', '2007-03-18T18:03:06.996577', '12676', '1'), + ('4.99', '393', '2007-04-09T04:42:56.996577', '5099', '1'), + ('1.99', '393', '2007-02-17T03:56:54.996577', '1915', '2'), + ('6.99', '393', '2007-02-16T05:10:01.996577', '1611', '1'), + ('3.99', '393', '2007-03-22T17:45:34.996577', '15284', '2'), + ('2.99', '393', '2007-02-20T08:18:42.996577', '3001', '2'), + ('2.99', '393', '2007-03-22T11:39:51.996577', '15132', '1'), + ('1.99', '393', '2007-03-17T21:29:26.996577', '12113', '1'), + ('2.99', '393', '2007-04-11T11:52:53.996577', '6221', '1'), + ('1.99', '393', '2007-03-20T10:44:07.996577', '13788', '2'), + ('4.99', '393', '2007-02-18T07:52:48.996577', '2319', '1'), + ('1.99', '17', '2007-04-12T19:21:07.996577', '6884', '2'), + ('2.99', '17', '2007-03-21T06:44:07.996577', '14326', '2'), + ('2.99', '17', '2007-03-21T07:10:52.996577', '14346', '1'), + ('2.99', '17', '2007-04-28T22:05:59.996577', '8213', '1'), + ('8.99', '17', '2007-02-19T10:57:34.996577', '2684', '1'), + ('2.99', '17', '2007-03-20T20:12:10.996577', '14040', '1'), + ('8.99', '17', '2007-04-30T06:59:22.996577', '9092', '2'), + ('8.99', '17', '2007-04-30T17:52:10.996577', '9382', '2'), + ('5.99', '17', '2007-02-17T22:46:24.996577', '2175', '2'), + ('3.99', '17', '2007-04-10T09:15:23.996577', '5714', '1'), + ('8.99', '17', '2007-04-28T16:14:24.996577', '8076', '2'), + ('3.99', '17', '2007-04-10T17:53:47.996577', '5883', '1'), + ('0.99', '17', '2007-04-30T22:11:58.996577', '9489', '1'), + ('5.99', '17', '2007-02-21T03:34:56.996577', '3269', '2'), + ('4.99', '17', '2007-03-17T16:54:48.996577', '11990', '2'), + ('5.99', '17', '2007-03-23T11:10:04.996577', '15752', '2'), + ('2.99', '17', '2007-03-20T08:53:07.996577', '13732', '1'), + ('2.99', '17', '2007-04-30T08:40:18.996577', '9138', '1'), + ('3.99', '376', '2007-04-07T16:20:25.996577', '4320', '1'), + ('3.99', '376', '2007-03-01T21:09:05.996577', '10810', '1'), + ('4.99', '376', '2007-04-08T17:42:31.996577', '4869', '1'), + ('4.99', '376', '2007-03-02T08:07:43.996577', '11144', '1'), + ('2.99', '376', '2007-04-28T23:55:20.996577', '8269', '1'), + ('3.99', '376', '2007-03-01T06:28:05.996577', '10413', '2'), + ('0.99', '376', '2007-03-19T06:19:01.996577', '13009', '1'), + ('4.99', '376', '2007-04-10T06:59:32.996577', '5675', '1'), + ('2.99', '376', '2007-04-12T16:02:19.996577', '6807', '2'), + ('0.99', '376', '2007-02-15T00:58:29.996577', '1208', '2'), + ('0.99', '376', '2007-02-19T16:47:33.996577', '2779', '1'), + ('8.99', '376', '2007-04-12T03:24:56.996577', '6545', '1'), + ('4.99', '376', '2007-03-22T10:33:28.996577', '15107', '1'), + ('0.99', '376', '2007-04-30T11:56:21.996577', '9872', '1'), + ('0.99', '376', '2007-04-07T07:47:54.996577', '4163', '1'), + ('2.99', '376', '2007-04-30T10:25:23.996577', '9828', '1'), + ('4.99', '376', '2007-03-17T11:58:53.996577', '11851', '1'), + ('5.99', '376', '2007-04-29T05:29:11.996577', '8420', '1'), + ('2.99', '376', '2007-04-06T09:34:21.996577', '3719', '2'), + ('4.99', '376', '2007-04-30T08:25:22.996577', '9773', '1'), + ('6.99', '376', '2007-04-12T02:43:01.996577', '6524', '1'), + ('5.99', '376', '2007-04-08T03:16:29.996577', '4554', '1'), + ('8.99', '376', '2007-04-07T08:01:56.996577', '4166', '2'), + ('4.99', '376', '2007-03-20T09:57:16.996577', '13761', '2'), + ('4.99', '376', '2007-03-17T09:32:19.996577', '11792', '2'), + ('0.99', '376', '2007-03-19T11:10:07.996577', '13141', '1'), + ('2.99', '376', '2007-03-22T20:59:16.996577', '15382', '1'), + ('9.99', '295', '2007-04-06T16:49:39.996577', '3876', '1'), + ('4.99', '295', '2007-04-10T23:42:36.996577', '5994', '2'), + ('4.99', '295', '2007-03-17T19:02:59.996577', '12041', '2'), + ('8.99', '295', '2007-04-30T05:39:30.996577', '9692', '2'), + ('3.99', '295', '2007-03-01T03:55:39.996577', '10349', '1'), + ('0.99', '295', '2007-05-14T13:44:29.996577', '15735', '2'), + ('2.99', '295', '2007-04-09T13:35:43.996577', '5283', '2'), + ('5.99', '295', '2007-03-17T14:21:43.996577', '11913', '2'), + ('6.99', '295', '2007-03-21T13:20:18.996577', '14514', '1'), + ('1.99', '295', '2007-04-05T22:27:41.996577', '3496', '2'), + ('6.99', '295', '2007-03-21T08:38:27.996577', '14387', '1'), + ('4.99', '295', '2007-04-09T02:28:12.996577', '5053', '2'), + ('3.99', '295', '2007-04-11T17:45:47.996577', '6331', '2'), + ('0.99', '295', '2007-03-21T04:46:48.996577', '14264', '1'), + ('2.99', '295', '2007-04-09T00:32:58.996577', '5019', '1'), + ('1.99', '295', '2007-04-07T21:08:28.996577', '4432', '1'), + ('0.99', '295', '2007-04-28T16:49:42.996577', '8087', '2'), + ('4.99', '295', '2007-04-30T09:13:37.996577', '9793', '2'), + ('4.99', '295', '2007-03-02T06:00:27.996577', '11083', '2'), + ('1.99', '295', '2007-04-07T07:48:37.996577', '4164', '1'), + ('7.99', '295', '2007-04-30T19:39:47.996577', '9425', '1'), + ('0.99', '295', '2007-03-18T07:04:29.996577', '12383', '1'), + ('9.99', '295', '2007-04-29T21:24:04.996577', '8840', '1'), + ('2.99', '295', '2007-04-30T00:59:52.996577', '8932', '2'), + ('0.99', '295', '2007-04-30T23:46:08.996577', '10222', '2'), + ('4.99', '295', '2007-04-30T21:36:06.996577', '10160', '2'), + ('2.99', '295', '2007-04-11T13:34:55.996577', '6252', '1'), + ('7.99', '295', '2007-04-28T17:36:04.996577', '8108', '1'), + ('4.99', '567', '2007-04-08T21:25:36.996577', '4949', '1'), + ('2.99', '567', '2007-03-17T21:45:10.996577', '12119', '1'), + ('2.99', '567', '2007-04-29T12:35:01.996577', '8629', '1'), + ('7.99', '567', '2007-04-30T13:43:47.996577', '9279', '1'), + ('7.99', '567', '2007-03-01T17:11:54.996577', '10708', '2'), + ('0.99', '567', '2007-04-08T04:19:45.996577', '4576', '2'), + ('0.99', '567', '2007-04-12T03:32:09.996577', '6551', '2'), + ('2.99', '567', '2007-02-20T08:58:25.996577', '3010', '1'), + ('2.99', '567', '2007-04-27T12:46:36.996577', '7340', '2'), + ('2.99', '567', '2007-04-28T21:39:14.996577', '8201', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['18345', '22349', '28514', '28518', '22350', '28524', '22352', '22351', '22347', '28515', '23136', '29516', '18687', '23127', '29512', '23133', '23131', '29513', '23130', '23129', '29511', '18689', '23125', '29515', '29514', '23123', '23135', '23121', '29518', '29517', '23126', '23124', '23132', '18688', '18686', '23122', '18690', '23128', '18692', '18691', '23134', '25559', '25556', '25561', '25560', '19857', '19853', '19856', '25555', '25554', '25558', '25553', '25557', '19855', '19854', '25562', '19243', '19244', '31157', '31153', '31159', '24518', '19240', '19239', '19241', '32073', '31154', '19242', '31156', '31160', '31152', '31155', '31158', '24519', '26123', '26124', '26130', '26128', '17545', '26126', '20307', '26129', '26132', '20304', '20306', '26127', '20303', '26131', '26121', '20302', '20305', '26122', '26120', '20301', '17547', '17546', '26125', '29497', '29492', '29496']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('4.99', '567', '2007-02-19T11:27:19.996577', '2689', '2'), + ('2.99', '567', '2007-03-19T06:58:30.996577', '13031', '2'), + ('5.99', '567', '2007-04-06T11:39:59.996577', '3769', '1'), + ('2.99', '567', '2007-04-11T19:31:38.996577', '6358', '2'), + ('2.99', '567', '2007-03-22T00:26:41.996577', '14839', '2'), + ('6.99', '567', '2007-04-30T21:34:59.996577', '9475', '1'), + ('10.99', '567', '2007-03-23T04:47:09.996577', '15594', '2'), + ('5.99', '567', '2007-03-22T09:31:18.996577', '15074', '2'), + ('2.99', '567', '2007-03-17T07:32:29.996577', '11749', '2'), + ('0.99', '567', '2007-04-07T22:14:04.996577', '4457', '2'), + ('5.99', '46', '2007-03-23T11:15:52.996577', '15758', '1'), + ('8.99', '46', '2007-04-30T05:05:23.996577', '9045', '2'), + ('4.99', '46', '2007-02-15T01:47:06.996577', '1214', '2'), + ('4.99', '46', '2007-03-18T03:17:53.996577', '12280', '2'), + ('4.99', '46', '2007-04-06T18:47:16.996577', '3916', '1'), + ('4.99', '46', '2007-03-22T04:22:29.996577', '14940', '1'), + ('4.99', '46', '2007-03-21T00:39:23.996577', '14144', '2'), + ('4.99', '46', '2007-04-10T08:15:26.996577', '5698', '2'), + ('0.99', '46', '2007-03-19T14:34:02.996577', '13226', '1'), + ('4.99', '46', '2007-03-18T09:48:13.996577', '12455', '2'), + ('2.99', '46', '2007-04-06T15:32:14.996577', '3855', '2'), + ('2.99', '46', '2007-02-18T00:39:08.996577', '2203', '1'), + ('4.99', '46', '2007-03-17T21:01:03.996577', '12095', '2'), + ('3.99', '46', '2007-04-28T19:21:31.996577', '8152', '2'), + ('0.99', '46', '2007-04-27T12:40:11.996577', '7336', '1'), + ('5.99', '46', '2007-03-01T21:41:26.996577', '10827', '1'), + ('0.99', '46', '2007-03-23T09:04:17.996577', '15708', '1'), + ('4.99', '46', '2007-03-01T06:58:37.996577', '10428', '2'), + ('2.99', '46', '2007-04-30T18:44:47.996577', '10088', '1'), + ('2.99', '46', '2007-04-30T09:42:15.996577', '9806', '2'), + ('2.99', '46', '2007-03-18T01:53:34.996577', '12238', '2'), + ('0.99', '46', '2007-03-17T06:17:43.996577', '11721', '1'), + ('6.99', '46', '2007-03-21T13:36:31.996577', '14528', '2'), + ('0.99', '46', '2007-02-17T20:34:06.996577', '2144', '2'), + ('4.99', '46', '2007-02-14T21:45:29.996577', '1166', '1'), + ('4.99', '46', '2007-03-01T20:50:33.996577', '10803', '1'), + ('8.99', '46', '2007-02-20T06:02:04.996577', '2965', '2'), + ('2.99', '46', '2007-03-18T03:58:57.996577', '12298', '1'), + ('4.99', '46', '2007-02-21T18:04:41.996577', '3439', '2'), + ('4.99', '46', '2007-02-20T06:34:44.996577', '2975', '2'), + ('2.99', '46', '2007-03-22T23:00:23.996577', '15438', '1'), + ('6.99', '301', '2007-04-12T17:22:00.996577', '6833', '2'), + ('4.99', '301', '2007-04-09T23:28:26.996577', '5511', '2'), + ('4.99', '301', '2007-04-28T06:53:26.996577', '7818', '2'), + ('4.99', '301', '2007-04-27T11:53:57.996577', '7318', '2'), + ('1.99', '301', '2007-03-22T17:07:37.996577', '15268', '1'), + ('0.99', '301', '2007-03-01T23:15:45.996577', '10883', '1'), + ('10.99', '301', '2007-03-22T14:53:08.996577', '15201', '1'), + ('6.99', '301', '2007-04-09T05:42:44.996577', '5119', '1'), + ('3.99', '301', '2007-04-08T16:36:11.996577', '4834', '2'), + ('2.99', '301', '2007-04-10T13:44:56.996577', '5807', '2'), + ('4.99', '301', '2007-04-07T16:12:48.996577', '4316', '2'), + ('2.99', '301', '2007-04-10T09:56:58.996577', '5730', '2'), + ('2.99', '301', '2007-03-20T05:42:13.996577', '13633', '2'), + ('5.99', '301', '2007-03-19T12:37:52.996577', '13183', '2'), + ('4.99', '301', '2007-04-30T19:59:28.996577', '9435', '2'), + ('4.99', '191', '2007-02-17T13:38:42.996577', '2051', '1'), + ('2.99', '191', '2007-02-19T01:35:28.996577', '2555', '2'), + ('2.99', '191', '2007-04-27T19:30:28.996577', '7520', '1'), + ('5.99', '191', '2007-04-09T18:12:17.996577', '5397', '2'), + ('4.99', '191', '2007-04-30T14:54:55.996577', '9297', '1'), + ('2.99', '191', '2007-03-01T10:35:01.996577', '10532', '2'), + ('0.99', '191', '2007-02-15T06:37:38.996577', '1278', '1'), + ('2.99', '191', '2007-02-14T22:23:12.996577', '1173', '2'), + ('2.99', '191', '2007-02-16T09:35:37.996577', '1677', '1'), + ('0.99', '191', '2007-05-14T13:44:29.996577', '14361', '1'), + ('5.99', '191', '2007-04-10T20:09:49.996577', '5924', '1'), + ('2.99', '191', '2007-02-17T00:53:02.996577', '1870', '2'), + ('3.99', '191', '2007-04-27T16:47:01.996577', '7450', '1'), + ('4.99', '191', '2007-04-30T14:46:05.996577', '9964', '1'), + ('2.99', '191', '2007-04-09T15:35:33.996577', '5338', '1'), + ('6.99', '191', '2007-04-27T05:39:40.996577', '7150', '1'), + ('0.99', '191', '2007-04-29T10:33:16.996577', '8583', '2'), + ('4.99', '191', '2007-03-22T20:40:28.996577', '15375', '2'), + ('5.99', '351', '2007-04-08T13:20:11.996577', '4761', '2'), + ('0.99', '351', '2007-04-09T13:23:33.996577', '5280', '1'), + ('4.99', '351', '2007-04-29T08:16:29.996577', '8512', '2'), + ('5.99', '351', '2007-04-12T14:33:06.996577', '6777', '2'), + ('5.99', '351', '2007-02-16T18:33:16.996577', '1792', '2'), + ('3.99', '351', '2007-04-11T09:35:16.996577', '6180', '2'), + ('2.99', '351', '2007-03-23T11:30:09.996577', '15762', '1'), + ('4.99', '351', '2007-04-27T23:29:29.996577', '7630', '2'), + ('0.99', '351', '2007-04-30T19:49:25.996577', '10119', '2'), + ('4.99', '351', '2007-03-22T12:12:58.996577', '15142', '2'), + ('2.99', '351', '2007-03-23T09:12:22.996577', '15712', '2'), + ('4.99', '351', '2007-04-12T09:56:48.996577', '6664', '1'), + ('6.99', '351', '2007-03-21T08:00:13.996577', '14368', '1'), + ('7.99', '351', '2007-04-30T06:12:44.996577', '9707', '1'), + ('0.99', '351', '2007-04-08T02:39:30.996577', '4544', '1'), + ('0.99', '351', '2007-03-02T07:29:25.996577', '11127', '2'), + ('4.99', '351', '2007-03-23T07:25:37.996577', '15664', '1'), + ('1.99', '351', '2007-04-08T12:52:26.996577', '4756', '1'), + ('2.99', '351', '2007-04-06T14:54:30.996577', '3836', '1'), + ('2.99', '351', '2007-03-01T09:33:12.996577', '10501', '2'), + ('2.99', '351', '2007-02-19T15:38:50.996577', '2759', '1'), + ('0.99', '351', '2007-02-17T00:36:26.996577', '1869', '1'), + ('3.99', '351', '2007-04-10T19:26:48.996577', '5912', '1'), + ('4.99', '44', '2007-04-10T19:14:39.996577', '5909', '2'), + ('0.99', '44', '2007-04-07T19:27:32.996577', '4390', '2'), + ('6.99', '44', '2007-04-10T16:00:59.996577', '5849', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['18677', '23108', '29495', '18680', '23107', '18679', '23105', '29501', '23106', '29499', '29494', '29498', '23103', '32027', '23104', '29493', '18678', '29500', '20752', '20745', '26648', '20746', '26649', '20754', '20750', '26645', '26650', '20751', '26651', '20743', '26642', '26652', '20744', '20755', '20749', '20747', '20753', '20748', '26643', '26654', '17733', '26646', '26653', '26647', '17734', '26644', '26054', '20256', '17526', '20248', '20252', '26055', '26066', '26062', '26056', '26061', '26063', '17527', '26058', '17528', '26059', '20247', '20255', '26065', '20251', '20246', '26060', '26053', '20254', '26064', '20257', '20249', '26057', '20250', '20253', '26052', '31041', '24404', '24405', '24409', '31029', '24402', '31030', '31033', '24407', '31035', '19191', '31040', '31037', '31038', '31031', '24410', '31036', '24403', '19192', '24408', '31034', '24401', '31039', '24406']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('3.99', '44', '2007-02-15T20:25:05.996577', '1497', '1'), + ('2.99', '44', '2007-03-22T08:42:59.996577', '15054', '2'), + ('8.99', '44', '2007-04-10T12:37:15.996577', '5787', '1'), + ('4.99', '44', '2007-02-19T22:30:02.996577', '2866', '2'), + ('4.99', '44', '2007-03-19T05:35:00.996577', '12982', '2'), + ('3.99', '44', '2007-02-19T18:08:53.996577', '2809', '1'), + ('4.99', '44', '2007-03-18T11:45:33.996577', '12504', '1'), + ('4.99', '44', '2007-04-29T22:26:45.996577', '8866', '1'), + ('6.99', '44', '2007-03-18T22:45:20.996577', '12790', '1'), + ('6.99', '44', '2007-04-27T19:42:13.996577', '7526', '2'), + ('3.99', '44', '2007-04-10T01:29:35.996577', '5551', '1'), + ('0.99', '44', '2007-04-27T19:20:15.996577', '7514', '1'), + ('2.99', '44', '2007-03-02T16:22:02.996577', '11364', '1'), + ('4.99', '44', '2007-05-14T13:44:29.996577', '13428', '2'), + ('3.99', '44', '2007-03-18T05:45:24.996577', '12345', '2'), + ('9.99', '44', '2007-04-08T11:13:25.996577', '4723', '2'), + ('2.99', '44', '2007-02-18T12:53:55.996577', '2369', '1'), + ('4.99', '44', '2007-04-29T18:34:04.996577', '8775', '2'), + ('4.99', '397', '2007-03-18T21:57:51.996577', '12772', '1'), + ('1.99', '397', '2007-03-01T19:53:21.996577', '10785', '1'), + ('2.99', '397', '2007-04-11T14:14:05.996577', '6266', '2'), + ('4.99', '397', '2007-03-16T22:08:25.996577', '11511', '2'), + ('4.99', '397', '2007-04-11T23:59:32.996577', '6471', '1'), + ('6.99', '397', '2007-03-21T23:02:43.996577', '14790', '1'), + ('0.99', '397', '2007-03-18T18:53:12.996577', '12700', '2'), + ('4.99', '397', '2007-04-10T03:16:55.996577', '5598', '2'), + ('2.99', '397', '2007-04-27T13:16:01.996577', '7356', '2'), + ('2.99', '397', '2007-03-18T20:13:12.996577', '12726', '2'), + ('4.99', '397', '2007-04-28T09:15:24.996577', '7892', '2'), + ('0.99', '397', '2007-03-01T10:43:37.996577', '10534', '1'), + ('5.99', '397', '2007-04-05T22:02:06.996577', '3489', '1'), + ('6.99', '397', '2007-04-28T17:18:40.996577', '8103', '1'), + ('4.99', '397', '2007-03-01T12:52:02.996577', '10598', '2'), + ('6.99', '397', '2007-03-22T09:46:03.996577', '15083', '1'), + ('1.99', '397', '2007-03-18T05:12:56.996577', '12329', '2'), + ('2.99', '397', '2007-03-18T01:27:06.996577', '12223', '2'), + ('3.99', '397', '2007-03-20T22:59:33.996577', '14100', '2'), + ('0.99', '397', '2007-03-18T03:11:48.996577', '12276', '1'), + ('0.99', '397', '2007-04-07T01:16:26.996577', '4036', '1'), + ('1.99', '397', '2007-04-30T02:20:18.996577', '9608', '2'), + ('5.99', '397', '2007-02-16T16:36:14.996577', '1769', '1'), + ('4.99', '397', '2007-04-10T11:26:38.996577', '5763', '2'), + ('0.99', '397', '2007-04-30T22:22:52.996577', '9495', '1'), + ('2.99', '397', '2007-04-11T00:31:21.996577', '6014', '2'), + ('1.99', '397', '2007-02-20T10:18:56.996577', '3027', '2'), + ('4.99', '397', '2007-04-09T05:03:06.996577', '5103', '2'), + ('4.99', '346', '2007-04-09T19:41:16.996577', '5428', '1'), + ('5.99', '346', '2007-03-23T13:39:08.996577', '15825', '2'), + ('5.99', '346', '2007-02-17T09:35:32.996577', '1994', '1'), + ('0.99', '346', '2007-03-01T10:14:43.996577', '10521', '2'), + ('5.99', '346', '2007-03-22T02:39:15.996577', '14890', '1'), + ('4.99', '346', '2007-04-10T01:38:47.996577', '5557', '2'), + ('2.99', '346', '2007-04-30T13:40:39.996577', '9927', '1'), + ('0.99', '346', '2007-04-29T09:30:23.996577', '8543', '2'), + ('4.99', '346', '2007-04-11T07:02:35.996577', '6136', '2'), + ('6.99', '346', '2007-04-29T07:51:18.996577', '8505', '1'), + ('8.99', '346', '2007-04-29T16:53:29.996577', '8732', '2'), + ('2.99', '346', '2007-02-21T12:02:45.996577', '3372', '2'), + ('8.99', '346', '2007-04-12T19:15:01.996577', '6881', '2'), + ('2.99', '346', '2007-02-21T15:51:24.996577', '3421', '1'), + ('6.99', '346', '2007-04-28T11:19:21.996577', '7943', '2'), + ('3.99', '346', '2007-03-01T05:15:09.996577', '10389', '2'), + ('8.99', '346', '2007-03-23T07:20:29.996577', '15661', '1'), + ('4.99', '346', '2007-04-30T11:12:59.996577', '9848', '1'), + ('2.99', '346', '2007-03-02T20:16:54.996577', '11470', '2'), + ('5.99', '346', '2007-03-01T02:42:38.996577', '10304', '1'), + ('5.99', '346', '2007-04-28T23:58:17.996577', '8272', '2'), + ('8.99', '346', '2007-04-08T21:48:18.996577', '4958', '1'), + ('0.99', '346', '2007-03-23T02:26:28.996577', '15535', '1'), + ('4.99', '346', '2007-04-30T01:00:36.996577', '9566', '2'), + ('0.99', '346', '2007-03-23T13:43:45.996577', '15827', '1'), + ('4.99', '346', '2007-03-02T05:21:20.996577', '11062', '2'), + ('2.99', '346', '2007-04-11T17:30:45.996577', '6323', '2'), + ('4.99', '346', '2007-03-02T16:43:22.996577', '11375', '1'), + ('2.99', '346', '2007-03-22T23:38:14.996577', '15459', '2'), + ('4.99', '346', '2007-04-07T20:35:57.996577', '4420', '2'), + ('4.99', '179', '2007-04-30T21:04:26.996577', '10156', '1'), + ('0.99', '179', '2007-03-19T14:50:40.996577', '13240', '2'), + ('4.99', '179', '2007-03-19T20:40:10.996577', '13400', '1'), + ('0.99', '179', '2007-03-21T15:57:21.996577', '14589', '1'), + ('0.99', '179', '2007-04-06T15:06:24.996577', '3844', '1'), + ('3.99', '179', '2007-03-01T11:46:49.996577', '10569', '2'), + ('2.99', '179', '2007-04-08T06:28:46.996577', '4618', '1'), + ('2.99', '179', '2007-04-12T16:00:09.996577', '6806', '1'), + ('0.99', '179', '2007-03-20T16:37:30.996577', '13957', '2'), + ('4.99', '179', '2007-04-27T02:11:54.996577', '7054', '1'), + ('7.99', '179', '2007-02-15T07:09:39.996577', '1286', '2'), + ('0.99', '179', '2007-04-30T12:35:47.996577', '9893', '2'), + ('2.99', '179', '2007-04-29T10:19:51.996577', '8573', '1'), + ('8.99', '179', '2007-04-29T16:52:23.996577', '8731', '1'), + ('6.99', '179', '2007-04-11T03:18:29.996577', '6071', '2'), + ('4.99', '179', '2007-03-23T18:48:49.996577', '15985', '1'), + ('4.99', '179', '2007-04-27T22:39:26.996577', '7609', '1'), + ('0.99', '179', '2007-03-02T15:40:01.996577', '11342', '1'), + ('4.99', '179', '2007-02-19T05:54:16.996577', '2613', '1'), + ('7.99', '179', '2007-03-20T22:10:26.996577', '14082', '2'), + ('6.99', '179', '2007-04-27T01:22:51.996577', '7028', '1'), + ('4.99', '179', '2007-03-01T05:08:21.996577', '10385', '1'), + ('4.99', '179', '2007-04-30T22:13:49.996577', '9491', '2'), + ('7.99', '179', '2007-03-20T12:58:52.996577', '13844', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['31028', '31032', '21060', '17846', '21063', '21058', '17842', '27017', '27020', '27015', '27019', '21061', '21059', '17844', '27014', '27016', '27018', '21057', '17843', '17845', '17841', '21062', '31410', '31411', '31412', '31416', '24752', '19339', '31409', '31408', '31407', '24751', '31406', '24750', '19338', '31414', '31415', '31413', '23669', '23672', '30194', '23668', '23670', '23674', '23673', '30199', '30192', '30189', '23675', '30193', '30190', '18909', '30191', '30195', '18910', '30197', '23671', '30198', '30196', '26994', '21052', '26997', '17836', '17833', '26995', '27004', '21051', '27001', '26996', '26998', '26999', '27003', '27002', '27000', '17832', '17834', '17835', '21053', '29536', '23144', '29531', '29532', '29530', '23143', '29535', '18696', '29533', '29529', '23145', '29534', '18697', '23146', '29608', '23214', '23216', '18722', '18724', '23215', '29606', '18725']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('6.99', '179', '2007-04-06T07:29:55.996577', '3671', '1'), + ('7.99', '179', '2007-04-12T07:05:56.996577', '6616', '1'), + ('0.99', '430', '2007-03-19T22:48:33.996577', '13452', '2'), + ('0.99', '430', '2007-02-20T19:12:41.996577', '3153', '2'), + ('4.99', '430', '2007-03-22T07:40:14.996577', '15031', '1'), + ('4.99', '430', '2007-03-19T05:01:26.996577', '12965', '1'), + ('2.99', '430', '2007-02-15T06:21:18.996577', '1274', '1'), + ('6.99', '430', '2007-04-10T22:00:17.996577', '5958', '1'), + ('2.99', '430', '2007-04-30T20:32:30.996577', '9450', '2'), + ('5.99', '430', '2007-04-09T10:25:16.996577', '5217', '1'), + ('4.99', '430', '2007-04-29T09:55:53.996577', '8560', '1'), + ('2.99', '430', '2007-03-19T22:59:18.996577', '13454', '2'), + ('0.99', '430', '2007-03-19T06:16:09.996577', '13007', '1'), + ('6.99', '430', '2007-02-16T16:15:03.996577', '1759', '1'), + ('4.99', '430', '2007-04-08T23:45:34.996577', '5002', '1'), + ('6.99', '430', '2007-04-10T17:41:13.996577', '5879', '2'), + ('0.99', '430', '2007-04-11T01:46:36.996577', '6043', '2'), + ('0.99', '430', '2007-03-18T20:02:42.996577', '12723', '1'), + ('2.99', '430', '2007-02-15T23:34:16.996577', '1538', '1'), + ('0.99', '430', '2007-02-20T00:35:05.996577', '2892', '2'), + ('0.99', '430', '2007-02-15T00:55:34.996577', '1207', '2'), + ('5.99', '430', '2007-03-20T20:53:01.996577', '14058', '1'), + ('2.99', '222', '2007-04-11T06:43:35.996577', '6129', '2'), + ('0.99', '222', '2007-04-12T01:32:55.996577', '6497', '1'), + ('0.99', '222', '2007-04-28T05:46:52.996577', '7786', '2'), + ('1.99', '222', '2007-04-30T17:30:33.996577', '10043', '2'), + ('2.99', '222', '2007-03-21T07:27:04.996577', '14350', '2'), + ('6.99', '222', '2007-02-19T04:49:51.996577', '2603', '2'), + ('5.99', '222', '2007-04-10T04:57:05.996577', '5635', '2'), + ('6.99', '222', '2007-04-10T02:54:39.996577', '5592', '2'), + ('3.99', '222', '2007-04-09T12:46:06.996577', '5266', '1'), + ('2.99', '222', '2007-03-19T23:35:26.996577', '13477', '1'), + ('8.99', '222', '2007-04-09T09:51:05.996577', '5209', '2'), + ('2.99', '222', '2007-03-17T23:49:47.996577', '12179', '2'), + ('8.99', '222', '2007-02-15T12:56:13.996577', '1368', '1'), + ('6.99', '222', '2007-04-29T11:24:21.996577', '8597', '2'), + ('4.99', '222', '2007-04-29T19:12:15.996577', '8787', '1'), + ('1.99', '222', '2007-04-29T01:26:25.996577', '8300', '1'), + ('8.99', '106', '2007-03-01T07:30:06.996577', '10444', '1'), + ('2.99', '106', '2007-03-19T00:31:03.996577', '12845', '1'), + ('3.99', '106', '2007-04-27T08:12:52.996577', '7224', '1'), + ('2.99', '106', '2007-03-01T00:11:44.996577', '10228', '1'), + ('0.99', '106', '2007-03-02T18:44:32.996577', '11436', '2'), + ('0.99', '106', '2007-03-22T03:37:24.996577', '14920', '1'), + ('2.99', '106', '2007-03-21T09:59:41.996577', '14431', '2'), + ('8.99', '106', '2007-04-30T23:31:44.996577', '10213', '2'), + ('3.99', '106', '2007-04-09T20:52:37.996577', '5453', '2'), + ('4.99', '106', '2007-04-07T11:11:49.996577', '4229', '1'), + ('6.99', '106', '2007-03-22T12:56:03.996577', '15154', '1'), + ('0.99', '106', '2007-04-26T23:33:11.996577', '6992', '2'), + ('2.99', '106', '2007-04-07T13:20:38.996577', '4277', '2'), + ('4.99', '106', '2007-02-18T06:24:44.996577', '2295', '1'), + ('3.99', '106', '2007-04-08T08:32:50.996577', '4665', '1'), + ('4.99', '106', '2007-04-27T17:53:26.996577', '7483', '1'), + ('4.99', '106', '2007-02-20T09:46:37.996577', '3023', '1'), + ('2.99', '106', '2007-04-30T06:14:15.996577', '9072', '2'), + ('7.99', '106', '2007-03-17T23:04:35.996577', '12159', '1'), + ('7.99', '106', '2007-04-30T07:45:23.996577', '9747', '2'), + ('4.99', '106', '2007-04-28T17:42:43.996577', '8115', '1'), + ('2.99', '428', '2007-04-06T08:42:22.996577', '3702', '1'), + ('2.99', '428', '2007-03-01T23:21:11.996577', '10888', '2'), + ('4.99', '428', '2007-04-09T17:17:23.996577', '5373', '1'), + ('0.99', '428', '2007-02-21T12:19:38.996577', '3377', '2'), + ('2.99', '428', '2007-02-15T19:21:52.996577', '1471', '2'), + ('5.99', '428', '2007-04-06T19:10:10.996577', '3925', '1'), + ('2.99', '428', '2007-04-30T15:37:28.996577', '9982', '2'), + ('4.99', '428', '2007-03-01T12:15:04.996577', '10577', '2'), + ('4.99', '428', '2007-04-29T04:15:53.996577', '8387', '2'), + ('0.99', '428', '2007-04-07T07:17:28.996577', '4151', '1'), + ('5.99', '428', '2007-04-12T12:36:46.996577', '6735', '1'), + ('6.99', '428', '2007-04-28T07:01:19.996577', '7823', '1'), + ('5.99', '428', '2007-04-30T13:02:43.996577', '9904', '1'), + ('4.99', '428', '2007-04-29T08:52:48.996577', '8528', '2'), + ('2.99', '428', '2007-04-28T19:25:32.996577', '8155', '1'), + ('3.99', '428', '2007-02-15T02:18:29.996577', '1227', '1'), + ('3.99', '428', '2007-02-16T04:39:39.996577', '1601', '1'), + ('2.99', '428', '2007-02-19T10:30:25.996577', '2677', '1'), + ('0.99', '428', '2007-03-16T23:08:29.996577', '11536', '2'), + ('7.99', '48', '2007-04-30T07:38:46.996577', '9742', '2'), + ('1.99', '48', '2007-03-21T10:49:51.996577', '14450', '2'), + ('6.99', '48', '2007-04-09T06:51:12.996577', '5148', '2'), + ('3.99', '48', '2007-04-12T01:34:04.996577', '6498', '2'), + ('2.99', '48', '2007-04-07T18:20:27.996577', '4367', '1'), + ('2.99', '48', '2007-03-01T01:50:49.996577', '10276', '2'), + ('7.99', '48', '2007-04-30T18:46:53.996577', '9402', '1'), + ('9.99', '48', '2007-02-16T10:47:07.996577', '1689', '2'), + ('2.99', '48', '2007-04-28T10:29:45.996577', '7920', '1'), + ('4.99', '48', '2007-04-06T11:11:37.996577', '3758', '2'), + ('2.99', '48', '2007-03-21T13:51:16.996577', '14536', '2'), + ('6.99', '48', '2007-04-29T16:07:35.996577', '8716', '1'), + ('0.99', '48', '2007-02-19T18:57:50.996577', '2822', '2'), + ('3.99', '48', '2007-03-22T15:55:49.996577', '15228', '1'), + ('4.99', '55', '2007-04-27T02:01:43.996577', '7050', '2'), + ('4.99', '55', '2007-03-18T22:05:59.996577', '12776', '1'), + ('1.99', '55', '2007-03-19T05:11:54.996577', '12972', '2'), + ('2.99', '55', '2007-02-16T20:21:31.996577', '1825', '2'), + ('2.99', '55', '2007-02-20T01:22:32.996577', '2904', '1'), + ('4.99', '55', '2007-03-18T23:09:07.996577', '12808', '1'), + ('4.99', '55', '2007-04-08T08:43:58.996577', '4671', '1'), + ('4.99', '55', '2007-02-20T06:37:37.996577', '2976', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['23219', '23213', '18723', '29612', '29611', '23218', '23217', '18726', '29609', '29610', '29607', '21621', '27652', '27651', '27644', '21624', '18070', '27656', '27648', '21625', '21620', '21615', '27654', '27647', '27645', '27657', '27646', '21616', '27649', '27650', '21618', '21617', '21622', '21623', '27655', '21619', '27653', '23622', '18895', '30111', '30116', '30112', '30114', '23623', '30110', '30113', '23621', '30118', '23620', '30119', '18892', '30109', '30117', '18894', '23624', '30108', '32047', '30115', '18893', '30107', '27368', '21380', '27367', '27362', '27369', '21386', '21387', '17981', '21378', '27365', '21384', '21379', '27361', '21382', '27370', '27360', '27363', '17979', '27358', '17980', '27356', '21376', '27359', '27357', '21377', '27371', '21383', '21381', '27364', '27366', '21385', '30429', '18993', '30428', '23865', '23866', '23868', '30427', '23862', '23860']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('4.99', '55', '2007-03-22T18:05:46.996577', '15296', '1'), + ('1.99', '55', '2007-03-02T13:18:17.996577', '11287', '2'), + ('2.99', '55', '2007-02-17T14:25:09.996577', '2062', '2'), + ('2.99', '55', '2007-04-30T09:23:44.996577', '9798', '2'), + ('5.99', '55', '2007-04-30T01:57:13.996577', '9596', '2'), + ('2.99', '55', '2007-03-21T18:19:37.996577', '14667', '1'), + ('6.99', '55', '2007-03-19T18:53:50.996577', '13345', '1'), + ('4.99', '55', '2007-02-20T19:03:21.996577', '3149', '1'), + ('6.99', '55', '2007-04-29T00:32:48.996577', '8288', '2'), + ('2.99', '55', '2007-04-30T15:03:23.996577', '9302', '1'), + ('7.99', '55', '2007-04-11T17:01:10.996577', '6314', '2'), + ('5.99', '487', '2007-03-17T13:37:09.996577', '11890', '2'), + ('2.99', '487', '2007-04-29T15:07:24.996577', '8689', '2'), + ('1.99', '487', '2007-04-29T08:10:04.996577', '8510', '2'), + ('1.99', '487', '2007-04-06T22:07:27.996577', '3994', '2'), + ('7.99', '487', '2007-03-20T06:30:48.996577', '13658', '1'), + ('3.99', '487', '2007-02-20T15:16:23.996577', '3100', '2'), + ('3.99', '487', '2007-04-30T22:13:35.996577', '9490', '1'), + ('2.99', '487', '2007-04-27T03:24:35.996577', '7097', '1'), + ('2.99', '487', '2007-03-23T07:27:38.996577', '15665', '2'), + ('5.99', '487', '2007-03-17T04:17:17.996577', '11669', '1'), + ('2.99', '487', '2007-03-01T10:00:42.996577', '10511', '2'), + ('7.99', '487', '2007-04-30T03:07:15.996577', '8988', '1'), + ('2.99', '487', '2007-04-26T21:24:47.996577', '6928', '1'), + ('2.99', '487', '2007-04-08T17:13:10.996577', '4854', '2'), + ('0.99', '487', '2007-04-30T19:59:12.996577', '10123', '2'), + ('3.99', '487', '2007-04-10T04:54:14.996577', '5634', '1'), + ('6.99', '487', '2007-03-01T11:25:04.996577', '10555', '2'), + ('0.99', '487', '2007-04-28T05:50:21.996577', '7788', '1'), + ('4.99', '487', '2007-04-28T11:35:50.996577', '7949', '2'), + ('5.99', '487', '2007-03-01T23:00:30.996577', '10877', '2'), + ('6.99', '487', '2007-03-01T21:53:19.996577', '10832', '1'), + ('7.99', '487', '2007-03-18T11:22:04.996577', '12493', '1'), + ('4.99', '487', '2007-03-19T13:52:04.996577', '13210', '2'), + ('2.99', '487', '2007-04-30T20:51:31.996577', '9457', '2'), + ('9.99', '487', '2007-03-02T02:40:53.996577', '10978', '1'), + ('4.99', '487', '2007-04-29T20:18:09.996577', '8814', '1'), + ('0.99', '100', '2007-03-18T17:30:42.996577', '12657', '1'), + ('6.99', '100', '2007-02-21T21:12:11.996577', '3468', '2'), + ('6.99', '100', '2007-04-08T22:55:25.996577', '4980', '2'), + ('1.99', '100', '2007-04-28T10:31:12.996577', '7921', '1'), + ('4.99', '100', '2007-04-09T11:39:40.996577', '5238', '2'), + ('4.99', '100', '2007-04-12T09:36:58.996577', '6655', '1'), + ('0.99', '100', '2007-03-22T13:11:39.996577', '15163', '1'), + ('8.99', '100', '2007-04-08T22:22:55.996577', '4970', '1'), + ('6.99', '100', '2007-04-09T16:35:43.996577', '5355', '2'), + ('4.99', '100', '2007-03-02T15:44:04.996577', '11346', '2'), + ('5.99', '100', '2007-04-30T05:25:33.996577', '9048', '2'), + ('0.99', '100', '2007-03-02T08:01:20.996577', '11143', '1'), + ('4.99', '100', '2007-04-30T13:32:57.996577', '9271', '1'), + ('4.99', '100', '2007-02-15T01:52:14.996577', '1216', '2'), + ('2.99', '100', '2007-04-07T10:03:34.996577', '4209', '1'), + ('0.99', '100', '2007-04-28T21:43:22.996577', '8203', '2'), + ('2.99', '100', '2007-02-15T16:45:54.996577', '1427', '1'), + ('3.99', '100', '2007-03-22T16:19:15.996577', '15246', '2'), + ('8.99', '100', '2007-04-06T13:29:53.996577', '3800', '1'), + ('0.99', '100', '2007-05-14T13:44:29.996577', '15021', '2'), + ('4.99', '100', '2007-04-28T06:55:40.996577', '7819', '2'), + ('3.99', '100', '2007-02-15T10:52:41.996577', '1340', '1'), + ('5.99', '100', '2007-04-06T03:51:36.996577', '3602', '2'), + ('0.99', '462', '2007-04-29T00:17:30.996577', '8282', '1'), + ('0.99', '462', '2007-03-18T14:19:38.996577', '12582', '2'), + ('2.99', '462', '2007-04-28T15:48:35.996577', '8066', '1'), + ('8.99', '462', '2007-04-27T11:07:13.996577', '7295', '2'), + ('3.99', '462', '2007-04-29T00:52:34.996577', '8290', '1'), + ('2.99', '462', '2007-03-23T17:17:58.996577', '15943', '1'), + ('0.99', '462', '2007-03-23T19:45:43.996577', '16013', '1'), + ('4.99', '462', '2007-02-21T04:34:19.996577', '3279', '1'), + ('2.99', '462', '2007-03-17T10:19:42.996577', '11808', '1'), + ('4.99', '462', '2007-04-28T10:53:20.996577', '7932', '1'), + ('7.99', '462', '2007-03-20T00:00:30.996577', '13492', '1'), + ('4.99', '462', '2007-03-18T10:05:21.996577', '12466', '1'), + ('6.99', '462', '2007-04-12T12:11:24.996577', '6721', '1'), + ('8.99', '462', '2007-03-19T07:34:04.996577', '13041', '2'), + ('2.99', '462', '2007-04-29T17:47:36.996577', '8757', '2'), + ('7.99', '462', '2007-04-12T11:51:35.996577', '6710', '1'), + ('6.99', '462', '2007-04-27T12:11:05.996577', '7324', '1'), + ('5.99', '462', '2007-02-16T16:42:09.996577', '1773', '2'), + ('4.99', '462', '2007-04-12T05:10:57.996577', '6583', '1'), + ('9.99', '462', '2007-02-17T04:52:56.996577', '1926', '2'), + ('4.99', '462', '2007-04-08T00:38:27.996577', '4500', '1'), + ('2.99', '462', '2007-03-01T01:58:11.996577', '10283', '1'), + ('0.99', '462', '2007-04-12T07:58:31.996577', '6630', '1'), + ('3.99', '462', '2007-04-08T11:27:27.996577', '4728', '2'), + ('6.99', '462', '2007-03-17T03:11:55.996577', '11639', '2'), + ('0.99', '462', '2007-04-30T12:34:10.996577', '9891', '1'), + ('4.99', '462', '2007-03-19T18:24:27.996577', '13328', '1'), + ('8.99', '462', '2007-03-18T22:56:07.996577', '12802', '1'), + ('8.99', '462', '2007-04-28T05:02:49.996577', '7762', '1'), + ('2.99', '462', '2007-04-28T11:01:43.996577', '7935', '2'), + ('2.99', '462', '2007-03-23T04:10:39.996577', '15581', '2'), + ('6.99', '127', '2007-04-28T21:57:54.996577', '8209', '2'), + ('2.99', '127', '2007-02-16T19:01:13.996577', '1803', '2'), + ('4.99', '127', '2007-04-28T10:15:24.996577', '7912', '1'), + ('4.99', '127', '2007-03-19T07:35:39.996577', '13043', '2'), + ('2.99', '127', '2007-03-19T09:08:36.996577', '13091', '1'), + ('2.99', '127', '2007-03-21T02:00:43.996577', '14189', '1'), + ('2.99', '127', '2007-04-10T23:02:37.996577', '5983', '2'), + ('0.99', '127', '2007-03-02T11:41:47.996577', '11235', '1'), + ('10.99', '127', '2007-03-01T20:03:27.996577', '10787', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['30424', '23867', '30431', '18992', '23869', '18994', '30430', '23870', '30426', '23863', '30425', '23861', '23864', '27905', '21820', '18146', '27913', '18149', '21819', '21818', '21822', '27912', '27908', '18143', '27910', '27904', '18145', '18147', '27909', '27911', '18150', '18144', '21821', '18148', '27906', '27907', '20299', '20293', '26114', '26113', '20294', '17542', '17541', '20292', '20297', '20298', '17543', '26112', '20296', '17544', '26119', '20295', '26117', '20300', '26116', '26118', '26115', '21229', '21228', '27217', '27218', '17902', '21227', '27212', '27210', '27213', '27215', '21230', '17903', '27211', '21226', '21224', '17901', '27219', '21223', '21219', '27220', '27214', '21225', '17904', '21221', '27216', '21222', '21220', '19947', '19942', '25671', '25669', '19944', '19948', '19945', '25672', '25674', '25673', '25670', '25668', '19946', '19943', '25675', '23460']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('5.99', '127', '2007-04-08T08:16:17.996577', '4652', '1'), + ('2.99', '127', '2007-03-20T19:52:20.996577', '14030', '2'), + ('2.99', '127', '2007-04-30T23:03:51.996577', '10197', '1'), + ('4.99', '127', '2007-02-15T07:34:50.996577', '1293', '1'), + ('5.99', '127', '2007-03-22T23:43:33.996577', '15463', '1'), + ('3.99', '127', '2007-02-18T15:27:24.996577', '2412', '2'), + ('6.99', '127', '2007-04-30T11:31:21.996577', '9859', '1'), + ('5.99', '127', '2007-03-23T10:08:56.996577', '15736', '2'), + ('2.99', '127', '2007-04-09T22:56:11.996577', '5499', '2'), + ('4.99', '127', '2007-03-17T19:40:23.996577', '12060', '2'), + ('5.99', '127', '2007-04-08T15:32:50.996577', '4811', '2'), + ('7.99', '127', '2007-03-02T02:38:08.996577', '10973', '1'), + ('2.99', '127', '2007-03-18T23:33:34.996577', '12820', '2'), + ('4.99', '510', '2007-04-06T23:27:20.996577', '4014', '1'), + ('0.99', '510', '2007-03-18T04:45:32.996577', '12317', '1'), + ('8.99', '510', '2007-02-19T13:34:41.996577', '2729', '1'), + ('0.99', '510', '2007-04-30T20:13:54.996577', '10131', '1'), + ('8.99', '510', '2007-02-21T09:54:55.996577', '3352', '2'), + ('4.99', '510', '2007-03-17T17:03:03.996577', '11996', '2'), + ('7.99', '510', '2007-03-01T01:33:30.996577', '10265', '2'), + ('4.99', '510', '2007-03-22T09:15:10.996577', '15065', '1'), + ('4.99', '510', '2007-04-30T00:38:57.996577', '8926', '1'), + ('2.99', '510', '2007-04-27T17:03:43.996577', '7457', '1'), + ('5.99', '510', '2007-02-15T17:00:56.996577', '1435', '2'), + ('9.99', '510', '2007-04-28T05:56:29.996577', '7794', '2'), + ('2.99', '510', '2007-04-06T10:38:28.996577', '3744', '2'), + ('0.99', '510', '2007-02-17T04:45:13.996577', '1925', '2'), + ('0.99', '510', '2007-02-19T17:59:14.996577', '2806', '2'), + ('8.99', '510', '2007-04-28T01:26:42.996577', '7678', '1'), + ('3.99', '510', '2007-04-29T18:06:50.996577', '8763', '2'), + ('5.99', '510', '2007-02-21T20:38:27.996577', '3465', '2'), + ('0.99', '510', '2007-02-16T16:00:50.996577', '1757', '2'), + ('2.99', '510', '2007-03-18T08:06:28.996577', '12406', '2'), + ('0.99', '510', '2007-02-19T18:33:48.996577', '2817', '2'), + ('4.99', '510', '2007-04-10T16:09:13.996577', '5851', '2'), + ('1.99', '510', '2007-04-12T03:03:50.996577', '6531', '1'), + ('1.99', '350', '2007-03-23T12:25:06.996577', '15789', '2'), + ('6.99', '350', '2007-03-17T01:21:40.996577', '11595', '2'), + ('2.99', '350', '2007-04-08T13:47:19.996577', '4767', '1'), + ('5.99', '350', '2007-04-06T17:27:57.996577', '3893', '1'), + ('6.99', '350', '2007-03-17T05:21:07.996577', '11692', '2'), + ('0.99', '350', '2007-02-19T06:31:38.996577', '2619', '1'), + ('3.99', '350', '2007-02-17T10:24:35.996577', '2011', '2'), + ('0.99', '350', '2007-03-16T21:45:12.996577', '11504', '2'), + ('2.99', '350', '2007-03-18T09:24:46.996577', '12445', '2'), + ('0.99', '350', '2007-03-19T09:00:54.996577', '13086', '2'), + ('2.99', '350', '2007-02-20T13:42:06.996577', '3079', '1'), + ('0.99', '350', '2007-04-05T23:43:52.996577', '3529', '1'), + ('6.99', '350', '2007-03-18T02:28:17.996577', '12252', '2'), + ('0.99', '350', '2007-02-20T23:08:05.996577', '3206', '2'), + ('4.99', '350', '2007-04-27T15:23:51.996577', '7416', '2'), + ('0.99', '350', '2007-03-17T09:58:18.996577', '11800', '1'), + ('1.99', '350', '2007-04-10T12:35:10.996577', '5786', '1'), + ('0.99', '350', '2007-03-23T13:03:36.996577', '15807', '1'), + ('2.99', '350', '2007-04-09T14:12:35.996577', '5303', '1'), + ('3.99', '350', '2007-04-11T21:31:28.996577', '6408', '2'), + ('0.99', '350', '2007-04-09T11:43:14.996577', '5240', '1'), + ('4.99', '447', '2007-03-23T19:08:57.996577', '15997', '1'), + ('2.99', '447', '2007-03-22T10:38:33.996577', '15108', '1'), + ('8.99', '447', '2007-04-29T09:13:20.996577', '8537', '1'), + ('4.99', '447', '2007-04-30T01:40:14.996577', '8945', '2'), + ('2.99', '447', '2007-02-17T02:34:39.996577', '1890', '2'), + ('5.99', '447', '2007-03-21T10:34:58.996577', '14443', '2'), + ('4.99', '447', '2007-04-09T15:22:32.996577', '5331', '1'), + ('4.99', '447', '2007-04-07T19:58:06.996577', '4403', '2'), + ('0.99', '447', '2007-04-10T10:05:54.996577', '5734', '1'), + ('0.99', '447', '2007-04-12T09:25:54.996577', '6651', '1'), + ('4.99', '447', '2007-03-23T20:28:23.996577', '16032', '2'), + ('4.99', '447', '2007-02-17T11:32:26.996577', '2025', '1'), + ('6.99', '447', '2007-04-08T17:21:50.996577', '4858', '1'), + ('4.99', '447', '2007-03-20T13:06:15.996577', '13848', '1'), + ('2.99', '447', '2007-03-19T08:31:56.996577', '13072', '1'), + ('0.99', '447', '2007-02-15T02:32:35.996577', '1230', '2'), + ('5.99', '447', '2007-04-30T06:26:38.996577', '9076', '2'), + ('0.99', '447', '2007-03-18T11:51:45.996577', '12511', '2'), + ('2.99', '447', '2007-03-01T06:51:51.996577', '10425', '1'), + ('6.99', '447', '2007-04-30T14:25:05.996577', '9288', '1'), + ('2.99', '447', '2007-04-10T23:23:57.996577', '5987', '2'), + ('0.99', '447', '2007-03-19T09:53:03.996577', '13110', '2'), + ('4.99', '447', '2007-02-18T05:29:20.996577', '2285', '2'), + ('0.99', '447', '2007-03-02T06:48:27.996577', '11108', '2'), + ('1.99', '447', '2007-04-12T10:51:28.996577', '6690', '1'), + ('5.99', '447', '2007-03-02T20:12:18.996577', '11465', '1'), + ('5.99', '447', '2007-03-02T02:01:56.996577', '10957', '2'), + ('9.99', '311', '2007-03-23T13:43:28.996577', '15826', '2'), + ('4.99', '311', '2007-03-01T07:37:57.996577', '10448', '2'), + ('6.99', '311', '2007-04-28T19:54:11.996577', '8167', '2'), + ('5.99', '311', '2007-04-09T10:35:53.996577', '5224', '2'), + ('0.99', '311', '2007-03-19T17:33:42.996577', '13310', '2'), + ('8.99', '311', '2007-03-23T20:02:59.996577', '16020', '1'), + ('1.99', '311', '2007-03-19T21:36:08.996577', '13423', '2'), + ('2.99', '311', '2007-04-29T07:05:19.996577', '8473', '1'), + ('8.99', '311', '2007-04-30T12:21:59.996577', '9882', '2'), + ('6.99', '311', '2007-04-30T22:31:04.996577', '9503', '1'), + ('4.99', '311', '2007-04-11T22:05:04.996577', '6419', '2'), + ('3.99', '311', '2007-04-08T16:37:34.996577', '4836', '2'), + ('4.99', '311', '2007-03-21T13:25:29.996577', '14517', '2'), + ('2.99', '311', '2007-03-19T06:00:12.996577', '12997', '1'), + ('4.99', '311', '2007-04-30T20:24:36.996577', '10134', '1'), + ('0.99', '81', '2007-03-01T07:45:47.996577', '10456', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['23470', '23463', '29893', '29897', '29896', '18811', '23465', '23464', '18810', '29894', '29892', '29895', '23467', '23469', '23462', '18809', '23466', '23468', '23461', '23471', '25055', '19470', '31813', '25048', '25047', '31796', '31808', '25050', '31806', '31809', '31799', '31810', '25058', '25059', '31801', '31802', '31797', '31811', '25053', '31798', '25046', '31807', '25056', '31805', '25054', '31804', '31812', '25049', '19469', '31800', '25051', '25057', '31803', '25052', '23605', '30080', '18883', '30071', '30076', '30072', '30079', '18881', '18882', '30078', '23603', '30075', '30081', '30073', '30082', '23604', '30074', '30077', '27045', '21079', '27038', '21086', '27041', '27042', '21083', '21081', '27044', '21078', '27050', '27043', '27051', '27047', '27046', '27039', '27040', '21082', '27048', '27049', '21085', '21084', '21080', '25066', '25064', '25061', '31815', '19473']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('2.99', '81', '2007-03-23T14:35:41.996577', '15858', '1'), + ('5.99', '81', '2007-03-20T11:55:03.996577', '13820', '2'), + ('9.99', '81', '2007-04-08T23:02:42.996577', '4983', '2'), + ('3.99', '81', '2007-04-30T20:48:35.996577', '9454', '2'), + ('0.99', '81', '2007-04-28T02:50:40.996577', '7709', '1'), + ('4.99', '81', '2007-02-21T00:49:07.996577', '3229', '1'), + ('3.99', '81', '2007-03-21T17:38:06.996577', '14642', '1'), + ('4.99', '81', '2007-03-21T00:04:24.996577', '14128', '1'), + ('5.99', '81', '2007-02-19T21:40:14.996577', '2854', '1'), + ('0.99', '81', '2007-04-09T21:34:35.996577', '5468', '1'), + ('2.99', '81', '2007-04-06T16:59:46.996577', '3879', '1'), + ('4.99', '81', '2007-04-27T04:52:02.996577', '7130', '2'), + ('5.99', '81', '2007-03-22T15:46:31.996577', '15224', '1'), + ('4.99', '81', '2007-03-23T13:36:26.996577', '15823', '1'), + ('4.99', '81', '2007-03-17T23:56:44.996577', '12181', '2'), + ('1.99', '81', '2007-02-19T12:54:35.996577', '2714', '1'), + ('7.99', '81', '2007-03-21T21:30:28.996577', '14748', '2'), + ('4.99', '81', '2007-03-23T05:09:33.996577', '15602', '1'), + ('5.99', '81', '2007-03-17T11:33:07.996577', '11837', '1'), + ('1.99', '81', '2007-03-23T15:13:54.996577', '15884', '2'), + ('5.99', '257', '2007-03-20T13:00:57.996577', '13846', '2'), + ('4.99', '257', '2007-02-20T14:02:13.996577', '3083', '2'), + ('4.99', '257', '2007-04-30T20:39:20.996577', '10142', '2'), + ('6.99', '257', '2007-03-16T23:24:32.996577', '11545', '2'), + ('0.99', '257', '2007-03-02T17:13:11.996577', '11394', '1'), + ('6.99', '257', '2007-04-07T22:31:15.996577', '4462', '2'), + ('2.99', '257', '2007-04-28T23:22:43.996577', '8252', '2'), + ('2.99', '257', '2007-03-19T00:24:21.996577', '12841', '2'), + ('5.99', '257', '2007-04-27T19:29:42.996577', '7518', '2'), + ('4.99', '257', '2007-04-29T03:13:51.996577', '8344', '1'), + ('4.99', '257', '2007-04-10T16:28:33.996577', '5858', '1'), + ('4.99', '257', '2007-04-29T13:02:43.996577', '8640', '1'), + ('2.99', '257', '2007-03-23T18:18:32.996577', '15967', '1'), + ('0.99', '257', '2007-03-23T18:19:55.996577', '15968', '2'), + ('5.99', '257', '2007-04-12T11:52:06.996577', '6711', '2'), + ('4.99', '257', '2007-04-27T00:12:05.996577', '7007', '2'), + ('4.99', '257', '2007-04-08T04:08:08.996577', '4574', '2'), + ('6.99', '257', '2007-04-30T01:43:19.996577', '8946', '2'), + ('0.99', '257', '2007-03-19T14:08:05.996577', '13218', '2'), + ('6.99', '257', '2007-04-09T22:45:20.996577', '5495', '1'), + ('4.99', '257', '2007-03-02T11:27:34.996577', '11230', '1'), + ('3.99', '257', '2007-04-28T19:27:30.996577', '8156', '2'), + ('0.99', '257', '2007-03-20T23:38:55.996577', '14115', '2'), + ('2.99', '257', '2007-04-27T19:06:23.996577', '7510', '2'), + ('2.99', '257', '2007-03-19T20:21:17.996577', '13389', '1'), + ('1.99', '257', '2007-04-27T18:32:31.996577', '7496', '1'), + ('4.99', '257', '2007-04-30T09:29:24.996577', '9800', '1'), + ('1.99', '257', '2007-03-17T12:20:52.996577', '11860', '2'), + ('0.99', '257', '2007-02-19T01:37:17.996577', '2557', '1'), + ('5.99', '257', '2007-04-11T22:14:45.996577', '6422', '1'), + ('5.99', '257', '2007-03-19T02:39:16.996577', '12904', '1'), + ('0.99', '257', '2007-03-22T07:25:50.996577', '15025', '1'), + ('2.99', '257', '2007-04-27T06:32:54.996577', '7176', '1'), + ('7.99', '257', '2007-03-19T13:29:24.996577', '13203', '2'), + ('0.99', '97', '2007-03-22T06:48:41.996577', '15006', '1'), + ('0.99', '97', '2007-04-28T10:37:19.996577', '7924', '2'), + ('0.99', '97', '2007-02-21T20:14:13.996577', '3459', '1'), + ('2.99', '97', '2007-04-06T00:15:46.996577', '3540', '1'), + ('4.99', '97', '2007-04-09T20:52:51.996577', '5454', '2'), + ('0.99', '97', '2007-04-06T01:31:24.996577', '3565', '2'), + ('5.99', '97', '2007-04-27T06:44:04.996577', '7182', '2'), + ('2.99', '97', '2007-02-17T15:42:26.996577', '2083', '2'), + ('4.99', '97', '2007-02-19T17:18:11.996577', '2790', '2'), + ('0.99', '97', '2007-04-12T12:16:40.996577', '6726', '1'), + ('2.99', '97', '2007-03-01T21:22:06.996577', '10820', '1'), + ('4.99', '97', '2007-04-08T00:57:07.996577', '4508', '1'), + ('2.99', '97', '2007-04-29T05:54:08.996577', '8438', '2'), + ('4.99', '97', '2007-04-06T14:01:57.996577', '3818', '2'), + ('4.99', '97', '2007-04-30T01:47:54.996577', '9591', '1'), + ('4.99', '97', '2007-03-21T06:37:09.996577', '14323', '2'), + ('4.99', '97', '2007-04-07T16:03:25.996577', '4312', '2'), + ('0.99', '97', '2007-04-12T03:24:41.996577', '6544', '1'), + ('4.99', '433', '2007-04-12T17:59:08.996577', '6850', '1'), + ('2.99', '433', '2007-03-17T04:04:18.996577', '11664', '1'), + ('6.99', '433', '2007-04-07T03:59:22.996577', '4087', '2'), + ('5.99', '433', '2007-03-23T01:08:30.996577', '15502', '1'), + ('0.99', '433', '2007-04-09T21:01:40.996577', '5457', '2'), + ('8.99', '433', '2007-04-10T22:31:48.996577', '5969', '1'), + ('4.99', '433', '2007-03-21T13:32:11.996577', '14523', '2'), + ('4.99', '433', '2007-03-19T16:17:39.996577', '13273', '2'), + ('0.99', '433', '2007-04-12T17:52:33.996577', '6848', '1'), + ('4.99', '433', '2007-03-01T15:19:34.996577', '10663', '1'), + ('4.99', '433', '2007-04-30T09:47:44.996577', '9161', '2'), + ('5.99', '433', '2007-04-12T13:59:13.996577', '6765', '1'), + ('3.99', '433', '2007-04-30T14:43:03.996577', '9294', '1'), + ('4.99', '433', '2007-04-28T10:00:26.996577', '7907', '2'), + ('4.99', '433', '2007-04-28T06:59:49.996577', '7821', '1'), + ('0.99', '433', '2007-04-07T07:34:08.996577', '4158', '2'), + ('7.99', '433', '2007-04-08T23:14:40.996577', '4988', '2'), + ('4.99', '433', '2007-03-20T11:09:19.996577', '13801', '1'), + ('5.99', '433', '2007-04-29T05:17:01.996577', '8414', '1'), + ('2.99', '433', '2007-04-29T15:59:45.996577', '8713', '1'), + ('4.99', '433', '2007-03-23T00:13:33.996577', '15476', '2'), + ('6.99', '433', '2007-03-21T14:40:01.996577', '14559', '1'), + ('6.99', '433', '2007-03-18T17:46:13.996577', '12669', '2'), + ('3.99', '258', '2007-03-18T03:44:54.996577', '12296', '2'), + ('0.99', '258', '2007-03-01T05:21:16.996577', '10393', '1'), + ('4.99', '258', '2007-03-01T03:03:11.996577', '10315', '2'), + ('5.99', '258', '2007-04-08T08:59:02.996577', '4677', '1'), + ('8.99', '258', '2007-02-20T03:19:11.996577', '2931', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['31817', '25062', '31820', '31823', '25065', '25063', '31816', '31819', '31821', '25068', '31818', '31814', '25069', '25067', '19472', '25070', '31822', '19471', '25060', '26880', '26882', '20968', '26879', '20957', '20967', '20963', '20962', '26878', '20961', '20958', '20965', '20970', '26881', '17799', '20960', '26876', '26875', '17801', '20955', '20969', '20956', '26873', '17800', '26877', '20964', '20971', '20959', '26874', '20966', '27089', '21125', '21122', '27093', '21124', '27086', '17867', '27092', '27091', '27090', '17868', '27088', '17869', '21126', '27085', '27087', '21123', '21121', '21127', '27084', '27025', '21069', '21066', '27022', '21071', '21070', '21072', '17851', '31961', '21064', '17850', '21065', '17852', '17848', '21068', '27024', '27023', '27021', '21067', '17847', '17853', '17849', '17949', '21308', '27287', '21310', '21302', '21307', '21304', '21305', '27291']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('5.99', '258', '2007-04-09T14:31:35.996577', '5312', '2'), + ('5.99', '258', '2007-03-01T03:20:38.996577', '10325', '1'), + ('4.99', '258', '2007-04-11T00:28:38.996577', '6012', '2'), + ('4.99', '258', '2007-04-30T06:08:25.996577', '9069', '2'), + ('5.99', '258', '2007-03-18T02:17:07.996577', '12246', '1'), + ('6.99', '258', '2007-03-01T03:25:58.996577', '10332', '2'), + ('0.99', '258', '2007-04-08T18:53:37.996577', '4897', '2'), + ('9.99', '258', '2007-04-10T20:39:30.996577', '5935', '1'), + ('2.99', '258', '2007-04-28T06:38:14.996577', '7814', '1'), + ('6.99', '258', '2007-03-20T07:41:51.996577', '13695', '1'), + ('0.99', '258', '2007-04-10T06:54:52.996577', '5674', '1'), + ('2.99', '258', '2007-04-07T20:09:32.996577', '4408', '2'), + ('2.99', '258', '2007-03-20T14:30:54.996577', '13897', '2'), + ('4.99', '258', '2007-03-19T23:59:22.996577', '13491', '1'), + ('0.99', '258', '2007-02-19T10:40:49.996577', '2678', '2'), + ('6.99', '258', '2007-03-22T03:00:03.996577', '14901', '2'), + ('4.99', '258', '2007-04-29T14:24:44.996577', '8675', '1'), + ('2.99', '258', '2007-02-16T15:06:36.996577', '1743', '1'), + ('1.99', '258', '2007-03-01T02:12:52.996577', '10293', '2'), + ('0.99', '418', '2007-04-29T11:00:59.996577', '8591', '2'), + ('4.99', '418', '2007-04-30T00:43:01.996577', '9558', '1'), + ('4.99', '418', '2007-03-22T00:20:52.996577', '14836', '1'), + ('5.99', '418', '2007-04-29T09:37:14.996577', '8546', '2'), + ('2.99', '418', '2007-03-02T00:33:30.996577', '10915', '2'), + ('0.99', '418', '2007-03-21T12:15:55.996577', '14484', '1'), + ('0.99', '418', '2007-03-17T14:13:03.996577', '11910', '1'), + ('2.99', '418', '2007-03-17T08:33:15.996577', '11769', '1'), + ('4.99', '418', '2007-04-26T22:54:40.996577', '6970', '1'), + ('4.99', '418', '2007-03-17T03:28:29.996577', '11650', '1'), + ('2.99', '418', '2007-03-02T12:46:33.996577', '11270', '1'), + ('2.99', '418', '2007-03-20T02:07:41.996577', '13537', '1'), + ('4.99', '418', '2007-03-22T23:45:21.996577', '15466', '1'), + ('10.99', '418', '2007-04-29T23:04:57.996577', '8886', '2'), + ('2.99', '418', '2007-02-19T19:00:45.996577', '2825', '1'), + ('1.99', '418', '2007-03-02T17:55:17.996577', '11409', '2'), + ('0.99', '418', '2007-04-08T21:01:19.996577', '4938', '1'), + ('2.99', '418', '2007-04-08T17:37:30.996577', '4865', '1'), + ('2.99', '418', '2007-02-20T06:12:53.996577', '2969', '2'), + ('5.99', '418', '2007-03-01T10:50:54.996577', '10537', '2'), + ('2.99', '418', '2007-03-22T01:15:33.996577', '14860', '2'), + ('0.99', '418', '2007-03-01T17:12:23.996577', '10709', '1'), + ('0.99', '418', '2007-04-06T13:37:08.996577', '3805', '1'), + ('2.99', '418', '2007-02-20T04:11:31.996577', '2943', '2'), + ('4.99', '418', '2007-04-11T07:52:22.996577', '6150', '1'), + ('0.99', '418', '2007-03-19T17:37:40.996577', '13312', '2'), + ('5.99', '418', '2007-03-23T17:49:48.996577', '15957', '2'), + ('3.99', '418', '2007-03-02T14:51:43.996577', '11322', '2'), + ('7.99', '418', '2007-04-08T17:11:41.996577', '4852', '2'), + ('0.99', '418', '2007-03-20T17:12:00.996577', '13970', '1'), + ('6.99', '437', '2007-04-10T16:58:23.996577', '5864', '2'), + ('2.99', '437', '2007-03-20T12:51:42.996577', '13839', '1'), + ('3.99', '437', '2007-03-02T18:13:12.996577', '11417', '2'), + ('8.99', '437', '2007-04-30T16:28:54.996577', '10009', '2'), + ('7.99', '437', '2007-03-20T12:51:12.996577', '13838', '2'), + ('4.99', '437', '2007-04-09T04:05:15.996577', '5085', '2'), + ('5.99', '437', '2007-02-18T02:52:20.996577', '2239', '2'), + ('2.99', '437', '2007-04-30T16:22:11.996577', '9333', '2'), + ('2.99', '437', '2007-04-30T10:05:04.996577', '9172', '2'), + ('2.99', '437', '2007-04-28T22:12:22.996577', '8215', '2'), + ('2.99', '437', '2007-02-19T17:20:51.996577', '2792', '1'), + ('2.99', '437', '2007-04-10T10:36:59.996577', '5744', '2'), + ('2.99', '437', '2007-02-21T02:51:39.996577', '3265', '2'), + ('1.99', '437', '2007-03-20T14:41:14.996577', '13905', '1'), + ('4.99', '437', '2007-04-08T13:37:11.996577', '4765', '2'), + ('1.99', '437', '2007-04-09T07:47:09.996577', '5167', '1'), + ('8.99', '437', '2007-03-18T00:49:34.996577', '12205', '1'), + ('0.99', '437', '2007-03-01T01:04:05.996577', '10249', '2'), + ('1.99', '437', '2007-03-22T06:20:44.996577', '14993', '1'), + ('4.99', '437', '2007-04-06T10:39:40.996577', '3747', '1'), + ('4.99', '431', '2007-04-29T20:13:45.996577', '8810', '2'), + ('1.99', '431', '2007-03-19T11:38:13.996577', '13153', '2'), + ('6.99', '431', '2007-03-02T02:08:05.996577', '10959', '2'), + ('2.99', '431', '2007-04-08T15:20:02.996577', '4801', '1'), + ('2.99', '431', '2007-03-23T13:10:33.996577', '15809', '1'), + ('4.99', '431', '2007-03-20T10:39:54.996577', '13784', '1'), + ('2.99', '431', '2007-03-23T18:04:08.996577', '15960', '1'), + ('2.99', '431', '2007-02-19T15:50:43.996577', '2761', '2'), + ('2.99', '431', '2007-05-14T13:44:29.996577', '13587', '2'), + ('0.99', '431', '2007-03-01T09:51:53.996577', '10508', '2'), + ('4.99', '431', '2007-02-18T05:15:55.996577', '2281', '2'), + ('4.99', '431', '2007-03-01T10:24:20.996577', '10527', '1'), + ('6.99', '431', '2007-02-21T06:12:06.996577', '3304', '2'), + ('4.99', '431', '2007-02-17T17:01:30.996577', '2096', '1'), + ('6.99', '431', '2007-03-18T03:09:16.996577', '12273', '1'), + ('4.99', '431', '2007-04-28T12:44:40.996577', '7978', '2'), + ('0.99', '431', '2007-04-08T17:31:41.996577', '4863', '1'), + ('3.99', '431', '2007-04-07T06:54:10.996577', '4144', '1'), + ('2.99', '431', '2007-03-16T23:12:30.996577', '11538', '2'), + ('2.99', '431', '2007-02-16T01:09:56.996577', '1561', '2'), + ('8.99', '431', '2007-02-21T11:48:57.996577', '3369', '2'), + ('3.99', '431', '2007-02-18T04:49:20.996577', '2269', '1'), + ('2.99', '455', '2007-02-17T03:22:01.996577', '1906', '1'), + ('2.99', '455', '2007-03-21T05:35:52.996577', '14294', '1'), + ('2.99', '455', '2007-04-07T09:28:28.996577', '4195', '2'), + ('1.99', '455', '2007-03-23T00:53:35.996577', '15494', '1'), + ('0.99', '455', '2007-03-01T07:19:25.996577', '10436', '1'), + ('4.99', '455', '2007-03-20T11:31:52.996577', '13813', '2'), + ('2.99', '455', '2007-03-17T23:14:27.996577', '12163', '1'), + ('4.99', '455', '2007-03-18T04:38:28.996577', '12314', '1'), + ('4.99', '455', '2007-04-12T12:26:49.996577', '6729', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['17947', '17948', '27292', '21309', '27294', '21303', '21306', '27288', '27295', '27293', '17950', '27289', '27290', '20144', '25947', '20141', '20140', '25936', '20139', '25940', '25946', '25937', '25941', '31936', '25949', '25943', '25945', '20143', '25939', '25944', '25950', '25938', '25948', '25942', '20142', '27945', '21856', '27943', '27941', '21850', '21846', '18159', '27942', '27936', '27935', '27940', '18160', '18158', '21848', '27944', '27939', '21844', '27946', '27937', '27934', '21852', '21854', '21851', '27938', '21843', '21855', '21845', '21853', '21849', '21847', '24890', '24885', '31625', '24891', '31622', '24886', '24884', '31615', '24892', '24889', '19401', '19403', '31621', '31620', '31624', '31614', '24888', '31619', '31617', '19400', '24893', '24883', '31616', '19399', '24887', '31618', '19402', '31623', '22639', '18474', '18473', '22635', '28928', '28925', '22634']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('1.99', '455', '2007-02-15T13:46:34.996577', '1382', '2'), + ('1.99', '455', '2007-02-16T18:51:56.996577', '1802', '1'), + ('4.99', '455', '2007-04-27T14:22:45.996577', '7388', '1'), + ('4.99', '455', '2007-03-21T15:40:13.996577', '14583', '2'), + ('5.99', '455', '2007-04-28T09:55:23.996577', '7905', '2'), + ('4.99', '455', '2007-03-17T01:59:23.996577', '11605', '1'), + ('2.99', '455', '2007-03-19T08:55:11.996577', '13083', '2'), + ('8.99', '455', '2007-04-08T17:25:56.996577', '4861', '1'), + ('2.99', '455', '2007-04-29T00:56:51.996577', '8291', '2'), + ('4.99', '455', '2007-04-27T18:37:57.996577', '7498', '2'), + ('0.99', '455', '2007-02-18T11:27:49.996577', '2356', '2'), + ('2.99', '455', '2007-04-08T22:15:04.996577', '4964', '1'), + ('6.99', '455', '2007-04-09T23:05:04.996577', '5504', '1'), + ('0.99', '335', '2007-03-22T10:24:28.996577', '15101', '2'), + ('2.99', '335', '2007-04-29T22:08:36.996577', '8855', '1'), + ('1.99', '335', '2007-03-20T05:13:58.996577', '13622', '1'), + ('0.99', '335', '2007-03-19T16:00:02.996577', '13267', '2'), + ('0.99', '335', '2007-04-06T03:58:35.996577', '3607', '1'), + ('4.99', '335', '2007-03-01T13:07:41.996577', '10606', '2'), + ('8.99', '335', '2007-04-07T19:25:13.996577', '4387', '1'), + ('3.99', '335', '2007-04-29T12:48:23.996577', '8634', '2'), + ('0.99', '335', '2007-04-06T23:34:16.996577', '4016', '2'), + ('4.99', '335', '2007-04-09T00:53:38.996577', '5024', '1'), + ('0.99', '335', '2007-05-14T13:44:29.996577', '11541', '2'), + ('4.99', '335', '2007-04-30T17:12:15.996577', '9361', '2'), + ('2.99', '335', '2007-04-10T09:54:40.996577', '5728', '2'), + ('0.99', '335', '2007-04-12T20:31:28.996577', '6906', '1'), + ('4.99', '335', '2007-03-22T06:44:10.996577', '15005', '2'), + ('4.99', '335', '2007-04-07T13:30:19.996577', '4279', '1'), + ('7.99', '335', '2007-04-12T07:34:16.996577', '6624', '1'), + ('0.99', '335', '2007-04-30T19:47:03.996577', '9428', '1'), + ('2.99', '335', '2007-04-07T01:02:39.996577', '4032', '2'), + ('5.99', '335', '2007-04-30T08:12:05.996577', '9125', '1'), + ('0.99', '335', '2007-04-09T12:09:10.996577', '5252', '1'), + ('2.99', '335', '2007-03-20T19:15:35.996577', '14014', '1'), + ('2.99', '513', '2007-04-30T11:33:29.996577', '9862', '2'), + ('5.99', '513', '2007-03-23T02:48:42.996577', '15545', '2'), + ('9.99', '513', '2007-04-29T14:44:09.996577', '8683', '2'), + ('4.99', '513', '2007-04-29T02:18:24.996577', '8320', '2'), + ('5.99', '513', '2007-03-20T04:27:24.996577', '13596', '1'), + ('3.99', '513', '2007-03-17T07:44:01.996577', '11755', '1'), + ('7.99', '513', '2007-02-18T06:03:03.996577', '2290', '2'), + ('4.99', '513', '2007-04-29T03:19:05.996577', '8350', '1'), + ('4.99', '513', '2007-04-07T08:42:57.996577', '4178', '2'), + ('2.99', '513', '2007-04-07T02:17:39.996577', '4055', '2'), + ('0.99', '513', '2007-04-28T00:29:37.996577', '7655', '1'), + ('1.99', '513', '2007-02-19T14:16:59.996577', '2737', '2'), + ('2.99', '513', '2007-02-16T04:54:01.996577', '1607', '1'), + ('2.99', '513', '2007-03-18T22:31:12.996577', '12784', '2'), + ('5.99', '513', '2007-04-29T19:44:04.996577', '8798', '1'), + ('4.99', '513', '2007-04-11T00:54:55.996577', '6027', '1'), + ('2.99', '513', '2007-03-02T08:40:43.996577', '11165', '1'), + ('3.99', '513', '2007-04-30T16:34:32.996577', '10012', '1'), + ('4.99', '513', '2007-04-07T10:41:02.996577', '4220', '2'), + ('0.99', '513', '2007-04-06T16:28:45.996577', '3872', '2'), + ('7.99', '513', '2007-03-22T00:37:38.996577', '14844', '2'), + ('4.99', '513', '2007-03-22T08:02:58.996577', '15035', '1'), + ('4.99', '513', '2007-03-20T07:35:53.996577', '13690', '1'), + ('7.99', '513', '2007-04-10T10:24:06.996577', '5741', '1'), + ('2.99', '513', '2007-03-02T05:58:40.996577', '11081', '2'), + ('6.99', '513', '2007-03-22T17:55:50.996577', '15289', '2'), + ('3.99', '513', '2007-03-02T17:47:09.996577', '11407', '1'), + ('4.99', '513', '2007-03-22T02:03:05.996577', '14875', '1'), + ('4.99', '513', '2007-03-18T23:07:12.996577', '12807', '2'), + ('5.99', '513', '2007-03-18T13:22:24.996577', '12559', '1'), + ('4.99', '239', '2007-03-19T12:23:19.996577', '13175', '1'), + ('2.99', '239', '2007-03-02T21:03:31.996577', '11487', '1'), + ('5.99', '239', '2007-04-30T11:33:55.996577', '9863', '1'), + ('4.99', '239', '2007-03-19T21:47:28.996577', '13427', '2'), + ('2.99', '239', '2007-04-27T18:21:49.996577', '7491', '2'), + ('4.99', '239', '2007-03-17T13:59:10.996577', '11900', '2'), + ('2.99', '239', '2007-03-02T00:43:27.996577', '10923', '2'), + ('5.99', '239', '2007-04-06T01:02:35.996577', '3552', '1'), + ('3.99', '239', '2007-03-20T18:21:58.996577', '13999', '2'), + ('1.99', '239', '2007-03-18T19:58:38.996577', '12721', '1'), + ('2.99', '239', '2007-02-18T01:16:47.996577', '2215', '2'), + ('5.99', '239', '2007-02-21T12:35:45.996577', '3383', '1'), + ('0.99', '239', '2007-04-27T15:48:12.996577', '7426', '1'), + ('8.99', '239', '2007-04-27T00:29:29.996577', '7012', '2'), + ('0.99', '239', '2007-04-30T05:07:39.996577', '9676', '2'), + ('0.99', '239', '2007-04-06T00:46:32.996577', '3547', '2'), + ('4.99', '239', '2007-03-18T05:35:27.996577', '12340', '1'), + ('0.99', '239', '2007-04-12T04:32:06.996577', '6573', '1'), + ('4.99', '239', '2007-04-10T05:45:39.996577', '5651', '2'), + ('4.99', '239', '2007-02-16T01:05:09.996577', '1560', '2'), + ('1.99', '239', '2007-03-20T21:03:00.996577', '14062', '2'), + ('0.99', '239', '2007-03-01T18:42:40.996577', '10755', '1'), + ('7.99', '239', '2007-04-08T20:10:36.996577', '4920', '2'), + ('4.99', '239', '2007-02-14T21:29:00.996577', '1160', '1'), + ('0.99', '239', '2007-03-17T16:16:00.996577', '11968', '1'), + ('0.99', '239', '2007-04-10T22:07:00.996577', '5960', '1'), + ('4.99', '239', '2007-02-18T13:57:52.996577', '2390', '1'), + ('6.99', '239', '2007-04-29T06:27:29.996577', '8457', '1'), + ('2.99', '203', '2007-03-23T18:56:00.996577', '15991', '2'), + ('7.99', '203', '2007-02-20T03:46:42.996577', '2939', '2'), + ('2.99', '203', '2007-02-16T13:05:38.996577', '1715', '1'), + ('0.99', '203', '2007-03-18T12:10:40.996577', '12519', '1'), + ('7.99', '203', '2007-04-29T19:24:40.996577', '8792', '1'), + ('6.99', '203', '2007-04-28T05:47:28.996577', '7787', '2'), + ('2.99', '203', '2007-03-17T06:01:17.996577', '11712', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['22632', '22633', '28926', '28924', '22638', '22637', '28929', '18475', '22636', '18472', '28923', '28927', '20077', '20076', '25853', '20074', '25850', '25851', '20081', '25855', '20075', '20078', '20084', '20083', '20082', '25854', '20080', '25852', '20079', '27858', '21799', '18135', '27859', '27864', '18133', '21788', '21795', '21797', '21790', '18136', '21793', '27863', '21789', '21798', '21796', '21794', '27861', '27862', '18132', '27860', '21791', '21787', '27856', '27855', '21792', '18134', '27857', '21251', '21252', '21250', '27240', '27242', '31967', '21256', '17919', '21247', '27241', '27244', '17917', '21254', '21255', '17916', '27243', '17913', '17915', '21248', '21253', '27239', '27245', '17918', '17914', '21249', '28271', '18264', '22123', '28266', '28272', '22124', '28268', '28265', '28269', '22119', '22120', '28267', '22122', '22121', '18265', '28270', '23749', '23758']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('3.99', '203', '2007-03-01T16:54:57.996577', '10700', '2'), + ('2.99', '203', '2007-03-01T20:52:03.996577', '10805', '2'), + ('0.99', '203', '2007-04-28T15:03:42.996577', '8039', '1'), + ('5.99', '203', '2007-04-10T02:32:55.996577', '5579', '2'), + ('2.99', '203', '2007-03-23T12:51:29.996577', '15798', '2'), + ('5.99', '203', '2007-03-21T12:54:54.996577', '14505', '2'), + ('10.99', '203', '2007-04-30T03:49:58.996577', '9015', '2'), + ('2.99', '203', '2007-02-21T14:28:44.996577', '3406', '2'), + ('4.99', '203', '2007-03-20T12:53:44.996577', '13841', '2'), + ('4.99', '203', '2007-02-15T01:52:40.996577', '1217', '1'), + ('2.99', '203', '2007-04-07T06:44:18.996577', '4136', '2'), + ('4.99', '203', '2007-04-29T06:46:17.996577', '8463', '1'), + ('2.99', '328', '2007-03-20T04:40:17.996577', '13609', '1'), + ('0.99', '328', '2007-03-18T23:52:24.996577', '12825', '2'), + ('4.99', '328', '2007-04-29T18:48:11.996577', '8780', '2'), + ('2.99', '328', '2007-03-02T09:00:37.996577', '11174', '1'), + ('4.99', '328', '2007-04-09T20:41:51.996577', '5450', '1'), + ('1.99', '328', '2007-04-28T14:04:07.996577', '8017', '1'), + ('3.99', '328', '2007-03-21T21:46:34.996577', '14755', '1'), + ('2.99', '328', '2007-04-30T10:36:01.996577', '9835', '1'), + ('4.99', '328', '2007-03-17T23:38:43.996577', '12175', '1'), + ('7.99', '328', '2007-03-20T07:16:03.996577', '13681', '2'), + ('0.99', '328', '2007-03-23T14:45:35.996577', '15863', '1'), + ('4.99', '328', '2007-03-22T14:04:48.996577', '15179', '1'), + ('2.99', '328', '2007-03-22T04:22:18.996577', '14939', '2'), + ('2.99', '328', '2007-04-30T00:42:27.996577', '9557', '2'), + ('3.99', '328', '2007-03-21T06:03:18.996577', '14307', '2'), + ('6.99', '328', '2007-04-29T10:24:56.996577', '8577', '1'), + ('3.99', '328', '2007-03-20T14:45:53.996577', '13907', '1'), + ('0.99', '506', '2007-04-10T23:20:24.996577', '5985', '2'), + ('9.99', '506', '2007-03-23T08:31:12.996577', '15694', '1'), + ('9.99', '506', '2007-02-19T15:24:57.996577', '2755', '1'), + ('2.99', '506', '2007-04-12T14:56:22.996577', '6783', '1'), + ('2.99', '506', '2007-04-30T15:11:09.996577', '9972', '2'), + ('2.99', '506', '2007-02-15T19:15:36.996577', '1467', '1'), + ('4.99', '506', '2007-03-01T22:59:00.996577', '10873', '1'), + ('2.99', '506', '2007-03-21T07:02:52.996577', '14337', '1'), + ('5.99', '506', '2007-03-22T07:24:09.996577', '15022', '2'), + ('4.99', '506', '2007-03-17T09:05:26.996577', '11781', '2'), + ('6.99', '506', '2007-02-19T19:00:11.996577', '2824', '2'), + ('0.99', '506', '2007-03-20T10:12:02.996577', '13767', '2'), + ('3.99', '506', '2007-04-30T04:26:08.996577', '9654', '2'), + ('0.99', '506', '2007-03-02T11:54:16.996577', '11238', '2'), + ('1.99', '506', '2007-03-23T03:56:27.996577', '15572', '2'), + ('6.99', '506', '2007-03-21T08:52:26.996577', '14395', '2'), + ('1.99', '506', '2007-03-20T21:44:33.996577', '14074', '1'), + ('9.99', '506', '2007-04-28T17:01:12.996577', '8096', '2'), + ('0.99', '506', '2007-04-29T07:52:18.996577', '8506', '2'), + ('6.99', '506', '2007-02-15T17:42:11.996577', '1446', '1'), + ('0.99', '506', '2007-04-27T00:52:53.996577', '7020', '1'), + ('0.99', '506', '2007-03-19T05:54:36.996577', '12994', '1'), + ('2.99', '506', '2007-03-01T08:32:43.996577', '10477', '1'), + ('6.99', '506', '2007-04-08T07:28:00.996577', '4640', '2'), + ('7.99', '506', '2007-04-08T05:08:32.996577', '4594', '2'), + ('2.99', '506', '2007-03-19T08:34:04.996577', '13073', '2'), + ('0.99', '506', '2007-02-16T01:41:35.996577', '1565', '2'), + ('8.99', '506', '2007-04-08T15:29:28.996577', '4806', '2'), + ('0.99', '450', '2007-03-20T11:28:04.996577', '13810', '1'), + ('4.99', '450', '2007-03-20T12:18:18.996577', '13828', '1'), + ('4.99', '450', '2007-03-20T08:50:34.996577', '13731', '2'), + ('7.99', '450', '2007-04-10T23:49:48.996577', '5999', '1'), + ('2.99', '450', '2007-04-27T13:28:46.996577', '7365', '2'), + ('0.99', '450', '2007-05-14T13:44:29.996577', '14172', '1'), + ('4.99', '450', '2007-03-22T22:23:02.996577', '15419', '2'), + ('4.99', '450', '2007-02-20T19:31:04.996577', '3155', '1'), + ('2.99', '450', '2007-03-01T07:11:47.996577', '10432', '2'), + ('4.99', '450', '2007-04-11T01:00:10.996577', '6028', '1'), + ('0.99', '450', '2007-04-27T23:17:27.996577', '7626', '1'), + ('4.99', '450', '2007-02-18T21:38:37.996577', '2501', '1'), + ('0.99', '450', '2007-03-22T07:21:19.996577', '15019', '2'), + ('4.99', '450', '2007-03-22T18:59:50.996577', '15327', '1'), + ('0.99', '450', '2007-02-18T05:06:23.996577', '2278', '2'), + ('0.99', '450', '2007-04-27T22:40:01.996577', '7610', '1'), + ('4.99', '450', '2007-02-16T07:02:05.996577', '1639', '2'), + ('2.99', '450', '2007-02-17T03:54:20.996577', '1914', '2'), + ('3.99', '450', '2007-03-02T02:58:28.996577', '10984', '1'), + ('4.99', '450', '2007-03-21T05:09:55.996577', '14282', '1'), + ('3.99', '450', '2007-04-06T01:52:09.996577', '3570', '1'), + ('4.99', '450', '2007-04-29T16:55:00.996577', '8733', '2'), + ('2.99', '450', '2007-02-19T06:57:10.996577', '2626', '1'), + ('0.99', '450', '2007-02-16T14:38:04.996577', '1739', '1'), + ('0.99', '450', '2007-03-18T23:22:28.996577', '12812', '2'), + ('4.99', '542', '2007-04-29T08:57:42.996577', '8533', '1'), + ('4.99', '542', '2007-02-19T05:44:46.996577', '2610', '1'), + ('0.99', '542', '2007-03-19T22:38:02.996577', '13447', '1'), + ('6.99', '542', '2007-04-09T22:12:15.996577', '5477', '1'), + ('3.99', '542', '2007-04-29T09:30:34.996577', '8544', '2'), + ('9.99', '542', '2007-03-22T05:49:21.996577', '14982', '2'), + ('5.99', '542', '2007-04-11T17:34:27.996577', '6325', '2'), + ('0.99', '542', '2007-04-09T13:45:49.996577', '5293', '2'), + ('9.99', '542', '2007-04-12T19:28:49.996577', '6887', '1'), + ('4.99', '542', '2007-03-01T01:55:41.996577', '10280', '1'), + ('0.99', '542', '2007-03-17T00:36:39.996577', '11583', '2'), + ('5.99', '542', '2007-04-11T03:34:34.996577', '6077', '2'), + ('0.99', '542', '2007-03-18T23:33:31.996577', '12819', '1'), + ('2.99', '542', '2007-03-17T14:06:11.996577', '11903', '2'), + ('10.99', '542', '2007-02-20T05:22:13.996577', '2957', '2'), + ('8.99', '542', '2007-04-28T01:18:07.996577', '7672', '2'), + ('1.99', '116', '2007-03-01T01:07:08.996577', '10250', '2'), + ('2.99', '116', '2007-03-22T03:12:35.996577', '14907', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['23751', '18955', '30309', '18953', '18957', '30304', '30305', '23753', '23750', '18956', '30310', '23757', '23754', '30311', '30313', '23752', '18952', '18954', '30307', '23755', '30312', '30306', '30308', '23756', '26379', '26373', '26380', '26375', '17625', '17626', '20496', '20501', '20497', '26383', '20499', '20495', '26371', '20492', '26372', '26369', '20500', '26378', '20493', '26384', '26381', '26370', '20494', '20491', '17627', '26374', '26377', '20498', '26382', '20502', '20490', '26376', '27311', '27316', '27315', '27313', '21336', '21331', '27317', '21332', '27310', '21330', '17968', '21335', '27314', '21333', '17967', '27312', '27318', '21334', '21337', '26810', '26820', '26814', '20885', '26813', '20888', '26817', '31955', '26816', '26812', '17782', '17784', '26821', '17783', '26815', '26819', '20887', '20884', '26811', '20886', '26818', '20890', '20889', '20883', '21500']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('4.99', '116', '2007-03-02T03:47:39.996577', '11016', '2'), + ('4.99', '116', '2007-02-17T03:48:13.996577', '1913', '2'), + ('4.99', '116', '2007-04-12T03:40:29.996577', '6557', '1'), + ('0.99', '116', '2007-02-15T23:14:28.996577', '1533', '2'), + ('3.99', '116', '2007-02-19T21:50:00.996577', '2861', '1'), + ('6.99', '116', '2007-04-06T18:15:52.996577', '3908', '2'), + ('2.99', '116', '2007-04-06T19:45:25.996577', '3940', '2'), + ('7.99', '116', '2007-03-19T11:23:08.996577', '13146', '2'), + ('1.99', '116', '2007-03-01T20:38:01.996577', '10801', '1'), + ('4.99', '116', '2007-02-19T07:52:28.996577', '2639', '1'), + ('0.99', '116', '2007-04-27T08:42:07.996577', '7238', '1'), + ('11.99', '116', '2007-03-21T22:02:26.996577', '14763', '2'), + ('0.99', '116', '2007-03-19T19:48:13.996577', '13369', '1'), + ('5.99', '116', '2007-04-28T05:03:42.996577', '7763', '2'), + ('3.99', '116', '2007-04-30T00:51:46.996577', '9562', '1'), + ('2.99', '116', '2007-03-18T06:48:55.996577', '12376', '2'), + ('0.99', '116', '2007-02-15T10:04:27.996577', '1332', '2'), + ('4.99', '116', '2007-02-16T16:18:45.996577', '1762', '2'), + ('4.99', '116', '2007-04-08T11:52:19.996577', '4737', '2'), + ('0.99', '116', '2007-03-19T23:32:58.996577', '13474', '1'), + ('6.99', '116', '2007-04-30T12:36:16.996577', '9245', '2'), + ('0.99', '116', '2007-04-07T00:47:27.996577', '4027', '1'), + ('2.99', '116', '2007-04-09T07:50:51.996577', '5169', '2'), + ('6.99', '116', '2007-03-20T10:24:56.996577', '13775', '1'), + ('2.99', '372', '2007-04-28T15:38:25.996577', '8059', '1'), + ('7.99', '372', '2007-04-10T19:29:38.996577', '5914', '2'), + ('0.99', '372', '2007-04-29T03:29:24.996577', '8358', '1'), + ('4.99', '372', '2007-04-27T07:04:27.996577', '7190', '1'), + ('2.99', '372', '2007-02-18T07:32:05.996577', '2315', '1'), + ('4.99', '372', '2007-02-20T05:36:20.996577', '2959', '1'), + ('8.99', '372', '2007-03-20T13:38:39.996577', '13871', '2'), + ('0.99', '372', '2007-03-22T08:11:44.996577', '15041', '2'), + ('9.99', '372', '2007-03-20T20:04:24.996577', '14037', '2'), + ('8.99', '372', '2007-04-29T21:17:26.996577', '8837', '2'), + ('2.99', '372', '2007-03-21T06:58:04.996577', '14331', '1'), + ('4.99', '372', '2007-03-19T20:45:19.996577', '13402', '2'), + ('2.99', '372', '2007-04-09T16:23:24.996577', '5352', '1'), + ('4.99', '372', '2007-03-16T23:37:25.996577', '11555', '2'), + ('6.99', '372', '2007-04-09T23:02:14.996577', '5501', '1'), + ('4.99', '372', '2007-04-09T10:58:44.996577', '5229', '1'), + ('1.99', '372', '2007-03-21T22:15:42.996577', '14770', '1'), + ('7.99', '372', '2007-04-28T13:54:24.996577', '8009', '2'), + ('0.99', '372', '2007-03-18T01:27:35.996577', '12224', '1'), + ('5.99', '372', '2007-04-30T08:19:40.996577', '9128', '1'), + ('0.99', '372', '2007-04-29T16:33:47.996577', '8724', '1'), + ('2.99', '372', '2007-04-09T14:33:54.996577', '5314', '1'), + ('3.99', '372', '2007-03-18T19:36:27.996577', '12714', '1'), + ('3.99', '372', '2007-03-02T18:49:34.996577', '11438', '2'), + ('3.99', '372', '2007-02-21T04:47:33.996577', '3283', '1'), + ('4.99', '372', '2007-04-12T11:04:05.996577', '6692', '2'), + ('4.99', '372', '2007-04-28T03:38:22.996577', '7735', '2'), + ('4.99', '372', '2007-03-21T02:57:37.996577', '14211', '1'), + ('2.99', '372', '2007-04-29T17:46:57.996577', '8755', '1'), + ('2.99', '372', '2007-03-23T03:37:24.996577', '15563', '1'), + ('10.99', '372', '2007-03-02T07:47:48.996577', '11134', '2'), + ('5.99', '372', '2007-04-27T08:37:11.996577', '7234', '2'), + ('2.99', '458', '2007-04-09T18:52:18.996577', '5412', '1'), + ('1.99', '458', '2007-04-12T09:34:54.996577', '6654', '1'), + ('7.99', '458', '2007-04-12T05:54:14.996577', '6595', '2'), + ('3.99', '458', '2007-04-11T13:30:30.996577', '6250', '2'), + ('4.99', '458', '2007-03-21T09:55:33.996577', '14428', '2'), + ('2.99', '458', '2007-03-17T16:27:05.996577', '11975', '2'), + ('3.99', '458', '2007-04-28T10:36:55.996577', '7923', '2'), + ('0.99', '458', '2007-03-18T21:54:37.996577', '12768', '2'), + ('2.99', '458', '2007-04-08T01:43:26.996577', '4525', '2'), + ('2.99', '458', '2007-03-02T07:54:42.996577', '11138', '2'), + ('0.99', '458', '2007-02-21T07:11:03.996577', '3322', '2'), + ('4.99', '458', '2007-03-20T03:33:40.996577', '13571', '2'), + ('5.99', '458', '2007-04-11T22:32:23.996577', '6431', '1'), + ('2.99', '458', '2007-03-19T15:37:19.996577', '13259', '2'), + ('5.99', '458', '2007-02-19T07:10:38.996577', '2629', '2'), + ('0.99', '458', '2007-04-10T02:17:26.996577', '5572', '1'), + ('0.99', '458', '2007-04-28T19:37:12.996577', '8158', '1'), + ('2.99', '458', '2007-03-19T23:55:31.996577', '13487', '2'), + ('4.99', '458', '2007-03-23T05:12:45.996577', '15604', '1'), + ('2.99', '411', '2007-04-06T19:20:35.996577', '3928', '1'), + ('5.99', '411', '2007-04-29T11:59:24.996577', '8613', '2'), + ('2.99', '411', '2007-04-10T13:27:02.996577', '5800', '1'), + ('0.99', '411', '2007-03-20T05:45:11.996577', '13634', '2'), + ('5.99', '411', '2007-04-09T16:37:25.996577', '5357', '2'), + ('5.99', '411', '2007-03-21T22:19:05.996577', '14772', '1'), + ('2.99', '411', '2007-04-27T19:19:30.996577', '7513', '1'), + ('4.99', '411', '2007-05-14T13:44:29.996577', '13246', '2'), + ('0.99', '411', '2007-04-27T14:31:37.996577', '7395', '2'), + ('2.99', '411', '2007-04-07T12:17:29.996577', '4246', '1'), + ('0.99', '411', '2007-02-17T09:00:03.996577', '1985', '1'), + ('0.99', '411', '2007-02-19T12:48:39.996577', '2712', '2'), + ('0.99', '411', '2007-04-30T02:50:11.996577', '9622', '2'), + ('2.99', '411', '2007-02-17T09:48:09.996577', '1997', '2'), + ('1.99', '411', '2007-04-27T03:35:47.996577', '7102', '1'), + ('0.99', '411', '2007-04-28T14:21:55.996577', '8023', '1'), + ('2.99', '411', '2007-03-21T12:05:06.996577', '14480', '2'), + ('5.99', '411', '2007-03-17T17:03:04.996577', '11997', '1'), + ('0.99', '411', '2007-04-07T06:58:42.996577', '4146', '2'), + ('7.99', '411', '2007-03-20T06:29:33.996577', '13656', '2'), + ('2.99', '411', '2007-04-28T06:36:53.996577', '7813', '1'), + ('0.99', '411', '2007-03-23T17:11:37.996577', '15936', '1'), + ('2.99', '411', '2007-03-22T06:21:07.996577', '14996', '2'), + ('2.99', '411', '2007-03-02T13:36:53.996577', '11294', '2'), + ('7.99', '473', '2007-03-02T18:20:19.996577', '11421', '2') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + + v_old_ids_payment := ARRAY['21501', '21502', '27488', '27486', '27490', '27485', '21503', '27481', '27487', '18026', '18025', '27479', '18023', '21506', '27484', '27489', '27480', '21507', '27483', '21499', '18024', '27482', '21504', '21496', '21505', '21508', '21498', '21497', '21509', '27478', '21955', '18204', '18202', '28061', '28064', '18203', '21954', '28059', '28063', '21952', '21951', '28062', '28065', '28060', '28058', '21950', '21953', '30734', '19094', '30733', '24161', '30729', '24159', '19095', '19096', '30732', '30727', '24163', '24160', '24156', '24155', '24157', '30728', '30735', '30730', '24158', '24162', '30726', '24154', '30731', '19093', '27795', '27800', '21731', '18117', '18116', '21732', '27792', '27801', '18114', '27793', '21726', '27794', '27797', '27799', '27798', '21728', '21725', '27802', '21730', '18113', '18115', '21724', '27796', '21727', '21729']; + WITH inserted AS ( + INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") + SELECT + data.amount::numeric, + map0.new_id::smallint, + data.payment_date::timestamp without time zone, + map1.new_id::integer, + map2.new_id::smallint + FROM (VALUES + ('0.99', '473', '2007-03-17T07:17:05.996577', '11741', '1'), + ('4.99', '473', '2007-03-20T17:40:56.996577', '13984', '2'), + ('7.99', '473', '2007-04-28T10:44:17.996577', '7928', '2'), + ('2.99', '473', '2007-04-27T07:52:26.996577', '7215', '1'), + ('8.99', '473', '2007-04-30T07:54:34.996577', '9120', '2'), + ('4.99', '473', '2007-04-27T04:06:42.996577', '7111', '1'), + ('0.99', '473', '2007-03-21T02:20:18.996577', '14202', '2'), + ('0.99', '473', '2007-04-08T17:51:58.996577', '4873', '1'), + ('1.99', '473', '2007-04-28T10:27:19.996577', '7918', '2'), + ('4.99', '473', '2007-02-19T14:50:52.996577', '2748', '2'), + ('4.99', '473', '2007-02-19T01:33:25.996577', '2553', '2'), + ('4.99', '473', '2007-04-06T22:53:55.996577', '4006', '2'), + ('0.99', '473', '2007-02-16T15:22:29.996577', '1748', '2'), + ('4.99', '473', '2007-03-21T21:52:03.996577', '14757', '2'), + ('4.99', '473', '2007-04-12T19:31:29.996577', '6890', '2'), + ('4.99', '473', '2007-04-30T04:18:34.996577', '9025', '1'), + ('4.99', '473', '2007-04-08T06:42:52.996577', '4625', '2'), + ('4.99', '473', '2007-03-22T11:07:03.996577', '15118', '1'), + ('2.99', '473', '2007-04-11T23:12:34.996577', '6446', '1'), + ('0.99', '473', '2007-03-02T15:27:22.996577', '11336', '1'), + ('2.99', '473', '2007-02-17T19:22:08.996577', '2125', '1'), + ('5.99', '473', '2007-04-09T20:37:54.996577', '5447', '2'), + ('0.99', '473', '2007-03-21T14:25:05.996577', '14550', '2'), + ('2.99', '473', '2007-03-01T22:52:41.996577', '10867', '1'), + ('4.99', '473', '2007-03-21T18:10:16.996577', '14658', '2'), + ('2.99', '473', '2007-03-22T21:41:29.996577', '15400', '2'), + ('4.99', '473', '2007-03-02T10:52:09.996577', '11216', '1'), + ('2.99', '473', '2007-03-02T03:34:18.996577', '11006', '2'), + ('4.99', '473', '2007-03-23T20:15:13.996577', '16024', '2'), + ('0.99', '473', '2007-04-06T21:19:06.996577', '3971', '1'), + ('6.99', '524', '2007-03-22T15:02:05.996577', '15206', '2'), + ('2.99', '524', '2007-02-21T19:40:39.996577', '3454', '2'), + ('1.99', '524', '2007-02-15T08:27:50.996577', '1306', '1'), + ('6.99', '524', '2007-04-11T13:01:07.996577', '6240', '1'), + ('4.99', '524', '2007-04-27T01:45:45.996577', '7040', '1'), + ('4.99', '524', '2007-02-16T07:53:04.996577', '1651', '2'), + ('1.99', '524', '2007-03-21T18:48:18.996577', '14680', '2'), + ('4.99', '524', '2007-04-09T01:27:36.996577', '5037', '2'), + ('8.99', '524', '2007-04-27T00:43:06.996577', '7014', '2'), + ('2.99', '524', '2007-03-21T01:42:11.996577', '14178', '1'), + ('4.99', '524', '2007-03-20T20:21:47.996577', '14046', '2'), + ('4.99', '524', '2007-04-12T12:59:17.996577', '6745', '2'), + ('6.99', '524', '2007-04-29T07:58:10.996577', '8507', '1'), + ('4.99', '524', '2007-04-11T08:40:20.996577', '6161', '2'), + ('5.99', '524', '2007-04-07T18:17:02.996577', '4366', '1'), + ('2.99', '524', '2007-03-20T05:23:50.996577', '13626', '2'), + ('2.99', '524', '2007-03-21T08:00:05.996577', '14366', '1'), + ('0.99', '153', '2007-04-30T13:56:07.996577', '9936', '2'), + ('0.99', '153', '2007-02-19T08:48:35.996577', '2649', '1'), + ('7.99', '153', '2007-04-28T07:03:13.996577', '7824', '2'), + ('0.99', '153', '2007-03-22T17:06:14.996577', '15267', '2'), + ('5.99', '153', '2007-04-08T08:42:44.996577', '4670', '2'), + ('4.99', '153', '2007-03-21T21:28:28.996577', '14747', '1'), + ('4.99', '153', '2007-02-20T00:50:34.996577', '2893', '1'), + ('5.99', '153', '2007-02-20T04:17:53.996577', '2945', '1'), + ('9.99', '153', '2007-04-12T16:49:20.996577', '6818', '2'), + ('0.99', '153', '2007-04-06T20:15:02.996577', '3949', '1'), + ('1.99', '153', '2007-03-23T04:43:35.996577', '15593', '1'), + ('4.99', '153', '2007-03-22T04:29:52.996577', '14944', '1'), + ('3.99', '153', '2007-03-18T09:13:23.996577', '12439', '1'), + ('1.99', '153', '2007-03-17T21:17:35.996577', '12103', '1'), + ('4.99', '153', '2007-03-19T02:02:12.996577', '12882', '1'), + ('5.99', '153', '2007-04-07T09:28:05.996577', '4194', '1'), + ('4.99', '153', '2007-04-30T16:39:43.996577', '10015', '2'), + ('0.99', '153', '2007-04-10T07:06:58.996577', '5676', '2'), + ('4.99', '153', '2007-03-21T18:17:13.996577', '14664', '1'), + ('7.99', '153', '2007-03-22T23:15:18.996577', '15444', '2'), + ('0.99', '153', '2007-04-06T13:06:07.996577', '3795', '1'), + ('4.99', '153', '2007-03-02T16:31:31.996577', '11368', '2'), + ('0.99', '153', '2007-04-10T11:55:11.996577', '5771', '2'), + ('0.99', '153', '2007-02-18T02:02:24.996577', '2224', '1'), + ('4.99', '500', '2007-04-11T00:35:02.996577', '6018', '2'), + ('6.99', '500', '2007-04-29T09:13:43.996577', '8538', '1'), + ('2.99', '500', '2007-03-23T04:17:47.996577', '15584', '1'), + ('2.99', '500', '2007-02-20T07:48:55.996577', '2996', '1'), + ('6.99', '500', '2007-02-18T23:31:33.996577', '2526', '2'), + ('2.99', '500', '2007-03-23T14:22:46.996577', '15853', '1'), + ('4.99', '500', '2007-04-06T19:11:01.996577', '3926', '2'), + ('0.99', '500', '2007-04-30T00:37:40.996577', '8925', '1'), + ('5.99', '500', '2007-02-15T14:17:07.996577', '1388', '2'), + ('0.99', '500', '2007-04-08T03:31:09.996577', '4561', '1'), + ('2.99', '500', '2007-03-18T16:41:31.996577', '12639', '1'), + ('4.99', '500', '2007-04-08T14:53:53.996577', '4790', '2'), + ('3.99', '500', '2007-04-12T15:37:34.996577', '6801', '2'), + ('2.99', '500', '2007-04-28T10:38:28.996577', '7925', '1'), + ('0.99', '500', '2007-04-28T08:18:06.996577', '7857', '1'), + ('4.99', '500', '2007-03-20T05:32:19.996577', '13628', '2'), + ('1.99', '500', '2007-03-02T10:57:38.996577', '11218', '2'), + ('3.99', '500', '2007-04-30T14:27:34.996577', '9290', '2'), + ('4.99', '500', '2007-03-22T05:07:50.996577', '14964', '1'), + ('5.99', '500', '2007-02-15T13:23:22.996577', '1375', '1'), + ('3.99', '500', '2007-02-17T23:48:52.996577', '2189', '2'), + ('6.99', '500', '2007-03-02T01:51:43.996577', '10947', '1'), + ('2.99', '500', '2007-04-11T09:57:17.996577', '6187', '2'), + ('2.99', '500', '2007-03-18T23:22:48.996577', '12813', '2'), + ('0.99', '500', '2007-03-21T09:15:17.996577', '14407', '1') + ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) + JOIN _pgslice_id_map map0 + ON map0.table_name = '"public"."customer"' + AND map0.old_id = data.old_customer_id + JOIN _pgslice_id_map map1 + ON map1.table_name = '"public"."rental"' + AND map1.old_id = data.old_rental_id + JOIN _pgslice_id_map map2 + ON map2.table_name = '"public"."staff"' + AND map2.old_id = data.old_staff_id + RETURNING payment_id + ) + SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; + + FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP + INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); + END LOOP; + +END $$; + +-- Cleanup +DROP TABLE IF EXISTS _pgslice_id_map; diff --git a/src/pgslice/cli.py b/src/pgslice/cli.py index 2a48cbf..f5f13d1 100644 --- a/src/pgslice/cli.py +++ b/src/pgslice/cli.py @@ -160,7 +160,7 @@ def run_cli_dump( return 1 pk_values = fetch_pks_by_timeframe( - conn_manager, args.table, args.schema, timeframe + conn_manager, args.dump, args.schema, timeframe ) if not pk_values: printy("[y]No records found matching the timeframe@") @@ -170,8 +170,9 @@ def run_cli_dump( sys.stderr.write("Error: --pks or --timeframe is required\n") return 1 - # Show progress only if stderr is a TTY (not piped) - show_progress = sys.stderr.isatty() + # Always show progress since we're writing to files (not stdout) + # Users want to see progress for large datasets + show_progress = True # Wide mode warning if args.wide and show_progress: @@ -186,7 +187,7 @@ def run_cli_dump( # Execute dump result = service.dump( - table=args.table, + table=args.dump, pk_values=pk_values, schema=args.schema, wide_mode=args.wide, @@ -196,12 +197,20 @@ def run_cli_dump( show_graph=args.graph, ) - # Output SQL + # Always write to file (never stdout) if args.output: - SQLWriter.write_to_file(result.sql_content, args.output) - printy(f"[g]Wrote {result.record_count} records to {args.output}@") + output_path = args.output else: - SQLWriter.write_to_stdout(result.sql_content) + # Generate default filename like REPL mode does + output_path = SQLWriter.get_default_output_path( + config.output_dir, + args.dump, # table name + pk_values[0] if pk_values else "multi", # first PK for filename + args.schema, + ) + + SQLWriter.write_to_file(result.sql_content, str(output_path)) + printy(f"[g]✓ Wrote {result.record_count} records to {output_path}@") return 0 @@ -260,14 +269,14 @@ def main() -> int: formatter_class=argparse.RawDescriptionHelpFormatter, epilog=""" Examples: - # Dump to stdout - PGPASSWORD=xxx %(prog)s --host localhost --database mydb --table users --pks 42 + # Dump to auto-generated file (shows progress) + PGPASSWORD=xxx %(prog)s --host localhost --database mydb --dump users --pks 42 # Dump by timeframe (instead of PKs) - %(prog)s --host localhost --database mydb --table orders --timeframe "created_at:2024-01-01:2024-12-31" + %(prog)s --host localhost --database mydb --dump orders --timeframe "created_at:2024-01-01:2024-12-31" - # Dump to file with truncate filter for related tables - %(prog)s --table users --pks 1 --truncate "orders:created_at:2024-01-01:2024-12-31" --output user.sql + # Dump to specific file with truncate filter for related tables + %(prog)s --dump users --pks 1 --truncate "orders:created_at:2024-01-01:2024-12-31" --output user.sql # List all tables %(prog)s --host localhost --database mydb --tables @@ -340,8 +349,9 @@ def main() -> int: # Dump operation arguments (non-interactive CLI mode) dump_group = parser.add_argument_group("Dump Operation (CLI mode)") dump_group.add_argument( - "--table", - help="Table name to dump (enables non-interactive CLI mode)", + "--dump", + "-d", + help="Table name to dump (same as 'dump' command in REPL mode)", ) # --pks and --timeframe are mutually exclusive ways to select records @@ -432,9 +442,9 @@ def main() -> int: config.log_level = args.log_level # Validate CLI dump mode arguments - if args.table and not args.pks and not args.timeframe: + if args.dump and not args.pks and not args.timeframe: sys.stderr.write( - "Error: --pks or --timeframe is required when using --table\n" + "Error: --pks or --timeframe is required when using --dump\n" ) return 1 @@ -485,7 +495,7 @@ def main() -> int: if args.describe: return run_describe_table(conn_manager, args.schema, args.describe) - if args.table: + if args.dump: # Non-interactive CLI dump mode return run_cli_dump(args, config, conn_manager) else: From df985aec3180c9d186d5418366a162f36dbe74d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgardo=20Obreg=C3=B3n?= Date: Mon, 29 Dec 2025 08:18:15 -0500 Subject: [PATCH 2/3] perf: optimize traversal relationships with batch querying --- .gitignore | 1 + dumps/store_1_20251229_115627.sql | 127 - dumps/store_1_20251229_121147.sql | 56555 ------------------ src/pgslice/cli.py | 25 +- src/pgslice/dumper/dump_service.py | 90 +- src/pgslice/dumper/sql_generator.py | 10 + src/pgslice/graph/traverser.py | 352 +- src/pgslice/repl.py | 27 +- src/pgslice/utils/spinner.py | 40 + tests/unit/graph/test_traverser.py | 11 +- tests/unit/graph/test_traverser_progress.py | 185 - tests/unit/test_cli.py | 36 +- 12 files changed, 434 insertions(+), 57025 deletions(-) delete mode 100644 dumps/store_1_20251229_115627.sql delete mode 100644 dumps/store_1_20251229_121147.sql delete mode 100644 tests/unit/graph/test_traverser_progress.py diff --git a/.gitignore b/.gitignore index 013fe9d..4e5dee5 100644 --- a/.gitignore +++ b/.gitignore @@ -145,6 +145,7 @@ Thumbs.db .pgslice_history schema_cache.db output/ +dumps/ # AI CLAUDE.md diff --git a/dumps/store_1_20251229_115627.sql b/dumps/store_1_20251229_115627.sql deleted file mode 100644 index b2f2b44..0000000 --- a/dumps/store_1_20251229_115627.sql +++ /dev/null @@ -1,127 +0,0 @@ --- Generated by pgslice --- Date: 2025-12-29T11:56:27.238674 --- Records: 6 --- Mode: PL/pgSQL with ID remapping - --- Create temporary table for ID mapping -CREATE TEMP TABLE IF NOT EXISTS _pgslice_id_map ( - table_name TEXT NOT NULL, - old_id TEXT NOT NULL, - new_id TEXT NOT NULL, - PRIMARY KEY (table_name, old_id) -); - --- Main PL/pgSQL block with ID remapping -DO $$ -DECLARE - v_new_id_staff integer; - v_new_ids_staff integer[]; - v_old_ids_staff TEXT[]; - v_new_id_country integer; - v_new_ids_country integer[]; - v_old_ids_country TEXT[]; - v_new_id_city integer; - v_new_ids_city integer[]; - v_old_ids_city TEXT[]; - v_new_id_store integer; - v_new_ids_store integer[]; - v_old_ids_store TEXT[]; - v_new_id_address integer; - v_new_ids_address integer[]; - v_old_ids_address TEXT[]; - i INTEGER; -BEGIN - - -- Table: "public"."country" (1 records) - INSERT INTO "public"."country" ("country", "last_update") - VALUES - ('Canada', '2006-02-15T09:44:00') - RETURNING country_id INTO v_new_id_country; - INSERT INTO _pgslice_id_map VALUES ('"public"."country"', '20', v_new_id_country::TEXT); - - -- Table: "public"."city" (1 records) - INSERT INTO "public"."city" ("city", "country_id", "last_update") - SELECT - data.city::character varying, - map0.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('Lethbridge', '20', '2006-02-15T09:45:25') - ) AS data(city, old_country_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."country"' - AND map0.old_id = data.old_country_id - RETURNING city_id INTO v_new_id_city; - INSERT INTO _pgslice_id_map VALUES ('"public"."city"', '300', v_new_id_city::TEXT); - - -- Table: "public"."address" (2 records) - v_old_ids_address := ARRAY['1', '3']; - WITH inserted AS ( - INSERT INTO "public"."address" ("address", "address2", "city_id", "district", "last_update", "phone", "postal_code") - SELECT - data.address::character varying, - data.address2::character varying, - map0.new_id::smallint, - data.district::character varying, - data.last_update::timestamp without time zone, - data.phone::character varying, - data.postal_code::character varying - FROM (VALUES - ('47 MySakila Drive', NULL, '300', 'Alberta', '2006-02-15T09:45:30', '', ''), - ('23 Workhaven Lane', NULL, '300', 'Alberta', '2006-02-15T09:45:30', '14033335568', '') - ) AS data(address, address2, old_city_id, district, last_update, phone, postal_code) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."city"' - AND map0.old_id = data.old_city_id - RETURNING address_id - ) - SELECT array_agg(address_id) INTO v_new_ids_address FROM inserted; - - FOR i IN 1..array_length(v_new_ids_address, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."address"', v_old_ids_address[i], v_new_ids_address[i]::TEXT); - END LOOP; - - -- Table: "public"."staff" (1 records) - INSERT INTO "public"."staff" ("active", "address_id", "email", "first_name", "last_name", "last_update", "password", "picture", "store_id", "username") - SELECT - data.active::boolean, - map0.new_id::smallint, - data.email::character varying, - data.first_name::character varying, - data.last_name::character varying, - data.last_update::timestamp without time zone, - data.password::character varying, - data.picture::bytea, - data.store_id::smallint, - data.username::character varying - FROM (VALUES - (TRUE, '3', 'Mike.Hillyer@sakilastaff.com', 'Mike', 'Hillyer', '2006-05-16T16:13:11.793280', '8cb2237d0679ca88db6464eac60da96345513964', '\x89504e470d0a5a0a', 1, 'Mike') - ) AS data(active, old_address_id, email, first_name, last_name, last_update, password, picture, store_id, username) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."address"' - AND map0.old_id = data.old_address_id - RETURNING staff_id INTO v_new_id_staff; - INSERT INTO _pgslice_id_map VALUES ('"public"."staff"', '1', v_new_id_staff::TEXT); - - -- Table: "public"."store" (1 records) - INSERT INTO "public"."store" ("address_id", "last_update", "manager_staff_id") - SELECT - map0.new_id::smallint, - data.last_update::timestamp without time zone, - map1.new_id::smallint - FROM (VALUES - ('1', '2006-02-15T09:57:12', '1') - ) AS data(old_address_id, last_update, old_manager_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."address"' - AND map0.old_id = data.old_address_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."staff"' - AND map1.old_id = data.old_manager_staff_id - RETURNING store_id INTO v_new_id_store; - INSERT INTO _pgslice_id_map VALUES ('"public"."store"', '1', v_new_id_store::TEXT); - -END $$; - --- Cleanup -DROP TABLE IF EXISTS _pgslice_id_map; diff --git a/dumps/store_1_20251229_121147.sql b/dumps/store_1_20251229_121147.sql deleted file mode 100644 index e82268c..0000000 --- a/dumps/store_1_20251229_121147.sql +++ /dev/null @@ -1,56555 +0,0 @@ --- NOTE: PostgreSQL does not support 'CREATE DATABASE IF NOT EXISTS'. --- If the database already exists, comment out the line below or it will fail. --- For a new database: Uncomment the following line --- CREATE DATABASE "dvdrental"; - --- Connect to the database before creating schemas/tables. --- For psql: Use the \c command below --- For other clients: Disconnect and reconnect to the database manually -\c "dvdrental" - -CREATE SCHEMA IF NOT EXISTS "public"; - -CREATE TABLE IF NOT EXISTS "public"."customer" ( - "customer_id" INTEGER NOT NULL, - "store_id" SMALLINT NOT NULL, - "first_name" TEXT NOT NULL, - "last_name" TEXT NOT NULL, - "email" TEXT, - "address_id" SMALLINT NOT NULL, - "activebool" BOOLEAN NOT NULL DEFAULT true, - "create_date" DATE NOT NULL DEFAULT ('now'::text)::date, - "last_update" TIMESTAMP DEFAULT now(), - "active" INTEGER -); -CREATE TABLE IF NOT EXISTS "public"."city" ( - "city_id" INTEGER NOT NULL, - "city" TEXT NOT NULL, - "country_id" SMALLINT NOT NULL, - "last_update" TIMESTAMP NOT NULL DEFAULT now() -); -CREATE TABLE IF NOT EXISTS "public"."inventory" ( - "inventory_id" INTEGER NOT NULL, - "film_id" SMALLINT NOT NULL, - "store_id" SMALLINT NOT NULL, - "last_update" TIMESTAMP NOT NULL DEFAULT now() -); -CREATE TABLE IF NOT EXISTS "public"."address" ( - "address_id" INTEGER NOT NULL, - "address" TEXT NOT NULL, - "address2" TEXT, - "district" TEXT NOT NULL, - "city_id" SMALLINT NOT NULL, - "postal_code" TEXT, - "phone" TEXT NOT NULL, - "last_update" TIMESTAMP NOT NULL DEFAULT now() -); -CREATE TABLE IF NOT EXISTS "public"."category" ( - "category_id" INTEGER NOT NULL, - "name" TEXT NOT NULL, - "last_update" TIMESTAMP NOT NULL DEFAULT now() -); -CREATE TABLE IF NOT EXISTS "public"."film_actor" ( - "actor_id" SMALLINT NOT NULL PRIMARY KEY, - "film_id" SMALLINT NOT NULL PRIMARY KEY, - "last_update" TIMESTAMP NOT NULL DEFAULT now(), - PRIMARY KEY ("actor_id", "film_id") -); -CREATE TABLE IF NOT EXISTS "public"."country" ( - "country_id" INTEGER NOT NULL, - "country" TEXT NOT NULL, - "last_update" TIMESTAMP NOT NULL DEFAULT now() -); -CREATE TABLE IF NOT EXISTS "public"."actor" ( - "actor_id" INTEGER NOT NULL, - "first_name" TEXT NOT NULL, - "last_name" TEXT NOT NULL, - "last_update" TIMESTAMP NOT NULL DEFAULT now() -); -CREATE TABLE IF NOT EXISTS "public"."film_category" ( - "film_id" SMALLINT NOT NULL PRIMARY KEY, - "category_id" SMALLINT NOT NULL PRIMARY KEY, - "last_update" TIMESTAMP NOT NULL DEFAULT now(), - PRIMARY KEY ("film_id", "category_id") -); -CREATE TABLE IF NOT EXISTS "public"."payment" ( - "payment_id" INTEGER NOT NULL, - "customer_id" SMALLINT NOT NULL, - "staff_id" SMALLINT NOT NULL, - "rental_id" INTEGER NOT NULL, - "amount" NUMERIC NOT NULL, - "payment_date" TIMESTAMP NOT NULL -); -CREATE TABLE IF NOT EXISTS "public"."language" ( - "language_id" INTEGER NOT NULL, - "name" CHAR NOT NULL, - "last_update" TIMESTAMP NOT NULL DEFAULT now() -); -CREATE TABLE IF NOT EXISTS "public"."store" ( - "store_id" INTEGER NOT NULL, - "manager_staff_id" SMALLINT NOT NULL, - "address_id" SMALLINT NOT NULL, - "last_update" TIMESTAMP NOT NULL DEFAULT now() -); -CREATE TABLE IF NOT EXISTS "public"."staff" ( - "staff_id" INTEGER NOT NULL, - "first_name" TEXT NOT NULL, - "last_name" TEXT NOT NULL, - "address_id" SMALLINT NOT NULL, - "email" TEXT, - "store_id" SMALLINT NOT NULL, - "active" BOOLEAN NOT NULL DEFAULT true, - "username" TEXT NOT NULL, - "password" TEXT, - "last_update" TIMESTAMP NOT NULL DEFAULT now(), - "picture" BYTEA -); -CREATE TABLE IF NOT EXISTS "public"."film" ( - "film_id" INTEGER NOT NULL, - "title" TEXT NOT NULL, - "description" TEXT, - "release_year" INTEGER, - "language_id" SMALLINT NOT NULL, - "rental_duration" SMALLINT NOT NULL DEFAULT 3, - "rental_rate" NUMERIC NOT NULL DEFAULT 4.99, - "length" SMALLINT, - "replacement_cost" NUMERIC NOT NULL DEFAULT 19.99, - "rating" mpaa_rating DEFAULT 'G'::mpaa_rating, - "last_update" TIMESTAMP NOT NULL DEFAULT now(), - "special_features" TEXT[], - "fulltext" TSVECTOR NOT NULL -); -CREATE TABLE IF NOT EXISTS "public"."rental" ( - "rental_id" INTEGER NOT NULL, - "rental_date" TIMESTAMP NOT NULL, - "inventory_id" INTEGER NOT NULL, - "customer_id" SMALLINT NOT NULL, - "return_date" TIMESTAMP, - "staff_id" SMALLINT NOT NULL, - "last_update" TIMESTAMP NOT NULL DEFAULT now() -); - --- Add foreign key constraints -ALTER TABLE "public"."customer" - ADD CONSTRAINT "customer_address_id_fkey" - FOREIGN KEY ("address_id") - REFERENCES "public"."public.address"("address_id") - ON DELETE RESTRICT; -ALTER TABLE "public"."city" - ADD CONSTRAINT "fk_city" - FOREIGN KEY ("country_id") - REFERENCES "public"."public.country"("country_id"); -ALTER TABLE "public"."inventory" - ADD CONSTRAINT "inventory_film_id_fkey" - FOREIGN KEY ("film_id") - REFERENCES "public"."public.film"("film_id") - ON DELETE RESTRICT; -ALTER TABLE "public"."address" - ADD CONSTRAINT "fk_address_city" - FOREIGN KEY ("city_id") - REFERENCES "public"."public.city"("city_id"); -ALTER TABLE "public"."film_actor" - ADD CONSTRAINT "film_actor_actor_id_fkey" - FOREIGN KEY ("actor_id") - REFERENCES "public"."public.actor"("actor_id") - ON DELETE RESTRICT; - -ALTER TABLE "public"."film_actor" - ADD CONSTRAINT "film_actor_film_id_fkey" - FOREIGN KEY ("film_id") - REFERENCES "public"."public.film"("film_id") - ON DELETE RESTRICT; -ALTER TABLE "public"."film_category" - ADD CONSTRAINT "film_category_category_id_fkey" - FOREIGN KEY ("category_id") - REFERENCES "public"."public.category"("category_id") - ON DELETE RESTRICT; - -ALTER TABLE "public"."film_category" - ADD CONSTRAINT "film_category_film_id_fkey" - FOREIGN KEY ("film_id") - REFERENCES "public"."public.film"("film_id") - ON DELETE RESTRICT; -ALTER TABLE "public"."payment" - ADD CONSTRAINT "payment_customer_id_fkey" - FOREIGN KEY ("customer_id") - REFERENCES "public"."public.customer"("customer_id") - ON DELETE RESTRICT; - -ALTER TABLE "public"."payment" - ADD CONSTRAINT "payment_rental_id_fkey" - FOREIGN KEY ("rental_id") - REFERENCES "public"."public.rental"("rental_id") - ON DELETE SET NULL; - -ALTER TABLE "public"."payment" - ADD CONSTRAINT "payment_staff_id_fkey" - FOREIGN KEY ("staff_id") - REFERENCES "public"."public.staff"("staff_id") - ON DELETE RESTRICT; -ALTER TABLE "public"."store" - ADD CONSTRAINT "store_address_id_fkey" - FOREIGN KEY ("address_id") - REFERENCES "public"."public.address"("address_id") - ON DELETE RESTRICT; - -ALTER TABLE "public"."store" - ADD CONSTRAINT "store_manager_staff_id_fkey" - FOREIGN KEY ("manager_staff_id") - REFERENCES "public"."public.staff"("staff_id") - ON DELETE RESTRICT; -ALTER TABLE "public"."staff" - ADD CONSTRAINT "staff_address_id_fkey" - FOREIGN KEY ("address_id") - REFERENCES "public"."public.address"("address_id") - ON DELETE RESTRICT; -ALTER TABLE "public"."film" - ADD CONSTRAINT "film_language_id_fkey" - FOREIGN KEY ("language_id") - REFERENCES "public"."public.language"("language_id") - ON DELETE RESTRICT; -ALTER TABLE "public"."rental" - ADD CONSTRAINT "rental_customer_id_fkey" - FOREIGN KEY ("customer_id") - REFERENCES "public"."public.customer"("customer_id") - ON DELETE RESTRICT; - -ALTER TABLE "public"."rental" - ADD CONSTRAINT "rental_inventory_id_fkey" - FOREIGN KEY ("inventory_id") - REFERENCES "public"."public.inventory"("inventory_id") - ON DELETE RESTRICT; - -ALTER TABLE "public"."rental" - ADD CONSTRAINT "rental_staff_id_key" - FOREIGN KEY ("staff_id") - REFERENCES "public"."public.staff"("staff_id"); - --- Generated by pgslice --- Date: 2025-12-29T12:11:44.092831 --- Records: 44815 --- Mode: PL/pgSQL with ID remapping - --- Create temporary table for ID mapping -CREATE TEMP TABLE IF NOT EXISTS _pgslice_id_map ( - table_name TEXT NOT NULL, - old_id TEXT NOT NULL, - new_id TEXT NOT NULL, - PRIMARY KEY (table_name, old_id) -); - --- Main PL/pgSQL block with ID remapping -DO $$ -DECLARE - v_new_id_customer integer; - v_new_ids_customer integer[]; - v_old_ids_customer TEXT[]; - v_new_id_city integer; - v_new_ids_city integer[]; - v_old_ids_city TEXT[]; - v_new_id_inventory integer; - v_new_ids_inventory integer[]; - v_old_ids_inventory TEXT[]; - v_new_id_address integer; - v_new_ids_address integer[]; - v_old_ids_address TEXT[]; - v_new_id_category integer; - v_new_ids_category integer[]; - v_old_ids_category TEXT[]; - v_new_id_payment integer; - v_new_ids_payment integer[]; - v_old_ids_payment TEXT[]; - v_new_id_country integer; - v_new_ids_country integer[]; - v_old_ids_country TEXT[]; - v_new_id_actor integer; - v_new_ids_actor integer[]; - v_old_ids_actor TEXT[]; - v_new_id_language integer; - v_new_ids_language integer[]; - v_old_ids_language TEXT[]; - v_new_id_store integer; - v_new_ids_store integer[]; - v_old_ids_store TEXT[]; - v_new_id_staff integer; - v_new_ids_staff integer[]; - v_old_ids_staff TEXT[]; - v_new_id_film integer; - v_new_ids_film integer[]; - v_old_ids_film TEXT[]; - v_new_id_rental integer; - v_new_ids_rental integer[]; - v_old_ids_rental TEXT[]; - i INTEGER; -BEGIN - - -- Table: "public"."category" (16 records) - v_old_ids_category := ARRAY['9', '1', '5', '15', '2', '12', '14', '3', '4', '13', '16', '7', '6', '11', '8', '10']; - WITH inserted AS ( - INSERT INTO "public"."category" ("last_update", "name") - VALUES - ('2006-02-15T09:46:27', 'Foreign'), - ('2006-02-15T09:46:27', 'Action'), - ('2006-02-15T09:46:27', 'Comedy'), - ('2006-02-15T09:46:27', 'Sports'), - ('2006-02-15T09:46:27', 'Animation'), - ('2006-02-15T09:46:27', 'Music'), - ('2006-02-15T09:46:27', 'Sci-Fi'), - ('2006-02-15T09:46:27', 'Children'), - ('2006-02-15T09:46:27', 'Classics'), - ('2006-02-15T09:46:27', 'New'), - ('2006-02-15T09:46:27', 'Travel'), - ('2006-02-15T09:46:27', 'Drama'), - ('2006-02-15T09:46:27', 'Documentary'), - ('2006-02-15T09:46:27', 'Horror'), - ('2006-02-15T09:46:27', 'Family'), - ('2006-02-15T09:46:27', 'Games') - RETURNING category_id - ) - SELECT array_agg(category_id) INTO v_new_ids_category FROM inserted; - - FOR i IN 1..array_length(v_new_ids_category, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."category"', v_old_ids_category[i], v_new_ids_category[i]::TEXT); - END LOOP; - - -- Table: "public"."actor" (200 records) - v_old_ids_actor := ARRAY['103', '145', '133', '68', '199', '113', '190', '119', '28', '38', '42', '107', '84', '172', '117', '40', '51', '167', '18', '56', '10', '159', '109', '178', '123', '194', '59', '20', '142', '9', '135', '160', '146', '48', '94', '164', '23', '161', '39', '83', '11', '50', '157', '44', '1', '189', '98', '8', '106', '200', '49', '195', '70', '148', '36', '155', '5', '79', '125', '95', '64', '99', '89', '134', '188', '25', '67', '198', '131', '163', '76', '129', '116', '15', '151', '2', '86', '80', '52', '63', '12', '130', '182', '14', '100', '45', '175', '75', '33', '105', '132', '170', '140', '126', '144', '71', '139', '158', '168', '193']; - WITH inserted AS ( - INSERT INTO "public"."actor" ("first_name", "last_name", "last_update") - VALUES - ('Matthew', 'Leigh', '2013-05-26T14:47:57.620000'), - ('Kim', 'Allen', '2013-05-26T14:47:57.620000'), - ('Richard', 'Penn', '2013-05-26T14:47:57.620000'), - ('Rip', 'Winslet', '2013-05-26T14:47:57.620000'), - ('Julia', 'Fawcett', '2013-05-26T14:47:57.620000'), - ('Morgan', 'Hopkins', '2013-05-26T14:47:57.620000'), - ('Audrey', 'Bailey', '2013-05-26T14:47:57.620000'), - ('Warren', 'Jackman', '2013-05-26T14:47:57.620000'), - ('Woody', 'Hoffman', '2013-05-26T14:47:57.620000'), - ('Tom', 'Mckellen', '2013-05-26T14:47:57.620000'), - ('Tom', 'Miranda', '2013-05-26T14:47:57.620000'), - ('Gina', 'Degeneres', '2013-05-26T14:47:57.620000'), - ('James', 'Pitt', '2013-05-26T14:47:57.620000'), - ('Groucho', 'Williams', '2013-05-26T14:47:57.620000'), - ('Renee', 'Tracy', '2013-05-26T14:47:57.620000'), - ('Johnny', 'Cage', '2013-05-26T14:47:57.620000'), - ('Gary', 'Phoenix', '2013-05-26T14:47:57.620000'), - ('Laurence', 'Bullock', '2013-05-26T14:47:57.620000'), - ('Dan', 'Torn', '2013-05-26T14:47:57.620000'), - ('Dan', 'Harris', '2013-05-26T14:47:57.620000'), - ('Christian', 'Gable', '2013-05-26T14:47:57.620000'), - ('Laura', 'Brody', '2013-05-26T14:47:57.620000'), - ('Sylvester', 'Dern', '2013-05-26T14:47:57.620000'), - ('Lisa', 'Monroe', '2013-05-26T14:47:57.620000'), - ('Julianne', 'Dench', '2013-05-26T14:47:57.620000'), - ('Meryl', 'Allen', '2013-05-26T14:47:57.620000'), - ('Dustin', 'Tautou', '2013-05-26T14:47:57.620000'), - ('Lucille', 'Tracy', '2013-05-26T14:47:57.620000'), - ('Jada', 'Ryder', '2013-05-26T14:47:57.620000'), - ('Joe', 'Swank', '2013-05-26T14:47:57.620000'), - ('Rita', 'Reynolds', '2013-05-26T14:47:57.620000'), - ('Chris', 'Depp', '2013-05-26T14:47:57.620000'), - ('Albert', 'Johansson', '2013-05-26T14:47:57.620000'), - ('Frances', 'Day-Lewis', '2013-05-26T14:47:57.620000'), - ('Kenneth', 'Torn', '2013-05-26T14:47:57.620000'), - ('Humphrey', 'Willis', '2013-05-26T14:47:57.620000'), - ('Sandra', 'Kilmer', '2013-05-26T14:47:57.620000'), - ('Harvey', 'Hope', '2013-05-26T14:47:57.620000'), - ('Goldie', 'Brody', '2013-05-26T14:47:57.620000'), - ('Ben', 'Willis', '2013-05-26T14:47:57.620000'), - ('Zero', 'Cage', '2013-05-26T14:47:57.620000'), - ('Natalie', 'Hopkins', '2013-05-26T14:47:57.620000'), - ('Greta', 'Malden', '2013-05-26T14:47:57.620000'), - ('Nick', 'Stallone', '2013-05-26T14:47:57.620000'), - ('Penelope', 'Guiness', '2013-05-26T14:47:57.620000'), - ('Cuba', 'Birch', '2013-05-26T14:47:57.620000'), - ('Chris', 'Bridges', '2013-05-26T14:47:57.620000'), - ('Matthew', 'Johansson', '2013-05-26T14:47:57.620000'), - ('Groucho', 'Dunst', '2013-05-26T14:47:57.620000'), - ('Thora', 'Temple', '2013-05-26T14:47:57.620000'), - ('Anne', 'Cronyn', '2013-05-26T14:47:57.620000'), - ('Jayne', 'Silverstone', '2013-05-26T14:47:57.620000'), - ('Michelle', 'Mcconaughey', '2013-05-26T14:47:57.620000'), - ('Emily', 'Dee', '2013-05-26T14:47:57.620000'), - ('Burt', 'Dukakis', '2013-05-26T14:47:57.620000'), - ('Ian', 'Tandy', '2013-05-26T14:47:57.620000'), - ('Johnny', 'Lollobrigida', '2013-05-26T14:47:57.620000'), - ('Mae', 'Hoffman', '2013-05-26T14:47:57.620000'), - ('Albert', 'Nolte', '2013-05-26T14:47:57.620000'), - ('Daryl', 'Wahlberg', '2013-05-26T14:47:57.620000'), - ('Ray', 'Johansson', '2013-05-26T14:47:57.620000'), - ('Jim', 'Mostel', '2013-05-26T14:47:57.620000'), - ('Charlize', 'Dench', '2013-05-26T14:47:57.620000'), - ('Gene', 'Hopkins', '2013-05-26T14:47:57.620000'), - ('Rock', 'Dukakis', '2013-05-26T14:47:57.620000'), - ('Kevin', 'Bloom', '2013-05-26T14:47:57.620000'), - ('Jessica', 'Bailey', '2013-05-26T14:47:57.620000'), - ('Mary', 'Keitel', '2013-05-26T14:47:57.620000'), - ('Jane', 'Jackman', '2013-05-26T14:47:57.620000'), - ('Christopher', 'West', '2013-05-26T14:47:57.620000'), - ('Angelina', 'Astaire', '2013-05-26T14:47:57.620000'), - ('Daryl', 'Crawford', '2013-05-26T14:47:57.620000'), - ('Dan', 'Streep', '2013-05-26T14:47:57.620000'), - ('Cuba', 'Olivier', '2013-05-26T14:47:57.620000'), - ('Geoffrey', 'Heston', '2013-05-26T14:47:57.620000'), - ('Nick', 'Wahlberg', '2013-05-26T14:47:57.620000'), - ('Greg', 'Chaplin', '2013-05-26T14:47:57.620000'), - ('Ralph', 'Cruz', '2013-05-26T14:47:57.620000'), - ('Carmen', 'Hunt', '2013-05-26T14:47:57.620000'), - ('Cameron', 'Wray', '2013-05-26T14:47:57.620000'), - ('Karl', 'Berry', '2013-05-26T14:47:57.620000'), - ('Greta', 'Keitel', '2013-05-26T14:47:57.620000'), - ('Debbie', 'Akroyd', '2013-05-26T14:47:57.620000'), - ('Vivien', 'Bergen', '2013-05-26T14:47:57.620000'), - ('Spencer', 'Depp', '2013-05-26T14:47:57.620000'), - ('Reese', 'Kilmer', '2013-05-26T14:47:57.620000'), - ('William', 'Hackman', '2013-05-26T14:47:57.620000'), - ('Burt', 'Posey', '2013-05-26T14:47:57.620000'), - ('Milla', 'Peck', '2013-05-26T14:47:57.620000'), - ('Sidney', 'Crowe', '2013-05-26T14:47:57.620000'), - ('Adam', 'Hopper', '2013-05-26T14:47:57.620000'), - ('Mena', 'Hopper', '2013-05-26T14:47:57.620000'), - ('Whoopi', 'Hurt', '2013-05-26T14:47:57.620000'), - ('Frances', 'Tomei', '2013-05-26T14:47:57.620000'), - ('Angela', 'Witherspoon', '2013-05-26T14:47:57.620000'), - ('Adam', 'Grant', '2013-05-26T14:47:57.620000'), - ('Ewan', 'Gooding', '2013-05-26T14:47:57.620000'), - ('Vivien', 'Basinger', '2013-05-26T14:47:57.620000'), - ('Will', 'Wilson', '2013-05-26T14:47:57.620000'), - ('Burt', 'Temple', '2013-05-26T14:47:57.620000') - RETURNING actor_id - ) - SELECT array_agg(actor_id) INTO v_new_ids_actor FROM inserted; - - FOR i IN 1..array_length(v_new_ids_actor, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."actor"', v_old_ids_actor[i], v_new_ids_actor[i]::TEXT); - END LOOP; - - v_old_ids_actor := ARRAY['57', '120', '27', '96', '65', '118', '87', '47', '102', '150', '143', '29', '147', '177', '165', '97', '61', '35', '171', '22', '156', '111', '21', '108', '186', '69', '41', '93', '192', '43', '101', '152', '162', '74', '53', '191', '196', '104', '54', '88', '77', '72', '179', '60', '24', '122', '187', '112', '166', '30', '181', '3', '46', '32', '26', '37', '184', '153', '90', '137', '4', '34', '91', '124', '180', '127', '154', '19', '78', '13', '16', '197', '185', '7', '66', '173', '115', '128', '6', '110', '62', '176', '82', '169', '55', '136', '183', '174', '85', '17', '114', '138', '121', '58', '141', '31', '81', '73', '92', '149']; - WITH inserted AS ( - INSERT INTO "public"."actor" ("first_name", "last_name", "last_update") - VALUES - ('Jude', 'Cruise', '2013-05-26T14:47:57.620000'), - ('Penelope', 'Monroe', '2013-05-26T14:47:57.620000'), - ('Julia', 'Mcqueen', '2013-05-26T14:47:57.620000'), - ('Gene', 'Willis', '2013-05-26T14:47:57.620000'), - ('Angela', 'Hudson', '2013-05-26T14:47:57.620000'), - ('Cuba', 'Allen', '2013-05-26T14:47:57.620000'), - ('Spencer', 'Peck', '2013-05-26T14:47:57.620000'), - ('Julia', 'Barrymore', '2013-05-26T14:47:57.620000'), - ('Walter', 'Torn', '2013-05-26T14:47:57.620000'), - ('Jayne', 'Nolte', '2013-05-26T14:47:57.620000'), - ('River', 'Dean', '2013-05-26T14:47:57.620000'), - ('Alec', 'Wayne', '2013-05-26T14:47:57.620000'), - ('Fay', 'Winslet', '2013-05-26T14:47:57.620000'), - ('Gene', 'Mckellen', '2013-05-26T14:47:57.620000'), - ('Al', 'Garland', '2013-05-26T14:47:57.620000'), - ('Meg', 'Hawke', '2013-05-26T14:47:57.620000'), - ('Christian', 'Neeson', '2013-05-26T14:47:57.620000'), - ('Judy', 'Dean', '2013-05-26T14:47:57.620000'), - ('Olympia', 'Pfeiffer', '2013-05-26T14:47:57.620000'), - ('Elvis', 'Marx', '2013-05-26T14:47:57.620000'), - ('Fay', 'Wood', '2013-05-26T14:47:57.620000'), - ('Cameron', 'Zellweger', '2013-05-26T14:47:57.620000'), - ('Kirsten', 'Paltrow', '2013-05-26T14:47:57.620000'), - ('Warren', 'Nolte', '2013-05-26T14:47:57.620000'), - ('Julia', 'Zellweger', '2013-05-26T14:47:57.620000'), - ('Kenneth', 'Paltrow', '2013-05-26T14:47:57.620000'), - ('Jodie', 'Degeneres', '2013-05-26T14:47:57.620000'), - ('Ellen', 'Presley', '2013-05-26T14:47:57.620000'), - ('John', 'Suvari', '2013-05-26T14:47:57.620000'), - ('Kirk', 'Jovovich', '2013-05-26T14:47:57.620000'), - ('Susan', 'Davis', '2013-05-26T14:47:57.620000'), - ('Ben', 'Harris', '2013-05-26T14:47:57.620000'), - ('Oprah', 'Kilmer', '2013-05-26T14:47:57.620000'), - ('Milla', 'Keitel', '2013-05-26T14:47:57.620000'), - ('Mena', 'Temple', '2013-05-26T14:47:57.620000'), - ('Gregory', 'Gooding', '2013-05-26T14:47:57.620000'), - ('Bela', 'Walken', '2013-05-26T14:47:57.620000'), - ('Penelope', 'Cronyn', '2013-05-26T14:47:57.620000'), - ('Penelope', 'Pinkett', '2013-05-26T14:47:57.620000'), - ('Kenneth', 'Pesci', '2013-05-26T14:47:57.620000'), - ('Cary', 'Mcconaughey', '2013-05-26T14:47:57.620000'), - ('Sean', 'Williams', '2013-05-26T14:47:57.620000'), - ('Ed', 'Guiness', '2013-05-26T14:47:57.620000'), - ('Henry', 'Berry', '2013-05-26T14:47:57.620000'), - ('Cameron', 'Streep', '2013-05-26T14:47:57.620000'), - ('Salma', 'Nolte', '2013-05-26T14:47:57.620000'), - ('Renee', 'Ball', '2013-05-26T14:47:57.620000'), - ('Russell', 'Bacall', '2013-05-26T14:47:57.620000'), - ('Nick', 'Degeneres', '2013-05-26T14:47:57.620000'), - ('Sandra', 'Peck', '2013-05-26T14:47:57.620000'), - ('Matthew', 'Carrey', '2013-05-26T14:47:57.620000'), - ('Ed', 'Chase', '2013-05-26T14:47:57.620000'), - ('Parker', 'Goldberg', '2013-05-26T14:47:57.620000'), - ('Tim', 'Hackman', '2013-05-26T14:47:57.620000'), - ('Rip', 'Crawford', '2013-05-26T14:47:57.620000'), - ('Val', 'Bolger', '2013-05-26T14:47:57.620000'), - ('Humphrey', 'Garland', '2013-05-26T14:47:57.620000'), - ('Minnie', 'Kilmer', '2013-05-26T14:47:57.620000'), - ('Sean', 'Guiness', '2013-05-26T14:47:57.620000'), - ('Morgan', 'Williams', '2013-05-26T14:47:57.620000'), - ('Jennifer', 'Davis', '2013-05-26T14:47:57.620000'), - ('Audrey', 'Olivier', '2013-05-26T14:47:57.620000'), - ('Christopher', 'Berry', '2013-05-26T14:47:57.620000'), - ('Scarlett', 'Bening', '2013-05-26T14:47:57.620000'), - ('Jeff', 'Silverstone', '2013-05-26T14:47:57.620000'), - ('Kevin', 'Garland', '2013-05-26T14:47:57.620000'), - ('Meryl', 'Gibson', '2013-05-26T14:47:57.620000'), - ('Bob', 'Fawcett', '2013-05-26T14:47:57.620000'), - ('Groucho', 'Sinatra', '2013-05-26T14:47:57.620000'), - ('Uma', 'Wood', '2013-05-26T14:47:57.620000'), - ('Fred', 'Costner', '2013-05-26T14:47:57.620000'), - ('Reese', 'West', '2013-05-26T14:47:57.620000'), - ('Michael', 'Bolger', '2013-05-26T14:47:57.620000'), - ('Grace', 'Mostel', '2013-05-26T14:47:57.620000'), - ('Mary', 'Tandy', '2013-05-26T14:47:57.620000'), - ('Alan', 'Dreyfuss', '2013-05-26T14:47:57.620000'), - ('Harrison', 'Bale', '2013-05-26T14:47:57.620000'), - ('Cate', 'Mcqueen', '2013-05-26T14:47:57.620000'), - ('Bette', 'Nicholson', '2013-05-26T14:47:57.620000'), - ('Susan', 'Davis', '2013-05-26T14:47:57.620000'), - ('Jayne', 'Neeson', '2013-05-26T14:47:57.620000'), - ('Jon', 'Chase', '2013-05-26T14:47:57.620000'), - ('Woody', 'Jolie', '2013-05-26T14:47:57.620000'), - ('Kenneth', 'Hoffman', '2013-05-26T14:47:57.620000'), - ('Fay', 'Kilmer', '2013-05-26T14:47:57.620000'), - ('Ed', 'Mansfield', '2013-05-26T14:47:57.620000'), - ('Russell', 'Close', '2013-05-26T14:47:57.620000'), - ('Michael', 'Bening', '2013-05-26T14:47:57.620000'), - ('Minnie', 'Zellweger', '2013-05-26T14:47:57.620000'), - ('Helen', 'Voight', '2013-05-26T14:47:57.620000'), - ('Morgan', 'Mcdormand', '2013-05-26T14:47:57.620000'), - ('Lucille', 'Dee', '2013-05-26T14:47:57.620000'), - ('Liza', 'Bergman', '2013-05-26T14:47:57.620000'), - ('Christian', 'Akroyd', '2013-05-26T14:47:57.620000'), - ('Cate', 'Harris', '2013-05-26T14:47:57.620000'), - ('Sissy', 'Sobieski', '2013-05-26T14:47:57.620000'), - ('Scarlett', 'Damon', '2013-05-26T14:47:57.620000'), - ('Gary', 'Penn', '2013-05-26T14:47:57.620000'), - ('Kirsten', 'Akroyd', '2013-05-26T14:47:57.620000'), - ('Russell', 'Temple', '2013-05-26T14:47:57.620000') - RETURNING actor_id - ) - SELECT array_agg(actor_id) INTO v_new_ids_actor FROM inserted; - - FOR i IN 1..array_length(v_new_ids_actor, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."actor"', v_old_ids_actor[i], v_new_ids_actor[i]::TEXT); - END LOOP; - - -- Table: "public"."country" (109 records) - v_old_ids_country := ARRAY['105', '47', '102', '29', '35', '22', '71', '21', '101', '87', '74', '53', '97', '61', '104', '77', '108', '69', '41', '93', '43', '24', '32', '54', '37', '88', '90', '72', '4', '91', '60', '78', '30', '3', '46', '26', '7', '66', '62', '82', '34', '55', '17', '19', '13', '16', '31', '81', '73', '92', '6', '103', '85', '68', '28', '58', '107', '40', '56', '59', '20', '9', '48', '94', '38', '42', '23', '84', '39', '11', '50', '51', '44', '1', '18', '8', '106', '10', '109', '49', '36', '5', '95', '64', '99', '25', '83', '98', '2', '70', '52', '12', '79', '100', '75', '89', '33', '67', '76', '15']; - WITH inserted AS ( - INSERT INTO "public"."country" ("country", "last_update") - VALUES - ('Vietnam', '2006-02-15T09:44:00'), - ('Iraq', '2006-02-15T09:44:00'), - ('United Kingdom', '2006-02-15T09:44:00'), - ('Egypt', '2006-02-15T09:44:00'), - ('French Guiana', '2006-02-15T09:44:00'), - ('Chile', '2006-02-15T09:44:00'), - ('Oman', '2006-02-15T09:44:00'), - ('Chad', '2006-02-15T09:44:00'), - ('United Arab Emirates', '2006-02-15T09:44:00'), - ('Spain', '2006-02-15T09:44:00'), - ('Peru', '2006-02-15T09:44:00'), - ('Kuwait', '2006-02-15T09:44:00'), - ('Turkey', '2006-02-15T09:44:00'), - ('Moldova', '2006-02-15T09:44:00'), - ('Venezuela', '2006-02-15T09:44:00'), - ('Puerto Rico', '2006-02-15T09:44:00'), - ('Yugoslavia', '2006-02-15T09:44:00'), - ('Nigeria', '2006-02-15T09:44:00'), - ('Holy See (Vatican City State)', '2006-02-15T09:44:00'), - ('Tanzania', '2006-02-15T09:44:00'), - ('Hungary', '2006-02-15T09:44:00'), - ('Colombia', '2006-02-15T09:44:00'), - ('Faroe Islands', '2006-02-15T09:44:00'), - ('Latvia', '2006-02-15T09:44:00'), - ('Gambia', '2006-02-15T09:44:00'), - ('Sri Lanka', '2006-02-15T09:44:00'), - ('Sweden', '2006-02-15T09:44:00'), - ('Pakistan', '2006-02-15T09:44:00'), - ('Angola', '2006-02-15T09:44:00'), - ('Switzerland', '2006-02-15T09:44:00'), - ('Mexico', '2006-02-15T09:44:00'), - ('Romania', '2006-02-15T09:44:00'), - ('Estonia', '2006-02-15T09:44:00'), - ('American Samoa', '2006-02-15T09:44:00'), - ('Iran', '2006-02-15T09:44:00'), - ('Czech Republic', '2006-02-15T09:44:00'), - ('Armenia', '2006-02-15T09:44:00'), - ('Nepal', '2006-02-15T09:44:00'), - ('Morocco', '2006-02-15T09:44:00'), - ('Saudi Arabia', '2006-02-15T09:44:00'), - ('France', '2006-02-15T09:44:00'), - ('Liechtenstein', '2006-02-15T09:44:00'), - ('Bulgaria', '2006-02-15T09:44:00'), - ('Cameroon', '2006-02-15T09:44:00'), - ('Belarus', '2006-02-15T09:44:00'), - ('Brunei', '2006-02-15T09:44:00'), - ('Ethiopia', '2006-02-15T09:44:00'), - ('Saint Vincent and the Grenadines', '2006-02-15T09:44:00'), - ('Paraguay', '2006-02-15T09:44:00'), - ('Taiwan', '2006-02-15T09:44:00'), - ('Argentina', '2006-02-15T09:44:00'), - ('United States', '2006-02-15T09:44:00'), - ('South Africa', '2006-02-15T09:44:00'), - ('New Zealand', '2006-02-15T09:44:00'), - ('Ecuador', '2006-02-15T09:44:00'), - ('Malawi', '2006-02-15T09:44:00'), - ('Yemen', '2006-02-15T09:44:00'), - ('Greenland', '2006-02-15T09:44:00'), - ('Lithuania', '2006-02-15T09:44:00'), - ('Malaysia', '2006-02-15T09:44:00'), - ('Canada', '2006-02-15T09:44:00'), - ('Austria', '2006-02-15T09:44:00'), - ('Israel', '2006-02-15T09:44:00'), - ('Thailand', '2006-02-15T09:44:00'), - ('Germany', '2006-02-15T09:44:00'), - ('Hong Kong', '2006-02-15T09:44:00'), - ('China', '2006-02-15T09:44:00'), - ('Slovakia', '2006-02-15T09:44:00'), - ('Greece', '2006-02-15T09:44:00'), - ('Bahrain', '2006-02-15T09:44:00'), - ('Japan', '2006-02-15T09:44:00'), - ('Kazakstan', '2006-02-15T09:44:00'), - ('India', '2006-02-15T09:44:00'), - ('Afghanistan', '2006-02-15T09:44:00'), - ('Cambodia', '2006-02-15T09:44:00'), - ('Australia', '2006-02-15T09:44:00'), - ('Virgin Islands, U.S.', '2006-02-15T09:44:00'), - ('Azerbaijan', '2006-02-15T09:44:00'), - ('Zambia', '2006-02-15T09:44:00'), - ('Italy', '2006-02-15T09:44:00'), - ('French Polynesia', '2006-02-15T09:44:00'), - ('Anguilla', '2006-02-15T09:44:00'), - ('Tonga', '2006-02-15T09:44:00'), - ('Myanmar', '2006-02-15T09:44:00'), - ('Tuvalu', '2006-02-15T09:44:00'), - ('Congo, The Democratic Republic of the', '2006-02-15T09:44:00'), - ('Senegal', '2006-02-15T09:44:00'), - ('Turkmenistan', '2006-02-15T09:44:00'), - ('Algeria', '2006-02-15T09:44:00'), - ('North Korea', '2006-02-15T09:44:00'), - ('Kenya', '2006-02-15T09:44:00'), - ('Bangladesh', '2006-02-15T09:44:00'), - ('Runion', '2006-02-15T09:44:00'), - ('Ukraine', '2006-02-15T09:44:00'), - ('Philippines', '2006-02-15T09:44:00'), - ('Sudan', '2006-02-15T09:44:00'), - ('Finland', '2006-02-15T09:44:00'), - ('Netherlands', '2006-02-15T09:44:00'), - ('Poland', '2006-02-15T09:44:00'), - ('Brazil', '2006-02-15T09:44:00') - RETURNING country_id - ) - SELECT array_agg(country_id) INTO v_new_ids_country FROM inserted; - - FOR i IN 1..array_length(v_new_ids_country, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."country"', v_old_ids_country[i], v_new_ids_country[i]::TEXT); - END LOOP; - - v_old_ids_country := ARRAY['86', '80', '57', '63', '27', '14', '96', '65', '45']; - WITH inserted AS ( - INSERT INTO "public"."country" ("country", "last_update") - VALUES - ('South Korea', '2006-02-15T09:44:00'), - ('Russian Federation', '2006-02-15T09:44:00'), - ('Madagascar', '2006-02-15T09:44:00'), - ('Mozambique', '2006-02-15T09:44:00'), - ('Dominican Republic', '2006-02-15T09:44:00'), - ('Bolivia', '2006-02-15T09:44:00'), - ('Tunisia', '2006-02-15T09:44:00'), - ('Nauru', '2006-02-15T09:44:00'), - ('Indonesia', '2006-02-15T09:44:00') - RETURNING country_id - ) - SELECT array_agg(country_id) INTO v_new_ids_country FROM inserted; - - FOR i IN 1..array_length(v_new_ids_country, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."country"', v_old_ids_country[i], v_new_ids_country[i]::TEXT); - END LOOP; - - -- Table: "public"."language" (1 records) - INSERT INTO "public"."language" ("last_update", "name") - VALUES - ('2006-02-15T10:02:19', 'English ') - RETURNING language_id INTO v_new_id_language; - INSERT INTO _pgslice_id_map VALUES ('"public"."language"', '1', v_new_id_language::TEXT); - - -- Table: "public"."city" (600 records) - v_old_ids_city := ARRAY['201', '366', '571', '194', '359', '100', '344', '589', '500', '496', '88', '312', '149', '494', '495', '337', '79', '216', '465', '421', '476', '105', '428', '127', '27', '329', '444', '363', '3', '470', '12', '181', '1', '388', '146', '459', '503', '214', '99', '305', '233', '180', '58', '281', '266', '222', '538', '142', '50', '529', '384', '557', '482', '504', '163', '5', '115', '561', '326', '102', '55', '132', '562', '373', '411', '32', '368', '280', '488', '252', '389', '390', '374', '152', '381', '69', '141', '220', '218', '217', '596', '121', '593', '513', '347', '512', '405', '487', '147', '170', '480', '96', '545', '137', '303', '54', '230', '321', '324', '375']; - WITH inserted AS ( - INSERT INTO "public"."city" ("city", "country_id", "last_update") - SELECT - data.city::character varying, - map0.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('Hanoi', '105', '2006-02-15T09:45:25'), - ('Nha Trang', '105', '2006-02-15T09:45:25'), - ('Vinh', '105', '2006-02-15T09:45:25'), - ('Haiphong', '105', '2006-02-15T09:45:25'), - ('Nam Dinh', '105', '2006-02-15T09:45:25'), - ('Cam Ranh', '105', '2006-02-15T09:45:25'), - ('Mosul', '47', '2006-02-15T09:45:25'), - ('York', '102', '2006-02-15T09:45:25'), - ('Stockport', '102', '2006-02-15T09:45:25'), - ('Southport', '102', '2006-02-15T09:45:25'), - ('Bradford', '102', '2006-02-15T09:45:25'), - ('London', '102', '2006-02-15T09:45:25'), - ('Dundee', '102', '2006-02-15T09:45:25'), - ('Southampton', '102', '2006-02-15T09:45:25'), - ('Southend-on-Sea', '102', '2006-02-15T09:45:25'), - ('Mit Ghamr', '29', '2006-02-15T09:45:25'), - ('Bilbays', '29', '2006-02-15T09:45:25'), - ('Idfu', '29', '2006-02-15T09:45:25'), - ('Sawhaj', '29', '2006-02-15T09:45:25'), - ('Qalyub', '29', '2006-02-15T09:45:25'), - ('Shubra al-Khayma', '29', '2006-02-15T09:45:25'), - ('Cayenne', '35', '2006-02-15T09:45:25'), - ('Rancagua', '22', '2006-02-15T09:45:25'), - ('Coquimbo', '22', '2006-02-15T09:45:25'), - ('Antofagasta', '22', '2006-02-15T09:45:25'), - ('Masqat', '71', '2006-02-15T09:45:25'), - ('Salala', '71', '2006-02-15T09:45:25'), - ('NDjamna', '21', '2006-02-15T09:45:25'), - ('Abu Dhabi', '101', '2006-02-15T09:45:25'), - ('Sharja', '101', '2006-02-15T09:45:25'), - ('al-Ayn', '101', '2006-02-15T09:45:25'), - ('Gijn', '87', '2006-02-15T09:45:25'), - ('A Corua (La Corua)', '87', '2006-02-15T09:45:25'), - ('Ourense (Orense)', '87', '2006-02-15T09:45:25'), - ('Donostia-San Sebastin', '87', '2006-02-15T09:45:25'), - ('Santiago de Compostela', '87', '2006-02-15T09:45:25'), - ('Sullana', '74', '2006-02-15T09:45:25'), - ('Hunuco', '74', '2006-02-15T09:45:25'), - ('Callao', '74', '2006-02-15T09:45:25'), - ('Lima', '74', '2006-02-15T09:45:25'), - ('Jalib al-Shuyukh', '53', '2006-02-15T09:45:25'), - ('Gaziantep', '97', '2006-02-15T09:45:25'), - ('Batman', '97', '2006-02-15T09:45:25'), - ('Ktahya', '97', '2006-02-15T09:45:25'), - ('Kilis', '97', '2006-02-15T09:45:25'), - ('Inegl', '97', '2006-02-15T09:45:25'), - ('Tokat', '97', '2006-02-15T09:45:25'), - ('Denizli', '97', '2006-02-15T09:45:25'), - ('Balikesir', '97', '2006-02-15T09:45:25'), - ('Tarsus', '97', '2006-02-15T09:45:25'), - ('Osmaniye', '97', '2006-02-15T09:45:25'), - ('Usak', '97', '2006-02-15T09:45:25'), - ('Sivas', '97', '2006-02-15T09:45:25'), - ('Sultanbeyli', '97', '2006-02-15T09:45:25'), - ('Eskisehir', '97', '2006-02-15T09:45:25'), - ('Adana', '97', '2006-02-15T09:45:25'), - ('Chisinau', '61', '2006-02-15T09:45:25'), - ('Valencia', '104', '2006-02-15T09:45:25'), - ('Maracabo', '104', '2006-02-15T09:45:25'), - ('Caracas', '104', '2006-02-15T09:45:25'), - ('Barcelona', '104', '2006-02-15T09:45:25'), - ('Cuman', '104', '2006-02-15T09:45:25'), - ('Valle de la Pascua', '104', '2006-02-15T09:45:25'), - ('Ocumare del Tuy', '104', '2006-02-15T09:45:25'), - ('Ponce', '77', '2006-02-15T09:45:25'), - ('Arecibo', '77', '2006-02-15T09:45:25'), - ('Novi Sad', '108', '2006-02-15T09:45:25'), - ('Kragujevac', '108', '2006-02-15T09:45:25'), - ('Sokoto', '69', '2006-02-15T09:45:25'), - ('Kaduna', '69', '2006-02-15T09:45:25'), - ('Owo', '69', '2006-02-15T09:45:25'), - ('Oyo', '69', '2006-02-15T09:45:25'), - ('Ogbomosho', '69', '2006-02-15T09:45:25'), - ('Effon-Alaiye', '69', '2006-02-15T09:45:25'), - ('Ondo', '69', '2006-02-15T09:45:25'), - ('Benin City', '69', '2006-02-15T09:45:25'), - ('Deba Habe', '69', '2006-02-15T09:45:25'), - ('Ilorin', '69', '2006-02-15T09:45:25'), - ('Ikerre', '69', '2006-02-15T09:45:25'), - ('Ife', '69', '2006-02-15T09:45:25'), - ('Zaria', '69', '2006-02-15T09:45:25'), - ('Citt del Vaticano', '41', '2006-02-15T09:45:25'), - ('Zanzibar', '93', '2006-02-15T09:45:25'), - ('Tabora', '93', '2006-02-15T09:45:25'), - ('Mwanza', '93', '2006-02-15T09:45:25'), - ('Szkesfehrvr', '43', '2006-02-15T09:45:25'), - ('Pereira', '24', '2006-02-15T09:45:25'), - ('Sogamoso', '24', '2006-02-15T09:45:25'), - ('Dos Quebradas', '24', '2006-02-15T09:45:25'), - ('Florencia', '24', '2006-02-15T09:45:25'), - ('Sincelejo', '24', '2006-02-15T09:45:25'), - ('Buenaventura', '24', '2006-02-15T09:45:25'), - ('Trshavn', '32', '2006-02-15T09:45:25'), - ('Daugavpils', '54', '2006-02-15T09:45:25'), - ('Liepaja', '54', '2006-02-15T09:45:25'), - ('Banjul', '37', '2006-02-15T09:45:25'), - ('Jaffna', '88', '2006-02-15T09:45:25'), - ('Malm', '90', '2006-02-15T09:45:25'), - ('Mandi Bahauddin', '72', '2006-02-15T09:45:25'), - ('Okara', '72', '2006-02-15T09:45:25') - ) AS data(city, old_country_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."country"' - AND map0.old_id = data.old_country_id - RETURNING city_id - ) - SELECT array_agg(city_id) INTO v_new_ids_city FROM inserted; - - FOR i IN 1..array_length(v_new_ids_city, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."city"', v_old_ids_city[i], v_new_ids_city[i]::TEXT); - END LOOP; - - v_old_ids_city := ARRAY['472', '134', '327', '360', '67', '72', '296', '56', '106', '451', '556', '154', '131', '288', '341', '103', '125', '393', '541', '335', '365', '212', '213', '452', '246', '250', '40', '130', '595', '188', '124', '19', '202', '445', '563', '4', '129', '330', '86', '95', '530', '516', '423', '481', '356', '162', '31', '467', '514', '265', '378', '586', '81', '443', '68', '353', '237', '2', '13', '16', '515', '543', '92', '297', '544', '560', '436', '498', '52', '585', '339', '340', '53', '6', '269', '453', '37', '122', '168', '108', '209', '546', '316', '116', '542', '361', '114', '526', '424', '128', '524', '334', '165', '20', '161', '457', '45', '454', '43', '567']; - WITH inserted AS ( - INSERT INTO "public"."city" ("city", "country_id", "last_update") - SELECT - data.city::character varying, - map0.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('Shikarpur', '72', '2006-02-15T09:45:25'), - ('Dadu', '72', '2006-02-15T09:45:25'), - ('Mardan', '72', '2006-02-15T09:45:25'), - ('Namibe', '4', '2006-02-15T09:45:25'), - ('Benguela', '4', '2006-02-15T09:45:25'), - ('Bern', '91', '2006-02-15T09:45:25'), - ('Lausanne', '91', '2006-02-15T09:45:25'), - ('Basel', '91', '2006-02-15T09:45:25'), - ('Celaya', '60', '2006-02-15T09:45:25'), - ('San Felipe del Progreso', '60', '2006-02-15T09:45:25'), - ('Uruapan', '60', '2006-02-15T09:45:25'), - ('El Fuerte', '60', '2006-02-15T09:45:25'), - ('Cuernavaca', '60', '2006-02-15T09:45:25'), - ('La Paz', '60', '2006-02-15T09:45:25'), - ('Monclova', '60', '2006-02-15T09:45:25'), - ('Carmen', '60', '2006-02-15T09:45:25'), - ('Coatzacoalcos', '60', '2006-02-15T09:45:25'), - ('Pachuca de Soto', '60', '2006-02-15T09:45:25'), - ('Torren', '60', '2006-02-15T09:45:25'), - ('Mexicali', '60', '2006-02-15T09:45:25'), - ('Nezahualcyotl', '60', '2006-02-15T09:45:25'), - ('Huejutla de Reyes', '60', '2006-02-15T09:45:25'), - ('Huixquilucan', '60', '2006-02-15T09:45:25'), - ('San Juan Bautista Tuxtepec', '60', '2006-02-15T09:45:25'), - ('Jos Azueta', '60', '2006-02-15T09:45:25'), - ('Jurez', '60', '2006-02-15T09:45:25'), - ('Atlixco', '60', '2006-02-15T09:45:25'), - ('Cuautla', '60', '2006-02-15T09:45:25'), - ('Zapopan', '60', '2006-02-15T09:45:25'), - ('Guadalajara', '60', '2006-02-15T09:45:25'), - ('Coacalco de Berriozbal', '60', '2006-02-15T09:45:25'), - ('Allende', '60', '2006-02-15T09:45:25'), - ('Hidalgo', '60', '2006-02-15T09:45:25'), - ('Salamanca', '60', '2006-02-15T09:45:25'), - ('Valle de Santiago', '60', '2006-02-15T09:45:25'), - ('Acua', '60', '2006-02-15T09:45:25'), - ('Cuauhtmoc', '60', '2006-02-15T09:45:25'), - ('Matamoros', '60', '2006-02-15T09:45:25'), - ('Botosani', '78', '2006-02-15T09:45:25'), - ('Bucuresti', '78', '2006-02-15T09:45:25'), - ('Tartu', '30', '2006-02-15T09:45:25'), - ('Tafuna', '3', '2006-02-15T09:45:25'), - ('Qomsheh', '46', '2006-02-15T09:45:25'), - ('Sirjan', '46', '2006-02-15T09:45:25'), - ('Najafabad', '46', '2006-02-15T09:45:25'), - ('Esfahan', '46', '2006-02-15T09:45:25'), - ('Arak', '46', '2006-02-15T09:45:25'), - ('Shahr-e Kord', '46', '2006-02-15T09:45:25'), - ('Tabriz', '46', '2006-02-15T09:45:25'), - ('Kermanshah', '46', '2006-02-15T09:45:25'), - ('Olomouc', '26', '2006-02-15T09:45:25'), - ('Yerevan', '7', '2006-02-15T09:45:25'), - ('Birgunj', '66', '2006-02-15T09:45:25'), - ('Sal', '62', '2006-02-15T09:45:25'), - ('Beni-Mellal', '62', '2006-02-15T09:45:25'), - ('Nador', '62', '2006-02-15T09:45:25'), - ('Jedda', '82', '2006-02-15T09:45:25'), - ('Abha', '82', '2006-02-15T09:45:25'), - ('al-Hawiya', '82', '2006-02-15T09:45:25'), - ('al-Qatif', '82', '2006-02-15T09:45:25'), - ('Tabuk', '82', '2006-02-15T09:45:25'), - ('Toulon', '34', '2006-02-15T09:45:25'), - ('Brest', '34', '2006-02-15T09:45:25'), - ('Le Mans', '34', '2006-02-15T09:45:25'), - ('Toulouse', '34', '2006-02-15T09:45:25'), - ('Vaduz', '55', '2006-02-15T09:45:25'), - ('Ruse', '17', '2006-02-15T09:45:25'), - ('Stara Zagora', '17', '2006-02-15T09:45:25'), - ('Bamenda', '19', '2006-02-15T09:45:25'), - ('Yaound', '19', '2006-02-15T09:45:25'), - ('Mogiljov', '13', '2006-02-15T09:45:25'), - ('Molodetno', '13', '2006-02-15T09:45:25'), - ('Bandar Seri Begawan', '16', '2006-02-15T09:45:25'), - ('Addis Abeba', '31', '2006-02-15T09:45:25'), - ('Kingstown', '81', '2006-02-15T09:45:25'), - ('San Lorenzo', '73', '2006-02-15T09:45:25'), - ('Asuncin', '73', '2006-02-15T09:45:25'), - ('Ciudad del Este', '73', '2006-02-15T09:45:25'), - ('Fengshan', '92', '2006-02-15T09:45:25'), - ('Changhwa', '92', '2006-02-15T09:45:25'), - ('Hsichuh', '92', '2006-02-15T09:45:25'), - ('Tsaotun', '92', '2006-02-15T09:45:25'), - ('Lungtan', '92', '2006-02-15T09:45:25'), - ('Chungho', '92', '2006-02-15T09:45:25'), - ('Touliu', '92', '2006-02-15T09:45:25'), - ('Nantou', '92', '2006-02-15T09:45:25'), - ('Chiayi', '92', '2006-02-15T09:45:25'), - ('Tanshui', '92', '2006-02-15T09:45:25'), - ('Quilmes', '6', '2006-02-15T09:45:25'), - ('Crdoba', '6', '2006-02-15T09:45:25'), - ('Tandil', '6', '2006-02-15T09:45:25'), - ('Merlo', '6', '2006-02-15T09:45:25'), - ('Ezeiza', '6', '2006-02-15T09:45:25'), - ('Almirante Brown', '6', '2006-02-15T09:45:25'), - ('Escobar', '6', '2006-02-15T09:45:25'), - ('Santa F', '6', '2006-02-15T09:45:25'), - ('Baha Blanca', '6', '2006-02-15T09:45:25'), - ('San Miguel de Tucumn', '6', '2006-02-15T09:45:25'), - ('Avellaneda', '6', '2006-02-15T09:45:25'), - ('Vicente Lpez', '6', '2006-02-15T09:45:25') - ) AS data(city, old_country_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."country"' - AND map0.old_id = data.old_country_id - RETURNING city_id - ) - SELECT array_agg(city_id) INTO v_new_ids_city FROM inserted; - - FOR i IN 1..array_length(v_new_ids_city, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."city"', v_old_ids_city[i], v_new_ids_city[i]::TEXT); - END LOOP; - - v_old_ids_city := ARRAY['289', '33', '573', '262', '42', '178', '126', '123', '65', '446', '449', '333', '435', '135', '508', '292', '499', '245', '433', '120', '187', '177', '140', '11', '322', '441', '404', '94', '520', '306', '171', '155', '295', '185', '101', '41', '112', '273', '85', '364', '491', '437', '267', '497', '87', '244', '392', '200', '311', '414', '434', '304', '206', '7', '455', '518', '371', '570', '507', '223', '282', '196', '300', '430', '179', '383', '565', '313', '447', '186', '307', '34', '57', '533', '36', '358', '394', '489', '439', '160', '198', '575', '148', '477', '325', '279', '581', '47', '174', '594', '584', '432', '536', '159', '592', '535', '590', '574', '362', '293']; - WITH inserted AS ( - INSERT INTO "public"."city" ("city", "country_id", "last_update") - SELECT - data.city::character varying, - map0.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('La Plata', '6', '2006-02-15T09:45:25'), - ('Arlington', '103', '2006-02-15T09:45:25'), - ('Warren', '103', '2006-02-15T09:45:25'), - ('Kansas City', '103', '2006-02-15T09:45:25'), - ('Aurora', '103', '2006-02-15T09:45:25'), - ('Garland', '103', '2006-02-15T09:45:25'), - ('Compton', '103', '2006-02-15T09:45:25'), - ('Clarksville', '103', '2006-02-15T09:45:25'), - ('Bellevue', '103', '2006-02-15T09:45:25'), - ('Salinas', '103', '2006-02-15T09:45:25'), - ('San Bernardino', '103', '2006-02-15T09:45:25'), - ('Memphis', '103', '2006-02-15T09:45:25'), - ('Rockford', '103', '2006-02-15T09:45:25'), - ('Dallas', '103', '2006-02-15T09:45:25'), - ('Sunnyvale', '103', '2006-02-15T09:45:25'), - ('Lancaster', '103', '2006-02-15T09:45:25'), - ('Sterling Heights', '103', '2006-02-15T09:45:25'), - ('Joliet', '103', '2006-02-15T09:45:25'), - ('Roanoke', '103', '2006-02-15T09:45:25'), - ('Citrus Heights', '103', '2006-02-15T09:45:25'), - ('Greensboro', '103', '2006-02-15T09:45:25'), - ('Garden Grove', '103', '2006-02-15T09:45:25'), - ('Dayton', '103', '2006-02-15T09:45:25'), - ('Akron', '103', '2006-02-15T09:45:25'), - ('Manchester', '103', '2006-02-15T09:45:25'), - ('Saint Louis', '103', '2006-02-15T09:45:25'), - ('Peoria', '103', '2006-02-15T09:45:25'), - ('Brockton', '103', '2006-02-15T09:45:25'), - ('Tallahassee', '103', '2006-02-15T09:45:25'), - ('Lincoln', '103', '2006-02-15T09:45:25'), - ('Fontana', '103', '2006-02-15T09:45:25'), - ('El Monte', '103', '2006-02-15T09:45:25'), - ('Laredo', '103', '2006-02-15T09:45:25'), - ('Grand Prairie', '103', '2006-02-15T09:45:25'), - ('Cape Coral', '103', '2006-02-15T09:45:25'), - ('Augusta-Richmond County', '103', '2006-02-15T09:45:25'), - ('Chatsworth', '85', '2006-02-15T09:45:25'), - ('Klerksdorp', '85', '2006-02-15T09:45:25'), - ('Boksburg', '85', '2006-02-15T09:45:25'), - ('Newcastle', '85', '2006-02-15T09:45:25'), - ('Soshanguve', '85', '2006-02-15T09:45:25'), - ('Rustenburg', '85', '2006-02-15T09:45:25'), - ('Kimberley', '85', '2006-02-15T09:45:25'), - ('Springs', '85', '2006-02-15T09:45:25'), - ('Botshabelo', '85', '2006-02-15T09:45:25'), - ('Johannesburg', '85', '2006-02-15T09:45:25'), - ('Paarl', '85', '2006-02-15T09:45:25'), - ('Hamilton', '68', '2006-02-15T09:45:25'), - ('Loja', '28', '2006-02-15T09:45:25'), - ('Portoviejo', '28', '2006-02-15T09:45:25'), - ('Robamba', '28', '2006-02-15T09:45:25'), - ('Lilongwe', '58', '2006-02-15T09:45:25'), - ('Hodeida', '107', '2006-02-15T09:45:25'), - ('Aden', '107', '2006-02-15T09:45:25'), - ('Sanaa', '107', '2006-02-15T09:45:25'), - ('Taizz', '107', '2006-02-15T09:45:25'), - ('Nuuk', '40', '2006-02-15T09:45:25'), - ('Vilnius', '56', '2006-02-15T09:45:25'), - ('Sungai Petani', '59', '2006-02-15T09:45:25'), - ('Ipoh', '59', '2006-02-15T09:45:25'), - ('Kuching', '59', '2006-02-15T09:45:25'), - ('Halifax', '20', '2006-02-15T09:45:25'), - ('Lethbridge', '20', '2006-02-15T09:45:25'), - ('Richmond Hill', '20', '2006-02-15T09:45:25'), - ('Gatineau', '20', '2006-02-15T09:45:25'), - ('Oshawa', '20', '2006-02-15T09:45:25'), - ('Vancouver', '20', '2006-02-15T09:45:25'), - ('London', '20', '2006-02-15T09:45:25'), - ('Salzburg', '9', '2006-02-15T09:45:25'), - ('Graz', '9', '2006-02-15T09:45:25'), - ('Linz', '9', '2006-02-15T09:45:25'), - ('Ashdod', '48', '2006-02-15T09:45:25'), - ('Bat Yam', '48', '2006-02-15T09:45:25'), - ('Tel Aviv-Jaffa', '48', '2006-02-15T09:45:25'), - ('Ashqelon', '48', '2006-02-15T09:45:25'), - ('Nakhon Sawan', '94', '2006-02-15T09:45:25'), - ('Pak Kret', '94', '2006-02-15T09:45:25'), - ('Songkhla', '94', '2006-02-15T09:45:25'), - ('Saarbrcken', '38', '2006-02-15T09:45:25'), - ('Erlangen', '38', '2006-02-15T09:45:25'), - ('Halle/Saale', '38', '2006-02-15T09:45:25'), - ('Witten', '38', '2006-02-15T09:45:25'), - ('Duisburg', '38', '2006-02-15T09:45:25'), - ('Siegen', '38', '2006-02-15T09:45:25'), - ('Mannheim', '38', '2006-02-15T09:45:25'), - ('Kowloon and New Kowloon', '42', '2006-02-15T09:45:25'), - ('Xinxiang', '23', '2006-02-15T09:45:25'), - ('Baiyin', '23', '2006-02-15T09:45:25'), - ('Fuyu', '23', '2006-02-15T09:45:25'), - ('Zaoyang', '23', '2006-02-15T09:45:25'), - ('Yantai', '23', '2006-02-15T09:45:25'), - ('Rizhao', '23', '2006-02-15T09:45:25'), - ('Tiefa', '23', '2006-02-15T09:45:25'), - ('Enshi', '23', '2006-02-15T09:45:25'), - ('Zalantun', '23', '2006-02-15T09:45:25'), - ('Tianjin', '23', '2006-02-15T09:45:25'), - ('Yuncheng', '23', '2006-02-15T09:45:25'), - ('Weifang', '23', '2006-02-15T09:45:25'), - ('Nanyang', '23', '2006-02-15T09:45:25'), - ('Laohekou', '23', '2006-02-15T09:45:25') - ) AS data(city, old_country_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."country"' - AND map0.old_id = data.old_country_id - RETURNING city_id - ) - SELECT array_agg(city_id) INTO v_new_ids_city FROM inserted; - - FOR i IN 1..array_length(v_new_ids_city, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."city"', v_old_ids_city[i], v_new_ids_city[i]::TEXT); - END LOOP; - - v_old_ids_city := ARRAY['210', '175', '241', '277', '240', '468', '80', '578', '588', '422', '471', '193', '332', '136', '302', '591', '249', '46', '580', '109', '540', '207', '298', '291', '299', '145', '139', '199', '166', '469', '579', '242', '407', '157', '537', '502', '599', '587', '462', '90', '38', '401', '14', '338', '382', '386', '331', '284', '256', '555', '521', '440', '552', '474', '287', '260', '355', '229', '276', '226', '203', '204', '380', '205', '253', '227', '376', '10', '228', '463', '377', '224', '172', '547', '598', '402', '429', '231', '211', '522', '417', '197', '74', '243', '427', '144', '395', '426', '564', '475', '107', '22', '582', '399', '169', '464', '554', '176', '76', '416']; - WITH inserted AS ( - INSERT INTO "public"."city" ("city", "country_id", "last_update") - SELECT - data.city::character varying, - map0.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('Huaian', '23', '2006-02-15T09:45:25'), - ('Fuzhou', '23', '2006-02-15T09:45:25'), - ('Jining', '23', '2006-02-15T09:45:25'), - ('Korla', '23', '2006-02-15T09:45:25'), - ('Jinchang', '23', '2006-02-15T09:45:25'), - ('Shanwei', '23', '2006-02-15T09:45:25'), - ('Binzhou', '23', '2006-02-15T09:45:25'), - ('Xiangfan', '23', '2006-02-15T09:45:25'), - ('Yingkou', '23', '2006-02-15T09:45:25'), - ('Qinhuangdao', '23', '2006-02-15T09:45:25'), - ('Shenzhen', '23', '2006-02-15T09:45:25'), - ('Haining', '23', '2006-02-15T09:45:25'), - ('Meixian', '23', '2006-02-15T09:45:25'), - ('Datong', '23', '2006-02-15T09:45:25'), - ('Liaocheng', '23', '2006-02-15T09:45:25'), - ('Yuzhou', '23', '2006-02-15T09:45:25'), - ('Junan', '23', '2006-02-15T09:45:25'), - ('Baicheng', '23', '2006-02-15T09:45:25'), - ('Xintai', '23', '2006-02-15T09:45:25'), - ('Changzhou', '23', '2006-02-15T09:45:25'), - ('Tongliao', '23', '2006-02-15T09:45:25'), - ('Hohhot', '23', '2006-02-15T09:45:25'), - ('Lengshuijiang', '23', '2006-02-15T09:45:25'), - ('Laiwu', '23', '2006-02-15T09:45:25'), - ('Leshan', '23', '2006-02-15T09:45:25'), - ('Dongying', '23', '2006-02-15T09:45:25'), - ('Daxian', '23', '2006-02-15T09:45:25'), - ('Hami', '23', '2006-02-15T09:45:25'), - ('Ezhou', '23', '2006-02-15T09:45:25'), - ('Shaoguan', '23', '2006-02-15T09:45:25'), - ('Xiangtan', '23', '2006-02-15T09:45:25'), - ('Jinzhou', '23', '2006-02-15T09:45:25'), - ('Pingxiang', '23', '2006-02-15T09:45:25'), - ('Emeishan', '23', '2006-02-15T09:45:25'), - ('Tieli', '23', '2006-02-15T09:45:25'), - ('Suihua', '23', '2006-02-15T09:45:25'), - ('Zhoushan', '23', '2006-02-15T09:45:25'), - ('Yinchuan', '23', '2006-02-15T09:45:25'), - ('Sanya', '23', '2006-02-15T09:45:25'), - ('Bratislava', '84', '2006-02-15T09:45:25'), - ('Athenai', '39', '2006-02-15T09:45:25'), - ('Patras', '39', '2006-02-15T09:45:25'), - ('al-Manama', '11', '2006-02-15T09:45:25'), - ('Miyakonojo', '50', '2006-02-15T09:45:25'), - ('Onomichi', '50', '2006-02-15T09:45:25'), - ('Otsu', '50', '2006-02-15T09:45:25'), - ('Matsue', '50', '2006-02-15T09:45:25'), - ('Kurashiki', '50', '2006-02-15T09:45:25'), - ('Kamakura', '50', '2006-02-15T09:45:25'), - ('Urawa', '50', '2006-02-15T09:45:25'), - ('Tama', '50', '2006-02-15T09:45:25'), - ('Sagamihara', '50', '2006-02-15T09:45:25'), - ('Ueda', '50', '2006-02-15T09:45:25'), - ('Shimonoseki', '50', '2006-02-15T09:45:25'), - ('Kuwana', '50', '2006-02-15T09:45:25'), - ('Kanazawa', '50', '2006-02-15T09:45:25'), - ('Nagareyama', '50', '2006-02-15T09:45:25'), - ('Izumisano', '50', '2006-02-15T09:45:25'), - ('Koriyama', '50', '2006-02-15T09:45:25'), - ('Iwaki', '50', '2006-02-15T09:45:25'), - ('Higashiosaka', '50', '2006-02-15T09:45:25'), - ('Hino', '50', '2006-02-15T09:45:25'), - ('Omiya', '50', '2006-02-15T09:45:25'), - ('Hiroshima', '50', '2006-02-15T09:45:25'), - ('Kakamigahara', '50', '2006-02-15T09:45:25'), - ('Iwakuni', '50', '2006-02-15T09:45:25'), - ('Okayama', '50', '2006-02-15T09:45:25'), - ('Akishima', '50', '2006-02-15T09:45:25'), - ('Iwatsuki', '50', '2006-02-15T09:45:25'), - ('Sasebo', '50', '2006-02-15T09:45:25'), - ('Okinawa', '50', '2006-02-15T09:45:25'), - ('Isesaki', '50', '2006-02-15T09:45:25'), - ('Fukuyama', '50', '2006-02-15T09:45:25'), - ('Tsuyama', '50', '2006-02-15T09:45:25'), - ('Zhezqazghan', '51', '2006-02-15T09:45:25'), - ('Pavlodar', '51', '2006-02-15T09:45:25'), - ('Ranchi', '44', '2006-02-15T09:45:25'), - ('Jaipur', '44', '2006-02-15T09:45:25'), - ('Hubli-Dharwad', '44', '2006-02-15T09:45:25'), - ('Tambaram', '44', '2006-02-15T09:45:25'), - ('Pune', '44', '2006-02-15T09:45:25'), - ('Halisahar', '44', '2006-02-15T09:45:25'), - ('Bhilwara', '44', '2006-02-15T09:45:25'), - ('Jodhpur', '44', '2006-02-15T09:45:25'), - ('Rampur', '44', '2006-02-15T09:45:25'), - ('Dhule (Dhulia)', '44', '2006-02-15T09:45:25'), - ('Palghat (Palakkad)', '44', '2006-02-15T09:45:25'), - ('Rajkot', '44', '2006-02-15T09:45:25'), - ('Valparai', '44', '2006-02-15T09:45:25'), - ('Shivapuri', '44', '2006-02-15T09:45:25'), - ('Chandrapur', '44', '2006-02-15T09:45:25'), - ('Ambattur', '44', '2006-02-15T09:45:25'), - ('Yamuna Nagar', '44', '2006-02-15T09:45:25'), - ('Pathankot', '44', '2006-02-15T09:45:25'), - ('Firozabad', '44', '2006-02-15T09:45:25'), - ('Satna', '44', '2006-02-15T09:45:25'), - ('Uluberia', '44', '2006-02-15T09:45:25'), - ('Gandhinagar', '44', '2006-02-15T09:45:25'), - ('Bhopal', '44', '2006-02-15T09:45:25'), - ('Pudukkottai', '44', '2006-02-15T09:45:25') - ) AS data(city, old_country_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."country"' - AND map0.old_id = data.old_country_id - RETURNING city_id - ) - SELECT array_agg(city_id) INTO v_new_ids_city FROM inserted; - - FOR i IN 1..array_length(v_new_ids_city, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."city"', v_old_ids_city[i], v_new_ids_city[i]::TEXT); - END LOOP; - - v_old_ids_city := ARRAY['239', '398', '75', '550', '257', '24', '71', '566', '473', '283', '263', '350', '77', '425', '354', '478', '261', '164', '448', '264', '191', '400', '568', '73', '110', '336', '51', '418', '18', '78', '8', '208', '346', '195', '9', '559', '251', '60', '406', '576', '111', '48', '505', '272', '551', '93', '511', '17', '309', '70', '91', '167', '397', '493', '370', '349', '342', '173', '348', '315', '600', '35', '63', '59', '483', '420', '372', '271', '143', '234', '525', '442', '479', '258', '385', '506', '345', '275', '182', '517', '528', '294', '82', '527', '221', '391', '458', '519', '219', '104', '323', '98', '61', '548', '138', '523', '62', '192', '15', '379']; - WITH inserted AS ( - INSERT INTO "public"."city" ("city", "country_id", "last_update") - SELECT - data.city::character varying, - map0.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('Jhansi', '44', '2006-02-15T09:45:25'), - ('Parbhani', '44', '2006-02-15T09:45:25'), - ('Bhimavaram', '44', '2006-02-15T09:45:25'), - ('Udaipur', '44', '2006-02-15T09:45:25'), - ('Kamarhati', '44', '2006-02-15T09:45:25'), - ('Amroha', '44', '2006-02-15T09:45:25'), - ('Berhampore (Baharampur)', '44', '2006-02-15T09:45:25'), - ('Varanasi (Benares)', '44', '2006-02-15T09:45:25'), - ('Shimoga', '44', '2006-02-15T09:45:25'), - ('Kumbakonam', '44', '2006-02-15T09:45:25'), - ('Karnal', '44', '2006-02-15T09:45:25'), - ('Mysore', '44', '2006-02-15T09:45:25'), - ('Bhusawal', '44', '2006-02-15T09:45:25'), - ('Rae Bareli', '44', '2006-02-15T09:45:25'), - ('Nagaon', '44', '2006-02-15T09:45:25'), - ('Siliguri (Shiliguri)', '44', '2006-02-15T09:45:25'), - ('Kanchrapara', '44', '2006-02-15T09:45:25'), - ('Etawah', '44', '2006-02-15T09:45:25'), - ('Sambhal', '44', '2006-02-15T09:45:25'), - ('Katihar', '44', '2006-02-15T09:45:25'), - ('Gulbarga', '44', '2006-02-15T09:45:25'), - ('Patiala', '44', '2006-02-15T09:45:25'), - ('Vijayawada', '44', '2006-02-15T09:45:25'), - ('Bhavnagar', '44', '2006-02-15T09:45:25'), - ('Chapra', '44', '2006-02-15T09:45:25'), - ('Miraj', '44', '2006-02-15T09:45:25'), - ('Balurghat', '44', '2006-02-15T09:45:25'), - ('Purnea (Purnia)', '44', '2006-02-15T09:45:25'), - ('Allappuzha (Alleppey)', '44', '2006-02-15T09:45:25'), - ('Bijapur', '44', '2006-02-15T09:45:25'), - ('Adoni', '44', '2006-02-15T09:45:25'), - ('Hoshiarpur', '44', '2006-02-15T09:45:25'), - ('Munger (Monghyr)', '44', '2006-02-15T09:45:25'), - ('Haldia', '44', '2006-02-15T09:45:25'), - ('Ahmadnagar', '44', '2006-02-15T09:45:25'), - ('Uttarpara-Kotrung', '44', '2006-02-15T09:45:25'), - ('Kabul', '1', '2006-02-15T09:45:25'), - ('Battambang', '18', '2006-02-15T09:45:25'), - ('Phnom Penh', '18', '2006-02-15T09:45:25'), - ('Woodridge', '8', '2006-02-15T09:45:25'), - ('Charlotte Amalie', '106', '2006-02-15T09:45:25'), - ('Baku', '10', '2006-02-15T09:45:25'), - ('Sumqayit', '10', '2006-02-15T09:45:25'), - ('Kitwe', '109', '2006-02-15T09:45:25'), - ('Udine', '49', '2006-02-15T09:45:25'), - ('Brindisi', '49', '2006-02-15T09:45:25'), - ('Syrakusa', '49', '2006-02-15T09:45:25'), - ('Alessandria', '49', '2006-02-15T09:45:25'), - ('Livorno', '49', '2006-02-15T09:45:25'), - ('Bergamo', '49', '2006-02-15T09:45:25'), - ('Brescia', '49', '2006-02-15T09:45:25'), - ('Faaa', '36', '2006-02-15T09:45:25'), - ('Papeete', '36', '2006-02-15T09:45:25'), - ('South Hill', '5', '2006-02-15T09:45:25'), - ('Nukualofa', '95', '2006-02-15T09:45:25'), - ('Myingyan', '64', '2006-02-15T09:45:25'), - ('Monywa', '64', '2006-02-15T09:45:25'), - ('Funafuti', '99', '2006-02-15T09:45:25'), - ('Mwene-Ditu', '25', '2006-02-15T09:45:25'), - ('Lubumbashi', '25', '2006-02-15T09:45:25'), - ('Ziguinchor', '83', '2006-02-15T09:45:25'), - ('Ashgabat', '98', '2006-02-15T09:45:25'), - ('Bchar', '2', '2006-02-15T09:45:25'), - ('Batna', '2', '2006-02-15T09:45:25'), - ('Skikda', '2', '2006-02-15T09:45:25'), - ('Pyongyang', '70', '2006-02-15T09:45:25'), - ('Nyeri', '52', '2006-02-15T09:45:25'), - ('Kisumu', '52', '2006-02-15T09:45:25'), - ('Dhaka', '12', '2006-02-15T09:45:25'), - ('Jamalpur', '12', '2006-02-15T09:45:25'), - ('Tangail', '12', '2006-02-15T09:45:25'), - ('Saint-Denis', '79', '2006-02-15T09:45:25'), - ('Simferopol', '100', '2006-02-15T09:45:25'), - ('Kamjanets-Podilskyi', '100', '2006-02-15T09:45:25'), - ('ostka', '100', '2006-02-15T09:45:25'), - ('Sumy', '100', '2006-02-15T09:45:25'), - ('Mukateve', '100', '2006-02-15T09:45:25'), - ('Konotop', '100', '2006-02-15T09:45:25'), - ('Gingoog', '75', '2006-02-15T09:45:25'), - ('Taguig', '75', '2006-02-15T09:45:25'), - ('Tarlac', '75', '2006-02-15T09:45:25'), - ('Lapu-Lapu', '75', '2006-02-15T09:45:25'), - ('Bislig', '75', '2006-02-15T09:45:25'), - ('Tanza', '75', '2006-02-15T09:45:25'), - ('Imus', '75', '2006-02-15T09:45:25'), - ('Ozamis', '75', '2006-02-15T09:45:25'), - ('Santa Rosa', '75', '2006-02-15T09:45:25'), - ('Talavera', '75', '2006-02-15T09:45:25'), - ('Iligan', '75', '2006-02-15T09:45:25'), - ('Cavite', '75', '2006-02-15T09:45:25'), - ('Mandaluyong', '75', '2006-02-15T09:45:25'), - ('Cabuyao', '75', '2006-02-15T09:45:25'), - ('Baybay', '75', '2006-02-15T09:45:25'), - ('Tuguegarao', '75', '2006-02-15T09:45:25'), - ('Davao', '75', '2006-02-15T09:45:25'), - ('Tanauan', '75', '2006-02-15T09:45:25'), - ('Bayugan', '75', '2006-02-15T09:45:25'), - ('Hagonoy', '75', '2006-02-15T09:45:25'), - ('al-Qadarif', '89', '2006-02-15T09:45:25'), - ('Omdurman', '89', '2006-02-15T09:45:25') - ) AS data(city, old_country_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."country"' - AND map0.old_id = data.old_country_id - RETURNING city_id - ) - SELECT array_agg(city_id) INTO v_new_ids_city FROM inserted; - - FOR i IN 1..array_length(v_new_ids_city, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."city"', v_old_ids_city[i], v_new_ids_city[i]::TEXT); - END LOOP; - - v_old_ids_city := ARRAY['387', '29', '158', '23', '151', '438', '409', '133', '577', '97', '236', '255', '549', '314', '84', '486', '28', '317', '26', '21', '30', '89', '490', '44', '215', '485', '461', '83', '572', '456', '190', '413', '183', '328', '410', '25', '431', '189', '248', '66', '247', '569', '268', '357', '113', '539', '553', '310', '278', '156', '285', '274', '466', '343', '254', '369', '597', '308', '39', '320', '270', '150', '235', '225', '510', '367', '49', '408', '238', '558', '484', '259', '531', '352', '286', '319', '64', '534', '351', '460', '450', '290', '501', '153', '492', '583', '118', '184', '119', '412', '509', '396', '403', '415', '532', '117', '301', '419', '232', '318']; - WITH inserted AS ( - INSERT INTO "public"."city" ("city", "country_id", "last_update") - SELECT - data.city::character varying, - map0.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('Oulu', '33', '2006-02-15T09:45:25'), - ('Apeldoorn', '67', '2006-02-15T09:45:25'), - ('Emmen', '67', '2006-02-15T09:45:25'), - ('Amersfoort', '67', '2006-02-15T09:45:25'), - ('Ede', '67', '2006-02-15T09:45:25'), - ('s-Hertogenbosch', '67', '2006-02-15T09:45:25'), - ('Plock', '76', '2006-02-15T09:45:25'), - ('Czestochowa', '76', '2006-02-15T09:45:25'), - ('Wroclaw', '76', '2006-02-15T09:45:25'), - ('Bydgoszcz', '76', '2006-02-15T09:45:25'), - ('Jastrzebie-Zdrj', '76', '2006-02-15T09:45:25'), - ('Kalisz', '76', '2006-02-15T09:45:25'), - ('Tychy', '76', '2006-02-15T09:45:25'), - ('Lublin', '76', '2006-02-15T09:45:25'), - ('Boa Vista', '15', '2006-02-15T09:45:25'), - ('So Leopoldo', '15', '2006-02-15T09:45:25'), - ('Aparecida de Goinia', '15', '2006-02-15T09:45:25'), - ('Luzinia', '15', '2006-02-15T09:45:25'), - ('Anpolis', '15', '2006-02-15T09:45:25'), - ('Alvorada', '15', '2006-02-15T09:45:25'), - ('Araatuba', '15', '2006-02-15T09:45:25'), - ('Braslia', '15', '2006-02-15T09:45:25'), - ('Sorocaba', '15', '2006-02-15T09:45:25'), - ('Bag', '15', '2006-02-15T09:45:25'), - ('Ibirit', '15', '2006-02-15T09:45:25'), - ('So Bernardo do Campo', '15', '2006-02-15T09:45:25'), - ('Santo Andr', '15', '2006-02-15T09:45:25'), - ('Blumenau', '15', '2006-02-15T09:45:25'), - ('Vitria de Santo Anto', '15', '2006-02-15T09:45:25'), - ('Santa Brbara dOeste', '15', '2006-02-15T09:45:25'), - ('guas Lindas de Gois', '15', '2006-02-15T09:45:25'), - ('Poos de Caldas', '15', '2006-02-15T09:45:25'), - ('Goinia', '15', '2006-02-15T09:45:25'), - ('Maring', '15', '2006-02-15T09:45:25'), - ('Po', '15', '2006-02-15T09:45:25'), - ('Angra dos Reis', '15', '2006-02-15T09:45:25'), - ('Rio Claro', '15', '2006-02-15T09:45:25'), - ('Guaruj', '15', '2006-02-15T09:45:25'), - ('Juiz de Fora', '15', '2006-02-15T09:45:25'), - ('Belm', '15', '2006-02-15T09:45:25'), - ('Juazeiro do Norte', '15', '2006-02-15T09:45:25'), - ('Vila Velha', '15', '2006-02-15T09:45:25'), - ('Kimchon', '86', '2006-02-15T09:45:25'), - ('Naju', '86', '2006-02-15T09:45:25'), - ('Cheju', '86', '2006-02-15T09:45:25'), - ('Tonghae', '86', '2006-02-15T09:45:25'), - ('Uijongbu', '86', '2006-02-15T09:45:25'), - ('Ljubertsy', '80', '2006-02-15T09:45:25'), - ('Korolev', '80', '2006-02-15T09:45:25'), - ('Elista', '80', '2006-02-15T09:45:25'), - ('Kurgan', '80', '2006-02-15T09:45:25'), - ('Kolpino', '80', '2006-02-15T09:45:25'), - ('Serpuhov', '80', '2006-02-15T09:45:25'), - ('Moscow', '80', '2006-02-15T09:45:25'), - ('Kaliningrad', '80', '2006-02-15T09:45:25'), - ('Novoterkassk', '80', '2006-02-15T09:45:25'), - ('Zeleznogorsk', '80', '2006-02-15T09:45:25'), - ('Lipetsk', '80', '2006-02-15T09:45:25'), - ('Atinsk', '80', '2006-02-15T09:45:25'), - ('Maikop', '80', '2006-02-15T09:45:25'), - ('Kirovo-Tepetsk', '80', '2006-02-15T09:45:25'), - ('Dzerzinsk', '80', '2006-02-15T09:45:25'), - ('Jaroslavl', '80', '2006-02-15T09:45:25'), - ('Ivanovo', '80', '2006-02-15T09:45:25'), - ('Syktyvkar', '80', '2006-02-15T09:45:25'), - ('Niznekamsk', '80', '2006-02-15T09:45:25'), - ('Balaiha', '80', '2006-02-15T09:45:25'), - ('Pjatigorsk', '80', '2006-02-15T09:45:25'), - ('Jelets', '80', '2006-02-15T09:45:25'), - ('Usolje-Sibirskoje', '80', '2006-02-15T09:45:25'), - ('Smolensk', '80', '2006-02-15T09:45:25'), - ('Kamyin', '80', '2006-02-15T09:45:25'), - ('Teboksary', '80', '2006-02-15T09:45:25'), - ('Nabereznyje Telny', '80', '2006-02-15T09:45:25'), - ('Kursk', '80', '2006-02-15T09:45:25'), - ('Mahajanga', '57', '2006-02-15T09:45:25'), - ('Beira', '63', '2006-02-15T09:45:25'), - ('Tete', '63', '2006-02-15T09:45:25'), - ('Naala-Porto', '63', '2006-02-15T09:45:25'), - ('Santiago de los Caballeros', '27', '2006-02-15T09:45:25'), - ('San Felipe de Puerto Plata', '27', '2006-02-15T09:45:25'), - ('La Romana', '27', '2006-02-15T09:45:25'), - ('Sucre', '14', '2006-02-15T09:45:25'), - ('El Alto', '14', '2006-02-15T09:45:25'), - ('Sousse', '96', '2006-02-15T09:45:25'), - ('Yangor', '65', '2006-02-15T09:45:25'), - ('Ciomas', '45', '2006-02-15T09:45:25'), - ('Gorontalo', '45', '2006-02-15T09:45:25'), - ('Ciparay', '45', '2006-02-15T09:45:25'), - ('Pontianak', '45', '2006-02-15T09:45:25'), - ('Surakarta', '45', '2006-02-15T09:45:25'), - ('Pangkal Pinang', '45', '2006-02-15T09:45:25'), - ('Pemalang', '45', '2006-02-15T09:45:25'), - ('Probolinggo', '45', '2006-02-15T09:45:25'), - ('Tegal', '45', '2006-02-15T09:45:25'), - ('Cianjur', '45', '2006-02-15T09:45:25'), - ('Lhokseumawe', '45', '2006-02-15T09:45:25'), - ('Purwakarta', '45', '2006-02-15T09:45:25'), - ('Jakarta', '45', '2006-02-15T09:45:25'), - ('Madiun', '45', '2006-02-15T09:45:25') - ) AS data(city, old_country_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."country"' - AND map0.old_id = data.old_country_id - RETURNING city_id - ) - SELECT array_agg(city_id) INTO v_new_ids_city FROM inserted; - - FOR i IN 1..array_length(v_new_ids_city, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."city"', v_old_ids_city[i], v_new_ids_city[i]::TEXT); - END LOOP; - - -- Table: "public"."film" (1000 records) - v_old_ids_film := ARRAY['805', '853', '817', '732', '65', '915', '999', '564', '176', '655', '32', '75', '653', '362', '789', '642', '930', '82', '34', '233', '792', '355', '761', '575', '643', '454', '71', '488', '108', '91', '387', '959', '458', '728', '704', '950', '752', '818', '583', '626', '834', '160', '483', '189', '822', '248', '647', '228', '29', '520', '969', '411', '755', '501', '247', '186', '654', '769', '858', '509', '352', '394', '599', '526', '979', '182', '451', '992', '331', '278', '381', '117', '414', '597', '305', '105', '68', '450', '841', '449', '487', '7', '889', '457', '839', '894', '146', '508', '578', '623', '735', '200', '808', '275', '3', '519', '921', '456', '663', '770']; - WITH inserted AS ( - INSERT INTO "public"."film" ("description", "fulltext", "language_id", "last_update", "length", "rating", "release_year", "rental_duration", "rental_rate", "replacement_cost", "special_features", "title") - SELECT - data.description::text, - data.fulltext::tsvector, - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.length::smallint, - data.rating::mpaa_rating, - data.release_year::integer, - data.rental_duration::smallint, - data.rental_rate::numeric, - data.replacement_cost::numeric, - data.special_features::text[], - data.title::character varying - FROM (VALUES - ('A Amazing Saga of a Moose And a Pastry Chef who must Escape a Butler in Australia', '''amaz'':4 ''australia'':19 ''butler'':17 ''chef'':12 ''escap'':15 ''monsoon'':2 ''moos'':8 ''must'':14 ''pastri'':11 ''saga'':5 ''sleepless'':1', '1', '2013-05-26T14:50:58.951000', 64, 'G', 2006, 5, '4.99', '12.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Sleepless Monsoon'), - ('A Awe-Inspiring Yarn of a Womanizer And a Explorer who must Fight a Woman in The First Manned Space Station', '''awe'':5 ''awe-inspir'':4 ''explor'':13 ''fight'':16 ''first'':21 ''inspir'':6 ''man'':22 ''must'':15 ''space'':23 ''station'':24 ''stranger'':1,2 ''woman'':10,18 ''yarn'':7', '1', '2013-05-26T14:50:58.951000', 139, 'G', 2006, 3, '4.99', '12.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Stranger Strangers'), - ('A Lacklusture Panorama of a A Shark And a Pioneer who must Confront a Student in The First Manned Space Station', '''confront'':15 ''evolut'':2 ''first'':20 ''lacklustur'':4 ''man'':21 ''must'':14 ''panorama'':5 ''pioneer'':12 ''shark'':9 ''soldier'':1 ''space'':22 ''station'':23 ''student'':17', '1', '2013-05-26T14:50:58.951000', 185, 'R', 2006, 7, '4.99', '27.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Soldiers Evolution'), - ('A Amazing Yarn of a Sumo Wrestler And a Boat who must Conquer a Waitress in New Orleans', '''amaz'':4 ''boat'':12 ''conquer'':15 ''heartbreak'':2 ''must'':14 ''new'':19 ''orlean'':20 ''ring'':1 ''sumo'':8 ''waitress'':17 ''wrestler'':9 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 58, 'G', 2006, 5, '0.99', '17.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Rings Heartbreakers'), - ('A Unbelieveable Drama of a Student And a Husband who must Outrace a Sumo Wrestler in Berlin', '''behavior'':1 ''berlin'':19 ''drama'':5 ''husband'':11 ''must'':13 ''outrac'':14 ''runaway'':2 ''student'':8 ''sumo'':16 ''unbeliev'':4 ''wrestler'':17', '1', '2013-05-26T14:50:58.951000', 100, 'PG', 2006, 3, '4.99', '20.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Behavior Runaway'), - ('A Thrilling Epistle of a Moose And a Boy who must Meet a Database Administrator in A Monastery', '''administr'':17 ''boy'':11 ''crazi'':2 ''databas'':16 ''epistl'':5 ''meet'':14 ''monasteri'':20 ''moos'':8 ''must'':13 ''thrill'':4 ''truman'':1', '1', '2013-05-26T14:50:58.951000', 92, 'G', 2006, 7, '4.99', '9.99', ARRAY['Trailers', 'Commentaries']::text[], 'Truman Crazy'), - ('A Fateful Reflection of a Waitress And a Boat who must Discover a Sumo Wrestler in Ancient China', '''ancient'':19 ''boat'':11 ''china'':20 ''discov'':14 ''fate'':4 ''fiction'':2 ''must'':13 ''reflect'':5 ''sumo'':16 ''waitress'':8 ''wrestler'':17 ''zooland'':1', '1', '2013-05-26T14:50:58.951000', 101, 'R', 2006, 5, '2.99', '28.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Zoolander Fiction'), - ('A Fateful Drama of a Frisbee And a Crocodile who must Vanquish a Dog in The First Manned Space Station', '''crocodil'':11 ''dog'':16 ''drama'':5 ''fate'':4 ''first'':19 ''frisbe'':8 ''imag'':2 ''man'':20 ''massag'':1 ''must'':13 ''space'':21 ''station'':22 ''vanquish'':14', '1', '2013-05-26T14:50:58.951000', 161, 'PG', 2006, 4, '2.99', '11.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Massage Image'), - ('A Touching Documentary of a Cat And a Pastry Chef who must Find a Lumberjack in A Baloon', '''baloon'':20 ''cat'':8 ''chef'':12 ''congeni'':1 ''documentari'':5 ''find'':15 ''lumberjack'':17 ''must'':14 ''pastri'':11 ''quest'':2 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 87, 'PG-13', 2006, 6, '0.99', '21.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Congeniality Quest'), - ('A Brilliant Panorama of a Moose And a Man who must Reach a Teacher in The Gulf of Mexico', '''brilliant'':4 ''gulf'':19 ''man'':11 ''mexico'':21 ''moos'':8 ''must'':13 ''panorama'':5 ''panther'':1 ''reach'':14 ''red'':2 ''teacher'':16', '1', '2013-05-26T14:50:58.951000', 109, 'NC-17', 2006, 5, '4.99', '22.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Panther Reds'), - ('A Astounding Story of a Dog And a Squirrel who must Defeat a Woman in An Abandoned Amusement Park', '''abandon'':19 ''amus'':20 ''apocalyps'':1 ''astound'':4 ''defeat'':14 ''dog'':8 ''flamingo'':2 ''must'':13 ''park'':21 ''squirrel'':11 ''stori'':5 ''woman'':16', '1', '2013-05-26T14:50:58.951000', 119, 'R', 2006, 6, '4.99', '11.99', ARRAY['Trailers', 'Commentaries']::text[], 'Apocalypse Flamingos'), - ('A Thrilling Documentary of a Car And a Student who must Sink a Hunter in The Canadian Rockies', '''bird'':1 ''canadian'':19 ''car'':8 ''documentari'':5 ''hunter'':16 ''independ'':2 ''must'':13 ''rocki'':20 ''sink'':14 ''student'':11 ''thrill'':4', '1', '2013-05-26T14:50:58.951000', 163, 'G', 2006, 6, '4.99', '14.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Bird Independence'), - ('A Fanciful Display of a Teacher And a Crocodile who must Succumb a Girl in A Baloon', '''baloon'':19 ''club'':2 ''crocodil'':11 ''display'':5 ''fanci'':4 ''girl'':16 ''must'':13 ''panic'':1 ''succumb'':14 ''teacher'':8', '1', '2013-05-26T14:50:58.951000', 102, 'G', 2006, 3, '4.99', '15.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Panic Club'), - ('A Amazing Saga of a Woman And a Womanizer who must Discover a Cat in The First Manned Space Station', '''amaz'':4 ''cat'':16 ''discov'':14 ''first'':19 ''glori'':1 ''man'':20 ''must'':13 ''saga'':5 ''space'':21 ''station'':22 ''traci'':2 ''woman'':8,11', '1', '2013-05-26T14:50:58.951000', 115, 'PG-13', 2006, 7, '2.99', '13.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Glory Tracy'), - ('A Fateful Tale of a Mad Cow And a Crocodile who must Meet a Husband in New Orleans', '''cabin'':2 ''cow'':9 ''crocodil'':12 ''fate'':4 ''husband'':17 ''mad'':8 ''meet'':15 ''must'':14 ''new'':19 ''orlean'':20 ''shock'':1 ''tale'':5', '1', '2013-05-26T14:50:58.951000', 79, 'PG-13', 2006, 7, '2.99', '15.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Shock Cabin'), - ('A Amazing Saga of a Dog And a A Shark who must Challenge a Cat in The Sahara Desert', '''amaz'':4 ''betray'':2 ''cat'':17 ''challeng'':15 ''desert'':21 ''dog'':8 ''must'':14 ''order'':1 ''saga'':5 ''sahara'':20 ''shark'':12', '1', '2013-05-26T14:50:58.951000', 120, 'PG-13', 2006, 7, '2.99', '13.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Order Betrayed'), - ('A Fanciful Character Study of a Secret Agent And a Mad Scientist who must Reach a Teacher in Australia', '''agent'':10 ''australia'':21 ''boondock'':2 ''charact'':5 ''fanci'':4 ''mad'':13 ''must'':16 ''reach'':17 ''scientist'':14 ''secret'':9 ''studi'':6 ''teacher'':19 ''vacat'':1', '1', '2013-05-26T14:50:58.951000', 145, 'R', 2006, 4, '2.99', '23.99', ARRAY['Commentaries']::text[], 'Vacation Boondock'), - ('A Boring Drama of a Explorer And a Man who must Kill a Lumberjack in A Manhattan Penthouse', '''argonaut'':2 ''blood'':1 ''bore'':4 ''drama'':5 ''explor'':8 ''kill'':14 ''lumberjack'':16 ''man'':11 ''manhattan'':19 ''must'':13 ''penthous'':20', '1', '2013-05-26T14:50:58.951000', 71, 'G', 2006, 3, '0.99', '13.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Blood Argonauts'), - ('A Touching Epistle of a Madman And a Mad Cow who must Defeat a Student in Nigeria', '''arabia'':1 ''cow'':12 ''defeat'':15 ''dogma'':2 ''epistl'':5 ''mad'':11 ''madman'':8 ''must'':14 ''nigeria'':19 ''student'':17 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 62, 'NC-17', 2006, 6, '0.99', '29.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Arabia Dogma'), - ('A Touching Reflection of a Mad Scientist And a Boat who must Face a Moose in A Shark Tank', '''boat'':12 ''discipl'':1 ''face'':15 ''mad'':8 ''moos'':17 ''mother'':2 ''must'':14 ''reflect'':5 ''scientist'':9 ''shark'':20 ''tank'':21 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 141, 'PG', 2006, 3, '0.99', '17.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Disciple Mother'), - ('A Fateful Yarn of a Secret Agent And a Feminist who must Find a Feminist in A Jet Boat', '''agent'':9 ''boat'':21 ''fate'':4 ''feminist'':12,17 ''find'':15 ''jet'':20 ''licens'':2 ''must'':14 ''secret'':8 ''shrek'':1 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 154, 'PG-13', 2006, 7, '2.99', '15.99', ARRAY['Commentaries']::text[], 'Shrek License'), - ('A Thoughtful Epistle of a Dog And a Feminist who must Chase a Composer in Berlin', '''berlin'':18 ''chase'':14 ''compos'':16 ''dog'':8 ''elf'':2 ''epistl'':5 ''feminist'':11 ''ghostbust'':1 ''must'':13 ''thought'':4', '1', '2013-05-26T14:50:58.951000', 101, 'R', 2006, 7, '0.99', '18.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Ghostbusters Elf'), - ('A Emotional Documentary of a Moose And a Car who must Redeem a Mad Cow in A Baloon Factory', '''baloon'':20 ''car'':11 ''cow'':17 ''documentari'':5 ''emot'':4 ''factori'':21 ''mad'':16 ''moos'':8 ''must'':13 ''pari'':2 ''redeem'':14 ''santa'':1', '1', '2013-05-26T14:50:58.951000', 154, 'PG', 2006, 7, '2.99', '23.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Santa Paris'), - ('A Fateful Panorama of a Moose And a Dog who must Chase a Crocodile in Ancient Japan', '''ancient'':18 ''chase'':14 ''crocodil'':16 ''dog'':11 ''fate'':4 ''groundhog'':2 ''japan'':19 ''midsumm'':1 ''moos'':8 ''must'':13 ''panorama'':5', '1', '2013-05-26T14:50:58.951000', 48, 'G', 2006, 3, '4.99', '27.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Midsummer Groundhog'), - ('A Astounding Epistle of a Technical Writer And a Teacher who must Fight a Squirrel in The Sahara Desert', '''astound'':4 ''closer'':2 ''desert'':21 ''epistl'':5 ''fight'':15 ''must'':14 ''orient'':1 ''sahara'':20 ''squirrel'':17 ''teacher'':12 ''technic'':8 ''writer'':9', '1', '2013-05-26T14:50:58.951000', 118, 'R', 2006, 3, '2.99', '22.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Orient Closer'), - ('A Epic Character Study of a Frisbee And a Moose who must Outgun a Technical Writer in A Shark Tank', '''aladdin'':2 ''charact'':5 ''epic'':4 ''frisbe'':9 ''impact'':1 ''moos'':12 ''must'':14 ''outgun'':15 ''shark'':21 ''studi'':6 ''tank'':22 ''technic'':17 ''writer'':18', '1', '2013-05-26T14:50:58.951000', 180, 'PG-13', 2006, 6, '0.99', '20.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Impact Aladdin'), - ('A Emotional Reflection of a Teacher And a Man who must Meet a Cat in The First Manned Space Station', '''anonym'':2 ''bilko'':1 ''cat'':16 ''emot'':4 ''first'':19 ''man'':11,20 ''meet'':14 ''must'':13 ''reflect'':5 ''space'':21 ''station'':22 ''teacher'':8', '1', '2013-05-26T14:50:58.951000', 100, 'PG-13', 2006, 3, '4.99', '25.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Bilko Anonymous'), - ('A Thrilling Panorama of a Technical Writer And a Car who must Discover a Forensic Psychologist in A Shark Tank', '''car'':12 ''discov'':15 ''forens'':17 ''joon'':1 ''must'':14 ''northwest'':2 ''panorama'':5 ''psychologist'':18 ''shark'':21 ''tank'':22 ''technic'':8 ''thrill'':4 ''writer'':9', '1', '2013-05-26T14:50:58.951000', 105, 'NC-17', 2006, 3, '0.99', '23.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Joon Northwest'), - ('A Lacklusture Yarn of a Feminist And a Database Administrator who must Face a Hunter in New Orleans', '''administr'':12 ''butch'':1 ''databas'':11 ''face'':15 ''feminist'':8 ''hunter'':17 ''lacklustur'':4 ''must'':14 ''new'':19 ''orlean'':20 ''panther'':2 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 67, 'PG-13', 2006, 6, '0.99', '19.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Butch Panther'), - ('A Thrilling Panorama of a Database Administrator And a Astronaut who must Challenge a Lumberjack in A Baloon', '''administr'':9 ''astronaut'':12 ''baloon'':20 ''bound'':1 ''challeng'':15 ''cheaper'':2 ''databas'':8 ''lumberjack'':17 ''must'':14 ''panorama'':5 ''thrill'':4', '1', '2013-05-26T14:50:58.951000', 98, 'PG', 2006, 5, '0.99', '17.99', ARRAY['Behind the Scenes']::text[], 'Bound Cheaper'), - ('A Boring Display of a Sumo Wrestler And a Husband who must Build a Waitress in The Gulf of Mexico', '''bonni'':2 ''bore'':4 ''build'':15 ''display'':5 ''gulf'':20 ''gun'':1 ''husband'':12 ''mexico'':22 ''must'':14 ''sumo'':8 ''waitress'':17 ''wrestler'':9', '1', '2013-05-26T14:50:58.951000', 100, 'G', 2006, 7, '0.99', '27.99', ARRAY['Behind the Scenes']::text[], 'Gun Bonnie'), - ('A Astounding Yarn of a Pioneer And a Crocodile who must Defeat a A Shark in The Outback', '''astound'':4 ''crocodil'':11 ''defeat'':14 ''must'':13 ''outback'':20 ''pioneer'':8 ''shark'':17 ''warlock'':1 ''werewolf'':2 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 83, 'G', 2006, 6, '2.99', '10.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Warlock Werewolf'), - ('A Insightful Saga of a Mad Scientist And a Mad Scientist who must Kill a Astronaut in An Abandoned Fun House', '''abandon'':21 ''astronaut'':18 ''fun'':22 ''hous'':23 ''indian'':1 ''insight'':4 ''kill'':16 ''love'':2 ''mad'':8,12 ''must'':15 ''saga'':5 ''scientist'':9,13', '1', '2013-05-26T14:50:58.951000', 135, 'NC-17', 2006, 4, '0.99', '26.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Indian Love'), - ('A Unbelieveable Documentary of a Database Administrator And a Frisbee who must Redeem a Mad Scientist in A Baloon Factory', '''administr'':9 ''baloon'':21 ''databas'':8 ''documentari'':5 ''factori'':22 ''frisbe'':12 ''mad'':17 ''must'':14 ''redeem'':15 ''reunion'':1 ''scientist'':18 ''unbeliev'':4 ''witch'':2', '1', '2013-05-26T14:50:58.951000', 63, 'R', 2006, 3, '0.99', '26.99', ARRAY['Commentaries']::text[], 'Reunion Witches'), - ('A Thoughtful Documentary of a Student And a Madman who must Challenge a Squirrel in A Manhattan Penthouse', '''challeng'':14 ''documentari'':5 ''madman'':11 ''manhattan'':19 ''must'':13 ''penthous'':20 ''pure'':1 ''runner'':2 ''squirrel'':16 ''student'':8 ''thought'':4', '1', '2013-05-26T14:50:58.951000', 121, 'NC-17', 2006, 3, '2.99', '25.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Pure Runner'), - ('A Boring Tale of a Dog And a Woman who must Meet a Dentist in California', '''bore'':4 ''california'':18 ''dentist'':16 ''dog'':8 ''hous'':2 ''meet'':14 ''must'':13 ''tale'':5 ''volum'':1 ''woman'':11', '1', '2013-05-26T14:50:58.951000', 132, 'PG', 2006, 7, '4.99', '12.99', ARRAY['Commentaries']::text[], 'Volume House'), - ('A Thoughtful Documentary of a Crocodile And a Robot who must Outrace a Womanizer in The Outback', '''crocodil'':8 ''documentari'':5 ''madigan'':2 ''must'':13 ''outback'':19 ''outrac'':14 ''robot'':11 ''runner'':1 ''thought'':4 ''woman'':16', '1', '2013-05-26T14:50:58.951000', 101, 'NC-17', 2006, 6, '0.99', '27.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Runner Madigan'), - ('A Boring Character Study of a Car And a Husband who must Outgun a Frisbee in The First Manned Space Station', '''bore'':4 ''car'':9 ''charact'':5 ''duck'':2 ''first'':20 ''frisbe'':17 ''husband'':12 ''man'':21 ''must'':14 ''outgun'':15 ''someth'':1 ''space'':22 ''station'':23 ''studi'':6', '1', '2013-05-26T14:50:58.951000', 180, 'NC-17', 2006, 4, '4.99', '17.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Something Duck'), - ('A Intrepid Story of a Sumo Wrestler And a Teacher who must Meet a A Shark in An Abandoned Fun House', '''abandon'':21 ''fun'':22 ''hous'':23 ''intrepid'':4 ''meet'':15 ''mission'':1 ''must'':14 ''shark'':18 ''stori'':5 ''sumo'':8 ''teacher'':12 ''wrestler'':9 ''zooland'':2', '1', '2013-05-26T14:50:58.951000', 164, 'PG-13', 2006, 3, '4.99', '26.99', ARRAY['Behind the Scenes']::text[], 'Mission Zoolander'), - ('A Unbelieveable Character Study of a Mad Scientist And a Astronaut who must Find a Pioneer in A Manhattan Penthouse', '''astronaut'':13 ''charact'':5 ''find'':16 ''mad'':9 ''manhattan'':21 ''must'':15 ''noon'':1 ''papi'':2 ''penthous'':22 ''pioneer'':18 ''scientist'':10 ''studi'':6 ''unbeliev'':4', '1', '2013-05-26T14:50:58.951000', 57, 'G', 2006, 5, '2.99', '12.99', ARRAY['Behind the Scenes']::text[], 'Noon Papi'), - ('A Fanciful Story of a Technical Writer And a Squirrel who must Defeat a Dog in The Gulf of Mexico', '''defeat'':15 ''dog'':17 ''fanci'':4 ''gulf'':20 ''hellfight'':2 ''mexico'':22 ''must'':14 ''spoiler'':1 ''squirrel'':12 ''stori'':5 ''technic'':8 ''writer'':9', '1', '2013-05-26T14:50:58.951000', 151, 'G', 2006, 4, '0.99', '26.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Spoilers Hellfighters'), - ('A Epic Tale of a Pioneer And a Hunter who must Escape a Girl in A U-Boat', '''boat'':21 ''club'':1 ''epic'':4 ''escap'':14 ''girl'':16 ''graffiti'':2 ''hunter'':11 ''must'':13 ''pioneer'':8 ''tale'':5 ''u'':20 ''u-boat'':19', '1', '2013-05-26T14:50:58.951000', 65, 'PG-13', 2006, 4, '0.99', '12.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Club Graffiti'), - ('A Amazing Yarn of a Hunter And a Butler who must Defeat a Boy in A Jet Boat', '''amaz'':4 ''boat'':20 ''boy'':16 ''butler'':11 ''defeat'':14 ''hunter'':8 ''jericho'':1 ''jet'':19 ''mulan'':2 ''must'':13 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 171, 'NC-17', 2006, 3, '2.99', '29.99', ARRAY['Commentaries']::text[], 'Jericho Mulan'), - ('A Emotional Drama of a Womanizer And a Squirrel who must Vanquish a Crocodile in Ancient India', '''ancient'':18 ''creatur'':1 ''crocodil'':16 ''drama'':5 ''emot'':4 ''india'':19 ''must'':13 ''shakespear'':2 ''squirrel'':11 ''vanquish'':14 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 139, 'NC-17', 2006, 3, '0.99', '23.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Creatures Shakespeare'), - ('A Fast-Paced Display of a Robot And a Butler who must Defeat a Butler in A MySQL Convention', '''butler'':13,18 ''convent'':22 ''defeat'':16 ''display'':7 ''fast'':5 ''fast-pac'':4 ''must'':15 ''mysql'':21 ''pace'':6 ''robot'':10 ''soup'':1 ''wisdom'':2', '1', '2013-05-26T14:50:58.951000', 169, 'R', 2006, 6, '0.99', '12.99', ARRAY['Behind the Scenes']::text[], 'Soup Wisdom'), - ('A Taut Drama of a Cat And a Girl who must Defeat a Frisbee in The Canadian Rockies', '''canadian'':19 ''cat'':8 ''defeat'':14 ''dozen'':1 ''drama'':5 ''frisbe'':16 ''girl'':11 ''lion'':2 ''must'':13 ''rocki'':20 ''taut'':4', '1', '2013-05-26T14:50:58.951000', 177, 'NC-17', 2006, 6, '4.99', '20.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Dozen Lion'), - ('A Thoughtful Drama of a Husband And a Secret Agent who must Pursue a Database Administrator in Ancient India', '''administr'':18 ''agent'':12 ''ancient'':20 ''databas'':17 ''drama'':5 ''husband'':8 ''india'':21 ''massacr'':2 ''must'':14 ''outfield'':1 ''pursu'':15 ''secret'':11 ''thought'':4', '1', '2013-05-26T14:50:58.951000', 129, 'NC-17', 2006, 4, '0.99', '18.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Outfield Massacre'), - ('A Fanciful Documentary of a Pioneer And a Woman who must Redeem a Hunter in Ancient Japan', '''ancient'':18 ''detect'':1 ''documentari'':5 ''fanci'':4 ''hunter'':16 ''japan'':19 ''must'':13 ''pioneer'':8 ''redeem'':14 ''vision'':2 ''woman'':11', '1', '2013-05-26T14:50:58.951000', 143, 'PG-13', 2006, 4, '0.99', '16.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Detective Vision'), - ('A Fateful Yarn of a Womanizer And a Feminist who must Succumb a Database Administrator in Ancient India', '''administr'':17 ''ancient'':19 ''antitrust'':1 ''databas'':16 ''fate'':4 ''feminist'':11 ''india'':20 ''must'':13 ''succumb'':14 ''tomato'':2 ''woman'':8 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 168, 'NC-17', 2006, 5, '2.99', '11.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Antitrust Tomatoes'), - ('A Insightful Story of a Man And a Husband who must Overcome a Madman in A Monastery', '''husband'':11 ''insight'':4 ''licens'':1 ''madman'':16 ''man'':8 ''monasteri'':19 ''must'':13 ''overcom'':14 ''stori'':5 ''weekend'':2', '1', '2013-05-26T14:50:58.951000', 91, 'NC-17', 2006, 7, '2.99', '28.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'License Weekend'), - ('A Intrepid Drama of a Butler And a Lumberjack who must Challenge a Database Administrator in A Manhattan Penthouse', '''administr'':17 ''butler'':8 ''challeng'':14 ''databas'':16 ''drama'':5 ''intrepid'':4 ''lion'':2 ''lumberjack'':11 ''manhattan'':20 ''must'':13 ''penthous'':21 ''west'':1', '1', '2013-05-26T14:50:58.951000', 159, 'G', 2006, 4, '4.99', '29.99', ARRAY['Trailers']::text[], 'West Lion'), - ('A Beautiful Yarn of a Forensic Psychologist And a Frisbee who must Battle a Moose in A Jet Boat', '''battl'':15 ''beauti'':4 ''boat'':21 ''forens'':8 ''frisbe'':12 ''gun'':2 ''heaven'':1 ''jet'':20 ''moos'':17 ''must'':14 ''psychologist'':9 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 49, 'NC-17', 2006, 5, '4.99', '13.99', ARRAY['Behind the Scenes']::text[], 'Heavenly Gun'), - ('A Emotional Story of a Squirrel And a Crocodile who must Succumb a Husband in The Sahara Desert', '''crocodil'':11 ''desert'':20 ''emot'':4 ''husband'':16 ''midnight'':2 ''must'':13 ''sabrina'':1 ''sahara'':19 ''squirrel'':8 ''stori'':5 ''succumb'':14', '1', '2013-05-26T14:50:58.951000', 99, 'PG', 2006, 5, '4.99', '11.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Sabrina Midnight'), - ('A Insightful Reflection of a Pioneer And a Teacher who must Build a Composer in The First Manned Space Station', '''build'':14 ''compos'':16 ''doll'':2 ''first'':19 ''insight'':4 ''kiss'':1 ''man'':20 ''must'':13 ''pioneer'':8 ''reflect'':5 ''space'':21 ''station'':22 ''teacher'':11', '1', '2013-05-26T14:50:58.951000', 141, 'R', 2006, 3, '4.99', '9.99', ARRAY['Trailers']::text[], 'Kissing Dolls'), - ('A Emotional Tale of a Pastry Chef And a Forensic Psychologist who must Succumb a Monkey in The Sahara Desert', '''chef'':9 ''desert'':22 ''downhil'':1 ''emot'':4 ''enough'':2 ''forens'':12 ''monkey'':18 ''must'':15 ''pastri'':8 ''psychologist'':13 ''sahara'':21 ''succumb'':16 ''tale'':5', '1', '2013-05-26T14:50:58.951000', 47, 'G', 2006, 3, '0.99', '19.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Downhill Enough'), - ('A Lacklusture Display of a Explorer And a Hunter who must Succumb a Database Administrator in A Baloon Factory', '''administr'':17 ''baloon'':20 ''craft'':1 ''databas'':16 ''display'':5 ''explor'':8 ''factori'':21 ''hunter'':11 ''lacklustur'':4 ''must'':13 ''outfield'':2 ''succumb'':14', '1', '2013-05-26T14:50:58.951000', 64, 'NC-17', 2006, 6, '0.99', '17.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Craft Outfield'), - ('A Touching Documentary of a Dentist And a Sumo Wrestler who must Overcome a Boy in The Gulf of Mexico', '''boy'':17 ''dentist'':8 ''documentari'':5 ''gulf'':20 ''mexico'':22 ''must'':14 ''overcom'':15 ''panki'':1 ''submarin'':2 ''sumo'':11 ''touch'':4 ''wrestler'':12', '1', '2013-05-26T14:50:58.951000', 93, 'G', 2006, 4, '4.99', '19.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Panky Submarine'), - ('A Intrepid Yarn of a Monkey And a Boy who must Fight a Composer in A Manhattan Penthouse', '''boy'':11 ''compos'':16 ''fight'':14 ''intrepid'':4 ''jacket'':2 ''manhattan'':19 ''monkey'':8 ''must'':13 ''penthous'':20 ''school'':1 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 151, 'PG-13', 2006, 5, '4.99', '21.99', ARRAY['Trailers']::text[], 'School Jacket'), - ('A Amazing Display of a Car And a Monkey who must Fight a Teacher in Soviet Georgia', '''amaz'':4 ''bed'':2 ''car'':8 ''display'':5 ''fight'':14 ''georgia'':19 ''monkey'':11 ''must'':13 ''soviet'':18 ''submarin'':1 ''teacher'':16', '1', '2013-05-26T14:50:58.951000', 127, 'R', 2006, 5, '4.99', '21.99', ARRAY['Trailers']::text[], 'Submarine Bed'), - ('A Epic Yarn of a Cat And a Madman who must Vanquish a Dentist in An Abandoned Amusement Park', '''abandon'':19 ''amus'':20 ''cat'':8 ''cowboy'':2 ''dentist'':16 ''epic'':4 ''languag'':1 ''madman'':11 ''must'':13 ''park'':21 ''vanquish'':14 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 78, 'NC-17', 2006, 5, '0.99', '26.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Language Cowboy'), - ('A Intrepid Tale of a Pioneer And a Moose who must Conquer a Frisbee in A MySQL Convention', '''calendar'':2 ''conquer'':14 ''convent'':20 ''frisbe'':16 ''gather'':1 ''intrepid'':4 ''moos'':11 ''must'':13 ''mysql'':19 ''pioneer'':8 ''tale'':5', '1', '2013-05-26T14:50:58.951000', 176, 'PG-13', 2006, 4, '0.99', '22.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Gathering Calendar'), - ('A Touching Reflection of a Man And a Man who must Sink a Robot in The Outback', '''hamlet'':1 ''man'':8,11 ''must'':13 ''outback'':19 ''reflect'':5 ''robot'':16 ''sink'':14 ''touch'':4 ''wisdom'':2', '1', '2013-05-26T14:50:58.951000', 146, 'R', 2006, 7, '2.99', '21.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Hamlet Wisdom'), - ('A Boring Tale of a Husband And a Boy who must Fight a Squirrel in Ancient China', '''ancient'':18 ''bore'':4 ''boy'':11 ''china'':19 ''fight'':14 ''husband'':8 ''mother'':1 ''must'':13 ''oleand'':2 ''squirrel'':16 ''tale'':5', '1', '2013-05-26T14:50:58.951000', 103, 'R', 2006, 3, '0.99', '20.99', ARRAY['Trailers', 'Commentaries']::text[], 'Mother Oleander'), - ('A Thoughtful Character Study of a Squirrel And a Technical Writer who must Outrace a Student in Ancient Japan', '''ancient'':20 ''charact'':5 ''japan'':21 ''lock'':1 ''must'':15 ''outrac'':16 ''rear'':2 ''squirrel'':9 ''student'':18 ''studi'':6 ''technic'':12 ''thought'':4 ''writer'':13', '1', '2013-05-26T14:50:58.951000', 120, 'R', 2006, 7, '2.99', '10.99', ARRAY['Trailers', 'Commentaries']::text[], 'Lock Rear'), - ('A Awe-Inspiring Drama of a Secret Agent And a Hunter who must Fight a Moose in Nigeria', '''agent'':11 ''awe'':5 ''awe-inspir'':4 ''drama'':7 ''fight'':17 ''hunter'':14 ''inspir'':6 ''moos'':19 ''must'':16 ''nigeria'':21 ''panic'':2 ''secret'':10 ''witch'':1', '1', '2013-05-26T14:50:58.951000', 100, 'NC-17', 2006, 6, '4.99', '10.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Witches Panic'), - ('A Fateful Documentary of a Robot And a Student who must Battle a Cat in A Monastery', '''anthem'':2 ''battl'':14 ''cat'':16 ''control'':1 ''documentari'':5 ''fate'':4 ''monasteri'':19 ''must'':13 ''robot'':8 ''student'':11', '1', '2013-05-26T14:50:58.951000', 185, 'G', 2006, 7, '4.99', '9.99', ARRAY['Commentaries']::text[], 'Control Anthem'), - ('A Epic Documentary of a Hunter And a Dog who must Outgun a Dog in A Baloon Factory', '''baloon'':19 ''documentari'':5 ''dog'':11,16 ''epic'':4 ''factori'':20 ''hunter'':8 ''igbi'':1 ''maker'':2 ''must'':13 ''outgun'':14', '1', '2013-05-26T14:50:58.951000', 160, 'NC-17', 2006, 7, '4.99', '12.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Igby Maker'), - ('A Intrepid Reflection of a Technical Writer And a Hunter who must Defeat a Sumo Wrestler in A Monastery', '''defeat'':15 ''hunter'':12 ''intrepid'':4 ''mile'':2 ''monasteri'':21 ''must'':14 ''reflect'':5 ''sumo'':17 ''technic'':8 ''wrath'':1 ''wrestler'':18 ''writer'':9', '1', '2013-05-26T14:50:58.951000', 176, 'NC-17', 2006, 5, '0.99', '17.99', ARRAY['Trailers', 'Commentaries']::text[], 'Wrath Mile'), - ('A Astounding Display of a Forensic Psychologist And a Mad Scientist who must Challenge a Girl in New Orleans', '''astound'':4 ''challeng'':16 ''display'':5 ''forens'':8 ''forward'':1 ''girl'':18 ''mad'':12 ''must'':15 ''new'':20 ''orlean'':21 ''psychologist'':9 ''scientist'':13 ''templ'':2', '1', '2013-05-26T14:50:58.951000', 90, 'NC-17', 2006, 6, '2.99', '25.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Forward Temple'), - ('A Action-Packed Story of a Frisbee And a Woman who must Reach a Girl in An Abandoned Mine Shaft', '''abandon'':21 ''action'':5 ''action-pack'':4 ''elf'':1 ''frisbe'':10 ''girl'':18 ''mine'':22 ''murder'':2 ''must'':15 ''pack'':6 ''reach'':16 ''shaft'':23 ''stori'':7 ''woman'':13', '1', '2013-05-26T14:50:58.951000', 155, 'NC-17', 2006, 4, '4.99', '19.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Elf Murder'), - ('A Intrepid Display of a Madman And a Feminist who must Pursue a Pioneer in The First Manned Space Station', '''display'':5 ''feminist'':11 ''first'':19 ''grinch'':1 ''intrepid'':4 ''madman'':8 ''man'':20 ''massag'':2 ''must'':13 ''pioneer'':16 ''pursu'':14 ''space'':21 ''station'':22', '1', '2013-05-26T14:50:58.951000', 150, 'R', 2006, 7, '4.99', '25.99', ARRAY['Trailers']::text[], 'Grinch Massage'), - ('A Fanciful Character Study of a Monkey And a Explorer who must Build a Astronaut in An Abandoned Fun House', '''abandon'':20 ''astronaut'':17 ''build'':15 ''candl'':1 ''charact'':5 ''explor'':12 ''fanci'':4 ''fun'':21 ''grape'':2 ''hous'':22 ''monkey'':9 ''must'':14 ''studi'':6', '1', '2013-05-26T14:50:58.951000', 135, 'NC-17', 2006, 6, '4.99', '15.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Candles Grapes'), - ('A Taut Reflection of a A Shark And a Dentist who must Battle a Boat in Soviet Georgia', '''battl'':15 ''boat'':17 ''dentist'':12 ''georgia'':20 ''hellfight'':1 ''must'':14 ''reflect'':5 ''shark'':9 ''sierra'':2 ''soviet'':19 ''taut'':4', '1', '2013-05-26T14:50:58.951000', 75, 'PG', 2006, 3, '2.99', '23.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Hellfighters Sierra'), - ('A Epic Drama of a Feminist And a Pioneer who must Sink a Composer in New Orleans', '''compos'':16 ''drama'':5 ''epic'':4 ''feminist'':8 ''fool'':2 ''moonwalk'':1 ''must'':13 ''new'':18 ''orlean'':19 ''pioneer'':11 ''sink'':14', '1', '2013-05-26T14:50:58.951000', 184, 'G', 2006, 5, '4.99', '12.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Moonwalker Fool'), - ('A Beautiful Drama of a Student And a Secret Agent who must Confront a Dentist in Ancient Japan', '''agent'':12 ''ancient'':19 ''beauti'':4 ''confront'':15 ''dentist'':17 ''drama'':5 ''fatal'':1 ''haunt'':2 ''japan'':20 ''must'':14 ''secret'':11 ''student'':8', '1', '2013-05-26T14:50:58.951000', 91, 'PG', 2006, 6, '2.99', '24.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Fatal Haunted'), - ('A Fanciful Drama of a Moose And a Squirrel who must Conquer a Pioneer in The Canadian Rockies', '''bull'':1 ''canadian'':19 ''conquer'':14 ''drama'':5 ''fanci'':4 ''moos'':8 ''must'':13 ''pioneer'':16 ''rocki'':20 ''shawshank'':2 ''squirrel'':11', '1', '2013-05-26T14:50:58.951000', 125, 'NC-17', 2006, 6, '0.99', '21.99', ARRAY['Deleted Scenes']::text[], 'Bull Shawshank'), - ('A Emotional Character Study of a Boat And a Pioneer who must Find a Explorer in A Shark Tank', '''betray'':1 ''boat'':9 ''charact'':5 ''emot'':4 ''explor'':17 ''find'':15 ''must'':14 ''pioneer'':12 ''rear'':2 ''shark'':20 ''studi'':6 ''tank'':21', '1', '2013-05-26T14:50:58.951000', 122, 'NC-17', 2006, 5, '4.99', '26.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Betrayed Rear'), - ('A Insightful Drama of a Car And a Composer who must Fight a Man in A Monastery', '''car'':8 ''compos'':11 ''drama'':5 ''fight'':14 ''idol'':1 ''insight'':4 ''man'':16 ''monasteri'':19 ''must'':13 ''snatcher'':2', '1', '2013-05-26T14:50:58.951000', 84, 'NC-17', 2006, 5, '2.99', '29.99', ARRAY['Trailers']::text[], 'Idols Snatchers'), - ('A Insightful Character Study of a Girl And a Car who must Pursue a Mad Cow in A Shark Tank', '''car'':12 ''charact'':5 ''cow'':18 ''girl'':9 ''insight'':4 ''mad'':17 ''must'':14 ''oper'':2 ''pursu'':15 ''shark'':21 ''star'':1 ''studi'':6 ''tank'':22', '1', '2013-05-26T14:50:58.951000', 181, 'PG', 2006, 5, '2.99', '9.99', ARRAY['Commentaries']::text[], 'Star Operation'), - ('A Boring Tale of a Composer And a Mad Cow who must Defeat a Car in The Outback', '''bore'':4 ''car'':17 ''compos'':8 ''cow'':12 ''defeat'':15 ''ident'':1 ''lover'':2 ''mad'':11 ''must'':14 ''outback'':20 ''tale'':5', '1', '2013-05-26T14:50:58.951000', 119, 'PG-13', 2006, 4, '2.99', '12.99', ARRAY['Deleted Scenes']::text[], 'Identity Lover'), - ('A Epic Character Study of a Feminist And a Student who must Meet a Woman in A Baloon', '''baloon'':20 ''charact'':5 ''epic'':4 ''feminist'':9 ''jingl'':1 ''meet'':15 ''must'':14 ''sagebrush'':2 ''student'':12 ''studi'':6 ''woman'':17', '1', '2013-05-26T14:50:58.951000', 124, 'PG-13', 2006, 6, '4.99', '29.99', ARRAY['Trailers', 'Commentaries']::text[], 'Jingle Sagebrush'), - ('A Touching Saga of a Hunter And a Butler who must Discover a Butler in A Jet Boat', '''airplan'':1 ''boat'':20 ''butler'':11,16 ''discov'':14 ''hunter'':8 ''jet'':19 ''must'':13 ''saga'':5 ''sierra'':2 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 62, 'PG-13', 2006, 6, '4.99', '28.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Airplane Sierra'), - ('A Insightful Saga of a Astronaut And a Explorer who must Pursue a Mad Scientist in A U-Boat', '''astronaut'':8 ''boat'':22 ''explor'':11 ''hunger'':2 ''insight'':4 ''mad'':16 ''must'':13 ''pursu'':14 ''saga'':5 ''scientist'':17 ''tie'':1 ''u'':21 ''u-boat'':20', '1', '2013-05-26T14:50:58.951000', 111, 'R', 2006, 3, '4.99', '28.99', ARRAY['Deleted Scenes']::text[], 'Ties Hunger'), - ('A Thrilling Tale of a Technical Writer And a Boy who must Face a Pioneer in A Monastery', '''boy'':12 ''face'':15 ''hotel'':2 ''independ'':1 ''monasteri'':20 ''must'':14 ''pioneer'':17 ''tale'':5 ''technic'':8 ''thrill'':4 ''writer'':9', '1', '2013-05-26T14:50:58.951000', 157, 'NC-17', 2006, 5, '0.99', '21.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Independence Hotel'), - ('A Fast-Paced Tale of a Car And a Dog who must Outgun a A Shark in Australia', '''australia'':21 ''car'':10 ''dog'':13 ''fast'':5 ''fast-pac'':4 ''must'':15 ''outgun'':16 ''pace'':6 ''shark'':19 ''stallion'':1 ''sundanc'':2 ''tale'':7', '1', '2013-05-26T14:50:58.951000', 130, 'PG-13', 2006, 5, '0.99', '23.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Stallion Sundance'), - ('A Thoughtful Epistle of a Madman And a Astronaut who must Overcome a Monkey in A Shark Tank', '''astronaut'':11 ''epistl'':5 ''hellfight'':2 ''madman'':8 ''monkey'':16 ''must'':13 ''overcom'':14 ''shark'':19 ''tank'':20 ''thought'':4 ''tomato'':1', '1', '2013-05-26T14:50:58.951000', 68, 'PG', 2006, 6, '0.99', '23.99', ARRAY['Behind the Scenes']::text[], 'Tomatoes Hellfighters'), - ('A Boring Epistle of a Boat And a Database Administrator who must Kill a Sumo Wrestler in The First Manned Space Station', '''administr'':12 ''boat'':8 ''bore'':4 ''chitti'':1 ''databas'':11 ''epistl'':5 ''first'':21 ''kill'':15 ''lock'':2 ''man'':22 ''must'':14 ''space'':23 ''station'':24 ''sumo'':17 ''wrestler'':18', '1', '2013-05-26T14:50:58.951000', 107, 'G', 2006, 6, '2.99', '24.99', ARRAY['Commentaries']::text[], 'Chitty Lock'), - ('A Insightful Story of a Man And a Feminist who must Fight a Composer in Australia', '''australia'':18 ''cincinatti'':2 ''compos'':16 ''feminist'':11 ''fight'':14 ''insight'':4 ''lamb'':1 ''man'':8 ''must'':13 ''stori'':5', '1', '2013-05-26T14:50:58.951000', 144, 'PG-13', 2006, 6, '4.99', '18.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Lambs Cincinatti'), - ('A Brilliant Documentary of a Womanizer And a Squirrel who must Find a Technical Writer in The Sahara Desert', '''ace'':2 ''brilliant'':4 ''desert'':21 ''documentari'':5 ''find'':14 ''million'':1 ''must'':13 ''sahara'':20 ''squirrel'':11 ''technic'':16 ''woman'':8 ''writer'':17', '1', '2013-05-26T14:50:58.951000', 142, 'PG-13', 2006, 4, '4.99', '16.99', ARRAY['Deleted Scenes']::text[], 'Million Ace'), - ('A Intrepid Character Study of a Moose And a Waitress who must Find a A Shark in Ancient India', '''ancient'':20 ''charact'':5 ''find'':15 ''india'':21 ''intrepid'':4 ''labyrinth'':2 ''moos'':9 ''must'':14 ''newton'':1 ''shark'':18 ''studi'':6 ''waitress'':12', '1', '2013-05-26T14:50:58.951000', 75, 'PG', 2006, 4, '0.99', '9.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Newton Labyrinth'), - ('A Thoughtful Story of a Mad Scientist And a Waitress who must Confront a Forensic Psychologist in Soviet Georgia', '''confront'':15 ''forens'':17 ''georgia'':21 ''joon'':2 ''mad'':8 ''must'':14 ''psychologist'':18 ''robber'':1 ''scientist'':9 ''soviet'':20 ''stori'':5 ''thought'':4 ''waitress'':12', '1', '2013-05-26T14:50:58.951000', 102, 'PG-13', 2006, 7, '2.99', '26.99', ARRAY['Commentaries']::text[], 'Robbers Joon'), - ('A Boring Reflection of a Dentist And a Mad Cow who must Chase a Secret Agent in A Shark Tank', '''agent'':18 ''bore'':4 ''chase'':15 ''cow'':12 ''curtain'':1 ''dentist'':8 ''mad'':11 ''must'':14 ''reflect'':5 ''secret'':17 ''shark'':21 ''tank'':22 ''videotap'':2', '1', '2013-05-26T14:50:58.951000', 133, 'PG-13', 2006, 7, '0.99', '27.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Curtain Videotape'), - ('A Intrepid Character Study of a Robot And a Monkey who must Reach a Secret Agent in An Abandoned Amusement Park', '''abandon'':21 ''agent'':18 ''amus'':22 ''charact'':5 ''intrepid'':4 ''luke'':2 ''monkey'':12 ''must'':14 ''park'':23 ''reach'':15 ''robot'':9 ''secret'':17 ''sling'':1 ''studi'':6', '1', '2013-05-26T14:50:58.951000', 84, 'R', 2006, 5, '0.99', '10.99', ARRAY['Behind the Scenes']::text[], 'Sling Luke'), - ('A Intrepid Story of a Madman And a Secret Agent who must Outrace a Astronaut in An Abandoned Amusement Park', '''abandon'':20 ''agent'':12 ''amus'':21 ''astronaut'':17 ''egypt'':1 ''intrepid'':4 ''madman'':8 ''must'':14 ''outrac'':15 ''park'':22 ''secret'':11 ''stori'':5 ''tenenbaum'':2', '1', '2013-05-26T14:50:58.951000', 85, 'PG', 2006, 3, '0.99', '11.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Egypt Tenenbaums'), - ('A Astounding Reflection of a Lumberjack And a Car who must Sink a Lumberjack in A Baloon Factory', '''adapt'':1 ''astound'':4 ''baloon'':19 ''car'':11 ''factori'':20 ''hole'':2 ''lumberjack'':8,16 ''must'':13 ''reflect'':5 ''sink'':14', '1', '2013-05-26T14:50:58.951000', 50, 'NC-17', 2006, 7, '2.99', '18.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Adaptation Holes'), - ('A Boring Drama of a Student And a Cat who must Sink a Technical Writer in A Baloon', '''baloon'':20 ''bore'':4 ''cat'':11 ''drama'':5 ''liberti'':1 ''magnific'':2 ''must'':13 ''sink'':14 ''student'':8 ''technic'':16 ''writer'':17', '1', '2013-05-26T14:50:58.951000', 138, 'G', 2006, 3, '2.99', '27.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Liberty Magnificent'), - ('A Intrepid Yarn of a Explorer And a Pastry Chef who must Pursue a Mad Cow in A U-Boat', '''boat'':23 ''chef'':12 ''cow'':18 ''explor'':8 ''intrepid'':4 ''mad'':17 ''must'':14 ''pastri'':11 ''pursu'':15 ''suicid'':2 ''u'':22 ''u-boat'':21 ''uncut'':1 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 172, 'PG-13', 2006, 7, '2.99', '29.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Uncut Suicides'), - ('A Fateful Saga of a Womanizer And a Student who must Defeat a Butler in A Monastery', '''butler'':16 ''defeat'':14 ''fate'':4 ''inch'':1 ''jet'':2 ''monasteri'':19 ''must'':13 ''saga'':5 ''student'':11 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 167, 'NC-17', 2006, 6, '4.99', '18.99', ARRAY['Deleted Scenes']::text[], 'Inch Jet'), - ('A Emotional Epistle of a Squirrel And a Robot who must Confront a Lumberjack in Soviet Georgia', '''confront'':14 ''emot'':4 ''epistl'':5 ''georgia'':19 ''lumberjack'':16 ''must'':13 ''patient'':1 ''robot'':11 ''sister'':2 ''soviet'':18 ''squirrel'':8', '1', '2013-05-26T14:50:58.951000', 99, 'NC-17', 2006, 7, '0.99', '29.99', ARRAY['Trailers', 'Commentaries']::text[], 'Patient Sister'), - ('A Awe-Inspiring Drama of a Girl And a Technical Writer who must Meet a Feminist in The Canadian Rockies', '''awe'':5 ''awe-inspir'':4 ''canadian'':22 ''drama'':7 ''feminist'':19 ''girl'':10 ''inspir'':6 ''meet'':17 ''must'':16 ''rocki'':23 ''scissorhand'':1 ''slum'':2 ''technic'':13 ''writer'':14', '1', '2013-05-26T14:50:58.951000', 147, 'G', 2006, 5, '2.99', '13.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Scissorhands Slums') - ) AS data(description, fulltext, old_language_id, last_update, length, rating, release_year, rental_duration, rental_rate, replacement_cost, special_features, title) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."language"' - AND map0.old_id = data.old_language_id - RETURNING film_id - ) - SELECT array_agg(film_id) INTO v_new_ids_film FROM inserted; - - FOR i IN 1..array_length(v_new_ids_film, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."film"', v_old_ids_film[i], v_new_ids_film[i]::TEXT); - END LOOP; - - v_old_ids_film := ARRAY['651', '296', '142', '890', '727', '98', '668', '492', '322', '86', '832', '291', '796', '563', '242', '658', '199', '797', '787', '139', '976', '619', '118', '940', '363', '549', '868', '878', '677', '16', '427', '912', '551', '869', '621', '516', '243', '2', '364', '47', '347', '644', '131', '52', '167', '254', '733', '590', '690', '360', '293', '333', '730', '257', '134', '215', '571', '461', '820', '892', '641', '326', '610', '687', '402', '961', '471', '962', '981', '358', '61', '624', '413', '645', '380', '823', '768', '888', '504', '824', '431', '757', '669', '251', '810', '523', '686', '753', '830', '637', '763', '470', '8', '463', '63', '87', '141', '512', '586', '462']; - WITH inserted AS ( - INSERT INTO "public"."film" ("description", "fulltext", "language_id", "last_update", "length", "rating", "release_year", "rental_duration", "rental_rate", "replacement_cost", "special_features", "title") - SELECT - data.description::text, - data.fulltext::tsvector, - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.length::smallint, - data.rating::mpaa_rating, - data.release_year::integer, - data.rental_duration::smallint, - data.rental_rate::numeric, - data.replacement_cost::numeric, - data.special_features::text[], - data.title::character varying - FROM (VALUES - ('A Epic Display of a Sumo Wrestler And a Forensic Psychologist who must Build a Woman in An Abandoned Amusement Park', '''abandon'':21 ''amus'':22 ''build'':16 ''display'':5 ''epic'':4 ''forens'':12 ''madigan'':2 ''must'':15 ''packer'':1 ''park'':23 ''psychologist'':13 ''sumo'':8 ''woman'':18 ''wrestler'':9', '1', '2013-05-26T14:50:58.951000', 84, 'PG-13', 2006, 3, '0.99', '20.99', ARRAY['Trailers']::text[], 'Packer Madigan'), - ('A Boring Drama of a Astronaut And a Boat who must Face a Boat in California', '''astronaut'':8 ''boat'':11,16 ''bore'':4 ''california'':18 ''drama'':5 ''express'':1 ''face'':14 ''lone'':2 ''must'':13', '1', '2013-05-26T14:50:58.951000', 178, 'R', 2006, 5, '2.99', '23.99', ARRAY['Trailers']::text[], 'Express Lonely'), - ('A Emotional Drama of a Dog And a Explorer who must Outrace a Technical Writer in Australia', '''australia'':19 ''chicken'':1 ''dog'':8 ''drama'':5 ''emot'':4 ''explor'':11 ''hellfight'':2 ''must'':13 ''outrac'':14 ''technic'':16 ''writer'':17', '1', '2013-05-26T14:50:58.951000', 122, 'PG', 2006, 3, '0.99', '24.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Chicken Hellfighters'), - ('A Thrilling Epistle of a Boat And a Secret Agent who must Face a Boy in A Baloon', '''agent'':12 ''baloon'':20 ''boat'':8 ''boy'':17 ''dawn'':2 ''epistl'':5 ''face'':15 ''must'':14 ''secret'':11 ''thrill'':4 ''tight'':1', '1', '2013-05-26T14:50:58.951000', 172, 'R', 2006, 5, '0.99', '14.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Tights Dawn'), - ('A Epic Yarn of a Robot And a Explorer who must Challenge a Girl in A MySQL Convention', '''challeng'':14 ''convent'':20 ''epic'':4 ''explor'':11 ''girl'':16 ''must'':13 ''mysql'':19 ''resurrect'':1 ''robot'':8 ''silverado'':2 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 117, 'PG', 2006, 6, '0.99', '12.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Resurrection Silverado'), - ('A Fateful Yarn of a Lumberjack And a Feminist who must Conquer a Student in A Jet Boat', '''boat'':20 ''bright'':1 ''conquer'':14 ''encount'':2 ''fate'':4 ''feminist'':11 ''jet'':19 ''lumberjack'':8 ''must'':13 ''student'':16 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 73, 'PG-13', 2006, 4, '4.99', '12.99', ARRAY['Trailers']::text[], 'Bright Encounters'), - ('A Insightful Reflection of a Boat And a Secret Agent who must Vanquish a Astronaut in An Abandoned Mine Shaft', '''abandon'':20 ''agent'':12 ''astronaut'':17 ''boat'':8 ''forev'':2 ''insight'':4 ''mine'':21 ''must'':14 ''peak'':1 ''reflect'':5 ''secret'':11 ''shaft'':22 ''vanquish'':15', '1', '2013-05-26T14:50:58.951000', 80, 'PG', 2006, 7, '4.99', '25.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Peak Forever'), - ('A Boring Character Study of a Boy And a Woman who must Battle a Astronaut in Australia', '''astronaut'':17 ''australia'':19 ''battl'':15 ''bore'':4 ''boy'':9 ''charact'':5 ''closer'':2 ''jungl'':1 ''must'':14 ''studi'':6 ''woman'':12', '1', '2013-05-26T14:50:58.951000', 134, 'NC-17', 2006, 6, '0.99', '11.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Jungle Closer'), - ('A Taut Display of a Secret Agent And a Waitress who must Sink a Robot in An Abandoned Mine Shaft', '''abandon'':20 ''agent'':9 ''display'':5 ''flatlin'':1 ''killer'':2 ''mine'':21 ''must'':14 ''robot'':17 ''secret'':8 ''shaft'':22 ''sink'':15 ''taut'':4 ''waitress'':12', '1', '2013-05-26T14:50:58.951000', 100, 'G', 2006, 5, '2.99', '29.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Flatliners Killer'), - ('A Lacklusture Character Study of a Husband And a Sumo Wrestler who must Succumb a Technical Writer in The Gulf of Mexico', '''ameli'':2 ''boogi'':1 ''charact'':5 ''gulf'':22 ''husband'':9 ''lacklustur'':4 ''mexico'':24 ''must'':15 ''studi'':6 ''succumb'':16 ''sumo'':12 ''technic'':18 ''wrestler'':13 ''writer'':19', '1', '2013-05-26T14:50:58.951000', 121, 'R', 2006, 6, '4.99', '11.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Boogie Amelie'), - ('A Taut Saga of a Crocodile And a Boat who must Conquer a Hunter in A Shark Tank', '''boat'':11 ''conquer'':14 ''crocodil'':8 ''gump'':2 ''hunter'':16 ''must'':13 ''saga'':5 ''shark'':19 ''splash'':1 ''tank'':20 ''taut'':4', '1', '2013-05-26T14:50:58.951000', 175, 'PG', 2006, 5, '0.99', '16.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Splash Gump'), - ('A Fanciful Character Study of a Feminist And a Madman who must Find a Explorer in A Baloon Factory', '''alter'':2 ''baloon'':20 ''charact'':5 ''evolut'':1 ''explor'':17 ''factori'':21 ''fanci'':4 ''feminist'':9 ''find'':15 ''madman'':12 ''must'':14 ''studi'':6', '1', '2013-05-26T14:50:58.951000', 174, 'PG-13', 2006, 5, '0.99', '10.99', ARRAY['Behind the Scenes']::text[], 'Evolution Alter'), - ('A Emotional Character Study of a Frisbee And a Mad Scientist who must Build a Madman in California', '''build'':16 ''california'':20 ''charact'':5 ''divid'':2 ''emot'':4 ''frisbe'':9 ''mad'':12 ''madman'':18 ''must'':15 ''scientist'':13 ''sierra'':1 ''studi'':6', '1', '2013-05-26T14:50:58.951000', 135, 'NC-17', 2006, 3, '0.99', '12.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Sierra Divide'), - ('A Fateful Reflection of a Waitress And a Crocodile who must Challenge a Forensic Psychologist in California', '''california'':19 ''challeng'':14 ''crocodil'':11 ''fate'':4 ''forens'':16 ''massacr'':1 ''must'':13 ''psychologist'':17 ''reflect'':5 ''usual'':2 ''waitress'':8', '1', '2013-05-26T14:50:58.951000', 165, 'R', 2006, 6, '4.99', '16.99', ARRAY['Commentaries']::text[], 'Massacre Usual'), - ('A Astounding Panorama of a Car And a Mad Scientist who must Battle a Lumberjack in A MySQL Convention', '''astound'':4 ''battl'':15 ''car'':8 ''convent'':21 ''danc'':2 ''doom'':1 ''lumberjack'':17 ''mad'':11 ''must'':14 ''mysql'':20 ''panorama'':5 ''scientist'':12', '1', '2013-05-26T14:50:58.951000', 68, 'R', 2006, 4, '0.99', '13.99', ARRAY['Trailers', 'Commentaries']::text[], 'Doom Dancing'), - ('A Intrepid Story of a Squirrel And a Crocodile who must Defeat a Monkey in The Outback', '''crocodil'':11 ''defeat'':14 ''intrepid'':4 ''monkey'':16 ''must'':13 ''outback'':19 ''pari'':1 ''squirrel'':8 ''stori'':5 ''weekend'':2', '1', '2013-05-26T14:50:58.951000', 121, 'PG-13', 2006, 7, '2.99', '19.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Paris Weekend'), - ('A Emotional Reflection of a Frisbee And a Boat who must Reach a Pastry Chef in An Abandoned Amusement Park', '''abandon'':20 ''amus'':21 ''boat'':11 ''chef'':17 ''cupboard'':1 ''emot'':4 ''frisbe'':8 ''must'':13 ''park'':22 ''pastri'':16 ''reach'':14 ''reflect'':5 ''sinner'':2', '1', '2013-05-26T14:50:58.951000', 56, 'R', 2006, 4, '2.99', '29.99', ARRAY['Behind the Scenes']::text[], 'Cupboard Sinners'), - ('A Emotional Drama of a Sumo Wrestler And a Dentist who must Confront a Sumo Wrestler in A Baloon', '''baloon'':21 ''confront'':15 ''dentist'':12 ''drama'':5 ''emot'':4 ''kane'':2 ''must'':14 ''silenc'':1 ''sumo'':8,17 ''wrestler'':9,18', '1', '2013-05-26T14:50:58.951000', 67, 'R', 2006, 7, '0.99', '23.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Silence Kane'), - ('A Awe-Inspiring Character Study of a Astronaut And a Forensic Psychologist who must Challenge a Madman in Ancient India', '''ancient'':22 ''astronaut'':11 ''awe'':5 ''awe-inspir'':4 ''challeng'':18 ''charact'':7 ''forens'':14 ''india'':23 ''inspir'':6 ''madman'':20 ''must'':17 ''psychologist'':15 ''rose'':2 ''shine'':1 ''studi'':8', '1', '2013-05-26T14:50:58.951000', 125, 'G', 2006, 4, '0.99', '12.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Shining Roses'), - ('A Astounding Saga of a Technical Writer And a Butler who must Battle a Butler in A Shark Tank', '''astound'':4 ''battl'':15 ''butler'':12,17 ''chase'':1 ''fight'':2 ''must'':14 ''saga'':5 ''shark'':20 ''tank'':21 ''technic'':8 ''writer'':9', '1', '2013-05-26T14:50:58.951000', 114, 'PG', 2006, 7, '4.99', '21.99', ARRAY['Trailers', 'Commentaries']::text[], 'Chasing Fight'), - ('A Touching Saga of a Madman And a Forensic Psychologist who must Build a Sumo Wrestler in An Abandoned Mine Shaft', '''abandon'':21 ''build'':15 ''forens'':11 ''madman'':8 ''mine'':22 ''must'':14 ''phantom'':2 ''psychologist'':12 ''saga'':5 ''shaft'':23 ''sumo'':17 ''touch'':4 ''wind'':1 ''wrestler'':18', '1', '2013-05-26T14:50:58.951000', 111, 'R', 2006, 6, '0.99', '12.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Wind Phantom'), - ('A Fanciful Reflection of a Crocodile And a Astronaut who must Outrace a Feminist in An Abandoned Amusement Park', '''abandon'':19 ''amus'':20 ''astronaut'':11 ''charad'':2 ''crocodil'':8 ''fanci'':4 ''feminist'':16 ''must'':13 ''neighbor'':1 ''outrac'':14 ''park'':21 ''reflect'':5', '1', '2013-05-26T14:50:58.951000', 161, 'R', 2006, 3, '0.99', '20.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Neighbors Charade'), - ('A Thoughtful Reflection of a Waitress And a Feminist who must Escape a Squirrel in A Manhattan Penthouse', '''canyon'':1 ''escap'':14 ''feminist'':11 ''manhattan'':19 ''must'':13 ''penthous'':20 ''reflect'':5 ''squirrel'':16 ''stock'':2 ''thought'':4 ''waitress'':8', '1', '2013-05-26T14:50:58.951000', 85, 'R', 2006, 7, '0.99', '26.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Canyon Stock'), - ('A Insightful Epistle of a Mad Scientist And a Explorer who must Challenge a Cat in The Sahara Desert', '''academi'':2 ''cat'':17 ''challeng'':15 ''desert'':21 ''epistl'':5 ''explor'':12 ''insight'':4 ''mad'':8 ''must'':14 ''sahara'':20 ''scientist'':9 ''victori'':1', '1', '2013-05-26T14:50:58.951000', 64, 'PG-13', 2006, 6, '0.99', '19.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Victory Academy'), - ('A Fast-Paced Display of a Car And a Database Administrator who must Battle a Woman in A Baloon', '''administr'':14 ''baloon'':22 ''battl'':17 ''car'':10 ''databas'':13 ''display'':7 ''fast'':5 ''fast-pac'':4 ''go'':1 ''must'':16 ''pace'':6 ''purpl'':2 ''woman'':19', '1', '2013-05-26T14:50:58.951000', 54, 'R', 2006, 3, '0.99', '12.99', ARRAY['Trailers']::text[], 'Go Purple'), - ('A Thoughtful Documentary of a Composer And a Explorer who must Conquer a Dentist in New Orleans', '''compos'':8 ''conquer'':14 ''dentist'':16 ''documentari'':5 ''explor'':11 ''forrest'':2 ''magnolia'':1 ''must'':13 ''new'':18 ''orlean'':19 ''thought'':4', '1', '2013-05-26T14:50:58.951000', 171, 'PG-13', 2006, 4, '0.99', '28.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Magnolia Forrester'), - ('A Beautiful Saga of a Lumberjack And a Teacher who must Build a Technical Writer in An Abandoned Fun House', '''abandon'':20 ''beauti'':4 ''build'':14 ''fun'':21 ''hous'':22 ''lumberjack'':8 ''must'':13 ''saga'':5 ''superfli'':1 ''teacher'':11 ''technic'':16 ''trip'':2 ''writer'':17', '1', '2013-05-26T14:50:58.951000', 114, 'PG', 2006, 5, '0.99', '27.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Superfly Trip'), - ('A Awe-Inspiring Drama of a Dog And a Man who must Escape a Robot in A Shark Tank', '''apollo'':2 ''awe'':5 ''awe-inspir'':4 ''dog'':10 ''drama'':7 ''escap'':16 ''inspir'':6 ''man'':13 ''must'':15 ''robot'':18 ''shark'':21 ''tank'':22 ''teen'':1', '1', '2013-05-26T14:50:58.951000', 74, 'G', 2006, 3, '4.99', '25.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Teen Apollo'), - ('A Intrepid Story of a Boy And a Technical Writer who must Pursue a Lumberjack in A Monastery', '''boy'':8 ''intrepid'':4 ''lumberjack'':17 ''monasteri'':20 ''must'':14 ''outfield'':2 ''pianist'':1 ''pursu'':15 ''stori'':5 ''technic'':11 ''writer'':12', '1', '2013-05-26T14:50:58.951000', 136, 'NC-17', 2006, 6, '0.99', '25.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Pianist Outfield'), - ('A Fast-Paced Drama of a Robot And a Composer who must Battle a Astronaut in New Orleans', '''alley'':1 ''astronaut'':18 ''battl'':16 ''compos'':13 ''drama'':7 ''evolut'':2 ''fast'':5 ''fast-pac'':4 ''must'':15 ''new'':20 ''orlean'':21 ''pace'':6 ''robot'':10', '1', '2013-05-26T14:50:58.951000', 180, 'NC-17', 2006, 6, '2.99', '23.99', ARRAY['Trailers', 'Commentaries']::text[], 'Alley Evolution'), - ('A Taut Reflection of a Astronaut And a Squirrel who must Fight a Squirrel in A Manhattan Penthouse', '''astronaut'':8 ''cider'':2 ''fight'':14 ''homeward'':1 ''manhattan'':19 ''must'':13 ''penthous'':20 ''reflect'':5 ''squirrel'':11,16 ''taut'':4', '1', '2013-05-26T14:50:58.951000', 103, 'R', 2006, 5, '0.99', '19.99', ARRAY['Trailers']::text[], 'Homeward Cider'), - ('A Astounding Panorama of a Husband And a Sumo Wrestler who must Pursue a Boat in Ancient India', '''ancient'':19 ''astound'':4 ''boat'':17 ''husband'':8 ''india'':20 ''must'':14 ''panorama'':5 ''pursu'':15 ''sumo'':11 ''tomorrow'':2 ''trojan'':1 ''wrestler'':12', '1', '2013-05-26T14:50:58.951000', 52, 'PG', 2006, 3, '2.99', '9.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Trojan Tomorrow'), - ('A Lacklusture Saga of a Moose And a Teacher who must Kill a Forensic Psychologist in A MySQL Convention', '''convent'':21 ''forens'':16 ''home'':2 ''kill'':14 ''lacklustur'':4 ''maiden'':1 ''moos'':8 ''must'':13 ''mysql'':20 ''psychologist'':17 ''saga'':5 ''teacher'':11', '1', '2013-05-26T14:50:58.951000', 138, 'PG', 2006, 3, '4.99', '9.99', ARRAY['Behind the Scenes']::text[], 'Maiden Home'), - ('A Emotional Epistle of a Pioneer And a Crocodile who must Battle a Man in A Manhattan Penthouse', '''battl'':14 ''crocodil'':11 ''emot'':4 ''epistl'':5 ''man'':16 ''manhattan'':19 ''must'':13 ''penthous'':20 ''pioneer'':8 ''quill'':2 ''suspect'':1', '1', '2013-05-26T14:50:58.951000', 47, 'PG', 2006, 4, '2.99', '22.99', ARRAY['Trailers']::text[], 'Suspects Quills'), - ('A Unbelieveable Reflection of a Butler And a Boat who must Outgun a Mad Scientist in California', '''boat'':11 ''butler'':8 ''california'':19 ''mad'':16 ''must'':13 ''network'':1 ''outgun'':14 ''peak'':2 ''reflect'':5 ''scientist'':17 ''unbeliev'':4', '1', '2013-05-26T14:50:58.951000', 75, 'PG-13', 2006, 5, '2.99', '23.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Network Peak'), - ('A Awe-Inspiring Epistle of a Pioneer And a Student who must Outgun a Crocodile in The Outback', '''awe'':5 ''awe-inspir'':4 ''crocodil'':18 ''epistl'':7 ''inspir'':6 ''jedi'':2 ''legend'':1 ''must'':15 ''outback'':21 ''outgun'':16 ''pioneer'':10 ''student'':13', '1', '2013-05-26T14:50:58.951000', 59, 'PG', 2006, 7, '0.99', '18.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Legend Jedi'), - ('A Awe-Inspiring Display of a Squirrel And a Woman who must Overcome a Boy in The Gulf of Mexico', '''awe'':5 ''awe-inspir'':4 ''boy'':18 ''display'':7 ''door'':1 ''gulf'':21 ''inspir'':6 ''mexico'':23 ''must'':15 ''overcom'':16 ''presid'':2 ''squirrel'':10 ''woman'':13', '1', '2013-05-26T14:50:58.951000', 49, 'NC-17', 2006, 3, '4.99', '22.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Doors President'), - ('A Astounding Epistle of a Database Administrator And a Explorer who must Find a Car in Ancient China', '''ace'':1 ''administr'':9 ''ancient'':19 ''astound'':4 ''car'':17 ''china'':20 ''databas'':8 ''epistl'':5 ''explor'':12 ''find'':15 ''goldfing'':2 ''must'':14', '1', '2013-05-26T14:50:58.951000', 48, 'G', 2006, 3, '4.99', '12.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Ace Goldfinger'), - ('A Stunning Saga of a Lumberjack And a Squirrel who must Chase a Car in The Outback', '''car'':16 ''chase'':14 ''diari'':2 ''godfath'':1 ''lumberjack'':8 ''must'':13 ''outback'':19 ''saga'':5 ''squirrel'':11 ''stun'':4', '1', '2013-05-26T14:50:58.951000', 73, 'NC-17', 2006, 3, '2.99', '14.99', ARRAY['Trailers']::text[], 'Godfather Diary'), - ('A Boring Character Study of a A Shark And a Girl who must Outrace a Feminist in An Abandoned Mine Shaft', '''abandon'':21 ''babi'':1 ''bore'':4 ''charact'':5 ''feminist'':18 ''girl'':13 ''hall'':2 ''mine'':22 ''must'':15 ''outrac'':16 ''shaft'':23 ''shark'':10 ''studi'':6', '1', '2013-05-26T14:50:58.951000', 153, 'NC-17', 2006, 5, '4.99', '23.99', ARRAY['Commentaries']::text[], 'Baby Hall'), - ('A Astounding Documentary of a Butler And a Explorer who must Challenge a Butler in A Monastery', '''astound'':4 ''bowfing'':2 ''butler'':8,16 ''challeng'':14 ''documentari'':5 ''explor'':11 ''game'':1 ''monasteri'':19 ''must'':13', '1', '2013-05-26T14:50:58.951000', 119, 'PG-13', 2006, 7, '4.99', '17.99', ARRAY['Behind the Scenes']::text[], 'Games Bowfinger'), - ('A Insightful Tale of a Database Administrator And a Dog who must Face a Madman in Soviet Georgia', '''administr'':9 ''databas'':8 ''dog'':12 ''face'':15 ''georgia'':20 ''gold'':2 ''insight'':4 ''madman'':17 ''must'':14 ''oscar'':1 ''soviet'':19 ''tale'':5', '1', '2013-05-26T14:50:58.951000', 115, 'PG', 2006, 7, '2.99', '29.99', ARRAY['Behind the Scenes']::text[], 'Oscar Gold'), - ('A Beautiful Character Study of a Sumo Wrestler And a Dentist who must Find a Dog in California', '''beauti'':4 ''california'':20 ''center'':1 ''charact'':5 ''dentist'':13 ''dinosaur'':2 ''dog'':18 ''find'':16 ''must'':15 ''studi'':6 ''sumo'':9 ''wrestler'':10', '1', '2013-05-26T14:50:58.951000', 152, 'PG', 2006, 5, '4.99', '12.99', ARRAY['Deleted Scenes']::text[], 'Center Dinosaur'), - ('A Thrilling Documentary of a Composer And a Monkey who must Find a Feminist in California', '''ballroom'':1 ''california'':18 ''compos'':8 ''documentari'':5 ''feminist'':16 ''find'':14 ''mockingbird'':2 ''monkey'':11 ''must'':13 ''thrill'':4', '1', '2013-05-26T14:50:58.951000', 173, 'G', 2006, 6, '0.99', '29.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Ballroom Mockingbird'), - ('A Awe-Inspiring Drama of a Boy And a Frisbee who must Escape a Pastry Chef in California', '''awe'':5 ''awe-inspir'':4 ''boy'':10 ''california'':21 ''chef'':19 ''coma'':1 ''drama'':7 ''escap'':16 ''frisbe'':13 ''head'':2 ''inspir'':6 ''must'':15 ''pastri'':18', '1', '2013-05-26T14:50:58.951000', 109, 'NC-17', 2006, 6, '4.99', '10.99', ARRAY['Commentaries']::text[], 'Coma Head'), - ('A Lacklusture Character Study of a Butler And a Car who must Redeem a Boat in An Abandoned Fun House', '''abandon'':20 ''anni'':2 ''boat'':17 ''butler'':9 ''car'':12 ''charact'':5 ''driver'':1 ''fun'':21 ''hous'':22 ''lacklustur'':4 ''must'':14 ''redeem'':15 ''studi'':6', '1', '2013-05-26T14:50:58.951000', 159, 'PG-13', 2006, 4, '2.99', '11.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Driver Annie'), - ('A Thrilling Character Study of a Squirrel And a Lumberjack who must Face a Hunter in A MySQL Convention', '''charact'':5 ''convent'':21 ''face'':15 ''hunter'':17 ''lumberjack'':12 ''must'':14 ''mysql'':20 ''outlaw'':2 ''river'':1 ''squirrel'':9 ''studi'':6 ''thrill'':4', '1', '2013-05-26T14:50:58.951000', 149, 'PG-13', 2006, 4, '0.99', '29.99', ARRAY['Commentaries']::text[], 'River Outlaw'), - ('A Touching Tale of a Explorer And a Boat who must Defeat a Robot in Australia', '''australia'':18 ''boat'':11 ''defeat'':14 ''explor'':8 ''harold'':2 ''money'':1 ''must'':13 ''robot'':16 ''tale'':5 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 135, 'PG', 2006, 3, '2.99', '17.99', ARRAY['Trailers', 'Commentaries']::text[], 'Money Harold'), - ('A Stunning Drama of a Teacher And a Boat who must Battle a Feminist in Ancient China', '''ancient'':18 ''battl'':14 ''boat'':11 ''china'':19 ''drama'':5 ''feminist'':16 ''must'':13 ''pond'':1 ''seattl'':2 ''stun'':4 ''teacher'':8', '1', '2013-05-26T14:50:58.951000', 185, 'PG-13', 2006, 7, '2.99', '25.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Pond Seattle'), - ('A Astounding Drama of a Frisbee And a Astronaut who must Fight a Dog in Ancient Japan', '''ancient'':18 ''astound'':4 ''astronaut'':11 ''die'':2 ''dog'':16 ''drama'':5 ''fight'':14 ''frisbe'':8 ''glass'':1 ''japan'':19 ''must'':13', '1', '2013-05-26T14:50:58.951000', 103, 'G', 2006, 4, '0.99', '24.99', ARRAY['Trailers']::text[], 'Glass Dying'), - ('A Touching Drama of a Dog And a Sumo Wrestler who must Conquer a Mad Scientist in Berlin', '''berlin'':20 ''conquer'':15 ''dog'':8 ''drama'':5 ''exorcist'':1 ''mad'':17 ''must'':14 ''scientist'':18 ''sting'':2 ''sumo'':11 ''touch'':4 ''wrestler'':12', '1', '2013-05-26T14:50:58.951000', 167, 'G', 2006, 6, '2.99', '17.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Exorcist Sting'), - ('A Fast-Paced Documentary of a Pastry Chef And a Crocodile who must Chase a Squirrel in The Gulf of Mexico', '''chase'':17 ''chef'':11 ''crocodil'':14 ''documentari'':7 ''fast'':5 ''fast-pac'':4 ''freaki'':1 ''gulf'':22 ''mexico'':24 ''must'':16 ''pace'':6 ''pastri'':10 ''pocus'':2 ''squirrel'':19', '1', '2013-05-26T14:50:58.951000', 126, 'R', 2006, 7, '2.99', '16.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Freaky Pocus'), - ('A Unbelieveable Drama of a Waitress And a Composer who must Sink a Mad Cow in Ancient Japan', '''ancient'':19 ''compos'':11 ''cow'':17 ''drama'':5 ''japan'':20 ''mad'':16 ''must'':13 ''ridgemont'':1 ''sink'':14 ''submarin'':2 ''unbeliev'':4 ''waitress'':8', '1', '2013-05-26T14:50:58.951000', 46, 'PG-13', 2006, 3, '0.99', '28.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Ridgemont Submarine'), - ('A Insightful Panorama of a Monkey And a Sumo Wrestler who must Outrace a Mad Scientist in The Canadian Rockies', '''canadian'':21 ''cyclon'':2 ''drumlin'':1 ''insight'':4 ''mad'':17 ''monkey'':8 ''must'':14 ''outrac'':15 ''panorama'':5 ''rocki'':22 ''scientist'':18 ''sumo'':11 ''wrestler'':12', '1', '2013-05-26T14:50:58.951000', 110, 'G', 2006, 3, '0.99', '14.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Drumline Cyclone'), - ('A Amazing Story of a Mad Cow And a Dog who must Kill a Husband in A Monastery', '''amaz'':4 ''champion'':1 ''cow'':9 ''dog'':12 ''flatlin'':2 ''husband'':17 ''kill'':15 ''mad'':8 ''monasteri'':20 ''must'':14 ''stori'':5', '1', '2013-05-26T14:50:58.951000', 51, 'PG', 2006, 4, '4.99', '21.99', ARRAY['Trailers']::text[], 'Champion Flatliners'), - ('A Thoughtful Documentary of a Dentist And a Forensic Psychologist who must Defeat a Waitress in Berlin', '''berlin'':19 ''dawn'':1 ''defeat'':15 ''dentist'':8 ''documentari'':5 ''forens'':11 ''must'':14 ''pond'':2 ''psychologist'':12 ''thought'':4 ''waitress'':17', '1', '2013-05-26T14:50:58.951000', 57, 'PG', 2006, 4, '4.99', '27.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Dawn Pond'), - ('A Thrilling Display of a Lumberjack And a Crocodile who must Meet a Monkey in A Baloon Factory', '''armageddon'':2 ''baloon'':19 ''crocodil'':11 ''display'':5 ''factori'':20 ''lumberjack'':8 ''meet'':14 ''metal'':1 ''monkey'':16 ''must'':13 ''thrill'':4', '1', '2013-05-26T14:50:58.951000', 161, 'PG-13', 2006, 6, '2.99', '26.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Metal Armageddon'), - ('A Epic Display of a Butler And a Dog who must Vanquish a Crocodile in A Manhattan Penthouse', '''butler'':8 ''crocodil'':16 ''display'':5 ''dog'':11 ''epic'':4 ''insect'':1 ''manhattan'':19 ''must'':13 ''penthous'':20 ''stone'':2 ''vanquish'':14', '1', '2013-05-26T14:50:58.951000', 123, 'NC-17', 2006, 3, '0.99', '14.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Insects Stone'), - ('A Taut Character Study of a Explorer And a Mad Cow who must Battle a Hunter in Ancient China', '''ancient'':20 ''battl'':16 ''charact'':5 ''china'':21 ''cow'':13 ''explor'':9 ''hunter'':18 ''interview'':2 ''mad'':12 ''must'':15 ''son'':1 ''studi'':6 ''taut'':4', '1', '2013-05-26T14:50:58.951000', 184, 'NC-17', 2006, 3, '2.99', '11.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Sons Interview'), - ('A Brilliant Reflection of a Feminist And a Dog who must Fight a Boy in A Baloon Factory', '''baloon'':19 ''boondock'':2 ''boy'':16 ''brilliant'':4 ''dog'':11 ''factori'':20 ''feminist'':8 ''fight'':14 ''must'':13 ''reflect'':5 ''titan'':1', '1', '2013-05-26T14:50:58.951000', 104, 'R', 2006, 3, '4.99', '18.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Titanic Boondock'), - ('A Astounding Documentary of a Butler And a Womanizer who must Face a Dog in A U-Boat', '''astound'':4 ''boat'':21 ''butler'':8 ''documentari'':5 ''dog'':16 ''face'':14 ''grape'':2 ''must'':13 ''orang'':1 ''u'':20 ''u-boat'':19 ''woman'':11', '1', '2013-05-26T14:50:58.951000', 76, 'PG-13', 2006, 4, '0.99', '21.99', ARRAY['Trailers', 'Commentaries']::text[], 'Orange Grapes'), - ('A Thrilling Display of a Mad Cow And a Dog who must Challenge a Frisbee in Nigeria', '''challeng'':15 ''cow'':9 ''display'':5 ''dog'':12 ''fli'':1 ''frisbe'':17 ''hook'':2 ''mad'':8 ''must'':14 ''nigeria'':19 ''thrill'':4', '1', '2013-05-26T14:50:58.951000', 69, 'NC-17', 2006, 6, '2.99', '18.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Flying Hook'), - ('A Thrilling Tale of a Butler And a Astronaut who must Battle a Explorer in The First Manned Space Station', '''astronaut'':11 ''battl'':14 ''boondock'':2 ''butler'':8 ''explor'':16 ''first'':19 ''man'':20 ''music'':1 ''must'':13 ''space'':21 ''station'':22 ''tale'':5 ''thrill'':4', '1', '2013-05-26T14:50:58.951000', 129, 'R', 2006, 7, '0.99', '17.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Music Boondock'), - ('A Intrepid Yarn of a Frisbee And a Dog who must Build a Astronaut in A Baloon Factory', '''astronaut'':16 ''baloon'':19 ''build'':14 ''dog'':11 ''factori'':20 ''frisbe'':8 ''intrepid'':4 ''must'':13 ''pocus'':1 ''pulp'':2 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 138, 'NC-17', 2006, 6, '0.99', '15.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Pocus Pulp'), - ('A Awe-Inspiring Reflection of a Woman And a Cat who must Confront a Feminist in The Sahara Desert', '''awe'':5 ''awe-inspir'':4 ''cat'':13 ''confront'':16 ''desert'':22 ''die'':2 ''feminist'':18 ''harper'':1 ''inspir'':6 ''must'':15 ''reflect'':7 ''sahara'':21 ''woman'':10', '1', '2013-05-26T14:50:58.951000', 52, 'G', 2006, 3, '0.99', '15.99', ARRAY['Trailers']::text[], 'Harper Dying'), - ('A Awe-Inspiring Reflection of a Cat And a Pioneer who must Escape a Hunter in Ancient China', '''ancient'':20 ''awe'':5 ''awe-inspir'':4 ''cat'':10 ''china'':21 ''escap'':16 ''heaven'':2 ''hunter'':18 ''inspir'':6 ''must'':15 ''pioneer'':13 ''reflect'':7 ''wash'':1', '1', '2013-05-26T14:50:58.951000', 161, 'R', 2006, 7, '4.99', '22.99', ARRAY['Commentaries']::text[], 'Wash Heavenly'), - ('A Fanciful Panorama of a Technical Writer And a Boy who must Find a Dentist in An Abandoned Fun House', '''abandon'':20 ''boy'':12 ''dentist'':17 ''exorcist'':2 ''fanci'':4 ''find'':15 ''fun'':21 ''hous'':22 ''island'':1 ''must'':14 ''panorama'':5 ''technic'':8 ''writer'':9', '1', '2013-05-26T14:50:58.951000', 84, 'NC-17', 2006, 7, '2.99', '23.99', ARRAY['Trailers', 'Commentaries']::text[], 'Island Exorcist'), - ('A Fanciful Story of a Database Administrator And a Womanizer who must Fight a Database Administrator in Ancient China', '''administr'':9,18 ''ancient'':20 ''china'':21 ''databas'':8,17 ''divin'':2 ''fanci'':4 ''fight'':15 ''must'':14 ''stori'':5 ''wasteland'':1 ''woman'':12', '1', '2013-05-26T14:50:58.951000', 85, 'PG', 2006, 7, '2.99', '18.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Wasteland Divine'), - ('A Fast-Paced Drama of a Squirrel And a Robot who must Succumb a Technical Writer in A Manhattan Penthouse', '''desir'':2 ''drama'':7 ''fast'':5 ''fast-pac'':4 ''manhattan'':22 ''must'':15 ''pace'':6 ''penthous'':23 ''robot'':13 ''squirrel'':10 ''succumb'':16 ''technic'':18 ''wolv'':1 ''writer'':19', '1', '2013-05-26T14:50:58.951000', 55, 'NC-17', 2006, 7, '0.99', '13.99', ARRAY['Behind the Scenes']::text[], 'Wolves Desire'), - ('A Unbelieveable Documentary of a Boat And a Husband who must Succumb a Student in A U-Boat', '''boat'':8,21 ''boil'':2 ''documentari'':5 ''gilmor'':1 ''husband'':11 ''must'':13 ''student'':16 ''succumb'':14 ''u'':20 ''u-boat'':19 ''unbeliev'':4', '1', '2013-05-26T14:50:58.951000', 163, 'R', 2006, 5, '0.99', '29.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Gilmore Boiled'), - ('A Fast-Paced Display of a Composer And a Moose who must Sink a Robot in An Abandoned Mine Shaft', '''abandon'':21 ''beauti'':1 ''compos'':10 ''display'':7 ''fast'':5 ''fast-pac'':4 ''greas'':2 ''mine'':22 ''moos'':13 ''must'':15 ''pace'':6 ''robot'':18 ''shaft'':23 ''sink'':16', '1', '2013-05-26T14:50:58.951000', 175, 'G', 2006, 5, '4.99', '28.99', ARRAY['Trailers', 'Commentaries']::text[], 'Beauty Grease'), - ('A Brilliant Display of a Robot And a Butler who must Fight a Waitress in An Abandoned Mine Shaft', '''abandon'':19 ''brilliant'':4 ''butler'':11 ''chill'':2 ''display'':5 ''fight'':14 ''mine'':20 ''must'':13 ''nightmar'':1 ''robot'':8 ''shaft'':21 ''waitress'':16', '1', '2013-05-26T14:50:58.951000', 149, 'PG', 2006, 3, '4.99', '25.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Nightmare Chill'), - ('A Action-Packed Yarn of a Womanizer And a Lumberjack who must Chase a Sumo Wrestler in A Monastery', '''action'':5 ''action-pack'':4 ''alter'':2 ''chase'':16 ''hedwig'':1 ''lumberjack'':13 ''monasteri'':22 ''must'':15 ''pack'':6 ''sumo'':18 ''woman'':10 ''wrestler'':19 ''yarn'':7', '1', '2013-05-26T14:50:58.951000', 169, 'NC-17', 2006, 7, '2.99', '16.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Hedwig Alter'), - ('A Lacklusture Documentary of a Mad Cow And a Madman who must Sink a Moose in The Gulf of Mexico', '''cow'':9 ''documentari'':5 ''gulf'':20 ''lacklustur'':4 ''mad'':8 ''madman'':12 ''mexico'':22 ''moos'':17 ''must'':14 ''other'':1 ''sink'':15 ''soup'':2', '1', '2013-05-26T14:50:58.951000', 118, 'PG', 2006, 7, '2.99', '18.99', ARRAY['Deleted Scenes']::text[], 'Others Soup'), - ('A Stunning Display of a Butler And a Teacher who must Confront a A Shark in The First Manned Space Station', '''butler'':8 ''confront'':14 ''display'':5 ''everyon'':2 ''first'':20 ''greek'':1 ''man'':21 ''must'':13 ''shark'':17 ''space'':22 ''station'':23 ''stun'':4 ''teacher'':11', '1', '2013-05-26T14:50:58.951000', 176, 'PG', 2006, 7, '2.99', '11.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Greek Everyone'), - ('A Amazing Documentary of a Car And a Robot who must Escape a Lumberjack in An Abandoned Amusement Park', '''abandon'':19 ''amaz'':4 ''amus'':20 ''car'':8 ''documentari'':5 ''escap'':14 ''lumberjack'':16 ''must'':13 ''park'':21 ''robot'':11 ''south'':1 ''wait'':2', '1', '2013-05-26T14:50:58.951000', 143, 'R', 2006, 4, '2.99', '21.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'South Wait'), - ('A Emotional Yarn of a Teacher And a Girl who must Find a Teacher in A Baloon Factory', '''baloon'':19 ''bang'':2 ''emot'':4 ''factori'':20 ''find'':14 ''girl'':11 ''must'':13 ''scarfac'':1 ''teacher'':8,16 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 102, 'PG-13', 2006, 3, '4.99', '11.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Scarface Bang'), - ('A Emotional Drama of a Husband And a Lumberjack who must Build a Cat in Ancient India', '''ancient'':18 ''build'':14 ''cat'':16 ''drama'':5 ''emot'':4 ''husband'':8 ''india'':19 ''lumberjack'':11 ''must'':13 ''sagebrush'':2 ''thin'':1', '1', '2013-05-26T14:50:58.951000', 53, 'PG-13', 2006, 5, '4.99', '9.99', ARRAY['Behind the Scenes']::text[], 'Thin Sagebrush'), - ('A Amazing Drama of a Car And a Squirrel who must Pursue a Car in Soviet Georgia', '''amaz'':4 ''car'':8,16 ''drama'':5 ''georgia'':19 ''homeward'':2 ''kwai'':1 ''must'':13 ''pursu'':14 ''soviet'':18 ''squirrel'':11', '1', '2013-05-26T14:50:58.951000', 46, 'PG-13', 2006, 5, '0.99', '25.99', ARRAY['Trailers', 'Commentaries']::text[], 'Kwai Homeward'), - ('A Thrilling Panorama of a Pastry Chef And a Secret Agent who must Overcome a Student in A Manhattan Penthouse', '''agent'':13 ''cheaper'':2 ''chef'':9 ''manhattan'':21 ''must'':15 ''overcom'':16 ''panorama'':5 ''pastri'':8 ''penthous'':22 ''secret'':12 ''spartacus'':1 ''student'':18 ''thrill'':4', '1', '2013-05-26T14:50:58.951000', 52, 'NC-17', 2006, 4, '4.99', '19.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Spartacus Cheaper'), - ('A Astounding Display of a Explorer And a Boat who must Vanquish a Car in The First Manned Space Station', '''astound'':4 ''birdcag'':2 ''boat'':11 ''car'':16 ''display'':5 ''explor'':8 ''first'':19 ''hoosier'':1 ''man'':20 ''must'':13 ''space'':21 ''station'':22 ''vanquish'':14', '1', '2013-05-26T14:50:58.951000', 176, 'G', 2006, 3, '2.99', '12.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Hoosiers Birdcage'), - ('A Insightful Story of a Lumberjack And a Hunter who must Kill a Boy in Ancient Japan', '''ancient'':18 ''boy'':16 ''clueless'':2 ''hunter'':11 ''insight'':4 ''japan'':19 ''kill'':14 ''lumberjack'':8 ''must'':13 ''sagebrush'':1 ''stori'':5', '1', '2013-05-26T14:50:58.951000', 106, 'G', 2006, 4, '2.99', '28.99', ARRAY['Trailers']::text[], 'Sagebrush Clueless'), - ('A Lacklusture Yarn of a Astronaut And a Pastry Chef who must Sink a Dog in A U-Boat', '''astronaut'':8 ''boat'':22 ''chef'':12 ''destini'':2 ''dog'':17 ''lacklustur'':4 ''must'':14 ''pastri'':11 ''pearl'':1 ''sink'':15 ''u'':21 ''u-boat'':20 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 74, 'NC-17', 2006, 3, '2.99', '10.99', ARRAY['Trailers']::text[], 'Pearl Destiny'), - ('A Boring Documentary of a Pioneer And a Man who must Vanquish a Man in Nigeria', '''bore'':4 ''documentari'':5 ''dragonfli'':1 ''man'':11,16 ''must'':13 ''nigeria'':18 ''pioneer'':8 ''stranger'':2 ''vanquish'':14', '1', '2013-05-26T14:50:58.951000', 133, 'NC-17', 2006, 6, '4.99', '19.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Dragonfly Strangers'), - ('A Amazing Character Study of a Teacher And a Database Administrator who must Defeat a Waitress in A Jet Boat', '''administr'':13 ''amaz'':4 ''boat'':22 ''charact'':5 ''databas'':12 ''defeat'':16 ''duck'':2 ''jet'':21 ''must'':15 ''slum'':1 ''studi'':6 ''teacher'':9 ''waitress'':18', '1', '2013-05-26T14:50:58.951000', 147, 'PG', 2006, 5, '0.99', '21.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Slums Duck'), - ('A Unbelieveable Epistle of a Dog And a Woman who must Confront a Moose in The Gulf of Mexico', '''confront'':14 ''deer'':2 ''dog'':8 ''epistl'':5 ''gulf'':19 ''light'':1 ''mexico'':21 ''moos'':16 ''must'':13 ''unbeliev'':4 ''woman'':11', '1', '2013-05-26T14:50:58.951000', 174, 'R', 2006, 7, '0.99', '21.99', ARRAY['Commentaries']::text[], 'Lights Deer'), - ('A Action-Packed Reflection of a Car And a Moose who must Outgun a Car in A Shark Tank', '''action'':5 ''action-pack'':4 ''car'':10,18 ''moos'':13 ''must'':15 ''oleand'':2 ''outgun'':16 ''pack'':6 ''pluto'':1 ''reflect'':7 ''shark'':21 ''tank'':22', '1', '2013-05-26T14:50:58.951000', 84, 'R', 2006, 5, '4.99', '9.99', ARRAY['Behind the Scenes']::text[], 'Pluto Oleander'), - ('A Emotional Display of a Man And a Dentist who must Challenge a Squirrel in Australia', '''australia'':18 ''challeng'':14 ''dentist'':11 ''display'':5 ''emot'':4 ''goodfella'':2 ''man'':8 ''must'':13 ''rush'':1 ''squirrel'':16', '1', '2013-05-26T14:50:58.951000', 48, 'PG', 2006, 3, '0.99', '20.99', ARRAY['Deleted Scenes']::text[], 'Rush Goodfellas'), - ('A Brilliant Yarn of a Cat And a Car who must Confront a Explorer in Ancient Japan', '''ancient'':18 ''brilliant'':4 ''car'':11 ''cat'':8 ''confront'':14 ''explor'':16 ''flintston'':2 ''japan'':19 ''must'':13 ''spirit'':1 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 149, 'R', 2006, 7, '0.99', '23.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Spirit Flintstones'), - ('A Lacklusture Drama of a Secret Agent And a Explorer who must Discover a Car in A U-Boat', '''african'':2 ''agent'':9 ''boat'':22 ''car'':17 ''discov'':15 ''drama'':5 ''explor'':12 ''lacklustur'':4 ''must'':14 ''open'':1 ''secret'':8 ''u'':21 ''u-boat'':20', '1', '2013-05-26T14:50:58.951000', 131, 'PG', 2006, 7, '4.99', '16.99', ARRAY['Trailers', 'Commentaries']::text[], 'Open African'), - ('A Lacklusture Yarn of a Dentist And a Butler who must Meet a Secret Agent in Ancient China', '''agent'':17 ''ancient'':19 ''butler'':11 ''china'':20 ''confidenti'':2 ''dentist'':8 ''lacklustur'':4 ''meet'':14 ''must'':13 ''satisfact'':1 ''secret'':16 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 75, 'G', 2006, 3, '4.99', '26.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Satisfaction Confidential'), - ('A Astounding Saga of a Dog And a Squirrel who must Conquer a Dog in An Abandoned Fun House', '''abandon'':19 ''astound'':4 ''conquer'':14 ''dog'':8,16 ''fun'':20 ''hous'':21 ''ishtar'':1 ''must'':13 ''rocket'':2 ''saga'':5 ''squirrel'':11', '1', '2013-05-26T14:50:58.951000', 79, 'R', 2006, 4, '4.99', '24.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Ishtar Rocketeer'), - ('A Epic Tale of a Moose And a Girl who must Confront a Monkey in Ancient India', '''airport'':1 ''ancient'':18 ''confront'':14 ''epic'':4 ''girl'':11 ''india'':19 ''monkey'':16 ''moos'':8 ''must'':13 ''pollock'':2 ''tale'':5', '1', '2013-05-26T14:50:58.951000', 54, 'R', 2006, 6, '4.99', '15.99', ARRAY['Trailers']::text[], 'Airport Pollock'), - ('A Touching Documentary of a Mad Cow And a Explorer who must Confront a Butler in A Manhattan Penthouse', '''airport'':2 ''butler'':17 ''confront'':15 ''cow'':9 ''documentari'':5 ''explor'':12 ''instinct'':1 ''mad'':8 ''manhattan'':20 ''must'':14 ''penthous'':21 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 116, 'PG', 2006, 4, '2.99', '21.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Instinct Airport'), - ('A Astounding Character Study of a Madman And a Robot who must Meet a Mad Scientist in An Abandoned Fun House', '''abandon'':21 ''astound'':4 ''bedazzl'':1 ''charact'':5 ''fun'':22 ''hous'':23 ''mad'':17 ''madman'':9 ''marri'':2 ''meet'':15 ''must'':14 ''robot'':12 ''scientist'':18 ''studi'':6', '1', '2013-05-26T14:50:58.951000', 73, 'PG', 2006, 6, '0.99', '21.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Bedazzled Married'), - ('A Fateful Panorama of a Crocodile And a Boy who must Defeat a Monkey in The Gulf of Mexico', '''ballroom'':2 ''boondock'':1 ''boy'':11 ''crocodil'':8 ''defeat'':14 ''fate'':4 ''gulf'':19 ''mexico'':21 ''monkey'':16 ''must'':13 ''panorama'':5', '1', '2013-05-26T14:50:58.951000', 76, 'NC-17', 2006, 7, '0.99', '14.99', ARRAY['Behind the Scenes']::text[], 'Boondock Ballroom'), - ('A Fateful Yarn of a Mad Cow And a Waitress who must Battle a Student in California', '''battl'':15 ''california'':19 ''chicago'':1 ''cow'':9 ''fate'':4 ''mad'':8 ''must'':14 ''north'':2 ''student'':17 ''waitress'':12 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 185, 'PG-13', 2006, 6, '4.99', '11.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Chicago North'), - ('A Thoughtful Saga of a A Shark And a Monkey who must Outgun a Student in Ancient China', '''ancient'':19 ''china'':20 ''hellfight'':2 ''leagu'':1 ''monkey'':12 ''must'':14 ''outgun'':15 ''saga'':5 ''shark'':9 ''student'':17 ''thought'':4', '1', '2013-05-26T14:50:58.951000', 110, 'PG-13', 2006, 5, '4.99', '25.99', ARRAY['Trailers']::text[], 'League Hellfighters'), - ('A Thoughtful Panorama of a Man And a Car who must Sink a Composer in Berlin', '''berlin'':18 ''car'':11 ''compos'':16 ''hollywood'':2 ''man'':8 ''mockingbird'':1 ''must'':13 ''panorama'':5 ''sink'':14 ''thought'':4', '1', '2013-05-26T14:50:58.951000', 60, 'PG', 2006, 4, '0.99', '27.99', ARRAY['Behind the Scenes']::text[], 'Mockingbird Hollywood'), - ('A Astounding Saga of a Mad Scientist And a Hunter who must Pursue a Robot in A Baloon Factory', '''arizona'':2 ''astound'':4 ''baloon'':20 ''factori'':21 ''hunter'':12 ''insid'':1 ''mad'':8 ''must'':14 ''pursu'':15 ''robot'':17 ''saga'':5 ''scientist'':9', '1', '2013-05-26T14:50:58.951000', 78, 'NC-17', 2006, 5, '2.99', '17.99', ARRAY['Commentaries']::text[], 'Insider Arizona') - ) AS data(description, fulltext, old_language_id, last_update, length, rating, release_year, rental_duration, rental_rate, replacement_cost, special_features, title) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."language"' - AND map0.old_id = data.old_language_id - RETURNING film_id - ) - SELECT array_agg(film_id) INTO v_new_ids_film FROM inserted; - - FOR i IN 1..array_length(v_new_ids_film, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."film"', v_old_ids_film[i], v_new_ids_film[i]::TEXT); - END LOOP; - - v_old_ids_film := ARRAY['70', '809', '209', '724', '390', '607', '442', '316', '781', '867', '554', '794', '993', '170', '337', '825', '541', '945', '659', '374', '562', '95', '923', '113', '468', '532', '313', '566', '219', '225', '974', '699', '25', '269', '64', '507', '109', '378', '917', '697', '138', '48', '264', '234', '43', '230', '115', '919', '531', '553', '371', '778', '12', '330', '121', '90', '715', '174', '956', '980', '158', '865', '528', '846', '514', '635', '373', '421', '169', '232', '926', '398', '754', '609', '606', '365', '860', '527', '460', '871', '24', '952', '419', '570', '270', '292', '780', '72', '939', '190', '612', '283', '152', '478', '31', '444', '137', '85', '944', '14']; - WITH inserted AS ( - INSERT INTO "public"."film" ("description", "fulltext", "language_id", "last_update", "length", "rating", "release_year", "rental_duration", "rental_rate", "replacement_cost", "special_features", "title") - SELECT - data.description::text, - data.fulltext::tsvector, - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.length::smallint, - data.rating::mpaa_rating, - data.release_year::integer, - data.rental_duration::smallint, - data.rental_rate::numeric, - data.replacement_cost::numeric, - data.special_features::text[], - data.title::character varying - FROM (VALUES - ('A Astounding Drama of a Astronaut And a Cat who must Discover a Woman in The First Manned Space Station', '''astound'':4 ''astronaut'':8 ''bikini'':1 ''borrow'':2 ''cat'':11 ''discov'':14 ''drama'':5 ''first'':19 ''man'':20 ''must'':13 ''space'':21 ''station'':22 ''woman'':16', '1', '2013-05-26T14:50:58.951000', 142, 'NC-17', 2006, 7, '4.99', '26.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Bikini Borrowers'), - ('A Taut Reflection of a Secret Agent And a Man who must Redeem a Explorer in A MySQL Convention', '''agent'':9 ''convent'':21 ''explor'':17 ''fidel'':2 ''man'':12 ''must'':14 ''mysql'':20 ''redeem'':15 ''reflect'':5 ''secret'':8 ''slipper'':1 ''taut'':4', '1', '2013-05-26T14:50:58.951000', 156, 'PG-13', 2006, 5, '0.99', '14.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Slipper Fidelity'), - ('A Touching Documentary of a Husband And a Hunter who must Escape a Boy in The Sahara Desert', '''boy'':16 ''dark'':1 ''desert'':20 ''documentari'':5 ''escap'':14 ''hunter'':11 ''husband'':8 ''must'':13 ''sahara'':19 ''touch'':4 ''war'':2', '1', '2013-05-26T14:50:58.951000', 99, 'NC-17', 2006, 6, '2.99', '24.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Darkness War'), - ('A Insightful Tale of a Technical Writer And a Waitress who must Conquer a Monkey in Ancient India', '''ancient'':19 ''conquer'':15 ''diari'':2 ''india'':20 ''insight'':4 ''monkey'':17 ''must'':14 ''rememb'':1 ''tale'':5 ''technic'':8 ''waitress'':12 ''writer'':9', '1', '2013-05-26T14:50:58.951000', 110, 'R', 2006, 5, '2.99', '15.99', ARRAY['Trailers', 'Commentaries']::text[], 'Remember Diary'), - ('A Boring Story of a Woman And a Feminist who must Redeem a Squirrel in A U-Boat', '''boat'':21 ''bore'':4 ''falcon'':2 ''feminist'':11 ''guy'':1 ''must'':13 ''redeem'':14 ''squirrel'':16 ''stori'':5 ''u'':20 ''u-boat'':19 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 84, 'R', 2006, 4, '4.99', '20.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Guys Falcon'), - ('A Lacklusture Story of a Madman And a Teacher who must Kill a Frisbee in The Gulf of Mexico', '''frisbe'':16 ''gulf'':19 ''kill'':14 ''lacklustur'':4 ''madman'':8 ''mexico'':21 ''mile'':2 ''muppet'':1 ''must'':13 ''stori'':5 ''teacher'':11', '1', '2013-05-26T14:50:58.951000', 50, 'PG', 2006, 5, '4.99', '18.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Muppet Mile'), - ('A Thrilling Reflection of a Pioneer And a Dentist who must Outrace a Womanizer in An Abandoned Mine Shaft', '''abandon'':19 ''dentist'':11 ''hunt'':1 ''mine'':20 ''musket'':2 ''must'':13 ''outrac'':14 ''pioneer'':8 ''reflect'':5 ''shaft'':21 ''thrill'':4 ''woman'':16', '1', '2013-05-26T14:50:58.951000', 65, 'NC-17', 2006, 6, '2.99', '24.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Hunting Musketeers'), - ('A Intrepid Documentary of a Frisbee And a Dog who must Outrace a Lumberjack in Nigeria', '''documentari'':5 ''dog'':11 ''fire'':1 ''frisbe'':8 ''intrepid'':4 ''lumberjack'':16 ''must'':13 ''nigeria'':18 ''outrac'':14 ''wolv'':2', '1', '2013-05-26T14:50:58.951000', 173, 'R', 2006, 5, '4.99', '18.99', ARRAY['Trailers']::text[], 'Fire Wolves'), - ('A Unbelieveable Character Study of a Dog And a Mad Cow who must Kill a Monkey in Berlin', '''berlin'':20 ''charact'':5 ''cow'':13 ''dog'':9 ''kill'':16 ''mad'':12 ''monkey'':18 ''must'':15 ''seven'':1 ''studi'':6 ''swarm'':2 ''unbeliev'':4', '1', '2013-05-26T14:50:58.951000', 127, 'R', 2006, 4, '4.99', '15.99', ARRAY['Deleted Scenes']::text[], 'Seven Swarm'), - ('A Action-Packed Saga of a Pastry Chef And a Explorer who must Discover a A Shark in The Outback', '''action'':5 ''action-pack'':4 ''chef'':11 ''discov'':17 ''explor'':14 ''must'':16 ''outback'':23 ''pack'':6 ''pastri'':10 ''saga'':7 ''shark'':20 ''super'':1 ''wyom'':2', '1', '2013-05-26T14:50:58.951000', 58, 'PG', 2006, 5, '4.99', '10.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Super Wyoming'), - ('A Intrepid Reflection of a Waitress And a A Shark who must Kill a Squirrel in The Outback', '''intrepid'':4 ''kill'':15 ''malkovich'':1 ''must'':14 ''outback'':20 ''pet'':2 ''reflect'':5 ''shark'':12 ''squirrel'':17 ''waitress'':8', '1', '2013-05-26T14:50:58.951000', 159, 'G', 2006, 6, '2.99', '22.99', ARRAY['Behind the Scenes']::text[], 'Malkovich Pet'), - ('A Stunning Panorama of a Crocodile And a Womanizer who must Meet a Feminist in The Canadian Rockies', '''ark'':2 ''canadian'':19 ''crocodil'':8 ''feminist'':16 ''meet'':14 ''must'':13 ''panorama'':5 ''rocki'':20 ''side'':1 ''stun'':4 ''woman'':11', '1', '2013-05-26T14:50:58.951000', 52, 'G', 2006, 5, '0.99', '28.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Side Ark'), - ('A Emotional Saga of a Crocodile And a Sumo Wrestler who must Discover a Mad Cow in New Orleans', '''behavior'':2 ''cow'':18 ''crocodil'':8 ''discov'':15 ''emot'':4 ''mad'':17 ''must'':14 ''new'':20 ''orlean'':21 ''saga'':5 ''sumo'':11 ''wrestler'':12 ''wrong'':1', '1', '2013-05-26T14:50:58.951000', 178, 'PG-13', 2006, 6, '2.99', '10.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Wrong Behavior'), - ('A Awe-Inspiring Tale of a Forensic Psychologist And a Woman who must Challenge a Database Administrator in Ancient Japan', '''administr'':20 ''ancient'':22 ''awe'':5 ''awe-inspir'':4 ''challeng'':17 ''command'':1 ''darl'':2 ''databas'':19 ''forens'':10 ''inspir'':6 ''japan'':23 ''must'':16 ''psychologist'':11 ''tale'':7 ''woman'':14', '1', '2013-05-26T14:50:58.951000', 120, 'PG-13', 2006, 5, '4.99', '28.99', ARRAY['Behind the Scenes']::text[], 'Command Darling'), - ('A Fateful Story of a Lumberjack And a Car who must Escape a Boat in An Abandoned Mine Shaft', '''abandon'':19 ''boat'':16 ''car'':11 ''escap'':14 ''fate'':4 ''frida'':1 ''lumberjack'':8 ''mine'':20 ''must'':13 ''shaft'':21 ''slipper'':2 ''stori'':5', '1', '2013-05-26T14:50:58.951000', 73, 'R', 2006, 6, '2.99', '11.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Frida Slipper'), - ('A Lacklusture Drama of a Forensic Psychologist And a Car who must Redeem a Man in A Manhattan Penthouse', '''car'':12 ''date'':2 ''drama'':5 ''forens'':8 ''lacklustur'':4 ''man'':17 ''manhattan'':20 ''must'':14 ''penthous'':21 ''psychologist'':9 ''redeem'':15 ''speakeasi'':1', '1', '2013-05-26T14:50:58.951000', 165, 'PG-13', 2006, 6, '2.99', '22.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Speakeasy Date'), - ('A Taut Character Study of a Boy And a Robot who must Redeem a Mad Scientist in Ancient India', '''ancient'':20 ''boy'':9 ''charact'':5 ''india'':21 ''luke'':1 ''mad'':17 ''mummi'':2 ''must'':14 ''redeem'':15 ''robot'':12 ''scientist'':18 ''studi'':6 ''taut'':4', '1', '2013-05-26T14:50:58.951000', 74, 'NC-17', 2006, 5, '2.99', '21.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Luke Mummy'), - ('A Emotional Panorama of a Dentist And a Crocodile who must Meet a Boy in Berlin', '''berlin'':18 ''boy'':16 ''crocodil'':11 ''dentist'':8 ''emot'':4 ''meet'':14 ''must'':13 ''panorama'':5 ''pluto'':2 ''virginian'':1', '1', '2013-05-26T14:50:58.951000', 164, 'R', 2006, 5, '0.99', '22.99', ARRAY['Deleted Scenes']::text[], 'Virginian Pluto'), - ('A Taut Epistle of a Sumo Wrestler And a Girl who must Face a Husband in Ancient Japan', '''ancient'':19 ''citizen'':2 ''epistl'':5 ''face'':15 ''girl'':12 ''husband'':17 ''japan'':20 ''must'':14 ''park'':1 ''sumo'':8 ''taut'':4 ''wrestler'':9', '1', '2013-05-26T14:50:58.951000', 109, 'PG-13', 2006, 3, '4.99', '14.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Park Citizen'), - ('A Unbelieveable Epistle of a Sumo Wrestler And a Hunter who must Build a Composer in Berlin', '''berlin'':19 ''build'':15 ''compos'':17 ''epistl'':5 ''graffiti'':1 ''hunter'':12 ''love'':2 ''must'':14 ''sumo'':8 ''unbeliev'':4 ''wrestler'':9', '1', '2013-05-26T14:50:58.951000', 117, 'PG', 2006, 3, '0.99', '29.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Graffiti Love'), - ('A Fanciful Documentary of a Pioneer And a Boat who must Pursue a Pioneer in An Abandoned Mine Shaft', '''abandon'':19 ''boat'':11 ''bubbl'':2 ''documentari'':5 ''fanci'':4 ''mask'':1 ''mine'':20 ''must'':13 ''pioneer'':8,16 ''pursu'':14 ''shaft'':21', '1', '2013-05-26T14:50:58.951000', 151, 'PG-13', 2006, 6, '0.99', '12.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Masked Bubble'), - ('A Beautiful Reflection of a Student And a Student who must Fight a Moose in Berlin', '''beauti'':4 ''berlin'':18 ''breakfast'':1 ''fight'':14 ''goldfing'':2 ''moos'':16 ''must'':13 ''reflect'':5 ''student'':8,11', '1', '2013-05-26T14:50:58.951000', 123, 'G', 2006, 5, '4.99', '18.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Breakfast Goldfinger'), - ('A Taut Documentary of a Waitress And a Mad Scientist who must Battle a Technical Writer in New Orleans', '''battl'':15 ''documentari'':5 ''kill'':2 ''mad'':11 ''must'':14 ''new'':20 ''orlean'':21 ''scientist'':12 ''taut'':4 ''technic'':17 ''unfaith'':1 ''waitress'':8 ''writer'':18', '1', '2013-05-26T14:50:58.951000', 78, 'R', 2006, 7, '2.99', '12.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Unfaithful Kill'), - ('A Thrilling Yarn of a Database Administrator And a Robot who must Battle a Database Administrator in Ancient India', '''administr'':9,18 ''ancient'':20 ''battl'':15 ''bird'':2 ''california'':1 ''databas'':8,17 ''india'':21 ''must'':14 ''robot'':12 ''thrill'':4 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 75, 'NC-17', 2006, 4, '4.99', '19.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'California Birds'), - ('A Lacklusture Character Study of a Mad Scientist And a Womanizer who must Outrace a Explorer in A Monastery', '''charact'':5 ''cyclon'':2 ''explor'':18 ''invas'':1 ''lacklustur'':4 ''mad'':9 ''monasteri'':21 ''must'':15 ''outrac'':16 ''scientist'':10 ''studi'':6 ''woman'':13', '1', '2013-05-26T14:50:58.951000', 97, 'PG', 2006, 5, '2.99', '12.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Invasion Cyclone'), - ('A Stunning Drama of a Robot And a Feminist who must Outgun a Butler in Nigeria', '''butler'':16 ''drama'':5 ''feminist'':11 ''hustler'':2 ''loser'':1 ''must'':13 ''nigeria'':18 ''outgun'':14 ''robot'':8 ''stun'':4', '1', '2013-05-26T14:50:58.951000', 80, 'PG', 2006, 5, '4.99', '28.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Loser Hustler'), - ('A Awe-Inspiring Drama of a Technical Writer And a Composer who must Reach a Pastry Chef in A U-Boat', '''awe'':5 ''awe-inspir'':4 ''boat'':25 ''chef'':20 ''compos'':14 ''devil'':2 ''drama'':7 ''fidel'':1 ''inspir'':6 ''must'':16 ''pastri'':19 ''reach'':17 ''technic'':10 ''u'':24 ''u-boat'':23 ''writer'':11', '1', '2013-05-26T14:50:58.951000', 118, 'G', 2006, 5, '4.99', '11.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Fidelity Devil'), - ('A Beautiful Documentary of a Forensic Psychologist And a Cat who must Reach a Astronaut in Nigeria', '''astronaut'':17 ''beauti'':4 ''cat'':12 ''documentari'':5 ''forens'':8 ''maud'':1 ''mod'':2 ''must'':14 ''nigeria'':19 ''psychologist'':9 ''reach'':15', '1', '2013-05-26T14:50:58.951000', 72, 'R', 2006, 6, '0.99', '20.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Maude Mod'), - ('A Amazing Tale of a Crocodile And a Squirrel who must Discover a Composer in Australia', '''amaz'':4 ''australia'':18 ''compos'':16 ''crocodil'':8 ''crusad'':2 ''deep'':1 ''discov'':14 ''must'':13 ''squirrel'':11 ''tale'':5', '1', '2013-05-26T14:50:58.951000', 51, 'PG-13', 2006, 6, '4.99', '20.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Deep Crusade'), - ('A Beautiful Yarn of a Teacher And a Cat who must Build a Car in A U-Boat', '''beauti'':4 ''boat'':21 ''build'':14 ''car'':16 ''cat'':11 ''destin'':1 ''jerk'':2 ''must'':13 ''teacher'':8 ''u'':20 ''u-boat'':19 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 76, 'PG-13', 2006, 3, '0.99', '19.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Destination Jerk'), - ('A Beautiful Story of a Monkey And a Sumo Wrestler who must Conquer a A Shark in A MySQL Convention', '''apollo'':2 ''beauti'':4 ''conquer'':15 ''convent'':22 ''monkey'':8 ''must'':14 ''mysql'':21 ''shark'':18 ''stori'':5 ''sumo'':11 ''wild'':1 ''wrestler'':12', '1', '2013-05-26T14:50:58.951000', 181, 'R', 2006, 4, '0.99', '24.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Wild Apollo'), - ('A Stunning Story of a Technical Writer And a Hunter who must Succumb a Secret Agent in A Baloon', '''agent'':18 ''baloon'':21 ''drop'':2 ''hunter'':12 ''must'':14 ''privat'':1 ''secret'':17 ''stori'':5 ''stun'':4 ''succumb'':15 ''technic'':8 ''writer'':9', '1', '2013-05-26T14:50:58.951000', 106, 'PG', 2006, 7, '4.99', '26.99', ARRAY['Trailers']::text[], 'Private Drop'), - ('A Thoughtful Display of a Woman And a Astronaut who must Battle a Robot in Berlin', '''angel'':1 ''astronaut'':11 ''battl'':14 ''berlin'':18 ''display'':5 ''life'':2 ''must'':13 ''robot'':16 ''thought'':4 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 74, 'G', 2006, 3, '2.99', '15.99', ARRAY['Trailers']::text[], 'Angels Life'), - ('A Stunning Character Study of a Dentist And a Mad Cow who must Find a Teacher in Nigeria', '''charact'':5 ''cow'':13 ''dentist'':9 ''earring'':1 ''find'':16 ''instinct'':2 ''mad'':12 ''must'':15 ''nigeria'':20 ''studi'':6 ''stun'':4 ''teacher'':18', '1', '2013-05-26T14:50:58.951000', 98, 'R', 2006, 3, '0.99', '22.99', ARRAY['Behind the Scenes']::text[], 'Earring Instinct'), - ('A Epic Display of a Pioneer And a Student who must Challenge a Butler in The Gulf of Mexico', '''beethoven'':1 ''butler'':16 ''challeng'':14 ''display'':5 ''epic'':4 ''exorcist'':2 ''gulf'':19 ''mexico'':21 ''must'':13 ''pioneer'':8 ''student'':11', '1', '2013-05-26T14:50:58.951000', 151, 'PG-13', 2006, 6, '0.99', '26.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Beethoven Exorcist'), - ('A Fateful Reflection of a Dog And a Mad Scientist who must Meet a Mad Scientist in New Orleans', '''armageddon'':2 ''dog'':8 ''fate'':4 ''ladybug'':1 ''mad'':11,17 ''meet'':15 ''must'':14 ''new'':20 ''orlean'':21 ''reflect'':5 ''scientist'':12,18', '1', '2013-05-26T14:50:58.951000', 113, 'NC-17', 2006, 4, '0.99', '13.99', ARRAY['Deleted Scenes']::text[], 'Ladybugs Armageddon'), - ('A Fateful Story of a Girl And a Composer who must Conquer a Husband in A Shark Tank', '''butterfli'':1 ''chocolat'':2 ''compos'':11 ''conquer'':14 ''fate'':4 ''girl'':8 ''husband'':16 ''must'':13 ''shark'':19 ''stori'':5 ''tank'':20', '1', '2013-05-26T14:50:58.951000', 89, 'G', 2006, 3, '0.99', '17.99', ARRAY['Behind the Scenes']::text[], 'Butterfly Chocolat'), - ('A Astounding Character Study of a Secret Agent And a Robot who must Build a A Shark in Berlin', '''agent'':10 ''astound'':4 ''berlin'':21 ''build'':16 ''charact'':5 ''greatest'':1 ''must'':15 ''north'':2 ''robot'':13 ''secret'':9 ''shark'':19 ''studi'':6', '1', '2013-05-26T14:50:58.951000', 93, 'NC-17', 2006, 5, '2.99', '24.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Greatest North'), - ('A Boring Drama of a Man And a Forensic Psychologist who must Face a Frisbee in Ancient India', '''ancient'':19 ''bore'':4 ''drama'':5 ''face'':15 ''forens'':11 ''frisbe'':17 ''india'':20 ''man'':8 ''mile'':2 ''must'':14 ''psychologist'':12 ''tuxedo'':1', '1', '2013-05-26T14:50:58.951000', 152, 'R', 2006, 3, '2.99', '24.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Tuxedo Mile'), - ('A Fateful Documentary of a Pastry Chef And a Butler who must Build a Dog in The Canadian Rockies', '''build'':15 ''butler'':12 ''canadian'':20 ''chef'':9 ''documentari'':5 ''dog'':17 ''fate'':4 ''glass'':2 ''must'':14 ''pastri'':8 ''primari'':1 ''rocki'':21', '1', '2013-05-26T14:50:58.951000', 53, 'G', 2006, 7, '0.99', '16.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Primary Glass'), - ('A Unbelieveable Epistle of a Robot And a Husband who must Chase a Robot in The First Manned Space Station', '''chariot'':1 ''chase'':14 ''conspiraci'':2 ''epistl'':5 ''first'':19 ''husband'':11 ''man'':20 ''must'':13 ''robot'':8,16 ''space'':21 ''station'':22 ''unbeliev'':4', '1', '2013-05-26T14:50:58.951000', 71, 'R', 2006, 5, '2.99', '29.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Chariots Conspiracy'), - ('A Stunning Character Study of a Mad Scientist And a Mad Cow who must Kill a Car in A Monastery', '''backlash'':1 ''car'':19 ''charact'':5 ''cow'':14 ''kill'':17 ''mad'':9,13 ''monasteri'':22 ''must'':16 ''scientist'':10 ''studi'':6 ''stun'':4 ''undef'':2', '1', '2013-05-26T14:50:58.951000', 118, 'PG-13', 2006, 3, '4.99', '24.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Backlash Undefeated'), - ('A Emotional Yarn of a Girl And a Dog who must Challenge a Composer in Ancient Japan', '''alter'':2 ''ancient'':18 ''challeng'':14 ''compos'':16 ''dog'':11 ''dwarf'':1 ''emot'':4 ''girl'':8 ''japan'':19 ''must'':13 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 101, 'G', 2006, 6, '2.99', '13.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Dwarfs Alter'), - ('A Lacklusture Display of a Crocodile And a Butler who must Overcome a Monkey in A U-Boat', '''boat'':21 ''butler'':11 ''crocodil'':8 ''display'':5 ''disturb'':1 ''lacklustur'':4 ''monkey'':16 ''must'':13 ''overcom'':14 ''scarfac'':2 ''u'':20 ''u-boat'':19', '1', '2013-05-26T14:50:58.951000', 94, 'R', 2006, 6, '2.99', '27.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Disturbing Scarface'), - ('A Thrilling Yarn of a Feminist And a Hunter who must Fight a Technical Writer in A Shark Tank', '''atlanti'':1 ''caus'':2 ''feminist'':8 ''fight'':14 ''hunter'':11 ''must'':13 ''shark'':20 ''tank'':21 ''technic'':16 ''thrill'':4 ''writer'':17 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 170, 'G', 2006, 6, '2.99', '15.99', ARRAY['Behind the Scenes']::text[], 'Atlantis Cause'), - ('A Thoughtful Character Study of a Frisbee And a Mad Cow who must Outgun a Man in Ancient India', '''ancient'':20 ''charact'':5 ''cow'':13 ''diari'':1 ''frisbe'':9 ''india'':21 ''mad'':12 ''man'':18 ''must'':15 ''outgun'':16 ''panic'':2 ''studi'':6 ''thought'':4', '1', '2013-05-26T14:50:58.951000', 107, 'G', 2006, 7, '2.99', '20.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Diary Panic'), - ('A Astounding Drama of a Crocodile And a Mad Cow who must Build a Robot in A Jet Boat', '''astound'':4 ''boat'':21 ''build'':15 ''campus'':1 ''cow'':12 ''crocodil'':8 ''drama'':5 ''jet'':20 ''mad'':11 ''must'':14 ''rememb'':2 ''robot'':17', '1', '2013-05-26T14:50:58.951000', 167, 'R', 2006, 5, '2.99', '27.99', ARRAY['Behind the Scenes']::text[], 'Campus Remember'), - ('A Emotional Display of a Husband And a A Shark who must Succumb a Madman in A Manhattan Penthouse', '''display'':5 ''emot'':4 ''gather'':2 ''husband'':8 ''madman'':17 ''manhattan'':20 ''must'':14 ''penthous'':21 ''shark'':12 ''succumb'':15 ''tycoon'':1', '1', '2013-05-26T14:50:58.951000', 82, 'G', 2006, 3, '4.99', '17.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Tycoon Gathering'), - ('A Stunning Reflection of a Student And a Technical Writer who must Battle a Butler in The First Manned Space Station', '''battl'':15 ''butler'':17 ''first'':20 ''inch'':2 ''lose'':1 ''man'':21 ''must'':14 ''reflect'':5 ''space'':22 ''station'':23 ''student'':8 ''stun'':4 ''technic'':11 ''writer'':12', '1', '2013-05-26T14:50:58.951000', 137, 'R', 2006, 3, '0.99', '18.99', ARRAY['Trailers', 'Commentaries']::text[], 'Lose Inch'), - ('A Stunning Display of a Moose And a Database Administrator who must Pursue a Composer in A Jet Boat', '''administr'':12 ''boat'':21 ''compos'':17 ''databas'':11 ''display'':5 ''gabl'':2 ''jet'':20 ''maker'':1 ''moos'':8 ''must'':14 ''pursu'':15 ''stun'':4', '1', '2013-05-26T14:50:58.951000', 136, 'PG-13', 2006, 4, '0.99', '12.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Maker Gables'), - ('A Epic Panorama of a Mad Scientist And a Monkey who must Redeem a Secret Agent in Berlin', '''agent'':18 ''berlin'':20 ''donni'':2 ''epic'':4 ''gosford'':1 ''mad'':8 ''monkey'':12 ''must'':14 ''panorama'':5 ''redeem'':15 ''scientist'':9 ''secret'':17', '1', '2013-05-26T14:50:58.951000', 129, 'G', 2006, 5, '4.99', '17.99', ARRAY['Commentaries']::text[], 'Gosford Donnie'), - ('A Fateful Saga of a Cat And a Frisbee who must Kill a Girl in A Manhattan Penthouse', '''cat'':8 ''fate'':4 ''frisbe'':11 ''girl'':16 ''kill'':14 ''manhattan'':19 ''must'':13 ''paradis'':2 ''penthous'':20 ''saga'':5 ''secret'':1', '1', '2013-05-26T14:50:58.951000', 109, 'G', 2006, 3, '4.99', '24.99', ARRAY['Trailers', 'Commentaries']::text[], 'Secrets Paradise'), - ('A Fanciful Saga of a Hunter And a Pastry Chef who must Vanquish a Boy in Australia', '''alaska'':1 ''australia'':19 ''boy'':17 ''chef'':12 ''fanci'':4 ''hunter'':8 ''must'':14 ''pastri'':11 ''phantom'':2 ''saga'':5 ''vanquish'':15', '1', '2013-05-26T14:50:58.951000', 136, 'PG', 2006, 6, '0.99', '22.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Alaska Phantom'), - ('A Fateful Tale of a Squirrel And a Forensic Psychologist who must Redeem a Man in Nigeria', '''comanchero'':2 ''fate'':4 ''forens'':11 ''forrest'':1 ''man'':17 ''must'':14 ''nigeria'':19 ''psychologist'':12 ''redeem'':15 ''squirrel'':8 ''tale'':5', '1', '2013-05-26T14:50:58.951000', 112, 'NC-17', 2006, 7, '4.99', '22.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Forrester Comancheros'), - ('A Astounding Character Study of a Composer And a Student who must Overcome a Composer in A Monastery', '''astound'':4 ''carol'':1 ''charact'':5 ''compos'':9,17 ''monasteri'':20 ''must'':14 ''overcom'':15 ''student'':12 ''studi'':6 ''texa'':2', '1', '2013-05-26T14:50:58.951000', 151, 'PG', 2006, 4, '2.99', '15.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Carol Texas'), - ('A Fateful Epistle of a Moose And a Monkey who must Confront a Lumberjack in Ancient China', '''ancient'':18 ''boulevard'':1 ''china'':19 ''confront'':14 ''epistl'':5 ''fate'':4 ''lumberjack'':16 ''mob'':2 ''monkey'':11 ''moos'':8 ''must'':13', '1', '2013-05-26T14:50:58.951000', 63, 'R', 2006, 3, '0.99', '11.99', ARRAY['Trailers']::text[], 'Boulevard Mob'), - ('A Insightful Documentary of a Hunter And a Dentist who must Confront a Crocodile in A Baloon', '''baloon'':19 ''confront'':14 ''crocodil'':16 ''dentist'':11 ''documentari'':5 ''hunter'':8 ''insight'':4 ''moonwalk'':2 ''must'':13 ''rang'':1', '1', '2013-05-26T14:50:58.951000', 147, 'PG', 2006, 3, '4.99', '25.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Range Moonwalker'), - ('A Stunning Reflection of a Cat And a Woman who must Find a Astronaut in Ancient Japan', '''ancient'':18 ''astronaut'':16 ''cat'':8 ''confidenti'':1 ''find'':14 ''interview'':2 ''japan'':19 ''must'':13 ''reflect'':5 ''stun'':4 ''woman'':11', '1', '2013-05-26T14:50:58.951000', 180, 'NC-17', 2006, 6, '4.99', '13.99', ARRAY['Commentaries']::text[], 'Confidential Interview'), - ('A Insightful Drama of a A Shark And a Pioneer who must Find a Womanizer in The Outback', '''chamber'':2 ''drama'':5 ''find'':15 ''insight'':4 ''must'':14 ''outback'':20 ''pioneer'':12 ''shark'':9 ''wanda'':1 ''woman'':17', '1', '2013-05-26T14:50:58.951000', 107, 'PG-13', 2006, 7, '4.99', '23.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Wanda Chamber'), - ('A Lacklusture Display of a Robot And a Girl who must Defeat a Sumo Wrestler in A MySQL Convention', '''coldblood'':2 ''convent'':21 ''defeat'':14 ''display'':5 ''girl'':11 ''lacklustur'':4 ''must'':13 ''mysql'':20 ''robot'':8 ''sumo'':16 ''wizard'':1 ''wrestler'':17', '1', '2013-05-26T14:50:58.951000', 75, 'PG', 2006, 4, '4.99', '12.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Wizard Coldblooded'), - ('A Amazing Drama of a Car And a Robot who must Pursue a Dentist in New Orleans', '''amaz'':4 ''car'':8 ''clone'':1 ''dentist'':16 ''drama'':5 ''must'':13 ''new'':18 ''orlean'':19 ''pinocchio'':2 ''pursu'':14 ''robot'':11', '1', '2013-05-26T14:50:58.951000', 124, 'R', 2006, 6, '2.99', '16.99', ARRAY['Behind the Scenes']::text[], 'Clones Pinocchio'), - ('A Beautiful Epistle of a Madman And a Butler who must Face a Crocodile in A Manhattan Penthouse', '''beauti'':4 ''butler'':11 ''crocodil'':16 ''epistl'':5 ''face'':14 ''leagu'':2 ''madman'':8 ''manhattan'':19 ''must'':13 ''penthous'':20 ''sunris'':1', '1', '2013-05-26T14:50:58.951000', 135, 'PG-13', 2006, 3, '4.99', '19.99', ARRAY['Behind the Scenes']::text[], 'Sunrise League'), - ('A Thrilling Drama of a Girl And a Robot who must Redeem a Waitress in An Abandoned Mine Shaft', '''abandon'':19 ''drama'':5 ''girl'':8 ''lolita'':1 ''mine'':20 ''must'':13 ''redeem'':14 ''robot'':11 ''shaft'':21 ''thrill'':4 ''waitress'':16 ''world'':2', '1', '2013-05-26T14:50:58.951000', 155, 'NC-17', 2006, 4, '2.99', '25.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Lolita World'), - ('A Fanciful Drama of a Frisbee And a Dog who must Fight a Madman in A Jet Boat', '''boat'':20 ''dog'':11 ''drama'':5 ''fanci'':4 ''fight'':14 ''frisbe'':8 ''jet'':19 ''madman'':16 ''must'':13 ''person'':2 ''sting'':1', '1', '2013-05-26T14:50:58.951000', 93, 'NC-17', 2006, 3, '4.99', '9.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Sting Personal'), - ('A Beautiful Epistle of a Secret Agent And a Pioneer who must Chase a Astronaut in Ancient China', '''agent'':9 ''ancient'':19 ''astronaut'':17 ''beauti'':4 ''chase'':15 ''china'':20 ''epistl'':5 ''lebowski'':1 ''must'':14 ''pioneer'':12 ''secret'':8 ''soldier'':2', '1', '2013-05-26T14:50:58.951000', 69, 'PG-13', 2006, 6, '2.99', '17.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Lebowski Soldiers'), - ('A Thoughtful Drama of a Dentist And a Womanizer who must Meet a Husband in The Sahara Desert', '''dentist'':8 ''desert'':20 ''drama'':5 ''husband'':16 ''jumanji'':2 ''meet'':14 ''must'':13 ''oklahoma'':1 ''sahara'':19 ''thought'':4 ''woman'':11', '1', '2013-05-26T14:50:58.951000', 58, 'PG', 2006, 7, '0.99', '15.99', ARRAY['Behind the Scenes']::text[], 'Oklahoma Jumanji'), - ('A Lacklusture Epistle of a Girl And a A Shark who must Meet a Mad Scientist in Ancient China', '''ancient'':20 ''china'':21 ''epistl'':5 ''girl'':8 ''graduat'':1 ''lacklustur'':4 ''lord'':2 ''mad'':17 ''meet'':15 ''must'':14 ''scientist'':18 ''shark'':12', '1', '2013-05-26T14:50:58.951000', 156, 'G', 2006, 7, '2.99', '14.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Graduate Lord'), - ('A Insightful Reflection of a Waitress And a Madman who must Pursue a Boy in Ancient Japan', '''ancient'':18 ''boy'':16 ''game'':2 ''holiday'':1 ''insight'':4 ''japan'':19 ''madman'':11 ''must'':13 ''pursu'':14 ''reflect'':5 ''waitress'':8', '1', '2013-05-26T14:50:58.951000', 78, 'PG-13', 2006, 7, '4.99', '10.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Holiday Games'), - ('A Unbelieveable Panorama of a Pioneer And a Husband who must Meet a Mad Cow in An Abandoned Mine Shaft', '''abandon'':20 ''comfort'':1 ''cow'':17 ''husband'':11 ''mad'':16 ''meet'':14 ''mine'':21 ''must'':13 ''panorama'':5 ''pioneer'':8 ''rush'':2 ''shaft'':22 ''unbeliev'':4', '1', '2013-05-26T14:50:58.951000', 76, 'NC-17', 2006, 3, '2.99', '19.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Comforts Rush'), - ('A Action-Packed Character Study of a Forensic Psychologist And a Girl who must Build a Dentist in The Outback', '''ace'':2 ''action'':5 ''action-pack'':4 ''build'':18 ''charact'':7 ''dentist'':20 ''dirti'':1 ''forens'':11 ''girl'':15 ''must'':17 ''outback'':23 ''pack'':6 ''psychologist'':12 ''studi'':8', '1', '2013-05-26T14:50:58.951000', 147, 'NC-17', 2006, 7, '2.99', '29.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Dirty Ace'), - ('A Amazing Documentary of a Woman And a Astronaut who must Outrace a Teacher in An Abandoned Fun House', '''abandon'':19 ''amaz'':4 ''astronaut'':11 ''documentari'':5 ''fun'':20 ''hous'':21 ''must'':13 ''outrac'':14 ''sunris'':2 ''teacher'':16 ''untouch'':1 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 120, 'NC-17', 2006, 5, '2.99', '11.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Untouchables Sunrise'), - ('A Stunning Reflection of a Girl And a Secret Agent who must Succumb a Boy in A MySQL Convention', '''agent'':12 ''boy'':17 ''convent'':21 ''galaxi'':2 ''girl'':8 ''hanov'':1 ''must'':14 ''mysql'':20 ''reflect'':5 ''secret'':11 ''stun'':4 ''succumb'':15', '1', '2013-05-26T14:50:58.951000', 47, 'NC-17', 2006, 5, '4.99', '21.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Hanover Galaxy'), - ('A Boring Story of a Woman And a Moose who must Reach a Husband in A Shark Tank', '''bore'':4 ''husband'':16 ''mermaid'':2 ''moos'':11 ''must'':13 ''reach'':14 ''rushmor'':1 ''shark'':19 ''stori'':5 ''tank'':20 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 150, 'PG-13', 2006, 6, '2.99', '17.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Rushmore Mermaid'), - ('A Stunning Panorama of a Sumo Wrestler And a Husband who must Redeem a Madman in Ancient India', '''ancient'':19 ''bright'':2 ''husband'':12 ''india'':20 ''madman'':17 ''muscl'':1 ''must'':14 ''panorama'':5 ''redeem'':15 ''stun'':4 ''sumo'':8 ''wrestler'':9', '1', '2013-05-26T14:50:58.951000', 185, 'G', 2006, 7, '2.99', '23.99', ARRAY['Deleted Scenes']::text[], 'Muscle Bright'), - ('A Fateful Character Study of a Crocodile And a Monkey who must Meet a Dentist in Australia', '''australia'':19 ''charact'':5 ''creatur'':2 ''crocodil'':9 ''dentist'':17 ''fate'':4 ''meet'':15 ''monkey'':12 ''mummi'':1 ''must'':14 ''studi'':6', '1', '2013-05-26T14:50:58.951000', 160, 'NC-17', 2006, 3, '0.99', '15.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Mummy Creatures'), - ('A Taut Documentary of a Database Administrator And a Waitress who must Reach a Mad Scientist in A Baloon Factory', '''administr'':9 ''baloon'':21 ''databas'':8 ''documentari'':5 ''factori'':22 ''gold'':1 ''mad'':17 ''must'':14 ''reach'':15 ''river'':2 ''scientist'':18 ''taut'':4 ''waitress'':12', '1', '2013-05-26T14:50:58.951000', 154, 'R', 2006, 4, '4.99', '21.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Gold River'), - ('A Emotional Character Study of a Car And a Girl who must Face a Composer in A U-Boat', '''boat'':22 ''car'':9 ''charact'':5 ''compos'':17 ''emot'':4 ''face'':15 ''girl'':12 ''must'':14 ''silenc'':2 ''studi'':6 ''suicid'':1 ''u'':21 ''u-boat'':20', '1', '2013-05-26T14:50:58.951000', 93, 'G', 2006, 4, '4.99', '13.99', ARRAY['Deleted Scenes']::text[], 'Suicides Silence'), - ('A Astounding Tale of a Mad Scientist And a Husband who must Redeem a Database Administrator in Ancient Japan', '''administr'':18 ''agent'':2 ''ancient'':20 ''astound'':4 ''databas'':17 ''husband'':12 ''japan'':21 ''lola'':1 ''mad'':8 ''must'':14 ''redeem'':15 ''scientist'':9 ''tale'':5', '1', '2013-05-26T14:50:58.951000', 85, 'PG', 2006, 4, '4.99', '24.99', ARRAY['Trailers', 'Commentaries']::text[], 'Lola Agent'), - ('A Beautiful Drama of a Pioneer And a Crocodile who must Challenge a Student in The Outback', '''beauti'':4 ''challeng'':14 ''crocodil'':11 ''drama'':5 ''innoc'':1 ''must'':13 ''outback'':19 ''pioneer'':8 ''student'':16 ''usual'':2', '1', '2013-05-26T14:50:58.951000', 178, 'PG-13', 2006, 3, '4.99', '26.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Innocent Usual'), - ('A Taut Documentary of a Car And a Robot who must Conquer a Boy in The Canadian Rockies', '''boy'':16 ''canadian'':19 ''car'':8 ''conquer'':14 ''documentari'':5 ''must'':13 ''robot'':11 ''rocki'':20 ''shine'':2 ''sweden'':1 ''taut'':4', '1', '2013-05-26T14:50:58.951000', 176, 'PG', 2006, 6, '4.99', '19.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Sweden Shining'), - ('A Thoughtful Display of a Explorer And a Pastry Chef who must Overcome a Feminist in The Sahara Desert', '''analyz'':1 ''chef'':12 ''desert'':21 ''display'':5 ''explor'':8 ''feminist'':17 ''hoosier'':2 ''must'':14 ''overcom'':15 ''pastri'':11 ''sahara'':20 ''thought'':4', '1', '2013-05-26T14:50:58.951000', 181, 'R', 2006, 6, '2.99', '19.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Analyze Hoosiers'), - ('A Intrepid Drama of a Moose And a Boat who must Kill a Explorer in A Manhattan Penthouse', '''boat'':11 ''drama'':5 ''explor'':16 ''intrepid'':4 ''jaw'':2 ''kill'':14 ''manhattan'':19 ''moos'':8 ''must'':13 ''penthous'':20 ''wagon'':1', '1', '2013-05-26T14:50:58.951000', 152, 'PG', 2006, 7, '2.99', '17.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Wagon Jaws'), - ('A Awe-Inspiring Tale of a Girl And a Madman who must Outgun a Student in A Shark Tank', '''awe'':5 ''awe-inspir'':4 ''frida'':2 ''girl'':10 ''hocus'':1 ''inspir'':6 ''madman'':13 ''must'':15 ''outgun'':16 ''shark'':21 ''student'':18 ''tale'':7 ''tank'':22', '1', '2013-05-26T14:50:58.951000', 141, 'G', 2006, 4, '2.99', '19.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Hocus Frida'), - ('A Lacklusture Drama of a Waitress And a Husband who must Fight a Husband in California', '''california'':18 ''drama'':5 ''fight'':14 ''husband'':11,16 ''insect'':2 ''lacklustur'':4 ''mermaid'':1 ''must'':13 ''waitress'':8', '1', '2013-05-26T14:50:58.951000', 104, 'NC-17', 2006, 5, '4.99', '20.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Mermaid Insects'), - ('A Stunning Drama of a Butler And a Madman who must Outrace a Womanizer in Ancient India', '''ancient'':18 ''butler'':8 ''drama'':5 ''earth'':1 ''india'':19 ''madman'':11 ''must'':13 ''outrac'':14 ''stun'':4 ''vision'':2 ''woman'':16', '1', '2013-05-26T14:50:58.951000', 85, 'NC-17', 2006, 7, '0.99', '29.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Earth Vision'), - ('A Brilliant Documentary of a Monkey And a Car who must Conquer a Crocodile in A Shark Tank', '''brilliant'':4 ''car'':11 ''conquer'':14 ''crocodil'':16 ''documentari'':5 ''eve'':2 ''excit'':1 ''monkey'':8 ''must'':13 ''shark'':19 ''tank'':20', '1', '2013-05-26T14:50:58.951000', 51, 'G', 2006, 3, '0.99', '20.99', ARRAY['Commentaries']::text[], 'Excitement Eve'), - ('A Emotional Tale of a Robot And a Sumo Wrestler who must Redeem a Pastry Chef in A Baloon Factory', '''baloon'':21 ''chef'':18 ''emot'':4 ''factori'':22 ''must'':14 ''pastri'':17 ''rear'':2 ''redeem'':15 ''robot'':8 ''sensibl'':1 ''sumo'':11 ''tale'':5 ''wrestler'':12', '1', '2013-05-26T14:50:58.951000', 98, 'PG', 2006, 7, '4.99', '15.99', ARRAY['Behind the Scenes']::text[], 'Sensibility Rear'), - ('A Stunning Saga of a Mad Scientist And a Forensic Psychologist who must Challenge a Squirrel in A MySQL Convention', '''bill'':1 ''challeng'':16 ''convent'':22 ''forens'':12 ''mad'':8 ''must'':15 ''mysql'':21 ''other'':2 ''psychologist'':13 ''saga'':5 ''scientist'':9 ''squirrel'':18 ''stun'':4', '1', '2013-05-26T14:50:58.951000', 93, 'PG', 2006, 6, '2.99', '12.99', ARRAY['Trailers', 'Commentaries']::text[], 'Bill Others'), - ('A Unbelieveable Display of a Mad Scientist And a Mad Scientist who must Outgun a Mad Cow in Ancient Japan', '''ancient'':21 ''cow'':19 ''display'':5 ''japan'':22 ''mad'':8,12,18 ''must'':15 ''northwest'':2 ''outgun'':16 ''scientist'':9,13 ''unbeliev'':4 ''vertigo'':1', '1', '2013-05-26T14:50:58.951000', 90, 'R', 2006, 4, '2.99', '17.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Vertigo Northwest'), - ('A Awe-Inspiring Reflection of a Squirrel And a Boat who must Outrace a Car in A Jet Boat', '''awe'':5 ''awe-inspir'':4 ''boat'':13,22 ''car'':18 ''creeper'':1 ''inspir'':6 ''jet'':21 ''kane'':2 ''must'':15 ''outrac'':16 ''reflect'':7 ''squirrel'':10', '1', '2013-05-26T14:50:58.951000', 172, 'NC-17', 2006, 5, '4.99', '23.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Creepers Kane'), - ('A Thrilling Display of a Boat And a Monkey who must Meet a Composer in Ancient China', '''ancient'':18 ''boat'':8 ''china'':19 ''compos'':16 ''display'':5 ''meet'':14 ''monkey'':11 ''mussolini'':1 ''must'':13 ''spoiler'':2 ''thrill'':4', '1', '2013-05-26T14:50:58.951000', 180, 'G', 2006, 6, '2.99', '10.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Mussolini Spoilers'), - ('A Unbelieveable Display of a Dentist And a Madman who must Vanquish a Squirrel in Berlin', '''berlin'':18 ''crowd'':2 ''dentist'':8 ''display'':5 ''end'':1 ''madman'':11 ''must'':13 ''squirrel'':16 ''unbeliev'':4 ''vanquish'':14', '1', '2013-05-26T14:50:58.951000', 85, 'NC-17', 2006, 6, '0.99', '10.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Ending Crowds'), - ('A Thoughtful Drama of a Pastry Chef And a Dentist who must Pursue a Girl in A Baloon', '''baloon'':20 ''chef'':9 ''circus'':1 ''dentist'':12 ''drama'':5 ''girl'':17 ''must'':14 ''pastri'':8 ''pursu'':15 ''thought'':4 ''youth'':2', '1', '2013-05-26T14:50:58.951000', 90, 'PG-13', 2006, 5, '2.99', '13.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Circus Youth'), - ('A Thrilling Display of a Database Administrator And a Monkey who must Overcome a Dog in An Abandoned Fun House', '''abandon'':20 ''administr'':9 ''databas'':8 ''display'':5 ''dog'':17 ''fun'':21 ''harri'':2 ''hous'':22 ''jaw'':1 ''monkey'':12 ''must'':14 ''overcom'':15 ''thrill'':4', '1', '2013-05-26T14:50:58.951000', 112, 'G', 2006, 4, '2.99', '10.99', ARRAY['Deleted Scenes']::text[], 'Jaws Harry'), - ('A Awe-Inspiring Reflection of a Pastry Chef And a Teacher who must Overcome a Sumo Wrestler in A U-Boat', '''apach'':1 ''awe'':5 ''awe-inspir'':4 ''boat'':25 ''chef'':11 ''divin'':2 ''inspir'':6 ''must'':16 ''overcom'':17 ''pastri'':10 ''reflect'':7 ''sumo'':19 ''teacher'':14 ''u'':24 ''u-boat'':23 ''wrestler'':20', '1', '2013-05-26T14:50:58.951000', 92, 'NC-17', 2006, 5, '4.99', '16.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Apache Divine'), - ('A Emotional Reflection of a Sumo Wrestler And a Monkey who must Conquer a Robot in The Sahara Desert', '''conquer'':15 ''desert'':21 ''emot'':4 ''hustler'':1 ''monkey'':12 ''must'':14 ''parti'':2 ''reflect'':5 ''robot'':17 ''sahara'':20 ''sumo'':8 ''wrestler'':9', '1', '2013-05-26T14:50:58.951000', 83, 'NC-17', 2006, 3, '4.99', '22.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Hustler Party'), - ('A Action-Packed Display of a Man And a Waitress who must Build a Dog in A MySQL Convention', '''action'':5 ''action-pack'':4 ''build'':16 ''charad'':1 ''convent'':22 ''display'':7 ''dog'':18 ''duffel'':2 ''man'':10 ''must'':15 ''mysql'':21 ''pack'':6 ''waitress'':13', '1', '2013-05-26T14:50:58.951000', 66, 'PG', 2006, 3, '2.99', '21.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Charade Duffel'), - ('A Fast-Paced Story of a Crocodile And a Robot who must Find a Moose in Ancient Japan', '''ancient'':20 ''bonni'':1 ''crocodil'':10 ''fast'':5 ''fast-pac'':4 ''find'':16 ''holocaust'':2 ''japan'':21 ''moos'':18 ''must'':15 ''pace'':6 ''robot'':13 ''stori'':7', '1', '2013-05-26T14:50:58.951000', 63, 'G', 2006, 4, '0.99', '29.99', ARRAY['Deleted Scenes']::text[], 'Bonnie Holocaust'), - ('A Awe-Inspiring Documentary of a Robot And a Mad Scientist who must Reach a Database Administrator in A Shark Tank', '''administr'':20 ''awe'':5 ''awe-inspir'':4 ''daisi'':2 ''databas'':19 ''documentari'':7 ''inspir'':6 ''mad'':13 ''must'':16 ''reach'':17 ''robot'':10 ''scientist'':14 ''shark'':23 ''tank'':24 ''virgin'':1', '1', '2013-05-26T14:50:58.951000', 179, 'PG-13', 2006, 6, '4.99', '29.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Virgin Daisy'), - ('A Emotional Drama of a A Shark And a Database Administrator who must Vanquish a Pioneer in Soviet Georgia', '''administr'':13 ''alic'':1 ''databas'':12 ''drama'':5 ''emot'':4 ''fantasia'':2 ''georgia'':21 ''must'':15 ''pioneer'':18 ''shark'':9 ''soviet'':20 ''vanquish'':16', '1', '2013-05-26T14:50:58.951000', 94, 'NC-17', 2006, 6, '0.99', '23.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Alice Fantasia') - ) AS data(description, fulltext, old_language_id, last_update, length, rating, release_year, rental_duration, rental_rate, replacement_cost, special_features, title) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."language"' - AND map0.old_id = data.old_language_id - RETURNING film_id - ) - SELECT array_agg(film_id) INTO v_new_ids_film FROM inserted; - - FOR i IN 1..array_length(v_new_ids_film, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."film"', v_old_ids_film[i], v_new_ids_film[i]::TEXT); - END LOOP; - - v_old_ids_film := ARRAY['410', '271', '891', '184', '205', '207', '814', '372', '223', '568', '737', '306', '803', '162', '793', '989', '632', '81', '67', '370', '236', '147', '897', '932', '760', '99', '436', '106', '310', '622', '546', '679', '689', '555', '274', '731', '766', '341', '799', '886', '399', '446', '951', '879', '369', '500', '740', '779', '909', '258', '620', '55', '736', '585', '480', '745', '250', '588', '963', '307', '120', '844', '734', '843', '593', '829', '168', '786', '340', '336', '511', '812', '129', '346', '613', '895', '795', '741', '119', '42', '726', '198', '385', '17', '806', '672', '343', '239', '318', '464', '26', '988', '670', '608', '524', '212', '819', '308', '89', '23']; - WITH inserted AS ( - INSERT INTO "public"."film" ("description", "fulltext", "language_id", "last_update", "length", "rating", "release_year", "rental_duration", "rental_rate", "replacement_cost", "special_features", "title") - SELECT - data.description::text, - data.fulltext::tsvector, - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.length::smallint, - data.rating::mpaa_rating, - data.release_year::integer, - data.rental_duration::smallint, - data.rental_rate::numeric, - data.replacement_cost::numeric, - data.special_features::text[], - data.title::character varying - FROM (VALUES - ('A Intrepid Story of a Butler And a Car who must Vanquish a Man in New Orleans', '''butler'':8 ''car'':11 ''freedom'':2 ''heaven'':1 ''intrepid'':4 ''man'':16 ''must'':13 ''new'':18 ''orlean'':19 ''stori'':5 ''vanquish'':14', '1', '2013-05-26T14:50:58.951000', 48, 'PG', 2006, 7, '2.99', '19.99', ARRAY['Commentaries']::text[], 'Heaven Freedom'), - ('A Fateful Story of a Monkey And a Girl who must Overcome a Pastry Chef in Ancient India', '''ancient'':19 ''chef'':17 ''easi'':1 ''fate'':4 ''girl'':11 ''gladiat'':2 ''india'':20 ''monkey'':8 ''must'':13 ''overcom'':14 ''pastri'':16 ''stori'':5', '1', '2013-05-26T14:50:58.951000', 148, 'G', 2006, 5, '4.99', '12.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Easy Gladiator'), - ('A Boring Display of a Man And a Dog who must Redeem a Girl in A U-Boat', '''boat'':21 ''bore'':4 ''display'':5 ''dog'':11 ''girl'':16 ''man'':8 ''must'':13 ''redeem'':14 ''sky'':2 ''timberland'':1 ''u'':20 ''u-boat'':19', '1', '2013-05-26T14:50:58.951000', 69, 'G', 2006, 3, '0.99', '13.99', ARRAY['Commentaries']::text[], 'Timberland Sky'), - ('A Unbelieveable Tale of a Car And a Explorer who must Confront a Boat in A Manhattan Penthouse', '''boat'':16 ''car'':8 ''confront'':14 ''core'':1 ''explor'':11 ''manhattan'':19 ''must'':13 ''penthous'':20 ''suit'':2 ''tale'':5 ''unbeliev'':4', '1', '2013-05-26T14:50:58.951000', 92, 'PG-13', 2006, 3, '2.99', '24.99', ARRAY['Deleted Scenes']::text[], 'Core Suit'), - ('A Insightful Reflection of a A Shark And a Dog who must Kill a Butler in An Abandoned Amusement Park', '''abandon'':20 ''amus'':21 ''butler'':17 ''danc'':1 ''dog'':12 ''insight'':4 ''kill'':15 ''must'':14 ''none'':2 ''park'':22 ''reflect'':5 ''shark'':9', '1', '2013-05-26T14:50:58.951000', 58, 'NC-17', 2006, 3, '0.99', '22.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Dances None'), - ('A Unbelieveable Story of a Mad Scientist And a Woman who must Overcome a Dog in California', '''california'':19 ''danger'':1 ''dog'':17 ''mad'':8 ''must'':14 ''overcom'':15 ''scientist'':9 ''stori'':5 ''unbeliev'':4 ''uptown'':2 ''woman'':12', '1', '2013-05-26T14:50:58.951000', 121, 'PG', 2006, 7, '4.99', '26.99', ARRAY['Commentaries']::text[], 'Dangerous Uptown'), - ('A Insightful Panorama of a Woman And a Feminist who must Defeat a Forensic Psychologist in Berlin', '''berlin'':19 ''defeat'':14 ''feminist'':11 ''forens'':16 ''insight'':4 ''must'':13 ''panorama'':5 ''psychologist'':17 ''slipper'':2 ''snatch'':1 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 110, 'PG', 2006, 6, '4.99', '15.99', ARRAY['Commentaries']::text[], 'Snatch Slipper'), - ('A Taut Display of a Cat And a Girl who must Overcome a Database Administrator in New Orleans', '''administr'':17 ''cat'':8 ''databas'':16 ''display'':5 ''dynamit'':2 ''girl'':11 ''graceland'':1 ''must'':13 ''new'':19 ''orlean'':20 ''overcom'':14 ''taut'':4', '1', '2013-05-26T14:50:58.951000', 140, 'R', 2006, 5, '4.99', '26.99', ARRAY['Trailers', 'Commentaries']::text[], 'Graceland Dynamite'), - ('A Fast-Paced Tale of a Dog And a Forensic Psychologist who must Meet a Astronaut in The First Manned Space Station', '''alien'':2 ''astronaut'':19 ''desir'':1 ''dog'':10 ''fast'':5 ''fast-pac'':4 ''first'':22 ''forens'':13 ''man'':23 ''meet'':17 ''must'':16 ''pace'':6 ''psychologist'':14 ''space'':24 ''station'':25 ''tale'':7', '1', '2013-05-26T14:50:58.951000', 76, 'NC-17', 2006, 7, '2.99', '24.99', ARRAY['Deleted Scenes']::text[], 'Desire Alien'), - ('A Touching Epistle of a Squirrel And a Explorer who must Redeem a Pastry Chef in The Sahara Desert', '''chef'':17 ''desert'':21 ''epistl'':5 ''explor'':11 ''memento'':1 ''must'':13 ''pastri'':16 ''redeem'':14 ''sahara'':20 ''squirrel'':8 ''touch'':4 ''zooland'':2', '1', '2013-05-26T14:50:58.951000', 77, 'NC-17', 2006, 4, '4.99', '11.99', ARRAY['Behind the Scenes']::text[], 'Memento Zoolander'), - ('A Astounding Character Study of a Robot And a Moose who must Overcome a Astronaut in Ancient India', '''ancient'':19 ''astound'':4 ''astronaut'':17 ''charact'':5 ''india'':20 ''instinct'':2 ''moos'':12 ''must'':14 ''overcom'':15 ''robot'':9 ''rock'':1 ''studi'':6', '1', '2013-05-26T14:50:58.951000', 102, 'G', 2006, 4, '0.99', '28.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Rock Instinct'), - ('A Thoughtful Yarn of a Monkey And a Teacher who must Find a Dog in Australia', '''australia'':18 ''dog'':16 ''feather'':1 ''find'':14 ''metal'':2 ''monkey'':8 ''must'':13 ''teacher'':11 ''thought'':4 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 104, 'PG-13', 2006, 3, '0.99', '12.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Feathers Metal'), - ('A Fast-Paced Tale of a A Shark And a Student who must Meet a Crocodile in Ancient China', '''ancient'':21 ''china'':22 ''crocodil'':19 ''fast'':5 ''fast-pac'':4 ''liaison'':2 ''meet'':17 ''must'':16 ''pace'':6 ''shark'':11 ''slacker'':1 ''student'':14 ''tale'':7', '1', '2013-05-26T14:50:58.951000', 179, 'R', 2006, 7, '4.99', '29.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Slacker Liaisons'), - ('A Taut Tale of a Car And a Pioneer who must Conquer a Sumo Wrestler in An Abandoned Fun House', '''abandon'':20 ''bucket'':2 ''car'':8 ''clueless'':1 ''conquer'':14 ''fun'':21 ''hous'':22 ''must'':13 ''pioneer'':11 ''sumo'':16 ''tale'':5 ''taut'':4 ''wrestler'':17', '1', '2013-05-26T14:50:58.951000', 95, 'R', 2006, 4, '2.99', '13.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Clueless Bucket'), - ('A Fateful Character Study of a Waitress And a Technical Writer who must Battle a Hunter in A Baloon', '''baloon'':21 ''battl'':16 ''charact'':5 ''divin'':2 ''fate'':4 ''hunter'':18 ''must'':15 ''shrunk'':1 ''studi'':6 ''technic'':12 ''waitress'':9 ''writer'':13', '1', '2013-05-26T14:50:58.951000', 139, 'R', 2006, 6, '2.99', '14.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Shrunk Divine'), - ('A Stunning Epistle of a Dentist And a Dog who must Kill a Madman in Ancient China', '''ancient'':18 ''china'':19 ''dentist'':8 ''dog'':11 ''epistl'':5 ''kill'':14 ''madman'':16 ''microcosmo'':2 ''must'':13 ''stun'':4 ''work'':1', '1', '2013-05-26T14:50:58.951000', 74, 'R', 2006, 4, '4.99', '22.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Working Microcosmos'), - ('A Thoughtful Drama of a Explorer And a Womanizer who must Meet a Teacher in California', '''california'':18 ''drama'':5 ''explor'':8 ''meet'':14 ''must'':13 ''nut'':1 ''teacher'':16 ''thought'':4 ''tie'':2 ''woman'':11', '1', '2013-05-26T14:50:58.951000', 145, 'NC-17', 2006, 5, '4.99', '10.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Nuts Ties'), - ('A Touching Drama of a Robot And a Dentist who must Meet a Hunter in A Jet Boat', '''blind'':1 ''boat'':20 ''dentist'':11 ''drama'':5 ''gun'':2 ''hunter'':16 ''jet'':19 ''meet'':14 ''must'':13 ''robot'':8 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 103, 'PG-13', 2006, 6, '4.99', '29.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Blindness Gun'), - ('A Taut Saga of a Crocodile And a Boy who must Overcome a Technical Writer in Ancient China', '''agent'':2 ''ancient'':19 ''beret'':1 ''boy'':11 ''china'':20 ''crocodil'':8 ''must'':13 ''overcom'':14 ''saga'':5 ''taut'':4 ''technic'':16 ''writer'':17', '1', '2013-05-26T14:50:58.951000', 77, 'PG-13', 2006, 5, '2.99', '24.99', ARRAY['Deleted Scenes']::text[], 'Berets Agent'), - ('A Action-Packed Display of a Sumo Wrestler And a Car who must Overcome a Waitress in A Baloon Factory', '''action'':5 ''action-pack'':4 ''baloon'':22 ''bingo'':2 ''car'':14 ''display'':7 ''factori'':23 ''gorgeous'':1 ''must'':16 ''overcom'':17 ''pack'':6 ''sumo'':10 ''waitress'':19 ''wrestler'':11', '1', '2013-05-26T14:50:58.951000', 108, 'R', 2006, 4, '2.99', '26.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Gorgeous Bingo'), - ('A Boring Character Study of a Man And a Womanizer who must Succumb a Teacher in An Abandoned Amusement Park', '''abandon'':20 ''amus'':21 ''bore'':4 ''charact'':5 ''divin'':1 ''man'':9 ''must'':14 ''park'':22 ''resurrect'':2 ''studi'':6 ''succumb'':15 ''teacher'':17 ''woman'':12', '1', '2013-05-26T14:50:58.951000', 100, 'R', 2006, 4, '2.99', '19.99', ARRAY['Trailers', 'Commentaries']::text[], 'Divine Resurrection'), - ('A Action-Packed Epistle of a Dentist And a Moose who must Meet a Mad Cow in Ancient Japan', '''action'':5 ''action-pack'':4 ''ancient'':21 ''chocolat'':1 ''cow'':19 ''dentist'':10 ''epistl'':7 ''harri'':2 ''japan'':22 ''mad'':18 ''meet'':16 ''moos'':13 ''must'':15 ''pack'':6', '1', '2013-05-26T14:50:58.951000', 101, 'NC-17', 2006, 5, '0.99', '16.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Chocolat Harry'), - ('A Emotional Display of a Crocodile And a Husband who must Reach a Man in Ancient Japan', '''ancient'':18 ''bound'':2 ''crocodil'':8 ''display'':5 ''emot'':4 ''husband'':11 ''japan'':19 ''man'':16 ''must'':13 ''reach'':14 ''torqu'':1', '1', '2013-05-26T14:50:58.951000', 179, 'G', 2006, 3, '4.99', '27.99', ARRAY['Trailers', 'Commentaries']::text[], 'Torque Bound'), - ('A Astounding Documentary of a Astronaut And a Boy who must Outrace a Sumo Wrestler in Berlin', '''astound'':4 ''astronaut'':8 ''berlin'':19 ''boy'':11 ''documentari'':5 ''must'':13 ''outrac'':14 ''packer'':2 ''sumo'':16 ''valley'':1 ''wrestler'':17', '1', '2013-05-26T14:50:58.951000', 73, 'G', 2006, 3, '0.99', '21.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Valley Packer'), - ('A Fast-Paced Story of a Pioneer And a Astronaut who must Reach a Boat in A Baloon', '''astronaut'':13 ''baloon'':21 ''boat'':18 ''fast'':5 ''fast-pac'':4 ''lion'':2 ''must'':15 ''pace'':6 ''pioneer'':10 ''reach'':16 ''samurai'':1 ''stori'':7', '1', '2013-05-26T14:50:58.951000', 110, 'G', 2006, 5, '2.99', '21.99', ARRAY['Commentaries']::text[], 'Samurai Lion'), - ('A Fateful Saga of a A Shark And a Technical Writer who must Find a Woman in A Jet Boat', '''boat'':22 ''bring'':1 ''fate'':4 ''find'':16 ''hyster'':2 ''jet'':21 ''must'':15 ''saga'':5 ''shark'':9 ''technic'':12 ''woman'':18 ''writer'':13', '1', '2013-05-26T14:50:58.951000', 136, 'PG', 2006, 7, '2.99', '14.99', ARRAY['Trailers']::text[], 'Bringing Hysterical'), - ('A Fateful Story of a Explorer And a Feminist who must Meet a Technical Writer in Soviet Georgia', '''explor'':8 ''fate'':4 ''feminist'':11 ''georgia'':20 ''hour'':1 ''meet'':14 ''must'':13 ''rage'':2 ''soviet'':19 ''stori'':5 ''technic'':16 ''writer'':17', '1', '2013-05-26T14:50:58.951000', 122, 'NC-17', 2006, 4, '0.99', '14.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Hours Rage'), - ('A Amazing Display of a Mad Cow And a Pioneer who must Redeem a Sumo Wrestler in The Outback', '''amaz'':4 ''bulworth'':1 ''command'':2 ''cow'':9 ''display'':5 ''mad'':8 ''must'':14 ''outback'':21 ''pioneer'':12 ''redeem'':15 ''sumo'':17 ''wrestler'':18', '1', '2013-05-26T14:50:58.951000', 61, 'G', 2006, 4, '2.99', '14.99', ARRAY['Trailers']::text[], 'Bulworth Commandments'), - ('A Insightful Panorama of a Cat And a Boat who must Defeat a Boat in The Gulf of Mexico', '''boat'':11,16 ''cat'':8 ''defeat'':14 ''empir'':2 ''fever'':1 ''gulf'':19 ''insight'':4 ''mexico'':21 ''must'':13 ''panorama'':5', '1', '2013-05-26T14:50:58.951000', 158, 'R', 2006, 5, '4.99', '20.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Fever Empire'), - ('A Action-Packed Character Study of a Dog And a Lumberjack who must Outrace a Moose in The Gulf of Mexico', '''action'':5 ''action-pack'':4 ''charact'':7 ''dog'':11 ''gulf'':22 ''lumberjack'':14 ''mexico'':24 ''moos'':19 ''must'':16 ''newsi'':1 ''outrac'':17 ''pack'':6 ''stori'':2 ''studi'':8', '1', '2013-05-26T14:50:58.951000', 159, 'G', 2006, 4, '0.99', '25.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Newsies Story'), - ('A Intrepid Panorama of a Sumo Wrestler And a Forensic Psychologist who must Discover a Moose in The First Manned Space Station', '''discov'':16 ''first'':21 ''forens'':12 ''gabl'':2 ''intrepid'':4 ''madr'':1 ''man'':22 ''moos'':18 ''must'':15 ''panorama'':5 ''psychologist'':13 ''space'':23 ''station'':24 ''sumo'':8 ''wrestler'':9', '1', '2013-05-26T14:50:58.951000', 98, 'PG-13', 2006, 7, '2.99', '27.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Madre Gables'), - ('A Awe-Inspiring Reflection of a Crocodile And a Sumo Wrestler who must Meet a Forensic Psychologist in An Abandoned Mine Shaft', '''abandon'':23 ''awe'':5 ''awe-inspir'':4 ''crocodil'':10 ''forens'':19 ''hoosier'':2 ''inspir'':6 ''meet'':17 ''mine'':24 ''must'':16 ''pilot'':1 ''psychologist'':20 ''reflect'':7 ''shaft'':25 ''sumo'':13 ''wrestler'':14', '1', '2013-05-26T14:50:58.951000', 50, 'PG', 2006, 6, '2.99', '17.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Pilot Hoosiers'), - ('A Intrepid Story of a Madman And a Frisbee who must Outgun a Boat in The Sahara Desert', '''boat'':16 ''deliver'':2 ''desert'':20 ''frisbe'':11 ''intrepid'':4 ''madman'':8 ''must'':13 ''outgun'':14 ''pollock'':1 ''sahara'':19 ''stori'':5', '1', '2013-05-26T14:50:58.951000', 137, 'PG', 2006, 5, '2.99', '14.99', ARRAY['Commentaries']::text[], 'Pollock Deliverance'), - ('A Thrilling Yarn of a Waitress And a Dentist who must Find a Hunter in A Monastery', '''dentist'':11 ''find'':14 ''hunter'':16 ''mallrat'':1 ''monasteri'':19 ''must'':13 ''thrill'':4 ''unit'':2 ''waitress'':8 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 133, 'PG', 2006, 4, '0.99', '25.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Mallrats United'), - ('A Beautiful Documentary of a Boat And a Sumo Wrestler who must Succumb a Database Administrator in The First Manned Space Station', '''administr'':18 ''beauti'':4 ''boat'':8 ''databas'':17 ''documentari'':5 ''egg'':1 ''first'':21 ''igbi'':2 ''man'':22 ''must'':14 ''space'':23 ''station'':24 ''succumb'':15 ''sumo'':11 ''wrestler'':12', '1', '2013-05-26T14:50:58.951000', 67, 'PG', 2006, 4, '2.99', '20.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Egg Igby'), - ('A Fateful Character Study of a Boat And a Cat who must Find a Database Administrator in A Jet Boat', '''administr'':18 ''boat'':9,22 ''cat'':12 ''charact'':5 ''crane'':2 ''databas'':17 ''fate'':4 ''find'':15 ''jet'':21 ''must'':14 ''right'':1 ''studi'':6', '1', '2013-05-26T14:50:58.951000', 153, 'PG-13', 2006, 7, '4.99', '29.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Right Cranes'), - ('A Awe-Inspiring Tale of a Astronaut And a Database Administrator who must Chase a Secret Agent in The Gulf of Mexico', '''administr'':14 ''agent'':20 ''astronaut'':10 ''awe'':5 ''awe-inspir'':4 ''chase'':17 ''databas'':13 ''gulf'':23 ''inspir'':6 ''mexico'':25 ''must'':16 ''savannah'':1 ''secret'':19 ''tale'':7 ''town'':2', '1', '2013-05-26T14:50:58.951000', 84, 'PG-13', 2006, 5, '0.99', '25.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Savannah Town'), - ('A Amazing Reflection of a Lumberjack And a Cat who must Discover a Husband in A MySQL Convention', '''amaz'':4 ''cat'':11 ''convent'':20 ''discov'':14 ''frost'':1 ''head'':2 ''husband'':16 ''lumberjack'':8 ''must'':13 ''mysql'':19 ''reflect'':5', '1', '2013-05-26T14:50:58.951000', 82, 'PG', 2006, 5, '0.99', '13.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Frost Head'), - ('A Thrilling Documentary of a Technical Writer And a A Shark who must Face a Pioneer in A Shark Tank', '''documentari'':5 ''face'':16 ''must'':15 ''north'':2 ''pioneer'':18 ''shark'':13,21 ''simon'':1 ''tank'':22 ''technic'':8 ''thrill'':4 ''writer'':9', '1', '2013-05-26T14:50:58.951000', 51, 'NC-17', 2006, 3, '0.99', '26.99', ARRAY['Trailers', 'Commentaries']::text[], 'Simon North'), - ('A Fateful Yarn of a Composer And a Monkey who must Vanquish a Womanizer in The First Manned Space Station', '''compos'':8 ''fate'':4 ''first'':19 ''man'':20 ''mermaid'':2 ''monkey'':11 ''must'':13 ''space'':21 ''station'':22 ''theori'':1 ''vanquish'':14 ''woman'':16 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 184, 'PG-13', 2006, 5, '0.99', '9.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Theory Mermaid'), - ('A Action-Packed Panorama of a Husband And a Feminist who must Meet a Forensic Psychologist in Ancient Japan', '''action'':5 ''action-pack'':4 ''ancient'':21 ''feminist'':13 ''forens'':18 ''happi'':1 ''husband'':10 ''japan'':22 ''meet'':16 ''must'':15 ''pack'':6 ''panorama'':7 ''psychologist'':19 ''unit'':2', '1', '2013-05-26T14:50:58.951000', 100, 'G', 2006, 6, '2.99', '23.99', ARRAY['Deleted Scenes']::text[], 'Happiness United'), - ('A Amazing Saga of a Madman And a Dentist who must Build a Car in A Manhattan Penthouse', '''amaz'':4 ''build'':14 ''car'':16 ''dentist'':11 ''grail'':2 ''hyster'':1 ''madman'':8 ''manhattan'':19 ''must'':13 ''penthous'':20 ''saga'':5', '1', '2013-05-26T14:50:58.951000', 150, 'PG', 2006, 5, '4.99', '19.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Hysterical Grail'), - ('A Epic Tale of a Squirrel And a Hunter who must Conquer a Boy in An Abandoned Mine Shaft', '''abandon'':19 ''boy'':16 ''conquer'':14 ''epic'':4 ''hunter'':11 ''legal'':2 ''mine'':20 ''must'':13 ''shaft'':21 ''squirrel'':8 ''tale'':5 ''voyag'':1', '1', '2013-05-26T14:50:58.951000', 78, 'PG-13', 2006, 6, '0.99', '28.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Voyage Legally'), - ('A Fateful Yarn of a Husband And a Dog who must Battle a Waitress in A Jet Boat', '''battl'':14 ''boat'':20 ''dog'':11 ''fate'':4 ''husband'':8 ''jet'':19 ''must'':13 ''telegraph'':1 ''voyag'':2 ''waitress'':16 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 148, 'PG', 2006, 3, '4.99', '20.99', ARRAY['Commentaries']::text[], 'Telegraph Voyage'), - ('A Unbelieveable Tale of a Dog And a Explorer who must Sink a Mad Cow in A Baloon Factory', '''baloon'':20 ''cow'':17 ''dog'':8 ''explor'':11 ''factori'':21 ''goodfella'':1 ''mad'':16 ''must'':13 ''salut'':2 ''sink'':14 ''tale'':5 ''unbeliev'':4', '1', '2013-05-26T14:50:58.951000', 56, 'PG', 2006, 4, '4.99', '22.99', ARRAY['Deleted Scenes']::text[], 'Goodfellas Salute'), - ('A Lacklusture Reflection of a Girl And a Husband who must Find a Robot in The Canadian Rockies', '''canadian'':19 ''find'':14 ''girl'':8 ''glori'':2 ''husband'':11 ''kiss'':1 ''lacklustur'':4 ''must'':13 ''reflect'':5 ''robot'':16 ''rocki'':20', '1', '2013-05-26T14:50:58.951000', 163, 'PG-13', 2006, 5, '4.99', '11.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Kiss Glory'), - ('A Beautiful Drama of a Robot And a Lumberjack who must Discover a Technical Writer in A Shark Tank', '''beauti'':4 ''bring'':2 ''discov'':14 ''drama'':5 ''lumberjack'':11 ''must'':13 ''robot'':8 ''rollercoast'':1 ''shark'':20 ''tank'':21 ''technic'':16 ''writer'':17', '1', '2013-05-26T14:50:58.951000', 153, 'PG-13', 2006, 5, '2.99', '13.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Rollercoaster Bringing'), - ('A Taut Saga of a Lumberjack And a Pastry Chef who must Escape a Sumo Wrestler in An Abandoned Fun House', '''abandon'':21 ''chef'':12 ''escap'':15 ''fun'':22 ''greek'':2 ''hous'':23 ''lumberjack'':8 ''must'':14 ''pastri'':11 ''saga'':5 ''sens'':1 ''sumo'':17 ''taut'':4 ''wrestler'':18', '1', '2013-05-26T14:50:58.951000', 54, 'R', 2006, 4, '4.99', '23.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Sense Greek'), - ('A Emotional Saga of a Car And a Madman who must Discover a Pioneer in California', '''california'':18 ''car'':8 ''command'':2 ''discov'':14 ''emot'':4 ''madman'':11 ''must'':13 ''pioneer'':16 ''saga'':5 ''treasur'':1', '1', '2013-05-26T14:50:58.951000', 102, 'PG-13', 2006, 3, '0.99', '28.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Treasure Command'), - ('A Epic Display of a Crocodile And a Crocodile who must Confront a Dog in An Abandoned Amusement Park', '''abandon'':19 ''amus'':20 ''confront'':14 ''crocodil'':8,11 ''display'':5 ''dog'':16 ''drum'':1 ''dynamit'':2 ''epic'':4 ''must'':13 ''park'':21', '1', '2013-05-26T14:50:58.951000', 96, 'PG', 2006, 6, '0.99', '11.99', ARRAY['Trailers']::text[], 'Drums Dynamite'), - ('A Lacklusture Reflection of a Monkey And a Squirrel who must Outrace a Womanizer in A Manhattan Penthouse', '''campus'':2 ''lacklustur'':4 ''manhattan'':19 ''monkey'':8 ''must'':13 ''nemo'':1 ''outrac'':14 ''penthous'':20 ''reflect'':5 ''squirrel'':11 ''woman'':16', '1', '2013-05-26T14:50:58.951000', 131, 'NC-17', 2006, 5, '2.99', '23.99', ARRAY['Trailers']::text[], 'Nemo Campus'), - ('A Awe-Inspiring Story of a Feminist And a Cat who must Conquer a Dog in A Monastery', '''awe'':5 ''awe-inspir'':4 ''barbarella'':1 ''cat'':13 ''conquer'':16 ''dog'':18 ''feminist'':10 ''inspir'':6 ''monasteri'':21 ''must'':15 ''stori'':7 ''streetcar'':2', '1', '2013-05-26T14:50:58.951000', 65, 'G', 2006, 6, '2.99', '27.99', ARRAY['Behind the Scenes']::text[], 'Barbarella Streetcar'), - ('A Taut Reflection of a Robot And a Squirrel who must Fight a Boat in Ancient Japan', '''ancient'':18 ''boat'':16 ''bright'':2 ''fight'':14 ''japan'':19 ''must'':13 ''reflect'':5 ''robberi'':1 ''robot'':8 ''squirrel'':11 ''taut'':4', '1', '2013-05-26T14:50:58.951000', 134, 'R', 2006, 4, '0.99', '21.99', ARRAY['Trailers']::text[], 'Robbery Bright'), - ('A Unbelieveable Documentary of a Frisbee And a Boat who must Meet a Boy in The Canadian Rockies', '''boat'':11 ''boy'':16 ''canadian'':19 ''documentari'':5 ''duffel'':2 ''frisbe'':8 ''meet'':14 ''mob'':1 ''must'':13 ''rocki'':20 ''unbeliev'':4', '1', '2013-05-26T14:50:58.951000', 105, 'G', 2006, 4, '0.99', '25.99', ARRAY['Trailers']::text[], 'Mob Duffel'), - ('A Astounding Display of a Composer And a Dog who must Kill a Pastry Chef in Soviet Georgia', '''astound'':4 ''chef'':17 ''compos'':8 ''display'':5 ''dog'':11 ''georgia'':20 ''jeeper'':1 ''kill'':14 ''must'':13 ''pastri'':16 ''soviet'':19 ''wed'':2', '1', '2013-05-26T14:50:58.951000', 84, 'R', 2006, 3, '2.99', '29.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Jeepers Wedding'), - ('A Astounding Panorama of a Monkey And a Secret Agent who must Defeat a Woman in The First Manned Space Station', '''agent'':12 ''astound'':4 ''defeat'':15 ''first'':20 ''man'':21 ''monkey'':8 ''must'':14 ''panorama'':5 ''rose'':1 ''secret'':11 ''space'':22 ''station'':23 ''treasur'':2 ''woman'':17', '1', '2013-05-26T14:50:58.951000', 162, 'PG-13', 2006, 5, '4.99', '23.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Roses Treasure'), - ('A Taut Reflection of a Boy And a Waitress who must Outgun a Teacher in Ancient China', '''ancient'':18 ''boy'':8 ''china'':19 ''dragon'':1 ''must'':13 ''outgun'':14 ''reflect'':5 ''squad'':2 ''taut'':4 ''teacher'':16 ''waitress'':11', '1', '2013-05-26T14:50:58.951000', 170, 'NC-17', 2006, 4, '0.99', '26.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Dragon Squad'), - ('A Beautiful Panorama of a Boat And a Crocodile who must Outrace a Dog in Australia', '''australia'':18 ''beauti'':4 ''boat'':8 ''crocodil'':11 ''dog'':16 ''fish'':2 ''model'':1 ''must'':13 ''outrac'':14 ''panorama'':5', '1', '2013-05-26T14:50:58.951000', 175, 'NC-17', 2006, 4, '4.99', '11.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Model Fish'), - ('A Fast-Paced Yarn of a Dog And a Frisbee who must Conquer a Hunter in Nigeria', '''conquer'':16 ''dog'':10 ''fast'':5 ''fast-pac'':4 ''frisbe'':13 ''hunter'':18 ''must'':15 ''nigeria'':20 ''pace'':6 ''traci'':2 ''watch'':1 ''yarn'':7', '1', '2013-05-26T14:50:58.951000', 78, 'PG', 2006, 5, '0.99', '12.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Watch Tracy'), - ('A Lacklusture Reflection of a Dentist And a Hunter who must Meet a Teacher in A Baloon', '''autumn'':2 ''baloon'':19 ''dentist'':8 ''fellowship'':1 ''hunter'':11 ''lacklustur'':4 ''meet'':14 ''must'':13 ''reflect'':5 ''teacher'':16', '1', '2013-05-26T14:50:58.951000', 77, 'NC-17', 2006, 6, '4.99', '9.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Fellowship Autumn'), - ('A Fanciful Tale of a Pioneer And a Technical Writer who must Outgun a Pioneer in A Shark Tank', '''caribbean'':1 ''fanci'':4 ''liberti'':2 ''must'':14 ''outgun'':15 ''pioneer'':8,17 ''shark'':20 ''tale'':5 ''tank'':21 ''technic'':11 ''writer'':12', '1', '2013-05-26T14:50:58.951000', 92, 'NC-17', 2006, 3, '4.99', '16.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Caribbean Liberty'), - ('A Stunning Character Study of a Car And a Girl who must Succumb a Car in A MySQL Convention', '''armageddon'':2 ''car'':9,17 ''charact'':5 ''convent'':21 ''girl'':12 ''must'':14 ''mysql'':20 ''steer'':1 ''studi'':6 ''stun'':4 ''succumb'':15', '1', '2013-05-26T14:50:58.951000', 140, 'PG', 2006, 6, '4.99', '16.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Steers Armageddon'), - ('A Boring Character Study of a Waitress And a Astronaut who must Fight a Crocodile in Ancient Japan', '''ancient'':19 ''astronaut'':12 ''bore'':4 ''charact'':5 ''crocodil'':17 ''fight'':15 ''japan'':20 ''must'':14 ''road'':1 ''roxann'':2 ''studi'':6 ''waitress'':9', '1', '2013-05-26T14:50:58.951000', 158, 'R', 2006, 4, '4.99', '12.99', ARRAY['Behind the Scenes']::text[], 'Road Roxanne'), - ('A Fast-Paced Yarn of a Composer And a Frisbee who must Face a Moose in Nigeria', '''compos'':10 ''face'':16 ''fast'':5 ''fast-pac'':4 ''frisbe'':13 ''moos'':18 ''must'':15 ''nigeria'':20 ''pace'':6 ''santa'':2 ''steel'':1 ''yarn'':7', '1', '2013-05-26T14:50:58.951000', 143, 'NC-17', 2006, 4, '4.99', '15.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Steel Santa'), - ('A Awe-Inspiring Drama of a Monkey And a Composer who must Escape a Feminist in A U-Boat', '''awe'':5 ''awe-inspir'':4 ''boat'':23 ''compos'':13 ''drama'':7 ''escap'':16 ''feminist'':18 ''inspir'':6 ''labyrinth'':2 ''monkey'':10 ''monterey'':1 ''must'':15 ''u'':22 ''u-boat'':21', '1', '2013-05-26T14:50:58.951000', 158, 'G', 2006, 6, '0.99', '13.99', ARRAY['Trailers', 'Commentaries']::text[], 'Monterey Labyrinth'), - ('A Lacklusture Epistle of a Sumo Wrestler And a Squirrel who must Defeat a Explorer in California', '''california'':19 ''defeat'':15 ''epistl'':5 ''explor'':17 ''lacklustur'':4 ''must'':14 ''rocki'':2 ''spinal'':1 ''squirrel'':12 ''sumo'':8 ''wrestler'':9', '1', '2013-05-26T14:50:58.951000', 138, 'PG-13', 2006, 7, '2.99', '12.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Spinal Rocky'), - ('A Boring Saga of a Lumberjack And a Monkey who must Find a Monkey in The Gulf of Mexico', '''bore'':4 ''comanchero'':1 ''enemi'':2 ''find'':14 ''gulf'':19 ''lumberjack'':8 ''mexico'':21 ''monkey'':11,16 ''must'':13 ''saga'':5', '1', '2013-05-26T14:50:58.951000', 67, 'R', 2006, 5, '0.99', '23.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Comancheros Enemy'), - ('A Thoughtful Drama of a Robot And a Womanizer who must Kill a Lumberjack in A Baloon', '''baloon'':19 ''drama'':5 ''kill'':14 ''lumberjack'':16 ''midsumm'':2 ''must'':13 ''robot'':8 ''shepherd'':1 ''thought'':4 ''woman'':11', '1', '2013-05-26T14:50:58.951000', 113, 'R', 2006, 7, '0.99', '14.99', ARRAY['Deleted Scenes']::text[], 'Shepherd Midsummer'), - ('A Emotional Story of a Madman And a Waitress who must Battle a Teacher in An Abandoned Fun House', '''abandon'':19 ''battl'':14 ''cabin'':2 ''emot'':4 ''frontier'':1 ''fun'':20 ''hous'':21 ''madman'':8 ''must'':13 ''stori'':5 ''teacher'':16 ''waitress'':11', '1', '2013-05-26T14:50:58.951000', 183, 'PG-13', 2006, 6, '4.99', '14.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Frontier Cabin'), - ('A Thrilling Epistle of a Dog And a Feminist who must Kill a Madman in Berlin', '''berlin'':18 ''dog'':8 ''epistl'':5 ''feminist'':11 ''french'':1 ''holiday'':2 ''kill'':14 ''madman'':16 ''must'':13 ''thrill'':4', '1', '2013-05-26T14:50:58.951000', 99, 'PG', 2006, 5, '4.99', '22.99', ARRAY['Behind the Scenes']::text[], 'French Holiday'), - ('A Fanciful Yarn of a Database Administrator And a Mad Cow who must Pursue a Womanizer in Berlin', '''administr'':9 ''berlin'':20 ''cow'':13 ''databas'':8 ''fanci'':4 ''lawrenc'':1 ''love'':2 ''mad'':12 ''must'':15 ''pursu'':16 ''woman'':18 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 175, 'NC-17', 2006, 7, '0.99', '23.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Lawrence Love'), - ('A Lacklusture Saga of a Mad Cow And a Mad Scientist who must Sink a Cat in A MySQL Convention', '''barbarella'':2 ''cat'':18 ''convent'':22 ''cow'':9 ''lacklustur'':4 ''mad'':8,12 ''must'':15 ''mysql'':21 ''saga'':5 ''scientist'':13 ''sink'':16 ''smoke'':1', '1', '2013-05-26T14:50:58.951000', 50, 'PG-13', 2006, 7, '0.99', '13.99', ARRAY['Behind the Scenes']::text[], 'Smoking Barbarella'), - ('A Taut Tale of a Explorer And a Pastry Chef who must Conquer a Hunter in A MySQL Convention', '''caus'':1 ''chef'':12 ''conquer'':15 ''convent'':21 ''date'':2 ''explor'':8 ''hunter'':17 ''must'':14 ''mysql'':20 ''pastri'':11 ''tale'':5 ''taut'':4', '1', '2013-05-26T14:50:58.951000', 179, 'R', 2006, 3, '2.99', '16.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Cause Date'), - ('A Emotional Reflection of a Womanizer And a Pioneer who must Face a Squirrel in Berlin', '''berlin'':18 ''emot'':4 ''face'':14 ''galaxi'':1 ''must'':13 ''pioneer'':11 ''reflect'':5 ''squirrel'':16 ''sweetheart'':2 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 128, 'R', 2006, 4, '4.99', '13.99', ARRAY['Deleted Scenes']::text[], 'Galaxy Sweethearts'), - ('A Epic Yarn of a Teacher And a Hunter who must Outgun a Explorer in Soviet Georgia', '''epic'':4 ''explor'':16 ''georgia'':19 ''hunter'':11 ''must'':13 ''mystic'':1 ''outgun'':14 ''soviet'':18 ''teacher'':8 ''truman'':2 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 92, 'NC-17', 2006, 5, '0.99', '19.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Mystic Truman'), - ('A Thoughtful Story of a Moose And a Husband who must Face a Secret Agent in The Sahara Desert', '''agent'':17 ''desert'':21 ''face'':14 ''husband'':11 ''hustler'':2 ''moos'':8 ''must'':13 ''sahara'':20 ''secret'':16 ''stori'':5 ''thought'':4 ''tomorrow'':1', '1', '2013-05-26T14:50:58.951000', 142, 'R', 2006, 3, '2.99', '21.99', ARRAY['Commentaries']::text[], 'Tomorrow Hustler'), - ('A Boring Tale of a Frisbee And a Crocodile who must Vanquish a Moose in An Abandoned Mine Shaft', '''abandon'':19 ''bore'':4 ''crocodil'':11 ''frisbe'':8 ''madr'':2 ''mine'':20 ''moos'':16 ''must'':13 ''shaft'':21 ''sieg'':1 ''tale'':5 ''vanquish'':14', '1', '2013-05-26T14:50:58.951000', 111, 'R', 2006, 7, '0.99', '23.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Siege Madre'), - ('A Thoughtful Panorama of a Mad Cow And a Student who must Battle a Forensic Psychologist in Berlin', '''battl'':15 ''berlin'':20 ''cow'':9 ''forens'':17 ''mad'':8 ''must'':14 ''panorama'':5 ''psychologist'':18 ''punk'':2 ''roman'':1 ''student'':12 ''thought'':4', '1', '2013-05-26T14:50:58.951000', 81, 'NC-17', 2006, 7, '0.99', '28.99', ARRAY['Trailers']::text[], 'Roman Punk'), - ('A Fateful Saga of a Moose And a Car who must Pursue a Woman in A MySQL Convention', '''caper'':1 ''car'':11 ''convent'':20 ''fate'':4 ''moos'':8 ''motion'':2 ''must'':13 ''mysql'':19 ''pursu'':14 ''saga'':5 ''woman'':16', '1', '2013-05-26T14:50:58.951000', 176, 'G', 2006, 6, '0.99', '22.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Caper Motions'), - ('A Stunning Reflection of a Robot And a Moose who must Challenge a Woman in California', '''artist'':1 ''california'':18 ''challeng'':14 ''coldblood'':2 ''moos'':11 ''must'':13 ''reflect'':5 ''robot'':8 ''stun'':4 ''woman'':16', '1', '2013-05-26T14:50:58.951000', 170, 'NC-17', 2006, 5, '2.99', '10.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Artist Coldblooded'), - ('A Intrepid Drama of a Teacher And a Moose who must Kill a Car in California', '''adapt'':2 ''california'':18 ''car'':16 ''drama'':5 ''intrepid'':4 ''kill'':14 ''moos'':11 ''must'':13 ''reservoir'':1 ''teacher'':8', '1', '2013-05-26T14:50:58.951000', 61, 'PG-13', 2006, 7, '2.99', '29.99', ARRAY['Commentaries']::text[], 'Reservoir Adaptation'), - ('A Fast-Paced Character Study of a Feminist And a Explorer who must Face a Pastry Chef in Ancient Japan', '''ancient'':22 ''break'':2 ''charact'':7 ''chef'':20 ''crystal'':1 ''explor'':14 ''face'':17 ''fast'':5 ''fast-pac'':4 ''feminist'':11 ''japan'':23 ''must'':16 ''pace'':6 ''pastri'':19 ''studi'':8', '1', '2013-05-26T14:50:58.951000', 184, 'NC-17', 2006, 6, '2.99', '22.99', ARRAY['Trailers', 'Commentaries']::text[], 'Crystal Breaking'), - ('A Brilliant Panorama of a Astronaut And a Technical Writer who must Discover a Butler in A Manhattan Penthouse', '''astronaut'':8 ''brilliant'':4 ''butler'':17 ''discov'':15 ''groundhog'':1 ''manhattan'':20 ''must'':14 ''panorama'':5 ''penthous'':21 ''technic'':11 ''uncut'':2 ''writer'':12', '1', '2013-05-26T14:50:58.951000', 139, 'PG-13', 2006, 6, '4.99', '26.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Groundhog Uncut'), - ('A Fast-Paced Character Study of a Composer And a Dog who must Outgun a Boat in An Abandoned Fun House', '''abandon'':22 ''alon'':1 ''boat'':19 ''charact'':7 ''compos'':11 ''dog'':14 ''fast'':5 ''fast-pac'':4 ''fun'':23 ''hous'':24 ''must'':16 ''outgun'':17 ''pace'':6 ''studi'':8 ''trip'':2', '1', '2013-05-26T14:50:58.951000', 82, 'R', 2006, 3, '0.99', '14.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Alone Trip'), - ('A Emotional Epistle of a Moose And a Composer who must Fight a Technical Writer in The Outback', '''compos'':11 ''emot'':4 ''epistl'':5 ''fight'':14 ''japanes'':2 ''moos'':8 ''must'':13 ''outback'':20 ''sleepi'':1 ''technic'':16 ''writer'':17', '1', '2013-05-26T14:50:58.951000', 137, 'PG', 2006, 4, '2.99', '25.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Sleepy Japanese'), - ('A Thrilling Yarn of a Dog And a Dog who must Build a Husband in A Baloon', '''baloon'':19 ''build'':14 ''dog'':8,11 ''groov'':2 ''husband'':16 ''must'':13 ''perfect'':1 ''thrill'':4 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 82, 'PG-13', 2006, 7, '2.99', '17.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Perfect Groove'), - ('A Beautiful Documentary of a Astronaut And a Moose who must Pursue a Monkey in A Shark Tank', '''astronaut'':8 ''beauti'':4 ''documentari'':5 ''flatlin'':2 ''full'':1 ''monkey'':16 ''moos'':11 ''must'':13 ''pursu'':14 ''shark'':19 ''tank'':20', '1', '2013-05-26T14:50:58.951000', 94, 'PG', 2006, 6, '2.99', '14.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Full Flatliners'), - ('A Brilliant Character Study of a Database Administrator And a Monkey who must Succumb a Astronaut in New Orleans', '''administr'':10 ''astronaut'':18 ''brilliant'':4 ''charact'':5 ''databas'':9 ''dogma'':1 ''famili'':2 ''monkey'':13 ''must'':15 ''new'':20 ''orlean'':21 ''studi'':6 ''succumb'':16', '1', '2013-05-26T14:50:58.951000', 122, 'G', 2006, 5, '4.99', '16.99', ARRAY['Commentaries']::text[], 'Dogma Family'), - ('A Awe-Inspiring Character Study of a Boat And a Boy who must Kill a Pastry Chef in The Sahara Desert', '''awe'':5 ''awe-inspir'':4 ''boat'':11 ''boy'':14 ''charact'':7 ''chef'':20 ''desert'':24 ''firehous'':1 ''inspir'':6 ''kill'':17 ''must'':16 ''pastri'':19 ''sahara'':23 ''studi'':8 ''vietnam'':2', '1', '2013-05-26T14:50:58.951000', 103, 'G', 2006, 7, '0.99', '14.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Firehouse Vietnam'), - ('A Astounding Epistle of a Cat And a Cat who must Conquer a Mad Cow in A U-Boat', '''astound'':4 ''boat'':22 ''cat'':8,11 ''conquer'':14 ''cow'':17 ''empir'':2 ''epistl'':5 ''intent'':1 ''mad'':16 ''must'':13 ''u'':21 ''u-boat'':20', '1', '2013-05-26T14:50:58.951000', 107, 'PG-13', 2006, 3, '2.99', '13.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Intentions Empire'), - ('A Amazing Panorama of a Pastry Chef And a Boat who must Escape a Woman in An Abandoned Amusement Park', '''abandon'':20 ''amaz'':4 ''amus'':21 ''anni'':1 ''boat'':12 ''chef'':9 ''escap'':15 ''ident'':2 ''must'':14 ''panorama'':5 ''park'':22 ''pastri'':8 ''woman'':17', '1', '2013-05-26T14:50:58.951000', 86, 'G', 2006, 3, '0.99', '15.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Annie Identity'), - ('A Action-Packed Yarn of a Secret Agent And a Technical Writer who must Battle a Sumo Wrestler in The First Manned Space Station', '''action'':5 ''action-pack'':4 ''agent'':11 ''battl'':18 ''first'':24 ''man'':25 ''must'':17 ''pack'':6 ''secret'':10 ''space'':26 ''station'':27 ''sumo'':20 ''tarzan'':2 ''technic'':14 ''worker'':1 ''wrestler'':21 ''writer'':15 ''yarn'':7', '1', '2013-05-26T14:50:58.951000', 139, 'R', 2006, 7, '2.99', '26.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Worker Tarzan'), - ('A Epic Documentary of a Boy And a Monkey who must Pursue a Astronaut in Berlin', '''astronaut'':16 ''berlin'':18 ''boy'':8 ''comfort'':2 ''documentari'':5 ''epic'':4 ''monkey'':11 ''must'':13 ''pelican'':1 ''pursu'':14', '1', '2013-05-26T14:50:58.951000', 48, 'PG', 2006, 4, '4.99', '17.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Pelican Comforts'), - ('A Brilliant Yarn of a Car And a Database Administrator who must Escape a Boy in A MySQL Convention', '''administr'':12 ''antitrust'':2 ''boy'':17 ''brilliant'':4 ''car'':8 ''convent'':21 ''databas'':11 ''escap'':15 ''murder'':1 ''must'':14 ''mysql'':20 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 166, 'PG', 2006, 6, '2.99', '11.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Murder Antitrust'), - ('A Intrepid Display of a Pastry Chef And a Cat who must Kill a A Shark in Ancient China', '''ancient'':20 ''cat'':12 ''chef'':9 ''china'':21 ''display'':5 ''intrepid'':4 ''kill'':15 ''lion'':1 ''must'':14 ''pastri'':8 ''shark'':18 ''uncut'':2', '1', '2013-05-26T14:50:58.951000', 50, 'PG', 2006, 6, '0.99', '13.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Lion Uncut'), - ('A Fateful Story of a A Shark And a Explorer who must Succumb a Technical Writer in A Jet Boat', '''boat'':22 ''darn'':1 ''explor'':12 ''fate'':4 ''forrest'':2 ''jet'':21 ''must'':14 ''shark'':9 ''stori'':5 ''succumb'':15 ''technic'':17 ''writer'':18', '1', '2013-05-26T14:50:58.951000', 185, 'G', 2006, 7, '4.99', '14.99', ARRAY['Deleted Scenes']::text[], 'Darn Forrester'), - ('A Amazing Documentary of a Man And a Husband who must Confront a Squirrel in A MySQL Convention', '''amaz'':4 ''confront'':14 ''convent'':20 ''documentari'':5 ''hedwig'':2 ''husband'':11 ''man'':8 ''must'':13 ''mysql'':19 ''song'':1 ''squirrel'':16', '1', '2013-05-26T14:50:58.951000', 165, 'PG-13', 2006, 3, '0.99', '29.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Song Hedwig'), - ('A Touching Display of a Frisbee And a Frisbee who must Kill a Girl in The Gulf of Mexico', '''display'':5 ''ferri'':1 ''frisbe'':8,11 ''girl'':16 ''gulf'':19 ''kill'':14 ''mexico'':21 ''mother'':2 ''must'':13 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 142, 'PG', 2006, 3, '2.99', '13.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Ferris Mother'), - ('A Brilliant Epistle of a Teacher And a Sumo Wrestler who must Defeat a Man in An Abandoned Fun House', '''abandon'':20 ''bedazzl'':2 ''borrow'':1 ''brilliant'':4 ''defeat'':15 ''epistl'':5 ''fun'':21 ''hous'':22 ''man'':17 ''must'':14 ''sumo'':11 ''teacher'':8 ''wrestler'':12', '1', '2013-05-26T14:50:58.951000', 63, 'G', 2006, 7, '0.99', '22.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Borrowers Bedazzled'), - ('A Lacklusture Display of a Dentist And a Dentist who must Fight a Girl in Australia', '''anaconda'':1 ''australia'':18 ''confess'':2 ''dentist'':8,11 ''display'':5 ''fight'':14 ''girl'':16 ''lacklustur'':4 ''must'':13', '1', '2013-05-26T14:50:58.951000', 92, 'R', 2006, 3, '0.99', '9.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Anaconda Confessions') - ) AS data(description, fulltext, old_language_id, last_update, length, rating, release_year, rental_duration, rental_rate, replacement_cost, special_features, title) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."language"' - AND map0.old_id = data.old_language_id - RETURNING film_id - ) - SELECT array_agg(film_id) INTO v_new_ids_film FROM inserted; - - FOR i IN 1..array_length(v_new_ids_film, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."film"', v_old_ids_film[i], v_new_ids_film[i]::TEXT); - END LOOP; - - v_old_ids_film := ARRAY['260', '111', '934', '743', '943', '221', '603', '826', '473', '543', '201', '350', '136', '698', '332', '905', '973', '261', '177', '614', '148', '217', '937', '960', '873', '649', '667', '49', '222', '703', '272', '875', '845', '356', '165', '388', '948', '155', '116', '415', '18', '224', '625', '69', '361', '633', '977', '887', '211', '505', '534', '9', '314', '798', '517', '896', '334', '443', '284', '802', '126', '144', '466', '97', '107', '901', '850', '982', '821', '638', '582', '813', '665', '661', '420', '535', '876', '435', '692', '557', '229', '598', '452', '995', '771', '870', '235', '648', '290', '128', '491', '357', '772', '19', '947', '298', '899', '877', '58', '400']; - WITH inserted AS ( - INSERT INTO "public"."film" ("description", "fulltext", "language_id", "last_update", "length", "rating", "release_year", "rental_duration", "rental_rate", "replacement_cost", "special_features", "title") - SELECT - data.description::text, - data.fulltext::tsvector, - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.length::smallint, - data.rating::mpaa_rating, - data.release_year::integer, - data.rental_duration::smallint, - data.rental_rate::numeric, - data.replacement_cost::numeric, - data.special_features::text[], - data.title::character varying - FROM (VALUES - ('A Stunning Reflection of a Husband And a Lumberjack who must Face a Frisbee in An Abandoned Fun House', '''abandon'':19 ''blind'':2 ''dude'':1 ''face'':14 ''frisbe'':16 ''fun'':20 ''hous'':21 ''husband'':8 ''lumberjack'':11 ''must'':13 ''reflect'':5 ''stun'':4', '1', '2013-05-26T14:50:58.951000', 132, 'G', 2006, 3, '4.99', '9.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Dude Blindness'), - ('A Awe-Inspiring Epistle of a Woman And a Madman who must Fight a Robot in Soviet Georgia', '''awe'':5 ''awe-inspir'':4 ''caddyshack'':1 ''epistl'':7 ''fight'':16 ''georgia'':21 ''inspir'':6 ''jedi'':2 ''madman'':13 ''must'':15 ''robot'':18 ''soviet'':20 ''woman'':10', '1', '2013-05-26T14:50:58.951000', 52, 'NC-17', 2006, 3, '0.99', '17.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Caddyshack Jedi'), - ('A Fast-Paced Saga of a Girl And a Forensic Psychologist who must Redeem a Girl in Nigeria', '''day'':2 ''fast'':5 ''fast-pac'':4 ''forens'':13 ''girl'':10,19 ''must'':16 ''nigeria'':21 ''pace'':6 ''psychologist'':14 ''redeem'':17 ''saga'':7 ''vanilla'':1', '1', '2013-05-26T14:50:58.951000', 122, 'NC-17', 2006, 7, '4.99', '20.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Vanilla Day'), - ('A Awe-Inspiring Panorama of a Composer And a Secret Agent who must Sink a Composer in A Shark Tank', '''agent'':14 ''awe'':5 ''awe-inspir'':4 ''compos'':10,19 ''inspir'':6 ''must'':16 ''panorama'':7 ''roman'':2 ''room'':1 ''secret'':13 ''shark'':22 ''sink'':17 ''tank'':23', '1', '2013-05-26T14:50:58.951000', 60, 'PG', 2006, 7, '0.99', '27.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Room Roman'), - ('A Boring Yarn of a Pioneer And a Feminist who must Redeem a Cat in An Abandoned Amusement Park', '''abandon'':19 ''amus'':20 ''bore'':4 ''cat'':16 ''desper'':2 ''feminist'':11 ''must'':13 ''park'':21 ''pioneer'':8 ''redeem'':14 ''villain'':1 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 76, 'PG-13', 2006, 4, '4.99', '27.99', ARRAY['Trailers', 'Commentaries']::text[], 'Villain Desperate'), - ('A Astounding Saga of a Monkey And a Moose who must Conquer a Butler in A Shark Tank', '''astound'':4 ''butler'':16 ''conquer'':14 ''deliver'':1 ''monkey'':8 ''moos'':11 ''mulholland'':2 ''must'':13 ''saga'':5 ''shark'':19 ''tank'':20', '1', '2013-05-26T14:50:58.951000', 100, 'R', 2006, 4, '0.99', '9.99', ARRAY['Deleted Scenes']::text[], 'Deliverance Mulholland'), - ('A Insightful Display of a Database Administrator And a Student who must Build a Hunter in Berlin', '''administr'':9 ''berlin'':19 ''build'':15 ''databas'':8 ''display'':5 ''hunter'':17 ''insight'':4 ''movi'':1 ''must'':14 ''shakespear'':2 ''student'':12', '1', '2013-05-26T14:50:58.951000', 53, 'PG', 2006, 6, '4.99', '27.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Movie Shakespeare'), - ('A Brilliant Display of a Frisbee And a Mad Scientist who must Succumb a Robot in Ancient China', '''ancient'':19 ''brilliant'':4 ''china'':20 ''display'':5 ''frisbe'':8 ''mad'':11 ''must'':14 ''robot'':17 ''scientist'':12 ''speed'':1 ''succumb'':15 ''suit'':2', '1', '2013-05-26T14:50:58.951000', 124, 'PG-13', 2006, 7, '4.99', '19.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Speed Suit'), - ('A Insightful Reflection of a Womanizer And a Husband who must Conquer a Pastry Chef in A Baloon', '''baloon'':20 ''chef'':17 ''conquer'':14 ''frisco'':2 ''husband'':11 ''insight'':4 ''jacket'':1 ''must'':13 ''pastri'':16 ''reflect'':5 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 181, 'PG-13', 2006, 5, '2.99', '16.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Jacket Frisco'), - ('A Astounding Character Study of a A Shark And a A Shark who must Discover a Crocodile in The Outback', '''astound'':4 ''charact'':5 ''crocodil'':19 ''discov'':17 ''dorado'':2 ''madigan'':1 ''must'':16 ''outback'':22 ''shark'':10,14 ''studi'':6', '1', '2013-05-26T14:50:58.951000', 116, 'R', 2006, 5, '4.99', '20.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Madigan Dorado'), - ('A Lacklusture Drama of a Student And a Monkey who must Sink a Womanizer in A MySQL Convention', '''convent'':20 ''cyclon'':1 ''drama'':5 ''famili'':2 ''lacklustur'':4 ''monkey'':11 ''must'':13 ''mysql'':19 ''sink'':14 ''student'':8 ''woman'':16', '1', '2013-05-26T14:50:58.951000', 176, 'PG', 2006, 7, '2.99', '18.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Cyclone Family'), - ('A Unbelieveable Character Study of a Womanizer And a Madman who must Reach a Man in The Outback', '''charact'':5 ''garden'':1 ''island'':2 ''madman'':12 ''man'':17 ''must'':14 ''outback'':20 ''reach'':15 ''studi'':6 ''unbeliev'':4 ''woman'':9', '1', '2013-05-26T14:50:58.951000', 80, 'G', 2006, 3, '4.99', '21.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Garden Island'), - ('A Boring Drama of a Dog And a Forensic Psychologist who must Outrace a Explorer in Ancient India', '''ancient'':19 ''bore'':4 ''chaplin'':1 ''dog'':8 ''drama'':5 ''explor'':17 ''forens'':11 ''india'':20 ''licens'':2 ''must'':14 ''outrac'':15 ''psychologist'':12', '1', '2013-05-26T14:50:58.951000', 146, 'NC-17', 2006, 7, '2.99', '26.99', ARRAY['Behind the Scenes']::text[], 'Chaplin License'), - ('A Thrilling Yarn of a Pastry Chef And a Monkey who must Battle a Monkey in A Shark Tank', '''battl'':15 ''chef'':9 ''giant'':2 ''monkey'':12,17 ''must'':14 ''pastri'':8 ''princess'':1 ''shark'':20 ''tank'':21 ''thrill'':4 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 71, 'NC-17', 2006, 3, '2.99', '29.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Princess Giant'), - ('A Insightful Character Study of a Feminist And a Pioneer who must Pursue a Pastry Chef in Nigeria', '''charact'':5 ''chef'':18 ''feminist'':9 ''frankenstein'':1 ''insight'':4 ''must'':14 ''nigeria'':20 ''pastri'':17 ''pioneer'':12 ''pursu'':15 ''stranger'':2 ''studi'':6', '1', '2013-05-26T14:50:58.951000', 159, 'NC-17', 2006, 7, '0.99', '16.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Frankenstein Stranger'), - ('A Fast-Paced Drama of a Pioneer And a Mad Cow who must Challenge a Madman in Ancient Japan', '''ancient'':21 ''challeng'':17 ''cow'':14 ''drama'':7 ''fast'':5 ''fast-pac'':4 ''japan'':22 ''mad'':13 ''madman'':19 ''must'':16 ''pace'':6 ''pioneer'':10 ''stranger'':2 ''trainspot'':1', '1', '2013-05-26T14:50:58.951000', 132, 'PG-13', 2006, 7, '4.99', '10.99', ARRAY['Trailers']::text[], 'Trainspotting Strangers'), - ('A Awe-Inspiring Epistle of a Teacher And a Feminist who must Confront a Pioneer in Ancient Japan', '''ancient'':20 ''awe'':5 ''awe-inspir'':4 ''confront'':16 ''epistl'':7 ''feminist'':13 ''inspir'':6 ''japan'':21 ''must'':15 ''pioneer'':18 ''teacher'':10 ''turn'':2 ''wife'':1', '1', '2013-05-26T14:50:58.951000', 183, 'NC-17', 2006, 3, '4.99', '27.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Wife Turn'), - ('A Emotional Display of a Boat And a Explorer who must Challenge a Madman in A MySQL Convention', '''apocalyps'':2 ''boat'':8 ''challeng'':14 ''convent'':20 ''display'':5 ''duffel'':1 ''emot'':4 ''explor'':11 ''madman'':16 ''must'':13 ''mysql'':19', '1', '2013-05-26T14:50:58.951000', 171, 'G', 2006, 5, '0.99', '13.99', ARRAY['Commentaries']::text[], 'Duffel Apocalypse'), - ('A Unbelieveable Drama of a Crocodile And a Mad Cow who must Reach a Dentist in A Shark Tank', '''connecticut'':1 ''cow'':12 ''crocodil'':8 ''dentist'':17 ''drama'':5 ''mad'':11 ''must'':14 ''reach'':15 ''shark'':20 ''tank'':21 ''tramp'':2 ''unbeliev'':4', '1', '2013-05-26T14:50:58.951000', 172, 'R', 2006, 4, '4.99', '20.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Connecticut Tramp'), - ('A Touching Saga of a Sumo Wrestler And a Cat who must Pursue a Mad Scientist in Nigeria', '''cat'':12 ''detect'':2 ''mad'':17 ''must'':14 ''name'':1 ''nigeria'':20 ''pursu'':15 ''saga'':5 ''scientist'':18 ''sumo'':8 ''touch'':4 ''wrestler'':9', '1', '2013-05-26T14:50:58.951000', 178, 'PG-13', 2006, 5, '4.99', '11.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Name Detective'), - ('A Unbelieveable Story of a Mad Scientist And a Technical Writer who must Discover a Composer in Ancient China', '''ancient'':20 ''china'':21 ''chocol'':1 ''compos'':18 ''discov'':16 ''duck'':2 ''mad'':8 ''must'':15 ''scientist'':9 ''stori'':5 ''technic'':12 ''unbeliev'':4 ''writer'':13', '1', '2013-05-26T14:50:58.951000', 132, 'R', 2006, 3, '2.99', '13.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Chocolate Duck'), - ('A Action-Packed Story of a Pioneer And a Technical Writer who must Discover a Forensic Psychologist in An Abandoned Amusement Park', '''abandon'':23 ''action'':5 ''action-pack'':4 ''amus'':24 ''daze'':1 ''discov'':17 ''forens'':19 ''must'':16 ''pack'':6 ''park'':25 ''pioneer'':10 ''psychologist'':20 ''punk'':2 ''stori'':7 ''technic'':13 ''writer'':14', '1', '2013-05-26T14:50:58.951000', 120, 'G', 2006, 6, '4.99', '20.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Dazed Punk'), - ('A Action-Packed Character Study of a Astronaut And a Explorer who must Reach a Monkey in A MySQL Convention', '''action'':5 ''action-pack'':4 ''astronaut'':11 ''charact'':7 ''convent'':23 ''explor'':14 ''monkey'':19 ''must'':16 ''mysql'':22 ''pack'':6 ''reach'':17 ''studi'':8 ''trip'':2 ''varsiti'':1', '1', '2013-05-26T14:50:58.951000', 85, 'NC-17', 2006, 7, '2.99', '14.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Varsity Trip'), - ('A Taut Reflection of a Teacher And a Database Administrator who must Chase a Madman in The Sahara Desert', '''administr'':12 ''chase'':15 ''databas'':11 ''desert'':21 ''madman'':17 ''must'':14 ''pluto'':2 ''reflect'':5 ''sahara'':20 ''taut'':4 ''teacher'':8 ''war'':1', '1', '2013-05-26T14:50:58.951000', 128, 'G', 2006, 5, '2.99', '15.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Wars Pluto'), - ('A Brilliant Character Study of a Frisbee And a Sumo Wrestler who must Confront a Woman in The Gulf of Mexico', '''brilliant'':4 ''charact'':5 ''confront'':16 ''frisbe'':9 ''gulf'':21 ''mexico'':23 ''must'':15 ''studi'':6 ''sumo'':12 ''suspect'':2 ''sweetheart'':1 ''woman'':18 ''wrestler'':13', '1', '2013-05-26T14:50:58.951000', 108, 'G', 2006, 3, '0.99', '13.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Sweethearts Suspects'), - ('A Epic Yarn of a Mad Scientist And a Cat who must Confront a Womanizer in A Baloon Factory', '''baloon'':20 ''cat'':12 ''confront'':15 ''epic'':4 ''factori'':21 ''liaison'':2 ''mad'':8 ''must'':14 ''oz'':1 ''scientist'':9 ''woman'':17 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 85, 'R', 2006, 4, '2.99', '14.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Oz Liaisons'), - ('A Action-Packed Drama of a Monkey And a Dentist who must Chase a Butler in Berlin', '''action'':5 ''action-pack'':4 ''berlin'':20 ''butler'':18 ''chase'':16 ''dentist'':13 ''drama'':7 ''innoc'':2 ''monkey'':10 ''must'':15 ''pack'':6 ''peach'':1', '1', '2013-05-26T14:50:58.951000', 160, 'PG-13', 2006, 3, '2.99', '20.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Peach Innocent'), - ('A Emotional Panorama of a Pioneer And a Composer who must Escape a Mad Scientist in A Jet Boat', '''badman'':1 ''boat'':21 ''compos'':11 ''dawn'':2 ''emot'':4 ''escap'':14 ''jet'':20 ''mad'':16 ''must'':13 ''panorama'':5 ''pioneer'':8 ''scientist'':17', '1', '2013-05-26T14:50:58.951000', 162, 'R', 2006, 6, '2.99', '22.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Badman Dawn'), - ('A Brilliant Documentary of a Butler And a Frisbee who must Build a Astronaut in New Orleans', '''astronaut'':16 ''brilliant'':4 ''build'':14 ''butler'':8 ''desert'':1 ''documentari'':5 ''frisbe'':11 ''must'':13 ''new'':18 ''orlean'':19 ''poseidon'':2', '1', '2013-05-26T14:50:58.951000', 64, 'R', 2006, 4, '4.99', '27.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Desert Poseidon'), - ('A Fast-Paced Tale of a Pastry Chef And a Boat who must Face a Frisbee in The Canadian Rockies', '''boat'':14 ''canadian'':22 ''chef'':11 ''divorc'':2 ''face'':17 ''fast'':5 ''fast-pac'':4 ''frisbe'':19 ''must'':16 ''pace'':6 ''pastri'':10 ''punk'':1 ''rocki'':23 ''tale'':7', '1', '2013-05-26T14:50:58.951000', 100, 'PG', 2006, 6, '4.99', '18.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Punk Divorce'), - ('A Beautiful Yarn of a Composer And a Mad Cow who must Redeem a Mad Scientist in A Jet Boat', '''beauti'':4 ''boat'':22 ''compos'':8 ''cow'':12 ''edg'':1 ''jet'':21 ''kiss'':2 ''mad'':11,17 ''must'':14 ''redeem'':15 ''scientist'':18 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 153, 'NC-17', 2006, 5, '4.99', '9.99', ARRAY['Deleted Scenes']::text[], 'Edge Kissing'), - ('A Lacklusture Panorama of a Dentist And a Forensic Psychologist who must Outrace a Pioneer in A U-Boat', '''boat'':22 ''dentist'':8 ''forens'':11 ''homicid'':2 ''lacklustur'':4 ''must'':14 ''outrac'':15 ''panorama'':5 ''pioneer'':17 ''psychologist'':12 ''talent'':1 ''u'':21 ''u-boat'':20', '1', '2013-05-26T14:50:58.951000', 173, 'PG', 2006, 6, '0.99', '9.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Talented Homicide'), - ('A Touching Epistle of a Crocodile And a Teacher who must Build a Forensic Psychologist in A MySQL Convention', '''build'':14 ''convent'':21 ''crocodil'':8 ''dream'':2 ''epistl'':5 ''forens'':16 ''must'':13 ''mysql'':20 ''psychologist'':17 ''stepmom'':1 ''teacher'':11 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 48, 'NC-17', 2006, 7, '4.99', '9.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Stepmom Dream'), - ('A Fateful Display of a Feminist And a Monkey who must Vanquish a Monkey in The Canadian Rockies', '''canadian'':19 ''display'':5 ''fate'':4 ''feminist'':8 ''giant'':1 ''monkey'':11,16 ''must'':13 ''rocki'':20 ''trooper'':2 ''vanquish'':14', '1', '2013-05-26T14:50:58.951000', 102, 'R', 2006, 5, '2.99', '10.99', ARRAY['Trailers', 'Commentaries']::text[], 'Giant Troopers'), - ('A Brilliant Panorama of a Dentist And a Moose who must Find a Student in The Gulf of Mexico', '''brilliant'':4 ''coldblood'':1 ''darl'':2 ''dentist'':8 ''find'':14 ''gulf'':19 ''mexico'':21 ''moos'':11 ''must'':13 ''panorama'':5 ''student'':16', '1', '2013-05-26T14:50:58.951000', 70, 'G', 2006, 7, '4.99', '27.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Coldblooded Darling'), - ('A Epic Reflection of a Pastry Chef And a Explorer who must Reach a Dentist in The Sahara Desert', '''chef'':9 ''dentist'':17 ''desert'':21 ''epic'':4 ''explor'':12 ''gunfight'':1 ''moon'':2 ''must'':14 ''pastri'':8 ''reach'':15 ''reflect'':5 ''sahara'':20', '1', '2013-05-26T14:50:58.951000', 70, 'NC-17', 2006, 5, '0.99', '16.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Gunfight Moon'), - ('A Amazing Panorama of a Pioneer And a Student who must Overcome a Mad Scientist in A Manhattan Penthouse', '''amaz'':4 ''mad'':16 ''manhattan'':20 ''must'':13 ''overcom'':14 ''panorama'':5 ''peach'':2 ''penthous'':21 ''pioneer'':8 ''scientist'':17 ''student'':11 ''voic'':1', '1', '2013-05-26T14:50:58.951000', 139, 'PG-13', 2006, 6, '0.99', '22.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Voice Peach'), - ('A Fanciful Documentary of a Crocodile And a Technical Writer who must Fight a A Shark in A Baloon', '''baloon'':21 ''cleopatra'':1 ''crocodil'':8 ''devil'':2 ''documentari'':5 ''fanci'':4 ''fight'':15 ''must'':14 ''shark'':18 ''technic'':11 ''writer'':12', '1', '2013-05-26T14:50:58.951000', 150, 'PG-13', 2006, 6, '0.99', '26.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Cleopatra Devil'), - ('A Brilliant Epistle of a Composer And a Database Administrator who must Vanquish a Mad Scientist in The First Manned Space Station', '''administr'':12 ''brilliant'':4 ''candid'':1 ''compos'':8 ''databas'':11 ''epistl'':5 ''first'':21 ''mad'':17 ''man'':22 ''must'':14 ''perdit'':2 ''scientist'':18 ''space'':23 ''station'':24 ''vanquish'':15', '1', '2013-05-26T14:50:58.951000', 70, 'R', 2006, 4, '2.99', '10.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Candidate Perdition'), - ('A Fateful Saga of a Waitress And a Hunter who must Outrace a Sumo Wrestler in Australia', '''australia'':19 ''encino'':2 ''fate'':4 ''high'':1 ''hunter'':11 ''must'':13 ''outrac'':14 ''saga'':5 ''sumo'':16 ''waitress'':8 ''wrestler'':17', '1', '2013-05-26T14:50:58.951000', 84, 'R', 2006, 3, '2.99', '23.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'High Encino'), - ('A Thoughtful Drama of a Composer And a Feminist who must Meet a Secret Agent in The Canadian Rockies', '''agent'':17 ''alter'':1 ''canadian'':20 ''compos'':8 ''drama'':5 ''feminist'':11 ''meet'':14 ''must'':13 ''rocki'':21 ''secret'':16 ''thought'':4 ''victori'':2', '1', '2013-05-26T14:50:58.951000', 57, 'PG-13', 2006, 6, '0.99', '27.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Alter Victory'), - ('A Epic Yarn of a Forensic Psychologist And a Teacher who must Face a Lumberjack in California', '''california'':19 ''desper'':1 ''epic'':4 ''face'':15 ''forens'':8 ''lumberjack'':17 ''must'':14 ''psychologist'':9 ''teacher'':12 ''trainspot'':2 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 81, 'G', 2006, 7, '4.99', '29.99', ARRAY['Deleted Scenes']::text[], 'Desperate Trainspotting'), - ('A Boring Reflection of a Secret Agent And a Astronaut who must Face a Composer in A Manhattan Penthouse', '''agent'':9 ''astronaut'':12 ''bore'':4 ''compos'':17 ''face'':15 ''manhattan'':20 ''must'':14 ''none'':1 ''penthous'':21 ''reflect'':5 ''secret'':8 ''spike'':2', '1', '2013-05-26T14:50:58.951000', 83, 'NC-17', 2006, 3, '0.99', '18.99', ARRAY['Trailers', 'Commentaries']::text[], 'None Spiking'), - ('A Fanciful Documentary of a Womanizer And a Boat who must Defeat a Madman in The First Manned Space Station', '''bever'':1 ''boat'':11 ''defeat'':14 ''documentari'':5 ''fanci'':4 ''first'':19 ''madman'':16 ''man'':20 ''must'':13 ''outlaw'':2 ''space'':21 ''station'':22 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 85, 'R', 2006, 3, '2.99', '21.99', ARRAY['Trailers']::text[], 'Beverly Outlaw'), - ('A Amazing Display of a Composer And a Forensic Psychologist who must Discover a Car in The Canadian Rockies', '''amaz'':4 ''canadian'':20 ''car'':17 ''compos'':8 ''discov'':15 ''display'':5 ''forens'':11 ''gleam'':1 ''jawbreak'':2 ''must'':14 ''psychologist'':12 ''rocki'':21', '1', '2013-05-26T14:50:58.951000', 89, 'NC-17', 2006, 5, '2.99', '25.99', ARRAY['Trailers', 'Commentaries']::text[], 'Gleaming Jawbreaker'), - ('A Taut Epistle of a Monkey And a Boy who must Confront a Husband in A Jet Boat', '''boat'':20 ''boy'':11 ''confront'':14 ''epistl'':5 ''husband'':16 ''jet'':19 ''monkey'':8 ''must'':13 ''octob'':1 ''submarin'':2 ''taut'':4', '1', '2013-05-26T14:50:58.951000', 54, 'PG-13', 2006, 6, '4.99', '10.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'October Submarine'), - ('A Astounding Character Study of a Womanizer And a Hunter who must Escape a Robot in A Monastery', '''astound'':4 ''charact'':5 ''escap'':15 ''hunter'':12 ''monasteri'':20 ''must'':14 ''robot'':17 ''side'':2 ''studi'':6 ''window'':1 ''woman'':9', '1', '2013-05-26T14:50:58.951000', 85, 'R', 2006, 3, '2.99', '25.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Window Side'), - ('A Touching Documentary of a Madman And a Mad Scientist who must Outrace a Feminist in An Abandoned Mine Shaft', '''abandon'':20 ''documentari'':5 ''feminist'':17 ''mad'':11 ''madman'':8 ''mine'':21 ''must'':14 ''outrac'':15 ''pelican'':2 ''scientist'':12 ''shaft'':22 ''thief'':1 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 135, 'PG-13', 2006, 5, '4.99', '28.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Thief Pelican'), - ('A Brilliant Documentary of a Astronaut And a Squirrel who must Succumb a Student in The Gulf of Mexico', '''astronaut'':8 ''break'':2 ''brilliant'':4 ''darl'':1 ''documentari'':5 ''gulf'':19 ''mexico'':21 ''must'':13 ''squirrel'':11 ''student'':16 ''succumb'':14', '1', '2013-05-26T14:50:58.951000', 165, 'PG-13', 2006, 7, '4.99', '20.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Darling Breaking'), - ('A Awe-Inspiring Saga of a Composer And a Frisbee who must Succumb a Pioneer in The Sahara Desert', '''awe'':5 ''awe-inspir'':4 ''compos'':10 ''desert'':22 ''frisbe'':13 ''inspir'':6 ''labyrinth'':1 ''leagu'':2 ''must'':15 ''pioneer'':18 ''saga'':7 ''sahara'':21 ''succumb'':16', '1', '2013-05-26T14:50:58.951000', 46, 'PG-13', 2006, 6, '2.99', '24.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Labyrinth League'), - ('A Lacklusture Drama of a Girl And a Technical Writer who must Redeem a Monkey in A Shark Tank', '''drama'':5 ''girl'':8 ''harri'':2 ''lacklustur'':4 ''louisiana'':1 ''monkey'':17 ''must'':14 ''redeem'':15 ''shark'':20 ''tank'':21 ''technic'':11 ''writer'':12', '1', '2013-05-26T14:50:58.951000', 70, 'PG-13', 2006, 5, '0.99', '18.99', ARRAY['Trailers']::text[], 'Louisiana Harry'), - ('A Thoughtful Panorama of a Database Administrator And a Mad Scientist who must Outgun a Mad Scientist in A Jet Boat', '''administr'':9 ''alabama'':1 ''boat'':23 ''databas'':8 ''devil'':2 ''jet'':22 ''mad'':12,18 ''must'':15 ''outgun'':16 ''panorama'':5 ''scientist'':13,19 ''thought'':4', '1', '2013-05-26T14:50:58.951000', 114, 'PG-13', 2006, 3, '2.99', '21.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Alabama Devil'), - ('A Intrepid Panorama of a Womanizer And a Girl who must Escape a Girl in A Manhattan Penthouse', '''escap'':14 ''fight'':1 ''girl'':11,16 ''intrepid'':4 ''jawbreak'':2 ''manhattan'':19 ''must'':13 ''panorama'':5 ''penthous'':20 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 91, 'R', 2006, 3, '0.99', '13.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Fight Jawbreaker'), - ('A Stunning Epistle of a Sumo Wrestler And a Man who must Challenge a Waitress in Ancient India', '''ancient'':19 ''challeng'':15 ''epistl'':5 ''goldfing'':2 ''india'':20 ''man'':12 ''must'':14 ''silverado'':1 ''stun'':4 ''sumo'':8 ''waitress'':17 ''wrestler'':9', '1', '2013-05-26T14:50:58.951000', 74, 'PG', 2006, 4, '4.99', '11.99', ARRAY['Trailers', 'Commentaries']::text[], 'Silverado Goldfinger'), - ('A Emotional Display of a Man And a Explorer who must Build a Boy in A Manhattan Penthouse', '''boy'':16 ''build'':14 ''cleopatra'':2 ''display'':5 ''emot'':4 ''explor'':11 ''lesson'':1 ''man'':8 ''manhattan'':19 ''must'':13 ''penthous'':20', '1', '2013-05-26T14:50:58.951000', 167, 'NC-17', 2006, 3, '0.99', '28.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Lesson Cleopatra'), - ('A Awe-Inspiring Documentary of a Womanizer And a Pastry Chef who must Kill a Lumberjack in Berlin', '''awe'':5 ''awe-inspir'':4 ''berlin'':21 ''chef'':14 ''documentari'':7 ''inspir'':6 ''kill'':17 ''lumberjack'':19 ''must'':16 ''pastri'':13 ''pilot'':2 ''tootsi'':1 ''woman'':10', '1', '2013-05-26T14:50:58.951000', 157, 'PG', 2006, 3, '0.99', '10.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Tootsie Pilot'), - ('A Intrepid Saga of a Man And a Lumberjack who must Vanquish a Husband in The Outback', '''freddi'':1 ''husband'':16 ''intrepid'':4 ''lumberjack'':11 ''man'':8 ''must'':13 ''outback'':19 ''saga'':5 ''storm'':2 ''vanquish'':14', '1', '2013-05-26T14:50:58.951000', 65, 'NC-17', 2006, 6, '4.99', '21.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Freddy Storm'), - ('A Lacklusture Epistle of a Database Administrator And a Woman who must Meet a Hunter in An Abandoned Mine Shaft', '''abandon'':20 ''administr'':9 ''affair'':2 ''databas'':8 ''epistl'':5 ''hunter'':17 ''hurrican'':1 ''lacklustur'':4 ''meet'':15 ''mine'':21 ''must'':14 ''shaft'':22 ''woman'':12', '1', '2013-05-26T14:50:58.951000', 49, 'PG', 2006, 6, '2.99', '11.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Hurricane Affair'), - ('A Fanciful Panorama of a Mad Scientist And a Woman who must Pursue a Astronaut in Ancient India', '''ancient'':19 ''astronaut'':17 ''enemi'':1 ''fanci'':4 ''india'':20 ''mad'':8 ''must'':14 ''odd'':2 ''panorama'':5 ''pursu'':15 ''scientist'':9 ''woman'':12', '1', '2013-05-26T14:50:58.951000', 77, 'NC-17', 2006, 5, '4.99', '23.99', ARRAY['Trailers']::text[], 'Enemy Odds'), - ('A Epic Drama of a Mad Scientist And a Explorer who must Succumb a Waitress in An Abandoned Fun House', '''abandon'':20 ''drama'':5 ''epic'':4 ''explor'':12 ''fun'':21 ''hous'':22 ''mad'':8 ''miracl'':2 ''must'':14 ''scientist'':9 ''sky'':1 ''succumb'':15 ''waitress'':17', '1', '2013-05-26T14:50:58.951000', 132, 'PG', 2006, 7, '2.99', '15.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Sky Miracle'), - ('A Insightful Yarn of a A Shark And a Pastry Chef who must Face a Boy in A Monastery', '''boy'':18 ''casualti'':1 ''chef'':13 ''encino'':2 ''face'':16 ''insight'':4 ''monasteri'':21 ''must'':15 ''pastri'':12 ''shark'':9 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 179, 'G', 2006, 3, '4.99', '16.99', ARRAY['Trailers']::text[], 'Casualties Encino'), - ('A Brilliant Panorama of a Technical Writer And a Lumberjack who must Escape a Butler in Ancient India', '''ancient'':19 ''brilliant'':4 ''butler'':17 ''chinatown'':1 ''escap'':15 ''gladiat'':2 ''india'':20 ''lumberjack'':12 ''must'':14 ''panorama'':5 ''technic'':8 ''writer'':9', '1', '2013-05-26T14:50:58.951000', 61, 'PG', 2006, 7, '4.99', '24.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Chinatown Gladiator'), - ('A Awe-Inspiring Story of a Monkey And a Pastry Chef who must Succumb a Womanizer in A MySQL Convention', '''awe'':5 ''awe-inspir'':4 ''chef'':14 ''convent'':23 ''inspir'':6 ''intent'':2 ''intoler'':1 ''monkey'':10 ''must'':16 ''mysql'':22 ''pastri'':13 ''stori'':7 ''succumb'':17 ''woman'':19', '1', '2013-05-26T14:50:58.951000', 63, 'PG-13', 2006, 6, '4.99', '20.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Intolerable Intentions'), - ('A Epic Tale of a Robot And a Monkey who must Vanquish a Man in New Orleans', '''bride'':1 ''epic'':4 ''intrigu'':2 ''man'':16 ''monkey'':11 ''must'':13 ''new'':18 ''orlean'':19 ''robot'':8 ''tale'':5 ''vanquish'':14', '1', '2013-05-26T14:50:58.951000', 56, 'G', 2006, 7, '0.99', '24.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Bride Intrigue'), - ('A Emotional Story of a Feminist And a Feminist who must Escape a Pastry Chef in A MySQL Convention', '''bunch'':1 ''chef'':17 ''convent'':21 ''emot'':4 ''escap'':14 ''feminist'':8,11 ''mind'':2 ''must'':13 ''mysql'':20 ''pastri'':16 ''stori'':5', '1', '2013-05-26T14:50:58.951000', 63, 'G', 2006, 4, '2.99', '13.99', ARRAY['Behind the Scenes']::text[], 'Bunch Minds'), - ('A Touching Reflection of a Database Administrator And a Madman who must Build a Lumberjack in Nigeria', '''administr'':9 ''build'':15 ''cider'':2 ''databas'':8 ''lumberjack'':17 ''madman'':12 ''must'':14 ''nigeria'':19 ''reflect'':5 ''touch'':4 ''traci'':1', '1', '2013-05-26T14:50:58.951000', 142, 'G', 2006, 3, '0.99', '29.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Tracy Cider'), - ('A Lacklusture Saga of a Boy And a Cat who must Sink a Dentist in An Abandoned Mine Shaft', '''abandon'':19 ''boy'':8 ''cat'':11 ''dentist'':16 ''lacklustur'':4 ''mine'':20 ''must'':13 ''saga'':5 ''shaft'':21 ''side'':2 ''sink'':14 ''stori'':1', '1', '2013-05-26T14:50:58.951000', 163, 'R', 2006, 7, '0.99', '27.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Story Side'), - ('A Insightful Documentary of a Waitress And a Butler who must Vanquish a Composer in Australia', '''australia'':18 ''butler'':11 ''compos'':16 ''documentari'':5 ''dorado'':2 ''insight'':4 ''must'':13 ''vanquish'':14 ''waitress'':8 ''women'':1', '1', '2013-05-26T14:50:58.951000', 126, 'R', 2006, 4, '0.99', '23.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Women Dorado'), - ('A Fast-Paced Display of a Squirrel And a Composer who must Fight a Forensic Psychologist in A Jet Boat', '''boat'':23 ''compos'':13 ''display'':7 ''fast'':5 ''fast-pac'':4 ''fight'':16 ''forens'':18 ''jet'':22 ''must'':15 ''pace'':6 ''psychologist'':19 ''queen'':2 ''soror'':1 ''squirrel'':10', '1', '2013-05-26T14:50:58.951000', 184, 'NC-17', 2006, 6, '0.99', '17.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Sorority Queen'), - ('A Intrepid Character Study of a Man And a Frisbee who must Overcome a Madman in Ancient China', '''ancient'':19 ''charact'':5 ''china'':20 ''frisbe'':12 ''intrepid'':4 ''madman'':17 ''man'':9 ''must'':14 ''oper'':1,2 ''overcom'':15 ''studi'':6', '1', '2013-05-26T14:50:58.951000', 156, 'G', 2006, 7, '2.99', '23.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Operation Operation'), - ('A Touching Epistle of a Butler And a Boy who must Find a Mad Scientist in The Sahara Desert', '''boy'':11 ''butler'':8 ''desert'':21 ''epistl'':5 ''find'':14 ''mad'':16 ''miracl'':1 ''must'':13 ''sahara'':20 ''scientist'':17 ''touch'':4 ''virtual'':2', '1', '2013-05-26T14:50:58.951000', 162, 'PG-13', 2006, 3, '2.99', '19.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Miracle Virtual'), - ('A Thrilling Documentary of a Husband And a Feminist who must Face a Mad Scientist in Ancient China', '''ancient'':19 ''china'':20 ''control'':2 ''documentari'':5 ''face'':14 ''feminist'':11 ''husband'':8 ''mad'':16 ''must'':13 ''scientist'':17 ''smoochi'':1 ''thrill'':4', '1', '2013-05-26T14:50:58.951000', 184, 'R', 2006, 7, '0.99', '18.99', ARRAY['Behind the Scenes']::text[], 'Smoochy Control'), - ('A Thrilling Documentary of a Composer And a Secret Agent who must Succumb a Cat in Berlin', '''agent'':12 ''berlin'':19 ''cat'':17 ''compos'':8 ''documentari'':5 ''interview'':2 ''must'':14 ''patton'':1 ''secret'':11 ''succumb'':15 ''thrill'':4', '1', '2013-05-26T14:50:58.951000', 175, 'PG', 2006, 4, '2.99', '22.99', ARRAY['Commentaries']::text[], 'Patton Interview'), - ('A Intrepid Tale of a Madman And a Astronaut who must Challenge a Hunter in A Monastery', '''astronaut'':11 ''challeng'':14 ''hunter'':16 ''intrepid'':4 ''madman'':8 ''monasteri'':19 ''must'':13 ''past'':1 ''suicid'':2 ''tale'':5', '1', '2013-05-26T14:50:58.951000', 157, 'PG-13', 2006, 5, '4.99', '17.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Past Suicides'), - ('A Fast-Paced Reflection of a Technical Writer And a Student who must Fight a Boy in The Canadian Rockies', '''boy'':19 ''brannigan'':2 ''canadian'':22 ''fast'':5 ''fast-pac'':4 ''fight'':17 ''hole'':1 ''must'':16 ''pace'':6 ''reflect'':7 ''rocki'':23 ''student'':14 ''technic'':10 ''writer'':11', '1', '2013-05-26T14:50:58.951000', 128, 'PG', 2006, 7, '4.99', '27.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Holes Brannigan'), - ('A Brilliant Panorama of a Hunter And a Explorer who must Pursue a Dentist in An Abandoned Fun House', '''abandon'':19 ''brilliant'':4 ''dentist'':16 ''explor'':11 ''fun'':20 ''hous'':21 ''hunter'':8 ''love'':1 ''must'':13 ''panorama'':5 ''pursu'':14 ''suicid'':2', '1', '2013-05-26T14:50:58.951000', 181, 'R', 2006, 6, '0.99', '21.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Love Suicides'), - ('A Fast-Paced Display of a Lumberjack And a Mad Scientist who must Succumb a Sumo Wrestler in The Sahara Desert', '''desert'':24 ''display'':7 ''fast'':5 ''fast-pac'':4 ''lumberjack'':10 ''mad'':13 ''must'':16 ''pace'':6 ''sahara'':23 ''scientist'':14 ''succumb'':17 ''sumo'':19 ''tarzan'':1 ''videotap'':2 ''wrestler'':20', '1', '2013-05-26T14:50:58.951000', 91, 'PG-13', 2006, 3, '2.99', '11.99', ARRAY['Trailers']::text[], 'Tarzan Videotape'), - ('A Thrilling Yarn of a Pastry Chef And a A Shark who must Challenge a Mad Scientist in The Outback', '''challeng'':16 ''chef'':9 ''happi'':2 ''hotel'':1 ''mad'':18 ''must'':15 ''outback'':22 ''pastri'':8 ''scientist'':19 ''shark'':13 ''thrill'':4 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 181, 'PG-13', 2006, 6, '4.99', '28.99', ARRAY['Behind the Scenes']::text[], 'Hotel Happiness'), - ('A Beautiful Story of a Dog And a Technical Writer who must Outgun a Student in A Baloon', '''baloon'':20 ''beauti'':4 ''dog'':8 ''mix'':2 ''must'':14 ''outgun'':15 ''potluck'':1 ''stori'':5 ''student'':17 ''technic'':11 ''writer'':12', '1', '2013-05-26T14:50:58.951000', 179, 'G', 2006, 3, '2.99', '10.99', ARRAY['Behind the Scenes']::text[], 'Potluck Mixed'), - ('A Stunning Tale of a Mad Cow And a Boy who must Battle a Boy in Berlin', '''battl'':15 ''berlin'':19 ''boy'':12,17 ''cow'':9 ''curtain'':2 ''mad'':8 ''manchurian'':1 ''must'':14 ''stun'':4 ''tale'':5', '1', '2013-05-26T14:50:58.951000', 177, 'PG', 2006, 5, '2.99', '27.99', ARRAY['Trailers', 'Commentaries']::text[], 'Manchurian Curtain'), - ('A Beautiful Reflection of a Monkey And a Dentist who must Face a Database Administrator in Ancient Japan', '''administr'':17 ''ancient'':19 ''beauti'':4 ''databas'':16 ''dentist'':11 ''desir'':2 ''devil'':1 ''face'':14 ''japan'':20 ''monkey'':8 ''must'':13 ''reflect'':5', '1', '2013-05-26T14:50:58.951000', 87, 'R', 2006, 6, '4.99', '12.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Devil Desire'), - ('A Thoughtful Character Study of a Waitress And a Feminist who must Build a Teacher in Ancient Japan', '''ancient'':19 ''armageddon'':2 ''build'':15 ''charact'':5 ''feminist'':12 ''japan'':20 ''mosquito'':1 ''must'':14 ''studi'':6 ''teacher'':17 ''thought'':4 ''waitress'':9', '1', '2013-05-26T14:50:58.951000', 57, 'G', 2006, 6, '0.99', '22.99', ARRAY['Trailers']::text[], 'Mosquito Armageddon'), - ('A Emotional Epistle of a Boat And a Mad Scientist who must Outrace a Robot in An Abandoned Mine Shaft', '''abandon'':20 ''ameli'':2 ''boat'':8 ''emot'':4 ''epistl'':5 ''illus'':1 ''mad'':11 ''mine'':21 ''must'':14 ''outrac'':15 ''robot'':17 ''scientist'':12 ''shaft'':22', '1', '2013-05-26T14:50:58.951000', 122, 'R', 2006, 4, '0.99', '15.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Illusion Amelie'), - ('A Amazing Display of a Robot And a Astronaut who must Fight a Womanizer in Berlin', '''amaz'':4 ''astronaut'':11 ''berlin'':18 ''display'':5 ''fight'':14 ''idaho'':2 ''must'':13 ''robot'':8 ''woman'':16 ''yentl'':1', '1', '2013-05-26T14:50:58.951000', 86, 'R', 2006, 5, '4.99', '11.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Yentl Idaho'), - ('A Awe-Inspiring Documentary of a Technical Writer And a Husband who must Meet a Monkey in An Abandoned Fun House', '''abandon'':22 ''apollo'':2 ''awe'':5 ''awe-inspir'':4 ''documentari'':7 ''fun'':23 ''hous'':24 ''husband'':14 ''inspir'':6 ''meet'':17 ''monkey'':19 ''must'':16 ''scorpion'':1 ''technic'':10 ''writer'':11', '1', '2013-05-26T14:50:58.951000', 137, 'NC-17', 2006, 3, '4.99', '23.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Scorpion Apollo'), - ('A Insightful Panorama of a Crocodile And a Boat who must Conquer a Sumo Wrestler in A MySQL Convention', '''boat'':11 ''conquer'':14 ''convent'':21 ''crocodil'':8 ''gold'':2 ''insight'':4 ''must'':13 ''mysql'':20 ''panorama'':5 ''sumo'':16 ''swarm'':1 ''wrestler'':17', '1', '2013-05-26T14:50:58.951000', 123, 'PG-13', 2006, 4, '0.99', '12.99', ARRAY['Trailers', 'Commentaries']::text[], 'Swarm Gold'), - ('A Intrepid Saga of a Man And a Forensic Psychologist who must Reach a Squirrel in A Monastery', '''divid'':1 ''forens'':11 ''intrepid'':4 ''man'':8 ''monasteri'':20 ''monster'':2 ''must'':14 ''psychologist'':12 ''reach'':15 ''saga'':5 ''squirrel'':17', '1', '2013-05-26T14:50:58.951000', 68, 'PG-13', 2006, 6, '2.99', '13.99', ARRAY['Trailers', 'Commentaries']::text[], 'Divide Monster'), - ('A Thoughtful Story of a Astronaut And a Composer who must Conquer a Dog in The Sahara Desert', '''astronaut'':8 ''compos'':11 ''conquer'':14 ''desert'':20 ''dog'':16 ''hanki'':2 ''must'':13 ''outlaw'':1 ''sahara'':19 ''stori'':5 ''thought'':4', '1', '2013-05-26T14:50:58.951000', 148, 'PG-13', 2006, 7, '4.99', '17.99', ARRAY['Trailers', 'Commentaries']::text[], 'Outlaw Hanky'), - ('A Fateful Display of a Waitress And a Dentist who must Reach a Butler in Nigeria', '''butler'':16 ''craft'':2 ''dentist'':11 ''display'':5 ''everyon'':1 ''fate'':4 ''must'':13 ''nigeria'':18 ''reach'':14 ''waitress'':8', '1', '2013-05-26T14:50:58.951000', 163, 'PG', 2006, 4, '0.99', '29.99', ARRAY['Trailers', 'Commentaries']::text[], 'Everyone Craft'), - ('A Boring Reflection of a Lumberjack And a Feminist who must Discover a Woman in Nigeria', '''amistad'':2 ''bore'':4 ''catch'':1 ''discov'':14 ''feminist'':11 ''lumberjack'':8 ''must'':13 ''nigeria'':18 ''reflect'':5 ''woman'':16', '1', '2013-05-26T14:50:58.951000', 183, 'G', 2006, 7, '0.99', '10.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Catch Amistad'), - ('A Touching Epistle of a Monkey And a Feminist who must Discover a Boat in Berlin', '''berlin'':18 ''boat'':16 ''discov'':14 ''epistl'':5 ''feminist'':11 ''jump'':1 ''monkey'':8 ''must'':13 ''touch'':4 ''wrath'':2', '1', '2013-05-26T14:50:58.951000', 74, 'NC-17', 2006, 4, '0.99', '18.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Jumping Wrath'), - ('A Fateful Tale of a Man And a Feminist who must Conquer a Crocodile in A Manhattan Penthouse', '''conquer'':14 ''crocodil'':16 ''fate'':4 ''feminist'':11 ''gilbert'':1 ''man'':8 ''manhattan'':19 ''must'':13 ''pelican'':2 ''penthous'':20 ''tale'':5', '1', '2013-05-26T14:50:58.951000', 114, 'G', 2006, 7, '0.99', '13.99', ARRAY['Trailers', 'Commentaries']::text[], 'Gilbert Pelican'), - ('A Fast-Paced Documentary of a Technical Writer And a Pastry Chef who must Escape a Moose in A U-Boat', '''boat'':25 ''chef'':15 ''documentari'':7 ''escap'':18 ''fast'':5 ''fast-pac'':4 ''moos'':20 ''must'':17 ''pace'':6 ''pastri'':14 ''sea'':1 ''technic'':10 ''u'':24 ''u-boat'':23 ''virgin'':2 ''writer'':11', '1', '2013-05-26T14:50:58.951000', 80, 'PG', 2006, 4, '2.99', '24.99', ARRAY['Deleted Scenes']::text[], 'Sea Virgin'), - ('A Emotional Display of a Pioneer And a Technical Writer who must Battle a Man in A Baloon', '''amadeus'':1 ''baloon'':20 ''battl'':15 ''display'':5 ''emot'':4 ''holi'':2 ''man'':17 ''must'':14 ''pioneer'':8 ''technic'':11 ''writer'':12', '1', '2013-05-26T14:50:58.951000', 113, 'PG', 2006, 6, '0.99', '20.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Amadeus Holy'), - ('A Thoughtful Documentary of a Dog And a Man who must Sink a Man in A Shark Tank', '''documentari'':5 ''dog'':8 ''man'':11,16 ''must'':13 ''shark'':19 ''sink'':14 ''tank'':20 ''thought'':4 ''torqu'':2 ''vision'':1', '1', '2013-05-26T14:50:58.951000', 59, 'PG-13', 2006, 5, '0.99', '16.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Vision Torque'), - ('A Thrilling Story of a Cat And a Waitress who must Fight a Explorer in The Outback', '''cat'':8 ''drive'':2 ''explor'':16 ''eye'':1 ''fight'':14 ''must'':13 ''outback'':19 ''stori'':5 ''thrill'':4 ''waitress'':11', '1', '2013-05-26T14:50:58.951000', 172, 'PG-13', 2006, 4, '2.99', '13.99', ARRAY['Trailers', 'Commentaries']::text[], 'Eyes Driving'), - ('A Fateful Display of a Monkey And a Car who must Sink a Husband in A MySQL Convention', '''car'':11 ''convent'':20 ''display'':5 ''fate'':4 ''hurrican'':2 ''husband'':16 ''monkey'':8 ''must'':13 ''mysql'':19 ''sink'':14 ''tower'':1', '1', '2013-05-26T14:50:58.951000', 144, 'NC-17', 2006, 7, '0.99', '14.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Towers Hurricane'), - ('A Amazing Epistle of a Girl And a Woman who must Outrace a Waitress in Soviet Georgia', '''amaz'':4 ''epistl'':5 ''georgia'':19 ''girl'':8 ''kick'':2 ''must'':13 ''outrac'':14 ''soviet'':18 ''taxi'':1 ''waitress'':16 ''woman'':11', '1', '2013-05-26T14:50:58.951000', 64, 'PG-13', 2006, 4, '0.99', '23.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Taxi Kick'), - ('A Fateful Display of a Womanizer And a Mad Scientist who must Outgun a A Shark in Soviet Georgia', '''beach'':1 ''display'':5 ''fate'':4 ''georgia'':21 ''heartbreak'':2 ''mad'':11 ''must'':14 ''outgun'':15 ''scientist'':12 ''shark'':18 ''soviet'':20 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 122, 'G', 2006, 6, '2.99', '16.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Beach Heartbreakers'), - ('A Emotional Character Study of a Hunter And a Car who must Kill a Woman in Berlin', '''berlin'':19 ''car'':12 ''charact'':5 ''emot'':4 ''hard'':1 ''hunter'':9 ''kill'':15 ''must'':14 ''robber'':2 ''studi'':6 ''woman'':17', '1', '2013-05-26T14:50:58.951000', 72, 'R', 2006, 7, '2.99', '15.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Hardly Robbers') - ) AS data(description, fulltext, old_language_id, last_update, length, rating, release_year, rental_duration, rental_rate, replacement_cost, special_features, title) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."language"' - AND map0.old_id = data.old_language_id - RETURNING film_id - ) - SELECT array_agg(film_id) INTO v_new_ids_film FROM inserted; - - FOR i IN 1..array_length(v_new_ids_film, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."film"', v_old_ids_film[i], v_new_ids_film[i]::TEXT); - END LOOP; - - v_old_ids_film := ARRAY['73', '94', '329', '484', '579', '78', '161', '898', '601', '885', '92', '863', '920', '338', '522', '681', '650', '6', '345', '664', '767', '791', '872', '396', '432', '486', '592', '21', '122', '163', '709', '847', '744', '710', '866', '277', '967', '604', '80', '718', '972', '762', '742', '864', '409', '916', '949', '882', '683', '751', '193', '775', '975', '680', '204', '56', '102', '595', '991', '580', '100', '558', '725', '756', '342', '615', '312', '15', '494', '630', '27', '827', '565', '382', '231', '587', '581', '924', '720', '262', '946', '862', '900', '682', '708', '938', '758', '265', '685', '35', '392', '804', '815', '574', '430', '721', '706', '693', '39', '196']; - WITH inserted AS ( - INSERT INTO "public"."film" ("description", "fulltext", "language_id", "last_update", "length", "rating", "release_year", "rental_duration", "rental_rate", "replacement_cost", "special_features", "title") - SELECT - data.description::text, - data.fulltext::tsvector, - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.length::smallint, - data.rating::mpaa_rating, - data.release_year::integer, - data.rental_duration::smallint, - data.rental_rate::numeric, - data.replacement_cost::numeric, - data.special_features::text[], - data.title::character varying - FROM (VALUES - ('A Touching Tale of a Girl And a Crocodile who must Discover a Waitress in Nigeria', '''bingo'':1 ''crocodil'':11 ''discov'':14 ''girl'':8 ''must'':13 ''nigeria'':18 ''tale'':5 ''talent'':2 ''touch'':4 ''waitress'':16', '1', '2013-05-26T14:50:58.951000', 150, 'PG-13', 2006, 5, '2.99', '22.99', ARRAY['Trailers', 'Commentaries']::text[], 'Bingo Talented'), - ('A Insightful Story of a Dog And a Pastry Chef who must Battle a Girl in Berlin', '''battl'':15 ''berlin'':19 ''braveheart'':1 ''chef'':12 ''dog'':8 ''girl'':17 ''human'':2 ''insight'':4 ''must'':14 ''pastri'':11 ''stori'':5', '1', '2013-05-26T14:50:58.951000', 176, 'PG-13', 2006, 7, '2.99', '14.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Braveheart Human'), - ('A Thrilling Documentary of a Forensic Psychologist And a Butler who must Defeat a Explorer in A Jet Boat', '''boat'':21 ''butler'':12 ''defeat'':15 ''documentari'':5 ''explor'':17 ''forens'':8 ''forrest'':1 ''jet'':20 ''must'':14 ''psychologist'':9 ''son'':2 ''thrill'':4', '1', '2013-05-26T14:50:58.951000', 63, 'R', 2006, 4, '2.99', '15.99', ARRAY['Commentaries']::text[], 'Forrest Sons'), - ('A Touching Character Study of a Pastry Chef And a Database Administrator who must Reach a A Shark in Ancient Japan', '''administr'':14 ''ancient'':22 ''charact'':5 ''chef'':10 ''databas'':13 ''japan'':23 ''jerk'':1 ''must'':16 ''pastri'':9 ''paycheck'':2 ''reach'':17 ''shark'':20 ''studi'':6 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 172, 'NC-17', 2006, 3, '2.99', '13.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Jerk Paycheck'), - ('A Taut Yarn of a Mad Scientist And a Crocodile who must Outgun a Database Administrator in A Monastery', '''administr'':18 ''crocodil'':12 ''databas'':17 ''mad'':8 ''mind'':1 ''monasteri'':21 ''must'':14 ''outgun'':15 ''scientist'':9 ''taut'':4 ''truman'':2 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 149, 'PG-13', 2006, 3, '4.99', '22.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Minds Truman'), - ('A Intrepid Yarn of a Pastry Chef And a Mad Scientist who must Challenge a Secret Agent in Ancient Japan', '''agent'':19 ''ancient'':21 ''blackout'':1 ''challeng'':16 ''chef'':9 ''intrepid'':4 ''japan'':22 ''mad'':12 ''must'':15 ''pastri'':8 ''privat'':2 ''scientist'':13 ''secret'':18 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 85, 'PG', 2006, 7, '2.99', '12.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Blackout Private'), - ('A Taut Tale of a Butler And a Mad Scientist who must Build a Crocodile in Ancient China', '''ancient'':19 ''build'':15 ''butler'':8 ''china'':20 ''clue'':1 ''crocodil'':17 ''grail'':2 ''mad'':11 ''must'':14 ''scientist'':12 ''tale'':5 ''taut'':4', '1', '2013-05-26T14:50:58.951000', 70, 'NC-17', 2006, 6, '4.99', '27.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Clue Grail'), - ('A Boring Story of a Butler And a Astronaut who must Outrace a Pioneer in Australia', '''astronaut'':11 ''australia'':18 ''bore'':4 ''butler'':8 ''must'':13 ''outrac'':14 ''pelican'':2 ''pioneer'':16 ''stori'':5 ''tourist'':1', '1', '2013-05-26T14:50:58.951000', 152, 'PG-13', 2006, 4, '4.99', '18.99', ARRAY['Deleted Scenes']::text[], 'Tourist Pelican'), - ('A Astounding Story of a Forensic Psychologist And a Cat who must Battle a Teacher in An Abandoned Mine Shaft', '''abandon'':20 ''astound'':4 ''battl'':15 ''cat'':12 ''forens'':8 ''mine'':21 ''moulin'':1 ''must'':14 ''psychologist'':9 ''shaft'':22 ''stori'':5 ''teacher'':17 ''wake'':2', '1', '2013-05-26T14:50:58.951000', 79, 'PG-13', 2006, 4, '0.99', '20.99', ARRAY['Trailers']::text[], 'Moulin Wake'), - ('A Awe-Inspiring Yarn of a Student And a Teacher who must Fight a Teacher in An Abandoned Amusement Park', '''abandon'':21 ''amus'':22 ''awe'':5 ''awe-inspir'':4 ''fight'':16 ''inspir'':6 ''must'':15 ''park'':23 ''student'':10 ''teacher'':13,18 ''texa'':1 ''watch'':2 ''yarn'':7', '1', '2013-05-26T14:50:58.951000', 179, 'NC-17', 2006, 7, '0.99', '22.99', ARRAY['Trailers']::text[], 'Texas Watch'), - ('A Fast-Paced Yarn of a Waitress And a Composer who must Outgun a Dentist in California', '''bowfing'':1 ''california'':20 ''compos'':13 ''dentist'':18 ''fast'':5 ''fast-pac'':4 ''gabl'':2 ''must'':15 ''outgun'':16 ''pace'':6 ''waitress'':10 ''yarn'':7', '1', '2013-05-26T14:50:58.951000', 72, 'NC-17', 2006, 7, '4.99', '19.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Bowfinger Gables'), - ('A Beautiful Display of a Mad Cow And a Dog who must Redeem a Waitress in An Abandoned Amusement Park', '''abandon'':20 ''amus'':21 ''beauti'':4 ''confess'':2 ''cow'':9 ''display'':5 ''dog'':12 ''mad'':8 ''must'':14 ''park'':22 ''redeem'':15 ''sun'':1 ''waitress'':17', '1', '2013-05-26T14:50:58.951000', 141, 'R', 2006, 5, '0.99', '9.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Sun Confessions'), - ('A Amazing Character Study of a Robot And a Student who must Chase a Robot in Australia', '''amaz'':4 ''australia'':19 ''charact'':5 ''chase'':15 ''karat'':2 ''must'':14 ''robot'':9,17 ''student'':12 ''studi'':6 ''unbreak'':1', '1', '2013-05-26T14:50:58.951000', 62, 'G', 2006, 3, '0.99', '16.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Unbreakable Karate'), - ('A Beautiful Documentary of a Woman And a Pioneer who must Pursue a Mad Scientist in A Shark Tank', '''beauti'':4 ''documentari'':5 ''forrest'':2 ''frisco'':1 ''mad'':16 ''must'':13 ''pioneer'':11 ''pursu'':14 ''scientist'':17 ''shark'':20 ''tank'':21 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 51, 'PG', 2006, 6, '4.99', '23.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Frisco Forrest'), - ('A Thrilling Reflection of a Teacher And a Composer who must Find a Man in The First Manned Space Station', '''compos'':11 ''find'':14 ''first'':19 ''life'':1 ''man'':16,20 ''must'':13 ''reflect'':5 ''space'':21 ''station'':22 ''teacher'':8 ''thrill'':4 ''twist'':2', '1', '2013-05-26T14:50:58.951000', 137, 'NC-17', 2006, 4, '2.99', '9.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Life Twisted'), - ('A Stunning Drama of a Woman And a Lumberjack who must Overcome a A Shark in The Canadian Rockies', '''canadian'':20 ''drama'':5 ''lumberjack'':11 ''must'':13 ''overcom'':14 ''pirat'':1 ''rocki'':21 ''roxann'':2 ''shark'':17 ''stun'':4 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 100, 'PG', 2006, 4, '0.99', '20.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Pirates Roxanne'), - ('A Thrilling Yarn of a Dog And a Moose who must Kill a Pastry Chef in A Manhattan Penthouse', '''amistad'':2 ''chef'':17 ''dog'':8 ''kill'':14 ''manhattan'':20 ''moos'':11 ''must'':13 ''pacif'':1 ''pastri'':16 ''penthous'':21 ''thrill'':4 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 144, 'G', 2006, 3, '0.99', '27.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Pacific Amistad'), - ('A Intrepid Panorama of a Robot And a Boy who must Escape a Sumo Wrestler in Ancient China', '''agent'':1 ''ancient'':19 ''boy'':11 ''china'':20 ''escap'':14 ''intrepid'':4 ''must'':13 ''panorama'':5 ''robot'':8 ''sumo'':16 ''truman'':2 ''wrestler'':17', '1', '2013-05-26T14:50:58.951000', 169, 'PG', 2006, 3, '2.99', '17.99', ARRAY['Deleted Scenes']::text[], 'Agent Truman'), - ('A Fateful Display of a Cat And a Pioneer who must Challenge a Pastry Chef in A Baloon Factory', '''baloon'':20 ''cat'':8 ''challeng'':14 ''chef'':17 ''display'':5 ''factori'':21 ''fate'':4 ''gabl'':1 ''metropoli'':2 ''must'':13 ''pastri'':16 ''pioneer'':11', '1', '2013-05-26T14:50:58.951000', 161, 'PG', 2006, 3, '0.99', '17.99', ARRAY['Trailers', 'Commentaries']::text[], 'Gables Metropolis'), - ('A Taut Saga of a Robot And a Database Administrator who must Challenge a Astronaut in California', '''administr'':12 ''astronaut'':17 ''california'':19 ''challeng'':15 ''databas'':11 ''must'':14 ''patriot'':1 ''robot'':8 ''roman'':2 ''saga'':5 ''taut'':4', '1', '2013-05-26T14:50:58.951000', 65, 'PG', 2006, 6, '2.99', '12.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Patriot Roman'), - ('A Fateful Reflection of a Car And a Teacher who must Confront a Waitress in A Monastery', '''car'':8 ''confront'':14 ''duck'':2 ''fate'':4 ''monasteri'':19 ''must'':13 ''reflect'':5 ''scalawag'':1 ''teacher'':11 ''waitress'':16', '1', '2013-05-26T14:50:58.951000', 183, 'NC-17', 2006, 6, '4.99', '13.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Scalawag Duck'), - ('A Fanciful Saga of a Student And a Girl who must Find a Butler in Ancient Japan', '''ancient'':18 ''butler'':16 ''fanci'':4 ''find'':14 ''girl'':11 ''japan'':19 ''lord'':2 ''must'':13 ''saga'':5 ''show'':1 ''student'':8', '1', '2013-05-26T14:50:58.951000', 167, 'PG-13', 2006, 3, '4.99', '24.99', ARRAY['Deleted Scenes']::text[], 'Show Lord'), - ('A Unbelieveable Epistle of a Sumo Wrestler And a Hunter who must Chase a Forensic Psychologist in A Baloon', '''baloon'':21 ''brotherhood'':2 ''chase'':15 ''epistl'':5 ''forens'':17 ''hunter'':12 ''must'':14 ''psychologist'':18 ''sumo'':8 ''sweet'':1 ''unbeliev'':4 ''wrestler'':9', '1', '2013-05-26T14:50:58.951000', 185, 'R', 2006, 3, '2.99', '27.99', ARRAY['Deleted Scenes']::text[], 'Sweet Brotherhood'), - ('A Action-Packed Yarn of a Boat And a Crocodile who must Build a Monkey in Berlin', '''action'':5 ''action-pack'':4 ''berlin'':20 ''boat'':10 ''build'':16 ''crocodil'':13 ''deep'':2 ''hang'':1 ''monkey'':18 ''must'':15 ''pack'':6 ''yarn'':7', '1', '2013-05-26T14:50:58.951000', 62, 'G', 2006, 5, '4.99', '18.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Hanging Deep'), - ('A Amazing Documentary of a Student And a Sumo Wrestler who must Outgun a A Shark in A Shark Tank', '''amaz'':4 ''documentari'':5 ''hope'':1 ''must'':14 ''outgun'':15 ''shark'':18,21 ''student'':8 ''sumo'':11 ''tank'':22 ''tootsi'':2 ''wrestler'':12', '1', '2013-05-26T14:50:58.951000', 139, 'NC-17', 2006, 4, '2.99', '22.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Hope Tootsie'), - ('A Amazing Display of a Lumberjack And a Teacher who must Outrace a Woman in A U-Boat', '''amaz'':4 ''boat'':21 ''display'':5 ''jet'':1 ''lumberjack'':8 ''must'':13 ''neighbor'':2 ''outrac'':14 ''teacher'':11 ''u'':20 ''u-boat'':19 ''woman'':16', '1', '2013-05-26T14:50:58.951000', 59, 'R', 2006, 7, '4.99', '14.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Jet Neighbors'), - ('A Fast-Paced Story of a Waitress And a Cat who must Fight a Girl in Australia', '''australia'':20 ''cat'':13 ''fast'':5 ''fast-pac'':4 ''fight'':16 ''girl'':18 ''monster'':1 ''must'':15 ''pace'':6 ''spartacus'':2 ''stori'':7 ''waitress'':10', '1', '2013-05-26T14:50:58.951000', 107, 'PG', 2006, 6, '2.99', '28.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Monster Spartacus'), - ('A Insightful Drama of a Girl And a Astronaut who must Face a Database Administrator in A Shark Tank', '''administr'':17 ''american'':1 ''astronaut'':11 ''circus'':2 ''databas'':16 ''drama'':5 ''face'':14 ''girl'':8 ''insight'':4 ''must'':13 ''shark'':20 ''tank'':21', '1', '2013-05-26T14:50:58.951000', 129, 'R', 2006, 3, '4.99', '17.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'American Circus'), - ('A Amazing Epistle of a Student And a Astronaut who must Discover a Frisbee in The Canadian Rockies', '''amaz'':4 ''astronaut'':11 ''bunch'':2 ''canadian'':19 ''carri'':1 ''discov'':14 ''epistl'':5 ''frisbe'':16 ''must'':13 ''rocki'':20 ''student'':8', '1', '2013-05-26T14:50:58.951000', 114, 'PG', 2006, 7, '0.99', '11.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Carrie Bunch'), - ('A Beautiful Yarn of a Astronaut And a Frisbee who must Overcome a Explorer in A Jet Boat', '''astronaut'':8 ''beauti'':4 ''boat'':20 ''clyde'':1 ''explor'':16 ''frisbe'':11 ''jet'':19 ''must'':13 ''overcom'':14 ''theori'':2 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 139, 'PG-13', 2006, 4, '0.99', '29.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Clyde Theory'), - ('A Emotional Display of a Monkey And a Waitress who must Reach a Secret Agent in California', '''agent'':17 ''california'':19 ''display'':5 ''egg'':2 ''emot'':4 ''monkey'':8 ''must'':13 ''racer'':1 ''reach'':14 ''secret'':16 ''waitress'':11', '1', '2013-05-26T14:50:58.951000', 147, 'NC-17', 2006, 7, '2.99', '19.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Racer Egg'), - ('A Boring Epistle of a Crocodile And a Lumberjack who must Outgun a Moose in Ancient China', '''ancient'':18 ''bore'':4 ''china'':19 ''crocodil'':8 ''epistl'':5 ''glass'':2 ''lumberjack'':11 ''moos'':16 ''must'':13 ''outgun'':14 ''stock'':1', '1', '2013-05-26T14:50:58.951000', 160, 'PG', 2006, 7, '2.99', '10.99', ARRAY['Commentaries']::text[], 'Stock Glass'), - ('A Brilliant Drama of a Mad Cow And a Hunter who must Escape a Hunter in Berlin', '''berlin'':19 ''brilliant'':4 ''cow'':9 ''drama'':5 ''escap'':15 ''hunter'':12,17 ''mad'':8 ''must'':14 ''rememb'':2 ''root'':1', '1', '2013-05-26T14:50:58.951000', 89, 'PG-13', 2006, 4, '0.99', '23.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Roots Remember'), - ('A Fast-Paced Saga of a Astronaut And a Secret Agent who must Escape a Hunter in An Abandoned Amusement Park', '''abandon'':22 ''agent'':14 ''amus'':23 ''astronaut'':10 ''escap'':17 ''fast'':5 ''fast-pac'':4 ''game'':2 ''hunter'':19 ''must'':16 ''pace'':6 ''park'':24 ''rage'':1 ''saga'':7 ''secret'':13', '1', '2013-05-26T14:50:58.951000', 120, 'R', 2006, 4, '4.99', '18.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Rage Games'), - ('A Awe-Inspiring Reflection of a Astronaut And a A Shark who must Defeat a Forensic Psychologist in California', '''astronaut'':10 ''awe'':5 ''awe-inspir'':4 ''california'':22 ''defeat'':17 ''forens'':19 ''inspir'':6 ''must'':16 ''psychologist'':20 ''racer'':2 ''reflect'':7 ''shark'':14 ''sunset'':1', '1', '2013-05-26T14:50:58.951000', 48, 'NC-17', 2006, 6, '0.99', '28.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Sunset Racer'), - ('A Beautiful Panorama of a Lumberjack And a Forensic Psychologist who must Overcome a Frisbee in A Baloon', '''baloon'':20 ''beauti'':4 ''eleph'':1 ''forens'':11 ''frisbe'':17 ''lumberjack'':8 ''must'':14 ''overcom'':15 ''panorama'':5 ''psychologist'':12 ''trojan'':2', '1', '2013-05-26T14:50:58.951000', 126, 'PG-13', 2006, 4, '4.99', '24.99', ARRAY['Behind the Scenes']::text[], 'Elephant Trojan'), - ('A Fast-Paced Documentary of a Car And a Butler who must Find a Frisbee in A Jet Boat', '''boat'':22 ''butler'':13 ''car'':10 ''documentari'':7 ''fast'':5 ''fast-pac'':4 ''find'':16 ''frisbe'':18 ''jet'':21 ''must'':15 ''pace'':6 ''person'':2 ''weekend'':1', '1', '2013-05-26T14:50:58.951000', 134, 'R', 2006, 5, '2.99', '26.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Weekend Personal'), - ('A Emotional Saga of a Womanizer And a Pioneer who must Overcome a Dentist in A Baloon', '''baloon'':19 ''dentist'':16 ''emot'':4 ''moon'':2 ''mulan'':1 ''must'':13 ''overcom'':14 ''pioneer'':11 ''saga'':5 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 160, 'G', 2006, 4, '0.99', '10.99', ARRAY['Behind the Scenes']::text[], 'Mulan Moon'), - ('A Emotional Documentary of a Student And a Girl who must Build a Boat in Nigeria', '''bever'':2 ''blanket'':1 ''boat'':16 ''build'':14 ''documentari'':5 ''emot'':4 ''girl'':11 ''must'':13 ''nigeria'':18 ''student'':8', '1', '2013-05-26T14:50:58.951000', 148, 'G', 2006, 7, '2.99', '21.99', ARRAY['Trailers']::text[], 'Blanket Beverly'), - ('A Intrepid Yarn of a Database Administrator And a Boat who must Outrace a Husband in Ancient India', '''administr'':9 ''airport'':2 ''ancient'':19 ''boat'':12 ''databas'':8 ''husband'':17 ''india'':20 ''intrepid'':4 ''must'':14 ''outrac'':15 ''rebel'':1 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 73, 'G', 2006, 7, '0.99', '24.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Rebel Airport'), - ('A Intrepid Story of a Dentist And a Hunter who must Confront a Monkey in Ancient Japan', '''ancient'':18 ''confront'':14 ''dentist'':8 ''giant'':2 ''hunter'':11 ''intrepid'':4 ''japan'':19 ''monkey'':16 ''must'':13 ''stori'':5 ''whisper'':1', '1', '2013-05-26T14:50:58.951000', 59, 'PG-13', 2006, 4, '4.99', '24.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Whisperer Giant'), - ('A Fast-Paced Documentary of a Dog And a Teacher who must Find a Moose in A Manhattan Penthouse', '''documentari'':7 ''dog'':10 ''fast'':5 ''fast-pac'':4 ''find'':16 ''manhattan'':21 ''moos'':18 ''must'':15 ''pace'':6 ''packer'':2 ''penthous'':22 ''sassi'':1 ''teacher'':13', '1', '2013-05-26T14:50:58.951000', 154, 'G', 2006, 6, '0.99', '29.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Sassy Packer'), - ('A Lacklusture Reflection of a Car And a Explorer who must Find a Monkey in A Baloon', '''baloon'':19 ''car'':8 ''champion'':2 ''explor'':11 ''find'':14 ''lacklustur'':4 ''monkey'':16 ''must'':13 ''reflect'':5 ''roof'':1', '1', '2013-05-26T14:50:58.951000', 101, 'R', 2006, 7, '0.99', '25.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Roof Champion'), - ('A Epic Drama of a Lumberjack And a Explorer who must Confront a Hunter in A Baloon Factory', '''baloon'':19 ''confront'':14 ''drama'':5 ''epic'':4 ''explor'':11 ''factori'':20 ''hunter'':16 ''invas'':2 ''lumberjack'':8 ''must'':13 ''sundanc'':1', '1', '2013-05-26T14:50:58.951000', 92, 'NC-17', 2006, 5, '0.99', '21.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Sundance Invasion'), - ('A Awe-Inspiring Documentary of a A Shark And a Dentist who must Outrace a Pastry Chef in The Canadian Rockies', '''awe'':5 ''awe-inspir'':4 ''bright'':2 ''canadian'':23 ''chef'':20 ''dentist'':14 ''documentari'':7 ''heartbreak'':1 ''inspir'':6 ''must'':16 ''outrac'':17 ''pastri'':19 ''rocki'':24 ''shark'':11', '1', '2013-05-26T14:50:58.951000', 59, 'G', 2006, 3, '4.99', '9.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Heartbreakers Bright'), - ('A Stunning Tale of a Man And a Monkey who must Chase a Student in New Orleans', '''chase'':14 ''man'':8 ''monkey'':11 ''must'':13 ''new'':18 ''orlean'':19 ''star'':2 ''student'':16 ''stun'':4 ''tale'':5 ''turn'':1', '1', '2013-05-26T14:50:58.951000', 80, 'G', 2006, 3, '2.99', '10.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Turn Star'), - ('A Awe-Inspiring Yarn of a Hunter And a Feminist who must Challenge a Dentist in The Outback', '''awe'':5 ''awe-inspir'':4 ''challeng'':16 ''dentist'':18 ''feminist'':13 ''hunter'':10 ''inspir'':6 ''must'':15 ''outback'':21 ''texa'':2 ''volcano'':1 ''yarn'':7', '1', '2013-05-26T14:50:58.951000', 157, 'NC-17', 2006, 6, '0.99', '27.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Volcano Texas'), - ('A Taut Display of a Pioneer And a Man who must Reach a Girl in The Gulf of Mexico', '''command'':2 ''display'':5 ''girl'':16 ''gulf'':19 ''man'':11 ''mexico'':21 ''must'':13 ''pioneer'':8 ''reach'':14 ''taut'':4 ''tenenbaum'':1', '1', '2013-05-26T14:50:58.951000', 99, 'PG-13', 2006, 4, '0.99', '24.99', ARRAY['Trailers', 'Commentaries']::text[], 'Tenenbaums Command'), - ('A Boring Panorama of a Feminist And a Moose who must Defeat a Database Administrator in Nigeria', '''administr'':17 ''bore'':4 ''bound'':2 ''databas'':16 ''defeat'':14 ''feminist'':8 ''moos'':11 ''must'':13 ''nigeria'':19 ''panorama'':5 ''piti'':1', '1', '2013-05-26T14:50:58.951000', 60, 'NC-17', 2006, 5, '4.99', '19.99', ARRAY['Commentaries']::text[], 'Pity Bound'), - ('A Thoughtful Documentary of a Boat And a Man who must Meet a Boat in An Abandoned Fun House', '''abandon'':19 ''boat'':8,16 ''documentari'':5 ''fun'':20 ''hous'':21 ''man'':11 ''meet'':14 ''must'':13 ''runaway'':1 ''tenenbaum'':2 ''thought'':4', '1', '2013-05-26T14:50:58.951000', 181, 'NC-17', 2006, 6, '0.99', '17.99', ARRAY['Commentaries']::text[], 'Runaway Tenenbaums'), - ('A Intrepid Documentary of a Sumo Wrestler And a Astronaut who must Battle a Composer in The Outback', '''astronaut'':12 ''battl'':15 ''casualti'':2 ''compos'':17 ''crossroad'':1 ''documentari'':5 ''intrepid'':4 ''must'':14 ''outback'':20 ''sumo'':8 ''wrestler'':9', '1', '2013-05-26T14:50:58.951000', 153, 'G', 2006, 5, '2.99', '20.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Crossroads Casualties'), - ('A Insightful Reflection of a Crocodile And a Sumo Wrestler who must Meet a Technical Writer in The Sahara Desert', '''crocodil'':8 ''desert'':22 ''expec'':2 ''insight'':4 ''meet'':15 ''must'':14 ''reflect'':5 ''sahara'':21 ''seattl'':1 ''sumo'':11 ''technic'':17 ''wrestler'':12 ''writer'':18', '1', '2013-05-26T14:50:58.951000', 110, 'PG-13', 2006, 4, '4.99', '18.99', ARRAY['Trailers']::text[], 'Seattle Expecations'), - ('A Brilliant Panorama of a Boat And a Astronaut who must Challenge a Teacher in A Manhattan Penthouse', '''astronaut'':11 ''boat'':8 ''brilliant'':4 ''challeng'':14 ''manhattan'':19 ''must'':13 ''panorama'':5 ''penthous'':20 ''teacher'':16 ''traci'':2 ''willow'':1', '1', '2013-05-26T14:50:58.951000', 137, 'R', 2006, 6, '2.99', '22.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Willow Tracy'), - ('A Action-Packed Reflection of a Mad Scientist And a A Shark who must Find a Feminist in California', '''action'':5 ''action-pack'':4 ''california'':22 ''feminist'':20 ''find'':18 ''mad'':10 ''must'':17 ''pack'':6 ''pinocchio'':1 ''reflect'':7 ''scientist'':11 ''shark'':15 ''simon'':2', '1', '2013-05-26T14:50:58.951000', 103, 'PG', 2006, 4, '4.99', '21.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Pinocchio Simon'), - ('A Emotional Epistle of a Moose And a Hunter who must Overcome a Robot in A Manhattan Penthouse', '''dalmat'':1 ''emot'':4 ''epistl'':5 ''hunter'':11 ''manhattan'':19 ''moos'':8 ''must'':13 ''overcom'':14 ''penthous'':20 ''robot'':16 ''sweden'':2', '1', '2013-05-26T14:50:58.951000', 106, 'PG', 2006, 4, '0.99', '25.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Dalmations Sweden'), - ('A Intrepid Story of a Cat And a Student who must Vanquish a Girl in An Abandoned Amusement Park', '''abandon'':19 ''amus'':20 ''barefoot'':1 ''cat'':8 ''girl'':16 ''intrepid'':4 ''manchurian'':2 ''must'':13 ''park'':21 ''stori'':5 ''student'':11 ''vanquish'':14', '1', '2013-05-26T14:50:58.951000', 129, 'G', 2006, 6, '2.99', '15.99', ARRAY['Trailers', 'Commentaries']::text[], 'Barefoot Manchurian'), - ('A Awe-Inspiring Panorama of a Crocodile And a Moose who must Confront a Girl in A Baloon', '''awe'':5 ''awe-inspir'':4 ''baloon'':21 ''bubbl'':1 ''confront'':16 ''crocodil'':10 ''girl'':18 ''gross'':2 ''inspir'':6 ''moos'':13 ''must'':15 ''panorama'':7', '1', '2013-05-26T14:50:58.951000', 60, 'R', 2006, 4, '4.99', '20.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Bubble Grosse'), - ('A Beautiful Tale of a Astronaut And a Mad Cow who must Challenge a Cat in A Baloon Factory', '''astronaut'':8 ''baloon'':20 ''beauti'':4 ''bunch'':2 ''cat'':17 ''challeng'':15 ''cow'':12 ''factori'':21 ''mad'':11 ''moon'':1 ''must'':14 ''tale'':5', '1', '2013-05-26T14:50:58.951000', 83, 'PG', 2006, 7, '0.99', '20.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Moon Bunch'), - ('A Thrilling Drama of a Madman And a Dentist who must Conquer a Boy in The Outback', '''banger'':2 ''boy'':16 ''conquer'':14 ''dentist'':11 ''drama'':5 ''madman'':8 ''must'':13 ''outback'':19 ''thrill'':4 ''worst'':1', '1', '2013-05-26T14:50:58.951000', 185, 'PG', 2006, 4, '2.99', '26.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Worst Banger'), - ('A Amazing Yarn of a Robot And a Womanizer who must Discover a Forensic Psychologist in Berlin', '''amaz'':4 ''berlin'':19 ''discov'':14 ''forens'':16 ''mine'':1 ''must'':13 ''psychologist'':17 ''robot'':8 ''titan'':2 ''woman'':11 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 166, 'PG-13', 2006, 3, '4.99', '12.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Mine Titans'), - ('A Beautiful Drama of a Dentist And a Composer who must Battle a Sumo Wrestler in The First Manned Space Station', '''battl'':14 ''beauti'':4 ''brooklyn'':1 ''compos'':11 ''dentist'':8 ''desert'':2 ''drama'':5 ''first'':20 ''man'':21 ''must'':13 ''space'':22 ''station'':23 ''sumo'':16 ''wrestler'':17', '1', '2013-05-26T14:50:58.951000', 161, 'R', 2006, 7, '4.99', '21.99', ARRAY['Commentaries']::text[], 'Brooklyn Desert'), - ('A Astounding Saga of a Mad Cow And a Pastry Chef who must Discover a Husband in Ancient India', '''ancient'':20 ''astound'':4 ''chef'':13 ''cow'':9 ''discov'':16 ''husband'':18 ''india'':21 ''mad'':8 ''mannequin'':1 ''must'':15 ''pastri'':12 ''saga'':5 ''worst'':2', '1', '2013-05-26T14:50:58.951000', 71, 'PG-13', 2006, 3, '2.99', '18.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Mannequin Worst'), - ('A Unbelieveable Character Study of a Cat And a Database Administrator who must Pursue a Teacher in A Monastery', '''administr'':13 ''cat'':9 ''charact'':5 ''databas'':12 ''monasteri'':21 ''must'':15 ''pursu'':16 ''requiem'':1 ''studi'':6 ''teacher'':18 ''tycoon'':2 ''unbeliev'':4', '1', '2013-05-26T14:50:58.951000', 167, 'R', 2006, 6, '4.99', '25.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Requiem Tycoon'), - ('A Stunning Epistle of a Feminist And a A Shark who must Battle a Woman in An Abandoned Fun House', '''abandon'':20 ''antitrust'':2 ''battl'':15 ''epistl'':5 ''feminist'':8 ''fun'':21 ''hous'':22 ''must'':14 ''saddl'':1 ''shark'':12 ''stun'':4 ''woman'':17', '1', '2013-05-26T14:50:58.951000', 80, 'PG-13', 2006, 7, '2.99', '10.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Saddle Antitrust'), - ('A Taut Epistle of a Feminist And a Sumo Wrestler who must Battle a Crocodile in Australia', '''australia'':19 ''battl'':15 ''crocodil'':17 ''epistl'':5 ''feminist'':8 ''fugit'':1 ''maguir'':2 ''must'':14 ''sumo'':11 ''taut'':4 ''wrestler'':12', '1', '2013-05-26T14:50:58.951000', 83, 'R', 2006, 7, '4.99', '28.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Fugitive Maguire'), - ('A Epic Reflection of a Monkey And a Mad Cow who must Kill a Forensic Psychologist in An Abandoned Mine Shaft', '''abandon'':21 ''chocolat'':2 ''cow'':12 ''epic'':4 ''forens'':17 ''kill'':15 ''mad'':11 ''mine'':22 ''monkey'':8 ''must'':14 ''nash'':1 ''psychologist'':18 ''reflect'':5 ''shaft'':23', '1', '2013-05-26T14:50:58.951000', 180, 'PG-13', 2006, 6, '2.99', '21.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Nash Chocolat'), - ('A Boring Tale of a Squirrel And a Dog who must Challenge a Madman in The Gulf of Mexico', '''bore'':4 ''challeng'':14 ''dog'':11 ''fiddler'':1 ''gulf'':19 ''lost'':2 ''madman'':16 ''mexico'':21 ''must'':13 ''squirrel'':8 ''tale'':5', '1', '2013-05-26T14:50:58.951000', 75, 'R', 2006, 4, '4.99', '20.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Fiddler Lost'), - ('A Brilliant Drama of a Cat And a Mad Scientist who must Battle a Feminist in A MySQL Convention', '''alien'':1 ''battl'':15 ''brilliant'':4 ''cat'':8 ''center'':2 ''convent'':21 ''drama'':5 ''feminist'':17 ''mad'':11 ''must'':14 ''mysql'':20 ''scientist'':12', '1', '2013-05-26T14:50:58.951000', 46, 'NC-17', 2006, 5, '2.99', '10.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Alien Center'), - ('A Astounding Yarn of a Womanizer And a Dog who must Reach a Waitress in A MySQL Convention', '''astound'':4 ''convent'':20 ''dog'':11 ''karat'':1 ''moon'':2 ''must'':13 ''mysql'':19 ''reach'':14 ''waitress'':16 ''woman'':8 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 120, 'PG-13', 2006, 4, '0.99', '21.99', ARRAY['Behind the Scenes']::text[], 'Karate Moon'), - ('A Thoughtful Display of a Butler And a Womanizer who must Find a Waitress in The Canadian Rockies', '''butler'':8 ''canadian'':19 ''display'':5 ''find'':14 ''must'':13 ''not'':1 ''rocki'':20 ''speakeasi'':2 ''thought'':4 ''waitress'':16 ''woman'':11', '1', '2013-05-26T14:50:58.951000', 48, 'PG-13', 2006, 7, '0.99', '19.99', ARRAY['Trailers', 'Commentaries']::text[], 'Notting Speakeasy'), - ('A Amazing Reflection of a Database Administrator And a Astronaut who must Outrace a Database Administrator in A Shark Tank', '''administr'':9,18 ''amaz'':4 ''anonym'':1 ''astronaut'':12 ''databas'':8,17 ''human'':2 ''must'':14 ''outrac'':15 ''reflect'':5 ''shark'':21 ''tank'':22', '1', '2013-05-26T14:50:58.951000', 179, 'NC-17', 2006, 7, '0.99', '12.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Anonymous Human'), - ('A Fateful Display of a Pioneer And a Hunter who must Defeat a Husband in An Abandoned Mine Shaft', '''abandon'':19 ''defeat'':14 ''display'':5 ''fate'':4 ''hunter'':11 ''husband'':16 ''mine'':20 ''must'':13 ''pioneer'':8 ''shaft'':21 ''soror'':2 ''spice'':1', '1', '2013-05-26T14:50:58.951000', 141, 'NC-17', 2006, 5, '4.99', '22.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Spice Sorority'), - ('A Action-Packed Saga of a Womanizer And a Woman who must Overcome a Student in California', '''action'':5 ''action-pack'':4 ''california'':20 ''matrix'':1 ''must'':15 ''overcom'':16 ''pack'':6 ''saga'':7 ''snowman'':2 ''student'':18 ''woman'':10,13', '1', '2013-05-26T14:50:58.951000', 56, 'PG-13', 2006, 6, '4.99', '9.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Matrix Snowman'), - ('A Thoughtful Display of a Dentist And a Squirrel who must Confront a Lumberjack in A Shark Tank', '''clockwork'':2 ''confront'':14 ''dentist'':8 ''display'':5 ''grit'':1 ''lumberjack'':16 ''must'':13 ''shark'':19 ''squirrel'':11 ''tank'':20 ''thought'':4', '1', '2013-05-26T14:50:58.951000', 137, 'PG', 2006, 3, '0.99', '21.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Grit Clockwork'), - ('A Action-Packed Drama of a Feminist And a Girl who must Reach a Robot in The Canadian Rockies', '''action'':5 ''action-pack'':4 ''canadian'':21 ''dinosaur'':1 ''drama'':7 ''feminist'':10 ''girl'':13 ''must'':15 ''pack'':6 ''reach'':16 ''robot'':18 ''rocki'':22 ''secretari'':2', '1', '2013-05-26T14:50:58.951000', 63, 'R', 2006, 7, '2.99', '27.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Dinosaur Secretary'), - ('A Boring Documentary of a Mad Cow And a Cat who must Build a Lumberjack in New Orleans', '''bore'':4 ''build'':15 ''cat'':12 ''cow'':9 ''documentari'':5 ''lumberjack'':17 ''mad'':8 ''mod'':1 ''must'':14 ''new'':19 ''orlean'':20 ''secretari'':2', '1', '2013-05-26T14:50:58.951000', 77, 'NC-17', 2006, 6, '4.99', '20.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Mod Secretary'), - ('A Insightful Display of a Lumberjack And a Sumo Wrestler who must Meet a Man in The Outback', '''display'':5 ''insight'':4 ''kiss'':2 ''lumberjack'':8 ''man'':17 ''meet'':15 ''minor'':1 ''must'':14 ''outback'':20 ''sumo'':11 ''wrestler'':12', '1', '2013-05-26T14:50:58.951000', 59, 'G', 2006, 4, '0.99', '16.99', ARRAY['Trailers']::text[], 'Minority Kiss'), - ('A Taut Epistle of a Monkey And a Sumo Wrestler who must Vanquish a A Shark in A Baloon Factory', '''baloon'':21 ''epistl'':5 ''factori'':22 ''monkey'':8 ''must'':14 ''shark'':18 ''sumo'':11 ''taut'':4 ''unforgiven'':1 ''vanquish'':15 ''wrestler'':12 ''zooland'':2', '1', '2013-05-26T14:50:58.951000', 129, 'PG', 2006, 7, '0.99', '15.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Unforgiven Zoolander'), - ('A Emotional Documentary of a Dentist And a Woman who must Battle a Mad Scientist in Ancient China', '''ancient'':19 ''battl'':14 ''china'':20 ''comfort'':2 ''dentist'':8 ''documentari'':5 ''emot'':4 ''mad'':16 ''must'':13 ''redempt'':1 ''scientist'':17 ''woman'':11', '1', '2013-05-26T14:50:58.951000', 179, 'NC-17', 2006, 3, '2.99', '20.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Redemption Comforts'), - ('A Touching Display of a Feminist And a Dentist who must Conquer a Husband in The Gulf of Mexico', '''conquer'':14 ''dentist'':11 ''display'':5 ''dumbo'':1 ''feminist'':8 ''gulf'':19 ''husband'':16 ''lust'':2 ''mexico'':21 ''must'':13 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 119, 'NC-17', 2006, 5, '0.99', '17.99', ARRAY['Behind the Scenes']::text[], 'Dumbo Lust'), - ('A Fateful Tale of a Database Administrator And a Squirrel who must Discover a Student in Soviet Georgia', '''administr'':9 ''databas'':8 ''discov'':15 ''fate'':4 ''georgia'':20 ''must'':14 ''soviet'':19 ''spoiler'':2 ''squirrel'':12 ''student'':17 ''tale'':5 ''virtual'':1', '1', '2013-05-26T14:50:58.951000', 144, 'NC-17', 2006, 3, '4.99', '14.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Virtual Spoilers'), - ('A Emotional Panorama of a Lumberjack And a Hunter who must Meet a Girl in A Shark Tank', '''emot'':4 ''girl'':16 ''hunter'':11 ''lumberjack'':8 ''meet'':14 ''must'':13 ''panorama'':5 ''scarfac'':2 ''shark'':19 ''summer'':1 ''tank'':20', '1', '2013-05-26T14:50:58.951000', 53, 'G', 2006, 5, '0.99', '25.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Summer Scarface'), - ('A Awe-Inspiring Documentary of a Moose And a Madman who must Meet a Dog in An Abandoned Mine Shaft', '''abandon'':21 ''ark'':2 ''awe'':5 ''awe-inspir'':4 ''documentari'':7 ''dog'':18 ''inspir'':6 ''madman'':13 ''meet'':16 ''mine'':22 ''moos'':10 ''must'':15 ''shaft'':23 ''town'':1', '1', '2013-05-26T14:50:58.951000', 136, 'R', 2006, 6, '2.99', '17.99', ARRAY['Behind the Scenes']::text[], 'Town Ark'), - ('A Thrilling Epistle of a Boy And a Boat who must Find a Student in Soviet Georgia', '''boat'':11 ''boy'':8 ''epistl'':5 ''find'':14 ''georgia'':19 ''hunchback'':2 ''must'':13 ''pittsburgh'':1 ''soviet'':18 ''student'':16 ''thrill'':4', '1', '2013-05-26T14:50:58.951000', 134, 'PG-13', 2006, 4, '4.99', '17.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Pittsburgh Hunchback'), - ('A Thoughtful Story of a Pioneer And a Woman who must Reach a Moose in Australia', '''australia'':18 ''bull'':2 ''moos'':16 ''must'':13 ''pioneer'':8 ''quill'':1 ''reach'':14 ''stori'':5 ''thought'':4 ''woman'':11', '1', '2013-05-26T14:50:58.951000', 112, 'R', 2006, 4, '4.99', '19.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Quills Bull'), - ('A Lacklusture Tale of a Pastry Chef And a Technical Writer who must Confront a Crocodile in An Abandoned Amusement Park', '''abandon'':21 ''amus'':22 ''chef'':9 ''confront'':16 ''crocodil'':18 ''lacklustur'':4 ''must'':15 ''park'':23 ''pastri'':8 ''tale'':5 ''technic'':12 ''termin'':2 ''velvet'':1 ''writer'':13', '1', '2013-05-26T14:50:58.951000', 173, 'R', 2006, 3, '4.99', '14.99', ARRAY['Behind the Scenes']::text[], 'Velvet Terminator'), - ('A Fateful Tale of a Technical Writer And a Composer who must Pursue a Explorer in The Gulf of Mexico', '''bride'':2 ''compos'':12 ''explor'':17 ''fate'':4 ''gulf'':20 ''mexico'':22 ''must'':14 ''pursu'':15 ''saint'':1 ''tale'':5 ''technic'':8 ''writer'':9', '1', '2013-05-26T14:50:58.951000', 125, 'G', 2006, 5, '2.99', '11.99', ARRAY['Deleted Scenes']::text[], 'Saints Bride'), - ('A Intrepid Tale of a Boat And a Monkey who must Kill a Cat in California', '''boat'':8 ''california'':18 ''cat'':16 ''die'':1 ''intrepid'':4 ''kill'':14 ''maker'':2 ''monkey'':11 ''must'':13 ''tale'':5', '1', '2013-05-26T14:50:58.951000', 168, 'PG', 2006, 5, '4.99', '28.99', ARRAY['Behind the Scenes']::text[], 'Dying Maker'), - ('A Thrilling Panorama of a Man And a Woman who must Reach a Woman in Australia', '''australia'':18 ''instinct'':2 ''man'':8 ''must'':13 ''panorama'':5 ''platoon'':1 ''reach'':14 ''thrill'':4 ''woman'':11,16', '1', '2013-05-26T14:50:58.951000', 132, 'PG-13', 2006, 6, '4.99', '10.99', ARRAY['Trailers', 'Commentaries']::text[], 'Platoon Instinct'), - ('A Action-Packed Reflection of a Pastry Chef And a Composer who must Discover a Mad Scientist in The First Manned Space Station', '''action'':5 ''action-pack'':4 ''arachnophobia'':1 ''chef'':11 ''compos'':14 ''discov'':17 ''first'':23 ''mad'':19 ''man'':24 ''must'':16 ''pack'':6 ''pastri'':10 ''reflect'':7 ''rollercoast'':2 ''scientist'':20 ''space'':25 ''station'':26', '1', '2013-05-26T14:50:58.951000', 147, 'PG-13', 2006, 4, '2.99', '24.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Arachnophobia Rollercoaster'), - ('A Beautiful Panorama of a Pastry Chef And a A Shark who must Battle a Pioneer in Soviet Georgia', '''battl'':16 ''beauti'':4 ''cassidi'':2 ''chef'':9 ''georgia'':21 ''hall'':1 ''must'':15 ''panorama'':5 ''pastri'':8 ''pioneer'':18 ''shark'':13 ''soviet'':20', '1', '2013-05-26T14:50:58.951000', 51, 'NC-17', 2006, 5, '4.99', '13.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Hall Cassidy'), - ('A Stunning Reflection of a Sumo Wrestler And a Explorer who must Sink a Frisbee in A MySQL Convention', '''convent'':21 ''explor'':12 ''frisbe'':17 ''must'':14 ''mysql'':20 ''reflect'':5 ''sink'':15 ''sleep'':1 ''stun'':4 ''sumo'':8 ''suspect'':2 ''wrestler'':9', '1', '2013-05-26T14:50:58.951000', 129, 'PG-13', 2006, 7, '4.99', '13.99', ARRAY['Trailers', 'Commentaries']::text[], 'Sleeping Suspects'), - ('A Boring Epistle of a Sumo Wrestler And a Woman who must Escape a Man in The Canadian Rockies', '''bore'':4 ''canadian'':20 ''epistl'':5 ''escap'':15 ''man'':17 ''montezuma'':2 ''must'':14 ''rocki'':21 ''snatcher'':1 ''sumo'':8 ''woman'':12 ''wrestler'':9', '1', '2013-05-26T14:50:58.951000', 74, 'PG-13', 2006, 4, '2.99', '14.99', ARRAY['Commentaries']::text[], 'Snatchers Montezuma'), - ('A Taut Reflection of a Husband And a A Shark who must Redeem a Pastry Chef in A Monastery', '''chef'':18 ''husband'':8 ''midnight'':1 ''monasteri'':21 ''must'':14 ''pastri'':17 ''redeem'':15 ''reflect'':5 ''shark'':12 ''taut'':4 ''westward'':2', '1', '2013-05-26T14:50:58.951000', 86, 'G', 2006, 3, '0.99', '19.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Midnight Westward'), - ('A Insightful Story of a Boy And a Dog who must Redeem a Boy in Australia', '''australia'':18 ''boy'':8,16 ''chariot'':2 ''dog'':11 ''hook'':1 ''insight'':4 ''must'':13 ''redeem'':14 ''stori'':5', '1', '2013-05-26T14:50:58.951000', 49, 'G', 2006, 7, '0.99', '23.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Hook Chariots'), - ('A Lacklusture Yarn of a Sumo Wrestler And a Squirrel who must Redeem a Monkey in Soviet Georgia', '''georgia'':20 ''lacklustur'':4 ''monkey'':17 ''must'':14 ''pocus'':2 ''red'':1 ''redeem'':15 ''soviet'':19 ''squirrel'':12 ''sumo'':8 ''wrestler'':9 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 182, 'PG-13', 2006, 7, '4.99', '23.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Reds Pocus'), - ('A Astounding Story of a Girl And a Boy who must Challenge a Composer in New Orleans', '''astound'':4 ''boy'':11 ''challeng'':14 ''compos'':16 ''girl'':8 ''luke'':2 ''must'':13 ''new'':18 ''orlean'':19 ''queen'':1 ''stori'':5', '1', '2013-05-26T14:50:58.951000', 163, 'PG', 2006, 5, '4.99', '22.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Queen Luke'), - ('A Thrilling Epistle of a Frisbee And a Cat who must Fight a Technical Writer in Berlin', '''berlin'':19 ''cat'':11 ''connecticut'':2 ''epistl'':5 ''fight'':14 ''frisbe'':8 ''must'':13 ''potter'':1 ''technic'':16 ''thrill'':4 ''writer'':17', '1', '2013-05-26T14:50:58.951000', 115, 'PG', 2006, 5, '2.99', '16.99', ARRAY['Trailers', 'Commentaries']::text[], 'Potter Connecticut'), - ('A Fast-Paced Tale of a Boat And a Teacher who must Succumb a Composer in An Abandoned Mine Shaft', '''abandon'':21 ''armageddon'':1 ''boat'':10 ''compos'':18 ''fast'':5 ''fast-pac'':4 ''lost'':2 ''mine'':22 ''must'':15 ''pace'':6 ''shaft'':23 ''succumb'':16 ''tale'':7 ''teacher'':13', '1', '2013-05-26T14:50:58.951000', 99, 'G', 2006, 5, '0.99', '10.99', ARRAY['Trailers']::text[], 'Armageddon Lost'), - ('A Brilliant Tale of a Car And a Moose who must Battle a Dentist in Nigeria', '''battl'':14 ''brilliant'':4 ''car'':8 ''cruelti'':1 ''dentist'':16 ''moos'':11 ''must'':13 ''nigeria'':18 ''tale'':5 ''unforgiven'':2', '1', '2013-05-26T14:50:58.951000', 69, 'G', 2006, 7, '0.99', '29.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Cruelty Unforgiven') - ) AS data(description, fulltext, old_language_id, last_update, length, rating, release_year, rental_duration, rental_rate, replacement_cost, special_features, title) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."language"' - AND map0.old_id = data.old_language_id - RETURNING film_id - ) - SELECT array_agg(film_id) INTO v_new_ids_film FROM inserted; - - FOR i IN 1..array_length(v_new_ids_film, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."film"', v_old_ids_film[i], v_new_ids_film[i]::TEXT); - END LOOP; - - v_old_ids_film := ARRAY['855', '179', '255', '617', '634', '83', '783', '276', '282', '784', '405', '688', '506', '842', '353', '188', '187', '164', '249', '722', '618', '729', '874', '397', '408', '861', '576', '931', '112', '496', '941', '171', '101', '114', '957', '502', '5', '987', '723', '429', '978', '178', '907', '965', '556', '852', '600', '998', '123', '914', '45', '616', '675', '749', '521', '424', '636', '76', '406', '605', '639', '311', '495', '301', '572', '150', '36', '656', '629', '226', '389', '925', '747', '77', '662', '328', '183', '459', '11', '801', '143', '244', '958', '955', '367', '253', '445', '110', '166', '194', '377', '807', '74', '412', '423', '666', '79', '154', '904', '395']; - WITH inserted AS ( - INSERT INTO "public"."film" ("description", "fulltext", "language_id", "last_update", "length", "rating", "release_year", "rental_duration", "rental_rate", "replacement_cost", "special_features", "title") - SELECT - data.description::text, - data.fulltext::tsvector, - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.length::smallint, - data.rating::mpaa_rating, - data.release_year::integer, - data.rental_duration::smallint, - data.rental_rate::numeric, - data.replacement_cost::numeric, - data.special_features::text[], - data.title::character varying - FROM (VALUES - ('A Astounding Character Study of a Hunter And a Waitress who must Sink a Man in New Orleans', '''astound'':4 ''charact'':5 ''hunter'':9 ''man'':17 ''must'':14 ''new'':19 ''orlean'':20 ''ridgemont'':2 ''sink'':15 ''streak'':1 ''studi'':6 ''waitress'':12', '1', '2013-05-26T14:50:58.951000', 132, 'PG-13', 2006, 7, '0.99', '28.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Streak Ridgemont'), - ('A Taut Drama of a Mad Scientist And a Man who must Escape a Pioneer in An Abandoned Mine Shaft', '''abandon'':20 ''conquer'':1 ''drama'':5 ''escap'':15 ''mad'':8 ''man'':12 ''mine'':21 ''must'':14 ''nut'':2 ''pioneer'':17 ''scientist'':9 ''shaft'':22 ''taut'':4', '1', '2013-05-26T14:50:58.951000', 173, 'G', 2006, 4, '4.99', '14.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Conquerer Nuts'), - ('A Action-Packed Yarn of a Feminist And a Technical Writer who must Sink a Boat in An Abandoned Mine Shaft', '''abandon'':22 ''action'':5 ''action-pack'':4 ''boat'':19 ''drive'':1 ''feminist'':10 ''mine'':23 ''must'':16 ''pack'':6 ''polish'':2 ''shaft'':24 ''sink'':17 ''technic'':13 ''writer'':14 ''yarn'':7', '1', '2013-05-26T14:50:58.951000', 175, 'NC-17', 2006, 6, '4.99', '21.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Driving Polish'), - ('A Fast-Paced Story of a Sumo Wrestler And a Girl who must Defeat a Car in A Baloon Factory', '''baloon'':22 ''car'':19 ''defeat'':17 ''factori'':23 ''fast'':5 ''fast-pac'':4 ''girl'':14 ''must'':16 ''natur'':1 ''pace'':6 ''stock'':2 ''stori'':7 ''sumo'':10 ''wrestler'':11', '1', '2013-05-26T14:50:58.951000', 50, 'PG-13', 2006, 4, '0.99', '24.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Natural Stock'), - ('A Thrilling Yarn of a Feminist And a Madman who must Battle a Hunter in Berlin', '''battl'':14 ''berlin'':18 ''boogi'':2 ''feminist'':8 ''hunter'':16 ''madman'':11 ''must'':13 ''odd'':1 ''thrill'':4 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 48, 'NC-17', 2006, 6, '0.99', '14.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Odds Boogie'), - ('A Insightful Documentary of a Boat And a Composer who must Meet a Forensic Psychologist in An Abandoned Fun House', '''abandon'':20 ''blue'':1 ''boat'':8 ''compos'':11 ''documentari'':5 ''forens'':16 ''fun'':21 ''hous'':22 ''insight'':4 ''instinct'':2 ''meet'':14 ''must'':13 ''psychologist'':17', '1', '2013-05-26T14:50:58.951000', 50, 'G', 2006, 5, '2.99', '18.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Blues Instinct'), - ('A Action-Packed Saga of a Moose And a Lumberjack who must Find a Woman in Berlin', '''action'':5 ''action-pack'':4 ''berlin'':20 ''dark'':2 ''find'':16 ''lumberjack'':13 ''moos'':10 ''must'':15 ''pack'':6 ''saga'':7 ''shane'':1 ''woman'':18', '1', '2013-05-26T14:50:58.951000', 93, 'PG', 2006, 5, '2.99', '22.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Shane Darkness'), - ('A Awe-Inspiring Reflection of a Waitress And a Squirrel who must Kill a Mad Cow in A Jet Boat', '''awe'':5 ''awe-inspir'':4 ''boat'':23 ''cow'':19 ''element'':1 ''freddi'':2 ''inspir'':6 ''jet'':22 ''kill'':16 ''mad'':18 ''must'':15 ''reflect'':7 ''squirrel'':13 ''waitress'':10', '1', '2013-05-26T14:50:58.951000', 115, 'NC-17', 2006, 6, '4.99', '28.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Element Freddy'), - ('A Insightful Epistle of a Pastry Chef And a Womanizer who must Build a Boat in New Orleans', '''boat'':17 ''build'':15 ''chef'':9 ''curtain'':2 ''encount'':1 ''epistl'':5 ''insight'':4 ''must'':14 ''new'':19 ''orlean'':20 ''pastri'':8 ''woman'':12', '1', '2013-05-26T14:50:58.951000', 92, 'NC-17', 2006, 5, '0.99', '20.99', ARRAY['Trailers']::text[], 'Encounters Curtain'), - ('A Fast-Paced Character Study of a Crocodile And a Lumberjack who must Build a Husband in An Abandoned Fun House', '''abandon'':22 ''build'':17 ''charact'':7 ''crocodil'':11 ''fast'':5 ''fast-pac'':4 ''fun'':23 ''hous'':24 ''husband'':19 ''lumberjack'':14 ''must'':16 ''pace'':6 ''shanghai'':1 ''studi'':8 ''tycoon'':2', '1', '2013-05-26T14:50:58.951000', 47, 'PG', 2006, 7, '2.99', '20.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Shanghai Tycoon'), - ('A Amazing Saga of a Man And a Dentist who must Reach a Technical Writer in Ancient India', '''amaz'':4 ''ancient'':19 ''antitrust'':2 ''dentist'':11 ''haunt'':1 ''india'':20 ''man'':8 ''must'':13 ''reach'':14 ''saga'':5 ''technic'':16 ''writer'':17', '1', '2013-05-26T14:50:58.951000', 76, 'NC-17', 2006, 6, '4.99', '13.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Haunted Antitrust'), - ('A Boring Character Study of a Database Administrator And a Lumberjack who must Reach a Madman in The Outback', '''administr'':10 ''bore'':4 ''brooklyn'':2 ''charact'':5 ''databas'':9 ''lumberjack'':13 ''madman'':18 ''must'':15 ''outback'':21 ''polish'':1 ''reach'':16 ''studi'':6', '1', '2013-05-26T14:50:58.951000', 61, 'PG', 2006, 6, '0.99', '12.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Polish Brooklyn'), - ('A Beautiful Character Study of a Woman And a Man who must Pursue a Explorer in A U-Boat', '''beauti'':4 ''boat'':22 ''charact'':5 ''explor'':17 ''ladi'':1 ''man'':12 ''must'':14 ''pursu'':15 ''stage'':2 ''studi'':6 ''u'':21 ''u-boat'':20 ''woman'':9', '1', '2013-05-26T14:50:58.951000', 67, 'PG', 2006, 4, '4.99', '14.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Lady Stage'), - ('A Beautiful Display of a Cat And a Pastry Chef who must Outrace a Mad Cow in A Jet Boat', '''beauti'':4 ''boat'':22 ''cat'':8 ''chef'':12 ''cow'':18 ''display'':5 ''jet'':21 ''mad'':17 ''must'':14 ''outrac'':15 ''pastri'':11 ''state'':1 ''wasteland'':2', '1', '2013-05-26T14:50:58.951000', 113, 'NC-17', 2006, 4, '2.99', '13.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'State Wasteland'), - ('A Awe-Inspiring Reflection of a Monkey And a Student who must Overcome a Dentist in The First Manned Space Station', '''awe'':5 ''awe-inspir'':4 ''dentist'':18 ''first'':21 ''gentlemen'':1 ''inspir'':6 ''man'':22 ''monkey'':10 ''must'':15 ''overcom'':16 ''reflect'':7 ''space'':23 ''stage'':2 ''station'':24 ''student'':13', '1', '2013-05-26T14:50:58.951000', 125, 'NC-17', 2006, 6, '2.99', '22.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Gentlemen Stage'), - ('A Fanciful Panorama of a Boy And a Woman who must Vanquish a Database Administrator in The Outback', '''administr'':17 ''boy'':8 ''crazi'':1 ''databas'':16 ''fanci'':4 ''home'':2 ''must'':13 ''outback'':20 ''panorama'':5 ''vanquish'':14 ''woman'':11', '1', '2013-05-26T14:50:58.951000', 136, 'PG', 2006, 7, '2.99', '24.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Crazy Home'), - ('A Fanciful Documentary of a Teacher And a Dog who must Outgun a Forensic Psychologist in A Baloon Factory', '''baloon'':20 ''crane'':1 ''documentari'':5 ''dog'':11 ''factori'':21 ''fanci'':4 ''forens'':16 ''must'':13 ''outgun'':14 ''psychologist'':17 ''reservoir'':2 ''teacher'':8', '1', '2013-05-26T14:50:58.951000', 57, 'NC-17', 2006, 5, '2.99', '12.99', ARRAY['Commentaries']::text[], 'Cranes Reservoir'), - ('A Astounding Documentary of a Mad Cow And a Pioneer who must Challenge a Butler in The Sahara Desert', '''astound'':4 ''butler'':17 ''challeng'':15 ''coast'':1 ''cow'':9 ''desert'':21 ''documentari'':5 ''mad'':8 ''must'':14 ''pioneer'':12 ''rainbow'':2 ''sahara'':20', '1', '2013-05-26T14:50:58.951000', 55, 'PG', 2006, 4, '0.99', '20.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Coast Rainbow'), - ('A Thrilling Reflection of a Feminist And a Cat who must Find a Frisbee in An Abandoned Fun House', '''abandon'':19 ''cat'':11 ''crystal'':2 ''dracula'':1 ''feminist'':8 ''find'':14 ''frisbe'':16 ''fun'':20 ''hous'':21 ''must'':13 ''reflect'':5 ''thrill'':4', '1', '2013-05-26T14:50:58.951000', 176, 'G', 2006, 7, '0.99', '26.99', ARRAY['Commentaries']::text[], 'Dracula Crystal'), - ('A Action-Packed Saga of a Teacher And a Lumberjack who must Battle a Dentist in A Baloon', '''action'':5 ''action-pack'':4 ''baloon'':21 ''battl'':16 ''dentist'':18 ''lumberjack'':13 ''must'':15 ''pack'':6 ''reef'':1 ''saga'':7 ''salut'':2 ''teacher'':10', '1', '2013-05-26T14:50:58.951000', 123, 'NC-17', 2006, 5, '0.99', '26.99', ARRAY['Behind the Scenes']::text[], 'Reef Salute'), - ('A Astounding Epistle of a Database Administrator And a Mad Scientist who must Pursue a Cat in California', '''administr'':9 ''astound'':4 ''california'':20 ''cat'':18 ''databas'':8 ''epistl'':5 ''mad'':12 ''must'':15 ''necklac'':1 ''outbreak'':2 ''pursu'':16 ''scientist'':13', '1', '2013-05-26T14:50:58.951000', 132, 'PG', 2006, 3, '0.99', '21.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Necklace Outbreak'), - ('A Taut Reflection of a Monkey And a Womanizer who must Chase a Moose in Nigeria', '''caddyshack'':2 ''chase'':14 ''monkey'':8 ''moos'':16 ''must'':13 ''nigeria'':18 ''reflect'':5 ''rider'':1 ''taut'':4 ''woman'':11', '1', '2013-05-26T14:50:58.951000', 177, 'PG', 2006, 5, '2.99', '28.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Rider Caddyshack'), - ('A Beautiful Tale of a Frisbee And a Moose who must Vanquish a Dog in An Abandoned Amusement Park', '''abandon'':19 ''amus'':20 ''beauti'':4 ''dog'':16 ''frisbe'':8 ''moos'':11 ''must'':13 ''park'':2,21 ''tadpol'':1 ''tale'':5 ''vanquish'':14', '1', '2013-05-26T14:50:58.951000', 155, 'PG', 2006, 6, '2.99', '13.99', ARRAY['Trailers', 'Commentaries']::text[], 'Tadpole Park'), - ('A Boring Epistle of a Database Administrator And a Explorer who must Pursue a Madman in Soviet Georgia', '''administr'':9 ''bore'':4 ''databas'':8 ''epistl'':5 ''explor'':12 ''georgia'':20 ''hanki'':1 ''madman'':17 ''must'':14 ''octob'':2 ''pursu'':15 ''soviet'':19', '1', '2013-05-26T14:50:58.951000', 107, 'NC-17', 2006, 5, '2.99', '26.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Hanky October'), - ('A Thoughtful Saga of a Hunter And a Crocodile who must Confront a Dog in The Gulf of Mexico', '''confront'':14 ''crocodil'':11 ''dog'':16 ''gulf'':19 ''head'':1 ''hunter'':8 ''mexico'':21 ''must'':13 ''saga'':5 ''stranger'':2 ''thought'':4', '1', '2013-05-26T14:50:58.951000', 69, 'R', 2006, 4, '4.99', '28.99', ARRAY['Trailers', 'Commentaries']::text[], 'Head Stranger'), - ('A Touching Panorama of a Lumberjack And a Frisbee who must Build a Dog in Australia', '''australia'':18 ''build'':14 ''dog'':16 ''frisbe'':11 ''lumberjack'':8 ''must'':13 ''panorama'':5 ''suit'':1 ''touch'':4 ''wall'':2', '1', '2013-05-26T14:50:58.951000', 111, 'R', 2006, 3, '4.99', '12.99', ARRAY['Commentaries']::text[], 'Suit Walls'), - ('A Astounding Epistle of a Mad Scientist And a Pioneer who must Escape a Database Administrator in A MySQL Convention', '''administr'':18 ''astound'':4 ''convent'':22 ''databas'':17 ''epistl'':5 ''escap'':15 ''luck'':2 ''mad'':8 ''mighti'':1 ''must'':14 ''mysql'':21 ''pioneer'':12 ''scientist'':9', '1', '2013-05-26T14:50:58.951000', 122, 'PG', 2006, 7, '2.99', '13.99', ARRAY['Behind the Scenes']::text[], 'Mighty Luck'), - ('A Thrilling Display of a Husband And a Butler who must Reach a Pastry Chef in California', '''butler'':11 ''california'':19 ''chef'':17 ''display'':5 ''husband'':8 ''must'':13 ''pastri'':16 ''reach'':14 ''thrill'':4 ''valentin'':1 ''vanish'':2', '1', '2013-05-26T14:50:58.951000', 48, 'PG-13', 2006, 7, '0.99', '9.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Valentine Vanishing'), - ('A Thrilling Drama of a Frisbee And a Lumberjack who must Sink a Man in Nigeria', '''calendar'':1 ''drama'':5 ''frisbe'':8 ''gunfight'':2 ''lumberjack'':11 ''man'':16 ''must'':13 ''nigeria'':18 ''sink'':14 ''thrill'':4', '1', '2013-05-26T14:50:58.951000', 120, 'NC-17', 2006, 4, '4.99', '22.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Calendar Gunfight'), - ('A Emotional Drama of a Monkey And a Robot who must Defeat a Monkey in New Orleans', '''defeat'':14 ''drama'':5 ''emot'':4 ''kick'':1 ''monkey'':8,16 ''must'':13 ''new'':18 ''orlean'':19 ''robot'':11 ''savannah'':2', '1', '2013-05-26T14:50:58.951000', 179, 'PG-13', 2006, 3, '0.99', '10.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Kick Savannah'), - ('A Lacklusture Display of a Girl And a Astronaut who must Succumb a Student in Australia', '''arsenic'':2 ''astronaut'':11 ''australia'':18 ''display'':5 ''girl'':8 ''lacklustur'':4 ''must'':13 ''student'':16 ''succumb'':14 ''videotap'':1', '1', '2013-05-26T14:50:58.951000', 145, 'NC-17', 2006, 4, '4.99', '10.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Videotape Arsenic'), - ('A Fanciful Saga of a Student And a Mad Scientist who must Battle a Hunter in An Abandoned Mine Shaft', '''abandon'':20 ''battl'':15 ''command'':1 ''express'':2 ''fanci'':4 ''hunter'':17 ''mad'':11 ''mine'':21 ''must'':14 ''saga'':5 ''scientist'':12 ''shaft'':22 ''student'':8', '1', '2013-05-26T14:50:58.951000', 59, 'R', 2006, 6, '4.99', '13.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Commandments Express'), - ('A Fateful Character Study of a Butler And a Technical Writer who must Sink a Astronaut in Ancient Japan', '''ancient'':20 ''astronaut'':18 ''blanket'':2 ''brotherhood'':1 ''butler'':9 ''charact'':5 ''fate'':4 ''japan'':21 ''must'':15 ''sink'':16 ''studi'':6 ''technic'':12 ''writer'':13', '1', '2013-05-26T14:50:58.951000', 73, 'R', 2006, 3, '0.99', '26.99', ARRAY['Behind the Scenes']::text[], 'Brotherhood Blanket'), - ('A Touching Character Study of a Woman And a Waitress who must Battle a Pastry Chef in A MySQL Convention', '''battl'':15 ''camelot'':1 ''charact'':5 ''chef'':18 ''convent'':22 ''must'':14 ''mysql'':21 ''pastri'':17 ''studi'':6 ''touch'':4 ''vacat'':2 ''waitress'':12 ''woman'':9', '1', '2013-05-26T14:50:58.951000', 61, 'NC-17', 2006, 3, '0.99', '26.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Camelot Vacation'), - ('A Boring Drama of a Teacher And a Sumo Wrestler who must Challenge a Secret Agent in The Canadian Rockies', '''agent'':18 ''bore'':4 ''canadian'':21 ''challeng'':15 ''drama'':5 ''must'':14 ''not'':2 ''rocki'':22 ''secret'':17 ''sumo'':11 ''teacher'':8 ''war'':1 ''wrestler'':12', '1', '2013-05-26T14:50:58.951000', 80, 'G', 2006, 7, '4.99', '26.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'War Notting'), - ('A Unbelieveable Story of a Teacher And a Boat who must Confront a Moose in A Baloon', '''baloon'':19 ''boat'':11 ''confront'':14 ''knock'':1 ''moos'':16 ''must'':13 ''stori'':5 ''teacher'':8 ''unbeliev'':4 ''warlock'':2', '1', '2013-05-26T14:50:58.951000', 71, 'PG-13', 2006, 4, '2.99', '21.99', ARRAY['Trailers']::text[], 'Knock Warlock'), - ('A Fast-Paced Documentary of a Pastry Chef And a Dentist who must Pursue a Forensic Psychologist in The Gulf of Mexico', '''african'':1 ''chef'':11 ''dentist'':14 ''documentari'':7 ''egg'':2 ''fast'':5 ''fast-pac'':4 ''forens'':19 ''gulf'':23 ''mexico'':25 ''must'':16 ''pace'':6 ''pastri'':10 ''psychologist'':20 ''pursu'':17', '1', '2013-05-26T14:50:58.951000', 130, 'G', 2006, 6, '2.99', '22.99', ARRAY['Deleted Scenes']::text[], 'African Egg'), - ('A Action-Packed Reflection of a Composer And a Mad Scientist who must Face a Pioneer in A MySQL Convention', '''action'':5 ''action-pack'':4 ''compos'':10 ''convent'':23 ''face'':17 ''hunter'':2 ''mad'':13 ''must'':16 ''mysql'':22 ''pack'':6 ''pioneer'':19 ''reflect'':7 ''scientist'':14 ''word'':1', '1', '2013-05-26T14:50:58.951000', 116, 'PG', 2006, 3, '2.99', '13.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Words Hunter'), - ('A Emotional Yarn of a Composer And a Man who must Escape a Butler in The Gulf of Mexico', '''butler'':16 ''compos'':8 ''emot'':4 ''escap'':14 ''gentlemen'':2 ''gulf'':19 ''man'':11 ''mexico'':21 ''must'':13 ''reign'':1 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 82, 'PG-13', 2006, 3, '2.99', '29.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Reign Gentlemen'), - ('A Taut Story of a Waitress And a Crocodile who must Outrace a Lumberjack in A Shark Tank', '''crocodil'':11 ''honey'':1 ''lumberjack'':16 ''must'':13 ''outrac'':14 ''shark'':19 ''stori'':5 ''tank'':20 ''taut'':4 ''tie'':2 ''waitress'':8', '1', '2013-05-26T14:50:58.951000', 84, 'R', 2006, 3, '0.99', '29.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Honey Ties'), - ('A Unbelieveable Saga of a Forensic Psychologist And a Student who must Face a Squirrel in The First Manned Space Station', '''face'':15 ''first'':20 ''forens'':8 ''man'':21 ''must'':14 ''psychologist'':9 ''saga'':5 ''space'':22 ''squirrel'':17 ''station'':23 ''student'':12 ''unbeliev'':4 ''wisdom'':1 ''worker'':2', '1', '2013-05-26T14:50:58.951000', 98, 'R', 2006, 3, '0.99', '12.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Wisdom Worker'), - ('A Fateful Documentary of a Crocodile And a Husband who must Face a Husband in The First Manned Space Station', '''connect'':1 ''crocodil'':8 ''documentari'':5 ''face'':14 ''fate'':4 ''first'':19 ''husband'':11,16 ''man'':20 ''microcosmo'':2 ''must'':13 ''space'':21 ''station'':22', '1', '2013-05-26T14:50:58.951000', 115, 'G', 2006, 6, '0.99', '25.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Connection Microcosmos'), - ('A Touching Reflection of a Man And a Monkey who must Pursue a Womanizer in A MySQL Convention', '''convent'':20 ''man'':8 ''monkey'':11 ''must'':13 ''mysql'':19 ''pursu'':14 ''reflect'':5 ''summer'':2 ''touch'':4 ''translat'':1 ''woman'':16', '1', '2013-05-26T14:50:58.951000', 168, 'PG-13', 2006, 4, '0.99', '10.99', ARRAY['Trailers']::text[], 'Translation Summer'), - ('A Emotional Yarn of a Boat And a Crocodile who must Meet a Moose in Soviet Georgia', '''boat'':8 ''crocodil'':11 ''emot'':4 ''frontier'':2 ''georgia'':19 ''meet'':14 ''moos'':16 ''must'':13 ''soviet'':18 ''watership'':1 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 112, 'G', 2006, 6, '0.99', '28.99', ARRAY['Commentaries']::text[], 'Watership Frontier'), - ('A Fast-Paced Documentary of a Crocodile And a Sumo Wrestler who must Conquer a Explorer in California', '''california'':21 ''conquer'':17 ''crocodil'':10 ''documentari'':7 ''explor'':19 ''fast'':5 ''fast-pac'':4 ''hope'':2 ''maltes'':1 ''must'':16 ''pace'':6 ''sumo'':13 ''wrestler'':14', '1', '2013-05-26T14:50:58.951000', 127, 'PG-13', 2006, 6, '4.99', '26.99', ARRAY['Behind the Scenes']::text[], 'Maltese Hope'), - ('A Awe-Inspiring Panorama of a Lumberjack And a Waitress who must Defeat a Crocodile in An Abandoned Amusement Park', '''abandon'':21 ''amus'':22 ''awe'':5 ''awe-inspir'':4 ''crocodil'':18 ''defeat'':16 ''desir'':2 ''inspir'':6 ''lumberjack'':10 ''must'':15 ''panorama'':7 ''park'':23 ''strangelov'':1 ''waitress'':13', '1', '2013-05-26T14:50:58.951000', 103, 'NC-17', 2006, 4, '0.99', '27.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Strangelove Desire'), - ('A Awe-Inspiring Reflection of a Dog And a Student who must Kill a Car in An Abandoned Fun House', '''abandon'':21 ''awe'':5 ''awe-inspir'':4 ''car'':18 ''detail'':2 ''dog'':10 ''fun'':22 ''hous'':23 ''inspir'':6 ''kill'':16 ''motion'':1 ''must'':15 ''reflect'':7 ''student'':13', '1', '2013-05-26T14:50:58.951000', 166, 'PG', 2006, 5, '0.99', '16.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Motions Details'), - ('A Fateful Yarn of a Composer And a Man who must Face a Boy in The Canadian Rockies', '''boy'':16 ''canadian'':19 ''compos'':8 ''core'':2 ''face'':14 ''fate'':4 ''man'':11 ''must'':13 ''rocki'':20 ''yarn'':5 ''zhivago'':1', '1', '2013-05-26T14:50:58.951000', 105, 'NC-17', 2006, 6, '0.99', '10.99', ARRAY['Deleted Scenes']::text[], 'Zhivago Core'), - ('A Amazing Panorama of a Crocodile And a Forensic Psychologist who must Pursue a Secret Agent in The First Manned Space Station', '''agent'':18 ''amaz'':4 ''casablanca'':1 ''crocodil'':8 ''first'':21 ''forens'':11 ''man'':22 ''must'':14 ''panorama'':5 ''psychologist'':12 ''pursu'':15 ''secret'':17 ''space'':23 ''station'':24 ''super'':2', '1', '2013-05-26T14:50:58.951000', 85, 'G', 2006, 6, '4.99', '22.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Casablanca Super'), - ('A Lacklusture Panorama of a Forensic Psychologist And a Woman who must Kill a Explorer in Ancient Japan', '''ancient'':19 ''date'':2 ''explor'':17 ''forens'':8 ''japan'':20 ''kill'':15 ''lacklustur'':4 ''must'':14 ''panorama'':5 ''psychologist'':9 ''troubl'':1 ''woman'':12', '1', '2013-05-26T14:50:58.951000', 61, 'PG', 2006, 6, '2.99', '13.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Trouble Date'), - ('A Astounding Panorama of a Composer And a Frisbee who must Reach a Husband in Ancient Japan', '''ancient'':18 ''astound'':4 ''attract'':1 ''compos'':8 ''frisbe'':11 ''husband'':16 ''japan'':19 ''must'':13 ''newton'':2 ''panorama'':5 ''reach'':14', '1', '2013-05-26T14:50:58.951000', 83, 'PG-13', 2006, 5, '4.99', '14.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Attraction Newton'), - ('A Taut Epistle of a Mad Scientist And a Girl who must Escape a Monkey in California', '''california'':19 ''epistl'':5 ''escap'':15 ''girl'':12 ''mad'':8 ''monkey'':17 ''must'':14 ''nation'':1 ''scientist'':9 ''stori'':2 ''taut'':4', '1', '2013-05-26T14:50:58.951000', 92, 'NC-17', 2006, 4, '2.99', '19.99', ARRAY['Trailers']::text[], 'National Story'), - ('A Beautiful Documentary of a Astronaut And a Crocodile who must Discover a Madman in A Monastery', '''astronaut'':8 ''beauti'':4 ''crocodil'':11 ''discov'':14 ''documentari'':5 ''glori'':2 ''madman'':16 ''monasteri'':19 ''must'':13 ''phantom'':1', '1', '2013-05-26T14:50:58.951000', 60, 'NC-17', 2006, 6, '2.99', '17.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Phantom Glory'), - ('A Beautiful Epistle of a Astronaut And a Student who must Confront a Monkey in An Abandoned Fun House', '''abandon'':19 ''astronaut'':8 ''beauti'':4 ''confront'':14 ''epistl'':5 ''fun'':20 ''hous'':21 ''human'':2 ''monkey'':16 ''must'':13 ''rule'':1 ''student'':11', '1', '2013-05-26T14:50:58.951000', 153, 'R', 2006, 6, '4.99', '19.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Rules Human'), - ('A Fast-Paced Character Study of a Dentist And a Moose who must Defeat a Composer in The First Manned Space Station', '''charact'':7 ''compos'':19 ''defeat'':17 ''dentist'':11 ''fast'':5 ''fast-pac'':4 ''first'':22 ''lie'':1 ''man'':23 ''moos'':14 ''must'':16 ''pace'':6 ''space'':24 ''station'':25 ''studi'':8 ''treatment'':2', '1', '2013-05-26T14:50:58.951000', 147, 'NC-17', 2006, 7, '4.99', '28.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Lies Treatment'), - ('A Awe-Inspiring Yarn of a Composer And a Man who must Find a Robot in Soviet Georgia', '''awe'':5 ''awe-inspir'':4 ''compos'':10 ''find'':16 ''georgia'':21 ''highbal'':2 ''holocaust'':1 ''inspir'':6 ''man'':13 ''must'':15 ''robot'':18 ''soviet'':20 ''yarn'':7', '1', '2013-05-26T14:50:58.951000', 149, 'R', 2006, 6, '0.99', '12.99', ARRAY['Deleted Scenes']::text[], 'Holocaust Highball'), - ('A Boring Story of a Teacher And a Monkey who must Succumb a Forensic Psychologist in A Jet Boat', '''boat'':21 ''bore'':4 ''clue'':2 ''forens'':16 ''jet'':20 ''monkey'':11 ''must'':13 ''oleand'':1 ''psychologist'':17 ''stori'':5 ''succumb'':14 ''teacher'':8', '1', '2013-05-26T14:50:58.951000', 161, 'PG', 2006, 5, '0.99', '12.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Oleander Clue'), - ('A Fast-Paced Saga of a Frisbee And a Astronaut who must Overcome a Feminist in Ancient India', '''ancient'':20 ''astronaut'':13 ''birdcag'':1 ''casper'':2 ''fast'':5 ''fast-pac'':4 ''feminist'':18 ''frisbe'':10 ''india'':21 ''must'':15 ''overcom'':16 ''pace'':6 ''saga'':7', '1', '2013-05-26T14:50:58.951000', 103, 'NC-17', 2006, 4, '0.99', '23.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Birdcage Casper'), - ('A Fast-Paced Story of a Database Administrator And a Composer who must Defeat a Squirrel in An Abandoned Amusement Park', '''abandon'':22 ''administr'':11 ''amus'':23 ''compos'':14 ''databas'':10 ''defeat'':17 ''fast'':5 ''fast-pac'':4 ''haunt'':1 ''must'':16 ''pace'':6 ''park'':24 ''pianist'':2 ''squirrel'':19 ''stori'':7', '1', '2013-05-26T14:50:58.951000', 181, 'R', 2006, 5, '0.99', '22.99', ARRAY['Behind the Scenes']::text[], 'Haunting Pianist'), - ('A Awe-Inspiring Display of a Husband And a Squirrel who must Battle a Sumo Wrestler in A Jet Boat', '''awe'':5 ''awe-inspir'':4 ''battl'':16 ''beast'':2 ''boat'':23 ''display'':7 ''husband'':10 ''inspir'':6 ''jet'':22 ''mulholland'':1 ''must'':15 ''squirrel'':13 ''sumo'':18 ''wrestler'':19', '1', '2013-05-26T14:50:58.951000', 157, 'PG', 2006, 7, '2.99', '13.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Mulholland Beast'), - ('A Fateful Epistle of a Crocodile And a Moose who must Kill a Explorer in Nigeria', '''crocodil'':8 ''epistl'':5 ''explor'':16 ''fate'':4 ''kill'':14 ''moos'':11 ''must'':13 ''necklac'':2 ''nigeria'':18 ''opposit'':1', '1', '2013-05-26T14:50:58.951000', 92, 'PG', 2006, 7, '4.99', '9.99', ARRAY['Deleted Scenes']::text[], 'Opposite Necklace'), - ('A Emotional Yarn of a A Shark And a Student who must Battle a Robot in An Abandoned Mine Shaft', '''abandon'':20 ''battl'':15 ''christma'':2 ''emot'':4 ''fiction'':1 ''mine'':21 ''must'':14 ''robot'':17 ''shaft'':22 ''shark'':9 ''student'':12 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 72, 'PG', 2006, 4, '0.99', '14.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Fiction Christmas'), - ('A Stunning Yarn of a Woman And a Frisbee who must Escape a Waitress in A U-Boat', '''boat'':21 ''escap'':14 ''frisbe'':11 ''giant'':2 ''kentuckian'':1 ''must'':13 ''stun'':4 ''u'':20 ''u-boat'':19 ''waitress'':16 ''woman'':8 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 169, 'PG', 2006, 5, '2.99', '10.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Kentuckian Giant'), - ('A Epic Documentary of a Teacher And a Boy who must Escape a Woman in Berlin', '''berlin'':18 ''boy'':11 ''documentari'':5 ''epic'':4 ''escap'':14 ''famili'':1 ''must'':13 ''sweet'':2 ''teacher'':8 ''woman'':16', '1', '2013-05-26T14:50:58.951000', 155, 'R', 2006, 4, '0.99', '24.99', ARRAY['Trailers']::text[], 'Family Sweet'), - ('A Emotional Saga of a Database Administrator And a Pastry Chef who must Confront a Teacher in A Baloon Factory', '''administr'':9 ''baloon'':21 ''chef'':13 ''coma'':2 ''confront'':16 ''databas'':8 ''emot'':4 ''factori'':22 ''metropoli'':1 ''must'':15 ''pastri'':12 ''saga'':5 ''teacher'':18', '1', '2013-05-26T14:50:58.951000', 64, 'PG-13', 2006, 4, '2.99', '9.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Metropolis Coma'), - ('A Stunning Character Study of a Composer And a Mad Cow who must Succumb a Cat in Soviet Georgia', '''cat'':18 ''charact'':5 ''cider'':1 ''compos'':9 ''cow'':13 ''desir'':2 ''georgia'':21 ''mad'':12 ''must'':15 ''soviet'':20 ''studi'':6 ''stun'':4 ''succumb'':16', '1', '2013-05-26T14:50:58.951000', 101, 'PG', 2006, 7, '2.99', '9.99', ARRAY['Behind the Scenes']::text[], 'Cider Desire'), - ('A Emotional Epistle of a Forensic Psychologist And a Butler who must Challenge a Waitress in An Abandoned Mine Shaft', '''abandon'':20 ''argonaut'':1 ''butler'':12 ''challeng'':15 ''emot'':4 ''epistl'':5 ''forens'':8 ''mine'':21 ''must'':14 ''psychologist'':9 ''shaft'':22 ''town'':2 ''waitress'':17', '1', '2013-05-26T14:50:58.951000', 127, 'PG-13', 2006, 7, '0.99', '12.99', ARRAY['Trailers', 'Commentaries']::text[], 'Argonauts Town'), - ('A Fanciful Display of a Car And a Monkey who must Escape a Squirrel in Ancient Japan', '''ancient'':18 ''car'':8 ''display'':5 ''escap'':14 ''fanci'':4 ''japan'':19 ''monkey'':11 ''must'':13 ''necklac'':2 ''papi'':1 ''squirrel'':16', '1', '2013-05-26T14:50:58.951000', 128, 'PG', 2006, 3, '0.99', '9.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Papi Necklace'), - ('A Amazing Epistle of a Woman And a Squirrel who must Fight a Hunter in A Baloon', '''amaz'':4 ''baloon'':19 ''epistl'':5 ''fight'':14 ''hunter'':16 ''must'':13 ''notori'':1 ''reunion'':2 ''squirrel'':11 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 128, 'NC-17', 2006, 7, '0.99', '9.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Notorious Reunion'), - ('A Touching Drama of a Crocodile And a Crocodile who must Conquer a Explorer in Soviet Georgia', '''conquer'':14 ''crocodil'':8,11 ''destini'':1 ''drama'':5 ''explor'':16 ''georgia'':19 ''must'':13 ''saturday'':2 ''soviet'':18 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 56, 'G', 2006, 4, '4.99', '20.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Destiny Saturday'), - ('A Touching Saga of a Robot And a Boy who must Kill a Man in Ancient Japan', '''ancient'':18 ''boy'':11 ''gunfight'':1 ''japan'':19 ''kill'':14 ''man'':16 ''mussolini'':2 ''must'':13 ''robot'':8 ''saga'':5 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 127, 'PG-13', 2006, 3, '2.99', '9.99', ARRAY['Trailers', 'Commentaries']::text[], 'Gunfighter Mussolini'), - ('A Fast-Paced Reflection of a Cat And a Mad Cow who must Fight a Car in The Sahara Desert', '''car'':19 ''cat'':10 ''cow'':14 ''desert'':23 ''fast'':5 ''fast-pac'':4 ''fight'':17 ''mad'':13 ''must'':16 ''pace'':6 ''pilot'':2 ''reflect'':7 ''sahara'':22 ''unit'':1', '1', '2013-05-26T14:50:58.951000', 164, 'R', 2006, 3, '0.99', '27.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'United Pilot'), - ('A Astounding Story of a Pastry Chef And a Database Administrator who must Fight a Man in The Outback', '''administr'':13 ''astound'':4 ''chef'':9 ''databas'':12 ''fight'':16 ''man'':18 ''must'':15 ''outback'':21 ''pastri'':8 ''rebel'':2 ''roxann'':1 ''stori'':5', '1', '2013-05-26T14:50:58.951000', 171, 'R', 2006, 5, '0.99', '9.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Roxanne Rebel'), - ('A Boring Story of a Womanizer And a Pioneer who must Face a Dog in California', '''bird'':1 ''bore'':4 ''california'':18 ''dog'':16 ''face'':14 ''must'':13 ''perdit'':2 ''pioneer'':11 ''stori'':5 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 61, 'G', 2006, 5, '4.99', '15.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Birds Perdition'), - ('A Astounding Documentary of a Butler And a Cat who must Find a Frisbee in Ancient China', '''ancient'':18 ''astound'':4 ''butler'':8 ''cat'':11 ''china'':19 ''control'':2 ''documentari'':5 ''find'':14 ''frisbe'':16 ''must'':13 ''path'':1', '1', '2013-05-26T14:50:58.951000', 118, 'PG', 2006, 3, '4.99', '9.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Paths Control'), - ('A Unbelieveable Panorama of a Technical Writer And a Man who must Pursue a Frisbee in A U-Boat', '''boat'':22 ''candid'':2 ''forev'':1 ''frisbe'':17 ''man'':12 ''must'':14 ''panorama'':5 ''pursu'':15 ''technic'':8 ''u'':21 ''u-boat'':20 ''unbeliev'':4 ''writer'':9', '1', '2013-05-26T14:50:58.951000', 131, 'NC-17', 2006, 7, '2.99', '28.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Forever Candidate'), - ('A Taut Character Study of a Husband And a Waitress who must Sink a Squirrel in A MySQL Convention', '''charact'':5 ''convent'':21 ''convers'':1 ''downhil'':2 ''husband'':9 ''must'':14 ''mysql'':20 ''sink'':15 ''squirrel'':17 ''studi'':6 ''taut'':4 ''waitress'':12', '1', '2013-05-26T14:50:58.951000', 112, 'R', 2006, 4, '4.99', '14.99', ARRAY['Commentaries']::text[], 'Conversation Downhill'), - ('A Action-Packed Display of a Woman And a Dentist who must Redeem a Forensic Psychologist in The Canadian Rockies', '''action'':5 ''action-pack'':4 ''canadian'':22 ''dentist'':13 ''display'':7 ''doubl'':2 ''forens'':18 ''inform'':1 ''must'':15 ''pack'':6 ''psychologist'':19 ''redeem'':16 ''rocki'':23 ''woman'':10', '1', '2013-05-26T14:50:58.951000', 74, 'NC-17', 2006, 4, '4.99', '23.99', ARRAY['Trailers', 'Commentaries']::text[], 'Informer Double'), - ('A Boring Epistle of a Butler And a Cat who must Fight a Pastry Chef in A MySQL Convention', '''alamo'':1 ''bore'':4 ''butler'':8 ''cat'':11 ''chef'':17 ''convent'':21 ''epistl'':5 ''fight'':14 ''must'':13 ''mysql'':20 ''pastri'':16 ''videotap'':2', '1', '2013-05-26T14:50:58.951000', 126, 'G', 2006, 6, '0.99', '16.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Alamo Videotape'), - ('A Stunning Saga of a Butler And a Woman who must Pursue a Explorer in Australia', '''australia'':18 ''butler'':8 ''explor'':16 ''freddi'':2 ''must'':13 ''pursu'':14 ''saga'':5 ''sister'':1 ''stun'':4 ''woman'':11', '1', '2013-05-26T14:50:58.951000', 152, 'PG-13', 2006, 5, '4.99', '19.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Sister Freddy'), - ('A Lacklusture Epistle of a Boat And a Technical Writer who must Fight a A Shark in The Canadian Rockies', '''boat'':8 ''canadian'':21 ''chill'':1 ''epistl'':5 ''fight'':15 ''lacklustur'':4 ''luck'':2 ''must'':14 ''rocki'':22 ''shark'':18 ''technic'':11 ''writer'':12', '1', '2013-05-26T14:50:58.951000', 142, 'PG', 2006, 6, '0.99', '17.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Chill Luck'), - ('A Action-Packed Tale of a Sumo Wrestler And a A Shark who must Meet a Frisbee in California', '''action'':5 ''action-pack'':4 ''california'':22 ''dorado'':1 ''frisbe'':20 ''meet'':18 ''must'':17 ''not'':2 ''pack'':6 ''shark'':15 ''sumo'':10 ''tale'':7 ''wrestler'':11', '1', '2013-05-26T14:50:58.951000', 139, 'NC-17', 2006, 5, '4.99', '26.99', ARRAY['Commentaries']::text[], 'Dorado Notting'), - ('A Action-Packed Display of a Mad Cow And a Astronaut who must Kill a Car in Ancient India', '''action'':5 ''action-pack'':4 ''ancient'':21 ''astronaut'':14 ''car'':19 ''cow'':11 ''display'':7 ''india'':22 ''kill'':17 ''mad'':10 ''must'':16 ''pack'':6 ''phantom'':2 ''wardrob'':1', '1', '2013-05-26T14:50:58.951000', 178, 'G', 2006, 6, '2.99', '19.99', ARRAY['Trailers', 'Commentaries']::text[], 'Wardrobe Phantom'), - ('A Insightful Panorama of a Teacher And a Teacher who must Overcome a Mad Cow in An Abandoned Fun House', '''abandon'':20 ''artist'':2 ''cow'':17 ''fun'':21 ''hous'':22 ''insight'':4 ''mad'':16 ''must'':13 ''overcom'':14 ''panorama'':5 ''teacher'':8,11 ''wall'':1', '1', '2013-05-26T14:50:58.951000', 135, 'PG', 2006, 7, '4.99', '19.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Walls Artist'), - ('A Brilliant Epistle of a Composer And a Frisbee who must Conquer a Husband in The Outback', '''brilliant'':4 ''compos'':8 ''conquer'':14 ''epistl'':5 ''frisbe'':11 ''goldmin'':1 ''husband'':16 ''must'':13 ''outback'':19 ''tycoon'':2', '1', '2013-05-26T14:50:58.951000', 153, 'R', 2006, 6, '0.99', '20.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Goldmine Tycoon'), - ('A Epic Reflection of a Womanizer And a Squirrel who must Discover a Husband in A Jet Boat', '''boat'':20 ''command'':2 ''discov'':14 ''drifter'':1 ''epic'':4 ''husband'':16 ''jet'':19 ''must'':13 ''reflect'':5 ''squirrel'':11 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 61, 'PG-13', 2006, 5, '4.99', '18.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Drifter Commandments'), - ('A Fanciful Documentary of a Boy And a Woman who must Redeem a Womanizer in A Jet Boat', '''boat'':20 ''boy'':8 ''doctor'':2 ''documentari'':5 ''fanci'':4 ''hyde'':1 ''jet'':19 ''must'':13 ''redeem'':14 ''woman'':11,16', '1', '2013-05-26T14:50:58.951000', 100, 'G', 2006, 5, '2.99', '11.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Hyde Doctor'), - ('A Stunning Epistle of a Boat And a Man who must Challenge a A Shark in A Baloon Factory', '''baloon'':20 ''boat'':8 ''cabin'':1 ''challeng'':14 ''epistl'':5 ''factori'':21 ''flash'':2 ''man'':11 ''must'':13 ''shark'':17 ''stun'':4', '1', '2013-05-26T14:50:58.951000', 53, 'NC-17', 2006, 4, '0.99', '25.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Cabin Flash'), - ('A Thoughtful Panorama of a Car And a Crocodile who must Sink a Monkey in The Sahara Desert', '''car'':8 ''color'':1 ''crocodil'':11 ''desert'':20 ''monkey'':16 ''must'':13 ''panorama'':5 ''philadelphia'':2 ''sahara'':19 ''sink'':14 ''thought'':4', '1', '2013-05-26T14:50:58.951000', 149, 'G', 2006, 6, '2.99', '19.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Color Philadelphia'), - ('A Awe-Inspiring Documentary of a Woman And a Husband who must Sink a Database Administrator in The First Manned Space Station', '''administr'':19 ''awe'':5 ''awe-inspir'':4 ''crow'':1 ''databas'':18 ''documentari'':7 ''first'':22 ''greas'':2 ''husband'':13 ''inspir'':6 ''man'':23 ''must'':15 ''sink'':16 ''space'':24 ''station'':25 ''woman'':10', '1', '2013-05-26T14:50:58.951000', 104, 'PG', 2006, 6, '0.99', '22.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Crow Grease'), - ('A Emotional Panorama of a Secret Agent And a Waitress who must Escape a Composer in Soviet Georgia', '''agent'':9 ''compos'':17 ''emot'':4 ''escap'':15 ''georgia'':20 ''greas'':1 ''must'':14 ''panorama'':5 ''secret'':8 ''soviet'':19 ''waitress'':12 ''youth'':2', '1', '2013-05-26T14:50:58.951000', 135, 'G', 2006, 7, '0.99', '20.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Grease Youth'), - ('A Fateful Character Study of a Husband And a Dog who must Find a Feminist in Ancient India', '''ancient'':19 ''charact'':5 ''dog'':12 ''fate'':4 ''feminist'':17 ''find'':15 ''husband'':9 ''india'':20 ''must'':14 ''orient'':2 ''sleuth'':1 ''studi'':6', '1', '2013-05-26T14:50:58.951000', 87, 'NC-17', 2006, 4, '0.99', '25.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Sleuth Orient'), - ('A Fanciful Panorama of a Husband And a Pioneer who must Outgun a Dog in A Baloon', '''antitrust'':2 ''baloon'':19 ''birch'':1 ''dog'':16 ''fanci'':4 ''husband'':8 ''must'':13 ''outgun'':14 ''panorama'':5 ''pioneer'':11', '1', '2013-05-26T14:50:58.951000', 162, 'PG', 2006, 4, '4.99', '18.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Birch Antitrust'), - ('A Unbelieveable Story of a Composer And a Dog who must Overcome a Womanizer in An Abandoned Amusement Park', '''abandon'':19 ''amus'':20 ''beast'':2 ''compos'':8 ''dog'':11 ''heavyweight'':1 ''must'':13 ''overcom'':14 ''park'':21 ''stori'':5 ''unbeliev'':4 ''woman'':16', '1', '2013-05-26T14:50:58.951000', 102, 'G', 2006, 6, '4.99', '25.99', ARRAY['Deleted Scenes']::text[], 'Heavyweights Beast'), - ('A Fast-Paced Epistle of a Boy And a Explorer who must Escape a Dog in A U-Boat', '''anonym'':2 ''boat'':23 ''boy'':10 ''dog'':18 ''epistl'':7 ''escap'':16 ''explor'':13 ''fast'':5 ''fast-pac'':4 ''hollywood'':1 ''must'':15 ''pace'':6 ''u'':22 ''u-boat'':21', '1', '2013-05-26T14:50:58.951000', 69, 'PG', 2006, 7, '0.99', '29.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Hollywood Anonymous'), - ('A Awe-Inspiring Reflection of a Boy And a Man who must Discover a Moose in The Sahara Desert', '''awe'':5 ''awe-inspir'':4 ''boy'':10 ''desert'':22 ''discov'':16 ''inspir'':6 ''man'':13 ''moos'':18 ''must'':15 ''paycheck'':1 ''reflect'':7 ''sahara'':21 ''wait'':2', '1', '2013-05-26T14:50:58.951000', 145, 'PG-13', 2006, 4, '4.99', '27.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Paycheck Wait'), - ('A Thoughtful Character Study of a Frisbee And a Pastry Chef who must Fight a Dentist in The First Manned Space Station', '''blade'':1 ''charact'':5 ''chef'':13 ''dentist'':18 ''fight'':16 ''first'':21 ''frisbe'':9 ''man'':22 ''must'':15 ''pastri'':12 ''polish'':2 ''space'':23 ''station'':24 ''studi'':6 ''thought'':4', '1', '2013-05-26T14:50:58.951000', 114, 'PG-13', 2006, 5, '0.99', '10.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Blade Polish'), - ('A Amazing Yarn of a Composer And a Squirrel who must Escape a Astronaut in Australia', '''amaz'':4 ''astronaut'':16 ''australia'':18 ''clash'':1 ''compos'':8 ''escap'':14 ''freddi'':2 ''must'':13 ''squirrel'':11 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 81, 'G', 2006, 6, '2.99', '12.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Clash Freddy'), - ('A Thrilling Character Study of a Robot And a Squirrel who must Face a Dog in Ancient India', '''ancient'':19 ''bunch'':2 ''charact'':5 ''dog'':17 ''face'':15 ''india'':20 ''must'':14 ''robot'':9 ''squirrel'':12 ''studi'':6 ''thrill'':4 ''train'':1', '1', '2013-05-26T14:50:58.951000', 71, 'R', 2006, 3, '4.99', '26.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Train Bunch'), - ('A Beautiful Display of a Pioneer And a Squirrel who must Vanquish a Sumo Wrestler in Soviet Georgia', '''beauti'':4 ''boondock'':2 ''display'':5 ''georgia'':20 ''handicap'':1 ''must'':13 ''pioneer'':8 ''soviet'':19 ''squirrel'':11 ''sumo'':16 ''vanquish'':14 ''wrestler'':17', '1', '2013-05-26T14:50:58.951000', 108, 'R', 2006, 4, '0.99', '28.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Handicap Boondock') - ) AS data(description, fulltext, old_language_id, last_update, length, rating, release_year, rental_duration, rental_rate, replacement_cost, special_features, title) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."language"' - AND map0.old_id = data.old_language_id - RETURNING film_id - ) - SELECT array_agg(film_id) INTO v_new_ids_film FROM inserted; - - FOR i IN 1..array_length(v_new_ids_film, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."film"', v_old_ids_film[i], v_new_ids_film[i]::TEXT); - END LOOP; - - v_old_ids_film := ARRAY['530', '59', '691', '317', '596', '348', '60', '479', '908', '335', '774', '838', '294', '788', '880', '903', '700', '719', '153', '44', '922', '38', '746', '716', '714', '713', '349', '53', '640', '40', '245', '302', '104', '493', '203', '673', '837', '790', '268', '151', '927', '966', '652', '140', '764', '227', '1', '202', '577', '983', '437', '66', '469', '851', '465', '295', '489', '259', '41', '149', '515', '401', '518', '561', '386', '602', '285', '28', '811', '702', '759', '694', '344', '266', '490', '440', '883', '287', '953', '383', '717', '327', '359', '237', '325', '971', '391', '263', '57', '785', '130', '750', '46', '375', '548', '911', '567', '627', '482', '476']; - WITH inserted AS ( - INSERT INTO "public"."film" ("description", "fulltext", "language_id", "last_update", "length", "rating", "release_year", "rental_duration", "rental_rate", "replacement_cost", "special_features", "title") - SELECT - data.description::text, - data.fulltext::tsvector, - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.length::smallint, - data.rating::mpaa_rating, - data.release_year::integer, - data.rental_duration::smallint, - data.rental_rate::numeric, - data.replacement_cost::numeric, - data.special_features::text[], - data.title::character varying - FROM (VALUES - ('A Action-Packed Display of a Frisbee And a Pastry Chef who must Pursue a Crocodile in A Jet Boat', '''action'':5 ''action-pack'':4 ''arizona'':2 ''boat'':23 ''chef'':14 ''crocodil'':19 ''display'':7 ''frisbe'':10 ''jet'':22 ''lord'':1 ''must'':16 ''pack'':6 ''pastri'':13 ''pursu'':17', '1', '2013-05-26T14:50:58.951000', 108, 'PG-13', 2006, 5, '2.99', '27.99', ARRAY['Trailers']::text[], 'Lord Arizona'), - ('A Astounding Saga of a Dog And a Boy who must Kill a Teacher in The First Manned Space Station', '''astound'':4 ''bear'':1 ''boy'':11 ''dog'':8 ''first'':19 ''graceland'':2 ''kill'':14 ''man'':20 ''must'':13 ''saga'':5 ''space'':21 ''station'':22 ''teacher'':16', '1', '2013-05-26T14:50:58.951000', 160, 'R', 2006, 4, '2.99', '20.99', ARRAY['Deleted Scenes']::text[], 'Bear Graceland'), - ('A Thoughtful Epistle of a Womanizer And a Monkey who must Vanquish a Dentist in A Monastery', '''dentist'':16 ''epistl'':5 ''forev'':2 ''monasteri'':19 ''monkey'':11 ''must'':13 ''poseidon'':1 ''thought'':4 ''vanquish'':14 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 159, 'PG-13', 2006, 6, '4.99', '29.99', ARRAY['Commentaries']::text[], 'Poseidon Forever'), - ('A Amazing Yarn of a Dentist And a A Shark who must Vanquish a Madman in An Abandoned Mine Shaft', '''abandon'':20 ''amaz'':4 ''dentist'':8 ''firebal'':1 ''madman'':17 ''mine'':21 ''must'':14 ''philadelphia'':2 ''shaft'':22 ''shark'':12 ''vanquish'':15 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 148, 'PG', 2006, 4, '0.99', '25.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Fireball Philadelphia'), - ('A Thoughtful Display of a Astronaut And a Feminist who must Chase a Frisbee in A Jet Boat', '''astronaut'':8 ''boat'':20 ''cabin'':2 ''chase'':14 ''display'':5 ''feminist'':11 ''frisbe'':16 ''jet'':19 ''moonshin'':1 ''must'':13 ''thought'':4', '1', '2013-05-26T14:50:58.951000', 171, 'PG-13', 2006, 4, '4.99', '25.99', ARRAY['Behind the Scenes']::text[], 'Moonshine Cabin'), - ('A Thoughtful Display of a Mad Scientist And a Secret Agent who must Chase a Boat in Berlin', '''agent'':13 ''berlin'':20 ''boat'':18 ''chase'':16 ''display'':5 ''gandhi'':1 ''kwai'':2 ''mad'':8 ''must'':15 ''scientist'':9 ''secret'':12 ''thought'':4', '1', '2013-05-26T14:50:58.951000', 86, 'PG-13', 2006, 7, '0.99', '9.99', ARRAY['Trailers']::text[], 'Gandhi Kwai'), - ('A Awe-Inspiring Epistle of a Student And a Squirrel who must Defeat a Boy in Ancient China', '''ancient'':20 ''awe'':5 ''awe-inspir'':4 ''beast'':1 ''boy'':18 ''china'':21 ''defeat'':16 ''epistl'':7 ''hunchback'':2 ''inspir'':6 ''must'':15 ''squirrel'':13 ''student'':10', '1', '2013-05-26T14:50:58.951000', 89, 'R', 2006, 3, '4.99', '22.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Beast Hunchback'), - ('A Astounding Reflection of a Explorer And a Dentist who must Pursue a Student in Nigeria', '''astound'':4 ''beneath'':2 ''dentist'':11 ''explor'':8 ''jedi'':1 ''must'':13 ''nigeria'':18 ''pursu'':14 ''reflect'':5 ''student'':16', '1', '2013-05-26T14:50:58.951000', 128, 'PG', 2006, 7, '0.99', '12.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Jedi Beneath'), - ('A Unbelieveable Story of a Boy And a Mad Cow who must Challenge a Database Administrator in The Sahara Desert', '''administr'':18 ''boy'':8 ''challeng'':15 ''cow'':12 ''databas'':17 ''desert'':22 ''guy'':2 ''mad'':11 ''must'':14 ''sahara'':21 ''stori'':5 ''trap'':1 ''unbeliev'':4', '1', '2013-05-26T14:50:58.951000', 110, 'G', 2006, 3, '4.99', '11.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Trap Guys'), - ('A Emotional Reflection of a Dentist And a Mad Cow who must Face a Squirrel in A Baloon', '''baloon'':20 ''cleopatra'':2 ''cow'':12 ''dentist'':8 ''emot'':4 ''face'':15 ''freedom'':1 ''mad'':11 ''must'':14 ''reflect'':5 ''squirrel'':17', '1', '2013-05-26T14:50:58.951000', 133, 'PG-13', 2006, 5, '0.99', '23.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Freedom Cleopatra'), - ('A Fast-Paced Tale of a Car And a Mad Scientist who must Kill a Womanizer in Ancient Japan', '''ancient'':21 ''car'':10 ''fast'':5 ''fast-pac'':4 ''japan'':22 ''kill'':17 ''mad'':13 ''must'':16 ''pace'':6 ''scientist'':14 ''searcher'':1 ''tale'':7 ''wait'':2 ''woman'':19', '1', '2013-05-26T14:50:58.951000', 182, 'NC-17', 2006, 3, '2.99', '22.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Searchers Wait'), - ('A Touching Display of a Pioneer And a Butler who must Chase a Car in California', '''armageddon'':2 ''butler'':11 ''california'':18 ''car'':16 ''chase'':14 ''display'':5 ''must'':13 ''pioneer'':8 ''stagecoach'':1 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 112, 'R', 2006, 5, '4.99', '25.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Stagecoach Armageddon'), - ('A Amazing Drama of a Butler And a Husband who must Reach a A Shark in A U-Boat', '''amaz'':4 ''boat'':22 ''butler'':8 ''drama'':5 ''expec'':1 ''husband'':11 ''must'':13 ''natur'':2 ''reach'':14 ''shark'':17 ''u'':21 ''u-boat'':20', '1', '2013-05-26T14:50:58.951000', 138, 'PG-13', 2006, 5, '4.99', '26.99', ARRAY['Deleted Scenes']::text[], 'Expecations Natural'), - ('A Thrilling Saga of a Monkey And a Frisbee who must Escape a Explorer in The Outback', '''escap'':14 ''explor'':16 ''frisbe'':11 ''monkey'':8 ''must'':13 ''outback'':19 ''saga'':5 ''ship'':1 ''thrill'':4 ''wonderland'':2', '1', '2013-05-26T14:50:58.951000', 104, 'R', 2006, 5, '2.99', '15.99', ARRAY['Commentaries']::text[], 'Ship Wonderland'), - ('A Action-Packed Panorama of a Technical Writer And a Man who must Build a Forensic Psychologist in A Manhattan Penthouse', '''action'':5 ''action-pack'':4 ''build'':17 ''forens'':19 ''heartbreak'':2 ''man'':14 ''manhattan'':23 ''must'':16 ''pack'':6 ''panorama'':7 ''penthous'':24 ''psychologist'':20 ''technic'':10 ''telemark'':1 ''writer'':11', '1', '2013-05-26T14:50:58.951000', 152, 'PG-13', 2006, 6, '2.99', '9.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Telemark Heartbreakers'), - ('A Amazing Epistle of a Squirrel And a Lumberjack who must Succumb a Database Administrator in A U-Boat', '''administr'':17 ''amaz'':4 ''boat'':22 ''databas'':16 ''epistl'':5 ''hobbit'':2 ''lumberjack'':11 ''must'':13 ''squirrel'':8 ''succumb'':14 ''traffic'':1 ''u'':21 ''u-boat'':20', '1', '2013-05-26T14:50:58.951000', 139, 'G', 2006, 5, '4.99', '13.99', ARRAY['Trailers', 'Commentaries']::text[], 'Traffic Hobbit'), - ('A Stunning Saga of a Mad Scientist And a Boat who must Overcome a Dentist in Ancient China', '''ancient'':19 ''boat'':12 ''china'':20 ''dentist'':17 ''mad'':8 ''must'':14 ''overcom'':15 ''prix'':1 ''saga'':5 ''scientist'':9 ''stun'':4 ''undef'':2', '1', '2013-05-26T14:50:58.951000', 115, 'R', 2006, 4, '2.99', '13.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Prix Undefeated'), - ('A Amazing Drama of a Mad Scientist And a Composer who must Build a Husband in The Outback', '''amaz'':4 ''build'':15 ''compos'':12 ''drama'':5 ''husband'':17 ''mad'':8 ''must'':14 ''outback'':20 ''record'':1 ''scientist'':9 ''zorro'':2', '1', '2013-05-26T14:50:58.951000', 182, 'PG', 2006, 7, '4.99', '11.99', ARRAY['Behind the Scenes']::text[], 'Records Zorro'), - ('A Fanciful Character Study of a Technical Writer And a Husband who must Redeem a Robot in The Outback', '''charact'':5 ''citizen'':1 ''fanci'':4 ''husband'':13 ''must'':15 ''outback'':21 ''redeem'':16 ''robot'':18 ''shrek'':2 ''studi'':6 ''technic'':9 ''writer'':10', '1', '2013-05-26T14:50:58.951000', 165, 'G', 2006, 7, '0.99', '18.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Citizen Shrek'), - ('A Fast-Paced Panorama of a Technical Writer And a Mad Scientist who must Find a Feminist in An Abandoned Mine Shaft', '''abandon'':23 ''attack'':1 ''fast'':5 ''fast-pac'':4 ''feminist'':20 ''find'':18 ''hate'':2 ''mad'':14 ''mine'':24 ''must'':17 ''pace'':6 ''panorama'':7 ''scientist'':15 ''shaft'':25 ''technic'':10 ''writer'':11', '1', '2013-05-26T14:50:58.951000', 113, 'PG-13', 2006, 5, '4.99', '21.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Attacks Hate'), - ('A Unbelieveable Display of a Crocodile And a Feminist who must Overcome a Moose in An Abandoned Amusement Park', '''abandon'':19 ''amus'':20 ''crocodil'':8 ''dalmat'':2 ''display'':5 ''feminist'':11 ''moos'':16 ''must'':13 ''overcom'':14 ''park'':21 ''unbeliev'':4 ''undef'':1', '1', '2013-05-26T14:50:58.951000', 107, 'PG-13', 2006, 7, '4.99', '22.99', ARRAY['Commentaries']::text[], 'Undefeated Dalmations'), - ('A Beautiful Yarn of a Pioneer And a Monkey who must Pursue a Explorer in The Sahara Desert', '''ark'':1 ''beauti'':4 ''desert'':20 ''explor'':16 ''monkey'':11 ''must'':13 ''pioneer'':8 ''pursu'':14 ''ridgemont'':2 ''sahara'':19 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 68, 'NC-17', 2006, 6, '0.99', '25.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Ark Ridgemont'), - ('A Awe-Inspiring Drama of a Astronaut And a Frisbee who must Conquer a Mad Scientist in Australia', '''astronaut'':10 ''australia'':21 ''awe'':5 ''awe-inspir'':4 ''conquer'':16 ''drama'':7 ''frisbe'':13 ''inspir'':6 ''mad'':18 ''must'':15 ''roug'':1 ''scientist'':19 ''squad'':2', '1', '2013-05-26T14:50:58.951000', 118, 'NC-17', 2006, 3, '0.99', '10.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Rouge Squad'), - ('A Thrilling Epistle of a Composer And a Sumo Wrestler who must Challenge a Mad Cow in A MySQL Convention', '''challeng'':15 ''compos'':8 ''convent'':22 ''cow'':18 ''epistl'':5 ''mad'':17 ''must'':14 ''mysql'':21 ''reap'':1 ''sumo'':11 ''thrill'':4 ''unfaith'':2 ''wrestler'':12', '1', '2013-05-26T14:50:58.951000', 136, 'PG-13', 2006, 6, '2.99', '26.99', ARRAY['Trailers', 'Commentaries']::text[], 'Reap Unfaithful'), - ('A Fateful Drama of a Frisbee And a Student who must Confront a Cat in A Shark Tank', '''cat'':16 ''confront'':14 ''drama'':5 ''fate'':4 ''frisbe'':8 ''go'':2 ''must'':13 ''random'':1 ''shark'':19 ''student'':11 ''tank'':20', '1', '2013-05-26T14:50:58.951000', 73, 'NC-17', 2006, 6, '2.99', '29.99', ARRAY['Trailers']::text[], 'Random Go'), - ('A Action-Packed Story of a Hunter And a Boy who must Discover a Lumberjack in Ancient India', '''action'':5 ''action-pack'':4 ''ancient'':20 ''boy'':13 ''discov'':16 ''hunter'':10 ''india'':21 ''lumberjack'':18 ''must'':15 ''pack'':6 ''rainbow'':1 ''shock'':2 ''stori'':7', '1', '2013-05-26T14:50:58.951000', 74, 'PG', 2006, 3, '4.99', '14.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Rainbow Shock'), - ('A Taut Character Study of a Woman And a A Shark who must Confront a Frisbee in Berlin', '''berlin'':20 ''charact'':5 ''confront'':16 ''frisbe'':18 ''gang'':1 ''must'':15 ''pride'':2 ''shark'':13 ''studi'':6 ''taut'':4 ''woman'':9', '1', '2013-05-26T14:50:58.951000', 185, 'PG-13', 2006, 4, '2.99', '27.99', ARRAY['Behind the Scenes']::text[], 'Gangs Pride'), - ('A Epic Drama of a Madman And a Cat who must Face a A Shark in An Abandoned Amusement Park', '''abandon'':20 ''amus'':21 ''bang'':1 ''cat'':11 ''drama'':5 ''epic'':4 ''face'':14 ''kwai'':2 ''madman'':8 ''must'':13 ''park'':22 ''shark'':17', '1', '2013-05-26T14:50:58.951000', 87, 'NC-17', 2006, 5, '2.99', '25.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Bang Kwai'), - ('A Fast-Paced Drama of a Hunter And a Boy who must Discover a Feminist in The Sahara Desert', '''boy'':13 ''desert'':22 ''discov'':16 ''drama'':7 ''fast'':5 ''fast-pac'':4 ''feminist'':18 ''hunter'':10 ''ice'':2 ''must'':15 ''opus'':1 ''pace'':6 ''sahara'':21', '1', '2013-05-26T14:50:58.951000', 102, 'R', 2006, 5, '4.99', '21.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Opus Ice'), - ('A Boring Saga of a Database Administrator And a Womanizer who must Battle a Waitress in Nigeria', '''administr'':9 ''armi'':1 ''battl'':15 ''bore'':4 ''databas'':8 ''flintston'':2 ''must'':14 ''nigeria'':19 ''saga'':5 ''waitress'':17 ''woman'':12', '1', '2013-05-26T14:50:58.951000', 148, 'R', 2006, 4, '0.99', '22.99', ARRAY['Trailers', 'Commentaries']::text[], 'Army Flintstones'), - ('A Thoughtful Yarn of a Womanizer And a Dog who must Challenge a Madman in The Gulf of Mexico', '''challeng'':14 ''dog'':11 ''doubl'':1 ''gulf'':19 ''madman'':16 ''mexico'':21 ''must'':13 ''thought'':4 ''woman'':8 ''wrath'':2 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 177, 'R', 2006, 4, '0.99', '28.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Double Wrath'), - ('A Thoughtful Documentary of a Mad Scientist And a A Shark who must Outrace a Feminist in Australia', '''australia'':20 ''documentari'':5 ''fantasia'':1 ''feminist'':18 ''mad'':8 ''must'':15 ''outrac'':16 ''park'':2 ''scientist'':9 ''shark'':13 ''thought'':4', '1', '2013-05-26T14:50:58.951000', 131, 'G', 2006, 5, '2.99', '29.99', ARRAY['Commentaries']::text[], 'Fantasia Park'), - ('A Awe-Inspiring Character Study of a Secret Agent And a Boat who must Find a Squirrel in The First Manned Space Station', '''agent'':12 ''awe'':5 ''awe-inspir'':4 ''boat'':15 ''bugsi'':1 ''charact'':7 ''find'':18 ''first'':23 ''inspir'':6 ''man'':24 ''must'':17 ''secret'':11 ''song'':2 ''space'':25 ''squirrel'':20 ''station'':26 ''studi'':8', '1', '2013-05-26T14:50:58.951000', 119, 'G', 2006, 4, '2.99', '17.99', ARRAY['Commentaries']::text[], 'Bugsy Song'), - ('A Epic Documentary of a Composer And a Robot who must Overcome a Car in Berlin', '''berlin'':18 ''car'':16 ''compos'':8 ''documentari'':5 ''epic'':4 ''exorcist'':2 ''kane'':1 ''must'':13 ''overcom'':14 ''robot'':11', '1', '2013-05-26T14:50:58.951000', 92, 'R', 2006, 5, '0.99', '18.99', ARRAY['Trailers', 'Commentaries']::text[], 'Kane Exorcist'), - ('A Fast-Paced Saga of a Pastry Chef And a Monkey who must Sink a Composer in Ancient India', '''ancient'':21 ''chef'':11 ''compos'':19 ''daisi'':1 ''fast'':5 ''fast-pac'':4 ''india'':22 ''menageri'':2 ''monkey'':14 ''must'':16 ''pace'':6 ''pastri'':10 ''saga'':7 ''sink'':17', '1', '2013-05-26T14:50:58.951000', 84, 'G', 2006, 5, '4.99', '9.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Daisy Menagerie'), - ('A Epic Saga of a Hunter And a Technical Writer who must Conquer a Cat in Ancient Japan', '''ancient'':19 ''cat'':17 ''conquer'':15 ''epic'':4 ''hunter'':8 ''japan'':20 ''ladybug'':2 ''must'':14 ''person'':1 ''saga'':5 ''technic'':11 ''writer'':12', '1', '2013-05-26T14:50:58.951000', 118, 'PG-13', 2006, 3, '0.99', '19.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Personal Ladybugs'), - ('A Lacklusture Panorama of a Woman And a Frisbee who must Chase a Crocodile in A Jet Boat', '''boat'':20 ''chase'':14 ''crocodil'':16 ''frisbe'':11 ''jet'':19 ''lacklustur'':4 ''must'':13 ''panorama'':5 ''stage'':1 ''woman'':8 ''world'':2', '1', '2013-05-26T14:50:58.951000', 85, 'PG', 2006, 4, '2.99', '19.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Stage World'), - ('A Fast-Paced Story of a Crocodile And a A Shark who must Sink a Pioneer in Berlin', '''berlin'':21 ''crocodil'':10 ''fast'':5 ''fast-pac'':4 ''must'':16 ''pace'':6 ''pioneer'':19 ''shark'':14 ''shootist'':1 ''sink'':17 ''stori'':7 ''superfli'':2', '1', '2013-05-26T14:50:58.951000', 67, 'PG-13', 2006, 6, '0.99', '22.99', ARRAY['Trailers']::text[], 'Shootist Superfly'), - ('A Amazing Panorama of a Mad Scientist And a Husband who must Meet a Woman in The Outback', '''amaz'':4 ''earli'':1 ''home'':2 ''husband'':12 ''mad'':8 ''meet'':15 ''must'':14 ''outback'':20 ''panorama'':5 ''scientist'':9 ''woman'':17', '1', '2013-05-26T14:50:58.951000', 96, 'NC-17', 2006, 6, '4.99', '27.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Early Home'), - ('A Brilliant Saga of a Pastry Chef And a Hunter who must Confront a Butler in Berlin', '''berlin'':19 ''brilliant'':4 ''butler'':17 ''chef'':9 ''cincinatti'':1 ''confront'':15 ''hunter'':12 ''must'':14 ''pastri'':8 ''saga'':5 ''whisper'':2', '1', '2013-05-26T14:50:58.951000', 143, 'NC-17', 2006, 5, '4.99', '26.99', ARRAY['Deleted Scenes']::text[], 'Cincinatti Whisperer'), - ('A Fanciful Reflection of a Boy And a Butler who must Pursue a Woman in Berlin', '''berlin'':18 ''boy'':8 ''butler'':11 ''fanci'':4 ''must'':13 ''pursu'':14 ''reflect'':5 ''upris'':1 ''uptown'':2 ''woman'':16', '1', '2013-05-26T14:50:58.951000', 174, 'NC-17', 2006, 6, '2.99', '16.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Uprising Uptown'), - ('A Action-Packed Tale of a Student And a Waitress who must Conquer a Lumberjack in An Abandoned Mine Shaft', '''abandon'':21 ''action'':5 ''action-pack'':4 ''apollo'':2 ''conquer'':16 ''lumberjack'':18 ''mine'':22 ''must'':15 ''pack'':6 ''shaft'':23 ''student'':10 ''tale'':7 ''waitress'':13 ''wed'':1', '1', '2013-05-26T14:50:58.951000', 70, 'PG', 2006, 3, '0.99', '14.99', ARRAY['Trailers']::text[], 'Wedding Apollo'), - ('A Emotional Drama of a Boy And a Technical Writer who must Redeem a Sumo Wrestler in California', '''boy'':8 ''california'':20 ''drama'':5 ''emot'':4 ''jawbreak'':2 ''must'':14 ''pajama'':1 ''redeem'':15 ''sumo'':17 ''technic'':11 ''wrestler'':18 ''writer'':12', '1', '2013-05-26T14:50:58.951000', 126, 'R', 2006, 3, '0.99', '14.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Pajama Jawbreaker'), - ('A Emotional Character Study of a Pioneer And a Girl who must Discover a Dog in Ancient Japan', '''ancient'':19 ''charact'':5 ''cheaper'':1 ''clyde'':2 ''discov'':15 ''dog'':17 ''emot'':4 ''girl'':12 ''japan'':20 ''must'':14 ''pioneer'':9 ''studi'':6', '1', '2013-05-26T14:50:58.951000', 87, 'G', 2006, 6, '0.99', '23.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Cheaper Clyde'), - ('A Thoughtful Reflection of a Mad Scientist And a Moose who must Kill a Husband in A Baloon', '''baloon'':20 ''husband'':17 ''kill'':15 ''lamb'':2 ''mad'':8 ''moos'':12 ''must'':14 ''reflect'':5 ''saturday'':1 ''scientist'':9 ''thought'':4', '1', '2013-05-26T14:50:58.951000', 150, 'G', 2006, 3, '4.99', '28.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Saturday Lambs'), - ('A Epic Saga of a Waitress And a Composer who must Face a Boat in A U-Boat', '''boat'':16,21 ''compos'':11 ''detail'':1 ''epic'':4 ''face'':14 ''must'':13 ''packer'':2 ''saga'':5 ''u'':20 ''u-boat'':19 ''waitress'':8', '1', '2013-05-26T14:50:58.951000', 88, 'R', 2006, 4, '4.99', '17.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Details Packer'), - ('A Epic Drama of a Feminist And a Mad Scientist who must Battle a Teacher in The Canadian Rockies', '''academi'':1 ''battl'':15 ''canadian'':20 ''dinosaur'':2 ''drama'':5 ''epic'':4 ''feminist'':8 ''mad'':11 ''must'':14 ''rocki'':21 ''scientist'':12 ''teacher'':17', '1', '2013-05-26T14:50:58.951000', 86, 'PG', 2006, 6, '0.99', '20.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Academy Dinosaur'), - ('A Epic Story of a A Shark And a Student who must Confront a Explorer in The Gulf of Mexico', '''confront'':15 ''daddi'':1 ''epic'':4 ''explor'':17 ''gulf'':20 ''mexico'':22 ''must'':14 ''pittsburgh'':2 ''shark'':9 ''stori'':5 ''student'':12', '1', '2013-05-26T14:50:58.951000', 161, 'G', 2006, 5, '4.99', '26.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Daddy Pittsburgh'), - ('A Lacklusture Epistle of a Cat And a Husband who must Confront a Boy in A MySQL Convention', '''boy'':16 ''cat'':8 ''confront'':14 ''convent'':20 ''epistl'':5 ''husband'':11 ''lacklustur'':4 ''mile'':1 ''mulan'':2 ''must'':13 ''mysql'':19', '1', '2013-05-26T14:50:58.951000', 64, 'PG', 2006, 4, '0.99', '10.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Mile Mulan'), - ('A Unbelieveable Documentary of a Teacher And a Monkey who must Defeat a Explorer in A U-Boat', '''boat'':21 ''dare'':2 ''defeat'':14 ''documentari'':5 ''explor'':16 ''monkey'':11 ''must'':13 ''teacher'':8 ''u'':20 ''u-boat'':19 ''unbeliev'':4 ''won'':1', '1', '2013-05-26T14:50:58.951000', 105, 'PG', 2006, 7, '2.99', '18.99', ARRAY['Behind the Scenes']::text[], 'Won Dares'), - ('A Taut Story of a Pioneer And a Squirrel who must Battle a Student in Soviet Georgia', '''battl'':14 ''dynamit'':2 ''georgia'':19 ''hous'':1 ''must'':13 ''pioneer'':8 ''soviet'':18 ''squirrel'':11 ''stori'':5 ''student'':16 ''taut'':4', '1', '2013-05-26T14:50:58.951000', 109, 'R', 2006, 7, '2.99', '13.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'House Dynamite'), - ('A Astounding Panorama of a Man And a Monkey who must Discover a Man in The First Manned Space Station', '''astound'':4 ''beneath'':1 ''discov'':14 ''first'':19 ''man'':8,16,20 ''monkey'':11 ''must'':13 ''panorama'':5 ''rush'':2 ''space'':21 ''station'':22', '1', '2013-05-26T14:50:58.951000', 53, 'NC-17', 2006, 6, '0.99', '27.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Beneath Rush'), - ('A Fast-Paced Documentary of a Mad Cow And a Boy who must Pursue a Dentist in A Baloon', '''baloon'':22 ''boy'':14 ''cow'':11 ''dentist'':19 ''documentari'':7 ''fast'':5 ''fast-pac'':4 ''iron'':1 ''mad'':10 ''moon'':2 ''must'':16 ''pace'':6 ''pursu'':17', '1', '2013-05-26T14:50:58.951000', 46, 'PG', 2006, 7, '4.99', '27.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Iron Moon'), - ('A Boring Panorama of a Secret Agent And a Girl who must Sink a Waitress in The Outback', '''agent'':9 ''bore'':4 ''girl'':12 ''hour'':2 ''must'':14 ''outback'':20 ''panorama'':5 ''secret'':8 ''sink'':15 ''straight'':1 ''waitress'':17', '1', '2013-05-26T14:50:58.951000', 151, 'R', 2006, 3, '0.99', '19.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Straight Hours'), - ('A Action-Packed Reflection of a Student And a Butler who must Discover a Database Administrator in A Manhattan Penthouse', '''action'':5 ''action-pack'':4 ''administr'':19 ''butler'':13 ''databas'':18 ''discov'':16 ''interview'':1 ''liaison'':2 ''manhattan'':22 ''must'':15 ''pack'':6 ''penthous'':23 ''reflect'':7 ''student'':10', '1', '2013-05-26T14:50:58.951000', 59, 'R', 2006, 4, '4.99', '17.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Interview Liaisons'), - ('A Amazing Character Study of a Mad Cow And a Squirrel who must Discover a Hunter in A U-Boat', '''amaz'':4 ''boat'':23 ''charact'':5 ''cow'':10 ''discov'':16 ''expend'':1 ''hunter'':18 ''mad'':9 ''must'':15 ''squirrel'':13 ''stallion'':2 ''studi'':6 ''u'':22 ''u-boat'':21', '1', '2013-05-26T14:50:58.951000', 97, 'PG', 2006, 3, '0.99', '14.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Expendable Stallion'), - ('A Epic Story of a Mad Cow And a Astronaut who must Challenge a Car in California', '''astronaut'':12 ''california'':19 ''car'':17 ''challeng'':15 ''cow'':9 ''epic'':4 ''hard'':2 ''juggler'':1 ''mad'':8 ''must'':14 ''stori'':5', '1', '2013-05-26T14:50:58.951000', 54, 'PG-13', 2006, 4, '0.99', '14.99', ARRAY['Trailers', 'Commentaries']::text[], 'Juggler Hardly'), - ('A Lacklusture Yarn of a Teacher And a Squirrel who must Overcome a Dog in A Shark Tank', '''dog'':16 ''duck'':1 ''lacklustur'':4 ''must'':13 ''overcom'':14 ''racer'':2 ''shark'':19 ''squirrel'':11 ''tank'':20 ''teacher'':8 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 116, 'NC-17', 2006, 4, '2.99', '15.99', ARRAY['Behind the Scenes']::text[], 'Duck Racer'), - ('A Fanciful Documentary of a Mad Cow And a Womanizer who must Find a Dentist in Berlin', '''arsenic'':1 ''berlin'':19 ''cow'':9 ''dentist'':17 ''documentari'':5 ''fanci'':4 ''find'':15 ''independ'':2 ''mad'':8 ''must'':14 ''woman'':12', '1', '2013-05-26T14:50:58.951000', 137, 'PG', 2006, 4, '0.99', '17.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Arsenic Independence'), - ('A Action-Packed Epistle of a Feminist And a Astronaut who must Conquer a Boat in A Manhattan Penthouse', '''action'':5 ''action-pack'':4 ''astronaut'':13 ''boat'':18 ''christma'':1 ''conquer'':16 ''epistl'':7 ''feminist'':10 ''manhattan'':21 ''moonshin'':2 ''must'':15 ''pack'':6 ''penthous'':22', '1', '2013-05-26T14:50:58.951000', 150, 'NC-17', 2006, 7, '0.99', '21.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Christmas Moonshine'), - ('A Astounding Tale of a A Shark And a Moose who must Meet a Womanizer in The Sahara Desert', '''astound'':4 ''desert'':21 ''legal'':1 ''meet'':15 ''moos'':12 ''must'':14 ''sahara'':20 ''secretari'':2 ''shark'':9 ''tale'':5 ''woman'':17', '1', '2013-05-26T14:50:58.951000', 113, 'PG', 2006, 7, '4.99', '14.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Legally Secretary'), - ('A Stunning Saga of a Sumo Wrestler And a Student who must Outrace a Moose in The Sahara Desert', '''desert'':21 ''french'':2 ''harold'':1 ''moos'':17 ''must'':14 ''outrac'':15 ''saga'':5 ''sahara'':20 ''student'':12 ''stun'':4 ''sumo'':8 ''wrestler'':9', '1', '2013-05-26T14:50:58.951000', 168, 'NC-17', 2006, 6, '0.99', '10.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Harold French'), - ('A Boring Drama of a A Shark And a Explorer who must Redeem a Waitress in The Canadian Rockies', '''bore'':4 ''canadian'':20 ''drama'':5 ''explor'':12 ''liaison'':1 ''must'':14 ''redeem'':15 ''rocki'':21 ''shark'':9 ''sweet'':2 ''waitress'':17', '1', '2013-05-26T14:50:58.951000', 140, 'PG', 2006, 5, '4.99', '15.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Liaisons Sweet'), - ('A Boring Character Study of a Student And a Robot who must Meet a Woman in California', '''bore'':4 ''california'':19 ''charact'':5 ''mask'':1 ''meet'':15 ''must'':14 ''peach'':2 ''robot'':12 ''student'':9 ''studi'':6 ''woman'':17', '1', '2013-05-26T14:50:58.951000', 123, 'NC-17', 2006, 6, '2.99', '26.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Mask Peach'), - ('A Intrepid Yarn of a Explorer And a Student who must Kill a Husband in An Abandoned Mine Shaft', '''abandon'':19 ''date'':2 ''explor'':8 ''gump'':1 ''husband'':16 ''intrepid'':4 ''kill'':14 ''mine'':20 ''must'':13 ''shaft'':21 ''student'':11 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 53, 'NC-17', 2006, 3, '4.99', '12.99', ARRAY['Deleted Scenes']::text[], 'Gump Date'), - ('A Lacklusture Display of a Waitress And a Lumberjack who must Chase a Pioneer in New Orleans', '''chase'':14 ''display'':5 ''lacklustur'':4 ''lumberjack'':11 ''mourn'':1 ''must'':13 ''new'':18 ''orlean'':19 ''pioneer'':16 ''purpl'':2 ''waitress'':8', '1', '2013-05-26T14:50:58.951000', 146, 'PG', 2006, 5, '0.99', '14.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Mourning Purple'), - ('A Intrepid Epistle of a Pastry Chef And a Pastry Chef who must Pursue a Crocodile in Ancient China', '''ancient'':20 ''bulworth'':2 ''chef'':9,13 ''china'':21 ''crocodil'':18 ''english'':1 ''epistl'':5 ''intrepid'':4 ''must'':15 ''pastri'':8,12 ''pursu'':16', '1', '2013-05-26T14:50:58.951000', 51, 'PG-13', 2006, 3, '0.99', '18.99', ARRAY['Deleted Scenes']::text[], 'English Bulworth'), - ('A Touching Panorama of a Waitress And a Woman who must Outrace a Dog in An Abandoned Amusement Park', '''abandon'':19 ''amus'':20 ''anthem'':1 ''dog'':16 ''luke'':2 ''must'':13 ''outrac'':14 ''panorama'':5 ''park'':21 ''touch'':4 ''waitress'':8 ''woman'':11', '1', '2013-05-26T14:50:58.951000', 91, 'PG-13', 2006, 5, '4.99', '16.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Anthem Luke'), - ('A Intrepid Drama of a Teacher And a Butler who must Build a Pastry Chef in Berlin', '''berlin'':19 ''build'':14 ''butler'':11 ''chef'':17 ''drama'':5 ''earring'':2 ''intrepid'':4 ''must'':13 ''pastri'':16 ''smile'':1 ''teacher'':8', '1', '2013-05-26T14:50:58.951000', 60, 'G', 2006, 4, '2.99', '29.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Smile Earring'), - ('A Unbelieveable Display of a Dog And a Crocodile who must Outrace a Man in Nigeria', '''bever'':2 ''crocodil'':11 ''display'':5 ''dog'':8 ''man'':16 ''must'':13 ''nigeria'':18 ''outrac'':14 ''pulp'':1 ''unbeliev'':4', '1', '2013-05-26T14:50:58.951000', 89, 'G', 2006, 4, '2.99', '12.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Pulp Beverly'), - ('A Awe-Inspiring Character Study of a Boy And a Feminist who must Sink a Crocodile in Ancient China', '''ancient'':21 ''apollo'':2 ''awe'':5 ''awe-inspir'':4 ''boy'':11 ''charact'':7 ''china'':22 ''crocodil'':19 ''feminist'':14 ''inspir'':6 ''must'':16 ''salut'':1 ''sink'':17 ''studi'':8', '1', '2013-05-26T14:50:58.951000', 73, 'R', 2006, 4, '2.99', '29.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Salute Apollo'), - ('A Epic Saga of a Boy And a Dentist who must Outrace a Madman in A U-Boat', '''boat'':21 ''boy'':8 ''dentist'':11 ''epic'':4 ''madman'':16 ''must'':13 ''oleand'':2 ''outrac'':14 ''prejudic'':1 ''saga'':5 ''u'':20 ''u-boat'':19', '1', '2013-05-26T14:50:58.951000', 98, 'PG-13', 2006, 6, '4.99', '15.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Prejudice Oleander'), - ('A Lacklusture Reflection of a Boat And a Forensic Psychologist who must Fight a Waitress in A Monastery', '''boat'':8 ''fight'':15 ''forens'':11 ''furi'':1 ''lacklustur'':4 ''monasteri'':20 ''murder'':2 ''must'':14 ''psychologist'':12 ''reflect'':5 ''waitress'':17', '1', '2013-05-26T14:50:58.951000', 178, 'PG-13', 2006, 3, '0.99', '28.99', ARRAY['Deleted Scenes']::text[], 'Fury Murder'), - ('A Intrepid Documentary of a Forensic Psychologist And a Mad Scientist who must Face a Explorer in A U-Boat', '''boat'':23 ''documentari'':5 ''dynamit'':1 ''explor'':18 ''face'':16 ''forens'':8 ''intrepid'':4 ''mad'':12 ''must'':15 ''psychologist'':9 ''scientist'':13 ''tarzan'':2 ''u'':22 ''u-boat'':21', '1', '2013-05-26T14:50:58.951000', 141, 'PG-13', 2006, 4, '0.99', '27.99', ARRAY['Deleted Scenes']::text[], 'Dynamite Tarzan'), - ('A Intrepid Yarn of a Husband And a Womanizer who must Pursue a Mad Scientist in New Orleans', '''blade'':2 ''husband'':8 ''intrepid'':4 ''jumanji'':1 ''mad'':16 ''must'':13 ''new'':19 ''orlean'':20 ''pursu'':14 ''scientist'':17 ''woman'':11 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 121, 'G', 2006, 4, '2.99', '13.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Jumanji Blade'), - ('A Unbelieveable Yarn of a Student And a Database Administrator who must Outgun a Husband in An Abandoned Mine Shaft', '''abandon'':20 ''administr'':12 ''databas'':11 ''hunger'':1 ''husband'':17 ''mine'':21 ''must'':14 ''outgun'':15 ''roof'':2 ''shaft'':22 ''student'':8 ''unbeliev'':4 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 105, 'G', 2006, 6, '0.99', '21.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Hunger Roof'), - ('A Action-Packed Panorama of a Mad Scientist And a Robot who must Challenge a Student in Nigeria', '''action'':5 ''action-pack'':4 ''challeng'':17 ''mad'':10 ''must'':16 ''nigeria'':21 ''pack'':6 ''panorama'':7 ''past'':2 ''robot'':14 ''scientist'':11 ''student'':19 ''tequila'':1', '1', '2013-05-26T14:50:58.951000', 53, 'PG', 2006, 6, '4.99', '17.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Tequila Past'), - ('A Thoughtful Panorama of a Hunter And a Teacher who must Reach a Mad Cow in A U-Boat', '''boat'':22 ''cow'':17 ''entrap'':1 ''hunter'':8 ''mad'':16 ''must'':13 ''panorama'':5 ''reach'':14 ''satisfact'':2 ''teacher'':11 ''thought'':4 ''u'':21 ''u-boat'':20', '1', '2013-05-26T14:50:58.951000', 176, 'R', 2006, 5, '0.99', '19.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Entrapment Satisfaction'), - ('A Intrepid Epistle of a Woman And a Forensic Psychologist who must Succumb a Astronaut in A Manhattan Penthouse', '''astronaut'':17 ''cider'':2 ''epistl'':5 ''forens'':11 ''intrepid'':4 ''manhattan'':20 ''must'':14 ''penthous'':21 ''psychologist'':12 ''succumb'':15 ''wait'':1 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 112, 'PG-13', 2006, 3, '0.99', '9.99', ARRAY['Trailers']::text[], 'Wait Cider'), - ('A Unbelieveable Reflection of a Moose And a A Shark who must Defeat a Lumberjack in An Abandoned Mine Shaft', '''abandon'':20 ''defeat'':15 ''fiction'':2 ''groov'':1 ''lumberjack'':17 ''mine'':21 ''moos'':8 ''must'':14 ''reflect'':5 ''shaft'':22 ''shark'':12 ''unbeliev'':4', '1', '2013-05-26T14:50:58.951000', 111, 'NC-17', 2006, 6, '0.99', '13.99', ARRAY['Behind the Scenes']::text[], 'Groove Fiction'), - ('A Awe-Inspiring Reflection of a Forensic Psychologist And a Secret Agent who must Succumb a Pastry Chef in Soviet Georgia', '''agent'':15 ''awe'':5 ''awe-inspir'':4 ''chef'':21 ''forens'':10 ''georgia'':24 ''inspir'':6 ''must'':17 ''pastri'':20 ''psychologist'':11 ''rear'':1 ''reflect'':7 ''secret'':14 ''soviet'':23 ''succumb'':18 ''trade'':2', '1', '2013-05-26T14:50:58.951000', 97, 'NC-17', 2006, 6, '0.99', '23.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Rear Trading'), - ('A Lacklusture Tale of a Crocodile And a Composer who must Defeat a Madman in A U-Boat', '''boat'':21 ''compos'':11 ''crocodil'':8 ''defeat'':14 ''fool'':1 ''lacklustur'':4 ''madman'':16 ''mockingbird'':2 ''must'':13 ''tale'':5 ''u'':20 ''u-boat'':19', '1', '2013-05-26T14:50:58.951000', 158, 'PG', 2006, 3, '4.99', '24.99', ARRAY['Trailers', 'Commentaries']::text[], 'Fool Mockingbird'), - ('A Astounding Reflection of a Squirrel And a Sumo Wrestler who must Sink a Dentist in Ancient Japan', '''ancient'':19 ''astound'':4 ''dentist'':17 ''gladiat'':1 ''japan'':20 ''must'':14 ''reflect'':5 ''sink'':15 ''squirrel'':8 ''sumo'':11 ''westward'':2 ''wrestler'':12', '1', '2013-05-26T14:50:58.951000', 173, 'PG', 2006, 6, '4.99', '20.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Gladiator Westward'), - ('A Unbelieveable Saga of a Crocodile And a Student who must Discover a Cat in Ancient India', '''ancient'':18 ''cat'':16 ''crocodil'':8 ''discov'':14 ''divorc'':1 ''india'':19 ''must'':13 ''saga'':5 ''shine'':2 ''student'':11 ''unbeliev'':4', '1', '2013-05-26T14:50:58.951000', 47, 'G', 2006, 3, '2.99', '21.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Divorce Shining'), - ('A Action-Packed Epistle of a Robot And a Car who must Chase a Boat in Ancient Japan', '''action'':5 ''action-pack'':4 ''ancient'':20 ''boat'':18 ''car'':13 ''chase'':16 ''epistl'':7 ''float'':1 ''garden'':2 ''japan'':21 ''must'':15 ''pack'':6 ''robot'':10', '1', '2013-05-26T14:50:58.951000', 145, 'PG-13', 2006, 6, '2.99', '29.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Floats Garden'), - ('A Intrepid Story of a Pastry Chef And a Database Administrator who must Kill a Feminist in A MySQL Convention', '''administr'':13 ''bikini'':2 ''chef'':9 ''convent'':22 ''databas'':12 ''feminist'':18 ''intrepid'':4 ''kill'':16 ''must'':15 ''mysql'':21 ''pastri'':8 ''stori'':5 ''whale'':1', '1', '2013-05-26T14:50:58.951000', 109, 'PG-13', 2006, 4, '4.99', '11.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Whale Bikini'), - ('A Epic Epistle of a Database Administrator And a Crocodile who must Face a Madman in A Jet Boat', '''administr'':9 ''boat'':21 ''crocodil'':12 ''databas'':8 ''epic'':4 ''epistl'':5 ''face'':15 ''half'':1 ''jet'':20 ''madman'':17 ''must'':14 ''outfield'':2', '1', '2013-05-26T14:50:58.951000', 146, 'PG-13', 2006, 6, '2.99', '25.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Half Outfield'), - ('A Brilliant Panorama of a Girl And a Boy who must Face a Mad Scientist in An Abandoned Mine Shaft', '''abandon'':20 ''boy'':11 ''brilliant'':4 ''durham'':1 ''face'':14 ''girl'':8 ''mad'':16 ''mine'':21 ''must'':13 ''panki'':2 ''panorama'':5 ''scientist'':17 ''shaft'':22', '1', '2013-05-26T14:50:58.951000', 154, 'R', 2006, 6, '4.99', '14.99', ARRAY['Trailers', 'Commentaries']::text[], 'Durham Panky'), - ('A Stunning Epistle of a Man And a Husband who must Reach a Mad Scientist in A Jet Boat', '''basic'':1 ''boat'':21 ''easi'':2 ''epistl'':5 ''husband'':11 ''jet'':20 ''mad'':16 ''man'':8 ''must'':13 ''reach'':14 ''scientist'':17 ''stun'':4', '1', '2013-05-26T14:50:58.951000', 90, 'PG-13', 2006, 4, '2.99', '18.99', ARRAY['Deleted Scenes']::text[], 'Basic Easy'), - ('A Lacklusture Story of a Moose And a Monkey who must Confront a Butler in An Abandoned Amusement Park', '''abandon'':19 ''amus'':20 ''bubbl'':2 ''butler'':16 ''confront'':14 ''lacklustur'':4 ''monkey'':11 ''moos'':8 ''must'':13 ''park'':21 ''shawshank'':1 ''stori'':5', '1', '2013-05-26T14:50:58.951000', 80, 'PG', 2006, 6, '4.99', '20.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Shawshank Bubble'), - ('A Amazing Documentary of a Secret Agent And a Astronaut who must Vanquish a Hunter in A Shark Tank', '''agent'':9 ''amaz'':4 ''astronaut'':12 ''celebr'':1 ''documentari'':5 ''horn'':2 ''hunter'':17 ''must'':14 ''secret'':8 ''shark'':20 ''tank'':21 ''vanquish'':15', '1', '2013-05-26T14:50:58.951000', 110, 'PG-13', 2006, 7, '0.99', '24.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Celebrity Horn'), - ('A Touching Tale of a Cat And a Pastry Chef who must Conquer a Pastry Chef in A MySQL Convention', '''cat'':8 ''chef'':12,18 ''conquer'':15 ''convent'':22 ''must'':14 ''mysql'':21 ''pacif'':2 ''pastri'':11,17 ''run'':1 ''tale'':5 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 145, 'R', 2006, 3, '0.99', '25.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Run Pacific'), - ('A Beautiful Tale of a Dentist And a Mad Cow who must Battle a Moose in The Sahara Desert', '''autumn'':1 ''battl'':15 ''beauti'':4 ''cow'':12 ''crow'':2 ''dentist'':8 ''desert'':21 ''mad'':11 ''moos'':17 ''must'':14 ''sahara'':20 ''tale'':5', '1', '2013-05-26T14:50:58.951000', 108, 'G', 2006, 3, '4.99', '13.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Autumn Crow'), - ('A Unbelieveable Saga of a Teacher And a Monkey who must Fight a Girl in An Abandoned Mine Shaft', '''abandon'':19 ''fight'':14 ''frankenstein'':2 ''girl'':16 ''grail'':1 ''mine'':20 ''monkey'':11 ''must'':13 ''saga'':5 ''shaft'':21 ''teacher'':8 ''unbeliev'':4', '1', '2013-05-26T14:50:58.951000', 85, 'NC-17', 2006, 4, '2.99', '17.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Grail Frankenstein'), - ('A Insightful Story of a Teacher And a Hunter who must Face a Mad Cow in California', '''california'':19 ''chitti'':2 ''cow'':17 ''face'':14 ''hunter'':11 ''insight'':4 ''mad'':16 ''magnific'':1 ''must'':13 ''stori'':5 ''teacher'':8', '1', '2013-05-26T14:50:58.951000', 53, 'R', 2006, 3, '2.99', '27.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Magnificent Chitty'), - ('A Fanciful Character Study of a Lumberjack And a Car who must Discover a Cat in An Abandoned Amusement Park', '''abandon'':20 ''amus'':21 ''car'':12 ''cat'':17 ''charact'':5 ''discov'':15 ''fanci'':4 ''lumberjack'':9 ''must'':14 ''newton'':2 ''park'':22 ''studi'':6 ''trip'':1', '1', '2013-05-26T14:50:58.951000', 64, 'PG-13', 2006, 7, '4.99', '14.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Trip Newton'), - ('A Boring Documentary of a Dentist And a Butler who must Confront a Monkey in A MySQL Convention', '''bore'':4 ''butler'':11 ''chocol'':2 ''confront'':14 ''convent'':20 ''dentist'':8 ''documentari'':5 ''meet'':1 ''monkey'':16 ''must'':13 ''mysql'':19', '1', '2013-05-26T14:50:58.951000', 80, 'G', 2006, 3, '2.99', '26.99', ARRAY['Trailers']::text[], 'Meet Chocolate'), - ('A Beautiful Character Study of a Mad Cow And a Robot who must Reach a Womanizer in New Orleans', '''beauti'':4 ''charact'':5 ''cow'':10 ''mad'':9 ''must'':15 ''new'':20 ''north'':1 ''orlean'':21 ''reach'':16 ''robot'':13 ''studi'':6 ''tequila'':2 ''woman'':18', '1', '2013-05-26T14:50:58.951000', 67, 'NC-17', 2006, 4, '4.99', '9.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'North Tequila'), - ('A Boring Panorama of a Man And a Mad Cow who must Face a Explorer in Ancient India', '''ancient'':19 ''bore'':4 ''cow'':12 ''encino'':2 ''explor'':17 ''face'':15 ''india'':20 ''jeopardi'':1 ''mad'':11 ''man'':8 ''must'':14 ''panorama'':5', '1', '2013-05-26T14:50:58.951000', 102, 'R', 2006, 3, '0.99', '12.99', ARRAY['Trailers', 'Commentaries']::text[], 'Jeopardy Encino'), - ('A Thoughtful Tale of a Woman And a A Shark who must Conquer a Dog in A Monastery', '''conquer'':15 ''dog'':17 ''jason'':1 ''monasteri'':20 ''must'':14 ''shark'':12 ''tale'':5 ''thought'':4 ''trap'':2 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 130, 'NC-17', 2006, 5, '2.99', '9.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Jason Trap') - ) AS data(description, fulltext, old_language_id, last_update, length, rating, release_year, rental_duration, rental_rate, replacement_cost, special_features, title) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."language"' - AND map0.old_id = data.old_language_id - RETURNING film_id - ) - SELECT array_agg(film_id) INTO v_new_ids_film FROM inserted; - - FOR i IN 1..array_length(v_new_ids_film, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."film"', v_old_ids_film[i], v_new_ids_film[i]::TEXT); - END LOOP; - - v_old_ids_film := ARRAY['404', '906', '859', '674', '10', '481', '418', '300', '836', '881', '611', '455', '542', '933', '918', '37', '569', '712', '273', '671', '281', '910', '538', '84', '297', '256', '695', '467', '426', '472', '856', '288', '954', '833', '990', '942', '854', '631', '125', '30', '816', '135', '474', '485', '50', '552', '216', '246', '403', '173', '773', '503', '309', '928', '315', '684', '422', '93', '354', '996', '711', '124', '206', '323', '453', '279', '748', '1000', '893', '428', '970', '544', '238', '589', '498', '62', '145', '192', '537', '286', '33', '180', '968', '197', '849', '321', '840', '22', '536', '393', '159', '280', '103', '477', '303', '416', '800', '545', '351', '366']; - WITH inserted AS ( - INSERT INTO "public"."film" ("description", "fulltext", "language_id", "last_update", "length", "rating", "release_year", "rental_duration", "rental_rate", "replacement_cost", "special_features", "title") - SELECT - data.description::text, - data.fulltext::tsvector, - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.length::smallint, - data.rating::mpaa_rating, - data.release_year::integer, - data.rental_duration::smallint, - data.rental_rate::numeric, - data.replacement_cost::numeric, - data.special_features::text[], - data.title::character varying - FROM (VALUES - ('A Intrepid Reflection of a Mad Scientist And a Pioneer who must Overcome a Hunter in The First Manned Space Station', '''first'':20 ''handicap'':2 ''hate'':1 ''hunter'':17 ''intrepid'':4 ''mad'':8 ''man'':21 ''must'':14 ''overcom'':15 ''pioneer'':12 ''reflect'':5 ''scientist'':9 ''space'':22 ''station'':23', '1', '2013-05-26T14:50:58.951000', 107, 'PG', 2006, 4, '0.99', '26.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Hate Handicap'), - ('A Brilliant Display of a Composer And a Cat who must Succumb a A Shark in Ancient India', '''ancient'':19 ''brilliant'':4 ''cat'':11 ''compos'':8 ''display'':5 ''india'':20 ''must'':13 ''other'':2 ''shark'':17 ''succumb'':14 ''tramp'':1', '1', '2013-05-26T14:50:58.951000', 171, 'PG', 2006, 4, '0.99', '27.99', ARRAY['Deleted Scenes']::text[], 'Tramp Others'), - ('A Touching Story of a Dentist And a Database Administrator who must Conquer a Astronaut in An Abandoned Amusement Park', '''abandon'':20 ''administr'':12 ''amus'':21 ''astronaut'':17 ''conquer'':15 ''databas'':11 ''dentist'':8 ''must'':14 ''park'':22 ''stori'':5 ''sugar'':1 ''touch'':4 ''wonka'':2', '1', '2013-05-26T14:50:58.951000', 114, 'PG', 2006, 3, '4.99', '20.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Sugar Wonka'), - ('A Unbelieveable Reflection of a Explorer And a Boat who must Conquer a Woman in California', '''boat'':11 ''california'':18 ''conquer'':14 ''explor'':8 ''haunt'':2 ''must'':13 ''pet'':1 ''reflect'':5 ''unbeliev'':4 ''woman'':16', '1', '2013-05-26T14:50:58.951000', 99, 'PG', 2006, 3, '0.99', '11.99', ARRAY['Trailers', 'Commentaries']::text[], 'Pet Haunting'), - ('A Action-Packed Tale of a Man And a Lumberjack who must Reach a Feminist in Ancient China', '''action'':5 ''action-pack'':4 ''aladdin'':1 ''ancient'':20 ''calendar'':2 ''china'':21 ''feminist'':18 ''lumberjack'':13 ''man'':10 ''must'':15 ''pack'':6 ''reach'':16 ''tale'':7', '1', '2013-05-26T14:50:58.951000', 63, 'NC-17', 2006, 6, '4.99', '24.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Aladdin Calendar'), - ('A Fanciful Epistle of a Student And a Astronaut who must Kill a Waitress in A Shark Tank', '''astronaut'':11 ''epistl'':5 ''fanci'':4 ''frogmen'':2 ''jekyl'':1 ''kill'':14 ''must'':13 ''shark'':19 ''student'':8 ''tank'':20 ''waitress'':16', '1', '2013-05-26T14:50:58.951000', 58, 'PG', 2006, 4, '2.99', '22.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Jekyll Frogmen'), - ('A Emotional Drama of a Husband And a Girl who must Outgun a Composer in The First Manned Space Station', '''alien'':2 ''compos'':16 ''drama'':5 ''emot'':4 ''first'':19 ''girl'':11 ''hobbit'':1 ''husband'':8 ''man'':20 ''must'':13 ''outgun'':14 ''space'':21 ''station'':22', '1', '2013-05-26T14:50:58.951000', 157, 'PG-13', 2006, 5, '0.99', '27.99', ARRAY['Commentaries']::text[], 'Hobbit Alien'), - ('A Fateful Saga of a Sumo Wrestler And a Hunter who must Redeem a A Shark in New Orleans', '''falcon'':1 ''fate'':4 ''hunter'':12 ''must'':14 ''new'':20 ''orlean'':21 ''redeem'':15 ''saga'':5 ''shark'':18 ''sumo'':8 ''volum'':2 ''wrestler'':9', '1', '2013-05-26T14:50:58.951000', 102, 'PG-13', 2006, 5, '4.99', '21.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Falcon Volume'), - ('A Fast-Paced Display of a Pastry Chef And a Dog who must Kill a Teacher in Berlin', '''berlin'':21 ''chef'':11 ''display'':7 ''dog'':14 ''fast'':5 ''fast-pac'':4 ''fish'':2 ''kill'':17 ''must'':16 ''pace'':6 ''pastri'':10 ''squad'':1 ''teacher'':19', '1', '2013-05-26T14:50:58.951000', 136, 'PG', 2006, 3, '2.99', '14.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Squad Fish'), - ('A Action-Packed Saga of a Forensic Psychologist And a Woman who must Battle a Womanizer in Soviet Georgia', '''action'':5 ''action-pack'':4 ''attract'':2 ''battl'':17 ''forens'':10 ''georgia'':22 ''must'':16 ''pack'':6 ''psychologist'':11 ''saga'':7 ''soviet'':21 ''templ'':1 ''woman'':14,19', '1', '2013-05-26T14:50:58.951000', 71, 'PG', 2006, 5, '4.99', '13.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Temple Attraction'), - ('A Touching Yarn of a Student And a Moose who must Fight a Mad Cow in Australia', '''australia'':19 ''cow'':17 ''fight'':14 ''mad'':16 ''moos'':11 ''musket'':1 ''must'':13 ''student'':8 ''touch'':4 ''wait'':2 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 73, 'PG', 2006, 7, '4.99', '17.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Musketeers Wait'), - ('A Awe-Inspiring Yarn of a Monkey And a Hunter who must Chase a Teacher in Ancient China', '''ancient'':20 ''awe'':5 ''awe-inspir'':4 ''chase'':16 ''china'':21 ''hunter'':13 ''imposs'':1 ''inspir'':6 ''monkey'':10 ''must'':15 ''prejudic'':2 ''teacher'':18 ''yarn'':7', '1', '2013-05-26T14:50:58.951000', 103, 'NC-17', 2006, 7, '4.99', '11.99', ARRAY['Deleted Scenes']::text[], 'Impossible Prejudice'), - ('A Fanciful Panorama of a Hunter And a Dentist who must Meet a Secret Agent in The Sahara Desert', '''agent'':17 ''dentist'':11 ''desert'':21 ''fanci'':4 ''hunter'':8 ''lock'':2 ''lust'':1 ''meet'':14 ''must'':13 ''panorama'':5 ''sahara'':20 ''secret'':16', '1', '2013-05-26T14:50:58.951000', 52, 'G', 2006, 3, '2.99', '28.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Lust Lock'), - ('A Epic Story of a Lumberjack And a Monkey who must Confront a Pioneer in A MySQL Convention', '''confront'':14 ''convent'':20 ''epic'':4 ''lumberjack'':8 ''monkey'':11 ''must'':13 ''mysql'':19 ''pioneer'':16 ''stori'':5 ''vampir'':1 ''whale'':2', '1', '2013-05-26T14:50:58.951000', 126, 'NC-17', 2006, 4, '4.99', '11.99', ARRAY['Trailers', 'Commentaries']::text[], 'Vampire Whale'), - ('A Touching Display of a Frisbee And a Boat who must Kill a Girl in A MySQL Convention', '''boat'':11 ''convent'':20 ''display'':5 ''frisbe'':8 ''girl'':16 ''kill'':14 ''must'':13 ''mysql'':19 ''pirat'':2 ''touch'':4 ''twist'':1', '1', '2013-05-26T14:50:58.951000', 152, 'PG', 2006, 4, '4.99', '23.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Twisted Pirates'), - ('A Brilliant Panorama of a Mad Scientist And a Mad Cow who must Meet a Pioneer in A Monastery', '''arizona'':1 ''bang'':2 ''brilliant'':4 ''cow'':13 ''mad'':8,12 ''meet'':16 ''monasteri'':21 ''must'':15 ''panorama'':5 ''pioneer'':18 ''scientist'':9', '1', '2013-05-26T14:50:58.951000', 121, 'PG', 2006, 3, '2.99', '28.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Arizona Bang'), - ('A Unbelieveable Panorama of a Composer And a Butler who must Overcome a Database Administrator in The First Manned Space Station', '''administr'':17 ''butler'':11 ''compos'':8 ''databas'':16 ''first'':20 ''man'':21 ''menageri'':1 ''must'':13 ''overcom'':14 ''panorama'':5 ''rushmor'':2 ''space'':22 ''station'':23 ''unbeliev'':4', '1', '2013-05-26T14:50:58.951000', 147, 'G', 2006, 7, '2.99', '18.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Menagerie Rushmore'), - ('A Amazing Drama of a Teacher And a Feminist who must Meet a Woman in The First Manned Space Station', '''amaz'':4 ''antitrust'':2 ''drama'':5 ''feminist'':11 ''first'':19 ''man'':20 ''meet'':14 ''must'':13 ''raider'':1 ''space'':21 ''station'':22 ''teacher'':8 ''woman'':16', '1', '2013-05-26T14:50:58.951000', 82, 'PG-13', 2006, 4, '0.99', '11.99', ARRAY['Deleted Scenes']::text[], 'Raiders Antitrust'), - ('A Beautiful Display of a Pastry Chef And a Pastry Chef who must Outgun a Forensic Psychologist in A Manhattan Penthouse', '''beauti'':4 ''chef'':9,13 ''display'':5 ''effect'':1 ''forens'':18 ''gladiat'':2 ''manhattan'':22 ''must'':15 ''outgun'':16 ''pastri'':8,12 ''penthous'':23 ''psychologist'':19', '1', '2013-05-26T14:50:58.951000', 107, 'PG', 2006, 6, '0.99', '14.99', ARRAY['Commentaries']::text[], 'Effect Gladiator'), - ('A Fast-Paced Story of a Car And a Cat who must Outgun a Hunter in Berlin', '''berlin'':20 ''car'':10 ''cat'':13 ''fargo'':2 ''fast'':5 ''fast-pac'':4 ''hunter'':18 ''must'':15 ''outgun'':16 ''pace'':6 ''perdit'':1 ''stori'':7', '1', '2013-05-26T14:50:58.951000', 99, 'NC-17', 2006, 7, '4.99', '27.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Perdition Fargo'), - ('A Astounding Drama of a Feminist And a Teacher who must Confront a Husband in A Baloon', '''astound'':4 ''baloon'':19 ''confront'':14 ''drama'':5 ''elf'':2 ''encino'':1 ''feminist'':8 ''husband'':16 ''must'':13 ''teacher'':11', '1', '2013-05-26T14:50:58.951000', 143, 'G', 2006, 6, '0.99', '9.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Encino Elf'), - ('A Boring Story of a Teacher And a Student who must Outgun a Cat in An Abandoned Mine Shaft', '''abandon'':19 ''bore'':4 ''cat'':16 ''jekyl'':2 ''mine'':20 ''must'':13 ''outgun'':14 ''shaft'':21 ''stori'':5 ''student'':11 ''teacher'':8 ''treatment'':1', '1', '2013-05-26T14:50:58.951000', 87, 'PG', 2006, 3, '0.99', '19.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Treatment Jekyll'), - ('A Boring Story of a Car And a Butler who must Build a Girl in Soviet Georgia', '''attack'':2 ''bore'':4 ''build'':14 ''butler'':11 ''car'':8 ''georgia'':19 ''girl'':16 ''loverboy'':1 ''must'':13 ''soviet'':18 ''stori'':5', '1', '2013-05-26T14:50:58.951000', 162, 'PG-13', 2006, 7, '0.99', '19.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Loverboy Attacks'), - ('A Awe-Inspiring Story of a Waitress And a Dog who must Discover a Dentist in Ancient Japan', '''ancient'':20 ''awe'':5 ''awe-inspir'':4 ''boil'':1 ''dare'':2 ''dentist'':18 ''discov'':16 ''dog'':13 ''inspir'':6 ''japan'':21 ''must'':15 ''stori'':7 ''waitress'':10', '1', '2013-05-26T14:50:58.951000', 102, 'PG', 2006, 7, '4.99', '13.99', ARRAY['Trailers', 'Commentaries']::text[], 'Boiled Dares'), - ('A Stunning Story of a Dog And a Feminist who must Face a Forensic Psychologist in Berlin', '''berlin'':19 ''conquer'':2 ''dog'':8 ''extraordinari'':1 ''face'':14 ''feminist'':11 ''forens'':16 ''must'':13 ''psychologist'':17 ''stori'':5 ''stun'':4', '1', '2013-05-26T14:50:58.951000', 122, 'G', 2006, 6, '2.99', '29.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Extraordinary Conquerer'), - ('A Fanciful Documentary of a Husband And a Explorer who must Reach a Madman in Ancient China', '''ancient'':18 ''china'':19 ''documentari'':5 ''drop'':1 ''explor'':11 ''fanci'':4 ''husband'':8 ''madman'':16 ''must'':13 ''reach'':14 ''waterfront'':2', '1', '2013-05-26T14:50:58.951000', 178, 'R', 2006, 6, '4.99', '20.99', ARRAY['Trailers', 'Commentaries']::text[], 'Drop Waterfront'), - ('A Fateful Panorama of a Technical Writer And a Moose who must Battle a Robot in Soviet Georgia', '''bang'':2 ''battl'':15 ''fate'':4 ''georgia'':20 ''moos'':12 ''must'':14 ''panorama'':5 ''presid'':1 ''robot'':17 ''soviet'':19 ''technic'':8 ''writer'':9', '1', '2013-05-26T14:50:58.951000', 144, 'PG', 2006, 6, '4.99', '12.99', ARRAY['Behind the Scenes']::text[], 'President Bang'), - ('A Fanciful Character Study of a Explorer And a Mad Scientist who must Vanquish a Squirrel in A Jet Boat', '''boat'':22 ''charact'':5 ''explor'':9 ''fanci'':4 ''intrigu'':1 ''jet'':21 ''mad'':12 ''must'':15 ''scientist'':13 ''squirrel'':18 ''studi'':6 ''vanquish'':16 ''worst'':2', '1', '2013-05-26T14:50:58.951000', 181, 'G', 2006, 6, '0.99', '10.99', ARRAY['Deleted Scenes']::text[], 'Intrigue Worst'), - ('A Touching Panorama of a Man And a Secret Agent who must Challenge a Teacher in A MySQL Convention', '''agent'':12 ''challeng'':15 ''convent'':21 ''home'':1 ''man'':8 ''must'':14 ''mysql'':20 ''panorama'':5 ''piti'':2 ''secret'':11 ''teacher'':17 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 185, 'R', 2006, 7, '4.99', '15.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Home Pity'), - ('A Astounding Character Study of a Monkey And a Moose who must Outgun a Cat in A U-Boat', '''african'':2 ''astound'':4 ''boat'':22 ''cat'':17 ''charact'':5 ''italian'':1 ''monkey'':9 ''moos'':12 ''must'':14 ''outgun'':15 ''studi'':6 ''u'':21 ''u-boat'':20', '1', '2013-05-26T14:50:58.951000', 174, 'G', 2006, 3, '4.99', '24.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Italian African'), - ('A Insightful Character Study of a Waitress And a Crocodile who must Sink a Waitress in The Gulf of Mexico', '''charact'':5 ''crocodil'':12 ''gulf'':20 ''insight'':4 ''intent'':2 ''mexico'':22 ''must'':14 ''sink'':15 ''streetcar'':1 ''studi'':6 ''waitress'':9,17', '1', '2013-05-26T14:50:58.951000', 73, 'R', 2006, 5, '4.99', '11.99', ARRAY['Commentaries']::text[], 'Streetcar Intentions'), - ('A Taut Yarn of a Astronaut And a Technical Writer who must Outgun a Boat in New Orleans', '''astronaut'':8 ''boat'':17 ''escap'':1 ''metropoli'':2 ''must'':14 ''new'':19 ''orlean'':20 ''outgun'':15 ''taut'':4 ''technic'':11 ''writer'':12 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 167, 'R', 2006, 7, '2.99', '20.99', ARRAY['Trailers']::text[], 'Escape Metropolis'), - ('A Beautiful Saga of a Feminist And a Composer who must Challenge a Moose in Berlin', '''beauti'':4 ''berlin'':18 ''challeng'':14 ''compos'':11 ''feminist'':8 ''jaw'':2 ''moos'':16 ''must'':13 ''saga'':5 ''wake'':1', '1', '2013-05-26T14:50:58.951000', 73, 'G', 2006, 7, '4.99', '18.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Wake Jaws'), - ('A Taut Story of a Dog And a Explorer who must Find a Astronaut in Berlin', '''astronaut'':16 ''berlin'':18 ''dog'':8 ''explor'':11 ''find'':14 ''must'':13 ''patton'':2 ''splendor'':1 ''stori'':5 ''taut'':4', '1', '2013-05-26T14:50:58.951000', 134, 'R', 2006, 5, '0.99', '20.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Splendor Patton'), - ('A Unbelieveable Tale of a Pioneer And a Astronaut who must Overcome a Robot in An Abandoned Amusement Park', '''abandon'':19 ''amus'':20 ''astronaut'':11 ''leatherneck'':2 ''must'':13 ''overcom'':14 ''park'':21 ''pioneer'':8 ''robot'':16 ''tale'':5 ''unbeliev'':4 ''world'':1', '1', '2013-05-26T14:50:58.951000', 171, 'PG-13', 2006, 3, '0.99', '13.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'World Leathernecks'), - ('A Lacklusture Display of a Butler And a Man who must Sink a Explorer in Soviet Georgia', '''butler'':8 ''display'':5 ''explor'':16 ''georgia'':19 ''lacklustur'':4 ''man'':11 ''must'':13 ''sink'':14 ''smoochi'':2 ''soviet'':18 ''vietnam'':1', '1', '2013-05-26T14:50:58.951000', 174, 'PG-13', 2006, 7, '0.99', '27.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Vietnam Smoochy'), - ('A Brilliant Character Study of a Secret Agent And a Man who must Find a Cat in The Gulf of Mexico', '''agent'':10 ''brilliant'':4 ''cat'':18 ''charact'':5 ''find'':16 ''graffiti'':2 ''gulf'':21 ''man'':13 ''mexico'':23 ''must'':15 ''secret'':9 ''stranger'':1 ''studi'':6', '1', '2013-05-26T14:50:58.951000', 119, 'R', 2006, 4, '4.99', '22.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Strangers Graffiti'), - ('A Fanciful Display of a Student And a Teacher who must Outgun a Crocodile in Nigeria', '''crocodil'':16 ''display'':5 ''fanci'':4 ''flight'':2 ''must'':13 ''nigeria'':18 ''novocain'':1 ''outgun'':14 ''student'':8 ''teacher'':11', '1', '2013-05-26T14:50:58.951000', 64, 'G', 2006, 4, '0.99', '11.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Novocaine Flight'), - ('A Intrepid Drama of a Frisbee And a Hunter who must Kill a Secret Agent in New Orleans', '''agent'':17 ''cassidi'':1 ''drama'':5 ''frisbe'':8 ''hunter'':11 ''intrepid'':4 ''kill'':14 ''must'':13 ''new'':19 ''orlean'':20 ''secret'':16 ''wyom'':2', '1', '2013-05-26T14:50:58.951000', 61, 'NC-17', 2006, 5, '2.99', '19.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Cassidy Wyoming'), - ('A Epic Story of a Pastry Chef And a Woman who must Chase a Feminist in An Abandoned Fun House', '''abandon'':20 ''anyth'':1 ''chase'':15 ''chef'':9 ''epic'':4 ''feminist'':17 ''fun'':21 ''hous'':22 ''must'':14 ''pastri'':8 ''savannah'':2 ''stori'':5 ''woman'':12', '1', '2013-05-26T14:50:58.951000', 82, 'R', 2006, 4, '2.99', '27.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Anything Savannah'), - ('A Fateful Display of a Lumberjack And a Girl who must Succumb a Mad Cow in A Manhattan Penthouse', '''cow'':17 ''display'':5 ''fate'':4 ''girl'':11 ''lumberjack'':8 ''mad'':16 ''manhattan'':20 ''must'':13 ''penthous'':21 ''rollercoast'':2 ''snowman'':1 ''succumb'':14', '1', '2013-05-26T14:50:58.951000', 62, 'G', 2006, 3, '0.99', '27.99', ARRAY['Trailers']::text[], 'Snowman Rollercoaster'), - ('A Astounding Story of a Forensic Psychologist And a Forensic Psychologist who must Overcome a Moose in Ancient China', '''ancient'':20 ''astound'':4 ''chanc'':1 ''china'':21 ''forens'':8,12 ''moos'':18 ''must'':15 ''overcom'':16 ''psychologist'':9,13 ''resurrect'':2 ''stori'':5', '1', '2013-05-26T14:50:58.951000', 70, 'R', 2006, 3, '2.99', '22.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Chance Resurrection'), - ('A Insightful Panorama of a Squirrel And a Mad Cow who must Confront a Student in The First Manned Space Station', '''bunch'':2 ''confront'':15 ''cow'':12 ''first'':20 ''insight'':4 ''jade'':1 ''mad'':11 ''man'':21 ''must'':14 ''panorama'':5 ''space'':22 ''squirrel'':8 ''station'':23 ''student'':17', '1', '2013-05-26T14:50:58.951000', 174, 'NC-17', 2006, 6, '2.99', '21.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Jade Bunch'), - ('A Lacklusture Documentary of a Madman And a Mad Cow who must Find a Feminist in Ancient Japan', '''ancient'':19 ''cow'':12 ''documentari'':5 ''feminist'':17 ''find'':15 ''japan'':20 ''jersey'':1 ''lacklustur'':4 ''mad'':11 ''madman'':8 ''must'':14 ''sassi'':2', '1', '2013-05-26T14:50:58.951000', 60, 'PG', 2006, 6, '4.99', '16.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Jersey Sassy'), - ('A Stunning Drama of a Forensic Psychologist And a Husband who must Overcome a Waitress in A Monastery', '''bake'':1 ''cleopatra'':2 ''drama'':5 ''forens'':8 ''husband'':12 ''monasteri'':20 ''must'':14 ''overcom'':15 ''psychologist'':9 ''stun'':4 ''waitress'':17', '1', '2013-05-26T14:50:58.951000', 182, 'G', 2006, 3, '2.99', '20.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Baked Cleopatra'), - ('A Thrilling Character Study of a Moose And a Student who must Escape a Butler in The First Manned Space Station', '''butler'':17 ''charact'':5 ''escap'':15 ''first'':20 ''float'':2 ''majest'':1 ''man'':21 ''moos'':9 ''must'':14 ''space'':22 ''station'':23 ''student'':12 ''studi'':6 ''thrill'':4', '1', '2013-05-26T14:50:58.951000', 130, 'PG', 2006, 5, '0.99', '15.99', ARRAY['Trailers']::text[], 'Majestic Floats'), - ('A Stunning Documentary of a Composer And a Mad Scientist who must Find a Technical Writer in A U-Boat', '''boat'':23 ''compos'':8 ''day'':1 ''documentari'':5 ''find'':15 ''mad'':11 ''must'':14 ''scientist'':12 ''stun'':4 ''technic'':17 ''u'':22 ''u-boat'':21 ''unfaith'':2 ''writer'':18', '1', '2013-05-26T14:50:58.951000', 113, 'G', 2006, 3, '4.99', '16.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Day Unfaithful'), - ('A Intrepid Panorama of a Butler And a Composer who must Meet a Mad Cow in The Sahara Desert', '''butler'':8 ''compos'':11 ''cow'':17 ''desert'':21 ''doubtfir'':1 ''intrepid'':4 ''labyrinth'':2 ''mad'':16 ''meet'':14 ''must'':13 ''panorama'':5 ''sahara'':20', '1', '2013-05-26T14:50:58.951000', 154, 'R', 2006, 5, '4.99', '16.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Doubtfire Labyrinth'), - ('A Taut Yarn of a Technical Writer And a Feminist who must Outrace a Dog in California', '''california'':19 ''dog'':17 ''feminist'':12 ''harri'':1 ''idaho'':2 ''must'':14 ''outrac'':15 ''taut'':4 ''technic'':8 ''writer'':9 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 121, 'PG-13', 2006, 5, '4.99', '18.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Harry Idaho'), - ('A Insightful Story of a Car And a Boy who must Battle a Technical Writer in A Baloon', '''baloon'':20 ''battl'':14 ''boy'':11 ''car'':8 ''confess'':1 ''insight'':4 ''maguir'':2 ''must'':13 ''stori'':5 ''technic'':16 ''writer'':17', '1', '2013-05-26T14:50:58.951000', 65, 'PG-13', 2006, 7, '4.99', '25.99', ARRAY['Behind the Scenes']::text[], 'Confessions Maguire'), - ('A Insightful Saga of a Man And a Forensic Psychologist who must Discover a Mad Cow in A MySQL Convention', '''convent'':22 ''cow'':18 ''discov'':15 ''forens'':11 ''insight'':4 ''mad'':17 ''man'':8 ''must'':14 ''mysql'':21 ''psychologist'':12 ''punk'':2 ''saga'':5 ''seabiscuit'':1', '1', '2013-05-26T14:50:58.951000', 112, 'NC-17', 2006, 6, '2.99', '28.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Seabiscuit Punk'), - ('A Amazing Yarn of a Robot And a Pastry Chef who must Redeem a Mad Scientist in The Outback', '''amaz'':4 ''chef'':12 ''chocol'':2 ''kramer'':1 ''mad'':17 ''must'':14 ''outback'':21 ''pastri'':11 ''redeem'':15 ''robot'':8 ''scientist'':18 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 171, 'R', 2006, 3, '2.99', '24.99', ARRAY['Trailers']::text[], 'Kramer Chocolate'), - ('A Brilliant Reflection of a Database Administrator And a Mad Cow who must Chase a Woman in The Canadian Rockies', '''administr'':9 ''brilliant'':4 ''canadian'':21 ''chase'':16 ''cow'':13 ''databas'':8 ''feud'':1 ''frogmen'':2 ''mad'':12 ''must'':15 ''reflect'':5 ''rocki'':22 ''woman'':18', '1', '2013-05-26T14:50:58.951000', 98, 'R', 2006, 6, '0.99', '29.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Feud Frogmen'), - ('A Fateful Documentary of a Dog And a Hunter who must Pursue a Teacher in An Abandoned Amusement Park', '''abandon'':19 ''amus'':20 ''documentari'':5 ''dog'':8 ''fate'':4 ''hunter'':11 ''must'':13 ''park'':21 ''pursu'':14 ''teacher'':16 ''uptown'':1 ''young'':2', '1', '2013-05-26T14:50:58.951000', 84, 'PG', 2006, 5, '2.99', '16.99', ARRAY['Commentaries']::text[], 'Uptown Young'), - ('A Fateful Tale of a Database Administrator And a Girl who must Battle a Squirrel in New Orleans', '''administr'':9 ''anaconda'':2 ''battl'':15 ''databas'':8 ''fate'':4 ''find'':1 ''girl'':12 ''must'':14 ''new'':19 ''orlean'':20 ''squirrel'':17 ''tale'':5', '1', '2013-05-26T14:50:58.951000', 156, 'R', 2006, 4, '0.99', '10.99', ARRAY['Trailers', 'Commentaries']::text[], 'Finding Anaconda'), - ('A Epic Saga of a Cat And a Squirrel who must Outgun a Robot in A U-Boat', '''boat'':21 ''cat'':8 ''epic'':4 ''jumanji'':2 ''must'':13 ''outgun'':14 ''pizza'':1 ''robot'':16 ''saga'':5 ''squirrel'':11 ''u'':20 ''u-boat'':19', '1', '2013-05-26T14:50:58.951000', 173, 'NC-17', 2006, 4, '2.99', '11.99', ARRAY['Commentaries']::text[], 'Pizza Jumanji'), - ('A Beautiful Character Study of a Robot And a Astronaut who must Overcome a Boat in A Monastery', '''astronaut'':12 ''beauti'':4 ''boat'':17 ''charact'':5 ''hollow'':1 ''jeopardi'':2 ''monasteri'':20 ''must'':14 ''overcom'':15 ''robot'':9 ''studi'':6', '1', '2013-05-26T14:50:58.951000', 136, 'NC-17', 2006, 7, '4.99', '25.99', ARRAY['Behind the Scenes']::text[], 'Hollow Jeopardy'), - ('A Amazing Epistle of a Moose And a Crocodile who must Outrace a Dog in Berlin', '''amaz'':4 ''berlin'':18 ''brannigan'':1 ''crocodil'':11 ''dog'':16 ''epistl'':5 ''moos'':8 ''must'':13 ''outrac'':14 ''sunris'':2', '1', '2013-05-26T14:50:58.951000', 121, 'PG', 2006, 4, '4.99', '27.99', ARRAY['Trailers']::text[], 'Brannigan Sunrise'), - ('A Brilliant Panorama of a Madman And a Composer who must Succumb a Car in Ancient India', '''ancient'':18 ''brilliant'':4 ''car'':16 ''compos'':11 ''ghost'':1 ''groundhog'':2 ''india'':19 ''madman'':8 ''must'':13 ''panorama'':5 ''succumb'':14', '1', '2013-05-26T14:50:58.951000', 85, 'G', 2006, 6, '4.99', '18.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Ghost Groundhog'), - ('A Unbelieveable Yarn of a Boat And a Database Administrator who must Meet a Boy in The First Manned Space Station', '''administr'':12 ''boat'':8 ''boy'':17 ''databas'':11 ''first'':20 ''languag'':2 ''man'':21 ''meet'':15 ''must'':14 ''space'':22 ''station'':23 ''unbeliev'':4 ''yarn'':5 ''young'':1', '1', '2013-05-26T14:50:58.951000', 183, 'G', 2006, 6, '0.99', '9.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Young Language'), - ('A Astounding Display of a Secret Agent And a Technical Writer who must Escape a Mad Scientist in A Jet Boat', '''agent'':9 ''airplan'':2 ''astound'':4 ''boat'':23 ''display'':5 ''escap'':16 ''jet'':22 ''mad'':18 ''must'':15 ''rage'':1 ''scientist'':19 ''secret'':8 ''technic'':12 ''writer'':13', '1', '2013-05-26T14:50:58.951000', 154, 'R', 2006, 4, '4.99', '18.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Raging Airplane'), - ('A Intrepid Documentary of a Boat And a Crocodile who must Chase a Robot in The Sahara Desert', '''boat'':8 ''casper'':1 ''chase'':14 ''crocodil'':11 ''desert'':20 ''documentari'':5 ''dragonfli'':2 ''intrepid'':4 ''must'':13 ''robot'':16 ''sahara'':19', '1', '2013-05-26T14:50:58.951000', 163, 'PG-13', 2006, 3, '4.99', '16.99', ARRAY['Trailers']::text[], 'Casper Dragonfly'), - ('A Stunning Story of a Explorer And a Forensic Psychologist who must Face a Crocodile in A Shark Tank', '''crocodil'':17 ''danc'':1 ''explor'':8 ''face'':15 ''fever'':2 ''forens'':11 ''must'':14 ''psychologist'':12 ''shark'':20 ''stori'':5 ''stun'':4 ''tank'':21', '1', '2013-05-26T14:50:58.951000', 144, 'G', 2006, 6, '0.99', '25.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Dancing Fever'), - ('A Stunning Character Study of a Crocodile And a Pioneer who must Pursue a Teacher in New Orleans', '''charact'':5 ''crocodil'':9 ''flight'':1 ''lie'':2 ''must'':14 ''new'':19 ''orlean'':20 ''pioneer'':12 ''pursu'':15 ''studi'':6 ''stun'':4 ''teacher'':17', '1', '2013-05-26T14:50:58.951000', 179, 'R', 2006, 7, '4.99', '22.99', ARRAY['Trailers']::text[], 'Flight Lies'), - ('A Lacklusture Panorama of a Secret Agent And a Crocodile who must Discover a Madman in The Canadian Rockies', '''agent'':9 ''canadian'':20 ''crocodil'':12 ''discov'':15 ''imag'':1 ''lacklustur'':4 ''madman'':17 ''must'':14 ''panorama'':5 ''princess'':2 ''rocki'':21 ''secret'':8', '1', '2013-05-26T14:50:58.951000', 178, 'PG-13', 2006, 3, '2.99', '17.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Image Princess'), - ('A Lacklusture Display of a Womanizer And a Dog who must Face a Sumo Wrestler in Ancient Japan', '''ancient'':19 ''display'':5 ''dog'':11 ''elizabeth'':1 ''face'':14 ''japan'':20 ''lacklustur'':4 ''must'':13 ''shane'':2 ''sumo'':16 ''woman'':8 ''wrestler'':17', '1', '2013-05-26T14:50:58.951000', 152, 'NC-17', 2006, 7, '4.99', '11.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Elizabeth Shane'), - ('A Touching Saga of a Crocodile And a Crocodile who must Discover a Technical Writer in Nigeria', '''crocodil'':8,11 ''discov'':14 ''must'':13 ''nigeria'':19 ''rugrat'':1 ''saga'':5 ''shakespear'':2 ''technic'':16 ''touch'':4 ''writer'':17', '1', '2013-05-26T14:50:58.951000', 109, 'PG-13', 2006, 4, '0.99', '16.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Rugrats Shakespeare'), - ('A Intrepid Panorama of a Mad Scientist And a Boy who must Redeem a Boy in A Monastery', '''ark'':2 ''boy'':12,17 ''intrepid'':4 ''mad'':8 ''monasteri'':20 ''must'':14 ''panorama'':5 ''redeem'':15 ''scientist'':9 ''zorro'':1', '1', '2013-05-26T14:50:58.951000', 50, 'NC-17', 2006, 3, '4.99', '18.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Zorro Ark'), - ('A Unbelieveable Panorama of a Feminist And a Sumo Wrestler who must Challenge a Technical Writer in Ancient China', '''ancient'':20 ''challeng'':15 ''china'':21 ''feminist'':8 ''jerk'':2 ''must'':14 ''panorama'':5 ''sumo'':11 ''technic'':17 ''titan'':1 ''unbeliev'':4 ''wrestler'':12 ''writer'':18', '1', '2013-05-26T14:50:58.951000', 91, 'PG', 2006, 4, '4.99', '11.99', ARRAY['Behind the Scenes']::text[], 'Titans Jerk'), - ('A Astounding Documentary of a Hunter And a Boy who must Confront a Boy in A MySQL Convention', '''astound'':4 ''boy'':11,16 ''confront'':14 ''convent'':20 ''documentari'':5 ''homicid'':1 ''hunter'':8 ''must'':13 ''mysql'':19 ''peach'':2', '1', '2013-05-26T14:50:58.951000', 141, 'PG-13', 2006, 6, '2.99', '21.99', ARRAY['Commentaries']::text[], 'Homicide Peach'), - ('A Lacklusture Tale of a Butler And a Husband who must Face a Boy in Ancient China', '''ancient'':18 ''boy'':16 ''butler'':8 ''china'':19 ''face'':14 ''husband'':11 ''lacklustur'':4 ''must'':13 ''seabiscuit'':2 ''tale'':5 ''westward'':1', '1', '2013-05-26T14:50:58.951000', 52, 'NC-17', 2006, 7, '0.99', '11.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Westward Seabiscuit'), - ('A Awe-Inspiring Reflection of a Monkey And a Dentist who must Overcome a Pioneer in A U-Boat', '''awe'':5 ''awe-inspir'':4 ''boat'':23 ''dentist'':13 ''inspir'':6 ''madison'':1 ''monkey'':10 ''must'':15 ''overcom'':16 ''pioneer'':18 ''reflect'':7 ''trap'':2 ''u'':22 ''u-boat'':21', '1', '2013-05-26T14:50:58.951000', 147, 'R', 2006, 4, '2.99', '11.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Madison Trap'), - ('A Insightful Drama of a Womanizer And a Waitress who must Reach a Forensic Psychologist in The Outback', '''doctor'':1 ''drama'':5 ''forens'':16 ''grail'':2 ''insight'':4 ''must'':13 ''outback'':20 ''psychologist'':17 ''reach'':14 ''waitress'':11 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 57, 'G', 2006, 4, '2.99', '29.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Doctor Grail'), - ('A Awe-Inspiring Story of a Butler And a Sumo Wrestler who must Redeem a Boy in New Orleans', '''awe'':5 ''awe-inspir'':4 ''boy'':19 ''butler'':10 ''dorado'':2 ''inspir'':6 ''modern'':1 ''must'':16 ''new'':21 ''orlean'':22 ''redeem'':17 ''stori'':7 ''sumo'':13 ''wrestler'':14', '1', '2013-05-26T14:50:58.951000', 74, 'PG', 2006, 3, '0.99', '20.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Modern Dorado'), - ('A Fanciful Character Study of a Student And a Explorer who must Succumb a Composer in An Abandoned Mine Shaft', '''abandon'':20 ''charact'':5 ''compos'':17 ''explor'':12 ''fanci'':4 ''innoc'':2 ''killer'':1 ''mine'':21 ''must'':14 ''shaft'':22 ''student'':9 ''studi'':6 ''succumb'':15', '1', '2013-05-26T14:50:58.951000', 161, 'R', 2006, 7, '2.99', '11.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Killer Innocent'), - ('A Astounding Panorama of a Lumberjack And a Dog who must Redeem a Woman in An Abandoned Fun House', '''abandon'':19 ''astound'':4 ''bed'':1 ''dog'':11 ''fun'':20 ''highbal'':2 ''hous'':21 ''lumberjack'':8 ''must'':13 ''panorama'':5 ''redeem'':14 ''woman'':16', '1', '2013-05-26T14:50:58.951000', 106, 'NC-17', 2006, 5, '2.99', '23.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Bed Highball'), - ('A Epic Documentary of a Sumo Wrestler And a Butler who must Kill a Car in Ancient India', '''ancient'':19 ''behavior'':2 ''butler'':12 ''car'':17 ''chisum'':1 ''documentari'':5 ''epic'':4 ''india'':20 ''kill'':15 ''must'':14 ''sumo'':8 ''wrestler'':9', '1', '2013-05-26T14:50:58.951000', 124, 'G', 2006, 5, '4.99', '25.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Chisum Behavior'), - ('A Beautiful Documentary of a Dog And a Robot who must Redeem a Womanizer in Berlin', '''beauti'':4 ''berlin'':18 ''cross'':1 ''divorc'':2 ''documentari'':5 ''dog'':8 ''must'':13 ''redeem'':14 ''robot'':11 ''woman'':16', '1', '2013-05-26T14:50:58.951000', 50, 'R', 2006, 4, '4.99', '19.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Crossing Divorce'), - ('A Emotional Yarn of a Robot And a Boy who must Outgun a Technical Writer in A U-Boat', '''boat'':22 ''boy'':11 ''emot'':4 ''lover'':1 ''must'':13 ''outgun'':14 ''robot'':8 ''technic'':16 ''truman'':2 ''u'':21 ''u-boat'':20 ''writer'':17 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 75, 'G', 2006, 3, '2.99', '29.99', ARRAY['Trailers']::text[], 'Lover Truman'), - ('A Astounding Character Study of a Boat And a Secret Agent who must Find a Mad Cow in The Sahara Desert', '''agent'':13 ''astound'':4 ''boat'':9 ''charact'':5 ''cow'':19 ''desert'':23 ''enough'':1 ''find'':16 ''mad'':18 ''must'':15 ''rage'':2 ''sahara'':22 ''secret'':12 ''studi'':6', '1', '2013-05-26T14:50:58.951000', 158, 'NC-17', 2006, 7, '2.99', '16.99', ARRAY['Commentaries']::text[], 'Enough Raging'), - ('A Action-Packed Reflection of a Crocodile And a Explorer who must Find a Sumo Wrestler in An Abandoned Mine Shaft', '''abandon'':22 ''action'':5 ''action-pack'':4 ''apollo'':1 ''crocodil'':10 ''explor'':13 ''find'':16 ''mine'':23 ''must'':15 ''pack'':6 ''reflect'':7 ''shaft'':24 ''sumo'':18 ''teen'':2 ''wrestler'':19', '1', '2013-05-26T14:50:58.951000', 153, 'PG-13', 2006, 5, '2.99', '15.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Apollo Teen'), - ('A Awe-Inspiring Story of a Student And a Frisbee who must Conquer a Crocodile in An Abandoned Mine Shaft', '''abandon'':21 ''awe'':5 ''awe-inspir'':4 ''conquer'':16 ''conspiraci'':1 ''crocodil'':18 ''frisbe'':13 ''inspir'':6 ''mine'':22 ''must'':15 ''shaft'':23 ''spirit'':2 ''stori'':7 ''student'':10', '1', '2013-05-26T14:50:58.951000', 184, 'PG-13', 2006, 4, '2.99', '27.99', ARRAY['Trailers', 'Commentaries']::text[], 'Conspiracy Spirit'), - ('A Fanciful Story of a Man And a Sumo Wrestler who must Outrace a Student in A Monastery', '''fanci'':4 ''lola'':2 ''man'':8 ''monasteri'':20 ''must'':14 ''outrac'':15 ''stori'':5 ''student'':17 ''sumo'':11 ''werewolf'':1 ''wrestler'':12', '1', '2013-05-26T14:50:58.951000', 79, 'G', 2006, 6, '4.99', '19.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Werewolf Lola'), - ('A Fast-Paced Reflection of a Explorer And a Butler who must Battle a Madman in An Abandoned Amusement Park', '''abandon'':21 ''amus'':22 ''battl'':16 ''butler'':13 ''crusad'':1 ''explor'':10 ''fast'':5 ''fast-pac'':4 ''honey'':2 ''madman'':18 ''must'':15 ''pace'':6 ''park'':23 ''reflect'':7', '1', '2013-05-26T14:50:58.951000', 112, 'R', 2006, 4, '2.99', '27.99', ARRAY['Commentaries']::text[], 'Crusade Honey'), - ('A Insightful Drama of a Feminist And a A Shark who must Vanquish a Boat in A Shark Tank', '''boat'':17 ''drama'':5 ''feminist'':8 ''happi'':2 ''insight'':4 ''must'':14 ''shark'':12,20 ''storm'':1 ''tank'':21 ''vanquish'':15', '1', '2013-05-26T14:50:58.951000', 57, 'NC-17', 2006, 6, '0.99', '28.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Storm Happiness'), - ('A Astounding Saga of a Moose And a Pastry Chef who must Chase a Student in The Gulf of Mexico', '''astound'':4 ''chase'':15 ''chef'':12 ''flash'':1 ''gulf'':20 ''mexico'':22 ''moos'':8 ''must'':14 ''pastri'':11 ''saga'':5 ''student'':17 ''war'':2', '1', '2013-05-26T14:50:58.951000', 123, 'NC-17', 2006, 3, '4.99', '21.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Flash Wars'), - ('A Unbelieveable Tale of a Woman And a Lumberjack who must Fight a Frisbee in A U-Boat', '''boat'':21 ''disturb'':2 ''fight'':14 ''frisbe'':16 ''lumberjack'':11 ''must'':13 ''stamped'':1 ''tale'':5 ''u'':20 ''u-boat'':19 ''unbeliev'':4 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 75, 'R', 2006, 5, '0.99', '26.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Stampede Disturbing'), - ('A Emotional Character Study of a Dentist And a Crocodile who must Meet a Sumo Wrestler in California', '''amistad'':1 ''california'':20 ''charact'':5 ''crocodil'':12 ''dentist'':9 ''emot'':4 ''meet'':15 ''midsumm'':2 ''must'':14 ''studi'':6 ''sumo'':17 ''wrestler'':18', '1', '2013-05-26T14:50:58.951000', 85, 'G', 2006, 6, '2.99', '10.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Amistad Midsummer'), - ('A Fanciful Yarn of a Crocodile And a Forensic Psychologist who must Discover a Crocodile in The Outback', '''crocodil'':8,17 ''discov'':15 ''fanci'':4 ''forens'':11 ''jingl'':2 ''love'':1 ''must'':14 ''outback'':20 ''psychologist'':12 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 65, 'PG', 2006, 3, '2.99', '18.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Lovely Jingle'), - ('A Amazing Panorama of a Forensic Psychologist And a Technical Writer who must Fight a Dentist in A U-Boat', '''amaz'':4 ''boat'':23 ''dentist'':18 ''fight'':16 ''forens'':8 ''halloween'':1 ''must'':15 ''nut'':2 ''panorama'':5 ''psychologist'':9 ''technic'':12 ''u'':22 ''u-boat'':21 ''writer'':13', '1', '2013-05-26T14:50:58.951000', 47, 'PG-13', 2006, 6, '2.99', '19.99', ARRAY['Deleted Scenes']::text[], 'Halloween Nuts'), - ('A Unbelieveable Panorama of a Frisbee And a Hunter who must Vanquish a Monkey in Ancient India', '''ancient'':18 ''bang'':2 ''closer'':1 ''frisbe'':8 ''hunter'':11 ''india'':19 ''monkey'':16 ''must'':13 ''panorama'':5 ''unbeliev'':4 ''vanquish'':14', '1', '2013-05-26T14:50:58.951000', 58, 'R', 2006, 5, '4.99', '12.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Closer Bang'), - ('A Amazing Story of a Feminist And a Cat who must Face a Car in An Abandoned Fun House', '''abandon'':19 ''amaz'':4 ''car'':16 ''cat'':11 ''empir'':1 ''face'':14 ''feminist'':8 ''fun'':20 ''hous'':21 ''malkovich'':2 ''must'':13 ''stori'':5', '1', '2013-05-26T14:50:58.951000', 177, 'G', 2006, 7, '0.99', '26.99', ARRAY['Deleted Scenes']::text[], 'Empire Malkovich'), - ('A Amazing Display of a Girl And a Womanizer who must Succumb a Lumberjack in A Baloon Factory', '''amaz'':4 ''baloon'':19 ''brotherhood'':2 ''bucket'':1 ''display'':5 ''factori'':20 ''girl'':8 ''lumberjack'':16 ''must'':13 ''succumb'':14 ''woman'':11', '1', '2013-05-26T14:50:58.951000', 133, 'PG', 2006, 7, '4.99', '27.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Bucket Brotherhood'), - ('A Stunning Reflection of a Boat And a Pastry Chef who must Succumb a A Shark in A Jet Boat', '''boat'':8,22 ''brooklyn'':2 ''chef'':12 ''jawbreak'':1 ''jet'':21 ''must'':14 ''pastri'':11 ''reflect'':5 ''shark'':18 ''stun'':4 ''succumb'':15', '1', '2013-05-26T14:50:58.951000', 118, 'PG', 2006, 5, '0.99', '15.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Jawbreaker Brooklyn'), - ('A Touching Saga of a Teacher And a Monkey who must Overcome a Secret Agent in A MySQL Convention', '''agent'':17 ''convent'':21 ''fantasi'':1 ''monkey'':11 ''must'':13 ''mysql'':20 ''overcom'':14 ''saga'':5 ''secret'':16 ''teacher'':8 ''touch'':4 ''trooper'':2', '1', '2013-05-26T14:50:58.951000', 58, 'PG-13', 2006, 6, '0.99', '27.99', ARRAY['Behind the Scenes']::text[], 'Fantasy Troopers'), - ('A Action-Packed Saga of a Husband And a Dog who must Redeem a Database Administrator in The Sahara Desert', '''action'':5 ''action-pack'':4 ''administr'':19 ''databas'':18 ''desert'':23 ''dog'':13 ''highbal'':1 ''husband'':10 ''must'':15 ''pack'':6 ''potter'':2 ''redeem'':16 ''saga'':7 ''sahara'':22', '1', '2013-05-26T14:50:58.951000', 110, 'R', 2006, 6, '0.99', '10.99', ARRAY['Deleted Scenes']::text[], 'Highball Potter'), - ('A Epic Display of a Dog And a Boat who must Succumb a Mad Scientist in An Abandoned Mine Shaft', '''abandon'':20 ''atlanti'':2 ''boat'':11 ''display'':5 ''dog'':8 ''epic'':4 ''mad'':16 ''mine'':21 ''must'':13 ''scientist'':17 ''shaft'':22 ''sinner'':1 ''succumb'':14', '1', '2013-05-26T14:50:58.951000', 126, 'PG-13', 2006, 7, '2.99', '19.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Sinners Atlantis'), - ('A Fanciful Tale of a Squirrel And a Boat who must Defeat a Crocodile in The Gulf of Mexico', '''attack'':2 ''boat'':11 ''crocodil'':16 ''defeat'':14 ''fanci'':4 ''gulf'':19 ''mad'':1 ''mexico'':21 ''must'':13 ''squirrel'':8 ''tale'':5', '1', '2013-05-26T14:50:58.951000', 178, 'PG-13', 2006, 4, '0.99', '14.99', ARRAY['Trailers']::text[], 'Madness Attacks'), - ('A Amazing Epistle of a Boy And a Astronaut who must Redeem a Man in The Gulf of Mexico', '''amaz'':4 ''astronaut'':11 ''boy'':8 ''crusad'':2 ''epistl'':5 ''gaslight'':1 ''gulf'':19 ''man'':16 ''mexico'':21 ''must'':13 ''redeem'':14', '1', '2013-05-26T14:50:58.951000', 106, 'PG', 2006, 4, '2.99', '10.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Gaslight Crusade'), - ('A Insightful Drama of a Mad Scientist And a Hunter who must Defeat a Pastry Chef in New Orleans', '''chef'':18 ''defeat'':15 ''drama'':5 ''goldfing'':1 ''hunter'':12 ''insight'':4 ''mad'':8 ''must'':14 ''new'':20 ''orlean'':21 ''pastri'':17 ''scientist'':9 ''sensibl'':2', '1', '2013-05-26T14:50:58.951000', 93, 'G', 2006, 3, '0.99', '29.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Goldfinger Sensibility') - ) AS data(description, fulltext, old_language_id, last_update, length, rating, release_year, rental_duration, rental_rate, replacement_cost, special_features, title) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."language"' - AND map0.old_id = data.old_language_id - RETURNING film_id - ) - SELECT array_agg(film_id) INTO v_new_ids_film FROM inserted; - - FOR i IN 1..array_length(v_new_ids_film, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."film"', v_old_ids_film[i], v_new_ids_film[i]::TEXT); - END LOOP; - - v_old_ids_film := ARRAY['997', '175', '550', '54', '88', '213', '678', '339', '986', '701', '499', '782', '252', '985', '433', '776', '267', '218', '510', '214', '368', '513', '707', '379', '441', '738', '447', '299', '132', '407', '51', '20', '525', '828', '560', '157', '195', '434', '208', '628', '559', '573', '319', '660', '156', '417', '848', '739', '324', '181', '438', '584', '13', '765', '475', '913', '831', '210', '657', '935', '320', '646', '241', '533', '529', '240', '676', '884', '857', '127', '964', '696', '929', '902', '705', '425', '539', '591', '448', '540', '384', '289', '439', '191', '96', '304', '376', '936', '4', '984', '497', '777', '220', '994', '185', '172', '547', '835', '594', '133']; - WITH inserted AS ( - INSERT INTO "public"."film" ("description", "fulltext", "language_id", "last_update", "length", "rating", "release_year", "rental_duration", "rental_rate", "replacement_cost", "special_features", "title") - SELECT - data.description::text, - data.fulltext::tsvector, - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.length::smallint, - data.rating::mpaa_rating, - data.release_year::integer, - data.rental_duration::smallint, - data.rental_rate::numeric, - data.replacement_cost::numeric, - data.special_features::text[], - data.title::character varying - FROM (VALUES - ('A Touching Drama of a Teacher And a Cat who must Challenge a Technical Writer in A U-Boat', '''boat'':22 ''cat'':11 ''challeng'':14 ''drama'':5 ''kick'':2 ''must'':13 ''teacher'':8 ''technic'':16 ''touch'':4 ''u'':21 ''u-boat'':20 ''writer'':17 ''youth'':1', '1', '2013-05-26T14:50:58.951000', 179, 'NC-17', 2006, 4, '0.99', '14.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Youth Kick'), - ('A Stunning Epistle of a Cat And a Forensic Psychologist who must Confront a Pioneer in A Baloon', '''baloon'':20 ''candl'':2 ''cat'':8 ''confront'':15 ''confus'':1 ''epistl'':5 ''forens'':11 ''must'':14 ''pioneer'':17 ''psychologist'':12 ''stun'':4', '1', '2013-05-26T14:50:58.951000', 122, 'PG-13', 2006, 3, '2.99', '27.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Confused Candles'), - ('A Fast-Paced Reflection of a Waitress And a Hunter who must Defeat a Forensic Psychologist in A Baloon', '''apach'':2 ''baloon'':22 ''defeat'':16 ''fast'':5 ''fast-pac'':4 ''forens'':18 ''hunter'':13 ''maguir'':1 ''must'':15 ''pace'':6 ''psychologist'':19 ''reflect'':7 ''waitress'':10', '1', '2013-05-26T14:50:58.951000', 74, 'NC-17', 2006, 6, '2.99', '22.99', ARRAY['Trailers', 'Commentaries']::text[], 'Maguire Apache'), - ('A Awe-Inspiring Drama of a Car And a Pastry Chef who must Chase a Crocodile in The First Manned Space Station', '''awe'':5 ''awe-inspir'':4 ''banger'':1 ''car'':10 ''chase'':17 ''chef'':14 ''crocodil'':19 ''drama'':7 ''first'':22 ''inspir'':6 ''man'':23 ''must'':16 ''pastri'':13 ''pinocchio'':2 ''space'':24 ''station'':25', '1', '2013-05-26T14:50:58.951000', 113, 'R', 2006, 5, '0.99', '15.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Banger Pinocchio'), - ('A Touching Epistle of a Frisbee And a Husband who must Pursue a Student in Nigeria', '''born'':1 ''epistl'':5 ''frisbe'':8 ''husband'':11 ''must'':13 ''nigeria'':18 ''pursu'':14 ''spinal'':2 ''student'':16 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 179, 'PG', 2006, 7, '4.99', '17.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Born Spinal'), - ('A Touching Saga of a Composer And a Moose who must Discover a Dentist in A MySQL Convention', '''compos'':8 ''convent'':20 ''date'':1 ''dentist'':16 ''discov'':14 ''moos'':11 ''must'':13 ''mysql'':19 ''saga'':5 ''speed'':2 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 104, 'R', 2006, 4, '0.99', '19.99', ARRAY['Commentaries']::text[], 'Date Speed'), - ('A Touching Documentary of a Husband And a Boat who must Meet a Pastry Chef in A Baloon Factory', '''baloon'':20 ''boat'':11 ''chef'':17 ''documentari'':5 ''drive'':2 ''factori'':21 ''husband'':8 ''meet'':14 ''must'':13 ''pastri'':16 ''pickup'':1 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 77, 'G', 2006, 3, '2.99', '23.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Pickup Driving'), - ('A Unbelieveable Yarn of a Mad Scientist And a Cat who must Chase a Lumberjack in Australia', '''australia'':19 ''break'':2 ''cat'':12 ''chase'':15 ''frogmen'':1 ''lumberjack'':17 ''mad'':8 ''must'':14 ''scientist'':9 ''unbeliev'':4 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 111, 'R', 2006, 5, '0.99', '17.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Frogmen Breaking'), - ('A Brilliant Saga of a Boat And a Mad Scientist who must Meet a Moose in Ancient India', '''ancient'':19 ''boat'':8 ''brilliant'':4 ''india'':20 ''mad'':11 ''meet'':15 ''moos'':17 ''must'':14 ''saga'':5 ''scientist'':12 ''sea'':2 ''wonka'':1', '1', '2013-05-26T14:50:58.951000', 85, 'NC-17', 2006, 6, '2.99', '24.99', ARRAY['Trailers', 'Commentaries']::text[], 'Wonka Sea'), - ('A Amazing Panorama of a Crocodile And a Explorer who must Fight a Husband in Nigeria', '''amaz'':4 ''crocodil'':8 ''explor'':11 ''fight'':14 ''husband'':16 ''must'':13 ''nigeria'':18 ''panorama'':5 ''psycho'':1 ''shrunk'':2', '1', '2013-05-26T14:50:58.951000', 155, 'PG-13', 2006, 5, '2.99', '11.99', ARRAY['Behind the Scenes']::text[], 'Psycho Shrunk'), - ('A Action-Packed Tale of a Boy And a Lumberjack who must Chase a Madman in A Baloon', '''action'':5 ''action-pack'':4 ''baloon'':21 ''boy'':10 ''chase'':16 ''evolut'':2 ''king'':1 ''lumberjack'':13 ''madman'':18 ''must'':15 ''pack'':6 ''tale'':7', '1', '2013-05-26T14:50:58.951000', 184, 'NC-17', 2006, 3, '4.99', '24.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'King Evolution'), - ('A Fast-Paced Panorama of a Lumberjack And a Database Administrator who must Defeat a Madman in A MySQL Convention', '''administr'':14 ''convent'':23 ''databas'':13 ''defeat'':17 ''fast'':5 ''fast-pac'':4 ''lumberjack'':10 ''madman'':19 ''must'':16 ''mysql'':22 ''pace'':6 ''panorama'':7 ''saddl'':2 ''shakespear'':1', '1', '2013-05-26T14:50:58.951000', 60, 'PG-13', 2006, 6, '2.99', '26.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Shakespeare Saddle'), - ('A Epic Display of a Car And a Composer who must Overcome a Forensic Psychologist in The Gulf of Mexico', '''car'':8 ''compos'':11 ''display'':5 ''dream'':1 ''epic'':4 ''forens'':16 ''gulf'':20 ''mexico'':22 ''must'':13 ''overcom'':14 ''pickup'':2 ''psychologist'':17', '1', '2013-05-26T14:50:58.951000', 135, 'PG', 2006, 6, '2.99', '18.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Dream Pickup'), - ('A Awe-Inspiring Character Study of a Waitress And a Car who must Pursue a Mad Scientist in The First Manned Space Station', '''awe'':5 ''awe-inspir'':4 ''car'':14 ''charact'':7 ''christma'':2 ''first'':23 ''inspir'':6 ''mad'':19 ''man'':24 ''must'':16 ''pursu'':17 ''scientist'':20 ''space'':25 ''station'':26 ''studi'':8 ''waitress'':11 ''wonderland'':1', '1', '2013-05-26T14:50:58.951000', 111, 'PG', 2006, 4, '4.99', '19.99', ARRAY['Commentaries']::text[], 'Wonderland Christmas'), - ('A Stunning Display of a Mad Scientist And a Technical Writer who must Succumb a Monkey in A Shark Tank', '''display'':5 ''horn'':1 ''mad'':8 ''monkey'':18 ''must'':15 ''scientist'':9 ''shark'':21 ''stun'':4 ''succumb'':16 ''tank'':22 ''technic'':12 ''work'':2 ''writer'':13', '1', '2013-05-26T14:50:58.951000', 95, 'PG', 2006, 4, '2.99', '23.99', ARRAY['Trailers']::text[], 'Horn Working'), - ('A Astounding Story of a Cat And a Database Administrator who must Build a Technical Writer in New Orleans', '''administr'':12 ''astound'':4 ''build'':15 ''cat'':8 ''databas'':11 ''groundhog'':2 ''must'':14 ''new'':20 ''orlean'':21 ''secret'':1 ''stori'':5 ''technic'':17 ''writer'':18', '1', '2013-05-26T14:50:58.951000', 90, 'PG', 2006, 6, '4.99', '11.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Secret Groundhog'), - ('A Thoughtful Story of a Car And a Boy who must Find a A Shark in The Sahara Desert', '''boy'':11 ''car'':8 ''desert'':21 ''eagl'':1 ''find'':14 ''must'':13 ''panki'':2 ''sahara'':20 ''shark'':17 ''stori'':5 ''thought'':4', '1', '2013-05-26T14:50:58.951000', 140, 'NC-17', 2006, 4, '4.99', '14.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Eagles Panky'), - ('A Taut Story of a Moose And a Squirrel who must Build a Husband in Ancient India', '''ancient'':18 ''betray'':2 ''build'':14 ''deceiv'':1 ''husband'':16 ''india'':19 ''moos'':8 ''must'':13 ''squirrel'':11 ''stori'':5 ''taut'':4', '1', '2013-05-26T14:50:58.951000', 122, 'NC-17', 2006, 7, '0.99', '22.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Deceiver Betrayed'), - ('A Insightful Yarn of a Boy And a Sumo Wrestler who must Outgun a Car in The Outback', '''boy'':8 ''car'':17 ''insight'':4 ''lawless'':1 ''must'':14 ''outback'':20 ''outgun'':15 ''sumo'':11 ''vision'':2 ''wrestler'':12 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 181, 'G', 2006, 6, '4.99', '29.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Lawless Vision'), - ('A Beautiful Tale of a Hunter And a Mad Scientist who must Confront a Squirrel in The First Manned Space Station', '''beauti'':4 ''confront'':15 ''daughter'':1 ''first'':20 ''hunter'':8 ''mad'':11 ''madigan'':2 ''man'':21 ''must'':14 ''scientist'':12 ''space'':22 ''squirrel'':17 ''station'':23 ''tale'':5', '1', '2013-05-26T14:50:58.951000', 59, 'PG-13', 2006, 3, '4.99', '13.99', ARRAY['Trailers']::text[], 'Daughter Madigan'), - ('A Insightful Character Study of a Mad Cow And a Forensic Psychologist who must Conquer a A Shark in A Manhattan Penthouse', '''charact'':5 ''conquer'':17 ''cow'':10 ''forens'':13 ''gone'':1 ''insight'':4 ''mad'':9 ''manhattan'':23 ''must'':16 ''penthous'':24 ''psychologist'':14 ''shark'':20 ''studi'':6 ''troubl'':2', '1', '2013-05-26T14:50:58.951000', 84, 'R', 2006, 7, '2.99', '20.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Gone Trouble'), - ('A Fateful Reflection of a Dog And a Mad Cow who must Outrace a Teacher in An Abandoned Mine Shaft', '''abandon'':20 ''cow'':12 ''dog'':8 ''dwarf'':2 ''fate'':4 ''leatherneck'':1 ''mad'':11 ''mine'':21 ''must'':14 ''outrac'':15 ''reflect'':5 ''shaft'':22 ''teacher'':17', '1', '2013-05-26T14:50:58.951000', 153, 'PG-13', 2006, 6, '2.99', '21.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Leathernecks Dwarfs'), - ('A Fateful Drama of a Husband And a Sumo Wrestler who must Battle a Pastry Chef in A Baloon Factory', '''baloon'':21 ''battl'':15 ''chef'':18 ''drama'':5 ''factori'':22 ''fate'':4 ''husband'':8 ''mussolini'':2 ''must'':14 ''pastri'':17 ''quest'':1 ''sumo'':11 ''wrestler'':12', '1', '2013-05-26T14:50:58.951000', 177, 'R', 2006, 5, '2.99', '29.99', ARRAY['Behind the Scenes']::text[], 'Quest Mussolini'), - ('A Amazing Reflection of a A Shark And a Butler who must Chase a Hunter in The Canadian Rockies', '''amaz'':4 ''butler'':12 ''canadian'':20 ''chase'':15 ''greedi'':1 ''hunter'':17 ''must'':14 ''reflect'':5 ''rocki'':21 ''root'':2 ''shark'':9', '1', '2013-05-26T14:50:58.951000', 166, 'R', 2006, 7, '0.99', '14.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Greedy Roots'), - ('A Emotional Drama of a Mad Cow And a Boat who must Redeem a Secret Agent in A Shark Tank', '''agent'':18 ''alter'':2 ''boat'':12 ''cow'':9 ''drama'':5 ''emot'':4 ''hunter'':1 ''mad'':8 ''must'':14 ''redeem'':15 ''secret'':17 ''shark'':21 ''tank'':22', '1', '2013-05-26T14:50:58.951000', 125, 'PG-13', 2006, 5, '2.99', '21.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Hunter Alter'), - ('A Awe-Inspiring Character Study of a Robot And a Sumo Wrestler who must Discover a Womanizer in A Shark Tank', '''awe'':5 ''awe-inspir'':4 ''charact'':7 ''discov'':18 ''inspir'':6 ''mother'':2 ''must'':17 ''robot'':11 ''rocket'':1 ''shark'':23 ''studi'':8 ''sumo'':14 ''tank'':24 ''woman'':20 ''wrestler'':15', '1', '2013-05-26T14:50:58.951000', 178, 'PG-13', 2006, 3, '0.99', '27.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Rocketeer Mother'), - ('A Fast-Paced Tale of a Butler And a Moose who must Overcome a Pioneer in A Manhattan Penthouse', '''butler'':10 ''cross'':2 ''fast'':5 ''fast-pac'':4 ''ice'':1 ''manhattan'':21 ''moos'':13 ''must'':15 ''overcom'':16 ''pace'':6 ''penthous'':22 ''pioneer'':18 ''tale'':7', '1', '2013-05-26T14:50:58.951000', 131, 'R', 2006, 5, '2.99', '28.99', ARRAY['Deleted Scenes']::text[], 'Ice Crossing'), - ('A Action-Packed Saga of a Teacher And a Frisbee who must Escape a Lumberjack in The Sahara Desert', '''action'':5 ''action-pack'':4 ''desert'':22 ''dragon'':2 ''escap'':16 ''factori'':1 ''frisbe'':13 ''lumberjack'':18 ''must'':15 ''pack'':6 ''saga'':7 ''sahara'':21 ''teacher'':10', '1', '2013-05-26T14:50:58.951000', 144, 'PG-13', 2006, 4, '0.99', '9.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Factory Dragon'), - ('A Beautiful Documentary of a Boy And a Robot who must Discover a Squirrel in Australia', '''australia'':18 ''beauti'':4 ''boy'':8 ''chainsaw'':1 ''discov'':14 ''documentari'':5 ''must'':13 ''robot'':11 ''squirrel'':16 ''uptown'':2', '1', '2013-05-26T14:50:58.951000', 114, 'PG', 2006, 6, '0.99', '25.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Chainsaw Uptown'), - ('A Action-Packed Drama of a Mad Scientist And a Composer who must Outgun a Car in Australia', '''action'':5 ''action-pack'':4 ''australia'':21 ''car'':19 ''chill'':2 ''compos'':14 ''drama'':7 ''hawk'':1 ''mad'':10 ''must'':16 ''outgun'':17 ''pack'':6 ''scientist'':11', '1', '2013-05-26T14:50:58.951000', 47, 'PG-13', 2006, 5, '0.99', '12.99', ARRAY['Behind the Scenes']::text[], 'Hawk Chill'), - ('A Insightful Panorama of a Forensic Psychologist And a Mad Cow who must Build a Mad Scientist in The First Manned Space Station', '''balloon'':1 ''build'':16 ''cow'':13 ''first'':22 ''forens'':8 ''homeward'':2 ''insight'':4 ''mad'':12,18 ''man'':23 ''must'':15 ''panorama'':5 ''psychologist'':9 ''scientist'':19 ''space'':24 ''station'':25', '1', '2013-05-26T14:50:58.951000', 75, 'NC-17', 2006, 5, '2.99', '10.99', ARRAY['Deleted Scenes']::text[], 'Balloon Homeward'), - ('A Boring Drama of a Woman And a Squirrel who must Conquer a Student in A Baloon', '''ameli'':1 ''baloon'':19 ''bore'':4 ''conquer'':14 ''drama'':5 ''hellfight'':2 ''must'':13 ''squirrel'':11 ''student'':16 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 79, 'R', 2006, 4, '4.99', '23.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Amelie Hellfighters'), - ('A Boring Epistle of a Pioneer And a Mad Scientist who must Escape a Frisbee in The Gulf of Mexico', '''bore'':4 ''epistl'':5 ''escap'':15 ''frisbe'':17 ''gulf'':20 ''legal'':2 ''loath'':1 ''mad'':11 ''mexico'':22 ''must'':14 ''pioneer'':8 ''scientist'':12', '1', '2013-05-26T14:50:58.951000', 140, 'R', 2006, 4, '0.99', '29.99', ARRAY['Deleted Scenes']::text[], 'Loathing Legally'), - ('A Lacklusture Epistle of a Dentist And a Technical Writer who must Find a Dog in A Monastery', '''dentist'':8 ''dog'':17 ''element'':2 ''epistl'':5 ''find'':15 ''lacklustur'':4 ''monasteri'':20 ''must'':14 ''spike'':1 ''technic'':11 ''writer'':12', '1', '2013-05-26T14:50:58.951000', 79, 'G', 2006, 7, '2.99', '12.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Spiking Element'), - ('A Boring Drama of a Car And a Dog who must Succumb a Madman in Soviet Georgia', '''bore'':4 ''car'':8 ''dog'':11 ''drama'':5 ''georgia'':19 ''madman'':16 ''mar'':1 ''must'':13 ''roman'':2 ''soviet'':18 ''succumb'':14', '1', '2013-05-26T14:50:58.951000', 62, 'NC-17', 2006, 6, '0.99', '21.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Mars Roman'), - ('A Insightful Documentary of a Technical Writer And a Feminist who must Challenge a Cat in A Baloon', '''baloon'':20 ''cat'':17 ''challeng'':15 ''clockwork'':1 ''documentari'':5 ''feminist'':12 ''insight'':4 ''must'':14 ''paradis'':2 ''technic'':8 ''writer'':9', '1', '2013-05-26T14:50:58.951000', 143, 'PG-13', 2006, 7, '0.99', '29.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Clockwork Paradise'), - ('A Intrepid Documentary of a Astronaut And a Forensic Psychologist who must Find a Frisbee in An Abandoned Fun House', '''abandon'':20 ''astronaut'':8 ''crowd'':1 ''documentari'':5 ''find'':15 ''forens'':11 ''frisbe'':17 ''fun'':21 ''hous'':22 ''intrepid'':4 ''must'':14 ''psychologist'':12 ''telemark'':2', '1', '2013-05-26T14:50:58.951000', 112, 'R', 2006, 3, '4.99', '16.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Crowds Telemark'), - ('A Touching Documentary of a A Shark And a Car who must Build a Husband in Nigeria', '''build'':15 ''car'':12 ''documentari'':5 ''horror'':1 ''husband'':17 ''must'':14 ''nigeria'':19 ''reign'':2 ''shark'':9 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 139, 'R', 2006, 3, '0.99', '25.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Horror Reign'), - ('A Fateful Story of a Robot And a Dentist who must Defeat a Astronaut in New Orleans', '''astronaut'':16 ''dare'':1 ''defeat'':14 ''dentist'':11 ''fate'':4 ''must'':13 ''new'':18 ''orlean'':19 ''pluto'':2 ''robot'':8 ''stori'':5', '1', '2013-05-26T14:50:58.951000', 89, 'PG-13', 2006, 7, '2.99', '16.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Dares Pluto'), - ('A Boring Character Study of a Boy And a A Shark who must Outrace a Womanizer in The Outback', '''bore'':4 ''boy'':9 ''charact'':5 ''must'':15 ''northwest'':1 ''outback'':21 ''outrac'':16 ''polish'':2 ''shark'':13 ''studi'':6 ''woman'':18', '1', '2013-05-26T14:50:58.951000', 172, 'PG', 2006, 5, '2.99', '24.99', ARRAY['Trailers']::text[], 'Northwest Polish'), - ('A Fanciful Story of a Womanizer And a Dog who must Face a Forensic Psychologist in The Sahara Desert', '''desert'':21 ''dog'':11 ''face'':14 ''fanci'':4 ''forens'':16 ''go'':2 ''marri'':1 ''must'':13 ''psychologist'':17 ''sahara'':20 ''stori'':5 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 114, 'G', 2006, 7, '2.99', '22.99', ARRAY['Behind the Scenes']::text[], 'Married Go'), - ('A Touching Character Study of a Boat And a Student who must Sink a A Shark in Nigeria', '''boat'':9 ''charact'':5 ''microcosmo'':1 ''must'':14 ''nigeria'':20 ''paradis'':2 ''shark'':18 ''sink'':15 ''student'':12 ''studi'':6 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 105, 'PG-13', 2006, 6, '2.99', '22.99', ARRAY['Commentaries']::text[], 'Microcosmos Paradise'), - ('A Touching Display of a Feminist And a Girl who must Confront a Astronaut in Australia', '''astronaut'':16 ''australia'':18 ''confront'':14 ''display'':5 ''feminist'':8 ''fish'':1 ''girl'':11 ''must'':13 ''opus'':2 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 125, 'R', 2006, 4, '2.99', '22.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Fish Opus'), - ('A Fateful Display of a Technical Writer And a Butler who must Battle a Sumo Wrestler in An Abandoned Mine Shaft', '''abandon'':21 ''battl'':15 ''butler'':12 ''display'':5 ''fate'':4 ''knock'':2 ''mine'':22 ''must'':14 ''parti'':1 ''shaft'':23 ''sumo'':17 ''technic'':8 ''wrestler'':18 ''writer'':9', '1', '2013-05-26T14:50:58.951000', 107, 'PG', 2006, 7, '2.99', '11.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Party Knock'), - ('A Thrilling Display of a Sumo Wrestler And a Girl who must Confront a Man in A Baloon', '''angel'':2 ''baloon'':20 ''clerk'':1 ''confront'':15 ''display'':5 ''girl'':12 ''man'':17 ''must'':14 ''sumo'':8 ''thrill'':4 ''wrestler'':9', '1', '2013-05-26T14:50:58.951000', 164, 'G', 2006, 3, '4.99', '15.99', ARRAY['Commentaries']::text[], 'Clerks Angels'), - ('A Epic Display of a Hunter And a Feminist who must Sink a Car in A U-Boat', '''boat'':21 ''car'':16 ''display'':5 ''epic'':4 ''feminist'':11 ''hill'':1 ''hunter'':8 ''must'':13 ''neighbor'':2 ''sink'':14 ''u'':20 ''u-boat'':19', '1', '2013-05-26T14:50:58.951000', 93, 'G', 2006, 5, '0.99', '29.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Hills Neighbors'), - ('A Intrepid Drama of a Astronaut And a Crocodile who must Find a Boat in Soviet Georgia', '''astronaut'':8 ''boat'':16 ''crocodil'':11 ''drama'':5 ''find'':14 ''fire'':2 ''georgia'':19 ''intrepid'':4 ''must'':13 ''soviet'':18 ''stone'':1', '1', '2013-05-26T14:50:58.951000', 94, 'G', 2006, 3, '0.99', '19.99', ARRAY['Trailers']::text[], 'Stone Fire'), - ('A Fast-Paced Display of a Squirrel And a Explorer who must Outgun a Mad Scientist in Nigeria', '''display'':7 ''explor'':13 ''fast'':5 ''fast-pac'':4 ''mad'':18 ''must'':15 ''nigeria'':21 ''outgun'':16 ''pace'':6 ''rocki'':1 ''scientist'':19 ''squirrel'':10 ''war'':2', '1', '2013-05-26T14:50:58.951000', 145, 'PG-13', 2006, 4, '4.99', '17.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Rocky War'), - ('A Fateful Story of a Husband And a Moose who must Vanquish a Boy in California', '''boy'':16 ''california'':18 ''fate'':4 ''flintston'':1 ''happi'':2 ''husband'':8 ''moos'':11 ''must'':13 ''stori'':5 ''vanquish'':14', '1', '2013-05-26T14:50:58.951000', 148, 'PG-13', 2006, 3, '4.99', '11.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Flintstones Happiness'), - ('A Insightful Display of a A Shark And a Monkey who must Face a Database Administrator in Ancient India', '''administr'':18 ''ancient'':20 ''anonym'':2 ''contact'':1 ''databas'':17 ''display'':5 ''face'':15 ''india'':21 ''insight'':4 ''monkey'':12 ''must'':14 ''shark'':9', '1', '2013-05-26T14:50:58.951000', 166, 'PG-13', 2006, 7, '2.99', '10.99', ARRAY['Commentaries']::text[], 'Contact Anonymous'), - ('A Beautiful Reflection of a Womanizer And a Sumo Wrestler who must Chase a Database Administrator in The Gulf of Mexico', '''administr'':18 ''beauti'':4 ''chase'':15 ''databas'':17 ''graffiti'':2 ''gulf'':21 ''human'':1 ''mexico'':23 ''must'':14 ''reflect'':5 ''sumo'':11 ''woman'':8 ''wrestler'':12', '1', '2013-05-26T14:50:58.951000', 68, 'NC-17', 2006, 3, '2.99', '22.99', ARRAY['Trailers', 'Behind the Scenes']::text[], 'Human Graffiti'), - ('A Taut Drama of a Womanizer And a Lumberjack who must Succumb a Pioneer in Ancient India', '''ancient'':18 ''door'':2 ''drama'':5 ''india'':19 ''lumberjack'':11 ''mix'':1 ''must'':13 ''pioneer'':16 ''succumb'':14 ''taut'':4 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 180, 'PG-13', 2006, 6, '2.99', '26.99', ARRAY['Behind the Scenes']::text[], 'Mixed Doors'), - ('A Action-Packed Drama of a Dentist And a Crocodile who must Battle a Feminist in The Canadian Rockies', '''action'':5 ''action-pack'':4 ''ali'':1 ''battl'':16 ''canadian'':21 ''crocodil'':13 ''dentist'':10 ''drama'':7 ''feminist'':18 ''forev'':2 ''must'':15 ''pack'':6 ''rocki'':22', '1', '2013-05-26T14:50:58.951000', 150, 'PG', 2006, 4, '4.99', '21.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Ali Forever'), - ('A Fateful Epistle of a Butler And a Boy who must Redeem a Teacher in Berlin', '''berlin'':18 ''boy'':11 ''butler'':8 ''epistl'':5 ''fate'':4 ''must'':13 ''name'':2 ''redeem'':14 ''saturn'':1 ''teacher'':16', '1', '2013-05-26T14:50:58.951000', 182, 'R', 2006, 7, '4.99', '18.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Saturn Name'), - ('A Awe-Inspiring Epistle of a Feminist And a Girl who must Sink a Girl in The Outback', '''awe'':5 ''awe-inspir'':4 ''epistl'':7 ''feminist'':10 ''girl'':13,18 ''inspir'':6 ''japanes'':1 ''must'':15 ''outback'':21 ''run'':2 ''sink'':16', '1', '2013-05-26T14:50:58.951000', 135, 'G', 2006, 6, '0.99', '29.99', ARRAY['Deleted Scenes']::text[], 'Japanese Run'), - ('A Fanciful Drama of a Monkey And a Feminist who must Sink a Man in Berlin', '''berlin'':18 ''drama'':5 ''fanci'':4 ''feminist'':11 ''man'':16 ''metal'':2 ''monkey'':8 ''must'':13 ''sink'':14 ''trooper'':1', '1', '2013-05-26T14:50:58.951000', 115, 'R', 2006, 3, '0.99', '20.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Troopers Metal'), - ('A Taut Story of a Waitress And a Man who must Face a Car in A Baloon Factory', '''baloon'':19 ''car'':16 ''casualti'':2 ''face'':14 ''factori'':20 ''man'':11 ''must'':13 ''spirit'':1 ''stori'':5 ''taut'':4 ''waitress'':8', '1', '2013-05-26T14:50:58.951000', 138, 'PG-13', 2006, 5, '0.99', '20.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Spirited Casualties'), - ('A Stunning Reflection of a Frisbee And a Husband who must Redeem a Dog in New Orleans', '''darko'':1 ''dog'':16 ''dorado'':2 ''frisbe'':8 ''husband'':11 ''must'':13 ''new'':18 ''orlean'':19 ''redeem'':14 ''reflect'':5 ''stun'':4', '1', '2013-05-26T14:50:58.951000', 130, 'NC-17', 2006, 3, '4.99', '13.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Darko Dorado'), - ('A Intrepid Yarn of a Car And a Moose who must Outrace a Crocodile in A Manhattan Penthouse', '''car'':8 ''crocodil'':16 ''intrepid'':4 ''manhattan'':19 ''moos'':11 ''must'':13 ''outrac'':14 ''paradis'':1 ''penthous'':20 ''sabrina'':2 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 48, 'PG-13', 2006, 5, '2.99', '12.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Paradise Sabrina'), - ('A Intrepid Character Study of a Squirrel And a A Shark who must Kill a Lumberjack in California', '''california'':20 ''charact'':5 ''garden'':2 ''intrepid'':4 ''kill'':16 ''lumberjack'':18 ''must'':15 ''shark'':13 ''squirrel'':9 ''studi'':6 ''vanish'':1', '1', '2013-05-26T14:50:58.951000', 142, 'R', 2006, 5, '0.99', '17.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Vanished Garden'), - ('A Fast-Paced Reflection of a Composer And a Composer who must Meet a Cat in The Sahara Desert', '''cat'':18 ''compos'':10,13 ''connecticut'':2 ''desert'':22 ''fast'':5 ''fast-pac'':4 ''flamingo'':1 ''meet'':16 ''must'':15 ''pace'':6 ''reflect'':7 ''sahara'':21', '1', '2013-05-26T14:50:58.951000', 80, 'PG-13', 2006, 4, '4.99', '28.99', ARRAY['Trailers']::text[], 'Flamingos Connecticut'), - ('A Unbelieveable Yarn of a Database Administrator And a Woman who must Succumb a A Shark in A U-Boat', '''administr'':9 ''boat'':23 ''databas'':8 ''divin'':2 ''must'':14 ''outbreak'':1 ''shark'':18 ''succumb'':15 ''u'':22 ''u-boat'':21 ''unbeliev'':4 ''woman'':12 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 169, 'NC-17', 2006, 6, '0.99', '12.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Outbreak Divine'), - ('A Awe-Inspiring Tale of a Butler And a Frisbee who must Vanquish a Teacher in Ancient Japan', '''alley'':2 ''ancient'':20 ''awe'':5 ''awe-inspir'':4 ''butler'':10 ''donni'':1 ''frisbe'':13 ''inspir'':6 ''japan'':21 ''must'':15 ''tale'':7 ''teacher'':18 ''vanquish'':16', '1', '2013-05-26T14:50:58.951000', 125, 'NC-17', 2006, 4, '0.99', '20.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Donnie Alley'), - ('A Emotional Character Study of a Robot And a A Shark who must Defeat a Technical Writer in A Manhattan Penthouse', '''bird'':2 ''charact'':5 ''defeat'':16 ''emot'':4 ''lost'':1 ''manhattan'':22 ''must'':15 ''penthous'':23 ''robot'':9 ''shark'':13 ''studi'':6 ''technic'':18 ''writer'':19', '1', '2013-05-26T14:50:58.951000', 98, 'PG-13', 2006, 4, '2.99', '21.99', ARRAY['Deleted Scenes']::text[], 'Lost Bird'), - ('A Intrepid Story of a Student And a Dog who must Challenge a Explorer in Soviet Georgia', '''challeng'':14 ''dog'':11 ''eleph'':2 ''explor'':16 ''georgia'':19 ''intrepid'':4 ''lone'':1 ''must'':13 ''soviet'':18 ''stori'':5 ''student'':8', '1', '2013-05-26T14:50:58.951000', 67, 'G', 2006, 3, '2.99', '12.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Lonely Elephant'), - ('A Thrilling Display of a Pioneer And a Frisbee who must Escape a Teacher in The Outback', '''display'':5 ''doll'':1 ''escap'':14 ''frisbe'':11 ''must'':13 ''outback'':19 ''pioneer'':8 ''rage'':2 ''teacher'':16 ''thrill'':4', '1', '2013-05-26T14:50:58.951000', 120, 'PG-13', 2006, 7, '2.99', '10.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Dolls Rage'), - ('A Taut Yarn of a Hunter And a Astronaut who must Conquer a Database Administrator in The Sahara Desert', '''administr'':17 ''astronaut'':11 ''conquer'':14 ''databas'':16 ''desert'':21 ''hunter'':8 ''must'':13 ''philadelphia'':1 ''sahara'':20 ''taut'':4 ''wife'':2 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 137, 'PG-13', 2006, 7, '4.99', '16.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Philadelphia Wife'), - ('A Touching Story of a Crocodile And a Girl who must Sink a Man in The Gulf of Mexico', '''club'':2 ''crocodil'':8 ''girl'':11 ''gulf'':19 ''man'':16 ''mexico'':21 ''must'':13 ''sink'':14 ''stori'':5 ''termin'':1 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 88, 'R', 2006, 5, '4.99', '11.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Terminator Club'), - ('A Touching Reflection of a Crocodile And a Dog who must Chase a Hunter in An Abandoned Fun House', '''abandon'':19 ''chase'':14 ''crocodil'':8 ''dog'':11 ''fun'':20 ''hous'':21 ''hunter'':16 ''must'':13 ''reflect'':5 ''scarfac'':2 ''strict'':1 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 144, 'PG-13', 2006, 3, '2.99', '24.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Strictly Scarface'), - ('A Fast-Paced Panorama of a Girl And a A Shark who must Confront a Boy in Ancient India', '''ancient'':21 ''boy'':19 ''cat'':1 ''conehead'':2 ''confront'':17 ''fast'':5 ''fast-pac'':4 ''girl'':10 ''india'':22 ''must'':16 ''pace'':6 ''panorama'':7 ''shark'':14', '1', '2013-05-26T14:50:58.951000', 112, 'G', 2006, 5, '4.99', '14.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Cat Coneheads'), - ('A Unbelieveable Documentary of a Dentist And a Technical Writer who must Build a Womanizer in Nigeria', '''build'':15 ''deliver'':2 ''dentist'':8 ''documentari'':5 ''must'':14 ''nigeria'':19 ''technic'':11 ''unbeliev'':4 ''waterfront'':1 ''woman'':17 ''writer'':12', '1', '2013-05-26T14:50:58.951000', 61, 'G', 2006, 4, '4.99', '17.99', ARRAY['Behind the Scenes']::text[], 'Waterfront Deliverance'), - ('A Thoughtful Drama of a A Shark And a Forensic Psychologist who must Vanquish a Student in Ancient India', '''alamo'':2 ''ancient'':20 ''drama'':5 ''forens'':12 ''india'':21 ''must'':15 ''pride'':1 ''psychologist'':13 ''shark'':9 ''student'':18 ''thought'':4 ''vanquish'':16', '1', '2013-05-26T14:50:58.951000', 114, 'NC-17', 2006, 6, '0.99', '20.99', ARRAY['Deleted Scenes']::text[], 'Pride Alamo'), - ('A Touching Display of a Explorer And a Lumberjack who must Fight a Forensic Psychologist in A Shark Tank', '''display'':5 ''explor'':8 ''fight'':14 ''forens'':16 ''lumberjack'':11 ''must'':13 ''psychologist'':17 ''shark'':20 ''tank'':21 ''touch'':4 ''untouch'':2 ''usual'':1', '1', '2013-05-26T14:50:58.951000', 128, 'PG-13', 2006, 5, '4.99', '21.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Usual Untouchables'), - ('A Emotional Character Study of a Student And a Explorer who must Discover a Frisbee in The First Manned Space Station', '''charact'':5 ''discov'':15 ''emot'':4 ''explor'':12 ''first'':20 ''frisbe'':17 ''man'':21 ''must'':14 ''pinocchio'':2 ''space'':22 ''station'':23 ''student'':9 ''studi'':6 ''trade'':1', '1', '2013-05-26T14:50:58.951000', 170, 'PG', 2006, 6, '4.99', '22.99', ARRAY['Trailers', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Trading Pinocchio'), - ('A Boring Display of a Pastry Chef And a Sumo Wrestler who must Discover a Frisbee in An Abandoned Amusement Park', '''abandon'':21 ''amus'':22 ''bore'':4 ''chef'':9 ''discov'':16 ''display'':5 ''frisbe'':18 ''movi'':2 ''must'':15 ''park'':23 ''pastri'':8 ''purpl'':1 ''sumo'':12 ''wrestler'':13', '1', '2013-05-26T14:50:58.951000', 88, 'R', 2006, 4, '2.99', '9.99', ARRAY['Commentaries', 'Deleted Scenes']::text[], 'Purple Movie'), - ('A Action-Packed Display of a Feminist And a Pioneer who must Pursue a Dog in A Baloon Factory', '''action'':5 ''action-pack'':4 ''baloon'':21 ''display'':7 ''dog'':18 ''factori'':22 ''feminist'':10 ''holi'':1 ''must'':15 ''pack'':6 ''pioneer'':13 ''pursu'':16 ''tadpol'':2', '1', '2013-05-26T14:50:58.951000', 88, 'R', 2006, 6, '0.99', '20.99', ARRAY['Behind the Scenes']::text[], 'Holy Tadpole'), - ('A Boring Display of a Moose And a Squirrel who must Outrace a Teacher in A Shark Tank', '''bore'':4 ''display'':5 ''luck'':1 ''moos'':8 ''must'':13 ''opus'':2 ''outrac'':14 ''shark'':19 ''squirrel'':11 ''tank'':20 ''teacher'':16', '1', '2013-05-26T14:50:58.951000', 152, 'NC-17', 2006, 7, '2.99', '21.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Luck Opus'), - ('A Astounding Tale of a Crocodile And a Car who must Outrace a Squirrel in A U-Boat', '''astound'':4 ''boat'':21 ''car'':11 ''caus'':2 ''crocodil'':8 ''monsoon'':1 ''must'':13 ''outrac'':14 ''squirrel'':16 ''tale'':5 ''u'':20 ''u-boat'':19', '1', '2013-05-26T14:50:58.951000', 182, 'PG', 2006, 6, '4.99', '20.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Monsoon Cause'), - ('A Fast-Paced Drama of a Student And a Crocodile who must Meet a Database Administrator in The Outback', '''administr'':19 ''crocodil'':13 ''databas'':18 ''drama'':7 ''fast'':5 ''fast-pac'':4 ''idaho'':1 ''love'':2 ''meet'':16 ''must'':15 ''outback'':22 ''pace'':6 ''student'':10', '1', '2013-05-26T14:50:58.951000', 172, 'PG-13', 2006, 3, '2.99', '25.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Idaho Love'), - ('A Lacklusture Character Study of a A Shark And a Man who must Find a Forensic Psychologist in A U-Boat', '''boat'':24 ''charact'':5 ''find'':16 ''fli'':2 ''forens'':18 ''lacklustur'':4 ''lucki'':1 ''man'':13 ''must'':15 ''psychologist'':19 ''shark'':10 ''studi'':6 ''u'':23 ''u-boat'':22', '1', '2013-05-26T14:50:58.951000', 97, 'PG-13', 2006, 7, '2.99', '10.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Lucky Flying'), - ('A Epic Drama of a Cat And a Explorer who must Redeem a Moose in Australia', '''australia'':18 ''cat'':8 ''drama'':5 ''epic'':4 ''explor'':11 ''gross'':1 ''moos'':16 ''must'':13 ''redeem'':14 ''wonder'':2', '1', '2013-05-26T14:50:58.951000', 49, 'R', 2006, 5, '4.99', '19.99', ARRAY['Behind the Scenes']::text[], 'Grosse Wonderful'), - ('A Awe-Inspiring Yarn of a Pastry Chef And a Database Administrator who must Challenge a Teacher in A Baloon', '''administr'':15 ''awe'':5 ''awe-inspir'':4 ''baloon'':23 ''challeng'':18 ''chef'':11 ''databas'':14 ''eve'':1 ''inspir'':6 ''must'':17 ''pastri'':10 ''resurrect'':2 ''teacher'':20 ''yarn'':7', '1', '2013-05-26T14:50:58.951000', 66, 'G', 2006, 5, '4.99', '25.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes']::text[], 'Eve Resurrection'), - ('A Touching Yarn of a Frisbee And a Dentist who must Fight a Composer in Ancient Japan', '''ancient'':18 ''compos'':16 ''dentist'':11 ''fight'':14 ''frisbe'':8 ''hunchback'':1 ''imposs'':2 ''japan'':19 ''must'':13 ''touch'':4 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 151, 'PG-13', 2006, 4, '4.99', '28.99', ARRAY['Trailers', 'Deleted Scenes']::text[], 'Hunchback Impossible'), - ('A Unbelieveable Drama of a Hunter And a Database Administrator who must Battle a Crocodile in An Abandoned Amusement Park', '''abandon'':20 ''administr'':12 ''amus'':21 ''battl'':15 ''crocodil'':17 ''crook'':1 ''databas'':11 ''drama'':5 ''frogmen'':2 ''hunter'':8 ''must'':14 ''park'':22 ''unbeliev'':4', '1', '2013-05-26T14:50:58.951000', 143, 'PG-13', 2006, 6, '0.99', '27.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Crooked Frogmen'), - ('A Beautiful Display of a Secret Agent And a Monkey who must Battle a Sumo Wrestler in An Abandoned Mine Shaft', '''abandon'':21 ''agent'':9 ''battl'':15 ''beauti'':4 ''break'':1 ''display'':5 ''home'':2 ''mine'':22 ''monkey'':12 ''must'':14 ''secret'':8 ''shaft'':23 ''sumo'':17 ''wrestler'':18', '1', '2013-05-26T14:50:58.951000', 169, 'PG-13', 2006, 4, '2.99', '21.99', ARRAY['Trailers', 'Commentaries']::text[], 'Breaking Home'), - ('A Thrilling Reflection of a Pastry Chef And a Crocodile who must Reach a Teacher in The Outback', '''chef'':9 ''crocodil'':12 ''fargo'':1 ''gandhi'':2 ''must'':14 ''outback'':20 ''pastri'':8 ''reach'':15 ''reflect'':5 ''teacher'':17 ''thrill'':4', '1', '2013-05-26T14:50:58.951000', 130, 'G', 2006, 3, '2.99', '28.99', ARRAY['Deleted Scenes']::text[], 'Fargo Gandhi'), - ('A Boring Yarn of a Mad Cow And a Sumo Wrestler who must Meet a Robot in Australia', '''australia'':20 ''bore'':4 ''cow'':9 ''furi'':2 ''grape'':1 ''mad'':8 ''meet'':16 ''must'':15 ''robot'':18 ''sumo'':12 ''wrestler'':13 ''yarn'':5', '1', '2013-05-26T14:50:58.951000', 155, 'G', 2006, 4, '0.99', '20.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Grapes Fury'), - ('A Brilliant Reflection of a Man And a Woman who must Conquer a Pioneer in A MySQL Convention', '''brilliant'':4 ''conquer'':14 ''convent'':20 ''man'':8 ''must'':13 ''mysql'':19 ''pioneer'':16 ''reflect'':5 ''rocki'':2 ''vanish'':1 ''woman'':11', '1', '2013-05-26T14:50:58.951000', 123, 'NC-17', 2006, 3, '2.99', '21.99', ARRAY['Trailers', 'Commentaries', 'Behind the Scenes']::text[], 'Vanishing Rocky'), - ('A Fanciful Documentary of a Frisbee And a Lumberjack who must Chase a Monkey in A Shark Tank', '''affair'':1 ''chase'':14 ''documentari'':5 ''fanci'':4 ''frisbe'':8 ''lumberjack'':11 ''monkey'':16 ''must'':13 ''prejudic'':2 ''shark'':19 ''tank'':20', '1', '2013-05-26T14:50:58.951000', 117, 'G', 2006, 5, '2.99', '26.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Affair Prejudice'), - ('A Boring Panorama of a Woman And a Madman who must Overcome a Butler in A U-Boat', '''boat'':21 ''bore'':4 ''butler'':16 ''drop'':2 ''madman'':11 ''must'':13 ''overcom'':14 ''panorama'':5 ''u'':20 ''u-boat'':19 ''woman'':8 ''wonder'':1', '1', '2013-05-26T14:50:58.951000', 126, 'NC-17', 2006, 3, '2.99', '20.99', ARRAY['Commentaries']::text[], 'Wonderful Drop'), - ('A Touching Display of a Hunter And a Secret Agent who must Redeem a Husband in The Outback', '''agent'':12 ''brotherhood'':2 ''display'':5 ''hunter'':8 ''husband'':17 ''kill'':1 ''must'':14 ''outback'':20 ''redeem'':15 ''secret'':11 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 54, 'G', 2006, 4, '0.99', '15.99', ARRAY['Trailers', 'Commentaries']::text[], 'Kill Brotherhood'), - ('A Action-Packed Panorama of a Mad Cow And a Composer who must Discover a Robot in A Baloon Factory', '''action'':5 ''action-pack'':4 ''baloon'':22 ''compos'':14 ''cow'':11 ''discov'':17 ''factori'':23 ''mad'':10 ''must'':16 ''pack'':6 ''panorama'':7 ''robot'':19 ''roug'':2 ''secretari'':1', '1', '2013-05-26T14:50:58.951000', 158, 'PG', 2006, 5, '4.99', '10.99', ARRAY['Commentaries', 'Behind the Scenes']::text[], 'Secretary Rouge'), - ('A Thoughtful Story of a Mad Cow And a Womanizer who must Overcome a Mad Scientist in Soviet Georgia', '''cow'':9 ''deer'':1 ''georgia'':21 ''mad'':8,17 ''must'':14 ''overcom'':15 ''scientist'':18 ''soviet'':20 ''stori'':5 ''thought'':4 ''virginian'':2 ''woman'':12', '1', '2013-05-26T14:50:58.951000', 106, 'NC-17', 2006, 7, '2.99', '13.99', ARRAY['Deleted Scenes']::text[], 'Deer Virginian'), - ('A Awe-Inspiring Panorama of a Robot And a Boat who must Overcome a Feminist in A U-Boat', '''awe'':5 ''awe-inspir'':4 ''boat'':13,23 ''feminist'':18 ''inspir'':6 ''must'':15 ''overcom'':16 ''panorama'':7 ''robot'':10 ''storm'':2 ''u'':22 ''u-boat'':21 ''wyom'':1', '1', '2013-05-26T14:50:58.951000', 100, 'PG-13', 2006, 6, '4.99', '29.99', ARRAY['Deleted Scenes']::text[], 'Wyoming Storm'), - ('A Astounding Drama of a Boy And a Lumberjack who must Fight a Butler in A Baloon', '''astound'':4 ''baloon'':19 ''boy'':8 ''butler'':16 ''cowboy'':1 ''doom'':2 ''drama'':5 ''fight'':14 ''lumberjack'':11 ''must'':13', '1', '2013-05-26T14:50:58.951000', 146, 'PG', 2006, 3, '2.99', '10.99', ARRAY['Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Cowboy Doom'), - ('A Touching Story of a Womanizer And a Composer who must Pursue a Husband in Nigeria', '''compos'':11 ''conehead'':1 ''husband'':16 ''must'':13 ''nigeria'':18 ''pursu'':14 ''smoochi'':2 ''stori'':5 ''touch'':4 ''woman'':8', '1', '2013-05-26T14:50:58.951000', 112, 'NC-17', 2006, 7, '4.99', '12.99', ARRAY['Deleted Scenes', 'Behind the Scenes']::text[], 'Coneheads Smoochy'), - ('A Touching Documentary of a Pastry Chef And a Pastry Chef who must Build a Mad Scientist in California', '''build'':16 ''california'':21 ''chef'':9,13 ''documentari'':5 ''mad'':18 ''magic'':1 ''mallrat'':2 ''must'':15 ''pastri'':8,12 ''scientist'':19 ''touch'':4', '1', '2013-05-26T14:50:58.951000', 117, 'PG', 2006, 3, '0.99', '19.99', ARRAY['Trailers', 'Commentaries']::text[], 'Magic Mallrats'), - ('A Thrilling Documentary of a Feminist And a Feminist who must Confront a Feminist in A Baloon', '''baloon'':19 ''confront'':14 ''documentari'':5 ''feminist'':8,11,16 ''mile'':2 ''must'':13 ''spi'':1 ''thrill'':4', '1', '2013-05-26T14:50:58.951000', 112, 'PG-13', 2006, 6, '2.99', '13.99', ARRAY['Trailers', 'Commentaries', 'Deleted Scenes', 'Behind the Scenes']::text[], 'Spy Mile'), - ('A Thrilling Reflection of a Waitress And a Butler who must Battle a Butler in A Jet Boat', '''battl'':14 ''boat'':20 ''butler'':11,16 ''command'':2 ''jet'':19 ''montezuma'':1 ''must'':13 ''reflect'':5 ''thrill'':4 ''waitress'':8', '1', '2013-05-26T14:50:58.951000', 126, 'NC-17', 2006, 6, '0.99', '22.99', ARRAY['Trailers']::text[], 'Montezuma Command'), - ('A Fateful Reflection of a Moose And a Husband who must Overcome a Monkey in Nigeria', '''chamber'':1 ''fate'':4 ''husband'':11 ''italian'':2 ''monkey'':16 ''moos'':8 ''must'':13 ''nigeria'':18 ''overcom'':14 ''reflect'':5', '1', '2013-05-26T14:50:58.951000', 117, 'NC-17', 2006, 7, '4.99', '14.99', ARRAY['Trailers']::text[], 'Chamber Italian') - ) AS data(description, fulltext, old_language_id, last_update, length, rating, release_year, rental_duration, rental_rate, replacement_cost, special_features, title) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."language"' - AND map0.old_id = data.old_language_id - RETURNING film_id - ) - SELECT array_agg(film_id) INTO v_new_ids_film FROM inserted; - - FOR i IN 1..array_length(v_new_ids_film, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."film"', v_old_ids_film[i], v_new_ids_film[i]::TEXT); - END LOOP; - - -- Table: "public"."address" (603 records) - v_old_ids_address := ARRAY['345', '526', '529', '203', '477', '538', '585', '502', '482', '562', '89', '517', '256', '146', '589', '20', '496', '565', '237', '428', '138', '123', '69', '469', '521', '49', '13', '503', '541', '457', '297', '102', '399', '56', '474', '298', '555', '603', '571', '309', '126', '238', '485', '176', '128', '147', '283', '572', '488', '371', '168', '17', '208', '524', '498', '512', '332', '42', '545', '458', '115', '574', '117', '295', '178', '287', '365', '559', '11', '568', '22', '285', '254', '282', '291', '160', '289', '414', '107', '202', '84', '236', '30', '224', '194', '486', '598', '184', '495', '124', '465', '91', '239', '322', '352', '27', '590', '413', '70', '227']; - WITH inserted AS ( - INSERT INTO "public"."address" ("address", "address2", "city_id", "district", "last_update", "phone", "postal_code") - SELECT - data.address::character varying, - data.address2::character varying, - map0.new_id::smallint, - data.district::character varying, - data.last_update::timestamp without time zone, - data.phone::character varying, - data.postal_code::character varying - FROM (VALUES - ('68 Ponce Parkway', '', '201', 'Hanoi', '2006-02-15T09:45:30', '870635127812', '85926'), - ('617 Klerksdorp Place', '', '366', 'Khanh Hoa', '2006-02-15T09:45:30', '574973479129', '94707'), - ('600 Purnea (Purnia) Avenue', '', '571', 'Nghe An', '2006-02-15T09:45:30', '638409958875', '18043'), - ('1149 A Corua (La Corua) Boulevard', '', '194', 'Haiphong', '2006-02-15T09:45:30', '470884141195', '95824'), - ('1786 Salinas Place', '', '359', 'Nam Ha', '2006-02-15T09:45:30', '206060652238', '66546'), - ('1817 Livorno Way', '', '100', 'Khanh Hoa', '2006-02-15T09:45:30', '478380208348', '79401'), - ('1208 Tama Loop', '', '344', 'Ninawa', '2006-02-15T09:45:30', '954786054144', '73605'), - ('1515 Korla Way', '', '589', 'England', '2006-02-15T09:45:30', '959467760895', '57197'), - ('808 Naala-Porto Parkway', '', '500', 'England', '2006-02-15T09:45:30', '553452430707', '41060'), - ('869 Shikarpur Way', '', '496', 'England', '2006-02-15T09:45:30', '590764256785', '57380'), - ('1557 Ktahya Boulevard', '', '88', 'England', '2006-02-15T09:45:30', '720998247660', '88002'), - ('548 Uruapan Street', '', '312', 'Ontario', '2006-02-15T09:45:30', '879347453467', '35653'), - ('1497 Yuzhou Drive', '', '312', 'England', '2006-02-15T09:45:30', '246810237916', '3433'), - ('483 Ljubertsy Parkway', '', '149', 'Scotland', '2006-02-15T09:45:30', '581174211853', '60562'), - ('1584 Ljubertsy Lane', '', '494', 'England', '2006-02-15T09:45:30', '285710089439', '22954'), - ('360 Toulouse Parkway', '', '495', 'England', '2006-02-15T09:45:30', '949312333307', '54308'), - ('775 ostka Drive', '', '337', 'al-Daqahliya', '2006-02-15T09:45:30', '171973024401', '22358'), - ('1741 Hoshiarpur Boulevard', '', '79', 'al-Sharqiya', '2006-02-15T09:45:30', '855066328617', '22372'), - ('1736 Cavite Place', '', '216', 'Qina', '2006-02-15T09:45:30', '431770603551', '98775'), - ('1727 Matamoros Place', '', '465', 'Sawhaj', '2006-02-15T09:45:30', '129673677866', '78813'), - ('765 Southampton Drive', '', '421', 'al-Qalyubiya', '2006-02-15T09:45:30', '23712411567', '4285'), - ('1987 Coacalco de Berriozbal Loop', '', '476', 'al-Qalyubiya', '2006-02-15T09:45:30', '787654415858', '96065'), - ('698 Otsu Street', '', '105', 'Cayenne', '2006-02-15T09:45:30', '409983924481', '71110'), - ('1872 Toulon Loop', '', '428', 'OHiggins', '2006-02-15T09:45:30', '928809465153', '7939'), - ('568 Dhule (Dhulia) Loop', '', '127', 'Coquimbo', '2006-02-15T09:45:30', '602101369463', '92568'), - ('1718 Valencia Street', '', '27', 'Antofagasta', '2006-02-15T09:45:30', '675292816413', '37359'), - ('613 Korolev Drive', '', '329', 'Masqat', '2006-02-15T09:45:30', '380657522649', '45844'), - ('1416 San Juan Bautista Tuxtepec Avenue', '', '444', 'Zufar', '2006-02-15T09:45:30', '144206758053', '50592'), - ('195 Ilorin Street', '', '363', 'Chari-Baguirmi', '2006-02-15T09:45:30', '8912935608', '49250'), - ('535 Ahmadnagar Manor', '', '3', 'Abu Dhabi', '2006-02-15T09:45:30', '985109775584', '41136'), - ('1192 Tongliao Street', '', '470', 'Sharja', '2006-02-15T09:45:30', '350970907017', '19065'), - ('669 Firozabad Loop', '', '12', 'Abu Dhabi', '2006-02-15T09:45:30', '412903167998', '92265'), - ('331 Bydgoszcz Parkway', '', '181', 'Asturia', '2006-02-15T09:45:30', '537374465982', '966'), - ('939 Probolinggo Loop', '', '1', 'Galicia', '2006-02-15T09:45:30', '680428310138', '4166'), - ('1469 Plock Lane', '', '388', 'Galicia', '2006-02-15T09:45:30', '622884741180', '95835'), - ('44 Najafabad Way', '', '146', 'Baskimaa', '2006-02-15T09:45:30', '96604821070', '61391'), - ('1764 Jalib al-Shuyukh Parkway', '', '459', 'Galicia', '2006-02-15T09:45:30', '84794532510', '77642'), - ('1103 Quilmes Boulevard', '', '503', 'Piura', '2006-02-15T09:45:30', '644021380889', '52137'), - ('1746 Faaa Way', '', '214', 'Huanuco', '2006-02-15T09:45:30', '863080561151', '32515'), - ('827 Yuncheng Drive', '', '99', 'Callao', '2006-02-15T09:45:30', '504434452842', '79047'), - ('1175 Tanauan Way', '', '305', 'Lima', '2006-02-15T09:45:30', '937222955822', '64615'), - ('346 Skikda Parkway', '', '233', 'Hawalli', '2006-02-15T09:45:30', '630424482919', '90628'), - ('984 Novoterkassk Loop', '', '180', 'Gaziantep', '2006-02-15T09:45:30', '435118527255', '28165'), - ('29 Pyongyang Loop', '', '58', 'Batman', '2006-02-15T09:45:30', '734780743462', '47753'), - ('848 Tafuna Manor', '', '281', 'Ktahya', '2006-02-15T09:45:30', '614935229095', '45142'), - ('374 Bat Yam Boulevard', '', '266', 'Kilis', '2006-02-15T09:45:30', '923261616249', '97700'), - ('457 Tongliao Loop', '', '222', 'Bursa', '2006-02-15T09:45:30', '880756161823', '56254'), - ('539 Hami Way', '', '538', 'Tokat', '2006-02-15T09:45:30', '525518075499', '52196'), - ('698 Jelets Boulevard', '', '142', 'Denizli', '2006-02-15T09:45:30', '975185523021', '2596'), - ('1912 Emeishan Drive', '', '50', 'Balikesir', '2006-02-15T09:45:30', '99883471275', '33050'), - ('842 Salzburg Lane', '', '529', 'Adana', '2006-02-15T09:45:30', '697151428760', '3313'), - ('270 Amroha Parkway', '', '384', 'Osmaniye', '2006-02-15T09:45:30', '695479687538', '29610'), - ('1215 Pyongyang Parkway', '', '557', 'Usak', '2006-02-15T09:45:30', '646237101779', '25238'), - ('680 A Corua (La Corua) Manor', '', '482', 'Sivas', '2006-02-15T09:45:30', '158326114853', '49806'), - ('319 Plock Parkway', '', '504', 'Istanbul', '2006-02-15T09:45:30', '854259976812', '26101'), - ('1269 Ipoh Avenue', '', '163', 'Eskisehir', '2006-02-15T09:45:30', '402630109080', '54674'), - ('663 Baha Blanca Parkway', '', '5', 'Adana', '2006-02-15T09:45:30', '834418779292', '33463'), - ('269 Cam Ranh Parkway', '', '115', 'Chisinau', '2006-02-15T09:45:30', '489783829737', '34689'), - ('163 Augusta-Richmond County Loop', '', '561', 'Carabobo', '2006-02-15T09:45:30', '754579047924', '33030'), - ('138 Caracas Boulevard', '', '326', 'Zulia', '2006-02-15T09:45:30', '974433019532', '16790'), - ('1378 Alvorada Avenue', '', '102', 'Distrito Federal', '2006-02-15T09:45:30', '272234298332', '75834'), - ('502 Mandi Bahauddin Parkway', '', '55', 'Anzotegui', '2006-02-15T09:45:30', '618156722572', '15992'), - ('1079 Tel Aviv-Jaffa Boulevard', '', '132', 'Sucre', '2006-02-15T09:45:30', '358178933857', '10885'), - ('544 Tarsus Boulevard', '', '562', 'Gurico', '2006-02-15T09:45:30', '892523334', '53145'), - ('1848 Salala Boulevard', '', '373', 'Miranda', '2006-02-15T09:45:30', '48265851133', '25220'), - ('1405 Chisinau Place', '', '411', 'Ponce', '2006-02-15T09:45:30', '62781725285', '8160'), - ('1009 Zanzibar Lane', '', '32', 'Arecibo', '2006-02-15T09:45:30', '102396298916', '64875'), - ('1917 Kumbakonam Parkway', '', '368', 'Vojvodina', '2006-02-15T09:45:30', '698182547686', '11892'), - ('900 Santiago de Compostela Parkway', '', '280', 'Central Serbia', '2006-02-15T09:45:30', '716571220373', '93896'), - ('1342 Sharja Way', '', '488', 'Sokoto & Kebbi & Zam', '2006-02-15T09:45:30', '946114054231', '93655'), - ('320 Brest Avenue', '', '252', 'Kaduna', '2006-02-15T09:45:30', '747791594069', '43331'), - ('1006 Santa Brbara dOeste Manor', '', '389', 'Ondo & Ekiti', '2006-02-15T09:45:30', '85059738746', '36229'), - ('786 Stara Zagora Way', '', '390', 'Oyo & Osun', '2006-02-15T09:45:30', '716256596301', '98332'), - ('556 Baybay Manor', '', '374', 'Oyo & Osun', '2006-02-15T09:45:30', '363982224739', '55802'), - ('1155 Liaocheng Place', '', '152', 'Oyo & Osun', '2006-02-15T09:45:30', '558236142492', '22650'), - ('1367 Yantai Manor', '', '381', 'Ondo & Ekiti', '2006-02-15T09:45:30', '889538496300', '21294'), - ('1279 Udine Parkway', '', '69', 'Edo & Delta', '2006-02-15T09:45:30', '195003555232', '75860'), - ('1936 Lapu-Lapu Parkway', '', '141', 'Bauchi & Gombe', '2006-02-15T09:45:30', '653436985797', '7122'), - ('1177 Jelets Way', '', '220', 'Kwara & Kogi', '2006-02-15T09:45:30', '484292626944', '3305'), - ('955 Bamenda Way', '', '218', 'Ondo & Ekiti', '2006-02-15T09:45:30', '768481779568', '1545'), - ('1888 Kabul Drive', '', '217', 'Oyo & Osun', '2006-02-15T09:45:30', '701457319790', '20936'), - ('885 Yingkou Manor', '', '596', 'Kaduna', '2006-02-15T09:45:30', '588964509072', '31390'), - ('18 Duisburg Boulevard', '', '121', '', '2006-02-15T09:45:30', '998009777982', '58327'), - ('1842 Luzinia Boulevard', '', '593', 'Zanzibar West', '2006-02-15T09:45:30', '706878974831', '94420'), - ('605 Rio Claro Parkway', '', '513', 'Tabora', '2006-02-15T09:45:30', '352469351088', '49348'), - ('64 Korla Street', '', '347', 'Mwanza', '2006-02-15T09:45:30', '510383179153', '25145'), - ('42 Fontana Avenue', '', '512', 'Fejr', '2006-02-15T09:45:30', '437829801725', '14684'), - ('1410 Benin City Parkway', '', '405', 'Risaralda', '2006-02-15T09:45:30', '104150372603', '29747'), - ('656 Matamoros Drive', '', '487', 'Boyac', '2006-02-15T09:45:30', '17305839123', '19489'), - ('241 Mosul Lane', '', '147', 'Risaralda', '2006-02-15T09:45:30', '765345144779', '76157'), - ('734 Tanshui Avenue', '', '170', 'Caquet', '2006-02-15T09:45:30', '366776723320', '70664'), - ('1740 Portoviejo Avenue', '', '480', 'Sucre', '2006-02-15T09:45:30', '198123170793', '29932'), - ('98 Stara Zagora Boulevard', '', '96', 'Valle', '2006-02-15T09:45:30', '610173756082', '76448'), - ('1359 Zhoushan Parkway', '', '545', 'Streymoyar', '2006-02-15T09:45:30', '46568045367', '29763'), - ('1673 Tangail Drive', '', '137', 'Daugavpils', '2006-02-15T09:45:30', '627924259271', '26857'), - ('1780 Hino Boulevard', '', '303', 'Liepaja', '2006-02-15T09:45:30', '902731229323', '7716'), - ('247 Jining Parkway', '', '54', 'Banjul', '2006-02-15T09:45:30', '170115379190', '53446'), - ('692 Amroha Drive', '', '230', 'Northern', '2006-02-15T09:45:30', '359478883004', '35575'), - ('1150 Kimchon Manor', '', '321', 'Skne ln', '2006-02-15T09:45:30', '663449333709', '96109'), - ('1820 Maring Parkway', '', '324', 'Punjab', '2006-02-15T09:45:30', '99760893676', '88307') - ) AS data(address, address2, old_city_id, district, last_update, phone, postal_code) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."city"' - AND map0.old_id = data.old_city_id - RETURNING address_id - ) - SELECT array_agg(address_id) INTO v_new_ids_address FROM inserted; - - FOR i IN 1..array_length(v_new_ids_address, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."address"', v_old_ids_address[i], v_new_ids_address[i]::TEXT); - END LOOP; - - v_old_ids_address := ARRAY['404', '29', '421', '24', '388', '534', '159', '604', '65', '593', '324', '459', '456', '581', '493', '576', '584', '487', '358', '137', '348', '119', '588', '112', '430', '587', '374', '88', '328', '470', '369', '251', '419', '154', '278', '293', '491', '472', '181', '234', '569', '449', '325', '464', '454', '373', '14', '40', '189', '284', '382', '270', '45', '326', '26', '549', '44', '53', '105', '74', '422', '317', '108', '407', '166', '39', '61', '546', '219', '357', '366', '533', '148', '95', '397', '331', '350', '230', '209', '582', '79', '353', '592', '34', '523', '143', '9', '77', '583', '591', '28', '410', '111', '536', '364', '450', '336', '327', '247', '566']; - WITH inserted AS ( - INSERT INTO "public"."address" ("address", "address2", "city_id", "district", "last_update", "phone", "postal_code") - SELECT - data.address::character varying, - data.address2::character varying, - map0.new_id::smallint, - data.district::character varying, - data.last_update::timestamp without time zone, - data.phone::character varying, - data.postal_code::character varying - FROM (VALUES - ('734 Bchar Place', '', '375', 'Punjab', '2006-02-15T09:45:30', '280578750435', '30586'), - ('934 San Felipe de Puerto Plata Street', '', '472', 'Sind', '2006-02-15T09:45:30', '196495945706', '99780'), - ('966 Arecibo Loop', '', '134', 'Sind', '2006-02-15T09:45:30', '15273765306', '94018'), - ('1688 Okara Way', '', '327', 'Nothwest Border Prov', '2006-02-15T09:45:30', '144453869132', '21954'), - ('368 Hunuco Boulevard', '', '360', 'Namibe', '2006-02-15T09:45:30', '106439158941', '17165'), - ('486 Ondo Parkway', '', '67', 'Benguela', '2006-02-15T09:45:30', '105882218332', '35202'), - ('185 Novi Sad Place', '', '72', 'Bern', '2006-02-15T09:45:30', '904253967161', '41778'), - ('1331 Usak Boulevard', '', '296', 'Vaud', '2006-02-15T09:45:30', '145308717464', '61960'), - ('915 Ponce Place', '', '56', 'Basel-Stadt', '2006-02-15T09:45:30', '1395251317', '83980'), - ('1402 Zanzibar Boulevard', '', '106', 'Guanajuato', '2006-02-15T09:45:30', '387448063440', '71102'), - ('1145 Vilnius Manor', '', '451', 'Mxico', '2006-02-15T09:45:30', '674805712553', '73170'), - ('251 Florencia Drive', '', '556', 'Michoacn de Ocampo', '2006-02-15T09:45:30', '118011831565', '16119'), - ('814 Simferopol Loop', '', '154', 'Sinaloa', '2006-02-15T09:45:30', '524567129902', '48745'), - ('186 Skikda Lane', '', '131', 'Morelos', '2006-02-15T09:45:30', '14465669789', '89422'), - ('184 Mandaluyong Street', '', '288', 'Baja California Sur', '2006-02-15T09:45:30', '488425406814', '94239'), - ('1351 Sousse Lane', '', '341', 'Coahuila de Zaragoza', '2006-02-15T09:45:30', '203804046132', '37815'), - ('1819 Alessandria Loop', '', '103', 'Campeche', '2006-02-15T09:45:30', '377633994405', '53829'), - ('1785 So Bernardo do Campo Street', '', '125', 'Veracruz', '2006-02-15T09:45:30', '684529463244', '71182'), - ('1698 Southport Loop', '', '393', 'Hidalgo', '2006-02-15T09:45:30', '754358349853', '49009'), - ('261 Saint Louis Way', '', '541', 'Coahuila de Zaragoza', '2006-02-15T09:45:30', '321944036800', '83401'), - ('785 Vaduz Street', '', '335', 'Baja California', '2006-02-15T09:45:30', '895616862749', '36170'), - ('1107 Nakhon Sawan Avenue', '', '365', 'Mxico', '2006-02-15T09:45:30', '867546627903', '75149'), - ('966 Asuncin Way', '', '212', 'Hidalgo', '2006-02-15T09:45:30', '995527378381', '62703'), - ('1002 Ahmadnagar Manor', '', '213', 'Mxico', '2006-02-15T09:45:30', '371490777743', '93026'), - ('355 Vitria de Santo Anto Way', '', '452', 'Oaxaca', '2006-02-15T09:45:30', '548003849552', '81758'), - ('760 Miyakonojo Drive', '', '246', 'Guerrero', '2006-02-15T09:45:30', '294449058179', '64682'), - ('433 Florencia Street', '', '250', 'Chihuahua', '2006-02-15T09:45:30', '561729882725', '91330'), - ('125 Citt del Vaticano Boulevard', '', '40', 'Puebla', '2006-02-15T09:45:30', '48417642933', '67912'), - ('479 San Felipe del Progreso Avenue', '', '130', 'Morelos', '2006-02-15T09:45:30', '869051782691', '54949'), - ('1088 Ibirit Place', '', '595', 'Jalisco', '2006-02-15T09:45:30', '49084281333', '88502'), - ('817 Laredo Avenue', '', '188', 'Jalisco', '2006-02-15T09:45:30', '151249681135', '77449'), - ('1473 Changhwa Parkway', '', '124', 'Mxico', '2006-02-15T09:45:30', '266798132374', '75933'), - ('397 Sunnyvale Avenue', '', '19', 'Guanajuato', '2006-02-15T09:45:30', '680851640676', '55566'), - ('781 Shimonoseki Drive', '', '202', 'Michoacn de Ocampo', '2006-02-15T09:45:30', '632316273199', '95444'), - ('144 South Hill Loop', '', '445', 'Guanajuato', '2006-02-15T09:45:30', '45387294817', '2012'), - ('86 Higashiosaka Lane', '', '563', 'Guanajuato', '2006-02-15T09:45:30', '957128697225', '33768'), - ('1789 Saint-Denis Parkway', '', '4', 'Coahuila de Zaragoza', '2006-02-15T09:45:30', '936806643983', '8268'), - ('1447 Chatsworth Place', '', '129', 'Chihuahua', '2006-02-15T09:45:30', '769370126331', '41545'), - ('146 Johannesburg Way', '', '330', 'Tamaulipas', '2006-02-15T09:45:30', '953689007081', '54132'), - ('1256 Bislig Boulevard', '', '86', 'Botosani', '2006-02-15T09:45:30', '479007229460', '50598'), - ('1342 Abha Boulevard', '', '95', 'Bukarest', '2006-02-15T09:45:30', '997453607116', '10714'), - ('1289 Belm Boulevard', '', '530', 'Tartumaa', '2006-02-15T09:45:30', '237368926031', '88306'), - ('1892 Nabereznyje Telny Lane', '', '516', 'Tutuila', '2006-02-15T09:45:30', '478229987054', '28396'), - ('76 Kermanshah Manor', '', '423', 'Esfahan', '2006-02-15T09:45:30', '762361821578', '23343'), - ('956 Nam Dinh Manor', '', '481', 'Kerman', '2006-02-15T09:45:30', '474047727727', '21872'), - ('1922 Miraj Way', '', '356', 'Esfahan', '2006-02-15T09:45:30', '320471479776', '13203'), - ('1531 Sal Drive', '', '162', 'Esfahan', '2006-02-15T09:45:30', '648856936185', '53628'), - ('334 Munger (Monghyr) Lane', '', '31', 'Markazi', '2006-02-15T09:45:30', '481183273622', '38145'), - ('927 Barcelona Street', '', '467', 'Chaharmahal va Bakht', '2006-02-15T09:45:30', '951486492670', '65121'), - ('600 Bradford Street', '', '514', 'East Azerbaidzan', '2006-02-15T09:45:30', '117592274996', '96204'), - ('220 Hidalgo Drive', '', '265', 'Kermanshah', '2006-02-15T09:45:30', '342720754566', '45298'), - ('682 Halisahar Place', '', '378', 'Severn Morava', '2006-02-15T09:45:30', '475553436330', '20536'), - ('42 Brindisi Place', '', '586', 'Yerevan', '2006-02-15T09:45:30', '42384721397', '16744'), - ('470 Boksburg Street', '', '81', 'Central', '2006-02-15T09:45:30', '908029859266', '97960'), - ('28 Charlotte Amalie Street', '', '443', 'Rabat-Sal-Zammour-Z', '2006-02-15T09:45:30', '161968374323', '37551'), - ('454 Qinhuangdao Drive', '', '68', 'Tadla-Azilal', '2006-02-15T09:45:30', '786270036240', '25866'), - ('671 Graz Street', '', '353', 'Oriental', '2006-02-15T09:45:30', '680768868518', '94399'), - ('725 Isesaki Place', '', '237', 'Mekka', '2006-02-15T09:45:30', '876295323994', '74428'), - ('733 Mandaluyong Place', '', '2', 'Asir', '2006-02-15T09:45:30', '196568435814', '77459'), - ('1124 Buenaventura Drive', '', '13', 'Mekka', '2006-02-15T09:45:30', '407733804223', '6856'), - ('289 Santo Andr Manor', '', '16', 'al-Sharqiya', '2006-02-15T09:45:30', '214976066017', '72410'), - ('780 Kimberley Way', '', '515', 'Tabuk', '2006-02-15T09:45:30', '824396883951', '17032'), - ('1386 Yangor Avenue', '', '543', 'Provence-Alpes-Cte', '2006-02-15T09:45:30', '449216226468', '80720'), - ('1346 Mysore Drive', '', '92', 'Bretagne', '2006-02-15T09:45:30', '516647474029', '61507'), - ('1740 Le Mans Loop', '', '297', 'Pays de la Loire', '2006-02-15T09:45:30', '168476538960', '22853'), - ('391 Callao Drive', '', '544', 'Midi-Pyrnes', '2006-02-15T09:45:30', '440512153169', '34021'), - ('943 Tokat Street', '', '560', 'Vaduz', '2006-02-15T09:45:30', '889318963672', '45428'), - ('191 Jos Azueta Parkway', '', '436', 'Ruse', '2006-02-15T09:45:30', '932156667696', '13629'), - ('1229 Valencia Parkway', '', '498', 'Haskovo', '2006-02-15T09:45:30', '352679173732', '99124'), - ('1641 Changhwa Place', '', '52', 'Nord-Ouest', '2006-02-15T09:45:30', '256546485220', '37636'), - ('114 Jalib al-Shuyukh Manor', '', '585', 'Centre', '2006-02-15T09:45:30', '845378657301', '60440'), - ('556 Asuncin Way', '', '339', 'Mogiljov', '2006-02-15T09:45:30', '338244023543', '35364'), - ('1027 Songkhla Manor', '', '340', 'Minsk', '2006-02-15T09:45:30', '563660187896', '30861'), - ('1370 Le Mans Avenue', '', '53', 'Brunei and Muara', '2006-02-15T09:45:30', '345679835036', '52163'), - ('614 Pak Kret Street', '', '6', 'Addis Abeba', '2006-02-15T09:45:30', '47808359842', '27796'), - ('1016 Iwakuni Street', '', '269', 'St George', '2006-02-15T09:45:30', '961370847344', '49833'), - ('1628 Nagareyama Lane', '', '453', 'Central', '2006-02-15T09:45:30', '20064292617', '60079'), - ('201 Effon-Alaiye Way', '', '37', 'Asuncin', '2006-02-15T09:45:30', '684192903087', '64344'), - ('1679 Antofagasta Street', '', '122', 'Alto Paran', '2006-02-15T09:45:30', '905903574913', '86599'), - ('1568 Celaya Parkway', '', '168', 'Kaohsiung', '2006-02-15T09:45:30', '278669994384', '34750'), - ('1551 Rampur Lane', '', '108', 'Changhwa', '2006-02-15T09:45:30', '251164340471', '72394'), - ('381 Kabul Way', '', '209', 'Taipei', '2006-02-15T09:45:30', '55477302294', '87272'), - ('1923 Stara Zagora Lane', '', '546', 'Nantou', '2006-02-15T09:45:30', '182178609211', '95179'), - ('1668 Anpolis Street', '', '316', 'Taipei', '2006-02-15T09:45:30', '525255540978', '50199'), - ('608 Birgunj Parkway', '', '116', 'Taipei', '2006-02-15T09:45:30', '627425618482', '400'), - ('1029 Dzerzinsk Manor', '', '542', 'Ynlin', '2006-02-15T09:45:30', '33173584456', '57519'), - ('53 Idfu Parkway', '', '361', 'Nantou', '2006-02-15T09:45:30', '10655648674', '42399'), - ('1947 Poos de Caldas Boulevard', '', '114', 'Chiayi', '2006-02-15T09:45:30', '427454485876', '60951'), - ('1489 Kakamigahara Lane', '', '526', 'Taipei', '2006-02-15T09:45:30', '29341849811', '98883'), - ('773 Dallas Manor', '', '424', 'Buenos Aires', '2006-02-15T09:45:30', '914466027044', '12664'), - ('96 Tafuna Way', '', '128', 'Crdoba', '2006-02-15T09:45:30', '934730187245', '99865'), - ('88 Nagaon Manor', '', '524', 'Buenos Aires', '2006-02-15T09:45:30', '779461480495', '86868'), - ('1532 Dzerzinsk Way', '', '334', 'Buenos Aires', '2006-02-15T09:45:30', '330838016880', '9599'), - ('166 Jinchang Street', '', '165', 'Buenos Aires', '2006-02-15T09:45:30', '717566026669', '86760'), - ('1623 Kingstown Drive', '', '20', 'Buenos Aires', '2006-02-15T09:45:30', '296394569728', '91299'), - ('203 Tambaram Street', '', '161', 'Buenos Aires', '2006-02-15T09:45:30', '411549550611', '73942'), - ('430 Kumbakonam Drive', '', '457', 'Santa F', '2006-02-15T09:45:30', '105470691550', '28814'), - ('1427 A Corua (La Corua) Place', '', '45', 'Buenos Aires', '2006-02-15T09:45:30', '972574862516', '85799'), - ('1483 Pathankot Street', '', '454', 'Tucumn', '2006-02-15T09:45:30', '686015532180', '37288'), - ('1229 Varanasi (Benares) Manor', '', '43', 'Buenos Aires', '2006-02-15T09:45:30', '817740355461', '40195') - ) AS data(address, address2, old_city_id, district, last_update, phone, postal_code) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."city"' - AND map0.old_id = data.old_city_id - RETURNING address_id - ) - SELECT array_agg(address_id) INTO v_new_ids_address FROM inserted; - - FOR i IN 1..array_length(v_new_ids_address, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."address"', v_old_ids_address[i], v_new_ids_address[i]::TEXT); - END LOOP; - - v_old_ids_address := ARRAY['223', '93', '310', '281', '313', '543', '335', '567', '186', '144', '216', '274', '6', '185', '462', '405', '218', '116', '150', '509', '296', '18', '162', '599', '299', '484', '387', '66', '280', '153', '252', '67', '55', '425', '10', '122', '532', '100', '561', '113', '129', '437', '149', '412', '23', '87', '136', '476', '343', '12', '595', '267', '499', '170', '475', '214', '308', '217', '211', '563', '311', '175', '62', '468', '1', '3', '415', '481', '193', '441', '271', '177', '163', '106', '320', '165', '483', '395', '46', '90', '231', '453', '255', '205', '118', '199', '200', '294', '344', '500', '215', '520', '277', '501', '307', '114', '97', '253', '158', '594']; - WITH inserted AS ( - INSERT INTO "public"."address" ("address", "address2", "city_id", "district", "last_update", "phone", "postal_code") - SELECT - data.address::character varying, - data.address2::character varying, - map0.new_id::smallint, - data.district::character varying, - data.last_update::timestamp without time zone, - data.phone::character varying, - data.postal_code::character varying - FROM (VALUES - ('1244 Allappuzha (Alleppey) Place', '', '567', 'Buenos Aires', '2006-02-15T09:45:30', '991802825778', '20657'), - ('1926 El Alto Avenue', '', '289', 'Buenos Aires', '2006-02-15T09:45:30', '846225459260', '75543'), - ('913 Coacalco de Berriozbal Loop', '', '33', 'Texas', '2006-02-15T09:45:30', '262088367001', '42141'), - ('1944 Bamenda Way', '', '573', 'Michigan', '2006-02-15T09:45:30', '75975221996', '24645'), - ('1191 Sungai Petani Boulevard', '', '262', 'Missouri', '2006-02-15T09:45:30', '983259819766', '9668'), - ('43 Vilnius Manor', '', '42', 'Colorado', '2006-02-15T09:45:30', '484500282381', '79814'), - ('587 Benguela Manor', '', '42', 'Illinois', '2006-02-15T09:45:30', '165450987037', '91590'), - ('1894 Boa Vista Way', '', '178', 'Texas', '2006-02-15T09:45:30', '239357986667', '77464'), - ('533 al-Ayn Boulevard', '', '126', 'California', '2006-02-15T09:45:30', '662227486184', '8862'), - ('1666 Beni-Mellal Place', '', '123', 'Tennessee', '2006-02-15T09:45:30', '9099941466', '13377'), - ('660 Jedda Boulevard', '', '65', 'Washington', '2006-02-15T09:45:30', '168758068397', '25053'), - ('920 Kumbakonam Loop', '', '446', 'California', '2006-02-15T09:45:30', '685010736240', '75090'), - ('1121 Loja Avenue', '', '449', 'California', '2006-02-15T09:45:30', '838635286649', '17886'), - ('682 Garden Grove Place', '', '333', 'Tennessee', '2006-02-15T09:45:30', '72136330362', '67497'), - ('1485 Bratislava Place', '', '435', 'Illinois', '2006-02-15T09:45:30', '924663855568', '83183'), - ('530 Lausanne Lane', '', '135', 'Texas', '2006-02-15T09:45:30', '775235029633', '11067'), - ('226 Brest Manor', '', '508', 'California', '2006-02-15T09:45:30', '785881412500', '2299'), - ('793 Cam Ranh Avenue', '', '292', 'California', '2006-02-15T09:45:30', '824370924746', '87057'), - ('879 Newcastle Way', '', '499', 'Michigan', '2006-02-15T09:45:30', '206841104594', '90732'), - ('786 Matsue Way', '', '245', 'Illinois', '2006-02-15T09:45:30', '111177206479', '37469'), - ('1936 Cuman Avenue', '', '433', 'Virginia', '2006-02-15T09:45:30', '976798660411', '61195'), - ('770 Bydgoszcz Avenue', '', '120', 'California', '2006-02-15T09:45:30', '517338314235', '16266'), - ('369 Papeete Way', '', '187', 'North Carolina', '2006-02-15T09:45:30', '170117068815', '66639'), - ('1895 Zhezqazghan Drive', '', '177', 'California', '2006-02-15T09:45:30', '137809746111', '36693'), - ('32 Pudukkottai Lane', '', '140', 'Ohio', '2006-02-15T09:45:30', '967274728547', '38834'), - ('98 Pyongyang Boulevard', '', '11', 'Ohio', '2006-02-15T09:45:30', '191958435142', '88749'), - ('401 Sucre Boulevard', '', '322', 'New Hampshire', '2006-02-15T09:45:30', '486395999608', '25007'), - ('1717 Guadalajara Lane', '', '441', 'Missouri', '2006-02-15T09:45:30', '914090181665', '85505'), - ('1980 Kamjanets-Podilskyi Street', '', '404', 'Illinois', '2006-02-15T09:45:30', '874337098891', '89502'), - ('782 Mosul Street', '', '94', 'Massachusetts', '2006-02-15T09:45:30', '885899703621', '25545'), - ('1309 Weifang Street', '', '520', 'Florida', '2006-02-15T09:45:30', '435785045362', '57338'), - ('1214 Hanoi Way', '', '306', 'Nebraska', '2006-02-15T09:45:30', '491001136577', '67055'), - ('1135 Izumisano Parkway', '', '171', 'California', '2006-02-15T09:45:30', '171822533480', '48150'), - ('1866 al-Qatif Avenue', '', '155', 'California', '2006-02-15T09:45:30', '546793516940', '89420'), - ('1795 Santiago de Compostela Way', '', '295', 'Texas', '2006-02-15T09:45:30', '860452626434', '18743'), - ('333 Goinia Way', '', '185', 'Texas', '2006-02-15T09:45:30', '909029256431', '78625'), - ('1427 Tabuk Place', '', '101', 'Florida', '2006-02-15T09:45:30', '214756839122', '31342'), - ('1308 Arecibo Way', '', '41', 'Georgia', '2006-02-15T09:45:30', '6171054059', '30695'), - ('1497 Fengshan Drive', '', '112', 'KwaZulu-Natal', '2006-02-15T09:45:30', '368738360376', '63022'), - ('682 Junan Way', '', '273', 'North West', '2006-02-15T09:45:30', '622255216127', '30418'), - ('569 Baicheng Lane', '', '85', 'Gauteng', '2006-02-15T09:45:30', '490211944645', '60304'), - ('1766 Almirante Brown Street', '', '364', 'KwaZulu-Natal', '2006-02-15T09:45:30', '617567598243', '63104'), - ('999 Sanaa Loop', '', '491', 'Gauteng', '2006-02-15T09:45:30', '918032330119', '3439'), - ('1639 Saarbrcken Drive', '', '437', 'North West', '2006-02-15T09:45:30', '328494873422', '9827'), - ('1417 Lancaster Avenue', '', '267', 'Northern Cape', '2006-02-15T09:45:30', '272572357893', '72192'), - ('929 Tallahassee Loop', '', '497', 'Gauteng', '2006-02-15T09:45:30', '800716535041', '74671'), - ('898 Belm Manor', '', '87', 'Free State', '2006-02-15T09:45:30', '707169393853', '49757'), - ('270 Tambaram Parkway', '', '244', 'Gauteng', '2006-02-15T09:45:30', '248446668735', '9668'), - ('1443 Mardan Street', '', '392', 'Western Cape', '2006-02-15T09:45:30', '231383037471', '31483'), - ('478 Joliet Way', '', '200', 'Hamilton', '2006-02-15T09:45:30', '657282285970', '77948'), - ('1074 Sanaa Parkway', '', '311', 'Loja', '2006-02-15T09:45:30', '154124128457', '22474'), - ('816 Cayenne Parkway', '', '414', 'Manab', '2006-02-15T09:45:30', '282874611748', '93629'), - ('1954 Kowloon and New Kowloon Way', '', '434', 'Chimborazo', '2006-02-15T09:45:30', '898559280434', '63667'), - ('710 San Felipe del Progreso Avenue', '', '304', 'Lilongwe', '2006-02-15T09:45:30', '843801144113', '76901'), - ('434 Ourense (Orense) Manor', '', '206', 'Hodeida', '2006-02-15T09:45:30', '562370137426', '14122'), - ('751 Lima Loop', '', '7', 'Aden', '2006-02-15T09:45:30', '756460337785', '99405'), - ('687 Alessandria Parkway', '', '455', 'Sanaa', '2006-02-15T09:45:30', '407218522294', '57587'), - ('1001 Miyakonojo Lane', '', '518', 'Taizz', '2006-02-15T09:45:30', '584316724815', '67924'), - ('850 Salala Loop', '', '371', 'Kitaa', '2006-02-15T09:45:30', '403404780639', '10800'), - ('1059 Yuncheng Avenue', '', '570', 'Vilna', '2006-02-15T09:45:30', '107092893983', '47498'), - ('715 So Bernardo do Campo Lane', '', '507', 'Kedah', '2006-02-15T09:45:30', '181179321332', '84804'), - ('316 Uruapan Street', '', '223', 'Perak', '2006-02-15T09:45:30', '275788967899', '58194'), - ('1114 Liepaja Street', '', '282', 'Sarawak', '2006-02-15T09:45:30', '212869228936', '69226'), - ('1844 Usak Avenue', '', '196', 'Nova Scotia', '2006-02-15T09:45:30', '164414772677', '84461'), - ('47 MySakila Drive', NULL, '300', 'Alberta', '2006-02-15T09:45:30', '', ''), - ('23 Workhaven Lane', NULL, '300', 'Alberta', '2006-02-15T09:45:30', '14033335568', ''), - ('432 Garden Grove Street', '', '430', 'Ontario', '2006-02-15T09:45:30', '615964523510', '65630'), - ('1153 Allende Way', '', '179', 'Qubec', '2006-02-15T09:45:30', '856872225376', '20336'), - ('891 Novi Sad Manor', '', '383', 'Ontario', '2006-02-15T09:45:30', '247646995453', '5379'), - ('983 Santa F Way', '', '565', 'British Colombia', '2006-02-15T09:45:30', '145720452260', '47472'), - ('1587 Loja Manor', '', '447', 'Salzburg', '2006-02-15T09:45:30', '621625204422', '5410'), - ('1010 Klerksdorp Way', '', '186', 'Steiermark', '2006-02-15T09:45:30', '493008546874', '6802'), - ('1440 Compton Place', '', '307', 'North Austria', '2006-02-15T09:45:30', '931059836497', '81037'), - ('659 Vaduz Drive', '', '34', 'Ha Darom', '2006-02-15T09:45:30', '709935135487', '49708'), - ('1542 Lubumbashi Boulevard', '', '57', 'Tel Aviv', '2006-02-15T09:45:30', '508800331065', '62472'), - ('97 Shimoga Avenue', '', '533', 'Tel Aviv', '2006-02-15T09:45:30', '177167004331', '44660'), - ('632 Usolje-Sibirskoje Parkway', '', '36', 'Ha Darom', '2006-02-15T09:45:30', '667648979883', '73085'), - ('1337 Mit Ghamr Avenue', '', '358', 'Nakhon Sawan', '2006-02-15T09:45:30', '175283210378', '29810'), - ('1632 Bislig Avenue', '', '394', 'Nonthaburi', '2006-02-15T09:45:30', '471675840679', '61117'), - ('870 Ashqelon Loop', '', '489', 'Songkhla', '2006-02-15T09:45:30', '135117278909', '84931'), - ('430 Alessandria Loop', '', '439', 'Saarland', '2006-02-15T09:45:30', '669828224459', '47446'), - ('319 Springs Loop', '', '160', 'Baijeri', '2006-02-15T09:45:30', '72524459905', '99552'), - ('1966 Tonghae Street', '', '198', 'Anhalt Sachsen', '2006-02-15T09:45:30', '567359279425', '36481'), - ('68 Molodetno Manor', '', '575', 'Nordrhein-Westfalen', '2006-02-15T09:45:30', '146640639760', '4662'), - ('442 Rae Bareli Place', '', '148', 'Nordrhein-Westfalen', '2006-02-15T09:45:30', '886636413768', '24321'), - ('1792 Valle de la Pascua Place', '', '477', 'Nordrhein-Westfalen', '2006-02-15T09:45:30', '419419591240', '15540'), - ('1074 Binzhou Manor', '', '325', 'Baden-Wrttemberg', '2006-02-15T09:45:30', '331132568928', '36490'), - ('1912 Allende Manor', '', '279', 'Kowloon and New Kowl', '2006-02-15T09:45:30', '172262454487', '58124'), - ('1909 Benguela Lane', '', '581', 'Henan', '2006-02-15T09:45:30', '624138001031', '19913'), - ('362 Rajkot Lane', '', '47', 'Gansu', '2006-02-15T09:45:30', '962020153680', '98030'), - ('1333 Haldia Street', '', '174', 'Jilin', '2006-02-15T09:45:30', '408304391718', '82161'), - ('1778 Gijn Manor', '', '594', 'Hubei', '2006-02-15T09:45:30', '288910576761', '35156'), - ('85 San Felipe de Puerto Plata Drive', '', '584', 'Shandong', '2006-02-15T09:45:30', '170739645687', '46063'), - ('1060 Tandil Lane', '', '432', 'Shandong', '2006-02-15T09:45:30', '211256301880', '72349'), - ('1908 Gaziantep Place', '', '536', 'Liaoning', '2006-02-15T09:45:30', '108053751300', '58979'), - ('804 Elista Drive', '', '159', 'Hubei', '2006-02-15T09:45:30', '379804592943', '61069'), - ('832 Nakhon Sawan Manor', '', '592', 'Inner Mongolia', '2006-02-15T09:45:30', '275595571388', '49021'), - ('1760 Oshawa Manor', '', '535', 'Tianjin', '2006-02-15T09:45:30', '56257502250', '38140'), - ('798 Cianjur Avenue', '', '590', 'Shanxi', '2006-02-15T09:45:30', '499408708580', '76990'), - ('1464 Kursk Parkway', '', '574', 'Shandong', '2006-02-15T09:45:30', '338758048786', '17381') - ) AS data(address, address2, old_city_id, district, last_update, phone, postal_code) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."city"' - AND map0.old_id = data.old_city_id - RETURNING address_id - ) - SELECT array_agg(address_id) INTO v_new_ids_address FROM inserted; - - FOR i IN 1..array_length(v_new_ids_address, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."address"', v_old_ids_address[i], v_new_ids_address[i]::TEXT); - END LOOP; - - v_old_ids_address := ARRAY['41', '427', '389', '286', '600', '288', '172', '429', '539', '245', '527', '246', '383', '558', '94', '265', '133', '329', '440', '544', '570', '201', '447', '142', '272', '155', '575', '471', '68', '169', '318', '490', '71', '601', '173', '394', '605', '516', '556', '489', '552', '362', '7', '602', '596', '258', '342', '290', '360', '38', '83', '151', '390', '15', '508', '33', '537', '553', '57', '396', '406', '244', '269', '198', '409', '304', '167', '58', '494', '580', '401', '5', '370', '525', '145', '434', '579', '80', '363', '64', '140', '292', '139', '264', '213', '228', '341', '445', '273', '560', '408', '72', '171', '229', '16', '99', '196', '361', '451', '121']; - WITH inserted AS ( - INSERT INTO "public"."address" ("address", "address2", "city_id", "district", "last_update", "phone", "postal_code") - SELECT - data.address::character varying, - data.address2::character varying, - map0.new_id::smallint, - data.district::character varying, - data.last_update::timestamp without time zone, - data.phone::character varying, - data.postal_code::character varying - FROM (VALUES - ('1440 Fukuyama Loop', '', '362', 'Henan', '2006-02-15T09:45:30', '912257250465', '47929'), - ('1557 Cape Coral Parkway', '', '293', 'Hubei', '2006-02-15T09:45:30', '368284120423', '46875'), - ('500 Lincoln Parkway', '', '210', 'Jiangsu', '2006-02-15T09:45:30', '550306965159', '95509'), - ('1308 Sumy Loop', '', '175', 'Fujian', '2006-02-15T09:45:30', '583021225407', '30657'), - ('1837 Kaduna Parkway', '', '241', 'Inner Mongolia', '2006-02-15T09:45:30', '640843562301', '82580'), - ('226 Halifax Street', '', '277', 'Xinxiang', '2006-02-15T09:45:30', '790651020929', '58492'), - ('475 Atinsk Way', '', '240', 'Gansu', '2006-02-15T09:45:30', '201705577290', '59571'), - ('1269 Botosani Manor', '', '468', 'Guangdong', '2006-02-15T09:45:30', '736517327853', '47394'), - ('1332 Gaziantep Lane', '', '80', 'Shandong', '2006-02-15T09:45:30', '383353187467', '22813'), - ('1103 Bilbays Parkway', '', '578', 'Hubei', '2006-02-15T09:45:30', '279979529227', '87660'), - ('1993 0 Loop', '', '588', 'Liaoning', '2006-02-15T09:45:30', '25865528181', '41214'), - ('1246 Boksburg Parkway', '', '422', 'Hebei', '2006-02-15T09:45:30', '890283544295', '28349'), - ('686 Donostia-San Sebastin Lane', '', '471', 'Guangdong', '2006-02-15T09:45:30', '71857599858', '97390'), - ('904 Clarksville Drive', '', '193', 'Zhejiang', '2006-02-15T09:45:30', '955349440539', '52234'), - ('1952 Chatsworth Drive', '', '332', 'Guangdong', '2006-02-15T09:45:30', '991562402283', '25958'), - ('1158 Mandi Bahauddin Parkway', '', '136', 'Shanxi', '2006-02-15T09:45:30', '276555730211', '98484'), - ('1854 Tieli Street', '', '302', 'Shandong', '2006-02-15T09:45:30', '509492324775', '15819'), - ('867 Benin City Avenue', '', '591', 'Henan', '2006-02-15T09:45:30', '168884817145', '78543'), - ('722 Bradford Lane', '', '249', 'Shandong', '2006-02-15T09:45:30', '746251338300', '90920'), - ('183 Haiphong Street', '', '46', 'Jilin', '2006-02-15T09:45:30', '488600270038', '69953'), - ('415 Pune Avenue', '', '580', 'Shandong', '2006-02-15T09:45:30', '203202500108', '44274'), - ('817 Bradford Loop', '', '109', 'Jiangsu', '2006-02-15T09:45:30', '264286442804', '89459'), - ('105 Dzerzinsk Manor', '', '540', 'Inner Mongolia', '2006-02-15T09:45:30', '240776414296', '48570'), - ('1587 Sullana Lane', '', '207', 'Inner Mongolia', '2006-02-15T09:45:30', '468060467018', '85769'), - ('1762 Paarl Parkway', '', '298', 'Hunan', '2006-02-15T09:45:30', '192459639410', '53928'), - ('1560 Jelets Boulevard', '', '291', 'Shandong', '2006-02-15T09:45:30', '189446090264', '77777'), - ('1052 Pathankot Avenue', '', '299', 'Sichuan', '2006-02-15T09:45:30', '128499386727', '77397'), - ('1322 Mosul Parkway', '', '145', 'Shandong', '2006-02-15T09:45:30', '268053970382', '95400'), - ('1966 Amroha Avenue', '', '139', 'Sichuan', '2006-02-15T09:45:30', '333489324603', '70385'), - ('154 Tallahassee Loop', '', '199', 'Xinxiang', '2006-02-15T09:45:30', '935508855935', '62250'), - ('1774 Yaound Place', '', '166', 'Hubei', '2006-02-15T09:45:30', '613124286867', '91400'), - ('1909 Dayton Avenue', '', '469', 'Guangdong', '2006-02-15T09:45:30', '702955450528', '88513'), - ('1586 Guaruj Place', '', '579', 'Hunan', '2006-02-15T09:45:30', '947233365992', '5135'), - ('844 Bucuresti Place', '', '242', 'Liaoning', '2006-02-15T09:45:30', '935952366111', '36603'), - ('1294 Firozabad Drive', '', '407', 'Jiangxi', '2006-02-15T09:45:30', '161801569569', '70618'), - ('753 Ilorin Avenue', '', '157', 'Sichuan', '2006-02-15T09:45:30', '464511145118', '3656'), - ('1325 Fukuyama Street', '', '537', 'Heilongjiang', '2006-02-15T09:45:30', '288241215394', '27107'), - ('1574 Goinia Boulevard', '', '502', 'Heilongjiang', '2006-02-15T09:45:30', '59634255214', '39529'), - ('346 Cam Ranh Avenue', '', '599', 'Zhejiang', '2006-02-15T09:45:30', '978430786151', '39976'), - ('1297 Alvorada Parkway', '', '587', 'Ningxia', '2006-02-15T09:45:30', '508348602835', '11839'), - ('390 Wroclaw Way', '', '462', 'Hainan', '2006-02-15T09:45:30', '357593328658', '5753'), - ('482 Kowloon and New Kowloon Manor', '', '90', 'Bratislava', '2006-02-15T09:45:30', '738968474939', '97056'), - ('692 Joliet Street', '', '38', 'Attika', '2006-02-15T09:45:30', '448477190408', '83579'), - ('1101 Bucuresti Boulevard', '', '401', 'West Greece', '2006-02-15T09:45:30', '199514580428', '97661'), - ('1759 Niznekamsk Avenue', '', '14', 'al-Manama', '2006-02-15T09:45:30', '864392582257', '39414'), - ('752 Ondo Loop', '', '338', 'Miyazaki', '2006-02-15T09:45:30', '134673576619', '32474'), - ('124 al-Manama Way', '', '382', 'Hiroshima', '2006-02-15T09:45:30', '647899404952', '52368'), - ('1336 Benin City Drive', '', '386', 'Shiga', '2006-02-15T09:45:30', '341242939532', '46044'), - ('619 Hunuco Avenue', '', '331', 'Shimane', '2006-02-15T09:45:30', '142596392389', '81508'), - ('61 Tama Street', '', '284', 'Okayama', '2006-02-15T09:45:30', '708403338270', '94065'), - ('586 Tete Way', '', '256', 'Kanagawa', '2006-02-15T09:45:30', '18581624103', '1079'), - ('1337 Lincoln Parkway', '', '555', 'Saitama', '2006-02-15T09:45:30', '597815221267', '99457'), - ('102 Chapra Drive', '', '521', 'Ibaragi', '2006-02-15T09:45:30', '776031833752', '14073'), - ('1542 Tarlac Parkway', '', '440', 'Kanagawa', '2006-02-15T09:45:30', '635297277345', '1027'), - ('496 Celaya Drive', '', '552', 'Nagano', '2006-02-15T09:45:30', '759586584889', '90797'), - ('786 Aurora Avenue', '', '474', 'Yamaguchi', '2006-02-15T09:45:30', '18461860151', '65750'), - ('958 Sagamihara Lane', '', '287', 'Mie', '2006-02-15T09:45:30', '427274926505', '88408'), - ('1421 Quilmes Lane', '', '260', 'Ishikawa', '2006-02-15T09:45:30', '135407755975', '19151'), - ('17 Kabul Boulevard', '', '355', 'Chiba', '2006-02-15T09:45:30', '697760867968', '38594'), - ('767 Pyongyang Drive', '', '229', 'Osaka', '2006-02-15T09:45:30', '667736124769', '83536'), - ('454 Patiala Lane', '', '276', 'Fukushima', '2006-02-15T09:45:30', '794553031307', '13496'), - ('1148 Saarbrcken Parkway', '', '226', 'Fukushima', '2006-02-15T09:45:30', '137773001988', '1921'), - ('446 Kirovo-Tepetsk Lane', '', '203', 'Osaka', '2006-02-15T09:45:30', '303967439816', '19428'), - ('345 Oshawa Boulevard', '', '204', 'Tokyo-to', '2006-02-15T09:45:30', '104491201771', '32114'), - ('1266 Laredo Parkway', '', '380', 'Saitama', '2006-02-15T09:45:30', '1483365694', '7664'), - ('1635 Kuwana Boulevard', '', '205', 'Hiroshima', '2006-02-15T09:45:30', '710603868323', '52137'), - ('1287 Xiangfan Boulevard', '', '253', 'Gifu', '2006-02-15T09:45:30', '819416131190', '57844'), - ('1964 Allappuzha (Alleppey) Street', '', '227', 'Yamaguchi', '2006-02-15T09:45:30', '920811325222', '48980'), - ('591 Sungai Petani Drive', '', '376', 'Okayama', '2006-02-15T09:45:30', '37247325001', '46400'), - ('923 Tangail Boulevard', '', '10', 'Tokyo-to', '2006-02-15T09:45:30', '315528269898', '33384'), - ('168 Cianjur Manor', '', '228', 'Saitama', '2006-02-15T09:45:30', '679095087143', '73824'), - ('1913 Hanoi Way', '', '463', 'Nagasaki', '2006-02-15T09:45:30', '28303384290', '35200'), - ('1565 Tangail Manor', '', '377', 'Okinawa', '2006-02-15T09:45:30', '634445428822', '45750'), - ('1949 Sanya Street', '', '224', 'Gumma', '2006-02-15T09:45:30', '132100972047', '61244'), - ('928 Jaffna Loop', '', '172', 'Hiroshima', '2006-02-15T09:45:30', '581852137991', '93762'), - ('1404 Taguig Drive', '', '547', 'Okayama', '2006-02-15T09:45:30', '572068624538', '87212'), - ('521 San Juan Bautista Tuxtepec Place', '', '598', 'Qaraghandy', '2006-02-15T09:45:30', '844018348565', '95093'), - ('602 Paarl Street', '', '402', 'Pavlodar', '2006-02-15T09:45:30', '896314772871', '98889'), - ('604 Bern Place', '', '429', 'Jharkhand', '2006-02-15T09:45:30', '620719383725', '5373'), - ('81 Hodeida Way', '', '231', 'Rajasthan', '2006-02-15T09:45:30', '250767749542', '55561'), - ('788 Atinsk Street', '', '211', 'Karnataka', '2006-02-15T09:45:30', '146497509724', '81691'), - ('1993 Tabuk Lane', '', '522', 'Tamil Nadu', '2006-02-15T09:45:30', '648482415405', '64221'), - ('943 Johannesburg Avenue', '', '417', 'Maharashtra', '2006-02-15T09:45:30', '90921003005', '5892'), - ('1027 Banjul Place', '', '197', 'West Bengali', '2006-02-15T09:45:30', '538241037443', '50390'), - ('43 Dadu Avenue', '', '74', 'Rajasthan', '2006-02-15T09:45:30', '95666951770', '4855'), - ('60 Poos de Caldas Street', '', '243', 'Rajasthan', '2006-02-15T09:45:30', '963063788669', '82338'), - ('1920 Weifang Avenue', '', '427', 'Uttar Pradesh', '2006-02-15T09:45:30', '869507847714', '15643'), - ('495 Bhimavaram Lane', '', '144', 'Maharashtra', '2006-02-15T09:45:30', '82088937724', '3'), - ('1519 Ilorin Place', '', '395', 'Kerala', '2006-02-15T09:45:30', '357445645426', '49298'), - ('1447 Imus Place', '', '426', 'Gujarat', '2006-02-15T09:45:30', '62127829280', '12905'), - ('990 Etawah Loop', '', '564', 'Tamil Nadu', '2006-02-15T09:45:30', '206169448769', '79940'), - ('57 Arlington Manor', '', '475', 'Madhya Pradesh', '2006-02-15T09:45:30', '990214419142', '48960'), - ('1540 Wroclaw Drive', '', '107', 'Maharashtra', '2006-02-15T09:45:30', '182363341674', '62686'), - ('1014 Loja Manor', '', '22', 'Tamil Nadu', '2006-02-15T09:45:30', '460795526514', '66851'), - ('808 Bhopal Manor', '', '582', 'Haryana', '2006-02-15T09:45:30', '465887807014', '10672'), - ('1697 Tanauan Lane', '', '399', 'Punjab', '2006-02-15T09:45:30', '4764773857', '22870'), - ('9 San Miguel de Tucumn Manor', '', '169', 'Uttar Pradesh', '2006-02-15T09:45:30', '956188728558', '90845'), - ('45 Aparecida de Goinia Place', '', '464', 'Madhya Pradesh', '2006-02-15T09:45:30', '650496654258', '7431'), - ('1704 Tambaram Manor', '', '554', 'West Bengali', '2006-02-15T09:45:30', '39463554936', '2834'), - ('1967 Sincelejo Place', '', '176', 'Gujarat', '2006-02-15T09:45:30', '577812616052', '73644') - ) AS data(address, address2, old_city_id, district, last_update, phone, postal_code) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."city"' - AND map0.old_id = data.old_city_id - RETURNING address_id - ) - SELECT array_agg(address_id) INTO v_new_ids_address FROM inserted; - - FOR i IN 1..array_length(v_new_ids_address, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."address"', v_old_ids_address[i], v_new_ids_address[i]::TEXT); - END LOOP; - - v_old_ids_address := ARRAY['19', '426', '36', '305', '535', '174', '35', '540', '418', '127', '242', '276', '279', '63', '206', '82', '156', '507', '497', '125', '221', '424', '375', '301', '513', '384', '514', '321', '212', '431', '179', '473', '372', '417', '32', '190', '302', '235', '222', '522', '232', '2', '4', '411', '338', '339', '443', '531', '504', '225', '37', '547', '444', '314', '47', '60', '386', '349', '8', '261', '109', '380', '392', '461', '204', '73', '446', '180', '161', '368', '197', '337', '334', '25', '152', '86', '391', '480', '191', '135', '551', '466', '76', '554', '248', '98', '240', '354', '439', '528', '510', '586', '393', '268', '376', '75', '266', '31', '378', '192']; - WITH inserted AS ( - INSERT INTO "public"."address" ("address", "address2", "city_id", "district", "last_update", "phone", "postal_code") - SELECT - data.address::character varying, - data.address2::character varying, - map0.new_id::smallint, - data.district::character varying, - data.last_update::timestamp without time zone, - data.phone::character varying, - data.postal_code::character varying - FROM (VALUES - ('419 Iligan Lane', '', '76', 'Madhya Pradesh', '2006-02-15T09:45:30', '990911107354', '72878'), - ('1661 Abha Drive', '', '416', 'Tamil Nadu', '2006-02-15T09:45:30', '270456873752', '14400'), - ('176 Mandaluyong Place', '', '239', 'Uttar Pradesh', '2006-02-15T09:45:30', '627705991774', '65213'), - ('41 El Alto Parkway', '', '398', 'Maharashtra', '2006-02-15T09:45:30', '51917807050', '56883'), - ('635 Brest Manor', '', '75', 'Andhra Pradesh', '2006-02-15T09:45:30', '80593242951', '40899'), - ('1877 Ezhou Lane', '', '550', 'Rajasthan', '2006-02-15T09:45:30', '264541743403', '63337'), - ('33 Gorontalo Way', '', '257', 'West Bengali', '2006-02-15T09:45:30', '745994947458', '30348'), - ('949 Allende Lane', '', '24', 'Uttar Pradesh', '2006-02-15T09:45:30', '122981120653', '67521'), - ('126 Acua Parkway', '', '71', 'West Bengali', '2006-02-15T09:45:30', '480039662421', '58888'), - ('117 Boa Vista Way', '', '566', 'Uttar Pradesh', '2006-02-15T09:45:30', '677976133614', '6804'), - ('1964 Gijn Manor', '', '473', 'Karnataka', '2006-02-15T09:45:30', '918119601885', '14408'), - ('1675 Xiangfan Manor', '', '283', 'Tamil Nadu', '2006-02-15T09:45:30', '271149517630', '11763'), - ('1884 Shikarpur Avenue', '', '263', 'Haryana', '2006-02-15T09:45:30', '959949395183', '85548'), - ('1213 Ranchi Parkway', '', '350', 'Karnataka', '2006-02-15T09:45:30', '800024380485', '94352'), - ('642 Nador Drive', '', '77', 'Maharashtra', '2006-02-15T09:45:30', '369050085652', '3924'), - ('936 Salzburg Lane', '', '425', 'Uttar Pradesh', '2006-02-15T09:45:30', '875756771675', '96709'), - ('1963 Moscow Place', '', '354', 'Assam', '2006-02-15T09:45:30', '761379480249', '64863'), - ('1197 Sokoto Boulevard', '', '478', 'West Bengali', '2006-02-15T09:45:30', '868602816371', '87687'), - ('1013 Tabuk Boulevard', '', '261', 'West Bengali', '2006-02-15T09:45:30', '158399646978', '96203'), - ('211 Chiayi Drive', '', '164', 'Uttar Pradesh', '2006-02-15T09:45:30', '665993880048', '58186'), - ('866 Shivapuri Manor', '', '448', 'Uttar Pradesh', '2006-02-15T09:45:30', '778502731092', '22474'), - ('1948 Bayugan Parkway', '', '264', 'Bihar', '2006-02-15T09:45:30', '987306329957', '60622'), - ('1049 Matamoros Parkway', '', '191', 'Karnataka', '2006-02-15T09:45:30', '960505250340', '69640'), - ('951 Stara Zagora Manor', '', '400', 'Punjab', '2006-02-15T09:45:30', '429925609431', '98573'), - ('758 Korolev Parkway', '', '568', 'Andhra Pradesh', '2006-02-15T09:45:30', '441628280920', '75474'), - ('97 Mogiljov Lane', '', '73', 'Gujarat', '2006-02-15T09:45:30', '924815207181', '89294'), - ('1747 Rustenburg Place', '', '110', 'Bihar', '2006-02-15T09:45:30', '442673923363', '51369'), - ('651 Pathankot Loop', '', '336', 'Maharashtra', '2006-02-15T09:45:30', '139378397418', '59811'), - ('624 Oshawa Boulevard', '', '51', 'West Bengali', '2006-02-15T09:45:30', '49677664184', '89959'), - ('1596 Acua Parkway', '', '418', 'Jharkhand', '2006-02-15T09:45:30', '157133457169', '70425'), - ('431 Xiangtan Avenue', '', '18', 'Kerala', '2006-02-15T09:45:30', '230250973122', '4854'), - ('1257 Guadalajara Street', '', '78', 'Karnataka', '2006-02-15T09:45:30', '195337700615', '33599'), - ('230 Urawa Drive', '', '8', 'Andhra Pradesh', '2006-02-15T09:45:30', '166898395731', '2738'), - ('791 Salinas Street', '', '208', 'Punjab', '2006-02-15T09:45:30', '129953030512', '40509'), - ('1425 Shikarpur Manor', '', '346', 'Bihar', '2006-02-15T09:45:30', '678220867005', '65599'), - ('435 0 Way', '', '195', 'West Bengali', '2006-02-15T09:45:30', '760171523969', '74750'), - ('922 Vila Velha Loop', '', '9', 'Maharashtra', '2006-02-15T09:45:30', '510737228015', '4085'), - ('954 Kimchon Place', '', '559', 'West Bengali', '2006-02-15T09:45:30', '541327526474', '42420'), - ('1168 Najafabad Parkway', '', '251', 'Kabol', '2006-02-15T09:45:30', '886649065861', '40301'), - ('1768 Udine Loop', '', '60', 'Battambang', '2006-02-15T09:45:30', '448876499197', '32347'), - ('754 Valencia Place', '', '406', 'Phnom Penh', '2006-02-15T09:45:30', '594319417514', '87911'), - ('28 MySQL Boulevard', NULL, '576', 'QLD', '2006-02-15T09:45:30', '', ''), - ('1411 Lillydale Drive', NULL, '576', 'QLD', '2006-02-15T09:45:30', '6172235589', ''), - ('264 Bhimavaram Manor', '', '111', 'St Thomas', '2006-02-15T09:45:30', '302526949177', '54749'), - ('431 Szkesfehrvr Avenue', '', '48', 'Baki', '2006-02-15T09:45:30', '119501405123', '57828'), - ('503 Sogamoso Loop', '', '505', 'Sumqayit', '2006-02-15T09:45:30', '834626715837', '49812'), - ('1836 Korla Parkway', '', '272', 'Copperbelt', '2006-02-15T09:45:30', '689681677428', '55405'), - ('1986 Sivas Place', '', '551', 'Friuli-Venezia Giuli', '2006-02-15T09:45:30', '182059202712', '95775'), - ('1 Valle de Santiago Avenue', '', '93', 'Apulia', '2006-02-15T09:45:30', '465897838272', '86208'), - ('1926 Gingoog Street', '', '511', 'Sisilia', '2006-02-15T09:45:30', '469738825391', '22824'), - ('127 Purnea (Purnia) Manor', '', '17', 'Piemonte', '2006-02-15T09:45:30', '911872220378', '79388'), - ('379 Lublin Parkway', '', '309', 'Toscana', '2006-02-15T09:45:30', '921960450089', '74568'), - ('231 Kaliningrad Place', '', '70', 'Lombardia', '2006-02-15T09:45:30', '575081026569', '57833'), - ('1224 Huejutla de Reyes Boulevard', '', '91', 'Lombardia', '2006-02-15T09:45:30', '806016930576', '70923'), - ('1447 Imus Way', '', '167', 'Tahiti', '2006-02-15T09:45:30', '539758313890', '48942'), - ('1668 Saint Louis Place', '', '397', 'Tahiti', '2006-02-15T09:45:30', '347487831378', '39072'), - ('1368 Maracabo Boulevard', '', '493', '', '2006-02-15T09:45:30', '934352415130', '32716'), - ('1516 Escobar Drive', '', '370', 'Tongatapu', '2006-02-15T09:45:30', '64536069371', '46069'), - ('1566 Inegl Manor', '', '349', 'Mandalay', '2006-02-15T09:45:30', '705814003527', '53561'), - ('51 Laredo Avenue', '', '342', 'Sagaing', '2006-02-15T09:45:30', '884536620568', '68146'), - ('454 Nakhon Sawan Boulevard', '', '173', 'Funafuti', '2006-02-15T09:45:30', '963887147572', '76383'), - ('1519 Santiago de los Caballeros Loop', '', '348', 'East Kasai', '2006-02-15T09:45:30', '409315295763', '22025'), - ('514 Ife Way', '', '315', 'Shaba', '2006-02-15T09:45:30', '900235712074', '69973'), - ('1889 Valparai Way', '', '600', 'Ziguinchor', '2006-02-15T09:45:30', '670370974122', '75559'), - ('387 Mwene-Ditu Drive', '', '35', 'Ahal', '2006-02-15T09:45:30', '764477681869', '8073'), - ('1031 Daugavpils Parkway', '', '63', 'Bchar', '2006-02-15T09:45:30', '107137400143', '59025'), - ('1924 Shimonoseki Drive', '', '59', 'Batna', '2006-02-15T09:45:30', '406784385440', '52625'), - ('757 Rustenburg Avenue', '', '483', 'Skikda', '2006-02-15T09:45:30', '506134035434', '89668'), - ('1386 Nakhon Sawan Boulevard', '', '420', 'Pyongyang-si', '2006-02-15T09:45:30', '368899174225', '53502'), - ('1658 Jastrzebie-Zdrj Loop', '', '372', 'Central', '2006-02-15T09:45:30', '568367775448', '96584'), - ('447 Surakarta Loop', '', '271', 'Nyanza', '2006-02-15T09:45:30', '940830176580', '10428'), - ('1838 Tabriz Lane', '', '143', 'Dhaka', '2006-02-15T09:45:30', '38988715447', '1195'), - ('1816 Bydgoszcz Loop', '', '234', 'Dhaka', '2006-02-15T09:45:30', '965273813662', '64308'), - ('262 A Corua (La Corua) Parkway', '', '525', 'Dhaka', '2006-02-15T09:45:30', '892775750063', '34418'), - ('1952 Pune Lane', '', '442', 'Saint-Denis', '2006-02-15T09:45:30', '354615066969', '92150'), - ('927 Baha Blanca Parkway', '', '479', 'Krim', '2006-02-15T09:45:30', '821972242086', '9495'), - ('1793 Meixian Place', '', '258', 'Hmelnytskyi', '2006-02-15T09:45:30', '619966287415', '33535'), - ('421 Yaound Street', '', '385', 'Sumy', '2006-02-15T09:45:30', '726875628268', '11363'), - ('140 Chiayi Parkway', '', '506', 'Sumy', '2006-02-15T09:45:30', '855863906434', '38982'), - ('1752 So Leopoldo Parkway', '', '345', 'Taka-Karpatia', '2006-02-15T09:45:30', '252265130067', '14014'), - ('182 Nukualofa Drive', '', '275', 'Sumy', '2006-02-15T09:45:30', '426346224043', '15414'), - ('118 Jaffna Loop', '', '182', 'Northern Mindanao', '2006-02-15T09:45:30', '325526730021', '10447'), - ('89 Allappuzha (Alleppey) Manor', '', '517', 'National Capital Reg', '2006-02-15T09:45:30', '255800440636', '75444'), - ('947 Trshavn Place', '', '528', 'Central Luzon', '2006-02-15T09:45:30', '50898428626', '841'), - ('582 Papeete Loop', '', '294', 'Central Visayas', '2006-02-15T09:45:30', '569868543137', '27722'), - ('152 Kitwe Parkway', '', '82', 'Caraga', '2006-02-15T09:45:30', '835433605312', '53182'), - ('1479 Rustenburg Boulevard', '', '527', 'Southern Tagalog', '2006-02-15T09:45:30', '727785483194', '18727'), - ('953 Hodeida Street', '', '221', 'Southern Tagalog', '2006-02-15T09:45:30', '53912826864', '18841'), - ('1351 Aparecida de Goinia Parkway', '', '391', 'Northern Mindanao', '2006-02-15T09:45:30', '959834530529', '41775'), - ('1176 Southend-on-Sea Manor', '', '458', 'Southern Tagalog', '2006-02-15T09:45:30', '236679267178', '81651'), - ('48 Maracabo Place', '', '519', 'Central Luzon', '2006-02-15T09:45:30', '82671830126', '1570'), - ('951 Springs Lane', '', '219', 'Central Mindanao', '2006-02-15T09:45:30', '165164761435', '96115'), - ('717 Changzhou Lane', '', '104', 'Southern Tagalog', '2006-02-15T09:45:30', '426255288071', '21615'), - ('1831 Nam Dinh Loop', '', '323', 'National Capital Reg', '2006-02-15T09:45:30', '322888976727', '51990'), - ('1061 Ede Avenue', '', '98', 'Southern Tagalog', '2006-02-15T09:45:30', '333390595558', '57810'), - ('492 Cam Ranh Street', '', '61', 'Eastern Visayas', '2006-02-15T09:45:30', '565018274456', '50805'), - ('862 Xintai Lane', '', '548', 'Cagayan Valley', '2006-02-15T09:45:30', '265153400632', '30065'), - ('217 Botshabelo Place', '', '138', 'Southern Mindanao', '2006-02-15T09:45:30', '665356572025', '49521'), - ('1191 Tandil Drive', '', '523', 'Southern Tagalog', '2006-02-15T09:45:30', '45554316010', '6362'), - ('1166 Changhwa Street', '', '62', 'Caraga', '2006-02-15T09:45:30', '650752094490', '58852') - ) AS data(address, address2, old_city_id, district, last_update, phone, postal_code) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."city"' - AND map0.old_id = data.old_city_id - RETURNING address_id - ) - SELECT array_agg(address_id) INTO v_new_ids_address FROM inserted; - - FOR i IN 1..array_length(v_new_ids_address, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."address"', v_old_ids_address[i], v_new_ids_address[i]::TEXT); - END LOOP; - - v_old_ids_address := ARRAY['260', '400', '54', '303', '141', '479', '420', '346', '188', '577', '578', '564', '323', '132', '275', '385', '506', '347', '448', '220', '187', '233', '557', '81', '330', '319', '403', '315', '550', '359', '210', '379', '182', '134', '259', '96', '250', '130', '312', '78', '432', '597', '367', '51', '43', '103', '241', '92', '542', '249', '164', '398', '21', '381', '300', '573', '50', '306', '195', '356', '48', '402', '351', '183', '435', '226', '110', '433', '52', '59', '492', '104', '467', '131', '515', '355', '452', '316', '85', '262', '101', '438', '263', '423', '442', '436', '460', '340', '519', '243', '207', '333', '511', '455', '548', '120', '377', '463', '416', '478']; - WITH inserted AS ( - INSERT INTO "public"."address" ("address", "address2", "city_id", "district", "last_update", "phone", "postal_code") - SELECT - data.address::character varying, - data.address2::character varying, - map0.new_id::smallint, - data.district::character varying, - data.last_update::timestamp without time zone, - data.phone::character varying, - data.postal_code::character varying - FROM (VALUES - ('127 Iwakuni Boulevard', '', '192', 'Central Luzon', '2006-02-15T09:45:30', '987442542471', '20777'), - ('1152 Citrus Heights Manor', '', '15', 'al-Qadarif', '2006-02-15T09:45:30', '765957414528', '5239'), - ('115 Hidalgo Parkway', '', '379', 'Khartum', '2006-02-15T09:45:30', '307703950263', '80168'), - ('898 Jining Lane', '', '387', 'Pohjois-Pohjanmaa', '2006-02-15T09:45:30', '161643343536', '40070'), - ('1749 Daxian Place', '', '29', 'Gelderland', '2006-02-15T09:45:30', '963369996279', '11044'), - ('1854 Okara Boulevard', '', '158', 'Drenthe', '2006-02-15T09:45:30', '131912793873', '42123'), - ('992 Klerksdorp Loop', '', '23', 'Utrecht', '2006-02-15T09:45:30', '855290087237', '33711'), - ('1217 Konotop Avenue', '', '151', 'Gelderland', '2006-02-15T09:45:30', '718917251754', '504'), - ('741 Ambattur Manor', '', '438', 'Noord-Brabant', '2006-02-15T09:45:30', '302590383819', '43310'), - ('1501 Pangkal Pinang Avenue', '', '409', 'Mazowieckie', '2006-02-15T09:45:30', '770864062795', '943'), - ('1405 Hagonoy Avenue', '', '133', 'Slaskie', '2006-02-15T09:45:30', '867287719310', '86587'), - ('505 Madiun Boulevard', '', '577', 'Dolnoslaskie', '2006-02-15T09:45:30', '970638808606', '97271'), - ('1769 Iwaki Lane', '', '97', 'Kujawsko-Pomorskie', '2006-02-15T09:45:30', '556100547674', '25787'), - ('1050 Garden Grove Avenue', '', '236', 'Slaskie', '2006-02-15T09:45:30', '973047364353', '4999'), - ('906 Goinia Way', '', '255', 'Wielkopolskie', '2006-02-15T09:45:30', '701767622697', '83565'), - ('1642 Charlotte Amalie Drive', '', '549', 'Slaskie', '2006-02-15T09:45:30', '821476736117', '75442'), - ('414 Mandaluyong Street', '', '314', 'Lubelskie', '2006-02-15T09:45:30', '52709222667', '16370'), - ('1293 Nam Dinh Way', '', '84', 'Roraima', '2006-02-15T09:45:30', '697656479977', '71583'), - ('614 Denizli Parkway', '', '486', 'Rio Grande do Sul', '2006-02-15T09:45:30', '876491807547', '29444'), - ('1201 Qomsheh Manor', '', '28', 'Gois', '2006-02-15T09:45:30', '873492228462', '21464'), - ('1839 Szkesfehrvr Parkway', '', '317', 'Gois', '2006-02-15T09:45:30', '947468818183', '55709'), - ('356 Olomouc Manor', '', '26', 'Gois', '2006-02-15T09:45:30', '22326410776', '93323'), - ('1407 Pachuca de Soto Place', '', '21', 'Rio Grande do Sul', '2006-02-15T09:45:30', '380077794770', '26284'), - ('1692 Ede Loop', '', '30', 'So Paulo', '2006-02-15T09:45:30', '918711376618', '9223'), - ('981 Kumbakonam Place', '', '89', 'Distrito Federal', '2006-02-15T09:45:30', '829116184079', '87611'), - ('1957 Yantai Lane', '', '490', 'So Paulo', '2006-02-15T09:45:30', '704948322302', '59255'), - ('1190 0 Place', '', '44', 'Rio Grande do Sul', '2006-02-15T09:45:30', '841876514789', '10417'), - ('543 Bergamo Avenue', '', '215', 'Minas Gerais', '2006-02-15T09:45:30', '103602195112', '59686'), - ('1715 Okayama Street', '', '485', 'So Paulo', '2006-02-15T09:45:30', '169352919175', '55676'), - ('519 Nyeri Manor', '', '461', 'So Paulo', '2006-02-15T09:45:30', '764680915323', '37650'), - ('1304 s-Hertogenbosch Way', '', '83', 'Santa Catarina', '2006-02-15T09:45:30', '90336226227', '10925'), - ('1133 Rizhao Avenue', '', '572', 'Pernambuco', '2006-02-15T09:45:30', '600264533987', '2800'), - ('1891 Rizhao Boulevard', '', '456', 'So Paulo', '2006-02-15T09:45:30', '391065549876', '47288'), - ('758 Junan Lane', '', '190', 'Gois', '2006-02-15T09:45:30', '935448624185', '82639'), - ('1338 Zalantun Lane', '', '413', 'Minas Gerais', '2006-02-15T09:45:30', '840522972766', '45403'), - ('984 Effon-Alaiye Avenue', '', '183', 'Gois', '2006-02-15T09:45:30', '132986892228', '17119'), - ('829 Grand Prairie Way', '', '328', 'Paran', '2006-02-15T09:45:30', '741070712873', '6461'), - ('1666 Qomsheh Drive', '', '410', 'So Paulo', '2006-02-15T09:45:30', '582835362905', '66255'), - ('1354 Siegen Street', '', '25', 'Rio de Janeiro', '2006-02-15T09:45:30', '573441801529', '80184'), - ('1206 Dos Quebradas Place', '', '431', 'So Paulo', '2006-02-15T09:45:30', '241832790687', '20207'), - ('259 Ipoh Drive', '', '189', 'So Paulo', '2006-02-15T09:45:30', '419009857119', '64964'), - ('32 Liaocheng Way', '', '248', 'Minas Gerais', '2006-02-15T09:45:30', '410877354933', '1944'), - ('1163 London Parkway', '', '66', 'Par', '2006-02-15T09:45:30', '675120358494', '6066'), - ('686 Garland Manor', '', '247', 'Cear', '2006-02-15T09:45:30', '69493378813', '52535'), - ('306 Antofagasta Place', '', '569', 'Esprito Santo', '2006-02-15T09:45:30', '378318851631', '3989'), - ('588 Vila Velha Manor', '', '268', 'Kyongsangbuk', '2006-02-15T09:45:30', '333339908719', '51540'), - ('647 A Corua (La Corua) Street', '', '357', 'Chollanam', '2006-02-15T09:45:30', '792557457753', '36971'), - ('1942 Ciparay Parkway', '', '113', 'Cheju', '2006-02-15T09:45:30', '978987363654', '82624'), - ('193 Bhusawal Place', '', '539', 'Kang-won', '2006-02-15T09:45:30', '745267607502', '9750'), - ('300 Junan Street', '', '553', 'Kyonggi', '2006-02-15T09:45:30', '890289150158', '81314'), - ('1623 Baha Blanca Manor', '', '310', 'Moskova', '2006-02-15T09:45:30', '149981248346', '81511'), - ('954 Lapu-Lapu Way', '', '278', 'Moskova', '2006-02-15T09:45:30', '737229003916', '8816'), - ('270 Toulon Boulevard', '', '156', 'Kalmykia', '2006-02-15T09:45:30', '407752414682', '81766'), - ('1618 Olomouc Manor', '', '285', 'Kurgan', '2006-02-15T09:45:30', '96846695220', '26385'), - ('661 Chisinau Lane', '', '274', 'Pietari', '2006-02-15T09:45:30', '816436065431', '8856'), - ('1407 Surakarta Manor', '', '466', 'Moskova', '2006-02-15T09:45:30', '324346485054', '33224'), - ('46 Pjatigorsk Lane', '', '343', 'Moscow (City)', '2006-02-15T09:45:30', '262076994845', '23616'), - ('1883 Maikop Lane', '', '254', 'Kaliningrad', '2006-02-15T09:45:30', '96110042435', '68469'), - ('1077 San Felipe de Puerto Plata Place', '', '369', 'Rostov-na-Donu', '2006-02-15T09:45:30', '812824036424', '65387'), - ('1378 Beira Loop', '', '597', 'Krasnojarsk', '2006-02-15T09:45:30', '840957664136', '40792'), - ('1998 Halifax Drive', '', '308', 'Lipetsk', '2006-02-15T09:45:30', '177727722820', '76022'), - ('616 Hagonoy Avenue', '', '39', 'Krasnojarsk', '2006-02-15T09:45:30', '604177838256', '46043'), - ('1157 Nyeri Loop', '', '320', 'Adygea', '2006-02-15T09:45:30', '262744791493', '56380'), - ('1089 Iwatsuki Avenue', '', '270', 'Kirov', '2006-02-15T09:45:30', '866092335135', '35109'), - ('740 Udaipur Lane', '', '150', 'Nizni Novgorod', '2006-02-15T09:45:30', '497288595103', '33505'), - ('810 Palghat (Palakkad) Boulevard', '', '235', 'Jaroslavl', '2006-02-15T09:45:30', '516331171356', '73431'), - ('1867 San Juan Bautista Tuxtepec Avenue', '', '225', 'Ivanovo', '2006-02-15T09:45:30', '547003310357', '78311'), - ('1823 Hoshiarpur Lane', '', '510', 'Komi', '2006-02-15T09:45:30', '307133768620', '33191'), - ('909 Garland Manor', '', '367', 'Tatarstan', '2006-02-15T09:45:30', '705800322606', '69367'), - ('1697 Kowloon and New Kowloon Loop', '', '49', 'Moskova', '2006-02-15T09:45:30', '499352017190', '57807'), - ('185 Mannheim Lane', '', '408', 'Stavropol', '2006-02-15T09:45:30', '589377568313', '23661'), - ('1913 Kamakura Place', '', '238', 'Lipetsk', '2006-02-15T09:45:30', '942570536750', '97287'), - ('1621 Tongliao Avenue', '', '558', 'Irkutsk', '2006-02-15T09:45:30', '209342540247', '22173'), - ('801 Hagonoy Drive', '', '484', 'Smolensk', '2006-02-15T09:45:30', '237426099212', '8439'), - ('886 Tonghae Place', '', '259', 'Volgograd', '2006-02-15T09:45:30', '711928348157', '19450'), - ('469 Nakhon Sawan Street', '', '531', 'Tuvassia', '2006-02-15T09:45:30', '689199636560', '58866'), - ('207 Cuernavaca Loop', '', '352', 'Tatarstan', '2006-02-15T09:45:30', '782900030287', '52671'), - ('746 Joliet Lane', '', '286', 'Kursk', '2006-02-15T09:45:30', '688485191923', '94878'), - ('320 Baiyin Parkway', '', '319', 'Mahajanga', '2006-02-15T09:45:30', '223664661973', '37307'), - ('771 Yaound Manor', '', '64', 'Sofala', '2006-02-15T09:45:30', '245477603573', '86768'), - ('1599 Plock Drive', '', '534', 'Tete', '2006-02-15T09:45:30', '817248913162', '71986'), - ('596 Huixquilucan Place', '', '351', 'Nampula', '2006-02-15T09:45:30', '342709348083', '65892'), - ('532 Toulon Street', '', '460', 'Santiago', '2006-02-15T09:45:30', '46871694740', '69517'), - ('437 Chungho Drive', '', '450', 'Puerto Plata', '2006-02-15T09:45:30', '491271355190', '59489'), - ('1245 Ibirit Way', '', '290', 'La Romana', '2006-02-15T09:45:30', '331888642162', '40926'), - ('287 Cuautla Boulevard', '', '501', 'Chuquisaca', '2006-02-15T09:45:30', '82619513349', '72736'), - ('659 Gatineau Boulevard', '', '153', 'La Paz', '2006-02-15T09:45:30', '205524798287', '28587'), - ('507 Smolensk Loop', '', '492', 'Sousse', '2006-02-15T09:45:30', '80303246192', '22971'), - ('962 Tama Loop', '', '583', '', '2006-02-15T09:45:30', '282667506728', '65952'), - ('47 Syktyvkar Lane', '', '118', 'West Java', '2006-02-15T09:45:30', '63937119031', '22236'), - ('1688 Nador Lane', '', '184', 'Sulawesi Utara', '2006-02-15T09:45:30', '652218196731', '61613'), - ('1860 Taguig Loop', '', '119', 'West Java', '2006-02-15T09:45:30', '38158430589', '59550'), - ('1152 al-Qatif Lane', '', '412', 'Kalimantan Barat', '2006-02-15T09:45:30', '131370665218', '44816'), - ('1947 Paarl Way', '', '509', 'Central Java', '2006-02-15T09:45:30', '834061016202', '23636'), - ('1658 Cuman Loop', '', '396', 'Sumatera Selatan', '2006-02-15T09:45:30', '784907335610', '51309'), - ('544 Malm Parkway', '', '403', 'Central Java', '2006-02-15T09:45:30', '386759646229', '63502'), - ('154 Oshawa Manor', '', '415', 'East Java', '2006-02-15T09:45:30', '440365973660', '72771'), - ('935 Aden Boulevard', '', '532', 'Central Java', '2006-02-15T09:45:30', '335052544020', '64709'), - ('1445 Carmen Parkway', '', '117', 'West Java', '2006-02-15T09:45:30', '598912394463', '70809'), - ('1078 Stara Zagora Drive', '', '301', 'Aceh', '2006-02-15T09:45:30', '932992626595', '69221') - ) AS data(address, address2, old_city_id, district, last_update, phone, postal_code) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."city"' - AND map0.old_id = data.old_city_id - RETURNING address_id - ) - SELECT array_agg(address_id) INTO v_new_ids_address FROM inserted; - - FOR i IN 1..array_length(v_new_ids_address, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."address"', v_old_ids_address[i], v_new_ids_address[i]::TEXT); - END LOOP; - - v_old_ids_address := ARRAY['530', '157', '505']; - WITH inserted AS ( - INSERT INTO "public"."address" ("address", "address2", "city_id", "district", "last_update", "phone", "postal_code") - SELECT - data.address::character varying, - data.address2::character varying, - map0.new_id::smallint, - data.district::character varying, - data.last_update::timestamp without time zone, - data.phone::character varying, - data.postal_code::character varying - FROM (VALUES - ('1003 Qinhuangdao Street', '', '419', 'West Java', '2006-02-15T09:45:30', '35533115997', '25972'), - ('456 Escobar Way', '', '232', 'Jakarta Raya', '2006-02-15T09:45:30', '719202533520', '36061'), - ('519 Brescia Parkway', '', '318', 'East Java', '2006-02-15T09:45:30', '793996678771', '69504') - ) AS data(address, address2, old_city_id, district, last_update, phone, postal_code) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."city"' - AND map0.old_id = data.old_city_id - RETURNING address_id - ) - SELECT array_agg(address_id) INTO v_new_ids_address FROM inserted; - - FOR i IN 1..array_length(v_new_ids_address, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."address"', v_old_ids_address[i], v_new_ids_address[i]::TEXT); - END LOOP; - - -- Table: "public"."inventory" (4581 records) - v_old_ids_inventory := ARRAY['3683', '3680', '3679', '3681', '3682', '3910', '3909', '3911', '3737', '3738', '3329', '3328', '3327', '3326', '290', '287', '288', '289', '4209', '4210', '4207', '4211', '4208', '4212', '4571', '4569', '4573', '4570', '4572', '2578', '2576', '2577', '808', '810', '809', '812', '811', '813', '2988', '2989', '2987', '2990', '2991', '2986', '154', '155', '340', '341', '339', '2981', '2980', '1659', '1660', '3614', '3613', '3608', '3615', '3611', '3612', '3609', '3610', '4277', '4274', '4272', '4276', '4273', '4275', '372', '373', '159', '156', '158', '157', '1042', '1045', '1046', '1044', '1047', '1043', '3629', '3630', '3631', '1625', '1626', '3472', '3473', '3474', '2626', '2622', '2621', '2623', '2624', '2625', '2925', '2926', '2927', '2922', '2923', '2924', '2095']; - WITH inserted AS ( - INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") - SELECT - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - ('805', '2006-02-15T10:09:17', 2), - ('805', '2006-02-15T10:09:17', 1), - ('805', '2006-02-15T10:09:17', 1), - ('805', '2006-02-15T10:09:17', 2), - ('805', '2006-02-15T10:09:17', 2), - ('853', '2006-02-15T10:09:17', 1), - ('853', '2006-02-15T10:09:17', 1), - ('853', '2006-02-15T10:09:17', 1), - ('817', '2006-02-15T10:09:17', 1), - ('817', '2006-02-15T10:09:17', 1), - ('732', '2006-02-15T10:09:17', 1), - ('732', '2006-02-15T10:09:17', 1), - ('732', '2006-02-15T10:09:17', 1), - ('732', '2006-02-15T10:09:17', 1), - ('65', '2006-02-15T10:09:17', 2), - ('65', '2006-02-15T10:09:17', 2), - ('65', '2006-02-15T10:09:17', 2), - ('65', '2006-02-15T10:09:17', 2), - ('915', '2006-02-15T10:09:17', 1), - ('915', '2006-02-15T10:09:17', 1), - ('915', '2006-02-15T10:09:17', 1), - ('915', '2006-02-15T10:09:17', 2), - ('915', '2006-02-15T10:09:17', 1), - ('915', '2006-02-15T10:09:17', 2), - ('999', '2006-02-15T10:09:17', 2), - ('999', '2006-02-15T10:09:17', 1), - ('999', '2006-02-15T10:09:17', 2), - ('999', '2006-02-15T10:09:17', 1), - ('999', '2006-02-15T10:09:17', 2), - ('564', '2006-02-15T10:09:17', 2), - ('564', '2006-02-15T10:09:17', 2), - ('564', '2006-02-15T10:09:17', 2), - ('176', '2006-02-15T10:09:17', 1), - ('176', '2006-02-15T10:09:17', 2), - ('176', '2006-02-15T10:09:17', 1), - ('176', '2006-02-15T10:09:17', 2), - ('176', '2006-02-15T10:09:17', 2), - ('176', '2006-02-15T10:09:17', 2), - ('655', '2006-02-15T10:09:17', 1), - ('655', '2006-02-15T10:09:17', 2), - ('655', '2006-02-15T10:09:17', 1), - ('655', '2006-02-15T10:09:17', 2), - ('655', '2006-02-15T10:09:17', 2), - ('655', '2006-02-15T10:09:17', 1), - ('32', '2006-02-15T10:09:17', 2), - ('32', '2006-02-15T10:09:17', 2), - ('75', '2006-02-15T10:09:17', 2), - ('75', '2006-02-15T10:09:17', 2), - ('75', '2006-02-15T10:09:17', 2), - ('653', '2006-02-15T10:09:17', 1), - ('653', '2006-02-15T10:09:17', 1), - ('362', '2006-02-15T10:09:17', 1), - ('362', '2006-02-15T10:09:17', 1), - ('789', '2006-02-15T10:09:17', 2), - ('789', '2006-02-15T10:09:17', 2), - ('789', '2006-02-15T10:09:17', 1), - ('789', '2006-02-15T10:09:17', 2), - ('789', '2006-02-15T10:09:17', 1), - ('789', '2006-02-15T10:09:17', 2), - ('789', '2006-02-15T10:09:17', 1), - ('789', '2006-02-15T10:09:17', 1), - ('930', '2006-02-15T10:09:17', 2), - ('930', '2006-02-15T10:09:17', 1), - ('930', '2006-02-15T10:09:17', 1), - ('930', '2006-02-15T10:09:17', 2), - ('930', '2006-02-15T10:09:17', 1), - ('930', '2006-02-15T10:09:17', 2), - ('82', '2006-02-15T10:09:17', 1), - ('82', '2006-02-15T10:09:17', 1), - ('34', '2006-02-15T10:09:17', 2), - ('34', '2006-02-15T10:09:17', 2), - ('34', '2006-02-15T10:09:17', 2), - ('34', '2006-02-15T10:09:17', 2), - ('233', '2006-02-15T10:09:17', 1), - ('233', '2006-02-15T10:09:17', 1), - ('233', '2006-02-15T10:09:17', 2), - ('233', '2006-02-15T10:09:17', 1), - ('233', '2006-02-15T10:09:17', 2), - ('233', '2006-02-15T10:09:17', 1), - ('792', '2006-02-15T10:09:17', 2), - ('792', '2006-02-15T10:09:17', 2), - ('792', '2006-02-15T10:09:17', 2), - ('355', '2006-02-15T10:09:17', 2), - ('355', '2006-02-15T10:09:17', 2), - ('761', '2006-02-15T10:09:17', 2), - ('761', '2006-02-15T10:09:17', 2), - ('761', '2006-02-15T10:09:17', 2), - ('575', '2006-02-15T10:09:17', 2), - ('575', '2006-02-15T10:09:17', 1), - ('575', '2006-02-15T10:09:17', 1), - ('575', '2006-02-15T10:09:17', 2), - ('575', '2006-02-15T10:09:17', 2), - ('575', '2006-02-15T10:09:17', 2), - ('643', '2006-02-15T10:09:17', 2), - ('643', '2006-02-15T10:09:17', 2), - ('643', '2006-02-15T10:09:17', 2), - ('643', '2006-02-15T10:09:17', 1), - ('643', '2006-02-15T10:09:17', 1), - ('643', '2006-02-15T10:09:17', 1), - ('454', '2006-02-15T10:09:17', 1) - ) AS data(old_film_id, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."film"' - AND map0.old_id = data.old_film_id - RETURNING inventory_id - ) - SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; - - FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); - END LOOP; - - v_old_ids_inventory := ARRAY['2094', '318', '319', '316', '317', '2258', '2255', '2256', '2257', '2259', '412', '416', '417', '418', '411', '415', '413', '414', '1783', '1782', '1779', '1780', '1778', '1781', '4390', '4391', '2113', '2115', '2114', '2116', '2112', '2117', '3308', '3310', '3306', '3309', '3307', '3204', '3203', '3206', '3205', '3202', '3428', '3430', '3429', '3743', '3740', '3742', '3741', '3739', '2658', '2657', '2656', '2660', '2659', '2859', '2858', '2857', '2860', '3809', '3808', '3810', '734', '732', '731', '735', '733', '2232', '2235', '2233', '2231', '2234', '861', '862', '860', '857', '858', '859', '3757', '3758', '1120', '1119', '2948', '2947', '2951', '2949', '2946', '2950', '1019', '1022', '1016', '1021', '1017', '1018', '1020', '142', '143', '2383', '2384', '4430']; - WITH inserted AS ( - INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") - SELECT - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - ('454', '2006-02-15T10:09:17', 1), - ('71', '2006-02-15T10:09:17', 2), - ('71', '2006-02-15T10:09:17', 2), - ('71', '2006-02-15T10:09:17', 2), - ('71', '2006-02-15T10:09:17', 2), - ('488', '2006-02-15T10:09:17', 2), - ('488', '2006-02-15T10:09:17', 1), - ('488', '2006-02-15T10:09:17', 1), - ('488', '2006-02-15T10:09:17', 2), - ('488', '2006-02-15T10:09:17', 2), - ('91', '2006-02-15T10:09:17', 1), - ('91', '2006-02-15T10:09:17', 2), - ('91', '2006-02-15T10:09:17', 2), - ('91', '2006-02-15T10:09:17', 2), - ('91', '2006-02-15T10:09:17', 1), - ('91', '2006-02-15T10:09:17', 2), - ('91', '2006-02-15T10:09:17', 1), - ('91', '2006-02-15T10:09:17', 1), - ('387', '2006-02-15T10:09:17', 2), - ('387', '2006-02-15T10:09:17', 2), - ('387', '2006-02-15T10:09:17', 1), - ('387', '2006-02-15T10:09:17', 1), - ('387', '2006-02-15T10:09:17', 1), - ('387', '2006-02-15T10:09:17', 2), - ('959', '2006-02-15T10:09:17', 1), - ('959', '2006-02-15T10:09:17', 1), - ('458', '2006-02-15T10:09:17', 1), - ('458', '2006-02-15T10:09:17', 2), - ('458', '2006-02-15T10:09:17', 2), - ('458', '2006-02-15T10:09:17', 2), - ('458', '2006-02-15T10:09:17', 1), - ('458', '2006-02-15T10:09:17', 2), - ('728', '2006-02-15T10:09:17', 1), - ('728', '2006-02-15T10:09:17', 2), - ('728', '2006-02-15T10:09:17', 1), - ('728', '2006-02-15T10:09:17', 2), - ('728', '2006-02-15T10:09:17', 1), - ('704', '2006-02-15T10:09:17', 2), - ('704', '2006-02-15T10:09:17', 1), - ('704', '2006-02-15T10:09:17', 2), - ('704', '2006-02-15T10:09:17', 2), - ('704', '2006-02-15T10:09:17', 1), - ('752', '2006-02-15T10:09:17', 2), - ('752', '2006-02-15T10:09:17', 2), - ('752', '2006-02-15T10:09:17', 2), - ('818', '2006-02-15T10:09:17', 2), - ('818', '2006-02-15T10:09:17', 1), - ('818', '2006-02-15T10:09:17', 2), - ('818', '2006-02-15T10:09:17', 1), - ('818', '2006-02-15T10:09:17', 1), - ('583', '2006-02-15T10:09:17', 1), - ('583', '2006-02-15T10:09:17', 1), - ('583', '2006-02-15T10:09:17', 1), - ('583', '2006-02-15T10:09:17', 2), - ('583', '2006-02-15T10:09:17', 2), - ('626', '2006-02-15T10:09:17', 2), - ('626', '2006-02-15T10:09:17', 2), - ('626', '2006-02-15T10:09:17', 2), - ('626', '2006-02-15T10:09:17', 2), - ('834', '2006-02-15T10:09:17', 2), - ('834', '2006-02-15T10:09:17', 2), - ('834', '2006-02-15T10:09:17', 2), - ('160', '2006-02-15T10:09:17', 2), - ('160', '2006-02-15T10:09:17', 1), - ('160', '2006-02-15T10:09:17', 1), - ('160', '2006-02-15T10:09:17', 2), - ('160', '2006-02-15T10:09:17', 2), - ('483', '2006-02-15T10:09:17', 1), - ('483', '2006-02-15T10:09:17', 2), - ('483', '2006-02-15T10:09:17', 1), - ('483', '2006-02-15T10:09:17', 1), - ('483', '2006-02-15T10:09:17', 2), - ('189', '2006-02-15T10:09:17', 2), - ('189', '2006-02-15T10:09:17', 2), - ('189', '2006-02-15T10:09:17', 2), - ('189', '2006-02-15T10:09:17', 1), - ('189', '2006-02-15T10:09:17', 1), - ('189', '2006-02-15T10:09:17', 2), - ('822', '2006-02-15T10:09:17', 2), - ('822', '2006-02-15T10:09:17', 2), - ('248', '2006-02-15T10:09:17', 2), - ('248', '2006-02-15T10:09:17', 2), - ('647', '2006-02-15T10:09:17', 1), - ('647', '2006-02-15T10:09:17', 1), - ('647', '2006-02-15T10:09:17', 2), - ('647', '2006-02-15T10:09:17', 2), - ('647', '2006-02-15T10:09:17', 1), - ('647', '2006-02-15T10:09:17', 2), - ('228', '2006-02-15T10:09:17', 2), - ('228', '2006-02-15T10:09:17', 2), - ('228', '2006-02-15T10:09:17', 1), - ('228', '2006-02-15T10:09:17', 2), - ('228', '2006-02-15T10:09:17', 1), - ('228', '2006-02-15T10:09:17', 1), - ('228', '2006-02-15T10:09:17', 2), - ('29', '2006-02-15T10:09:17', 1), - ('29', '2006-02-15T10:09:17', 1), - ('520', '2006-02-15T10:09:17', 1), - ('520', '2006-02-15T10:09:17', 1), - ('969', '2006-02-15T10:09:17', 1) - ) AS data(old_film_id, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."film"' - AND map0.old_id = data.old_film_id - RETURNING inventory_id - ) - SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; - - FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); - END LOOP; - - v_old_ids_inventory := ARRAY['4431', '4433', '4432', '1886', '1887', '3447', '3446', '3441', '3442', '3443', '3445', '3444', '2306', '2308', '2304', '2305', '2307', '1113', '1116', '1118', '1115', '1114', '1117', '1112', '847', '848', '849', '850', '2985', '2984', '2982', '2983', '3514', '3513', '3936', '3938', '3937', '3935', '2340', '2342', '2341', '1611', '1610', '1612', '1613', '1812', '1813', '1814', '1815', '2730', '2729', '2732', '2731', '2733', '2411', '2410', '2412', '2413', '4484', '4482', '4480', '4481', '4478', '4483', '4479', '832', '833', '2084', '2082', '2080', '2081', '2083', '4546', '4544', '4543', '4545', '1519', '1520', '1515', '1516', '1517', '1521', '1518', '1514', '1256', '1257', '1752', '1753', '1756', '1754', '1755', '534', '535', '533', '537', '532', '536', '1902', '1900', '1903']; - WITH inserted AS ( - INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") - SELECT - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - ('969', '2006-02-15T10:09:17', 1), - ('969', '2006-02-15T10:09:17', 1), - ('969', '2006-02-15T10:09:17', 1), - ('411', '2006-02-15T10:09:17', 1), - ('411', '2006-02-15T10:09:17', 1), - ('755', '2006-02-15T10:09:17', 2), - ('755', '2006-02-15T10:09:17', 2), - ('755', '2006-02-15T10:09:17', 1), - ('755', '2006-02-15T10:09:17', 1), - ('755', '2006-02-15T10:09:17', 1), - ('755', '2006-02-15T10:09:17', 2), - ('755', '2006-02-15T10:09:17', 1), - ('501', '2006-02-15T10:09:17', 1), - ('501', '2006-02-15T10:09:17', 2), - ('501', '2006-02-15T10:09:17', 1), - ('501', '2006-02-15T10:09:17', 1), - ('501', '2006-02-15T10:09:17', 2), - ('247', '2006-02-15T10:09:17', 1), - ('247', '2006-02-15T10:09:17', 2), - ('247', '2006-02-15T10:09:17', 2), - ('247', '2006-02-15T10:09:17', 2), - ('247', '2006-02-15T10:09:17', 1), - ('247', '2006-02-15T10:09:17', 2), - ('247', '2006-02-15T10:09:17', 1), - ('186', '2006-02-15T10:09:17', 1), - ('186', '2006-02-15T10:09:17', 1), - ('186', '2006-02-15T10:09:17', 2), - ('186', '2006-02-15T10:09:17', 2), - ('654', '2006-02-15T10:09:17', 2), - ('654', '2006-02-15T10:09:17', 2), - ('654', '2006-02-15T10:09:17', 1), - ('654', '2006-02-15T10:09:17', 1), - ('769', '2006-02-15T10:09:17', 2), - ('769', '2006-02-15T10:09:17', 2), - ('858', '2006-02-15T10:09:17', 2), - ('858', '2006-02-15T10:09:17', 2), - ('858', '2006-02-15T10:09:17', 2), - ('858', '2006-02-15T10:09:17', 2), - ('509', '2006-02-15T10:09:17', 2), - ('509', '2006-02-15T10:09:17', 2), - ('509', '2006-02-15T10:09:17', 2), - ('352', '2006-02-15T10:09:17', 2), - ('352', '2006-02-15T10:09:17', 2), - ('352', '2006-02-15T10:09:17', 2), - ('352', '2006-02-15T10:09:17', 2), - ('394', '2006-02-15T10:09:17', 1), - ('394', '2006-02-15T10:09:17', 1), - ('394', '2006-02-15T10:09:17', 1), - ('394', '2006-02-15T10:09:17', 1), - ('599', '2006-02-15T10:09:17', 1), - ('599', '2006-02-15T10:09:17', 1), - ('599', '2006-02-15T10:09:17', 2), - ('599', '2006-02-15T10:09:17', 1), - ('599', '2006-02-15T10:09:17', 2), - ('526', '2006-02-15T10:09:17', 2), - ('526', '2006-02-15T10:09:17', 2), - ('526', '2006-02-15T10:09:17', 2), - ('526', '2006-02-15T10:09:17', 2), - ('979', '2006-02-15T10:09:17', 2), - ('979', '2006-02-15T10:09:17', 2), - ('979', '2006-02-15T10:09:17', 1), - ('979', '2006-02-15T10:09:17', 1), - ('979', '2006-02-15T10:09:17', 1), - ('979', '2006-02-15T10:09:17', 2), - ('979', '2006-02-15T10:09:17', 1), - ('182', '2006-02-15T10:09:17', 1), - ('182', '2006-02-15T10:09:17', 1), - ('451', '2006-02-15T10:09:17', 2), - ('451', '2006-02-15T10:09:17', 2), - ('451', '2006-02-15T10:09:17', 1), - ('451', '2006-02-15T10:09:17', 1), - ('451', '2006-02-15T10:09:17', 2), - ('992', '2006-02-15T10:09:17', 2), - ('992', '2006-02-15T10:09:17', 2), - ('992', '2006-02-15T10:09:17', 2), - ('992', '2006-02-15T10:09:17', 2), - ('331', '2006-02-15T10:09:17', 2), - ('331', '2006-02-15T10:09:17', 2), - ('331', '2006-02-15T10:09:17', 1), - ('331', '2006-02-15T10:09:17', 1), - ('331', '2006-02-15T10:09:17', 1), - ('331', '2006-02-15T10:09:17', 2), - ('331', '2006-02-15T10:09:17', 2), - ('331', '2006-02-15T10:09:17', 1), - ('278', '2006-02-15T10:09:17', 1), - ('278', '2006-02-15T10:09:17', 1), - ('381', '2006-02-15T10:09:17', 1), - ('381', '2006-02-15T10:09:17', 1), - ('381', '2006-02-15T10:09:17', 2), - ('381', '2006-02-15T10:09:17', 2), - ('381', '2006-02-15T10:09:17', 2), - ('117', '2006-02-15T10:09:17', 1), - ('117', '2006-02-15T10:09:17', 1), - ('117', '2006-02-15T10:09:17', 1), - ('117', '2006-02-15T10:09:17', 2), - ('117', '2006-02-15T10:09:17', 1), - ('117', '2006-02-15T10:09:17', 2), - ('414', '2006-02-15T10:09:17', 2), - ('414', '2006-02-15T10:09:17', 1), - ('414', '2006-02-15T10:09:17', 2) - ) AS data(old_film_id, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."film"' - AND map0.old_id = data.old_film_id - RETURNING inventory_id - ) - SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; - - FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); - END LOOP; - - v_old_ids_inventory := ARRAY['1899', '1901', '1904', '2722', '2723', '2721', '2724', '1391', '1390', '1392', '1394', '1396', '1395', '1393', '477', '479', '476', '478', '480', '303', '302', '300', '301', '2077', '2076', '2078', '2073', '2075', '2079', '2074', '3838', '3837', '3839', '3842', '3840', '3843', '3841', '2072', '2070', '2069', '2071', '2252', '2254', '2253', '36', '33', '32', '35', '34', '4078', '4077', '4079', '2110', '2106', '2111', '2108', '2107', '2109', '3832', '3831', '4111', '4113', '4112', '4109', '4110', '671', '670', '669', '2337', '2339', '2338', '2636', '2637', '2633', '2634', '2635', '2839', '2840', '2842', '2838', '2841', '3348', '3346', '3344', '3345', '3343', '3347', '3349', '899', '902', '904', '900', '903', '901', '897', '898', '3694', '3695', '1248', '1246']; - WITH inserted AS ( - INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") - SELECT - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - ('414', '2006-02-15T10:09:17', 1), - ('414', '2006-02-15T10:09:17', 1), - ('414', '2006-02-15T10:09:17', 2), - ('597', '2006-02-15T10:09:17', 2), - ('597', '2006-02-15T10:09:17', 2), - ('597', '2006-02-15T10:09:17', 2), - ('597', '2006-02-15T10:09:17', 2), - ('305', '2006-02-15T10:09:17', 1), - ('305', '2006-02-15T10:09:17', 1), - ('305', '2006-02-15T10:09:17', 1), - ('305', '2006-02-15T10:09:17', 2), - ('305', '2006-02-15T10:09:17', 2), - ('305', '2006-02-15T10:09:17', 2), - ('305', '2006-02-15T10:09:17', 1), - ('105', '2006-02-15T10:09:17', 1), - ('105', '2006-02-15T10:09:17', 2), - ('105', '2006-02-15T10:09:17', 1), - ('105', '2006-02-15T10:09:17', 2), - ('105', '2006-02-15T10:09:17', 2), - ('68', '2006-02-15T10:09:17', 2), - ('68', '2006-02-15T10:09:17', 2), - ('68', '2006-02-15T10:09:17', 1), - ('68', '2006-02-15T10:09:17', 1), - ('450', '2006-02-15T10:09:17', 2), - ('450', '2006-02-15T10:09:17', 2), - ('450', '2006-02-15T10:09:17', 2), - ('450', '2006-02-15T10:09:17', 1), - ('450', '2006-02-15T10:09:17', 1), - ('450', '2006-02-15T10:09:17', 2), - ('450', '2006-02-15T10:09:17', 1), - ('841', '2006-02-15T10:09:17', 1), - ('841', '2006-02-15T10:09:17', 1), - ('841', '2006-02-15T10:09:17', 1), - ('841', '2006-02-15T10:09:17', 2), - ('841', '2006-02-15T10:09:17', 2), - ('841', '2006-02-15T10:09:17', 2), - ('841', '2006-02-15T10:09:17', 2), - ('449', '2006-02-15T10:09:17', 2), - ('449', '2006-02-15T10:09:17', 2), - ('449', '2006-02-15T10:09:17', 2), - ('449', '2006-02-15T10:09:17', 2), - ('487', '2006-02-15T10:09:17', 2), - ('487', '2006-02-15T10:09:17', 2), - ('487', '2006-02-15T10:09:17', 2), - ('7', '2006-02-15T10:09:17', 2), - ('7', '2006-02-15T10:09:17', 1), - ('7', '2006-02-15T10:09:17', 1), - ('7', '2006-02-15T10:09:17', 2), - ('7', '2006-02-15T10:09:17', 2), - ('889', '2006-02-15T10:09:17', 1), - ('889', '2006-02-15T10:09:17', 1), - ('889', '2006-02-15T10:09:17', 1), - ('457', '2006-02-15T10:09:17', 2), - ('457', '2006-02-15T10:09:17', 1), - ('457', '2006-02-15T10:09:17', 2), - ('457', '2006-02-15T10:09:17', 2), - ('457', '2006-02-15T10:09:17', 1), - ('457', '2006-02-15T10:09:17', 2), - ('839', '2006-02-15T10:09:17', 2), - ('839', '2006-02-15T10:09:17', 2), - ('894', '2006-02-15T10:09:17', 1), - ('894', '2006-02-15T10:09:17', 2), - ('894', '2006-02-15T10:09:17', 2), - ('894', '2006-02-15T10:09:17', 1), - ('894', '2006-02-15T10:09:17', 1), - ('146', '2006-02-15T10:09:17', 1), - ('146', '2006-02-15T10:09:17', 1), - ('146', '2006-02-15T10:09:17', 1), - ('508', '2006-02-15T10:09:17', 2), - ('508', '2006-02-15T10:09:17', 2), - ('508', '2006-02-15T10:09:17', 2), - ('578', '2006-02-15T10:09:17', 2), - ('578', '2006-02-15T10:09:17', 2), - ('578', '2006-02-15T10:09:17', 1), - ('578', '2006-02-15T10:09:17', 1), - ('578', '2006-02-15T10:09:17', 2), - ('623', '2006-02-15T10:09:17', 1), - ('623', '2006-02-15T10:09:17', 2), - ('623', '2006-02-15T10:09:17', 2), - ('623', '2006-02-15T10:09:17', 1), - ('623', '2006-02-15T10:09:17', 2), - ('735', '2006-02-15T10:09:17', 2), - ('735', '2006-02-15T10:09:17', 2), - ('735', '2006-02-15T10:09:17', 1), - ('735', '2006-02-15T10:09:17', 1), - ('735', '2006-02-15T10:09:17', 1), - ('735', '2006-02-15T10:09:17', 2), - ('735', '2006-02-15T10:09:17', 2), - ('200', '2006-02-15T10:09:17', 1), - ('200', '2006-02-15T10:09:17', 2), - ('200', '2006-02-15T10:09:17', 2), - ('200', '2006-02-15T10:09:17', 1), - ('200', '2006-02-15T10:09:17', 2), - ('200', '2006-02-15T10:09:17', 2), - ('200', '2006-02-15T10:09:17', 1), - ('200', '2006-02-15T10:09:17', 1), - ('808', '2006-02-15T10:09:17', 2), - ('808', '2006-02-15T10:09:17', 2), - ('275', '2006-02-15T10:09:17', 2), - ('275', '2006-02-15T10:09:17', 1) - ) AS data(old_film_id, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."film"' - AND map0.old_id = data.old_film_id - RETURNING inventory_id - ) - SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; - - FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); - END LOOP; - - v_old_ids_inventory := ARRAY['1244', '1247', '1245', '13', '14', '15', '12', '2379', '2382', '2380', '2381', '4237', '4236', '4238', '4235', '2101', '2102', '2100', '2105', '2104', '2103', '3019', '3018', '3021', '3022', '3020', '3517', '3515', '3516', '2973', '2970', '2974', '2972', '2975', '2971', '1343', '1346', '1345', '1344', '655', '656', '657', '658', '654', '4081', '4086', '4083', '4084', '4082', '4085', '4080', '3302', '3301', '3305', '3304', '3303', '444', '443', '442', '3048', '3045', '3047', '3046', '3044', '2276', '2277', '1474', '1472', '1473', '1470', '1475', '1471', '393', '387', '391', '389', '390', '388', '392', '394', '3800', '3797', '3798', '3799', '1316', '1318', '1317', '1315', '3644', '3647', '3645', '3648', '3646', '2573', '2575', '2571', '2570', '2572', '2569', '2574']; - WITH inserted AS ( - INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") - SELECT - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - ('275', '2006-02-15T10:09:17', 1), - ('275', '2006-02-15T10:09:17', 2), - ('275', '2006-02-15T10:09:17', 1), - ('3', '2006-02-15T10:09:17', 2), - ('3', '2006-02-15T10:09:17', 2), - ('3', '2006-02-15T10:09:17', 2), - ('3', '2006-02-15T10:09:17', 2), - ('519', '2006-02-15T10:09:17', 2), - ('519', '2006-02-15T10:09:17', 2), - ('519', '2006-02-15T10:09:17', 2), - ('519', '2006-02-15T10:09:17', 2), - ('921', '2006-02-15T10:09:17', 2), - ('921', '2006-02-15T10:09:17', 1), - ('921', '2006-02-15T10:09:17', 2), - ('921', '2006-02-15T10:09:17', 1), - ('456', '2006-02-15T10:09:17', 1), - ('456', '2006-02-15T10:09:17', 2), - ('456', '2006-02-15T10:09:17', 1), - ('456', '2006-02-15T10:09:17', 2), - ('456', '2006-02-15T10:09:17', 2), - ('456', '2006-02-15T10:09:17', 2), - ('663', '2006-02-15T10:09:17', 1), - ('663', '2006-02-15T10:09:17', 1), - ('663', '2006-02-15T10:09:17', 2), - ('663', '2006-02-15T10:09:17', 2), - ('663', '2006-02-15T10:09:17', 1), - ('770', '2006-02-15T10:09:17', 2), - ('770', '2006-02-15T10:09:17', 2), - ('770', '2006-02-15T10:09:17', 2), - ('651', '2006-02-15T10:09:17', 2), - ('651', '2006-02-15T10:09:17', 1), - ('651', '2006-02-15T10:09:17', 2), - ('651', '2006-02-15T10:09:17', 2), - ('651', '2006-02-15T10:09:17', 2), - ('651', '2006-02-15T10:09:17', 1), - ('296', '2006-02-15T10:09:17', 1), - ('296', '2006-02-15T10:09:17', 1), - ('296', '2006-02-15T10:09:17', 1), - ('296', '2006-02-15T10:09:17', 1), - ('142', '2006-02-15T10:09:17', 1), - ('142', '2006-02-15T10:09:17', 1), - ('142', '2006-02-15T10:09:17', 2), - ('142', '2006-02-15T10:09:17', 2), - ('142', '2006-02-15T10:09:17', 1), - ('890', '2006-02-15T10:09:17', 1), - ('890', '2006-02-15T10:09:17', 2), - ('890', '2006-02-15T10:09:17', 2), - ('890', '2006-02-15T10:09:17', 2), - ('890', '2006-02-15T10:09:17', 1), - ('890', '2006-02-15T10:09:17', 2), - ('890', '2006-02-15T10:09:17', 1), - ('727', '2006-02-15T10:09:17', 1), - ('727', '2006-02-15T10:09:17', 1), - ('727', '2006-02-15T10:09:17', 2), - ('727', '2006-02-15T10:09:17', 2), - ('727', '2006-02-15T10:09:17', 2), - ('98', '2006-02-15T10:09:17', 1), - ('98', '2006-02-15T10:09:17', 1), - ('98', '2006-02-15T10:09:17', 1), - ('668', '2006-02-15T10:09:17', 2), - ('668', '2006-02-15T10:09:17', 1), - ('668', '2006-02-15T10:09:17', 2), - ('668', '2006-02-15T10:09:17', 2), - ('668', '2006-02-15T10:09:17', 1), - ('492', '2006-02-15T10:09:17', 1), - ('492', '2006-02-15T10:09:17', 1), - ('322', '2006-02-15T10:09:17', 2), - ('322', '2006-02-15T10:09:17', 1), - ('322', '2006-02-15T10:09:17', 1), - ('322', '2006-02-15T10:09:17', 1), - ('322', '2006-02-15T10:09:17', 2), - ('322', '2006-02-15T10:09:17', 1), - ('86', '2006-02-15T10:09:17', 2), - ('86', '2006-02-15T10:09:17', 1), - ('86', '2006-02-15T10:09:17', 2), - ('86', '2006-02-15T10:09:17', 1), - ('86', '2006-02-15T10:09:17', 1), - ('86', '2006-02-15T10:09:17', 1), - ('86', '2006-02-15T10:09:17', 2), - ('86', '2006-02-15T10:09:17', 2), - ('832', '2006-02-15T10:09:17', 1), - ('832', '2006-02-15T10:09:17', 1), - ('832', '2006-02-15T10:09:17', 1), - ('832', '2006-02-15T10:09:17', 1), - ('291', '2006-02-15T10:09:17', 1), - ('291', '2006-02-15T10:09:17', 1), - ('291', '2006-02-15T10:09:17', 1), - ('291', '2006-02-15T10:09:17', 1), - ('796', '2006-02-15T10:09:17', 1), - ('796', '2006-02-15T10:09:17', 2), - ('796', '2006-02-15T10:09:17', 1), - ('796', '2006-02-15T10:09:17', 2), - ('796', '2006-02-15T10:09:17', 2), - ('563', '2006-02-15T10:09:17', 2), - ('563', '2006-02-15T10:09:17', 2), - ('563', '2006-02-15T10:09:17', 1), - ('563', '2006-02-15T10:09:17', 1), - ('563', '2006-02-15T10:09:17', 1), - ('563', '2006-02-15T10:09:17', 1), - ('563', '2006-02-15T10:09:17', 2) - ) AS data(old_film_id, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."film"' - AND map0.old_id = data.old_film_id - RETURNING inventory_id - ) - SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; - - FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); - END LOOP; - - v_old_ids_inventory := ARRAY['1084', '1087', '1086', '1088', '1085', '3002', '3000', '3001', '3003', '893', '896', '895', '890', '889', '894', '891', '892', '3649', '3653', '3652', '3650', '3651', '3602', '3601', '3603', '640', '642', '639', '643', '638', '641', '4471', '4469', '4466', '4470', '4468', '4467', '2821', '2818', '2819', '2820', '2822', '2817', '543', '538', '541', '539', '542', '540', '4314', '4316', '4315', '1665', '1662', '1666', '1663', '1664', '1661', '2501', '2500', '2498', '2499', '3981', '3982', '3983', '4029', '4030', '4032', '4031', '3078', '3083', '3081', '3082', '3080', '3077', '3079', '79', '77', '78', '80', '1959', '1956', '1957', '1958', '4192', '4191', '4193', '4194', '4190', '4189', '2507', '2509', '2508', '2505', '2506', '2510', '3988', '3986', '3987', '3990']; - WITH inserted AS ( - INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") - SELECT - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - ('242', '2006-02-15T10:09:17', 1), - ('242', '2006-02-15T10:09:17', 2), - ('242', '2006-02-15T10:09:17', 2), - ('242', '2006-02-15T10:09:17', 2), - ('242', '2006-02-15T10:09:17', 1), - ('658', '2006-02-15T10:09:17', 2), - ('658', '2006-02-15T10:09:17', 2), - ('658', '2006-02-15T10:09:17', 2), - ('658', '2006-02-15T10:09:17', 2), - ('199', '2006-02-15T10:09:17', 2), - ('199', '2006-02-15T10:09:17', 2), - ('199', '2006-02-15T10:09:17', 2), - ('199', '2006-02-15T10:09:17', 1), - ('199', '2006-02-15T10:09:17', 1), - ('199', '2006-02-15T10:09:17', 2), - ('199', '2006-02-15T10:09:17', 1), - ('199', '2006-02-15T10:09:17', 1), - ('797', '2006-02-15T10:09:17', 1), - ('797', '2006-02-15T10:09:17', 2), - ('797', '2006-02-15T10:09:17', 2), - ('797', '2006-02-15T10:09:17', 1), - ('797', '2006-02-15T10:09:17', 2), - ('787', '2006-02-15T10:09:17', 1), - ('787', '2006-02-15T10:09:17', 1), - ('787', '2006-02-15T10:09:17', 1), - ('139', '2006-02-15T10:09:17', 1), - ('139', '2006-02-15T10:09:17', 2), - ('139', '2006-02-15T10:09:17', 1), - ('139', '2006-02-15T10:09:17', 2), - ('139', '2006-02-15T10:09:17', 1), - ('139', '2006-02-15T10:09:17', 1), - ('976', '2006-02-15T10:09:17', 2), - ('976', '2006-02-15T10:09:17', 2), - ('976', '2006-02-15T10:09:17', 1), - ('976', '2006-02-15T10:09:17', 2), - ('976', '2006-02-15T10:09:17', 2), - ('976', '2006-02-15T10:09:17', 1), - ('619', '2006-02-15T10:09:17', 2), - ('619', '2006-02-15T10:09:17', 1), - ('619', '2006-02-15T10:09:17', 2), - ('619', '2006-02-15T10:09:17', 2), - ('619', '2006-02-15T10:09:17', 2), - ('619', '2006-02-15T10:09:17', 1), - ('118', '2006-02-15T10:09:17', 2), - ('118', '2006-02-15T10:09:17', 1), - ('118', '2006-02-15T10:09:17', 1), - ('118', '2006-02-15T10:09:17', 1), - ('118', '2006-02-15T10:09:17', 2), - ('118', '2006-02-15T10:09:17', 1), - ('940', '2006-02-15T10:09:17', 1), - ('940', '2006-02-15T10:09:17', 1), - ('940', '2006-02-15T10:09:17', 1), - ('363', '2006-02-15T10:09:17', 2), - ('363', '2006-02-15T10:09:17', 1), - ('363', '2006-02-15T10:09:17', 2), - ('363', '2006-02-15T10:09:17', 1), - ('363', '2006-02-15T10:09:17', 2), - ('363', '2006-02-15T10:09:17', 1), - ('549', '2006-02-15T10:09:17', 2), - ('549', '2006-02-15T10:09:17', 2), - ('549', '2006-02-15T10:09:17', 1), - ('549', '2006-02-15T10:09:17', 1), - ('868', '2006-02-15T10:09:17', 1), - ('868', '2006-02-15T10:09:17', 1), - ('868', '2006-02-15T10:09:17', 1), - ('878', '2006-02-15T10:09:17', 2), - ('878', '2006-02-15T10:09:17', 2), - ('878', '2006-02-15T10:09:17', 2), - ('878', '2006-02-15T10:09:17', 2), - ('677', '2006-02-15T10:09:17', 1), - ('677', '2006-02-15T10:09:17', 2), - ('677', '2006-02-15T10:09:17', 2), - ('677', '2006-02-15T10:09:17', 2), - ('677', '2006-02-15T10:09:17', 2), - ('677', '2006-02-15T10:09:17', 1), - ('677', '2006-02-15T10:09:17', 1), - ('16', '2006-02-15T10:09:17', 2), - ('16', '2006-02-15T10:09:17', 1), - ('16', '2006-02-15T10:09:17', 1), - ('16', '2006-02-15T10:09:17', 2), - ('427', '2006-02-15T10:09:17', 1), - ('427', '2006-02-15T10:09:17', 1), - ('427', '2006-02-15T10:09:17', 1), - ('427', '2006-02-15T10:09:17', 1), - ('912', '2006-02-15T10:09:17', 2), - ('912', '2006-02-15T10:09:17', 1), - ('912', '2006-02-15T10:09:17', 2), - ('912', '2006-02-15T10:09:17', 2), - ('912', '2006-02-15T10:09:17', 1), - ('912', '2006-02-15T10:09:17', 1), - ('551', '2006-02-15T10:09:17', 1), - ('551', '2006-02-15T10:09:17', 2), - ('551', '2006-02-15T10:09:17', 2), - ('551', '2006-02-15T10:09:17', 1), - ('551', '2006-02-15T10:09:17', 1), - ('551', '2006-02-15T10:09:17', 2), - ('869', '2006-02-15T10:09:17', 2), - ('869', '2006-02-15T10:09:17', 1), - ('869', '2006-02-15T10:09:17', 1), - ('869', '2006-02-15T10:09:17', 2) - ) AS data(old_film_id, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."film"' - AND map0.old_id = data.old_film_id - RETURNING inventory_id - ) - SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; - - FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); - END LOOP; - - v_old_ids_inventory := ARRAY['3989', '3984', '3985', '2831', '2835', '2830', '2832', '2828', '2829', '2834', '2833', '2368', '2370', '2369', '1089', '1094', '1090', '1091', '1093', '1092', '9', '10', '11', '1668', '1669', '1667', '211', '210', '1582', '1583', '1584', '1581', '2929', '2930', '2928', '2934', '2933', '2931', '2932', '603', '605', '602', '600', '601', '604', '234', '233', '770', '765', '766', '767', '769', '768', '764', '1150', '1151', '1152', '1148', '1149', '3332', '3330', '3333', '3335', '3331', '3334', '3336', '2689', '2686', '2692', '2691', '2690', '2687', '2688', '3141', '3144', '3143', '3145', '3142', '3140', '1647', '1649', '1650', '1648', '1326', '1325', '1327', '1328', '1329', '1525', '1523', '1522', '1524', '3322', '3316', '3319', '3321', '3315', '3320', '3317', '3318']; - WITH inserted AS ( - INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") - SELECT - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - ('869', '2006-02-15T10:09:17', 2), - ('869', '2006-02-15T10:09:17', 1), - ('869', '2006-02-15T10:09:17', 1), - ('621', '2006-02-15T10:09:17', 1), - ('621', '2006-02-15T10:09:17', 2), - ('621', '2006-02-15T10:09:17', 1), - ('621', '2006-02-15T10:09:17', 2), - ('621', '2006-02-15T10:09:17', 1), - ('621', '2006-02-15T10:09:17', 1), - ('621', '2006-02-15T10:09:17', 2), - ('621', '2006-02-15T10:09:17', 2), - ('516', '2006-02-15T10:09:17', 2), - ('516', '2006-02-15T10:09:17', 2), - ('516', '2006-02-15T10:09:17', 2), - ('243', '2006-02-15T10:09:17', 1), - ('243', '2006-02-15T10:09:17', 2), - ('243', '2006-02-15T10:09:17', 1), - ('243', '2006-02-15T10:09:17', 2), - ('243', '2006-02-15T10:09:17', 2), - ('243', '2006-02-15T10:09:17', 2), - ('2', '2006-02-15T10:09:17', 2), - ('2', '2006-02-15T10:09:17', 2), - ('2', '2006-02-15T10:09:17', 2), - ('364', '2006-02-15T10:09:17', 1), - ('364', '2006-02-15T10:09:17', 1), - ('364', '2006-02-15T10:09:17', 1), - ('47', '2006-02-15T10:09:17', 2), - ('47', '2006-02-15T10:09:17', 2), - ('347', '2006-02-15T10:09:17', 1), - ('347', '2006-02-15T10:09:17', 1), - ('347', '2006-02-15T10:09:17', 1), - ('347', '2006-02-15T10:09:17', 1), - ('644', '2006-02-15T10:09:17', 1), - ('644', '2006-02-15T10:09:17', 1), - ('644', '2006-02-15T10:09:17', 1), - ('644', '2006-02-15T10:09:17', 2), - ('644', '2006-02-15T10:09:17', 2), - ('644', '2006-02-15T10:09:17', 2), - ('644', '2006-02-15T10:09:17', 2), - ('131', '2006-02-15T10:09:17', 1), - ('131', '2006-02-15T10:09:17', 2), - ('131', '2006-02-15T10:09:17', 1), - ('131', '2006-02-15T10:09:17', 1), - ('131', '2006-02-15T10:09:17', 1), - ('131', '2006-02-15T10:09:17', 2), - ('52', '2006-02-15T10:09:17', 2), - ('52', '2006-02-15T10:09:17', 2), - ('167', '2006-02-15T10:09:17', 2), - ('167', '2006-02-15T10:09:17', 1), - ('167', '2006-02-15T10:09:17', 1), - ('167', '2006-02-15T10:09:17', 1), - ('167', '2006-02-15T10:09:17', 2), - ('167', '2006-02-15T10:09:17', 2), - ('167', '2006-02-15T10:09:17', 1), - ('254', '2006-02-15T10:09:17', 2), - ('254', '2006-02-15T10:09:17', 2), - ('254', '2006-02-15T10:09:17', 2), - ('254', '2006-02-15T10:09:17', 1), - ('254', '2006-02-15T10:09:17', 1), - ('733', '2006-02-15T10:09:17', 1), - ('733', '2006-02-15T10:09:17', 1), - ('733', '2006-02-15T10:09:17', 1), - ('733', '2006-02-15T10:09:17', 2), - ('733', '2006-02-15T10:09:17', 1), - ('733', '2006-02-15T10:09:17', 2), - ('733', '2006-02-15T10:09:17', 2), - ('590', '2006-02-15T10:09:17', 2), - ('590', '2006-02-15T10:09:17', 1), - ('590', '2006-02-15T10:09:17', 2), - ('590', '2006-02-15T10:09:17', 2), - ('590', '2006-02-15T10:09:17', 2), - ('590', '2006-02-15T10:09:17', 1), - ('590', '2006-02-15T10:09:17', 1), - ('690', '2006-02-15T10:09:17', 1), - ('690', '2006-02-15T10:09:17', 2), - ('690', '2006-02-15T10:09:17', 1), - ('690', '2006-02-15T10:09:17', 2), - ('690', '2006-02-15T10:09:17', 1), - ('690', '2006-02-15T10:09:17', 1), - ('360', '2006-02-15T10:09:17', 1), - ('360', '2006-02-15T10:09:17', 1), - ('360', '2006-02-15T10:09:17', 1), - ('360', '2006-02-15T10:09:17', 1), - ('293', '2006-02-15T10:09:17', 1), - ('293', '2006-02-15T10:09:17', 1), - ('293', '2006-02-15T10:09:17', 2), - ('293', '2006-02-15T10:09:17', 2), - ('293', '2006-02-15T10:09:17', 2), - ('333', '2006-02-15T10:09:17', 2), - ('333', '2006-02-15T10:09:17', 1), - ('333', '2006-02-15T10:09:17', 1), - ('333', '2006-02-15T10:09:17', 2), - ('730', '2006-02-15T10:09:17', 2), - ('730', '2006-02-15T10:09:17', 1), - ('730', '2006-02-15T10:09:17', 2), - ('730', '2006-02-15T10:09:17', 2), - ('730', '2006-02-15T10:09:17', 1), - ('730', '2006-02-15T10:09:17', 2), - ('730', '2006-02-15T10:09:17', 1), - ('730', '2006-02-15T10:09:17', 1) - ) AS data(old_film_id, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."film"' - AND map0.old_id = data.old_film_id - RETURNING inventory_id - ) - SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; - - FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); - END LOOP; - - v_old_ids_inventory := ARRAY['1164', '1163', '1162', '616', '618', '617', '963', '968', '965', '966', '967', '964', '2598', '2599', '2601', '2603', '2602', '2600', '2128', '2129', '2132', '2133', '2130', '2131', '3747', '3749', '3751', '3748', '3750', '3752', '4099', '4094', '4100', '4098', '4096', '4095', '4097', '2916', '2918', '2921', '2920', '2915', '2917', '2919', '1487', '1486', '1489', '1490', '1485', '1488', '2783', '2779', '2781', '2782', '2780', '3129', '3128', '3126', '3125', '3124', '3123', '3127', '1848', '1846', '1843', '1845', '1844', '1847', '4399', '4395', '4397', '4398', '4396', '2181', '2184', '2178', '2182', '2183', '2180', '2179', '4401', '4400', '4402', '4403', '4490', '4491', '4495', '4493', '4492', '4494', '1641', '1643', '1646', '1644', '1645', '1640', '1639', '1642', '275', '272']; - WITH inserted AS ( - INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") - SELECT - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - ('257', '2006-02-15T10:09:17', 2), - ('257', '2006-02-15T10:09:17', 2), - ('257', '2006-02-15T10:09:17', 2), - ('134', '2006-02-15T10:09:17', 2), - ('134', '2006-02-15T10:09:17', 2), - ('134', '2006-02-15T10:09:17', 2), - ('215', '2006-02-15T10:09:17', 1), - ('215', '2006-02-15T10:09:17', 2), - ('215', '2006-02-15T10:09:17', 1), - ('215', '2006-02-15T10:09:17', 2), - ('215', '2006-02-15T10:09:17', 2), - ('215', '2006-02-15T10:09:17', 1), - ('571', '2006-02-15T10:09:17', 1), - ('571', '2006-02-15T10:09:17', 1), - ('571', '2006-02-15T10:09:17', 2), - ('571', '2006-02-15T10:09:17', 2), - ('571', '2006-02-15T10:09:17', 2), - ('571', '2006-02-15T10:09:17', 2), - ('461', '2006-02-15T10:09:17', 1), - ('461', '2006-02-15T10:09:17', 1), - ('461', '2006-02-15T10:09:17', 2), - ('461', '2006-02-15T10:09:17', 2), - ('461', '2006-02-15T10:09:17', 2), - ('461', '2006-02-15T10:09:17', 2), - ('820', '2006-02-15T10:09:17', 1), - ('820', '2006-02-15T10:09:17', 1), - ('820', '2006-02-15T10:09:17', 2), - ('820', '2006-02-15T10:09:17', 1), - ('820', '2006-02-15T10:09:17', 1), - ('820', '2006-02-15T10:09:17', 2), - ('892', '2006-02-15T10:09:17', 2), - ('892', '2006-02-15T10:09:17', 1), - ('892', '2006-02-15T10:09:17', 2), - ('892', '2006-02-15T10:09:17', 2), - ('892', '2006-02-15T10:09:17', 1), - ('892', '2006-02-15T10:09:17', 1), - ('892', '2006-02-15T10:09:17', 2), - ('641', '2006-02-15T10:09:17', 1), - ('641', '2006-02-15T10:09:17', 2), - ('641', '2006-02-15T10:09:17', 2), - ('641', '2006-02-15T10:09:17', 2), - ('641', '2006-02-15T10:09:17', 1), - ('641', '2006-02-15T10:09:17', 1), - ('641', '2006-02-15T10:09:17', 2), - ('326', '2006-02-15T10:09:17', 2), - ('326', '2006-02-15T10:09:17', 1), - ('326', '2006-02-15T10:09:17', 2), - ('326', '2006-02-15T10:09:17', 2), - ('326', '2006-02-15T10:09:17', 1), - ('326', '2006-02-15T10:09:17', 2), - ('610', '2006-02-15T10:09:17', 2), - ('610', '2006-02-15T10:09:17', 1), - ('610', '2006-02-15T10:09:17', 2), - ('610', '2006-02-15T10:09:17', 2), - ('610', '2006-02-15T10:09:17', 1), - ('687', '2006-02-15T10:09:17', 2), - ('687', '2006-02-15T10:09:17', 2), - ('687', '2006-02-15T10:09:17', 2), - ('687', '2006-02-15T10:09:17', 1), - ('687', '2006-02-15T10:09:17', 1), - ('687', '2006-02-15T10:09:17', 1), - ('687', '2006-02-15T10:09:17', 2), - ('402', '2006-02-15T10:09:17', 2), - ('402', '2006-02-15T10:09:17', 2), - ('402', '2006-02-15T10:09:17', 1), - ('402', '2006-02-15T10:09:17', 1), - ('402', '2006-02-15T10:09:17', 1), - ('402', '2006-02-15T10:09:17', 2), - ('961', '2006-02-15T10:09:17', 2), - ('961', '2006-02-15T10:09:17', 1), - ('961', '2006-02-15T10:09:17', 1), - ('961', '2006-02-15T10:09:17', 2), - ('961', '2006-02-15T10:09:17', 1), - ('471', '2006-02-15T10:09:17', 2), - ('471', '2006-02-15T10:09:17', 2), - ('471', '2006-02-15T10:09:17', 1), - ('471', '2006-02-15T10:09:17', 2), - ('471', '2006-02-15T10:09:17', 2), - ('471', '2006-02-15T10:09:17', 1), - ('471', '2006-02-15T10:09:17', 1), - ('962', '2006-02-15T10:09:17', 1), - ('962', '2006-02-15T10:09:17', 1), - ('962', '2006-02-15T10:09:17', 1), - ('962', '2006-02-15T10:09:17', 1), - ('981', '2006-02-15T10:09:17', 1), - ('981', '2006-02-15T10:09:17', 1), - ('981', '2006-02-15T10:09:17', 2), - ('981', '2006-02-15T10:09:17', 2), - ('981', '2006-02-15T10:09:17', 1), - ('981', '2006-02-15T10:09:17', 2), - ('358', '2006-02-15T10:09:17', 1), - ('358', '2006-02-15T10:09:17', 2), - ('358', '2006-02-15T10:09:17', 2), - ('358', '2006-02-15T10:09:17', 2), - ('358', '2006-02-15T10:09:17', 2), - ('358', '2006-02-15T10:09:17', 1), - ('358', '2006-02-15T10:09:17', 1), - ('358', '2006-02-15T10:09:17', 1), - ('61', '2006-02-15T10:09:17', 1), - ('61', '2006-02-15T10:09:17', 1) - ) AS data(old_film_id, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."film"' - AND map0.old_id = data.old_film_id - RETURNING inventory_id - ) - SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; - - FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); - END LOOP; - - v_old_ids_inventory := ARRAY['276', '274', '277', '273', '2844', '2845', '2849', '2846', '2848', '2847', '2843', '1897', '1898', '1896', '2935', '2938', '2936', '2937', '2939', '2940', '1750', '1748', '1747', '1749', '1751', '3763', '3762', '3760', '3764', '3759', '3765', '3761', '3512', '3508', '3511', '3510', '3509', '3507', '4073', '4076', '4075', '4074', '2322', '2319', '2323', '2321', '2320', '2324', '3766', '3767', '3769', '3768', '1976', '1978', '1977', '3452', '3455', '3451', '3454', '3453', '1133', '1135', '1132', '1134', '1131', '3706', '3702', '3703', '3700', '3704', '3701', '3705', '2394', '2395', '3120', '3122', '3119', '3121', '3433', '3434', '3432', '3438', '3431', '3437', '3435', '3436', '3793', '3791', '3792', '3790', '2899', '2898', '2897', '2896', '2900', '3479', '3483', '3481', '3480', '3482']; - WITH inserted AS ( - INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") - SELECT - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - ('61', '2006-02-15T10:09:17', 2), - ('61', '2006-02-15T10:09:17', 1), - ('61', '2006-02-15T10:09:17', 2), - ('61', '2006-02-15T10:09:17', 1), - ('624', '2006-02-15T10:09:17', 1), - ('624', '2006-02-15T10:09:17', 1), - ('624', '2006-02-15T10:09:17', 2), - ('624', '2006-02-15T10:09:17', 2), - ('624', '2006-02-15T10:09:17', 2), - ('624', '2006-02-15T10:09:17', 2), - ('624', '2006-02-15T10:09:17', 1), - ('413', '2006-02-15T10:09:17', 1), - ('413', '2006-02-15T10:09:17', 1), - ('413', '2006-02-15T10:09:17', 1), - ('645', '2006-02-15T10:09:17', 1), - ('645', '2006-02-15T10:09:17', 2), - ('645', '2006-02-15T10:09:17', 1), - ('645', '2006-02-15T10:09:17', 1), - ('645', '2006-02-15T10:09:17', 2), - ('645', '2006-02-15T10:09:17', 2), - ('380', '2006-02-15T10:09:17', 2), - ('380', '2006-02-15T10:09:17', 1), - ('380', '2006-02-15T10:09:17', 1), - ('380', '2006-02-15T10:09:17', 2), - ('380', '2006-02-15T10:09:17', 2), - ('823', '2006-02-15T10:09:17', 2), - ('823', '2006-02-15T10:09:17', 2), - ('823', '2006-02-15T10:09:17', 1), - ('823', '2006-02-15T10:09:17', 2), - ('823', '2006-02-15T10:09:17', 1), - ('823', '2006-02-15T10:09:17', 2), - ('823', '2006-02-15T10:09:17', 1), - ('768', '2006-02-15T10:09:17', 2), - ('768', '2006-02-15T10:09:17', 1), - ('768', '2006-02-15T10:09:17', 2), - ('768', '2006-02-15T10:09:17', 2), - ('768', '2006-02-15T10:09:17', 1), - ('768', '2006-02-15T10:09:17', 1), - ('888', '2006-02-15T10:09:17', 1), - ('888', '2006-02-15T10:09:17', 1), - ('888', '2006-02-15T10:09:17', 1), - ('888', '2006-02-15T10:09:17', 1), - ('504', '2006-02-15T10:09:17', 1), - ('504', '2006-02-15T10:09:17', 1), - ('504', '2006-02-15T10:09:17', 2), - ('504', '2006-02-15T10:09:17', 1), - ('504', '2006-02-15T10:09:17', 1), - ('504', '2006-02-15T10:09:17', 2), - ('824', '2006-02-15T10:09:17', 2), - ('824', '2006-02-15T10:09:17', 2), - ('824', '2006-02-15T10:09:17', 2), - ('824', '2006-02-15T10:09:17', 2), - ('431', '2006-02-15T10:09:17', 2), - ('431', '2006-02-15T10:09:17', 2), - ('431', '2006-02-15T10:09:17', 2), - ('757', '2006-02-15T10:09:17', 1), - ('757', '2006-02-15T10:09:17', 2), - ('757', '2006-02-15T10:09:17', 1), - ('757', '2006-02-15T10:09:17', 2), - ('757', '2006-02-15T10:09:17', 1), - ('251', '2006-02-15T10:09:17', 2), - ('251', '2006-02-15T10:09:17', 2), - ('251', '2006-02-15T10:09:17', 1), - ('251', '2006-02-15T10:09:17', 2), - ('251', '2006-02-15T10:09:17', 1), - ('810', '2006-02-15T10:09:17', 2), - ('810', '2006-02-15T10:09:17', 1), - ('810', '2006-02-15T10:09:17', 1), - ('810', '2006-02-15T10:09:17', 1), - ('810', '2006-02-15T10:09:17', 2), - ('810', '2006-02-15T10:09:17', 1), - ('810', '2006-02-15T10:09:17', 2), - ('523', '2006-02-15T10:09:17', 1), - ('523', '2006-02-15T10:09:17', 1), - ('686', '2006-02-15T10:09:17', 1), - ('686', '2006-02-15T10:09:17', 1), - ('686', '2006-02-15T10:09:17', 1), - ('686', '2006-02-15T10:09:17', 1), - ('753', '2006-02-15T10:09:17', 1), - ('753', '2006-02-15T10:09:17', 1), - ('753', '2006-02-15T10:09:17', 1), - ('753', '2006-02-15T10:09:17', 2), - ('753', '2006-02-15T10:09:17', 1), - ('753', '2006-02-15T10:09:17', 2), - ('753', '2006-02-15T10:09:17', 2), - ('753', '2006-02-15T10:09:17', 2), - ('830', '2006-02-15T10:09:17', 2), - ('830', '2006-02-15T10:09:17', 2), - ('830', '2006-02-15T10:09:17', 2), - ('830', '2006-02-15T10:09:17', 2), - ('637', '2006-02-15T10:09:17', 2), - ('637', '2006-02-15T10:09:17', 2), - ('637', '2006-02-15T10:09:17', 1), - ('637', '2006-02-15T10:09:17', 1), - ('637', '2006-02-15T10:09:17', 2), - ('763', '2006-02-15T10:09:17', 1), - ('763', '2006-02-15T10:09:17', 2), - ('763', '2006-02-15T10:09:17', 1), - ('763', '2006-02-15T10:09:17', 1), - ('763', '2006-02-15T10:09:17', 2) - ) AS data(old_film_id, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."film"' - AND map0.old_id = data.old_film_id - RETURNING inventory_id - ) - SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; - - FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); - END LOOP; - - v_old_ids_inventory := ARRAY['2176', '2177', '40', '37', '39', '38', '2141', '2140', '2139', '2143', '2142', '280', '281', '283', '282', '649', '653', '650', '651', '652', '2352', '2355', '2356', '2353', '2354', '2357', '2674', '2669', '2671', '2670', '2672', '2667', '2673', '2668', '2137', '2136', '2138', '2135', '2134', '314', '313', '315', '312', '3696', '3698', '3699', '3697', '944', '941', '943', '942', '3289', '3290', '3288', '3287', '3291', '3286', '1794', '1795', '1796', '2030', '2031', '2029', '1443', '1444', '3571', '3570', '3978', '3980', '3979', '3977', '2522', '2524', '2518', '2520', '2519', '2523', '2521', '3639', '3637', '3636', '3638', '4550', '4547', '4549', '4553', '4551', '4548', '4552', '782', '780', '779', '777', '781', '778', '1541', '1542', '1540', '1539', '3772']; - WITH inserted AS ( - INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") - SELECT - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - ('470', '2006-02-15T10:09:17', 1), - ('470', '2006-02-15T10:09:17', 1), - ('8', '2006-02-15T10:09:17', 2), - ('8', '2006-02-15T10:09:17', 2), - ('8', '2006-02-15T10:09:17', 2), - ('8', '2006-02-15T10:09:17', 2), - ('463', '2006-02-15T10:09:17', 1), - ('463', '2006-02-15T10:09:17', 1), - ('463', '2006-02-15T10:09:17', 1), - ('463', '2006-02-15T10:09:17', 2), - ('463', '2006-02-15T10:09:17', 2), - ('63', '2006-02-15T10:09:17', 1), - ('63', '2006-02-15T10:09:17', 1), - ('63', '2006-02-15T10:09:17', 2), - ('63', '2006-02-15T10:09:17', 2), - ('141', '2006-02-15T10:09:17', 1), - ('141', '2006-02-15T10:09:17', 2), - ('141', '2006-02-15T10:09:17', 1), - ('141', '2006-02-15T10:09:17', 1), - ('141', '2006-02-15T10:09:17', 2), - ('512', '2006-02-15T10:09:17', 1), - ('512', '2006-02-15T10:09:17', 2), - ('512', '2006-02-15T10:09:17', 2), - ('512', '2006-02-15T10:09:17', 1), - ('512', '2006-02-15T10:09:17', 2), - ('512', '2006-02-15T10:09:17', 2), - ('586', '2006-02-15T10:09:17', 2), - ('586', '2006-02-15T10:09:17', 1), - ('586', '2006-02-15T10:09:17', 2), - ('586', '2006-02-15T10:09:17', 1), - ('586', '2006-02-15T10:09:17', 2), - ('586', '2006-02-15T10:09:17', 1), - ('586', '2006-02-15T10:09:17', 2), - ('586', '2006-02-15T10:09:17', 1), - ('462', '2006-02-15T10:09:17', 2), - ('462', '2006-02-15T10:09:17', 2), - ('462', '2006-02-15T10:09:17', 2), - ('462', '2006-02-15T10:09:17', 1), - ('462', '2006-02-15T10:09:17', 1), - ('70', '2006-02-15T10:09:17', 2), - ('70', '2006-02-15T10:09:17', 1), - ('70', '2006-02-15T10:09:17', 2), - ('70', '2006-02-15T10:09:17', 1), - ('809', '2006-02-15T10:09:17', 2), - ('809', '2006-02-15T10:09:17', 2), - ('809', '2006-02-15T10:09:17', 2), - ('809', '2006-02-15T10:09:17', 2), - ('209', '2006-02-15T10:09:17', 1), - ('209', '2006-02-15T10:09:17', 1), - ('209', '2006-02-15T10:09:17', 1), - ('209', '2006-02-15T10:09:17', 1), - ('724', '2006-02-15T10:09:17', 2), - ('724', '2006-02-15T10:09:17', 2), - ('724', '2006-02-15T10:09:17', 2), - ('724', '2006-02-15T10:09:17', 1), - ('724', '2006-02-15T10:09:17', 2), - ('724', '2006-02-15T10:09:17', 1), - ('390', '2006-02-15T10:09:17', 1), - ('390', '2006-02-15T10:09:17', 1), - ('390', '2006-02-15T10:09:17', 1), - ('442', '2006-02-15T10:09:17', 1), - ('442', '2006-02-15T10:09:17', 1), - ('442', '2006-02-15T10:09:17', 1), - ('316', '2006-02-15T10:09:17', 2), - ('316', '2006-02-15T10:09:17', 2), - ('781', '2006-02-15T10:09:17', 2), - ('781', '2006-02-15T10:09:17', 2), - ('867', '2006-02-15T10:09:17', 1), - ('867', '2006-02-15T10:09:17', 1), - ('867', '2006-02-15T10:09:17', 1), - ('867', '2006-02-15T10:09:17', 1), - ('554', '2006-02-15T10:09:17', 2), - ('554', '2006-02-15T10:09:17', 2), - ('554', '2006-02-15T10:09:17', 1), - ('554', '2006-02-15T10:09:17', 1), - ('554', '2006-02-15T10:09:17', 1), - ('554', '2006-02-15T10:09:17', 2), - ('554', '2006-02-15T10:09:17', 1), - ('794', '2006-02-15T10:09:17', 2), - ('794', '2006-02-15T10:09:17', 1), - ('794', '2006-02-15T10:09:17', 1), - ('794', '2006-02-15T10:09:17', 2), - ('993', '2006-02-15T10:09:17', 1), - ('993', '2006-02-15T10:09:17', 1), - ('993', '2006-02-15T10:09:17', 1), - ('993', '2006-02-15T10:09:17', 2), - ('993', '2006-02-15T10:09:17', 2), - ('993', '2006-02-15T10:09:17', 1), - ('993', '2006-02-15T10:09:17', 2), - ('170', '2006-02-15T10:09:17', 2), - ('170', '2006-02-15T10:09:17', 2), - ('170', '2006-02-15T10:09:17', 2), - ('170', '2006-02-15T10:09:17', 1), - ('170', '2006-02-15T10:09:17', 2), - ('170', '2006-02-15T10:09:17', 1), - ('337', '2006-02-15T10:09:17', 2), - ('337', '2006-02-15T10:09:17', 2), - ('337', '2006-02-15T10:09:17', 1), - ('337', '2006-02-15T10:09:17', 1), - ('825', '2006-02-15T10:09:17', 1) - ) AS data(old_film_id, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."film"' - AND map0.old_id = data.old_film_id - RETURNING inventory_id - ) - SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; - - FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); - END LOOP; - - v_old_ids_inventory := ARRAY['3770', '3771', '2471', '2470', '4340', '4335', '4338', '4333', '4339', '4336', '4337', '4334', '3004', '3005', '1717', '1718', '1716', '1714', '1713', '1719', '1715', '2567', '2566', '2564', '2565', '2568', '2563', '431', '430', '428', '429', '432', '4248', '4247', '4246', '511', '510', '508', '509', '2166', '2167', '2168', '2171', '2165', '2169', '2172', '2170', '2438', '2440', '2439', '2441', '1431', '1432', '1430', '1428', '1429', '1433', '2582', '2581', '984', '983', '981', '982', '1003', '1005', '1004', '4460', '4459', '3188', '3187', '125', '128', '126', '124', '129', '127', '1210', '1208', '1212', '1209', '1213', '1211', '286', '284', '285', '2336', '2335', '492', '490', '491', '485', '487', '489', '486', '488', '1741', '1738', '1737', '1736', '1739']; - WITH inserted AS ( - INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") - SELECT - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - ('825', '2006-02-15T10:09:17', 1), - ('825', '2006-02-15T10:09:17', 1), - ('541', '2006-02-15T10:09:17', 2), - ('541', '2006-02-15T10:09:17', 2), - ('945', '2006-02-15T10:09:17', 2), - ('945', '2006-02-15T10:09:17', 1), - ('945', '2006-02-15T10:09:17', 2), - ('945', '2006-02-15T10:09:17', 1), - ('945', '2006-02-15T10:09:17', 2), - ('945', '2006-02-15T10:09:17', 1), - ('945', '2006-02-15T10:09:17', 2), - ('945', '2006-02-15T10:09:17', 1), - ('659', '2006-02-15T10:09:17', 2), - ('659', '2006-02-15T10:09:17', 2), - ('374', '2006-02-15T10:09:17', 2), - ('374', '2006-02-15T10:09:17', 2), - ('374', '2006-02-15T10:09:17', 2), - ('374', '2006-02-15T10:09:17', 1), - ('374', '2006-02-15T10:09:17', 1), - ('374', '2006-02-15T10:09:17', 2), - ('374', '2006-02-15T10:09:17', 1), - ('562', '2006-02-15T10:09:17', 2), - ('562', '2006-02-15T10:09:17', 1), - ('562', '2006-02-15T10:09:17', 1), - ('562', '2006-02-15T10:09:17', 1), - ('562', '2006-02-15T10:09:17', 2), - ('562', '2006-02-15T10:09:17', 1), - ('95', '2006-02-15T10:09:17', 2), - ('95', '2006-02-15T10:09:17', 2), - ('95', '2006-02-15T10:09:17', 1), - ('95', '2006-02-15T10:09:17', 1), - ('95', '2006-02-15T10:09:17', 2), - ('923', '2006-02-15T10:09:17', 2), - ('923', '2006-02-15T10:09:17', 2), - ('923', '2006-02-15T10:09:17', 2), - ('113', '2006-02-15T10:09:17', 2), - ('113', '2006-02-15T10:09:17', 2), - ('113', '2006-02-15T10:09:17', 2), - ('113', '2006-02-15T10:09:17', 2), - ('468', '2006-02-15T10:09:17', 1), - ('468', '2006-02-15T10:09:17', 1), - ('468', '2006-02-15T10:09:17', 1), - ('468', '2006-02-15T10:09:17', 2), - ('468', '2006-02-15T10:09:17', 1), - ('468', '2006-02-15T10:09:17', 2), - ('468', '2006-02-15T10:09:17', 2), - ('468', '2006-02-15T10:09:17', 2), - ('532', '2006-02-15T10:09:17', 2), - ('532', '2006-02-15T10:09:17', 2), - ('532', '2006-02-15T10:09:17', 2), - ('532', '2006-02-15T10:09:17', 2), - ('313', '2006-02-15T10:09:17', 1), - ('313', '2006-02-15T10:09:17', 2), - ('313', '2006-02-15T10:09:17', 1), - ('313', '2006-02-15T10:09:17', 1), - ('313', '2006-02-15T10:09:17', 1), - ('313', '2006-02-15T10:09:17', 2), - ('566', '2006-02-15T10:09:17', 1), - ('566', '2006-02-15T10:09:17', 1), - ('219', '2006-02-15T10:09:17', 1), - ('219', '2006-02-15T10:09:17', 1), - ('219', '2006-02-15T10:09:17', 1), - ('219', '2006-02-15T10:09:17', 1), - ('225', '2006-02-15T10:09:17', 1), - ('225', '2006-02-15T10:09:17', 1), - ('225', '2006-02-15T10:09:17', 1), - ('974', '2006-02-15T10:09:17', 1), - ('974', '2006-02-15T10:09:17', 1), - ('699', '2006-02-15T10:09:17', 1), - ('699', '2006-02-15T10:09:17', 1), - ('25', '2006-02-15T10:09:17', 1), - ('25', '2006-02-15T10:09:17', 2), - ('25', '2006-02-15T10:09:17', 1), - ('25', '2006-02-15T10:09:17', 1), - ('25', '2006-02-15T10:09:17', 2), - ('25', '2006-02-15T10:09:17', 1), - ('269', '2006-02-15T10:09:17', 2), - ('269', '2006-02-15T10:09:17', 1), - ('269', '2006-02-15T10:09:17', 2), - ('269', '2006-02-15T10:09:17', 1), - ('269', '2006-02-15T10:09:17', 2), - ('269', '2006-02-15T10:09:17', 2), - ('64', '2006-02-15T10:09:17', 2), - ('64', '2006-02-15T10:09:17', 2), - ('64', '2006-02-15T10:09:17', 2), - ('507', '2006-02-15T10:09:17', 2), - ('507', '2006-02-15T10:09:17', 2), - ('109', '2006-02-15T10:09:17', 2), - ('109', '2006-02-15T10:09:17', 2), - ('109', '2006-02-15T10:09:17', 2), - ('109', '2006-02-15T10:09:17', 1), - ('109', '2006-02-15T10:09:17', 1), - ('109', '2006-02-15T10:09:17', 2), - ('109', '2006-02-15T10:09:17', 1), - ('109', '2006-02-15T10:09:17', 1), - ('378', '2006-02-15T10:09:17', 2), - ('378', '2006-02-15T10:09:17', 1), - ('378', '2006-02-15T10:09:17', 1), - ('378', '2006-02-15T10:09:17', 1), - ('378', '2006-02-15T10:09:17', 2) - ) AS data(old_film_id, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."film"' - AND map0.old_id = data.old_film_id - RETURNING inventory_id - ) - SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; - - FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); - END LOOP; - - v_old_ids_inventory := ARRAY['1740', '1742', '1735', '4221', '4217', '4218', '4219', '4220', '3176', '3174', '3178', '3179', '3173', '3172', '3175', '3177', '636', '634', '637', '635', '633', '212', '214', '213', '215', '1187', '1186', '1053', '1054', '1051', '1049', '1048', '1050', '1052', '191', '190', '189', '193', '192', '194', '195', '1027', '1028', '519', '521', '523', '522', '524', '520', '525', '4226', '4228', '4229', '4227', '2436', '2432', '2435', '2430', '2434', '2433', '2431', '2437', '2517', '2516', '2515', '1705', '1703', '1704', '3561', '3563', '3559', '3560', '3562', '3564', '62', '61', '66', '65', '63', '64', '60', '1510', '1512', '1509', '1511', '1513', '1507', '1508', '558', '556', '555', '557', '559', '554', '409', '408', '406', '405', '407', '410']; - WITH inserted AS ( - INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") - SELECT - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - ('378', '2006-02-15T10:09:17', 2), - ('378', '2006-02-15T10:09:17', 2), - ('378', '2006-02-15T10:09:17', 1), - ('917', '2006-02-15T10:09:17', 2), - ('917', '2006-02-15T10:09:17', 1), - ('917', '2006-02-15T10:09:17', 1), - ('917', '2006-02-15T10:09:17', 1), - ('917', '2006-02-15T10:09:17', 2), - ('697', '2006-02-15T10:09:17', 2), - ('697', '2006-02-15T10:09:17', 1), - ('697', '2006-02-15T10:09:17', 2), - ('697', '2006-02-15T10:09:17', 2), - ('697', '2006-02-15T10:09:17', 1), - ('697', '2006-02-15T10:09:17', 1), - ('697', '2006-02-15T10:09:17', 1), - ('697', '2006-02-15T10:09:17', 2), - ('138', '2006-02-15T10:09:17', 2), - ('138', '2006-02-15T10:09:17', 1), - ('138', '2006-02-15T10:09:17', 2), - ('138', '2006-02-15T10:09:17', 2), - ('138', '2006-02-15T10:09:17', 1), - ('48', '2006-02-15T10:09:17', 1), - ('48', '2006-02-15T10:09:17', 2), - ('48', '2006-02-15T10:09:17', 1), - ('48', '2006-02-15T10:09:17', 2), - ('264', '2006-02-15T10:09:17', 2), - ('264', '2006-02-15T10:09:17', 2), - ('234', '2006-02-15T10:09:17', 2), - ('234', '2006-02-15T10:09:17', 2), - ('234', '2006-02-15T10:09:17', 1), - ('234', '2006-02-15T10:09:17', 1), - ('234', '2006-02-15T10:09:17', 1), - ('234', '2006-02-15T10:09:17', 1), - ('234', '2006-02-15T10:09:17', 2), - ('43', '2006-02-15T10:09:17', 1), - ('43', '2006-02-15T10:09:17', 1), - ('43', '2006-02-15T10:09:17', 1), - ('43', '2006-02-15T10:09:17', 2), - ('43', '2006-02-15T10:09:17', 2), - ('43', '2006-02-15T10:09:17', 2), - ('43', '2006-02-15T10:09:17', 2), - ('230', '2006-02-15T10:09:17', 1), - ('230', '2006-02-15T10:09:17', 1), - ('115', '2006-02-15T10:09:17', 1), - ('115', '2006-02-15T10:09:17', 1), - ('115', '2006-02-15T10:09:17', 2), - ('115', '2006-02-15T10:09:17', 2), - ('115', '2006-02-15T10:09:17', 2), - ('115', '2006-02-15T10:09:17', 1), - ('115', '2006-02-15T10:09:17', 2), - ('919', '2006-02-15T10:09:17', 1), - ('919', '2006-02-15T10:09:17', 1), - ('919', '2006-02-15T10:09:17', 1), - ('919', '2006-02-15T10:09:17', 1), - ('531', '2006-02-15T10:09:17', 2), - ('531', '2006-02-15T10:09:17', 1), - ('531', '2006-02-15T10:09:17', 2), - ('531', '2006-02-15T10:09:17', 1), - ('531', '2006-02-15T10:09:17', 2), - ('531', '2006-02-15T10:09:17', 1), - ('531', '2006-02-15T10:09:17', 1), - ('531', '2006-02-15T10:09:17', 2), - ('553', '2006-02-15T10:09:17', 2), - ('553', '2006-02-15T10:09:17', 2), - ('553', '2006-02-15T10:09:17', 2), - ('371', '2006-02-15T10:09:17', 1), - ('371', '2006-02-15T10:09:17', 1), - ('371', '2006-02-15T10:09:17', 1), - ('778', '2006-02-15T10:09:17', 1), - ('778', '2006-02-15T10:09:17', 2), - ('778', '2006-02-15T10:09:17', 1), - ('778', '2006-02-15T10:09:17', 1), - ('778', '2006-02-15T10:09:17', 1), - ('778', '2006-02-15T10:09:17', 2), - ('12', '2006-02-15T10:09:17', 1), - ('12', '2006-02-15T10:09:17', 1), - ('12', '2006-02-15T10:09:17', 2), - ('12', '2006-02-15T10:09:17', 2), - ('12', '2006-02-15T10:09:17', 2), - ('12', '2006-02-15T10:09:17', 2), - ('12', '2006-02-15T10:09:17', 1), - ('330', '2006-02-15T10:09:17', 1), - ('330', '2006-02-15T10:09:17', 2), - ('330', '2006-02-15T10:09:17', 1), - ('330', '2006-02-15T10:09:17', 2), - ('330', '2006-02-15T10:09:17', 2), - ('330', '2006-02-15T10:09:17', 1), - ('330', '2006-02-15T10:09:17', 1), - ('121', '2006-02-15T10:09:17', 2), - ('121', '2006-02-15T10:09:17', 1), - ('121', '2006-02-15T10:09:17', 1), - ('121', '2006-02-15T10:09:17', 2), - ('121', '2006-02-15T10:09:17', 2), - ('121', '2006-02-15T10:09:17', 1), - ('90', '2006-02-15T10:09:17', 2), - ('90', '2006-02-15T10:09:17', 2), - ('90', '2006-02-15T10:09:17', 1), - ('90', '2006-02-15T10:09:17', 1), - ('90', '2006-02-15T10:09:17', 1), - ('90', '2006-02-15T10:09:17', 2) - ) AS data(old_film_id, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."film"' - AND map0.old_id = data.old_film_id - RETURNING inventory_id - ) - SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; - - FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); - END LOOP; - - v_old_ids_inventory := ARRAY['3252', '3249', '3248', '3250', '3246', '3251', '3247', '798', '796', '795', '800', '797', '802', '801', '799', '4378', '4375', '4376', '4377', '4489', '4488', '4487', '4485', '4486', '721', '723', '720', '719', '722', '3969', '3970', '3974', '3973', '3972', '3971', '2422', '2421', '2420', '3870', '3872', '3866', '3871', '3873', '3867', '3869', '3868', '2363', '2364', '2365', '2361', '2360', '2362', '2892', '2891', '1711', '1708', '1712', '1709', '1710', '1936', '1937', '1938', '1939', '774', '775', '776', '773', '1038', '1041', '1039', '1040', '1037', '4259', '4260', '1834', '1836', '1833', '1835', '3439', '3440', '2774', '2778', '2771', '2777', '2772', '2773', '2775', '2776', '2763', '2760', '2764', '2759', '2761', '2762', '1673', '1672', '1670', '1671', '2416', '2419']; - WITH inserted AS ( - INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") - SELECT - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - ('715', '2006-02-15T10:09:17', 2), - ('715', '2006-02-15T10:09:17', 1), - ('715', '2006-02-15T10:09:17', 1), - ('715', '2006-02-15T10:09:17', 2), - ('715', '2006-02-15T10:09:17', 1), - ('715', '2006-02-15T10:09:17', 2), - ('715', '2006-02-15T10:09:17', 1), - ('174', '2006-02-15T10:09:17', 1), - ('174', '2006-02-15T10:09:17', 1), - ('174', '2006-02-15T10:09:17', 1), - ('174', '2006-02-15T10:09:17', 2), - ('174', '2006-02-15T10:09:17', 1), - ('174', '2006-02-15T10:09:17', 2), - ('174', '2006-02-15T10:09:17', 2), - ('174', '2006-02-15T10:09:17', 2), - ('956', '2006-02-15T10:09:17', 1), - ('956', '2006-02-15T10:09:17', 1), - ('956', '2006-02-15T10:09:17', 1), - ('956', '2006-02-15T10:09:17', 1), - ('980', '2006-02-15T10:09:17', 2), - ('980', '2006-02-15T10:09:17', 2), - ('980', '2006-02-15T10:09:17', 1), - ('980', '2006-02-15T10:09:17', 1), - ('980', '2006-02-15T10:09:17', 1), - ('158', '2006-02-15T10:09:17', 2), - ('158', '2006-02-15T10:09:17', 2), - ('158', '2006-02-15T10:09:17', 1), - ('158', '2006-02-15T10:09:17', 1), - ('158', '2006-02-15T10:09:17', 2), - ('865', '2006-02-15T10:09:17', 1), - ('865', '2006-02-15T10:09:17', 1), - ('865', '2006-02-15T10:09:17', 2), - ('865', '2006-02-15T10:09:17', 2), - ('865', '2006-02-15T10:09:17', 1), - ('865', '2006-02-15T10:09:17', 1), - ('528', '2006-02-15T10:09:17', 1), - ('528', '2006-02-15T10:09:17', 1), - ('528', '2006-02-15T10:09:17', 1), - ('846', '2006-02-15T10:09:17', 2), - ('846', '2006-02-15T10:09:17', 2), - ('846', '2006-02-15T10:09:17', 1), - ('846', '2006-02-15T10:09:17', 2), - ('846', '2006-02-15T10:09:17', 2), - ('846', '2006-02-15T10:09:17', 1), - ('846', '2006-02-15T10:09:17', 1), - ('846', '2006-02-15T10:09:17', 1), - ('514', '2006-02-15T10:09:17', 2), - ('514', '2006-02-15T10:09:17', 2), - ('514', '2006-02-15T10:09:17', 2), - ('514', '2006-02-15T10:09:17', 1), - ('514', '2006-02-15T10:09:17', 1), - ('514', '2006-02-15T10:09:17', 2), - ('635', '2006-02-15T10:09:17', 2), - ('635', '2006-02-15T10:09:17', 2), - ('373', '2006-02-15T10:09:17', 2), - ('373', '2006-02-15T10:09:17', 1), - ('373', '2006-02-15T10:09:17', 2), - ('373', '2006-02-15T10:09:17', 1), - ('373', '2006-02-15T10:09:17', 1), - ('421', '2006-02-15T10:09:17', 2), - ('421', '2006-02-15T10:09:17', 2), - ('421', '2006-02-15T10:09:17', 2), - ('421', '2006-02-15T10:09:17', 2), - ('169', '2006-02-15T10:09:17', 1), - ('169', '2006-02-15T10:09:17', 2), - ('169', '2006-02-15T10:09:17', 2), - ('169', '2006-02-15T10:09:17', 1), - ('232', '2006-02-15T10:09:17', 1), - ('232', '2006-02-15T10:09:17', 2), - ('232', '2006-02-15T10:09:17', 1), - ('232', '2006-02-15T10:09:17', 2), - ('232', '2006-02-15T10:09:17', 1), - ('926', '2006-02-15T10:09:17', 2), - ('926', '2006-02-15T10:09:17', 2), - ('398', '2006-02-15T10:09:17', 2), - ('398', '2006-02-15T10:09:17', 2), - ('398', '2006-02-15T10:09:17', 2), - ('398', '2006-02-15T10:09:17', 2), - ('754', '2006-02-15T10:09:17', 2), - ('754', '2006-02-15T10:09:17', 2), - ('609', '2006-02-15T10:09:17', 1), - ('609', '2006-02-15T10:09:17', 2), - ('609', '2006-02-15T10:09:17', 1), - ('609', '2006-02-15T10:09:17', 2), - ('609', '2006-02-15T10:09:17', 1), - ('609', '2006-02-15T10:09:17', 1), - ('609', '2006-02-15T10:09:17', 2), - ('609', '2006-02-15T10:09:17', 2), - ('606', '2006-02-15T10:09:17', 2), - ('606', '2006-02-15T10:09:17', 1), - ('606', '2006-02-15T10:09:17', 2), - ('606', '2006-02-15T10:09:17', 1), - ('606', '2006-02-15T10:09:17', 2), - ('606', '2006-02-15T10:09:17', 2), - ('365', '2006-02-15T10:09:17', 2), - ('365', '2006-02-15T10:09:17', 2), - ('365', '2006-02-15T10:09:17', 1), - ('365', '2006-02-15T10:09:17', 1), - ('527', '2006-02-15T10:09:17', 2), - ('527', '2006-02-15T10:09:17', 2) - ) AS data(old_film_id, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."film"' - AND map0.old_id = data.old_film_id - RETURNING inventory_id - ) - SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; - - FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); - END LOOP; - - v_old_ids_inventory := ARRAY['2418', '2414', '2417', '2415', '2126', '2120', '2122', '2123', '2124', '2121', '2127', '2125', '4000', '4003', '3999', '4001', '4002', '121', '120', '123', '122', '4368', '4366', '4367', '2596', '2597', '2593', '2595', '2594', '1215', '1216', '1214', '1220', '1217', '1219', '1218', '1321', '1322', '1319', '1324', '1323', '1320', '3567', '3568', '3569', '322', '325', '324', '320', '323', '321', '4313', '4310', '4311', '4312', '864', '865', '866', '863', '2791', '2790', '1279', '1280', '1278', '696', '694', '695', '697', '2209', '2210', '2208', '2212', '2211', '150', '152', '147', '153', '146', '148', '149', '151', '2041', '2039', '2046', '2043', '2040', '2042', '2044', '2045', '631', '629', '632', '630', '386', '385', '383', '384', '4332', '4329', '4330']; - WITH inserted AS ( - INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") - SELECT - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - ('527', '2006-02-15T10:09:17', 2), - ('527', '2006-02-15T10:09:17', 1), - ('527', '2006-02-15T10:09:17', 2), - ('527', '2006-02-15T10:09:17', 1), - ('460', '2006-02-15T10:09:17', 2), - ('460', '2006-02-15T10:09:17', 1), - ('460', '2006-02-15T10:09:17', 1), - ('460', '2006-02-15T10:09:17', 1), - ('460', '2006-02-15T10:09:17', 2), - ('460', '2006-02-15T10:09:17', 1), - ('460', '2006-02-15T10:09:17', 2), - ('460', '2006-02-15T10:09:17', 2), - ('871', '2006-02-15T10:09:17', 1), - ('871', '2006-02-15T10:09:17', 2), - ('871', '2006-02-15T10:09:17', 1), - ('871', '2006-02-15T10:09:17', 2), - ('871', '2006-02-15T10:09:17', 2), - ('24', '2006-02-15T10:09:17', 1), - ('24', '2006-02-15T10:09:17', 1), - ('24', '2006-02-15T10:09:17', 1), - ('24', '2006-02-15T10:09:17', 1), - ('952', '2006-02-15T10:09:17', 1), - ('952', '2006-02-15T10:09:17', 1), - ('952', '2006-02-15T10:09:17', 1), - ('570', '2006-02-15T10:09:17', 2), - ('570', '2006-02-15T10:09:17', 2), - ('570', '2006-02-15T10:09:17', 1), - ('570', '2006-02-15T10:09:17', 2), - ('570', '2006-02-15T10:09:17', 1), - ('270', '2006-02-15T10:09:17', 1), - ('270', '2006-02-15T10:09:17', 1), - ('270', '2006-02-15T10:09:17', 1), - ('270', '2006-02-15T10:09:17', 2), - ('270', '2006-02-15T10:09:17', 2), - ('270', '2006-02-15T10:09:17', 2), - ('270', '2006-02-15T10:09:17', 2), - ('292', '2006-02-15T10:09:17', 1), - ('292', '2006-02-15T10:09:17', 2), - ('292', '2006-02-15T10:09:17', 1), - ('292', '2006-02-15T10:09:17', 2), - ('292', '2006-02-15T10:09:17', 2), - ('292', '2006-02-15T10:09:17', 1), - ('780', '2006-02-15T10:09:17', 2), - ('780', '2006-02-15T10:09:17', 2), - ('780', '2006-02-15T10:09:17', 2), - ('72', '2006-02-15T10:09:17', 1), - ('72', '2006-02-15T10:09:17', 2), - ('72', '2006-02-15T10:09:17', 2), - ('72', '2006-02-15T10:09:17', 1), - ('72', '2006-02-15T10:09:17', 1), - ('72', '2006-02-15T10:09:17', 1), - ('939', '2006-02-15T10:09:17', 2), - ('939', '2006-02-15T10:09:17', 2), - ('939', '2006-02-15T10:09:17', 2), - ('939', '2006-02-15T10:09:17', 2), - ('190', '2006-02-15T10:09:17', 2), - ('190', '2006-02-15T10:09:17', 2), - ('190', '2006-02-15T10:09:17', 2), - ('190', '2006-02-15T10:09:17', 2), - ('612', '2006-02-15T10:09:17', 2), - ('612', '2006-02-15T10:09:17', 2), - ('283', '2006-02-15T10:09:17', 1), - ('283', '2006-02-15T10:09:17', 1), - ('283', '2006-02-15T10:09:17', 1), - ('152', '2006-02-15T10:09:17', 1), - ('152', '2006-02-15T10:09:17', 1), - ('152', '2006-02-15T10:09:17', 1), - ('152', '2006-02-15T10:09:17', 1), - ('478', '2006-02-15T10:09:17', 1), - ('478', '2006-02-15T10:09:17', 2), - ('478', '2006-02-15T10:09:17', 1), - ('478', '2006-02-15T10:09:17', 2), - ('478', '2006-02-15T10:09:17', 2), - ('31', '2006-02-15T10:09:17', 2), - ('31', '2006-02-15T10:09:17', 2), - ('31', '2006-02-15T10:09:17', 1), - ('31', '2006-02-15T10:09:17', 2), - ('31', '2006-02-15T10:09:17', 1), - ('31', '2006-02-15T10:09:17', 1), - ('31', '2006-02-15T10:09:17', 1), - ('31', '2006-02-15T10:09:17', 2), - ('444', '2006-02-15T10:09:17', 1), - ('444', '2006-02-15T10:09:17', 1), - ('444', '2006-02-15T10:09:17', 2), - ('444', '2006-02-15T10:09:17', 2), - ('444', '2006-02-15T10:09:17', 1), - ('444', '2006-02-15T10:09:17', 1), - ('444', '2006-02-15T10:09:17', 2), - ('444', '2006-02-15T10:09:17', 2), - ('137', '2006-02-15T10:09:17', 2), - ('137', '2006-02-15T10:09:17', 2), - ('137', '2006-02-15T10:09:17', 2), - ('137', '2006-02-15T10:09:17', 2), - ('85', '2006-02-15T10:09:17', 2), - ('85', '2006-02-15T10:09:17', 2), - ('85', '2006-02-15T10:09:17', 2), - ('85', '2006-02-15T10:09:17', 2), - ('944', '2006-02-15T10:09:17', 2), - ('944', '2006-02-15T10:09:17', 1), - ('944', '2006-02-15T10:09:17', 2) - ) AS data(old_film_id, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."film"' - AND map0.old_id = data.old_film_id - RETURNING inventory_id - ) - SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; - - FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); - END LOOP; - - v_old_ids_inventory := ARRAY['4331', '4328', '1881', '1883', '1882', '1885', '1884', '1224', '1225', '1221', '1223', '1222', '4088', '4093', '4089', '4087', '4092', '4090', '4091', '841', '844', '843', '842', '840', '924', '925', '923', '922', '936', '935', '934', '937', '3723', '3726', '3725', '3724', '3722', '3720', '3721', '1706', '1707', '999', '1000', '2588', '2587', '2590', '2589', '3354', '3356', '3359', '3358', '3357', '3355', '1399', '1397', '1398', '3669', '3666', '3670', '3671', '3668', '3667', '742', '738', '741', '744', '740', '739', '743', '3634', '3635', '3633', '3632', '4533', '4531', '4535', '4530', '4532', '4534', '2883', '2882', '2881', '369', '370', '371', '368', '298', '299', '294', '297', '296', '295', '1699', '1700', '1698', '1701', '1702', '1063', '1064', '1062']; - WITH inserted AS ( - INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") - SELECT - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - ('944', '2006-02-15T10:09:17', 2), - ('944', '2006-02-15T10:09:17', 1), - ('410', '2006-02-15T10:09:17', 1), - ('410', '2006-02-15T10:09:17', 1), - ('410', '2006-02-15T10:09:17', 1), - ('410', '2006-02-15T10:09:17', 2), - ('410', '2006-02-15T10:09:17', 2), - ('271', '2006-02-15T10:09:17', 2), - ('271', '2006-02-15T10:09:17', 2), - ('271', '2006-02-15T10:09:17', 1), - ('271', '2006-02-15T10:09:17', 1), - ('271', '2006-02-15T10:09:17', 1), - ('891', '2006-02-15T10:09:17', 1), - ('891', '2006-02-15T10:09:17', 2), - ('891', '2006-02-15T10:09:17', 1), - ('891', '2006-02-15T10:09:17', 1), - ('891', '2006-02-15T10:09:17', 2), - ('891', '2006-02-15T10:09:17', 2), - ('891', '2006-02-15T10:09:17', 2), - ('184', '2006-02-15T10:09:17', 1), - ('184', '2006-02-15T10:09:17', 2), - ('184', '2006-02-15T10:09:17', 2), - ('184', '2006-02-15T10:09:17', 2), - ('184', '2006-02-15T10:09:17', 1), - ('205', '2006-02-15T10:09:17', 1), - ('205', '2006-02-15T10:09:17', 1), - ('205', '2006-02-15T10:09:17', 1), - ('205', '2006-02-15T10:09:17', 1), - ('207', '2006-02-15T10:09:17', 1), - ('207', '2006-02-15T10:09:17', 1), - ('207', '2006-02-15T10:09:17', 1), - ('207', '2006-02-15T10:09:17', 1), - ('814', '2006-02-15T10:09:17', 2), - ('814', '2006-02-15T10:09:17', 2), - ('814', '2006-02-15T10:09:17', 2), - ('814', '2006-02-15T10:09:17', 2), - ('814', '2006-02-15T10:09:17', 1), - ('814', '2006-02-15T10:09:17', 1), - ('814', '2006-02-15T10:09:17', 1), - ('372', '2006-02-15T10:09:17', 1), - ('372', '2006-02-15T10:09:17', 1), - ('223', '2006-02-15T10:09:17', 2), - ('223', '2006-02-15T10:09:17', 2), - ('568', '2006-02-15T10:09:17', 1), - ('568', '2006-02-15T10:09:17', 1), - ('568', '2006-02-15T10:09:17', 2), - ('568', '2006-02-15T10:09:17', 2), - ('737', '2006-02-15T10:09:17', 1), - ('737', '2006-02-15T10:09:17', 2), - ('737', '2006-02-15T10:09:17', 2), - ('737', '2006-02-15T10:09:17', 2), - ('737', '2006-02-15T10:09:17', 2), - ('737', '2006-02-15T10:09:17', 1), - ('306', '2006-02-15T10:09:17', 1), - ('306', '2006-02-15T10:09:17', 1), - ('306', '2006-02-15T10:09:17', 1), - ('803', '2006-02-15T10:09:17', 1), - ('803', '2006-02-15T10:09:17', 1), - ('803', '2006-02-15T10:09:17', 2), - ('803', '2006-02-15T10:09:17', 2), - ('803', '2006-02-15T10:09:17', 1), - ('803', '2006-02-15T10:09:17', 1), - ('162', '2006-02-15T10:09:17', 2), - ('162', '2006-02-15T10:09:17', 1), - ('162', '2006-02-15T10:09:17', 2), - ('162', '2006-02-15T10:09:17', 2), - ('162', '2006-02-15T10:09:17', 1), - ('162', '2006-02-15T10:09:17', 1), - ('162', '2006-02-15T10:09:17', 2), - ('793', '2006-02-15T10:09:17', 1), - ('793', '2006-02-15T10:09:17', 1), - ('793', '2006-02-15T10:09:17', 1), - ('793', '2006-02-15T10:09:17', 1), - ('989', '2006-02-15T10:09:17', 1), - ('989', '2006-02-15T10:09:17', 1), - ('989', '2006-02-15T10:09:17', 2), - ('989', '2006-02-15T10:09:17', 1), - ('989', '2006-02-15T10:09:17', 1), - ('989', '2006-02-15T10:09:17', 2), - ('632', '2006-02-15T10:09:17', 1), - ('632', '2006-02-15T10:09:17', 1), - ('632', '2006-02-15T10:09:17', 1), - ('81', '2006-02-15T10:09:17', 1), - ('81', '2006-02-15T10:09:17', 1), - ('81', '2006-02-15T10:09:17', 1), - ('81', '2006-02-15T10:09:17', 1), - ('67', '2006-02-15T10:09:17', 2), - ('67', '2006-02-15T10:09:17', 2), - ('67', '2006-02-15T10:09:17', 1), - ('67', '2006-02-15T10:09:17', 2), - ('67', '2006-02-15T10:09:17', 2), - ('67', '2006-02-15T10:09:17', 1), - ('370', '2006-02-15T10:09:17', 1), - ('370', '2006-02-15T10:09:17', 1), - ('370', '2006-02-15T10:09:17', 1), - ('370', '2006-02-15T10:09:17', 2), - ('370', '2006-02-15T10:09:17', 2), - ('236', '2006-02-15T10:09:17', 2), - ('236', '2006-02-15T10:09:17', 2), - ('236', '2006-02-15T10:09:17', 2) - ) AS data(old_film_id, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."film"' - AND map0.old_id = data.old_film_id - RETURNING inventory_id - ) - SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; - - FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); - END LOOP; - - v_old_ids_inventory := ARRAY['1061', '675', '672', '673', '676', '677', '674', '4126', '4127', '4129', '4125', '4131', '4130', '4132', '4128', '4283', '4282', '4281', '4284', '3465', '3468', '3471', '3466', '3469', '3470', '3467', '446', '445', '447', '450', '449', '448', '2000', '2003', '2002', '2004', '2001', '2005', '481', '482', '1417', '1416', '2837', '2836', '2493', '2490', '2491', '2492', '3090', '3091', '3089', '3088', '3135', '3139', '3137', '3138', '3134', '3136', '2528', '2529', '2530', '2527', '2531', '2526', '2525', '1243', '1241', '1240', '1242', '1237', '1239', '1238', '3325', '3324', '3323', '3496', '3497', '3498', '1556', '1552', '1558', '1553', '1554', '1557', '1551', '1555', '3658', '3659', '4065', '4063', '4066', '4064', '1838', '1837', '2055', '2053', '2054', '2056', '4360', '4359']; - WITH inserted AS ( - INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") - SELECT - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - ('236', '2006-02-15T10:09:17', 2), - ('147', '2006-02-15T10:09:17', 2), - ('147', '2006-02-15T10:09:17', 1), - ('147', '2006-02-15T10:09:17', 1), - ('147', '2006-02-15T10:09:17', 2), - ('147', '2006-02-15T10:09:17', 2), - ('147', '2006-02-15T10:09:17', 1), - ('897', '2006-02-15T10:09:17', 1), - ('897', '2006-02-15T10:09:17', 1), - ('897', '2006-02-15T10:09:17', 2), - ('897', '2006-02-15T10:09:17', 1), - ('897', '2006-02-15T10:09:17', 2), - ('897', '2006-02-15T10:09:17', 2), - ('897', '2006-02-15T10:09:17', 2), - ('897', '2006-02-15T10:09:17', 1), - ('932', '2006-02-15T10:09:17', 2), - ('932', '2006-02-15T10:09:17', 1), - ('932', '2006-02-15T10:09:17', 1), - ('932', '2006-02-15T10:09:17', 2), - ('760', '2006-02-15T10:09:17', 1), - ('760', '2006-02-15T10:09:17', 2), - ('760', '2006-02-15T10:09:17', 2), - ('760', '2006-02-15T10:09:17', 1), - ('760', '2006-02-15T10:09:17', 2), - ('760', '2006-02-15T10:09:17', 2), - ('760', '2006-02-15T10:09:17', 1), - ('99', '2006-02-15T10:09:17', 1), - ('99', '2006-02-15T10:09:17', 1), - ('99', '2006-02-15T10:09:17', 1), - ('99', '2006-02-15T10:09:17', 2), - ('99', '2006-02-15T10:09:17', 2), - ('99', '2006-02-15T10:09:17', 2), - ('436', '2006-02-15T10:09:17', 1), - ('436', '2006-02-15T10:09:17', 2), - ('436', '2006-02-15T10:09:17', 1), - ('436', '2006-02-15T10:09:17', 2), - ('436', '2006-02-15T10:09:17', 1), - ('436', '2006-02-15T10:09:17', 2), - ('106', '2006-02-15T10:09:17', 1), - ('106', '2006-02-15T10:09:17', 1), - ('310', '2006-02-15T10:09:17', 1), - ('310', '2006-02-15T10:09:17', 1), - ('622', '2006-02-15T10:09:17', 2), - ('622', '2006-02-15T10:09:17', 2), - ('546', '2006-02-15T10:09:17', 2), - ('546', '2006-02-15T10:09:17', 2), - ('546', '2006-02-15T10:09:17', 2), - ('546', '2006-02-15T10:09:17', 2), - ('679', '2006-02-15T10:09:17', 2), - ('679', '2006-02-15T10:09:17', 2), - ('679', '2006-02-15T10:09:17', 1), - ('679', '2006-02-15T10:09:17', 1), - ('689', '2006-02-15T10:09:17', 1), - ('689', '2006-02-15T10:09:17', 2), - ('689', '2006-02-15T10:09:17', 1), - ('689', '2006-02-15T10:09:17', 2), - ('689', '2006-02-15T10:09:17', 1), - ('689', '2006-02-15T10:09:17', 1), - ('555', '2006-02-15T10:09:17', 2), - ('555', '2006-02-15T10:09:17', 2), - ('555', '2006-02-15T10:09:17', 2), - ('555', '2006-02-15T10:09:17', 1), - ('555', '2006-02-15T10:09:17', 2), - ('555', '2006-02-15T10:09:17', 1), - ('555', '2006-02-15T10:09:17', 1), - ('274', '2006-02-15T10:09:17', 2), - ('274', '2006-02-15T10:09:17', 2), - ('274', '2006-02-15T10:09:17', 2), - ('274', '2006-02-15T10:09:17', 2), - ('274', '2006-02-15T10:09:17', 1), - ('274', '2006-02-15T10:09:17', 1), - ('274', '2006-02-15T10:09:17', 1), - ('731', '2006-02-15T10:09:17', 2), - ('731', '2006-02-15T10:09:17', 2), - ('731', '2006-02-15T10:09:17', 2), - ('766', '2006-02-15T10:09:17', 1), - ('766', '2006-02-15T10:09:17', 1), - ('766', '2006-02-15T10:09:17', 1), - ('341', '2006-02-15T10:09:17', 2), - ('341', '2006-02-15T10:09:17', 1), - ('341', '2006-02-15T10:09:17', 2), - ('341', '2006-02-15T10:09:17', 1), - ('341', '2006-02-15T10:09:17', 1), - ('341', '2006-02-15T10:09:17', 2), - ('341', '2006-02-15T10:09:17', 1), - ('341', '2006-02-15T10:09:17', 2), - ('799', '2006-02-15T10:09:17', 1), - ('799', '2006-02-15T10:09:17', 1), - ('886', '2006-02-15T10:09:17', 1), - ('886', '2006-02-15T10:09:17', 1), - ('886', '2006-02-15T10:09:17', 1), - ('886', '2006-02-15T10:09:17', 1), - ('399', '2006-02-15T10:09:17', 2), - ('399', '2006-02-15T10:09:17', 2), - ('446', '2006-02-15T10:09:17', 2), - ('446', '2006-02-15T10:09:17', 1), - ('446', '2006-02-15T10:09:17', 1), - ('446', '2006-02-15T10:09:17', 2), - ('951', '2006-02-15T10:09:17', 1), - ('951', '2006-02-15T10:09:17', 1) - ) AS data(old_film_id, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."film"' - AND map0.old_id = data.old_film_id - RETURNING inventory_id - ) - SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; - - FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); - END LOOP; - - v_old_ids_inventory := ARRAY['4364', '4361', '4363', '4362', '4365', '4033', '4036', '4039', '4037', '4038', '4034', '4035', '1692', '1694', '1693', '1690', '1697', '1696', '1695', '1691', '2297', '2296', '2298', '2301', '2303', '2300', '2302', '2299', '3373', '3374', '3375', '3565', '3566', '1165', '1166', '1167', '1168', '2825', '2823', '2826', '2824', '2827', '245', '242', '243', '247', '246', '244', '3352', '3350', '3353', '3351', '2665', '2663', '2664', '2666', '2219', '2221', '2220', '2218', '3400', '3399', '3396', '3393', '3394', '3397', '3398', '3395', '1127', '1129', '1128', '1130', '2681', '2680', '2678', '2679', '4408', '4404', '4406', '4405', '4407', '1400', '1404', '1403', '1405', '1401', '1402', '551', '552', '553', '3857', '3856', '3855', '3858', '3337', '3340', '3342', '3338', '3341', '3339']; - WITH inserted AS ( - INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") - SELECT - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - ('951', '2006-02-15T10:09:17', 2), - ('951', '2006-02-15T10:09:17', 1), - ('951', '2006-02-15T10:09:17', 2), - ('951', '2006-02-15T10:09:17', 2), - ('951', '2006-02-15T10:09:17', 2), - ('879', '2006-02-15T10:09:17', 1), - ('879', '2006-02-15T10:09:17', 1), - ('879', '2006-02-15T10:09:17', 2), - ('879', '2006-02-15T10:09:17', 2), - ('879', '2006-02-15T10:09:17', 2), - ('879', '2006-02-15T10:09:17', 1), - ('879', '2006-02-15T10:09:17', 1), - ('369', '2006-02-15T10:09:17', 1), - ('369', '2006-02-15T10:09:17', 2), - ('369', '2006-02-15T10:09:17', 1), - ('369', '2006-02-15T10:09:17', 1), - ('369', '2006-02-15T10:09:17', 2), - ('369', '2006-02-15T10:09:17', 2), - ('369', '2006-02-15T10:09:17', 2), - ('369', '2006-02-15T10:09:17', 1), - ('500', '2006-02-15T10:09:17', 1), - ('500', '2006-02-15T10:09:17', 1), - ('500', '2006-02-15T10:09:17', 1), - ('500', '2006-02-15T10:09:17', 2), - ('500', '2006-02-15T10:09:17', 2), - ('500', '2006-02-15T10:09:17', 2), - ('500', '2006-02-15T10:09:17', 2), - ('500', '2006-02-15T10:09:17', 1), - ('740', '2006-02-15T10:09:17', 2), - ('740', '2006-02-15T10:09:17', 2), - ('740', '2006-02-15T10:09:17', 2), - ('779', '2006-02-15T10:09:17', 2), - ('779', '2006-02-15T10:09:17', 2), - ('258', '2006-02-15T10:09:17', 2), - ('258', '2006-02-15T10:09:17', 2), - ('258', '2006-02-15T10:09:17', 2), - ('258', '2006-02-15T10:09:17', 2), - ('620', '2006-02-15T10:09:17', 2), - ('620', '2006-02-15T10:09:17', 1), - ('620', '2006-02-15T10:09:17', 2), - ('620', '2006-02-15T10:09:17', 1), - ('620', '2006-02-15T10:09:17', 2), - ('55', '2006-02-15T10:09:17', 1), - ('55', '2006-02-15T10:09:17', 1), - ('55', '2006-02-15T10:09:17', 1), - ('55', '2006-02-15T10:09:17', 2), - ('55', '2006-02-15T10:09:17', 2), - ('55', '2006-02-15T10:09:17', 1), - ('736', '2006-02-15T10:09:17', 1), - ('736', '2006-02-15T10:09:17', 1), - ('736', '2006-02-15T10:09:17', 1), - ('736', '2006-02-15T10:09:17', 1), - ('585', '2006-02-15T10:09:17', 2), - ('585', '2006-02-15T10:09:17', 2), - ('585', '2006-02-15T10:09:17', 2), - ('585', '2006-02-15T10:09:17', 2), - ('480', '2006-02-15T10:09:17', 1), - ('480', '2006-02-15T10:09:17', 2), - ('480', '2006-02-15T10:09:17', 2), - ('480', '2006-02-15T10:09:17', 1), - ('745', '2006-02-15T10:09:17', 2), - ('745', '2006-02-15T10:09:17', 2), - ('745', '2006-02-15T10:09:17', 1), - ('745', '2006-02-15T10:09:17', 1), - ('745', '2006-02-15T10:09:17', 1), - ('745', '2006-02-15T10:09:17', 2), - ('745', '2006-02-15T10:09:17', 2), - ('745', '2006-02-15T10:09:17', 1), - ('250', '2006-02-15T10:09:17', 2), - ('250', '2006-02-15T10:09:17', 2), - ('250', '2006-02-15T10:09:17', 2), - ('250', '2006-02-15T10:09:17', 2), - ('588', '2006-02-15T10:09:17', 2), - ('588', '2006-02-15T10:09:17', 2), - ('588', '2006-02-15T10:09:17', 2), - ('588', '2006-02-15T10:09:17', 2), - ('963', '2006-02-15T10:09:17', 2), - ('963', '2006-02-15T10:09:17', 1), - ('963', '2006-02-15T10:09:17', 2), - ('963', '2006-02-15T10:09:17', 1), - ('963', '2006-02-15T10:09:17', 2), - ('307', '2006-02-15T10:09:17', 1), - ('307', '2006-02-15T10:09:17', 2), - ('307', '2006-02-15T10:09:17', 2), - ('307', '2006-02-15T10:09:17', 2), - ('307', '2006-02-15T10:09:17', 1), - ('307', '2006-02-15T10:09:17', 1), - ('120', '2006-02-15T10:09:17', 1), - ('120', '2006-02-15T10:09:17', 1), - ('120', '2006-02-15T10:09:17', 1), - ('844', '2006-02-15T10:09:17', 2), - ('844', '2006-02-15T10:09:17', 1), - ('844', '2006-02-15T10:09:17', 1), - ('844', '2006-02-15T10:09:17', 2), - ('734', '2006-02-15T10:09:17', 1), - ('734', '2006-02-15T10:09:17', 2), - ('734', '2006-02-15T10:09:17', 2), - ('734', '2006-02-15T10:09:17', 1), - ('734', '2006-02-15T10:09:17', 2), - ('734', '2006-02-15T10:09:17', 2) - ) AS data(old_film_id, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."film"' - AND map0.old_id = data.old_film_id - RETURNING inventory_id - ) - SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; - - FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); - END LOOP; - - v_old_ids_inventory := ARRAY['3853', '3848', '3849', '3851', '3854', '3850', '3852', '2701', '2700', '2703', '2702', '3788', '3787', '3789', '3786', '3785', '771', '772', '3595', '3600', '3598', '3594', '3597', '3596', '3599', '1550', '1549', '1535', '1537', '1534', '1536', '1538', '2351', '2347', '2350', '2349', '2348', '3712', '3714', '3710', '3715', '3711', '3713', '590', '588', '589', '591', '593', '592', '1577', '1575', '1578', '1579', '1576', '1580', '2792', '2793', '4120', '4118', '4116', '4114', '4115', '4119', '4117', '3640', '3641', '3642', '3643', '3379', '3378', '3380', '3376', '3381', '3377', '547', '544', '549', '545', '546', '550', '548', '187', '186', '188', '185', '3299', '3300', '3298', '1774', '1775', '1773', '1776', '1777', '86', '84', '85', '82', '81', '83', '3686']; - WITH inserted AS ( - INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") - SELECT - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - ('843', '2006-02-15T10:09:17', 2), - ('843', '2006-02-15T10:09:17', 1), - ('843', '2006-02-15T10:09:17', 1), - ('843', '2006-02-15T10:09:17', 1), - ('843', '2006-02-15T10:09:17', 2), - ('843', '2006-02-15T10:09:17', 1), - ('843', '2006-02-15T10:09:17', 2), - ('593', '2006-02-15T10:09:17', 2), - ('593', '2006-02-15T10:09:17', 2), - ('593', '2006-02-15T10:09:17', 2), - ('593', '2006-02-15T10:09:17', 2), - ('829', '2006-02-15T10:09:17', 2), - ('829', '2006-02-15T10:09:17', 2), - ('829', '2006-02-15T10:09:17', 2), - ('829', '2006-02-15T10:09:17', 1), - ('829', '2006-02-15T10:09:17', 1), - ('168', '2006-02-15T10:09:17', 1), - ('168', '2006-02-15T10:09:17', 1), - ('786', '2006-02-15T10:09:17', 1), - ('786', '2006-02-15T10:09:17', 2), - ('786', '2006-02-15T10:09:17', 2), - ('786', '2006-02-15T10:09:17', 1), - ('786', '2006-02-15T10:09:17', 2), - ('786', '2006-02-15T10:09:17', 1), - ('786', '2006-02-15T10:09:17', 2), - ('340', '2006-02-15T10:09:17', 1), - ('340', '2006-02-15T10:09:17', 1), - ('336', '2006-02-15T10:09:17', 1), - ('336', '2006-02-15T10:09:17', 2), - ('336', '2006-02-15T10:09:17', 1), - ('336', '2006-02-15T10:09:17', 1), - ('336', '2006-02-15T10:09:17', 2), - ('511', '2006-02-15T10:09:17', 2), - ('511', '2006-02-15T10:09:17', 1), - ('511', '2006-02-15T10:09:17', 2), - ('511', '2006-02-15T10:09:17', 2), - ('511', '2006-02-15T10:09:17', 1), - ('812', '2006-02-15T10:09:17', 1), - ('812', '2006-02-15T10:09:17', 2), - ('812', '2006-02-15T10:09:17', 1), - ('812', '2006-02-15T10:09:17', 2), - ('812', '2006-02-15T10:09:17', 1), - ('812', '2006-02-15T10:09:17', 2), - ('129', '2006-02-15T10:09:17', 1), - ('129', '2006-02-15T10:09:17', 1), - ('129', '2006-02-15T10:09:17', 1), - ('129', '2006-02-15T10:09:17', 2), - ('129', '2006-02-15T10:09:17', 2), - ('129', '2006-02-15T10:09:17', 2), - ('346', '2006-02-15T10:09:17', 2), - ('346', '2006-02-15T10:09:17', 1), - ('346', '2006-02-15T10:09:17', 2), - ('346', '2006-02-15T10:09:17', 2), - ('346', '2006-02-15T10:09:17', 1), - ('346', '2006-02-15T10:09:17', 2), - ('613', '2006-02-15T10:09:17', 1), - ('613', '2006-02-15T10:09:17', 1), - ('895', '2006-02-15T10:09:17', 2), - ('895', '2006-02-15T10:09:17', 2), - ('895', '2006-02-15T10:09:17', 1), - ('895', '2006-02-15T10:09:17', 1), - ('895', '2006-02-15T10:09:17', 1), - ('895', '2006-02-15T10:09:17', 2), - ('895', '2006-02-15T10:09:17', 1), - ('795', '2006-02-15T10:09:17', 1), - ('795', '2006-02-15T10:09:17', 1), - ('795', '2006-02-15T10:09:17', 1), - ('795', '2006-02-15T10:09:17', 1), - ('741', '2006-02-15T10:09:17', 1), - ('741', '2006-02-15T10:09:17', 1), - ('741', '2006-02-15T10:09:17', 2), - ('741', '2006-02-15T10:09:17', 1), - ('741', '2006-02-15T10:09:17', 2), - ('741', '2006-02-15T10:09:17', 1), - ('119', '2006-02-15T10:09:17', 2), - ('119', '2006-02-15T10:09:17', 1), - ('119', '2006-02-15T10:09:17', 2), - ('119', '2006-02-15T10:09:17', 1), - ('119', '2006-02-15T10:09:17', 1), - ('119', '2006-02-15T10:09:17', 2), - ('119', '2006-02-15T10:09:17', 2), - ('42', '2006-02-15T10:09:17', 2), - ('42', '2006-02-15T10:09:17', 2), - ('42', '2006-02-15T10:09:17', 2), - ('42', '2006-02-15T10:09:17', 2), - ('726', '2006-02-15T10:09:17', 2), - ('726', '2006-02-15T10:09:17', 2), - ('726', '2006-02-15T10:09:17', 2), - ('385', '2006-02-15T10:09:17', 1), - ('385', '2006-02-15T10:09:17', 2), - ('385', '2006-02-15T10:09:17', 1), - ('385', '2006-02-15T10:09:17', 2), - ('385', '2006-02-15T10:09:17', 2), - ('17', '2006-02-15T10:09:17', 2), - ('17', '2006-02-15T10:09:17', 2), - ('17', '2006-02-15T10:09:17', 2), - ('17', '2006-02-15T10:09:17', 1), - ('17', '2006-02-15T10:09:17', 1), - ('17', '2006-02-15T10:09:17', 1), - ('806', '2006-02-15T10:09:17', 1) - ) AS data(old_film_id, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."film"' - AND map0.old_id = data.old_film_id - RETURNING inventory_id - ) - SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; - - FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); - END LOOP; - - v_old_ids_inventory := ARRAY['3684', '3688', '3685', '3687', '3057', '3060', '3058', '3056', '3059', '3061', '1563', '1564', '1075', '1069', '1072', '1076', '1071', '1073', '1070', '1074', '2147', '2148', '2144', '2146', '2149', '2150', '2145', '133', '132', '130', '131', '134', '4528', '4529', '4525', '4527', '4526', '3052', '3049', '3054', '3055', '3050', '3053', '3051', '2770', '2767', '2765', '2766', '2769', '2768', '2400', '2398', '2397', '2399', '2401', '2396', '951', '952', '954', '950', '953', '3745', '3744', '3746', '1409', '1407', '1408', '1406', '401', '400', '402', '403', '399', '404', '119', '115', '116', '118', '117', '1174', '1171', '1173', '1172', '499', '498', '500', '497', '4288', '4289', '4290', '3387', '3384', '3385', '3383', '3386', '3382', '2749', '2748', '2751', '2750']; - WITH inserted AS ( - INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") - SELECT - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - ('806', '2006-02-15T10:09:17', 1), - ('806', '2006-02-15T10:09:17', 2), - ('806', '2006-02-15T10:09:17', 1), - ('806', '2006-02-15T10:09:17', 2), - ('672', '2006-02-15T10:09:17', 1), - ('672', '2006-02-15T10:09:17', 2), - ('672', '2006-02-15T10:09:17', 2), - ('672', '2006-02-15T10:09:17', 1), - ('672', '2006-02-15T10:09:17', 2), - ('672', '2006-02-15T10:09:17', 2), - ('343', '2006-02-15T10:09:17', 1), - ('343', '2006-02-15T10:09:17', 1), - ('239', '2006-02-15T10:09:17', 2), - ('239', '2006-02-15T10:09:17', 1), - ('239', '2006-02-15T10:09:17', 1), - ('239', '2006-02-15T10:09:17', 2), - ('239', '2006-02-15T10:09:17', 1), - ('239', '2006-02-15T10:09:17', 2), - ('239', '2006-02-15T10:09:17', 1), - ('239', '2006-02-15T10:09:17', 2), - ('464', '2006-02-15T10:09:17', 1), - ('464', '2006-02-15T10:09:17', 2), - ('464', '2006-02-15T10:09:17', 1), - ('464', '2006-02-15T10:09:17', 1), - ('464', '2006-02-15T10:09:17', 2), - ('464', '2006-02-15T10:09:17', 2), - ('464', '2006-02-15T10:09:17', 1), - ('26', '2006-02-15T10:09:17', 2), - ('26', '2006-02-15T10:09:17', 2), - ('26', '2006-02-15T10:09:17', 1), - ('26', '2006-02-15T10:09:17', 1), - ('26', '2006-02-15T10:09:17', 2), - ('988', '2006-02-15T10:09:17', 2), - ('988', '2006-02-15T10:09:17', 2), - ('988', '2006-02-15T10:09:17', 1), - ('988', '2006-02-15T10:09:17', 1), - ('988', '2006-02-15T10:09:17', 1), - ('670', '2006-02-15T10:09:17', 1), - ('670', '2006-02-15T10:09:17', 1), - ('670', '2006-02-15T10:09:17', 2), - ('670', '2006-02-15T10:09:17', 2), - ('670', '2006-02-15T10:09:17', 1), - ('670', '2006-02-15T10:09:17', 2), - ('670', '2006-02-15T10:09:17', 1), - ('608', '2006-02-15T10:09:17', 2), - ('608', '2006-02-15T10:09:17', 2), - ('608', '2006-02-15T10:09:17', 1), - ('608', '2006-02-15T10:09:17', 1), - ('608', '2006-02-15T10:09:17', 2), - ('608', '2006-02-15T10:09:17', 2), - ('524', '2006-02-15T10:09:17', 2), - ('524', '2006-02-15T10:09:17', 2), - ('524', '2006-02-15T10:09:17', 1), - ('524', '2006-02-15T10:09:17', 2), - ('524', '2006-02-15T10:09:17', 2), - ('524', '2006-02-15T10:09:17', 1), - ('212', '2006-02-15T10:09:17', 1), - ('212', '2006-02-15T10:09:17', 1), - ('212', '2006-02-15T10:09:17', 2), - ('212', '2006-02-15T10:09:17', 1), - ('212', '2006-02-15T10:09:17', 2), - ('819', '2006-02-15T10:09:17', 1), - ('819', '2006-02-15T10:09:17', 1), - ('819', '2006-02-15T10:09:17', 1), - ('308', '2006-02-15T10:09:17', 2), - ('308', '2006-02-15T10:09:17', 1), - ('308', '2006-02-15T10:09:17', 2), - ('308', '2006-02-15T10:09:17', 1), - ('89', '2006-02-15T10:09:17', 1), - ('89', '2006-02-15T10:09:17', 1), - ('89', '2006-02-15T10:09:17', 2), - ('89', '2006-02-15T10:09:17', 2), - ('89', '2006-02-15T10:09:17', 1), - ('89', '2006-02-15T10:09:17', 2), - ('23', '2006-02-15T10:09:17', 2), - ('23', '2006-02-15T10:09:17', 1), - ('23', '2006-02-15T10:09:17', 1), - ('23', '2006-02-15T10:09:17', 2), - ('23', '2006-02-15T10:09:17', 1), - ('260', '2006-02-15T10:09:17', 2), - ('260', '2006-02-15T10:09:17', 2), - ('260', '2006-02-15T10:09:17', 2), - ('260', '2006-02-15T10:09:17', 2), - ('111', '2006-02-15T10:09:17', 2), - ('111', '2006-02-15T10:09:17', 2), - ('111', '2006-02-15T10:09:17', 2), - ('111', '2006-02-15T10:09:17', 2), - ('934', '2006-02-15T10:09:17', 2), - ('934', '2006-02-15T10:09:17', 2), - ('934', '2006-02-15T10:09:17', 2), - ('743', '2006-02-15T10:09:17', 2), - ('743', '2006-02-15T10:09:17', 2), - ('743', '2006-02-15T10:09:17', 2), - ('743', '2006-02-15T10:09:17', 1), - ('743', '2006-02-15T10:09:17', 2), - ('743', '2006-02-15T10:09:17', 1), - ('603', '2006-02-15T10:09:17', 1), - ('603', '2006-02-15T10:09:17', 1), - ('603', '2006-02-15T10:09:17', 1), - ('603', '2006-02-15T10:09:17', 1) - ) AS data(old_film_id, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."film"' - AND map0.old_id = data.old_film_id - RETURNING inventory_id - ) - SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; - - FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); - END LOOP; - - v_old_ids_inventory := ARRAY['2753', '2752', '3774', '3773', '2189', '2187', '2191', '2188', '2190', '2478', '2479', '908', '907', '905', '906', '1596', '1602', '1603', '1599', '1600', '1598', '1601', '1597', '628', '626', '627', '3184', '3186', '3185', '3183', '3181', '3182', '3180', '4164', '4165', '4163', '4456', '4458', '4454', '4455', '4453', '4451', '4452', '4457', '1176', '1175', '814', '816', '815', '2796', '2798', '2794', '2797', '2799', '2795', '4300', '4301', '4299', '4302', '4303', '4392', '4394', '4393', '4011', '4014', '4009', '4010', '4007', '4008', '4013', '4012', '2960', '2961', '2962', '2958', '2963', '2959', '3040', '3043', '3041', '3042', '219', '216', '220', '218', '217', '221', '993', '997', '996', '995', '994', '998', '3200', '3201', '1228', '1229', '1226', '1227', '4015']; - WITH inserted AS ( - INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") - SELECT - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - ('603', '2006-02-15T10:09:17', 2), - ('603', '2006-02-15T10:09:17', 2), - ('826', '2006-02-15T10:09:17', 2), - ('826', '2006-02-15T10:09:17', 2), - ('473', '2006-02-15T10:09:17', 2), - ('473', '2006-02-15T10:09:17', 1), - ('473', '2006-02-15T10:09:17', 2), - ('473', '2006-02-15T10:09:17', 1), - ('473', '2006-02-15T10:09:17', 2), - ('543', '2006-02-15T10:09:17', 1), - ('543', '2006-02-15T10:09:17', 1), - ('201', '2006-02-15T10:09:17', 1), - ('201', '2006-02-15T10:09:17', 1), - ('201', '2006-02-15T10:09:17', 1), - ('201', '2006-02-15T10:09:17', 1), - ('350', '2006-02-15T10:09:17', 1), - ('350', '2006-02-15T10:09:17', 2), - ('350', '2006-02-15T10:09:17', 2), - ('350', '2006-02-15T10:09:17', 1), - ('350', '2006-02-15T10:09:17', 2), - ('350', '2006-02-15T10:09:17', 1), - ('350', '2006-02-15T10:09:17', 2), - ('350', '2006-02-15T10:09:17', 1), - ('136', '2006-02-15T10:09:17', 1), - ('136', '2006-02-15T10:09:17', 1), - ('136', '2006-02-15T10:09:17', 1), - ('698', '2006-02-15T10:09:17', 2), - ('698', '2006-02-15T10:09:17', 2), - ('698', '2006-02-15T10:09:17', 2), - ('698', '2006-02-15T10:09:17', 1), - ('698', '2006-02-15T10:09:17', 1), - ('698', '2006-02-15T10:09:17', 1), - ('698', '2006-02-15T10:09:17', 1), - ('905', '2006-02-15T10:09:17', 1), - ('905', '2006-02-15T10:09:17', 1), - ('905', '2006-02-15T10:09:17', 1), - ('973', '2006-02-15T10:09:17', 2), - ('973', '2006-02-15T10:09:17', 2), - ('973', '2006-02-15T10:09:17', 1), - ('973', '2006-02-15T10:09:17', 2), - ('973', '2006-02-15T10:09:17', 1), - ('973', '2006-02-15T10:09:17', 1), - ('973', '2006-02-15T10:09:17', 1), - ('973', '2006-02-15T10:09:17', 2), - ('261', '2006-02-15T10:09:17', 1), - ('261', '2006-02-15T10:09:17', 1), - ('177', '2006-02-15T10:09:17', 2), - ('177', '2006-02-15T10:09:17', 2), - ('177', '2006-02-15T10:09:17', 2), - ('614', '2006-02-15T10:09:17', 1), - ('614', '2006-02-15T10:09:17', 2), - ('614', '2006-02-15T10:09:17', 1), - ('614', '2006-02-15T10:09:17', 2), - ('614', '2006-02-15T10:09:17', 2), - ('614', '2006-02-15T10:09:17', 1), - ('937', '2006-02-15T10:09:17', 1), - ('937', '2006-02-15T10:09:17', 2), - ('937', '2006-02-15T10:09:17', 1), - ('937', '2006-02-15T10:09:17', 2), - ('937', '2006-02-15T10:09:17', 2), - ('960', '2006-02-15T10:09:17', 2), - ('960', '2006-02-15T10:09:17', 2), - ('960', '2006-02-15T10:09:17', 2), - ('873', '2006-02-15T10:09:17', 2), - ('873', '2006-02-15T10:09:17', 2), - ('873', '2006-02-15T10:09:17', 1), - ('873', '2006-02-15T10:09:17', 1), - ('873', '2006-02-15T10:09:17', 1), - ('873', '2006-02-15T10:09:17', 1), - ('873', '2006-02-15T10:09:17', 2), - ('873', '2006-02-15T10:09:17', 2), - ('649', '2006-02-15T10:09:17', 2), - ('649', '2006-02-15T10:09:17', 2), - ('649', '2006-02-15T10:09:17', 2), - ('649', '2006-02-15T10:09:17', 1), - ('649', '2006-02-15T10:09:17', 2), - ('649', '2006-02-15T10:09:17', 1), - ('667', '2006-02-15T10:09:17', 1), - ('667', '2006-02-15T10:09:17', 2), - ('667', '2006-02-15T10:09:17', 1), - ('667', '2006-02-15T10:09:17', 2), - ('49', '2006-02-15T10:09:17', 2), - ('49', '2006-02-15T10:09:17', 1), - ('49', '2006-02-15T10:09:17', 2), - ('49', '2006-02-15T10:09:17', 1), - ('49', '2006-02-15T10:09:17', 1), - ('49', '2006-02-15T10:09:17', 2), - ('222', '2006-02-15T10:09:17', 1), - ('222', '2006-02-15T10:09:17', 2), - ('222', '2006-02-15T10:09:17', 2), - ('222', '2006-02-15T10:09:17', 2), - ('222', '2006-02-15T10:09:17', 1), - ('222', '2006-02-15T10:09:17', 2), - ('703', '2006-02-15T10:09:17', 2), - ('703', '2006-02-15T10:09:17', 2), - ('272', '2006-02-15T10:09:17', 1), - ('272', '2006-02-15T10:09:17', 1), - ('272', '2006-02-15T10:09:17', 1), - ('272', '2006-02-15T10:09:17', 1), - ('875', '2006-02-15T10:09:17', 1) - ) AS data(old_film_id, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."film"' - AND map0.old_id = data.old_film_id - RETURNING inventory_id - ) - SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; - - FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); - END LOOP; - - v_old_ids_inventory := ARRAY['4019', '4020', '4016', '4021', '4018', '4017', '3859', '3862', '3865', '3864', '3861', '3863', '3860', '1627', '1631', '1634', '1630', '1629', '1632', '1628', '1633', '757', '754', '753', '756', '755', '1785', '1788', '1789', '1786', '1787', '1784', '4352', '4350', '4348', '4351', '4349', '4347', '709', '713', '711', '710', '712', '526', '528', '531', '529', '530', '527', '1908', '1907', '1906', '1905', '1910', '1909', '90', '91', '89', '88', '87', '92', '1002', '1001', '2850', '2851', '2853', '2856', '2852', '2855', '2854', '309', '305', '304', '307', '308', '310', '306', '311', '1658', '1651', '1653', '1654', '1655', '1656', '1652', '1657', '2885', '2884', '2886', '4474', '4473', '4472', '4068', '4069', '4072', '4070', '4071', '4067', '949', '948']; - WITH inserted AS ( - INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") - SELECT - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - ('875', '2006-02-15T10:09:17', 2), - ('875', '2006-02-15T10:09:17', 2), - ('875', '2006-02-15T10:09:17', 1), - ('875', '2006-02-15T10:09:17', 2), - ('875', '2006-02-15T10:09:17', 2), - ('875', '2006-02-15T10:09:17', 1), - ('845', '2006-02-15T10:09:17', 1), - ('845', '2006-02-15T10:09:17', 1), - ('845', '2006-02-15T10:09:17', 2), - ('845', '2006-02-15T10:09:17', 2), - ('845', '2006-02-15T10:09:17', 1), - ('845', '2006-02-15T10:09:17', 2), - ('845', '2006-02-15T10:09:17', 1), - ('356', '2006-02-15T10:09:17', 1), - ('356', '2006-02-15T10:09:17', 2), - ('356', '2006-02-15T10:09:17', 2), - ('356', '2006-02-15T10:09:17', 1), - ('356', '2006-02-15T10:09:17', 1), - ('356', '2006-02-15T10:09:17', 2), - ('356', '2006-02-15T10:09:17', 1), - ('356', '2006-02-15T10:09:17', 2), - ('165', '2006-02-15T10:09:17', 2), - ('165', '2006-02-15T10:09:17', 1), - ('165', '2006-02-15T10:09:17', 1), - ('165', '2006-02-15T10:09:17', 2), - ('165', '2006-02-15T10:09:17', 1), - ('388', '2006-02-15T10:09:17', 1), - ('388', '2006-02-15T10:09:17', 2), - ('388', '2006-02-15T10:09:17', 2), - ('388', '2006-02-15T10:09:17', 1), - ('388', '2006-02-15T10:09:17', 2), - ('388', '2006-02-15T10:09:17', 1), - ('948', '2006-02-15T10:09:17', 2), - ('948', '2006-02-15T10:09:17', 2), - ('948', '2006-02-15T10:09:17', 1), - ('948', '2006-02-15T10:09:17', 2), - ('948', '2006-02-15T10:09:17', 2), - ('948', '2006-02-15T10:09:17', 1), - ('155', '2006-02-15T10:09:17', 1), - ('155', '2006-02-15T10:09:17', 2), - ('155', '2006-02-15T10:09:17', 2), - ('155', '2006-02-15T10:09:17', 1), - ('155', '2006-02-15T10:09:17', 2), - ('116', '2006-02-15T10:09:17', 1), - ('116', '2006-02-15T10:09:17', 2), - ('116', '2006-02-15T10:09:17', 2), - ('116', '2006-02-15T10:09:17', 2), - ('116', '2006-02-15T10:09:17', 2), - ('116', '2006-02-15T10:09:17', 1), - ('415', '2006-02-15T10:09:17', 2), - ('415', '2006-02-15T10:09:17', 1), - ('415', '2006-02-15T10:09:17', 1), - ('415', '2006-02-15T10:09:17', 1), - ('415', '2006-02-15T10:09:17', 2), - ('415', '2006-02-15T10:09:17', 2), - ('18', '2006-02-15T10:09:17', 2), - ('18', '2006-02-15T10:09:17', 2), - ('18', '2006-02-15T10:09:17', 1), - ('18', '2006-02-15T10:09:17', 1), - ('18', '2006-02-15T10:09:17', 1), - ('18', '2006-02-15T10:09:17', 2), - ('224', '2006-02-15T10:09:17', 1), - ('224', '2006-02-15T10:09:17', 1), - ('625', '2006-02-15T10:09:17', 1), - ('625', '2006-02-15T10:09:17', 1), - ('625', '2006-02-15T10:09:17', 2), - ('625', '2006-02-15T10:09:17', 2), - ('625', '2006-02-15T10:09:17', 1), - ('625', '2006-02-15T10:09:17', 2), - ('625', '2006-02-15T10:09:17', 2), - ('69', '2006-02-15T10:09:17', 2), - ('69', '2006-02-15T10:09:17', 1), - ('69', '2006-02-15T10:09:17', 1), - ('69', '2006-02-15T10:09:17', 1), - ('69', '2006-02-15T10:09:17', 2), - ('69', '2006-02-15T10:09:17', 2), - ('69', '2006-02-15T10:09:17', 1), - ('69', '2006-02-15T10:09:17', 2), - ('361', '2006-02-15T10:09:17', 2), - ('361', '2006-02-15T10:09:17', 1), - ('361', '2006-02-15T10:09:17', 1), - ('361', '2006-02-15T10:09:17', 1), - ('361', '2006-02-15T10:09:17', 2), - ('361', '2006-02-15T10:09:17', 2), - ('361', '2006-02-15T10:09:17', 1), - ('361', '2006-02-15T10:09:17', 2), - ('633', '2006-02-15T10:09:17', 2), - ('633', '2006-02-15T10:09:17', 2), - ('633', '2006-02-15T10:09:17', 2), - ('977', '2006-02-15T10:09:17', 2), - ('977', '2006-02-15T10:09:17', 2), - ('977', '2006-02-15T10:09:17', 2), - ('887', '2006-02-15T10:09:17', 1), - ('887', '2006-02-15T10:09:17', 1), - ('887', '2006-02-15T10:09:17', 2), - ('887', '2006-02-15T10:09:17', 1), - ('887', '2006-02-15T10:09:17', 2), - ('887', '2006-02-15T10:09:17', 1), - ('211', '2006-02-15T10:09:17', 1), - ('211', '2006-02-15T10:09:17', 1) - ) AS data(old_film_id, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."film"' - AND map0.old_id = data.old_film_id - RETURNING inventory_id - ) - SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; - - FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); - END LOOP; - - v_old_ids_inventory := ARRAY['2325', '2327', '2328', '2326', '2445', '2447', '2448', '2449', '2446', '45', '42', '41', '44', '43', '1437', '1435', '1439', '1434', '1438', '1436', '3655', '3657', '3654', '3656', '2371', '2372', '4121', '4124', '4122', '4123', '1529', '1530', '1527', '1531', '1528', '1526', '2035', '2036', '2033', '2037', '2038', '2034', '2032', '1284', '1281', '1283', '1282', '1285', '1286', '1287', '577', '579', '578', '2156', '2157', '441', '436', '440', '437', '438', '439', '483', '484', '4146', '4148', '4145', '4151', '4150', '4147', '4149', '3889', '3892', '3893', '3890', '3894', '3895', '3891', '4501', '4496', '4498', '4502', '4500', '4499', '4497', '3756', '3754', '3755', '3753', '2903', '2905', '2907', '2908', '2902', '2904', '2901', '2906', '2654', '2655', '3719', '3718']; - WITH inserted AS ( - INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") - SELECT - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - ('505', '2006-02-15T10:09:17', 2), - ('505', '2006-02-15T10:09:17', 2), - ('505', '2006-02-15T10:09:17', 2), - ('505', '2006-02-15T10:09:17', 2), - ('534', '2006-02-15T10:09:17', 1), - ('534', '2006-02-15T10:09:17', 2), - ('534', '2006-02-15T10:09:17', 2), - ('534', '2006-02-15T10:09:17', 2), - ('534', '2006-02-15T10:09:17', 1), - ('9', '2006-02-15T10:09:17', 2), - ('9', '2006-02-15T10:09:17', 1), - ('9', '2006-02-15T10:09:17', 1), - ('9', '2006-02-15T10:09:17', 2), - ('9', '2006-02-15T10:09:17', 1), - ('314', '2006-02-15T10:09:17', 2), - ('314', '2006-02-15T10:09:17', 1), - ('314', '2006-02-15T10:09:17', 2), - ('314', '2006-02-15T10:09:17', 1), - ('314', '2006-02-15T10:09:17', 2), - ('314', '2006-02-15T10:09:17', 2), - ('798', '2006-02-15T10:09:17', 1), - ('798', '2006-02-15T10:09:17', 2), - ('798', '2006-02-15T10:09:17', 1), - ('798', '2006-02-15T10:09:17', 2), - ('517', '2006-02-15T10:09:17', 2), - ('517', '2006-02-15T10:09:17', 2), - ('896', '2006-02-15T10:09:17', 1), - ('896', '2006-02-15T10:09:17', 2), - ('896', '2006-02-15T10:09:17', 1), - ('896', '2006-02-15T10:09:17', 2), - ('334', '2006-02-15T10:09:17', 2), - ('334', '2006-02-15T10:09:17', 2), - ('334', '2006-02-15T10:09:17', 1), - ('334', '2006-02-15T10:09:17', 2), - ('334', '2006-02-15T10:09:17', 2), - ('334', '2006-02-15T10:09:17', 1), - ('443', '2006-02-15T10:09:17', 2), - ('443', '2006-02-15T10:09:17', 2), - ('443', '2006-02-15T10:09:17', 1), - ('443', '2006-02-15T10:09:17', 2), - ('443', '2006-02-15T10:09:17', 2), - ('443', '2006-02-15T10:09:17', 1), - ('443', '2006-02-15T10:09:17', 1), - ('284', '2006-02-15T10:09:17', 2), - ('284', '2006-02-15T10:09:17', 1), - ('284', '2006-02-15T10:09:17', 1), - ('284', '2006-02-15T10:09:17', 1), - ('284', '2006-02-15T10:09:17', 2), - ('284', '2006-02-15T10:09:17', 2), - ('284', '2006-02-15T10:09:17', 2), - ('126', '2006-02-15T10:09:17', 2), - ('126', '2006-02-15T10:09:17', 2), - ('126', '2006-02-15T10:09:17', 2), - ('466', '2006-02-15T10:09:17', 1), - ('466', '2006-02-15T10:09:17', 1), - ('97', '2006-02-15T10:09:17', 2), - ('97', '2006-02-15T10:09:17', 1), - ('97', '2006-02-15T10:09:17', 2), - ('97', '2006-02-15T10:09:17', 1), - ('97', '2006-02-15T10:09:17', 1), - ('97', '2006-02-15T10:09:17', 1), - ('107', '2006-02-15T10:09:17', 2), - ('107', '2006-02-15T10:09:17', 2), - ('901', '2006-02-15T10:09:17', 1), - ('901', '2006-02-15T10:09:17', 1), - ('901', '2006-02-15T10:09:17', 1), - ('901', '2006-02-15T10:09:17', 2), - ('901', '2006-02-15T10:09:17', 2), - ('901', '2006-02-15T10:09:17', 1), - ('901', '2006-02-15T10:09:17', 2), - ('850', '2006-02-15T10:09:17', 1), - ('850', '2006-02-15T10:09:17', 2), - ('850', '2006-02-15T10:09:17', 2), - ('850', '2006-02-15T10:09:17', 1), - ('850', '2006-02-15T10:09:17', 2), - ('850', '2006-02-15T10:09:17', 2), - ('850', '2006-02-15T10:09:17', 1), - ('982', '2006-02-15T10:09:17', 2), - ('982', '2006-02-15T10:09:17', 1), - ('982', '2006-02-15T10:09:17', 1), - ('982', '2006-02-15T10:09:17', 2), - ('982', '2006-02-15T10:09:17', 2), - ('982', '2006-02-15T10:09:17', 2), - ('982', '2006-02-15T10:09:17', 1), - ('821', '2006-02-15T10:09:17', 2), - ('821', '2006-02-15T10:09:17', 2), - ('821', '2006-02-15T10:09:17', 2), - ('821', '2006-02-15T10:09:17', 2), - ('638', '2006-02-15T10:09:17', 1), - ('638', '2006-02-15T10:09:17', 2), - ('638', '2006-02-15T10:09:17', 2), - ('638', '2006-02-15T10:09:17', 2), - ('638', '2006-02-15T10:09:17', 1), - ('638', '2006-02-15T10:09:17', 1), - ('638', '2006-02-15T10:09:17', 1), - ('638', '2006-02-15T10:09:17', 2), - ('582', '2006-02-15T10:09:17', 2), - ('582', '2006-02-15T10:09:17', 2), - ('813', '2006-02-15T10:09:17', 2), - ('813', '2006-02-15T10:09:17', 2) - ) AS data(old_film_id, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."film"' - AND map0.old_id = data.old_film_id - RETURNING inventory_id - ) - SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; - - FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); - END LOOP; - - v_old_ids_inventory := ARRAY['3716', '3717', '3032', '3034', '3031', '3033', '3028', '3030', '3029', '3013', '3011', '3010', '3012', '1932', '1935', '1931', '1933', '1934', '2451', '2453', '2450', '2452', '4022', '4023', '1999', '1998', '3151', '3153', '3152', '2539', '2541', '2543', '2540', '2542', '1025', '1026', '1024', '1023', '2726', '2728', '2727', '2725', '2086', '2085', '2088', '2087', '4559', '4561', '4560', '4558', '4562', '4557', '3520', '3522', '3519', '3521', '3523', '3524', '3518', '3996', '3995', '3998', '3992', '3994', '3993', '3991', '3997', '1058', '1057', '1055', '1056', '1059', '1060', '2952', '2953', '2956', '2957', '2954', '2955', '1314', '1313', '1312', '2274', '2275', '2271', '2270', '2273', '2272', '1638', '1637', '1636', '1635', '3530', '3528', '3527', '3529', '3525', '3526', '96', '93']; - WITH inserted AS ( - INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") - SELECT - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - ('813', '2006-02-15T10:09:17', 2), - ('813', '2006-02-15T10:09:17', 2), - ('665', '2006-02-15T10:09:17', 2), - ('665', '2006-02-15T10:09:17', 2), - ('665', '2006-02-15T10:09:17', 1), - ('665', '2006-02-15T10:09:17', 2), - ('665', '2006-02-15T10:09:17', 1), - ('665', '2006-02-15T10:09:17', 1), - ('665', '2006-02-15T10:09:17', 1), - ('661', '2006-02-15T10:09:17', 1), - ('661', '2006-02-15T10:09:17', 1), - ('661', '2006-02-15T10:09:17', 1), - ('661', '2006-02-15T10:09:17', 1), - ('420', '2006-02-15T10:09:17', 1), - ('420', '2006-02-15T10:09:17', 2), - ('420', '2006-02-15T10:09:17', 1), - ('420', '2006-02-15T10:09:17', 2), - ('420', '2006-02-15T10:09:17', 2), - ('535', '2006-02-15T10:09:17', 1), - ('535', '2006-02-15T10:09:17', 1), - ('535', '2006-02-15T10:09:17', 1), - ('535', '2006-02-15T10:09:17', 1), - ('876', '2006-02-15T10:09:17', 1), - ('876', '2006-02-15T10:09:17', 1), - ('435', '2006-02-15T10:09:17', 1), - ('435', '2006-02-15T10:09:17', 1), - ('692', '2006-02-15T10:09:17', 2), - ('692', '2006-02-15T10:09:17', 2), - ('692', '2006-02-15T10:09:17', 2), - ('557', '2006-02-15T10:09:17', 1), - ('557', '2006-02-15T10:09:17', 2), - ('557', '2006-02-15T10:09:17', 2), - ('557', '2006-02-15T10:09:17', 1), - ('557', '2006-02-15T10:09:17', 2), - ('229', '2006-02-15T10:09:17', 2), - ('229', '2006-02-15T10:09:17', 2), - ('229', '2006-02-15T10:09:17', 1), - ('229', '2006-02-15T10:09:17', 1), - ('598', '2006-02-15T10:09:17', 1), - ('598', '2006-02-15T10:09:17', 1), - ('598', '2006-02-15T10:09:17', 1), - ('598', '2006-02-15T10:09:17', 1), - ('452', '2006-02-15T10:09:17', 2), - ('452', '2006-02-15T10:09:17', 2), - ('452', '2006-02-15T10:09:17', 2), - ('452', '2006-02-15T10:09:17', 2), - ('995', '2006-02-15T10:09:17', 1), - ('995', '2006-02-15T10:09:17', 2), - ('995', '2006-02-15T10:09:17', 1), - ('995', '2006-02-15T10:09:17', 1), - ('995', '2006-02-15T10:09:17', 2), - ('995', '2006-02-15T10:09:17', 1), - ('771', '2006-02-15T10:09:17', 1), - ('771', '2006-02-15T10:09:17', 2), - ('771', '2006-02-15T10:09:17', 1), - ('771', '2006-02-15T10:09:17', 2), - ('771', '2006-02-15T10:09:17', 2), - ('771', '2006-02-15T10:09:17', 2), - ('771', '2006-02-15T10:09:17', 1), - ('870', '2006-02-15T10:09:17', 2), - ('870', '2006-02-15T10:09:17', 2), - ('870', '2006-02-15T10:09:17', 2), - ('870', '2006-02-15T10:09:17', 1), - ('870', '2006-02-15T10:09:17', 1), - ('870', '2006-02-15T10:09:17', 1), - ('870', '2006-02-15T10:09:17', 1), - ('870', '2006-02-15T10:09:17', 2), - ('235', '2006-02-15T10:09:17', 2), - ('235', '2006-02-15T10:09:17', 2), - ('235', '2006-02-15T10:09:17', 1), - ('235', '2006-02-15T10:09:17', 1), - ('235', '2006-02-15T10:09:17', 2), - ('235', '2006-02-15T10:09:17', 2), - ('648', '2006-02-15T10:09:17', 1), - ('648', '2006-02-15T10:09:17', 1), - ('648', '2006-02-15T10:09:17', 2), - ('648', '2006-02-15T10:09:17', 2), - ('648', '2006-02-15T10:09:17', 1), - ('648', '2006-02-15T10:09:17', 1), - ('290', '2006-02-15T10:09:17', 1), - ('290', '2006-02-15T10:09:17', 1), - ('290', '2006-02-15T10:09:17', 1), - ('491', '2006-02-15T10:09:17', 2), - ('491', '2006-02-15T10:09:17', 2), - ('491', '2006-02-15T10:09:17', 1), - ('491', '2006-02-15T10:09:17', 1), - ('491', '2006-02-15T10:09:17', 2), - ('491', '2006-02-15T10:09:17', 2), - ('357', '2006-02-15T10:09:17', 2), - ('357', '2006-02-15T10:09:17', 2), - ('357', '2006-02-15T10:09:17', 2), - ('357', '2006-02-15T10:09:17', 2), - ('772', '2006-02-15T10:09:17', 2), - ('772', '2006-02-15T10:09:17', 1), - ('772', '2006-02-15T10:09:17', 1), - ('772', '2006-02-15T10:09:17', 2), - ('772', '2006-02-15T10:09:17', 1), - ('772', '2006-02-15T10:09:17', 1), - ('19', '2006-02-15T10:09:17', 1), - ('19', '2006-02-15T10:09:17', 1) - ) AS data(old_film_id, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."film"' - AND map0.old_id = data.old_film_id - RETURNING inventory_id - ) - SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; - - FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); - END LOOP; - - v_old_ids_inventory := ARRAY['94', '98', '97', '95', '4346', '4345', '1353', '1350', '1352', '1351', '1349', '4139', '4140', '4138', '4028', '4025', '4027', '4024', '4026', '263', '262', '260', '261', '1839', '1840', '326', '333', '331', '329', '328', '332', '330', '327', '427', '426', '1502', '1506', '1503', '1504', '1501', '1505', '2239', '2242', '2237', '2236', '2240', '2238', '2241', '2638', '2644', '2639', '2640', '2642', '2641', '2643', '356', '351', '354', '357', '353', '355', '352', '737', '736', '4135', '4137', '4134', '4133', '4136', '2738', '2740', '2742', '2741', '2739', '4062', '4061', '420', '422', '421', '419', '3962', '3959', '3960', '3957', '3961', '3958', '3956', '4230', '4234', '4231', '4233', '4232', '1544', '1545', '1543', '2392', '2393', '3099', '3098', '3101']; - WITH inserted AS ( - INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") - SELECT - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - ('19', '2006-02-15T10:09:17', 1), - ('19', '2006-02-15T10:09:17', 2), - ('19', '2006-02-15T10:09:17', 2), - ('19', '2006-02-15T10:09:17', 1), - ('947', '2006-02-15T10:09:17', 1), - ('947', '2006-02-15T10:09:17', 1), - ('298', '2006-02-15T10:09:17', 2), - ('298', '2006-02-15T10:09:17', 1), - ('298', '2006-02-15T10:09:17', 2), - ('298', '2006-02-15T10:09:17', 2), - ('298', '2006-02-15T10:09:17', 1), - ('899', '2006-02-15T10:09:17', 1), - ('899', '2006-02-15T10:09:17', 1), - ('899', '2006-02-15T10:09:17', 1), - ('877', '2006-02-15T10:09:17', 2), - ('877', '2006-02-15T10:09:17', 1), - ('877', '2006-02-15T10:09:17', 2), - ('877', '2006-02-15T10:09:17', 1), - ('877', '2006-02-15T10:09:17', 1), - ('58', '2006-02-15T10:09:17', 2), - ('58', '2006-02-15T10:09:17', 2), - ('58', '2006-02-15T10:09:17', 2), - ('58', '2006-02-15T10:09:17', 2), - ('400', '2006-02-15T10:09:17', 1), - ('400', '2006-02-15T10:09:17', 1), - ('73', '2006-02-15T10:09:17', 1), - ('73', '2006-02-15T10:09:17', 2), - ('73', '2006-02-15T10:09:17', 2), - ('73', '2006-02-15T10:09:17', 1), - ('73', '2006-02-15T10:09:17', 1), - ('73', '2006-02-15T10:09:17', 2), - ('73', '2006-02-15T10:09:17', 2), - ('73', '2006-02-15T10:09:17', 1), - ('94', '2006-02-15T10:09:17', 1), - ('94', '2006-02-15T10:09:17', 1), - ('329', '2006-02-15T10:09:17', 1), - ('329', '2006-02-15T10:09:17', 2), - ('329', '2006-02-15T10:09:17', 1), - ('329', '2006-02-15T10:09:17', 2), - ('329', '2006-02-15T10:09:17', 1), - ('329', '2006-02-15T10:09:17', 2), - ('484', '2006-02-15T10:09:17', 1), - ('484', '2006-02-15T10:09:17', 2), - ('484', '2006-02-15T10:09:17', 1), - ('484', '2006-02-15T10:09:17', 1), - ('484', '2006-02-15T10:09:17', 2), - ('484', '2006-02-15T10:09:17', 1), - ('484', '2006-02-15T10:09:17', 2), - ('579', '2006-02-15T10:09:17', 1), - ('579', '2006-02-15T10:09:17', 2), - ('579', '2006-02-15T10:09:17', 1), - ('579', '2006-02-15T10:09:17', 1), - ('579', '2006-02-15T10:09:17', 2), - ('579', '2006-02-15T10:09:17', 1), - ('579', '2006-02-15T10:09:17', 2), - ('78', '2006-02-15T10:09:17', 2), - ('78', '2006-02-15T10:09:17', 1), - ('78', '2006-02-15T10:09:17', 2), - ('78', '2006-02-15T10:09:17', 2), - ('78', '2006-02-15T10:09:17', 1), - ('78', '2006-02-15T10:09:17', 2), - ('78', '2006-02-15T10:09:17', 1), - ('161', '2006-02-15T10:09:17', 1), - ('161', '2006-02-15T10:09:17', 1), - ('898', '2006-02-15T10:09:17', 1), - ('898', '2006-02-15T10:09:17', 2), - ('898', '2006-02-15T10:09:17', 1), - ('898', '2006-02-15T10:09:17', 1), - ('898', '2006-02-15T10:09:17', 2), - ('601', '2006-02-15T10:09:17', 1), - ('601', '2006-02-15T10:09:17', 1), - ('601', '2006-02-15T10:09:17', 2), - ('601', '2006-02-15T10:09:17', 2), - ('601', '2006-02-15T10:09:17', 1), - ('885', '2006-02-15T10:09:17', 1), - ('885', '2006-02-15T10:09:17', 1), - ('92', '2006-02-15T10:09:17', 1), - ('92', '2006-02-15T10:09:17', 2), - ('92', '2006-02-15T10:09:17', 2), - ('92', '2006-02-15T10:09:17', 1), - ('863', '2006-02-15T10:09:17', 2), - ('863', '2006-02-15T10:09:17', 1), - ('863', '2006-02-15T10:09:17', 2), - ('863', '2006-02-15T10:09:17', 1), - ('863', '2006-02-15T10:09:17', 2), - ('863', '2006-02-15T10:09:17', 1), - ('863', '2006-02-15T10:09:17', 1), - ('920', '2006-02-15T10:09:17', 1), - ('920', '2006-02-15T10:09:17', 2), - ('920', '2006-02-15T10:09:17', 1), - ('920', '2006-02-15T10:09:17', 2), - ('920', '2006-02-15T10:09:17', 1), - ('338', '2006-02-15T10:09:17', 2), - ('338', '2006-02-15T10:09:17', 2), - ('338', '2006-02-15T10:09:17', 2), - ('522', '2006-02-15T10:09:17', 2), - ('522', '2006-02-15T10:09:17', 2), - ('681', '2006-02-15T10:09:17', 1), - ('681', '2006-02-15T10:09:17', 1), - ('681', '2006-02-15T10:09:17', 2) - ) AS data(old_film_id, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."film"' - AND map0.old_id = data.old_film_id - RETURNING inventory_id - ) - SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; - - FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); - END LOOP; - - v_old_ids_inventory := ARRAY['3103', '3102', '3100', '2967', '2968', '2966', '2965', '2969', '2964', '26', '30', '29', '31', '28', '27', '1573', '1574', '1572', '1571', '1570', '3024', '3026', '3023', '3027', '3025', '3503', '3502', '3505', '3506', '3500', '3504', '3501', '3499', '3627', '3628', '3625', '3624', '3623', '3626', '4005', '4006', '4004', '1824', '1822', '1825', '1823', '1979', '1980', '1983', '1981', '1982', '2246', '2247', '2250', '2251', '2249', '2248', '2696', '2698', '2697', '2699', '103', '105', '106', '104', '102', '107', '566', '561', '563', '562', '560', '564', '565', '745', '747', '746', '3229', '3228', '3232', '3231', '3230', '3227', '3875', '3876', '3874', '3877', '3389', '3392', '3390', '3391', '3388', '3236', '3238', '3235', '3233', '3234', '3237', '3975', '3976']; - WITH inserted AS ( - INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") - SELECT - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - ('681', '2006-02-15T10:09:17', 2), - ('681', '2006-02-15T10:09:17', 2), - ('681', '2006-02-15T10:09:17', 1), - ('650', '2006-02-15T10:09:17', 2), - ('650', '2006-02-15T10:09:17', 2), - ('650', '2006-02-15T10:09:17', 2), - ('650', '2006-02-15T10:09:17', 1), - ('650', '2006-02-15T10:09:17', 2), - ('650', '2006-02-15T10:09:17', 1), - ('6', '2006-02-15T10:09:17', 1), - ('6', '2006-02-15T10:09:17', 2), - ('6', '2006-02-15T10:09:17', 2), - ('6', '2006-02-15T10:09:17', 2), - ('6', '2006-02-15T10:09:17', 1), - ('6', '2006-02-15T10:09:17', 1), - ('345', '2006-02-15T10:09:17', 2), - ('345', '2006-02-15T10:09:17', 2), - ('345', '2006-02-15T10:09:17', 1), - ('345', '2006-02-15T10:09:17', 1), - ('345', '2006-02-15T10:09:17', 1), - ('664', '2006-02-15T10:09:17', 1), - ('664', '2006-02-15T10:09:17', 2), - ('664', '2006-02-15T10:09:17', 1), - ('664', '2006-02-15T10:09:17', 2), - ('664', '2006-02-15T10:09:17', 2), - ('767', '2006-02-15T10:09:17', 2), - ('767', '2006-02-15T10:09:17', 1), - ('767', '2006-02-15T10:09:17', 2), - ('767', '2006-02-15T10:09:17', 2), - ('767', '2006-02-15T10:09:17', 1), - ('767', '2006-02-15T10:09:17', 2), - ('767', '2006-02-15T10:09:17', 1), - ('767', '2006-02-15T10:09:17', 1), - ('791', '2006-02-15T10:09:17', 2), - ('791', '2006-02-15T10:09:17', 2), - ('791', '2006-02-15T10:09:17', 2), - ('791', '2006-02-15T10:09:17', 1), - ('791', '2006-02-15T10:09:17', 1), - ('791', '2006-02-15T10:09:17', 2), - ('872', '2006-02-15T10:09:17', 2), - ('872', '2006-02-15T10:09:17', 2), - ('872', '2006-02-15T10:09:17', 2), - ('396', '2006-02-15T10:09:17', 2), - ('396', '2006-02-15T10:09:17', 2), - ('396', '2006-02-15T10:09:17', 2), - ('396', '2006-02-15T10:09:17', 2), - ('432', '2006-02-15T10:09:17', 1), - ('432', '2006-02-15T10:09:17', 1), - ('432', '2006-02-15T10:09:17', 2), - ('432', '2006-02-15T10:09:17', 1), - ('432', '2006-02-15T10:09:17', 2), - ('486', '2006-02-15T10:09:17', 1), - ('486', '2006-02-15T10:09:17', 1), - ('486', '2006-02-15T10:09:17', 2), - ('486', '2006-02-15T10:09:17', 2), - ('486', '2006-02-15T10:09:17', 1), - ('486', '2006-02-15T10:09:17', 1), - ('592', '2006-02-15T10:09:17', 1), - ('592', '2006-02-15T10:09:17', 2), - ('592', '2006-02-15T10:09:17', 1), - ('592', '2006-02-15T10:09:17', 2), - ('21', '2006-02-15T10:09:17', 1), - ('21', '2006-02-15T10:09:17', 2), - ('21', '2006-02-15T10:09:17', 2), - ('21', '2006-02-15T10:09:17', 2), - ('21', '2006-02-15T10:09:17', 1), - ('21', '2006-02-15T10:09:17', 2), - ('122', '2006-02-15T10:09:17', 2), - ('122', '2006-02-15T10:09:17', 1), - ('122', '2006-02-15T10:09:17', 1), - ('122', '2006-02-15T10:09:17', 1), - ('122', '2006-02-15T10:09:17', 1), - ('122', '2006-02-15T10:09:17', 2), - ('122', '2006-02-15T10:09:17', 2), - ('163', '2006-02-15T10:09:17', 2), - ('163', '2006-02-15T10:09:17', 2), - ('163', '2006-02-15T10:09:17', 2), - ('709', '2006-02-15T10:09:17', 2), - ('709', '2006-02-15T10:09:17', 1), - ('709', '2006-02-15T10:09:17', 2), - ('709', '2006-02-15T10:09:17', 2), - ('709', '2006-02-15T10:09:17', 2), - ('709', '2006-02-15T10:09:17', 1), - ('847', '2006-02-15T10:09:17', 2), - ('847', '2006-02-15T10:09:17', 2), - ('847', '2006-02-15T10:09:17', 2), - ('847', '2006-02-15T10:09:17', 2), - ('744', '2006-02-15T10:09:17', 1), - ('744', '2006-02-15T10:09:17', 2), - ('744', '2006-02-15T10:09:17', 2), - ('744', '2006-02-15T10:09:17', 2), - ('744', '2006-02-15T10:09:17', 1), - ('710', '2006-02-15T10:09:17', 1), - ('710', '2006-02-15T10:09:17', 2), - ('710', '2006-02-15T10:09:17', 1), - ('710', '2006-02-15T10:09:17', 1), - ('710', '2006-02-15T10:09:17', 1), - ('710', '2006-02-15T10:09:17', 2), - ('866', '2006-02-15T10:09:17', 2), - ('866', '2006-02-15T10:09:17', 2) - ) AS data(old_film_id, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."film"' - AND map0.old_id = data.old_film_id - RETURNING inventory_id - ) - SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; - - FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); - END LOOP; - - v_old_ids_inventory := ARRAY['1254', '1253', '1255', '4426', '4423', '4425', '4424', '4422', '2754', '2756', '2755', '367', '366', '365', '364', '3263', '3262', '4446', '4450', '4449', '4448', '4447', '4445', '3477', '3476', '3475', '3478', '3967', '3963', '3966', '3964', '3968', '3965', '1880', '1875', '1874', '1879', '1876', '1878', '1877', '4216', '4213', '4215', '4214', '4358', '4355', '4354', '4356', '4357', '4353', '4052', '4055', '4053', '4054', '3113', '3109', '3112', '3107', '3114', '3108', '3110', '3111', '3427', '3426', '873', '879', '877', '876', '874', '875', '880', '878', '3546', '3545', '3544', '3547', '3543', '4463', '4464', '4465', '4461', '4462', '3093', '3097', '3092', '3096', '3095', '3094', '920', '921', '916', '919', '918', '917', '252', '251', '248', '250', '249', '464']; - WITH inserted AS ( - INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") - SELECT - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - ('277', '2006-02-15T10:09:17', 1), - ('277', '2006-02-15T10:09:17', 1), - ('277', '2006-02-15T10:09:17', 1), - ('967', '2006-02-15T10:09:17', 2), - ('967', '2006-02-15T10:09:17', 1), - ('967', '2006-02-15T10:09:17', 2), - ('967', '2006-02-15T10:09:17', 1), - ('967', '2006-02-15T10:09:17', 1), - ('604', '2006-02-15T10:09:17', 2), - ('604', '2006-02-15T10:09:17', 2), - ('604', '2006-02-15T10:09:17', 2), - ('80', '2006-02-15T10:09:17', 1), - ('80', '2006-02-15T10:09:17', 1), - ('80', '2006-02-15T10:09:17', 1), - ('80', '2006-02-15T10:09:17', 1), - ('718', '2006-02-15T10:09:17', 2), - ('718', '2006-02-15T10:09:17', 2), - ('972', '2006-02-15T10:09:17', 1), - ('972', '2006-02-15T10:09:17', 2), - ('972', '2006-02-15T10:09:17', 2), - ('972', '2006-02-15T10:09:17', 2), - ('972', '2006-02-15T10:09:17', 1), - ('972', '2006-02-15T10:09:17', 1), - ('762', '2006-02-15T10:09:17', 2), - ('762', '2006-02-15T10:09:17', 2), - ('762', '2006-02-15T10:09:17', 2), - ('762', '2006-02-15T10:09:17', 2), - ('864', '2006-02-15T10:09:17', 2), - ('864', '2006-02-15T10:09:17', 1), - ('864', '2006-02-15T10:09:17', 1), - ('864', '2006-02-15T10:09:17', 1), - ('864', '2006-02-15T10:09:17', 2), - ('864', '2006-02-15T10:09:17', 1), - ('409', '2006-02-15T10:09:17', 2), - ('409', '2006-02-15T10:09:17', 1), - ('409', '2006-02-15T10:09:17', 1), - ('409', '2006-02-15T10:09:17', 2), - ('409', '2006-02-15T10:09:17', 1), - ('409', '2006-02-15T10:09:17', 2), - ('409', '2006-02-15T10:09:17', 1), - ('916', '2006-02-15T10:09:17', 2), - ('916', '2006-02-15T10:09:17', 1), - ('916', '2006-02-15T10:09:17', 2), - ('916', '2006-02-15T10:09:17', 1), - ('949', '2006-02-15T10:09:17', 2), - ('949', '2006-02-15T10:09:17', 1), - ('949', '2006-02-15T10:09:17', 1), - ('949', '2006-02-15T10:09:17', 1), - ('949', '2006-02-15T10:09:17', 2), - ('949', '2006-02-15T10:09:17', 1), - ('882', '2006-02-15T10:09:17', 1), - ('882', '2006-02-15T10:09:17', 1), - ('882', '2006-02-15T10:09:17', 1), - ('882', '2006-02-15T10:09:17', 1), - ('683', '2006-02-15T10:09:17', 2), - ('683', '2006-02-15T10:09:17', 1), - ('683', '2006-02-15T10:09:17', 2), - ('683', '2006-02-15T10:09:17', 1), - ('683', '2006-02-15T10:09:17', 2), - ('683', '2006-02-15T10:09:17', 1), - ('683', '2006-02-15T10:09:17', 1), - ('683', '2006-02-15T10:09:17', 2), - ('751', '2006-02-15T10:09:17', 2), - ('751', '2006-02-15T10:09:17', 2), - ('193', '2006-02-15T10:09:17', 1), - ('193', '2006-02-15T10:09:17', 2), - ('193', '2006-02-15T10:09:17', 2), - ('193', '2006-02-15T10:09:17', 1), - ('193', '2006-02-15T10:09:17', 1), - ('193', '2006-02-15T10:09:17', 1), - ('193', '2006-02-15T10:09:17', 2), - ('193', '2006-02-15T10:09:17', 2), - ('775', '2006-02-15T10:09:17', 2), - ('775', '2006-02-15T10:09:17', 1), - ('775', '2006-02-15T10:09:17', 1), - ('775', '2006-02-15T10:09:17', 2), - ('775', '2006-02-15T10:09:17', 1), - ('975', '2006-02-15T10:09:17', 2), - ('975', '2006-02-15T10:09:17', 2), - ('975', '2006-02-15T10:09:17', 2), - ('975', '2006-02-15T10:09:17', 1), - ('975', '2006-02-15T10:09:17', 1), - ('680', '2006-02-15T10:09:17', 1), - ('680', '2006-02-15T10:09:17', 2), - ('680', '2006-02-15T10:09:17', 1), - ('680', '2006-02-15T10:09:17', 2), - ('680', '2006-02-15T10:09:17', 2), - ('680', '2006-02-15T10:09:17', 2), - ('204', '2006-02-15T10:09:17', 2), - ('204', '2006-02-15T10:09:17', 2), - ('204', '2006-02-15T10:09:17', 1), - ('204', '2006-02-15T10:09:17', 1), - ('204', '2006-02-15T10:09:17', 1), - ('204', '2006-02-15T10:09:17', 1), - ('56', '2006-02-15T10:09:17', 2), - ('56', '2006-02-15T10:09:17', 2), - ('56', '2006-02-15T10:09:17', 1), - ('56', '2006-02-15T10:09:17', 1), - ('56', '2006-02-15T10:09:17', 1), - ('102', '2006-02-15T10:09:17', 2) - ) AS data(old_film_id, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."film"' - AND map0.old_id = data.old_film_id - RETURNING inventory_id - ) - SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; - - FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); - END LOOP; - - v_old_ids_inventory := ARRAY['463', '2712', '2709', '2708', '2707', '2714', '2710', '2713', '2711', '4539', '4542', '4541', '4538', '4540', '2650', '2645', '2649', '2648', '2647', '2646', '456', '453', '451', '455', '452', '454', '2545', '2544', '3294', '3293', '3297', '3292', '3295', '3296', '3448', '3449', '3450', '1562', '1560', '1559', '1561', '2802', '2803', '2801', '2800', '1425', '1427', '1426', '74', '76', '75', '73', '71', '72', '2284', '2285', '2286', '2282', '2281', '2283', '2875', '2873', '2874', '135', '136', '137', '138', '3775', '3777', '3776', '3780', '3778', '3779', '2580', '2579', '1758', '1759', '1760', '1757', '1763', '1764', '1761', '1762', '1036', '1030', '1034', '1032', '1031', '1033', '1035', '1029', '2676', '2675', '2677', '2653', '2652', '2651', '4252', '4251', '4250']; - WITH inserted AS ( - INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") - SELECT - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - ('102', '2006-02-15T10:09:17', 2), - ('595', '2006-02-15T10:09:17', 2), - ('595', '2006-02-15T10:09:17', 1), - ('595', '2006-02-15T10:09:17', 1), - ('595', '2006-02-15T10:09:17', 1), - ('595', '2006-02-15T10:09:17', 2), - ('595', '2006-02-15T10:09:17', 1), - ('595', '2006-02-15T10:09:17', 2), - ('595', '2006-02-15T10:09:17', 2), - ('991', '2006-02-15T10:09:17', 1), - ('991', '2006-02-15T10:09:17', 2), - ('991', '2006-02-15T10:09:17', 2), - ('991', '2006-02-15T10:09:17', 1), - ('991', '2006-02-15T10:09:17', 2), - ('580', '2006-02-15T10:09:17', 2), - ('580', '2006-02-15T10:09:17', 1), - ('580', '2006-02-15T10:09:17', 2), - ('580', '2006-02-15T10:09:17', 1), - ('580', '2006-02-15T10:09:17', 1), - ('580', '2006-02-15T10:09:17', 1), - ('100', '2006-02-15T10:09:17', 2), - ('100', '2006-02-15T10:09:17', 1), - ('100', '2006-02-15T10:09:17', 1), - ('100', '2006-02-15T10:09:17', 2), - ('100', '2006-02-15T10:09:17', 1), - ('100', '2006-02-15T10:09:17', 1), - ('558', '2006-02-15T10:09:17', 2), - ('558', '2006-02-15T10:09:17', 2), - ('725', '2006-02-15T10:09:17', 1), - ('725', '2006-02-15T10:09:17', 1), - ('725', '2006-02-15T10:09:17', 2), - ('725', '2006-02-15T10:09:17', 1), - ('725', '2006-02-15T10:09:17', 2), - ('725', '2006-02-15T10:09:17', 2), - ('756', '2006-02-15T10:09:17', 2), - ('756', '2006-02-15T10:09:17', 2), - ('756', '2006-02-15T10:09:17', 2), - ('342', '2006-02-15T10:09:17', 1), - ('342', '2006-02-15T10:09:17', 1), - ('342', '2006-02-15T10:09:17', 1), - ('342', '2006-02-15T10:09:17', 1), - ('615', '2006-02-15T10:09:17', 2), - ('615', '2006-02-15T10:09:17', 2), - ('615', '2006-02-15T10:09:17', 2), - ('615', '2006-02-15T10:09:17', 2), - ('312', '2006-02-15T10:09:17', 2), - ('312', '2006-02-15T10:09:17', 2), - ('312', '2006-02-15T10:09:17', 2), - ('15', '2006-02-15T10:09:17', 2), - ('15', '2006-02-15T10:09:17', 2), - ('15', '2006-02-15T10:09:17', 2), - ('15', '2006-02-15T10:09:17', 2), - ('15', '2006-02-15T10:09:17', 1), - ('15', '2006-02-15T10:09:17', 1), - ('494', '2006-02-15T10:09:17', 1), - ('494', '2006-02-15T10:09:17', 2), - ('494', '2006-02-15T10:09:17', 2), - ('494', '2006-02-15T10:09:17', 1), - ('494', '2006-02-15T10:09:17', 1), - ('494', '2006-02-15T10:09:17', 1), - ('630', '2006-02-15T10:09:17', 2), - ('630', '2006-02-15T10:09:17', 2), - ('630', '2006-02-15T10:09:17', 2), - ('27', '2006-02-15T10:09:17', 1), - ('27', '2006-02-15T10:09:17', 1), - ('27', '2006-02-15T10:09:17', 1), - ('27', '2006-02-15T10:09:17', 1), - ('827', '2006-02-15T10:09:17', 1), - ('827', '2006-02-15T10:09:17', 2), - ('827', '2006-02-15T10:09:17', 1), - ('827', '2006-02-15T10:09:17', 2), - ('827', '2006-02-15T10:09:17', 2), - ('827', '2006-02-15T10:09:17', 2), - ('565', '2006-02-15T10:09:17', 1), - ('565', '2006-02-15T10:09:17', 1), - ('382', '2006-02-15T10:09:17', 1), - ('382', '2006-02-15T10:09:17', 1), - ('382', '2006-02-15T10:09:17', 1), - ('382', '2006-02-15T10:09:17', 1), - ('382', '2006-02-15T10:09:17', 2), - ('382', '2006-02-15T10:09:17', 2), - ('382', '2006-02-15T10:09:17', 2), - ('382', '2006-02-15T10:09:17', 2), - ('231', '2006-02-15T10:09:17', 2), - ('231', '2006-02-15T10:09:17', 1), - ('231', '2006-02-15T10:09:17', 2), - ('231', '2006-02-15T10:09:17', 1), - ('231', '2006-02-15T10:09:17', 1), - ('231', '2006-02-15T10:09:17', 2), - ('231', '2006-02-15T10:09:17', 2), - ('231', '2006-02-15T10:09:17', 1), - ('587', '2006-02-15T10:09:17', 1), - ('587', '2006-02-15T10:09:17', 1), - ('587', '2006-02-15T10:09:17', 1), - ('581', '2006-02-15T10:09:17', 1), - ('581', '2006-02-15T10:09:17', 1), - ('581', '2006-02-15T10:09:17', 1), - ('924', '2006-02-15T10:09:17', 2), - ('924', '2006-02-15T10:09:17', 2), - ('924', '2006-02-15T10:09:17', 1) - ) AS data(old_film_id, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."film"' - AND map0.old_id = data.old_film_id - RETURNING inventory_id - ) - SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; - - FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); - END LOOP; - - v_old_ids_inventory := ARRAY['4253', '4249', '3266', '3271', '3272', '3269', '3267', '3270', '3268', '1178', '1177', '4343', '4344', '4341', '4342', '3954', '3951', '3952', '3955', '3953', '4144', '4141', '4143', '4142', '3106', '3104', '3105', '3225', '3226', '3223', '3224', '4308', '4304', '4307', '4309', '4305', '4306', '3457', '3456', '3458', '1190', '1189', '1188', '1191', '3117', '3118', '163', '160', '165', '162', '161', '166', '164', '1806', '1804', '1809', '1808', '1805', '1807', '3673', '3674', '3672', '3675', '3678', '3677', '3676', '3727', '3728', '3729', '2620', '2617', '2616', '2618', '2619', '1973', '1974', '1975', '1972', '3273', '3274', '3212', '3216', '3214', '3211', '3213', '3215', '3156', '3157', '3158', '3154', '3155', '180', '174', '178', '175', '177', '179', '176', '885', '886']; - WITH inserted AS ( - INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") - SELECT - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - ('924', '2006-02-15T10:09:17', 2), - ('924', '2006-02-15T10:09:17', 1), - ('720', '2006-02-15T10:09:17', 1), - ('720', '2006-02-15T10:09:17', 2), - ('720', '2006-02-15T10:09:17', 2), - ('720', '2006-02-15T10:09:17', 2), - ('720', '2006-02-15T10:09:17', 1), - ('720', '2006-02-15T10:09:17', 2), - ('720', '2006-02-15T10:09:17', 1), - ('262', '2006-02-15T10:09:17', 2), - ('262', '2006-02-15T10:09:17', 2), - ('946', '2006-02-15T10:09:17', 2), - ('946', '2006-02-15T10:09:17', 2), - ('946', '2006-02-15T10:09:17', 2), - ('946', '2006-02-15T10:09:17', 2), - ('862', '2006-02-15T10:09:17', 2), - ('862', '2006-02-15T10:09:17', 1), - ('862', '2006-02-15T10:09:17', 1), - ('862', '2006-02-15T10:09:17', 2), - ('862', '2006-02-15T10:09:17', 1), - ('900', '2006-02-15T10:09:17', 2), - ('900', '2006-02-15T10:09:17', 1), - ('900', '2006-02-15T10:09:17', 2), - ('900', '2006-02-15T10:09:17', 1), - ('682', '2006-02-15T10:09:17', 1), - ('682', '2006-02-15T10:09:17', 1), - ('682', '2006-02-15T10:09:17', 1), - ('708', '2006-02-15T10:09:17', 2), - ('708', '2006-02-15T10:09:17', 2), - ('708', '2006-02-15T10:09:17', 1), - ('708', '2006-02-15T10:09:17', 1), - ('938', '2006-02-15T10:09:17', 2), - ('938', '2006-02-15T10:09:17', 1), - ('938', '2006-02-15T10:09:17', 1), - ('938', '2006-02-15T10:09:17', 2), - ('938', '2006-02-15T10:09:17', 1), - ('938', '2006-02-15T10:09:17', 1), - ('758', '2006-02-15T10:09:17', 2), - ('758', '2006-02-15T10:09:17', 2), - ('758', '2006-02-15T10:09:17', 2), - ('265', '2006-02-15T10:09:17', 1), - ('265', '2006-02-15T10:09:17', 1), - ('265', '2006-02-15T10:09:17', 1), - ('265', '2006-02-15T10:09:17', 1), - ('685', '2006-02-15T10:09:17', 2), - ('685', '2006-02-15T10:09:17', 2), - ('35', '2006-02-15T10:09:17', 1), - ('35', '2006-02-15T10:09:17', 1), - ('35', '2006-02-15T10:09:17', 2), - ('35', '2006-02-15T10:09:17', 1), - ('35', '2006-02-15T10:09:17', 1), - ('35', '2006-02-15T10:09:17', 2), - ('35', '2006-02-15T10:09:17', 2), - ('392', '2006-02-15T10:09:17', 1), - ('392', '2006-02-15T10:09:17', 1), - ('392', '2006-02-15T10:09:17', 2), - ('392', '2006-02-15T10:09:17', 2), - ('392', '2006-02-15T10:09:17', 1), - ('392', '2006-02-15T10:09:17', 1), - ('804', '2006-02-15T10:09:17', 1), - ('804', '2006-02-15T10:09:17', 1), - ('804', '2006-02-15T10:09:17', 1), - ('804', '2006-02-15T10:09:17', 1), - ('804', '2006-02-15T10:09:17', 2), - ('804', '2006-02-15T10:09:17', 2), - ('804', '2006-02-15T10:09:17', 2), - ('815', '2006-02-15T10:09:17', 1), - ('815', '2006-02-15T10:09:17', 1), - ('815', '2006-02-15T10:09:17', 1), - ('574', '2006-02-15T10:09:17', 2), - ('574', '2006-02-15T10:09:17', 1), - ('574', '2006-02-15T10:09:17', 1), - ('574', '2006-02-15T10:09:17', 2), - ('574', '2006-02-15T10:09:17', 2), - ('430', '2006-02-15T10:09:17', 2), - ('430', '2006-02-15T10:09:17', 2), - ('430', '2006-02-15T10:09:17', 2), - ('430', '2006-02-15T10:09:17', 2), - ('721', '2006-02-15T10:09:17', 1), - ('721', '2006-02-15T10:09:17', 1), - ('706', '2006-02-15T10:09:17', 1), - ('706', '2006-02-15T10:09:17', 2), - ('706', '2006-02-15T10:09:17', 2), - ('706', '2006-02-15T10:09:17', 1), - ('706', '2006-02-15T10:09:17', 2), - ('706', '2006-02-15T10:09:17', 2), - ('693', '2006-02-15T10:09:17', 2), - ('693', '2006-02-15T10:09:17', 2), - ('693', '2006-02-15T10:09:17', 2), - ('693', '2006-02-15T10:09:17', 1), - ('693', '2006-02-15T10:09:17', 1), - ('39', '2006-02-15T10:09:17', 2), - ('39', '2006-02-15T10:09:17', 1), - ('39', '2006-02-15T10:09:17', 2), - ('39', '2006-02-15T10:09:17', 1), - ('39', '2006-02-15T10:09:17', 2), - ('39', '2006-02-15T10:09:17', 2), - ('39', '2006-02-15T10:09:17', 1), - ('196', '2006-02-15T10:09:17', 1), - ('196', '2006-02-15T10:09:17', 1) - ) AS data(old_film_id, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."film"' - AND map0.old_id = data.old_film_id - RETURNING inventory_id - ) - SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; - - FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); - END LOOP; - - v_old_ids_inventory := ARRAY['3919', '3917', '3918', '3916', '822', '819', '820', '821', '1155', '1156', '1154', '1158', '1157', '1153', '2810', '2812', '2811', '2887', '2889', '2888', '2890', '376', '374', '377', '375', '378', '3580', '3581', '3579', '3578', '1252', '1251', '1249', '1250', '1274', '1273', '1272', '1276', '1277', '1275', '3585', '3587', '3586', '3582', '3584', '3583', '1858', '1857', '3131', '3130', '3132', '3133', '2334', '2333', '2332', '2330', '2329', '2331', '3847', '3846', '3845', '3844', '1619', '1614', '1615', '1617', '1618', '1616', '854', '855', '856', '852', '853', '851', '749', '751', '750', '748', '752', '1121', '1123', '1126', '1124', '1122', '1125', '3277', '3275', '3276', '3278', '2814', '2813', '2815', '2816', '3314', '3311', '3313', '3312', '1826', '1832', '1831']; - WITH inserted AS ( - INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") - SELECT - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - ('855', '2006-02-15T10:09:17', 2), - ('855', '2006-02-15T10:09:17', 1), - ('855', '2006-02-15T10:09:17', 2), - ('855', '2006-02-15T10:09:17', 1), - ('179', '2006-02-15T10:09:17', 1), - ('179', '2006-02-15T10:09:17', 1), - ('179', '2006-02-15T10:09:17', 1), - ('179', '2006-02-15T10:09:17', 1), - ('255', '2006-02-15T10:09:17', 1), - ('255', '2006-02-15T10:09:17', 1), - ('255', '2006-02-15T10:09:17', 1), - ('255', '2006-02-15T10:09:17', 2), - ('255', '2006-02-15T10:09:17', 2), - ('255', '2006-02-15T10:09:17', 1), - ('617', '2006-02-15T10:09:17', 1), - ('617', '2006-02-15T10:09:17', 1), - ('617', '2006-02-15T10:09:17', 1), - ('634', '2006-02-15T10:09:17', 2), - ('634', '2006-02-15T10:09:17', 2), - ('634', '2006-02-15T10:09:17', 2), - ('634', '2006-02-15T10:09:17', 2), - ('83', '2006-02-15T10:09:17', 1), - ('83', '2006-02-15T10:09:17', 1), - ('83', '2006-02-15T10:09:17', 2), - ('83', '2006-02-15T10:09:17', 1), - ('83', '2006-02-15T10:09:17', 2), - ('783', '2006-02-15T10:09:17', 1), - ('783', '2006-02-15T10:09:17', 1), - ('783', '2006-02-15T10:09:17', 1), - ('783', '2006-02-15T10:09:17', 1), - ('276', '2006-02-15T10:09:17', 1), - ('276', '2006-02-15T10:09:17', 1), - ('276', '2006-02-15T10:09:17', 1), - ('276', '2006-02-15T10:09:17', 1), - ('282', '2006-02-15T10:09:17', 1), - ('282', '2006-02-15T10:09:17', 1), - ('282', '2006-02-15T10:09:17', 1), - ('282', '2006-02-15T10:09:17', 2), - ('282', '2006-02-15T10:09:17', 2), - ('282', '2006-02-15T10:09:17', 2), - ('784', '2006-02-15T10:09:17', 2), - ('784', '2006-02-15T10:09:17', 2), - ('784', '2006-02-15T10:09:17', 2), - ('784', '2006-02-15T10:09:17', 1), - ('784', '2006-02-15T10:09:17', 1), - ('784', '2006-02-15T10:09:17', 1), - ('405', '2006-02-15T10:09:17', 2), - ('405', '2006-02-15T10:09:17', 2), - ('688', '2006-02-15T10:09:17', 2), - ('688', '2006-02-15T10:09:17', 2), - ('688', '2006-02-15T10:09:17', 2), - ('688', '2006-02-15T10:09:17', 2), - ('506', '2006-02-15T10:09:17', 2), - ('506', '2006-02-15T10:09:17', 2), - ('506', '2006-02-15T10:09:17', 1), - ('506', '2006-02-15T10:09:17', 1), - ('506', '2006-02-15T10:09:17', 1), - ('506', '2006-02-15T10:09:17', 1), - ('842', '2006-02-15T10:09:17', 2), - ('842', '2006-02-15T10:09:17', 2), - ('842', '2006-02-15T10:09:17', 1), - ('842', '2006-02-15T10:09:17', 1), - ('353', '2006-02-15T10:09:17', 2), - ('353', '2006-02-15T10:09:17', 1), - ('353', '2006-02-15T10:09:17', 1), - ('353', '2006-02-15T10:09:17', 2), - ('353', '2006-02-15T10:09:17', 2), - ('353', '2006-02-15T10:09:17', 2), - ('188', '2006-02-15T10:09:17', 1), - ('188', '2006-02-15T10:09:17', 1), - ('188', '2006-02-15T10:09:17', 1), - ('187', '2006-02-15T10:09:17', 2), - ('187', '2006-02-15T10:09:17', 2), - ('187', '2006-02-15T10:09:17', 2), - ('164', '2006-02-15T10:09:17', 1), - ('164', '2006-02-15T10:09:17', 2), - ('164', '2006-02-15T10:09:17', 2), - ('164', '2006-02-15T10:09:17', 1), - ('164', '2006-02-15T10:09:17', 2), - ('249', '2006-02-15T10:09:17', 1), - ('249', '2006-02-15T10:09:17', 2), - ('249', '2006-02-15T10:09:17', 2), - ('249', '2006-02-15T10:09:17', 2), - ('249', '2006-02-15T10:09:17', 1), - ('249', '2006-02-15T10:09:17', 2), - ('722', '2006-02-15T10:09:17', 2), - ('722', '2006-02-15T10:09:17', 1), - ('722', '2006-02-15T10:09:17', 1), - ('722', '2006-02-15T10:09:17', 2), - ('618', '2006-02-15T10:09:17', 2), - ('618', '2006-02-15T10:09:17', 2), - ('618', '2006-02-15T10:09:17', 2), - ('618', '2006-02-15T10:09:17', 2), - ('729', '2006-02-15T10:09:17', 2), - ('729', '2006-02-15T10:09:17', 2), - ('729', '2006-02-15T10:09:17', 2), - ('729', '2006-02-15T10:09:17', 2), - ('397', '2006-02-15T10:09:17', 1), - ('397', '2006-02-15T10:09:17', 2), - ('397', '2006-02-15T10:09:17', 2) - ) AS data(old_film_id, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."film"' - AND map0.old_id = data.old_film_id - RETURNING inventory_id - ) - SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; - - FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); - END LOOP; - - v_old_ids_inventory := ARRAY['1828', '1830', '1827', '1829', '1868', '1871', '1867', '1873', '1869', '1870', '1872', '3948', '3950', '3949', '3945', '3946', '3947', '2627', '2629', '2628', '4279', '4280', '4278', '505', '501', '506', '507', '502', '503', '504', '2289', '2288', '2291', '2287', '2290', '4317', '4322', '4319', '4323', '4321', '4320', '4318', '462', '461', '458', '460', '457', '459', '513', '515', '518', '517', '516', '514', '512', '4381', '4382', '4379', '4383', '4380', '2311', '2314', '2313', '2310', '2312', '2309', '2315', '23', '25', '24', '4522', '4521', '4524', '4523', '3284', '3280', '3285', '3283', '3279', '3282', '3281', '1966', '1967', '1969', '1971', '1968', '1970', '4476', '4475', '4477', '817', '818', '4173', '4171', '4174', '4172', '4415', '4414', '2532', '2536']; - WITH inserted AS ( - INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") - SELECT - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - ('397', '2006-02-15T10:09:17', 1), - ('397', '2006-02-15T10:09:17', 2), - ('397', '2006-02-15T10:09:17', 1), - ('397', '2006-02-15T10:09:17', 2), - ('408', '2006-02-15T10:09:17', 1), - ('408', '2006-02-15T10:09:17', 2), - ('408', '2006-02-15T10:09:17', 1), - ('408', '2006-02-15T10:09:17', 2), - ('408', '2006-02-15T10:09:17', 1), - ('408', '2006-02-15T10:09:17', 1), - ('408', '2006-02-15T10:09:17', 2), - ('861', '2006-02-15T10:09:17', 2), - ('861', '2006-02-15T10:09:17', 2), - ('861', '2006-02-15T10:09:17', 2), - ('861', '2006-02-15T10:09:17', 1), - ('861', '2006-02-15T10:09:17', 1), - ('861', '2006-02-15T10:09:17', 1), - ('576', '2006-02-15T10:09:17', 2), - ('576', '2006-02-15T10:09:17', 2), - ('576', '2006-02-15T10:09:17', 2), - ('931', '2006-02-15T10:09:17', 2), - ('931', '2006-02-15T10:09:17', 2), - ('931', '2006-02-15T10:09:17', 2), - ('112', '2006-02-15T10:09:17', 2), - ('112', '2006-02-15T10:09:17', 1), - ('112', '2006-02-15T10:09:17', 2), - ('112', '2006-02-15T10:09:17', 2), - ('112', '2006-02-15T10:09:17', 1), - ('112', '2006-02-15T10:09:17', 1), - ('112', '2006-02-15T10:09:17', 1), - ('496', '2006-02-15T10:09:17', 2), - ('496', '2006-02-15T10:09:17', 1), - ('496', '2006-02-15T10:09:17', 2), - ('496', '2006-02-15T10:09:17', 1), - ('496', '2006-02-15T10:09:17', 2), - ('941', '2006-02-15T10:09:17', 1), - ('941', '2006-02-15T10:09:17', 2), - ('941', '2006-02-15T10:09:17', 1), - ('941', '2006-02-15T10:09:17', 2), - ('941', '2006-02-15T10:09:17', 2), - ('941', '2006-02-15T10:09:17', 1), - ('941', '2006-02-15T10:09:17', 1), - ('101', '2006-02-15T10:09:17', 2), - ('101', '2006-02-15T10:09:17', 2), - ('101', '2006-02-15T10:09:17', 1), - ('101', '2006-02-15T10:09:17', 1), - ('101', '2006-02-15T10:09:17', 1), - ('101', '2006-02-15T10:09:17', 1), - ('114', '2006-02-15T10:09:17', 1), - ('114', '2006-02-15T10:09:17', 1), - ('114', '2006-02-15T10:09:17', 2), - ('114', '2006-02-15T10:09:17', 2), - ('114', '2006-02-15T10:09:17', 2), - ('114', '2006-02-15T10:09:17', 1), - ('114', '2006-02-15T10:09:17', 1), - ('957', '2006-02-15T10:09:17', 1), - ('957', '2006-02-15T10:09:17', 2), - ('957', '2006-02-15T10:09:17', 1), - ('957', '2006-02-15T10:09:17', 2), - ('957', '2006-02-15T10:09:17', 1), - ('502', '2006-02-15T10:09:17', 1), - ('502', '2006-02-15T10:09:17', 2), - ('502', '2006-02-15T10:09:17', 2), - ('502', '2006-02-15T10:09:17', 1), - ('502', '2006-02-15T10:09:17', 1), - ('502', '2006-02-15T10:09:17', 1), - ('502', '2006-02-15T10:09:17', 2), - ('5', '2006-02-15T10:09:17', 2), - ('5', '2006-02-15T10:09:17', 2), - ('5', '2006-02-15T10:09:17', 2), - ('987', '2006-02-15T10:09:17', 1), - ('987', '2006-02-15T10:09:17', 1), - ('987', '2006-02-15T10:09:17', 2), - ('987', '2006-02-15T10:09:17', 2), - ('723', '2006-02-15T10:09:17', 2), - ('723', '2006-02-15T10:09:17', 1), - ('723', '2006-02-15T10:09:17', 2), - ('723', '2006-02-15T10:09:17', 2), - ('723', '2006-02-15T10:09:17', 1), - ('723', '2006-02-15T10:09:17', 1), - ('723', '2006-02-15T10:09:17', 1), - ('429', '2006-02-15T10:09:17', 1), - ('429', '2006-02-15T10:09:17', 1), - ('429', '2006-02-15T10:09:17', 2), - ('429', '2006-02-15T10:09:17', 2), - ('429', '2006-02-15T10:09:17', 2), - ('429', '2006-02-15T10:09:17', 2), - ('978', '2006-02-15T10:09:17', 1), - ('978', '2006-02-15T10:09:17', 1), - ('978', '2006-02-15T10:09:17', 1), - ('178', '2006-02-15T10:09:17', 1), - ('178', '2006-02-15T10:09:17', 1), - ('907', '2006-02-15T10:09:17', 1), - ('907', '2006-02-15T10:09:17', 1), - ('907', '2006-02-15T10:09:17', 1), - ('907', '2006-02-15T10:09:17', 1), - ('965', '2006-02-15T10:09:17', 1), - ('965', '2006-02-15T10:09:17', 1), - ('556', '2006-02-15T10:09:17', 1), - ('556', '2006-02-15T10:09:17', 2) - ) AS data(old_film_id, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."film"' - AND map0.old_id = data.old_film_id - RETURNING inventory_id - ) - SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; - - FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); - END LOOP; - - v_old_ids_inventory := ARRAY['2533', '2534', '2535', '2538', '2537', '3908', '3902', '3907', '3904', '3903', '3906', '3905', '2735', '2737', '2734', '2736', '4567', '4568', '568', '567', '571', '570', '569', '4201', '4205', '4206', '4203', '4204', '4202', '205', '202', '201', '203', '204', '206', '2808', '2807', '2809', '2804', '2805', '2806', '3070', '3069', '3422', '3421', '3419', '3420', '2388', '2387', '2386', '2385', '2389', '2391', '2390', '1946', '1950', '1947', '1948', '1949', '2895', '2893', '2894', '344', '342', '343', '1859', '1860', '1862', '1863', '1864', '1861', '2758', '2757', '2910', '2911', '2909', '1418', '1419', '1424', '1423', '1420', '1422', '1421', '1366', '1371', '1370', '1365', '1368', '1364', '1369', '1367', '2607', '2610', '2608', '2606', '2611', '2609', '2604', '2605', '684']; - WITH inserted AS ( - INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") - SELECT - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - ('556', '2006-02-15T10:09:17', 1), - ('556', '2006-02-15T10:09:17', 1), - ('556', '2006-02-15T10:09:17', 2), - ('556', '2006-02-15T10:09:17', 2), - ('556', '2006-02-15T10:09:17', 2), - ('852', '2006-02-15T10:09:17', 2), - ('852', '2006-02-15T10:09:17', 1), - ('852', '2006-02-15T10:09:17', 2), - ('852', '2006-02-15T10:09:17', 1), - ('852', '2006-02-15T10:09:17', 1), - ('852', '2006-02-15T10:09:17', 2), - ('852', '2006-02-15T10:09:17', 1), - ('600', '2006-02-15T10:09:17', 1), - ('600', '2006-02-15T10:09:17', 2), - ('600', '2006-02-15T10:09:17', 1), - ('600', '2006-02-15T10:09:17', 2), - ('998', '2006-02-15T10:09:17', 2), - ('998', '2006-02-15T10:09:17', 2), - ('123', '2006-02-15T10:09:17', 1), - ('123', '2006-02-15T10:09:17', 1), - ('123', '2006-02-15T10:09:17', 2), - ('123', '2006-02-15T10:09:17', 2), - ('123', '2006-02-15T10:09:17', 2), - ('914', '2006-02-15T10:09:17', 1), - ('914', '2006-02-15T10:09:17', 2), - ('914', '2006-02-15T10:09:17', 2), - ('914', '2006-02-15T10:09:17', 2), - ('914', '2006-02-15T10:09:17', 2), - ('914', '2006-02-15T10:09:17', 1), - ('45', '2006-02-15T10:09:17', 2), - ('45', '2006-02-15T10:09:17', 1), - ('45', '2006-02-15T10:09:17', 1), - ('45', '2006-02-15T10:09:17', 1), - ('45', '2006-02-15T10:09:17', 1), - ('45', '2006-02-15T10:09:17', 2), - ('616', '2006-02-15T10:09:17', 2), - ('616', '2006-02-15T10:09:17', 2), - ('616', '2006-02-15T10:09:17', 2), - ('616', '2006-02-15T10:09:17', 1), - ('616', '2006-02-15T10:09:17', 1), - ('616', '2006-02-15T10:09:17', 2), - ('675', '2006-02-15T10:09:17', 1), - ('675', '2006-02-15T10:09:17', 1), - ('749', '2006-02-15T10:09:17', 2), - ('749', '2006-02-15T10:09:17', 2), - ('749', '2006-02-15T10:09:17', 1), - ('749', '2006-02-15T10:09:17', 1), - ('521', '2006-02-15T10:09:17', 1), - ('521', '2006-02-15T10:09:17', 1), - ('521', '2006-02-15T10:09:17', 1), - ('521', '2006-02-15T10:09:17', 1), - ('521', '2006-02-15T10:09:17', 2), - ('521', '2006-02-15T10:09:17', 2), - ('521', '2006-02-15T10:09:17', 2), - ('424', '2006-02-15T10:09:17', 1), - ('424', '2006-02-15T10:09:17', 2), - ('424', '2006-02-15T10:09:17', 1), - ('424', '2006-02-15T10:09:17', 1), - ('424', '2006-02-15T10:09:17', 2), - ('636', '2006-02-15T10:09:17', 1), - ('636', '2006-02-15T10:09:17', 1), - ('636', '2006-02-15T10:09:17', 1), - ('76', '2006-02-15T10:09:17', 1), - ('76', '2006-02-15T10:09:17', 1), - ('76', '2006-02-15T10:09:17', 1), - ('406', '2006-02-15T10:09:17', 1), - ('406', '2006-02-15T10:09:17', 1), - ('406', '2006-02-15T10:09:17', 2), - ('406', '2006-02-15T10:09:17', 2), - ('406', '2006-02-15T10:09:17', 2), - ('406', '2006-02-15T10:09:17', 2), - ('605', '2006-02-15T10:09:17', 2), - ('605', '2006-02-15T10:09:17', 2), - ('639', '2006-02-15T10:09:17', 2), - ('639', '2006-02-15T10:09:17', 2), - ('639', '2006-02-15T10:09:17', 2), - ('311', '2006-02-15T10:09:17', 1), - ('311', '2006-02-15T10:09:17', 1), - ('311', '2006-02-15T10:09:17', 2), - ('311', '2006-02-15T10:09:17', 2), - ('311', '2006-02-15T10:09:17', 1), - ('311', '2006-02-15T10:09:17', 2), - ('311', '2006-02-15T10:09:17', 2), - ('301', '2006-02-15T10:09:17', 1), - ('301', '2006-02-15T10:09:17', 2), - ('301', '2006-02-15T10:09:17', 2), - ('301', '2006-02-15T10:09:17', 1), - ('301', '2006-02-15T10:09:17', 2), - ('301', '2006-02-15T10:09:17', 1), - ('301', '2006-02-15T10:09:17', 2), - ('301', '2006-02-15T10:09:17', 1), - ('572', '2006-02-15T10:09:17', 1), - ('572', '2006-02-15T10:09:17', 2), - ('572', '2006-02-15T10:09:17', 2), - ('572', '2006-02-15T10:09:17', 1), - ('572', '2006-02-15T10:09:17', 2), - ('572', '2006-02-15T10:09:17', 2), - ('572', '2006-02-15T10:09:17', 1), - ('572', '2006-02-15T10:09:17', 1), - ('150', '2006-02-15T10:09:17', 1) - ) AS data(old_film_id, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."film"' - AND map0.old_id = data.old_film_id - RETURNING inventory_id - ) - SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; - - FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); - END LOOP; - - v_old_ids_inventory := ARRAY['686', '687', '688', '689', '685', '2993', '2992', '2872', '2870', '2869', '2871', '1008', '1007', '1006', '1010', '1009', '1793', '1792', '1791', '1790', '4256', '4254', '4258', '4255', '4257', '3410', '3406', '3407', '3409', '3408', '346', '349', '350', '347', '345', '348', '3016', '3017', '3015', '3014', '1499', '1497', '1500', '1498', '834', '835', '838', '836', '837', '839', '2118', '2119', '53', '58', '57', '54', '55', '56', '59', '665', '661', '660', '662', '663', '659', '664', '1100', '1099', '1096', '1095', '1098', '1101', '1097', '4384', '4389', '4388', '4387', '4386', '4385', '1685', '1687', '1683', '1686', '1684', '1681', '1682', '1144', '1145', '1147', '1143', '1142', '1146', '2047', '2049', '2050', '2048', '2051', '2052', '496', '493']; - WITH inserted AS ( - INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") - SELECT - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - ('150', '2006-02-15T10:09:17', 2), - ('150', '2006-02-15T10:09:17', 2), - ('150', '2006-02-15T10:09:17', 2), - ('150', '2006-02-15T10:09:17', 2), - ('150', '2006-02-15T10:09:17', 1), - ('656', '2006-02-15T10:09:17', 2), - ('656', '2006-02-15T10:09:17', 2), - ('629', '2006-02-15T10:09:17', 2), - ('629', '2006-02-15T10:09:17', 2), - ('629', '2006-02-15T10:09:17', 2), - ('629', '2006-02-15T10:09:17', 2), - ('226', '2006-02-15T10:09:17', 2), - ('226', '2006-02-15T10:09:17', 1), - ('226', '2006-02-15T10:09:17', 1), - ('226', '2006-02-15T10:09:17', 2), - ('226', '2006-02-15T10:09:17', 2), - ('389', '2006-02-15T10:09:17', 2), - ('389', '2006-02-15T10:09:17', 2), - ('389', '2006-02-15T10:09:17', 1), - ('389', '2006-02-15T10:09:17', 1), - ('925', '2006-02-15T10:09:17', 1), - ('925', '2006-02-15T10:09:17', 1), - ('925', '2006-02-15T10:09:17', 2), - ('925', '2006-02-15T10:09:17', 1), - ('925', '2006-02-15T10:09:17', 2), - ('747', '2006-02-15T10:09:17', 2), - ('747', '2006-02-15T10:09:17', 1), - ('747', '2006-02-15T10:09:17', 1), - ('747', '2006-02-15T10:09:17', 2), - ('747', '2006-02-15T10:09:17', 2), - ('77', '2006-02-15T10:09:17', 1), - ('77', '2006-02-15T10:09:17', 2), - ('77', '2006-02-15T10:09:17', 2), - ('77', '2006-02-15T10:09:17', 1), - ('77', '2006-02-15T10:09:17', 1), - ('77', '2006-02-15T10:09:17', 1), - ('662', '2006-02-15T10:09:17', 2), - ('662', '2006-02-15T10:09:17', 2), - ('662', '2006-02-15T10:09:17', 1), - ('662', '2006-02-15T10:09:17', 1), - ('328', '2006-02-15T10:09:17', 2), - ('328', '2006-02-15T10:09:17', 2), - ('328', '2006-02-15T10:09:17', 2), - ('328', '2006-02-15T10:09:17', 2), - ('183', '2006-02-15T10:09:17', 1), - ('183', '2006-02-15T10:09:17', 1), - ('183', '2006-02-15T10:09:17', 2), - ('183', '2006-02-15T10:09:17', 1), - ('183', '2006-02-15T10:09:17', 2), - ('183', '2006-02-15T10:09:17', 2), - ('459', '2006-02-15T10:09:17', 2), - ('459', '2006-02-15T10:09:17', 2), - ('11', '2006-02-15T10:09:17', 1), - ('11', '2006-02-15T10:09:17', 2), - ('11', '2006-02-15T10:09:17', 2), - ('11', '2006-02-15T10:09:17', 1), - ('11', '2006-02-15T10:09:17', 1), - ('11', '2006-02-15T10:09:17', 1), - ('11', '2006-02-15T10:09:17', 2), - ('143', '2006-02-15T10:09:17', 2), - ('143', '2006-02-15T10:09:17', 1), - ('143', '2006-02-15T10:09:17', 1), - ('143', '2006-02-15T10:09:17', 1), - ('143', '2006-02-15T10:09:17', 2), - ('143', '2006-02-15T10:09:17', 1), - ('143', '2006-02-15T10:09:17', 2), - ('244', '2006-02-15T10:09:17', 2), - ('244', '2006-02-15T10:09:17', 2), - ('244', '2006-02-15T10:09:17', 1), - ('244', '2006-02-15T10:09:17', 1), - ('244', '2006-02-15T10:09:17', 1), - ('244', '2006-02-15T10:09:17', 2), - ('244', '2006-02-15T10:09:17', 1), - ('958', '2006-02-15T10:09:17', 1), - ('958', '2006-02-15T10:09:17', 2), - ('958', '2006-02-15T10:09:17', 2), - ('958', '2006-02-15T10:09:17', 2), - ('958', '2006-02-15T10:09:17', 1), - ('958', '2006-02-15T10:09:17', 1), - ('367', '2006-02-15T10:09:17', 2), - ('367', '2006-02-15T10:09:17', 2), - ('367', '2006-02-15T10:09:17', 1), - ('367', '2006-02-15T10:09:17', 2), - ('367', '2006-02-15T10:09:17', 1), - ('367', '2006-02-15T10:09:17', 1), - ('367', '2006-02-15T10:09:17', 1), - ('253', '2006-02-15T10:09:17', 1), - ('253', '2006-02-15T10:09:17', 1), - ('253', '2006-02-15T10:09:17', 2), - ('253', '2006-02-15T10:09:17', 1), - ('253', '2006-02-15T10:09:17', 1), - ('253', '2006-02-15T10:09:17', 2), - ('445', '2006-02-15T10:09:17', 1), - ('445', '2006-02-15T10:09:17', 1), - ('445', '2006-02-15T10:09:17', 2), - ('445', '2006-02-15T10:09:17', 1), - ('445', '2006-02-15T10:09:17', 2), - ('445', '2006-02-15T10:09:17', 2), - ('110', '2006-02-15T10:09:17', 1), - ('110', '2006-02-15T10:09:17', 1) - ) AS data(old_film_id, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."film"' - AND map0.old_id = data.old_film_id - RETURNING inventory_id - ) - SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; - - FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); - END LOOP; - - v_old_ids_inventory := ARRAY['494', '495', '762', '760', '759', '763', '758', '761', '882', '884', '881', '883', '1729', '1733', '1734', '1731', '1732', '1730', '3690', '3691', '3692', '3689', '3693', '338', '335', '337', '334', '336', '1892', '1888', '1894', '1891', '1895', '1893', '1889', '1890', '1943', '1942', '1945', '1944', '3038', '3039', '3037', '3036', '3035', '363', '362', '360', '358', '361', '359', '703', '707', '706', '705', '708', '704', '702', '4162', '4161', '1818', '1816', '1820', '1819', '1821', '1817', '2427', '2428', '2429', '264', '266', '267', '268', '265', '3149', '3148', '3150', '3146', '3147', '1449', '1451', '1445', '1446', '1447', '1450', '1448', '2719', '2716', '2720', '2717', '2715', '2718', '1585', '1587', '1586', '1588', '269', '271', '270', '2216']; - WITH inserted AS ( - INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") - SELECT - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - ('110', '2006-02-15T10:09:17', 1), - ('110', '2006-02-15T10:09:17', 1), - ('166', '2006-02-15T10:09:17', 2), - ('166', '2006-02-15T10:09:17', 1), - ('166', '2006-02-15T10:09:17', 1), - ('166', '2006-02-15T10:09:17', 2), - ('166', '2006-02-15T10:09:17', 1), - ('166', '2006-02-15T10:09:17', 1), - ('194', '2006-02-15T10:09:17', 1), - ('194', '2006-02-15T10:09:17', 2), - ('194', '2006-02-15T10:09:17', 1), - ('194', '2006-02-15T10:09:17', 2), - ('377', '2006-02-15T10:09:17', 1), - ('377', '2006-02-15T10:09:17', 2), - ('377', '2006-02-15T10:09:17', 2), - ('377', '2006-02-15T10:09:17', 1), - ('377', '2006-02-15T10:09:17', 2), - ('377', '2006-02-15T10:09:17', 1), - ('807', '2006-02-15T10:09:17', 1), - ('807', '2006-02-15T10:09:17', 1), - ('807', '2006-02-15T10:09:17', 2), - ('807', '2006-02-15T10:09:17', 1), - ('807', '2006-02-15T10:09:17', 2), - ('74', '2006-02-15T10:09:17', 2), - ('74', '2006-02-15T10:09:17', 1), - ('74', '2006-02-15T10:09:17', 2), - ('74', '2006-02-15T10:09:17', 1), - ('74', '2006-02-15T10:09:17', 1), - ('412', '2006-02-15T10:09:17', 2), - ('412', '2006-02-15T10:09:17', 1), - ('412', '2006-02-15T10:09:17', 2), - ('412', '2006-02-15T10:09:17', 1), - ('412', '2006-02-15T10:09:17', 2), - ('412', '2006-02-15T10:09:17', 2), - ('412', '2006-02-15T10:09:17', 1), - ('412', '2006-02-15T10:09:17', 1), - ('423', '2006-02-15T10:09:17', 1), - ('423', '2006-02-15T10:09:17', 1), - ('423', '2006-02-15T10:09:17', 2), - ('423', '2006-02-15T10:09:17', 2), - ('666', '2006-02-15T10:09:17', 2), - ('666', '2006-02-15T10:09:17', 2), - ('666', '2006-02-15T10:09:17', 1), - ('666', '2006-02-15T10:09:17', 1), - ('666', '2006-02-15T10:09:17', 1), - ('79', '2006-02-15T10:09:17', 2), - ('79', '2006-02-15T10:09:17', 2), - ('79', '2006-02-15T10:09:17', 1), - ('79', '2006-02-15T10:09:17', 1), - ('79', '2006-02-15T10:09:17', 2), - ('79', '2006-02-15T10:09:17', 1), - ('154', '2006-02-15T10:09:17', 1), - ('154', '2006-02-15T10:09:17', 2), - ('154', '2006-02-15T10:09:17', 2), - ('154', '2006-02-15T10:09:17', 2), - ('154', '2006-02-15T10:09:17', 2), - ('154', '2006-02-15T10:09:17', 1), - ('154', '2006-02-15T10:09:17', 1), - ('904', '2006-02-15T10:09:17', 1), - ('904', '2006-02-15T10:09:17', 1), - ('395', '2006-02-15T10:09:17', 1), - ('395', '2006-02-15T10:09:17', 1), - ('395', '2006-02-15T10:09:17', 2), - ('395', '2006-02-15T10:09:17', 2), - ('395', '2006-02-15T10:09:17', 2), - ('395', '2006-02-15T10:09:17', 1), - ('530', '2006-02-15T10:09:17', 1), - ('530', '2006-02-15T10:09:17', 1), - ('530', '2006-02-15T10:09:17', 1), - ('59', '2006-02-15T10:09:17', 1), - ('59', '2006-02-15T10:09:17', 1), - ('59', '2006-02-15T10:09:17', 2), - ('59', '2006-02-15T10:09:17', 2), - ('59', '2006-02-15T10:09:17', 1), - ('691', '2006-02-15T10:09:17', 2), - ('691', '2006-02-15T10:09:17', 1), - ('691', '2006-02-15T10:09:17', 2), - ('691', '2006-02-15T10:09:17', 1), - ('691', '2006-02-15T10:09:17', 1), - ('317', '2006-02-15T10:09:17', 2), - ('317', '2006-02-15T10:09:17', 2), - ('317', '2006-02-15T10:09:17', 1), - ('317', '2006-02-15T10:09:17', 1), - ('317', '2006-02-15T10:09:17', 1), - ('317', '2006-02-15T10:09:17', 2), - ('317', '2006-02-15T10:09:17', 1), - ('596', '2006-02-15T10:09:17', 2), - ('596', '2006-02-15T10:09:17', 1), - ('596', '2006-02-15T10:09:17', 2), - ('596', '2006-02-15T10:09:17', 2), - ('596', '2006-02-15T10:09:17', 1), - ('596', '2006-02-15T10:09:17', 2), - ('348', '2006-02-15T10:09:17', 2), - ('348', '2006-02-15T10:09:17', 2), - ('348', '2006-02-15T10:09:17', 2), - ('348', '2006-02-15T10:09:17', 2), - ('60', '2006-02-15T10:09:17', 1), - ('60', '2006-02-15T10:09:17', 1), - ('60', '2006-02-15T10:09:17', 1), - ('479', '2006-02-15T10:09:17', 2) - ) AS data(old_film_id, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."film"' - AND map0.old_id = data.old_film_id - RETURNING inventory_id - ) - SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; - - FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); - END LOOP; - - v_old_ids_inventory := ARRAY['2217', '2213', '2215', '2214', '4175', '4176', '4178', '4177', '1532', '1533', '3541', '3539', '3542', '3540', '3828', '3830', '3826', '3829', '3827', '3825', '1334', '1331', '1330', '1332', '1333', '3605', '3606', '3604', '3607', '4043', '4040', '4042', '4047', '4045', '4044', '4046', '4041', '4160', '4159', '3191', '3189', '3190', '3264', '3265', '698', '699', '700', '701', '197', '199', '198', '196', '200', '4241', '4239', '4242', '4244', '4243', '4240', '4245', '3405', '3404', '3403', '3401', '3402', '3253', '3256', '3255', '3257', '3254', '3245', '3244', '3243', '1592', '1594', '1589', '1595', '1591', '1590', '1593', '235', '236', '2913', '2912', '2914', '184', '182', '181', '183', '1102', '1103', '1107', '1106', '1105', '1108', '1104', '1376', '1377', '1372', '1373']; - WITH inserted AS ( - INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") - SELECT - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - ('479', '2006-02-15T10:09:17', 2), - ('479', '2006-02-15T10:09:17', 1), - ('479', '2006-02-15T10:09:17', 2), - ('479', '2006-02-15T10:09:17', 1), - ('908', '2006-02-15T10:09:17', 1), - ('908', '2006-02-15T10:09:17', 1), - ('908', '2006-02-15T10:09:17', 2), - ('908', '2006-02-15T10:09:17', 2), - ('335', '2006-02-15T10:09:17', 1), - ('335', '2006-02-15T10:09:17', 1), - ('774', '2006-02-15T10:09:17', 1), - ('774', '2006-02-15T10:09:17', 1), - ('774', '2006-02-15T10:09:17', 1), - ('774', '2006-02-15T10:09:17', 1), - ('838', '2006-02-15T10:09:17', 2), - ('838', '2006-02-15T10:09:17', 2), - ('838', '2006-02-15T10:09:17', 1), - ('838', '2006-02-15T10:09:17', 2), - ('838', '2006-02-15T10:09:17', 2), - ('838', '2006-02-15T10:09:17', 1), - ('294', '2006-02-15T10:09:17', 2), - ('294', '2006-02-15T10:09:17', 1), - ('294', '2006-02-15T10:09:17', 1), - ('294', '2006-02-15T10:09:17', 2), - ('294', '2006-02-15T10:09:17', 2), - ('788', '2006-02-15T10:09:17', 1), - ('788', '2006-02-15T10:09:17', 2), - ('788', '2006-02-15T10:09:17', 1), - ('788', '2006-02-15T10:09:17', 2), - ('880', '2006-02-15T10:09:17', 1), - ('880', '2006-02-15T10:09:17', 1), - ('880', '2006-02-15T10:09:17', 1), - ('880', '2006-02-15T10:09:17', 2), - ('880', '2006-02-15T10:09:17', 2), - ('880', '2006-02-15T10:09:17', 2), - ('880', '2006-02-15T10:09:17', 2), - ('880', '2006-02-15T10:09:17', 1), - ('903', '2006-02-15T10:09:17', 2), - ('903', '2006-02-15T10:09:17', 2), - ('700', '2006-02-15T10:09:17', 2), - ('700', '2006-02-15T10:09:17', 2), - ('700', '2006-02-15T10:09:17', 2), - ('719', '2006-02-15T10:09:17', 1), - ('719', '2006-02-15T10:09:17', 1), - ('153', '2006-02-15T10:09:17', 1), - ('153', '2006-02-15T10:09:17', 1), - ('153', '2006-02-15T10:09:17', 1), - ('153', '2006-02-15T10:09:17', 1), - ('44', '2006-02-15T10:09:17', 1), - ('44', '2006-02-15T10:09:17', 2), - ('44', '2006-02-15T10:09:17', 2), - ('44', '2006-02-15T10:09:17', 1), - ('44', '2006-02-15T10:09:17', 2), - ('922', '2006-02-15T10:09:17', 1), - ('922', '2006-02-15T10:09:17', 1), - ('922', '2006-02-15T10:09:17', 2), - ('922', '2006-02-15T10:09:17', 2), - ('922', '2006-02-15T10:09:17', 2), - ('922', '2006-02-15T10:09:17', 1), - ('922', '2006-02-15T10:09:17', 2), - ('746', '2006-02-15T10:09:17', 2), - ('746', '2006-02-15T10:09:17', 2), - ('746', '2006-02-15T10:09:17', 2), - ('746', '2006-02-15T10:09:17', 1), - ('746', '2006-02-15T10:09:17', 1), - ('716', '2006-02-15T10:09:17', 1), - ('716', '2006-02-15T10:09:17', 2), - ('716', '2006-02-15T10:09:17', 2), - ('716', '2006-02-15T10:09:17', 2), - ('716', '2006-02-15T10:09:17', 1), - ('714', '2006-02-15T10:09:17', 2), - ('714', '2006-02-15T10:09:17', 2), - ('714', '2006-02-15T10:09:17', 2), - ('349', '2006-02-15T10:09:17', 1), - ('349', '2006-02-15T10:09:17', 2), - ('349', '2006-02-15T10:09:17', 1), - ('349', '2006-02-15T10:09:17', 2), - ('349', '2006-02-15T10:09:17', 1), - ('349', '2006-02-15T10:09:17', 1), - ('349', '2006-02-15T10:09:17', 2), - ('53', '2006-02-15T10:09:17', 1), - ('53', '2006-02-15T10:09:17', 1), - ('640', '2006-02-15T10:09:17', 2), - ('640', '2006-02-15T10:09:17', 2), - ('640', '2006-02-15T10:09:17', 2), - ('40', '2006-02-15T10:09:17', 2), - ('40', '2006-02-15T10:09:17', 2), - ('40', '2006-02-15T10:09:17', 2), - ('40', '2006-02-15T10:09:17', 2), - ('245', '2006-02-15T10:09:17', 1), - ('245', '2006-02-15T10:09:17', 1), - ('245', '2006-02-15T10:09:17', 2), - ('245', '2006-02-15T10:09:17', 2), - ('245', '2006-02-15T10:09:17', 2), - ('245', '2006-02-15T10:09:17', 2), - ('245', '2006-02-15T10:09:17', 1), - ('302', '2006-02-15T10:09:17', 2), - ('302', '2006-02-15T10:09:17', 2), - ('302', '2006-02-15T10:09:17', 1), - ('302', '2006-02-15T10:09:17', 1) - ) AS data(old_film_id, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."film"' - AND map0.old_id = data.old_film_id - RETURNING inventory_id - ) - SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; - - FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); - END LOOP; - - v_old_ids_inventory := ARRAY['1374', '1375', '473', '474', '475', '2279', '2278', '2280', '912', '915', '914', '913', '3064', '3065', '3063', '3062', '3823', '3824', '3822', '3621', '3622', '3617', '3616', '3620', '3618', '3619', '1207', '1206', '690', '693', '692', '691', '4262', '4264', '4261', '4263', '4420', '4418', '4416', '4421', '4417', '4419', '2978', '2977', '2976', '2979', '648', '647', '646', '644', '645', '3484', '3488', '3489', '3491', '3486', '3487', '3485', '3490', '1014', '1012', '1013', '1015', '1011', '1', '4', '8', '5', '2', '6', '7', '3', '910', '909', '911', '2630', '2632', '2631', '4504', '4503', '4505', '2007', '2010', '2008', '2009', '2006', '2011', '291', '293', '292', '2174', '2175', '2173', '3896', '3898', '3901', '3897', '3899', '3900', '2151']; - WITH inserted AS ( - INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") - SELECT - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - ('302', '2006-02-15T10:09:17', 2), - ('302', '2006-02-15T10:09:17', 2), - ('104', '2006-02-15T10:09:17', 2), - ('104', '2006-02-15T10:09:17', 2), - ('104', '2006-02-15T10:09:17', 2), - ('493', '2006-02-15T10:09:17', 2), - ('493', '2006-02-15T10:09:17', 2), - ('493', '2006-02-15T10:09:17', 2), - ('203', '2006-02-15T10:09:17', 2), - ('203', '2006-02-15T10:09:17', 2), - ('203', '2006-02-15T10:09:17', 2), - ('203', '2006-02-15T10:09:17', 2), - ('673', '2006-02-15T10:09:17', 2), - ('673', '2006-02-15T10:09:17', 2), - ('673', '2006-02-15T10:09:17', 1), - ('673', '2006-02-15T10:09:17', 1), - ('837', '2006-02-15T10:09:17', 2), - ('837', '2006-02-15T10:09:17', 2), - ('837', '2006-02-15T10:09:17', 2), - ('790', '2006-02-15T10:09:17', 2), - ('790', '2006-02-15T10:09:17', 2), - ('790', '2006-02-15T10:09:17', 1), - ('790', '2006-02-15T10:09:17', 1), - ('790', '2006-02-15T10:09:17', 2), - ('790', '2006-02-15T10:09:17', 1), - ('790', '2006-02-15T10:09:17', 1), - ('268', '2006-02-15T10:09:17', 2), - ('268', '2006-02-15T10:09:17', 2), - ('151', '2006-02-15T10:09:17', 1), - ('151', '2006-02-15T10:09:17', 2), - ('151', '2006-02-15T10:09:17', 2), - ('151', '2006-02-15T10:09:17', 1), - ('927', '2006-02-15T10:09:17', 1), - ('927', '2006-02-15T10:09:17', 1), - ('927', '2006-02-15T10:09:17', 1), - ('927', '2006-02-15T10:09:17', 1), - ('966', '2006-02-15T10:09:17', 2), - ('966', '2006-02-15T10:09:17', 2), - ('966', '2006-02-15T10:09:17', 1), - ('966', '2006-02-15T10:09:17', 2), - ('966', '2006-02-15T10:09:17', 1), - ('966', '2006-02-15T10:09:17', 2), - ('652', '2006-02-15T10:09:17', 1), - ('652', '2006-02-15T10:09:17', 1), - ('652', '2006-02-15T10:09:17', 1), - ('652', '2006-02-15T10:09:17', 1), - ('140', '2006-02-15T10:09:17', 2), - ('140', '2006-02-15T10:09:17', 2), - ('140', '2006-02-15T10:09:17', 2), - ('140', '2006-02-15T10:09:17', 1), - ('140', '2006-02-15T10:09:17', 1), - ('764', '2006-02-15T10:09:17', 1), - ('764', '2006-02-15T10:09:17', 2), - ('764', '2006-02-15T10:09:17', 2), - ('764', '2006-02-15T10:09:17', 2), - ('764', '2006-02-15T10:09:17', 1), - ('764', '2006-02-15T10:09:17', 1), - ('764', '2006-02-15T10:09:17', 1), - ('764', '2006-02-15T10:09:17', 2), - ('227', '2006-02-15T10:09:17', 2), - ('227', '2006-02-15T10:09:17', 1), - ('227', '2006-02-15T10:09:17', 1), - ('227', '2006-02-15T10:09:17', 2), - ('227', '2006-02-15T10:09:17', 1), - ('1', '2006-02-15T10:09:17', 1), - ('1', '2006-02-15T10:09:17', 1), - ('1', '2006-02-15T10:09:17', 2), - ('1', '2006-02-15T10:09:17', 2), - ('1', '2006-02-15T10:09:17', 1), - ('1', '2006-02-15T10:09:17', 2), - ('1', '2006-02-15T10:09:17', 2), - ('1', '2006-02-15T10:09:17', 1), - ('202', '2006-02-15T10:09:17', 1), - ('202', '2006-02-15T10:09:17', 1), - ('202', '2006-02-15T10:09:17', 1), - ('577', '2006-02-15T10:09:17', 1), - ('577', '2006-02-15T10:09:17', 1), - ('577', '2006-02-15T10:09:17', 1), - ('983', '2006-02-15T10:09:17', 1), - ('983', '2006-02-15T10:09:17', 1), - ('983', '2006-02-15T10:09:17', 1), - ('437', '2006-02-15T10:09:17', 1), - ('437', '2006-02-15T10:09:17', 2), - ('437', '2006-02-15T10:09:17', 2), - ('437', '2006-02-15T10:09:17', 2), - ('437', '2006-02-15T10:09:17', 1), - ('437', '2006-02-15T10:09:17', 2), - ('66', '2006-02-15T10:09:17', 1), - ('66', '2006-02-15T10:09:17', 1), - ('66', '2006-02-15T10:09:17', 1), - ('469', '2006-02-15T10:09:17', 2), - ('469', '2006-02-15T10:09:17', 2), - ('469', '2006-02-15T10:09:17', 2), - ('851', '2006-02-15T10:09:17', 1), - ('851', '2006-02-15T10:09:17', 1), - ('851', '2006-02-15T10:09:17', 2), - ('851', '2006-02-15T10:09:17', 1), - ('851', '2006-02-15T10:09:17', 2), - ('851', '2006-02-15T10:09:17', 2), - ('465', '2006-02-15T10:09:17', 1) - ) AS data(old_film_id, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."film"' - AND map0.old_id = data.old_film_id - RETURNING inventory_id - ) - SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; - - FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); - END LOOP; - - v_old_ids_inventory := ARRAY['2152', '2154', '2153', '2155', '1340', '1335', '1336', '1342', '1337', '1341', '1339', '1338', '2265', '2260', '2267', '2264', '2263', '2261', '2266', '2262', '1170', '1169', '681', '683', '679', '682', '680', '678', '2367', '2366', '1841', '1842', '2376', '2377', '2374', '2378', '2373', '2375', '2561', '2560', '2559', '2562', '2746', '2744', '2745', '2743', '2747', '1292', '1289', '1294', '1288', '1290', '1293', '1291', '139', '140', '141', '3707', '3708', '3709', '3198', '3199', '3195', '3193', '3197', '3194', '3192', '3196', '3463', '3461', '3462', '3460', '3464', '3459', '3161', '3163', '3159', '3162', '3160', '3164', '1567', '1569', '1568', '1566', '1565', '1196', '1195', '1193', '1197', '1194', '1198', '1192', '1199', '2269', '2268', '2026', '2023', '2025', '2024', '4057']; - WITH inserted AS ( - INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") - SELECT - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - ('465', '2006-02-15T10:09:17', 1), - ('465', '2006-02-15T10:09:17', 2), - ('465', '2006-02-15T10:09:17', 2), - ('465', '2006-02-15T10:09:17', 2), - ('295', '2006-02-15T10:09:17', 2), - ('295', '2006-02-15T10:09:17', 1), - ('295', '2006-02-15T10:09:17', 1), - ('295', '2006-02-15T10:09:17', 2), - ('295', '2006-02-15T10:09:17', 1), - ('295', '2006-02-15T10:09:17', 2), - ('295', '2006-02-15T10:09:17', 2), - ('295', '2006-02-15T10:09:17', 1), - ('489', '2006-02-15T10:09:17', 2), - ('489', '2006-02-15T10:09:17', 1), - ('489', '2006-02-15T10:09:17', 2), - ('489', '2006-02-15T10:09:17', 2), - ('489', '2006-02-15T10:09:17', 1), - ('489', '2006-02-15T10:09:17', 1), - ('489', '2006-02-15T10:09:17', 2), - ('489', '2006-02-15T10:09:17', 1), - ('259', '2006-02-15T10:09:17', 1), - ('259', '2006-02-15T10:09:17', 1), - ('149', '2006-02-15T10:09:17', 2), - ('149', '2006-02-15T10:09:17', 2), - ('149', '2006-02-15T10:09:17', 1), - ('149', '2006-02-15T10:09:17', 2), - ('149', '2006-02-15T10:09:17', 1), - ('149', '2006-02-15T10:09:17', 1), - ('515', '2006-02-15T10:09:17', 2), - ('515', '2006-02-15T10:09:17', 2), - ('401', '2006-02-15T10:09:17', 1), - ('401', '2006-02-15T10:09:17', 1), - ('518', '2006-02-15T10:09:17', 2), - ('518', '2006-02-15T10:09:17', 2), - ('518', '2006-02-15T10:09:17', 1), - ('518', '2006-02-15T10:09:17', 2), - ('518', '2006-02-15T10:09:17', 1), - ('518', '2006-02-15T10:09:17', 2), - ('561', '2006-02-15T10:09:17', 1), - ('561', '2006-02-15T10:09:17', 1), - ('561', '2006-02-15T10:09:17', 1), - ('561', '2006-02-15T10:09:17', 1), - ('602', '2006-02-15T10:09:17', 2), - ('602', '2006-02-15T10:09:17', 1), - ('602', '2006-02-15T10:09:17', 2), - ('602', '2006-02-15T10:09:17', 1), - ('602', '2006-02-15T10:09:17', 2), - ('285', '2006-02-15T10:09:17', 2), - ('285', '2006-02-15T10:09:17', 1), - ('285', '2006-02-15T10:09:17', 2), - ('285', '2006-02-15T10:09:17', 1), - ('285', '2006-02-15T10:09:17', 1), - ('285', '2006-02-15T10:09:17', 2), - ('285', '2006-02-15T10:09:17', 2), - ('28', '2006-02-15T10:09:17', 1), - ('28', '2006-02-15T10:09:17', 1), - ('28', '2006-02-15T10:09:17', 1), - ('811', '2006-02-15T10:09:17', 1), - ('811', '2006-02-15T10:09:17', 1), - ('811', '2006-02-15T10:09:17', 1), - ('702', '2006-02-15T10:09:17', 2), - ('702', '2006-02-15T10:09:17', 2), - ('702', '2006-02-15T10:09:17', 1), - ('702', '2006-02-15T10:09:17', 1), - ('702', '2006-02-15T10:09:17', 2), - ('702', '2006-02-15T10:09:17', 1), - ('702', '2006-02-15T10:09:17', 1), - ('702', '2006-02-15T10:09:17', 2), - ('759', '2006-02-15T10:09:17', 2), - ('759', '2006-02-15T10:09:17', 2), - ('759', '2006-02-15T10:09:17', 2), - ('759', '2006-02-15T10:09:17', 1), - ('759', '2006-02-15T10:09:17', 2), - ('759', '2006-02-15T10:09:17', 1), - ('694', '2006-02-15T10:09:17', 1), - ('694', '2006-02-15T10:09:17', 2), - ('694', '2006-02-15T10:09:17', 1), - ('694', '2006-02-15T10:09:17', 1), - ('694', '2006-02-15T10:09:17', 1), - ('694', '2006-02-15T10:09:17', 2), - ('344', '2006-02-15T10:09:17', 1), - ('344', '2006-02-15T10:09:17', 2), - ('344', '2006-02-15T10:09:17', 2), - ('344', '2006-02-15T10:09:17', 1), - ('344', '2006-02-15T10:09:17', 1), - ('266', '2006-02-15T10:09:17', 2), - ('266', '2006-02-15T10:09:17', 1), - ('266', '2006-02-15T10:09:17', 1), - ('266', '2006-02-15T10:09:17', 2), - ('266', '2006-02-15T10:09:17', 1), - ('266', '2006-02-15T10:09:17', 2), - ('266', '2006-02-15T10:09:17', 1), - ('266', '2006-02-15T10:09:17', 2), - ('490', '2006-02-15T10:09:17', 1), - ('490', '2006-02-15T10:09:17', 1), - ('440', '2006-02-15T10:09:17', 2), - ('440', '2006-02-15T10:09:17', 1), - ('440', '2006-02-15T10:09:17', 2), - ('440', '2006-02-15T10:09:17', 1), - ('883', '2006-02-15T10:09:17', 2) - ) AS data(old_film_id, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."film"' - AND map0.old_id = data.old_film_id - RETURNING inventory_id - ) - SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; - - FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); - END LOOP; - - v_old_ids_inventory := ARRAY['4056', '1302', '1303', '1300', '1301', '4371', '4373', '4370', '4374', '4372', '4369', '1767', '1769', '1766', '1765', '1768', '3260', '3259', '3261', '3258', '1495', '1496', '1491', '1493', '1492', '1494', '1066', '1065', '4441', '4444', '4442', '4443', '1797', '1799', '1798', '1800', '1801', '1803', '1802', '1180', '1179', '1184', '1183', '1185', '1182', '1181', '253', '259', '258', '256', '257', '255', '254', '3589', '3590', '3593', '3592', '3588', '3591', '599', '597', '594', '595', '598', '596', '3423', '3425', '3424', '209', '207', '208', '1721', '1720', '2496', '2497', '4186', '4188', '4183', '4184', '4185', '4181', '4187', '4182', '2584', '2585', '2583', '2586', '2863', '2861', '2862', '2230', '2228', '2229', '2204', '2202', '2199', '2200', '2198', '2201', '2203']; - WITH inserted AS ( - INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") - SELECT - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - ('883', '2006-02-15T10:09:17', 2), - ('287', '2006-02-15T10:09:17', 2), - ('287', '2006-02-15T10:09:17', 2), - ('287', '2006-02-15T10:09:17', 1), - ('287', '2006-02-15T10:09:17', 1), - ('953', '2006-02-15T10:09:17', 1), - ('953', '2006-02-15T10:09:17', 2), - ('953', '2006-02-15T10:09:17', 1), - ('953', '2006-02-15T10:09:17', 2), - ('953', '2006-02-15T10:09:17', 1), - ('953', '2006-02-15T10:09:17', 1), - ('383', '2006-02-15T10:09:17', 1), - ('383', '2006-02-15T10:09:17', 2), - ('383', '2006-02-15T10:09:17', 1), - ('383', '2006-02-15T10:09:17', 1), - ('383', '2006-02-15T10:09:17', 2), - ('717', '2006-02-15T10:09:17', 2), - ('717', '2006-02-15T10:09:17', 1), - ('717', '2006-02-15T10:09:17', 2), - ('717', '2006-02-15T10:09:17', 1), - ('327', '2006-02-15T10:09:17', 2), - ('327', '2006-02-15T10:09:17', 2), - ('327', '2006-02-15T10:09:17', 1), - ('327', '2006-02-15T10:09:17', 1), - ('327', '2006-02-15T10:09:17', 1), - ('327', '2006-02-15T10:09:17', 1), - ('237', '2006-02-15T10:09:17', 1), - ('237', '2006-02-15T10:09:17', 1), - ('971', '2006-02-15T10:09:17', 1), - ('971', '2006-02-15T10:09:17', 1), - ('971', '2006-02-15T10:09:17', 1), - ('971', '2006-02-15T10:09:17', 1), - ('391', '2006-02-15T10:09:17', 1), - ('391', '2006-02-15T10:09:17', 1), - ('391', '2006-02-15T10:09:17', 1), - ('391', '2006-02-15T10:09:17', 1), - ('391', '2006-02-15T10:09:17', 2), - ('391', '2006-02-15T10:09:17', 2), - ('391', '2006-02-15T10:09:17', 2), - ('263', '2006-02-15T10:09:17', 1), - ('263', '2006-02-15T10:09:17', 1), - ('263', '2006-02-15T10:09:17', 2), - ('263', '2006-02-15T10:09:17', 2), - ('263', '2006-02-15T10:09:17', 2), - ('263', '2006-02-15T10:09:17', 1), - ('263', '2006-02-15T10:09:17', 1), - ('57', '2006-02-15T10:09:17', 1), - ('57', '2006-02-15T10:09:17', 2), - ('57', '2006-02-15T10:09:17', 2), - ('57', '2006-02-15T10:09:17', 1), - ('57', '2006-02-15T10:09:17', 2), - ('57', '2006-02-15T10:09:17', 1), - ('57', '2006-02-15T10:09:17', 1), - ('785', '2006-02-15T10:09:17', 1), - ('785', '2006-02-15T10:09:17', 1), - ('785', '2006-02-15T10:09:17', 2), - ('785', '2006-02-15T10:09:17', 2), - ('785', '2006-02-15T10:09:17', 1), - ('785', '2006-02-15T10:09:17', 1), - ('130', '2006-02-15T10:09:17', 2), - ('130', '2006-02-15T10:09:17', 2), - ('130', '2006-02-15T10:09:17', 1), - ('130', '2006-02-15T10:09:17', 1), - ('130', '2006-02-15T10:09:17', 2), - ('130', '2006-02-15T10:09:17', 2), - ('750', '2006-02-15T10:09:17', 1), - ('750', '2006-02-15T10:09:17', 1), - ('750', '2006-02-15T10:09:17', 1), - ('46', '2006-02-15T10:09:17', 2), - ('46', '2006-02-15T10:09:17', 2), - ('46', '2006-02-15T10:09:17', 2), - ('375', '2006-02-15T10:09:17', 1), - ('375', '2006-02-15T10:09:17', 1), - ('548', '2006-02-15T10:09:17', 1), - ('548', '2006-02-15T10:09:17', 1), - ('911', '2006-02-15T10:09:17', 2), - ('911', '2006-02-15T10:09:17', 2), - ('911', '2006-02-15T10:09:17', 1), - ('911', '2006-02-15T10:09:17', 1), - ('911', '2006-02-15T10:09:17', 2), - ('911', '2006-02-15T10:09:17', 1), - ('911', '2006-02-15T10:09:17', 2), - ('911', '2006-02-15T10:09:17', 1), - ('567', '2006-02-15T10:09:17', 1), - ('567', '2006-02-15T10:09:17', 2), - ('567', '2006-02-15T10:09:17', 1), - ('567', '2006-02-15T10:09:17', 2), - ('627', '2006-02-15T10:09:17', 2), - ('627', '2006-02-15T10:09:17', 2), - ('627', '2006-02-15T10:09:17', 2), - ('482', '2006-02-15T10:09:17', 1), - ('482', '2006-02-15T10:09:17', 1), - ('482', '2006-02-15T10:09:17', 1), - ('476', '2006-02-15T10:09:17', 2), - ('476', '2006-02-15T10:09:17', 2), - ('476', '2006-02-15T10:09:17', 1), - ('476', '2006-02-15T10:09:17', 1), - ('476', '2006-02-15T10:09:17', 1), - ('476', '2006-02-15T10:09:17', 2), - ('476', '2006-02-15T10:09:17', 2) - ) AS data(old_film_id, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."film"' - AND map0.old_id = data.old_film_id - RETURNING inventory_id - ) - SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; - - FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); - END LOOP; - - v_old_ids_inventory := ARRAY['4166', '4167', '4169', '4170', '4168', '3940', '3942', '3941', '3939', '3943', '3944', '3066', '3067', '3068', '49', '47', '51', '50', '46', '52', '48', '2224', '2226', '2225', '2223', '2227', '2222', '1928', '1923', '1929', '1926', '1925', '1927', '1930', '1924', '1359', '1361', '1360', '1358', '1362', '1363', '3821', '3820', '3819', '4050', '4049', '4051', '4048', '2785', '2784', '2786', '2788', '2787', '2789', '2097', '2099', '2096', '2098', '2472', '2476', '2473', '2475', '2474', '2477', '4285', '4286', '4287', '4224', '4222', '4225', '4223', '167', '170', '168', '171', '169', '172', '173', '2591', '2592', '1235', '1236', '1232', '1233', '1234', '1231', '1230', '1270', '1268', '1267', '1269', '1271', '1266', '4180', '4179', '2463', '2462', '2464', '382', '379']; - WITH inserted AS ( - INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") - SELECT - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - ('906', '2006-02-15T10:09:17', 1), - ('906', '2006-02-15T10:09:17', 1), - ('906', '2006-02-15T10:09:17', 2), - ('906', '2006-02-15T10:09:17', 2), - ('906', '2006-02-15T10:09:17', 2), - ('859', '2006-02-15T10:09:17', 1), - ('859', '2006-02-15T10:09:17', 2), - ('859', '2006-02-15T10:09:17', 1), - ('859', '2006-02-15T10:09:17', 1), - ('859', '2006-02-15T10:09:17', 2), - ('859', '2006-02-15T10:09:17', 2), - ('674', '2006-02-15T10:09:17', 1), - ('674', '2006-02-15T10:09:17', 1), - ('674', '2006-02-15T10:09:17', 1), - ('10', '2006-02-15T10:09:17', 1), - ('10', '2006-02-15T10:09:17', 1), - ('10', '2006-02-15T10:09:17', 2), - ('10', '2006-02-15T10:09:17', 2), - ('10', '2006-02-15T10:09:17', 1), - ('10', '2006-02-15T10:09:17', 2), - ('10', '2006-02-15T10:09:17', 1), - ('481', '2006-02-15T10:09:17', 1), - ('481', '2006-02-15T10:09:17', 2), - ('481', '2006-02-15T10:09:17', 2), - ('481', '2006-02-15T10:09:17', 1), - ('481', '2006-02-15T10:09:17', 2), - ('481', '2006-02-15T10:09:17', 1), - ('418', '2006-02-15T10:09:17', 2), - ('418', '2006-02-15T10:09:17', 1), - ('418', '2006-02-15T10:09:17', 2), - ('418', '2006-02-15T10:09:17', 1), - ('418', '2006-02-15T10:09:17', 1), - ('418', '2006-02-15T10:09:17', 2), - ('418', '2006-02-15T10:09:17', 2), - ('418', '2006-02-15T10:09:17', 1), - ('300', '2006-02-15T10:09:17', 1), - ('300', '2006-02-15T10:09:17', 2), - ('300', '2006-02-15T10:09:17', 2), - ('300', '2006-02-15T10:09:17', 1), - ('300', '2006-02-15T10:09:17', 2), - ('300', '2006-02-15T10:09:17', 2), - ('836', '2006-02-15T10:09:17', 1), - ('836', '2006-02-15T10:09:17', 1), - ('836', '2006-02-15T10:09:17', 1), - ('881', '2006-02-15T10:09:17', 2), - ('881', '2006-02-15T10:09:17', 2), - ('881', '2006-02-15T10:09:17', 2), - ('881', '2006-02-15T10:09:17', 2), - ('611', '2006-02-15T10:09:17', 1), - ('611', '2006-02-15T10:09:17', 1), - ('611', '2006-02-15T10:09:17', 1), - ('611', '2006-02-15T10:09:17', 2), - ('611', '2006-02-15T10:09:17', 1), - ('611', '2006-02-15T10:09:17', 2), - ('455', '2006-02-15T10:09:17', 1), - ('455', '2006-02-15T10:09:17', 1), - ('455', '2006-02-15T10:09:17', 1), - ('455', '2006-02-15T10:09:17', 1), - ('542', '2006-02-15T10:09:17', 1), - ('542', '2006-02-15T10:09:17', 2), - ('542', '2006-02-15T10:09:17', 1), - ('542', '2006-02-15T10:09:17', 1), - ('542', '2006-02-15T10:09:17', 1), - ('542', '2006-02-15T10:09:17', 2), - ('933', '2006-02-15T10:09:17', 1), - ('933', '2006-02-15T10:09:17', 1), - ('933', '2006-02-15T10:09:17', 1), - ('918', '2006-02-15T10:09:17', 2), - ('918', '2006-02-15T10:09:17', 2), - ('918', '2006-02-15T10:09:17', 2), - ('918', '2006-02-15T10:09:17', 2), - ('37', '2006-02-15T10:09:17', 1), - ('37', '2006-02-15T10:09:17', 1), - ('37', '2006-02-15T10:09:17', 1), - ('37', '2006-02-15T10:09:17', 2), - ('37', '2006-02-15T10:09:17', 1), - ('37', '2006-02-15T10:09:17', 2), - ('37', '2006-02-15T10:09:17', 2), - ('569', '2006-02-15T10:09:17', 1), - ('569', '2006-02-15T10:09:17', 1), - ('273', '2006-02-15T10:09:17', 2), - ('273', '2006-02-15T10:09:17', 2), - ('273', '2006-02-15T10:09:17', 1), - ('273', '2006-02-15T10:09:17', 1), - ('273', '2006-02-15T10:09:17', 2), - ('273', '2006-02-15T10:09:17', 1), - ('273', '2006-02-15T10:09:17', 1), - ('281', '2006-02-15T10:09:17', 2), - ('281', '2006-02-15T10:09:17', 2), - ('281', '2006-02-15T10:09:17', 1), - ('281', '2006-02-15T10:09:17', 2), - ('281', '2006-02-15T10:09:17', 2), - ('281', '2006-02-15T10:09:17', 1), - ('910', '2006-02-15T10:09:17', 2), - ('910', '2006-02-15T10:09:17', 2), - ('538', '2006-02-15T10:09:17', 2), - ('538', '2006-02-15T10:09:17', 2), - ('538', '2006-02-15T10:09:17', 2), - ('84', '2006-02-15T10:09:17', 1), - ('84', '2006-02-15T10:09:17', 1) - ) AS data(old_film_id, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."film"' - AND map0.old_id = data.old_film_id - RETURNING inventory_id - ) - SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; - - FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); - END LOOP; - - v_old_ids_inventory := ARRAY['380', '381', '1347', '1348', '1161', '1160', '1159', '3165', '3166', '2164', '2160', '2162', '2163', '2159', '2158', '2161', '1953', '1955', '1954', '2186', '2185', '3926', '3924', '3922', '3923', '3925', '3920', '3927', '3921', '1309', '1307', '1304', '1308', '1306', '1305', '3802', '3801', '3806', '3803', '3804', '3807', '3805', '4536', '4537', '4324', '4325', '4326', '4327', '3915', '3914', '3913', '3912', '2880', '2879', '2876', '2877', '2878', '576', '575', '145', '144', '3736', '3735', '3731', '3733', '3730', '3734', '3732', '621', '622', '620', '624', '619', '625', '623', '2192', '2195', '2194', '2193', '2243', '2244', '2245', '222', '223', '226', '225', '224', '2513', '2512', '2511', '2514', '971', '970', '969', '973', '972', '1111', '1110', '1109', '1853']; - WITH inserted AS ( - INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") - SELECT - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - ('84', '2006-02-15T10:09:17', 1), - ('84', '2006-02-15T10:09:17', 1), - ('297', '2006-02-15T10:09:17', 2), - ('297', '2006-02-15T10:09:17', 2), - ('256', '2006-02-15T10:09:17', 2), - ('256', '2006-02-15T10:09:17', 2), - ('256', '2006-02-15T10:09:17', 2), - ('695', '2006-02-15T10:09:17', 1), - ('695', '2006-02-15T10:09:17', 1), - ('467', '2006-02-15T10:09:17', 2), - ('467', '2006-02-15T10:09:17', 1), - ('467', '2006-02-15T10:09:17', 2), - ('467', '2006-02-15T10:09:17', 2), - ('467', '2006-02-15T10:09:17', 1), - ('467', '2006-02-15T10:09:17', 1), - ('467', '2006-02-15T10:09:17', 1), - ('426', '2006-02-15T10:09:17', 2), - ('426', '2006-02-15T10:09:17', 2), - ('426', '2006-02-15T10:09:17', 2), - ('472', '2006-02-15T10:09:17', 2), - ('472', '2006-02-15T10:09:17', 2), - ('856', '2006-02-15T10:09:17', 2), - ('856', '2006-02-15T10:09:17', 2), - ('856', '2006-02-15T10:09:17', 1), - ('856', '2006-02-15T10:09:17', 1), - ('856', '2006-02-15T10:09:17', 2), - ('856', '2006-02-15T10:09:17', 1), - ('856', '2006-02-15T10:09:17', 2), - ('856', '2006-02-15T10:09:17', 1), - ('288', '2006-02-15T10:09:17', 2), - ('288', '2006-02-15T10:09:17', 2), - ('288', '2006-02-15T10:09:17', 1), - ('288', '2006-02-15T10:09:17', 2), - ('288', '2006-02-15T10:09:17', 2), - ('288', '2006-02-15T10:09:17', 1), - ('833', '2006-02-15T10:09:17', 1), - ('833', '2006-02-15T10:09:17', 1), - ('833', '2006-02-15T10:09:17', 2), - ('833', '2006-02-15T10:09:17', 1), - ('833', '2006-02-15T10:09:17', 2), - ('833', '2006-02-15T10:09:17', 2), - ('833', '2006-02-15T10:09:17', 2), - ('990', '2006-02-15T10:09:17', 2), - ('990', '2006-02-15T10:09:17', 2), - ('942', '2006-02-15T10:09:17', 1), - ('942', '2006-02-15T10:09:17', 1), - ('942', '2006-02-15T10:09:17', 2), - ('942', '2006-02-15T10:09:17', 2), - ('854', '2006-02-15T10:09:17', 2), - ('854', '2006-02-15T10:09:17', 2), - ('854', '2006-02-15T10:09:17', 2), - ('854', '2006-02-15T10:09:17', 2), - ('631', '2006-02-15T10:09:17', 2), - ('631', '2006-02-15T10:09:17', 2), - ('631', '2006-02-15T10:09:17', 1), - ('631', '2006-02-15T10:09:17', 1), - ('631', '2006-02-15T10:09:17', 1), - ('125', '2006-02-15T10:09:17', 2), - ('125', '2006-02-15T10:09:17', 2), - ('30', '2006-02-15T10:09:17', 1), - ('30', '2006-02-15T10:09:17', 1), - ('816', '2006-02-15T10:09:17', 2), - ('816', '2006-02-15T10:09:17', 2), - ('816', '2006-02-15T10:09:17', 1), - ('816', '2006-02-15T10:09:17', 1), - ('816', '2006-02-15T10:09:17', 1), - ('816', '2006-02-15T10:09:17', 2), - ('816', '2006-02-15T10:09:17', 1), - ('135', '2006-02-15T10:09:17', 1), - ('135', '2006-02-15T10:09:17', 2), - ('135', '2006-02-15T10:09:17', 1), - ('135', '2006-02-15T10:09:17', 2), - ('135', '2006-02-15T10:09:17', 1), - ('135', '2006-02-15T10:09:17', 2), - ('135', '2006-02-15T10:09:17', 2), - ('474', '2006-02-15T10:09:17', 2), - ('474', '2006-02-15T10:09:17', 2), - ('474', '2006-02-15T10:09:17', 2), - ('474', '2006-02-15T10:09:17', 2), - ('485', '2006-02-15T10:09:17', 2), - ('485', '2006-02-15T10:09:17', 2), - ('485', '2006-02-15T10:09:17', 2), - ('50', '2006-02-15T10:09:17', 1), - ('50', '2006-02-15T10:09:17', 1), - ('50', '2006-02-15T10:09:17', 2), - ('50', '2006-02-15T10:09:17', 2), - ('50', '2006-02-15T10:09:17', 1), - ('552', '2006-02-15T10:09:17', 2), - ('552', '2006-02-15T10:09:17', 2), - ('552', '2006-02-15T10:09:17', 2), - ('552', '2006-02-15T10:09:17', 2), - ('216', '2006-02-15T10:09:17', 2), - ('216', '2006-02-15T10:09:17', 1), - ('216', '2006-02-15T10:09:17', 1), - ('216', '2006-02-15T10:09:17', 2), - ('216', '2006-02-15T10:09:17', 2), - ('246', '2006-02-15T10:09:17', 2), - ('246', '2006-02-15T10:09:17', 2), - ('246', '2006-02-15T10:09:17', 2), - ('403', '2006-02-15T10:09:17', 2) - ) AS data(old_film_id, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."film"' - AND map0.old_id = data.old_film_id - RETURNING inventory_id - ) - SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; - - FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); - END LOOP; - - v_old_ids_inventory := ARRAY['1855', '1856', '1854', '1851', '1852', '1849', '1850', '793', '790', '792', '791', '794', '3536', '3531', '3538', '3534', '3537', '3532', '3535', '3533', '2317', '2318', '2316', '1412', '1415', '1411', '1410', '1413', '1414', '4266', '4267', '4265', '1441', '1440', '1442', '3115', '3116', '1941', '1940', '424', '423', '425', '1622', '1623', '1624', '1620', '1621', '4563', '4564', '3241', '3240', '3239', '3242', '574', '573', '572', '928', '929', '926', '931', '933', '930', '932', '927', '1477', '1478', '1479', '1476', '2090', '2089', '2092', '2093', '2091', '1258', '1259', '3415', '3418', '3411', '3412', '3414', '3417', '3413', '3416', '4577', '4579', '4581', '4576', '4578', '4580', '4574', '4575', '4103', '4104', '4101', '4107', '4108', '4105', '4106', '4102', '1963']; - WITH inserted AS ( - INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") - SELECT - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - ('403', '2006-02-15T10:09:17', 2), - ('403', '2006-02-15T10:09:17', 2), - ('403', '2006-02-15T10:09:17', 2), - ('403', '2006-02-15T10:09:17', 1), - ('403', '2006-02-15T10:09:17', 1), - ('403', '2006-02-15T10:09:17', 1), - ('403', '2006-02-15T10:09:17', 1), - ('173', '2006-02-15T10:09:17', 2), - ('173', '2006-02-15T10:09:17', 1), - ('173', '2006-02-15T10:09:17', 1), - ('173', '2006-02-15T10:09:17', 1), - ('173', '2006-02-15T10:09:17', 2), - ('773', '2006-02-15T10:09:17', 2), - ('773', '2006-02-15T10:09:17', 1), - ('773', '2006-02-15T10:09:17', 2), - ('773', '2006-02-15T10:09:17', 1), - ('773', '2006-02-15T10:09:17', 2), - ('773', '2006-02-15T10:09:17', 1), - ('773', '2006-02-15T10:09:17', 2), - ('773', '2006-02-15T10:09:17', 1), - ('503', '2006-02-15T10:09:17', 1), - ('503', '2006-02-15T10:09:17', 1), - ('503', '2006-02-15T10:09:17', 1), - ('309', '2006-02-15T10:09:17', 2), - ('309', '2006-02-15T10:09:17', 2), - ('309', '2006-02-15T10:09:17', 1), - ('309', '2006-02-15T10:09:17', 1), - ('309', '2006-02-15T10:09:17', 2), - ('309', '2006-02-15T10:09:17', 2), - ('928', '2006-02-15T10:09:17', 1), - ('928', '2006-02-15T10:09:17', 1), - ('928', '2006-02-15T10:09:17', 1), - ('315', '2006-02-15T10:09:17', 2), - ('315', '2006-02-15T10:09:17', 2), - ('315', '2006-02-15T10:09:17', 2), - ('684', '2006-02-15T10:09:17', 2), - ('684', '2006-02-15T10:09:17', 2), - ('422', '2006-02-15T10:09:17', 2), - ('422', '2006-02-15T10:09:17', 2), - ('93', '2006-02-15T10:09:17', 2), - ('93', '2006-02-15T10:09:17', 2), - ('93', '2006-02-15T10:09:17', 2), - ('354', '2006-02-15T10:09:17', 1), - ('354', '2006-02-15T10:09:17', 2), - ('354', '2006-02-15T10:09:17', 2), - ('354', '2006-02-15T10:09:17', 1), - ('354', '2006-02-15T10:09:17', 1), - ('996', '2006-02-15T10:09:17', 1), - ('996', '2006-02-15T10:09:17', 1), - ('711', '2006-02-15T10:09:17', 2), - ('711', '2006-02-15T10:09:17', 2), - ('711', '2006-02-15T10:09:17', 2), - ('711', '2006-02-15T10:09:17', 2), - ('124', '2006-02-15T10:09:17', 2), - ('124', '2006-02-15T10:09:17', 2), - ('124', '2006-02-15T10:09:17', 2), - ('206', '2006-02-15T10:09:17', 1), - ('206', '2006-02-15T10:09:17', 1), - ('206', '2006-02-15T10:09:17', 1), - ('206', '2006-02-15T10:09:17', 2), - ('206', '2006-02-15T10:09:17', 2), - ('206', '2006-02-15T10:09:17', 2), - ('206', '2006-02-15T10:09:17', 2), - ('206', '2006-02-15T10:09:17', 1), - ('323', '2006-02-15T10:09:17', 2), - ('323', '2006-02-15T10:09:17', 2), - ('323', '2006-02-15T10:09:17', 2), - ('323', '2006-02-15T10:09:17', 2), - ('453', '2006-02-15T10:09:17', 1), - ('453', '2006-02-15T10:09:17', 1), - ('453', '2006-02-15T10:09:17', 2), - ('453', '2006-02-15T10:09:17', 2), - ('453', '2006-02-15T10:09:17', 1), - ('279', '2006-02-15T10:09:17', 1), - ('279', '2006-02-15T10:09:17', 1), - ('748', '2006-02-15T10:09:17', 2), - ('748', '2006-02-15T10:09:17', 2), - ('748', '2006-02-15T10:09:17', 1), - ('748', '2006-02-15T10:09:17', 1), - ('748', '2006-02-15T10:09:17', 1), - ('748', '2006-02-15T10:09:17', 2), - ('748', '2006-02-15T10:09:17', 1), - ('748', '2006-02-15T10:09:17', 2), - ('1000', '2006-02-15T10:09:17', 1), - ('1000', '2006-02-15T10:09:17', 2), - ('1000', '2006-02-15T10:09:17', 2), - ('1000', '2006-02-15T10:09:17', 1), - ('1000', '2006-02-15T10:09:17', 2), - ('1000', '2006-02-15T10:09:17', 2), - ('1000', '2006-02-15T10:09:17', 1), - ('1000', '2006-02-15T10:09:17', 1), - ('893', '2006-02-15T10:09:17', 1), - ('893', '2006-02-15T10:09:17', 1), - ('893', '2006-02-15T10:09:17', 1), - ('893', '2006-02-15T10:09:17', 2), - ('893', '2006-02-15T10:09:17', 2), - ('893', '2006-02-15T10:09:17', 2), - ('893', '2006-02-15T10:09:17', 2), - ('893', '2006-02-15T10:09:17', 1), - ('428', '2006-02-15T10:09:17', 1) - ) AS data(old_film_id, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."film"' - AND map0.old_id = data.old_film_id - RETURNING inventory_id - ) - SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; - - FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); - END LOOP; - - v_old_ids_inventory := ARRAY['1965', '1960', '1961', '1964', '1962', '4438', '4434', '4437', '4440', '4435', '4439', '4436', '2480', '2482', '2481', '2483', '1067', '1068', '2683', '2684', '2685', '2682', '2292', '2293', '278', '279', '667', '666', '668', '2460', '2461', '2459', '1295', '1297', '1298', '1296', '1299', '824', '823', '4429', '4427', '4428', '887', '888', '3887', '3881', '3885', '3884', '3882', '3883', '3886', '3888', '1468', '1466', '1469', '1467', '3833', '3835', '3834', '3836', '108', '113', '110', '112', '111', '114', '109', '2456', '2458', '2454', '2457', '2455', '1810', '1811', '724', '728', '726', '727', '725', '730', '729', '1263', '1260', '1264', '1261', '1262', '1265', '468', '471', '469', '470', '465', '472', '466', '467', '2205', '2207', '2206', '1381', '1378']; - WITH inserted AS ( - INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") - SELECT - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - ('428', '2006-02-15T10:09:17', 2), - ('428', '2006-02-15T10:09:17', 1), - ('428', '2006-02-15T10:09:17', 1), - ('428', '2006-02-15T10:09:17', 2), - ('428', '2006-02-15T10:09:17', 1), - ('970', '2006-02-15T10:09:17', 2), - ('970', '2006-02-15T10:09:17', 1), - ('970', '2006-02-15T10:09:17', 2), - ('970', '2006-02-15T10:09:17', 2), - ('970', '2006-02-15T10:09:17', 1), - ('970', '2006-02-15T10:09:17', 2), - ('970', '2006-02-15T10:09:17', 1), - ('544', '2006-02-15T10:09:17', 1), - ('544', '2006-02-15T10:09:17', 2), - ('544', '2006-02-15T10:09:17', 1), - ('544', '2006-02-15T10:09:17', 2), - ('238', '2006-02-15T10:09:17', 1), - ('238', '2006-02-15T10:09:17', 1), - ('589', '2006-02-15T10:09:17', 2), - ('589', '2006-02-15T10:09:17', 2), - ('589', '2006-02-15T10:09:17', 2), - ('589', '2006-02-15T10:09:17', 2), - ('498', '2006-02-15T10:09:17', 1), - ('498', '2006-02-15T10:09:17', 1), - ('62', '2006-02-15T10:09:17', 2), - ('62', '2006-02-15T10:09:17', 2), - ('145', '2006-02-15T10:09:17', 2), - ('145', '2006-02-15T10:09:17', 2), - ('145', '2006-02-15T10:09:17', 2), - ('537', '2006-02-15T10:09:17', 2), - ('537', '2006-02-15T10:09:17', 2), - ('537', '2006-02-15T10:09:17', 2), - ('286', '2006-02-15T10:09:17', 1), - ('286', '2006-02-15T10:09:17', 2), - ('286', '2006-02-15T10:09:17', 2), - ('286', '2006-02-15T10:09:17', 1), - ('286', '2006-02-15T10:09:17', 2), - ('180', '2006-02-15T10:09:17', 2), - ('180', '2006-02-15T10:09:17', 2), - ('968', '2006-02-15T10:09:17', 1), - ('968', '2006-02-15T10:09:17', 1), - ('968', '2006-02-15T10:09:17', 1), - ('197', '2006-02-15T10:09:17', 1), - ('197', '2006-02-15T10:09:17', 1), - ('849', '2006-02-15T10:09:17', 2), - ('849', '2006-02-15T10:09:17', 1), - ('849', '2006-02-15T10:09:17', 2), - ('849', '2006-02-15T10:09:17', 1), - ('849', '2006-02-15T10:09:17', 1), - ('849', '2006-02-15T10:09:17', 1), - ('849', '2006-02-15T10:09:17', 2), - ('849', '2006-02-15T10:09:17', 2), - ('321', '2006-02-15T10:09:17', 1), - ('321', '2006-02-15T10:09:17', 1), - ('321', '2006-02-15T10:09:17', 1), - ('321', '2006-02-15T10:09:17', 1), - ('840', '2006-02-15T10:09:17', 1), - ('840', '2006-02-15T10:09:17', 1), - ('840', '2006-02-15T10:09:17', 1), - ('840', '2006-02-15T10:09:17', 1), - ('22', '2006-02-15T10:09:17', 1), - ('22', '2006-02-15T10:09:17', 2), - ('22', '2006-02-15T10:09:17', 1), - ('22', '2006-02-15T10:09:17', 2), - ('22', '2006-02-15T10:09:17', 1), - ('22', '2006-02-15T10:09:17', 2), - ('22', '2006-02-15T10:09:17', 1), - ('536', '2006-02-15T10:09:17', 1), - ('536', '2006-02-15T10:09:17', 2), - ('536', '2006-02-15T10:09:17', 1), - ('536', '2006-02-15T10:09:17', 2), - ('536', '2006-02-15T10:09:17', 1), - ('393', '2006-02-15T10:09:17', 1), - ('393', '2006-02-15T10:09:17', 1), - ('159', '2006-02-15T10:09:17', 1), - ('159', '2006-02-15T10:09:17', 2), - ('159', '2006-02-15T10:09:17', 1), - ('159', '2006-02-15T10:09:17', 1), - ('159', '2006-02-15T10:09:17', 1), - ('159', '2006-02-15T10:09:17', 2), - ('159', '2006-02-15T10:09:17', 2), - ('280', '2006-02-15T10:09:17', 1), - ('280', '2006-02-15T10:09:17', 1), - ('280', '2006-02-15T10:09:17', 2), - ('280', '2006-02-15T10:09:17', 1), - ('280', '2006-02-15T10:09:17', 1), - ('280', '2006-02-15T10:09:17', 2), - ('103', '2006-02-15T10:09:17', 1), - ('103', '2006-02-15T10:09:17', 2), - ('103', '2006-02-15T10:09:17', 2), - ('103', '2006-02-15T10:09:17', 2), - ('103', '2006-02-15T10:09:17', 1), - ('103', '2006-02-15T10:09:17', 2), - ('103', '2006-02-15T10:09:17', 1), - ('103', '2006-02-15T10:09:17', 1), - ('477', '2006-02-15T10:09:17', 2), - ('477', '2006-02-15T10:09:17', 2), - ('477', '2006-02-15T10:09:17', 2), - ('303', '2006-02-15T10:09:17', 1), - ('303', '2006-02-15T10:09:17', 1) - ) AS data(old_film_id, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."film"' - AND map0.old_id = data.old_film_id - RETURNING inventory_id - ) - SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; - - FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); - END LOOP; - - v_old_ids_inventory := ARRAY['1379', '1382', '1380', '1383', '1912', '1916', '1914', '1913', '1911', '1915', '3662', '3661', '3663', '3665', '3664', '3660', '2487', '2489', '2484', '2486', '2485', '2488', '1604', '1608', '1606', '1609', '1607', '1605', '1674', '1678', '1679', '1677', '1680', '1675', '1676', '4566', '4565', '805', '803', '804', '806', '807', '2503', '2504', '2502', '239', '238', '241', '240', '237', '397', '398', '395', '396', '955', '956', '957', '958', '3086', '3087', '3085', '3084', '1546', '1547', '1548', '4518', '4517', '4519', '4516', '4515', '4520', '2295', '2294', '3577', '3576', '3574', '3575', '3572', '3573', '1136', '1139', '1140', '1141', '1137', '1138', '4513', '4512', '4508', '4511', '4509', '4514', '4510', '1986', '1988', '1987', '1985', '1984', '1989', '3552', '3551']; - WITH inserted AS ( - INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") - SELECT - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - ('303', '2006-02-15T10:09:17', 1), - ('303', '2006-02-15T10:09:17', 2), - ('303', '2006-02-15T10:09:17', 1), - ('303', '2006-02-15T10:09:17', 2), - ('416', '2006-02-15T10:09:17', 1), - ('416', '2006-02-15T10:09:17', 2), - ('416', '2006-02-15T10:09:17', 2), - ('416', '2006-02-15T10:09:17', 2), - ('416', '2006-02-15T10:09:17', 1), - ('416', '2006-02-15T10:09:17', 2), - ('800', '2006-02-15T10:09:17', 2), - ('800', '2006-02-15T10:09:17', 1), - ('800', '2006-02-15T10:09:17', 2), - ('800', '2006-02-15T10:09:17', 2), - ('800', '2006-02-15T10:09:17', 2), - ('800', '2006-02-15T10:09:17', 1), - ('545', '2006-02-15T10:09:17', 1), - ('545', '2006-02-15T10:09:17', 2), - ('545', '2006-02-15T10:09:17', 1), - ('545', '2006-02-15T10:09:17', 1), - ('545', '2006-02-15T10:09:17', 1), - ('545', '2006-02-15T10:09:17', 2), - ('351', '2006-02-15T10:09:17', 1), - ('351', '2006-02-15T10:09:17', 2), - ('351', '2006-02-15T10:09:17', 1), - ('351', '2006-02-15T10:09:17', 2), - ('351', '2006-02-15T10:09:17', 2), - ('351', '2006-02-15T10:09:17', 1), - ('366', '2006-02-15T10:09:17', 1), - ('366', '2006-02-15T10:09:17', 2), - ('366', '2006-02-15T10:09:17', 2), - ('366', '2006-02-15T10:09:17', 1), - ('366', '2006-02-15T10:09:17', 2), - ('366', '2006-02-15T10:09:17', 1), - ('366', '2006-02-15T10:09:17', 1), - ('997', '2006-02-15T10:09:17', 1), - ('997', '2006-02-15T10:09:17', 1), - ('175', '2006-02-15T10:09:17', 2), - ('175', '2006-02-15T10:09:17', 1), - ('175', '2006-02-15T10:09:17', 1), - ('175', '2006-02-15T10:09:17', 2), - ('175', '2006-02-15T10:09:17', 2), - ('550', '2006-02-15T10:09:17', 1), - ('550', '2006-02-15T10:09:17', 1), - ('550', '2006-02-15T10:09:17', 1), - ('54', '2006-02-15T10:09:17', 1), - ('54', '2006-02-15T10:09:17', 1), - ('54', '2006-02-15T10:09:17', 2), - ('54', '2006-02-15T10:09:17', 2), - ('54', '2006-02-15T10:09:17', 1), - ('88', '2006-02-15T10:09:17', 2), - ('88', '2006-02-15T10:09:17', 2), - ('88', '2006-02-15T10:09:17', 2), - ('88', '2006-02-15T10:09:17', 2), - ('213', '2006-02-15T10:09:17', 1), - ('213', '2006-02-15T10:09:17', 1), - ('213', '2006-02-15T10:09:17', 1), - ('213', '2006-02-15T10:09:17', 1), - ('678', '2006-02-15T10:09:17', 1), - ('678', '2006-02-15T10:09:17', 1), - ('678', '2006-02-15T10:09:17', 1), - ('678', '2006-02-15T10:09:17', 1), - ('339', '2006-02-15T10:09:17', 2), - ('339', '2006-02-15T10:09:17', 2), - ('339', '2006-02-15T10:09:17', 2), - ('986', '2006-02-15T10:09:17', 1), - ('986', '2006-02-15T10:09:17', 1), - ('986', '2006-02-15T10:09:17', 2), - ('986', '2006-02-15T10:09:17', 1), - ('986', '2006-02-15T10:09:17', 1), - ('986', '2006-02-15T10:09:17', 2), - ('499', '2006-02-15T10:09:17', 1), - ('499', '2006-02-15T10:09:17', 1), - ('782', '2006-02-15T10:09:17', 2), - ('782', '2006-02-15T10:09:17', 2), - ('782', '2006-02-15T10:09:17', 1), - ('782', '2006-02-15T10:09:17', 2), - ('782', '2006-02-15T10:09:17', 1), - ('782', '2006-02-15T10:09:17', 1), - ('252', '2006-02-15T10:09:17', 1), - ('252', '2006-02-15T10:09:17', 2), - ('252', '2006-02-15T10:09:17', 2), - ('252', '2006-02-15T10:09:17', 2), - ('252', '2006-02-15T10:09:17', 1), - ('252', '2006-02-15T10:09:17', 1), - ('985', '2006-02-15T10:09:17', 2), - ('985', '2006-02-15T10:09:17', 2), - ('985', '2006-02-15T10:09:17', 1), - ('985', '2006-02-15T10:09:17', 1), - ('985', '2006-02-15T10:09:17', 1), - ('985', '2006-02-15T10:09:17', 2), - ('985', '2006-02-15T10:09:17', 1), - ('433', '2006-02-15T10:09:17', 1), - ('433', '2006-02-15T10:09:17', 2), - ('433', '2006-02-15T10:09:17', 1), - ('433', '2006-02-15T10:09:17', 1), - ('433', '2006-02-15T10:09:17', 1), - ('433', '2006-02-15T10:09:17', 2), - ('776', '2006-02-15T10:09:17', 2), - ('776', '2006-02-15T10:09:17', 2) - ) AS data(old_film_id, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."film"' - AND map0.old_id = data.old_film_id - RETURNING inventory_id - ) - SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; - - FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); - END LOOP; - - v_old_ids_inventory := ARRAY['3549', '3550', '3548', '1204', '1205', '1200', '1202', '1201', '1203', '979', '978', '980', '974', '975', '976', '977', '2343', '2345', '2344', '2346', '959', '961', '962', '960', '1688', '1689', '2358', '2359', '3217', '3219', '3220', '3222', '3221', '3218', '1744', '1745', '1743', '1746', '2027', '2028', '3366', '3361', '3364', '3363', '3365', '3362', '3367', '3360', '2058', '2060', '2061', '2059', '2057', '2062', '2063', '1355', '1356', '1357', '1354', '610', '608', '609', '611', '606', '607', '1866', '1865', '231', '232', '230', '228', '229', '227', '99', '100', '101', '2408', '2409', '2402', '2403', '2406', '2407', '2405', '2404', '3784', '3783', '3782', '3781', '2556', '2557', '2558', '2554', '2555', '716', '718', '717', '1992', '1993', '1990', '1994']; - WITH inserted AS ( - INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") - SELECT - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - ('776', '2006-02-15T10:09:17', 1), - ('776', '2006-02-15T10:09:17', 2), - ('776', '2006-02-15T10:09:17', 1), - ('267', '2006-02-15T10:09:17', 2), - ('267', '2006-02-15T10:09:17', 2), - ('267', '2006-02-15T10:09:17', 1), - ('267', '2006-02-15T10:09:17', 1), - ('267', '2006-02-15T10:09:17', 1), - ('267', '2006-02-15T10:09:17', 1), - ('218', '2006-02-15T10:09:17', 2), - ('218', '2006-02-15T10:09:17', 2), - ('218', '2006-02-15T10:09:17', 2), - ('218', '2006-02-15T10:09:17', 1), - ('218', '2006-02-15T10:09:17', 1), - ('218', '2006-02-15T10:09:17', 1), - ('218', '2006-02-15T10:09:17', 1), - ('510', '2006-02-15T10:09:17', 1), - ('510', '2006-02-15T10:09:17', 1), - ('510', '2006-02-15T10:09:17', 1), - ('510', '2006-02-15T10:09:17', 1), - ('214', '2006-02-15T10:09:17', 2), - ('214', '2006-02-15T10:09:17', 2), - ('214', '2006-02-15T10:09:17', 2), - ('214', '2006-02-15T10:09:17', 2), - ('368', '2006-02-15T10:09:17', 1), - ('368', '2006-02-15T10:09:17', 1), - ('513', '2006-02-15T10:09:17', 2), - ('513', '2006-02-15T10:09:17', 2), - ('707', '2006-02-15T10:09:17', 1), - ('707', '2006-02-15T10:09:17', 2), - ('707', '2006-02-15T10:09:17', 2), - ('707', '2006-02-15T10:09:17', 2), - ('707', '2006-02-15T10:09:17', 2), - ('707', '2006-02-15T10:09:17', 1), - ('379', '2006-02-15T10:09:17', 2), - ('379', '2006-02-15T10:09:17', 2), - ('379', '2006-02-15T10:09:17', 2), - ('379', '2006-02-15T10:09:17', 2), - ('441', '2006-02-15T10:09:17', 1), - ('441', '2006-02-15T10:09:17', 1), - ('738', '2006-02-15T10:09:17', 2), - ('738', '2006-02-15T10:09:17', 1), - ('738', '2006-02-15T10:09:17', 2), - ('738', '2006-02-15T10:09:17', 1), - ('738', '2006-02-15T10:09:17', 2), - ('738', '2006-02-15T10:09:17', 1), - ('738', '2006-02-15T10:09:17', 2), - ('738', '2006-02-15T10:09:17', 1), - ('447', '2006-02-15T10:09:17', 1), - ('447', '2006-02-15T10:09:17', 1), - ('447', '2006-02-15T10:09:17', 2), - ('447', '2006-02-15T10:09:17', 1), - ('447', '2006-02-15T10:09:17', 1), - ('447', '2006-02-15T10:09:17', 2), - ('447', '2006-02-15T10:09:17', 2), - ('299', '2006-02-15T10:09:17', 1), - ('299', '2006-02-15T10:09:17', 1), - ('299', '2006-02-15T10:09:17', 1), - ('299', '2006-02-15T10:09:17', 1), - ('132', '2006-02-15T10:09:17', 2), - ('132', '2006-02-15T10:09:17', 1), - ('132', '2006-02-15T10:09:17', 1), - ('132', '2006-02-15T10:09:17', 2), - ('132', '2006-02-15T10:09:17', 1), - ('132', '2006-02-15T10:09:17', 1), - ('407', '2006-02-15T10:09:17', 1), - ('407', '2006-02-15T10:09:17', 1), - ('51', '2006-02-15T10:09:17', 2), - ('51', '2006-02-15T10:09:17', 2), - ('51', '2006-02-15T10:09:17', 2), - ('51', '2006-02-15T10:09:17', 1), - ('51', '2006-02-15T10:09:17', 2), - ('51', '2006-02-15T10:09:17', 1), - ('20', '2006-02-15T10:09:17', 1), - ('20', '2006-02-15T10:09:17', 1), - ('20', '2006-02-15T10:09:17', 1), - ('525', '2006-02-15T10:09:17', 2), - ('525', '2006-02-15T10:09:17', 2), - ('525', '2006-02-15T10:09:17', 1), - ('525', '2006-02-15T10:09:17', 1), - ('525', '2006-02-15T10:09:17', 2), - ('525', '2006-02-15T10:09:17', 2), - ('525', '2006-02-15T10:09:17', 1), - ('525', '2006-02-15T10:09:17', 1), - ('828', '2006-02-15T10:09:17', 2), - ('828', '2006-02-15T10:09:17', 2), - ('828', '2006-02-15T10:09:17', 2), - ('828', '2006-02-15T10:09:17', 2), - ('560', '2006-02-15T10:09:17', 1), - ('560', '2006-02-15T10:09:17', 2), - ('560', '2006-02-15T10:09:17', 2), - ('560', '2006-02-15T10:09:17', 1), - ('560', '2006-02-15T10:09:17', 1), - ('157', '2006-02-15T10:09:17', 2), - ('157', '2006-02-15T10:09:17', 2), - ('157', '2006-02-15T10:09:17', 2), - ('434', '2006-02-15T10:09:17', 1), - ('434', '2006-02-15T10:09:17', 1), - ('434', '2006-02-15T10:09:17', 1), - ('434', '2006-02-15T10:09:17', 2) - ) AS data(old_film_id, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."film"' - AND map0.old_id = data.old_film_id - RETURNING inventory_id - ) - SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; - - FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); - END LOOP; - - v_old_ids_inventory := ARRAY['1997', '1991', '1996', '1995', '939', '938', '940', '2864', '2867', '2866', '2868', '2865', '2547', '2551', '2550', '2553', '2548', '2549', '2546', '2552', '2612', '2615', '2613', '2614', '1457', '1456', '1455', '1458', '1452', '1454', '1453', '3009', '3008', '3006', '3007', '714', '715', '1917', '1920', '1919', '1921', '1918', '1922', '3878', '3879', '3880', '3372', '3368', '3371', '3369', '3370', '1483', '1481', '1480', '1482', '1484', '829', '826', '825', '830', '828', '831', '827', '2016', '2013', '2015', '2014', '2012', '2662', '2661', '70', '68', '67', '69', '3495', '3494', '3493', '3492', '2197', '2196', '4197', '4198', '4196', '4195', '4200', '4199', '3794', '3795', '3796', '947', '946', '945', '2997', '2995', '2999', '2996', '2994', '2998', '4291', '4292']; - WITH inserted AS ( - INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") - SELECT - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - ('434', '2006-02-15T10:09:17', 2), - ('434', '2006-02-15T10:09:17', 1), - ('434', '2006-02-15T10:09:17', 2), - ('434', '2006-02-15T10:09:17', 2), - ('208', '2006-02-15T10:09:17', 1), - ('208', '2006-02-15T10:09:17', 1), - ('208', '2006-02-15T10:09:17', 1), - ('628', '2006-02-15T10:09:17', 1), - ('628', '2006-02-15T10:09:17', 2), - ('628', '2006-02-15T10:09:17', 1), - ('628', '2006-02-15T10:09:17', 2), - ('628', '2006-02-15T10:09:17', 1), - ('559', '2006-02-15T10:09:17', 1), - ('559', '2006-02-15T10:09:17', 2), - ('559', '2006-02-15T10:09:17', 2), - ('559', '2006-02-15T10:09:17', 2), - ('559', '2006-02-15T10:09:17', 1), - ('559', '2006-02-15T10:09:17', 1), - ('559', '2006-02-15T10:09:17', 1), - ('559', '2006-02-15T10:09:17', 2), - ('573', '2006-02-15T10:09:17', 1), - ('573', '2006-02-15T10:09:17', 1), - ('573', '2006-02-15T10:09:17', 1), - ('573', '2006-02-15T10:09:17', 1), - ('319', '2006-02-15T10:09:17', 2), - ('319', '2006-02-15T10:09:17', 2), - ('319', '2006-02-15T10:09:17', 2), - ('319', '2006-02-15T10:09:17', 2), - ('319', '2006-02-15T10:09:17', 1), - ('319', '2006-02-15T10:09:17', 1), - ('319', '2006-02-15T10:09:17', 1), - ('660', '2006-02-15T10:09:17', 2), - ('660', '2006-02-15T10:09:17', 2), - ('660', '2006-02-15T10:09:17', 1), - ('660', '2006-02-15T10:09:17', 1), - ('156', '2006-02-15T10:09:17', 2), - ('156', '2006-02-15T10:09:17', 2), - ('417', '2006-02-15T10:09:17', 1), - ('417', '2006-02-15T10:09:17', 1), - ('417', '2006-02-15T10:09:17', 1), - ('417', '2006-02-15T10:09:17', 2), - ('417', '2006-02-15T10:09:17', 1), - ('417', '2006-02-15T10:09:17', 2), - ('848', '2006-02-15T10:09:17', 1), - ('848', '2006-02-15T10:09:17', 1), - ('848', '2006-02-15T10:09:17', 1), - ('739', '2006-02-15T10:09:17', 2), - ('739', '2006-02-15T10:09:17', 1), - ('739', '2006-02-15T10:09:17', 2), - ('739', '2006-02-15T10:09:17', 1), - ('739', '2006-02-15T10:09:17', 2), - ('324', '2006-02-15T10:09:17', 2), - ('324', '2006-02-15T10:09:17', 1), - ('324', '2006-02-15T10:09:17', 1), - ('324', '2006-02-15T10:09:17', 1), - ('324', '2006-02-15T10:09:17', 2), - ('181', '2006-02-15T10:09:17', 2), - ('181', '2006-02-15T10:09:17', 1), - ('181', '2006-02-15T10:09:17', 1), - ('181', '2006-02-15T10:09:17', 2), - ('181', '2006-02-15T10:09:17', 2), - ('181', '2006-02-15T10:09:17', 2), - ('181', '2006-02-15T10:09:17', 1), - ('438', '2006-02-15T10:09:17', 2), - ('438', '2006-02-15T10:09:17', 1), - ('438', '2006-02-15T10:09:17', 2), - ('438', '2006-02-15T10:09:17', 2), - ('438', '2006-02-15T10:09:17', 1), - ('584', '2006-02-15T10:09:17', 1), - ('584', '2006-02-15T10:09:17', 1), - ('13', '2006-02-15T10:09:17', 2), - ('13', '2006-02-15T10:09:17', 2), - ('13', '2006-02-15T10:09:17', 2), - ('13', '2006-02-15T10:09:17', 2), - ('765', '2006-02-15T10:09:17', 1), - ('765', '2006-02-15T10:09:17', 1), - ('765', '2006-02-15T10:09:17', 1), - ('765', '2006-02-15T10:09:17', 1), - ('475', '2006-02-15T10:09:17', 2), - ('475', '2006-02-15T10:09:17', 2), - ('913', '2006-02-15T10:09:17', 1), - ('913', '2006-02-15T10:09:17', 1), - ('913', '2006-02-15T10:09:17', 1), - ('913', '2006-02-15T10:09:17', 1), - ('913', '2006-02-15T10:09:17', 2), - ('913', '2006-02-15T10:09:17', 2), - ('831', '2006-02-15T10:09:17', 1), - ('831', '2006-02-15T10:09:17', 1), - ('831', '2006-02-15T10:09:17', 1), - ('210', '2006-02-15T10:09:17', 2), - ('210', '2006-02-15T10:09:17', 2), - ('210', '2006-02-15T10:09:17', 2), - ('657', '2006-02-15T10:09:17', 1), - ('657', '2006-02-15T10:09:17', 1), - ('657', '2006-02-15T10:09:17', 2), - ('657', '2006-02-15T10:09:17', 1), - ('657', '2006-02-15T10:09:17', 1), - ('657', '2006-02-15T10:09:17', 2), - ('935', '2006-02-15T10:09:17', 2), - ('935', '2006-02-15T10:09:17', 2) - ) AS data(old_film_id, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."film"' - AND map0.old_id = data.old_film_id - RETURNING inventory_id - ) - SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; - - FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); - END LOOP; - - v_old_ids_inventory := ARRAY['1465', '1459', '1463', '1460', '1461', '1464', '1462', '2941', '2945', '2943', '2944', '2942', '1082', '1081', '1080', '1083', '2443', '2444', '2442', '2424', '2423', '2426', '2425', '1078', '1077', '1079', '3072', '3076', '3073', '3074', '3075', '3071', '4059', '4060', '4058', '3929', '3928', '3933', '3932', '3931', '3934', '3930', '586', '587', '580', '584', '585', '581', '583', '582', '4410', '4412', '4409', '4411', '4413', '3167', '3171', '3169', '3170', '3168', '4271', '4269', '4268', '4270', '4158', '4155', '4152', '4156', '4153', '4154', '4157', '3207', '3208', '3209', '3210', '1951', '1952', '2466', '2465', '2695', '2694', '2693', '2066', '2068', '2067', '2065', '2064', '2469', '2468', '2467', '1770', '1772', '1771', '1310', '1311', '2021', '2018', '2022', '2019', '2020']; - WITH inserted AS ( - INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") - SELECT - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - ('320', '2006-02-15T10:09:17', 2), - ('320', '2006-02-15T10:09:17', 1), - ('320', '2006-02-15T10:09:17', 2), - ('320', '2006-02-15T10:09:17', 1), - ('320', '2006-02-15T10:09:17', 1), - ('320', '2006-02-15T10:09:17', 2), - ('320', '2006-02-15T10:09:17', 2), - ('646', '2006-02-15T10:09:17', 1), - ('646', '2006-02-15T10:09:17', 2), - ('646', '2006-02-15T10:09:17', 1), - ('646', '2006-02-15T10:09:17', 2), - ('646', '2006-02-15T10:09:17', 1), - ('241', '2006-02-15T10:09:17', 1), - ('241', '2006-02-15T10:09:17', 1), - ('241', '2006-02-15T10:09:17', 1), - ('241', '2006-02-15T10:09:17', 1), - ('533', '2006-02-15T10:09:17', 1), - ('533', '2006-02-15T10:09:17', 1), - ('533', '2006-02-15T10:09:17', 1), - ('529', '2006-02-15T10:09:17', 1), - ('529', '2006-02-15T10:09:17', 1), - ('529', '2006-02-15T10:09:17', 1), - ('529', '2006-02-15T10:09:17', 1), - ('240', '2006-02-15T10:09:17', 2), - ('240', '2006-02-15T10:09:17', 2), - ('240', '2006-02-15T10:09:17', 2), - ('676', '2006-02-15T10:09:17', 1), - ('676', '2006-02-15T10:09:17', 2), - ('676', '2006-02-15T10:09:17', 2), - ('676', '2006-02-15T10:09:17', 2), - ('676', '2006-02-15T10:09:17', 2), - ('676', '2006-02-15T10:09:17', 1), - ('884', '2006-02-15T10:09:17', 2), - ('884', '2006-02-15T10:09:17', 2), - ('884', '2006-02-15T10:09:17', 2), - ('857', '2006-02-15T10:09:17', 1), - ('857', '2006-02-15T10:09:17', 1), - ('857', '2006-02-15T10:09:17', 2), - ('857', '2006-02-15T10:09:17', 2), - ('857', '2006-02-15T10:09:17', 2), - ('857', '2006-02-15T10:09:17', 2), - ('857', '2006-02-15T10:09:17', 1), - ('127', '2006-02-15T10:09:17', 2), - ('127', '2006-02-15T10:09:17', 2), - ('127', '2006-02-15T10:09:17', 1), - ('127', '2006-02-15T10:09:17', 2), - ('127', '2006-02-15T10:09:17', 2), - ('127', '2006-02-15T10:09:17', 1), - ('127', '2006-02-15T10:09:17', 1), - ('127', '2006-02-15T10:09:17', 1), - ('964', '2006-02-15T10:09:17', 1), - ('964', '2006-02-15T10:09:17', 2), - ('964', '2006-02-15T10:09:17', 1), - ('964', '2006-02-15T10:09:17', 1), - ('964', '2006-02-15T10:09:17', 2), - ('696', '2006-02-15T10:09:17', 1), - ('696', '2006-02-15T10:09:17', 2), - ('696', '2006-02-15T10:09:17', 2), - ('696', '2006-02-15T10:09:17', 2), - ('696', '2006-02-15T10:09:17', 1), - ('929', '2006-02-15T10:09:17', 1), - ('929', '2006-02-15T10:09:17', 1), - ('929', '2006-02-15T10:09:17', 1), - ('929', '2006-02-15T10:09:17', 1), - ('902', '2006-02-15T10:09:17', 2), - ('902', '2006-02-15T10:09:17', 1), - ('902', '2006-02-15T10:09:17', 1), - ('902', '2006-02-15T10:09:17', 2), - ('902', '2006-02-15T10:09:17', 1), - ('902', '2006-02-15T10:09:17', 1), - ('902', '2006-02-15T10:09:17', 2), - ('705', '2006-02-15T10:09:17', 1), - ('705', '2006-02-15T10:09:17', 1), - ('705', '2006-02-15T10:09:17', 1), - ('705', '2006-02-15T10:09:17', 1), - ('425', '2006-02-15T10:09:17', 2), - ('425', '2006-02-15T10:09:17', 2), - ('539', '2006-02-15T10:09:17', 1), - ('539', '2006-02-15T10:09:17', 1), - ('591', '2006-02-15T10:09:17', 2), - ('591', '2006-02-15T10:09:17', 2), - ('591', '2006-02-15T10:09:17', 2), - ('448', '2006-02-15T10:09:17', 2), - ('448', '2006-02-15T10:09:17', 2), - ('448', '2006-02-15T10:09:17', 2), - ('448', '2006-02-15T10:09:17', 1), - ('448', '2006-02-15T10:09:17', 1), - ('540', '2006-02-15T10:09:17', 1), - ('540', '2006-02-15T10:09:17', 1), - ('540', '2006-02-15T10:09:17', 1), - ('384', '2006-02-15T10:09:17', 2), - ('384', '2006-02-15T10:09:17', 2), - ('384', '2006-02-15T10:09:17', 2), - ('289', '2006-02-15T10:09:17', 1), - ('289', '2006-02-15T10:09:17', 1), - ('439', '2006-02-15T10:09:17', 2), - ('439', '2006-02-15T10:09:17', 1), - ('439', '2006-02-15T10:09:17', 2), - ('439', '2006-02-15T10:09:17', 1), - ('439', '2006-02-15T10:09:17', 1) - ) AS data(old_film_id, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."film"' - AND map0.old_id = data.old_film_id - RETURNING inventory_id - ) - SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; - - FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); - END LOOP; - - v_old_ids_inventory := ARRAY['2017', '870', '869', '867', '871', '872', '868', '433', '435', '434', '1385', '1389', '1384', '1388', '1386', '1387', '1725', '1722', '1726', '1727', '1724', '1723', '1728', '4298', '4294', '4293', '4297', '4296', '4295', '19', '20', '17', '21', '18', '22', '16', '4507', '4506', '3555', '3558', '3553', '3557', '3554', '3556', '986', '987', '988', '985', '992', '989', '991', '990', '4555', '4554', '4556', '845', '846', '786', '789', '787', '784', '785', '788', '783', '2495', '2494', '3818', '3814', '3813', '3817', '3815', '3812', '3816', '3811', '2706', '2704', '2705', '613', '612', '615', '614']; - WITH inserted AS ( - INSERT INTO "public"."inventory" ("film_id", "last_update", "store_id") - SELECT - map0.new_id::smallint, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - ('439', '2006-02-15T10:09:17', 1), - ('191', '2006-02-15T10:09:17', 2), - ('191', '2006-02-15T10:09:17', 1), - ('191', '2006-02-15T10:09:17', 1), - ('191', '2006-02-15T10:09:17', 2), - ('191', '2006-02-15T10:09:17', 2), - ('191', '2006-02-15T10:09:17', 1), - ('96', '2006-02-15T10:09:17', 1), - ('96', '2006-02-15T10:09:17', 1), - ('96', '2006-02-15T10:09:17', 1), - ('304', '2006-02-15T10:09:17', 1), - ('304', '2006-02-15T10:09:17', 2), - ('304', '2006-02-15T10:09:17', 1), - ('304', '2006-02-15T10:09:17', 2), - ('304', '2006-02-15T10:09:17', 1), - ('304', '2006-02-15T10:09:17', 1), - ('376', '2006-02-15T10:09:17', 1), - ('376', '2006-02-15T10:09:17', 1), - ('376', '2006-02-15T10:09:17', 2), - ('376', '2006-02-15T10:09:17', 2), - ('376', '2006-02-15T10:09:17', 1), - ('376', '2006-02-15T10:09:17', 1), - ('376', '2006-02-15T10:09:17', 2), - ('936', '2006-02-15T10:09:17', 2), - ('936', '2006-02-15T10:09:17', 1), - ('936', '2006-02-15T10:09:17', 1), - ('936', '2006-02-15T10:09:17', 2), - ('936', '2006-02-15T10:09:17', 2), - ('936', '2006-02-15T10:09:17', 2), - ('4', '2006-02-15T10:09:17', 1), - ('4', '2006-02-15T10:09:17', 2), - ('4', '2006-02-15T10:09:17', 1), - ('4', '2006-02-15T10:09:17', 2), - ('4', '2006-02-15T10:09:17', 1), - ('4', '2006-02-15T10:09:17', 2), - ('4', '2006-02-15T10:09:17', 1), - ('984', '2006-02-15T10:09:17', 1), - ('984', '2006-02-15T10:09:17', 1), - ('777', '2006-02-15T10:09:17', 1), - ('777', '2006-02-15T10:09:17', 2), - ('777', '2006-02-15T10:09:17', 1), - ('777', '2006-02-15T10:09:17', 2), - ('777', '2006-02-15T10:09:17', 1), - ('777', '2006-02-15T10:09:17', 2), - ('220', '2006-02-15T10:09:17', 1), - ('220', '2006-02-15T10:09:17', 1), - ('220', '2006-02-15T10:09:17', 1), - ('220', '2006-02-15T10:09:17', 1), - ('220', '2006-02-15T10:09:17', 2), - ('220', '2006-02-15T10:09:17', 2), - ('220', '2006-02-15T10:09:17', 2), - ('220', '2006-02-15T10:09:17', 2), - ('994', '2006-02-15T10:09:17', 1), - ('994', '2006-02-15T10:09:17', 1), - ('994', '2006-02-15T10:09:17', 1), - ('185', '2006-02-15T10:09:17', 1), - ('185', '2006-02-15T10:09:17', 1), - ('172', '2006-02-15T10:09:17', 1), - ('172', '2006-02-15T10:09:17', 2), - ('172', '2006-02-15T10:09:17', 2), - ('172', '2006-02-15T10:09:17', 1), - ('172', '2006-02-15T10:09:17', 1), - ('172', '2006-02-15T10:09:17', 2), - ('172', '2006-02-15T10:09:17', 1), - ('547', '2006-02-15T10:09:17', 2), - ('547', '2006-02-15T10:09:17', 2), - ('835', '2006-02-15T10:09:17', 2), - ('835', '2006-02-15T10:09:17', 1), - ('835', '2006-02-15T10:09:17', 1), - ('835', '2006-02-15T10:09:17', 2), - ('835', '2006-02-15T10:09:17', 2), - ('835', '2006-02-15T10:09:17', 1), - ('835', '2006-02-15T10:09:17', 2), - ('835', '2006-02-15T10:09:17', 1), - ('594', '2006-02-15T10:09:17', 1), - ('594', '2006-02-15T10:09:17', 1), - ('594', '2006-02-15T10:09:17', 1), - ('133', '2006-02-15T10:09:17', 1), - ('133', '2006-02-15T10:09:17', 1), - ('133', '2006-02-15T10:09:17', 2), - ('133', '2006-02-15T10:09:17', 2) - ) AS data(old_film_id, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."film"' - AND map0.old_id = data.old_film_id - RETURNING inventory_id - ) - SELECT array_agg(inventory_id) INTO v_new_ids_inventory FROM inserted; - - FOR i IN 1..array_length(v_new_ids_inventory, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."inventory"', v_old_ids_inventory[i], v_new_ids_inventory[i]::TEXT); - END LOOP; - - -- Table: "public"."film_actor" (5462 records) - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('60', '805', '2006-02-15T10:05:03'), - ('129', '805', '2006-02-15T10:05:03'), - ('27', '805', '2006-02-15T10:05:03'), - ('7', '805', '2006-02-15T10:05:03'), - ('79', '853', '2006-02-15T10:05:03'), - ('17', '853', '2006-02-15T10:05:03'), - ('34', '853', '2006-02-15T10:05:03'), - ('59', '853', '2006-02-15T10:05:03'), - ('174', '853', '2006-02-15T10:05:03'), - ('23', '853', '2006-02-15T10:05:03'), - ('37', '853', '2006-02-15T10:05:03'), - ('38', '853', '2006-02-15T10:05:03'), - ('189', '853', '2006-02-15T10:05:03'), - ('35', '817', '2006-02-15T10:05:03'), - ('5', '817', '2006-02-15T10:05:03'), - ('90', '817', '2006-02-15T10:05:03'), - ('112', '817', '2006-02-15T10:05:03'), - ('13', '817', '2006-02-15T10:05:03'), - ('198', '817', '2006-02-15T10:05:03'), - ('153', '817', '2006-02-15T10:05:03'), - ('179', '817', '2006-02-15T10:05:03'), - ('15', '817', '2006-02-15T10:05:03'), - ('50', '732', '2006-02-15T10:05:03'), - ('179', '732', '2006-02-15T10:05:03'), - ('30', '732', '2006-02-15T10:05:03'), - ('5', '732', '2006-02-15T10:05:03'), - ('35', '732', '2006-02-15T10:05:03'), - ('180', '732', '2006-02-15T10:05:03'), - ('111', '732', '2006-02-15T10:05:03'), - ('26', '732', '2006-02-15T10:05:03'), - ('113', '732', '2006-02-15T10:05:03'), - ('153', '732', '2006-02-15T10:05:03'), - ('109', '732', '2006-02-15T10:05:03'), - ('179', '65', '2006-02-15T10:05:03'), - ('135', '65', '2006-02-15T10:05:03'), - ('45', '65', '2006-02-15T10:05:03'), - ('32', '65', '2006-02-15T10:05:03'), - ('95', '65', '2006-02-15T10:05:03'), - ('134', '915', '2006-02-15T10:05:03'), - ('36', '915', '2006-02-15T10:05:03'), - ('67', '915', '2006-02-15T10:05:03'), - ('105', '915', '2006-02-15T10:05:03'), - ('66', '915', '2006-02-15T10:05:03'), - ('52', '915', '2006-02-15T10:05:03'), - ('104', '999', '2006-02-15T10:05:03'), - ('52', '999', '2006-02-15T10:05:03'), - ('142', '999', '2006-02-15T10:05:03'), - ('140', '999', '2006-02-15T10:05:03'), - ('66', '999', '2006-02-15T10:05:03'), - ('92', '564', '2006-02-15T10:05:03'), - ('25', '564', '2006-02-15T10:05:03'), - ('137', '564', '2006-02-15T10:05:03'), - ('169', '564', '2006-02-15T10:05:03'), - ('89', '564', '2006-02-15T10:05:03'), - ('81', '564', '2006-02-15T10:05:03'), - ('128', '564', '2006-02-15T10:05:03'), - ('26', '564', '2006-02-15T10:05:03'), - ('173', '564', '2006-02-15T10:05:03'), - ('91', '176', '2006-02-15T10:05:03'), - ('38', '176', '2006-02-15T10:05:03'), - ('44', '176', '2006-02-15T10:05:03'), - ('108', '655', '2006-02-15T10:05:03'), - ('83', '655', '2006-02-15T10:05:03'), - ('134', '655', '2006-02-15T10:05:03'), - ('101', '655', '2006-02-15T10:05:03'), - ('161', '655', '2006-02-15T10:05:03'), - ('168', '32', '2006-02-15T10:05:03'), - ('162', '32', '2006-02-15T10:05:03'), - ('79', '32', '2006-02-15T10:05:03'), - ('183', '32', '2006-02-15T10:05:03'), - ('158', '32', '2006-02-15T10:05:03'), - ('150', '75', '2006-02-15T10:05:03'), - ('55', '75', '2006-02-15T10:05:03'), - ('24', '653', '2006-02-15T10:05:03'), - ('161', '653', '2006-02-15T10:05:03'), - ('116', '653', '2006-02-15T10:05:03'), - ('175', '362', '2006-02-15T10:05:03'), - ('149', '362', '2006-02-15T10:05:03'), - ('182', '362', '2006-02-15T10:05:03'), - ('80', '362', '2006-02-15T10:05:03'), - ('61', '362', '2006-02-15T10:05:03'), - ('71', '362', '2006-02-15T10:05:03'), - ('159', '789', '2006-02-15T10:05:03'), - ('157', '642', '2006-02-15T10:05:03'), - ('169', '642', '2006-02-15T10:05:03'), - ('76', '642', '2006-02-15T10:05:03'), - ('100', '642', '2006-02-15T10:05:03'), - ('184', '642', '2006-02-15T10:05:03'), - ('113', '642', '2006-02-15T10:05:03'), - ('120', '642', '2006-02-15T10:05:03'), - ('130', '930', '2006-02-15T10:05:03'), - ('10', '930', '2006-02-15T10:05:03'), - ('178', '930', '2006-02-15T10:05:03'), - ('97', '930', '2006-02-15T10:05:03'), - ('132', '930', '2006-02-15T10:05:03'), - ('55', '930', '2006-02-15T10:05:03'), - ('128', '82', '2006-02-15T10:05:03'), - ('132', '82', '2006-02-15T10:05:03'), - ('189', '82', '2006-02-15T10:05:03'), - ('159', '82', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('57', '34', '2006-02-15T10:05:03'), - ('40', '34', '2006-02-15T10:05:03'), - ('178', '34', '2006-02-15T10:05:03'), - ('126', '34', '2006-02-15T10:05:03'), - ('157', '34', '2006-02-15T10:05:03'), - ('102', '34', '2006-02-15T10:05:03'), - ('72', '34', '2006-02-15T10:05:03'), - ('112', '34', '2006-02-15T10:05:03'), - ('75', '34', '2006-02-15T10:05:03'), - ('12', '34', '2006-02-15T10:05:03'), - ('26', '34', '2006-02-15T10:05:03'), - ('27', '34', '2006-02-15T10:05:03'), - ('40', '233', '2006-02-15T10:05:03'), - ('47', '233', '2006-02-15T10:05:03'), - ('104', '233', '2006-02-15T10:05:03'), - ('150', '233', '2006-02-15T10:05:03'), - ('71', '233', '2006-02-15T10:05:03'), - ('181', '233', '2006-02-15T10:05:03'), - ('139', '233', '2006-02-15T10:05:03'), - ('48', '792', '2006-02-15T10:05:03'), - ('148', '792', '2006-02-15T10:05:03'), - ('143', '792', '2006-02-15T10:05:03'), - ('4', '355', '2006-02-15T10:05:03'), - ('69', '761', '2006-02-15T10:05:03'), - ('85', '761', '2006-02-15T10:05:03'), - ('149', '761', '2006-02-15T10:05:03'), - ('81', '761', '2006-02-15T10:05:03'), - ('171', '761', '2006-02-15T10:05:03'), - ('185', '761', '2006-02-15T10:05:03'), - ('196', '575', '2006-02-15T10:05:03'), - ('142', '575', '2006-02-15T10:05:03'), - ('111', '643', '2006-02-15T10:05:03'), - ('103', '643', '2006-02-15T10:05:03'), - ('81', '643', '2006-02-15T10:05:03'), - ('20', '643', '2006-02-15T10:05:03'), - ('107', '454', '2006-02-15T10:05:03'), - ('14', '454', '2006-02-15T10:05:03'), - ('119', '454', '2006-02-15T10:05:03'), - ('39', '71', '2006-02-15T10:05:03'), - ('183', '71', '2006-02-15T10:05:03'), - ('93', '71', '2006-02-15T10:05:03'), - ('29', '488', '2006-02-15T10:05:03'), - ('89', '488', '2006-02-15T10:05:03'), - ('106', '108', '2006-02-15T10:05:03'), - ('52', '108', '2006-02-15T10:05:03'), - ('15', '108', '2006-02-15T10:05:03'), - ('15', '91', '2006-02-15T10:05:03'), - ('12', '91', '2006-02-15T10:05:03'), - ('181', '387', '2006-02-15T10:05:03'), - ('36', '387', '2006-02-15T10:05:03'), - ('168', '387', '2006-02-15T10:05:03'), - ('78', '387', '2006-02-15T10:05:03'), - ('155', '387', '2006-02-15T10:05:03'), - ('17', '959', '2006-02-15T10:05:03'), - ('172', '959', '2006-02-15T10:05:03'), - ('190', '959', '2006-02-15T10:05:03'), - ('184', '959', '2006-02-15T10:05:03'), - ('168', '959', '2006-02-15T10:05:03'), - ('7', '959', '2006-02-15T10:05:03'), - ('8', '458', '2006-02-15T10:05:03'), - ('77', '458', '2006-02-15T10:05:03'), - ('107', '458', '2006-02-15T10:05:03'), - ('38', '458', '2006-02-15T10:05:03'), - ('149', '458', '2006-02-15T10:05:03'), - ('176', '458', '2006-02-15T10:05:03'), - ('177', '458', '2006-02-15T10:05:03'), - ('2', '458', '2006-02-15T10:05:03'), - ('135', '458', '2006-02-15T10:05:03'), - ('81', '458', '2006-02-15T10:05:03'), - ('56', '728', '2006-02-15T10:05:03'), - ('150', '728', '2006-02-15T10:05:03'), - ('112', '728', '2006-02-15T10:05:03'), - ('12', '728', '2006-02-15T10:05:03'), - ('97', '728', '2006-02-15T10:05:03'), - ('92', '728', '2006-02-15T10:05:03'), - ('102', '728', '2006-02-15T10:05:03'), - ('74', '704', '2006-02-15T10:05:03'), - ('24', '704', '2006-02-15T10:05:03'), - ('160', '950', '2006-02-15T10:05:03'), - ('34', '950', '2006-02-15T10:05:03'), - ('94', '950', '2006-02-15T10:05:03'), - ('73', '950', '2006-02-15T10:05:03'), - ('197', '950', '2006-02-15T10:05:03'), - ('197', '752', '2006-02-15T10:05:03'), - ('9', '752', '2006-02-15T10:05:03'), - ('19', '752', '2006-02-15T10:05:03'), - ('141', '752', '2006-02-15T10:05:03'), - ('61', '752', '2006-02-15T10:05:03'), - ('86', '752', '2006-02-15T10:05:03'), - ('106', '752', '2006-02-15T10:05:03'), - ('8', '752', '2006-02-15T10:05:03'), - ('159', '818', '2006-02-15T10:05:03'), - ('185', '818', '2006-02-15T10:05:03'), - ('136', '818', '2006-02-15T10:05:03'), - ('16', '583', '2006-02-15T10:05:03'), - ('138', '583', '2006-02-15T10:05:03'), - ('38', '583', '2006-02-15T10:05:03'), - ('25', '583', '2006-02-15T10:05:03'), - ('104', '583', '2006-02-15T10:05:03'), - ('132', '626', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('168', '626', '2006-02-15T10:05:03'), - ('74', '626', '2006-02-15T10:05:03'), - ('15', '626', '2006-02-15T10:05:03'), - ('158', '626', '2006-02-15T10:05:03'), - ('167', '626', '2006-02-15T10:05:03'), - ('191', '834', '2006-02-15T10:05:03'), - ('68', '834', '2006-02-15T10:05:03'), - ('164', '834', '2006-02-15T10:05:03'), - ('193', '834', '2006-02-15T10:05:03'), - ('129', '834', '2006-02-15T10:05:03'), - ('70', '834', '2006-02-15T10:05:03'), - ('74', '834', '2006-02-15T10:05:03'), - ('178', '160', '2006-02-15T10:05:03'), - ('182', '160', '2006-02-15T10:05:03'), - ('38', '160', '2006-02-15T10:05:03'), - ('137', '160', '2006-02-15T10:05:03'), - ('178', '483', '2006-02-15T10:05:03'), - ('158', '483', '2006-02-15T10:05:03'), - ('175', '483', '2006-02-15T10:05:03'), - ('22', '483', '2006-02-15T10:05:03'), - ('106', '189', '2006-02-15T10:05:03'), - ('197', '189', '2006-02-15T10:05:03'), - ('101', '189', '2006-02-15T10:05:03'), - ('103', '822', '2006-02-15T10:05:03'), - ('145', '822', '2006-02-15T10:05:03'), - ('169', '248', '2006-02-15T10:05:03'), - ('142', '248', '2006-02-15T10:05:03'), - ('152', '248', '2006-02-15T10:05:03'), - ('63', '248', '2006-02-15T10:05:03'), - ('50', '248', '2006-02-15T10:05:03'), - ('159', '248', '2006-02-15T10:05:03'), - ('150', '647', '2006-02-15T10:05:03'), - ('116', '647', '2006-02-15T10:05:03'), - ('131', '647', '2006-02-15T10:05:03'), - ('140', '647', '2006-02-15T10:05:03'), - ('186', '228', '2006-02-15T10:05:03'), - ('144', '228', '2006-02-15T10:05:03'), - ('94', '228', '2006-02-15T10:05:03'), - ('105', '29', '2006-02-15T10:05:03'), - ('6', '29', '2006-02-15T10:05:03'), - ('122', '29', '2006-02-15T10:05:03'), - ('13', '29', '2006-02-15T10:05:03'), - ('197', '29', '2006-02-15T10:05:03'), - ('187', '29', '2006-02-15T10:05:03'), - ('175', '29', '2006-02-15T10:05:03'), - ('90', '520', '2006-02-15T10:05:03'), - ('129', '520', '2006-02-15T10:05:03'), - ('86', '520', '2006-02-15T10:05:03'), - ('107', '520', '2006-02-15T10:05:03'), - ('50', '520', '2006-02-15T10:05:03'), - ('195', '520', '2006-02-15T10:05:03'), - ('183', '520', '2006-02-15T10:05:03'), - ('78', '520', '2006-02-15T10:05:03'), - ('118', '969', '2006-02-15T10:05:03'), - ('146', '969', '2006-02-15T10:05:03'), - ('77', '969', '2006-02-15T10:05:03'), - ('24', '969', '2006-02-15T10:05:03'), - ('184', '969', '2006-02-15T10:05:03'), - ('113', '969', '2006-02-15T10:05:03'), - ('11', '969', '2006-02-15T10:05:03'), - ('72', '969', '2006-02-15T10:05:03'), - ('191', '969', '2006-02-15T10:05:03'), - ('127', '411', '2006-02-15T10:05:03'), - ('5', '411', '2006-02-15T10:05:03'), - ('100', '411', '2006-02-15T10:05:03'), - ('190', '411', '2006-02-15T10:05:03'), - ('185', '411', '2006-02-15T10:05:03'), - ('25', '411', '2006-02-15T10:05:03'), - ('25', '755', '2006-02-15T10:05:03'), - ('160', '755', '2006-02-15T10:05:03'), - ('58', '755', '2006-02-15T10:05:03'), - ('97', '755', '2006-02-15T10:05:03'), - ('151', '501', '2006-02-15T10:05:03'), - ('142', '501', '2006-02-15T10:05:03'), - ('38', '501', '2006-02-15T10:05:03'), - ('161', '247', '2006-02-15T10:05:03'), - ('129', '247', '2006-02-15T10:05:03'), - ('83', '247', '2006-02-15T10:05:03'), - ('82', '247', '2006-02-15T10:05:03'), - ('198', '186', '2006-02-15T10:05:03'), - ('60', '186', '2006-02-15T10:05:03'), - ('142', '186', '2006-02-15T10:05:03'), - ('121', '186', '2006-02-15T10:05:03'), - ('26', '186', '2006-02-15T10:05:03'), - ('81', '186', '2006-02-15T10:05:03'), - ('87', '654', '2006-02-15T10:05:03'), - ('68', '654', '2006-02-15T10:05:03'), - ('121', '654', '2006-02-15T10:05:03'), - ('70', '654', '2006-02-15T10:05:03'), - ('112', '654', '2006-02-15T10:05:03'), - ('106', '654', '2006-02-15T10:05:03'), - ('122', '654', '2006-02-15T10:05:03'), - ('186', '654', '2006-02-15T10:05:03'), - ('66', '769', '2006-02-15T10:05:03'), - ('197', '769', '2006-02-15T10:05:03'), - ('195', '769', '2006-02-15T10:05:03'), - ('56', '769', '2006-02-15T10:05:03'), - ('160', '769', '2006-02-15T10:05:03'), - ('79', '769', '2006-02-15T10:05:03'), - ('179', '769', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('8', '769', '2006-02-15T10:05:03'), - ('54', '858', '2006-02-15T10:05:03'), - ('119', '858', '2006-02-15T10:05:03'), - ('198', '858', '2006-02-15T10:05:03'), - ('4', '858', '2006-02-15T10:05:03'), - ('124', '858', '2006-02-15T10:05:03'), - ('58', '858', '2006-02-15T10:05:03'), - ('90', '858', '2006-02-15T10:05:03'), - ('105', '858', '2006-02-15T10:05:03'), - ('191', '858', '2006-02-15T10:05:03'), - ('80', '858', '2006-02-15T10:05:03'), - ('106', '858', '2006-02-15T10:05:03'), - ('189', '509', '2006-02-15T10:05:03'), - ('119', '509', '2006-02-15T10:05:03'), - ('1', '509', '2006-02-15T10:05:03'), - ('91', '509', '2006-02-15T10:05:03'), - ('6', '509', '2006-02-15T10:05:03'), - ('140', '509', '2006-02-15T10:05:03'), - ('194', '352', '2006-02-15T10:05:03'), - ('174', '352', '2006-02-15T10:05:03'), - ('193', '352', '2006-02-15T10:05:03'), - ('163', '394', '2006-02-15T10:05:03'), - ('40', '394', '2006-02-15T10:05:03'), - ('119', '394', '2006-02-15T10:05:03'), - ('104', '394', '2006-02-15T10:05:03'), - ('147', '394', '2006-02-15T10:05:03'), - ('140', '599', '2006-02-15T10:05:03'), - ('144', '599', '2006-02-15T10:05:03'), - ('78', '599', '2006-02-15T10:05:03'), - ('87', '599', '2006-02-15T10:05:03'), - ('48', '599', '2006-02-15T10:05:03'), - ('161', '526', '2006-02-15T10:05:03'), - ('102', '526', '2006-02-15T10:05:03'), - ('80', '979', '2006-02-15T10:05:03'), - ('197', '979', '2006-02-15T10:05:03'), - ('102', '979', '2006-02-15T10:05:03'), - ('100', '979', '2006-02-15T10:05:03'), - ('19', '182', '2006-02-15T10:05:03'), - ('89', '182', '2006-02-15T10:05:03'), - ('34', '182', '2006-02-15T10:05:03'), - ('6', '451', '2006-02-15T10:05:03'), - ('174', '451', '2006-02-15T10:05:03'), - ('151', '451', '2006-02-15T10:05:03'), - ('90', '451', '2006-02-15T10:05:03'), - ('116', '451', '2006-02-15T10:05:03'), - ('100', '992', '2006-02-15T10:05:03'), - ('149', '992', '2006-02-15T10:05:03'), - ('141', '992', '2006-02-15T10:05:03'), - ('169', '992', '2006-02-15T10:05:03'), - ('72', '331', '2006-02-15T10:05:03'), - ('86', '331', '2006-02-15T10:05:03'), - ('68', '331', '2006-02-15T10:05:03'), - ('146', '278', '2006-02-15T10:05:03'), - ('190', '278', '2006-02-15T10:05:03'), - ('63', '278', '2006-02-15T10:05:03'), - ('134', '278', '2006-02-15T10:05:03'), - ('108', '278', '2006-02-15T10:05:03'), - ('92', '381', '2006-02-15T10:05:03'), - ('119', '381', '2006-02-15T10:05:03'), - ('181', '381', '2006-02-15T10:05:03'), - ('13', '381', '2006-02-15T10:05:03'), - ('99', '381', '2006-02-15T10:05:03'), - ('36', '381', '2006-02-15T10:05:03'), - ('74', '117', '2006-02-15T10:05:03'), - ('146', '117', '2006-02-15T10:05:03'), - ('89', '117', '2006-02-15T10:05:03'), - ('65', '117', '2006-02-15T10:05:03'), - ('45', '117', '2006-02-15T10:05:03'), - ('192', '117', '2006-02-15T10:05:03'), - ('23', '117', '2006-02-15T10:05:03'), - ('99', '414', '2006-02-15T10:05:03'), - ('125', '414', '2006-02-15T10:05:03'), - ('7', '414', '2006-02-15T10:05:03'), - ('70', '414', '2006-02-15T10:05:03'), - ('100', '414', '2006-02-15T10:05:03'), - ('111', '414', '2006-02-15T10:05:03'), - ('120', '414', '2006-02-15T10:05:03'), - ('161', '414', '2006-02-15T10:05:03'), - ('84', '414', '2006-02-15T10:05:03'), - ('15', '414', '2006-02-15T10:05:03'), - ('23', '414', '2006-02-15T10:05:03'), - ('136', '414', '2006-02-15T10:05:03'), - ('11', '597', '2006-02-15T10:05:03'), - ('198', '597', '2006-02-15T10:05:03'), - ('13', '597', '2006-02-15T10:05:03'), - ('64', '597', '2006-02-15T10:05:03'), - ('184', '597', '2006-02-15T10:05:03'), - ('129', '597', '2006-02-15T10:05:03'), - ('28', '597', '2006-02-15T10:05:03'), - ('114', '305', '2006-02-15T10:05:03'), - ('168', '305', '2006-02-15T10:05:03'), - ('147', '305', '2006-02-15T10:05:03'), - ('41', '305', '2006-02-15T10:05:03'), - ('65', '305', '2006-02-15T10:05:03'), - ('33', '305', '2006-02-15T10:05:03'), - ('2', '105', '2006-02-15T10:05:03'), - ('150', '105', '2006-02-15T10:05:03'), - ('144', '105', '2006-02-15T10:05:03'), - ('23', '105', '2006-02-15T10:05:03'), - ('123', '105', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('116', '105', '2006-02-15T10:05:03'), - ('29', '105', '2006-02-15T10:05:03'), - ('43', '105', '2006-02-15T10:05:03'), - ('114', '68', '2006-02-15T10:05:03'), - ('166', '68', '2006-02-15T10:05:03'), - ('58', '68', '2006-02-15T10:05:03'), - ('76', '68', '2006-02-15T10:05:03'), - ('71', '450', '2006-02-15T10:05:03'), - ('72', '450', '2006-02-15T10:05:03'), - ('125', '450', '2006-02-15T10:05:03'), - ('198', '450', '2006-02-15T10:05:03'), - ('131', '450', '2006-02-15T10:05:03'), - ('38', '450', '2006-02-15T10:05:03'), - ('171', '450', '2006-02-15T10:05:03'), - ('112', '450', '2006-02-15T10:05:03'), - ('168', '841', '2006-02-15T10:05:03'), - ('114', '841', '2006-02-15T10:05:03'), - ('137', '841', '2006-02-15T10:05:03'), - ('5', '841', '2006-02-15T10:05:03'), - ('101', '841', '2006-02-15T10:05:03'), - ('29', '449', '2006-02-15T10:05:03'), - ('23', '449', '2006-02-15T10:05:03'), - ('124', '449', '2006-02-15T10:05:03'), - ('121', '449', '2006-02-15T10:05:03'), - ('172', '487', '2006-02-15T10:05:03'), - ('145', '487', '2006-02-15T10:05:03'), - ('162', '7', '2006-02-15T10:05:03'), - ('99', '7', '2006-02-15T10:05:03'), - ('185', '7', '2006-02-15T10:05:03'), - ('133', '7', '2006-02-15T10:05:03'), - ('170', '7', '2006-02-15T10:05:03'), - ('9', '889', '2006-02-15T10:05:03'), - ('150', '889', '2006-02-15T10:05:03'), - ('46', '889', '2006-02-15T10:05:03'), - ('92', '889', '2006-02-15T10:05:03'), - ('168', '889', '2006-02-15T10:05:03'), - ('27', '889', '2006-02-15T10:05:03'), - ('78', '457', '2006-02-15T10:05:03'), - ('94', '457', '2006-02-15T10:05:03'), - ('17', '457', '2006-02-15T10:05:03'), - ('145', '457', '2006-02-15T10:05:03'), - ('56', '457', '2006-02-15T10:05:03'), - ('62', '457', '2006-02-15T10:05:03'), - ('106', '457', '2006-02-15T10:05:03'), - ('12', '457', '2006-02-15T10:05:03'), - ('143', '457', '2006-02-15T10:05:03'), - ('82', '839', '2006-02-15T10:05:03'), - ('37', '839', '2006-02-15T10:05:03'), - ('38', '839', '2006-02-15T10:05:03'), - ('176', '839', '2006-02-15T10:05:03'), - ('127', '839', '2006-02-15T10:05:03'), - ('68', '839', '2006-02-15T10:05:03'), - ('88', '839', '2006-02-15T10:05:03'), - ('41', '894', '2006-02-15T10:05:03'), - ('169', '894', '2006-02-15T10:05:03'), - ('106', '894', '2006-02-15T10:05:03'), - ('158', '894', '2006-02-15T10:05:03'), - ('133', '894', '2006-02-15T10:05:03'), - ('111', '894', '2006-02-15T10:05:03'), - ('144', '894', '2006-02-15T10:05:03'), - ('120', '894', '2006-02-15T10:05:03'), - ('108', '894', '2006-02-15T10:05:03'), - ('165', '146', '2006-02-15T10:05:03'), - ('37', '146', '2006-02-15T10:05:03'), - ('166', '146', '2006-02-15T10:05:03'), - ('188', '146', '2006-02-15T10:05:03'), - ('171', '146', '2006-02-15T10:05:03'), - ('101', '146', '2006-02-15T10:05:03'), - ('184', '146', '2006-02-15T10:05:03'), - ('5', '146', '2006-02-15T10:05:03'), - ('178', '146', '2006-02-15T10:05:03'), - ('20', '146', '2006-02-15T10:05:03'), - ('22', '146', '2006-02-15T10:05:03'), - ('31', '146', '2006-02-15T10:05:03'), - ('149', '146', '2006-02-15T10:05:03'), - ('45', '508', '2006-02-15T10:05:03'), - ('28', '508', '2006-02-15T10:05:03'), - ('186', '508', '2006-02-15T10:05:03'), - ('47', '508', '2006-02-15T10:05:03'), - ('61', '508', '2006-02-15T10:05:03'), - ('37', '508', '2006-02-15T10:05:03'), - ('102', '508', '2006-02-15T10:05:03'), - ('147', '508', '2006-02-15T10:05:03'), - ('53', '508', '2006-02-15T10:05:03'), - ('150', '508', '2006-02-15T10:05:03'), - ('170', '508', '2006-02-15T10:05:03'), - ('75', '508', '2006-02-15T10:05:03'), - ('111', '508', '2006-02-15T10:05:03'), - ('138', '508', '2006-02-15T10:05:03'), - ('81', '508', '2006-02-15T10:05:03'), - ('117', '578', '2006-02-15T10:05:03'), - ('58', '578', '2006-02-15T10:05:03'), - ('81', '578', '2006-02-15T10:05:03'), - ('152', '578', '2006-02-15T10:05:03'), - ('192', '578', '2006-02-15T10:05:03'), - ('125', '623', '2006-02-15T10:05:03'), - ('72', '623', '2006-02-15T10:05:03'), - ('86', '623', '2006-02-15T10:05:03'), - ('190', '623', '2006-02-15T10:05:03'), - ('33', '735', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('103', '735', '2006-02-15T10:05:03'), - ('118', '735', '2006-02-15T10:05:03'), - ('142', '735', '2006-02-15T10:05:03'), - ('65', '735', '2006-02-15T10:05:03'), - ('9', '200', '2006-02-15T10:05:03'), - ('102', '200', '2006-02-15T10:05:03'), - ('139', '200', '2006-02-15T10:05:03'), - ('18', '808', '2006-02-15T10:05:03'), - ('86', '808', '2006-02-15T10:05:03'), - ('136', '808', '2006-02-15T10:05:03'), - ('73', '275', '2006-02-15T10:05:03'), - ('15', '275', '2006-02-15T10:05:03'), - ('101', '275', '2006-02-15T10:05:03'), - ('160', '275', '2006-02-15T10:05:03'), - ('94', '275', '2006-02-15T10:05:03'), - ('64', '3', '2006-02-15T10:05:03'), - ('123', '3', '2006-02-15T10:05:03'), - ('2', '3', '2006-02-15T10:05:03'), - ('19', '3', '2006-02-15T10:05:03'), - ('24', '3', '2006-02-15T10:05:03'), - ('86', '519', '2006-02-15T10:05:03'), - ('29', '519', '2006-02-15T10:05:03'), - ('83', '519', '2006-02-15T10:05:03'), - ('61', '519', '2006-02-15T10:05:03'), - ('189', '519', '2006-02-15T10:05:03'), - ('168', '519', '2006-02-15T10:05:03'), - ('6', '519', '2006-02-15T10:05:03'), - ('173', '921', '2006-02-15T10:05:03'), - ('113', '921', '2006-02-15T10:05:03'), - ('181', '921', '2006-02-15T10:05:03'), - ('131', '921', '2006-02-15T10:05:03'), - ('149', '921', '2006-02-15T10:05:03'), - ('64', '921', '2006-02-15T10:05:03'), - ('161', '921', '2006-02-15T10:05:03'), - ('181', '456', '2006-02-15T10:05:03'), - ('46', '456', '2006-02-15T10:05:03'), - ('16', '456', '2006-02-15T10:05:03'), - ('39', '456', '2006-02-15T10:05:03'), - ('13', '456', '2006-02-15T10:05:03'), - ('90', '663', '2006-02-15T10:05:03'), - ('20', '663', '2006-02-15T10:05:03'), - ('74', '663', '2006-02-15T10:05:03'), - ('37', '663', '2006-02-15T10:05:03'), - ('17', '770', '2006-02-15T10:05:03'), - ('188', '770', '2006-02-15T10:05:03'), - ('7', '770', '2006-02-15T10:05:03'), - ('131', '770', '2006-02-15T10:05:03'), - ('47', '770', '2006-02-15T10:05:03'), - ('32', '651', '2006-02-15T10:05:03'), - ('191', '296', '2006-02-15T10:05:03'), - ('171', '296', '2006-02-15T10:05:03'), - ('146', '296', '2006-02-15T10:05:03'), - ('68', '296', '2006-02-15T10:05:03'), - ('29', '296', '2006-02-15T10:05:03'), - ('72', '296', '2006-02-15T10:05:03'), - ('46', '296', '2006-02-15T10:05:03'), - ('85', '296', '2006-02-15T10:05:03'), - ('60', '142', '2006-02-15T10:05:03'), - ('21', '142', '2006-02-15T10:05:03'), - ('42', '890', '2006-02-15T10:05:03'), - ('155', '890', '2006-02-15T10:05:03'), - ('175', '890', '2006-02-15T10:05:03'), - ('14', '890', '2006-02-15T10:05:03'), - ('113', '890', '2006-02-15T10:05:03'), - ('53', '727', '2006-02-15T10:05:03'), - ('79', '727', '2006-02-15T10:05:03'), - ('133', '727', '2006-02-15T10:05:03'), - ('127', '727', '2006-02-15T10:05:03'), - ('169', '727', '2006-02-15T10:05:03'), - ('187', '98', '2006-02-15T10:05:03'), - ('194', '98', '2006-02-15T10:05:03'), - ('111', '98', '2006-02-15T10:05:03'), - ('125', '98', '2006-02-15T10:05:03'), - ('144', '668', '2006-02-15T10:05:03'), - ('182', '668', '2006-02-15T10:05:03'), - ('34', '668', '2006-02-15T10:05:03'), - ('191', '668', '2006-02-15T10:05:03'), - ('88', '668', '2006-02-15T10:05:03'), - ('184', '492', '2006-02-15T10:05:03'), - ('116', '492', '2006-02-15T10:05:03'), - ('75', '492', '2006-02-15T10:05:03'), - ('189', '492', '2006-02-15T10:05:03'), - ('53', '492', '2006-02-15T10:05:03'), - ('20', '492', '2006-02-15T10:05:03'), - ('170', '322', '2006-02-15T10:05:03'), - ('113', '322', '2006-02-15T10:05:03'), - ('124', '322', '2006-02-15T10:05:03'), - ('44', '322', '2006-02-15T10:05:03'), - ('94', '322', '2006-02-15T10:05:03'), - ('188', '322', '2006-02-15T10:05:03'), - ('99', '322', '2006-02-15T10:05:03'), - ('73', '322', '2006-02-15T10:05:03'), - ('112', '322', '2006-02-15T10:05:03'), - ('194', '86', '2006-02-15T10:05:03'), - ('177', '86', '2006-02-15T10:05:03'), - ('41', '86', '2006-02-15T10:05:03'), - ('25', '86', '2006-02-15T10:05:03'), - ('78', '86', '2006-02-15T10:05:03'), - ('166', '86', '2006-02-15T10:05:03'), - ('164', '832', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('96', '832', '2006-02-15T10:05:03'), - ('24', '832', '2006-02-15T10:05:03'), - ('4', '832', '2006-02-15T10:05:03'), - ('165', '832', '2006-02-15T10:05:03'), - ('137', '832', '2006-02-15T10:05:03'), - ('61', '832', '2006-02-15T10:05:03'), - ('1', '832', '2006-02-15T10:05:03'), - ('13', '832', '2006-02-15T10:05:03'), - ('64', '832', '2006-02-15T10:05:03'), - ('193', '291', '2006-02-15T10:05:03'), - ('144', '291', '2006-02-15T10:05:03'), - ('64', '291', '2006-02-15T10:05:03'), - ('179', '291', '2006-02-15T10:05:03'), - ('22', '291', '2006-02-15T10:05:03'), - ('157', '291', '2006-02-15T10:05:03'), - ('112', '796', '2006-02-15T10:05:03'), - ('99', '796', '2006-02-15T10:05:03'), - ('107', '796', '2006-02-15T10:05:03'), - ('198', '796', '2006-02-15T10:05:03'), - ('102', '796', '2006-02-15T10:05:03'), - ('100', '563', '2006-02-15T10:05:03'), - ('177', '563', '2006-02-15T10:05:03'), - ('147', '563', '2006-02-15T10:05:03'), - ('67', '242', '2006-02-15T10:05:03'), - ('79', '242', '2006-02-15T10:05:03'), - ('160', '242', '2006-02-15T10:05:03'), - ('24', '242', '2006-02-15T10:05:03'), - ('58', '242', '2006-02-15T10:05:03'), - ('108', '242', '2006-02-15T10:05:03'), - ('44', '242', '2006-02-15T10:05:03'), - ('82', '242', '2006-02-15T10:05:03'), - ('60', '658', '2006-02-15T10:05:03'), - ('121', '658', '2006-02-15T10:05:03'), - ('65', '658', '2006-02-15T10:05:03'), - ('151', '658', '2006-02-15T10:05:03'), - ('54', '658', '2006-02-15T10:05:03'), - ('195', '658', '2006-02-15T10:05:03'), - ('32', '199', '2006-02-15T10:05:03'), - ('126', '199', '2006-02-15T10:05:03'), - ('17', '199', '2006-02-15T10:05:03'), - ('142', '199', '2006-02-15T10:05:03'), - ('24', '199', '2006-02-15T10:05:03'), - ('103', '199', '2006-02-15T10:05:03'), - ('87', '199', '2006-02-15T10:05:03'), - ('58', '199', '2006-02-15T10:05:03'), - ('30', '797', '2006-02-15T10:05:03'), - ('45', '797', '2006-02-15T10:05:03'), - ('174', '797', '2006-02-15T10:05:03'), - ('117', '797', '2006-02-15T10:05:03'), - ('141', '787', '2006-02-15T10:05:03'), - ('184', '787', '2006-02-15T10:05:03'), - ('47', '787', '2006-02-15T10:05:03'), - ('82', '787', '2006-02-15T10:05:03'), - ('101', '787', '2006-02-15T10:05:03'), - ('147', '139', '2006-02-15T10:05:03'), - ('142', '139', '2006-02-15T10:05:03'), - ('170', '139', '2006-02-15T10:05:03'), - ('149', '139', '2006-02-15T10:05:03'), - ('42', '139', '2006-02-15T10:05:03'), - ('89', '976', '2006-02-15T10:05:03'), - ('179', '976', '2006-02-15T10:05:03'), - ('187', '976', '2006-02-15T10:05:03'), - ('38', '619', '2006-02-15T10:05:03'), - ('81', '619', '2006-02-15T10:05:03'), - ('28', '619', '2006-02-15T10:05:03'), - ('114', '619', '2006-02-15T10:05:03'), - ('80', '619', '2006-02-15T10:05:03'), - ('95', '619', '2006-02-15T10:05:03'), - ('168', '619', '2006-02-15T10:05:03'), - ('149', '118', '2006-02-15T10:05:03'), - ('37', '118', '2006-02-15T10:05:03'), - ('11', '118', '2006-02-15T10:05:03'), - ('100', '118', '2006-02-15T10:05:03'), - ('80', '118', '2006-02-15T10:05:03'), - ('103', '118', '2006-02-15T10:05:03'), - ('182', '940', '2006-02-15T10:05:03'), - ('189', '940', '2006-02-15T10:05:03'), - ('194', '940', '2006-02-15T10:05:03'), - ('88', '940', '2006-02-15T10:05:03'), - ('51', '940', '2006-02-15T10:05:03'), - ('177', '363', '2006-02-15T10:05:03'), - ('122', '363', '2006-02-15T10:05:03'), - ('90', '363', '2006-02-15T10:05:03'), - ('23', '549', '2006-02-15T10:05:03'), - ('159', '549', '2006-02-15T10:05:03'), - ('58', '549', '2006-02-15T10:05:03'), - ('78', '549', '2006-02-15T10:05:03'), - ('190', '549', '2006-02-15T10:05:03'), - ('130', '549', '2006-02-15T10:05:03'), - ('171', '549', '2006-02-15T10:05:03'), - ('119', '868', '2006-02-15T10:05:03'), - ('40', '868', '2006-02-15T10:05:03'), - ('90', '868', '2006-02-15T10:05:03'), - ('56', '868', '2006-02-15T10:05:03'), - ('133', '868', '2006-02-15T10:05:03'), - ('181', '868', '2006-02-15T10:05:03'), - ('170', '868', '2006-02-15T10:05:03'), - ('52', '878', '2006-02-15T10:05:03'), - ('44', '878', '2006-02-15T10:05:03'), - ('86', '878', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('33', '878', '2006-02-15T10:05:03'), - ('143', '878', '2006-02-15T10:05:03'), - ('195', '677', '2006-02-15T10:05:03'), - ('182', '677', '2006-02-15T10:05:03'), - ('174', '677', '2006-02-15T10:05:03'), - ('104', '677', '2006-02-15T10:05:03'), - ('192', '677', '2006-02-15T10:05:03'), - ('57', '16', '2006-02-15T10:05:03'), - ('12', '16', '2006-02-15T10:05:03'), - ('191', '16', '2006-02-15T10:05:03'), - ('192', '16', '2006-02-15T10:05:03'), - ('146', '16', '2006-02-15T10:05:03'), - ('146', '427', '2006-02-15T10:05:03'), - ('32', '427', '2006-02-15T10:05:03'), - ('36', '427', '2006-02-15T10:05:03'), - ('185', '427', '2006-02-15T10:05:03'), - ('93', '427', '2006-02-15T10:05:03'), - ('13', '427', '2006-02-15T10:05:03'), - ('155', '427', '2006-02-15T10:05:03'), - ('22', '912', '2006-02-15T10:05:03'), - ('110', '912', '2006-02-15T10:05:03'), - ('76', '912', '2006-02-15T10:05:03'), - ('98', '912', '2006-02-15T10:05:03'), - ('103', '912', '2006-02-15T10:05:03'), - ('200', '912', '2006-02-15T10:05:03'), - ('41', '912', '2006-02-15T10:05:03'), - ('128', '912', '2006-02-15T10:05:03'), - ('28', '551', '2006-02-15T10:05:03'), - ('150', '551', '2006-02-15T10:05:03'), - ('95', '551', '2006-02-15T10:05:03'), - ('82', '551', '2006-02-15T10:05:03'), - ('58', '551', '2006-02-15T10:05:03'), - ('60', '551', '2006-02-15T10:05:03'), - ('191', '551', '2006-02-15T10:05:03'), - ('94', '551', '2006-02-15T10:05:03'), - ('85', '869', '2006-02-15T10:05:03'), - ('195', '869', '2006-02-15T10:05:03'), - ('40', '869', '2006-02-15T10:05:03'), - ('130', '869', '2006-02-15T10:05:03'), - ('70', '869', '2006-02-15T10:05:03'), - ('158', '869', '2006-02-15T10:05:03'), - ('112', '869', '2006-02-15T10:05:03'), - ('180', '869', '2006-02-15T10:05:03'), - ('93', '621', '2006-02-15T10:05:03'), - ('43', '621', '2006-02-15T10:05:03'), - ('50', '621', '2006-02-15T10:05:03'), - ('65', '516', '2006-02-15T10:05:03'), - ('104', '516', '2006-02-15T10:05:03'), - ('38', '516', '2006-02-15T10:05:03'), - ('128', '516', '2006-02-15T10:05:03'), - ('145', '243', '2006-02-15T10:05:03'), - ('50', '243', '2006-02-15T10:05:03'), - ('20', '243', '2006-02-15T10:05:03'), - ('136', '243', '2006-02-15T10:05:03'), - ('12', '243', '2006-02-15T10:05:03'), - ('109', '243', '2006-02-15T10:05:03'), - ('197', '243', '2006-02-15T10:05:03'), - ('134', '243', '2006-02-15T10:05:03'), - ('58', '243', '2006-02-15T10:05:03'), - ('90', '2', '2006-02-15T10:05:03'), - ('85', '2', '2006-02-15T10:05:03'), - ('19', '2', '2006-02-15T10:05:03'), - ('160', '2', '2006-02-15T10:05:03'), - ('86', '364', '2006-02-15T10:05:03'), - ('11', '364', '2006-02-15T10:05:03'), - ('136', '364', '2006-02-15T10:05:03'), - ('135', '364', '2006-02-15T10:05:03'), - ('197', '364', '2006-02-15T10:05:03'), - ('159', '364', '2006-02-15T10:05:03'), - ('158', '47', '2006-02-15T10:05:03'), - ('8', '47', '2006-02-15T10:05:03'), - ('95', '47', '2006-02-15T10:05:03'), - ('153', '47', '2006-02-15T10:05:03'), - ('143', '47', '2006-02-15T10:05:03'), - ('89', '47', '2006-02-15T10:05:03'), - ('2', '47', '2006-02-15T10:05:03'), - ('127', '47', '2006-02-15T10:05:03'), - ('65', '347', '2006-02-15T10:05:03'), - ('68', '347', '2006-02-15T10:05:03'), - ('164', '347', '2006-02-15T10:05:03'), - ('126', '347', '2006-02-15T10:05:03'), - ('75', '347', '2006-02-15T10:05:03'), - ('198', '347', '2006-02-15T10:05:03'), - ('27', '347', '2006-02-15T10:05:03'), - ('103', '347', '2006-02-15T10:05:03'), - ('165', '644', '2006-02-15T10:05:03'), - ('19', '644', '2006-02-15T10:05:03'), - ('161', '644', '2006-02-15T10:05:03'), - ('59', '644', '2006-02-15T10:05:03'), - ('26', '644', '2006-02-15T10:05:03'), - ('93', '644', '2006-02-15T10:05:03'), - ('147', '131', '2006-02-15T10:05:03'), - ('179', '131', '2006-02-15T10:05:03'), - ('151', '131', '2006-02-15T10:05:03'), - ('29', '131', '2006-02-15T10:05:03'), - ('83', '52', '2006-02-15T10:05:03'), - ('115', '52', '2006-02-15T10:05:03'), - ('177', '52', '2006-02-15T10:05:03'), - ('71', '52', '2006-02-15T10:05:03'), - ('35', '52', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('95', '52', '2006-02-15T10:05:03'), - ('138', '52', '2006-02-15T10:05:03'), - ('117', '167', '2006-02-15T10:05:03'), - ('151', '167', '2006-02-15T10:05:03'), - ('63', '167', '2006-02-15T10:05:03'), - ('114', '254', '2006-02-15T10:05:03'), - ('23', '254', '2006-02-15T10:05:03'), - ('46', '254', '2006-02-15T10:05:03'), - ('58', '254', '2006-02-15T10:05:03'), - ('89', '254', '2006-02-15T10:05:03'), - ('137', '254', '2006-02-15T10:05:03'), - ('13', '254', '2006-02-15T10:05:03'), - ('147', '254', '2006-02-15T10:05:03'), - ('108', '733', '2006-02-15T10:05:03'), - ('21', '733', '2006-02-15T10:05:03'), - ('178', '733', '2006-02-15T10:05:03'), - ('51', '733', '2006-02-15T10:05:03'), - ('29', '590', '2006-02-15T10:05:03'), - ('131', '590', '2006-02-15T10:05:03'), - ('182', '590', '2006-02-15T10:05:03'), - ('36', '590', '2006-02-15T10:05:03'), - ('120', '590', '2006-02-15T10:05:03'), - ('155', '590', '2006-02-15T10:05:03'), - ('96', '590', '2006-02-15T10:05:03'), - ('134', '690', '2006-02-15T10:05:03'), - ('143', '690', '2006-02-15T10:05:03'), - ('95', '690', '2006-02-15T10:05:03'), - ('165', '360', '2006-02-15T10:05:03'), - ('110', '360', '2006-02-15T10:05:03'), - ('185', '360', '2006-02-15T10:05:03'), - ('103', '360', '2006-02-15T10:05:03'), - ('158', '293', '2006-02-15T10:05:03'), - ('145', '293', '2006-02-15T10:05:03'), - ('191', '293', '2006-02-15T10:05:03'), - ('144', '293', '2006-02-15T10:05:03'), - ('39', '293', '2006-02-15T10:05:03'), - ('147', '333', '2006-02-15T10:05:03'), - ('105', '333', '2006-02-15T10:05:03'), - ('127', '333', '2006-02-15T10:05:03'), - ('42', '333', '2006-02-15T10:05:03'), - ('103', '333', '2006-02-15T10:05:03'), - ('5', '730', '2006-02-15T10:05:03'), - ('199', '730', '2006-02-15T10:05:03'), - ('140', '730', '2006-02-15T10:05:03'), - ('185', '730', '2006-02-15T10:05:03'), - ('123', '730', '2006-02-15T10:05:03'), - ('57', '134', '2006-02-15T10:05:03'), - ('48', '134', '2006-02-15T10:05:03'), - ('96', '134', '2006-02-15T10:05:03'), - ('63', '134', '2006-02-15T10:05:03'), - ('103', '215', '2006-02-15T10:05:03'), - ('172', '215', '2006-02-15T10:05:03'), - ('194', '215', '2006-02-15T10:05:03'), - ('68', '215', '2006-02-15T10:05:03'), - ('158', '215', '2006-02-15T10:05:03'), - ('81', '215', '2006-02-15T10:05:03'), - ('13', '571', '2006-02-15T10:05:03'), - ('146', '571', '2006-02-15T10:05:03'), - ('5', '571', '2006-02-15T10:05:03'), - ('169', '571', '2006-02-15T10:05:03'), - ('65', '571', '2006-02-15T10:05:03'), - ('185', '571', '2006-02-15T10:05:03'), - ('107', '571', '2006-02-15T10:05:03'), - ('173', '571', '2006-02-15T10:05:03'), - ('191', '461', '2006-02-15T10:05:03'), - ('176', '461', '2006-02-15T10:05:03'), - ('85', '461', '2006-02-15T10:05:03'), - ('51', '461', '2006-02-15T10:05:03'), - ('23', '820', '2006-02-15T10:05:03'), - ('46', '820', '2006-02-15T10:05:03'), - ('189', '820', '2006-02-15T10:05:03'), - ('180', '820', '2006-02-15T10:05:03'), - ('164', '820', '2006-02-15T10:05:03'), - ('140', '820', '2006-02-15T10:05:03'), - ('168', '892', '2006-02-15T10:05:03'), - ('123', '892', '2006-02-15T10:05:03'), - ('104', '892', '2006-02-15T10:05:03'), - ('151', '892', '2006-02-15T10:05:03'), - ('181', '892', '2006-02-15T10:05:03'), - ('56', '892', '2006-02-15T10:05:03'), - ('198', '892', '2006-02-15T10:05:03'), - ('171', '892', '2006-02-15T10:05:03'), - ('150', '892', '2006-02-15T10:05:03'), - ('6', '892', '2006-02-15T10:05:03'), - ('139', '892', '2006-02-15T10:05:03'), - ('108', '892', '2006-02-15T10:05:03'), - ('97', '641', '2006-02-15T10:05:03'), - ('118', '641', '2006-02-15T10:05:03'), - ('120', '641', '2006-02-15T10:05:03'), - ('145', '641', '2006-02-15T10:05:03'), - ('127', '641', '2006-02-15T10:05:03'), - ('130', '326', '2006-02-15T10:05:03'), - ('15', '326', '2006-02-15T10:05:03'), - ('102', '326', '2006-02-15T10:05:03'), - ('128', '326', '2006-02-15T10:05:03'), - ('169', '326', '2006-02-15T10:05:03'), - ('40', '326', '2006-02-15T10:05:03'), - ('166', '326', '2006-02-15T10:05:03'), - ('157', '326', '2006-02-15T10:05:03'), - ('174', '610', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('137', '610', '2006-02-15T10:05:03'), - ('164', '610', '2006-02-15T10:05:03'), - ('106', '687', '2006-02-15T10:05:03'), - ('80', '687', '2006-02-15T10:05:03'), - ('42', '687', '2006-02-15T10:05:03'), - ('143', '687', '2006-02-15T10:05:03'), - ('5', '687', '2006-02-15T10:05:03'), - ('146', '402', '2006-02-15T10:05:03'), - ('94', '402', '2006-02-15T10:05:03'), - ('147', '402', '2006-02-15T10:05:03'), - ('145', '402', '2006-02-15T10:05:03'), - ('110', '961', '2006-02-15T10:05:03'), - ('122', '961', '2006-02-15T10:05:03'), - ('114', '961', '2006-02-15T10:05:03'), - ('53', '961', '2006-02-15T10:05:03'), - ('87', '961', '2006-02-15T10:05:03'), - ('64', '471', '2006-02-15T10:05:03'), - ('129', '471', '2006-02-15T10:05:03'), - ('65', '471', '2006-02-15T10:05:03'), - ('129', '962', '2006-02-15T10:05:03'), - ('150', '962', '2006-02-15T10:05:03'), - ('20', '962', '2006-02-15T10:05:03'), - ('195', '962', '2006-02-15T10:05:03'), - ('111', '962', '2006-02-15T10:05:03'), - ('165', '962', '2006-02-15T10:05:03'), - ('130', '981', '2006-02-15T10:05:03'), - ('62', '981', '2006-02-15T10:05:03'), - ('23', '981', '2006-02-15T10:05:03'), - ('63', '981', '2006-02-15T10:05:03'), - ('113', '981', '2006-02-15T10:05:03'), - ('67', '981', '2006-02-15T10:05:03'), - ('28', '358', '2006-02-15T10:05:03'), - ('193', '358', '2006-02-15T10:05:03'), - ('97', '358', '2006-02-15T10:05:03'), - ('170', '358', '2006-02-15T10:05:03'), - ('141', '358', '2006-02-15T10:05:03'), - ('53', '358', '2006-02-15T10:05:03'), - ('111', '61', '2006-02-15T10:05:03'), - ('166', '61', '2006-02-15T10:05:03'), - ('174', '61', '2006-02-15T10:05:03'), - ('136', '61', '2006-02-15T10:05:03'), - ('138', '61', '2006-02-15T10:05:03'), - ('102', '624', '2006-02-15T10:05:03'), - ('134', '624', '2006-02-15T10:05:03'), - ('84', '413', '2006-02-15T10:05:03'), - ('134', '413', '2006-02-15T10:05:03'), - ('62', '413', '2006-02-15T10:05:03'), - ('182', '413', '2006-02-15T10:05:03'), - ('50', '645', '2006-02-15T10:05:03'), - ('171', '645', '2006-02-15T10:05:03'), - ('48', '645', '2006-02-15T10:05:03'), - ('75', '645', '2006-02-15T10:05:03'), - ('141', '380', '2006-02-15T10:05:03'), - ('68', '380', '2006-02-15T10:05:03'), - ('31', '380', '2006-02-15T10:05:03'), - ('36', '380', '2006-02-15T10:05:03'), - ('70', '823', '2006-02-15T10:05:03'), - ('73', '823', '2006-02-15T10:05:03'), - ('93', '768', '2006-02-15T10:05:03'), - ('46', '768', '2006-02-15T10:05:03'), - ('187', '768', '2006-02-15T10:05:03'), - ('141', '768', '2006-02-15T10:05:03'), - ('155', '768', '2006-02-15T10:05:03'), - ('148', '768', '2006-02-15T10:05:03'), - ('152', '768', '2006-02-15T10:05:03'), - ('11', '888', '2006-02-15T10:05:03'), - ('80', '888', '2006-02-15T10:05:03'), - ('144', '504', '2006-02-15T10:05:03'), - ('50', '504', '2006-02-15T10:05:03'), - ('156', '504', '2006-02-15T10:05:03'), - ('70', '504', '2006-02-15T10:05:03'), - ('142', '504', '2006-02-15T10:05:03'), - ('98', '824', '2006-02-15T10:05:03'), - ('158', '824', '2006-02-15T10:05:03'), - ('180', '824', '2006-02-15T10:05:03'), - ('164', '431', '2006-02-15T10:05:03'), - ('39', '431', '2006-02-15T10:05:03'), - ('95', '431', '2006-02-15T10:05:03'), - ('130', '431', '2006-02-15T10:05:03'), - ('102', '431', '2006-02-15T10:05:03'), - ('147', '431', '2006-02-15T10:05:03'), - ('129', '431', '2006-02-15T10:05:03'), - ('157', '431', '2006-02-15T10:05:03'), - ('31', '431', '2006-02-15T10:05:03'), - ('32', '431', '2006-02-15T10:05:03'), - ('48', '757', '2006-02-15T10:05:03'), - ('20', '757', '2006-02-15T10:05:03'), - ('72', '757', '2006-02-15T10:05:03'), - ('97', '757', '2006-02-15T10:05:03'), - ('173', '757', '2006-02-15T10:05:03'), - ('114', '757', '2006-02-15T10:05:03'), - ('155', '757', '2006-02-15T10:05:03'), - ('32', '669', '2006-02-15T10:05:03'), - ('129', '669', '2006-02-15T10:05:03'), - ('111', '669', '2006-02-15T10:05:03'), - ('161', '669', '2006-02-15T10:05:03'), - ('76', '251', '2006-02-15T10:05:03'), - ('10', '251', '2006-02-15T10:05:03'), - ('147', '251', '2006-02-15T10:05:03'), - ('149', '810', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('45', '810', '2006-02-15T10:05:03'), - ('102', '810', '2006-02-15T10:05:03'), - ('32', '523', '2006-02-15T10:05:03'), - ('8', '523', '2006-02-15T10:05:03'), - ('115', '686', '2006-02-15T10:05:03'), - ('105', '686', '2006-02-15T10:05:03'), - ('98', '686', '2006-02-15T10:05:03'), - ('136', '686', '2006-02-15T10:05:03'), - ('83', '686', '2006-02-15T10:05:03'), - ('92', '686', '2006-02-15T10:05:03'), - ('21', '686', '2006-02-15T10:05:03'), - ('79', '753', '2006-02-15T10:05:03'), - ('173', '753', '2006-02-15T10:05:03'), - ('109', '753', '2006-02-15T10:05:03'), - ('144', '753', '2006-02-15T10:05:03'), - ('43', '753', '2006-02-15T10:05:03'), - ('140', '830', '2006-02-15T10:05:03'), - ('174', '830', '2006-02-15T10:05:03'), - ('158', '830', '2006-02-15T10:05:03'), - ('27', '830', '2006-02-15T10:05:03'), - ('46', '830', '2006-02-15T10:05:03'), - ('84', '830', '2006-02-15T10:05:03'), - ('143', '830', '2006-02-15T10:05:03'), - ('191', '830', '2006-02-15T10:05:03'), - ('87', '830', '2006-02-15T10:05:03'), - ('120', '830', '2006-02-15T10:05:03'), - ('60', '830', '2006-02-15T10:05:03'), - ('158', '637', '2006-02-15T10:05:03'), - ('186', '637', '2006-02-15T10:05:03'), - ('107', '637', '2006-02-15T10:05:03'), - ('31', '637', '2006-02-15T10:05:03'), - ('7', '637', '2006-02-15T10:05:03'), - ('27', '637', '2006-02-15T10:05:03'), - ('74', '637', '2006-02-15T10:05:03'), - ('132', '637', '2006-02-15T10:05:03'), - ('57', '637', '2006-02-15T10:05:03'), - ('106', '763', '2006-02-15T10:05:03'), - ('192', '763', '2006-02-15T10:05:03'), - ('63', '763', '2006-02-15T10:05:03'), - ('177', '763', '2006-02-15T10:05:03'), - ('127', '763', '2006-02-15T10:05:03'), - ('192', '470', '2006-02-15T10:05:03'), - ('142', '470', '2006-02-15T10:05:03'), - ('122', '470', '2006-02-15T10:05:03'), - ('92', '470', '2006-02-15T10:05:03'), - ('55', '8', '2006-02-15T10:05:03'), - ('110', '8', '2006-02-15T10:05:03'), - ('138', '8', '2006-02-15T10:05:03'), - ('96', '8', '2006-02-15T10:05:03'), - ('4', '463', '2006-02-15T10:05:03'), - ('40', '463', '2006-02-15T10:05:03'), - ('179', '463', '2006-02-15T10:05:03'), - ('104', '463', '2006-02-15T10:05:03'), - ('151', '463', '2006-02-15T10:05:03'), - ('109', '463', '2006-02-15T10:05:03'), - ('46', '463', '2006-02-15T10:05:03'), - ('133', '463', '2006-02-15T10:05:03'), - ('45', '463', '2006-02-15T10:05:03'), - ('7', '463', '2006-02-15T10:05:03'), - ('24', '463', '2006-02-15T10:05:03'), - ('150', '63', '2006-02-15T10:05:03'), - ('56', '63', '2006-02-15T10:05:03'), - ('167', '63', '2006-02-15T10:05:03'), - ('20', '63', '2006-02-15T10:05:03'), - ('51', '63', '2006-02-15T10:05:03'), - ('197', '63', '2006-02-15T10:05:03'), - ('120', '63', '2006-02-15T10:05:03'), - ('119', '87', '2006-02-15T10:05:03'), - ('3', '87', '2006-02-15T10:05:03'), - ('88', '87', '2006-02-15T10:05:03'), - ('4', '87', '2006-02-15T10:05:03'), - ('30', '87', '2006-02-15T10:05:03'), - ('13', '87', '2006-02-15T10:05:03'), - ('64', '87', '2006-02-15T10:05:03'), - ('21', '87', '2006-02-15T10:05:03'), - ('190', '87', '2006-02-15T10:05:03'), - ('56', '87', '2006-02-15T10:05:03'), - ('184', '87', '2006-02-15T10:05:03'), - ('16', '87', '2006-02-15T10:05:03'), - ('98', '87', '2006-02-15T10:05:03'), - ('118', '141', '2006-02-15T10:05:03'), - ('195', '141', '2006-02-15T10:05:03'), - ('154', '141', '2006-02-15T10:05:03'), - ('143', '141', '2006-02-15T10:05:03'), - ('79', '141', '2006-02-15T10:05:03'), - ('121', '141', '2006-02-15T10:05:03'), - ('127', '141', '2006-02-15T10:05:03'), - ('193', '141', '2006-02-15T10:05:03'), - ('92', '512', '2006-02-15T10:05:03'), - ('189', '512', '2006-02-15T10:05:03'), - ('94', '512', '2006-02-15T10:05:03'), - ('67', '512', '2006-02-15T10:05:03'), - ('99', '512', '2006-02-15T10:05:03'), - ('146', '512', '2006-02-15T10:05:03'), - ('132', '586', '2006-02-15T10:05:03'), - ('90', '586', '2006-02-15T10:05:03'), - ('27', '586', '2006-02-15T10:05:03'), - ('29', '462', '2006-02-15T10:05:03'), - ('27', '462', '2006-02-15T10:05:03'), - ('156', '462', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('43', '462', '2006-02-15T10:05:03'), - ('128', '462', '2006-02-15T10:05:03'), - ('18', '462', '2006-02-15T10:05:03'), - ('200', '462', '2006-02-15T10:05:03'), - ('56', '462', '2006-02-15T10:05:03'), - ('193', '462', '2006-02-15T10:05:03'), - ('104', '70', '2006-02-15T10:05:03'), - ('6', '70', '2006-02-15T10:05:03'), - ('180', '809', '2006-02-15T10:05:03'), - ('63', '809', '2006-02-15T10:05:03'), - ('165', '809', '2006-02-15T10:05:03'), - ('131', '809', '2006-02-15T10:05:03'), - ('84', '809', '2006-02-15T10:05:03'), - ('130', '809', '2006-02-15T10:05:03'), - ('174', '809', '2006-02-15T10:05:03'), - ('96', '209', '2006-02-15T10:05:03'), - ('107', '209', '2006-02-15T10:05:03'), - ('180', '724', '2006-02-15T10:05:03'), - ('197', '724', '2006-02-15T10:05:03'), - ('94', '724', '2006-02-15T10:05:03'), - ('41', '724', '2006-02-15T10:05:03'), - ('183', '390', '2006-02-15T10:05:03'), - ('26', '390', '2006-02-15T10:05:03'), - ('133', '390', '2006-02-15T10:05:03'), - ('36', '390', '2006-02-15T10:05:03'), - ('137', '390', '2006-02-15T10:05:03'), - ('68', '607', '2006-02-15T10:05:03'), - ('152', '607', '2006-02-15T10:05:03'), - ('165', '607', '2006-02-15T10:05:03'), - ('98', '607', '2006-02-15T10:05:03'), - ('115', '607', '2006-02-15T10:05:03'), - ('104', '607', '2006-02-15T10:05:03'), - ('141', '607', '2006-02-15T10:05:03'), - ('79', '607', '2006-02-15T10:05:03'), - ('175', '442', '2006-02-15T10:05:03'), - ('174', '442', '2006-02-15T10:05:03'), - ('90', '442', '2006-02-15T10:05:03'), - ('77', '442', '2006-02-15T10:05:03'), - ('123', '442', '2006-02-15T10:05:03'), - ('82', '316', '2006-02-15T10:05:03'), - ('5', '316', '2006-02-15T10:05:03'), - ('143', '316', '2006-02-15T10:05:03'), - ('117', '316', '2006-02-15T10:05:03'), - ('58', '316', '2006-02-15T10:05:03'), - ('107', '781', '2006-02-15T10:05:03'), - ('76', '781', '2006-02-15T10:05:03'), - ('195', '781', '2006-02-15T10:05:03'), - ('63', '781', '2006-02-15T10:05:03'), - ('56', '781', '2006-02-15T10:05:03'), - ('24', '781', '2006-02-15T10:05:03'), - ('136', '781', '2006-02-15T10:05:03'), - ('166', '867', '2006-02-15T10:05:03'), - ('42', '867', '2006-02-15T10:05:03'), - ('184', '867', '2006-02-15T10:05:03'), - ('7', '554', '2006-02-15T10:05:03'), - ('197', '554', '2006-02-15T10:05:03'), - ('147', '554', '2006-02-15T10:05:03'), - ('167', '554', '2006-02-15T10:05:03'), - ('142', '554', '2006-02-15T10:05:03'), - ('185', '554', '2006-02-15T10:05:03'), - ('8', '554', '2006-02-15T10:05:03'), - ('195', '794', '2006-02-15T10:05:03'), - ('160', '794', '2006-02-15T10:05:03'), - ('17', '794', '2006-02-15T10:05:03'), - ('34', '794', '2006-02-15T10:05:03'), - ('142', '794', '2006-02-15T10:05:03'), - ('167', '794', '2006-02-15T10:05:03'), - ('136', '993', '2006-02-15T10:05:03'), - ('51', '993', '2006-02-15T10:05:03'), - ('170', '993', '2006-02-15T10:05:03'), - ('114', '993', '2006-02-15T10:05:03'), - ('33', '993', '2006-02-15T10:05:03'), - ('191', '993', '2006-02-15T10:05:03'), - ('200', '993', '2006-02-15T10:05:03'), - ('77', '993', '2006-02-15T10:05:03'), - ('105', '993', '2006-02-15T10:05:03'), - ('154', '170', '2006-02-15T10:05:03'), - ('135', '170', '2006-02-15T10:05:03'), - ('75', '170', '2006-02-15T10:05:03'), - ('7', '170', '2006-02-15T10:05:03'), - ('88', '170', '2006-02-15T10:05:03'), - ('121', '170', '2006-02-15T10:05:03'), - ('139', '170', '2006-02-15T10:05:03'), - ('151', '170', '2006-02-15T10:05:03'), - ('85', '337', '2006-02-15T10:05:03'), - ('13', '337', '2006-02-15T10:05:03'), - ('117', '337', '2006-02-15T10:05:03'), - ('94', '337', '2006-02-15T10:05:03'), - ('62', '337', '2006-02-15T10:05:03'), - ('92', '825', '2006-02-15T10:05:03'), - ('161', '825', '2006-02-15T10:05:03'), - ('44', '825', '2006-02-15T10:05:03'), - ('65', '541', '2006-02-15T10:05:03'), - ('192', '541', '2006-02-15T10:05:03'), - ('199', '541', '2006-02-15T10:05:03'), - ('75', '541', '2006-02-15T10:05:03'), - ('198', '541', '2006-02-15T10:05:03'), - ('196', '541', '2006-02-15T10:05:03'), - ('58', '541', '2006-02-15T10:05:03'), - ('15', '541', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('135', '541', '2006-02-15T10:05:03'), - ('200', '945', '2006-02-15T10:05:03'), - ('146', '945', '2006-02-15T10:05:03'), - ('12', '945', '2006-02-15T10:05:03'), - ('63', '945', '2006-02-15T10:05:03'), - ('96', '945', '2006-02-15T10:05:03'), - ('67', '945', '2006-02-15T10:05:03'), - ('104', '945', '2006-02-15T10:05:03'), - ('30', '945', '2006-02-15T10:05:03'), - ('165', '659', '2006-02-15T10:05:03'), - ('162', '659', '2006-02-15T10:05:03'), - ('106', '659', '2006-02-15T10:05:03'), - ('174', '659', '2006-02-15T10:05:03'), - ('120', '659', '2006-02-15T10:05:03'), - ('143', '659', '2006-02-15T10:05:03'), - ('73', '374', '2006-02-15T10:05:03'), - ('90', '374', '2006-02-15T10:05:03'), - ('190', '374', '2006-02-15T10:05:03'), - ('40', '374', '2006-02-15T10:05:03'), - ('69', '374', '2006-02-15T10:05:03'), - ('61', '374', '2006-02-15T10:05:03'), - ('190', '562', '2006-02-15T10:05:03'), - ('73', '562', '2006-02-15T10:05:03'), - ('132', '562', '2006-02-15T10:05:03'), - ('165', '95', '2006-02-15T10:05:03'), - ('76', '95', '2006-02-15T10:05:03'), - ('185', '95', '2006-02-15T10:05:03'), - ('186', '95', '2006-02-15T10:05:03'), - ('149', '95', '2006-02-15T10:05:03'), - ('95', '923', '2006-02-15T10:05:03'), - ('187', '923', '2006-02-15T10:05:03'), - ('86', '923', '2006-02-15T10:05:03'), - ('145', '923', '2006-02-15T10:05:03'), - ('140', '923', '2006-02-15T10:05:03'), - ('167', '923', '2006-02-15T10:05:03'), - ('47', '923', '2006-02-15T10:05:03'), - ('138', '923', '2006-02-15T10:05:03'), - ('124', '113', '2006-02-15T10:05:03'), - ('183', '113', '2006-02-15T10:05:03'), - ('179', '468', '2006-02-15T10:05:03'), - ('117', '468', '2006-02-15T10:05:03'), - ('124', '468', '2006-02-15T10:05:03'), - ('82', '468', '2006-02-15T10:05:03'), - ('126', '468', '2006-02-15T10:05:03'), - ('150', '468', '2006-02-15T10:05:03'), - ('148', '468', '2006-02-15T10:05:03'), - ('8', '532', '2006-02-15T10:05:03'), - ('71', '532', '2006-02-15T10:05:03'), - ('158', '532', '2006-02-15T10:05:03'), - ('28', '532', '2006-02-15T10:05:03'), - ('11', '532', '2006-02-15T10:05:03'), - ('173', '313', '2006-02-15T10:05:03'), - ('104', '313', '2006-02-15T10:05:03'), - ('183', '313', '2006-02-15T10:05:03'), - ('17', '313', '2006-02-15T10:05:03'), - ('106', '566', '2006-02-15T10:05:03'), - ('84', '566', '2006-02-15T10:05:03'), - ('171', '566', '2006-02-15T10:05:03'), - ('179', '566', '2006-02-15T10:05:03'), - ('77', '566', '2006-02-15T10:05:03'), - ('188', '566', '2006-02-15T10:05:03'), - ('191', '219', '2006-02-15T10:05:03'), - ('171', '219', '2006-02-15T10:05:03'), - ('32', '219', '2006-02-15T10:05:03'), - ('81', '219', '2006-02-15T10:05:03'), - ('45', '219', '2006-02-15T10:05:03'), - ('108', '219', '2006-02-15T10:05:03'), - ('134', '219', '2006-02-15T10:05:03'), - ('26', '225', '2006-02-15T10:05:03'), - ('7', '225', '2006-02-15T10:05:03'), - ('63', '225', '2006-02-15T10:05:03'), - ('9', '974', '2006-02-15T10:05:03'), - ('178', '974', '2006-02-15T10:05:03'), - ('51', '974', '2006-02-15T10:05:03'), - ('197', '974', '2006-02-15T10:05:03'), - ('44', '699', '2006-02-15T10:05:03'), - ('176', '699', '2006-02-15T10:05:03'), - ('111', '699', '2006-02-15T10:05:03'), - ('93', '699', '2006-02-15T10:05:03'), - ('92', '699', '2006-02-15T10:05:03'), - ('47', '25', '2006-02-15T10:05:03'), - ('4', '25', '2006-02-15T10:05:03'), - ('91', '25', '2006-02-15T10:05:03'), - ('1', '25', '2006-02-15T10:05:03'), - ('187', '25', '2006-02-15T10:05:03'), - ('166', '25', '2006-02-15T10:05:03'), - ('136', '25', '2006-02-15T10:05:03'), - ('167', '25', '2006-02-15T10:05:03'), - ('7', '25', '2006-02-15T10:05:03'), - ('16', '269', '2006-02-15T10:05:03'), - ('135', '269', '2006-02-15T10:05:03'), - ('161', '269', '2006-02-15T10:05:03'), - ('79', '269', '2006-02-15T10:05:03'), - ('20', '269', '2006-02-15T10:05:03'), - ('153', '64', '2006-02-15T10:05:03'), - ('124', '64', '2006-02-15T10:05:03'), - ('30', '64', '2006-02-15T10:05:03'), - ('196', '64', '2006-02-15T10:05:03'), - ('119', '64', '2006-02-15T10:05:03'), - ('158', '64', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('21', '507', '2006-02-15T10:05:03'), - ('130', '507', '2006-02-15T10:05:03'), - ('108', '507', '2006-02-15T10:05:03'), - ('181', '507', '2006-02-15T10:05:03'), - ('44', '109', '2006-02-15T10:05:03'), - ('53', '109', '2006-02-15T10:05:03'), - ('179', '109', '2006-02-15T10:05:03'), - ('145', '109', '2006-02-15T10:05:03'), - ('178', '109', '2006-02-15T10:05:03'), - ('193', '109', '2006-02-15T10:05:03'), - ('198', '109', '2006-02-15T10:05:03'), - ('103', '378', '2006-02-15T10:05:03'), - ('108', '378', '2006-02-15T10:05:03'), - ('189', '378', '2006-02-15T10:05:03'), - ('191', '378', '2006-02-15T10:05:03'), - ('17', '378', '2006-02-15T10:05:03'), - ('68', '378', '2006-02-15T10:05:03'), - ('43', '917', '2006-02-15T10:05:03'), - ('137', '917', '2006-02-15T10:05:03'), - ('18', '917', '2006-02-15T10:05:03'), - ('25', '697', '2006-02-15T10:05:03'), - ('37', '697', '2006-02-15T10:05:03'), - ('9', '697', '2006-02-15T10:05:03'), - ('89', '697', '2006-02-15T10:05:03'), - ('53', '697', '2006-02-15T10:05:03'), - ('150', '697', '2006-02-15T10:05:03'), - ('66', '697', '2006-02-15T10:05:03'), - ('185', '138', '2006-02-15T10:05:03'), - ('107', '138', '2006-02-15T10:05:03'), - ('109', '48', '2006-02-15T10:05:03'), - ('131', '48', '2006-02-15T10:05:03'), - ('58', '48', '2006-02-15T10:05:03'), - ('87', '48', '2006-02-15T10:05:03'), - ('91', '48', '2006-02-15T10:05:03'), - ('127', '48', '2006-02-15T10:05:03'), - ('116', '48', '2006-02-15T10:05:03'), - ('198', '264', '2006-02-15T10:05:03'), - ('123', '234', '2006-02-15T10:05:03'), - ('76', '234', '2006-02-15T10:05:03'), - ('88', '234', '2006-02-15T10:05:03'), - ('190', '234', '2006-02-15T10:05:03'), - ('123', '43', '2006-02-15T10:05:03'), - ('189', '43', '2006-02-15T10:05:03'), - ('161', '43', '2006-02-15T10:05:03'), - ('160', '43', '2006-02-15T10:05:03'), - ('34', '43', '2006-02-15T10:05:03'), - ('141', '43', '2006-02-15T10:05:03'), - ('28', '43', '2006-02-15T10:05:03'), - ('130', '43', '2006-02-15T10:05:03'), - ('126', '43', '2006-02-15T10:05:03'), - ('129', '230', '2006-02-15T10:05:03'), - ('41', '230', '2006-02-15T10:05:03'), - ('79', '230', '2006-02-15T10:05:03'), - ('66', '230', '2006-02-15T10:05:03'), - ('45', '115', '2006-02-15T10:05:03'), - ('8', '115', '2006-02-15T10:05:03'), - ('168', '115', '2006-02-15T10:05:03'), - ('100', '919', '2006-02-15T10:05:03'), - ('185', '919', '2006-02-15T10:05:03'), - ('14', '919', '2006-02-15T10:05:03'), - ('111', '919', '2006-02-15T10:05:03'), - ('153', '919', '2006-02-15T10:05:03'), - ('196', '919', '2006-02-15T10:05:03'), - ('194', '531', '2006-02-15T10:05:03'), - ('20', '531', '2006-02-15T10:05:03'), - ('197', '531', '2006-02-15T10:05:03'), - ('115', '531', '2006-02-15T10:05:03'), - ('37', '553', '2006-02-15T10:05:03'), - ('15', '553', '2006-02-15T10:05:03'), - ('135', '553', '2006-02-15T10:05:03'), - ('58', '553', '2006-02-15T10:05:03'), - ('92', '553', '2006-02-15T10:05:03'), - ('66', '553', '2006-02-15T10:05:03'), - ('127', '553', '2006-02-15T10:05:03'), - ('97', '553', '2006-02-15T10:05:03'), - ('138', '553', '2006-02-15T10:05:03'), - ('80', '553', '2006-02-15T10:05:03'), - ('118', '553', '2006-02-15T10:05:03'), - ('65', '371', '2006-02-15T10:05:03'), - ('142', '371', '2006-02-15T10:05:03'), - ('184', '371', '2006-02-15T10:05:03'), - ('117', '778', '2006-02-15T10:05:03'), - ('169', '778', '2006-02-15T10:05:03'), - ('175', '778', '2006-02-15T10:05:03'), - ('45', '778', '2006-02-15T10:05:03'), - ('140', '778', '2006-02-15T10:05:03'), - ('96', '778', '2006-02-15T10:05:03'), - ('75', '12', '2006-02-15T10:05:03'), - ('109', '12', '2006-02-15T10:05:03'), - ('105', '12', '2006-02-15T10:05:03'), - ('177', '12', '2006-02-15T10:05:03'), - ('37', '12', '2006-02-15T10:05:03'), - ('180', '12', '2006-02-15T10:05:03'), - ('146', '12', '2006-02-15T10:05:03'), - ('90', '330', '2006-02-15T10:05:03'), - ('43', '330', '2006-02-15T10:05:03'), - ('45', '330', '2006-02-15T10:05:03'), - ('59', '121', '2006-02-15T10:05:03'), - ('158', '121', '2006-02-15T10:05:03'), - ('51', '121', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('83', '121', '2006-02-15T10:05:03'), - ('16', '121', '2006-02-15T10:05:03'), - ('162', '121', '2006-02-15T10:05:03'), - ('200', '121', '2006-02-15T10:05:03'), - ('34', '90', '2006-02-15T10:05:03'), - ('139', '90', '2006-02-15T10:05:03'), - ('144', '90', '2006-02-15T10:05:03'), - ('92', '90', '2006-02-15T10:05:03'), - ('26', '90', '2006-02-15T10:05:03'), - ('114', '90', '2006-02-15T10:05:03'), - ('161', '90', '2006-02-15T10:05:03'), - ('116', '90', '2006-02-15T10:05:03'), - ('36', '715', '2006-02-15T10:05:03'), - ('26', '715', '2006-02-15T10:05:03'), - ('120', '715', '2006-02-15T10:05:03'), - ('183', '715', '2006-02-15T10:05:03'), - ('109', '174', '2006-02-15T10:05:03'), - ('46', '174', '2006-02-15T10:05:03'), - ('71', '956', '2006-02-15T10:05:03'), - ('116', '956', '2006-02-15T10:05:03'), - ('36', '956', '2006-02-15T10:05:03'), - ('72', '956', '2006-02-15T10:05:03'), - ('103', '956', '2006-02-15T10:05:03'), - ('74', '956', '2006-02-15T10:05:03'), - ('177', '956', '2006-02-15T10:05:03'), - ('10', '980', '2006-02-15T10:05:03'), - ('102', '980', '2006-02-15T10:05:03'), - ('32', '980', '2006-02-15T10:05:03'), - ('1', '980', '2006-02-15T10:05:03'), - ('49', '980', '2006-02-15T10:05:03'), - ('46', '980', '2006-02-15T10:05:03'), - ('64', '980', '2006-02-15T10:05:03'), - ('101', '980', '2006-02-15T10:05:03'), - ('53', '980', '2006-02-15T10:05:03'), - ('65', '158', '2006-02-15T10:05:03'), - ('105', '158', '2006-02-15T10:05:03'), - ('8', '158', '2006-02-15T10:05:03'), - ('122', '158', '2006-02-15T10:05:03'), - ('154', '158', '2006-02-15T10:05:03'), - ('42', '865', '2006-02-15T10:05:03'), - ('9', '865', '2006-02-15T10:05:03'), - ('5', '865', '2006-02-15T10:05:03'), - ('72', '865', '2006-02-15T10:05:03'), - ('112', '865', '2006-02-15T10:05:03'), - ('13', '528', '2006-02-15T10:05:03'), - ('115', '846', '2006-02-15T10:05:03'), - ('152', '846', '2006-02-15T10:05:03'), - ('34', '846', '2006-02-15T10:05:03'), - ('127', '846', '2006-02-15T10:05:03'), - ('100', '846', '2006-02-15T10:05:03'), - ('96', '846', '2006-02-15T10:05:03'), - ('7', '846', '2006-02-15T10:05:03'), - ('9', '514', '2006-02-15T10:05:03'), - ('146', '514', '2006-02-15T10:05:03'), - ('133', '514', '2006-02-15T10:05:03'), - ('58', '635', '2006-02-15T10:05:03'), - ('196', '635', '2006-02-15T10:05:03'), - ('1', '635', '2006-02-15T10:05:03'), - ('15', '635', '2006-02-15T10:05:03'), - ('4', '635', '2006-02-15T10:05:03'), - ('77', '635', '2006-02-15T10:05:03'), - ('133', '635', '2006-02-15T10:05:03'), - ('12', '635', '2006-02-15T10:05:03'), - ('26', '635', '2006-02-15T10:05:03'), - ('140', '373', '2006-02-15T10:05:03'), - ('139', '373', '2006-02-15T10:05:03'), - ('87', '421', '2006-02-15T10:05:03'), - ('165', '421', '2006-02-15T10:05:03'), - ('56', '421', '2006-02-15T10:05:03'), - ('85', '421', '2006-02-15T10:05:03'), - ('182', '421', '2006-02-15T10:05:03'), - ('154', '421', '2006-02-15T10:05:03'), - ('184', '169', '2006-02-15T10:05:03'), - ('164', '169', '2006-02-15T10:05:03'), - ('154', '169', '2006-02-15T10:05:03'), - ('149', '169', '2006-02-15T10:05:03'), - ('196', '169', '2006-02-15T10:05:03'), - ('14', '232', '2006-02-15T10:05:03'), - ('143', '232', '2006-02-15T10:05:03'), - ('194', '232', '2006-02-15T10:05:03'), - ('81', '232', '2006-02-15T10:05:03'), - ('151', '232', '2006-02-15T10:05:03'), - ('48', '926', '2006-02-15T10:05:03'), - ('123', '926', '2006-02-15T10:05:03'), - ('117', '926', '2006-02-15T10:05:03'), - ('104', '926', '2006-02-15T10:05:03'), - ('9', '926', '2006-02-15T10:05:03'), - ('81', '398', '2006-02-15T10:05:03'), - ('27', '398', '2006-02-15T10:05:03'), - ('4', '398', '2006-02-15T10:05:03'), - ('21', '398', '2006-02-15T10:05:03'), - ('169', '398', '2006-02-15T10:05:03'), - ('65', '398', '2006-02-15T10:05:03'), - ('62', '398', '2006-02-15T10:05:03'), - ('40', '754', '2006-02-15T10:05:03'), - ('54', '754', '2006-02-15T10:05:03'), - ('156', '754', '2006-02-15T10:05:03'), - ('115', '754', '2006-02-15T10:05:03'), - ('33', '754', '2006-02-15T10:05:03'), - ('60', '754', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('2', '754', '2006-02-15T10:05:03'), - ('172', '609', '2006-02-15T10:05:03'), - ('180', '609', '2006-02-15T10:05:03'), - ('72', '609', '2006-02-15T10:05:03'), - ('181', '609', '2006-02-15T10:05:03'), - ('103', '609', '2006-02-15T10:05:03'), - ('116', '606', '2006-02-15T10:05:03'), - ('25', '606', '2006-02-15T10:05:03'), - ('102', '606', '2006-02-15T10:05:03'), - ('188', '606', '2006-02-15T10:05:03'), - ('32', '606', '2006-02-15T10:05:03'), - ('39', '606', '2006-02-15T10:05:03'), - ('112', '606', '2006-02-15T10:05:03'), - ('107', '606', '2006-02-15T10:05:03'), - ('76', '606', '2006-02-15T10:05:03'), - ('87', '606', '2006-02-15T10:05:03'), - ('105', '606', '2006-02-15T10:05:03'), - ('190', '606', '2006-02-15T10:05:03'), - ('17', '606', '2006-02-15T10:05:03'), - ('106', '365', '2006-02-15T10:05:03'), - ('149', '365', '2006-02-15T10:05:03'), - ('64', '860', '2006-02-15T10:05:03'), - ('123', '860', '2006-02-15T10:05:03'), - ('126', '860', '2006-02-15T10:05:03'), - ('145', '527', '2006-02-15T10:05:03'), - ('151', '527', '2006-02-15T10:05:03'), - ('81', '527', '2006-02-15T10:05:03'), - ('20', '527', '2006-02-15T10:05:03'), - ('42', '527', '2006-02-15T10:05:03'), - ('82', '527', '2006-02-15T10:05:03'), - ('84', '460', '2006-02-15T10:05:03'), - ('58', '460', '2006-02-15T10:05:03'), - ('18', '460', '2006-02-15T10:05:03'), - ('25', '871', '2006-02-15T10:05:03'), - ('146', '871', '2006-02-15T10:05:03'), - ('12', '871', '2006-02-15T10:05:03'), - ('66', '871', '2006-02-15T10:05:03'), - ('198', '871', '2006-02-15T10:05:03'), - ('38', '24', '2006-02-15T10:05:03'), - ('179', '24', '2006-02-15T10:05:03'), - ('42', '24', '2006-02-15T10:05:03'), - ('67', '24', '2006-02-15T10:05:03'), - ('157', '24', '2006-02-15T10:05:03'), - ('115', '952', '2006-02-15T10:05:03'), - ('87', '952', '2006-02-15T10:05:03'), - ('44', '952', '2006-02-15T10:05:03'), - ('60', '952', '2006-02-15T10:05:03'), - ('198', '952', '2006-02-15T10:05:03'), - ('133', '952', '2006-02-15T10:05:03'), - ('23', '419', '2006-02-15T10:05:03'), - ('200', '419', '2006-02-15T10:05:03'), - ('126', '419', '2006-02-15T10:05:03'), - ('198', '570', '2006-02-15T10:05:03'), - ('119', '570', '2006-02-15T10:05:03'), - ('87', '570', '2006-02-15T10:05:03'), - ('48', '570', '2006-02-15T10:05:03'), - ('151', '570', '2006-02-15T10:05:03'), - ('139', '570', '2006-02-15T10:05:03'), - ('94', '270', '2006-02-15T10:05:03'), - ('150', '270', '2006-02-15T10:05:03'), - ('133', '270', '2006-02-15T10:05:03'), - ('7', '292', '2006-02-15T10:05:03'), - ('113', '292', '2006-02-15T10:05:03'), - ('14', '292', '2006-02-15T10:05:03'), - ('69', '292', '2006-02-15T10:05:03'), - ('30', '292', '2006-02-15T10:05:03'), - ('54', '292', '2006-02-15T10:05:03'), - ('110', '292', '2006-02-15T10:05:03'), - ('107', '292', '2006-02-15T10:05:03'), - ('74', '780', '2006-02-15T10:05:03'), - ('174', '780', '2006-02-15T10:05:03'), - ('61', '780', '2006-02-15T10:05:03'), - ('121', '780', '2006-02-15T10:05:03'), - ('106', '780', '2006-02-15T10:05:03'), - ('75', '780', '2006-02-15T10:05:03'), - ('167', '72', '2006-02-15T10:05:03'), - ('98', '72', '2006-02-15T10:05:03'), - ('85', '72', '2006-02-15T10:05:03'), - ('149', '72', '2006-02-15T10:05:03'), - ('165', '72', '2006-02-15T10:05:03'), - ('59', '72', '2006-02-15T10:05:03'), - ('116', '939', '2006-02-15T10:05:03'), - ('196', '939', '2006-02-15T10:05:03'), - ('119', '939', '2006-02-15T10:05:03'), - ('1', '939', '2006-02-15T10:05:03'), - ('150', '190', '2006-02-15T10:05:03'), - ('109', '190', '2006-02-15T10:05:03'), - ('124', '190', '2006-02-15T10:05:03'), - ('91', '190', '2006-02-15T10:05:03'), - ('117', '190', '2006-02-15T10:05:03'), - ('175', '190', '2006-02-15T10:05:03'), - ('35', '612', '2006-02-15T10:05:03'), - ('18', '612', '2006-02-15T10:05:03'), - ('77', '612', '2006-02-15T10:05:03'), - ('55', '612', '2006-02-15T10:05:03'), - ('14', '612', '2006-02-15T10:05:03'), - ('69', '612', '2006-02-15T10:05:03'), - ('162', '612', '2006-02-15T10:05:03'), - ('105', '283', '2006-02-15T10:05:03'), - ('66', '283', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('11', '283', '2006-02-15T10:05:03'), - ('36', '283', '2006-02-15T10:05:03'), - ('163', '283', '2006-02-15T10:05:03'), - ('181', '152', '2006-02-15T10:05:03'), - ('19', '152', '2006-02-15T10:05:03'), - ('130', '478', '2006-02-15T10:05:03'), - ('20', '478', '2006-02-15T10:05:03'), - ('17', '478', '2006-02-15T10:05:03'), - ('46', '478', '2006-02-15T10:05:03'), - ('85', '478', '2006-02-15T10:05:03'), - ('2', '31', '2006-02-15T10:05:03'), - ('60', '31', '2006-02-15T10:05:03'), - ('49', '31', '2006-02-15T10:05:03'), - ('15', '31', '2006-02-15T10:05:03'), - ('163', '444', '2006-02-15T10:05:03'), - ('76', '444', '2006-02-15T10:05:03'), - ('29', '444', '2006-02-15T10:05:03'), - ('153', '444', '2006-02-15T10:05:03'), - ('86', '137', '2006-02-15T10:05:03'), - ('92', '137', '2006-02-15T10:05:03'), - ('108', '137', '2006-02-15T10:05:03'), - ('101', '85', '2006-02-15T10:05:03'), - ('60', '85', '2006-02-15T10:05:03'), - ('162', '85', '2006-02-15T10:05:03'), - ('5', '85', '2006-02-15T10:05:03'), - ('126', '85', '2006-02-15T10:05:03'), - ('147', '85', '2006-02-15T10:05:03'), - ('27', '85', '2006-02-15T10:05:03'), - ('179', '85', '2006-02-15T10:05:03'), - ('85', '85', '2006-02-15T10:05:03'), - ('166', '944', '2006-02-15T10:05:03'), - ('128', '944', '2006-02-15T10:05:03'), - ('18', '944', '2006-02-15T10:05:03'), - ('100', '944', '2006-02-15T10:05:03'), - ('29', '944', '2006-02-15T10:05:03'), - ('63', '944', '2006-02-15T10:05:03'), - ('47', '944', '2006-02-15T10:05:03'), - ('44', '944', '2006-02-15T10:05:03'), - ('137', '14', '2006-02-15T10:05:03'), - ('85', '14', '2006-02-15T10:05:03'), - ('188', '14', '2006-02-15T10:05:03'), - ('28', '14', '2006-02-15T10:05:03'), - ('132', '410', '2006-02-15T10:05:03'), - ('43', '410', '2006-02-15T10:05:03'), - ('89', '410', '2006-02-15T10:05:03'), - ('137', '410', '2006-02-15T10:05:03'), - ('147', '410', '2006-02-15T10:05:03'), - ('162', '410', '2006-02-15T10:05:03'), - ('191', '410', '2006-02-15T10:05:03'), - ('36', '410', '2006-02-15T10:05:03'), - ('146', '410', '2006-02-15T10:05:03'), - ('133', '410', '2006-02-15T10:05:03'), - ('103', '271', '2006-02-15T10:05:03'), - ('16', '271', '2006-02-15T10:05:03'), - ('136', '271', '2006-02-15T10:05:03'), - ('51', '891', '2006-02-15T10:05:03'), - ('163', '891', '2006-02-15T10:05:03'), - ('57', '891', '2006-02-15T10:05:03'), - ('152', '891', '2006-02-15T10:05:03'), - ('144', '184', '2006-02-15T10:05:03'), - ('54', '184', '2006-02-15T10:05:03'), - ('170', '184', '2006-02-15T10:05:03'), - ('104', '184', '2006-02-15T10:05:03'), - ('8', '205', '2006-02-15T10:05:03'), - ('68', '205', '2006-02-15T10:05:03'), - ('11', '205', '2006-02-15T10:05:03'), - ('102', '205', '2006-02-15T10:05:03'), - ('79', '205', '2006-02-15T10:05:03'), - ('146', '207', '2006-02-15T10:05:03'), - ('49', '207', '2006-02-15T10:05:03'), - ('92', '207', '2006-02-15T10:05:03'), - ('80', '207', '2006-02-15T10:05:03'), - ('95', '207', '2006-02-15T10:05:03'), - ('87', '207', '2006-02-15T10:05:03'), - ('141', '207', '2006-02-15T10:05:03'), - ('66', '207', '2006-02-15T10:05:03'), - ('124', '814', '2006-02-15T10:05:03'), - ('135', '814', '2006-02-15T10:05:03'), - ('128', '814', '2006-02-15T10:05:03'), - ('146', '372', '2006-02-15T10:05:03'), - ('105', '372', '2006-02-15T10:05:03'), - ('50', '372', '2006-02-15T10:05:03'), - ('75', '372', '2006-02-15T10:05:03'), - ('61', '372', '2006-02-15T10:05:03'), - ('169', '372', '2006-02-15T10:05:03'), - ('76', '223', '2006-02-15T10:05:03'), - ('123', '223', '2006-02-15T10:05:03'), - ('159', '223', '2006-02-15T10:05:03'), - ('38', '223', '2006-02-15T10:05:03'), - ('40', '223', '2006-02-15T10:05:03'), - ('188', '223', '2006-02-15T10:05:03'), - ('141', '223', '2006-02-15T10:05:03'), - ('125', '568', '2006-02-15T10:05:03'), - ('76', '568', '2006-02-15T10:05:03'), - ('92', '568', '2006-02-15T10:05:03'), - ('198', '568', '2006-02-15T10:05:03'), - ('42', '568', '2006-02-15T10:05:03'), - ('101', '568', '2006-02-15T10:05:03'), - ('33', '737', '2006-02-15T10:05:03'), - ('40', '737', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('165', '737', '2006-02-15T10:05:03'), - ('57', '737', '2006-02-15T10:05:03'), - ('111', '737', '2006-02-15T10:05:03'), - ('51', '737', '2006-02-15T10:05:03'), - ('47', '737', '2006-02-15T10:05:03'), - ('179', '737', '2006-02-15T10:05:03'), - ('150', '306', '2006-02-15T10:05:03'), - ('50', '306', '2006-02-15T10:05:03'), - ('69', '306', '2006-02-15T10:05:03'), - ('124', '306', '2006-02-15T10:05:03'), - ('82', '306', '2006-02-15T10:05:03'), - ('33', '306', '2006-02-15T10:05:03'), - ('166', '306', '2006-02-15T10:05:03'), - ('89', '306', '2006-02-15T10:05:03'), - ('58', '306', '2006-02-15T10:05:03'), - ('114', '162', '2006-02-15T10:05:03'), - ('13', '162', '2006-02-15T10:05:03'), - ('89', '162', '2006-02-15T10:05:03'), - ('132', '162', '2006-02-15T10:05:03'), - ('107', '162', '2006-02-15T10:05:03'), - ('173', '162', '2006-02-15T10:05:03'), - ('111', '162', '2006-02-15T10:05:03'), - ('176', '162', '2006-02-15T10:05:03'), - ('66', '793', '2006-02-15T10:05:03'), - ('31', '793', '2006-02-15T10:05:03'), - ('28', '793', '2006-02-15T10:05:03'), - ('38', '793', '2006-02-15T10:05:03'), - ('94', '989', '2006-02-15T10:05:03'), - ('37', '989', '2006-02-15T10:05:03'), - ('151', '989', '2006-02-15T10:05:03'), - ('188', '989', '2006-02-15T10:05:03'), - ('138', '989', '2006-02-15T10:05:03'), - ('58', '632', '2006-02-15T10:05:03'), - ('50', '632', '2006-02-15T10:05:03'), - ('36', '81', '2006-02-15T10:05:03'), - ('98', '81', '2006-02-15T10:05:03'), - ('132', '81', '2006-02-15T10:05:03'), - ('123', '67', '2006-02-15T10:05:03'), - ('7', '67', '2006-02-15T10:05:03'), - ('67', '67', '2006-02-15T10:05:03'), - ('47', '67', '2006-02-15T10:05:03'), - ('141', '67', '2006-02-15T10:05:03'), - ('155', '67', '2006-02-15T10:05:03'), - ('194', '67', '2006-02-15T10:05:03'), - ('175', '67', '2006-02-15T10:05:03'), - ('199', '67', '2006-02-15T10:05:03'), - ('144', '67', '2006-02-15T10:05:03'), - ('126', '370', '2006-02-15T10:05:03'), - ('151', '370', '2006-02-15T10:05:03'), - ('140', '370', '2006-02-15T10:05:03'), - ('97', '370', '2006-02-15T10:05:03'), - ('23', '370', '2006-02-15T10:05:03'), - ('14', '370', '2006-02-15T10:05:03'), - ('197', '370', '2006-02-15T10:05:03'), - ('56', '236', '2006-02-15T10:05:03'), - ('17', '236', '2006-02-15T10:05:03'), - ('69', '236', '2006-02-15T10:05:03'), - ('10', '236', '2006-02-15T10:05:03'), - ('15', '236', '2006-02-15T10:05:03'), - ('9', '147', '2006-02-15T10:05:03'), - ('26', '147', '2006-02-15T10:05:03'), - ('43', '147', '2006-02-15T10:05:03'), - ('131', '147', '2006-02-15T10:05:03'), - ('197', '147', '2006-02-15T10:05:03'), - ('134', '897', '2006-02-15T10:05:03'), - ('50', '897', '2006-02-15T10:05:03'), - ('169', '897', '2006-02-15T10:05:03'), - ('132', '897', '2006-02-15T10:05:03'), - ('13', '897', '2006-02-15T10:05:03'), - ('83', '932', '2006-02-15T10:05:03'), - ('63', '932', '2006-02-15T10:05:03'), - ('42', '932', '2006-02-15T10:05:03'), - ('101', '932', '2006-02-15T10:05:03'), - ('86', '760', '2006-02-15T10:05:03'), - ('76', '760', '2006-02-15T10:05:03'), - ('144', '99', '2006-02-15T10:05:03'), - ('48', '99', '2006-02-15T10:05:03'), - ('60', '436', '2006-02-15T10:05:03'), - ('29', '436', '2006-02-15T10:05:03'), - ('75', '436', '2006-02-15T10:05:03'), - ('131', '436', '2006-02-15T10:05:03'), - ('80', '436', '2006-02-15T10:05:03'), - ('92', '436', '2006-02-15T10:05:03'), - ('65', '106', '2006-02-15T10:05:03'), - ('124', '106', '2006-02-15T10:05:03'), - ('173', '106', '2006-02-15T10:05:03'), - ('1', '106', '2006-02-15T10:05:03'), - ('147', '310', '2006-02-15T10:05:03'), - ('190', '310', '2006-02-15T10:05:03'), - ('17', '310', '2006-02-15T10:05:03'), - ('166', '622', '2006-02-15T10:05:03'), - ('192', '622', '2006-02-15T10:05:03'), - ('174', '622', '2006-02-15T10:05:03'), - ('116', '622', '2006-02-15T10:05:03'), - ('99', '622', '2006-02-15T10:05:03'), - ('180', '622', '2006-02-15T10:05:03'), - ('109', '622', '2006-02-15T10:05:03'), - ('80', '622', '2006-02-15T10:05:03'), - ('54', '546', '2006-02-15T10:05:03'), - ('181', '546', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('95', '546', '2006-02-15T10:05:03'), - ('42', '546', '2006-02-15T10:05:03'), - ('27', '679', '2006-02-15T10:05:03'), - ('87', '679', '2006-02-15T10:05:03'), - ('190', '679', '2006-02-15T10:05:03'), - ('60', '679', '2006-02-15T10:05:03'), - ('28', '679', '2006-02-15T10:05:03'), - ('182', '679', '2006-02-15T10:05:03'), - ('111', '679', '2006-02-15T10:05:03'), - ('39', '689', '2006-02-15T10:05:03'), - ('78', '689', '2006-02-15T10:05:03'), - ('59', '689', '2006-02-15T10:05:03'), - ('193', '689', '2006-02-15T10:05:03'), - ('199', '689', '2006-02-15T10:05:03'), - ('52', '689', '2006-02-15T10:05:03'), - ('37', '555', '2006-02-15T10:05:03'), - ('2', '555', '2006-02-15T10:05:03'), - ('158', '555', '2006-02-15T10:05:03'), - ('198', '555', '2006-02-15T10:05:03'), - ('111', '555', '2006-02-15T10:05:03'), - ('38', '274', '2006-02-15T10:05:03'), - ('162', '274', '2006-02-15T10:05:03'), - ('20', '274', '2006-02-15T10:05:03'), - ('154', '274', '2006-02-15T10:05:03'), - ('50', '274', '2006-02-15T10:05:03'), - ('111', '731', '2006-02-15T10:05:03'), - ('67', '731', '2006-02-15T10:05:03'), - ('22', '731', '2006-02-15T10:05:03'), - ('146', '731', '2006-02-15T10:05:03'), - ('140', '731', '2006-02-15T10:05:03'), - ('36', '731', '2006-02-15T10:05:03'), - ('46', '731', '2006-02-15T10:05:03'), - ('61', '766', '2006-02-15T10:05:03'), - ('67', '766', '2006-02-15T10:05:03'), - ('23', '766', '2006-02-15T10:05:03'), - ('7', '766', '2006-02-15T10:05:03'), - ('46', '766', '2006-02-15T10:05:03'), - ('153', '766', '2006-02-15T10:05:03'), - ('3', '341', '2006-02-15T10:05:03'), - ('134', '341', '2006-02-15T10:05:03'), - ('141', '341', '2006-02-15T10:05:03'), - ('147', '341', '2006-02-15T10:05:03'), - ('167', '341', '2006-02-15T10:05:03'), - ('80', '341', '2006-02-15T10:05:03'), - ('52', '341', '2006-02-15T10:05:03'), - ('41', '799', '2006-02-15T10:05:03'), - ('40', '799', '2006-02-15T10:05:03'), - ('158', '799', '2006-02-15T10:05:03'), - ('198', '886', '2006-02-15T10:05:03'), - ('170', '886', '2006-02-15T10:05:03'), - ('15', '886', '2006-02-15T10:05:03'), - ('199', '886', '2006-02-15T10:05:03'), - ('16', '886', '2006-02-15T10:05:03'), - ('168', '886', '2006-02-15T10:05:03'), - ('118', '399', '2006-02-15T10:05:03'), - ('154', '399', '2006-02-15T10:05:03'), - ('2', '399', '2006-02-15T10:05:03'), - ('106', '399', '2006-02-15T10:05:03'), - ('71', '399', '2006-02-15T10:05:03'), - ('97', '446', '2006-02-15T10:05:03'), - ('138', '446', '2006-02-15T10:05:03'), - ('123', '446', '2006-02-15T10:05:03'), - ('137', '446', '2006-02-15T10:05:03'), - ('85', '446', '2006-02-15T10:05:03'), - ('150', '446', '2006-02-15T10:05:03'), - ('89', '446', '2006-02-15T10:05:03'), - ('102', '446', '2006-02-15T10:05:03'), - ('75', '446', '2006-02-15T10:05:03'), - ('62', '951', '2006-02-15T10:05:03'), - ('66', '951', '2006-02-15T10:05:03'), - ('97', '951', '2006-02-15T10:05:03'), - ('52', '951', '2006-02-15T10:05:03'), - ('65', '951', '2006-02-15T10:05:03'), - ('107', '879', '2006-02-15T10:05:03'), - ('28', '879', '2006-02-15T10:05:03'), - ('138', '879', '2006-02-15T10:05:03'), - ('52', '879', '2006-02-15T10:05:03'), - ('200', '879', '2006-02-15T10:05:03'), - ('174', '879', '2006-02-15T10:05:03'), - ('158', '879', '2006-02-15T10:05:03'), - ('22', '369', '2006-02-15T10:05:03'), - ('110', '369', '2006-02-15T10:05:03'), - ('126', '369', '2006-02-15T10:05:03'), - ('107', '369', '2006-02-15T10:05:03'), - ('83', '369', '2006-02-15T10:05:03'), - ('5', '369', '2006-02-15T10:05:03'), - ('197', '369', '2006-02-15T10:05:03'), - ('2', '369', '2006-02-15T10:05:03'), - ('162', '500', '2006-02-15T10:05:03'), - ('17', '500', '2006-02-15T10:05:03'), - ('184', '500', '2006-02-15T10:05:03'), - ('106', '500', '2006-02-15T10:05:03'), - ('27', '500', '2006-02-15T10:05:03'), - ('42', '500', '2006-02-15T10:05:03'), - ('15', '500', '2006-02-15T10:05:03'), - ('141', '740', '2006-02-15T10:05:03'), - ('176', '740', '2006-02-15T10:05:03'), - ('115', '740', '2006-02-15T10:05:03'), - ('41', '779', '2006-02-15T10:05:03'), - ('171', '779', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('100', '779', '2006-02-15T10:05:03'), - ('16', '779', '2006-02-15T10:05:03'), - ('165', '779', '2006-02-15T10:05:03'), - ('187', '779', '2006-02-15T10:05:03'), - ('34', '779', '2006-02-15T10:05:03'), - ('141', '909', '2006-02-15T10:05:03'), - ('100', '909', '2006-02-15T10:05:03'), - ('146', '909', '2006-02-15T10:05:03'), - ('66', '909', '2006-02-15T10:05:03'), - ('93', '909', '2006-02-15T10:05:03'), - ('4', '909', '2006-02-15T10:05:03'), - ('162', '909', '2006-02-15T10:05:03'), - ('57', '258', '2006-02-15T10:05:03'), - ('180', '258', '2006-02-15T10:05:03'), - ('140', '258', '2006-02-15T10:05:03'), - ('113', '258', '2006-02-15T10:05:03'), - ('14', '258', '2006-02-15T10:05:03'), - ('138', '258', '2006-02-15T10:05:03'), - ('197', '258', '2006-02-15T10:05:03'), - ('55', '620', '2006-02-15T10:05:03'), - ('99', '620', '2006-02-15T10:05:03'), - ('122', '620', '2006-02-15T10:05:03'), - ('88', '620', '2006-02-15T10:05:03'), - ('136', '620', '2006-02-15T10:05:03'), - ('177', '55', '2006-02-15T10:05:03'), - ('166', '55', '2006-02-15T10:05:03'), - ('66', '55', '2006-02-15T10:05:03'), - ('173', '55', '2006-02-15T10:05:03'), - ('118', '55', '2006-02-15T10:05:03'), - ('140', '736', '2006-02-15T10:05:03'), - ('39', '736', '2006-02-15T10:05:03'), - ('103', '585', '2006-02-15T10:05:03'), - ('106', '585', '2006-02-15T10:05:03'), - ('61', '585', '2006-02-15T10:05:03'), - ('24', '585', '2006-02-15T10:05:03'), - ('31', '585', '2006-02-15T10:05:03'), - ('32', '585', '2006-02-15T10:05:03'), - ('123', '480', '2006-02-15T10:05:03'), - ('3', '480', '2006-02-15T10:05:03'), - ('153', '480', '2006-02-15T10:05:03'), - ('91', '480', '2006-02-15T10:05:03'), - ('10', '480', '2006-02-15T10:05:03'), - ('82', '480', '2006-02-15T10:05:03'), - ('184', '745', '2006-02-15T10:05:03'), - ('193', '745', '2006-02-15T10:05:03'), - ('198', '745', '2006-02-15T10:05:03'), - ('15', '745', '2006-02-15T10:05:03'), - ('137', '745', '2006-02-15T10:05:03'), - ('99', '250', '2006-02-15T10:05:03'), - ('49', '250', '2006-02-15T10:05:03'), - ('125', '250', '2006-02-15T10:05:03'), - ('87', '250', '2006-02-15T10:05:03'), - ('134', '250', '2006-02-15T10:05:03'), - ('101', '250', '2006-02-15T10:05:03'), - ('179', '250', '2006-02-15T10:05:03'), - ('100', '250', '2006-02-15T10:05:03'), - ('133', '588', '2006-02-15T10:05:03'), - ('154', '588', '2006-02-15T10:05:03'), - ('198', '588', '2006-02-15T10:05:03'), - ('134', '588', '2006-02-15T10:05:03'), - ('13', '588', '2006-02-15T10:05:03'), - ('161', '588', '2006-02-15T10:05:03'), - ('179', '588', '2006-02-15T10:05:03'), - ('37', '588', '2006-02-15T10:05:03'), - ('37', '963', '2006-02-15T10:05:03'), - ('77', '963', '2006-02-15T10:05:03'), - ('180', '963', '2006-02-15T10:05:03'), - ('78', '963', '2006-02-15T10:05:03'), - ('55', '963', '2006-02-15T10:05:03'), - ('53', '307', '2006-02-15T10:05:03'), - ('61', '307', '2006-02-15T10:05:03'), - ('56', '307', '2006-02-15T10:05:03'), - ('122', '307', '2006-02-15T10:05:03'), - ('163', '307', '2006-02-15T10:05:03'), - ('64', '307', '2006-02-15T10:05:03'), - ('55', '307', '2006-02-15T10:05:03'), - ('145', '120', '2006-02-15T10:05:03'), - ('110', '120', '2006-02-15T10:05:03'), - ('167', '120', '2006-02-15T10:05:03'), - ('93', '120', '2006-02-15T10:05:03'), - ('83', '120', '2006-02-15T10:05:03'), - ('98', '120', '2006-02-15T10:05:03'), - ('131', '120', '2006-02-15T10:05:03'), - ('161', '120', '2006-02-15T10:05:03'), - ('162', '844', '2006-02-15T10:05:03'), - ('56', '844', '2006-02-15T10:05:03'), - ('116', '844', '2006-02-15T10:05:03'), - ('156', '844', '2006-02-15T10:05:03'), - ('47', '734', '2006-02-15T10:05:03'), - ('17', '734', '2006-02-15T10:05:03'), - ('189', '734', '2006-02-15T10:05:03'), - ('21', '734', '2006-02-15T10:05:03'), - ('167', '734', '2006-02-15T10:05:03'), - ('146', '734', '2006-02-15T10:05:03'), - ('51', '734', '2006-02-15T10:05:03'), - ('98', '734', '2006-02-15T10:05:03'), - ('84', '843', '2006-02-15T10:05:03'), - ('198', '843', '2006-02-15T10:05:03'), - ('13', '843', '2006-02-15T10:05:03'), - ('123', '593', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('27', '593', '2006-02-15T10:05:03'), - ('156', '593', '2006-02-15T10:05:03'), - ('188', '593', '2006-02-15T10:05:03'), - ('56', '593', '2006-02-15T10:05:03'), - ('12', '593', '2006-02-15T10:05:03'), - ('112', '829', '2006-02-15T10:05:03'), - ('24', '829', '2006-02-15T10:05:03'), - ('98', '829', '2006-02-15T10:05:03'), - ('46', '829', '2006-02-15T10:05:03'), - ('66', '829', '2006-02-15T10:05:03'), - ('50', '829', '2006-02-15T10:05:03'), - ('91', '829', '2006-02-15T10:05:03'), - ('141', '829', '2006-02-15T10:05:03'), - ('150', '168', '2006-02-15T10:05:03'), - ('174', '168', '2006-02-15T10:05:03'), - ('39', '168', '2006-02-15T10:05:03'), - ('187', '168', '2006-02-15T10:05:03'), - ('128', '168', '2006-02-15T10:05:03'), - ('109', '786', '2006-02-15T10:05:03'), - ('123', '786', '2006-02-15T10:05:03'), - ('119', '786', '2006-02-15T10:05:03'), - ('162', '786', '2006-02-15T10:05:03'), - ('194', '786', '2006-02-15T10:05:03'), - ('83', '340', '2006-02-15T10:05:03'), - ('26', '340', '2006-02-15T10:05:03'), - ('55', '340', '2006-02-15T10:05:03'), - ('161', '340', '2006-02-15T10:05:03'), - ('57', '340', '2006-02-15T10:05:03'), - ('5', '340', '2006-02-15T10:05:03'), - ('34', '336', '2006-02-15T10:05:03'), - ('128', '336', '2006-02-15T10:05:03'), - ('184', '336', '2006-02-15T10:05:03'), - ('116', '336', '2006-02-15T10:05:03'), - ('168', '336', '2006-02-15T10:05:03'), - ('41', '336', '2006-02-15T10:05:03'), - ('3', '336', '2006-02-15T10:05:03'), - ('101', '511', '2006-02-15T10:05:03'), - ('91', '511', '2006-02-15T10:05:03'), - ('85', '812', '2006-02-15T10:05:03'), - ('117', '812', '2006-02-15T10:05:03'), - ('158', '812', '2006-02-15T10:05:03'), - ('12', '812', '2006-02-15T10:05:03'), - ('29', '812', '2006-02-15T10:05:03'), - ('52', '812', '2006-02-15T10:05:03'), - ('197', '129', '2006-02-15T10:05:03'), - ('54', '129', '2006-02-15T10:05:03'), - ('195', '129', '2006-02-15T10:05:03'), - ('175', '129', '2006-02-15T10:05:03'), - ('59', '129', '2006-02-15T10:05:03'), - ('62', '129', '2006-02-15T10:05:03'), - ('13', '346', '2006-02-15T10:05:03'), - ('182', '346', '2006-02-15T10:05:03'), - ('200', '346', '2006-02-15T10:05:03'), - ('127', '613', '2006-02-15T10:05:03'), - ('164', '613', '2006-02-15T10:05:03'), - ('143', '613', '2006-02-15T10:05:03'), - ('81', '613', '2006-02-15T10:05:03'), - ('151', '895', '2006-02-15T10:05:03'), - ('45', '895', '2006-02-15T10:05:03'), - ('8', '895', '2006-02-15T10:05:03'), - ('51', '895', '2006-02-15T10:05:03'), - ('103', '895', '2006-02-15T10:05:03'), - ('85', '895', '2006-02-15T10:05:03'), - ('105', '795', '2006-02-15T10:05:03'), - ('122', '795', '2006-02-15T10:05:03'), - ('56', '795', '2006-02-15T10:05:03'), - ('26', '795', '2006-02-15T10:05:03'), - ('196', '795', '2006-02-15T10:05:03'), - ('50', '795', '2006-02-15T10:05:03'), - ('15', '795', '2006-02-15T10:05:03'), - ('108', '741', '2006-02-15T10:05:03'), - ('99', '741', '2006-02-15T10:05:03'), - ('34', '119', '2006-02-15T10:05:03'), - ('128', '119', '2006-02-15T10:05:03'), - ('127', '119', '2006-02-15T10:05:03'), - ('193', '119', '2006-02-15T10:05:03'), - ('37', '119', '2006-02-15T10:05:03'), - ('58', '119', '2006-02-15T10:05:03'), - ('17', '119', '2006-02-15T10:05:03'), - ('105', '42', '2006-02-15T10:05:03'), - ('194', '42', '2006-02-15T10:05:03'), - ('23', '42', '2006-02-15T10:05:03'), - ('117', '42', '2006-02-15T10:05:03'), - ('43', '42', '2006-02-15T10:05:03'), - ('3', '42', '2006-02-15T10:05:03'), - ('62', '42', '2006-02-15T10:05:03'), - ('145', '726', '2006-02-15T10:05:03'), - ('176', '726', '2006-02-15T10:05:03'), - ('99', '726', '2006-02-15T10:05:03'), - ('67', '726', '2006-02-15T10:05:03'), - ('113', '726', '2006-02-15T10:05:03'), - ('177', '726', '2006-02-15T10:05:03'), - ('58', '726', '2006-02-15T10:05:03'), - ('124', '726', '2006-02-15T10:05:03'), - ('121', '198', '2006-02-15T10:05:03'), - ('62', '198', '2006-02-15T10:05:03'), - ('104', '198', '2006-02-15T10:05:03'), - ('156', '198', '2006-02-15T10:05:03'), - ('45', '198', '2006-02-15T10:05:03'), - ('172', '385', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('47', '385', '2006-02-15T10:05:03'), - ('62', '385', '2006-02-15T10:05:03'), - ('71', '385', '2006-02-15T10:05:03'), - ('90', '385', '2006-02-15T10:05:03'), - ('133', '385', '2006-02-15T10:05:03'), - ('13', '385', '2006-02-15T10:05:03'), - ('3', '17', '2006-02-15T10:05:03'), - ('13', '17', '2006-02-15T10:05:03'), - ('160', '17', '2006-02-15T10:05:03'), - ('82', '17', '2006-02-15T10:05:03'), - ('187', '17', '2006-02-15T10:05:03'), - ('12', '17', '2006-02-15T10:05:03'), - ('167', '17', '2006-02-15T10:05:03'), - ('100', '17', '2006-02-15T10:05:03'), - ('198', '806', '2006-02-15T10:05:03'), - ('190', '806', '2006-02-15T10:05:03'), - ('136', '806', '2006-02-15T10:05:03'), - ('133', '806', '2006-02-15T10:05:03'), - ('132', '806', '2006-02-15T10:05:03'), - ('7', '806', '2006-02-15T10:05:03'), - ('50', '672', '2006-02-15T10:05:03'), - ('83', '672', '2006-02-15T10:05:03'), - ('167', '672', '2006-02-15T10:05:03'), - ('150', '672', '2006-02-15T10:05:03'), - ('99', '672', '2006-02-15T10:05:03'), - ('12', '672', '2006-02-15T10:05:03'), - ('80', '343', '2006-02-15T10:05:03'), - ('159', '343', '2006-02-15T10:05:03'), - ('124', '343', '2006-02-15T10:05:03'), - ('77', '343', '2006-02-15T10:05:03'), - ('110', '343', '2006-02-15T10:05:03'), - ('70', '343', '2006-02-15T10:05:03'), - ('105', '239', '2006-02-15T10:05:03'), - ('107', '239', '2006-02-15T10:05:03'), - ('143', '239', '2006-02-15T10:05:03'), - ('43', '239', '2006-02-15T10:05:03'), - ('78', '239', '2006-02-15T10:05:03'), - ('163', '239', '2006-02-15T10:05:03'), - ('60', '239', '2006-02-15T10:05:03'), - ('171', '318', '2006-02-15T10:05:03'), - ('152', '318', '2006-02-15T10:05:03'), - ('103', '318', '2006-02-15T10:05:03'), - ('30', '318', '2006-02-15T10:05:03'), - ('147', '318', '2006-02-15T10:05:03'), - ('76', '464', '2006-02-15T10:05:03'), - ('198', '464', '2006-02-15T10:05:03'), - ('130', '26', '2006-02-15T10:05:03'), - ('128', '26', '2006-02-15T10:05:03'), - ('71', '26', '2006-02-15T10:05:03'), - ('11', '988', '2006-02-15T10:05:03'), - ('123', '988', '2006-02-15T10:05:03'), - ('54', '988', '2006-02-15T10:05:03'), - ('154', '988', '2006-02-15T10:05:03'), - ('153', '988', '2006-02-15T10:05:03'), - ('62', '988', '2006-02-15T10:05:03'), - ('101', '988', '2006-02-15T10:05:03'), - ('188', '988', '2006-02-15T10:05:03'), - ('112', '988', '2006-02-15T10:05:03'), - ('149', '670', '2006-02-15T10:05:03'), - ('47', '670', '2006-02-15T10:05:03'), - ('78', '670', '2006-02-15T10:05:03'), - ('19', '670', '2006-02-15T10:05:03'), - ('140', '670', '2006-02-15T10:05:03'), - ('66', '608', '2006-02-15T10:05:03'), - ('140', '608', '2006-02-15T10:05:03'), - ('142', '608', '2006-02-15T10:05:03'), - ('91', '608', '2006-02-15T10:05:03'), - ('43', '608', '2006-02-15T10:05:03'), - ('111', '608', '2006-02-15T10:05:03'), - ('171', '608', '2006-02-15T10:05:03'), - ('101', '608', '2006-02-15T10:05:03'), - ('13', '524', '2006-02-15T10:05:03'), - ('196', '524', '2006-02-15T10:05:03'), - ('54', '524', '2006-02-15T10:05:03'), - ('41', '212', '2006-02-15T10:05:03'), - ('19', '212', '2006-02-15T10:05:03'), - ('89', '212', '2006-02-15T10:05:03'), - ('128', '212', '2006-02-15T10:05:03'), - ('90', '212', '2006-02-15T10:05:03'), - ('98', '212', '2006-02-15T10:05:03'), - ('23', '212', '2006-02-15T10:05:03'), - ('80', '212', '2006-02-15T10:05:03'), - ('170', '212', '2006-02-15T10:05:03'), - ('192', '819', '2006-02-15T10:05:03'), - ('191', '819', '2006-02-15T10:05:03'), - ('182', '819', '2006-02-15T10:05:03'), - ('88', '819', '2006-02-15T10:05:03'), - ('127', '819', '2006-02-15T10:05:03'), - ('31', '308', '2006-02-15T10:05:03'), - ('22', '89', '2006-02-15T10:05:03'), - ('81', '89', '2006-02-15T10:05:03'), - ('129', '89', '2006-02-15T10:05:03'), - ('176', '89', '2006-02-15T10:05:03'), - ('15', '89', '2006-02-15T10:05:03'), - ('43', '89', '2006-02-15T10:05:03'), - ('161', '89', '2006-02-15T10:05:03'), - ('4', '23', '2006-02-15T10:05:03'), - ('1', '23', '2006-02-15T10:05:03'), - ('22', '23', '2006-02-15T10:05:03'), - ('164', '23', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('150', '23', '2006-02-15T10:05:03'), - ('78', '260', '2006-02-15T10:05:03'), - ('124', '260', '2006-02-15T10:05:03'), - ('30', '260', '2006-02-15T10:05:03'), - ('37', '260', '2006-02-15T10:05:03'), - ('81', '260', '2006-02-15T10:05:03'), - ('144', '260', '2006-02-15T10:05:03'), - ('80', '260', '2006-02-15T10:05:03'), - ('38', '111', '2006-02-15T10:05:03'), - ('69', '111', '2006-02-15T10:05:03'), - ('3', '111', '2006-02-15T10:05:03'), - ('22', '111', '2006-02-15T10:05:03'), - ('188', '111', '2006-02-15T10:05:03'), - ('50', '111', '2006-02-15T10:05:03'), - ('154', '111', '2006-02-15T10:05:03'), - ('140', '934', '2006-02-15T10:05:03'), - ('106', '934', '2006-02-15T10:05:03'), - ('28', '743', '2006-02-15T10:05:03'), - ('72', '743', '2006-02-15T10:05:03'), - ('77', '943', '2006-02-15T10:05:03'), - ('59', '943', '2006-02-15T10:05:03'), - ('103', '221', '2006-02-15T10:05:03'), - ('16', '221', '2006-02-15T10:05:03'), - ('184', '221', '2006-02-15T10:05:03'), - ('24', '603', '2006-02-15T10:05:03'), - ('143', '603', '2006-02-15T10:05:03'), - ('55', '603', '2006-02-15T10:05:03'), - ('137', '603', '2006-02-15T10:05:03'), - ('111', '603', '2006-02-15T10:05:03'), - ('17', '603', '2006-02-15T10:05:03'), - ('107', '603', '2006-02-15T10:05:03'), - ('112', '603', '2006-02-15T10:05:03'), - ('129', '826', '2006-02-15T10:05:03'), - ('23', '826', '2006-02-15T10:05:03'), - ('6', '826', '2006-02-15T10:05:03'), - ('97', '826', '2006-02-15T10:05:03'), - ('168', '826', '2006-02-15T10:05:03'), - ('160', '826', '2006-02-15T10:05:03'), - ('93', '473', '2006-02-15T10:05:03'), - ('165', '473', '2006-02-15T10:05:03'), - ('158', '473', '2006-02-15T10:05:03'), - ('144', '473', '2006-02-15T10:05:03'), - ('196', '473', '2006-02-15T10:05:03'), - ('79', '473', '2006-02-15T10:05:03'), - ('19', '473', '2006-02-15T10:05:03'), - ('89', '473', '2006-02-15T10:05:03'), - ('94', '473', '2006-02-15T10:05:03'), - ('33', '473', '2006-02-15T10:05:03'), - ('177', '543', '2006-02-15T10:05:03'), - ('64', '543', '2006-02-15T10:05:03'), - ('85', '543', '2006-02-15T10:05:03'), - ('92', '543', '2006-02-15T10:05:03'), - ('74', '543', '2006-02-15T10:05:03'), - ('176', '543', '2006-02-15T10:05:03'), - ('26', '201', '2006-02-15T10:05:03'), - ('35', '201', '2006-02-15T10:05:03'), - ('17', '201', '2006-02-15T10:05:03'), - ('66', '350', '2006-02-15T10:05:03'), - ('108', '350', '2006-02-15T10:05:03'), - ('142', '350', '2006-02-15T10:05:03'), - ('118', '136', '2006-02-15T10:05:03'), - ('104', '136', '2006-02-15T10:05:03'), - ('32', '136', '2006-02-15T10:05:03'), - ('106', '136', '2006-02-15T10:05:03'), - ('107', '136', '2006-02-15T10:05:03'), - ('153', '136', '2006-02-15T10:05:03'), - ('132', '698', '2006-02-15T10:05:03'), - ('164', '698', '2006-02-15T10:05:03'), - ('58', '698', '2006-02-15T10:05:03'), - ('154', '698', '2006-02-15T10:05:03'), - ('179', '698', '2006-02-15T10:05:03'), - ('152', '332', '2006-02-15T10:05:03'), - ('81', '332', '2006-02-15T10:05:03'), - ('86', '905', '2006-02-15T10:05:03'), - ('107', '905', '2006-02-15T10:05:03'), - ('149', '905', '2006-02-15T10:05:03'), - ('135', '905', '2006-02-15T10:05:03'), - ('157', '973', '2006-02-15T10:05:03'), - ('28', '973', '2006-02-15T10:05:03'), - ('185', '973', '2006-02-15T10:05:03'), - ('107', '973', '2006-02-15T10:05:03'), - ('111', '973', '2006-02-15T10:05:03'), - ('47', '973', '2006-02-15T10:05:03'), - ('78', '261', '2006-02-15T10:05:03'), - ('77', '261', '2006-02-15T10:05:03'), - ('139', '261', '2006-02-15T10:05:03'), - ('40', '177', '2006-02-15T10:05:03'), - ('60', '177', '2006-02-15T10:05:03'), - ('158', '177', '2006-02-15T10:05:03'), - ('97', '177', '2006-02-15T10:05:03'), - ('12', '177', '2006-02-15T10:05:03'), - ('16', '177', '2006-02-15T10:05:03'), - ('146', '177', '2006-02-15T10:05:03'), - ('119', '614', '2006-02-15T10:05:03'), - ('128', '614', '2006-02-15T10:05:03'), - ('192', '614', '2006-02-15T10:05:03'), - ('85', '148', '2006-02-15T10:05:03'), - ('123', '148', '2006-02-15T10:05:03'), - ('9', '148', '2006-02-15T10:05:03'), - ('172', '148', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('164', '148', '2006-02-15T10:05:03'), - ('73', '148', '2006-02-15T10:05:03'), - ('24', '148', '2006-02-15T10:05:03'), - ('19', '217', '2006-02-15T10:05:03'), - ('157', '217', '2006-02-15T10:05:03'), - ('152', '217', '2006-02-15T10:05:03'), - ('83', '217', '2006-02-15T10:05:03'), - ('7', '217', '2006-02-15T10:05:03'), - ('151', '217', '2006-02-15T10:05:03'), - ('44', '937', '2006-02-15T10:05:03'), - ('193', '937', '2006-02-15T10:05:03'), - ('53', '937', '2006-02-15T10:05:03'), - ('85', '960', '2006-02-15T10:05:03'), - ('179', '960', '2006-02-15T10:05:03'), - ('193', '960', '2006-02-15T10:05:03'), - ('66', '960', '2006-02-15T10:05:03'), - ('150', '873', '2006-02-15T10:05:03'), - ('17', '873', '2006-02-15T10:05:03'), - ('83', '873', '2006-02-15T10:05:03'), - ('27', '873', '2006-02-15T10:05:03'), - ('9', '873', '2006-02-15T10:05:03'), - ('136', '649', '2006-02-15T10:05:03'), - ('23', '649', '2006-02-15T10:05:03'), - ('54', '649', '2006-02-15T10:05:03'), - ('119', '649', '2006-02-15T10:05:03'), - ('172', '649', '2006-02-15T10:05:03'), - ('195', '649', '2006-02-15T10:05:03'), - ('177', '649', '2006-02-15T10:05:03'), - ('61', '649', '2006-02-15T10:05:03'), - ('147', '649', '2006-02-15T10:05:03'), - ('105', '649', '2006-02-15T10:05:03'), - ('122', '649', '2006-02-15T10:05:03'), - ('73', '667', '2006-02-15T10:05:03'), - ('75', '667', '2006-02-15T10:05:03'), - ('172', '667', '2006-02-15T10:05:03'), - ('33', '667', '2006-02-15T10:05:03'), - ('32', '667', '2006-02-15T10:05:03'), - ('130', '49', '2006-02-15T10:05:03'), - ('171', '49', '2006-02-15T10:05:03'), - ('83', '49', '2006-02-15T10:05:03'), - ('200', '49', '2006-02-15T10:05:03'), - ('173', '49', '2006-02-15T10:05:03'), - ('119', '49', '2006-02-15T10:05:03'), - ('118', '49', '2006-02-15T10:05:03'), - ('115', '49', '2006-02-15T10:05:03'), - ('121', '222', '2006-02-15T10:05:03'), - ('75', '222', '2006-02-15T10:05:03'), - ('39', '222', '2006-02-15T10:05:03'), - ('187', '222', '2006-02-15T10:05:03'), - ('60', '222', '2006-02-15T10:05:03'), - ('84', '703', '2006-02-15T10:05:03'), - ('39', '703', '2006-02-15T10:05:03'), - ('115', '703', '2006-02-15T10:05:03'), - ('10', '703', '2006-02-15T10:05:03'), - ('61', '703', '2006-02-15T10:05:03'), - ('137', '703', '2006-02-15T10:05:03'), - ('151', '703', '2006-02-15T10:05:03'), - ('62', '272', '2006-02-15T10:05:03'), - ('144', '272', '2006-02-15T10:05:03'), - ('189', '272', '2006-02-15T10:05:03'), - ('142', '875', '2006-02-15T10:05:03'), - ('36', '875', '2006-02-15T10:05:03'), - ('85', '875', '2006-02-15T10:05:03'), - ('131', '875', '2006-02-15T10:05:03'), - ('44', '875', '2006-02-15T10:05:03'), - ('102', '845', '2006-02-15T10:05:03'), - ('185', '845', '2006-02-15T10:05:03'), - ('182', '845', '2006-02-15T10:05:03'), - ('144', '845', '2006-02-15T10:05:03'), - ('103', '356', '2006-02-15T10:05:03'), - ('20', '165', '2006-02-15T10:05:03'), - ('83', '165', '2006-02-15T10:05:03'), - ('6', '165', '2006-02-15T10:05:03'), - ('107', '165', '2006-02-15T10:05:03'), - ('183', '388', '2006-02-15T10:05:03'), - ('127', '388', '2006-02-15T10:05:03'), - ('107', '388', '2006-02-15T10:05:03'), - ('52', '388', '2006-02-15T10:05:03'), - ('165', '948', '2006-02-15T10:05:03'), - ('17', '948', '2006-02-15T10:05:03'), - ('14', '948', '2006-02-15T10:05:03'), - ('156', '155', '2006-02-15T10:05:03'), - ('175', '155', '2006-02-15T10:05:03'), - ('192', '155', '2006-02-15T10:05:03'), - ('145', '155', '2006-02-15T10:05:03'), - ('139', '155', '2006-02-15T10:05:03'), - ('12', '155', '2006-02-15T10:05:03'), - ('16', '155', '2006-02-15T10:05:03'), - ('200', '116', '2006-02-15T10:05:03'), - ('105', '116', '2006-02-15T10:05:03'), - ('23', '116', '2006-02-15T10:05:03'), - ('113', '116', '2006-02-15T10:05:03'), - ('179', '415', '2006-02-15T10:05:03'), - ('162', '415', '2006-02-15T10:05:03'), - ('194', '415', '2006-02-15T10:05:03'), - ('14', '415', '2006-02-15T10:05:03'), - ('39', '415', '2006-02-15T10:05:03'), - ('27', '415', '2006-02-15T10:05:03'), - ('74', '415', '2006-02-15T10:05:03'), - ('162', '18', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('142', '18', '2006-02-15T10:05:03'), - ('45', '18', '2006-02-15T10:05:03'), - ('144', '18', '2006-02-15T10:05:03'), - ('117', '224', '2006-02-15T10:05:03'), - ('137', '224', '2006-02-15T10:05:03'), - ('187', '224', '2006-02-15T10:05:03'), - ('77', '224', '2006-02-15T10:05:03'), - ('28', '625', '2006-02-15T10:05:03'), - ('145', '625', '2006-02-15T10:05:03'), - ('110', '625', '2006-02-15T10:05:03'), - ('187', '625', '2006-02-15T10:05:03'), - ('171', '625', '2006-02-15T10:05:03'), - ('181', '625', '2006-02-15T10:05:03'), - ('41', '69', '2006-02-15T10:05:03'), - ('30', '69', '2006-02-15T10:05:03'), - ('192', '69', '2006-02-15T10:05:03'), - ('80', '69', '2006-02-15T10:05:03'), - ('125', '361', '2006-02-15T10:05:03'), - ('143', '361', '2006-02-15T10:05:03'), - ('195', '361', '2006-02-15T10:05:03'), - ('66', '361', '2006-02-15T10:05:03'), - ('166', '361', '2006-02-15T10:05:03'), - ('155', '361', '2006-02-15T10:05:03'), - ('1', '361', '2006-02-15T10:05:03'), - ('192', '361', '2006-02-15T10:05:03'), - ('121', '633', '2006-02-15T10:05:03'), - ('90', '633', '2006-02-15T10:05:03'), - ('7', '633', '2006-02-15T10:05:03'), - ('148', '633', '2006-02-15T10:05:03'), - ('63', '633', '2006-02-15T10:05:03'), - ('175', '977', '2006-02-15T10:05:03'), - ('20', '977', '2006-02-15T10:05:03'), - ('49', '977', '2006-02-15T10:05:03'), - ('107', '977', '2006-02-15T10:05:03'), - ('150', '887', '2006-02-15T10:05:03'), - ('117', '887', '2006-02-15T10:05:03'), - ('108', '887', '2006-02-15T10:05:03'), - ('115', '887', '2006-02-15T10:05:03'), - ('40', '887', '2006-02-15T10:05:03'), - ('21', '887', '2006-02-15T10:05:03'), - ('84', '887', '2006-02-15T10:05:03'), - ('48', '211', '2006-02-15T10:05:03'), - ('62', '211', '2006-02-15T10:05:03'), - ('92', '505', '2006-02-15T10:05:03'), - ('169', '505', '2006-02-15T10:05:03'), - ('42', '505', '2006-02-15T10:05:03'), - ('78', '505', '2006-02-15T10:05:03'), - ('106', '505', '2006-02-15T10:05:03'), - ('81', '505', '2006-02-15T10:05:03'), - ('107', '534', '2006-02-15T10:05:03'), - ('195', '534', '2006-02-15T10:05:03'), - ('60', '534', '2006-02-15T10:05:03'), - ('26', '9', '2006-02-15T10:05:03'), - ('108', '9', '2006-02-15T10:05:03'), - ('22', '9', '2006-02-15T10:05:03'), - ('53', '9', '2006-02-15T10:05:03'), - ('130', '9', '2006-02-15T10:05:03'), - ('10', '9', '2006-02-15T10:05:03'), - ('68', '9', '2006-02-15T10:05:03'), - ('175', '9', '2006-02-15T10:05:03'), - ('194', '9', '2006-02-15T10:05:03'), - ('146', '314', '2006-02-15T10:05:03'), - ('154', '314', '2006-02-15T10:05:03'), - ('2', '314', '2006-02-15T10:05:03'), - ('131', '798', '2006-02-15T10:05:03'), - ('4', '798', '2006-02-15T10:05:03'), - ('42', '798', '2006-02-15T10:05:03'), - ('165', '798', '2006-02-15T10:05:03'), - ('21', '798', '2006-02-15T10:05:03'), - ('6', '517', '2006-02-15T10:05:03'), - ('108', '517', '2006-02-15T10:05:03'), - ('52', '517', '2006-02-15T10:05:03'), - ('63', '517', '2006-02-15T10:05:03'), - ('102', '517', '2006-02-15T10:05:03'), - ('94', '517', '2006-02-15T10:05:03'), - ('118', '517', '2006-02-15T10:05:03'), - ('176', '517', '2006-02-15T10:05:03'), - ('188', '517', '2006-02-15T10:05:03'), - ('121', '517', '2006-02-15T10:05:03'), - ('65', '517', '2006-02-15T10:05:03'), - ('178', '517', '2006-02-15T10:05:03'), - ('158', '896', '2006-02-15T10:05:03'), - ('11', '896', '2006-02-15T10:05:03'), - ('134', '896', '2006-02-15T10:05:03'), - ('189', '896', '2006-02-15T10:05:03'), - ('44', '896', '2006-02-15T10:05:03'), - ('60', '334', '2006-02-15T10:05:03'), - ('102', '334', '2006-02-15T10:05:03'), - ('27', '334', '2006-02-15T10:05:03'), - ('112', '443', '2006-02-15T10:05:03'), - ('92', '443', '2006-02-15T10:05:03'), - ('147', '443', '2006-02-15T10:05:03'), - ('121', '284', '2006-02-15T10:05:03'), - ('14', '284', '2006-02-15T10:05:03'), - ('139', '284', '2006-02-15T10:05:03'), - ('196', '284', '2006-02-15T10:05:03'), - ('82', '802', '2006-02-15T10:05:03'), - ('190', '802', '2006-02-15T10:05:03'), - ('176', '802', '2006-02-15T10:05:03'), - ('157', '802', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('22', '802', '2006-02-15T10:05:03'), - ('102', '802', '2006-02-15T10:05:03'), - ('167', '802', '2006-02-15T10:05:03'), - ('31', '802', '2006-02-15T10:05:03'), - ('92', '802', '2006-02-15T10:05:03'), - ('159', '802', '2006-02-15T10:05:03'), - ('154', '802', '2006-02-15T10:05:03'), - ('119', '802', '2006-02-15T10:05:03'), - ('110', '126', '2006-02-15T10:05:03'), - ('106', '126', '2006-02-15T10:05:03'), - ('95', '126', '2006-02-15T10:05:03'), - ('24', '126', '2006-02-15T10:05:03'), - ('53', '126', '2006-02-15T10:05:03'), - ('67', '144', '2006-02-15T10:05:03'), - ('57', '144', '2006-02-15T10:05:03'), - ('13', '144', '2006-02-15T10:05:03'), - ('180', '144', '2006-02-15T10:05:03'), - ('151', '144', '2006-02-15T10:05:03'), - ('18', '144', '2006-02-15T10:05:03'), - ('72', '144', '2006-02-15T10:05:03'), - ('195', '144', '2006-02-15T10:05:03'), - ('120', '144', '2006-02-15T10:05:03'), - ('19', '144', '2006-02-15T10:05:03'), - ('40', '466', '2006-02-15T10:05:03'), - ('171', '466', '2006-02-15T10:05:03'), - ('70', '466', '2006-02-15T10:05:03'), - ('97', '466', '2006-02-15T10:05:03'), - ('69', '466', '2006-02-15T10:05:03'), - ('36', '466', '2006-02-15T10:05:03'), - ('65', '97', '2006-02-15T10:05:03'), - ('40', '107', '2006-02-15T10:05:03'), - ('130', '107', '2006-02-15T10:05:03'), - ('142', '107', '2006-02-15T10:05:03'), - ('167', '107', '2006-02-15T10:05:03'), - ('139', '107', '2006-02-15T10:05:03'), - ('12', '107', '2006-02-15T10:05:03'), - ('28', '107', '2006-02-15T10:05:03'), - ('98', '107', '2006-02-15T10:05:03'), - ('7', '901', '2006-02-15T10:05:03'), - ('90', '901', '2006-02-15T10:05:03'), - ('45', '901', '2006-02-15T10:05:03'), - ('183', '850', '2006-02-15T10:05:03'), - ('161', '850', '2006-02-15T10:05:03'), - ('76', '850', '2006-02-15T10:05:03'), - ('100', '850', '2006-02-15T10:05:03'), - ('11', '850', '2006-02-15T10:05:03'), - ('44', '982', '2006-02-15T10:05:03'), - ('91', '982', '2006-02-15T10:05:03'), - ('93', '982', '2006-02-15T10:05:03'), - ('99', '982', '2006-02-15T10:05:03'), - ('174', '982', '2006-02-15T10:05:03'), - ('143', '821', '2006-02-15T10:05:03'), - ('26', '821', '2006-02-15T10:05:03'), - ('141', '821', '2006-02-15T10:05:03'), - ('152', '821', '2006-02-15T10:05:03'), - ('58', '638', '2006-02-15T10:05:03'), - ('191', '638', '2006-02-15T10:05:03'), - ('71', '638', '2006-02-15T10:05:03'), - ('16', '582', '2006-02-15T10:05:03'), - ('95', '813', '2006-02-15T10:05:03'), - ('195', '813', '2006-02-15T10:05:03'), - ('140', '665', '2006-02-15T10:05:03'), - ('5', '665', '2006-02-15T10:05:03'), - ('68', '665', '2006-02-15T10:05:03'), - ('151', '665', '2006-02-15T10:05:03'), - ('185', '665', '2006-02-15T10:05:03'), - ('72', '665', '2006-02-15T10:05:03'), - ('42', '665', '2006-02-15T10:05:03'), - ('128', '665', '2006-02-15T10:05:03'), - ('60', '665', '2006-02-15T10:05:03'), - ('172', '661', '2006-02-15T10:05:03'), - ('157', '661', '2006-02-15T10:05:03'), - ('184', '661', '2006-02-15T10:05:03'), - ('96', '661', '2006-02-15T10:05:03'), - ('115', '661', '2006-02-15T10:05:03'), - ('145', '661', '2006-02-15T10:05:03'), - ('191', '420', '2006-02-15T10:05:03'), - ('136', '420', '2006-02-15T10:05:03'), - ('12', '420', '2006-02-15T10:05:03'), - ('116', '420', '2006-02-15T10:05:03'), - ('181', '420', '2006-02-15T10:05:03'), - ('51', '420', '2006-02-15T10:05:03'), - ('50', '420', '2006-02-15T10:05:03'), - ('95', '420', '2006-02-15T10:05:03'), - ('114', '420', '2006-02-15T10:05:03'), - ('44', '420', '2006-02-15T10:05:03'), - ('25', '420', '2006-02-15T10:05:03'), - ('42', '535', '2006-02-15T10:05:03'), - ('61', '535', '2006-02-15T10:05:03'), - ('5', '535', '2006-02-15T10:05:03'), - ('157', '535', '2006-02-15T10:05:03'), - ('159', '876', '2006-02-15T10:05:03'), - ('38', '876', '2006-02-15T10:05:03'), - ('42', '876', '2006-02-15T10:05:03'), - ('187', '435', '2006-02-15T10:05:03'), - ('110', '435', '2006-02-15T10:05:03'), - ('68', '435', '2006-02-15T10:05:03'), - ('23', '435', '2006-02-15T10:05:03'), - ('145', '692', '2006-02-15T10:05:03'), - ('191', '692', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('81', '692', '2006-02-15T10:05:03'), - ('167', '692', '2006-02-15T10:05:03'), - ('6', '692', '2006-02-15T10:05:03'), - ('103', '692', '2006-02-15T10:05:03'), - ('64', '557', '2006-02-15T10:05:03'), - ('125', '557', '2006-02-15T10:05:03'), - ('92', '229', '2006-02-15T10:05:03'), - ('136', '229', '2006-02-15T10:05:03'), - ('66', '229', '2006-02-15T10:05:03'), - ('106', '229', '2006-02-15T10:05:03'), - ('139', '229', '2006-02-15T10:05:03'), - ('44', '598', '2006-02-15T10:05:03'), - ('197', '598', '2006-02-15T10:05:03'), - ('39', '598', '2006-02-15T10:05:03'), - ('43', '598', '2006-02-15T10:05:03'), - ('69', '452', '2006-02-15T10:05:03'), - ('129', '452', '2006-02-15T10:05:03'), - ('130', '452', '2006-02-15T10:05:03'), - ('96', '452', '2006-02-15T10:05:03'), - ('133', '452', '2006-02-15T10:05:03'), - ('184', '452', '2006-02-15T10:05:03'), - ('114', '452', '2006-02-15T10:05:03'), - ('197', '995', '2006-02-15T10:05:03'), - ('27', '771', '2006-02-15T10:05:03'), - ('60', '771', '2006-02-15T10:05:03'), - ('19', '771', '2006-02-15T10:05:03'), - ('121', '771', '2006-02-15T10:05:03'), - ('172', '771', '2006-02-15T10:05:03'), - ('127', '771', '2006-02-15T10:05:03'), - ('8', '771', '2006-02-15T10:05:03'), - ('90', '771', '2006-02-15T10:05:03'), - ('87', '870', '2006-02-15T10:05:03'), - ('82', '870', '2006-02-15T10:05:03'), - ('67', '870', '2006-02-15T10:05:03'), - ('76', '870', '2006-02-15T10:05:03'), - ('181', '870', '2006-02-15T10:05:03'), - ('75', '870', '2006-02-15T10:05:03'), - ('58', '235', '2006-02-15T10:05:03'), - ('23', '235', '2006-02-15T10:05:03'), - ('177', '235', '2006-02-15T10:05:03'), - ('60', '235', '2006-02-15T10:05:03'), - ('61', '235', '2006-02-15T10:05:03'), - ('173', '235', '2006-02-15T10:05:03'), - ('61', '648', '2006-02-15T10:05:03'), - ('39', '648', '2006-02-15T10:05:03'), - ('108', '648', '2006-02-15T10:05:03'), - ('42', '648', '2006-02-15T10:05:03'), - ('22', '648', '2006-02-15T10:05:03'), - ('76', '648', '2006-02-15T10:05:03'), - ('186', '648', '2006-02-15T10:05:03'), - ('39', '290', '2006-02-15T10:05:03'), - ('85', '290', '2006-02-15T10:05:03'), - ('84', '290', '2006-02-15T10:05:03'), - ('82', '290', '2006-02-15T10:05:03'), - ('70', '290', '2006-02-15T10:05:03'), - ('88', '128', '2006-02-15T10:05:03'), - ('155', '128', '2006-02-15T10:05:03'), - ('116', '128', '2006-02-15T10:05:03'), - ('40', '128', '2006-02-15T10:05:03'), - ('58', '128', '2006-02-15T10:05:03'), - ('101', '491', '2006-02-15T10:05:03'), - ('141', '491', '2006-02-15T10:05:03'), - ('65', '491', '2006-02-15T10:05:03'), - ('22', '491', '2006-02-15T10:05:03'), - ('122', '491', '2006-02-15T10:05:03'), - ('173', '491', '2006-02-15T10:05:03'), - ('23', '491', '2006-02-15T10:05:03'), - ('84', '491', '2006-02-15T10:05:03'), - ('30', '357', '2006-02-15T10:05:03'), - ('68', '357', '2006-02-15T10:05:03'), - ('2', '357', '2006-02-15T10:05:03'), - ('135', '357', '2006-02-15T10:05:03'), - ('39', '772', '2006-02-15T10:05:03'), - ('148', '772', '2006-02-15T10:05:03'), - ('73', '772', '2006-02-15T10:05:03'), - ('141', '772', '2006-02-15T10:05:03'), - ('112', '772', '2006-02-15T10:05:03'), - ('175', '772', '2006-02-15T10:05:03'), - ('59', '772', '2006-02-15T10:05:03'), - ('184', '772', '2006-02-15T10:05:03'), - ('27', '19', '2006-02-15T10:05:03'), - ('43', '19', '2006-02-15T10:05:03'), - ('37', '19', '2006-02-15T10:05:03'), - ('84', '19', '2006-02-15T10:05:03'), - ('5', '19', '2006-02-15T10:05:03'), - ('104', '19', '2006-02-15T10:05:03'), - ('97', '947', '2006-02-15T10:05:03'), - ('149', '947', '2006-02-15T10:05:03'), - ('163', '947', '2006-02-15T10:05:03'), - ('165', '947', '2006-02-15T10:05:03'), - ('53', '947', '2006-02-15T10:05:03'), - ('56', '298', '2006-02-15T10:05:03'), - ('195', '298', '2006-02-15T10:05:03'), - ('117', '298', '2006-02-15T10:05:03'), - ('147', '298', '2006-02-15T10:05:03'), - ('174', '298', '2006-02-15T10:05:03'), - ('189', '899', '2006-02-15T10:05:03'), - ('149', '899', '2006-02-15T10:05:03'), - ('132', '899', '2006-02-15T10:05:03'), - ('128', '899', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('100', '877', '2006-02-15T10:05:03'), - ('125', '877', '2006-02-15T10:05:03'), - ('170', '877', '2006-02-15T10:05:03'), - ('69', '877', '2006-02-15T10:05:03'), - ('19', '877', '2006-02-15T10:05:03'), - ('82', '877', '2006-02-15T10:05:03'), - ('126', '58', '2006-02-15T10:05:03'), - ('28', '58', '2006-02-15T10:05:03'), - ('96', '58', '2006-02-15T10:05:03'), - ('83', '58', '2006-02-15T10:05:03'), - ('44', '58', '2006-02-15T10:05:03'), - ('53', '58', '2006-02-15T10:05:03'), - ('161', '58', '2006-02-15T10:05:03'), - ('49', '400', '2006-02-15T10:05:03'), - ('12', '400', '2006-02-15T10:05:03'), - ('157', '400', '2006-02-15T10:05:03'), - ('63', '73', '2006-02-15T10:05:03'), - ('39', '73', '2006-02-15T10:05:03'), - ('187', '73', '2006-02-15T10:05:03'), - ('176', '73', '2006-02-15T10:05:03'), - ('77', '73', '2006-02-15T10:05:03'), - ('150', '94', '2006-02-15T10:05:03'), - ('131', '94', '2006-02-15T10:05:03'), - ('92', '94', '2006-02-15T10:05:03'), - ('44', '94', '2006-02-15T10:05:03'), - ('102', '329', '2006-02-15T10:05:03'), - ('3', '329', '2006-02-15T10:05:03'), - ('26', '329', '2006-02-15T10:05:03'), - ('198', '329', '2006-02-15T10:05:03'), - ('95', '329', '2006-02-15T10:05:03'), - ('196', '484', '2006-02-15T10:05:03'), - ('160', '484', '2006-02-15T10:05:03'), - ('45', '484', '2006-02-15T10:05:03'), - ('18', '484', '2006-02-15T10:05:03'), - ('36', '484', '2006-02-15T10:05:03'), - ('47', '484', '2006-02-15T10:05:03'), - ('74', '484', '2006-02-15T10:05:03'), - ('135', '484', '2006-02-15T10:05:03'), - ('160', '579', '2006-02-15T10:05:03'), - ('81', '579', '2006-02-15T10:05:03'), - ('186', '579', '2006-02-15T10:05:03'), - ('49', '579', '2006-02-15T10:05:03'), - ('75', '579', '2006-02-15T10:05:03'), - ('181', '579', '2006-02-15T10:05:03'), - ('111', '78', '2006-02-15T10:05:03'), - ('169', '78', '2006-02-15T10:05:03'), - ('77', '78', '2006-02-15T10:05:03'), - ('181', '78', '2006-02-15T10:05:03'), - ('23', '78', '2006-02-15T10:05:03'), - ('194', '161', '2006-02-15T10:05:03'), - ('121', '161', '2006-02-15T10:05:03'), - ('68', '161', '2006-02-15T10:05:03'), - ('43', '161', '2006-02-15T10:05:03'), - ('87', '161', '2006-02-15T10:05:03'), - ('134', '161', '2006-02-15T10:05:03'), - ('171', '898', '2006-02-15T10:05:03'), - ('152', '898', '2006-02-15T10:05:03'), - ('120', '898', '2006-02-15T10:05:03'), - ('67', '601', '2006-02-15T10:05:03'), - ('124', '601', '2006-02-15T10:05:03'), - ('158', '601', '2006-02-15T10:05:03'), - ('138', '885', '2006-02-15T10:05:03'), - ('195', '885', '2006-02-15T10:05:03'), - ('155', '885', '2006-02-15T10:05:03'), - ('121', '885', '2006-02-15T10:05:03'), - ('26', '885', '2006-02-15T10:05:03'), - ('109', '885', '2006-02-15T10:05:03'), - ('12', '92', '2006-02-15T10:05:03'), - ('85', '92', '2006-02-15T10:05:03'), - ('168', '92', '2006-02-15T10:05:03'), - ('52', '92', '2006-02-15T10:05:03'), - ('70', '92', '2006-02-15T10:05:03'), - ('141', '863', '2006-02-15T10:05:03'), - ('142', '863', '2006-02-15T10:05:03'), - ('18', '863', '2006-02-15T10:05:03'), - ('20', '863', '2006-02-15T10:05:03'), - ('109', '863', '2006-02-15T10:05:03'), - ('45', '920', '2006-02-15T10:05:03'), - ('129', '920', '2006-02-15T10:05:03'), - ('185', '920', '2006-02-15T10:05:03'), - ('75', '920', '2006-02-15T10:05:03'), - ('108', '920', '2006-02-15T10:05:03'), - ('161', '920', '2006-02-15T10:05:03'), - ('39', '920', '2006-02-15T10:05:03'), - ('21', '920', '2006-02-15T10:05:03'), - ('133', '338', '2006-02-15T10:05:03'), - ('92', '338', '2006-02-15T10:05:03'), - ('125', '338', '2006-02-15T10:05:03'), - ('116', '338', '2006-02-15T10:05:03'), - ('107', '338', '2006-02-15T10:05:03'), - ('38', '338', '2006-02-15T10:05:03'), - ('188', '338', '2006-02-15T10:05:03'), - ('121', '338', '2006-02-15T10:05:03'), - ('65', '338', '2006-02-15T10:05:03'), - ('181', '522', '2006-02-15T10:05:03'), - ('85', '522', '2006-02-15T10:05:03'), - ('163', '522', '2006-02-15T10:05:03'), - ('13', '522', '2006-02-15T10:05:03'), - ('197', '522', '2006-02-15T10:05:03'), - ('95', '522', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('10', '522', '2006-02-15T10:05:03'), - ('177', '522', '2006-02-15T10:05:03'), - ('164', '681', '2006-02-15T10:05:03'), - ('179', '650', '2006-02-15T10:05:03'), - ('110', '650', '2006-02-15T10:05:03'), - ('128', '650', '2006-02-15T10:05:03'), - ('5', '650', '2006-02-15T10:05:03'), - ('9', '650', '2006-02-15T10:05:03'), - ('59', '650', '2006-02-15T10:05:03'), - ('76', '650', '2006-02-15T10:05:03'), - ('184', '650', '2006-02-15T10:05:03'), - ('169', '6', '2006-02-15T10:05:03'), - ('62', '6', '2006-02-15T10:05:03'), - ('21', '6', '2006-02-15T10:05:03'), - ('23', '6', '2006-02-15T10:05:03'), - ('197', '6', '2006-02-15T10:05:03'), - ('137', '6', '2006-02-15T10:05:03'), - ('108', '6', '2006-02-15T10:05:03'), - ('172', '345', '2006-02-15T10:05:03'), - ('128', '345', '2006-02-15T10:05:03'), - ('48', '345', '2006-02-15T10:05:03'), - ('16', '345', '2006-02-15T10:05:03'), - ('106', '345', '2006-02-15T10:05:03'), - ('132', '345', '2006-02-15T10:05:03'), - ('26', '345', '2006-02-15T10:05:03'), - ('64', '345', '2006-02-15T10:05:03'), - ('52', '664', '2006-02-15T10:05:03'), - ('187', '664', '2006-02-15T10:05:03'), - ('145', '664', '2006-02-15T10:05:03'), - ('125', '664', '2006-02-15T10:05:03'), - ('160', '767', '2006-02-15T10:05:03'), - ('78', '767', '2006-02-15T10:05:03'), - ('57', '767', '2006-02-15T10:05:03'), - ('61', '767', '2006-02-15T10:05:03'), - ('45', '767', '2006-02-15T10:05:03'), - ('127', '791', '2006-02-15T10:05:03'), - ('69', '791', '2006-02-15T10:05:03'), - ('74', '872', '2006-02-15T10:05:03'), - ('143', '872', '2006-02-15T10:05:03'), - ('176', '872', '2006-02-15T10:05:03'), - ('194', '872', '2006-02-15T10:05:03'), - ('171', '872', '2006-02-15T10:05:03'), - ('100', '872', '2006-02-15T10:05:03'), - ('144', '396', '2006-02-15T10:05:03'), - ('40', '396', '2006-02-15T10:05:03'), - ('188', '396', '2006-02-15T10:05:03'), - ('8', '396', '2006-02-15T10:05:03'), - ('68', '396', '2006-02-15T10:05:03'), - ('154', '396', '2006-02-15T10:05:03'), - ('69', '396', '2006-02-15T10:05:03'), - ('117', '432', '2006-02-15T10:05:03'), - ('86', '432', '2006-02-15T10:05:03'), - ('199', '432', '2006-02-15T10:05:03'), - ('131', '432', '2006-02-15T10:05:03'), - ('55', '486', '2006-02-15T10:05:03'), - ('153', '486', '2006-02-15T10:05:03'), - ('194', '486', '2006-02-15T10:05:03'), - ('86', '486', '2006-02-15T10:05:03'), - ('184', '486', '2006-02-15T10:05:03'), - ('96', '486', '2006-02-15T10:05:03'), - ('192', '592', '2006-02-15T10:05:03'), - ('173', '592', '2006-02-15T10:05:03'), - ('195', '592', '2006-02-15T10:05:03'), - ('119', '592', '2006-02-15T10:05:03'), - ('130', '592', '2006-02-15T10:05:03'), - ('57', '592', '2006-02-15T10:05:03'), - ('145', '592', '2006-02-15T10:05:03'), - ('26', '21', '2006-02-15T10:05:03'), - ('119', '21', '2006-02-15T10:05:03'), - ('25', '21', '2006-02-15T10:05:03'), - ('105', '21', '2006-02-15T10:05:03'), - ('126', '21', '2006-02-15T10:05:03'), - ('196', '122', '2006-02-15T10:05:03'), - ('53', '122', '2006-02-15T10:05:03'), - ('57', '122', '2006-02-15T10:05:03'), - ('37', '122', '2006-02-15T10:05:03'), - ('76', '122', '2006-02-15T10:05:03'), - ('94', '122', '2006-02-15T10:05:03'), - ('157', '122', '2006-02-15T10:05:03'), - ('40', '163', '2006-02-15T10:05:03'), - ('31', '163', '2006-02-15T10:05:03'), - ('194', '163', '2006-02-15T10:05:03'), - ('86', '163', '2006-02-15T10:05:03'), - ('49', '709', '2006-02-15T10:05:03'), - ('193', '709', '2006-02-15T10:05:03'), - ('11', '709', '2006-02-15T10:05:03'), - ('80', '709', '2006-02-15T10:05:03'), - ('55', '709', '2006-02-15T10:05:03'), - ('76', '709', '2006-02-15T10:05:03'), - ('121', '847', '2006-02-15T10:05:03'), - ('180', '847', '2006-02-15T10:05:03'), - ('14', '847', '2006-02-15T10:05:03'), - ('51', '847', '2006-02-15T10:05:03'), - ('111', '847', '2006-02-15T10:05:03'), - ('153', '847', '2006-02-15T10:05:03'), - ('169', '847', '2006-02-15T10:05:03'), - ('139', '744', '2006-02-15T10:05:03'), - ('75', '744', '2006-02-15T10:05:03'), - ('178', '744', '2006-02-15T10:05:03'), - ('102', '744', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('93', '744', '2006-02-15T10:05:03'), - ('108', '744', '2006-02-15T10:05:03'), - ('40', '744', '2006-02-15T10:05:03'), - ('111', '744', '2006-02-15T10:05:03'), - ('181', '744', '2006-02-15T10:05:03'), - ('172', '744', '2006-02-15T10:05:03'), - ('117', '710', '2006-02-15T10:05:03'), - ('81', '710', '2006-02-15T10:05:03'), - ('127', '710', '2006-02-15T10:05:03'), - ('172', '710', '2006-02-15T10:05:03'), - ('142', '710', '2006-02-15T10:05:03'), - ('125', '710', '2006-02-15T10:05:03'), - ('98', '710', '2006-02-15T10:05:03'), - ('106', '866', '2006-02-15T10:05:03'), - ('76', '866', '2006-02-15T10:05:03'), - ('114', '866', '2006-02-15T10:05:03'), - ('115', '277', '2006-02-15T10:05:03'), - ('1', '277', '2006-02-15T10:05:03'), - ('37', '277', '2006-02-15T10:05:03'), - ('107', '277', '2006-02-15T10:05:03'), - ('24', '277', '2006-02-15T10:05:03'), - ('109', '967', '2006-02-15T10:05:03'), - ('16', '967', '2006-02-15T10:05:03'), - ('3', '967', '2006-02-15T10:05:03'), - ('158', '967', '2006-02-15T10:05:03'), - ('99', '967', '2006-02-15T10:05:03'), - ('157', '967', '2006-02-15T10:05:03'), - ('184', '967', '2006-02-15T10:05:03'), - ('100', '967', '2006-02-15T10:05:03'), - ('197', '967', '2006-02-15T10:05:03'), - ('27', '967', '2006-02-15T10:05:03'), - ('44', '604', '2006-02-15T10:05:03'), - ('157', '604', '2006-02-15T10:05:03'), - ('199', '604', '2006-02-15T10:05:03'), - ('76', '604', '2006-02-15T10:05:03'), - ('181', '604', '2006-02-15T10:05:03'), - ('173', '80', '2006-02-15T10:05:03'), - ('193', '80', '2006-02-15T10:05:03'), - ('200', '80', '2006-02-15T10:05:03'), - ('16', '80', '2006-02-15T10:05:03'), - ('148', '718', '2006-02-15T10:05:03'), - ('87', '718', '2006-02-15T10:05:03'), - ('13', '718', '2006-02-15T10:05:03'), - ('100', '718', '2006-02-15T10:05:03'), - ('72', '718', '2006-02-15T10:05:03'), - ('122', '718', '2006-02-15T10:05:03'), - ('196', '972', '2006-02-15T10:05:03'), - ('67', '972', '2006-02-15T10:05:03'), - ('33', '972', '2006-02-15T10:05:03'), - ('178', '762', '2006-02-15T10:05:03'), - ('144', '762', '2006-02-15T10:05:03'), - ('78', '762', '2006-02-15T10:05:03'), - ('2', '742', '2006-02-15T10:05:03'), - ('116', '742', '2006-02-15T10:05:03'), - ('124', '742', '2006-02-15T10:05:03'), - ('22', '742', '2006-02-15T10:05:03'), - ('140', '742', '2006-02-15T10:05:03'), - ('167', '864', '2006-02-15T10:05:03'), - ('89', '864', '2006-02-15T10:05:03'), - ('69', '864', '2006-02-15T10:05:03'), - ('182', '864', '2006-02-15T10:05:03'), - ('117', '864', '2006-02-15T10:05:03'), - ('147', '864', '2006-02-15T10:05:03'), - ('105', '864', '2006-02-15T10:05:03'), - ('145', '409', '2006-02-15T10:05:03'), - ('181', '409', '2006-02-15T10:05:03'), - ('107', '409', '2006-02-15T10:05:03'), - ('163', '409', '2006-02-15T10:05:03'), - ('162', '409', '2006-02-15T10:05:03'), - ('93', '916', '2006-02-15T10:05:03'), - ('197', '916', '2006-02-15T10:05:03'), - ('79', '916', '2006-02-15T10:05:03'), - ('125', '949', '2006-02-15T10:05:03'), - ('149', '949', '2006-02-15T10:05:03'), - ('15', '949', '2006-02-15T10:05:03'), - ('183', '949', '2006-02-15T10:05:03'), - ('128', '949', '2006-02-15T10:05:03'), - ('185', '882', '2006-02-15T10:05:03'), - ('167', '882', '2006-02-15T10:05:03'), - ('133', '882', '2006-02-15T10:05:03'), - ('189', '882', '2006-02-15T10:05:03'), - ('124', '882', '2006-02-15T10:05:03'), - ('125', '683', '2006-02-15T10:05:03'), - ('134', '683', '2006-02-15T10:05:03'), - ('39', '683', '2006-02-15T10:05:03'), - ('177', '683', '2006-02-15T10:05:03'), - ('65', '683', '2006-02-15T10:05:03'), - ('119', '751', '2006-02-15T10:05:03'), - ('44', '751', '2006-02-15T10:05:03'), - ('177', '751', '2006-02-15T10:05:03'), - ('126', '193', '2006-02-15T10:05:03'), - ('6', '193', '2006-02-15T10:05:03'), - ('136', '193', '2006-02-15T10:05:03'), - ('149', '193', '2006-02-15T10:05:03'), - ('154', '193', '2006-02-15T10:05:03'), - ('179', '193', '2006-02-15T10:05:03'), - ('88', '193', '2006-02-15T10:05:03'), - ('94', '193', '2006-02-15T10:05:03'), - ('22', '775', '2006-02-15T10:05:03'), - ('94', '775', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('33', '775', '2006-02-15T10:05:03'), - ('124', '775', '2006-02-15T10:05:03'), - ('156', '775', '2006-02-15T10:05:03'), - ('191', '775', '2006-02-15T10:05:03'), - ('84', '975', '2006-02-15T10:05:03'), - ('45', '975', '2006-02-15T10:05:03'), - ('192', '680', '2006-02-15T10:05:03'), - ('93', '680', '2006-02-15T10:05:03'), - ('45', '680', '2006-02-15T10:05:03'), - ('152', '680', '2006-02-15T10:05:03'), - ('143', '680', '2006-02-15T10:05:03'), - ('113', '680', '2006-02-15T10:05:03'), - ('154', '680', '2006-02-15T10:05:03'), - ('159', '680', '2006-02-15T10:05:03'), - ('111', '680', '2006-02-15T10:05:03'), - ('21', '680', '2006-02-15T10:05:03'), - ('80', '680', '2006-02-15T10:05:03'), - ('165', '204', '2006-02-15T10:05:03'), - ('25', '204', '2006-02-15T10:05:03'), - ('9', '204', '2006-02-15T10:05:03'), - ('37', '204', '2006-02-15T10:05:03'), - ('125', '204', '2006-02-15T10:05:03'), - ('106', '204', '2006-02-15T10:05:03'), - ('43', '56', '2006-02-15T10:05:03'), - ('136', '56', '2006-02-15T10:05:03'), - ('4', '56', '2006-02-15T10:05:03'), - ('137', '56', '2006-02-15T10:05:03'), - ('33', '56', '2006-02-15T10:05:03'), - ('22', '56', '2006-02-15T10:05:03'), - ('129', '56', '2006-02-15T10:05:03'), - ('168', '56', '2006-02-15T10:05:03'), - ('158', '102', '2006-02-15T10:05:03'), - ('188', '102', '2006-02-15T10:05:03'), - ('170', '102', '2006-02-15T10:05:03'), - ('49', '595', '2006-02-15T10:05:03'), - ('100', '991', '2006-02-15T10:05:03'), - ('46', '991', '2006-02-15T10:05:03'), - ('181', '991', '2006-02-15T10:05:03'), - ('92', '991', '2006-02-15T10:05:03'), - ('166', '580', '2006-02-15T10:05:03'), - ('184', '580', '2006-02-15T10:05:03'), - ('90', '100', '2006-02-15T10:05:03'), - ('125', '100', '2006-02-15T10:05:03'), - ('172', '100', '2006-02-15T10:05:03'), - ('41', '100', '2006-02-15T10:05:03'), - ('62', '100', '2006-02-15T10:05:03'), - ('49', '558', '2006-02-15T10:05:03'), - ('105', '558', '2006-02-15T10:05:03'), - ('118', '558', '2006-02-15T10:05:03'), - ('134', '558', '2006-02-15T10:05:03'), - ('85', '558', '2006-02-15T10:05:03'), - ('53', '725', '2006-02-15T10:05:03'), - ('70', '725', '2006-02-15T10:05:03'), - ('49', '725', '2006-02-15T10:05:03'), - ('66', '725', '2006-02-15T10:05:03'), - ('98', '725', '2006-02-15T10:05:03'), - ('130', '725', '2006-02-15T10:05:03'), - ('123', '725', '2006-02-15T10:05:03'), - ('67', '725', '2006-02-15T10:05:03'), - ('153', '756', '2006-02-15T10:05:03'), - ('19', '756', '2006-02-15T10:05:03'), - ('132', '756', '2006-02-15T10:05:03'), - ('15', '342', '2006-02-15T10:05:03'), - ('148', '342', '2006-02-15T10:05:03'), - ('80', '342', '2006-02-15T10:05:03'), - ('29', '342', '2006-02-15T10:05:03'), - ('171', '342', '2006-02-15T10:05:03'), - ('89', '342', '2006-02-15T10:05:03'), - ('151', '342', '2006-02-15T10:05:03'), - ('97', '342', '2006-02-15T10:05:03'), - ('66', '342', '2006-02-15T10:05:03'), - ('133', '342', '2006-02-15T10:05:03'), - ('159', '342', '2006-02-15T10:05:03'), - ('196', '615', '2006-02-15T10:05:03'), - ('115', '615', '2006-02-15T10:05:03'), - ('35', '615', '2006-02-15T10:05:03'), - ('83', '615', '2006-02-15T10:05:03'), - ('65', '615', '2006-02-15T10:05:03'), - ('184', '615', '2006-02-15T10:05:03'), - ('152', '615', '2006-02-15T10:05:03'), - ('87', '312', '2006-02-15T10:05:03'), - ('48', '312', '2006-02-15T10:05:03'), - ('155', '312', '2006-02-15T10:05:03'), - ('32', '312', '2006-02-15T10:05:03'), - ('128', '312', '2006-02-15T10:05:03'), - ('112', '312', '2006-02-15T10:05:03'), - ('97', '312', '2006-02-15T10:05:03'), - ('144', '312', '2006-02-15T10:05:03'), - ('95', '312', '2006-02-15T10:05:03'), - ('84', '312', '2006-02-15T10:05:03'), - ('124', '312', '2006-02-15T10:05:03'), - ('117', '15', '2006-02-15T10:05:03'), - ('105', '15', '2006-02-15T10:05:03'), - ('164', '15', '2006-02-15T10:05:03'), - ('69', '15', '2006-02-15T10:05:03'), - ('36', '15', '2006-02-15T10:05:03'), - ('170', '15', '2006-02-15T10:05:03'), - ('123', '494', '2006-02-15T10:05:03'), - ('195', '494', '2006-02-15T10:05:03'), - ('101', '494', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('40', '494', '2006-02-15T10:05:03'), - ('142', '494', '2006-02-15T10:05:03'), - ('145', '494', '2006-02-15T10:05:03'), - ('185', '494', '2006-02-15T10:05:03'), - ('131', '494', '2006-02-15T10:05:03'), - ('85', '630', '2006-02-15T10:05:03'), - ('155', '630', '2006-02-15T10:05:03'), - ('55', '27', '2006-02-15T10:05:03'), - ('154', '27', '2006-02-15T10:05:03'), - ('170', '27', '2006-02-15T10:05:03'), - ('7', '27', '2006-02-15T10:05:03'), - ('140', '27', '2006-02-15T10:05:03'), - ('179', '27', '2006-02-15T10:05:03'), - ('148', '27', '2006-02-15T10:05:03'), - ('110', '27', '2006-02-15T10:05:03'), - ('99', '27', '2006-02-15T10:05:03'), - ('28', '827', '2006-02-15T10:05:03'), - ('114', '827', '2006-02-15T10:05:03'), - ('43', '827', '2006-02-15T10:05:03'), - ('55', '827', '2006-02-15T10:05:03'), - ('3', '827', '2006-02-15T10:05:03'), - ('38', '827', '2006-02-15T10:05:03'), - ('177', '827', '2006-02-15T10:05:03'), - ('191', '827', '2006-02-15T10:05:03'), - ('176', '827', '2006-02-15T10:05:03'), - ('81', '827', '2006-02-15T10:05:03'), - ('174', '827', '2006-02-15T10:05:03'), - ('30', '565', '2006-02-15T10:05:03'), - ('73', '565', '2006-02-15T10:05:03'), - ('112', '565', '2006-02-15T10:05:03'), - ('111', '382', '2006-02-15T10:05:03'), - ('127', '382', '2006-02-15T10:05:03'), - ('151', '382', '2006-02-15T10:05:03'), - ('62', '231', '2006-02-15T10:05:03'), - ('112', '231', '2006-02-15T10:05:03'), - ('20', '231', '2006-02-15T10:05:03'), - ('36', '231', '2006-02-15T10:05:03'), - ('120', '231', '2006-02-15T10:05:03'), - ('153', '231', '2006-02-15T10:05:03'), - ('11', '587', '2006-02-15T10:05:03'), - ('39', '587', '2006-02-15T10:05:03'), - ('196', '587', '2006-02-15T10:05:03'), - ('178', '587', '2006-02-15T10:05:03'), - ('10', '587', '2006-02-15T10:05:03'), - ('140', '587', '2006-02-15T10:05:03'), - ('158', '581', '2006-02-15T10:05:03'), - ('198', '924', '2006-02-15T10:05:03'), - ('47', '924', '2006-02-15T10:05:03'), - ('161', '924', '2006-02-15T10:05:03'), - ('15', '924', '2006-02-15T10:05:03'), - ('50', '924', '2006-02-15T10:05:03'), - ('4', '924', '2006-02-15T10:05:03'), - ('179', '924', '2006-02-15T10:05:03'), - ('34', '720', '2006-02-15T10:05:03'), - ('146', '720', '2006-02-15T10:05:03'), - ('69', '720', '2006-02-15T10:05:03'), - ('182', '720', '2006-02-15T10:05:03'), - ('74', '720', '2006-02-15T10:05:03'), - ('79', '262', '2006-02-15T10:05:03'), - ('30', '262', '2006-02-15T10:05:03'), - ('60', '262', '2006-02-15T10:05:03'), - ('90', '262', '2006-02-15T10:05:03'), - ('139', '262', '2006-02-15T10:05:03'), - ('136', '262', '2006-02-15T10:05:03'), - ('80', '262', '2006-02-15T10:05:03'), - ('198', '262', '2006-02-15T10:05:03'), - ('156', '262', '2006-02-15T10:05:03'), - ('176', '946', '2006-02-15T10:05:03'), - ('59', '946', '2006-02-15T10:05:03'), - ('73', '946', '2006-02-15T10:05:03'), - ('141', '862', '2006-02-15T10:05:03'), - ('59', '862', '2006-02-15T10:05:03'), - ('56', '862', '2006-02-15T10:05:03'), - ('76', '862', '2006-02-15T10:05:03'), - ('139', '862', '2006-02-15T10:05:03'), - ('29', '862', '2006-02-15T10:05:03'), - ('97', '862', '2006-02-15T10:05:03'), - ('183', '862', '2006-02-15T10:05:03'), - ('119', '900', '2006-02-15T10:05:03'), - ('37', '900', '2006-02-15T10:05:03'), - ('45', '900', '2006-02-15T10:05:03'), - ('7', '900', '2006-02-15T10:05:03'), - ('190', '682', '2006-02-15T10:05:03'), - ('192', '682', '2006-02-15T10:05:03'), - ('26', '682', '2006-02-15T10:05:03'), - ('27', '682', '2006-02-15T10:05:03'), - ('120', '682', '2006-02-15T10:05:03'), - ('178', '708', '2006-02-15T10:05:03'), - ('192', '708', '2006-02-15T10:05:03'), - ('147', '708', '2006-02-15T10:05:03'), - ('190', '708', '2006-02-15T10:05:03'), - ('118', '938', '2006-02-15T10:05:03'), - ('153', '938', '2006-02-15T10:05:03'), - ('65', '938', '2006-02-15T10:05:03'), - ('40', '938', '2006-02-15T10:05:03'), - ('77', '938', '2006-02-15T10:05:03'), - ('194', '938', '2006-02-15T10:05:03'), - ('129', '938', '2006-02-15T10:05:03'), - ('11', '938', '2006-02-15T10:05:03'), - ('72', '938', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('170', '758', '2006-02-15T10:05:03'), - ('101', '758', '2006-02-15T10:05:03'), - ('137', '758', '2006-02-15T10:05:03'), - ('172', '758', '2006-02-15T10:05:03'), - ('176', '758', '2006-02-15T10:05:03'), - ('197', '758', '2006-02-15T10:05:03'), - ('16', '758', '2006-02-15T10:05:03'), - ('7', '758', '2006-02-15T10:05:03'), - ('198', '758', '2006-02-15T10:05:03'), - ('26', '758', '2006-02-15T10:05:03'), - ('78', '265', '2006-02-15T10:05:03'), - ('185', '265', '2006-02-15T10:05:03'), - ('149', '685', '2006-02-15T10:05:03'), - ('3', '685', '2006-02-15T10:05:03'), - ('168', '685', '2006-02-15T10:05:03'), - ('57', '685', '2006-02-15T10:05:03'), - ('126', '685', '2006-02-15T10:05:03'), - ('184', '35', '2006-02-15T10:05:03'), - ('113', '35', '2006-02-15T10:05:03'), - ('7', '35', '2006-02-15T10:05:03'), - ('135', '35', '2006-02-15T10:05:03'), - ('95', '35', '2006-02-15T10:05:03'), - ('118', '35', '2006-02-15T10:05:03'), - ('35', '35', '2006-02-15T10:05:03'), - ('139', '35', '2006-02-15T10:05:03'), - ('63', '392', '2006-02-15T10:05:03'), - ('195', '392', '2006-02-15T10:05:03'), - ('5', '392', '2006-02-15T10:05:03'), - ('107', '392', '2006-02-15T10:05:03'), - ('26', '392', '2006-02-15T10:05:03'), - ('23', '804', '2006-02-15T10:05:03'), - ('168', '804', '2006-02-15T10:05:03'), - ('74', '804', '2006-02-15T10:05:03'), - ('21', '804', '2006-02-15T10:05:03'), - ('100', '815', '2006-02-15T10:05:03'), - ('197', '815', '2006-02-15T10:05:03'), - ('188', '815', '2006-02-15T10:05:03'), - ('39', '815', '2006-02-15T10:05:03'), - ('55', '815', '2006-02-15T10:05:03'), - ('196', '815', '2006-02-15T10:05:03'), - ('169', '815', '2006-02-15T10:05:03'), - ('9', '815', '2006-02-15T10:05:03'), - ('32', '815', '2006-02-15T10:05:03'), - ('157', '574', '2006-02-15T10:05:03'), - ('71', '574', '2006-02-15T10:05:03'), - ('184', '574', '2006-02-15T10:05:03'), - ('28', '574', '2006-02-15T10:05:03'), - ('107', '574', '2006-02-15T10:05:03'), - ('84', '574', '2006-02-15T10:05:03'), - ('33', '574', '2006-02-15T10:05:03'), - ('162', '574', '2006-02-15T10:05:03'), - ('151', '574', '2006-02-15T10:05:03'), - ('79', '430', '2006-02-15T10:05:03'), - ('107', '430', '2006-02-15T10:05:03'), - ('96', '430', '2006-02-15T10:05:03'), - ('22', '430', '2006-02-15T10:05:03'), - ('98', '721', '2006-02-15T10:05:03'), - ('4', '721', '2006-02-15T10:05:03'), - ('108', '721', '2006-02-15T10:05:03'), - ('41', '721', '2006-02-15T10:05:03'), - ('87', '721', '2006-02-15T10:05:03'), - ('139', '706', '2006-02-15T10:05:03'), - ('143', '706', '2006-02-15T10:05:03'), - ('87', '706', '2006-02-15T10:05:03'), - ('195', '706', '2006-02-15T10:05:03'), - ('68', '706', '2006-02-15T10:05:03'), - ('66', '706', '2006-02-15T10:05:03'), - ('190', '693', '2006-02-15T10:05:03'), - ('140', '693', '2006-02-15T10:05:03'), - ('128', '693', '2006-02-15T10:05:03'), - ('108', '693', '2006-02-15T10:05:03'), - ('131', '693', '2006-02-15T10:05:03'), - ('119', '693', '2006-02-15T10:05:03'), - ('165', '693', '2006-02-15T10:05:03'), - ('118', '39', '2006-02-15T10:05:03'), - ('65', '39', '2006-02-15T10:05:03'), - ('104', '39', '2006-02-15T10:05:03'), - ('191', '39', '2006-02-15T10:05:03'), - ('145', '39', '2006-02-15T10:05:03'), - ('84', '39', '2006-02-15T10:05:03'), - ('177', '39', '2006-02-15T10:05:03'), - ('86', '196', '2006-02-15T10:05:03'), - ('168', '196', '2006-02-15T10:05:03'), - ('90', '855', '2006-02-15T10:05:03'), - ('23', '855', '2006-02-15T10:05:03'), - ('95', '855', '2006-02-15T10:05:03'), - ('25', '179', '2006-02-15T10:05:03'), - ('60', '179', '2006-02-15T10:05:03'), - ('8', '179', '2006-02-15T10:05:03'), - ('192', '179', '2006-02-15T10:05:03'), - ('111', '179', '2006-02-15T10:05:03'), - ('21', '179', '2006-02-15T10:05:03'), - ('101', '255', '2006-02-15T10:05:03'), - ('166', '255', '2006-02-15T10:05:03'), - ('68', '255', '2006-02-15T10:05:03'), - ('8', '255', '2006-02-15T10:05:03'), - ('14', '255', '2006-02-15T10:05:03'), - ('168', '255', '2006-02-15T10:05:03'), - ('120', '255', '2006-02-15T10:05:03'), - ('74', '617', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('101', '617', '2006-02-15T10:05:03'), - ('187', '617', '2006-02-15T10:05:03'), - ('127', '617', '2006-02-15T10:05:03'), - ('79', '634', '2006-02-15T10:05:03'), - ('22', '634', '2006-02-15T10:05:03'), - ('169', '634', '2006-02-15T10:05:03'), - ('151', '634', '2006-02-15T10:05:03'), - ('98', '634', '2006-02-15T10:05:03'), - ('181', '83', '2006-02-15T10:05:03'), - ('122', '83', '2006-02-15T10:05:03'), - ('106', '83', '2006-02-15T10:05:03'), - ('24', '83', '2006-02-15T10:05:03'), - ('117', '783', '2006-02-15T10:05:03'), - ('15', '783', '2006-02-15T10:05:03'), - ('60', '783', '2006-02-15T10:05:03'), - ('43', '276', '2006-02-15T10:05:03'), - ('154', '276', '2006-02-15T10:05:03'), - ('196', '276', '2006-02-15T10:05:03'), - ('65', '276', '2006-02-15T10:05:03'), - ('139', '282', '2006-02-15T10:05:03'), - ('154', '282', '2006-02-15T10:05:03'), - ('49', '282', '2006-02-15T10:05:03'), - ('29', '282', '2006-02-15T10:05:03'), - ('60', '784', '2006-02-15T10:05:03'), - ('199', '784', '2006-02-15T10:05:03'), - ('116', '784', '2006-02-15T10:05:03'), - ('20', '784', '2006-02-15T10:05:03'), - ('83', '784', '2006-02-15T10:05:03'), - ('41', '784', '2006-02-15T10:05:03'), - ('159', '784', '2006-02-15T10:05:03'), - ('44', '784', '2006-02-15T10:05:03'), - ('147', '405', '2006-02-15T10:05:03'), - ('175', '405', '2006-02-15T10:05:03'), - ('72', '405', '2006-02-15T10:05:03'), - ('24', '405', '2006-02-15T10:05:03'), - ('173', '405', '2006-02-15T10:05:03'), - ('25', '688', '2006-02-15T10:05:03'), - ('147', '688', '2006-02-15T10:05:03'), - ('173', '688', '2006-02-15T10:05:03'), - ('22', '688', '2006-02-15T10:05:03'), - ('62', '688', '2006-02-15T10:05:03'), - ('155', '688', '2006-02-15T10:05:03'), - ('26', '688', '2006-02-15T10:05:03'), - ('80', '688', '2006-02-15T10:05:03'), - ('14', '688', '2006-02-15T10:05:03'), - ('137', '688', '2006-02-15T10:05:03'), - ('48', '506', '2006-02-15T10:05:03'), - ('1', '506', '2006-02-15T10:05:03'), - ('180', '506', '2006-02-15T10:05:03'), - ('188', '506', '2006-02-15T10:05:03'), - ('104', '506', '2006-02-15T10:05:03'), - ('49', '506', '2006-02-15T10:05:03'), - ('115', '506', '2006-02-15T10:05:03'), - ('64', '506', '2006-02-15T10:05:03'), - ('54', '842', '2006-02-15T10:05:03'), - ('142', '842', '2006-02-15T10:05:03'), - ('175', '842', '2006-02-15T10:05:03'), - ('18', '842', '2006-02-15T10:05:03'), - ('136', '842', '2006-02-15T10:05:03'), - ('23', '842', '2006-02-15T10:05:03'), - ('154', '842', '2006-02-15T10:05:03'), - ('135', '353', '2006-02-15T10:05:03'), - ('38', '353', '2006-02-15T10:05:03'), - ('121', '353', '2006-02-15T10:05:03'), - ('157', '353', '2006-02-15T10:05:03'), - ('113', '353', '2006-02-15T10:05:03'), - ('95', '353', '2006-02-15T10:05:03'), - ('179', '353', '2006-02-15T10:05:03'), - ('161', '353', '2006-02-15T10:05:03'), - ('161', '188', '2006-02-15T10:05:03'), - ('149', '188', '2006-02-15T10:05:03'), - ('177', '188', '2006-02-15T10:05:03'), - ('114', '188', '2006-02-15T10:05:03'), - ('141', '188', '2006-02-15T10:05:03'), - ('82', '188', '2006-02-15T10:05:03'), - ('158', '188', '2006-02-15T10:05:03'), - ('112', '188', '2006-02-15T10:05:03'), - ('31', '188', '2006-02-15T10:05:03'), - ('125', '188', '2006-02-15T10:05:03'), - ('97', '188', '2006-02-15T10:05:03'), - ('173', '188', '2006-02-15T10:05:03'), - ('168', '188', '2006-02-15T10:05:03'), - ('76', '187', '2006-02-15T10:05:03'), - ('186', '187', '2006-02-15T10:05:03'), - ('45', '187', '2006-02-15T10:05:03'), - ('14', '187', '2006-02-15T10:05:03'), - ('89', '187', '2006-02-15T10:05:03'), - ('159', '187', '2006-02-15T10:05:03'), - ('144', '164', '2006-02-15T10:05:03'), - ('162', '164', '2006-02-15T10:05:03'), - ('45', '164', '2006-02-15T10:05:03'), - ('48', '164', '2006-02-15T10:05:03'), - ('31', '164', '2006-02-15T10:05:03'), - ('178', '164', '2006-02-15T10:05:03'), - ('24', '164', '2006-02-15T10:05:03'), - ('193', '164', '2006-02-15T10:05:03'), - ('6', '164', '2006-02-15T10:05:03'), - ('197', '164', '2006-02-15T10:05:03'), - ('197', '249', '2006-02-15T10:05:03'), - ('86', '249', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('72', '249', '2006-02-15T10:05:03'), - ('63', '249', '2006-02-15T10:05:03'), - ('137', '249', '2006-02-15T10:05:03'), - ('41', '249', '2006-02-15T10:05:03'), - ('83', '249', '2006-02-15T10:05:03'), - ('52', '249', '2006-02-15T10:05:03'), - ('2', '249', '2006-02-15T10:05:03'), - ('113', '249', '2006-02-15T10:05:03'), - ('70', '249', '2006-02-15T10:05:03'), - ('155', '249', '2006-02-15T10:05:03'), - ('129', '249', '2006-02-15T10:05:03'), - ('69', '722', '2006-02-15T10:05:03'), - ('120', '722', '2006-02-15T10:05:03'), - ('9', '722', '2006-02-15T10:05:03'), - ('174', '722', '2006-02-15T10:05:03'), - ('38', '618', '2006-02-15T10:05:03'), - ('3', '618', '2006-02-15T10:05:03'), - ('33', '618', '2006-02-15T10:05:03'), - ('192', '618', '2006-02-15T10:05:03'), - ('174', '618', '2006-02-15T10:05:03'), - ('99', '618', '2006-02-15T10:05:03'), - ('92', '618', '2006-02-15T10:05:03'), - ('7', '618', '2006-02-15T10:05:03'), - ('152', '729', '2006-02-15T10:05:03'), - ('180', '729', '2006-02-15T10:05:03'), - ('13', '729', '2006-02-15T10:05:03'), - ('84', '729', '2006-02-15T10:05:03'), - ('175', '729', '2006-02-15T10:05:03'), - ('140', '729', '2006-02-15T10:05:03'), - ('81', '729', '2006-02-15T10:05:03'), - ('186', '729', '2006-02-15T10:05:03'), - ('49', '729', '2006-02-15T10:05:03'), - ('93', '874', '2006-02-15T10:05:03'), - ('180', '874', '2006-02-15T10:05:03'), - ('181', '874', '2006-02-15T10:05:03'), - ('96', '874', '2006-02-15T10:05:03'), - ('17', '874', '2006-02-15T10:05:03'), - ('190', '874', '2006-02-15T10:05:03'), - ('157', '874', '2006-02-15T10:05:03'), - ('71', '874', '2006-02-15T10:05:03'), - ('178', '397', '2006-02-15T10:05:03'), - ('133', '397', '2006-02-15T10:05:03'), - ('171', '397', '2006-02-15T10:05:03'), - ('51', '408', '2006-02-15T10:05:03'), - ('67', '408', '2006-02-15T10:05:03'), - ('54', '861', '2006-02-15T10:05:03'), - ('114', '861', '2006-02-15T10:05:03'), - ('134', '861', '2006-02-15T10:05:03'), - ('42', '861', '2006-02-15T10:05:03'), - ('67', '861', '2006-02-15T10:05:03'), - ('140', '576', '2006-02-15T10:05:03'), - ('123', '576', '2006-02-15T10:05:03'), - ('143', '576', '2006-02-15T10:05:03'), - ('196', '576', '2006-02-15T10:05:03'), - ('67', '576', '2006-02-15T10:05:03'), - ('47', '576', '2006-02-15T10:05:03'), - ('183', '576', '2006-02-15T10:05:03'), - ('53', '576', '2006-02-15T10:05:03'), - ('36', '931', '2006-02-15T10:05:03'), - ('179', '931', '2006-02-15T10:05:03'), - ('107', '112', '2006-02-15T10:05:03'), - ('6', '112', '2006-02-15T10:05:03'), - ('32', '112', '2006-02-15T10:05:03'), - ('140', '112', '2006-02-15T10:05:03'), - ('51', '112', '2006-02-15T10:05:03'), - ('24', '112', '2006-02-15T10:05:03'), - ('130', '112', '2006-02-15T10:05:03'), - ('33', '112', '2006-02-15T10:05:03'), - ('65', '496', '2006-02-15T10:05:03'), - ('167', '496', '2006-02-15T10:05:03'), - ('173', '496', '2006-02-15T10:05:03'), - ('174', '496', '2006-02-15T10:05:03'), - ('67', '496', '2006-02-15T10:05:03'), - ('157', '496', '2006-02-15T10:05:03'), - ('183', '941', '2006-02-15T10:05:03'), - ('101', '941', '2006-02-15T10:05:03'), - ('155', '941', '2006-02-15T10:05:03'), - ('80', '941', '2006-02-15T10:05:03'), - ('91', '941', '2006-02-15T10:05:03'), - ('189', '171', '2006-02-15T10:05:03'), - ('5', '171', '2006-02-15T10:05:03'), - ('36', '171', '2006-02-15T10:05:03'), - ('119', '171', '2006-02-15T10:05:03'), - ('57', '101', '2006-02-15T10:05:03'), - ('62', '101', '2006-02-15T10:05:03'), - ('48', '101', '2006-02-15T10:05:03'), - ('129', '101', '2006-02-15T10:05:03'), - ('16', '101', '2006-02-15T10:05:03'), - ('125', '114', '2006-02-15T10:05:03'), - ('57', '114', '2006-02-15T10:05:03'), - ('7', '957', '2006-02-15T10:05:03'), - ('50', '957', '2006-02-15T10:05:03'), - ('118', '957', '2006-02-15T10:05:03'), - ('85', '957', '2006-02-15T10:05:03'), - ('147', '957', '2006-02-15T10:05:03'), - ('17', '957', '2006-02-15T10:05:03'), - ('122', '957', '2006-02-15T10:05:03'), - ('164', '957', '2006-02-15T10:05:03'), - ('66', '957', '2006-02-15T10:05:03'), - ('42', '502', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('15', '502', '2006-02-15T10:05:03'), - ('57', '502', '2006-02-15T10:05:03'), - ('45', '502', '2006-02-15T10:05:03'), - ('28', '502', '2006-02-15T10:05:03'), - ('34', '502', '2006-02-15T10:05:03'), - ('51', '5', '2006-02-15T10:05:03'), - ('181', '5', '2006-02-15T10:05:03'), - ('103', '5', '2006-02-15T10:05:03'), - ('200', '5', '2006-02-15T10:05:03'), - ('59', '5', '2006-02-15T10:05:03'), - ('96', '987', '2006-02-15T10:05:03'), - ('132', '987', '2006-02-15T10:05:03'), - ('124', '987', '2006-02-15T10:05:03'), - ('147', '987', '2006-02-15T10:05:03'), - ('155', '987', '2006-02-15T10:05:03'), - ('110', '987', '2006-02-15T10:05:03'), - ('40', '723', '2006-02-15T10:05:03'), - ('29', '723', '2006-02-15T10:05:03'), - ('113', '723', '2006-02-15T10:05:03'), - ('146', '429', '2006-02-15T10:05:03'), - ('11', '429', '2006-02-15T10:05:03'), - ('123', '429', '2006-02-15T10:05:03'), - ('125', '429', '2006-02-15T10:05:03'), - ('21', '429', '2006-02-15T10:05:03'), - ('31', '978', '2006-02-15T10:05:03'), - ('45', '978', '2006-02-15T10:05:03'), - ('101', '978', '2006-02-15T10:05:03'), - ('159', '978', '2006-02-15T10:05:03'), - ('82', '978', '2006-02-15T10:05:03'), - ('175', '978', '2006-02-15T10:05:03'), - ('99', '978', '2006-02-15T10:05:03'), - ('147', '178', '2006-02-15T10:05:03'), - ('81', '178', '2006-02-15T10:05:03'), - ('158', '178', '2006-02-15T10:05:03'), - ('24', '178', '2006-02-15T10:05:03'), - ('149', '178', '2006-02-15T10:05:03'), - ('50', '178', '2006-02-15T10:05:03'), - ('117', '178', '2006-02-15T10:05:03'), - ('181', '907', '2006-02-15T10:05:03'), - ('159', '907', '2006-02-15T10:05:03'), - ('42', '907', '2006-02-15T10:05:03'), - ('65', '965', '2006-02-15T10:05:03'), - ('33', '965', '2006-02-15T10:05:03'), - ('128', '965', '2006-02-15T10:05:03'), - ('56', '965', '2006-02-15T10:05:03'), - ('125', '965', '2006-02-15T10:05:03'), - ('185', '965', '2006-02-15T10:05:03'), - ('65', '556', '2006-02-15T10:05:03'), - ('57', '852', '2006-02-15T10:05:03'), - ('64', '852', '2006-02-15T10:05:03'), - ('78', '852', '2006-02-15T10:05:03'), - ('102', '852', '2006-02-15T10:05:03'), - ('179', '852', '2006-02-15T10:05:03'), - ('118', '852', '2006-02-15T10:05:03'), - ('174', '852', '2006-02-15T10:05:03'), - ('173', '852', '2006-02-15T10:05:03'), - ('65', '852', '2006-02-15T10:05:03'), - ('54', '600', '2006-02-15T10:05:03'), - ('159', '600', '2006-02-15T10:05:03'), - ('22', '600', '2006-02-15T10:05:03'), - ('102', '600', '2006-02-15T10:05:03'), - ('13', '600', '2006-02-15T10:05:03'), - ('104', '600', '2006-02-15T10:05:03'), - ('99', '600', '2006-02-15T10:05:03'), - ('36', '600', '2006-02-15T10:05:03'), - ('13', '998', '2006-02-15T10:05:03'), - ('44', '998', '2006-02-15T10:05:03'), - ('175', '998', '2006-02-15T10:05:03'), - ('169', '998', '2006-02-15T10:05:03'), - ('73', '998', '2006-02-15T10:05:03'), - ('122', '998', '2006-02-15T10:05:03'), - ('197', '123', '2006-02-15T10:05:03'), - ('102', '123', '2006-02-15T10:05:03'), - ('144', '123', '2006-02-15T10:05:03'), - ('92', '123', '2006-02-15T10:05:03'), - ('183', '914', '2006-02-15T10:05:03'), - ('25', '914', '2006-02-15T10:05:03'), - ('35', '914', '2006-02-15T10:05:03'), - ('191', '914', '2006-02-15T10:05:03'), - ('10', '914', '2006-02-15T10:05:03'), - ('187', '914', '2006-02-15T10:05:03'), - ('142', '914', '2006-02-15T10:05:03'), - ('69', '914', '2006-02-15T10:05:03'), - ('13', '45', '2006-02-15T10:05:03'), - ('163', '45', '2006-02-15T10:05:03'), - ('73', '45', '2006-02-15T10:05:03'), - ('68', '45', '2006-02-15T10:05:03'), - ('4', '616', '2006-02-15T10:05:03'), - ('64', '616', '2006-02-15T10:05:03'), - ('135', '616', '2006-02-15T10:05:03'), - ('158', '616', '2006-02-15T10:05:03'), - ('84', '616', '2006-02-15T10:05:03'), - ('175', '616', '2006-02-15T10:05:03'), - ('157', '616', '2006-02-15T10:05:03'), - ('106', '675', '2006-02-15T10:05:03'), - ('52', '675', '2006-02-15T10:05:03'), - ('77', '749', '2006-02-15T10:05:03'), - ('1', '749', '2006-02-15T10:05:03'), - ('161', '749', '2006-02-15T10:05:03'), - ('127', '749', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('59', '749', '2006-02-15T10:05:03'), - ('40', '521', '2006-02-15T10:05:03'), - ('102', '521', '2006-02-15T10:05:03'), - ('119', '521', '2006-02-15T10:05:03'), - ('94', '521', '2006-02-15T10:05:03'), - ('17', '521', '2006-02-15T10:05:03'), - ('176', '521', '2006-02-15T10:05:03'), - ('56', '521', '2006-02-15T10:05:03'), - ('66', '424', '2006-02-15T10:05:03'), - ('120', '424', '2006-02-15T10:05:03'), - ('52', '424', '2006-02-15T10:05:03'), - ('95', '424', '2006-02-15T10:05:03'), - ('175', '424', '2006-02-15T10:05:03'), - ('72', '636', '2006-02-15T10:05:03'), - ('86', '636', '2006-02-15T10:05:03'), - ('99', '636', '2006-02-15T10:05:03'), - ('139', '636', '2006-02-15T10:05:03'), - ('23', '636', '2006-02-15T10:05:03'), - ('11', '636', '2006-02-15T10:05:03'), - ('54', '636', '2006-02-15T10:05:03'), - ('183', '636', '2006-02-15T10:05:03'), - ('119', '636', '2006-02-15T10:05:03'), - ('162', '636', '2006-02-15T10:05:03'), - ('122', '76', '2006-02-15T10:05:03'), - ('88', '76', '2006-02-15T10:05:03'), - ('187', '76', '2006-02-15T10:05:03'), - ('94', '76', '2006-02-15T10:05:03'), - ('157', '406', '2006-02-15T10:05:03'), - ('90', '406', '2006-02-15T10:05:03'), - ('198', '406', '2006-02-15T10:05:03'), - ('89', '406', '2006-02-15T10:05:03'), - ('62', '406', '2006-02-15T10:05:03'), - ('57', '605', '2006-02-15T10:05:03'), - ('102', '605', '2006-02-15T10:05:03'), - ('1', '605', '2006-02-15T10:05:03'), - ('6', '605', '2006-02-15T10:05:03'), - ('139', '605', '2006-02-15T10:05:03'), - ('43', '605', '2006-02-15T10:05:03'), - ('103', '639', '2006-02-15T10:05:03'), - ('182', '639', '2006-02-15T10:05:03'), - ('172', '639', '2006-02-15T10:05:03'), - ('106', '639', '2006-02-15T10:05:03'), - ('61', '639', '2006-02-15T10:05:03'), - ('138', '639', '2006-02-15T10:05:03'), - ('118', '311', '2006-02-15T10:05:03'), - ('132', '311', '2006-02-15T10:05:03'), - ('198', '311', '2006-02-15T10:05:03'), - ('25', '311', '2006-02-15T10:05:03'), - ('178', '311', '2006-02-15T10:05:03'), - ('188', '311', '2006-02-15T10:05:03'), - ('29', '311', '2006-02-15T10:05:03'), - ('181', '311', '2006-02-15T10:05:03'), - ('108', '495', '2006-02-15T10:05:03'), - ('14', '495', '2006-02-15T10:05:03'), - ('183', '495', '2006-02-15T10:05:03'), - ('22', '495', '2006-02-15T10:05:03'), - ('54', '301', '2006-02-15T10:05:03'), - ('95', '301', '2006-02-15T10:05:03'), - ('30', '301', '2006-02-15T10:05:03'), - ('182', '301', '2006-02-15T10:05:03'), - ('156', '301', '2006-02-15T10:05:03'), - ('78', '301', '2006-02-15T10:05:03'), - ('169', '301', '2006-02-15T10:05:03'), - ('75', '301', '2006-02-15T10:05:03'), - ('181', '301', '2006-02-15T10:05:03'), - ('64', '572', '2006-02-15T10:05:03'), - ('118', '572', '2006-02-15T10:05:03'), - ('37', '572', '2006-02-15T10:05:03'), - ('59', '572', '2006-02-15T10:05:03'), - ('99', '572', '2006-02-15T10:05:03'), - ('96', '572', '2006-02-15T10:05:03'), - ('48', '150', '2006-02-15T10:05:03'), - ('54', '150', '2006-02-15T10:05:03'), - ('27', '150', '2006-02-15T10:05:03'), - ('41', '150', '2006-02-15T10:05:03'), - ('176', '150', '2006-02-15T10:05:03'), - ('127', '36', '2006-02-15T10:05:03'), - ('73', '36', '2006-02-15T10:05:03'), - ('116', '36', '2006-02-15T10:05:03'), - ('96', '36', '2006-02-15T10:05:03'), - ('47', '36', '2006-02-15T10:05:03'), - ('113', '656', '2006-02-15T10:05:03'), - ('97', '656', '2006-02-15T10:05:03'), - ('118', '656', '2006-02-15T10:05:03'), - ('150', '629', '2006-02-15T10:05:03'), - ('145', '629', '2006-02-15T10:05:03'), - ('66', '226', '2006-02-15T10:05:03'), - ('23', '226', '2006-02-15T10:05:03'), - ('29', '226', '2006-02-15T10:05:03'), - ('56', '226', '2006-02-15T10:05:03'), - ('25', '226', '2006-02-15T10:05:03'), - ('148', '226', '2006-02-15T10:05:03'), - ('2', '226', '2006-02-15T10:05:03'), - ('34', '389', '2006-02-15T10:05:03'), - ('81', '389', '2006-02-15T10:05:03'), - ('35', '389', '2006-02-15T10:05:03'), - ('183', '389', '2006-02-15T10:05:03'), - ('37', '925', '2006-02-15T10:05:03'), - ('45', '925', '2006-02-15T10:05:03'), - ('188', '925', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('90', '925', '2006-02-15T10:05:03'), - ('170', '925', '2006-02-15T10:05:03'), - ('64', '925', '2006-02-15T10:05:03'), - ('40', '747', '2006-02-15T10:05:03'), - ('68', '747', '2006-02-15T10:05:03'), - ('192', '747', '2006-02-15T10:05:03'), - ('138', '747', '2006-02-15T10:05:03'), - ('74', '747', '2006-02-15T10:05:03'), - ('73', '77', '2006-02-15T10:05:03'), - ('140', '77', '2006-02-15T10:05:03'), - ('109', '77', '2006-02-15T10:05:03'), - ('30', '77', '2006-02-15T10:05:03'), - ('49', '662', '2006-02-15T10:05:03'), - ('92', '662', '2006-02-15T10:05:03'), - ('101', '662', '2006-02-15T10:05:03'), - ('37', '662', '2006-02-15T10:05:03'), - ('188', '662', '2006-02-15T10:05:03'), - ('142', '328', '2006-02-15T10:05:03'), - ('98', '183', '2006-02-15T10:05:03'), - ('59', '183', '2006-02-15T10:05:03'), - ('157', '183', '2006-02-15T10:05:03'), - ('117', '459', '2006-02-15T10:05:03'), - ('155', '459', '2006-02-15T10:05:03'), - ('127', '459', '2006-02-15T10:05:03'), - ('90', '11', '2006-02-15T10:05:03'), - ('40', '11', '2006-02-15T10:05:03'), - ('174', '11', '2006-02-15T10:05:03'), - ('81', '11', '2006-02-15T10:05:03'), - ('110', '801', '2006-02-15T10:05:03'), - ('191', '801', '2006-02-15T10:05:03'), - ('164', '801', '2006-02-15T10:05:03'), - ('82', '143', '2006-02-15T10:05:03'), - ('119', '143', '2006-02-15T10:05:03'), - ('75', '143', '2006-02-15T10:05:03'), - ('66', '143', '2006-02-15T10:05:03'), - ('97', '143', '2006-02-15T10:05:03'), - ('96', '244', '2006-02-15T10:05:03'), - ('156', '244', '2006-02-15T10:05:03'), - ('67', '244', '2006-02-15T10:05:03'), - ('34', '244', '2006-02-15T10:05:03'), - ('108', '958', '2006-02-15T10:05:03'), - ('143', '958', '2006-02-15T10:05:03'), - ('200', '958', '2006-02-15T10:05:03'), - ('102', '958', '2006-02-15T10:05:03'), - ('43', '958', '2006-02-15T10:05:03'), - ('191', '958', '2006-02-15T10:05:03'), - ('2', '958', '2006-02-15T10:05:03'), - ('76', '958', '2006-02-15T10:05:03'), - ('146', '955', '2006-02-15T10:05:03'), - ('98', '955', '2006-02-15T10:05:03'), - ('115', '955', '2006-02-15T10:05:03'), - ('180', '955', '2006-02-15T10:05:03'), - ('109', '955', '2006-02-15T10:05:03'), - ('164', '367', '2006-02-15T10:05:03'), - ('192', '367', '2006-02-15T10:05:03'), - ('23', '367', '2006-02-15T10:05:03'), - ('125', '367', '2006-02-15T10:05:03'), - ('151', '367', '2006-02-15T10:05:03'), - ('79', '367', '2006-02-15T10:05:03'), - ('129', '367', '2006-02-15T10:05:03'), - ('14', '253', '2006-02-15T10:05:03'), - ('190', '253', '2006-02-15T10:05:03'), - ('165', '253', '2006-02-15T10:05:03'), - ('21', '253', '2006-02-15T10:05:03'), - ('87', '253', '2006-02-15T10:05:03'), - ('60', '253', '2006-02-15T10:05:03'), - ('37', '253', '2006-02-15T10:05:03'), - ('107', '445', '2006-02-15T10:05:03'), - ('93', '445', '2006-02-15T10:05:03'), - ('20', '445', '2006-02-15T10:05:03'), - ('15', '445', '2006-02-15T10:05:03'), - ('62', '445', '2006-02-15T10:05:03'), - ('75', '445', '2006-02-15T10:05:03'), - ('83', '110', '2006-02-15T10:05:03'), - ('29', '110', '2006-02-15T10:05:03'), - ('13', '110', '2006-02-15T10:05:03'), - ('187', '110', '2006-02-15T10:05:03'), - ('171', '166', '2006-02-15T10:05:03'), - ('129', '166', '2006-02-15T10:05:03'), - ('106', '166', '2006-02-15T10:05:03'), - ('192', '166', '2006-02-15T10:05:03'), - ('122', '166', '2006-02-15T10:05:03'), - ('163', '166', '2006-02-15T10:05:03'), - ('1', '166', '2006-02-15T10:05:03'), - ('98', '194', '2006-02-15T10:05:03'), - ('114', '194', '2006-02-15T10:05:03'), - ('41', '194', '2006-02-15T10:05:03'), - ('102', '194', '2006-02-15T10:05:03'), - ('106', '194', '2006-02-15T10:05:03'), - ('81', '194', '2006-02-15T10:05:03'), - ('126', '194', '2006-02-15T10:05:03'), - ('178', '194', '2006-02-15T10:05:03'), - ('24', '194', '2006-02-15T10:05:03'), - ('111', '194', '2006-02-15T10:05:03'), - ('43', '377', '2006-02-15T10:05:03'), - ('105', '377', '2006-02-15T10:05:03'), - ('132', '377', '2006-02-15T10:05:03'), - ('91', '807', '2006-02-15T10:05:03'), - ('168', '807', '2006-02-15T10:05:03'), - ('165', '807', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('161', '807', '2006-02-15T10:05:03'), - ('80', '807', '2006-02-15T10:05:03'), - ('193', '807', '2006-02-15T10:05:03'), - ('114', '807', '2006-02-15T10:05:03'), - ('181', '74', '2006-02-15T10:05:03'), - ('139', '74', '2006-02-15T10:05:03'), - ('28', '74', '2006-02-15T10:05:03'), - ('173', '74', '2006-02-15T10:05:03'), - ('95', '74', '2006-02-15T10:05:03'), - ('9', '74', '2006-02-15T10:05:03'), - ('188', '412', '2006-02-15T10:05:03'), - ('83', '412', '2006-02-15T10:05:03'), - ('116', '412', '2006-02-15T10:05:03'), - ('193', '412', '2006-02-15T10:05:03'), - ('119', '412', '2006-02-15T10:05:03'), - ('49', '423', '2006-02-15T10:05:03'), - ('172', '423', '2006-02-15T10:05:03'), - ('196', '423', '2006-02-15T10:05:03'), - ('117', '423', '2006-02-15T10:05:03'), - ('61', '423', '2006-02-15T10:05:03'), - ('60', '423', '2006-02-15T10:05:03'), - ('73', '666', '2006-02-15T10:05:03'), - ('121', '666', '2006-02-15T10:05:03'), - ('112', '666', '2006-02-15T10:05:03'), - ('127', '79', '2006-02-15T10:05:03'), - ('29', '79', '2006-02-15T10:05:03'), - ('144', '79', '2006-02-15T10:05:03'), - ('143', '79', '2006-02-15T10:05:03'), - ('4', '79', '2006-02-15T10:05:03'), - ('121', '154', '2006-02-15T10:05:03'), - ('17', '154', '2006-02-15T10:05:03'), - ('33', '154', '2006-02-15T10:05:03'), - ('145', '154', '2006-02-15T10:05:03'), - ('173', '154', '2006-02-15T10:05:03'), - ('13', '154', '2006-02-15T10:05:03'), - ('14', '154', '2006-02-15T10:05:03'), - ('104', '904', '2006-02-15T10:05:03'), - ('26', '904', '2006-02-15T10:05:03'), - ('27', '904', '2006-02-15T10:05:03'), - ('132', '904', '2006-02-15T10:05:03'), - ('117', '395', '2006-02-15T10:05:03'), - ('141', '395', '2006-02-15T10:05:03'), - ('51', '395', '2006-02-15T10:05:03'), - ('125', '395', '2006-02-15T10:05:03'), - ('11', '395', '2006-02-15T10:05:03'), - ('198', '395', '2006-02-15T10:05:03'), - ('165', '395', '2006-02-15T10:05:03'), - ('21', '530', '2006-02-15T10:05:03'), - ('10', '530', '2006-02-15T10:05:03'), - ('78', '530', '2006-02-15T10:05:03'), - ('105', '530', '2006-02-15T10:05:03'), - ('123', '530', '2006-02-15T10:05:03'), - ('137', '530', '2006-02-15T10:05:03'), - ('104', '59', '2006-02-15T10:05:03'), - ('152', '59', '2006-02-15T10:05:03'), - ('81', '59', '2006-02-15T10:05:03'), - ('139', '691', '2006-02-15T10:05:03'), - ('23', '691', '2006-02-15T10:05:03'), - ('7', '691', '2006-02-15T10:05:03'), - ('4', '691', '2006-02-15T10:05:03'), - ('197', '691', '2006-02-15T10:05:03'), - ('120', '691', '2006-02-15T10:05:03'), - ('126', '317', '2006-02-15T10:05:03'), - ('57', '317', '2006-02-15T10:05:03'), - ('37', '317', '2006-02-15T10:05:03'), - ('84', '317', '2006-02-15T10:05:03'), - ('71', '317', '2006-02-15T10:05:03'), - ('52', '596', '2006-02-15T10:05:03'), - ('41', '596', '2006-02-15T10:05:03'), - ('175', '596', '2006-02-15T10:05:03'), - ('191', '596', '2006-02-15T10:05:03'), - ('181', '596', '2006-02-15T10:05:03'), - ('54', '348', '2006-02-15T10:05:03'), - ('97', '348', '2006-02-15T10:05:03'), - ('76', '348', '2006-02-15T10:05:03'), - ('20', '348', '2006-02-15T10:05:03'), - ('49', '348', '2006-02-15T10:05:03'), - ('129', '348', '2006-02-15T10:05:03'), - ('11', '348', '2006-02-15T10:05:03'), - ('107', '348', '2006-02-15T10:05:03'), - ('41', '60', '2006-02-15T10:05:03'), - ('94', '60', '2006-02-15T10:05:03'), - ('101', '60', '2006-02-15T10:05:03'), - ('76', '60', '2006-02-15T10:05:03'), - ('6', '60', '2006-02-15T10:05:03'), - ('123', '479', '2006-02-15T10:05:03'), - ('131', '479', '2006-02-15T10:05:03'), - ('84', '479', '2006-02-15T10:05:03'), - ('121', '479', '2006-02-15T10:05:03'), - ('164', '908', '2006-02-15T10:05:03'), - ('28', '908', '2006-02-15T10:05:03'), - ('125', '908', '2006-02-15T10:05:03'), - ('14', '908', '2006-02-15T10:05:03'), - ('196', '908', '2006-02-15T10:05:03'), - ('175', '908', '2006-02-15T10:05:03'), - ('88', '908', '2006-02-15T10:05:03'), - ('24', '335', '2006-02-15T10:05:03'), - ('29', '335', '2006-02-15T10:05:03'), - ('64', '335', '2006-02-15T10:05:03'), - ('91', '335', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('38', '335', '2006-02-15T10:05:03'), - ('128', '774', '2006-02-15T10:05:03'), - ('107', '774', '2006-02-15T10:05:03'), - ('188', '774', '2006-02-15T10:05:03'), - ('101', '774', '2006-02-15T10:05:03'), - ('90', '838', '2006-02-15T10:05:03'), - ('12', '838', '2006-02-15T10:05:03'), - ('113', '838', '2006-02-15T10:05:03'), - ('92', '838', '2006-02-15T10:05:03'), - ('30', '838', '2006-02-15T10:05:03'), - ('82', '838', '2006-02-15T10:05:03'), - ('22', '294', '2006-02-15T10:05:03'), - ('167', '294', '2006-02-15T10:05:03'), - ('95', '294', '2006-02-15T10:05:03'), - ('94', '788', '2006-02-15T10:05:03'), - ('34', '788', '2006-02-15T10:05:03'), - ('79', '788', '2006-02-15T10:05:03'), - ('80', '788', '2006-02-15T10:05:03'), - ('118', '788', '2006-02-15T10:05:03'), - ('119', '788', '2006-02-15T10:05:03'), - ('189', '788', '2006-02-15T10:05:03'), - ('166', '788', '2006-02-15T10:05:03'), - ('151', '880', '2006-02-15T10:05:03'), - ('31', '880', '2006-02-15T10:05:03'), - ('12', '880', '2006-02-15T10:05:03'), - ('78', '880', '2006-02-15T10:05:03'), - ('150', '880', '2006-02-15T10:05:03'), - ('158', '880', '2006-02-15T10:05:03'), - ('90', '880', '2006-02-15T10:05:03'), - ('185', '880', '2006-02-15T10:05:03'), - ('27', '880', '2006-02-15T10:05:03'), - ('161', '880', '2006-02-15T10:05:03'), - ('17', '880', '2006-02-15T10:05:03'), - ('9', '903', '2006-02-15T10:05:03'), - ('171', '903', '2006-02-15T10:05:03'), - ('103', '903', '2006-02-15T10:05:03'), - ('95', '903', '2006-02-15T10:05:03'), - ('112', '700', '2006-02-15T10:05:03'), - ('113', '700', '2006-02-15T10:05:03'), - ('109', '700', '2006-02-15T10:05:03'), - ('31', '700', '2006-02-15T10:05:03'), - ('21', '700', '2006-02-15T10:05:03'), - ('39', '700', '2006-02-15T10:05:03'), - ('101', '700', '2006-02-15T10:05:03'), - ('135', '719', '2006-02-15T10:05:03'), - ('163', '719', '2006-02-15T10:05:03'), - ('62', '719', '2006-02-15T10:05:03'), - ('194', '719', '2006-02-15T10:05:03'), - ('175', '719', '2006-02-15T10:05:03'), - ('139', '719', '2006-02-15T10:05:03'), - ('83', '719', '2006-02-15T10:05:03'), - ('113', '719', '2006-02-15T10:05:03'), - ('152', '153', '2006-02-15T10:05:03'), - ('149', '153', '2006-02-15T10:05:03'), - ('57', '153', '2006-02-15T10:05:03'), - ('94', '153', '2006-02-15T10:05:03'), - ('25', '153', '2006-02-15T10:05:03'), - ('155', '153', '2006-02-15T10:05:03'), - ('77', '153', '2006-02-15T10:05:03'), - ('51', '153', '2006-02-15T10:05:03'), - ('74', '44', '2006-02-15T10:05:03'), - ('193', '44', '2006-02-15T10:05:03'), - ('106', '44', '2006-02-15T10:05:03'), - ('18', '44', '2006-02-15T10:05:03'), - ('42', '922', '2006-02-15T10:05:03'), - ('48', '922', '2006-02-15T10:05:03'), - ('146', '922', '2006-02-15T10:05:03'), - ('166', '38', '2006-02-15T10:05:03'), - ('46', '38', '2006-02-15T10:05:03'), - ('190', '38', '2006-02-15T10:05:03'), - ('120', '746', '2006-02-15T10:05:03'), - ('176', '746', '2006-02-15T10:05:03'), - ('139', '746', '2006-02-15T10:05:03'), - ('197', '746', '2006-02-15T10:05:03'), - ('49', '716', '2006-02-15T10:05:03'), - ('10', '716', '2006-02-15T10:05:03'), - ('12', '716', '2006-02-15T10:05:03'), - ('36', '716', '2006-02-15T10:05:03'), - ('100', '714', '2006-02-15T10:05:03'), - ('36', '714', '2006-02-15T10:05:03'), - ('52', '714', '2006-02-15T10:05:03'), - ('182', '714', '2006-02-15T10:05:03'), - ('115', '714', '2006-02-15T10:05:03'), - ('161', '714', '2006-02-15T10:05:03'), - ('57', '714', '2006-02-15T10:05:03'), - ('4', '714', '2006-02-15T10:05:03'), - ('200', '714', '2006-02-15T10:05:03'), - ('65', '714', '2006-02-15T10:05:03'), - ('166', '714', '2006-02-15T10:05:03'), - ('20', '714', '2006-02-15T10:05:03'), - ('45', '714', '2006-02-15T10:05:03'), - ('42', '713', '2006-02-15T10:05:03'), - ('131', '713', '2006-02-15T10:05:03'), - ('59', '713', '2006-02-15T10:05:03'), - ('145', '713', '2006-02-15T10:05:03'), - ('94', '713', '2006-02-15T10:05:03'), - ('157', '713', '2006-02-15T10:05:03'), - ('48', '349', '2006-02-15T10:05:03'), - ('156', '349', '2006-02-15T10:05:03'), - ('169', '349', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('22', '349', '2006-02-15T10:05:03'), - ('6', '53', '2006-02-15T10:05:03'), - ('70', '53', '2006-02-15T10:05:03'), - ('47', '53', '2006-02-15T10:05:03'), - ('149', '53', '2006-02-15T10:05:03'), - ('30', '53', '2006-02-15T10:05:03'), - ('156', '53', '2006-02-15T10:05:03'), - ('102', '53', '2006-02-15T10:05:03'), - ('184', '640', '2006-02-15T10:05:03'), - ('129', '640', '2006-02-15T10:05:03'), - ('199', '640', '2006-02-15T10:05:03'), - ('72', '640', '2006-02-15T10:05:03'), - ('79', '40', '2006-02-15T10:05:03'), - ('77', '40', '2006-02-15T10:05:03'), - ('181', '40', '2006-02-15T10:05:03'), - ('96', '40', '2006-02-15T10:05:03'), - ('3', '40', '2006-02-15T10:05:03'), - ('183', '40', '2006-02-15T10:05:03'), - ('104', '40', '2006-02-15T10:05:03'), - ('73', '245', '2006-02-15T10:05:03'), - ('48', '245', '2006-02-15T10:05:03'), - ('36', '245', '2006-02-15T10:05:03'), - ('95', '245', '2006-02-15T10:05:03'), - ('123', '245', '2006-02-15T10:05:03'), - ('115', '245', '2006-02-15T10:05:03'), - ('25', '245', '2006-02-15T10:05:03'), - ('77', '245', '2006-02-15T10:05:03'), - ('115', '302', '2006-02-15T10:05:03'), - ('108', '302', '2006-02-15T10:05:03'), - ('172', '302', '2006-02-15T10:05:03'), - ('82', '104', '2006-02-15T10:05:03'), - ('92', '104', '2006-02-15T10:05:03'), - ('34', '493', '2006-02-15T10:05:03'), - ('172', '493', '2006-02-15T10:05:03'), - ('60', '493', '2006-02-15T10:05:03'), - ('36', '493', '2006-02-15T10:05:03'), - ('91', '493', '2006-02-15T10:05:03'), - ('41', '203', '2006-02-15T10:05:03'), - ('153', '203', '2006-02-15T10:05:03'), - ('74', '203', '2006-02-15T10:05:03'), - ('52', '203', '2006-02-15T10:05:03'), - ('39', '203', '2006-02-15T10:05:03'), - ('13', '203', '2006-02-15T10:05:03'), - ('5', '203', '2006-02-15T10:05:03'), - ('169', '673', '2006-02-15T10:05:03'), - ('42', '673', '2006-02-15T10:05:03'), - ('141', '673', '2006-02-15T10:05:03'), - ('19', '673', '2006-02-15T10:05:03'), - ('122', '673', '2006-02-15T10:05:03'), - ('164', '673', '2006-02-15T10:05:03'), - ('23', '673', '2006-02-15T10:05:03'), - ('195', '673', '2006-02-15T10:05:03'), - ('108', '673', '2006-02-15T10:05:03'), - ('196', '837', '2006-02-15T10:05:03'), - ('102', '837', '2006-02-15T10:05:03'), - ('55', '790', '2006-02-15T10:05:03'), - ('28', '790', '2006-02-15T10:05:03'), - ('47', '790', '2006-02-15T10:05:03'), - ('53', '268', '2006-02-15T10:05:03'), - ('137', '268', '2006-02-15T10:05:03'), - ('102', '268', '2006-02-15T10:05:03'), - ('81', '268', '2006-02-15T10:05:03'), - ('18', '268', '2006-02-15T10:05:03'), - ('83', '268', '2006-02-15T10:05:03'), - ('118', '151', '2006-02-15T10:05:03'), - ('123', '151', '2006-02-15T10:05:03'), - ('112', '151', '2006-02-15T10:05:03'), - ('49', '151', '2006-02-15T10:05:03'), - ('168', '927', '2006-02-15T10:05:03'), - ('134', '927', '2006-02-15T10:05:03'), - ('161', '927', '2006-02-15T10:05:03'), - ('49', '927', '2006-02-15T10:05:03'), - ('152', '927', '2006-02-15T10:05:03'), - ('37', '966', '2006-02-15T10:05:03'), - ('108', '966', '2006-02-15T10:05:03'), - ('3', '966', '2006-02-15T10:05:03'), - ('115', '966', '2006-02-15T10:05:03'), - ('10', '966', '2006-02-15T10:05:03'), - ('121', '966', '2006-02-15T10:05:03'), - ('13', '966', '2006-02-15T10:05:03'), - ('146', '966', '2006-02-15T10:05:03'), - ('155', '966', '2006-02-15T10:05:03'), - ('184', '966', '2006-02-15T10:05:03'), - ('133', '652', '2006-02-15T10:05:03'), - ('28', '652', '2006-02-15T10:05:03'), - ('168', '652', '2006-02-15T10:05:03'), - ('108', '652', '2006-02-15T10:05:03'), - ('20', '652', '2006-02-15T10:05:03'), - ('1', '140', '2006-02-15T10:05:03'), - ('20', '140', '2006-02-15T10:05:03'), - ('83', '764', '2006-02-15T10:05:03'), - ('26', '764', '2006-02-15T10:05:03'), - ('54', '764', '2006-02-15T10:05:03'), - ('170', '764', '2006-02-15T10:05:03'), - ('14', '764', '2006-02-15T10:05:03'), - ('84', '764', '2006-02-15T10:05:03'), - ('130', '764', '2006-02-15T10:05:03'), - ('177', '764', '2006-02-15T10:05:03'), - ('75', '764', '2006-02-15T10:05:03'), - ('122', '227', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('70', '227', '2006-02-15T10:05:03'), - ('20', '1', '2006-02-15T10:05:03'), - ('108', '1', '2006-02-15T10:05:03'), - ('162', '1', '2006-02-15T10:05:03'), - ('40', '1', '2006-02-15T10:05:03'), - ('198', '1', '2006-02-15T10:05:03'), - ('1', '1', '2006-02-15T10:05:03'), - ('188', '1', '2006-02-15T10:05:03'), - ('10', '1', '2006-02-15T10:05:03'), - ('30', '1', '2006-02-15T10:05:03'), - ('53', '1', '2006-02-15T10:05:03'), - ('129', '202', '2006-02-15T10:05:03'), - ('69', '202', '2006-02-15T10:05:03'), - ('127', '202', '2006-02-15T10:05:03'), - ('70', '202', '2006-02-15T10:05:03'), - ('5', '202', '2006-02-15T10:05:03'), - ('123', '577', '2006-02-15T10:05:03'), - ('53', '577', '2006-02-15T10:05:03'), - ('65', '577', '2006-02-15T10:05:03'), - ('186', '983', '2006-02-15T10:05:03'), - ('10', '983', '2006-02-15T10:05:03'), - ('178', '983', '2006-02-15T10:05:03'), - ('21', '983', '2006-02-15T10:05:03'), - ('183', '983', '2006-02-15T10:05:03'), - ('57', '437', '2006-02-15T10:05:03'), - ('158', '437', '2006-02-15T10:05:03'), - ('182', '437', '2006-02-15T10:05:03'), - ('181', '437', '2006-02-15T10:05:03'), - ('165', '437', '2006-02-15T10:05:03'), - ('97', '437', '2006-02-15T10:05:03'), - ('185', '437', '2006-02-15T10:05:03'), - ('50', '437', '2006-02-15T10:05:03'), - ('103', '437', '2006-02-15T10:05:03'), - ('101', '66', '2006-02-15T10:05:03'), - ('158', '66', '2006-02-15T10:05:03'), - ('45', '66', '2006-02-15T10:05:03'), - ('76', '66', '2006-02-15T10:05:03'), - ('98', '66', '2006-02-15T10:05:03'), - ('131', '66', '2006-02-15T10:05:03'), - ('96', '66', '2006-02-15T10:05:03'), - ('17', '469', '2006-02-15T10:05:03'), - ('106', '469', '2006-02-15T10:05:03'), - ('160', '469', '2006-02-15T10:05:03'), - ('126', '469', '2006-02-15T10:05:03'), - ('164', '469', '2006-02-15T10:05:03'), - ('49', '469', '2006-02-15T10:05:03'), - ('64', '469', '2006-02-15T10:05:03'), - ('161', '469', '2006-02-15T10:05:03'), - ('56', '851', '2006-02-15T10:05:03'), - ('164', '851', '2006-02-15T10:05:03'), - ('193', '851', '2006-02-15T10:05:03'), - ('200', '465', '2006-02-15T10:05:03'), - ('53', '465', '2006-02-15T10:05:03'), - ('81', '465', '2006-02-15T10:05:03'), - ('62', '465', '2006-02-15T10:05:03'), - ('192', '465', '2006-02-15T10:05:03'), - ('62', '295', '2006-02-15T10:05:03'), - ('147', '295', '2006-02-15T10:05:03'), - ('59', '295', '2006-02-15T10:05:03'), - ('48', '295', '2006-02-15T10:05:03'), - ('54', '489', '2006-02-15T10:05:03'), - ('120', '489', '2006-02-15T10:05:03'), - ('154', '489', '2006-02-15T10:05:03'), - ('137', '489', '2006-02-15T10:05:03'), - ('179', '489', '2006-02-15T10:05:03'), - ('33', '489', '2006-02-15T10:05:03'), - ('111', '489', '2006-02-15T10:05:03'), - ('122', '489', '2006-02-15T10:05:03'), - ('139', '489', '2006-02-15T10:05:03'), - ('104', '259', '2006-02-15T10:05:03'), - ('28', '259', '2006-02-15T10:05:03'), - ('162', '41', '2006-02-15T10:05:03'), - ('135', '41', '2006-02-15T10:05:03'), - ('118', '41', '2006-02-15T10:05:03'), - ('120', '149', '2006-02-15T10:05:03'), - ('200', '149', '2006-02-15T10:05:03'), - ('148', '149', '2006-02-15T10:05:03'), - ('24', '515', '2006-02-15T10:05:03'), - ('13', '515', '2006-02-15T10:05:03'), - ('131', '515', '2006-02-15T10:05:03'), - ('52', '515', '2006-02-15T10:05:03'), - ('196', '515', '2006-02-15T10:05:03'), - ('17', '515', '2006-02-15T10:05:03'), - ('50', '401', '2006-02-15T10:05:03'), - ('177', '401', '2006-02-15T10:05:03'), - ('161', '401', '2006-02-15T10:05:03'), - ('104', '401', '2006-02-15T10:05:03'), - ('176', '401', '2006-02-15T10:05:03'), - ('32', '401', '2006-02-15T10:05:03'), - ('136', '401', '2006-02-15T10:05:03'), - ('2', '518', '2006-02-15T10:05:03'), - ('185', '518', '2006-02-15T10:05:03'), - ('97', '518', '2006-02-15T10:05:03'), - ('156', '518', '2006-02-15T10:05:03'), - ('53', '518', '2006-02-15T10:05:03'), - ('61', '518', '2006-02-15T10:05:03'), - ('2', '561', '2006-02-15T10:05:03'), - ('97', '561', '2006-02-15T10:05:03'), - ('108', '561', '2006-02-15T10:05:03'), - ('138', '561', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('82', '561', '2006-02-15T10:05:03'), - ('159', '561', '2006-02-15T10:05:03'), - ('187', '561', '2006-02-15T10:05:03'), - ('105', '561', '2006-02-15T10:05:03'), - ('180', '561', '2006-02-15T10:05:03'), - ('73', '561', '2006-02-15T10:05:03'), - ('18', '561', '2006-02-15T10:05:03'), - ('53', '386', '2006-02-15T10:05:03'), - ('68', '386', '2006-02-15T10:05:03'), - ('150', '386', '2006-02-15T10:05:03'), - ('18', '386', '2006-02-15T10:05:03'), - ('143', '386', '2006-02-15T10:05:03'), - ('134', '386', '2006-02-15T10:05:03'), - ('58', '602', '2006-02-15T10:05:03'), - ('88', '602', '2006-02-15T10:05:03'), - ('139', '602', '2006-02-15T10:05:03'), - ('129', '602', '2006-02-15T10:05:03'), - ('125', '602', '2006-02-15T10:05:03'), - ('154', '602', '2006-02-15T10:05:03'), - ('168', '602', '2006-02-15T10:05:03'), - ('53', '285', '2006-02-15T10:05:03'), - ('103', '285', '2006-02-15T10:05:03'), - ('150', '285', '2006-02-15T10:05:03'), - ('156', '285', '2006-02-15T10:05:03'), - ('54', '285', '2006-02-15T10:05:03'), - ('74', '28', '2006-02-15T10:05:03'), - ('162', '28', '2006-02-15T10:05:03'), - ('149', '811', '2006-02-15T10:05:03'), - ('179', '811', '2006-02-15T10:05:03'), - ('78', '811', '2006-02-15T10:05:03'), - ('2', '811', '2006-02-15T10:05:03'), - ('9', '811', '2006-02-15T10:05:03'), - ('5', '811', '2006-02-15T10:05:03'), - ('49', '811', '2006-02-15T10:05:03'), - ('180', '811', '2006-02-15T10:05:03'), - ('108', '702', '2006-02-15T10:05:03'), - ('21', '702', '2006-02-15T10:05:03'), - ('101', '702', '2006-02-15T10:05:03'), - ('130', '702', '2006-02-15T10:05:03'), - ('59', '702', '2006-02-15T10:05:03'), - ('140', '702', '2006-02-15T10:05:03'), - ('144', '702', '2006-02-15T10:05:03'), - ('142', '759', '2006-02-15T10:05:03'), - ('14', '759', '2006-02-15T10:05:03'), - ('128', '759', '2006-02-15T10:05:03'), - ('100', '759', '2006-02-15T10:05:03'), - ('10', '694', '2006-02-15T10:05:03'), - ('77', '694', '2006-02-15T10:05:03'), - ('109', '694', '2006-02-15T10:05:03'), - ('185', '694', '2006-02-15T10:05:03'), - ('64', '694', '2006-02-15T10:05:03'), - ('169', '694', '2006-02-15T10:05:03'), - ('33', '694', '2006-02-15T10:05:03'), - ('65', '694', '2006-02-15T10:05:03'), - ('59', '694', '2006-02-15T10:05:03'), - ('37', '694', '2006-02-15T10:05:03'), - ('43', '344', '2006-02-15T10:05:03'), - ('159', '344', '2006-02-15T10:05:03'), - ('82', '344', '2006-02-15T10:05:03'), - ('12', '344', '2006-02-15T10:05:03'), - ('139', '266', '2006-02-15T10:05:03'), - ('123', '266', '2006-02-15T10:05:03'), - ('189', '266', '2006-02-15T10:05:03'), - ('89', '266', '2006-02-15T10:05:03'), - ('19', '266', '2006-02-15T10:05:03'), - ('19', '490', '2006-02-15T10:05:03'), - ('53', '490', '2006-02-15T10:05:03'), - ('99', '490', '2006-02-15T10:05:03'), - ('51', '490', '2006-02-15T10:05:03'), - ('44', '490', '2006-02-15T10:05:03'), - ('4', '490', '2006-02-15T10:05:03'), - ('154', '440', '2006-02-15T10:05:03'), - ('160', '883', '2006-02-15T10:05:03'), - ('18', '883', '2006-02-15T10:05:03'), - ('44', '883', '2006-02-15T10:05:03'), - ('48', '287', '2006-02-15T10:05:03'), - ('104', '287', '2006-02-15T10:05:03'), - ('28', '287', '2006-02-15T10:05:03'), - ('16', '287', '2006-02-15T10:05:03'), - ('199', '953', '2006-02-15T10:05:03'), - ('144', '953', '2006-02-15T10:05:03'), - ('145', '953', '2006-02-15T10:05:03'), - ('127', '953', '2006-02-15T10:05:03'), - ('171', '953', '2006-02-15T10:05:03'), - ('150', '953', '2006-02-15T10:05:03'), - ('70', '953', '2006-02-15T10:05:03'), - ('28', '953', '2006-02-15T10:05:03'), - ('193', '953', '2006-02-15T10:05:03'), - ('85', '383', '2006-02-15T10:05:03'), - ('131', '383', '2006-02-15T10:05:03'), - ('115', '383', '2006-02-15T10:05:03'), - ('41', '383', '2006-02-15T10:05:03'), - ('56', '383', '2006-02-15T10:05:03'), - ('5', '383', '2006-02-15T10:05:03'), - ('155', '383', '2006-02-15T10:05:03'), - ('50', '717', '2006-02-15T10:05:03'), - ('120', '717', '2006-02-15T10:05:03'), - ('88', '717', '2006-02-15T10:05:03'), - ('57', '717', '2006-02-15T10:05:03'), - ('167', '717', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('18', '717', '2006-02-15T10:05:03'), - ('20', '717', '2006-02-15T10:05:03'), - ('16', '717', '2006-02-15T10:05:03'), - ('50', '327', '2006-02-15T10:05:03'), - ('26', '327', '2006-02-15T10:05:03'), - ('27', '359', '2006-02-15T10:05:03'), - ('43', '359', '2006-02-15T10:05:03'), - ('111', '359', '2006-02-15T10:05:03'), - ('195', '359', '2006-02-15T10:05:03'), - ('155', '359', '2006-02-15T10:05:03'), - ('71', '359', '2006-02-15T10:05:03'), - ('114', '237', '2006-02-15T10:05:03'), - ('186', '237', '2006-02-15T10:05:03'), - ('168', '237', '2006-02-15T10:05:03'), - ('177', '237', '2006-02-15T10:05:03'), - ('61', '237', '2006-02-15T10:05:03'), - ('72', '237', '2006-02-15T10:05:03'), - ('99', '325', '2006-02-15T10:05:03'), - ('68', '325', '2006-02-15T10:05:03'), - ('72', '325', '2006-02-15T10:05:03'), - ('93', '325', '2006-02-15T10:05:03'), - ('111', '325', '2006-02-15T10:05:03'), - ('3', '971', '2006-02-15T10:05:03'), - ('60', '971', '2006-02-15T10:05:03'), - ('68', '971', '2006-02-15T10:05:03'), - ('34', '971', '2006-02-15T10:05:03'), - ('191', '971', '2006-02-15T10:05:03'), - ('129', '391', '2006-02-15T10:05:03'), - ('49', '391', '2006-02-15T10:05:03'), - ('90', '391', '2006-02-15T10:05:03'), - ('182', '391', '2006-02-15T10:05:03'), - ('115', '391', '2006-02-15T10:05:03'), - ('86', '391', '2006-02-15T10:05:03'), - ('8', '263', '2006-02-15T10:05:03'), - ('126', '263', '2006-02-15T10:05:03'), - ('83', '263', '2006-02-15T10:05:03'), - ('28', '263', '2006-02-15T10:05:03'), - ('74', '263', '2006-02-15T10:05:03'), - ('156', '263', '2006-02-15T10:05:03'), - ('124', '263', '2006-02-15T10:05:03'), - ('137', '263', '2006-02-15T10:05:03'), - ('101', '263', '2006-02-15T10:05:03'), - ('67', '57', '2006-02-15T10:05:03'), - ('130', '57', '2006-02-15T10:05:03'), - ('172', '57', '2006-02-15T10:05:03'), - ('148', '57', '2006-02-15T10:05:03'), - ('139', '57', '2006-02-15T10:05:03'), - ('120', '57', '2006-02-15T10:05:03'), - ('117', '785', '2006-02-15T10:05:03'), - ('163', '785', '2006-02-15T10:05:03'), - ('155', '785', '2006-02-15T10:05:03'), - ('37', '785', '2006-02-15T10:05:03'), - ('19', '785', '2006-02-15T10:05:03'), - ('144', '785', '2006-02-15T10:05:03'), - ('88', '785', '2006-02-15T10:05:03'), - ('199', '785', '2006-02-15T10:05:03'), - ('109', '785', '2006-02-15T10:05:03'), - ('124', '785', '2006-02-15T10:05:03'), - ('59', '130', '2006-02-15T10:05:03'), - ('195', '130', '2006-02-15T10:05:03'), - ('144', '130', '2006-02-15T10:05:03'), - ('103', '130', '2006-02-15T10:05:03'), - ('19', '750', '2006-02-15T10:05:03'), - ('82', '750', '2006-02-15T10:05:03'), - ('79', '750', '2006-02-15T10:05:03'), - ('105', '750', '2006-02-15T10:05:03'), - ('56', '750', '2006-02-15T10:05:03'), - ('51', '750', '2006-02-15T10:05:03'), - ('59', '46', '2006-02-15T10:05:03'), - ('65', '46', '2006-02-15T10:05:03'), - ('84', '46', '2006-02-15T10:05:03'), - ('130', '375', '2006-02-15T10:05:03'), - ('5', '375', '2006-02-15T10:05:03'), - ('62', '375', '2006-02-15T10:05:03'), - ('165', '375', '2006-02-15T10:05:03'), - ('95', '375', '2006-02-15T10:05:03'), - ('107', '548', '2006-02-15T10:05:03'), - ('189', '548', '2006-02-15T10:05:03'), - ('187', '548', '2006-02-15T10:05:03'), - ('94', '548', '2006-02-15T10:05:03'), - ('73', '548', '2006-02-15T10:05:03'), - ('86', '548', '2006-02-15T10:05:03'), - ('16', '548', '2006-02-15T10:05:03'), - ('120', '911', '2006-02-15T10:05:03'), - ('82', '911', '2006-02-15T10:05:03'), - ('127', '911', '2006-02-15T10:05:03'), - ('181', '911', '2006-02-15T10:05:03'), - ('46', '567', '2006-02-15T10:05:03'), - ('119', '567', '2006-02-15T10:05:03'), - ('172', '567', '2006-02-15T10:05:03'), - ('108', '567', '2006-02-15T10:05:03'), - ('32', '567', '2006-02-15T10:05:03'), - ('11', '567', '2006-02-15T10:05:03'), - ('138', '627', '2006-02-15T10:05:03'), - ('153', '627', '2006-02-15T10:05:03'), - ('95', '627', '2006-02-15T10:05:03'), - ('73', '627', '2006-02-15T10:05:03'), - ('51', '627', '2006-02-15T10:05:03'), - ('151', '482', '2006-02-15T10:05:03'), - ('198', '482', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('186', '482', '2006-02-15T10:05:03'), - ('86', '482', '2006-02-15T10:05:03'), - ('29', '482', '2006-02-15T10:05:03'), - ('153', '476', '2006-02-15T10:05:03'), - ('50', '476', '2006-02-15T10:05:03'), - ('39', '476', '2006-02-15T10:05:03'), - ('65', '476', '2006-02-15T10:05:03'), - ('152', '476', '2006-02-15T10:05:03'), - ('143', '404', '2006-02-15T10:05:03'), - ('19', '404', '2006-02-15T10:05:03'), - ('25', '404', '2006-02-15T10:05:03'), - ('187', '906', '2006-02-15T10:05:03'), - ('143', '906', '2006-02-15T10:05:03'), - ('196', '906', '2006-02-15T10:05:03'), - ('105', '906', '2006-02-15T10:05:03'), - ('142', '906', '2006-02-15T10:05:03'), - ('26', '906', '2006-02-15T10:05:03'), - ('91', '859', '2006-02-15T10:05:03'), - ('176', '859', '2006-02-15T10:05:03'), - ('142', '859', '2006-02-15T10:05:03'), - ('8', '859', '2006-02-15T10:05:03'), - ('107', '859', '2006-02-15T10:05:03'), - ('113', '674', '2006-02-15T10:05:03'), - ('159', '674', '2006-02-15T10:05:03'), - ('41', '674', '2006-02-15T10:05:03'), - ('166', '674', '2006-02-15T10:05:03'), - ('78', '674', '2006-02-15T10:05:03'), - ('152', '674', '2006-02-15T10:05:03'), - ('192', '674', '2006-02-15T10:05:03'), - ('142', '10', '2006-02-15T10:05:03'), - ('35', '10', '2006-02-15T10:05:03'), - ('29', '10', '2006-02-15T10:05:03'), - ('64', '10', '2006-02-15T10:05:03'), - ('117', '10', '2006-02-15T10:05:03'), - ('37', '10', '2006-02-15T10:05:03'), - ('157', '10', '2006-02-15T10:05:03'), - ('188', '10', '2006-02-15T10:05:03'), - ('142', '481', '2006-02-15T10:05:03'), - ('2', '481', '2006-02-15T10:05:03'), - ('116', '481', '2006-02-15T10:05:03'), - ('119', '418', '2006-02-15T10:05:03'), - ('59', '418', '2006-02-15T10:05:03'), - ('102', '418', '2006-02-15T10:05:03'), - ('22', '418', '2006-02-15T10:05:03'), - ('129', '418', '2006-02-15T10:05:03'), - ('159', '418', '2006-02-15T10:05:03'), - ('14', '418', '2006-02-15T10:05:03'), - ('197', '418', '2006-02-15T10:05:03'), - ('122', '300', '2006-02-15T10:05:03'), - ('66', '300', '2006-02-15T10:05:03'), - ('136', '300', '2006-02-15T10:05:03'), - ('69', '300', '2006-02-15T10:05:03'), - ('34', '836', '2006-02-15T10:05:03'), - ('126', '836', '2006-02-15T10:05:03'), - ('181', '836', '2006-02-15T10:05:03'), - ('46', '836', '2006-02-15T10:05:03'), - ('74', '836', '2006-02-15T10:05:03'), - ('33', '881', '2006-02-15T10:05:03'), - ('88', '881', '2006-02-15T10:05:03'), - ('106', '881', '2006-02-15T10:05:03'), - ('131', '881', '2006-02-15T10:05:03'), - ('163', '881', '2006-02-15T10:05:03'), - ('152', '611', '2006-02-15T10:05:03'), - ('135', '455', '2006-02-15T10:05:03'), - ('160', '455', '2006-02-15T10:05:03'), - ('16', '455', '2006-02-15T10:05:03'), - ('89', '542', '2006-02-15T10:05:03'), - ('90', '542', '2006-02-15T10:05:03'), - ('150', '542', '2006-02-15T10:05:03'), - ('181', '542', '2006-02-15T10:05:03'), - ('122', '542', '2006-02-15T10:05:03'), - ('136', '542', '2006-02-15T10:05:03'), - ('49', '542', '2006-02-15T10:05:03'), - ('40', '933', '2006-02-15T10:05:03'), - ('97', '933', '2006-02-15T10:05:03'), - ('133', '933', '2006-02-15T10:05:03'), - ('173', '933', '2006-02-15T10:05:03'), - ('136', '933', '2006-02-15T10:05:03'), - ('57', '918', '2006-02-15T10:05:03'), - ('71', '918', '2006-02-15T10:05:03'), - ('50', '918', '2006-02-15T10:05:03'), - ('112', '37', '2006-02-15T10:05:03'), - ('12', '37', '2006-02-15T10:05:03'), - ('64', '37', '2006-02-15T10:05:03'), - ('130', '37', '2006-02-15T10:05:03'), - ('64', '569', '2006-02-15T10:05:03'), - ('36', '569', '2006-02-15T10:05:03'), - ('92', '712', '2006-02-15T10:05:03'), - ('4', '712', '2006-02-15T10:05:03'), - ('94', '712', '2006-02-15T10:05:03'), - ('102', '712', '2006-02-15T10:05:03'), - ('33', '712', '2006-02-15T10:05:03'), - ('142', '712', '2006-02-15T10:05:03'), - ('29', '273', '2006-02-15T10:05:03'), - ('47', '273', '2006-02-15T10:05:03'), - ('27', '273', '2006-02-15T10:05:03'), - ('44', '273', '2006-02-15T10:05:03'), - ('117', '273', '2006-02-15T10:05:03'), - ('171', '273', '2006-02-15T10:05:03'), - ('178', '273', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('115', '671', '2006-02-15T10:05:03'), - ('187', '671', '2006-02-15T10:05:03'), - ('128', '671', '2006-02-15T10:05:03'), - ('68', '671', '2006-02-15T10:05:03'), - ('9', '671', '2006-02-15T10:05:03'), - ('11', '281', '2006-02-15T10:05:03'), - ('109', '281', '2006-02-15T10:05:03'), - ('83', '281', '2006-02-15T10:05:03'), - ('161', '281', '2006-02-15T10:05:03'), - ('21', '281', '2006-02-15T10:05:03'), - ('84', '281', '2006-02-15T10:05:03'), - ('105', '910', '2006-02-15T10:05:03'), - ('81', '910', '2006-02-15T10:05:03'), - ('129', '910', '2006-02-15T10:05:03'), - ('7', '910', '2006-02-15T10:05:03'), - ('177', '910', '2006-02-15T10:05:03'), - ('77', '538', '2006-02-15T10:05:03'), - ('20', '538', '2006-02-15T10:05:03'), - ('46', '538', '2006-02-15T10:05:03'), - ('132', '538', '2006-02-15T10:05:03'), - ('114', '538', '2006-02-15T10:05:03'), - ('200', '538', '2006-02-15T10:05:03'), - ('187', '538', '2006-02-15T10:05:03'), - ('25', '538', '2006-02-15T10:05:03'), - ('172', '538', '2006-02-15T10:05:03'), - ('99', '84', '2006-02-15T10:05:03'), - ('18', '84', '2006-02-15T10:05:03'), - ('199', '84', '2006-02-15T10:05:03'), - ('32', '84', '2006-02-15T10:05:03'), - ('113', '84', '2006-02-15T10:05:03'), - ('54', '84', '2006-02-15T10:05:03'), - ('44', '84', '2006-02-15T10:05:03'), - ('191', '84', '2006-02-15T10:05:03'), - ('121', '297', '2006-02-15T10:05:03'), - ('166', '297', '2006-02-15T10:05:03'), - ('187', '297', '2006-02-15T10:05:03'), - ('98', '297', '2006-02-15T10:05:03'), - ('85', '297', '2006-02-15T10:05:03'), - ('60', '297', '2006-02-15T10:05:03'), - ('156', '297', '2006-02-15T10:05:03'), - ('53', '256', '2006-02-15T10:05:03'), - ('35', '256', '2006-02-15T10:05:03'), - ('67', '256', '2006-02-15T10:05:03'), - ('6', '256', '2006-02-15T10:05:03'), - ('24', '256', '2006-02-15T10:05:03'), - ('126', '256', '2006-02-15T10:05:03'), - ('136', '256', '2006-02-15T10:05:03'), - ('97', '256', '2006-02-15T10:05:03'), - ('27', '695', '2006-02-15T10:05:03'), - ('182', '695', '2006-02-15T10:05:03'), - ('138', '695', '2006-02-15T10:05:03'), - ('118', '695', '2006-02-15T10:05:03'), - ('190', '695', '2006-02-15T10:05:03'), - ('37', '467', '2006-02-15T10:05:03'), - ('141', '467', '2006-02-15T10:05:03'), - ('73', '467', '2006-02-15T10:05:03'), - ('107', '467', '2006-02-15T10:05:03'), - ('45', '467', '2006-02-15T10:05:03'), - ('154', '467', '2006-02-15T10:05:03'), - ('156', '467', '2006-02-15T10:05:03'), - ('21', '426', '2006-02-15T10:05:03'), - ('58', '426', '2006-02-15T10:05:03'), - ('166', '426', '2006-02-15T10:05:03'), - ('192', '426', '2006-02-15T10:05:03'), - ('190', '426', '2006-02-15T10:05:03'), - ('36', '426', '2006-02-15T10:05:03'), - ('14', '472', '2006-02-15T10:05:03'), - ('190', '472', '2006-02-15T10:05:03'), - ('58', '856', '2006-02-15T10:05:03'), - ('112', '856', '2006-02-15T10:05:03'), - ('70', '856', '2006-02-15T10:05:03'), - ('93', '856', '2006-02-15T10:05:03'), - ('167', '856', '2006-02-15T10:05:03'), - ('14', '856', '2006-02-15T10:05:03'), - ('23', '856', '2006-02-15T10:05:03'), - ('5', '288', '2006-02-15T10:05:03'), - ('126', '288', '2006-02-15T10:05:03'), - ('50', '288', '2006-02-15T10:05:03'), - ('136', '288', '2006-02-15T10:05:03'), - ('154', '954', '2006-02-15T10:05:03'), - ('169', '954', '2006-02-15T10:05:03'), - ('160', '954', '2006-02-15T10:05:03'), - ('82', '954', '2006-02-15T10:05:03'), - ('105', '954', '2006-02-15T10:05:03'), - ('83', '833', '2006-02-15T10:05:03'), - ('43', '833', '2006-02-15T10:05:03'), - ('13', '833', '2006-02-15T10:05:03'), - ('163', '833', '2006-02-15T10:05:03'), - ('165', '833', '2006-02-15T10:05:03'), - ('196', '833', '2006-02-15T10:05:03'), - ('89', '833', '2006-02-15T10:05:03'), - ('172', '833', '2006-02-15T10:05:03'), - ('23', '833', '2006-02-15T10:05:03'), - ('71', '833', '2006-02-15T10:05:03'), - ('98', '990', '2006-02-15T10:05:03'), - ('182', '990', '2006-02-15T10:05:03'), - ('54', '990', '2006-02-15T10:05:03'), - ('61', '990', '2006-02-15T10:05:03'), - ('158', '990', '2006-02-15T10:05:03'), - ('105', '990', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('62', '990', '2006-02-15T10:05:03'), - ('51', '990', '2006-02-15T10:05:03'), - ('103', '942', '2006-02-15T10:05:03'), - ('41', '942', '2006-02-15T10:05:03'), - ('72', '854', '2006-02-15T10:05:03'), - ('27', '854', '2006-02-15T10:05:03'), - ('44', '854', '2006-02-15T10:05:03'), - ('150', '854', '2006-02-15T10:05:03'), - ('11', '854', '2006-02-15T10:05:03'), - ('83', '631', '2006-02-15T10:05:03'), - ('86', '631', '2006-02-15T10:05:03'), - ('12', '631', '2006-02-15T10:05:03'), - ('149', '631', '2006-02-15T10:05:03'), - ('102', '631', '2006-02-15T10:05:03'), - ('185', '631', '2006-02-15T10:05:03'), - ('198', '125', '2006-02-15T10:05:03'), - ('144', '125', '2006-02-15T10:05:03'), - ('138', '125', '2006-02-15T10:05:03'), - ('15', '125', '2006-02-15T10:05:03'), - ('34', '125', '2006-02-15T10:05:03'), - ('65', '125', '2006-02-15T10:05:03'), - ('23', '125', '2006-02-15T10:05:03'), - ('178', '30', '2006-02-15T10:05:03'), - ('163', '30', '2006-02-15T10:05:03'), - ('9', '30', '2006-02-15T10:05:03'), - ('28', '816', '2006-02-15T10:05:03'), - ('181', '816', '2006-02-15T10:05:03'), - ('13', '816', '2006-02-15T10:05:03'), - ('33', '135', '2006-02-15T10:05:03'), - ('194', '135', '2006-02-15T10:05:03'), - ('140', '135', '2006-02-15T10:05:03'), - ('83', '135', '2006-02-15T10:05:03'), - ('144', '135', '2006-02-15T10:05:03'), - ('58', '135', '2006-02-15T10:05:03'), - ('187', '474', '2006-02-15T10:05:03'), - ('111', '474', '2006-02-15T10:05:03'), - ('200', '474', '2006-02-15T10:05:03'), - ('76', '474', '2006-02-15T10:05:03'), - ('56', '474', '2006-02-15T10:05:03'), - ('136', '474', '2006-02-15T10:05:03'), - ('52', '474', '2006-02-15T10:05:03'), - ('154', '474', '2006-02-15T10:05:03'), - ('37', '485', '2006-02-15T10:05:03'), - ('102', '485', '2006-02-15T10:05:03'), - ('128', '485', '2006-02-15T10:05:03'), - ('2', '485', '2006-02-15T10:05:03'), - ('11', '485', '2006-02-15T10:05:03'), - ('192', '485', '2006-02-15T10:05:03'), - ('136', '485', '2006-02-15T10:05:03'), - ('143', '485', '2006-02-15T10:05:03'), - ('55', '485', '2006-02-15T10:05:03'), - ('70', '50', '2006-02-15T10:05:03'), - ('78', '552', '2006-02-15T10:05:03'), - ('9', '552', '2006-02-15T10:05:03'), - ('186', '552', '2006-02-15T10:05:03'), - ('136', '552', '2006-02-15T10:05:03'), - ('50', '552', '2006-02-15T10:05:03'), - ('86', '216', '2006-02-15T10:05:03'), - ('199', '216', '2006-02-15T10:05:03'), - ('12', '216', '2006-02-15T10:05:03'), - ('144', '216', '2006-02-15T10:05:03'), - ('85', '216', '2006-02-15T10:05:03'), - ('115', '246', '2006-02-15T10:05:03'), - ('124', '246', '2006-02-15T10:05:03'), - ('169', '246', '2006-02-15T10:05:03'), - ('123', '246', '2006-02-15T10:05:03'), - ('117', '246', '2006-02-15T10:05:03'), - ('55', '403', '2006-02-15T10:05:03'), - ('181', '403', '2006-02-15T10:05:03'), - ('113', '403', '2006-02-15T10:05:03'), - ('138', '403', '2006-02-15T10:05:03'), - ('195', '403', '2006-02-15T10:05:03'), - ('111', '403', '2006-02-15T10:05:03'), - ('7', '173', '2006-02-15T10:05:03'), - ('119', '173', '2006-02-15T10:05:03'), - ('190', '173', '2006-02-15T10:05:03'), - ('112', '173', '2006-02-15T10:05:03'), - ('188', '773', '2006-02-15T10:05:03'), - ('71', '773', '2006-02-15T10:05:03'), - ('72', '773', '2006-02-15T10:05:03'), - ('16', '503', '2006-02-15T10:05:03'), - ('123', '503', '2006-02-15T10:05:03'), - ('74', '503', '2006-02-15T10:05:03'), - ('27', '503', '2006-02-15T10:05:03'), - ('82', '503', '2006-02-15T10:05:03'), - ('5', '503', '2006-02-15T10:05:03'), - ('6', '503', '2006-02-15T10:05:03'), - ('45', '503', '2006-02-15T10:05:03'), - ('198', '309', '2006-02-15T10:05:03'), - ('42', '309', '2006-02-15T10:05:03'), - ('104', '309', '2006-02-15T10:05:03'), - ('32', '309', '2006-02-15T10:05:03'), - ('66', '928', '2006-02-15T10:05:03'), - ('29', '928', '2006-02-15T10:05:03'), - ('11', '928', '2006-02-15T10:05:03'), - ('173', '928', '2006-02-15T10:05:03'), - ('32', '928', '2006-02-15T10:05:03'), - ('101', '928', '2006-02-15T10:05:03'), - ('60', '928', '2006-02-15T10:05:03'), - ('68', '315', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('48', '315', '2006-02-15T10:05:03'), - ('189', '315', '2006-02-15T10:05:03'), - ('103', '315', '2006-02-15T10:05:03'), - ('105', '315', '2006-02-15T10:05:03'), - ('184', '684', '2006-02-15T10:05:03'), - ('129', '684', '2006-02-15T10:05:03'), - ('196', '684', '2006-02-15T10:05:03'), - ('177', '684', '2006-02-15T10:05:03'), - ('161', '684', '2006-02-15T10:05:03'), - ('148', '422', '2006-02-15T10:05:03'), - ('186', '422', '2006-02-15T10:05:03'), - ('169', '93', '2006-02-15T10:05:03'), - ('26', '93', '2006-02-15T10:05:03'), - ('94', '354', '2006-02-15T10:05:03'), - ('187', '354', '2006-02-15T10:05:03'), - ('127', '354', '2006-02-15T10:05:03'), - ('56', '354', '2006-02-15T10:05:03'), - ('149', '354', '2006-02-15T10:05:03'), - ('3', '996', '2006-02-15T10:05:03'), - ('163', '996', '2006-02-15T10:05:03'), - ('84', '996', '2006-02-15T10:05:03'), - ('170', '996', '2006-02-15T10:05:03'), - ('27', '996', '2006-02-15T10:05:03'), - ('85', '711', '2006-02-15T10:05:03'), - ('19', '711', '2006-02-15T10:05:03'), - ('192', '711', '2006-02-15T10:05:03'), - ('64', '124', '2006-02-15T10:05:03'), - ('17', '124', '2006-02-15T10:05:03'), - ('102', '124', '2006-02-15T10:05:03'), - ('80', '124', '2006-02-15T10:05:03'), - ('93', '124', '2006-02-15T10:05:03'), - ('159', '206', '2006-02-15T10:05:03'), - ('94', '206', '2006-02-15T10:05:03'), - ('188', '206', '2006-02-15T10:05:03'), - ('150', '206', '2006-02-15T10:05:03'), - ('103', '206', '2006-02-15T10:05:03'), - ('131', '206', '2006-02-15T10:05:03'), - ('3', '453', '2006-02-15T10:05:03'), - ('82', '453', '2006-02-15T10:05:03'), - ('130', '453', '2006-02-15T10:05:03'), - ('70', '453', '2006-02-15T10:05:03'), - ('81', '453', '2006-02-15T10:05:03'), - ('36', '453', '2006-02-15T10:05:03'), - ('11', '453', '2006-02-15T10:05:03'), - ('138', '453', '2006-02-15T10:05:03'), - ('93', '453', '2006-02-15T10:05:03'), - ('16', '453', '2006-02-15T10:05:03'), - ('92', '453', '2006-02-15T10:05:03'), - ('162', '279', '2006-02-15T10:05:03'), - ('18', '279', '2006-02-15T10:05:03'), - ('83', '279', '2006-02-15T10:05:03'), - ('95', '748', '2006-02-15T10:05:03'), - ('189', '748', '2006-02-15T10:05:03'), - ('35', '748', '2006-02-15T10:05:03'), - ('145', '748', '2006-02-15T10:05:03'), - ('73', '748', '2006-02-15T10:05:03'), - ('113', '748', '2006-02-15T10:05:03'), - ('178', '1000', '2006-02-15T10:05:03'), - ('155', '1000', '2006-02-15T10:05:03'), - ('166', '1000', '2006-02-15T10:05:03'), - ('63', '893', '2006-02-15T10:05:03'), - ('21', '893', '2006-02-15T10:05:03'), - ('82', '893', '2006-02-15T10:05:03'), - ('105', '893', '2006-02-15T10:05:03'), - ('86', '893', '2006-02-15T10:05:03'), - ('145', '893', '2006-02-15T10:05:03'), - ('56', '893', '2006-02-15T10:05:03'), - ('125', '428', '2006-02-15T10:05:03'), - ('62', '428', '2006-02-15T10:05:03'), - ('19', '428', '2006-02-15T10:05:03'), - ('78', '428', '2006-02-15T10:05:03'), - ('115', '428', '2006-02-15T10:05:03'), - ('94', '428', '2006-02-15T10:05:03'), - ('48', '428', '2006-02-15T10:05:03'), - ('79', '428', '2006-02-15T10:05:03'), - ('14', '970', '2006-02-15T10:05:03'), - ('54', '970', '2006-02-15T10:05:03'), - ('138', '970', '2006-02-15T10:05:03'), - ('1', '970', '2006-02-15T10:05:03'), - ('89', '970', '2006-02-15T10:05:03'), - ('127', '970', '2006-02-15T10:05:03'), - ('26', '544', '2006-02-15T10:05:03'), - ('102', '544', '2006-02-15T10:05:03'), - ('41', '544', '2006-02-15T10:05:03'), - ('200', '544', '2006-02-15T10:05:03'), - ('191', '544', '2006-02-15T10:05:03'), - ('125', '238', '2006-02-15T10:05:03'), - ('120', '238', '2006-02-15T10:05:03'), - ('176', '238', '2006-02-15T10:05:03'), - ('84', '238', '2006-02-15T10:05:03'), - ('122', '238', '2006-02-15T10:05:03'), - ('128', '238', '2006-02-15T10:05:03'), - ('35', '589', '2006-02-15T10:05:03'), - ('20', '589', '2006-02-15T10:05:03'), - ('123', '589', '2006-02-15T10:05:03'), - ('84', '589', '2006-02-15T10:05:03'), - ('141', '589', '2006-02-15T10:05:03'), - ('194', '498', '2006-02-15T10:05:03'), - ('75', '498', '2006-02-15T10:05:03'), - ('140', '498', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('76', '498', '2006-02-15T10:05:03'), - ('95', '498', '2006-02-15T10:05:03'), - ('190', '62', '2006-02-15T10:05:03'), - ('110', '62', '2006-02-15T10:05:03'), - ('125', '62', '2006-02-15T10:05:03'), - ('107', '62', '2006-02-15T10:05:03'), - ('4', '62', '2006-02-15T10:05:03'), - ('2', '145', '2006-02-15T10:05:03'), - ('199', '145', '2006-02-15T10:05:03'), - ('134', '145', '2006-02-15T10:05:03'), - ('147', '145', '2006-02-15T10:05:03'), - ('74', '192', '2006-02-15T10:05:03'), - ('57', '192', '2006-02-15T10:05:03'), - ('74', '537', '2006-02-15T10:05:03'), - ('200', '537', '2006-02-15T10:05:03'), - ('14', '537', '2006-02-15T10:05:03'), - ('61', '537', '2006-02-15T10:05:03'), - ('178', '537', '2006-02-15T10:05:03'), - ('45', '537', '2006-02-15T10:05:03'), - ('170', '537', '2006-02-15T10:05:03'), - ('123', '286', '2006-02-15T10:05:03'), - ('127', '286', '2006-02-15T10:05:03'), - ('30', '286', '2006-02-15T10:05:03'), - ('165', '286', '2006-02-15T10:05:03'), - ('5', '286', '2006-02-15T10:05:03'), - ('72', '286', '2006-02-15T10:05:03'), - ('185', '286', '2006-02-15T10:05:03'), - ('133', '286', '2006-02-15T10:05:03'), - ('181', '286', '2006-02-15T10:05:03'), - ('162', '33', '2006-02-15T10:05:03'), - ('79', '33', '2006-02-15T10:05:03'), - ('136', '33', '2006-02-15T10:05:03'), - ('180', '33', '2006-02-15T10:05:03'), - ('146', '33', '2006-02-15T10:05:03'), - ('182', '33', '2006-02-15T10:05:03'), - ('170', '33', '2006-02-15T10:05:03'), - ('82', '33', '2006-02-15T10:05:03'), - ('170', '180', '2006-02-15T10:05:03'), - ('43', '180', '2006-02-15T10:05:03'), - ('153', '180', '2006-02-15T10:05:03'), - ('163', '180', '2006-02-15T10:05:03'), - ('158', '968', '2006-02-15T10:05:03'), - ('162', '968', '2006-02-15T10:05:03'), - ('88', '968', '2006-02-15T10:05:03'), - ('152', '968', '2006-02-15T10:05:03'), - ('96', '968', '2006-02-15T10:05:03'), - ('15', '968', '2006-02-15T10:05:03'), - ('78', '968', '2006-02-15T10:05:03'), - ('178', '197', '2006-02-15T10:05:03'), - ('32', '197', '2006-02-15T10:05:03'), - ('146', '197', '2006-02-15T10:05:03'), - ('97', '197', '2006-02-15T10:05:03'), - ('64', '197', '2006-02-15T10:05:03'), - ('117', '197', '2006-02-15T10:05:03'), - ('55', '197', '2006-02-15T10:05:03'), - ('103', '197', '2006-02-15T10:05:03'), - ('90', '197', '2006-02-15T10:05:03'), - ('91', '849', '2006-02-15T10:05:03'), - ('169', '849', '2006-02-15T10:05:03'), - ('141', '849', '2006-02-15T10:05:03'), - ('191', '849', '2006-02-15T10:05:03'), - ('155', '849', '2006-02-15T10:05:03'), - ('188', '849', '2006-02-15T10:05:03'), - ('171', '849', '2006-02-15T10:05:03'), - ('107', '849', '2006-02-15T10:05:03'), - ('21', '321', '2006-02-15T10:05:03'), - ('30', '321', '2006-02-15T10:05:03'), - ('74', '321', '2006-02-15T10:05:03'), - ('2', '321', '2006-02-15T10:05:03'), - ('8', '321', '2006-02-15T10:05:03'), - ('18', '321', '2006-02-15T10:05:03'), - ('157', '321', '2006-02-15T10:05:03'), - ('50', '840', '2006-02-15T10:05:03'), - ('79', '840', '2006-02-15T10:05:03'), - ('37', '840', '2006-02-15T10:05:03'), - ('141', '840', '2006-02-15T10:05:03'), - ('68', '840', '2006-02-15T10:05:03'), - ('158', '840', '2006-02-15T10:05:03'), - ('124', '22', '2006-02-15T10:05:03'), - ('95', '22', '2006-02-15T10:05:03'), - ('77', '22', '2006-02-15T10:05:03'), - ('122', '22', '2006-02-15T10:05:03'), - ('153', '536', '2006-02-15T10:05:03'), - ('14', '536', '2006-02-15T10:05:03'), - ('22', '536', '2006-02-15T10:05:03'), - ('18', '536', '2006-02-15T10:05:03'), - ('23', '536', '2006-02-15T10:05:03'), - ('198', '536', '2006-02-15T10:05:03'), - ('109', '393', '2006-02-15T10:05:03'), - ('144', '393', '2006-02-15T10:05:03'), - ('3', '393', '2006-02-15T10:05:03'), - ('57', '393', '2006-02-15T10:05:03'), - ('78', '393', '2006-02-15T10:05:03'), - ('34', '393', '2006-02-15T10:05:03'), - ('62', '393', '2006-02-15T10:05:03'), - ('157', '159', '2006-02-15T10:05:03'), - ('179', '159', '2006-02-15T10:05:03'), - ('149', '159', '2006-02-15T10:05:03'), - ('41', '159', '2006-02-15T10:05:03'), - ('21', '159', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('199', '159', '2006-02-15T10:05:03'), - ('80', '280', '2006-02-15T10:05:03'), - ('64', '280', '2006-02-15T10:05:03'), - ('15', '280', '2006-02-15T10:05:03'), - ('93', '280', '2006-02-15T10:05:03'), - ('105', '280', '2006-02-15T10:05:03'), - ('17', '280', '2006-02-15T10:05:03'), - ('18', '280', '2006-02-15T10:05:03'), - ('133', '280', '2006-02-15T10:05:03'), - ('16', '280', '2006-02-15T10:05:03'), - ('32', '103', '2006-02-15T10:05:03'), - ('26', '103', '2006-02-15T10:05:03'), - ('89', '103', '2006-02-15T10:05:03'), - ('51', '103', '2006-02-15T10:05:03'), - ('193', '103', '2006-02-15T10:05:03'), - ('92', '103', '2006-02-15T10:05:03'), - ('27', '477', '2006-02-15T10:05:03'), - ('67', '477', '2006-02-15T10:05:03'), - ('10', '477', '2006-02-15T10:05:03'), - ('58', '477', '2006-02-15T10:05:03'), - ('37', '477', '2006-02-15T10:05:03'), - ('90', '303', '2006-02-15T10:05:03'), - ('86', '303', '2006-02-15T10:05:03'), - ('163', '303', '2006-02-15T10:05:03'), - ('157', '303', '2006-02-15T10:05:03'), - ('50', '303', '2006-02-15T10:05:03'), - ('198', '303', '2006-02-15T10:05:03'), - ('176', '303', '2006-02-15T10:05:03'), - ('155', '303', '2006-02-15T10:05:03'), - ('196', '303', '2006-02-15T10:05:03'), - ('45', '416', '2006-02-15T10:05:03'), - ('12', '416', '2006-02-15T10:05:03'), - ('170', '416', '2006-02-15T10:05:03'), - ('91', '416', '2006-02-15T10:05:03'), - ('130', '416', '2006-02-15T10:05:03'), - ('17', '800', '2006-02-15T10:05:03'), - ('167', '800', '2006-02-15T10:05:03'), - ('159', '800', '2006-02-15T10:05:03'), - ('58', '800', '2006-02-15T10:05:03'), - ('48', '545', '2006-02-15T10:05:03'), - ('110', '545', '2006-02-15T10:05:03'), - ('164', '545', '2006-02-15T10:05:03'), - ('126', '545', '2006-02-15T10:05:03'), - ('81', '545', '2006-02-15T10:05:03'), - ('198', '545', '2006-02-15T10:05:03'), - ('92', '545', '2006-02-15T10:05:03'), - ('147', '351', '2006-02-15T10:05:03'), - ('102', '351', '2006-02-15T10:05:03'), - ('133', '351', '2006-02-15T10:05:03'), - ('7', '351', '2006-02-15T10:05:03'), - ('47', '351', '2006-02-15T10:05:03'), - ('127', '366', '2006-02-15T10:05:03'), - ('10', '366', '2006-02-15T10:05:03'), - ('166', '366', '2006-02-15T10:05:03'), - ('20', '366', '2006-02-15T10:05:03'), - ('155', '997', '2006-02-15T10:05:03'), - ('23', '997', '2006-02-15T10:05:03'), - ('198', '997', '2006-02-15T10:05:03'), - ('124', '997', '2006-02-15T10:05:03'), - ('37', '997', '2006-02-15T10:05:03'), - ('125', '175', '2006-02-15T10:05:03'), - ('80', '175', '2006-02-15T10:05:03'), - ('143', '175', '2006-02-15T10:05:03'), - ('58', '175', '2006-02-15T10:05:03'), - ('84', '175', '2006-02-15T10:05:03'), - ('177', '175', '2006-02-15T10:05:03'), - ('2', '550', '2006-02-15T10:05:03'), - ('72', '550', '2006-02-15T10:05:03'), - ('173', '550', '2006-02-15T10:05:03'), - ('117', '550', '2006-02-15T10:05:03'), - ('190', '54', '2006-02-15T10:05:03'), - ('5', '54', '2006-02-15T10:05:03'), - ('62', '54', '2006-02-15T10:05:03'), - ('59', '54', '2006-02-15T10:05:03'), - ('20', '54', '2006-02-15T10:05:03'), - ('96', '54', '2006-02-15T10:05:03'), - ('135', '88', '2006-02-15T10:05:03'), - ('194', '88', '2006-02-15T10:05:03'), - ('59', '88', '2006-02-15T10:05:03'), - ('44', '88', '2006-02-15T10:05:03'), - ('116', '88', '2006-02-15T10:05:03'), - ('31', '88', '2006-02-15T10:05:03'), - ('69', '88', '2006-02-15T10:05:03'), - ('21', '88', '2006-02-15T10:05:03'), - ('64', '88', '2006-02-15T10:05:03'), - ('57', '213', '2006-02-15T10:05:03'), - ('68', '213', '2006-02-15T10:05:03'), - ('25', '213', '2006-02-15T10:05:03'), - ('12', '213', '2006-02-15T10:05:03'), - ('93', '678', '2006-02-15T10:05:03'), - ('168', '678', '2006-02-15T10:05:03'), - ('51', '678', '2006-02-15T10:05:03'), - ('85', '678', '2006-02-15T10:05:03'), - ('41', '678', '2006-02-15T10:05:03'), - ('83', '339', '2006-02-15T10:05:03'), - ('167', '339', '2006-02-15T10:05:03'), - ('143', '339', '2006-02-15T10:05:03'), - ('114', '339', '2006-02-15T10:05:03'), - ('149', '339', '2006-02-15T10:05:03'), - ('93', '339', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('27', '986', '2006-02-15T10:05:03'), - ('60', '986', '2006-02-15T10:05:03'), - ('171', '701', '2006-02-15T10:05:03'), - ('198', '499', '2006-02-15T10:05:03'), - ('36', '499', '2006-02-15T10:05:03'), - ('118', '499', '2006-02-15T10:05:03'), - ('1', '499', '2006-02-15T10:05:03'), - ('187', '499', '2006-02-15T10:05:03'), - ('20', '499', '2006-02-15T10:05:03'), - ('10', '782', '2006-02-15T10:05:03'), - ('23', '782', '2006-02-15T10:05:03'), - ('98', '782', '2006-02-15T10:05:03'), - ('149', '782', '2006-02-15T10:05:03'), - ('119', '782', '2006-02-15T10:05:03'), - ('84', '782', '2006-02-15T10:05:03'), - ('164', '252', '2006-02-15T10:05:03'), - ('33', '252', '2006-02-15T10:05:03'), - ('41', '252', '2006-02-15T10:05:03'), - ('176', '252', '2006-02-15T10:05:03'), - ('184', '985', '2006-02-15T10:05:03'), - ('98', '985', '2006-02-15T10:05:03'), - ('115', '985', '2006-02-15T10:05:03'), - ('82', '985', '2006-02-15T10:05:03'), - ('15', '985', '2006-02-15T10:05:03'), - ('61', '433', '2006-02-15T10:05:03'), - ('150', '433', '2006-02-15T10:05:03'), - ('90', '433', '2006-02-15T10:05:03'), - ('49', '433', '2006-02-15T10:05:03'), - ('11', '433', '2006-02-15T10:05:03'), - ('168', '433', '2006-02-15T10:05:03'), - ('177', '433', '2006-02-15T10:05:03'), - ('137', '433', '2006-02-15T10:05:03'), - ('144', '776', '2006-02-15T10:05:03'), - ('79', '776', '2006-02-15T10:05:03'), - ('55', '776', '2006-02-15T10:05:03'), - ('48', '267', '2006-02-15T10:05:03'), - ('160', '267', '2006-02-15T10:05:03'), - ('81', '267', '2006-02-15T10:05:03'), - ('16', '267', '2006-02-15T10:05:03'), - ('79', '267', '2006-02-15T10:05:03'), - ('57', '267', '2006-02-15T10:05:03'), - ('7', '218', '2006-02-15T10:05:03'), - ('146', '218', '2006-02-15T10:05:03'), - ('113', '218', '2006-02-15T10:05:03'), - ('16', '218', '2006-02-15T10:05:03'), - ('54', '510', '2006-02-15T10:05:03'), - ('9', '510', '2006-02-15T10:05:03'), - ('19', '510', '2006-02-15T10:05:03'), - ('185', '510', '2006-02-15T10:05:03'), - ('138', '214', '2006-02-15T10:05:03'), - ('33', '214', '2006-02-15T10:05:03'), - ('192', '214', '2006-02-15T10:05:03'), - ('136', '214', '2006-02-15T10:05:03'), - ('172', '368', '2006-02-15T10:05:03'), - ('160', '368', '2006-02-15T10:05:03'), - ('148', '368', '2006-02-15T10:05:03'), - ('133', '368', '2006-02-15T10:05:03'), - ('31', '368', '2006-02-15T10:05:03'), - ('12', '513', '2006-02-15T10:05:03'), - ('100', '513', '2006-02-15T10:05:03'), - ('120', '513', '2006-02-15T10:05:03'), - ('155', '513', '2006-02-15T10:05:03'), - ('19', '513', '2006-02-15T10:05:03'), - ('13', '513', '2006-02-15T10:05:03'), - ('110', '513', '2006-02-15T10:05:03'), - ('73', '707', '2006-02-15T10:05:03'), - ('117', '707', '2006-02-15T10:05:03'), - ('35', '707', '2006-02-15T10:05:03'), - ('57', '707', '2006-02-15T10:05:03'), - ('62', '707', '2006-02-15T10:05:03'), - ('173', '379', '2006-02-15T10:05:03'), - ('108', '379', '2006-02-15T10:05:03'), - ('198', '379', '2006-02-15T10:05:03'), - ('156', '379', '2006-02-15T10:05:03'), - ('115', '379', '2006-02-15T10:05:03'), - ('4', '379', '2006-02-15T10:05:03'), - ('187', '379', '2006-02-15T10:05:03'), - ('73', '379', '2006-02-15T10:05:03'), - ('187', '441', '2006-02-15T10:05:03'), - ('3', '441', '2006-02-15T10:05:03'), - ('176', '441', '2006-02-15T10:05:03'), - ('180', '441', '2006-02-15T10:05:03'), - ('98', '738', '2006-02-15T10:05:03'), - ('195', '738', '2006-02-15T10:05:03'), - ('117', '738', '2006-02-15T10:05:03'), - ('42', '738', '2006-02-15T10:05:03'), - ('119', '738', '2006-02-15T10:05:03'), - ('194', '738', '2006-02-15T10:05:03'), - ('35', '738', '2006-02-15T10:05:03'), - ('171', '447', '2006-02-15T10:05:03'), - ('150', '447', '2006-02-15T10:05:03'), - ('139', '447', '2006-02-15T10:05:03'), - ('57', '447', '2006-02-15T10:05:03'), - ('91', '447', '2006-02-15T10:05:03'), - ('53', '447', '2006-02-15T10:05:03'), - ('31', '299', '2006-02-15T10:05:03'), - ('170', '299', '2006-02-15T10:05:03'), - ('154', '299', '2006-02-15T10:05:03'), - ('79', '299', '2006-02-15T10:05:03'), - ('60', '299', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('128', '299', '2006-02-15T10:05:03'), - ('2', '132', '2006-02-15T10:05:03'), - ('134', '132', '2006-02-15T10:05:03'), - ('111', '407', '2006-02-15T10:05:03'), - ('155', '407', '2006-02-15T10:05:03'), - ('45', '407', '2006-02-15T10:05:03'), - ('128', '407', '2006-02-15T10:05:03'), - ('52', '407', '2006-02-15T10:05:03'), - ('49', '407', '2006-02-15T10:05:03'), - ('46', '407', '2006-02-15T10:05:03'), - ('53', '51', '2006-02-15T10:05:03'), - ('188', '51', '2006-02-15T10:05:03'), - ('73', '51', '2006-02-15T10:05:03'), - ('133', '51', '2006-02-15T10:05:03'), - ('46', '51', '2006-02-15T10:05:03'), - ('187', '51', '2006-02-15T10:05:03'), - ('52', '20', '2006-02-15T10:05:03'), - ('159', '20', '2006-02-15T10:05:03'), - ('102', '20', '2006-02-15T10:05:03'), - ('155', '20', '2006-02-15T10:05:03'), - ('136', '20', '2006-02-15T10:05:03'), - ('139', '20', '2006-02-15T10:05:03'), - ('130', '525', '2006-02-15T10:05:03'), - ('34', '525', '2006-02-15T10:05:03'), - ('110', '525', '2006-02-15T10:05:03'), - ('51', '525', '2006-02-15T10:05:03'), - ('113', '525', '2006-02-15T10:05:03'), - ('101', '828', '2006-02-15T10:05:03'), - ('175', '828', '2006-02-15T10:05:03'), - ('102', '828', '2006-02-15T10:05:03'), - ('193', '828', '2006-02-15T10:05:03'), - ('182', '828', '2006-02-15T10:05:03'), - ('95', '828', '2006-02-15T10:05:03'), - ('195', '560', '2006-02-15T10:05:03'), - ('189', '560', '2006-02-15T10:05:03'), - ('143', '560', '2006-02-15T10:05:03'), - ('196', '560', '2006-02-15T10:05:03'), - ('171', '560', '2006-02-15T10:05:03'), - ('71', '560', '2006-02-15T10:05:03'), - ('185', '560', '2006-02-15T10:05:03'), - ('138', '157', '2006-02-15T10:05:03'), - ('127', '157', '2006-02-15T10:05:03'), - ('122', '157', '2006-02-15T10:05:03'), - ('109', '157', '2006-02-15T10:05:03'), - ('87', '157', '2006-02-15T10:05:03'), - ('180', '195', '2006-02-15T10:05:03'), - ('8', '195', '2006-02-15T10:05:03'), - ('49', '195', '2006-02-15T10:05:03'), - ('181', '195', '2006-02-15T10:05:03'), - ('66', '434', '2006-02-15T10:05:03'), - ('44', '434', '2006-02-15T10:05:03'), - ('163', '434', '2006-02-15T10:05:03'), - ('169', '434', '2006-02-15T10:05:03'), - ('9', '434', '2006-02-15T10:05:03'), - ('159', '208', '2006-02-15T10:05:03'), - ('63', '208', '2006-02-15T10:05:03'), - ('154', '208', '2006-02-15T10:05:03'), - ('120', '208', '2006-02-15T10:05:03'), - ('168', '208', '2006-02-15T10:05:03'), - ('108', '208', '2006-02-15T10:05:03'), - ('130', '208', '2006-02-15T10:05:03'), - ('19', '208', '2006-02-15T10:05:03'), - ('186', '208', '2006-02-15T10:05:03'), - ('12', '208', '2006-02-15T10:05:03'), - ('189', '628', '2006-02-15T10:05:03'), - ('197', '628', '2006-02-15T10:05:03'), - ('198', '628', '2006-02-15T10:05:03'), - ('135', '628', '2006-02-15T10:05:03'), - ('79', '628', '2006-02-15T10:05:03'), - ('70', '628', '2006-02-15T10:05:03'), - ('180', '628', '2006-02-15T10:05:03'), - ('167', '628', '2006-02-15T10:05:03'), - ('39', '559', '2006-02-15T10:05:03'), - ('48', '559', '2006-02-15T10:05:03'), - ('106', '559', '2006-02-15T10:05:03'), - ('93', '573', '2006-02-15T10:05:03'), - ('53', '573', '2006-02-15T10:05:03'), - ('17', '573', '2006-02-15T10:05:03'), - ('176', '573', '2006-02-15T10:05:03'), - ('127', '573', '2006-02-15T10:05:03'), - ('157', '573', '2006-02-15T10:05:03'), - ('167', '319', '2006-02-15T10:05:03'), - ('46', '319', '2006-02-15T10:05:03'), - ('143', '660', '2006-02-15T10:05:03'), - ('160', '660', '2006-02-15T10:05:03'), - ('110', '156', '2006-02-15T10:05:03'), - ('196', '156', '2006-02-15T10:05:03'), - ('132', '156', '2006-02-15T10:05:03'), - ('104', '156', '2006-02-15T10:05:03'), - ('50', '417', '2006-02-15T10:05:03'), - ('14', '417', '2006-02-15T10:05:03'), - ('187', '417', '2006-02-15T10:05:03'), - ('176', '417', '2006-02-15T10:05:03'), - ('58', '417', '2006-02-15T10:05:03'), - ('56', '417', '2006-02-15T10:05:03'), - ('74', '848', '2006-02-15T10:05:03'), - ('104', '739', '2006-02-15T10:05:03'), - ('31', '739', '2006-02-15T10:05:03'), - ('117', '739', '2006-02-15T10:05:03'), - ('196', '324', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('125', '324', '2006-02-15T10:05:03'), - ('164', '324', '2006-02-15T10:05:03'), - ('182', '324', '2006-02-15T10:05:03'), - ('139', '181', '2006-02-15T10:05:03'), - ('113', '181', '2006-02-15T10:05:03'), - ('91', '181', '2006-02-15T10:05:03'), - ('53', '181', '2006-02-15T10:05:03'), - ('171', '181', '2006-02-15T10:05:03'), - ('16', '438', '2006-02-15T10:05:03'), - ('34', '438', '2006-02-15T10:05:03'), - ('168', '438', '2006-02-15T10:05:03'), - ('1', '438', '2006-02-15T10:05:03'), - ('155', '584', '2006-02-15T10:05:03'), - ('70', '584', '2006-02-15T10:05:03'), - ('116', '584', '2006-02-15T10:05:03'), - ('185', '584', '2006-02-15T10:05:03'), - ('125', '584', '2006-02-15T10:05:03'), - ('52', '584', '2006-02-15T10:05:03'), - ('91', '13', '2006-02-15T10:05:03'), - ('94', '13', '2006-02-15T10:05:03'), - ('176', '13', '2006-02-15T10:05:03'), - ('77', '13', '2006-02-15T10:05:03'), - ('114', '13', '2006-02-15T10:05:03'), - ('76', '765', '2006-02-15T10:05:03'), - ('98', '765', '2006-02-15T10:05:03'), - ('14', '475', '2006-02-15T10:05:03'), - ('65', '475', '2006-02-15T10:05:03'), - ('85', '475', '2006-02-15T10:05:03'), - ('94', '475', '2006-02-15T10:05:03'), - ('145', '475', '2006-02-15T10:05:03'), - ('192', '475', '2006-02-15T10:05:03'), - ('99', '475', '2006-02-15T10:05:03'), - ('152', '475', '2006-02-15T10:05:03'), - ('80', '475', '2006-02-15T10:05:03'), - ('149', '913', '2006-02-15T10:05:03'), - ('54', '913', '2006-02-15T10:05:03'), - ('114', '913', '2006-02-15T10:05:03'), - ('47', '913', '2006-02-15T10:05:03'), - ('157', '913', '2006-02-15T10:05:03'), - ('39', '831', '2006-02-15T10:05:03'), - ('117', '831', '2006-02-15T10:05:03'), - ('61', '831', '2006-02-15T10:05:03'), - ('105', '831', '2006-02-15T10:05:03'), - ('107', '831', '2006-02-15T10:05:03'), - ('59', '210', '2006-02-15T10:05:03'), - ('133', '210', '2006-02-15T10:05:03'), - ('114', '210', '2006-02-15T10:05:03'), - ('157', '210', '2006-02-15T10:05:03'), - ('180', '657', '2006-02-15T10:05:03'), - ('109', '657', '2006-02-15T10:05:03'), - ('104', '657', '2006-02-15T10:05:03'), - ('41', '657', '2006-02-15T10:05:03'), - ('76', '935', '2006-02-15T10:05:03'), - ('23', '935', '2006-02-15T10:05:03'), - ('131', '320', '2006-02-15T10:05:03'), - ('135', '320', '2006-02-15T10:05:03'), - ('39', '320', '2006-02-15T10:05:03'), - ('42', '320', '2006-02-15T10:05:03'), - ('55', '320', '2006-02-15T10:05:03'), - ('176', '320', '2006-02-15T10:05:03'), - ('94', '320', '2006-02-15T10:05:03'), - ('146', '320', '2006-02-15T10:05:03'), - ('96', '320', '2006-02-15T10:05:03'), - ('29', '646', '2006-02-15T10:05:03'), - ('156', '646', '2006-02-15T10:05:03'), - ('79', '646', '2006-02-15T10:05:03'), - ('64', '646', '2006-02-15T10:05:03'), - ('84', '646', '2006-02-15T10:05:03'), - ('38', '241', '2006-02-15T10:05:03'), - ('59', '241', '2006-02-15T10:05:03'), - ('158', '241', '2006-02-15T10:05:03'), - ('106', '241', '2006-02-15T10:05:03'), - ('26', '241', '2006-02-15T10:05:03'), - ('14', '241', '2006-02-15T10:05:03'), - ('168', '241', '2006-02-15T10:05:03'), - ('43', '533', '2006-02-15T10:05:03'), - ('189', '533', '2006-02-15T10:05:03'), - ('94', '533', '2006-02-15T10:05:03'), - ('84', '529', '2006-02-15T10:05:03'), - ('89', '529', '2006-02-15T10:05:03'), - ('188', '529', '2006-02-15T10:05:03'), - ('90', '529', '2006-02-15T10:05:03'), - ('172', '529', '2006-02-15T10:05:03'), - ('102', '529', '2006-02-15T10:05:03'), - ('139', '529', '2006-02-15T10:05:03'), - ('173', '529', '2006-02-15T10:05:03'), - ('83', '529', '2006-02-15T10:05:03'), - ('26', '529', '2006-02-15T10:05:03'), - ('69', '529', '2006-02-15T10:05:03'), - ('37', '529', '2006-02-15T10:05:03'), - ('77', '240', '2006-02-15T10:05:03'), - ('90', '676', '2006-02-15T10:05:03'), - ('66', '676', '2006-02-15T10:05:03'), - ('121', '884', '2006-02-15T10:05:03'), - ('164', '884', '2006-02-15T10:05:03'), - ('173', '857', '2006-02-15T10:05:03'), - ('129', '857', '2006-02-15T10:05:03'), - ('86', '857', '2006-02-15T10:05:03'), - ('140', '857', '2006-02-15T10:05:03'), - ('17', '127', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('144', '127', '2006-02-15T10:05:03'), - ('187', '127', '2006-02-15T10:05:03'), - ('159', '127', '2006-02-15T10:05:03'), - ('152', '964', '2006-02-15T10:05:03'), - ('72', '964', '2006-02-15T10:05:03'), - ('10', '964', '2006-02-15T10:05:03'), - ('9', '964', '2006-02-15T10:05:03'), - ('70', '964', '2006-02-15T10:05:03'), - ('22', '964', '2006-02-15T10:05:03'), - ('128', '696', '2006-02-15T10:05:03'), - ('157', '696', '2006-02-15T10:05:03'), - ('108', '696', '2006-02-15T10:05:03'), - ('39', '696', '2006-02-15T10:05:03'), - ('92', '929', '2006-02-15T10:05:03'), - ('10', '929', '2006-02-15T10:05:03'), - ('34', '929', '2006-02-15T10:05:03'), - ('88', '929', '2006-02-15T10:05:03'), - ('86', '929', '2006-02-15T10:05:03'), - ('6', '902', '2006-02-15T10:05:03'), - ('74', '902', '2006-02-15T10:05:03'), - ('44', '902', '2006-02-15T10:05:03'), - ('48', '705', '2006-02-15T10:05:03'), - ('156', '705', '2006-02-15T10:05:03'), - ('190', '705', '2006-02-15T10:05:03'), - ('129', '705', '2006-02-15T10:05:03'), - ('38', '705', '2006-02-15T10:05:03'), - ('174', '705', '2006-02-15T10:05:03'), - ('170', '705', '2006-02-15T10:05:03'), - ('98', '705', '2006-02-15T10:05:03'), - ('39', '425', '2006-02-15T10:05:03'), - ('114', '425', '2006-02-15T10:05:03'), - ('161', '425', '2006-02-15T10:05:03'), - ('3', '539', '2006-02-15T10:05:03'), - ('124', '539', '2006-02-15T10:05:03'), - ('151', '539', '2006-02-15T10:05:03'), - ('110', '539', '2006-02-15T10:05:03'), - ('181', '539', '2006-02-15T10:05:03'), - ('131', '539', '2006-02-15T10:05:03'), - ('175', '591', '2006-02-15T10:05:03'), - ('146', '591', '2006-02-15T10:05:03'), - ('50', '591', '2006-02-15T10:05:03'), - ('85', '591', '2006-02-15T10:05:03'), - ('44', '591', '2006-02-15T10:05:03'), - ('156', '448', '2006-02-15T10:05:03'), - ('164', '448', '2006-02-15T10:05:03'), - ('185', '448', '2006-02-15T10:05:03'), - ('46', '448', '2006-02-15T10:05:03'), - ('64', '448', '2006-02-15T10:05:03'), - ('38', '448', '2006-02-15T10:05:03'), - ('84', '540', '2006-02-15T10:05:03'), - ('94', '540', '2006-02-15T10:05:03'), - ('142', '540', '2006-02-15T10:05:03'), - ('99', '540', '2006-02-15T10:05:03'), - ('2', '540', '2006-02-15T10:05:03'), - ('144', '540', '2006-02-15T10:05:03'), - ('139', '540', '2006-02-15T10:05:03'), - ('12', '540', '2006-02-15T10:05:03'), - ('46', '540', '2006-02-15T10:05:03'), - ('27', '540', '2006-02-15T10:05:03'), - ('146', '384', '2006-02-15T10:05:03'), - ('118', '384', '2006-02-15T10:05:03'), - ('90', '384', '2006-02-15T10:05:03'), - ('116', '384', '2006-02-15T10:05:03'), - ('177', '289', '2006-02-15T10:05:03'), - ('3', '289', '2006-02-15T10:05:03'), - ('124', '289', '2006-02-15T10:05:03'), - ('169', '289', '2006-02-15T10:05:03'), - ('101', '289', '2006-02-15T10:05:03'), - ('188', '289', '2006-02-15T10:05:03'), - ('106', '439', '2006-02-15T10:05:03'), - ('175', '439', '2006-02-15T10:05:03'), - ('167', '191', '2006-02-15T10:05:03'), - ('10', '191', '2006-02-15T10:05:03'), - ('175', '191', '2006-02-15T10:05:03'), - ('9', '191', '2006-02-15T10:05:03'), - ('141', '191', '2006-02-15T10:05:03'), - ('146', '191', '2006-02-15T10:05:03'), - ('126', '96', '2006-02-15T10:05:03'), - ('17', '96', '2006-02-15T10:05:03'), - ('28', '96', '2006-02-15T10:05:03'), - ('7', '96', '2006-02-15T10:05:03'), - ('52', '96', '2006-02-15T10:05:03'), - ('137', '96', '2006-02-15T10:05:03'), - ('81', '304', '2006-02-15T10:05:03'), - ('88', '304', '2006-02-15T10:05:03'), - ('163', '304', '2006-02-15T10:05:03'), - ('137', '304', '2006-02-15T10:05:03'), - ('70', '304', '2006-02-15T10:05:03'), - ('193', '376', '2006-02-15T10:05:03'), - ('138', '376', '2006-02-15T10:05:03'), - ('52', '376', '2006-02-15T10:05:03'), - ('60', '376', '2006-02-15T10:05:03'), - ('66', '376', '2006-02-15T10:05:03'), - ('8', '936', '2006-02-15T10:05:03'), - ('73', '936', '2006-02-15T10:05:03'), - ('134', '936', '2006-02-15T10:05:03'), - ('101', '936', '2006-02-15T10:05:03'), - ('56', '936', '2006-02-15T10:05:03'), - ('81', '4', '2006-02-15T10:05:03'), - ('88', '4', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_actor" ("actor_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('41', '4', '2006-02-15T10:05:03'), - ('147', '4', '2006-02-15T10:05:03'), - ('162', '4', '2006-02-15T10:05:03'), - ('59', '984', '2006-02-15T10:05:03'), - ('164', '984', '2006-02-15T10:05:03'), - ('104', '984', '2006-02-15T10:05:03'), - ('101', '984', '2006-02-15T10:05:03'), - ('68', '497', '2006-02-15T10:05:03'), - ('125', '497', '2006-02-15T10:05:03'), - ('143', '497', '2006-02-15T10:05:03'), - ('21', '497', '2006-02-15T10:05:03'), - ('82', '497', '2006-02-15T10:05:03'), - ('180', '777', '2006-02-15T10:05:03'), - ('150', '777', '2006-02-15T10:05:03'), - ('83', '777', '2006-02-15T10:05:03'), - ('93', '777', '2006-02-15T10:05:03'), - ('47', '777', '2006-02-15T10:05:03'), - ('111', '777', '2006-02-15T10:05:03'), - ('121', '220', '2006-02-15T10:05:03'), - ('155', '220', '2006-02-15T10:05:03'), - ('107', '220', '2006-02-15T10:05:03'), - ('120', '994', '2006-02-15T10:05:03'), - ('115', '994', '2006-02-15T10:05:03'), - ('105', '994', '2006-02-15T10:05:03'), - ('186', '994', '2006-02-15T10:05:03'), - ('6', '994', '2006-02-15T10:05:03'), - ('28', '994', '2006-02-15T10:05:03'), - ('3', '185', '2006-02-15T10:05:03'), - ('191', '185', '2006-02-15T10:05:03'), - ('140', '185', '2006-02-15T10:05:03'), - ('123', '185', '2006-02-15T10:05:03'), - ('74', '185', '2006-02-15T10:05:03'), - ('29', '172', '2006-02-15T10:05:03'), - ('27', '172', '2006-02-15T10:05:03'), - ('119', '172', '2006-02-15T10:05:03'), - ('18', '172', '2006-02-15T10:05:03'), - ('47', '172', '2006-02-15T10:05:03'), - ('5', '172', '2006-02-15T10:05:03'), - ('34', '172', '2006-02-15T10:05:03'), - ('107', '172', '2006-02-15T10:05:03'), - ('133', '172', '2006-02-15T10:05:03'), - ('92', '547', '2006-02-15T10:05:03'), - ('29', '547', '2006-02-15T10:05:03'), - ('38', '547', '2006-02-15T10:05:03'), - ('75', '547', '2006-02-15T10:05:03'), - ('105', '835', '2006-02-15T10:05:03'), - ('93', '835', '2006-02-15T10:05:03'), - ('140', '835', '2006-02-15T10:05:03'), - ('99', '835', '2006-02-15T10:05:03'), - ('157', '835', '2006-02-15T10:05:03'), - ('28', '835', '2006-02-15T10:05:03'), - ('40', '835', '2006-02-15T10:05:03'), - ('60', '835', '2006-02-15T10:05:03'), - ('133', '594', '2006-02-15T10:05:03'), - ('15', '594', '2006-02-15T10:05:03'), - ('68', '133', '2006-02-15T10:05:03'), - ('148', '133', '2006-02-15T10:05:03'), - ('107', '133', '2006-02-15T10:05:03'), - ('133', '133', '2006-02-15T10:05:03'), - ('29', '133', '2006-02-15T10:05:03'), - ('132', '133', '2006-02-15T10:05:03'), - ('60', '133', '2006-02-15T10:05:03') - ) AS data(old_actor_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."actor"' - AND map0.old_id = data.old_actor_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - -- Table: "public"."film_category" (1000 records) - INSERT INTO "public"."film_category" ("category_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('2', '805', '2006-02-15T10:07:09'), - ('3', '853', '2006-02-15T10:07:09'), - ('14', '817', '2006-02-15T10:07:09'), - ('1', '732', '2006-02-15T10:07:09'), - ('11', '65', '2006-02-15T10:07:09'), - ('1', '915', '2006-02-15T10:07:09'), - ('3', '999', '2006-02-15T10:07:09'), - ('2', '564', '2006-02-15T10:07:09'), - ('15', '176', '2006-02-15T10:07:09'), - ('14', '655', '2006-02-15T10:07:09'), - ('13', '32', '2006-02-15T10:07:09'), - ('16', '75', '2006-02-15T10:07:09'), - ('11', '653', '2006-02-15T10:07:09'), - ('10', '362', '2006-02-15T10:07:09'), - ('9', '789', '2006-02-15T10:07:09'), - ('16', '642', '2006-02-15T10:07:09'), - ('14', '930', '2006-02-15T10:07:09'), - ('8', '82', '2006-02-15T10:07:09'), - ('11', '34', '2006-02-15T10:07:09'), - ('16', '233', '2006-02-15T10:07:09'), - ('9', '792', '2006-02-15T10:07:09'), - ('2', '355', '2006-02-15T10:07:09'), - ('3', '761', '2006-02-15T10:07:09'), - ('6', '575', '2006-02-15T10:07:09'), - ('7', '643', '2006-02-15T10:07:09'), - ('12', '454', '2006-02-15T10:07:09'), - ('8', '71', '2006-02-15T10:07:09'), - ('15', '488', '2006-02-15T10:07:09'), - ('13', '108', '2006-02-15T10:07:09'), - ('4', '91', '2006-02-15T10:07:09'), - ('10', '387', '2006-02-15T10:07:09'), - ('3', '959', '2006-02-15T10:07:09'), - ('8', '458', '2006-02-15T10:07:09'), - ('7', '728', '2006-02-15T10:07:09'), - ('5', '704', '2006-02-15T10:07:09'), - ('4', '950', '2006-02-15T10:07:09'), - ('12', '752', '2006-02-15T10:07:09'), - ('7', '818', '2006-02-15T10:07:09'), - ('2', '583', '2006-02-15T10:07:09'), - ('3', '626', '2006-02-15T10:07:09'), - ('6', '834', '2006-02-15T10:07:09'), - ('2', '160', '2006-02-15T10:07:09'), - ('10', '483', '2006-02-15T10:07:09'), - ('10', '189', '2006-02-15T10:07:09'), - ('8', '822', '2006-02-15T10:07:09'), - ('6', '248', '2006-02-15T10:07:09'), - ('12', '647', '2006-02-15T10:07:09'), - ('4', '228', '2006-02-15T10:07:09'), - ('1', '29', '2006-02-15T10:07:09'), - ('14', '520', '2006-02-15T10:07:09'), - ('7', '969', '2006-02-15T10:07:09'), - ('12', '411', '2006-02-15T10:07:09'), - ('3', '755', '2006-02-15T10:07:09'), - ('1', '501', '2006-02-15T10:07:09'), - ('5', '247', '2006-02-15T10:07:09'), - ('7', '186', '2006-02-15T10:07:09'), - ('10', '654', '2006-02-15T10:07:09'), - ('9', '769', '2006-02-15T10:07:09'), - ('5', '858', '2006-02-15T10:07:09'), - ('3', '509', '2006-02-15T10:07:09'), - ('10', '352', '2006-02-15T10:07:09'), - ('14', '394', '2006-02-15T10:07:09'), - ('15', '599', '2006-02-15T10:07:09'), - ('16', '526', '2006-02-15T10:07:09'), - ('7', '979', '2006-02-15T10:07:09'), - ('5', '182', '2006-02-15T10:07:09'), - ('16', '451', '2006-02-15T10:07:09'), - ('6', '992', '2006-02-15T10:07:09'), - ('10', '331', '2006-02-15T10:07:09'), - ('12', '278', '2006-02-15T10:07:09'), - ('10', '381', '2006-02-15T10:07:09'), - ('10', '117', '2006-02-15T10:07:09'), - ('9', '414', '2006-02-15T10:07:09'), - ('10', '597', '2006-02-15T10:07:09'), - ('13', '305', '2006-02-15T10:07:09'), - ('1', '105', '2006-02-15T10:07:09'), - ('3', '68', '2006-02-15T10:07:09'), - ('3', '450', '2006-02-15T10:07:09'), - ('15', '841', '2006-02-15T10:07:09'), - ('14', '449', '2006-02-15T10:07:09'), - ('4', '487', '2006-02-15T10:07:09'), - ('5', '7', '2006-02-15T10:07:09'), - ('3', '889', '2006-02-15T10:07:09'), - ('6', '457', '2006-02-15T10:07:09'), - ('14', '839', '2006-02-15T10:07:09'), - ('16', '894', '2006-02-15T10:07:09'), - ('7', '146', '2006-02-15T10:07:09'), - ('10', '508', '2006-02-15T10:07:09'), - ('4', '578', '2006-02-15T10:07:09'), - ('9', '623', '2006-02-15T10:07:09'), - ('3', '735', '2006-02-15T10:07:09'), - ('10', '200', '2006-02-15T10:07:09'), - ('4', '808', '2006-02-15T10:07:09'), - ('11', '275', '2006-02-15T10:07:09'), - ('6', '3', '2006-02-15T10:07:09'), - ('15', '519', '2006-02-15T10:07:09'), - ('12', '921', '2006-02-15T10:07:09'), - ('2', '456', '2006-02-15T10:07:09'), - ('4', '663', '2006-02-15T10:07:09'), - ('9', '770', '2006-02-15T10:07:09') - ) AS data(old_category_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."category"' - AND map0.old_id = data.old_category_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_category" ("category_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('2', '651', '2006-02-15T10:07:09'), - ('14', '296', '2006-02-15T10:07:09'), - ('6', '142', '2006-02-15T10:07:09'), - ('15', '890', '2006-02-15T10:07:09'), - ('8', '727', '2006-02-15T10:07:09'), - ('7', '98', '2006-02-15T10:07:09'), - ('15', '668', '2006-02-15T10:07:09'), - ('13', '492', '2006-02-15T10:07:09'), - ('15', '322', '2006-02-15T10:07:09'), - ('12', '86', '2006-02-15T10:07:09'), - ('8', '832', '2006-02-15T10:07:09'), - ('15', '291', '2006-02-15T10:07:09'), - ('15', '796', '2006-02-15T10:07:09'), - ('10', '563', '2006-02-15T10:07:09'), - ('5', '242', '2006-02-15T10:07:09'), - ('11', '658', '2006-02-15T10:07:09'), - ('6', '199', '2006-02-15T10:07:09'), - ('12', '797', '2006-02-15T10:07:09'), - ('16', '787', '2006-02-15T10:07:09'), - ('8', '139', '2006-02-15T10:07:09'), - ('10', '976', '2006-02-15T10:07:09'), - ('15', '619', '2006-02-15T10:07:09'), - ('2', '118', '2006-02-15T10:07:09'), - ('15', '940', '2006-02-15T10:07:09'), - ('12', '363', '2006-02-15T10:07:09'), - ('1', '549', '2006-02-15T10:07:09'), - ('16', '868', '2006-02-15T10:07:09'), - ('16', '878', '2006-02-15T10:07:09'), - ('13', '677', '2006-02-15T10:07:09'), - ('9', '16', '2006-02-15T10:07:09'), - ('6', '427', '2006-02-15T10:07:09'), - ('14', '912', '2006-02-15T10:07:09'), - ('13', '551', '2006-02-15T10:07:09'), - ('1', '869', '2006-02-15T10:07:09'), - ('8', '621', '2006-02-15T10:07:09'), - ('12', '516', '2006-02-15T10:07:09'), - ('2', '243', '2006-02-15T10:07:09'), - ('11', '2', '2006-02-15T10:07:09'), - ('13', '364', '2006-02-15T10:07:09'), - ('9', '47', '2006-02-15T10:07:09'), - ('16', '347', '2006-02-15T10:07:09'), - ('2', '644', '2006-02-15T10:07:09'), - ('4', '131', '2006-02-15T10:07:09'), - ('9', '52', '2006-02-15T10:07:09'), - ('16', '167', '2006-02-15T10:07:09'), - ('15', '254', '2006-02-15T10:07:09'), - ('15', '733', '2006-02-15T10:07:09'), - ('13', '590', '2006-02-15T10:07:09'), - ('2', '690', '2006-02-15T10:07:09'), - ('1', '360', '2006-02-15T10:07:09'), - ('15', '293', '2006-02-15T10:07:09'), - ('12', '333', '2006-02-15T10:07:09'), - ('13', '730', '2006-02-15T10:07:09'), - ('16', '257', '2006-02-15T10:07:09'), - ('2', '134', '2006-02-15T10:07:09'), - ('10', '215', '2006-02-15T10:07:09'), - ('6', '571', '2006-02-15T10:07:09'), - ('2', '461', '2006-02-15T10:07:09'), - ('2', '820', '2006-02-15T10:07:09'), - ('2', '892', '2006-02-15T10:07:09'), - ('9', '641', '2006-02-15T10:07:09'), - ('2', '326', '2006-02-15T10:07:09'), - ('8', '610', '2006-02-15T10:07:09'), - ('6', '687', '2006-02-15T10:07:09'), - ('2', '402', '2006-02-15T10:07:09'), - ('9', '961', '2006-02-15T10:07:09'), - ('4', '471', '2006-02-15T10:07:09'), - ('4', '962', '2006-02-15T10:07:09'), - ('16', '981', '2006-02-15T10:07:09'), - ('4', '358', '2006-02-15T10:07:09'), - ('7', '61', '2006-02-15T10:07:09'), - ('10', '624', '2006-02-15T10:07:09'), - ('5', '413', '2006-02-15T10:07:09'), - ('16', '645', '2006-02-15T10:07:09'), - ('9', '380', '2006-02-15T10:07:09'), - ('1', '823', '2006-02-15T10:07:09'), - ('3', '768', '2006-02-15T10:07:09'), - ('6', '888', '2006-02-15T10:07:09'), - ('7', '504', '2006-02-15T10:07:09'), - ('8', '824', '2006-02-15T10:07:09'), - ('9', '431', '2006-02-15T10:07:09'), - ('6', '757', '2006-02-15T10:07:09'), - ('9', '669', '2006-02-15T10:07:09'), - ('13', '251', '2006-02-15T10:07:09'), - ('8', '810', '2006-02-15T10:07:09'), - ('4', '523', '2006-02-15T10:07:09'), - ('13', '686', '2006-02-15T10:07:09'), - ('8', '753', '2006-02-15T10:07:09'), - ('11', '830', '2006-02-15T10:07:09'), - ('14', '637', '2006-02-15T10:07:09'), - ('15', '763', '2006-02-15T10:07:09'), - ('2', '470', '2006-02-15T10:07:09'), - ('11', '8', '2006-02-15T10:07:09'), - ('15', '463', '2006-02-15T10:07:09'), - ('8', '63', '2006-02-15T10:07:09'), - ('16', '87', '2006-02-15T10:07:09'), - ('10', '141', '2006-02-15T10:07:09'), - ('4', '512', '2006-02-15T10:07:09'), - ('1', '586', '2006-02-15T10:07:09'), - ('12', '462', '2006-02-15T10:07:09') - ) AS data(old_category_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."category"' - AND map0.old_id = data.old_category_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_category" ("category_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('2', '70', '2006-02-15T10:07:09'), - ('15', '809', '2006-02-15T10:07:09'), - ('7', '209', '2006-02-15T10:07:09'), - ('8', '724', '2006-02-15T10:07:09'), - ('14', '390', '2006-02-15T10:07:09'), - ('9', '607', '2006-02-15T10:07:09'), - ('8', '442', '2006-02-15T10:07:09'), - ('10', '316', '2006-02-15T10:07:09'), - ('10', '781', '2006-02-15T10:07:09'), - ('8', '867', '2006-02-15T10:07:09'), - ('4', '554', '2006-02-15T10:07:09'), - ('1', '794', '2006-02-15T10:07:09'), - ('3', '993', '2006-02-15T10:07:09'), - ('9', '170', '2006-02-15T10:07:09'), - ('9', '337', '2006-02-15T10:07:09'), - ('1', '825', '2006-02-15T10:07:09'), - ('2', '541', '2006-02-15T10:07:09'), - ('6', '945', '2006-02-15T10:07:09'), - ('1', '659', '2006-02-15T10:07:09'), - ('14', '374', '2006-02-15T10:07:09'), - ('12', '562', '2006-02-15T10:07:09'), - ('13', '95', '2006-02-15T10:07:09'), - ('7', '923', '2006-02-15T10:07:09'), - ('15', '113', '2006-02-15T10:07:09'), - ('3', '468', '2006-02-15T10:07:09'), - ('15', '532', '2006-02-15T10:07:09'), - ('11', '313', '2006-02-15T10:07:09'), - ('9', '566', '2006-02-15T10:07:09'), - ('6', '219', '2006-02-15T10:07:09'), - ('7', '225', '2006-02-15T10:07:09'), - ('13', '974', '2006-02-15T10:07:09'), - ('10', '699', '2006-02-15T10:07:09'), - ('13', '25', '2006-02-15T10:07:09'), - ('8', '269', '2006-02-15T10:07:09'), - ('7', '64', '2006-02-15T10:07:09'), - ('10', '507', '2006-02-15T10:07:09'), - ('13', '109', '2006-02-15T10:07:09'), - ('12', '378', '2006-02-15T10:07:09'), - ('15', '917', '2006-02-15T10:07:09'), - ('1', '697', '2006-02-15T10:07:09'), - ('14', '138', '2006-02-15T10:07:09'), - ('3', '48', '2006-02-15T10:07:09'), - ('10', '264', '2006-02-15T10:07:09'), - ('14', '234', '2006-02-15T10:07:09'), - ('8', '43', '2006-02-15T10:07:09'), - ('7', '230', '2006-02-15T10:07:09'), - ('1', '115', '2006-02-15T10:07:09'), - ('10', '919', '2006-02-15T10:07:09'), - ('9', '531', '2006-02-15T10:07:09'), - ('3', '553', '2006-02-15T10:07:09'), - ('1', '371', '2006-02-15T10:07:09'), - ('8', '778', '2006-02-15T10:07:09'), - ('12', '12', '2006-02-15T10:07:09'), - ('2', '330', '2006-02-15T10:07:09'), - ('2', '121', '2006-02-15T10:07:09'), - ('13', '90', '2006-02-15T10:07:09'), - ('8', '715', '2006-02-15T10:07:09'), - ('12', '174', '2006-02-15T10:07:09'), - ('10', '956', '2006-02-15T10:07:09'), - ('12', '980', '2006-02-15T10:07:09'), - ('12', '158', '2006-02-15T10:07:09'), - ('2', '865', '2006-02-15T10:07:09'), - ('8', '528', '2006-02-15T10:07:09'), - ('13', '846', '2006-02-15T10:07:09'), - ('7', '514', '2006-02-15T10:07:09'), - ('13', '635', '2006-02-15T10:07:09'), - ('3', '373', '2006-02-15T10:07:09'), - ('9', '421', '2006-02-15T10:07:09'), - ('16', '169', '2006-02-15T10:07:09'), - ('10', '232', '2006-02-15T10:07:09'), - ('6', '926', '2006-02-15T10:07:09'), - ('12', '398', '2006-02-15T10:07:09'), - ('5', '754', '2006-02-15T10:07:09'), - ('16', '609', '2006-02-15T10:07:09'), - ('15', '606', '2006-02-15T10:07:09'), - ('5', '365', '2006-02-15T10:07:09'), - ('14', '860', '2006-02-15T10:07:09'), - ('11', '527', '2006-02-15T10:07:09'), - ('9', '460', '2006-02-15T10:07:09'), - ('5', '871', '2006-02-15T10:07:09'), - ('11', '24', '2006-02-15T10:07:09'), - ('6', '952', '2006-02-15T10:07:09'), - ('8', '419', '2006-02-15T10:07:09'), - ('15', '570', '2006-02-15T10:07:09'), - ('13', '270', '2006-02-15T10:07:09'), - ('1', '292', '2006-02-15T10:07:09'), - ('8', '780', '2006-02-15T10:07:09'), - ('6', '72', '2006-02-15T10:07:09'), - ('5', '939', '2006-02-15T10:07:09'), - ('4', '190', '2006-02-15T10:07:09'), - ('15', '612', '2006-02-15T10:07:09'), - ('13', '283', '2006-02-15T10:07:09'), - ('3', '152', '2006-02-15T10:07:09'), - ('5', '478', '2006-02-15T10:07:09'), - ('8', '31', '2006-02-15T10:07:09'), - ('5', '444', '2006-02-15T10:07:09'), - ('14', '137', '2006-02-15T10:07:09'), - ('6', '85', '2006-02-15T10:07:09'), - ('7', '944', '2006-02-15T10:07:09'), - ('4', '14', '2006-02-15T10:07:09') - ) AS data(old_category_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."category"' - AND map0.old_id = data.old_category_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_category" ("category_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('5', '410', '2006-02-15T10:07:09'), - ('1', '271', '2006-02-15T10:07:09'), - ('4', '891', '2006-02-15T10:07:09'), - ('4', '184', '2006-02-15T10:07:09'), - ('1', '205', '2006-02-15T10:07:09'), - ('9', '207', '2006-02-15T10:07:09'), - ('5', '814', '2006-02-15T10:07:09'), - ('15', '372', '2006-02-15T10:07:09'), - ('2', '223', '2006-02-15T10:07:09'), - ('5', '568', '2006-02-15T10:07:09'), - ('11', '737', '2006-02-15T10:07:09'), - ('10', '306', '2006-02-15T10:07:09'), - ('7', '803', '2006-02-15T10:07:09'), - ('1', '162', '2006-02-15T10:07:09'), - ('1', '793', '2006-02-15T10:07:09'), - ('16', '989', '2006-02-15T10:07:09'), - ('13', '632', '2006-02-15T10:07:09'), - ('14', '81', '2006-02-15T10:07:09'), - ('1', '67', '2006-02-15T10:07:09'), - ('3', '370', '2006-02-15T10:07:09'), - ('10', '236', '2006-02-15T10:07:09'), - ('8', '147', '2006-02-15T10:07:09'), - ('7', '897', '2006-02-15T10:07:09'), - ('5', '932', '2006-02-15T10:07:09'), - ('13', '760', '2006-02-15T10:07:09'), - ('5', '99', '2006-02-15T10:07:09'), - ('13', '436', '2006-02-15T10:07:09'), - ('10', '106', '2006-02-15T10:07:09'), - ('10', '310', '2006-02-15T10:07:09'), - ('6', '622', '2006-02-15T10:07:09'), - ('10', '546', '2006-02-15T10:07:09'), - ('8', '679', '2006-02-15T10:07:09'), - ('9', '689', '2006-02-15T10:07:09'), - ('5', '555', '2006-02-15T10:07:09'), - ('6', '274', '2006-02-15T10:07:09'), - ('4', '731', '2006-02-15T10:07:09'), - ('7', '766', '2006-02-15T10:07:09'), - ('4', '341', '2006-02-15T10:07:09'), - ('11', '799', '2006-02-15T10:07:09'), - ('2', '886', '2006-02-15T10:07:09'), - ('9', '399', '2006-02-15T10:07:09'), - ('15', '446', '2006-02-15T10:07:09'), - ('4', '951', '2006-02-15T10:07:09'), - ('12', '879', '2006-02-15T10:07:09'), - ('14', '369', '2006-02-15T10:07:09'), - ('9', '500', '2006-02-15T10:07:09'), - ('11', '740', '2006-02-15T10:07:09'), - ('15', '779', '2006-02-15T10:07:09'), - ('11', '909', '2006-02-15T10:07:09'), - ('11', '258', '2006-02-15T10:07:09'), - ('14', '620', '2006-02-15T10:07:09'), - ('14', '55', '2006-02-15T10:07:09'), - ('8', '736', '2006-02-15T10:07:09'), - ('7', '585', '2006-02-15T10:07:09'), - ('4', '480', '2006-02-15T10:07:09'), - ('15', '745', '2006-02-15T10:07:09'), - ('1', '250', '2006-02-15T10:07:09'), - ('3', '588', '2006-02-15T10:07:09'), - ('2', '963', '2006-02-15T10:07:09'), - ('16', '307', '2006-02-15T10:07:09'), - ('15', '120', '2006-02-15T10:07:09'), - ('15', '844', '2006-02-15T10:07:09'), - ('6', '734', '2006-02-15T10:07:09'), - ('4', '843', '2006-02-15T10:07:09'), - ('11', '593', '2006-02-15T10:07:09'), - ('8', '829', '2006-02-15T10:07:09'), - ('3', '168', '2006-02-15T10:07:09'), - ('3', '786', '2006-02-15T10:07:09'), - ('13', '340', '2006-02-15T10:07:09'), - ('6', '336', '2006-02-15T10:07:09'), - ('1', '511', '2006-02-15T10:07:09'), - ('6', '812', '2006-02-15T10:07:09'), - ('6', '129', '2006-02-15T10:07:09'), - ('4', '346', '2006-02-15T10:07:09'), - ('5', '613', '2006-02-15T10:07:09'), - ('4', '895', '2006-02-15T10:07:09'), - ('8', '795', '2006-02-15T10:07:09'), - ('12', '741', '2006-02-15T10:07:09'), - ('5', '119', '2006-02-15T10:07:09'), - ('15', '42', '2006-02-15T10:07:09'), - ('9', '726', '2006-02-15T10:07:09'), - ('9', '198', '2006-02-15T10:07:09'), - ('5', '385', '2006-02-15T10:07:09'), - ('12', '17', '2006-02-15T10:07:09'), - ('13', '806', '2006-02-15T10:07:09'), - ('5', '672', '2006-02-15T10:07:09'), - ('3', '343', '2006-02-15T10:07:09'), - ('2', '239', '2006-02-15T10:07:09'), - ('1', '318', '2006-02-15T10:07:09'), - ('2', '464', '2006-02-15T10:07:09'), - ('14', '26', '2006-02-15T10:07:09'), - ('16', '988', '2006-02-15T10:07:09'), - ('6', '670', '2006-02-15T10:07:09'), - ('3', '608', '2006-02-15T10:07:09'), - ('5', '524', '2006-02-15T10:07:09'), - ('1', '212', '2006-02-15T10:07:09'), - ('12', '819', '2006-02-15T10:07:09'), - ('5', '308', '2006-02-15T10:07:09'), - ('2', '89', '2006-02-15T10:07:09'), - ('2', '23', '2006-02-15T10:07:09') - ) AS data(old_category_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."category"' - AND map0.old_id = data.old_category_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_category" ("category_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('15', '260', '2006-02-15T10:07:09'), - ('1', '111', '2006-02-15T10:07:09'), - ('10', '934', '2006-02-15T10:07:09'), - ('2', '743', '2006-02-15T10:07:09'), - ('6', '943', '2006-02-15T10:07:09'), - ('6', '221', '2006-02-15T10:07:09'), - ('8', '603', '2006-02-15T10:07:09'), - ('16', '826', '2006-02-15T10:07:09'), - ('7', '473', '2006-02-15T10:07:09'), - ('16', '543', '2006-02-15T10:07:09'), - ('9', '201', '2006-02-15T10:07:09'), - ('14', '350', '2006-02-15T10:07:09'), - ('13', '136', '2006-02-15T10:07:09'), - ('6', '698', '2006-02-15T10:07:09'), - ('5', '332', '2006-02-15T10:07:09'), - ('5', '905', '2006-02-15T10:07:09'), - ('6', '973', '2006-02-15T10:07:09'), - ('6', '261', '2006-02-15T10:07:09'), - ('14', '177', '2006-02-15T10:07:09'), - ('10', '614', '2006-02-15T10:07:09'), - ('9', '148', '2006-02-15T10:07:09'), - ('10', '217', '2006-02-15T10:07:09'), - ('13', '937', '2006-02-15T10:07:09'), - ('6', '960', '2006-02-15T10:07:09'), - ('3', '873', '2006-02-15T10:07:09'), - ('2', '649', '2006-02-15T10:07:09'), - ('15', '667', '2006-02-15T10:07:09'), - ('14', '49', '2006-02-15T10:07:09'), - ('11', '222', '2006-02-15T10:07:09'), - ('2', '703', '2006-02-15T10:07:09'), - ('7', '272', '2006-02-15T10:07:09'), - ('15', '875', '2006-02-15T10:07:09'), - ('9', '845', '2006-02-15T10:07:09'), - ('3', '356', '2006-02-15T10:07:09'), - ('14', '165', '2006-02-15T10:07:09'), - ('5', '388', '2006-02-15T10:07:09'), - ('13', '948', '2006-02-15T10:07:09'), - ('13', '155', '2006-02-15T10:07:09'), - ('4', '116', '2006-02-15T10:07:09'), - ('11', '415', '2006-02-15T10:07:09'), - ('2', '18', '2006-02-15T10:07:09'), - ('16', '224', '2006-02-15T10:07:09'), - ('14', '625', '2006-02-15T10:07:09'), - ('14', '69', '2006-02-15T10:07:09'), - ('15', '361', '2006-02-15T10:07:09'), - ('4', '633', '2006-02-15T10:07:09'), - ('16', '977', '2006-02-15T10:07:09'), - ('2', '887', '2006-02-15T10:07:09'), - ('10', '211', '2006-02-15T10:07:09'), - ('3', '505', '2006-02-15T10:07:09'), - ('8', '534', '2006-02-15T10:07:09'), - ('11', '9', '2006-02-15T10:07:09'), - ('2', '314', '2006-02-15T10:07:09'), - ('14', '798', '2006-02-15T10:07:09'), - ('15', '517', '2006-02-15T10:07:09'), - ('3', '896', '2006-02-15T10:07:09'), - ('11', '334', '2006-02-15T10:07:09'), - ('5', '443', '2006-02-15T10:07:09'), - ('12', '284', '2006-02-15T10:07:09'), - ('1', '802', '2006-02-15T10:07:09'), - ('1', '126', '2006-02-15T10:07:09'), - ('13', '144', '2006-02-15T10:07:09'), - ('6', '466', '2006-02-15T10:07:09'), - ('1', '97', '2006-02-15T10:07:09'), - ('7', '107', '2006-02-15T10:07:09'), - ('2', '901', '2006-02-15T10:07:09'), - ('1', '850', '2006-02-15T10:07:09'), - ('1', '982', '2006-02-15T10:07:09'), - ('9', '821', '2006-02-15T10:07:09'), - ('5', '638', '2006-02-15T10:07:09'), - ('2', '582', '2006-02-15T10:07:09'), - ('15', '813', '2006-02-15T10:07:09'), - ('11', '665', '2006-02-15T10:07:09'), - ('9', '661', '2006-02-15T10:07:09'), - ('15', '420', '2006-02-15T10:07:09'), - ('11', '535', '2006-02-15T10:07:09'), - ('11', '876', '2006-02-15T10:07:09'), - ('9', '435', '2006-02-15T10:07:09'), - ('2', '692', '2006-02-15T10:07:09'), - ('8', '557', '2006-02-15T10:07:09'), - ('1', '229', '2006-02-15T10:07:09'), - ('15', '598', '2006-02-15T10:07:09'), - ('9', '452', '2006-02-15T10:07:09'), - ('11', '995', '2006-02-15T10:07:09'), - ('7', '771', '2006-02-15T10:07:09'), - ('11', '870', '2006-02-15T10:07:09'), - ('14', '235', '2006-02-15T10:07:09'), - ('16', '648', '2006-02-15T10:07:09'), - ('9', '290', '2006-02-15T10:07:09'), - ('9', '128', '2006-02-15T10:07:09'), - ('3', '491', '2006-02-15T10:07:09'), - ('4', '357', '2006-02-15T10:07:09'), - ('7', '772', '2006-02-15T10:07:09'), - ('1', '19', '2006-02-15T10:07:09'), - ('9', '947', '2006-02-15T10:07:09'), - ('14', '298', '2006-02-15T10:07:09'), - ('4', '899', '2006-02-15T10:07:09'), - ('12', '877', '2006-02-15T10:07:09'), - ('6', '58', '2006-02-15T10:07:09'), - ('6', '400', '2006-02-15T10:07:09') - ) AS data(old_category_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."category"' - AND map0.old_id = data.old_category_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_category" ("category_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('14', '73', '2006-02-15T10:07:09'), - ('8', '94', '2006-02-15T10:07:09'), - ('1', '329', '2006-02-15T10:07:09'), - ('4', '484', '2006-02-15T10:07:09'), - ('1', '579', '2006-02-15T10:07:09'), - ('2', '78', '2006-02-15T10:07:09'), - ('12', '161', '2006-02-15T10:07:09'), - ('15', '898', '2006-02-15T10:07:09'), - ('16', '601', '2006-02-15T10:07:09'), - ('11', '885', '2006-02-15T10:07:09'), - ('11', '92', '2006-02-15T10:07:09'), - ('14', '863', '2006-02-15T10:07:09'), - ('13', '920', '2006-02-15T10:07:09'), - ('14', '338', '2006-02-15T10:07:09'), - ('5', '522', '2006-02-15T10:07:09'), - ('15', '681', '2006-02-15T10:07:09'), - ('6', '650', '2006-02-15T10:07:09'), - ('9', '6', '2006-02-15T10:07:09'), - ('8', '345', '2006-02-15T10:07:09'), - ('1', '664', '2006-02-15T10:07:09'), - ('12', '767', '2006-02-15T10:07:09'), - ('6', '791', '2006-02-15T10:07:09'), - ('16', '872', '2006-02-15T10:07:09'), - ('7', '396', '2006-02-15T10:07:09'), - ('4', '432', '2006-02-15T10:07:09'), - ('9', '486', '2006-02-15T10:07:09'), - ('12', '592', '2006-02-15T10:07:09'), - ('1', '21', '2006-02-15T10:07:09'), - ('11', '122', '2006-02-15T10:07:09'), - ('13', '163', '2006-02-15T10:07:09'), - ('7', '709', '2006-02-15T10:07:09'), - ('13', '847', '2006-02-15T10:07:09'), - ('4', '744', '2006-02-15T10:07:09'), - ('8', '710', '2006-02-15T10:07:09'), - ('8', '866', '2006-02-15T10:07:09'), - ('11', '277', '2006-02-15T10:07:09'), - ('14', '967', '2006-02-15T10:07:09'), - ('5', '604', '2006-02-15T10:07:09'), - ('8', '80', '2006-02-15T10:07:09'), - ('12', '718', '2006-02-15T10:07:09'), - ('14', '972', '2006-02-15T10:07:09'), - ('10', '762', '2006-02-15T10:07:09'), - ('10', '742', '2006-02-15T10:07:09'), - ('3', '864', '2006-02-15T10:07:09'), - ('3', '409', '2006-02-15T10:07:09'), - ('2', '916', '2006-02-15T10:07:09'), - ('10', '949', '2006-02-15T10:07:09'), - ('7', '882', '2006-02-15T10:07:09'), - ('7', '683', '2006-02-15T10:07:09'), - ('13', '751', '2006-02-15T10:07:09'), - ('2', '193', '2006-02-15T10:07:09'), - ('7', '775', '2006-02-15T10:07:09'), - ('8', '975', '2006-02-15T10:07:09'), - ('5', '680', '2006-02-15T10:07:09'), - ('7', '204', '2006-02-15T10:07:09'), - ('1', '56', '2006-02-15T10:07:09'), - ('15', '102', '2006-02-15T10:07:09'), - ('9', '595', '2006-02-15T10:07:09'), - ('1', '991', '2006-02-15T10:07:09'), - ('13', '580', '2006-02-15T10:07:09'), - ('9', '100', '2006-02-15T10:07:09'), - ('13', '558', '2006-02-15T10:07:09'), - ('4', '725', '2006-02-15T10:07:09'), - ('5', '756', '2006-02-15T10:07:09'), - ('16', '342', '2006-02-15T10:07:09'), - ('2', '615', '2006-02-15T10:07:09'), - ('14', '312', '2006-02-15T10:07:09'), - ('9', '15', '2006-02-15T10:07:09'), - ('11', '494', '2006-02-15T10:07:09'), - ('7', '630', '2006-02-15T10:07:09'), - ('15', '27', '2006-02-15T10:07:09'), - ('7', '827', '2006-02-15T10:07:09'), - ('9', '565', '2006-02-15T10:07:09'), - ('10', '382', '2006-02-15T10:07:09'), - ('8', '231', '2006-02-15T10:07:09'), - ('6', '587', '2006-02-15T10:07:09'), - ('12', '581', '2006-02-15T10:07:09'), - ('14', '924', '2006-02-15T10:07:09'), - ('13', '720', '2006-02-15T10:07:09'), - ('8', '262', '2006-02-15T10:07:09'), - ('8', '946', '2006-02-15T10:07:09'), - ('4', '862', '2006-02-15T10:07:09'), - ('9', '900', '2006-02-15T10:07:09'), - ('8', '682', '2006-02-15T10:07:09'), - ('6', '708', '2006-02-15T10:07:09'), - ('5', '938', '2006-02-15T10:07:09'), - ('7', '758', '2006-02-15T10:07:09'), - ('5', '265', '2006-02-15T10:07:09'), - ('13', '685', '2006-02-15T10:07:09'), - ('11', '35', '2006-02-15T10:07:09'), - ('3', '392', '2006-02-15T10:07:09'), - ('11', '804', '2006-02-15T10:07:09'), - ('4', '815', '2006-02-15T10:07:09'), - ('1', '574', '2006-02-15T10:07:09'), - ('2', '430', '2006-02-15T10:07:09'), - ('12', '721', '2006-02-15T10:07:09'), - ('7', '706', '2006-02-15T10:07:09'), - ('2', '693', '2006-02-15T10:07:09'), - ('14', '39', '2006-02-15T10:07:09'), - ('4', '196', '2006-02-15T10:07:09') - ) AS data(old_category_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."category"' - AND map0.old_id = data.old_category_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_category" ("category_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('6', '855', '2006-02-15T10:07:09'), - ('7', '179', '2006-02-15T10:07:09'), - ('12', '255', '2006-02-15T10:07:09'), - ('8', '617', '2006-02-15T10:07:09'), - ('8', '634', '2006-02-15T10:07:09'), - ('8', '83', '2006-02-15T10:07:09'), - ('16', '783', '2006-02-15T10:07:09'), - ('5', '276', '2006-02-15T10:07:09'), - ('7', '282', '2006-02-15T10:07:09'), - ('16', '784', '2006-02-15T10:07:09'), - ('16', '405', '2006-02-15T10:07:09'), - ('3', '688', '2006-02-15T10:07:09'), - ('11', '506', '2006-02-15T10:07:09'), - ('10', '842', '2006-02-15T10:07:09'), - ('9', '353', '2006-02-15T10:07:09'), - ('5', '188', '2006-02-15T10:07:09'), - ('15', '187', '2006-02-15T10:07:09'), - ('6', '164', '2006-02-15T10:07:09'), - ('4', '249', '2006-02-15T10:07:09'), - ('11', '722', '2006-02-15T10:07:09'), - ('7', '618', '2006-02-15T10:07:09'), - ('15', '729', '2006-02-15T10:07:09'), - ('4', '874', '2006-02-15T10:07:09'), - ('14', '397', '2006-02-15T10:07:09'), - ('10', '408', '2006-02-15T10:07:09'), - ('10', '861', '2006-02-15T10:07:09'), - ('6', '576', '2006-02-15T10:07:09'), - ('16', '931', '2006-02-15T10:07:09'), - ('9', '112', '2006-02-15T10:07:09'), - ('16', '496', '2006-02-15T10:07:09'), - ('10', '941', '2006-02-15T10:07:09'), - ('11', '171', '2006-02-15T10:07:09'), - ('6', '101', '2006-02-15T10:07:09'), - ('14', '114', '2006-02-15T10:07:09'), - ('9', '957', '2006-02-15T10:07:09'), - ('5', '502', '2006-02-15T10:07:09'), - ('8', '5', '2006-02-15T10:07:09'), - ('12', '987', '2006-02-15T10:07:09'), - ('14', '723', '2006-02-15T10:07:09'), - ('15', '429', '2006-02-15T10:07:09'), - ('5', '978', '2006-02-15T10:07:09'), - ('5', '178', '2006-02-15T10:07:09'), - ('7', '907', '2006-02-15T10:07:09'), - ('11', '965', '2006-02-15T10:07:09'), - ('10', '556', '2006-02-15T10:07:09'), - ('3', '852', '2006-02-15T10:07:09'), - ('11', '600', '2006-02-15T10:07:09'), - ('11', '998', '2006-02-15T10:07:09'), - ('16', '123', '2006-02-15T10:07:09'), - ('16', '914', '2006-02-15T10:07:09'), - ('13', '45', '2006-02-15T10:07:09'), - ('6', '616', '2006-02-15T10:07:09'), - ('13', '675', '2006-02-15T10:07:09'), - ('11', '749', '2006-02-15T10:07:09'), - ('7', '521', '2006-02-15T10:07:09'), - ('3', '424', '2006-02-15T10:07:09'), - ('12', '636', '2006-02-15T10:07:09'), - ('12', '76', '2006-02-15T10:07:09'), - ('10', '406', '2006-02-15T10:07:09'), - ('9', '605', '2006-02-15T10:07:09'), - ('8', '639', '2006-02-15T10:07:09'), - ('9', '311', '2006-02-15T10:07:09'), - ('11', '495', '2006-02-15T10:07:09'), - ('11', '301', '2006-02-15T10:07:09'), - ('14', '572', '2006-02-15T10:07:09'), - ('6', '150', '2006-02-15T10:07:09'), - ('2', '36', '2006-02-15T10:07:09'), - ('16', '656', '2006-02-15T10:07:09'), - ('6', '629', '2006-02-15T10:07:09'), - ('13', '226', '2006-02-15T10:07:09'), - ('15', '389', '2006-02-15T10:07:09'), - ('6', '925', '2006-02-15T10:07:09'), - ('10', '747', '2006-02-15T10:07:09'), - ('13', '77', '2006-02-15T10:07:09'), - ('7', '662', '2006-02-15T10:07:09'), - ('3', '328', '2006-02-15T10:07:09'), - ('8', '183', '2006-02-15T10:07:09'), - ('9', '459', '2006-02-15T10:07:09'), - ('9', '11', '2006-02-15T10:07:09'), - ('3', '801', '2006-02-15T10:07:09'), - ('7', '143', '2006-02-15T10:07:09'), - ('12', '244', '2006-02-15T10:07:09'), - ('7', '958', '2006-02-15T10:07:09'), - ('3', '955', '2006-02-15T10:07:09'), - ('14', '367', '2006-02-15T10:07:09'), - ('1', '253', '2006-02-15T10:07:09'), - ('4', '445', '2006-02-15T10:07:09'), - ('3', '110', '2006-02-15T10:07:09'), - ('4', '166', '2006-02-15T10:07:09'), - ('1', '194', '2006-02-15T10:07:09'), - ('8', '377', '2006-02-15T10:07:09'), - ('10', '807', '2006-02-15T10:07:09'), - ('12', '74', '2006-02-15T10:07:09'), - ('6', '412', '2006-02-15T10:07:09'), - ('3', '423', '2006-02-15T10:07:09'), - ('7', '666', '2006-02-15T10:07:09'), - ('7', '79', '2006-02-15T10:07:09'), - ('2', '154', '2006-02-15T10:07:09'), - ('11', '904', '2006-02-15T10:07:09'), - ('1', '395', '2006-02-15T10:07:09') - ) AS data(old_category_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."category"' - AND map0.old_id = data.old_category_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_category" ("category_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('1', '530', '2006-02-15T10:07:09'), - ('3', '59', '2006-02-15T10:07:09'), - ('15', '691', '2006-02-15T10:07:09'), - ('5', '317', '2006-02-15T10:07:09'), - ('10', '596', '2006-02-15T10:07:09'), - ('8', '348', '2006-02-15T10:07:09'), - ('4', '60', '2006-02-15T10:07:09'), - ('8', '479', '2006-02-15T10:07:09'), - ('9', '908', '2006-02-15T10:07:09'), - ('5', '335', '2006-02-15T10:07:09'), - ('5', '774', '2006-02-15T10:07:09'), - ('1', '838', '2006-02-15T10:07:09'), - ('16', '294', '2006-02-15T10:07:09'), - ('6', '788', '2006-02-15T10:07:09'), - ('2', '880', '2006-02-15T10:07:09'), - ('16', '903', '2006-02-15T10:07:09'), - ('8', '700', '2006-02-15T10:07:09'), - ('15', '719', '2006-02-15T10:07:09'), - ('14', '153', '2006-02-15T10:07:09'), - ('14', '44', '2006-02-15T10:07:09'), - ('11', '922', '2006-02-15T10:07:09'), - ('1', '38', '2006-02-15T10:07:09'), - ('10', '746', '2006-02-15T10:07:09'), - ('11', '716', '2006-02-15T10:07:09'), - ('14', '714', '2006-02-15T10:07:09'), - ('6', '713', '2006-02-15T10:07:09'), - ('2', '349', '2006-02-15T10:07:09'), - ('8', '53', '2006-02-15T10:07:09'), - ('9', '640', '2006-02-15T10:07:09'), - ('6', '40', '2006-02-15T10:07:09'), - ('2', '245', '2006-02-15T10:07:09'), - ('10', '302', '2006-02-15T10:07:09'), - ('9', '104', '2006-02-15T10:07:09'), - ('9', '493', '2006-02-15T10:07:09'), - ('14', '203', '2006-02-15T10:07:09'), - ('12', '673', '2006-02-15T10:07:09'), - ('5', '837', '2006-02-15T10:07:09'), - ('7', '790', '2006-02-15T10:07:09'), - ('2', '268', '2006-02-15T10:07:09'), - ('14', '151', '2006-02-15T10:07:09'), - ('1', '927', '2006-02-15T10:07:09'), - ('6', '966', '2006-02-15T10:07:09'), - ('4', '652', '2006-02-15T10:07:09'), - ('14', '140', '2006-02-15T10:07:09'), - ('15', '764', '2006-02-15T10:07:09'), - ('10', '227', '2006-02-15T10:07:09'), - ('6', '1', '2006-02-15T10:07:09'), - ('5', '202', '2006-02-15T10:07:09'), - ('15', '577', '2006-02-15T10:07:09'), - ('12', '983', '2006-02-15T10:07:09'), - ('8', '437', '2006-02-15T10:07:09'), - ('3', '66', '2006-02-15T10:07:09'), - ('4', '469', '2006-02-15T10:07:09'), - ('15', '851', '2006-02-15T10:07:09'), - ('13', '465', '2006-02-15T10:07:09'), - ('6', '295', '2006-02-15T10:07:09'), - ('2', '489', '2006-02-15T10:07:09'), - ('2', '259', '2006-02-15T10:07:09'), - ('16', '41', '2006-02-15T10:07:09'), - ('3', '149', '2006-02-15T10:07:09'), - ('3', '515', '2006-02-15T10:07:09'), - ('7', '401', '2006-02-15T10:07:09'), - ('16', '518', '2006-02-15T10:07:09'), - ('13', '561', '2006-02-15T10:07:09'), - ('16', '386', '2006-02-15T10:07:09'), - ('14', '602', '2006-02-15T10:07:09'), - ('14', '285', '2006-02-15T10:07:09'), - ('5', '28', '2006-02-15T10:07:09'), - ('16', '811', '2006-02-15T10:07:09'), - ('11', '702', '2006-02-15T10:07:09'), - ('13', '759', '2006-02-15T10:07:09'), - ('4', '694', '2006-02-15T10:07:09'), - ('3', '344', '2006-02-15T10:07:09'), - ('4', '266', '2006-02-15T10:07:09'), - ('13', '490', '2006-02-15T10:07:09'), - ('9', '440', '2006-02-15T10:07:09'), - ('3', '883', '2006-02-15T10:07:09'), - ('1', '287', '2006-02-15T10:07:09'), - ('2', '953', '2006-02-15T10:07:09'), - ('15', '383', '2006-02-15T10:07:09'), - ('1', '717', '2006-02-15T10:07:09'), - ('1', '327', '2006-02-15T10:07:09'), - ('8', '359', '2006-02-15T10:07:09'), - ('15', '237', '2006-02-15T10:07:09'), - ('2', '325', '2006-02-15T10:07:09'), - ('9', '971', '2006-02-15T10:07:09'), - ('8', '391', '2006-02-15T10:07:09'), - ('15', '263', '2006-02-15T10:07:09'), - ('16', '57', '2006-02-15T10:07:09'), - ('16', '785', '2006-02-15T10:07:09'), - ('1', '130', '2006-02-15T10:07:09'), - ('13', '750', '2006-02-15T10:07:09'), - ('10', '46', '2006-02-15T10:07:09'), - ('1', '375', '2006-02-15T10:07:09'), - ('4', '548', '2006-02-15T10:07:09'), - ('1', '911', '2006-02-15T10:07:09'), - ('9', '567', '2006-02-15T10:07:09'), - ('6', '627', '2006-02-15T10:07:09'), - ('4', '482', '2006-02-15T10:07:09'), - ('8', '476', '2006-02-15T10:07:09') - ) AS data(old_category_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."category"' - AND map0.old_id = data.old_category_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_category" ("category_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('5', '404', '2006-02-15T10:07:09'), - ('5', '906', '2006-02-15T10:07:09'), - ('2', '859', '2006-02-15T10:07:09'), - ('9', '674', '2006-02-15T10:07:09'), - ('15', '10', '2006-02-15T10:07:09'), - ('13', '481', '2006-02-15T10:07:09'), - ('7', '418', '2006-02-15T10:07:09'), - ('2', '300', '2006-02-15T10:07:09'), - ('15', '836', '2006-02-15T10:07:09'), - ('11', '881', '2006-02-15T10:07:09'), - ('4', '611', '2006-02-15T10:07:09'), - ('9', '455', '2006-02-15T10:07:09'), - ('1', '542', '2006-02-15T10:07:09'), - ('13', '933', '2006-02-15T10:07:09'), - ('3', '918', '2006-02-15T10:07:09'), - ('4', '37', '2006-02-15T10:07:09'), - ('2', '569', '2006-02-15T10:07:09'), - ('6', '712', '2006-02-15T10:07:09'), - ('8', '273', '2006-02-15T10:07:09'), - ('15', '671', '2006-02-15T10:07:09'), - ('10', '281', '2006-02-15T10:07:09'), - ('7', '910', '2006-02-15T10:07:09'), - ('13', '538', '2006-02-15T10:07:09'), - ('16', '84', '2006-02-15T10:07:09'), - ('4', '297', '2006-02-15T10:07:09'), - ('15', '256', '2006-02-15T10:07:09'), - ('8', '695', '2006-02-15T10:07:09'), - ('9', '467', '2006-02-15T10:07:09'), - ('12', '426', '2006-02-15T10:07:09'), - ('16', '472', '2006-02-15T10:07:09'), - ('11', '856', '2006-02-15T10:07:09'), - ('16', '288', '2006-02-15T10:07:09'), - ('13', '954', '2006-02-15T10:07:09'), - ('3', '833', '2006-02-15T10:07:09'), - ('11', '990', '2006-02-15T10:07:09'), - ('7', '942', '2006-02-15T10:07:09'), - ('11', '854', '2006-02-15T10:07:09'), - ('15', '631', '2006-02-15T10:07:09'), - ('16', '125', '2006-02-15T10:07:09'), - ('11', '30', '2006-02-15T10:07:09'), - ('2', '816', '2006-02-15T10:07:09'), - ('15', '135', '2006-02-15T10:07:09'), - ('15', '474', '2006-02-15T10:07:09'), - ('3', '485', '2006-02-15T10:07:09'), - ('8', '50', '2006-02-15T10:07:09'), - ('6', '552', '2006-02-15T10:07:09'), - ('13', '216', '2006-02-15T10:07:09'), - ('9', '246', '2006-02-15T10:07:09'), - ('7', '403', '2006-02-15T10:07:09'), - ('7', '173', '2006-02-15T10:07:09'), - ('15', '773', '2006-02-15T10:07:09'), - ('15', '503', '2006-02-15T10:07:09'), - ('8', '309', '2006-02-15T10:07:09'), - ('3', '928', '2006-02-15T10:07:09'), - ('8', '315', '2006-02-15T10:07:09'), - ('10', '684', '2006-02-15T10:07:09'), - ('14', '422', '2006-02-15T10:07:09'), - ('13', '93', '2006-02-15T10:07:09'), - ('3', '354', '2006-02-15T10:07:09'), - ('6', '996', '2006-02-15T10:07:09'), - ('14', '711', '2006-02-15T10:07:09'), - ('3', '124', '2006-02-15T10:07:09'), - ('6', '206', '2006-02-15T10:07:09'), - ('15', '323', '2006-02-15T10:07:09'), - ('15', '453', '2006-02-15T10:07:09'), - ('15', '279', '2006-02-15T10:07:09'), - ('1', '748', '2006-02-15T10:07:09'), - ('5', '1000', '2006-02-15T10:07:09'), - ('14', '893', '2006-02-15T10:07:09'), - ('8', '428', '2006-02-15T10:07:09'), - ('4', '970', '2006-02-15T10:07:09'), - ('6', '544', '2006-02-15T10:07:09'), - ('3', '238', '2006-02-15T10:07:09'), - ('6', '589', '2006-02-15T10:07:09'), - ('8', '498', '2006-02-15T10:07:09'), - ('6', '62', '2006-02-15T10:07:09'), - ('8', '145', '2006-02-15T10:07:09'), - ('9', '192', '2006-02-15T10:07:09'), - ('4', '537', '2006-02-15T10:07:09'), - ('16', '286', '2006-02-15T10:07:09'), - ('7', '33', '2006-02-15T10:07:09'), - ('4', '180', '2006-02-15T10:07:09'), - ('1', '968', '2006-02-15T10:07:09'), - ('15', '197', '2006-02-15T10:07:09'), - ('2', '849', '2006-02-15T10:07:09'), - ('13', '321', '2006-02-15T10:07:09'), - ('10', '840', '2006-02-15T10:07:09'), - ('13', '22', '2006-02-15T10:07:09'), - ('4', '536', '2006-02-15T10:07:09'), - ('6', '393', '2006-02-15T10:07:09'), - ('5', '159', '2006-02-15T10:07:09'), - ('3', '280', '2006-02-15T10:07:09'), - ('16', '103', '2006-02-15T10:07:09'), - ('12', '477', '2006-02-15T10:07:09'), - ('1', '303', '2006-02-15T10:07:09'), - ('9', '416', '2006-02-15T10:07:09'), - ('11', '800', '2006-02-15T10:07:09'), - ('9', '545', '2006-02-15T10:07:09'), - ('11', '351', '2006-02-15T10:07:09'), - ('7', '366', '2006-02-15T10:07:09') - ) AS data(old_category_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."category"' - AND map0.old_id = data.old_category_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - INSERT INTO "public"."film_category" ("category_id", "film_id", "last_update") - SELECT - map0.new_id::smallint, - map1.new_id::smallint, - data.last_update::timestamp without time zone - FROM (VALUES - ('12', '997', '2006-02-15T10:07:09'), - ('8', '175', '2006-02-15T10:07:09'), - ('8', '550', '2006-02-15T10:07:09'), - ('12', '54', '2006-02-15T10:07:09'), - ('16', '88', '2006-02-15T10:07:09'), - ('8', '213', '2006-02-15T10:07:09'), - ('15', '678', '2006-02-15T10:07:09'), - ('16', '339', '2006-02-15T10:07:09'), - ('2', '986', '2006-02-15T10:07:09'), - ('10', '701', '2006-02-15T10:07:09'), - ('8', '499', '2006-02-15T10:07:09'), - ('15', '782', '2006-02-15T10:07:09'), - ('1', '252', '2006-02-15T10:07:09'), - ('14', '985', '2006-02-15T10:07:09'), - ('2', '433', '2006-02-15T10:07:09'), - ('6', '776', '2006-02-15T10:07:09'), - ('13', '267', '2006-02-15T10:07:09'), - ('7', '218', '2006-02-15T10:07:09'), - ('2', '510', '2006-02-15T10:07:09'), - ('3', '214', '2006-02-15T10:07:09'), - ('7', '368', '2006-02-15T10:07:09'), - ('16', '513', '2006-02-15T10:07:09'), - ('1', '707', '2006-02-15T10:07:09'), - ('7', '379', '2006-02-15T10:07:09'), - ('6', '441', '2006-02-15T10:07:09'), - ('9', '738', '2006-02-15T10:07:09'), - ('10', '447', '2006-02-15T10:07:09'), - ('16', '299', '2006-02-15T10:07:09'), - ('14', '132', '2006-02-15T10:07:09'), - ('6', '407', '2006-02-15T10:07:09'), - ('12', '51', '2006-02-15T10:07:09'), - ('12', '20', '2006-02-15T10:07:09'), - ('4', '525', '2006-02-15T10:07:09'), - ('4', '828', '2006-02-15T10:07:09'), - ('10', '560', '2006-02-15T10:07:09'), - ('3', '157', '2006-02-15T10:07:09'), - ('14', '195', '2006-02-15T10:07:09'), - ('16', '434', '2006-02-15T10:07:09'), - ('2', '208', '2006-02-15T10:07:09'), - ('15', '628', '2006-02-15T10:07:09'), - ('14', '559', '2006-02-15T10:07:09'), - ('3', '573', '2006-02-15T10:07:09'), - ('14', '319', '2006-02-15T10:07:09'), - ('5', '660', '2006-02-15T10:07:09'), - ('6', '156', '2006-02-15T10:07:09'), - ('1', '417', '2006-02-15T10:07:09'), - ('16', '848', '2006-02-15T10:07:09'), - ('7', '739', '2006-02-15T10:07:09'), - ('5', '324', '2006-02-15T10:07:09'), - ('16', '181', '2006-02-15T10:07:09'), - ('10', '438', '2006-02-15T10:07:09'), - ('9', '584', '2006-02-15T10:07:09'), - ('11', '13', '2006-02-15T10:07:09'), - ('5', '765', '2006-02-15T10:07:09'), - ('11', '475', '2006-02-15T10:07:09'), - ('13', '913', '2006-02-15T10:07:09'), - ('14', '831', '2006-02-15T10:07:09'), - ('1', '210', '2006-02-15T10:07:09'), - ('5', '657', '2006-02-15T10:07:09'), - ('13', '935', '2006-02-15T10:07:09'), - ('13', '320', '2006-02-15T10:07:09'), - ('10', '646', '2006-02-15T10:07:09'), - ('2', '241', '2006-02-15T10:07:09'), - ('9', '533', '2006-02-15T10:07:09'), - ('5', '529', '2006-02-15T10:07:09'), - ('14', '240', '2006-02-15T10:07:09'), - ('15', '676', '2006-02-15T10:07:09'), - ('12', '884', '2006-02-15T10:07:09'), - ('5', '857', '2006-02-15T10:07:09'), - ('5', '127', '2006-02-15T10:07:09'), - ('1', '964', '2006-02-15T10:07:09'), - ('2', '696', '2006-02-15T10:07:09'), - ('9', '929', '2006-02-15T10:07:09'), - ('15', '902', '2006-02-15T10:07:09'), - ('9', '705', '2006-02-15T10:07:09'), - ('4', '425', '2006-02-15T10:07:09'), - ('7', '539', '2006-02-15T10:07:09'), - ('10', '591', '2006-02-15T10:07:09'), - ('13', '448', '2006-02-15T10:07:09'), - ('12', '540', '2006-02-15T10:07:09'), - ('12', '384', '2006-02-15T10:07:09'), - ('13', '289', '2006-02-15T10:07:09'), - ('7', '439', '2006-02-15T10:07:09'), - ('3', '191', '2006-02-15T10:07:09'), - ('13', '96', '2006-02-15T10:07:09'), - ('3', '304', '2006-02-15T10:07:09'), - ('9', '376', '2006-02-15T10:07:09'), - ('12', '936', '2006-02-15T10:07:09'), - ('11', '4', '2006-02-15T10:07:09'), - ('9', '984', '2006-02-15T10:07:09'), - ('6', '497', '2006-02-15T10:07:09'), - ('15', '777', '2006-02-15T10:07:09'), - ('12', '220', '2006-02-15T10:07:09'), - ('13', '994', '2006-02-15T10:07:09'), - ('9', '185', '2006-02-15T10:07:09'), - ('7', '172', '2006-02-15T10:07:09'), - ('3', '547', '2006-02-15T10:07:09'), - ('10', '835', '2006-02-15T10:07:09'), - ('1', '594', '2006-02-15T10:07:09'), - ('12', '133', '2006-02-15T10:07:09') - ) AS data(old_category_id, old_film_id, last_update) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."category"' - AND map0.old_id = data.old_category_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."film"' - AND map1.old_id = data.old_film_id; - - -- Table: "public"."customer" (599 records) - v_old_ids_customer := ARRAY['340', '520', '523', '199', '472', '532', '579', '497', '477', '556', '85', '512', '252', '142', '583', '16', '491', '559', '233', '423', '134', '119', '65', '464', '515', '45', '9', '498', '535', '452', '292', '98', '394', '52', '469', '293', '549', '597', '565', '304', '122', '234', '480', '172', '124', '143', '278', '566', '483', '366', '164', '13', '204', '518', '493', '507', '327', '38', '539', '453', '111', '568', '113', '290', '174', '282', '360', '553', '7', '562', '18', '280', '250', '277', '286', '156', '284', '409', '103', '198', '80', '232', '26', '220', '190', '481', '592', '180', '490', '120', '460', '87', '235', '317', '347', '23', '584', '408', '66', '223']; - WITH inserted AS ( - INSERT INTO "public"."customer" ("active", "activebool", "address_id", "create_date", "email", "first_name", "last_name", "last_update", "store_id") - SELECT - data.active::integer, - data.activebool::boolean, - map0.new_id::smallint, - data.create_date::date, - data.email::character varying, - data.first_name::character varying, - data.last_name::character varying, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - (1, TRUE, '345', '2006-02-14', 'patrick.newsom@sakilacustomer.org', 'Patrick', 'Newsom', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '526', '2006-02-14', 'mitchell.westmoreland@sakilacustomer.org', 'Mitchell', 'Westmoreland', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '529', '2006-02-14', 'harvey.guajardo@sakilacustomer.org', 'Harvey', 'Guajardo', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '203', '2006-02-14', 'beth.franklin@sakilacustomer.org', 'Beth', 'Franklin', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '477', '2006-02-14', 'greg.robins@sakilacustomer.org', 'Greg', 'Robins', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '538', '2006-02-14', 'neil.renner@sakilacustomer.org', 'Neil', 'Renner', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '585', '2006-02-14', 'daryl.larue@sakilacustomer.org', 'Daryl', 'Larue', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '502', '2006-02-14', 'gilbert.sledge@sakilacustomer.org', 'Gilbert', 'Sledge', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '482', '2006-02-14', 'dan.paine@sakilacustomer.org', 'Dan', 'Paine', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '562', '2006-02-14', 'armando.gruber@sakilacustomer.org', 'Armando', 'Gruber', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '89', '2006-02-14', 'anne.powell@sakilacustomer.org', 'Anne', 'Powell', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '517', '2006-02-14', 'cecil.vines@sakilacustomer.org', 'Cecil', 'Vines', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '256', '2006-02-14', 'mattie.hoffman@sakilacustomer.org', 'Mattie', 'Hoffman', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '146', '2006-02-14', 'april.burns@sakilacustomer.org', 'April', 'Burns', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '589', '2006-02-14', 'marshall.thorn@sakilacustomer.org', 'Marshall', 'Thorn', '2013-05-26T14:49:45.738000', 1), - (0, TRUE, '20', '2006-02-14', 'sandra.martin@sakilacustomer.org', 'Sandra', 'Martin', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '496', '2006-02-14', 'rick.mattox@sakilacustomer.org', 'Rick', 'Mattox', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '565', '2006-02-14', 'everett.banda@sakilacustomer.org', 'Everett', 'Banda', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '237', '2006-02-14', 'lillie.kim@sakilacustomer.org', 'Lillie', 'Kim', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '428', '2006-02-14', 'alfred.casillas@sakilacustomer.org', 'Alfred', 'Casillas', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '138', '2006-02-14', 'emma.boyd@sakilacustomer.org', 'Emma', 'Boyd', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '123', '2006-02-14', 'sherry.marshall@sakilacustomer.org', 'Sherry', 'Marshall', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '69', '2006-02-14', 'rose.howard@sakilacustomer.org', 'Rose', 'Howard', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '469', '2006-02-14', 'jerome.kenyon@sakilacustomer.org', 'Jerome', 'Kenyon', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '521', '2006-02-14', 'andre.rapp@sakilacustomer.org', 'Andre', 'Rapp', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '49', '2006-02-14', 'janet.phillips@sakilacustomer.org', 'Janet', 'Phillips', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '13', '2006-02-14', 'margaret.moore@sakilacustomer.org', 'Margaret', 'Moore', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '503', '2006-02-14', 'gene.sanborn@sakilacustomer.org', 'Gene', 'Sanborn', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '541', '2006-02-14', 'javier.elrod@sakilacustomer.org', 'Javier', 'Elrod', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '457', '2006-02-14', 'tom.milner@sakilacustomer.org', 'Tom', 'Milner', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '297', '2006-02-14', 'misty.lambert@sakilacustomer.org', 'Misty', 'Lambert', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '102', '2006-02-14', 'lillian.griffin@sakilacustomer.org', 'Lillian', 'Griffin', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '399', '2006-02-14', 'chris.brothers@sakilacustomer.org', 'Chris', 'Brothers', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '56', '2006-02-14', 'julie.sanchez@sakilacustomer.org', 'Julie', 'Sanchez', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '474', '2006-02-14', 'wesley.bull@sakilacustomer.org', 'Wesley', 'Bull', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '298', '2006-02-14', 'mae.fletcher@sakilacustomer.org', 'Mae', 'Fletcher', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '555', '2006-02-14', 'nelson.christenson@sakilacustomer.org', 'Nelson', 'Christenson', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '603', '2006-02-14', 'freddie.duggan@sakilacustomer.org', 'Freddie', 'Duggan', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '571', '2006-02-14', 'jaime.nettles@sakilacustomer.org', 'Jaime', 'Nettles', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '309', '2006-02-14', 'david.royal@sakilacustomer.org', 'David', 'Royal', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '126', '2006-02-14', 'thelma.murray@sakilacustomer.org', 'Thelma', 'Murray', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '238', '2006-02-14', 'claudia.fuller@sakilacustomer.org', 'Claudia', 'Fuller', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '485', '2006-02-14', 'corey.hauser@sakilacustomer.org', 'Corey', 'Hauser', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '176', '2006-02-14', 'bernice.willis@sakilacustomer.org', 'Bernice', 'Willis', '2013-05-26T14:49:45.738000', 1), - (0, TRUE, '128', '2006-02-14', 'sheila.wells@sakilacustomer.org', 'Sheila', 'Wells', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '147', '2006-02-14', 'leslie.gordon@sakilacustomer.org', 'Leslie', 'Gordon', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '283', '2006-02-14', 'billie.horton@sakilacustomer.org', 'Billie', 'Horton', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '572', '2006-02-14', 'casey.mena@sakilacustomer.org', 'Casey', 'Mena', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '488', '2006-02-14', 'vernon.chapa@sakilacustomer.org', 'Vernon', 'Chapa', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '371', '2006-02-14', 'brandon.huey@sakilacustomer.org', 'Brandon', 'Huey', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '168', '2006-02-14', 'joann.gardner@sakilacustomer.org', 'Joann', 'Gardner', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '17', '2006-02-14', 'karen.jackson@sakilacustomer.org', 'Karen', 'Jackson', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '208', '2006-02-14', 'rosemary.schmidt@sakilacustomer.org', 'Rosemary', 'Schmidt', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '524', '2006-02-14', 'gabriel.harder@sakilacustomer.org', 'Gabriel', 'Harder', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '498', '2006-02-14', 'brent.harkins@sakilacustomer.org', 'Brent', 'Harkins', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '512', '2006-02-14', 'edgar.rhoads@sakilacustomer.org', 'Edgar', 'Rhoads', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '332', '2006-02-14', 'larry.thrasher@sakilacustomer.org', 'Larry', 'Thrasher', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '42', '2006-02-14', 'martha.gonzalez@sakilacustomer.org', 'Martha', 'Gonzalez', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '545', '2006-02-14', 'mathew.bolin@sakilacustomer.org', 'Mathew', 'Bolin', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '458', '2006-02-14', 'calvin.martel@sakilacustomer.org', 'Calvin', 'Martel', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '115', '2006-02-14', 'carmen.owens@sakilacustomer.org', 'Carmen', 'Owens', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '574', '2006-02-14', 'alberto.henning@sakilacustomer.org', 'Alberto', 'Henning', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '117', '2006-02-14', 'cindy.fisher@sakilacustomer.org', 'Cindy', 'Fisher', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '295', '2006-02-14', 'kristina.chambers@sakilacustomer.org', 'Kristina', 'Chambers', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '178', '2006-02-14', 'yvonne.watkins@sakilacustomer.org', 'Yvonne', 'Watkins', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '287', '2006-02-14', 'jenny.castro@sakilacustomer.org', 'Jenny', 'Castro', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '365', '2006-02-14', 'ralph.madrigal@sakilacustomer.org', 'Ralph', 'Madrigal', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '559', '2006-02-14', 'max.pitt@sakilacustomer.org', 'Max', 'Pitt', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '11', '2006-02-14', 'maria.miller@sakilacustomer.org', 'Maria', 'Miller', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '568', '2006-02-14', 'wallace.slone@sakilacustomer.org', 'Wallace', 'Slone', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '22', '2006-02-14', 'carol.garcia@sakilacustomer.org', 'Carol', 'Garcia', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '285', '2006-02-14', 'tracey.barrett@sakilacustomer.org', 'Tracey', 'Barrett', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '254', '2006-02-14', 'jo.fowler@sakilacustomer.org', 'Jo', 'Fowler', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '282', '2006-02-14', 'olga.jimenez@sakilacustomer.org', 'Olga', 'Jimenez', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '291', '2006-02-14', 'velma.lucas@sakilacustomer.org', 'Velma', 'Lucas', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '160', '2006-02-14', 'bertha.ferguson@sakilacustomer.org', 'Bertha', 'Ferguson', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '289', '2006-02-14', 'sonia.gregory@sakilacustomer.org', 'Sonia', 'Gregory', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '414', '2006-02-14', 'rodney.moeller@sakilacustomer.org', 'Rodney', 'Moeller', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '107', '2006-02-14', 'gladys.hamilton@sakilacustomer.org', 'Gladys', 'Hamilton', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '202', '2006-02-14', 'elsie.kelley@sakilacustomer.org', 'Elsie', 'Kelley', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '84', '2006-02-14', 'marilyn.ross@sakilacustomer.org', 'Marilyn', 'Ross', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '236', '2006-02-14', 'constance.reid@sakilacustomer.org', 'Constance', 'Reid', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '30', '2006-02-14', 'jessica.hall@sakilacustomer.org', 'Jessica', 'Hall', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '224', '2006-02-14', 'charlene.alvarez@sakilacustomer.org', 'Charlene', 'Alvarez', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '194', '2006-02-14', 'yolanda.weaver@sakilacustomer.org', 'Yolanda', 'Weaver', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '486', '2006-02-14', 'herman.devore@sakilacustomer.org', 'Herman', 'Devore', '2013-05-26T14:49:45.738000', 1), - (0, TRUE, '598', '2006-02-14', 'terrance.roush@sakilacustomer.org', 'Terrance', 'Roush', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '184', '2006-02-14', 'stacy.cunningham@sakilacustomer.org', 'Stacy', 'Cunningham', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '495', '2006-02-14', 'sam.mcduffie@sakilacustomer.org', 'Sam', 'Mcduffie', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '124', '2006-02-14', 'sylvia.ortiz@sakilacustomer.org', 'Sylvia', 'Ortiz', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '465', '2006-02-14', 'leon.bostic@sakilacustomer.org', 'Leon', 'Bostic', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '91', '2006-02-14', 'wanda.patterson@sakilacustomer.org', 'Wanda', 'Patterson', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '239', '2006-02-14', 'jackie.lynch@sakilacustomer.org', 'Jackie', 'Lynch', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '322', '2006-02-14', 'edward.baugh@sakilacustomer.org', 'Edward', 'Baugh', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '352', '2006-02-14', 'ryan.salisbury@sakilacustomer.org', 'Ryan', 'Salisbury', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '27', '2006-02-14', 'sarah.lewis@sakilacustomer.org', 'Sarah', 'Lewis', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '590', '2006-02-14', 'salvador.teel@sakilacustomer.org', 'Salvador', 'Teel', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '413', '2006-02-14', 'manuel.murrell@sakilacustomer.org', 'Manuel', 'Murrell', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '70', '2006-02-14', 'janice.ward@sakilacustomer.org', 'Janice', 'Ward', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '227', '2006-02-14', 'melinda.fernandez@sakilacustomer.org', 'Melinda', 'Fernandez', '2013-05-26T14:49:45.738000', 1) - ) AS data(active, activebool, old_address_id, create_date, email, first_name, last_name, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."address"' - AND map0.old_id = data.old_address_id - RETURNING customer_id - ) - SELECT array_agg(customer_id) INTO v_new_ids_customer FROM inserted; - - FOR i IN 1..array_length(v_new_ids_customer, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."customer"', v_old_ids_customer[i], v_new_ids_customer[i]::TEXT); - END LOOP; - - v_old_ids_customer := ARRAY['399', '25', '416', '20', '383', '528', '155', '598', '61', '587', '319', '454', '451', '575', '488', '570', '578', '482', '353', '133', '343', '115', '582', '108', '425', '581', '369', '84', '323', '465', '364', '247', '414', '150', '273', '288', '486', '467', '177', '230', '563', '444', '320', '459', '449', '368', '10', '36', '185', '279', '377', '265', '41', '321', '22', '543', '40', '49', '101', '70', '417', '312', '104', '402', '162', '35', '57', '540', '215', '352', '361', '527', '144', '91', '392', '326', '345', '226', '205', '576', '75', '348', '586', '30', '517', '139', '5', '73', '577', '585', '24', '405', '107', '530', '359', '445', '331', '322', '243', '560']; - WITH inserted AS ( - INSERT INTO "public"."customer" ("active", "activebool", "address_id", "create_date", "email", "first_name", "last_name", "last_update", "store_id") - SELECT - data.active::integer, - data.activebool::boolean, - map0.new_id::smallint, - data.create_date::date, - data.email::character varying, - data.first_name::character varying, - data.last_name::character varying, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - (1, TRUE, '404', '2006-02-14', 'danny.isom@sakilacustomer.org', 'Danny', 'Isom', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '29', '2006-02-14', 'deborah.walker@sakilacustomer.org', 'Deborah', 'Walker', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '421', '2006-02-14', 'jeffery.pinson@sakilacustomer.org', 'Jeffery', 'Pinson', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '24', '2006-02-14', 'sharon.robinson@sakilacustomer.org', 'Sharon', 'Robinson', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '388', '2006-02-14', 'martin.bales@sakilacustomer.org', 'Martin', 'Bales', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '534', '2006-02-14', 'claude.herzog@sakilacustomer.org', 'Claude', 'Herzog', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '159', '2006-02-14', 'gail.knight@sakilacustomer.org', 'Gail', 'Knight', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '604', '2006-02-14', 'wade.delvalle@sakilacustomer.org', 'Wade', 'Delvalle', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '65', '2006-02-14', 'katherine.rivera@sakilacustomer.org', 'Katherine', 'Rivera', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '593', '2006-02-14', 'sergio.stanfield@sakilacustomer.org', 'Sergio', 'Stanfield', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '324', '2006-02-14', 'ronald.weiner@sakilacustomer.org', 'Ronald', 'Weiner', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '459', '2006-02-14', 'alex.gresham@sakilacustomer.org', 'Alex', 'Gresham', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '456', '2006-02-14', 'jim.rea@sakilacustomer.org', 'Jim', 'Rea', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '581', '2006-02-14', 'isaac.oglesby@sakilacustomer.org', 'Isaac', 'Oglesby', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '493', '2006-02-14', 'shane.millard@sakilacustomer.org', 'Shane', 'Millard', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '576', '2006-02-14', 'ivan.cromwell@sakilacustomer.org', 'Ivan', 'Cromwell', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '584', '2006-02-14', 'willard.lumpkin@sakilacustomer.org', 'Willard', 'Lumpkin', '2013-05-26T14:49:45.738000', 2), - (0, TRUE, '487', '2006-02-14', 'maurice.crawley@sakilacustomer.org', 'Maurice', 'Crawley', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '358', '2006-02-14', 'jonathan.scarborough@sakilacustomer.org', 'Jonathan', 'Scarborough', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '137', '2006-02-14', 'pauline.henry@sakilacustomer.org', 'Pauline', 'Henry', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '348', '2006-02-14', 'douglas.graf@sakilacustomer.org', 'Douglas', 'Graf', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '119', '2006-02-14', 'wendy.harrison@sakilacustomer.org', 'Wendy', 'Harrison', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '588', '2006-02-14', 'andy.vanhorn@sakilacustomer.org', 'Andy', 'Vanhorn', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '112', '2006-02-14', 'tracy.cole@sakilacustomer.org', 'Tracy', 'Cole', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '430', '2006-02-14', 'francis.sikes@sakilacustomer.org', 'Francis', 'Sikes', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '587', '2006-02-14', 'virgil.wofford@sakilacustomer.org', 'Virgil', 'Wofford', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '374', '2006-02-14', 'fred.wheat@sakilacustomer.org', 'Fred', 'Wheat', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '88', '2006-02-14', 'sara.perry@sakilacustomer.org', 'Sara', 'Perry', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '328', '2006-02-14', 'matthew.mahan@sakilacustomer.org', 'Matthew', 'Mahan', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '470', '2006-02-14', 'floyd.gandy@sakilacustomer.org', 'Floyd', 'Gandy', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '369', '2006-02-14', 'benjamin.varney@sakilacustomer.org', 'Benjamin', 'Varney', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '251', '2006-02-14', 'stella.moreno@sakilacustomer.org', 'Stella', 'Moreno', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '419', '2006-02-14', 'vincent.ralston@sakilacustomer.org', 'Vincent', 'Ralston', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '154', '2006-02-14', 'danielle.daniels@sakilacustomer.org', 'Danielle', 'Daniels', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '278', '2006-02-14', 'priscilla.lowe@sakilacustomer.org', 'Priscilla', 'Lowe', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '293', '2006-02-14', 'bobbie.craig@sakilacustomer.org', 'Bobbie', 'Craig', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '491', '2006-02-14', 'glen.talbert@sakilacustomer.org', 'Glen', 'Talbert', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '472', '2006-02-14', 'alvin.deloach@sakilacustomer.org', 'Alvin', 'Deloach', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '181', '2006-02-14', 'samantha.duncan@sakilacustomer.org', 'Samantha', 'Duncan', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '234', '2006-02-14', 'joy.george@sakilacustomer.org', 'Joy', 'George', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '569', '2006-02-14', 'ken.prewitt@sakilacustomer.org', 'Ken', 'Prewitt', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '449', '2006-02-14', 'marcus.hidalgo@sakilacustomer.org', 'Marcus', 'Hidalgo', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '325', '2006-02-14', 'anthony.schwab@sakilacustomer.org', 'Anthony', 'Schwab', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '464', '2006-02-14', 'tommy.collazo@sakilacustomer.org', 'Tommy', 'Collazo', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '454', '2006-02-14', 'oscar.aquino@sakilacustomer.org', 'Oscar', 'Aquino', '2013-05-26T14:49:45.738000', 2), - (0, TRUE, '373', '2006-02-14', 'harry.arce@sakilacustomer.org', 'Harry', 'Arce', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '14', '2006-02-14', 'dorothy.taylor@sakilacustomer.org', 'Dorothy', 'Taylor', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '40', '2006-02-14', 'kathleen.adams@sakilacustomer.org', 'Kathleen', 'Adams', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '189', '2006-02-14', 'roberta.harper@sakilacustomer.org', 'Roberta', 'Harper', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '284', '2006-02-14', 'dianne.shelton@sakilacustomer.org', 'Dianne', 'Shelton', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '382', '2006-02-14', 'howard.fortner@sakilacustomer.org', 'Howard', 'Fortner', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '270', '2006-02-14', 'jennie.terry@sakilacustomer.org', 'Jennie', 'Terry', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '45', '2006-02-14', 'stephanie.mitchell@sakilacustomer.org', 'Stephanie', 'Mitchell', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '326', '2006-02-14', 'kevin.schuler@sakilacustomer.org', 'Kevin', 'Schuler', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '26', '2006-02-14', 'laura.rodriguez@sakilacustomer.org', 'Laura', 'Rodriguez', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '549', '2006-02-14', 'lance.pemberton@sakilacustomer.org', 'Lance', 'Pemberton', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '44', '2006-02-14', 'amanda.carter@sakilacustomer.org', 'Amanda', 'Carter', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '53', '2006-02-14', 'joyce.edwards@sakilacustomer.org', 'Joyce', 'Edwards', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '105', '2006-02-14', 'peggy.myers@sakilacustomer.org', 'Peggy', 'Myers', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '74', '2006-02-14', 'christina.ramirez@sakilacustomer.org', 'Christina', 'Ramirez', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '422', '2006-02-14', 'travis.estep@sakilacustomer.org', 'Travis', 'Estep', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '317', '2006-02-14', 'mark.rinehart@sakilacustomer.org', 'Mark', 'Rinehart', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '108', '2006-02-14', 'rita.graham@sakilacustomer.org', 'Rita', 'Graham', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '407', '2006-02-14', 'luis.yanez@sakilacustomer.org', 'Luis', 'Yanez', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '166', '2006-02-14', 'lauren.hudson@sakilacustomer.org', 'Lauren', 'Hudson', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '39', '2006-02-14', 'virginia.green@sakilacustomer.org', 'Virginia', 'Green', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '61', '2006-02-14', 'evelyn.morgan@sakilacustomer.org', 'Evelyn', 'Morgan', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '546', '2006-02-14', 'tyrone.asher@sakilacustomer.org', 'Tyrone', 'Asher', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '219', '2006-02-14', 'jessie.banks@sakilacustomer.org', 'Jessie', 'Banks', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '357', '2006-02-14', 'albert.crouse@sakilacustomer.org', 'Albert', 'Crouse', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '366', '2006-02-14', 'lawrence.lawton@sakilacustomer.org', 'Lawrence', 'Lawton', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '533', '2006-02-14', 'cory.meehan@sakilacustomer.org', 'Cory', 'Meehan', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '148', '2006-02-14', 'clara.shaw@sakilacustomer.org', 'Clara', 'Shaw', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '95', '2006-02-14', 'lois.butler@sakilacustomer.org', 'Lois', 'Butler', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '397', '2006-02-14', 'sean.douglass@sakilacustomer.org', 'Sean', 'Douglass', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '331', '2006-02-14', 'jose.andrew@sakilacustomer.org', 'Jose', 'Andrew', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '350', '2006-02-14', 'carl.artis@sakilacustomer.org', 'Carl', 'Artis', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '230', '2006-02-14', 'maureen.little@sakilacustomer.org', 'Maureen', 'Little', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '209', '2006-02-14', 'eileen.carr@sakilacustomer.org', 'Eileen', 'Carr', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '582', '2006-02-14', 'morris.mccarter@sakilacustomer.org', 'Morris', 'Mccarter', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '79', '2006-02-14', 'tammy.sanders@sakilacustomer.org', 'Tammy', 'Sanders', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '353', '2006-02-14', 'roger.quintanilla@sakilacustomer.org', 'Roger', 'Quintanilla', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '592', '2006-02-14', 'kirk.stclair@sakilacustomer.org', 'Kirk', 'Stclair', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '34', '2006-02-14', 'melissa.king@sakilacustomer.org', 'Melissa', 'King', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '523', '2006-02-14', 'brad.mccurdy@sakilacustomer.org', 'Brad', 'Mccurdy', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '143', '2006-02-14', 'amber.dixon@sakilacustomer.org', 'Amber', 'Dixon', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '9', '2006-02-14', 'elizabeth.brown@sakilacustomer.org', 'Elizabeth', 'Brown', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '77', '2006-02-14', 'beverly.brooks@sakilacustomer.org', 'Beverly', 'Brooks', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '583', '2006-02-14', 'clifton.malcolm@sakilacustomer.org', 'Clifton', 'Malcolm', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '591', '2006-02-14', 'perry.swafford@sakilacustomer.org', 'Perry', 'Swafford', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '28', '2006-02-14', 'kimberly.lee@sakilacustomer.org', 'Kimberly', 'Lee', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '410', '2006-02-14', 'leonard.schofield@sakilacustomer.org', 'Leonard', 'Schofield', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '111', '2006-02-14', 'florence.woods@sakilacustomer.org', 'Florence', 'Woods', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '536', '2006-02-14', 'darryl.ashcraft@sakilacustomer.org', 'Darryl', 'Ashcraft', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '364', '2006-02-14', 'willie.markham@sakilacustomer.org', 'Willie', 'Markham', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '450', '2006-02-14', 'micheal.forman@sakilacustomer.org', 'Micheal', 'Forman', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '336', '2006-02-14', 'eric.robert@sakilacustomer.org', 'Eric', 'Robert', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '327', '2006-02-14', 'jason.morrissey@sakilacustomer.org', 'Jason', 'Morrissey', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '247', '2006-02-14', 'lydia.burke@sakilacustomer.org', 'Lydia', 'Burke', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '566', '2006-02-14', 'jordan.archuleta@sakilacustomer.org', 'Jordan', 'Archuleta', '2013-05-26T14:49:45.738000', 1) - ) AS data(active, activebool, old_address_id, create_date, email, first_name, last_name, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."address"' - AND map0.old_id = data.old_address_id - RETURNING customer_id - ) - SELECT array_agg(customer_id) INTO v_new_ids_customer FROM inserted; - - FOR i IN 1..array_length(v_new_ids_customer, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."customer"', v_old_ids_customer[i], v_new_ids_customer[i]::TEXT); - END LOOP; - - v_old_ids_customer := ARRAY['219', '89', '305', '276', '308', '537', '330', '561', '182', '140', '212', '269', '2', '181', '457', '400', '214', '112', '146', '504', '291', '14', '158', '593', '294', '479', '382', '62', '275', '149', '248', '63', '51', '420', '6', '118', '526', '96', '555', '109', '125', '432', '145', '407', '19', '83', '132', '471', '338', '8', '589', '262', '494', '166', '470', '210', '303', '213', '207', '557', '306', '171', '58', '463', '410', '476', '189', '436', '266', '173', '159', '102', '315', '161', '478', '390', '42', '86', '227', '448', '251', '201', '114', '195', '196', '289', '339', '495', '211', '514', '272', '496', '302', '110', '93', '249', '154', '588', '37', '422']; - WITH inserted AS ( - INSERT INTO "public"."customer" ("active", "activebool", "address_id", "create_date", "email", "first_name", "last_name", "last_update", "store_id") - SELECT - data.active::integer, - data.activebool::boolean, - map0.new_id::smallint, - data.create_date::date, - data.email::character varying, - data.first_name::character varying, - data.last_name::character varying, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - (1, TRUE, '223', '2006-02-14', 'willie.howell@sakilacustomer.org', 'Willie', 'Howell', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '93', '2006-02-14', 'julia.flores@sakilacustomer.org', 'Julia', 'Flores', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '310', '2006-02-14', 'richard.mccrary@sakilacustomer.org', 'Richard', 'Mccrary', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '281', '2006-02-14', 'brandy.graves@sakilacustomer.org', 'Brandy', 'Graves', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '313', '2006-02-14', 'thomas.grigsby@sakilacustomer.org', 'Thomas', 'Grigsby', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '543', '2006-02-14', 'clinton.buford@sakilacustomer.org', 'Clinton', 'Buford', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '335', '2006-02-14', 'scott.shelley@sakilacustomer.org', 'Scott', 'Shelley', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '567', '2006-02-14', 'ian.still@sakilacustomer.org', 'Ian', 'Still', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '186', '2006-02-14', 'renee.lane@sakilacustomer.org', 'Renee', 'Lane', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '144', '2006-02-14', 'eva.ramos@sakilacustomer.org', 'Eva', 'Ramos', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '216', '2006-02-14', 'wilma.richards@sakilacustomer.org', 'Wilma', 'Richards', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '274', '2006-02-14', 'cassandra.walters@sakilacustomer.org', 'Cassandra', 'Walters', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '6', '2006-02-14', 'patricia.johnson@sakilacustomer.org', 'Patricia', 'Johnson', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '185', '2006-02-14', 'ana.bradley@sakilacustomer.org', 'Ana', 'Bradley', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '462', '2006-02-14', 'bill.gavin@sakilacustomer.org', 'Bill', 'Gavin', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '405', '2006-02-14', 'bryan.hardison@sakilacustomer.org', 'Bryan', 'Hardison', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '218', '2006-02-14', 'kristin.johnston@sakilacustomer.org', 'Kristin', 'Johnston', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '116', '2006-02-14', 'rosa.reynolds@sakilacustomer.org', 'Rosa', 'Reynolds', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '150', '2006-02-14', 'jamie.rice@sakilacustomer.org', 'Jamie', 'Rice', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '509', '2006-02-14', 'nathaniel.adam@sakilacustomer.org', 'Nathaniel', 'Adam', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '296', '2006-02-14', 'toni.holt@sakilacustomer.org', 'Toni', 'Holt', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '18', '2006-02-14', 'betty.white@sakilacustomer.org', 'Betty', 'White', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '162', '2006-02-14', 'veronica.stone@sakilacustomer.org', 'Veronica', 'Stone', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '599', '2006-02-14', 'rene.mcalister@sakilacustomer.org', 'Rene', 'Mcalister', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '299', '2006-02-14', 'shelly.watts@sakilacustomer.org', 'Shelly', 'Watts', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '484', '2006-02-14', 'zachary.hite@sakilacustomer.org', 'Zachary', 'Hite', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '387', '2006-02-14', 'victor.barkley@sakilacustomer.org', 'Victor', 'Barkley', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '66', '2006-02-14', 'joan.cooper@sakilacustomer.org', 'Joan', 'Cooper', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '280', '2006-02-14', 'carole.barnett@sakilacustomer.org', 'Carole', 'Barnett', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '153', '2006-02-14', 'valerie.black@sakilacustomer.org', 'Valerie', 'Black', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '252', '2006-02-14', 'caroline.bowman@sakilacustomer.org', 'Caroline', 'Bowman', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '67', '2006-02-14', 'ashley.richardson@sakilacustomer.org', 'Ashley', 'Richardson', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '55', '2006-02-14', 'alice.stewart@sakilacustomer.org', 'Alice', 'Stewart', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '425', '2006-02-14', 'jacob.lance@sakilacustomer.org', 'Jacob', 'Lance', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '10', '2006-02-14', 'jennifer.davis@sakilacustomer.org', 'Jennifer', 'Davis', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '122', '2006-02-14', 'kim.cruz@sakilacustomer.org', 'Kim', 'Cruz', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '532', '2006-02-14', 'karl.seal@sakilacustomer.org', 'Karl', 'Seal', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '100', '2006-02-14', 'diana.alexander@sakilacustomer.org', 'Diana', 'Alexander', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '561', '2006-02-14', 'dwight.lombardi@sakilacustomer.org', 'Dwight', 'Lombardi', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '113', '2006-02-14', 'edna.west@sakilacustomer.org', 'Edna', 'West', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '129', '2006-02-14', 'ethel.webb@sakilacustomer.org', 'Ethel', 'Webb', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '437', '2006-02-14', 'edwin.burk@sakilacustomer.org', 'Edwin', 'Burk', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '149', '2006-02-14', 'lucille.holmes@sakilacustomer.org', 'Lucille', 'Holmes', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '412', '2006-02-14', 'dale.ratcliff@sakilacustomer.org', 'Dale', 'Ratcliff', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '23', '2006-02-14', 'ruth.martinez@sakilacustomer.org', 'Ruth', 'Martinez', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '87', '2006-02-14', 'louise.jenkins@sakilacustomer.org', 'Louise', 'Jenkins', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '136', '2006-02-14', 'esther.crawford@sakilacustomer.org', 'Esther', 'Crawford', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '476', '2006-02-14', 'dean.sauer@sakilacustomer.org', 'Dean', 'Sauer', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '343', '2006-02-14', 'dennis.gilman@sakilacustomer.org', 'Dennis', 'Gilman', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '12', '2006-02-14', 'susan.wilson@sakilacustomer.org', 'Susan', 'Wilson', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '595', '2006-02-14', 'tracy.herrmann@sakilacustomer.org', 'Tracy', 'Herrmann', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '267', '2006-02-14', 'patsy.davidson@sakilacustomer.org', 'Patsy', 'Davidson', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '499', '2006-02-14', 'ramon.choate@sakilacustomer.org', 'Ramon', 'Choate', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '170', '2006-02-14', 'lynn.payne@sakilacustomer.org', 'Lynn', 'Payne', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '475', '2006-02-14', 'gordon.allard@sakilacustomer.org', 'Gordon', 'Allard', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '214', '2006-02-14', 'ella.oliver@sakilacustomer.org', 'Ella', 'Oliver', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '308', '2006-02-14', 'william.satterfield@sakilacustomer.org', 'William', 'Satterfield', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '217', '2006-02-14', 'gina.williamson@sakilacustomer.org', 'Gina', 'Williamson', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '211', '2006-02-14', 'gertrude.castillo@sakilacustomer.org', 'Gertrude', 'Castillo', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '563', '2006-02-14', 'felix.gaffney@sakilacustomer.org', 'Felix', 'Gaffney', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '311', '2006-02-14', 'charles.kowalski@sakilacustomer.org', 'Charles', 'Kowalski', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '175', '2006-02-14', 'dolores.wagner@sakilacustomer.org', 'Dolores', 'Wagner', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '62', '2006-02-14', 'jean.bell@sakilacustomer.org', 'Jean', 'Bell', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '468', '2006-02-14', 'darrell.power@sakilacustomer.org', 'Darrell', 'Power', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '415', '2006-02-14', 'curtis.irby@sakilacustomer.org', 'Curtis', 'Irby', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '481', '2006-02-14', 'derrick.bourque@sakilacustomer.org', 'Derrick', 'Bourque', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '193', '2006-02-14', 'loretta.carpenter@sakilacustomer.org', 'Loretta', 'Carpenter', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '441', '2006-02-14', 'troy.quigley@sakilacustomer.org', 'Troy', 'Quigley', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '271', '2006-02-14', 'nora.herrera@sakilacustomer.org', 'Nora', 'Herrera', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '177', '2006-02-14', 'audrey.ray@sakilacustomer.org', 'Audrey', 'Ray', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '163', '2006-02-14', 'jill.hawkins@sakilacustomer.org', 'Jill', 'Hawkins', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '106', '2006-02-14', 'crystal.ford@sakilacustomer.org', 'Crystal', 'Ford', '2013-05-26T14:49:45.738000', 1), - (0, TRUE, '320', '2006-02-14', 'kenneth.gooden@sakilacustomer.org', 'Kenneth', 'Gooden', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '165', '2006-02-14', 'geraldine.perkins@sakilacustomer.org', 'Geraldine', 'Perkins', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '483', '2006-02-14', 'lewis.lyman@sakilacustomer.org', 'Lewis', 'Lyman', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '395', '2006-02-14', 'shawn.heaton@sakilacustomer.org', 'Shawn', 'Heaton', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '46', '2006-02-14', 'carolyn.perez@sakilacustomer.org', 'Carolyn', 'Perez', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '90', '2006-02-14', 'jacqueline.long@sakilacustomer.org', 'Jacqueline', 'Long', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '231', '2006-02-14', 'colleen.burton@sakilacustomer.org', 'Colleen', 'Burton', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '453', '2006-02-14', 'miguel.betancourt@sakilacustomer.org', 'Miguel', 'Betancourt', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '255', '2006-02-14', 'vickie.brewer@sakilacustomer.org', 'Vickie', 'Brewer', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '205', '2006-02-14', 'vicki.fields@sakilacustomer.org', 'Vicki', 'Fields', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '118', '2006-02-14', 'grace.ellis@sakilacustomer.org', 'Grace', 'Ellis', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '199', '2006-02-14', 'vanessa.sims@sakilacustomer.org', 'Vanessa', 'Sims', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '200', '2006-02-14', 'alma.austin@sakilacustomer.org', 'Alma', 'Austin', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '294', '2006-02-14', 'violet.rodriquez@sakilacustomer.org', 'Violet', 'Rodriquez', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '344', '2006-02-14', 'walter.perryman@sakilacustomer.org', 'Walter', 'Perryman', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '500', '2006-02-14', 'charlie.bess@sakilacustomer.org', 'Charlie', 'Bess', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '215', '2006-02-14', 'stacey.montgomery@sakilacustomer.org', 'Stacey', 'Montgomery', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '520', '2006-02-14', 'franklin.troutman@sakilacustomer.org', 'Franklin', 'Troutman', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '277', '2006-02-14', 'kay.caldwell@sakilacustomer.org', 'Kay', 'Caldwell', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '501', '2006-02-14', 'tyler.wren@sakilacustomer.org', 'Tyler', 'Wren', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '307', '2006-02-14', 'michael.silverman@sakilacustomer.org', 'Michael', 'Silverman', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '114', '2006-02-14', 'tiffany.jordan@sakilacustomer.org', 'Tiffany', 'Jordan', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '97', '2006-02-14', 'phyllis.foster@sakilacustomer.org', 'Phyllis', 'Foster', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '253', '2006-02-14', 'dora.medina@sakilacustomer.org', 'Dora', 'Medina', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '158', '2006-02-14', 'michele.grant@sakilacustomer.org', 'Michele', 'Grant', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '594', '2006-02-14', 'marion.ocampo@sakilacustomer.org', 'Marion', 'Ocampo', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '41', '2006-02-14', 'pamela.baker@sakilacustomer.org', 'Pamela', 'Baker', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '427', '2006-02-14', 'melvin.ellington@sakilacustomer.org', 'Melvin', 'Ellington', '2013-05-26T14:49:45.738000', 1) - ) AS data(active, activebool, old_address_id, create_date, email, first_name, last_name, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."address"' - AND map0.old_id = data.old_address_id - RETURNING customer_id - ) - SELECT array_agg(customer_id) INTO v_new_ids_customer FROM inserted; - - FOR i IN 1..array_length(v_new_ids_customer, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."customer"', v_old_ids_customer[i], v_new_ids_customer[i]::TEXT); - END LOOP; - - v_old_ids_customer := ARRAY['384', '281', '594', '283', '168', '424', '533', '241', '521', '242', '378', '552', '90', '260', '129', '324', '435', '538', '564', '197', '442', '138', '267', '151', '569', '466', '64', '165', '313', '485', '67', '595', '169', '389', '599', '511', '550', '484', '546', '357', '3', '596', '590', '253', '337', '285', '355', '34', '79', '147', '385', '11', '503', '29', '531', '547', '53', '391', '401', '240', '264', '194', '404', '299', '163', '54', '489', '574', '396', '1', '365', '519', '141', '429', '573', '76', '358', '60', '136', '287', '135', '259', '209', '224', '336', '440', '268', '554', '403', '68', '167', '225', '12', '95', '192', '356', '446', '117', '15', '421']; - WITH inserted AS ( - INSERT INTO "public"."customer" ("active", "activebool", "address_id", "create_date", "email", "first_name", "last_name", "last_update", "store_id") - SELECT - data.active::integer, - data.activebool::boolean, - map0.new_id::smallint, - data.create_date::date, - data.email::character varying, - data.first_name::character varying, - data.last_name::character varying, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - (1, TRUE, '389', '2006-02-14', 'ernest.stepp@sakilacustomer.org', 'Ernest', 'Stepp', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '286', '2006-02-14', 'leona.obrien@sakilacustomer.org', 'Leona', 'Obrien', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '600', '2006-02-14', 'eduardo.hiatt@sakilacustomer.org', 'Eduardo', 'Hiatt', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '288', '2006-02-14', 'felicia.sutton@sakilacustomer.org', 'Felicia', 'Sutton', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '172', '2006-02-14', 'regina.berry@sakilacustomer.org', 'Regina', 'Berry', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '429', '2006-02-14', 'kyle.spurlock@sakilacustomer.org', 'Kyle', 'Spurlock', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '539', '2006-02-14', 'jessie.milam@sakilacustomer.org', 'Jessie', 'Milam', '2013-05-26T14:49:45.738000', 1), - (0, TRUE, '245', '2006-02-14', 'heidi.larson@sakilacustomer.org', 'Heidi', 'Larson', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '527', '2006-02-14', 'roland.south@sakilacustomer.org', 'Roland', 'South', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '246', '2006-02-14', 'glenda.frazier@sakilacustomer.org', 'Glenda', 'Frazier', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '383', '2006-02-14', 'eugene.culpepper@sakilacustomer.org', 'Eugene', 'Culpepper', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '558', '2006-02-14', 'hugh.waldrop@sakilacustomer.org', 'Hugh', 'Waldrop', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '94', '2006-02-14', 'ruby.washington@sakilacustomer.org', 'Ruby', 'Washington', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '265', '2006-02-14', 'christy.vargas@sakilacustomer.org', 'Christy', 'Vargas', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '133', '2006-02-14', 'carrie.porter@sakilacustomer.org', 'Carrie', 'Porter', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '329', '2006-02-14', 'gary.coy@sakilacustomer.org', 'Gary', 'Coy', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '440', '2006-02-14', 'ricky.shelby@sakilacustomer.org', 'Ricky', 'Shelby', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '544', '2006-02-14', 'ted.breaux@sakilacustomer.org', 'Ted', 'Breaux', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '570', '2006-02-14', 'bob.pfeiffer@sakilacustomer.org', 'Bob', 'Pfeiffer', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '201', '2006-02-14', 'sue.peters@sakilacustomer.org', 'Sue', 'Peters', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '447', '2006-02-14', 'leroy.bustamante@sakilacustomer.org', 'Leroy', 'Bustamante', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '142', '2006-02-14', 'hazel.warren@sakilacustomer.org', 'Hazel', 'Warren', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '272', '2006-02-14', 'margie.wade@sakilacustomer.org', 'Margie', 'Wade', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '155', '2006-02-14', 'megan.palmer@sakilacustomer.org', 'Megan', 'Palmer', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '575', '2006-02-14', 'dave.gardiner@sakilacustomer.org', 'Dave', 'Gardiner', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '471', '2006-02-14', 'leo.ebert@sakilacustomer.org', 'Leo', 'Ebert', '2013-05-26T14:49:45.738000', 1), - (0, TRUE, '68', '2006-02-14', 'judith.cox@sakilacustomer.org', 'Judith', 'Cox', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '169', '2006-02-14', 'lorraine.stephens@sakilacustomer.org', 'Lorraine', 'Stephens', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '318', '2006-02-14', 'donald.mahon@sakilacustomer.org', 'Donald', 'Mahon', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '490', '2006-02-14', 'clyde.tobias@sakilacustomer.org', 'Clyde', 'Tobias', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '71', '2006-02-14', 'kelly.torres@sakilacustomer.org', 'Kelly', 'Torres', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '601', '2006-02-14', 'terrence.gunderson@sakilacustomer.org', 'Terrence', 'Gunderson', '2013-05-26T14:49:45.738000', 1), - (0, TRUE, '173', '2006-02-14', 'erica.matthews@sakilacustomer.org', 'Erica', 'Matthews', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '394', '2006-02-14', 'alan.kahn@sakilacustomer.org', 'Alan', 'Kahn', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '605', '2006-02-14', 'austin.cintron@sakilacustomer.org', 'Austin', 'Cintron', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '516', '2006-02-14', 'chester.benner@sakilacustomer.org', 'Chester', 'Benner', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '556', '2006-02-14', 'guy.brownlee@sakilacustomer.org', 'Guy', 'Brownlee', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '489', '2006-02-14', 'roberto.vu@sakilacustomer.org', 'Roberto', 'Vu', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '552', '2006-02-14', 'kelly.knott@sakilacustomer.org', 'Kelly', 'Knott', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '362', '2006-02-14', 'keith.rico@sakilacustomer.org', 'Keith', 'Rico', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '7', '2006-02-14', 'linda.williams@sakilacustomer.org', 'Linda', 'Williams', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '602', '2006-02-14', 'enrique.forsythe@sakilacustomer.org', 'Enrique', 'Forsythe', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '596', '2006-02-14', 'seth.hannon@sakilacustomer.org', 'Seth', 'Hannon', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '258', '2006-02-14', 'terry.carlson@sakilacustomer.org', 'Terry', 'Carlson', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '342', '2006-02-14', 'jerry.jordon@sakilacustomer.org', 'Jerry', 'Jordon', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '290', '2006-02-14', 'miriam.mckinney@sakilacustomer.org', 'Miriam', 'Mckinney', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '360', '2006-02-14', 'terry.grissom@sakilacustomer.org', 'Terry', 'Grissom', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '38', '2006-02-14', 'rebecca.scott@sakilacustomer.org', 'Rebecca', 'Scott', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '83', '2006-02-14', 'rachel.barnes@sakilacustomer.org', 'Rachel', 'Barnes', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '151', '2006-02-14', 'joanne.robertson@sakilacustomer.org', 'Joanne', 'Robertson', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '390', '2006-02-14', 'phillip.holm@sakilacustomer.org', 'Phillip', 'Holm', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '15', '2006-02-14', 'lisa.anderson@sakilacustomer.org', 'Lisa', 'Anderson', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '508', '2006-02-14', 'angel.barclay@sakilacustomer.org', 'Angel', 'Barclay', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '33', '2006-02-14', 'angela.hernandez@sakilacustomer.org', 'Angela', 'Hernandez', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '537', '2006-02-14', 'jamie.waugh@sakilacustomer.org', 'Jamie', 'Waugh', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '553', '2006-02-14', 'kurt.emmons@sakilacustomer.org', 'Kurt', 'Emmons', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '57', '2006-02-14', 'heather.morris@sakilacustomer.org', 'Heather', 'Morris', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '396', '2006-02-14', 'clarence.gamez@sakilacustomer.org', 'Clarence', 'Gamez', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '406', '2006-02-14', 'tony.carranza@sakilacustomer.org', 'Tony', 'Carranza', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '244', '2006-02-14', 'marlene.welch@sakilacustomer.org', 'Marlene', 'Welch', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '269', '2006-02-14', 'gwendolyn.may@sakilacustomer.org', 'Gwendolyn', 'May', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '198', '2006-02-14', 'kristen.chavez@sakilacustomer.org', 'Kristen', 'Chavez', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '409', '2006-02-14', 'stanley.scroggins@sakilacustomer.org', 'Stanley', 'Scroggins', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '304', '2006-02-14', 'james.gannon@sakilacustomer.org', 'James', 'Gannon', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '167', '2006-02-14', 'cathy.spencer@sakilacustomer.org', 'Cathy', 'Spencer', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '58', '2006-02-14', 'teresa.rogers@sakilacustomer.org', 'Teresa', 'Rogers', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '494', '2006-02-14', 'ricardo.meador@sakilacustomer.org', 'Ricardo', 'Meador', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '580', '2006-02-14', 'julian.vest@sakilacustomer.org', 'Julian', 'Vest', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '401', '2006-02-14', 'earl.shanks@sakilacustomer.org', 'Earl', 'Shanks', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '5', '2006-02-14', 'mary.smith@sakilacustomer.org', 'Mary', 'Smith', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '370', '2006-02-14', 'bruce.schwarz@sakilacustomer.org', 'Bruce', 'Schwarz', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '525', '2006-02-14', 'ron.deluca@sakilacustomer.org', 'Ron', 'Deluca', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '145', '2006-02-14', 'debbie.reyes@sakilacustomer.org', 'Debbie', 'Reyes', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '434', '2006-02-14', 'frederick.isbell@sakilacustomer.org', 'Frederick', 'Isbell', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '579', '2006-02-14', 'byron.box@sakilacustomer.org', 'Byron', 'Box', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '80', '2006-02-14', 'irene.price@sakilacustomer.org', 'Irene', 'Price', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '363', '2006-02-14', 'samuel.marlow@sakilacustomer.org', 'Samuel', 'Marlow', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '64', '2006-02-14', 'mildred.bailey@sakilacustomer.org', 'Mildred', 'Bailey', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '140', '2006-02-14', 'anita.morales@sakilacustomer.org', 'Anita', 'Morales', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '292', '2006-02-14', 'becky.miles@sakilacustomer.org', 'Becky', 'Miles', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '139', '2006-02-14', 'juanita.mason@sakilacustomer.org', 'Juanita', 'Mason', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '264', '2006-02-14', 'lena.jensen@sakilacustomer.org', 'Lena', 'Jensen', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '213', '2006-02-14', 'tonya.chapman@sakilacustomer.org', 'Tonya', 'Chapman', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '228', '2006-02-14', 'pearl.garza@sakilacustomer.org', 'Pearl', 'Garza', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '341', '2006-02-14', 'joshua.mark@sakilacustomer.org', 'Joshua', 'Mark', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '445', '2006-02-14', 'bernard.colby@sakilacustomer.org', 'Bernard', 'Colby', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '273', '2006-02-14', 'nina.soto@sakilacustomer.org', 'Nina', 'Soto', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '560', '2006-02-14', 'dwayne.olvera@sakilacustomer.org', 'Dwayne', 'Olvera', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '408', '2006-02-14', 'mike.way@sakilacustomer.org', 'Mike', 'Way', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '72', '2006-02-14', 'nicole.peterson@sakilacustomer.org', 'Nicole', 'Peterson', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '171', '2006-02-14', 'sally.pierce@sakilacustomer.org', 'Sally', 'Pierce', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '229', '2006-02-14', 'arlene.harvey@sakilacustomer.org', 'Arlene', 'Harvey', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '16', '2006-02-14', 'nancy.thomas@sakilacustomer.org', 'Nancy', 'Thomas', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '99', '2006-02-14', 'paula.bryant@sakilacustomer.org', 'Paula', 'Bryant', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '196', '2006-02-14', 'laurie.lawrence@sakilacustomer.org', 'Laurie', 'Lawrence', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '361', '2006-02-14', 'gerald.fultz@sakilacustomer.org', 'Gerald', 'Fultz', '2013-05-26T14:49:45.738000', 2), - (0, TRUE, '451', '2006-02-14', 'theodore.culp@sakilacustomer.org', 'Theodore', 'Culp', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '121', '2006-02-14', 'edith.mcdonald@sakilacustomer.org', 'Edith', 'Mcdonald', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '19', '2006-02-14', 'helen.harris@sakilacustomer.org', 'Helen', 'Harris', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '426', '2006-02-14', 'lee.hawks@sakilacustomer.org', 'Lee', 'Hawks', '2013-05-26T14:49:45.738000', 1) - ) AS data(active, activebool, old_address_id, create_date, email, first_name, last_name, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."address"' - AND map0.old_id = data.old_address_id - RETURNING customer_id - ) - SELECT array_agg(customer_id) INTO v_new_ids_customer FROM inserted; - - FOR i IN 1..array_length(v_new_ids_customer, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."customer"', v_old_ids_customer[i], v_new_ids_customer[i]::TEXT); - END LOOP; - - v_old_ids_customer := ARRAY['32', '300', '529', '170', '31', '534', '413', '123', '238', '271', '274', '59', '202', '78', '152', '502', '492', '121', '217', '419', '370', '296', '508', '379', '509', '316', '208', '426', '175', '468', '367', '412', '28', '186', '297', '231', '218', '516', '228', '406', '333', '334', '438', '525', '499', '221', '33', '541', '439', '309', '43', '56', '381', '344', '4', '256', '105', '375', '387', '456', '200', '69', '441', '176', '157', '363', '193', '332', '329', '21', '148', '82', '386', '475', '187', '131', '545', '461', '72', '548', '244', '94', '236', '349', '434', '522', '505', '580', '388', '263', '371', '71', '261', '27', '373', '188', '255', '395', '50', '298']; - WITH inserted AS ( - INSERT INTO "public"."customer" ("active", "activebool", "address_id", "create_date", "email", "first_name", "last_name", "last_update", "store_id") - SELECT - data.active::integer, - data.activebool::boolean, - map0.new_id::smallint, - data.create_date::date, - data.email::character varying, - data.first_name::character varying, - data.last_name::character varying, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - (1, TRUE, '36', '2006-02-14', 'amy.lopez@sakilacustomer.org', 'Amy', 'Lopez', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '305', '2006-02-14', 'john.farnsworth@sakilacustomer.org', 'John', 'Farnsworth', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '535', '2006-02-14', 'erik.guillen@sakilacustomer.org', 'Erik', 'Guillen', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '174', '2006-02-14', 'beatrice.arnold@sakilacustomer.org', 'Beatrice', 'Arnold', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '35', '2006-02-14', 'brenda.wright@sakilacustomer.org', 'Brenda', 'Wright', '2013-05-26T14:49:45.738000', 2), - (0, TRUE, '540', '2006-02-14', 'christian.jung@sakilacustomer.org', 'Christian', 'Jung', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '418', '2006-02-14', 'marvin.yee@sakilacustomer.org', 'Marvin', 'Yee', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '127', '2006-02-14', 'shannon.freeman@sakilacustomer.org', 'Shannon', 'Freeman', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '242', '2006-02-14', 'nellie.garrett@sakilacustomer.org', 'Nellie', 'Garrett', '2013-05-26T14:49:45.738000', 1), - (0, TRUE, '276', '2006-02-14', 'penny.neal@sakilacustomer.org', 'Penny', 'Neal', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '279', '2006-02-14', 'naomi.jennings@sakilacustomer.org', 'Naomi', 'Jennings', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '63', '2006-02-14', 'cheryl.murphy@sakilacustomer.org', 'Cheryl', 'Murphy', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '206', '2006-02-14', 'carla.gutierrez@sakilacustomer.org', 'Carla', 'Gutierrez', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '82', '2006-02-14', 'lori.wood@sakilacustomer.org', 'Lori', 'Wood', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '156', '2006-02-14', 'alicia.mills@sakilacustomer.org', 'Alicia', 'Mills', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '507', '2006-02-14', 'brett.cornwell@sakilacustomer.org', 'Brett', 'Cornwell', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '497', '2006-02-14', 'lester.kraus@sakilacustomer.org', 'Lester', 'Kraus', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '125', '2006-02-14', 'josephine.gomez@sakilacustomer.org', 'Josephine', 'Gomez', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '221', '2006-02-14', 'agnes.bishop@sakilacustomer.org', 'Agnes', 'Bishop', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '424', '2006-02-14', 'chad.carbone@sakilacustomer.org', 'Chad', 'Carbone', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '375', '2006-02-14', 'wayne.truong@sakilacustomer.org', 'Wayne', 'Truong', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '301', '2006-02-14', 'ramona.hale@sakilacustomer.org', 'Ramona', 'Hale', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '513', '2006-02-14', 'milton.howland@sakilacustomer.org', 'Milton', 'Howland', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '384', '2006-02-14', 'carlos.coughlin@sakilacustomer.org', 'Carlos', 'Coughlin', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '514', '2006-02-14', 'raul.fortier@sakilacustomer.org', 'Raul', 'Fortier', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '321', '2006-02-14', 'steven.curley@sakilacustomer.org', 'Steven', 'Curley', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '212', '2006-02-14', 'lucy.wheeler@sakilacustomer.org', 'Lucy', 'Wheeler', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '431', '2006-02-14', 'bradley.motley@sakilacustomer.org', 'Bradley', 'Motley', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '179', '2006-02-14', 'annette.olson@sakilacustomer.org', 'Annette', 'Olson', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '473', '2006-02-14', 'tim.cary@sakilacustomer.org', 'Tim', 'Cary', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '372', '2006-02-14', 'adam.gooch@sakilacustomer.org', 'Adam', 'Gooch', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '417', '2006-02-14', 'allen.butterfield@sakilacustomer.org', 'Allen', 'Butterfield', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '32', '2006-02-14', 'cynthia.young@sakilacustomer.org', 'Cynthia', 'Young', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '190', '2006-02-14', 'holly.fox@sakilacustomer.org', 'Holly', 'Fox', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '302', '2006-02-14', 'sherri.rhodes@sakilacustomer.org', 'Sherri', 'Rhodes', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '235', '2006-02-14', 'georgia.jacobs@sakilacustomer.org', 'Georgia', 'Jacobs', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '222', '2006-02-14', 'vera.mccoy@sakilacustomer.org', 'Vera', 'Mccoy', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '522', '2006-02-14', 'elmer.noe@sakilacustomer.org', 'Elmer', 'Noe', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '232', '2006-02-14', 'allison.stanley@sakilacustomer.org', 'Allison', 'Stanley', '2013-05-26T14:49:45.738000', 2), - (0, TRUE, '411', '2006-02-14', 'nathan.runyon@sakilacustomer.org', 'Nathan', 'Runyon', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '338', '2006-02-14', 'andrew.purdy@sakilacustomer.org', 'Andrew', 'Purdy', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '339', '2006-02-14', 'raymond.mcwhorter@sakilacustomer.org', 'Raymond', 'Mcwhorter', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '443', '2006-02-14', 'barry.lovelace@sakilacustomer.org', 'Barry', 'Lovelace', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '531', '2006-02-14', 'adrian.clary@sakilacustomer.org', 'Adrian', 'Clary', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '504', '2006-02-14', 'marc.outlaw@sakilacustomer.org', 'Marc', 'Outlaw', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '225', '2006-02-14', 'bessie.morrison@sakilacustomer.org', 'Bessie', 'Morrison', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '37', '2006-02-14', 'anna.hill@sakilacustomer.org', 'Anna', 'Hill', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '547', '2006-02-14', 'darren.windham@sakilacustomer.org', 'Darren', 'Windham', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '444', '2006-02-14', 'alexander.fennell@sakilacustomer.org', 'Alexander', 'Fennell', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '314', '2006-02-14', 'christopher.greco@sakilacustomer.org', 'Christopher', 'Greco', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '47', '2006-02-14', 'christine.roberts@sakilacustomer.org', 'Christine', 'Roberts', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '60', '2006-02-14', 'gloria.cook@sakilacustomer.org', 'Gloria', 'Cook', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '386', '2006-02-14', 'bobby.boudreau@sakilacustomer.org', 'Bobby', 'Boudreau', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '349', '2006-02-14', 'henry.billingsley@sakilacustomer.org', 'Henry', 'Billingsley', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '8', '2006-02-14', 'barbara.jones@sakilacustomer.org', 'Barbara', 'Jones', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '261', '2006-02-14', 'mabel.holland@sakilacustomer.org', 'Mabel', 'Holland', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '109', '2006-02-14', 'dawn.sullivan@sakilacustomer.org', 'Dawn', 'Sullivan', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '380', '2006-02-14', 'aaron.selby@sakilacustomer.org', 'Aaron', 'Selby', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '392', '2006-02-14', 'jesse.schilling@sakilacustomer.org', 'Jesse', 'Schilling', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '461', '2006-02-14', 'ronnie.ricketts@sakilacustomer.org', 'Ronnie', 'Ricketts', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '204', '2006-02-14', 'jeanne.lawson@sakilacustomer.org', 'Jeanne', 'Lawson', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '73', '2006-02-14', 'judy.gray@sakilacustomer.org', 'Judy', 'Gray', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '446', '2006-02-14', 'mario.cheatham@sakilacustomer.org', 'Mario', 'Cheatham', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '180', '2006-02-14', 'june.carroll@sakilacustomer.org', 'June', 'Carroll', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '161', '2006-02-14', 'darlene.rose@sakilacustomer.org', 'Darlene', 'Rose', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '368', '2006-02-14', 'roy.whiting@sakilacustomer.org', 'Roy', 'Whiting', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '197', '2006-02-14', 'katie.elliott@sakilacustomer.org', 'Katie', 'Elliott', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '337', '2006-02-14', 'stephen.qualls@sakilacustomer.org', 'Stephen', 'Qualls', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '334', '2006-02-14', 'frank.waggoner@sakilacustomer.org', 'Frank', 'Waggoner', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '25', '2006-02-14', 'michelle.clark@sakilacustomer.org', 'Michelle', 'Clark', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '152', '2006-02-14', 'eleanor.hunt@sakilacustomer.org', 'Eleanor', 'Hunt', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '86', '2006-02-14', 'kathryn.coleman@sakilacustomer.org', 'Kathryn', 'Coleman', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '391', '2006-02-14', 'todd.tan@sakilacustomer.org', 'Todd', 'Tan', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '480', '2006-02-14', 'pedro.chestnut@sakilacustomer.org', 'Pedro', 'Chestnut', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '191', '2006-02-14', 'brittany.riley@sakilacustomer.org', 'Brittany', 'Riley', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '135', '2006-02-14', 'monica.hicks@sakilacustomer.org', 'Monica', 'Hicks', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '551', '2006-02-14', 'julio.noland@sakilacustomer.org', 'Julio', 'Noland', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '466', '2006-02-14', 'derek.blakely@sakilacustomer.org', 'Derek', 'Blakely', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '76', '2006-02-14', 'theresa.watson@sakilacustomer.org', 'Theresa', 'Watson', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '554', '2006-02-14', 'allan.cornish@sakilacustomer.org', 'Allan', 'Cornish', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '248', '2006-02-14', 'viola.hanson@sakilacustomer.org', 'Viola', 'Hanson', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '98', '2006-02-14', 'norma.gonzales@sakilacustomer.org', 'Norma', 'Gonzales', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '240', '2006-02-14', 'marcia.dean@sakilacustomer.org', 'Marcia', 'Dean', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '354', '2006-02-14', 'joe.gilliland@sakilacustomer.org', 'Joe', 'Gilliland', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '439', '2006-02-14', 'eddie.tomlin@sakilacustomer.org', 'Eddie', 'Tomlin', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '528', '2006-02-14', 'arnold.havens@sakilacustomer.org', 'Arnold', 'Havens', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '510', '2006-02-14', 'rafael.abney@sakilacustomer.org', 'Rafael', 'Abney', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '586', '2006-02-14', 'ross.grey@sakilacustomer.org', 'Ross', 'Grey', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '393', '2006-02-14', 'craig.morrell@sakilacustomer.org', 'Craig', 'Morrell', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '268', '2006-02-14', 'hilda.hopkins@sakilacustomer.org', 'Hilda', 'Hopkins', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '376', '2006-02-14', 'billy.poulin@sakilacustomer.org', 'Billy', 'Poulin', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '75', '2006-02-14', 'kathy.james@sakilacustomer.org', 'Kathy', 'James', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '266', '2006-02-14', 'deanna.byrd@sakilacustomer.org', 'Deanna', 'Byrd', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '31', '2006-02-14', 'shirley.allen@sakilacustomer.org', 'Shirley', 'Allen', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '378', '2006-02-14', 'louis.leone@sakilacustomer.org', 'Louis', 'Leone', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '192', '2006-02-14', 'melanie.armstrong@sakilacustomer.org', 'Melanie', 'Armstrong', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '260', '2006-02-14', 'irma.pearson@sakilacustomer.org', 'Irma', 'Pearson', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '400', '2006-02-14', 'johnny.turpin@sakilacustomer.org', 'Johnny', 'Turpin', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '54', '2006-02-14', 'diane.collins@sakilacustomer.org', 'Diane', 'Collins', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '303', '2006-02-14', 'erika.pena@sakilacustomer.org', 'Erika', 'Pena', '2013-05-26T14:49:45.738000', 1) - ) AS data(active, activebool, old_address_id, create_date, email, first_name, last_name, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."address"' - AND map0.old_id = data.old_address_id - RETURNING customer_id - ) - SELECT array_agg(customer_id) INTO v_new_ids_customer FROM inserted; - - FOR i IN 1..array_length(v_new_ids_customer, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."customer"', v_old_ids_customer[i], v_new_ids_customer[i]::TEXT); - END LOOP; - - v_old_ids_customer := ARRAY['137', '474', '415', '341', '184', '571', '572', '558', '318', '128', '270', '380', '501', '342', '443', '216', '183', '229', '551', '77', '325', '314', '398', '310', '544', '354', '206', '374', '178', '130', '254', '92', '246', '126', '307', '74', '427', '591', '362', '47', '39', '99', '237', '88', '536', '245', '160', '393', '17', '376', '295', '567', '46', '301', '191', '351', '44', '397', '346', '179', '430', '222', '106', '428', '48', '55', '487', '100', '462', '127', '510', '350', '447', '311', '81', '257', '97', '433', '258', '418', '437', '431', '455', '335', '513', '239', '203', '328', '506', '450', '542', '116', '372', '458', '411', '473', '524', '153', '500']; - WITH inserted AS ( - INSERT INTO "public"."customer" ("active", "activebool", "address_id", "create_date", "email", "first_name", "last_name", "last_update", "store_id") - SELECT - data.active::integer, - data.activebool::boolean, - map0.new_id::smallint, - data.create_date::date, - data.email::character varying, - data.first_name::character varying, - data.last_name::character varying, - data.last_update::timestamp without time zone, - data.store_id::smallint - FROM (VALUES - (1, TRUE, '141', '2006-02-14', 'rhonda.kennedy@sakilacustomer.org', 'Rhonda', 'Kennedy', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '479', '2006-02-14', 'dustin.gillette@sakilacustomer.org', 'Dustin', 'Gillette', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '420', '2006-02-14', 'glenn.pullen@sakilacustomer.org', 'Glenn', 'Pullen', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '346', '2006-02-14', 'peter.menard@sakilacustomer.org', 'Peter', 'Menard', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '188', '2006-02-14', 'vivian.ruiz@sakilacustomer.org', 'Vivian', 'Ruiz', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '577', '2006-02-14', 'johnnie.chisholm@sakilacustomer.org', 'Johnnie', 'Chisholm', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '578', '2006-02-14', 'sidney.burleson@sakilacustomer.org', 'Sidney', 'Burleson', '2013-05-26T14:49:45.738000', 1), - (0, TRUE, '564', '2006-02-14', 'jimmie.eggleston@sakilacustomer.org', 'Jimmie', 'Eggleston', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '323', '2006-02-14', 'brian.wyman@sakilacustomer.org', 'Brian', 'Wyman', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '132', '2006-02-14', 'marjorie.tucker@sakilacustomer.org', 'Marjorie', 'Tucker', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '275', '2006-02-14', 'leah.curtis@sakilacustomer.org', 'Leah', 'Curtis', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '385', '2006-02-14', 'russell.brinson@sakilacustomer.org', 'Russell', 'Brinson', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '506', '2006-02-14', 'ruben.geary@sakilacustomer.org', 'Ruben', 'Geary', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '347', '2006-02-14', 'harold.martino@sakilacustomer.org', 'Harold', 'Martino', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '448', '2006-02-14', 'francisco.skidmore@sakilacustomer.org', 'Francisco', 'Skidmore', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '220', '2006-02-14', 'natalie.meyer@sakilacustomer.org', 'Natalie', 'Meyer', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '187', '2006-02-14', 'ida.andrews@sakilacustomer.org', 'Ida', 'Andrews', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '233', '2006-02-14', 'tamara.nguyen@sakilacustomer.org', 'Tamara', 'Nguyen', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '557', '2006-02-14', 'clayton.barbee@sakilacustomer.org', 'Clayton', 'Barbee', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '81', '2006-02-14', 'jane.bennett@sakilacustomer.org', 'Jane', 'Bennett', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '330', '2006-02-14', 'timothy.bunn@sakilacustomer.org', 'Timothy', 'Bunn', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '319', '2006-02-14', 'george.linton@sakilacustomer.org', 'George', 'Linton', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '403', '2006-02-14', 'antonio.meek@sakilacustomer.org', 'Antonio', 'Meek', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '315', '2006-02-14', 'daniel.cabral@sakilacustomer.org', 'Daniel', 'Cabral', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '550', '2006-02-14', 'cody.nolen@sakilacustomer.org', 'Cody', 'Nolen', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '359', '2006-02-14', 'justin.ngo@sakilacustomer.org', 'Justin', 'Ngo', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '210', '2006-02-14', 'terri.vasquez@sakilacustomer.org', 'Terri', 'Vasquez', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '379', '2006-02-14', 'jeremy.hurtado@sakilacustomer.org', 'Jeremy', 'Hurtado', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '182', '2006-02-14', 'marion.snyder@sakilacustomer.org', 'Marion', 'Snyder', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '134', '2006-02-14', 'charlotte.hunter@sakilacustomer.org', 'Charlotte', 'Hunter', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '259', '2006-02-14', 'maxine.silva@sakilacustomer.org', 'Maxine', 'Silva', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '96', '2006-02-14', 'tina.simmons@sakilacustomer.org', 'Tina', 'Simmons', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '250', '2006-02-14', 'marian.mendoza@sakilacustomer.org', 'Marian', 'Mendoza', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '130', '2006-02-14', 'ellen.simpson@sakilacustomer.org', 'Ellen', 'Simpson', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '312', '2006-02-14', 'joseph.joy@sakilacustomer.org', 'Joseph', 'Joy', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '78', '2006-02-14', 'denise.kelly@sakilacustomer.org', 'Denise', 'Kelly', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '432', '2006-02-14', 'jesus.mccartney@sakilacustomer.org', 'Jesus', 'Mccartney', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '597', '2006-02-14', 'kent.arsenault@sakilacustomer.org', 'Kent', 'Arsenault', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '367', '2006-02-14', 'nicholas.barfield@sakilacustomer.org', 'Nicholas', 'Barfield', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '51', '2006-02-14', 'frances.parker@sakilacustomer.org', 'Frances', 'Parker', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '43', '2006-02-14', 'debra.nelson@sakilacustomer.org', 'Debra', 'Nelson', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '103', '2006-02-14', 'emily.diaz@sakilacustomer.org', 'Emily', 'Diaz', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '241', '2006-02-14', 'tanya.gilbert@sakilacustomer.org', 'Tanya', 'Gilbert', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '92', '2006-02-14', 'bonnie.hughes@sakilacustomer.org', 'Bonnie', 'Hughes', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '542', '2006-02-14', 'fernando.churchill@sakilacustomer.org', 'Fernando', 'Churchill', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '249', '2006-02-14', 'courtney.day@sakilacustomer.org', 'Courtney', 'Day', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '164', '2006-02-14', 'erin.dunn@sakilacustomer.org', 'Erin', 'Dunn', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '398', '2006-02-14', 'philip.causey@sakilacustomer.org', 'Philip', 'Causey', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '21', '2006-02-14', 'donna.thompson@sakilacustomer.org', 'Donna', 'Thompson', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '381', '2006-02-14', 'randy.gaither@sakilacustomer.org', 'Randy', 'Gaither', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '300', '2006-02-14', 'daisy.bates@sakilacustomer.org', 'Daisy', 'Bates', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '573', '2006-02-14', 'alfredo.mcadams@sakilacustomer.org', 'Alfredo', 'Mcadams', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '50', '2006-02-14', 'catherine.campbell@sakilacustomer.org', 'Catherine', 'Campbell', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '306', '2006-02-14', 'robert.baughman@sakilacustomer.org', 'Robert', 'Baughman', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '195', '2006-02-14', 'jeanette.greene@sakilacustomer.org', 'Jeanette', 'Greene', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '356', '2006-02-14', 'jack.foust@sakilacustomer.org', 'Jack', 'Foust', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '48', '2006-02-14', 'marie.turner@sakilacustomer.org', 'Marie', 'Turner', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '402', '2006-02-14', 'jimmy.schrader@sakilacustomer.org', 'Jimmy', 'Schrader', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '351', '2006-02-14', 'arthur.simpkins@sakilacustomer.org', 'Arthur', 'Simpkins', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '183', '2006-02-14', 'dana.hart@sakilacustomer.org', 'Dana', 'Hart', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '435', '2006-02-14', 'ray.houle@sakilacustomer.org', 'Ray', 'Houle', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '226', '2006-02-14', 'delores.hansen@sakilacustomer.org', 'Delores', 'Hansen', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '110', '2006-02-14', 'connie.wallace@sakilacustomer.org', 'Connie', 'Wallace', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '433', '2006-02-14', 'herbert.kruger@sakilacustomer.org', 'Herbert', 'Kruger', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '52', '2006-02-14', 'ann.evans@sakilacustomer.org', 'Ann', 'Evans', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '59', '2006-02-14', 'doris.reed@sakilacustomer.org', 'Doris', 'Reed', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '492', '2006-02-14', 'hector.poindexter@sakilacustomer.org', 'Hector', 'Poindexter', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '104', '2006-02-14', 'robin.hayes@sakilacustomer.org', 'Robin', 'Hayes', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '467', '2006-02-14', 'warren.sherrod@sakilacustomer.org', 'Warren', 'Sherrod', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '131', '2006-02-14', 'elaine.stevens@sakilacustomer.org', 'Elaine', 'Stevens', '2013-05-26T14:49:45.738000', 2), - (0, TRUE, '515', '2006-02-14', 'ben.easter@sakilacustomer.org', 'Ben', 'Easter', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '355', '2006-02-14', 'juan.fraley@sakilacustomer.org', 'Juan', 'Fraley', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '452', '2006-02-14', 'clifford.bowens@sakilacustomer.org', 'Clifford', 'Bowens', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '316', '2006-02-14', 'paul.trout@sakilacustomer.org', 'Paul', 'Trout', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '85', '2006-02-14', 'andrea.henderson@sakilacustomer.org', 'Andrea', 'Henderson', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '262', '2006-02-14', 'marsha.douglas@sakilacustomer.org', 'Marsha', 'Douglas', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '101', '2006-02-14', 'annie.russell@sakilacustomer.org', 'Annie', 'Russell', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '438', '2006-02-14', 'don.bone@sakilacustomer.org', 'Don', 'Bone', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '263', '2006-02-14', 'myrtle.fleming@sakilacustomer.org', 'Myrtle', 'Fleming', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '423', '2006-02-14', 'jeff.east@sakilacustomer.org', 'Jeff', 'East', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '442', '2006-02-14', 'randall.neumann@sakilacustomer.org', 'Randall', 'Neumann', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '436', '2006-02-14', 'joel.francisco@sakilacustomer.org', 'Joel', 'Francisco', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '460', '2006-02-14', 'jon.wiles@sakilacustomer.org', 'Jon', 'Wiles', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '340', '2006-02-14', 'gregory.mauldin@sakilacustomer.org', 'Gregory', 'Mauldin', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '519', '2006-02-14', 'duane.tubbs@sakilacustomer.org', 'Duane', 'Tubbs', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '243', '2006-02-14', 'minnie.romero@sakilacustomer.org', 'Minnie', 'Romero', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '207', '2006-02-14', 'tara.ryan@sakilacustomer.org', 'Tara', 'Ryan', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '333', '2006-02-14', 'jeffrey.spear@sakilacustomer.org', 'Jeffrey', 'Spear', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '511', '2006-02-14', 'leslie.seward@sakilacustomer.org', 'Leslie', 'Seward', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '455', '2006-02-14', 'jay.robb@sakilacustomer.org', 'Jay', 'Robb', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '548', '2006-02-14', 'lonnie.tirado@sakilacustomer.org', 'Lonnie', 'Tirado', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '120', '2006-02-14', 'victoria.gibson@sakilacustomer.org', 'Victoria', 'Gibson', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '377', '2006-02-14', 'steve.mackenzie@sakilacustomer.org', 'Steve', 'Mackenzie', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '463', '2006-02-14', 'lloyd.dowd@sakilacustomer.org', 'Lloyd', 'Dowd', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '416', '2006-02-14', 'norman.currier@sakilacustomer.org', 'Norman', 'Currier', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '478', '2006-02-14', 'jorge.olivares@sakilacustomer.org', 'Jorge', 'Olivares', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '530', '2006-02-14', 'jared.ely@sakilacustomer.org', 'Jared', 'Ely', '2013-05-26T14:49:45.738000', 1), - (1, TRUE, '157', '2006-02-14', 'suzanne.nichols@sakilacustomer.org', 'Suzanne', 'Nichols', '2013-05-26T14:49:45.738000', 2), - (1, TRUE, '505', '2006-02-14', 'reginald.kinder@sakilacustomer.org', 'Reginald', 'Kinder', '2013-05-26T14:49:45.738000', 1) - ) AS data(active, activebool, old_address_id, create_date, email, first_name, last_name, last_update, store_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."address"' - AND map0.old_id = data.old_address_id - RETURNING customer_id - ) - SELECT array_agg(customer_id) INTO v_new_ids_customer FROM inserted; - - FOR i IN 1..array_length(v_new_ids_customer, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."customer"', v_old_ids_customer[i], v_new_ids_customer[i]::TEXT); - END LOOP; - - -- Table: "public"."staff" (2 records) - v_old_ids_staff := ARRAY['1', '2']; - WITH inserted AS ( - INSERT INTO "public"."staff" ("active", "address_id", "email", "first_name", "last_name", "last_update", "password", "picture", "store_id", "username") - SELECT - data.active::boolean, - map0.new_id::smallint, - data.email::character varying, - data.first_name::character varying, - data.last_name::character varying, - data.last_update::timestamp without time zone, - data.password::character varying, - data.picture::bytea, - data.store_id::smallint, - data.username::character varying - FROM (VALUES - (TRUE, '3', 'Mike.Hillyer@sakilastaff.com', 'Mike', 'Hillyer', '2006-05-16T16:13:11.793280', '8cb2237d0679ca88db6464eac60da96345513964', '\x89504e470d0a5a0a', 1, 'Mike'), - (TRUE, '4', 'Jon.Stephens@sakilastaff.com', 'Jon', 'Stephens', '2006-05-16T16:13:11.793280', '8cb2237d0679ca88db6464eac60da96345513964', NULL, 2, 'Jon') - ) AS data(active, old_address_id, email, first_name, last_name, last_update, password, picture, store_id, username) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."address"' - AND map0.old_id = data.old_address_id - RETURNING staff_id - ) - SELECT array_agg(staff_id) INTO v_new_ids_staff FROM inserted; - - FOR i IN 1..array_length(v_new_ids_staff, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."staff"', v_old_ids_staff[i], v_new_ids_staff[i]::TEXT); - END LOOP; - - -- Table: "public"."rental" (16044 records) - v_old_ids_rental := ARRAY['13531', '7380', '8312', '15149', '11980', '6191', '15229', '4822', '15716', '12513', '4282', '4109', '5798', '5655', '7897', '15042', '4472', '4503', '7064', '9035', '6699', '7553', '16022', '3664', '1948', '12592', '15815', '3713', '7346', '13289', '10133', '7782', '5152', '12134', '4108', '7136', '15477', '13149', '15852', '14032', '3082', '60', '7166', '8983', '908', '3086', '788', '13510', '203', '4364', '7009', '14785', '1547', '4418', '12887', '8162', '12896', '4174', '476', '12265', '9641', '14362', '10621', '2856', '472', '12940', '3120', '1881', '9400', '13179', '9369', '5688', '4579', '63', '2070', '9997', '15269', '13372', '3770', '9309', '1359', '4588', '6435', '9623', '12652', '15066', '379', '447', '11570', '8823', '2176', '9363', '10834', '4488', '6076', '8468', '10871', '10613', '5269', '10904']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('156', '2778', '2006-02-16T02:30:53', '2005-08-20T03:26:10', '2005-08-25T03:41:10', '1'), - ('348', '988', '2006-02-16T02:30:53', '2005-07-27T15:37:01', '2005-08-03T19:24:01', '1'), - ('143', '3996', '2006-02-16T02:30:53', '2005-07-29T03:32:38', '2005-07-31T02:12:38', '1'), - ('537', '3059', '2006-02-16T02:30:53', '2005-08-22T14:08:06', '2005-08-25T08:25:06', '1'), - ('589', '4165', '2006-02-16T02:30:53', '2005-08-17T18:10:18', '2005-08-20T13:28:18', '1'), - ('480', '3448', '2006-02-16T02:30:53', '2005-07-11T11:37:52', '2005-07-17T12:45:52', '1'), - ('63', '320', '2006-02-16T02:30:53', '2005-08-22T17:30:25', '2005-08-23T14:13:25', '1'), - ('185', '3970', '2006-02-16T02:30:53', '2005-07-08T17:28:47', '2005-07-14T13:06:47', '1'), - ('408', '2812', '2006-02-16T02:30:53', '2005-08-23T11:02:00', '2005-08-28T14:46:00', '1'), - ('527', '29', '2006-02-16T02:30:53', '2005-08-18T13:31:45', '2005-08-25T08:26:45', '1'), - ('25', '3134', '2006-02-16T02:30:53', '2005-07-07T15:26:31', '2005-07-11T14:27:31', '1'), - ('517', '532', '2006-02-16T02:30:53', '2005-07-07T06:39:43', '2005-07-10T06:30:43', '1'), - ('107', '331', '2006-02-16T02:30:53', '2005-07-10T14:45:09', '2005-07-16T13:43:09', '1'), - ('113', '3470', '2006-02-16T02:30:53', '2005-07-10T07:31:06', '2005-07-17T08:22:06', '1'), - ('75', '1396', '2006-02-16T02:30:53', '2005-07-28T11:01:51', '2005-07-31T13:13:51', '1'), - ('553', '3796', '2006-02-16T02:30:53', '2005-08-22T09:47:37', '2005-08-31T04:42:37', '1'), - ('343', '2089', '2006-02-16T02:30:53', '2005-07-08T00:22:06', '2005-07-16T20:16:06', '1'), - ('8', '1503', '2006-02-16T02:30:53', '2005-07-08T02:17:12', '2005-07-13T08:12:12', '1'), - ('320', '4204', '2006-02-16T02:30:53', '2005-07-27T03:53:29', '2005-08-03T06:32:29', '1'), - ('243', '3785', '2006-02-16T02:30:53', '2005-07-30T06:16:07', '2005-08-06T09:22:07', '1'), - ('565', '3411', '2006-02-16T02:30:53', '2005-07-12T12:45:21', '2005-07-15T12:59:21', '1'), - ('275', '1643', '2006-02-16T02:30:53', '2005-07-27T22:11:36', '2005-08-03T17:52:36', '1'), - ('504', '2925', '2006-02-16T02:30:53', '2005-08-23T21:44:27', '2005-08-28T01:52:27', '1'), - ('528', '3366', '2006-02-16T02:30:53', '2005-07-06T08:15:57', '2005-07-08T06:11:57', '1'), - ('89', '46', '2006-02-16T02:30:53', '2005-06-17T08:06:53', '2005-06-21T05:00:53', '1'), - ('305', '1618', '2006-02-16T02:30:53', '2005-08-18T16:17:50', '2005-08-25T20:20:50', '1'), - ('444', '316', '2006-02-16T02:30:53', '2005-08-23T14:55:47', '2005-08-24T12:37:47', '1'), - ('504', '1823', '2006-02-16T02:30:53', '2005-07-06T10:49:30', '2005-07-13T10:44:30', '1'), - ('2', '741', '2006-02-16T02:30:53', '2005-07-27T14:30:42', '2005-08-02T16:48:42', '1'), - ('497', '3527', '2006-02-16T02:30:53', '2005-08-19T18:31:30', '2005-08-20T13:43:30', '1'), - ('234', '614', '2006-02-16T02:30:53', '2005-07-31T21:55:07', '2005-08-08T23:04:07', '1'), - ('199', '3770', '2006-02-16T02:30:53', '2005-07-28T07:13:40', '2005-08-05T06:50:40', '1'), - ('331', '4005', '2006-02-16T02:30:53', '2005-07-09T08:34:44', '2005-07-10T05:26:44', '1'), - ('288', '2682', '2006-02-16T02:30:53', '2005-08-17T23:49:43', '2005-08-21T21:00:43', '1'), - ('66', '4535', '2006-02-16T02:30:53', '2005-07-07T06:38:31', '2005-07-08T10:44:31', '1'), - ('6', '1929', '2006-02-16T02:30:53', '2005-07-27T06:38:25', '2005-08-03T05:13:25', '1'), - ('142', '2406', '2006-02-16T02:30:53', '2005-08-23T01:46:35', '2005-08-28T22:12:35', '1'), - ('40', '1436', '2006-02-16T02:30:53', '2005-08-19T13:07:12', '2005-08-28T18:12:12', '1'), - ('140', '1506', '2006-02-16T02:30:53', '2005-08-23T15:47:02', '2005-08-25T19:37:02', '1'), - ('317', '3542', '2006-02-16T02:30:53', '2005-08-20T21:26:55', '2005-08-26T19:19:55', '1'), - ('164', '4431', '2006-02-16T02:30:53', '2005-06-20T15:32:11', '2005-06-28T13:08:11', '1'), - ('470', '330', '2006-02-16T02:30:53', '2005-05-25T08:58:25', '2005-05-30T14:14:25', '1'), - ('562', '1375', '2006-02-16T02:30:53', '2005-07-27T07:36:56', '2005-08-02T03:46:56', '1'), - ('144', '1861', '2006-02-16T02:30:53', '2005-07-30T04:31:08', '2005-07-31T09:28:08', '1'), - ('85', '4427', '2006-02-16T02:30:53', '2005-05-30T10:38:37', '2005-06-03T09:56:37', '1'), - ('377', '4437', '2006-02-16T02:30:53', '2005-06-20T15:42:40', '2005-06-25T19:21:40', '1'), - ('562', '763', '2006-02-16T02:30:53', '2005-05-29T16:13:55', '2005-05-31T16:40:55', '1'), - ('107', '691', '2006-02-16T02:30:53', '2005-08-20T02:18:30', '2005-08-27T01:33:30', '1'), - ('109', '3374', '2006-02-16T02:30:53', '2005-05-26T07:27:57', '2005-06-03T12:52:57', '1'), - ('145', '10', '2006-02-16T02:30:53', '2005-07-07T19:46:51', '2005-07-08T21:55:51', '1'), - ('414', '1585', '2006-02-16T02:30:53', '2005-07-27T01:45:44', '2005-07-28T05:50:44', '1'), - ('560', '1981', '2006-02-16T02:30:53', '2005-08-22T00:24:37', '2005-08-25T04:15:37', '1'), - ('343', '2909', '2006-02-16T02:30:53', '2005-06-16T01:42:24', '2005-06-19T01:13:24', '1'), - ('417', '4368', '2006-02-16T02:30:53', '2005-07-07T22:05:30', '2005-07-11T18:42:30', '1'), - ('150', '1214', '2006-02-16T02:30:53', '2005-08-19T03:38:54', '2005-08-27T08:45:54', '1'), - ('107', '4393', '2006-02-16T02:30:53', '2005-07-28T21:11:46', '2005-08-04T18:26:46', '1'), - ('220', '148', '2006-02-16T02:30:53', '2005-08-19T03:52:44', '2005-08-24T22:27:44', '1'), - ('182', '3814', '2006-02-16T02:30:53', '2005-07-07T09:59:49', '2005-07-11T13:34:49', '1'), - ('543', '2451', '2006-02-16T02:30:53', '2005-05-27T22:31:36', '2005-06-03T19:12:36', '1'), - ('247', '537', '2006-02-16T02:30:53', '2005-08-18T04:22:01', '2005-08-20T03:22:01', '1'), - ('30', '1085', '2006-02-16T02:30:53', '2005-07-31T05:33:48', '2005-08-04T07:43:48', '1'), - ('312', '1992', '2006-02-16T02:30:53', '2005-08-21T09:19:49', '2005-08-26T11:06:49', '1'), - ('172', '1650', '2006-02-16T02:30:53', '2005-08-01T15:10:26', '2005-08-04T10:58:26', '1'), - ('210', '1859', '2006-02-16T02:30:53', '2005-06-19T23:13:04', '2005-06-23T22:47:04', '1'), - ('528', '1338', '2006-02-16T02:30:53', '2005-05-27T21:36:15', '2005-05-29T21:07:15', '1'), - ('340', '2222', '2006-02-16T02:30:53', '2005-08-19T05:38:29', '2005-08-20T08:15:29', '1'), - ('107', '2530', '2006-02-16T02:30:53', '2005-06-20T18:19:29', '2005-06-23T23:40:29', '1'), - ('134', '159', '2006-02-16T02:30:53', '2005-06-17T03:09:56', '2005-06-18T01:49:56', '1'), - ('368', '3910', '2006-02-16T02:30:53', '2005-07-30T20:15:58', '2005-08-03T21:21:58', '1'), - ('104', '1624', '2006-02-16T02:30:53', '2005-08-19T13:59:53', '2005-08-25T12:10:53', '1'), - ('36', '3538', '2006-02-16T02:30:53', '2005-07-30T18:52:19', '2005-08-01T12:53:19', '1'), - ('598', '3036', '2006-02-16T02:30:53', '2005-07-10T09:16:08', '2005-07-15T09:44:08', '1'), - ('585', '4290', '2006-02-16T02:30:53', '2005-07-08T06:01:56', '2005-07-13T11:24:56', '1'), - ('383', '4008', '2006-02-16T02:30:53', '2005-05-25T09:19:16', '2005-05-27T04:24:16', '1'), - ('24', '2609', '2006-02-16T02:30:53', '2005-06-17T16:27:51', '2005-06-20T20:46:51', '1'), - ('579', '640', '2006-02-16T02:30:53', '2005-07-31T17:37:30', '2005-08-02T14:49:30', '1'), - ('275', '524', '2006-02-16T02:30:53', '2005-08-22T18:39:44', '2005-08-24T17:29:44', '1'), - ('150', '3366', '2006-02-16T02:30:53', '2005-08-19T21:23:19', '2005-08-24T22:12:19', '1'), - ('198', '3836', '2006-02-16T02:30:53', '2005-07-06T13:14:28', '2005-07-13T09:23:28', '1'), - ('30', '3616', '2006-02-16T02:30:53', '2005-07-30T16:55:53', '2005-08-07T11:23:53', '1'), - ('353', '3140', '2006-02-16T02:30:53', '2005-06-15T13:30:30', '2005-06-17T14:55:30', '1'), - ('198', '3629', '2006-02-16T02:30:53', '2005-07-08T06:18:01', '2005-07-10T08:59:01', '1'), - ('561', '1957', '2006-02-16T02:30:53', '2005-07-12T00:16:19', '2005-07-17T19:15:19', '1'), - ('360', '113', '2006-02-16T02:30:53', '2005-07-31T04:30:02', '2005-08-06T23:34:02', '1'), - ('9', '2118', '2006-02-16T02:30:53', '2005-08-18T18:48:58', '2005-08-21T14:15:58', '1'), - ('530', '2712', '2006-02-16T02:30:53', '2005-08-22T10:49:06', '2005-08-23T10:25:06', '1'), - ('584', '3462', '2006-02-16T02:30:53', '2005-05-27T09:25:32', '2005-06-02T06:19:32', '1'), - ('133', '3890', '2006-02-16T02:30:53', '2005-05-27T18:57:02', '2005-06-05T18:38:02', '1'), - ('343', '2466', '2006-02-16T02:30:53', '2005-08-17T01:34:32', '2005-08-24T05:47:32', '1'), - ('75', '951', '2006-02-16T02:30:53', '2005-07-29T22:22:12', '2005-08-07T21:03:12', '1'), - ('282', '4201', '2006-02-16T02:30:53', '2005-06-18T00:29:51', '2005-06-21T01:41:51', '1'), - ('323', '873', '2006-02-16T02:30:53', '2005-07-30T18:44:23', '2005-08-04T15:03:23', '1'), - ('252', '2270', '2006-02-16T02:30:53', '2005-08-01T23:28:00', '2005-08-07T01:21:00', '1'), - ('89', '2108', '2006-02-16T02:30:53', '2005-07-08T01:22:23', '2005-07-13T21:17:23', '1'), - ('143', '1792', '2006-02-16T02:30:53', '2005-07-11T05:05:30', '2005-07-18T04:22:30', '1'), - ('282', '1338', '2006-02-16T02:30:53', '2005-07-29T08:26:04', '2005-08-02T07:18:04', '1'), - ('75', '104', '2006-02-16T02:30:53', '2005-08-02T00:27:24', '2005-08-05T06:25:24', '1'), - ('527', '4357', '2006-02-16T02:30:53', '2005-08-01T14:56:14', '2005-08-07T09:33:14', '1'), - ('230', '3886', '2006-02-16T02:30:53', '2005-07-09T14:23:05', '2005-07-17T14:03:05', '1'), - ('593', '3681', '2006-02-16T02:30:53', '2005-08-02T01:43:02', '2005-08-04T04:34:02', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['4719', '1244', '2057', '8020', '7679', '2182', '13885', '14148', '15804', '9577', '10542', '189', '10576', '5910', '2913', '2652', '8125', '7507', '3036', '10625', '4596', '10902', '3062', '242', '8476', '10271', '8734', '15983', '5086', '1594', '12927', '15919', '8773', '4973', '10479', '14700', '12883', '10323', '141', '6730', '14539', '13882', '337', '3098', '10255', '11044', '15733', '11259', '1860', '2705', '7639', '4392', '2832', '15471', '12838', '1477', '4176', '4042', '373', '5365', '2251', '31', '16045', '2467', '7937', '10740', '15176', '5825', '14310', '11821', '7889', '5231', '7202', '10400', '10963', '11736', '7271', '7274', '5334', '9349', '9455', '8524', '6527', '9217', '14258', '12933', '12625', '8200', '9105', '12980', '2042', '11575', '10677', '5880', '3712', '12598', '524', '8639', '221', '8877']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('556', '1315', '2006-02-16T02:30:53', '2005-07-08T12:33:00', '2005-07-15T12:30:00', '1'), - ('515', '1026', '2006-02-16T02:30:53', '2005-06-15T05:08:40', '2005-06-20T10:41:40', '1'), - ('190', '2803', '2006-02-16T02:30:53', '2005-06-17T15:31:58', '2005-06-25T09:39:58', '1'), - ('498', '4459', '2006-02-16T02:30:53', '2005-07-28T15:43:32', '2005-08-05T12:19:32', '1'), - ('444', '1063', '2006-02-16T02:30:53', '2005-07-28T02:58:39', '2005-08-02T04:58:39', '1'), - ('454', '3494', '2006-02-16T02:30:53', '2005-06-18T00:56:18', '2005-06-26T20:01:18', '1'), - ('537', '3195', '2006-02-16T02:30:53', '2005-08-20T15:32:09', '2005-08-26T15:54:09', '1'), - ('528', '1605', '2006-02-16T02:30:53', '2005-08-21T02:17:49', '2005-08-22T00:12:49', '1'), - ('585', '3338', '2006-02-16T02:30:53', '2005-08-23T14:29:16', '2005-08-26T08:41:16', '1'), - ('526', '2423', '2006-02-16T02:30:53', '2005-07-31T02:53:33', '2005-08-07T05:56:33', '1'), - ('465', '1102', '2006-02-16T02:30:53', '2005-08-01T12:32:23', '2005-08-08T16:26:23', '1'), - ('247', '984', '2006-02-16T02:30:53', '2005-05-26T06:01:41', '2005-05-27T06:11:41', '1'), - ('180', '1876', '2006-02-16T02:30:53', '2005-08-01T13:46:02', '2005-08-05T10:19:02', '1'), - ('464', '1039', '2006-02-16T02:30:53', '2005-07-10T20:51:34', '2005-07-19T14:54:34', '1'), - ('402', '3456', '2006-02-16T02:30:53', '2005-06-20T03:42:27', '2005-06-23T04:47:27', '1'), - ('589', '3108', '2006-02-16T02:30:53', '2005-06-19T10:35:26', '2005-06-28T08:03:26', '1'), - ('96', '4330', '2006-02-16T02:30:53', '2005-07-28T19:31:48', '2005-07-30T01:09:48', '1'), - ('512', '3618', '2006-02-16T02:30:53', '2005-07-27T20:31:48', '2005-08-02T17:27:48', '1'), - ('399', '4463', '2006-02-16T02:30:53', '2005-06-20T12:18:31', '2005-06-29T09:52:31', '1'), - ('5', '3022', '2006-02-16T02:30:53', '2005-08-01T15:27:10', '2005-08-02T13:16:10', '1'), - ('306', '2280', '2006-02-16T02:30:53', '2005-07-08T06:41:25', '2005-07-14T01:36:25', '1'), - ('486', '3863', '2006-02-16T02:30:53', '2005-08-02T01:35:46', '2005-08-09T01:59:46', '1'), - ('75', '591', '2006-02-16T02:30:53', '2005-06-20T13:50:00', '2005-06-27T08:18:00', '1'), - ('214', '2095', '2006-02-16T02:30:53', '2005-05-26T13:05:08', '2005-06-02T15:26:08', '1'), - ('470', '3741', '2006-02-16T02:30:53', '2005-07-29T08:39:12', '2005-08-06T03:03:12', '1'), - ('6', '3692', '2006-02-16T02:30:53', '2005-08-01T03:13:39', '2005-08-07T23:40:39', '1'), - ('303', '2374', '2006-02-16T02:30:53', '2005-07-29T18:28:15', '2005-08-05T23:38:15', '1'), - ('464', '3318', '2006-02-16T02:30:53', '2005-08-23T20:13:38', '2005-08-30T18:42:38', '1'), - ('539', '3072', '2006-02-16T02:30:53', '2005-07-09T05:40:04', '2005-07-16T07:51:04', '1'), - ('470', '3858', '2006-02-16T02:30:53', '2005-06-16T05:15:12', '2005-06-25T00:38:12', '1'), - ('223', '1171', '2006-02-16T02:30:53', '2005-08-19T05:02:46', '2005-08-23T01:08:46', '1'), - ('497', '1746', '2006-02-16T02:30:53', '2005-08-23T18:01:31', '2005-08-24T16:27:31', '1'), - ('592', '131', '2006-02-16T02:30:53', '2005-07-29T19:55:34', '2005-07-30T14:11:34', '1'), - ('432', '391', '2006-02-16T02:30:53', '2005-07-08T23:58:18', '2005-07-14T21:42:18', '1'), - ('275', '4580', '2006-02-16T02:30:53', '2005-08-01T10:11:25', '2005-08-06T04:52:25', '1'), - ('360', '3446', '2006-02-16T02:30:53', '2005-08-21T20:53:40', '2005-08-23T22:01:40', '1'), - ('555', '964', '2006-02-16T02:30:53', '2005-08-19T03:33:47', '2005-08-23T21:55:47', '1'), - ('577', '3539', '2006-02-16T02:30:53', '2005-08-01T04:44:58', '2005-08-06T07:56:58', '1'), - ('89', '811', '2006-02-16T02:30:53', '2005-05-25T23:34:53', '2005-06-02T01:57:53', '1'), - ('532', '1552', '2006-02-16T02:30:53', '2005-07-12T13:58:25', '2005-07-20T13:01:25', '1'), - ('41', '3340', '2006-02-16T02:30:53', '2005-08-21T15:29:47', '2005-08-28T19:01:47', '1'), - ('51', '3245', '2006-02-16T02:30:53', '2005-08-20T15:23:26', '2005-08-22T13:03:26', '1'), - ('19', '751', '2006-02-16T02:30:53', '2005-05-27T03:22:30', '2005-06-02T03:27:30', '1'), - ('498', '3409', '2006-02-16T02:30:53', '2005-06-20T16:37:01', '2005-06-22T22:24:01', '1'), - ('459', '4558', '2006-02-16T02:30:53', '2005-08-01T02:46:13', '2005-08-03T05:54:13', '1'), - ('122', '2922', '2006-02-16T02:30:53', '2005-08-02T06:05:27', '2005-08-06T05:15:27', '1'), - ('512', '4185', '2006-02-16T02:30:53', '2005-08-23T11:37:32', '2005-08-28T16:27:32', '1'), - ('330', '896', '2006-02-16T02:30:53', '2005-08-02T13:46:30', '2005-08-07T14:03:30', '1'), - ('293', '1853', '2006-02-16T02:30:53', '2005-06-17T01:17:12', '2005-06-21T22:35:12', '1'), - ('562', '1191', '2006-02-16T02:30:53', '2005-06-19T13:54:30', '2005-06-20T12:31:30', '1'), - ('459', '767', '2006-02-16T02:30:53', '2005-07-28T01:14:36', '2005-07-29T00:19:36', '1'), - ('491', '4236', '2006-02-16T02:30:53', '2005-07-07T21:11:02', '2005-07-13T21:52:02', '1'), - ('593', '828', '2006-02-16T02:30:53', '2005-06-19T21:21:53', '2005-06-28T23:00:53', '1'), - ('139', '2591', '2006-02-16T02:30:53', '2005-08-23T01:38:48', '2005-08-31T19:47:48', '1'), - ('308', '1207', '2006-02-16T02:30:53', '2005-08-19T01:51:50', '2005-08-27T23:12:50', '1'), - ('51', '418', '2006-02-16T02:30:53', '2005-06-15T21:11:18', '2005-06-19T02:05:18', '1'), - ('420', '2745', '2006-02-16T02:30:53', '2005-07-07T10:03:34', '2005-07-16T08:43:34', '1'), - ('10', '50', '2006-02-16T02:30:53', '2005-07-07T03:06:40', '2005-07-10T02:37:40', '1'), - ('464', '1649', '2006-02-16T02:30:53', '2005-05-27T08:16:25', '2005-06-01T11:41:25', '1'), - ('527', '4469', '2006-02-16T02:30:53', '2005-07-09T18:27:00', '2005-07-11T14:18:00', '1'), - ('143', '1458', '2006-02-16T02:30:53', '2005-06-18T05:05:08', '2005-06-23T08:34:08', '1'), - ('369', '4482', '2006-02-16T02:30:53', '2005-05-25T04:05:17', '2005-05-30T07:15:17', '1'), - ('14', '772', '2006-02-16T02:30:53', '2005-08-23T22:25:26', '2005-08-25T23:54:26', '1'), - ('177', '4387', '2006-02-16T02:30:53', '2005-06-18T20:20:05', '2005-06-20T17:01:05', '1'), - ('323', '3944', '2006-02-16T02:30:53', '2005-07-28T12:38:22', '2005-07-29T09:19:22', '1'), - ('144', '3215', '2006-02-16T02:30:53', '2005-08-01T19:50:32', '2005-08-07T23:25:32', '1'), - ('115', '3063', '2006-02-16T02:30:53', '2005-08-22T15:30:25', '2005-08-31T20:00:25', '1'), - ('444', '3843', '2006-02-16T02:30:53', '2005-07-10T16:20:30', '2005-07-11T18:58:30', '1'), - ('177', '95', '2006-02-16T02:30:53', '2005-08-21T07:44:32', '2005-08-22T09:02:32', '1'), - ('20', '2711', '2006-02-16T02:30:53', '2005-08-17T12:27:55', '2005-08-18T07:07:55', '1'), - ('416', '3123', '2006-02-16T02:30:53', '2005-07-28T10:43:21', '2005-07-30T09:11:21', '1'), - ('405', '1275', '2006-02-16T02:30:53', '2005-07-09T12:35:02', '2005-07-10T09:22:02', '1'), - ('560', '109', '2006-02-16T02:30:53', '2005-07-27T09:00:20', '2005-08-04T03:09:20', '1'), - ('132', '3897', '2006-02-16T02:30:53', '2005-08-01T07:18:24', '2005-08-10T08:38:24', '1'), - ('36', '4501', '2006-02-16T02:30:53', '2005-08-02T03:48:17', '2005-08-02T22:15:17', '1'), - ('535', '4217', '2006-02-16T02:30:53', '2005-08-17T08:40:55', '2005-08-26T09:03:55', '1'), - ('469', '858', '2006-02-16T02:30:53', '2005-07-27T11:29:11', '2005-08-05T15:33:11', '1'), - ('180', '4087', '2006-02-16T02:30:53', '2005-07-27T11:35:34', '2005-08-01T07:10:34', '1'), - ('482', '3852', '2006-02-16T02:30:53', '2005-07-09T17:00:13', '2005-07-11T15:50:13', '1'), - ('579', '3739', '2006-02-16T02:30:53', '2005-07-30T18:20:08', '2005-08-08T22:06:08', '1'), - ('220', '2647', '2006-02-16T02:30:53', '2005-07-30T22:20:29', '2005-08-08T20:08:29', '1'), - ('124', '2110', '2006-02-16T02:30:53', '2005-07-29T10:20:07', '2005-08-03T04:30:07', '1'), - ('65', '538', '2006-02-16T02:30:53', '2005-07-12T04:23:06', '2005-07-17T00:20:06', '1'), - ('112', '1561', '2006-02-16T02:30:53', '2005-07-30T13:13:55', '2005-08-05T17:27:55', '1'), - ('359', '752', '2006-02-16T02:30:53', '2005-08-21T05:56:36', '2005-08-26T06:14:36', '1'), - ('589', '4103', '2006-02-16T02:30:53', '2005-08-19T05:18:20', '2005-08-27T00:13:20', '1'), - ('108', '2645', '2006-02-16T02:30:53', '2005-08-18T17:36:19', '2005-08-23T11:42:19', '1'), - ('185', '353', '2006-02-16T02:30:53', '2005-07-28T23:10:46', '2005-07-29T18:35:46', '1'), - ('262', '4443', '2006-02-16T02:30:53', '2005-07-30T08:50:25', '2005-08-05T06:08:25', '1'), - ('144', '1854', '2006-02-16T02:30:53', '2005-08-19T07:03:14', '2005-08-26T05:07:14', '1'), - ('84', '3102', '2006-02-16T02:30:53', '2005-06-17T14:31:02', '2005-06-18T14:43:02', '1'), - ('319', '1725', '2006-02-16T02:30:53', '2005-08-17T01:50:26', '2005-08-18T00:43:26', '1'), - ('483', '4350', '2006-02-16T02:30:53', '2005-08-01T17:24:35', '2005-08-04T20:03:35', '1'), - ('482', '359', '2006-02-16T02:30:53', '2005-07-10T19:14:58', '2005-07-17T01:13:58', '1'), - ('504', '3741', '2006-02-16T02:30:53', '2005-07-06T10:47:35', '2005-07-15T09:39:35', '1'), - ('340', '3159', '2006-02-16T02:30:53', '2005-08-18T16:34:03', '2005-08-22T16:44:03', '1'), - ('223', '1962', '2006-02-16T02:30:53', '2005-05-28T03:57:28', '2005-05-31T05:20:28', '1'), - ('290', '3504', '2006-02-16T02:30:53', '2005-07-29T14:30:31', '2005-08-02T16:04:31', '1'), - ('143', '3578', '2006-02-16T02:30:53', '2005-05-26T10:14:09', '2005-05-29T05:57:09', '1'), - ('417', '1140', '2006-02-16T02:30:53', '2005-07-30T00:15:22', '2005-07-31T00:53:22', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['2168', '3573', '15029', '10266', '3165', '15357', '4628', '4120', '12711', '11064', '3227', '3196', '3525', '10038', '11256', '6380', '13251', '14358', '10101', '1209', '2028', '6995', '11556', '122', '8778', '11789', '762', '10151', '4635', '7737', '9316', '7333', '4133', '2924', '14843', '8353', '7976', '11955', '3793', '6911', '10926', '9514', '4840', '6496', '15651', '187', '7465', '13513', '8978', '13624', '2897', '11590', '1581', '3290', '4437', '11961', '2614', '15521', '3977', '11552', '6820', '3495', '9250', '166', '9347', '5380', '8030', '8050', '14562', '10299', '9139', '12144', '4396', '14567', '7674', '11275', '11133', '11084', '3586', '7836', '1203', '11707', '3923', '13373', '4560', '10626', '7250', '9646', '7883', '14953', '6294', '8513', '1647', '3325', '6432', '10183', '15672', '2244', '833', '16023']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('308', '802', '2006-02-16T02:30:53', '2005-06-17T23:53:24', '2005-06-20T01:11:24', '1'), - ('66', '146', '2006-02-16T02:30:53', '2005-07-06T03:33:48', '2005-07-07T22:39:48', '1'), - ('139', '2234', '2006-02-16T02:30:53', '2005-08-22T09:04:53', '2005-08-25T09:03:53', '1'), - ('49', '476', '2006-02-16T02:30:53', '2005-08-01T03:05:59', '2005-08-06T06:23:59', '1'), - ('85', '796', '2006-02-16T02:30:53', '2005-06-20T21:29:17', '2005-06-22T18:03:17', '1'), - ('24', '727', '2006-02-16T02:30:53', '2005-08-22T21:28:59', '2005-08-25T17:15:59', '1'), - ('540', '1888', '2006-02-16T02:30:53', '2005-07-08T08:25:52', '2005-07-10T11:22:52', '1'), - ('559', '987', '2006-02-16T02:30:53', '2005-07-07T07:07:03', '2005-07-16T04:07:03', '1'), - ('122', '2530', '2006-02-16T02:30:53', '2005-08-18T21:03:32', '2005-08-26T17:31:32', '1'), - ('338', '3012', '2006-02-16T02:30:53', '2005-08-02T06:55:17', '2005-08-06T03:29:17', '1'), - ('568', '1156', '2006-02-16T02:30:53', '2005-06-21T02:18:25', '2005-06-27T00:59:25', '1'), - ('52', '1575', '2006-02-16T02:30:53', '2005-06-21T00:02:28', '2005-06-22T23:08:28', '1'), - ('51', '208', '2006-02-16T02:30:53', '2005-07-06T01:02:39', '2005-07-14T02:27:39', '1'), - ('112', '3727', '2006-02-16T02:30:53', '2005-07-31T18:49:12', '2005-08-01T18:02:12', '1'), - ('2', '2060', '2006-02-16T02:30:53', '2005-08-02T13:44:53', '2005-08-04T16:39:53', '1'), - ('172', '3378', '2006-02-16T02:30:53', '2005-07-11T21:55:40', '2005-07-17T20:42:40', '1'), - ('111', '4216', '2006-02-16T02:30:53', '2005-08-19T16:48:37', '2005-08-20T16:33:37', '1'), - ('112', '861', '2006-02-16T02:30:53', '2005-08-21T09:14:28', '2005-08-24T05:05:28', '1'), - ('119', '2513', '2006-02-16T02:30:53', '2005-07-31T20:47:29', '2005-08-04T21:28:29', '1'), - ('146', '1494', '2006-02-16T02:30:53', '2005-06-15T02:31:12', '2005-06-21T07:39:12', '1'), - ('155', '4451', '2006-02-16T02:30:53', '2005-06-17T13:08:08', '2005-06-23T10:54:08', '1'), - ('66', '1630', '2006-02-16T02:30:53', '2005-07-27T01:12:13', '2005-07-29T21:26:13', '1'), - ('9', '373', '2006-02-16T02:30:53', '2005-08-17T01:11:53', '2005-08-18T23:41:53', '1'), - ('273', '2908', '2006-02-16T02:30:53', '2005-05-25T19:46:21', '2005-06-02T19:07:21', '1'), - ('582', '3654', '2006-02-16T02:30:53', '2005-07-29T20:14:25', '2005-08-04T00:50:25', '1'), - ('150', '851', '2006-02-16T02:30:53', '2005-08-17T10:59:24', '2005-08-26T16:17:24', '1'), - ('146', '3683', '2006-02-16T02:30:53', '2005-05-29T11:15:51', '2005-06-06T07:48:51', '1'), - ('361', '4442', '2006-02-16T02:30:53', '2005-07-31T22:22:37', '2005-08-01T22:20:37', '1'), - ('65', '2434', '2006-02-16T02:30:53', '2005-07-08T08:42:40', '2005-07-14T10:31:40', '1'), - ('494', '1235', '2006-02-16T02:30:53', '2005-07-28T05:15:03', '2005-08-04T01:24:03', '1'), - ('366', '4409', '2006-02-16T02:30:53', '2005-07-30T17:11:58', '2005-08-05T14:36:58', '1'), - ('230', '1331', '2006-02-16T02:30:53', '2005-07-27T13:59:11', '2005-07-30T16:04:11', '1'), - ('488', '3672', '2006-02-16T02:30:53', '2005-07-07T08:12:26', '2005-07-16T03:43:26', '1'), - ('132', '580', '2006-02-16T02:30:53', '2005-06-20T04:20:14', '2005-06-21T01:13:14', '1'), - ('454', '3000', '2006-02-16T02:30:53', '2005-08-22T02:05:25', '2005-08-28T22:11:25', '1'), - ('585', '26', '2006-02-16T02:30:53', '2005-07-29T04:52:10', '2005-07-30T04:01:10', '1'), - ('205', '2296', '2006-02-16T02:30:53', '2005-07-28T14:13:24', '2005-08-05T09:01:24', '1'), - ('319', '1221', '2006-02-16T02:30:53', '2005-08-17T17:21:35', '2005-08-24T22:06:35', '1'), - ('553', '4558', '2006-02-16T02:30:53', '2005-07-06T14:32:44', '2005-07-08T13:55:44', '1'), - ('361', '901', '2006-02-16T02:30:53', '2005-07-12T22:14:34', '2005-07-18T20:17:34', '1'), - ('460', '4016', '2006-02-16T02:30:53', '2005-08-02T02:26:37', '2005-08-09T20:55:37', '1'), - ('243', '1892', '2006-02-16T02:30:53', '2005-07-31T00:29:44', '2005-08-02T23:49:44', '1'), - ('119', '1670', '2006-02-16T02:30:53', '2005-07-08T18:18:16', '2005-07-16T14:59:16', '1'), - ('139', '3550', '2006-02-16T02:30:53', '2005-07-12T02:57:39', '2005-07-20T01:43:39', '1'), - ('451', '3393', '2006-02-16T02:30:53', '2005-08-23T08:31:49', '2005-08-26T02:57:49', '1'), - ('515', '4004', '2006-02-16T02:30:53', '2005-05-26T05:42:37', '2005-06-04T00:38:37', '1'), - ('115', '2357', '2006-02-16T02:30:53', '2005-07-27T18:50:30', '2005-07-30T20:55:30', '1'), - ('454', '1653', '2006-02-16T02:30:53', '2005-08-20T02:27:53', '2005-08-22T06:10:53', '1'), - ('5', '711', '2006-02-16T02:30:53', '2005-07-30T04:14:28', '2005-08-06T09:08:28', '1'), - ('63', '430', '2006-02-16T02:30:53', '2005-08-20T06:51:02', '2005-08-29T02:39:02', '1'), - ('107', '3464', '2006-02-16T02:30:53', '2005-06-20T02:34:23', '2005-06-25T05:29:23', '1'), - ('491', '3600', '2006-02-16T02:30:53', '2005-08-17T02:28:33', '2005-08-20T03:13:33', '1'), - ('109', '4004', '2006-02-16T02:30:53', '2005-06-16T04:28:45', '2005-06-18T07:07:45', '1'), - ('293', '2727', '2006-02-16T02:30:53', '2005-06-21T06:45:34', '2005-06-28T09:44:34', '1'), - ('414', '3578', '2006-02-16T02:30:53', '2005-07-07T22:55:41', '2005-07-13T19:40:41', '1'), - ('276', '2015', '2006-02-16T02:30:53', '2005-08-17T17:28:01', '2005-08-21T20:43:01', '1'), - ('145', '4147', '2006-02-16T02:30:53', '2005-06-19T07:28:11', '2005-06-22T12:33:11', '1'), - ('331', '134', '2006-02-16T02:30:53', '2005-08-23T03:30:51', '2005-08-28T22:09:51', '1'), - ('449', '1284', '2006-02-16T02:30:53', '2005-07-06T23:00:49', '2005-07-15T00:41:49', '1'), - ('230', '1143', '2006-02-16T02:30:53', '2005-08-17T01:04:29', '2005-08-23T23:07:29', '1'), - ('243', '223', '2006-02-16T02:30:53', '2005-07-12T18:21:30', '2005-07-14T15:14:30', '1'), - ('553', '2306', '2006-02-16T02:30:53', '2005-07-05T23:50:04', '2005-07-10T01:06:04', '1'), - ('539', '4544', '2006-02-16T02:30:53', '2005-07-30T14:18:16', '2005-08-04T12:31:16', '1'), - ('322', '3894', '2006-02-16T02:30:53', '2005-05-26T02:49:11', '2005-05-31T01:28:11', '1'), - ('479', '3557', '2006-02-16T02:30:53', '2005-07-30T18:16:03', '2005-08-05T18:35:03', '1'), - ('166', '3047', '2006-02-16T02:30:53', '2005-07-09T19:08:44', '2005-07-11T20:09:44', '1'), - ('30', '2633', '2006-02-16T02:30:53', '2005-07-28T16:12:53', '2005-07-31T17:15:53', '1'), - ('488', '1864', '2006-02-16T02:30:53', '2005-07-28T16:55:47', '2005-08-02T13:20:47', '1'), - ('107', '3501', '2006-02-16T02:30:53', '2005-08-21T16:22:59', '2005-08-22T21:15:59', '1'), - ('369', '1125', '2006-02-16T02:30:53', '2005-08-01T04:08:04', '2005-08-04T08:11:04', '1'), - ('133', '2809', '2006-02-16T02:30:53', '2005-07-30T10:11:52', '2005-08-03T12:44:52', '1'), - ('587', '512', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('275', '750', '2006-02-16T02:30:53', '2005-07-07T21:14:19', '2005-07-10T19:22:19', '1'), - ('214', '3805', '2006-02-16T02:30:53', '2005-08-21T16:27:25', '2005-08-26T10:47:25', '1'), - ('177', '682', '2006-02-16T02:30:53', '2005-07-28T02:54:30', '2005-08-05T23:09:30', '1'), - ('464', '2838', '2006-02-16T02:30:53', '2005-08-02T14:25:58', '2005-08-07T11:20:58', '1'), - ('120', '675', '2006-02-16T02:30:53', '2005-08-02T09:15:45', '2005-08-04T10:39:45', '1'), - ('369', '32', '2006-02-16T02:30:53', '2005-08-02T07:34:19', '2005-08-07T09:30:19', '1'), - ('493', '616', '2006-02-16T02:30:53', '2005-07-06T04:24:42', '2005-07-09T02:37:42', '1'), - ('481', '1770', '2006-02-16T02:30:53', '2005-07-28T08:55:27', '2005-08-05T09:35:27', '1'), - ('452', '2223', '2006-02-16T02:30:53', '2005-06-15T02:09:02', '2005-06-21T00:04:02', '1'), - ('581', '1030', '2006-02-16T02:30:53', '2005-08-17T07:24:59', '2005-08-24T10:40:59', '1'), - ('63', '2039', '2006-02-16T02:30:53', '2005-07-06T20:34:10', '2005-07-13T19:20:10', '1'), - ('7', '4045', '2006-02-16T02:30:53', '2005-08-19T21:23:31', '2005-08-25T22:38:31', '1'), - ('36', '303', '2006-02-16T02:30:53', '2005-07-08T04:58:48', '2005-07-10T04:27:48', '1'), - ('122', '1042', '2006-02-16T02:30:53', '2005-08-01T15:32:41', '2005-08-05T18:08:41', '1'), - ('589', '3410', '2006-02-16T02:30:53', '2005-07-27T10:44:09', '2005-07-28T11:47:09', '1'), - ('89', '3756', '2006-02-16T02:30:53', '2005-07-31T05:43:28', '2005-08-08T04:00:28', '1'), - ('526', '447', '2006-02-16T02:30:53', '2005-07-28T10:37:20', '2005-08-02T05:08:20', '1'), - ('182', '816', '2006-02-16T02:30:53', '2005-08-22T06:23:54', '2005-08-28T03:19:54', '1'), - ('463', '1732', '2006-02-16T02:30:53', '2005-07-11T17:25:55', '2005-07-15T17:48:55', '1'), - ('142', '3156', '2006-02-16T02:30:53', '2005-07-29T09:52:59', '2005-07-31T12:05:59', '1'), - ('454', '1936', '2006-02-16T02:30:53', '2005-06-16T09:14:58', '2005-06-17T10:46:58', '1'), - ('185', '1720', '2006-02-16T02:30:53', '2005-06-21T08:51:44', '2005-06-27T06:16:44', '1'), - ('293', '970', '2006-02-16T02:30:53', '2005-07-12T00:09:41', '2005-07-20T20:06:41', '1'), - ('377', '4319', '2006-02-16T02:30:53', '2005-08-01T00:08:01', '2005-08-09T20:41:01', '1'), - ('210', '701', '2006-02-16T02:30:53', '2005-08-23T09:09:18', '2005-08-27T06:19:18', '1'), - ('233', '3629', '2006-02-16T02:30:53', '2005-06-18T04:46:33', '2005-06-20T04:28:33', '1'), - ('417', '2898', '2006-02-16T02:30:53', '2005-05-29T23:21:56', '2005-06-02T18:40:56', '1'), - ('124', '2347', '2006-02-16T02:30:53', '2005-08-23T21:45:02', '2005-08-24T21:28:02', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['15428', '2870', '6068', '354', '4402', '4280', '13901', '15213', '9026', '11383', '5374', '2493', '2720', '10002', '11274', '11316', '4105', '13233', '4762', '12683', '13963', '7196', '4483', '8542', '11197', '10601', '1109', '15828', '324', '10631', '5715', '1468', '10925', '14817', '2165', '11351', '15089', '11557', '12581', '3452', '14702', '9075', '13715', '1587', '13548', '4020', '12630', '6905', '10495', '4430', '15417', '2845', '2211', '10742', '3', '7386', '200', '1144', '11953', '3572', '8739', '2794', '15236', '13378', '10548', '5124', '12101', '10516', '11520', '4972', '11622', '8620', '12905', '4233', '1888', '13500', '12248', '2457', '1649', '1466', '9834', '13408', '7914', '9733', '7636', '6635', '7194', '12173', '10096', '12950', '7600', '15161', '9713', '6702', '2237', '4135', '7539', '2674', '10919', '11045']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('402', '4379', '2006-02-16T02:30:53', '2005-08-23T00:11:52', '2005-08-24T02:35:52', '1'), - ('467', '214', '2006-02-16T02:30:53', '2005-06-20T00:17:46', '2005-06-28T20:21:46', '1'), - ('265', '2331', '2006-02-16T02:30:53', '2005-07-11T04:41:09', '2005-07-14T04:45:09', '1'), - ('452', '2058', '2006-02-16T02:30:53', '2005-05-27T06:12:26', '2005-06-01T06:48:26', '1'), - ('26', '1198', '2006-02-16T02:30:53', '2005-07-07T21:28:46', '2005-07-08T17:04:46', '1'), - ('593', '1115', '2006-02-16T02:30:53', '2005-07-07T15:09:31', '2005-07-13T14:47:31', '1'), - ('166', '3281', '2006-02-16T02:30:53', '2005-08-20T16:06:53', '2005-08-28T11:30:53', '1'), - ('166', '2002', '2006-02-16T02:30:53', '2005-08-22T16:49:02', '2005-08-31T20:22:02', '1'), - ('423', '1524', '2006-02-16T02:30:53', '2005-07-30T05:55:31', '2005-08-01T03:19:31', '1'), - ('445', '257', '2006-02-16T02:30:53', '2005-08-02T18:22:05', '2005-08-11T17:18:05', '1'), - ('144', '946', '2006-02-16T02:30:53', '2005-07-09T18:52:08', '2005-07-16T16:34:08', '1'), - ('269', '4121', '2006-02-16T02:30:53', '2005-06-18T22:12:09', '2005-06-27T23:44:09', '1'), - ('504', '3597', '2006-02-16T02:30:53', '2005-06-19T14:51:55', '2005-06-27T13:06:55', '1'), - ('323', '1002', '2006-02-16T02:30:53', '2005-07-31T17:48:16', '2005-08-06T16:15:16', '1'), - ('70', '1253', '2006-02-16T02:30:53', '2005-08-02T14:24:08', '2005-08-11T14:56:08', '1'), - ('108', '521', '2006-02-16T02:30:53', '2005-08-02T16:07:49', '2005-08-10T13:22:49', '1'), - ('423', '439', '2006-02-16T02:30:53', '2005-07-07T06:31:00', '2005-07-09T03:52:00', '1'), - ('279', '1057', '2006-02-16T02:30:53', '2005-08-19T16:14:41', '2005-08-24T21:13:41', '1'), - ('36', '390', '2006-02-16T02:30:53', '2005-07-08T14:54:42', '2005-07-12T18:08:42', '1'), - ('166', '1802', '2006-02-16T02:30:53', '2005-08-18T19:50:43', '2005-08-26T00:47:43', '1'), - ('368', '4145', '2006-02-16T02:30:53', '2005-08-20T18:20:18', '2005-08-24T21:26:18', '1'), - ('118', '2998', '2006-02-16T02:30:53', '2005-07-27T08:49:08', '2005-07-29T03:54:08', '1'), - ('425', '1222', '2006-02-16T02:30:53', '2005-07-08T01:03:12', '2005-07-17T00:20:12', '1'), - ('213', '792', '2006-02-16T02:30:53', '2005-07-29T11:01:50', '2005-07-30T08:19:50', '1'), - ('122', '3041', '2006-02-16T02:30:53', '2005-08-02T11:45:07', '2005-08-03T09:07:07', '1'), - ('420', '2843', '2006-02-16T02:30:53', '2005-08-01T14:25:40', '2005-08-10T09:07:40', '1'), - ('481', '2031', '2006-02-16T02:30:53', '2005-05-31T15:12:15', '2005-06-09T16:21:15', '1'), - ('327', '428', '2006-02-16T02:30:53', '2005-08-23T15:16:32', '2005-08-29T12:20:32', '1'), - ('292', '3364', '2006-02-16T02:30:53', '2005-05-27T01:00:04', '2005-05-30T04:27:04', '1'), - ('304', '2712', '2006-02-16T02:30:53', '2005-08-01T15:35:14', '2005-08-03T10:48:14', '1'), - ('132', '1638', '2006-02-16T02:30:53', '2005-07-10T10:48:03', '2005-07-18T11:27:03', '1'), - ('230', '228', '2006-02-16T02:30:53', '2005-06-15T20:48:22', '2005-06-21T19:48:22', '1'), - ('98', '1475', '2006-02-16T02:30:53', '2005-08-02T02:24:38', '2005-08-03T05:06:38', '1'), - ('215', '910', '2006-02-16T02:30:53', '2005-08-22T01:17:16', '2005-08-27T02:43:16', '1'), - ('471', '2392', '2006-02-16T02:30:53', '2005-06-17T23:51:10', '2005-06-21T23:54:10', '1'), - ('198', '242', '2006-02-16T02:30:53', '2005-08-02T17:28:07', '2005-08-09T21:55:07', '1'), - ('61', '3288', '2006-02-16T02:30:53', '2005-08-22T11:34:06', '2005-08-31T12:45:06', '1'), - ('416', '2376', '2006-02-16T02:30:53', '2005-08-17T01:19:20', '2005-08-24T02:25:20', '1'), - ('70', '4309', '2006-02-16T02:30:53', '2005-08-18T15:49:15', '2005-08-23T20:18:15', '1'), - ('293', '2646', '2006-02-16T02:30:53', '2005-06-21T21:11:27', '2005-06-24T16:31:27', '1'), - ('345', '4096', '2006-02-16T02:30:53', '2005-08-21T21:00:03', '2005-08-30T16:59:03', '1'), - ('20', '1931', '2006-02-16T02:30:53', '2005-07-30T07:55:14', '2005-08-02T13:49:14', '1'), - ('292', '1028', '2006-02-16T02:30:53', '2005-08-20T09:43:06', '2005-08-27T10:22:06', '1'), - ('62', '1781', '2006-02-16T02:30:53', '2005-06-16T04:52:28', '2005-06-23T07:36:28', '1'), - ('319', '4389', '2006-02-16T02:30:53', '2005-08-20T03:53:20', '2005-08-27T21:54:20', '1'), - ('471', '3760', '2006-02-16T02:30:53', '2005-07-07T01:42:22', '2005-07-10T00:53:22', '1'), - ('452', '1457', '2006-02-16T02:30:53', '2005-08-18T17:49:28', '2005-08-24T12:23:28', '1'), - ('25', '763', '2006-02-16T02:30:53', '2005-07-12T22:02:18', '2005-07-18T23:30:18', '1'), - ('41', '2232', '2006-02-16T02:30:53', '2005-08-01T10:45:51', '2005-08-06T08:11:51', '1'), - ('278', '3436', '2006-02-16T02:30:53', '2005-07-07T22:35:24', '2005-07-14T23:49:24', '1'), - ('305', '1826', '2006-02-16T02:30:53', '2005-08-22T23:54:04', '2005-08-26T22:25:04', '1'), - ('583', '3948', '2006-02-16T02:30:53', '2005-06-19T22:46:37', '2005-06-23T03:31:37', '1'), - ('166', '4114', '2006-02-16T02:30:53', '2005-06-18T02:29:10', '2005-06-22T02:02:10', '1'), - ('416', '3658', '2006-02-16T02:30:53', '2005-08-01T19:53:13', '2005-08-10T15:05:13', '1'), - ('408', '1711', '2006-02-16T02:30:53', '2005-05-24T23:03:39', '2005-06-01T22:12:39', '1'), - ('190', '3569', '2006-02-16T02:30:53', '2005-07-27T15:52:10', '2005-08-04T15:13:10', '1'), - ('321', '3926', '2006-02-16T02:30:53', '2005-05-26T07:12:21', '2005-05-31T12:07:21', '1'), - ('207', '2450', '2006-02-16T02:30:53', '2005-05-31T20:04:10', '2005-06-09T16:34:10', '1'), - ('399', '2993', '2006-02-16T02:30:53', '2005-08-17T17:16:42', '2005-08-23T18:28:42', '1'), - ('284', '1915', '2006-02-16T02:30:53', '2005-07-06T03:33:23', '2005-07-08T07:54:23', '1'), - ('326', '4310', '2006-02-16T02:30:53', '2005-07-29T18:34:33', '2005-08-02T16:05:33', '1'), - ('85', '1957', '2006-02-16T02:30:53', '2005-06-19T18:53:05', '2005-06-22T13:15:05', '1'), - ('557', '4124', '2006-02-16T02:30:53', '2005-08-22T17:44:27', '2005-08-24T23:25:27', '1'), - ('368', '2708', '2006-02-16T02:30:53', '2005-08-19T21:33:35', '2005-08-20T22:47:35', '1'), - ('85', '1914', '2006-02-16T02:30:53', '2005-08-01T12:44:32', '2005-08-07T09:17:32', '1'), - ('565', '1857', '2006-02-16T02:30:53', '2005-07-09T07:25:19', '2005-07-15T01:51:19', '1'), - ('479', '1556', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('449', '3924', '2006-02-16T02:30:53', '2005-08-01T11:41:55', '2005-08-08T17:16:55', '1'), - ('119', '3536', '2006-02-16T02:30:53', '2005-08-17T00:04:28', '2005-08-26T02:03:28', '1'), - ('498', '2451', '2006-02-16T02:30:53', '2005-07-08T23:56:09', '2005-07-16T19:15:09', '1'), - ('220', '499', '2006-02-16T02:30:53', '2005-08-17T04:15:46', '2005-08-24T04:48:46', '1'), - ('306', '3718', '2006-02-16T02:30:53', '2005-07-29T13:51:20', '2005-08-02T13:05:20', '1'), - ('480', '1043', '2006-02-16T02:30:53', '2005-08-19T04:13:37', '2005-08-26T23:52:37', '1'), - ('488', '1849', '2006-02-16T02:30:53', '2005-07-07T13:00:20', '2005-07-13T16:37:20', '1'), - ('405', '2872', '2006-02-16T02:30:53', '2005-06-17T03:58:36', '2005-06-22T09:28:36', '1'), - ('577', '1353', '2006-02-16T02:30:53', '2005-08-20T01:54:39', '2005-08-25T21:23:39', '1'), - ('562', '2120', '2006-02-16T02:30:53', '2005-08-18T03:53:18', '2005-08-22T04:53:18', '1'), - ('91', '1277', '2006-02-16T02:30:53', '2005-06-18T19:38:20', '2005-06-26T20:48:20', '1'), - ('352', '390', '2006-02-16T02:30:53', '2005-06-16T09:20:33', '2005-06-18T13:42:33', '1'), - ('288', '1057', '2006-02-16T02:30:53', '2005-06-15T20:46:04', '2005-06-24T22:46:04', '1'), - ('340', '2292', '2006-02-16T02:30:53', '2005-07-31T12:05:42', '2005-08-07T15:26:42', '1'), - ('575', '2795', '2006-02-16T02:30:53', '2005-08-19T22:34:51', '2005-08-21T03:30:51', '1'), - ('469', '2796', '2006-02-16T02:30:53', '2005-07-28T11:48:08', '2005-07-30T14:14:08', '1'), - ('575', '1255', '2006-02-16T02:30:53', '2005-07-31T08:57:35', '2005-08-04T04:47:35', '1'), - ('51', '202', '2006-02-16T02:30:53', '2005-07-28T01:08:36', '2005-08-03T21:36:36', '1'), - ('273', '515', '2006-02-16T02:30:53', '2005-07-12T09:47:58', '2005-07-16T15:43:58', '1'), - ('172', '254', '2006-02-16T02:30:53', '2005-07-27T08:39:58', '2005-08-01T03:12:58', '1'), - ('41', '2830', '2006-02-16T02:30:53', '2005-08-18T01:08:34', '2005-08-24T20:52:34', '1'), - ('290', '3606', '2006-02-16T02:30:53', '2005-07-31T20:38:58', '2005-08-06T02:34:58', '1'), - ('463', '1064', '2006-02-16T02:30:53', '2005-08-19T05:55:58', '2005-08-23T08:05:58', '1'), - ('107', '3492', '2006-02-16T02:30:53', '2005-07-27T23:41:18', '2005-08-06T04:40:18', '1'), - ('20', '1445', '2006-02-16T02:30:53', '2005-08-22T14:37:22', '2005-08-27T17:40:22', '1'), - ('158', '929', '2006-02-16T02:30:53', '2005-07-31T08:13:28', '2005-08-07T10:11:28', '1'), - ('164', '233', '2006-02-16T02:30:53', '2005-07-12T12:48:03', '2005-07-13T11:55:03', '1'), - ('205', '1821', '2006-02-16T02:30:53', '2005-06-18T04:17:44', '2005-06-27T09:08:44', '1'), - ('36', '3384', '2006-02-16T02:30:53', '2005-07-07T08:15:03', '2005-07-11T10:56:03', '1'), - ('423', '1849', '2006-02-16T02:30:53', '2005-07-27T21:39:42', '2005-08-06T00:12:42', '1'), - ('585', '3744', '2006-02-16T02:30:53', '2005-06-19T11:47:59', '2005-06-20T08:09:59', '1'), - ('115', '868', '2006-02-16T02:30:53', '2005-08-02T02:11:03', '2005-08-04T01:49:03', '1'), - ('402', '2214', '2006-02-16T02:30:53', '2005-08-02T06:07:54', '2005-08-08T00:37:54', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['12365', '2741', '15280', '8286', '14476', '9177', '3646', '13419', '11239', '9273', '8461', '1589', '1379', '12740', '14612', '12343', '8422', '13735', '603', '2653', '2030', '8929', '15317', '3946', '8270', '14707', '14727', '15601', '850', '6867', '12750', '7599', '5100', '5061', '10679', '1282', '12730', '9592', '6253', '1801', '709', '5881', '3494', '5926', '7558', '1346', '4913', '12366', '12609', '11709', '1376', '9898', '4327', '11941', '4298', '13974', '4431', '5828', '13749', '2429', '874', '14735', '8336', '8045', '11960', '4082', '10021', '12424', '11494', '7930', '4497', '9914', '5711', '10773', '9089', '12264', '14349', '2449', '6091', '12601', '11751', '13171', '15975', '4568', '5774', '1550', '3884', '268', '8048', '8726', '851', '14585', '6811', '7023', '13323', '7063', '10289', '15075', '15372', '8680']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('303', '4350', '2006-02-16T02:30:53', '2005-08-18T07:55:09', '2005-08-24T05:42:09', '1'), - ('36', '1662', '2006-02-16T02:30:53', '2005-06-19T16:05:41', '2005-06-20T20:48:41', '1'), - ('317', '3464', '2006-02-16T02:30:53', '2005-08-22T19:09:52', '2005-08-28T00:39:52', '1'), - ('87', '4092', '2006-02-16T02:30:53', '2005-07-29T02:02:46', '2005-08-06T06:00:46', '1'), - ('101', '2821', '2006-02-16T02:30:53', '2005-08-21T13:31:07', '2005-08-23T17:06:07', '1'), - ('400', '1088', '2006-02-16T02:30:53', '2005-07-30T11:52:40', '2005-08-08T09:35:40', '1'), - ('322', '3591', '2006-02-16T02:30:53', '2005-07-06T07:28:59', '2005-07-11T05:19:59', '1'), - ('537', '3507', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('111', '189', '2006-02-16T02:30:53', '2005-08-02T13:27:11', '2005-08-03T14:36:11', '1'), - ('497', '1867', '2006-02-16T02:30:53', '2005-07-30T15:05:36', '2005-08-08T09:07:36', '1'), - ('399', '3373', '2006-02-16T02:30:53', '2005-07-29T08:11:31', '2005-08-06T09:23:31', '1'), - ('293', '4307', '2006-02-16T02:30:53', '2005-06-16T04:58:03', '2005-06-24T08:36:03', '1'), - ('212', '810', '2006-02-16T02:30:53', '2005-06-15T15:05:10', '2005-06-18T12:11:10', '1'), - ('330', '1157', '2006-02-16T02:30:53', '2005-08-18T22:17:04', '2005-08-23T23:42:04', '1'), - ('445', '4105', '2006-02-16T02:30:53', '2005-08-21T18:03:15', '2005-08-27T13:39:15', '1'), - ('507', '448', '2006-02-16T02:30:53', '2005-08-18T07:15:13', '2005-08-27T11:07:13', '1'), - ('7', '3104', '2006-02-16T02:30:53', '2005-07-29T07:02:55', '2005-08-03T12:35:55', '1'), - ('35', '1813', '2006-02-16T02:30:53', '2005-08-20T10:31:01', '2005-08-26T05:00:01', '1'), - ('537', '3248', '2006-02-16T02:30:53', '2005-05-28T14:27:51', '2005-05-29T13:13:51', '1'), - ('340', '3528', '2006-02-16T02:30:53', '2005-06-19T10:36:53', '2005-06-26T15:15:53', '1'), - ('457', '4024', '2006-02-16T02:30:53', '2005-06-17T13:13:27', '2005-06-19T10:44:27', '1'), - ('472', '3501', '2006-02-16T02:30:53', '2005-07-30T02:28:22', '2005-08-06T06:13:22', '1'), - ('512', '2325', '2006-02-16T02:30:53', '2005-08-22T20:14:13', '2005-08-29T18:32:13', '1'), - ('13', '294', '2006-02-16T02:30:53', '2005-07-06T21:39:24', '2005-07-11T16:10:24', '1'), - ('282', '3565', '2006-02-16T02:30:53', '2005-07-29T01:27:22', '2005-07-29T20:55:22', '1'), - ('530', '2916', '2006-02-16T02:30:53', '2005-08-21T21:06:29', '2005-08-30T23:37:29', '1'), - ('275', '650', '2006-02-16T02:30:53', '2005-08-21T22:12:45', '2005-08-25T00:46:45', '1'), - ('579', '3643', '2006-02-16T02:30:53', '2005-08-23T06:33:26', '2005-08-24T04:10:26', '1'), - ('517', '2390', '2006-02-16T02:30:53', '2005-05-30T01:35:12', '2005-05-31T01:51:12', '1'), - ('190', '3354', '2006-02-16T02:30:53', '2005-07-12T20:06:47', '2005-07-19T16:59:47', '1'), - ('535', '3717', '2006-02-16T02:30:53', '2005-08-18T22:32:39', '2005-08-26T01:54:39', '1'), - ('87', '3272', '2006-02-16T02:30:53', '2005-07-27T23:38:46', '2005-07-28T22:52:46', '1'), - ('101', '3193', '2006-02-16T02:30:53', '2005-07-09T06:16:03', '2005-07-10T10:21:03', '1'), - ('230', '3893', '2006-02-16T02:30:53', '2005-07-09T04:30:50', '2005-07-12T03:24:50', '1'), - ('198', '4437', '2006-02-16T02:30:53', '2005-08-01T17:27:58', '2005-08-08T16:06:58', '1'), - ('539', '186', '2006-02-16T02:30:53', '2005-06-15T08:25:33', '2005-06-21T04:02:33', '1'), - ('7', '75', '2006-02-16T02:30:53', '2005-08-18T21:55:01', '2005-08-22T01:23:01', '1'), - ('14', '1828', '2006-02-16T02:30:53', '2005-07-31T03:21:16', '2005-08-05T08:32:16', '1'), - ('570', '1425', '2006-02-16T02:30:53', '2005-07-11T15:07:19', '2005-07-13T11:00:19', '1'), - ('10', '1015', '2006-02-16T02:30:53', '2005-06-16T20:21:53', '2005-06-18T23:18:53', '1'), - ('479', '2459', '2006-02-16T02:30:53', '2005-05-29T03:48:01', '2005-06-06T05:21:01', '1'), - ('25', '236', '2006-02-16T02:30:53', '2005-07-10T19:19:43', '2005-07-12T20:11:43', '1'), - ('348', '3149', '2006-02-16T02:30:53', '2005-07-05T23:47:30', '2005-07-11T18:10:30', '1'), - ('282', '2840', '2006-02-16T02:30:53', '2005-07-10T21:53:42', '2005-07-20T01:04:42', '1'), - ('80', '550', '2006-02-16T02:30:53', '2005-07-27T22:19:08', '2005-07-30T21:31:08', '1'), - ('585', '4540', '2006-02-16T02:30:53', '2005-06-15T12:39:52', '2005-06-24T17:43:52', '1'), - ('368', '982', '2006-02-16T02:30:53', '2005-07-08T21:27:48', '2005-07-18T02:51:48', '1'), - ('115', '3799', '2006-02-16T02:30:53', '2005-08-18T07:55:14', '2005-08-22T06:12:14', '1'), - ('486', '2327', '2006-02-16T02:30:53', '2005-08-18T17:06:22', '2005-08-20T21:30:22', '1'), - ('330', '1720', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('215', '4271', '2006-02-16T02:30:53', '2005-06-15T14:59:06', '2005-06-19T17:34:06', '1'), - ('359', '2151', '2006-02-16T02:30:53', '2005-07-31T14:12:03', '2005-08-01T12:27:03', '1'), - ('73', '860', '2006-02-16T02:30:53', '2005-07-07T18:01:39', '2005-07-12T22:40:39', '1'), - ('566', '159', '2006-02-16T02:30:53', '2005-08-17T16:56:57', '2005-08-24T16:29:57', '1'), - ('560', '1055', '2006-02-16T02:30:53', '2005-07-07T16:27:25', '2005-07-12T18:20:25', '1'), - ('479', '1912', '2006-02-16T02:30:53', '2005-08-20T18:54:59', '2005-08-28T13:02:59', '1'), - ('26', '936', '2006-02-16T02:30:53', '2005-07-07T22:39:02', '2005-07-16T19:24:02', '1'), - ('156', '2999', '2006-02-16T02:30:53', '2005-07-10T16:27:25', '2005-07-11T18:42:25', '1'), - ('282', '2811', '2006-02-16T02:30:53', '2005-08-20T11:00:37', '2005-08-26T12:04:37', '1'), - ('583', '3238', '2006-02-16T02:30:53', '2005-06-18T17:48:28', '2005-06-27T15:52:28', '1'), - ('52', '363', '2006-02-16T02:30:53', '2005-05-30T05:36:21', '2005-06-01T09:32:21', '1'), - ('35', '950', '2006-02-16T02:30:53', '2005-08-21T22:25:09', '2005-08-23T21:16:09', '1'), - ('210', '2120', '2006-02-16T02:30:53', '2005-07-29T04:20:42', '2005-08-05T10:17:42', '1'), - ('368', '3427', '2006-02-16T02:30:53', '2005-07-28T16:49:38', '2005-08-03T15:42:38', '1'), - ('84', '3924', '2006-02-16T02:30:53', '2005-08-17T17:24:30', '2005-08-18T14:28:30', '1'), - ('108', '2904', '2006-02-16T02:30:53', '2005-07-07T05:11:53', '2005-07-12T00:55:53', '1'), - ('597', '3235', '2006-02-16T02:30:53', '2005-07-31T18:24:39', '2005-08-01T19:16:39', '1'), - ('319', '2055', '2006-02-16T02:30:53', '2005-08-18T10:16:57', '2005-08-27T04:41:57', '1'), - ('579', '3994', '2006-02-16T02:30:53', '2005-08-02T22:51:23', '2005-08-09T01:52:23', '1'), - ('320', '4181', '2006-02-16T02:30:53', '2005-07-28T12:21:08', '2005-07-30T11:56:08', '1'), - ('142', '1995', '2006-02-16T02:30:53', '2005-07-08T01:51:32', '2005-07-15T22:56:32', '1'), - ('530', '3147', '2006-02-16T02:30:53', '2005-07-31T14:51:19', '2005-08-05T09:51:19', '1'), - ('481', '3988', '2006-02-16T02:30:53', '2005-07-10T10:37:20', '2005-07-13T11:20:20', '1'), - ('181', '3854', '2006-02-16T02:30:53', '2005-08-01T20:53:45', '2005-08-07T00:16:45', '1'), - ('369', '490', '2006-02-16T02:30:53', '2005-07-30T08:23:39', '2005-07-31T06:00:39', '1'), - ('87', '3073', '2006-02-16T02:30:53', '2005-08-18T04:17:33', '2005-08-26T08:07:33', '1'), - ('119', '96', '2006-02-16T02:30:53', '2005-08-21T08:54:53', '2005-08-30T14:27:53', '1'), - ('498', '3630', '2006-02-16T02:30:53', '2005-06-18T19:18:36', '2005-06-27T23:49:36', '1'), - ('383', '580', '2006-02-16T02:30:53', '2005-07-11T05:49:18', '2005-07-15T07:26:18', '1'), - ('598', '3099', '2006-02-16T02:30:53', '2005-08-18T16:47:52', '2005-08-24T11:05:52', '1'), - ('51', '3309', '2006-02-16T02:30:53', '2005-08-17T09:07:56', '2005-08-26T13:16:56', '1'), - ('122', '1765', '2006-02-16T02:30:53', '2005-08-19T13:48:54', '2005-08-27T18:57:54', '1'), - ('174', '2723', '2006-02-16T02:30:53', '2005-08-23T20:06:23', '2005-08-27T19:52:23', '1'), - ('122', '2626', '2006-02-16T02:30:53', '2005-07-08T05:23:59', '2005-07-09T06:07:59', '1'), - ('113', '326', '2006-02-16T02:30:53', '2005-07-10T13:31:56', '2005-07-18T07:32:56', '1'), - ('345', '2003', '2006-02-16T02:30:53', '2005-06-16T01:58:35', '2005-06-18T23:56:35', '1'), - ('210', '1806', '2006-02-16T02:30:53', '2005-07-06T18:41:33', '2005-07-07T22:06:33', '1'), - ('75', '1714', '2006-02-16T02:30:53', '2005-05-26T16:19:08', '2005-05-27T14:35:08', '1'), - ('182', '2721', '2006-02-16T02:30:53', '2005-07-28T16:50:26', '2005-08-06T19:20:26', '1'), - ('409', '897', '2006-02-16T02:30:53', '2005-07-29T18:09:22', '2005-08-06T16:24:22', '1'), - ('530', '2780', '2006-02-16T02:30:53', '2005-05-30T01:35:15', '2005-06-06T07:27:15', '1'), - ('30', '82', '2006-02-16T02:30:53', '2005-08-21T17:18:33', '2005-08-26T11:36:33', '1'), - ('107', '1572', '2006-02-16T02:30:53', '2005-07-12T17:54:33', '2005-07-20T17:39:33', '1'), - ('303', '4196', '2006-02-16T02:30:53', '2005-07-27T02:32:44', '2005-08-03T04:06:44', '1'), - ('133', '1055', '2006-02-16T02:30:53', '2005-08-19T19:48:07', '2005-08-23T15:28:07', '1'), - ('58', '2125', '2006-02-16T02:30:53', '2005-07-27T03:52:27', '2005-08-04T07:53:27', '1'), - ('566', '3153', '2006-02-16T02:30:53', '2005-08-01T03:39:48', '2005-08-08T02:56:48', '1'), - ('535', '1938', '2006-02-16T02:30:53', '2005-08-22T11:04:52', '2005-08-30T05:06:52', '1'), - ('273', '3876', '2006-02-16T02:30:53', '2005-08-22T21:59:51', '2005-08-23T17:01:51', '1'), - ('330', '1227', '2006-02-16T02:30:53', '2005-07-29T16:08:03', '2005-07-31T17:26:03', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['10583', '971', '7278', '9796', '7218', '11432', '11506', '13406', '15426', '15173', '2252', '6056', '10226', '6371', '5383', '8871', '11168', '3727', '12156', '4473', '4033', '6424', '14945', '11327', '6945', '14714', '12886', '7581', '12137', '2757', '7319', '15457', '14643', '2780', '4982', '11591', '8771', '13190', '5694', '10671', '15874', '7692', '14769', '132', '13666', '7013', '4724', '15810', '10627', '5508', '6851', '12867', '3539', '11645', '6663', '4257', '32', '2105', '12814', '5739', '14296', '8137', '15106', '3781', '6824', '2522', '12350', '11140', '2753', '8631', '8594', '2107', '9488', '1061', '13594', '3866', '16002', '1865', '11328', '5707', '12586', '1287', '2848', '12160', '2885', '3627', '13261', '13944', '8409', '4283', '230', '12817', '7401', '4805', '6975', '15738', '9029', '7778', '5311', '6934']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('125', '704', '2006-02-16T02:30:53', '2005-08-01T13:54:35', '2005-08-03T18:21:35', '1'), - ('561', '2911', '2006-02-16T02:30:53', '2005-05-30T20:10:52', '2005-06-06T20:47:52', '1'), - ('592', '531', '2006-02-16T02:30:53', '2005-07-27T11:50:34', '2005-08-01T10:22:34', '1'), - ('539', '1038', '2006-02-16T02:30:53', '2005-07-31T10:52:43', '2005-08-09T06:08:43', '1'), - ('530', '2458', '2006-02-16T02:30:53', '2005-07-27T09:34:24', '2005-08-01T07:00:24', '1'), - ('540', '959', '2006-02-16T02:30:53', '2005-08-02T20:10:01', '2005-08-07T01:28:01', '1'), - ('565', '1529', '2006-02-16T02:30:53', '2005-08-16T23:25:48', '2005-08-22T18:17:48', '1'), - ('113', '3031', '2006-02-16T02:30:53', '2005-08-19T22:22:01', '2005-08-22T18:16:01', '1'), - ('347', '3280', '2006-02-16T02:30:53', '2005-08-23T00:07:19', '2005-08-26T23:19:19', '1'), - ('338', '2585', '2006-02-16T02:30:53', '2005-08-22T15:26:29', '2005-08-29T14:03:29', '1'), - ('383', '1987', '2006-02-16T02:30:53', '2005-06-18T05:05:18', '2005-06-21T08:19:18', '1'), - ('145', '3069', '2006-02-16T02:30:53', '2005-07-11T04:01:27', '2005-07-12T04:14:27', '1'), - ('107', '3067', '2006-02-16T02:30:53', '2005-08-01T01:40:04', '2005-08-08T01:02:04', '1'), - ('265', '4297', '2006-02-16T02:30:53', '2005-07-11T21:31:51', '2005-07-16T23:10:51', '1'), - ('14', '573', '2006-02-16T02:30:53', '2005-07-09T19:14:32', '2005-07-11T19:57:32', '1'), - ('382', '4535', '2006-02-16T02:30:53', '2005-07-30T00:12:41', '2005-08-08T03:53:41', '1'), - ('555', '468', '2006-02-16T02:30:53', '2005-08-02T10:19:42', '2005-08-04T08:42:42', '1'), - ('57', '2886', '2006-02-16T02:30:53', '2005-07-06T11:16:43', '2005-07-07T15:39:43', '1'), - ('212', '3270', '2006-02-16T02:30:53', '2005-08-18T00:27:33', '2005-08-26T01:43:33', '1'), - ('481', '1387', '2006-02-16T02:30:53', '2005-07-08T00:22:10', '2005-07-09T21:11:10', '1'), - ('453', '203', '2006-02-16T02:30:53', '2005-07-07T02:35:46', '2005-07-16T01:12:46', '1'), - ('359', '3040', '2006-02-16T02:30:53', '2005-07-11T23:49:37', '2005-07-21T00:53:37', '1'), - ('304', '1567', '2006-02-16T02:30:53', '2005-08-22T06:05:38', '2005-08-29T12:01:38', '1'), - ('361', '773', '2006-02-16T02:30:53', '2005-08-02T16:40:47', '2005-08-03T22:13:47', '1'), - ('560', '1627', '2006-02-16T02:30:53', '2005-07-26T23:35:29', '2005-07-28T00:12:29', '1'), - ('279', '1', '2006-02-16T02:30:53', '2005-08-21T21:27:43', '2005-08-30T22:26:43', '1'), - ('174', '2157', '2006-02-16T02:30:53', '2005-08-19T03:38:32', '2005-08-26T02:17:32', '1'), - ('166', '2051', '2006-02-16T02:30:53', '2005-07-27T23:14:35', '2005-07-29T21:30:35', '1'), - ('109', '3632', '2006-02-16T02:30:53', '2005-08-17T23:52:26', '2005-08-27T00:19:26', '1'), - ('243', '3814', '2006-02-16T02:30:53', '2005-06-19T17:01:14', '2005-06-28T11:38:14', '1'), - ('576', '2370', '2006-02-16T02:30:53', '2005-07-27T13:31:25', '2005-08-04T07:31:25', '1'), - ('306', '4539', '2006-02-16T02:30:53', '2005-08-23T01:07:37', '2005-08-26T19:46:37', '1'), - ('119', '798', '2006-02-16T02:30:53', '2005-08-21T19:11:58', '2005-08-29T19:52:58', '1'), - ('360', '1513', '2006-02-16T02:30:53', '2005-06-19T18:19:33', '2005-06-28T22:29:33', '1'), - ('162', '249', '2006-02-16T02:30:53', '2005-07-09T00:30:52', '2005-07-15T23:50:52', '1'), - ('6', '1670', '2006-02-16T02:30:53', '2005-08-17T02:29:41', '2005-08-23T20:47:41', '1'), - ('347', '3533', '2006-02-16T02:30:53', '2005-07-29T19:54:41', '2005-08-03T20:38:41', '1'), - ('290', '4316', '2006-02-16T02:30:53', '2005-08-19T14:27:59', '2005-08-26T13:45:59', '1'), - ('57', '3476', '2006-02-16T02:30:53', '2005-07-10T09:40:38', '2005-07-14T09:16:38', '1'), - ('10', '4430', '2006-02-16T02:30:53', '2005-08-01T17:09:59', '2005-08-09T21:36:59', '1'), - ('132', '621', '2006-02-16T02:30:53', '2005-08-23T16:30:55', '2005-08-28T20:57:55', '1'), - ('392', '267', '2006-02-16T02:30:53', '2005-07-28T03:30:21', '2005-07-30T22:25:21', '1'), - ('361', '1800', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('479', '3367', '2006-02-16T02:30:53', '2005-05-25T21:46:54', '2005-05-31T21:02:54', '1'), - ('451', '2007', '2006-02-16T02:30:53', '2005-08-20T08:20:19', '2005-08-22T03:22:19', '1'), - ('463', '3919', '2006-02-16T02:30:53', '2005-07-27T02:03:21', '2005-07-31T22:12:21', '1'), - ('18', '3375', '2006-02-16T02:30:53', '2005-07-08T12:46:30', '2005-07-14T12:39:30', '1'), - ('171', '2196', '2006-02-16T02:30:53', '2005-08-23T14:43:15', '2005-08-25T17:41:15', '1'), - ('472', '2026', '2006-02-16T02:30:53', '2005-08-01T15:33:03', '2005-08-02T21:26:03', '1'), - ('345', '2977', '2006-02-16T02:30:53', '2005-07-10T00:50:01', '2005-07-16T19:07:01', '1'), - ('280', '664', '2006-02-16T02:30:53', '2005-07-12T19:32:14', '2005-07-17T21:03:14', '1'), - ('330', '4499', '2006-02-16T02:30:53', '2005-08-19T02:40:11', '2005-08-20T04:01:11', '1'), - ('444', '4081', '2006-02-16T02:30:53', '2005-07-06T01:39:08', '2005-07-07T05:38:08', '1'), - ('35', '4261', '2006-02-16T02:30:53', '2005-08-17T04:50:56', '2005-08-25T23:03:56', '1'), - ('5', '4364', '2006-02-16T02:30:53', '2005-07-12T11:27:35', '2005-07-21T16:35:35', '1'), - ('553', '3927', '2006-02-16T02:30:53', '2005-07-07T14:18:41', '2005-07-08T14:58:41', '1'), - ('230', '3832', '2006-02-16T02:30:53', '2005-05-25T04:06:21', '2005-05-25T23:55:21', '1'), - ('57', '4090', '2006-02-16T02:30:53', '2005-06-17T19:15:45', '2005-06-20T16:00:45', '1'), - ('465', '204', '2006-02-16T02:30:53', '2005-08-19T00:58:24', '2005-08-21T05:46:24', '1'), - ('219', '163', '2006-02-16T02:30:53', '2005-07-10T11:51:50', '2005-07-19T17:40:50', '1'), - ('275', '3813', '2006-02-16T02:30:53', '2005-08-21T07:13:23', '2005-08-26T11:14:23', '1'), - ('312', '3188', '2006-02-16T02:30:53', '2005-07-28T20:07:18', '2005-08-03T17:41:18', '1'), - ('155', '399', '2006-02-16T02:30:53', '2005-08-22T12:01:48', '2005-08-27T16:12:48', '1'), - ('23', '3894', '2006-02-16T02:30:53', '2005-07-06T13:53:41', '2005-07-15T10:03:41', '1'), - ('579', '858', '2006-02-16T02:30:53', '2005-07-12T18:26:46', '2005-07-21T15:23:46', '1'), - ('579', '550', '2006-02-16T02:30:53', '2005-06-19T00:43:42', '2005-06-28T04:26:42', '1'), - ('172', '1333', '2006-02-16T02:30:53', '2005-08-18T07:29:46', '2005-08-21T12:50:46', '1'), - ('132', '3836', '2006-02-16T02:30:53', '2005-08-02T09:27:45', '2005-08-05T04:10:45', '1'), - ('23', '2408', '2006-02-16T02:30:53', '2005-06-19T16:44:35', '2005-06-24T13:45:35', '1'), - ('559', '98', '2006-02-16T02:30:53', '2005-07-29T14:08:06', '2005-08-05T14:57:06', '1'), - ('115', '4155', '2006-02-16T02:30:53', '2005-07-29T12:42:13', '2005-08-02T07:38:13', '1'), - ('104', '1270', '2006-02-16T02:30:53', '2005-06-17T19:31:16', '2005-06-18T23:33:16', '1'), - ('528', '4221', '2006-02-16T02:30:53', '2005-07-30T23:42:42', '2005-08-08T22:15:42', '1'), - ('109', '965', '2006-02-16T02:30:53', '2005-05-31T08:27:58', '2005-06-07T02:34:58', '1'), - ('7', '3424', '2006-02-16T02:30:53', '2005-08-20T05:53:31', '2005-08-23T09:01:31', '1'), - ('409', '194', '2006-02-16T02:30:53', '2005-07-06T17:47:20', '2005-07-15T18:12:20', '1'), - ('73', '2770', '2006-02-16T02:30:53', '2005-08-23T20:47:12', '2005-08-27T23:07:12', '1'), - ('526', '2657', '2006-02-16T02:30:53', '2005-06-17T01:49:36', '2005-06-23T21:13:36', '1'), - ('219', '2031', '2006-02-16T02:30:53', '2005-08-02T16:42:38', '2005-08-04T21:02:38', '1'), - ('581', '708', '2006-02-16T02:30:53', '2005-07-10T10:26:14', '2005-07-18T06:19:14', '1'), - ('460', '4245', '2006-02-16T02:30:53', '2005-08-18T15:54:39', '2005-08-21T19:29:39', '1'), - ('104', '4204', '2006-02-16T02:30:53', '2005-06-15T08:41:38', '2005-06-22T14:02:38', '1'), - ('19', '3449', '2006-02-16T02:30:53', '2005-06-19T22:55:37', '2005-06-25T23:10:37', '1'), - ('481', '1328', '2006-02-16T02:30:53', '2005-08-18T00:37:59', '2005-08-19T20:51:59', '1'), - ('330', '2701', '2006-02-16T02:30:53', '2005-06-20T01:33:42', '2005-06-22T22:23:42', '1'), - ('322', '1087', '2006-02-16T02:30:53', '2005-07-06T06:19:25', '2005-07-11T05:53:25', '1'), - ('417', '3538', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('408', '3685', '2006-02-16T02:30:53', '2005-08-20T17:41:16', '2005-08-23T12:02:16', '1'), - ('303', '4314', '2006-02-16T02:30:53', '2005-07-29T06:41:22', '2005-07-31T11:21:22', '1'), - ('477', '2807', '2006-02-16T02:30:53', '2005-07-07T15:29:35', '2005-07-11T17:12:35', '1'), - ('58', '1085', '2006-02-16T02:30:53', '2005-05-26T11:31:50', '2005-05-30T15:22:50', '1'), - ('113', '1246', '2006-02-16T02:30:53', '2005-08-19T01:04:35', '2005-08-25T21:14:35', '1'), - ('583', '2759', '2006-02-16T02:30:53', '2005-07-27T16:17:55', '2005-08-04T15:48:55', '1'), - ('453', '377', '2006-02-16T02:30:53', '2005-07-08T16:59:12', '2005-07-09T15:02:12', '1'), - ('527', '3328', '2006-02-16T02:30:53', '2005-07-27T00:39:54', '2005-08-02T19:49:54', '1'), - ('38', '556', '2006-02-16T02:30:53', '2005-08-23T11:55:50', '2005-08-30T15:07:50', '1'), - ('52', '2220', '2006-02-16T02:30:53', '2005-07-30T06:03:11', '2005-08-04T01:42:11', '1'), - ('248', '1044', '2006-02-16T02:30:53', '2005-07-28T07:10:11', '2005-08-05T05:09:11', '1'), - ('107', '986', '2006-02-16T02:30:53', '2005-07-09T16:02:54', '2005-07-18T10:44:54', '1'), - ('107', '455', '2006-02-16T02:30:53', '2005-07-26T23:11:03', '2005-08-04T19:18:03', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['11332', '12693', '13762', '8845', '7602', '5861', '7952', '7091', '15550', '1486', '1125', '7455', '14613', '4492', '9174', '5180', '2669', '3968', '15778', '11214', '8148', '11289', '15687', '6969', '9750', '9766', '6897', '11929', '13331', '579', '7769', '12196', '11503', '2694', '14942', '3825', '1364', '15285', '1361', '991', '7958', '13823', '10993', '10321', '2568', '946', '2094', '9999', '1294', '6685', '9066', '9103', '5478', '13234', '618', '15657', '3615', '10275', '7983', '1907', '13851', '1460', '11832', '9328', '6762', '2039', '4228', '1820', '12199', '1521', '15737', '6530', '12061', '8360', '7919', '15190', '8311', '7393', '2309', '5095', '15954', '2058', '9154', '13973', '10945', '12844', '1876', '8897', '12692', '37', '4012', '3752', '2118', '3742', '1524', '15261', '2063', '11476', '7281', '8847']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('467', '2381', '2006-02-16T02:30:53', '2005-08-02T16:52:57', '2005-08-04T14:13:57', '1'), - ('584', '1543', '2006-02-16T02:30:53', '2005-08-18T20:10:19', '2005-08-25T21:11:19', '1'), - ('566', '451', '2006-02-16T02:30:53', '2005-08-20T11:29:32', '2005-08-23T17:25:32', '1'), - ('543', '3036', '2006-02-16T02:30:53', '2005-07-29T23:06:13', '2005-08-02T20:16:13', '1'), - ('366', '2516', '2006-02-16T02:30:53', '2005-07-27T23:48:35', '2005-08-04T17:58:35', '1'), - ('277', '3881', '2006-02-16T02:30:53', '2005-07-10T18:14:22', '2005-07-14T15:32:22', '1'), - ('158', '3313', '2006-02-16T02:30:53', '2005-07-28T13:23:49', '2005-08-01T08:50:49', '1'), - ('322', '2593', '2006-02-16T02:30:53', '2005-07-27T04:44:10', '2005-07-31T07:14:10', '1'), - ('465', '1375', '2006-02-16T02:30:53', '2005-08-23T04:27:54', '2005-08-29T01:29:54', '1'), - ('62', '847', '2006-02-16T02:30:53', '2005-06-15T21:25:30', '2005-06-16T16:36:30', '1'), - ('234', '1172', '2006-02-16T02:30:53', '2005-05-31T17:23:44', '2005-06-01T15:02:44', '1'), - ('405', '3815', '2006-02-16T02:30:53', '2005-07-27T18:34:41', '2005-07-31T17:32:41', '1'), - ('20', '3841', '2006-02-16T02:30:53', '2005-08-21T18:03:20', '2005-08-26T19:46:20', '1'), - ('247', '1152', '2006-02-16T02:30:53', '2005-07-08T01:32:04', '2005-07-10T22:11:04', '1'), - ('144', '2636', '2006-02-16T02:30:53', '2005-07-30T11:42:10', '2005-07-31T09:52:10', '1'), - ('494', '3684', '2006-02-16T02:30:53', '2005-07-09T10:06:53', '2005-07-12T15:25:53', '1'), - ('523', '2734', '2006-02-16T02:30:53', '2005-06-19T11:28:52', '2005-06-20T16:43:52', '1'), - ('235', '558', '2006-02-16T02:30:53', '2005-07-06T22:47:09', '2005-07-12T21:01:09', '1'), - ('234', '1269', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('407', '2722', '2006-02-16T02:30:53', '2005-08-02T12:19:50', '2005-08-11T06:38:50', '1'), - ('347', '537', '2006-02-16T02:30:53', '2005-07-28T20:39:47', '2005-08-02T16:29:47', '1'), - ('10', '2869', '2006-02-16T02:30:53', '2005-08-02T14:55:00', '2005-08-11T13:57:00', '1'), - ('112', '276', '2006-02-16T02:30:53', '2005-08-23T09:46:33', '2005-09-01T06:07:33', '1'), - ('579', '2650', '2006-02-16T02:30:53', '2005-07-27T00:23:54', '2005-08-03T04:34:54', '1'), - ('527', '3174', '2006-02-16T02:30:53', '2005-07-31T09:19:46', '2005-08-06T08:07:46', '1'), - ('570', '4049', '2006-02-16T02:30:53', '2005-07-31T09:46:29', '2005-08-01T05:08:29', '1'), - ('13', '170', '2006-02-16T02:30:53', '2005-07-12T21:30:41', '2005-07-15T03:19:41', '1'), - ('327', '3765', '2006-02-16T02:30:53', '2005-08-17T16:28:51', '2005-08-25T19:36:51', '1'), - ('23', '3867', '2006-02-16T02:30:53', '2005-08-19T20:00:25', '2005-08-21T17:03:25', '1'), - ('181', '3481', '2006-02-16T02:30:53', '2005-05-28T11:19:23', '2005-06-02T13:51:23', '1'), - ('30', '3250', '2006-02-16T02:30:53', '2005-07-28T06:45:23', '2005-07-30T12:18:23', '1'), - ('111', '4302', '2006-02-16T02:30:53', '2005-08-18T02:08:48', '2005-08-26T00:39:48', '1'), - ('526', '1496', '2006-02-16T02:30:53', '2005-08-16T23:10:34', '2005-08-25T03:55:34', '1'), - ('368', '380', '2006-02-16T02:30:53', '2005-06-19T13:17:21', '2005-06-24T15:09:21', '1'), - ('471', '32', '2006-02-16T02:30:53', '2005-08-22T05:58:27', '2005-08-31T10:08:27', '1'), - ('132', '630', '2006-02-16T02:30:53', '2005-07-06T15:50:03', '2005-07-09T19:20:03', '1'), - ('400', '115', '2006-02-16T02:30:53', '2005-06-15T14:05:32', '2005-06-16T15:31:32', '1'), - ('233', '481', '2006-02-16T02:30:53', '2005-08-22T19:17:24', '2005-08-25T00:25:24', '1'), - ('115', '4338', '2006-02-16T02:30:53', '2005-06-15T13:37:38', '2005-06-19T17:08:38', '1'), - ('593', '2863', '2006-02-16T02:30:53', '2005-05-30T23:29:22', '2005-06-07T23:16:22', '1'), - ('593', '421', '2006-02-16T02:30:53', '2005-07-28T13:34:34', '2005-07-29T16:03:34', '1'), - ('89', '3875', '2006-02-16T02:30:53', '2005-08-20T13:42:10', '2005-08-22T18:45:10', '1'), - ('383', '292', '2006-02-16T02:30:53', '2005-08-02T04:45:01', '2005-08-04T03:32:01', '1'), - ('177', '4512', '2006-02-16T02:30:53', '2005-08-01T04:40:02', '2005-08-03T04:18:02', '1'), - ('190', '3032', '2006-02-16T02:30:53', '2005-06-19T04:09:03', '2005-06-24T23:24:03', '1'), - ('486', '1264', '2006-02-16T02:30:53', '2005-05-30T15:35:08', '2005-06-08T11:38:08', '1'), - ('308', '2205', '2006-02-16T02:30:53', '2005-06-17T18:18:56', '2005-06-18T19:36:56', '1'), - ('543', '1438', '2006-02-16T02:30:53', '2005-07-31T17:40:53', '2005-08-01T14:25:53', '1'), - ('327', '339', '2006-02-16T02:30:53', '2005-06-15T09:09:27', '2005-06-19T04:43:27', '1'), - ('5', '1434', '2006-02-16T02:30:53', '2005-07-12T12:16:28', '2005-07-19T17:03:28', '1'), - ('171', '196', '2006-02-16T02:30:53', '2005-07-30T07:28:54', '2005-08-02T05:23:54', '1'), - ('280', '3806', '2006-02-16T02:30:53', '2005-07-30T08:49:26', '2005-07-31T14:15:26', '1'), - ('583', '3213', '2006-02-16T02:30:53', '2005-07-09T23:45:15', '2005-07-15T22:48:15', '1'), - ('559', '976', '2006-02-16T02:30:53', '2005-08-19T16:17:15', '2005-08-27T12:36:15', '1'), - ('248', '4445', '2006-02-16T02:30:53', '2005-05-28T15:50:07', '2005-06-01T19:45:07', '1'), - ('36', '1897', '2006-02-16T02:30:53', '2005-08-23T08:42:40', '2005-09-01T13:08:40', '1'), - ('49', '711', '2006-02-16T02:30:53', '2005-07-06T05:47:47', '2005-07-11T05:01:47', '1'), - ('463', '669', '2006-02-16T02:30:53', '2005-08-01T03:20:08', '2005-08-08T06:48:08', '1'), - ('115', '1836', '2006-02-16T02:30:53', '2005-07-28T14:23:01', '2005-07-29T11:51:01', '1'), - ('66', '988', '2006-02-16T02:30:53', '2005-06-17T05:08:27', '2005-06-23T09:13:27', '1'), - ('80', '3278', '2006-02-16T02:30:53', '2005-08-20T14:44:22', '2005-08-22T18:10:22', '1'), - ('565', '1405', '2006-02-16T02:30:53', '2005-06-15T20:27:02', '2005-06-16T16:21:02', '1'), - ('125', '2331', '2006-02-16T02:30:53', '2005-08-17T12:55:31', '2005-08-19T08:31:31', '1'), - ('89', '1087', '2006-02-16T02:30:53', '2005-07-30T17:32:11', '2005-08-05T13:36:11', '1'), - ('262', '3857', '2006-02-16T02:30:53', '2005-07-12T15:25:33', '2005-07-21T18:57:33', '1'), - ('304', '1514', '2006-02-16T02:30:53', '2005-06-17T14:03:43', '2005-06-24T09:21:43', '1'), - ('38', '1020', '2006-02-16T02:30:53', '2005-07-07T12:42:02', '2005-07-12T10:52:02', '1'), - ('120', '3672', '2006-02-16T02:30:53', '2005-06-16T21:34:50', '2005-06-20T16:50:50', '1'), - ('96', '424', '2006-02-16T02:30:53', '2005-08-18T02:09:23', '2005-08-22T20:33:23', '1'), - ('149', '4299', '2006-02-16T02:30:53', '2005-06-15T23:58:53', '2005-06-18T03:10:53', '1'), - ('83', '996', '2006-02-16T02:30:53', '2005-08-23T11:52:18', '2005-08-28T15:28:18', '1'), - ('75', '3410', '2006-02-16T02:30:53', '2005-07-12T04:33:19', '2005-07-15T08:26:19', '1'), - ('532', '144', '2006-02-16T02:30:53', '2005-08-17T21:13:35', '2005-08-22T19:18:35', '1'), - ('62', '4135', '2006-02-16T02:30:53', '2005-07-29T05:08:00', '2005-08-02T00:40:00', '1'), - ('36', '2138', '2006-02-16T02:30:53', '2005-07-28T11:59:45', '2005-08-06T11:19:45', '1'), - ('84', '2096', '2006-02-16T02:30:53', '2005-08-22T15:57:38', '2005-08-24T13:46:38', '1'), - ('63', '3623', '2006-02-16T02:30:53', '2005-07-29T03:26:07', '2005-08-02T01:46:07', '1'), - ('181', '2369', '2006-02-16T02:30:53', '2005-07-27T16:02:52', '2005-08-02T13:24:52', '1'), - ('576', '611', '2006-02-16T02:30:53', '2005-06-18T08:43:24', '2005-06-20T03:56:24', '1'), - ('292', '2788', '2006-02-16T02:30:53', '2005-07-09T06:08:22', '2005-07-11T10:52:22', '1'), - ('460', '576', '2006-02-16T02:30:53', '2005-08-23T19:14:07', '2005-08-24T20:21:07', '1'), - ('57', '1324', '2006-02-16T02:30:53', '2005-06-17T15:34:41', '2005-06-25T14:50:41', '1'), - ('312', '576', '2006-02-16T02:30:53', '2005-07-30T10:59:54', '2005-08-05T16:47:54', '1'), - ('58', '1181', '2006-02-16T02:30:53', '2005-08-20T18:52:43', '2005-08-21T19:11:43', '1'), - ('532', '3684', '2006-02-16T02:30:53', '2005-08-02T03:20:23', '2005-08-09T03:23:23', '1'), - ('584', '4146', '2006-02-16T02:30:53', '2005-08-19T01:59:08', '2005-08-24T22:21:08', '1'), - ('459', '384', '2006-02-16T02:30:53', '2005-06-17T02:50:51', '2005-06-18T07:21:51', '1'), - ('459', '1964', '2006-02-16T02:30:53', '2005-07-30T01:00:17', '2005-08-01T03:41:17', '1'), - ('273', '2781', '2006-02-16T02:30:53', '2005-08-18T20:09:19', '2005-08-21T00:14:19', '1'), - ('535', '403', '2006-02-16T02:30:53', '2005-05-25T04:44:31', '2005-05-29T01:03:31', '1'), - ('104', '1400', '2006-02-16T02:30:53', '2005-07-07T00:56:09', '2005-07-10T21:49:09', '1'), - ('235', '4561', '2006-02-16T02:30:53', '2005-07-06T12:30:12', '2005-07-13T12:13:12', '1'), - ('103', '1261', '2006-02-16T02:30:53', '2005-06-17T20:28:29', '2005-06-23T22:47:29', '1'), - ('96', '2873', '2006-02-16T02:30:53', '2005-07-06T12:01:38', '2005-07-15T10:46:38', '1'), - ('177', '3439', '2006-02-16T02:30:53', '2005-06-16T00:25:52', '2005-06-19T03:32:52', '1'), - ('140', '2200', '2006-02-16T02:30:53', '2005-08-22T18:24:34', '2005-08-27T19:53:34', '1'), - ('5', '4323', '2006-02-16T02:30:53', '2005-06-17T15:56:53', '2005-06-21T14:19:53', '1'), - ('144', '724', '2006-02-16T02:30:53', '2005-08-02T22:03:47', '2005-08-09T02:19:47', '1'), - ('491', '1350', '2006-02-16T02:30:53', '2005-07-27T11:59:20', '2005-08-04T12:48:20', '1'), - ('480', '4133', '2006-02-16T02:30:53', '2005-07-29T23:13:41', '2005-07-31T23:55:41', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['6312', '15988', '12483', '15414', '10353', '12335', '7820', '9910', '6013', '11278', '2495', '9756', '15247', '14044', '8895', '7552', '10960', '9667', '2953', '14673', '9895', '1979', '12400', '3328', '14218', '5253', '11586', '6912', '11986', '15532', '3892', '3754', '6907', '9351', '9922', '2386', '15953', '14438', '4239', '4268', '1553', '5703', '10396', '9265', '12619', '575', '12703', '12081', '1632', '8356', '9553', '15034', '10600', '12251', '3025', '526', '7690', '12419', '3559', '13975', '2736', '2052', '6383', '10897', '10857', '11370', '5582', '15820', '3033', '5309', '47', '15891', '8046', '4514', '12336', '5921', '6775', '5005', '15057', '10398', '14533', '5680', '9133', '14341', '11515', '11563', '13684', '2417', '10281', '6843', '10340', '3455', '2450', '7431', '11073', '14408', '12260', '14487', '7153', '4046']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('417', '2188', '2006-02-16T02:30:53', '2005-07-11T18:19:02', '2005-07-18T00:00:02', '1'), - ('400', '3932', '2006-02-16T02:30:53', '2005-08-23T20:23:08', '2005-08-28T20:50:08', '1'), - ('488', '1805', '2006-02-16T02:30:53', '2005-08-18T12:38:37', '2005-08-24T13:26:37', '1'), - ('532', '718', '2006-02-16T02:30:53', '2005-08-22T23:43:54', '2005-08-30T18:26:54', '1'), - ('535', '1446', '2006-02-16T02:30:53', '2005-08-01T05:46:33', '2005-08-08T09:14:33', '1'), - ('150', '2776', '2006-02-16T02:30:53', '2005-08-18T06:59:15', '2005-08-20T06:47:15', '1'), - ('459', '4475', '2006-02-16T02:30:53', '2005-07-28T08:28:51', '2005-08-05T10:00:51', '1'), - ('122', '368', '2006-02-16T02:30:53', '2005-07-31T14:47:57', '2005-08-05T18:20:57', '1'), - ('543', '3774', '2006-02-16T02:30:53', '2005-07-11T02:02:03', '2005-07-14T02:07:03', '1'), - ('143', '961', '2006-02-16T02:30:53', '2005-08-02T14:29:43', '2005-08-07T10:13:43', '1'), - ('338', '3826', '2006-02-16T02:30:53', '2005-06-18T22:15:42', '2005-06-21T23:21:42', '1'), - ('400', '207', '2006-02-16T02:30:53', '2005-07-31T09:25:00', '2005-08-02T05:11:00', '1'), - ('250', '4572', '2006-02-16T02:30:53', '2005-08-22T17:52:05', '2005-08-31T21:37:05', '1'), - ('145', '1422', '2006-02-16T02:30:53', '2005-08-20T21:48:38', '2005-08-29T02:56:38', '1'), - ('494', '3217', '2006-02-16T02:30:53', '2005-07-30T00:49:17', '2005-07-31T01:56:17', '1'), - ('16', '2166', '2006-02-16T02:30:53', '2005-07-27T22:03:41', '2005-07-28T22:24:41', '1'), - ('399', '3536', '2006-02-16T02:30:53', '2005-08-02T03:46:18', '2005-08-11T01:29:18', '1'), - ('523', '4289', '2006-02-16T02:30:53', '2005-07-31T06:23:52', '2005-08-09T09:12:52', '1'), - ('540', '1829', '2006-02-16T02:30:53', '2005-06-20T06:39:11', '2005-06-26T06:19:11', '1'), - ('445', '1827', '2006-02-16T02:30:53', '2005-08-21T20:01:18', '2005-08-25T18:55:18', '1'), - ('560', '835', '2006-02-16T02:30:53', '2005-07-31T14:07:56', '2005-08-05T14:56:56', '1'), - ('45', '3470', '2006-02-16T02:30:53', '2005-06-17T09:45:30', '2005-06-20T10:52:30', '1'), - ('10', '1767', '2006-02-16T02:30:53', '2005-08-18T09:19:12', '2005-08-26T06:52:12', '1'), - ('292', '2462', '2006-02-16T02:30:53', '2005-06-21T09:08:44', '2005-06-30T12:28:44', '1'), - ('104', '4087', '2006-02-16T02:30:53', '2005-08-21T04:43:59', '2005-08-27T10:29:59', '1'), - ('532', '2241', '2006-02-16T02:30:53', '2005-07-09T13:41:17', '2005-07-17T17:09:17', '1'), - ('465', '3140', '2006-02-16T02:30:53', '2005-08-17T02:20:42', '2005-08-26T05:01:42', '1'), - ('471', '1701', '2006-02-16T02:30:53', '2005-07-12T22:17:16', '2005-07-19T18:18:16', '1'), - ('352', '1610', '2006-02-16T02:30:53', '2005-08-17T18:21:58', '2005-08-18T13:05:58', '1'), - ('23', '1061', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('549', '778', '2006-02-16T02:30:53', '2005-07-06T18:58:58', '2005-07-10T19:29:58', '1'), - ('83', '4042', '2006-02-16T02:30:53', '2005-07-06T12:35:44', '2005-07-08T16:28:44', '1'), - ('575', '2516', '2006-02-16T02:30:53', '2005-07-12T22:03:49', '2005-07-18T19:18:49', '1'), - ('107', '2063', '2006-02-16T02:30:53', '2005-07-30T18:28:30', '2005-08-02T17:26:30', '1'), - ('25', '3615', '2006-02-16T02:30:53', '2005-07-31T14:59:37', '2005-08-06T14:05:37', '1'), - ('293', '1361', '2006-02-16T02:30:53', '2005-06-18T15:22:51', '2005-06-22T20:01:51', '1'), - ('540', '3727', '2006-02-16T02:30:53', '2005-08-23T19:13:46', '2005-08-28T23:05:46', '1'), - ('392', '1621', '2006-02-16T02:30:53', '2005-08-21T11:51:10', '2005-08-28T17:10:10', '1'), - ('122', '3866', '2006-02-16T02:30:53', '2005-07-07T13:23:17', '2005-07-13T17:49:17', '1'), - ('80', '432', '2006-02-16T02:30:53', '2005-07-07T14:36:05', '2005-07-16T14:36:05', '1'), - ('416', '4026', '2006-02-16T02:30:53', '2005-06-16T02:02:44', '2005-06-19T07:50:44', '1'), - ('132', '1585', '2006-02-16T02:30:53', '2005-07-10T10:04:15', '2005-07-16T07:43:15', '1'), - ('284', '2982', '2006-02-16T02:30:53', '2005-08-01T07:08:46', '2005-08-08T03:47:46', '1'), - ('560', '3700', '2006-02-16T02:30:53', '2005-07-30T14:55:25', '2005-08-02T11:34:25', '1'), - ('592', '980', '2006-02-16T02:30:53', '2005-08-18T17:24:15', '2005-08-21T15:56:15', '1'), - ('142', '4451', '2006-02-16T02:30:53', '2005-05-28T10:56:09', '2005-06-05T15:39:09', '1'), - ('453', '1278', '2006-02-16T02:30:53', '2005-08-18T20:37:13', '2005-08-26T16:13:13', '1'), - ('597', '620', '2006-02-16T02:30:53', '2005-08-17T22:10:46', '2005-08-22T22:37:46', '1'), - ('319', '1518', '2006-02-16T02:30:53', '2005-06-16T08:03:42', '2005-06-17T03:40:42', '1'), - ('483', '2951', '2006-02-16T02:30:53', '2005-07-29T04:58:56', '2005-08-06T03:07:56', '1'), - ('579', '4187', '2006-02-16T02:30:53', '2005-07-31T02:06:34', '2005-08-08T02:20:34', '1'), - ('235', '1331', '2006-02-16T02:30:53', '2005-08-22T09:33:08', '2005-08-29T13:04:08', '1'), - ('294', '3900', '2006-02-16T02:30:53', '2005-08-01T14:25:21', '2005-08-06T18:00:21', '1'), - ('276', '3044', '2006-02-16T02:30:53', '2005-08-18T03:59:02', '2005-08-19T02:38:02', '1'), - ('293', '1309', '2006-02-16T02:30:53', '2005-06-20T11:46:48', '2005-06-22T08:43:48', '1'), - ('408', '1387', '2006-02-16T02:30:53', '2005-05-28T04:27:37', '2005-05-30T07:52:37', '1'), - ('150', '1076', '2006-02-16T02:30:53', '2005-07-28T03:26:21', '2005-07-29T00:08:21', '1'), - ('133', '3111', '2006-02-16T02:30:53', '2005-08-18T10:01:48', '2005-08-19T13:40:48', '1'), - ('483', '2211', '2006-02-16T02:30:53', '2005-07-06T02:49:42', '2005-07-12T04:44:42', '1'), - ('286', '3821', '2006-02-16T02:30:53', '2005-08-20T18:58:23', '2005-08-25T20:58:23', '1'), - ('359', '4510', '2006-02-16T02:30:53', '2005-06-19T15:43:20', '2005-06-21T13:03:20', '1'), - ('172', '1686', '2006-02-16T02:30:53', '2005-06-17T15:14:43', '2005-06-21T11:08:43', '1'), - ('486', '4275', '2006-02-16T02:30:53', '2005-07-11T22:06:53', '2005-07-17T16:09:53', '1'), - ('338', '291', '2006-02-16T02:30:53', '2005-08-02T01:23:42', '2005-08-03T23:27:42', '1'), - ('360', '2961', '2006-02-16T02:30:53', '2005-08-02T00:07:20', '2005-08-04T02:35:20', '1'), - ('146', '3077', '2006-02-16T02:30:53', '2005-08-02T18:06:01', '2005-08-04T15:10:01', '1'), - ('305', '3341', '2006-02-16T02:30:53', '2005-07-10T04:08:25', '2005-07-13T06:04:25', '1'), - ('308', '4553', '2006-02-16T02:30:53', '2005-08-23T15:03:13', '2005-08-25T20:12:13', '1'), - ('107', '4422', '2006-02-16T02:30:53', '2005-06-20T12:02:05', '2005-06-26T15:58:05', '1'), - ('338', '4026', '2006-02-16T02:30:53', '2005-07-09T16:00:16', '2005-07-17T17:56:16', '1'), - ('35', '2211', '2006-02-16T02:30:53', '2005-05-25T06:05:20', '2005-05-30T03:04:20', '1'), - ('52', '2168', '2006-02-16T02:30:53', '2005-08-23T17:00:12', '2005-08-31T21:12:12', '1'), - ('120', '2873', '2006-02-16T02:30:53', '2005-07-28T16:49:41', '2005-07-31T21:33:41', '1'), - ('576', '1938', '2006-02-16T02:30:53', '2005-07-08T02:41:25', '2005-07-15T06:17:25', '1'), - ('75', '2484', '2006-02-16T02:30:53', '2005-08-18T06:59:41', '2005-08-23T01:36:41', '1'), - ('7', '3920', '2006-02-16T02:30:53', '2005-07-10T21:35:12', '2005-07-18T19:59:12', '1'), - ('383', '2909', '2006-02-16T02:30:53', '2005-07-12T16:01:44', '2005-07-19T14:11:44', '1'), - ('451', '3034', '2006-02-16T02:30:53', '2005-07-09T01:21:44', '2005-07-14T20:27:44', '1'), - ('20', '4534', '2006-02-16T02:30:53', '2005-08-22T10:19:58', '2005-08-28T05:12:58', '1'), - ('174', '4306', '2006-02-16T02:30:53', '2005-08-01T07:11:49', '2005-08-04T05:54:49', '1'), - ('586', '2202', '2006-02-16T02:30:53', '2005-08-21T15:15:19', '2005-08-26T12:47:19', '1'), - ('199', '3503', '2006-02-16T02:30:53', '2005-07-10T08:47:36', '2005-07-17T06:10:36', '1'), - ('576', '408', '2006-02-16T02:30:53', '2005-07-30T09:59:00', '2005-08-07T04:24:00', '1'), - ('560', '4498', '2006-02-16T02:30:53', '2005-08-21T08:38:24', '2005-08-26T12:36:24', '1'), - ('279', '1053', '2006-02-16T02:30:53', '2005-08-16T23:54:34', '2005-08-21T19:00:34', '1'), - ('83', '1545', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('348', '2213', '2006-02-16T02:30:53', '2005-08-20T08:55:53', '2005-08-25T08:11:53', '1'), - ('219', '1956', '2006-02-16T02:30:53', '2005-06-18T17:12:01', '2005-06-26T13:32:01', '1'), - ('549', '1047', '2006-02-16T02:30:53', '2005-08-01T03:28:33', '2005-08-02T05:06:33', '1'), - ('561', '746', '2006-02-16T02:30:53', '2005-07-12T19:14:05', '2005-07-20T23:15:05', '1'), - ('568', '3608', '2006-02-16T02:30:53', '2005-08-01T05:07:03', '2005-08-06T01:03:03', '1'), - ('340', '4403', '2006-02-16T02:30:53', '2005-06-21T21:17:51', '2005-06-23T17:22:51', '1'), - ('230', '863', '2006-02-16T02:30:53', '2005-06-18T19:25:47', '2005-06-27T15:54:47', '1'), - ('589', '3931', '2006-02-16T02:30:53', '2005-07-27T17:27:27', '2005-07-31T18:40:27', '1'), - ('234', '4232', '2006-02-16T02:30:53', '2005-08-02T07:13:03', '2005-08-03T05:46:03', '1'), - ('593', '222', '2006-02-16T02:30:53', '2005-08-21T10:47:24', '2005-08-27T08:18:24', '1'), - ('150', '1352', '2006-02-16T02:30:53', '2005-08-18T04:15:43', '2005-08-26T23:31:43', '1'), - ('526', '2578', '2006-02-16T02:30:53', '2005-08-21T13:53:33', '2005-08-29T19:32:33', '1'), - ('41', '2657', '2006-02-16T02:30:53', '2005-07-27T07:15:38', '2005-07-28T09:56:38', '1'), - ('491', '3518', '2006-02-16T02:30:53', '2005-07-07T03:27:59', '2005-07-14T01:14:59', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['1119', '12647', '3964', '3194', '10688', '1085', '1783', '14831', '15888', '4173', '11691', '2077', '14639', '14089', '7538', '10036', '8772', '6901', '1590', '14457', '7159', '1321', '184', '814', '6533', '4940', '7971', '8843', '3092', '13809', '8762', '9463', '1016', '2008', '399', '15514', '620', '11930', '2782', '11774', '2803', '10472', '8815', '11698', '8589', '11037', '14768', '1391', '3408', '9003', '12698', '6106', '9979', '5239', '5475', '5585', '11362', '6696', '9429', '9012', '10077', '3180', '1987', '3080', '3955', '1494', '1498', '5222', '12989', '7438', '15667', '102', '12225', '10205', '8730', '10913', '1617', '4829', '11877', '3145', '7120', '2119', '15408', '7032', '701', '4242', '1665', '2595', '14406', '8218', '15191', '852', '11708', '3767', '13115', '9625', '5091', '7287', '11399', '11034']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('469', '4401', '2006-02-16T02:30:53', '2005-05-31T16:34:27', '2005-06-02T10:54:27', '1'), - ('520', '323', '2006-02-16T02:30:53', '2005-08-18T18:29:51', '2005-08-27T22:51:51', '1'), - ('30', '1853', '2006-02-16T02:30:53', '2005-07-06T22:23:02', '2005-07-07T22:21:02', '1'), - ('432', '1835', '2006-02-16T02:30:53', '2005-06-20T23:59:57', '2005-06-24T19:21:57', '1'), - ('449', '3161', '2006-02-16T02:30:53', '2005-08-01T17:53:43', '2005-08-09T21:50:43', '1'), - ('5', '301', '2006-02-16T02:30:53', '2005-05-31T11:15:43', '2005-06-07T12:02:43', '1'), - ('18', '50', '2006-02-16T02:30:53', '2005-06-16T19:23:23', '2005-06-18T00:57:23', '1'), - ('156', '3370', '2006-02-16T02:30:53', '2005-08-22T01:40:49', '2005-08-23T02:47:49', '1'), - ('321', '2955', '2006-02-16T02:30:53', '2005-08-23T16:56:14', '2005-08-31T14:32:14', '1'), - ('320', '4272', '2006-02-16T02:30:53', '2005-07-07T09:57:26', '2005-07-10T04:05:26', '1'), - ('515', '2529', '2006-02-16T02:30:53', '2005-08-17T06:51:05', '2005-08-24T09:53:05', '1'), - ('113', '4478', '2006-02-16T02:30:53', '2005-06-17T16:46:11', '2005-06-19T15:10:11', '1'), - ('210', '3510', '2006-02-16T02:30:53', '2005-08-21T19:01:39', '2005-08-26T14:08:39', '1'), - ('425', '1400', '2006-02-16T02:30:53', '2005-08-20T23:59:02', '2005-08-27T00:19:02', '1'), - ('361', '2486', '2006-02-16T02:30:53', '2005-07-27T21:38:04', '2005-08-02T03:14:04', '1'), - ('491', '41', '2006-02-16T02:30:53', '2005-07-31T18:47:20', '2005-08-03T22:53:20', '1'), - ('122', '3526', '2006-02-16T02:30:53', '2005-07-29T19:55:25', '2005-08-05T18:48:25', '1'), - ('158', '4574', '2006-02-16T02:30:53', '2005-07-12T21:46:33', '2005-07-16T21:36:33', '1'), - ('98', '3685', '2006-02-16T02:30:53', '2005-06-16T05:11:41', '2005-06-23T10:11:41', '1'), - ('340', '4288', '2006-02-16T02:30:53', '2005-08-21T12:47:38', '2005-08-25T13:07:38', '1'), - ('158', '1220', '2006-02-16T02:30:53', '2005-07-27T07:24:00', '2005-08-05T11:13:00', '1'), - ('204', '3516', '2006-02-16T02:30:53', '2005-06-15T10:49:17', '2005-06-16T15:30:17', '1'), - ('556', '1970', '2006-02-16T02:30:53', '2005-05-26T05:29:49', '2005-05-28T10:10:49', '1'), - ('134', '1572', '2006-02-16T02:30:53', '2005-05-29T20:16:12', '2005-06-07T17:47:12', '1'), - ('366', '3853', '2006-02-16T02:30:53', '2005-07-12T04:39:38', '2005-07-18T05:29:38', '1'), - ('215', '971', '2006-02-16T02:30:53', '2005-07-08T22:36:06', '2005-07-15T04:28:06', '1'), - ('445', '1910', '2006-02-16T02:30:53', '2005-07-28T14:00:47', '2005-08-02T10:01:47', '1'), - ('294', '406', '2006-02-16T02:30:53', '2005-07-29T23:04:25', '2005-08-05T22:12:25', '1'), - ('347', '4344', '2006-02-16T02:30:53', '2005-06-20T16:04:42', '2005-06-27T19:54:42', '1'), - ('207', '1597', '2006-02-16T02:30:53', '2005-08-20T12:56:03', '2005-08-27T11:58:03', '1'), - ('463', '2765', '2006-02-16T02:30:53', '2005-07-29T19:30:02', '2005-08-04T18:38:02', '1'), - ('352', '883', '2006-02-16T02:30:53', '2005-07-30T22:30:57', '2005-08-03T22:53:57', '1'), - ('204', '3423', '2006-02-16T02:30:53', '2005-05-31T02:49:43', '2005-06-04T03:48:43', '1'), - ('570', '2081', '2006-02-16T02:30:53', '2005-06-17T11:48:05', '2005-06-25T13:16:05', '1'), - ('204', '553', '2006-02-16T02:30:53', '2005-05-27T12:48:38', '2005-05-29T15:27:38', '1'), - ('366', '2824', '2006-02-16T02:30:53', '2005-08-23T03:03:40', '2005-08-24T01:06:40', '1'), - ('321', '2444', '2006-02-16T02:30:53', '2005-05-28T15:54:45', '2005-06-04T20:26:45', '1'), - ('5', '1299', '2006-02-16T02:30:53', '2005-08-17T16:28:53', '2005-08-25T10:31:53', '1'), - ('156', '3644', '2006-02-16T02:30:53', '2005-06-19T18:25:07', '2005-06-22T14:10:07', '1'), - ('488', '1679', '2006-02-16T02:30:53', '2005-08-17T10:20:39', '2005-08-23T13:37:39', '1'), - ('120', '103', '2006-02-16T02:30:53', '2005-06-19T19:18:27', '2005-06-27T21:48:27', '1'), - ('405', '506', '2006-02-16T02:30:53', '2005-08-01T09:54:41', '2005-08-04T13:31:41', '1'), - ('230', '3469', '2006-02-16T02:30:53', '2005-07-29T21:51:26', '2005-08-03T22:37:26', '1'), - ('353', '3946', '2006-02-16T02:30:53', '2005-08-17T07:09:59', '2005-08-19T04:31:59', '1'), - ('293', '1628', '2006-02-16T02:30:53', '2005-07-29T12:28:17', '2005-08-05T11:40:17', '1'), - ('220', '4291', '2006-02-16T02:30:53', '2005-08-02T05:58:12', '2005-08-07T11:26:12', '1'), - ('570', '3465', '2006-02-16T02:30:53', '2005-08-21T23:44:53', '2005-08-27T20:33:53', '1'), - ('273', '4213', '2006-02-16T02:30:53', '2005-06-15T16:11:21', '2005-06-22T21:32:21', '1'), - ('282', '3453', '2006-02-16T02:30:53', '2005-06-21T16:15:11', '2005-06-27T14:55:11', '1'), - ('507', '1605', '2006-02-16T02:30:53', '2005-07-30T05:02:52', '2005-07-31T10:33:52', '1'), - ('497', '3657', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('185', '2714', '2006-02-16T02:30:53', '2005-07-11T07:05:06', '2005-07-20T09:27:06', '1'), - ('576', '646', '2006-02-16T02:30:53', '2005-07-31T17:00:07', '2005-08-08T20:40:07', '1'), - ('497', '380', '2006-02-16T02:30:53', '2005-07-09T13:12:35', '2005-07-10T13:37:35', '1'), - ('219', '726', '2006-02-16T02:30:53', '2005-07-09T23:31:38', '2005-07-12T03:51:38', '1'), - ('63', '3524', '2006-02-16T02:30:53', '2005-07-10T04:15:43', '2005-07-15T08:24:43', '1'), - ('331', '2628', '2006-02-16T02:30:53', '2005-08-02T17:47:25', '2005-08-07T20:14:25', '1'), - ('273', '299', '2006-02-16T02:30:53', '2005-07-12T12:44:04', '2005-07-16T14:17:04', '1'), - ('288', '1769', '2006-02-16T02:30:53', '2005-07-30T21:19:26', '2005-08-07T18:39:26', '1'), - ('494', '3604', '2006-02-16T02:30:53', '2005-07-30T05:18:57', '2005-08-06T06:21:57', '1'), - ('19', '2333', '2006-02-16T02:30:53', '2005-07-31T20:01:06', '2005-08-09T16:07:06', '1'), - ('162', '3997', '2006-02-16T02:30:53', '2005-06-20T22:48:44', '2005-06-21T21:25:44', '1'), - ('479', '110', '2006-02-16T02:30:53', '2005-06-17T10:40:36', '2005-06-23T14:23:36', '1'), - ('377', '118', '2006-02-16T02:30:53', '2005-06-20T15:22:32', '2005-06-24T11:08:32', '1'), - ('247', '2523', '2006-02-16T02:30:53', '2005-07-06T21:58:08', '2005-07-08T03:43:08', '1'), - ('575', '244', '2006-02-16T02:30:53', '2005-06-15T21:54:20', '2005-06-19T18:46:20', '1'), - ('352', '3690', '2006-02-16T02:30:53', '2005-06-15T21:58:00', '2005-06-17T21:50:00', '1'), - ('400', '2508', '2006-02-16T02:30:53', '2005-07-09T12:05:45', '2005-07-13T12:11:45', '1'), - ('306', '2929', '2006-02-16T02:30:53', '2005-08-19T07:19:04', '2005-08-21T10:58:04', '1'), - ('52', '1364', '2006-02-16T02:30:53', '2005-07-27T17:40:40', '2005-08-05T15:25:40', '1'), - ('73', '1302', '2006-02-16T02:30:53', '2005-08-23T09:02:03', '2005-08-24T05:47:03', '1'), - ('343', '373', '2006-02-16T02:30:53', '2005-05-25T17:22:10', '2005-05-31T19:47:10', '1'), - ('306', '1876', '2006-02-16T02:30:53', '2005-08-18T03:00:11', '2005-08-24T05:01:11', '1'), - ('87', '33', '2006-02-16T02:30:53', '2005-08-01T00:48:24', '2005-08-06T23:53:24', '1'), - ('592', '4191', '2006-02-16T02:30:53', '2005-07-29T18:23:34', '2005-08-01T19:56:34', '1'), - ('565', '3388', '2006-02-16T02:30:53', '2005-08-02T02:04:03', '2005-08-09T03:21:03', '1'), - ('83', '1382', '2006-02-16T02:30:53', '2005-06-16T07:06:06', '2005-06-25T03:35:06', '1'), - ('133', '2661', '2006-02-16T02:30:53', '2005-07-08T17:54:18', '2005-07-11T23:41:18', '1'), - ('445', '4528', '2006-02-16T02:30:53', '2005-08-17T14:21:11', '2005-08-25T19:46:11', '1'), - ('144', '2211', '2006-02-16T02:30:53', '2005-06-20T20:21:17', '2005-06-22T14:44:17', '1'), - ('98', '416', '2006-02-16T02:30:53', '2005-07-27T05:56:39', '2005-08-04T10:57:39', '1'), - ('561', '2104', '2006-02-16T02:30:53', '2005-06-17T20:34:42', '2005-06-22T00:05:42', '1'), - ('156', '165', '2006-02-16T02:30:53', '2005-08-22T23:26:32', '2005-08-30T20:22:32', '1'), - ('269', '3397', '2006-02-16T02:30:53', '2005-07-27T03:03:09', '2005-07-28T22:57:09', '1'), - ('112', '372', '2006-02-16T02:30:53', '2005-05-29T02:26:27', '2005-06-03T04:59:27', '1'), - ('286', '3626', '2006-02-16T02:30:53', '2005-07-07T13:39:01', '2005-07-12T18:29:01', '1'), - ('490', '2613', '2006-02-16T02:30:53', '2005-06-16T10:16:02', '2005-06-23T09:32:02', '1'), - ('122', '3197', '2006-02-16T02:30:53', '2005-06-19T05:43:55', '2005-06-25T10:20:55', '1'), - ('181', '2741', '2006-02-16T02:30:53', '2005-08-21T10:46:35', '2005-08-28T15:55:35', '1'), - ('578', '2769', '2006-02-16T02:30:53', '2005-07-28T23:45:41', '2005-08-02T00:14:41', '1'), - ('75', '3688', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('549', '1622', '2006-02-16T02:30:53', '2005-05-30T01:36:57', '2005-06-01T22:44:57', '1'), - ('582', '76', '2006-02-16T02:30:53', '2005-08-17T07:26:47', '2005-08-22T04:11:47', '1'), - ('582', '923', '2006-02-16T02:30:53', '2005-07-06T13:07:27', '2005-07-08T18:48:27', '1'), - ('84', '1961', '2006-02-16T02:30:53', '2005-08-19T11:27:43', '2005-08-20T10:58:43', '1'), - ('445', '1703', '2006-02-16T02:30:53', '2005-07-31T04:30:48', '2005-08-03T01:12:48', '1'), - ('149', '4572', '2006-02-16T02:30:53', '2005-07-09T05:52:54', '2005-07-10T02:49:54', '1'), - ('198', '926', '2006-02-16T02:30:53', '2005-07-27T12:24:12', '2005-07-31T15:34:12', '1'), - ('565', '2094', '2006-02-16T02:30:53', '2005-08-02T18:56:28', '2005-08-11T23:19:28', '1'), - ('586', '2939', '2006-02-16T02:30:53', '2005-08-02T05:54:53', '2005-08-09T04:14:53', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['9394', '2389', '6096', '6915', '495', '5189', '4382', '2558', '5877', '15507', '1179', '7487', '8957', '3952', '9150', '7069', '13249', '4764', '2601', '5398', '7707', '10449', '9296', '6102', '14209', '15448', '4066', '1452', '4825', '1362', '8952', '11209', '5246', '14743', '6366', '2651', '4837', '4274', '2078', '15755', '8140', '8582', '6919', '8876', '15440', '933', '12262', '1999', '14070', '6737', '13455', '13930', '125', '3657', '1103', '13726', '9808', '4883', '14883', '15718', '14496', '4205', '7180', '5735', '1933', '4232', '13476', '10860', '5123', '11612', '9212', '13438', '10164', '8502', '7605', '3843', '3262', '1942', '11729', '4516', '12202', '12756', '12758', '5153', '2551', '14191', '1457', '11428', '7146', '7638', '5027', '2055', '12561', '3040', '1226', '7441', '3674', '8294', '12051', '10288']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('204', '161', '2006-02-16T02:30:53', '2005-07-30T20:06:24', '2005-08-06T22:36:24', '1'), - ('382', '731', '2006-02-16T02:30:53', '2005-06-18T15:27:47', '2005-06-21T12:26:47', '1'), - ('420', '2720', '2006-02-16T02:30:53', '2005-07-11T06:18:04', '2005-07-14T01:15:04', '1'), - ('559', '1243', '2006-02-16T02:30:53', '2005-07-12T22:28:09', '2005-07-14T00:53:09', '1'), - ('526', '1007', '2006-02-16T02:30:53', '2005-05-28T00:40:48', '2005-05-29T06:07:48', '1'), - ('113', '2539', '2006-02-16T02:30:53', '2005-07-09T10:23:21', '2005-07-14T08:06:21', '1'), - ('26', '657', '2006-02-16T02:30:53', '2005-07-07T20:41:03', '2005-07-14T15:15:03', '1'), - ('361', '2920', '2006-02-16T02:30:53', '2005-06-19T03:09:16', '2005-06-24T05:29:16', '1'), - ('537', '1520', '2006-02-16T02:30:53', '2005-07-10T19:08:51', '2005-07-19T19:48:51', '1'), - ('563', '3130', '2006-02-16T02:30:53', '2005-08-23T02:48:26', '2005-08-27T01:32:26', '1'), - ('119', '816', '2006-02-16T02:30:53', '2005-06-15T00:36:50', '2005-06-22T22:09:50', '1'), - ('58', '4451', '2006-02-16T02:30:53', '2005-07-27T19:32:45', '2005-07-28T15:11:45', '1'), - ('158', '811', '2006-02-16T02:30:53', '2005-07-30T03:34:10', '2005-08-06T07:05:10', '1'), - ('417', '1719', '2006-02-16T02:30:53', '2005-07-06T21:51:31', '2005-07-13T15:54:31', '1'), - ('213', '2834', '2006-02-16T02:30:53', '2005-07-30T10:49:32', '2005-08-08T15:43:32', '1'), - ('343', '2073', '2006-02-16T02:30:53', '2005-07-27T03:59:35', '2005-08-05T03:33:35', '1'), - ('377', '3084', '2006-02-16T02:30:53', '2005-08-19T16:47:41', '2005-08-20T13:30:41', '1'), - ('89', '1188', '2006-02-16T02:30:53', '2005-07-08T15:01:25', '2005-07-17T15:16:25', '1'), - ('98', '2898', '2006-02-16T02:30:53', '2005-06-19T06:09:44', '2005-06-20T08:03:44', '1'), - ('199', '4352', '2006-02-16T02:30:53', '2005-07-09T19:44:58', '2005-07-17T00:56:58', '1'), - ('232', '2563', '2006-02-16T02:30:53', '2005-07-28T04:07:47', '2005-07-29T02:02:47', '1'), - ('213', '1395', '2006-02-16T02:30:53', '2005-08-01T09:09:59', '2005-08-05T11:25:59', '1'), - ('2', '4088', '2006-02-16T02:30:53', '2005-07-30T16:21:13', '2005-08-08T11:57:13', '1'), - ('146', '4305', '2006-02-16T02:30:53', '2005-07-11T06:53:09', '2005-07-17T07:05:09', '1'), - ('472', '896', '2006-02-16T02:30:53', '2005-08-21T04:17:56', '2005-08-27T06:57:56', '1'), - ('490', '2903', '2006-02-16T02:30:53', '2005-08-23T00:55:24', '2005-08-25T02:20:24', '1'), - ('368', '1975', '2006-02-16T02:30:53', '2005-07-07T04:34:09', '2005-07-10T23:54:09', '1'), - ('243', '4348', '2006-02-16T02:30:53', '2005-06-15T19:32:52', '2005-06-16T13:45:52', '1'), - ('563', '2419', '2006-02-16T02:30:53', '2005-07-08T17:43:01', '2005-07-11T20:58:01', '1'), - ('98', '4524', '2006-02-16T02:30:53', '2005-06-15T13:53:32', '2005-06-19T16:05:32', '1'), - ('36', '4397', '2006-02-16T02:30:53', '2005-07-30T03:20:38', '2005-08-02T02:54:38', '1'), - ('24', '3219', '2006-02-16T02:30:53', '2005-08-02T12:09:45', '2005-08-07T08:52:45', '1'), - ('276', '3548', '2006-02-16T02:30:53', '2005-07-09T13:25:18', '2005-07-13T18:38:18', '1'), - ('2', '4570', '2006-02-16T02:30:53', '2005-08-21T22:41:56', '2005-08-29T00:18:56', '1'), - ('366', '3989', '2006-02-16T02:30:53', '2005-07-11T21:18:16', '2005-07-17T00:21:16', '1'), - ('576', '2181', '2006-02-16T02:30:53', '2005-06-19T10:22:56', '2005-06-27T13:37:56', '1'), - ('149', '1944', '2006-02-16T02:30:53', '2005-07-08T18:09:12', '2005-07-11T16:40:12', '1'), - ('26', '787', '2006-02-16T02:30:53', '2005-07-07T14:42:04', '2005-07-13T20:23:04', '1'), - ('278', '2021', '2006-02-16T02:30:53', '2005-06-17T16:48:55', '2005-06-19T18:01:55', '1'), - ('423', '511', '2006-02-16T02:30:53', '2005-08-23T12:46:38', '2005-08-25T12:59:38', '1'), - ('119', '4270', '2006-02-16T02:30:53', '2005-07-28T20:17:50', '2005-07-30T18:07:50', '1'), - ('162', '841', '2006-02-16T02:30:53', '2005-07-29T12:03:27', '2005-08-03T07:02:27', '1'), - ('540', '1122', '2006-02-16T02:30:53', '2005-07-12T22:32:17', '2005-07-18T20:09:17', '1'), - ('579', '2394', '2006-02-16T02:30:53', '2005-07-30T00:15:09', '2005-08-02T23:56:09', '1'), - ('559', '2254', '2006-02-16T02:30:53', '2005-08-23T00:37:21', '2005-08-24T23:24:21', '1'), - ('66', '3672', '2006-02-16T02:30:53', '2005-05-30T13:08:45', '2005-06-01T18:56:45', '1'), - ('125', '591', '2006-02-16T02:30:53', '2005-08-18T04:16:15', '2005-08-20T09:16:15', '1'), - ('111', '3704', '2006-02-16T02:30:53', '2005-06-17T11:30:08', '2005-06-23T08:36:08', '1'), - ('581', '846', '2006-02-16T02:30:53', '2005-08-20T22:56:34', '2005-08-29T22:02:34', '1'), - ('304', '315', '2006-02-16T02:30:53', '2005-07-12T14:16:52', '2005-07-18T19:48:52', '1'), - ('133', '1315', '2006-02-16T02:30:53', '2005-08-20T00:32:17', '2005-08-26T19:33:17', '1'), - ('58', '3585', '2006-02-16T02:30:53', '2005-08-20T17:15:06', '2005-08-21T14:29:06', '1'), - ('368', '952', '2006-02-16T02:30:53', '2005-05-25T20:48:50', '2005-06-02T21:39:50', '1'), - ('113', '4134', '2006-02-16T02:30:53', '2005-07-06T07:55:30', '2005-07-11T07:18:30', '1'), - ('353', '3154', '2006-02-16T02:30:53', '2005-05-31T14:24:18', '2005-06-09T10:27:18', '1'), - ('214', '2258', '2006-02-16T02:30:53', '2005-08-20T10:08:40', '2005-08-23T14:58:40', '1'), - ('583', '3259', '2006-02-16T02:30:53', '2005-07-31T11:17:22', '2005-08-07T15:54:22', '1'), - ('563', '1366', '2006-02-16T02:30:53', '2005-07-08T19:46:58', '2005-07-10T15:48:58', '1'), - ('177', '1946', '2006-02-16T02:30:53', '2005-08-22T03:55:02', '2005-08-28T02:51:02', '1'), - ('276', '2180', '2006-02-16T02:30:53', '2005-08-23T11:05:17', '2005-08-28T12:50:17', '1'), - ('223', '2185', '2006-02-16T02:30:53', '2005-08-21T14:07:35', '2005-08-24T12:31:35', '1'), - ('486', '3922', '2006-02-16T02:30:53', '2005-07-07T11:25:39', '2005-07-11T06:12:39', '1'), - ('215', '460', '2006-02-16T02:30:53', '2005-07-27T08:14:34', '2005-07-31T05:24:34', '1'), - ('65', '3259', '2006-02-16T02:30:53', '2005-07-10T11:39:15', '2005-07-19T09:52:15', '1'), - ('13', '980', '2006-02-16T02:30:53', '2005-06-17T06:54:42', '2005-06-26T02:00:42', '1'), - ('347', '3841', '2006-02-16T02:30:53', '2005-07-07T12:49:12', '2005-07-15T16:45:12', '1'), - ('7', '2866', '2006-02-16T02:30:53', '2005-08-20T01:06:04', '2005-08-24T23:56:04', '1'), - ('25', '2827', '2006-02-16T02:30:53', '2005-08-02T00:12:32', '2005-08-04T03:50:32', '1'), - ('219', '4278', '2006-02-16T02:30:53', '2005-07-09T07:20:30', '2005-07-14T05:24:30', '1'), - ('526', '375', '2006-02-16T02:30:53', '2005-08-17T03:48:51', '2005-08-20T03:03:51', '1'), - ('73', '2111', '2006-02-16T02:30:53', '2005-07-30T13:03:13', '2005-08-06T09:48:13', '1'), - ('520', '1750', '2006-02-16T02:30:53', '2005-08-19T23:38:02', '2005-08-26T21:36:02', '1'), - ('89', '1405', '2006-02-16T02:30:53', '2005-07-31T23:17:57', '2005-08-05T19:43:57', '1'), - ('457', '2149', '2006-02-16T02:30:53', '2005-07-29T09:15:41', '2005-07-30T10:41:41', '1'), - ('576', '1391', '2006-02-16T02:30:53', '2005-07-27T23:57:01', '2005-08-03T04:11:01', '1'), - ('62', '3844', '2006-02-16T02:30:53', '2005-07-06T16:35:40', '2005-07-07T18:29:40', '1'), - ('9', '3773', '2006-02-16T02:30:53', '2005-06-21T04:08:43', '2005-06-28T02:55:43', '1'), - ('143', '261', '2006-02-16T02:30:53', '2005-06-17T07:43:39', '2005-06-25T02:24:39', '1'), - ('215', '2819', '2006-02-16T02:30:53', '2005-08-17T08:14:41', '2005-08-22T02:54:41', '1'), - ('497', '2314', '2006-02-16T02:30:53', '2005-07-08T02:43:41', '2005-07-14T02:20:41', '1'), - ('563', '672', '2006-02-16T02:30:53', '2005-08-18T02:14:08', '2005-08-24T04:35:08', '1'), - ('89', '1840', '2006-02-16T02:30:53', '2005-08-18T22:52:13', '2005-08-21T17:22:13', '1'), - ('30', '2279', '2006-02-16T02:30:53', '2005-08-18T22:58:34', '2005-08-22T23:33:34', '1'), - ('504', '2826', '2006-02-16T02:30:53', '2005-07-09T08:35:05', '2005-07-18T14:21:05', '1'), - ('444', '2007', '2006-02-16T02:30:53', '2005-06-19T02:51:04', '2005-06-28T05:02:04', '1'), - ('423', '301', '2006-02-16T02:30:53', '2005-08-21T03:35:58', '2005-08-28T00:28:58', '1'), - ('345', '730', '2006-02-16T02:30:53', '2005-06-15T20:05:49', '2005-06-19T15:35:49', '1'), - ('326', '722', '2006-02-16T02:30:53', '2005-08-02T20:03:10', '2005-08-04T01:55:10', '1'), - ('323', '2245', '2006-02-16T02:30:53', '2005-07-27T07:02:30', '2005-08-05T10:29:30', '1'), - ('172', '1890', '2006-02-16T02:30:53', '2005-07-28T01:13:26', '2005-07-28T20:34:26', '1'), - ('109', '2179', '2006-02-16T02:30:53', '2005-07-09T02:32:37', '2005-07-16T23:13:37', '1'), - ('593', '1399', '2006-02-16T02:30:53', '2005-06-17T15:27:03', '2005-06-25T13:44:03', '1'), - ('392', '812', '2006-02-16T02:30:53', '2005-08-18T14:58:51', '2005-08-20T10:53:51', '1'), - ('162', '2568', '2006-02-16T02:30:53', '2005-06-20T12:34:13', '2005-06-21T12:33:13', '1'), - ('409', '2290', '2006-02-16T02:30:53', '2005-06-15T03:46:10', '2005-06-23T02:00:10', '1'), - ('198', '4039', '2006-02-16T02:30:53', '2005-07-27T17:46:53', '2005-07-31T23:05:53', '1'), - ('559', '3686', '2006-02-16T02:30:53', '2005-07-06T09:03:13', '2005-07-13T08:43:13', '1'), - ('520', '1811', '2006-02-16T02:30:53', '2005-07-29T02:32:41', '2005-08-02T06:28:41', '1'), - ('579', '4001', '2006-02-16T02:30:53', '2005-08-17T20:56:15', '2005-08-25T19:08:15', '1'), - ('63', '572', '2006-02-16T02:30:53', '2005-08-01T03:38:42', '2005-08-06T04:34:42', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['7265', '12342', '8584', '5561', '12394', '3032', '3490', '5068', '3384', '3126', '11991', '9422', '7344', '13562', '3235', '14149', '11455', '10951', '4334', '1891', '4081', '13105', '4748', '5757', '8500', '3415', '9028', '3826', '1263', '12042', '7877', '11392', '10466', '962', '13071', '11495', '6874', '13805', '4803', '6896', '8861', '12606', '14123', '4421', '4678', '9102', '1095', '15461', '6360', '3669', '9624', '4993', '64', '4198', '4475', '90', '3418', '8170', '13212', '9675', '14088', '7805', '12863', '14789', '292', '9442', '7024', '14795', '1324', '12138', '4629', '6607', '2186', '7326', '8374', '1879', '1347', '9367', '3535', '3440', '8907', '12347', '11040', '1928', '13559', '5081', '7839', '3221', '8934', '12168', '11181', '14141', '698', '8485', '1019', '9550', '4255', '14739', '15663', '6478']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('290', '3465', '2006-02-16T02:30:53', '2005-07-27T11:19:01', '2005-08-01T09:29:01', '1'), - ('63', '1408', '2006-02-16T02:30:53', '2005-08-18T07:12:46', '2005-08-21T07:44:46', '1'), - ('482', '1656', '2006-02-16T02:30:53', '2005-07-29T12:07:53', '2005-07-31T09:27:53', '1'), - ('369', '1048', '2006-02-16T02:30:53', '2005-07-10T03:15:24', '2005-07-15T06:46:24', '1'), - ('330', '3605', '2006-02-16T02:30:53', '2005-08-18T09:05:15', '2005-08-23T11:10:15', '1'), - ('172', '3734', '2006-02-16T02:30:53', '2005-06-20T11:58:30', '2005-06-24T09:49:30', '1'), - ('369', '3041', '2006-02-16T02:30:53', '2005-07-05T23:37:13', '2005-07-12T22:07:13', '1'), - ('10', '2937', '2006-02-16T02:30:53', '2005-07-09T04:53:18', '2005-07-13T09:21:18', '1'), - ('91', '409', '2006-02-16T02:30:53', '2005-06-21T14:07:35', '2005-06-26T16:34:35', '1'), - ('5', '1183', '2006-02-16T02:30:53', '2005-06-20T18:38:22', '2005-06-26T00:00:22', '1'), - ('361', '940', '2006-02-16T02:30:53', '2005-08-17T18:27:08', '2005-08-25T14:07:08', '1'), - ('470', '1843', '2006-02-16T02:30:53', '2005-07-30T21:08:41', '2005-08-07T15:55:41', '1'), - ('366', '1714', '2006-02-16T02:30:53', '2005-07-27T14:29:28', '2005-07-31T15:36:28', '1'), - ('36', '4547', '2006-02-16T02:30:53', '2005-08-20T04:31:45', '2005-08-25T09:59:45', '1'), - ('49', '212', '2006-02-16T02:30:53', '2005-06-21T02:46:17', '2005-06-22T20:58:17', '1'), - ('518', '3371', '2006-02-16T02:30:53', '2005-08-21T02:22:47', '2005-08-24T02:36:47', '1'), - ('498', '2000', '2006-02-16T02:30:53', '2005-08-02T21:07:06', '2005-08-12T01:21:06', '1'), - ('144', '173', '2006-02-16T02:30:53', '2005-08-02T03:26:35', '2005-08-07T22:03:35', '1'), - ('210', '3021', '2006-02-16T02:30:53', '2005-07-07T18:32:04', '2005-07-08T16:19:04', '1'), - ('109', '3576', '2006-02-16T02:30:53', '2005-06-17T04:16:44', '2005-06-24T07:20:44', '1'), - ('284', '1138', '2006-02-16T02:30:53', '2005-07-07T05:10:08', '2005-07-12T00:47:08', '1'), - ('279', '729', '2006-02-16T02:30:53', '2005-08-19T11:06:16', '2005-08-27T15:21:16', '1'), - ('9', '4279', '2006-02-16T02:30:53', '2005-07-08T13:59:38', '2005-07-15T16:51:38', '1'), - ('101', '1827', '2006-02-16T02:30:53', '2005-07-10T12:40:17', '2005-07-12T14:02:17', '1'), - ('348', '4516', '2006-02-16T02:30:53', '2005-07-29T09:12:01', '2005-07-31T10:15:01', '1'), - ('444', '3540', '2006-02-16T02:30:53', '2005-06-21T16:59:49', '2005-06-27T17:19:49', '1'), - ('119', '2687', '2006-02-16T02:30:53', '2005-07-30T06:00:35', '2005-08-02T01:35:35', '1'), - ('451', '73', '2006-02-16T02:30:53', '2005-07-06T15:51:58', '2005-07-13T12:35:58', '1'), - ('540', '4144', '2006-02-16T02:30:53', '2005-06-15T06:56:39', '2005-06-16T11:08:39', '1'), - ('570', '1772', '2006-02-16T02:30:53', '2005-08-17T20:36:37', '2005-08-21T15:03:37', '1'), - ('65', '2576', '2006-02-16T02:30:53', '2005-07-28T10:25:36', '2005-08-05T12:46:36', '1'), - ('146', '261', '2006-02-16T02:30:53', '2005-08-02T18:41:11', '2005-08-11T21:41:11', '1'), - ('2', '138', '2006-02-16T02:30:53', '2005-08-01T09:45:26', '2005-08-06T06:28:26', '1'), - ('520', '4535', '2006-02-16T02:30:53', '2005-05-30T18:45:17', '2005-06-05T22:47:17', '1'), - ('578', '527', '2006-02-16T02:30:53', '2005-08-19T10:01:07', '2005-08-26T14:26:07', '1'), - ('247', '1265', '2006-02-16T02:30:53', '2005-08-16T22:51:20', '2005-08-23T00:44:20', '1'), - ('539', '4478', '2006-02-16T02:30:53', '2005-07-12T20:20:53', '2005-07-19T19:41:53', '1'), - ('454', '349', '2006-02-16T02:30:53', '2005-08-20T12:53:12', '2005-08-27T15:21:12', '1'), - ('174', '1786', '2006-02-16T02:30:53', '2005-07-08T16:56:34', '2005-07-14T20:16:34', '1'), - ('111', '1266', '2006-02-16T02:30:53', '2005-07-12T21:25:37', '2005-07-20T23:51:37', '1'), - ('560', '759', '2006-02-16T02:30:53', '2005-07-29T23:47:29', '2005-08-07T01:27:29', '1'), - ('275', '359', '2006-02-16T02:30:53', '2005-08-18T17:02:21', '2005-08-24T22:38:21', '1'), - ('66', '143', '2006-02-16T02:30:53', '2005-08-21T01:31:25', '2005-08-23T02:32:25', '1'), - ('417', '4103', '2006-02-16T02:30:53', '2005-07-07T22:07:55', '2005-07-16T20:21:55', '1'), - ('219', '241', '2006-02-16T02:30:53', '2005-07-08T10:30:40', '2005-07-13T11:08:40', '1'), - ('276', '1154', '2006-02-16T02:30:53', '2005-07-30T08:48:20', '2005-08-04T10:19:20', '1'), - ('252', '4546', '2006-02-16T02:30:53', '2005-05-31T13:15:41', '2005-06-05T12:10:41', '1'), - ('103', '4542', '2006-02-16T02:30:53', '2005-08-23T01:13:52', '2005-08-30T00:44:52', '1'), - ('338', '3075', '2006-02-16T02:30:53', '2005-07-11T21:07:40', '2005-07-16T15:11:40', '1'), - ('530', '1299', '2006-02-16T02:30:53', '2005-07-06T08:38:29', '2005-07-10T05:28:29', '1'), - ('7', '3480', '2006-02-16T02:30:53', '2005-07-31T04:30:03', '2005-08-06T09:13:03', '1'), - ('517', '1740', '2006-02-16T02:30:53', '2005-07-09T00:49:47', '2005-07-11T21:19:47', '1'), - ('368', '79', '2006-02-16T02:30:53', '2005-05-25T09:21:29', '2005-06-03T11:31:29', '1'), - ('247', '333', '2006-02-16T02:30:53', '2005-07-07T11:08:11', '2005-07-16T15:29:11', '1'), - ('340', '3466', '2006-02-16T02:30:53', '2005-07-08T00:27:30', '2005-07-09T05:39:30', '1'), - ('25', '2984', '2006-02-16T02:30:53', '2005-05-25T14:31:25', '2005-06-01T10:07:25', '1'), - ('85', '4115', '2006-02-16T02:30:53', '2005-06-21T17:06:38', '2005-06-25T19:43:38', '1'), - ('40', '2495', '2006-02-16T02:30:53', '2005-07-28T21:32:29', '2005-08-03T22:02:29', '1'), - ('158', '3691', '2006-02-16T02:30:53', '2005-08-19T15:24:07', '2005-08-24T21:03:07', '1'), - ('243', '2523', '2006-02-16T02:30:53', '2005-07-31T06:37:07', '2005-08-03T07:03:07', '1'), - ('518', '1184', '2006-02-16T02:30:53', '2005-08-20T23:57:24', '2005-08-28T21:49:24', '1'), - ('366', '3204', '2006-02-16T02:30:53', '2005-07-28T07:56:41', '2005-08-04T06:53:41', '1'), - ('234', '780', '2006-02-16T02:30:53', '2005-08-19T02:35:59', '2005-08-21T21:13:59', '1'), - ('279', '2344', '2006-02-16T02:30:53', '2005-08-22T00:29:39', '2005-08-25T02:25:39', '1'), - ('515', '4264', '2006-02-16T02:30:53', '2005-05-26T20:22:12', '2005-06-05T00:58:12', '1'), - ('75', '44', '2006-02-16T02:30:53', '2005-07-30T21:44:31', '2005-08-04T01:29:31', '1'), - ('252', '3113', '2006-02-16T02:30:53', '2005-07-27T02:36:40', '2005-07-28T06:58:40', '1'), - ('303', '1695', '2006-02-16T02:30:53', '2005-08-22T00:40:22', '2005-08-26T01:37:22', '1'), - ('394', '764', '2006-02-16T02:30:53', '2005-06-15T11:02:45', '2005-06-17T07:14:45', '1'), - ('317', '388', '2006-02-16T02:30:53', '2005-08-17T23:55:54', '2005-08-26T23:32:54', '1'), - ('563', '228', '2006-02-16T02:30:53', '2005-07-08T08:31:26', '2005-07-17T12:07:26', '1'), - ('562', '337', '2006-02-16T02:30:53', '2005-07-12T08:08:50', '2005-07-20T09:17:50', '1'), - ('204', '2050', '2006-02-16T02:30:53', '2005-06-18T01:15:27', '2005-06-21T06:16:27', '1'), - ('432', '2844', '2006-02-16T02:30:53', '2005-07-27T13:50:40', '2005-07-30T08:16:40', '1'), - ('589', '1084', '2006-02-16T02:30:53', '2005-07-29T05:24:02', '2005-08-05T03:55:02', '1'), - ('343', '3983', '2006-02-16T02:30:53', '2005-06-17T02:57:34', '2005-06-19T00:00:34', '1'), - ('190', '374', '2006-02-16T02:30:53', '2005-06-15T12:43:43', '2005-06-16T09:55:43', '1'), - ('557', '793', '2006-02-16T02:30:53', '2005-07-30T18:49:58', '2005-08-08T22:04:58', '1'), - ('65', '4214', '2006-02-16T02:30:53', '2005-07-06T01:32:46', '2005-07-11T03:15:46', '1'), - ('491', '853', '2006-02-16T02:30:53', '2005-06-21T19:58:18', '2005-06-27T22:08:18', '1'), - ('576', '3239', '2006-02-16T02:30:53', '2005-07-30T01:25:03', '2005-08-03T05:41:03', '1'), - ('454', '1788', '2006-02-16T02:30:53', '2005-08-18T07:18:10', '2005-08-19T05:49:10', '1'), - ('223', '2297', '2006-02-16T02:30:53', '2005-08-02T06:03:22', '2005-08-03T07:58:22', '1'), - ('353', '3454', '2006-02-16T02:30:53', '2005-06-17T06:48:31', '2005-06-26T08:17:31', '1'), - ('444', '2413', '2006-02-16T02:30:53', '2005-08-20T04:16:07', '2005-08-24T23:23:07', '1'), - ('420', '1953', '2006-02-16T02:30:53', '2005-07-09T05:25:20', '2005-07-13T23:45:20', '1'), - ('518', '914', '2006-02-16T02:30:53', '2005-07-28T09:01:13', '2005-08-04T11:46:13', '1'), - ('454', '245', '2006-02-16T02:30:53', '2005-06-21T01:49:47', '2005-06-25T06:31:47', '1'), - ('494', '3223', '2006-02-16T02:30:53', '2005-07-30T02:37:05', '2005-08-01T20:42:05', '1'), - ('535', '2859', '2006-02-16T02:30:53', '2005-08-18T01:03:52', '2005-08-18T20:19:52', '1'), - ('557', '3127', '2006-02-16T02:30:53', '2005-08-02T10:55:03', '2005-08-07T10:43:03', '1'), - ('190', '4527', '2006-02-16T02:30:53', '2005-08-21T02:07:22', '2005-08-30T07:32:22', '1'), - ('109', '1412', '2006-02-16T02:30:53', '2005-05-29T02:10:52', '2005-06-01T21:52:52', '1'), - ('420', '3172', '2006-02-16T02:30:53', '2005-07-29T08:53:09', '2005-07-30T11:25:09', '1'), - ('279', '3975', '2006-02-16T02:30:53', '2005-05-31T03:05:07', '2005-06-03T08:34:07', '1'), - ('583', '2233', '2006-02-16T02:30:53', '2005-07-31T01:57:34', '2005-08-08T23:33:34', '1'), - ('10', '749', '2006-02-16T02:30:53', '2005-07-07T14:14:13', '2005-07-12T18:32:13', '1'), - ('226', '4026', '2006-02-16T02:30:53', '2005-08-21T22:33:22', '2005-08-22T19:45:22', '1'), - ('291', '3291', '2006-02-16T02:30:53', '2005-08-23T08:54:26', '2005-08-29T02:56:26', '1'), - ('483', '2589', '2006-02-16T02:30:53', '2005-07-12T01:41:44', '2005-07-15T20:48:44', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['4381', '2376', '11827', '1564', '3803', '10907', '7417', '5684', '2318', '4410', '9049', '1275', '6326', '12541', '7657', '11777', '8480', '4083', '8361', '13631', '7808', '10337', '12999', '11655', '10667', '7131', '10099', '565', '14791', '924', '1411', '4532', '9390', '12291', '5315', '430', '5248', '276', '7454', '188', '14556', '2416', '6131', '8385', '3380', '13635', '6727', '6724', '5853', '12628', '3766', '2221', '7828', '15771', '328', '3055', '6918', '4591', '6399', '12187', '2029', '7398', '11232', '14482', '423', '4666', '294', '5079', '3943', '10484', '8223', '386', '5083', '450', '1133', '12145', '9752', '3388', '11937', '13800', '8623', '1236', '13456', '8588', '4341', '10363', '5300', '8474', '13180', '11806', '2788', '9334', '6238', '1284', '12610', '7516', '2232', '4218', '4326', '7199']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('486', '3727', '2006-02-16T02:30:53', '2005-07-07T20:37:53', '2005-07-10T16:54:53', '1'), - ('479', '3664', '2006-02-16T02:30:53', '2005-06-18T14:55:30', '2005-06-25T17:40:30', '1'), - ('523', '3064', '2006-02-16T02:30:53', '2005-08-17T12:44:27', '2005-08-24T13:31:27', '1'), - ('343', '145', '2006-02-16T02:30:53', '2005-06-16T02:47:07', '2005-06-24T03:12:07', '1'), - ('494', '2062', '2006-02-16T02:30:53', '2005-07-06T15:06:55', '2005-07-08T18:53:55', '1'), - ('561', '1430', '2006-02-16T02:30:53', '2005-08-02T01:51:48', '2005-08-02T19:53:48', '1'), - ('214', '2952', '2006-02-16T02:30:53', '2005-07-27T16:58:33', '2005-07-30T22:17:33', '1'), - ('132', '99', '2006-02-16T02:30:53', '2005-07-10T08:59:03', '2005-07-15T07:21:03', '1'), - ('383', '2328', '2006-02-16T02:30:53', '2005-06-18T09:13:54', '2005-06-23T07:19:54', '1'), - ('584', '2754', '2006-02-16T02:30:53', '2005-07-07T21:48:16', '2005-07-09T03:15:16', '1'), - ('417', '2620', '2006-02-16T02:30:53', '2005-07-30T06:57:28', '2005-08-04T09:02:28', '1'), - ('214', '950', '2006-02-16T02:30:53', '2005-06-15T07:55:43', '2005-06-20T06:30:43', '1'), - ('563', '2137', '2006-02-16T02:30:53', '2005-07-11T19:06:55', '2005-07-12T20:41:55', '1'), - ('584', '4357', '2006-02-16T02:30:53', '2005-08-18T14:18:30', '2005-08-26T10:24:30', '1'), - ('518', '2319', '2006-02-16T02:30:53', '2005-07-28T02:09:00', '2005-08-04T21:44:00', '1'), - ('83', '4065', '2006-02-16T02:30:53', '2005-08-17T10:27:19', '2005-08-26T13:10:19', '1'), - ('467', '3512', '2006-02-16T02:30:53', '2005-07-29T08:44:46', '2005-08-05T13:22:46', '1'), - ('490', '3454', '2006-02-16T02:30:53', '2005-07-07T05:13:15', '2005-07-08T09:11:15', '1'), - ('360', '3404', '2006-02-16T02:30:53', '2005-07-29T05:08:57', '2005-08-03T02:49:57', '1'), - ('535', '1015', '2006-02-16T02:30:53', '2005-08-20T07:07:37', '2005-08-22T04:01:37', '1'), - ('327', '4052', '2006-02-16T02:30:53', '2005-07-28T07:58:56', '2005-08-02T10:49:56', '1'), - ('451', '307', '2006-02-16T02:30:53', '2005-08-01T05:01:46', '2005-08-10T02:41:46', '1'), - ('24', '661', '2006-02-16T02:30:53', '2005-08-19T07:34:53', '2005-08-26T03:57:53', '1'), - ('113', '1699', '2006-02-16T02:30:53', '2005-08-17T05:11:07', '2005-08-26T10:18:07', '1'), - ('340', '3937', '2006-02-16T02:30:53', '2005-08-01T16:58:22', '2005-08-10T15:41:22', '1'), - ('585', '2832', '2006-02-16T02:30:53', '2005-07-27T06:25:06', '2005-07-31T09:07:06', '1'), - ('220', '1960', '2006-02-16T02:30:53', '2005-07-31T20:47:14', '2005-08-02T17:25:14', '1'), - ('288', '1494', '2006-02-16T02:30:53', '2005-05-28T09:26:31', '2005-06-01T07:28:31', '1'), - ('317', '1490', '2006-02-16T02:30:53', '2005-08-22T00:35:55', '2005-08-30T20:23:55', '1'), - ('293', '3279', '2006-02-16T02:30:53', '2005-05-30T12:10:59', '2005-06-04T17:28:59', '1'), - ('520', '2276', '2006-02-16T02:30:53', '2005-06-15T17:05:36', '2005-06-21T14:05:36', '1'), - ('481', '4012', '2006-02-16T02:30:53', '2005-07-08T03:30:39', '2005-07-11T21:49:39', '1'), - ('103', '1794', '2006-02-16T02:30:53', '2005-07-30T19:42:07', '2005-08-01T23:17:07', '1'), - ('73', '4270', '2006-02-16T02:30:53', '2005-08-18T05:08:37', '2005-08-23T09:01:37', '1'), - ('134', '585', '2006-02-16T02:30:53', '2005-07-09T16:09:19', '2005-07-14T21:10:19', '1'), - ('190', '1920', '2006-02-16T02:30:53', '2005-05-27T16:22:10', '2005-06-05T13:10:10', '1'), - ('279', '246', '2006-02-16T02:30:53', '2005-07-09T13:29:44', '2005-07-12T18:12:44', '1'), - ('58', '1221', '2006-02-16T02:30:53', '2005-05-26T17:16:07', '2005-06-03T12:59:07', '1'), - ('75', '3248', '2006-02-16T02:30:53', '2005-07-27T18:27:26', '2005-07-30T23:50:26', '1'), - ('243', '3342', '2006-02-16T02:30:53', '2005-05-26T05:47:12', '2005-05-26T23:48:12', '1'), - ('265', '475', '2006-02-16T02:30:53', '2005-08-21T16:03:27', '2005-08-29T15:49:27', '1'), - ('26', '2868', '2006-02-16T02:30:53', '2005-06-18T17:07:34', '2005-06-24T19:16:34', '1'), - ('107', '3313', '2006-02-16T02:30:53', '2005-07-11T08:22:05', '2005-07-14T07:40:05', '1'), - ('233', '4108', '2006-02-16T02:30:53', '2005-07-29T05:39:16', '2005-08-03T00:30:16', '1'), - ('483', '3212', '2006-02-16T02:30:53', '2005-06-21T13:58:46', '2005-06-30T09:29:46', '1'), - ('286', '669', '2006-02-16T02:30:53', '2005-08-20T07:17:35', '2005-08-29T06:27:35', '1'), - ('407', '3793', '2006-02-16T02:30:53', '2005-07-12T13:54:25', '2005-07-14T17:29:25', '1'), - ('262', '2486', '2006-02-16T02:30:53', '2005-07-12T13:45:15', '2005-07-19T19:18:15', '1'), - ('520', '3026', '2006-02-16T02:30:53', '2005-07-10T17:45:13', '2005-07-17T21:37:13', '1'), - ('520', '3210', '2006-02-16T02:30:53', '2005-08-18T17:40:25', '2005-08-25T13:39:25', '1'), - ('312', '4504', '2006-02-16T02:30:53', '2005-07-06T13:04:35', '2005-07-07T15:46:35', '1'), - ('156', '3905', '2006-02-16T02:30:53', '2005-06-18T03:24:56', '2005-06-22T08:27:56', '1'), - ('212', '1710', '2006-02-16T02:30:53', '2005-07-28T08:40:46', '2005-07-30T14:22:46', '1'), - ('262', '3667', '2006-02-16T02:30:53', '2005-08-23T13:18:46', '2005-08-26T07:29:46', '1'), - ('451', '2524', '2006-02-16T02:30:53', '2005-05-27T01:29:31', '2005-06-01T02:27:31', '1'), - ('23', '1510', '2006-02-16T02:30:53', '2005-06-20T13:19:58', '2005-06-27T14:54:58', '1'), - ('140', '4085', '2006-02-16T02:30:53', '2005-07-12T22:30:29', '2005-07-19T22:51:29', '1'), - ('182', '2276', '2006-02-16T02:30:53', '2005-07-08T06:29:43', '2005-07-17T07:20:43', '1'), - ('288', '2031', '2006-02-16T02:30:53', '2005-07-11T22:39:05', '2005-07-16T01:12:05', '1'), - ('38', '3360', '2006-02-16T02:30:53', '2005-08-18T01:45:50', '2005-08-22T20:12:50', '1'), - ('512', '914', '2006-02-16T02:30:53', '2005-06-17T13:10:59', '2005-06-19T18:15:59', '1'), - ('51', '1572', '2006-02-16T02:30:53', '2005-07-27T16:07:22', '2005-08-05T16:16:22', '1'), - ('8', '971', '2006-02-16T02:30:53', '2005-08-02T13:04:12', '2005-08-10T15:39:12', '1'), - ('23', '2765', '2006-02-16T02:30:53', '2005-08-21T13:42:45', '2005-08-27T11:55:45', '1'), - ('284', '1783', '2006-02-16T02:30:53', '2005-05-27T15:32:57', '2005-06-02T19:03:57', '1'), - ('120', '4576', '2006-02-16T02:30:53', '2005-07-08T10:05:02', '2005-07-16T07:28:02', '1'), - ('369', '2751', '2006-02-16T02:30:53', '2005-05-26T20:29:57', '2005-05-28T17:20:57', '1'), - ('566', '3948', '2006-02-16T02:30:53', '2005-07-09T05:20:40', '2005-07-17T00:06:40', '1'), - ('566', '1816', '2006-02-16T02:30:53', '2005-07-06T21:22:17', '2005-07-07T21:26:17', '1'), - ('400', '1908', '2006-02-16T02:30:53', '2005-08-01T10:19:53', '2005-08-03T05:36:53', '1'), - ('282', '4508', '2006-02-16T02:30:53', '2005-07-28T23:56:01', '2005-08-03T22:27:01', '1'), - ('109', '1288', '2006-02-16T02:30:53', '2005-05-27T10:26:31', '2005-05-30T08:32:31', '1'), - ('494', '148', '2006-02-16T02:30:53', '2005-07-09T05:30:32', '2005-07-11T02:20:32', '1'), - ('247', '1343', '2006-02-16T02:30:53', '2005-05-27T19:18:54', '2005-06-05T23:52:54', '1'), - ('73', '4271', '2006-02-16T02:30:53', '2005-05-31T19:12:21', '2005-06-02T20:12:21', '1'), - ('5', '3482', '2006-02-16T02:30:53', '2005-08-18T00:10:04', '2005-08-26T00:51:04', '1'), - ('199', '249', '2006-02-16T02:30:53', '2005-07-31T09:22:02', '2005-08-02T14:34:02', '1'), - ('119', '556', '2006-02-16T02:30:53', '2005-06-21T14:34:51', '2005-06-28T18:19:51', '1'), - ('515', '2926', '2006-02-16T02:30:53', '2005-08-17T16:48:36', '2005-08-24T19:01:36', '1'), - ('407', '1552', '2006-02-16T02:30:53', '2005-08-20T12:40:48', '2005-08-22T15:06:48', '1'), - ('142', '458', '2006-02-16T02:30:53', '2005-07-29T13:55:11', '2005-08-05T11:16:11', '1'), - ('66', '3182', '2006-02-16T02:30:53', '2005-06-15T04:34:27', '2005-06-18T08:15:27', '1'), - ('13', '1644', '2006-02-16T02:30:53', '2005-08-20T00:33:19', '2005-08-22T01:47:19', '1'), - ('416', '2858', '2006-02-16T02:30:53', '2005-07-29T12:22:20', '2005-07-31T10:49:20', '1'), - ('124', '4523', '2006-02-16T02:30:53', '2005-07-07T18:44:23', '2005-07-15T18:13:23', '1'), - ('174', '320', '2006-02-16T02:30:53', '2005-08-01T06:01:52', '2005-08-05T03:56:52', '1'), - ('8', '2520', '2006-02-16T02:30:53', '2005-07-09T15:40:46', '2005-07-15T13:46:46', '1'), - ('323', '4346', '2006-02-16T02:30:53', '2005-07-29T08:36:56', '2005-08-01T03:07:56', '1'), - ('322', '3443', '2006-02-16T02:30:53', '2005-08-19T14:00:38', '2005-08-20T09:56:38', '1'), - ('125', '3203', '2006-02-16T02:30:53', '2005-08-17T11:49:28', '2005-08-22T15:42:28', '1'), - ('171', '1457', '2006-02-16T02:30:53', '2005-06-19T18:48:11', '2005-06-21T13:32:11', '1'), - ('25', '1499', '2006-02-16T02:30:53', '2005-07-30T17:56:38', '2005-08-03T21:27:38', '1'), - ('23', '3749', '2006-02-16T02:30:53', '2005-07-11T14:20:18', '2005-07-14T18:34:18', '1'), - ('463', '1387', '2006-02-16T02:30:53', '2005-06-15T08:27:33', '2005-06-17T03:58:33', '1'), - ('269', '3181', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('134', '2178', '2006-02-16T02:30:53', '2005-07-27T20:55:28', '2005-07-30T00:50:28', '1'), - ('52', '2463', '2006-02-16T02:30:53', '2005-06-18T03:54:31', '2005-06-22T07:29:31', '1'), - ('497', '152', '2006-02-16T02:30:53', '2005-07-07T12:10:24', '2005-07-15T16:09:24', '1'), - ('331', '4037', '2006-02-16T02:30:53', '2005-07-07T18:01:22', '2005-07-16T15:45:22', '1'), - ('292', '3685', '2006-02-16T02:30:53', '2005-07-27T08:53:23', '2005-08-03T10:01:23', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['11379', '11576', '14272', '5045', '3469', '15472', '11179', '8349', '16048', '10529', '13674', '8157', '2353', '8038', '13394', '657', '12809', '3617', '5869', '5052', '11514', '13998', '11738', '9734', '15539', '10504', '5575', '3562', '14924', '11482', '7270', '3185', '2838', '11788', '14315', '11055', '10004', '10770', '9484', '9786', '3969', '6621', '2821', '15018', '7669', '9256', '3638', '4117', '9911', '4183', '1331', '2556', '3877', '15430', '6525', '10526', '12865', '7157', '13938', '13842', '4752', '8329', '11101', '1142', '6026', '11148', '12104', '2391', '13745', '7506', '6846', '8327', '8746', '2640', '2085', '3112', '7517', '13759', '14023', '532', '6989', '1738', '14564', '14581', '1511', '12662', '12668', '12664', '4019', '9329', '7066', '3162', '2723', '9131', '7367', '1073', '6990', '3215', '13469', '7310']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('61', '251', '2006-02-16T02:30:53', '2005-08-02T18:16:55', '2005-08-07T18:12:55', '1'), - ('293', '327', '2006-02-16T02:30:53', '2005-08-17T01:53:20', '2005-08-19T00:15:20', '1'), - ('243', '3908', '2006-02-16T02:30:53', '2005-08-21T06:24:55', '2005-08-28T02:25:55', '1'), - ('230', '1041', '2006-02-16T02:30:53', '2005-07-09T03:33:32', '2005-07-18T06:15:32', '1'), - ('181', '4087', '2006-02-16T02:30:53', '2005-06-21T22:48:59', '2005-06-28T19:32:59', '1'), - ('226', '4293', '2006-02-16T02:30:53', '2005-08-23T01:39:05', '2005-08-25T04:43:05', '1'), - ('5', '4376', '2006-02-16T02:30:53', '2005-08-02T10:50:06', '2005-08-04T05:24:06', '1'), - ('416', '534', '2006-02-16T02:30:53', '2005-07-29T04:50:22', '2005-08-05T08:50:22', '1'), - ('103', '2019', '2006-02-16T02:30:53', '2005-08-23T22:43:07', '2005-08-31T21:33:07', '1'), - ('444', '851', '2006-02-16T02:30:53', '2005-08-01T12:00:02', '2005-08-08T16:18:02', '1'), - ('36', '3397', '2006-02-16T02:30:53', '2005-08-20T08:30:54', '2005-08-22T02:59:54', '1'), - ('566', '915', '2006-02-16T02:30:53', '2005-07-28T21:06:45', '2005-08-04T16:06:45', '1'), - ('361', '3223', '2006-02-16T02:30:53', '2005-06-18T12:53:25', '2005-06-19T13:53:25', '1'), - ('30', '1225', '2006-02-16T02:30:53', '2005-07-28T16:32:55', '2005-07-30T21:08:55', '1'), - ('45', '2597', '2006-02-16T02:30:53', '2005-08-19T22:05:19', '2005-08-21T23:53:19', '1'), - ('65', '848', '2006-02-16T02:30:53', '2005-05-28T20:23:09', '2005-06-01T02:11:09', '1'), - ('22', '2005', '2006-02-16T02:30:53', '2005-08-19T00:42:24', '2005-08-23T06:06:24', '1'), - ('125', '1337', '2006-02-16T02:30:53', '2005-07-06T05:58:06', '2005-07-13T02:10:06', '1'), - ('40', '2157', '2006-02-16T02:30:53', '2005-07-10T18:40:09', '2005-07-17T18:42:09', '1'), - ('305', '1884', '2006-02-16T02:30:53', '2005-07-09T03:59:43', '2005-07-12T05:48:43', '1'), - ('423', '4240', '2006-02-16T02:30:53', '2005-08-16T23:53:10', '2005-08-23T22:04:10', '1'), - ('530', '3936', '2006-02-16T02:30:53', '2005-08-20T19:52:38', '2005-08-26T14:57:38', '1'), - ('347', '3042', '2006-02-16T02:30:53', '2005-08-17T08:45:55', '2005-08-26T07:09:55', '1'), - ('125', '3320', '2006-02-16T02:30:53', '2005-07-31T08:57:45', '2005-08-05T11:57:45', '1'), - ('582', '2853', '2006-02-16T02:30:53', '2005-08-23T04:09:03', '2005-08-26T04:01:03', '1'), - ('530', '3345', '2006-02-16T02:30:53', '2005-08-01T11:10:55', '2005-08-10T10:16:55', '1'), - ('107', '2316', '2006-02-16T02:30:53', '2005-07-10T03:55:50', '2005-07-12T08:40:50', '1'), - ('587', '1660', '2006-02-16T02:30:53', '2005-07-06T02:54:36', '2005-07-11T05:48:36', '1'), - ('118', '4189', '2006-02-16T02:30:53', '2005-08-22T05:15:17', '2005-08-23T10:11:17', '1'), - ('134', '1400', '2006-02-16T02:30:53', '2005-08-02T22:24:31', '2005-08-04T01:48:31', '1'), - ('526', '1888', '2006-02-16T02:30:53', '2005-07-27T11:29:02', '2005-08-05T08:04:02', '1'), - ('234', '601', '2006-02-16T02:30:53', '2005-06-20T22:58:01', '2005-06-27T00:26:01', '1'), - ('292', '143', '2006-02-16T02:30:53', '2005-06-19T22:06:06', '2005-06-25T22:30:06', '1'), - ('560', '1310', '2006-02-16T02:30:53', '2005-08-17T10:59:18', '2005-08-22T11:12:18', '1'), - ('459', '1164', '2006-02-16T02:30:53', '2005-08-21T07:56:39', '2005-08-27T04:52:39', '1'), - ('182', '3851', '2006-02-16T02:30:53', '2005-08-02T06:36:05', '2005-08-06T00:36:05', '1'), - ('570', '2396', '2006-02-16T02:30:53', '2005-07-31T17:51:23', '2005-08-03T19:12:23', '1'), - ('262', '2567', '2006-02-16T02:30:53', '2005-08-01T20:45:39', '2005-08-04T19:21:39', '1'), - ('26', '3389', '2006-02-16T02:30:53', '2005-07-30T23:31:40', '2005-08-02T18:25:40', '1'), - ('586', '2560', '2006-02-16T02:30:53', '2005-07-31T10:25:21', '2005-08-03T04:28:21', '1'), - ('587', '383', '2006-02-16T02:30:53', '2005-07-06T22:47:59', '2005-07-08T02:11:59', '1'), - ('561', '2229', '2006-02-16T02:30:53', '2005-07-12T08:57:30', '2005-07-14T09:47:30', '1'), - ('532', '2551', '2006-02-16T02:30:53', '2005-06-19T20:26:52', '2005-06-27T23:48:52', '1'), - ('504', '394', '2006-02-16T02:30:53', '2005-08-22T08:52:38', '2005-08-25T08:08:38', '1'), - ('483', '2624', '2006-02-16T02:30:53', '2005-07-28T02:44:07', '2005-07-29T00:54:07', '1'), - ('19', '4021', '2006-02-16T02:30:53', '2005-07-30T14:29:29', '2005-08-05T16:59:29', '1'), - ('452', '190', '2006-02-16T02:30:53', '2005-07-06T07:08:17', '2005-07-13T12:30:17', '1'), - ('158', '780', '2006-02-16T02:30:53', '2005-07-07T06:58:14', '2005-07-16T05:28:14', '1'), - ('112', '3879', '2006-02-16T02:30:53', '2005-07-31T14:48:01', '2005-08-06T11:55:01', '1'), - ('479', '3342', '2006-02-16T02:30:53', '2005-07-07T10:28:33', '2005-07-15T12:29:33', '1'), - ('277', '3089', '2006-02-16T02:30:53', '2005-06-15T11:34:33', '2005-06-21T09:46:33', '1'), - ('377', '125', '2006-02-16T02:30:53', '2005-06-19T03:07:32', '2005-06-23T23:09:32', '1'), - ('576', '2796', '2006-02-16T02:30:53', '2005-07-06T18:22:10', '2005-07-07T23:38:10', '1'), - ('282', '4353', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('103', '1408', '2006-02-16T02:30:53', '2005-07-12T04:17:15', '2005-07-18T23:11:15', '1'), - ('14', '27', '2006-02-16T02:30:53', '2005-08-01T11:55:33', '2005-08-08T16:42:33', '1'), - ('460', '3437', '2006-02-16T02:30:53', '2005-08-19T02:38:50', '2005-08-21T02:33:50', '1'), - ('423', '1353', '2006-02-16T02:30:53', '2005-07-27T07:20:28', '2005-08-02T07:19:28', '1'), - ('463', '3743', '2006-02-16T02:30:53', '2005-08-20T17:24:45', '2005-08-21T18:39:45', '1'), - ('180', '4337', '2006-02-16T02:30:53', '2005-08-20T14:29:37', '2005-08-29T18:19:37', '1'), - ('512', '3250', '2006-02-16T02:30:53', '2005-07-08T14:15:20', '2005-07-12T13:22:20', '1'), - ('108', '3468', '2006-02-16T02:30:53', '2005-07-29T04:06:33', '2005-08-06T01:46:33', '1'), - ('80', '2621', '2006-02-16T02:30:53', '2005-08-02T08:08:24', '2005-08-06T05:55:24', '1'), - ('5', '3998', '2006-02-16T02:30:53', '2005-05-31T19:46:38', '2005-06-05T14:03:38', '1'), - ('409', '3936', '2006-02-16T02:30:53', '2005-07-11T02:21:43', '2005-07-13T03:49:43', '1'), - ('230', '2991', '2006-02-16T02:30:53', '2005-08-02T09:47:08', '2005-08-08T10:57:08', '1'), - ('16', '4551', '2006-02-16T02:30:53', '2005-08-17T22:53:00', '2005-08-23T19:49:00', '1'), - ('491', '2850', '2006-02-16T02:30:53', '2005-06-18T15:33:30', '2005-06-25T14:30:30', '1'), - ('142', '1264', '2006-02-16T02:30:53', '2005-08-20T10:53:49', '2005-08-25T13:25:49', '1'), - ('527', '2091', '2006-02-16T02:30:53', '2005-07-27T20:28:34', '2005-08-05T18:14:34', '1'), - ('18', '1214', '2006-02-16T02:30:53', '2005-07-12T19:20:45', '2005-07-17T00:06:45', '1'), - ('317', '2928', '2006-02-16T02:30:53', '2005-07-29T04:00:52', '2005-07-31T08:27:52', '1'), - ('275', '2179', '2006-02-16T02:30:53', '2005-07-29T19:03:15', '2005-07-30T17:06:15', '1'), - ('540', '721', '2006-02-16T02:30:53', '2005-06-19T09:26:13', '2005-06-20T14:38:13', '1'), - ('214', '2275', '2006-02-16T02:30:53', '2005-06-17T17:30:56', '2005-06-23T12:13:56', '1'), - ('35', '3725', '2006-02-16T02:30:53', '2005-06-20T17:53:30', '2005-06-26T16:03:30', '1'), - ('41', '3177', '2006-02-16T02:30:53', '2005-07-27T20:57:07', '2005-08-04T15:08:07', '1'), - ('269', '595', '2006-02-16T02:30:53', '2005-08-20T11:24:48', '2005-08-29T10:29:48', '1'), - ('304', '2668', '2006-02-16T02:30:53', '2005-08-20T21:10:32', '2005-08-23T20:57:32', '1'), - ('120', '2793', '2006-02-16T02:30:53', '2005-05-28T05:36:58', '2005-06-02T01:50:58', '1'), - ('120', '4036', '2006-02-16T02:30:53', '2005-07-27T01:00:34', '2005-07-30T23:53:34', '1'), - ('177', '3260', '2006-02-16T02:30:53', '2005-06-16T16:07:27', '2005-06-20T15:22:27', '1'), - ('22', '3250', '2006-02-16T02:30:53', '2005-08-21T16:24:43', '2005-08-26T16:58:43', '1'), - ('243', '751', '2006-02-16T02:30:53', '2005-08-21T17:07:08', '2005-08-26T16:02:08', '1'), - ('330', '1135', '2006-02-16T02:30:53', '2005-06-15T22:45:06', '2005-06-22T22:48:06', '1'), - ('75', '1412', '2006-02-16T02:30:53', '2005-08-18T19:10:41', '2005-08-23T16:59:41', '1'), - ('14', '1986', '2006-02-16T02:30:53', '2005-08-18T19:16:47', '2005-08-19T16:31:47', '1'), - ('577', '2732', '2006-02-16T02:30:53', '2005-08-18T19:10:54', '2005-08-25T19:19:54', '1'), - ('294', '3200', '2006-02-16T02:30:53', '2005-07-07T01:27:44', '2005-07-10T21:30:44', '1'), - ('593', '1293', '2006-02-16T02:30:53', '2005-07-30T17:42:38', '2005-08-08T23:17:38', '1'), - ('185', '1862', '2006-02-16T02:30:53', '2005-07-27T03:53:52', '2005-08-05T03:32:52', '1'), - ('113', '3220', '2006-02-16T02:30:53', '2005-06-20T21:21:15', '2005-06-29T18:42:15', '1'), - ('277', '4317', '2006-02-16T02:30:53', '2005-06-19T14:55:23', '2005-06-20T14:28:23', '1'), - ('142', '623', '2006-02-16T02:30:53', '2005-07-30T09:55:57', '2005-08-01T14:21:57', '1'), - ('383', '1738', '2006-02-16T02:30:53', '2005-07-27T15:05:45', '2005-08-02T13:46:45', '1'), - ('146', '522', '2006-02-16T02:30:53', '2005-05-31T09:55:04', '2005-06-07T03:55:04', '1'), - ('146', '4065', '2006-02-16T02:30:53', '2005-07-27T01:02:46', '2005-07-31T00:22:46', '1'), - ('279', '4140', '2006-02-16T02:30:53', '2005-06-21T01:11:32', '2005-06-26T19:42:32', '1'), - ('235', '1410', '2006-02-16T02:30:53', '2005-08-20T00:59:36', '2005-08-24T22:41:36', '1'), - ('103', '3711', '2006-02-16T02:30:53', '2005-07-27T13:00:55', '2005-07-28T17:54:55', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['6177', '11329', '12987', '546', '8035', '4754', '14909', '11019', '11737', '1447', '13392', '12410', '2259', '14363', '7123', '4795', '4412', '7616', '9781', '9739', '11221', '11433', '15274', '7572', '2408', '2834', '2574', '11095', '11276', '2216', '14171', '4359', '15039', '1716', '13860', '12890', '4587', '6898', '8324', '15872', '14301', '9395', '12763', '1996', '1120', '9032', '10342', '2867', '14934', '14820', '2570', '5700', '7512', '16038', '710', '15743', '11500', '7941', '204', '15177', '9719', '1713', '12108', '7575', '13388', '265', '13929', '6639', '12301', '6932', '15131', '14049', '2162', '10967', '688', '5951', '2027', '8224', '3462', '1940', '10366', '8118', '5491', '7062', '3850', '12071', '902', '13840', '14660', '253', '8580', '7573', '2384', '395', '9236', '7267', '12473', '1839', '2071', '4995']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('589', '313', '2006-02-16T02:30:53', '2005-07-11T10:53:49', '2005-07-17T14:54:49', '1'), - ('399', '2677', '2006-02-16T02:30:53', '2005-08-02T16:42:52', '2005-08-08T16:45:52', '1'), - ('134', '3665', '2006-02-16T02:30:53', '2005-08-19T07:11:44', '2005-08-20T04:17:44', '1'), - ('20', '487', '2006-02-16T02:30:53', '2005-05-28T07:16:25', '2005-06-01T08:36:25', '1'), - ('14', '1503', '2006-02-16T02:30:53', '2005-07-28T16:23:01', '2005-08-05T10:52:01', '1'), - ('108', '3177', '2006-02-16T02:30:53', '2005-07-08T14:20:01', '2005-07-11T11:50:01', '1'), - ('155', '1997', '2006-02-16T02:30:53', '2005-08-22T04:48:44', '2005-08-25T04:59:44', '1'), - ('112', '3227', '2006-02-16T02:30:53', '2005-08-02T05:29:31', '2005-08-04T00:42:31', '1'), - ('549', '4128', '2006-02-16T02:30:53', '2005-08-17T08:42:08', '2005-08-19T08:14:08', '1'), - ('471', '984', '2006-02-16T02:30:53', '2005-06-15T19:13:51', '2005-06-21T22:56:51', '1'), - ('409', '692', '2006-02-16T02:30:53', '2005-08-19T22:03:22', '2005-08-28T19:27:22', '1'), - ('210', '1904', '2006-02-16T02:30:53', '2005-08-18T09:45:33', '2005-08-27T08:50:33', '1'), - ('491', '4103', '2006-02-16T02:30:53', '2005-06-18T05:37:45', '2005-06-21T01:51:45', '1'), - ('560', '2579', '2006-02-16T02:30:53', '2005-08-21T09:20:03', '2005-08-23T14:26:03', '1'), - ('232', '134', '2006-02-16T02:30:53', '2005-07-27T06:08:48', '2005-08-04T05:26:48', '1'), - ('497', '3409', '2006-02-16T02:30:53', '2005-07-08T16:32:54', '2005-07-09T14:15:54', '1'), - ('282', '1181', '2006-02-16T02:30:53', '2005-07-07T21:56:53', '2005-07-11T19:28:53', '1'), - ('9', '3790', '2006-02-16T02:30:53', '2005-07-28T00:15:26', '2005-07-30T21:52:26', '1'), - ('155', '2310', '2006-02-16T02:30:53', '2005-07-31T10:13:02', '2005-08-09T14:46:02', '1'), - ('343', '1328', '2006-02-16T02:30:53', '2005-07-31T09:08:03', '2005-08-04T13:57:03', '1'), - ('146', '1689', '2006-02-16T02:30:53', '2005-08-02T12:32:12', '2005-08-03T17:13:12', '1'), - ('518', '1', '2006-02-16T02:30:53', '2005-08-02T20:13:10', '2005-08-11T21:35:10', '1'), - ('515', '3519', '2006-02-16T02:30:53', '2005-08-22T18:55:52', '2005-08-23T20:02:52', '1'), - ('532', '3068', '2006-02-16T02:30:53', '2005-07-27T22:44:29', '2005-08-01T03:04:29', '1'), - ('87', '258', '2006-02-16T02:30:53', '2005-06-18T16:50:44', '2005-06-19T20:11:44', '1'), - ('122', '2876', '2006-02-16T02:30:53', '2005-06-19T21:41:46', '2005-06-24T20:47:46', '1'), - ('143', '3320', '2006-02-16T02:30:53', '2005-06-19T04:23:52', '2005-06-20T05:24:52', '1'), - ('278', '3517', '2006-02-16T02:30:53', '2005-08-02T08:03:20', '2005-08-10T05:20:20', '1'), - ('190', '4226', '2006-02-16T02:30:53', '2005-08-02T14:28:46', '2005-08-04T14:00:46', '1'), - ('320', '1428', '2006-02-16T02:30:53', '2005-06-18T03:08:17', '2005-06-19T08:13:17', '1'), - ('320', '4179', '2006-02-16T02:30:53', '2005-08-21T03:00:42', '2005-08-24T00:54:42', '1'), - ('282', '3222', '2006-02-16T02:30:53', '2005-07-07T19:30:20', '2005-07-09T13:34:20', '1'), - ('180', '895', '2006-02-16T02:30:53', '2005-08-22T09:37:54', '2005-08-28T12:23:54', '1'), - ('24', '20', '2006-02-16T02:30:53', '2005-06-16T14:39:31', '2005-06-19T15:37:31', '1'), - ('275', '558', '2006-02-16T02:30:53', '2005-08-20T14:55:09', '2005-08-22T20:42:09', '1'), - ('150', '3831', '2006-02-16T02:30:53', '2005-08-19T03:42:08', '2005-08-19T23:08:08', '1'), - ('63', '3502', '2006-02-16T02:30:53', '2005-07-08T06:16:26', '2005-07-13T00:59:26', '1'), - ('557', '1725', '2006-02-16T02:30:53', '2005-07-12T21:39:04', '2005-07-15T20:30:04', '1'), - ('98', '1467', '2006-02-16T02:30:53', '2005-07-29T03:56:05', '2005-08-02T01:41:05', '1'), - ('212', '3391', '2006-02-16T02:30:53', '2005-08-23T16:27:24', '2005-08-31T11:57:24', '1'), - ('162', '283', '2006-02-16T02:30:53', '2005-08-21T07:19:48', '2005-08-28T02:06:48', '1'), - ('306', '1298', '2006-02-16T02:30:53', '2005-07-30T20:07:06', '2005-08-08T21:21:06', '1'), - ('472', '393', '2006-02-16T02:30:53', '2005-08-18T23:07:01', '2005-08-21T18:45:01', '1'), - ('149', '3074', '2006-02-16T02:30:53', '2005-06-17T11:17:45', '2005-06-26T09:42:45', '1'), - ('361', '2897', '2006-02-16T02:30:53', '2005-05-31T16:37:14', '2005-06-04T12:53:14', '1'), - ('369', '4448', '2006-02-16T02:30:53', '2005-07-30T06:06:54', '2005-08-01T05:27:54', '1'), - ('140', '332', '2006-02-16T02:30:53', '2005-08-01T05:11:11', '2005-08-10T00:27:11', '1'), - ('483', '95', '2006-02-16T02:30:53', '2005-06-20T00:08:38', '2005-06-23T19:35:38', '1'), - ('226', '815', '2006-02-16T02:30:53', '2005-08-22T05:47:15', '2005-08-26T11:32:15', '1'), - ('52', '1409', '2006-02-16T02:30:53', '2005-08-22T01:18:37', '2005-08-23T19:44:37', '1'), - ('5', '1105', '2006-02-16T02:30:53', '2005-06-19T04:20:13', '2005-06-25T07:00:13', '1'), - ('87', '3961', '2006-02-16T02:30:53', '2005-07-10T09:49:42', '2005-07-19T04:20:42', '1'), - ('352', '1343', '2006-02-16T02:30:53', '2005-07-27T20:40:40', '2005-08-05T01:44:40', '1'), - ('172', '2612', '2006-02-16T02:30:53', '2005-08-23T22:14:31', '2005-08-30T03:28:31', '1'), - ('518', '194', '2006-02-16T02:30:53', '2005-05-29T03:48:36', '2005-06-03T05:03:36', '1'), - ('139', '1625', '2006-02-16T02:30:53', '2005-08-23T12:12:05', '2005-08-26T11:35:05', '1'), - ('584', '4003', '2006-02-16T02:30:53', '2005-08-16T23:01:22', '2005-08-24T22:54:22', '1'), - ('566', '439', '2006-02-16T02:30:53', '2005-07-28T12:47:20', '2005-08-01T08:46:20', '1'), - ('528', '1842', '2006-02-16T02:30:53', '2005-05-26T07:30:37', '2005-05-30T08:11:37', '1'), - ('493', '838', '2006-02-16T02:30:53', '2005-08-22T15:34:49', '2005-08-26T12:54:49', '1'), - ('584', '335', '2006-02-16T02:30:53', '2005-07-31T08:25:13', '2005-08-05T08:22:13', '1'), - ('164', '2580', '2006-02-16T02:30:53', '2005-06-16T14:28:33', '2005-06-18T09:02:33', '1'), - ('207', '1675', '2006-02-16T02:30:53', '2005-08-17T22:56:39', '2005-08-26T19:37:39', '1'), - ('582', '702', '2006-02-16T02:30:53', '2005-07-27T22:53:52', '2005-07-29T02:02:52', '1'), - ('317', '942', '2006-02-16T02:30:53', '2005-08-19T21:46:49', '2005-08-27T16:18:49', '1'), - ('303', '2276', '2006-02-16T02:30:53', '2005-05-26T16:07:38', '2005-06-01T14:20:38', '1'), - ('57', '946', '2006-02-16T02:30:53', '2005-08-20T17:13:48', '2005-08-28T15:19:48', '1'), - ('587', '3385', '2006-02-16T02:30:53', '2005-07-12T10:00:44', '2005-07-19T04:56:44', '1'), - ('317', '2293', '2006-02-16T02:30:53', '2005-08-18T05:36:20', '2005-08-23T03:15:20', '1'), - ('463', '4517', '2006-02-16T02:30:53', '2005-07-26T23:08:04', '2005-08-05T01:35:04', '1'), - ('119', '1930', '2006-02-16T02:30:53', '2005-08-22T13:06:26', '2005-08-30T16:43:26', '1'), - ('112', '1335', '2006-02-16T02:30:53', '2005-08-20T22:08:55', '2005-08-28T20:24:55', '1'), - ('277', '1790', '2006-02-16T02:30:53', '2005-06-17T23:45:47', '2005-06-21T21:03:47', '1'), - ('149', '683', '2006-02-16T02:30:53', '2005-08-02T04:02:16', '2005-08-09T07:57:16', '1'), - ('162', '4135', '2006-02-16T02:30:53', '2005-05-29T00:45:24', '2005-06-02T01:30:24', '1'), - ('589', '2501', '2006-02-16T02:30:53', '2005-07-10T23:14:29', '2005-07-13T01:01:29', '1'), - ('265', '4309', '2006-02-16T02:30:53', '2005-06-17T13:06:56', '2005-06-23T13:46:56', '1'), - ('467', '1995', '2006-02-16T02:30:53', '2005-07-28T23:59:02', '2005-08-02T04:54:02', '1'), - ('568', '547', '2006-02-16T02:30:53', '2005-06-21T21:52:52', '2005-06-28T21:41:52', '1'), - ('451', '105', '2006-02-16T02:30:53', '2005-06-17T07:42:22', '2005-06-22T11:59:22', '1'), - ('119', '2654', '2006-02-16T02:30:53', '2005-08-01T06:09:37', '2005-08-05T03:19:37', '1'), - ('566', '331', '2006-02-16T02:30:53', '2005-07-28T19:22:22', '2005-08-01T22:13:22', '1'), - ('49', '2007', '2006-02-16T02:30:53', '2005-07-10T00:09:45', '2005-07-11T02:25:45', '1'), - ('469', '226', '2006-02-16T02:30:53', '2005-07-27T03:52:01', '2005-08-03T08:26:01', '1'), - ('103', '1700', '2006-02-16T02:30:53', '2005-07-06T16:51:21', '2005-07-12T13:58:21', '1'), - ('507', '1874', '2006-02-16T02:30:53', '2005-08-17T21:49:14', '2005-08-22T18:20:14', '1'), - ('561', '1514', '2006-02-16T02:30:53', '2005-05-30T09:53:36', '2005-06-07T12:10:36', '1'), - ('40', '1211', '2006-02-16T02:30:53', '2005-08-20T14:23:20', '2005-08-28T11:53:20', '1'), - ('452', '3433', '2006-02-16T02:30:53', '2005-08-21T19:43:21', '2005-08-22T20:42:21', '1'), - ('416', '2969', '2006-02-16T02:30:53', '2005-05-26T14:43:14', '2005-05-27T12:21:14', '1'), - ('543', '4040', '2006-02-16T02:30:53', '2005-07-29T12:00:27', '2005-08-04T16:39:27', '1'), - ('467', '314', '2006-02-16T02:30:53', '2005-07-27T22:46:20', '2005-08-04T01:55:20', '1'), - ('132', '3378', '2006-02-16T02:30:53', '2005-06-18T15:18:49', '2005-06-21T18:10:49', '1'), - ('575', '752', '2006-02-16T02:30:53', '2005-05-27T11:45:49', '2005-05-31T13:42:49', '1'), - ('2', '4030', '2006-02-16T02:30:53', '2005-07-30T13:47:43', '2005-08-08T18:52:43', '1'), - ('122', '3661', '2006-02-16T02:30:53', '2005-07-27T11:22:55', '2005-08-01T08:13:55', '1'), - ('303', '1237', '2006-02-16T02:30:53', '2005-08-18T11:59:44', '2005-08-21T13:38:44', '1'), - ('223', '2750', '2006-02-16T02:30:53', '2005-06-16T23:22:22', '2005-06-23T00:33:22', '1'), - ('479', '2867', '2006-02-16T02:30:53', '2005-06-17T16:33:17', '2005-06-23T21:51:17', '1'), - ('247', '2063', '2006-02-16T02:30:53', '2005-07-09T00:57:46', '2005-07-13T03:32:46', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['4357', '10202', '7779', '15907', '3807', '9998', '12553', '15283', '4779', '15658', '735', '6268', '3289', '15662', '1397', '2952', '14193', '6377', '9384', '9926', '11173', '8989', '323', '8995', '5628', '1737', '3961', '1712', '6740', '15995', '6842', '13189', '3449', '180', '1139', '14176', '5121', '11596', '11812', '6103', '7186', '11868', '12985', '4711', '14394', '8654', '12124', '13960', '3584', '10929', '15599', '8399', '4050', '15218', '5990', '1563', '6980', '13441', '3327', '13178', '11100', '14864', '12086', '789', '7019', '14596', '5155', '10243', '3790', '5950', '15929', '769', '14266', '6258', '15529', '8011', '1666', '13650', '7087', '13908', '6466', '14914', '8832', '6112', '5502', '15470', '10053', '1031', '11402', '516', '15562', '9815', '10155', '6540', '11761', '11949', '10145', '11430', '6951', '1163']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('103', '3413', '2006-02-16T02:30:53', '2005-07-07T19:24:39', '2005-07-12T00:11:39', '1'), - ('306', '1099', '2006-02-16T02:30:53', '2005-08-01T00:43:18', '2005-08-08T23:26:18', '1'), - ('414', '3663', '2006-02-16T02:30:53', '2005-07-28T07:11:11', '2005-07-30T11:12:11', '1'), - ('2', '2898', '2006-02-16T02:30:53', '2005-08-23T17:39:35', '2005-08-25T23:23:35', '1'), - ('425', '39', '2006-02-16T02:30:53', '2005-07-06T15:11:44', '2005-07-10T09:20:44', '1'), - ('30', '2549', '2006-02-16T02:30:53', '2005-07-31T17:40:35', '2005-08-04T18:15:35', '1'), - ('454', '2893', '2006-02-16T02:30:53', '2005-08-18T14:46:54', '2005-08-22T13:41:54', '1'), - ('219', '1688', '2006-02-16T02:30:53', '2005-08-22T19:16:04', '2005-08-31T21:05:04', '1'), - ('338', '1321', '2006-02-16T02:30:53', '2005-07-08T15:53:41', '2005-07-15T20:30:41', '1'), - ('22', '3565', '2006-02-16T02:30:53', '2005-08-23T08:48:43', '2005-08-25T05:38:43', '1'), - ('454', '3421', '2006-02-16T02:30:53', '2005-05-29T08:08:13', '2005-06-07T13:35:13', '1'), - ('125', '1154', '2006-02-16T02:30:53', '2005-07-11T15:55:34', '2005-07-19T17:25:34', '1'), - ('115', '2248', '2006-02-16T02:30:53', '2005-06-21T06:41:48', '2005-06-30T00:54:48', '1'), - ('223', '3028', '2006-02-16T02:30:53', '2005-08-23T08:52:50', '2005-08-24T08:08:50', '1'), - ('444', '1830', '2006-02-16T02:30:53', '2005-06-15T16:25:26', '2005-06-21T20:45:26', '1'), - ('13', '3759', '2006-02-16T02:30:53', '2005-06-20T06:26:57', '2005-06-22T11:51:57', '1'), - ('25', '513', '2006-02-16T02:30:53', '2005-08-21T03:38:27', '2005-08-28T09:16:27', '1'), - ('118', '4017', '2006-02-16T02:30:53', '2005-07-11T21:41:16', '2005-07-15T20:05:16', '1'), - ('220', '2313', '2006-02-16T02:30:53', '2005-07-30T19:25:35', '2005-08-08T21:50:35', '1'), - ('472', '3733', '2006-02-16T02:30:53', '2005-07-31T15:11:51', '2005-08-09T18:26:51', '1'), - ('146', '4296', '2006-02-16T02:30:53', '2005-08-02T10:28:00', '2005-08-10T14:53:00', '1'), - ('575', '954', '2006-02-16T02:30:53', '2005-07-30T04:39:19', '2005-08-06T02:11:19', '1'), - ('144', '2362', '2006-02-16T02:30:53', '2005-05-27T00:49:27', '2005-05-30T03:12:27', '1'), - ('331', '3575', '2006-02-16T02:30:53', '2005-07-30T04:53:11', '2005-08-07T00:24:11', '1'), - ('87', '4040', '2006-02-16T02:30:53', '2005-07-10T05:56:40', '2005-07-17T11:13:40', '1'), - ('467', '4029', '2006-02-16T02:30:53', '2005-06-16T15:59:44', '2005-06-23T12:22:44', '1'), - ('364', '4320', '2006-02-16T02:30:53', '2005-07-06T22:11:43', '2005-07-09T03:14:43', '1'), - ('535', '1363', '2006-02-16T02:30:53', '2005-06-16T14:25:09', '2005-06-17T17:55:09', '1'), - ('139', '2431', '2006-02-16T02:30:53', '2005-07-12T14:22:08', '2005-07-14T14:35:08', '1'), - ('377', '1122', '2006-02-16T02:30:53', '2005-08-23T20:29:56', '2005-08-30T18:09:56', '1'), - ('366', '3376', '2006-02-16T02:30:53', '2005-07-12T19:07:55', '2005-07-19T22:47:55', '1'), - ('368', '3444', '2006-02-16T02:30:53', '2005-08-19T14:27:16', '2005-08-28T10:34:16', '1'), - ('181', '210', '2006-02-16T02:30:53', '2005-06-21T21:01:27', '2005-06-27T21:20:27', '1'), - ('75', '2752', '2006-02-16T02:30:53', '2005-05-26T04:46:23', '2005-06-01T09:58:23', '1'), - ('562', '666', '2006-02-16T02:30:53', '2005-05-31T19:34:52', '2005-06-06T17:40:52', '1'), - ('556', '4420', '2006-02-16T02:30:53', '2005-08-21T03:09:23', '2005-08-26T21:26:23', '1'), - ('526', '3321', '2006-02-16T02:30:53', '2005-07-09T07:18:31', '2005-07-15T01:48:31', '1'), - ('290', '1674', '2006-02-16T02:30:53', '2005-08-17T02:53:55', '2005-08-26T02:19:55', '1'), - ('132', '119', '2006-02-16T02:30:53', '2005-08-17T12:00:54', '2005-08-18T16:08:54', '1'), - ('540', '262', '2006-02-16T02:30:53', '2005-07-11T06:59:55', '2005-07-16T09:30:55', '1'), - ('584', '4005', '2006-02-16T02:30:53', '2005-07-27T08:26:12', '2005-07-28T12:21:12', '1'), - ('445', '2909', '2006-02-16T02:30:53', '2005-08-17T14:05:34', '2005-08-19T15:47:34', '1'), - ('83', '4133', '2006-02-16T02:30:53', '2005-08-19T07:08:05', '2005-08-24T02:25:05', '1'), - ('563', '2327', '2006-02-16T02:30:53', '2005-07-08T12:06:58', '2005-07-12T08:37:58', '1'), - ('118', '4555', '2006-02-16T02:30:53', '2005-08-21T10:23:10', '2005-08-28T09:33:10', '1'), - ('84', '3925', '2006-02-16T02:30:53', '2005-07-29T15:04:27', '2005-08-07T18:37:27', '1'), - ('22', '2036', '2006-02-16T02:30:53', '2005-08-17T23:22:46', '2005-08-21T01:40:46', '1'), - ('459', '4177', '2006-02-16T02:30:53', '2005-08-20T18:16:26', '2005-08-29T14:06:26', '1'), - ('207', '367', '2006-02-16T02:30:53', '2005-07-06T04:16:43', '2005-07-13T07:08:43', '1'), - ('305', '913', '2006-02-16T02:30:53', '2005-08-02T02:35:44', '2005-08-05T03:52:44', '1'), - ('103', '4560', '2006-02-16T02:30:53', '2005-08-23T06:25:07', '2005-08-29T00:48:07', '1'), - ('286', '233', '2006-02-16T02:30:53', '2005-07-29T06:20:18', '2005-08-04T01:26:18', '1'), - ('528', '104', '2006-02-16T02:30:53', '2005-07-07T03:35:33', '2005-07-15T03:11:33', '1'), - ('139', '10', '2006-02-16T02:30:53', '2005-08-22T16:59:05', '2005-08-30T17:01:05', '1'), - ('432', '1561', '2006-02-16T02:30:53', '2005-07-11T01:03:14', '2005-07-15T19:32:14', '1'), - ('262', '1516', '2006-02-16T02:30:53', '2005-06-16T02:46:28', '2005-06-18T02:37:28', '1'), - ('164', '1127', '2006-02-16T02:30:53', '2005-07-27T00:50:30', '2005-08-03T23:35:30', '1'), - ('125', '3188', '2006-02-16T02:30:53', '2005-08-19T23:48:23', '2005-08-28T23:47:23', '1'), - ('62', '3083', '2006-02-16T02:30:53', '2005-06-21T09:04:50', '2005-06-30T05:45:50', '1'), - ('394', '693', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('65', '3047', '2006-02-16T02:30:53', '2005-08-02T08:08:00', '2005-08-10T07:19:00', '1'), - ('460', '2872', '2006-02-16T02:30:53', '2005-08-22T02:57:06', '2005-08-22T22:19:06', '1'), - ('140', '3963', '2006-02-16T02:30:53', '2005-08-17T22:20:01', '2005-08-26T02:14:01', '1'), - ('553', '708', '2006-02-16T02:30:53', '2005-05-29T16:17:07', '2005-06-06T18:15:07', '1'), - ('491', '3837', '2006-02-16T02:30:53', '2005-07-27T02:20:26', '2005-08-02T22:48:26', '1'), - ('472', '2010', '2006-02-16T02:30:53', '2005-08-21T17:38:37', '2005-08-30T20:28:37', '1'), - ('523', '988', '2006-02-16T02:30:53', '2005-07-09T08:46:54', '2005-07-14T04:13:54', '1'), - ('132', '2236', '2006-02-16T02:30:53', '2005-08-01T02:18:46', '2005-08-06T21:45:46', '1'), - ('10', '1711', '2006-02-16T02:30:53', '2005-07-06T14:13:45', '2005-07-14T13:35:45', '1'), - ('585', '4319', '2006-02-16T02:30:53', '2005-07-10T23:13:45', '2005-07-13T02:35:45', '1'), - ('477', '1832', '2006-02-16T02:30:53', '2005-08-23T18:23:30', '2005-08-27T17:04:30', '1'), - ('575', '1523', '2006-02-16T02:30:53', '2005-05-29T12:51:44', '2005-06-01T17:43:44', '1'), - ('269', '3543', '2006-02-16T02:30:53', '2005-08-21T06:20:51', '2005-08-23T00:44:51', '1'), - ('417', '632', '2006-02-16T02:30:53', '2005-07-11T15:24:32', '2005-07-18T18:29:32', '1'), - ('19', '4015', '2006-02-16T02:30:53', '2005-08-23T03:46:47', '2005-08-24T00:59:47', '1'), - ('497', '4274', '2006-02-16T02:30:53', '2005-07-28T15:26:39', '2005-07-30T13:59:39', '1'), - ('557', '4019', '2006-02-16T02:30:53', '2005-06-16T10:17:19', '2005-06-21T05:50:19', '1'), - ('322', '2644', '2006-02-16T02:30:53', '2005-08-20T07:49:06', '2005-08-28T10:11:06', '1'), - ('22', '1159', '2006-02-16T02:30:53', '2005-07-27T04:42:08', '2005-08-02T00:53:08', '1'), - ('532', '3661', '2006-02-16T02:30:53', '2005-08-20T16:21:40', '2005-08-29T21:16:40', '1'), - ('235', '3369', '2006-02-16T02:30:53', '2005-07-12T01:21:03', '2005-07-14T04:05:03', '1'), - ('156', '4348', '2006-02-16T02:30:53', '2005-08-22T04:53:35', '2005-08-26T10:35:35', '1'), - ('125', '380', '2006-02-16T02:30:53', '2005-07-29T22:37:49', '2005-08-04T23:32:49', '1'), - ('366', '1311', '2006-02-16T02:30:53', '2005-07-11T07:28:05', '2005-07-18T07:29:05', '1'), - ('243', '3712', '2006-02-16T02:30:53', '2005-07-10T00:34:15', '2005-07-11T21:44:15', '1'), - ('416', '3009', '2006-02-16T02:30:53', '2005-08-23T01:35:12', '2005-09-01T05:33:12', '1'), - ('223', '4102', '2006-02-16T02:30:53', '2005-07-31T19:15:39', '2005-08-07T22:32:39', '1'), - ('416', '917', '2006-02-16T02:30:53', '2005-05-31T04:23:01', '2005-06-06T08:35:01', '1'), - ('561', '3291', '2006-02-16T02:30:53', '2005-08-02T19:07:21', '2005-08-07T20:59:21', '1'), - ('400', '4357', '2006-02-16T02:30:53', '2005-05-28T03:11:47', '2005-06-04T02:19:47', '1'), - ('149', '4238', '2006-02-16T02:30:53', '2005-08-23T05:04:33', '2005-08-27T09:58:33', '1'), - ('540', '2728', '2006-02-16T02:30:53', '2005-07-31T11:30:51', '2005-08-08T12:52:51', '1'), - ('235', '3176', '2006-02-16T02:30:53', '2005-07-31T22:31:43', '2005-08-07T02:43:43', '1'), - ('156', '937', '2006-02-16T02:30:53', '2005-07-12T04:51:13', '2005-07-21T03:38:13', '1'), - ('13', '2230', '2006-02-16T02:30:53', '2005-08-17T09:44:59', '2005-08-25T07:46:59', '1'), - ('198', '854', '2006-02-16T02:30:53', '2005-08-17T17:12:26', '2005-08-23T20:48:26', '1'), - ('361', '2511', '2006-02-16T02:30:53', '2005-07-31T22:15:13', '2005-08-06T23:26:13', '1'), - ('140', '2258', '2006-02-16T02:30:53', '2005-08-02T20:04:36', '2005-08-08T19:43:36', '1'), - ('98', '3348', '2006-02-16T02:30:53', '2005-07-26T23:47:31', '2005-07-31T22:17:31', '1'), - ('592', '4209', '2006-02-16T02:30:53', '2005-06-14T23:12:46', '2005-06-23T21:53:46', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['6819', '2451', '11711', '13565', '8553', '4901', '9044', '10284', '6592', '5916', '7022', '5016', '15769', '5322', '12679', '12546', '15765', '7617', '4952', '778', '15380', '179', '5963', '10972', '2177', '12744', '4067', '11483', '3942', '568', '5221', '9620', '8632', '10478', '7221', '2659', '7726', '5712', '12174', '6741', '4851', '8437', '6378', '14117', '11167', '13518', '2026', '4470', '14876', '9201', '3678', '15679', '11614', '10741', '14509', '5512', '5872', '5013', '10003', '1423', '10753', '2615', '8257', '6986', '10927', '2468', '9055', '10092', '2263', '4692', '6845', '1366', '2321', '6829', '396', '8976', '6283', '15348', '13859', '15349', '7299', '1373', '866', '718', '7872', '12275', '2185', '15681', '11728', '8606', '8459', '2050', '6244', '14372', '2783', '12645', '6318', '14270', '9110', '3687']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('198', '1253', '2006-02-16T02:30:53', '2005-07-12T18:21:01', '2005-07-13T21:14:01', '1'), - ('24', '835', '2006-02-16T02:30:53', '2005-06-18T19:28:02', '2005-06-23T16:41:02', '1'), - ('470', '1503', '2006-02-16T02:30:53', '2005-08-17T07:30:55', '2005-08-18T09:21:55', '1'), - ('214', '3378', '2006-02-16T02:30:53', '2005-08-20T04:38:52', '2005-08-27T07:17:52', '1'), - ('49', '2645', '2006-02-16T02:30:53', '2005-07-29T11:15:36', '2005-08-07T16:37:36', '1'), - ('507', '2187', '2006-02-16T02:30:53', '2005-07-08T20:44:51', '2005-07-10T01:04:51', '1'), - ('319', '3796', '2006-02-16T02:30:53', '2005-07-30T06:35:21', '2005-07-31T10:27:21', '1'), - ('20', '2879', '2006-02-16T02:30:53', '2005-08-01T03:33:19', '2005-08-09T07:58:19', '1'), - ('273', '3481', '2006-02-16T02:30:53', '2005-07-12T07:19:35', '2005-07-19T07:15:35', '1'), - ('35', '2267', '2006-02-16T02:30:53', '2005-07-10T21:26:31', '2005-07-19T20:23:31', '1'), - ('243', '1711', '2006-02-16T02:30:53', '2005-07-27T02:31:15', '2005-07-29T02:52:15', '1'), - ('5', '1871', '2006-02-16T02:30:53', '2005-07-09T01:57:57', '2005-07-09T22:07:57', '1'), - ('276', '2392', '2006-02-16T02:30:53', '2005-08-23T13:16:15', '2005-08-28T18:31:15', '1'), - ('432', '4420', '2006-02-16T02:30:53', '2005-07-09T16:28:13', '2005-07-18T14:53:13', '1'), - ('463', '1535', '2006-02-16T02:30:53', '2005-08-18T19:42:11', '2005-08-25T01:01:11', '1'), - ('30', '610', '2006-02-16T02:30:53', '2005-08-18T14:29:37', '2005-08-26T09:47:37', '1'), - ('408', '1250', '2006-02-16T02:30:53', '2005-08-23T13:06:19', '2005-08-31T12:18:19', '1'), - ('340', '2904', '2006-02-16T02:30:53', '2005-07-28T00:18:40', '2005-08-01T01:17:40', '1'), - ('14', '459', '2006-02-16T02:30:53', '2005-07-08T23:00:07', '2005-07-09T21:47:07', '1'), - ('535', '1816', '2006-02-16T02:30:53', '2005-05-29T14:09:53', '2005-06-05T20:05:53', '1'), - ('423', '3642', '2006-02-16T02:30:53', '2005-08-22T22:28:15', '2005-08-28T23:21:15', '1'), - ('19', '2575', '2006-02-16T02:30:53', '2005-05-26T04:26:06', '2005-06-03T10:06:06', '1'), - ('35', '4434', '2006-02-16T02:30:53', '2005-07-10T23:47:08', '2005-07-12T04:27:08', '1'), - ('348', '1928', '2006-02-16T02:30:53', '2005-08-02T04:08:25', '2005-08-09T23:25:25', '1'), - ('340', '492', '2006-02-16T02:30:53', '2005-06-18T00:34:45', '2005-06-26T18:40:45', '1'), - ('593', '3815', '2006-02-16T02:30:53', '2005-08-18T22:22:36', '2005-08-24T00:26:36', '1'), - ('469', '2945', '2006-02-16T02:30:53', '2005-07-07T04:34:23', '2005-07-16T04:04:23', '1'), - ('45', '1586', '2006-02-16T02:30:53', '2005-08-02T22:28:22', '2005-08-11T18:06:22', '1'), - ('553', '677', '2006-02-16T02:30:53', '2005-07-06T21:21:34', '2005-07-15T02:34:34', '1'), - ('155', '2232', '2006-02-16T02:30:53', '2005-05-28T09:57:36', '2005-05-31T15:44:36', '1'), - ('84', '2339', '2006-02-16T02:30:53', '2005-07-09T12:02:23', '2005-07-16T15:43:23', '1'), - ('576', '2177', '2006-02-16T02:30:53', '2005-07-31T04:19:18', '2005-08-08T09:20:18', '1'), - ('563', '1666', '2006-02-16T02:30:53', '2005-07-29T14:11:25', '2005-08-07T15:32:25', '1'), - ('417', '3885', '2006-02-16T02:30:53', '2005-08-01T10:09:06', '2005-08-06T05:05:06', '1'), - ('579', '3820', '2006-02-16T02:30:53', '2005-07-27T09:37:35', '2005-07-28T11:25:35', '1'), - ('139', '66', '2006-02-16T02:30:53', '2005-06-19T10:47:42', '2005-06-23T14:03:42', '1'), - ('219', '2578', '2006-02-16T02:30:53', '2005-07-28T04:52:19', '2005-08-04T09:05:19', '1'), - ('304', '3480', '2006-02-16T02:30:53', '2005-07-10T10:40:32', '2005-07-12T11:45:32', '1'), - ('101', '1458', '2006-02-16T02:30:53', '2005-08-18T01:08:53', '2005-08-20T03:28:53', '1'), - ('359', '237', '2006-02-16T02:30:53', '2005-07-12T14:24:16', '2005-07-15T08:31:16', '1'), - ('557', '134', '2006-02-16T02:30:53', '2005-07-08T18:40:05', '2005-07-12T21:46:05', '1'), - ('96', '2118', '2006-02-16T02:30:53', '2005-07-29T07:23:43', '2005-08-04T10:52:43', '1'), - ('145', '3170', '2006-02-16T02:30:53', '2005-07-11T21:45:23', '2005-07-14T16:56:23', '1'), - ('493', '573', '2006-02-16T02:30:53', '2005-08-21T01:11:59', '2005-08-22T06:56:59', '1'), - ('451', '148', '2006-02-16T02:30:53', '2005-08-02T10:15:51', '2005-08-09T09:18:51', '1'), - ('528', '352', '2006-02-16T02:30:53', '2005-08-20T02:36:17', '2005-08-24T08:06:17', '1'), - ('491', '3681', '2006-02-16T02:30:53', '2005-06-17T13:05:38', '2005-06-21T17:19:38', '1'), - ('145', '3605', '2006-02-16T02:30:53', '2005-07-08T00:20:57', '2005-07-10T02:31:57', '1'), - ('210', '3669', '2006-02-16T02:30:53', '2005-08-22T03:39:29', '2005-08-23T06:53:29', '1'), - ('291', '4387', '2006-02-16T02:30:53', '2005-07-30T12:42:21', '2005-08-08T06:50:21', '1'), - ('364', '3861', '2006-02-16T02:30:53', '2005-07-06T09:15:15', '2005-07-10T05:01:15', '1'), - ('103', '2945', '2006-02-16T02:30:53', '2005-08-23T09:27:29', '2005-08-28T09:14:29', '1'), - ('2', '805', '2006-02-16T02:30:53', '2005-08-17T03:52:18', '2005-08-20T07:04:18', '1'), - ('469', '3300', '2006-02-16T02:30:53', '2005-08-01T19:52:52', '2005-08-04T19:58:52', '1'), - ('520', '541', '2006-02-16T02:30:53', '2005-08-21T14:39:58', '2005-08-26T13:19:58', '1'), - ('405', '4470', '2006-02-16T02:30:53', '2005-07-10T01:05:38', '2005-07-17T20:47:38', '1'), - ('364', '270', '2006-02-16T02:30:53', '2005-07-10T18:54:05', '2005-07-19T15:41:05', '1'), - ('35', '3000', '2006-02-16T02:30:53', '2005-07-09T01:46:45', '2005-07-16T06:57:45', '1'), - ('13', '1603', '2006-02-16T02:30:53', '2005-07-31T17:48:51', '2005-08-02T14:23:51', '1'), - ('592', '1396', '2006-02-16T02:30:53', '2005-06-15T18:08:12', '2005-06-24T19:13:12', '1'), - ('273', '1557', '2006-02-16T02:30:53', '2005-08-01T20:09:24', '2005-08-09T19:31:24', '1'), - ('578', '3810', '2006-02-16T02:30:53', '2005-06-19T07:29:13', '2005-06-27T12:50:13', '1'), - ('566', '3024', '2006-02-16T02:30:53', '2005-07-29T01:03:20', '2005-08-04T21:54:20', '1'), - ('262', '2104', '2006-02-16T02:30:53', '2005-07-27T00:59:05', '2005-07-29T00:31:05', '1'), - ('288', '4125', '2006-02-16T02:30:53', '2005-08-02T02:31:15', '2005-08-10T20:41:15', '1'), - ('382', '1833', '2006-02-16T02:30:53', '2005-06-18T20:23:52', '2005-06-23T14:34:52', '1'), - ('512', '634', '2006-02-16T02:30:53', '2005-07-30T07:13:07', '2005-08-01T12:18:07', '1'), - ('364', '4151', '2006-02-16T02:30:53', '2005-07-31T20:28:09', '2005-08-01T21:37:09', '1'), - ('452', '3259', '2006-02-16T02:30:53', '2005-06-18T05:57:47', '2005-06-20T06:13:47', '1'), - ('288', '1490', '2006-02-16T02:30:53', '2005-07-08T11:07:06', '2005-07-09T14:08:06', '1'), - ('414', '3833', '2006-02-16T02:30:53', '2005-07-12T19:20:41', '2005-07-14T15:27:41', '1'), - ('576', '4238', '2006-02-16T02:30:53', '2005-06-15T14:21:00', '2005-06-24T17:36:00', '1'), - ('565', '1160', '2006-02-16T02:30:53', '2005-06-18T09:42:42', '2005-06-25T14:28:42', '1'), - ('361', '4184', '2006-02-16T02:30:53', '2005-07-12T18:38:59', '2005-07-16T23:25:59', '1'), - ('112', '1020', '2006-02-16T02:30:53', '2005-05-27T11:47:04', '2005-05-29T10:14:04', '1'), - ('507', '2135', '2006-02-16T02:30:53', '2005-07-30T04:12:32', '2005-08-04T23:08:32', '1'), - ('402', '3319', '2006-02-16T02:30:53', '2005-07-11T16:47:32', '2005-07-17T21:46:32', '1'), - ('587', '3846', '2006-02-16T02:30:53', '2005-08-22T21:13:46', '2005-08-24T17:06:46', '1'), - ('504', '4381', '2006-02-16T02:30:53', '2005-08-20T14:53:43', '2005-08-28T09:50:43', '1'), - ('587', '4055', '2006-02-16T02:30:53', '2005-08-22T21:13:51', '2005-08-23T20:55:51', '1'), - ('286', '3002', '2006-02-16T02:30:53', '2005-07-27T12:49:56', '2005-08-03T12:25:56', '1'), - ('51', '284', '2006-02-16T02:30:53', '2005-06-15T14:48:04', '2005-06-22T09:48:04', '1'), - ('8', '2867', '2006-02-16T02:30:53', '2005-05-30T03:43:54', '2005-06-08T04:28:54', '1'), - ('498', '1736', '2006-02-16T02:30:53', '2005-05-29T04:52:23', '2005-06-02T02:27:23', '1'), - ('66', '826', '2006-02-16T02:30:53', '2005-07-28T10:18:16', '2005-07-31T10:57:16', '1'), - ('507', '1474', '2006-02-16T02:30:53', '2005-08-18T04:42:02', '2005-08-25T00:50:02', '1'), - ('198', '4326', '2006-02-16T02:30:53', '2005-06-18T01:12:22', '2005-06-20T20:41:22', '1'), - ('61', '2813', '2006-02-16T02:30:53', '2005-08-23T09:35:34', '2005-08-27T08:33:34', '1'), - ('444', '726', '2006-02-16T02:30:53', '2005-08-17T08:12:26', '2005-08-18T03:26:26', '1'), - ('340', '4051', '2006-02-16T02:30:53', '2005-07-29T13:14:24', '2005-07-30T14:52:24', '1'), - ('144', '3441', '2006-02-16T02:30:53', '2005-07-29T08:05:40', '2005-08-04T03:24:40', '1'), - ('549', '1963', '2006-02-16T02:30:53', '2005-06-17T15:07:30', '2005-06-18T14:43:30', '1'), - ('383', '1558', '2006-02-16T02:30:53', '2005-07-11T14:53:38', '2005-07-12T16:42:38', '1'), - ('520', '1953', '2006-02-16T02:30:53', '2005-08-21T09:39:50', '2005-08-28T13:36:50', '1'), - ('113', '2778', '2006-02-16T02:30:53', '2005-06-19T18:29:10', '2005-06-21T22:09:10', '1'), - ('457', '1658', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('425', '2048', '2006-02-16T02:30:53', '2005-07-11T18:48:22', '2005-07-12T13:39:22', '1'), - ('171', '4083', '2006-02-16T02:30:53', '2005-08-21T06:22:18', '2005-08-27T08:04:18', '1'), - ('317', '1474', '2006-02-16T02:30:53', '2005-07-30T09:05:42', '2005-08-03T05:15:42', '1'), - ('207', '2040', '2006-02-16T02:30:53', '2005-07-06T09:38:33', '2005-07-14T07:50:33', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['4804', '13225', '11461', '14586', '10661', '5996', '11809', '2447', '1989', '11725', '7744', '10384', '3470', '9477', '9315', '1522', '1894', '424', '8806', '4663', '6097', '4573', '2693', '13044', '7571', '1196', '10341', '4009', '6411', '10146', '7607', '14126', '12058', '3355', '4436', '2855', '5441', '9108', '3048', '5390', '14297', '9700', '4106', '14352', '12313', '11993', '14568', '6752', '8109', '10517', '1545', '1437', '7803', '11047', '3663', '5887', '15134', '467', '11023', '2771', '12600', '8231', '4129', '10828', '14661', '3681', '1398', '11836', '11418', '2743', '11490', '13213', '9770', '8710', '6588', '7107', '1238', '10535', '6823', '10378', '1414', '7409', '15749', '1052', '15860', '8996', '13118', '3606', '6118', '13538', '14761', '4165', '3575', '13094', '9248', '5755', '454', '6836', '13881', '3405']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('269', '3756', '2006-02-16T02:30:53', '2005-07-08T16:57:30', '2005-07-10T18:25:30', '1'), - ('562', '1420', '2006-02-16T02:30:53', '2005-08-19T15:54:33', '2005-08-25T16:40:33', '1'), - ('65', '4343', '2006-02-16T02:30:53', '2005-08-02T21:35:00', '2005-08-05T01:34:00', '1'), - ('182', '3094', '2006-02-16T02:30:53', '2005-08-21T17:19:09', '2005-08-26T17:00:09', '1'), - ('177', '3311', '2006-02-16T02:30:53', '2005-08-01T16:48:31', '2005-08-02T21:02:31', '1'), - ('223', '4263', '2006-02-16T02:30:53', '2005-07-11T01:18:33', '2005-07-17T04:18:33', '1'), - ('305', '1136', '2006-02-16T02:30:53', '2005-08-17T11:51:39', '2005-08-24T17:14:39', '1'), - ('523', '2353', '2006-02-16T02:30:53', '2005-06-18T19:10:55', '2005-06-27T16:35:55', '1'), - ('35', '634', '2006-02-16T02:30:53', '2005-06-17T10:47:24', '2005-06-19T05:12:24', '1'), - ('45', '519', '2006-02-16T02:30:53', '2005-08-17T08:09:00', '2005-08-18T09:50:00', '1'), - ('288', '1863', '2006-02-16T02:30:53', '2005-07-28T05:38:20', '2005-07-31T11:00:20', '1'), - ('366', '2622', '2006-02-16T02:30:53', '2005-08-01T06:39:14', '2005-08-02T03:06:14', '1'), - ('565', '883', '2006-02-16T02:30:53', '2005-07-05T22:49:24', '2005-07-07T19:36:24', '1'), - ('213', '1932', '2006-02-16T02:30:53', '2005-07-30T23:07:22', '2005-08-04T20:54:22', '1'), - ('96', '444', '2006-02-16T02:30:53', '2005-07-30T17:05:29', '2005-08-01T12:47:29', '1'), - ('133', '235', '2006-02-16T02:30:53', '2005-06-16T00:17:39', '2005-06-22T05:38:39', '1'), - ('204', '3707', '2006-02-16T02:30:53', '2005-06-17T04:18:48', '2005-06-26T00:07:48', '1'), - ('35', '2815', '2006-02-16T02:30:53', '2005-05-27T15:34:01', '2005-06-05T09:44:01', '1'), - ('454', '4085', '2006-02-16T02:30:53', '2005-07-29T21:36:34', '2005-08-02T00:58:34', '1'), - ('139', '2959', '2006-02-16T02:30:53', '2005-07-08T09:59:18', '2005-07-10T11:25:18', '1'), - ('416', '297', '2006-02-16T02:30:53', '2005-07-11T06:21:43', '2005-07-16T10:04:43', '1'), - ('400', '2478', '2006-02-16T02:30:53', '2005-07-08T05:38:46', '2005-07-15T07:07:46', '1'), - ('107', '2570', '2006-02-16T02:30:53', '2005-06-19T13:11:47', '2005-06-27T11:17:47', '1'), - ('142', '809', '2006-02-16T02:30:53', '2005-08-19T09:14:31', '2005-08-20T11:16:31', '1'), - ('368', '3850', '2006-02-16T02:30:53', '2005-07-27T22:43:42', '2005-07-30T22:17:42', '1'), - ('52', '994', '2006-02-16T02:30:53', '2005-06-15T01:38:31', '2005-06-18T06:55:31', '1'), - ('445', '3304', '2006-02-16T02:30:53', '2005-08-01T05:10:02', '2005-08-07T11:01:02', '1'), - ('394', '3607', '2006-02-16T02:30:53', '2005-07-07T00:28:55', '2005-07-10T00:37:55', '1'), - ('124', '4347', '2006-02-16T02:30:53', '2005-07-11T23:10:50', '2005-07-19T17:15:50', '1'), - ('559', '1721', '2006-02-16T02:30:53', '2005-07-31T22:17:56', '2005-08-02T21:27:56', '1'), - ('293', '3914', '2006-02-16T02:30:53', '2005-07-28T00:05:53', '2005-07-31T04:13:53', '1'), - ('215', '2738', '2006-02-16T02:30:53', '2005-08-21T01:32:17', '2005-08-23T01:02:17', '1'), - ('540', '2438', '2006-02-16T02:30:53', '2005-08-17T21:07:41', '2005-08-26T16:07:41', '1'), - ('275', '1960', '2006-02-16T02:30:53', '2005-06-21T11:30:47', '2005-06-23T06:04:47', '1'), - ('563', '4326', '2006-02-16T02:30:53', '2005-07-07T22:52:04', '2005-07-10T04:51:04', '1'), - ('483', '3495', '2006-02-16T02:30:53', '2005-06-19T23:11:49', '2005-06-26T21:52:49', '1'), - ('7', '3913', '2006-02-16T02:30:53', '2005-07-09T21:52:05', '2005-07-17T02:54:05', '1'), - ('490', '3977', '2006-02-16T02:30:53', '2005-07-30T08:56:36', '2005-08-04T11:07:36', '1'), - ('482', '4389', '2006-02-16T02:30:53', '2005-06-20T12:49:55', '2005-06-26T11:06:55', '1'), - ('139', '715', '2006-02-16T02:30:53', '2005-07-09T19:26:22', '2005-07-14T22:46:22', '1'), - ('566', '1712', '2006-02-16T02:30:53', '2005-08-21T07:13:46', '2005-08-25T09:07:46', '1'), - ('40', '2678', '2006-02-16T02:30:53', '2005-07-31T07:29:59', '2005-08-02T09:53:59', '1'), - ('563', '4083', '2006-02-16T02:30:53', '2005-07-07T06:33:35', '2005-07-13T04:03:35', '1'), - ('527', '1224', '2006-02-16T02:30:53', '2005-08-21T09:06:29', '2005-08-28T13:36:29', '1'), - ('180', '2053', '2006-02-16T02:30:53', '2005-08-18T06:07:31', '2005-08-27T00:20:31', '1'), - ('303', '295', '2006-02-16T02:30:53', '2005-08-17T18:27:49', '2005-08-21T00:04:49', '1'), - ('582', '3331', '2006-02-16T02:30:53', '2005-08-21T16:30:48', '2005-08-22T13:49:48', '1'), - ('453', '3392', '2006-02-16T02:30:53', '2005-07-12T14:53:15', '2005-07-20T09:23:15', '1'), - ('407', '652', '2006-02-16T02:30:53', '2005-07-28T19:07:44', '2005-07-31T14:59:44', '1'), - ('199', '2299', '2006-02-16T02:30:53', '2005-08-01T11:41:57', '2005-08-05T06:14:57', '1'), - ('563', '762', '2006-02-16T02:30:53', '2005-06-16T01:31:23', '2005-06-24T05:50:23', '1'), - ('96', '3263', '2006-02-16T02:30:53', '2005-06-15T18:37:04', '2005-06-20T12:56:04', '1'), - ('449', '3438', '2006-02-16T02:30:53', '2005-07-28T07:52:13', '2005-08-03T13:35:13', '1'), - ('416', '2267', '2006-02-16T02:30:53', '2005-08-02T06:09:20', '2005-08-11T08:36:20', '1'), - ('566', '2646', '2006-02-16T02:30:53', '2005-07-06T08:15:47', '2005-07-07T08:57:47', '1'), - ('532', '2602', '2006-02-16T02:30:53', '2005-07-10T19:45:47', '2005-07-15T22:15:47', '1'), - ('22', '4442', '2006-02-16T02:30:53', '2005-08-22T13:18:25', '2005-08-29T18:03:25', '1'), - ('557', '339', '2006-02-16T02:30:53', '2005-05-27T21:10:03', '2005-06-01T16:08:03', '1'), - ('6', '3617', '2006-02-16T02:30:53', '2005-08-02T05:36:38', '2005-08-10T05:39:38', '1'), - ('262', '40', '2006-02-16T02:30:53', '2005-06-19T17:54:48', '2005-06-27T17:14:48', '1'), - ('171', '1475', '2006-02-16T02:30:53', '2005-08-18T16:44:24', '2005-08-25T17:28:24', '1'), - ('331', '1083', '2006-02-16T02:30:53', '2005-07-29T00:14:37', '2005-07-31T19:12:37', '1'), - ('592', '1413', '2006-02-16T02:30:53', '2005-07-07T07:37:03', '2005-07-14T13:31:03', '1'), - ('471', '2448', '2006-02-16T02:30:53', '2005-08-01T23:16:10', '2005-08-09T21:17:10', '1'), - ('469', '745', '2006-02-16T02:30:53', '2005-08-21T19:44:21', '2005-08-27T14:35:21', '1'), - ('294', '3325', '2006-02-16T02:30:53', '2005-07-06T09:19:30', '2005-07-11T09:40:30', '1'), - ('527', '4402', '2006-02-16T02:30:53', '2005-06-15T16:28:42', '2005-06-16T12:11:42', '1'), - ('198', '2253', '2006-02-16T02:30:53', '2005-08-17T13:03:36', '2005-08-19T17:15:36', '1'), - ('91', '4490', '2006-02-16T02:30:53', '2005-08-02T19:45:33', '2005-08-06T17:40:33', '1'), - ('35', '2611', '2006-02-16T02:30:53', '2005-06-19T16:15:56', '2005-06-23T12:30:56', '1'), - ('156', '1178', '2006-02-16T02:30:53', '2005-08-02T22:36:00', '2005-08-09T16:36:00', '1'), - ('13', '1546', '2006-02-16T02:30:53', '2005-08-19T15:25:48', '2005-08-22T09:32:48', '1'), - ('317', '1226', '2006-02-16T02:30:53', '2005-07-31T09:52:40', '2005-08-09T06:44:40', '1'), - ('566', '3391', '2006-02-16T02:30:53', '2005-07-29T17:26:03', '2005-07-30T19:51:03', '1'), - ('420', '1257', '2006-02-16T02:30:53', '2005-07-12T06:57:40', '2005-07-16T04:27:40', '1'), - ('104', '1883', '2006-02-16T02:30:53', '2005-07-27T05:22:04', '2005-08-02T06:38:04', '1'), - ('205', '3534', '2006-02-16T02:30:53', '2005-06-15T04:49:08', '2005-06-20T00:06:08', '1'), - ('284', '1838', '2006-02-16T02:30:53', '2005-08-01T12:21:13', '2005-08-09T08:58:13', '1'), - ('557', '795', '2006-02-16T02:30:53', '2005-07-12T18:24:31', '2005-07-17T23:13:31', '1'), - ('113', '4110', '2006-02-16T02:30:53', '2005-08-01T06:30:04', '2005-08-06T09:10:04', '1'), - ('304', '4005', '2006-02-16T02:30:53', '2005-06-15T17:26:32', '2005-06-22T22:30:32', '1'), - ('585', '2352', '2006-02-16T02:30:53', '2005-07-27T16:38:24', '2005-07-30T18:06:24', '1'), - ('575', '4224', '2006-02-16T02:30:53', '2005-08-23T12:33:41', '2005-08-24T10:52:41', '1'), - ('156', '2157', '2006-02-16T02:30:53', '2005-05-31T07:07:03', '2005-06-05T09:38:03', '1'), - ('41', '2583', '2006-02-16T02:30:53', '2005-08-23T16:08:40', '2005-08-28T15:35:40', '1'), - ('579', '1970', '2006-02-16T02:30:53', '2005-07-30T04:53:23', '2005-07-31T06:01:23', '1'), - ('181', '470', '2006-02-16T02:30:53', '2005-08-19T11:39:58', '2005-08-25T14:44:58', '1'), - ('166', '1737', '2006-02-16T02:30:53', '2005-07-06T05:28:02', '2005-07-10T04:51:02', '1'), - ('13', '3013', '2006-02-16T02:30:53', '2005-07-11T07:43:08', '2005-07-20T03:17:08', '1'), - ('279', '581', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('490', '2657', '2006-02-16T02:30:53', '2005-08-21T23:30:28', '2005-08-26T03:26:28', '1'), - ('66', '3845', '2006-02-16T02:30:53', '2005-07-07T09:23:27', '2005-07-15T06:00:27', '1'), - ('49', '3234', '2006-02-16T02:30:53', '2005-07-06T03:36:19', '2005-07-08T06:21:19', '1'), - ('494', '3178', '2006-02-16T02:30:53', '2005-08-19T10:47:58', '2005-08-21T06:20:58', '1'), - ('2', '1382', '2006-02-16T02:30:53', '2005-07-30T14:14:11', '2005-08-05T11:19:11', '1'), - ('2', '2760', '2006-02-16T02:30:53', '2005-07-10T12:38:56', '2005-07-19T17:02:56', '1'), - ('575', '3499', '2006-02-16T02:30:53', '2005-05-27T19:31:36', '2005-05-30T15:46:36', '1'), - ('113', '2744', '2006-02-16T02:30:53', '2005-07-12T18:58:05', '2005-07-15T17:45:05', '1'), - ('144', '2831', '2006-02-16T02:30:53', '2005-08-20T15:18:55', '2005-08-25T11:25:55', '1'), - ('155', '2344', '2006-02-16T02:30:53', '2005-06-21T15:58:25', '2005-06-23T10:58:25', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['10121', '6849', '12136', '7170', '10064', '14910', '12502', '2172', '8174', '6002', '2569', '15047', '6062', '10334', '15881', '12398', '1676', '5256', '1268', '6869', '5154', '15911', '1910', '2137', '8433', '6638', '12743', '11947', '9799', '5795', '7068', '3399', '13227', '14595', '7258', '8401', '2968', '2828', '4839', '9830', '9909', '10300', '3138', '15345', '5503', '14733', '2089', '2422', '13644', '10430', '8974', '14114', '11885', '6079', '7988', '1112', '4661', '1920', '8397', '1690', '14766', '223', '11207', '8747', '310', '4931', '1352', '9749', '15851', '14159', '5363', '15986', '9021', '8150', '14306', '14603', '7290', '2865', '4538', '11377', '3247', '9167', '4802', '14125', '14995', '3862', '3652', '3906', '6407', '1786', '4650', '9578', '8373', '5957', '6286', '2666', '13611', '7433', '13466', '116']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('425', '2969', '2006-02-16T02:30:53', '2005-07-31T21:24:53', '2005-08-03T22:24:53', '1'), - ('479', '4307', '2006-02-16T02:30:53', '2005-07-12T19:29:19', '2005-07-19T22:03:19', '1'), - ('527', '3944', '2006-02-16T02:30:53', '2005-08-17T23:51:30', '2005-08-23T01:35:30', '1'), - ('140', '370', '2006-02-16T02:30:53', '2005-07-27T07:58:26', '2005-07-28T02:30:26', '1'), - ('41', '3140', '2006-02-16T02:30:53', '2005-07-31T19:27:02', '2005-08-06T21:15:02', '1'), - ('540', '1266', '2006-02-16T02:30:53', '2005-08-22T04:50:52', '2005-08-25T04:14:52', '1'), - ('235', '2153', '2006-02-16T02:30:53', '2005-08-18T13:16:31', '2005-08-19T17:47:31', '1'), - ('457', '2912', '2006-02-16T02:30:53', '2005-06-18T00:06:16', '2005-06-26T00:50:16', '1'), - ('359', '465', '2006-02-16T02:30:53', '2005-07-28T21:36:52', '2005-08-04T00:32:52', '1'), - ('45', '4422', '2006-02-16T02:30:53', '2005-07-11T01:27:49', '2005-07-12T06:02:49', '1'), - ('213', '30', '2006-02-16T02:30:53', '2005-06-19T04:19:04', '2005-06-26T04:31:04', '1'), - ('19', '1309', '2006-02-16T02:30:53', '2005-08-22T09:57:16', '2005-08-23T11:39:16', '1'), - ('408', '3301', '2006-02-16T02:30:53', '2005-07-11T04:11:58', '2005-07-15T05:00:58', '1'), - ('445', '3387', '2006-02-16T02:30:53', '2005-08-01T04:58:42', '2005-08-09T02:00:42', '1'), - ('383', '617', '2006-02-16T02:30:53', '2005-08-23T16:44:25', '2005-08-29T13:58:25', '1'), - ('321', '4247', '2006-02-16T02:30:53', '2005-08-18T09:13:24', '2005-08-27T14:58:24', '1'), - ('171', '931', '2006-02-16T02:30:53', '2005-06-16T11:06:09', '2005-06-21T05:17:09', '1'), - ('273', '4226', '2006-02-16T02:30:53', '2005-07-09T13:55:45', '2005-07-15T17:02:45', '1'), - ('142', '3641', '2006-02-16T02:30:53', '2005-06-15T07:29:30', '2005-06-23T12:36:30', '1'), - ('278', '3546', '2006-02-16T02:30:53', '2005-07-12T20:12:06', '2005-07-13T18:37:06', '1'), - ('361', '3785', '2006-02-16T02:30:53', '2005-07-09T08:46:18', '2005-07-14T03:19:18', '1'), - ('582', '3006', '2006-02-16T02:30:53', '2005-08-23T17:44:53', '2005-09-01T19:14:53', '1'), - ('199', '3903', '2006-02-16T02:30:53', '2005-06-17T05:11:27', '2005-06-23T23:16:27', '1'), - ('581', '1158', '2006-02-16T02:30:53', '2005-06-17T21:18:28', '2005-06-20T21:05:28', '1'), - ('125', '1957', '2006-02-16T02:30:53', '2005-07-29T07:19:16', '2005-08-05T03:29:16', '1'), - ('87', '207', '2006-02-16T02:30:53', '2005-07-12T09:58:02', '2005-07-13T09:40:02', '1'), - ('565', '2630', '2006-02-16T02:30:53', '2005-08-18T22:22:31', '2005-08-27T00:31:31', '1'), - ('220', '2928', '2006-02-16T02:30:53', '2005-08-17T17:08:13', '2005-08-23T21:53:13', '1'), - ('494', '3008', '2006-02-16T02:30:53', '2005-07-31T10:58:32', '2005-08-01T12:08:32', '1'), - ('304', '3958', '2006-02-16T02:30:53', '2005-07-10T14:36:29', '2005-07-14T13:26:29', '1'), - ('568', '4465', '2006-02-16T02:30:53', '2005-07-27T03:57:50', '2005-07-30T04:27:50', '1'), - ('98', '619', '2006-02-16T02:30:53', '2005-06-21T15:47:48', '2005-06-26T13:46:48', '1'), - ('288', '2759', '2006-02-16T02:30:53', '2005-08-19T16:05:38', '2005-08-20T21:39:38', '1'), - ('118', '1879', '2006-02-16T02:30:53', '2005-08-21T17:35:17', '2005-08-27T12:11:17', '1'), - ('494', '2079', '2006-02-16T02:30:53', '2005-07-27T11:05:54', '2005-08-02T11:36:54', '1'), - ('232', '3121', '2006-02-16T02:30:53', '2005-07-29T06:25:08', '2005-08-01T06:49:08', '1'), - ('252', '4415', '2006-02-16T02:30:53', '2005-06-20T07:41:47', '2005-06-23T04:27:47', '1'), - ('526', '3230', '2006-02-16T02:30:53', '2005-06-19T20:51:33', '2005-06-25T17:38:33', '1'), - ('556', '1810', '2006-02-16T02:30:53', '2005-07-08T18:13:10', '2005-07-15T12:49:10', '1'), - ('112', '170', '2006-02-16T02:30:53', '2005-07-31T11:59:05', '2005-08-06T10:38:05', '1'), - ('587', '2600', '2006-02-16T02:30:53', '2005-07-31T14:43:34', '2005-08-09T15:31:34', '1'), - ('207', '4334', '2006-02-16T02:30:53', '2005-08-01T04:08:11', '2005-08-04T00:24:11', '1'), - ('570', '2265', '2006-02-16T02:30:53', '2005-06-20T19:43:45', '2005-06-26T20:41:45', '1'), - ('277', '3481', '2006-02-16T02:30:53', '2005-08-22T21:05:50', '2005-08-26T20:30:50', '1'), - ('262', '3892', '2006-02-16T02:30:53', '2005-07-10T00:35:37', '2005-07-12T20:29:37', '1'), - ('408', '398', '2006-02-16T02:30:53', '2005-08-21T22:22:33', '2005-08-26T21:01:33', '1'), - ('156', '4030', '2006-02-16T02:30:53', '2005-06-17T17:45:09', '2005-06-25T16:41:09', '1'), - ('527', '3170', '2006-02-16T02:30:53', '2005-06-18T17:28:57', '2005-06-23T15:22:57', '1'), - ('464', '970', '2006-02-16T02:30:53', '2005-08-20T07:46:30', '2005-08-27T01:54:30', '1'), - ('471', '1150', '2006-02-16T02:30:53', '2005-08-01T08:37:06', '2005-08-03T07:25:06', '1'), - ('425', '3376', '2006-02-16T02:30:53', '2005-07-30T04:09:16', '2005-08-04T06:55:16', '1'), - ('8', '2270', '2006-02-16T02:30:53', '2005-08-21T01:07:11', '2005-08-24T20:33:11', '1'), - ('481', '3931', '2006-02-16T02:30:53', '2005-08-17T14:53:53', '2005-08-22T10:59:53', '1'), - ('119', '1494', '2006-02-16T02:30:53', '2005-07-11T05:07:14', '2005-07-17T08:45:14', '1'), - ('517', '2906', '2006-02-16T02:30:53', '2005-07-28T14:37:18', '2005-08-05T10:53:18', '1'), - ('214', '2453', '2006-02-16T02:30:53', '2005-05-31T15:51:39', '2005-06-03T14:04:39', '1'), - ('518', '2641', '2006-02-16T02:30:53', '2005-07-08T09:55:06', '2005-07-11T08:26:06', '1'), - ('75', '2199', '2006-02-16T02:30:53', '2005-06-17T06:00:23', '2005-06-24T04:49:23', '1'), - ('518', '3542', '2006-02-16T02:30:53', '2005-07-29T06:09:35', '2005-08-01T02:08:35', '1'), - ('286', '1099', '2006-02-16T02:30:53', '2005-06-16T12:24:18', '2005-06-25T15:00:18', '1'), - ('523', '768', '2006-02-16T02:30:53', '2005-08-21T23:42:20', '2005-08-26T03:46:20', '1'), - ('460', '3121', '2006-02-16T02:30:53', '2005-05-26T10:15:23', '2005-05-30T11:43:23', '1'), - ('481', '4470', '2006-02-16T02:30:53', '2005-08-02T12:01:30', '2005-08-05T07:56:30', '1'), - ('70', '2584', '2006-02-16T02:30:53', '2005-07-29T19:07:57', '2005-07-30T16:01:57', '1'), - ('409', '593', '2006-02-16T02:30:53', '2005-05-26T22:41:07', '2005-06-02T04:09:07', '1'), - ('284', '2750', '2006-02-16T02:30:53', '2005-07-08T22:16:18', '2005-07-17T03:42:18', '1'), - ('276', '4352', '2006-02-16T02:30:53', '2005-06-15T12:58:27', '2005-06-18T10:57:27', '1'), - ('52', '658', '2006-02-16T02:30:53', '2005-07-31T09:18:33', '2005-08-06T07:41:33', '1'), - ('469', '2286', '2006-02-16T02:30:53', '2005-08-23T15:46:33', '2005-08-29T15:52:33', '1'), - ('144', '3231', '2006-02-16T02:30:53', '2005-08-21T02:45:58', '2005-08-27T04:53:58', '1'), - ('425', '2180', '2006-02-16T02:30:53', '2005-07-09T18:18:49', '2005-07-14T22:16:49', '1'), - ('226', '3472', '2006-02-16T02:30:53', '2005-08-23T20:20:37', '2005-08-29T20:49:37', '1'), - ('498', '674', '2006-02-16T02:30:53', '2005-07-30T05:34:24', '2005-08-03T04:13:24', '1'), - ('497', '3489', '2006-02-16T02:30:53', '2005-07-28T20:50:41', '2005-08-02T00:43:41', '1'), - ('453', '4027', '2006-02-16T02:30:53', '2005-08-21T07:32:35', '2005-08-30T05:53:35', '1'), - ('26', '94', '2006-02-16T02:30:53', '2005-08-21T17:51:06', '2005-08-28T15:36:06', '1'), - ('423', '3652', '2006-02-16T02:30:53', '2005-07-27T12:28:45', '2005-08-01T16:18:45', '1'), - ('10', '1569', '2006-02-16T02:30:53', '2005-06-20T00:00:55', '2005-06-21T02:20:55', '1'), - ('451', '3638', '2006-02-16T02:30:53', '2005-07-08T03:56:29', '2005-07-15T08:24:29', '1'), - ('119', '3334', '2006-02-16T02:30:53', '2005-08-02T18:16:47', '2005-08-08T13:46:47', '1'), - ('277', '1406', '2006-02-16T02:30:53', '2005-06-21T03:12:15', '2005-06-27T00:44:15', '1'), - ('162', '1785', '2006-02-16T02:30:53', '2005-07-30T11:30:37', '2005-08-08T17:13:37', '1'), - ('562', '22', '2006-02-16T02:30:53', '2005-07-08T16:55:17', '2005-07-15T19:34:17', '1'), - ('265', '2174', '2006-02-16T02:30:53', '2005-08-21T01:32:16', '2005-08-26T00:09:16', '1'), - ('482', '4178', '2006-02-16T02:30:53', '2005-08-22T07:52:31', '2005-08-24T05:16:31', '1'), - ('181', '471', '2006-02-16T02:30:53', '2005-07-06T17:35:22', '2005-07-15T17:13:22', '1'), - ('518', '1231', '2006-02-16T02:30:53', '2005-07-06T07:44:30', '2005-07-08T04:41:30', '1'), - ('293', '1383', '2006-02-16T02:30:53', '2005-07-06T19:35:55', '2005-07-15T22:35:55', '1'), - ('140', '775', '2006-02-16T02:30:53', '2005-07-11T23:02:19', '2005-07-21T00:30:19', '1'), - ('323', '263', '2006-02-16T02:30:53', '2005-06-16T19:30:54', '2005-06-19T14:24:54', '1'), - ('108', '2850', '2006-02-16T02:30:53', '2005-07-08T09:32:08', '2005-07-15T15:20:08', '1'), - ('115', '2965', '2006-02-16T02:30:53', '2005-07-31T02:54:31', '2005-08-02T02:48:31', '1'), - ('457', '2070', '2006-02-16T02:30:53', '2005-07-29T05:19:53', '2005-08-04T04:39:53', '1'), - ('210', '2517', '2006-02-16T02:30:53', '2005-07-10T23:24:02', '2005-07-12T20:28:02', '1'), - ('140', '1070', '2006-02-16T02:30:53', '2005-07-11T16:55:35', '2005-07-13T22:51:35', '1'), - ('454', '1872', '2006-02-16T02:30:53', '2005-06-19T11:17:12', '2005-06-28T12:47:12', '1'), - ('112', '1460', '2006-02-16T02:30:53', '2005-08-20T06:20:42', '2005-08-28T10:07:42', '1'), - ('282', '1748', '2006-02-16T02:30:53', '2005-07-27T17:32:20', '2005-08-01T18:49:20', '1'), - ('262', '3088', '2006-02-16T02:30:53', '2005-08-20T00:55:16', '2005-08-22T22:48:16', '1'), - ('18', '4453', '2006-02-16T02:30:53', '2005-05-25T19:27:51', '2005-05-26T16:23:51', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['6673', '14378', '5237', '4079', '11152', '13464', '8655', '10567', '6694', '14288', '4887', '10225', '7145', '6092', '2564', '877', '7863', '5274', '7611', '15043', '15989', '1719', '2596', '5202', '15', '11670', '9962', '4460', '1319', '6247', '5245', '1205', '2322', '776', '4816', '1554', '2342', '7174', '3360', '11659', '10737', '4237', '8911', '8821', '14541', '10699', '1750', '14246', '13302', '3543', '2679', '7721', '3103', '2346', '12515', '1892', '640', '10254', '3443', '14669', '151', '6330', '983', '1711', '14324', '1017', '12463', '3042', '41', '11349', '2350', '13727', '15151', '7673', '3097', '8880', '14223', '9439', '5500', '4245', '1315', '4321', '14221', '750', '3498', '13771', '1489', '7875', '6295', '4978', '3344', '14354', '7948', '14712', '4422', '9682', '10178', '4584', '849', '5000']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('322', '1997', '2006-02-16T02:30:53', '2005-07-12T11:50:56', '2005-07-13T14:27:56', '1'), - ('515', '810', '2006-02-16T02:30:53', '2005-08-21T09:50:02', '2005-08-30T09:07:02', '1'), - ('84', '2341', '2006-02-16T02:30:53', '2005-07-09T12:56:58', '2005-07-11T15:41:58', '1'), - ('84', '2202', '2006-02-16T02:30:53', '2005-07-07T05:06:27', '2005-07-16T08:46:27', '1'), - ('494', '3887', '2006-02-16T02:30:53', '2005-08-02T09:53:36', '2005-08-11T14:58:36', '1'), - ('576', '4292', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('232', '3986', '2006-02-16T02:30:53', '2005-07-29T15:04:42', '2005-08-04T11:26:42', '1'), - ('212', '2744', '2006-02-16T02:30:53', '2005-08-01T13:16:01', '2005-08-05T14:59:01', '1'), - ('204', '586', '2006-02-16T02:30:53', '2005-07-12T12:39:23', '2005-07-19T14:47:23', '1'), - ('512', '587', '2006-02-16T02:30:53', '2005-08-21T06:57:34', '2005-08-26T11:32:34', '1'), - ('543', '3613', '2006-02-16T02:30:53', '2005-07-08T19:59:14', '2005-07-15T22:53:14', '1'), - ('498', '3131', '2006-02-16T02:30:53', '2005-08-01T01:38:40', '2005-08-06T20:00:40', '1'), - ('109', '3653', '2006-02-16T02:30:53', '2005-07-27T07:01:00', '2005-07-31T02:31:00', '1'), - ('75', '2129', '2006-02-16T02:30:53', '2005-07-11T05:51:31', '2005-07-17T03:42:31', '1'), - ('408', '4008', '2006-02-16T02:30:53', '2005-06-19T03:41:10', '2005-06-24T03:10:10', '1'), - ('9', '886', '2006-02-16T02:30:53', '2005-05-30T05:48:59', '2005-06-02T09:30:59', '1'), - ('182', '1212', '2006-02-16T02:30:53', '2005-07-28T10:05:46', '2005-07-29T14:42:46', '1'), - ('108', '4579', '2006-02-16T02:30:53', '2005-07-09T14:34:09', '2005-07-14T13:02:09', '1'), - ('467', '3347', '2006-02-16T02:30:53', '2005-07-28T00:11:47', '2005-07-28T18:35:47', '1'), - ('182', '3797', '2006-02-16T02:30:53', '2005-08-22T09:49:32', '2005-08-28T13:50:32', '1'), - ('96', '38', '2006-02-16T02:30:53', '2005-08-23T20:24:36', '2005-08-26T20:35:36', '1'), - ('582', '2699', '2006-02-16T02:30:53', '2005-06-16T14:55:53', '2005-06-18T14:12:53', '1'), - ('80', '2229', '2006-02-16T02:30:53', '2005-06-19T05:48:26', '2005-06-24T10:16:26', '1'), - ('321', '3417', '2006-02-16T02:30:53', '2005-07-09T10:53:48', '2005-07-15T13:31:48', '1'), - ('319', '3049', '2006-02-16T02:30:53', '2005-05-25T00:39:22', '2005-06-03T03:30:22', '1'), - ('286', '4437', '2006-02-16T02:30:53', '2005-08-17T05:48:59', '2005-08-19T08:51:59', '1'), - ('576', '1951', '2006-02-16T02:30:53', '2005-07-31T16:10:36', '2005-08-02T17:09:36', '1'), - ('592', '4121', '2006-02-16T02:30:53', '2005-07-07T23:50:14', '2005-07-09T21:55:14', '1'), - ('190', '4296', '2006-02-16T02:30:53', '2005-06-15T10:39:05', '2005-06-18T05:25:05', '1'), - ('589', '2504', '2006-02-16T02:30:53', '2005-07-11T15:00:05', '2005-07-18T13:47:05', '1'), - ('115', '3547', '2006-02-16T02:30:53', '2005-07-09T13:24:14', '2005-07-12T11:16:14', '1'), - ('340', '470', '2006-02-16T02:30:53', '2005-06-15T02:25:56', '2005-06-22T23:19:56', '1'), - ('213', '1893', '2006-02-16T02:30:53', '2005-06-18T09:44:21', '2005-06-25T09:29:21', '1'), - ('113', '4339', '2006-02-16T02:30:53', '2005-05-29T13:35:35', '2005-06-03T17:33:35', '1'), - ('207', '2700', '2006-02-16T02:30:53', '2005-07-08T17:14:14', '2005-07-11T15:03:14', '1'), - ('155', '715', '2006-02-16T02:30:53', '2005-06-16T02:16:47', '2005-06-22T05:15:47', '1'), - ('146', '2169', '2006-02-16T02:30:53', '2005-06-18T11:42:40', '2005-06-20T14:40:40', '1'), - ('570', '46', '2006-02-16T02:30:53', '2005-07-27T08:00:36', '2005-08-01T03:11:36', '1'), - ('498', '2792', '2006-02-16T02:30:53', '2005-06-21T12:12:41', '2005-06-26T06:32:41', '1'), - ('112', '2881', '2006-02-16T02:30:53', '2005-08-17T05:20:45', '2005-08-22T10:18:45', '1'), - ('149', '1773', '2006-02-16T02:30:53', '2005-08-01T19:31:24', '2005-08-10T19:17:24', '1'), - ('477', '3773', '2006-02-16T02:30:53', '2005-07-07T13:16:55', '2005-07-15T16:33:55', '1'), - ('445', '2159', '2006-02-16T02:30:53', '2005-07-30T01:30:57', '2005-08-02T20:01:57', '1'), - ('477', '52', '2006-02-16T02:30:53', '2005-07-29T22:18:12', '2005-08-05T22:00:12', '1'), - ('576', '1275', '2006-02-16T02:30:53', '2005-08-21T15:34:32', '2005-08-25T13:18:32', '1'), - ('125', '1029', '2006-02-16T02:30:53', '2005-08-01T18:24:51', '2005-08-06T20:18:51', '1'), - ('321', '1103', '2006-02-16T02:30:53', '2005-06-16T16:57:36', '2005-06-25T21:51:36', '1'), - ('120', '3499', '2006-02-16T02:30:53', '2005-08-21T05:34:09', '2005-08-26T06:12:09', '1'), - ('51', '4041', '2006-02-16T02:30:53', '2005-08-19T18:54:26', '2005-08-21T23:01:26', '1'), - ('394', '3997', '2006-02-16T02:30:53', '2005-07-06T02:01:08', '2005-07-07T03:14:08', '1'), - ('109', '1994', '2006-02-16T02:30:53', '2005-06-19T12:12:30', '2005-06-27T08:27:30', '1'), - ('83', '2228', '2006-02-16T02:30:53', '2005-07-28T04:42:58', '2005-07-31T07:52:58', '1'), - ('553', '1877', '2006-02-16T02:30:53', '2005-06-20T16:58:19', '2005-06-25T21:18:19', '1'), - ('308', '2575', '2006-02-16T02:30:53', '2005-06-18T12:08:16', '2005-06-27T15:02:16', '1'), - ('63', '2703', '2006-02-16T02:30:53', '2005-08-18T13:39:26', '2005-08-22T09:05:26', '1'), - ('319', '139', '2006-02-16T02:30:53', '2005-06-17T04:17:33', '2005-06-20T00:06:33', '1'), - ('465', '495', '2006-02-16T02:30:53', '2005-05-28T18:43:26', '2005-05-30T13:39:26', '1'), - ('416', '2238', '2006-02-16T02:30:53', '2005-08-01T02:42:03', '2005-08-05T23:31:03', '1'), - ('377', '1639', '2006-02-16T02:30:53', '2005-06-21T20:19:00', '2005-06-30T15:39:00', '1'), - ('317', '3154', '2006-02-16T02:30:53', '2005-08-21T19:54:06', '2005-08-25T23:12:06', '1'), - ('14', '2942', '2006-02-16T02:30:53', '2005-05-26T00:37:28', '2005-05-30T06:28:28', '1'), - ('119', '3917', '2006-02-16T02:30:53', '2005-07-11T19:15:42', '2005-07-17T19:10:42', '1'), - ('115', '63', '2006-02-16T02:30:53', '2005-05-30T22:15:51', '2005-06-02T22:56:51', '1'), - ('347', '273', '2006-02-16T02:30:53', '2005-06-16T14:11:52', '2005-06-25T08:49:52', '1'), - ('155', '1361', '2006-02-16T02:30:53', '2005-08-21T08:10:56', '2005-08-30T12:09:56', '1'), - ('16', '1242', '2006-02-16T02:30:53', '2005-05-31T02:53:36', '2005-06-03T05:04:36', '1'), - ('214', '30', '2006-02-16T02:30:53', '2005-08-18T11:31:34', '2005-08-23T12:04:34', '1'), - ('291', '3103', '2006-02-16T02:30:53', '2005-06-20T12:38:27', '2005-06-26T11:18:27', '1'), - ('174', '1761', '2006-02-16T02:30:53', '2005-05-25T05:12:29', '2005-06-02T00:28:29', '1'), - ('73', '1871', '2006-02-16T02:30:53', '2005-08-02T17:21:49', '2005-08-06T18:40:49', '1'), - ('471', '1179', '2006-02-16T02:30:53', '2005-06-18T12:25:29', '2005-06-23T11:35:29', '1'), - ('85', '4201', '2006-02-16T02:30:53', '2005-08-20T10:08:53', '2005-08-27T09:30:53', '1'), - ('463', '4070', '2006-02-16T02:30:53', '2005-08-22T14:23:11', '2005-08-30T14:01:11', '1'), - ('409', '2368', '2006-02-16T02:30:53', '2005-07-28T02:53:53', '2005-08-06T00:07:53', '1'), - ('280', '4337', '2006-02-16T02:30:53', '2005-06-20T16:26:14', '2005-06-23T14:46:14', '1'), - ('51', '2920', '2006-02-16T02:30:53', '2005-07-30T00:16:55', '2005-08-01T01:05:55', '1'), - ('392', '514', '2006-02-16T02:30:53', '2005-08-21T04:51:51', '2005-08-29T00:37:51', '1'), - ('479', '290', '2006-02-16T02:30:53', '2005-07-30T21:38:12', '2005-08-06T00:03:12', '1'), - ('457', '3380', '2006-02-16T02:30:53', '2005-07-10T00:28:17', '2005-07-15T19:09:17', '1'), - ('91', '3743', '2006-02-16T02:30:53', '2005-07-07T13:48:33', '2005-07-10T09:54:33', '1'), - ('405', '3844', '2006-02-16T02:30:53', '2005-06-15T10:23:08', '2005-06-21T15:06:08', '1'), - ('91', '612', '2006-02-16T02:30:53', '2005-07-07T17:52:38', '2005-07-11T23:37:38', '1'), - ('51', '3824', '2006-02-16T02:30:53', '2005-08-21T04:49:41', '2005-08-29T23:52:41', '1'), - ('269', '730', '2006-02-16T02:30:53', '2005-05-29T09:41:40', '2005-05-30T13:31:40', '1'), - ('444', '1869', '2006-02-16T02:30:53', '2005-07-06T00:02:08', '2005-07-10T00:19:08', '1'), - ('512', '2278', '2006-02-16T02:30:53', '2005-08-20T11:47:21', '2005-08-22T17:09:21', '1'), - ('213', '699', '2006-02-16T02:30:53', '2005-06-15T21:41:38', '2005-06-22T17:00:38', '1'), - ('504', '3693', '2006-02-16T02:30:53', '2005-07-28T10:23:48', '2005-08-02T12:09:48', '1'), - ('7', '1393', '2006-02-16T02:30:53', '2005-07-11T17:30:58', '2005-07-15T15:50:58', '1'), - ('279', '2578', '2006-02-16T02:30:53', '2005-07-09T00:22:02', '2005-07-18T04:37:02', '1'), - ('277', '4401', '2006-02-16T02:30:53', '2005-06-21T10:57:27', '2005-06-28T10:53:27', '1'), - ('382', '1137', '2006-02-16T02:30:53', '2005-08-21T09:08:14', '2005-08-30T05:27:14', '1'), - ('589', '215', '2006-02-16T02:30:53', '2005-07-28T13:06:16', '2005-08-05T08:38:16', '1'), - ('226', '1198', '2006-02-16T02:30:53', '2005-08-21T21:22:56', '2005-08-25T01:53:56', '1'), - ('345', '1741', '2006-02-16T02:30:53', '2005-07-07T22:09:45', '2005-07-10T01:43:45', '1'), - ('425', '2427', '2006-02-16T02:30:53', '2005-07-31T06:47:10', '2005-08-04T09:07:10', '1'), - ('491', '1582', '2006-02-16T02:30:53', '2005-07-31T23:43:04', '2005-08-03T00:43:04', '1'), - ('368', '2322', '2006-02-16T02:30:53', '2005-07-08T06:11:02', '2005-07-11T05:14:02', '1'), - ('449', '2424', '2006-02-16T02:30:53', '2005-05-30T01:23:07', '2005-06-07T01:50:07', '1'), - ('146', '668', '2006-02-16T02:30:53', '2005-07-09T01:16:13', '2005-07-14T21:55:13', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['1012', '11752', '351', '14891', '3300', '11353', '3745', '3922', '14745', '13602', '10995', '14389', '4914', '6025', '11804', '4404', '6619', '6917', '13157', '3890', '10716', '10358', '13830', '4186', '11314', '9077', '5396', '9228', '458', '8818', '13017', '11223', '8001', '6550', '14220', '4103', '10952', '6860', '8232', '2851', '11419', '13522', '14214', '5765', '3124', '7266', '9104', '1776', '13375', '4604', '15854', '3720', '2093', '2', '11366', '2532', '10141', '4991', '15920', '7053', '12420', '10541', '2826', '8705', '10144', '12968', '7447', '4757', '13255', '10760', '10642', '10196', '4361', '8530', '3613', '15493', '1567', '6069', '10054', '9887', '11228', '15415', '10691', '13855', '9554', '4219', '5168', '7205', '4372', '9610', '15603', '500', '10777', '1220', '15123', '14625', '1356', '12091', '6147', '12725']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('291', '688', '2006-02-16T02:30:53', '2005-05-31T02:18:05', '2005-06-03T06:47:05', '1'), - ('481', '1833', '2006-02-16T02:30:53', '2005-08-17T09:10:55', '2005-08-18T06:22:55', '1'), - ('118', '3371', '2006-02-16T02:30:53', '2005-05-27T05:39:03', '2005-06-01T11:10:03', '1'), - ('482', '288', '2006-02-16T02:30:53', '2005-08-22T04:11:02', '2005-08-27T03:22:02', '1'), - ('565', '2505', '2006-02-16T02:30:53', '2005-06-21T07:25:01', '2005-06-25T01:47:01', '1'), - ('444', '1729', '2006-02-16T02:30:53', '2005-08-02T17:34:45', '2005-08-09T16:01:45', '1'), - ('171', '1518', '2006-02-16T02:30:53', '2005-07-06T12:10:32', '2005-07-12T15:20:32', '1'), - ('470', '2878', '2006-02-16T02:30:53', '2005-07-06T20:32:27', '2005-07-14T19:00:27', '1'), - ('277', '4399', '2006-02-16T02:30:53', '2005-08-21T22:53:01', '2005-08-23T23:22:01', '1'), - ('348', '2805', '2006-02-16T02:30:53', '2005-08-20T06:02:02', '2005-08-27T04:51:02', '1'), - ('340', '2891', '2006-02-16T02:30:53', '2005-08-02T04:48:00', '2005-08-07T05:00:00', '1'), - ('145', '2718', '2006-02-16T02:30:53', '2005-08-21T10:15:20', '2005-08-27T05:39:20', '1'), - ('535', '298', '2006-02-16T02:30:53', '2005-07-08T21:30:53', '2005-07-17T01:29:53', '1'), - ('113', '3306', '2006-02-16T02:30:53', '2005-07-11T02:18:13', '2005-07-11T23:30:13', '1'), - ('556', '1040', '2006-02-16T02:30:53', '2005-08-17T11:42:45', '2005-08-25T07:11:45', '1'), - ('25', '944', '2006-02-16T02:30:53', '2005-07-07T21:31:53', '2005-07-13T19:00:53', '1'), - ('305', '4062', '2006-02-16T02:30:53', '2005-07-12T08:50:48', '2005-07-14T11:54:48', '1'), - ('23', '3048', '2006-02-16T02:30:53', '2005-07-12T22:30:15', '2005-07-20T03:20:15', '1'), - ('592', '4391', '2006-02-16T02:30:53', '2005-08-19T13:12:28', '2005-08-20T10:41:28', '1'), - ('553', '2570', '2006-02-16T02:30:53', '2005-07-06T18:58:15', '2005-07-10T18:51:15', '1'), - ('515', '3405', '2006-02-16T02:30:53', '2005-08-01T18:53:48', '2005-08-04T13:49:48', '1'), - ('517', '3039', '2006-02-16T02:30:53', '2005-08-01T05:50:07', '2005-08-03T08:18:07', '1'), - ('61', '2874', '2006-02-16T02:30:53', '2005-08-20T13:57:59', '2005-08-25T11:29:59', '1'), - ('185', '3910', '2006-02-16T02:30:53', '2005-07-07T10:32:25', '2005-07-15T06:22:25', '1'), - ('26', '2790', '2006-02-16T02:30:53', '2005-08-02T16:04:08', '2005-08-04T18:47:08', '1'), - ('471', '4324', '2006-02-16T02:30:53', '2005-07-30T08:00:19', '2005-08-08T11:21:19', '1'), - ('559', '3795', '2006-02-16T02:30:53', '2005-07-09T19:42:52', '2005-07-15T21:45:52', '1'), - ('91', '2325', '2006-02-16T02:30:53', '2005-07-30T13:36:57', '2005-08-05T10:43:57', '1'), - ('565', '3350', '2006-02-16T02:30:53', '2005-05-27T19:58:36', '2005-06-06T00:51:36', '1'), - ('98', '3090', '2006-02-16T02:30:53', '2005-07-29T22:14:04', '2005-08-07T17:26:04', '1'), - ('104', '2160', '2006-02-16T02:30:53', '2005-08-19T08:02:24', '2005-08-26T07:32:24', '1'), - ('597', '1994', '2006-02-16T02:30:53', '2005-08-02T12:34:27', '2005-08-07T14:21:27', '1'), - ('10', '2570', '2006-02-16T02:30:53', '2005-07-28T15:10:55', '2005-08-05T18:23:55', '1'), - ('112', '2184', '2006-02-16T02:30:53', '2005-07-12T05:03:14', '2005-07-19T04:06:14', '1'), - ('162', '2618', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('91', '3632', '2006-02-16T02:30:53', '2005-07-07T06:25:28', '2005-07-12T11:18:28', '1'), - ('111', '3218', '2006-02-16T02:30:53', '2005-08-02T03:28:21', '2005-08-09T01:41:21', '1'), - ('91', '2907', '2006-02-16T02:30:53', '2005-07-12T19:54:17', '2005-07-18T13:59:17', '1'), - ('526', '3255', '2006-02-16T02:30:53', '2005-07-29T00:14:37', '2005-08-06T00:57:37', '1'), - ('361', '2168', '2006-02-16T02:30:53', '2005-06-19T23:07:03', '2005-06-22T17:26:03', '1'), - ('444', '514', '2006-02-16T02:30:53', '2005-08-02T19:46:38', '2005-08-11T14:49:38', '1'), - ('343', '2940', '2006-02-16T02:30:53', '2005-08-20T02:44:06', '2005-08-28T05:30:06', '1'), - ('198', '4510', '2006-02-16T02:30:53', '2005-08-21T04:30:49', '2005-08-26T04:42:49', '1'), - ('293', '2619', '2006-02-16T02:30:53', '2005-07-10T13:03:02', '2005-07-16T09:31:02', '1'), - ('113', '3342', '2006-02-16T02:30:53', '2005-06-20T18:28:19', '2005-06-28T21:08:19', '1'), - ('24', '3379', '2006-02-16T02:30:53', '2005-07-27T11:22:17', '2005-08-04T05:45:17', '1'), - ('322', '3372', '2006-02-16T02:30:53', '2005-07-30T08:49:55', '2005-08-06T12:23:55', '1'), - ('472', '1404', '2006-02-16T02:30:53', '2005-06-16T18:46:58', '2005-06-24T16:01:58', '1'), - ('120', '949', '2006-02-16T02:30:53', '2005-08-19T21:31:31', '2005-08-29T00:17:31', '1'), - ('402', '4230', '2006-02-16T02:30:53', '2005-07-08T06:58:43', '2005-07-14T06:41:43', '1'), - ('464', '1648', '2006-02-16T02:30:53', '2005-08-23T15:58:05', '2005-08-26T19:23:05', '1'), - ('96', '2958', '2006-02-16T02:30:53', '2005-07-06T11:06:57', '2005-07-09T14:16:57', '1'), - ('26', '814', '2006-02-16T02:30:53', '2005-06-17T18:14:08', '2005-06-26T18:10:08', '1'), - ('459', '1525', '2006-02-16T02:30:53', '2005-05-24T22:54:33', '2005-05-28T19:40:33', '1'), - ('280', '3583', '2006-02-16T02:30:53', '2005-08-02T18:01:25', '2005-08-11T15:02:25', '1'), - ('26', '1870', '2006-02-16T02:30:53', '2005-06-19T01:27:46', '2005-06-20T02:15:46', '1'), - ('8', '8', '2006-02-16T02:30:53', '2005-07-31T22:08:29', '2005-08-06T16:59:29', '1'), - ('540', '1856', '2006-02-16T02:30:53', '2005-07-09T00:49:03', '2005-07-13T05:02:03', '1'), - ('212', '243', '2006-02-16T02:30:53', '2005-08-23T18:05:10', '2005-08-26T18:09:10', '1'), - ('408', '149', '2006-02-16T02:30:53', '2005-07-27T03:38:54', '2005-07-31T01:13:54', '1'), - ('477', '452', '2006-02-16T02:30:53', '2005-08-18T10:01:50', '2005-08-22T08:14:50', '1'), - ('234', '1413', '2006-02-16T02:30:53', '2005-08-01T12:24:54', '2005-08-03T16:18:54', '1'), - ('125', '2980', '2006-02-16T02:30:53', '2005-06-19T20:41:35', '2005-06-25T17:23:35', '1'), - ('2', '4038', '2006-02-16T02:30:53', '2005-07-29T17:14:29', '2005-08-02T16:01:29', '1'), - ('49', '3011', '2006-02-16T02:30:53', '2005-07-31T22:13:52', '2005-08-05T19:27:52', '1'), - ('166', '3108', '2006-02-16T02:30:53', '2005-08-19T06:38:18', '2005-08-20T08:29:18', '1'), - ('107', '1795', '2006-02-16T02:30:53', '2005-07-27T18:02:08', '2005-07-29T21:15:08', '1'), - ('504', '1278', '2006-02-16T02:30:53', '2005-07-08T14:36:51', '2005-07-12T15:28:51', '1'), - ('150', '1101', '2006-02-16T02:30:53', '2005-08-19T16:54:12', '2005-08-28T17:00:12', '1'), - ('497', '1311', '2006-02-16T02:30:53', '2005-08-01T20:25:20', '2005-08-09T16:57:20', '1'), - ('294', '2573', '2006-02-16T02:30:53', '2005-08-01T15:45:11', '2005-08-02T20:13:11', '1'), - ('199', '3070', '2006-02-16T02:30:53', '2005-08-01T00:34:51', '2005-08-05T03:43:51', '1'), - ('425', '116', '2006-02-16T02:30:53', '2005-07-07T19:33:23', '2005-07-12T22:36:23', '1'), - ('233', '4528', '2006-02-16T02:30:53', '2005-07-29T10:26:14', '2005-07-31T10:24:14', '1'), - ('331', '3776', '2006-02-16T02:30:53', '2005-07-06T05:45:53', '2005-07-07T10:02:53', '1'), - ('308', '3521', '2006-02-16T02:30:53', '2005-08-23T02:20:53', '2005-08-25T23:02:53', '1'), - ('320', '3098', '2006-02-16T02:30:53', '2005-06-16T03:13:30', '2005-06-21T23:56:30', '1'), - ('553', '256', '2006-02-16T02:30:53', '2005-07-11T04:44:59', '2005-07-13T01:00:59', '1'), - ('598', '2303', '2006-02-16T02:30:53', '2005-07-31T19:15:52', '2005-08-04T19:54:52', '1'), - ('549', '436', '2006-02-16T02:30:53', '2005-07-31T14:00:32', '2005-08-05T19:16:32', '1'), - ('144', '2561', '2006-02-16T02:30:53', '2005-08-02T12:55:23', '2005-08-08T12:31:23', '1'), - ('204', '4176', '2006-02-16T02:30:53', '2005-08-22T23:48:56', '2005-09-01T02:05:56', '1'), - ('276', '4281', '2006-02-16T02:30:53', '2005-08-01T18:09:53', '2005-08-03T16:32:53', '1'), - ('96', '1617', '2006-02-16T02:30:53', '2005-08-20T14:48:55', '2005-08-28T14:45:55', '1'), - ('490', '2581', '2006-02-16T02:30:53', '2005-07-31T02:06:49', '2005-08-01T22:27:49', '1'), - ('16', '2800', '2006-02-16T02:30:53', '2005-07-07T12:11:22', '2005-07-11T11:05:22', '1'), - ('420', '4096', '2006-02-16T02:30:53', '2005-07-09T09:20:01', '2005-07-11T14:42:01', '1'), - ('36', '2828', '2006-02-16T02:30:53', '2005-07-27T09:06:13', '2005-08-05T07:11:13', '1'), - ('252', '2207', '2006-02-16T02:30:53', '2005-07-07T20:09:01', '2005-07-09T18:24:01', '1'), - ('16', '3110', '2006-02-16T02:30:53', '2005-07-31T03:54:05', '2005-08-06T23:11:05', '1'), - ('6', '2565', '2006-02-16T02:30:53', '2005-08-23T06:41:32', '2005-08-28T08:51:32', '1'), - ('145', '4500', '2006-02-16T02:30:53', '2005-05-28T01:05:25', '2005-05-31T20:04:25', '1'), - ('493', '3487', '2006-02-16T02:30:53', '2005-08-01T21:03:50', '2005-08-06T19:29:50', '1'), - ('290', '1621', '2006-02-16T02:30:53', '2005-06-15T03:26:15', '2005-06-23T08:17:15', '1'), - ('445', '1455', '2006-02-16T02:30:53', '2005-08-22T12:48:44', '2005-08-27T11:07:44', '1'), - ('507', '2661', '2006-02-16T02:30:53', '2005-08-21T18:34:21', '2005-08-29T21:41:21', '1'), - ('212', '1318', '2006-02-16T02:30:53', '2005-06-15T13:17:01', '2005-06-19T16:22:01', '1'), - ('555', '2161', '2006-02-16T02:30:53', '2005-08-17T22:22:50', '2005-08-27T03:55:50', '1'), - ('35', '910', '2006-02-16T02:30:53', '2005-07-11T09:13:08', '2005-07-17T03:48:08', '1'), - ('51', '4071', '2006-02-16T02:30:53', '2005-08-18T21:43:09', '2005-08-23T18:50:09', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['11864', '7207', '11193', '1809', '11129', '1771', '15232', '5947', '943', '1164', '14317', '9391', '11865', '505', '2443', '6237', '12517', '13600', '2445', '3305', '9252', '2174', '13676', '12908', '8693', '14744', '1507', '9767', '522', '14834', '1151', '10839', '13580', '14543', '5104', '5268', '8444', '6953', '7057', '12769', '4216', '900', '10463', '804', '13008', '14689', '11715', '5329', '3391', '5021', '2554', '2179', '10211', '14422', '9013', '13694', '8112', '9485', '2726', '12626', '7239', '6402', '6594', '3756', '15243', '12849', '10894', '9933', '2963', '6697', '774', '8826', '13217', '11029', '4966', '12399', '14290', '12939', '7704', '4566', '518', '11452', '8187', '5215', '3511', '5905', '6637', '14456', '3107', '8761', '4452', '9916', '15012', '3009', '9629', '14491', '4454', '10426', '6494', '10914']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('96', '2985', '2006-02-16T02:30:53', '2005-08-17T14:02:01', '2005-08-21T19:54:01', '1'), - ('51', '336', '2006-02-16T02:30:53', '2005-07-27T09:13:26', '2005-08-01T10:24:26', '1'), - ('292', '2246', '2006-02-16T02:30:53', '2005-08-02T11:31:33', '2005-08-04T14:00:33', '1'), - ('517', '1071', '2006-02-16T02:30:53', '2005-06-16T21:00:20', '2005-06-25T20:25:20', '1'), - ('566', '23', '2006-02-16T02:30:53', '2005-08-02T09:08:44', '2005-08-04T04:00:44', '1'), - ('416', '1769', '2006-02-16T02:30:53', '2005-06-16T18:12:17', '2005-06-18T16:11:17', '1'), - ('5', '61', '2006-02-16T02:30:53', '2005-08-22T17:37:02', '2005-08-25T18:45:02', '1'), - ('331', '327', '2006-02-16T02:30:53', '2005-07-10T23:07:42', '2005-07-18T23:13:42', '1'), - ('57', '3737', '2006-02-16T02:30:53', '2005-05-30T15:20:19', '2005-06-06T18:53:19', '1'), - ('49', '3691', '2006-02-16T02:30:53', '2005-06-14T23:16:26', '2005-06-16T21:00:26', '1'), - ('471', '2090', '2006-02-16T02:30:53', '2005-08-21T08:00:40', '2005-08-27T06:52:40', '1'), - ('273', '665', '2006-02-16T02:30:53', '2005-07-30T19:48:41', '2005-08-04T15:27:41', '1'), - ('345', '2577', '2006-02-16T02:30:53', '2005-08-17T14:03:46', '2005-08-19T08:39:46', '1'), - ('111', '71', '2006-02-16T02:30:53', '2005-05-28T02:06:37', '2005-05-29T06:57:37', '1'), - ('233', '1622', '2006-02-16T02:30:53', '2005-06-18T18:52:30', '2005-06-24T21:27:30', '1'), - ('166', '2215', '2006-02-16T02:30:53', '2005-07-11T14:19:12', '2005-07-15T15:05:12', '1'), - ('520', '2908', '2006-02-16T02:30:53', '2005-08-18T13:40:20', '2005-08-27T14:04:20', '1'), - ('528', '431', '2006-02-16T02:30:53', '2005-08-20T06:00:25', '2005-08-28T02:39:25', '1'), - ('98', '2887', '2006-02-16T02:30:53', '2005-06-18T19:02:11', '2005-06-23T22:25:11', '1'), - ('578', '2811', '2006-02-16T02:30:53', '2005-06-21T07:46:57', '2005-06-27T06:16:57', '1'), - ('322', '2350', '2006-02-16T02:30:53', '2005-07-30T14:19:59', '2005-08-07T15:17:59', '1'), - ('520', '3279', '2006-02-16T02:30:53', '2005-06-18T00:09:01', '2005-06-25T23:14:01', '1'), - ('103', '3170', '2006-02-16T02:30:53', '2005-08-20T08:33:21', '2005-08-25T02:51:21', '1'), - ('340', '175', '2006-02-16T02:30:53', '2005-08-19T04:19:05', '2005-08-25T09:50:05', '1'), - ('51', '917', '2006-02-16T02:30:53', '2005-07-29T16:44:13', '2005-08-01T15:56:13', '1'), - ('213', '800', '2006-02-16T02:30:53', '2005-08-21T22:45:21', '2005-08-29T23:57:21', '1'), - ('172', '2514', '2006-02-16T02:30:53', '2005-06-15T22:25:26', '2005-06-19T17:00:26', '1'), - ('89', '3432', '2006-02-16T02:30:53', '2005-07-31T09:46:49', '2005-08-03T11:20:49', '1'), - ('382', '3195', '2006-02-16T02:30:53', '2005-05-28T03:33:20', '2005-05-31T04:23:20', '1'), - ('262', '3105', '2006-02-16T02:30:53', '2005-08-22T01:45:58', '2005-08-28T20:52:58', '1'), - ('581', '1281', '2006-02-16T02:30:53', '2005-05-31T21:29:00', '2005-06-03T23:24:00', '1'), - ('482', '2867', '2006-02-16T02:30:53', '2005-08-01T23:37:39', '2005-08-02T20:18:39', '1'), - ('526', '4419', '2006-02-16T02:30:53', '2005-08-20T05:23:34', '2005-08-23T02:45:34', '1'), - ('579', '709', '2006-02-16T02:30:53', '2005-08-21T15:39:01', '2005-08-28T09:47:01', '1'), - ('14', '2109', '2006-02-16T02:30:53', '2005-07-09T06:37:07', '2005-07-14T12:32:07', '1'), - ('119', '1083', '2006-02-16T02:30:53', '2005-07-09T14:22:43', '2005-07-12T08:27:43', '1'), - ('213', '3329', '2006-02-16T02:30:53', '2005-07-29T07:36:13', '2005-08-05T04:55:13', '1'), - ('306', '2910', '2006-02-16T02:30:53', '2005-07-26T23:52:47', '2005-07-30T23:07:47', '1'), - ('320', '1196', '2006-02-16T02:30:53', '2005-07-27T03:50:03', '2005-08-04T04:36:03', '1'), - ('504', '926', '2006-02-16T02:30:53', '2005-08-18T23:26:40', '2005-08-25T03:03:40', '1'), - ('467', '1216', '2006-02-16T02:30:53', '2005-07-07T12:01:34', '2005-07-08T09:59:34', '1'), - ('586', '3543', '2006-02-16T02:30:53', '2005-05-30T09:38:41', '2005-06-07T11:54:41', '1'), - ('291', '1301', '2006-02-16T02:30:53', '2005-08-01T09:39:43', '2005-08-10T03:42:43', '1'), - ('171', '3909', '2006-02-16T02:30:53', '2005-05-29T18:10:24', '2005-06-06T22:53:24', '1'), - ('181', '1838', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('463', '1124', '2006-02-16T02:30:53', '2005-08-21T20:33:00', '2005-08-22T18:10:00', '1'), - ('452', '1615', '2006-02-16T02:30:53', '2005-08-17T07:40:55', '2005-08-25T11:19:55', '1'), - ('402', '1628', '2006-02-16T02:30:53', '2005-07-09T16:49:46', '2005-07-16T19:05:46', '1'), - ('45', '26', '2006-02-16T02:30:53', '2005-06-21T15:11:02', '2005-06-25T14:12:02', '1'), - ('73', '3445', '2006-02-16T02:30:53', '2005-07-09T02:09:41', '2005-07-13T05:47:41', '1'), - ('322', '3916', '2006-02-16T02:30:53', '2005-06-19T03:05:38', '2005-06-25T23:03:38', '1'), - ('338', '4334', '2006-02-16T02:30:53', '2005-06-18T00:41:36', '2005-06-19T02:17:36', '1'), - ('530', '810', '2006-02-16T02:30:53', '2005-08-01T01:01:16', '2005-08-10T01:31:16', '1'), - ('361', '1382', '2006-02-16T02:30:53', '2005-08-21T11:21:46', '2005-08-25T13:15:46', '1'), - ('347', '2367', '2006-02-16T02:30:53', '2005-07-30T05:19:20', '2005-08-04T01:35:20', '1'), - ('454', '3654', '2006-02-16T02:30:53', '2005-08-20T09:13:23', '2005-08-28T06:10:23', '1'), - ('528', '2444', '2006-02-16T02:30:53', '2005-07-28T19:11:07', '2005-08-03T18:41:07', '1'), - ('338', '3722', '2006-02-16T02:30:53', '2005-07-30T23:32:40', '2005-08-08T17:44:40', '1'), - ('420', '2970', '2006-02-16T02:30:53', '2005-06-19T15:02:20', '2005-06-21T15:38:20', '1'), - ('361', '4230', '2006-02-16T02:30:53', '2005-08-18T17:36:45', '2005-08-26T17:12:45', '1'), - ('278', '1786', '2006-02-16T02:30:53', '2005-07-27T10:20:27', '2005-07-29T10:15:27', '1'), - ('66', '2576', '2006-02-16T02:30:53', '2005-07-11T22:46:10', '2005-07-16T04:02:10', '1'), - ('517', '4458', '2006-02-16T02:30:53', '2005-07-12T07:25:43', '2005-07-13T07:59:43', '1'), - ('320', '30', '2006-02-16T02:30:53', '2005-07-06T12:40:38', '2005-07-11T09:29:38', '1'), - ('308', '4408', '2006-02-16T02:30:53', '2005-08-22T17:48:28', '2005-08-31T13:22:28', '1'), - ('280', '3489', '2006-02-16T02:30:53', '2005-08-19T02:05:37', '2005-08-23T07:00:37', '1'), - ('51', '598', '2006-02-16T02:30:53', '2005-08-02T01:12:35', '2005-08-09T22:55:35', '1'), - ('111', '2349', '2006-02-16T02:30:53', '2005-07-31T15:24:46', '2005-08-01T10:00:46', '1'), - ('24', '1444', '2006-02-16T02:30:53', '2005-06-20T07:33:09', '2005-06-28T09:23:09', '1'), - ('103', '210', '2006-02-16T02:30:53', '2005-07-12T12:44:57', '2005-07-19T13:02:57', '1'), - ('575', '1188', '2006-02-16T02:30:53', '2005-05-29T13:19:43', '2005-06-01T18:51:43', '1'), - ('369', '1800', '2006-02-16T02:30:53', '2005-07-29T22:30:16', '2005-07-30T19:43:16', '1'), - ('565', '616', '2006-02-16T02:30:53', '2005-08-19T15:38:39', '2005-08-21T14:33:39', '1'), - ('45', '1023', '2006-02-16T02:30:53', '2005-08-02T05:51:10', '2005-08-05T04:15:10', '1'), - ('118', '4360', '2006-02-16T02:30:53', '2005-07-08T23:47:25', '2005-07-14T03:35:25', '1'), - ('347', '3950', '2006-02-16T02:30:53', '2005-08-18T09:13:42', '2005-08-27T11:44:42', '1'), - ('366', '790', '2006-02-16T02:30:53', '2005-08-21T07:02:59', '2005-08-28T02:57:59', '1'), - ('181', '3375', '2006-02-16T02:30:53', '2005-08-19T05:38:25', '2005-08-23T23:52:25', '1'), - ('265', '2342', '2006-02-16T02:30:53', '2005-07-28T04:02:13', '2005-08-04T00:51:13', '1'), - ('133', '4302', '2006-02-16T02:30:53', '2005-07-08T05:18:50', '2005-07-15T01:53:50', '1'), - ('480', '4087', '2006-02-16T02:30:53', '2005-05-28T03:18:02', '2005-05-30T05:32:02', '1'), - ('35', '1245', '2006-02-16T02:30:53', '2005-08-02T20:59:52', '2005-08-12T01:16:52', '1'), - ('87', '945', '2006-02-16T02:30:53', '2005-07-28T22:33:53', '2005-08-03T03:54:53', '1'), - ('528', '3888', '2006-02-16T02:30:53', '2005-07-09T11:47:58', '2005-07-18T09:58:58', '1'), - ('494', '2128', '2006-02-16T02:30:53', '2005-07-06T00:42:01', '2005-07-09T23:08:01', '1'), - ('10', '3891', '2006-02-16T02:30:53', '2005-07-10T20:41:09', '2005-07-19T14:49:09', '1'), - ('164', '2852', '2006-02-16T02:30:53', '2005-07-12T09:57:39', '2005-07-19T08:40:39', '1'), - ('125', '2520', '2006-02-16T02:30:53', '2005-08-21T12:38:09', '2005-08-26T08:29:09', '1'), - ('303', '4527', '2006-02-16T02:30:53', '2005-06-20T17:26:05', '2005-06-25T12:36:05', '1'), - ('539', '1317', '2006-02-16T02:30:53', '2005-07-29T19:26:47', '2005-08-08T00:09:47', '1'), - ('460', '2414', '2006-02-16T02:30:53', '2005-07-07T23:31:54', '2005-07-14T04:05:54', '1'), - ('432', '949', '2006-02-16T02:30:53', '2005-07-31T14:54:52', '2005-08-07T13:18:52', '1'), - ('454', '1584', '2006-02-16T02:30:53', '2005-08-22T08:42:32', '2005-08-28T05:04:32', '1'), - ('280', '2721', '2006-02-16T02:30:53', '2005-06-20T10:24:44', '2005-06-23T13:39:44', '1'), - ('8', '2773', '2006-02-16T02:30:53', '2005-07-31T04:54:43', '2005-08-02T08:36:43', '1'), - ('226', '2072', '2006-02-16T02:30:53', '2005-08-21T13:55:39', '2005-08-29T17:51:39', '1'), - ('9', '1395', '2006-02-16T02:30:53', '2005-07-07T23:37:00', '2005-07-11T02:30:00', '1'), - ('305', '1325', '2006-02-16T02:30:53', '2005-08-01T08:26:08', '2005-08-09T04:09:08', '1'), - ('57', '1124', '2006-02-16T02:30:53', '2005-07-12T02:42:51', '2005-07-20T06:57:51', '1'), - ('584', '585', '2006-02-16T02:30:53', '2005-08-02T02:04:43', '2005-08-06T03:00:43', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['3705', '1704', '5004', '7061', '15764', '8972', '2355', '2852', '5480', '1440', '2187', '12538', '5660', '3542', '6284', '11153', '14024', '10936', '3555', '5523', '6393', '8565', '3113', '5751', '1621', '2772', '9033', '12695', '11845', '9803', '1033', '15294', '8161', '4784', '9532', '6904', '13972', '10273', '10890', '5534', '1105', '822', '7387', '6717', '14041', '4088', '12064', '4290', '13498', '12357', '10551', '13285', '14365', '11382', '13943', '3907', '7719', '9119', '3913', '1532', '1157', '2228', '878', '11334', '8993', '152', '13363', '4924', '4672', '1814', '3760', '10710', '10749', '7893', '11510', '2973', '687', '14681', '4003', '9083', '12498', '13754', '8003', '10181', '10068', '5967', '5419', '13341', '14093', '1943', '14065', '9915', '7732', '7458', '8509', '13116', '6774', '6352', '11408', '8070']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('223', '65', '2006-02-16T02:30:53', '2005-07-06T10:17:59', '2005-07-10T15:31:59', '1'), - ('488', '4425', '2006-02-16T02:30:53', '2005-06-16T13:45:56', '2005-06-24T18:12:56', '1'), - ('382', '2637', '2006-02-16T02:30:53', '2005-07-09T01:20:50', '2005-07-09T19:56:50', '1'), - ('145', '880', '2006-02-16T02:30:53', '2005-07-27T03:51:10', '2005-07-31T05:36:10', '1'), - ('8', '2937', '2006-02-16T02:30:53', '2005-08-23T13:05:10', '2005-08-25T16:15:10', '1'), - ('89', '1974', '2006-02-16T02:30:53', '2005-07-30T04:06:25', '2005-08-04T22:49:25', '1'), - ('125', '3613', '2006-02-16T02:30:53', '2005-06-18T12:57:06', '2005-06-26T07:32:06', '1'), - ('453', '2695', '2006-02-16T02:30:53', '2005-06-19T23:08:50', '2005-06-26T04:00:50', '1'), - ('452', '847', '2006-02-16T02:30:53', '2005-07-09T23:49:07', '2005-07-12T00:15:07', '1'), - ('26', '2921', '2006-02-16T02:30:53', '2005-06-15T18:53:14', '2005-06-24T15:28:14', '1'), - ('477', '1385', '2006-02-16T02:30:53', '2005-06-18T01:17:27', '2005-06-20T22:18:27', '1'), - ('118', '1373', '2006-02-16T02:30:53', '2005-08-18T14:09:09', '2005-08-23T19:12:09', '1'), - ('171', '1404', '2006-02-16T02:30:53', '2005-07-10T07:46:12', '2005-07-17T07:48:12', '1'), - ('593', '4391', '2006-02-16T02:30:53', '2005-07-06T01:51:42', '2005-07-11T03:29:42', '1'), - ('177', '2938', '2006-02-16T02:30:53', '2005-07-11T16:51:39', '2005-07-15T19:59:39', '1'), - ('220', '1546', '2006-02-16T02:30:53', '2005-08-02T09:54:19', '2005-08-10T14:57:19', '1'), - ('87', '1492', '2006-02-16T02:30:53', '2005-08-20T21:13:58', '2005-08-29T23:02:58', '1'), - ('445', '463', '2006-02-16T02:30:53', '2005-08-02T02:55:04', '2005-08-11T07:56:04', '1'), - ('537', '869', '2006-02-16T02:30:53', '2005-07-06T02:45:35', '2005-07-10T07:17:35', '1'), - ('125', '2233', '2006-02-16T02:30:53', '2005-07-10T01:47:55', '2005-07-18T22:25:55', '1'), - ('164', '3802', '2006-02-16T02:30:53', '2005-07-11T22:28:12', '2005-07-14T18:03:12', '1'), - ('280', '3211', '2006-02-16T02:30:53', '2005-07-29T11:35:23', '2005-08-06T08:28:23', '1'), - ('517', '3620', '2006-02-16T02:30:53', '2005-06-20T17:56:40', '2005-06-23T14:45:40', '1'), - ('479', '387', '2006-02-16T02:30:53', '2005-07-10T12:25:11', '2005-07-11T15:23:11', '1'), - ('177', '3677', '2006-02-16T02:30:53', '2005-06-16T07:24:12', '2005-06-19T02:35:12', '1'), - ('520', '1221', '2006-02-16T02:30:53', '2005-06-19T17:59:27', '2005-06-23T17:52:27', '1'), - ('35', '3416', '2006-02-16T02:30:53', '2005-07-30T06:07:42', '2005-08-05T01:18:42', '1'), - ('483', '446', '2006-02-16T02:30:53', '2005-08-18T20:11:35', '2005-08-25T18:29:35', '1'), - ('65', '14', '2006-02-16T02:30:53', '2005-08-17T13:16:38', '2005-08-18T11:21:38', '1'), - ('520', '3783', '2006-02-16T02:30:53', '2005-07-31T11:06:02', '2005-08-01T06:25:02', '1'), - ('25', '14', '2006-02-16T02:30:53', '2005-05-31T04:50:07', '2005-06-02T01:53:07', '1'), - ('108', '70', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('555', '848', '2006-02-16T02:30:53', '2005-07-28T21:11:00', '2005-08-03T23:32:00', '1'), - ('182', '549', '2006-02-16T02:30:53', '2005-07-08T16:09:56', '2005-07-09T20:35:56', '1'), - ('488', '1309', '2006-02-16T02:30:53', '2005-07-31T01:16:51', '2005-08-01T20:23:51', '1'), - ('465', '2312', '2006-02-16T02:30:53', '2005-07-12T22:02:09', '2005-07-17T16:42:09', '1'), - ('553', '1687', '2006-02-16T02:30:53', '2005-08-20T18:52:17', '2005-08-28T15:19:17', '1'), - ('212', '1458', '2006-02-16T02:30:53', '2005-08-01T03:14:47', '2005-08-07T03:59:47', '1'), - ('210', '78', '2006-02-16T02:30:53', '2005-08-02T00:58:46', '2005-08-10T02:13:46', '1'), - ('156', '3251', '2006-02-16T02:30:53', '2005-07-10T02:26:49', '2005-07-11T07:13:49', '1'), - ('26', '1708', '2006-02-16T02:30:53', '2005-05-31T14:33:56', '2005-06-07T11:30:56', '1'), - ('480', '2634', '2006-02-16T02:30:53', '2005-05-29T21:36:00', '2005-06-07T17:24:00', '1'), - ('233', '3274', '2006-02-16T02:30:53', '2005-07-27T15:54:19', '2005-08-03T14:46:19', '1'), - ('273', '523', '2006-02-16T02:30:53', '2005-07-12T13:35:02', '2005-07-20T15:03:02', '1'), - ('247', '52', '2006-02-16T02:30:53', '2005-08-20T21:45:23', '2005-08-26T01:42:23', '1'), - ('66', '234', '2006-02-16T02:30:53', '2005-07-07T05:31:55', '2005-07-15T07:35:55', '1'), - ('284', '298', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('277', '4174', '2006-02-16T02:30:53', '2005-07-07T15:47:10', '2005-07-15T15:03:10', '1'), - ('578', '1603', '2006-02-16T02:30:53', '2005-08-20T01:51:23', '2005-08-24T05:32:23', '1'), - ('19', '166', '2006-02-16T02:30:53', '2005-08-18T07:40:52', '2005-08-22T02:51:52', '1'), - ('294', '2974', '2006-02-16T02:30:53', '2005-08-01T12:48:55', '2005-08-10T16:11:55', '1'), - ('182', '2139', '2006-02-16T02:30:53', '2005-08-19T18:18:44', '2005-08-20T12:33:44', '1'), - ('457', '618', '2006-02-16T02:30:53', '2005-08-21T09:25:13', '2005-08-27T11:48:13', '1'), - ('407', '3848', '2006-02-16T02:30:53', '2005-08-02T18:20:52', '2005-08-07T17:06:52', '1'), - ('464', '22', '2006-02-16T02:30:53', '2005-08-20T17:31:18', '2005-08-24T11:33:18', '1'), - ('452', '2507', '2006-02-16T02:30:53', '2005-07-06T19:39:14', '2005-07-11T17:45:14', '1'), - ('286', '2481', '2006-02-16T02:30:53', '2005-07-28T04:39:09', '2005-08-05T03:15:09', '1'), - ('305', '275', '2006-02-16T02:30:53', '2005-07-30T09:25:56', '2005-08-03T03:36:56', '1'), - ('494', '752', '2006-02-16T02:30:53', '2005-07-06T20:11:00', '2005-07-08T14:42:00', '1'), - ('290', '3793', '2006-02-16T02:30:53', '2005-06-16T00:41:31', '2005-06-20T21:36:31', '1'), - ('61', '1449', '2006-02-16T02:30:53', '2005-05-31T22:47:45', '2005-06-02T18:01:45', '1'), - ('383', '490', '2006-02-16T02:30:53', '2005-06-18T03:44:50', '2005-06-23T00:28:50', '1'), - ('323', '4265', '2006-02-16T02:30:53', '2005-05-30T05:49:13', '2005-06-07T04:35:13', '1'), - ('560', '1504', '2006-02-16T02:30:53', '2005-08-02T16:53:20', '2005-08-11T20:47:20', '1'), - ('382', '1891', '2006-02-16T02:30:53', '2005-07-30T04:51:25', '2005-08-01T01:04:25', '1'), - ('57', '2622', '2006-02-16T02:30:53', '2005-05-26T00:41:10', '2005-06-03T06:05:10', '1'), - ('288', '588', '2006-02-16T02:30:53', '2005-08-19T21:07:59', '2005-08-21T17:08:59', '1'), - ('180', '4344', '2006-02-16T02:30:53', '2005-07-08T21:55:25', '2005-07-16T16:52:25', '1'), - ('18', '1922', '2006-02-16T02:30:53', '2005-07-08T10:15:38', '2005-07-16T05:06:38', '1'), - ('144', '39', '2006-02-16T02:30:53', '2005-06-16T21:15:22', '2005-06-23T17:00:22', '1'), - ('330', '1306', '2006-02-16T02:30:53', '2005-07-06T12:49:28', '2005-07-09T16:29:28', '1'), - ('177', '3082', '2006-02-16T02:30:53', '2005-08-01T18:44:36', '2005-08-03T13:17:36', '1'), - ('214', '2953', '2006-02-16T02:30:53', '2005-08-01T20:02:01', '2005-08-03T14:20:01', '1'), - ('479', '3058', '2006-02-16T02:30:53', '2005-07-28T10:49:27', '2005-08-02T06:46:27', '1'), - ('400', '2997', '2006-02-16T02:30:53', '2005-08-16T23:30:07', '2005-08-25T17:35:07', '1'), - ('96', '2626', '2006-02-16T02:30:53', '2005-06-20T07:59:27', '2005-06-24T12:31:27', '1'), - ('250', '1731', '2006-02-16T02:30:53', '2005-05-29T00:32:09', '2005-05-31T23:53:09', '1'), - ('212', '1083', '2006-02-16T02:30:53', '2005-08-21T20:25:13', '2005-08-30T19:48:13', '1'), - ('8', '4054', '2006-02-16T02:30:53', '2005-07-07T00:09:02', '2005-07-08T04:27:02', '1'), - ('488', '456', '2006-02-16T02:30:53', '2005-07-30T08:14:27', '2005-08-07T14:02:27', '1'), - ('408', '1063', '2006-02-16T02:30:53', '2005-08-18T13:01:08', '2005-08-21T13:12:08', '1'), - ('108', '1740', '2006-02-16T02:30:53', '2005-08-20T11:18:08', '2005-08-22T11:55:08', '1'), - ('89', '2775', '2006-02-16T02:30:53', '2005-07-28T15:11:27', '2005-08-04T18:35:27', '1'), - ('113', '3111', '2006-02-16T02:30:53', '2005-08-01T00:00:44', '2005-08-04T19:33:44', '1'), - ('58', '4000', '2006-02-16T02:30:53', '2005-07-31T19:39:38', '2005-08-05T22:49:38', '1'), - ('215', '2125', '2006-02-16T02:30:53', '2005-07-11T00:02:19', '2005-07-18T23:08:19', '1'), - ('226', '1516', '2006-02-16T02:30:53', '2005-07-09T20:47:36', '2005-07-12T01:36:36', '1'), - ('460', '1749', '2006-02-16T02:30:53', '2005-08-19T20:18:53', '2005-08-27T14:36:53', '1'), - ('177', '1176', '2006-02-16T02:30:53', '2005-08-21T00:21:29', '2005-08-22T04:01:29', '1'), - ('144', '4327', '2006-02-16T02:30:53', '2005-06-17T07:49:17', '2005-06-20T03:47:17', '1'), - ('190', '3758', '2006-02-16T02:30:53', '2005-08-20T22:40:47', '2005-08-24T01:47:47', '1'), - ('566', '2933', '2006-02-16T02:30:53', '2005-07-31T14:52:26', '2005-08-03T11:53:26', '1'), - ('158', '3597', '2006-02-16T02:30:53', '2005-07-28T05:03:32', '2005-07-29T10:20:32', '1'), - ('327', '2964', '2006-02-16T02:30:53', '2005-07-27T18:36:17', '2005-07-31T22:43:17', '1'), - ('80', '1332', '2006-02-16T02:30:53', '2005-07-29T09:38:19', '2005-08-04T11:45:19', '1'), - ('150', '1544', '2006-02-16T02:30:53', '2005-08-19T11:31:41', '2005-08-27T16:05:41', '1'), - ('171', '868', '2006-02-16T02:30:53', '2005-07-12T15:56:08', '2005-07-13T18:42:08', '1'), - ('235', '1143', '2006-02-16T02:30:53', '2005-07-11T20:34:13', '2005-07-13T19:49:13', '1'), - ('83', '1779', '2006-02-16T02:30:53', '2005-08-02T19:25:13', '2005-08-06T17:12:13', '1'), - ('89', '1606', '2006-02-16T02:30:53', '2005-07-28T17:26:56', '2005-08-01T17:33:56', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['7529', '7429', '11371', '2298', '15890', '2658', '1299', '4700', '6184', '11147', '2908', '4299', '11525', '2194', '15193', '7691', '622', '10435', '7446', '11240', '11309', '15792', '4259', '4903', '14676', '4707', '14976', '3199', '6830', '6728', '12070', '5535', '2932', '16029', '12450', '5479', '15946', '4445', '15616', '9991', '10968', '11090', '13977', '12589', '9142', '9401', '9671', '4331', '12053', '12705', '9165', '15104', '6703', '1580', '13108', '10918', '1754', '9341', '15707', '15487', '14590', '8884', '12918', '3506', '2079', '12885', '12533', '1727', '11546', '6657', '13405', '11702', '2799', '1273', '12949', '9405', '11553', '1436', '1917', '4338', '6416', '11835', '15598', '8601', '5659', '14906', '1387', '12289', '2437', '10045', '10768', '8378', '14017', '8948', '5516', '15875', '6725', '639', '5288', '4536']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('145', '3644', '2006-02-16T02:30:53', '2005-07-27T21:18:08', '2005-08-06T00:59:08', '1'), - ('515', '2160', '2006-02-16T02:30:53', '2005-07-27T17:24:50', '2005-08-05T23:02:50', '1'), - ('561', '324', '2006-02-16T02:30:53', '2005-08-02T18:07:36', '2005-08-06T17:52:36', '1'), - ('497', '1227', '2006-02-16T02:30:53', '2005-06-18T08:18:29', '2005-06-24T11:51:29', '1'), - ('87', '3625', '2006-02-16T02:30:53', '2005-08-23T16:58:12', '2005-08-24T12:23:12', '1'), - ('156', '3281', '2006-02-16T02:30:53', '2005-06-19T10:43:42', '2005-06-24T16:23:42', '1'), - ('91', '1584', '2006-02-16T02:30:53', '2005-06-15T09:34:50', '2005-06-21T12:07:50', '1'), - ('317', '3889', '2006-02-16T02:30:53', '2005-07-08T11:37:21', '2005-07-12T15:41:21', '1'), - ('146', '1131', '2006-02-16T02:30:53', '2005-07-11T11:19:21', '2005-07-19T07:35:21', '1'), - ('597', '1562', '2006-02-16T02:30:53', '2005-08-02T09:45:54', '2005-08-07T07:28:54', '1'), - ('91', '517', '2006-02-16T02:30:53', '2005-06-20T03:16:52', '2005-06-22T08:46:52', '1'), - ('80', '870', '2006-02-16T02:30:53', '2005-07-07T16:33:48', '2005-07-16T11:48:48', '1'), - ('174', '1107', '2006-02-16T02:30:53', '2005-08-17T00:15:31', '2005-08-20T21:14:31', '1'), - ('149', '1827', '2006-02-16T02:30:53', '2005-06-18T01:41:37', '2005-06-25T04:27:37', '1'), - ('40', '1033', '2006-02-16T02:30:53', '2005-08-22T16:06:49', '2005-08-25T17:23:49', '1'), - ('112', '1579', '2006-02-16T02:30:53', '2005-07-28T03:30:09', '2005-07-29T21:31:09', '1'), - ('109', '2363', '2006-02-16T02:30:53', '2005-05-28T15:58:22', '2005-06-04T10:13:22', '1'), - ('392', '1934', '2006-02-16T02:30:53', '2005-08-01T08:50:51', '2005-08-08T12:23:51', '1'), - ('486', '2337', '2006-02-16T02:30:53', '2005-07-27T18:00:24', '2005-07-29T13:40:24', '1'), - ('597', '2170', '2006-02-16T02:30:53', '2005-08-02T13:28:30', '2005-08-05T11:40:30', '1'), - ('275', '607', '2006-02-16T02:30:53', '2005-08-02T15:50:55', '2005-08-09T18:28:55', '1'), - ('581', '2175', '2006-02-16T02:30:53', '2005-08-23T14:05:37', '2005-08-28T10:54:37', '1'), - ('467', '4378', '2006-02-16T02:30:53', '2005-07-07T14:22:18', '2005-07-11T19:38:18', '1'), - ('132', '1769', '2006-02-16T02:30:53', '2005-07-08T20:50:05', '2005-07-13T15:27:05', '1'), - ('49', '877', '2006-02-16T02:30:53', '2005-08-21T20:02:18', '2005-08-26T21:55:18', '1'), - ('286', '52', '2006-02-16T02:30:53', '2005-07-08T11:57:28', '2005-07-10T17:47:28', '1'), - ('581', '77', '2006-02-16T02:30:53', '2005-08-22T07:10:26', '2005-08-28T07:22:26', '1'), - ('234', '3824', '2006-02-16T02:30:53', '2005-06-21T00:12:40', '2005-06-27T23:26:40', '1'), - ('578', '1943', '2006-02-16T02:30:53', '2005-07-12T18:42:55', '2005-07-17T17:58:55', '1'), - ('414', '2113', '2006-02-16T02:30:53', '2005-07-12T13:56:48', '2005-07-15T18:49:48', '1'), - ('158', '1357', '2006-02-16T02:30:53', '2005-08-17T21:46:47', '2005-08-22T22:59:47', '1'), - ('394', '1623', '2006-02-16T02:30:53', '2005-07-10T02:27:42', '2005-07-12T21:13:42', '1'), - ('526', '4418', '2006-02-16T02:30:53', '2005-06-20T04:51:19', '2005-06-29T08:31:19', '1'), - ('143', '953', '2006-02-16T02:30:53', '2005-08-23T21:54:02', '2005-08-29T23:55:02', '1'), - ('518', '3439', '2006-02-16T02:30:53', '2005-08-18T11:04:04', '2005-08-22T07:24:04', '1'), - ('250', '216', '2006-02-16T02:30:53', '2005-07-09T23:47:33', '2005-07-13T01:09:33', '1'), - ('561', '4549', '2006-02-16T02:30:53', '2005-08-23T18:54:07', '2005-08-28T21:21:07', '1'), - ('327', '3328', '2006-02-16T02:30:53', '2005-07-07T23:08:22', '2005-07-16T03:49:22', '1'), - ('70', '2947', '2006-02-16T02:30:53', '2005-08-23T07:06:38', '2005-08-30T04:16:38', '1'), - ('414', '3662', '2006-02-16T02:30:53', '2005-07-31T17:26:27', '2005-08-03T17:36:27', '1'), - ('234', '888', '2006-02-16T02:30:53', '2005-08-02T04:03:13', '2005-08-11T08:36:13', '1'), - ('89', '2743', '2006-02-16T02:30:53', '2005-08-02T07:56:40', '2005-08-10T07:58:40', '1'), - ('115', '1126', '2006-02-16T02:30:53', '2005-08-20T19:02:34', '2005-08-24T14:14:34', '1'), - ('275', '956', '2006-02-16T02:30:53', '2005-08-18T16:06:31', '2005-08-27T17:20:31', '1'), - ('486', '4467', '2006-02-16T02:30:53', '2005-07-30T10:21:03', '2005-08-04T15:14:03', '1'), - ('331', '2057', '2006-02-16T02:30:53', '2005-07-30T20:18:19', '2005-08-07T15:46:19', '1'), - ('133', '920', '2006-02-16T02:30:53', '2005-07-31T06:33:41', '2005-08-02T07:50:41', '1'), - ('535', '419', '2006-02-16T02:30:53', '2005-07-07T18:22:30', '2005-07-13T18:20:30', '1'), - ('280', '4448', '2006-02-16T02:30:53', '2005-08-17T20:57:27', '2005-08-20T19:51:27', '1'), - ('517', '2342', '2006-02-16T02:30:53', '2005-08-18T20:44:14', '2005-08-23T20:46:14', '1'), - ('291', '4034', '2006-02-16T02:30:53', '2005-07-30T11:24:28', '2005-08-03T09:38:28', '1'), - ('359', '4550', '2006-02-16T02:30:53', '2005-08-22T12:01:16', '2005-08-27T17:48:16', '1'), - ('470', '46', '2006-02-16T02:30:53', '2005-07-12T12:50:19', '2005-07-16T13:41:19', '1'), - ('87', '2479', '2006-02-16T02:30:53', '2005-06-16T04:12:25', '2005-06-20T06:53:25', '1'), - ('73', '3630', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('2', '3418', '2006-02-16T02:30:53', '2005-08-02T02:10:56', '2005-08-02T21:23:56', '1'), - ('25', '4106', '2006-02-16T02:30:53', '2005-06-16T17:13:23', '2005-06-22T20:46:23', '1'), - ('557', '894', '2006-02-16T02:30:53', '2005-07-30T18:07:58', '2005-08-01T17:43:58', '1'), - ('91', '3646', '2006-02-16T02:30:53', '2005-08-23T10:35:45', '2005-08-27T10:57:45', '1'), - ('469', '2636', '2006-02-16T02:30:53', '2005-08-23T02:05:51', '2005-08-25T04:45:51', '1'), - ('526', '2633', '2006-02-16T02:30:53', '2005-08-21T17:29:10', '2005-08-28T20:15:10', '1'), - ('80', '3050', '2006-02-16T02:30:53', '2005-07-30T00:26:22', '2005-08-05T03:24:22', '1'), - ('13', '972', '2006-02-16T02:30:53', '2005-08-19T04:31:36', '2005-08-25T05:50:36', '1'), - ('459', '19', '2006-02-16T02:30:53', '2005-07-06T00:22:29', '2005-07-07T22:15:29', '1'), - ('465', '3853', '2006-02-16T02:30:53', '2005-06-17T16:49:45', '2005-06-18T18:10:45', '1'), - ('185', '883', '2006-02-16T02:30:53', '2005-08-19T03:37:25', '2005-08-20T22:10:25', '1'), - ('331', '795', '2006-02-16T02:30:53', '2005-08-18T14:01:40', '2005-08-20T15:32:40', '1'), - ('457', '2951', '2006-02-16T02:30:53', '2005-06-16T15:21:47', '2005-06-17T14:12:47', '1'), - ('24', '2522', '2006-02-16T02:30:53', '2005-08-17T00:57:36', '2005-08-18T23:16:36', '1'), - ('553', '3697', '2006-02-16T02:30:53', '2005-07-12T11:11:36', '2005-07-16T15:56:36', '1'), - ('181', '1554', '2006-02-16T02:30:53', '2005-08-19T22:20:49', '2005-08-28T21:21:49', '1'), - ('526', '3286', '2006-02-16T02:30:53', '2005-08-17T07:18:56', '2005-08-24T06:33:56', '1'), - ('576', '4579', '2006-02-16T02:30:53', '2005-06-19T19:15:21', '2005-06-21T21:35:21', '1'), - ('530', '361', '2006-02-16T02:30:53', '2005-06-15T07:52:35', '2005-06-21T04:55:35', '1'), - ('279', '4209', '2006-02-16T02:30:53', '2005-08-19T05:55:52', '2005-08-23T00:01:52', '1'), - ('463', '1983', '2006-02-16T02:30:53', '2005-07-30T20:22:17', '2005-08-08T16:55:17', '1'), - ('360', '3317', '2006-02-16T02:30:53', '2005-08-17T01:04:31', '2005-08-24T00:44:31', '1'), - ('584', '924', '2006-02-16T02:30:53', '2005-06-15T18:35:40', '2005-06-21T15:04:40', '1'), - ('400', '2667', '2006-02-16T02:30:53', '2005-06-17T05:36:07', '2005-06-24T01:44:07', '1'), - ('581', '3152', '2006-02-16T02:30:53', '2005-07-07T18:39:56', '2005-07-12T21:03:56', '1'), - ('158', '1063', '2006-02-16T02:30:53', '2005-07-11T23:29:14', '2005-07-13T20:20:14', '1'), - ('479', '2796', '2006-02-16T02:30:53', '2005-08-17T13:03:13', '2005-08-19T10:50:13', '1'), - ('66', '2794', '2006-02-16T02:30:53', '2005-08-23T06:23:26', '2005-09-01T05:43:26', '1'), - ('181', '3247', '2006-02-16T02:30:53', '2005-07-29T13:03:31', '2005-08-06T16:32:31', '1'), - ('9', '4265', '2006-02-16T02:30:53', '2005-07-10T07:45:40', '2005-07-15T05:20:40', '1'), - ('366', '153', '2006-02-16T02:30:53', '2005-08-22T04:38:18', '2005-08-29T23:03:18', '1'), - ('278', '515', '2006-02-16T02:30:53', '2005-06-15T15:40:56', '2005-06-17T10:39:56', '1'), - ('575', '443', '2006-02-16T02:30:53', '2005-08-18T05:05:28', '2005-08-26T09:02:28', '1'), - ('454', '1799', '2006-02-16T02:30:53', '2005-06-18T18:30:26', '2005-06-21T18:36:26', '1'), - ('118', '58', '2006-02-16T02:30:53', '2005-07-31T19:04:35', '2005-08-07T16:53:35', '1'), - ('273', '454', '2006-02-16T02:30:53', '2005-08-01T20:39:32', '2005-08-10T19:41:32', '1'), - ('347', '3500', '2006-02-16T02:30:53', '2005-07-29T05:28:35', '2005-08-02T05:55:35', '1'), - ('230', '920', '2006-02-16T02:30:53', '2005-08-20T20:55:32', '2005-08-23T16:12:32', '1'), - ('597', '948', '2006-02-16T02:30:53', '2005-07-30T03:16:18', '2005-08-04T03:16:18', '1'), - ('581', '1902', '2006-02-16T02:30:53', '2005-07-10T01:13:52', '2005-07-15T22:56:52', '1'), - ('41', '3611', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('213', '831', '2006-02-16T02:30:53', '2005-07-12T13:47:17', '2005-07-17T13:31:17', '1'), - ('198', '4204', '2006-02-16T02:30:53', '2005-05-28T18:25:02', '2005-05-29T18:22:02', '1'), - ('120', '850', '2006-02-16T02:30:53', '2005-07-09T15:13:07', '2005-07-16T12:39:07', '1'), - ('26', '220', '2006-02-16T02:30:53', '2005-07-08T03:43:22', '2005-07-15T08:44:22', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['8881', '13421', '13599', '10730', '12629', '14928', '11965', '11875', '9218', '1343', '10953', '7637', '6937', '6061', '9009', '12292', '14393', '15770', '13561', '15892', '2833', '2005', '11340', '8008', '375', '4979', '2016', '1653', '9543', '7251', '12623', '15561', '12521', '13247', '13655', '13152', '9036', '11112', '1271', '5998', '13370', '5832', '15111', '12018', '3764', '15196', '13352', '8185', '9754', '14930', '15817', '14039', '16003', '4989', '6345', '2910', '12186', '2991', '1083', '525', '5391', '9907', '13617', '15258', '8393', '3832', '6464', '14911', '11439', '2364', '11857', '4333', '10525', '5029', '15401', '9502', '853', '9906', '12523', '915', '9943', '13450', '5235', '15876', '14560', '12055', '11764', '7421', '5565', '9098', '7363', '8032', '11372', '1327', '11863', '6418', '10748', '10738', '9043', '5408']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('118', '2012', '2006-02-16T02:30:53', '2005-07-30T00:22:31', '2005-08-04T19:10:31', '1'), - ('366', '9', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('150', '3333', '2006-02-16T02:30:53', '2005-08-20T06:00:03', '2005-08-29T07:56:03', '1'), - ('368', '1793', '2006-02-16T02:30:53', '2005-08-01T19:21:42', '2005-08-10T21:18:42', '1'), - ('459', '1705', '2006-02-16T02:30:53', '2005-08-18T17:40:33', '2005-08-26T21:09:33', '1'), - ('472', '4375', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('490', '194', '2006-02-16T02:30:53', '2005-08-17T17:39:45', '2005-08-19T12:05:45', '1'), - ('294', '1787', '2006-02-16T02:30:53', '2005-08-17T14:16:48', '2005-08-26T14:20:48', '1'), - ('172', '119', '2006-02-16T02:30:53', '2005-07-30T13:14:35', '2005-08-07T18:03:35', '1'), - ('416', '2393', '2006-02-16T02:30:53', '2005-06-15T12:27:19', '2005-06-21T16:57:19', '1'), - ('483', '1510', '2006-02-16T02:30:53', '2005-08-02T03:28:38', '2005-08-11T03:53:38', '1'), - ('91', '87', '2006-02-16T02:30:53', '2005-07-28T01:12:25', '2005-08-02T03:48:25', '1'), - ('592', '1768', '2006-02-16T02:30:53', '2005-07-26T23:15:50', '2005-07-27T19:14:50', '1'), - ('392', '1859', '2006-02-16T02:30:53', '2005-07-11T04:06:25', '2005-07-11T23:11:25', '1'), - ('166', '4136', '2006-02-16T02:30:53', '2005-07-30T05:12:01', '2005-08-07T10:58:01', '1'), - ('58', '1417', '2006-02-16T02:30:53', '2005-08-18T05:08:54', '2005-08-27T02:51:54', '1'), - ('368', '3937', '2006-02-16T02:30:53', '2005-08-21T10:22:51', '2005-08-29T08:28:51', '1'), - ('113', '1424', '2006-02-16T02:30:53', '2005-08-23T13:18:16', '2005-08-29T11:31:16', '1'), - ('530', '3202', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('174', '1365', '2006-02-16T02:30:53', '2005-08-23T17:01:00', '2005-08-28T12:50:00', '1'), - ('232', '1976', '2006-02-16T02:30:53', '2005-06-19T21:34:54', '2005-06-28T16:21:54', '1'), - ('234', '4177', '2006-02-16T02:30:53', '2005-06-17T11:44:54', '2005-06-19T10:53:54', '1'), - ('366', '1403', '2006-02-16T02:30:53', '2005-08-02T17:05:43', '2005-08-09T13:25:43', '1'), - ('41', '2093', '2006-02-16T02:30:53', '2005-07-28T15:25:55', '2005-08-04T13:16:55', '1'), - ('306', '1815', '2006-02-16T02:30:53', '2005-05-27T08:49:21', '2005-06-04T14:11:21', '1'), - ('204', '3447', '2006-02-16T02:30:53', '2005-07-09T00:24:34', '2005-07-12T20:04:34', '1'), - ('282', '4265', '2006-02-16T02:30:53', '2005-06-17T12:18:36', '2005-06-20T12:13:36', '1'), - ('517', '2294', '2006-02-16T02:30:53', '2005-06-16T09:34:45', '2005-06-18T09:13:45', '1'), - ('369', '956', '2006-02-16T02:30:53', '2005-07-31T01:43:34', '2005-08-01T06:49:34', '1'), - ('360', '1737', '2006-02-16T02:30:53', '2005-07-27T10:44:55', '2005-08-01T16:12:55', '1'), - ('177', '3670', '2006-02-16T02:30:53', '2005-08-18T17:34:19', '2005-08-20T21:30:19', '1'), - ('469', '68', '2006-02-16T02:30:53', '2005-08-23T05:02:31', '2005-09-01T02:51:31', '1'), - ('369', '1022', '2006-02-16T02:30:53', '2005-08-18T13:43:07', '2005-08-21T07:53:07', '1'), - ('24', '1271', '2006-02-16T02:30:53', '2005-08-19T16:45:59', '2005-08-25T15:25:59', '1'), - ('207', '4294', '2006-02-16T02:30:53', '2005-08-20T07:59:13', '2005-08-22T12:04:13', '1'), - ('597', '3571', '2006-02-16T02:30:53', '2005-08-19T13:09:32', '2005-08-25T14:47:32', '1'), - ('18', '790', '2006-02-16T02:30:53', '2005-07-30T06:18:38', '2005-07-31T01:22:38', '1'), - ('207', '526', '2006-02-16T02:30:53', '2005-08-02T08:25:14', '2005-08-03T08:41:14', '1'), - ('560', '379', '2006-02-16T02:30:53', '2005-06-15T07:32:24', '2005-06-21T05:12:24', '1'), - ('250', '1458', '2006-02-16T02:30:53', '2005-07-11T01:20:46', '2005-07-15T21:41:46', '1'), - ('101', '239', '2006-02-16T02:30:53', '2005-08-19T21:20:11', '2005-08-25T22:51:11', '1'), - ('63', '2387', '2006-02-16T02:30:53', '2005-07-10T16:34:48', '2005-07-17T17:25:48', '1'), - ('119', '4101', '2006-02-16T02:30:53', '2005-08-22T12:21:43', '2005-08-24T09:31:43', '1'), - ('319', '1921', '2006-02-16T02:30:53', '2005-08-17T19:44:46', '2005-08-26T20:24:46', '1'), - ('470', '3115', '2006-02-16T02:30:53', '2005-07-06T13:01:03', '2005-07-13T15:26:03', '1'), - ('181', '1413', '2006-02-16T02:30:53', '2005-08-22T16:11:32', '2005-08-30T22:06:32', '1'), - ('80', '2689', '2006-02-16T02:30:53', '2005-08-19T20:51:40', '2005-08-24T01:22:40', '1'), - ('568', '2452', '2006-02-16T02:30:53', '2005-07-28T22:23:49', '2005-07-31T00:07:49', '1'), - ('479', '3751', '2006-02-16T02:30:53', '2005-07-31T09:23:43', '2005-08-08T06:04:43', '1'), - ('584', '2875', '2006-02-16T02:30:53', '2005-08-22T05:38:32', '2005-08-30T07:21:32', '1'), - ('348', '598', '2006-02-16T02:30:53', '2005-08-23T14:59:51', '2005-08-25T15:27:51', '1'), - ('383', '4187', '2006-02-16T02:30:53', '2005-08-20T21:39:43', '2005-08-24T19:03:43', '1'), - ('577', '3413', '2006-02-16T02:30:53', '2005-08-23T20:47:28', '2005-08-31T23:22:28', '1'), - ('210', '3326', '2006-02-16T02:30:53', '2005-07-09T00:46:56', '2005-07-17T06:24:56', '1'), - ('532', '4332', '2006-02-16T02:30:53', '2005-07-11T20:05:18', '2005-07-20T17:28:18', '1'), - ('57', '630', '2006-02-16T02:30:53', '2005-06-20T03:31:18', '2005-06-28T00:35:18', '1'), - ('312', '1342', '2006-02-16T02:30:53', '2005-08-18T01:43:36', '2005-08-23T07:13:36', '1'), - ('472', '4308', '2006-02-16T02:30:53', '2005-06-20T09:10:43', '2005-06-23T13:04:43', '1'), - ('556', '2393', '2006-02-16T02:30:53', '2005-05-31T11:04:48', '2005-06-05T13:32:48', '1'), - ('14', '1817', '2006-02-16T02:30:53', '2005-05-28T04:25:33', '2005-06-06T04:18:33', '1'), - ('132', '402', '2006-02-16T02:30:53', '2005-07-09T19:28:34', '2005-07-18T01:07:34', '1'), - ('120', '4282', '2006-02-16T02:30:53', '2005-07-31T14:39:50', '2005-08-09T09:39:50', '1'), - ('526', '4059', '2006-02-16T02:30:53', '2005-08-20T06:35:30', '2005-08-29T09:03:30', '1'), - ('293', '788', '2006-02-16T02:30:53', '2005-08-22T18:22:44', '2005-08-25T16:54:44', '1'), - ('504', '3369', '2006-02-16T02:30:53', '2005-07-29T06:02:11', '2005-08-07T03:23:11', '1'), - ('233', '4499', '2006-02-16T02:30:53', '2005-07-06T16:12:23', '2005-07-12T21:29:23', '1'), - ('303', '3100', '2006-02-16T02:30:53', '2005-07-12T01:16:40', '2005-07-20T00:53:40', '1'), - ('273', '353', '2006-02-16T02:30:53', '2005-08-22T04:51:42', '2005-08-28T05:37:42', '1'), - ('18', '2897', '2006-02-16T02:30:53', '2005-08-02T20:22:45', '2005-08-04T18:30:45', '1'), - ('512', '2856', '2006-02-16T02:30:53', '2005-06-18T13:37:32', '2005-06-23T14:18:32', '1'), - ('146', '101', '2006-02-16T02:30:53', '2005-08-17T13:48:30', '2005-08-18T15:55:30', '1'), - ('113', '76', '2006-02-16T02:30:53', '2005-07-07T18:31:50', '2005-07-08T21:26:50', '1'), - ('36', '3811', '2006-02-16T02:30:53', '2005-08-01T11:53:17', '2005-08-07T07:24:17', '1'), - ('265', '3938', '2006-02-16T02:30:53', '2005-07-09T02:35:32', '2005-07-17T22:46:32', '1'), - ('103', '1721', '2006-02-16T02:30:53', '2005-08-22T23:13:10', '2005-09-01T03:44:10', '1'), - ('471', '2700', '2006-02-16T02:30:53', '2005-07-31T00:02:10', '2005-08-01T19:47:10', '1'), - ('122', '3693', '2006-02-16T02:30:53', '2005-05-30T01:43:31', '2005-06-01T02:05:31', '1'), - ('204', '4241', '2006-02-16T02:30:53', '2005-07-31T14:38:12', '2005-08-01T13:56:12', '1'), - ('230', '888', '2006-02-16T02:30:53', '2005-08-18T13:45:41', '2005-08-27T10:46:41', '1'), - ('115', '1859', '2006-02-16T02:30:53', '2005-05-30T11:20:27', '2005-06-02T11:55:27', '1'), - ('494', '887', '2006-02-16T02:30:53', '2005-07-31T15:37:29', '2005-08-09T18:25:29', '1'), - ('61', '135', '2006-02-16T02:30:53', '2005-08-20T00:18:15', '2005-08-24T19:36:15', '1'), - ('122', '1044', '2006-02-16T02:30:53', '2005-07-09T12:54:25', '2005-07-18T16:28:25', '1'), - ('87', '1735', '2006-02-16T02:30:53', '2005-08-23T16:32:10', '2005-08-24T18:16:10', '1'), - ('579', '1616', '2006-02-16T02:30:53', '2005-08-21T16:13:47', '2005-08-26T15:19:47', '1'), - ('35', '1481', '2006-02-16T02:30:53', '2005-08-17T21:02:19', '2005-08-18T15:24:19', '1'), - ('252', '4502', '2006-02-16T02:30:53', '2005-08-17T09:51:54', '2005-08-20T07:11:54', '1'), - ('70', '3548', '2006-02-16T02:30:53', '2005-07-27T17:10:05', '2005-08-05T17:55:05', '1'), - ('14', '3368', '2006-02-16T02:30:53', '2005-07-10T03:29:48', '2005-07-17T04:43:48', '1'), - ('144', '1267', '2006-02-16T02:30:53', '2005-07-30T08:44:21', '2005-08-08T12:31:21', '1'), - ('407', '1649', '2006-02-16T02:30:53', '2005-07-27T14:58:29', '2005-08-05T09:02:29', '1'), - ('230', '431', '2006-02-16T02:30:53', '2005-07-28T16:17:00', '2005-07-29T13:32:00', '1'), - ('327', '796', '2006-02-16T02:30:53', '2005-08-02T18:10:50', '2005-08-07T17:58:50', '1'), - ('539', '403', '2006-02-16T02:30:53', '2005-06-15T11:11:39', '2005-06-22T10:45:39', '1'), - ('112', '1003', '2006-02-16T02:30:53', '2005-08-17T13:56:01', '2005-08-23T18:38:01', '1'), - ('185', '3101', '2006-02-16T02:30:53', '2005-07-11T23:36:27', '2005-07-16T18:42:27', '1'), - ('181', '3769', '2006-02-16T02:30:53', '2005-08-01T20:01:24', '2005-08-05T19:55:24', '1'), - ('377', '544', '2006-02-16T02:30:53', '2005-08-01T19:39:08', '2005-08-10T20:37:08', '1'), - ('9', '4127', '2006-02-16T02:30:53', '2005-07-30T06:34:07', '2005-08-02T01:16:07', '1'), - ('144', '3162', '2006-02-16T02:30:53', '2005-07-09T20:16:51', '2005-07-18T22:19:51', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['8809', '4684', '13705', '16001', '15306', '9726', '8667', '8043', '14587', '6304', '7587', '2173', '9634', '2663', '8005', '3031', '772', '8709', '10168', '14280', '4768', '11390', '6572', '1371', '12355', '15992', '13539', '10644', '10410', '13089', '9268', '15481', '4438', '4131', '15859', '12946', '2593', '12942', '1542', '13088', '7944', '897', '10282', '7901', '13714', '9330', '12984', '7917', '10005', '4529', '13326', '10622', '3792', '4051', '5200', '250', '2597', '6618', '6132', '4721', '1075', '13137', '2718', '3507', '10549', '7567', '3903', '15452', '6165', '2213', '11050', '6647', '12229', '6065', '361', '3601', '15499', '128', '6674', '3675', '14866', '15145', '7966', '7031', '7286', '13142', '15600', '12023', '6514', '9820', '15080', '6', '7052', '4600', '15640', '6776', '15326', '6759', '9404', '10922']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('8', '3278', '2006-02-16T02:30:53', '2005-07-29T21:42:49', '2005-08-04T01:13:49', '1'), - ('585', '503', '2006-02-16T02:30:53', '2005-07-08T10:41:06', '2005-07-17T10:35:06', '1'), - ('451', '3663', '2006-02-16T02:30:53', '2005-08-20T09:32:23', '2005-08-21T13:51:23', '1'), - ('108', '245', '2006-02-16T02:30:53', '2005-08-23T20:45:53', '2005-08-27T15:52:53', '1'), - ('340', '521', '2006-02-16T02:30:53', '2005-08-22T19:46:36', '2005-08-27T14:09:36', '1'), - ('162', '1701', '2006-02-16T02:30:53', '2005-07-31T08:37:07', '2005-08-09T06:09:07', '1'), - ('25', '3439', '2006-02-16T02:30:53', '2005-07-29T15:40:57', '2005-07-31T20:59:57', '1'), - ('577', '208', '2006-02-16T02:30:53', '2005-07-28T16:45:44', '2005-08-01T12:26:44', '1'), - ('250', '2329', '2006-02-16T02:30:53', '2005-08-21T17:20:55', '2005-08-26T17:17:55', '1'), - ('579', '4183', '2006-02-16T02:30:53', '2005-07-11T18:02:16', '2005-07-14T14:01:16', '1'), - ('113', '655', '2006-02-16T02:30:53', '2005-07-27T23:23:03', '2005-08-01T17:34:03', '1'), - ('65', '995', '2006-02-16T02:30:53', '2005-06-18T00:08:20', '2005-06-25T05:30:20', '1'), - ('444', '924', '2006-02-16T02:30:53', '2005-07-31T05:06:02', '2005-08-04T06:53:02', '1'), - ('583', '1012', '2006-02-16T02:30:53', '2005-06-19T10:54:00', '2005-06-20T16:48:00', '1'), - ('488', '670', '2006-02-16T02:30:53', '2005-07-28T15:15:11', '2005-07-29T14:54:11', '1'), - ('491', '1184', '2006-02-16T02:30:53', '2005-06-20T11:52:49', '2005-06-22T07:00:49', '1'), - ('556', '3319', '2006-02-16T02:30:53', '2005-05-29T13:08:06', '2005-06-06T08:19:06', '1'), - ('199', '902', '2006-02-16T02:30:53', '2005-07-29T17:25:54', '2005-08-02T22:35:54', '1'), - ('570', '4548', '2006-02-16T02:30:53', '2005-07-31T23:25:24', '2005-08-02T19:03:24', '1'), - ('481', '1561', '2006-02-16T02:30:53', '2005-08-21T06:39:58', '2005-08-23T04:50:58', '1'), - ('482', '2787', '2006-02-16T02:30:53', '2005-07-08T15:28:20', '2005-07-09T11:46:20', '1'), - ('294', '3135', '2006-02-16T02:30:53', '2005-08-02T18:39:16', '2005-08-04T21:43:16', '1'), - ('35', '3121', '2006-02-16T02:30:53', '2005-07-12T05:56:38', '2005-07-16T10:41:38', '1'), - ('491', '760', '2006-02-16T02:30:53', '2005-06-15T14:38:15', '2005-06-23T15:36:15', '1'), - ('452', '4112', '2006-02-16T02:30:53', '2005-08-18T07:36:23', '2005-08-20T08:59:23', '1'), - ('589', '3334', '2006-02-16T02:30:53', '2005-08-23T20:28:32', '2005-08-24T21:35:32', '1'), - ('518', '3110', '2006-02-16T02:30:53', '2005-08-20T03:40:27', '2005-08-27T07:15:27', '1'), - ('7', '4374', '2006-02-16T02:30:53', '2005-08-01T15:52:00', '2005-08-08T16:08:00', '1'), - ('247', '3901', '2006-02-16T02:30:53', '2005-08-01T07:53:29', '2005-08-10T08:56:29', '1'), - ('63', '1783', '2006-02-16T02:30:53', '2005-08-19T10:38:56', '2005-08-24T12:41:56', '1'), - ('592', '3593', '2006-02-16T02:30:53', '2005-07-30T15:02:30', '2005-08-05T12:50:30', '1'), - ('414', '3262', '2006-02-16T02:30:53', '2005-08-23T01:59:14', '2005-08-27T04:38:14', '1'), - ('104', '4371', '2006-02-16T02:30:53', '2005-07-07T22:56:17', '2005-07-16T17:28:17', '1'), - ('58', '2621', '2006-02-16T02:30:53', '2005-07-07T07:53:18', '2005-07-08T04:48:18', '1'), - ('465', '4269', '2006-02-16T02:30:53', '2005-08-23T16:08:15', '2005-08-28T11:08:15', '1'), - ('444', '2066', '2006-02-16T02:30:53', '2005-08-19T05:53:34', '2005-08-20T07:30:34', '1'), - ('556', '2031', '2006-02-16T02:30:53', '2005-06-19T05:40:11', '2005-06-28T08:11:11', '1'), - ('103', '3938', '2006-02-16T02:30:53', '2005-08-19T05:40:36', '2005-08-27T02:04:36', '1'), - ('182', '1714', '2006-02-16T02:30:53', '2005-06-16T01:20:05', '2005-06-22T03:59:05', '1'), - ('457', '4281', '2006-02-16T02:30:53', '2005-08-19T10:36:11', '2005-08-21T09:12:11', '1'), - ('504', '3148', '2006-02-16T02:30:53', '2005-07-28T12:51:22', '2005-07-30T12:19:22', '1'), - ('432', '1334', '2006-02-16T02:30:53', '2005-05-30T09:10:01', '2005-06-08T03:43:01', '1'), - ('472', '617', '2006-02-16T02:30:53', '2005-08-01T03:29:10', '2005-08-07T06:16:10', '1'), - ('280', '4435', '2006-02-16T02:30:53', '2005-07-28T11:12:12', '2005-08-01T08:13:12', '1'), - ('277', '2659', '2006-02-16T02:30:53', '2005-08-20T09:41:09', '2005-08-22T06:28:09', '1'), - ('232', '4227', '2006-02-16T02:30:53', '2005-07-30T17:44:24', '2005-08-08T17:39:24', '1'), - ('537', '4211', '2006-02-16T02:30:53', '2005-08-19T07:06:51', '2005-08-22T04:04:51', '1'), - ('416', '2071', '2006-02-16T02:30:53', '2005-07-28T11:56:57', '2005-07-29T14:06:57', '1'), - ('454', '928', '2006-02-16T02:30:53', '2005-07-31T17:53:51', '2005-08-09T21:39:51', '1'), - ('104', '1361', '2006-02-16T02:30:53', '2005-07-08T03:26:20', '2005-07-16T05:04:20', '1'), - ('576', '429', '2006-02-16T02:30:53', '2005-08-19T19:52:52', '2005-08-20T18:56:52', '1'), - ('171', '3044', '2006-02-16T02:30:53', '2005-08-01T15:12:00', '2005-08-08T14:09:00', '1'), - ('312', '2651', '2006-02-16T02:30:53', '2005-07-06T14:26:38', '2005-07-11T16:34:38', '1'), - ('331', '2715', '2006-02-16T02:30:53', '2005-07-07T03:37:28', '2005-07-09T01:40:28', '1'), - ('125', '4528', '2006-02-16T02:30:53', '2005-07-09T10:52:09', '2005-07-13T15:12:09', '1'), - ('539', '368', '2006-02-16T02:30:53', '2005-05-26T14:30:24', '2005-05-27T08:50:24', '1'), - ('407', '2278', '2006-02-16T02:30:53', '2005-06-19T05:53:46', '2005-06-20T05:14:46', '1'), - ('327', '4266', '2006-02-16T02:30:53', '2005-07-12T08:41:42', '2005-07-14T05:34:42', '1'), - ('319', '3229', '2006-02-16T02:30:53', '2005-07-11T08:24:44', '2005-07-13T06:41:44', '1'), - ('234', '3105', '2006-02-16T02:30:53', '2005-07-08T12:39:31', '2005-07-15T18:07:31', '1'), - ('9', '2279', '2006-02-16T02:30:53', '2005-05-31T10:13:34', '2005-06-09T08:11:34', '1'), - ('20', '4431', '2006-02-16T02:30:53', '2005-08-19T12:26:32', '2005-08-22T13:26:32', '1'), - ('139', '4443', '2006-02-16T02:30:53', '2005-06-19T14:49:42', '2005-06-26T19:37:42', '1'), - ('480', '166', '2006-02-16T02:30:53', '2005-07-06T00:23:43', '2005-07-15T04:19:43', '1'), - ('61', '3719', '2006-02-16T02:30:53', '2005-08-01T12:46:39', '2005-08-06T17:17:39', '1'), - ('504', '1066', '2006-02-16T02:30:53', '2005-07-27T22:38:05', '2005-07-30T17:20:05', '1'), - ('369', '3614', '2006-02-16T02:30:53', '2005-07-06T19:27:32', '2005-07-08T23:27:32', '1'), - ('115', '717', '2006-02-16T02:30:53', '2005-08-23T00:57:12', '2005-08-28T00:19:12', '1'), - ('9', '3540', '2006-02-16T02:30:53', '2005-07-11T10:17:29', '2005-07-17T07:27:29', '1'), - ('98', '949', '2006-02-16T02:30:53', '2005-06-18T02:36:47', '2005-06-23T05:02:47', '1'), - ('234', '2077', '2006-02-16T02:30:53', '2005-08-02T06:17:16', '2005-08-09T05:58:16', '1'), - ('8', '1841', '2006-02-16T02:30:53', '2005-07-12T10:43:53', '2005-07-14T05:37:53', '1'), - ('382', '1123', '2006-02-16T02:30:53', '2005-08-18T03:08:23', '2005-08-22T03:42:23', '1'), - ('562', '1007', '2006-02-16T02:30:53', '2005-07-11T04:25:51', '2005-07-17T08:19:51', '1'), - ('587', '6', '2006-02-16T02:30:53', '2005-05-27T07:03:28', '2005-05-31T08:01:28', '1'), - ('205', '2806', '2006-02-16T02:30:53', '2005-07-06T05:20:25', '2005-07-15T03:13:25', '1'), - ('488', '630', '2006-02-16T02:30:53', '2005-08-23T02:37:19', '2005-08-23T20:57:19', '1'), - ('40', '4322', '2006-02-16T02:30:53', '2005-05-25T21:19:53', '2005-05-29T23:34:53', '1'), - ('399', '2385', '2006-02-16T02:30:53', '2005-07-12T11:51:54', '2005-07-13T16:57:54', '1'), - ('282', '3662', '2006-02-16T02:30:53', '2005-07-06T09:09:19', '2005-07-12T08:51:19', '1'), - ('445', '2607', '2006-02-16T02:30:53', '2005-08-22T03:11:35', '2005-08-30T00:10:35', '1'), - ('2', '2179', '2006-02-16T02:30:53', '2005-08-22T13:53:04', '2005-08-31T15:51:04', '1'), - ('91', '2514', '2006-02-16T02:30:53', '2005-07-28T13:53:54', '2005-08-06T15:32:54', '1'), - ('530', '1435', '2006-02-16T02:30:53', '2005-07-27T03:02:07', '2005-08-02T07:14:07', '1'), - ('498', '3452', '2006-02-16T02:30:53', '2005-07-27T12:23:49', '2005-08-04T07:57:49', '1'), - ('269', '1404', '2006-02-16T02:30:53', '2005-08-19T12:42:28', '2005-08-26T14:52:28', '1'), - ('113', '2260', '2006-02-16T02:30:53', '2005-08-23T06:31:24', '2005-08-28T06:53:24', '1'), - ('22', '247', '2006-02-16T02:30:53', '2005-08-17T19:54:54', '2005-08-26T23:03:54', '1'), - ('73', '3562', '2006-02-16T02:30:53', '2005-07-12T03:47:44', '2005-07-20T00:11:44', '1'), - ('279', '499', '2006-02-16T02:30:53', '2005-07-31T11:46:57', '2005-08-08T13:35:57', '1'), - ('133', '927', '2006-02-16T02:30:53', '2005-08-22T11:11:51', '2005-08-23T13:09:51', '1'), - ('549', '2792', '2006-02-16T02:30:53', '2005-05-24T23:08:07', '2005-05-27T01:32:07', '1'), - ('75', '3798', '2006-02-16T02:30:53', '2005-07-27T03:36:38', '2005-08-03T21:51:38', '1'), - ('457', '1526', '2006-02-16T02:30:53', '2005-07-08T06:48:37', '2005-07-15T10:11:37', '1'), - ('262', '3505', '2006-02-16T02:30:53', '2005-08-23T08:04:40', '2005-08-24T06:38:40', '1'), - ('348', '2398', '2006-02-16T02:30:53', '2005-07-12T16:02:09', '2005-07-20T16:31:09', '1'), - ('58', '3320', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('49', '3624', '2006-02-16T02:30:53', '2005-07-12T15:14:48', '2005-07-15T11:29:48', '1'), - ('140', '3832', '2006-02-16T02:30:53', '2005-07-30T20:21:35', '2005-08-02T15:52:35', '1'), - ('539', '4522', '2006-02-16T02:30:53', '2005-08-02T02:14:40', '2005-08-06T06:04:40', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['7254', '2579', '7627', '12786', '2258', '13592', '3649', '13661', '14616', '5489', '9856', '15917', '5041', '2559', '4585', '3623', '4330', '10031', '14147', '3886', '11226', '4035', '9060', '2205', '13292', '8833', '747', '12981', '12319', '14565', '10994', '9590', '12879', '6804', '5619', '14206', '59', '2304', '596', '11094', '15341', '10912', '153', '12149', '10876', '5030', '8060', '14547', '4880', '764', '202', '15497', '5965', '11861', '7311', '2154', '10136', '10063', '4307', '14351', '3184', '7825', '14653', '1399', '2675', '11410', '15914', '11950', '7197', '1810', '3757', '4263', '4240', '3823', '10399', '7961', '2608', '1512', '12408', '4213', '10819', '800', '10996', '4720', '3761', '7890', '14895', '6506', '3859', '7519', '2482', '10042', '11667', '5664', '2541', '14822', '660', '11610', '529', '13785']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('286', '2697', '2006-02-16T02:30:53', '2005-07-27T10:48:50', '2005-07-28T10:34:50', '1'), - ('493', '3836', '2006-02-16T02:30:53', '2005-06-19T04:40:44', '2005-06-22T09:22:44', '1'), - ('52', '782', '2006-02-16T02:30:53', '2005-07-28T00:56:47', '2005-08-02T04:16:47', '1'), - ('512', '97', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('292', '4573', '2006-02-16T02:30:53', '2005-06-18T05:30:36', '2005-06-24T09:09:36', '1'), - ('470', '1509', '2006-02-16T02:30:53', '2005-08-20T05:50:35', '2005-08-23T04:52:35', '1'), - ('24', '3564', '2006-02-16T02:30:53', '2005-07-06T07:32:42', '2005-07-12T09:37:42', '1'), - ('471', '3996', '2006-02-16T02:30:53', '2005-08-20T08:05:59', '2005-08-29T12:15:59', '1'), - ('532', '4537', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('490', '2319', '2006-02-16T02:30:53', '2005-07-10T00:07:03', '2005-07-15T19:52:03', '1'), - ('347', '723', '2006-02-16T02:30:53', '2005-07-31T13:00:35', '2005-08-07T18:07:35', '1'), - ('589', '2093', '2006-02-16T02:30:53', '2005-08-23T17:57:28', '2005-08-29T20:03:28', '1'), - ('305', '2711', '2006-02-16T02:30:53', '2005-07-09T03:18:51', '2005-07-13T03:08:51', '1'), - ('414', '4433', '2006-02-16T02:30:53', '2005-06-19T03:09:46', '2005-06-28T07:49:46', '1'), - ('143', '1622', '2006-02-16T02:30:53', '2005-07-08T06:11:58', '2005-07-17T01:58:58', '1'), - ('80', '430', '2006-02-16T02:30:53', '2005-07-06T06:05:23', '2005-07-07T05:59:23', '1'), - ('408', '2408', '2006-02-16T02:30:53', '2005-07-07T18:09:41', '2005-07-14T22:05:41', '1'), - ('96', '3048', '2006-02-16T02:30:53', '2005-07-31T18:40:15', '2005-08-03T14:38:15', '1'), - ('366', '1476', '2006-02-16T02:30:53', '2005-08-21T02:14:03', '2005-08-27T22:38:03', '1'), - ('326', '2368', '2006-02-16T02:30:53', '2005-07-06T18:44:24', '2005-07-08T15:11:24', '1'), - ('282', '79', '2006-02-16T02:30:53', '2005-08-02T12:47:30', '2005-08-06T11:24:30', '1'), - ('539', '3611', '2006-02-16T02:30:53', '2005-07-07T02:45:02', '2005-07-14T01:41:02', '1'), - ('87', '4360', '2006-02-16T02:30:53', '2005-07-30T07:20:36', '2005-08-03T10:51:36', '1'), - ('593', '1245', '2006-02-16T02:30:53', '2005-06-18T02:14:34', '2005-06-25T05:11:34', '1'), - ('171', '1336', '2006-02-16T02:30:53', '2005-08-19T18:35:32', '2005-08-22T00:27:32', '1'), - ('101', '1741', '2006-02-16T02:30:53', '2005-07-29T22:39:36', '2005-08-05T21:19:36', '1'), - ('291', '1993', '2006-02-16T02:30:53', '2005-05-29T09:26:34', '2005-06-05T07:28:34', '1'), - ('481', '3925', '2006-02-16T02:30:53', '2005-08-19T07:04:00', '2005-08-21T09:17:00', '1'), - ('368', '999', '2006-02-16T02:30:53', '2005-08-18T06:26:45', '2005-08-23T01:35:45', '1'), - ('250', '4160', '2006-02-16T02:30:53', '2005-08-21T16:24:45', '2005-08-25T14:42:45', '1'), - ('323', '647', '2006-02-16T02:30:53', '2005-08-02T04:46:53', '2005-08-11T10:30:53', '1'), - ('585', '2293', '2006-02-16T02:30:53', '2005-07-31T03:17:16', '2005-08-08T04:24:16', '1'), - ('210', '3556', '2006-02-16T02:30:53', '2005-08-19T03:22:55', '2005-08-24T22:00:55', '1'), - ('269', '1554', '2006-02-16T02:30:53', '2005-07-12T17:22:06', '2005-07-21T11:37:06', '1'), - ('204', '113', '2006-02-16T02:30:53', '2005-07-10T05:29:33', '2005-07-15T00:40:33', '1'), - ('279', '860', '2006-02-16T02:30:53', '2005-08-21T03:59:26', '2005-08-26T03:52:26', '1'), - ('408', '2884', '2006-02-16T02:30:53', '2005-05-25T08:56:42', '2005-06-01T09:52:42', '1'), - ('327', '3543', '2006-02-16T02:30:53', '2005-06-18T08:30:15', '2005-06-23T06:17:15', '1'), - ('589', '821', '2006-02-16T02:30:53', '2005-05-28T14:00:03', '2005-05-29T17:10:03', '1'), - ('18', '3095', '2006-02-16T02:30:53', '2005-08-02T08:03:02', '2005-08-03T11:34:02', '1'), - ('91', '3359', '2006-02-16T02:30:53', '2005-08-22T20:56:31', '2005-08-30T17:25:31', '1'), - ('477', '732', '2006-02-16T02:30:53', '2005-08-02T02:00:03', '2005-08-06T05:55:03', '1'), - ('348', '3888', '2006-02-16T02:30:53', '2005-05-26T00:47:47', '2005-05-27T21:28:47', '1'), - ('277', '3696', '2006-02-16T02:30:53', '2005-08-18T00:13:51', '2005-08-26T19:47:51', '1'), - ('559', '2161', '2006-02-16T02:30:53', '2005-08-02T00:31:58', '2005-08-05T21:45:58', '1'), - ('497', '25', '2006-02-16T02:30:53', '2005-07-09T02:35:43', '2005-07-17T02:05:43', '1'), - ('577', '3765', '2006-02-16T02:30:53', '2005-07-28T17:10:02', '2005-08-05T17:11:02', '1'), - ('265', '1172', '2006-02-16T02:30:53', '2005-08-21T15:51:38', '2005-08-26T15:35:38', '1'), - ('269', '4178', '2006-02-16T02:30:53', '2005-07-08T19:36:17', '2005-07-13T00:01:17', '1'), - ('149', '1069', '2006-02-16T02:30:53', '2005-05-29T11:37:35', '2005-05-31T16:47:35', '1'), - ('20', '674', '2006-02-16T02:30:53', '2005-05-26T07:27:36', '2005-06-02T03:52:36', '1'), - ('107', '363', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('348', '4476', '2006-02-16T02:30:53', '2005-07-10T23:51:52', '2005-07-11T23:29:52', '1'), - ('232', '2674', '2006-02-16T02:30:53', '2005-08-17T13:53:47', '2005-08-21T16:07:47', '1'), - ('582', '2807', '2006-02-16T02:30:53', '2005-07-27T13:02:54', '2005-08-04T09:52:54', '1'), - ('30', '1655', '2006-02-16T02:30:53', '2005-06-17T22:59:42', '2005-06-24T04:11:42', '1'), - ('2', '3142', '2006-02-16T02:30:53', '2005-07-31T21:58:56', '2005-08-03T19:44:56', '1'), - ('517', '3003', '2006-02-16T02:30:53', '2005-07-31T19:25:13', '2005-08-09T15:55:13', '1'), - ('394', '2827', '2006-02-16T02:30:53', '2005-07-07T17:20:39', '2005-07-16T14:42:39', '1'), - ('66', '2037', '2006-02-16T02:30:53', '2005-08-21T09:04:20', '2005-08-25T05:27:20', '1'), - ('457', '3179', '2006-02-16T02:30:53', '2005-06-20T22:57:44', '2005-06-29T20:57:44', '1'), - ('348', '4340', '2006-02-16T02:30:53', '2005-07-28T08:34:57', '2005-08-06T02:45:57', '1'), - ('593', '491', '2006-02-16T02:30:53', '2005-08-21T19:35:59', '2005-08-24T15:31:59', '1'), - ('469', '1435', '2006-02-16T02:30:53', '2005-06-15T16:29:51', '2005-06-18T14:06:51', '1'), - ('230', '3078', '2006-02-16T02:30:53', '2005-06-19T11:52:15', '2005-06-23T16:45:15', '1'), - ('592', '692', '2006-02-16T02:30:53', '2005-08-02T19:29:01', '2005-08-11T16:50:01', '1'), - ('557', '747', '2006-02-16T02:30:53', '2005-08-23T17:49:26', '2005-08-24T12:20:26', '1'), - ('190', '4412', '2006-02-16T02:30:53', '2005-08-17T17:13:16', '2005-08-26T21:25:16', '1'), - ('577', '2109', '2006-02-16T02:30:53', '2005-07-27T08:49:32', '2005-07-31T13:50:32', '1'), - ('7', '2368', '2006-02-16T02:30:53', '2005-06-16T21:06:00', '2005-06-21T21:24:00', '1'), - ('66', '2816', '2006-02-16T02:30:53', '2005-07-06T12:42:26', '2005-07-11T10:30:26', '1'), - ('16', '2975', '2006-02-16T02:30:53', '2005-07-07T14:24:44', '2005-07-13T18:22:44', '1'), - ('65', '1024', '2006-02-16T02:30:53', '2005-07-07T13:33:12', '2005-07-13T12:28:12', '1'), - ('265', '124', '2006-02-16T02:30:53', '2005-07-06T15:41:27', '2005-07-09T09:48:27', '1'), - ('204', '2515', '2006-02-16T02:30:53', '2005-08-01T07:13:39', '2005-08-10T06:56:39', '1'), - ('45', '3284', '2006-02-16T02:30:53', '2005-07-28T13:47:21', '2005-08-01T09:33:21', '1'), - ('132', '1618', '2006-02-16T02:30:53', '2005-06-19T07:10:36', '2005-06-24T13:09:36', '1'), - ('452', '1628', '2006-02-16T02:30:53', '2005-06-15T22:53:03', '2005-06-23T18:56:03', '1'), - ('143', '2360', '2006-02-16T02:30:53', '2005-08-18T09:40:38', '2005-08-19T04:45:38', '1'), - ('103', '705', '2006-02-16T02:30:53', '2005-07-07T11:53:49', '2005-07-13T07:51:49', '1'), - ('308', '983', '2006-02-16T02:30:53', '2005-08-01T22:52:57', '2005-08-06T00:08:57', '1'), - ('472', '441', '2006-02-16T02:30:53', '2005-05-29T17:28:12', '2005-05-30T14:59:12', '1'), - ('26', '2235', '2006-02-16T02:30:53', '2005-08-02T04:48:11', '2005-08-06T08:00:11', '1'), - ('452', '2669', '2006-02-16T02:30:53', '2005-07-08T12:34:34', '2005-07-09T10:28:34', '1'), - ('464', '4304', '2006-02-16T02:30:53', '2005-07-06T12:52:44', '2005-07-08T17:22:44', '1'), - ('553', '3443', '2006-02-16T02:30:53', '2005-07-28T10:43:40', '2005-07-31T06:07:40', '1'), - ('340', '4462', '2006-02-16T02:30:53', '2005-08-22T04:19:23', '2005-08-27T04:02:23', '1'), - ('423', '386', '2006-02-16T02:30:53', '2005-07-12T03:28:22', '2005-07-17T22:43:22', '1'), - ('553', '2548', '2006-02-16T02:30:53', '2005-07-06T17:18:15', '2005-07-09T16:48:15', '1'), - ('124', '4009', '2006-02-16T02:30:53', '2005-07-27T21:01:41', '2005-08-05T19:15:41', '1'), - ('122', '452', '2006-02-16T02:30:53', '2005-06-18T21:10:44', '2005-06-19T20:39:44', '1'), - ('204', '123', '2006-02-16T02:30:53', '2005-07-31T19:01:25', '2005-08-06T14:21:25', '1'), - ('582', '1516', '2006-02-16T02:30:53', '2005-08-17T05:46:55', '2005-08-26T08:19:55', '1'), - ('469', '2375', '2006-02-16T02:30:53', '2005-07-10T08:04:41', '2005-07-17T10:29:41', '1'), - ('360', '129', '2006-02-16T02:30:53', '2005-06-19T02:08:10', '2005-06-23T23:32:10', '1'), - ('52', '2835', '2006-02-16T02:30:53', '2005-08-22T01:21:14', '2005-08-30T03:59:14', '1'), - ('578', '1414', '2006-02-16T02:30:53', '2005-05-28T20:53:31', '2005-05-30T15:26:31', '1'), - ('275', '3048', '2006-02-16T02:30:53', '2005-08-17T03:43:37', '2005-08-20T22:14:37', '1'), - ('469', '2624', '2006-02-16T02:30:53', '2005-05-28T04:34:17', '2005-05-30T00:35:17', '1'), - ('453', '379', '2006-02-16T02:30:53', '2005-08-20T12:11:46', '2005-08-21T06:39:46', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['8316', '8018', '14527', '5884', '7139', '9006', '7414', '8916', '13311', '3492', '5319', '14320', '3917', '12932', '12641', '4911', '8199', '2183', '15416', '2514', '4917', '10000', '13765', '4939', '6534', '950', '15498', '11914', '6866', '6882', '11530', '15259', '14340', '4053', '6225', '9278', '6542', '10423', '13831', '6656', '13883', '14557', '10874', '9230', '13662', '12220', '4124', '14597', '13150', '13642', '12254', '1077', '5187', '4346', '9504', '2730', '11509', '8744', '3414', '3370', '10259', '10470', '7916', '2583', '2890', '11534', '14969', '13192', '4407', '5267', '15902', '1239', '11071', '15383', '4613', '12228', '13316', '4662', '3115', '10733', '13877', '12656', '15026', '9134', '3122', '9362', '7081', '15761', '6650', '4780', '10825', '10118', '12607', '11840', '9693', '3875', '4065', '15885', '7059', '12453']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('549', '4118', '2006-02-16T02:30:53', '2005-07-29T03:38:49', '2005-08-03T07:41:49', '1'), - ('377', '4129', '2006-02-16T02:30:53', '2005-07-28T15:36:48', '2005-08-06T20:04:48', '1'), - ('232', '3496', '2006-02-16T02:30:53', '2005-08-21T15:07:42', '2005-08-23T12:31:42', '1'), - ('498', '916', '2006-02-16T02:30:53', '2005-07-10T19:31:38', '2005-07-11T20:30:38', '1'), - ('575', '846', '2006-02-16T02:30:53', '2005-07-27T06:52:21', '2005-07-30T01:45:21', '1'), - ('49', '3315', '2006-02-16T02:30:53', '2005-07-30T05:06:32', '2005-07-31T08:24:32', '1'), - ('265', '3276', '2006-02-16T02:30:53', '2005-07-27T16:46:07', '2005-08-02T20:04:07', '1'), - ('377', '3852', '2006-02-16T02:30:53', '2005-07-30T01:42:21', '2005-08-03T05:28:21', '1'), - ('520', '3890', '2006-02-16T02:30:53', '2005-08-19T19:07:09', '2005-08-20T23:07:09', '1'), - ('142', '980', '2006-02-16T02:30:53', '2005-07-05T23:44:37', '2005-07-14T03:54:37', '1'), - ('282', '1899', '2006-02-16T02:30:53', '2005-07-09T16:17:44', '2005-07-18T16:35:44', '1'), - ('199', '3121', '2006-02-16T02:30:53', '2005-08-21T08:04:40', '2005-08-22T02:09:40', '1'), - ('471', '2747', '2006-02-16T02:30:53', '2005-07-06T20:19:29', '2005-07-11T00:49:29', '1'), - ('416', '2295', '2006-02-16T02:30:53', '2005-08-19T05:17:30', '2005-08-21T09:24:30', '1'), - ('467', '776', '2006-02-16T02:30:53', '2005-08-18T18:18:08', '2005-08-19T23:17:08', '1'), - ('66', '4479', '2006-02-16T02:30:53', '2005-07-08T21:20:26', '2005-07-15T03:11:26', '1'), - ('471', '404', '2006-02-16T02:30:53', '2005-07-28T23:10:25', '2005-08-04T23:30:25', '1'), - ('340', '1776', '2006-02-16T02:30:53', '2005-06-18T01:06:01', '2005-06-22T01:20:01', '1'), - ('383', '1167', '2006-02-16T02:30:53', '2005-08-22T23:51:23', '2005-08-29T20:03:23', '1'), - ('382', '2559', '2006-02-16T02:30:53', '2005-06-18T23:56:44', '2005-06-23T21:10:44', '1'), - ('104', '3231', '2006-02-16T02:30:53', '2005-07-08T21:32:30', '2005-07-09T15:34:30', '1'), - ('576', '3221', '2006-02-16T02:30:53', '2005-07-31T17:41:05', '2005-08-02T20:51:05', '1'), - ('219', '2104', '2006-02-16T02:30:53', '2005-08-20T11:39:00', '2005-08-21T06:05:00', '1'), - ('425', '3201', '2006-02-16T02:30:53', '2005-07-08T22:35:30', '2005-07-17T22:05:30', '1'), - ('577', '2359', '2006-02-16T02:30:53', '2005-07-12T04:39:43', '2005-07-16T06:33:43', '1'), - ('83', '491', '2006-02-16T02:30:53', '2005-05-30T16:06:08', '2005-06-01T11:43:08', '1'), - ('83', '1583', '2006-02-16T02:30:53', '2005-08-23T02:33:27', '2005-08-23T22:30:27', '1'), - ('230', '1634', '2006-02-16T02:30:53', '2005-08-17T16:04:42', '2005-08-22T19:29:42', '1'), - ('312', '2481', '2006-02-16T02:30:53', '2005-07-12T20:03:44', '2005-07-15T01:55:44', '1'), - ('166', '2469', '2006-02-16T02:30:53', '2005-07-12T20:50:39', '2005-07-14T21:01:39', '1'), - ('400', '365', '2006-02-16T02:30:53', '2005-08-17T00:29:00', '2005-08-22T03:22:00', '1'), - ('488', '3261', '2006-02-16T02:30:53', '2005-08-22T18:23:23', '2005-08-27T13:06:23', '1'), - ('230', '2181', '2006-02-16T02:30:53', '2005-08-21T08:38:21', '2005-08-25T09:25:21', '1'), - ('377', '2889', '2006-02-16T02:30:53', '2005-07-07T03:39:22', '2005-07-09T22:32:22', '1'), - ('204', '2483', '2006-02-16T02:30:53', '2005-07-11T13:45:14', '2005-07-14T10:23:14', '1'), - ('581', '3782', '2006-02-16T02:30:53', '2005-07-30T15:15:19', '2005-08-03T20:21:19', '1'), - ('359', '2421', '2006-02-16T02:30:53', '2005-07-12T04:53:49', '2005-07-13T01:48:49', '1'), - ('7', '739', '2006-02-16T02:30:53', '2005-08-01T08:19:53', '2005-08-08T10:25:53', '1'), - ('480', '570', '2006-02-16T02:30:53', '2005-08-20T13:59:35', '2005-08-24T12:50:35', '1'), - ('330', '2282', '2006-02-16T02:30:53', '2005-07-12T11:09:47', '2005-07-14T05:50:47', '1'), - ('568', '584', '2006-02-16T02:30:53', '2005-08-20T15:28:53', '2005-08-21T13:11:53', '1'), - ('490', '483', '2006-02-16T02:30:53', '2005-08-21T16:05:11', '2005-08-27T16:37:11', '1'), - ('230', '2552', '2006-02-16T02:30:53', '2005-08-02T00:31:00', '2005-08-07T05:04:00', '1'), - ('109', '1199', '2006-02-16T02:30:53', '2005-07-30T13:39:42', '2005-07-31T19:20:42', '1'), - ('592', '3880', '2006-02-16T02:30:53', '2005-08-20T08:11:58', '2005-08-26T13:34:58', '1'), - ('530', '982', '2006-02-16T02:30:53', '2005-08-18T02:50:02', '2005-08-22T00:20:02', '1'), - ('330', '2856', '2006-02-16T02:30:53', '2005-07-07T07:19:54', '2005-07-11T05:54:54', '1'), - ('472', '1160', '2006-02-16T02:30:53', '2005-08-21T17:39:41', '2005-08-25T14:07:41', '1'), - ('457', '1514', '2006-02-16T02:30:53', '2005-08-19T13:08:19', '2005-08-25T18:00:19', '1'), - ('452', '4415', '2006-02-16T02:30:53', '2005-08-20T07:42:17', '2005-08-29T10:49:17', '1'), - ('6', '2858', '2006-02-16T02:30:53', '2005-08-18T04:05:29', '2005-08-23T04:17:29', '1'), - ('24', '1986', '2006-02-16T02:30:53', '2005-05-31T10:22:54', '2005-06-02T12:21:54', '1'), - ('91', '2631', '2006-02-16T02:30:53', '2005-07-09T10:19:51', '2005-07-14T10:35:51', '1'), - ('520', '1906', '2006-02-16T02:30:53', '2005-07-07T18:58:45', '2005-07-10T16:37:45', '1'), - ('125', '91', '2006-02-16T02:30:53', '2005-07-31T00:09:07', '2005-08-02T05:44:07', '1'), - ('30', '1264', '2006-02-16T02:30:53', '2005-06-19T15:10:09', '2005-06-28T13:05:09', '1'), - ('273', '2750', '2006-02-16T02:30:53', '2005-08-16T23:29:53', '2005-08-19T02:09:53', '1'), - ('280', '1086', '2006-02-16T02:30:53', '2005-07-29T18:58:24', '2005-08-05T17:56:24', '1'), - ('226', '2929', '2006-02-16T02:30:53', '2005-06-21T16:58:50', '2005-06-24T17:26:50', '1'), - ('559', '1573', '2006-02-16T02:30:53', '2005-06-21T13:27:01', '2005-06-25T09:27:01', '1'), - ('566', '1881', '2006-02-16T02:30:53', '2005-08-01T02:52:05', '2005-08-03T20:54:05', '1'), - ('523', '82', '2006-02-16T02:30:53', '2005-08-01T09:52:26', '2005-08-05T06:52:26', '1'), - ('13', '3877', '2006-02-16T02:30:53', '2005-07-28T11:49:53', '2005-07-29T15:01:53', '1'), - ('523', '3999', '2006-02-16T02:30:53', '2005-06-19T05:01:40', '2005-06-28T00:04:40', '1'), - ('392', '3437', '2006-02-16T02:30:53', '2005-06-20T02:00:45', '2005-06-27T21:12:45', '1'), - ('144', '2414', '2006-02-16T02:30:53', '2005-08-17T00:35:27', '2005-08-24T01:36:27', '1'), - ('120', '4060', '2006-02-16T02:30:53', '2005-08-22T06:49:15', '2005-08-29T05:52:15', '1'), - ('532', '966', '2006-02-16T02:30:53', '2005-08-19T14:30:06', '2005-08-27T15:20:06', '1'), - ('20', '267', '2006-02-16T02:30:53', '2005-07-07T21:39:45', '2005-07-11T23:40:45', '1'), - ('233', '2242', '2006-02-16T02:30:53', '2005-07-09T14:21:10', '2005-07-15T12:02:10', '1'), - ('172', '4500', '2006-02-16T02:30:53', '2005-08-23T17:28:03', '2005-08-30T18:36:03', '1'), - ('444', '3731', '2006-02-16T02:30:53', '2005-06-15T04:53:01', '2005-06-16T07:03:01', '1'), - ('294', '4264', '2006-02-16T02:30:53', '2005-08-02T07:10:53', '2005-08-07T09:58:53', '1'), - ('405', '686', '2006-02-16T02:30:53', '2005-08-22T22:31:20', '2005-08-28T17:43:20', '1'), - ('581', '476', '2006-02-16T02:30:53', '2005-07-08T07:44:49', '2005-07-09T04:47:49', '1'), - ('9', '2772', '2006-02-16T02:30:53', '2005-08-18T03:08:10', '2005-08-20T02:48:10', '1'), - ('10', '4450', '2006-02-16T02:30:53', '2005-08-19T19:23:30', '2005-08-22T23:37:30', '1'), - ('553', '1370', '2006-02-16T02:30:53', '2005-07-08T09:58:54', '2005-07-10T12:51:54', '1'), - ('457', '2193', '2006-02-16T02:30:53', '2005-06-20T17:59:05', '2005-06-26T13:28:05', '1'), - ('560', '3980', '2006-02-16T02:30:53', '2005-08-01T19:28:01', '2005-08-09T18:41:01', '1'), - ('5', '3387', '2006-02-16T02:30:53', '2005-08-20T15:16:18', '2005-08-22T18:20:18', '1'), - ('286', '3981', '2006-02-16T02:30:53', '2005-08-18T18:58:35', '2005-08-21T00:41:35', '1'), - ('66', '4328', '2006-02-16T02:30:53', '2005-08-22T09:01:52', '2005-08-28T09:21:52', '1'), - ('559', '3797', '2006-02-16T02:30:53', '2005-07-30T10:00:21', '2005-08-01T05:01:21', '1'), - ('87', '2720', '2006-02-16T02:30:53', '2005-06-20T18:25:57', '2005-06-29T16:08:57', '1'), - ('420', '3357', '2006-02-16T02:30:53', '2005-07-30T18:44:16', '2005-08-01T20:14:16', '1'), - ('420', '462', '2006-02-16T02:30:53', '2005-07-27T04:25:59', '2005-08-01T00:14:59', '1'), - ('416', '4362', '2006-02-16T02:30:53', '2005-08-23T12:55:51', '2005-08-26T16:51:51', '1'), - ('526', '1589', '2006-02-16T02:30:53', '2005-07-12T10:57:10', '2005-07-14T07:24:10', '1'), - ('115', '2740', '2006-02-16T02:30:53', '2005-07-08T16:06:51', '2005-07-13T18:34:51', '1'), - ('587', '4386', '2006-02-16T02:30:53', '2005-08-01T23:05:33', '2005-08-04T04:33:33', '1'), - ('143', '1209', '2006-02-16T02:30:53', '2005-07-31T21:16:31', '2005-08-03T02:32:31', '1'), - ('526', '2130', '2006-02-16T02:30:53', '2005-08-18T17:03:49', '2005-08-19T18:29:49', '1'), - ('491', '1824', '2006-02-16T02:30:53', '2005-08-17T13:09:01', '2005-08-19T17:42:01', '1'), - ('273', '1031', '2006-02-16T02:30:53', '2005-07-31T07:11:50', '2005-08-08T09:55:50', '1'), - ('108', '712', '2006-02-16T02:30:53', '2005-07-06T18:15:39', '2005-07-11T17:34:39', '1'), - ('26', '1339', '2006-02-16T02:30:53', '2005-07-07T04:32:28', '2005-07-12T08:30:28', '1'), - ('565', '2116', '2006-02-16T02:30:53', '2005-08-23T16:50:43', '2005-08-29T20:19:43', '1'), - ('578', '129', '2006-02-16T02:30:53', '2005-07-27T03:51:02', '2005-08-02T22:04:02', '1'), - ('104', '2487', '2006-02-16T02:30:53', '2005-08-18T11:17:07', '2005-08-25T12:34:07', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['9194', '7588', '1793', '10602', '14677', '4750', '1122', '2605', '1044', '5590', '13158', '7217', '11588', '13763', '235', '1055', '6309', '6203', '2599', '6519', '11850', '7169', '3647', '11817', '15320', '7117', '4984', '7677', '916', '595', '6900', '4821', '3503', '7795', '11600', '1513', '3419', '815', '14732', '4511', '3612', '3158', '9797', '4797', '8260', '408', '13301', '14500', '15671', '3201', '6133', '13795', '7854', '8367', '13215', '15374', '14552', '5377', '1841', '10992', '12184', '4859', '6652', '6172', '15845', '4324', '13349', '15287', '14946', '10674', '14345', '15433', '6645', '13025', '15685', '6412', '13398', '3659', '15332', '14756', '5636', '4669', '8241', '10974', '135', '15350', '216', '6234', '2860', '5546', '6611', '2402', '206', '6856', '10083', '8636', '8706', '6365', '7445', '3972']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('294', '2467', '2006-02-16T02:30:53', '2005-07-30T12:28:45', '2005-08-06T14:38:45', '1'), - ('360', '4033', '2006-02-16T02:30:53', '2005-07-27T23:23:31', '2005-08-04T02:54:31', '1'), - ('230', '4356', '2006-02-16T02:30:53', '2005-06-16T20:07:27', '2005-06-19T20:55:27', '1'), - ('111', '1506', '2006-02-16T02:30:53', '2005-08-01T14:30:23', '2005-08-07T15:20:23', '1'), - ('26', '4411', '2006-02-16T02:30:53', '2005-08-21T20:12:30', '2005-08-28T15:11:30', '1'), - ('198', '3383', '2006-02-16T02:30:53', '2005-07-08T14:07:03', '2005-07-13T18:05:03', '1'), - ('180', '1392', '2006-02-16T02:30:53', '2005-05-31T16:39:33', '2005-06-04T17:25:33', '1'), - ('38', '2342', '2006-02-16T02:30:53', '2005-06-19T06:48:01', '2005-06-25T07:00:01', '1'), - ('70', '2574', '2006-02-16T02:30:53', '2005-05-31T06:24:44', '2005-06-03T04:51:44', '1'), - ('407', '4442', '2006-02-16T02:30:53', '2005-07-10T04:23:11', '2005-07-19T09:03:11', '1'), - ('327', '944', '2006-02-16T02:30:53', '2005-08-19T13:18:10', '2005-08-25T09:27:10', '1'), - ('20', '2646', '2006-02-16T02:30:53', '2005-07-27T09:31:44', '2005-07-29T10:48:44', '1'), - ('565', '2480', '2006-02-16T02:30:53', '2005-08-17T02:26:23', '2005-08-22T02:32:23', '1'), - ('469', '4171', '2006-02-16T02:30:53', '2005-08-20T11:37:56', '2005-08-26T13:12:56', '1'), - ('119', '3537', '2006-02-16T02:30:53', '2005-05-26T11:51:09', '2005-06-04T09:36:09', '1'), - ('108', '1639', '2006-02-16T02:30:53', '2005-05-31T07:47:18', '2005-06-03T01:57:18', '1'), - ('232', '1054', '2006-02-16T02:30:53', '2005-07-11T18:13:24', '2005-07-13T23:11:24', '1'), - ('408', '1001', '2006-02-16T02:30:53', '2005-07-11T12:28:57', '2005-07-15T14:10:57', '1'), - ('171', '461', '2006-02-16T02:30:53', '2005-06-19T06:06:07', '2005-06-27T01:10:07', '1'), - ('598', '4149', '2006-02-16T02:30:53', '2005-07-12T04:00:36', '2005-07-19T01:15:36', '1'), - ('80', '1437', '2006-02-16T02:30:53', '2005-08-17T13:30:15', '2005-08-21T17:24:15', '1'), - ('559', '735', '2006-02-16T02:30:53', '2005-07-27T07:51:39', '2005-08-01T06:42:39', '1'), - ('145', '3762', '2006-02-16T02:30:53', '2005-07-06T07:29:17', '2005-07-13T08:32:17', '1'), - ('38', '2297', '2006-02-16T02:30:53', '2005-08-17T12:20:01', '2005-08-19T18:06:01', '1'), - ('407', '648', '2006-02-16T02:30:53', '2005-08-22T20:17:49', '2005-08-28T17:31:49', '1'), - ('326', '2772', '2006-02-16T02:30:53', '2005-07-27T05:48:36', '2005-08-01T00:33:36', '1'), - ('214', '1303', '2006-02-16T02:30:53', '2005-07-09T00:35:31', '2005-07-17T03:44:31', '1'), - ('566', '4464', '2006-02-16T02:30:53', '2005-07-28T02:56:37', '2005-07-31T02:21:37', '1'), - ('6', '1290', '2006-02-16T02:30:53', '2005-05-30T11:25:01', '2005-05-31T09:06:01', '1'), - ('294', '595', '2006-02-16T02:30:53', '2005-05-28T13:59:54', '2005-06-05T15:16:54', '1'), - ('292', '129', '2006-02-16T02:30:53', '2005-07-12T21:45:25', '2005-07-19T21:19:25', '1'), - ('172', '1690', '2006-02-16T02:30:53', '2005-07-08T17:28:08', '2005-07-11T17:44:08', '1'), - ('449', '2944', '2006-02-16T02:30:53', '2005-07-06T00:17:24', '2005-07-08T03:47:24', '1'), - ('38', '1278', '2006-02-16T02:30:53', '2005-07-28T07:28:16', '2005-07-31T12:03:16', '1'), - ('400', '1978', '2006-02-16T02:30:53', '2005-08-17T03:12:04', '2005-08-23T07:10:04', '1'), - ('368', '1173', '2006-02-16T02:30:53', '2005-06-15T22:53:30', '2005-06-23T01:00:30', '1'), - ('22', '4022', '2006-02-16T02:30:53', '2005-06-21T17:18:01', '2005-06-22T15:08:01', '1'), - ('14', '3757', '2006-02-16T02:30:53', '2005-05-29T20:24:28', '2005-06-03T15:32:28', '1'), - ('482', '1915', '2006-02-16T02:30:53', '2005-08-21T22:22:29', '2005-08-23T18:34:29', '1'), - ('75', '4438', '2006-02-16T02:30:53', '2005-07-08T02:36:21', '2005-07-15T06:01:21', '1'), - ('402', '2465', '2006-02-16T02:30:53', '2005-07-06T05:37:26', '2005-07-14T01:51:26', '1'), - ('592', '3461', '2006-02-16T02:30:53', '2005-06-20T21:08:19', '2005-06-29T18:59:19', '1'), - ('52', '687', '2006-02-16T02:30:53', '2005-07-31T10:53:44', '2005-08-09T05:51:44', '1'), - ('265', '1389', '2006-02-16T02:30:53', '2005-07-08T16:39:05', '2005-07-09T11:41:05', '1'), - ('366', '4249', '2006-02-16T02:30:53', '2005-07-29T01:11:00', '2005-08-06T00:36:00', '1'), - ('84', '1438', '2006-02-16T02:30:53', '2005-05-27T13:57:39', '2005-05-28T11:57:39', '1'), - ('494', '2261', '2006-02-16T02:30:53', '2005-08-19T18:53:15', '2005-08-26T21:37:15', '1'), - ('451', '2024', '2006-02-16T02:30:53', '2005-08-21T14:11:30', '2005-08-27T12:19:30', '1'), - ('112', '3716', '2006-02-16T02:30:53', '2005-08-23T09:08:16', '2005-08-29T14:01:16', '1'), - ('597', '6', '2006-02-16T02:30:53', '2005-06-21T00:30:26', '2005-06-28T03:42:26', '1'), - ('107', '1992', '2006-02-16T02:30:53', '2005-07-11T08:25:22', '2005-07-13T13:17:22', '1'), - ('331', '2837', '2006-02-16T02:30:53', '2005-08-20T12:32:09', '2005-08-21T17:28:09', '1'), - ('84', '3531', '2006-02-16T02:30:53', '2005-07-28T09:42:31', '2005-08-02T09:25:31', '1'), - ('383', '4551', '2006-02-16T02:30:53', '2005-07-29T05:11:19', '2005-08-02T00:35:19', '1'), - ('460', '3740', '2006-02-16T02:30:53', '2005-08-19T15:35:38', '2005-08-27T12:16:38', '1'), - ('8', '4275', '2006-02-16T02:30:53', '2005-08-22T22:09:09', '2005-08-31T01:10:09', '1'), - ('477', '1991', '2006-02-16T02:30:53', '2005-08-21T15:59:27', '2005-08-27T11:46:27', '1'), - ('578', '3118', '2006-02-16T02:30:53', '2005-07-09T19:04:30', '2005-07-11T14:42:30', '1'), - ('6', '2363', '2006-02-16T02:30:53', '2005-06-16T23:44:13', '2005-06-22T04:09:13', '1'), - ('180', '11', '2006-02-16T02:30:53', '2005-08-02T04:41:17', '2005-08-09T02:13:17', '1'), - ('51', '1723', '2006-02-16T02:30:53', '2005-08-18T01:36:00', '2005-08-21T01:59:00', '1'), - ('369', '1939', '2006-02-16T02:30:53', '2005-07-08T18:54:04', '2005-07-13T13:04:04', '1'), - ('518', '2200', '2006-02-16T02:30:53', '2005-07-12T10:59:38', '2005-07-13T13:52:38', '1'), - ('219', '3514', '2006-02-16T02:30:53', '2005-07-11T10:32:09', '2005-07-14T16:23:09', '1'), - ('89', '4312', '2006-02-16T02:30:53', '2005-08-23T15:38:34', '2005-08-25T10:06:34', '1'), - ('226', '952', '2006-02-16T02:30:53', '2005-07-07T17:57:56', '2005-07-13T22:34:56', '1'), - ('234', '4262', '2006-02-16T02:30:53', '2005-08-19T20:43:16', '2005-08-20T16:21:16', '1'), - ('535', '308', '2006-02-16T02:30:53', '2005-08-22T19:19:37', '2005-08-29T16:05:37', '1'), - ('308', '1395', '2006-02-16T02:30:53', '2005-08-22T06:07:10', '2005-08-28T05:25:10', '1'), - ('340', '1962', '2006-02-16T02:30:53', '2005-08-01T17:11:52', '2005-08-08T19:34:52', '1'), - ('598', '1726', '2006-02-16T02:30:53', '2005-08-21T08:41:15', '2005-08-24T11:59:15', '1'), - ('198', '155', '2006-02-16T02:30:53', '2005-08-23T00:27:18', '2005-08-26T21:36:18', '1'), - ('73', '2858', '2006-02-16T02:30:53', '2005-07-12T10:39:55', '2005-07-17T07:41:55', '1'), - ('269', '4066', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('491', '370', '2006-02-16T02:30:53', '2005-08-23T09:41:28', '2005-08-30T10:11:28', '1'), - ('220', '3797', '2006-02-16T02:30:53', '2005-07-11T23:19:21', '2005-07-16T19:48:21', '1'), - ('405', '3376', '2006-02-16T02:30:53', '2005-08-19T22:08:48', '2005-08-23T03:24:48', '1'), - ('330', '2271', '2006-02-16T02:30:53', '2005-07-06T08:03:14', '2005-07-12T09:50:14', '1'), - ('162', '3368', '2006-02-16T02:30:53', '2005-08-22T20:41:53', '2005-08-24T01:45:53', '1'), - ('288', '564', '2006-02-16T02:30:53', '2005-08-21T23:21:23', '2005-08-24T01:44:23', '1'), - ('2', '4116', '2006-02-16T02:30:53', '2005-07-10T06:31:24', '2005-07-13T02:36:24', '1'), - ('581', '3494', '2006-02-16T02:30:53', '2005-07-08T10:13:08', '2005-07-16T07:52:08', '1'), - ('26', '4297', '2006-02-16T02:30:53', '2005-07-29T00:33:36', '2005-08-03T01:31:36', '1'), - ('491', '690', '2006-02-16T02:30:53', '2005-08-02T04:10:52', '2005-08-09T08:26:52', '1'), - ('304', '103', '2006-02-16T02:30:53', '2005-05-25T21:58:58', '2005-06-03T17:50:58', '1'), - ('488', '1170', '2006-02-16T02:30:53', '2005-08-22T21:15:29', '2005-08-24T02:56:29', '1'), - ('91', '1398', '2006-02-16T02:30:53', '2005-05-26T09:17:43', '2005-06-03T08:21:43', '1'), - ('232', '2911', '2006-02-16T02:30:53', '2005-07-11T14:16:10', '2005-07-19T19:55:10', '1'), - ('107', '3045', '2006-02-16T02:30:53', '2005-06-19T23:20:40', '2005-06-21T04:59:40', '1'), - ('515', '2918', '2006-02-16T02:30:53', '2005-07-10T02:50:37', '2005-07-16T08:22:37', '1'), - ('286', '1604', '2006-02-16T02:30:53', '2005-07-12T08:20:23', '2005-07-16T07:19:23', '1'), - ('360', '2833', '2006-02-16T02:30:53', '2005-06-18T16:24:45', '2005-06-27T14:39:45', '1'), - ('345', '1717', '2006-02-16T02:30:53', '2005-05-26T08:01:54', '2005-05-27T06:26:54', '1'), - ('275', '4338', '2006-02-16T02:30:53', '2005-07-12T19:50:16', '2005-07-14T22:25:16', '1'), - ('449', '2585', '2006-02-16T02:30:53', '2005-07-31T20:10:19', '2005-08-06T23:18:19', '1'), - ('252', '4308', '2006-02-16T02:30:53', '2005-07-29T14:24:13', '2005-08-02T14:39:13', '1'), - ('515', '2886', '2006-02-16T02:30:53', '2005-07-29T17:19:15', '2005-08-03T22:52:15', '1'), - ('566', '4550', '2006-02-16T02:30:53', '2005-07-11T21:17:40', '2005-07-14T20:53:40', '1'), - ('394', '4115', '2006-02-16T02:30:53', '2005-07-27T17:57:15', '2005-07-31T20:24:15', '1'), - ('598', '1895', '2006-02-16T02:30:53', '2005-07-06T22:53:57', '2005-07-11T01:32:57', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['9844', '13222', '5006', '13845', '5431', '15862', '15395', '12385', '15628', '11517', '12003', '10797', '8711', '12211', '4181', '4230', '8557', '696', '2191', '936', '9511', '5198', '4343', '10105', '12416', '4610', '7508', '14134', '1800', '4815', '5190', '15469', '5710', '3050', '12834', '10800', '11899', '160', '6503', '8671', '9493', '10786', '9560', '6274', '11085', '7141', '5133', '6319', '10822', '15058', '11195', '9582', '5376', '690', '13342', '6485', '2231', '2938', '2246', '7647', '2902', '15554', '7373', '15972', '12962', '10665', '4370', '5927', '13875', '949', '9101', '48', '11142', '7968', '14504', '5007', '9580', '980', '10769', '9723', '10050', '3111', '3423', '5940', '3868', '5278', '8000', '3991', '15186', '8313', '15655', '10434', '14305', '9170', '7056', '13380', '12431', '11496', '14027', '7770']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('181', '3930', '2006-02-16T02:30:53', '2005-07-31T12:26:31', '2005-08-05T13:58:31', '1'), - ('91', '1656', '2006-02-16T02:30:53', '2005-08-19T15:47:58', '2005-08-26T12:43:58', '1'), - ('486', '1277', '2006-02-16T02:30:53', '2005-07-09T01:24:07', '2005-07-18T03:56:07', '1'), - ('559', '3993', '2006-02-16T02:30:53', '2005-08-20T14:31:21', '2005-08-29T18:29:21', '1'), - ('213', '2780', '2006-02-16T02:30:53', '2005-07-09T21:21:11', '2005-07-10T21:16:11', '1'), - ('215', '925', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('526', '2880', '2006-02-16T02:30:53', '2005-08-22T23:06:25', '2005-08-30T19:18:25', '1'), - ('146', '3143', '2006-02-16T02:30:53', '2005-08-18T08:39:33', '2005-08-21T14:22:33', '1'), - ('408', '1348', '2006-02-16T02:30:53', '2005-08-23T07:28:04', '2005-08-26T04:23:04', '1'), - ('280', '4266', '2006-02-16T02:30:53', '2005-08-16T23:56:28', '2005-08-21T22:40:28', '1'), - ('70', '3868', '2006-02-16T02:30:53', '2005-08-17T18:56:05', '2005-08-18T23:52:05', '1'), - ('308', '1731', '2006-02-16T02:30:53', '2005-08-01T22:02:51', '2005-08-03T23:07:51', '1'), - ('575', '3471', '2006-02-16T02:30:53', '2005-07-29T17:27:15', '2005-07-31T12:57:15', '1'), - ('19', '1484', '2006-02-16T02:30:53', '2005-08-18T02:31:18', '2005-08-26T02:36:18', '1'), - ('598', '3725', '2006-02-16T02:30:53', '2005-07-07T10:27:54', '2005-07-13T06:09:54', '1'), - ('205', '353', '2006-02-16T02:30:53', '2005-07-07T12:46:47', '2005-07-15T06:52:47', '1'), - ('459', '1481', '2006-02-16T02:30:53', '2005-07-29T11:19:59', '2005-08-07T12:50:59', '1'), - ('19', '2076', '2006-02-16T02:30:53', '2005-05-29T01:59:10', '2005-06-01T02:45:10', '1'), - ('58', '3369', '2006-02-16T02:30:53', '2005-06-18T01:33:09', '2005-06-19T20:18:09', '1'), - ('469', '901', '2006-02-16T02:30:53', '2005-05-30T13:52:49', '2005-06-07T16:56:49', '1'), - ('549', '964', '2006-02-16T02:30:53', '2005-07-31T00:25:05', '2005-08-09T02:46:05', '1'), - ('101', '218', '2006-02-16T02:30:53', '2005-07-09T10:49:10', '2005-07-13T04:52:10', '1'), - ('293', '1926', '2006-02-16T02:30:53', '2005-07-07T18:48:54', '2005-07-12T15:19:54', '1'), - ('286', '112', '2006-02-16T02:30:53', '2005-07-31T20:54:20', '2005-08-09T17:45:20', '1'), - ('515', '3784', '2006-02-16T02:30:53', '2005-08-18T09:56:48', '2005-08-22T12:34:48', '1'), - ('265', '1279', '2006-02-16T02:30:53', '2005-07-08T07:28:05', '2005-07-14T02:10:05', '1'), - ('465', '3401', '2006-02-16T02:30:53', '2005-07-27T20:33:08', '2005-08-01T01:29:08', '1'), - ('497', '2159', '2006-02-16T02:30:53', '2005-08-21T01:45:54', '2005-08-24T01:36:54', '1'), - ('149', '2058', '2006-02-16T02:30:53', '2005-06-16T20:18:46', '2005-06-20T17:12:46', '1'), - ('581', '840', '2006-02-16T02:30:53', '2005-07-08T17:12:51', '2005-07-17T13:14:51', '1'), - ('532', '2213', '2006-02-16T02:30:53', '2005-07-09T10:25:24', '2005-07-18T04:33:24', '1'), - ('597', '1939', '2006-02-16T02:30:53', '2005-08-23T01:29:59', '2005-08-27T04:02:59', '1'), - ('265', '2843', '2006-02-16T02:30:53', '2005-07-10T10:32:52', '2005-07-18T06:28:52', '1'), - ('557', '2397', '2006-02-16T02:30:53', '2005-06-20T13:03:03', '2005-06-29T07:22:03', '1'), - ('133', '757', '2006-02-16T02:30:53', '2005-08-19T01:47:30', '2005-08-24T20:08:30', '1'), - ('583', '507', '2006-02-16T02:30:53', '2005-08-01T22:07:44', '2005-08-05T22:45:44', '1'), - ('84', '3179', '2006-02-16T02:30:53', '2005-08-17T15:29:12', '2005-08-24T17:41:12', '1'), - ('290', '1885', '2006-02-16T02:30:53', '2005-05-26T01:46:20', '2005-06-01T05:45:20', '1'), - ('120', '1319', '2006-02-16T02:30:53', '2005-07-12T03:18:07', '2005-07-15T00:05:07', '1'), - ('577', '1431', '2006-02-16T02:30:53', '2005-07-29T15:49:37', '2005-08-05T18:20:37', '1'), - ('5', '1522', '2006-02-16T02:30:53', '2005-07-30T23:52:30', '2005-08-08T05:22:30', '1'), - ('490', '50', '2006-02-16T02:30:53', '2005-08-01T21:29:34', '2005-08-10T17:27:34', '1'), - ('471', '4236', '2006-02-16T02:30:53', '2005-07-31T02:17:27', '2005-08-07T03:33:27', '1'), - ('472', '2998', '2006-02-16T02:30:53', '2005-07-11T16:09:42', '2005-07-19T20:46:42', '1'), - ('276', '3207', '2006-02-16T02:30:53', '2005-08-02T07:36:44', '2005-08-04T03:32:44', '1'), - ('423', '3579', '2006-02-16T02:30:53', '2005-07-27T06:55:27', '2005-08-01T11:10:27', '1'), - ('469', '3403', '2006-02-16T02:30:53', '2005-07-09T07:43:22', '2005-07-12T04:52:22', '1'), - ('233', '3739', '2006-02-16T02:30:53', '2005-07-11T18:50:45', '2005-07-12T15:26:45', '1'), - ('343', '3895', '2006-02-16T02:30:53', '2005-08-01T22:54:28', '2005-08-02T17:19:28', '1'), - ('288', '3537', '2006-02-16T02:30:53', '2005-08-22T10:20:55', '2005-08-26T12:37:55', '1'), - ('177', '4359', '2006-02-16T02:30:53', '2005-08-02T11:42:23', '2005-08-03T08:29:23', '1'), - ('347', '3913', '2006-02-16T02:30:53', '2005-07-31T03:05:19', '2005-08-04T07:26:19', '1'), - ('104', '1730', '2006-02-16T02:30:53', '2005-07-09T18:54:08', '2005-07-17T22:01:08', '1'), - ('85', '2646', '2006-02-16T02:30:53', '2005-05-29T00:54:53', '2005-06-06T00:45:53', '1'), - ('172', '3476', '2006-02-16T02:30:53', '2005-08-19T20:21:36', '2005-08-21T16:26:36', '1'), - ('319', '1224', '2006-02-16T02:30:53', '2005-07-12T02:07:59', '2005-07-19T22:56:59', '1'), - ('35', '2280', '2006-02-16T02:30:53', '2005-06-18T03:52:14', '2005-06-23T06:52:14', '1'), - ('504', '1795', '2006-02-16T02:30:53', '2005-06-20T05:17:22', '2005-06-26T09:38:22', '1'), - ('414', '4287', '2006-02-16T02:30:53', '2005-06-18T04:54:29', '2005-06-22T09:14:29', '1'), - ('36', '3079', '2006-02-16T02:30:53', '2005-07-28T01:35:17', '2005-08-01T00:14:17', '1'), - ('304', '2787', '2006-02-16T02:30:53', '2005-06-20T02:45:35', '2005-06-26T07:51:35', '1'), - ('280', '198', '2006-02-16T02:30:53', '2005-08-23T04:48:12', '2005-08-29T05:11:12', '1'), - ('488', '3074', '2006-02-16T02:30:53', '2005-07-27T15:19:33', '2005-08-04T10:45:33', '1'), - ('25', '4428', '2006-02-16T02:30:53', '2005-08-23T20:00:30', '2005-08-30T00:25:30', '1'), - ('171', '575', '2006-02-16T02:30:53', '2005-08-19T06:22:48', '2005-08-27T07:47:48', '1'), - ('133', '3594', '2006-02-16T02:30:53', '2005-08-01T16:56:17', '2005-08-03T18:58:17', '1'), - ('559', '1591', '2006-02-16T02:30:53', '2005-07-07T20:05:36', '2005-07-16T23:58:36', '1'), - ('70', '807', '2006-02-16T02:30:53', '2005-07-10T21:57:14', '2005-07-16T19:32:14', '1'), - ('83', '348', '2006-02-16T02:30:53', '2005-08-20T15:13:11', '2005-08-21T13:11:11', '1'), - ('368', '2202', '2006-02-16T02:30:53', '2005-05-30T15:50:39', '2005-06-03T14:25:39', '1'), - ('566', '3165', '2006-02-16T02:30:53', '2005-07-30T08:47:13', '2005-08-02T12:52:13', '1'), - ('282', '1780', '2006-02-16T02:30:53', '2005-05-25T06:20:46', '2005-06-02T05:42:46', '1'), - ('306', '2954', '2006-02-16T02:30:53', '2005-08-02T09:30:11', '2005-08-05T06:52:11', '1'), - ('597', '3865', '2006-02-16T02:30:53', '2005-07-28T13:57:35', '2005-08-04T13:40:35', '1'), - ('312', '4536', '2006-02-16T02:30:53', '2005-08-21T14:23:01', '2005-08-27T13:56:01', '1'), - ('207', '3079', '2006-02-16T02:30:53', '2005-07-09T01:26:22', '2005-07-12T20:48:22', '1'), - ('22', '532', '2006-02-16T02:30:53', '2005-07-31T03:01:11', '2005-08-05T06:01:11', '1'), - ('273', '4169', '2006-02-16T02:30:53', '2005-05-30T21:45:19', '2005-06-01T20:32:19', '1'), - ('348', '3222', '2006-02-16T02:30:53', '2005-08-01T20:43:02', '2005-08-05T02:32:02', '1'), - ('24', '3968', '2006-02-16T02:30:53', '2005-07-31T08:31:18', '2005-08-03T10:25:18', '1'), - ('230', '295', '2006-02-16T02:30:53', '2005-07-31T19:13:29', '2005-08-06T15:44:29', '1'), - ('579', '4494', '2006-02-16T02:30:53', '2005-06-20T17:46:47', '2005-06-29T19:45:47', '1'), - ('19', '3612', '2006-02-16T02:30:53', '2005-06-21T17:38:02', '2005-06-23T19:47:02', '1'), - ('292', '3295', '2006-02-16T02:30:53', '2005-07-10T22:31:01', '2005-07-14T00:52:01', '1'), - ('416', '1606', '2006-02-16T02:30:53', '2005-07-06T17:54:13', '2005-07-10T14:51:13', '1'), - ('532', '2573', '2006-02-16T02:30:53', '2005-07-09T14:44:23', '2005-07-15T10:48:23', '1'), - ('212', '1644', '2006-02-16T02:30:53', '2005-07-28T15:10:25', '2005-08-06T19:15:25', '1'), - ('583', '587', '2006-02-16T02:30:53', '2005-07-06T23:33:41', '2005-07-16T01:31:41', '1'), - ('104', '1323', '2006-02-16T02:30:53', '2005-08-22T15:52:57', '2005-08-24T21:12:57', '1'), - ('91', '2736', '2006-02-16T02:30:53', '2005-07-29T03:34:21', '2005-08-02T01:32:21', '1'), - ('359', '604', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('73', '4073', '2006-02-16T02:30:53', '2005-08-01T08:47:00', '2005-08-06T08:34:00', '1'), - ('58', '2056', '2006-02-16T02:30:53', '2005-08-21T07:29:05', '2005-08-27T08:18:05', '1'), - ('425', '4279', '2006-02-16T02:30:53', '2005-07-30T11:35:24', '2005-08-05T05:36:24', '1'), - ('233', '805', '2006-02-16T02:30:53', '2005-07-27T03:46:27', '2005-08-05T07:46:27', '1'), - ('451', '4250', '2006-02-16T02:30:53', '2005-08-19T21:36:58', '2005-08-22T23:55:58', '1'), - ('89', '4461', '2006-02-16T02:30:53', '2005-08-18T10:34:59', '2005-08-22T14:42:59', '1'), - ('155', '2047', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('432', '284', '2006-02-16T02:30:53', '2005-08-20T21:21:34', '2005-08-28T17:46:34', '1'), - ('507', '1486', '2006-02-16T02:30:53', '2005-07-28T06:49:35', '2005-08-06T08:16:35', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['4912', '8813', '13629', '2217', '5323', '11855', '13387', '6679', '1835', '10157', '14566', '136', '8940', '2470', '4709', '6058', '3013', '6713', '11844', '11208', '12271', '821', '582', '1145', '1320', '10075', '9348', '15249', '3121', '7785', '8101', '14549', '11298', '6772', '7759', '6003', '1202', '277', '12842', '11248', '8695', '10397', '10948', '4271', '13778', '13207', '11869', '10578', '12922', '1339', '9365', '1861', '7566', '616', '7612', '8458', '5445', '13079', '13534', '8764', '4633', '1824', '6507', '8412', '12114', '1862', '3125', '7112', '4894', '4531', '13187', '5364', '14175', '5637', '713', '1974', '12141', '14241', '14501', '3264', '8904', '2797', '3610', '3487', '12162', '7216', '694', '15102', '7725', '953', '12352', '12117', '8831', '5243', '2424', '4772', '9255', '11727', '1706', '1186']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('275', '2012', '2006-02-16T02:30:53', '2005-07-08T21:26:11', '2005-07-18T02:19:11', '1'), - ('497', '3442', '2006-02-16T02:30:53', '2005-07-29T21:47:55', '2005-08-05T01:16:55', '1'), - ('392', '1834', '2006-02-16T02:30:53', '2005-08-20T07:04:07', '2005-08-25T12:36:07', '1'), - ('118', '2260', '2006-02-16T02:30:53', '2005-06-18T03:12:29', '2005-06-20T06:08:29', '1'), - ('35', '1302', '2006-02-16T02:30:53', '2005-07-09T16:34:07', '2005-07-13T21:37:07', '1'), - ('535', '1062', '2006-02-16T02:30:53', '2005-08-17T13:43:07', '2005-08-26T08:07:07', '1'), - ('504', '123', '2006-02-16T02:30:53', '2005-08-19T21:46:10', '2005-08-24T01:16:10', '1'), - ('586', '3664', '2006-02-16T02:30:53', '2005-07-12T12:01:07', '2005-07-14T11:36:07', '1'), - ('112', '1482', '2006-02-16T02:30:53', '2005-06-16T23:05:36', '2005-06-19T04:46:36', '1'), - ('232', '2960', '2006-02-16T02:30:53', '2005-07-31T22:38:48', '2005-08-01T21:38:48', '1'), - ('87', '84', '2006-02-16T02:30:53', '2005-08-21T16:25:05', '2005-08-26T10:31:05', '1'), - ('504', '2296', '2006-02-16T02:30:53', '2005-05-25T22:02:30', '2005-05-31T18:06:30', '1'), - ('212', '1566', '2006-02-16T02:30:53', '2005-07-30T02:57:26', '2005-08-05T22:05:26', '1'), - ('40', '4319', '2006-02-16T02:30:53', '2005-06-18T20:28:31', '2005-06-25T18:48:31', '1'), - ('124', '3964', '2006-02-16T02:30:53', '2005-07-08T12:04:34', '2005-07-15T06:48:34', '1'), - ('498', '3761', '2006-02-16T02:30:53', '2005-07-11T04:03:51', '2005-07-14T03:52:51', '1'), - ('290', '4146', '2006-02-16T02:30:53', '2005-06-20T10:45:09', '2005-06-26T04:55:09', '1'), - ('557', '4218', '2006-02-16T02:30:53', '2005-07-12T13:27:36', '2005-07-16T11:14:36', '1'), - ('368', '3791', '2006-02-16T02:30:53', '2005-08-17T13:16:04', '2005-08-18T10:16:04', '1'), - ('320', '4566', '2006-02-16T02:30:53', '2005-08-02T12:02:37', '2005-08-05T10:56:37', '1'), - ('471', '3866', '2006-02-16T02:30:53', '2005-08-18T04:33:11', '2005-08-20T23:10:11', '1'), - ('348', '3380', '2006-02-16T02:30:53', '2005-05-29T21:31:12', '2005-06-04T22:49:12', '1'), - ('198', '4579', '2006-02-16T02:30:53', '2005-05-28T11:33:46', '2005-05-29T08:33:46', '1'), - ('284', '1133', '2006-02-16T02:30:53', '2005-05-31T20:13:45', '2005-06-08T02:10:45', '1'), - ('84', '4484', '2006-02-16T02:30:53', '2005-06-15T10:42:13', '2005-06-17T13:44:13', '1'), - ('469', '2037', '2006-02-16T02:30:53', '2005-07-31T19:58:42', '2005-08-08T19:49:42', '1'), - ('87', '3128', '2006-02-16T02:30:53', '2005-07-30T18:17:09', '2005-08-07T15:25:09', '1'), - ('444', '121', '2006-02-16T02:30:53', '2005-08-22T17:58:27', '2005-08-30T14:55:27', '1'), - ('132', '797', '2006-02-16T02:30:53', '2005-06-20T18:23:30', '2005-06-21T20:36:30', '1'), - ('460', '4277', '2006-02-16T02:30:53', '2005-07-28T07:16:11', '2005-08-02T03:43:11', '1'), - ('6', '731', '2006-02-16T02:30:53', '2005-07-28T18:47:23', '2005-07-31T16:23:23', '1'), - ('155', '4117', '2006-02-16T02:30:53', '2005-08-21T15:54:21', '2005-08-22T17:22:21', '1'), - ('35', '1663', '2006-02-16T02:30:53', '2005-08-02T15:32:32', '2005-08-06T20:22:32', '1'), - ('89', '3810', '2006-02-16T02:30:53', '2005-07-12T15:55:35', '2005-07-18T10:47:35', '1'), - ('405', '3381', '2006-02-16T02:30:53', '2005-07-28T06:28:45', '2005-08-03T11:38:45', '1'), - ('527', '296', '2006-02-16T02:30:53', '2005-07-11T01:28:33', '2005-07-17T21:24:33', '1'), - ('451', '2821', '2006-02-16T02:30:53', '2005-06-15T02:08:04', '2005-06-16T21:56:04', '1'), - ('45', '1409', '2006-02-16T02:30:53', '2005-05-26T17:32:11', '2005-05-28T22:54:11', '1'), - ('119', '2540', '2006-02-16T02:30:53', '2005-08-19T01:57:21', '2005-08-28T01:10:21', '1'), - ('312', '4139', '2006-02-16T02:30:53', '2005-08-02T13:35:34', '2005-08-03T10:37:34', '1'), - ('280', '694', '2006-02-16T02:30:53', '2005-07-29T16:44:55', '2005-08-07T12:47:55', '1'), - ('504', '4168', '2006-02-16T02:30:53', '2005-08-01T07:11:27', '2005-08-03T07:51:27', '1'), - ('220', '4429', '2006-02-16T02:30:53', '2005-08-02T03:23:23', '2005-08-05T23:18:23', '1'), - ('150', '533', '2006-02-16T02:30:53', '2005-07-07T14:38:52', '2005-07-15T12:05:52', '1'), - ('539', '2385', '2006-02-16T02:30:53', '2005-08-20T12:03:44', '2005-08-28T12:09:44', '1'), - ('58', '674', '2006-02-16T02:30:53', '2005-08-19T15:14:38', '2005-08-27T16:09:38', '1'), - ('19', '3453', '2006-02-16T02:30:53', '2005-08-17T14:10:22', '2005-08-24T18:39:22', '1'), - ('113', '3704', '2006-02-16T02:30:53', '2005-08-01T13:48:02', '2005-08-07T13:40:02', '1'), - ('25', '342', '2006-02-16T02:30:53', '2005-08-19T04:48:48', '2005-08-23T23:32:48', '1'), - ('162', '424', '2006-02-16T02:30:53', '2005-06-15T12:21:56', '2005-06-19T07:46:56', '1'), - ('232', '1539', '2006-02-16T02:30:53', '2005-07-30T18:46:02', '2005-08-03T20:15:02', '1'), - ('454', '135', '2006-02-16T02:30:53', '2005-06-17T01:17:31', '2005-06-25T02:11:31', '1'), - ('144', '1802', '2006-02-16T02:30:53', '2005-07-27T22:34:45', '2005-08-01T22:20:45', '1'), - ('471', '989', '2006-02-16T02:30:53', '2005-05-28T15:45:39', '2005-06-02T09:55:39', '1'), - ('563', '1411', '2006-02-16T02:30:53', '2005-07-28T00:11:55', '2005-07-30T00:47:55', '1'), - ('317', '3857', '2006-02-16T02:30:53', '2005-07-29T08:05:09', '2005-08-02T03:42:09', '1'), - ('578', '565', '2006-02-16T02:30:53', '2005-07-09T21:59:41', '2005-07-15T00:40:41', '1'), - ('107', '733', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('75', '2476', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('303', '2348', '2006-02-16T02:30:53', '2005-07-29T19:39:04', '2005-08-01T13:52:04', '1'), - ('348', '3178', '2006-02-16T02:30:53', '2005-07-08T08:39:39', '2005-07-15T10:23:39', '1'), - ('575', '2269', '2006-02-16T02:30:53', '2005-06-16T21:51:04', '2005-06-18T18:12:04', '1'), - ('118', '2463', '2006-02-16T02:30:53', '2005-07-12T03:33:12', '2005-07-20T03:56:12', '1'), - ('312', '743', '2006-02-16T02:30:53', '2005-07-29T06:44:50', '2005-08-06T05:04:50', '1'), - ('65', '1405', '2006-02-16T02:30:53', '2005-08-17T23:02:00', '2005-08-26T18:02:00', '1'), - ('553', '3299', '2006-02-16T02:30:53', '2005-06-17T01:29:30', '2005-06-25T20:43:30', '1'), - ('382', '3293', '2006-02-16T02:30:53', '2005-06-20T18:31:58', '2005-06-21T15:03:58', '1'), - ('101', '4056', '2006-02-16T02:30:53', '2005-07-27T05:38:42', '2005-08-03T05:35:42', '1'), - ('286', '1028', '2006-02-16T02:30:53', '2005-07-08T20:21:31', '2005-07-11T01:59:31', '1'), - ('142', '3108', '2006-02-16T02:30:53', '2005-07-08T03:27:59', '2005-07-10T22:48:59', '1'), - ('543', '1944', '2006-02-16T02:30:53', '2005-08-19T14:24:48', '2005-08-20T19:37:48', '1'), - ('366', '2746', '2006-02-16T02:30:53', '2005-07-09T18:24:48', '2005-07-10T12:30:48', '1'), - ('452', '2021', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('45', '4436', '2006-02-16T02:30:53', '2005-07-10T06:31:37', '2005-07-17T01:16:37', '1'), - ('507', '3664', '2006-02-16T02:30:53', '2005-05-29T04:10:17', '2005-06-07T07:13:17', '1'), - ('111', '1979', '2006-02-16T02:30:53', '2005-06-17T09:30:05', '2005-06-21T12:10:05', '1'), - ('101', '731', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('291', '2547', '2006-02-16T02:30:53', '2005-08-21T05:24:55', '2005-08-30T03:33:55', '1'), - ('576', '3588', '2006-02-16T02:30:53', '2005-08-21T14:14:38', '2005-08-25T17:58:38', '1'), - ('340', '1666', '2006-02-16T02:30:53', '2005-06-21T04:19:03', '2005-06-23T01:29:03', '1'), - ('575', '3622', '2006-02-16T02:30:53', '2005-07-30T01:08:33', '2005-08-04T02:33:33', '1'), - ('486', '3222', '2006-02-16T02:30:53', '2005-06-19T19:04:32', '2005-06-20T22:43:32', '1'), - ('348', '1509', '2006-02-16T02:30:53', '2005-07-06T05:36:59', '2005-07-13T07:07:59', '1'), - ('586', '1575', '2006-02-16T02:30:53', '2005-07-05T23:30:36', '2005-07-11T04:00:36', '1'), - ('284', '2697', '2006-02-16T02:30:53', '2005-08-18T00:44:30', '2005-08-25T03:34:30', '1'), - ('292', '1812', '2006-02-16T02:30:53', '2005-07-27T09:27:45', '2005-08-03T13:08:45', '1'), - ('399', '592', '2006-02-16T02:30:53', '2005-05-29T01:49:43', '2005-06-05T06:52:43', '1'), - ('555', '2317', '2006-02-16T02:30:53', '2005-08-22T11:58:58', '2005-08-29T08:37:58', '1'), - ('326', '1922', '2006-02-16T02:30:53', '2005-07-28T04:47:14', '2005-08-04T09:03:14', '1'), - ('210', '2194', '2006-02-16T02:30:53', '2005-05-30T16:34:02', '2005-05-31T20:34:02', '1'), - ('155', '643', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('303', '4140', '2006-02-16T02:30:53', '2005-08-17T23:11:12', '2005-08-22T23:56:12', '1'), - ('13', '3520', '2006-02-16T02:30:53', '2005-07-29T22:37:41', '2005-08-08T04:28:41', '1'), - ('587', '122', '2006-02-16T02:30:53', '2005-07-09T13:22:08', '2005-07-16T09:25:08', '1'), - ('233', '1884', '2006-02-16T02:30:53', '2005-06-18T17:35:08', '2005-06-23T15:33:08', '1'), - ('486', '2156', '2006-02-16T02:30:53', '2005-07-08T15:41:11', '2005-07-17T15:25:11', '1'), - ('23', '1596', '2006-02-16T02:30:53', '2005-07-30T14:26:46', '2005-08-07T18:16:46', '1'), - ('6', '98', '2006-02-16T02:30:53', '2005-08-17T08:12:20', '2005-08-19T12:45:20', '1'), - ('26', '2935', '2006-02-16T02:30:53', '2005-06-16T14:01:02', '2005-06-25T19:29:02', '1'), - ('368', '1556', '2006-02-16T02:30:53', '2005-06-15T00:56:45', '2005-06-16T02:23:45', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['14522', '3522', '14369', '15591', '11671', '8410', '11315', '11870', '6248', '9289', '3838', '10354', '3171', '8899', '2448', '5384', '3296', '14952', '3957', '1195', '5482', '13511', '14605', '12207', '6171', '15829', '5678', '5745', '3642', '15542', '13090', '2195', '8685', '7749', '240', '1966', '10694', '11122', '1336', '6001', '10022', '15788', '4818', '5895', '8306', '10186', '7729', '564', '8663', '9448', '4202', '3485', '1063', '10686', '12733', '13446', '13065', '5160', '15238', '1698', '15362', '1678', '5382', '10480', '6521', '11548', '15291', '275', '6050', '7625', '11243', '1079', '9753', '15969', '15212', '8372', '7528', '2261', '14429', '6381', '12201', '13415', '15813', '470', '6128', '163', '170', '12805', '5913', '6459', '2700', '11102', '3118', '5540', '1895', '8678', '6784', '4655', '7879', '2800']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('535', '2101', '2006-02-16T02:30:53', '2005-08-21T15:01:34', '2005-08-25T16:37:34', '1'), - ('469', '4522', '2006-02-16T02:30:53', '2005-07-06T01:00:21', '2005-07-11T01:18:21', '1'), - ('392', '1636', '2006-02-16T02:30:53', '2005-08-21T09:33:44', '2005-08-25T08:56:44', '1'), - ('62', '64', '2006-02-16T02:30:53', '2005-08-23T06:11:52', '2005-08-25T05:34:52', '1'), - ('338', '3569', '2006-02-16T02:30:53', '2005-08-17T05:50:21', '2005-08-20T03:43:21', '1'), - ('277', '3448', '2006-02-16T02:30:53', '2005-07-29T06:41:36', '2005-08-02T08:38:36', '1'), - ('13', '1116', '2006-02-16T02:30:53', '2005-08-02T16:05:17', '2005-08-05T16:33:17', '1'), - ('432', '4251', '2006-02-16T02:30:53', '2005-08-17T14:11:28', '2005-08-24T16:43:28', '1'), - ('6', '2686', '2006-02-16T02:30:53', '2005-07-11T15:01:54', '2005-07-19T16:58:54', '1'), - ('453', '389', '2006-02-16T02:30:53', '2005-07-30T15:57:04', '2005-08-07T18:46:04', '1'), - ('565', '3404', '2006-02-16T02:30:53', '2005-07-06T16:29:43', '2005-07-11T20:50:43', '1'), - ('416', '1680', '2006-02-16T02:30:53', '2005-08-01T05:47:10', '2005-08-06T09:04:10', '1'), - ('140', '2838', '2006-02-16T02:30:53', '2005-06-20T22:15:47', '2005-06-24T18:14:47', '1'), - ('252', '4148', '2006-02-16T02:30:53', '2005-07-30T01:05:30', '2005-08-01T23:32:30', '1'), - ('308', '1642', '2006-02-16T02:30:53', '2005-06-18T19:13:45', '2005-06-27T14:43:45', '1'), - ('180', '1729', '2006-02-16T02:30:53', '2005-07-09T19:17:46', '2005-07-12T13:50:46', '1'), - ('284', '2453', '2006-02-16T02:30:53', '2005-06-21T07:04:53', '2005-06-25T08:36:53', '1'), - ('575', '2950', '2006-02-16T02:30:53', '2005-08-22T06:20:07', '2005-08-28T01:18:07', '1'), - ('414', '443', '2006-02-16T02:30:53', '2005-07-06T22:05:47', '2005-07-16T01:08:47', '1'), - ('84', '2272', '2006-02-16T02:30:53', '2005-06-15T01:37:38', '2005-06-17T21:50:38', '1'), - ('460', '2136', '2006-02-16T02:30:53', '2005-07-09T23:53:04', '2005-07-15T04:59:04', '1'), - ('23', '2973', '2006-02-16T02:30:53', '2005-08-20T02:21:40', '2005-08-21T03:26:40', '1'), - ('394', '476', '2006-02-16T02:30:53', '2005-08-21T17:56:06', '2005-08-24T18:35:06', '1'), - ('265', '3745', '2006-02-16T02:30:53', '2005-08-18T02:24:07', '2005-08-22T07:53:07', '1'), - ('491', '448', '2006-02-16T02:30:53', '2005-07-11T10:29:35', '2005-07-16T12:01:35', '1'), - ('30', '4387', '2006-02-16T02:30:53', '2005-08-23T15:17:14', '2005-08-27T13:04:14', '1'), - ('96', '4366', '2006-02-16T02:30:53', '2005-07-10T08:42:42', '2005-07-19T03:48:42', '1'), - ('305', '41', '2006-02-16T02:30:53', '2005-07-10T12:10:11', '2005-07-19T06:56:11', '1'), - ('166', '4204', '2006-02-16T02:30:53', '2005-07-06T07:18:20', '2005-07-09T01:37:20', '1'), - ('111', '21', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('52', '1447', '2006-02-16T02:30:53', '2005-08-19T10:39:54', '2005-08-28T10:31:54', '1'), - ('286', '2247', '2006-02-16T02:30:53', '2005-06-18T01:44:46', '2005-06-25T20:50:46', '1'), - ('321', '1827', '2006-02-16T02:30:53', '2005-07-29T16:17:05', '2005-08-07T17:44:05', '1'), - ('232', '3585', '2006-02-16T02:30:53', '2005-07-28T05:53:36', '2005-08-01T03:49:36', '1'), - ('103', '3420', '2006-02-16T02:30:53', '2005-05-26T12:40:23', '2005-06-04T07:22:23', '1'), - ('6', '2085', '2006-02-16T02:30:53', '2005-06-17T09:19:45', '2005-06-20T11:19:45', '1'), - ('98', '3429', '2006-02-16T02:30:53', '2005-08-01T18:15:07', '2005-08-10T15:38:07', '1'), - ('383', '3021', '2006-02-16T02:30:53', '2005-08-02T08:49:09', '2005-08-08T04:33:09', '1'), - ('290', '1696', '2006-02-16T02:30:53', '2005-06-15T12:01:34', '2005-06-23T12:05:34', '1'), - ('45', '1779', '2006-02-16T02:30:53', '2005-07-11T01:24:44', '2005-07-11T22:55:44', '1'), - ('115', '1900', '2006-02-16T02:30:53', '2005-07-31T18:25:30', '2005-08-04T13:35:30', '1'), - ('269', '13', '2006-02-16T02:30:53', '2005-08-23T13:54:39', '2005-08-26T10:17:39', '1'), - ('144', '115', '2006-02-16T02:30:53', '2005-07-08T17:18:22', '2005-07-14T14:40:22', '1'), - ('164', '2272', '2006-02-16T02:30:53', '2005-07-10T20:13:19', '2005-07-17T17:51:19', '1'), - ('232', '1708', '2006-02-16T02:30:53', '2005-07-29T03:12:26', '2005-08-01T23:26:26', '1'), - ('294', '4563', '2006-02-16T02:30:53', '2005-08-01T00:12:36', '2005-08-07T05:08:36', '1'), - ('89', '1491', '2006-02-16T02:30:53', '2005-07-28T04:57:57', '2005-07-30T09:38:57', '1'), - ('282', '2973', '2006-02-16T02:30:53', '2005-05-28T09:12:09', '2005-05-29T05:07:09', '1'), - ('214', '1281', '2006-02-16T02:30:53', '2005-07-29T15:33:18', '2005-07-30T18:03:18', '1'), - ('278', '1213', '2006-02-16T02:30:53', '2005-07-30T21:56:13', '2005-08-04T18:03:13', '1'), - ('38', '2274', '2006-02-16T02:30:53', '2005-07-07T11:23:48', '2005-07-16T16:32:48', '1'), - ('111', '117', '2006-02-16T02:30:53', '2005-07-05T23:25:54', '2005-07-09T17:38:54', '1'), - ('7', '2484', '2006-02-16T02:30:53', '2005-05-31T08:44:29', '2005-06-09T08:00:29', '1'), - ('150', '2542', '2006-02-16T02:30:53', '2005-08-01T17:51:21', '2005-08-03T19:01:21', '1'), - ('144', '3243', '2006-02-16T02:30:53', '2005-08-18T21:59:00', '2005-08-24T02:25:00', '1'), - ('488', '3226', '2006-02-16T02:30:53', '2005-08-20T00:06:13', '2005-08-22T19:56:13', '1'), - ('518', '1887', '2006-02-16T02:30:53', '2005-08-19T09:48:52', '2005-08-22T07:12:52', '1'), - ('467', '1925', '2006-02-16T02:30:53', '2005-07-09T08:57:07', '2005-07-18T06:01:07', '1'), - ('70', '403', '2006-02-16T02:30:53', '2005-08-22T17:46:12', '2005-08-29T16:41:12', '1'), - ('407', '1474', '2006-02-16T02:30:53', '2005-06-16T13:04:42', '2005-06-21T15:54:42', '1'), - ('497', '1023', '2006-02-16T02:30:53', '2005-08-22T21:40:20', '2005-08-29T15:55:20', '1'), - ('352', '1856', '2006-02-16T02:30:53', '2005-06-16T11:08:28', '2005-06-19T15:44:28', '1'), - ('586', '78', '2006-02-16T02:30:53', '2005-07-09T19:12:57', '2005-07-14T15:44:57', '1'), - ('560', '553', '2006-02-16T02:30:53', '2005-08-01T10:13:41', '2005-08-03T10:27:41', '1'), - ('49', '3293', '2006-02-16T02:30:53', '2005-07-12T04:06:11', '2005-07-21T05:50:11', '1'), - ('323', '480', '2006-02-16T02:30:53', '2005-08-17T00:59:47', '2005-08-22T05:09:47', '1'), - ('494', '1461', '2006-02-16T02:30:53', '2005-08-22T19:28:04', '2005-08-26T15:07:04', '1'), - ('133', '1718', '2006-02-16T02:30:53', '2005-05-26T17:09:53', '2005-06-04T22:35:53', '1'), - ('527', '825', '2006-02-16T02:30:53', '2005-07-11T03:34:29', '2005-07-15T02:55:29', '1'), - ('382', '3129', '2006-02-16T02:30:53', '2005-07-28T00:47:56', '2005-08-02T23:34:56', '1'), - ('361', '2517', '2006-02-16T02:30:53', '2005-08-02T13:32:48', '2005-08-11T18:55:48', '1'), - ('312', '268', '2006-02-16T02:30:53', '2005-05-31T10:48:17', '2005-06-08T12:30:17', '1'), - ('98', '3529', '2006-02-16T02:30:53', '2005-07-31T09:22:38', '2005-08-01T08:45:38', '1'), - ('327', '1807', '2006-02-16T02:30:53', '2005-08-23T19:51:30', '2005-08-31T23:50:30', '1'), - ('562', '2182', '2006-02-16T02:30:53', '2005-08-22T16:44:26', '2005-08-27T20:26:26', '1'), - ('523', '754', '2006-02-16T02:30:53', '2005-07-29T05:18:08', '2005-08-06T09:39:08', '1'), - ('213', '1218', '2006-02-16T02:30:53', '2005-07-27T21:15:25', '2005-08-03T19:12:25', '1'), - ('570', '1763', '2006-02-16T02:30:53', '2005-06-18T05:46:15', '2005-06-24T05:06:15', '1'), - ('66', '2513', '2006-02-16T02:30:53', '2005-08-21T11:29:43', '2005-08-24T12:05:43', '1'), - ('340', '2584', '2006-02-16T02:30:53', '2005-07-11T21:58:48', '2005-07-16T16:18:48', '1'), - ('540', '3676', '2006-02-16T02:30:53', '2005-08-18T02:14:06', '2005-08-23T04:44:06', '1'), - ('181', '1105', '2006-02-16T02:30:53', '2005-08-19T22:48:09', '2005-08-25T02:09:09', '1'), - ('9', '981', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('504', '1613', '2006-02-16T02:30:53', '2005-05-27T21:17:08', '2005-06-04T17:47:08', '1'), - ('18', '2050', '2006-02-16T02:30:53', '2005-07-11T08:15:08', '2005-07-13T03:36:08', '1'), - ('104', '2306', '2006-02-16T02:30:53', '2005-05-26T02:26:23', '2005-06-04T06:36:23', '1'), - ('107', '3688', '2006-02-16T02:30:53', '2005-05-26T03:11:12', '2005-06-02T03:53:12', '1'), - ('345', '2964', '2006-02-16T02:30:53', '2005-08-19T00:36:34', '2005-08-26T20:38:34', '1'), - ('277', '2767', '2006-02-16T02:30:53', '2005-07-10T20:58:55', '2005-07-13T15:18:55', '1'), - ('557', '4025', '2006-02-16T02:30:53', '2005-07-12T01:12:03', '2005-07-15T23:48:03', '1'), - ('180', '928', '2006-02-16T02:30:53', '2005-06-19T13:31:52', '2005-06-27T19:30:52', '1'), - ('73', '3112', '2006-02-16T02:30:53', '2005-08-02T08:08:30', '2005-08-04T09:16:30', '1'), - ('125', '1258', '2006-02-16T02:30:53', '2005-06-20T18:05:57', '2005-06-23T23:01:57', '1'), - ('250', '132', '2006-02-16T02:30:53', '2005-07-10T02:44:21', '2005-07-11T07:13:21', '1'), - ('30', '680', '2006-02-16T02:30:53', '2005-06-17T04:25:12', '2005-06-26T08:44:12', '1'), - ('210', '3991', '2006-02-16T02:30:53', '2005-07-29T16:04:00', '2005-08-05T12:37:00', '1'), - ('578', '197', '2006-02-16T02:30:53', '2005-07-12T16:28:49', '2005-07-15T17:27:49', '1'), - ('213', '4078', '2006-02-16T02:30:53', '2005-07-08T09:49:22', '2005-07-15T13:08:22', '1'), - ('125', '1969', '2006-02-16T02:30:53', '2005-07-28T10:27:46', '2005-07-31T07:48:46', '1'), - ('146', '183', '2006-02-16T02:30:53', '2005-06-19T19:15:56', '2005-06-23T00:15:56', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['2573', '15378', '10474', '4322', '85', '11793', '15363', '9481', '1669', '3566', '7909', '13060', '9437', '15490', '15560', '12594', '15257', '13994', '15909', '6598', '4713', '336', '3458', '5859', '2883', '17', '6861', '2479', '13657', '5020', '15256', '13665', '12447', '3950', '13278', '6914', '6229', '13937', '15242', '3603', '3910', '14885', '11013', '10808', '2497', '11145', '12358', '14261', '2979', '6701', '11952', '947', '8222', '3632', '4605', '16017', '15017', '4976', '11959', '2918', '13451', '3989', '7603', '11074', '8593', '1405', '4362', '14401', '13448', '15677', '13098', '4786', '13006', '11592', '3316', '9449', '2210', '10387', '7384', '6357', '1004', '11683', '12931', '6145', '13692', '506', '7415', '4962', '941', '10331', '9896', '5108', '3699', '2131', '3232', '11369', '7121', '8541', '4965', '1531']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('563', '3354', '2006-02-16T02:30:53', '2005-06-19T04:23:18', '2005-06-23T06:04:18', '1'), - ('340', '1483', '2006-02-16T02:30:53', '2005-08-22T22:25:17', '2005-08-30T17:04:17', '1'), - ('488', '4482', '2006-02-16T02:30:53', '2005-08-01T10:01:42', '2005-08-08T12:32:42', '1'), - ('568', '1522', '2006-02-16T02:30:53', '2005-07-07T17:54:37', '2005-07-14T13:56:37', '1'), - ('414', '470', '2006-02-16T02:30:53', '2005-05-25T13:05:34', '2005-05-29T16:53:34', '1'), - ('352', '1955', '2006-02-16T02:30:53', '2005-08-17T11:05:53', '2005-08-25T12:25:53', '1'), - ('480', '2326', '2006-02-16T02:30:53', '2005-08-22T21:41:40', '2005-08-23T21:40:40', '1'), - ('481', '613', '2006-02-16T02:30:53', '2005-07-30T23:26:05', '2005-08-04T17:46:05', '1'), - ('73', '360', '2006-02-16T02:30:53', '2005-06-16T10:20:20', '2005-06-18T04:26:20', '1'), - ('392', '2774', '2006-02-16T02:30:53', '2005-07-06T03:08:51', '2005-07-12T05:04:51', '1'), - ('210', '3355', '2006-02-16T02:30:53', '2005-07-28T11:38:08', '2005-07-29T13:54:08', '1'), - ('22', '507', '2006-02-16T02:30:53', '2005-08-19T09:43:25', '2005-08-28T15:22:25', '1'), - ('592', '1230', '2006-02-16T02:30:53', '2005-07-30T21:36:04', '2005-08-08T01:26:04', '1'), - ('493', '3922', '2006-02-16T02:30:53', '2005-08-23T02:08:18', '2005-08-30T06:15:18', '1'), - ('107', '3616', '2006-02-16T02:30:53', '2005-08-23T05:01:13', '2005-09-01T05:02:13', '1'), - ('198', '4421', '2006-02-16T02:30:53', '2005-08-18T16:24:24', '2005-08-25T15:45:24', '1'), - ('223', '915', '2006-02-16T02:30:53', '2005-08-22T18:21:04', '2005-08-30T20:13:04', '1'), - ('180', '142', '2006-02-16T02:30:53', '2005-08-20T19:33:21', '2005-08-24T20:55:21', '1'), - ('452', '404', '2006-02-16T02:30:53', '2005-08-23T17:42:42', '2005-08-26T20:25:42', '1'), - ('532', '2049', '2006-02-16T02:30:53', '2005-07-12T07:38:25', '2005-07-19T07:58:25', '1'), - ('207', '1399', '2006-02-16T02:30:53', '2005-07-08T12:12:33', '2005-07-16T17:13:33', '1'), - ('275', '1811', '2006-02-16T02:30:53', '2005-05-27T03:15:23', '2005-05-29T22:43:23', '1'), - ('338', '2136', '2006-02-16T02:30:53', '2005-06-21T21:42:49', '2005-06-29T01:26:49', '1'), - ('220', '131', '2006-02-16T02:30:53', '2005-07-10T18:02:02', '2005-07-11T23:24:02', '1'), - ('320', '585', '2006-02-16T02:30:53', '2005-06-20T01:29:10', '2005-06-28T06:12:10', '1'), - ('575', '830', '2006-02-16T02:30:53', '2005-05-25T01:06:36', '2005-05-27T00:43:36', '1'), - ('83', '354', '2006-02-16T02:30:53', '2005-07-12T19:56:52', '2005-07-13T16:02:52', '1'), - ('408', '1624', '2006-02-16T02:30:53', '2005-06-18T21:03:08', '2005-06-22T16:49:08', '1'), - ('414', '1752', '2006-02-16T02:30:53', '2005-08-20T08:01:39', '2005-08-23T07:31:39', '1'), - ('565', '4113', '2006-02-16T02:30:53', '2005-07-09T02:07:56', '2005-07-09T23:59:56', '1'), - ('198', '1873', '2006-02-16T02:30:53', '2005-08-22T18:20:07', '2005-08-28T12:57:07', '1'), - ('291', '117', '2006-02-16T02:30:53', '2005-08-20T08:19:20', '2005-08-28T06:26:20', '1'), - ('469', '4084', '2006-02-16T02:30:53', '2005-08-18T10:57:01', '2005-08-27T06:05:01', '1'), - ('598', '4153', '2006-02-16T02:30:53', '2005-07-06T21:48:44', '2005-07-14T02:25:44', '1'), - ('282', '2691', '2006-02-16T02:30:53', '2005-08-19T17:57:53', '2005-08-22T23:16:53', '1'), - ('361', '496', '2006-02-16T02:30:53', '2005-07-12T22:26:56', '2005-07-17T20:03:56', '1'), - ('399', '3137', '2006-02-16T02:30:53', '2005-07-11T13:59:50', '2005-07-20T09:26:50', '1'), - ('172', '1755', '2006-02-16T02:30:53', '2005-08-20T17:22:51', '2005-08-27T15:51:51', '1'), - ('364', '2106', '2006-02-16T02:30:53', '2005-08-22T17:48:10', '2005-08-27T23:32:10', '1'), - ('330', '2442', '2006-02-16T02:30:53', '2005-07-06T05:25:03', '2005-07-12T08:14:03', '1'), - ('248', '2085', '2006-02-16T02:30:53', '2005-07-06T20:05:18', '2005-07-10T18:51:18', '1'), - ('248', '2097', '2006-02-16T02:30:53', '2005-08-22T03:58:29', '2005-08-30T05:26:29', '1'), - ('527', '2993', '2006-02-16T02:30:53', '2005-08-02T05:10:54', '2005-08-10T08:59:54', '1'), - ('480', '596', '2006-02-16T02:30:53', '2005-08-01T22:37:11', '2005-08-09T02:37:11', '1'), - ('171', '2327', '2006-02-16T02:30:53', '2005-06-18T22:50:40', '2005-06-26T22:39:40', '1'), - ('291', '1270', '2006-02-16T02:30:53', '2005-08-02T09:43:24', '2005-08-05T15:29:24', '1'), - ('16', '504', '2006-02-16T02:30:53', '2005-08-18T07:41:43', '2005-08-20T03:46:43', '1'), - ('166', '1426', '2006-02-16T02:30:53', '2005-08-21T06:07:24', '2005-08-26T09:57:24', '1'), - ('589', '3961', '2006-02-16T02:30:53', '2005-06-20T08:31:05', '2005-06-27T12:25:05', '1'), - ('454', '3428', '2006-02-16T02:30:53', '2005-07-12T12:47:59', '2005-07-13T10:28:59', '1'), - ('288', '2411', '2006-02-16T02:30:53', '2005-08-17T17:14:57', '2005-08-19T19:15:57', '1'), - ('62', '4478', '2006-02-16T02:30:53', '2005-05-30T15:36:57', '2005-06-04T18:48:57', '1'), - ('278', '2999', '2006-02-16T02:30:53', '2005-07-28T23:51:53', '2005-08-05T22:48:53', '1'), - ('366', '2583', '2006-02-16T02:30:53', '2005-07-06T06:38:21', '2005-07-11T03:19:21', '1'), - ('523', '1139', '2006-02-16T02:30:53', '2005-07-08T07:00:14', '2005-07-16T08:38:14', '1'), - ('535', '664', '2006-02-16T02:30:53', '2005-08-23T21:27:11', '2005-08-24T23:22:11', '1'), - ('144', '3975', '2006-02-16T02:30:53', '2005-08-22T08:47:44', '2005-08-29T08:16:44', '1'), - ('199', '617', '2006-02-16T02:30:53', '2005-07-09T00:03:30', '2005-07-10T19:05:30', '1'), - ('101', '2694', '2006-02-16T02:30:53', '2005-08-17T17:23:35', '2005-08-20T20:57:35', '1'), - ('215', '1985', '2006-02-16T02:30:53', '2005-06-20T04:09:04', '2005-06-21T10:07:04', '1'), - ('6', '3837', '2006-02-16T02:30:53', '2005-08-20T00:18:25', '2005-08-29T01:08:25', '1'), - ('213', '2366', '2006-02-16T02:30:53', '2005-07-06T23:30:54', '2005-07-12T01:28:54', '1'), - ('497', '124', '2006-02-16T02:30:53', '2005-07-27T23:54:44', '2005-07-29T01:24:44', '1'), - ('277', '1439', '2006-02-16T02:30:53', '2005-08-02T07:21:43', '2005-08-08T05:18:43', '1'), - ('181', '2601', '2006-02-16T02:30:53', '2005-07-29T12:38:14', '2005-08-07T07:04:14', '1'), - ('243', '3184', '2006-02-16T02:30:53', '2005-06-15T16:41:26', '2005-06-21T18:16:26', '1'), - ('425', '3759', '2006-02-16T02:30:53', '2005-07-07T19:35:30', '2005-07-14T14:59:30', '1'), - ('407', '3468', '2006-02-16T02:30:53', '2005-08-21T10:36:20', '2005-08-30T06:45:20', '1'), - ('327', '2870', '2006-02-16T02:30:53', '2005-08-20T00:12:43', '2005-08-25T02:33:43', '1'), - ('109', '2050', '2006-02-16T02:30:53', '2005-08-23T09:23:36', '2005-08-27T05:01:36', '1'), - ('51', '3770', '2006-02-16T02:30:53', '2005-08-19T10:51:59', '2005-08-24T11:27:59', '1'), - ('294', '2724', '2006-02-16T02:30:53', '2005-07-08T16:13:05', '2005-07-16T15:29:05', '1'), - ('134', '3157', '2006-02-16T02:30:53', '2005-08-19T07:47:16', '2005-08-21T06:17:16', '1'), - ('383', '720', '2006-02-16T02:30:53', '2005-08-17T02:36:04', '2005-08-19T00:31:04', '1'), - ('451', '3271', '2006-02-16T02:30:53', '2005-06-21T08:20:18', '2005-06-28T07:44:18', '1'), - ('581', '2', '2006-02-16T02:30:53', '2005-07-30T22:02:34', '2005-08-06T02:09:34', '1'), - ('108', '219', '2006-02-16T02:30:53', '2005-06-18T02:27:01', '2005-06-21T00:45:01', '1'), - ('87', '1651', '2006-02-16T02:30:53', '2005-08-01T06:42:31', '2005-08-08T07:44:31', '1'), - ('585', '3573', '2006-02-16T02:30:53', '2005-07-27T15:49:45', '2005-08-04T15:17:45', '1'), - ('252', '658', '2006-02-16T02:30:53', '2005-07-11T20:58:51', '2005-07-12T15:06:51', '1'), - ('565', '1588', '2006-02-16T02:30:53', '2005-05-31T00:48:36', '2005-06-01T20:56:36', '1'), - ('66', '2603', '2006-02-16T02:30:53', '2005-08-17T06:15:17', '2005-08-26T05:33:17', '1'), - ('407', '3070', '2006-02-16T02:30:53', '2005-08-19T05:11:47', '2005-08-21T00:59:47', '1'), - ('540', '1359', '2006-02-16T02:30:53', '2005-07-11T09:07:01', '2005-07-19T08:21:01', '1'), - ('65', '1928', '2006-02-16T02:30:53', '2005-08-20T09:07:52', '2005-08-21T05:17:52', '1'), - ('469', '667', '2006-02-16T02:30:53', '2005-05-28T02:09:19', '2005-06-05T20:34:19', '1'), - ('294', '4410', '2006-02-16T02:30:53', '2005-07-27T16:50:59', '2005-08-02T11:21:59', '1'), - ('532', '4399', '2006-02-16T02:30:53', '2005-07-08T23:36:13', '2005-07-15T03:39:13', '1'), - ('562', '3630', '2006-02-16T02:30:53', '2005-05-30T15:02:25', '2005-06-01T17:19:25', '1'), - ('575', '4152', '2006-02-16T02:30:53', '2005-08-01T04:57:14', '2005-08-07T06:46:14', '1'), - ('586', '2591', '2006-02-16T02:30:53', '2005-07-31T14:09:48', '2005-08-01T20:02:48', '1'), - ('30', '4229', '2006-02-16T02:30:53', '2005-07-09T06:44:30', '2005-07-17T04:24:30', '1'), - ('262', '418', '2006-02-16T02:30:53', '2005-07-06T10:11:25', '2005-07-14T05:18:25', '1'), - ('85', '4424', '2006-02-16T02:30:53', '2005-06-17T21:02:25', '2005-06-25T18:45:25', '1'), - ('555', '1972', '2006-02-16T02:30:53', '2005-06-21T02:30:37', '2005-06-29T03:10:37', '1'), - ('480', '2480', '2006-02-16T02:30:53', '2005-08-02T18:04:41', '2005-08-09T18:41:41', '1'), - ('252', '1264', '2006-02-16T02:30:53', '2005-07-27T05:58:32', '2005-07-29T06:14:32', '1'), - ('340', '976', '2006-02-16T02:30:53', '2005-07-29T10:55:01', '2005-07-31T10:53:01', '1'), - ('432', '535', '2006-02-16T02:30:53', '2005-07-08T23:46:57', '2005-07-15T18:47:57', '1'), - ('515', '1388', '2006-02-16T02:30:53', '2005-06-16T00:40:34', '2005-06-22T02:44:34', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['3998', '1516', '11474', '5972', '3267', '9352', '4956', '11719', '1703', '6086', '1616', '11355', '15900', '14710', '14101', '6582', '5452', '3446', '6059', '5134', '773', '12118', '748', '12590', '6183', '1492', '3461', '4201', '14659', '13712', '2266', '11416', '14852', '13743', '5776', '14644', '3234', '1115', '3905', '10848', '1620', '9779', '12096', '2657', '10199', '2012', '6495', '13900', '12549', '8797', '6154', '766', '11744', '3203', '10673', '10718', '9901', '15126', '7876', '11103', '15506', '13934', '3556', '9967', '6826', '11344', '15652', '1998', '2409', '11994', '13096', '12222', '8239', '9175', '7135', '5946', '9336', '11981', '11878', '7864', '4732', '7155', '9080', '11120', '7801', '13061', '13604', '10049', '2534', '15024', '12002', '14000', '10236', '12637', '12178', '7970', '3274', '121', '6042', '5848']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('566', '1245', '2006-02-16T02:30:53', '2005-07-06T23:49:20', '2005-07-12T20:39:20', '1'), - ('530', '3702', '2006-02-16T02:30:53', '2005-06-15T23:11:10', '2005-06-17T20:37:10', '1'), - ('214', '574', '2006-02-16T02:30:53', '2005-08-02T21:53:08', '2005-08-05T22:36:08', '1'), - ('30', '4577', '2006-02-16T02:30:53', '2005-07-11T00:08:54', '2005-07-17T21:01:54', '1'), - ('134', '1118', '2006-02-16T02:30:53', '2005-06-21T04:55:21', '2005-06-29T23:46:21', '1'), - ('360', '2619', '2006-02-16T02:30:53', '2005-07-30T18:29:26', '2005-07-31T19:43:26', '1'), - ('477', '1512', '2006-02-16T02:30:53', '2005-07-08T23:17:10', '2005-07-18T00:14:10', '1'), - ('338', '2054', '2006-02-16T02:30:53', '2005-08-17T07:46:05', '2005-08-23T08:52:05', '1'), - ('589', '2346', '2006-02-16T02:30:53', '2005-06-16T13:28:44', '2005-06-17T11:03:44', '1'), - ('420', '1505', '2006-02-16T02:30:53', '2005-07-11T05:29:03', '2005-07-16T01:17:03', '1'), - ('204', '2296', '2006-02-16T02:30:53', '2005-06-16T07:04:52', '2005-06-24T04:06:52', '1'), - ('185', '2673', '2006-02-16T02:30:53', '2005-08-02T17:37:43', '2005-08-05T19:59:43', '1'), - ('562', '1112', '2006-02-16T02:30:53', '2005-08-23T17:16:30', '2005-08-27T18:02:30', '1'), - ('587', '1922', '2006-02-16T02:30:53', '2005-08-21T21:15:23', '2005-08-30T19:45:23', '1'), - ('19', '1892', '2006-02-16T02:30:53', '2005-08-21T00:33:03', '2005-08-24T01:59:03', '1'), - ('420', '2077', '2006-02-16T02:30:53', '2005-07-12T06:28:12', '2005-07-19T06:19:12', '1'), - ('80', '2036', '2006-02-16T02:30:53', '2005-07-09T22:23:21', '2005-07-17T00:20:21', '1'), - ('174', '1817', '2006-02-16T02:30:53', '2005-06-21T20:45:51', '2005-06-26T17:02:51', '1'), - ('394', '1437', '2006-02-16T02:30:53', '2005-07-11T04:03:54', '2005-07-18T01:35:54', '1'), - ('491', '149', '2006-02-16T02:30:53', '2005-07-09T07:53:12', '2005-07-16T05:30:12', '1'), - ('563', '245', '2006-02-16T02:30:53', '2005-05-29T13:18:05', '2005-06-07T17:22:05', '1'), - ('89', '158', '2006-02-16T02:30:53', '2005-08-17T23:14:25', '2005-08-26T22:26:25', '1'), - ('7', '2803', '2006-02-16T02:30:53', '2005-05-29T09:27:00', '2005-06-03T04:25:00', '1'), - ('308', '2624', '2006-02-16T02:30:53', '2005-08-18T16:11:35', '2005-08-23T10:35:35', '1'), - ('402', '856', '2006-02-16T02:30:53', '2005-07-11T11:14:35', '2005-07-16T15:35:35', '1'), - ('360', '4148', '2006-02-16T02:30:53', '2005-06-15T21:48:35', '2005-06-17T17:18:35', '1'), - ('23', '1715', '2006-02-16T02:30:53', '2005-06-21T21:49:18', '2005-06-26T19:51:18', '1'), - ('145', '3682', '2006-02-16T02:30:53', '2005-07-07T11:19:51', '2005-07-16T08:48:51', '1'), - ('119', '928', '2006-02-16T02:30:53', '2005-08-21T19:42:36', '2005-08-26T14:06:36', '1'), - ('581', '1039', '2006-02-16T02:30:53', '2005-08-20T09:38:04', '2005-08-21T06:10:04', '1'), - ('452', '2596', '2006-02-16T02:30:53', '2005-06-18T06:05:02', '2005-06-20T06:54:02', '1'), - ('58', '1848', '2006-02-16T02:30:53', '2005-08-02T19:44:04', '2005-08-11T15:30:04', '1'), - ('352', '2262', '2006-02-16T02:30:53', '2005-08-22T02:25:53', '2005-08-25T04:27:53', '1'), - ('57', '3693', '2006-02-16T02:30:53', '2005-08-20T10:51:27', '2005-08-24T15:54:27', '1'), - ('568', '3592', '2006-02-16T02:30:53', '2005-07-10T13:35:22', '2005-07-12T17:58:22', '1'), - ('453', '3905', '2006-02-16T02:30:53', '2005-08-21T19:12:12', '2005-08-29T17:08:12', '1'), - ('459', '3252', '2006-02-16T02:30:53', '2005-06-21T02:39:44', '2005-06-29T07:27:44', '1'), - ('109', '2140', '2006-02-16T02:30:53', '2005-05-31T16:07:09', '2005-06-04T18:51:09', '1'), - ('526', '3817', '2006-02-16T02:30:53', '2005-07-06T19:33:34', '2005-07-15T17:55:34', '1'), - ('368', '2630', '2006-02-16T02:30:53', '2005-08-01T23:50:22', '2005-08-06T00:52:22', '1'), - ('561', '389', '2006-02-16T02:30:53', '2005-06-16T07:21:30', '2005-06-17T09:46:30', '1'), - ('402', '1280', '2006-02-16T02:30:53', '2005-07-31T10:08:33', '2005-08-03T14:56:33', '1'), - ('463', '44', '2006-02-16T02:30:53', '2005-08-17T22:32:50', '2005-08-25T03:33:50', '1'), - ('19', '3595', '2006-02-16T02:30:53', '2005-06-19T10:42:59', '2005-06-28T12:37:59', '1'), - ('526', '3665', '2006-02-16T02:30:53', '2005-08-01T00:38:55', '2005-08-05T03:41:55', '1'), - ('84', '3588', '2006-02-16T02:30:53', '2005-06-17T11:57:15', '2005-06-24T17:18:15', '1'), - ('19', '2440', '2006-02-16T02:30:53', '2005-07-12T02:57:02', '2005-07-14T08:35:02', '1'), - ('66', '1140', '2006-02-16T02:30:53', '2005-08-20T16:05:41', '2005-08-22T15:13:41', '1'), - ('377', '1010', '2006-02-16T02:30:53', '2005-08-18T14:38:07', '2005-08-21T08:45:07', '1'), - ('566', '2929', '2006-02-16T02:30:53', '2005-07-29T21:10:37', '2005-08-07T21:43:37', '1'), - ('368', '2717', '2006-02-16T02:30:53', '2005-07-11T09:32:19', '2005-07-16T15:10:19', '1'), - ('383', '2154', '2006-02-16T02:30:53', '2005-05-29T11:47:02', '2005-06-06T07:14:02', '1'), - ('26', '297', '2006-02-16T02:30:53', '2005-08-17T08:54:30', '2005-08-25T03:28:30', '1'), - ('158', '442', '2006-02-16T02:30:53', '2005-06-21T00:34:56', '2005-06-29T23:30:56', '1'), - ('528', '2735', '2006-02-16T02:30:53', '2005-08-01T17:11:51', '2005-08-03T13:32:51', '1'), - ('394', '2763', '2006-02-16T02:30:53', '2005-08-01T18:55:38', '2005-08-04T14:45:38', '1'), - ('277', '3332', '2006-02-16T02:30:53', '2005-07-31T14:20:59', '2005-08-03T09:30:59', '1'), - ('459', '1902', '2006-02-16T02:30:53', '2005-08-22T12:53:58', '2005-08-28T07:39:58', '1'), - ('577', '3563', '2006-02-16T02:30:53', '2005-07-28T10:24:22', '2005-08-04T07:15:22', '1'), - ('158', '1879', '2006-02-16T02:30:53', '2005-08-02T08:09:54', '2005-08-07T12:05:54', '1'), - ('553', '1914', '2006-02-16T02:30:53', '2005-08-23T02:48:24', '2005-08-28T04:10:24', '1'), - ('457', '4567', '2006-02-16T02:30:53', '2005-08-20T17:18:48', '2005-08-26T15:31:48', '1'), - ('273', '3142', '2006-02-16T02:30:53', '2005-07-06T02:46:13', '2005-07-06T22:08:13', '1'), - ('537', '958', '2006-02-16T02:30:53', '2005-07-31T16:31:17', '2005-08-06T13:52:17', '1'), - ('408', '1708', '2006-02-16T02:30:53', '2005-07-12T18:32:02', '2005-07-16T23:21:02', '1'), - ('38', '365', '2006-02-16T02:30:53', '2005-08-02T17:13:26', '2005-08-07T16:44:26', '1'), - ('578', '4440', '2006-02-16T02:30:53', '2005-08-23T08:34:10', '2005-08-30T12:31:10', '1'), - ('562', '4365', '2006-02-16T02:30:53', '2005-06-17T11:24:57', '2005-06-26T09:48:57', '1'), - ('84', '656', '2006-02-16T02:30:53', '2005-06-18T16:53:33', '2005-06-20T18:23:33', '1'), - ('319', '3428', '2006-02-16T02:30:53', '2005-08-17T18:29:35', '2005-08-25T23:39:35', '1'), - ('13', '420', '2006-02-16T02:30:53', '2005-08-19T10:49:03', '2005-08-21T05:33:03', '1'), - ('22', '3949', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('549', '3951', '2006-02-16T02:30:53', '2005-07-29T00:31:39', '2005-07-29T19:33:39', '1'), - ('133', '358', '2006-02-16T02:30:53', '2005-07-30T11:47:48', '2005-08-02T08:13:48', '1'), - ('172', '2959', '2006-02-16T02:30:53', '2005-07-27T06:34:32', '2005-07-28T03:01:32', '1'), - ('308', '1629', '2006-02-16T02:30:53', '2005-07-10T22:57:29', '2005-07-12T00:08:29', '1'), - ('557', '1911', '2006-02-16T02:30:53', '2005-07-30T18:01:15', '2005-08-05T23:10:15', '1'), - ('294', '3228', '2006-02-16T02:30:53', '2005-08-17T18:10:40', '2005-08-20T16:56:40', '1'), - ('549', '255', '2006-02-16T02:30:53', '2005-08-17T14:23:52', '2005-08-21T14:23:52', '1'), - ('20', '1238', '2006-02-16T02:30:53', '2005-07-28T10:06:10', '2005-08-04T08:38:10', '1'), - ('562', '308', '2006-02-16T02:30:53', '2005-07-08T13:09:45', '2005-07-14T10:10:45', '1'), - ('23', '171', '2006-02-16T02:30:53', '2005-07-27T07:18:46', '2005-08-04T10:28:46', '1'), - ('276', '94', '2006-02-16T02:30:53', '2005-07-30T08:02:39', '2005-08-06T12:02:39', '1'), - ('322', '4185', '2006-02-16T02:30:53', '2005-08-02T08:47:04', '2005-08-05T05:33:04', '1'), - ('9', '2052', '2006-02-16T02:30:53', '2005-07-28T07:51:56', '2005-07-30T12:18:56', '1'), - ('576', '730', '2006-02-16T02:30:53', '2005-08-19T09:43:39', '2005-08-24T10:03:39', '1'), - ('353', '4352', '2006-02-16T02:30:53', '2005-08-20T06:03:33', '2005-08-21T07:06:33', '1'), - ('457', '854', '2006-02-16T02:30:53', '2005-07-31T19:11:11', '2005-08-03T22:15:11', '1'), - ('517', '2540', '2006-02-16T02:30:53', '2005-06-19T01:38:39', '2005-06-23T00:16:39', '1'), - ('139', '1831', '2006-02-16T02:30:53', '2005-08-22T08:57:10', '2005-08-24T10:39:10', '1'), - ('75', '1386', '2006-02-16T02:30:53', '2005-08-17T18:56:02', '2005-08-20T17:36:02', '1'), - ('276', '3907', '2006-02-16T02:30:53', '2005-08-20T20:06:05', '2005-08-28T17:02:05', '1'), - ('470', '3754', '2006-02-16T02:30:53', '2005-08-01T02:05:34', '2005-08-01T23:40:34', '1'), - ('145', '4005', '2006-02-16T02:30:53', '2005-08-18T18:06:53', '2005-08-19T17:36:53', '1'), - ('276', '1152', '2006-02-16T02:30:53', '2005-08-18T01:17:32', '2005-08-25T19:32:32', '1'), - ('507', '998', '2006-02-16T02:30:53', '2005-07-28T13:58:38', '2005-08-02T12:27:38', '1'), - ('277', '2156', '2006-02-16T02:30:53', '2005-06-21T05:30:36', '2005-06-24T05:12:36', '1'), - ('405', '1053', '2006-02-16T02:30:53', '2005-05-25T19:41:29', '2005-05-29T21:31:29', '1'), - ('5', '2153', '2006-02-16T02:30:53', '2005-07-11T03:17:04', '2005-07-19T07:08:04', '1'), - ('409', '4549', '2006-02-16T02:30:53', '2005-07-10T17:28:14', '2005-07-14T11:54:14', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['7329', '3965', '6443', '860', '4353', '9785', '6596', '11756', '13514', '1995', '7840', '7765', '1407', '6627', '2273', '15684', '4523', '14143', '1832', '14627', '8057', '826', '2441', '7077', '5212', '9050', '3299', '2444', '5456', '14377', '13955', '1168', '1219', '9935', '15555', '10487', '161', '345', '791', '12075', '12456', '3887', '2586', '742', '93', '2961', '882', '11566', '14284', '1850', '15564', '8587', '1252', '8478', '8791', '8380', '2889', '4878', '13545', '11466', '2406', '11297', '3246', '1884', '1794', '2917', '9600', '13100', '11338', '1357', '12773', '15508', '1129', '15935', '14434', '5292', '2148', '9762', '14185', '11624', '2193', '7683', '13585', '1374', '7561', '1172', '4957', '2899', '7422', '6522', '7219', '4380', '3392', '15185', '5230', '11735', '7965', '10724', '5177', '10823']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('226', '906', '2006-02-16T02:30:53', '2005-07-27T13:55:34', '2005-08-04T15:15:34', '1'), - ('243', '2863', '2006-02-16T02:30:53', '2005-07-06T22:36:20', '2005-07-09T17:45:20', '1'), - ('155', '895', '2006-02-16T02:30:53', '2005-07-12T00:35:51', '2005-07-16T04:50:51', '1'), - ('276', '578', '2006-02-16T02:30:53', '2005-05-30T02:45:16', '2005-06-08T07:28:16', '1'), - ('452', '368', '2006-02-16T02:30:53', '2005-07-07T19:19:05', '2005-07-13T13:40:05', '1'), - ('587', '4101', '2006-02-16T02:30:53', '2005-07-31T10:22:15', '2005-08-02T10:02:15', '1'), - ('409', '890', '2006-02-16T02:30:53', '2005-07-12T07:32:59', '2005-07-13T02:47:59', '1'), - ('198', '1798', '2006-02-16T02:30:53', '2005-08-17T09:29:22', '2005-08-21T12:17:22', '1'), - ('96', '3407', '2006-02-16T02:30:53', '2005-08-20T02:28:09', '2005-08-25T00:41:09', '1'), - ('10', '1866', '2006-02-16T02:30:53', '2005-06-17T11:11:14', '2005-06-26T16:37:14', '1'), - ('482', '2899', '2006-02-16T02:30:53', '2005-07-28T09:03:02', '2005-08-06T06:15:02', '1'), - ('294', '4098', '2006-02-16T02:30:53', '2005-07-28T06:40:33', '2005-07-31T01:25:33', '1'), - ('89', '1286', '2006-02-16T02:30:53', '2005-06-15T16:45:07', '2005-06-23T14:01:07', '1'), - ('565', '626', '2006-02-16T02:30:53', '2005-07-12T09:16:46', '2005-07-17T10:58:46', '1'), - ('327', '4456', '2006-02-16T02:30:53', '2005-06-18T06:30:02', '2005-06-20T07:07:02', '1'), - ('586', '3976', '2006-02-16T02:30:53', '2005-08-23T09:40:04', '2005-08-28T15:28:04', '1'), - ('347', '2785', '2006-02-16T02:30:53', '2005-07-08T03:06:59', '2005-07-17T04:44:59', '1'), - ('146', '2549', '2006-02-16T02:30:53', '2005-08-21T02:10:32', '2005-08-23T23:50:32', '1'), - ('220', '500', '2006-02-16T02:30:53', '2005-06-16T22:35:20', '2005-06-19T03:09:20', '1'), - ('49', '2470', '2006-02-16T02:30:53', '2005-08-21T18:35:54', '2005-08-30T21:17:54', '1'), - ('483', '4177', '2006-02-16T02:30:53', '2005-07-28T17:07:13', '2005-08-03T16:25:13', '1'), - ('207', '2263', '2006-02-16T02:30:53', '2005-05-29T21:56:15', '2005-06-08T03:18:15', '1'), - ('593', '3148', '2006-02-16T02:30:53', '2005-06-18T18:45:11', '2005-06-20T00:42:11', '1'), - ('155', '3186', '2006-02-16T02:30:53', '2005-07-27T04:13:02', '2005-07-31T23:15:02', '1'), - ('400', '3240', '2006-02-16T02:30:53', '2005-07-09T11:37:47', '2005-07-15T14:42:47', '1'), - ('40', '106', '2006-02-16T02:30:53', '2005-07-30T06:59:55', '2005-08-06T06:37:55', '1'), - ('199', '3427', '2006-02-16T02:30:53', '2005-06-21T07:23:34', '2005-06-27T04:02:34', '1'), - ('576', '2233', '2006-02-16T02:30:53', '2005-06-18T18:58:12', '2005-06-27T20:48:12', '1'), - ('360', '3003', '2006-02-16T02:30:53', '2005-07-09T22:31:45', '2005-07-12T03:53:45', '1'), - ('6', '1325', '2006-02-16T02:30:53', '2005-08-21T09:49:28', '2005-08-29T13:34:28', '1'), - ('273', '2613', '2006-02-16T02:30:53', '2005-08-20T18:05:12', '2005-08-29T18:25:12', '1'), - ('481', '4368', '2006-02-16T02:30:53', '2005-06-14T23:35:09', '2005-06-19T03:20:09', '1'), - ('330', '3005', '2006-02-16T02:30:53', '2005-06-15T03:25:59', '2005-06-20T00:37:59', '1'), - ('10', '2247', '2006-02-16T02:30:53', '2005-07-31T15:27:07', '2005-08-05T11:23:07', '1'), - ('347', '1869', '2006-02-16T02:30:53', '2005-08-23T04:51:52', '2005-08-24T01:01:52', '1'), - ('577', '1121', '2006-02-16T02:30:53', '2005-08-01T10:26:34', '2005-08-07T16:11:34', '1'), - ('182', '2941', '2006-02-16T02:30:53', '2005-05-26T01:51:48', '2005-05-27T05:42:48', '1'), - ('144', '1396', '2006-02-16T02:30:53', '2005-05-27T04:32:25', '2005-05-31T09:50:25', '1'), - ('284', '1554', '2006-02-16T02:30:53', '2005-05-29T16:30:42', '2005-06-01T19:11:42', '1'), - ('125', '3147', '2006-02-16T02:30:53', '2005-08-17T21:54:55', '2005-08-23T23:04:55', '1'), - ('85', '4578', '2006-02-16T02:30:53', '2005-08-18T11:21:51', '2005-08-21T13:28:51', '1'), - ('530', '1695', '2006-02-16T02:30:53', '2005-07-06T18:46:34', '2005-07-07T13:15:34', '1'), - ('537', '4104', '2006-02-16T02:30:53', '2005-06-19T05:05:11', '2005-06-27T00:23:11', '1'), - ('483', '273', '2006-02-16T02:30:53', '2005-05-29T08:36:30', '2005-06-05T11:30:30', '1'), - ('288', '4360', '2006-02-16T02:30:53', '2005-05-25T15:54:16', '2005-06-03T20:18:16', '1'), - ('399', '4539', '2006-02-16T02:30:53', '2005-06-20T07:29:15', '2005-06-24T08:05:15', '1'), - ('477', '3841', '2006-02-16T02:30:53', '2005-05-30T06:16:06', '2005-06-02T11:57:06', '1'), - ('520', '4020', '2006-02-16T02:30:53', '2005-08-17T01:28:35', '2005-08-20T22:42:35', '1'), - ('486', '633', '2006-02-16T02:30:53', '2005-08-21T06:44:37', '2005-08-28T05:03:37', '1'), - ('517', '761', '2006-02-16T02:30:53', '2005-06-17T00:31:35', '2005-06-25T05:19:35', '1'), - ('353', '1268', '2006-02-16T02:30:53', '2005-08-23T05:10:42', '2005-08-30T03:17:42', '1'), - ('108', '1941', '2006-02-16T02:30:53', '2005-07-29T12:18:40', '2005-08-03T14:01:40', '1'), - ('89', '1147', '2006-02-16T02:30:53', '2005-06-15T06:05:18', '2005-06-24T07:40:18', '1'), - ('162', '3742', '2006-02-16T02:30:53', '2005-07-29T08:40:36', '2005-08-01T10:23:36', '1'), - ('469', '1677', '2006-02-16T02:30:53', '2005-07-29T20:53:23', '2005-07-31T18:14:23', '1'), - ('145', '2279', '2006-02-16T02:30:53', '2005-07-29T05:31:29', '2005-08-02T01:27:29', '1'), - ('213', '151', '2006-02-16T02:30:53', '2005-06-20T01:54:08', '2005-06-23T06:33:08', '1'), - ('172', '4009', '2006-02-16T02:30:53', '2005-07-08T19:33:49', '2005-07-17T17:47:49', '1'), - ('417', '615', '2006-02-16T02:30:53', '2005-08-20T03:50:15', '2005-08-27T22:24:15', '1'), - ('556', '3363', '2006-02-16T02:30:53', '2005-08-02T21:46:46', '2005-08-06T01:42:46', '1'), - ('497', '1321', '2006-02-16T02:30:53', '2005-06-18T16:39:37', '2005-06-23T12:04:37', '1'), - ('62', '2531', '2006-02-16T02:30:53', '2005-08-02T15:22:47', '2005-08-11T18:45:47', '1'), - ('41', '4432', '2006-02-16T02:30:53', '2005-06-21T03:10:01', '2005-06-28T00:46:01', '1'), - ('305', '4567', '2006-02-16T02:30:53', '2005-06-17T03:19:20', '2005-06-21T00:19:20', '1'), - ('452', '497', '2006-02-16T02:30:53', '2005-06-16T20:08:37', '2005-06-22T01:54:37', '1'), - ('451', '647', '2006-02-16T02:30:53', '2005-06-20T04:08:35', '2005-06-24T01:17:35', '1'), - ('464', '3731', '2006-02-16T02:30:53', '2005-07-31T03:35:34', '2005-08-08T22:50:34', '1'), - ('451', '916', '2006-02-16T02:30:53', '2005-08-19T10:55:45', '2005-08-25T12:28:45', '1'), - ('26', '3689', '2006-02-16T02:30:53', '2005-08-02T17:00:12', '2005-08-03T18:54:12', '1'), - ('205', '2285', '2006-02-16T02:30:53', '2005-06-15T13:26:23', '2005-06-23T14:12:23', '1'), - ('360', '4390', '2006-02-16T02:30:53', '2005-08-18T23:32:19', '2005-08-27T04:40:19', '1'), - ('293', '4035', '2006-02-16T02:30:53', '2005-08-23T02:49:04', '2005-08-29T00:58:04', '1'), - ('486', '386', '2006-02-16T02:30:53', '2005-05-31T18:00:48', '2005-06-04T23:05:48', '1'), - ('361', '907', '2006-02-16T02:30:53', '2005-08-23T18:41:11', '2005-08-25T20:59:11', '1'), - ('549', '2085', '2006-02-16T02:30:53', '2005-08-21T11:40:46', '2005-08-24T05:50:46', '1'), - ('62', '3195', '2006-02-16T02:30:53', '2005-07-09T15:16:54', '2005-07-11T15:21:54', '1'), - ('338', '315', '2006-02-16T02:30:53', '2005-06-17T22:44:35', '2005-06-26T19:43:35', '1'), - ('540', '155', '2006-02-16T02:30:53', '2005-07-31T09:32:54', '2005-08-05T04:55:54', '1'), - ('579', '3957', '2006-02-16T02:30:53', '2005-08-21T03:28:37', '2005-08-26T01:15:37', '1'), - ('527', '606', '2006-02-16T02:30:53', '2005-08-17T04:17:42', '2005-08-18T02:46:42', '1'), - ('112', '1013', '2006-02-16T02:30:53', '2005-06-18T01:38:45', '2005-06-22T19:51:45', '1'), - ('73', '1760', '2006-02-16T02:30:53', '2005-07-28T03:11:29', '2005-08-04T00:14:29', '1'), - ('470', '3314', '2006-02-16T02:30:53', '2005-08-20T05:32:23', '2005-08-27T23:36:23', '1'), - ('120', '3353', '2006-02-16T02:30:53', '2005-06-15T14:49:54', '2005-06-22T12:30:54', '1'), - ('291', '3433', '2006-02-16T02:30:53', '2005-07-27T22:21:05', '2005-08-04T01:02:05', '1'), - ('306', '2685', '2006-02-16T02:30:53', '2005-06-14T23:54:34', '2005-06-16T02:26:34', '1'), - ('399', '4082', '2006-02-16T02:30:53', '2005-07-08T23:18:48', '2005-07-09T23:13:48', '1'), - ('459', '1919', '2006-02-16T02:30:53', '2005-06-20T02:39:21', '2005-06-23T06:47:21', '1'), - ('286', '3954', '2006-02-16T02:30:53', '2005-07-27T17:10:42', '2005-08-03T19:32:42', '1'), - ('142', '3916', '2006-02-16T02:30:53', '2005-07-12T04:11:58', '2005-07-15T08:32:58', '1'), - ('512', '4046', '2006-02-16T02:30:53', '2005-07-27T09:35:36', '2005-07-29T04:44:36', '1'), - ('353', '3164', '2006-02-16T02:30:53', '2005-07-07T20:35:00', '2005-07-14T17:06:00', '1'), - ('38', '3343', '2006-02-16T02:30:53', '2005-06-21T15:12:44', '2005-06-29T18:19:44', '1'), - ('472', '2948', '2006-02-16T02:30:53', '2005-08-22T15:52:50', '2005-08-31T20:38:50', '1'), - ('51', '3707', '2006-02-16T02:30:53', '2005-07-09T12:30:23', '2005-07-13T08:41:23', '1'), - ('452', '2555', '2006-02-16T02:30:53', '2005-08-17T08:35:42', '2005-08-26T11:04:42', '1'), - ('134', '3671', '2006-02-16T02:30:53', '2005-07-28T13:52:57', '2005-07-29T14:54:57', '1'), - ('576', '3425', '2006-02-16T02:30:53', '2005-08-01T19:10:59', '2005-08-07T18:44:59', '1'), - ('452', '1675', '2006-02-16T02:30:53', '2005-07-09T09:43:21', '2005-07-13T07:29:21', '1'), - ('405', '3322', '2006-02-16T02:30:53', '2005-08-01T22:59:10', '2005-08-08T23:44:10', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['8896', '10108', '15551', '15850', '7328', '1777', '3029', '1631', '2813', '4476', '695', '11987', '2357', '10892', '10864', '14525', '13166', '8694', '1947', '9186', '8616', '15583', '12239', '5519', '6675', '12986', '4111', '5566', '11397', '1982', '7027', '12112', '5403', '9432', '11954', '12390', '707', '13927', '6841', '14544', '6126', '4123', '5159', '2962', '10218', '7858', '15386', '4210', '13738', '12482', '15072', '1829', '2147', '10850', '11454', '8404', '11303', '9052', '15579', '11388', '5370', '13264', '3660', '8498', '15844', '3255', '1100', '8169', '894', '10232', '11879', '15608', '15100', '9093', '5483', '13494', '3755', '10971', '14665', '15364', '5304', '251', '10878', '3438', '12567', '9267', '9406', '11331', '12699', '6553', '3071', '1176', '12737', '2550', '7913', '9925', '540', '5842', '2580', '14252']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('205', '3560', '2006-02-16T02:30:53', '2005-07-30T00:51:21', '2005-07-31T22:33:21', '1'), - ('326', '3703', '2006-02-16T02:30:53', '2005-07-31T21:02:14', '2005-08-01T18:28:14', '1'), - ('345', '3570', '2006-02-16T02:30:53', '2005-08-23T04:28:25', '2005-08-26T07:19:25', '1'), - ('563', '586', '2006-02-16T02:30:53', '2005-08-23T15:45:42', '2005-08-27T19:24:42', '1'), - ('26', '663', '2006-02-16T02:30:53', '2005-07-27T13:55:18', '2005-08-01T19:52:18', '1'), - ('49', '3325', '2006-02-16T02:30:53', '2005-06-16T18:52:12', '2005-06-25T13:55:12', '1'), - ('317', '327', '2006-02-16T02:30:53', '2005-06-20T11:51:30', '2005-06-25T16:42:30', '1'), - ('5', '2466', '2006-02-16T02:30:53', '2005-06-16T08:01:02', '2005-06-19T09:04:02', '1'), - ('284', '3420', '2006-02-16T02:30:53', '2005-06-19T20:01:47', '2005-06-27T01:51:47', '1'), - ('279', '395', '2006-02-16T02:30:53', '2005-07-08T00:34:25', '2005-07-08T22:55:25', '1'), - ('528', '4276', '2006-02-16T02:30:53', '2005-05-29T01:50:53', '2005-06-03T02:28:53', '1'), - ('494', '1478', '2006-02-16T02:30:53', '2005-08-17T18:21:59', '2005-08-25T19:20:59', '1'), - ('561', '1323', '2006-02-16T02:30:53', '2005-06-18T12:59:41', '2005-06-26T16:40:41', '1'), - ('109', '3243', '2006-02-16T02:30:53', '2005-08-02T01:12:06', '2005-08-09T23:53:06', '1'), - ('134', '1694', '2006-02-16T02:30:53', '2005-08-02T00:18:59', '2005-08-08T22:20:59', '1'), - ('420', '3020', '2006-02-16T02:30:53', '2005-08-21T15:06:49', '2005-08-22T16:30:49', '1'), - ('504', '4386', '2006-02-16T02:30:53', '2005-08-19T13:36:28', '2005-08-22T07:57:28', '1'), - ('345', '503', '2006-02-16T02:30:53', '2005-07-29T16:44:48', '2005-08-06T16:28:48', '1'), - ('479', '3344', '2006-02-16T02:30:53', '2005-06-17T08:02:20', '2005-06-25T10:25:20', '1'), - ('273', '4513', '2006-02-16T02:30:53', '2005-07-30T12:13:48', '2005-07-31T11:59:48', '1'), - ('493', '2583', '2006-02-16T02:30:53', '2005-07-29T13:39:09', '2005-08-01T16:49:09', '1'), - ('215', '4299', '2006-02-16T02:30:53', '2005-08-23T05:47:55', '2005-08-26T01:46:55', '1'), - ('75', '1948', '2006-02-16T02:30:53', '2005-08-18T03:26:42', '2005-08-24T23:48:42', '1'), - ('85', '1312', '2006-02-16T02:30:53', '2005-07-10T01:18:32', '2005-07-11T20:39:32', '1'), - ('523', '2124', '2006-02-16T02:30:53', '2005-07-12T11:53:06', '2005-07-13T06:09:06', '1'), - ('210', '1145', '2006-02-16T02:30:53', '2005-08-19T07:09:36', '2005-08-22T05:01:36', '1'), - ('515', '1009', '2006-02-16T02:30:53', '2005-07-07T06:47:56', '2005-07-13T02:13:56', '1'), - ('124', '1343', '2006-02-16T02:30:53', '2005-07-10T03:30:17', '2005-07-13T06:32:17', '1'), - ('470', '2566', '2006-02-16T02:30:53', '2005-08-02T18:53:14', '2005-08-09T18:09:14', '1'), - ('566', '1091', '2006-02-16T02:30:53', '2005-06-17T10:12:15', '2005-06-20T13:56:15', '1'), - ('61', '3280', '2006-02-16T02:30:53', '2005-07-27T02:50:15', '2005-08-04T02:58:15', '1'), - ('576', '4290', '2006-02-16T02:30:53', '2005-08-17T23:00:31', '2005-08-25T02:05:31', '1'), - ('36', '3991', '2006-02-16T02:30:53', '2005-07-09T20:07:09', '2005-07-12T18:33:09', '1'), - ('570', '2489', '2006-02-16T02:30:53', '2005-07-30T21:26:18', '2005-08-05T00:23:18', '1'), - ('145', '220', '2006-02-16T02:30:53', '2005-08-17T17:18:36', '2005-08-18T19:49:36', '1'), - ('377', '3603', '2006-02-16T02:30:53', '2005-08-18T08:51:42', '2005-08-23T13:06:42', '1'), - ('252', '819', '2006-02-16T02:30:53', '2005-05-29T03:18:19', '2005-05-30T02:45:19', '1'), - ('417', '4284', '2006-02-16T02:30:53', '2005-08-20T17:11:58', '2005-08-24T12:44:58', '1'), - ('108', '2265', '2006-02-16T02:30:53', '2005-07-12T19:04:24', '2005-07-14T23:58:24', '1'), - ('589', '2445', '2006-02-16T02:30:53', '2005-08-21T15:41:01', '2005-08-24T15:20:01', '1'), - ('230', '1069', '2006-02-16T02:30:53', '2005-07-11T08:06:56', '2005-07-16T11:42:56', '1'), - ('469', '2707', '2006-02-16T02:30:53', '2005-07-07T07:16:19', '2005-07-10T05:23:19', '1'), - ('213', '3479', '2006-02-16T02:30:53', '2005-07-09T08:55:52', '2005-07-10T04:32:52', '1'), - ('364', '2978', '2006-02-16T02:30:53', '2005-06-20T07:31:55', '2005-06-26T04:43:55', '1'), - ('101', '3886', '2006-02-16T02:30:53', '2005-08-01T01:09:44', '2005-08-05T20:08:44', '1'), - ('144', '992', '2006-02-16T02:30:53', '2005-07-28T09:50:18', '2005-08-05T14:33:18', '1'), - ('327', '3056', '2006-02-16T02:30:53', '2005-08-22T22:41:14', '2005-08-29T22:29:14', '1'), - ('581', '1972', '2006-02-16T02:30:53', '2005-07-07T11:36:20', '2005-07-16T12:38:20', '1'), - ('273', '2748', '2006-02-16T02:30:53', '2005-08-20T10:42:42', '2005-08-25T09:32:42', '1'), - ('247', '3778', '2006-02-16T02:30:53', '2005-08-18T12:37:36', '2005-08-26T09:53:36', '1'), - ('405', '2871', '2006-02-16T02:30:53', '2005-08-22T10:58:45', '2005-08-30T16:18:45', '1'), - ('293', '617', '2006-02-16T02:30:53', '2005-06-16T22:14:21', '2005-06-21T16:51:21', '1'), - ('279', '2752', '2006-02-16T02:30:53', '2005-06-17T22:28:13', '2005-06-22T20:50:13', '1'), - ('199', '1853', '2006-02-16T02:30:53', '2005-08-01T23:53:45', '2005-08-10T21:11:45', '1'), - ('199', '2901', '2006-02-16T02:30:53', '2005-08-02T21:04:39', '2005-08-05T19:03:39', '1'), - ('65', '2086', '2006-02-16T02:30:53', '2005-07-29T06:27:01', '2005-08-07T04:33:01', '1'), - ('417', '1817', '2006-02-16T02:30:53', '2005-08-02T15:39:18', '2005-08-05T10:59:18', '1'), - ('408', '3351', '2006-02-16T02:30:53', '2005-07-30T07:06:08', '2005-08-03T10:30:08', '1'), - ('480', '3986', '2006-02-16T02:30:53', '2005-08-23T05:38:41', '2005-08-29T09:18:41', '1'), - ('369', '477', '2006-02-16T02:30:53', '2005-08-02T18:35:55', '2005-08-09T21:56:55', '1'), - ('248', '2193', '2006-02-16T02:30:53', '2005-07-09T18:43:19', '2005-07-15T19:59:19', '1'), - ('109', '1881', '2006-02-16T02:30:53', '2005-08-19T17:27:10', '2005-08-27T16:00:10', '1'), - ('507', '1129', '2006-02-16T02:30:53', '2005-07-06T08:07:29', '2005-07-14T08:46:29', '1'), - ('190', '4468', '2006-02-16T02:30:53', '2005-07-29T09:07:38', '2005-08-04T07:01:38', '1'), - ('119', '2027', '2006-02-16T02:30:53', '2005-08-23T15:38:12', '2005-08-26T15:18:12', '1'), - ('482', '2564', '2006-02-16T02:30:53', '2005-06-21T03:39:52', '2005-06-24T04:02:52', '1'), - ('497', '316', '2006-02-16T02:30:53', '2005-05-31T14:03:21', '2005-06-06T16:08:21', '1'), - ('366', '4086', '2006-02-16T02:30:53', '2005-07-28T21:29:46', '2005-08-06T22:29:46', '1'), - ('400', '1118', '2006-02-16T02:30:53', '2005-05-30T08:31:31', '2005-06-07T12:39:31', '1'), - ('512', '586', '2006-02-16T02:30:53', '2005-08-01T01:50:55', '2005-08-03T04:12:55', '1'), - ('312', '2500', '2006-02-16T02:30:53', '2005-08-17T14:25:09', '2005-08-26T09:19:09', '1'), - ('454', '2921', '2006-02-16T02:30:53', '2005-08-23T06:55:26', '2005-08-28T10:24:26', '1'), - ('312', '4489', '2006-02-16T02:30:53', '2005-08-22T11:55:03', '2005-08-25T14:55:03', '1'), - ('96', '2208', '2006-02-16T02:30:53', '2005-07-30T08:33:24', '2005-08-04T11:07:24', '1'), - ('89', '4362', '2006-02-16T02:30:53', '2005-07-09T23:54:09', '2005-07-17T23:36:09', '1'), - ('414', '1632', '2006-02-16T02:30:53', '2005-08-20T01:36:34', '2005-08-21T06:52:34', '1'), - ('402', '3147', '2006-02-16T02:30:53', '2005-07-06T12:37:16', '2005-07-13T07:22:16', '1'), - ('383', '2789', '2006-02-16T02:30:53', '2005-08-02T04:08:17', '2005-08-09T00:02:17', '1'), - ('58', '2896', '2006-02-16T02:30:53', '2005-08-21T19:49:46', '2005-08-30T18:00:46', '1'), - ('204', '4184', '2006-02-16T02:30:53', '2005-08-22T21:41:41', '2005-08-28T00:49:41', '1'), - ('51', '4411', '2006-02-16T02:30:53', '2005-07-09T15:48:06', '2005-07-14T19:29:06', '1'), - ('204', '4352', '2006-02-16T02:30:53', '2005-05-26T14:35:40', '2005-05-29T17:17:40', '1'), - ('45', '3511', '2006-02-16T02:30:53', '2005-08-02T00:33:12', '2005-08-07T06:02:12', '1'), - ('556', '1757', '2006-02-16T02:30:53', '2005-06-21T19:31:40', '2005-06-30T19:08:40', '1'), - ('308', '2931', '2006-02-16T02:30:53', '2005-08-18T15:14:36', '2005-08-26T18:56:36', '1'), - ('409', '645', '2006-02-16T02:30:53', '2005-07-30T14:59:05', '2005-08-04T10:17:05', '1'), - ('453', '3419', '2006-02-16T02:30:53', '2005-07-30T20:24:00', '2005-08-07T19:50:00', '1'), - ('568', '3789', '2006-02-16T02:30:53', '2005-08-02T16:49:01', '2005-08-09T19:15:01', '1'), - ('66', '3695', '2006-02-16T02:30:53', '2005-08-18T20:20:59', '2005-08-22T17:00:59', '1'), - ('265', '1137', '2006-02-16T02:30:53', '2005-07-12T05:06:39', '2005-07-21T10:37:39', '1'), - ('582', '1198', '2006-02-16T02:30:53', '2005-06-20T14:20:42', '2005-06-24T19:01:42', '1'), - ('512', '2715', '2006-02-16T02:30:53', '2005-06-15T00:28:37', '2005-06-21T21:42:37', '1'), - ('204', '736', '2006-02-16T02:30:53', '2005-08-18T22:11:37', '2005-08-26T04:08:37', '1'), - ('38', '1370', '2006-02-16T02:30:53', '2005-06-19T02:49:55', '2005-06-24T01:37:55', '1'), - ('459', '4001', '2006-02-16T02:30:53', '2005-07-28T11:47:23', '2005-08-05T06:36:23', '1'), - ('24', '2351', '2006-02-16T02:30:53', '2005-07-31T15:08:47', '2005-08-02T20:27:47', '1'), - ('119', '3321', '2006-02-16T02:30:53', '2005-05-28T06:40:25', '2005-06-06T00:47:25', '1'), - ('247', '139', '2006-02-16T02:30:53', '2005-07-10T17:11:37', '2005-07-14T21:43:37', '1'), - ('219', '2527', '2006-02-16T02:30:53', '2005-06-19T04:44:30', '2005-06-23T04:15:30', '1'), - ('13', '2660', '2006-02-16T02:30:53', '2005-08-21T05:44:07', '2005-08-29T08:53:07', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['8890', '1057', '15963', '7537', '11028', '9091', '7643', '7829', '1597', '2442', '6571', '5815', '9792', '12182', '731', '5829', '14520', '13013', '15453', '909', '2414', '11001', '1797', '13659', '14430', '5172', '10696', '10727', '15479', '9509', '12595', '3551', '7060', '5747', '5141', '14708', '11186', '9332', '8029', '1028', '7371', '7822', '8939', '14265', '6327', '10766', '15370', '11014', '58', '11227', '6227', '5749', '4862', '7523', '14237', '13748', '4267', '5150', '14298', '11694', '4062', '2400', '2073', '11472', '2255', '6148', '14319', '1514', '11187', '14819', '10402', '5330', '15518', '10837', '5192', '6151', '10346', '3448', '7461', '10617', '11059', '7790', '3813', '1117', '10247', '7469', '3108', '7675', '4203', '9506', '16008', '1834', '3763', '7593', '8097', '12429', '13099', '3851', '8027', '9539']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('470', '3656', '2006-02-16T02:30:53', '2005-07-30T00:42:06', '2005-08-05T21:04:06', '1'), - ('124', '497', '2006-02-16T02:30:53', '2005-05-31T07:58:06', '2005-06-06T03:21:06', '1'), - ('134', '3819', '2006-02-16T02:30:53', '2005-08-23T19:42:46', '2005-08-25T22:12:46', '1'), - ('269', '4456', '2006-02-16T02:30:53', '2005-07-27T21:36:09', '2005-08-01T01:51:09', '1'), - ('66', '2764', '2006-02-16T02:30:53', '2005-08-02T05:48:20', '2005-08-10T11:21:20', '1'), - ('66', '2249', '2006-02-16T02:30:53', '2005-07-30T08:30:45', '2005-08-07T13:28:45', '1'), - ('407', '4369', '2006-02-16T02:30:53', '2005-07-28T01:19:44', '2005-08-04T21:16:44', '1'), - ('5', '111', '2006-02-16T02:30:53', '2005-07-28T08:43:39', '2005-08-04T14:33:39', '1'), - ('432', '743', '2006-02-16T02:30:53', '2005-06-16T05:47:03', '2005-06-18T04:21:03', '1'), - ('364', '4045', '2006-02-16T02:30:53', '2005-06-18T18:49:18', '2005-06-22T16:18:18', '1'), - ('140', '3700', '2006-02-16T02:30:53', '2005-07-12T05:51:47', '2005-07-15T11:31:47', '1'), - ('22', '2934', '2006-02-16T02:30:53', '2005-07-10T15:48:19', '2005-07-13T12:09:19', '1'), - ('292', '3163', '2006-02-16T02:30:53', '2005-07-31T10:43:41', '2005-08-07T10:18:41', '1'), - ('555', '296', '2006-02-16T02:30:53', '2005-08-18T01:30:19', '2005-08-21T05:52:19', '1'), - ('5', '4124', '2006-02-16T02:30:53', '2005-05-29T07:25:16', '2005-05-30T05:21:16', '1'), - ('118', '3405', '2006-02-16T02:30:53', '2005-07-10T16:29:41', '2005-07-14T22:03:41', '1'), - ('150', '4533', '2006-02-16T02:30:53', '2005-08-21T15:00:49', '2005-08-30T19:04:49', '1'), - ('293', '841', '2006-02-16T02:30:53', '2005-08-19T07:55:51', '2005-08-26T05:14:51', '1'), - ('359', '2', '2006-02-16T02:30:53', '2005-08-23T01:01:01', '2005-08-30T20:08:01', '1'), - ('486', '3775', '2006-02-16T02:30:53', '2005-05-30T10:43:38', '2005-06-08T12:07:38', '1'), - ('275', '4500', '2006-02-16T02:30:53', '2005-06-18T17:01:55', '2005-06-20T17:42:55', '1'), - ('5', '3701', '2006-02-16T02:30:53', '2005-08-02T04:56:45', '2005-08-11T08:04:45', '1'), - ('275', '3435', '2006-02-16T02:30:53', '2005-06-16T20:13:03', '2005-06-22T22:56:03', '1'), - ('520', '3610', '2006-02-16T02:30:53', '2005-08-20T08:05:52', '2005-08-24T12:38:52', '1'), - ('5', '2623', '2006-02-16T02:30:53', '2005-08-21T11:31:11', '2005-08-26T06:29:11', '1'), - ('214', '4046', '2006-02-16T02:30:53', '2005-07-09T09:31:27', '2005-07-13T04:03:27', '1'), - ('120', '47', '2006-02-16T02:30:53', '2005-08-01T18:18:13', '2005-08-04T14:09:13', '1'), - ('16', '2049', '2006-02-16T02:30:53', '2005-08-01T19:15:08', '2005-08-03T13:52:08', '1'), - ('149', '4182', '2006-02-16T02:30:53', '2005-08-23T01:50:53', '2005-08-29T00:53:53', '1'), - ('320', '818', '2006-02-16T02:30:53', '2005-07-31T00:22:42', '2005-08-03T23:24:42', '1'), - ('286', '1662', '2006-02-16T02:30:53', '2005-08-18T16:27:08', '2005-08-19T14:53:08', '1'), - ('111', '3602', '2006-02-16T02:30:53', '2005-07-06T02:33:48', '2005-07-13T04:38:48', '1'), - ('479', '3912', '2006-02-16T02:30:53', '2005-07-27T03:51:04', '2005-08-03T07:53:04', '1'), - ('583', '4562', '2006-02-16T02:30:53', '2005-07-10T12:15:33', '2005-07-18T10:11:33', '1'), - ('488', '590', '2006-02-16T02:30:53', '2005-07-09T08:05:14', '2005-07-18T04:36:14', '1'), - ('226', '2828', '2006-02-16T02:30:53', '2005-08-21T21:07:23', '2005-08-28T15:47:23', '1'), - ('353', '733', '2006-02-16T02:30:53', '2005-08-02T11:12:08', '2005-08-03T10:46:08', '1'), - ('480', '1156', '2006-02-16T02:30:53', '2005-07-30T17:53:39', '2005-08-02T12:25:39', '1'), - ('61', '4273', '2006-02-16T02:30:53', '2005-07-28T16:11:21', '2005-08-05T13:52:21', '1'), - ('51', '4479', '2006-02-16T02:30:53', '2005-05-31T03:48:05', '2005-06-01T03:51:05', '1'), - ('577', '1807', '2006-02-16T02:30:53', '2005-07-27T15:18:42', '2005-08-01T09:58:42', '1'), - ('156', '1428', '2006-02-16T02:30:53', '2005-07-28T08:31:45', '2005-07-31T11:06:45', '1'), - ('598', '4175', '2006-02-16T02:30:53', '2005-07-30T02:56:53', '2005-08-01T21:19:53', '1'), - ('134', '3116', '2006-02-16T02:30:53', '2005-08-21T06:20:14', '2005-08-23T09:05:14', '1'), - ('146', '909', '2006-02-16T02:30:53', '2005-07-11T19:07:29', '2005-07-15T16:09:29', '1'), - ('420', '947', '2006-02-16T02:30:53', '2005-08-01T20:36:29', '2005-08-04T00:30:29', '1'), - ('10', '67', '2006-02-16T02:30:53', '2005-08-22T21:59:29', '2005-08-27T16:32:29', '1'), - ('269', '393', '2006-02-16T02:30:53', '2005-08-02T05:12:22', '2005-08-07T09:33:22', '1'), - ('323', '3050', '2006-02-16T02:30:53', '2005-05-25T08:53:14', '2005-05-28T14:40:14', '1'), - ('65', '1101', '2006-02-16T02:30:53', '2005-08-02T12:48:05', '2005-08-11T14:08:05', '1'), - ('210', '1654', '2006-02-16T02:30:53', '2005-07-11T13:56:46', '2005-07-18T12:53:46', '1'), - ('304', '1768', '2006-02-16T02:30:53', '2005-07-10T12:20:36', '2005-07-19T10:39:36', '1'), - ('291', '293', '2006-02-16T02:30:53', '2005-07-08T19:02:46', '2005-07-17T20:17:46', '1'), - ('410', '4153', '2006-02-16T02:30:53', '2005-07-27T21:11:23', '2005-07-28T16:37:23', '1'), - ('410', '3284', '2006-02-16T02:30:53', '2005-08-21T05:15:00', '2005-08-25T10:06:00', '1'), - ('410', '2198', '2006-02-16T02:30:53', '2005-08-20T10:59:54', '2005-08-23T12:33:54', '1'), - ('410', '136', '2006-02-16T02:30:53', '2005-07-07T14:35:30', '2005-07-11T10:41:30', '1'), - ('410', '1961', '2006-02-16T02:30:53', '2005-07-09T08:28:40', '2005-07-16T04:47:40', '1'), - ('410', '4317', '2006-02-16T02:30:53', '2005-08-21T07:17:10', '2005-08-25T10:10:10', '1'), - ('410', '3540', '2006-02-16T02:30:53', '2005-08-17T06:57:30', '2005-08-24T07:52:30', '1'), - ('410', '1323', '2006-02-16T02:30:53', '2005-07-07T04:22:27', '2005-07-09T03:27:27', '1'), - ('410', '3194', '2006-02-16T02:30:53', '2005-06-18T16:10:46', '2005-06-25T20:34:46', '1'), - ('410', '3530', '2006-02-16T02:30:53', '2005-06-17T16:33:59', '2005-06-19T11:57:59', '1'), - ('410', '1829', '2006-02-16T02:30:53', '2005-08-02T21:49:06', '2005-08-11T20:17:06', '1'), - ('410', '24', '2006-02-16T02:30:53', '2005-06-18T05:21:12', '2005-06-26T09:19:12', '1'), - ('410', '4318', '2006-02-16T02:30:53', '2005-07-11T09:14:22', '2005-07-12T08:01:22', '1'), - ('410', '4480', '2006-02-16T02:30:53', '2005-08-21T08:00:55', '2005-08-26T05:04:55', '1'), - ('410', '2937', '2006-02-16T02:30:53', '2005-06-15T22:57:34', '2005-06-19T20:27:34', '1'), - ('410', '3626', '2006-02-16T02:30:53', '2005-08-02T11:16:19', '2005-08-11T06:11:19', '1'), - ('410', '2890', '2006-02-16T02:30:53', '2005-08-22T01:17:19', '2005-08-30T05:54:19', '1'), - ('410', '274', '2006-02-16T02:30:53', '2005-08-01T07:27:19', '2005-08-04T12:30:19', '1'), - ('410', '3812', '2006-02-16T02:30:53', '2005-07-09T16:53:57', '2005-07-18T19:54:57', '1'), - ('410', '3522', '2006-02-16T02:30:53', '2005-08-23T03:19:34', '2005-08-24T02:55:34', '1'), - ('410', '1816', '2006-02-16T02:30:53', '2005-08-01T23:30:22', '2005-08-07T23:02:22', '1'), - ('410', '1225', '2006-02-16T02:30:53', '2005-07-09T10:27:09', '2005-07-10T12:04:09', '1'), - ('476', '352', '2006-02-16T02:30:53', '2005-07-11T09:25:17', '2005-07-12T05:11:17', '1'), - ('476', '4192', '2006-02-16T02:30:53', '2005-08-01T05:19:23', '2005-08-06T01:00:23', '1'), - ('476', '592', '2006-02-16T02:30:53', '2005-06-21T20:59:20', '2005-06-24T15:40:20', '1'), - ('476', '1236', '2006-02-16T02:30:53', '2005-07-27T18:45:15', '2005-07-29T17:19:15', '1'), - ('476', '4344', '2006-02-16T02:30:53', '2005-08-01T15:05:52', '2005-08-09T18:54:52', '1'), - ('189', '428', '2006-02-16T02:30:53', '2005-08-02T06:41:38', '2005-08-09T04:34:38', '1'), - ('189', '2327', '2006-02-16T02:30:53', '2005-07-28T07:22:35', '2005-07-30T02:59:35', '1'), - ('189', '4100', '2006-02-16T02:30:53', '2005-07-06T15:23:34', '2005-07-08T19:03:34', '1'), - ('189', '4125', '2006-02-16T02:30:53', '2005-05-31T16:15:31', '2005-06-04T17:20:31', '1'), - ('189', '4035', '2006-02-16T02:30:53', '2005-08-01T02:34:06', '2005-08-09T02:33:06', '1'), - ('189', '3723', '2006-02-16T02:30:53', '2005-07-27T18:57:40', '2005-07-31T00:17:40', '1'), - ('189', '2218', '2006-02-16T02:30:53', '2005-06-20T17:28:43', '2005-06-27T21:23:43', '1'), - ('189', '153', '2006-02-16T02:30:53', '2005-07-28T02:55:20', '2005-07-31T05:27:20', '1'), - ('189', '2743', '2006-02-16T02:30:53', '2005-07-07T11:24:14', '2005-07-11T16:26:14', '1'), - ('189', '3872', '2006-02-16T02:30:53', '2005-07-31T00:19:01', '2005-08-02T00:20:01', '1'), - ('189', '3273', '2006-02-16T02:30:53', '2005-08-23T21:04:51', '2005-08-31T22:09:51', '1'), - ('189', '4018', '2006-02-16T02:30:53', '2005-06-16T22:49:08', '2005-06-22T21:08:08', '1'), - ('189', '1573', '2006-02-16T02:30:53', '2005-07-06T12:56:31', '2005-07-09T14:49:31', '1'), - ('436', '1158', '2006-02-16T02:30:53', '2005-07-27T23:28:47', '2005-08-02T19:51:47', '1'), - ('436', '2719', '2006-02-16T02:30:53', '2005-07-28T18:32:49', '2005-08-06T16:09:49', '1'), - ('436', '2994', '2006-02-16T02:30:53', '2005-08-18T10:26:46', '2005-08-27T13:23:46', '1'), - ('436', '969', '2006-02-16T02:30:53', '2005-08-19T10:55:19', '2005-08-27T10:54:19', '1'), - ('436', '493', '2006-02-16T02:30:53', '2005-07-06T16:54:12', '2005-07-11T22:49:12', '1'), - ('436', '1335', '2006-02-16T02:30:53', '2005-07-28T16:09:57', '2005-08-05T18:17:57', '1'), - ('436', '3793', '2006-02-16T02:30:53', '2005-07-31T01:36:19', '2005-08-04T23:47:19', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['15766', '13533', '12297', '13382', '13826', '4782', '5959', '848', '9638', '11160', '256', '15346', '12378', '12255', '12715', '5362', '11726', '14080', '15181', '651', '86', '11626', '11233', '9109', '5577', '13468', '14492', '16010', '578', '6021', '15775', '1188', '15483', '4904', '5485', '3224', '12073', '10351', '3336', '5430', '1695', '9132', '9559', '549', '475', '5656', '9151', '16031', '12495', '8186', '15049', '5509', '3630', '9617', '1215', '3520', '13420', '8664', '4777', '2419', '7439', '5109', '7119', '9295', '10841', '9780', '14426', '4992', '5126', '1701', '14106', '11254', '14162', '11838', '10637', '8774', '4187', '539', '15150', '520', '4490', '9421', '10241', '5349', '6873', '3259', '15188', '8488', '2529', '10016', '1708', '2616', '13162', '9665', '10127', '3691', '2358', '7522', '2765', '13413']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('436', '1996', '2006-02-16T02:30:53', '2005-08-23T13:10:16', '2005-08-30T09:27:16', '1'), - ('436', '1801', '2006-02-16T02:30:53', '2005-08-20T03:30:00', '2005-08-27T05:53:00', '1'), - ('436', '903', '2006-02-16T02:30:53', '2005-08-18T05:19:57', '2005-08-21T00:53:57', '1'), - ('436', '3720', '2006-02-16T02:30:53', '2005-08-19T21:38:41', '2005-08-28T15:49:41', '1'), - ('436', '401', '2006-02-16T02:30:53', '2005-08-20T13:46:38', '2005-08-29T13:07:38', '1'), - ('436', '445', '2006-02-16T02:30:53', '2005-07-08T16:08:51', '2005-07-17T17:56:51', '1'), - ('436', '3169', '2006-02-16T02:30:53', '2005-07-10T23:35:36', '2005-07-13T02:19:36', '1'), - ('436', '1363', '2006-02-16T02:30:53', '2005-05-30T01:19:53', '2005-06-05T23:40:53', '1'), - ('436', '1616', '2006-02-16T02:30:53', '2005-07-31T05:30:27', '2005-08-09T02:04:27', '1'), - ('436', '3260', '2006-02-16T02:30:53', '2005-08-02T10:05:30', '2005-08-07T08:30:30', '1'), - ('436', '3194', '2006-02-16T02:30:53', '2005-05-26T15:20:58', '2005-05-31T15:58:58', '1'), - ('266', '3525', '2006-02-16T02:30:53', '2005-08-22T21:06:00', '2005-08-28T22:08:00', '1'), - ('266', '4418', '2006-02-16T02:30:53', '2005-08-18T08:26:13', '2005-08-19T07:21:13', '1'), - ('266', '2100', '2006-02-16T02:30:53', '2005-08-18T04:07:20', '2005-08-21T22:19:20', '1'), - ('266', '3768', '2006-02-16T02:30:53', '2005-08-18T21:09:38', '2005-08-21T20:25:38', '1'), - ('266', '24', '2006-02-16T02:30:53', '2005-07-09T18:16:08', '2005-07-18T18:27:08', '1'), - ('266', '4438', '2006-02-16T02:30:53', '2005-08-17T08:11:10', '2005-08-22T05:45:10', '1'), - ('266', '3962', '2006-02-16T02:30:53', '2005-08-20T23:29:50', '2005-08-26T00:33:50', '1'), - ('266', '3900', '2006-02-16T02:30:53', '2005-08-22T15:46:20', '2005-08-27T09:56:20', '1'), - ('266', '739', '2006-02-16T02:30:53', '2005-05-28T19:46:50', '2005-05-30T16:29:50', '1'), - ('266', '2275', '2006-02-16T02:30:53', '2005-05-25T13:36:12', '2005-05-30T14:53:12', '1'), - ('266', '4279', '2006-02-16T02:30:53', '2005-08-17T04:25:42', '2005-08-23T05:46:42', '1'), - ('266', '2221', '2006-02-16T02:30:53', '2005-08-02T13:06:11', '2005-08-08T15:02:11', '1'), - ('266', '787', '2006-02-16T02:30:53', '2005-07-30T08:58:24', '2005-08-07T06:56:24', '1'), - ('266', '3779', '2006-02-16T02:30:53', '2005-07-10T03:58:40', '2005-07-14T03:36:40', '1'), - ('266', '1851', '2006-02-16T02:30:53', '2005-08-20T00:56:44', '2005-08-29T06:26:44', '1'), - ('266', '1591', '2006-02-16T02:30:53', '2005-08-21T13:59:08', '2005-08-23T11:09:08', '1'), - ('173', '2539', '2006-02-16T02:30:53', '2005-08-23T21:10:24', '2005-08-25T17:58:24', '1'), - ('173', '2938', '2006-02-16T02:30:53', '2005-05-28T11:15:48', '2005-06-02T09:59:48', '1'), - ('173', '3949', '2006-02-16T02:30:53', '2005-07-11T02:10:18', '2005-07-13T05:19:18', '1'), - ('173', '2146', '2006-02-16T02:30:53', '2005-08-23T13:25:44', '2005-09-01T16:56:44', '1'), - ('173', '246', '2006-02-16T02:30:53', '2005-06-15T01:04:07', '2005-06-19T03:48:07', '1'), - ('173', '2970', '2006-02-16T02:30:53', '2005-08-23T02:02:53', '2005-08-26T04:13:53', '1'), - ('173', '2051', '2006-02-16T02:30:53', '2005-07-08T20:53:27', '2005-07-18T01:16:27', '1'), - ('173', '3930', '2006-02-16T02:30:53', '2005-07-09T23:55:25', '2005-07-14T04:08:25', '1'), - ('173', '3318', '2006-02-16T02:30:53', '2005-06-21T02:11:36', '2005-06-23T21:17:36', '1'), - ('173', '2939', '2006-02-16T02:30:53', '2005-08-17T21:50:39', '2005-08-21T02:59:39', '1'), - ('173', '3725', '2006-02-16T02:30:53', '2005-08-01T05:32:13', '2005-08-08T09:48:13', '1'), - ('173', '2122', '2006-02-16T02:30:53', '2005-06-21T10:14:27', '2005-06-22T09:29:27', '1'), - ('173', '1441', '2006-02-16T02:30:53', '2005-07-09T21:19:54', '2005-07-15T22:53:54', '1'), - ('159', '4436', '2006-02-16T02:30:53', '2005-06-16T12:40:28', '2005-06-22T13:41:28', '1'), - ('159', '402', '2006-02-16T02:30:53', '2005-07-30T09:56:00', '2005-08-02T09:22:00', '1'), - ('159', '2882', '2006-02-16T02:30:53', '2005-07-31T02:15:53', '2005-08-08T02:38:53', '1'), - ('159', '1818', '2006-02-16T02:30:53', '2005-05-28T07:35:37', '2005-06-02T09:08:37', '1'), - ('159', '2520', '2006-02-16T02:30:53', '2005-05-27T22:16:26', '2005-05-28T19:58:26', '1'), - ('159', '4138', '2006-02-16T02:30:53', '2005-07-10T07:31:07', '2005-07-15T04:44:07', '1'), - ('102', '3956', '2006-02-16T02:30:53', '2005-07-30T10:50:53', '2005-08-07T08:19:53', '1'), - ('102', '1843', '2006-02-16T02:30:53', '2005-08-23T21:59:26', '2005-08-29T20:15:26', '1'), - ('102', '1225', '2006-02-16T02:30:53', '2005-08-18T12:56:37', '2005-08-22T06:58:37', '1'), - ('102', '4255', '2006-02-16T02:30:53', '2005-07-28T22:30:27', '2005-07-31T21:08:27', '1'), - ('102', '1573', '2006-02-16T02:30:53', '2005-08-22T10:06:28', '2005-08-26T15:12:28', '1'), - ('102', '1142', '2006-02-16T02:30:53', '2005-07-10T00:54:46', '2005-07-16T05:10:46', '1'), - ('102', '2448', '2006-02-16T02:30:53', '2005-07-06T06:27:15', '2005-07-12T10:36:15', '1'), - ('102', '529', '2006-02-16T02:30:53', '2005-07-31T04:15:38', '2005-08-02T04:24:38', '1'), - ('102', '242', '2006-02-16T02:30:53', '2005-06-15T03:21:00', '2005-06-19T03:39:00', '1'), - ('102', '2872', '2006-02-16T02:30:53', '2005-07-06T00:58:27', '2005-07-14T05:56:27', '1'), - ('102', '1796', '2006-02-16T02:30:53', '2005-08-19T22:57:25', '2005-08-28T22:46:25', '1'), - ('102', '198', '2006-02-16T02:30:53', '2005-07-29T15:36:27', '2005-08-04T20:11:27', '1'), - ('102', '449', '2006-02-16T02:30:53', '2005-07-08T15:48:34', '2005-07-16T15:25:34', '1'), - ('102', '1255', '2006-02-16T02:30:53', '2005-06-18T17:21:24', '2005-06-26T18:25:24', '1'), - ('102', '4091', '2006-02-16T02:30:53', '2005-07-27T17:42:31', '2005-08-05T16:34:31', '1'), - ('102', '2373', '2006-02-16T02:30:53', '2005-07-09T06:48:49', '2005-07-14T01:17:49', '1'), - ('102', '1732', '2006-02-16T02:30:53', '2005-07-27T05:55:32', '2005-07-29T03:19:32', '1'), - ('102', '494', '2006-02-16T02:30:53', '2005-07-30T16:18:39', '2005-08-03T12:46:39', '1'), - ('102', '4337', '2006-02-16T02:30:53', '2005-08-01T23:39:21', '2005-08-07T20:47:21', '1'), - ('102', '3241', '2006-02-16T02:30:53', '2005-07-31T10:10:22', '2005-08-02T11:43:22', '1'), - ('315', '2902', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('315', '2081', '2006-02-16T02:30:53', '2005-07-09T00:49:37', '2005-07-16T02:05:37', '1'), - ('315', '3312', '2006-02-16T02:30:53', '2005-07-09T07:25:35', '2005-07-18T05:05:35', '1'), - ('315', '3000', '2006-02-16T02:30:53', '2005-06-16T13:18:48', '2005-06-22T15:00:48', '1'), - ('315', '2673', '2006-02-16T02:30:53', '2005-08-21T00:46:01', '2005-08-27T23:44:01', '1'), - ('315', '56', '2006-02-16T02:30:53', '2005-08-02T13:43:49', '2005-08-08T13:16:49', '1'), - ('315', '3788', '2006-02-16T02:30:53', '2005-08-21T02:55:34', '2005-08-27T00:13:34', '1'), - ('161', '3576', '2006-02-16T02:30:53', '2005-08-17T13:06:00', '2005-08-20T11:44:00', '1'), - ('161', '1243', '2006-02-16T02:30:53', '2005-08-01T15:44:09', '2005-08-04T14:42:09', '1'), - ('161', '315', '2006-02-16T02:30:53', '2005-07-29T20:05:04', '2005-07-31T14:32:04', '1'), - ('161', '2', '2006-02-16T02:30:53', '2005-07-07T10:41:31', '2005-07-11T06:25:31', '1'), - ('161', '3427', '2006-02-16T02:30:53', '2005-05-28T06:26:16', '2005-05-30T02:02:16', '1'), - ('161', '1797', '2006-02-16T02:30:53', '2005-08-22T14:12:05', '2005-08-27T12:47:05', '1'), - ('161', '3845', '2006-02-16T02:30:53', '2005-05-28T03:27:37', '2005-06-04T05:47:37', '1'), - ('161', '2690', '2006-02-16T02:30:53', '2005-07-08T01:26:32', '2005-07-09T01:13:32', '1'), - ('161', '2206', '2006-02-16T02:30:53', '2005-07-30T21:08:32', '2005-08-02T00:43:32', '1'), - ('161', '1526', '2006-02-16T02:30:53', '2005-08-01T02:12:25', '2005-08-08T00:37:25', '1'), - ('161', '3139', '2006-02-16T02:30:53', '2005-07-09T17:35:35', '2005-07-18T14:05:35', '1'), - ('161', '802', '2006-02-16T02:30:53', '2005-07-12T20:20:50', '2005-07-17T01:51:50', '1'), - ('478', '2751', '2006-02-16T02:30:53', '2005-06-21T03:57:15', '2005-06-24T03:32:15', '1'), - ('478', '131', '2006-02-16T02:30:53', '2005-08-22T15:55:48', '2005-08-29T19:10:48', '1'), - ('478', '2176', '2006-02-16T02:30:53', '2005-07-29T08:57:38', '2005-08-02T04:16:38', '1'), - ('478', '2306', '2006-02-16T02:30:53', '2005-06-19T01:18:27', '2005-06-24T00:26:27', '1'), - ('478', '2183', '2006-02-16T02:30:53', '2005-07-31T18:13:06', '2005-08-09T22:11:06', '1'), - ('478', '2259', '2006-02-16T02:30:53', '2005-06-16T14:08:44', '2005-06-19T08:35:44', '1'), - ('478', '581', '2006-02-16T02:30:53', '2005-06-19T07:33:00', '2005-06-28T03:05:00', '1'), - ('478', '1845', '2006-02-16T02:30:53', '2005-08-19T13:28:26', '2005-08-24T17:37:26', '1'), - ('478', '2863', '2006-02-16T02:30:53', '2005-07-31T06:17:33', '2005-08-04T08:53:33', '1'), - ('478', '717', '2006-02-16T02:30:53', '2005-07-31T21:39:48', '2005-08-06T00:10:48', '1'), - ('478', '1937', '2006-02-16T02:30:53', '2005-07-06T09:46:12', '2005-07-07T14:08:12', '1'), - ('478', '1728', '2006-02-16T02:30:53', '2005-06-18T13:00:51', '2005-06-26T12:58:51', '1'), - ('478', '2038', '2006-02-16T02:30:53', '2005-07-27T21:11:03', '2005-08-02T16:40:03', '1'), - ('478', '1017', '2006-02-16T02:30:53', '2005-06-19T17:34:39', '2005-06-27T23:26:39', '1'), - ('390', '1501', '2006-02-16T02:30:53', '2005-08-19T22:46:46', '2005-08-24T22:52:46', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['9314', '10061', '3999', '12803', '4968', '1730', '2330', '9825', '7595', '6215', '4191', '6430', '15376', '15303', '10060', '5517', '5652', '4391', '6925', '5199', '8785', '8095', '10845', '15442', '8499', '14461', '6179', '8049', '635', '12499', '1534', '14122', '5295', '13535', '9376', '15715', '1822', '1924', '7874', '11916', '3207', '6872', '2141', '4571', '3611', '12870', '13374', '13379', '111', '3065', '15406', '3576', '1679', '4340', '4680', '1823', '3959', '12446', '13220', '6985', '3992', '6341', '1313', '2697', '4024', '14580', '3347', '8982', '5979', '1091', '5012', '14107', '10575', '3799', '12047', '15647', '311', '2359', '13076', '2047', '14973', '3708', '756', '13671', '10750', '3144', '2680', '7938', '255', '14158', '8496', '9717', '4025', '8590', '5418', '6188', '15646', '15528', '3094', '5624']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('390', '2358', '2006-02-16T02:30:53', '2005-07-30T17:05:19', '2005-07-31T12:19:19', '1'), - ('390', '1401', '2006-02-16T02:30:53', '2005-07-31T19:23:25', '2005-08-04T19:38:25', '1'), - ('390', '707', '2006-02-16T02:30:53', '2005-07-06T23:50:54', '2005-07-09T22:09:54', '1'), - ('390', '1058', '2006-02-16T02:30:53', '2005-08-19T00:28:21', '2005-08-23T02:02:21', '1'), - ('390', '3204', '2006-02-16T02:30:53', '2005-07-08T23:49:19', '2005-07-14T02:46:19', '1'), - ('390', '1372', '2006-02-16T02:30:53', '2005-06-16T15:30:01', '2005-06-19T12:56:01', '1'), - ('390', '4285', '2006-02-16T02:30:53', '2005-06-18T10:41:19', '2005-06-25T10:48:19', '1'), - ('390', '4322', '2006-02-16T02:30:53', '2005-07-31T11:50:51', '2005-08-02T07:18:51', '1'), - ('390', '4313', '2006-02-16T02:30:53', '2005-07-27T23:32:23', '2005-08-03T05:28:23', '1'), - ('390', '316', '2006-02-16T02:30:53', '2005-07-11T12:52:36', '2005-07-12T08:33:36', '1'), - ('390', '2475', '2006-02-16T02:30:53', '2005-07-07T10:56:14', '2005-07-11T09:56:14', '1'), - ('390', '178', '2006-02-16T02:30:53', '2005-07-12T00:03:34', '2005-07-15T03:11:34', '1'), - ('390', '2963', '2006-02-16T02:30:53', '2005-08-22T22:21:35', '2005-08-28T20:56:35', '1'), - ('390', '1672', '2006-02-16T02:30:53', '2005-08-22T19:44:59', '2005-08-30T21:59:59', '1'), - ('42', '1979', '2006-02-16T02:30:53', '2005-07-31T19:23:00', '2005-08-08T19:07:00', '1'), - ('42', '3689', '2006-02-16T02:30:53', '2005-07-10T01:15:00', '2005-07-19T01:59:00', '1'), - ('42', '927', '2006-02-16T02:30:53', '2005-07-10T07:18:58', '2005-07-19T07:52:58', '1'), - ('42', '2135', '2006-02-16T02:30:53', '2005-07-07T21:09:38', '2005-07-09T17:35:38', '1'), - ('42', '2919', '2006-02-16T02:30:53', '2005-07-26T22:52:32', '2005-07-29T21:22:32', '1'), - ('42', '349', '2006-02-16T02:30:53', '2005-07-09T10:50:56', '2005-07-10T06:43:56', '1'), - ('42', '216', '2006-02-16T02:30:53', '2005-07-29T20:36:26', '2005-07-30T15:06:26', '1'), - ('42', '2685', '2006-02-16T02:30:53', '2005-07-28T18:32:40', '2005-08-06T23:45:40', '1'), - ('42', '2737', '2006-02-16T02:30:53', '2005-08-01T23:47:03', '2005-08-08T01:57:03', '1'), - ('42', '1452', '2006-02-16T02:30:53', '2005-08-23T00:42:49', '2005-08-27T00:35:49', '1'), - ('42', '219', '2006-02-16T02:30:53', '2005-07-29T09:10:41', '2005-08-05T10:01:41', '1'), - ('42', '371', '2006-02-16T02:30:53', '2005-08-21T12:50:33', '2005-08-30T13:35:33', '1'), - ('42', '3665', '2006-02-16T02:30:53', '2005-07-11T10:59:59', '2005-07-17T06:02:59', '1'), - ('42', '673', '2006-02-16T02:30:53', '2005-07-28T16:51:58', '2005-07-31T22:18:58', '1'), - ('42', '1648', '2006-02-16T02:30:53', '2005-05-28T17:46:57', '2005-06-06T18:24:57', '1'), - ('42', '2611', '2006-02-16T02:30:53', '2005-08-18T13:05:37', '2005-08-19T07:41:37', '1'), - ('42', '3124', '2006-02-16T02:30:53', '2005-06-16T00:49:32', '2005-06-18T02:41:32', '1'), - ('86', '3955', '2006-02-16T02:30:53', '2005-08-21T01:29:01', '2005-08-27T05:31:01', '1'), - ('86', '4460', '2006-02-16T02:30:53', '2005-07-09T15:25:06', '2005-07-10T12:40:06', '1'), - ('86', '1563', '2006-02-16T02:30:53', '2005-08-20T03:30:25', '2005-08-28T04:35:25', '1'), - ('86', '451', '2006-02-16T02:30:53', '2005-07-30T19:11:49', '2005-08-04T18:14:49', '1'), - ('86', '3808', '2006-02-16T02:30:53', '2005-08-23T10:57:40', '2005-08-28T12:40:40', '1'), - ('86', '674', '2006-02-16T02:30:53', '2005-06-16T21:43:45', '2005-06-17T21:37:45', '1'), - ('86', '2577', '2006-02-16T02:30:53', '2005-06-17T06:13:34', '2005-06-18T01:51:34', '1'), - ('86', '2981', '2006-02-16T02:30:53', '2005-07-28T10:21:52', '2005-08-06T16:19:52', '1'), - ('86', '2631', '2006-02-16T02:30:53', '2005-08-17T16:05:51', '2005-08-20T10:23:51', '1'), - ('86', '4020', '2006-02-16T02:30:53', '2005-06-21T00:43:16', '2005-06-24T22:13:16', '1'), - ('86', '3246', '2006-02-16T02:30:53', '2005-07-12T20:15:04', '2005-07-18T18:19:04', '1'), - ('86', '2176', '2006-02-16T02:30:53', '2005-06-17T21:41:34', '2005-06-19T00:15:34', '1'), - ('86', '2416', '2006-02-16T02:30:53', '2005-07-08T05:34:41', '2005-07-17T02:15:41', '1'), - ('86', '4502', '2006-02-16T02:30:53', '2005-07-06T05:37:18', '2005-07-10T05:14:18', '1'), - ('86', '991', '2006-02-16T02:30:53', '2005-08-19T02:54:38', '2005-08-27T00:45:38', '1'), - ('227', '2721', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('227', '1623', '2006-02-16T02:30:53', '2005-08-19T21:33:39', '2005-08-22T21:00:39', '1'), - ('227', '3725', '2006-02-16T02:30:53', '2005-05-25T18:45:19', '2005-05-28T17:18:19', '1'), - ('227', '1687', '2006-02-16T02:30:53', '2005-06-20T13:53:53', '2005-06-24T11:31:53', '1'), - ('227', '400', '2006-02-16T02:30:53', '2005-08-22T23:21:22', '2005-08-28T22:21:22', '1'), - ('227', '324', '2006-02-16T02:30:53', '2005-07-06T03:40:01', '2005-07-15T07:22:01', '1'), - ('227', '3959', '2006-02-16T02:30:53', '2005-06-16T11:11:01', '2005-06-23T08:11:01', '1'), - ('227', '3919', '2006-02-16T02:30:53', '2005-07-07T18:41:46', '2005-07-16T21:27:46', '1'), - ('227', '4043', '2006-02-16T02:30:53', '2005-07-08T10:35:28', '2005-07-14T08:42:28', '1'), - ('448', '3871', '2006-02-16T02:30:53', '2005-06-16T21:48:16', '2005-06-22T03:09:16', '1'), - ('448', '40', '2006-02-16T02:30:53', '2005-07-06T22:07:58', '2005-07-13T02:30:58', '1'), - ('448', '2138', '2006-02-16T02:30:53', '2005-08-18T10:56:29', '2005-08-23T05:30:29', '1'), - ('448', '1017', '2006-02-16T02:30:53', '2005-08-19T15:42:32', '2005-08-25T13:37:32', '1'), - ('448', '1834', '2006-02-16T02:30:53', '2005-07-27T00:57:42', '2005-07-31T00:53:42', '1'), - ('448', '3219', '2006-02-16T02:30:53', '2005-07-06T23:36:56', '2005-07-15T03:13:56', '1'), - ('448', '3580', '2006-02-16T02:30:53', '2005-07-11T19:48:02', '2005-07-15T01:31:02', '1'), - ('448', '1657', '2006-02-16T02:30:53', '2005-06-15T10:18:34', '2005-06-23T06:25:34', '1'), - ('448', '2271', '2006-02-16T02:30:53', '2005-06-19T13:29:08', '2005-06-23T13:21:08', '1'), - ('448', '3976', '2006-02-16T02:30:53', '2005-07-07T02:11:23', '2005-07-11T02:00:23', '1'), - ('448', '1440', '2006-02-16T02:30:53', '2005-08-21T16:56:39', '2005-08-28T15:25:39', '1'), - ('448', '4330', '2006-02-16T02:30:53', '2005-06-21T11:08:32', '2005-06-28T09:59:32', '1'), - ('251', '1128', '2006-02-16T02:30:53', '2005-07-30T04:31:02', '2005-07-31T04:22:02', '1'), - ('251', '1736', '2006-02-16T02:30:53', '2005-07-11T00:17:09', '2005-07-14T00:38:09', '1'), - ('251', '3853', '2006-02-16T02:30:53', '2005-05-31T12:11:04', '2005-06-04T11:42:04', '1'), - ('251', '1456', '2006-02-16T02:30:53', '2005-07-09T01:45:04', '2005-07-12T02:13:04', '1'), - ('251', '3998', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('251', '4447', '2006-02-16T02:30:53', '2005-08-01T13:41:41', '2005-08-08T11:30:41', '1'), - ('251', '4532', '2006-02-16T02:30:53', '2005-07-06T15:00:14', '2005-07-10T15:39:14', '1'), - ('251', '3886', '2006-02-16T02:30:53', '2005-08-17T20:48:32', '2005-08-26T00:07:32', '1'), - ('251', '2051', '2006-02-16T02:30:53', '2005-08-23T08:23:56', '2005-08-26T11:00:56', '1'), - ('201', '2830', '2006-02-16T02:30:53', '2005-05-26T22:51:37', '2005-06-01T00:02:37', '1'), - ('201', '3087', '2006-02-16T02:30:53', '2005-06-18T13:04:42', '2005-06-25T11:52:42', '1'), - ('201', '1226', '2006-02-16T02:30:53', '2005-08-19T10:10:26', '2005-08-22T05:41:26', '1'), - ('201', '2371', '2006-02-16T02:30:53', '2005-06-17T14:40:58', '2005-06-21T08:52:58', '1'), - ('201', '2888', '2006-02-16T02:30:53', '2005-08-22T06:59:28', '2005-08-30T02:28:28', '1'), - ('201', '2105', '2006-02-16T02:30:53', '2005-07-06T10:23:27', '2005-07-14T09:26:27', '1'), - ('201', '3152', '2006-02-16T02:30:53', '2005-05-29T10:28:45', '2005-06-04T12:50:45', '1'), - ('201', '1473', '2006-02-16T02:30:53', '2005-08-20T08:27:03', '2005-08-26T03:56:03', '1'), - ('201', '3206', '2006-02-16T02:30:53', '2005-08-01T20:06:00', '2005-08-07T15:48:00', '1'), - ('114', '1300', '2006-02-16T02:30:53', '2005-06-20T20:14:20', '2005-06-30T01:46:20', '1'), - ('114', '865', '2006-02-16T02:30:53', '2005-06-19T12:13:37', '2005-06-27T15:15:37', '1'), - ('114', '2579', '2006-02-16T02:30:53', '2005-07-28T12:39:11', '2005-08-04T16:56:11', '1'), - ('114', '3264', '2006-02-16T02:30:53', '2005-05-26T14:52:15', '2005-05-27T12:45:15', '1'), - ('114', '474', '2006-02-16T02:30:53', '2005-08-21T02:43:20', '2005-08-28T02:19:20', '1'), - ('114', '765', '2006-02-16T02:30:53', '2005-07-29T09:05:33', '2005-08-02T06:32:33', '1'), - ('114', '4207', '2006-02-16T02:30:53', '2005-07-31T08:24:41', '2005-08-04T02:51:41', '1'), - ('114', '3908', '2006-02-16T02:30:53', '2005-07-07T02:13:24', '2005-07-08T00:47:24', '1'), - ('114', '2505', '2006-02-16T02:30:53', '2005-07-29T12:32:20', '2005-08-07T08:00:20', '1'), - ('114', '55', '2006-02-16T02:30:53', '2005-07-09T20:41:35', '2005-07-14T00:15:35', '1'), - ('114', '189', '2006-02-16T02:30:53', '2005-07-11T11:31:47', '2005-07-15T09:28:47', '1'), - ('114', '3217', '2006-02-16T02:30:53', '2005-08-23T08:19:55', '2005-08-29T02:32:55', '1'), - ('114', '3033', '2006-02-16T02:30:53', '2005-08-23T03:45:40', '2005-08-25T01:16:40', '1'), - ('114', '2048', '2006-02-16T02:30:53', '2005-06-20T16:06:51', '2005-06-24T13:23:51', '1'), - ('114', '1015', '2006-02-16T02:30:53', '2005-07-10T05:43:16', '2005-07-12T05:33:16', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['8479', '13741', '9994', '6175', '11787', '4234', '9870', '11201', '3271', '9721', '2912', '1348', '10122', '1053', '5768', '12836', '6857', '5143', '1182', '10191', '8472', '13799', '9804', '4999', '9346', '12430', '11104', '12684', '8266', '4879', '1880', '14087', '7325', '3123', '6007', '5089', '3588', '10297', '13336', '2784', '7162', '13211', '13256', '14729', '13891', '11550', '6425', '6072', '8968', '7244', '4243', '5720', '3335', '4467', '11699', '1536', '1629', '11582', '8151', '9741', '8451', '15984', '2074', '623', '5484', '7191', '13753', '12782', '10783', '3966', '13445', '3129', '741', '6426', '13818', '4060', '8961', '5699', '10928', '7975', '4441', '238', '6438', '12746', '15538', '11076', '14812', '2812', '13979', '14782', '4857', '5668', '2789', '9038', '11675', '3860', '12302', '13344', '14386', '3084']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('195', '1990', '2006-02-16T02:30:53', '2005-07-29T08:42:04', '2005-08-01T03:10:04', '1'), - ('195', '3887', '2006-02-16T02:30:53', '2005-08-20T10:48:47', '2005-08-21T11:19:47', '1'), - ('195', '2155', '2006-02-16T02:30:53', '2005-07-31T17:30:31', '2005-08-01T11:35:31', '1'), - ('195', '3037', '2006-02-16T02:30:53', '2005-07-11T10:44:37', '2005-07-15T08:13:37', '1'), - ('195', '1980', '2006-02-16T02:30:53', '2005-08-17T10:59:00', '2005-08-19T05:56:00', '1'), - ('195', '1179', '2006-02-16T02:30:53', '2005-07-07T13:01:35', '2005-07-15T13:05:35', '1'), - ('195', '442', '2006-02-16T02:30:53', '2005-07-31T13:22:51', '2005-08-05T16:04:51', '1'), - ('195', '1501', '2006-02-16T02:30:53', '2005-08-02T11:49:16', '2005-08-11T08:39:16', '1'), - ('196', '4191', '2006-02-16T02:30:53', '2005-06-21T05:16:10', '2005-06-27T10:46:10', '1'), - ('196', '3942', '2006-02-16T02:30:53', '2005-07-31T08:28:46', '2005-08-05T14:03:46', '1'), - ('196', '1076', '2006-02-16T02:30:53', '2005-06-20T03:32:45', '2005-06-21T23:32:45', '1'), - ('196', '2078', '2006-02-16T02:30:53', '2005-06-15T12:45:30', '2005-06-17T17:12:30', '1'), - ('196', '4229', '2006-02-16T02:30:53', '2005-07-31T21:29:28', '2005-08-09T00:04:28', '1'), - ('196', '3734', '2006-02-16T02:30:53', '2005-05-31T07:12:44', '2005-06-04T12:33:44', '1'), - ('196', '345', '2006-02-16T02:30:53', '2005-07-10T13:15:26', '2005-07-15T09:42:26', '1'), - ('196', '1380', '2006-02-16T02:30:53', '2005-08-19T01:48:33', '2005-08-23T04:46:33', '1'), - ('196', '424', '2006-02-16T02:30:53', '2005-07-12T19:53:30', '2005-07-13T15:22:30', '1'), - ('196', '3803', '2006-02-16T02:30:53', '2005-07-09T08:07:07', '2005-07-18T10:17:07', '1'), - ('196', '1061', '2006-02-16T02:30:53', '2005-06-15T00:45:21', '2005-06-22T03:52:21', '1'), - ('196', '1131', '2006-02-16T02:30:53', '2005-08-01T00:28:38', '2005-08-06T02:23:38', '1'), - ('196', '2975', '2006-02-16T02:30:53', '2005-07-29T08:36:22', '2005-08-02T07:55:22', '1'), - ('196', '4413', '2006-02-16T02:30:53', '2005-08-20T12:36:42', '2005-08-28T08:47:42', '1'), - ('196', '2490', '2006-02-16T02:30:53', '2005-07-31T11:07:39', '2005-08-09T11:57:39', '1'), - ('196', '1797', '2006-02-16T02:30:53', '2005-07-09T01:12:57', '2005-07-17T00:12:57', '1'), - ('196', '2845', '2006-02-16T02:30:53', '2005-07-30T18:13:52', '2005-08-03T17:58:52', '1'), - ('196', '2840', '2006-02-16T02:30:53', '2005-08-18T10:32:41', '2005-08-22T16:16:41', '1'), - ('196', '3042', '2006-02-16T02:30:53', '2005-08-02T08:09:58', '2005-08-05T11:55:58', '1'), - ('196', '978', '2006-02-16T02:30:53', '2005-08-18T19:51:27', '2005-08-19T15:56:27', '1'), - ('196', '1972', '2006-02-16T02:30:53', '2005-07-29T01:20:16', '2005-07-30T04:31:16', '1'), - ('196', '1406', '2006-02-16T02:30:53', '2005-07-08T19:34:55', '2005-07-09T15:53:55', '1'), - ('289', '1133', '2006-02-16T02:30:53', '2005-06-17T03:08:59', '2005-06-19T07:16:59', '1'), - ('289', '2368', '2006-02-16T02:30:53', '2005-08-20T23:53:40', '2005-08-26T20:22:40', '1'), - ('289', '1727', '2006-02-16T02:30:53', '2005-07-27T13:46:55', '2005-07-28T14:21:55', '1'), - ('289', '1656', '2006-02-16T02:30:53', '2005-06-20T18:26:14', '2005-06-29T17:17:14', '1'), - ('289', '4393', '2006-02-16T02:30:53', '2005-07-11T01:43:06', '2005-07-17T04:46:06', '1'), - ('289', '451', '2006-02-16T02:30:53', '2005-07-09T05:45:40', '2005-07-15T05:31:40', '1'), - ('289', '3154', '2006-02-16T02:30:53', '2005-07-06T04:29:13', '2005-07-07T23:49:13', '1'), - ('289', '2795', '2006-02-16T02:30:53', '2005-08-01T04:05:04', '2005-08-09T06:08:04', '1'), - ('289', '1011', '2006-02-16T02:30:53', '2005-08-19T20:03:22', '2005-08-24T23:42:22', '1'), - ('289', '2305', '2006-02-16T02:30:53', '2005-06-19T18:40:29', '2005-06-28T15:27:29', '1'), - ('289', '2251', '2006-02-16T02:30:53', '2005-07-27T07:32:45', '2005-07-30T03:48:45', '1'), - ('289', '1968', '2006-02-16T02:30:53', '2005-08-19T15:23:41', '2005-08-22T16:58:41', '1'), - ('289', '2719', '2006-02-16T02:30:53', '2005-08-19T16:54:12', '2005-08-28T16:54:12', '1'), - ('289', '2483', '2006-02-16T02:30:53', '2005-08-21T22:16:57', '2005-08-27T21:32:57', '1'), - ('289', '2042', '2006-02-16T02:30:53', '2005-08-20T15:42:05', '2005-08-25T13:26:05', '1'), - ('339', '2972', '2006-02-16T02:30:53', '2005-08-17T01:02:06', '2005-08-22T21:44:06', '1'), - ('339', '2487', '2006-02-16T02:30:53', '2005-07-11T23:54:52', '2005-07-13T18:37:52', '1'), - ('339', '1790', '2006-02-16T02:30:53', '2005-07-11T04:52:40', '2005-07-18T01:02:40', '1'), - ('339', '2280', '2006-02-16T02:30:53', '2005-07-30T03:57:32', '2005-07-31T00:09:32', '1'), - ('339', '1329', '2006-02-16T02:30:53', '2005-07-27T10:27:33', '2005-07-30T13:09:33', '1'), - ('339', '4559', '2006-02-16T02:30:53', '2005-07-07T13:39:58', '2005-07-12T19:27:58', '1'), - ('339', '576', '2006-02-16T02:30:53', '2005-07-10T11:09:12', '2005-07-16T07:31:12', '1'), - ('339', '3033', '2006-02-16T02:30:53', '2005-06-21T10:09:08', '2005-06-27T11:33:08', '1'), - ('339', '4466', '2006-02-16T02:30:53', '2005-07-08T00:13:52', '2005-07-09T00:52:52', '1'), - ('339', '3997', '2006-02-16T02:30:53', '2005-08-17T07:11:58', '2005-08-26T12:08:58', '1'), - ('339', '3248', '2006-02-16T02:30:53', '2005-06-16T00:52:22', '2005-06-17T21:43:22', '1'), - ('339', '4375', '2006-02-16T02:30:53', '2005-06-16T07:53:47', '2005-06-22T13:03:47', '1'), - ('339', '2115', '2006-02-16T02:30:53', '2005-08-17T02:03:49', '2005-08-24T03:29:49', '1'), - ('495', '4370', '2006-02-16T02:30:53', '2005-07-28T20:50:52', '2005-07-31T14:50:52', '1'), - ('495', '1971', '2006-02-16T02:30:53', '2005-07-31T09:09:22', '2005-08-07T10:01:22', '1'), - ('495', '3309', '2006-02-16T02:30:53', '2005-07-29T07:44:56', '2005-08-06T02:29:56', '1'), - ('495', '2011', '2006-02-16T02:30:53', '2005-08-23T20:16:27', '2005-08-27T01:43:27', '1'), - ('495', '71', '2006-02-16T02:30:53', '2005-06-17T16:40:03', '2005-06-20T21:34:03', '1'), - ('495', '1222', '2006-02-16T02:30:53', '2005-05-28T16:01:28', '2005-05-30T11:19:28', '1'), - ('495', '3248', '2006-02-16T02:30:53', '2005-07-09T23:54:37', '2005-07-15T02:05:37', '1'), - ('495', '4292', '2006-02-16T02:30:53', '2005-07-27T08:36:15', '2005-08-03T08:54:15', '1'), - ('495', '3746', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('495', '1454', '2006-02-16T02:30:53', '2005-08-18T23:56:23', '2005-08-25T18:47:23', '1'), - ('495', '1192', '2006-02-16T02:30:53', '2005-08-01T21:23:37', '2005-08-09T20:18:37', '1'), - ('495', '556', '2006-02-16T02:30:53', '2005-07-06T22:38:49', '2005-07-07T23:33:49', '1'), - ('495', '1630', '2006-02-16T02:30:53', '2005-08-20T00:05:33', '2005-08-21T21:20:33', '1'), - ('495', '1789', '2006-02-16T02:30:53', '2005-06-20T18:57:48', '2005-06-28T13:45:48', '1'), - ('495', '3189', '2006-02-16T02:30:53', '2005-05-29T08:35:49', '2005-06-04T11:55:49', '1'), - ('495', '498', '2006-02-16T02:30:53', '2005-07-11T23:56:38', '2005-07-21T05:22:38', '1'), - ('495', '1283', '2006-02-16T02:30:53', '2005-08-20T13:20:09', '2005-08-21T18:41:09', '1'), - ('211', '2697', '2006-02-16T02:30:53', '2005-07-07T04:10:13', '2005-07-13T07:44:13', '1'), - ('211', '3679', '2006-02-16T02:30:53', '2005-07-30T03:43:35', '2005-08-06T07:42:35', '1'), - ('211', '958', '2006-02-16T02:30:53', '2005-07-10T09:48:04', '2005-07-17T09:07:04', '1'), - ('211', '2885', '2006-02-16T02:30:53', '2005-08-02T02:34:12', '2005-08-07T21:13:12', '1'), - ('211', '2565', '2006-02-16T02:30:53', '2005-07-28T14:12:47', '2005-08-05T09:18:47', '1'), - ('211', '3680', '2006-02-16T02:30:53', '2005-07-07T23:04:23', '2005-07-13T19:07:23', '1'), - ('211', '503', '2006-02-16T02:30:53', '2005-05-26T12:30:22', '2005-05-27T06:49:22', '1'), - ('211', '412', '2006-02-16T02:30:53', '2005-07-12T00:23:01', '2005-07-17T22:45:01', '1'), - ('211', '1012', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('211', '4226', '2006-02-16T02:30:53', '2005-08-23T04:07:37', '2005-08-28T07:37:37', '1'), - ('211', '837', '2006-02-16T02:30:53', '2005-08-02T07:24:47', '2005-08-10T09:16:47', '1'), - ('211', '4282', '2006-02-16T02:30:53', '2005-08-22T01:10:32', '2005-08-26T05:21:32', '1'), - ('211', '3016', '2006-02-16T02:30:53', '2005-06-19T19:58:16', '2005-06-26T15:26:16', '1'), - ('211', '2998', '2006-02-16T02:30:53', '2005-08-20T19:03:49', '2005-08-24T21:23:49', '1'), - ('211', '1727', '2006-02-16T02:30:53', '2005-08-22T00:17:20', '2005-08-23T01:24:20', '1'), - ('211', '2069', '2006-02-16T02:30:53', '2005-07-08T18:52:07', '2005-07-11T22:06:07', '1'), - ('211', '309', '2006-02-16T02:30:53', '2005-07-10T08:11:05', '2005-07-16T13:15:05', '1'), - ('514', '2398', '2006-02-16T02:30:53', '2005-06-19T18:48:21', '2005-06-21T21:50:21', '1'), - ('514', '217', '2006-02-16T02:30:53', '2005-07-30T06:23:35', '2005-08-06T11:10:35', '1'), - ('514', '1322', '2006-02-16T02:30:53', '2005-08-17T05:57:54', '2005-08-21T23:57:54', '1'), - ('514', '144', '2006-02-16T02:30:53', '2005-07-06T17:20:24', '2005-07-09T22:33:24', '1'), - ('514', '765', '2006-02-16T02:30:53', '2005-08-18T05:41:39', '2005-08-22T06:02:39', '1'), - ('514', '4392', '2006-02-16T02:30:53', '2005-08-19T20:22:44', '2005-08-25T18:39:44', '1'), - ('514', '3402', '2006-02-16T02:30:53', '2005-08-21T10:06:34', '2005-08-25T14:19:34', '1'), - ('514', '3578', '2006-02-16T02:30:53', '2005-06-20T15:35:24', '2005-06-23T19:11:24', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['2362', '12578', '7791', '3668', '12752', '15776', '5158', '11881', '1072', '9787', '13903', '10736', '11597', '7300', '12006', '33', '8221', '11893', '966', '11060', '322', '4269', '13569', '12605', '3569', '14332', '5559', '4261', '15578', '38', '15734', '12126', '9146', '8363', '7183', '14247', '5821', '12516', '10329', '9581', '5709', '13916', '7411', '7542', '6160', '7474', '7570', '3587', '12585', '6287', '15324', '14195', '13950', '5130', '15631', '6586', '4733', '3109', '13904', '13555', '15160', '14285', '11124', '11159', '2129', '13981', '7881', '5639', '11668', '14731', '15721', '7156', '12341', '6048', '10278', '5101', '7055', '10851', '469', '15351', '11296', '978', '4252', '4132', '5760', '15109', '10373', '15209', '7903', '12185', '15158', '8429', '2453', '3628', '13064', '14084', '923', '13493', '15028', '8419']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('514', '2815', '2006-02-16T02:30:53', '2005-06-18T13:31:15', '2005-06-19T12:35:15', '1'), - ('514', '930', '2006-02-16T02:30:53', '2005-08-18T15:47:11', '2005-08-21T10:55:11', '1'), - ('514', '822', '2006-02-16T02:30:53', '2005-07-28T07:22:51', '2005-07-30T03:09:51', '1'), - ('514', '269', '2006-02-16T02:30:53', '2005-07-06T08:36:48', '2005-07-10T11:31:48', '1'), - ('514', '3595', '2006-02-16T02:30:53', '2005-08-18T22:33:36', '2005-08-27T23:55:36', '1'), - ('514', '43', '2006-02-16T02:30:53', '2005-08-23T13:26:01', '2005-08-29T18:17:01', '1'), - ('272', '2825', '2006-02-16T02:30:53', '2005-07-09T08:53:09', '2005-07-10T11:05:09', '1'), - ('272', '3124', '2006-02-16T02:30:53', '2005-08-17T14:31:56', '2005-08-21T11:05:56', '1'), - ('272', '2557', '2006-02-16T02:30:53', '2005-05-31T09:52:50', '2005-06-05T05:39:50', '1'), - ('272', '3559', '2006-02-16T02:30:53', '2005-07-31T10:26:19', '2005-08-09T09:02:19', '1'), - ('272', '1676', '2006-02-16T02:30:53', '2005-08-20T16:07:55', '2005-08-25T18:26:55', '1'), - ('272', '2227', '2006-02-16T02:30:53', '2005-08-01T19:30:21', '2005-08-02T22:37:21', '1'), - ('272', '4073', '2006-02-16T02:30:53', '2005-08-17T03:02:56', '2005-08-26T04:47:56', '1'), - ('272', '4561', '2006-02-16T02:30:53', '2005-07-27T12:50:17', '2005-08-04T18:43:17', '1'), - ('272', '4072', '2006-02-16T02:30:53', '2005-08-17T19:09:12', '2005-08-24T13:50:12', '1'), - ('272', '1681', '2006-02-16T02:30:53', '2005-05-25T04:18:51', '2005-05-27T03:58:51', '1'), - ('496', '3138', '2006-02-16T02:30:53', '2005-07-28T23:47:19', '2005-08-02T20:42:19', '1'), - ('496', '2321', '2006-02-16T02:30:53', '2005-08-17T15:13:29', '2005-08-25T11:09:29', '1'), - ('496', '1294', '2006-02-16T02:30:53', '2005-05-30T19:00:37', '2005-05-31T23:51:37', '1'), - ('496', '3395', '2006-02-16T02:30:53', '2005-08-02T06:48:18', '2005-08-10T11:49:18', '1'), - ('496', '4556', '2006-02-16T02:30:53', '2005-05-27T00:47:35', '2005-06-02T00:32:35', '1'), - ('496', '415', '2006-02-16T02:30:53', '2005-07-07T14:38:33', '2005-07-09T10:27:33', '1'), - ('496', '1934', '2006-02-16T02:30:53', '2005-08-20T05:02:59', '2005-08-28T00:51:59', '1'), - ('496', '1359', '2006-02-16T02:30:53', '2005-08-18T16:59:37', '2005-08-20T18:09:37', '1'), - ('496', '1929', '2006-02-16T02:30:53', '2005-07-06T03:17:23', '2005-07-14T03:58:23', '1'), - ('496', '1388', '2006-02-16T02:30:53', '2005-08-21T08:30:43', '2005-08-29T10:51:43', '1'), - ('496', '4122', '2006-02-16T02:30:53', '2005-07-10T03:13:07', '2005-07-18T08:33:07', '1'), - ('496', '1405', '2006-02-16T02:30:53', '2005-07-07T14:23:56', '2005-07-13T15:26:56', '1'), - ('302', '2829', '2006-02-16T02:30:53', '2005-08-23T05:37:13', '2005-08-27T01:11:13', '1'), - ('302', '2540', '2006-02-16T02:30:53', '2005-05-25T04:47:44', '2005-06-01T00:58:44', '1'), - ('302', '3952', '2006-02-16T02:30:53', '2005-08-23T11:40:08', '2005-08-27T08:16:08', '1'), - ('302', '2304', '2006-02-16T02:30:53', '2005-08-17T23:25:21', '2005-08-23T21:51:21', '1'), - ('302', '483', '2006-02-16T02:30:53', '2005-07-30T10:32:08', '2005-08-08T14:30:08', '1'), - ('302', '1607', '2006-02-16T02:30:53', '2005-07-29T05:10:08', '2005-08-06T00:11:08', '1'), - ('302', '3384', '2006-02-16T02:30:53', '2005-07-27T08:18:38', '2005-08-01T03:24:38', '1'), - ('302', '267', '2006-02-16T02:30:53', '2005-08-21T05:35:17', '2005-08-26T03:22:17', '1'), - ('302', '147', '2006-02-16T02:30:53', '2005-07-10T16:07:16', '2005-07-14T19:48:16', '1'), - ('302', '1332', '2006-02-16T02:30:53', '2005-08-18T13:39:53', '2005-08-20T08:33:53', '1'), - ('302', '2289', '2006-02-16T02:30:53', '2005-08-01T04:56:13', '2005-08-03T03:54:13', '1'), - ('302', '2588', '2006-02-16T02:30:53', '2005-07-31T03:03:07', '2005-08-05T23:01:07', '1'), - ('302', '732', '2006-02-16T02:30:53', '2005-07-10T10:31:52', '2005-07-12T10:47:52', '1'), - ('302', '2971', '2006-02-16T02:30:53', '2005-08-20T16:43:02', '2005-08-25T19:21:02', '1'), - ('302', '515', '2006-02-16T02:30:53', '2005-07-27T16:42:30', '2005-08-05T17:38:30', '1'), - ('110', '1912', '2006-02-16T02:30:53', '2005-07-27T21:43:04', '2005-07-30T00:02:04', '1'), - ('110', '2716', '2006-02-16T02:30:53', '2005-07-11T10:08:13', '2005-07-14T08:18:13', '1'), - ('110', '2971', '2006-02-16T02:30:53', '2005-07-27T19:07:17', '2005-07-30T00:37:17', '1'), - ('110', '3189', '2006-02-16T02:30:53', '2005-07-27T22:40:06', '2005-07-28T23:14:06', '1'), - ('110', '462', '2006-02-16T02:30:53', '2005-07-06T04:27:52', '2005-07-13T08:19:52', '1'), - ('110', '773', '2006-02-16T02:30:53', '2005-08-18T15:52:12', '2005-08-22T21:00:12', '1'), - ('93', '35', '2006-02-16T02:30:53', '2005-07-11T17:00:04', '2005-07-12T13:16:04', '1'), - ('93', '161', '2006-02-16T02:30:53', '2005-08-22T20:23:13', '2005-08-29T18:23:13', '1'), - ('93', '3732', '2006-02-16T02:30:53', '2005-08-21T03:40:35', '2005-08-23T01:22:35', '1'), - ('93', '3978', '2006-02-16T02:30:53', '2005-08-20T17:58:00', '2005-08-29T23:23:00', '1'), - ('93', '3264', '2006-02-16T02:30:53', '2005-07-09T07:29:45', '2005-07-13T05:56:45', '1'), - ('93', '2458', '2006-02-16T02:30:53', '2005-08-23T07:30:23', '2005-08-24T07:23:23', '1'), - ('93', '3860', '2006-02-16T02:30:53', '2005-07-12T06:56:24', '2005-07-17T09:36:24', '1'), - ('93', '2230', '2006-02-16T02:30:53', '2005-07-08T13:12:07', '2005-07-13T07:34:07', '1'), - ('93', '977', '2006-02-16T02:30:53', '2005-06-20T17:33:55', '2005-06-22T23:09:55', '1'), - ('93', '721', '2006-02-16T02:30:53', '2005-08-20T16:11:34', '2005-08-26T12:46:34', '1'), - ('93', '3176', '2006-02-16T02:30:53', '2005-08-20T04:09:50', '2005-08-29T05:20:50', '1'), - ('249', '4321', '2006-02-16T02:30:53', '2005-08-22T14:33:50', '2005-08-28T11:26:50', '1'), - ('249', '402', '2006-02-16T02:30:53', '2005-08-21T06:50:48', '2005-08-28T11:35:48', '1'), - ('249', '698', '2006-02-16T02:30:53', '2005-08-02T08:55:25', '2005-08-10T10:59:25', '1'), - ('249', '4575', '2006-02-16T02:30:53', '2005-08-02T10:00:55', '2005-08-05T10:38:55', '1'), - ('249', '1930', '2006-02-16T02:30:53', '2005-06-17T20:58:32', '2005-06-23T22:22:32', '1'), - ('249', '3342', '2006-02-16T02:30:53', '2005-08-20T19:07:20', '2005-08-23T15:13:20', '1'), - ('249', '533', '2006-02-16T02:30:53', '2005-07-28T10:33:22', '2005-08-02T12:10:22', '1'), - ('249', '2452', '2006-02-16T02:30:53', '2005-07-10T06:33:39', '2005-07-19T07:47:39', '1'), - ('249', '2162', '2006-02-16T02:30:53', '2005-08-17T05:47:32', '2005-08-20T03:11:32', '1'), - ('154', '1351', '2006-02-16T02:30:53', '2005-08-21T22:21:49', '2005-08-24T16:27:49', '1'), - ('154', '685', '2006-02-16T02:30:53', '2005-08-23T11:16:16', '2005-08-28T10:21:16', '1'), - ('154', '34', '2006-02-16T02:30:53', '2005-07-27T07:19:34', '2005-07-31T04:31:34', '1'), - ('154', '130', '2006-02-16T02:30:53', '2005-08-18T07:09:27', '2005-08-21T03:44:27', '1'), - ('154', '975', '2006-02-16T02:30:53', '2005-07-11T03:32:23', '2005-07-14T07:39:23', '1'), - ('154', '2497', '2006-02-16T02:30:53', '2005-08-01T03:25:27', '2005-08-08T07:52:27', '1'), - ('154', '2737', '2006-02-16T02:30:53', '2005-07-09T06:21:29', '2005-07-11T02:58:29', '1'), - ('154', '4305', '2006-02-16T02:30:53', '2005-07-27T03:45:42', '2005-07-30T05:11:42', '1'), - ('154', '1359', '2006-02-16T02:30:53', '2005-08-01T23:58:45', '2005-08-04T00:59:45', '1'), - ('154', '4463', '2006-02-16T02:30:53', '2005-05-27T21:14:26', '2005-06-05T21:51:26', '1'), - ('154', '3260', '2006-02-16T02:30:53', '2005-08-22T21:15:46', '2005-08-23T17:38:46', '1'), - ('154', '247', '2006-02-16T02:30:53', '2005-08-02T15:15:27', '2005-08-11T16:12:27', '1'), - ('154', '407', '2006-02-16T02:30:53', '2005-05-30T21:30:52', '2005-06-07T16:22:52', '1'), - ('154', '474', '2006-02-16T02:30:53', '2005-07-07T14:13:05', '2005-07-09T14:17:05', '1'), - ('154', '993', '2006-02-16T02:30:53', '2005-07-07T08:06:07', '2005-07-10T14:04:07', '1'), - ('154', '1050', '2006-02-16T02:30:53', '2005-07-10T12:44:48', '2005-07-14T12:25:48', '1'), - ('588', '565', '2006-02-16T02:30:53', '2005-08-22T12:12:58', '2005-08-30T07:20:58', '1'), - ('588', '1754', '2006-02-16T02:30:53', '2005-08-01T06:24:26', '2005-08-02T12:07:26', '1'), - ('588', '1620', '2006-02-16T02:30:53', '2005-08-22T16:37:32', '2005-08-25T19:04:32', '1'), - ('588', '2767', '2006-02-16T02:30:53', '2005-07-28T11:20:36', '2005-07-31T09:16:36', '1'), - ('588', '1558', '2006-02-16T02:30:53', '2005-08-18T01:40:14', '2005-08-25T05:04:14', '1'), - ('588', '3614', '2006-02-16T02:30:53', '2005-08-22T14:30:39', '2005-08-27T15:55:39', '1'), - ('588', '2456', '2006-02-16T02:30:53', '2005-07-29T07:11:49', '2005-07-31T02:45:49', '1'), - ('588', '2562', '2006-02-16T02:30:53', '2005-06-18T19:30:53', '2005-06-20T17:22:53', '1'), - ('588', '3509', '2006-02-16T02:30:53', '2005-07-06T06:19:43', '2005-07-07T02:23:43', '1'), - ('588', '4131', '2006-02-16T02:30:53', '2005-08-19T09:46:53', '2005-08-21T08:29:53', '1'), - ('37', '900', '2006-02-16T02:30:53', '2005-08-20T23:42:46', '2005-08-24T20:06:46', '1'), - ('37', '1884', '2006-02-16T02:30:53', '2005-05-30T11:58:50', '2005-06-05T09:57:50', '1'), - ('37', '2927', '2006-02-16T02:30:53', '2005-08-20T01:33:36', '2005-08-24T06:32:36', '1'), - ('37', '4248', '2006-02-16T02:30:53', '2005-08-22T09:03:44', '2005-08-30T11:28:44', '1'), - ('37', '4574', '2006-02-16T02:30:53', '2005-07-29T06:54:48', '2005-08-06T05:02:48', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['16035', '1583', '1854', '13147', '3734', '14025', '398', '12907', '14861', '15272', '2747', '2778', '15316', '10833', '5784', '13722', '4504', '13625', '8206', '4463', '11325', '13709', '7827', '11842', '4424', '2020', '11773', '1961', '5608', '8445', '13521', '14416', '3088', '2510', '5250', '103', '7034', '1485', '14196', '4607', '13641', '650', '8180', '6825', '2786', '360', '3474', '10704', '3546', '1816', '4037', '14999', '3302', '1045', '9802', '9545', '6473', '11966', '3672', '4876', '15837', '4683', '6300', '9478', '2849', '6313', '6075', '3534', '5989', '11637', '3568', '6827', '1796', '2685', '3530', '11551', '4308', '9899', '12781', '1222', '404', '6444', '12545', '6809', '9197', '13811', '9857', '5459', '15894', '13018', '9471', '8194', '11374', '10866', '4512', '15113', '10369', '4696', '15941', '15094']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('37', '549', '2006-02-16T02:30:53', '2005-08-23T22:08:04', '2005-08-28T03:46:04', '1'), - ('37', '270', '2006-02-16T02:30:53', '2005-06-16T04:44:23', '2005-06-18T03:44:23', '1'), - ('37', '119', '2006-02-16T02:30:53', '2005-06-17T00:43:57', '2005-06-23T05:49:57', '1'), - ('37', '3490', '2006-02-16T02:30:53', '2005-08-19T12:55:09', '2005-08-22T18:10:09', '1'), - ('37', '4569', '2006-02-16T02:30:53', '2005-07-06T11:40:27', '2005-07-14T12:08:27', '1'), - ('37', '4521', '2006-02-16T02:30:53', '2005-08-20T21:19:36', '2005-08-29T23:39:36', '1'), - ('422', '1686', '2006-02-16T02:30:53', '2005-05-27T12:44:03', '2005-06-02T08:19:03', '1'), - ('422', '2844', '2006-02-16T02:30:53', '2005-08-19T04:16:13', '2005-08-27T02:43:13', '1'), - ('422', '1806', '2006-02-16T02:30:53', '2005-08-22T02:48:05', '2005-08-27T00:50:05', '1'), - ('422', '1664', '2006-02-16T02:30:53', '2005-08-22T18:49:40', '2005-08-28T21:22:40', '1'), - ('422', '1374', '2006-02-16T02:30:53', '2005-06-19T16:22:07', '2005-06-24T19:28:07', '1'), - ('422', '3357', '2006-02-16T02:30:53', '2005-06-19T18:18:12', '2005-06-28T21:43:12', '1'), - ('422', '1830', '2006-02-16T02:30:53', '2005-08-22T20:07:03', '2005-08-27T18:45:03', '1'), - ('422', '4380', '2006-02-16T02:30:53', '2005-08-01T23:25:55', '2005-08-10T18:01:55', '1'), - ('422', '2323', '2006-02-16T02:30:53', '2005-07-10T14:03:28', '2005-07-16T16:22:28', '1'), - ('422', '1581', '2006-02-16T02:30:53', '2005-08-20T10:03:45', '2005-08-25T04:26:45', '1'), - ('422', '361', '2006-02-16T02:30:53', '2005-07-08T02:19:27', '2005-07-12T21:15:27', '1'), - ('422', '60', '2006-02-16T02:30:53', '2005-08-20T06:52:03', '2005-08-27T07:43:03', '1'), - ('422', '2979', '2006-02-16T02:30:53', '2005-07-28T23:20:31', '2005-08-04T21:36:31', '1'), - ('422', '4356', '2006-02-16T02:30:53', '2005-07-08T00:04:59', '2005-07-16T01:19:59', '1'), - ('422', '4514', '2006-02-16T02:30:53', '2005-08-02T16:33:11', '2005-08-08T13:42:11', '1'), - ('422', '4089', '2006-02-16T02:30:53', '2005-08-20T09:34:51', '2005-08-23T04:13:51', '1'), - ('422', '659', '2006-02-16T02:30:53', '2005-07-28T08:37:22', '2005-07-31T04:27:22', '1'), - ('422', '2680', '2006-02-16T02:30:53', '2005-08-17T13:13:37', '2005-08-20T08:32:37', '1'), - ('384', '662', '2006-02-16T02:30:53', '2005-07-07T22:14:43', '2005-07-11T01:17:43', '1'), - ('384', '1914', '2006-02-16T02:30:53', '2005-06-17T12:39:50', '2005-06-19T14:59:50', '1'), - ('384', '1886', '2006-02-16T02:30:53', '2005-08-17T10:19:51', '2005-08-23T04:30:51', '1'), - ('384', '2851', '2006-02-16T02:30:53', '2005-06-17T09:02:58', '2005-06-20T03:07:58', '1'), - ('384', '3854', '2006-02-16T02:30:53', '2005-07-10T05:08:26', '2005-07-10T23:24:26', '1'), - ('384', '2792', '2006-02-16T02:30:53', '2005-07-29T07:37:48', '2005-08-04T10:43:48', '1'), - ('384', '2586', '2006-02-16T02:30:53', '2005-08-20T02:42:28', '2005-08-22T06:12:28', '1'), - ('384', '3002', '2006-02-16T02:30:53', '2005-08-21T11:11:46', '2005-08-25T12:33:46', '1'), - ('384', '3049', '2006-02-16T02:30:53', '2005-06-20T15:56:05', '2005-06-29T13:02:05', '1'), - ('384', '3827', '2006-02-16T02:30:53', '2005-06-18T23:44:21', '2005-06-24T00:31:21', '1'), - ('384', '2162', '2006-02-16T02:30:53', '2005-07-09T13:35:32', '2005-07-13T12:19:32', '1'), - ('384', '3343', '2006-02-16T02:30:53', '2005-05-25T17:30:42', '2005-06-03T22:36:42', '1'), - ('281', '1712', '2006-02-16T02:30:53', '2005-07-27T03:03:37', '2005-07-28T23:18:37', '1'), - ('281', '194', '2006-02-16T02:30:53', '2005-06-15T21:24:10', '2005-06-24T23:03:10', '1'), - ('281', '4477', '2006-02-16T02:30:53', '2005-08-21T03:40:40', '2005-08-25T05:55:40', '1'), - ('281', '1193', '2006-02-16T02:30:53', '2005-07-08T07:15:14', '2005-07-11T01:32:14', '1'), - ('281', '367', '2006-02-16T02:30:53', '2005-08-20T07:34:42', '2005-08-26T05:18:42', '1'), - ('281', '4384', '2006-02-16T02:30:53', '2005-05-28T19:45:40', '2005-05-29T21:02:40', '1'), - ('281', '3236', '2006-02-16T02:30:53', '2005-07-28T22:05:24', '2005-08-01T19:09:24', '1'), - ('281', '2342', '2006-02-16T02:30:53', '2005-07-12T18:28:12', '2005-07-15T19:24:12', '1'), - ('594', '2255', '2006-02-16T02:30:53', '2005-06-19T18:46:43', '2005-06-22T16:52:43', '1'), - ('594', '3489', '2006-02-16T02:30:53', '2005-05-27T06:51:14', '2005-06-03T01:58:14', '1'), - ('594', '97', '2006-02-16T02:30:53', '2005-07-05T22:59:53', '2005-07-08T20:32:53', '1'), - ('594', '960', '2006-02-16T02:30:53', '2005-08-01T18:38:02', '2005-08-08T20:19:02', '1'), - ('594', '959', '2006-02-16T02:30:53', '2005-07-06T02:17:54', '2005-07-07T00:19:54', '1'), - ('594', '2861', '2006-02-16T02:30:53', '2005-06-16T21:20:41', '2005-06-18T02:21:41', '1'), - ('594', '3903', '2006-02-16T02:30:53', '2005-07-07T02:52:52', '2005-07-16T00:09:52', '1'), - ('594', '3399', '2006-02-16T02:30:53', '2005-08-22T07:54:47', '2005-08-23T08:39:47', '1'), - ('594', '562', '2006-02-16T02:30:53', '2005-06-21T07:33:40', '2005-06-29T06:02:40', '1'), - ('594', '3470', '2006-02-16T02:30:53', '2005-05-31T06:29:01', '2005-06-09T04:31:01', '1'), - ('594', '2156', '2006-02-16T02:30:53', '2005-07-31T11:04:20', '2005-08-03T05:28:20', '1'), - ('594', '3451', '2006-02-16T02:30:53', '2005-07-31T01:46:24', '2005-08-09T06:11:24', '1'), - ('594', '527', '2006-02-16T02:30:53', '2005-07-12T01:35:40', '2005-07-20T20:11:40', '1'), - ('283', '3702', '2006-02-16T02:30:53', '2005-08-17T17:40:04', '2005-08-20T15:45:04', '1'), - ('283', '3883', '2006-02-16T02:30:53', '2005-07-06T09:01:56', '2005-07-11T14:18:56', '1'), - ('283', '1959', '2006-02-16T02:30:53', '2005-07-08T19:27:50', '2005-07-14T15:42:50', '1'), - ('283', '4388', '2006-02-16T02:30:53', '2005-08-23T15:29:41', '2005-08-27T18:17:41', '1'), - ('283', '3464', '2006-02-16T02:30:53', '2005-07-08T10:38:28', '2005-07-09T12:07:28', '1'), - ('283', '1269', '2006-02-16T02:30:53', '2005-07-11T17:50:09', '2005-07-18T13:11:09', '1'), - ('283', '1139', '2006-02-16T02:30:53', '2005-07-30T23:12:53', '2005-08-04T02:41:53', '1'), - ('283', '3628', '2006-02-16T02:30:53', '2005-06-19T23:06:00', '2005-06-25T18:36:00', '1'), - ('283', '2976', '2006-02-16T02:30:53', '2005-07-11T18:29:52', '2005-07-14T21:34:52', '1'), - ('283', '2160', '2006-02-16T02:30:53', '2005-07-11T05:03:03', '2005-07-12T01:28:03', '1'), - ('283', '2055', '2006-02-16T02:30:53', '2005-07-06T01:32:27', '2005-07-08T23:14:27', '1'), - ('283', '696', '2006-02-16T02:30:53', '2005-07-11T00:57:53', '2005-07-15T02:24:53', '1'), - ('283', '479', '2006-02-16T02:30:53', '2005-08-17T04:36:39', '2005-08-18T02:17:39', '1'), - ('283', '2084', '2006-02-16T02:30:53', '2005-07-06T03:11:57', '2005-07-15T03:14:57', '1'), - ('283', '1529', '2006-02-16T02:30:53', '2005-07-12T18:33:45', '2005-07-13T19:09:45', '1'), - ('283', '3229', '2006-02-16T02:30:53', '2005-06-16T20:10:43', '2005-06-20T19:12:43', '1'), - ('283', '1170', '2006-02-16T02:30:53', '2005-06-19T12:35:21', '2005-06-22T16:58:21', '1'), - ('168', '4542', '2006-02-16T02:30:53', '2005-07-06T01:22:45', '2005-07-10T03:23:45', '1'), - ('168', '3356', '2006-02-16T02:30:53', '2005-08-17T01:03:49', '2005-08-18T22:31:49', '1'), - ('168', '1482', '2006-02-16T02:30:53', '2005-07-07T17:29:16', '2005-07-11T21:47:16', '1'), - ('168', '3352', '2006-02-16T02:30:53', '2005-07-31T14:12:36', '2005-08-08T08:59:36', '1'), - ('168', '1187', '2006-02-16T02:30:53', '2005-08-18T23:50:24', '2005-08-21T02:31:24', '1'), - ('168', '2799', '2006-02-16T02:30:53', '2005-06-15T03:38:49', '2005-06-17T22:30:49', '1'), - ('168', '1293', '2006-02-16T02:30:53', '2005-05-27T13:31:51', '2005-05-30T16:58:51', '1'), - ('168', '2214', '2006-02-16T02:30:53', '2005-07-12T00:36:02', '2005-07-18T05:53:02', '1'), - ('168', '1988', '2006-02-16T02:30:53', '2005-08-18T14:28:00', '2005-08-26T14:10:00', '1'), - ('168', '3455', '2006-02-16T02:30:53', '2005-07-12T17:51:54', '2005-07-17T15:10:54', '1'), - ('168', '3214', '2006-02-16T02:30:53', '2005-07-30T12:31:36', '2005-08-03T09:05:36', '1'), - ('168', '1235', '2006-02-16T02:30:53', '2005-08-20T13:00:30', '2005-08-24T10:18:30', '1'), - ('168', '3316', '2006-02-16T02:30:53', '2005-07-31T13:00:53', '2005-08-09T15:56:53', '1'), - ('168', '1847', '2006-02-16T02:30:53', '2005-07-09T22:43:56', '2005-07-12T18:05:56', '1'), - ('168', '4416', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('168', '2122', '2006-02-16T02:30:53', '2005-08-19T08:04:50', '2005-08-26T11:46:50', '1'), - ('424', '2390', '2006-02-16T02:30:53', '2005-07-30T23:02:36', '2005-08-04T17:49:36', '1'), - ('424', '1148', '2006-02-16T02:30:53', '2005-07-28T22:51:44', '2005-07-29T17:13:44', '1'), - ('424', '2805', '2006-02-16T02:30:53', '2005-08-02T18:14:54', '2005-08-04T18:22:54', '1'), - ('424', '117', '2006-02-16T02:30:53', '2005-08-02T00:22:49', '2005-08-07T04:38:49', '1'), - ('424', '1569', '2006-02-16T02:30:53', '2005-07-08T02:38:56', '2005-07-10T20:46:56', '1'), - ('424', '4338', '2006-02-16T02:30:53', '2005-08-22T12:23:59', '2005-08-27T09:59:59', '1'), - ('424', '2534', '2006-02-16T02:30:53', '2005-08-01T06:13:44', '2005-08-07T09:46:44', '1'), - ('424', '1358', '2006-02-16T02:30:53', '2005-07-08T11:12:27', '2005-07-14T05:41:27', '1'), - ('424', '4304', '2006-02-16T02:30:53', '2005-08-23T18:46:44', '2005-08-31T17:31:44', '1'), - ('424', '922', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['10017', '5611', '3044', '12729', '3166', '11562', '7594', '6834', '8786', '190', '11918', '8093', '8471', '8250', '6781', '1859', '10380', '10090', '11524', '16006', '5525', '10447', '2455', '9944', '6245', '15429', '3822', '5981', '7860', '7434', '5017', '5211', '15137', '2478', '9528', '13527', '15170', '14738', '12082', '11967', '9556', '5458', '15329', '4439', '1384', '12855', '11607', '15002', '13646', '108', '283', '3604', '4426', '2691', '10382', '881', '10650', '4895', '11931', '13567', '2942', '8491', '1304', '11258', '14515', '12596', '2713', '8740', '10917', '7888', '3759', '4755', '1662', '14502', '11146', '8614', '7772', '3397', '8192', '4477', '11205', '12433', '2320', '15700', '8894', '11300', '15061', '8024', '3132', '4371', '11516', '14608', '15674', '2033', '14807', '15217', '3729', '13051', '12788', '12019']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('424', '1495', '2006-02-16T02:30:53', '2005-07-31T18:13:22', '2005-08-05T16:03:22', '1'), - ('424', '2832', '2006-02-16T02:30:53', '2005-07-10T05:13:43', '2005-07-16T05:56:43', '1'), - ('424', '3216', '2006-02-16T02:30:53', '2005-06-20T12:38:49', '2005-06-25T07:49:49', '1'), - ('424', '3711', '2006-02-16T02:30:53', '2005-08-18T21:52:59', '2005-08-21T00:02:59', '1'), - ('424', '1850', '2006-02-16T02:30:53', '2005-06-20T21:32:32', '2005-06-27T20:29:32', '1'), - ('424', '2992', '2006-02-16T02:30:53', '2005-08-17T01:23:39', '2005-08-26T06:16:39', '1'), - ('424', '3230', '2006-02-16T02:30:53', '2005-07-27T23:30:41', '2005-08-02T04:29:41', '1'), - ('533', '897', '2006-02-16T02:30:53', '2005-07-12T18:53:37', '2005-07-19T13:42:37', '1'), - ('533', '2404', '2006-02-16T02:30:53', '2005-07-29T20:39:49', '2005-08-03T18:08:49', '1'), - ('533', '3962', '2006-02-16T02:30:53', '2005-05-26T06:11:28', '2005-06-01T09:44:28', '1'), - ('533', '2169', '2006-02-16T02:30:53', '2005-08-17T16:08:42', '2005-08-20T20:12:42', '1'), - ('533', '1427', '2006-02-16T02:30:53', '2005-07-28T18:29:16', '2005-08-05T21:49:16', '1'), - ('533', '1520', '2006-02-16T02:30:53', '2005-07-29T08:32:11', '2005-08-01T13:55:11', '1'), - ('533', '4519', '2006-02-16T02:30:53', '2005-07-29T00:49:15', '2005-08-04T02:53:15', '1'), - ('533', '3783', '2006-02-16T02:30:53', '2005-07-12T16:21:47', '2005-07-15T19:52:47', '1'), - ('533', '3405', '2006-02-16T02:30:53', '2005-06-17T01:13:38', '2005-06-18T03:13:38', '1'), - ('533', '2225', '2006-02-16T02:30:53', '2005-08-01T06:34:36', '2005-08-02T09:08:36', '1'), - ('533', '4023', '2006-02-16T02:30:53', '2005-07-31T20:22:01', '2005-08-04T17:30:01', '1'), - ('533', '317', '2006-02-16T02:30:53', '2005-08-17T00:10:55', '2005-08-23T05:30:55', '1'), - ('533', '240', '2006-02-16T02:30:53', '2005-08-23T21:01:09', '2005-08-25T19:33:09', '1'), - ('241', '3141', '2006-02-16T02:30:53', '2005-07-10T02:03:08', '2005-07-18T07:32:08', '1'), - ('241', '1198', '2006-02-16T02:30:53', '2005-08-01T09:04:58', '2005-08-08T06:24:58', '1'), - ('241', '870', '2006-02-16T02:30:53', '2005-06-18T19:33:06', '2005-06-21T15:21:06', '1'), - ('241', '2540', '2006-02-16T02:30:53', '2005-07-31T15:44:43', '2005-08-08T10:30:43', '1'), - ('241', '512', '2006-02-16T02:30:53', '2005-07-11T14:56:57', '2005-07-16T14:35:57', '1'), - ('241', '740', '2006-02-16T02:30:53', '2005-08-23T00:20:31', '2005-08-23T20:22:31', '1'), - ('241', '1314', '2006-02-16T02:30:53', '2005-07-06T15:41:15', '2005-07-07T16:41:15', '1'), - ('241', '2151', '2006-02-16T02:30:53', '2005-07-11T00:19:04', '2005-07-13T19:10:04', '1'), - ('241', '2400', '2006-02-16T02:30:53', '2005-07-28T09:58:02', '2005-08-05T06:04:02', '1'), - ('241', '2927', '2006-02-16T02:30:53', '2005-07-27T17:34:40', '2005-07-29T15:01:40', '1'), - ('241', '3745', '2006-02-16T02:30:53', '2005-07-09T02:00:16', '2005-07-14T06:28:16', '1'), - ('241', '2216', '2006-02-16T02:30:53', '2005-07-09T11:26:50', '2005-07-16T15:30:50', '1'), - ('241', '856', '2006-02-16T02:30:53', '2005-08-22T13:20:28', '2005-08-26T09:35:28', '1'), - ('241', '2798', '2006-02-16T02:30:53', '2005-06-18T21:01:21', '2005-06-24T00:20:21', '1'), - ('241', '193', '2006-02-16T02:30:53', '2005-07-31T01:05:04', '2005-08-07T01:16:04', '1'), - ('521', '4424', '2006-02-16T02:30:53', '2005-08-20T03:00:47', '2005-08-25T01:03:47', '1'), - ('521', '2123', '2006-02-16T02:30:53', '2005-08-22T15:22:15', '2005-08-23T20:32:15', '1'), - ('521', '3315', '2006-02-16T02:30:53', '2005-08-21T22:29:13', '2005-08-29T21:19:13', '1'), - ('521', '3435', '2006-02-16T02:30:53', '2005-08-17T22:13:15', '2005-08-24T18:30:15', '1'), - ('521', '1151', '2006-02-16T02:30:53', '2005-08-17T17:45:00', '2005-08-22T13:03:00', '1'), - ('521', '3269', '2006-02-16T02:30:53', '2005-07-31T02:13:30', '2005-08-08T06:46:30', '1'), - ('521', '2203', '2006-02-16T02:30:53', '2005-07-09T22:35:49', '2005-07-16T22:55:49', '1'), - ('521', '1900', '2006-02-16T02:30:53', '2005-08-22T20:32:39', '2005-08-23T17:15:39', '1'), - ('521', '2393', '2006-02-16T02:30:53', '2005-07-07T22:57:30', '2005-07-10T18:28:30', '1'), - ('242', '4242', '2006-02-16T02:30:53', '2005-06-15T15:22:03', '2005-06-18T18:11:03', '1'), - ('242', '2900', '2006-02-16T02:30:53', '2005-08-19T02:18:58', '2005-08-19T20:50:58', '1'), - ('242', '4345', '2006-02-16T02:30:53', '2005-08-17T03:36:06', '2005-08-20T01:06:06', '1'), - ('242', '4198', '2006-02-16T02:30:53', '2005-08-22T08:06:00', '2005-08-24T10:48:00', '1'), - ('242', '1347', '2006-02-16T02:30:53', '2005-08-20T07:47:08', '2005-08-29T08:33:08', '1'), - ('242', '3289', '2006-02-16T02:30:53', '2005-05-25T18:30:05', '2005-05-30T19:40:05', '1'), - ('242', '3530', '2006-02-16T02:30:53', '2005-05-26T19:05:05', '2005-05-31T19:19:05', '1'), - ('242', '1380', '2006-02-16T02:30:53', '2005-07-06T05:25:22', '2005-07-07T23:52:22', '1'), - ('242', '364', '2006-02-16T02:30:53', '2005-07-07T22:28:32', '2005-07-16T02:04:32', '1'), - ('242', '3469', '2006-02-16T02:30:53', '2005-06-19T13:06:50', '2005-06-26T15:56:50', '1'), - ('242', '4455', '2006-02-16T02:30:53', '2005-08-01T06:36:45', '2005-08-02T06:06:45', '1'), - ('242', '602', '2006-02-16T02:30:53', '2005-05-30T06:15:36', '2005-06-02T10:21:36', '1'), - ('242', '2306', '2006-02-16T02:30:53', '2005-08-01T16:18:45', '2005-08-09T16:29:45', '1'), - ('242', '2620', '2006-02-16T02:30:53', '2005-07-08T20:22:05', '2005-07-12T20:49:05', '1'), - ('242', '2022', '2006-02-16T02:30:53', '2005-08-17T16:35:14', '2005-08-19T19:16:14', '1'), - ('242', '543', '2006-02-16T02:30:53', '2005-08-20T04:49:21', '2005-08-26T10:27:21', '1'), - ('242', '999', '2006-02-16T02:30:53', '2005-06-20T05:27:31', '2005-06-29T00:35:31', '1'), - ('242', '1806', '2006-02-16T02:30:53', '2005-07-29T09:02:13', '2005-08-03T04:32:13', '1'), - ('242', '1304', '2006-02-16T02:30:53', '2005-06-15T09:56:02', '2005-06-24T07:00:02', '1'), - ('242', '1576', '2006-02-16T02:30:53', '2005-08-02T13:45:39', '2005-08-06T07:57:39', '1'), - ('242', '2215', '2006-02-16T02:30:53', '2005-08-21T14:52:14', '2005-08-27T10:27:14', '1'), - ('378', '3662', '2006-02-16T02:30:53', '2005-08-18T16:29:35', '2005-08-24T16:48:35', '1'), - ('378', '3979', '2006-02-16T02:30:53', '2005-06-19T14:23:09', '2005-06-20T17:55:09', '1'), - ('378', '3781', '2006-02-16T02:30:53', '2005-07-29T18:41:31', '2005-08-01T18:38:31', '1'), - ('378', '3146', '2006-02-16T02:30:53', '2005-08-02T02:06:18', '2005-08-03T22:42:18', '1'), - ('378', '545', '2006-02-16T02:30:53', '2005-07-28T10:40:24', '2005-08-01T16:18:24', '1'), - ('378', '4165', '2006-02-16T02:30:53', '2005-07-06T12:46:38', '2005-07-10T11:31:38', '1'), - ('378', '661', '2006-02-16T02:30:53', '2005-07-08T14:23:41', '2005-07-10T19:35:41', '1'), - ('378', '3552', '2006-02-16T02:30:53', '2005-06-16T10:13:35', '2005-06-23T13:54:35', '1'), - ('378', '2986', '2006-02-16T02:30:53', '2005-08-21T14:22:28', '2005-08-23T10:40:28', '1'), - ('552', '2488', '2006-02-16T02:30:53', '2005-08-02T09:45:32', '2005-08-07T07:33:32', '1'), - ('552', '604', '2006-02-16T02:30:53', '2005-07-29T13:32:05', '2005-08-04T15:26:05', '1'), - ('552', '986', '2006-02-16T02:30:53', '2005-07-28T06:59:09', '2005-08-01T10:49:09', '1'), - ('552', '602', '2006-02-16T02:30:53', '2005-06-21T15:30:11', '2005-06-22T21:12:11', '1'), - ('552', '255', '2006-02-16T02:30:53', '2005-07-28T22:49:11', '2005-07-30T04:13:11', '1'), - ('552', '1602', '2006-02-16T02:30:53', '2005-07-08T00:38:24', '2005-07-13T05:14:24', '1'), - ('552', '4321', '2006-02-16T02:30:53', '2005-08-02T11:56:54', '2005-08-05T08:24:54', '1'), - ('552', '1776', '2006-02-16T02:30:53', '2005-08-18T10:37:49', '2005-08-19T08:00:49', '1'), - ('552', '597', '2006-02-16T02:30:53', '2005-06-18T09:24:50', '2005-06-24T07:59:50', '1'), - ('552', '2935', '2006-02-16T02:30:53', '2005-08-23T10:21:21', '2005-08-24T15:37:21', '1'), - ('552', '2055', '2006-02-16T02:30:53', '2005-07-30T00:48:31', '2005-07-31T05:49:31', '1'), - ('552', '3032', '2006-02-16T02:30:53', '2005-08-02T15:37:42', '2005-08-11T14:25:42', '1'), - ('90', '3436', '2006-02-16T02:30:53', '2005-08-22T10:29:44', '2005-08-24T14:40:44', '1'), - ('90', '1735', '2006-02-16T02:30:53', '2005-07-28T15:55:40', '2005-08-02T09:56:40', '1'), - ('90', '711', '2006-02-16T02:30:53', '2005-06-20T19:09:46', '2005-06-24T19:42:46', '1'), - ('90', '2533', '2006-02-16T02:30:53', '2005-07-07T20:06:45', '2005-07-08T18:50:45', '1'), - ('90', '1860', '2006-02-16T02:30:53', '2005-08-16T23:54:47', '2005-08-17T20:05:47', '1'), - ('90', '3321', '2006-02-16T02:30:53', '2005-08-21T17:57:22', '2005-08-25T13:20:22', '1'), - ('90', '4482', '2006-02-16T02:30:53', '2005-08-23T09:16:39', '2005-09-01T11:57:39', '1'), - ('90', '58', '2006-02-16T02:30:53', '2005-06-17T13:24:43', '2005-06-20T12:34:43', '1'), - ('90', '335', '2006-02-16T02:30:53', '2005-08-22T00:57:43', '2005-08-26T23:40:43', '1'), - ('90', '91', '2006-02-16T02:30:53', '2005-08-22T16:58:31', '2005-08-23T22:33:31', '1'), - ('90', '3156', '2006-02-16T02:30:53', '2005-07-06T11:30:29', '2005-07-12T07:18:29', '1'), - ('90', '4064', '2006-02-16T02:30:53', '2005-08-19T09:31:33', '2005-08-28T06:15:33', '1'), - ('90', '644', '2006-02-16T02:30:53', '2005-08-19T00:15:09', '2005-08-27T21:54:09', '1'), - ('90', '2566', '2006-02-16T02:30:53', '2005-08-17T19:48:55', '2005-08-21T18:20:55', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['5272', '2178', '12852', '2040', '2091', '4054', '2823', '3193', '14035', '8484', '14579', '13685', '13440', '7885', '10970', '1101', '2727', '12728', '10024', '3183', '9983', '4602', '13653', '3689', '14968', '10483', '13961', '8345', '1732', '2795', '4896', '2768', '4256', '15263', '9651', '10212', '5778', '11617', '4368', '4197', '7263', '14262', '7960', '3947', '12543', '563', '6034', '11771', '5702', '7240', '13356', '5220', '9269', '11041', '9655', '3690', '14696', '13208', '757', '3918', '6935', '10998', '14850', '10701', '9307', '15343', '3189', '13770', '12089', '3554', '9939', '5486', '2682', '10732', '6936', '14591', '594', '7694', '9897', '5898', '10962', '13544', '1314', '13558', '11768', '10401', '985', '9929', '10129', '14593', '13701', '4196', '10528', '13324', '14439', '1503', '1605', '903', '730', '8165']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('90', '1547', '2006-02-16T02:30:53', '2005-07-09T14:26:01', '2005-07-12T20:20:01', '1'), - ('260', '2950', '2006-02-16T02:30:53', '2005-06-18T00:38:35', '2005-06-21T02:56:35', '1'), - ('260', '2446', '2006-02-16T02:30:53', '2005-08-19T02:12:40', '2005-08-19T23:42:40', '1'), - ('260', '227', '2006-02-16T02:30:53', '2005-06-17T14:18:37', '2005-06-22T19:08:37', '1'), - ('260', '4033', '2006-02-16T02:30:53', '2005-06-17T18:09:04', '2005-06-26T12:11:04', '1'), - ('260', '3885', '2006-02-16T02:30:53', '2005-07-07T03:42:07', '2005-07-10T03:22:07', '1'), - ('260', '3566', '2006-02-16T02:30:53', '2005-06-19T20:30:21', '2005-06-26T17:58:21', '1'), - ('260', '3176', '2006-02-16T02:30:53', '2005-06-20T23:52:30', '2005-06-22T21:21:30', '1'), - ('260', '2035', '2006-02-16T02:30:53', '2005-08-20T21:31:58', '2005-08-22T16:28:58', '1'), - ('260', '742', '2006-02-16T02:30:53', '2005-07-29T08:51:59', '2005-07-30T09:07:59', '1'), - ('260', '1205', '2006-02-16T02:30:53', '2005-08-21T16:54:47', '2005-08-28T12:35:47', '1'), - ('260', '3336', '2006-02-16T02:30:53', '2005-08-20T08:57:11', '2005-08-27T07:26:11', '1'), - ('260', '2842', '2006-02-16T02:30:53', '2005-08-19T23:42:52', '2005-08-25T19:19:52', '1'), - ('260', '4294', '2006-02-16T02:30:53', '2005-07-28T10:37:41', '2005-08-05T07:56:41', '1'), - ('260', '1202', '2006-02-16T02:30:53', '2005-08-02T04:06:46', '2005-08-10T04:27:46', '1'), - ('260', '1174', '2006-02-16T02:30:53', '2005-05-31T14:13:59', '2005-06-07T15:49:59', '1'), - ('129', '3261', '2006-02-16T02:30:53', '2005-06-19T15:02:39', '2005-06-28T17:49:39', '1'), - ('129', '3156', '2006-02-16T02:30:53', '2005-08-18T21:47:48', '2005-08-25T16:13:48', '1'), - ('129', '265', '2006-02-16T02:30:53', '2005-07-31T18:26:36', '2005-08-09T16:16:36', '1'), - ('129', '4397', '2006-02-16T02:30:53', '2005-06-20T22:55:55', '2005-06-23T17:22:55', '1'), - ('129', '350', '2006-02-16T02:30:53', '2005-07-31T17:09:36', '2005-08-08T20:26:36', '1'), - ('129', '3616', '2006-02-16T02:30:53', '2005-07-08T06:52:40', '2005-07-10T06:30:40', '1'), - ('129', '4029', '2006-02-16T02:30:53', '2005-08-20T07:54:54', '2005-08-29T06:43:54', '1'), - ('129', '3168', '2006-02-16T02:30:53', '2005-07-06T09:43:01', '2005-07-11T09:57:01', '1'), - ('129', '3302', '2006-02-16T02:30:53', '2005-08-22T06:46:59', '2005-08-29T07:36:59', '1'), - ('129', '1521', '2006-02-16T02:30:53', '2005-08-01T10:19:45', '2005-08-04T09:29:45', '1'), - ('129', '2271', '2006-02-16T02:30:53', '2005-08-20T18:16:34', '2005-08-21T16:14:34', '1'), - ('129', '1034', '2006-02-16T02:30:53', '2005-07-29T04:47:37', '2005-08-02T07:25:37', '1'), - ('129', '2287', '2006-02-16T02:30:53', '2005-06-16T15:34:41', '2005-06-18T13:05:41', '1'), - ('129', '3694', '2006-02-16T02:30:53', '2005-06-19T18:58:53', '2005-06-28T18:56:53', '1'), - ('129', '3006', '2006-02-16T02:30:53', '2005-07-08T20:23:15', '2005-07-10T15:38:15', '1'), - ('129', '3018', '2006-02-16T02:30:53', '2005-06-19T17:46:52', '2005-06-25T21:49:52', '1'), - ('129', '1386', '2006-02-16T02:30:53', '2005-07-07T14:14:36', '2005-07-10T09:41:36', '1'), - ('324', '184', '2006-02-16T02:30:53', '2005-08-22T18:27:33', '2005-08-30T14:05:33', '1'), - ('324', '4059', '2006-02-16T02:30:53', '2005-07-31T05:48:49', '2005-08-04T06:53:49', '1'), - ('324', '3728', '2006-02-16T02:30:53', '2005-08-01T01:01:35', '2005-08-02T23:02:35', '1'), - ('324', '4435', '2006-02-16T02:30:53', '2005-07-10T13:41:37', '2005-07-14T16:26:37', '1'), - ('324', '1898', '2006-02-16T02:30:53', '2005-08-17T04:00:40', '2005-08-18T00:36:40', '1'), - ('324', '736', '2006-02-16T02:30:53', '2005-07-07T19:55:19', '2005-07-09T00:11:19', '1'), - ('324', '2515', '2006-02-16T02:30:53', '2005-07-07T11:07:52', '2005-07-10T10:19:52', '1'), - ('324', '725', '2006-02-16T02:30:53', '2005-07-27T11:17:22', '2005-08-04T10:59:22', '1'), - ('324', '1430', '2006-02-16T02:30:53', '2005-08-21T06:08:13', '2005-08-30T10:55:13', '1'), - ('324', '2718', '2006-02-16T02:30:53', '2005-07-28T13:47:08', '2005-08-03T15:17:08', '1'), - ('324', '4188', '2006-02-16T02:30:53', '2005-07-06T21:42:21', '2005-07-08T19:37:21', '1'), - ('324', '330', '2006-02-16T02:30:53', '2005-08-18T14:23:55', '2005-08-20T12:42:55', '1'), - ('324', '53', '2006-02-16T02:30:53', '2005-05-28T09:10:49', '2005-06-06T11:32:49', '1'), - ('324', '1735', '2006-02-16T02:30:53', '2005-07-11T03:00:50', '2005-07-16T06:19:50', '1'), - ('324', '2575', '2006-02-16T02:30:53', '2005-08-17T10:17:09', '2005-08-25T10:58:09', '1'), - ('324', '3349', '2006-02-16T02:30:53', '2005-07-10T10:00:01', '2005-07-11T15:29:01', '1'), - ('324', '4565', '2006-02-16T02:30:53', '2005-07-27T10:21:15', '2005-08-03T05:04:15', '1'), - ('324', '2713', '2006-02-16T02:30:53', '2005-08-19T21:02:21', '2005-08-24T00:31:21', '1'), - ('435', '2577', '2006-02-16T02:30:53', '2005-07-09T11:59:04', '2005-07-15T06:20:04', '1'), - ('435', '548', '2006-02-16T02:30:53', '2005-07-30T15:02:33', '2005-08-02T16:32:33', '1'), - ('435', '1897', '2006-02-16T02:30:53', '2005-08-02T06:03:53', '2005-08-03T11:57:53', '1'), - ('435', '3403', '2006-02-16T02:30:53', '2005-07-31T05:57:54', '2005-08-06T02:00:54', '1'), - ('435', '4405', '2006-02-16T02:30:53', '2005-07-06T09:46:03', '2005-07-07T12:12:03', '1'), - ('435', '3776', '2006-02-16T02:30:53', '2005-08-21T20:48:05', '2005-08-25T14:55:05', '1'), - ('435', '609', '2006-02-16T02:30:53', '2005-08-19T15:18:55', '2005-08-24T11:59:55', '1'), - ('435', '1067', '2006-02-16T02:30:53', '2005-05-29T10:29:47', '2005-06-07T15:27:47', '1'), - ('435', '1111', '2006-02-16T02:30:53', '2005-07-06T20:26:15', '2005-07-15T20:32:15', '1'), - ('435', '2771', '2006-02-16T02:30:53', '2005-07-26T23:13:10', '2005-07-27T18:09:10', '1'), - ('435', '1479', '2006-02-16T02:30:53', '2005-08-02T04:50:55', '2005-08-11T03:43:55', '1'), - ('435', '2405', '2006-02-16T02:30:53', '2005-08-22T02:16:55', '2005-08-26T21:08:55', '1'), - ('538', '3958', '2006-02-16T02:30:53', '2005-08-01T18:28:17', '2005-08-09T21:51:17', '1'), - ('538', '3831', '2006-02-16T02:30:53', '2005-07-30T16:52:43', '2005-08-01T11:58:43', '1'), - ('538', '2589', '2006-02-16T02:30:53', '2005-08-22T21:01:25', '2005-08-28T16:15:25', '1'), - ('538', '1502', '2006-02-16T02:30:53', '2005-06-20T23:19:33', '2005-06-24T17:46:33', '1'), - ('538', '998', '2006-02-16T02:30:53', '2005-08-20T11:45:54', '2005-08-22T17:08:54', '1'), - ('538', '651', '2006-02-16T02:30:53', '2005-08-17T22:20:29', '2005-08-24T02:12:29', '1'), - ('538', '793', '2006-02-16T02:30:53', '2005-07-06T02:37:10', '2005-07-09T01:58:10', '1'), - ('538', '3049', '2006-02-16T02:30:53', '2005-07-31T15:29:00', '2005-08-08T11:09:00', '1'), - ('538', '2864', '2006-02-16T02:30:53', '2005-07-09T23:57:44', '2005-07-14T00:23:44', '1'), - ('538', '3609', '2006-02-16T02:30:53', '2005-06-19T12:18:17', '2005-06-28T14:09:17', '1'), - ('538', '2810', '2006-02-16T02:30:53', '2005-08-01T19:25:18', '2005-08-10T22:26:18', '1'), - ('538', '60', '2006-02-16T02:30:53', '2005-07-26T23:13:34', '2005-07-30T19:14:34', '1'), - ('538', '3410', '2006-02-16T02:30:53', '2005-08-21T17:30:09', '2005-08-24T12:27:09', '1'), - ('538', '2766', '2006-02-16T02:30:53', '2005-05-28T13:41:56', '2005-05-30T12:00:56', '1'), - ('538', '2892', '2006-02-16T02:30:53', '2005-07-28T03:39:25', '2005-07-31T05:47:25', '1'), - ('538', '3945', '2006-02-16T02:30:53', '2005-07-31T14:11:57', '2005-08-02T12:20:57', '1'), - ('538', '3257', '2006-02-16T02:30:53', '2005-07-10T20:18:09', '2005-07-16T14:44:09', '1'), - ('538', '1953', '2006-02-16T02:30:53', '2005-08-02T03:48:13', '2005-08-07T00:04:13', '1'), - ('538', '58', '2006-02-16T02:30:53', '2005-08-20T03:44:26', '2005-08-27T22:11:26', '1'), - ('538', '1359', '2006-02-16T02:30:53', '2005-06-15T10:21:45', '2005-06-21T14:10:45', '1'), - ('564', '1551', '2006-02-16T02:30:53', '2005-08-20T04:13:17', '2005-08-24T06:38:17', '1'), - ('564', '1307', '2006-02-16T02:30:53', '2005-08-17T10:02:29', '2005-08-23T10:26:29', '1'), - ('564', '1560', '2006-02-16T02:30:53', '2005-08-01T07:27:09', '2005-08-02T01:38:09', '1'), - ('564', '1573', '2006-02-16T02:30:53', '2005-05-30T22:18:35', '2005-06-04T23:36:35', '1'), - ('564', '2521', '2006-02-16T02:30:53', '2005-07-31T15:17:24', '2005-08-03T17:27:24', '1'), - ('564', '2848', '2006-02-16T02:30:53', '2005-07-31T21:41:35', '2005-08-05T17:05:35', '1'), - ('564', '1399', '2006-02-16T02:30:53', '2005-08-21T17:33:18', '2005-08-24T22:11:18', '1'), - ('564', '1643', '2006-02-16T02:30:53', '2005-08-20T09:27:05', '2005-08-21T14:54:05', '1'), - ('564', '3407', '2006-02-16T02:30:53', '2005-07-07T11:06:33', '2005-07-14T13:46:33', '1'), - ('564', '4401', '2006-02-16T02:30:53', '2005-08-01T11:56:22', '2005-08-07T07:13:22', '1'), - ('564', '4349', '2006-02-16T02:30:53', '2005-08-19T19:51:00', '2005-08-20T20:26:00', '1'), - ('564', '3903', '2006-02-16T02:30:53', '2005-08-21T11:52:41', '2005-08-30T10:36:41', '1'), - ('197', '763', '2006-02-16T02:30:53', '2005-06-15T22:07:09', '2005-06-20T23:15:09', '1'), - ('197', '593', '2006-02-16T02:30:53', '2005-06-16T06:17:55', '2005-06-25T01:25:55', '1'), - ('197', '2423', '2006-02-16T02:30:53', '2005-05-30T10:11:29', '2005-06-03T09:33:29', '1'), - ('197', '3473', '2006-02-16T02:30:53', '2005-05-29T07:00:59', '2005-06-06T01:17:59', '1'), - ('197', '3460', '2006-02-16T02:30:53', '2005-07-28T21:23:06', '2005-08-01T21:32:06', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['4486', '11018', '11215', '683', '11478', '10743', '2090', '649', '94', '1919', '9378', '15078', '10460', '11643', '15540', '11311', '4739', '8044', '7671', '3661', '10365', '14199', '558', '13004', '6632', '632', '15207', '3545', '1358', '466', '9180', '7754', '9947', '10268', '7208', '6458', '8123', '5679', '14486', '15501', '14194', '3090', '8190', '8572', '1349', '91', '2877', '12320', '15020', '15208', '11373', '11690', '9807', '1030', '13713', '15903', '9059', '6706', '2754', '3817', '2265', '9403', '15227', '7332', '11714', '3017', '15996', '6854', '13230', '164', '10078', '3390', '10662', '10311', '9890', '14922', '2474', '4376', '1037', '9399', '6046', '11255', '14959', '12308', '10884', '624', '11946', '647', '11030', '4204', '14400', '12157', '12958', '16005', '6073', '13884', '11343', '13478', '5048', '1104']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('197', '837', '2006-02-16T02:30:53', '2005-07-08T01:09:09', '2005-07-16T23:40:09', '1'), - ('197', '2988', '2006-02-16T02:30:53', '2005-08-02T05:27:53', '2005-08-07T10:48:53', '1'), - ('197', '379', '2006-02-16T02:30:53', '2005-08-02T12:20:42', '2005-08-06T14:01:42', '1'), - ('197', '2038', '2006-02-16T02:30:53', '2005-05-29T00:09:48', '2005-06-02T04:27:48', '1'), - ('197', '3932', '2006-02-16T02:30:53', '2005-08-02T22:09:05', '2005-08-04T18:02:05', '1'), - ('197', '4206', '2006-02-16T02:30:53', '2005-08-01T19:55:09', '2005-08-03T19:29:09', '1'), - ('197', '17', '2006-02-16T02:30:53', '2005-06-17T18:06:14', '2005-06-22T23:52:14', '1'), - ('197', '1781', '2006-02-16T02:30:53', '2005-05-28T19:35:45', '2005-06-05T16:00:45', '1'), - ('197', '1675', '2006-02-16T02:30:53', '2005-05-25T16:03:42', '2005-05-30T14:23:42', '1'), - ('197', '3855', '2006-02-16T02:30:53', '2005-06-17T05:40:52', '2005-06-23T05:58:52', '1'), - ('197', '2209', '2006-02-16T02:30:53', '2005-07-30T19:12:54', '2005-08-05T18:16:54', '1'), - ('197', '3001', '2006-02-16T02:30:53', '2005-08-22T11:09:31', '2005-08-25T12:16:31', '1'), - ('197', '4504', '2006-02-16T02:30:53', '2005-08-01T09:31:00', '2005-08-09T09:28:00', '1'), - ('197', '1378', '2006-02-16T02:30:53', '2005-08-17T04:49:35', '2005-08-24T07:05:35', '1'), - ('197', '1696', '2006-02-16T02:30:53', '2005-08-23T04:12:52', '2005-08-31T04:25:52', '1'), - ('197', '204', '2006-02-16T02:30:53', '2005-08-02T15:53:48', '2005-08-03T16:32:48', '1'), - ('197', '140', '2006-02-16T02:30:53', '2005-07-08T13:25:57', '2005-07-11T17:36:57', '1'), - ('442', '879', '2006-02-16T02:30:53', '2005-07-28T16:49:12', '2005-08-02T22:41:12', '1'), - ('442', '3464', '2006-02-16T02:30:53', '2005-07-28T02:48:31', '2005-07-30T23:04:31', '1'), - ('442', '2600', '2006-02-16T02:30:53', '2005-07-06T08:10:02', '2005-07-10T10:17:02', '1'), - ('442', '4032', '2006-02-16T02:30:53', '2005-08-01T06:08:44', '2005-08-06T02:07:44', '1'), - ('442', '658', '2006-02-16T02:30:53', '2005-08-21T03:48:43', '2005-08-23T04:01:43', '1'), - ('442', '4163', '2006-02-16T02:30:53', '2005-05-28T08:38:43', '2005-06-06T13:52:43', '1'), - ('442', '771', '2006-02-16T02:30:53', '2005-08-19T07:40:08', '2005-08-20T11:49:08', '1'), - ('442', '2929', '2006-02-16T02:30:53', '2005-07-12T09:33:10', '2005-07-15T11:36:10', '1'), - ('442', '1287', '2006-02-16T02:30:53', '2005-05-28T17:37:50', '2005-06-03T16:04:50', '1'), - ('442', '1149', '2006-02-16T02:30:53', '2005-08-22T16:35:25', '2005-08-23T14:06:25', '1'), - ('442', '3924', '2006-02-16T02:30:53', '2005-07-06T02:16:17', '2005-07-11T00:54:17', '1'), - ('442', '2025', '2006-02-16T02:30:53', '2005-06-15T13:28:48', '2005-06-21T13:40:48', '1'), - ('442', '1786', '2006-02-16T02:30:53', '2005-05-27T20:57:07', '2005-05-29T15:52:07', '1'), - ('442', '3479', '2006-02-16T02:30:53', '2005-07-30T12:03:15', '2005-08-01T14:25:15', '1'), - ('138', '1981', '2006-02-16T02:30:53', '2005-07-28T06:10:55', '2005-07-29T02:46:55', '1'), - ('138', '1173', '2006-02-16T02:30:53', '2005-07-31T15:49:40', '2005-08-08T11:11:40', '1'), - ('138', '2755', '2006-02-16T02:30:53', '2005-08-01T03:08:56', '2005-08-08T02:41:56', '1'), - ('138', '1523', '2006-02-16T02:30:53', '2005-07-27T09:16:28', '2005-07-28T09:40:28', '1'), - ('138', '2809', '2006-02-16T02:30:53', '2005-07-12T01:08:52', '2005-07-16T20:22:52', '1'), - ('138', '2256', '2006-02-16T02:30:53', '2005-07-28T19:28:23', '2005-08-04T19:41:23', '1'), - ('138', '389', '2006-02-16T02:30:53', '2005-07-10T08:44:02', '2005-07-14T05:30:02', '1'), - ('138', '3119', '2006-02-16T02:30:53', '2005-08-21T13:52:54', '2005-08-23T07:58:54', '1'), - ('138', '4468', '2006-02-16T02:30:53', '2005-08-23T02:39:56', '2005-08-25T04:39:56', '1'), - ('138', '2003', '2006-02-16T02:30:53', '2005-08-21T03:40:11', '2005-08-26T07:38:11', '1'), - ('267', '3301', '2006-02-16T02:30:53', '2005-06-20T16:00:19', '2005-06-23T14:55:19', '1'), - ('267', '2290', '2006-02-16T02:30:53', '2005-07-28T22:47:06', '2005-08-04T21:51:06', '1'), - ('267', '2815', '2006-02-16T02:30:53', '2005-07-29T11:51:24', '2005-08-02T11:44:24', '1'), - ('267', '1131', '2006-02-16T02:30:53', '2005-06-15T12:49:02', '2005-06-17T15:20:02', '1'), - ('267', '139', '2006-02-16T02:30:53', '2005-05-25T14:57:22', '2005-06-01T18:32:22', '1'), - ('267', '485', '2006-02-16T02:30:53', '2005-06-20T01:07:16', '2005-06-24T01:05:16', '1'), - ('267', '3248', '2006-02-16T02:30:53', '2005-08-18T06:26:51', '2005-08-20T04:00:51', '1'), - ('267', '3460', '2006-02-16T02:30:53', '2005-08-22T08:54:12', '2005-08-27T04:54:12', '1'), - ('267', '4346', '2006-02-16T02:30:53', '2005-08-22T16:35:47', '2005-08-30T15:16:47', '1'), - ('267', '181', '2006-02-16T02:30:53', '2005-08-02T18:14:12', '2005-08-06T23:37:12', '1'), - ('267', '3934', '2006-02-16T02:30:53', '2005-08-17T06:44:22', '2005-08-24T03:49:22', '1'), - ('267', '2137', '2006-02-16T02:30:53', '2005-07-31T11:13:52', '2005-08-02T07:34:52', '1'), - ('267', '3948', '2006-02-16T02:30:53', '2005-05-31T04:06:47', '2005-06-02T02:59:47', '1'), - ('267', '3075', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('267', '1289', '2006-02-16T02:30:53', '2005-08-23T17:30:40', '2005-08-29T14:12:40', '1'), - ('267', '480', '2006-02-16T02:30:53', '2005-07-30T07:18:44', '2005-08-08T08:39:44', '1'), - ('267', '4552', '2006-02-16T02:30:53', '2005-07-12T12:59:16', '2005-07-19T10:37:16', '1'), - ('267', '1761', '2006-02-16T02:30:53', '2005-06-19T16:55:59', '2005-06-26T18:11:59', '1'), - ('267', '2933', '2006-02-16T02:30:53', '2005-07-06T15:31:45', '2005-07-11T17:11:45', '1'), - ('267', '3069', '2006-02-16T02:30:53', '2005-06-18T06:03:27', '2005-06-20T01:16:27', '1'), - ('267', '3466', '2006-02-16T02:30:53', '2005-07-30T20:18:53', '2005-08-06T19:54:53', '1'), - ('151', '2987', '2006-02-16T02:30:53', '2005-08-22T17:22:41', '2005-08-23T20:59:41', '1'), - ('151', '1761', '2006-02-16T02:30:53', '2005-07-27T13:58:57', '2005-08-02T12:40:57', '1'), - ('151', '17', '2006-02-16T02:30:53', '2005-08-17T07:34:55', '2005-08-18T04:07:55', '1'), - ('151', '2513', '2006-02-16T02:30:53', '2005-06-20T11:08:56', '2005-06-28T16:26:56', '1'), - ('151', '3098', '2006-02-16T02:30:53', '2005-08-23T20:31:38', '2005-08-29T20:58:38', '1'), - ('151', '3173', '2006-02-16T02:30:53', '2005-07-12T19:38:57', '2005-07-16T16:28:57', '1'), - ('151', '3645', '2006-02-16T02:30:53', '2005-08-19T16:12:07', '2005-08-21T12:19:07', '1'), - ('151', '1070', '2006-02-16T02:30:53', '2005-05-26T02:26:49', '2005-05-28T00:32:49', '1'), - ('151', '3198', '2006-02-16T02:30:53', '2005-07-31T20:02:02', '2005-08-04T00:45:02', '1'), - ('151', '2034', '2006-02-16T02:30:53', '2005-06-21T15:10:50', '2005-06-26T12:38:50', '1'), - ('151', '2857', '2006-02-16T02:30:53', '2005-08-01T16:50:57', '2005-08-03T17:19:57', '1'), - ('151', '4211', '2006-02-16T02:30:53', '2005-08-01T04:27:59', '2005-08-02T08:51:59', '1'), - ('151', '1024', '2006-02-16T02:30:53', '2005-07-31T14:04:44', '2005-08-01T11:24:44', '1'), - ('151', '2322', '2006-02-16T02:30:53', '2005-08-22T05:13:05', '2005-08-30T04:59:05', '1'), - ('151', '3450', '2006-02-16T02:30:53', '2005-06-18T20:51:34', '2005-06-25T01:39:34', '1'), - ('151', '1344', '2006-02-16T02:30:53', '2005-07-07T20:24:33', '2005-07-11T18:32:33', '1'), - ('569', '810', '2006-02-16T02:30:53', '2005-05-31T05:22:25', '2005-06-09T04:52:25', '1'), - ('569', '3668', '2006-02-16T02:30:53', '2005-07-30T20:14:50', '2005-08-03T17:30:50', '1'), - ('569', '1935', '2006-02-16T02:30:53', '2005-07-11T03:21:49', '2005-07-19T23:58:49', '1'), - ('569', '3393', '2006-02-16T02:30:53', '2005-08-02T13:44:30', '2005-08-03T12:00:30', '1'), - ('569', '2009', '2006-02-16T02:30:53', '2005-08-22T06:30:28', '2005-08-25T09:48:28', '1'), - ('569', '2877', '2006-02-16T02:30:53', '2005-08-18T05:48:53', '2005-08-22T09:03:53', '1'), - ('569', '3702', '2006-02-16T02:30:53', '2005-08-02T00:47:33', '2005-08-03T04:38:33', '1'), - ('569', '3660', '2006-02-16T02:30:53', '2005-05-28T16:13:22', '2005-06-06T20:35:22', '1'), - ('569', '2953', '2006-02-16T02:30:53', '2005-08-17T17:05:53', '2005-08-19T13:56:53', '1'), - ('569', '3435', '2006-02-16T02:30:53', '2005-05-28T19:22:52', '2005-06-01T00:10:52', '1'), - ('569', '1437', '2006-02-16T02:30:53', '2005-08-02T05:51:20', '2005-08-06T04:20:20', '1'), - ('569', '1513', '2006-02-16T02:30:53', '2005-07-07T11:24:18', '2005-07-15T12:42:18', '1'), - ('569', '3891', '2006-02-16T02:30:53', '2005-08-21T10:33:45', '2005-08-26T12:05:45', '1'), - ('569', '2311', '2006-02-16T02:30:53', '2005-08-18T00:33:45', '2005-08-22T19:33:45', '1'), - ('569', '4214', '2006-02-16T02:30:53', '2005-08-19T06:19:21', '2005-08-20T02:21:21', '1'), - ('466', '3265', '2006-02-16T02:30:53', '2005-08-23T21:00:22', '2005-09-02T02:35:22', '1'), - ('466', '4243', '2006-02-16T02:30:53', '2005-07-11T04:54:31', '2005-07-20T07:23:31', '1'), - ('466', '3182', '2006-02-16T02:30:53', '2005-08-20T15:30:51', '2005-08-26T13:34:51', '1'), - ('466', '564', '2006-02-16T02:30:53', '2005-08-02T17:12:30', '2005-08-09T12:08:30', '1'), - ('466', '2190', '2006-02-16T02:30:53', '2005-08-20T01:07:14', '2005-08-22T03:41:14', '1'), - ('466', '1271', '2006-02-16T02:30:53', '2005-07-09T03:46:33', '2005-07-15T01:14:33', '1'), - ('466', '1619', '2006-02-16T02:30:53', '2005-05-31T14:30:01', '2005-06-05T12:07:01', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['8276', '3343', '1808', '5691', '9257', '5114', '4819', '10185', '10889', '13773', '6744', '494', '2060', '4971', '9832', '6457', '14167', '7074', '9685', '2013', '15834', '15801', '10565', '5973', '12643', '11854', '10933', '10237', '1312', '6384', '2711', '669', '2617', '7294', '8381', '15340', '9836', '781', '5193', '10771', '3899', '9039', '11921', '8984', '6902', '4667', '5343', '10772', '1009', '9565', '1721', '7144', '12261', '12487', '5820', '1684', '9189', '9640', '2542', '13437', '7277', '13791', '11894', '331', '11295', '5952', '7307', '6105', '9826', '9223', '613', '9497', '7490', '3789', '15576', '12235', '15534', '2023', '527', '11687', '7187', '3493', '1087', '14435', '7597', '8558', '1763', '14777', '3527', '2552', '14493', '15462', '7029', '16011', '5626', '6104', '4443', '998', '8887', '10217']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('466', '2451', '2006-02-16T02:30:53', '2005-07-29T01:38:43', '2005-08-03T23:00:43', '1'), - ('466', '2038', '2006-02-16T02:30:53', '2005-06-21T10:56:59', '2005-06-25T16:41:59', '1'), - ('466', '2424', '2006-02-16T02:30:53', '2005-06-16T20:59:35', '2005-06-24T15:31:35', '1'), - ('466', '3526', '2006-02-16T02:30:53', '2005-07-10T09:29:49', '2005-07-16T13:37:49', '1'), - ('466', '2615', '2006-02-16T02:30:53', '2005-07-30T14:30:38', '2005-08-04T17:57:38', '1'), - ('64', '3734', '2006-02-16T02:30:53', '2005-07-09T07:07:05', '2005-07-15T03:06:05', '1'), - ('64', '1342', '2006-02-16T02:30:53', '2005-07-08T17:19:15', '2005-07-16T14:32:15', '1'), - ('64', '1266', '2006-02-16T02:30:53', '2005-08-01T00:12:11', '2005-08-03T03:03:11', '1'), - ('64', '2098', '2006-02-16T02:30:53', '2005-08-02T00:54:33', '2005-08-07T19:42:33', '1'), - ('64', '3389', '2006-02-16T02:30:53', '2005-08-20T11:50:14', '2005-08-26T12:35:14', '1'), - ('64', '2565', '2006-02-16T02:30:53', '2005-07-12T14:30:28', '2005-07-14T16:20:28', '1'), - ('64', '1850', '2006-02-16T02:30:53', '2005-05-28T00:39:31', '2005-06-02T19:35:31', '1'), - ('64', '1523', '2006-02-16T02:30:53', '2005-06-17T15:42:42', '2005-06-22T16:39:42', '1'), - ('64', '460', '2006-02-16T02:30:53', '2005-07-08T23:54:49', '2005-07-16T00:15:49', '1'), - ('64', '3126', '2006-02-16T02:30:53', '2005-07-31T12:01:49', '2005-08-08T09:21:49', '1'), - ('64', '2970', '2006-02-16T02:30:53', '2005-07-12T01:06:35', '2005-07-14T03:27:35', '1'), - ('64', '1005', '2006-02-16T02:30:53', '2005-08-21T02:59:48', '2005-08-29T22:17:48', '1'), - ('165', '1390', '2006-02-16T02:30:53', '2005-07-27T04:06:24', '2005-07-28T02:04:24', '1'), - ('165', '3097', '2006-02-16T02:30:53', '2005-07-31T06:49:18', '2005-08-04T03:19:18', '1'), - ('165', '3256', '2006-02-16T02:30:53', '2005-06-17T12:03:01', '2005-06-24T10:04:01', '1'), - ('165', '217', '2006-02-16T02:30:53', '2005-08-23T15:23:50', '2005-09-01T19:31:50', '1'), - ('165', '1590', '2006-02-16T02:30:53', '2005-08-23T14:26:04', '2005-08-28T15:04:04', '1'), - ('165', '347', '2006-02-16T02:30:53', '2005-08-01T13:08:27', '2005-08-02T10:30:27', '1'), - ('165', '1194', '2006-02-16T02:30:53', '2005-07-11T00:09:17', '2005-07-14T19:18:17', '1'), - ('165', '2245', '2006-02-16T02:30:53', '2005-08-18T18:21:06', '2005-08-24T14:26:06', '1'), - ('313', '137', '2006-02-16T02:30:53', '2005-08-17T13:42:52', '2005-08-26T14:04:52', '1'), - ('313', '3970', '2006-02-16T02:30:53', '2005-08-02T02:50:49', '2005-08-08T04:39:49', '1'), - ('313', '432', '2006-02-16T02:30:53', '2005-08-01T02:07:32', '2005-08-07T03:54:32', '1'), - ('313', '3608', '2006-02-16T02:30:53', '2005-06-15T10:16:27', '2005-06-20T06:53:27', '1'), - ('313', '491', '2006-02-16T02:30:53', '2005-07-11T22:07:26', '2005-07-16T22:39:26', '1'), - ('313', '3944', '2006-02-16T02:30:53', '2005-06-19T14:12:22', '2005-06-21T09:29:22', '1'), - ('313', '3677', '2006-02-16T02:30:53', '2005-05-28T22:03:25', '2005-06-03T03:39:25', '1'), - ('313', '204', '2006-02-16T02:30:53', '2005-06-19T07:48:31', '2005-06-27T11:56:31', '1'), - ('313', '487', '2006-02-16T02:30:53', '2005-07-27T12:38:14', '2005-07-30T13:01:14', '1'), - ('313', '865', '2006-02-16T02:30:53', '2005-07-29T05:31:44', '2005-07-31T09:20:44', '1'), - ('313', '3653', '2006-02-16T02:30:53', '2005-08-22T20:55:56', '2005-08-27T18:52:56', '1'), - ('313', '2870', '2006-02-16T02:30:53', '2005-07-31T12:12:00', '2005-08-09T06:53:00', '1'), - ('313', '88', '2006-02-16T02:30:53', '2005-05-29T14:23:58', '2005-05-30T17:44:58', '1'), - ('485', '2166', '2006-02-16T02:30:53', '2005-07-09T10:28:18', '2005-07-12T12:18:18', '1'), - ('485', '1274', '2006-02-16T02:30:53', '2005-08-01T20:49:35', '2005-08-10T16:58:35', '1'), - ('485', '4020', '2006-02-16T02:30:53', '2005-07-06T19:12:40', '2005-07-13T23:41:40', '1'), - ('485', '4493', '2006-02-16T02:30:53', '2005-07-30T06:24:28', '2005-08-08T00:28:28', '1'), - ('485', '494', '2006-02-16T02:30:53', '2005-08-17T16:12:27', '2005-08-25T22:07:27', '1'), - ('485', '2126', '2006-02-16T02:30:53', '2005-07-30T04:31:50', '2005-08-04T03:24:50', '1'), - ('485', '314', '2006-02-16T02:30:53', '2005-07-12T21:57:16', '2005-07-14T20:56:16', '1'), - ('485', '3348', '2006-02-16T02:30:53', '2005-07-08T10:06:26', '2005-07-14T04:48:26', '1'), - ('485', '92', '2006-02-16T02:30:53', '2005-07-09T17:23:43', '2005-07-18T22:14:43', '1'), - ('485', '132', '2006-02-16T02:30:53', '2005-08-01T20:51:10', '2005-08-10T15:50:10', '1'), - ('485', '2523', '2006-02-16T02:30:53', '2005-05-31T01:47:35', '2005-06-03T20:26:35', '1'), - ('485', '3621', '2006-02-16T02:30:53', '2005-07-31T02:32:00', '2005-08-04T05:45:00', '1'), - ('485', '3521', '2006-02-16T02:30:53', '2005-06-16T15:01:36', '2005-06-23T10:48:36', '1'), - ('485', '4506', '2006-02-16T02:30:53', '2005-07-27T07:00:37', '2005-08-01T06:57:37', '1'), - ('485', '4076', '2006-02-16T02:30:53', '2005-08-18T04:16:06', '2005-08-27T08:04:06', '1'), - ('485', '2554', '2006-02-16T02:30:53', '2005-08-18T12:45:24', '2005-08-22T12:39:24', '1'), - ('485', '1511', '2006-02-16T02:30:53', '2005-07-10T16:04:59', '2005-07-16T12:10:59', '1'), - ('485', '806', '2006-02-16T02:30:53', '2005-06-16T11:57:34', '2005-06-19T09:12:34', '1'), - ('485', '4529', '2006-02-16T02:30:53', '2005-07-30T12:20:59', '2005-08-06T16:15:59', '1'), - ('67', '1067', '2006-02-16T02:30:53', '2005-07-31T05:33:25', '2005-08-09T09:41:25', '1'), - ('67', '1446', '2006-02-16T02:30:53', '2005-06-19T02:08:39', '2005-06-26T20:25:39', '1'), - ('67', '2292', '2006-02-16T02:30:53', '2005-08-19T23:37:52', '2005-08-28T22:17:52', '1'), - ('67', '1544', '2006-02-16T02:30:53', '2005-07-27T11:48:37', '2005-08-03T07:20:37', '1'), - ('67', '1890', '2006-02-16T02:30:53', '2005-08-20T12:21:05', '2005-08-22T17:58:05', '1'), - ('67', '1223', '2006-02-16T02:30:53', '2005-08-17T15:15:01', '2005-08-26T13:49:01', '1'), - ('67', '1872', '2006-02-16T02:30:53', '2005-05-27T02:22:26', '2005-06-05T00:25:26', '1'), - ('67', '423', '2006-02-16T02:30:53', '2005-08-02T15:10:06', '2005-08-10T09:52:06', '1'), - ('595', '3406', '2006-02-16T02:30:53', '2005-07-10T23:18:20', '2005-07-16T17:42:20', '1'), - ('595', '3882', '2006-02-16T02:30:53', '2005-07-27T12:59:10', '2005-07-29T11:35:10', '1'), - ('595', '3501', '2006-02-16T02:30:53', '2005-07-11T07:03:19', '2005-07-19T06:46:19', '1'), - ('595', '2649', '2006-02-16T02:30:53', '2005-07-31T11:51:46', '2005-08-09T17:18:46', '1'), - ('595', '3231', '2006-02-16T02:30:53', '2005-07-30T13:23:20', '2005-08-04T11:24:20', '1'), - ('595', '270', '2006-02-16T02:30:53', '2005-05-28T15:27:22', '2005-06-02T20:01:22', '1'), - ('595', '933', '2006-02-16T02:30:53', '2005-07-30T23:56:54', '2005-08-04T19:52:54', '1'), - ('595', '4503', '2006-02-16T02:30:53', '2005-07-27T19:48:12', '2005-08-04T17:15:12', '1'), - ('595', '3560', '2006-02-16T02:30:53', '2005-07-06T14:02:26', '2005-07-14T18:13:26', '1'), - ('595', '3257', '2006-02-16T02:30:53', '2005-08-23T05:32:03', '2005-08-26T02:31:03', '1'), - ('595', '957', '2006-02-16T02:30:53', '2005-08-18T03:17:50', '2005-08-20T02:49:50', '1'), - ('169', '544', '2006-02-16T02:30:53', '2005-08-23T03:55:54', '2005-08-24T03:54:54', '1'), - ('169', '787', '2006-02-16T02:30:53', '2005-06-17T12:52:58', '2005-06-23T11:07:58', '1'), - ('169', '266', '2006-02-16T02:30:53', '2005-05-28T04:28:38', '2005-06-02T08:19:38', '1'), - ('169', '1977', '2006-02-16T02:30:53', '2005-08-17T06:39:59', '2005-08-23T04:53:59', '1'), - ('169', '2733', '2006-02-16T02:30:53', '2005-07-27T08:27:58', '2005-08-05T09:05:58', '1'), - ('169', '473', '2006-02-16T02:30:53', '2005-07-05T23:46:19', '2005-07-15T02:31:19', '1'), - ('169', '431', '2006-02-16T02:30:53', '2005-05-31T11:18:08', '2005-06-04T08:33:08', '1'), - ('169', '2919', '2006-02-16T02:30:53', '2005-08-21T11:44:37', '2005-08-24T08:04:37', '1'), - ('169', '2856', '2006-02-16T02:30:53', '2005-07-27T23:35:49', '2005-07-30T21:38:49', '1'), - ('169', '1160', '2006-02-16T02:30:53', '2005-07-29T11:24:49', '2005-07-31T15:03:49', '1'), - ('389', '1941', '2006-02-16T02:30:53', '2005-06-16T17:51:01', '2005-06-20T17:27:01', '1'), - ('389', '237', '2006-02-16T02:30:53', '2005-08-21T23:55:50', '2005-08-28T04:31:50', '1'), - ('389', '4537', '2006-02-16T02:30:53', '2005-07-06T01:11:08', '2005-07-08T01:21:08', '1'), - ('389', '664', '2006-02-16T02:30:53', '2005-06-19T03:01:29', '2005-06-28T04:13:29', '1'), - ('389', '2590', '2006-02-16T02:30:53', '2005-08-21T14:01:44', '2005-08-28T17:20:44', '1'), - ('389', '3267', '2006-02-16T02:30:53', '2005-08-23T01:14:01', '2005-08-29T19:52:01', '1'), - ('389', '2862', '2006-02-16T02:30:53', '2005-07-27T02:57:43', '2005-07-30T08:24:43', '1'), - ('389', '1093', '2006-02-16T02:30:53', '2005-08-23T21:11:33', '2005-08-31T17:51:33', '1'), - ('389', '3029', '2006-02-16T02:30:53', '2005-07-10T05:49:35', '2005-07-15T08:05:35', '1'), - ('389', '3531', '2006-02-16T02:30:53', '2005-07-11T07:01:35', '2005-07-17T02:29:35', '1'), - ('389', '72', '2006-02-16T02:30:53', '2005-07-07T23:05:53', '2005-07-16T01:46:53', '1'), - ('389', '3395', '2006-02-16T02:30:53', '2005-05-31T00:16:57', '2005-06-01T22:41:57', '1'), - ('389', '4119', '2006-02-16T02:30:53', '2005-07-30T00:36:54', '2005-08-04T19:07:54', '1'), - ('389', '1193', '2006-02-16T02:30:53', '2005-08-01T01:07:27', '2005-08-09T00:42:27', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['14599', '15725', '11522', '9679', '5065', '14233', '3398', '3429', '2272', '15719', '14719', '14302', '9095', '12110', '5601', '1281', '10429', '2966', '56', '10231', '15172', '3852', '3366', '5164', '14213', '4482', '1883', '15883', '3272', '7030', '11320', '3154', '9748', '12077', '7838', '8838', '1233', '14071', '9616', '7440', '9141', '5977', '727', '1351', '5708', '668', '9769', '7548', '6296', '13956', '6863', '11871', '16026', '13160', '5389', '5629', '6910', '3738', '9626', '14929', '9087', '11352', '2361', '14797', '14926', '6367', '15869', '5896', '8041', '7366', '824', '6839', '8124', '7353', '6288', '3865', '1788', '10503', '10502', '1246', '4180', '7911', '7703', '9443', '13403', '9595', '7724', '1546', '830', '9226', '10597', '15038', '2767', '11852', '11009', '1644', '6197', '10692', '15405', '12560']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('599', '4575', '2006-02-16T02:30:53', '2005-08-21T17:43:42', '2005-08-22T18:53:42', '1'), - ('599', '378', '2006-02-16T02:30:53', '2005-08-23T11:25:00', '2005-08-26T11:46:00', '1'), - ('599', '2033', '2006-02-16T02:30:53', '2005-08-17T00:05:05', '2005-08-24T04:56:05', '1'), - ('599', '3819', '2006-02-16T02:30:53', '2005-07-31T06:41:19', '2005-08-02T07:23:19', '1'), - ('599', '1788', '2006-02-16T02:30:53', '2005-07-09T04:42:00', '2005-07-12T08:55:00', '1'), - ('599', '2943', '2006-02-16T02:30:53', '2005-08-21T05:07:08', '2005-08-28T03:20:08', '1'), - ('599', '221', '2006-02-16T02:30:53', '2005-06-21T15:34:38', '2005-06-29T11:23:38', '1'), - ('599', '456', '2006-02-16T02:30:53', '2005-06-21T18:46:05', '2005-06-30T17:28:05', '1'), - ('599', '1364', '2006-02-16T02:30:53', '2005-06-18T06:29:53', '2005-06-23T10:58:53', '1'), - ('599', '3990', '2006-02-16T02:30:53', '2005-08-23T11:08:46', '2005-08-25T07:25:46', '1'), - ('599', '4091', '2006-02-16T02:30:53', '2005-08-21T21:41:57', '2005-08-25T20:37:57', '1'), - ('511', '1287', '2006-02-16T02:30:53', '2005-08-21T07:19:57', '2005-08-28T02:59:57', '1'), - ('511', '3019', '2006-02-16T02:30:53', '2005-07-30T08:38:36', '2005-07-31T06:14:36', '1'), - ('511', '2984', '2006-02-16T02:30:53', '2005-08-17T22:59:46', '2005-08-23T17:51:46', '1'), - ('511', '3062', '2006-02-16T02:30:53', '2005-07-10T04:56:55', '2005-07-11T00:14:55', '1'), - ('511', '2963', '2006-02-16T02:30:53', '2005-06-15T08:21:39', '2005-06-17T11:03:39', '1'), - ('511', '3894', '2006-02-16T02:30:53', '2005-08-01T08:34:18', '2005-08-10T12:38:18', '1'), - ('511', '3483', '2006-02-16T02:30:53', '2005-06-20T07:39:33', '2005-06-29T07:48:33', '1'), - ('511', '1352', '2006-02-16T02:30:53', '2005-05-25T08:28:11', '2005-05-26T14:21:11', '1'), - ('511', '1056', '2006-02-16T02:30:53', '2005-08-01T01:50:49', '2005-08-06T03:12:49', '1'), - ('511', '2367', '2006-02-16T02:30:53', '2005-08-22T15:25:33', '2005-08-23T17:29:33', '1'), - ('511', '3329', '2006-02-16T02:30:53', '2005-07-06T16:57:49', '2005-07-11T17:11:49', '1'), - ('511', '2584', '2006-02-16T02:30:53', '2005-06-21T13:03:37', '2005-06-26T16:29:37', '1'), - ('511', '1170', '2006-02-16T02:30:53', '2005-07-09T09:03:14', '2005-07-14T04:20:14', '1'), - ('511', '382', '2006-02-16T02:30:53', '2005-08-21T04:30:47', '2005-08-24T23:01:47', '1'), - ('511', '3500', '2006-02-16T02:30:53', '2005-07-08T01:01:18', '2005-07-11T01:18:18', '1'), - ('550', '3504', '2006-02-16T02:30:53', '2005-06-17T03:18:51', '2005-06-18T05:46:51', '1'), - ('550', '2792', '2006-02-16T02:30:53', '2005-08-23T16:44:56', '2005-08-24T22:42:56', '1'), - ('550', '1090', '2006-02-16T02:30:53', '2005-06-21T05:18:27', '2005-06-30T02:51:27', '1'), - ('550', '1277', '2006-02-16T02:30:53', '2005-07-27T03:01:40', '2005-07-31T07:01:40', '1'), - ('550', '3362', '2006-02-16T02:30:53', '2005-08-02T16:13:28', '2005-08-05T21:23:28', '1'), - ('550', '3195', '2006-02-16T02:30:53', '2005-06-20T20:44:40', '2005-06-23T19:10:40', '1'), - ('550', '3308', '2006-02-16T02:30:53', '2005-07-31T09:17:56', '2005-08-02T14:54:56', '1'), - ('550', '3589', '2006-02-16T02:30:53', '2005-08-17T21:59:14', '2005-08-22T03:23:14', '1'), - ('550', '2222', '2006-02-16T02:30:53', '2005-07-28T09:00:21', '2005-07-29T05:52:21', '1'), - ('550', '133', '2006-02-16T02:30:53', '2005-07-29T22:52:23', '2005-08-03T22:49:23', '1'), - ('550', '4214', '2006-02-16T02:30:53', '2005-06-15T04:18:37', '2005-06-22T03:36:37', '1'), - ('550', '2471', '2006-02-16T02:30:53', '2005-08-20T23:01:56', '2005-08-22T02:14:56', '1'), - ('550', '1210', '2006-02-16T02:30:53', '2005-07-31T04:05:01', '2005-08-05T00:10:01', '1'), - ('484', '1476', '2006-02-16T02:30:53', '2005-07-27T17:43:27', '2005-08-03T22:12:27', '1'), - ('484', '3087', '2006-02-16T02:30:53', '2005-07-30T10:16:04', '2005-08-05T08:01:04', '1'), - ('484', '4011', '2006-02-16T02:30:53', '2005-07-11T00:16:38', '2005-07-19T21:00:38', '1'), - ('484', '1629', '2006-02-16T02:30:53', '2005-05-29T06:08:15', '2005-05-30T07:16:15', '1'), - ('484', '2364', '2006-02-16T02:30:53', '2005-06-15T12:51:03', '2005-06-22T07:23:03', '1'), - ('484', '571', '2006-02-16T02:30:53', '2005-07-10T10:29:19', '2005-07-18T06:50:19', '1'), - ('484', '3528', '2006-02-16T02:30:53', '2005-05-28T21:54:45', '2005-05-29T22:32:45', '1'), - ('484', '2958', '2006-02-16T02:30:53', '2005-07-31T09:52:16', '2005-08-06T09:26:16', '1'), - ('484', '2194', '2006-02-16T02:30:53', '2005-07-27T21:53:18', '2005-08-02T17:50:18', '1'), - ('484', '4202', '2006-02-16T02:30:53', '2005-07-11T17:34:04', '2005-07-17T21:12:04', '1'), - ('484', '3757', '2006-02-16T02:30:53', '2005-08-20T18:08:19', '2005-08-29T17:03:19', '1'), - ('484', '229', '2006-02-16T02:30:53', '2005-07-12T19:58:34', '2005-07-21T16:57:34', '1'), - ('484', '3013', '2006-02-16T02:30:53', '2005-08-17T14:11:44', '2005-08-18T17:50:44', '1'), - ('484', '467', '2006-02-16T02:30:53', '2005-08-23T21:49:22', '2005-08-27T00:47:22', '1'), - ('484', '410', '2006-02-16T02:30:53', '2005-08-19T13:21:04', '2005-08-22T18:49:04', '1'), - ('484', '3882', '2006-02-16T02:30:53', '2005-07-09T19:25:45', '2005-07-17T13:31:45', '1'), - ('546', '400', '2006-02-16T02:30:53', '2005-07-10T06:02:25', '2005-07-16T07:33:25', '1'), - ('546', '1290', '2006-02-16T02:30:53', '2005-07-12T22:11:21', '2005-07-21T02:35:21', '1'), - ('546', '578', '2006-02-16T02:30:53', '2005-07-06T11:50:57', '2005-07-09T08:07:57', '1'), - ('546', '2216', '2006-02-16T02:30:53', '2005-07-31T04:37:41', '2005-08-08T04:00:41', '1'), - ('546', '4195', '2006-02-16T02:30:53', '2005-08-22T05:32:38', '2005-08-28T00:02:38', '1'), - ('546', '4048', '2006-02-16T02:30:53', '2005-07-30T08:19:47', '2005-08-02T07:15:47', '1'), - ('546', '2760', '2006-02-16T02:30:53', '2005-08-02T17:29:39', '2005-08-10T15:31:39', '1'), - ('546', '3547', '2006-02-16T02:30:53', '2005-06-18T13:19:05', '2005-06-23T07:59:05', '1'), - ('546', '1131', '2006-02-16T02:30:53', '2005-08-22T00:41:24', '2005-08-23T18:51:24', '1'), - ('357', '2448', '2006-02-16T02:30:53', '2005-08-22T05:18:44', '2005-08-26T02:18:44', '1'), - ('357', '1465', '2006-02-16T02:30:53', '2005-07-11T21:18:29', '2005-07-15T01:05:29', '1'), - ('357', '1344', '2006-02-16T02:30:53', '2005-08-23T16:22:20', '2005-08-27T11:52:20', '1'), - ('357', '731', '2006-02-16T02:30:53', '2005-07-10T20:15:56', '2005-07-12T00:39:56', '1'), - ('357', '763', '2006-02-16T02:30:53', '2005-07-28T16:39:56', '2005-07-30T18:44:56', '1'), - ('357', '461', '2006-02-16T02:30:53', '2005-07-27T15:01:17', '2005-08-04T20:28:17', '1'), - ('357', '3518', '2006-02-16T02:30:53', '2005-05-29T21:45:32', '2005-05-31T19:01:32', '1'), - ('357', '3900', '2006-02-16T02:30:53', '2005-07-12T19:03:19', '2005-07-15T23:48:19', '1'), - ('357', '1187', '2006-02-16T02:30:53', '2005-07-28T19:28:58', '2005-07-31T00:45:58', '1'), - ('357', '1308', '2006-02-16T02:30:53', '2005-07-27T14:38:39', '2005-07-31T19:50:39', '1'), - ('357', '3235', '2006-02-16T02:30:53', '2005-07-11T17:01:52', '2005-07-19T15:11:52', '1'), - ('357', '3579', '2006-02-16T02:30:53', '2005-07-06T17:46:57', '2005-07-12T12:20:57', '1'), - ('357', '3794', '2006-02-16T02:30:53', '2005-06-16T19:47:18', '2005-06-22T23:10:18', '1'), - ('357', '1823', '2006-02-16T02:30:53', '2005-08-01T11:07:44', '2005-08-08T08:22:44', '1'), - ('357', '3193', '2006-02-16T02:30:53', '2005-08-01T11:06:39', '2005-08-05T07:11:39', '1'), - ('357', '431', '2006-02-16T02:30:53', '2005-06-15T05:11:19', '2005-06-21T02:21:19', '1'), - ('3', '1704', '2006-02-16T02:30:53', '2005-07-07T10:23:25', '2005-07-10T13:18:25', '1'), - ('3', '390', '2006-02-16T02:30:53', '2005-07-28T11:46:45', '2005-07-29T07:19:45', '1'), - ('3', '2150', '2006-02-16T02:30:53', '2005-07-28T03:59:21', '2005-08-05T08:52:21', '1'), - ('3', '1675', '2006-02-16T02:30:53', '2005-07-30T21:45:46', '2005-08-05T21:22:46', '1'), - ('3', '3241', '2006-02-16T02:30:53', '2005-08-19T22:18:07', '2005-08-27T19:23:07', '1'), - ('3', '2829', '2006-02-16T02:30:53', '2005-07-31T03:27:58', '2005-08-03T05:58:58', '1'), - ('3', '346', '2006-02-16T02:30:53', '2005-07-28T04:46:30', '2005-08-04T08:41:30', '1'), - ('3', '3913', '2006-02-16T02:30:53', '2005-06-16T01:34:05', '2005-06-24T04:27:05', '1'), - ('3', '3464', '2006-02-16T02:30:53', '2005-05-29T22:43:55', '2005-06-01T17:43:55', '1'), - ('3', '4315', '2006-02-16T02:30:53', '2005-07-30T13:31:20', '2005-08-06T16:42:20', '1'), - ('3', '3292', '2006-02-16T02:30:53', '2005-08-01T14:19:48', '2005-08-08T20:01:48', '1'), - ('3', '1685', '2006-02-16T02:30:53', '2005-08-22T09:37:27', '2005-08-23T14:39:27', '1'), - ('596', '4052', '2006-02-16T02:30:53', '2005-06-19T17:46:35', '2005-06-24T22:42:35', '1'), - ('596', '2358', '2006-02-16T02:30:53', '2005-08-17T13:38:27', '2005-08-24T08:50:27', '1'), - ('596', '2574', '2006-02-16T02:30:53', '2005-08-02T05:06:23', '2005-08-08T03:02:23', '1'), - ('596', '749', '2006-02-16T02:30:53', '2005-06-16T08:58:18', '2005-06-21T06:47:18', '1'), - ('596', '4156', '2006-02-16T02:30:53', '2005-07-11T12:09:51', '2005-07-12T06:15:51', '1'), - ('596', '371', '2006-02-16T02:30:53', '2005-08-01T18:12:35', '2005-08-07T13:06:35', '1'), - ('596', '3263', '2006-02-16T02:30:53', '2005-08-22T23:20:41', '2005-08-25T23:53:41', '1'), - ('596', '829', '2006-02-16T02:30:53', '2005-08-18T14:54:19', '2005-08-27T13:39:19', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['667', '625', '14417', '15423', '12878', '6017', '11713', '2775', '14830', '7665', '9884', '7010', '4685', '8195', '8801', '5165', '2964', '8752', '14086', '986', '566', '10404', '12572', '13126', '7887', '14283', '1606', '3658', '1378', '2081', '14655', '10765', '374', '839', '12369', '13305', '7410', '4093', '8516', '6305', '8919', '11847', '5112', '10628', '5683', '12449', '6644', '1302', '6010', '8466', '6333', '7211', '1161', '4007', '15489', '1488', '14760', '6669', '5210', '3730', '11471', '7477', '3567', '6262', '13821', '1612', '1110', '15531', '7108', '6437', '6127', '5188', '13949', '3150', '7532', '14686', '5643', '3911', '14701', '2257', '10523', '12651', '5918', '7124', '1900', '10615', '13026', '4736', '3641', '10676', '3178', '9845', '3748', '11641', '5205', '9989', '4530', '8849', '9814', '15331']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('596', '797', '2006-02-16T02:30:53', '2005-05-28T21:49:02', '2005-05-31T03:07:02', '1'), - ('596', '2889', '2006-02-16T02:30:53', '2005-05-28T16:35:46', '2005-06-01T14:19:46', '1'), - ('596', '1768', '2006-02-16T02:30:53', '2005-08-21T11:13:35', '2005-08-25T11:27:35', '1'), - ('596', '1786', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('596', '1182', '2006-02-16T02:30:53', '2005-08-19T03:17:08', '2005-08-23T03:44:08', '1'), - ('596', '4088', '2006-02-16T02:30:53', '2005-07-11T02:05:32', '2005-07-14T22:50:32', '1'), - ('590', '1919', '2006-02-16T02:30:53', '2005-08-17T07:34:05', '2005-08-25T07:49:05', '1'), - ('590', '672', '2006-02-16T02:30:53', '2005-06-19T18:14:20', '2005-06-26T19:52:20', '1'), - ('590', '637', '2006-02-16T02:30:53', '2005-08-22T01:37:19', '2005-08-27T20:10:19', '1'), - ('590', '1455', '2006-02-16T02:30:53', '2005-07-28T02:28:30', '2005-07-31T20:42:30', '1'), - ('590', '511', '2006-02-16T02:30:53', '2005-07-31T13:56:24', '2005-08-01T16:59:24', '1'), - ('590', '3016', '2006-02-16T02:30:53', '2005-07-27T01:56:01', '2005-07-30T04:40:01', '1'), - ('590', '602', '2006-02-16T02:30:53', '2005-07-08T10:45:13', '2005-07-12T08:29:13', '1'), - ('590', '3989', '2006-02-16T02:30:53', '2005-07-28T22:52:58', '2005-08-04T02:12:58', '1'), - ('590', '1111', '2006-02-16T02:30:53', '2005-07-29T21:25:22', '2005-08-01T00:02:22', '1'), - ('590', '280', '2006-02-16T02:30:53', '2005-07-09T09:08:53', '2005-07-14T06:01:53', '1'), - ('590', '1201', '2006-02-16T02:30:53', '2005-06-20T07:33:29', '2005-06-29T12:48:29', '1'), - ('253', '4202', '2006-02-16T02:30:53', '2005-07-29T19:15:07', '2005-07-31T13:27:07', '1'), - ('253', '3244', '2006-02-16T02:30:53', '2005-08-20T23:47:54', '2005-08-27T22:49:54', '1'), - ('253', '4045', '2006-02-16T02:30:53', '2005-05-30T22:22:52', '2005-06-01T02:24:52', '1'), - ('253', '4330', '2006-02-16T02:30:53', '2005-05-28T09:51:39', '2005-06-05T09:35:39', '1'), - ('253', '2580', '2006-02-16T02:30:53', '2005-08-01T07:31:25', '2005-08-07T09:23:25', '1'), - ('253', '1366', '2006-02-16T02:30:53', '2005-08-18T15:32:54', '2005-08-21T10:30:54', '1'), - ('253', '1392', '2006-02-16T02:30:53', '2005-08-19T12:00:28', '2005-08-28T17:27:28', '1'), - ('253', '2820', '2006-02-16T02:30:53', '2005-07-28T10:40:12', '2005-08-02T06:09:12', '1'), - ('253', '3052', '2006-02-16T02:30:53', '2005-08-21T06:44:14', '2005-08-24T01:01:14', '1'), - ('253', '4290', '2006-02-16T02:30:53', '2005-06-16T06:18:31', '2005-06-25T09:15:31', '1'), - ('253', '3453', '2006-02-16T02:30:53', '2005-07-06T08:01:08', '2005-07-15T06:36:08', '1'), - ('253', '4372', '2006-02-16T02:30:53', '2005-06-15T15:03:15', '2005-06-19T16:50:15', '1'), - ('253', '917', '2006-02-16T02:30:53', '2005-06-17T17:05:02', '2005-06-26T20:26:02', '1'), - ('253', '785', '2006-02-16T02:30:53', '2005-08-21T19:37:10', '2005-08-22T15:43:10', '1'), - ('337', '566', '2006-02-16T02:30:53', '2005-08-01T20:34:51', '2005-08-04T00:02:51', '1'), - ('337', '4420', '2006-02-16T02:30:53', '2005-05-27T08:26:30', '2005-06-05T07:13:30', '1'), - ('337', '1886', '2006-02-16T02:30:53', '2005-05-30T00:28:12', '2005-06-08T02:43:12', '1'), - ('337', '484', '2006-02-16T02:30:53', '2005-08-18T07:57:43', '2005-08-26T09:36:43', '1'), - ('337', '2386', '2006-02-16T02:30:53', '2005-08-19T18:57:05', '2005-08-28T22:28:05', '1'), - ('337', '1559', '2006-02-16T02:30:53', '2005-07-27T16:41:59', '2005-07-29T22:11:59', '1'), - ('337', '1534', '2006-02-16T02:30:53', '2005-07-07T05:54:50', '2005-07-12T00:34:50', '1'), - ('337', '981', '2006-02-16T02:30:53', '2005-07-29T10:00:03', '2005-08-02T09:34:03', '1'), - ('337', '1544', '2006-02-16T02:30:53', '2005-07-11T18:02:25', '2005-07-20T13:29:25', '1'), - ('337', '4006', '2006-02-16T02:30:53', '2005-07-30T01:57:03', '2005-08-08T05:14:03', '1'), - ('337', '1784', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('285', '3529', '2006-02-16T02:30:53', '2005-07-09T07:04:04', '2005-07-13T08:42:04', '1'), - ('285', '427', '2006-02-16T02:30:53', '2005-08-01T15:33:19', '2005-08-05T17:27:19', '1'), - ('285', '4433', '2006-02-16T02:30:53', '2005-07-10T08:52:13', '2005-07-19T10:25:13', '1'), - ('285', '663', '2006-02-16T02:30:53', '2005-08-18T11:03:04', '2005-08-19T07:34:04', '1'), - ('285', '2667', '2006-02-16T02:30:53', '2005-07-12T10:39:39', '2005-07-14T11:50:39', '1'), - ('285', '324', '2006-02-16T02:30:53', '2005-06-15T09:48:37', '2005-06-22T06:18:37', '1'), - ('285', '771', '2006-02-16T02:30:53', '2005-07-11T01:52:28', '2005-07-13T03:13:28', '1'), - ('285', '4010', '2006-02-16T02:30:53', '2005-07-29T08:24:47', '2005-07-31T03:43:47', '1'), - ('285', '2610', '2006-02-16T02:30:53', '2005-07-11T19:20:16', '2005-07-17T15:33:16', '1'), - ('285', '4445', '2006-02-16T02:30:53', '2005-07-27T09:20:00', '2005-08-02T14:53:00', '1'), - ('285', '1690', '2006-02-16T02:30:53', '2005-06-14T23:07:08', '2005-06-21T17:12:08', '1'), - ('285', '2071', '2006-02-16T02:30:53', '2005-07-07T00:26:05', '2005-07-15T19:53:05', '1'), - ('285', '764', '2006-02-16T02:30:53', '2005-08-23T02:06:41', '2005-08-25T06:50:41', '1'), - ('355', '1081', '2006-02-16T02:30:53', '2005-06-15T21:39:54', '2005-06-16T20:33:54', '1'), - ('355', '1367', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('355', '1420', '2006-02-16T02:30:53', '2005-07-12T11:39:55', '2005-07-20T05:56:55', '1'), - ('355', '4514', '2006-02-16T02:30:53', '2005-07-09T11:24:19', '2005-07-11T06:27:19', '1'), - ('355', '1665', '2006-02-16T02:30:53', '2005-07-06T11:31:24', '2005-07-15T06:53:24', '1'), - ('355', '3378', '2006-02-16T02:30:53', '2005-08-02T21:49:03', '2005-08-08T00:17:03', '1'), - ('355', '2692', '2006-02-16T02:30:53', '2005-07-27T19:11:03', '2005-08-02T19:25:03', '1'), - ('355', '27', '2006-02-16T02:30:53', '2005-07-06T03:09:36', '2005-07-12T02:15:36', '1'), - ('355', '4136', '2006-02-16T02:30:53', '2005-07-11T15:33:24', '2005-07-17T12:40:24', '1'), - ('355', '2402', '2006-02-16T02:30:53', '2005-08-20T13:33:47', '2005-08-25T18:09:47', '1'), - ('355', '3025', '2006-02-16T02:30:53', '2005-06-16T06:52:05', '2005-06-19T01:51:05', '1'), - ('355', '2085', '2006-02-16T02:30:53', '2005-05-31T15:22:51', '2005-06-07T14:32:51', '1'), - ('355', '2410', '2006-02-16T02:30:53', '2005-08-23T03:52:36', '2005-08-25T23:21:36', '1'), - ('355', '2720', '2006-02-16T02:30:53', '2005-07-27T05:28:32', '2005-07-31T07:52:32', '1'), - ('355', '4539', '2006-02-16T02:30:53', '2005-07-12T00:20:29', '2005-07-12T22:26:29', '1'), - ('355', '285', '2006-02-16T02:30:53', '2005-07-11T08:06:59', '2005-07-12T09:01:59', '1'), - ('34', '3265', '2006-02-16T02:30:53', '2005-07-09T10:22:31', '2005-07-13T04:41:31', '1'), - ('34', '1518', '2006-02-16T02:30:53', '2005-08-20T17:55:13', '2005-08-22T20:49:13', '1'), - ('34', '94', '2006-02-16T02:30:53', '2005-06-20T20:35:28', '2005-06-26T01:01:28', '1'), - ('34', '677', '2006-02-16T02:30:53', '2005-07-27T21:20:52', '2005-07-30T21:38:52', '1'), - ('34', '814', '2006-02-16T02:30:53', '2005-08-21T20:32:08', '2005-08-26T18:07:08', '1'), - ('34', '796', '2006-02-16T02:30:53', '2005-07-10T06:49:00', '2005-07-14T01:53:00', '1'), - ('34', '4548', '2006-02-16T02:30:53', '2005-07-06T20:09:11', '2005-07-08T23:53:11', '1'), - ('34', '3034', '2006-02-16T02:30:53', '2005-08-21T20:54:32', '2005-08-30T16:46:32', '1'), - ('34', '2846', '2006-02-16T02:30:53', '2005-06-18T05:29:52', '2005-06-22T00:19:52', '1'), - ('34', '2408', '2006-02-16T02:30:53', '2005-08-01T11:52:32', '2005-08-02T10:47:32', '1'), - ('34', '8', '2006-02-16T02:30:53', '2005-08-18T18:36:16', '2005-08-22T22:01:16', '1'), - ('34', '120', '2006-02-16T02:30:53', '2005-07-10T21:32:06', '2005-07-19T21:35:06', '1'), - ('34', '3449', '2006-02-16T02:30:53', '2005-07-27T06:09:30', '2005-08-02T09:31:30', '1'), - ('34', '1425', '2006-02-16T02:30:53', '2005-06-17T04:29:58', '2005-06-21T05:58:58', '1'), - ('34', '2639', '2006-02-16T02:30:53', '2005-08-01T14:58:14', '2005-08-02T13:38:14', '1'), - ('79', '3026', '2006-02-16T02:30:53', '2005-08-19T08:22:45', '2005-08-21T09:31:45', '1'), - ('79', '3009', '2006-02-16T02:30:53', '2005-07-08T13:22:55', '2005-07-17T07:27:55', '1'), - ('79', '3834', '2006-02-16T02:30:53', '2005-07-06T07:17:09', '2005-07-11T07:25:09', '1'), - ('79', '629', '2006-02-16T02:30:53', '2005-08-01T17:14:15', '2005-08-04T12:34:15', '1'), - ('79', '3517', '2006-02-16T02:30:53', '2005-06-20T22:35:12', '2005-06-23T19:39:12', '1'), - ('79', '2417', '2006-02-16T02:30:53', '2005-07-31T12:28:05', '2005-08-06T06:47:05', '1'), - ('79', '2920', '2006-02-16T02:30:53', '2005-07-06T12:11:22', '2005-07-12T07:22:22', '1'), - ('79', '2717', '2006-02-16T02:30:53', '2005-08-17T04:45:39', '2005-08-20T10:38:39', '1'), - ('79', '161', '2006-02-16T02:30:53', '2005-07-09T10:56:37', '2005-07-13T05:45:37', '1'), - ('79', '1713', '2006-02-16T02:30:53', '2005-07-31T17:22:39', '2005-08-01T18:55:39', '1'), - ('79', '3775', '2006-02-16T02:30:53', '2005-07-08T03:27:05', '2005-07-11T07:44:05', '1'), - ('79', '4300', '2006-02-16T02:30:53', '2005-07-29T23:21:01', '2005-08-03T20:01:01', '1'), - ('79', '136', '2006-02-16T02:30:53', '2005-07-31T11:29:46', '2005-08-08T15:49:46', '1'), - ('147', '146', '2006-02-16T02:30:53', '2005-08-22T20:37:57', '2005-08-25T21:56:57', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['3919', '362', '6753', '10706', '2456', '6343', '12757', '5844', '509', '8893', '2859', '14021', '13062', '8346', '11559', '10636', '917', '5783', '6933', '7776', '12686', '9570', '8518', '3953', '15120', '13572', '11166', '8950', '8014', '987', '11502', '8715', '1470', '3192', '4608', '10812', '13790', '9974', '12370', '4570', '15692', '15077', '15056', '2225', '11075', '6166', '13332', '5465', '2108', '2655', '7453', '3324', '14985', '12615', '4262', '10543', '13777', '5857', '12508', '13832', '13436', '8673', '12488', '4313', '2923', '2735', '2673', '2972', '6876', '10920', '7444', '5587', '3921', '15360', '7753', '8359', '10941', '681', '12923', '3765', '11170', '8828', '14884', '7859', '14510', '13307', '306', '6605', '11361', '2022', '3679', '10980', '443', '10903', '9928', '3140', '1964', '5185', '3591', '13789']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('147', '2695', '2006-02-16T02:30:53', '2005-07-06T20:26:21', '2005-07-15T00:13:21', '1'), - ('147', '2324', '2006-02-16T02:30:53', '2005-05-27T07:10:25', '2005-06-01T08:34:25', '1'), - ('147', '2591', '2006-02-16T02:30:53', '2005-07-12T14:55:42', '2005-07-18T19:16:42', '1'), - ('147', '1183', '2006-02-16T02:30:53', '2005-08-01T18:41:28', '2005-08-10T14:30:28', '1'), - ('147', '553', '2006-02-16T02:30:53', '2005-06-18T19:36:50', '2005-06-23T22:48:50', '1'), - ('147', '513', '2006-02-16T02:30:53', '2005-07-11T19:51:35', '2005-07-12T19:13:35', '1'), - ('147', '1095', '2006-02-16T02:30:53', '2005-08-18T22:57:45', '2005-08-21T22:43:45', '1'), - ('147', '609', '2006-02-16T02:30:53', '2005-07-10T17:14:43', '2005-07-12T19:27:43', '1'), - ('147', '3416', '2006-02-16T02:30:53', '2005-05-28T02:51:12', '2005-05-31T06:27:12', '1'), - ('147', '1048', '2006-02-16T02:30:53', '2005-07-30T00:48:19', '2005-08-01T03:25:19', '1'), - ('147', '126', '2006-02-16T02:30:53', '2005-06-19T23:18:42', '2005-06-20T22:38:42', '1'), - ('147', '4394', '2006-02-16T02:30:53', '2005-08-20T21:02:12', '2005-08-27T22:15:12', '1'), - ('385', '1790', '2006-02-16T02:30:53', '2005-08-19T09:44:17', '2005-08-27T11:42:17', '1'), - ('385', '2475', '2006-02-16T02:30:53', '2005-07-29T04:48:22', '2005-08-01T04:22:22', '1'), - ('385', '1812', '2006-02-16T02:30:53', '2005-08-17T01:20:26', '2005-08-24T03:11:26', '1'), - ('385', '621', '2006-02-16T02:30:53', '2005-08-01T15:40:35', '2005-08-05T18:46:35', '1'), - ('385', '3629', '2006-02-16T02:30:53', '2005-05-30T11:27:06', '2005-06-02T08:31:06', '1'), - ('385', '3331', '2006-02-16T02:30:53', '2005-07-10T13:55:33', '2005-07-16T12:13:33', '1'), - ('385', '1334', '2006-02-16T02:30:53', '2005-07-26T23:09:23', '2005-07-31T20:50:23', '1'), - ('385', '4170', '2006-02-16T02:30:53', '2005-07-28T07:04:36', '2005-08-01T09:32:36', '1'), - ('385', '501', '2006-02-16T02:30:53', '2005-08-18T19:55:09', '2005-08-26T14:17:09', '1'), - ('385', '591', '2006-02-16T02:30:53', '2005-07-31T02:40:37', '2005-08-01T01:59:37', '1'), - ('385', '2311', '2006-02-16T02:30:53', '2005-07-29T10:05:27', '2005-08-02T05:39:27', '1'), - ('385', '3879', '2006-02-16T02:30:53', '2005-07-06T21:54:55', '2005-07-09T18:52:55', '1'), - ('11', '3083', '2006-02-16T02:30:53', '2005-08-22T12:42:47', '2005-08-23T14:21:47', '1'), - ('11', '660', '2006-02-16T02:30:53', '2005-08-20T05:07:27', '2005-08-23T23:33:27', '1'), - ('11', '638', '2006-02-16T02:30:53', '2005-08-02T10:14:58', '2005-08-11T11:43:58', '1'), - ('11', '3015', '2006-02-16T02:30:53', '2005-07-30T03:17:13', '2005-08-07T00:20:13', '1'), - ('11', '2339', '2006-02-16T02:30:53', '2005-07-28T15:32:07', '2005-07-31T20:52:07', '1'), - ('11', '390', '2006-02-16T02:30:53', '2005-05-30T22:59:12', '2005-06-07T20:56:12', '1'), - ('11', '4470', '2006-02-16T02:30:53', '2005-08-16T23:06:30', '2005-08-19T03:49:30', '1'), - ('11', '860', '2006-02-16T02:30:53', '2005-07-29T17:33:45', '2005-08-01T17:30:45', '1'), - ('11', '4044', '2006-02-16T02:30:53', '2005-06-15T20:53:07', '2005-06-25T02:12:07', '1'), - ('11', '3713', '2006-02-16T02:30:53', '2005-06-20T23:49:12', '2005-06-24T03:00:12', '1'), - ('11', '758', '2006-02-16T02:30:53', '2005-07-08T07:19:11', '2005-07-11T01:37:11', '1'), - ('11', '3762', '2006-02-16T02:30:53', '2005-08-01T22:41:16', '2005-08-07T00:50:16', '1'), - ('11', '1385', '2006-02-16T02:30:53', '2005-08-20T12:17:27', '2005-08-25T12:20:27', '1'), - ('503', '430', '2006-02-16T02:30:53', '2005-07-31T16:51:11', '2005-08-05T16:04:11', '1'), - ('503', '3343', '2006-02-16T02:30:53', '2005-08-18T07:57:47', '2005-08-22T11:32:47', '1'), - ('503', '2612', '2006-02-16T02:30:53', '2005-07-08T05:33:59', '2005-07-14T09:27:59', '1'), - ('503', '1852', '2006-02-16T02:30:53', '2005-08-23T10:00:02', '2005-08-24T05:25:02', '1'), - ('503', '3142', '2006-02-16T02:30:53', '2005-08-22T11:09:18', '2005-08-29T08:41:18', '1'), - ('503', '1871', '2006-02-16T02:30:53', '2005-08-22T10:15:54', '2005-08-25T07:21:54', '1'), - ('503', '2829', '2006-02-16T02:30:53', '2005-06-18T03:35:40', '2005-06-23T03:05:40', '1'), - ('503', '3027', '2006-02-16T02:30:53', '2005-08-02T07:24:23', '2005-08-08T04:55:23', '1'), - ('503', '967', '2006-02-16T02:30:53', '2005-07-11T10:19:05', '2005-07-12T14:30:05', '1'), - ('503', '3144', '2006-02-16T02:30:53', '2005-08-19T20:00:51', '2005-08-25T14:30:51', '1'), - ('503', '723', '2006-02-16T02:30:53', '2005-07-09T23:01:13', '2005-07-13T01:03:13', '1'), - ('503', '1395', '2006-02-16T02:30:53', '2005-06-17T19:35:26', '2005-06-25T15:45:26', '1'), - ('29', '1649', '2006-02-16T02:30:53', '2005-06-19T10:38:42', '2005-06-23T14:20:42', '1'), - ('29', '2992', '2006-02-16T02:30:53', '2005-07-27T18:27:13', '2005-07-29T23:52:13', '1'), - ('29', '2830', '2006-02-16T02:30:53', '2005-06-21T08:49:16', '2005-06-22T12:31:16', '1'), - ('29', '2017', '2006-02-16T02:30:53', '2005-08-22T07:35:56', '2005-08-29T13:17:56', '1'), - ('29', '2191', '2006-02-16T02:30:53', '2005-08-18T17:16:07', '2005-08-27T12:57:07', '1'), - ('29', '3122', '2006-02-16T02:30:53', '2005-07-07T14:24:30', '2005-07-14T13:12:30', '1'), - ('29', '624', '2006-02-16T02:30:53', '2005-08-01T12:36:09', '2005-08-07T07:42:09', '1'), - ('29', '3587', '2006-02-16T02:30:53', '2005-08-20T12:03:35', '2005-08-27T10:13:35', '1'), - ('29', '1265', '2006-02-16T02:30:53', '2005-07-10T17:59:29', '2005-07-18T18:13:29', '1'), - ('29', '1059', '2006-02-16T02:30:53', '2005-08-18T13:20:13', '2005-08-22T12:55:13', '1'), - ('29', '3299', '2006-02-16T02:30:53', '2005-08-20T14:00:25', '2005-08-28T10:11:25', '1'), - ('29', '2499', '2006-02-16T02:30:53', '2005-08-19T23:36:25', '2005-08-23T18:38:25', '1'), - ('29', '2167', '2006-02-16T02:30:53', '2005-07-29T15:50:14', '2005-08-03T18:30:14', '1'), - ('29', '3323', '2006-02-16T02:30:53', '2005-08-18T12:48:22', '2005-08-19T16:19:22', '1'), - ('29', '91', '2006-02-16T02:30:53', '2005-07-07T17:36:56', '2005-07-13T12:00:56', '1'), - ('29', '109', '2006-02-16T02:30:53', '2005-06-20T04:16:07', '2005-06-21T05:04:07', '1'), - ('29', '4550', '2006-02-16T02:30:53', '2005-06-19T15:42:07', '2005-06-22T17:28:07', '1'), - ('29', '2487', '2006-02-16T02:30:53', '2005-06-19T11:42:20', '2005-06-23T07:16:20', '1'), - ('531', '2232', '2006-02-16T02:30:53', '2005-06-20T07:57:54', '2005-06-21T12:48:54', '1'), - ('531', '34', '2006-02-16T02:30:53', '2005-07-12T20:32:50', '2005-07-16T21:12:50', '1'), - ('531', '3106', '2006-02-16T02:30:53', '2005-08-02T02:14:10', '2005-08-06T23:36:10', '1'), - ('531', '120', '2006-02-16T02:30:53', '2005-07-27T17:49:16', '2005-07-28T15:05:16', '1'), - ('531', '4485', '2006-02-16T02:30:53', '2005-07-10T04:17:25', '2005-07-15T01:41:25', '1'), - ('531', '949', '2006-02-16T02:30:53', '2005-07-06T20:29:48', '2005-07-14T01:44:48', '1'), - ('531', '1950', '2006-02-16T02:30:53', '2005-08-22T21:36:51', '2005-08-24T16:46:51', '1'), - ('531', '3071', '2006-02-16T02:30:53', '2005-07-28T06:09:19', '2005-08-06T06:17:19', '1'), - ('531', '140', '2006-02-16T02:30:53', '2005-07-29T05:02:12', '2005-08-04T08:52:12', '1'), - ('531', '2132', '2006-02-16T02:30:53', '2005-08-02T03:11:33', '2005-08-10T07:31:33', '1'), - ('531', '3346', '2006-02-16T02:30:53', '2005-05-28T23:39:44', '2005-06-01T01:42:44', '1'), - ('531', '1390', '2006-02-16T02:30:53', '2005-08-19T04:50:20', '2005-08-22T10:42:20', '1'), - ('547', '1805', '2006-02-16T02:30:53', '2005-07-06T13:01:47', '2005-07-09T07:10:47', '1'), - ('547', '1333', '2006-02-16T02:30:53', '2005-08-02T10:21:53', '2005-08-08T11:08:53', '1'), - ('547', '1608', '2006-02-16T02:30:53', '2005-07-29T22:32:54', '2005-07-30T20:41:54', '1'), - ('547', '2957', '2006-02-16T02:30:53', '2005-08-22T03:57:08', '2005-08-23T07:11:08', '1'), - ('547', '3392', '2006-02-16T02:30:53', '2005-07-28T09:57:17', '2005-08-04T06:04:17', '1'), - ('547', '1868', '2006-02-16T02:30:53', '2005-08-21T14:44:41', '2005-08-30T20:19:41', '1'), - ('547', '2242', '2006-02-16T02:30:53', '2005-08-19T18:58:44', '2005-08-22T00:15:44', '1'), - ('547', '2781', '2006-02-16T02:30:53', '2005-05-26T21:31:57', '2005-05-28T19:37:57', '1'), - ('547', '2892', '2006-02-16T02:30:53', '2005-07-12T08:01:07', '2005-07-19T03:12:07', '1'), - ('547', '1124', '2006-02-16T02:30:53', '2005-08-02T17:46:34', '2005-08-03T15:21:34', '1'), - ('547', '3053', '2006-02-16T02:30:53', '2005-06-17T12:44:39', '2005-06-25T12:32:39', '1'), - ('547', '2186', '2006-02-16T02:30:53', '2005-07-06T09:15:57', '2005-07-08T03:20:57', '1'), - ('547', '150', '2006-02-16T02:30:53', '2005-08-02T04:17:32', '2005-08-04T05:12:32', '1'), - ('547', '2021', '2006-02-16T02:30:53', '2005-05-27T18:35:20', '2005-06-04T18:58:20', '1'), - ('547', '2696', '2006-02-16T02:30:53', '2005-08-02T01:41:59', '2005-08-06T23:03:59', '1'), - ('53', '3627', '2006-02-16T02:30:53', '2005-07-31T15:13:57', '2005-08-06T20:39:57', '1'), - ('53', '2936', '2006-02-16T02:30:53', '2005-06-20T19:47:12', '2005-06-24T23:24:12', '1'), - ('53', '3390', '2006-02-16T02:30:53', '2005-06-17T09:10:09', '2005-06-21T15:08:09', '1'), - ('53', '357', '2006-02-16T02:30:53', '2005-07-09T10:14:39', '2005-07-10T13:31:39', '1'), - ('53', '1241', '2006-02-16T02:30:53', '2005-07-06T04:37:10', '2005-07-09T23:32:10', '1'), - ('53', '2523', '2006-02-16T02:30:53', '2005-08-20T12:16:38', '2005-08-25T07:29:38', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['751', '14811', '14091', '378', '14671', '9343', '12054', '7466', '14061', '3898', '856', '2388', '2690', '6302', '870', '10406', '11434', '5599', '4188', '14381', '11602', '6463', '10210', '5583', '891', '1931', '8913', '8908', '14433', '4059', '13024', '10171', '12906', '15927', '8450', '5923', '4292', '167', '8722', '14359', '460', '2264', '12283', '15641', '5262', '8905', '6956', '2872', '6272', '13030', '7870', '9380', '6395', '7006', '12518', '4328', '11539', '4539', '9932', '14243', '3403', '15595', '6391', '13664', '9861', '11533', '11527', '15937', '2347', '14440', '5894', '1430', '5146', '12851', '334', '4231', '14691', '4653', '1840', '9472', '14912', '1081', '8455', '9206', '4495', '10651', '13412', '3927', '14835', '1506', '14838', '8058', '12325', '4350', '3074', '3497', '14898', '7862', '9520', '6853']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('53', '2711', '2006-02-16T02:30:53', '2005-05-29T09:55:43', '2005-06-02T04:54:43', '1'), - ('53', '1613', '2006-02-16T02:30:53', '2005-08-22T01:09:04', '2005-08-26T19:30:04', '1'), - ('53', '3304', '2006-02-16T02:30:53', '2005-08-21T00:11:17', '2005-08-27T18:38:17', '1'), - ('53', '2242', '2006-02-16T02:30:53', '2005-05-27T09:23:22', '2005-05-29T15:20:22', '1'), - ('53', '2622', '2006-02-16T02:30:53', '2005-08-21T19:59:30', '2005-08-22T19:39:30', '1'), - ('53', '3521', '2006-02-16T02:30:53', '2005-07-30T18:13:13', '2005-08-02T13:48:13', '1'), - ('53', '3780', '2006-02-16T02:30:53', '2005-08-17T20:59:56', '2005-08-23T19:57:56', '1'), - ('53', '2791', '2006-02-16T02:30:53', '2005-07-27T18:51:17', '2005-07-31T16:58:17', '1'), - ('53', '73', '2006-02-16T02:30:53', '2005-08-20T22:32:11', '2005-08-22T19:28:11', '1'), - ('53', '3858', '2006-02-16T02:30:53', '2005-07-06T19:12:37', '2005-07-11T15:50:37', '1'), - ('53', '3969', '2006-02-16T02:30:53', '2005-05-30T02:01:21', '2005-06-07T03:25:21', '1'), - ('53', '2923', '2006-02-16T02:30:53', '2005-06-18T15:26:30', '2005-06-20T20:24:30', '1'), - ('391', '1381', '2006-02-16T02:30:53', '2005-06-19T13:00:02', '2005-06-27T14:29:02', '1'), - ('391', '3221', '2006-02-16T02:30:53', '2005-07-11T17:55:38', '2005-07-17T22:11:38', '1'), - ('391', '2903', '2006-02-16T02:30:53', '2005-05-30T04:25:47', '2005-06-06T04:32:47', '1'), - ('391', '2614', '2006-02-16T02:30:53', '2005-08-01T07:37:05', '2005-08-02T06:11:05', '1'), - ('391', '3154', '2006-02-16T02:30:53', '2005-08-02T20:13:14', '2005-08-05T15:01:14', '1'), - ('391', '3054', '2006-02-16T02:30:53', '2005-07-10T04:52:04', '2005-07-13T05:19:04', '1'), - ('391', '3243', '2006-02-16T02:30:53', '2005-07-07T10:45:29', '2005-07-16T09:39:29', '1'), - ('391', '811', '2006-02-16T02:30:53', '2005-08-21T09:55:47', '2005-08-25T08:23:47', '1'), - ('391', '2082', '2006-02-16T02:30:53', '2005-08-17T03:21:19', '2005-08-19T05:23:19', '1'), - ('391', '2930', '2006-02-16T02:30:53', '2005-07-12T01:16:11', '2005-07-13T01:37:11', '1'), - ('391', '49', '2006-02-16T02:30:53', '2005-08-01T00:58:52', '2005-08-10T01:16:52', '1'), - ('391', '1242', '2006-02-16T02:30:53', '2005-07-10T04:08:48', '2005-07-19T07:59:48', '1'), - ('391', '2611', '2006-02-16T02:30:53', '2005-05-30T07:43:12', '2005-06-08T09:21:12', '1'), - ('391', '1411', '2006-02-16T02:30:53', '2005-06-17T06:51:56', '2005-06-22T08:27:56', '1'), - ('391', '429', '2006-02-16T02:30:53', '2005-07-30T01:35:01', '2005-08-06T06:13:01', '1'), - ('391', '4498', '2006-02-16T02:30:53', '2005-07-30T01:26:05', '2005-07-31T20:39:05', '1'), - ('401', '732', '2006-02-16T02:30:53', '2005-08-21T11:36:34', '2005-08-26T08:51:34', '1'), - ('401', '292', '2006-02-16T02:30:53', '2005-07-07T04:04:26', '2005-07-10T22:35:26', '1'), - ('401', '2917', '2006-02-16T02:30:53', '2005-08-19T08:19:21', '2005-08-27T05:18:21', '1'), - ('401', '1367', '2006-02-16T02:30:53', '2005-07-31T23:29:05', '2005-08-03T19:39:05', '1'), - ('401', '2060', '2006-02-16T02:30:53', '2005-08-19T04:13:43', '2005-08-20T04:24:43', '1'), - ('401', '2450', '2006-02-16T02:30:53', '2005-08-23T18:23:11', '2005-08-24T15:09:11', '1'), - ('401', '484', '2006-02-16T02:30:53', '2005-07-29T07:44:05', '2005-08-01T12:23:05', '1'), - ('401', '1817', '2006-02-16T02:30:53', '2005-07-10T21:40:06', '2005-07-13T00:01:06', '1'), - ('401', '3084', '2006-02-16T02:30:53', '2005-07-07T15:48:38', '2005-07-15T17:53:38', '1'), - ('401', '865', '2006-02-16T02:30:53', '2005-05-26T02:50:31', '2005-05-27T03:07:31', '1'), - ('401', '1389', '2006-02-16T02:30:53', '2005-07-29T17:58:58', '2005-08-07T23:40:58', '1'), - ('401', '1841', '2006-02-16T02:30:53', '2005-08-21T09:16:19', '2005-08-22T09:28:19', '1'), - ('240', '4238', '2006-02-16T02:30:53', '2005-05-27T20:02:03', '2005-05-28T16:14:03', '1'), - ('240', '150', '2006-02-16T02:30:53', '2005-06-18T05:58:45', '2005-06-19T00:57:45', '1'), - ('240', '574', '2006-02-16T02:30:53', '2005-08-18T04:54:25', '2005-08-23T04:02:25', '1'), - ('240', '3126', '2006-02-16T02:30:53', '2005-08-23T08:06:49', '2005-08-24T13:17:49', '1'), - ('240', '1092', '2006-02-16T02:30:53', '2005-07-09T14:08:01', '2005-07-12T16:48:01', '1'), - ('240', '2154', '2006-02-16T02:30:53', '2005-07-30T01:11:11', '2005-08-04T22:39:11', '1'), - ('240', '2499', '2006-02-16T02:30:53', '2005-07-26T23:55:57', '2005-08-03T21:41:57', '1'), - ('240', '3779', '2006-02-16T02:30:53', '2005-06-20T00:38:21', '2005-06-26T19:56:21', '1'), - ('240', '3103', '2006-02-16T02:30:53', '2005-07-11T16:03:49', '2005-07-15T19:54:49', '1'), - ('240', '2614', '2006-02-16T02:30:53', '2005-08-19T08:28:11', '2005-08-24T07:20:11', '1'), - ('240', '970', '2006-02-16T02:30:53', '2005-07-28T10:16:03', '2005-07-31T16:06:03', '1'), - ('264', '4403', '2006-02-16T02:30:53', '2005-07-30T19:17:31', '2005-08-01T20:46:31', '1'), - ('264', '3058', '2006-02-16T02:30:53', '2005-07-11T22:29:29', '2005-07-18T00:50:29', '1'), - ('264', '3522', '2006-02-16T02:30:53', '2005-07-27T01:42:20', '2005-08-03T03:19:20', '1'), - ('264', '3860', '2006-02-16T02:30:53', '2005-08-18T13:41:32', '2005-08-23T13:01:32', '1'), - ('264', '2174', '2006-02-16T02:30:53', '2005-07-07T18:03:17', '2005-07-14T16:14:17', '1'), - ('264', '2064', '2006-02-16T02:30:53', '2005-08-17T00:45:41', '2005-08-19T06:03:41', '1'), - ('264', '2450', '2006-02-16T02:30:53', '2005-07-08T04:01:02', '2005-07-14T22:32:02', '1'), - ('264', '1691', '2006-02-16T02:30:53', '2005-07-31T15:19:48', '2005-08-05T21:09:48', '1'), - ('264', '1489', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('264', '1741', '2006-02-16T02:30:53', '2005-06-21T15:55:06', '2005-06-27T12:34:06', '1'), - ('264', '4046', '2006-02-16T02:30:53', '2005-08-23T06:19:12', '2005-08-31T04:52:12', '1'), - ('264', '1745', '2006-02-16T02:30:53', '2005-07-11T22:23:09', '2005-07-15T23:02:09', '1'), - ('264', '3750', '2006-02-16T02:30:53', '2005-08-20T08:18:36', '2005-08-26T11:04:36', '1'), - ('264', '1050', '2006-02-16T02:30:53', '2005-07-31T13:04:14', '2005-08-09T15:22:14', '1'), - ('264', '4252', '2006-02-16T02:30:53', '2005-08-17T00:34:53', '2005-08-22T06:10:53', '1'), - ('264', '162', '2006-02-16T02:30:53', '2005-08-17T00:25:06', '2005-08-22T21:13:06', '1'), - ('194', '2882', '2006-02-16T02:30:53', '2005-08-23T18:43:22', '2005-08-24T22:53:22', '1'), - ('194', '4516', '2006-02-16T02:30:53', '2005-06-18T12:12:29', '2005-06-23T14:03:29', '1'), - ('194', '3495', '2006-02-16T02:30:53', '2005-08-21T11:59:04', '2005-08-23T10:10:04', '1'), - ('194', '2264', '2006-02-16T02:30:53', '2005-07-10T20:09:34', '2005-07-17T15:39:34', '1'), - ('194', '3412', '2006-02-16T02:30:53', '2005-06-15T18:24:55', '2005-06-16T12:26:55', '1'), - ('194', '776', '2006-02-16T02:30:53', '2005-07-09T08:14:58', '2005-07-11T07:04:58', '1'), - ('194', '3311', '2006-02-16T02:30:53', '2005-08-19T02:12:12', '2005-08-25T23:51:12', '1'), - ('194', '3973', '2006-02-16T02:30:53', '2005-05-27T03:03:07', '2005-05-29T03:54:07', '1'), - ('194', '3522', '2006-02-16T02:30:53', '2005-07-07T12:48:19', '2005-07-13T18:45:19', '1'), - ('404', '2131', '2006-02-16T02:30:53', '2005-08-21T20:42:29', '2005-08-24T01:22:29', '1'), - ('404', '2511', '2006-02-16T02:30:53', '2005-07-08T09:48:01', '2005-07-17T05:18:01', '1'), - ('404', '340', '2006-02-16T02:30:53', '2005-06-16T23:39:34', '2005-06-21T23:36:34', '1'), - ('404', '4178', '2006-02-16T02:30:53', '2005-07-30T23:03:32', '2005-08-01T18:02:32', '1'), - ('404', '2658', '2006-02-16T02:30:53', '2005-08-22T04:51:42', '2005-08-23T23:50:42', '1'), - ('404', '4524', '2006-02-16T02:30:53', '2005-05-31T10:56:32', '2005-06-06T11:31:32', '1'), - ('404', '4043', '2006-02-16T02:30:53', '2005-07-29T07:53:06', '2005-08-05T05:29:06', '1'), - ('404', '2021', '2006-02-16T02:30:53', '2005-07-30T12:46:59', '2005-08-03T14:58:59', '1'), - ('404', '3515', '2006-02-16T02:30:53', '2005-07-08T01:43:46', '2005-07-10T07:38:46', '1'), - ('404', '1541', '2006-02-16T02:30:53', '2005-08-01T16:20:22', '2005-08-03T15:53:22', '1'), - ('404', '2806', '2006-02-16T02:30:53', '2005-08-19T22:46:35', '2005-08-26T18:06:35', '1'), - ('404', '2194', '2006-02-16T02:30:53', '2005-07-06T20:48:14', '2005-07-10T15:37:14', '1'), - ('404', '755', '2006-02-16T02:30:53', '2005-08-22T01:49:07', '2005-08-30T04:28:07', '1'), - ('404', '4085', '2006-02-16T02:30:53', '2005-06-15T22:19:37', '2005-06-22T18:28:37', '1'), - ('404', '506', '2006-02-16T02:30:53', '2005-08-22T01:57:34', '2005-08-25T06:34:34', '1'), - ('404', '2148', '2006-02-16T02:30:53', '2005-07-28T17:07:49', '2005-08-03T22:57:49', '1'), - ('404', '1844', '2006-02-16T02:30:53', '2005-08-18T06:41:30', '2005-08-26T02:49:30', '1'), - ('299', '2223', '2006-02-16T02:30:53', '2005-07-07T19:02:41', '2005-07-09T15:27:41', '1'), - ('299', '1441', '2006-02-16T02:30:53', '2005-06-20T14:41:41', '2005-06-21T15:56:41', '1'), - ('299', '1970', '2006-02-16T02:30:53', '2005-07-06T00:00:03', '2005-07-09T01:27:03', '1'), - ('299', '1736', '2006-02-16T02:30:53', '2005-08-22T04:26:34', '2005-08-31T10:04:34', '1'), - ('299', '2507', '2006-02-16T02:30:53', '2005-07-28T10:02:25', '2005-08-05T13:10:25', '1'), - ('299', '1306', '2006-02-16T02:30:53', '2005-07-31T00:50:54', '2005-08-04T20:05:54', '1'), - ('299', '4006', '2006-02-16T02:30:53', '2005-07-12T19:38:11', '2005-07-20T00:14:11', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['14208', '6732', '11998', '7746', '5033', '3288', '5642', '1650', '10245', '8063', '11940', '15282', '2994', '7403', '1265', '15520', '14275', '2000', '15847', '14427', '4126', '8403', '3915', '2536', '2323', '12872', '2647', '10489', '10882', '6813', '12775', '13890', '441', '11182', '13315', '12526', '8992', '11887', '15226', '1571', '198', '3816', '6963', '9231', '219', '513', '15205', '2370', '2201', '11705', '1614', '15981', '14095', '1559', '7093', '8303', '14941', '1636', '4212', '10347', '15214', '6523', '5076', '14076', '7134', '6335', '13355', '8371', '641', '5059', '14792', '1408', '14078', '12895', '14169', '12393', '1385', '7313', '10610', '10124', '8807', '15198', '8116', '8033', '10437', '8074', '7273', '2363', '12250', '573', '14762', '15298', '1476', '5326', '11367', '1725', '3284', '14463', '8856', '8168']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('299', '4180', '2006-02-16T02:30:53', '2005-08-21T04:09:18', '2005-08-22T03:29:18', '1'), - ('299', '1913', '2006-02-16T02:30:53', '2005-07-12T13:58:51', '2005-07-17T17:42:51', '1'), - ('299', '4258', '2006-02-16T02:30:53', '2005-08-17T18:46:21', '2005-08-18T20:29:21', '1'), - ('299', '176', '2006-02-16T02:30:53', '2005-07-28T05:48:56', '2005-08-04T07:33:56', '1'), - ('299', '2841', '2006-02-16T02:30:53', '2005-07-09T02:42:01', '2005-07-14T00:29:01', '1'), - ('299', '1961', '2006-02-16T02:30:53', '2005-06-21T06:36:59', '2005-06-30T06:50:59', '1'), - ('299', '3630', '2006-02-16T02:30:53', '2005-07-10T06:46:08', '2005-07-13T10:03:08', '1'), - ('299', '4125', '2006-02-16T02:30:53', '2005-06-16T09:23:20', '2005-06-23T11:25:20', '1'), - ('163', '2880', '2006-02-16T02:30:53', '2005-08-01T02:24:09', '2005-08-02T02:31:09', '1'), - ('163', '935', '2006-02-16T02:30:53', '2005-07-28T17:15:11', '2005-08-04T16:45:11', '1'), - ('163', '1188', '2006-02-16T02:30:53', '2005-08-17T16:56:28', '2005-08-18T15:09:28', '1'), - ('163', '1932', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('163', '1290', '2006-02-16T02:30:53', '2005-06-20T09:17:05', '2005-06-29T04:41:05', '1'), - ('163', '2551', '2006-02-16T02:30:53', '2005-07-27T16:22:09', '2005-08-01T15:32:09', '1'), - ('163', '982', '2006-02-16T02:30:53', '2005-06-15T07:00:50', '2005-06-19T12:27:50', '1'), - ('163', '1792', '2006-02-16T02:30:53', '2005-08-23T03:30:45', '2005-09-01T00:20:45', '1'), - ('163', '3238', '2006-02-16T02:30:53', '2005-08-21T06:30:30', '2005-08-25T12:28:30', '1'), - ('163', '323', '2006-02-16T02:30:53', '2005-06-17T11:32:30', '2005-06-22T13:37:30', '1'), - ('163', '2287', '2006-02-16T02:30:53', '2005-08-23T15:39:38', '2005-08-24T11:46:38', '1'), - ('163', '2353', '2006-02-16T02:30:53', '2005-08-21T11:26:06', '2005-08-27T10:39:06', '1'), - ('163', '3018', '2006-02-16T02:30:53', '2005-07-07T07:24:11', '2005-07-15T07:31:11', '1'), - ('163', '1360', '2006-02-16T02:30:53', '2005-07-29T06:26:39', '2005-08-02T05:37:39', '1'), - ('163', '125', '2006-02-16T02:30:53', '2005-07-06T20:16:46', '2005-07-10T17:24:46', '1'), - ('163', '4232', '2006-02-16T02:30:53', '2005-06-19T01:41:34', '2005-06-27T03:11:34', '1'), - ('54', '207', '2006-02-16T02:30:53', '2005-06-18T09:55:02', '2005-06-23T07:19:02', '1'), - ('54', '1975', '2006-02-16T02:30:53', '2005-08-19T02:57:37', '2005-08-22T23:23:37', '1'), - ('54', '1954', '2006-02-16T02:30:53', '2005-06-19T09:57:56', '2005-06-22T15:55:56', '1'), - ('54', '4067', '2006-02-16T02:30:53', '2005-08-01T10:27:42', '2005-08-07T12:56:42', '1'), - ('54', '1349', '2006-02-16T02:30:53', '2005-08-02T00:47:16', '2005-08-09T22:11:16', '1'), - ('54', '135', '2006-02-16T02:30:53', '2005-07-12T18:03:50', '2005-07-16T16:30:50', '1'), - ('54', '4374', '2006-02-16T02:30:53', '2005-08-18T23:35:56', '2005-08-26T18:37:56', '1'), - ('54', '2965', '2006-02-16T02:30:53', '2005-08-20T15:41:00', '2005-08-22T16:00:00', '1'), - ('54', '1578', '2006-02-16T02:30:53', '2005-05-27T18:11:05', '2005-05-30T22:45:05', '1'), - ('54', '605', '2006-02-16T02:30:53', '2005-08-02T10:55:14', '2005-08-06T05:58:14', '1'), - ('54', '3151', '2006-02-16T02:30:53', '2005-08-19T19:16:18', '2005-08-21T20:58:18', '1'), - ('54', '3541', '2006-02-16T02:30:53', '2005-08-18T13:48:43', '2005-08-19T10:05:43', '1'), - ('54', '4478', '2006-02-16T02:30:53', '2005-07-30T04:44:18', '2005-08-01T00:29:18', '1'), - ('54', '3290', '2006-02-16T02:30:53', '2005-08-17T15:03:13', '2005-08-19T09:49:13', '1'), - ('54', '318', '2006-02-16T02:30:53', '2005-08-22T17:20:17', '2005-08-31T15:36:17', '1'), - ('54', '1019', '2006-02-16T02:30:53', '2005-06-16T03:22:00', '2005-06-22T23:27:00', '1'), - ('54', '1789', '2006-02-16T02:30:53', '2005-05-26T07:03:49', '2005-06-04T11:45:49', '1'), - ('489', '2941', '2006-02-16T02:30:53', '2005-07-06T15:27:04', '2005-07-14T13:12:04', '1'), - ('489', '4284', '2006-02-16T02:30:53', '2005-07-27T00:13:02', '2005-08-03T18:13:02', '1'), - ('489', '1587', '2006-02-16T02:30:53', '2005-07-30T13:42:15', '2005-08-02T19:27:15', '1'), - ('489', '3074', '2006-02-16T02:30:53', '2005-05-26T09:41:45', '2005-05-28T04:40:45', '1'), - ('489', '225', '2006-02-16T02:30:53', '2005-05-28T03:08:10', '2005-05-29T07:22:10', '1'), - ('489', '3276', '2006-02-16T02:30:53', '2005-08-22T16:32:23', '2005-08-27T16:08:23', '1'), - ('489', '2656', '2006-02-16T02:30:53', '2005-06-18T14:29:54', '2005-06-24T10:23:54', '1'), - ('489', '1864', '2006-02-16T02:30:53', '2005-06-18T02:08:27', '2005-06-23T01:40:27', '1'), - ('489', '4242', '2006-02-16T02:30:53', '2005-08-17T07:22:25', '2005-08-18T06:42:25', '1'), - ('489', '23', '2006-02-16T02:30:53', '2005-06-16T06:58:02', '2005-06-23T11:24:02', '1'), - ('489', '2867', '2006-02-16T02:30:53', '2005-08-23T20:12:17', '2005-08-30T20:43:17', '1'), - ('489', '1550', '2006-02-16T02:30:53', '2005-08-21T00:25:45', '2005-08-28T23:00:45', '1'), - ('574', '716', '2006-02-16T02:30:53', '2005-06-16T02:35:03', '2005-06-19T21:22:03', '1'), - ('574', '3065', '2006-02-16T02:30:53', '2005-07-27T04:47:00', '2005-07-31T10:15:00', '1'), - ('574', '1620', '2006-02-16T02:30:53', '2005-07-29T03:05:56', '2005-08-04T06:13:56', '1'), - ('574', '2328', '2006-02-16T02:30:53', '2005-08-22T05:58:23', '2005-08-28T10:58:23', '1'), - ('574', '2052', '2006-02-16T02:30:53', '2005-06-16T08:28:54', '2005-06-24T09:23:54', '1'), - ('574', '1825', '2006-02-16T02:30:53', '2005-07-07T11:53:14', '2005-07-09T07:12:14', '1'), - ('574', '953', '2006-02-16T02:30:53', '2005-08-01T05:20:03', '2005-08-04T10:03:03', '1'), - ('574', '1500', '2006-02-16T02:30:53', '2005-08-22T16:53:29', '2005-08-24T14:17:29', '1'), - ('574', '1848', '2006-02-16T02:30:53', '2005-07-12T04:14:19', '2005-07-17T00:38:19', '1'), - ('574', '4388', '2006-02-16T02:30:53', '2005-07-09T05:13:22', '2005-07-16T09:11:22', '1'), - ('574', '1070', '2006-02-16T02:30:53', '2005-08-20T23:20:10', '2005-08-24T04:00:10', '1'), - ('574', '1058', '2006-02-16T02:30:53', '2005-07-27T06:33:06', '2005-07-28T06:15:06', '1'), - ('396', '2757', '2006-02-16T02:30:53', '2005-07-11T19:25:15', '2005-07-16T17:02:15', '1'), - ('396', '585', '2006-02-16T02:30:53', '2005-08-19T20:59:19', '2005-08-23T21:44:19', '1'), - ('396', '2466', '2006-02-16T02:30:53', '2005-07-29T05:16:35', '2005-07-31T01:49:35', '1'), - ('396', '3548', '2006-02-16T02:30:53', '2005-05-28T18:45:47', '2005-06-04T15:24:47', '1'), - ('396', '3951', '2006-02-16T02:30:53', '2005-07-09T04:28:01', '2005-07-15T22:57:01', '1'), - ('396', '4436', '2006-02-16T02:30:53', '2005-08-22T00:36:41', '2005-08-30T18:58:41', '1'), - ('396', '2655', '2006-02-16T02:30:53', '2005-06-15T16:57:58', '2005-06-22T21:08:58', '1'), - ('396', '1642', '2006-02-16T02:30:53', '2005-08-20T23:26:40', '2005-08-28T02:30:40', '1'), - ('396', '4372', '2006-02-16T02:30:53', '2005-08-19T03:50:48', '2005-08-26T09:13:48', '1'), - ('396', '3800', '2006-02-16T02:30:53', '2005-08-21T03:00:31', '2005-08-30T01:16:31', '1'), - ('396', '2435', '2006-02-16T02:30:53', '2005-08-18T09:02:41', '2005-08-26T12:47:41', '1'), - ('396', '4073', '2006-02-16T02:30:53', '2005-06-15T15:28:23', '2005-06-18T18:37:23', '1'), - ('396', '1884', '2006-02-16T02:30:53', '2005-07-27T13:11:57', '2005-08-02T07:31:57', '1'), - ('396', '1865', '2006-02-16T02:30:53', '2005-08-01T14:49:41', '2005-08-03T13:07:41', '1'), - ('396', '1956', '2006-02-16T02:30:53', '2005-07-31T21:31:49', '2005-08-04T00:06:49', '1'), - ('396', '2612', '2006-02-16T02:30:53', '2005-07-29T21:36:59', '2005-08-01T17:40:59', '1'), - ('396', '1253', '2006-02-16T02:30:53', '2005-08-22T16:15:33', '2005-08-29T20:49:33', '1'), - ('1', '4497', '2006-02-16T02:30:53', '2005-07-28T19:20:07', '2005-07-29T22:54:07', '1'), - ('1', '4268', '2006-02-16T02:30:53', '2005-07-28T16:18:23', '2005-07-30T17:56:23', '1'), - ('1', '14', '2006-02-16T02:30:53', '2005-08-01T08:51:04', '2005-08-10T12:12:04', '1'), - ('1', '1558', '2006-02-16T02:30:53', '2005-07-28T17:33:39', '2005-07-29T20:17:39', '1'), - ('1', '2465', '2006-02-16T02:30:53', '2005-07-27T11:31:22', '2005-07-31T06:50:22', '1'), - ('1', '3497', '2006-02-16T02:30:53', '2005-06-18T13:33:59', '2005-06-19T17:40:59', '1'), - ('1', '921', '2006-02-16T02:30:53', '2005-08-18T03:57:29', '2005-08-22T23:05:29', '1'), - ('1', '4020', '2006-02-16T02:30:53', '2005-05-28T10:35:23', '2005-06-03T06:32:23', '1'), - ('1', '4249', '2006-02-16T02:30:53', '2005-08-21T23:33:57', '2005-08-23T01:30:57', '1'), - ('1', '1446', '2006-02-16T02:30:53', '2005-08-22T19:41:37', '2005-08-28T22:49:37', '1'), - ('1', '1407', '2006-02-16T02:30:53', '2005-06-15T21:08:46', '2005-06-25T02:26:46', '1'), - ('1', '797', '2006-02-16T02:30:53', '2005-07-09T16:38:01', '2005-07-13T18:02:01', '1'), - ('1', '1440', '2006-02-16T02:30:53', '2005-08-02T18:01:38', '2005-08-04T13:19:38', '1'), - ('1', '726', '2006-02-16T02:30:53', '2005-06-16T15:18:57', '2005-06-17T21:05:57', '1'), - ('1', '4566', '2006-02-16T02:30:53', '2005-06-21T06:24:45', '2005-06-28T03:28:45', '1'), - ('365', '1403', '2006-02-16T02:30:53', '2005-08-21T12:51:49', '2005-08-29T12:17:49', '1'), - ('365', '2942', '2006-02-16T02:30:53', '2005-07-29T23:42:00', '2005-08-07T03:00:00', '1'), - ('365', '1120', '2006-02-16T02:30:53', '2005-07-28T21:28:32', '2005-07-30T02:10:32', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['4583', '7488', '9122', '9540', '10717', '231', '1578', '7634', '1983', '12322', '8782', '4773', '2997', '2505', '10697', '9645', '1941', '12648', '5236', '9886', '10097', '9441', '5547', '9534', '14182', '15347', '12924', '12032', '4656', '5062', '4057', '11412', '3434', '13000', '14112', '12107', '5769', '13470', '12093', '7878', '13169', '10379', '1242', '10798', '12953', '290', '7352', '5868', '844', '3409', '9849', '601', '8143', '799', '11043', '4609', '9837', '5903', '6693', '12791', '3930', '10296', '4085', '2995', '9963', '13113', '4770', '3295', '827', '11912', '12269', '10887', '1613', '5036', '11172', '8357', '10795', '2397', '15169', '8253', '4099', '1791', '2894', '13697', '574', '3809', '6362', '1908', '5023', '12452', '13197', '9062', '10193', '858', '2114', '706', '7494', '1482', '9356', '10680']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('365', '4151', '2006-02-16T02:30:53', '2005-07-08T06:09:44', '2005-07-12T03:44:44', '1'), - ('365', '554', '2006-02-16T02:30:53', '2005-07-27T19:36:15', '2005-08-05T14:14:15', '1'), - ('365', '627', '2006-02-16T02:30:53', '2005-07-30T09:36:52', '2005-08-05T13:20:52', '1'), - ('365', '2200', '2006-02-16T02:30:53', '2005-07-31T01:40:06', '2005-08-01T01:09:06', '1'), - ('365', '2934', '2006-02-16T02:30:53', '2005-08-01T18:53:53', '2005-08-05T21:28:53', '1'), - ('365', '4032', '2006-02-16T02:30:53', '2005-05-26T11:31:59', '2005-05-27T07:27:59', '1'), - ('365', '3397', '2006-02-16T02:30:53', '2005-06-16T04:08:16', '2005-06-23T07:57:16', '1'), - ('365', '4487', '2006-02-16T02:30:53', '2005-07-28T01:07:01', '2005-07-31T05:00:01', '1'), - ('365', '1955', '2006-02-16T02:30:53', '2005-06-17T10:22:13', '2005-06-24T05:04:13', '1'), - ('365', '4235', '2006-02-16T02:30:53', '2005-08-18T06:35:28', '2005-08-23T07:34:28', '1'), - ('365', '4379', '2006-02-16T02:30:53', '2005-07-29T20:29:34', '2005-08-04T02:19:34', '1'), - ('519', '3025', '2006-02-16T02:30:53', '2005-07-08T15:41:39', '2005-07-13T18:16:39', '1'), - ('519', '1449', '2006-02-16T02:30:53', '2005-06-20T09:23:45', '2005-06-29T08:15:45', '1'), - ('519', '1670', '2006-02-16T02:30:53', '2005-06-18T23:28:27', '2005-06-26T01:36:27', '1'), - ('519', '3115', '2006-02-16T02:30:53', '2005-08-01T18:20:23', '2005-08-07T21:18:23', '1'), - ('519', '3413', '2006-02-16T02:30:53', '2005-07-31T05:42:49', '2005-08-04T00:08:49', '1'), - ('519', '1063', '2006-02-16T02:30:53', '2005-06-17T07:42:45', '2005-06-20T07:12:45', '1'), - ('519', '3545', '2006-02-16T02:30:53', '2005-08-18T18:30:21', '2005-08-25T19:17:21', '1'), - ('519', '1215', '2006-02-16T02:30:53', '2005-07-09T12:56:29', '2005-07-13T08:26:29', '1'), - ('519', '1386', '2006-02-16T02:30:53', '2005-07-31T14:00:13', '2005-08-08T19:30:13', '1'), - ('519', '784', '2006-02-16T02:30:53', '2005-07-31T20:39:38', '2005-08-08T22:22:38', '1'), - ('519', '3982', '2006-02-16T02:30:53', '2005-07-30T21:43:28', '2005-08-08T16:57:28', '1'), - ('519', '1432', '2006-02-16T02:30:53', '2005-07-10T02:52:47', '2005-07-16T02:10:47', '1'), - ('519', '4457', '2006-02-16T02:30:53', '2005-07-31T01:18:27', '2005-08-06T00:28:27', '1'), - ('519', '2422', '2006-02-16T02:30:53', '2005-08-21T03:17:10', '2005-08-24T21:46:10', '1'), - ('519', '3764', '2006-02-16T02:30:53', '2005-08-22T21:12:19', '2005-08-24T20:12:19', '1'), - ('519', '3807', '2006-02-16T02:30:53', '2005-08-19T04:51:47', '2005-08-26T07:50:47', '1'), - ('141', '1106', '2006-02-16T02:30:53', '2005-08-17T20:14:26', '2005-08-26T16:01:26', '1'), - ('141', '839', '2006-02-16T02:30:53', '2005-07-08T09:50:10', '2005-07-13T15:00:10', '1'), - ('141', '2190', '2006-02-16T02:30:53', '2005-07-09T04:36:49', '2005-07-10T06:26:49', '1'), - ('141', '2838', '2006-02-16T02:30:53', '2005-07-07T04:00:20', '2005-07-12T08:14:20', '1'), - ('141', '2271', '2006-02-16T02:30:53', '2005-08-02T19:32:51', '2005-08-11T22:16:51', '1'), - ('141', '2295', '2006-02-16T02:30:53', '2005-06-21T19:08:28', '2005-06-23T14:25:28', '1'), - ('141', '2341', '2006-02-16T02:30:53', '2005-08-19T07:36:42', '2005-08-22T08:50:42', '1'), - ('141', '734', '2006-02-16T02:30:53', '2005-08-21T01:00:46', '2005-08-27T03:46:46', '1'), - ('141', '1060', '2006-02-16T02:30:53', '2005-08-17T22:56:24', '2005-08-24T19:36:24', '1'), - ('141', '4052', '2006-02-16T02:30:53', '2005-07-10T13:17:58', '2005-07-11T11:32:58', '1'), - ('141', '3097', '2006-02-16T02:30:53', '2005-08-20T01:01:16', '2005-08-21T03:19:16', '1'), - ('141', '216', '2006-02-16T02:30:53', '2005-08-17T22:28:40', '2005-08-22T02:05:40', '1'), - ('141', '1564', '2006-02-16T02:30:53', '2005-07-28T10:27:10', '2005-07-29T11:22:10', '1'), - ('141', '1709', '2006-02-16T02:30:53', '2005-08-19T13:43:35', '2005-08-26T09:31:35', '1'), - ('141', '3103', '2006-02-16T02:30:53', '2005-08-01T06:34:29', '2005-08-06T07:49:29', '1'), - ('141', '821', '2006-02-16T02:30:53', '2005-06-15T05:05:07', '2005-06-22T04:57:07', '1'), - ('141', '382', '2006-02-16T02:30:53', '2005-08-01T22:03:10', '2005-08-08T01:34:10', '1'), - ('429', '3954', '2006-02-16T02:30:53', '2005-08-19T06:04:07', '2005-08-28T11:05:07', '1'), - ('429', '2776', '2006-02-16T02:30:53', '2005-05-26T20:08:33', '2005-05-30T00:32:33', '1'), - ('429', '35', '2006-02-16T02:30:53', '2005-07-27T14:38:29', '2005-07-28T14:24:29', '1'), - ('429', '452', '2006-02-16T02:30:53', '2005-07-10T18:39:16', '2005-07-15T21:19:16', '1'), - ('429', '536', '2006-02-16T02:30:53', '2005-05-30T00:58:20', '2005-06-01T00:38:20', '1'), - ('429', '3374', '2006-02-16T02:30:53', '2005-06-21T16:17:38', '2005-06-22T14:16:38', '1'), - ('429', '2230', '2006-02-16T02:30:53', '2005-07-31T12:44:34', '2005-08-02T16:49:34', '1'), - ('429', '3225', '2006-02-16T02:30:53', '2005-05-28T14:08:22', '2005-06-04T10:50:22', '1'), - ('429', '3629', '2006-02-16T02:30:53', '2005-07-28T20:23:11', '2005-08-01T18:17:11', '1'), - ('429', '1713', '2006-02-16T02:30:53', '2005-05-29T17:24:48', '2005-06-05T12:25:48', '1'), - ('573', '65', '2006-02-16T02:30:53', '2005-08-02T06:04:44', '2005-08-06T11:37:44', '1'), - ('573', '3711', '2006-02-16T02:30:53', '2005-07-08T07:22:29', '2005-07-10T08:06:29', '1'), - ('573', '3488', '2006-02-16T02:30:53', '2005-07-31T12:14:19', '2005-08-09T17:08:19', '1'), - ('573', '1388', '2006-02-16T02:30:53', '2005-07-10T20:39:04', '2005-07-11T17:41:04', '1'), - ('573', '2014', '2006-02-16T02:30:53', '2005-07-12T12:37:00', '2005-07-20T09:36:00', '1'), - ('573', '3594', '2006-02-16T02:30:53', '2005-08-19T00:17:09', '2005-08-22T23:46:09', '1'), - ('573', '165', '2006-02-16T02:30:53', '2005-07-06T20:54:07', '2005-07-10T18:31:07', '1'), - ('573', '1958', '2006-02-16T02:30:53', '2005-08-01T04:04:37', '2005-08-01T23:59:37', '1'), - ('573', '1683', '2006-02-16T02:30:53', '2005-07-07T05:25:39', '2005-07-12T04:30:39', '1'), - ('573', '4544', '2006-02-16T02:30:53', '2005-06-20T09:18:22', '2005-06-26T14:31:22', '1'), - ('573', '1609', '2006-02-16T02:30:53', '2005-07-31T16:16:46', '2005-08-02T22:00:46', '1'), - ('573', '2393', '2006-02-16T02:30:53', '2005-08-19T11:27:20', '2005-08-23T12:40:20', '1'), - ('573', '2406', '2006-02-16T02:30:53', '2005-07-08T15:29:46', '2005-07-14T13:31:46', '1'), - ('573', '1703', '2006-02-16T02:30:53', '2005-06-21T07:04:17', '2005-06-29T01:52:17', '1'), - ('573', '62', '2006-02-16T02:30:53', '2005-05-29T21:58:43', '2005-06-06T00:54:43', '1'), - ('573', '744', '2006-02-16T02:30:53', '2005-08-17T15:51:49', '2005-08-24T18:48:49', '1'), - ('573', '724', '2006-02-16T02:30:53', '2005-08-18T04:27:54', '2005-08-25T07:03:54', '1'), - ('573', '3450', '2006-02-16T02:30:53', '2005-08-02T00:52:35', '2005-08-03T05:37:35', '1'), - ('573', '4462', '2006-02-16T02:30:53', '2005-06-16T06:55:10', '2005-06-24T12:08:10', '1'), - ('573', '75', '2006-02-16T02:30:53', '2005-07-09T02:58:41', '2005-07-17T04:09:41', '1'), - ('76', '1207', '2006-02-16T02:30:53', '2005-08-02T10:27:52', '2005-08-11T12:47:52', '1'), - ('76', '892', '2006-02-16T02:30:53', '2005-07-29T04:59:44', '2005-08-01T04:26:44', '1'), - ('76', '2748', '2006-02-16T02:30:53', '2005-08-01T21:56:37', '2005-08-03T01:36:37', '1'), - ('76', '2895', '2006-02-16T02:30:53', '2005-06-18T15:51:25', '2005-06-24T15:52:25', '1'), - ('76', '794', '2006-02-16T02:30:53', '2005-08-22T15:21:56', '2005-08-28T09:40:56', '1'), - ('76', '2388', '2006-02-16T02:30:53', '2005-07-29T00:57:06', '2005-08-07T01:46:06', '1'), - ('76', '1930', '2006-02-16T02:30:53', '2005-07-07T06:20:33', '2005-07-16T08:39:33', '1'), - ('76', '301', '2006-02-16T02:30:53', '2005-06-16T20:04:28', '2005-06-23T22:30:28', '1'), - ('76', '4316', '2006-02-16T02:30:53', '2005-06-20T02:22:42', '2005-06-22T00:38:42', '1'), - ('76', '291', '2006-02-16T02:30:53', '2005-08-20T09:21:08', '2005-08-29T12:33:08', '1'), - ('76', '3883', '2006-02-16T02:30:53', '2005-05-28T10:44:28', '2005-06-04T11:42:28', '1'), - ('358', '2932', '2006-02-16T02:30:53', '2005-07-06T15:16:37', '2005-07-09T14:45:37', '1'), - ('358', '4259', '2006-02-16T02:30:53', '2005-07-11T21:09:31', '2005-07-13T23:08:31', '1'), - ('358', '399', '2006-02-16T02:30:53', '2005-06-17T05:10:36', '2005-06-19T03:52:36', '1'), - ('358', '3206', '2006-02-16T02:30:53', '2005-07-09T02:23:16', '2005-07-15T20:37:16', '1'), - ('358', '4260', '2006-02-16T02:30:53', '2005-08-18T11:14:35', '2005-08-27T09:09:35', '1'), - ('358', '3190', '2006-02-16T02:30:53', '2005-08-19T14:44:03', '2005-08-22T10:11:03', '1'), - ('358', '2780', '2006-02-16T02:30:53', '2005-07-30T07:23:17', '2005-08-02T12:07:17', '1'), - ('358', '2036', '2006-02-16T02:30:53', '2005-08-01T00:33:27', '2005-08-07T20:15:27', '1'), - ('358', '1258', '2006-02-16T02:30:53', '2005-05-30T02:10:32', '2005-06-01T04:42:32', '1'), - ('358', '3541', '2006-02-16T02:30:53', '2005-06-17T20:00:25', '2005-06-23T18:51:25', '1'), - ('60', '2278', '2006-02-16T02:30:53', '2005-05-29T03:05:49', '2005-06-04T22:48:49', '1'), - ('60', '2259', '2006-02-16T02:30:53', '2005-07-27T19:56:31', '2005-07-30T14:28:31', '1'), - ('60', '3980', '2006-02-16T02:30:53', '2005-06-15T21:18:16', '2005-06-16T17:07:16', '1'), - ('60', '4188', '2006-02-16T02:30:53', '2005-07-30T18:36:24', '2005-08-03T14:10:24', '1'), - ('60', '2498', '2006-02-16T02:30:53', '2005-08-01T17:28:05', '2005-08-04T19:34:05', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['7331', '7067', '6282', '3849', '15618', '3473', '15649', '15318', '2394', '14379', '2104', '6585', '12287', '15439', '9319', '10027', '15614', '6397', '7777', '1642', '2286', '15127', '11106', '15076', '8994', '10807', '11716', '4877', '2612', '15084', '1247', '12861', '14204', '11194', '14136', '15908', '13035', '8885', '6817', '6461', '13390', '1272', '11704', '12249', '15425', '9282', '15473', '7774', '14170', '13598', '7188', '10510', '722', '1813', '9205', '13109', '6074', '10781', '14966', '15689', '11184', '4199', '13112', '6539', '13366', '901', '7817', '14631', '7116', '4810', '8067', '7752', '15254', '7269', '10811', '2650', '8816', '10646', '7505', '5170', '8439', '4118', '15952', '12492', '9181', '3282', '15225', '14271', '8255', '2277', '8605', '10055', '9306', '2575', '8275', '3204', '2954', '12323', '13066', '2212']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('60', '2090', '2006-02-16T02:30:53', '2005-07-27T13:57:50', '2005-07-31T08:59:50', '1'), - ('60', '870', '2006-02-16T02:30:53', '2005-07-27T03:55:10', '2005-08-01T02:56:10', '1'), - ('60', '4453', '2006-02-16T02:30:53', '2005-07-11T16:46:22', '2005-07-15T13:19:22', '1'), - ('60', '3660', '2006-02-16T02:30:53', '2005-07-06T16:49:43', '2005-07-12T17:20:43', '1'), - ('60', '1903', '2006-02-16T02:30:53', '2005-08-23T07:07:58', '2005-08-29T03:48:58', '1'), - ('60', '2735', '2006-02-16T02:30:53', '2005-07-05T22:57:34', '2005-07-12T23:53:34', '1'), - ('60', '415', '2006-02-16T02:30:53', '2005-08-23T08:28:03', '2005-08-30T05:11:03', '1'), - ('60', '1738', '2006-02-16T02:30:53', '2005-08-22T20:15:16', '2005-08-25T14:17:16', '1'), - ('60', '2669', '2006-02-16T02:30:53', '2005-06-18T15:42:30', '2005-06-26T16:12:30', '1'), - ('136', '3062', '2006-02-16T02:30:53', '2005-08-21T09:53:03', '2005-08-24T14:32:03', '1'), - ('136', '3084', '2006-02-16T02:30:53', '2005-06-17T19:14:30', '2005-06-19T16:26:30', '1'), - ('136', '2064', '2006-02-16T02:30:53', '2005-07-12T06:50:52', '2005-07-21T06:51:52', '1'), - ('136', '2238', '2006-02-16T02:30:53', '2005-08-18T04:58:06', '2005-08-24T00:06:06', '1'), - ('136', '3848', '2006-02-16T02:30:53', '2005-08-23T00:34:28', '2005-08-27T01:07:28', '1'), - ('136', '4066', '2006-02-16T02:30:53', '2005-07-30T17:15:27', '2005-08-03T14:03:27', '1'), - ('287', '525', '2006-02-16T02:30:53', '2005-07-31T18:33:51', '2005-08-09T18:40:51', '1'), - ('287', '1216', '2006-02-16T02:30:53', '2005-08-23T07:05:15', '2005-09-01T11:41:15', '1'), - ('287', '2423', '2006-02-16T02:30:53', '2005-07-11T22:34:02', '2005-07-13T23:01:02', '1'), - ('287', '4422', '2006-02-16T02:30:53', '2005-07-28T07:04:42', '2005-07-29T01:57:42', '1'), - ('287', '3875', '2006-02-16T02:30:53', '2005-06-16T08:54:15', '2005-06-18T12:36:15', '1'), - ('287', '618', '2006-02-16T02:30:53', '2005-06-18T07:02:32', '2005-06-27T12:33:32', '1'), - ('287', '2397', '2006-02-16T02:30:53', '2005-08-22T12:56:29', '2005-08-26T10:58:29', '1'), - ('287', '2307', '2006-02-16T02:30:53', '2005-08-02T08:17:38', '2005-08-03T07:54:38', '1'), - ('287', '4170', '2006-02-16T02:30:53', '2005-08-22T11:05:34', '2005-08-27T14:40:34', '1'), - ('287', '1527', '2006-02-16T02:30:53', '2005-07-30T04:51:32', '2005-08-07T09:41:32', '1'), - ('287', '1673', '2006-02-16T02:30:53', '2005-08-01T22:26:10', '2005-08-05T21:55:10', '1'), - ('287', '3054', '2006-02-16T02:30:53', '2005-08-17T07:40:55', '2005-08-21T05:56:55', '1'), - ('287', '1846', '2006-02-16T02:30:53', '2005-07-08T19:31:02', '2005-07-15T19:05:02', '1'), - ('287', '1691', '2006-02-16T02:30:53', '2005-06-19T07:19:41', '2005-06-25T11:10:41', '1'), - ('287', '821', '2006-02-16T02:30:53', '2005-08-22T11:17:59', '2005-08-23T09:23:59', '1'), - ('287', '4049', '2006-02-16T02:30:53', '2005-06-15T05:16:40', '2005-06-23T11:01:40', '1'), - ('287', '3115', '2006-02-16T02:30:53', '2005-08-19T02:30:24', '2005-08-22T08:23:24', '1'), - ('287', '4334', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('135', '2732', '2006-02-16T02:30:53', '2005-08-02T11:35:53', '2005-08-10T11:28:53', '1'), - ('135', '268', '2006-02-16T02:30:53', '2005-08-21T01:57:26', '2005-08-28T01:11:26', '1'), - ('135', '2453', '2006-02-16T02:30:53', '2005-08-23T17:42:00', '2005-08-31T22:32:00', '1'), - ('135', '4082', '2006-02-16T02:30:53', '2005-08-19T08:46:45', '2005-08-22T11:42:45', '1'), - ('135', '2984', '2006-02-16T02:30:53', '2005-07-30T00:36:26', '2005-08-06T03:05:26', '1'), - ('135', '184', '2006-02-16T02:30:53', '2005-07-12T18:19:57', '2005-07-19T22:53:57', '1'), - ('135', '1799', '2006-02-16T02:30:53', '2005-07-12T01:14:03', '2005-07-19T21:12:03', '1'), - ('135', '2855', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('135', '3128', '2006-02-16T02:30:53', '2005-06-15T07:42:58', '2005-06-18T12:00:58', '1'), - ('135', '1099', '2006-02-16T02:30:53', '2005-08-17T07:21:22', '2005-08-25T06:06:22', '1'), - ('135', '3586', '2006-02-16T02:30:53', '2005-08-18T03:53:34', '2005-08-21T01:14:34', '1'), - ('259', '551', '2006-02-16T02:30:53', '2005-08-23T00:05:57', '2005-09-01T05:08:57', '1'), - ('259', '736', '2006-02-16T02:30:53', '2005-07-30T15:17:31', '2005-08-07T20:46:31', '1'), - ('259', '356', '2006-02-16T02:30:53', '2005-08-23T01:39:10', '2005-08-25T03:48:10', '1'), - ('259', '3483', '2006-02-16T02:30:53', '2005-07-28T07:03:25', '2005-08-03T02:05:25', '1'), - ('259', '894', '2006-02-16T02:30:53', '2005-08-21T03:00:39', '2005-08-27T23:07:39', '1'), - ('259', '2803', '2006-02-16T02:30:53', '2005-08-20T05:59:17', '2005-08-29T01:02:17', '1'), - ('259', '2199', '2006-02-16T02:30:53', '2005-07-27T08:32:08', '2005-07-28T08:02:08', '1'), - ('259', '410', '2006-02-16T02:30:53', '2005-08-01T11:28:30', '2005-08-07T11:37:30', '1'), - ('259', '4540', '2006-02-16T02:30:53', '2005-05-29T05:30:31', '2005-06-06T04:51:31', '1'), - ('259', '1236', '2006-02-16T02:30:53', '2005-06-16T21:11:00', '2005-06-24T15:30:00', '1'), - ('259', '4165', '2006-02-16T02:30:53', '2005-07-30T12:46:40', '2005-08-08T14:58:40', '1'), - ('259', '46', '2006-02-16T02:30:53', '2005-08-19T11:23:20', '2005-08-25T17:05:20', '1'), - ('259', '2876', '2006-02-16T02:30:53', '2005-07-11T04:59:56', '2005-07-13T23:31:56', '1'), - ('259', '1321', '2006-02-16T02:30:53', '2005-08-01T21:22:41', '2005-08-06T01:02:41', '1'), - ('259', '679', '2006-02-16T02:30:53', '2005-08-22T06:45:57', '2005-08-31T10:02:57', '1'), - ('259', '248', '2006-02-16T02:30:53', '2005-08-23T09:52:55', '2005-08-29T11:15:55', '1'), - ('259', '871', '2006-02-16T02:30:53', '2005-08-02T11:01:26', '2005-08-11T06:29:26', '1'), - ('259', '2120', '2006-02-16T02:30:53', '2005-07-07T11:13:07', '2005-07-11T07:17:07', '1'), - ('259', '2074', '2006-02-16T02:30:53', '2005-08-19T11:27:10', '2005-08-22T05:32:10', '1'), - ('259', '2275', '2006-02-16T02:30:53', '2005-07-12T04:50:49', '2005-07-19T03:23:49', '1'), - ('259', '602', '2006-02-16T02:30:53', '2005-08-19T21:14:45', '2005-08-21T03:06:45', '1'), - ('259', '760', '2006-02-16T02:30:53', '2005-05-30T09:40:40', '2005-06-02T10:32:40', '1'), - ('259', '600', '2006-02-16T02:30:53', '2005-07-28T08:20:55', '2005-07-30T11:55:55', '1'), - ('209', '782', '2006-02-16T02:30:53', '2005-08-21T18:47:49', '2005-08-28T16:54:49', '1'), - ('209', '1755', '2006-02-16T02:30:53', '2005-07-27T05:46:43', '2005-08-05T05:54:43', '1'), - ('209', '4056', '2006-02-16T02:30:53', '2005-07-08T17:04:06', '2005-07-09T13:41:06', '1'), - ('209', '3923', '2006-02-16T02:30:53', '2005-07-28T17:20:17', '2005-07-29T21:55:17', '1'), - ('209', '2218', '2006-02-16T02:30:53', '2005-07-28T06:01:00', '2005-08-03T06:09:00', '1'), - ('209', '3762', '2006-02-16T02:30:53', '2005-08-22T18:13:07', '2005-08-24T21:55:07', '1'), - ('209', '2089', '2006-02-16T02:30:53', '2005-07-27T11:23:47', '2005-07-31T13:10:47', '1'), - ('209', '4012', '2006-02-16T02:30:53', '2005-08-01T22:41:15', '2005-08-10T00:10:15', '1'), - ('209', '4211', '2006-02-16T02:30:53', '2005-06-19T10:21:45', '2005-06-21T08:01:45', '1'), - ('209', '3984', '2006-02-16T02:30:53', '2005-07-29T21:53:00', '2005-08-01T21:20:00', '1'), - ('209', '1752', '2006-02-16T02:30:53', '2005-08-01T15:57:55', '2005-08-02T19:08:55', '1'), - ('209', '1342', '2006-02-16T02:30:53', '2005-07-27T20:28:03', '2005-08-03T17:04:03', '1'), - ('209', '66', '2006-02-16T02:30:53', '2005-07-09T09:24:19', '2005-07-18T04:02:19', '1'), - ('224', '182', '2006-02-16T02:30:53', '2005-07-29T07:28:43', '2005-08-04T11:22:43', '1'), - ('224', '355', '2006-02-16T02:30:53', '2005-07-07T07:03:30', '2005-07-08T09:20:30', '1'), - ('224', '1314', '2006-02-16T02:30:53', '2005-08-23T19:11:29', '2005-08-28T14:41:29', '1'), - ('224', '2839', '2006-02-16T02:30:53', '2005-08-18T12:49:04', '2005-08-26T17:55:04', '1'), - ('224', '3953', '2006-02-16T02:30:53', '2005-07-30T12:05:58', '2005-08-02T06:22:58', '1'), - ('224', '1676', '2006-02-16T02:30:53', '2005-06-21T06:18:42', '2005-06-28T09:18:42', '1'), - ('224', '1646', '2006-02-16T02:30:53', '2005-08-22T17:18:32', '2005-08-24T17:25:32', '1'), - ('224', '4506', '2006-02-16T02:30:53', '2005-08-21T06:23:29', '2005-08-27T04:49:29', '1'), - ('224', '3715', '2006-02-16T02:30:53', '2005-07-29T01:02:30', '2005-08-01T22:39:30', '1'), - ('224', '3770', '2006-02-16T02:30:53', '2005-06-18T06:35:03', '2005-06-19T01:26:03', '1'), - ('224', '3805', '2006-02-16T02:30:53', '2005-07-29T13:13:34', '2005-08-07T08:29:34', '1'), - ('336', '2725', '2006-02-16T02:30:53', '2005-07-31T19:15:58', '2005-08-05T20:23:58', '1'), - ('336', '3983', '2006-02-16T02:30:53', '2005-07-30T16:47:17', '2005-08-02T22:15:17', '1'), - ('336', '354', '2006-02-16T02:30:53', '2005-06-19T04:32:52', '2005-06-24T09:37:52', '1'), - ('336', '4432', '2006-02-16T02:30:53', '2005-07-29T01:35:47', '2005-07-30T02:16:47', '1'), - ('336', '2848', '2006-02-16T02:30:53', '2005-06-21T00:37:50', '2005-06-22T23:46:50', '1'), - ('336', '377', '2006-02-16T02:30:53', '2005-06-20T06:45:00', '2005-06-23T11:43:00', '1'), - ('336', '4107', '2006-02-16T02:30:53', '2005-08-18T06:36:22', '2005-08-26T11:36:22', '1'), - ('336', '3730', '2006-02-16T02:30:53', '2005-08-19T09:50:39', '2005-08-22T14:01:39', '1'), - ('336', '2458', '2006-02-16T02:30:53', '2005-06-18T02:36:10', '2005-06-19T21:21:10', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['4595', '8407', '12794', '15073', '14555', '7614', '5731', '7585', '4946', '13384', '15264', '7806', '9195', '13106', '14373', '15183', '9531', '2858', '2133', '11462', '12007', '4626', '1551', '9436', '5793', '12694', '3670', '2324', '13139', '12014', '10612', '2279', '14469', '14015', '5968', '12010', '3278', '11589', '15690', '817', '12793', '3737', '10109', '10547', '11391', '1221', '1249', '2927', '11460', '517', '8013', '3049', '3356', '2633', '12742', '4555', '10115', '11277', '2662', '14242', '3801', '9642', '3864', '2686', '365', '5131', '15003', '8227', '6269', '9563', '13825', '7608', '8864', '15050', '2381', '3518', '280', '10793', '8110', '7347', '8054', '6532', '6317', '7524', '6350', '11384', '4824', '3135', '5074', '9166', '1084', '9708', '11497', '12604', '10392', '5242', '3870', '2500', '5071', '988']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('336', '760', '2006-02-16T02:30:53', '2005-07-08T06:40:25', '2005-07-14T08:54:25', '1'), - ('336', '2985', '2006-02-16T02:30:53', '2005-07-29T06:37:02', '2005-08-04T03:13:02', '1'), - ('336', '1586', '2006-02-16T02:30:53', '2005-08-19T00:20:37', '2005-08-26T01:48:37', '1'), - ('336', '3970', '2006-02-16T02:30:53', '2005-08-22T11:01:15', '2005-08-31T09:23:15', '1'), - ('440', '1926', '2006-02-16T02:30:53', '2005-08-21T16:03:02', '2005-08-23T14:18:02', '1'), - ('440', '3475', '2006-02-16T02:30:53', '2005-07-28T00:14:38', '2005-07-29T18:18:38', '1'), - ('440', '2960', '2006-02-16T02:30:53', '2005-07-10T11:31:52', '2005-07-14T11:44:52', '1'), - ('440', '467', '2006-02-16T02:30:53', '2005-07-27T23:18:22', '2005-07-30T23:08:22', '1'), - ('440', '272', '2006-02-16T02:30:53', '2005-07-08T22:46:23', '2005-07-16T17:19:23', '1'), - ('440', '1462', '2006-02-16T02:30:53', '2005-08-19T21:38:51', '2005-08-23T17:55:51', '1'), - ('440', '4459', '2006-02-16T02:30:53', '2005-08-22T18:27:38', '2005-08-24T12:39:38', '1'), - ('440', '4317', '2006-02-16T02:30:53', '2005-07-28T07:58:17', '2005-08-06T10:15:17', '1'), - ('440', '944', '2006-02-16T02:30:53', '2005-07-30T12:29:43', '2005-08-04T12:35:43', '1'), - ('440', '3212', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('268', '4433', '2006-02-16T02:30:53', '2005-08-21T09:44:53', '2005-08-25T15:37:53', '1'), - ('268', '2696', '2006-02-16T02:30:53', '2005-08-22T15:49:54', '2005-08-25T12:29:54', '1'), - ('268', '4550', '2006-02-16T02:30:53', '2005-07-31T01:11:53', '2005-08-07T02:49:53', '1'), - ('268', '2628', '2006-02-16T02:30:53', '2005-06-19T23:17:11', '2005-06-21T19:07:11', '1'), - ('268', '932', '2006-02-16T02:30:53', '2005-06-17T21:10:05', '2005-06-23T22:41:05', '1'), - ('268', '167', '2006-02-16T02:30:53', '2005-08-02T21:36:46', '2005-08-10T01:48:46', '1'), - ('268', '3007', '2006-02-16T02:30:53', '2005-08-17T19:10:34', '2005-08-24T14:09:34', '1'), - ('268', '37', '2006-02-16T02:30:53', '2005-07-08T08:18:21', '2005-07-10T11:36:21', '1'), - ('268', '4088', '2006-02-16T02:30:53', '2005-06-16T02:01:15', '2005-06-22T07:33:15', '1'), - ('268', '2329', '2006-02-16T02:30:53', '2005-07-30T21:33:01', '2005-08-06T17:38:01', '1'), - ('268', '2927', '2006-02-16T02:30:53', '2005-07-10T14:33:00', '2005-07-13T19:27:00', '1'), - ('268', '1741', '2006-02-16T02:30:53', '2005-08-18T20:10:39', '2005-08-25T20:47:39', '1'), - ('268', '4271', '2006-02-16T02:30:53', '2005-07-06T08:56:43', '2005-07-11T09:11:43', '1'), - ('268', '2987', '2006-02-16T02:30:53', '2005-06-18T10:00:33', '2005-06-23T14:10:33', '1'), - ('554', '2099', '2006-02-16T02:30:53', '2005-08-19T12:32:10', '2005-08-24T12:12:10', '1'), - ('554', '1778', '2006-02-16T02:30:53', '2005-08-17T19:29:44', '2005-08-23T20:40:44', '1'), - ('554', '287', '2006-02-16T02:30:53', '2005-08-01T14:55:31', '2005-08-06T19:01:31', '1'), - ('554', '1953', '2006-02-16T02:30:53', '2005-06-18T06:38:22', '2005-06-27T07:16:22', '1'), - ('554', '1957', '2006-02-16T02:30:53', '2005-08-21T13:07:24', '2005-08-24T10:37:24', '1'), - ('554', '3145', '2006-02-16T02:30:53', '2005-08-20T20:47:43', '2005-08-26T19:37:43', '1'), - ('554', '3273', '2006-02-16T02:30:53', '2005-07-11T00:03:11', '2005-07-19T18:46:11', '1'), - ('554', '1076', '2006-02-16T02:30:53', '2005-08-17T19:17:54', '2005-08-26T00:41:54', '1'), - ('554', '2832', '2006-02-16T02:30:53', '2005-06-21T05:41:30', '2005-06-22T03:43:30', '1'), - ('554', '3480', '2006-02-16T02:30:53', '2005-08-17T02:28:22', '2005-08-25T00:08:22', '1'), - ('554', '2102', '2006-02-16T02:30:53', '2005-08-23T09:53:30', '2005-08-29T10:27:30', '1'), - ('554', '186', '2006-02-16T02:30:53', '2005-05-29T20:39:14', '2005-05-31T18:24:14', '1'), - ('403', '1195', '2006-02-16T02:30:53', '2005-08-19T00:20:36', '2005-08-28T02:43:36', '1'), - ('403', '123', '2006-02-16T02:30:53', '2005-07-06T11:45:53', '2005-07-13T15:27:53', '1'), - ('403', '2852', '2006-02-16T02:30:53', '2005-07-31T21:04:49', '2005-08-08T19:25:49', '1'), - ('403', '1707', '2006-02-16T02:30:53', '2005-08-01T12:44:17', '2005-08-08T06:53:17', '1'), - ('403', '2039', '2006-02-16T02:30:53', '2005-08-02T18:40:12', '2005-08-10T15:55:12', '1'), - ('403', '2124', '2006-02-16T02:30:53', '2005-06-15T03:35:16', '2005-06-18T03:11:16', '1'), - ('403', '2120', '2006-02-16T02:30:53', '2005-06-15T05:38:09', '2005-06-22T10:29:09', '1'), - ('403', '393', '2006-02-16T02:30:53', '2005-06-20T04:41:41', '2005-06-23T01:59:41', '1'), - ('403', '4113', '2006-02-16T02:30:53', '2005-08-02T21:28:03', '2005-08-08T18:24:03', '1'), - ('403', '234', '2006-02-16T02:30:53', '2005-05-28T03:17:57', '2005-05-29T06:33:57', '1'), - ('403', '2074', '2006-02-16T02:30:53', '2005-07-28T15:30:26', '2005-08-05T16:29:26', '1'), - ('403', '518', '2006-02-16T02:30:53', '2005-06-20T12:51:01', '2005-06-29T10:53:01', '1'), - ('403', '4532', '2006-02-16T02:30:53', '2005-06-21T11:38:45', '2005-06-26T17:18:45', '1'), - ('68', '3462', '2006-02-16T02:30:53', '2005-06-19T08:53:10', '2005-06-20T07:56:10', '1'), - ('68', '1742', '2006-02-16T02:30:53', '2005-08-18T22:22:03', '2005-08-22T04:01:03', '1'), - ('68', '1757', '2006-02-16T02:30:53', '2005-07-08T04:48:36', '2005-07-17T07:57:36', '1'), - ('68', '2731', '2006-02-16T02:30:53', '2005-07-31T21:13:47', '2005-08-10T00:44:47', '1'), - ('68', '2050', '2006-02-16T02:30:53', '2005-08-02T14:28:50', '2005-08-04T13:50:50', '1'), - ('68', '3936', '2006-02-16T02:30:53', '2005-06-19T10:53:42', '2005-06-20T11:41:42', '1'), - ('68', '1588', '2006-02-16T02:30:53', '2005-08-21T05:25:59', '2005-08-27T07:22:59', '1'), - ('68', '4209', '2006-02-16T02:30:53', '2005-07-06T15:05:50', '2005-07-12T12:56:50', '1'), - ('68', '3550', '2006-02-16T02:30:53', '2005-07-31T05:33:57', '2005-08-05T04:54:57', '1'), - ('68', '2811', '2006-02-16T02:30:53', '2005-07-06T17:41:42', '2005-07-08T14:17:42', '1'), - ('68', '2686', '2006-02-16T02:30:53', '2005-06-19T12:44:20', '2005-06-20T16:00:20', '1'), - ('167', '2887', '2006-02-16T02:30:53', '2005-05-27T07:31:20', '2005-06-04T04:46:20', '1'), - ('167', '3179', '2006-02-16T02:30:53', '2005-07-09T07:35:03', '2005-07-10T06:05:03', '1'), - ('167', '4009', '2006-02-16T02:30:53', '2005-08-22T08:11:24', '2005-08-28T08:49:24', '1'), - ('167', '269', '2006-02-16T02:30:53', '2005-07-29T00:02:22', '2005-07-31T04:05:22', '1'), - ('167', '3915', '2006-02-16T02:30:53', '2005-07-11T15:58:43', '2005-07-13T13:25:43', '1'), - ('167', '3858', '2006-02-16T02:30:53', '2005-07-31T02:28:39', '2005-08-05T22:10:39', '1'), - ('167', '2135', '2006-02-16T02:30:53', '2005-08-20T13:43:22', '2005-08-29T19:13:22', '1'), - ('167', '1256', '2006-02-16T02:30:53', '2005-07-28T00:08:36', '2005-07-28T18:13:36', '1'), - ('167', '2321', '2006-02-16T02:30:53', '2005-07-29T23:52:12', '2005-07-30T22:12:12', '1'), - ('167', '3961', '2006-02-16T02:30:53', '2005-08-22T10:07:52', '2005-08-23T04:45:52', '1'), - ('167', '1491', '2006-02-16T02:30:53', '2005-06-18T15:00:30', '2005-06-22T11:38:30', '1'), - ('167', '2502', '2006-02-16T02:30:53', '2005-07-06T00:56:03', '2005-07-14T02:27:03', '1'), - ('167', '1896', '2006-02-16T02:30:53', '2005-05-26T18:36:58', '2005-05-27T23:42:58', '1'), - ('225', '3018', '2006-02-16T02:30:53', '2005-08-01T21:48:03', '2005-08-10T19:16:03', '1'), - ('225', '1244', '2006-02-16T02:30:53', '2005-07-28T19:07:45', '2005-08-04T22:12:45', '1'), - ('225', '3779', '2006-02-16T02:30:53', '2005-07-27T14:31:24', '2005-07-31T16:19:24', '1'), - ('225', '1062', '2006-02-16T02:30:53', '2005-07-28T17:02:18', '2005-08-06T11:55:18', '1'), - ('225', '2361', '2006-02-16T02:30:53', '2005-07-12T04:38:32', '2005-07-13T03:54:32', '1'), - ('225', '4206', '2006-02-16T02:30:53', '2005-07-11T18:47:41', '2005-07-14T18:18:41', '1'), - ('225', '4295', '2006-02-16T02:30:53', '2005-07-27T21:11:44', '2005-08-03T02:17:44', '1'), - ('225', '2853', '2006-02-16T02:30:53', '2005-07-11T20:30:15', '2005-07-16T21:30:15', '1'), - ('225', '2840', '2006-02-16T02:30:53', '2005-08-02T18:23:01', '2005-08-05T17:59:01', '1'), - ('225', '1855', '2006-02-16T02:30:53', '2005-07-08T17:37:39', '2005-07-16T18:27:39', '1'), - ('12', '1122', '2006-02-16T02:30:53', '2005-06-20T19:33:52', '2005-06-29T18:20:52', '1'), - ('12', '1379', '2006-02-16T02:30:53', '2005-07-09T05:06:24', '2005-07-12T04:37:24', '1'), - ('12', '308', '2006-02-16T02:30:53', '2005-07-30T11:26:28', '2005-08-04T12:32:28', '1'), - ('12', '4577', '2006-02-16T02:30:53', '2005-05-31T11:10:17', '2005-06-01T11:15:17', '1'), - ('12', '3264', '2006-02-16T02:30:53', '2005-07-31T07:45:33', '2005-08-08T08:56:33', '1'), - ('12', '436', '2006-02-16T02:30:53', '2005-08-16T22:52:30', '2005-08-21T19:52:30', '1'), - ('12', '4127', '2006-02-16T02:30:53', '2005-08-18T16:58:48', '2005-08-19T19:36:48', '1'), - ('12', '3017', '2006-02-16T02:30:53', '2005-08-01T06:50:26', '2005-08-10T10:52:26', '1'), - ('12', '848', '2006-02-16T02:30:53', '2005-07-09T13:20:25', '2005-07-18T07:38:25', '1'), - ('12', '3357', '2006-02-16T02:30:53', '2005-07-06T17:57:54', '2005-07-13T12:30:54', '1'), - ('12', '4241', '2006-02-16T02:30:53', '2005-06-18T23:07:12', '2005-06-26T17:27:12', '1'), - ('12', '4358', '2006-02-16T02:30:53', '2005-07-09T05:00:39', '2005-07-09T23:08:39', '1'), - ('12', '1364', '2006-02-16T02:30:53', '2005-05-30T23:08:03', '2005-06-07T00:22:03', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['3633', '13516', '4000', '7471', '10130', '3426', '9951', '8051', '9831', '7147', '14692', '15855', '14404', '2760', '895', '11385', '13125', '8292', '10238', '6223', '3829', '7079', '9037', '4599', '9883', '11579', '2405', '12913', '15757', '6648', '1410', '6535', '7089', '2710', '12253', '5393', '14', '4358', '5409', '236', '3168', '6510', '15951', '12480', '2520', '6454', '8309', '6734', '700', '14854', '15432', '1755', '12575', '8687', '12618', '6093', '12337', '11467', '1114', '14784', '10558', '3218', '6449', '11141', '2486', '14872', '15897', '8615', '8927', '5975', '13503', '2937', '5717', '12272', '13541', '13339', '9377', '3491', '10200', '7449', '14887', '8268', '931', '15710', '3703', '14742', '11523', '11089', '2160', '4771', '1067', '2891', '4434', '8453', '2624', '6122', '7793', '483', '8914', '7589']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('95', '2978', '2006-02-16T02:30:53', '2005-07-06T06:43:26', '2005-07-10T04:54:26', '1'), - ('95', '4286', '2006-02-16T02:30:53', '2005-08-20T02:32:45', '2005-08-27T04:38:45', '1'), - ('95', '2122', '2006-02-16T02:30:53', '2005-07-06T23:58:37', '2005-07-08T21:43:37', '1'), - ('95', '1776', '2006-02-16T02:30:53', '2005-07-27T19:02:19', '2005-07-30T15:12:19', '1'), - ('95', '3964', '2006-02-16T02:30:53', '2005-07-31T21:44:30', '2005-08-04T17:06:30', '1'), - ('95', '3019', '2006-02-16T02:30:53', '2005-06-21T18:12:10', '2005-06-23T18:22:10', '1'), - ('95', '4412', '2006-02-16T02:30:53', '2005-07-31T15:51:16', '2005-08-03T14:54:16', '1'), - ('192', '4405', '2006-02-16T02:30:53', '2005-07-28T16:56:16', '2005-07-29T22:48:16', '1'), - ('192', '1961', '2006-02-16T02:30:53', '2005-07-31T11:59:32', '2005-08-04T07:14:32', '1'), - ('192', '990', '2006-02-16T02:30:53', '2005-07-27T07:02:34', '2005-08-01T02:16:34', '1'), - ('192', '1908', '2006-02-16T02:30:53', '2005-08-21T20:43:21', '2005-08-28T19:02:21', '1'), - ('192', '2528', '2006-02-16T02:30:53', '2005-08-23T15:59:01', '2005-08-29T20:26:01', '1'), - ('192', '3660', '2006-02-16T02:30:53', '2005-08-21T10:43:04', '2005-08-30T10:00:04', '1'), - ('192', '2602', '2006-02-16T02:30:53', '2005-06-19T17:16:33', '2005-06-26T14:58:33', '1'), - ('192', '2744', '2006-02-16T02:30:53', '2005-05-30T08:50:43', '2005-06-05T10:58:43', '1'), - ('192', '2478', '2006-02-16T02:30:53', '2005-08-02T18:23:11', '2005-08-06T12:37:11', '1'), - ('192', '3722', '2006-02-16T02:30:53', '2005-08-19T11:57:49', '2005-08-26T07:53:49', '1'), - ('192', '4003', '2006-02-16T02:30:53', '2005-07-29T02:29:36', '2005-08-07T08:06:36', '1'), - ('192', '561', '2006-02-16T02:30:53', '2005-08-01T02:08:05', '2005-08-02T01:52:05', '1'), - ('192', '3754', '2006-02-16T02:30:53', '2005-07-11T13:27:09', '2005-07-12T14:02:09', '1'), - ('356', '4126', '2006-02-16T02:30:53', '2005-07-06T15:59:40', '2005-07-11T10:29:40', '1'), - ('356', '4356', '2006-02-16T02:30:53', '2005-07-27T04:21:58', '2005-08-04T08:08:58', '1'), - ('356', '3833', '2006-02-16T02:30:53', '2005-07-30T06:23:14', '2005-08-08T06:25:14', '1'), - ('356', '2098', '2006-02-16T02:30:53', '2005-07-08T06:48:26', '2005-07-11T07:06:26', '1'), - ('356', '4286', '2006-02-16T02:30:53', '2005-07-31T13:53:37', '2005-08-06T15:45:37', '1'), - ('356', '4256', '2006-02-16T02:30:53', '2005-08-17T01:57:49', '2005-08-22T02:42:49', '1'), - ('356', '3604', '2006-02-16T02:30:53', '2005-06-18T16:36:38', '2005-06-21T19:15:38', '1'), - ('356', '3719', '2006-02-16T02:30:53', '2005-08-19T04:25:39', '2005-08-25T07:23:39', '1'), - ('356', '1308', '2006-02-16T02:30:53', '2005-08-23T12:47:16', '2005-08-29T17:19:16', '1'), - ('356', '718', '2006-02-16T02:30:53', '2005-07-12T10:46:30', '2005-07-14T16:15:30', '1'), - ('356', '809', '2006-02-16T02:30:53', '2005-06-15T16:59:46', '2005-06-21T16:38:46', '1'), - ('446', '1921', '2006-02-16T02:30:53', '2005-07-12T04:43:43', '2005-07-17T04:52:43', '1'), - ('446', '1380', '2006-02-16T02:30:53', '2005-07-27T04:43:42', '2005-07-30T10:04:42', '1'), - ('446', '2965', '2006-02-16T02:30:53', '2005-06-19T14:03:56', '2005-06-21T16:15:56', '1'), - ('446', '566', '2006-02-16T02:30:53', '2005-08-18T04:00:50', '2005-08-19T04:43:50', '1'), - ('446', '1417', '2006-02-16T02:30:53', '2005-07-09T19:35:12', '2005-07-11T14:00:12', '1'), - ('446', '2701', '2006-02-16T02:30:53', '2005-05-25T00:31:15', '2005-05-26T02:56:15', '1'), - ('446', '3136', '2006-02-16T02:30:53', '2005-07-07T19:27:04', '2005-07-14T23:46:04', '1'), - ('446', '3538', '2006-02-16T02:30:53', '2005-07-09T20:17:19', '2005-07-13T23:30:19', '1'), - ('446', '1265', '2006-02-16T02:30:53', '2005-05-26T11:53:49', '2005-05-28T13:55:49', '1'), - ('446', '2407', '2006-02-16T02:30:53', '2005-06-20T21:46:01', '2005-06-22T20:40:01', '1'), - ('446', '905', '2006-02-16T02:30:53', '2005-07-12T03:35:39', '2005-07-21T01:41:39', '1'), - ('446', '3018', '2006-02-16T02:30:53', '2005-08-23T19:10:32', '2005-08-29T14:17:32', '1'), - ('446', '3339', '2006-02-16T02:30:53', '2005-08-18T12:26:43', '2005-08-26T13:23:43', '1'), - ('446', '4181', '2006-02-16T02:30:53', '2005-06-19T00:29:00', '2005-06-28T04:36:00', '1'), - ('446', '4028', '2006-02-16T02:30:53', '2005-07-12T01:00:12', '2005-07-16T22:12:12', '1'), - ('446', '2250', '2006-02-16T02:30:53', '2005-07-29T03:22:20', '2005-08-01T06:30:20', '1'), - ('446', '2248', '2006-02-16T02:30:53', '2005-07-12T14:04:24', '2005-07-21T19:47:24', '1'), - ('117', '500', '2006-02-16T02:30:53', '2005-05-29T02:18:54', '2005-05-30T05:54:54', '1'), - ('117', '1989', '2006-02-16T02:30:53', '2005-08-22T02:26:47', '2005-08-23T05:53:47', '1'), - ('117', '1896', '2006-02-16T02:30:53', '2005-08-23T00:26:52', '2005-08-27T06:11:52', '1'), - ('117', '1721', '2006-02-16T02:30:53', '2005-06-16T17:18:44', '2005-06-17T16:54:44', '1'), - ('117', '3441', '2006-02-16T02:30:53', '2005-08-18T15:37:42', '2005-08-25T19:17:42', '1'), - ('117', '222', '2006-02-16T02:30:53', '2005-07-29T16:19:17', '2005-08-01T15:28:17', '1'), - ('117', '302', '2006-02-16T02:30:53', '2005-08-18T17:24:02', '2005-08-19T15:22:02', '1'), - ('117', '1868', '2006-02-16T02:30:53', '2005-07-11T05:52:50', '2005-07-20T11:45:50', '1'), - ('117', '4221', '2006-02-16T02:30:53', '2005-08-18T07:02:24', '2005-08-20T10:11:24', '1'), - ('117', '246', '2006-02-16T02:30:53', '2005-08-02T21:47:07', '2005-08-09T00:50:07', '1'), - ('117', '2287', '2006-02-16T02:30:53', '2005-05-31T16:00:33', '2005-06-01T19:05:33', '1'), - ('117', '441', '2006-02-16T02:30:53', '2005-08-22T00:23:13', '2005-08-28T03:42:13', '1'), - ('117', '4399', '2006-02-16T02:30:53', '2005-08-01T13:00:20', '2005-08-05T16:31:20', '1'), - ('117', '1828', '2006-02-16T02:30:53', '2005-06-21T01:38:09', '2005-06-23T02:00:09', '1'), - ('117', '4395', '2006-02-16T02:30:53', '2005-07-12T00:48:58', '2005-07-21T02:57:58', '1'), - ('15', '1614', '2006-02-16T02:30:53', '2005-08-02T09:29:11', '2005-08-04T07:50:11', '1'), - ('15', '268', '2006-02-16T02:30:53', '2005-06-18T21:26:56', '2005-06-22T23:42:56', '1'), - ('15', '962', '2006-02-16T02:30:53', '2005-08-22T03:23:41', '2005-08-29T23:25:41', '1'), - ('15', '1652', '2006-02-16T02:30:53', '2005-08-23T17:12:31', '2005-08-30T17:22:31', '1'), - ('15', '4453', '2006-02-16T02:30:53', '2005-07-29T13:36:01', '2005-08-03T13:15:01', '1'), - ('15', '272', '2006-02-16T02:30:53', '2005-07-30T02:13:31', '2005-08-01T01:34:31', '1'), - ('15', '2997', '2006-02-16T02:30:53', '2005-07-11T00:14:19', '2005-07-16T04:21:19', '1'), - ('15', '453', '2006-02-16T02:30:53', '2005-08-20T02:00:33', '2005-08-28T21:03:33', '1'), - ('15', '1998', '2006-02-16T02:30:53', '2005-06-20T05:15:37', '2005-06-27T02:45:37', '1'), - ('15', '529', '2006-02-16T02:30:53', '2005-07-10T11:02:03', '2005-07-13T13:00:03', '1'), - ('15', '1964', '2006-02-16T02:30:53', '2005-08-18T04:39:10', '2005-08-24T09:41:10', '1'), - ('15', '1363', '2006-02-16T02:30:53', '2005-08-20T03:41:41', '2005-08-24T23:14:41', '1'), - ('15', '1428', '2006-02-16T02:30:53', '2005-08-19T20:18:36', '2005-08-28T21:34:36', '1'), - ('421', '4164', '2006-02-16T02:30:53', '2005-07-30T19:12:18', '2005-08-05T19:38:18', '1'), - ('421', '1835', '2006-02-16T02:30:53', '2005-07-05T23:41:08', '2005-07-13T21:53:08', '1'), - ('421', '580', '2006-02-16T02:30:53', '2005-08-01T00:39:05', '2005-08-05T01:07:05', '1'), - ('421', '2084', '2006-02-16T02:30:53', '2005-07-27T18:17:41', '2005-08-01T18:52:41', '1'), - ('421', '56', '2006-02-16T02:30:53', '2005-08-22T04:04:31', '2005-08-31T02:30:31', '1'), - ('421', '4239', '2006-02-16T02:30:53', '2005-07-29T01:23:23', '2005-08-05T01:36:23', '1'), - ('421', '3384', '2006-02-16T02:30:53', '2005-05-30T12:53:01', '2005-05-31T14:28:01', '1'), - ('421', '1020', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('421', '4276', '2006-02-16T02:30:53', '2005-07-06T10:15:26', '2005-07-13T13:00:26', '1'), - ('421', '2988', '2006-02-16T02:30:53', '2005-08-21T22:39:01', '2005-08-26T00:17:01', '1'), - ('421', '1329', '2006-02-16T02:30:53', '2005-08-17T00:10:10', '2005-08-24T22:39:10', '1'), - ('421', '825', '2006-02-16T02:30:53', '2005-08-02T07:52:20', '2005-08-07T07:24:20', '1'), - ('32', '1644', '2006-02-16T02:30:53', '2005-06-17T23:39:11', '2005-06-22T20:04:11', '1'), - ('32', '1060', '2006-02-16T02:30:53', '2005-07-08T15:33:32', '2005-07-10T12:38:32', '1'), - ('32', '2345', '2006-02-16T02:30:53', '2005-05-31T09:12:13', '2005-06-01T06:15:13', '1'), - ('32', '343', '2006-02-16T02:30:53', '2005-06-20T02:02:05', '2005-06-25T02:45:05', '1'), - ('32', '1801', '2006-02-16T02:30:53', '2005-07-07T22:48:34', '2005-07-09T18:55:34', '1'), - ('32', '2907', '2006-02-16T02:30:53', '2005-07-29T07:46:29', '2005-07-30T07:07:29', '1'), - ('32', '3071', '2006-02-16T02:30:53', '2005-06-19T08:22:09', '2005-06-27T11:13:09', '1'), - ('32', '2212', '2006-02-16T02:30:53', '2005-07-11T07:58:07', '2005-07-16T09:52:07', '1'), - ('32', '24', '2006-02-16T02:30:53', '2005-07-28T07:26:14', '2005-08-03T07:45:14', '1'), - ('32', '1510', '2006-02-16T02:30:53', '2005-05-27T23:00:25', '2005-05-28T21:30:25', '1'), - ('32', '1347', '2006-02-16T02:30:53', '2005-07-30T01:42:03', '2005-08-04T03:53:03', '1'), - ('32', '1569', '2006-02-16T02:30:53', '2005-07-27T23:23:36', '2005-08-04T00:16:36', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['13736', '4899', '11831', '13499', '1111', '15811', '12644', '3177', '780', '9791', '14674', '15695', '9127', '14709', '6822', '13257', '5562', '8210', '9078', '15051', '8117', '3775', '13797', '13011', '4045', '13946', '8708', '1234', '453', '4553', '12356', '11862', '9375', '5993', '14970', '7128', '12622', '1686', '9310', '10102', '13081', '12706', '4113', '5685', '10481', '5075', '14022', '504', '15549', '211', '9517', '3749', '1656', '6208', '12085', '3701', '15682', '4122', '1838', '2438', '2530', '15816', '6580', '3205', '8997', '3117', '1610', '10796', '14816', '14526', '11180', '7113', '304', '1673', '940', '7662', '13294', '4491', '40', '13010', '3762', '13824', '7731', '8699', '15787', '12360', '7768', '7852', '7969', '7535', '15152', '15621', '10295', '992', '6403', '4143', '3181', '15455', '315', '842']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('32', '3369', '2006-02-16T02:30:53', '2005-08-20T10:31:23', '2005-08-28T06:51:23', '1'), - ('32', '414', '2006-02-16T02:30:53', '2005-07-08T20:37:11', '2005-07-10T21:53:11', '1'), - ('32', '4562', '2006-02-16T02:30:53', '2005-08-17T12:54:47', '2005-08-21T11:21:47', '1'), - ('300', '1893', '2006-02-16T02:30:53', '2005-08-20T01:52:30', '2005-08-28T04:57:30', '1'), - ('300', '1137', '2006-02-16T02:30:53', '2005-05-31T15:24:19', '2005-06-08T21:18:19', '1'), - ('300', '3487', '2006-02-16T02:30:53', '2005-08-23T14:43:46', '2005-08-27T16:43:46', '1'), - ('300', '1511', '2006-02-16T02:30:53', '2005-08-18T18:22:27', '2005-08-26T00:01:27', '1'), - ('300', '2546', '2006-02-16T02:30:53', '2005-06-20T22:32:44', '2005-06-22T23:01:44', '1'), - ('300', '1919', '2006-02-16T02:30:53', '2005-05-29T14:18:32', '2005-06-06T20:14:32', '1'), - ('300', '3642', '2006-02-16T02:30:53', '2005-07-31T10:35:22', '2005-08-03T05:34:22', '1'), - ('300', '572', '2006-02-16T02:30:53', '2005-08-21T20:01:34', '2005-08-27T18:33:34', '1'), - ('300', '2954', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('300', '4114', '2006-02-16T02:30:53', '2005-07-30T09:46:36', '2005-07-31T07:43:36', '1'), - ('300', '1856', '2006-02-16T02:30:53', '2005-08-21T21:07:59', '2005-08-31T02:19:59', '1'), - ('300', '1592', '2006-02-16T02:30:53', '2005-07-12T18:23:39', '2005-07-19T21:06:39', '1'), - ('300', '164', '2006-02-16T02:30:53', '2005-08-19T17:01:20', '2005-08-24T17:26:20', '1'), - ('300', '3604', '2006-02-16T02:30:53', '2005-07-10T03:17:42', '2005-07-12T03:26:42', '1'), - ('300', '3424', '2006-02-16T02:30:53', '2005-07-28T23:31:05', '2005-08-06T17:36:05', '1'), - ('300', '955', '2006-02-16T02:30:53', '2005-07-30T08:01:00', '2005-07-31T10:39:00', '1'), - ('300', '1419', '2006-02-16T02:30:53', '2005-08-22T10:08:50', '2005-08-28T10:23:50', '1'), - ('300', '1502', '2006-02-16T02:30:53', '2005-07-28T19:20:16', '2005-08-05T23:55:16', '1'), - ('300', '3696', '2006-02-16T02:30:53', '2005-07-06T13:27:33', '2005-07-09T10:27:33', '1'), - ('529', '2857', '2006-02-16T02:30:53', '2005-08-20T12:33:36', '2005-08-25T18:03:36', '1'), - ('529', '1998', '2006-02-16T02:30:53', '2005-08-19T07:53:58', '2005-08-24T12:00:58', '1'), - ('529', '1422', '2006-02-16T02:30:53', '2005-07-07T03:26:14', '2005-07-11T06:52:14', '1'), - ('529', '3564', '2006-02-16T02:30:53', '2005-08-20T17:44:32', '2005-08-28T19:19:32', '1'), - ('529', '4054', '2006-02-16T02:30:53', '2005-07-29T17:24:13', '2005-08-04T13:57:13', '1'), - ('529', '709', '2006-02-16T02:30:53', '2005-06-15T04:21:52', '2005-06-22T03:25:52', '1'), - ('529', '4425', '2006-02-16T02:30:53', '2005-05-27T19:31:16', '2005-05-29T23:06:16', '1'), - ('529', '2114', '2006-02-16T02:30:53', '2005-07-08T04:43:41', '2005-07-09T23:55:41', '1'), - ('529', '493', '2006-02-16T02:30:53', '2005-08-18T07:37:05', '2005-08-24T10:49:05', '1'), - ('529', '2604', '2006-02-16T02:30:53', '2005-08-17T13:54:53', '2005-08-19T10:48:53', '1'), - ('529', '3063', '2006-02-16T02:30:53', '2005-07-30T19:10:17', '2005-08-02T23:00:17', '1'), - ('529', '3588', '2006-02-16T02:30:53', '2005-07-11T01:06:41', '2005-07-14T19:19:41', '1'), - ('529', '536', '2006-02-16T02:30:53', '2005-08-22T06:49:29', '2005-08-29T08:47:29', '1'), - ('529', '143', '2006-02-16T02:30:53', '2005-07-27T06:14:36', '2005-08-02T05:18:36', '1'), - ('529', '278', '2006-02-16T02:30:53', '2005-08-18T17:34:11', '2005-08-24T16:10:11', '1'), - ('529', '3883', '2006-02-16T02:30:53', '2005-06-16T12:08:20', '2005-06-20T10:59:20', '1'), - ('529', '2957', '2006-02-16T02:30:53', '2005-07-30T16:57:09', '2005-08-03T18:14:09', '1'), - ('170', '4078', '2006-02-16T02:30:53', '2005-07-31T20:49:10', '2005-08-08T20:15:10', '1'), - ('170', '3077', '2006-02-16T02:30:53', '2005-08-19T10:19:06', '2005-08-20T05:49:06', '1'), - ('170', '1079', '2006-02-16T02:30:53', '2005-08-18T20:44:34', '2005-08-26T21:47:34', '1'), - ('170', '915', '2006-02-16T02:30:53', '2005-07-07T06:49:52', '2005-07-12T04:00:52', '1'), - ('170', '1462', '2006-02-16T02:30:53', '2005-07-10T09:01:38', '2005-07-17T10:58:38', '1'), - ('170', '229', '2006-02-16T02:30:53', '2005-08-01T10:17:26', '2005-08-09T08:50:26', '1'), - ('170', '903', '2006-02-16T02:30:53', '2005-07-09T05:12:07', '2005-07-12T08:29:07', '1'), - ('170', '4068', '2006-02-16T02:30:53', '2005-08-20T21:08:49', '2005-08-29T21:57:49', '1'), - ('170', '2086', '2006-02-16T02:30:53', '2005-05-28T02:05:34', '2005-05-30T23:03:34', '1'), - ('170', '369', '2006-02-16T02:30:53', '2005-08-23T04:27:06', '2005-09-01T06:07:06', '1'), - ('170', '4005', '2006-02-16T02:30:53', '2005-05-26T08:33:10', '2005-05-28T14:09:10', '1'), - ('170', '3299', '2006-02-16T02:30:53', '2005-07-31T00:41:23', '2005-08-02T23:08:23', '1'), - ('170', '1531', '2006-02-16T02:30:53', '2005-07-06T12:18:03', '2005-07-11T07:25:03', '1'), - ('31', '2253', '2006-02-16T02:30:53', '2005-06-16T10:05:40', '2005-06-22T06:26:40', '1'), - ('31', '672', '2006-02-16T02:30:53', '2005-07-11T12:34:56', '2005-07-19T15:17:56', '1'), - ('31', '600', '2006-02-16T02:30:53', '2005-08-17T22:17:09', '2005-08-21T01:45:09', '1'), - ('31', '3679', '2006-02-16T02:30:53', '2005-07-06T10:12:45', '2005-07-09T08:52:45', '1'), - ('31', '3293', '2006-02-16T02:30:53', '2005-08-23T09:37:34', '2005-08-31T06:01:34', '1'), - ('31', '273', '2006-02-16T02:30:53', '2005-07-07T07:15:35', '2005-07-14T12:10:35', '1'), - ('31', '513', '2006-02-16T02:30:53', '2005-06-16T23:20:16', '2005-06-20T02:34:16', '1'), - ('31', '184', '2006-02-16T02:30:53', '2005-06-18T18:34:21', '2005-06-19T16:50:21', '1'), - ('31', '4166', '2006-02-16T02:30:53', '2005-06-19T01:20:00', '2005-06-23T04:10:00', '1'), - ('31', '3628', '2006-02-16T02:30:53', '2005-08-23T14:58:06', '2005-08-28T13:30:06', '1'), - ('31', '1543', '2006-02-16T02:30:53', '2005-07-12T06:26:10', '2005-07-13T06:44:10', '1'), - ('31', '2964', '2006-02-16T02:30:53', '2005-06-21T00:38:47', '2005-06-21T22:49:47', '1'), - ('31', '850', '2006-02-16T02:30:53', '2005-07-30T04:53:56', '2005-08-03T07:10:56', '1'), - ('31', '2184', '2006-02-16T02:30:53', '2005-06-20T18:05:15', '2005-06-26T17:28:15', '1'), - ('534', '3551', '2006-02-16T02:30:53', '2005-06-16T06:36:33', '2005-06-19T07:12:33', '1'), - ('534', '2113', '2006-02-16T02:30:53', '2005-08-01T21:56:41', '2005-08-05T01:09:41', '1'), - ('534', '4086', '2006-02-16T02:30:53', '2005-08-22T01:15:51', '2005-08-28T04:11:51', '1'), - ('534', '1799', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('534', '3632', '2006-02-16T02:30:53', '2005-08-02T10:54:30', '2005-08-11T15:55:30', '1'), - ('534', '1963', '2006-02-16T02:30:53', '2005-07-27T05:41:20', '2005-07-30T04:50:20', '1'), - ('534', '1701', '2006-02-16T02:30:53', '2005-05-26T21:21:28', '2005-06-02T00:05:28', '1'), - ('534', '907', '2006-02-16T02:30:53', '2005-06-16T10:40:17', '2005-06-18T16:13:17', '1'), - ('534', '1278', '2006-02-16T02:30:53', '2005-05-30T15:01:02', '2005-06-01T18:26:02', '1'), - ('534', '1017', '2006-02-16T02:30:53', '2005-07-28T02:16:08', '2005-08-03T21:51:08', '1'), - ('534', '156', '2006-02-16T02:30:53', '2005-08-19T18:36:35', '2005-08-20T13:57:35', '1'), - ('413', '1168', '2006-02-16T02:30:53', '2005-07-08T01:30:46', '2005-07-11T03:12:46', '1'), - ('413', '2638', '2006-02-16T02:30:53', '2005-05-25T05:09:04', '2005-05-27T23:12:04', '1'), - ('413', '825', '2006-02-16T02:30:53', '2005-08-19T07:52:21', '2005-08-27T12:51:21', '1'), - ('413', '1941', '2006-02-16T02:30:53', '2005-07-06T12:52:49', '2005-07-12T11:41:49', '1'), - ('413', '2845', '2006-02-16T02:30:53', '2005-08-20T13:43:12', '2005-08-22T17:26:12', '1'), - ('413', '1533', '2006-02-16T02:30:53', '2005-07-28T05:01:18', '2005-07-29T02:22:18', '1'), - ('123', '4080', '2006-02-16T02:30:53', '2005-07-29T16:53:00', '2005-08-07T20:31:00', '1'), - ('123', '2932', '2006-02-16T02:30:53', '2005-08-23T13:51:57', '2005-08-27T17:06:57', '1'), - ('123', '929', '2006-02-16T02:30:53', '2005-08-18T07:46:35', '2005-08-26T12:01:35', '1'), - ('123', '2450', '2006-02-16T02:30:53', '2005-07-28T06:44:03', '2005-07-29T09:46:03', '1'), - ('123', '3462', '2006-02-16T02:30:53', '2005-07-28T09:34:29', '2005-07-30T05:48:29', '1'), - ('123', '2224', '2006-02-16T02:30:53', '2005-07-28T13:57:37', '2005-08-04T19:31:37', '1'), - ('123', '772', '2006-02-16T02:30:53', '2005-07-27T21:32:39', '2005-08-05T23:42:39', '1'), - ('123', '739', '2006-02-16T02:30:53', '2005-08-22T14:25:21', '2005-08-31T14:28:21', '1'), - ('123', '3832', '2006-02-16T02:30:53', '2005-08-23T07:13:43', '2005-08-29T08:19:43', '1'), - ('123', '2355', '2006-02-16T02:30:53', '2005-08-01T03:53:49', '2005-08-10T03:56:49', '1'), - ('123', '3572', '2006-02-16T02:30:53', '2005-05-30T23:47:56', '2005-06-05T19:01:56', '1'), - ('238', '1019', '2006-02-16T02:30:53', '2005-07-11T22:46:25', '2005-07-13T22:15:25', '1'), - ('238', '597', '2006-02-16T02:30:53', '2005-07-07T08:22:07', '2005-07-13T11:42:07', '1'), - ('238', '3473', '2006-02-16T02:30:53', '2005-06-20T22:51:02', '2005-06-27T21:21:02', '1'), - ('238', '3991', '2006-02-16T02:30:53', '2005-08-23T01:05:00', '2005-08-26T22:56:00', '1'), - ('238', '2847', '2006-02-16T02:30:53', '2005-05-26T23:12:55', '2005-05-29T23:33:55', '1'), - ('238', '2328', '2006-02-16T02:30:53', '2005-05-30T00:32:04', '2005-06-01T02:21:04', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['14343', '8382', '14312', '11632', '9841', '5878', '5922', '6024', '7618', '12219', '1096', '4545', '15260', '8406', '13486', '13129', '474', '10059', '15328', '892', '13549', '4582', '11363', '11058', '12321', '3291', '10855', '208', '2098', '9331', '4148', '1154', '5207', '4891', '14135', '5195', '2921', '15744', '8643', '5830', '13282', '13573', '12833', '1728', '4384', '12801', '5838', '11924', '5297', '4567', '8779', '13528', '13432', '13792', '4227', '7957', '9068', '5604', '7747', '10350', '12653', '10590', '12474', '7926', '12697', '10320', '359', '745', '11848', '4974', '12960', '3786', '14173', '13204', '2882', '6612', '11620', '6414', '7884', '12762', '16034', '11435', '7757', '861', '2911', '5662', '2420', '11317', '6828', '10938', '4142', '5609', '1691', '4128', '5325', '4258', '7203', '15822', '14255', '1956']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('238', '3769', '2006-02-16T02:30:53', '2005-08-21T08:40:21', '2005-08-29T03:06:21', '1'), - ('238', '317', '2006-02-16T02:30:53', '2005-07-29T05:33:21', '2005-08-03T03:38:21', '1'), - ('238', '1090', '2006-02-16T02:30:53', '2005-08-21T07:48:34', '2005-08-23T04:45:34', '1'), - ('238', '2551', '2006-02-16T02:30:53', '2005-08-17T04:29:32', '2005-08-22T03:44:32', '1'), - ('238', '4554', '2006-02-16T02:30:53', '2005-07-31T12:24:19', '2005-08-09T15:31:19', '1'), - ('271', '3805', '2006-02-16T02:30:53', '2005-07-10T19:09:57', '2005-07-16T17:22:57', '1'), - ('271', '1392', '2006-02-16T02:30:53', '2005-07-10T21:36:53', '2005-07-16T02:51:53', '1'), - ('271', '2923', '2006-02-16T02:30:53', '2005-07-11T02:16:47', '2005-07-12T05:54:47', '1'), - ('271', '774', '2006-02-16T02:30:53', '2005-07-28T00:24:14', '2005-08-01T04:35:14', '1'), - ('271', '2249', '2006-02-16T02:30:53', '2005-08-18T02:49:54', '2005-08-23T07:52:54', '1'), - ('271', '1066', '2006-02-16T02:30:53', '2005-05-31T13:30:49', '2005-06-09T13:53:49', '1'), - ('271', '3658', '2006-02-16T02:30:53', '2005-07-08T04:17:47', '2005-07-13T07:19:47', '1'), - ('274', '3135', '2006-02-16T02:30:53', '2005-08-22T18:24:16', '2005-08-24T21:26:16', '1'), - ('274', '2047', '2006-02-16T02:30:53', '2005-07-29T06:34:45', '2005-08-06T02:28:45', '1'), - ('274', '4460', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('274', '4455', '2006-02-16T02:30:53', '2005-08-19T12:05:04', '2005-08-26T10:24:04', '1'), - ('274', '1474', '2006-02-16T02:30:53', '2005-05-27T22:11:56', '2005-05-31T19:07:56', '1'), - ('274', '2020', '2006-02-16T02:30:53', '2005-07-31T19:20:49', '2005-08-03T14:39:49', '1'), - ('274', '4546', '2006-02-16T02:30:53', '2005-08-22T20:31:38', '2005-08-29T20:17:38', '1'), - ('274', '471', '2006-02-16T02:30:53', '2005-05-30T08:02:56', '2005-06-05T12:51:56', '1'), - ('274', '508', '2006-02-16T02:30:53', '2005-08-20T03:58:41', '2005-08-28T22:49:41', '1'), - ('274', '688', '2006-02-16T02:30:53', '2005-07-08T06:09:09', '2005-07-14T02:23:09', '1'), - ('274', '3190', '2006-02-16T02:30:53', '2005-08-02T17:48:39', '2005-08-05T17:20:39', '1'), - ('274', '3270', '2006-02-16T02:30:53', '2005-08-02T06:38:44', '2005-08-06T06:45:44', '1'), - ('274', '516', '2006-02-16T02:30:53', '2005-08-18T06:27:05', '2005-08-24T02:26:05', '1'), - ('274', '3866', '2006-02-16T02:30:53', '2005-06-21T06:55:36', '2005-06-29T03:41:36', '1'), - ('274', '1366', '2006-02-16T02:30:53', '2005-08-02T00:06:37', '2005-08-03T00:39:37', '1'), - ('274', '3669', '2006-02-16T02:30:53', '2005-05-26T08:10:22', '2005-05-27T03:55:22', '1'), - ('274', '3951', '2006-02-16T02:30:53', '2005-06-17T18:42:09', '2005-06-19T20:40:09', '1'), - ('274', '2248', '2006-02-16T02:30:53', '2005-07-30T17:46:50', '2005-08-01T19:03:50', '1'), - ('59', '260', '2006-02-16T02:30:53', '2005-07-07T08:36:58', '2005-07-09T05:51:58', '1'), - ('59', '2732', '2006-02-16T02:30:53', '2005-05-31T21:42:09', '2005-06-08T16:40:09', '1'), - ('59', '3496', '2006-02-16T02:30:53', '2005-07-09T11:15:44', '2005-07-17T06:00:44', '1'), - ('59', '1787', '2006-02-16T02:30:53', '2005-07-08T20:06:19', '2005-07-16T18:52:19', '1'), - ('59', '347', '2006-02-16T02:30:53', '2005-08-21T01:53:54', '2005-08-27T05:57:54', '1'), - ('59', '3399', '2006-02-16T02:30:53', '2005-07-09T10:39:31', '2005-07-18T13:54:31', '1'), - ('59', '1785', '2006-02-16T02:30:53', '2005-06-20T04:13:04', '2005-06-28T01:28:04', '1'), - ('59', '2364', '2006-02-16T02:30:53', '2005-08-23T12:15:51', '2005-08-31T17:19:51', '1'), - ('59', '381', '2006-02-16T02:30:53', '2005-07-29T14:45:23', '2005-08-04T18:42:23', '1'), - ('59', '2358', '2006-02-16T02:30:53', '2005-07-10T16:34:00', '2005-07-18T16:42:00', '1'), - ('59', '4373', '2006-02-16T02:30:53', '2005-08-19T18:08:18', '2005-08-24T14:08:18', '1'), - ('59', '3032', '2006-02-16T02:30:53', '2005-08-20T05:10:14', '2005-08-22T00:59:14', '1'), - ('59', '3723', '2006-02-16T02:30:53', '2005-08-19T01:42:28', '2005-08-26T20:13:28', '1'), - ('59', '1366', '2006-02-16T02:30:53', '2005-06-16T15:29:29', '2005-06-23T12:47:29', '1'), - ('59', '1178', '2006-02-16T02:30:53', '2005-07-07T20:46:45', '2005-07-16T21:54:45', '1'), - ('202', '960', '2006-02-16T02:30:53', '2005-08-19T00:27:19', '2005-08-26T03:10:19', '1'), - ('202', '1627', '2006-02-16T02:30:53', '2005-07-10T17:04:56', '2005-07-11T15:15:56', '1'), - ('202', '1711', '2006-02-16T02:30:53', '2005-08-17T16:22:05', '2005-08-26T12:34:05', '1'), - ('202', '3434', '2006-02-16T02:30:53', '2005-07-09T15:32:29', '2005-07-14T14:58:29', '1'), - ('202', '4073', '2006-02-16T02:30:53', '2005-07-08T05:20:04', '2005-07-10T01:35:04', '1'), - ('202', '3245', '2006-02-16T02:30:53', '2005-07-29T20:15:00', '2005-08-03T21:17:00', '1'), - ('202', '1847', '2006-02-16T02:30:53', '2005-08-20T03:03:31', '2005-08-26T03:09:31', '1'), - ('78', '2216', '2006-02-16T02:30:53', '2005-08-19T23:29:06', '2005-08-23T00:57:06', '1'), - ('78', '4157', '2006-02-16T02:30:53', '2005-08-20T12:21:37', '2005-08-27T14:28:37', '1'), - ('78', '4186', '2006-02-16T02:30:53', '2005-07-07T12:41:36', '2005-07-15T12:33:36', '1'), - ('78', '1623', '2006-02-16T02:30:53', '2005-07-28T13:34:08', '2005-08-05T07:58:08', '1'), - ('78', '2264', '2006-02-16T02:30:53', '2005-07-30T07:31:45', '2005-08-08T06:40:45', '1'), - ('78', '3702', '2006-02-16T02:30:53', '2005-07-10T05:05:00', '2005-07-12T08:04:00', '1'), - ('78', '1775', '2006-02-16T02:30:53', '2005-07-28T05:50:11', '2005-08-03T09:51:11', '1'), - ('78', '2067', '2006-02-16T02:30:53', '2005-08-01T05:30:05', '2005-08-05T09:59:05', '1'), - ('78', '3353', '2006-02-16T02:30:53', '2005-08-18T18:53:17', '2005-08-26T14:08:17', '1'), - ('78', '740', '2006-02-16T02:30:53', '2005-08-01T14:11:53', '2005-08-04T20:04:53', '1'), - ('78', '2240', '2006-02-16T02:30:53', '2005-08-18T12:10:03', '2005-08-27T17:05:03', '1'), - ('78', '180', '2006-02-16T02:30:53', '2005-07-28T12:13:02', '2005-08-05T08:54:02', '1'), - ('152', '2774', '2006-02-16T02:30:53', '2005-08-18T20:14:56', '2005-08-23T21:54:56', '1'), - ('152', '2298', '2006-02-16T02:30:53', '2005-08-01T04:39:26', '2005-08-08T06:01:26', '1'), - ('152', '1156', '2006-02-16T02:30:53', '2005-05-27T06:48:33', '2005-05-29T03:55:33', '1'), - ('152', '581', '2006-02-16T02:30:53', '2005-05-29T09:22:57', '2005-06-01T09:10:57', '1'), - ('152', '3680', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('152', '1071', '2006-02-16T02:30:53', '2005-07-09T00:00:36', '2005-07-13T21:03:36', '1'), - ('152', '3498', '2006-02-16T02:30:53', '2005-08-19T06:21:52', '2005-08-25T04:16:52', '1'), - ('152', '4508', '2006-02-16T02:30:53', '2005-07-06T14:00:41', '2005-07-13T16:49:41', '1'), - ('152', '3175', '2006-02-16T02:30:53', '2005-08-21T03:01:01', '2005-08-22T02:40:01', '1'), - ('152', '4524', '2006-02-16T02:30:53', '2005-08-19T15:02:48', '2005-08-24T18:07:48', '1'), - ('152', '205', '2006-02-16T02:30:53', '2005-06-20T01:26:26', '2005-06-21T19:33:26', '1'), - ('152', '235', '2006-02-16T02:30:53', '2005-07-12T08:28:33', '2005-07-17T06:25:33', '1'), - ('502', '3801', '2006-02-16T02:30:53', '2005-08-17T04:06:22', '2005-08-17T23:53:22', '1'), - ('502', '814', '2006-02-16T02:30:53', '2005-07-11T23:26:13', '2005-07-18T17:29:13', '1'), - ('502', '3871', '2006-02-16T02:30:53', '2005-07-28T10:37:24', '2005-07-31T10:31:24', '1'), - ('502', '3909', '2006-02-16T02:30:53', '2005-08-18T23:06:54', '2005-08-21T18:30:54', '1'), - ('502', '655', '2006-02-16T02:30:53', '2005-08-23T22:06:34', '2005-08-29T18:44:34', '1'), - ('502', '1625', '2006-02-16T02:30:53', '2005-08-02T20:14:23', '2005-08-05T20:40:23', '1'), - ('502', '3445', '2006-02-16T02:30:53', '2005-07-28T06:23:00', '2005-07-30T12:02:00', '1'), - ('502', '3711', '2006-02-16T02:30:53', '2005-05-30T02:48:32', '2005-06-06T05:43:32', '1'), - ('502', '3645', '2006-02-16T02:30:53', '2005-06-20T03:32:37', '2005-06-22T22:06:37', '1'), - ('502', '219', '2006-02-16T02:30:53', '2005-07-10T07:59:24', '2005-07-14T13:06:24', '1'), - ('502', '241', '2006-02-16T02:30:53', '2005-06-18T17:22:28', '2005-06-23T17:45:28', '1'), - ('502', '1889', '2006-02-16T02:30:53', '2005-08-02T16:08:52', '2005-08-08T21:12:52', '1'), - ('502', '874', '2006-02-16T02:30:53', '2005-07-12T18:38:51', '2005-07-14T20:10:51', '1'), - ('502', '3918', '2006-02-16T02:30:53', '2005-08-02T03:05:22', '2005-08-05T08:31:22', '1'), - ('492', '4045', '2006-02-16T02:30:53', '2005-07-07T08:19:45', '2005-07-08T13:55:45', '1'), - ('492', '1553', '2006-02-16T02:30:53', '2005-07-10T05:09:46', '2005-07-12T10:38:46', '1'), - ('492', '4438', '2006-02-16T02:30:53', '2005-06-16T12:24:28', '2005-06-24T08:24:28', '1'), - ('492', '3563', '2006-02-16T02:30:53', '2005-07-07T07:35:25', '2005-07-14T08:13:25', '1'), - ('492', '2703', '2006-02-16T02:30:53', '2005-07-09T16:35:47', '2005-07-10T11:52:47', '1'), - ('492', '1562', '2006-02-16T02:30:53', '2005-07-07T14:20:59', '2005-07-16T10:03:59', '1'), - ('492', '1685', '2006-02-16T02:30:53', '2005-07-27T09:01:23', '2005-08-04T14:14:23', '1'), - ('492', '3602', '2006-02-16T02:30:53', '2005-08-23T15:05:59', '2005-08-24T11:13:59', '1'), - ('492', '3125', '2006-02-16T02:30:53', '2005-08-21T05:51:37', '2005-08-29T10:00:37', '1'), - ('492', '1403', '2006-02-16T02:30:53', '2005-06-17T08:43:32', '2005-06-21T11:08:32', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['84', '15958', '1855', '12734', '12242', '14412', '15114', '7114', '14464', '7185', '8969', '7298', '12881', '1634', '8370', '12428', '15116', '5762', '9159', '11347', '10581', '6570', '8332', '828', '9745', '2076', '9317', '10372', '11313', '11689', '5863', '6173', '12720', '5900', '4224', '11323', '62', '7362', '14786', '7226', '15626', '14602', '7152', '11925', '11540', '10095', '7797', '15368', '11571', '6967', '1659', '11825', '6016', '511', '15023', '7568', '8171', '3486', '14571', '5589', '13991', '9249', '6646', '5978', '7668', '6929', '7283', '9706', '13201', '13095', '11447', '10128', '15930', '14886', '2926', '4740', '14011', '10041', '5402', '209', '13334', '14152', '3788', '10988', '8114', '14994', '2919', '831', '7586', '14226', '8564', '2820', '1065', '2338', '1350', '9903', '2491', '7945', '15840', '3373']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('492', '1829', '2006-02-16T02:30:53', '2005-05-25T12:36:30', '2005-05-29T18:33:30', '1'), - ('492', '4164', '2006-02-16T02:30:53', '2005-08-23T19:22:36', '2005-08-30T01:03:36', '1'), - ('492', '4457', '2006-02-16T02:30:53', '2005-06-17T00:54:58', '2005-06-20T19:29:58', '1'), - ('121', '3619', '2006-02-16T02:30:53', '2005-08-18T22:04:52', '2005-08-25T00:34:52', '1'), - ('121', '2095', '2006-02-16T02:30:53', '2005-08-18T03:37:31', '2005-08-25T06:50:31', '1'), - ('121', '212', '2006-02-16T02:30:53', '2005-08-21T11:02:09', '2005-08-29T06:44:09', '1'), - ('121', '2481', '2006-02-16T02:30:53', '2005-08-22T12:24:55', '2005-08-31T17:06:55', '1'), - ('121', '3892', '2006-02-16T02:30:53', '2005-07-27T05:42:13', '2005-07-29T01:59:13', '1'), - ('121', '2310', '2006-02-16T02:30:53', '2005-08-21T12:52:54', '2005-08-25T16:42:54', '1'), - ('121', '2340', '2006-02-16T02:30:53', '2005-07-27T08:23:54', '2005-07-30T09:50:54', '1'), - ('121', '2043', '2006-02-16T02:30:53', '2005-07-30T04:00:19', '2005-08-06T04:39:19', '1'), - ('121', '1653', '2006-02-16T02:30:53', '2005-07-27T12:45:14', '2005-07-30T07:02:14', '1'), - ('121', '1432', '2006-02-16T02:30:53', '2005-08-19T03:28:13', '2005-08-25T05:25:13', '1'), - ('121', '3990', '2006-02-16T02:30:53', '2005-06-16T08:16:05', '2005-06-17T04:49:05', '1'), - ('121', '1206', '2006-02-16T02:30:53', '2005-07-29T05:16:21', '2005-08-06T23:16:21', '1'), - ('121', '3735', '2006-02-16T02:30:53', '2005-08-18T10:24:21', '2005-08-24T05:12:21', '1'), - ('217', '518', '2006-02-16T02:30:53', '2005-08-22T12:35:40', '2005-08-23T17:58:40', '1'), - ('217', '1815', '2006-02-16T02:30:53', '2005-07-10T12:48:01', '2005-07-18T16:43:01', '1'), - ('217', '1234', '2006-02-16T02:30:53', '2005-07-30T11:16:37', '2005-08-03T10:32:37', '1'), - ('217', '195', '2006-02-16T02:30:53', '2005-08-02T17:18:07', '2005-08-05T12:30:07', '1'), - ('217', '2801', '2006-02-16T02:30:53', '2005-08-01T13:52:30', '2005-08-10T19:11:30', '1'), - ('217', '2082', '2006-02-16T02:30:53', '2005-07-12T05:50:31', '2005-07-13T09:58:31', '1'), - ('217', '1142', '2006-02-16T02:30:53', '2005-07-29T04:16:00', '2005-08-03T03:34:00', '1'), - ('217', '2468', '2006-02-16T02:30:53', '2005-05-29T22:14:55', '2005-05-30T17:22:55', '1'), - ('217', '3610', '2006-02-16T02:30:53', '2005-07-31T09:16:14', '2005-08-07T12:11:14', '1'), - ('217', '2242', '2006-02-16T02:30:53', '2005-06-17T16:43:47', '2005-06-24T11:12:47', '1'), - ('217', '4138', '2006-02-16T02:30:53', '2005-07-30T17:13:37', '2005-08-08T11:33:37', '1'), - ('419', '635', '2006-02-16T02:30:53', '2005-08-01T06:23:48', '2005-08-06T03:47:48', '1'), - ('419', '2689', '2006-02-16T02:30:53', '2005-08-02T16:02:51', '2005-08-03T14:54:51', '1'), - ('419', '2390', '2006-02-16T02:30:53', '2005-08-17T06:42:08', '2005-08-26T06:09:08', '1'), - ('419', '2557', '2006-02-16T02:30:53', '2005-07-10T18:25:23', '2005-07-15T23:49:23', '1'), - ('419', '4252', '2006-02-16T02:30:53', '2005-07-11T10:33:11', '2005-07-15T10:57:11', '1'), - ('419', '2676', '2006-02-16T02:30:53', '2005-08-18T21:28:42', '2005-08-25T18:02:42', '1'), - ('419', '1081', '2006-02-16T02:30:53', '2005-07-10T20:21:54', '2005-07-17T00:26:54', '1'), - ('419', '3659', '2006-02-16T02:30:53', '2005-07-07T12:24:21', '2005-07-10T11:48:21', '1'), - ('419', '3784', '2006-02-16T02:30:53', '2005-08-02T16:29:57', '2005-08-06T16:01:57', '1'), - ('419', '261', '2006-02-16T02:30:53', '2005-05-25T09:18:52', '2005-05-30T10:55:52', '1'), - ('419', '1902', '2006-02-16T02:30:53', '2005-07-27T14:58:27', '2005-08-01T11:51:27', '1'), - ('370', '2959', '2006-02-16T02:30:53', '2005-08-22T00:24:42', '2005-08-25T19:36:42', '1'), - ('370', '3507', '2006-02-16T02:30:53', '2005-07-27T09:47:53', '2005-08-01T08:24:53', '1'), - ('370', '640', '2006-02-16T02:30:53', '2005-08-23T07:25:34', '2005-08-28T11:01:34', '1'), - ('370', '3771', '2006-02-16T02:30:53', '2005-08-21T17:48:49', '2005-08-28T21:38:49', '1'), - ('370', '2338', '2006-02-16T02:30:53', '2005-07-27T07:15:01', '2005-08-05T04:50:01', '1'), - ('370', '1441', '2006-02-16T02:30:53', '2005-08-17T16:23:04', '2005-08-21T11:38:04', '1'), - ('370', '3385', '2006-02-16T02:30:53', '2005-08-17T00:48:03', '2005-08-25T03:46:03', '1'), - ('370', '4062', '2006-02-16T02:30:53', '2005-07-31T20:38:35', '2005-08-02T02:33:35', '1'), - ('370', '4180', '2006-02-16T02:30:53', '2005-07-28T07:41:07', '2005-07-31T04:13:07', '1'), - ('370', '1130', '2006-02-16T02:30:53', '2005-08-22T21:57:15', '2005-08-29T16:28:15', '1'), - ('296', '203', '2006-02-16T02:30:53', '2005-08-17T01:37:51', '2005-08-17T20:30:51', '1'), - ('296', '1145', '2006-02-16T02:30:53', '2005-07-27T00:16:31', '2005-08-03T22:19:31', '1'), - ('296', '1182', '2006-02-16T02:30:53', '2005-06-16T10:11:46', '2005-06-20T13:51:46', '1'), - ('296', '2656', '2006-02-16T02:30:53', '2005-08-17T12:43:30', '2005-08-20T15:25:30', '1'), - ('296', '651', '2006-02-16T02:30:53', '2005-07-11T02:04:45', '2005-07-17T22:22:45', '1'), - ('296', '3827', '2006-02-16T02:30:53', '2005-05-28T03:04:04', '2005-06-03T04:58:04', '1'), - ('296', '358', '2006-02-16T02:30:53', '2005-08-22T08:56:48', '2005-08-29T08:13:48', '1'), - ('296', '1578', '2006-02-16T02:30:53', '2005-07-27T22:38:53', '2005-07-29T00:51:53', '1'), - ('296', '3380', '2006-02-16T02:30:53', '2005-07-28T21:32:57', '2005-07-30T21:19:57', '1'), - ('296', '4067', '2006-02-16T02:30:53', '2005-07-05T23:29:55', '2005-07-13T19:54:55', '1'), - ('296', '2218', '2006-02-16T02:30:53', '2005-08-21T16:40:26', '2005-08-29T17:10:26', '1'), - ('296', '3673', '2006-02-16T02:30:53', '2005-07-10T04:22:58', '2005-07-10T23:13:58', '1'), - ('296', '1971', '2006-02-16T02:30:53', '2005-08-20T19:29:44', '2005-08-24T21:10:44', '1'), - ('296', '2015', '2006-02-16T02:30:53', '2005-07-30T14:15:02', '2005-08-05T13:02:02', '1'), - ('508', '4061', '2006-02-16T02:30:53', '2005-07-12T10:41:34', '2005-07-15T05:31:34', '1'), - ('508', '1720', '2006-02-16T02:30:53', '2005-07-11T00:16:54', '2005-07-19T18:55:54', '1'), - ('508', '3880', '2006-02-16T02:30:53', '2005-07-28T02:41:31', '2005-08-02T06:08:31', '1'), - ('508', '3339', '2006-02-16T02:30:53', '2005-07-26T22:59:19', '2005-08-03T22:40:19', '1'), - ('508', '3101', '2006-02-16T02:30:53', '2005-07-27T12:02:41', '2005-08-05T07:25:41', '1'), - ('508', '142', '2006-02-16T02:30:53', '2005-07-31T07:43:19', '2005-08-05T11:11:19', '1'), - ('508', '111', '2006-02-16T02:30:53', '2005-08-19T14:56:05', '2005-08-25T14:37:05', '1'), - ('508', '520', '2006-02-16T02:30:53', '2005-08-19T10:48:10', '2005-08-28T06:15:10', '1'), - ('508', '3868', '2006-02-16T02:30:53', '2005-08-02T20:36:25', '2005-08-07T18:52:25', '1'), - ('508', '2559', '2006-02-16T02:30:53', '2005-07-31T21:40:04', '2005-08-02T02:21:04', '1'), - ('379', '180', '2006-02-16T02:30:53', '2005-08-23T18:26:51', '2005-08-31T16:12:51', '1'), - ('379', '4330', '2006-02-16T02:30:53', '2005-08-22T03:59:01', '2005-08-23T01:22:01', '1'), - ('379', '1055', '2006-02-16T02:30:53', '2005-06-20T04:37:45', '2005-06-26T02:17:45', '1'), - ('379', '2559', '2006-02-16T02:30:53', '2005-07-08T13:30:35', '2005-07-14T18:43:35', '1'), - ('379', '1212', '2006-02-16T02:30:53', '2005-08-20T20:32:56', '2005-08-28T21:44:56', '1'), - ('379', '2994', '2006-02-16T02:30:53', '2005-07-31T19:01:02', '2005-08-07T21:32:02', '1'), - ('379', '4450', '2006-02-16T02:30:53', '2005-07-09T20:01:58', '2005-07-10T14:07:58', '1'), - ('379', '729', '2006-02-16T02:30:53', '2005-05-26T08:14:01', '2005-05-27T09:00:01', '1'), - ('379', '461', '2006-02-16T02:30:53', '2005-08-19T20:02:33', '2005-08-22T00:45:33', '1'), - ('379', '2561', '2006-02-16T02:30:53', '2005-08-21T02:23:50', '2005-08-25T06:05:50', '1'), - ('379', '1363', '2006-02-16T02:30:53', '2005-07-06T14:02:02', '2005-07-10T18:24:02', '1'), - ('509', '1157', '2006-02-16T02:30:53', '2005-08-02T04:38:17', '2005-08-09T00:09:17', '1'), - ('509', '815', '2006-02-16T02:30:53', '2005-07-28T19:14:06', '2005-08-05T13:16:06', '1'), - ('509', '1601', '2006-02-16T02:30:53', '2005-08-22T07:52:24', '2005-08-26T09:57:24', '1'), - ('509', '2835', '2006-02-16T02:30:53', '2005-06-20T04:10:16', '2005-06-27T06:34:16', '1'), - ('509', '3912', '2006-02-16T02:30:53', '2005-05-29T22:50:25', '2005-06-06T02:27:25', '1'), - ('316', '15', '2006-02-16T02:30:53', '2005-07-27T23:19:29', '2005-07-29T23:04:29', '1'), - ('316', '1793', '2006-02-16T02:30:53', '2005-08-21T04:55:37', '2005-08-24T04:32:37', '1'), - ('316', '2830', '2006-02-16T02:30:53', '2005-07-29T11:33:00', '2005-08-05T15:35:00', '1'), - ('316', '851', '2006-02-16T02:30:53', '2005-06-19T20:20:33', '2005-06-26T20:32:33', '1'), - ('316', '3379', '2006-02-16T02:30:53', '2005-05-31T08:54:56', '2005-06-08T09:21:56', '1'), - ('316', '3165', '2006-02-16T02:30:53', '2005-06-18T11:24:54', '2005-06-19T07:34:54', '1'), - ('316', '4261', '2006-02-16T02:30:53', '2005-06-15T12:50:25', '2005-06-23T11:35:25', '1'), - ('316', '1621', '2006-02-16T02:30:53', '2005-07-31T14:31:44', '2005-08-08T20:03:44', '1'), - ('316', '1779', '2006-02-16T02:30:53', '2005-06-18T22:01:31', '2005-06-26T02:46:31', '1'), - ('316', '3326', '2006-02-16T02:30:53', '2005-07-28T12:53:58', '2005-08-03T14:04:58', '1'), - ('316', '1901', '2006-02-16T02:30:53', '2005-08-23T15:34:49', '2005-08-24T16:54:49', '1'), - ('316', '2219', '2006-02-16T02:30:53', '2005-06-21T13:35:32', '2005-06-30T12:03:32', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['5618', '5544', '1317', '9508', '644', '2032', '13719', '7984', '7861', '10784', '100', '5117', '10762', '1805', '1949', '11819', '8742', '2592', '12822', '4114', '10172', '4398', '11938', '14151', '2204', '12548', '7527', '11876', '13834', '1842', '9185', '3243', '7495', '7789', '5232', '13016', '10229', '7771', '14897', '8440', '3625', '9941', '7448', '13161', '11618', '8817', '14614', '1627', '1229', '8423', '11257', '673', '459', '9598', '16044', '4184', '12026', '4527', '13221', '13417', '8768', '101', '11633', '6392', '3724', '6815', '5490', '939', '14413', '3078', '1089', '6835', '6716', '12373', '9030', '10344', '9912', '12152', '13235', '3292', '8411', '15314', '10381', '14068', '191', '15781', '9881', '11027', '8674', '12359', '5653', '9593', '15445', '11856', '12190', '4704', '12938', '1240', '388', '12708']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('316', '757', '2006-02-16T02:30:53', '2005-07-10T05:28:58', '2005-07-18T01:38:58', '1'), - ('316', '1014', '2006-02-16T02:30:53', '2005-07-10T02:48:07', '2005-07-17T01:08:07', '1'), - ('316', '3696', '2006-02-16T02:30:53', '2005-06-15T10:30:19', '2005-06-24T08:18:19', '1'), - ('316', '1204', '2006-02-16T02:30:53', '2005-07-31T00:22:39', '2005-08-04T05:40:39', '1'), - ('316', '4304', '2006-02-16T02:30:53', '2005-05-28T18:59:12', '2005-06-04T18:06:12', '1'), - ('316', '425', '2006-02-16T02:30:53', '2005-06-17T13:24:07', '2005-06-18T18:18:07', '1'), - ('208', '3547', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('208', '2893', '2006-02-16T02:30:53', '2005-07-28T14:27:51', '2005-08-04T17:34:51', '1'), - ('208', '1781', '2006-02-16T02:30:53', '2005-07-28T10:02:01', '2005-08-06T13:17:01', '1'), - ('208', '3494', '2006-02-16T02:30:53', '2005-08-01T21:24:28', '2005-08-09T19:23:28', '1'), - ('208', '2599', '2006-02-16T02:30:53', '2005-05-25T16:50:28', '2005-06-02T22:11:28', '1'), - ('208', '2284', '2006-02-16T02:30:53', '2005-07-09T07:11:22', '2005-07-15T08:44:22', '1'), - ('208', '1363', '2006-02-16T02:30:53', '2005-08-01T20:28:39', '2005-08-05T17:36:39', '1'), - ('208', '3962', '2006-02-16T02:30:53', '2005-06-16T20:36:00', '2005-06-17T16:27:00', '1'), - ('208', '1478', '2006-02-16T02:30:53', '2005-06-17T08:19:22', '2005-06-25T08:43:22', '1'), - ('208', '656', '2006-02-16T02:30:53', '2005-08-17T12:25:17', '2005-08-19T16:12:17', '1'), - ('208', '918', '2006-02-16T02:30:53', '2005-07-29T18:56:12', '2005-08-03T16:42:12', '1'), - ('208', '282', '2006-02-16T02:30:53', '2005-06-19T05:36:54', '2005-06-21T08:44:54', '1'), - ('426', '419', '2006-02-16T02:30:53', '2005-08-19T01:15:24', '2005-08-20T06:38:24', '1'), - ('426', '4109', '2006-02-16T02:30:53', '2005-07-07T06:51:12', '2005-07-15T01:36:12', '1'), - ('426', '2506', '2006-02-16T02:30:53', '2005-07-31T23:29:51', '2005-08-09T01:57:51', '1'), - ('426', '3628', '2006-02-16T02:30:53', '2005-07-07T21:18:44', '2005-07-10T22:45:44', '1'), - ('426', '3927', '2006-02-16T02:30:53', '2005-08-17T16:54:54', '2005-08-24T19:18:54', '1'), - ('426', '2785', '2006-02-16T02:30:53', '2005-08-21T02:23:25', '2005-08-30T07:08:25', '1'), - ('426', '1137', '2006-02-16T02:30:53', '2005-06-18T02:11:38', '2005-06-24T00:28:38', '1'), - ('426', '750', '2006-02-16T02:30:53', '2005-08-18T14:35:26', '2005-08-27T18:58:26', '1'), - ('426', '2124', '2006-02-16T02:30:53', '2005-07-27T21:14:28', '2005-08-05T21:08:28', '1'), - ('426', '3982', '2006-02-16T02:30:53', '2005-08-17T14:18:21', '2005-08-20T19:48:21', '1'), - ('426', '875', '2006-02-16T02:30:53', '2005-08-20T14:03:08', '2005-08-22T10:12:08', '1'), - ('426', '1472', '2006-02-16T02:30:53', '2005-06-16T23:45:59', '2005-06-26T05:31:59', '1'), - ('426', '2268', '2006-02-16T02:30:53', '2005-07-30T12:10:40', '2005-08-06T07:01:40', '1'), - ('426', '2556', '2006-02-16T02:30:53', '2005-06-21T03:00:11', '2005-06-25T21:53:11', '1'), - ('426', '3446', '2006-02-16T02:30:53', '2005-07-27T20:01:20', '2005-07-30T16:40:20', '1'), - ('426', '2837', '2006-02-16T02:30:53', '2005-07-28T07:22:07', '2005-08-06T10:47:07', '1'), - ('175', '3353', '2006-02-16T02:30:53', '2005-07-09T12:35:08', '2005-07-14T14:55:08', '1'), - ('175', '3095', '2006-02-16T02:30:53', '2005-08-19T07:57:14', '2005-08-23T03:29:14', '1'), - ('175', '3459', '2006-02-16T02:30:53', '2005-08-01T01:45:26', '2005-08-10T06:21:26', '1'), - ('175', '1003', '2006-02-16T02:30:53', '2005-07-28T06:52:12', '2005-07-30T12:48:12', '1'), - ('175', '1607', '2006-02-16T02:30:53', '2005-08-22T04:22:31', '2005-08-26T00:09:31', '1'), - ('175', '489', '2006-02-16T02:30:53', '2005-07-29T07:31:26', '2005-08-04T07:04:26', '1'), - ('175', '1133', '2006-02-16T02:30:53', '2005-07-06T06:12:52', '2005-07-12T07:37:52', '1'), - ('175', '1756', '2006-02-16T02:30:53', '2005-07-31T15:31:25', '2005-08-05T17:23:25', '1'), - ('175', '3584', '2006-02-16T02:30:53', '2005-07-27T18:06:30', '2005-07-29T15:43:30', '1'), - ('175', '986', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('175', '954', '2006-02-16T02:30:53', '2005-08-17T04:01:36', '2005-08-23T01:02:36', '1'), - ('175', '2716', '2006-02-16T02:30:53', '2005-07-29T22:09:08', '2005-08-01T19:07:08', '1'), - ('468', '3053', '2006-02-16T02:30:53', '2005-08-21T18:03:51', '2005-08-30T13:37:51', '1'), - ('468', '4135', '2006-02-16T02:30:53', '2005-06-16T07:51:09', '2005-06-24T02:24:09', '1'), - ('468', '2140', '2006-02-16T02:30:53', '2005-06-15T03:53:13', '2005-06-18T04:09:13', '1'), - ('468', '187', '2006-02-16T02:30:53', '2005-07-29T07:02:57', '2005-08-06T04:59:57', '1'), - ('468', '105', '2006-02-16T02:30:53', '2005-08-02T13:45:05', '2005-08-11T16:37:05', '1'), - ('468', '1769', '2006-02-16T02:30:53', '2005-05-28T22:07:30', '2005-06-01T23:42:30', '1'), - ('468', '597', '2006-02-16T02:30:53', '2005-05-27T20:00:04', '2005-05-29T22:47:04', '1'), - ('468', '1105', '2006-02-16T02:30:53', '2005-07-31T03:30:41', '2005-08-04T03:54:41', '1'), - ('468', '1312', '2006-02-16T02:30:53', '2005-08-23T22:24:39', '2005-08-25T04:08:39', '1'), - ('468', '1022', '2006-02-16T02:30:53', '2005-07-07T10:30:08', '2005-07-14T12:56:08', '1'), - ('468', '1568', '2006-02-16T02:30:53', '2005-08-17T20:00:10', '2005-08-26T01:54:10', '1'), - ('468', '2263', '2006-02-16T02:30:53', '2005-07-08T03:20:10', '2005-07-15T02:21:10', '1'), - ('468', '120', '2006-02-16T02:30:53', '2005-08-19T15:45:47', '2005-08-26T21:10:47', '1'), - ('468', '92', '2006-02-16T02:30:53', '2005-08-19T22:51:39', '2005-08-23T03:34:39', '1'), - ('468', '1601', '2006-02-16T02:30:53', '2005-07-29T19:43:02', '2005-08-03T23:36:02', '1'), - ('468', '617', '2006-02-16T02:30:53', '2005-05-25T17:17:04', '2005-05-31T19:47:04', '1'), - ('468', '1706', '2006-02-16T02:30:53', '2005-08-17T04:30:09', '2005-08-20T06:56:09', '1'), - ('468', '4406', '2006-02-16T02:30:53', '2005-07-11T22:25:19', '2005-07-16T04:24:19', '1'), - ('468', '3622', '2006-02-16T02:30:53', '2005-07-06T11:12:48', '2005-07-14T14:41:48', '1'), - ('468', '3236', '2006-02-16T02:30:53', '2005-07-12T18:14:10', '2005-07-17T14:16:10', '1'), - ('367', '3044', '2006-02-16T02:30:53', '2005-07-10T00:09:11', '2005-07-14T21:23:11', '1'), - ('367', '1314', '2006-02-16T02:30:53', '2005-05-30T14:49:34', '2005-06-01T19:00:34', '1'), - ('367', '50', '2006-02-16T02:30:53', '2005-08-21T11:06:33', '2005-08-29T16:10:33', '1'), - ('367', '3642', '2006-02-16T02:30:53', '2005-06-20T15:09:48', '2005-06-24T16:54:48', '1'), - ('367', '3784', '2006-02-16T02:30:53', '2005-05-31T11:38:29', '2005-06-02T08:06:29', '1'), - ('367', '1444', '2006-02-16T02:30:53', '2005-07-12T18:58:03', '2005-07-18T00:41:03', '1'), - ('367', '2783', '2006-02-16T02:30:53', '2005-07-12T13:34:58', '2005-07-19T15:09:58', '1'), - ('367', '777', '2006-02-16T02:30:53', '2005-08-18T08:07:25', '2005-08-27T03:41:25', '1'), - ('367', '2237', '2006-02-16T02:30:53', '2005-07-30T06:05:38', '2005-08-03T00:19:38', '1'), - ('367', '3673', '2006-02-16T02:30:53', '2005-08-01T05:18:23', '2005-08-06T05:20:23', '1'), - ('367', '3119', '2006-02-16T02:30:53', '2005-07-31T14:49:04', '2005-08-03T15:40:04', '1'), - ('367', '2797', '2006-02-16T02:30:53', '2005-08-18T00:21:35', '2005-08-22T02:51:35', '1'), - ('367', '3902', '2006-02-16T02:30:53', '2005-08-19T16:17:53', '2005-08-27T14:57:53', '1'), - ('412', '3288', '2006-02-16T02:30:53', '2005-06-21T06:59:11', '2005-06-23T07:11:11', '1'), - ('412', '3085', '2006-02-16T02:30:53', '2005-07-29T06:44:23', '2005-08-07T03:56:23', '1'), - ('412', '2754', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('412', '522', '2006-02-16T02:30:53', '2005-08-01T06:36:37', '2005-08-05T11:17:37', '1'), - ('412', '818', '2006-02-16T02:30:53', '2005-08-20T22:50:59', '2005-08-29T00:45:59', '1'), - ('412', '4365', '2006-02-16T02:30:53', '2005-05-26T06:14:06', '2005-05-28T05:33:06', '1'), - ('412', '4449', '2006-02-16T02:30:53', '2005-08-23T13:41:05', '2005-08-31T13:11:05', '1'), - ('412', '4209', '2006-02-16T02:30:53', '2005-07-31T13:50:38', '2005-08-06T08:58:38', '1'), - ('412', '571', '2006-02-16T02:30:53', '2005-08-02T05:47:10', '2005-08-05T23:51:10', '1'), - ('412', '1744', '2006-02-16T02:30:53', '2005-07-29T15:54:22', '2005-07-31T12:15:22', '1'), - ('28', '4172', '2006-02-16T02:30:53', '2005-08-18T07:44:05', '2005-08-19T02:26:05', '1'), - ('28', '919', '2006-02-16T02:30:53', '2005-07-10T07:21:27', '2005-07-16T01:58:27', '1'), - ('28', '1223', '2006-02-16T02:30:53', '2005-07-31T03:22:30', '2005-08-05T08:23:30', '1'), - ('28', '196', '2006-02-16T02:30:53', '2005-08-23T00:48:29', '2005-08-28T00:33:29', '1'), - ('28', '305', '2006-02-16T02:30:53', '2005-08-17T13:44:49', '2005-08-21T17:20:49', '1'), - ('28', '2464', '2006-02-16T02:30:53', '2005-08-18T01:54:44', '2005-08-27T04:32:44', '1'), - ('28', '2291', '2006-02-16T02:30:53', '2005-07-08T11:45:35', '2005-07-10T09:46:35', '1'), - ('28', '3987', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('28', '3841', '2006-02-16T02:30:53', '2005-06-15T04:58:07', '2005-06-17T23:56:07', '1'), - ('28', '434', '2006-02-16T02:30:53', '2005-05-27T10:37:27', '2005-05-30T05:45:27', '1'), - ('28', '3448', '2006-02-16T02:30:53', '2005-08-18T20:59:17', '2005-08-24T22:40:17', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['8901', '868', '4951', '7580', '2299', '12438', '14006', '9303', '14988', '6067', '3039', '14646', '14229', '2132', '14216', '11982', '13853', '10985', '1192', '15596', '8872', '8483', '6064', '15711', '13888', '6156', '11269', '2260', '11780', '11784', '14403', '2339', '12231', '12230', '2423', '5096', '15389', '3839', '6877', '13983', '8949', '11202', '9018', '5737', '7236', '13708', '11939', '6858', '15701', '3431', '1159', '571', '11926', '12535', '8534', '7882', '1200', '12915', '15526', '7628', '7601', '5902', '4909', '12304', '12672', '12952', '13458', '492', '3715', '5320', '8147', '6141', '2934', '1070', '8735', '5558', '8857', '11786', '4907', '967', '14436', '7688', '2306', '6844', '14615', '680', '14424', '1386', '13200', '7855', '14987', '720', '2508', '4089', '7613', '2053', '14814', '3842', '14706', '1540']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('28', '4392', '2006-02-16T02:30:53', '2005-07-30T01:07:12', '2005-08-02T06:34:12', '1'), - ('28', '3604', '2006-02-16T02:30:53', '2005-05-30T04:19:55', '2005-05-31T02:28:55', '1'), - ('28', '2766', '2006-02-16T02:30:53', '2005-07-08T22:58:21', '2005-07-16T18:58:21', '1'), - ('28', '338', '2006-02-16T02:30:53', '2005-07-27T23:07:40', '2005-08-05T02:17:40', '1'), - ('28', '4339', '2006-02-16T02:30:53', '2005-06-18T08:18:52', '2005-06-26T11:48:52', '1'), - ('186', '2043', '2006-02-16T02:30:53', '2005-08-18T10:42:52', '2005-08-25T11:42:52', '1'), - ('186', '2189', '2006-02-16T02:30:53', '2005-08-20T20:21:36', '2005-08-21T15:26:36', '1'), - ('186', '4299', '2006-02-16T02:30:53', '2005-07-30T16:35:59', '2005-08-03T18:31:59', '1'), - ('186', '2114', '2006-02-16T02:30:53', '2005-08-22T07:46:05', '2005-08-29T06:43:05', '1'), - ('186', '2097', '2006-02-16T02:30:53', '2005-07-11T04:34:49', '2005-07-16T09:33:49', '1'), - ('186', '4098', '2006-02-16T02:30:53', '2005-06-20T12:32:30', '2005-06-21T07:38:30', '1'), - ('186', '948', '2006-02-16T02:30:53', '2005-08-21T19:14:48', '2005-08-23T17:15:48', '1'), - ('186', '4479', '2006-02-16T02:30:53', '2005-08-21T04:57:15', '2005-08-26T10:00:15', '1'), - ('186', '2636', '2006-02-16T02:30:53', '2005-06-17T21:05:06', '2005-06-20T18:10:06', '1'), - ('186', '3763', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('186', '118', '2006-02-16T02:30:53', '2005-08-17T18:13:07', '2005-08-18T19:06:07', '1'), - ('186', '1680', '2006-02-16T02:30:53', '2005-08-20T14:47:02', '2005-08-26T20:32:02', '1'), - ('186', '2734', '2006-02-16T02:30:53', '2005-08-02T04:30:19', '2005-08-03T05:18:19', '1'), - ('186', '4134', '2006-02-16T02:30:53', '2005-06-15T01:18:39', '2005-06-19T22:46:39', '1'), - ('186', '3834', '2006-02-16T02:30:53', '2005-08-23T06:19:51', '2005-08-25T03:32:51', '1'), - ('186', '2669', '2006-02-16T02:30:53', '2005-07-30T00:13:54', '2005-08-01T18:34:54', '1'), - ('186', '2786', '2006-02-16T02:30:53', '2005-07-29T08:50:18', '2005-08-03T06:46:18', '1'), - ('297', '265', '2006-02-16T02:30:53', '2005-07-11T04:23:18', '2005-07-19T02:21:18', '1'), - ('297', '789', '2006-02-16T02:30:53', '2005-08-23T10:43:00', '2005-08-29T16:29:00', '1'), - ('297', '1943', '2006-02-16T02:30:53', '2005-08-20T15:39:42', '2005-08-28T13:41:42', '1'), - ('297', '302', '2006-02-16T02:30:53', '2005-07-11T09:45:48', '2005-07-15T04:51:48', '1'), - ('297', '2398', '2006-02-16T02:30:53', '2005-08-02T14:11:41', '2005-08-08T18:53:41', '1'), - ('297', '2773', '2006-02-16T02:30:53', '2005-06-18T05:38:36', '2005-06-20T08:08:36', '1'), - ('297', '2268', '2006-02-16T02:30:53', '2005-08-17T10:34:24', '2005-08-21T04:55:24', '1'), - ('297', '3101', '2006-02-16T02:30:53', '2005-08-17T10:48:05', '2005-08-19T06:47:05', '1'), - ('297', '3581', '2006-02-16T02:30:53', '2005-08-21T10:40:34', '2005-08-29T11:29:34', '1'), - ('297', '313', '2006-02-16T02:30:53', '2005-06-18T11:29:22', '2005-06-21T10:29:22', '1'), - ('231', '1115', '2006-02-16T02:30:53', '2005-08-18T03:11:44', '2005-08-24T03:26:44', '1'), - ('231', '1910', '2006-02-16T02:30:53', '2005-08-18T03:11:04', '2005-08-27T04:06:04', '1'), - ('231', '1744', '2006-02-16T02:30:53', '2005-06-18T17:32:08', '2005-06-21T11:58:08', '1'), - ('231', '490', '2006-02-16T02:30:53', '2005-07-09T06:08:23', '2005-07-14T11:36:23', '1'), - ('231', '2077', '2006-02-16T02:30:53', '2005-08-22T22:51:13', '2005-08-28T23:46:13', '1'), - ('231', '3230', '2006-02-16T02:30:53', '2005-07-06T16:30:30', '2005-07-11T19:00:30', '1'), - ('231', '3968', '2006-02-16T02:30:53', '2005-07-12T20:32:58', '2005-07-18T18:01:58', '1'), - ('231', '457', '2006-02-16T02:30:53', '2005-08-20T19:08:32', '2005-08-29T23:45:32', '1'), - ('231', '2876', '2006-02-16T02:30:53', '2005-07-30T03:17:02', '2005-08-08T07:38:02', '1'), - ('231', '3625', '2006-02-16T02:30:53', '2005-08-02T11:51:57', '2005-08-08T09:41:57', '1'), - ('218', '1982', '2006-02-16T02:30:53', '2005-07-30T05:28:40', '2005-08-07T01:34:40', '1'), - ('218', '1118', '2006-02-16T02:30:53', '2005-07-10T11:50:04', '2005-07-13T10:37:04', '1'), - ('218', '3004', '2006-02-16T02:30:53', '2005-07-27T10:09:39', '2005-08-03T16:05:39', '1'), - ('218', '2236', '2006-02-16T02:30:53', '2005-08-20T09:34:07', '2005-08-26T10:17:07', '1'), - ('516', '3305', '2006-02-16T02:30:53', '2005-08-17T16:55:57', '2005-08-24T21:36:57', '1'), - ('516', '1095', '2006-02-16T02:30:53', '2005-07-12T19:53:51', '2005-07-19T14:12:51', '1'), - ('516', '2942', '2006-02-16T02:30:53', '2005-08-23T10:22:21', '2005-08-24T10:52:21', '1'), - ('516', '133', '2006-02-16T02:30:53', '2005-06-21T18:46:48', '2005-06-26T23:08:48', '1'), - ('516', '4395', '2006-02-16T02:30:53', '2005-06-14T22:55:13', '2005-06-17T02:11:13', '1'), - ('516', '4250', '2006-02-16T02:30:53', '2005-05-28T10:17:41', '2005-06-05T07:56:41', '1'), - ('516', '2111', '2006-02-16T02:30:53', '2005-08-17T16:25:02', '2005-08-22T11:36:02', '1'), - ('516', '2944', '2006-02-16T02:30:53', '2005-08-18T14:05:22', '2005-08-25T16:35:22', '1'), - ('516', '4029', '2006-02-16T02:30:53', '2005-07-29T10:30:13', '2005-08-02T04:47:13', '1'), - ('516', '3922', '2006-02-16T02:30:53', '2005-07-28T10:33:42', '2005-07-29T13:49:42', '1'), - ('516', '3329', '2006-02-16T02:30:53', '2005-06-15T01:59:51', '2005-06-21T21:33:51', '1'), - ('516', '2651', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('516', '2892', '2006-02-16T02:30:53', '2005-08-23T03:44:30', '2005-08-30T08:19:30', '1'), - ('516', '1240', '2006-02-16T02:30:53', '2005-07-28T00:58:04', '2005-08-03T19:16:04', '1'), - ('228', '903', '2006-02-16T02:30:53', '2005-07-27T23:48:15', '2005-07-29T02:45:15', '1'), - ('228', '2727', '2006-02-16T02:30:53', '2005-07-10T20:31:24', '2005-07-11T20:50:24', '1'), - ('228', '1451', '2006-02-16T02:30:53', '2005-07-08T21:07:24', '2005-07-10T22:34:24', '1'), - ('228', '1381', '2006-02-16T02:30:53', '2005-08-18T05:44:29', '2005-08-24T04:31:29', '1'), - ('228', '1722', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('228', '2460', '2006-02-16T02:30:53', '2005-08-19T06:00:52', '2005-08-20T02:17:52', '1'), - ('228', '4223', '2006-02-16T02:30:53', '2005-08-20T00:35:30', '2005-08-21T20:51:30', '1'), - ('228', '1999', '2006-02-16T02:30:53', '2005-05-28T00:24:58', '2005-05-28T22:34:58', '1'), - ('228', '4456', '2006-02-16T02:30:53', '2005-07-06T10:51:48', '2005-07-11T06:08:48', '1'), - ('228', '3140', '2006-02-16T02:30:53', '2005-07-09T16:23:32', '2005-07-18T18:16:32', '1'), - ('228', '628', '2006-02-16T02:30:53', '2005-07-28T20:37:56', '2005-07-30T18:26:56', '1'), - ('228', '2279', '2006-02-16T02:30:53', '2005-07-11T08:52:16', '2005-07-17T03:00:16', '1'), - ('228', '697', '2006-02-16T02:30:53', '2005-06-20T05:05:53', '2005-06-22T02:44:53', '1'), - ('228', '3170', '2006-02-16T02:30:53', '2005-05-31T09:39:56', '2005-06-05T10:23:56', '1'), - ('570', '2881', '2006-02-16T02:30:53', '2005-07-29T18:28:54', '2005-08-03T12:43:54', '2'), - ('96', '1123', '2006-02-16T02:30:53', '2005-07-10T03:12:08', '2005-07-14T03:09:08', '2'), - ('477', '1348', '2006-02-16T02:30:53', '2005-07-29T23:44:22', '2005-07-31T21:32:22', '2'), - ('435', '1487', '2006-02-16T02:30:53', '2005-08-17T10:57:40', '2005-08-24T06:48:40', '2'), - ('209', '1206', '2006-02-16T02:30:53', '2005-07-08T21:01:41', '2005-07-13T02:23:41', '2'), - ('330', '1954', '2006-02-16T02:30:53', '2005-05-30T19:12:06', '2005-06-09T00:02:06', '2'), - ('560', '3473', '2006-02-16T02:30:53', '2005-08-21T11:48:27', '2005-08-25T15:49:27', '2'), - ('491', '1179', '2006-02-16T02:30:53', '2005-07-28T03:20:47', '2005-08-06T06:07:47', '2'), - ('477', '208', '2006-02-16T02:30:53', '2005-06-18T08:33:23', '2005-06-27T10:01:23', '2'), - ('482', '3211', '2006-02-16T02:30:53', '2005-07-12T19:14:53', '2005-07-18T16:07:53', '2'), - ('171', '2332', '2006-02-16T02:30:53', '2005-08-21T18:06:32', '2005-08-30T13:19:32', '2'), - ('482', '4147', '2006-02-16T02:30:53', '2005-05-28T23:27:26', '2005-06-02T02:28:26', '2'), - ('489', '2535', '2006-02-16T02:30:53', '2005-08-21T11:24:11', '2005-08-29T13:13:11', '2'), - ('322', '1296', '2006-02-16T02:30:53', '2005-06-15T15:38:58', '2005-06-20T16:28:58', '2'), - ('577', '2746', '2006-02-16T02:30:53', '2005-08-19T14:55:58', '2005-08-27T11:35:58', '2'), - ('288', '2474', '2006-02-16T02:30:53', '2005-07-28T09:43:02', '2005-07-30T12:57:02', '2'), - ('138', '1513', '2006-02-16T02:30:53', '2005-08-22T07:41:08', '2005-08-24T03:15:08', '2'), - ('480', '3687', '2006-02-16T02:30:53', '2005-05-29T05:17:30', '2005-06-06T02:47:30', '2'), - ('476', '4322', '2006-02-16T02:30:53', '2005-06-18T23:43:58', '2005-06-20T19:26:58', '2'), - ('102', '3431', '2006-02-16T02:30:53', '2005-07-07T05:45:59', '2005-07-16T07:34:59', '2'), - ('202', '4253', '2006-02-16T02:30:53', '2005-07-28T00:13:58', '2005-08-06T05:36:58', '2'), - ('521', '4279', '2006-02-16T02:30:53', '2005-06-17T15:19:34', '2005-06-19T10:06:34', '2'), - ('250', '3109', '2006-02-16T02:30:53', '2005-08-22T01:12:14', '2005-08-27T23:24:14', '2'), - ('583', '3119', '2006-02-16T02:30:53', '2005-07-06T16:34:32', '2005-07-08T11:55:32', '2'), - ('589', '4494', '2006-02-16T02:30:53', '2005-08-21T21:04:42', '2005-08-22T19:55:42', '2'), - ('586', '2707', '2006-02-16T02:30:53', '2005-06-16T01:14:56', '2005-06-20T23:31:56', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['13111', '5505', '2308', '10573', '15441', '1330', '3560', '11111', '3338', '15950', '12305', '6659', '2698', '10899', '675', '3064', '2121', '6273', '9462', '14468', '1623', '13936', '12956', '958', '12034', '10518', '14662', '12926', '9386', '12412', '13304', '8212', '9374', '3298', '7320', '14989', '653', '4104', '13416', '5567', '9470', '44', '3895', '15143', '5178', '9888', '13515', '7335', '10587', '3096', '4986', '3073', '5333', '5518', '4953', '9996', '6226', '5560', '8659', '3128', '10806', '9674', '9567', '8198', '6293', '8354', '8803', '7315', '1050', '12106', '15007', '9587', '16014', '57', '1158', '4480', '4499', '11746', '14018', '13865', '14470', '13131', '3945', '7847', '2752', '13652', '6307', '11776', '7043', '2240', '8750', '15276', '8078', '2706', '7555', '8348', '5435', '6087', '503', '8793']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('26', '580', '2006-02-16T02:30:53', '2005-08-19T11:25:10', '2005-08-21T05:52:10', '2'), - ('253', '896', '2006-02-16T02:30:53', '2005-07-10T00:38:48', '2005-07-12T03:12:48', '2'), - ('1', '197', '2006-02-16T02:30:53', '2005-06-18T08:41:48', '2005-06-22T03:36:48', '2'), - ('585', '4252', '2006-02-16T02:30:53', '2005-08-01T13:27:24', '2005-08-04T15:09:24', '2'), - ('422', '258', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('587', '1219', '2006-02-16T02:30:53', '2005-06-15T11:29:17', '2005-06-24T13:36:17', '2'), - ('592', '888', '2006-02-16T02:30:53', '2005-07-06T02:51:37', '2005-07-10T01:35:37', '2'), - ('378', '334', '2006-02-16T02:30:53', '2005-08-02T08:21:27', '2005-08-06T07:48:27', '2'), - ('171', '2097', '2006-02-16T02:30:53', '2005-06-21T10:27:31', '2005-06-30T14:15:31', '2'), - ('280', '1374', '2006-02-16T02:30:53', '2005-08-23T19:09:39', '2005-08-31T17:03:39', '2'), - ('534', '4463', '2006-02-16T02:30:53', '2005-08-18T05:46:29', '2005-08-22T11:14:29', '2'), - ('134', '2285', '2006-02-16T02:30:53', '2005-07-12T11:18:05', '2005-07-16T16:45:05', '2'), - ('420', '3900', '2006-02-16T02:30:53', '2005-06-19T13:29:11', '2005-06-20T07:31:11', '2'), - ('29', '859', '2006-02-16T02:30:53', '2005-08-02T01:30:21', '2005-08-06T05:01:21', '2'), - ('338', '1273', '2006-02-16T02:30:53', '2005-05-28T22:22:44', '2005-06-01T02:57:44', '2'), - ('276', '2624', '2006-02-16T02:30:53', '2005-06-20T13:53:13', '2005-06-25T16:33:13', '2'), - ('467', '141', '2006-02-16T02:30:53', '2005-06-17T20:38:54', '2005-06-22T23:06:54', '2'), - ('152', '2403', '2006-02-16T02:30:53', '2005-07-11T16:08:41', '2005-07-14T16:41:41', '2'), - ('192', '4090', '2006-02-16T02:30:53', '2005-07-30T22:30:44', '2005-08-09T03:54:44', '2'), - ('224', '4168', '2006-02-16T02:30:53', '2005-08-21T13:07:10', '2005-08-30T19:05:10', '2'), - ('378', '4485', '2006-02-16T02:30:53', '2005-06-16T07:48:50', '2005-06-17T03:53:50', '2'), - ('364', '1731', '2006-02-16T02:30:53', '2005-08-20T17:22:35', '2005-08-23T20:07:35', '2'), - ('241', '3613', '2006-02-16T02:30:53', '2005-08-19T06:06:26', '2005-08-28T08:37:26', '2'), - ('186', '548', '2006-02-16T02:30:53', '2005-05-30T17:58:03', '2005-06-01T19:17:03', '2'), - ('321', '834', '2006-02-16T02:30:53', '2005-08-17T20:15:31', '2005-08-24T15:46:31', '2'), - ('556', '4444', '2006-02-16T02:30:53', '2005-08-01T11:44:08', '2005-08-07T07:58:08', '2'), - ('403', '2969', '2006-02-16T02:30:53', '2005-08-21T19:45:27', '2005-08-23T14:44:27', '2'), - ('336', '23', '2006-02-16T02:30:53', '2005-08-19T05:00:16', '2005-08-26T06:12:16', '2'), - ('189', '1123', '2006-02-16T02:30:53', '2005-07-30T19:26:21', '2005-08-05T21:00:21', '2'), - ('75', '1578', '2006-02-16T02:30:53', '2005-08-18T09:49:52', '2005-08-23T12:32:52', '2'), - ('405', '2979', '2006-02-16T02:30:53', '2005-08-19T18:56:32', '2005-08-23T20:04:32', '2'), - ('159', '1305', '2006-02-16T02:30:53', '2005-07-28T23:37:23', '2005-08-04T04:33:23', '2'), - ('302', '103', '2006-02-16T02:30:53', '2005-07-30T19:10:03', '2005-08-06T21:54:03', '2'), - ('492', '444', '2006-02-16T02:30:53', '2005-06-21T07:09:44', '2005-06-30T11:26:44', '2'), - ('241', '4348', '2006-02-16T02:30:53', '2005-07-27T13:33:35', '2005-07-31T13:22:35', '2'), - ('58', '1431', '2006-02-16T02:30:53', '2005-08-22T07:47:07', '2005-08-26T04:42:07', '2'), - ('327', '126', '2006-02-16T02:30:53', '2005-05-28T20:12:20', '2005-06-04T14:44:20', '2'), - ('338', '1066', '2006-02-16T02:30:53', '2005-07-07T06:25:41', '2005-07-13T04:18:41', '2'), - ('204', '1075', '2006-02-16T02:30:53', '2005-08-19T22:48:48', '2005-08-21T22:09:48', '2'), - ('147', '1616', '2006-02-16T02:30:53', '2005-07-10T03:36:46', '2005-07-15T23:22:46', '2'), - ('566', '3908', '2006-02-16T02:30:53', '2005-07-30T23:01:31', '2005-08-07T01:35:31', '2'), - ('207', '3098', '2006-02-16T02:30:53', '2005-05-25T05:53:23', '2005-05-29T10:56:23', '2'), - ('584', '145', '2006-02-16T02:30:53', '2005-07-06T19:04:24', '2005-07-15T17:48:24', '2'), - ('274', '1519', '2006-02-16T02:30:53', '2005-08-22T13:46:24', '2005-08-25T09:47:24', '2'), - ('167', '1750', '2006-02-16T02:30:53', '2005-07-09T09:59:52', '2005-07-18T13:01:52', '2'), - ('5', '4400', '2006-02-16T02:30:53', '2005-07-31T14:00:53', '2005-08-08T18:51:53', '2'), - ('194', '3438', '2006-02-16T02:30:53', '2005-08-20T02:29:47', '2005-08-23T08:12:47', '2'), - ('219', '1219', '2006-02-16T02:30:53', '2005-07-27T14:06:50', '2005-08-05T18:27:50', '2'), - ('521', '3000', '2006-02-16T02:30:53', '2005-08-01T14:03:38', '2005-08-08T19:59:38', '2'), - ('79', '3851', '2006-02-16T02:30:53', '2005-06-20T16:17:56', '2005-06-24T10:17:56', '2'), - ('589', '3517', '2006-02-16T02:30:53', '2005-07-09T00:44:33', '2005-07-09T19:45:33', '2'), - ('471', '3164', '2006-02-16T02:30:53', '2005-06-20T14:33:26', '2005-06-26T08:42:26', '2'), - ('419', '2142', '2006-02-16T02:30:53', '2005-07-09T16:59:38', '2005-07-16T17:23:38', '2'), - ('451', '3340', '2006-02-16T02:30:53', '2005-07-10T01:15:11', '2005-07-18T19:28:11', '2'), - ('168', '2460', '2006-02-16T02:30:53', '2005-07-08T23:09:48', '2005-07-11T02:08:48', '2'), - ('104', '3271', '2006-02-16T02:30:53', '2005-07-31T17:32:03', '2005-08-06T16:17:03', '2'), - ('134', '2758', '2006-02-16T02:30:53', '2005-07-11T13:48:11', '2005-07-15T17:18:11', '2'), - ('231', '720', '2006-02-16T02:30:53', '2005-07-10T03:13:24', '2005-07-19T06:03:24', '2'), - ('168', '558', '2006-02-16T02:30:53', '2005-07-29T15:26:31', '2005-08-06T19:05:31', '2'), - ('543', '189', '2006-02-16T02:30:53', '2005-06-20T18:41:47', '2005-06-24T20:54:47', '2'), - ('89', '3553', '2006-02-16T02:30:53', '2005-08-01T22:25:29', '2005-08-04T18:46:29', '2'), - ('297', '3213', '2006-02-16T02:30:53', '2005-07-31T06:36:53', '2005-08-06T02:50:53', '2'), - ('37', '3688', '2006-02-16T02:30:53', '2005-07-31T02:36:11', '2005-08-07T01:19:11', '2'), - ('356', '1767', '2006-02-16T02:30:53', '2005-07-28T23:08:05', '2005-08-06T00:43:05', '2'), - ('471', '4260', '2006-02-16T02:30:53', '2005-07-11T17:24:57', '2005-07-13T18:45:57', '2'), - ('579', '4476', '2006-02-16T02:30:53', '2005-07-29T04:56:26', '2005-08-01T08:04:26', '2'), - ('86', '2814', '2006-02-16T02:30:53', '2005-07-29T21:26:24', '2005-08-06T18:05:24', '2'), - ('208', '974', '2006-02-16T02:30:53', '2005-07-27T13:14:56', '2005-08-03T08:44:56', '2'), - ('303', '726', '2006-02-16T02:30:53', '2005-05-31T07:01:27', '2005-06-03T07:50:27', '2'), - ('465', '3234', '2006-02-16T02:30:53', '2005-08-17T22:55:32', '2005-08-19T23:55:32', '2'), - ('165', '3692', '2006-02-16T02:30:53', '2005-08-22T08:21:21', '2005-08-27T04:44:21', '2'), - ('235', '2966', '2006-02-16T02:30:53', '2005-07-31T03:10:30', '2005-08-06T06:54:30', '2'), - ('532', '3322', '2006-02-16T02:30:53', '2005-08-23T21:18:31', '2005-08-31T17:28:31', '2'), - ('6', '3938', '2006-02-16T02:30:53', '2005-05-25T08:43:32', '2005-05-29T06:42:32', '2'), - ('416', '1632', '2006-02-16T02:30:53', '2005-06-14T22:53:33', '2005-06-18T21:37:33', '2'), - ('296', '4457', '2006-02-16T02:30:53', '2005-07-08T00:56:30', '2005-07-10T20:52:30', '2'), - ('199', '851', '2006-02-16T02:30:53', '2005-07-08T02:08:48', '2005-07-10T07:06:48', '2'), - ('299', '4571', '2006-02-16T02:30:53', '2005-08-17T09:03:24', '2005-08-25T06:08:24', '2'), - ('533', '2136', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('275', '3647', '2006-02-16T02:30:53', '2005-08-20T15:04:09', '2005-08-24T10:06:09', '2'), - ('379', '3899', '2006-02-16T02:30:53', '2005-08-21T13:09:41', '2005-08-23T10:20:41', '2'), - ('480', '1466', '2006-02-16T02:30:53', '2005-08-19T12:08:13', '2005-08-27T13:43:13', '2'), - ('86', '754', '2006-02-16T02:30:53', '2005-07-06T21:35:00', '2005-07-08T00:31:00', '2'), - ('323', '3602', '2006-02-16T02:30:53', '2005-07-28T09:23:14', '2005-08-02T11:02:14', '2'), - ('149', '386', '2006-02-16T02:30:53', '2005-06-19T16:44:18', '2005-06-22T12:40:18', '2'), - ('67', '2548', '2006-02-16T02:30:53', '2005-08-20T07:52:34', '2005-08-23T08:58:34', '2'), - ('345', '4029', '2006-02-16T02:30:53', '2005-07-11T18:04:29', '2005-07-17T23:40:29', '2'), - ('306', '2400', '2006-02-16T02:30:53', '2005-08-17T10:27:19', '2005-08-20T14:02:19', '2'), - ('493', '3422', '2006-02-16T02:30:53', '2005-07-27T03:24:23', '2005-08-05T02:55:23', '2'), - ('122', '1409', '2006-02-16T02:30:53', '2005-06-18T04:28:27', '2005-06-22T07:48:27', '2'), - ('158', '3157', '2006-02-16T02:30:53', '2005-07-29T19:14:21', '2005-07-31T17:22:21', '2'), - ('490', '4523', '2006-02-16T02:30:53', '2005-08-22T18:59:01', '2005-08-23T19:49:01', '2'), - ('407', '3839', '2006-02-16T02:30:53', '2005-07-28T17:54:42', '2005-07-30T18:18:42', '2'), - ('559', '373', '2006-02-16T02:30:53', '2005-06-19T13:56:51', '2005-06-21T17:23:51', '2'), - ('533', '3421', '2006-02-16T02:30:53', '2005-07-27T22:17:05', '2005-08-02T02:50:05', '2'), - ('174', '4533', '2006-02-16T02:30:53', '2005-07-29T04:49:26', '2005-08-05T03:26:26', '2'), - ('273', '2884', '2006-02-16T02:30:53', '2005-07-09T21:28:07', '2005-07-18T21:16:07', '2'), - ('155', '198', '2006-02-16T02:30:53', '2005-07-11T05:29:22', '2005-07-12T23:33:22', '2'), - ('288', '3005', '2006-02-16T02:30:53', '2005-05-28T01:35:25', '2005-05-28T22:12:25', '2'), - ('167', '1819', '2006-02-16T02:30:53', '2005-07-29T20:57:22', '2005-08-02T01:40:22', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['1034', '6205', '13582', '3070', '9444', '8258', '6998', '3608', '1505', '3934', '13067', '13270', '12100', '8998', '10073', '11758', '4535', '5467', '9923', '13815', '12285', '8729', '14899', '6359', '11175', '15615', '4659', '12074', '8305', '3457', '4910', '3776', '8225', '4668', '6875', '9163', '12407', '13205', '12351', '12382', '1959', '9794', '14576', '4641', '8154', '5794', '13224', '8036', '1930', '14425', '11441', '10493', '8104', '2106', '12048', '14512', '11805', '8475', '15513', '3558', '930', '12565', '14396', '488', '2566', '8765', '10865', '8852', '15994', '12027', '15784', '10491', '14663', '10893', '4639', '9051', '6871', '12612', '8959', '10780', '3202', '14697', '6346', '14793', '5466', '414', '2850', '6862', '457', '15877', '14918', '11405', '15987', '4845', '3105', '14465', '1953', '8246', '15488', '619']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('293', '4117', '2006-02-16T02:30:53', '2005-05-31T04:53:40', '2005-06-09T08:25:40', '2'), - ('303', '3442', '2006-02-16T02:30:53', '2005-07-11T12:31:24', '2005-07-13T11:31:24', '2'), - ('166', '211', '2006-02-16T02:30:53', '2005-08-20T05:28:11', '2005-08-23T02:06:11', '2'), - ('543', '3860', '2006-02-16T02:30:53', '2005-06-20T14:15:39', '2005-06-25T12:52:39', '2'), - ('259', '1134', '2006-02-16T02:30:53', '2005-07-30T21:48:44', '2005-08-08T22:36:44', '2'), - ('370', '1379', '2006-02-16T02:30:53', '2005-07-29T01:03:42', '2005-08-04T22:08:42', '2'), - ('300', '788', '2006-02-16T02:30:53', '2005-07-27T01:16:29', '2005-07-30T05:50:29', '2'), - ('368', '3095', '2006-02-16T02:30:53', '2005-07-06T05:35:39', '2005-07-10T07:46:39', '2'), - ('561', '2961', '2006-02-16T02:30:53', '2005-06-15T22:12:50', '2005-06-17T21:37:50', '2'), - ('576', '3187', '2006-02-16T02:30:53', '2005-07-06T21:07:23', '2005-07-10T18:20:23', '2'), - ('172', '3825', '2006-02-16T02:30:53', '2005-08-19T09:51:17', '2005-08-25T09:58:17', '2'), - ('159', '405', '2006-02-16T02:30:53', '2005-08-19T17:41:16', '2005-08-23T20:22:16', '2'), - ('391', '4365', '2006-02-16T02:30:53', '2005-08-17T22:41:10', '2005-08-24T21:31:10', '2'), - ('120', '1573', '2006-02-16T02:30:53', '2005-07-30T04:54:14', '2005-08-08T08:18:14', '2'), - ('584', '4246', '2006-02-16T02:30:53', '2005-07-31T19:53:15', '2005-08-05T23:12:15', '2'), - ('533', '11', '2006-02-16T02:30:53', '2005-08-17T09:33:02', '2005-08-24T05:03:02', '2'), - ('29', '561', '2006-02-16T02:30:53', '2005-07-08T03:40:46', '2005-07-13T06:53:46', '2'), - ('543', '374', '2006-02-16T02:30:53', '2005-07-09T23:05:47', '2005-07-16T17:06:47', '2'), - ('209', '1635', '2006-02-16T02:30:53', '2005-07-31T15:00:15', '2005-08-05T11:09:15', '2'), - ('582', '3388', '2006-02-16T02:30:53', '2005-08-20T13:08:53', '2005-08-29T13:11:53', '2'), - ('215', '3531', '2006-02-16T02:30:53', '2005-08-18T04:56:43', '2005-08-19T23:32:43', '2'), - ('83', '3342', '2006-02-16T02:30:53', '2005-07-29T18:23:02', '2005-07-31T16:09:02', '2'), - ('304', '3700', '2006-02-16T02:30:53', '2005-08-22T04:26:38', '2005-08-31T08:36:38', '2'), - ('30', '1656', '2006-02-16T02:30:53', '2005-07-11T21:06:17', '2005-07-16T02:51:17', '2'), - ('164', '85', '2006-02-16T02:30:53', '2005-08-02T10:38:47', '2005-08-07T07:11:47', '2'), - ('584', '899', '2006-02-16T02:30:53', '2005-08-23T07:06:00', '2005-08-30T11:21:00', '2'), - ('425', '4389', '2006-02-16T02:30:53', '2005-07-08T09:53:28', '2005-07-14T14:56:28', '2'), - ('417', '711', '2006-02-16T02:30:53', '2005-08-17T21:50:57', '2005-08-20T00:58:57', '2'), - ('566', '3916', '2006-02-16T02:30:53', '2005-07-29T03:08:47', '2005-08-06T07:49:47', '2'), - ('312', '883', '2006-02-16T02:30:53', '2005-06-21T21:42:33', '2005-06-30T19:54:33', '2'), - ('219', '3675', '2006-02-16T02:30:53', '2005-07-08T21:13:56', '2005-07-18T02:39:56', '2'), - ('278', '4387', '2006-02-16T02:30:53', '2005-07-06T13:31:37', '2005-07-10T10:53:37', '2'), - ('41', '3631', '2006-02-16T02:30:53', '2005-07-28T23:59:29', '2005-07-30T03:27:29', '2'), - ('481', '3971', '2006-02-16T02:30:53', '2005-07-08T10:11:45', '2005-07-17T13:01:45', '2'), - ('172', '3420', '2006-02-16T02:30:53', '2005-07-12T20:23:05', '2005-07-19T00:09:05', '2'), - ('345', '4562', '2006-02-16T02:30:53', '2005-07-30T11:23:22', '2005-07-31T07:34:22', '2'), - ('220', '391', '2006-02-16T02:30:53', '2005-08-18T09:39:26', '2005-08-24T05:19:26', '2'), - ('495', '2616', '2006-02-16T02:30:53', '2005-08-19T15:05:26', '2005-08-25T10:41:26', '2'), - ('95', '2299', '2006-02-16T02:30:53', '2005-08-18T07:32:12', '2005-08-24T04:29:12', '2'), - ('566', '3049', '2006-02-16T02:30:53', '2005-08-18T08:32:33', '2005-08-26T03:45:33', '2'), - ('554', '1464', '2006-02-16T02:30:53', '2005-06-17T08:54:10', '2005-06-20T05:02:10', '2'), - ('403', '1771', '2006-02-16T02:30:53', '2005-07-31T10:47:01', '2005-08-02T06:52:01', '2'), - ('45', '1189', '2006-02-16T02:30:53', '2005-08-21T16:52:03', '2005-08-28T19:43:03', '2'), - ('26', '2436', '2006-02-16T02:30:53', '2005-07-08T09:09:46', '2005-07-17T03:54:46', '2'), - ('285', '1180', '2006-02-16T02:30:53', '2005-07-28T20:56:18', '2005-08-01T21:56:18', '2'), - ('198', '1164', '2006-02-16T02:30:53', '2005-07-10T14:34:53', '2005-07-17T11:50:53', '2'), - ('526', '3086', '2006-02-16T02:30:53', '2005-08-19T15:52:13', '2005-08-28T20:53:13', '2'), - ('412', '2741', '2006-02-16T02:30:53', '2005-07-28T16:27:43', '2005-08-01T13:41:43', '2'), - ('112', '79', '2006-02-16T02:30:53', '2005-06-17T06:50:46', '2005-06-19T08:51:46', '2'), - ('560', '2752', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('389', '1027', '2006-02-16T02:30:53', '2005-08-02T20:25:41', '2005-08-05T00:05:41', '2'), - ('285', '2375', '2006-02-16T02:30:53', '2005-08-01T10:43:12', '2005-08-07T08:13:12', '2'), - ('533', '1080', '2006-02-16T02:30:53', '2005-07-28T18:59:36', '2005-08-03T22:05:36', '2'), - ('66', '643', '2006-02-16T02:30:53', '2005-06-17T19:29:03', '2005-06-23T18:17:03', '2'), - ('466', '3773', '2006-02-16T02:30:53', '2005-08-17T20:49:24', '2005-08-27T02:01:24', '2'), - ('51', '579', '2006-02-16T02:30:53', '2005-08-21T14:47:09', '2005-08-24T18:10:09', '2'), - ('208', '1208', '2006-02-16T02:30:53', '2005-08-17T11:48:47', '2005-08-26T11:06:47', '2'), - ('260', '3695', '2006-02-16T02:30:53', '2005-07-29T08:37:41', '2005-08-04T10:03:41', '2'), - ('147', '3779', '2006-02-16T02:30:53', '2005-08-23T03:01:56', '2005-08-24T23:46:56', '2'), - ('575', '1742', '2006-02-16T02:30:53', '2005-07-06T02:49:06', '2005-07-15T01:38:06', '2'), - ('141', '2835', '2006-02-16T02:30:53', '2005-05-30T12:44:57', '2005-06-04T10:53:57', '2'), - ('211', '1284', '2006-02-16T02:30:53', '2005-08-18T15:12:17', '2005-08-19T12:26:17', '2'), - ('353', '3855', '2006-02-16T02:30:53', '2005-08-21T10:24:54', '2005-08-22T04:49:54', '2'), - ('168', '393', '2006-02-16T02:30:53', '2005-05-28T00:07:50', '2005-06-03T22:30:50', '2'), - ('486', '495', '2006-02-16T02:30:53', '2005-06-19T03:45:39', '2005-06-25T08:43:39', '2'), - ('538', '2631', '2006-02-16T02:30:53', '2005-07-29T19:40:08', '2005-07-31T14:24:08', '2'), - ('201', '1485', '2006-02-16T02:30:53', '2005-08-02T00:22:46', '2005-08-09T05:08:46', '2'), - ('42', '1138', '2006-02-16T02:30:53', '2005-07-29T23:30:03', '2005-08-05T05:22:03', '2'), - ('595', '438', '2006-02-16T02:30:53', '2005-08-23T20:29:10', '2005-08-28T01:41:10', '2'), - ('285', '45', '2006-02-16T02:30:53', '2005-08-17T20:01:12', '2005-08-26T21:08:12', '2'), - ('425', '126', '2006-02-16T02:30:53', '2005-08-23T13:46:00', '2005-08-30T11:49:00', '2'), - ('24', '3091', '2006-02-16T02:30:53', '2005-08-01T10:38:27', '2005-08-04T04:55:27', '2'), - ('150', '2351', '2006-02-16T02:30:53', '2005-08-21T19:47:55', '2005-08-27T17:36:55', '2'), - ('306', '2529', '2006-02-16T02:30:53', '2005-08-02T01:12:13', '2005-08-11T05:53:13', '2'), - ('75', '2459', '2006-02-16T02:30:53', '2005-07-08T08:57:21', '2005-07-14T11:22:21', '2'), - ('337', '1847', '2006-02-16T02:30:53', '2005-07-30T07:05:54', '2005-08-07T09:12:54', '2'), - ('204', '3612', '2006-02-16T02:30:53', '2005-07-12T20:13:49', '2005-07-14T20:11:49', '2'), - ('129', '1035', '2006-02-16T02:30:53', '2005-08-18T17:10:05', '2005-08-26T15:55:05', '2'), - ('550', '3508', '2006-02-16T02:30:53', '2005-07-30T03:35:49', '2005-08-06T02:02:49', '2'), - ('51', '1450', '2006-02-16T02:30:53', '2005-08-01T21:14:24', '2005-08-07T16:32:24', '2'), - ('273', '2725', '2006-02-16T02:30:53', '2005-06-21T00:33:47', '2005-06-24T04:05:47', '2'), - ('409', '48', '2006-02-16T02:30:53', '2005-08-21T20:49:21', '2005-08-26T01:39:21', '2'), - ('445', '4066', '2006-02-16T02:30:53', '2005-07-11T20:08:34', '2005-07-16T16:35:34', '2'), - ('154', '4285', '2006-02-16T02:30:53', '2005-08-22T00:37:57', '2005-08-29T05:44:57', '2'), - ('482', '2302', '2006-02-16T02:30:53', '2005-07-09T23:03:21', '2005-07-10T20:11:21', '2'), - ('219', '1019', '2006-02-16T02:30:53', '2005-05-27T14:48:20', '2005-05-31T14:39:20', '2'), - ('262', '206', '2006-02-16T02:30:53', '2005-06-19T23:06:28', '2005-06-28T03:30:28', '2'), - ('231', '3477', '2006-02-16T02:30:53', '2005-07-12T19:58:09', '2005-07-18T15:48:09', '2'), - ('300', '2368', '2006-02-16T02:30:53', '2005-05-27T19:52:29', '2005-06-02T17:17:29', '2'), - ('559', '2307', '2006-02-16T02:30:53', '2005-08-23T16:33:33', '2005-08-26T10:36:33', '2'), - ('154', '4056', '2006-02-16T02:30:53', '2005-08-22T05:06:38', '2005-08-30T01:44:38', '2'), - ('10', '418', '2006-02-16T02:30:53', '2005-08-02T19:13:39', '2005-08-07T19:19:39', '2'), - ('302', '3150', '2006-02-16T02:30:53', '2005-08-23T20:22:17', '2005-08-31T21:46:17', '2'), - ('553', '2337', '2006-02-16T02:30:53', '2005-07-08T18:28:20', '2005-07-09T14:38:20', '2'), - ('385', '130', '2006-02-16T02:30:53', '2005-06-20T17:11:46', '2005-06-21T11:48:46', '2'), - ('262', '4206', '2006-02-16T02:30:53', '2005-08-21T12:54:22', '2005-08-28T10:46:22', '2'), - ('405', '3549', '2006-02-16T02:30:53', '2005-06-17T08:34:57', '2005-06-24T09:38:57', '2'), - ('146', '1724', '2006-02-16T02:30:53', '2005-07-29T00:38:41', '2005-08-05T06:28:41', '2'), - ('385', '4535', '2006-02-16T02:30:53', '2005-08-23T02:06:01', '2005-08-29T21:35:01', '2'), - ('407', '2482', '2006-02-16T02:30:53', '2005-05-28T15:52:26', '2005-06-06T17:55:26', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['10550', '15724', '11012', '8425', '10082', '10498', '1815', '13078', '15451', '11573', '14444', '2676', '15942', '5273', '333', '10544', '7015', '9905', '12154', '4537', '9379', '471', '358', '13290', '12617', '3133', '885', '5359', '8047', '11499', '2003', '6791', '10950', '4552', '3967', '8153', '4493', '562', '7915', '10161', '14383', '11488', '10944', '4831', '9609', '14370', '1781', '3477', '2936', '9746', '4039', '13919', '11798', '9607', '4094', '6564', '10790', '9353', '8365', '8702', '1702', '9253', '3374', '12979', '15450', '11891', '783', '14905', '612', '12405', '5442', '8308', '7576', '6629', '7228', '4168', '9094', '81', '12191', '106', '8888', '3532', '2527', '14234', '8598', '3146', '8851', '7659', '14479', '9067', '879', '3549', '7530', '6149', '120', '734', '9286', '9046', '8405', '12828']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('129', '1980', '2006-02-16T02:30:53', '2005-08-01T12:46:52', '2005-08-05T16:48:52', '2'), - ('478', '1025', '2006-02-16T02:30:53', '2005-08-23T11:22:09', '2005-08-28T12:56:09', '2'), - ('162', '542', '2006-02-16T02:30:53', '2005-08-02T05:09:42', '2005-08-05T07:22:42', '2'), - ('486', '3491', '2006-02-16T02:30:53', '2005-07-29T07:06:21', '2005-08-05T07:57:21', '2'), - ('76', '1275', '2006-02-16T02:30:53', '2005-07-31T20:09:32', '2005-08-01T15:41:32', '2'), - ('355', '2672', '2006-02-16T02:30:53', '2005-08-01T10:56:48', '2005-08-03T15:46:48', '2'), - ('84', '1551', '2006-02-16T02:30:53', '2005-06-16T21:16:07', '2005-06-17T16:37:07', '2'), - ('479', '4104', '2006-02-16T02:30:53', '2005-08-19T10:16:43', '2005-08-27T11:35:43', '2'), - ('514', '231', '2006-02-16T02:30:53', '2005-08-23T00:56:27', '2005-08-24T00:15:27', '2'), - ('146', '639', '2006-02-16T02:30:53', '2005-08-17T01:38:18', '2005-08-19T05:06:18', '2'), - ('225', '2211', '2006-02-16T02:30:53', '2005-08-21T12:07:25', '2005-08-28T08:36:25', '2'), - ('477', '3938', '2006-02-16T02:30:53', '2005-06-19T11:54:57', '2005-06-24T15:34:57', '2'), - ('210', '1096', '2006-02-16T02:30:53', '2005-08-23T18:48:40', '2005-09-01T18:39:40', '2'), - ('38', '4570', '2006-02-16T02:30:53', '2005-07-09T14:31:24', '2005-07-14T13:27:24', '2'), - ('412', '4001', '2006-02-16T02:30:53', '2005-05-27T02:52:21', '2005-06-01T00:55:21', '2'), - ('589', '3195', '2006-02-16T02:30:53', '2005-08-01T12:36:21', '2005-08-07T12:25:21', '2'), - ('34', '376', '2006-02-16T02:30:53', '2005-07-27T02:15:01', '2005-07-28T07:46:01', '2'), - ('519', '2839', '2006-02-16T02:30:53', '2005-07-31T14:37:03', '2005-08-01T15:55:03', '2'), - ('163', '2491', '2006-02-16T02:30:53', '2005-08-18T00:23:56', '2005-08-21T00:31:56', '2'), - ('448', '1305', '2006-02-16T02:30:53', '2005-07-08T03:48:40', '2005-07-13T22:54:40', '2'), - ('452', '3855', '2006-02-16T02:30:53', '2005-07-30T19:13:01', '2005-08-07T19:18:01', '2'), - ('209', '2872', '2006-02-16T02:30:53', '2005-05-27T21:32:42', '2005-05-31T00:39:42', '2'), - ('102', '1925', '2006-02-16T02:30:53', '2005-05-27T06:43:59', '2005-05-29T11:28:59', '2'), - ('23', '4174', '2006-02-16T02:30:53', '2005-08-19T18:31:50', '2005-08-25T15:49:50', '2'), - ('564', '3573', '2006-02-16T02:30:53', '2005-08-18T17:22:48', '2005-08-24T17:40:48', '2'), - ('120', '4529', '2006-02-16T02:30:53', '2005-06-20T19:18:32', '2005-06-26T17:54:32', '2'), - ('62', '646', '2006-02-16T02:30:53', '2005-05-30T06:54:28', '2005-06-03T07:03:28', '2'), - ('453', '4392', '2006-02-16T02:30:53', '2005-07-09T18:10:52', '2005-07-18T13:34:52', '2'), - ('292', '2936', '2006-02-16T02:30:53', '2005-07-28T16:49:43', '2005-08-03T14:48:43', '2'), - ('172', '3857', '2006-02-16T02:30:53', '2005-08-16T22:54:12', '2005-08-24T03:37:12', '2'), - ('515', '1581', '2006-02-16T02:30:53', '2005-06-17T11:40:35', '2005-06-19T08:30:35', '2'), - ('144', '1495', '2006-02-16T02:30:53', '2005-07-12T16:35:07', '2005-07-20T15:32:07', '2'), - ('451', '707', '2006-02-16T02:30:53', '2005-08-02T03:25:08', '2005-08-07T23:11:08', '2'), - ('313', '2549', '2006-02-16T02:30:53', '2005-07-08T04:36:35', '2005-07-14T05:48:35', '2'), - ('31', '2510', '2006-02-16T02:30:53', '2005-07-06T22:45:10', '2005-07-09T23:54:10', '2'), - ('347', '2173', '2006-02-16T02:30:53', '2005-07-28T20:55:49', '2005-08-01T15:56:49', '2'), - ('167', '1369', '2006-02-16T02:30:53', '2005-07-08T01:40:24', '2005-07-09T02:17:24', '2'), - ('102', '3390', '2006-02-16T02:30:53', '2005-05-28T09:01:21', '2005-06-02T05:26:21', '2'), - ('186', '2088', '2006-02-16T02:30:53', '2005-07-28T11:49:46', '2005-08-04T12:21:46', '2'), - ('120', '2651', '2006-02-16T02:30:53', '2005-07-31T23:09:41', '2005-08-02T20:46:41', '2'), - ('482', '1941', '2006-02-16T02:30:53', '2005-08-21T10:02:05', '2005-08-24T12:21:05', '2'), - ('45', '2520', '2006-02-16T02:30:53', '2005-08-02T22:35:15', '2005-08-09T00:28:15', '2'), - ('470', '2373', '2006-02-16T02:30:53', '2005-08-02T03:20:03', '2005-08-04T04:13:03', '2'), - ('243', '2739', '2006-02-16T02:30:53', '2005-07-08T18:00:14', '2005-07-12T15:54:14', '2'), - ('112', '693', '2006-02-16T02:30:53', '2005-07-31T03:53:24', '2005-08-05T08:32:24', '2'), - ('161', '3520', '2006-02-16T02:30:53', '2005-08-21T09:35:14', '2005-08-27T05:21:14', '2'), - ('429', '2841', '2006-02-16T02:30:53', '2005-06-16T19:20:24', '2005-06-25T17:02:24', '2'), - ('476', '4289', '2006-02-16T02:30:53', '2005-07-05T23:05:17', '2005-07-15T02:20:17', '2'), - ('330', '2675', '2006-02-16T02:30:53', '2005-06-20T05:09:27', '2005-06-26T10:16:27', '2'), - ('308', '1459', '2006-02-16T02:30:53', '2005-07-31T09:16:48', '2005-08-07T06:36:48', '2'), - ('290', '4050', '2006-02-16T02:30:53', '2005-07-07T02:57:59', '2005-07-12T03:44:59', '2'), - ('129', '909', '2006-02-16T02:30:53', '2005-08-20T16:47:34', '2005-08-23T21:27:34', '2'), - ('448', '3974', '2006-02-16T02:30:53', '2005-08-17T11:21:43', '2005-08-25T07:43:43', '2'), - ('294', '3414', '2006-02-16T02:30:53', '2005-07-31T03:51:06', '2005-08-02T00:18:06', '2'), - ('517', '2412', '2006-02-16T02:30:53', '2005-07-07T06:00:21', '2005-07-10T03:24:21', '2'), - ('210', '2320', '2006-02-16T02:30:53', '2005-07-12T05:34:44', '2005-07-18T06:12:44', '2'), - ('274', '3080', '2006-02-16T02:30:53', '2005-08-01T21:38:37', '2005-08-08T17:20:37', '2'), - ('283', '3581', '2006-02-16T02:30:53', '2005-07-30T18:30:37', '2005-08-06T22:32:37', '2'), - ('280', '53', '2006-02-16T02:30:53', '2005-07-29T05:11:00', '2005-07-30T05:30:00', '2'), - ('306', '2215', '2006-02-16T02:30:53', '2005-07-29T17:04:37', '2005-08-05T15:30:37', '2'), - ('242', '1822', '2006-02-16T02:30:53', '2005-06-16T13:21:05', '2005-06-19T10:13:05', '2'), - ('151', '4183', '2006-02-16T02:30:53', '2005-07-30T14:20:12', '2005-07-31T11:31:12', '2'), - ('279', '1067', '2006-02-16T02:30:53', '2005-06-21T13:36:30', '2005-06-23T15:10:30', '2'), - ('267', '1227', '2006-02-16T02:30:53', '2005-08-19T07:00:35', '2005-08-21T06:12:35', '2'), - ('322', '1102', '2006-02-16T02:30:53', '2005-08-23T00:56:01', '2005-08-24T01:00:01', '2'), - ('115', '2619', '2006-02-16T02:30:53', '2005-08-17T15:11:55', '2005-08-22T11:11:55', '2'), - ('53', '3046', '2006-02-16T02:30:53', '2005-05-29T14:41:18', '2005-06-06T10:39:18', '2'), - ('286', '4166', '2006-02-16T02:30:53', '2005-08-22T04:34:22', '2005-08-26T04:00:22', '2'), - ('161', '2180', '2006-02-16T02:30:53', '2005-05-28T15:24:54', '2005-05-30T14:22:54', '2'), - ('266', '228', '2006-02-16T02:30:53', '2005-08-18T09:37:30', '2005-08-27T13:11:30', '2'), - ('29', '3093', '2006-02-16T02:30:53', '2005-07-09T21:55:19', '2005-07-19T01:18:19', '2'), - ('582', '601', '2006-02-16T02:30:53', '2005-07-29T03:22:15', '2005-08-04T21:38:15', '2'), - ('446', '3374', '2006-02-16T02:30:53', '2005-07-27T22:54:35', '2005-08-03T03:53:35', '2'), - ('582', '2855', '2006-02-16T02:30:53', '2005-07-12T09:18:35', '2005-07-20T11:34:35', '2'), - ('481', '1693', '2006-02-16T02:30:53', '2005-07-27T09:55:33', '2005-07-29T04:33:33', '2'), - ('132', '1872', '2006-02-16T02:30:53', '2005-07-07T09:37:24', '2005-07-09T14:32:24', '2'), - ('140', '2699', '2006-02-16T02:30:53', '2005-07-30T08:35:10', '2005-08-07T08:18:10', '2'), - ('286', '2610', '2006-02-16T02:30:53', '2005-05-25T12:15:19', '2005-06-02T14:08:19', '2'), - ('316', '2667', '2006-02-16T02:30:53', '2005-08-18T01:57:11', '2005-08-22T22:53:11', '2'), - ('196', '3627', '2006-02-16T02:30:53', '2005-05-25T18:18:19', '2005-06-04T00:01:19', '2'), - ('284', '2824', '2006-02-16T02:30:53', '2005-07-30T00:39:36', '2005-08-01T02:28:36', '2'), - ('274', '2635', '2006-02-16T02:30:53', '2005-07-06T01:24:38', '2005-07-11T06:42:38', '2'), - ('463', '387', '2006-02-16T02:30:53', '2005-06-19T01:10:31', '2005-06-20T05:37:31', '2'), - ('271', '1439', '2006-02-16T02:30:53', '2005-08-21T05:07:12', '2005-08-23T06:44:12', '2'), - ('2', '626', '2006-02-16T02:30:53', '2005-07-29T12:56:59', '2005-08-01T08:39:59', '2'), - ('339', '2249', '2006-02-16T02:30:53', '2005-06-20T20:21:48', '2005-06-29T22:57:48', '2'), - ('445', '212', '2006-02-16T02:30:53', '2005-07-29T23:26:19', '2005-08-05T03:59:19', '2'), - ('584', '1622', '2006-02-16T02:30:53', '2005-07-28T02:09:45', '2005-08-02T05:34:45', '2'), - ('324', '2235', '2006-02-16T02:30:53', '2005-08-21T13:35:54', '2005-08-29T12:12:54', '2'), - ('382', '3628', '2006-02-16T02:30:53', '2005-07-30T07:31:01', '2005-08-04T11:44:01', '2'), - ('482', '4021', '2006-02-16T02:30:53', '2005-05-30T05:49:42', '2005-06-05T01:45:42', '2'), - ('19', '3921', '2006-02-16T02:30:53', '2005-07-06T02:24:55', '2005-07-06T21:40:55', '2'), - ('98', '3810', '2006-02-16T02:30:53', '2005-07-27T21:18:58', '2005-07-31T01:51:58', '2'), - ('26', '4337', '2006-02-16T02:30:53', '2005-07-11T09:19:31', '2005-07-17T14:45:31', '2'), - ('365', '37', '2006-02-16T02:30:53', '2005-05-25T19:37:47', '2005-06-01T23:29:47', '2'), - ('538', '3084', '2006-02-16T02:30:53', '2005-05-29T07:38:52', '2005-06-03T10:17:52', '2'), - ('154', '2477', '2006-02-16T02:30:53', '2005-07-30T15:32:28', '2005-07-31T20:42:28', '2'), - ('215', '1736', '2006-02-16T02:30:53', '2005-07-30T06:46:55', '2005-08-01T02:21:55', '2'), - ('76', '2164', '2006-02-16T02:30:53', '2005-07-29T06:28:19', '2005-08-07T08:14:19', '2'), - ('378', '4208', '2006-02-16T02:30:53', '2005-08-19T01:37:47', '2005-08-24T22:31:47', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['1599', '6271', '4152', '12467', '3273', '6114', '10216', '1132', '11150', '3317', '8920', '7936', '4069', '2576', '9541', '1010', '15369', '15128', '14871', '15870', '10112', '5348', '6185', '2036', '10940', '602', '15509', '4011', '10609', '10924', '12209', '771', '3359', '12738', '3550', '400', '73', '15866', '11082', '9698', '92', '5416', '3340', '14889', '12164', '4774', '744', '7562', '9984', '1441', '8936', '11972', '7781', '2056', '14823', '8299', '11020', '7954', '5644', '2375', '14548', '3900', '11262', '5371', '1937', '1231', '12167', '2622', '4517', '9631', '14124', '11508', '2756', '1502', '3605', '10084', '1951', '11387', '784', '4225', '15396', '3447', '15063', '2869', '3334', '14778', '11396', '11442', '12025', '15391', '12680', '11425', '4489', '13422', '5506', '3482', '2302', '9961', '1259', '3106']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('215', '1476', '2006-02-16T02:30:53', '2005-06-16T06:03:33', '2005-06-21T07:46:33', '2'), - ('467', '1246', '2006-02-16T02:30:53', '2005-07-11T16:01:35', '2005-07-20T12:07:35', '2'), - ('89', '1761', '2006-02-16T02:30:53', '2005-07-07T08:50:33', '2005-07-14T10:56:33', '2'), - ('212', '1414', '2006-02-16T02:30:53', '2005-08-18T11:40:09', '2005-08-19T13:33:09', '2'), - ('104', '3538', '2006-02-16T02:30:53', '2005-06-21T05:24:17', '2005-06-23T01:21:17', '2'), - ('404', '479', '2006-02-16T02:30:53', '2005-07-11T07:33:48', '2005-07-18T06:13:48', '2'), - ('436', '3603', '2006-02-16T02:30:53', '2005-08-01T01:06:27', '2005-08-08T22:41:27', '2'), - ('198', '1763', '2006-02-16T02:30:53', '2005-05-31T18:44:53', '2005-06-07T22:02:53', '2'), - ('527', '2193', '2006-02-16T02:30:53', '2005-08-02T09:51:46', '2005-08-05T09:03:46', '2'), - ('584', '4095', '2006-02-16T02:30:53', '2005-06-21T08:22:32', '2005-06-26T14:18:32', '2'), - ('78', '4079', '2006-02-16T02:30:53', '2005-07-30T01:59:24', '2005-08-02T22:37:24', '2'), - ('520', '563', '2006-02-16T02:30:53', '2005-07-28T12:33:21', '2005-07-30T13:31:21', '2'), - ('570', '3361', '2006-02-16T02:30:53', '2005-07-07T04:35:06', '2005-07-10T23:59:06', '2'), - ('559', '2928', '2006-02-16T02:30:53', '2005-06-19T04:34:15', '2005-06-28T10:02:15', '2'), - ('422', '1774', '2006-02-16T02:30:53', '2005-07-31T01:40:14', '2005-08-05T06:34:14', '2'), - ('49', '4038', '2006-02-16T02:30:53', '2005-05-31T01:57:32', '2005-06-01T06:50:32', '2'), - ('121', '881', '2006-02-16T02:30:53', '2005-08-22T21:58:06', '2005-08-26T00:27:06', '2'), - ('457', '3229', '2006-02-16T02:30:53', '2005-08-22T12:57:26', '2005-08-30T11:35:26', '2'), - ('204', '3411', '2006-02-16T02:30:53', '2005-08-22T03:23:24', '2005-08-23T22:23:24', '2'), - ('251', '590', '2006-02-16T02:30:53', '2005-08-23T16:23:08', '2005-08-28T20:30:08', '2'), - ('198', '2643', '2006-02-16T02:30:53', '2005-07-31T21:08:56', '2005-08-01T23:35:56', '2'), - ('597', '3495', '2006-02-16T02:30:53', '2005-07-09T17:34:11', '2005-07-15T18:32:11', '2'), - ('294', '4331', '2006-02-16T02:30:53', '2005-07-11T11:25:09', '2005-07-18T12:09:09', '2'), - ('486', '100', '2006-02-16T02:30:53', '2005-06-17T13:46:52', '2005-06-18T15:42:52', '2'), - ('120', '3760', '2006-02-16T02:30:53', '2005-08-02T03:08:29', '2005-08-07T21:28:29', '2'), - ('590', '1300', '2006-02-16T02:30:53', '2005-05-28T14:15:54', '2005-06-05T15:16:54', '2'), - ('6', '1291', '2006-02-16T02:30:53', '2005-08-23T02:51:24', '2005-08-31T06:21:24', '2'), - ('20', '2052', '2006-02-16T02:30:53', '2005-07-07T00:48:25', '2005-07-13T06:30:25', '2'), - ('5', '2587', '2006-02-16T02:30:53', '2005-08-01T14:48:45', '2005-08-04T13:41:45', '2'), - ('540', '589', '2006-02-16T02:30:53', '2005-08-02T02:20:19', '2005-08-11T05:50:19', '2'), - ('243', '279', '2006-02-16T02:30:53', '2005-08-18T02:27:20', '2005-08-21T00:41:20', '2'), - ('476', '353', '2006-02-16T02:30:53', '2005-05-29T12:59:14', '2005-06-01T16:05:14', '2'), - ('67', '3825', '2006-02-16T02:30:53', '2005-06-21T12:08:18', '2005-06-25T16:35:18', '2'), - ('589', '4313', '2006-02-16T02:30:53', '2005-08-18T22:11:47', '2005-08-27T17:55:47', '2'), - ('15', '2417', '2006-02-16T02:30:53', '2005-07-06T02:29:21', '2005-07-13T05:26:21', '2'), - ('249', '258', '2006-02-16T02:30:53', '2005-05-27T12:51:44', '2005-05-31T08:34:44', '2'), - ('391', '517', '2006-02-16T02:30:53', '2005-05-25T11:00:07', '2005-06-01T13:56:07', '2'), - ('296', '3828', '2006-02-16T02:30:53', '2005-08-23T16:19:02', '2005-08-31T12:29:02', '2'), - ('190', '3037', '2006-02-16T02:30:53', '2005-08-02T07:30:19', '2005-08-07T05:20:19', '2'), - ('594', '3477', '2006-02-16T02:30:53', '2005-07-31T07:24:35', '2005-08-09T04:52:35', '2'), - ('302', '775', '2006-02-16T02:30:53', '2005-05-25T15:38:46', '2005-05-31T13:40:46', '2'), - ('219', '568', '2006-02-16T02:30:53', '2005-07-09T20:33:50', '2005-07-14T01:50:50', '2'), - ('540', '2962', '2006-02-16T02:30:53', '2005-06-21T10:37:23', '2005-06-26T07:21:23', '2'), - ('299', '1579', '2006-02-16T02:30:53', '2005-08-22T04:10:10', '2005-08-24T06:23:10', '2'), - ('587', '3849', '2006-02-16T02:30:53', '2005-08-18T00:46:38', '2005-08-19T04:38:38', '2'), - ('489', '673', '2006-02-16T02:30:53', '2005-07-08T15:42:28', '2005-07-16T18:29:28', '2'), - ('420', '3722', '2006-02-16T02:30:53', '2005-05-29T09:13:08', '2005-06-01T07:05:08', '2'), - ('366', '4417', '2006-02-16T02:30:53', '2005-07-27T22:25:15', '2005-08-01T01:21:15', '2'), - ('432', '433', '2006-02-16T02:30:53', '2005-07-31T17:12:23', '2005-08-01T21:04:23', '2'), - ('444', '2095', '2006-02-16T02:30:53', '2005-06-15T18:54:21', '2005-06-22T22:48:21', '2'), - ('227', '1408', '2006-02-16T02:30:53', '2005-07-30T02:47:13', '2005-08-01T02:25:13', '2'), - ('308', '1282', '2006-02-16T02:30:53', '2005-08-17T17:55:46', '2005-08-22T15:31:46', '2'), - ('539', '541', '2006-02-16T02:30:53', '2005-07-28T07:13:20', '2005-08-06T05:43:20', '2'), - ('42', '229', '2006-02-16T02:30:53', '2005-06-17T15:27:33', '2005-06-20T13:04:33', '2'), - ('503', '680', '2006-02-16T02:30:53', '2005-08-22T01:24:42', '2005-08-22T19:45:42', '2'), - ('173', '1797', '2006-02-16T02:30:53', '2005-07-29T02:56:00', '2005-07-30T22:35:00', '2'), - ('242', '1645', '2006-02-16T02:30:53', '2005-08-02T05:29:48', '2005-08-06T05:36:48', '2'), - ('145', '3735', '2006-02-16T02:30:53', '2005-07-28T13:25:05', '2005-07-29T18:50:05', '2'), - ('476', '4069', '2006-02-16T02:30:53', '2005-07-10T06:57:44', '2005-07-15T03:52:44', '2'), - ('259', '2175', '2006-02-16T02:30:53', '2005-06-18T14:47:29', '2005-06-26T13:52:29', '2'), - ('299', '226', '2006-02-16T02:30:53', '2005-08-21T15:53:52', '2005-08-25T15:39:52', '2'), - ('129', '1497', '2006-02-16T02:30:53', '2005-07-06T19:21:28', '2005-07-15T21:06:28', '2'), - ('348', '71', '2006-02-16T02:30:53', '2005-08-02T13:58:55', '2005-08-05T18:09:55', '2'), - ('425', '789', '2006-02-16T02:30:53', '2005-07-09T18:47:48', '2005-07-14T14:39:48', '2'), - ('385', '1266', '2006-02-16T02:30:53', '2005-06-17T07:16:46', '2005-06-21T04:22:46', '2'), - ('302', '3003', '2006-02-16T02:30:53', '2005-06-15T04:04:41', '2005-06-20T23:52:41', '2'), - ('338', '3085', '2006-02-16T02:30:53', '2005-08-18T01:00:02', '2005-08-21T00:04:02', '2'), - ('573', '1393', '2006-02-16T02:30:53', '2005-06-19T08:10:41', '2005-06-28T10:44:41', '2'), - ('16', '453', '2006-02-16T02:30:53', '2005-07-08T02:45:19', '2005-07-12T03:04:19', '2'), - ('595', '321', '2006-02-16T02:30:53', '2005-07-31T05:02:00', '2005-08-02T02:04:00', '2'), - ('35', '311', '2006-02-16T02:30:53', '2005-08-21T01:31:51', '2005-08-24T22:20:51', '2'), - ('19', '2688', '2006-02-16T02:30:53', '2005-08-16T23:27:36', '2005-08-25T01:34:36', '2'), - ('144', '3264', '2006-02-16T02:30:53', '2005-06-19T16:57:42', '2005-06-26T15:30:42', '2'), - ('5', '3277', '2006-02-16T02:30:53', '2005-06-15T22:03:14', '2005-06-23T18:42:14', '2'), - ('347', '384', '2006-02-16T02:30:53', '2005-07-06T05:27:15', '2005-07-10T00:05:15', '2'), - ('528', '524', '2006-02-16T02:30:53', '2005-07-31T20:11:29', '2005-08-06T22:28:29', '2'), - ('123', '955', '2006-02-16T02:30:53', '2005-06-17T08:30:35', '2005-06-20T10:43:35', '2'), - ('481', '2491', '2006-02-16T02:30:53', '2005-08-02T18:32:38', '2005-08-07T19:08:38', '2'), - ('352', '2936', '2006-02-16T02:30:53', '2005-05-29T14:44:22', '2005-06-01T17:28:22', '2'), - ('377', '1766', '2006-02-16T02:30:53', '2005-07-07T12:24:37', '2005-07-12T06:47:37', '2'), - ('319', '4050', '2006-02-16T02:30:53', '2005-08-22T23:07:57', '2005-08-28T19:39:57', '2'), - ('25', '1146', '2006-02-16T02:30:53', '2005-06-21T20:53:31', '2005-06-24T02:20:31', '2'), - ('30', '1159', '2006-02-16T02:30:53', '2005-08-22T10:39:51', '2005-08-25T16:03:51', '2'), - ('155', '1331', '2006-02-16T02:30:53', '2005-06-20T00:09:25', '2005-06-24T04:40:25', '2'), - ('66', '2491', '2006-02-16T02:30:53', '2005-06-21T10:04:33', '2005-06-29T06:09:33', '2'), - ('396', '2152', '2006-02-16T02:30:53', '2005-08-21T23:56:30', '2005-08-26T00:07:30', '2'), - ('59', '1155', '2006-02-16T02:30:53', '2005-08-02T18:48:29', '2005-08-04T16:05:29', '2'), - ('208', '2598', '2006-02-16T02:30:53', '2005-08-02T20:26:19', '2005-08-07T00:33:19', '2'), - ('209', '4019', '2006-02-16T02:30:53', '2005-08-17T19:59:06', '2005-08-23T14:39:06', '2'), - ('482', '3918', '2006-02-16T02:30:53', '2005-08-22T23:01:45', '2005-08-29T02:59:45', '2'), - ('259', '833', '2006-02-16T02:30:53', '2005-08-18T19:43:46', '2005-08-27T00:08:46', '2'), - ('419', '989', '2006-02-16T02:30:53', '2005-08-02T19:58:48', '2005-08-03T19:30:48', '2'), - ('259', '4306', '2006-02-16T02:30:53', '2005-07-08T01:23:58', '2005-07-09T01:35:58', '2'), - ('404', '3835', '2006-02-16T02:30:53', '2005-08-19T23:07:24', '2005-08-28T04:12:24', '2'), - ('117', '2432', '2006-02-16T02:30:53', '2005-07-10T00:45:48', '2005-07-18T20:35:48', '2'), - ('520', '1291', '2006-02-16T02:30:53', '2005-07-05T23:13:22', '2005-07-12T19:02:22', '2'), - ('42', '1852', '2006-02-16T02:30:53', '2005-06-18T08:27:33', '2005-06-22T02:46:33', '2'), - ('40', '1856', '2006-02-16T02:30:53', '2005-07-31T16:07:50', '2005-08-07T18:37:50', '2'), - ('570', '4460', '2006-02-16T02:30:53', '2005-06-15T06:37:55', '2005-06-23T04:02:55', '2'), - ('201', '2637', '2006-02-16T02:30:53', '2005-06-20T17:18:06', '2005-06-24T14:50:06', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['7758', '7098', '5799', '12039', '2086', '4005', '12380', '14604', '12471', '880', '2198', '8922', '10539', '12458', '1130', '14441', '1449', '8633', '15940', '6084', '6413', '10343', '4708', '12381', '9187', '149', '1556', '7168', '13275', '11797', '15087', '13216', '13887', '4285', '2249', '10514', '1201', '14156', '6036', '1322', '10194', '482', '10559', '2842', '5385', '4297', '12827', '8310', '2270', '7327', '10106', '10214', '14075', '6965', '15832', '7632', '8800', '9010', '422', '9777', '1076', '2909', '4513', '7464', '5597', '3740', '7742', '2159', '5631', '6117', '12009', '14263', '11217', '9917', '3182', '1833', '2317', '4352', '6031', '303', '14913', '14102', '12847', '213', '14098', '499', '14825', '1709', '5812', '299', '13354', '2731', '12130', '14894', '181', '9736', '5149', '4409', '438', '6603']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('356', '4333', '2006-02-16T02:30:53', '2005-07-28T06:23:41', '2005-08-03T06:06:41', '2'), - ('359', '2555', '2006-02-16T02:30:53', '2005-07-27T05:01:08', '2005-08-02T07:49:08', '2'), - ('520', '3045', '2006-02-16T02:30:53', '2005-07-10T14:53:35', '2005-07-14T16:18:35', '2'), - ('563', '4404', '2006-02-16T02:30:53', '2005-08-17T20:29:08', '2005-08-23T21:20:08', '2'), - ('326', '898', '2006-02-16T02:30:53', '2005-06-17T17:32:07', '2005-06-21T20:19:07', '2'), - ('190', '3677', '2006-02-16T02:30:53', '2005-07-07T00:22:26', '2005-07-15T04:34:26', '2'), - ('215', '55', '2006-02-16T02:30:53', '2005-08-18T08:27:28', '2005-08-25T02:58:28', '2'), - ('585', '1024', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('101', '242', '2006-02-16T02:30:53', '2005-08-18T11:57:00', '2005-08-26T13:17:00', '2'), - ('460', '1819', '2006-02-16T02:30:53', '2005-05-30T06:12:33', '2005-06-02T04:35:33', '2'), - ('109', '1983', '2006-02-16T02:30:53', '2005-06-18T01:51:22', '2005-06-26T06:57:22', '2'), - ('446', '1696', '2006-02-16T02:30:53', '2005-07-30T02:08:25', '2005-08-08T07:19:25', '2'), - ('232', '3341', '2006-02-16T02:30:53', '2005-08-01T12:23:00', '2005-08-07T10:25:00', '2'), - ('277', '4579', '2006-02-16T02:30:53', '2005-08-18T11:22:53', '2005-08-22T14:30:53', '2'), - ('124', '3186', '2006-02-16T02:30:53', '2005-05-31T18:13:57', '2005-06-06T22:50:57', '2'), - ('260', '1210', '2006-02-16T02:30:53', '2005-08-21T11:59:38', '2005-08-26T11:17:38', '2'), - ('471', '1525', '2006-02-16T02:30:53', '2005-06-15T19:19:16', '2005-06-18T15:24:16', '2'), - ('534', '3436', '2006-02-16T02:30:53', '2005-07-29T14:19:53', '2005-08-01T11:31:53', '2'), - ('86', '1606', '2006-02-16T02:30:53', '2005-08-23T18:45:06', '2005-08-30T13:00:06', '2'), - ('479', '1334', '2006-02-16T02:30:53', '2005-07-11T05:16:20', '2005-07-19T01:38:20', '2'), - ('251', '4446', '2006-02-16T02:30:53', '2005-07-11T23:26:11', '2005-07-17T21:58:11', '2'), - ('267', '2627', '2006-02-16T02:30:53', '2005-08-01T05:15:47', '2005-08-02T04:48:47', '2'), - ('212', '3249', '2006-02-16T02:30:53', '2005-07-08T11:59:19', '2005-07-17T07:11:19', '2'), - ('190', '3651', '2006-02-16T02:30:53', '2005-08-18T08:31:43', '2005-08-23T12:24:43', '2'), - ('469', '4008', '2006-02-16T02:30:53', '2005-07-30T12:14:03', '2005-08-04T13:10:03', '2'), - ('319', '1084', '2006-02-16T02:30:53', '2005-05-26T00:28:05', '2005-06-02T21:30:05', '2'), - ('54', '533', '2006-02-16T02:30:53', '2005-06-16T02:19:02', '2005-06-17T22:36:02', '2'), - ('252', '6', '2006-02-16T02:30:53', '2005-07-27T07:51:11', '2005-08-01T04:08:11', '2'), - ('377', '710', '2006-02-16T02:30:53', '2005-08-19T17:53:38', '2005-08-23T16:29:38', '2'), - ('546', '1142', '2006-02-16T02:30:53', '2005-08-17T11:17:21', '2005-08-18T09:14:21', '2'), - ('404', '233', '2006-02-16T02:30:53', '2005-08-22T11:24:09', '2005-08-27T16:42:09', '2'), - ('422', '4335', '2006-02-16T02:30:53', '2005-08-19T15:36:05', '2005-08-25T19:03:05', '2'), - ('413', '4002', '2006-02-16T02:30:53', '2005-08-20T15:39:00', '2005-08-24T16:17:00', '2'), - ('308', '511', '2006-02-16T02:30:53', '2005-07-07T15:34:35', '2005-07-15T09:43:35', '2'), - ('285', '117', '2006-02-16T02:30:53', '2005-06-18T05:03:08', '2005-06-26T05:43:08', '2'), - ('7', '1512', '2006-02-16T02:30:53', '2005-08-01T11:39:26', '2005-08-03T07:53:26', '2'), - ('209', '2679', '2006-02-16T02:30:53', '2005-06-15T02:06:28', '2005-06-16T21:38:28', '2'), - ('147', '437', '2006-02-16T02:30:53', '2005-08-21T02:35:16', '2005-08-27T01:32:16', '2'), - ('297', '2553', '2006-02-16T02:30:53', '2005-07-11T03:02:28', '2005-07-15T22:12:28', '2'), - ('217', '2076', '2006-02-16T02:30:53', '2005-06-15T10:55:09', '2005-06-18T15:14:09', '2'), - ('290', '1447', '2006-02-16T02:30:53', '2005-08-01T00:33:52', '2005-08-06T04:50:52', '2'), - ('546', '4178', '2006-02-16T02:30:53', '2005-05-27T22:53:02', '2005-06-01T22:53:02', '2'), - ('174', '2861', '2006-02-16T02:30:53', '2005-08-01T13:02:58', '2005-08-09T10:03:58', '2'), - ('217', '4183', '2006-02-16T02:30:53', '2005-06-19T22:34:20', '2005-06-22T03:46:20', '2'), - ('112', '4291', '2006-02-16T02:30:53', '2005-07-09T19:18:11', '2005-07-16T18:50:11', '2'), - ('141', '882', '2006-02-16T02:30:53', '2005-07-07T16:24:09', '2005-07-13T15:08:09', '2'), - ('253', '880', '2006-02-16T02:30:53', '2005-08-19T01:27:23', '2005-08-27T02:22:23', '2'), - ('238', '2637', '2006-02-16T02:30:53', '2005-07-29T03:25:56', '2005-08-06T23:18:56', '2'), - ('588', '3447', '2006-02-16T02:30:53', '2005-06-18T06:29:01', '2005-06-26T07:21:01', '2'), - ('508', '4074', '2006-02-16T02:30:53', '2005-07-27T13:53:26', '2005-08-04T17:58:26', '2'), - ('556', '3444', '2006-02-16T02:30:53', '2005-07-31T21:00:47', '2005-08-02T20:11:47', '2'), - ('597', '648', '2006-02-16T02:30:53', '2005-08-01T01:04:15', '2005-08-01T19:31:15', '2'), - ('32', '3793', '2006-02-16T02:30:53', '2005-08-20T23:18:54', '2005-08-26T21:59:54', '2'), - ('185', '74', '2006-02-16T02:30:53', '2005-07-27T00:15:18', '2005-07-28T04:30:18', '2'), - ('537', '1468', '2006-02-16T02:30:53', '2005-08-23T15:21:35', '2005-08-30T15:01:35', '2'), - ('181', '3233', '2006-02-16T02:30:53', '2005-07-28T01:02:40', '2005-07-30T05:31:40', '2'), - ('207', '2082', '2006-02-16T02:30:53', '2005-07-29T21:18:59', '2005-08-06T19:59:59', '2'), - ('152', '1698', '2006-02-16T02:30:53', '2005-07-30T05:12:04', '2005-08-06T02:54:04', '2'), - ('150', '1152', '2006-02-16T02:30:53', '2005-05-27T15:31:55', '2005-06-01T11:47:55', '2'), - ('539', '225', '2006-02-16T02:30:53', '2005-07-31T10:01:06', '2005-08-08T04:44:06', '2'), - ('214', '2551', '2006-02-16T02:30:53', '2005-05-31T10:14:31', '2005-06-05T10:13:31', '2'), - ('451', '1701', '2006-02-16T02:30:53', '2005-06-20T03:19:10', '2005-06-25T06:06:10', '2'), - ('182', '3704', '2006-02-16T02:30:53', '2005-07-08T02:39:59', '2005-07-14T07:48:59', '2'), - ('31', '845', '2006-02-16T02:30:53', '2005-07-27T18:49:42', '2005-07-28T20:45:42', '2'), - ('576', '4264', '2006-02-16T02:30:53', '2005-07-10T04:47:57', '2005-07-17T01:54:57', '2'), - ('277', '1829', '2006-02-16T02:30:53', '2005-07-06T11:55:35', '2005-07-14T09:44:35', '2'), - ('49', '1808', '2006-02-16T02:30:53', '2005-07-28T05:33:16', '2005-08-06T01:04:16', '2'), - ('465', '3095', '2006-02-16T02:30:53', '2005-06-17T23:37:29', '2005-06-25T00:18:29', '2'), - ('595', '2095', '2006-02-16T02:30:53', '2005-07-10T06:15:45', '2005-07-17T09:53:45', '2'), - ('135', '2613', '2006-02-16T02:30:53', '2005-07-11T07:39:38', '2005-07-18T12:07:38', '2'), - ('296', '2134', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('533', '2595', '2006-02-16T02:30:53', '2005-08-21T06:08:15', '2005-08-29T09:22:15', '2'), - ('417', '1201', '2006-02-16T02:30:53', '2005-08-02T12:26:31', '2005-08-09T09:53:31', '2'), - ('159', '3829', '2006-02-16T02:30:53', '2005-07-31T14:55:11', '2005-08-02T13:58:11', '2'), - ('15', '4017', '2006-02-16T02:30:53', '2005-06-20T22:52:18', '2005-06-21T21:00:18', '2'), - ('121', '1337', '2006-02-16T02:30:53', '2005-06-16T22:45:03', '2005-06-20T22:02:03', '2'), - ('326', '1602', '2006-02-16T02:30:53', '2005-06-18T09:12:18', '2005-06-21T05:50:18', '2'), - ('249', '2636', '2006-02-16T02:30:53', '2005-07-07T19:15:58', '2005-07-16T20:22:58', '2'), - ('224', '1530', '2006-02-16T02:30:53', '2005-07-11T02:42:14', '2005-07-14T03:24:14', '2'), - ('596', '1111', '2006-02-16T02:30:53', '2005-05-26T21:16:52', '2005-05-27T23:41:52', '2'), - ('503', '3609', '2006-02-16T02:30:53', '2005-08-22T04:52:13', '2005-08-23T06:49:13', '2'), - ('584', '3772', '2006-02-16T02:30:53', '2005-08-21T00:35:21', '2005-08-30T04:51:21', '2'), - ('91', '384', '2006-02-16T02:30:53', '2005-08-19T02:04:07', '2005-08-23T20:13:07', '2'), - ('394', '1505', '2006-02-16T02:30:53', '2005-05-26T08:44:08', '2005-05-31T12:33:08', '2'), - ('554', '6', '2006-02-23T09:12:08', '2005-08-21T00:30:32', NULL, '2'), - ('199', '2381', '2006-02-16T02:30:53', '2005-05-28T01:05:07', '2005-06-05T19:54:07', '2'), - ('1', '1449', '2006-02-16T02:30:53', '2005-08-22T01:27:57', '2005-08-27T07:01:57', '2'), - ('426', '3501', '2006-02-16T02:30:53', '2005-06-16T14:10:15', '2005-06-24T16:38:15', '2'), - ('581', '1681', '2006-02-16T02:30:53', '2005-07-10T15:27:56', '2005-07-18T15:37:56', '2'), - ('448', '4376', '2006-02-16T02:30:53', '2005-05-26T20:55:36', '2005-05-28T00:25:36', '2'), - ('213', '1356', '2006-02-16T02:30:53', '2005-08-19T20:55:23', '2005-08-27T20:09:23', '2'), - ('138', '4218', '2006-02-16T02:30:53', '2005-06-19T15:14:55', '2005-06-27T14:30:55', '2'), - ('516', '1358', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('347', '3494', '2006-02-16T02:30:53', '2005-08-22T04:16:56', '2005-08-24T00:30:56', '2'), - ('587', '2417', '2006-02-16T02:30:53', '2005-05-26T04:47:06', '2005-05-29T06:34:06', '2'), - ('13', '2072', '2006-02-16T02:30:53', '2005-07-31T08:58:40', '2005-08-09T08:34:40', '2'), - ('330', '1500', '2006-02-16T02:30:53', '2005-07-09T08:28:23', '2005-07-16T06:19:23', '2'), - ('8', '3153', '2006-02-16T02:30:53', '2005-07-07T21:47:29', '2005-07-11T20:14:29', '2'), - ('249', '4260', '2006-02-16T02:30:53', '2005-05-27T17:52:34', '2005-06-05T22:23:34', '2'), - ('425', '3583', '2006-02-16T02:30:53', '2005-07-12T07:52:55', '2005-07-16T13:19:55', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['7658', '9821', '3513', '12823', '10072', '5078', '8521', '6840', '10233', '9510', '96', '1439', '7910', '3768', '2157', '8277', '13933', '12574', '14181', '6508', '10220', '14414', '4556', '2549', '4509', '12204', '15814', '643', '355', '761', '6816', '5128', '2002', '6063', '3216', '12245', '14274', '5600', '654', '13649', '7096', '979', '13393', '6538', '2584', '6865', '1484', '1722', '2037', '770', '9585', '13321', '3984', '6714', '3472', '14848', '6254', '3251', '3499', '13350', '13484', '15802', '12326', '9599', '4557', '7712', '3536', '11026', '10100', '6709', '5308', '9953', '2092', '9537', '8226', '9354', '753', '11734', '1365', '1020', '13886', '10445', '14845', '7666', '10294', '14997', '1981', '1026', '225', '8026', '1600', '8909', '4377', '5906', '10687', '4310', '12127', '8251', '4623', '2853']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('272', '1798', '2006-02-16T02:30:53', '2005-07-28T02:09:12', '2005-07-30T00:54:12', '2'), - ('271', '386', '2006-02-16T02:30:53', '2005-07-31T11:47:54', '2005-08-08T06:21:54', '2'), - ('223', '4225', '2006-02-16T02:30:53', '2005-07-06T00:45:57', '2005-07-11T19:04:57', '2'), - ('316', '426', '2006-02-16T02:30:53', '2005-08-19T01:15:47', '2005-08-22T05:32:47', '2'), - ('520', '3963', '2006-02-16T02:30:53', '2005-07-31T19:50:37', '2005-08-03T00:25:37', '2'), - ('78', '1994', '2006-02-16T02:30:53', '2005-07-09T05:20:24', '2005-07-13T06:41:24', '2'), - ('402', '2608', '2006-02-16T02:30:53', '2005-07-29T10:12:45', '2005-08-07T04:37:45', '2'), - ('323', '1381', '2006-02-16T02:30:53', '2005-07-12T19:03:22', '2005-07-21T18:34:22', '2'), - ('459', '4571', '2006-02-16T02:30:53', '2005-08-01T01:54:23', '2005-08-10T00:23:23', '2'), - ('494', '2301', '2006-02-16T02:30:53', '2005-07-31T00:24:17', '2005-08-08T18:47:17', '2'), - ('49', '3418', '2006-02-16T02:30:53', '2005-05-25T16:32:19', '2005-05-30T10:47:19', '2'), - ('589', '3155', '2006-02-16T02:30:53', '2005-06-15T18:45:32', '2005-06-22T15:57:32', '2'), - ('480', '2044', '2006-02-16T02:30:53', '2005-07-28T11:44:56', '2005-08-05T14:37:56', '2'), - ('573', '3995', '2006-02-16T02:30:53', '2005-07-06T13:07:30', '2005-07-09T16:26:30', '2'), - ('201', '1619', '2006-02-16T02:30:53', '2005-06-17T23:30:52', '2005-06-24T01:56:52', '2'), - ('13', '1296', '2006-02-16T02:30:53', '2005-07-29T01:38:53', '2005-08-04T07:09:53', '2'), - ('159', '647', '2006-02-16T02:30:53', '2005-08-20T17:17:07', '2005-08-22T18:10:07', '2'), - ('317', '177', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('210', '197', '2006-02-16T02:30:53', '2005-08-21T03:16:30', '2005-08-29T06:25:30', '2'), - ('597', '1474', '2006-02-16T02:30:53', '2005-07-12T03:34:50', '2005-07-17T02:57:50', '2'), - ('294', '3920', '2006-02-16T02:30:53', '2005-08-01T01:13:22', '2005-08-04T22:57:22', '2'), - ('515', '1757', '2006-02-16T02:30:53', '2005-08-21T11:08:17', '2005-08-23T08:37:17', '2'), - ('348', '4099', '2006-02-16T02:30:53', '2005-07-08T04:48:41', '2005-07-16T08:51:41', '2'), - ('495', '3854', '2006-02-16T02:30:53', '2005-06-19T02:46:39', '2005-06-26T22:30:39', '2'), - ('230', '1760', '2006-02-16T02:30:53', '2005-07-08T02:32:38', '2005-07-14T01:05:38', '2'), - ('575', '304', '2006-02-16T02:30:53', '2005-08-18T02:20:35', '2005-08-26T01:27:35', '2'), - ('459', '4361', '2006-02-16T02:30:53', '2005-08-23T14:52:50', '2005-08-27T16:12:50', '2'), - ('240', '3105', '2006-02-16T02:30:53', '2005-05-28T18:52:11', '2005-05-31T15:15:11', '2'), - ('446', '141', '2006-02-16T02:30:53', '2005-05-27T06:15:33', '2005-06-01T02:50:33', '2'), - ('58', '2342', '2006-02-16T02:30:53', '2005-05-29T11:09:01', '2005-06-03T16:18:01', '2'), - ('290', '2963', '2006-02-16T02:30:53', '2005-07-12T18:18:50', '2005-07-18T21:09:50', '2'), - ('155', '3757', '2006-02-16T02:30:53', '2005-07-09T07:25:54', '2005-07-16T04:04:54', '2'), - ('514', '2406', '2006-02-16T02:30:53', '2005-06-17T11:39:58', '2005-06-24T15:41:58', '2'), - ('519', '1715', '2006-02-16T02:30:53', '2005-07-11T04:16:51', '2005-07-13T08:35:51', '2'), - ('534', '719', '2006-02-16T02:30:53', '2005-06-21T01:19:37', '2005-06-29T06:45:37', '2'), - ('576', '2960', '2006-02-16T02:30:53', '2005-08-18T03:46:40', '2005-08-24T22:27:40', '2'), - ('405', '3183', '2006-02-16T02:30:53', '2005-08-21T06:29:20', '2005-08-26T06:25:20', '2'), - ('138', '3713', '2006-02-16T02:30:53', '2005-07-10T04:55:45', '2005-07-18T03:10:45', '2'), - ('23', '2312', '2006-02-16T02:30:53', '2005-05-28T20:15:30', '2005-05-30T22:02:30', '2'), - ('259', '1495', '2006-02-16T02:30:53', '2005-08-20T07:48:38', '2005-08-23T07:43:38', '2'), - ('3', '2575', '2006-02-16T02:30:53', '2005-07-27T04:54:42', '2005-08-03T01:42:42', '2'), - ('279', '3917', '2006-02-16T02:30:53', '2005-05-30T21:37:11', '2005-06-08T00:24:11', '2'), - ('15', '958', '2006-02-16T02:30:53', '2005-08-19T22:03:46', '2005-08-28T19:19:46', '2'), - ('529', '1987', '2006-02-16T02:30:53', '2005-07-12T04:50:26', '2005-07-20T23:44:26', '2'), - ('90', '3733', '2006-02-16T02:30:53', '2005-06-19T05:02:36', '2005-06-28T04:52:36', '2'), - ('175', '1428', '2006-02-16T02:30:53', '2005-07-12T20:02:40', '2005-07-20T00:39:40', '2'), - ('320', '1589', '2006-02-16T02:30:53', '2005-06-15T21:22:35', '2005-06-20T02:27:35', '2'), - ('364', '2142', '2006-02-16T02:30:53', '2005-06-16T15:12:52', '2005-06-19T13:01:52', '2'), - ('308', '2582', '2006-02-16T02:30:53', '2005-06-17T13:54:20', '2005-06-20T14:49:20', '2'), - ('405', '2491', '2006-02-16T02:30:53', '2005-05-29T12:56:50', '2005-06-07T15:54:50', '2'), - ('197', '3249', '2006-02-16T02:30:53', '2005-07-31T03:05:55', '2005-08-02T23:54:55', '2'), - ('280', '4183', '2006-02-16T02:30:53', '2005-08-19T19:40:37', '2005-08-21T19:09:37', '2'), - ('570', '2205', '2006-02-16T02:30:53', '2005-07-06T23:22:36', '2005-07-08T21:40:36', '2'), - ('370', '1947', '2006-02-16T02:30:53', '2005-07-12T13:29:06', '2005-07-18T16:02:06', '2'), - ('37', '841', '2006-02-16T02:30:53', '2005-07-05T22:56:33', '2005-07-13T17:18:33', '2'), - ('218', '395', '2006-02-16T02:30:53', '2005-08-22T02:14:19', '2005-08-26T02:54:19', '2'), - ('20', '2038', '2006-02-16T02:30:53', '2005-07-11T15:10:18', '2005-07-17T14:20:18', '2'), - ('317', '1414', '2006-02-16T02:30:53', '2005-06-21T03:20:37', '2005-06-23T04:54:37', '2'), - ('520', '1850', '2006-02-16T02:30:53', '2005-07-06T00:04:20', '2005-07-14T21:12:20', '2'), - ('214', '3523', '2006-02-16T02:30:53', '2005-08-19T20:44:00', '2005-08-27T01:23:00', '2'), - ('152', '1533', '2006-02-16T02:30:53', '2005-08-20T01:16:52', '2005-08-22T23:47:52', '2'), - ('158', '41', '2006-02-16T02:30:53', '2005-08-23T14:26:51', '2005-08-29T16:28:51', '2'), - ('114', '1865', '2006-02-16T02:30:53', '2005-08-18T06:41:59', '2005-08-19T10:16:59', '2'), - ('502', '3164', '2006-02-16T02:30:53', '2005-07-31T03:32:06', '2005-08-04T07:47:06', '2'), - ('132', '1191', '2006-02-16T02:30:53', '2005-07-08T04:49:15', '2005-07-14T00:00:15', '2'), - ('361', '3256', '2006-02-16T02:30:53', '2005-07-28T04:29:53', '2005-08-02T00:57:53', '2'), - ('339', '2328', '2006-02-16T02:30:53', '2005-07-06T01:36:11', '2005-07-12T20:00:11', '2'), - ('531', '3554', '2006-02-16T02:30:53', '2005-08-02T05:46:05', '2005-08-07T06:27:05', '2'), - ('330', '4050', '2006-02-16T02:30:53', '2005-07-31T20:47:18', '2005-08-03T16:58:18', '2'), - ('322', '4049', '2006-02-16T02:30:53', '2005-07-12T13:20:41', '2005-07-16T10:37:41', '2'), - ('52', '1684', '2006-02-16T02:30:53', '2005-07-09T15:58:38', '2005-07-15T13:55:38', '2'), - ('211', '1646', '2006-02-16T02:30:53', '2005-07-31T15:56:35', '2005-08-02T12:01:35', '2'), - ('556', '4427', '2006-02-16T02:30:53', '2005-06-17T18:12:16', '2005-06-25T15:06:16', '2'), - ('488', '546', '2006-02-16T02:30:53', '2005-07-31T01:23:00', '2005-08-01T01:16:00', '2'), - ('368', '3541', '2006-02-16T02:30:53', '2005-07-29T00:01:04', '2005-08-01T19:08:04', '2'), - ('595', '510', '2006-02-16T02:30:53', '2005-07-30T18:32:51', '2005-08-02T21:28:51', '2'), - ('135', '1021', '2006-02-16T02:30:53', '2005-05-29T10:16:42', '2005-06-05T08:52:42', '2'), - ('337', '4063', '2006-02-16T02:30:53', '2005-08-17T08:34:22', '2005-08-25T11:56:22', '2'), - ('25', '3813', '2006-02-16T02:30:53', '2005-06-15T14:09:55', '2005-06-19T18:11:55', '2'), - ('138', '3402', '2006-02-16T02:30:53', '2005-05-31T03:06:08', '2005-06-02T08:57:08', '2'), - ('73', '2248', '2006-02-16T02:30:53', '2005-08-20T15:34:43', '2005-08-26T11:48:43', '2'), - ('211', '3582', '2006-02-16T02:30:53', '2005-08-01T09:02:15', '2005-08-08T10:26:15', '2'), - ('292', '69', '2006-02-16T02:30:53', '2005-08-22T02:12:44', '2005-08-24T02:36:44', '2'), - ('196', '688', '2006-02-16T02:30:53', '2005-07-28T02:35:12', '2005-08-05T05:43:12', '2'), - ('28', '528', '2006-02-16T02:30:53', '2005-08-01T03:48:12', '2005-08-09T01:19:12', '2'), - ('29', '2724', '2006-02-16T02:30:53', '2005-08-22T07:53:00', '2005-08-28T03:47:00', '2'), - ('526', '3186', '2006-02-16T02:30:53', '2005-06-17T10:03:34', '2005-06-20T13:14:34', '2'), - ('107', '632', '2006-02-16T02:30:53', '2005-05-31T03:45:26', '2005-06-06T22:30:26', '2'), - ('467', '651', '2006-02-16T02:30:53', '2005-05-26T10:27:50', '2005-06-01T07:01:50', '2'), - ('511', '4225', '2006-02-16T02:30:53', '2005-07-28T16:05:38', '2005-07-29T21:28:38', '2'), - ('196', '2264', '2006-02-16T02:30:53', '2005-06-16T06:04:12', '2005-06-19T09:39:12', '2'), - ('556', '2606', '2006-02-16T02:30:53', '2005-07-30T01:28:03', '2005-08-06T04:40:03', '2'), - ('205', '3294', '2006-02-16T02:30:53', '2005-07-07T20:28:57', '2005-07-16T02:13:57', '2'), - ('323', '514', '2006-02-16T02:30:53', '2005-07-10T20:41:41', '2005-07-14T00:12:41', '2'), - ('16', '3191', '2006-02-16T02:30:53', '2005-08-01T17:53:02', '2005-08-05T19:16:02', '2'), - ('390', '3842', '2006-02-16T02:30:53', '2005-07-07T17:30:56', '2005-07-12T13:19:56', '2'), - ('582', '4218', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('408', '2317', '2006-02-16T02:30:53', '2005-07-29T00:50:14', '2005-08-03T23:52:14', '2'), - ('593', '4171', '2006-02-16T02:30:53', '2005-07-08T08:03:22', '2005-07-12T09:11:22', '2'), - ('453', '2578', '2006-02-16T02:30:53', '2005-06-19T23:09:41', '2005-06-28T00:51:41', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['1923', '3054', '5344', '3008', '871', '8086', '6433', '4373', '10201', '5555', '5669', '13892', '11312', '4506', '11615', '5118', '7559', '5077', '8985', '13913', '11759', '2153', '12573', '13895', '5580', '12873', '14511', '4440', '13163', '12527', '6212', '13254', '9973', '1148', '14806', '7880', '1591', '12259', '4559', '5813', '14267', '5673', '15731', '5925', '10921', '308', '10949', '3011', '13395', '934', '6329', '11213', '6239', '2683', '14750', '1107', '9874', '9757', '11636', '1970', '15404', '2602', '49', '12732', '15321', '11162', '1496', '4469', '14794', '13351', '14402', '15373', '8283', '876', '2811', '15543', '10143', '15580', '6142', '1851', '11054', '11444', '11560', '12576', '5576', '8481', '14867', '13926', '9053', '4466', '12830', '7252', '15013', '6279', '14949', '13996', '14092', '6486', '14215', '13253']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('400', '691', '2006-02-16T02:30:53', '2005-06-17T06:06:10', '2005-06-24T04:29:10', '2'), - ('322', '2817', '2006-02-16T02:30:53', '2005-06-20T13:16:41', '2005-06-28T13:45:41', '2'), - ('197', '159', '2006-02-16T02:30:53', '2005-07-09T17:27:05', '2005-07-10T15:51:05', '2'), - ('202', '3383', '2006-02-16T02:30:53', '2005-06-20T10:23:25', '2005-06-26T11:00:25', '2'), - ('303', '4573', '2006-02-16T02:30:53', '2005-05-30T05:01:30', '2005-06-04T06:22:30', '2'), - ('3', '1182', '2006-02-16T02:30:53', '2005-07-28T18:17:14', '2005-07-30T18:22:14', '2'), - ('101', '1357', '2006-02-16T02:30:53', '2005-07-12T00:12:02', '2005-07-21T04:25:02', '2'), - ('470', '3593', '2006-02-16T02:30:53', '2005-07-07T20:10:59', '2005-07-12T21:30:59', '2'), - ('299', '3649', '2006-02-16T02:30:53', '2005-08-01T00:42:18', '2005-08-08T20:49:18', '2'), - ('79', '2551', '2006-02-16T02:30:53', '2005-07-10T03:08:55', '2005-07-11T01:36:55', '2'), - ('323', '1173', '2006-02-16T02:30:53', '2005-07-10T08:12:53', '2005-07-11T05:48:53', '2'), - ('337', '1236', '2006-02-16T02:30:53', '2005-08-20T15:50:17', '2005-08-29T13:33:17', '2'), - ('190', '1093', '2006-02-16T02:30:53', '2005-08-02T15:56:51', '2005-08-07T20:56:51', '2'), - ('133', '1484', '2006-02-16T02:30:53', '2005-07-08T02:22:18', '2005-07-13T04:54:18', '2'), - ('436', '4331', '2006-02-16T02:30:53', '2005-08-17T03:54:35', '2005-08-23T06:54:35', '2'), - ('5', '957', '2006-02-16T02:30:53', '2005-07-09T07:13:52', '2005-07-18T05:18:52', '2'), - ('149', '661', '2006-02-16T02:30:53', '2005-07-27T22:20:03', '2005-08-06T00:26:03', '2'), - ('574', '686', '2006-02-16T02:30:53', '2005-07-09T05:18:01', '2005-07-17T10:39:01', '2'), - ('12', '3179', '2006-02-16T02:30:53', '2005-07-30T04:34:51', '2005-08-06T00:45:51', '2'), - ('197', '4259', '2006-02-16T02:30:53', '2005-08-20T16:37:35', '2005-08-26T13:12:35', '2'), - ('108', '2655', '2006-02-16T02:30:53', '2005-08-17T09:41:23', '2005-08-19T11:58:23', '2'), - ('357', '2440', '2006-02-16T02:30:53', '2005-06-17T22:58:04', '2005-06-24T19:38:04', '2'), - ('182', '1416', '2006-02-16T02:30:53', '2005-08-18T15:32:57', '2005-08-21T18:29:57', '2'), - ('12', '3060', '2006-02-16T02:30:53', '2005-08-20T15:58:28', '2005-08-26T15:07:28', '2'), - ('521', '2753', '2006-02-16T02:30:53', '2005-07-10T04:05:49', '2005-07-18T22:36:49', '2'), - ('138', '2140', '2006-02-16T02:30:53', '2005-08-19T03:05:41', '2005-08-22T06:57:41', '2'), - ('16', '4452', '2006-02-16T02:30:53', '2005-08-21T14:45:34', '2005-08-28T10:36:34', '2'), - ('507', '1236', '2006-02-16T02:30:53', '2005-07-07T23:00:58', '2005-07-08T21:31:58', '2'), - ('57', '3068', '2006-02-16T02:30:53', '2005-08-19T13:29:46', '2005-08-22T07:48:46', '2'), - ('459', '2536', '2006-02-16T02:30:53', '2005-08-18T13:48:46', '2005-08-26T13:31:46', '2'), - ('337', '3962', '2006-02-16T02:30:53', '2005-07-11T12:40:48', '2005-07-15T17:49:48', '2'), - ('532', '3412', '2006-02-16T02:30:53', '2005-08-19T16:54:01', '2005-08-27T19:50:01', '2'), - ('369', '1850', '2006-02-16T02:30:53', '2005-07-31T16:49:31', '2005-08-03T22:03:31', '2'), - ('235', '3307', '2006-02-16T02:30:53', '2005-05-31T20:38:40', '2005-06-02T18:35:40', '2'), - ('231', '2049', '2006-02-16T02:30:53', '2005-08-22T00:53:08', '2005-08-23T06:26:08', '2'), - ('182', '3670', '2006-02-16T02:30:53', '2005-07-28T10:30:37', '2005-08-03T08:05:37', '2'), - ('83', '1648', '2006-02-16T02:30:53', '2005-06-16T05:12:37', '2005-06-25T06:28:37', '2'), - ('429', '2904', '2006-02-16T02:30:53', '2005-08-18T04:14:35', '2005-08-18T22:30:35', '2'), - ('424', '1911', '2006-02-16T02:30:53', '2005-07-08T04:56:49', '2005-07-12T08:56:49', '2'), - ('512', '942', '2006-02-16T02:30:53', '2005-07-10T15:34:37', '2005-07-17T16:14:37', '2'), - ('527', '2199', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('117', '4018', '2006-02-16T02:30:53', '2005-07-10T08:21:54', '2005-07-11T05:54:54', '2'), - ('118', '3403', '2006-02-16T02:30:53', '2005-08-23T11:33:25', '2005-08-24T07:19:25', '2'), - ('503', '3724', '2006-02-16T02:30:53', '2005-07-10T21:41:27', '2005-07-18T18:35:27', '2'), - ('555', '1820', '2006-02-16T02:30:53', '2005-08-02T02:14:33', '2005-08-09T20:58:33', '2'), - ('277', '187', '2006-02-16T02:30:53', '2005-05-26T22:01:39', '2005-06-04T20:24:39', '2'), - ('389', '2309', '2006-02-16T02:30:53', '2005-08-02T03:24:04', '2005-08-06T08:36:04', '2'), - ('147', '4376', '2006-02-16T02:30:53', '2005-06-20T10:39:10', '2005-06-28T07:02:10', '2'), - ('80', '53', '2006-02-16T02:30:53', '2005-08-19T22:05:40', '2005-08-22T01:31:40', '2'), - ('60', '3595', '2006-02-16T02:30:53', '2005-05-30T13:24:46', '2005-06-08T16:44:46', '2'), - ('352', '2763', '2006-02-16T02:30:53', '2005-07-11T19:10:38', '2005-07-19T14:46:38', '2'), - ('584', '1007', '2006-02-16T02:30:53', '2005-08-02T12:18:35', '2005-08-05T08:44:35', '2'), - ('132', '4107', '2006-02-16T02:30:53', '2005-07-11T14:20:48', '2005-07-17T13:41:48', '2'), - ('241', '2860', '2006-02-16T02:30:53', '2005-06-19T12:27:19', '2005-06-21T16:26:19', '2'), - ('303', '918', '2006-02-16T02:30:53', '2005-08-21T23:09:32', '2005-08-30T00:46:32', '2'), - ('53', '3449', '2006-02-16T02:30:53', '2005-05-31T15:04:05', '2005-06-07T16:42:05', '2'), - ('482', '2476', '2006-02-16T02:30:53', '2005-07-31T13:32:31', '2005-08-07T09:50:31', '2'), - ('408', '2596', '2006-02-16T02:30:53', '2005-07-31T09:25:14', '2005-08-01T14:43:14', '2'), - ('276', '791', '2006-02-16T02:30:53', '2005-08-17T04:36:31', '2005-08-24T00:03:31', '2'), - ('303', '1358', '2006-02-16T02:30:53', '2005-06-17T09:23:16', '2005-06-22T09:40:16', '2'), - ('211', '3557', '2006-02-16T02:30:53', '2005-08-22T23:19:44', '2005-08-30T19:58:44', '2'), - ('173', '4124', '2006-02-16T02:30:53', '2005-06-19T06:10:08', '2005-06-24T00:39:08', '2'), - ('498', '2965', '2006-02-16T02:30:53', '2005-05-25T06:39:35', '2005-05-30T10:12:35', '2'), - ('535', '3307', '2006-02-16T02:30:53', '2005-08-18T21:57:50', '2005-08-19T18:28:50', '2'), - ('384', '4152', '2006-02-16T02:30:53', '2005-08-22T20:20:04', '2005-08-24T23:26:04', '2'), - ('277', '1809', '2006-02-16T02:30:53', '2005-08-02T10:07:54', '2005-08-05T11:35:54', '2'), - ('290', '3915', '2006-02-16T02:30:53', '2005-06-15T21:55:58', '2005-06-17T02:28:58', '2'), - ('192', '2173', '2006-02-16T02:30:53', '2005-07-08T00:18:32', '2005-07-12T21:17:32', '2'), - ('156', '413', '2006-02-16T02:30:53', '2005-08-22T00:39:31', '2005-08-28T20:08:31', '2'), - ('42', '4130', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('467', '749', '2006-02-16T02:30:53', '2005-08-21T10:38:17', '2005-08-27T08:36:17', '2'), - ('14', '4439', '2006-02-16T02:30:53', '2005-08-22T22:08:11', '2005-08-24T01:05:11', '2'), - ('300', '2002', '2006-02-16T02:30:53', '2005-07-29T01:52:22', '2005-08-05T03:22:22', '2'), - ('339', '1471', '2006-02-16T02:30:53', '2005-05-30T05:41:22', '2005-06-07T09:06:22', '2'), - ('457', '3890', '2006-02-16T02:30:53', '2005-06-19T19:53:30', '2005-06-22T23:21:30', '2'), - ('282', '3836', '2006-02-16T02:30:53', '2005-08-23T04:15:41', '2005-09-01T05:09:41', '2'), - ('271', '2139', '2006-02-16T02:30:53', '2005-07-31T22:11:43', '2005-08-09T17:48:43', '2'), - ('279', '754', '2006-02-16T02:30:53', '2005-08-23T05:39:06', '2005-09-01T01:14:06', '2'), - ('136', '1722', '2006-02-16T02:30:53', '2005-07-11T08:54:09', '2005-07-18T05:23:09', '2'), - ('451', '1121', '2006-02-16T02:30:53', '2005-06-17T00:32:26', '2005-06-22T19:54:26', '2'), - ('577', '728', '2006-02-16T02:30:53', '2005-08-02T06:33:07', '2005-08-10T02:52:07', '2'), - ('28', '1419', '2006-02-16T02:30:53', '2005-08-02T20:32:55', '2005-08-08T23:21:55', '2'), - ('320', '2316', '2006-02-16T02:30:53', '2005-08-17T01:20:30', '2005-08-18T04:29:30', '2'), - ('119', '329', '2006-02-16T02:30:53', '2005-08-18T15:38:31', '2005-08-22T21:29:31', '2'), - ('217', '1453', '2006-02-16T02:30:53', '2005-07-10T03:57:05', '2005-07-13T02:16:05', '2'), - ('454', '1739', '2006-02-16T02:30:53', '2005-07-29T08:45:57', '2005-08-01T12:50:57', '2'), - ('114', '271', '2006-02-16T02:30:53', '2005-08-22T03:14:46', '2005-08-25T03:53:46', '2'), - ('158', '932', '2006-02-16T02:30:53', '2005-08-20T17:09:27', '2005-08-28T13:42:27', '2'), - ('485', '2535', '2006-02-16T02:30:53', '2005-07-30T07:07:39', '2005-08-01T09:22:39', '2'), - ('304', '3320', '2006-02-16T02:30:53', '2005-07-08T00:12:53', '2005-07-17T03:49:53', '2'), - ('409', '4080', '2006-02-16T02:30:53', '2005-08-19T01:40:25', '2005-08-20T23:49:25', '2'), - ('549', '3107', '2006-02-16T02:30:53', '2005-07-27T10:45:28', '2005-08-04T06:24:28', '2'), - ('141', '141', '2006-02-16T02:30:53', '2005-08-22T08:42:45', '2005-08-24T05:20:45', '2'), - ('49', '1254', '2006-02-16T02:30:53', '2005-07-11T16:26:07', '2005-07-17T21:05:07', '2'), - ('111', '2434', '2006-02-16T02:30:53', '2005-08-22T06:12:16', '2005-08-25T08:25:16', '2'), - ('306', '3341', '2006-02-16T02:30:53', '2005-08-20T19:45:43', '2005-08-22T16:47:43', '2'), - ('273', '1596', '2006-02-16T02:30:53', '2005-08-21T00:14:32', '2005-08-24T22:22:32', '2'), - ('75', '4008', '2006-02-16T02:30:53', '2005-07-12T02:09:36', '2005-07-14T03:04:36', '2'), - ('54', '35', '2006-02-16T02:30:53', '2005-08-21T04:34:11', '2005-08-27T10:30:11', '2'), - ('399', '472', '2006-02-16T02:30:53', '2005-08-19T16:53:56', '2005-08-20T11:38:56', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['12212', '15756', '1729', '4673', '14538', '14355', '12971', '13391', '7894', '11703', '6920', '12754', '249', '7902', '6750', '8943', '8820', '9171', '1415', '13902', '2301', '957', '13496', '2158', '6207', '11437', '15544', '9058', '4726', '12973', '16039', '13460', '8166', '4900', '4464', '14073', '7904', '9801', '8602', '14180', '15906', '15783', '3958', '5084', '2988', '3885', '4647', '13340', '13504', '13385', '6529', '5742', '14309', '12411', '14882', '7192', '11244', '11118', '4303', '922', '10188', '1774', '14109', '2164', '2061', '6760', '9611', '6773', '7462', '10371', '13590', '2874', '14127', '6373', '8452', '10416', '6549', '12804', '305', '6924', '7993', '15503', '15460', '12840', '7237', '4241', '391', '3430', '13804', '13898', '46', '5318', '7810', '13133', '6959', '8235', '418', '13814', '15446', '13564']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('449', '3898', '2006-02-16T02:30:53', '2005-08-18T02:33:29', '2005-08-25T07:10:29', '2'), - ('112', '878', '2006-02-16T02:30:53', '2005-08-23T12:47:05', '2005-08-28T08:34:05', '2'), - ('523', '3364', '2006-02-16T02:30:53', '2005-06-16T15:29:47', '2005-06-25T20:55:47', '2'), - ('91', '2792', '2006-02-16T02:30:53', '2005-07-08T10:16:00', '2005-07-17T10:03:00', '2'), - ('471', '3348', '2006-02-16T02:30:53', '2005-08-21T15:28:15', '2005-08-22T19:55:15', '2'), - ('271', '649', '2006-02-16T02:30:53', '2005-08-21T09:08:29', '2005-08-27T10:08:29', '2'), - ('492', '3504', '2006-02-16T02:30:53', '2005-08-19T06:42:43', '2005-08-23T10:49:43', '2'), - ('16', '4220', '2006-02-16T02:30:53', '2005-08-19T22:01:42', '2005-08-24T22:20:42', '2'), - ('330', '3532', '2006-02-16T02:30:53', '2005-07-28T10:53:58', '2005-08-02T13:42:58', '2'), - ('279', '1692', '2006-02-16T02:30:53', '2005-08-17T07:19:29', '2005-08-20T09:35:29', '2'), - ('109', '2301', '2006-02-16T02:30:53', '2005-07-12T22:32:58', '2005-07-19T20:29:58', '2'), - ('134', '4154', '2006-02-16T02:30:53', '2005-08-18T22:37:41', '2005-08-27T20:17:41', '2'), - ('472', '2428', '2006-02-16T02:30:53', '2005-05-26T14:19:09', '2005-05-28T17:47:09', '2'), - ('356', '3066', '2006-02-16T02:30:53', '2005-07-28T11:14:19', '2005-07-30T09:01:19', '2'), - ('459', '3838', '2006-02-16T02:30:53', '2005-07-12T14:49:39', '2005-07-18T18:43:39', '2'), - ('531', '3698', '2006-02-16T02:30:53', '2005-07-30T03:06:48', '2005-08-02T00:59:48', '2'), - ('594', '481', '2006-02-16T02:30:53', '2005-07-29T22:14:56', '2005-08-05T23:36:56', '2'), - ('189', '1832', '2006-02-16T02:30:53', '2005-07-30T11:36:24', '2005-08-07T06:04:24', '2'), - ('331', '1885', '2006-02-16T02:30:53', '2005-06-15T17:31:57', '2005-06-16T22:22:57', '2'), - ('275', '1165', '2006-02-16T02:30:53', '2005-08-20T16:07:08', '2005-08-24T16:43:08', '2'), - ('273', '869', '2006-02-16T02:30:53', '2005-06-18T08:24:03', '2005-06-25T10:31:03', '2'), - ('440', '4428', '2006-02-16T02:30:53', '2005-05-30T17:53:29', '2005-06-03T15:31:29', '2'), - ('454', '3040', '2006-02-16T02:30:53', '2005-08-20T01:42:29', '2005-08-29T06:47:29', '2'), - ('530', '243', '2006-02-16T02:30:53', '2005-06-17T23:36:27', '2005-06-19T19:25:27', '2'), - ('143', '3226', '2006-02-16T02:30:53', '2005-07-11T12:34:24', '2005-07-14T10:15:24', '2'), - ('225', '2679', '2006-02-16T02:30:53', '2005-08-02T20:20:06', '2005-08-05T22:17:06', '2'), - ('30', '1918', '2006-02-16T02:30:53', '2005-08-23T04:17:56', '2005-09-01T00:43:56', '2'), - ('403', '4214', '2006-02-16T02:30:53', '2005-07-30T07:15:45', '2005-07-31T02:57:45', '2'), - ('144', '4369', '2006-02-16T02:30:53', '2005-07-08T12:50:54', '2005-07-17T07:09:54', '2'), - ('163', '128', '2006-02-16T02:30:53', '2005-08-19T06:48:11', '2005-08-22T07:18:11', '2'), - ('78', '545', '2006-02-16T02:30:53', '2005-08-23T22:18:51', '2005-08-31T19:55:51', '2'), - ('410', '244', '2006-02-16T02:30:53', '2005-08-20T00:48:24', '2005-08-28T04:13:24', '2'), - ('42', '3906', '2006-02-16T02:30:53', '2005-07-28T21:23:33', '2005-08-03T21:07:33', '2'), - ('426', '3487', '2006-02-16T02:30:53', '2005-07-08T20:38:06', '2005-07-09T22:45:06', '2'), - ('583', '4484', '2006-02-16T02:30:53', '2005-07-08T00:07:18', '2005-07-08T22:14:18', '2'), - ('230', '2996', '2006-02-16T02:30:53', '2005-08-20T23:12:57', '2005-08-28T18:47:57', '2'), - ('477', '316', '2006-02-16T02:30:53', '2005-07-28T11:25:39', '2005-08-06T08:22:39', '2'), - ('158', '3033', '2006-02-16T02:30:53', '2005-07-31T11:03:13', '2005-08-04T10:55:13', '2'), - ('64', '4002', '2006-02-16T02:30:53', '2005-07-29T13:04:27', '2005-08-03T12:21:27', '2'), - ('262', '796', '2006-02-16T02:30:53', '2005-08-21T03:16:15', '2005-08-24T22:31:15', '2'), - ('445', '3230', '2006-02-16T02:30:53', '2005-08-23T17:36:00', '2005-08-28T15:32:00', '2'), - ('247', '397', '2006-02-16T02:30:53', '2005-08-23T13:45:44', '2005-08-26T09:18:44', '2'), - ('288', '4117', '2006-02-16T02:30:53', '2005-07-06T22:07:33', '2005-07-10T19:31:33', '2'), - ('87', '3113', '2006-02-16T02:30:53', '2005-07-09T05:33:27', '2005-07-17T08:54:27', '2'), - ('557', '3160', '2006-02-16T02:30:53', '2005-06-20T08:59:08', '2005-06-28T04:31:08', '2'), - ('282', '1820', '2006-02-16T02:30:53', '2005-07-06T18:43:43', '2005-07-12T19:48:43', '2'), - ('312', '674', '2006-02-16T02:30:53', '2005-07-08T09:27:36', '2005-07-16T14:56:36', '2'), - ('45', '4358', '2006-02-16T02:30:53', '2005-08-19T20:18:39', '2005-08-28T21:06:39', '2'), - ('293', '4322', '2006-02-16T02:30:53', '2005-08-20T02:01:48', '2005-08-25T21:52:48', '2'), - ('252', '4323', '2006-02-16T02:30:53', '2005-08-19T21:39:35', '2005-08-22T22:38:35', '2'), - ('503', '1058', '2006-02-16T02:30:53', '2005-07-12T04:31:04', '2005-07-17T07:09:04', '2'), - ('596', '3975', '2006-02-16T02:30:53', '2005-07-10T11:56:18', '2005-07-19T06:59:18', '2'), - ('468', '4447', '2006-02-16T02:30:53', '2005-08-21T07:44:17', '2005-08-30T07:23:17', '2'), - ('181', '1234', '2006-02-16T02:30:53', '2005-08-18T09:47:57', '2005-08-21T05:54:57', '2'), - ('417', '12', '2006-02-16T02:30:53', '2005-08-22T03:52:21', '2005-08-25T04:50:21', '2'), - ('532', '4329', '2006-02-16T02:30:53', '2005-07-27T08:36:55', '2005-07-30T11:58:55', '2'), - ('142', '3423', '2006-02-16T02:30:53', '2005-08-02T13:33:24', '2005-08-10T10:18:24', '2'), - ('15', '2411', '2006-02-16T02:30:53', '2005-08-02T08:44:18', '2005-08-05T08:08:18', '2'), - ('108', '818', '2006-02-16T02:30:53', '2005-07-07T16:57:32', '2005-07-14T17:42:32', '2'), - ('550', '2442', '2006-02-16T02:30:53', '2005-05-30T11:55:55', '2005-06-08T10:12:55', '2'), - ('331', '1221', '2006-02-16T02:30:53', '2005-08-01T00:19:41', '2005-08-08T00:19:41', '2'), - ('442', '3058', '2006-02-16T02:30:53', '2005-06-16T18:27:52', '2005-06-21T13:35:52', '2'), - ('180', '1046', '2006-02-16T02:30:53', '2005-08-21T00:52:58', '2005-08-22T00:09:58', '2'), - ('227', '3442', '2006-02-16T02:30:53', '2005-06-17T23:46:21', '2005-06-24T19:10:21', '2'), - ('108', '4575', '2006-02-16T02:30:53', '2005-06-17T15:47:00', '2005-06-24T16:36:00', '2'), - ('502', '501', '2006-02-16T02:30:53', '2005-07-12T15:16:00', '2005-07-20T13:20:00', '2'), - ('215', '1976', '2006-02-16T02:30:53', '2005-07-31T03:54:43', '2005-08-05T03:54:43', '2'), - ('12', '3346', '2006-02-16T02:30:53', '2005-07-12T15:55:39', '2005-07-18T17:52:39', '2'), - ('114', '878', '2006-02-16T02:30:53', '2005-07-27T18:47:47', '2005-07-29T20:46:47', '2'), - ('327', '923', '2006-02-16T02:30:53', '2005-08-01T06:20:29', '2005-08-04T00:31:29', '2'), - ('264', '4417', '2006-02-16T02:30:53', '2005-08-20T05:48:59', '2005-08-25T00:44:59', '2'), - ('166', '331', '2006-02-16T02:30:53', '2005-06-20T00:42:26', '2005-06-28T01:37:26', '2'), - ('550', '4532', '2006-02-16T02:30:53', '2005-08-21T01:33:32', '2005-08-22T02:47:32', '2'), - ('115', '1042', '2006-02-16T02:30:53', '2005-07-11T21:35:20', '2005-07-13T23:22:20', '2'), - ('16', '4312', '2006-02-16T02:30:53', '2005-07-29T07:45:00', '2005-08-05T09:46:00', '2'), - ('449', '2629', '2006-02-16T02:30:53', '2005-08-01T08:08:39', '2005-08-10T09:26:39', '2'), - ('493', '2688', '2006-02-16T02:30:53', '2005-07-12T05:02:01', '2005-07-20T06:19:01', '2'), - ('365', '147', '2006-02-16T02:30:53', '2005-08-19T00:33:15', '2005-08-28T02:16:15', '2'), - ('464', '2665', '2006-02-16T02:30:53', '2005-05-26T21:22:07', '2005-06-02T22:33:07', '2'), - ('502', '1257', '2006-02-16T02:30:53', '2005-07-26T22:51:53', '2005-08-03T19:04:53', '2'), - ('353', '2926', '2006-02-16T02:30:53', '2005-07-28T14:56:41', '2005-08-01T17:01:41', '2'), - ('582', '4519', '2006-02-16T02:30:53', '2005-08-23T02:44:49', '2005-08-27T06:33:49', '2'), - ('20', '2907', '2006-02-16T02:30:53', '2005-08-23T01:10:42', '2005-08-28T20:49:42', '2'), - ('182', '2098', '2006-02-16T02:30:53', '2005-08-19T01:54:11', '2005-08-28T01:11:11', '2'), - ('29', '1904', '2006-02-16T02:30:53', '2005-07-27T10:12:36', '2005-07-31T08:40:36', '2'), - ('595', '4154', '2006-02-16T02:30:53', '2005-07-07T13:39:00', '2005-07-12T17:49:00', '2'), - ('197', '2193', '2006-02-16T02:30:53', '2005-05-27T11:03:55', '2005-06-01T11:59:55', '2'), - ('503', '1613', '2006-02-16T02:30:53', '2005-06-21T18:46:08', '2005-06-22T13:49:08', '2'), - ('19', '2232', '2006-02-16T02:30:53', '2005-08-20T12:46:32', '2005-08-29T14:04:32', '2'), - ('369', '4007', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('7', '3318', '2006-02-16T02:30:53', '2005-05-25T06:04:08', '2005-06-02T08:18:08', '2'), - ('472', '1738', '2006-02-16T02:30:53', '2005-07-09T16:11:33', '2005-07-14T12:49:33', '2'), - ('537', '30', '2006-02-16T02:30:53', '2005-07-28T08:00:38', '2005-08-02T06:14:38', '2'), - ('523', '1635', '2006-02-16T02:30:53', '2005-08-19T12:11:03', '2005-08-28T12:36:03', '2'), - ('452', '1618', '2006-02-16T02:30:53', '2005-07-27T00:07:51', '2005-07-27T20:45:51', '2'), - ('320', '1581', '2006-02-16T02:30:53', '2005-07-29T00:22:56', '2005-08-03T04:03:56', '2'), - ('151', '3063', '2006-02-16T02:30:53', '2005-05-27T15:13:17', '2005-06-04T12:05:17', '2'), - ('436', '2129', '2006-02-16T02:30:53', '2005-08-20T13:07:23', '2005-08-22T16:23:23', '2'), - ('379', '503', '2006-02-16T02:30:53', '2005-08-23T00:49:24', '2005-08-26T02:09:24', '2'), - ('36', '678', '2006-02-16T02:30:53', '2005-08-20T04:34:46', '2005-08-28T23:18:46', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['8383', '8621', '12043', '7711', '4286', '4807', '11135', '11098', '14116', '14385', '10690', '14066', '8176', '15271', '6665', '12338', '854', '12465', '12079', '4138', '5549', '10891', '15773', '7623', '4423', '4521', '6512', '14238', '15759', '7430', '15203', '6372', '14506', '428', '6837', '2986', '15468', '3577', '968', '13019', '4766', '6189', '4776', '4018', '13124', '2262', '2004', '15292', '12603', '1283', '1723', '14877', '10638', '10414', '8825', '12566', '13156', '9097', '6803', '13868', '11136', '8183', '1416', '195', '5788', '8520', '12346', '1903', '9584', '13453', '12311', '12069', '5342', '12115', '9666', '3354', '8083', '14558', '4221', '2930', '10370', '8536', '10317', '8540', '5701', '11635', '11920', '10856', '9743', '4902', '994', '8392', '15882', '10505', '15750', '15753', '1692', '7583', '15597', '3901']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('495', '3809', '2006-02-16T02:30:53', '2005-07-29T05:36:47', '2005-08-03T05:53:47', '2'), - ('358', '2473', '2006-02-16T02:30:53', '2005-07-29T13:52:42', '2005-07-30T11:42:42', '2'), - ('592', '3706', '2006-02-16T02:30:53', '2005-08-17T20:38:21', '2005-08-22T16:52:21', '2'), - ('426', '2695', '2006-02-16T02:30:53', '2005-07-28T04:26:42', '2005-07-29T07:30:42', '2'), - ('111', '4496', '2006-02-16T02:30:53', '2005-07-07T15:36:44', '2005-07-11T13:04:44', '2'), - ('348', '4511', '2006-02-16T02:30:53', '2005-07-08T17:01:48', '2005-07-16T22:33:48', '2'), - ('32', '799', '2006-02-16T02:30:53', '2005-08-02T09:22:25', '2005-08-04T14:30:25', '2'), - ('570', '158', '2006-02-16T02:30:53', '2005-08-02T08:06:18', '2005-08-11T04:50:18', '2'), - ('142', '2356', '2006-02-16T02:30:53', '2005-08-21T01:11:17', '2005-08-24T23:45:17', '2'), - ('317', '4356', '2006-02-16T02:30:53', '2005-08-21T10:02:55', '2005-08-25T07:19:55', '2'), - ('80', '807', '2006-02-16T02:30:53', '2005-08-01T18:05:54', '2005-08-10T21:43:54', '2'), - ('274', '2444', '2006-02-16T02:30:53', '2005-08-20T22:45:58', '2005-08-29T00:23:58', '2'), - ('347', '3527', '2006-02-16T02:30:53', '2005-07-28T21:42:08', '2005-08-03T22:59:08', '2'), - ('59', '4232', '2006-02-16T02:30:53', '2005-08-22T18:48:48', '2005-08-30T00:45:48', '2'), - ('587', '2912', '2006-02-16T02:30:53', '2005-07-12T11:29:14', '2005-07-19T11:26:14', '2'), - ('408', '274', '2006-02-16T02:30:53', '2005-08-18T07:04:24', '2005-08-19T08:36:24', '2'), - ('369', '921', '2006-02-16T02:30:53', '2005-05-30T01:56:11', '2005-06-01T06:34:11', '2'), - ('486', '1733', '2006-02-16T02:30:53', '2005-08-18T11:35:02', '2005-08-21T11:52:02', '2'), - ('230', '646', '2006-02-16T02:30:53', '2005-08-17T22:04:17', '2005-08-24T20:22:17', '2'), - ('317', '1588', '2006-02-16T02:30:53', '2005-07-07T08:17:13', '2005-07-14T05:18:13', '2'), - ('163', '2685', '2006-02-16T02:30:53', '2005-07-10T02:58:29', '2005-07-17T05:24:29', '2'), - ('201', '1269', '2006-02-16T02:30:53', '2005-08-02T01:09:55', '2005-08-05T05:03:55', '2'), - ('189', '1626', '2006-02-16T02:30:53', '2005-08-23T13:24:57', '2005-08-31T14:16:57', '2'), - ('459', '1146', '2006-02-16T02:30:53', '2005-07-28T00:37:41', '2005-08-04T19:38:41', '2'), - ('526', '2721', '2006-02-16T02:30:53', '2005-07-07T22:11:28', '2005-07-14T18:49:28', '2'), - ('327', '2652', '2006-02-16T02:30:53', '2005-07-08T02:57:56', '2005-07-11T22:49:56', '2'), - ('68', '1703', '2006-02-16T02:30:53', '2005-07-12T03:42:49', '2005-07-13T05:01:49', '2'), - ('192', '3148', '2006-02-16T02:30:53', '2005-08-21T05:16:40', '2005-08-30T02:13:40', '2'), - ('361', '1341', '2006-02-16T02:30:53', '2005-08-23T12:47:37', '2005-09-01T11:28:37', '2'), - ('562', '4205', '2006-02-16T02:30:53', '2005-07-27T17:26:14', '2005-08-01T13:02:14', '2'), - ('568', '743', '2006-02-16T02:30:53', '2005-08-22T16:28:00', '2005-08-26T16:55:00', '2'), - ('64', '741', '2006-02-16T02:30:53', '2005-07-11T21:35:06', '2005-07-15T02:30:06', '2'), - ('537', '4493', '2006-02-16T02:30:53', '2005-08-21T14:32:27', '2005-08-24T19:02:27', '2'), - ('161', '3349', '2006-02-16T02:30:53', '2005-05-27T16:10:58', '2005-05-31T17:24:58', '2'), - ('533', '1203', '2006-02-16T02:30:53', '2005-07-12T18:59:45', '2005-07-21T22:47:45', '2'), - ('556', '478', '2006-02-16T02:30:53', '2005-06-20T08:50:28', '2005-06-26T05:24:28', '2'), - ('399', '2440', '2006-02-16T02:30:53', '2005-08-23T01:25:30', '2005-08-28T01:40:30', '2'), - ('152', '4390', '2006-02-16T02:30:53', '2005-07-06T03:40:36', '2005-07-10T05:54:36', '2'), - ('576', '119', '2006-02-16T02:30:53', '2005-05-30T19:20:03', '2005-05-31T18:17:03', '2'), - ('597', '2827', '2006-02-16T02:30:53', '2005-08-19T08:07:43', '2005-08-20T12:09:43', '2'), - ('149', '1057', '2006-02-16T02:30:53', '2005-07-08T15:16:04', '2005-07-15T11:04:04', '2'), - ('552', '3800', '2006-02-16T02:30:53', '2005-07-11T11:36:03', '2005-07-20T15:33:03', '2'), - ('563', '2598', '2006-02-16T02:30:53', '2005-07-08T15:44:20', '2005-07-17T10:50:20', '2'), - ('207', '906', '2006-02-16T02:30:53', '2005-07-07T01:10:33', '2005-07-12T20:54:33', '2'), - ('78', '2105', '2006-02-16T02:30:53', '2005-08-19T11:55:59', '2005-08-26T06:01:59', '2'), - ('218', '4172', '2006-02-16T02:30:53', '2005-06-18T05:49:46', '2005-06-20T00:25:46', '2'), - ('171', '1342', '2006-02-16T02:30:53', '2005-06-17T11:43:38', '2005-06-24T08:05:38', '2'), - ('337', '3072', '2006-02-16T02:30:53', '2005-08-22T19:28:56', '2005-08-28T22:39:56', '2'), - ('119', '2769', '2006-02-16T02:30:53', '2005-08-18T16:56:20', '2005-08-25T11:50:20', '2'), - ('470', '3177', '2006-02-16T02:30:53', '2005-06-15T08:27:30', '2005-06-16T09:46:30', '2'), - ('259', '2417', '2006-02-16T02:30:53', '2005-06-16T15:14:18', '2005-06-23T15:45:18', '2'), - ('266', '974', '2006-02-16T02:30:53', '2005-08-22T03:39:56', '2005-08-24T03:41:56', '2'), - ('132', '2239', '2006-02-16T02:30:53', '2005-08-01T15:44:20', '2005-08-08T16:05:20', '2'), - ('361', '1271', '2006-02-16T02:30:53', '2005-08-01T08:03:55', '2005-08-04T08:44:55', '2'), - ('101', '881', '2006-02-16T02:30:53', '2005-07-29T22:24:16', '2005-08-05T00:27:16', '2'), - ('407', '1684', '2006-02-16T02:30:53', '2005-08-18T15:13:04', '2005-08-21T19:29:04', '2'), - ('512', '770', '2006-02-16T02:30:53', '2005-08-19T13:10:42', '2005-08-25T15:08:42', '2'), - ('173', '570', '2006-02-16T02:30:53', '2005-07-30T08:40:35', '2005-08-04T11:19:35', '2'), - ('490', '2676', '2006-02-16T02:30:53', '2005-07-12T17:21:49', '2005-07-14T18:01:49', '2'), - ('51', '3173', '2006-02-16T02:30:53', '2005-08-20T15:06:26', '2005-08-22T19:08:26', '2'), - ('559', '1315', '2006-02-16T02:30:53', '2005-08-02T09:22:57', '2005-08-08T14:12:57', '2'), - ('119', '1545', '2006-02-16T02:30:53', '2005-07-28T22:21:07', '2005-08-04T19:20:07', '2'), - ('167', '3816', '2006-02-16T02:30:53', '2005-06-15T17:44:57', '2005-06-22T20:53:57', '2'), - ('564', '506', '2006-02-16T02:30:53', '2005-05-26T06:52:36', '2005-05-31T02:47:36', '2'), - ('63', '1707', '2006-02-16T02:30:53', '2005-07-10T14:10:22', '2005-07-14T19:46:22', '2'), - ('103', '2440', '2006-02-16T02:30:53', '2005-07-29T10:10:02', '2005-08-02T05:25:02', '2'), - ('265', '1200', '2006-02-16T02:30:53', '2005-08-18T07:17:55', '2005-08-21T11:35:55', '2'), - ('588', '1939', '2006-02-16T02:30:53', '2005-06-17T04:37:20', '2005-06-26T09:05:20', '2'), - ('141', '419', '2006-02-16T02:30:53', '2005-07-31T03:05:48', '2005-08-01T05:50:48', '2'), - ('164', '2203', '2006-02-16T02:30:53', '2005-08-20T00:30:51', '2005-08-28T18:43:51', '2'), - ('211', '1650', '2006-02-16T02:30:53', '2005-08-18T06:07:00', '2005-08-21T07:54:00', '2'), - ('389', '631', '2006-02-16T02:30:53', '2005-08-17T21:39:40', '2005-08-22T01:12:40', '2'), - ('289', '3828', '2006-02-16T02:30:53', '2005-07-09T17:20:03', '2005-07-18T12:44:03', '2'), - ('457', '1228', '2006-02-16T02:30:53', '2005-08-17T23:04:15', '2005-08-20T22:25:15', '2'), - ('592', '4318', '2006-02-16T02:30:53', '2005-07-31T06:20:58', '2005-08-06T06:09:58', '2'), - ('529', '1083', '2006-02-16T02:30:53', '2005-06-21T11:29:49', '2005-06-25T07:39:49', '2'), - ('30', '2187', '2006-02-16T02:30:53', '2005-07-28T18:09:48', '2005-08-04T21:47:48', '2'), - ('273', '3958', '2006-02-16T02:30:53', '2005-08-21T16:10:50', '2005-08-28T16:36:50', '2'), - ('143', '4567', '2006-02-16T02:30:53', '2005-07-07T12:18:57', '2005-07-12T09:47:57', '2'), - ('585', '3615', '2006-02-16T02:30:53', '2005-06-20T04:50:29', '2005-06-28T06:00:29', '2'), - ('546', '4358', '2006-02-16T02:30:53', '2005-08-01T06:18:04', '2005-08-05T01:41:04', '2'), - ('219', '4510', '2006-02-16T02:30:53', '2005-07-29T10:37:23', '2005-07-31T07:21:23', '2'), - ('561', '110', '2006-02-16T02:30:53', '2005-08-01T04:35:34', '2005-08-06T02:27:34', '2'), - ('180', '539', '2006-02-16T02:30:53', '2005-07-29T10:52:51', '2005-08-07T11:44:51', '2'), - ('91', '2395', '2006-02-16T02:30:53', '2005-07-10T09:56:24', '2005-07-16T15:11:24', '2'), - ('98', '2642', '2006-02-16T02:30:53', '2005-08-17T04:33:17', '2005-08-21T07:50:17', '2'), - ('402', '4253', '2006-02-16T02:30:53', '2005-08-17T16:10:19', '2005-08-20T13:54:19', '2'), - ('451', '2010', '2006-02-16T02:30:53', '2005-08-02T00:07:14', '2005-08-04T02:48:14', '2'), - ('476', '1740', '2006-02-16T02:30:53', '2005-07-31T09:12:42', '2005-08-06T11:57:42', '2'), - ('554', '2238', '2006-02-16T02:30:53', '2005-07-08T20:49:30', '2005-07-13T16:54:30', '2'), - ('472', '2798', '2006-02-16T02:30:53', '2005-05-30T23:55:36', '2005-06-04T01:00:36', '2'), - ('65', '1323', '2006-02-16T02:30:53', '2005-07-29T06:00:27', '2005-08-02T00:30:27', '2'), - ('312', '2028', '2006-02-16T02:30:53', '2005-08-23T16:44:31', '2005-09-01T15:44:31', '2'), - ('426', '2977', '2006-02-16T02:30:53', '2005-08-01T11:13:59', '2005-08-05T07:20:59', '2'), - ('496', '4474', '2006-02-16T02:30:53', '2005-08-23T12:36:05', '2005-08-24T17:40:05', '2'), - ('144', '3451', '2006-02-16T02:30:53', '2005-08-23T12:43:30', '2005-09-01T09:07:30', '2'), - ('514', '3544', '2006-02-16T02:30:53', '2005-06-16T12:30:19', '2005-06-17T17:31:19', '2'), - ('198', '2890', '2006-02-16T02:30:53', '2005-07-27T23:15:22', '2005-08-04T04:39:22', '2'), - ('420', '3795', '2006-02-16T02:30:53', '2005-08-23T06:21:20', '2005-08-28T02:47:20', '2'), - ('321', '3367', '2006-02-16T02:30:53', '2005-07-06T19:24:55', '2005-07-14T20:30:55', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['3331', '10182', '5455', '3236', '10596', '14300', '6453', '6978', '4927', '15633', '1277', '3323', '4223', '13718', '4943', '4808', '12920', '7184', '5471', '14045', '13284', '9571', '4471', '11115', '4021', '7684', '9512', '2721', '14121', '4722', '8301', '3214', '14647', '3375', '5063', '4817', '7293', '12917', '291', '13243', '15648', '4763', '1693', '5602', '7714', '11988', '4154', '677', '10239', '869', '14668', '215', '3270', '12635', '9643', '5761', '4061', '9370', '6285', '9574', '7633', '7143', '12099', '637', '8417', '12948', '87', '13287', '70', '13087', '14449', '5695', '12551', '1409', '9459', '4070', '442', '8446', '9860', '15467', '2335', '10154', '14183', '2134', '14207', '7243', '10714', '13878', '9398', '16016', '6946', '6831', '9971', '11528', '234', '4450', '8870', '12200', '2656', '5802']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('352', '2913', '2006-02-16T02:30:53', '2005-06-21T09:37:53', '2005-06-26T04:01:53', '2'), - ('578', '4112', '2006-02-16T02:30:53', '2005-08-01T00:08:01', '2005-08-09T18:14:01', '2'), - ('464', '1955', '2006-02-16T02:30:53', '2005-07-09T22:28:45', '2005-07-18T02:50:45', '2'), - ('550', '1492', '2006-02-16T02:30:53', '2005-06-21T02:47:43', '2005-06-29T08:04:43', '2'), - ('112', '803', '2006-02-16T02:30:53', '2005-08-01T14:18:57', '2005-08-07T14:59:57', '2'), - ('382', '690', '2006-02-16T02:30:53', '2005-08-21T07:19:37', '2005-08-25T12:06:37', '2'), - ('169', '2506', '2006-02-16T02:30:53', '2005-07-12T00:59:53', '2005-07-14T19:17:53', '2'), - ('132', '3645', '2006-02-16T02:30:53', '2005-07-27T00:47:40', '2005-07-31T04:32:40', '2'), - ('136', '2566', '2006-02-16T02:30:53', '2005-07-08T22:05:35', '2005-07-14T23:22:35', '2'), - ('497', '882', '2006-02-16T02:30:53', '2005-08-23T07:31:10', '2005-08-26T04:35:10', '2'), - ('464', '76', '2006-02-16T02:30:53', '2005-06-15T08:01:29', '2005-06-22T07:16:29', '2'), - ('272', '2252', '2006-02-16T02:30:53', '2005-06-21T08:45:33', '2005-06-28T08:17:33', '2'), - ('405', '2407', '2006-02-16T02:30:53', '2005-07-07T12:23:54', '2005-07-10T14:46:54', '2'), - ('19', '205', '2006-02-16T02:30:53', '2005-08-20T09:53:44', '2005-08-29T13:46:44', '2'), - ('11', '2732', '2006-02-16T02:30:53', '2005-07-08T22:43:05', '2005-07-15T18:17:05', '2'), - ('563', '2544', '2006-02-16T02:30:53', '2005-07-08T17:02:49', '2005-07-12T22:49:49', '2'), - ('511', '2516', '2006-02-16T02:30:53', '2005-08-19T04:32:32', '2005-08-27T00:44:32', '2'), - ('457', '2324', '2006-02-16T02:30:53', '2005-07-27T08:22:26', '2005-08-02T09:34:26', '2'), - ('347', '4086', '2006-02-16T02:30:53', '2005-07-09T23:11:52', '2005-07-13T02:08:52', '2'), - ('509', '3010', '2006-02-16T02:30:53', '2005-08-20T21:50:11', '2005-08-25T19:03:11', '2'), - ('338', '2128', '2006-02-16T02:30:53', '2005-08-19T18:12:31', '2005-08-25T21:26:31', '2'), - ('1', '2219', '2006-02-16T02:30:53', '2005-07-31T02:42:18', '2005-08-02T23:26:18', '2'), - ('30', '263', '2006-02-16T02:30:53', '2005-07-08T00:21:29', '2005-07-11T18:48:29', '2'), - ('408', '3812', '2006-02-16T02:30:53', '2005-08-02T08:31:06', '2005-08-04T02:36:06', '2'), - ('315', '1676', '2006-02-16T02:30:53', '2005-07-07T01:46:44', '2005-07-12T00:16:44', '2'), - ('40', '3365', '2006-02-16T02:30:53', '2005-07-28T03:11:54', '2005-07-31T04:40:54', '2'), - ('173', '3786', '2006-02-16T02:30:53', '2005-07-31T00:26:30', '2005-08-04T23:43:30', '2'), - ('358', '3786', '2006-02-16T02:30:53', '2005-06-19T14:53:24', '2005-06-21T18:22:24', '2'), - ('417', '4207', '2006-02-16T02:30:53', '2005-08-21T01:26:33', '2005-08-28T22:47:33', '2'), - ('590', '3738', '2006-02-16T02:30:53', '2005-07-08T12:42:27', '2005-07-09T09:14:27', '2'), - ('101', '562', '2006-02-16T02:30:53', '2005-07-29T03:00:08', '2005-08-01T04:26:08', '2'), - ('142', '776', '2006-02-16T02:30:53', '2005-06-21T01:08:26', '2005-06-23T03:24:26', '2'), - ('36', '3854', '2006-02-16T02:30:53', '2005-08-21T19:15:33', '2005-08-30T18:58:33', '2'), - ('279', '912', '2006-02-16T02:30:53', '2005-06-21T13:37:18', '2005-06-22T11:26:18', '2'), - ('133', '1027', '2006-02-16T02:30:53', '2005-07-09T04:37:31', '2005-07-13T09:56:31', '2'), - ('145', '1608', '2006-02-16T02:30:53', '2005-07-08T17:17:31', '2005-07-09T22:32:31', '2'), - ('5', '3333', '2006-02-16T02:30:53', '2005-07-27T12:37:28', '2005-07-30T15:12:28', '2'), - ('152', '107', '2006-02-16T02:30:53', '2005-08-19T04:27:11', '2005-08-20T03:04:11', '2'), - ('577', '485', '2006-02-16T02:30:53', '2005-05-26T20:20:47', '2005-06-03T02:06:47', '2'), - ('251', '355', '2006-02-16T02:30:53', '2005-08-19T16:33:16', '2005-08-25T13:19:16', '2'), - ('80', '4039', '2006-02-16T02:30:53', '2005-08-23T08:27:57', '2005-08-30T08:53:57', '2'), - ('465', '899', '2006-02-16T02:30:53', '2005-07-08T14:57:32', '2005-07-15T10:00:32', '2'), - ('421', '2386', '2006-02-16T02:30:53', '2005-06-16T12:39:51', '2005-06-19T16:19:51', '2'), - ('253', '3544', '2006-02-16T02:30:53', '2005-07-10T05:02:22', '2005-07-14T23:40:22', '2'), - ('70', '940', '2006-02-16T02:30:53', '2005-07-28T04:32:30', '2005-08-02T07:10:30', '2'), - ('62', '3429', '2006-02-16T02:30:53', '2005-08-17T18:23:50', '2005-08-18T22:30:50', '2'), - ('594', '191', '2006-02-16T02:30:53', '2005-07-07T08:58:23', '2005-07-14T03:16:23', '2'), - ('194', '4558', '2006-02-16T02:30:53', '2005-05-28T23:00:08', '2005-06-05T19:11:08', '2'), - ('467', '1232', '2006-02-16T02:30:53', '2005-08-01T02:09:22', '2005-08-04T01:35:22', '2'), - ('296', '3399', '2006-02-16T02:30:53', '2005-05-30T04:22:06', '2005-06-03T09:18:06', '2'), - ('152', '1450', '2006-02-16T02:30:53', '2005-08-21T19:51:30', '2005-08-29T19:38:30', '2'), - ('197', '679', '2006-02-16T02:30:53', '2005-05-26T09:02:47', '2005-05-28T09:45:47', '2'), - ('86', '1578', '2006-02-16T02:30:53', '2005-06-21T05:07:31', '2005-06-22T07:45:31', '2'), - ('15', '331', '2006-02-16T02:30:53', '2005-08-18T18:00:23', '2005-08-23T16:40:23', '2'), - ('538', '3576', '2006-02-16T02:30:53', '2005-07-31T05:35:48', '2005-08-08T04:28:48', '2'), - ('287', '1763', '2006-02-16T02:30:53', '2005-07-10T12:45:36', '2005-07-13T10:05:36', '2'), - ('70', '62', '2006-02-16T02:30:53', '2005-07-07T04:13:35', '2005-07-10T23:58:35', '2'), - ('588', '4433', '2006-02-16T02:30:53', '2005-07-30T18:57:29', '2005-08-01T21:35:29', '2'), - ('444', '2140', '2006-02-16T02:30:53', '2005-07-11T16:52:07', '2005-07-13T21:33:07', '2'), - ('233', '2782', '2006-02-16T02:30:53', '2005-07-31T02:49:20', '2005-08-05T02:36:20', '2'), - ('402', '4171', '2006-02-16T02:30:53', '2005-07-28T01:03:41', '2005-08-01T23:54:41', '2'), - ('91', '2877', '2006-02-16T02:30:53', '2005-07-27T06:56:31', '2005-07-31T04:38:31', '2'), - ('195', '1743', '2006-02-16T02:30:53', '2005-08-17T22:38:54', '2005-08-18T21:29:54', '2'), - ('250', '1581', '2006-02-16T02:30:53', '2005-05-28T18:14:29', '2005-05-29T23:48:29', '2'), - ('227', '750', '2006-02-16T02:30:53', '2005-07-29T06:53:36', '2005-08-06T09:31:36', '2'), - ('442', '4173', '2006-02-16T02:30:53', '2005-08-19T05:55:14', '2005-08-22T01:05:14', '2'), - ('331', '1586', '2006-02-16T02:30:53', '2005-05-25T13:52:43', '2005-05-29T11:12:43', '2'), - ('569', '2716', '2006-02-16T02:30:53', '2005-08-19T18:28:24', '2005-08-26T20:13:24', '2'), - ('73', '2168', '2006-02-16T02:30:53', '2005-05-25T10:15:23', '2005-05-27T05:56:23', '2'), - ('171', '2693', '2006-02-16T02:30:53', '2005-08-19T10:33:52', '2005-08-27T09:15:52', '2'), - ('529', '653', '2006-02-16T02:30:53', '2005-08-21T12:13:18', '2005-08-27T15:41:18', '2'), - ('459', '440', '2006-02-16T02:30:53', '2005-07-10T09:43:40', '2005-07-13T15:04:40', '2'), - ('15', '2195', '2006-02-16T02:30:53', '2005-08-18T14:46:26', '2005-08-19T16:59:26', '2'), - ('297', '1398', '2006-02-16T02:30:53', '2005-06-15T16:58:12', '2005-06-21T11:21:12', '2'), - ('489', '1132', '2006-02-16T02:30:53', '2005-07-30T22:24:46', '2005-08-02T00:44:46', '2'), - ('496', '2926', '2006-02-16T02:30:53', '2005-07-07T04:37:09', '2005-07-08T04:19:09', '2'), - ('403', '1457', '2006-02-16T02:30:53', '2005-05-27T18:12:13', '2005-05-30T12:30:13', '2'), - ('235', '1593', '2006-02-16T02:30:53', '2005-07-29T07:38:10', '2005-08-06T04:39:10', '2'), - ('585', '3266', '2006-02-16T02:30:53', '2005-07-31T13:03:24', '2005-08-07T07:28:24', '2'), - ('103', '3658', '2006-02-16T02:30:53', '2005-08-23T01:22:12', '2005-08-29T23:42:12', '2'), - ('446', '3968', '2006-02-16T02:30:53', '2005-06-18T10:59:36', '2005-06-26T06:42:36', '2'), - ('149', '2745', '2006-02-16T02:30:53', '2005-07-31T22:30:49', '2005-08-07T03:05:49', '2'), - ('26', '1888', '2006-02-16T02:30:53', '2005-08-21T03:24:29', '2005-08-22T07:25:29', '2'), - ('378', '1699', '2006-02-16T02:30:53', '2005-06-17T21:13:44', '2005-06-26T16:28:44', '2'), - ('569', '1327', '2006-02-16T02:30:53', '2005-08-21T04:08:19', '2005-08-29T07:59:19', '2'), - ('238', '1287', '2006-02-16T02:30:53', '2005-07-27T10:26:11', '2005-07-29T11:43:11', '2'), - ('64', '1465', '2006-02-16T02:30:53', '2005-08-01T18:51:29', '2005-08-04T18:49:29', '2'), - ('481', '49', '2006-02-16T02:30:53', '2005-08-20T15:17:38', '2005-08-21T21:11:38', '2'), - ('570', '1175', '2006-02-16T02:30:53', '2005-07-30T20:09:00', '2005-08-01T23:35:00', '2'), - ('595', '3374', '2006-02-16T02:30:53', '2005-08-23T21:26:35', '2005-08-28T16:06:35', '2'), - ('181', '1854', '2006-02-16T02:30:53', '2005-07-26T23:40:07', '2005-08-04T01:18:07', '2'), - ('163', '924', '2006-02-16T02:30:53', '2005-07-12T18:44:04', '2005-07-16T21:39:04', '2'), - ('573', '2674', '2006-02-16T02:30:53', '2005-07-31T16:42:16', '2005-08-09T18:08:16', '2'), - ('14', '893', '2006-02-16T02:30:53', '2005-08-17T00:27:23', '2005-08-22T06:12:23', '2'), - ('566', '1321', '2006-02-16T02:30:53', '2005-05-26T11:47:20', '2005-06-03T10:39:20', '2'), - ('345', '1252', '2006-02-16T02:30:53', '2005-07-07T23:20:05', '2005-07-13T19:50:05', '2'), - ('90', '4104', '2006-02-16T02:30:53', '2005-07-30T00:08:08', '2005-08-08T00:15:08', '2'), - ('52', '840', '2006-02-16T02:30:53', '2005-08-18T02:12:33', '2005-08-18T20:47:33', '2'), - ('280', '559', '2006-02-16T02:30:53', '2005-06-19T10:42:33', '2005-06-24T08:31:33', '2'), - ('520', '2295', '2006-02-16T02:30:53', '2005-07-10T15:02:17', '2005-07-19T15:43:17', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['3253', '7650', '1579', '2627', '10641', '11722', '4794', '14508', '12375', '846', '8254', '1479', '6600', '1123', '15431', '9283', '7546', '8019', '14499', '15522', '10215', '10721', '3022', '14592', '6602', '9878', '11475', '9659', '7071', '9877', '7459', '12386', '7165', '6033', '369', '1258', '15868', '15394', '301', '8467', '2948', '14410', '4796', '11886', '13473', '6099', '7652', '12363', '15064', '12232', '11892', '6344', '10309', '9760', '11706', '13459', '5001', '14771', '385', '15639', '4606', '1069', '12599', '12591', '8608', '12418', '350', '10693', '148', '15696', '15244', '5351', '13048', '13781', '6964', '11440', '11457', '887', '7895', '14675', '2059', '15819', '8351', '6780', '8645', '8319', '15629', '14958', '5307', '6436', '13962', '7037', '9419', '15760', '2120', '12806', '7981', '4893', '14666', '2143']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('405', '1906', '2006-02-16T02:30:53', '2005-06-21T03:25:37', '2005-06-27T02:46:37', '2'), - ('290', '701', '2006-02-16T02:30:53', '2005-07-28T01:47:20', '2005-08-05T06:00:20', '2'), - ('35', '158', '2006-02-16T02:30:53', '2005-06-16T04:09:08', '2005-06-21T05:21:08', '2'), - ('592', '2779', '2006-02-16T02:30:53', '2005-06-19T08:32:00', '2005-06-24T04:31:00', '2'), - ('285', '972', '2006-02-16T02:30:53', '2005-08-01T15:44:57', '2005-08-04T18:15:57', '2'), - ('321', '2430', '2006-02-16T02:30:53', '2005-08-17T07:53:03', '2005-08-22T06:56:03', '2'), - ('451', '2497', '2006-02-16T02:30:53', '2005-07-08T16:30:11', '2005-07-17T12:41:11', '2'), - ('396', '703', '2006-02-16T02:30:53', '2005-08-21T14:33:58', '2005-08-27T10:45:58', '2'), - ('365', '3508', '2006-02-16T02:30:53', '2005-08-18T08:20:08', '2005-08-21T08:50:08', '2'), - ('49', '938', '2006-02-16T02:30:53', '2005-05-30T01:17:45', '2005-06-01T00:56:45', '2'), - ('392', '1787', '2006-02-16T02:30:53', '2005-07-29T00:59:31', '2005-08-03T23:43:31', '2'), - ('592', '172', '2006-02-16T02:30:53', '2005-06-15T21:13:38', '2005-06-17T01:26:38', '2'), - ('389', '3315', '2006-02-16T02:30:53', '2005-07-12T07:41:48', '2005-07-18T12:36:48', '2'), - ('448', '142', '2006-02-16T02:30:53', '2005-05-31T16:48:43', '2005-06-02T19:17:43', '2'), - ('550', '3251', '2006-02-16T02:30:53', '2005-08-23T00:26:47', '2005-08-31T23:26:47', '2'), - ('360', '1858', '2006-02-16T02:30:53', '2005-07-30T15:25:19', '2005-08-01T15:35:19', '2'), - ('494', '3683', '2006-02-16T02:30:53', '2005-07-27T21:50:09', '2005-08-05T03:07:09', '2'), - ('84', '1844', '2006-02-16T02:30:53', '2005-07-28T15:37:43', '2005-08-04T15:40:43', '2'), - ('292', '4109', '2006-02-16T02:30:53', '2005-08-21T14:11:19', '2005-08-23T16:10:19', '2'), - ('468', '2396', '2006-02-16T02:30:53', '2005-08-23T03:32:31', '2005-08-30T02:17:31', '2'), - ('345', '838', '2006-02-16T02:30:53', '2005-08-01T01:04:28', '2005-08-09T21:43:28', '2'), - ('18', '904', '2006-02-16T02:30:53', '2005-08-01T19:05:18', '2005-08-09T20:45:18', '2'), - ('466', '3745', '2006-02-16T02:30:53', '2005-06-20T11:17:20', '2005-06-26T13:15:20', '2'), - ('563', '2681', '2006-02-16T02:30:53', '2005-08-21T17:30:17', '2005-08-22T20:06:17', '2'), - ('214', '2382', '2006-02-16T02:30:53', '2005-07-12T07:50:24', '2005-07-20T03:25:24', '2'), - ('424', '1753', '2006-02-16T02:30:53', '2005-07-31T13:42:02', '2005-08-05T10:15:02', '2'), - ('194', '3687', '2006-02-16T02:30:53', '2005-08-02T21:55:09', '2005-08-09T20:28:09', '2'), - ('360', '4262', '2006-02-16T02:30:53', '2005-07-31T06:02:14', '2005-08-07T00:54:14', '2'), - ('61', '4361', '2006-02-16T02:30:53', '2005-07-27T04:01:15', '2005-08-03T05:18:15', '2'), - ('559', '1299', '2006-02-16T02:30:53', '2005-07-31T13:41:57', '2005-08-06T15:27:57', '2'), - ('2', '2053', '2006-02-16T02:30:53', '2005-07-27T18:40:20', '2005-08-02T21:07:20', '2'), - ('199', '3303', '2006-02-16T02:30:53', '2005-08-18T08:45:57', '2005-08-24T04:50:57', '2'), - ('243', '497', '2006-02-16T02:30:53', '2005-07-27T07:36:46', '2005-07-30T09:22:46', '2'), - ('322', '2819', '2006-02-16T02:30:53', '2005-07-11T02:59:34', '2005-07-16T03:48:34', '2'), - ('508', '944', '2006-02-16T02:30:53', '2005-05-27T07:46:49', '2005-06-01T06:20:49', '2'), - ('320', '4530', '2006-02-16T02:30:53', '2005-06-15T06:21:30', '2005-06-18T05:43:30', '2'), - ('306', '2186', '2006-02-16T02:30:53', '2005-08-23T16:19:14', '2005-08-29T16:14:14', '2'), - ('507', '3455', '2006-02-16T02:30:53', '2005-08-22T23:04:21', '2005-08-25T20:53:21', '2'), - ('274', '3448', '2006-02-16T02:30:53', '2005-05-26T21:06:14', '2005-06-01T01:54:14', '2'), - ('326', '263', '2006-02-16T02:30:53', '2005-07-29T08:25:35', '2005-08-07T03:28:35', '2'), - ('289', '4254', '2006-02-16T02:30:53', '2005-06-20T06:02:35', '2005-06-29T09:12:35', '2'), - ('196', '839', '2006-02-16T02:30:53', '2005-08-21T10:54:49', '2005-08-26T08:28:49', '2'), - ('9', '2484', '2006-02-16T02:30:53', '2005-07-08T16:35:44', '2005-07-13T11:08:44', '2'), - ('204', '608', '2006-02-16T02:30:53', '2005-08-17T14:58:51', '2005-08-19T16:07:51', '2'), - ('390', '381', '2006-02-16T02:30:53', '2005-08-20T01:03:50', '2005-08-22T02:33:50', '2'), - ('469', '3865', '2006-02-16T02:30:53', '2005-07-11T06:24:44', '2005-07-15T08:03:44', '2'), - ('5', '92', '2006-02-16T02:30:53', '2005-07-28T01:50:29', '2005-07-30T22:23:29', '2'), - ('181', '3447', '2006-02-16T02:30:53', '2005-08-18T07:52:49', '2005-08-26T03:20:49', '2'), - ('425', '1233', '2006-02-16T02:30:53', '2005-08-22T10:41:58', '2005-08-28T13:34:58', '2'), - ('87', '2399', '2006-02-16T02:30:53', '2005-08-18T03:14:14', '2005-08-19T05:44:14', '2'), - ('227', '746', '2006-02-16T02:30:53', '2005-08-17T15:13:21', '2005-08-21T09:19:21', '2'), - ('78', '3074', '2006-02-16T02:30:53', '2005-07-11T20:04:43', '2005-07-18T14:35:43', '2'), - ('156', '1505', '2006-02-16T02:30:53', '2005-08-01T04:24:18', '2005-08-09T08:32:18', '2'), - ('511', '426', '2006-02-16T02:30:53', '2005-07-31T09:29:33', '2005-08-09T07:32:33', '2'), - ('414', '4234', '2006-02-16T02:30:53', '2005-08-17T07:23:46', '2005-08-18T10:13:46', '2'), - ('114', '3666', '2006-02-16T02:30:53', '2005-08-20T00:45:40', '2005-08-29T02:53:40', '2'), - ('40', '2025', '2006-02-16T02:30:53', '2005-07-09T01:17:04', '2005-07-16T03:25:04', '2'), - ('149', '2665', '2006-02-16T02:30:53', '2005-08-21T23:50:15', '2005-08-28T22:55:15', '2'), - ('213', '1565', '2006-02-16T02:30:53', '2005-05-27T10:23:25', '2005-05-30T15:27:25', '2'), - ('214', '42', '2006-02-16T02:30:53', '2005-08-23T08:03:25', '2005-08-24T10:21:25', '2'), - ('502', '1946', '2006-02-16T02:30:53', '2005-07-08T07:05:50', '2005-07-16T09:11:50', '2'), - ('251', '3057', '2006-02-16T02:30:53', '2005-05-31T09:32:31', '2005-06-08T10:19:31', '2'), - ('34', '2032', '2006-02-16T02:30:53', '2005-08-18T16:42:45', '2005-08-23T18:27:45', '2'), - ('546', '723', '2006-02-16T02:30:53', '2005-08-18T16:16:41', '2005-08-24T10:29:41', '2'), - ('165', '2976', '2006-02-16T02:30:53', '2005-07-29T13:18:52', '2005-07-30T19:01:52', '2'), - ('241', '4186', '2006-02-16T02:30:53', '2005-08-18T09:59:36', '2005-08-19T11:35:36', '2'), - ('9', '2756', '2006-02-16T02:30:53', '2005-05-27T05:01:28', '2005-06-04T05:01:28', '2'), - ('444', '2387', '2006-02-16T02:30:53', '2005-08-01T18:14:14', '2005-08-03T22:00:14', '2'), - ('142', '4252', '2006-02-16T02:30:53', '2005-05-26T00:25:23', '2005-06-01T19:29:23', '2'), - ('93', '2836', '2006-02-16T02:30:53', '2005-08-23T10:04:17', '2005-08-25T08:47:17', '2'), - ('271', '1486', '2006-02-16T02:30:53', '2005-08-22T17:48:42', '2005-08-28T13:17:42', '2'), - ('112', '3722', '2006-02-16T02:30:53', '2005-07-09T17:40:52', '2005-07-14T16:55:52', '2'), - ('486', '1029', '2006-02-16T02:30:53', '2005-08-19T09:25:06', '2005-08-28T11:18:06', '2'), - ('368', '971', '2006-02-16T02:30:53', '2005-08-20T12:06:45', '2005-08-26T06:50:45', '2'), - ('404', '1537', '2006-02-16T02:30:53', '2005-07-27T00:15:04', '2005-07-31T00:04:04', '2'), - ('306', '2727', '2006-02-16T02:30:53', '2005-08-02T20:24:02', '2005-08-07T16:42:02', '2'), - ('379', '1642', '2006-02-16T02:30:53', '2005-08-02T21:14:16', '2005-08-10T02:39:16', '2'), - ('16', '2727', '2006-02-16T02:30:53', '2005-05-30T07:10:00', '2005-06-01T06:48:00', '2'), - ('67', '900', '2006-02-16T02:30:53', '2005-07-28T10:57:15', '2005-08-02T15:10:15', '2'), - ('170', '328', '2006-02-16T02:30:53', '2005-08-21T20:01:51', '2005-08-26T14:30:51', '2'), - ('114', '739', '2006-02-16T02:30:53', '2005-06-17T15:36:12', '2005-06-18T19:01:12', '2'), - ('274', '3639', '2006-02-16T02:30:53', '2005-08-23T15:01:54', '2005-08-31T20:01:54', '2'), - ('202', '2963', '2006-02-16T02:30:53', '2005-07-29T04:50:53', '2005-07-30T07:28:53', '2'), - ('121', '1255', '2006-02-16T02:30:53', '2005-07-12T16:18:12', '2005-07-13T17:56:12', '2'), - ('535', '2532', '2006-02-16T02:30:53', '2005-07-29T14:47:45', '2005-07-30T14:56:45', '2'), - ('280', '747', '2006-02-16T02:30:53', '2005-07-29T03:44:52', '2005-08-01T00:35:52', '2'), - ('286', '3725', '2006-02-16T02:30:53', '2005-08-23T07:28:22', '2005-08-29T06:29:22', '2'), - ('347', '1710', '2006-02-16T02:30:53', '2005-08-22T06:30:10', '2005-08-28T09:43:10', '2'), - ('32', '2847', '2006-02-16T02:30:53', '2005-07-09T15:57:15', '2005-07-17T13:42:15', '2'), - ('122', '3758', '2006-02-16T02:30:53', '2005-07-12T00:18:42', '2005-07-13T03:57:42', '2'), - ('348', '1434', '2006-02-16T02:30:53', '2005-08-20T18:18:06', '2005-08-24T22:16:06', '2'), - ('171', '3155', '2006-02-16T02:30:53', '2005-07-27T03:06:44', '2005-08-02T04:51:44', '2'), - ('142', '4427', '2006-02-16T02:30:53', '2005-07-30T21:04:59', '2005-08-06T15:47:59', '2'), - ('273', '3050', '2006-02-16T02:30:53', '2005-08-23T12:50:00', '2005-08-29T15:41:00', '2'), - ('182', '1498', '2006-02-16T02:30:53', '2005-06-17T20:36:50', '2005-06-27T01:18:50', '2'), - ('423', '4488', '2006-02-16T02:30:53', '2005-08-19T00:37:26', '2005-08-23T18:49:26', '2'), - ('392', '90', '2006-02-16T02:30:53', '2005-07-28T14:18:25', '2005-08-04T15:21:25', '2'), - ('210', '2060', '2006-02-16T02:30:53', '2005-07-08T20:19:55', '2005-07-15T21:28:55', '2'), - ('122', '2560', '2006-02-16T02:30:53', '2005-08-21T19:51:09', '2005-08-30T22:42:09', '2'), - ('507', '1257', '2006-02-16T02:30:53', '2005-06-17T21:58:13', '2005-06-19T23:59:13', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['14749', '8002', '3894', '11685', '1008', '9107', '14630', '14177', '5855', '5672', '8099', '8860', '1807', '4026', '5646', '8141', '4317', '15166', '8160', '13588', '1575', '15568', '15122', '6220', '9728', '10657', '14715', '11354', '14734', '13796', '7899', '3944', '12226', '4254', '693', '54', '6891', '3873', '10614', '13036', '7041', '14411', '4690', '5588', '11004', '3114', '15085', '3195', '429', '9207', '7977', '3834', '914', '3160', '3619', '2446', '12893', '1444', '4354', '1102', '3537', '3951', '9668', '10592', '1194', '6489', '8094', '1146', '2857', '13360', '10390', '4211', '12690', '9196', '3828', '6080', '335', '11608', '14334', '14277', '13543', '7364', '15768', '10085', '3437', '8135', '1574', '501', '10986', '15412', '10911', '259', '5265', '5716', '9339', '6488', '8653', '14029', '10345', '14356']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('235', '831', '2006-02-16T02:30:53', '2005-08-21T23:08:33', '2005-08-29T20:46:33', '2'), - ('449', '22', '2006-02-16T02:30:53', '2005-07-28T15:11:00', '2005-07-31T15:46:00', '2'), - ('149', '2087', '2006-02-16T02:30:53', '2005-07-06T19:01:39', '2005-07-12T21:35:39', '2'), - ('51', '3552', '2006-02-16T02:30:53', '2005-08-17T06:39:16', '2005-08-22T04:20:16', '2'), - ('599', '914', '2006-02-16T02:30:53', '2005-05-31T01:18:56', '2005-06-01T01:24:56', '2'), - ('531', '1068', '2006-02-16T02:30:53', '2005-07-30T08:52:45', '2005-08-05T08:39:45', '2'), - ('294', '4049', '2006-02-16T02:30:53', '2005-08-21T18:43:44', '2005-08-29T17:08:44', '2'), - ('121', '409', '2006-02-16T02:30:53', '2005-08-21T03:11:33', '2005-08-28T21:41:33', '2'), - ('166', '2457', '2006-02-16T02:30:53', '2005-07-10T17:54:06', '2005-07-18T15:41:06', '2'), - ('158', '2326', '2006-02-16T02:30:53', '2005-07-10T08:19:38', '2005-07-16T06:28:38', '2'), - ('36', '3694', '2006-02-16T02:30:53', '2005-07-28T18:35:12', '2005-07-30T15:44:12', '2'), - ('531', '2841', '2006-02-16T02:30:53', '2005-07-29T23:45:57', '2005-08-06T02:14:57', '2'), - ('338', '1174', '2006-02-16T02:30:53', '2005-06-16T20:58:59', '2005-06-20T21:31:59', '2'), - ('251', '4142', '2006-02-16T02:30:53', '2005-07-07T02:15:48', '2005-07-14T04:15:48', '2'), - ('166', '1471', '2006-02-16T02:30:53', '2005-07-10T07:08:09', '2005-07-14T03:48:09', '2'), - ('523', '361', '2006-02-16T02:30:53', '2005-07-28T20:21:19', '2005-07-30T19:16:19', '2'), - ('110', '2234', '2006-02-16T02:30:53', '2005-07-07T17:44:49', '2005-07-08T21:48:49', '2'), - ('504', '1530', '2006-02-16T02:30:53', '2005-08-22T15:05:37', '2005-08-30T12:22:37', '2'), - ('138', '2446', '2006-02-16T02:30:53', '2005-07-28T21:10:30', '2005-08-05T16:52:30', '2'), - ('279', '702', '2006-02-16T02:30:53', '2005-08-20T05:47:11', '2005-08-28T02:45:11', '2'), - ('6', '3317', '2006-02-16T02:30:53', '2005-06-16T03:41:38', '2005-06-22T03:01:38', '2'), - ('556', '988', '2006-02-16T02:30:53', '2005-08-23T05:24:09', '2005-08-27T08:57:09', '2'), - ('91', '1686', '2006-02-16T02:30:53', '2005-08-22T12:47:45', '2005-08-29T13:18:45', '2'), - ('421', '1717', '2006-02-16T02:30:53', '2005-07-11T13:22:06', '2005-07-12T17:46:06', '2'), - ('399', '3630', '2006-02-16T02:30:53', '2005-07-31T08:40:54', '2005-08-03T04:14:54', '2'), - ('590', '3075', '2006-02-16T02:30:53', '2005-08-01T16:38:44', '2005-08-06T16:05:44', '2'), - ('287', '4453', '2006-02-16T02:30:53', '2005-08-21T21:28:18', '2005-08-26T22:13:18', '2'), - ('569', '1887', '2006-02-16T02:30:53', '2005-08-02T17:35:10', '2005-08-09T12:07:10', '2'), - ('448', '1369', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('209', '28', '2006-02-16T02:30:53', '2005-08-20T12:32:32', '2005-08-29T10:48:32', '2'), - ('452', '4130', '2006-02-16T02:30:53', '2005-07-28T11:10:12', '2005-08-02T13:20:12', '2'), - ('436', '4213', '2006-02-16T02:30:53', '2005-07-06T21:34:11', '2005-07-08T23:46:11', '2'), - ('234', '682', '2006-02-16T02:30:53', '2005-08-18T03:00:48', '2005-08-25T00:43:48', '2'), - ('529', '3957', '2006-02-16T02:30:53', '2005-07-07T14:13:52', '2005-07-12T10:39:52', '2'), - ('190', '635', '2006-02-16T02:30:53', '2005-05-29T01:42:31', '2005-06-03T02:29:31', '2'), - ('291', '2787', '2006-02-16T02:30:53', '2005-05-25T07:23:25', '2005-06-01T05:05:25', '2'), - ('507', '3189', '2006-02-16T02:30:53', '2005-07-12T21:07:35', '2005-07-14T16:59:35', '2'), - ('394', '4148', '2006-02-16T02:30:53', '2005-07-06T18:03:16', '2005-07-15T23:58:16', '2'), - ('533', '232', '2006-02-16T02:30:53', '2005-08-01T14:57:00', '2005-08-10T09:31:00', '2'), - ('20', '1469', '2006-02-16T02:30:53', '2005-08-19T08:48:37', '2005-08-22T04:13:37', '2'), - ('379', '4212', '2006-02-16T02:30:53', '2005-07-27T03:18:32', '2005-07-30T06:40:32', '2'), - ('502', '2125', '2006-02-16T02:30:53', '2005-08-21T10:54:57', '2005-08-22T13:17:57', '2'), - ('64', '3304', '2006-02-16T02:30:53', '2005-07-08T11:04:02', '2005-07-15T10:27:02', '2'), - ('535', '1166', '2006-02-16T02:30:53', '2005-07-10T04:21:10', '2005-07-16T02:58:10', '2'), - ('45', '200', '2006-02-16T02:30:53', '2005-08-02T05:04:18', '2005-08-11T00:03:18', '2'), - ('8', '2388', '2006-02-16T02:30:53', '2005-06-20T17:57:47', '2005-06-21T19:18:47', '2'), - ('67', '1669', '2006-02-16T02:30:53', '2005-08-22T11:19:22', '2005-08-25T09:04:22', '2'), - ('165', '2383', '2006-02-16T02:30:53', '2005-06-21T00:02:10', '2005-06-21T23:11:10', '2'), - ('498', '129', '2006-02-16T02:30:53', '2005-05-27T16:21:26', '2005-06-05T20:23:26', '2'), - ('345', '1346', '2006-02-16T02:30:53', '2005-07-30T12:49:57', '2005-07-31T14:32:57', '2'), - ('389', '3162', '2006-02-16T02:30:53', '2005-07-28T14:15:54', '2005-08-01T18:58:54', '2'), - ('366', '3001', '2006-02-16T02:30:53', '2005-07-06T16:19:56', '2005-07-13T11:38:56', '2'), - ('596', '1393', '2006-02-16T02:30:53', '2005-05-30T11:06:00', '2005-06-04T06:07:00', '2'), - ('561', '4333', '2006-02-16T02:30:53', '2005-06-20T21:20:51', '2005-06-29T18:06:51', '2'), - ('526', '3350', '2006-02-16T02:30:53', '2005-07-06T05:59:44', '2005-07-11T08:58:44', '2'), - ('466', '1283', '2006-02-16T02:30:53', '2005-06-18T19:04:41', '2005-06-27T17:10:41', '2'), - ('498', '168', '2006-02-16T02:30:53', '2005-08-19T03:46:43', '2005-08-20T08:38:43', '2'), - ('539', '1303', '2006-02-16T02:30:53', '2005-06-15T19:08:16', '2005-06-24T15:20:16', '2'), - ('208', '4423', '2006-02-16T02:30:53', '2005-07-07T19:21:02', '2005-07-15T17:03:02', '2'), - ('115', '2052', '2006-02-16T02:30:53', '2005-05-31T14:20:29', '2005-06-04T17:38:29', '2'), - ('479', '4220', '2006-02-16T02:30:53', '2005-07-06T01:36:53', '2005-07-13T07:01:53', '2'), - ('250', '2288', '2006-02-16T02:30:53', '2005-07-06T21:50:41', '2005-07-12T02:09:41', '2'), - ('378', '1647', '2006-02-16T02:30:53', '2005-07-31T06:31:03', '2005-08-07T06:19:03', '2'), - ('265', '829', '2006-02-16T02:30:53', '2005-08-01T14:13:00', '2005-08-09T13:03:00', '2'), - ('402', '3774', '2006-02-16T02:30:53', '2005-06-15T01:25:08', '2005-06-21T01:16:08', '2'), - ('268', '1821', '2006-02-16T02:30:53', '2005-07-12T02:22:46', '2005-07-17T06:16:46', '2'), - ('432', '4276', '2006-02-16T02:30:53', '2005-07-28T18:30:28', '2005-08-05T17:37:28', '2'), - ('250', '3134', '2006-02-16T02:30:53', '2005-05-31T20:34:45', '2005-06-03T18:12:45', '2'), - ('364', '2886', '2006-02-16T02:30:53', '2005-06-19T23:15:15', '2005-06-25T04:24:15', '2'), - ('327', '3396', '2006-02-16T02:30:53', '2005-08-19T21:05:11', '2005-08-24T16:05:11', '2'), - ('502', '1489', '2006-02-16T02:30:53', '2005-08-01T06:46:48', '2005-08-09T02:55:48', '2'), - ('214', '2001', '2006-02-16T02:30:53', '2005-07-07T11:50:41', '2005-07-09T13:58:41', '2'), - ('361', '3574', '2006-02-16T02:30:53', '2005-08-18T20:06:57', '2005-08-24T20:54:57', '2'), - ('251', '4298', '2006-02-16T02:30:53', '2005-07-30T12:30:19', '2005-07-31T18:01:19', '2'), - ('498', '4493', '2006-02-16T02:30:53', '2005-07-06T15:57:30', '2005-07-10T12:17:30', '2'), - ('115', '2682', '2006-02-16T02:30:53', '2005-07-11T05:08:11', '2005-07-16T09:54:11', '2'), - ('16', '1411', '2006-02-16T02:30:53', '2005-05-27T03:07:10', '2005-06-05T00:15:10', '2'), - ('448', '1673', '2006-02-16T02:30:53', '2005-08-17T03:36:52', '2005-08-25T07:17:52', '2'), - ('595', '1448', '2006-02-16T02:30:53', '2005-08-21T08:32:32', '2005-08-25T02:53:32', '2'), - ('566', '2652', '2006-02-16T02:30:53', '2005-08-21T06:34:41', '2005-08-28T10:53:41', '2'), - ('163', '2142', '2006-02-16T02:30:53', '2005-08-20T03:43:13', '2005-08-29T07:14:13', '2'), - ('592', '3046', '2006-02-16T02:30:53', '2005-07-27T14:58:40', '2005-08-03T09:01:40', '2'), - ('267', '662', '2006-02-16T02:30:53', '2005-08-23T13:14:47', '2005-08-29T14:17:47', '2'), - ('392', '2556', '2006-02-16T02:30:53', '2005-07-31T20:12:02', '2005-08-03T00:03:02', '2'), - ('211', '1798', '2006-02-16T02:30:53', '2005-06-21T19:20:17', '2005-07-01T01:09:17', '2'), - ('164', '1339', '2006-02-16T02:30:53', '2005-07-28T20:03:25', '2005-08-03T01:28:25', '2'), - ('305', '161', '2006-02-16T02:30:53', '2005-06-16T03:39:56', '2005-06-22T05:40:56', '2'), - ('162', '601', '2006-02-16T02:30:53', '2005-05-28T01:09:36', '2005-05-30T06:14:36', '2'), - ('597', '555', '2006-02-16T02:30:53', '2005-08-02T04:35:24', '2005-08-09T07:34:24', '2'), - ('199', '1267', '2006-02-16T02:30:53', '2005-08-22T23:37:11', '2005-08-28T23:26:11', '2'), - ('195', '769', '2006-02-16T02:30:53', '2005-08-02T01:58:36', '2005-08-08T07:37:36', '2'), - ('482', '30', '2006-02-16T02:30:53', '2005-05-26T15:32:46', '2005-06-04T15:27:46', '2'), - ('139', '4482', '2006-02-16T02:30:53', '2005-07-09T14:15:01', '2005-07-18T14:43:01', '2'), - ('102', '3416', '2006-02-16T02:30:53', '2005-07-10T10:59:23', '2005-07-16T12:25:23', '2'), - ('68', '3171', '2006-02-16T02:30:53', '2005-07-30T18:03:28', '2005-08-08T19:45:28', '2'), - ('169', '3974', '2006-02-16T02:30:53', '2005-07-12T02:20:09', '2005-07-20T00:53:09', '2'), - ('230', '4440', '2006-02-16T02:30:53', '2005-07-29T15:04:23', '2005-08-02T09:39:23', '2'), - ('219', '2653', '2006-02-16T02:30:53', '2005-08-20T21:23:11', '2005-08-22T18:01:11', '2'), - ('42', '3985', '2006-02-16T02:30:53', '2005-08-01T05:18:56', '2005-08-04T01:34:56', '2'), - ('65', '3169', '2006-02-16T02:30:53', '2005-08-21T09:08:51', '2005-08-24T04:36:51', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['11882', '1596', '12969', '14717', '9001', '4642', '6779', '3476', '6677', '15886', '6299', '6228', '10956', '4898', '6442', '4871', '1697', '7799', '6038', '14318', '5092', '6502', '11625', '14153', '12709', '13873', '4630', '3006', '14519', '928', '4304', '1515', '10114', '11718', '6417', '2383', '15153', '4010', '1658', '6988', '4580', '4090', '11543', '4850', '7402', '9894', '14268', '1372', '10782', '840', '13794', '14333', '550', '3387', '13793', '4127', '2484', '15964', '8548', '3785', '14841', '13899', '3311', '9158', '7891', '3581', '12013', '7592', '7973', '4969', '12143', '1652', '14903', '6052', '12506', '2798', '14110', '15780', '11048', '10653', '1657', '6196', '10702', '805', '13092', '2862', '8085', '10252', '6668', '16040', '7142', '9136', '11404', '4519', '8556', '2523', '4442', '8333', '13320', '7716']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('234', '2401', '2006-02-16T02:30:53', '2005-08-17T14:33:41', '2005-08-26T17:25:41', '2'), - ('416', '2552', '2006-02-16T02:30:53', '2005-06-16T05:30:58', '2005-06-21T04:18:58', '2'), - ('224', '191', '2006-02-16T02:30:53', '2005-08-19T06:38:59', '2005-08-25T09:09:59', '2'), - ('366', '3839', '2006-02-16T02:30:53', '2005-08-21T21:30:39', '2005-08-26T16:58:39', '2'), - ('440', '3682', '2006-02-16T02:30:53', '2005-07-30T04:59:41', '2005-07-31T08:56:41', '2'), - ('30', '1962', '2006-02-16T02:30:53', '2005-07-08T09:13:28', '2005-07-10T06:17:28', '2'), - ('404', '4468', '2006-02-16T02:30:53', '2005-07-12T16:10:50', '2005-07-17T14:51:50', '2'), - ('490', '3011', '2006-02-16T02:30:53', '2005-07-05T23:02:37', '2005-07-10T22:17:37', '2'), - ('516', '2389', '2006-02-16T02:30:53', '2005-07-12T11:58:14', '2005-07-21T06:05:14', '2'), - ('91', '3038', '2006-02-16T02:30:53', '2005-08-23T16:50:53', '2005-08-26T15:38:53', '2'), - ('324', '4125', '2006-02-16T02:30:53', '2005-07-11T17:45:08', '2005-07-13T16:36:08', '2'), - ('367', '2281', '2006-02-16T02:30:53', '2005-07-11T13:58:36', '2005-07-17T19:03:36', '2'), - ('54', '4372', '2006-02-16T02:30:53', '2005-08-02T03:33:14', '2005-08-09T09:20:14', '2'), - ('218', '3212', '2006-02-16T02:30:53', '2005-07-08T20:31:43', '2005-07-15T15:58:43', '2'), - ('360', '1273', '2006-02-16T02:30:53', '2005-07-12T00:29:45', '2005-07-15T19:37:45', '2'), - ('210', '2509', '2006-02-16T02:30:53', '2005-07-08T19:19:52', '2005-07-13T20:27:52', '2'), - ('340', '1801', '2006-02-16T02:30:53', '2005-06-16T12:55:20', '2005-06-23T17:41:20', '2'), - ('384', '2163', '2006-02-16T02:30:53', '2005-07-28T07:42:09', '2005-08-02T10:02:09', '2'), - ('243', '1555', '2006-02-16T02:30:53', '2005-07-11T03:10:37', '2005-07-19T05:14:37', '2'), - ('508', '1042', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('139', '3256', '2006-02-16T02:30:53', '2005-07-09T05:57:39', '2005-07-12T00:45:39', '2'), - ('40', '1641', '2006-02-16T02:30:53', '2005-07-12T03:15:45', '2005-07-17T08:47:45', '2'), - ('521', '712', '2006-02-16T02:30:53', '2005-08-17T04:18:52', '2005-08-25T03:05:52', '2'), - ('120', '1502', '2006-02-16T02:30:53', '2005-08-21T02:24:33', '2005-08-27T05:28:33', '2'), - ('476', '3878', '2006-02-16T02:30:53', '2005-08-18T20:59:51', '2005-08-26T01:21:51', '2'), - ('306', '1683', '2006-02-16T02:30:53', '2005-08-20T15:11:11', '2005-08-22T20:13:11', '2'), - ('319', '3446', '2006-02-16T02:30:53', '2005-07-08T08:33:38', '2005-07-09T13:09:38', '2'), - ('133', '1677', '2006-02-16T02:30:53', '2005-06-20T10:10:29', '2005-06-22T07:26:29', '2'), - ('403', '1541', '2006-02-16T02:30:53', '2005-08-21T14:59:29', '2005-08-22T11:48:29', '2'), - ('79', '246', '2006-02-16T02:30:53', '2005-05-30T12:27:14', '2005-06-05T13:56:14', '2'), - ('165', '3382', '2006-02-16T02:30:53', '2005-07-07T17:01:19', '2005-07-12T22:47:19', '2'), - ('115', '3244', '2006-02-16T02:30:53', '2005-06-15T23:07:50', '2005-06-20T02:33:50', '2'), - ('218', '3881', '2006-02-16T02:30:53', '2005-07-31T21:12:58', '2005-08-02T19:45:58', '2'), - ('555', '3673', '2006-02-16T02:30:53', '2005-08-17T07:44:42', '2005-08-23T03:02:42', '2'), - ('80', '3042', '2006-02-16T02:30:53', '2005-07-11T23:35:11', '2005-07-18T20:00:11', '2'), - ('149', '2459', '2006-02-16T02:30:53', '2005-06-18T15:17:59', '2005-06-26T18:42:59', '2'), - ('512', '1051', '2006-02-16T02:30:53', '2005-08-22T14:26:01', '2005-08-27T14:17:01', '2'), - ('476', '4509', '2006-02-16T02:30:53', '2005-07-07T00:47:00', '2005-07-12T06:23:00', '2'), - ('568', '272', '2006-02-16T02:30:53', '2005-06-16T10:07:10', '2005-06-21T09:23:10', '2'), - ('316', '756', '2006-02-16T02:30:53', '2005-07-27T01:00:08', '2005-07-31T04:35:08', '2'), - ('199', '3512', '2006-02-16T02:30:53', '2005-07-08T06:04:23', '2005-07-15T05:42:23', '2'), - ('67', '3096', '2006-02-16T02:30:53', '2005-07-07T05:47:33', '2005-07-08T04:25:33', '2'), - ('238', '2860', '2006-02-16T02:30:53', '2005-08-17T00:54:28', '2005-08-25T04:31:28', '2'), - ('154', '3039', '2006-02-16T02:30:53', '2005-07-08T18:39:31', '2005-07-13T00:18:31', '2'), - ('287', '2707', '2006-02-16T02:30:53', '2005-07-27T16:19:40', '2005-08-05T14:48:40', '2'), - ('199', '3724', '2006-02-16T02:30:53', '2005-07-31T14:07:44', '2005-08-05T18:01:44', '2'), - ('278', '2442', '2006-02-16T02:30:53', '2005-08-21T06:21:24', '2005-08-23T05:39:24', '2'), - ('108', '3740', '2006-02-16T02:30:53', '2005-06-15T14:45:48', '2005-06-17T18:02:48', '2'), - ('577', '1507', '2006-02-16T02:30:53', '2005-08-01T21:23:25', '2005-08-03T20:15:25', '2'), - ('79', '4049', '2006-02-16T02:30:53', '2005-05-30T00:28:41', '2005-05-31T20:39:41', '2'), - ('557', '2148', '2006-02-16T02:30:53', '2005-08-20T12:25:32', '2005-08-23T06:38:32', '2'), - ('93', '2976', '2006-02-16T02:30:53', '2005-08-21T08:31:03', '2005-08-28T03:39:03', '2'), - ('432', '3632', '2006-02-16T02:30:53', '2005-05-28T07:39:16', '2005-06-06T12:20:16', '2'), - ('305', '2709', '2006-02-16T02:30:53', '2005-06-21T14:21:49', '2005-06-24T16:46:49', '2'), - ('424', '2598', '2006-02-16T02:30:53', '2005-08-20T12:22:04', '2005-08-27T09:51:04', '2'), - ('15', '1774', '2006-02-16T02:30:53', '2005-07-07T07:26:19', '2005-07-14T07:50:19', '2'), - ('515', '1511', '2006-02-16T02:30:53', '2005-06-18T21:25:23', '2005-06-24T16:03:23', '2'), - ('141', '251', '2006-02-16T02:30:53', '2005-08-23T19:45:25', '2005-08-26T22:43:25', '2'), - ('14', '3366', '2006-02-16T02:30:53', '2005-07-29T11:11:33', '2005-08-04T11:52:33', '2'), - ('577', '3279', '2006-02-16T02:30:53', '2005-07-06T14:00:13', '2005-07-14T10:13:13', '2'), - ('384', '4017', '2006-02-16T02:30:53', '2005-08-22T02:03:30', '2005-08-28T02:08:30', '2'), - ('204', '427', '2006-02-16T02:30:53', '2005-08-20T16:05:11', '2005-08-23T15:14:11', '2'), - ('518', '3438', '2006-02-16T02:30:53', '2005-06-21T08:05:27', '2005-06-22T06:51:27', '2'), - ('16', '4017', '2006-02-16T02:30:53', '2005-07-30T11:12:03', '2005-08-02T05:55:03', '2'), - ('560', '3637', '2006-02-16T02:30:53', '2005-07-28T10:43:56', '2005-08-05T14:04:56', '2'), - ('235', '4520', '2006-02-16T02:30:53', '2005-07-06T03:57:35', '2005-07-07T08:07:35', '2'), - ('586', '3530', '2006-02-16T02:30:53', '2005-08-17T19:23:02', '2005-08-23T00:31:02', '2'), - ('316', '4105', '2006-02-16T02:30:53', '2005-07-27T23:26:04', '2005-07-29T23:48:04', '2'), - ('339', '3936', '2006-02-16T02:30:53', '2005-07-28T14:10:06', '2005-07-29T11:26:06', '2'), - ('231', '4563', '2006-02-16T02:30:53', '2005-07-08T23:51:26', '2005-07-12T03:21:26', '2'), - ('117', '2876', '2006-02-16T02:30:53', '2005-08-18T00:06:26', '2005-08-24T02:45:26', '2'), - ('533', '3416', '2006-02-16T02:30:53', '2005-06-16T09:31:37', '2005-06-19T14:02:37', '2'), - ('51', '1795', '2006-02-16T02:30:53', '2005-08-22T04:31:50', '2005-08-25T22:53:50', '2'), - ('75', '881', '2006-02-16T02:30:53', '2005-07-11T03:51:27', '2005-07-16T02:55:27', '2'), - ('114', '1132', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('180', '1343', '2006-02-16T02:30:53', '2005-06-19T19:07:48', '2005-06-23T00:09:48', '2'), - ('35', '2709', '2006-02-16T02:30:53', '2005-08-21T00:53:09', '2005-08-24T05:33:09', '2'), - ('120', '2911', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('491', '206', '2006-02-16T02:30:53', '2005-08-02T06:15:07', '2005-08-04T02:47:07', '2'), - ('75', '1190', '2006-02-16T02:30:53', '2005-08-01T16:28:07', '2005-08-07T21:22:07', '2'), - ('209', '953', '2006-02-16T02:30:53', '2005-06-16T10:06:49', '2005-06-22T10:34:49', '2'), - ('429', '995', '2006-02-16T02:30:53', '2005-07-11T12:05:46', '2005-07-18T08:27:46', '2'), - ('560', '2802', '2006-02-16T02:30:53', '2005-08-01T18:34:59', '2005-08-09T23:44:59', '2'), - ('232', '3132', '2006-02-16T02:30:53', '2005-05-29T18:18:18', '2005-06-07T15:11:18', '2'), - ('480', '4359', '2006-02-16T02:30:53', '2005-08-19T10:41:09', '2005-08-25T05:11:09', '2'), - ('52', '4260', '2006-02-16T02:30:53', '2005-06-19T23:47:24', '2005-06-23T03:39:24', '2'), - ('552', '3059', '2006-02-16T02:30:53', '2005-07-28T18:13:15', '2005-08-04T13:45:15', '2'), - ('86', '2380', '2006-02-16T02:30:53', '2005-08-01T02:39:39', '2005-08-10T00:40:39', '2'), - ('199', '1498', '2006-02-16T02:30:53', '2005-07-12T11:37:45', '2005-07-14T13:28:45', '2'), - ('195', '3524', '2006-02-16T02:30:53', '2005-08-23T22:19:33', '2005-09-02T02:19:33', '2'), - ('396', '1743', '2006-02-16T02:30:53', '2005-07-27T06:55:39', '2005-07-28T01:41:39', '2'), - ('57', '1734', '2006-02-16T02:30:53', '2005-07-30T10:07:20', '2005-07-31T08:20:20', '2'), - ('60', '3285', '2006-02-16T02:30:53', '2005-08-02T19:12:40', '2005-08-11T22:38:40', '2'), - ('459', '4425', '2006-02-16T02:30:53', '2005-07-08T02:51:23', '2005-07-12T06:52:23', '2'), - ('231', '2793', '2006-02-16T02:30:53', '2005-07-29T11:18:27', '2005-07-30T05:21:27', '2'), - ('89', '460', '2006-02-16T02:30:53', '2005-06-19T00:45:56', '2005-06-21T00:54:56', '2'), - ('123', '461', '2006-02-16T02:30:53', '2005-07-07T23:05:30', '2005-07-13T22:20:30', '2'), - ('494', '823', '2006-02-16T02:30:53', '2005-07-29T04:16:40', '2005-08-02T10:10:40', '2'), - ('172', '4522', '2006-02-16T02:30:53', '2005-08-19T19:35:33', '2005-08-24T20:09:33', '2'), - ('284', '1493', '2006-02-16T02:30:53', '2005-07-28T04:33:15', '2005-08-04T00:08:15', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['9483', '14339', '1655', '14775', '8025', '2472', '15838', '13277', '4031', '15812', '9846', '15312', '8188', '7179', '9980', '9639', '15683', '10908', '8990', '8567', '15222', '10037', '4621', '1450', '6386', '8579', '11651', '229', '2796', '820', '16028', '326', '3655', '1389', '6162', '7436', '10159', '12909', '2248', '8776', '11292', '1936', '4853', '7717', '8326', '15899', '10395', '3225', '6761', '3935', '14990', '10531', '11747', '9251', '15081', '5341', '13707', '14043', '2545', '5090', '974', '11794', '3187', '9099', '12214', '4611', '8214', '9839', '14376', '7685', '4698', '15297', '5854', '1487', '7220', '14857', '13260', '4281', '13022', '12556', '3407', '4345', '7739', '11241', '13206', '3167', '4867', '14150', '13601', '15403', '5054', '15634', '14118', '12681', '446', '11119', '11448', '7303', '3979', '15399']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('593', '1136', '2006-02-16T02:30:53', '2005-07-30T23:31:31', '2005-08-09T04:29:31', '2'), - ('30', '1744', '2006-02-16T02:30:53', '2005-08-21T08:37:15', '2005-08-26T03:37:15', '2'), - ('488', '3693', '2006-02-16T02:30:53', '2005-06-16T09:51:39', '2005-06-23T14:53:39', '2'), - ('400', '4044', '2006-02-16T02:30:53', '2005-08-21T23:53:07', '2005-08-22T18:07:07', '2'), - ('421', '2932', '2006-02-16T02:30:53', '2005-07-28T16:03:27', '2005-08-03T21:58:27', '2'), - ('70', '4556', '2006-02-16T02:30:53', '2005-06-18T20:32:40', '2005-06-20T00:40:40', '2'), - ('579', '2194', '2006-02-16T02:30:53', '2005-08-23T15:30:48', '2005-08-31T11:20:48', '2'), - ('316', '3820', '2006-02-16T02:30:53', '2005-08-19T17:57:35', '2005-08-25T15:45:35', '2'), - ('143', '3094', '2006-02-16T02:30:53', '2005-07-07T02:32:07', '2005-07-14T06:01:07', '2'), - ('45', '4457', '2006-02-16T02:30:53', '2005-08-23T14:47:26', '2005-09-01T10:51:26', '2'), - ('573', '4240', '2006-02-16T02:30:53', '2005-07-31T12:30:12', '2005-08-05T08:24:12', '2'), - ('280', '2509', '2006-02-16T02:30:53', '2005-08-22T19:58:15', '2005-08-25T19:21:15', '2'), - ('10', '3826', '2006-02-16T02:30:53', '2005-07-28T22:34:12', '2005-08-01T02:32:12', '2'), - ('537', '2365', '2006-02-16T02:30:53', '2005-07-27T08:10:29', '2005-07-28T12:24:29', '2'), - ('225', '122', '2006-02-16T02:30:53', '2005-07-31T17:02:00', '2005-08-08T11:11:00', '2'), - ('459', '1373', '2006-02-16T02:30:53', '2005-07-31T05:32:10', '2005-08-03T07:04:10', '2'), - ('168', '3787', '2006-02-16T02:30:53', '2005-08-23T09:38:17', '2005-08-30T12:31:17', '2'), - ('269', '1284', '2006-02-16T02:30:53', '2005-08-02T01:53:06', '2005-08-04T02:46:06', '2'), - ('292', '1869', '2006-02-16T02:30:53', '2005-07-30T04:41:42', '2005-08-07T22:50:42', '2'), - ('594', '1612', '2006-02-16T02:30:53', '2005-07-29T11:37:30', '2005-08-03T05:58:30', '2'), - ('390', '1360', '2006-02-16T02:30:53', '2005-08-22T17:12:30', '2005-08-27T15:10:30', '2'), - ('58', '438', '2006-02-16T02:30:53', '2005-07-31T18:48:08', '2005-08-09T19:11:08', '2'), - ('297', '1594', '2006-02-16T02:30:53', '2005-07-08T08:02:18', '2005-07-12T08:53:18', '2'), - ('268', '4132', '2006-02-16T02:30:53', '2005-06-15T19:22:08', '2005-06-16T17:53:08', '2'), - ('593', '633', '2006-02-16T02:30:53', '2005-07-11T22:14:57', '2005-07-15T16:41:57', '2'), - ('250', '4045', '2006-02-16T02:30:53', '2005-07-29T11:59:22', '2005-07-30T11:41:22', '2'), - ('143', '3681', '2006-02-16T02:30:53', '2005-08-17T05:02:25', '2005-08-24T08:15:25', '2'), - ('312', '1131', '2006-02-16T02:30:53', '2005-05-26T11:19:20', '2005-05-31T11:56:20', '2'), - ('209', '2337', '2006-02-16T02:30:53', '2005-06-19T19:00:37', '2005-06-25T17:18:37', '2'), - ('22', '2584', '2006-02-16T02:30:53', '2005-05-29T21:07:22', '2005-06-07T00:22:22', '2'), - ('119', '2515', '2006-02-16T02:30:53', '2005-08-23T21:52:56', '2005-08-30T18:16:56', '2'), - ('432', '3979', '2006-02-16T02:30:53', '2005-05-27T01:10:11', '2005-06-04T20:25:11', '2'), - ('493', '1540', '2006-02-16T02:30:53', '2005-07-06T07:52:54', '2005-07-15T10:49:54', '2'), - ('472', '965', '2006-02-16T02:30:53', '2005-06-15T15:49:01', '2005-06-19T11:08:01', '2'), - ('79', '786', '2006-02-16T02:30:53', '2005-07-11T10:12:30', '2005-07-19T06:02:30', '2'), - ('45', '299', '2006-02-16T02:30:53', '2005-07-27T17:39:12', '2005-08-01T12:40:12', '2'), - ('515', '1174', '2006-02-16T02:30:53', '2005-07-31T22:54:30', '2005-08-03T00:43:30', '2'), - ('210', '4300', '2006-02-16T02:30:53', '2005-08-19T04:20:25', '2005-08-24T06:40:25', '2'), - ('446', '1999', '2006-02-16T02:30:53', '2005-06-18T04:59:48', '2005-06-19T08:51:48', '2'), - ('587', '1565', '2006-02-16T02:30:53', '2005-07-29T20:07:06', '2005-08-06T20:42:06', '2'), - ('13', '210', '2006-02-16T02:30:53', '2005-08-02T14:58:41', '2005-08-06T14:38:41', '2'), - ('213', '3037', '2006-02-16T02:30:53', '2005-06-17T07:15:41', '2005-06-18T11:37:41', '2'), - ('23', '1454', '2006-02-16T02:30:53', '2005-07-08T18:43:18', '2005-07-12T14:28:18', '2'), - ('459', '730', '2006-02-16T02:30:53', '2005-07-28T04:33:54', '2005-07-30T02:46:54', '2'), - ('1', '108', '2006-02-16T02:30:53', '2005-07-29T03:58:49', '2005-08-01T05:16:49', '2'), - ('596', '3851', '2006-02-16T02:30:53', '2005-08-23T17:16:28', '2005-08-29T21:46:28', '2'), - ('129', '279', '2006-02-16T02:30:53', '2005-08-01T07:08:22', '2005-08-05T08:00:22', '2'), - ('448', '1003', '2006-02-16T02:30:53', '2005-06-21T02:16:55', '2005-06-27T05:39:55', '2'), - ('7', '3645', '2006-02-16T02:30:53', '2005-07-12T15:17:42', '2005-07-18T17:59:42', '2'), - ('503', '3402', '2006-02-16T02:30:53', '2005-07-06T21:08:29', '2005-07-15T23:28:29', '2'), - ('198', '4057', '2006-02-16T02:30:53', '2005-08-22T07:48:01', '2005-08-24T06:41:01', '2'), - ('459', '3846', '2006-02-16T02:30:53', '2005-08-01T12:06:30', '2005-08-04T10:23:30', '2'), - ('555', '1041', '2006-02-16T02:30:53', '2005-08-17T09:03:31', '2005-08-19T08:23:31', '2'), - ('390', '2948', '2006-02-16T02:30:53', '2005-07-30T14:19:25', '2005-08-08T11:22:25', '2'), - ('313', '2501', '2006-02-16T02:30:53', '2005-08-22T11:14:31', '2005-08-28T14:23:31', '2'), - ('8', '2522', '2006-02-16T02:30:53', '2005-07-09T17:13:23', '2005-07-14T18:11:23', '2'), - ('232', '826', '2006-02-16T02:30:53', '2005-08-20T09:33:58', '2005-08-23T07:44:58', '2'), - ('586', '1485', '2006-02-16T02:30:53', '2005-08-20T21:46:43', '2005-08-21T18:27:43', '2'), - ('413', '3237', '2006-02-16T02:30:53', '2005-06-19T02:23:36', '2005-06-20T03:17:36', '2'), - ('296', '1728', '2006-02-16T02:30:53', '2005-07-09T05:48:22', '2005-07-11T06:50:22', '2'), - ('596', '2617', '2006-02-16T02:30:53', '2005-05-30T20:28:42', '2005-06-08T23:45:42', '2'), - ('453', '3486', '2006-02-16T02:30:53', '2005-08-17T11:08:48', '2005-08-20T13:36:48', '2'), - ('150', '4357', '2006-02-16T02:30:53', '2005-06-20T23:06:07', '2005-06-27T01:14:07', '2'), - ('250', '594', '2006-02-16T02:30:53', '2005-07-30T08:45:48', '2005-08-01T03:18:48', '2'), - ('231', '2094', '2006-02-16T02:30:53', '2005-08-18T02:34:22', '2005-08-21T07:48:22', '2'), - ('1', '3486', '2006-02-16T02:30:53', '2005-07-08T07:33:56', '2005-07-12T13:25:56', '2'), - ('509', '352', '2006-02-16T02:30:53', '2005-07-28T23:37:57', '2005-08-07T00:29:57', '2'), - ('561', '1591', '2006-02-16T02:30:53', '2005-07-31T12:21:16', '2005-08-09T13:41:16', '2'), - ('582', '1936', '2006-02-16T02:30:53', '2005-08-21T09:48:56', '2005-08-22T12:15:56', '2'), - ('468', '2213', '2006-02-16T02:30:53', '2005-07-28T03:13:00', '2005-08-01T00:29:00', '2'), - ('570', '3963', '2006-02-16T02:30:53', '2005-07-08T11:19:31', '2005-07-13T13:45:31', '2'), - ('327', '3192', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('547', '997', '2006-02-16T02:30:53', '2005-07-10T17:47:34', '2005-07-13T20:14:34', '2'), - ('76', '3791', '2006-02-16T02:30:53', '2005-06-15T21:27:42', '2005-06-22T03:09:42', '2'), - ('79', '3867', '2006-02-16T02:30:53', '2005-07-27T09:35:54', '2005-08-04T06:00:54', '2'), - ('232', '4150', '2006-02-16T02:30:53', '2005-08-22T02:42:39', '2005-08-24T21:26:39', '2'), - ('251', '578', '2006-02-16T02:30:53', '2005-08-19T17:09:22', '2005-08-24T21:31:22', '2'), - ('321', '1182', '2006-02-16T02:30:53', '2005-07-07T15:17:50', '2005-07-08T11:42:50', '2'), - ('336', '2266', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('3', '1984', '2006-02-16T02:30:53', '2005-08-18T14:49:55', '2005-08-24T15:20:55', '2'), - ('343', '3919', '2006-02-16T02:30:53', '2005-06-21T16:14:02', '2005-06-24T15:38:02', '2'), - ('225', '2235', '2006-02-16T02:30:53', '2005-07-07T18:52:57', '2005-07-15T21:24:57', '2'), - ('186', '1554', '2006-02-16T02:30:53', '2005-07-28T05:21:51', '2005-07-30T02:06:51', '2'), - ('543', '3657', '2006-02-16T02:30:53', '2005-08-02T13:29:24', '2005-08-11T11:36:24', '2'), - ('504', '2477', '2006-02-16T02:30:53', '2005-08-19T15:05:34', '2005-08-21T20:37:34', '2'), - ('464', '353', '2006-02-16T02:30:53', '2005-06-20T21:42:29', '2005-06-22T00:36:29', '2'), - ('593', '4090', '2006-02-16T02:30:53', '2005-07-08T19:10:52', '2005-07-09T21:43:52', '2'), - ('161', '2324', '2006-02-16T02:30:53', '2005-08-21T02:23:03', '2005-08-25T22:50:03', '2'), - ('189', '2166', '2006-02-16T02:30:53', '2005-08-20T06:01:15', '2005-08-29T06:14:15', '2'), - ('581', '4315', '2006-02-16T02:30:53', '2005-08-22T23:18:10', '2005-08-23T18:08:10', '2'), - ('135', '4001', '2006-02-16T02:30:53', '2005-07-09T04:01:02', '2005-07-18T05:16:02', '2'), - ('576', '2517', '2006-02-16T02:30:53', '2005-08-23T07:34:18', '2005-08-24T12:00:18', '2'), - ('337', '2605', '2006-02-16T02:30:53', '2005-08-21T01:13:37', '2005-08-28T02:35:37', '2'), - ('518', '1570', '2006-02-16T02:30:53', '2005-08-18T19:48:06', '2005-08-23T15:05:06', '2'), - ('401', '1955', '2006-02-16T02:30:53', '2005-05-27T18:48:41', '2005-06-03T16:42:41', '2'), - ('489', '4307', '2006-02-16T02:30:53', '2005-08-02T08:44:44', '2005-08-10T11:32:44', '2'), - ('496', '1185', '2006-02-16T02:30:53', '2005-08-02T20:44:33', '2005-08-05T22:58:33', '2'), - ('163', '1398', '2006-02-16T02:30:53', '2005-07-27T12:54:39', '2005-07-31T09:26:39', '2'), - ('550', '794', '2006-02-16T02:30:53', '2005-07-06T23:04:35', '2005-07-13T01:38:35', '2'), - ('379', '3858', '2006-02-16T02:30:53', '2005-08-22T23:11:59', '2005-08-26T22:16:59', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['585', '3263', '963', '6450', '3666', '15980', '6230', '1558', '7343', '2588', '11161', '4643', '5186', '14304', '1171', '8868', '13546', '6316', '4860', '6157', '14977', '13862', '14130', '2864', '1170', '7302', '4998', '14063', '6771', '4217', '10863', '13102', '10104', '1733', '5444', '14859', '1463', '6587', '8238', '15355', '2831', '12333', '5411', '3034', '11171', '12853', '13861', '11775', '8289', '12388', '3314', '9851', '10554', '14678', '859', '13194', '8234', '3810', '8339', '13654', '15281', '6895', '2696', '8193', '12425', '15836', '1687', '7257', '4889', '7016', '13591', '11307', '767', '1764', '14295', '8964', '1210', '3066', '7680', '2343', '5135', '10659', '14240', '12815', '6482', '11067', '5553', '5875', '3237', '5948', '5113', '10170', '14281', '9902', '4922', '8686', '5147', '15839', '15723', '1256']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('490', '3544', '2006-02-16T02:30:53', '2005-05-28T11:50:45', '2005-06-03T15:35:45', '2'), - ('118', '3491', '2006-02-16T02:30:53', '2005-06-21T04:15:52', '2005-06-24T02:19:52', '2'), - ('225', '1921', '2006-02-16T02:30:53', '2005-05-30T18:52:53', '2005-06-07T16:19:53', '2'), - ('32', '2413', '2006-02-16T02:30:53', '2005-07-12T00:49:05', '2005-07-13T01:54:05', '2'), - ('347', '4212', '2006-02-16T02:30:53', '2005-07-06T08:27:43', '2005-07-09T07:37:43', '2'), - ('196', '3365', '2006-02-16T02:30:53', '2005-08-23T20:10:13', '2005-08-24T17:44:13', '2'), - ('490', '2260', '2006-02-16T02:30:53', '2005-07-11T14:02:19', '2005-07-17T08:11:19', '2'), - ('20', '4350', '2006-02-16T02:30:53', '2005-06-16T02:33:53', '2005-06-19T20:50:53', '2'), - ('526', '1177', '2006-02-16T02:30:53', '2005-07-27T14:27:13', '2005-07-30T09:27:13', '2'), - ('143', '3626', '2006-02-16T02:30:53', '2005-06-19T05:20:31', '2005-06-22T04:20:31', '2'), - ('503', '3321', '2006-02-16T02:30:53', '2005-08-02T10:05:57', '2005-08-06T05:05:57', '2'), - ('436', '239', '2006-02-16T02:30:53', '2005-07-08T09:13:56', '2005-07-10T12:09:56', '2'), - ('276', '2415', '2006-02-16T02:30:53', '2005-07-09T10:18:40', '2005-07-13T05:05:40', '2'), - ('417', '2650', '2006-02-16T02:30:53', '2005-08-21T07:23:10', '2005-08-26T11:21:10', '2'), - ('284', '4082', '2006-02-16T02:30:53', '2005-06-14T23:50:11', '2005-06-17T21:44:11', '2'), - ('512', '1229', '2006-02-16T02:30:53', '2005-07-30T00:02:26', '2005-08-01T22:28:26', '2'), - ('390', '2492', '2006-02-16T02:30:53', '2005-08-20T03:50:24', '2005-08-28T03:04:24', '2'), - ('526', '1910', '2006-02-16T02:30:53', '2005-07-11T18:44:52', '2005-07-19T23:35:52', '2'), - ('123', '428', '2006-02-16T02:30:53', '2005-07-08T18:54:07', '2005-07-17T15:09:07', '2'), - ('133', '4481', '2006-02-16T02:30:53', '2005-07-11T09:48:16', '2005-07-16T05:00:16', '2'), - ('59', '4093', '2006-02-16T02:30:53', '2005-08-22T07:12:53', '2005-08-30T08:11:53', '2'), - ('170', '3271', '2006-02-16T02:30:53', '2005-08-20T14:57:01', '2005-08-27T10:48:01', '2'), - ('352', '3859', '2006-02-16T02:30:53', '2005-08-21T01:43:11', '2005-08-27T21:16:11', '2'), - ('493', '1056', '2006-02-16T02:30:53', '2005-06-20T00:00:52', '2005-06-26T04:21:52', '2'), - ('595', '2444', '2006-02-16T02:30:53', '2005-06-14T23:47:35', '2005-06-17T05:28:35', '2'), - ('477', '4539', '2006-02-16T02:30:53', '2005-07-27T12:52:13', '2005-07-29T15:13:13', '2'), - ('534', '202', '2006-02-16T02:30:53', '2005-07-09T01:07:21', '2005-07-10T05:48:21', '2'), - ('275', '1215', '2006-02-16T02:30:53', '2005-08-20T22:36:40', '2005-08-25T00:18:40', '2'), - ('396', '1113', '2006-02-16T02:30:53', '2005-07-12T15:54:40', '2005-07-17T15:56:40', '2'), - ('228', '3186', '2006-02-16T02:30:53', '2005-07-07T12:08:59', '2005-07-11T15:07:59', '2'), - ('161', '1170', '2006-02-16T02:30:53', '2005-08-02T00:18:07', '2005-08-10T06:16:07', '2'), - ('285', '2885', '2006-02-16T02:30:53', '2005-08-19T11:02:03', '2005-08-28T13:05:03', '2'), - ('186', '3358', '2006-02-16T02:30:53', '2005-07-31T20:49:14', '2005-08-05T01:11:14', '2'), - ('480', '542', '2006-02-16T02:30:53', '2005-06-16T15:37:07', '2005-06-23T15:53:07', '2'), - ('10', '2968', '2006-02-16T02:30:53', '2005-07-09T21:58:57', '2005-07-11T03:09:57', '2'), - ('463', '2150', '2006-02-16T02:30:53', '2005-08-22T02:46:35', '2005-08-24T22:37:35', '2'), - ('569', '2984', '2006-02-16T02:30:53', '2005-06-15T20:37:51', '2005-06-21T16:46:51', '2'), - ('419', '238', '2006-02-16T02:30:53', '2005-07-12T06:56:26', '2005-07-20T05:53:26', '2'), - ('320', '2941', '2006-02-16T02:30:53', '2005-07-29T00:30:06', '2005-08-02T22:52:06', '2'), - ('493', '3477', '2006-02-16T02:30:53', '2005-08-22T21:19:24', '2005-08-28T20:36:24', '2'), - ('468', '4089', '2006-02-16T02:30:53', '2005-06-19T21:17:06', '2005-06-22T16:56:06', '2'), - ('18', '4370', '2006-02-16T02:30:53', '2005-08-18T06:51:39', '2005-08-21T01:44:39', '2'), - ('304', '4292', '2006-02-16T02:30:53', '2005-07-09T20:23:38', '2005-07-16T01:17:38', '2'), - ('296', '2755', '2006-02-16T02:30:53', '2005-06-20T12:15:50', '2005-06-24T06:21:50', '2'), - ('339', '3117', '2006-02-16T02:30:53', '2005-08-02T10:23:41', '2005-08-04T14:22:41', '2'), - ('232', '3753', '2006-02-16T02:30:53', '2005-08-19T02:15:32', '2005-08-27T21:26:32', '2'), - ('154', '303', '2006-02-16T02:30:53', '2005-08-20T14:56:53', '2005-08-22T18:13:53', '2'), - ('574', '256', '2006-02-16T02:30:53', '2005-08-17T10:25:53', '2005-08-22T08:37:53', '2'), - ('459', '4579', '2006-02-16T02:30:53', '2005-07-29T02:23:24', '2005-08-06T03:23:24', '2'), - ('555', '4016', '2006-02-16T02:30:53', '2005-08-18T08:48:09', '2005-08-26T09:05:09', '2'), - ('185', '4332', '2006-02-16T02:30:53', '2005-06-21T08:17:00', '2005-06-22T06:00:00', '2'), - ('49', '25', '2006-02-16T02:30:53', '2005-07-31T12:50:24', '2005-08-08T08:30:24', '2'), - ('209', '3220', '2006-02-16T02:30:53', '2005-08-01T12:56:19', '2005-08-03T09:44:19', '2'), - ('383', '1911', '2006-02-16T02:30:53', '2005-08-21T20:12:43', '2005-08-31T02:11:43', '2'), - ('79', '3032', '2006-02-16T02:30:53', '2005-05-30T02:36:20', '2005-06-02T07:49:20', '2'), - ('58', '2473', '2006-02-16T02:30:53', '2005-08-19T14:34:12', '2005-08-26T10:18:12', '2'), - ('227', '644', '2006-02-16T02:30:53', '2005-07-29T00:19:20', '2005-08-03T19:16:20', '2'), - ('296', '342', '2006-02-16T02:30:53', '2005-07-06T15:18:44', '2005-07-12T09:52:44', '2'), - ('129', '1870', '2006-02-16T02:30:53', '2005-07-29T04:41:13', '2005-07-30T09:01:13', '2'), - ('469', '1582', '2006-02-16T02:30:53', '2005-08-20T07:58:21', '2005-08-21T09:40:21', '2'), - ('543', '3992', '2006-02-16T02:30:53', '2005-08-22T19:10:26', '2005-08-27T21:55:26', '2'), - ('599', '2935', '2006-02-16T02:30:53', '2005-07-12T21:23:59', '2005-07-19T20:47:59', '2'), - ('597', '2110', '2006-02-16T02:30:53', '2005-06-19T13:28:42', '2005-06-28T14:06:42', '2'), - ('15', '2402', '2006-02-16T02:30:53', '2005-07-28T22:50:50', '2005-08-01T04:14:50', '2'), - ('405', '2000', '2006-02-16T02:30:53', '2005-08-18T10:18:06', '2005-08-27T08:16:06', '2'), - ('468', '260', '2006-02-16T02:30:53', '2005-08-23T15:29:17', '2005-08-26T11:44:17', '2'), - ('140', '3686', '2006-02-16T02:30:53', '2005-06-16T12:09:20', '2005-06-18T06:18:20', '2'), - ('480', '3302', '2006-02-16T02:30:53', '2005-07-27T11:04:17', '2005-08-04T12:32:17', '2'), - ('5', '4463', '2006-02-16T02:30:53', '2005-07-08T20:04:43', '2005-07-13T17:57:43', '2'), - ('423', '1425', '2006-02-16T02:30:53', '2005-07-27T02:15:16', '2005-08-01T23:08:16', '2'), - ('390', '3089', '2006-02-16T02:30:53', '2005-08-20T05:50:05', '2005-08-27T08:43:05', '2'), - ('15', '1490', '2006-02-16T02:30:53', '2005-08-02T15:48:08', '2005-08-06T20:33:08', '2'), - ('67', '687', '2006-02-16T02:30:53', '2005-05-29T12:20:19', '2005-06-02T14:15:19', '2'), - ('392', '705', '2006-02-16T02:30:53', '2005-06-16T17:51:54', '2005-06-21T20:36:54', '2'), - ('336', '2187', '2006-02-16T02:30:53', '2005-08-21T07:09:27', '2005-08-22T01:27:27', '2'), - ('424', '280', '2006-02-16T02:30:53', '2005-07-30T03:49:35', '2005-08-06T23:28:35', '2'), - ('345', '7', '2006-02-16T02:30:53', '2005-06-15T02:57:51', '2005-06-20T01:41:51', '2'), - ('268', '1116', '2006-02-16T02:30:53', '2005-06-20T13:55:41', '2005-06-26T09:38:41', '2'), - ('559', '1784', '2006-02-16T02:30:53', '2005-07-28T02:59:08', '2005-08-03T03:37:08', '2'), - ('20', '4554', '2006-02-16T02:30:53', '2005-06-18T11:46:26', '2005-06-22T11:37:26', '2'), - ('538', '3005', '2006-02-16T02:30:53', '2005-07-09T07:53:22', '2005-07-16T04:50:22', '2'), - ('238', '786', '2006-02-16T02:30:53', '2005-08-01T16:40:34', '2005-08-09T21:00:34', '2'), - ('12', '3294', '2006-02-16T02:30:53', '2005-08-21T05:19:39', '2005-08-22T23:25:39', '2'), - ('588', '435', '2006-02-16T02:30:53', '2005-08-19T00:59:42', '2005-08-25T21:43:42', '2'), - ('57', '4135', '2006-02-16T02:30:53', '2005-07-12T01:50:21', '2005-07-14T06:49:21', '2'), - ('85', '965', '2006-02-16T02:30:53', '2005-08-02T07:03:24', '2005-08-10T08:59:24', '2'), - ('6', '1686', '2006-02-16T02:30:53', '2005-07-10T03:03:35', '2005-07-14T07:49:35', '2'), - ('575', '964', '2006-02-16T02:30:53', '2005-07-10T19:06:47', '2005-07-18T17:33:47', '2'), - ('466', '4399', '2006-02-16T02:30:53', '2005-06-21T02:47:56', '2005-06-27T03:16:56', '2'), - ('57', '3260', '2006-02-16T02:30:53', '2005-07-10T23:12:08', '2005-07-18T19:06:08', '2'), - ('282', '3618', '2006-02-16T02:30:53', '2005-07-09T07:06:18', '2005-07-13T07:10:18', '2'), - ('41', '804', '2006-02-16T02:30:53', '2005-07-31T23:27:31', '2005-08-08T04:53:31', '2'), - ('166', '1848', '2006-02-16T02:30:53', '2005-08-21T06:40:48', '2005-08-26T11:42:48', '2'), - ('218', '486', '2006-02-16T02:30:53', '2005-07-31T14:24:33', '2005-08-09T11:11:33', '2'), - ('577', '2928', '2006-02-16T02:30:53', '2005-07-08T21:44:00', '2005-07-10T02:58:00', '2'), - ('52', '4160', '2006-02-16T02:30:53', '2005-07-29T16:17:49', '2005-08-01T12:50:49', '2'), - ('326', '2270', '2006-02-16T02:30:53', '2005-07-09T08:17:41', '2005-07-18T09:45:41', '2'), - ('294', '3726', '2006-02-16T02:30:53', '2005-08-23T15:34:46', '2005-08-30T21:00:46', '2'), - ('504', '3915', '2006-02-16T02:30:53', '2005-08-23T11:17:26', '2005-08-31T13:58:26', '2'), - ('470', '1437', '2006-02-16T02:30:53', '2005-06-15T06:13:57', '2005-06-16T06:54:57', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['11220', '12557', '6310', '2548', '12116', '15582', '150', '11983', '5904', '12552', '10872', '14388', '143', '11204', '10008', '1432', '9501', '13195', '4075', '12315', '10468', '12638', '4071', '11795', '14009', '9549', '9535', '7908', '8263', '14160', '1944', '4549', '245', '15304', '10262', '13687', '12111', '16041', '10561', '15763', '5040', '13497', '12902', '9321', '13085', '14703', '4716', '1049', '4455', '15673', '1609', '3796', '13711', '4247', '13568', '6847', '15795', '674', '2110', '9017', '14382', '7515', '6758', '15638', '11666', '5507', '4002', '14955', '9304', '10746', '14628', '13288', '13314', '9325', '12783', '12930', '14390', '11948', '12978', '2956', '3250', '7115', '6899', '13857', '2209', '12507', '2496', '6209', '12155', '9445', '1124', '8375', '14462', '5806', '4731', '5718', '5219', '6923', '9057', '3035']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('84', '3777', '2006-02-16T02:30:53', '2005-08-02T12:31:41', '2005-08-05T08:23:41', '2'), - ('364', '313', '2006-02-16T02:30:53', '2005-08-18T14:51:03', '2005-08-19T13:30:03', '2'), - ('537', '3064', '2006-02-16T02:30:53', '2005-07-11T18:14:05', '2005-07-16T15:39:05', '2'), - ('561', '4292', '2006-02-16T02:30:53', '2005-06-19T02:45:35', '2005-06-22T06:52:35', '2'), - ('560', '3082', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('297', '4264', '2006-02-16T02:30:53', '2005-08-23T05:45:44', '2005-08-25T07:54:44', '2'), - ('429', '909', '2006-02-16T02:30:53', '2005-05-26T00:28:39', '2005-06-01T02:10:39', '2'), - ('304', '2580', '2006-02-16T02:30:53', '2005-08-17T18:13:55', '2005-08-23T18:27:55', '2'), - ('531', '350', '2006-02-16T02:30:53', '2005-07-10T20:39:44', '2005-07-13T17:57:44', '2'), - ('413', '4303', '2006-02-16T02:30:53', '2005-08-18T14:46:34', '2005-08-20T11:02:34', '2'), - ('84', '2470', '2006-02-16T02:30:53', '2005-08-02T00:27:50', '2005-08-06T20:34:50', '2'), - ('274', '1078', '2006-02-16T02:30:53', '2005-08-21T10:15:13', '2005-08-30T13:41:13', '2'), - ('297', '847', '2006-02-16T02:30:53', '2005-05-25T23:45:52', '2005-05-27T21:41:52', '2'), - ('247', '3578', '2006-02-16T02:30:53', '2005-08-02T11:56:31', '2005-08-06T14:16:31', '2'), - ('91', '2589', '2006-02-16T02:30:53', '2005-07-31T17:59:36', '2005-08-03T22:43:36', '2'), - ('339', '523', '2006-02-16T02:30:53', '2005-06-15T18:27:24', '2005-06-21T14:03:24', '2'), - ('75', '4398', '2006-02-16T02:30:53', '2005-07-30T23:59:21', '2005-08-05T19:50:21', '2'), - ('565', '2537', '2006-02-16T02:30:53', '2005-08-19T14:39:14', '2005-08-24T10:30:14', '2'), - ('593', '1989', '2006-02-16T02:30:53', '2005-07-07T04:51:44', '2005-07-09T03:07:44', '2'), - ('579', '2012', '2006-02-16T02:30:53', '2005-08-18T06:15:06', '2005-08-24T07:45:06', '2'), - ('129', '2115', '2006-02-16T02:30:53', '2005-08-01T09:48:29', '2005-08-05T09:58:29', '2'), - ('172', '2849', '2006-02-16T02:30:53', '2005-08-18T18:11:39', '2005-08-25T21:54:39', '2'), - ('209', '2883', '2006-02-16T02:30:53', '2005-07-07T04:37:26', '2005-07-13T06:45:26', '2'), - ('565', '2220', '2006-02-16T02:30:53', '2005-08-17T11:13:38', '2005-08-19T14:20:38', '2'), - ('382', '3004', '2006-02-16T02:30:53', '2005-08-20T20:26:53', '2005-08-21T23:32:53', '2'), - ('63', '2409', '2006-02-16T02:30:53', '2005-07-31T01:57:04', '2005-08-07T21:00:04', '2'), - ('485', '2413', '2006-02-16T02:30:53', '2005-07-31T01:18:53', '2005-08-04T03:04:53', '2'), - ('360', '3646', '2006-02-16T02:30:53', '2005-07-28T11:32:57', '2005-08-03T13:30:57', '2'), - ('5', '28', '2006-02-16T02:30:53', '2005-07-29T01:11:23', '2005-07-31T01:53:23', '2'), - ('493', '2428', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('16', '318', '2006-02-16T02:30:53', '2005-06-17T07:50:53', '2005-06-23T02:52:53', '2'), - ('98', '2797', '2006-02-16T02:30:53', '2005-07-08T04:25:03', '2005-07-10T09:01:03', '2'), - ('158', '3045', '2006-02-16T02:30:53', '2005-05-26T13:46:59', '2005-05-27T09:58:59', '2'), - ('112', '4332', '2006-02-16T02:30:53', '2005-08-22T19:45:57', '2005-08-28T00:21:57', '2'), - ('181', '3842', '2006-02-16T02:30:53', '2005-08-01T03:01:26', '2005-08-08T08:03:26', '2'), - ('290', '3629', '2006-02-16T02:30:53', '2005-08-20T08:57:51', '2005-08-22T07:02:51', '2'), - ('317', '2905', '2006-02-16T02:30:53', '2005-08-17T22:59:55', '2005-08-22T19:33:55', '2'), - ('121', '4116', '2006-02-16T02:30:53', '2005-08-23T22:20:26', '2005-08-25T20:14:26', '2'), - ('8', '2195', '2006-02-16T02:30:53', '2005-08-01T13:05:35', '2005-08-04T08:34:35', '2'), - ('158', '124', '2006-02-16T02:30:53', '2005-08-23T13:02:59', '2005-08-24T17:45:59', '2'), - ('405', '2479', '2006-02-16T02:30:53', '2005-07-09T03:16:34', '2005-07-17T01:13:34', '2'), - ('481', '1296', '2006-02-16T02:30:53', '2005-08-20T01:46:38', '2005-08-26T05:37:38', '2'), - ('91', '464', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('112', '3558', '2006-02-16T02:30:53', '2005-07-30T17:19:44', '2005-08-06T22:42:44', '2'), - ('215', '360', '2006-02-16T02:30:53', '2005-08-19T10:28:22', '2005-08-22T07:37:22', '2'), - ('29', '4329', '2006-02-16T02:30:53', '2005-08-21T21:01:19', '2005-08-22T15:13:19', '2'), - ('391', '1923', '2006-02-16T02:30:53', '2005-07-08T12:18:51', '2005-07-11T11:06:51', '2'), - ('312', '3913', '2006-02-16T02:30:53', '2005-05-31T06:57:04', '2005-06-02T11:32:04', '2'), - ('507', '1396', '2006-02-16T02:30:53', '2005-07-07T23:43:46', '2005-07-08T21:34:46', '2'), - ('321', '3096', '2006-02-16T02:30:53', '2005-08-23T09:12:50', '2005-08-29T12:45:50', '2'), - ('174', '2279', '2006-02-16T02:30:53', '2005-06-16T06:34:59', '2005-06-17T09:41:59', '2'), - ('228', '1649', '2006-02-16T02:30:53', '2005-07-06T14:45:22', '2005-07-07T11:01:22', '2'), - ('453', '2318', '2006-02-16T02:30:53', '2005-08-20T09:35:20', '2005-08-28T09:06:20', '2'), - ('539', '808', '2006-02-16T02:30:53', '2005-07-07T13:51:54', '2005-07-10T09:43:54', '2'), - ('151', '1243', '2006-02-16T02:30:53', '2005-08-20T05:02:46', '2005-08-27T03:12:46', '2'), - ('63', '346', '2006-02-16T02:30:53', '2005-07-12T19:22:37', '2005-07-21T18:53:37', '2'), - ('417', '4371', '2006-02-16T02:30:53', '2005-08-23T14:07:56', '2005-08-25T12:10:56', '2'), - ('87', '1150', '2006-02-16T02:30:53', '2005-05-28T22:11:35', '2005-06-01T23:58:35', '2'), - ('163', '3592', '2006-02-16T02:30:53', '2005-06-17T19:45:49', '2005-06-26T18:59:49', '2'), - ('319', '3325', '2006-02-16T02:30:53', '2005-07-30T05:26:20', '2005-08-04T10:00:20', '2'), - ('119', '4119', '2006-02-16T02:30:53', '2005-08-21T10:01:03', '2005-08-22T13:21:03', '2'), - ('390', '1211', '2006-02-16T02:30:53', '2005-07-27T20:52:37', '2005-08-02T20:17:37', '2'), - ('546', '4098', '2006-02-16T02:30:53', '2005-07-12T15:13:49', '2005-07-20T09:31:49', '2'), - ('563', '3358', '2006-02-16T02:30:53', '2005-08-23T07:54:54', '2005-08-30T13:33:54', '2'), - ('531', '250', '2006-02-16T02:30:53', '2005-08-17T05:45:10', '2005-08-19T06:47:10', '2'), - ('399', '716', '2006-02-16T02:30:53', '2005-07-10T00:49:04', '2005-07-15T22:06:04', '2'), - ('308', '2790', '2006-02-16T02:30:53', '2005-07-07T00:08:18', '2005-07-14T01:29:18', '2'), - ('445', '1534', '2006-02-16T02:30:53', '2005-08-22T06:25:52', '2005-08-25T12:13:52', '2'), - ('296', '2937', '2006-02-16T02:30:53', '2005-07-30T16:41:34', '2005-08-02T13:55:34', '2'), - ('508', '305', '2006-02-16T02:30:53', '2005-08-01T19:58:49', '2005-08-10T19:00:49', '2'), - ('331', '3636', '2006-02-16T02:30:53', '2005-08-21T18:37:24', '2005-08-27T20:25:24', '2'), - ('162', '3558', '2006-02-16T02:30:53', '2005-08-19T18:30:10', '2005-08-20T19:20:10', '2'), - ('347', '2899', '2006-02-16T02:30:53', '2005-08-19T19:12:43', '2005-08-27T00:20:43', '2'), - ('476', '1938', '2006-02-16T02:30:53', '2005-07-30T17:29:19', '2005-08-08T12:55:19', '2'), - ('503', '1109', '2006-02-16T02:30:53', '2005-08-19T00:01:14', '2005-08-21T22:02:14', '2'), - ('414', '4410', '2006-02-16T02:30:53', '2005-08-19T05:11:32', '2005-08-22T02:20:32', '2'), - ('366', '3951', '2006-02-16T02:30:53', '2005-08-21T10:15:38', '2005-08-28T05:50:38', '2'), - ('40', '3329', '2006-02-16T02:30:53', '2005-08-17T17:11:05', '2005-08-25T21:16:05', '2'), - ('167', '3252', '2006-02-16T02:30:53', '2005-08-19T06:57:27', '2005-08-20T09:10:27', '2'), - ('533', '2684', '2006-02-16T02:30:53', '2005-06-20T06:47:23', '2005-06-22T07:24:23', '2'), - ('467', '736', '2006-02-16T02:30:53', '2005-06-21T03:16:36', '2005-06-29T00:53:36', '2'), - ('359', '3620', '2006-02-16T02:30:53', '2005-07-27T05:42:58', '2005-08-02T05:35:58', '2'), - ('483', '3565', '2006-02-16T02:30:53', '2005-07-12T21:44:16', '2005-07-21T22:21:16', '2'), - ('366', '2542', '2006-02-16T02:30:53', '2005-08-20T14:50:06', '2005-08-24T10:38:06', '2'), - ('13', '2441', '2006-02-16T02:30:53', '2005-06-18T02:24:01', '2005-06-22T04:13:01', '2'), - ('584', '199', '2006-02-16T02:30:53', '2005-08-18T13:19:13', '2005-08-27T11:48:13', '2'), - ('527', '646', '2006-02-16T02:30:53', '2005-06-18T22:20:11', '2005-06-20T03:08:11', '2'), - ('219', '3091', '2006-02-16T02:30:53', '2005-07-11T12:36:05', '2005-07-17T14:48:05', '2'), - ('315', '2065', '2006-02-16T02:30:53', '2005-08-18T00:24:30', '2005-08-18T19:12:30', '2'), - ('549', '1480', '2006-02-16T02:30:53', '2005-07-30T21:50:42', '2005-08-05T18:34:42', '2'), - ('134', '4560', '2006-02-16T02:30:53', '2005-05-31T16:49:34', '2005-06-04T19:32:34', '2'), - ('125', '3634', '2006-02-16T02:30:53', '2005-07-29T05:25:30', '2005-08-04T01:43:30', '2'), - ('96', '2201', '2006-02-16T02:30:53', '2005-08-21T12:50:57', '2005-08-27T10:42:57', '2'), - ('108', '29', '2006-02-16T02:30:53', '2005-07-10T15:11:54', '2005-07-15T11:51:54', '2'), - ('241', '4124', '2006-02-16T02:30:53', '2005-07-08T13:08:18', '2005-07-09T13:16:18', '2'), - ('20', '3719', '2006-02-16T02:30:53', '2005-07-10T11:03:20', '2005-07-19T15:38:20', '2'), - ('209', '3933', '2006-02-16T02:30:53', '2005-07-09T11:57:55', '2005-07-15T09:43:55', '2'), - ('490', '2642', '2006-02-16T02:30:53', '2005-07-12T22:40:48', '2005-07-19T23:07:48', '2'), - ('202', '3141', '2006-02-16T02:30:53', '2005-07-30T07:14:18', '2005-08-01T05:10:18', '2'), - ('62', '1223', '2006-02-16T02:30:53', '2005-06-20T12:17:03', '2005-06-26T17:42:03', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['9688', '9446', '2567', '1916', '11250', '12704', '5897', '11304', '7008', '12147', '10328', '2804', '7351', '2734', '267', '7125', '11906', '1003', '6670', '4681', '3824', '15905', '4541', '15556', '5661', '9031', '11443', '14120', '2101', '13618', '1663', '676', '964', '2701', '10789', '8129', '12169', '13668', '4177', '5244', '3134', '1483', '9505', '14880', '2049', '4413', '7467', '1535', '5663', '14774', '12496', '4004', '10290', '6879', '10964', '6044', '13037', '14079', '1490', '588', '8233', '704', '5093', '3692', '3217', '10080', '14617', '9243', '6113', '3101', '13070', '13638', '6548', '15511', '4710', '597', '15305', '68', '3466', '7767', '2459', '10981', '1421', '4985', '9873', '7272', '10310', '921', '2758', '8918', '6565', '4351', '6217', '14227', '4400', '11824', '12088', '10530', '6396', '427']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('566', '1304', '2006-02-16T02:30:53', '2005-07-31T06:56:08', '2005-08-08T03:31:08', '2'), - ('477', '1880', '2006-02-16T02:30:53', '2005-07-30T21:53:01', '2005-08-06T19:00:01', '2'), - ('496', '216', '2006-02-16T02:30:53', '2005-06-19T04:04:46', '2005-06-19T23:39:46', '2'), - ('429', '4428', '2006-02-16T02:30:53', '2005-06-17T05:29:59', '2005-06-26T05:35:59', '2'), - ('279', '2223', '2006-02-16T02:30:53', '2005-08-02T13:35:42', '2005-08-10T12:32:42', '2'), - ('93', '51', '2006-02-16T02:30:53', '2005-08-18T20:43:00', '2005-08-21T22:28:00', '2'), - ('413', '740', '2006-02-16T02:30:53', '2005-07-10T20:16:14', '2005-07-19T15:49:14', '2'), - ('413', '2592', '2006-02-16T02:30:53', '2005-08-02T15:40:10', '2005-08-06T16:12:10', '2'), - ('12', '3659', '2006-02-16T02:30:53', '2005-07-27T01:44:03', '2005-07-28T21:19:03', '2'), - ('41', '705', '2006-02-16T02:30:53', '2005-08-18T00:10:20', '2005-08-23T20:36:20', '2'), - ('85', '1191', '2006-02-16T02:30:53', '2005-08-01T04:56:10', '2005-08-01T23:22:10', '2'), - ('426', '88', '2006-02-16T02:30:53', '2005-06-19T19:24:54', '2005-06-25T01:19:54', '2'), - ('445', '2147', '2006-02-16T02:30:53', '2005-07-27T14:37:36', '2005-07-30T09:58:36', '2'), - ('204', '794', '2006-02-16T02:30:53', '2005-06-19T15:36:27', '2005-06-20T13:44:27', '2'), - ('417', '1206', '2006-02-16T02:30:53', '2005-05-26T16:16:21', '2005-05-30T16:53:21', '2'), - ('460', '801', '2006-02-16T02:30:53', '2005-07-27T06:11:00', '2005-08-04T09:41:00', '2'), - ('478', '325', '2006-02-16T02:30:53', '2005-08-17T15:40:46', '2005-08-20T15:20:46', '2'), - ('161', '133', '2006-02-16T02:30:53', '2005-05-31T00:48:20', '2005-06-02T04:53:20', '2'), - ('249', '3106', '2006-02-16T02:30:53', '2005-07-12T11:44:33', '2005-07-19T07:54:33', '2'), - ('133', '1025', '2006-02-16T02:30:53', '2005-07-08T10:36:03', '2005-07-16T09:21:03', '2'), - ('107', '3107', '2006-02-16T02:30:53', '2005-07-06T15:43:15', '2005-07-13T16:05:15', '2'), - ('59', '3631', '2006-02-16T02:30:53', '2005-08-23T17:33:04', '2005-08-26T17:38:04', '2'), - ('248', '1976', '2006-02-16T02:30:53', '2005-07-08T04:04:19', '2005-07-13T07:27:19', '2'), - ('108', '3683', '2006-02-16T02:30:53', '2005-08-23T04:52:16', '2005-09-01T02:05:16', '2'), - ('108', '1878', '2006-02-16T02:30:53', '2005-07-10T07:53:51', '2005-07-14T12:57:51', '2'), - ('2', '2377', '2006-02-16T02:30:53', '2005-07-30T06:06:10', '2005-08-04T10:45:10', '2'), - ('581', '1291', '2006-02-16T02:30:53', '2005-08-02T20:29:30', '2005-08-07T01:08:30', '2'), - ('302', '4069', '2006-02-16T02:30:53', '2005-08-21T01:25:00', '2005-08-24T23:21:00', '2'), - ('581', '2137', '2006-02-16T02:30:53', '2005-06-17T18:57:02', '2005-06-20T15:38:02', '2'), - ('390', '390', '2006-02-16T02:30:53', '2005-08-20T06:36:46', '2005-08-29T05:17:46', '2'), - ('186', '1558', '2006-02-16T02:30:53', '2005-06-16T10:14:15', '2005-06-23T08:34:15', '2'), - ('490', '2329', '2006-02-16T02:30:53', '2005-05-28T22:27:51', '2005-05-29T20:36:51', '2'), - ('287', '657', '2006-02-16T02:30:53', '2005-05-30T18:53:21', '2005-06-04T22:32:21', '2'), - ('29', '1623', '2006-02-16T02:30:53', '2005-06-19T13:33:06', '2005-06-28T15:11:06', '2'), - ('403', '3298', '2006-02-16T02:30:53', '2005-08-01T21:37:55', '2005-08-07T17:01:55', '2'), - ('345', '2546', '2006-02-16T02:30:53', '2005-07-28T19:47:02', '2005-07-31T21:33:02', '2'), - ('323', '2281', '2006-02-16T02:30:53', '2005-08-18T01:05:54', '2005-08-24T02:16:54', '2'), - ('123', '3659', '2006-02-16T02:30:53', '2005-08-20T08:26:06', '2005-08-25T05:52:06', '2'), - ('317', '4106', '2006-02-16T02:30:53', '2005-07-07T10:12:36', '2005-07-15T15:48:36', '2'), - ('1', '3726', '2006-02-16T02:30:53', '2005-07-09T13:24:07', '2005-07-14T14:01:07', '2'), - ('537', '1389', '2006-02-16T02:30:53', '2005-06-20T19:29:09', '2005-06-29T19:31:09', '2'), - ('242', '1926', '2006-02-16T02:30:53', '2005-06-15T21:21:58', '2005-06-24T00:44:58', '2'), - ('543', '4047', '2006-02-16T02:30:53', '2005-07-31T00:11:19', '2005-08-05T18:24:19', '2'), - ('224', '3615', '2006-02-16T02:30:53', '2005-08-22T03:44:36', '2005-08-24T05:45:36', '2'), - ('182', '1053', '2006-02-16T02:30:53', '2005-06-17T14:58:36', '2005-06-22T14:53:36', '2'), - ('565', '1062', '2006-02-16T02:30:53', '2005-07-07T22:00:04', '2005-07-10T18:20:04', '2'), - ('240', '3869', '2006-02-16T02:30:53', '2005-07-27T18:51:54', '2005-08-03T23:27:54', '2'), - ('202', '1096', '2006-02-16T02:30:53', '2005-06-16T00:52:04', '2005-06-20T22:47:04', '2'), - ('530', '3078', '2006-02-16T02:30:53', '2005-07-10T08:01:33', '2005-07-15T03:36:33', '2'), - ('252', '3185', '2006-02-16T02:30:53', '2005-08-21T23:52:32', '2005-08-26T23:42:32', '2'), - ('489', '456', '2006-02-16T02:30:53', '2005-08-18T12:58:25', '2005-08-27T18:43:25', '2'), - ('574', '667', '2006-02-16T02:30:53', '2005-07-07T00:20:51', '2005-07-11T18:55:51', '2'), - ('364', '4542', '2006-02-16T02:30:53', '2005-08-01T03:39:50', '2005-08-08T22:29:50', '2'), - ('416', '1901', '2006-02-16T02:30:53', '2005-07-12T20:37:37', '2005-07-20T15:40:37', '2'), - ('36', '2356', '2006-02-16T02:30:53', '2005-08-02T03:56:23', '2005-08-09T23:11:23', '2'), - ('481', '1270', '2006-02-16T02:30:53', '2005-07-11T03:18:39', '2005-07-13T06:58:39', '2'), - ('275', '65', '2006-02-16T02:30:53', '2005-08-19T08:53:57', '2005-08-28T08:56:57', '2'), - ('348', '3528', '2006-02-16T02:30:53', '2005-08-20T23:29:25', '2005-08-25T04:16:25', '2'), - ('123', '3515', '2006-02-16T02:30:53', '2005-06-15T21:42:17', '2005-06-22T02:01:17', '2'), - ('89', '95', '2006-02-16T02:30:53', '2005-05-28T12:08:37', '2005-05-29T16:25:37', '2'), - ('93', '1640', '2006-02-16T02:30:53', '2005-07-29T00:16:23', '2005-08-03T05:17:23', '2'), - ('330', '2628', '2006-02-16T02:30:53', '2005-05-29T02:44:43', '2005-06-06T01:51:43', '2'), - ('597', '2734', '2006-02-16T02:30:53', '2005-07-09T05:59:12', '2005-07-10T11:45:12', '2'), - ('286', '1237', '2006-02-16T02:30:53', '2005-07-06T09:54:12', '2005-07-11T09:42:12', '2'), - ('463', '1027', '2006-02-16T02:30:53', '2005-06-21T01:28:12', '2005-06-25T02:51:12', '2'), - ('62', '4355', '2006-02-16T02:30:53', '2005-07-31T20:07:10', '2005-08-04T23:07:10', '2'), - ('51', '3562', '2006-02-16T02:30:53', '2005-08-21T18:07:40', '2005-08-24T23:48:40', '2'), - ('516', '876', '2006-02-16T02:30:53', '2005-07-30T14:06:27', '2005-08-06T09:26:27', '2'), - ('115', '4437', '2006-02-16T02:30:53', '2005-07-11T07:31:08', '2005-07-20T11:01:08', '2'), - ('384', '1738', '2006-02-16T02:30:53', '2005-06-20T16:48:58', '2005-06-27T18:13:58', '2'), - ('235', '2214', '2006-02-16T02:30:53', '2005-08-19T09:56:23', '2005-08-24T09:08:23', '2'), - ('493', '3255', '2006-02-16T02:30:53', '2005-08-20T07:21:15', '2005-08-23T11:09:15', '2'), - ('488', '2480', '2006-02-16T02:30:53', '2005-07-12T05:00:46', '2005-07-19T04:40:46', '2'), - ('303', '3327', '2006-02-16T02:30:53', '2005-08-23T02:55:42', '2005-08-31T03:14:42', '2'), - ('590', '248', '2006-02-16T02:30:53', '2005-07-08T12:04:53', '2005-07-13T11:28:53', '2'), - ('249', '4469', '2006-02-16T02:30:53', '2005-05-28T14:01:02', '2005-06-06T19:06:02', '2'), - ('529', '671', '2006-02-16T02:30:53', '2005-08-22T19:46:05', '2005-08-27T19:11:05', '2'), - ('120', '4029', '2006-02-16T02:30:53', '2005-05-25T09:47:31', '2005-05-31T10:20:31', '2'), - ('226', '371', '2006-02-16T02:30:53', '2005-06-21T22:13:33', '2005-06-25T21:01:33', '2'), - ('139', '329', '2006-02-16T02:30:53', '2005-07-28T06:42:02', '2005-08-05T11:19:02', '2'), - ('185', '1024', '2006-02-16T02:30:53', '2005-06-18T19:44:08', '2005-06-23T19:14:08', '2'), - ('305', '3699', '2006-02-16T02:30:53', '2005-08-02T04:17:53', '2005-08-09T03:45:53', '2'), - ('533', '2439', '2006-02-16T02:30:53', '2005-06-15T17:57:04', '2005-06-21T20:38:04', '2'), - ('208', '2146', '2006-02-16T02:30:53', '2005-07-09T00:36:02', '2005-07-14T04:06:02', '2'), - ('442', '667', '2006-02-16T02:30:53', '2005-07-31T13:32:18', '2005-08-06T11:15:18', '2'), - ('364', '250', '2006-02-16T02:30:53', '2005-07-27T11:30:20', '2005-07-29T17:16:20', '2'), - ('271', '9', '2006-02-16T02:30:53', '2005-08-01T04:24:47', '2005-08-04T05:36:47', '2'), - ('508', '1827', '2006-02-16T02:30:53', '2005-05-30T11:53:09', '2005-06-03T10:00:09', '2'), - ('423', '3558', '2006-02-16T02:30:53', '2005-06-19T17:04:35', '2005-06-26T14:45:35', '2'), - ('424', '2544', '2006-02-16T02:30:53', '2005-07-30T01:56:22', '2005-08-04T01:58:22', '2'), - ('35', '2751', '2006-02-16T02:30:53', '2005-07-12T05:39:50', '2005-07-13T01:07:50', '2'), - ('382', '3567', '2006-02-16T02:30:53', '2005-07-07T19:04:24', '2005-07-14T00:03:24', '2'), - ('177', '1090', '2006-02-16T02:30:53', '2005-07-11T13:13:45', '2005-07-19T16:37:45', '2'), - ('277', '4102', '2006-02-16T02:30:53', '2005-08-21T04:56:31', '2005-08-22T05:04:31', '2'), - ('370', '49', '2006-02-16T02:30:53', '2005-07-07T21:22:26', '2005-07-16T00:59:26', '2'), - ('1', '2639', '2006-02-16T02:30:53', '2005-08-17T12:37:54', '2005-08-19T10:11:54', '2'), - ('360', '1754', '2006-02-16T02:30:53', '2005-08-17T22:20:16', '2005-08-25T23:30:16', '2'), - ('520', '3216', '2006-02-16T02:30:53', '2005-08-01T12:01:17', '2005-08-06T09:55:17', '2'), - ('507', '2394', '2006-02-16T02:30:53', '2005-07-11T22:31:08', '2005-07-19T17:19:08', '2'), - ('288', '1677', '2006-02-16T02:30:53', '2005-05-27T16:10:04', '2005-06-05T13:22:04', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['551', '12197', '14113', '13703', '15195', '2348', '1419', '10778', '15230', '12339', '11880', '15273', '13229', '6893', '3410', '15732', '961', '12387', '10234', '768', '3147', '6291', '12675', '4593', '15865', '2297', '2170', '11087', '4365', '12109', '2746', '15504', '15482', '10150', '9464', '3624', '11091', '9410', '12530', '3772', '2313', '6369', '3574', '12171', '9946', '10291', '14902', '113', '95', '1798', '12005', '4295', '10405', '269', '10524', '9809', '5640', '9458', '6927', '9730', '7947', '12712', '514', '14154', '926', '4888', '14437', '9990', '10689', '7460', '5399', '7730', '4687', '13920', '5425', '3982', '7255', '147', '14293', '6678', '4385', '6738', '4049', '8758', '1766', '14578', '4160', '3286', '11403', '951', '10932', '736', '13396', '9735', '10655', '5882', '13607', '6137', '1007', '4207']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('315', '3119', '2006-02-16T02:30:53', '2005-05-28T07:44:18', '2005-06-02T12:55:18', '2'), - ('564', '3687', '2006-02-16T02:30:53', '2005-08-18T02:08:58', '2005-08-26T21:54:58', '2'), - ('288', '931', '2006-02-16T02:30:53', '2005-08-21T01:03:30', '2005-08-23T06:46:30', '2'), - ('356', '2296', '2006-02-16T02:30:53', '2005-08-20T09:29:35', '2005-08-27T08:03:35', '2'), - ('508', '1080', '2006-02-16T02:30:53', '2005-08-22T16:08:23', '2005-08-30T17:56:23', '2'), - ('449', '3622', '2006-02-16T02:30:53', '2005-06-18T12:15:43', '2005-06-24T14:03:43', '2'), - ('312', '1208', '2006-02-16T02:30:53', '2005-06-15T17:54:50', '2005-06-17T19:44:50', '2'), - ('220', '1939', '2006-02-16T02:30:53', '2005-08-01T21:11:39', '2005-08-02T22:59:39', '2'), - ('466', '2572', '2006-02-16T02:30:53', '2005-08-22T17:31:41', '2005-08-25T21:57:41', '2'), - ('370', '1600', '2006-02-16T02:30:53', '2005-08-18T07:05:06', '2005-08-19T02:27:06', '2'), - ('597', '1539', '2006-02-16T02:30:53', '2005-08-17T14:28:28', '2005-08-26T12:32:28', '2'), - ('422', '2558', '2006-02-16T02:30:53', '2005-08-22T18:53:28', '2005-08-30T18:58:28', '2'), - ('283', '634', '2006-02-16T02:30:53', '2005-08-19T16:08:33', '2005-08-22T19:54:33', '2'), - ('377', '2611', '2006-02-16T02:30:53', '2005-07-12T21:20:11', '2005-07-21T18:55:11', '2'), - ('321', '1197', '2006-02-16T02:30:53', '2005-06-21T16:20:47', '2005-06-24T19:09:47', '2'), - ('412', '3247', '2006-02-16T02:30:53', '2005-08-23T11:35:12', '2005-08-26T12:50:12', '2'), - ('588', '3293', '2006-02-16T02:30:53', '2005-05-30T18:16:44', '2005-06-04T23:40:44', '2'), - ('530', '3604', '2006-02-16T02:30:53', '2005-08-18T08:46:24', '2005-08-21T02:56:24', '2'), - ('207', '1641', '2006-02-16T02:30:53', '2005-08-01T01:56:20', '2005-08-09T01:51:20', '2'), - ('566', '2895', '2006-02-16T02:30:53', '2005-05-29T12:30:46', '2005-06-07T09:00:46', '2'), - ('390', '615', '2006-02-16T02:30:53', '2005-06-20T20:25:17', '2005-06-28T20:22:17', '2'), - ('262', '3126', '2006-02-16T02:30:53', '2005-07-11T17:16:40', '2005-07-13T18:24:40', '2'), - ('140', '569', '2006-02-16T02:30:53', '2005-08-18T19:34:02', '2005-08-23T13:36:02', '2'), - ('528', '2897', '2006-02-16T02:30:53', '2005-07-08T06:38:12', '2005-07-16T10:48:12', '2'), - ('482', '2031', '2006-02-16T02:30:53', '2005-08-23T16:18:25', '2005-08-26T10:57:25', '2'), - ('111', '2262', '2006-02-16T02:30:53', '2005-06-18T08:17:41', '2005-06-26T05:08:41', '2'), - ('42', '3989', '2006-02-16T02:30:53', '2005-06-17T23:57:34', '2005-06-22T03:37:34', '2'), - ('2', '654', '2006-02-16T02:30:53', '2005-08-02T07:41:41', '2005-08-10T10:37:41', '2'), - ('442', '3207', '2006-02-16T02:30:53', '2005-07-07T19:47:46', '2005-07-08T23:21:46', '2'), - ('509', '1423', '2006-02-16T02:30:53', '2005-08-17T22:58:35', '2005-08-25T19:44:35', '2'), - ('562', '933', '2006-02-16T02:30:53', '2005-06-19T16:21:40', '2005-06-28T11:56:40', '2'), - ('315', '1967', '2006-02-16T02:30:53', '2005-08-23T02:45:21', '2005-09-01T03:24:21', '2'), - ('181', '3923', '2006-02-16T02:30:53', '2005-08-23T02:01:20', '2005-08-24T03:25:20', '2'), - ('419', '2328', '2006-02-16T02:30:53', '2005-07-31T22:22:00', '2005-08-05T01:17:00', '2'), - ('534', '3904', '2006-02-16T02:30:53', '2005-07-30T22:31:31', '2005-08-07T01:10:31', '2'), - ('115', '1778', '2006-02-16T02:30:53', '2005-07-06T06:06:27', '2005-07-13T08:30:27', '2'), - ('423', '1659', '2006-02-16T02:30:53', '2005-08-02T07:56:41', '2005-08-07T05:35:41', '2'), - ('22', '1789', '2006-02-16T02:30:53', '2005-07-30T20:38:05', '2005-07-31T19:57:05', '2'), - ('521', '1054', '2006-02-16T02:30:53', '2005-08-18T13:54:48', '2005-08-26T08:58:48', '2'), - ('338', '434', '2006-02-16T02:30:53', '2005-07-06T13:22:53', '2005-07-10T11:54:53', '2'), - ('379', '3134', '2006-02-16T02:30:53', '2005-06-18T08:56:45', '2005-06-26T10:30:45', '2'), - ('252', '1086', '2006-02-16T02:30:53', '2005-07-11T21:23:36', '2005-07-13T22:23:36', '2'), - ('225', '2799', '2006-02-16T02:30:53', '2005-07-06T03:36:01', '2005-07-10T01:29:01', '2'), - ('457', '454', '2006-02-16T02:30:53', '2005-08-18T01:06:13', '2005-08-22T19:39:13', '2'), - ('29', '2100', '2006-02-16T02:30:53', '2005-07-31T15:48:54', '2005-08-03T12:42:54', '2'), - ('420', '2056', '2006-02-16T02:30:53', '2005-08-01T03:39:57', '2005-08-05T02:05:57', '2'), - ('423', '866', '2006-02-16T02:30:53', '2005-08-22T04:31:50', '2005-08-23T23:47:50', '2'), - ('93', '2963', '2006-02-16T02:30:53', '2005-05-25T19:07:40', '2005-05-27T22:16:40', '2'), - ('400', '178', '2006-02-16T02:30:53', '2005-05-25T16:12:52', '2005-06-02T18:55:52', '2'), - ('429', '1654', '2006-02-16T02:30:53', '2005-06-16T20:16:15', '2005-06-20T22:23:15', '2'), - ('403', '2062', '2006-02-16T02:30:53', '2005-08-17T18:56:55', '2005-08-25T20:23:55', '2'), - ('319', '2490', '2006-02-16T02:30:53', '2005-07-07T16:08:51', '2005-07-13T13:06:51', '2'), - ('463', '3641', '2006-02-16T02:30:53', '2005-08-01T07:35:25', '2005-08-05T05:38:25', '2'), - ('322', '3501', '2006-02-16T02:30:53', '2005-05-26T16:19:46', '2005-05-27T15:59:46', '2'), - ('38', '4116', '2006-02-16T02:30:53', '2005-08-01T11:53:12', '2005-08-08T10:40:12', '2'), - ('286', '359', '2006-02-16T02:30:53', '2005-07-31T11:19:21', '2005-08-08T12:43:21', '2'), - ('574', '2706', '2006-02-16T02:30:53', '2005-07-10T06:38:00', '2005-07-18T08:56:00', '2'), - ('343', '3105', '2006-02-16T02:30:53', '2005-07-30T22:24:34', '2005-08-04T21:26:34', '2'), - ('470', '4511', '2006-02-16T02:30:53', '2005-07-26T22:56:00', '2005-08-05T03:16:00', '2'), - ('242', '2605', '2006-02-16T02:30:53', '2005-07-31T08:50:08', '2005-08-08T12:21:08', '2'), - ('279', '2504', '2006-02-16T02:30:53', '2005-07-28T13:05:50', '2005-08-02T11:16:50', '2'), - ('444', '2628', '2006-02-16T02:30:53', '2005-08-18T21:04:13', '2005-08-25T18:15:13', '2'), - ('597', '1697', '2006-02-16T02:30:53', '2005-05-28T03:09:28', '2005-06-05T00:49:28', '2'), - ('468', '951', '2006-02-16T02:30:53', '2005-08-21T02:30:00', '2005-08-28T01:41:00', '2'), - ('76', '4327', '2006-02-16T02:30:53', '2005-05-30T12:15:54', '2005-06-01T08:53:54', '2'), - ('527', '1220', '2006-02-16T02:30:53', '2005-07-08T20:04:27', '2005-07-10T14:53:27', '2'), - ('136', '1504', '2006-02-16T02:30:53', '2005-08-21T11:48:32', '2005-08-25T11:06:32', '2'), - ('555', '4481', '2006-02-16T02:30:53', '2005-07-31T17:24:21', '2005-08-09T17:14:21', '2'), - ('568', '1442', '2006-02-16T02:30:53', '2005-08-01T18:04:18', '2005-08-05T21:17:18', '2'), - ('442', '919', '2006-02-16T02:30:53', '2005-07-27T18:41:35', '2005-07-29T15:16:35', '2'), - ('67', '261', '2006-02-16T02:30:53', '2005-07-09T19:52:44', '2005-07-10T18:31:44', '2'), - ('155', '3118', '2006-02-16T02:30:53', '2005-07-28T04:59:48', '2005-08-04T04:35:48', '2'), - ('169', '1156', '2006-02-16T02:30:53', '2005-07-08T10:54:19', '2005-07-10T08:00:19', '2'), - ('460', '3200', '2006-02-16T02:30:53', '2005-08-20T16:51:18', '2005-08-27T16:05:18', '2'), - ('37', '531', '2006-02-16T02:30:53', '2005-07-09T21:02:26', '2005-07-16T23:38:26', '2'), - ('64', '4327', '2006-02-16T02:30:53', '2005-07-06T23:14:16', '2005-07-08T21:21:16', '2'), - ('502', '2101', '2006-02-16T02:30:53', '2005-07-27T10:49:54', '2005-07-31T10:40:54', '2'), - ('274', '633', '2006-02-16T02:30:53', '2005-05-26T00:17:50', '2005-05-29T23:21:50', '2'), - ('364', '3555', '2006-02-16T02:30:53', '2005-08-21T07:06:47', '2005-08-22T05:07:47', '2'), - ('330', '3473', '2006-02-16T02:30:53', '2005-07-12T11:58:36', '2005-07-15T17:50:36', '2'), - ('564', '849', '2006-02-16T02:30:53', '2005-07-07T20:48:38', '2005-07-11T17:03:38', '2'), - ('366', '1197', '2006-02-16T02:30:53', '2005-07-12T14:17:55', '2005-07-21T10:11:55', '2'), - ('79', '4172', '2006-02-16T02:30:53', '2005-07-07T03:34:53', '2005-07-15T04:10:53', '2'), - ('442', '2816', '2006-02-16T02:30:53', '2005-07-29T19:20:49', '2005-08-05T21:57:49', '2'), - ('118', '2041', '2006-02-16T02:30:53', '2005-06-16T17:59:37', '2005-06-18T16:32:37', '2'), - ('389', '3141', '2006-02-16T02:30:53', '2005-08-21T16:53:38', '2005-08-28T20:36:38', '2'), - ('326', '1909', '2006-02-16T02:30:53', '2005-07-07T09:13:17', '2005-07-15T11:50:17', '2'), - ('577', '742', '2006-02-16T02:30:53', '2005-06-21T06:31:29', '2005-06-25T00:46:29', '2'), - ('587', '4072', '2006-02-16T02:30:53', '2005-08-02T19:10:21', '2005-08-04T00:44:21', '2'), - ('59', '1395', '2006-02-16T02:30:53', '2005-05-30T16:10:35', '2005-05-31T19:01:35', '2'), - ('595', '1688', '2006-02-16T02:30:53', '2005-08-02T02:46:22', '2005-08-06T01:49:22', '2'), - ('276', '3689', '2006-02-16T02:30:53', '2005-05-29T08:10:07', '2005-06-05T10:21:07', '2'), - ('517', '4169', '2006-02-16T02:30:53', '2005-08-19T22:06:09', '2005-08-23T23:26:09', '2'), - ('315', '4228', '2006-02-16T02:30:53', '2005-07-31T08:57:49', '2005-08-08T13:51:49', '2'), - ('385', '1399', '2006-02-16T02:30:53', '2005-08-01T16:33:27', '2005-08-08T17:17:27', '2'), - ('319', '2830', '2006-02-16T02:30:53', '2005-07-10T19:20:34', '2005-07-11T18:39:34', '2'), - ('491', '2692', '2006-02-16T02:30:53', '2005-08-20T06:08:42', '2005-08-21T01:59:42', '2'), - ('67', '2029', '2006-02-16T02:30:53', '2005-07-11T08:34:20', '2005-07-13T03:31:20', '2'), - ('24', '3185', '2006-02-16T02:30:53', '2005-05-31T01:02:28', '2005-06-07T01:36:28', '2'), - ('588', '1119', '2006-02-16T02:30:53', '2005-07-07T11:32:45', '2005-07-14T05:49:45', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['1266', '12257', '11199', '10557', '1586', '9299', '9389', '13675', '6100', '4215', '2481', '318', '819', '15806', '7816', '2095', '11956', '3007', '7082', '12921', '13107', '4524', '12555', '1530', '8824', '1493', '8240', '6246', '1191', '661', '8967', '13397', '9019', '15728', '6609', '6301', '3313', '10937', '648', '12090', '2781', '12233', '1211', '9153', '9434', '8717', '12964', '12001', '12193', '2066', '2341', '7560', '14179', '2284', '4444', '10634', '9551', '9416', '2750', '4916', '13581', '13049', '6375', '3330', '2920', '615', '14485', '5944', '3909', '3538', '7756', '35', '4577', '9871', '7314', '3983', '14380', '11963', '6015', '5564', '10442', '15119', '7956', '11002', '2334', '15168', '2250', '13833', '6942', '171', '7189', '3651', '14047', '15794', '9920', '9725', '12685', '10588', '10116', '3349']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('96', '2230', '2006-02-16T02:30:53', '2005-06-15T07:11:39', '2005-06-21T02:59:39', '2'), - ('87', '269', '2006-02-16T02:30:53', '2005-08-18T04:11:03', '2005-08-25T01:20:03', '2'), - ('578', '3926', '2006-02-16T02:30:53', '2005-08-02T11:47:40', '2005-08-10T06:52:40', '2'), - ('385', '240', '2006-02-16T02:30:53', '2005-08-01T12:59:24', '2005-08-04T17:08:24', '2'), - ('140', '769', '2006-02-16T02:30:53', '2005-06-16T04:51:18', '2005-06-21T06:54:18', '2'), - ('555', '1515', '2006-02-16T02:30:53', '2005-07-30T16:32:51', '2005-08-08T15:28:51', '2'), - ('198', '3124', '2006-02-16T02:30:53', '2005-07-30T19:27:59', '2005-08-04T18:25:59', '2'), - ('493', '350', '2006-02-16T02:30:53', '2005-08-20T08:32:51', '2005-08-27T03:52:51', '2'), - ('16', '3485', '2006-02-16T02:30:53', '2005-07-11T06:40:31', '2005-07-14T10:59:31', '2'), - ('22', '1239', '2006-02-16T02:30:53', '2005-07-07T12:00:52', '2005-07-11T15:14:52', '2'), - ('322', '800', '2006-02-16T02:30:53', '2005-06-18T21:08:30', '2005-06-23T02:35:30', '2'), - ('60', '2559', '2006-02-16T02:30:53', '2005-05-26T23:37:39', '2005-06-03T04:31:39', '2'), - ('511', '623', '2006-02-16T02:30:53', '2005-05-29T21:00:32', '2005-06-02T15:15:32', '2'), - ('166', '2683', '2006-02-16T02:30:53', '2005-08-23T14:31:50', '2005-08-27T16:08:50', '2'), - ('283', '1422', '2006-02-16T02:30:53', '2005-07-28T08:14:12', '2005-07-30T08:00:12', '2'), - ('8', '1907', '2006-02-16T02:30:53', '2005-06-17T18:21:35', '2005-06-23T23:49:35', '2'), - ('457', '2533', '2006-02-16T02:30:53', '2005-08-17T17:22:05', '2005-08-25T22:19:05', '2'), - ('7', '1950', '2006-02-16T02:30:53', '2005-06-20T10:11:53', '2005-06-25T04:51:53', '2'), - ('64', '2032', '2006-02-16T02:30:53', '2005-07-27T04:27:32', '2005-07-30T06:06:32', '2'), - ('234', '781', '2006-02-16T02:30:53', '2005-08-19T04:47:48', '2005-08-25T00:07:48', '2'), - ('356', '3870', '2006-02-16T02:30:53', '2005-08-19T11:13:58', '2005-08-20T15:03:58', '2'), - ('185', '2218', '2006-02-16T02:30:53', '2005-07-08T03:10:48', '2005-07-09T07:49:48', '2'), - ('557', '4434', '2006-02-16T02:30:53', '2005-08-18T14:49:22', '2005-08-26T14:11:22', '2'), - ('392', '2421', '2006-02-16T02:30:53', '2005-06-16T00:38:07', '2005-06-24T02:45:07', '2'), - ('164', '3506', '2006-02-16T02:30:53', '2005-07-29T22:22:58', '2005-07-31T21:02:58', '2'), - ('235', '4581', '2006-02-16T02:30:53', '2005-06-15T21:50:32', '2005-06-17T01:02:32', '2'), - ('509', '1975', '2006-02-16T02:30:53', '2005-07-29T00:33:32', '2005-08-05T21:25:32', '2'), - ('172', '2376', '2006-02-16T02:30:53', '2005-07-11T14:57:51', '2005-07-19T19:10:51', '2'), - ('291', '2221', '2006-02-16T02:30:53', '2005-06-15T01:10:35', '2005-06-17T20:36:35', '2'), - ('51', '2247', '2006-02-16T02:30:53', '2005-05-28T21:01:25', '2005-06-02T01:22:25', '2'), - ('480', '1536', '2006-02-16T02:30:53', '2005-07-30T03:56:55', '2005-08-06T05:25:55', '2'), - ('379', '3863', '2006-02-16T02:30:53', '2005-08-19T22:06:35', '2005-08-29T01:11:35', '2'), - ('235', '946', '2006-02-16T02:30:53', '2005-07-30T05:28:53', '2005-08-03T02:16:53', '2'), - ('323', '2567', '2006-02-16T02:30:53', '2005-08-23T11:30:32', '2005-08-28T09:52:32', '2'), - ('133', '3332', '2006-02-16T02:30:53', '2005-07-12T08:19:41', '2005-07-19T08:19:41', '2'), - ('275', '3528', '2006-02-16T02:30:53', '2005-07-11T17:54:09', '2005-07-18T20:42:09', '2'), - ('213', '4267', '2006-02-16T02:30:53', '2005-06-21T08:11:18', '2005-06-23T04:28:18', '2'), - ('416', '1320', '2006-02-16T02:30:53', '2005-08-02T03:00:18', '2005-08-11T03:44:18', '2'), - ('253', '3476', '2006-02-16T02:30:53', '2005-05-28T19:25:54', '2005-06-03T15:57:54', '2'), - ('391', '3392', '2006-02-16T02:30:53', '2005-08-17T22:21:43', '2005-08-20T23:53:43', '2'), - ('197', '1230', '2006-02-16T02:30:53', '2005-06-19T18:24:42', '2005-06-27T17:02:42', '2'), - ('535', '174', '2006-02-16T02:30:53', '2005-08-18T03:16:54', '2005-08-22T04:48:54', '2'), - ('122', '3360', '2006-02-16T02:30:53', '2005-06-15T03:01:20', '2005-06-18T07:52:20', '2'), - ('589', '3743', '2006-02-16T02:30:53', '2005-07-30T10:58:16', '2005-08-03T06:16:16', '2'), - ('13', '3792', '2006-02-16T02:30:53', '2005-07-30T21:29:41', '2005-08-01T16:30:41', '2'), - ('260', '1821', '2006-02-16T02:30:53', '2005-07-29T17:40:45', '2005-08-01T22:38:45', '2'), - ('142', '2854', '2006-02-16T02:30:53', '2005-08-19T06:29:13', '2005-08-22T12:23:13', '2'), - ('52', '4158', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('290', '1086', '2006-02-16T02:30:53', '2005-08-18T02:03:59', '2005-08-25T05:32:59', '2'), - ('248', '2561', '2006-02-16T02:30:53', '2005-06-17T16:07:08', '2005-06-24T15:20:08', '2'), - ('31', '638', '2006-02-16T02:30:53', '2005-06-18T11:35:30', '2005-06-27T11:56:30', '2'), - ('562', '3574', '2006-02-16T02:30:53', '2005-07-27T22:20:17', '2005-08-02T23:00:17', '2'), - ('79', '3956', '2006-02-16T02:30:53', '2005-08-21T03:14:27', '2005-08-26T00:46:27', '2'), - ('228', '2682', '2006-02-16T02:30:53', '2005-06-18T06:59:51', '2005-06-24T04:58:51', '2'), - ('529', '764', '2006-02-16T02:30:53', '2005-07-07T23:07:44', '2005-07-14T02:51:44', '2'), - ('592', '445', '2006-02-16T02:30:53', '2005-08-01T15:37:48', '2005-08-02T12:11:48', '2'), - ('30', '1260', '2006-02-16T02:30:53', '2005-07-31T02:04:58', '2005-08-06T04:07:58', '2'), - ('265', '1470', '2006-02-16T02:30:53', '2005-07-30T20:52:45', '2005-08-02T17:38:45', '2'), - ('197', '3775', '2006-02-16T02:30:53', '2005-06-19T16:37:24', '2005-06-20T13:55:24', '2'), - ('212', '2680', '2006-02-16T02:30:53', '2005-07-08T21:32:17', '2005-07-14T20:55:17', '2'), - ('119', '1753', '2006-02-16T02:30:53', '2005-08-20T05:26:15', '2005-08-21T11:07:15', '2'), - ('53', '4122', '2006-02-16T02:30:53', '2005-08-19T09:25:40', '2005-08-27T10:19:40', '2'), - ('8', '1936', '2006-02-16T02:30:53', '2005-07-11T21:39:46', '2005-07-18T02:12:46', '2'), - ('294', '299', '2006-02-16T02:30:53', '2005-06-21T09:22:37', '2005-06-23T07:16:37', '2'), - ('588', '487', '2006-02-16T02:30:53', '2005-06-20T04:12:46', '2005-06-26T23:34:46', '2'), - ('533', '3397', '2006-02-16T02:30:53', '2005-05-28T15:35:52', '2005-06-03T17:35:52', '2'), - ('241', '1637', '2006-02-16T02:30:53', '2005-08-21T13:52:07', '2005-08-30T13:06:07', '2'), - ('432', '3904', '2006-02-16T02:30:53', '2005-07-10T22:51:44', '2005-07-18T17:54:44', '2'), - ('396', '3423', '2006-02-16T02:30:53', '2005-07-06T19:54:41', '2005-07-15T18:11:41', '2'), - ('228', '4361', '2006-02-16T02:30:53', '2005-07-06T01:37:07', '2005-07-11T06:02:07', '2'), - ('469', '1611', '2006-02-16T02:30:53', '2005-07-28T06:22:52', '2005-08-05T11:55:52', '2'), - ('484', '1286', '2006-02-16T02:30:53', '2005-05-25T04:24:36', '2005-05-27T07:02:36', '2'), - ('442', '1688', '2006-02-16T02:30:53', '2005-07-08T05:59:00', '2005-07-16T06:23:00', '2'), - ('109', '194', '2006-02-16T02:30:53', '2005-07-31T13:25:46', '2005-08-01T13:12:46', '2'), - ('11', '1376', '2006-02-16T02:30:53', '2005-07-27T13:13:32', '2005-08-03T09:24:32', '2'), - ('6', '1261', '2006-02-16T02:30:53', '2005-07-06T23:14:21', '2005-07-12T17:55:21', '2'), - ('198', '1523', '2006-02-16T02:30:53', '2005-08-21T09:53:52', '2005-08-25T05:03:52', '2'), - ('211', '232', '2006-02-16T02:30:53', '2005-08-17T17:35:47', '2005-08-23T16:19:47', '2'), - ('596', '295', '2006-02-16T02:30:53', '2005-07-11T02:04:12', '2005-07-13T02:43:12', '2'), - ('355', '196', '2006-02-16T02:30:53', '2005-07-10T03:23:05', '2005-07-16T07:46:05', '2'), - ('40', '4570', '2006-02-16T02:30:53', '2005-08-01T08:58:08', '2005-08-05T09:07:08', '2'), - ('288', '4526', '2006-02-16T02:30:53', '2005-08-22T12:41:33', '2005-08-23T14:44:33', '2'), - ('118', '4335', '2006-02-16T02:30:53', '2005-07-28T13:32:17', '2005-08-06T14:51:17', '2'), - ('583', '3073', '2006-02-16T02:30:53', '2005-08-02T05:02:56', '2005-08-05T07:04:56', '2'), - ('223', '3076', '2006-02-16T02:30:53', '2005-06-18T10:56:24', '2005-06-22T10:38:24', '2'), - ('526', '3218', '2006-02-16T02:30:53', '2005-08-22T15:14:20', '2005-08-25T20:12:20', '2'), - ('7', '4042', '2006-02-16T02:30:53', '2005-06-18T05:03:36', '2005-06-22T02:25:36', '2'), - ('175', '792', '2006-02-16T02:30:53', '2005-08-20T14:00:29', '2005-08-29T12:01:29', '2'), - ('470', '1203', '2006-02-16T02:30:53', '2005-07-26T23:27:40', '2005-07-31T03:17:40', '2'), - ('400', '4483', '2006-02-16T02:30:53', '2005-05-26T03:14:15', '2005-06-03T00:24:15', '2'), - ('151', '4419', '2006-02-16T02:30:53', '2005-07-27T08:35:02', '2005-07-30T14:00:02', '2'), - ('170', '3323', '2006-02-16T02:30:53', '2005-07-06T07:40:31', '2005-07-08T03:39:31', '2'), - ('579', '186', '2006-02-16T02:30:53', '2005-08-20T22:00:43', '2005-08-24T03:17:43', '2'), - ('579', '3917', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('139', '3108', '2006-02-16T02:30:53', '2005-07-31T14:57:13', '2005-08-03T18:58:13', '2'), - ('503', '3960', '2006-02-16T02:30:53', '2005-07-31T08:35:18', '2005-08-03T03:46:18', '2'), - ('114', '4283', '2006-02-16T02:30:53', '2005-08-18T19:51:29', '2005-08-27T14:58:29', '2'), - ('49', '2384', '2006-02-16T02:30:53', '2005-08-01T14:10:21', '2005-08-03T13:47:21', '2'), - ('28', '738', '2006-02-16T02:30:53', '2005-07-31T21:14:02', '2005-08-03T01:48:02', '2'), - ('336', '3885', '2006-02-16T02:30:53', '2005-06-21T11:17:35', '2005-06-22T12:51:35', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['7644', '12935', '13768', '2744', '10224', '2625', '801', '5299', '10244', '5115', '12426', '13338', '8745', '317', '16019', '479', '11934', '5753', '2382', '15352', '5526', '8146', '14598', '6467', '15420', '8627', '8280', '11944', '9720', '1787', '489', '8604', '7297', '4236', '8244', '1765', '285', '11901', '4453', '9876', '6756', '4945', '3853', '6695', '490', '883', '4147', '10292', '4935', '11748', '7200', '2035', '3835', '14737', '4101', '6961', '8256', '14236', '15129', '10086', '712', '5824', '13371', '3639', '12862', '2827', '8139', '631', '10815', '9233', '7261', '15424', '3063', '893', '8830', '12063', '498', '7213', '14081', '3750', '12955', '7990', '1782', '14573', '4270', '1443', '5648', '22', '4311', '9576', '6661', '12422', '8230', '1495', '15008', '5066', '368', '3484', '9805', '2504']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('173', '882', '2006-02-16T02:30:53', '2005-07-28T01:27:33', '2005-07-31T22:58:33', '2'), - ('279', '193', '2006-02-16T02:30:53', '2005-08-19T05:20:25', '2005-08-21T03:10:25', '2'), - ('198', '3847', '2006-02-16T02:30:53', '2005-08-20T11:43:43', '2005-08-27T07:56:43', '2'), - ('368', '4511', '2006-02-16T02:30:53', '2005-06-19T16:20:40', '2005-06-22T11:44:40', '2'), - ('587', '1443', '2006-02-16T02:30:53', '2005-08-01T01:31:56', '2005-08-05T21:21:56', '2'), - ('25', '3946', '2006-02-16T02:30:53', '2005-06-19T08:23:11', '2005-06-26T09:52:11', '2'), - ('402', '1642', '2006-02-16T02:30:53', '2005-05-29T17:35:50', '2005-06-04T17:05:50', '2'), - ('469', '4416', '2006-02-16T02:30:53', '2005-07-09T15:38:09', '2005-07-15T16:39:09', '2'), - ('51', '567', '2006-02-16T02:30:53', '2005-08-01T02:20:01', '2005-08-06T23:06:01', '2'), - ('212', '2296', '2006-02-16T02:30:53', '2005-07-09T07:07:18', '2005-07-16T03:28:18', '2'), - ('75', '799', '2006-02-16T02:30:53', '2005-08-18T10:24:11', '2005-08-22T15:34:11', '2'), - ('86', '3739', '2006-02-16T02:30:53', '2005-08-19T20:09:59', '2005-08-23T22:59:59', '2'), - ('293', '1766', '2006-02-16T02:30:53', '2005-07-29T19:03:05', '2005-08-06T14:06:05', '2'), - ('391', '26', '2006-02-16T02:30:53', '2005-05-26T23:23:56', '2005-06-01T19:56:56', '2'), - ('278', '3093', '2006-02-16T02:30:53', '2005-08-23T21:30:45', '2005-08-27T23:45:45', '2'), - ('231', '2060', '2006-02-16T02:30:53', '2005-05-27T22:39:10', '2005-06-05T22:46:10', '2'), - ('596', '1230', '2006-02-16T02:30:53', '2005-08-17T16:40:00', '2005-08-20T20:13:00', '2'), - ('444', '3639', '2006-02-16T02:30:53', '2005-07-10T12:29:43', '2005-07-17T12:50:43', '2'), - ('568', '915', '2006-02-16T02:30:53', '2005-06-18T15:03:52', '2005-06-20T10:16:52', '2'), - ('560', '16', '2006-02-16T02:30:53', '2005-08-22T21:16:54', '2005-08-31T00:38:54', '2'), - ('144', '3909', '2006-02-16T02:30:53', '2005-07-10T02:04:03', '2005-07-16T22:15:03', '2'), - ('476', '2430', '2006-02-16T02:30:53', '2005-07-28T20:37:36', '2005-07-31T16:03:36', '2'), - ('359', '1113', '2006-02-16T02:30:53', '2005-08-21T17:40:05', '2005-08-29T18:16:05', '2'), - ('457', '2067', '2006-02-16T02:30:53', '2005-07-12T01:22:03', '2005-07-20T04:37:03', '2'), - ('161', '1396', '2006-02-16T02:30:53', '2005-08-22T23:55:51', '2005-08-31T20:09:51', '2'), - ('226', '4235', '2006-02-16T02:30:53', '2005-07-29T14:05:12', '2005-08-05T16:53:12', '2'), - ('195', '1208', '2006-02-16T02:30:53', '2005-07-29T01:45:51', '2005-08-05T22:51:51', '2'), - ('389', '27', '2006-02-16T02:30:53', '2005-08-17T17:02:42', '2005-08-21T16:40:42', '2'), - ('587', '1282', '2006-02-16T02:30:53', '2005-07-31T08:25:21', '2005-08-07T11:30:21', '2'), - ('546', '3823', '2006-02-16T02:30:53', '2005-06-16T19:30:59', '2005-06-21T18:25:59', '2'), - ('476', '1940', '2006-02-16T02:30:53', '2005-05-28T00:09:12', '2005-05-31T04:44:12', '2'), - ('326', '3909', '2006-02-16T02:30:53', '2005-07-29T13:07:13', '2005-07-31T18:00:13', '2'), - ('135', '1855', '2006-02-16T02:30:53', '2005-07-27T12:39:48', '2005-07-29T17:50:48', '2'), - ('213', '642', '2006-02-16T02:30:53', '2005-07-07T13:12:07', '2005-07-08T15:00:07', '2'), - ('175', '1552', '2006-02-16T02:30:53', '2005-07-29T00:35:34', '2005-08-05T04:18:34', '2'), - ('273', '822', '2006-02-16T02:30:53', '2005-06-16T17:56:10', '2005-06-19T23:40:10', '2'), - ('162', '2486', '2006-02-16T02:30:53', '2005-05-26T19:41:40', '2005-05-31T16:58:40', '2'), - ('70', '4274', '2006-02-16T02:30:53', '2005-08-17T15:35:47', '2005-08-20T10:33:47', '2'), - ('560', '89', '2006-02-16T02:30:53', '2005-07-07T23:32:39', '2005-07-12T01:38:39', '2'), - ('347', '828', '2006-02-16T02:30:53', '2005-07-31T13:37:51', '2005-08-07T18:05:51', '2'), - ('531', '1174', '2006-02-16T02:30:53', '2005-07-12T15:08:28', '2005-07-13T14:25:28', '2'), - ('165', '2079', '2006-02-16T02:30:53', '2005-07-08T22:45:02', '2005-07-11T23:59:02', '2'), - ('537', '1411', '2006-02-16T02:30:53', '2005-07-06T16:59:20', '2005-07-07T12:30:20', '2'), - ('550', '3088', '2006-02-16T02:30:53', '2005-07-12T12:39:39', '2005-07-17T13:36:39', '2'), - ('95', '3524', '2006-02-16T02:30:53', '2005-05-28T00:09:56', '2005-05-30T22:32:56', '2'), - ('399', '2271', '2006-02-16T02:30:53', '2005-05-30T06:21:05', '2005-06-07T04:50:05', '2'), - ('274', '2776', '2006-02-16T02:30:53', '2005-07-07T08:32:12', '2005-07-12T10:10:12', '2'), - ('340', '2562', '2006-02-16T02:30:53', '2005-08-01T03:42:40', '2005-08-01T23:36:40', '2'), - ('230', '2708', '2006-02-16T02:30:53', '2005-07-08T22:20:56', '2005-07-12T01:01:56', '2'), - ('595', '1175', '2006-02-16T02:30:53', '2005-08-17T09:04:02', '2005-08-21T12:22:02', '2'), - ('78', '4406', '2006-02-16T02:30:53', '2005-07-27T08:57:38', '2005-08-02T12:29:38', '2'), - ('158', '4371', '2006-02-16T02:30:53', '2005-06-17T13:45:09', '2005-06-26T15:30:09', '2'), - ('486', '935', '2006-02-16T02:30:53', '2005-07-06T16:22:45', '2005-07-11T17:04:45', '2'), - ('124', '1842', '2006-02-16T02:30:53', '2005-08-21T22:27:11', '2005-08-25T18:51:11', '2'), - ('588', '2891', '2006-02-16T02:30:53', '2005-07-07T06:25:11', '2005-07-12T07:44:11', '2'), - ('38', '2205', '2006-02-16T02:30:53', '2005-07-27T00:10:49', '2005-07-30T00:26:49', '2'), - ('537', '1483', '2006-02-16T02:30:53', '2005-07-29T01:02:42', '2005-07-31T22:29:42', '2'), - ('25', '172', '2006-02-16T02:30:53', '2005-08-21T05:13:16', '2005-08-26T04:03:16', '2'), - ('234', '3782', '2006-02-16T02:30:53', '2005-08-22T13:03:52', '2005-08-29T10:56:52', '2'), - ('205', '2853', '2006-02-16T02:30:53', '2005-07-31T20:14:08', '2005-08-07T01:33:08', '2'), - ('313', '4191', '2006-02-16T02:30:53', '2005-05-29T04:02:24', '2005-05-30T03:09:24', '2'), - ('449', '1980', '2006-02-16T02:30:53', '2005-07-10T16:19:53', '2005-07-12T11:17:53', '2'), - ('34', '3401', '2006-02-16T02:30:53', '2005-08-19T21:21:47', '2005-08-26T16:17:47', '2'), - ('7', '2812', '2006-02-16T02:30:53', '2005-07-06T07:09:17', '2005-07-15T05:12:17', '2'), - ('198', '473', '2006-02-16T02:30:53', '2005-08-19T02:31:59', '2005-08-26T08:16:59', '2'), - ('23', '2745', '2006-02-16T02:30:53', '2005-06-19T20:50:01', '2005-06-20T18:54:01', '2'), - ('177', '3651', '2006-02-16T02:30:53', '2005-07-28T20:16:30', '2005-08-03T18:00:30', '2'), - ('503', '2465', '2006-02-16T02:30:53', '2005-05-28T17:36:32', '2005-06-03T14:56:32', '2'), - ('62', '877', '2006-02-16T02:30:53', '2005-08-01T22:46:21', '2005-08-03T02:43:21', '2'), - ('357', '2320', '2006-02-16T02:30:53', '2005-07-30T13:44:15', '2005-08-07T13:02:15', '2'), - ('172', '942', '2006-02-16T02:30:53', '2005-07-27T11:15:01', '2005-07-28T09:42:01', '2'), - ('138', '3452', '2006-02-16T02:30:53', '2005-08-23T00:03:01', '2005-08-27T23:27:01', '2'), - ('515', '3954', '2006-02-16T02:30:53', '2005-06-20T13:52:03', '2005-06-28T13:36:03', '2'), - ('502', '3260', '2006-02-16T02:30:53', '2005-05-30T08:06:59', '2005-06-07T08:23:59', '2'), - ('202', '1751', '2006-02-16T02:30:53', '2005-07-29T22:34:35', '2005-08-05T20:12:35', '2'), - ('550', '1141', '2006-02-16T02:30:53', '2005-08-17T21:24:48', '2005-08-23T22:10:48', '2'), - ('287', '458', '2006-02-16T02:30:53', '2005-05-28T01:01:21', '2005-05-30T21:20:21', '2'), - ('502', '2836', '2006-02-16T02:30:53', '2005-07-27T09:22:29', '2005-08-03T13:53:29', '2'), - ('392', '589', '2006-02-16T02:30:53', '2005-08-20T23:35:13', '2005-08-28T01:41:13', '2'), - ('103', '2422', '2006-02-16T02:30:53', '2005-07-06T12:19:28', '2005-07-14T13:16:28', '2'), - ('410', '2040', '2006-02-16T02:30:53', '2005-08-19T06:05:58', '2005-08-26T04:24:58', '2'), - ('232', '188', '2006-02-16T02:30:53', '2005-07-28T14:43:08', '2005-08-01T10:51:08', '2'), - ('498', '1820', '2006-02-16T02:30:53', '2005-06-16T19:21:12', '2005-06-22T16:03:12', '2'), - ('240', '2423', '2006-02-16T02:30:53', '2005-08-21T16:44:32', '2005-08-23T14:01:32', '2'), - ('210', '183', '2006-02-16T02:30:53', '2005-07-07T14:38:41', '2005-07-10T19:07:41', '2'), - ('435', '2485', '2006-02-16T02:30:53', '2005-06-15T18:57:51', '2005-06-18T14:18:51', '2'), - ('24', '4359', '2006-02-16T02:30:53', '2005-07-10T07:09:21', '2005-07-16T07:23:21', '2'), - ('509', '727', '2006-02-16T02:30:53', '2005-05-25T02:19:23', '2005-05-26T04:52:23', '2'), - ('498', '2985', '2006-02-16T02:30:53', '2005-07-07T17:31:14', '2005-07-11T19:21:14', '2'), - ('145', '3327', '2006-02-16T02:30:53', '2005-07-31T02:52:59', '2005-08-05T23:35:59', '2'), - ('315', '2367', '2006-02-16T02:30:53', '2005-07-12T11:20:39', '2005-07-16T08:17:39', '2'), - ('451', '1855', '2006-02-16T02:30:53', '2005-08-18T10:13:12', '2005-08-20T14:36:12', '2'), - ('2', '1937', '2006-02-16T02:30:53', '2005-07-29T00:12:59', '2005-08-06T19:52:59', '2'), - ('175', '1842', '2006-02-16T02:30:53', '2005-06-15T21:54:31', '2005-06-19T00:08:31', '2'), - ('277', '961', '2006-02-16T02:30:53', '2005-08-22T08:24:32', '2005-08-31T13:48:32', '2'), - ('169', '1702', '2006-02-16T02:30:53', '2005-07-09T04:48:50', '2005-07-12T22:54:50', '2'), - ('361', '1247', '2006-02-16T02:30:53', '2005-05-27T07:42:29', '2005-06-04T11:20:29', '2'), - ('114', '1934', '2006-02-16T02:30:53', '2005-07-05T23:23:11', '2005-07-11T00:27:11', '2'), - ('36', '4179', '2006-02-16T02:30:53', '2005-07-31T11:11:10', '2005-08-03T07:36:10', '2'), - ('452', '1684', '2006-02-16T02:30:53', '2005-06-18T23:19:53', '2005-06-21T04:43:53', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['12092', '9176', '4273', '739', '13576', '3002', '10533', '11264', '6469', '1528', '5974', '10028', '533', '13689', '5847', '1856', '8243', '3621', '9211', '3598', '8850', '7083', '5151', '1874', '1001', '1635', '1761', '6119', '6146', '10824', '15645', '34', '11183', '14670', '14108', '12912', '1185', '9312', '1946', '13512', '10623', '10776', '12633', '8142', '1224', '10482', '10942', '15392', '6966', '7341', '3416', '2801', '14862', '8563', '3939', '14166', '8607', '13530', '5837', '2974', '10209', '3233', '8092', '7606', '3784', '10885', '3456', '4619', '7842', '5410', '10649', '14217', '2276', '13038', '12875', '13490', '6537', '13293', '5258', '13966', '7045', '10457', '5102', '5988', '5008', '10670', '1696', '14230', '9417', '863', '10729', '15413', '5578', '10756', '11107', '13114', '3333', '2329', '11077', '25']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('38', '3964', '2006-02-16T02:30:53', '2005-08-17T22:28:15', '2005-08-18T16:46:15', '2'), - ('260', '2659', '2006-02-16T02:30:53', '2005-07-30T11:50:54', '2005-08-02T14:25:54', '2'), - ('159', '4163', '2006-02-16T02:30:53', '2005-07-07T14:40:22', '2005-07-13T09:58:22', '2'), - ('84', '1183', '2006-02-16T02:30:53', '2005-05-29T08:28:18', '2005-06-06T09:21:18', '2'), - ('223', '2669', '2006-02-16T02:30:53', '2005-08-20T05:19:56', '2005-08-22T09:08:56', '2'), - ('266', '2749', '2006-02-16T02:30:53', '2005-06-20T09:56:12', '2005-06-24T12:15:12', '2'), - ('593', '1924', '2006-02-16T02:30:53', '2005-08-01T12:14:16', '2005-08-09T17:13:16', '2'), - ('360', '3420', '2006-02-16T02:30:53', '2005-08-02T14:05:18', '2005-08-10T08:46:18', '2'), - ('147', '3830', '2006-02-16T02:30:53', '2005-07-12T01:29:27', '2005-07-16T20:22:27', '2'), - ('110', '4297', '2006-02-16T02:30:53', '2005-06-16T00:32:52', '2005-06-25T01:07:52', '2'), - ('517', '3984', '2006-02-16T02:30:53', '2005-07-11T00:10:37', '2005-07-18T18:48:37', '2'), - ('323', '2305', '2006-02-16T02:30:53', '2005-07-31T18:35:54', '2005-08-01T13:01:54', '2'), - ('528', '4306', '2006-02-16T02:30:53', '2005-05-28T06:14:46', '2005-06-01T06:26:46', '2'), - ('336', '819', '2006-02-16T02:30:53', '2005-08-20T09:04:30', '2005-08-22T05:38:30', '2'), - ('220', '4403', '2006-02-16T02:30:53', '2005-07-10T17:27:42', '2005-07-12T14:51:42', '2'), - ('161', '3034', '2006-02-16T02:30:53', '2005-06-17T01:02:00', '2005-06-19T21:29:00', '2'), - ('481', '1873', '2006-02-16T02:30:53', '2005-07-29T00:35:33', '2005-08-04T06:02:33', '2'), - ('171', '3132', '2006-02-16T02:30:53', '2005-07-06T06:03:55', '2005-07-11T09:25:55', '2'), - ('57', '595', '2006-02-16T02:30:53', '2005-07-30T12:59:45', '2005-08-07T18:17:45', '2'), - ('68', '1317', '2006-02-16T02:30:53', '2005-07-06T05:11:04', '2005-07-09T02:03:04', '2'), - ('86', '355', '2006-02-16T02:30:53', '2005-07-29T23:24:20', '2005-07-31T00:43:20', '2'), - ('575', '2663', '2006-02-16T02:30:53', '2005-07-27T04:28:39', '2005-07-30T04:35:39', '2'), - ('228', '224', '2006-02-16T02:30:53', '2005-07-09T08:31:03', '2005-07-10T08:18:03', '2'), - ('30', '3884', '2006-02-16T02:30:53', '2005-06-17T02:39:20', '2005-06-24T04:41:20', '2'), - ('64', '1498', '2006-02-16T02:30:53', '2005-05-31T00:46:31', '2005-06-06T06:14:31', '2'), - ('566', '1187', '2006-02-16T02:30:53', '2005-06-16T08:26:56', '2005-06-25T06:17:56', '2'), - ('521', '1570', '2006-02-16T02:30:53', '2005-06-16T17:49:57', '2005-06-17T21:03:57', '2'), - ('472', '4281', '2006-02-16T02:30:53', '2005-07-11T07:44:46', '2005-07-20T04:41:46', '2'), - ('11', '3374', '2006-02-16T02:30:53', '2005-07-11T09:09:59', '2005-07-20T11:42:59', '2'), - ('482', '3948', '2006-02-16T02:30:53', '2005-08-01T23:00:22', '2005-08-04T04:14:22', '2'), - ('214', '3838', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('597', '2613', '2006-02-16T02:30:53', '2005-05-25T04:19:28', '2005-05-29T00:10:28', '2'), - ('102', '833', '2006-02-16T02:30:53', '2005-08-02T11:00:32', '2005-08-04T08:59:32', '2'), - ('537', '4324', '2006-02-16T02:30:53', '2005-08-21T19:54:11', '2005-08-27T21:42:11', '2'), - ('243', '4339', '2006-02-16T02:30:53', '2005-08-21T00:52:45', '2005-08-21T19:35:45', '2'), - ('364', '1747', '2006-02-16T02:30:53', '2005-08-19T04:24:35', '2005-08-27T07:13:35', '2'), - ('1', '2785', '2006-02-16T02:30:53', '2005-06-15T00:54:12', '2005-06-23T02:42:12', '2'), - ('76', '2483', '2006-02-16T02:30:53', '2005-07-30T16:59:17', '2005-08-03T17:24:17', '2'), - ('389', '2335', '2006-02-16T02:30:53', '2005-06-17T07:58:39', '2005-06-25T06:49:39', '2'), - ('62', '4508', '2006-02-16T02:30:53', '2005-08-20T02:27:13', '2005-08-28T04:40:13', '2'), - ('494', '4426', '2006-02-16T02:30:53', '2005-08-01T15:22:38', '2005-08-03T11:03:38', '2'), - ('565', '1598', '2006-02-16T02:30:53', '2005-08-01T20:59:58', '2005-08-10T20:33:58', '2'), - ('469', '4341', '2006-02-16T02:30:53', '2005-08-18T17:55:38', '2005-08-23T17:19:38', '2'), - ('322', '1075', '2006-02-16T02:30:53', '2005-07-28T20:21:54', '2005-07-31T18:39:54', '2'), - ('369', '1572', '2006-02-16T02:30:53', '2005-06-15T03:44:25', '2005-06-17T03:49:25', '2'), - ('358', '48', '2006-02-16T02:30:53', '2005-08-01T10:17:47', '2005-08-02T15:04:47', '2'), - ('78', '2304', '2006-02-16T02:30:53', '2005-08-02T03:16:31', '2005-08-11T02:46:31', '2'), - ('410', '538', '2006-02-16T02:30:53', '2005-08-22T23:02:15', '2005-09-01T01:14:15', '2'), - ('45', '1577', '2006-02-16T02:30:53', '2005-07-27T00:15:35', '2005-08-05T03:04:35', '2'), - ('498', '3567', '2006-02-16T02:30:53', '2005-07-27T14:23:55', '2005-07-28T14:11:55', '2'), - ('76', '1215', '2006-02-16T02:30:53', '2005-06-21T17:05:29', '2005-06-23T17:58:29', '2'), - ('29', '4572', '2006-02-16T02:30:53', '2005-06-19T19:18:09', '2005-06-20T20:11:09', '2'), - ('78', '3479', '2006-02-16T02:30:53', '2005-08-22T02:51:41', '2005-08-28T06:30:41', '2'), - ('67', '61', '2006-02-16T02:30:53', '2005-07-29T11:32:58', '2005-08-05T07:21:58', '2'), - ('149', '3627', '2006-02-16T02:30:53', '2005-07-06T21:16:32', '2005-07-11T03:12:32', '2'), - ('190', '2457', '2006-02-16T02:30:53', '2005-08-21T02:59:31', '2005-08-24T23:19:31', '2'), - ('336', '4290', '2006-02-16T02:30:53', '2005-07-29T13:18:00', '2005-07-30T18:51:00', '2'), - ('156', '597', '2006-02-16T02:30:53', '2005-08-20T03:12:43', '2005-08-23T09:01:43', '2'), - ('478', '1648', '2006-02-16T02:30:53', '2005-07-10T16:57:50', '2005-07-18T14:07:50', '2'), - ('472', '2322', '2006-02-16T02:30:53', '2005-06-20T08:00:24', '2005-06-25T05:10:24', '2'), - ('303', '2429', '2006-02-16T02:30:53', '2005-08-01T00:56:47', '2005-08-03T19:58:47', '2'), - ('353', '3542', '2006-02-16T02:30:53', '2005-06-21T02:39:31', '2005-06-28T05:23:31', '2'), - ('167', '2034', '2006-02-16T02:30:53', '2005-07-28T18:28:07', '2005-07-30T19:17:07', '2'), - ('201', '637', '2006-02-16T02:30:53', '2005-07-28T00:02:15', '2005-07-29T03:14:15', '2'), - ('165', '2287', '2006-02-16T02:30:53', '2005-07-06T13:57:56', '2005-07-14T17:24:56', '2'), - ('493', '4223', '2006-02-16T02:30:53', '2005-08-02T00:51:37', '2005-08-09T20:49:37', '2'), - ('150', '1119', '2006-02-16T02:30:53', '2005-06-21T21:19:47', '2005-06-28T18:18:47', '2'), - ('579', '2127', '2006-02-16T02:30:53', '2005-07-08T08:01:09', '2005-07-16T05:52:09', '2'), - ('276', '2447', '2006-02-16T02:30:53', '2005-07-28T09:10:06', '2005-08-04T06:52:06', '2'), - ('281', '2261', '2006-02-16T02:30:53', '2005-07-09T20:21:10', '2005-07-18T21:43:10', '2'), - ('278', '1032', '2006-02-16T02:30:53', '2005-08-01T16:11:40', '2005-08-06T14:09:40', '2'), - ('66', '2847', '2006-02-16T02:30:53', '2005-08-21T04:37:56', '2005-08-26T03:55:56', '2'), - ('594', '1145', '2006-02-16T02:30:53', '2005-06-18T06:33:48', '2005-06-25T00:50:48', '2'), - ('532', '2226', '2006-02-16T02:30:53', '2005-08-19T08:55:16', '2005-08-25T12:23:16', '2'), - ('483', '1708', '2006-02-16T02:30:53', '2005-08-19T03:10:21', '2005-08-26T01:00:21', '2'), - ('18', '238', '2006-02-16T02:30:53', '2005-08-20T01:29:29', '2005-08-21T22:36:29', '2'), - ('207', '3381', '2006-02-16T02:30:53', '2005-07-12T04:46:30', '2005-07-19T03:04:30', '2'), - ('399', '380', '2006-02-16T02:30:53', '2005-08-19T18:35:52', '2005-08-23T17:18:52', '2'), - ('207', '3125', '2006-02-16T02:30:53', '2005-07-09T13:56:56', '2005-07-11T16:01:56', '2'), - ('260', '4520', '2006-02-16T02:30:53', '2005-08-20T18:28:28', '2005-08-22T16:49:28', '2'), - ('64', '1788', '2006-02-16T02:30:53', '2005-07-27T03:27:35', '2005-08-01T06:31:35', '2'), - ('121', '3052', '2006-02-16T02:30:53', '2005-08-01T09:17:34', '2005-08-06T07:28:34', '2'), - ('316', '242', '2006-02-16T02:30:53', '2005-07-09T06:25:48', '2005-07-16T11:32:48', '2'), - ('158', '151', '2006-02-16T02:30:53', '2005-07-11T00:55:38', '2005-07-13T21:36:38', '2'), - ('509', '824', '2006-02-16T02:30:53', '2005-07-09T01:31:42', '2005-07-11T22:34:42', '2'), - ('512', '156', '2006-02-16T02:30:53', '2005-08-01T17:07:16', '2005-08-10T11:46:16', '2'), - ('502', '3928', '2006-02-16T02:30:53', '2005-06-16T12:50:01', '2005-06-24T12:08:01', '2'), - ('584', '844', '2006-02-16T02:30:53', '2005-08-21T04:57:29', '2005-08-27T08:14:29', '2'), - ('519', '2509', '2006-02-16T02:30:53', '2005-07-30T20:54:55', '2005-08-04T00:54:55', '2'), - ('379', '3999', '2006-02-16T02:30:53', '2005-05-30T03:14:59', '2005-06-05T04:34:59', '2'), - ('595', '2918', '2006-02-16T02:30:53', '2005-08-01T19:21:11', '2005-08-07T21:20:11', '2'), - ('476', '2494', '2006-02-16T02:30:53', '2005-08-22T23:38:01', '2005-08-23T19:27:01', '2'), - ('378', '4543', '2006-02-16T02:30:53', '2005-07-10T04:00:31', '2005-07-16T08:06:31', '2'), - ('596', '4247', '2006-02-16T02:30:53', '2005-08-01T20:17:03', '2005-08-08T18:31:03', '2'), - ('410', '2217', '2006-02-16T02:30:53', '2005-08-02T08:19:38', '2005-08-07T08:46:38', '2'), - ('550', '4342', '2006-02-16T02:30:53', '2005-08-19T11:27:32', '2005-08-28T11:21:32', '2'), - ('111', '3688', '2006-02-16T02:30:53', '2005-06-21T10:01:36', '2005-06-25T10:27:36', '2'), - ('587', '4156', '2006-02-16T02:30:53', '2005-06-18T10:22:52', '2005-06-20T12:03:52', '2'), - ('158', '4254', '2006-02-16T02:30:53', '2005-08-02T07:26:43', '2005-08-09T10:34:43', '2'), - ('37', '3961', '2006-02-16T02:30:53', '2005-05-25T03:21:20', '2005-05-27T21:25:20', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['15135', '2984', '15180', '7991', '5911', '7100', '9383', '3833', '1473', '4620', '9387', '7084', '14636', '2971', '15427', '9054', '5208', '609', '10751', '12611', '15069', '3592', '5670', '9203', '5915', '6455', '737', '4153', '67', '7106', '6085', '12413', '8040', '2993', '9678', '5607', '10336', '6379', '13322', '13526', '9064', '12367', '14131', '15384', '8179', '5394', '4820', '5039', '3516', '6832', '1269', '4751', '11498', '7149', '119', '12284', '1504', '8042', '5573', '53', '6798', '13084', '6487', '608', '4562', '8725', '7564', '5337', '2229', '5966', '543', '14190', '6255', '4342', '2661', '14060', '14013', '10018', '5350', '10065', '10475', '1181', '10107', '633', '6427', '5531', '4289', '6500', '9969', '7964', '435', '692', '11598', '10169', '2511', '11935', '5521', '1645', '8743', '2296']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('284', '555', '2006-02-16T02:30:53', '2005-08-22T13:19:19', '2005-08-27T17:09:19', '2'), - ('435', '1819', '2006-02-16T02:30:53', '2005-06-20T08:43:44', '2005-06-22T03:08:44', '2'), - ('532', '234', '2006-02-16T02:30:53', '2005-08-22T15:42:57', '2005-08-24T12:49:57', '2'), - ('59', '1133', '2006-02-16T02:30:53', '2005-07-28T14:45:45', '2005-07-29T15:05:45', '2'), - ('420', '4140', '2006-02-16T02:30:53', '2005-07-10T20:51:42', '2005-07-14T21:58:42', '2'), - ('413', '4224', '2006-02-16T02:30:53', '2005-07-27T05:05:01', '2005-07-28T23:12:01', '2'), - ('416', '2806', '2006-02-16T02:30:53', '2005-07-30T19:24:50', '2005-08-01T21:41:50', '2'), - ('416', '3232', '2006-02-16T02:30:53', '2005-07-06T16:18:28', '2005-07-14T20:09:28', '2'), - ('249', '2377', '2006-02-16T02:30:53', '2005-06-15T20:55:20', '2005-06-21T16:40:20', '2'), - ('210', '3467', '2006-02-16T02:30:53', '2005-07-08T08:01:44', '2005-07-16T07:43:44', '2'), - ('495', '577', '2006-02-16T02:30:53', '2005-07-30T19:27:05', '2005-08-07T21:19:05', '2'), - ('32', '785', '2006-02-16T02:30:53', '2005-07-27T04:34:07', '2005-08-05T00:21:07', '2'), - ('339', '1671', '2006-02-16T02:30:53', '2005-08-21T18:59:17', '2005-08-23T13:19:17', '2'), - ('410', '1585', '2006-02-16T02:30:53', '2005-06-20T07:56:00', '2005-06-27T11:38:00', '2'), - ('448', '2775', '2006-02-16T02:30:53', '2005-08-23T00:07:53', '2005-09-01T02:55:53', '2'), - ('209', '2860', '2006-02-16T02:30:53', '2005-07-30T07:11:44', '2005-08-08T01:55:44', '2'), - ('560', '1881', '2006-02-16T02:30:53', '2005-07-09T11:16:56', '2005-07-10T07:21:56', '2'), - ('150', '2944', '2006-02-16T02:30:53', '2005-05-28T15:04:02', '2005-06-05T14:47:02', '2'), - ('518', '3257', '2006-02-16T02:30:53', '2005-08-01T20:06:10', '2005-08-10T22:36:10', '2'), - ('359', '1925', '2006-02-16T02:30:53', '2005-08-18T17:09:42', '2005-08-24T11:57:42', '2'), - ('568', '592', '2006-02-16T02:30:53', '2005-08-22T10:55:42', '2005-08-28T06:59:42', '2'), - ('286', '1272', '2006-02-16T02:30:53', '2005-07-06T04:38:50', '2005-07-15T06:36:50', '2'), - ('121', '610', '2006-02-16T02:30:53', '2005-07-10T08:14:52', '2005-07-14T04:13:52', '2'), - ('169', '2112', '2006-02-16T02:30:53', '2005-07-30T12:43:40', '2005-08-01T09:31:40', '2'), - ('66', '2464', '2006-02-16T02:30:53', '2005-07-10T21:12:16', '2005-07-15T16:59:16', '2'), - ('277', '4267', '2006-02-16T02:30:53', '2005-07-12T01:01:58', '2005-07-16T02:42:58', '2'), - ('589', '769', '2006-02-16T02:30:53', '2005-05-29T08:11:31', '2005-06-04T11:18:31', '2'), - ('299', '2185', '2006-02-16T02:30:53', '2005-07-07T08:53:08', '2005-07-11T05:09:08', '2'), - ('119', '239', '2006-02-16T02:30:53', '2005-05-25T09:41:01', '2005-05-27T13:46:01', '2'), - ('201', '1415', '2006-02-16T02:30:53', '2005-07-27T05:21:24', '2005-08-02T01:58:24', '2'), - ('155', '312', '2006-02-16T02:30:53', '2005-07-11T05:24:36', '2005-07-16T03:49:36', '2'), - ('366', '3466', '2006-02-16T02:30:53', '2005-08-18T09:50:34', '2005-08-23T05:57:34', '2'), - ('163', '4543', '2006-02-16T02:30:53', '2005-07-28T16:39:43', '2005-08-02T20:00:43', '2'), - ('40', '1527', '2006-02-16T02:30:53', '2005-06-20T09:12:12', '2005-06-22T13:36:12', '2'), - ('383', '3430', '2006-02-16T02:30:53', '2005-07-31T06:40:47', '2005-08-02T00:57:47', '2'), - ('52', '4257', '2006-02-16T02:30:53', '2005-07-10T05:08:10', '2005-07-15T00:40:10', '2'), - ('370', '1091', '2006-02-16T02:30:53', '2005-08-01T04:59:53', '2005-08-03T08:05:53', '2'), - ('287', '522', '2006-02-16T02:30:53', '2005-07-11T21:51:25', '2005-07-17T03:38:25', '2'), - ('559', '2149', '2006-02-16T02:30:53', '2005-08-19T19:43:08', '2005-08-24T16:30:08', '2'), - ('277', '1966', '2006-02-16T02:30:53', '2005-08-20T02:58:42', '2005-08-27T22:36:42', '2'), - ('194', '1417', '2006-02-16T02:30:53', '2005-07-30T07:24:55', '2005-08-07T08:44:55', '2'), - ('7', '1822', '2006-02-16T02:30:53', '2005-08-18T07:57:14', '2005-08-27T07:07:14', '2'), - ('267', '4382', '2006-02-16T02:30:53', '2005-08-21T01:43:40', '2005-08-29T02:00:40', '2'), - ('26', '3208', '2006-02-16T02:30:53', '2005-08-22T22:34:44', '2005-08-23T23:25:44', '2'), - ('578', '2902', '2006-02-16T02:30:53', '2005-07-28T22:05:13', '2005-07-30T21:57:13', '2'), - ('83', '1828', '2006-02-16T02:30:53', '2005-07-09T19:36:15', '2005-07-18T18:10:15', '2'), - ('172', '2672', '2006-02-16T02:30:53', '2005-07-08T17:25:23', '2005-07-17T20:32:23', '2'), - ('268', '2020', '2006-02-16T02:30:53', '2005-07-09T03:14:45', '2005-07-16T06:57:45', '2'), - ('338', '385', '2006-02-16T02:30:53', '2005-07-06T00:50:30', '2005-07-09T19:12:30', '2'), - ('220', '444', '2006-02-16T02:30:53', '2005-07-12T18:51:41', '2005-07-20T13:29:41', '2'), - ('59', '108', '2006-02-16T02:30:53', '2005-06-15T07:29:59', '2005-06-16T13:26:59', '2'), - ('436', '3469', '2006-02-16T02:30:53', '2005-07-08T14:07:52', '2005-07-13T10:37:52', '2'), - ('482', '487', '2006-02-16T02:30:53', '2005-08-16T22:52:54', '2005-08-25T03:27:54', '2'), - ('242', '3902', '2006-02-16T02:30:53', '2005-07-27T07:10:40', '2005-08-03T07:37:40', '2'), - ('51', '1359', '2006-02-16T02:30:53', '2005-05-25T19:37:02', '2005-05-29T23:51:02', '2'), - ('147', '3162', '2006-02-16T02:30:53', '2005-08-18T04:55:49', '2005-08-22T08:45:49', '2'), - ('423', '3621', '2006-02-16T02:30:53', '2005-06-15T22:08:06', '2005-06-24T01:16:06', '2'), - ('14', '4325', '2006-02-16T02:30:53', '2005-07-28T16:45:11', '2005-08-04T17:16:11', '2'), - ('170', '2957', '2006-02-16T02:30:53', '2005-07-10T03:50:47', '2005-07-17T06:40:47', '2'), - ('569', '1255', '2006-02-16T02:30:53', '2005-05-25T07:19:16', '2005-05-27T05:19:16', '2'), - ('115', '275', '2006-02-16T02:30:53', '2005-07-12T16:49:11', '2005-07-19T12:11:11', '2'), - ('204', '3792', '2006-02-16T02:30:53', '2005-08-19T10:27:25', '2005-08-26T07:32:25', '2'), - ('277', '4000', '2006-02-16T02:30:53', '2005-07-12T02:17:00', '2005-07-19T00:57:00', '2'), - ('494', '4254', '2006-02-16T02:30:53', '2005-05-28T15:03:44', '2005-06-04T17:14:44', '2'), - ('454', '963', '2006-02-16T02:30:53', '2005-07-08T05:08:32', '2005-07-12T08:16:32', '2'), - ('421', '2385', '2006-02-16T02:30:53', '2005-07-29T18:08:42', '2005-08-04T16:01:42', '2'), - ('291', '2887', '2006-02-16T02:30:53', '2005-07-27T22:31:17', '2005-08-01T01:05:17', '2'), - ('343', '4168', '2006-02-16T02:30:53', '2005-07-09T17:03:50', '2005-07-16T22:25:50', '2'), - ('35', '2840', '2006-02-16T02:30:53', '2005-06-18T03:50:18', '2005-06-26T07:16:18', '2'), - ('384', '2076', '2006-02-16T02:30:53', '2005-07-10T23:59:27', '2005-07-14T23:38:27', '2'), - ('493', '530', '2006-02-16T02:30:53', '2005-05-28T06:43:34', '2005-06-06T07:16:34', '2'), - ('517', '4203', '2006-02-16T02:30:53', '2005-08-21T03:35:21', '2005-08-29T07:35:21', '2'), - ('319', '1459', '2006-02-16T02:30:53', '2005-07-11T15:11:33', '2005-07-15T19:55:33', '2'), - ('120', '1355', '2006-02-16T02:30:53', '2005-07-07T18:47:03', '2005-07-09T21:59:03', '2'), - ('452', '3652', '2006-02-16T02:30:53', '2005-06-19T10:50:52', '2005-06-25T08:44:52', '2'), - ('175', '3100', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('496', '3941', '2006-02-16T02:30:53', '2005-08-20T20:42:50', '2005-08-25T21:37:50', '2'), - ('481', '3708', '2006-02-16T02:30:53', '2005-07-31T18:15:14', '2005-08-05T14:44:14', '2'), - ('129', '724', '2006-02-16T02:30:53', '2005-07-09T17:39:30', '2005-07-11T16:43:30', '2'), - ('495', '1426', '2006-02-16T02:30:53', '2005-07-31T19:27:34', '2005-08-01T13:45:34', '2'), - ('115', '2931', '2006-02-16T02:30:53', '2005-08-01T10:03:17', '2005-08-10T15:50:17', '2'), - ('546', '2973', '2006-02-16T02:30:53', '2005-06-15T00:42:17', '2005-06-19T03:36:17', '2'), - ('414', '1326', '2006-02-16T02:30:53', '2005-07-31T21:01:46', '2005-08-09T01:33:46', '2'), - ('360', '58', '2006-02-16T02:30:53', '2005-05-28T17:37:59', '2005-06-03T22:49:59', '2'), - ('122', '1043', '2006-02-16T02:30:53', '2005-07-11T23:57:34', '2005-07-14T18:05:34', '2'), - ('173', '2992', '2006-02-16T02:30:53', '2005-07-10T02:13:59', '2005-07-15T00:01:59', '2'), - ('231', '3172', '2006-02-16T02:30:53', '2005-07-07T15:45:58', '2005-07-09T11:11:58', '2'), - ('577', '4521', '2006-02-16T02:30:53', '2005-07-12T03:11:23', '2005-07-13T00:51:23', '2'), - ('151', '938', '2006-02-16T02:30:53', '2005-07-31T16:38:12', '2005-08-05T11:45:12', '2'), - ('574', '2528', '2006-02-16T02:30:53', '2005-07-28T13:49:58', '2005-08-03T10:03:58', '2'), - ('3', '3328', '2006-02-16T02:30:53', '2005-05-27T17:17:09', '2005-06-02T11:20:09', '2'), - ('18', '800', '2006-02-16T02:30:53', '2005-05-29T01:32:10', '2005-06-02T03:54:10', '2'), - ('319', '1949', '2006-02-16T02:30:53', '2005-08-17T03:03:07', '2005-08-22T21:05:07', '2'), - ('57', '2675', '2006-02-16T02:30:53', '2005-07-31T23:27:13', '2005-08-05T20:32:13', '2'), - ('234', '1824', '2006-02-16T02:30:53', '2005-06-18T23:45:30', '2005-06-24T01:21:30', '2'), - ('66', '1640', '2006-02-16T02:30:53', '2005-08-17T16:42:13', '2005-08-22T20:38:13', '2'), - ('182', '1956', '2006-02-16T02:30:53', '2005-07-10T01:31:22', '2005-07-17T05:42:22', '2'), - ('234', '4434', '2006-02-16T02:30:53', '2005-06-16T09:10:06', '2005-06-23T04:36:06', '2'), - ('282', '2664', '2006-02-16T02:30:53', '2005-07-29T18:57:01', '2005-07-31T22:09:01', '2'), - ('481', '4558', '2006-02-16T02:30:53', '2005-06-18T08:10:42', '2005-06-20T12:26:42', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['1013', '10900', '12993', '899', '9981', '13164', '298', '8098', '4592', '13005', '4447', '14967', '9360', '9188', '13426', '10619', '8559', '13296', '3385', '9393', '13552', '13347', '7764', '7697', '11326', '5633', '12198', '12634', '7470', '6575', '10257', '392', '4433', '3600', '4461', '9547', '12903', '1174', '14813', '4058', '8335', '9761', '3444', '13040', '15754', '10286', '3741', '13965', '10880', '10585', '6547', '7807', '13802', '10898', '14353', '9838', '10166', '5796', '9476', '14488', '8065', '14803', '5846', '2547', '7000', '1508', '13524', '6406', '2196', '13647', '8395', '14451', '12995', '13782', '3707', '12510', '530', '3746', '3526', '13724', '1674', '2887', '14094', '10103', '6251', '13978', '10910', '14546', '12797', '12562', '8704', '11337', '14192', '10258', '8760', '13866', '3904', '10303', '11279', '2426']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('384', '4522', '2006-02-16T02:30:53', '2005-05-31T02:37:00', '2005-06-02T06:39:00', '2'), - ('139', '1749', '2006-02-16T02:30:53', '2005-08-02T01:34:26', '2005-08-07T00:52:26', '2'), - ('484', '4225', '2006-02-16T02:30:53', '2005-08-19T07:24:03', '2005-08-26T07:15:03', '2'), - ('156', '1096', '2006-02-16T02:30:53', '2005-05-30T09:29:30', '2005-06-06T12:39:30', '2'), - ('321', '1354', '2006-02-16T02:30:53', '2005-07-31T17:08:31', '2005-08-01T22:46:31', '2'), - ('145', '1104', '2006-02-16T02:30:53', '2005-08-19T13:30:55', '2005-08-26T10:12:55', '2'), - ('460', '1083', '2006-02-16T02:30:53', '2005-05-26T20:52:26', '2005-05-29T22:08:26', '2'), - ('41', '1757', '2006-02-16T02:30:53', '2005-07-28T18:34:20', '2005-07-31T19:07:20', '2'), - ('235', '2141', '2006-02-16T02:30:53', '2005-07-08T06:31:28', '2005-07-10T06:08:28', '2'), - ('104', '3417', '2006-02-16T02:30:53', '2005-08-19T07:45:42', '2005-08-20T12:45:42', '2'), - ('549', '404', '2006-02-16T02:30:53', '2005-07-07T23:15:28', '2005-07-14T22:53:28', '2'), - ('67', '289', '2006-02-16T02:30:53', '2005-08-22T06:46:03', '2005-08-23T01:02:03', '2'), - ('186', '2119', '2006-02-16T02:30:53', '2005-07-30T18:39:43', '2005-08-04T22:41:43', '2'), - ('195', '727', '2006-02-16T02:30:53', '2005-07-30T12:19:54', '2005-08-06T09:12:54', '2'), - ('213', '3409', '2006-02-16T02:30:53', '2005-08-19T23:15:00', '2005-08-21T01:53:00', '2'), - ('132', '2189', '2006-02-16T02:30:53', '2005-08-01T15:07:04', '2005-08-07T11:42:04', '2'), - ('279', '2078', '2006-02-16T02:30:53', '2005-07-29T11:25:54', '2005-08-04T10:16:54', '2'), - ('300', '1728', '2006-02-16T02:30:53', '2005-08-19T18:43:53', '2005-08-21T23:30:53', '2'), - ('514', '2810', '2006-02-16T02:30:53', '2005-06-21T14:16:48', '2005-06-24T10:32:48', '2'), - ('158', '843', '2006-02-16T02:30:53', '2005-07-30T20:04:48', '2005-08-02T15:52:48', '2'), - ('578', '758', '2006-02-16T02:30:53', '2005-08-20T04:03:51', '2005-08-23T02:48:51', '2'), - ('562', '4038', '2006-02-16T02:30:53', '2005-08-19T20:28:48', '2005-08-28T19:33:48', '2'), - ('142', '3537', '2006-02-16T02:30:53', '2005-07-28T06:40:05', '2005-07-30T02:51:05', '2'), - ('377', '3966', '2006-02-16T02:30:53', '2005-07-28T03:43:45', '2005-08-03T07:55:45', '2'), - ('530', '1762', '2006-02-16T02:30:53', '2005-08-02T16:34:29', '2005-08-03T17:40:29', '2'), - ('480', '1056', '2006-02-16T02:30:53', '2005-07-10T06:22:24', '2005-07-11T05:59:24', '2'), - ('86', '1628', '2006-02-16T02:30:53', '2005-08-18T02:09:20', '2005-08-21T21:28:20', '2'), - ('549', '1037', '2006-02-16T02:30:53', '2005-08-18T17:58:14', '2005-08-19T21:08:14', '2'), - ('564', '289', '2006-02-16T02:30:53', '2005-07-27T19:01:03', '2005-08-05T19:16:03', '2'), - ('598', '1414', '2006-02-16T02:30:53', '2005-07-12T06:12:53', '2005-07-18T07:55:53', '2'), - ('543', '2403', '2006-02-16T02:30:53', '2005-08-01T02:49:43', '2005-08-04T04:45:43', '2'), - ('359', '263', '2006-02-16T02:30:53', '2005-05-27T11:14:42', '2005-06-01T14:28:42', '2'), - ('449', '88', '2006-02-16T02:30:53', '2005-07-07T22:45:41', '2005-07-16T23:30:41', '2'), - ('511', '2748', '2006-02-16T02:30:53', '2005-07-06T05:19:42', '2005-07-11T00:34:42', '2'), - ('286', '3656', '2006-02-16T02:30:53', '2005-07-07T23:59:43', '2005-07-16T19:44:43', '2'), - ('440', '2414', '2006-02-16T02:30:53', '2005-07-31T01:52:34', '2005-08-03T23:12:34', '2'), - ('302', '2340', '2006-02-16T02:30:53', '2005-08-19T04:09:38', '2005-08-26T03:24:38', '2'), - ('95', '2653', '2006-02-16T02:30:53', '2005-06-15T00:12:51', '2005-06-21T02:10:51', '2'), - ('142', '3364', '2006-02-16T02:30:53', '2005-08-22T01:11:37', '2005-08-24T05:57:37', '2'), - ('442', '3877', '2006-02-16T02:30:53', '2005-07-07T04:02:50', '2005-07-10T04:30:50', '2'), - ('143', '1719', '2006-02-16T02:30:53', '2005-07-29T04:18:25', '2005-07-31T08:12:25', '2'), - ('60', '3778', '2006-02-16T02:30:53', '2005-07-31T09:31:54', '2005-08-03T11:02:54', '2'), - ('45', '493', '2006-02-16T02:30:53', '2005-06-21T20:39:39', '2005-06-25T23:44:39', '2'), - ('425', '4113', '2006-02-16T02:30:53', '2005-08-19T09:04:24', '2005-08-23T12:36:24', '2'), - ('356', '2306', '2006-02-16T02:30:53', '2005-08-23T12:43:42', '2005-08-27T17:45:42', '2'), - ('532', '498', '2006-02-16T02:30:53', '2005-08-01T03:35:58', '2005-08-10T05:17:58', '2'), - ('584', '1449', '2006-02-16T02:30:53', '2005-07-06T12:00:18', '2005-07-12T09:02:18', '2'), - ('324', '670', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('528', '450', '2006-02-16T02:30:53', '2005-08-02T00:34:12', '2005-08-06T21:15:12', '2'), - ('228', '2670', '2006-02-16T02:30:53', '2005-08-01T14:00:42', '2005-08-09T11:42:42', '2'), - ('262', '2656', '2006-02-16T02:30:53', '2005-07-12T04:57:46', '2005-07-18T08:36:46', '2'), - ('504', '2204', '2006-02-16T02:30:53', '2005-07-28T07:58:27', '2005-08-01T02:48:27', '2'), - ('156', '2079', '2006-02-16T02:30:53', '2005-08-20T12:44:53', '2005-08-22T09:18:53', '2'), - ('23', '3814', '2006-02-16T02:30:53', '2005-08-02T01:29:57', '2005-08-06T00:07:57', '2'), - ('129', '1612', '2006-02-16T02:30:53', '2005-08-21T09:07:50', '2005-08-22T10:31:50', '2'), - ('208', '3866', '2006-02-16T02:30:53', '2005-07-31T12:18:49', '2005-08-03T16:49:49', '2'), - ('484', '4304', '2006-02-16T02:30:53', '2005-07-31T23:22:20', '2005-08-07T18:06:20', '2'), - ('286', '1631', '2006-02-16T02:30:53', '2005-07-10T14:42:54', '2005-07-17T08:47:54', '2'), - ('197', '3599', '2006-02-16T02:30:53', '2005-07-30T23:06:40', '2005-08-04T22:52:40', '2'), - ('75', '4202', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('220', '413', '2006-02-16T02:30:53', '2005-07-28T17:15:48', '2005-08-04T15:49:48', '2'), - ('278', '2525', '2006-02-16T02:30:53', '2005-08-22T00:49:10', '2005-08-22T23:44:10', '2'), - ('233', '938', '2006-02-16T02:30:53', '2005-07-10T17:25:24', '2005-07-12T13:41:24', '2'), - ('162', '4560', '2006-02-16T02:30:53', '2005-06-19T02:44:17', '2005-06-24T08:01:17', '2'), - ('31', '2024', '2006-02-16T02:30:53', '2005-07-27T01:23:24', '2005-08-03T02:10:24', '2'), - ('511', '1141', '2006-02-16T02:30:53', '2005-06-15T22:33:24', '2005-06-18T02:27:24', '2'), - ('593', '4557', '2006-02-16T02:30:53', '2005-08-20T02:48:43', '2005-08-27T03:14:43', '2'), - ('392', '4439', '2006-02-16T02:30:53', '2005-07-11T22:55:27', '2005-07-20T04:50:27', '2'), - ('240', '1925', '2006-02-16T02:30:53', '2005-06-18T01:47:07', '2005-06-26T03:18:07', '2'), - ('519', '3269', '2006-02-16T02:30:53', '2005-08-20T07:48:07', '2005-08-28T07:56:07', '2'), - ('535', '1471', '2006-02-16T02:30:53', '2005-07-29T06:03:30', '2005-07-31T09:08:30', '2'), - ('467', '3967', '2006-02-16T02:30:53', '2005-08-21T12:21:44', '2005-08-22T15:07:44', '2'), - ('566', '2069', '2006-02-16T02:30:53', '2005-08-19T07:26:30', '2005-08-25T12:47:30', '2'), - ('305', '577', '2006-02-16T02:30:53', '2005-08-20T12:09:26', '2005-08-23T08:31:26', '2'), - ('14', '1080', '2006-02-16T02:30:53', '2005-07-06T10:21:49', '2005-07-12T05:14:49', '2'), - ('394', '3051', '2006-02-16T02:30:53', '2005-08-18T13:22:25', '2005-08-27T17:38:25', '2'), - ('312', '3332', '2006-02-16T02:30:53', '2005-05-28T05:13:01', '2005-06-01T10:21:01', '2'), - ('424', '3387', '2006-02-16T02:30:53', '2005-07-06T12:10:51', '2005-07-07T11:36:51', '2'), - ('469', '3871', '2006-02-16T02:30:53', '2005-07-06T01:03:29', '2005-07-15T01:22:29', '2'), - ('80', '200', '2006-02-16T02:30:53', '2005-08-20T10:07:28', '2005-08-24T07:47:28', '2'), - ('234', '3606', '2006-02-16T02:30:53', '2005-06-16T10:57:00', '2005-06-18T07:31:00', '2'), - ('453', '1073', '2006-02-16T02:30:53', '2005-06-20T01:39:43', '2005-06-25T05:22:43', '2'), - ('471', '3674', '2006-02-16T02:30:53', '2005-08-21T00:21:35', '2005-08-23T05:27:35', '2'), - ('25', '77', '2006-02-16T02:30:53', '2005-07-31T20:49:13', '2005-08-05T15:55:13', '2'), - ('230', '3956', '2006-02-16T02:30:53', '2005-07-11T15:06:20', '2005-07-18T20:11:20', '2'), - ('260', '1263', '2006-02-16T02:30:53', '2005-08-20T19:03:25', '2005-08-27T18:02:25', '2'), - ('266', '2428', '2006-02-16T02:30:53', '2005-08-02T01:54:34', '2005-08-10T04:04:34', '2'), - ('466', '1515', '2006-02-16T02:30:53', '2005-08-21T15:50:50', '2005-08-23T11:37:50', '2'), - ('5', '1595', '2006-02-16T02:30:53', '2005-08-19T00:24:08', '2005-08-21T22:53:08', '2'), - ('212', '529', '2006-02-16T02:30:53', '2005-08-18T15:00:03', '2005-08-23T12:55:03', '2'), - ('107', '2117', '2006-02-16T02:30:53', '2005-07-29T17:13:45', '2005-08-03T20:03:45', '2'), - ('366', '3428', '2006-02-16T02:30:53', '2005-08-02T16:59:09', '2005-08-10T20:41:09', '2'), - ('26', '3563', '2006-02-16T02:30:53', '2005-08-21T03:37:42', '2005-08-28T05:31:42', '2'), - ('469', '2062', '2006-02-16T02:30:53', '2005-08-01T02:51:09', '2005-08-08T23:57:09', '2'), - ('118', '3566', '2006-02-16T02:30:53', '2005-07-29T19:22:40', '2005-08-05T01:09:40', '2'), - ('343', '3432', '2006-02-16T02:30:53', '2005-08-20T15:05:29', '2005-08-23T11:27:29', '2'), - ('485', '3600', '2006-02-16T02:30:53', '2005-07-06T19:30:57', '2005-07-11T18:47:57', '2'), - ('479', '936', '2006-02-16T02:30:53', '2005-08-01T04:13:33', '2005-08-06T02:16:33', '2'), - ('125', '151', '2006-02-16T02:30:53', '2005-08-02T14:30:03', '2005-08-10T09:49:03', '2'), - ('543', '474', '2006-02-16T02:30:53', '2005-06-18T17:40:44', '2005-06-22T14:30:44', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['15240', '9855', '515', '13475', '14535', '13906', '1290', '28', '12876', '12266', '8274', '1901', '5340', '6559', '4855', '13912', '7264', '6993', '14507', '2762', '10368', '8878', '4417', '7048', '6614', '4043', '7354', '13283', '10849', '4116', '10167', '15178', '10338', '5667', '12655', '7407', '15675', '4406', '2207', '13165', '12158', '4631', '7225', '11599', '711', '7720', '13663', '13702', '9355', '11815', '4416', '2436', '6465', '2935', '6633', '9597', '10556', '8441', '5026', '13012', '8010', '9847', '11823', '15627', '2905', '12687', '13863', '339', '3104', '13409', '5852', '4250', '10313', '2524', '15918', '15251', '15530', '2399', '6984', '15843', '8318', '6556', '1945', '646', '8511', '11902', '3258', '15342', '448', '11743', '10682', '2365', '11701', '12489', '10635', '12925', '7651', '12016', '13621', '7843']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('11', '2014', '2006-02-16T02:30:53', '2005-08-22T17:46:41', '2005-08-23T15:08:41', '2'), - ('326', '1246', '2006-02-16T02:30:53', '2005-07-31T13:00:33', '2005-08-03T16:18:33', '2'), - ('110', '3369', '2006-02-16T02:30:53', '2005-05-28T03:10:10', '2005-06-04T02:18:10', '2'), - ('68', '3214', '2006-02-16T02:30:53', '2005-08-20T01:05:05', '2005-08-20T20:22:05', '2'), - ('412', '530', '2006-02-16T02:30:53', '2005-08-21T15:22:37', '2005-08-29T19:23:37', '2'), - ('87', '3960', '2006-02-16T02:30:53', '2005-08-20T16:16:03', '2005-08-21T13:29:03', '2'), - ('540', '1921', '2006-02-16T02:30:53', '2005-06-15T08:52:44', '2005-06-24T13:36:44', '2'), - ('232', '4068', '2006-02-16T02:30:53', '2005-05-25T03:42:37', '2005-05-26T09:26:37', '2'), - ('356', '803', '2006-02-16T02:30:53', '2005-08-19T03:12:19', '2005-08-20T02:24:19', '2'), - ('467', '2192', '2006-02-16T02:30:53', '2005-08-18T04:22:31', '2005-08-19T04:25:31', '2'), - ('340', '2634', '2006-02-16T02:30:53', '2005-07-29T01:34:32', '2005-08-01T20:15:32', '2'), - ('292', '2469', '2006-02-16T02:30:53', '2005-06-17T04:35:19', '2005-06-25T06:09:19', '2'), - ('267', '650', '2006-02-16T02:30:53', '2005-07-09T17:11:35', '2005-07-17T17:59:35', '2'), - ('353', '458', '2006-02-16T02:30:53', '2005-07-12T05:20:35', '2005-07-16T08:44:35', '2'), - ('337', '1146', '2006-02-16T02:30:53', '2005-07-08T18:45:50', '2005-07-11T18:23:50', '2'), - ('207', '968', '2006-02-16T02:30:53', '2005-08-20T16:32:10', '2005-08-29T17:37:10', '2'), - ('299', '2391', '2006-02-16T02:30:53', '2005-07-27T11:18:58', '2005-08-03T07:43:58', '2'), - ('154', '3114', '2006-02-16T02:30:53', '2005-07-27T01:05:24', '2005-07-30T06:23:24', '2'), - ('175', '1969', '2006-02-16T02:30:53', '2005-08-21T14:32:45', '2005-08-28T09:50:45', '2'), - ('457', '3431', '2006-02-16T02:30:53', '2005-06-19T17:22:31', '2005-06-25T22:43:31', '2'), - ('593', '3535', '2006-02-16T02:30:53', '2005-08-01T06:13:38', '2005-08-08T04:40:38', '2'), - ('25', '440', '2006-02-16T02:30:53', '2005-07-30T00:15:57', '2005-08-01T00:22:57', '2'), - ('452', '743', '2006-02-16T02:30:53', '2005-07-07T22:05:05', '2005-07-09T16:16:05', '2'), - ('581', '3707', '2006-02-16T02:30:53', '2005-07-27T03:31:48', '2005-08-05T07:30:48', '2'), - ('144', '3004', '2006-02-16T02:30:53', '2005-07-12T08:33:49', '2005-07-18T07:28:49', '2'), - ('204', '3427', '2006-02-16T02:30:53', '2005-07-07T03:09:50', '2005-07-10T07:49:50', '2'), - ('598', '2395', '2006-02-16T02:30:53', '2005-07-27T14:42:11', '2005-08-03T18:19:11', '2'), - ('180', '2602', '2006-02-16T02:30:53', '2005-08-19T18:10:19', '2005-08-23T16:09:19', '2'), - ('278', '1683', '2006-02-16T02:30:53', '2005-08-01T23:51:00', '2005-08-10T19:59:00', '2'), - ('352', '666', '2006-02-16T02:30:53', '2005-07-07T06:56:13', '2005-07-11T11:13:13', '2'), - ('129', '1222', '2006-02-16T02:30:53', '2005-07-31T23:24:31', '2005-08-06T17:42:31', '2'), - ('15', '1745', '2006-02-16T02:30:53', '2005-08-22T15:36:04', '2005-08-26T21:00:04', '2'), - ('339', '1295', '2006-02-16T02:30:53', '2005-08-01T05:03:03', '2005-08-09T05:13:03', '2'), - ('336', '683', '2006-02-16T02:30:53', '2005-07-10T08:11:03', '2005-07-15T08:23:03', '2'), - ('533', '859', '2006-02-16T02:30:53', '2005-08-18T18:57:44', '2005-08-27T22:40:44', '2'), - ('410', '3093', '2006-02-16T02:30:53', '2005-07-27T16:29:04', '2005-08-01T17:47:04', '2'), - ('293', '4153', '2006-02-16T02:30:53', '2005-08-23T09:18:52', '2005-08-30T14:59:52', '2'), - ('448', '438', '2006-02-16T02:30:53', '2005-07-07T21:35:16', '2005-07-15T16:13:16', '2'), - ('78', '182', '2006-02-16T02:30:53', '2005-06-18T02:19:21', '2005-06-24T02:25:21', '2'), - ('289', '138', '2006-02-16T02:30:53', '2005-08-19T13:34:10', '2005-08-21T18:33:10', '2'), - ('289', '4121', '2006-02-16T02:30:53', '2005-08-18T00:34:20', '2005-08-22T20:10:20', '2'), - ('59', '470', '2006-02-16T02:30:53', '2005-07-08T08:38:22', '2005-07-11T03:33:22', '2'), - ('306', '632', '2006-02-16T02:30:53', '2005-07-27T09:47:12', '2005-08-03T13:19:12', '2'), - ('112', '3749', '2006-02-16T02:30:53', '2005-08-17T03:08:10', '2005-08-25T05:01:10', '2'), - ('215', '4581', '2006-02-16T02:30:53', '2005-05-29T03:49:03', '2005-05-31T08:29:03', '2'), - ('520', '185', '2006-02-16T02:30:53', '2005-07-28T04:41:44', '2005-08-04T06:51:44', '2'), - ('240', '3969', '2006-02-16T02:30:53', '2005-08-20T08:12:33', '2005-08-27T03:23:33', '2'), - ('296', '700', '2006-02-16T02:30:53', '2005-08-20T09:27:20', '2005-08-29T15:04:20', '2'), - ('201', '1122', '2006-02-16T02:30:53', '2005-07-30T18:35:25', '2005-08-03T20:33:25', '2'), - ('192', '272', '2006-02-16T02:30:53', '2005-08-17T12:13:26', '2005-08-22T17:15:26', '2'), - ('290', '1247', '2006-02-16T02:30:53', '2005-07-07T22:04:36', '2005-07-09T02:44:36', '2'), - ('534', '3328', '2006-02-16T02:30:53', '2005-06-18T18:13:32', '2005-06-21T13:33:32', '2'), - ('207', '2047', '2006-02-16T02:30:53', '2005-07-12T01:17:11', '2005-07-20T00:29:11', '2'), - ('384', '2735', '2006-02-16T02:30:53', '2005-06-20T05:07:24', '2005-06-28T09:17:24', '2'), - ('150', '2908', '2006-02-16T02:30:53', '2005-07-12T09:35:42', '2005-07-13T12:56:42', '2'), - ('61', '3317', '2006-02-16T02:30:53', '2005-07-31T03:29:07', '2005-08-09T03:33:07', '2'), - ('117', '144', '2006-02-16T02:30:53', '2005-08-01T12:58:42', '2005-08-03T07:18:42', '2'), - ('526', '1000', '2006-02-16T02:30:53', '2005-07-29T07:33:05', '2005-08-04T04:00:05', '2'), - ('463', '989', '2006-02-16T02:30:53', '2005-07-09T02:32:34', '2005-07-13T04:39:34', '2'), - ('145', '1690', '2006-02-16T02:30:53', '2005-08-19T07:54:59', '2005-08-26T09:50:59', '2'), - ('467', '68', '2006-02-16T02:30:53', '2005-07-28T15:26:20', '2005-08-04T18:39:20', '2'), - ('174', '1137', '2006-02-16T02:30:53', '2005-07-31T12:33:43', '2005-08-04T14:15:43', '2'), - ('352', '2626', '2006-02-16T02:30:53', '2005-08-17T12:36:37', '2005-08-22T11:10:37', '2'), - ('453', '1364', '2006-02-16T02:30:53', '2005-08-23T07:25:38', '2005-08-31T02:53:38', '2'), - ('189', '3898', '2006-02-16T02:30:53', '2005-06-20T02:56:16', '2005-06-24T23:51:16', '2'), - ('285', '3092', '2006-02-16T02:30:53', '2005-08-18T19:57:39', '2005-08-27T01:36:39', '2'), - ('563', '2417', '2006-02-16T02:30:53', '2005-08-20T14:57:50', '2005-08-29T15:36:50', '2'), - ('516', '2410', '2006-02-16T02:30:53', '2005-05-27T03:47:18', '2005-06-04T05:46:18', '2'), - ('196', '1490', '2006-02-16T02:30:53', '2005-06-20T17:06:46', '2005-06-28T13:18:46', '2'), - ('214', '873', '2006-02-16T02:30:53', '2005-08-19T22:36:26', '2005-08-22T01:52:26', '2'), - ('484', '3890', '2006-02-16T02:30:53', '2005-07-10T17:43:30', '2005-07-15T15:05:30', '2'), - ('423', '2556', '2006-02-16T02:30:53', '2005-07-07T14:08:11', '2005-07-13T08:09:11', '2'), - ('80', '1194', '2006-02-16T02:30:53', '2005-08-01T04:29:29', '2005-08-04T08:12:29', '2'), - ('465', '441', '2006-02-16T02:30:53', '2005-06-19T00:48:11', '2005-06-25T01:46:11', '2'), - ('262', '1456', '2006-02-16T02:30:53', '2005-08-23T17:57:35', '2005-08-28T14:16:35', '2'), - ('285', '1994', '2006-02-16T02:30:53', '2005-08-22T18:03:57', '2005-08-23T20:56:57', '2'), - ('167', '154', '2006-02-16T02:30:53', '2005-08-23T03:50:48', '2005-08-28T22:17:48', '2'), - ('577', '2492', '2006-02-16T02:30:53', '2005-06-18T16:06:14', '2005-06-26T16:56:14', '2'), - ('297', '2407', '2006-02-16T02:30:53', '2005-07-27T00:56:30', '2005-08-02T01:14:30', '2'), - ('215', '611', '2006-02-16T02:30:53', '2005-08-23T15:37:31', '2005-08-28T18:41:31', '2'), - ('167', '4524', '2006-02-16T02:30:53', '2005-07-29T03:44:30', '2005-07-30T05:03:30', '2'), - ('570', '3901', '2006-02-16T02:30:53', '2005-07-12T05:10:16', '2005-07-13T04:16:16', '2'), - ('207', '3366', '2006-02-16T02:30:53', '2005-06-17T07:51:26', '2005-06-23T13:22:26', '2'), - ('185', '1922', '2006-02-16T02:30:53', '2005-05-28T19:16:14', '2005-05-31T16:50:14', '2'), - ('598', '3667', '2006-02-16T02:30:53', '2005-07-29T09:42:42', '2005-08-06T14:22:42', '2'), - ('63', '1387', '2006-02-16T02:30:53', '2005-08-17T15:37:34', '2005-08-22T17:28:34', '2'), - ('241', '4417', '2006-02-16T02:30:53', '2005-06-21T03:53:58', '2005-06-22T22:49:58', '2'), - ('459', '3287', '2006-02-16T02:30:53', '2005-08-22T20:56:41', '2005-08-26T22:51:41', '2'), - ('247', '2671', '2006-02-16T02:30:53', '2005-05-27T19:03:08', '2005-06-03T20:28:08', '2'), - ('336', '294', '2006-02-16T02:30:53', '2005-08-17T08:49:05', '2005-08-22T08:53:05', '2'), - ('18', '4557', '2006-02-16T02:30:53', '2005-08-01T17:32:53', '2005-08-06T15:49:53', '2'), - ('493', '3109', '2006-02-16T02:30:53', '2005-06-18T13:45:34', '2005-06-21T12:12:34', '2'), - ('34', '993', '2006-02-16T02:30:53', '2005-08-17T07:15:47', '2005-08-19T01:44:47', '2'), - ('60', '387', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('52', '547', '2006-02-16T02:30:53', '2005-08-01T15:37:58', '2005-08-07T11:15:58', '2'), - ('57', '3361', '2006-02-16T02:30:53', '2005-08-19T04:59:01', '2005-08-27T02:03:01', '2'), - ('401', '2753', '2006-02-16T02:30:53', '2005-07-28T01:48:32', '2005-08-03T03:10:32', '2'), - ('327', '2109', '2006-02-16T02:30:53', '2005-08-17T19:33:24', '2005-08-21T19:59:24', '2'), - ('581', '3754', '2006-02-16T02:30:53', '2005-08-20T06:43:44', '2005-08-23T06:25:44', '2'), - ('75', '3962', '2006-02-16T02:30:53', '2005-07-28T09:10:22', '2005-08-01T11:27:22', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['13829', '5790', '7140', '7175', '14570', '1041', '6040', '11308', '9573', '11284', '12501', '5296', '11505', '11681', '6574', '5780', '10034', '1978', '3902', '278', '10452', '14648', '15140', '3880', '6567', '1572', '5622', '6088', '4961', '11330', '487', '10580', '3413', '889', '2886', '9208', '3997', '2238', '3561', '15510', '703', '1812', '796', '7339', '3941', '363', '6751', '347', '11648', '11360', '3478', '3802', '8883', '10409', '15622', '4348', '3043', '5581', '13917', '9022', '8330', '10091', '10668', '9823', '10469', '5835', '2896', '2021', '12789', '6290', '15339', '15575', '4086', '4179', '9415', '1392', '11898', '9833', '10076', '1305', '6976', '7584', '13554', '5259', '4841', '8175', '12475', '7596', '4167', '2577', '11365', '9783', '4543', '3287', '6011', '9650', '754', '2372', '12282', '13429']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('146', '3980', '2006-02-16T02:30:53', '2005-08-20T13:50:17', '2005-08-24T11:30:17', '2'), - ('235', '1696', '2006-02-16T02:30:53', '2005-07-10T14:15:21', '2005-07-14T08:53:21', '2'), - ('35', '2028', '2006-02-16T02:30:53', '2005-07-27T06:54:12', '2005-08-03T10:36:12', '2'), - ('190', '568', '2006-02-16T02:30:53', '2005-07-27T08:03:22', '2005-08-01T02:47:22', '2'), - ('32', '955', '2006-02-16T02:30:53', '2005-08-21T16:32:32', '2005-08-30T12:03:32', '2'), - ('272', '4432', '2006-02-16T02:30:53', '2005-05-31T05:46:23', '2005-06-06T09:50:23', '2'), - ('511', '2161', '2006-02-16T02:30:53', '2005-07-11T03:14:26', '2005-07-14T01:12:26', '2'), - ('16', '699', '2006-02-16T02:30:53', '2005-08-02T15:50:44', '2005-08-05T11:38:44', '2'), - ('59', '3745', '2006-02-16T02:30:53', '2005-07-31T02:45:38', '2005-08-09T04:31:38', '2'), - ('8', '172', '2006-02-16T02:30:53', '2005-08-02T14:42:45', '2005-08-04T11:55:45', '2'), - ('173', '728', '2006-02-16T02:30:53', '2005-08-18T13:13:13', '2005-08-23T07:24:13', '2'), - ('109', '495', '2006-02-16T02:30:53', '2005-07-09T15:26:27', '2005-07-15T10:03:27', '2'), - ('34', '3344', '2006-02-16T02:30:53', '2005-08-16T23:18:47', '2005-08-23T19:52:47', '2'), - ('543', '1260', '2006-02-16T02:30:53', '2005-08-17T06:13:30', '2005-08-26T01:29:30', '2'), - ('115', '621', '2006-02-16T02:30:53', '2005-07-12T06:04:22', '2005-07-18T03:19:22', '2'), - ('516', '168', '2006-02-16T02:30:53', '2005-07-10T13:46:23', '2005-07-14T17:19:23', '2'), - ('442', '354', '2006-02-16T02:30:53', '2005-07-31T18:45:30', '2005-08-04T21:13:30', '2'), - ('278', '1590', '2006-02-16T02:30:53', '2005-06-17T09:42:34', '2005-06-20T09:13:34', '2'), - ('192', '2868', '2006-02-16T02:30:53', '2005-07-06T19:25:18', '2005-07-10T17:42:18', '2'), - ('214', '182', '2006-02-16T02:30:53', '2005-05-26T17:40:58', '2005-06-02T16:43:58', '2'), - ('442', '1973', '2006-02-16T02:30:53', '2005-08-01T09:11:36', '2005-08-04T13:28:36', '2'), - ('284', '2250', '2006-02-16T02:30:53', '2005-08-21T19:18:01', '2005-08-25T14:59:01', '2'), - ('414', '1402', '2006-02-16T02:30:53', '2005-08-22T13:39:20', '2005-08-30T18:19:20', '2'), - ('507', '42', '2006-02-16T02:30:53', '2005-07-06T18:32:49', '2005-07-07T20:46:49', '2'), - ('198', '1336', '2006-02-16T02:30:53', '2005-07-12T05:43:09', '2005-07-19T08:18:09', '2'), - ('560', '4179', '2006-02-16T02:30:53', '2005-06-16T03:23:22', '2005-06-20T06:03:22', '2'), - ('568', '1783', '2006-02-16T02:30:53', '2005-07-10T05:39:37', '2005-07-15T00:48:37', '2'), - ('498', '3796', '2006-02-16T02:30:53', '2005-07-11T05:40:35', '2005-07-17T07:14:35', '2'), - ('96', '3668', '2006-02-16T02:30:53', '2005-07-08T23:35:53', '2005-07-14T22:46:53', '2'), - ('75', '4326', '2006-02-16T02:30:53', '2005-08-02T16:45:33', '2005-08-04T15:15:33', '2'), - ('569', '3774', '2006-02-16T02:30:53', '2005-05-28T00:00:30', '2005-05-28T19:18:30', '2'), - ('234', '590', '2006-02-16T02:30:53', '2005-08-01T13:51:14', '2005-08-08T11:49:14', '2'), - ('322', '666', '2006-02-16T02:30:53', '2005-06-21T16:57:07', '2005-06-30T12:03:07', '2'), - ('114', '1299', '2006-02-16T02:30:53', '2005-05-30T07:14:53', '2005-05-31T07:56:53', '2'), - ('154', '1755', '2006-02-16T02:30:53', '2005-06-20T01:38:39', '2005-06-23T04:28:39', '2'), - ('339', '2751', '2006-02-16T02:30:53', '2005-07-30T12:54:03', '2005-08-06T17:22:03', '2'), - ('52', '3895', '2006-02-16T02:30:53', '2005-07-06T23:46:52', '2005-07-14T05:39:52', '2'), - ('251', '2859', '2006-02-16T02:30:53', '2005-06-18T04:22:06', '2005-06-27T03:29:06', '2'), - ('231', '213', '2006-02-16T02:30:53', '2005-07-06T02:54:33', '2005-07-14T07:44:33', '2'), - ('209', '3239', '2006-02-16T02:30:53', '2005-08-23T02:51:27', '2005-09-01T02:44:27', '2'), - ('269', '1123', '2006-02-16T02:30:53', '2005-05-29T02:29:36', '2005-06-03T04:54:36', '2'), - ('37', '751', '2006-02-16T02:30:53', '2005-06-16T21:08:46', '2005-06-21T15:44:46', '2'), - ('26', '2697', '2006-02-16T02:30:53', '2005-05-29T16:59:44', '2005-06-03T16:22:44', '2'), - ('316', '3343', '2006-02-16T02:30:53', '2005-07-27T14:17:48', '2005-07-31T12:47:48', '2'), - ('560', '382', '2006-02-16T02:30:53', '2005-07-06T21:20:37', '2005-07-09T01:35:37', '2'), - ('345', '4282', '2006-02-16T02:30:53', '2005-05-27T07:14:00', '2005-05-28T12:22:00', '2'), - ('312', '1749', '2006-02-16T02:30:53', '2005-07-12T14:50:34', '2005-07-15T19:39:34', '2'), - ('378', '1625', '2006-02-16T02:30:53', '2005-05-27T04:40:33', '2005-05-28T09:56:33', '2'), - ('465', '3362', '2006-02-16T02:30:53', '2005-08-17T04:56:16', '2005-08-26T00:53:16', '2'), - ('66', '1750', '2006-02-16T02:30:53', '2005-08-02T17:46:04', '2005-08-04T21:02:04', '2'), - ('322', '2528', '2006-02-16T02:30:53', '2005-07-05T23:05:44', '2005-07-07T00:14:44', '2'), - ('91', '1017', '2006-02-16T02:30:53', '2005-07-06T15:06:09', '2005-07-08T09:33:09', '2'), - ('168', '1421', '2006-02-16T02:30:53', '2005-07-30T00:24:48', '2005-08-04T00:24:48', '2'), - ('449', '2804', '2006-02-16T02:30:53', '2005-08-01T07:49:15', '2005-08-02T13:42:15', '2'), - ('302', '3335', '2006-02-16T02:30:53', '2005-08-23T07:22:02', '2005-09-01T06:08:02', '2'), - ('452', '1948', '2006-02-16T02:30:53', '2005-07-07T19:02:05', '2005-07-09T20:51:05', '2'), - ('599', '633', '2006-02-16T02:30:53', '2005-06-20T12:38:35', '2005-06-29T14:16:35', '2'), - ('306', '3450', '2006-02-16T02:30:53', '2005-07-10T04:06:06', '2005-07-15T08:31:06', '2'), - ('10', '4326', '2006-02-16T02:30:53', '2005-08-20T16:43:28', '2005-08-29T16:44:28', '2'), - ('159', '4473', '2006-02-16T02:30:53', '2005-07-30T05:34:45', '2005-08-03T23:57:45', '2'), - ('412', '2294', '2006-02-16T02:30:53', '2005-07-29T04:09:07', '2005-08-05T05:00:07', '2'), - ('135', '1878', '2006-02-16T02:30:53', '2005-07-31T20:23:13', '2005-08-02T21:58:13', '2'), - ('58', '2085', '2006-02-16T02:30:53', '2005-08-01T17:00:27', '2005-08-02T14:49:27', '2'), - ('129', '4423', '2006-02-16T02:30:53', '2005-07-31T11:49:00', '2005-08-07T09:06:00', '2'), - ('466', '3054', '2006-02-16T02:30:53', '2005-08-01T09:51:11', '2005-08-05T06:53:11', '2'), - ('11', '800', '2006-02-16T02:30:53', '2005-07-10T16:44:58', '2005-07-17T16:03:58', '2'), - ('40', '1086', '2006-02-16T02:30:53', '2005-06-20T02:33:42', '2005-06-26T05:29:42', '2'), - ('319', '2852', '2006-02-16T02:30:53', '2005-06-17T12:41:18', '2005-06-23T17:17:18', '2'), - ('557', '2412', '2006-02-16T02:30:53', '2005-08-19T00:16:19', '2005-08-25T00:18:19', '2'), - ('66', '2634', '2006-02-16T02:30:53', '2005-07-11T17:12:42', '2005-07-19T21:53:42', '2'), - ('331', '1660', '2006-02-16T02:30:53', '2005-08-22T20:52:12', '2005-08-26T00:36:12', '2'), - ('218', '3916', '2006-02-16T02:30:53', '2005-08-23T05:30:19', '2005-08-27T05:19:19', '2'), - ('494', '253', '2006-02-16T02:30:53', '2005-07-07T05:26:06', '2005-07-12T00:45:06', '2'), - ('75', '559', '2006-02-16T02:30:53', '2005-07-07T10:17:15', '2005-07-10T05:12:15', '2'), - ('139', '3336', '2006-02-16T02:30:53', '2005-07-30T20:48:31', '2005-08-05T19:45:31', '2'), - ('460', '363', '2006-02-16T02:30:53', '2005-06-15T16:12:27', '2005-06-16T17:30:27', '2'), - ('169', '3163', '2006-02-16T02:30:53', '2005-08-17T15:24:12', '2005-08-24T13:36:12', '2'), - ('368', '4243', '2006-02-16T02:30:53', '2005-07-31T12:05:01', '2005-08-09T09:25:01', '2'), - ('555', '1117', '2006-02-16T02:30:53', '2005-07-31T20:00:34', '2005-08-10T00:37:34', '2'), - ('8', '187', '2006-02-16T02:30:53', '2005-06-15T09:59:16', '2005-06-19T09:48:16', '2'), - ('41', '3096', '2006-02-16T02:30:53', '2005-07-27T00:40:01', '2005-07-31T22:30:01', '2'), - ('338', '4390', '2006-02-16T02:30:53', '2005-07-27T23:15:46', '2005-08-03T02:18:46', '2'), - ('569', '2648', '2006-02-16T02:30:53', '2005-08-20T04:08:39', '2005-08-28T07:11:39', '2'), - ('207', '1310', '2006-02-16T02:30:53', '2005-07-09T14:02:50', '2005-07-11T19:13:50', '2'), - ('248', '518', '2006-02-16T02:30:53', '2005-07-08T18:18:23', '2005-07-11T16:51:23', '2'), - ('429', '641', '2006-02-16T02:30:53', '2005-07-28T21:38:16', '2005-08-07T01:34:16', '2'), - ('401', '3118', '2006-02-16T02:30:53', '2005-08-18T12:14:21', '2005-08-24T14:43:21', '2'), - ('275', '2097', '2006-02-16T02:30:53', '2005-07-27T23:33:57', '2005-08-01T20:46:57', '2'), - ('175', '3771', '2006-02-16T02:30:53', '2005-07-07T09:37:08', '2005-07-16T06:16:08', '2'), - ('66', '447', '2006-02-16T02:30:53', '2005-06-19T04:36:03', '2005-06-28T00:38:03', '2'), - ('508', '1151', '2006-02-16T02:30:53', '2005-08-02T18:00:09', '2005-08-04T13:40:09', '2'), - ('75', '836', '2006-02-16T02:30:53', '2005-07-31T10:15:46', '2005-08-09T13:22:46', '2'), - ('41', '913', '2006-02-16T02:30:53', '2005-07-08T04:06:55', '2005-07-12T23:17:55', '2'), - ('62', '4406', '2006-02-16T02:30:53', '2005-06-21T06:32:39', '2005-06-24T09:29:39', '2'), - ('527', '3899', '2006-02-16T02:30:53', '2005-07-11T01:54:48', '2005-07-18T07:17:48', '2'), - ('414', '2997', '2006-02-16T02:30:53', '2005-07-31T05:47:32', '2005-08-04T00:50:32', '2'), - ('281', '734', '2006-02-16T02:30:53', '2005-05-29T10:18:59', '2005-06-04T05:03:59', '2'), - ('96', '1567', '2006-02-16T02:30:53', '2005-06-18T14:37:37', '2005-06-21T08:40:37', '2'), - ('173', '3623', '2006-02-16T02:30:53', '2005-08-18T04:54:20', '2005-08-23T05:28:20', '2'), - ('23', '3677', '2006-02-16T02:30:53', '2005-08-19T23:25:37', '2005-08-28T01:04:37', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['1180', '10057', '3087', '4864', '15310', '6320', '11911', '10792', '9160', '9440', '3920', '6940', '8910', '6440', '6786', '4781', '6198', '10507', '9337', '8197', '14239', '7841', '2594', '6671', '11271', '13199', '10322', '2184', '10616', '5181', '4288', '13185', '3820', '13967', '13837', '14705', '9662', '8842', '9301', '1337', '7972', '1831', '3858', '14532', '3005', '4826', '2539', '7268', '14292', '6698', '1056', '13046', '3706', '10909', '284', '8495', '10584', '11414', '14052', '1395', '2223', '10934', '6334', '2222', '6055', '13077', '12309', '5353', '5046', '8202', '1300', '6885', '898', '14764', '2739', '14313', '12627', '12558', '5819', '13047', '8882', '6174', '9711', '10722', '11003', '14516', '15668', '5228', '975', '14718', '13947', '630', '9126', '9555', '9272', '8489', '1604', '10858', '9418', '12102']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('432', '3119', '2006-02-16T02:30:53', '2005-06-15T00:39:01', '2005-06-21T22:44:01', '2'), - ('230', '3485', '2006-02-16T02:30:53', '2005-07-31T19:20:18', '2005-08-08T17:59:18', '2'), - ('111', '1305', '2006-02-16T02:30:53', '2005-06-20T15:53:59', '2005-06-27T10:54:59', '2'), - ('281', '2974', '2006-02-16T02:30:53', '2005-07-08T19:05:34', '2005-07-17T15:05:34', '2'), - ('360', '2546', '2006-02-16T02:30:53', '2005-08-22T19:56:41', '2005-08-24T16:32:41', '2'), - ('511', '441', '2006-02-16T02:30:53', '2005-07-11T18:50:55', '2005-07-13T22:46:55', '2'), - ('472', '3578', '2006-02-16T02:30:53', '2005-08-17T15:51:35', '2005-08-26T20:26:35', '2'), - ('264', '1037', '2006-02-16T02:30:53', '2005-08-01T21:44:24', '2005-08-02T19:48:24', '2'), - ('34', '183', '2006-02-16T02:30:53', '2005-07-30T11:17:33', '2005-08-06T15:16:33', '2'), - ('535', '414', '2006-02-16T02:30:53', '2005-07-30T21:40:15', '2005-08-04T15:45:15', '2'), - ('321', '1551', '2006-02-16T02:30:53', '2005-07-06T20:26:40', '2005-07-15T15:00:40', '2'), - ('149', '3876', '2006-02-16T02:30:53', '2005-07-26T23:18:35', '2005-08-05T01:44:35', '2'), - ('569', '1039', '2006-02-16T02:30:53', '2005-07-30T01:29:48', '2005-07-31T21:33:48', '2'), - ('269', '2148', '2006-02-16T02:30:53', '2005-07-12T00:25:04', '2005-07-13T04:52:04', '2'), - ('546', '2011', '2006-02-16T02:30:53', '2005-07-12T16:32:33', '2005-07-16T12:42:33', '2'), - ('593', '1818', '2006-02-16T02:30:53', '2005-07-08T16:06:55', '2005-07-16T11:22:55', '2'), - ('470', '3345', '2006-02-16T02:30:53', '2005-07-11T12:12:17', '2005-07-18T07:40:17', '2'), - ('45', '367', '2006-02-16T02:30:53', '2005-08-01T11:22:20', '2005-08-04T13:18:20', '2'), - ('90', '2363', '2006-02-16T02:30:53', '2005-07-30T18:02:25', '2005-07-31T12:30:25', '2'), - ('407', '4126', '2006-02-16T02:30:53', '2005-07-28T23:04:10', '2005-08-05T00:06:10', '2'), - ('416', '1559', '2006-02-16T02:30:53', '2005-08-21T05:18:57', '2005-08-22T00:12:57', '2'), - ('1', '1092', '2006-02-16T02:30:53', '2005-07-28T09:04:45', '2005-07-30T12:37:45', '2'), - ('123', '829', '2006-02-16T02:30:53', '2005-06-19T05:43:43', '2005-06-25T03:41:43', '2'), - ('526', '955', '2006-02-16T02:30:53', '2005-07-12T11:48:48', '2005-07-19T16:55:48', '2'), - ('93', '4323', '2006-02-16T02:30:53', '2005-08-02T14:18:22', '2005-08-07T09:35:22', '2'), - ('339', '4291', '2006-02-16T02:30:53', '2005-08-19T14:53:22', '2005-08-27T19:03:22', '2'), - ('535', '1543', '2006-02-16T02:30:53', '2005-08-01T04:44:13', '2005-08-08T00:20:13', '2'), - ('537', '3468', '2006-02-16T02:30:53', '2005-06-18T01:10:36', '2005-06-21T05:59:36', '2'), - ('20', '1094', '2006-02-16T02:30:53', '2005-08-01T14:59:50', '2005-08-07T11:38:50', '2'), - ('45', '2569', '2006-02-16T02:30:53', '2005-07-09T10:07:27', '2005-07-17T10:18:27', '2'), - ('64', '1508', '2006-02-16T02:30:53', '2005-07-07T15:38:25', '2005-07-13T16:23:25', '2'), - ('174', '241', '2006-02-16T02:30:53', '2005-08-19T14:22:30', '2005-08-20T10:13:30', '2'), - ('460', '4192', '2006-02-16T02:30:53', '2005-07-06T15:35:26', '2005-07-11T12:22:26', '2'), - ('459', '2751', '2006-02-16T02:30:53', '2005-08-20T18:28:46', '2005-08-26T17:37:46', '2'), - ('67', '3220', '2006-02-16T02:30:53', '2005-08-20T14:19:03', '2005-08-22T16:25:03', '2'), - ('243', '2493', '2006-02-16T02:30:53', '2005-08-21T21:02:55', '2005-08-25T20:20:55', '2'), - ('96', '2757', '2006-02-16T02:30:53', '2005-07-31T06:09:53', '2005-08-08T00:50:53', '2'), - ('292', '4203', '2006-02-16T02:30:53', '2005-07-29T23:03:40', '2005-08-06T23:23:40', '2'), - ('174', '1073', '2006-02-16T02:30:53', '2005-07-30T16:34:29', '2005-07-31T18:41:29', '2'), - ('465', '4014', '2006-02-16T02:30:53', '2005-06-15T12:12:42', '2005-06-20T12:38:42', '2'), - ('269', '2930', '2006-02-16T02:30:53', '2005-07-28T14:07:46', '2005-08-01T11:28:46', '2'), - ('383', '2610', '2006-02-16T02:30:53', '2005-06-16T22:22:17', '2005-06-25T23:23:17', '2'), - ('377', '829', '2006-02-16T02:30:53', '2005-07-06T17:17:57', '2005-07-10T23:10:57', '2'), - ('37', '2057', '2006-02-16T02:30:53', '2005-08-21T15:15:03', '2005-08-25T17:41:03', '2'), - ('598', '286', '2006-02-16T02:30:53', '2005-06-20T10:10:29', '2005-06-28T15:48:29', '2'), - ('180', '911', '2006-02-16T02:30:53', '2005-07-08T17:44:25', '2005-07-16T20:14:25', '2'), - ('527', '4474', '2006-02-16T02:30:53', '2005-06-19T01:58:39', '2005-06-19T22:17:39', '2'), - ('260', '2740', '2006-02-16T02:30:53', '2005-07-27T11:23:09', '2005-08-01T12:42:09', '2'), - ('251', '1959', '2006-02-16T02:30:53', '2005-08-21T07:06:20', '2005-08-22T01:39:20', '2'), - ('64', '4419', '2006-02-16T02:30:53', '2005-07-12T12:45:00', '2005-07-16T11:16:00', '2'), - ('519', '1591', '2006-02-16T02:30:53', '2005-05-31T07:48:07', '2005-06-05T08:51:07', '2'), - ('37', '965', '2006-02-16T02:30:53', '2005-08-19T09:21:10', '2005-08-26T13:00:10', '2'), - ('132', '681', '2006-02-16T02:30:53', '2005-07-06T10:18:01', '2005-07-09T09:07:01', '2'), - ('413', '3516', '2006-02-16T02:30:53', '2005-08-02T01:53:59', '2005-08-03T04:36:59', '2'), - ('359', '350', '2006-02-16T02:30:53', '2005-05-26T19:21:44', '2005-06-04T14:18:44', '2'), - ('51', '344', '2006-02-16T02:30:53', '2005-07-29T09:05:06', '2005-08-06T05:48:06', '2'), - ('86', '715', '2006-02-16T02:30:53', '2005-08-01T13:58:47', '2005-08-06T13:38:47', '2'), - ('353', '1772', '2006-02-16T02:30:53', '2005-08-02T19:43:07', '2005-08-07T15:22:07', '2'), - ('514', '3893', '2006-02-16T02:30:53', '2005-08-20T22:11:46', '2005-08-22T20:26:46', '2'), - ('252', '753', '2006-02-16T02:30:53', '2005-06-15T16:21:04', '2005-06-23T12:52:04', '2'), - ('303', '4068', '2006-02-16T02:30:53', '2005-06-18T03:27:03', '2005-06-27T09:19:03', '2'), - ('142', '4458', '2006-02-16T02:30:53', '2005-08-02T02:52:18', '2005-08-06T01:23:18', '2'), - ('168', '948', '2006-02-16T02:30:53', '2005-07-11T19:20:44', '2005-07-19T18:49:44', '2'), - ('10', '3834', '2006-02-16T02:30:53', '2005-06-18T03:26:23', '2005-06-26T08:50:23', '2'), - ('125', '595', '2006-02-16T02:30:53', '2005-07-11T03:59:08', '2005-07-18T05:35:08', '2'), - ('241', '433', '2006-02-16T02:30:53', '2005-08-19T10:15:19', '2005-08-21T06:51:19', '2'), - ('9', '762', '2006-02-16T02:30:53', '2005-08-18T05:58:40', '2005-08-20T02:20:40', '2'), - ('196', '2994', '2006-02-16T02:30:53', '2005-07-09T18:04:29', '2005-07-15T17:46:29', '2'), - ('227', '1639', '2006-02-16T02:30:53', '2005-07-09T03:34:57', '2005-07-17T22:36:57', '2'), - ('75', '3802', '2006-02-16T02:30:53', '2005-07-28T23:11:45', '2005-08-03T21:57:45', '2'), - ('186', '2524', '2006-02-16T02:30:53', '2005-06-15T09:36:19', '2005-06-17T13:54:19', '2'), - ('159', '3972', '2006-02-16T02:30:53', '2005-07-12T20:56:04', '2005-07-15T19:21:04', '2'), - ('384', '3497', '2006-02-16T02:30:53', '2005-05-30T09:26:19', '2005-06-01T10:45:19', '2'), - ('529', '1270', '2006-02-16T02:30:53', '2005-08-21T23:37:47', '2005-08-24T00:23:47', '2'), - ('212', '213', '2006-02-16T02:30:53', '2005-06-19T15:58:38', '2005-06-27T15:01:38', '2'), - ('468', '3384', '2006-02-16T02:30:53', '2005-08-21T07:49:53', '2005-08-30T05:52:53', '2'), - ('150', '3760', '2006-02-16T02:30:53', '2005-08-18T17:37:11', '2005-08-19T14:59:11', '2'), - ('289', '167', '2006-02-16T02:30:53', '2005-08-18T14:52:35', '2005-08-26T09:45:35', '2'), - ('347', '3439', '2006-02-16T02:30:53', '2005-07-10T15:56:20', '2005-07-12T19:59:20', '2'), - ('394', '2704', '2006-02-16T02:30:53', '2005-08-19T09:24:49', '2005-08-24T11:06:49', '2'), - ('410', '441', '2006-02-16T02:30:53', '2005-07-30T00:24:05', '2005-08-03T19:48:05', '2'), - ('7', '3123', '2006-02-16T02:30:53', '2005-07-11T10:36:28', '2005-07-18T16:19:28', '2'), - ('231', '1525', '2006-02-16T02:30:53', '2005-07-31T08:06:41', '2005-08-02T10:30:41', '2'), - ('90', '2849', '2006-02-16T02:30:53', '2005-08-01T19:07:08', '2005-08-04T14:09:08', '2'), - ('272', '4301', '2006-02-16T02:30:53', '2005-08-02T05:03:05', '2005-08-05T10:48:05', '2'), - ('457', '713', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('38', '1963', '2006-02-16T02:30:53', '2005-08-23T09:02:04', '2005-08-29T03:17:04', '2'), - ('195', '622', '2006-02-16T02:30:53', '2005-07-09T12:26:01', '2005-07-14T13:31:01', '2'), - ('7', '3109', '2006-02-16T02:30:53', '2005-05-30T21:07:15', '2005-06-03T01:48:15', '2'), - ('340', '3618', '2006-02-16T02:30:53', '2005-08-21T21:39:25', '2005-08-26T22:07:25', '2'), - ('218', '2562', '2006-02-16T02:30:53', '2005-08-20T17:46:06', '2005-08-29T23:44:06', '2'), - ('417', '1254', '2006-02-16T02:30:53', '2005-05-28T17:24:51', '2005-06-05T20:05:51', '2'), - ('590', '4495', '2006-02-16T02:30:53', '2005-07-30T09:44:15', '2005-08-02T11:02:15', '2'), - ('382', '2108', '2006-02-16T02:30:53', '2005-07-31T02:11:16', '2005-08-03T06:58:16', '2'), - ('553', '1352', '2006-02-16T02:30:53', '2005-07-30T15:05:22', '2005-08-05T10:02:22', '2'), - ('265', '375', '2006-02-16T02:30:53', '2005-07-29T08:58:03', '2005-08-02T07:50:03', '2'), - ('272', '3226', '2006-02-16T02:30:53', '2005-06-16T06:14:25', '2005-06-17T03:53:25', '2'), - ('312', '852', '2006-02-16T02:30:53', '2005-08-02T00:08:39', '2005-08-05T00:58:39', '2'), - ('168', '241', '2006-02-16T02:30:53', '2005-07-30T21:00:52', '2005-08-08T15:56:52', '2'), - ('392', '4268', '2006-02-16T02:30:53', '2005-08-17T22:45:26', '2005-08-24T01:47:26', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['2434', '4870', '1952', '5752', '9232', '2428', '13672', '3548', '12258', '13619', '7989', '7492', '5615', '7338', '3242', '965', '1843', '14687', '11151', '14932', '15670', '13986', '76', '5056', '15435', '15001', '15496', '1445', '11341', '5255', '1060', '1257', '9482', '7158', '11033', '3622', '3170', '2941', '11189', '3988', '10779', '1770', '5962', '154', '11535', '11246', '5298', '4379', '10177', '3505', '11814', '14574', '4542', '9657', '14132', '13317', '7698', '4425', '3929', '349', '4578', '5011', '12719', '7995', '10500', '2432', '6620', '3060', '13817', '5156', '8875', '3223', '4569', '7105', '10711', '5850', '8122', '3891', '9564', '7282', '14415', '10853', '2724', '7122', '98', '9774', '7551', '5725', '7834', '627', '4981', '14329', '836', '14870', '4742', '11424', '1025', '10419', '538', '10298']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('12', '3739', '2006-02-16T02:30:53', '2005-06-18T18:11:51', '2005-06-23T12:52:51', '2'), - ('260', '3089', '2006-02-16T02:30:53', '2005-07-08T19:14:45', '2005-07-12T18:58:45', '2'), - ('338', '1823', '2006-02-16T02:30:53', '2005-06-17T08:33:02', '2005-06-21T14:00:02', '2'), - ('86', '4444', '2006-02-16T02:30:53', '2005-07-10T12:27:38', '2005-07-18T09:22:38', '2'), - ('502', '1991', '2006-02-16T02:30:53', '2005-07-30T13:43:00', '2005-08-02T11:39:00', '2'), - ('241', '3892', '2006-02-16T02:30:53', '2005-06-18T17:47:34', '2005-06-19T14:39:34', '2'), - ('201', '2068', '2006-02-16T02:30:53', '2005-08-20T08:27:27', '2005-08-22T06:15:27', '2'), - ('16', '4498', '2006-02-16T02:30:53', '2005-07-06T02:23:39', '2005-07-08T07:53:39', '2'), - ('83', '2861', '2006-02-16T02:30:53', '2005-08-18T04:11:13', '2005-08-21T23:40:13', '2'), - ('365', '1068', '2006-02-16T02:30:53', '2005-08-20T06:39:26', '2005-08-23T05:22:26', '2'), - ('149', '3196', '2006-02-16T02:30:53', '2005-07-28T14:39:05', '2005-08-05T13:58:05', '2'), - ('155', '908', '2006-02-16T02:30:53', '2005-07-27T19:54:18', '2005-07-31T15:36:18', '2'), - ('173', '1521', '2006-02-16T02:30:53', '2005-07-10T05:18:51', '2005-07-17T11:05:51', '2'), - ('251', '107', '2006-02-16T02:30:53', '2005-07-27T14:13:34', '2005-08-03T18:36:34', '2'), - ('562', '1421', '2006-02-16T02:30:53', '2005-06-21T02:56:24', '2005-06-29T21:41:24', '2'), - ('502', '3363', '2006-02-16T02:30:53', '2005-05-30T19:00:14', '2005-05-31T17:10:14', '2'), - ('132', '2714', '2006-02-16T02:30:53', '2005-06-16T23:53:42', '2005-06-22T18:33:42', '2'), - ('550', '306', '2006-02-16T02:30:53', '2005-08-21T20:32:16', '2005-08-26T16:17:16', '2'), - ('391', '3939', '2006-02-16T02:30:53', '2005-08-02T09:52:44', '2005-08-05T06:29:44', '2'), - ('516', '2259', '2006-02-16T02:30:53', '2005-08-22T05:40:39', '2005-08-23T11:02:39', '2'), - ('211', '2834', '2006-02-16T02:30:53', '2005-08-23T09:07:11', '2005-08-31T04:32:11', '2'), - ('152', '3701', '2006-02-16T02:30:53', '2005-08-20T19:13:23', '2005-08-22T20:59:23', '2'), - ('1', '3021', '2006-02-16T02:30:53', '2005-05-25T11:30:37', '2005-06-03T12:00:37', '2'), - ('526', '2599', '2006-02-16T02:30:53', '2005-07-09T04:13:45', '2005-07-10T06:17:45', '2'), - ('468', '2103', '2006-02-16T02:30:53', '2005-08-23T00:28:19', '2005-08-26T00:44:19', '2'), - ('186', '2869', '2006-02-16T02:30:53', '2005-08-22T08:00:49', '2005-08-27T05:53:49', '2'), - ('275', '1863', '2006-02-16T02:30:53', '2005-08-23T02:30:23', '2005-08-31T03:31:23', '2'), - ('537', '3189', '2006-02-16T02:30:53', '2005-06-15T19:10:07', '2005-06-19T20:27:07', '2'), - ('15', '3586', '2006-02-16T02:30:53', '2005-08-02T17:09:24', '2005-08-09T19:48:24', '2'), - ('313', '4418', '2006-02-16T02:30:53', '2005-07-09T13:51:08', '2005-07-17T13:58:08', '2'), - ('570', '2676', '2006-02-16T02:30:53', '2005-05-31T08:21:43', '2005-06-09T04:02:43', '2'), - ('267', '1938', '2006-02-16T02:30:53', '2005-06-15T06:15:36', '2005-06-21T01:04:36', '2'), - ('348', '2421', '2006-02-16T02:30:53', '2005-07-30T23:29:16', '2005-08-02T20:37:16', '2'), - ('38', '2432', '2006-02-16T02:30:53', '2005-07-27T07:23:58', '2005-08-03T06:00:58', '2'), - ('155', '3323', '2006-02-16T02:30:53', '2005-08-02T05:54:17', '2005-08-09T10:50:17', '2'), - ('454', '3489', '2006-02-16T02:30:53', '2005-07-06T06:05:04', '2005-07-12T03:14:04', '2'), - ('421', '1306', '2006-02-16T02:30:53', '2005-06-20T22:02:54', '2005-06-29T00:41:54', '2'), - ('135', '3632', '2006-02-16T02:30:53', '2005-06-20T05:22:18', '2005-06-26T07:40:18', '2'), - ('565', '729', '2006-02-16T02:30:53', '2005-08-02T11:17:23', '2005-08-09T16:30:23', '2'), - ('421', '2981', '2006-02-16T02:30:53', '2005-07-06T23:30:42', '2005-07-13T03:06:42', '2'), - ('578', '2092', '2006-02-16T02:30:53', '2005-08-01T21:11:54', '2005-08-09T21:00:54', '2'), - ('359', '1681', '2006-02-16T02:30:53', '2005-06-16T18:07:55', '2005-06-23T23:49:55', '2'), - ('507', '1292', '2006-02-16T02:30:53', '2005-07-10T23:45:22', '2005-07-13T03:49:22', '2'), - ('185', '1354', '2006-02-16T02:30:53', '2005-05-26T00:55:56', '2005-05-29T23:18:56', '2'), - ('356', '1649', '2006-02-16T02:30:53', '2005-08-17T00:39:54', '2005-08-24T20:46:54', '2'), - ('550', '3577', '2006-02-16T02:30:53', '2005-08-02T13:33:56', '2005-08-03T08:52:56', '2'), - ('149', '3491', '2006-02-16T02:30:53', '2005-07-09T15:36:17', '2005-07-18T19:07:17', '2'), - ('316', '2773', '2006-02-16T02:30:53', '2005-07-07T20:32:30', '2005-07-11T20:40:30', '2'), - ('279', '2242', '2006-02-16T02:30:53', '2005-07-31T23:42:33', '2005-08-03T01:30:33', '2'), - ('331', '2630', '2006-02-16T02:30:53', '2005-07-06T00:19:32', '2005-07-14T20:14:32', '2'), - ('509', '3462', '2006-02-16T02:30:53', '2005-08-17T12:09:20', '2005-08-25T16:56:20', '2'), - ('62', '1611', '2006-02-16T02:30:53', '2005-08-21T16:50:34', '2005-08-26T14:24:34', '2'), - ('293', '4169', '2006-02-16T02:30:53', '2005-07-08T04:06:30', '2005-07-16T06:54:30', '2'), - ('402', '2681', '2006-02-16T02:30:53', '2005-07-31T06:00:41', '2005-08-06T06:51:41', '2'), - ('91', '3806', '2006-02-16T02:30:53', '2005-08-21T01:43:58', '2005-08-26T20:16:58', '2'), - ('20', '3349', '2006-02-16T02:30:53', '2005-08-19T19:25:42', '2005-08-20T20:57:42', '2'), - ('561', '3650', '2006-02-16T02:30:53', '2005-07-28T03:44:14', '2005-08-04T03:44:14', '2'), - ('345', '877', '2006-02-16T02:30:53', '2005-07-07T22:22:44', '2005-07-08T22:23:44', '2'), - ('453', '1235', '2006-02-16T02:30:53', '2005-07-06T20:52:39', '2005-07-12T00:27:39', '2'), - ('36', '2920', '2006-02-16T02:30:53', '2005-05-27T04:53:11', '2005-05-28T06:33:11', '2'), - ('497', '1533', '2006-02-16T02:30:53', '2005-07-08T06:00:17', '2005-07-10T06:58:17', '2'), - ('249', '463', '2006-02-16T02:30:53', '2005-07-09T01:44:40', '2005-07-11T00:58:40', '2'), - ('87', '1094', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('89', '536', '2006-02-16T02:30:53', '2005-07-28T15:00:09', '2005-08-01T12:33:09', '2'), - ('477', '469', '2006-02-16T02:30:53', '2005-08-01T11:01:01', '2005-08-06T08:59:01', '2'), - ('250', '4420', '2006-02-16T02:30:53', '2005-06-18T17:59:18', '2005-06-25T15:19:18', '2'), - ('337', '2362', '2006-02-16T02:30:53', '2005-07-12T08:51:03', '2005-07-16T03:59:03', '2'), - ('446', '2075', '2006-02-16T02:30:53', '2005-06-20T13:47:20', '2005-06-25T16:00:20', '2'), - ('293', '1935', '2006-02-16T02:30:53', '2005-08-20T13:15:30', '2005-08-22T18:48:30', '2'), - ('5', '416', '2006-02-16T02:30:53', '2005-07-09T08:51:42', '2005-07-15T03:59:42', '2'), - ('121', '1294', '2006-02-16T02:30:53', '2005-07-30T00:15:09', '2005-08-04T02:54:09', '2'), - ('299', '1033', '2006-02-16T02:30:53', '2005-06-21T02:06:45', '2005-06-22T07:16:45', '2'), - ('366', '2925', '2006-02-16T02:30:53', '2005-07-08T05:30:51', '2005-07-14T04:14:51', '2'), - ('15', '864', '2006-02-16T02:30:53', '2005-07-27T05:15:37', '2005-07-28T05:49:37', '2'), - ('400', '4278', '2006-02-16T02:30:53', '2005-08-01T18:45:09', '2005-08-02T19:47:09', '2'), - ('531', '4015', '2006-02-16T02:30:53', '2005-07-10T17:36:27', '2005-07-15T16:44:27', '2'), - ('18', '2141', '2006-02-16T02:30:53', '2005-07-28T19:27:37', '2005-07-29T19:48:37', '2'), - ('553', '3216', '2006-02-16T02:30:53', '2005-07-06T18:58:25', '2005-07-09T23:20:25', '2'), - ('377', '383', '2006-02-16T02:30:53', '2005-07-31T02:31:37', '2005-08-03T22:57:37', '2'), - ('276', '4418', '2006-02-16T02:30:53', '2005-07-27T12:00:19', '2005-08-04T14:48:19', '2'), - ('561', '2670', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('41', '2682', '2006-02-16T02:30:53', '2005-08-02T00:00:54', '2005-08-10T05:37:54', '2'), - ('103', '3879', '2006-02-16T02:30:53', '2005-06-19T14:57:54', '2005-06-22T16:31:54', '2'), - ('172', '1699', '2006-02-16T02:30:53', '2005-07-27T06:03:18', '2005-08-04T10:43:18', '2'), - ('269', '2970', '2006-02-16T02:30:53', '2005-05-25T16:48:24', '2005-05-27T11:29:24', '2'), - ('306', '4174', '2006-02-16T02:30:53', '2005-07-31T09:57:51', '2005-08-02T09:08:51', '2'), - ('304', '2635', '2006-02-16T02:30:53', '2005-07-27T21:59:15', '2005-07-31T19:54:15', '2'), - ('426', '4293', '2006-02-16T02:30:53', '2005-07-10T11:21:21', '2005-07-14T05:34:21', '2'), - ('278', '4124', '2006-02-16T02:30:53', '2005-07-28T08:46:43', '2005-07-31T07:09:43', '2'), - ('241', '425', '2006-02-16T02:30:53', '2005-05-28T17:04:43', '2005-06-04T19:58:43', '2'), - ('399', '3363', '2006-02-16T02:30:53', '2005-07-09T00:29:29', '2005-07-16T19:06:29', '2'), - ('6', '3544', '2006-02-16T02:30:53', '2005-08-21T08:22:56', '2005-08-28T02:22:56', '2'), - ('368', '3140', '2006-02-16T02:30:53', '2005-05-29T23:56:42', '2005-05-31T04:11:42', '2'), - ('512', '2170', '2006-02-16T02:30:53', '2005-08-22T03:23:20', '2005-08-23T06:50:20', '2'), - ('340', '3022', '2006-02-16T02:30:53', '2005-07-08T13:35:23', '2005-07-11T10:24:23', '2'), - ('84', '1030', '2006-02-16T02:30:53', '2005-08-02T19:57:42', '2005-08-10T16:57:42', '2'), - ('93', '1618', '2006-02-16T02:30:53', '2005-05-31T03:41:37', '2005-06-08T07:05:37', '2'), - ('66', '415', '2006-02-16T02:30:53', '2005-08-01T08:13:22', '2005-08-06T04:45:22', '2'), - ('110', '2262', '2006-02-16T02:30:53', '2005-05-28T06:21:05', '2005-06-02T01:22:05', '2'), - ('323', '1383', '2006-02-16T02:30:53', '2005-08-01T04:06:03', '2005-08-05T05:59:03', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['10383', '5992', '13174', '14654', '12835', '4077', '5049', '15036', '6476', '11642', '12361', '9548', '3508', '6660', '14478', '6516', '5574', '4389', '13856', '14392', '12348', '2462', '12976', '1023', '14031', '7104', '6270', '7848', '13616', '5332', '15797', '1619', '6190', '8691', '4551', '9755', '782', '3582', '4294', '4318', '6233', '5942', '13274', '4456', '15848', '1826', '12008', '8676', '5539', '15365', '9242', '2607', '8935', '6405', '9628', '9518', '11742', '9137', '984', '5658', '7072', '9152', '4558', '8635', '15808', '8690', '3779', '10140', '959', '14254', '3252', '10431', '12829', '14787', '11638', '8970', '7249', '13615', '10593', '3417', '186', '14251', '3897', '12234', '4937', '13029', '3348', '451', '8836', '8262', '12701', '9816', '449', '14684', '15171', '12288', '4139', '4689', '10361', '12824']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('592', '4166', '2006-02-16T02:30:53', '2005-08-01T06:37:16', '2005-08-03T07:36:16', '2'), - ('54', '4216', '2006-02-16T02:30:53', '2005-07-11T01:06:21', '2005-07-13T19:15:21', '2'), - ('482', '2303', '2006-02-16T02:30:53', '2005-08-19T13:52:50', '2005-08-22T14:43:50', '2'), - ('173', '687', '2006-02-16T02:30:53', '2005-08-21T19:36:59', '2005-08-23T22:03:59', '2'), - ('124', '1477', '2006-02-16T02:30:53', '2005-08-19T01:47:45', '2005-08-26T00:58:45', '2'), - ('377', '2445', '2006-02-16T02:30:53', '2005-07-07T04:53:40', '2005-07-09T09:56:40', '2'), - ('144', '3336', '2006-02-16T02:30:53', '2005-07-09T03:54:12', '2005-07-11T22:39:12', '2'), - ('280', '874', '2006-02-16T02:30:53', '2005-08-22T09:36:00', '2005-08-23T08:12:00', '2'), - ('28', '978', '2006-02-16T02:30:53', '2005-07-12T01:37:48', '2005-07-12T20:21:48', '2'), - ('25', '3790', '2006-02-16T02:30:53', '2005-08-17T04:48:05', '2005-08-18T01:53:05', '2'), - ('250', '1418', '2006-02-16T02:30:53', '2005-08-18T07:47:31', '2005-08-22T12:08:31', '2'), - ('576', '3038', '2006-02-16T02:30:53', '2005-07-31T01:54:19', '2005-08-05T00:50:19', '2'), - ('34', '2381', '2006-02-16T02:30:53', '2005-07-06T00:24:25', '2005-07-10T05:38:25', '2'), - ('598', '446', '2006-02-16T02:30:53', '2005-07-12T11:20:12', '2005-07-20T12:58:12', '2'), - ('231', '2990', '2006-02-16T02:30:53', '2005-08-21T13:33:28', '2005-08-25T13:33:28', '2'), - ('291', '863', '2006-02-16T02:30:53', '2005-07-12T03:51:54', '2005-07-14T03:41:54', '2'), - ('163', '2307', '2006-02-16T02:30:53', '2005-07-10T03:54:38', '2005-07-19T07:20:38', '2'), - ('166', '1672', '2006-02-16T02:30:53', '2005-07-07T20:58:58', '2005-07-13T19:57:58', '2'), - ('407', '4196', '2006-02-16T02:30:53', '2005-08-20T14:49:32', '2005-08-29T12:37:32', '2'), - ('586', '847', '2006-02-16T02:30:53', '2005-08-21T10:19:25', '2005-08-28T15:57:25', '2'), - ('186', '434', '2006-02-16T02:30:53', '2005-08-18T07:21:47', '2005-08-25T04:41:47', '2'), - ('468', '2151', '2006-02-16T02:30:53', '2005-06-18T20:00:15', '2005-06-21T21:54:15', '2'), - ('592', '66', '2006-02-16T02:30:53', '2005-08-19T06:52:58', '2005-08-26T11:23:58', '2'), - ('227', '2483', '2006-02-16T02:30:53', '2005-05-31T03:26:50', '2005-06-05T08:19:50', '2'), - ('361', '440', '2006-02-16T02:30:53', '2005-08-20T21:24:24', '2005-08-23T21:47:24', '2'), - ('217', '118', '2006-02-16T02:30:53', '2005-07-27T05:15:25', '2005-08-01T05:36:25', '2'), - ('292', '2308', '2006-02-16T02:30:53', '2005-07-11T15:59:10', '2005-07-18T10:29:10', '2'), - ('509', '162', '2006-02-16T02:30:53', '2005-07-28T09:24:31', '2005-08-05T05:11:31', '2'), - ('194', '1694', '2006-02-16T02:30:53', '2005-08-20T06:30:33', '2005-08-27T09:29:33', '2'), - ('568', '3269', '2006-02-16T02:30:53', '2005-07-09T16:59:23', '2005-07-10T16:01:23', '2'), - ('503', '497', '2006-02-16T02:30:53', '2005-08-23T14:13:47', '2005-08-25T09:16:47', '2'), - ('232', '4258', '2006-02-16T02:30:53', '2005-06-16T07:14:13', '2005-06-19T05:50:13', '2'), - ('321', '2564', '2006-02-16T02:30:53', '2005-07-11T11:36:18', '2005-07-19T17:05:18', '2'), - ('446', '672', '2006-02-16T02:30:53', '2005-07-29T16:41:23', '2005-08-02T12:32:23', '2'), - ('494', '1160', '2006-02-16T02:30:53', '2005-07-08T04:36:21', '2005-07-17T10:23:21', '2'), - ('108', '86', '2006-02-16T02:30:53', '2005-07-31T09:24:55', '2005-08-07T06:00:55', '2'), - ('596', '2255', '2006-02-16T02:30:53', '2005-05-29T14:38:57', '2005-06-02T13:18:57', '2'), - ('297', '1866', '2006-02-16T02:30:53', '2005-07-06T04:10:35', '2005-07-11T01:29:35', '2'), - ('41', '2845', '2006-02-16T02:30:53', '2005-07-07T15:56:23', '2005-07-15T14:50:23', '2'), - ('321', '1607', '2006-02-16T02:30:53', '2005-07-07T17:47:50', '2005-07-14T12:15:50', '2'), - ('378', '3731', '2006-02-16T02:30:53', '2005-07-11T14:10:47', '2005-07-15T15:13:47', '2'), - ('317', '2861', '2006-02-16T02:30:53', '2005-07-10T22:47:17', '2005-07-17T01:54:17', '2'), - ('272', '704', '2006-02-16T02:30:53', '2005-08-19T17:50:03', '2005-08-20T14:39:03', '2'), - ('421', '3395', '2006-02-16T02:30:53', '2005-07-07T23:45:21', '2005-07-13T23:03:21', '2'), - ('336', '2141', '2006-02-16T02:30:53', '2005-08-23T15:41:12', '2005-08-26T10:29:12', '2'), - ('578', '421', '2006-02-16T02:30:53', '2005-06-16T21:53:52', '2005-06-25T18:46:52', '2'), - ('562', '865', '2006-02-16T02:30:53', '2005-08-17T19:16:18', '2005-08-18T14:24:18', '2'), - ('533', '283', '2006-02-16T02:30:53', '2005-07-29T15:59:06', '2005-08-05T19:12:06', '2'), - ('90', '3217', '2006-02-16T02:30:53', '2005-07-10T02:42:58', '2005-07-16T02:27:58', '2'), - ('327', '3382', '2006-02-16T02:30:53', '2005-08-22T21:42:17', '2005-09-01T03:14:17', '2'), - ('306', '755', '2006-02-16T02:30:53', '2005-07-30T14:03:58', '2005-08-02T18:09:58', '2'), - ('340', '3922', '2006-02-16T02:30:53', '2005-06-19T06:55:01', '2005-06-25T03:21:01', '2'), - ('76', '285', '2006-02-16T02:30:53', '2005-07-30T02:38:45', '2005-08-02T07:11:45', '2'), - ('357', '3983', '2006-02-16T02:30:53', '2005-07-11T22:53:12', '2005-07-18T23:02:12', '2'), - ('565', '1387', '2006-02-16T02:30:53', '2005-07-31T04:51:11', '2005-07-31T23:11:11', '2'), - ('215', '2714', '2006-02-16T02:30:53', '2005-07-31T00:43:26', '2005-08-04T19:12:26', '2'), - ('470', '596', '2006-02-16T02:30:53', '2005-08-17T08:48:43', '2005-08-23T07:18:43', '2'), - ('459', '840', '2006-02-16T02:30:53', '2005-07-30T10:09:24', '2005-08-06T04:30:24', '2'), - ('262', '2305', '2006-02-16T02:30:53', '2005-05-30T22:17:17', '2005-06-01T20:15:17', '2'), - ('165', '4402', '2006-02-16T02:30:53', '2005-07-10T07:34:08', '2005-07-19T04:21:08', '2'), - ('260', '3899', '2006-02-16T02:30:53', '2005-07-27T04:02:33', '2005-07-28T09:26:33', '2'), - ('595', '3607', '2006-02-16T02:30:53', '2005-07-30T10:51:27', '2005-07-31T06:38:27', '2'), - ('448', '828', '2006-02-16T02:30:53', '2005-07-08T04:55:26', '2005-07-09T10:53:26', '2'), - ('383', '2894', '2006-02-16T02:30:53', '2005-07-29T14:22:48', '2005-08-01T11:59:48', '2'), - ('446', '1663', '2006-02-16T02:30:53', '2005-08-23T14:38:37', '2005-08-27T14:45:37', '2'), - ('291', '1292', '2006-02-16T02:30:53', '2005-07-29T16:39:28', '2005-08-01T14:03:28', '2'), - ('583', '634', '2006-02-16T02:30:53', '2005-07-06T13:46:36', '2005-07-10T15:49:36', '2'), - ('550', '2494', '2006-02-16T02:30:53', '2005-07-31T22:03:20', '2005-08-07T23:15:20', '2'), - ('535', '3108', '2006-02-16T02:30:53', '2005-05-30T18:07:00', '2005-06-02T14:37:00', '2'), - ('589', '1549', '2006-02-16T02:30:53', '2005-08-21T05:51:28', '2005-08-29T06:05:28', '2'), - ('213', '2009', '2006-02-16T02:30:53', '2005-06-21T03:25:26', '2005-06-24T00:38:26', '2'), - ('138', '1074', '2006-02-16T02:30:53', '2005-08-01T08:41:54', '2005-08-07T09:44:54', '2'), - ('326', '1129', '2006-02-16T02:30:53', '2005-08-19T01:38:18', '2005-08-25T22:23:18', '2'), - ('38', '2634', '2006-02-16T02:30:53', '2005-08-22T00:25:59', '2005-08-28T22:30:59', '2'), - ('152', '3421', '2006-02-16T02:30:53', '2005-08-17T04:39:09', '2005-08-25T06:42:09', '2'), - ('313', '2940', '2006-02-16T02:30:53', '2005-07-30T04:02:05', '2005-08-07T03:40:05', '2'), - ('425', '2441', '2006-02-16T02:30:53', '2005-07-27T10:39:53', '2005-07-28T14:48:53', '2'), - ('539', '1864', '2006-02-16T02:30:53', '2005-08-20T06:28:53', '2005-08-27T11:40:53', '2'), - ('144', '1886', '2006-02-16T02:30:53', '2005-08-01T14:13:19', '2005-08-06T08:48:19', '2'), - ('282', '874', '2006-02-16T02:30:53', '2005-06-21T17:06:20', '2005-06-23T17:00:20', '2'), - ('468', '1799', '2006-02-16T02:30:53', '2005-05-26T05:32:52', '2005-06-03T07:19:52', '2'), - ('486', '139', '2006-02-16T02:30:53', '2005-08-21T05:42:20', '2005-08-26T06:20:20', '2'), - ('277', '14', '2006-02-16T02:30:53', '2005-07-06T19:11:43', '2005-07-11T21:50:43', '2'), - ('352', '3823', '2006-02-16T02:30:53', '2005-08-18T03:17:33', '2005-08-25T04:44:33', '2'), - ('273', '33', '2006-02-16T02:30:53', '2005-07-08T22:29:59', '2005-07-15T21:51:59', '2'), - ('293', '3283', '2006-02-16T02:30:53', '2005-08-19T08:28:04', '2005-08-22T12:25:04', '2'), - ('16', '2945', '2006-02-16T02:30:53', '2005-06-21T11:16:42', '2005-06-27T13:50:42', '2'), - ('87', '205', '2006-02-16T02:30:53', '2005-05-27T19:27:54', '2005-05-29T01:07:54', '2'), - ('14', '3265', '2006-02-16T02:30:53', '2005-07-29T22:46:08', '2005-08-02T19:53:08', '2'), - ('563', '1341', '2006-02-16T02:30:53', '2005-07-29T01:11:18', '2005-08-02T05:17:18', '2'), - ('489', '2337', '2006-02-16T02:30:53', '2005-08-18T20:26:47', '2005-08-26T23:36:47', '2'), - ('3', '4560', '2006-02-16T02:30:53', '2005-07-31T11:32:58', '2005-08-04T17:12:58', '2'), - ('172', '2469', '2006-02-16T02:30:53', '2005-05-27T19:13:15', '2005-06-04T01:08:15', '2'), - ('369', '3593', '2006-02-16T02:30:53', '2005-08-21T20:28:26', '2005-08-28T19:01:26', '2'), - ('119', '1201', '2006-02-16T02:30:53', '2005-08-22T15:23:59', '2005-08-28T12:05:59', '2'), - ('523', '4401', '2006-02-16T02:30:53', '2005-08-18T05:01:20', '2005-08-25T09:51:20', '2'), - ('509', '2094', '2006-02-16T02:30:53', '2005-07-07T08:17:35', '2005-07-14T14:01:35', '2'), - ('364', '2519', '2006-02-16T02:30:53', '2005-07-08T11:03:47', '2005-07-16T06:07:47', '2'), - ('529', '318', '2006-02-16T02:30:53', '2005-08-01T05:53:49', '2005-08-10T00:42:49', '2'), - ('247', '1875', '2006-02-16T02:30:53', '2005-08-19T01:18:00', '2005-08-22T01:12:00', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['13280', '6581', '3721', '13988', '14588', '1714', '15705', '11859', '1717', '9479', '10324', '2015', '4193', '11577', '12377', '6260', '7229', '8928', '3026', '6974', '8891', '10545', '4284', '2256', '15090', '11518', '8777', '12353', '1969', '14256', '12649', '15092', '12172', '6707', '14513', '9892', '11007', '865', '5010', '5064', '4175', '9930', '2606', '4664', '10454', '7316', '14951', '8571', '2489', '8822', '12580', '6078', '4306', '3590', '15211', '370', '2475', '6120', '932', '11321', '6746', '14067', '9718', '13237', '3840', '2538', '1018', '12295', '5986', '1243', '662', '5028', '7133', '7178', '2433', '2681', '4872', '14007', '13924', '10427', '5605', '5876', '129', '8846', '13819', '7399', '5140', '10520', '42', '14688', '672', '239', '3914', '6236', '2034', '6501', '1250', '14751', '6421', '222']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('368', '218', '2006-02-16T02:30:53', '2005-08-19T18:02:51', '2005-08-21T23:17:51', '2'), - ('468', '2121', '2006-02-16T02:30:53', '2005-07-12T06:26:49', '2005-07-14T05:07:49', '2'), - ('226', '2654', '2006-02-16T02:30:53', '2005-07-06T11:10:09', '2005-07-11T07:45:09', '2'), - ('466', '3567', '2006-02-16T02:30:53', '2005-08-20T19:21:28', '2005-08-21T22:20:28', '2'), - ('219', '1350', '2006-02-16T02:30:53', '2005-08-21T17:25:53', '2005-08-28T21:47:53', '2'), - ('477', '535', '2006-02-16T02:30:53', '2005-06-16T14:29:59', '2005-06-24T17:27:59', '2'), - ('356', '936', '2006-02-16T02:30:53', '2005-08-23T10:32:52', '2005-08-29T13:18:52', '2'), - ('144', '423', '2006-02-16T02:30:53', '2005-08-17T13:51:20', '2005-08-21T13:47:20', '2'), - ('277', '3007', '2006-02-16T02:30:53', '2005-06-16T14:47:16', '2005-06-19T10:11:16', '2'), - ('308', '3461', '2006-02-16T02:30:53', '2005-07-30T23:22:09', '2005-07-31T22:26:09', '2'), - ('25', '523', '2006-02-16T02:30:53', '2005-08-01T04:49:06', '2005-08-09T08:04:06', '2'), - ('484', '3776', '2006-02-16T02:30:53', '2005-06-17T12:16:29', '2005-06-18T14:40:29', '2'), - ('445', '3791', '2006-02-16T02:30:53', '2005-07-07T10:57:21', '2005-07-09T07:33:21', '2'), - ('219', '4106', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('31', '4564', '2006-02-16T02:30:53', '2005-08-18T08:26:05', '2005-08-23T02:51:05', '2'), - ('454', '4308', '2006-02-16T02:30:53', '2005-07-11T15:26:29', '2005-07-13T17:37:29', '2'), - ('182', '978', '2006-02-16T02:30:53', '2005-07-27T10:00:54', '2005-07-28T13:58:54', '2'), - ('366', '706', '2006-02-16T02:30:53', '2005-07-30T02:18:19', '2005-08-05T00:49:19', '2'), - ('347', '4032', '2006-02-16T02:30:53', '2005-06-20T11:48:00', '2005-06-21T12:51:00', '2'), - ('122', '2924', '2006-02-16T02:30:53', '2005-07-27T00:39:16', '2005-08-04T01:59:16', '2'), - ('435', '4093', '2006-02-16T02:30:53', '2005-07-30T00:46:55', '2005-08-06T23:32:55', '2'), - ('425', '4230', '2006-02-16T02:30:53', '2005-08-01T12:37:46', '2005-08-04T16:02:46', '2'), - ('521', '1313', '2006-02-16T02:30:53', '2005-07-07T15:31:57', '2005-07-09T10:20:57', '2'), - ('93', '1863', '2006-02-16T02:30:53', '2005-06-18T05:21:56', '2005-06-27T02:06:56', '2'), - ('582', '2918', '2006-02-16T02:30:53', '2005-08-22T11:34:33', '2005-08-31T06:09:33', '2'), - ('407', '3297', '2006-02-16T02:30:53', '2005-08-16T23:59:49', '2005-08-17T22:51:49', '2'), - ('382', '2462', '2006-02-16T02:30:53', '2005-07-29T20:10:21', '2005-07-30T20:32:21', '2'), - ('141', '1594', '2006-02-16T02:30:53', '2005-08-18T07:33:08', '2005-08-21T03:42:08', '2'), - ('337', '4450', '2006-02-16T02:30:53', '2005-06-17T09:22:22', '2005-06-21T05:31:22', '2'), - ('331', '2922', '2006-02-16T02:30:53', '2005-08-21T05:52:27', '2005-08-29T02:10:27', '2'), - ('530', '3201', '2006-02-16T02:30:53', '2005-08-18T18:31:47', '2005-08-22T21:07:47', '2'), - ('464', '2418', '2006-02-16T02:30:53', '2005-08-22T11:36:16', '2005-08-28T09:49:16', '2'), - ('226', '1162', '2006-02-16T02:30:53', '2005-08-18T01:07:00', '2005-08-22T21:01:00', '2'), - ('80', '406', '2006-02-16T02:30:53', '2005-07-12T13:07:55', '2005-07-16T16:26:55', '2'), - ('185', '4265', '2006-02-16T02:30:53', '2005-08-21T14:51:35', '2005-08-24T13:24:35', '2'), - ('251', '1045', '2006-02-16T02:30:53', '2005-07-31T14:06:25', '2005-08-03T18:11:25', '2'), - ('98', '4172', '2006-02-16T02:30:53', '2005-08-02T05:05:53', '2005-08-05T01:56:53', '2'), - ('154', '3183', '2006-02-16T02:30:53', '2005-05-30T03:39:44', '2005-06-07T08:10:44', '2'), - ('574', '1999', '2006-02-16T02:30:53', '2005-07-09T01:33:23', '2005-07-14T04:00:23', '2'), - ('512', '373', '2006-02-16T02:30:53', '2005-07-09T04:38:51', '2005-07-18T00:33:51', '2'), - ('8', '1979', '2006-02-16T02:30:53', '2005-07-07T10:02:03', '2005-07-10T06:09:03', '2'), - ('304', '4491', '2006-02-16T02:30:53', '2005-07-31T15:18:03', '2005-08-01T12:36:03', '2'), - ('364', '4133', '2006-02-16T02:30:53', '2005-06-19T06:51:32', '2005-06-21T03:15:32', '2'), - ('546', '1318', '2006-02-16T02:30:53', '2005-07-08T10:01:28', '2005-07-12T10:37:28', '2'), - ('9', '397', '2006-02-16T02:30:53', '2005-08-01T09:14:00', '2005-08-04T04:52:00', '2'), - ('114', '3344', '2006-02-16T02:30:53', '2005-07-27T13:19:03', '2005-07-28T07:43:03', '2'), - ('197', '2800', '2006-02-16T02:30:53', '2005-08-22T06:19:37', '2005-08-30T05:51:37', '2'), - ('407', '1778', '2006-02-16T02:30:53', '2005-07-29T11:48:39', '2005-08-03T06:35:39', '2'), - ('382', '4012', '2006-02-16T02:30:53', '2005-06-18T22:00:44', '2005-06-22T02:06:44', '2'), - ('35', '744', '2006-02-16T02:30:53', '2005-07-29T22:20:21', '2005-08-06T03:00:21', '2'), - ('53', '1197', '2006-02-16T02:30:53', '2005-08-18T15:49:08', '2005-08-24T11:03:08', '2'), - ('91', '3985', '2006-02-16T02:30:53', '2005-07-11T05:06:52', '2005-07-17T06:13:52', '2'), - ('210', '1219', '2006-02-16T02:30:53', '2005-07-07T17:12:32', '2005-07-16T11:24:32', '2'), - ('283', '1510', '2006-02-16T02:30:53', '2005-07-06T04:35:12', '2005-07-10T05:14:12', '2'), - ('410', '3025', '2006-02-16T02:30:53', '2005-08-22T16:40:21', '2005-08-28T13:33:21', '2'), - ('22', '3347', '2006-02-16T02:30:53', '2005-05-27T07:49:43', '2005-06-05T06:39:43', '2'), - ('336', '889', '2006-02-16T02:30:53', '2005-06-18T20:52:46', '2005-06-21T19:40:46', '2'), - ('268', '3299', '2006-02-16T02:30:53', '2005-07-11T07:49:53', '2005-07-19T04:56:53', '2'), - ('198', '719', '2006-02-16T02:30:53', '2005-05-30T12:55:36', '2005-05-31T10:30:36', '2'), - ('266', '205', '2006-02-16T02:30:53', '2005-08-02T16:15:07', '2005-08-04T20:35:07', '2'), - ('537', '3127', '2006-02-16T02:30:53', '2005-07-12T14:33:01', '2005-07-17T19:52:01', '2'), - ('259', '1376', '2006-02-16T02:30:53', '2005-08-20T22:49:23', '2005-08-29T22:28:23', '2'), - ('23', '2747', '2006-02-16T02:30:53', '2005-07-31T08:25:03', '2005-08-08T04:16:03', '2'), - ('169', '1272', '2006-02-16T02:30:53', '2005-08-19T16:18:36', '2005-08-25T15:22:36', '2'), - ('468', '4384', '2006-02-16T02:30:53', '2005-07-06T16:30:59', '2005-07-15T22:08:59', '2'), - ('472', '1287', '2006-02-16T02:30:53', '2005-06-19T01:56:59', '2005-06-25T00:54:59', '2'), - ('594', '1930', '2006-02-16T02:30:53', '2005-05-31T02:53:42', '2005-06-03T00:47:42', '2'), - ('532', '1651', '2006-02-16T02:30:53', '2005-08-18T05:15:46', '2005-08-26T02:23:46', '2'), - ('171', '1624', '2006-02-16T02:30:53', '2005-07-11T00:54:56', '2005-07-13T22:52:56', '2'), - ('107', '2629', '2006-02-16T02:30:53', '2005-06-15T05:07:32', '2005-06-21T08:17:32', '2'), - ('166', '2968', '2006-02-16T02:30:53', '2005-05-28T21:09:31', '2005-06-01T19:00:31', '2'), - ('30', '4531', '2006-02-16T02:30:53', '2005-07-09T02:34:45', '2005-07-14T20:45:45', '2'), - ('496', '2995', '2006-02-16T02:30:53', '2005-07-27T06:29:23', '2005-07-29T03:20:23', '2'), - ('31', '1899', '2006-02-16T02:30:53', '2005-07-27T08:09:25', '2005-07-29T13:00:25', '2'), - ('356', '937', '2006-02-16T02:30:53', '2005-06-18T18:10:17', '2005-06-23T14:46:17', '2'), - ('196', '2704', '2006-02-16T02:30:53', '2005-06-19T12:15:27', '2005-06-21T16:48:27', '2'), - ('103', '1836', '2006-02-16T02:30:53', '2005-07-08T19:23:16', '2005-07-10T14:17:16', '2'), - ('284', '374', '2006-02-16T02:30:53', '2005-08-20T20:22:47', '2005-08-28T20:40:47', '2'), - ('444', '3066', '2006-02-16T02:30:53', '2005-08-20T17:05:18', '2005-08-23T16:54:18', '2'), - ('356', '2978', '2006-02-16T02:30:53', '2005-08-01T08:30:11', '2005-08-07T06:18:11', '2'), - ('273', '2964', '2006-02-16T02:30:53', '2005-07-10T05:06:45', '2005-07-15T02:51:45', '2'), - ('578', '4445', '2006-02-16T02:30:53', '2005-07-10T19:07:15', '2005-07-14T17:29:15', '2'), - ('23', '4154', '2006-02-16T02:30:53', '2005-05-25T21:20:03', '2005-06-04T01:25:03', '2'), - ('108', '2912', '2006-02-16T02:30:53', '2005-07-29T23:10:28', '2005-08-03T22:07:28', '2'), - ('296', '1459', '2006-02-16T02:30:53', '2005-08-20T13:23:15', '2005-08-22T16:02:15', '2'), - ('526', '1682', '2006-02-16T02:30:53', '2005-07-27T16:16:02', '2005-08-03T18:02:02', '2'), - ('303', '947', '2006-02-16T02:30:53', '2005-07-09T08:04:59', '2005-07-11T08:28:59', '2'), - ('543', '4396', '2006-02-16T02:30:53', '2005-08-01T11:45:58', '2005-08-06T17:28:58', '2'), - ('523', '380', '2006-02-16T02:30:53', '2005-05-25T05:24:58', '2005-05-31T02:47:58', '2'), - ('219', '2573', '2006-02-16T02:30:53', '2005-08-21T20:32:37', '2005-08-27T00:06:37', '2'), - ('306', '697', '2006-02-16T02:30:53', '2005-05-28T22:05:29', '2005-06-06T02:10:29', '2'), - ('49', '131', '2006-02-16T02:30:53', '2005-05-26T12:30:26', '2005-06-01T13:26:26', '2'), - ('159', '4092', '2006-02-16T02:30:53', '2005-07-06T20:11:10', '2005-07-14T14:42:10', '2'), - ('338', '3813', '2006-02-16T02:30:53', '2005-07-11T14:18:17', '2005-07-14T08:47:17', '2'), - ('587', '1512', '2006-02-16T02:30:53', '2005-06-17T13:27:16', '2005-06-22T08:53:16', '2'), - ('219', '2851', '2006-02-16T02:30:53', '2005-07-12T03:11:55', '2005-07-16T02:08:55', '2'), - ('38', '4360', '2006-02-16T02:30:53', '2005-06-15T05:55:40', '2005-06-23T03:11:40', '2'), - ('195', '1156', '2006-02-16T02:30:53', '2005-08-21T23:11:23', '2005-08-30T20:01:23', '2'), - ('479', '4477', '2006-02-16T02:30:53', '2005-07-11T23:45:25', '2005-07-15T20:45:25', '2'), - ('83', '2745', '2006-02-16T02:30:53', '2005-05-26T10:14:38', '2005-05-31T08:36:38', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['5473', '4827', '12037', '1929', '15566', '4967', '8236', '14826', '7437', '7493', '4744', '3148', '4846', '107', '9778', '13435', '12665', '717', '10359', '9867', '1871', '3143', '14962', '2531', '6009', '3046', '4363', '4226', '3015', '78', '3276', '8698', '1451', '2598', '15315', '1637', '13058', '11225', '8338', '14423', '12785', '604', '409', '15925', '11177', '1106', '8656', '11200', '5369', '4056', '5682', '4159', '14119', '3266', '2774', '7766', '11942', '3364', '7427', '12839', '3228', '15136', '6232', '9041', '5568', '15533', '4741', '7232', '14447', '13140', '4648', '5327', '2425', '729', '10831', '10364', '6124', '14348', '10235', '1577', '14936', '9116', '6589', '11796', '1668', '9190', '13404', '5785', '13959', '1094', '13198', '9697', '3307', '15831', '2305', '14863', '14085', '12747', '9919', '4001']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('51', '4283', '2006-02-16T02:30:53', '2005-07-09T23:19:11', '2005-07-19T02:30:11', '2'), - ('110', '4455', '2006-02-16T02:30:53', '2005-07-08T17:46:30', '2005-07-11T14:12:30', '2'), - ('356', '766', '2006-02-16T02:30:53', '2005-08-17T20:21:35', '2005-08-22T17:16:35', '2'), - ('327', '573', '2006-02-16T02:30:53', '2005-06-17T06:49:30', '2005-06-22T12:07:30', '2'), - ('76', '4344', '2006-02-16T02:30:53', '2005-08-23T05:17:23', '2005-09-01T08:09:23', '2'), - ('339', '108', '2006-02-16T02:30:53', '2005-07-08T23:48:03', '2005-07-15T23:51:03', '2'), - ('369', '1901', '2006-02-16T02:30:53', '2005-07-29T00:27:04', '2005-07-31T05:02:04', '2'), - ('426', '4023', '2006-02-16T02:30:53', '2005-08-22T01:32:14', '2005-08-23T03:52:14', '2'), - ('135', '2617', '2006-02-16T02:30:53', '2005-07-27T17:39:18', '2005-07-28T18:33:18', '2'), - ('177', '2868', '2006-02-16T02:30:53', '2005-07-27T19:55:46', '2005-08-02T19:46:46', '2'), - ('507', '2948', '2006-02-16T02:30:53', '2005-07-08T13:43:57', '2005-07-12T09:21:57', '2'), - ('202', '4490', '2006-02-16T02:30:53', '2005-06-20T20:27:18', '2005-06-24T20:30:18', '2'), - ('556', '417', '2006-02-16T02:30:53', '2005-07-08T18:29:05', '2005-07-10T22:33:05', '2'), - ('317', '2833', '2006-02-16T02:30:53', '2005-05-25T18:28:09', '2005-06-03T22:46:09', '2'), - ('230', '304', '2006-02-16T02:30:53', '2005-07-31T10:02:04', '2005-08-04T07:44:04', '2'), - ('30', '3919', '2006-02-16T02:30:53', '2005-08-19T23:35:44', '2005-08-24T18:14:44', '2'), - ('410', '1701', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('412', '1383', '2006-02-16T02:30:53', '2005-05-29T04:37:44', '2005-05-30T05:48:44', '2'), - ('369', '259', '2006-02-16T02:30:53', '2005-08-01T05:52:21', '2005-08-06T05:52:21', '2'), - ('83', '2485', '2006-02-16T02:30:53', '2005-07-31T13:17:04', '2005-08-05T07:17:04', '2'), - ('204', '481', '2006-02-16T02:30:53', '2005-06-17T02:25:12', '2005-06-23T03:16:12', '2'), - ('215', '1355', '2006-02-16T02:30:53', '2005-06-20T20:01:52', '2005-06-26T19:26:52', '2'), - ('449', '3104', '2006-02-16T02:30:53', '2005-08-22T06:37:43', '2005-08-29T03:44:43', '2'), - ('368', '768', '2006-02-16T02:30:53', '2005-06-19T01:20:49', '2005-06-22T01:50:49', '2'), - ('470', '494', '2006-02-16T02:30:53', '2005-07-11T01:51:58', '2005-07-18T07:12:58', '2'), - ('559', '471', '2006-02-16T02:30:53', '2005-06-20T12:42:59', '2005-06-26T17:40:59', '2'), - ('168', '3202', '2006-02-16T02:30:53', '2005-07-07T19:43:28', '2005-07-13T00:15:28', '2'), - ('57', '1692', '2006-02-16T02:30:53', '2005-07-07T12:37:56', '2005-07-09T08:48:56', '2'), - ('23', '1311', '2006-02-16T02:30:53', '2005-06-20T10:48:56', '2005-06-26T11:30:56', '2'), - ('135', '4067', '2006-02-16T02:30:53', '2005-05-25T11:35:18', '2005-05-31T12:48:18', '2'), - ('425', '1890', '2006-02-16T02:30:53', '2005-06-21T05:35:52', '2005-06-29T03:26:52', '2'), - ('324', '2973', '2006-02-16T02:30:53', '2005-07-29T16:52:17', '2005-08-04T13:20:17', '2'), - ('18', '3560', '2006-02-16T02:30:53', '2005-06-15T19:30:18', '2005-06-19T19:22:18', '2'), - ('265', '2079', '2006-02-16T02:30:53', '2005-06-19T05:59:57', '2005-06-24T11:44:57', '2'), - ('1', '312', '2006-02-16T02:30:53', '2005-08-22T20:03:46', '2005-08-30T01:51:46', '2'), - ('212', '906', '2006-02-16T02:30:53', '2005-06-16T08:29:58', '2005-06-23T04:55:58', '2'), - ('24', '2437', '2006-02-16T02:30:53', '2005-08-19T09:40:53', '2005-08-26T05:48:53', '2'), - ('159', '3721', '2006-02-16T02:30:53', '2005-08-02T12:43:27', '2005-08-04T18:41:27', '2'), - ('389', '2257', '2006-02-16T02:30:53', '2005-07-29T04:40:39', '2005-08-07T04:40:39', '2'), - ('521', '2873', '2006-02-16T02:30:53', '2005-08-21T11:23:59', '2005-08-26T11:52:59', '2'), - ('145', '4190', '2006-02-16T02:30:53', '2005-08-19T00:05:49', '2005-08-21T04:39:49', '2'), - ('426', '1585', '2006-02-16T02:30:53', '2005-05-28T14:37:07', '2005-06-03T11:03:07', '2'), - ('220', '3652', '2006-02-16T02:30:53', '2005-05-27T14:10:58', '2005-06-02T10:40:58', '2'), - ('440', '3394', '2006-02-16T02:30:53', '2005-08-23T18:15:06', '2005-08-26T18:09:06', '2'), - ('2', '1149', '2006-02-16T02:30:53', '2005-08-02T10:43:48', '2005-08-10T10:55:48', '2'), - ('109', '4185', '2006-02-16T02:30:53', '2005-05-31T14:36:52', '2005-06-01T14:33:52', '2'), - ('460', '1385', '2006-02-16T02:30:53', '2005-07-29T15:05:52', '2005-07-31T20:57:52', '2'), - ('98', '2730', '2006-02-16T02:30:53', '2005-08-02T11:48:36', '2005-08-07T08:35:36', '2'), - ('538', '1550', '2006-02-16T02:30:53', '2005-07-09T18:42:16', '2005-07-12T18:16:16', '2'), - ('360', '4211', '2006-02-16T02:30:53', '2005-07-07T03:57:36', '2005-07-09T08:53:36', '2'), - ('302', '17', '2006-02-16T02:30:53', '2005-07-10T08:51:39', '2005-07-12T14:44:39', '2'), - ('62', '3625', '2006-02-16T02:30:53', '2005-07-07T09:10:57', '2005-07-09T10:19:57', '2'), - ('53', '129', '2006-02-16T02:30:53', '2005-08-21T01:15:59', '2005-08-27T23:36:59', '2'), - ('175', '2533', '2006-02-16T02:30:53', '2005-06-21T04:49:07', '2005-06-26T05:19:07', '2'), - ('299', '2809', '2006-02-16T02:30:53', '2005-06-19T18:05:11', '2005-06-21T16:21:11', '2'), - ('292', '2774', '2006-02-16T02:30:53', '2005-07-28T06:41:57', '2005-08-06T11:21:57', '2'), - ('576', '4094', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('201', '2329', '2006-02-16T02:30:53', '2005-06-21T12:37:46', '2005-06-28T07:18:46', '2'), - ('442', '2548', '2006-02-16T02:30:53', '2005-07-27T17:20:16', '2005-08-03T20:38:16', '2'), - ('360', '1970', '2006-02-16T02:30:53', '2005-08-19T01:53:43', '2005-08-28T02:27:43', '2'), - ('535', '2489', '2006-02-16T02:30:53', '2005-06-21T02:20:24', '2005-06-29T00:50:24', '2'), - ('435', '2606', '2006-02-16T02:30:53', '2005-08-22T13:19:25', '2005-08-24T07:28:25', '2'), - ('590', '2492', '2006-02-16T02:30:53', '2005-07-11T14:08:27', '2005-07-20T19:34:27', '2'), - ('454', '1103', '2006-02-16T02:30:53', '2005-07-30T06:32:36', '2005-08-01T10:28:36', '2'), - ('424', '1130', '2006-02-16T02:30:53', '2005-07-10T03:36:56', '2005-07-11T08:35:56', '2'), - ('400', '1895', '2006-02-16T02:30:53', '2005-08-23T03:54:39', '2005-08-26T08:27:39', '2'), - ('260', '516', '2006-02-16T02:30:53', '2005-07-08T13:31:23', '2005-07-17T12:02:23', '2'), - ('306', '1147', '2006-02-16T02:30:53', '2005-07-27T10:04:19', '2005-07-28T09:43:19', '2'), - ('584', '1889', '2006-02-16T02:30:53', '2005-08-21T12:12:05', '2005-08-27T14:47:05', '2'), - ('323', '4210', '2006-02-16T02:30:53', '2005-08-19T12:35:56', '2005-08-27T18:24:56', '2'), - ('444', '3490', '2006-02-16T02:30:53', '2005-07-08T09:31:27', '2005-07-13T03:55:27', '2'), - ('547', '3657', '2006-02-16T02:30:53', '2005-07-09T16:39:49', '2005-07-12T18:47:49', '2'), - ('579', '2630', '2006-02-16T02:30:53', '2005-06-18T17:37:45', '2005-06-27T18:40:45', '2'), - ('323', '1688', '2006-02-16T02:30:53', '2005-05-29T06:35:13', '2005-06-04T03:23:13', '2'), - ('78', '1496', '2006-02-16T02:30:53', '2005-08-01T23:22:45', '2005-08-07T01:05:45', '2'), - ('317', '1842', '2006-02-16T02:30:53', '2005-08-01T06:06:49', '2005-08-09T06:05:49', '2'), - ('368', '2022', '2006-02-16T02:30:53', '2005-07-11T08:02:32', '2005-07-12T05:58:32', '2'), - ('496', '885', '2006-02-16T02:30:53', '2005-08-21T08:54:26', '2005-08-24T02:55:26', '2'), - ('30', '2850', '2006-02-16T02:30:53', '2005-08-01T01:57:48', '2005-08-10T07:38:48', '2'), - ('327', '367', '2006-02-16T02:30:53', '2005-06-16T04:03:28', '2005-06-24T22:40:28', '2'), - ('241', '3710', '2006-02-16T02:30:53', '2005-08-22T05:51:26', '2005-08-29T10:21:26', '2'), - ('446', '2917', '2006-02-16T02:30:53', '2005-07-30T09:19:41', '2005-08-03T08:01:41', '2'), - ('424', '1595', '2006-02-16T02:30:53', '2005-07-12T07:06:29', '2005-07-14T12:06:29', '2'), - ('435', '3983', '2006-02-16T02:30:53', '2005-08-17T11:16:47', '2005-08-18T16:55:47', '2'), - ('569', '2483', '2006-02-16T02:30:53', '2005-06-16T10:19:52', '2005-06-23T12:22:52', '2'), - ('177', '4421', '2006-02-16T02:30:53', '2005-07-30T12:24:17', '2005-08-03T07:41:17', '2'), - ('414', '416', '2006-02-16T02:30:53', '2005-08-19T22:18:42', '2005-08-23T16:29:42', '2'), - ('211', '142', '2006-02-16T02:30:53', '2005-07-10T14:06:03', '2005-07-17T17:59:03', '2'), - ('142', '2283', '2006-02-16T02:30:53', '2005-08-20T18:16:21', '2005-08-22T13:56:21', '2'), - ('547', '3810', '2006-02-16T02:30:53', '2005-05-31T13:03:49', '2005-06-05T14:30:49', '2'), - ('169', '4273', '2006-02-16T02:30:53', '2005-08-19T14:47:18', '2005-08-21T18:09:18', '2'), - ('479', '762', '2006-02-16T02:30:53', '2005-07-31T07:23:11', '2005-08-05T08:04:11', '2'), - ('85', '462', '2006-02-16T02:30:53', '2005-06-21T07:52:30', '2005-06-25T02:36:30', '2'), - ('401', '3123', '2006-02-16T02:30:53', '2005-08-23T15:21:19', '2005-08-24T15:47:19', '2'), - ('149', '622', '2006-02-16T02:30:53', '2005-06-18T08:31:18', '2005-06-24T06:18:18', '2'), - ('440', '779', '2006-02-16T02:30:53', '2005-08-22T02:57:04', '2005-08-30T03:24:04', '2'), - ('471', '3506', '2006-02-16T02:30:53', '2005-08-20T23:46:24', '2005-08-29T02:31:24', '2'), - ('549', '4075', '2006-02-16T02:30:53', '2005-08-18T22:28:22', '2005-08-22T22:25:22', '2'), - ('291', '3205', '2006-02-16T02:30:53', '2005-07-31T14:55:46', '2005-08-08T11:43:46', '2'), - ('120', '864', '2006-02-16T02:30:53', '2005-07-07T00:07:00', '2005-07-13T21:27:00', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['10314', '4305', '5038', '13921', '7001', '11290', '7420', '1237', '7590', '3863', '9705', '6971', '2728', '9759', '13896', '2946', '10375', '2048', '927', '9090', '6401', '4272', '9542', '10391', '13318', '7463', '15165', '1747', '12133', '5995', '3648', '13188', '9392', '4369', '8015', '12564', '14210', '13733', '9669', '11629', '3845', '906', '15295', '15821', '4029', '8610', '4760', '6883', '2421', '11079', '9123', '5194', '6492', '2116', '10285', '2360', '1311', '3626', '8055', '6051', '9621', '13744', '5754', '2488', '11038', '13276', '6788', '5693', '1155', '6070', '9522', '8131', '2793', '14133', '10603', '10966', '5448', '2907', '14375', '8622', '1626', '7204', '4759', '15443', '15398', '11853', '1143', '15485', '12539', '1135', '7201', '8930', '5073', '12331', '3119', '7376', '3597', '13835', '4502', '5282']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('252', '1548', '2006-02-16T02:30:53', '2005-08-01T04:31:18', '2005-08-06T01:49:18', '2'), - ('240', '3926', '2006-02-16T02:30:53', '2005-07-07T17:07:11', '2005-07-08T16:15:11', '2'), - ('10', '3086', '2006-02-16T02:30:53', '2005-07-09T03:12:52', '2005-07-17T22:27:52', '2'), - ('59', '3943', '2006-02-16T02:30:53', '2005-08-20T16:57:11', '2005-08-22T19:25:11', '2'), - ('240', '1460', '2006-02-16T02:30:53', '2005-07-27T01:25:34', '2005-07-31T23:30:34', '2'), - ('582', '425', '2006-02-16T02:30:53', '2005-08-02T14:57:44', '2005-08-09T19:36:44', '2'), - ('547', '3505', '2006-02-16T02:30:53', '2005-07-27T17:09:39', '2005-07-30T12:30:39', '2'), - ('49', '3249', '2006-02-16T02:30:53', '2005-06-15T04:44:10', '2005-06-23T07:00:10', '2'), - ('73', '2152', '2006-02-16T02:30:53', '2005-07-27T23:24:24', '2005-07-28T19:53:24', '2'), - ('481', '363', '2006-02-16T02:30:53', '2005-07-06T17:40:18', '2005-07-07T17:58:18', '2'), - ('28', '4158', '2006-02-16T02:30:53', '2005-07-31T07:40:33', '2005-08-01T03:50:33', '2'), - ('366', '3493', '2006-02-16T02:30:53', '2005-07-27T00:26:17', '2005-08-01T03:59:17', '2'), - ('408', '775', '2006-02-16T02:30:53', '2005-06-19T15:04:04', '2005-06-22T12:22:04', '2'), - ('574', '2950', '2006-02-16T02:30:53', '2005-07-31T09:25:57', '2005-08-07T12:56:57', '2'), - ('278', '1338', '2006-02-16T02:30:53', '2005-08-20T15:59:56', '2005-08-21T20:14:56', '2'), - ('213', '3737', '2006-02-16T02:30:53', '2005-06-20T05:50:40', '2005-06-21T00:42:40', '2'), - ('202', '857', '2006-02-16T02:30:53', '2005-08-01T06:26:22', '2005-08-06T02:51:22', '2'), - ('454', '2055', '2006-02-16T02:30:53', '2005-06-17T14:55:29', '2005-06-23T16:29:29', '2'), - ('167', '1158', '2006-02-16T02:30:53', '2005-05-30T12:16:40', '2005-05-31T16:20:40', '2'), - ('104', '3426', '2006-02-16T02:30:53', '2005-07-30T08:24:42', '2005-08-08T06:17:42', '2'), - ('35', '1427', '2006-02-16T02:30:53', '2005-07-11T22:44:34', '2005-07-12T22:18:34', '2'), - ('120', '488', '2006-02-16T02:30:53', '2005-07-07T14:39:20', '2005-07-13T08:57:20', '2'), - ('595', '2243', '2006-02-16T02:30:53', '2005-07-31T01:41:48', '2005-08-01T00:49:48', '2'), - ('357', '2203', '2006-02-16T02:30:53', '2005-08-01T06:49:05', '2005-08-04T01:51:05', '2'), - ('413', '1389', '2006-02-16T02:30:53', '2005-08-19T19:33:57', '2005-08-21T17:52:57', '2'), - ('284', '3676', '2006-02-16T02:30:53', '2005-07-27T18:48:32', '2005-07-29T23:54:32', '2'), - ('168', '3664', '2006-02-16T02:30:53', '2005-08-22T14:59:30', '2005-08-29T15:46:30', '2'), - ('273', '1661', '2006-02-16T02:30:53', '2005-06-16T16:53:33', '2005-06-25T21:48:33', '2'), - ('132', '1958', '2006-02-16T02:30:53', '2005-08-17T23:47:16', '2005-08-19T03:46:16', '2'), - ('360', '4357', '2006-02-16T02:30:53', '2005-07-11T01:15:39', '2005-07-20T05:01:39', '2'), - ('598', '2810', '2006-02-16T02:30:53', '2005-07-06T07:30:41', '2005-07-10T06:00:41', '2'), - ('472', '583', '2006-02-16T02:30:53', '2005-08-19T14:27:03', '2005-08-28T09:15:03', '2'), - ('29', '2797', '2006-02-16T02:30:53', '2005-07-30T19:50:13', '2005-08-03T22:38:13', '2'), - ('517', '3552', '2006-02-16T02:30:53', '2005-07-07T20:01:38', '2005-07-13T01:19:38', '2'), - ('23', '1814', '2006-02-16T02:30:53', '2005-07-28T15:33:03', '2005-07-30T15:32:03', '2'), - ('348', '263', '2006-02-16T02:30:53', '2005-08-18T15:11:35', '2005-08-22T11:45:35', '2'), - ('468', '1867', '2006-02-16T02:30:53', '2005-08-21T04:28:02', '2005-08-24T02:14:02', '2'), - ('85', '3994', '2006-02-16T02:30:53', '2005-08-20T10:25:12', '2005-08-21T10:49:12', '2'), - ('277', '4496', '2006-02-16T02:30:53', '2005-07-31T06:31:36', '2005-08-08T03:05:36', '2'), - ('299', '786', '2006-02-16T02:30:53', '2005-08-17T04:27:24', '2005-08-26T10:25:24', '2'), - ('28', '4495', '2006-02-16T02:30:53', '2005-07-06T16:38:14', '2005-07-09T14:59:14', '2'), - ('549', '1862', '2006-02-16T02:30:53', '2005-05-30T10:30:38', '2005-06-07T06:44:38', '2'), - ('186', '2164', '2006-02-16T02:30:53', '2005-08-22T19:36:21', '2005-08-31T00:07:21', '2'), - ('233', '1714', '2006-02-16T02:30:53', '2005-08-23T15:03:58', '2005-08-24T17:46:58', '2'), - ('518', '4075', '2006-02-16T02:30:53', '2005-07-07T02:19:44', '2005-07-15T02:30:44', '2'), - ('563', '4222', '2006-02-16T02:30:53', '2005-07-29T13:25:02', '2005-08-03T08:10:02', '2'), - ('177', '3718', '2006-02-16T02:30:53', '2005-07-08T14:48:07', '2005-07-10T12:41:07', '2'), - ('596', '468', '2006-02-16T02:30:53', '2005-07-12T20:50:48', '2005-07-19T16:00:48', '2'), - ('26', '3524', '2006-02-16T02:30:53', '2005-06-18T17:25:05', '2005-06-23T21:09:05', '2'), - ('29', '3185', '2006-02-16T02:30:53', '2005-08-02T07:29:10', '2005-08-07T01:59:10', '2'), - ('293', '3748', '2006-02-16T02:30:53', '2005-07-30T09:39:15', '2005-08-02T08:12:15', '2'), - ('202', '3809', '2006-02-16T02:30:53', '2005-07-09T10:31:34', '2005-07-15T08:50:34', '2'), - ('590', '466', '2006-02-16T02:30:53', '2005-07-12T02:28:40', '2005-07-17T05:58:40', '2'), - ('24', '2373', '2006-02-16T02:30:53', '2005-06-17T20:16:12', '2005-06-18T17:03:12', '2'), - ('167', '4523', '2006-02-16T02:30:53', '2005-08-01T03:35:11', '2005-08-05T03:55:11', '2'), - ('57', '37', '2006-02-16T02:30:53', '2005-06-18T13:11:13', '2005-06-23T15:32:13', '2'), - ('326', '3114', '2006-02-16T02:30:53', '2005-06-15T10:11:59', '2005-06-17T08:44:59', '2'), - ('337', '1599', '2006-02-16T02:30:53', '2005-07-06T06:15:35', '2005-07-10T10:18:35', '2'), - ('304', '4162', '2006-02-16T02:30:53', '2005-07-28T17:02:32', '2005-07-31T22:05:32', '2'), - ('435', '2675', '2006-02-16T02:30:53', '2005-07-11T03:46:41', '2005-07-11T22:36:41', '2'), - ('38', '325', '2006-02-16T02:30:53', '2005-07-31T04:21:08', '2005-08-08T03:50:08', '2'), - ('408', '2962', '2006-02-16T02:30:53', '2005-08-20T10:51:45', '2005-08-25T06:42:45', '2'), - ('291', '162', '2006-02-16T02:30:53', '2005-07-10T12:32:43', '2005-07-12T13:11:43', '2'), - ('403', '1338', '2006-02-16T02:30:53', '2005-06-18T21:38:26', '2005-06-24T02:08:26', '2'), - ('403', '4452', '2006-02-16T02:30:53', '2005-08-02T05:59:42', '2005-08-08T04:37:42', '2'), - ('516', '625', '2006-02-16T02:30:53', '2005-08-19T17:53:42', '2005-08-28T20:49:42', '2'), - ('460', '1162', '2006-02-16T02:30:53', '2005-07-12T16:33:44', '2005-07-20T15:38:44', '2'), - ('208', '2167', '2006-02-16T02:30:53', '2005-07-10T09:35:43', '2005-07-12T08:05:43', '2'), - ('251', '2048', '2006-02-16T02:30:53', '2005-05-31T22:17:11', '2005-06-04T20:27:11', '2'), - ('267', '1679', '2006-02-16T02:30:53', '2005-07-11T04:47:42', '2005-07-13T01:49:42', '2'), - ('294', '4266', '2006-02-16T02:30:53', '2005-07-31T00:55:11', '2005-08-03T06:41:11', '2'), - ('281', '437', '2006-02-16T02:30:53', '2005-07-28T19:55:21', '2005-08-02T21:52:21', '2'), - ('419', '732', '2006-02-16T02:30:53', '2005-06-19T18:52:37', '2005-06-25T19:45:37', '2'), - ('453', '2463', '2006-02-16T02:30:53', '2005-08-21T01:44:14', '2005-08-30T02:19:14', '2'), - ('394', '4024', '2006-02-16T02:30:53', '2005-08-01T14:30:35', '2005-08-05T11:13:35', '2'), - ('584', '478', '2006-02-16T02:30:53', '2005-08-02T04:00:47', '2005-08-08T01:58:47', '2'), - ('463', '646', '2006-02-16T02:30:53', '2005-07-09T22:11:14', '2005-07-15T21:08:14', '2'), - ('208', '2516', '2006-02-16T02:30:53', '2005-06-20T03:15:09', '2005-06-20T21:56:09', '2'), - ('550', '2507', '2006-02-16T02:30:53', '2005-08-21T09:46:35', '2005-08-26T10:24:35', '2'), - ('98', '4076', '2006-02-16T02:30:53', '2005-07-29T13:53:28', '2005-07-31T16:12:28', '2'), - ('260', '694', '2006-02-16T02:30:53', '2005-06-16T07:49:47', '2005-06-22T13:32:47', '2'), - ('531', '2512', '2006-02-16T02:30:53', '2005-07-27T09:02:31', '2005-08-03T08:56:31', '2'), - ('284', '3999', '2006-02-16T02:30:53', '2005-07-08T14:39:22', '2005-07-17T15:02:22', '2'), - ('598', '742', '2006-02-16T02:30:53', '2005-08-23T00:44:15', '2005-09-01T05:33:15', '2'), - ('109', '4451', '2006-02-16T02:30:53', '2005-08-22T23:10:49', '2005-08-28T00:49:49', '2'), - ('6', '3888', '2006-02-16T02:30:53', '2005-08-17T13:39:32', '2005-08-23T18:44:32', '2'), - ('209', '2632', '2006-02-16T02:30:53', '2005-05-31T19:53:03', '2005-06-06T20:56:03', '2'), - ('114', '281', '2006-02-16T02:30:53', '2005-08-23T02:04:57', '2005-08-28T07:05:57', '2'), - ('136', '3259', '2006-02-16T02:30:53', '2005-08-18T14:10:09', '2005-08-19T19:44:09', '2'), - ('122', '3118', '2006-02-16T02:30:53', '2005-05-31T19:15:11', '2005-06-01T14:44:11', '2'), - ('598', '482', '2006-02-16T02:30:53', '2005-07-27T08:57:40', '2005-08-04T09:55:40', '2'), - ('202', '1107', '2006-02-16T02:30:53', '2005-07-30T02:28:38', '2005-08-02T01:43:38', '2'), - ('408', '546', '2006-02-16T02:30:53', '2005-07-09T05:02:35', '2005-07-15T01:22:35', '2'), - ('483', '4565', '2006-02-16T02:30:53', '2005-08-18T06:47:19', '2005-08-25T05:51:19', '2'), - ('296', '683', '2006-02-16T02:30:53', '2005-06-20T18:11:44', '2005-06-27T16:14:44', '2'), - ('2', '488', '2006-02-16T02:30:53', '2005-07-27T15:23:02', '2005-08-04T10:35:02', '2'), - ('35', '4080', '2006-02-16T02:30:53', '2005-07-06T05:03:59', '2005-07-13T06:49:59', '2'), - ('143', '3738', '2006-02-16T02:30:53', '2005-08-20T14:06:33', '2005-08-26T12:15:33', '2'), - ('470', '225', '2006-02-16T02:30:53', '2005-07-08T02:12:04', '2005-07-15T02:19:04', '2'), - ('226', '4386', '2006-02-16T02:30:53', '2005-07-09T15:01:23', '2005-07-13T11:06:23', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['9751', '5654', '13053', '591', '6447', '12484', '9694', '6415', '10989', '3318', '7137', '8951', '14222', '11574', '5436', '5724', '9118', '5571', '11458', '11359', '6799', '11280', '4266', '7242', '12990', '1752', '12402', '6259', '13990', '13976', '5279', '12666', '4337', '2316', '1806', '9712', '7783', '7996', '13279', '1566', '117', '15402', '3089', '10536', '15878', '15234', '14842', '3614', '3924', '14758', '11565', '11459', '12050', '1024', '12520', '6768', '3782', '8648', '6886', '12871', '5287', '1846', '8189', '4753', '9987', '9716', '5934', '14330', '16', '2810', '7484', '912', '8555', '15354', '4301', '8177', '14626', '11684', '7723', '10189', '9918', '1641', '13951', '6601', '2571', '1643', '2111', '11985', '5047', '10029', '3704', '2868', '13779', '15059', '8490', '14146', '15569', '2407', '13667', '7670']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('202', '36', '2006-02-16T02:30:53', '2005-07-31T09:20:50', '2005-08-01T05:34:50', '2'), - ('490', '3419', '2006-02-16T02:30:53', '2005-07-10T07:24:46', '2005-07-14T07:39:46', '2'), - ('140', '2044', '2006-02-16T02:30:53', '2005-08-19T09:31:48', '2005-08-28T07:51:48', '2'), - ('19', '377', '2006-02-16T02:30:53', '2005-05-28T13:11:04', '2005-05-29T17:20:04', '2'), - ('482', '3945', '2006-02-16T02:30:53', '2005-07-12T00:45:17', '2005-07-18T05:56:17', '2'), - ('300', '3690', '2006-02-16T02:30:53', '2005-08-18T12:39:37', '2005-08-24T08:47:37', '2'), - ('508', '3447', '2006-02-16T02:30:53', '2005-07-31T07:13:16', '2005-08-06T09:12:16', '2'), - ('84', '4175', '2006-02-16T02:30:53', '2005-07-11T23:27:52', '2005-07-19T22:29:52', '2'), - ('7', '2272', '2006-02-16T02:30:53', '2005-08-02T04:40:54', '2005-08-09T03:39:54', '2'), - ('414', '1111', '2006-02-16T02:30:53', '2005-06-21T08:23:05', '2005-06-27T14:07:05', '2'), - ('483', '3957', '2006-02-16T02:30:53', '2005-07-27T06:40:41', '2005-07-29T09:05:41', '2'), - ('336', '127', '2006-02-16T02:30:53', '2005-07-30T03:18:24', '2005-08-08T08:50:24', '2'), - ('7', '714', '2006-02-16T02:30:53', '2005-08-21T04:49:48', '2005-08-25T05:34:48', '2'), - ('277', '3596', '2006-02-16T02:30:53', '2005-08-17T01:38:19', '2005-08-18T20:30:19', '2'), - ('89', '2364', '2006-02-16T02:30:53', '2005-07-09T21:31:11', '2005-07-13T16:59:11', '2'), - ('289', '3597', '2006-02-16T02:30:53', '2005-07-10T11:18:12', '2005-07-16T14:53:12', '2'), - ('172', '4538', '2006-02-16T02:30:53', '2005-07-30T09:24:18', '2005-08-02T14:46:18', '2'), - ('76', '1084', '2006-02-16T02:30:53', '2005-07-10T03:48:20', '2005-07-11T02:09:20', '2'), - ('575', '3514', '2006-02-16T02:30:53', '2005-08-02T21:24:02', '2005-08-04T01:32:02', '2'), - ('466', '1648', '2006-02-16T02:30:53', '2005-08-02T17:45:55', '2005-08-10T20:53:55', '2'), - ('42', '2778', '2006-02-16T02:30:53', '2005-07-12T16:52:13', '2005-07-14T15:11:13', '2'), - ('134', '1846', '2006-02-16T02:30:53', '2005-08-02T14:34:33', '2005-08-08T15:40:33', '2'), - ('509', '1578', '2006-02-16T02:30:53', '2005-07-07T14:34:50', '2005-07-08T09:23:50', '2'), - ('565', '1966', '2006-02-16T02:30:53', '2005-07-27T10:25:51', '2005-08-04T16:02:51', '2'), - ('360', '1825', '2006-02-16T02:30:53', '2005-08-19T07:20:39', '2005-08-21T12:31:39', '2'), - ('12', '3529', '2006-02-16T02:30:53', '2005-06-16T17:02:55', '2005-06-23T19:09:55', '2'), - ('123', '385', '2006-02-16T02:30:53', '2005-08-18T09:27:34', '2005-08-25T13:10:34', '2'), - ('84', '3007', '2006-02-16T02:30:53', '2005-07-11T15:25:52', '2005-07-13T11:54:52', '2'), - ('481', '2272', '2006-02-16T02:30:53', '2005-08-20T19:29:23', '2005-08-25T18:50:23', '2'), - ('278', '1785', '2006-02-16T02:30:53', '2005-08-20T19:02:16', '2005-08-25T17:58:16', '2'), - ('64', '709', '2006-02-16T02:30:53', '2005-07-09T14:46:36', '2005-07-17T10:04:36', '2'), - ('251', '4156', '2006-02-16T02:30:53', '2005-08-18T19:11:41', '2005-08-21T18:04:41', '2'), - ('464', '2313', '2006-02-16T02:30:53', '2005-07-07T18:36:37', '2005-07-14T14:59:37', '2'), - ('289', '372', '2006-02-16T02:30:53', '2005-06-18T09:04:59', '2005-06-20T09:39:59', '2'), - ('45', '2053', '2006-02-16T02:30:53', '2005-06-16T20:41:57', '2005-06-18T19:25:57', '2'), - ('219', '2487', '2006-02-16T02:30:53', '2005-07-31T08:13:11', '2005-08-08T12:40:11', '2'), - ('581', '3817', '2006-02-16T02:30:53', '2005-07-28T07:14:43', '2005-08-01T05:03:43', '2'), - ('408', '2171', '2006-02-16T02:30:53', '2005-07-28T15:00:49', '2005-08-04T20:58:49', '2'), - ('343', '2472', '2006-02-16T02:30:53', '2005-08-19T18:02:18', '2005-08-24T22:15:18', '2'), - ('174', '3215', '2006-02-16T02:30:53', '2005-06-16T03:13:20', '2005-06-24T01:59:20', '2'), - ('7', '4278', '2006-02-16T02:30:53', '2005-05-25T19:30:46', '2005-05-31T23:59:46', '2'), - ('293', '1575', '2006-02-16T02:30:53', '2005-08-22T23:17:41', '2005-08-30T20:07:41', '2'), - ('151', '539', '2006-02-16T02:30:53', '2005-06-20T15:57:01', '2005-06-25T13:15:01', '2'), - ('86', '1251', '2006-02-16T02:30:53', '2005-08-01T12:21:53', '2005-08-04T13:08:53', '2'), - ('493', '1592', '2006-02-16T02:30:53', '2005-08-23T16:34:31', '2005-08-27T21:51:31', '2'), - ('228', '908', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('467', '2511', '2006-02-16T02:30:53', '2005-08-22T02:04:38', '2005-08-30T06:46:38', '2'), - ('502', '853', '2006-02-16T02:30:53', '2005-07-06T05:46:05', '2005-07-11T01:24:05', '2'), - ('114', '187', '2006-02-16T02:30:53', '2005-07-06T20:38:02', '2005-07-11T23:35:02', '2'), - ('339', '2372', '2006-02-16T02:30:53', '2005-08-21T23:24:52', '2005-08-27T04:25:52', '2'), - ('83', '173', '2006-02-16T02:30:53', '2005-08-17T01:28:05', '2005-08-23T23:33:05', '2'), - ('392', '3730', '2006-02-16T02:30:53', '2005-08-02T21:25:25', '2005-08-04T19:57:25', '2'), - ('405', '2348', '2006-02-16T02:30:53', '2005-08-17T20:55:25', '2005-08-22T20:31:25', '2'), - ('457', '2310', '2006-02-16T02:30:53', '2005-05-31T03:30:19', '2005-06-09T05:52:19', '2'), - ('52', '681', '2006-02-16T02:30:53', '2005-08-18T13:42:45', '2005-08-23T12:54:45', '2'), - ('151', '3418', '2006-02-16T02:30:53', '2005-07-12T15:47:51', '2005-07-19T21:17:51', '2'), - ('515', '3365', '2006-02-16T02:30:53', '2005-07-06T13:57:03', '2005-07-09T11:13:03', '2'), - ('416', '160', '2006-02-16T02:30:53', '2005-07-29T14:56:21', '2005-07-31T16:56:21', '2'), - ('429', '4533', '2006-02-16T02:30:53', '2005-07-12T20:58:04', '2005-07-18T16:56:04', '2'), - ('217', '2625', '2006-02-16T02:30:53', '2005-08-19T02:55:36', '2005-08-22T01:00:36', '2'), - ('523', '3110', '2006-02-16T02:30:53', '2005-07-09T15:11:54', '2005-07-16T16:05:54', '2'), - ('422', '1725', '2006-02-16T02:30:53', '2005-06-17T00:02:44', '2005-06-18T23:47:44', '2'), - ('361', '3515', '2006-02-16T02:30:53', '2005-07-28T22:36:26', '2005-08-04T00:12:26', '2'), - ('391', '1642', '2006-02-16T02:30:53', '2005-07-08T14:18:41', '2005-07-09T10:00:41', '2'), - ('15', '1619', '2006-02-16T02:30:53', '2005-07-31T17:22:35', '2005-08-01T21:19:35', '2'), - ('287', '3385', '2006-02-16T02:30:53', '2005-07-31T08:23:53', '2005-08-08T12:03:53', '2'), - ('576', '3825', '2006-02-16T02:30:53', '2005-07-10T22:07:59', '2005-07-15T21:07:59', '2'), - ('84', '763', '2006-02-16T02:30:53', '2005-08-21T08:29:20', '2005-08-30T03:59:20', '2'), - ('316', '389', '2006-02-16T02:30:53', '2005-05-25T00:43:11', '2005-05-26T04:42:11', '2'), - ('67', '2558', '2006-02-16T02:30:53', '2005-06-19T19:44:12', '2005-06-20T19:41:12', '2'), - ('211', '2746', '2006-02-16T02:30:53', '2005-07-27T19:28:17', '2005-07-31T20:05:17', '2'), - ('390', '3200', '2006-02-16T02:30:53', '2005-05-30T10:58:33', '2005-05-31T09:31:33', '2'), - ('18', '2784', '2006-02-16T02:30:53', '2005-07-29T11:18:01', '2005-07-30T10:47:01', '2'), - ('412', '4212', '2006-02-16T02:30:53', '2005-08-22T21:18:59', '2005-08-27T20:12:59', '2'), - ('440', '1630', '2006-02-16T02:30:53', '2005-07-07T16:37:23', '2005-07-11T18:05:23', '2'), - ('122', '3696', '2006-02-16T02:30:53', '2005-07-28T21:43:54', '2005-08-02T22:38:54', '2'), - ('554', '1038', '2006-02-16T02:30:53', '2005-08-21T18:35:44', '2005-08-25T23:54:44', '2'), - ('517', '4277', '2006-02-16T02:30:53', '2005-08-17T06:27:15', '2005-08-22T02:11:15', '2'), - ('147', '3263', '2006-02-16T02:30:53', '2005-07-28T04:45:37', '2005-07-30T09:03:37', '2'), - ('509', '616', '2006-02-16T02:30:53', '2005-08-01T00:25:00', '2005-08-03T06:01:00', '2'), - ('283', '2519', '2006-02-16T02:30:53', '2005-07-31T14:55:22', '2005-08-04T09:02:22', '2'), - ('259', '2925', '2006-02-16T02:30:53', '2005-06-16T08:46:26', '2005-06-24T14:39:26', '2'), - ('40', '2034', '2006-02-16T02:30:53', '2005-08-20T17:58:11', '2005-08-26T14:50:11', '2'), - ('464', '1640', '2006-02-16T02:30:53', '2005-07-12T07:44:49', '2005-07-20T03:22:49', '2'), - ('66', '1800', '2006-02-16T02:30:53', '2005-06-19T04:20:14', '2005-06-21T07:28:14', '2'), - ('484', '1352', '2006-02-16T02:30:53', '2005-06-16T08:55:35', '2005-06-21T05:36:35', '2'), - ('76', '2108', '2006-02-16T02:30:53', '2005-06-17T19:47:21', '2005-06-19T22:46:21', '2'), - ('198', '2208', '2006-02-16T02:30:53', '2005-08-17T18:19:44', '2005-08-18T19:14:44', '2'), - ('272', '230', '2006-02-16T02:30:53', '2005-07-09T03:44:15', '2005-07-15T09:07:15', '2'), - ('578', '505', '2006-02-16T02:30:53', '2005-07-31T18:37:47', '2005-08-06T14:58:47', '2'), - ('323', '2687', '2006-02-16T02:30:53', '2005-07-06T10:16:45', '2005-07-13T12:44:45', '2'), - ('214', '1213', '2006-02-16T02:30:53', '2005-06-20T00:08:58', '2005-06-25T21:23:58', '2'), - ('440', '63', '2006-02-16T02:30:53', '2005-08-20T12:03:54', '2005-08-28T15:24:54', '2'), - ('564', '4079', '2006-02-16T02:30:53', '2005-08-22T10:22:00', '2005-08-29T07:01:00', '2'), - ('367', '1943', '2006-02-16T02:30:53', '2005-07-29T08:59:25', '2005-08-05T14:02:25', '2'), - ('192', '2151', '2006-02-16T02:30:53', '2005-08-21T02:13:31', '2005-08-24T22:47:31', '2'), - ('313', '1071', '2006-02-16T02:30:53', '2005-08-23T05:24:29', '2005-08-30T08:23:29', '2'), - ('421', '2547', '2006-02-16T02:30:53', '2005-06-18T16:50:41', '2005-06-24T15:29:41', '2'), - ('280', '3856', '2006-02-16T02:30:53', '2005-08-20T08:25:34', '2005-08-24T07:04:34', '2'), - ('252', '1356', '2006-02-16T02:30:53', '2005-07-28T02:44:25', '2005-07-29T21:55:25', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['5214', '6868', '2791', '7092', '10799', '6591', '2271', '13578', '7715', '1957', '11897', '10163', '956', '8442', '4944', '12486', '3753', '5405', '10377', '13623', '5301', '8271', '10302', '13610', '13471', '7127', '9523', '2202', '9680', '803', '11176', '8416', '8126', '3308', '11301', '15275', '5009', '7525', '10195', '14099', '8721', '6805', '4401', '10071', '9992', '3583', '4052', '5203', '11584', '726', '11272', '1422', '12811', '3579', '7509', '11445', '9772', '875', '2352', '12724', '15617', '7830', '4397', '11253', '2970', '9209', '4222', '14799', '1828', '6649', '7428', '11265', '15105', '3735', '12884', '1539', '12066', '8352', '9649', '6410', '12753', '3861', '7322', '920', '3441', '2242', '9850', '10681', '13281', '6336', '5889', '12371', '2632', '6767', '403', '6955', '3644', '5216', '9308', '4787']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('290', '1657', '2006-02-16T02:30:53', '2005-07-09T11:43:08', '2005-07-17T08:58:08', '2'), - ('306', '719', '2006-02-16T02:30:53', '2005-07-12T20:10:17', '2005-07-15T22:34:17', '2'), - ('299', '2174', '2006-02-16T02:30:53', '2005-06-19T18:51:27', '2005-06-22T19:35:27', '2'), - ('345', '1433', '2006-02-16T02:30:53', '2005-07-27T04:46:00', '2005-08-03T07:22:00', '2'), - ('145', '3282', '2006-02-16T02:30:53', '2005-08-01T22:03:31', '2005-08-06T20:19:31', '2'), - ('509', '2846', '2006-02-16T02:30:53', '2005-07-12T07:13:46', '2005-07-16T05:15:46', '2'), - ('145', '2416', '2006-02-16T02:30:53', '2005-06-18T06:29:52', '2005-06-21T09:46:52', '2'), - ('352', '4301', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('512', '3210', '2006-02-16T02:30:53', '2005-07-28T04:32:38', '2005-08-05T00:37:38', '2'), - ('68', '2496', '2006-02-16T02:30:53', '2005-06-17T08:50:58', '2005-06-26T13:39:58', '2'), - ('238', '3904', '2006-02-16T02:30:53', '2005-08-17T15:24:06', '2005-08-23T11:50:06', '2'), - ('425', '2811', '2006-02-16T02:30:53', '2005-07-31T23:12:34', '2005-08-01T22:47:34', '2'), - ('296', '647', '2006-02-16T02:30:53', '2005-05-30T17:30:28', '2005-06-07T13:54:28', '2'), - ('185', '4345', '2006-02-16T02:30:53', '2005-07-29T07:33:07', '2005-08-03T03:09:07', '2'), - ('293', '3648', '2006-02-16T02:30:53', '2005-07-08T22:44:28', '2005-07-17T21:51:28', '2'), - ('515', '2991', '2006-02-16T02:30:53', '2005-08-18T12:42:50', '2005-08-27T13:41:50', '2'), - ('358', '774', '2006-02-16T02:30:53', '2005-07-06T12:34:06', '2005-07-07T14:19:06', '2'), - ('45', '799', '2006-02-16T02:30:53', '2005-07-09T20:11:49', '2005-07-18T18:37:49', '2'), - ('559', '2401', '2006-02-16T02:30:53', '2005-08-01T06:28:28', '2005-08-10T05:45:28', '2'), - ('321', '3948', '2006-02-16T02:30:53', '2005-08-20T06:49:46', '2005-08-25T05:19:46', '2'), - ('459', '245', '2006-02-16T02:30:53', '2005-07-09T15:42:10', '2005-07-16T21:27:10', '2'), - ('481', '83', '2006-02-16T02:30:53', '2005-07-29T01:27:44', '2005-08-07T05:01:44', '2'), - ('144', '1043', '2006-02-16T02:30:53', '2005-08-01T04:12:08', '2005-08-01T22:12:08', '2'), - ('3', '2526', '2006-02-16T02:30:53', '2005-08-20T06:14:12', '2005-08-26T00:44:12', '2'), - ('296', '1391', '2006-02-16T02:30:53', '2005-08-20T01:02:26', '2005-08-25T06:37:26', '2'), - ('486', '273', '2006-02-16T02:30:53', '2005-07-27T06:13:48', '2005-08-01T02:50:48', '2'), - ('356', '891', '2006-02-16T02:30:53', '2005-07-31T00:56:09', '2005-08-05T05:44:09', '2'), - ('297', '815', '2006-02-16T02:30:53', '2005-06-18T02:09:24', '2005-06-26T07:17:24', '2'), - ('84', '3010', '2006-02-16T02:30:53', '2005-07-31T06:41:46', '2005-08-01T11:02:46', '2'), - ('32', '1602', '2006-02-16T02:30:53', '2005-05-29T17:52:30', '2005-05-30T14:35:30', '2'), - ('37', '1448', '2006-02-16T02:30:53', '2005-08-02T10:39:43', '2005-08-09T14:42:43', '2'), - ('315', '1999', '2006-02-16T02:30:53', '2005-07-29T06:52:54', '2005-08-05T09:50:54', '2'), - ('537', '719', '2006-02-16T02:30:53', '2005-07-28T19:32:41', '2005-08-05T00:33:41', '2'), - ('96', '3129', '2006-02-16T02:30:53', '2005-06-21T07:58:36', '2005-06-23T05:23:36', '2'), - ('502', '676', '2006-02-16T02:30:53', '2005-08-02T15:37:59', '2005-08-04T10:57:59', '2'), - ('597', '1522', '2006-02-16T02:30:53', '2005-08-22T18:57:39', '2005-08-23T19:00:39', '2'), - ('102', '1539', '2006-02-16T02:30:53', '2005-07-09T01:32:17', '2005-07-18T03:39:17', '2'), - ('281', '4084', '2006-02-16T02:30:53', '2005-07-27T21:13:28', '2005-08-04T19:44:28', '2'), - ('396', '2691', '2006-02-16T02:30:53', '2005-08-01T00:34:42', '2005-08-08T05:04:42', '2'), - ('224', '2452', '2006-02-16T02:30:53', '2005-08-21T00:31:03', '2005-08-27T03:18:03', '2'), - ('312', '2416', '2006-02-16T02:30:53', '2005-07-29T17:56:21', '2005-08-02T21:30:21', '2'), - ('262', '1758', '2006-02-16T02:30:53', '2005-07-12T17:23:01', '2005-07-21T19:38:01', '2'), - ('405', '2725', '2006-02-16T02:30:53', '2005-07-07T21:26:27', '2005-07-12T17:18:27', '2'), - ('353', '2360', '2006-02-16T02:30:53', '2005-07-31T19:49:35', '2005-08-03T00:00:35', '2'), - ('304', '4242', '2006-02-16T02:30:53', '2005-07-31T17:29:48', '2005-08-09T13:02:48', '2'), - ('574', '204', '2006-02-16T02:30:53', '2005-07-06T04:10:43', '2005-07-14T22:17:43', '2'), - ('442', '206', '2006-02-16T02:30:53', '2005-07-07T03:38:22', '2005-07-13T02:56:22', '2'), - ('588', '3661', '2006-02-16T02:30:53', '2005-07-09T10:53:59', '2005-07-15T09:45:59', '2'), - ('479', '3906', '2006-02-16T02:30:53', '2005-08-17T02:13:26', '2005-08-22T01:24:26', '2'), - ('452', '933', '2006-02-16T02:30:53', '2005-05-29T06:05:29', '2005-06-05T04:40:29', '2'), - ('158', '4111', '2006-02-16T02:30:53', '2005-08-02T14:20:27', '2005-08-07T12:24:27', '2'), - ('1', '1021', '2006-02-16T02:30:53', '2005-06-15T18:02:53', '2005-06-19T15:54:53', '2'), - ('54', '641', '2006-02-16T02:30:53', '2005-08-19T00:51:28', '2005-08-24T01:57:28', '2'), - ('485', '3309', '2006-02-16T02:30:53', '2005-07-06T03:47:47', '2005-07-08T02:16:47', '2'), - ('228', '4134', '2006-02-16T02:30:53', '2005-07-27T20:37:19', '2005-08-04T19:35:19', '2'), - ('108', '3340', '2006-02-16T02:30:53', '2005-08-02T20:33:35', '2005-08-08T16:02:35', '2'), - ('147', '3639', '2006-02-16T02:30:53', '2005-07-31T09:56:07', '2005-08-01T13:50:07', '2'), - ('326', '1428', '2006-02-16T02:30:53', '2005-05-30T05:38:24', '2005-06-06T00:34:24', '2'), - ('590', '2141', '2006-02-16T02:30:53', '2005-06-18T12:40:15', '2005-06-22T07:07:15', '2'), - ('242', '2224', '2006-02-16T02:30:53', '2005-08-18T21:37:20', '2005-08-27T21:56:20', '2'), - ('569', '4085', '2006-02-16T02:30:53', '2005-08-23T07:07:22', '2005-08-27T01:24:22', '2'), - ('144', '4492', '2006-02-16T02:30:53', '2005-07-28T08:43:49', '2005-08-04T09:30:49', '2'), - ('494', '3085', '2006-02-16T02:30:53', '2005-07-07T21:14:54', '2005-07-13T19:24:54', '2'), - ('303', '2898', '2006-02-16T02:30:53', '2005-08-02T13:42:44', '2005-08-09T17:06:44', '2'), - ('449', '1167', '2006-02-16T02:30:53', '2005-06-20T07:51:51', '2005-06-28T10:14:51', '2'), - ('23', '3940', '2006-02-16T02:30:53', '2005-07-30T12:55:36', '2005-08-03T11:31:36', '2'), - ('467', '2053', '2006-02-16T02:30:53', '2005-07-07T12:20:21', '2005-07-11T11:09:21', '2'), - ('454', '1276', '2006-02-16T02:30:53', '2005-08-22T00:44:57', '2005-08-24T20:08:57', '2'), - ('68', '316', '2006-02-16T02:30:53', '2005-06-16T22:04:34', '2005-06-20T21:07:34', '2'), - ('57', '70', '2006-02-16T02:30:53', '2005-07-12T10:51:09', '2005-07-14T16:05:09', '2'), - ('90', '243', '2006-02-16T02:30:53', '2005-07-27T17:21:52', '2005-08-05T17:13:52', '2'), - ('531', '3870', '2006-02-16T02:30:53', '2005-08-02T14:05:42', '2005-08-11T15:27:42', '2'), - ('338', '3965', '2006-02-16T02:30:53', '2005-08-22T12:01:33', '2005-08-26T14:29:33', '2'), - ('534', '2262', '2006-02-16T02:30:53', '2005-07-06T11:42:04', '2005-07-12T14:33:04', '2'), - ('348', '2768', '2006-02-16T02:30:53', '2005-08-19T03:34:04', '2005-08-28T01:00:04', '2'), - ('390', '267', '2006-02-16T02:30:53', '2005-06-16T01:11:25', '2005-06-23T03:43:25', '2'), - ('267', '2474', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('168', '2710', '2006-02-16T02:30:53', '2005-07-29T04:52:01', '2005-08-06T07:39:01', '2'), - ('51', '1588', '2006-02-16T02:30:53', '2005-07-31T05:46:54', '2005-08-04T08:42:54', '2'), - ('560', '1127', '2006-02-16T02:30:53', '2005-07-11T23:08:06', '2005-07-19T19:57:06', '2'), - ('470', '1494', '2006-02-16T02:30:53', '2005-08-18T22:37:39', '2005-08-27T00:21:39', '2'), - ('202', '4506', '2006-02-16T02:30:53', '2005-07-06T17:24:49', '2005-07-15T22:19:49', '2'), - ('508', '1810', '2006-02-16T02:30:53', '2005-07-27T13:37:26', '2005-08-03T18:00:26', '2'), - ('584', '3860', '2006-02-16T02:30:53', '2005-05-30T11:44:01', '2005-06-02T08:19:01', '2'), - ('326', '2863', '2006-02-16T02:30:53', '2005-06-21T20:00:12', '2005-06-24T00:24:12', '2'), - ('146', '1995', '2006-02-16T02:30:53', '2005-06-18T04:32:28', '2005-06-24T03:26:28', '2'), - ('497', '1461', '2006-02-16T02:30:53', '2005-07-31T12:46:52', '2005-08-04T10:52:52', '2'), - ('119', '1468', '2006-02-16T02:30:53', '2005-08-01T17:30:35', '2005-08-02T14:48:35', '2'), - ('220', '113', '2006-02-16T02:30:53', '2005-08-19T18:07:47', '2005-08-20T21:51:47', '2'), - ('471', '1229', '2006-02-16T02:30:53', '2005-07-11T19:30:13', '2005-07-20T21:27:13', '2'), - ('491', '1706', '2006-02-16T02:30:53', '2005-07-10T19:54:41', '2005-07-12T20:08:41', '2'), - ('451', '622', '2006-02-16T02:30:53', '2005-08-18T08:02:46', '2005-08-19T02:50:46', '2'), - ('574', '2274', '2006-02-16T02:30:53', '2005-06-19T08:51:47', '2005-06-23T07:13:47', '2'), - ('208', '1819', '2006-02-16T02:30:53', '2005-07-12T15:46:55', '2005-07-17T17:36:55', '2'), - ('424', '3983', '2006-02-16T02:30:53', '2005-05-27T13:28:52', '2005-05-29T11:47:52', '2'), - ('469', '1104', '2006-02-16T02:30:53', '2005-07-26T23:55:48', '2005-08-02T03:25:48', '2'), - ('403', '4309', '2006-02-16T02:30:53', '2005-07-06T07:20:11', '2005-07-11T10:26:11', '2'), - ('515', '1644', '2006-02-16T02:30:53', '2005-07-09T11:54:58', '2005-07-12T09:46:58', '2'), - ('267', '2202', '2006-02-16T02:30:53', '2005-07-30T16:53:21', '2005-08-08T15:33:21', '2'), - ('7', '3929', '2006-02-16T02:30:53', '2005-07-08T16:16:04', '2005-07-14T18:02:04', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['5324', '15730', '13507', '8053', '3357', '15523', '2915', '1190', '10446', '9516', '10048', '10835', '9020', '9619', '14620', '7163', '6782', '5127', '3401', '5885', '3593', '2884', '11677', '6526', '4925', '15204', '12024', '7501', '2117', '11212', '10079', '2665', '5536', '11790', '377', '807', '5527', '14168', '3367', '4930', '5423', '11398', '9970', '11922', '9632', '12901', '6163', '8362', '5823', '6604', '790', '15156', '9340', '14545', '13297', '1059', '295', '5417', '10647', '14693', '3912', '12332', '15255', '811', '4686', '14716', '13648', '11829', '5773', '8334', '11291', '15027', '4096', '7653', '6243', '15486', '6952', '16025', '13517', '5144', '1638', '10316', '11609', '15779', '13485', '14943', '5378', '5336', '8874', '2044', '11657', '3685', '14821', '309', '10843', '7209', '5593', '5488', '1280', '2895']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('113', '4024', '2006-02-16T02:30:53', '2005-07-09T16:34:18', '2005-07-15T12:35:18', '2'), - ('147', '947', '2006-02-16T02:30:53', '2005-08-23T11:32:35', '2005-08-30T13:46:35', '2'), - ('478', '3324', '2006-02-16T02:30:53', '2005-08-20T02:10:27', '2005-08-23T04:03:27', '2'), - ('526', '1511', '2006-02-16T02:30:53', '2005-07-28T16:59:41', '2005-08-03T22:28:41', '2'), - ('57', '2528', '2006-02-16T02:30:53', '2005-06-21T11:55:42', '2005-06-22T07:19:42', '2'), - ('432', '2570', '2006-02-16T02:30:53', '2005-08-23T03:32:36', '2005-08-26T22:08:36', '2'), - ('262', '1293', '2006-02-16T02:30:53', '2005-06-20T03:57:17', '2005-06-24T05:59:17', '2'), - ('370', '2572', '2006-02-16T02:30:53', '2005-06-15T01:05:32', '2005-06-23T02:34:32', '2'), - ('95', '2671', '2006-02-16T02:30:53', '2005-08-01T09:02:17', '2005-08-04T10:00:17', '2'), - ('424', '3519', '2006-02-16T02:30:53', '2005-07-31T00:40:58', '2005-08-07T02:13:58', '2'), - ('267', '3821', '2006-02-16T02:30:53', '2005-07-31T19:08:56', '2005-08-05T20:15:56', '2'), - ('90', '351', '2006-02-16T02:30:53', '2005-08-01T23:28:49', '2005-08-10T21:28:49', '2'), - ('142', '1700', '2006-02-16T02:30:53', '2005-07-30T05:31:27', '2005-08-08T06:44:27', '2'), - ('138', '1730', '2006-02-16T02:30:53', '2005-07-31T04:17:02', '2005-08-05T06:36:02', '2'), - ('78', '3272', '2006-02-16T02:30:53', '2005-08-21T18:10:43', '2005-08-22T15:19:43', '2'), - ('38', '3666', '2006-02-16T02:30:53', '2005-07-27T07:36:11', '2005-08-04T06:03:11', '2'), - ('199', '2742', '2006-02-16T02:30:53', '2005-07-12T16:23:25', '2005-07-20T18:46:25', '2'), - ('129', '3649', '2006-02-16T02:30:53', '2005-07-09T07:25:47', '2005-07-13T11:44:47', '2'), - ('577', '3423', '2006-02-16T02:30:53', '2005-06-21T15:52:43', '2005-06-30T21:09:43', '2'), - ('331', '3129', '2006-02-16T02:30:53', '2005-07-10T19:33:50', '2005-07-17T00:26:50', '2'), - ('78', '619', '2006-02-16T02:30:53', '2005-07-06T04:39:52', '2005-07-11T23:20:52', '2'), - ('319', '3384', '2006-02-16T02:30:53', '2005-06-20T01:31:16', '2005-06-21T04:03:16', '2'), - ('407', '2206', '2006-02-16T02:30:53', '2005-08-17T06:06:26', '2005-08-20T04:35:26', '2'), - ('225', '1718', '2006-02-16T02:30:53', '2005-07-12T04:21:20', '2005-07-18T23:45:20', '2'), - ('68', '2169', '2006-02-16T02:30:53', '2005-07-08T21:56:00', '2005-07-14T17:17:00', '2'), - ('317', '1471', '2006-02-16T02:30:53', '2005-08-22T16:30:43', '2005-08-26T20:37:43', '2'), - ('484', '2398', '2006-02-16T02:30:53', '2005-08-17T19:57:34', '2005-08-21T23:00:34', '2'), - ('587', '1464', '2006-02-16T02:30:53', '2005-07-27T20:16:59', '2005-08-04T00:11:59', '2'), - ('170', '2', '2006-02-16T02:30:53', '2005-06-17T20:24:00', '2005-06-23T17:45:00', '2'), - ('343', '4007', '2006-02-16T02:30:53', '2005-08-02T12:18:29', '2005-08-05T16:05:29', '2'), - ('486', '4541', '2006-02-16T02:30:53', '2005-07-31T20:05:45', '2005-08-04T16:25:45', '2'), - ('133', '4531', '2006-02-16T02:30:53', '2005-06-19T11:12:35', '2005-06-26T11:55:35', '2'), - ('195', '1919', '2006-02-16T02:30:53', '2005-07-10T02:29:42', '2005-07-13T04:06:42', '2'), - ('451', '2384', '2006-02-16T02:30:53', '2005-08-17T11:00:08', '2005-08-20T05:15:08', '2'), - ('170', '3012', '2006-02-16T02:30:53', '2005-05-27T09:04:05', '2005-06-02T03:36:05', '2'), - ('235', '2195', '2006-02-16T02:30:53', '2005-05-29T18:50:50', '2005-06-03T18:36:50', '2'), - ('554', '4462', '2006-02-16T02:30:53', '2005-07-10T02:06:01', '2005-07-15T00:55:01', '2'), - ('49', '1321', '2006-02-16T02:30:53', '2005-08-21T03:00:03', '2005-08-29T06:04:03', '2'), - ('80', '2442', '2006-02-16T02:30:53', '2005-06-21T13:08:21', '2005-06-26T08:43:21', '2'), - ('451', '2057', '2006-02-16T02:30:53', '2005-07-08T22:15:48', '2005-07-15T21:02:48', '2'), - ('440', '1952', '2006-02-16T02:30:53', '2005-07-09T20:56:48', '2005-07-17T14:58:48', '2'), - ('6', '3952', '2006-02-16T02:30:53', '2005-08-02T18:55:15', '2005-08-10T19:50:15', '2'), - ('578', '2846', '2006-02-16T02:30:53', '2005-07-31T16:38:24', '2005-08-02T12:59:24', '2'), - ('15', '3707', '2006-02-16T02:30:53', '2005-08-17T16:20:37', '2005-08-26T16:53:37', '2'), - ('217', '3368', '2006-02-16T02:30:53', '2005-07-31T05:02:23', '2005-08-06T04:49:23', '2'), - ('180', '2799', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('1', '1330', '2006-02-16T02:30:53', '2005-07-11T10:13:46', '2005-07-19T13:15:46', '2'), - ('223', '2287', '2006-02-16T02:30:53', '2005-07-29T05:09:11', '2005-08-04T00:08:11', '2'), - ('483', '1879', '2006-02-16T02:30:53', '2005-07-10T16:19:52', '2005-07-11T12:33:52', '2'), - ('365', '822', '2006-02-16T02:30:53', '2005-07-12T07:57:45', '2005-07-16T05:41:45', '2'), - ('593', '2858', '2006-02-16T02:30:53', '2005-05-29T16:19:29', '2005-06-02T17:22:29', '2'), - ('494', '1174', '2006-02-16T02:30:53', '2005-08-22T14:29:11', '2005-08-30T17:48:11', '2'), - ('213', '3228', '2006-02-16T02:30:53', '2005-07-30T18:07:16', '2005-08-04T14:33:16', '2'), - ('13', '2459', '2006-02-16T02:30:53', '2005-08-21T15:44:23', '2005-08-29T20:09:23', '2'), - ('359', '3818', '2006-02-16T02:30:53', '2005-08-19T18:45:49', '2005-08-22T14:58:49', '2'), - ('241', '3041', '2006-02-16T02:30:53', '2005-05-31T08:20:43', '2005-06-04T09:05:43', '2'), - ('65', '4030', '2006-02-16T02:30:53', '2005-05-26T20:33:20', '2005-05-27T18:23:20', '2'), - ('265', '3569', '2006-02-16T02:30:53', '2005-07-09T20:34:09', '2005-07-14T00:36:09', '2'), - ('115', '3137', '2006-02-16T02:30:53', '2005-08-01T16:08:46', '2005-08-06T20:37:46', '2'), - ('269', '3454', '2006-02-16T02:30:53', '2005-08-21T20:44:19', '2005-08-29T00:37:19', '2'), - ('154', '2449', '2006-02-16T02:30:53', '2005-07-06T20:10:03', '2005-07-08T18:39:03', '2'), - ('235', '627', '2006-02-16T02:30:53', '2005-08-18T06:51:05', '2005-08-20T04:28:05', '2'), - ('84', '3415', '2006-02-16T02:30:53', '2005-08-22T18:16:50', '2005-08-28T14:14:50', '2'), - ('401', '4419', '2006-02-16T02:30:53', '2005-05-29T19:30:42', '2005-06-02T16:19:42', '2'), - ('234', '1398', '2006-02-16T02:30:53', '2005-07-08T10:53:39', '2005-07-10T05:34:39', '2'), - ('78', '2285', '2006-02-16T02:30:53', '2005-08-21T21:29:55', '2005-08-23T18:34:55', '2'), - ('596', '3921', '2006-02-16T02:30:53', '2005-08-20T07:48:10', '2005-08-22T12:15:10', '2'), - ('563', '2207', '2006-02-16T02:30:53', '2005-08-17T12:52:04', '2005-08-19T10:50:04', '2'), - ('180', '3277', '2006-02-16T02:30:53', '2005-07-10T13:31:09', '2005-07-15T08:21:09', '2'), - ('154', '982', '2006-02-16T02:30:53', '2005-07-29T04:18:25', '2005-08-07T07:18:25', '2'), - ('417', '491', '2006-02-16T02:30:53', '2005-08-02T14:57:58', '2005-08-11T09:04:58', '2'), - ('478', '326', '2006-02-16T02:30:53', '2005-08-22T09:03:04', '2005-08-29T04:03:04', '2'), - ('403', '3911', '2006-02-16T02:30:53', '2005-07-07T06:09:11', '2005-07-08T09:17:11', '2'), - ('232', '814', '2006-02-16T02:30:53', '2005-07-28T01:58:30', '2005-07-28T23:32:30', '2'), - ('26', '3456', '2006-02-16T02:30:53', '2005-07-11T14:53:25', '2005-07-15T09:26:25', '2'), - ('502', '1666', '2006-02-16T02:30:53', '2005-08-23T02:05:20', '2005-08-29T07:52:20', '2'), - ('290', '4288', '2006-02-16T02:30:53', '2005-07-26T23:51:27', '2005-07-30T02:45:27', '2'), - ('569', '1777', '2006-02-16T02:30:53', '2005-08-23T21:48:54', '2005-08-24T22:05:54', '2'), - ('186', '533', '2006-02-16T02:30:53', '2005-08-20T02:33:17', '2005-08-23T22:40:17', '2'), - ('89', '3530', '2006-02-16T02:30:53', '2005-07-09T08:09:53', '2005-07-18T07:11:53', '2'), - ('181', '1905', '2006-02-16T02:30:53', '2005-06-16T08:32:36', '2005-06-18T07:11:36', '2'), - ('469', '1907', '2006-02-16T02:30:53', '2005-08-01T04:34:57', '2005-08-06T02:34:57', '2'), - ('73', '351', '2006-02-16T02:30:53', '2005-08-17T03:41:11', '2005-08-25T01:30:11', '2'), - ('419', '1560', '2006-02-16T02:30:53', '2005-08-23T13:33:46', '2005-08-28T08:40:46', '2'), - ('379', '3802', '2006-02-16T02:30:53', '2005-08-20T01:20:14', '2005-08-22T01:28:14', '2'), - ('265', '3515', '2006-02-16T02:30:53', '2005-08-22T05:59:59', '2005-08-26T10:31:59', '2'), - ('138', '1570', '2006-02-16T02:30:53', '2005-07-09T19:05:56', '2005-07-10T18:03:56', '2'), - ('410', '4144', '2006-02-16T02:30:53', '2005-07-09T17:01:08', '2005-07-11T19:22:08', '2'), - ('564', '459', '2006-02-16T02:30:53', '2005-07-30T00:14:45', '2005-08-02T22:34:45', '2'), - ('484', '2418', '2006-02-16T02:30:53', '2005-06-17T14:37:57', '2005-06-22T17:15:57', '2'), - ('53', '3043', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('58', '2015', '2006-02-16T02:30:53', '2005-07-06T09:30:45', '2005-07-11T15:16:45', '2'), - ('62', '3155', '2006-02-16T02:30:53', '2005-08-22T01:20:19', '2005-08-29T03:06:19', '2'), - ('251', '1946', '2006-02-16T02:30:53', '2005-05-26T22:38:10', '2005-06-02T03:10:10', '2'), - ('192', '1286', '2006-02-16T02:30:53', '2005-08-01T23:43:03', '2005-08-09T23:49:03', '2'), - ('49', '3766', '2006-02-16T02:30:53', '2005-07-27T09:16:53', '2005-07-30T08:09:53', '2'), - ('287', '702', '2006-02-16T02:30:53', '2005-07-10T04:33:13', '2005-07-17T08:44:13', '2'), - ('173', '4262', '2006-02-16T02:30:53', '2005-07-10T00:02:06', '2005-07-15T01:45:06', '2'), - ('266', '2597', '2006-02-16T02:30:53', '2005-06-15T08:16:06', '2005-06-21T04:10:06', '2'), - ('141', '4445', '2006-02-16T02:30:53', '2005-06-20T02:26:31', '2005-06-27T23:42:31', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['9156', '13236', '9544', '10954', '15015', '7533', '8651', '1992', '15045', '6047', '1353', '13843', '197', '3650', '7734', '9561', '1428', '545', '15796', '14554', '9868', '7543', '9738', '1198', '4479', '7284', '10272', '6810', '14540', '15772', '214', '14531', '1911', '14090', '1412', '16033', '14971', '7931', '9498', '8670', '11904', '11411', '13132', '7695', '9744', '6994', '913', '14635', '1241', '2513', '13238', '1014', '7743', '6720', '15977', '7018', '13556', '1975', '15000', '3244', '2648', '185', '1149', '6159', '15307', '9229', '3422', '9293', '12691', '12062', '11222', '9486', '9568', '1383', '3736', '10499', '13935', '9007', '15117', '9270', '12509', '15785', '16037', '1255', '8665', '8424', '394', '9182', '2396', '4235', '1169', '12631', '7', '7804', '7845', '9957', '12957', '296', '14249', '832']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('145', '1747', '2006-02-16T02:30:53', '2005-07-30T11:04:55', '2005-07-31T14:10:55', '2'), - ('267', '4574', '2006-02-16T02:30:53', '2005-08-19T16:18:24', '2005-08-27T17:48:24', '2'), - ('28', '2383', '2006-02-16T02:30:53', '2005-07-31T01:44:51', '2005-08-05T05:25:51', '2'), - ('20', '3406', '2006-02-16T02:30:53', '2005-08-02T03:30:24', '2005-08-08T05:52:24', '2'), - ('14', '3067', '2006-02-16T02:30:53', '2005-08-22T08:43:50', '2005-08-31T06:53:50', '2'), - ('594', '1791', '2006-02-16T02:30:53', '2005-07-27T21:24:33', '2005-08-05T16:33:33', '2'), - ('61', '2095', '2006-02-16T02:30:53', '2005-07-29T15:02:18', '2005-08-07T09:34:18', '2'), - ('233', '636', '2006-02-16T02:30:53', '2005-06-17T10:58:53', '2005-06-19T08:42:53', '2'), - ('161', '3485', '2006-02-16T02:30:53', '2005-08-22T09:53:23', '2005-08-26T10:09:23', '2'), - ('235', '4147', '2006-02-16T02:30:53', '2005-07-11T03:27:01', '2005-07-16T06:42:01', '2'), - ('480', '2711', '2006-02-16T02:30:53', '2005-06-15T13:13:36', '2005-06-21T08:46:36', '2'), - ('308', '3058', '2006-02-16T02:30:53', '2005-08-20T14:30:01', '2005-08-27T10:06:01', '2'), - ('546', '4212', '2006-02-16T02:30:53', '2005-05-26T06:59:21', '2005-06-03T05:04:21', '2'), - ('482', '3606', '2006-02-16T02:30:53', '2005-07-06T07:34:15', '2005-07-08T01:50:15', '2'), - ('135', '2726', '2006-02-16T02:30:53', '2005-07-28T05:08:44', '2005-07-30T09:42:44', '2'), - ('58', '1079', '2006-02-16T02:30:53', '2005-07-31T02:22:13', '2005-08-03T07:00:13', '2'), - ('583', '3689', '2006-02-16T02:30:53', '2005-06-15T18:19:30', '2005-06-22T23:05:30', '2'), - ('54', '1086', '2006-02-16T02:30:53', '2005-05-28T07:10:20', '2005-06-04T01:47:20', '2'), - ('158', '1425', '2006-02-16T02:30:53', '2005-08-23T14:12:22', '2005-08-28T17:03:22', '2'), - ('38', '31', '2006-02-16T02:30:53', '2005-08-21T16:03:01', '2005-08-26T13:09:01', '2'), - ('378', '266', '2006-02-16T02:30:53', '2005-07-31T13:20:08', '2005-08-01T18:17:08', '2'), - ('526', '1289', '2006-02-16T02:30:53', '2005-07-27T21:44:28', '2005-08-04T21:42:28', '2'), - ('568', '2278', '2006-02-16T02:30:53', '2005-07-31T09:04:14', '2005-08-05T14:40:14', '2'), - ('491', '1138', '2006-02-16T02:30:53', '2005-06-15T01:48:58', '2005-06-20T01:07:58', '2'), - ('211', '3516', '2006-02-16T02:30:53', '2005-07-08T00:52:35', '2005-07-09T20:19:35', '2'), - ('52', '2336', '2006-02-16T02:30:53', '2005-07-27T12:12:04', '2005-07-31T11:17:04', '2'), - ('273', '128', '2006-02-16T02:30:53', '2005-08-01T03:14:34', '2005-08-10T05:56:34', '2'), - ('485', '2802', '2006-02-16T02:30:53', '2005-07-12T17:54:19', '2005-07-20T16:58:19', '2'), - ('28', '2362', '2006-02-16T02:30:53', '2005-08-21T15:34:23', '2005-08-27T11:51:23', '2'), - ('202', '4343', '2006-02-16T02:30:53', '2005-08-23T13:22:56', '2005-08-26T10:35:56', '2'), - ('98', '1453', '2006-02-16T02:30:53', '2005-05-26T08:48:49', '2005-05-31T04:06:49', '2'), - ('568', '4296', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('3', '910', '2006-02-16T02:30:53', '2005-06-17T05:15:15', '2005-06-24T11:05:15', '2'), - ('168', '3254', '2006-02-16T02:30:53', '2005-08-21T00:11:16', '2005-08-23T19:48:16', '2'), - ('166', '4236', '2006-02-16T02:30:53', '2005-06-15T17:09:48', '2005-06-18T17:05:48', '2'), - ('226', '760', '2006-02-16T02:30:53', '2005-08-23T22:06:15', '2005-09-01T02:36:15', '2'), - ('378', '1883', '2006-02-16T02:30:53', '2005-08-22T06:52:49', '2005-08-28T06:27:49', '2'), - ('326', '1923', '2006-02-16T02:30:53', '2005-07-28T12:23:41', '2005-08-06T09:49:41', '2'), - ('289', '1035', '2006-02-16T02:30:53', '2005-07-30T23:56:55', '2005-08-03T18:34:55', '2'), - ('446', '2354', '2006-02-16T02:30:53', '2005-07-29T15:49:03', '2005-08-01T20:19:03', '2'), - ('145', '2846', '2006-02-16T02:30:53', '2005-08-17T15:39:26', '2005-08-21T18:24:26', '2'), - ('141', '1497', '2006-02-16T02:30:53', '2005-08-02T19:29:47', '2005-08-09T16:27:47', '2'), - ('529', '1748', '2006-02-16T02:30:53', '2005-08-19T12:10:57', '2005-08-27T12:22:57', '2'), - ('323', '2742', '2006-02-16T02:30:53', '2005-07-28T03:41:13', '2005-08-06T05:06:13', '2'), - ('459', '839', '2006-02-16T02:30:53', '2005-07-31T09:15:38', '2005-08-03T10:31:38', '2'), - ('400', '4316', '2006-02-16T02:30:53', '2005-07-27T01:08:26', '2005-08-04T22:58:26', '2'), - ('369', '3213', '2006-02-16T02:30:53', '2005-05-30T11:04:58', '2005-06-07T13:22:58', '2'), - ('108', '2171', '2006-02-16T02:30:53', '2005-08-21T18:51:43', '2005-08-27T16:30:43', '2'), - ('62', '4377', '2006-02-16T02:30:53', '2005-06-15T04:59:43', '2005-06-24T03:32:43', '2'), - ('515', '3379', '2006-02-16T02:30:53', '2005-06-18T23:53:15', '2005-06-24T21:16:15', '2'), - ('348', '985', '2006-02-16T02:30:53', '2005-08-19T16:20:56', '2005-08-23T15:51:56', '2'), - ('280', '766', '2006-02-16T02:30:53', '2005-05-31T02:39:16', '2005-06-01T06:03:16', '2'), - ('210', '2883', '2006-02-16T02:30:53', '2005-07-28T05:36:13', '2005-08-03T11:28:13', '2'), - ('151', '2704', '2006-02-16T02:30:53', '2005-07-12T13:41:16', '2005-07-13T14:41:16', '2'), - ('550', '1031', '2006-02-16T02:30:53', '2005-08-23T20:07:10', '2005-09-01T22:12:10', '2'), - ('451', '1078', '2006-02-16T02:30:53', '2005-07-27T02:20:22', '2005-08-02T05:04:22', '2'), - ('266', '3914', '2006-02-16T02:30:53', '2005-08-20T04:10:26', '2005-08-26T06:45:26', '2'), - ('468', '2520', '2006-02-16T02:30:53', '2005-06-17T09:32:10', '2005-06-23T03:50:10', '2'), - ('161', '3080', '2006-02-16T02:30:53', '2005-08-22T07:54:58', '2005-08-24T12:46:58', '2'), - ('53', '291', '2006-02-16T02:30:53', '2005-06-21T03:01:10', '2005-06-24T06:59:10', '2'), - ('31', '1620', '2006-02-16T02:30:53', '2005-06-19T10:06:20', '2005-06-21T04:30:20', '2'), - ('125', '2598', '2006-02-16T02:30:53', '2005-05-26T05:30:03', '2005-06-02T09:48:03', '2'), - ('326', '352', '2006-02-16T02:30:53', '2005-05-31T21:03:17', '2005-06-08T19:58:17', '2'), - ('225', '126', '2006-02-16T02:30:53', '2005-07-11T09:55:34', '2005-07-13T10:01:34', '2'), - ('598', '4525', '2006-02-16T02:30:53', '2005-08-22T19:54:26', '2005-08-29T01:38:26', '2'), - ('276', '3780', '2006-02-16T02:30:53', '2005-07-30T13:38:17', '2005-08-08T18:17:17', '2'), - ('251', '2724', '2006-02-16T02:30:53', '2005-06-21T17:24:40', '2005-06-29T13:59:40', '2'), - ('65', '1676', '2006-02-16T02:30:53', '2005-07-30T16:12:28', '2005-08-05T18:34:28', '2'), - ('534', '3744', '2006-02-16T02:30:53', '2005-08-18T20:07:46', '2005-08-26T18:49:46', '2'), - ('330', '1791', '2006-02-16T02:30:53', '2005-08-17T21:24:47', '2005-08-20T20:35:47', '2'), - ('407', '1780', '2006-02-16T02:30:53', '2005-08-02T12:32:28', '2005-08-11T18:15:28', '2'), - ('403', '2787', '2006-02-16T02:30:53', '2005-07-30T23:35:42', '2005-08-09T02:08:42', '2'), - ('358', '1248', '2006-02-16T02:30:53', '2005-07-31T02:37:44', '2005-08-02T07:07:44', '2'), - ('379', '1281', '2006-02-16T02:30:53', '2005-06-15T15:20:06', '2005-06-24T18:42:06', '2'), - ('23', '1515', '2006-02-16T02:30:53', '2005-07-06T11:43:44', '2005-07-13T07:55:44', '2'), - ('459', '3293', '2006-02-16T02:30:53', '2005-08-01T11:00:20', '2005-08-10T11:52:20', '2'), - ('205', '4426', '2006-02-16T02:30:53', '2005-08-20T17:20:49', '2005-08-24T16:52:49', '2'), - ('63', '2813', '2006-02-16T02:30:53', '2005-07-30T05:09:32', '2005-08-02T06:12:32', '2'), - ('292', '2502', '2006-02-16T02:30:53', '2005-08-22T12:38:20', '2005-08-27T07:36:20', '2'), - ('232', '700', '2006-02-16T02:30:53', '2005-07-30T15:03:16', '2005-07-31T16:09:16', '2'), - ('175', '2462', '2006-02-16T02:30:53', '2005-08-18T13:21:52', '2005-08-20T12:14:52', '2'), - ('543', '1758', '2006-02-16T02:30:53', '2005-08-23T13:46:27', '2005-08-27T10:16:27', '2'), - ('45', '341', '2006-02-16T02:30:53', '2005-08-23T22:13:04', '2005-09-01T02:48:04', '2'), - ('526', '1433', '2006-02-16T02:30:53', '2005-06-15T06:13:45', '2005-06-16T03:59:45', '2'), - ('265', '1113', '2006-02-16T02:30:53', '2005-07-29T15:39:29', '2005-08-01T10:33:29', '2'), - ('138', '366', '2006-02-16T02:30:53', '2005-07-29T07:06:03', '2005-08-06T12:00:03', '2'), - ('274', '1890', '2006-02-16T02:30:53', '2005-05-27T11:26:11', '2005-06-03T16:44:11', '2'), - ('165', '2533', '2006-02-16T02:30:53', '2005-07-30T12:06:58', '2005-08-08T11:33:58', '2'), - ('31', '1986', '2006-02-16T02:30:53', '2005-06-18T15:49:48', '2005-06-27T20:31:48', '2'), - ('86', '3525', '2006-02-16T02:30:53', '2005-07-07T13:05:52', '2005-07-10T12:17:52', '2'), - ('139', '1062', '2006-02-16T02:30:53', '2005-06-14T23:42:56', '2005-06-16T04:02:56', '2'), - ('339', '2782', '2006-02-16T02:30:53', '2005-08-18T17:52:51', '2005-08-25T14:40:51', '2'), - ('269', '3995', '2006-02-16T02:30:53', '2005-05-24T23:11:53', '2005-05-29T20:34:53', '2'), - ('249', '592', '2006-02-16T02:30:53', '2005-07-28T07:56:00', '2005-07-30T10:33:00', '2'), - ('352', '38', '2006-02-16T02:30:53', '2005-07-28T09:18:07', '2005-08-04T10:23:07', '2'), - ('85', '1857', '2006-02-16T02:30:53', '2005-07-31T16:03:55', '2005-08-04T15:16:55', '2'), - ('512', '2219', '2006-02-16T02:30:53', '2005-08-19T06:12:44', '2005-08-28T10:49:44', '2'), - ('468', '3878', '2006-02-16T02:30:53', '2005-05-26T20:35:19', '2005-06-04T02:31:19', '2'), - ('268', '695', '2006-02-16T02:30:53', '2005-08-21T05:38:05', '2005-08-28T09:07:05', '2'), - ('159', '1381', '2006-02-16T02:30:53', '2005-05-29T22:51:20', '2005-06-07T17:37:20', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['11754', '12033', '7058', '3564', '13052', '2960', '1453', '1140', '8136', '3047', '52', '4645', '12792', '6796', '5145', '1922', '6814', '5638', '3889', '11065', '8132', '9202', '4921', '7534', '11423', '9663', '5191', '9192', '512', '5414', '724', '1413', '1442', '3475', '8947', '8987', '9687', '15492', '13783', '11468', '3254', '10327', '13532', '6892', '12000', '8718', '8808', '11450', '1742', '8794', '13717', '8912', '10666', '2142', '15887', '11554', '3509', '13678', '9889', '13300', '3544', '12046', '13401', '6558', '12579', '478', '14069', '15880', '5496', '2064', '10935', '1245', '10836', '3791', '162', '16004', '11427', '7419', '13068', '9500', '1726', '7026', '13894', '4697', '8031', '12848', '8052', '15458', '1478', '5175', '15079', '11299', '14466', '4832', '11872', '7394', '15990', '15277', '13874', '8515']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('163', '3747', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('321', '2731', '2006-02-16T02:30:53', '2005-08-17T20:14:34', '2005-08-26T00:22:34', '2'), - ('90', '716', '2006-02-16T02:30:53', '2005-07-27T03:50:46', '2005-08-04T07:40:46', '2'), - ('402', '1096', '2006-02-16T02:30:53', '2005-07-06T03:02:13', '2005-07-13T01:41:13', '2'), - ('502', '3036', '2006-02-16T02:30:53', '2005-08-19T09:31:42', '2005-08-28T15:11:42', '2'), - ('16', '3970', '2006-02-16T02:30:53', '2005-06-20T07:10:09', '2005-06-26T08:14:09', '2'), - ('457', '3274', '2006-02-16T02:30:53', '2005-06-15T19:36:39', '2005-06-19T00:16:39', '2'), - ('10', '3731', '2006-02-16T02:30:53', '2005-05-31T19:36:30', '2005-06-07T18:33:30', '2'), - ('429', '3434', '2006-02-16T02:30:53', '2005-07-28T20:05:48', '2005-08-01T20:31:48', '2'), - ('13', '624', '2006-02-16T02:30:53', '2005-06-20T12:45:33', '2005-06-29T13:09:33', '2'), - ('507', '4017', '2006-02-16T02:30:53', '2005-05-25T06:51:29', '2005-05-31T01:27:29', '2'), - ('400', '687', '2006-02-16T02:30:53', '2005-07-08T09:20:09', '2005-07-09T06:07:09', '2'), - ('405', '1435', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('291', '227', '2006-02-16T02:30:53', '2005-07-12T16:44:16', '2005-07-16T14:48:16', '2'), - ('204', '2397', '2006-02-16T02:30:53', '2005-07-09T08:13:25', '2005-07-10T03:56:25', '2'), - ('343', '2484', '2006-02-16T02:30:53', '2005-06-17T06:04:25', '2005-06-18T09:15:25', '2'), - ('579', '1863', '2006-02-16T02:30:53', '2005-07-12T18:11:58', '2005-07-18T20:37:58', '2'), - ('570', '1528', '2006-02-16T02:30:53', '2005-07-10T06:32:49', '2005-07-13T04:32:49', '2'), - ('576', '2005', '2006-02-16T02:30:53', '2005-07-06T18:56:25', '2005-07-08T21:22:25', '2'), - ('357', '2226', '2006-02-16T02:30:53', '2005-08-02T06:57:55', '2005-08-06T01:31:55', '2'), - ('562', '1303', '2006-02-16T02:30:53', '2005-07-28T19:57:31', '2005-08-02T22:16:31', '2'), - ('466', '4525', '2006-02-16T02:30:53', '2005-07-30T12:43:24', '2005-08-07T10:39:24', '2'), - ('109', '425', '2006-02-16T02:30:53', '2005-07-08T21:43:21', '2005-07-10T16:06:21', '2'), - ('282', '2276', '2006-02-16T02:30:53', '2005-07-27T21:26:17', '2005-08-05T00:23:17', '2'), - ('241', '3431', '2006-02-16T02:30:53', '2005-08-02T19:57:13', '2005-08-06T00:54:13', '2'), - ('339', '2099', '2006-02-16T02:30:53', '2005-07-31T06:10:48', '2005-08-01T11:40:48', '2'), - ('167', '2131', '2006-02-16T02:30:53', '2005-07-09T10:26:48', '2005-07-10T15:52:48', '2'), - ('102', '2372', '2006-02-16T02:30:53', '2005-07-30T12:26:26', '2005-08-04T07:54:26', '2'), - ('231', '2176', '2006-02-16T02:30:53', '2005-05-28T03:07:50', '2005-06-05T02:12:50', '2'), - ('174', '1201', '2006-02-16T02:30:53', '2005-07-09T20:29:36', '2005-07-13T01:55:36', '2'), - ('416', '3770', '2006-02-16T02:30:53', '2005-05-29T05:53:23', '2005-06-05T04:01:23', '2'), - ('96', '3625', '2006-02-16T02:30:53', '2005-06-15T17:25:07', '2005-06-21T17:17:07', '2'), - ('122', '3912', '2006-02-16T02:30:53', '2005-06-15T18:55:34', '2005-06-22T20:41:34', '2'), - ('8', '2189', '2006-02-16T02:30:53', '2005-07-05T23:01:21', '2005-07-13T23:07:21', '2'), - ('24', '341', '2006-02-16T02:30:53', '2005-07-30T03:15:37', '2005-08-04T07:10:37', '2'), - ('135', '1434', '2006-02-16T02:30:53', '2005-07-30T04:37:36', '2005-08-08T10:14:36', '2'), - ('470', '3540', '2006-02-16T02:30:53', '2005-07-31T06:52:54', '2005-08-01T03:40:54', '2'), - ('520', '1298', '2006-02-16T02:30:53', '2005-08-23T02:13:46', '2005-08-26T21:53:46', '2'), - ('28', '2643', '2006-02-16T02:30:53', '2005-08-20T12:11:03', '2005-08-21T15:53:03', '2'), - ('413', '3168', '2006-02-16T02:30:53', '2005-08-02T21:47:26', '2005-08-05T02:30:26', '2'), - ('472', '3893', '2006-02-16T02:30:53', '2005-06-21T03:27:10', '2005-06-22T22:01:10', '2'), - ('382', '328', '2006-02-16T02:30:53', '2005-08-01T04:55:35', '2005-08-07T08:17:35', '2'), - ('168', '1433', '2006-02-16T02:30:53', '2005-08-20T03:29:28', '2005-08-23T22:53:28', '2'), - ('138', '1567', '2006-02-16T02:30:53', '2005-07-12T21:10:04', '2005-07-13T23:03:04', '2'), - ('149', '2256', '2006-02-16T02:30:53', '2005-08-17T18:49:44', '2005-08-24T16:34:44', '2'), - ('23', '137', '2006-02-16T02:30:53', '2005-07-29T17:41:14', '2005-08-01T18:22:14', '2'), - ('173', '593', '2006-02-16T02:30:53', '2005-07-29T21:39:07', '2005-08-03T02:09:07', '2'), - ('214', '2009', '2006-02-16T02:30:53', '2005-08-02T20:45:54', '2005-08-08T17:17:54', '2'), - ('576', '2772', '2006-02-16T02:30:53', '2005-06-16T16:37:48', '2005-06-17T19:47:48', '2'), - ('320', '3509', '2006-02-16T02:30:53', '2005-07-29T20:59:38', '2005-07-31T00:15:38', '2'), - ('300', '1629', '2006-02-16T02:30:53', '2005-08-20T09:50:52', '2005-08-28T11:32:52', '2'), - ('280', '1686', '2006-02-16T02:30:53', '2005-07-30T01:31:25', '2005-08-02T07:14:25', '2'), - ('197', '1945', '2006-02-16T02:30:53', '2005-08-01T16:56:36', '2005-08-07T22:23:36', '2'), - ('253', '1787', '2006-02-16T02:30:53', '2005-06-17T21:55:43', '2005-06-26T19:41:43', '2'), - ('201', '4263', '2006-02-16T02:30:53', '2005-08-23T16:54:09', '2005-08-26T13:20:09', '2'), - ('460', '2212', '2006-02-16T02:30:53', '2005-08-17T01:05:17', '2005-08-20T06:20:17', '2'), - ('182', '4394', '2006-02-16T02:30:53', '2005-07-06T00:24:57', '2005-07-09T18:48:57', '2'), - ('337', '1118', '2006-02-16T02:30:53', '2005-08-20T08:38:24', '2005-08-27T13:54:24', '2'), - ('143', '2842', '2006-02-16T02:30:53', '2005-07-31T14:02:50', '2005-08-05T12:09:50', '2'), - ('531', '842', '2006-02-16T02:30:53', '2005-08-19T18:46:56', '2005-08-28T20:23:56', '2'), - ('115', '3098', '2006-02-16T02:30:53', '2005-07-06T02:06:32', '2005-07-09T04:35:32', '2'), - ('435', '3895', '2006-02-16T02:30:53', '2005-08-17T20:47:46', '2005-08-19T16:09:46', '2'), - ('139', '488', '2006-02-16T02:30:53', '2005-08-19T22:16:16', '2005-08-25T19:01:16', '2'), - ('164', '2195', '2006-02-16T02:30:53', '2005-07-12T05:16:07', '2005-07-13T05:32:07', '2'), - ('547', '3021', '2006-02-16T02:30:53', '2005-08-18T15:47:49', '2005-08-20T18:12:49', '2'), - ('557', '424', '2006-02-16T02:30:53', '2005-05-27T22:38:20', '2005-05-31T18:39:20', '2'), - ('197', '2239', '2006-02-16T02:30:53', '2005-08-20T22:51:25', '2005-08-30T00:30:25', '2'), - ('528', '2538', '2006-02-16T02:30:53', '2005-08-23T16:43:54', '2005-08-31T14:40:54', '2'), - ('369', '3182', '2006-02-16T02:30:53', '2005-07-10T00:20:23', '2005-07-18T21:10:23', '2'), - ('67', '1970', '2006-02-16T02:30:53', '2005-06-17T15:57:56', '2005-06-23T21:04:56', '2'), - ('42', '4373', '2006-02-16T02:30:53', '2005-08-02T02:54:53', '2005-08-10T00:07:53', '2'), - ('234', '1314', '2006-02-16T02:30:53', '2005-06-15T05:09:01', '2005-06-22T06:55:01', '2'), - ('217', '4534', '2006-02-16T02:30:53', '2005-08-01T23:29:58', '2005-08-07T23:03:58', '2'), - ('452', '3426', '2006-02-16T02:30:53', '2005-07-06T14:24:56', '2005-07-14T11:06:56', '2'), - ('296', '1229', '2006-02-16T02:30:53', '2005-05-26T02:02:05', '2005-05-27T03:38:05', '2'), - ('147', '2223', '2006-02-16T02:30:53', '2005-08-23T20:53:20', '2005-08-31T15:15:20', '2'), - ('403', '3287', '2006-02-16T02:30:53', '2005-08-02T20:02:39', '2005-08-04T22:26:39', '2'), - ('352', '3454', '2006-02-16T02:30:53', '2005-07-27T17:04:15', '2005-08-05T21:54:15', '2'), - ('1', '3019', '2006-02-16T02:30:53', '2005-08-19T09:55:16', '2005-08-20T14:44:16', '2'), - ('241', '2808', '2006-02-16T02:30:53', '2005-07-30T23:58:36', '2005-08-07T21:08:36', '2'), - ('3', '116', '2006-02-16T02:30:53', '2005-06-16T15:19:10', '2005-06-25T11:39:10', '2'), - ('493', '3456', '2006-02-16T02:30:53', '2005-07-27T02:48:58', '2005-07-29T03:41:58', '2'), - ('360', '2649', '2006-02-16T02:30:53', '2005-08-20T15:55:20', '2005-08-26T17:26:20', '2'), - ('224', '4143', '2006-02-16T02:30:53', '2005-07-08T11:19:14', '2005-07-12T07:14:14', '2'), - ('40', '2196', '2006-02-16T02:30:53', '2005-07-28T16:15:49', '2005-08-02T18:27:49', '2'), - ('539', '2833', '2006-02-16T02:30:53', '2005-08-19T02:05:11', '2005-08-24T05:27:11', '2'), - ('166', '2460', '2006-02-16T02:30:53', '2005-07-28T16:57:31', '2005-08-03T18:03:31', '2'), - ('590', '25', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('336', '435', '2006-02-16T02:30:53', '2005-06-15T21:12:13', '2005-06-18T21:43:13', '2'), - ('409', '1003', '2006-02-16T02:30:53', '2005-07-09T09:34:28', '2005-07-15T15:19:28', '2'), - ('540', '4552', '2006-02-16T02:30:53', '2005-08-22T11:09:56', '2005-08-24T15:40:56', '2'), - ('1', '3232', '2006-02-16T02:30:53', '2005-08-02T15:36:52', '2005-08-10T16:40:52', '2'), - ('442', '923', '2006-02-16T02:30:53', '2005-08-21T13:03:13', '2005-08-22T15:19:13', '2'), - ('509', '1838', '2006-02-16T02:30:53', '2005-07-08T18:07:05', '2005-07-10T19:37:05', '2'), - ('113', '4306', '2006-02-16T02:30:53', '2005-08-17T14:11:45', '2005-08-21T17:02:45', '2'), - ('30', '2399', '2006-02-16T02:30:53', '2005-07-27T16:03:08', '2005-08-04T11:27:08', '2'), - ('512', '3233', '2006-02-16T02:30:53', '2005-08-23T20:25:11', '2005-08-25T15:01:11', '2'), - ('217', '1780', '2006-02-16T02:30:53', '2005-08-22T19:02:48', '2005-08-31T18:53:48', '2'), - ('86', '72', '2006-02-16T02:30:53', '2005-08-20T15:11:48', '2005-08-21T18:26:48', '2'), - ('477', '1071', '2006-02-16T02:30:53', '2005-07-29T09:55:20', '2005-08-05T07:08:20', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['1525', '346', '4929', '15976', '3045', '2950', '13942', '14164', '13103', '1932', '10007', '11532', '4977', '332', '13639', '3978', '356', '3172', '15197', '3523', '18', '6263', '13540', '12286', '5218', '11031', '1074', '10362', '10098', '491', '1939', '13002', '13589', '9115', '1417', '13444', '329', '484', '4778', '9140', '2226', '338', '13756', '9438', '9937', '8854', '5345', '8389', '6219', '1977', '3072', '8672', '12796', '14203', '5097', '10465', '13925', '8421', '1193', '14016', '8979', '7635', '11021', '2310', '2604', '13803', '7080', '13308', '1206', '6231', '8975', '15573', '13248', '15465', '1459', '2499', '3711', '14640', '8298', '8386', '15055', '6264', '5834', '4798', '15654', '9704', '6351', '1817', '4638', '857', '14139', '7126', '10111', '5817', '8508', '9071', '7005', '12745', '2180', '7504']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('304', '1467', '2006-02-16T02:30:53', '2005-06-16T00:26:07', '2005-06-19T22:37:07', '2'), - ('14', '4319', '2006-02-16T02:30:53', '2005-05-27T04:34:41', '2005-06-05T04:24:41', '2'), - ('297', '734', '2006-02-16T02:30:53', '2005-07-08T22:06:18', '2005-07-17T18:17:18', '2'), - ('227', '835', '2006-02-16T02:30:53', '2005-08-23T20:07:08', '2005-08-25T01:47:08', '2'), - ('459', '3065', '2006-02-16T02:30:53', '2005-06-20T12:42:00', '2005-06-23T10:49:00', '2'), - ('561', '1438', '2006-02-16T02:30:53', '2005-06-20T06:08:36', '2005-06-27T07:45:36', '2'), - ('211', '4403', '2006-02-16T02:30:53', '2005-08-20T17:30:52', '2005-08-25T13:46:52', '2'), - ('274', '2381', '2006-02-16T02:30:53', '2005-08-21T02:58:02', '2005-08-29T23:17:02', '2'), - ('274', '1751', '2006-02-16T02:30:53', '2005-08-19T11:05:51', '2005-08-26T09:16:51', '2'), - ('120', '3185', '2006-02-16T02:30:53', '2005-06-17T06:54:41', '2005-06-19T05:12:41', '2'), - ('445', '293', '2006-02-16T02:30:53', '2005-07-31T17:54:58', '2005-08-05T17:24:58', '2'), - ('413', '1947', '2006-02-16T02:30:53', '2005-08-17T00:34:14', '2005-08-22T19:37:14', '2'), - ('584', '3310', '2006-02-16T02:30:53', '2005-07-09T00:15:50', '2005-07-10T00:34:50', '2'), - ('299', '1529', '2006-02-16T02:30:53', '2005-05-27T02:27:10', '2005-06-03T01:26:10', '2'), - ('562', '2489', '2006-02-16T02:30:53', '2005-08-20T07:22:07', '2005-08-23T11:24:07', '2'), - ('343', '4341', '2006-02-16T02:30:53', '2005-07-06T23:04:33', '2005-07-10T17:45:33', '2'), - ('382', '2868', '2006-02-16T02:30:53', '2005-05-27T06:32:30', '2005-05-30T06:24:30', '2'), - ('31', '1758', '2006-02-16T02:30:53', '2005-06-20T22:19:25', '2005-06-24T17:18:25', '2'), - ('159', '2915', '2006-02-16T02:30:53', '2005-08-22T16:14:25', '2005-08-26T16:22:25', '2'), - ('549', '2171', '2006-02-16T02:30:53', '2005-07-06T01:01:38', '2005-07-10T20:24:38', '2'), - ('19', '3376', '2006-02-16T02:30:53', '2005-05-25T01:10:47', '2005-05-31T06:35:47', '2'), - ('336', '2391', '2006-02-16T02:30:53', '2005-07-11T15:33:50', '2005-07-17T12:49:50', '2'), - ('557', '3785', '2006-02-16T02:30:53', '2005-08-20T03:41:23', '2005-08-27T09:09:23', '2'), - ('34', '3729', '2006-02-16T02:30:53', '2005-08-18T04:57:59', '2005-08-18T23:20:59', '2'), - ('83', '1121', '2006-02-16T02:30:53', '2005-07-09T11:57:12', '2005-07-13T06:34:12', '2'), - ('361', '1205', '2006-02-16T02:30:53', '2005-08-02T05:52:58', '2005-08-07T07:14:58', '2'), - ('503', '2508', '2006-02-16T02:30:53', '2005-05-31T10:04:42', '2005-06-02T15:27:42', '2'), - ('181', '72', '2006-02-16T02:30:53', '2005-08-01T05:55:13', '2005-08-10T10:23:13', '2'), - ('155', '1324', '2006-02-16T02:30:53', '2005-07-31T20:41:17', '2005-08-02T00:06:17', '2'), - ('196', '1326', '2006-02-16T02:30:53', '2005-05-28T00:13:35', '2005-05-29T00:11:35', '2'), - ('11', '605', '2006-02-16T02:30:53', '2005-06-17T07:26:45', '2005-06-25T13:06:45', '2'), - ('477', '3892', '2006-02-16T02:30:53', '2005-08-19T07:37:58', '2005-08-26T11:32:58', '2'), - ('574', '3216', '2006-02-16T02:30:53', '2005-08-20T05:47:25', '2005-08-23T01:29:25', '2'), - ('322', '3750', '2006-02-16T02:30:53', '2005-07-30T09:13:55', '2005-08-04T04:02:55', '2'), - ('570', '1334', '2006-02-16T02:30:53', '2005-06-15T17:45:51', '2005-06-19T14:00:51', '2'), - ('37', '2564', '2006-02-16T02:30:53', '2005-08-20T00:00:24', '2005-08-21T05:59:24', '2'), - ('231', '2659', '2006-02-16T02:30:53', '2005-05-27T01:57:14', '2005-05-31T04:19:14', '2'), - ('491', '3115', '2006-02-16T02:30:53', '2005-05-27T23:26:45', '2005-05-29T21:16:45', '2'), - ('78', '611', '2006-02-16T02:30:53', '2005-07-08T15:51:51', '2005-07-12T16:58:51', '2'), - ('25', '4095', '2006-02-16T02:30:53', '2005-07-30T10:12:01', '2005-08-06T09:16:01', '2'), - ('225', '3487', '2006-02-16T02:30:53', '2005-06-18T03:39:56', '2005-06-24T07:26:56', '2'), - ('165', '2596', '2006-02-16T02:30:53', '2005-05-27T03:42:52', '2005-06-01T05:23:52', '2'), - ('252', '1146', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('14', '121', '2006-02-16T02:30:53', '2005-07-30T21:36:15', '2005-08-07T16:54:15', '2'), - ('521', '3697', '2006-02-16T02:30:53', '2005-07-31T15:28:10', '2005-08-06T21:20:10', '2'), - ('527', '1365', '2006-02-16T02:30:53', '2005-07-29T23:40:07', '2005-08-01T00:35:07', '2'), - ('348', '3055', '2006-02-16T02:30:53', '2005-07-09T17:28:18', '2005-07-11T14:30:18', '2'), - ('133', '1241', '2006-02-16T02:30:53', '2005-07-29T05:50:09', '2005-08-06T05:15:09', '2'), - ('303', '38', '2006-02-16T02:30:53', '2005-07-11T13:18:37', '2005-07-13T13:18:37', '2'), - ('459', '2468', '2006-02-16T02:30:53', '2005-06-17T09:38:22', '2005-06-23T14:19:22', '2'), - ('423', '4131', '2006-02-16T02:30:53', '2005-06-20T14:21:31', '2005-06-27T18:46:31', '2'), - ('495', '405', '2006-02-16T02:30:53', '2005-07-29T15:49:48', '2005-08-06T17:59:48', '2'), - ('368', '1285', '2006-02-16T02:30:53', '2005-08-19T00:22:24', '2005-08-19T22:53:24', '2'), - ('95', '3668', '2006-02-16T02:30:53', '2005-08-21T03:51:52', '2005-08-24T06:13:52', '2'), - ('343', '3252', '2006-02-16T02:30:53', '2005-07-09T06:09:51', '2005-07-10T03:55:51', '2'), - ('534', '4384', '2006-02-16T02:30:53', '2005-08-01T09:45:25', '2005-08-10T09:08:25', '2'), - ('565', '4034', '2006-02-16T02:30:53', '2005-08-20T17:05:34', '2005-08-27T15:32:34', '2'), - ('588', '3399', '2006-02-16T02:30:53', '2005-07-29T07:00:47', '2005-08-02T08:03:47', '2'), - ('561', '4504', '2006-02-16T02:30:53', '2005-06-15T01:24:20', '2005-06-21T02:29:20', '2'), - ('220', '509', '2006-02-16T02:30:53', '2005-08-20T20:52:03', '2005-08-23T18:04:03', '2'), - ('529', '1394', '2006-02-16T02:30:53', '2005-07-30T04:20:25', '2005-08-08T03:39:25', '2'), - ('413', '55', '2006-02-16T02:30:53', '2005-07-28T01:08:11', '2005-08-01T03:32:11', '2'), - ('385', '2069', '2006-02-16T02:30:53', '2005-08-02T05:30:11', '2005-08-05T05:50:11', '2'), - ('409', '2590', '2006-02-16T02:30:53', '2005-06-18T08:45:59', '2005-06-26T05:06:59', '2'), - ('28', '2889', '2006-02-16T02:30:53', '2005-06-19T06:30:10', '2005-06-25T11:16:10', '2'), - ('486', '1084', '2006-02-16T02:30:53', '2005-08-20T12:46:17', '2005-08-24T15:44:17', '2'), - ('466', '710', '2006-02-16T02:30:53', '2005-07-27T04:25:25', '2005-08-04T04:22:25', '2'), - ('414', '3189', '2006-02-16T02:30:53', '2005-08-19T18:59:42', '2005-08-28T13:21:42', '2'), - ('264', '1097', '2006-02-16T02:30:53', '2005-06-15T02:27:07', '2005-06-18T22:46:07', '2'), - ('122', '2526', '2006-02-16T02:30:53', '2005-07-11T14:02:36', '2005-07-13T19:04:36', '2'), - ('356', '3288', '2006-02-16T02:30:53', '2005-07-30T04:10:18', '2005-08-07T01:06:18', '2'), - ('561', '3133', '2006-02-16T02:30:53', '2005-08-23T05:28:36', '2005-08-27T05:37:36', '2'), - ('559', '2864', '2006-02-16T02:30:53', '2005-08-19T16:47:41', '2005-08-28T18:11:41', '2'), - ('520', '362', '2006-02-16T02:30:53', '2005-08-23T01:16:33', '2005-08-28T20:08:33', '2'), - ('218', '1862', '2006-02-16T02:30:53', '2005-06-15T20:25:53', '2005-06-22T23:34:53', '2'), - ('348', '3172', '2006-02-16T02:30:53', '2005-06-18T23:01:36', '2005-06-20T21:50:36', '2'), - ('75', '1914', '2006-02-16T02:30:53', '2005-07-06T10:46:15', '2005-07-07T09:25:15', '2'), - ('253', '1880', '2006-02-16T02:30:53', '2005-08-21T19:03:19', '2005-08-27T00:37:19', '2'), - ('493', '952', '2006-02-16T02:30:53', '2005-07-29T02:47:36', '2005-08-05T07:58:36', '2'), - ('435', '388', '2006-02-16T02:30:53', '2005-07-29T05:45:30', '2005-08-05T03:56:30', '2'), - ('125', '623', '2006-02-16T02:30:53', '2005-08-22T10:14:39', '2005-08-25T07:25:39', '2'), - ('565', '4246', '2006-02-16T02:30:53', '2005-07-11T15:42:35', '2005-07-12T11:29:35', '2'), - ('360', '85', '2006-02-16T02:30:53', '2005-07-10T16:44:12', '2005-07-14T11:34:12', '2'), - ('212', '3874', '2006-02-16T02:30:53', '2005-07-08T16:45:16', '2005-07-16T13:45:16', '2'), - ('471', '4360', '2006-02-16T02:30:53', '2005-08-23T08:34:53', '2005-08-30T04:18:53', '2'), - ('385', '1402', '2006-02-16T02:30:53', '2005-07-31T07:39:32', '2005-08-06T01:50:32', '2'), - ('507', '1852', '2006-02-16T02:30:53', '2005-07-11T20:31:44', '2005-07-18T17:16:44', '2'), - ('574', '1354', '2006-02-16T02:30:53', '2005-06-16T21:20:52', '2005-06-19T16:24:52', '2'), - ('305', '2240', '2006-02-16T02:30:53', '2005-07-08T08:57:20', '2005-07-10T05:08:20', '2'), - ('204', '2569', '2006-02-16T02:30:53', '2005-05-30T02:01:23', '2005-06-02T06:07:23', '2'), - ('561', '2280', '2006-02-16T02:30:53', '2005-08-21T02:04:33', '2005-08-22T04:16:33', '2'), - ('582', '3240', '2006-02-16T02:30:53', '2005-07-27T06:13:13', '2005-07-28T08:22:13', '2'), - ('38', '3474', '2006-02-16T02:30:53', '2005-07-31T21:08:33', '2005-08-06T02:58:33', '2'), - ('28', '2993', '2006-02-16T02:30:53', '2005-07-10T15:49:12', '2005-07-18T19:30:12', '2'), - ('484', '4173', '2006-02-16T02:30:53', '2005-07-29T09:34:38', '2005-08-01T14:52:38', '2'), - ('523', '3151', '2006-02-16T02:30:53', '2005-07-30T07:40:58', '2005-08-01T06:59:58', '2'), - ('446', '2438', '2006-02-16T02:30:53', '2005-07-27T01:38:36', '2005-08-02T05:56:36', '2'), - ('24', '262', '2006-02-16T02:30:53', '2005-08-18T22:22:45', '2005-08-20T01:44:45', '2'), - ('497', '3564', '2006-02-16T02:30:53', '2005-06-18T00:47:43', '2005-06-25T04:12:43', '2'), - ('283', '3354', '2006-02-16T02:30:53', '2005-07-27T20:24:31', '2005-07-30T21:25:31', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['2130', '5808', '7301', '4040', '11039', '6211', '6152', '3467', '11915', '1848', '1736', '4296', '8377', '13480', '11700', '15456', '2985', '6518', '1661', '7288', '5182', '11720', '1845', '13632', '2006', '6870', '11015', '8120', '4788', '3142', '8973', '3275', '66', '4705', '12911', '8443', '8482', '2587', '9976', '14050', '9469', '6590', '16009', '8554', '13519', '5437', '2065', '13196', '10764', '4323', '15678', '9689', '911', '11429', '2017', '14026', '10', '481', '8493', '3427', '15248', '6852', '3618', '10552', '2609', '11765', '11252', '173', '9427', '8077', '1740', '279', '3585', '5932', '10270', '11431', '11099', '13252', '2197', '4047', '5284', '7309', '12491', '13138', '14338', '10763', '1660', '1688', '14947', '2349', '15637', '3245', '12850', '4015', '12529', '8869', '9372', '15606', '4156', '10975']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('413', '1369', '2006-02-16T02:30:53', '2005-06-17T21:00:44', '2005-06-26T00:05:44', '2'), - ('170', '2310', '2006-02-16T02:30:53', '2005-07-10T15:17:33', '2005-07-14T12:14:33', '2'), - ('93', '3367', '2006-02-16T02:30:53', '2005-07-27T12:50:23', '2005-08-01T09:43:23', '2'), - ('103', '3046', '2006-02-16T02:30:53', '2005-07-07T03:02:40', '2005-07-16T06:05:40', '2'), - ('170', '549', '2006-02-16T02:30:53', '2005-08-02T06:00:53', '2005-08-05T06:19:53', '2'), - ('6', '2699', '2006-02-16T02:30:53', '2005-07-11T12:39:01', '2005-07-20T15:59:01', '2'), - ('361', '560', '2006-02-16T02:30:53', '2005-07-11T09:25:52', '2005-07-17T07:40:52', '2'), - ('543', '729', '2006-02-16T02:30:53', '2005-06-21T22:19:25', '2005-06-27T00:03:25', '2'), - ('269', '1557', '2006-02-16T02:30:53', '2005-08-17T16:05:28', '2005-08-25T19:53:28', '2'), - ('526', '3797', '2006-02-16T02:30:53', '2005-06-17T00:07:07', '2005-06-21T21:41:07', '2'), - ('139', '3771', '2006-02-16T02:30:53', '2005-06-16T15:52:32', '2005-06-21T14:39:32', '2'), - ('407', '977', '2006-02-16T02:30:53', '2005-07-07T16:16:03', '2005-07-08T20:16:03', '2'), - ('73', '270', '2006-02-16T02:30:53', '2005-07-29T05:27:40', '2005-07-30T02:52:40', '2'), - ('16', '206', '2006-02-16T02:30:53', '2005-08-20T01:10:27', '2005-08-27T22:18:27', '2'), - ('104', '2365', '2006-02-16T02:30:53', '2005-08-17T07:12:31', '2005-08-18T04:21:31', '2'), - ('262', '2451', '2006-02-16T02:30:53', '2005-08-23T01:07:01', '2005-08-24T23:28:01', '2'), - ('154', '122', '2006-02-16T02:30:53', '2005-06-20T08:45:08', '2005-06-22T04:26:08', '2'), - ('288', '2698', '2006-02-16T02:30:53', '2005-07-12T03:59:42', '2005-07-19T22:21:42', '2'), - ('508', '2403', '2006-02-16T02:30:53', '2005-06-16T10:12:57', '2005-06-24T09:23:57', '2'), - ('226', '45', '2006-02-16T02:30:53', '2005-07-27T12:24:59', '2005-08-02T15:52:59', '2'), - ('197', '725', '2006-02-16T02:30:53', '2005-07-09T10:08:10', '2005-07-16T14:36:10', '2'), - ('121', '1707', '2006-02-16T02:30:53', '2005-08-17T07:46:54', '2005-08-26T04:19:54', '2'), - ('215', '3395', '2006-02-16T02:30:53', '2005-06-16T23:56:11', '2005-06-19T01:41:11', '2'), - ('409', '4008', '2006-02-16T02:30:53', '2005-08-20T07:10:52', '2005-08-29T10:19:52', '2'), - ('215', '992', '2006-02-16T02:30:53', '2005-06-17T11:47:03', '2005-06-19T13:47:03', '2'), - ('13', '3102', '2006-02-16T02:30:53', '2005-07-12T20:13:45', '2005-07-16T22:09:45', '2'), - ('138', '4331', '2006-02-16T02:30:53', '2005-08-02T05:13:00', '2005-08-08T04:18:00', '2'), - ('235', '3993', '2006-02-16T02:30:53', '2005-07-28T19:24:24', '2005-07-31T14:31:24', '2'), - ('533', '691', '2006-02-16T02:30:53', '2005-07-08T16:17:35', '2005-07-11T11:56:35', '2'), - ('9', '3926', '2006-02-16T02:30:53', '2005-06-20T19:59:28', '2005-06-28T19:51:28', '2'), - ('282', '886', '2006-02-16T02:30:53', '2005-07-30T04:09:13', '2005-08-07T22:30:13', '2'), - ('368', '2320', '2006-02-16T02:30:53', '2005-06-21T05:33:04', '2005-06-30T00:37:04', '2'), - ('86', '1162', '2006-02-16T02:30:53', '2005-05-25T09:35:12', '2005-05-29T04:16:12', '2'), - ('85', '3709', '2006-02-16T02:30:53', '2005-07-08T11:50:38', '2005-07-12T15:58:38', '2'), - ('367', '1770', '2006-02-16T02:30:53', '2005-08-19T04:24:10', '2005-08-26T00:35:10', '2'), - ('251', '1059', '2006-02-16T02:30:53', '2005-07-29T07:33:12', '2005-08-02T01:36:12', '2'), - ('405', '2686', '2006-02-16T02:30:53', '2005-07-29T08:46:33', '2005-07-31T11:07:33', '2'), - ('331', '2188', '2006-02-16T02:30:53', '2005-06-19T05:06:14', '2005-06-24T10:50:14', '2'), - ('579', '4219', '2006-02-16T02:30:53', '2005-07-31T16:57:49', '2005-08-03T16:33:49', '2'), - ('596', '1737', '2006-02-16T02:30:53', '2005-08-20T22:09:04', '2005-08-26T01:39:04', '2'), - ('59', '967', '2006-02-16T02:30:53', '2005-07-30T22:56:34', '2005-08-07T03:16:34', '2'), - ('442', '1067', '2006-02-16T02:30:53', '2005-07-12T07:08:21', '2005-07-18T06:16:21', '2'), - ('133', '3055', '2006-02-16T02:30:53', '2005-08-23T21:07:59', '2005-08-29T16:54:59', '2'), - ('582', '1563', '2006-02-16T02:30:53', '2005-07-29T11:16:29', '2005-07-31T06:38:29', '2'), - ('12', '182', '2006-02-16T02:30:53', '2005-08-20T02:37:07', '2005-08-23T01:26:07', '2'), - ('26', '3532', '2006-02-16T02:30:53', '2005-07-09T21:32:29', '2005-07-15T00:27:29', '2'), - ('266', '844', '2006-02-16T02:30:53', '2005-06-17T16:03:46', '2005-06-22T16:41:46', '2'), - ('202', '458', '2006-02-16T02:30:53', '2005-08-19T14:40:32', '2005-08-26T18:15:32', '2'), - ('357', '3808', '2006-02-16T02:30:53', '2005-08-01T20:32:42', '2005-08-03T22:14:42', '2'), - ('336', '1287', '2006-02-16T02:30:53', '2005-07-07T17:55:53', '2005-07-13T16:43:53', '2'), - ('413', '1345', '2006-02-16T02:30:53', '2005-08-23T09:23:45', '2005-08-27T11:38:45', '2'), - ('498', '819', '2006-02-16T02:30:53', '2005-07-31T07:00:08', '2005-08-04T03:33:08', '2'), - ('366', '1404', '2006-02-16T02:30:53', '2005-05-30T10:50:22', '2005-06-07T12:26:22', '2'), - ('348', '1098', '2006-02-16T02:30:53', '2005-08-02T20:03:52', '2005-08-10T16:38:52', '2'), - ('516', '1434', '2006-02-16T02:30:53', '2005-06-17T12:33:30', '2005-06-19T10:08:30', '2'), - ('231', '115', '2006-02-16T02:30:53', '2005-08-20T21:21:08', '2005-08-22T23:19:08', '2'), - ('399', '1824', '2006-02-16T02:30:53', '2005-05-25T00:02:21', '2005-05-31T22:44:21', '2'), - ('445', '72', '2006-02-16T02:30:53', '2005-05-27T22:49:27', '2005-05-30T17:46:27', '2'), - ('390', '664', '2006-02-16T02:30:53', '2005-07-29T09:04:31', '2005-08-04T05:17:31', '2'), - ('561', '560', '2006-02-16T02:30:53', '2005-06-21T18:31:09', '2005-06-22T14:18:09', '2'), - ('20', '977', '2006-02-16T02:30:53', '2005-08-22T17:53:06', '2005-08-25T18:43:06', '2'), - ('75', '2182', '2006-02-16T02:30:53', '2005-07-12T19:33:49', '2005-07-13T20:01:49', '2'), - ('264', '330', '2006-02-16T02:30:53', '2005-07-06T05:58:45', '2005-07-15T09:13:45', '2'), - ('119', '4263', '2006-02-16T02:30:53', '2005-08-01T12:49:44', '2005-08-04T16:20:44', '2'), - ('383', '2254', '2006-02-16T02:30:53', '2005-06-19T07:13:12', '2005-06-28T12:30:12', '2'), - ('308', '4311', '2006-02-16T02:30:53', '2005-08-17T09:55:28', '2005-08-19T15:53:28', '2'), - ('337', '2410', '2006-02-16T02:30:53', '2005-08-02T13:42:13', '2005-08-06T19:04:13', '2'), - ('533', '3596', '2006-02-16T02:30:53', '2005-05-26T03:42:10', '2005-05-28T01:37:10', '2'), - ('85', '1494', '2006-02-16T02:30:53', '2005-07-30T21:16:33', '2005-08-05T17:23:33', '2'), - ('122', '3253', '2006-02-16T02:30:53', '2005-07-28T17:54:35', '2005-07-29T19:28:35', '2'), - ('324', '2282', '2006-02-16T02:30:53', '2005-06-16T16:29:00', '2005-06-20T14:07:00', '2'), - ('384', '661', '2006-02-16T02:30:53', '2005-05-26T18:02:50', '2005-06-03T18:48:50', '2'), - ('266', '2726', '2006-02-16T02:30:53', '2005-07-06T04:22:36', '2005-07-09T06:16:36', '2'), - ('523', '2269', '2006-02-16T02:30:53', '2005-07-10T22:05:15', '2005-07-12T17:04:15', '2'), - ('168', '2025', '2006-02-16T02:30:53', '2005-08-01T03:10:24', '2005-08-07T03:04:24', '2'), - ('271', '1409', '2006-02-16T02:30:53', '2005-08-02T20:05:16', '2005-08-04T00:05:16', '2'), - ('102', '1444', '2006-02-16T02:30:53', '2005-08-02T08:07:12', '2005-08-07T12:11:12', '2'), - ('451', '775', '2006-02-16T02:30:53', '2005-08-19T16:50:50', '2005-08-22T22:09:50', '2'), - ('103', '3350', '2006-02-16T02:30:53', '2005-06-18T01:50:27', '2005-06-19T01:31:27', '2'), - ('364', '3475', '2006-02-16T02:30:53', '2005-07-07T03:28:49', '2005-07-09T02:42:49', '2'), - ('585', '1036', '2006-02-16T02:30:53', '2005-07-09T15:08:21', '2005-07-16T09:53:21', '2'), - ('317', '633', '2006-02-16T02:30:53', '2005-07-27T13:00:29', '2005-07-29T12:15:29', '2'), - ('247', '2354', '2006-02-16T02:30:53', '2005-08-18T12:48:45', '2005-08-22T12:40:45', '2'), - ('214', '3138', '2006-02-16T02:30:53', '2005-08-19T12:30:01', '2005-08-21T06:35:01', '2'), - ('205', '1789', '2006-02-16T02:30:53', '2005-08-21T08:36:03', '2005-08-24T12:31:03', '2'), - ('276', '987', '2006-02-16T02:30:53', '2005-08-01T20:32:27', '2005-08-05T01:24:27', '2'), - ('238', '2374', '2006-02-16T02:30:53', '2005-06-16T10:12:55', '2005-06-18T05:56:55', '2'), - ('49', '383', '2006-02-16T02:30:53', '2005-06-16T12:11:20', '2005-06-18T08:39:20', '2'), - ('68', '3497', '2006-02-16T02:30:53', '2005-08-22T06:07:52', '2005-08-28T01:12:52', '2'), - ('495', '1536', '2006-02-16T02:30:53', '2005-06-18T12:25:14', '2005-06-19T11:24:14', '2'), - ('172', '445', '2006-02-16T02:30:53', '2005-08-23T07:53:38', '2005-08-29T03:16:38', '2'), - ('358', '2057', '2006-02-16T02:30:53', '2005-06-21T03:06:11', '2005-06-25T08:06:11', '2'), - ('440', '1816', '2006-02-16T02:30:53', '2005-08-19T02:08:06', '2005-08-20T21:06:06', '2'), - ('233', '3032', '2006-02-16T02:30:53', '2005-07-07T00:59:46', '2005-07-14T03:16:46', '2'), - ('382', '1956', '2006-02-16T02:30:53', '2005-08-18T13:53:36', '2005-08-19T18:20:36', '2'), - ('308', '4353', '2006-02-16T02:30:53', '2005-07-30T00:06:32', '2005-07-31T20:49:32', '2'), - ('454', '4075', '2006-02-16T02:30:53', '2005-07-30T19:04:30', '2005-08-09T00:18:30', '2'), - ('279', '1811', '2006-02-16T02:30:53', '2005-08-23T06:50:27', '2005-08-28T04:23:27', '2'), - ('585', '1259', '2006-02-16T02:30:53', '2005-07-07T09:03:51', '2005-07-12T09:46:51', '2'), - ('361', '2616', '2006-02-16T02:30:53', '2005-08-02T04:11:25', '2005-08-04T04:39:25', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['8056', '10147', '1904', '9954', '6909', '10955', '12036', '439', '1456', '10319', '497', '4734', '777', '9467', '10287', '3956', '11820', '999', '2525', '12312', '3665', '10110', '12035', '12080', '12330', '2398', '14483', '7950', '8628', '9812', '13586', '8304', '4833', '818', '834', '13069', '11097', '7922', '12761', '1934', '5462', '14328', '4997', '9995', '15904', '9285', '6599', '4572', '3433', '14442', '12031', '5031', '13298', '6006', '3696', '7154', '4856', '13122', '3346', '10174', '6029', '1338', '10658', '3179', '14575', '976', '12368', '13931', '14856', '15842', '11717', '10977', '5666', '15913', '9414', '2636', '12770', '8595', '10256', '12460', '4248', '15896', '12279', '9143', '2947', '12015', '11051', '11730', '9714', '11224', '316', '10726', '7489', '12441', '12132', '9129', '15174', '4073', '13721', '9220']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('589', '4018', '2006-02-16T02:30:53', '2005-07-28T17:04:15', '2005-08-03T19:11:15', '2'), - ('198', '1351', '2006-02-16T02:30:53', '2005-07-31T22:18:43', '2005-08-02T23:08:43', '2'), - ('87', '2472', '2006-02-16T02:30:53', '2005-06-17T04:45:41', '2005-06-17T23:56:41', '2'), - ('463', '1830', '2006-02-16T02:30:53', '2005-07-31T15:57:07', '2005-08-05T12:04:07', '2'), - ('174', '769', '2006-02-16T02:30:53', '2005-07-12T22:09:30', '2005-07-17T02:05:30', '2'), - ('490', '618', '2006-02-16T02:30:53', '2005-08-02T03:32:34', '2005-08-09T21:53:34', '2'), - ('85', '3620', '2006-02-16T02:30:53', '2005-08-17T20:19:06', '2005-08-18T19:57:06', '2'), - ('319', '354', '2006-02-16T02:30:53', '2005-05-27T17:54:48', '2005-06-02T23:01:48', '2'), - ('590', '632', '2006-02-16T02:30:53', '2005-06-15T20:00:11', '2005-06-23T18:03:11', '2'), - ('394', '3120', '2006-02-16T02:30:53', '2005-08-01T04:37:19', '2005-08-05T03:18:19', '2'), - ('20', '2636', '2006-02-16T02:30:53', '2005-05-28T00:54:39', '2005-06-03T20:47:39', '2'), - ('546', '1928', '2006-02-16T02:30:53', '2005-07-08T13:12:12', '2005-07-10T09:01:12', '2'), - ('360', '451', '2006-02-16T02:30:53', '2005-05-29T14:07:58', '2005-06-03T08:41:58', '2'), - ('202', '1905', '2006-02-16T02:30:53', '2005-07-30T22:45:34', '2005-08-08T00:58:34', '2'), - ('141', '125', '2006-02-16T02:30:53', '2005-08-01T03:37:01', '2005-08-05T23:03:01', '2'), - ('147', '15', '2006-02-16T02:30:53', '2005-07-06T22:01:51', '2005-07-12T21:35:51', '2'), - ('401', '2801', '2006-02-16T02:30:53', '2005-08-17T12:25:33', '2005-08-19T07:04:33', '2'), - ('413', '4433', '2006-02-16T02:30:53', '2005-05-31T00:25:10', '2005-06-03T06:05:10', '2'), - ('365', '1307', '2006-02-16T02:30:53', '2005-06-19T00:48:22', '2005-06-24T19:10:22', '2'), - ('185', '80', '2006-02-16T02:30:53', '2005-08-18T06:07:26', '2005-08-21T02:07:26', '2'), - ('102', '922', '2006-02-16T02:30:53', '2005-07-06T08:23:08', '2005-07-13T13:38:08', '2'), - ('138', '4081', '2006-02-16T02:30:53', '2005-07-31T21:06:12', '2005-08-03T02:03:12', '2'), - ('469', '2335', '2006-02-16T02:30:53', '2005-08-17T20:18:06', '2005-08-21T16:41:06', '2'), - ('394', '1491', '2006-02-16T02:30:53', '2005-08-17T22:08:04', '2005-08-19T22:55:04', '2'), - ('587', '889', '2006-02-16T02:30:53', '2005-08-18T06:46:33', '2005-08-26T11:35:33', '2'), - ('526', '3001', '2006-02-16T02:30:53', '2005-06-18T15:56:53', '2005-06-27T14:25:53', '2'), - ('275', '37', '2006-02-16T02:30:53', '2005-08-21T13:43:59', '2005-08-28T16:38:59', '2'), - ('122', '2286', '2006-02-16T02:30:53', '2005-07-28T13:21:00', '2005-08-05T18:47:00', '2'), - ('550', '4484', '2006-02-16T02:30:53', '2005-07-29T14:06:24', '2005-08-06T10:42:24', '2'), - ('57', '1540', '2006-02-16T02:30:53', '2005-07-31T11:28:07', '2005-08-01T12:35:07', '2'), - ('445', '4544', '2006-02-16T02:30:53', '2005-08-20T05:40:33', '2005-08-25T01:32:33', '2'), - ('119', '4431', '2006-02-16T02:30:53', '2005-07-29T03:08:30', '2005-08-02T03:04:30', '2'), - ('581', '2921', '2006-02-16T02:30:53', '2005-07-08T18:07:35', '2005-07-13T15:29:35', '2'), - ('321', '4106', '2006-02-16T02:30:53', '2005-05-29T20:47:53', '2005-06-02T23:18:53', '2'), - ('84', '3628', '2006-02-16T02:30:53', '2005-05-29T23:24:30', '2005-05-30T22:00:30', '2'), - ('299', '368', '2006-02-16T02:30:53', '2005-08-19T09:55:20', '2005-08-24T04:10:20', '2'), - ('575', '2493', '2006-02-16T02:30:53', '2005-08-02T08:05:46', '2005-08-10T12:00:46', '2'), - ('125', '817', '2006-02-16T02:30:53', '2005-07-28T12:05:25', '2005-08-02T12:13:25', '2'), - ('364', '2684', '2006-02-16T02:30:53', '2005-08-18T23:05:22', '2005-08-22T01:08:22', '2'), - ('16', '4000', '2006-02-16T02:30:53', '2005-06-17T07:04:57', '2005-06-25T12:21:57', '2'), - ('583', '871', '2006-02-16T02:30:53', '2005-07-09T22:56:53', '2005-07-11T21:50:53', '2'), - ('489', '3194', '2006-02-16T02:30:53', '2005-08-21T08:18:20', '2005-08-25T03:05:20', '2'), - ('102', '186', '2006-02-16T02:30:53', '2005-07-09T01:06:03', '2005-07-18T04:21:03', '2'), - ('180', '1978', '2006-02-16T02:30:53', '2005-07-31T17:30:47', '2005-08-04T12:20:47', '2'), - ('37', '179', '2006-02-16T02:30:53', '2005-08-23T17:32:19', '2005-08-24T21:05:19', '2'), - ('273', '3686', '2006-02-16T02:30:53', '2005-07-30T15:26:08', '2005-08-06T15:59:08', '2'), - ('519', '4348', '2006-02-16T02:30:53', '2005-07-12T07:41:14', '2005-07-21T02:45:14', '2'), - ('323', '1324', '2006-02-16T02:30:53', '2005-07-08T05:36:59', '2005-07-12T04:46:59', '2'), - ('228', '1077', '2006-02-16T02:30:53', '2005-06-21T19:07:19', '2005-06-29T18:01:19', '2'), - ('205', '122', '2006-02-16T02:30:53', '2005-08-21T12:00:21', '2005-08-23T17:00:21', '2'), - ('10', '2793', '2006-02-16T02:30:53', '2005-08-17T20:11:35', '2005-08-24T23:48:35', '2'), - ('312', '4224', '2006-02-16T02:30:53', '2005-07-09T02:36:37', '2005-07-14T03:09:37', '2'), - ('361', '2133', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('399', '4201', '2006-02-16T02:30:53', '2005-07-11T01:38:42', '2005-07-17T05:18:42', '2'), - ('497', '3244', '2006-02-16T02:30:53', '2005-07-06T10:04:55', '2005-07-11T15:58:55', '2'), - ('518', '2019', '2006-02-16T02:30:53', '2005-07-27T07:16:17', '2005-07-28T04:04:17', '2'), - ('7', '2441', '2006-02-16T02:30:53', '2005-07-08T18:47:38', '2005-07-13T15:02:38', '2'), - ('277', '3319', '2006-02-16T02:30:53', '2005-08-19T11:53:49', '2005-08-26T16:01:49', '2'), - ('189', '4393', '2006-02-16T02:30:53', '2005-06-21T11:06:53', '2005-06-22T15:19:53', '2'), - ('359', '2459', '2006-02-16T02:30:53', '2005-07-31T23:40:08', '2005-08-06T21:08:08', '2'), - ('520', '2030', '2006-02-16T02:30:53', '2005-07-11T02:36:46', '2005-07-14T20:51:46', '2'), - ('25', '1206', '2006-02-16T02:30:53', '2005-06-15T12:17:34', '2005-06-19T07:40:34', '2'), - ('469', '2943', '2006-02-16T02:30:53', '2005-08-01T16:39:18', '2005-08-09T18:17:18', '2'), - ('163', '2214', '2006-02-16T02:30:53', '2005-06-20T22:37:59', '2005-06-26T22:26:59', '2'), - ('159', '3752', '2006-02-16T02:30:53', '2005-08-21T16:51:34', '2005-08-30T20:13:34', '2'), - ('581', '2290', '2006-02-16T02:30:53', '2005-05-30T21:11:19', '2005-06-06T02:16:19', '2'), - ('392', '3777', '2006-02-16T02:30:53', '2005-08-18T07:57:38', '2005-08-25T05:49:38', '2'), - ('32', '3884', '2006-02-16T02:30:53', '2005-08-20T17:16:10', '2005-08-27T12:03:10', '2'), - ('151', '3292', '2006-02-16T02:30:53', '2005-08-22T02:31:51', '2005-08-26T23:41:51', '2'), - ('146', '1850', '2006-02-16T02:30:53', '2005-08-23T15:36:05', '2005-08-30T14:05:05', '2'), - ('566', '1371', '2006-02-16T02:30:53', '2005-08-17T07:44:09', '2005-08-20T09:39:09', '2'), - ('300', '2302', '2006-02-16T02:30:53', '2005-08-02T04:12:17', '2005-08-06T06:52:17', '2'), - ('242', '2225', '2006-02-16T02:30:53', '2005-07-10T08:10:29', '2005-07-17T04:54:29', '2'), - ('93', '3894', '2006-02-16T02:30:53', '2005-08-23T17:48:30', '2005-08-31T21:17:30', '2'), - ('484', '578', '2006-02-16T02:30:53', '2005-07-30T20:46:02', '2005-08-07T21:23:02', '2'), - ('253', '2102', '2006-02-16T02:30:53', '2005-06-19T09:13:06', '2005-06-25T07:47:06', '2'), - ('575', '1654', '2006-02-16T02:30:53', '2005-08-18T23:29:00', '2005-08-26T20:57:00', '2'), - ('423', '3225', '2006-02-16T02:30:53', '2005-07-29T12:47:43', '2005-08-07T13:51:43', '2'), - ('58', '780', '2006-02-16T02:30:53', '2005-08-01T02:47:11', '2005-08-05T05:21:11', '2'), - ('419', '3550', '2006-02-16T02:30:53', '2005-08-18T11:25:13', '2005-08-27T06:27:13', '2'), - ('161', '773', '2006-02-16T02:30:53', '2005-07-07T13:59:20', '2005-07-14T15:18:20', '2'), - ('585', '528', '2006-02-16T02:30:53', '2005-08-23T17:09:56', '2005-08-31T14:51:56', '2'), - ('421', '4159', '2006-02-16T02:30:53', '2005-08-18T04:47:30', '2005-08-19T09:47:30', '2'), - ('511', '2962', '2006-02-16T02:30:53', '2005-07-30T10:22:11', '2005-08-07T06:13:11', '2'), - ('151', '4302', '2006-02-16T02:30:53', '2005-06-20T06:00:21', '2005-06-23T10:04:21', '2'), - ('11', '593', '2006-02-16T02:30:53', '2005-08-17T19:32:44', '2005-08-23T13:36:44', '2'), - ('446', '4189', '2006-02-16T02:30:53', '2005-08-02T06:23:39', '2005-08-06T06:46:39', '2'), - ('98', '3817', '2006-02-16T02:30:53', '2005-08-17T08:22:00', '2005-08-22T05:43:00', '2'), - ('144', '1532', '2006-02-16T02:30:53', '2005-07-31T08:15:32', '2005-08-03T08:33:32', '2'), - ('181', '3938', '2006-02-16T02:30:53', '2005-08-02T12:40:38', '2005-08-04T10:02:38', '2'), - ('249', '3828', '2006-02-16T02:30:53', '2005-05-26T23:22:55', '2005-05-29T23:25:55', '2'), - ('75', '749', '2006-02-16T02:30:53', '2005-08-01T19:14:53', '2005-08-08T23:56:53', '2'), - ('16', '3732', '2006-02-16T02:30:53', '2005-07-27T19:39:38', '2005-07-30T23:10:38', '2'), - ('561', '2163', '2006-02-16T02:30:53', '2005-08-18T10:47:57', '2005-08-26T07:11:57', '2'), - ('403', '2600', '2006-02-16T02:30:53', '2005-08-17T23:37:03', '2005-08-22T04:53:03', '2'), - ('125', '2658', '2006-02-16T02:30:53', '2005-07-30T09:51:21', '2005-08-07T08:50:21', '2'), - ('111', '19', '2006-02-16T02:30:53', '2005-08-22T15:26:36', '2005-08-31T10:47:36', '2'), - ('290', '647', '2006-02-16T02:30:53', '2005-07-07T04:49:13', '2005-07-10T03:20:13', '2'), - ('297', '1444', '2006-02-16T02:30:53', '2005-08-20T10:02:59', '2005-08-24T07:02:59', '2'), - ('569', '2463', '2006-02-16T02:30:53', '2005-07-30T13:17:27', '2005-08-07T11:34:27', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['9938', '2413', '15610', '109', '16047', '7350', '2745', '4688', '6143', '13952', '14632', '14828', '15632', '1767', '15791', '10804', '8259', '4336', '14986', '12967', '6543', '5596', '2171', '11282', '4874', '4484', '2371', '2136', '16012', '8273', '9357', '1898', '9070', '9529', '7361', '12959', '14931', '11456', '793', '8999', '15250', '15619', '10240', '12362', '1912', '13574', '13910', '6110', '7761', '1092', '12771', '13479', '3428', '11783', '10153', '16036', '7476', '4074', '7292', '9515', '6176', '8924', '14269', '13231', '3599', '9546', '1751', '1537', '9579', '1113', '6979', '12741', '14459', '1425', '6195', '10467', '13918', '5439', '15144', '3682', '4388', '10138', '8700', '11807', '4775', '12087', '1199', '13333', '14980', '6193', '1043', '9178', '6684', '9795', '5226', '4679', '8971', '15301', '10330', '11858']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('63', '2871', '2006-02-16T02:30:53', '2005-07-31T15:28:47', '2005-08-09T21:24:47', '2'), - ('170', '1851', '2006-02-16T02:30:53', '2005-06-18T16:59:34', '2005-06-27T16:10:34', '2'), - ('215', '2076', '2006-02-16T02:30:53', '2005-08-23T06:56:15', '2005-08-24T07:37:15', '2'), - ('503', '1044', '2006-02-16T02:30:53', '2005-05-25T18:40:20', '2005-05-29T20:39:20', '2'), - ('114', '2088', '2006-02-16T02:30:53', '2005-08-23T22:42:48', '2005-08-25T02:48:48', '2'), - ('410', '737', '2006-02-16T02:30:53', '2005-07-27T14:34:14', '2005-08-02T19:19:14', '2'), - ('26', '1253', '2006-02-16T02:30:53', '2005-06-19T16:21:19', '2005-06-21T22:07:19', '2'), - ('80', '3574', '2006-02-16T02:30:53', '2005-07-08T11:03:29', '2005-07-17T15:41:29', '2'), - ('169', '1030', '2006-02-16T02:30:53', '2005-07-11T09:02:37', '2005-07-19T05:57:37', '2'), - ('199', '224', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('38', '2807', '2006-02-16T02:30:53', '2005-08-21T18:48:06', '2005-08-25T00:33:06', '2'), - ('319', '4114', '2006-02-16T02:30:53', '2005-08-22T01:34:05', '2005-08-27T06:27:05', '2'), - ('60', '2941', '2006-02-16T02:30:53', '2005-08-23T07:30:26', '2005-08-24T07:53:26', '2'), - ('205', '1162', '2006-02-16T02:30:53', '2005-06-16T18:01:36', '2005-06-18T12:39:36', '2'), - ('445', '4147', '2006-02-16T02:30:53', '2005-08-23T14:02:13', '2005-09-01T09:03:13', '2'), - ('596', '2915', '2006-02-16T02:30:53', '2005-08-01T22:22:11', '2005-08-03T03:42:11', '2'), - ('274', '343', '2006-02-16T02:30:53', '2005-07-29T01:05:16', '2005-08-01T23:27:16', '2'), - ('532', '482', '2006-02-16T02:30:53', '2005-07-07T18:34:36', '2005-07-10T17:58:36', '2'), - ('278', '1493', '2006-02-16T02:30:53', '2005-08-22T07:37:24', '2005-08-23T04:22:24', '2'), - ('170', '3404', '2006-02-16T02:30:53', '2005-08-19T06:37:51', '2005-08-25T06:58:51', '2'), - ('264', '2568', '2006-02-16T02:30:53', '2005-07-12T04:54:32', '2005-07-15T09:50:32', '2'), - ('240', '1662', '2006-02-16T02:30:53', '2005-07-10T04:43:14', '2005-07-11T22:58:14', '2'), - ('147', '1768', '2006-02-16T02:30:53', '2005-06-18T00:06:04', '2005-06-24T18:09:04', '2'), - ('273', '1824', '2006-02-16T02:30:53', '2005-08-02T14:35:03', '2005-08-03T16:02:03', '2'), - ('223', '2386', '2006-02-16T02:30:53', '2005-07-08T19:23:38', '2005-07-13T14:39:38', '2'), - ('306', '2867', '2006-02-16T02:30:53', '2005-07-08T01:05:57', '2005-07-16T00:41:57', '2'), - ('248', '178', '2006-02-16T02:30:53', '2005-06-18T14:35:29', '2005-06-22T09:38:29', '2'), - ('20', '2651', '2006-02-16T02:30:53', '2005-06-17T21:16:41', '2005-06-24T22:42:41', '2'), - ('80', '2421', '2006-02-16T02:30:53', '2005-08-23T21:13:39', '2005-08-30T23:52:39', '2'), - ('532', '4244', '2006-02-16T02:30:53', '2005-07-29T01:33:16', '2005-08-06T04:26:16', '2'), - ('181', '3927', '2006-02-16T02:30:53', '2005-07-30T18:37:00', '2005-08-08T19:57:00', '2'), - ('143', '2873', '2006-02-16T02:30:53', '2005-06-17T04:28:11', '2005-06-25T07:04:11', '2'), - ('276', '3690', '2006-02-16T02:30:53', '2005-07-30T07:40:39', '2005-08-01T04:19:39', '2'), - ('123', '816', '2006-02-16T02:30:53', '2005-07-31T01:05:26', '2005-08-02T22:30:26', '2'), - ('463', '4567', '2006-02-16T02:30:53', '2005-07-27T14:53:55', '2005-07-31T19:48:55', '2'), - ('284', '1540', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('63', '657', '2006-02-16T02:30:53', '2005-08-22T05:38:55', '2005-08-28T04:15:55', '2'), - ('322', '3638', '2006-02-16T02:30:53', '2005-08-02T21:14:04', '2005-08-07T19:49:04', '2'), - ('528', '379', '2006-02-16T02:30:53', '2005-05-29T16:44:08', '2005-06-06T19:21:08', '2'), - ('424', '3458', '2006-02-16T02:30:53', '2005-07-30T04:55:46', '2005-08-01T00:16:46', '2'), - ('143', '2176', '2006-02-16T02:30:53', '2005-08-22T18:03:11', '2005-08-27T12:19:11', '2'), - ('3', '2468', '2006-02-16T02:30:53', '2005-08-23T07:10:14', '2005-08-26T07:21:14', '2'), - ('109', '4494', '2006-02-16T02:30:53', '2005-08-01T02:09:33', '2005-08-07T02:22:33', '2'), - ('367', '3131', '2006-02-16T02:30:53', '2005-08-18T07:48:05', '2005-08-20T05:16:05', '2'), - ('538', '4136', '2006-02-16T02:30:53', '2005-06-17T05:18:32', '2005-06-20T10:01:32', '2'), - ('552', '2383', '2006-02-16T02:30:53', '2005-08-20T05:10:39', '2005-08-21T02:21:39', '2'), - ('133', '252', '2006-02-16T02:30:53', '2005-08-20T16:30:49', '2005-08-24T13:30:49', '2'), - ('405', '541', '2006-02-16T02:30:53', '2005-07-11T07:23:47', '2005-07-20T03:17:47', '2'), - ('112', '3568', '2006-02-16T02:30:53', '2005-07-28T06:31:45', '2005-07-30T01:36:45', '2'), - ('278', '4412', '2006-02-16T02:30:53', '2005-05-31T12:15:57', '2005-06-03T15:39:57', '2'), - ('484', '3076', '2006-02-16T02:30:53', '2005-08-18T23:29:23', '2005-08-22T17:31:23', '2'), - ('87', '1262', '2006-02-16T02:30:53', '2005-08-20T01:09:11', '2005-08-26T05:35:11', '2'), - ('40', '1959', '2006-02-16T02:30:53', '2005-06-21T18:39:34', '2005-06-22T18:23:34', '2'), - ('152', '979', '2006-02-16T02:30:53', '2005-08-17T10:39:24', '2005-08-21T12:43:24', '2'), - ('297', '2945', '2006-02-16T02:30:53', '2005-07-31T22:30:10', '2005-08-06T02:32:10', '2'), - ('425', '1372', '2006-02-16T02:30:53', '2005-08-23T22:12:44', '2005-08-25T17:48:44', '2'), - ('64', '2288', '2006-02-16T02:30:53', '2005-07-27T19:08:56', '2005-07-31T16:36:56', '2'), - ('412', '2347', '2006-02-16T02:30:53', '2005-07-07T04:49:49', '2005-07-12T04:51:49', '2'), - ('468', '795', '2006-02-16T02:30:53', '2005-07-27T12:34:14', '2005-08-01T18:16:14', '2'), - ('264', '3099', '2006-02-16T02:30:53', '2005-07-31T00:35:05', '2005-08-02T23:35:05', '2'), - ('279', '2969', '2006-02-16T02:30:53', '2005-07-11T10:48:21', '2005-07-12T15:54:21', '2'), - ('38', '2291', '2006-02-16T02:30:53', '2005-07-30T02:08:58', '2005-08-05T02:13:58', '2'), - ('241', '531', '2006-02-16T02:30:53', '2005-08-21T06:22:07', '2005-08-30T00:41:07', '2'), - ('280', '2126', '2006-02-16T02:30:53', '2005-08-19T16:12:49', '2005-08-27T17:14:49', '2'), - ('577', '3262', '2006-02-16T02:30:53', '2005-07-06T05:16:36', '2005-07-13T07:14:36', '2'), - ('63', '211', '2006-02-16T02:30:53', '2005-07-31T01:47:40', '2005-08-02T07:25:40', '2'), - ('123', '138', '2006-02-16T02:30:53', '2005-06-16T17:00:14', '2005-06-17T12:12:14', '2'), - ('594', '4577', '2006-02-16T02:30:53', '2005-06-16T00:52:51', '2005-06-20T19:33:51', '2'), - ('35', '3547', '2006-02-16T02:30:53', '2005-07-31T02:59:20', '2005-08-06T03:52:20', '2'), - ('451', '2078', '2006-02-16T02:30:53', '2005-05-31T15:58:44', '2005-06-05T18:05:44', '2'), - ('141', '1001', '2006-02-16T02:30:53', '2005-07-27T00:49:53', '2005-07-31T03:59:53', '2'), - ('435', '2084', '2006-02-16T02:30:53', '2005-08-18T22:17:05', '2005-08-25T20:07:05', '2'), - ('98', '1532', '2006-02-16T02:30:53', '2005-08-21T12:48:08', '2005-08-27T10:50:08', '2'), - ('108', '1308', '2006-02-16T02:30:53', '2005-06-15T18:13:46', '2005-06-18T22:50:46', '2'), - ('319', '4193', '2006-02-16T02:30:53', '2005-07-11T12:00:32', '2005-07-16T15:00:32', '2'), - ('412', '3773', '2006-02-16T02:30:53', '2005-08-01T09:45:58', '2005-08-09T10:17:58', '2'), - ('248', '3301', '2006-02-16T02:30:53', '2005-08-20T16:47:32', '2005-08-21T12:00:32', '2'), - ('58', '1993', '2006-02-16T02:30:53', '2005-07-09T21:39:35', '2005-07-13T17:45:35', '2'), - ('527', '559', '2006-02-16T02:30:53', '2005-08-22T13:49:18', '2005-08-26T11:11:18', '2'), - ('98', '2597', '2006-02-16T02:30:53', '2005-07-06T09:22:48', '2005-07-14T11:17:48', '2'), - ('210', '3150', '2006-02-16T02:30:53', '2005-07-07T20:58:03', '2005-07-16T20:05:03', '2'), - ('225', '179', '2006-02-16T02:30:53', '2005-07-31T22:02:09', '2005-08-07T20:46:09', '2'), - ('196', '3710', '2006-02-16T02:30:53', '2005-07-29T16:56:01', '2005-07-31T16:19:01', '2'), - ('201', '4052', '2006-02-16T02:30:53', '2005-08-17T11:51:15', '2005-08-21T11:47:15', '2'), - ('595', '4277', '2006-02-16T02:30:53', '2005-07-08T15:44:05', '2005-07-11T20:39:05', '2'), - ('144', '324', '2006-02-16T02:30:53', '2005-08-17T22:20:12', '2005-08-20T02:11:12', '2'), - ('238', '253', '2006-02-16T02:30:53', '2005-06-15T01:58:50', '2005-06-16T20:30:50', '2'), - ('64', '1092', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('518', '2701', '2006-02-16T02:30:53', '2005-08-22T07:16:45', '2005-08-26T06:04:45', '2'), - ('189', '465', '2006-02-16T02:30:53', '2005-07-11T11:46:57', '2005-07-19T14:11:57', '2'), - ('412', '2322', '2006-02-16T02:30:53', '2005-05-31T06:11:40', '2005-06-08T09:15:40', '2'), - ('448', '2046', '2006-02-16T02:30:53', '2005-07-30T11:58:50', '2005-08-08T15:24:50', '2'), - ('583', '2817', '2006-02-16T02:30:53', '2005-07-12T12:14:42', '2005-07-21T11:07:42', '2'), - ('63', '2005', '2006-02-16T02:30:53', '2005-07-31T10:47:19', '2005-08-04T09:32:19', '2'), - ('218', '3128', '2006-02-16T02:30:53', '2005-07-09T12:10:44', '2005-07-11T17:32:44', '2'), - ('423', '3610', '2006-02-16T02:30:53', '2005-07-08T10:33:14', '2005-07-15T14:30:14', '2'), - ('35', '3572', '2006-02-16T02:30:53', '2005-07-30T04:03:58', '2005-08-08T04:16:58', '2'), - ('454', '619', '2006-02-16T02:30:53', '2005-08-22T19:44:16', '2005-08-26T22:57:16', '2'), - ('7', '1580', '2006-02-16T02:30:53', '2005-08-01T04:57:04', '2005-08-07T23:00:04', '2'), - ('503', '3483', '2006-02-16T02:30:53', '2005-08-17T13:50:31', '2005-08-19T08:45:31', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['6083', '12716', '10999', '2670', '3371', '3213', '1354', '10451', '2332', '11484', '11969', '13798', '11156', '6218', '15252', '10869', '2888', '4110', '11453', '6340', '9000', '11745', '6770', '342', '8436', '11261', '14542', '10752', '10538', '13433', '758', '13982', '11210', '3342', '2600', '2722', '2345', '12963', '9496', '15830', '8248', '15767', '2288', '6332', '13693', '4575', '5671', '15923', '12798', '178', '3056', '45', '10515', '14917', '12821', '7391', '1165', '10916', '3553', '12123', '14824', '15871', '11032', '8766', '10192', '4518', '4758', '110', '194', '4743', '3778', '12778', '9292', '14059', '74', '6597', '5705', '2344', '14800', '14724', '14753', '1011', '3463', '6954', '10660', '9729', '13563', '8953', '3733', '11791', '6394', '14103', '13063', '9016', '10586', '5843', '837', '2233', '6541', '14551']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('285', '3183', '2006-02-16T02:30:53', '2005-07-11T05:12:49', '2005-07-15T00:46:49', '2'), - ('570', '858', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('227', '2013', '2006-02-16T02:30:53', '2005-08-02T04:53:13', '2005-08-06T04:36:13', '2'), - ('457', '3518', '2006-02-16T02:30:53', '2005-06-19T11:30:16', '2005-06-21T17:25:16', '2'), - ('595', '2526', '2006-02-16T02:30:53', '2005-06-21T13:27:22', '2005-06-29T14:04:22', '2'), - ('534', '3832', '2006-02-16T02:30:53', '2005-06-21T01:05:19', '2005-06-27T21:55:19', '2'), - ('83', '1294', '2006-02-16T02:30:53', '2005-06-15T13:13:49', '2005-06-23T13:08:49', '2'), - ('9', '2435', '2006-02-16T02:30:53', '2005-08-01T09:11:25', '2005-08-03T12:37:25', '2'), - ('140', '2152', '2006-02-16T02:30:53', '2005-06-18T10:53:51', '2005-06-24T12:06:51', '2'), - ('165', '330', '2006-02-16T02:30:53', '2005-08-02T22:28:23', '2005-08-04T20:51:23', '2'), - ('550', '668', '2006-02-16T02:30:53', '2005-08-17T17:49:37', '2005-08-19T19:45:37', '2'), - ('15', '526', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('465', '907', '2006-02-16T02:30:53', '2005-08-02T09:56:06', '2005-08-04T13:36:06', '2'), - ('410', '815', '2006-02-16T02:30:53', '2005-07-11T13:14:58', '2005-07-16T08:13:58', '2'), - ('453', '1821', '2006-02-16T02:30:53', '2005-08-22T18:04:22', '2005-08-25T17:14:22', '2'), - ('568', '2967', '2006-02-16T02:30:53', '2005-08-02T00:26:54', '2005-08-04T03:40:54', '2'), - ('7', '468', '2006-02-16T02:30:53', '2005-06-20T01:50:56', '2005-06-22T05:05:56', '2'), - ('486', '226', '2006-02-16T02:30:53', '2005-07-07T06:44:27', '2005-07-12T05:43:27', '2'), - ('84', '4578', '2006-02-16T02:30:53', '2005-08-02T21:00:05', '2005-08-08T22:03:05', '2'), - ('264', '2374', '2006-02-16T02:30:53', '2005-07-11T19:46:05', '2005-07-20T16:51:05', '2'), - ('290', '3763', '2006-02-16T02:30:53', '2005-07-30T04:58:55', '2005-08-08T04:01:55', '2'), - ('240', '4018', '2006-02-16T02:30:53', '2005-08-17T09:00:01', '2005-08-26T14:29:01', '2'), - ('360', '2080', '2006-02-16T02:30:53', '2005-07-12T15:49:40', '2005-07-20T10:14:40', '2'), - ('539', '4019', '2006-02-16T02:30:53', '2005-05-27T04:11:04', '2005-05-29T01:28:04', '2'), - ('598', '2702', '2006-02-16T02:30:53', '2005-07-29T07:21:20', '2005-07-31T12:56:20', '2'), - ('204', '31', '2006-02-16T02:30:53', '2005-08-02T13:54:26', '2005-08-10T19:04:26', '2'), - ('101', '1247', '2006-02-16T02:30:53', '2005-08-21T15:36:34', '2005-08-27T20:24:34', '2'), - ('147', '3203', '2006-02-16T02:30:53', '2005-08-01T20:08:49', '2005-08-10T15:41:49', '2'), - ('37', '686', '2006-02-16T02:30:53', '2005-08-01T12:22:41', '2005-08-02T10:31:41', '2'), - ('171', '1647', '2006-02-16T02:30:53', '2005-08-19T23:30:53', '2005-08-22T05:18:53', '2'), - ('563', '1191', '2006-02-16T02:30:53', '2005-05-29T10:31:56', '2005-06-01T14:53:56', '2'), - ('448', '2901', '2006-02-16T02:30:53', '2005-08-20T19:08:25', '2005-08-28T15:59:25', '2'), - ('202', '422', '2006-02-16T02:30:53', '2005-08-02T12:15:54', '2005-08-04T16:18:54', '2'), - ('196', '2884', '2006-02-16T02:30:53', '2005-06-21T10:46:36', '2005-06-23T09:46:36', '2'), - ('423', '469', '2006-02-16T02:30:53', '2005-06-19T06:07:25', '2005-06-28T03:37:25', '2'), - ('45', '952', '2006-02-16T02:30:53', '2005-06-19T14:55:17', '2005-06-25T13:11:17', '2'), - ('6', '1818', '2006-02-16T02:30:53', '2005-06-18T12:03:23', '2005-06-22T14:25:23', '2'), - ('2', '1521', '2006-02-16T02:30:53', '2005-08-19T06:26:04', '2005-08-23T11:37:04', '2'), - ('125', '453', '2006-02-16T02:30:53', '2005-07-30T23:55:20', '2005-08-02T02:47:20', '2'), - ('467', '309', '2006-02-16T02:30:53', '2005-08-23T15:19:15', '2005-08-25T18:42:15', '2'), - ('272', '2017', '2006-02-16T02:30:53', '2005-07-29T00:41:56', '2005-08-05T18:53:56', '2'), - ('241', '3492', '2006-02-16T02:30:53', '2005-08-23T13:14:15', '2005-08-27T14:43:15', '2'), - ('247', '877', '2006-02-16T02:30:53', '2005-06-18T07:23:17', '2005-06-26T07:44:17', '2'), - ('538', '1733', '2006-02-16T02:30:53', '2005-07-11T19:19:06', '2005-07-13T13:51:06', '2'), - ('552', '933', '2006-02-16T02:30:53', '2005-08-20T09:11:42', '2005-08-24T15:00:42', '2'), - ('41', '231', '2006-02-16T02:30:53', '2005-07-08T05:49:14', '2005-07-11T04:08:14', '2'), - ('268', '1304', '2006-02-16T02:30:53', '2005-07-10T08:18:22', '2005-07-11T07:03:22', '2'), - ('276', '1693', '2006-02-16T02:30:53', '2005-08-23T18:08:19', '2005-08-26T18:06:19', '2'), - ('534', '4244', '2006-02-16T02:30:53', '2005-08-19T00:24:33', '2005-08-21T23:01:33', '2'), - ('196', '1489', '2006-02-16T02:30:53', '2005-05-26T04:21:46', '2005-06-04T07:09:46', '2'), - ('95', '2010', '2006-02-16T02:30:53', '2005-06-20T13:20:58', '2005-06-26T08:35:58', '2'), - ('436', '1853', '2006-02-16T02:30:53', '2005-05-25T05:59:39', '2005-06-02T09:56:39', '2'), - ('383', '874', '2006-02-16T02:30:53', '2005-08-01T11:41:33', '2005-08-08T06:23:33', '2'), - ('289', '377', '2006-02-16T02:30:53', '2005-08-22T05:03:59', '2005-08-29T04:00:59', '2'), - ('41', '3418', '2006-02-16T02:30:53', '2005-08-19T01:07:02', '2005-08-23T01:22:02', '2'), - ('531', '1153', '2006-02-16T02:30:53', '2005-07-27T16:00:00', '2005-08-04T18:07:00', '2'), - ('264', '2855', '2006-02-16T02:30:53', '2005-06-14T23:16:27', '2005-06-20T02:40:27', '2'), - ('25', '3841', '2006-02-16T02:30:53', '2005-08-02T02:05:59', '2005-08-06T03:46:59', '2'), - ('422', '4510', '2006-02-16T02:30:53', '2005-07-06T02:35:41', '2005-07-08T06:38:41', '2'), - ('497', '361', '2006-02-16T02:30:53', '2005-08-17T23:22:18', '2005-08-19T23:36:18', '2'), - ('594', '4162', '2006-02-16T02:30:53', '2005-08-22T01:27:51', '2005-08-23T03:24:51', '2'), - ('57', '425', '2006-02-16T02:30:53', '2005-08-23T16:24:24', '2005-09-01T13:48:24', '2'), - ('359', '1119', '2006-02-16T02:30:53', '2005-08-02T05:53:35', '2005-08-05T02:58:35', '2'), - ('338', '3888', '2006-02-16T02:30:53', '2005-07-29T19:41:04', '2005-08-02T00:41:04', '2'), - ('569', '1632', '2006-02-16T02:30:53', '2005-08-01T00:33:00', '2005-08-05T03:37:00', '2'), - ('592', '697', '2006-02-16T02:30:53', '2005-07-08T02:48:36', '2005-07-13T04:53:36', '2'), - ('288', '3698', '2006-02-16T02:30:53', '2005-07-08T14:38:02', '2005-07-13T12:09:02', '2'), - ('19', '4108', '2006-02-16T02:30:53', '2005-05-25T18:43:49', '2005-06-03T18:13:49', '2'), - ('29', '1337', '2006-02-16T02:30:53', '2005-05-26T06:52:33', '2005-05-30T04:08:33', '2'), - ('535', '80', '2006-02-16T02:30:53', '2005-07-08T13:42:36', '2005-07-11T18:54:36', '2'), - ('122', '2181', '2006-02-16T02:30:53', '2005-07-06T13:44:48', '2005-07-13T09:31:48', '2'), - ('290', '3626', '2006-02-16T02:30:53', '2005-08-18T23:40:23', '2005-08-19T18:14:23', '2'), - ('11', '1702', '2006-02-16T02:30:53', '2005-07-30T16:08:21', '2005-08-07T10:38:21', '2'), - ('141', '2045', '2006-02-16T02:30:53', '2005-08-20T22:24:44', '2005-08-26T21:25:44', '2'), - ('265', '1744', '2006-02-16T02:30:53', '2005-05-25T11:09:48', '2005-05-26T12:23:48', '2'), - ('479', '979', '2006-02-16T02:30:53', '2005-07-12T07:37:02', '2005-07-16T10:24:02', '2'), - ('300', '4030', '2006-02-16T02:30:53', '2005-07-10T10:09:17', '2005-07-19T07:24:17', '2'), - ('498', '2015', '2006-02-16T02:30:53', '2005-06-18T12:01:47', '2005-06-19T11:56:47', '2'), - ('533', '3554', '2006-02-16T02:30:53', '2005-08-22T00:46:18', '2005-08-26T01:44:18', '2'), - ('552', '3559', '2006-02-16T02:30:53', '2005-08-21T21:53:47', '2005-08-23T20:14:47', '2'), - ('155', '1803', '2006-02-16T02:30:53', '2005-08-21T23:11:43', '2005-08-22T22:25:43', '2'), - ('164', '118', '2006-02-16T02:30:53', '2005-05-31T02:05:39', '2005-06-04T21:27:39', '2'), - ('96', '3436', '2006-02-16T02:30:53', '2005-06-21T22:00:00', '2005-06-22T19:22:00', '2'), - ('584', '1112', '2006-02-16T02:30:53', '2005-07-26T23:55:13', '2005-07-28T19:01:13', '2'), - ('253', '2518', '2006-02-16T02:30:53', '2005-08-01T16:48:01', '2005-08-07T14:42:01', '2'), - ('273', '4199', '2006-02-16T02:30:53', '2005-07-31T08:43:43', '2005-08-01T13:25:43', '2'), - ('366', '599', '2006-02-16T02:30:53', '2005-08-20T04:33:31', '2005-08-24T07:08:31', '2'), - ('278', '535', '2006-02-16T02:30:53', '2005-07-30T03:21:05', '2005-08-02T05:24:05', '2'), - ('586', '3242', '2006-02-16T02:30:53', '2005-07-06T11:33:55', '2005-07-09T10:08:55', '2'), - ('219', '3640', '2006-02-16T02:30:53', '2005-08-17T11:01:11', '2005-08-22T06:31:11', '2'), - ('52', '2574', '2006-02-16T02:30:53', '2005-07-11T22:29:15', '2005-07-20T02:19:15', '2'), - ('409', '1438', '2006-02-16T02:30:53', '2005-08-21T00:37:00', '2005-08-25T22:09:00', '2'), - ('5', '1192', '2006-02-16T02:30:53', '2005-08-19T09:45:41', '2005-08-24T09:11:41', '2'), - ('312', '4309', '2006-02-16T02:30:53', '2005-07-30T05:26:13', '2005-08-04T00:25:13', '2'), - ('583', '3306', '2006-02-16T02:30:53', '2005-08-01T14:00:59', '2005-08-06T10:00:59', '2'), - ('599', '1615', '2006-02-16T02:30:53', '2005-07-10T17:14:27', '2005-07-15T21:18:27', '2'), - ('172', '977', '2006-02-16T02:30:53', '2005-05-30T00:02:08', '2005-06-02T05:31:08', '2'), - ('31', '3063', '2006-02-16T02:30:53', '2005-06-18T03:57:36', '2005-06-21T09:42:36', '2'), - ('529', '1795', '2006-02-16T02:30:53', '2005-07-12T04:53:41', '2005-07-17T23:17:41', '2'), - ('521', '496', '2006-02-16T02:30:53', '2005-08-21T15:57:25', '2005-08-28T11:10:25', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['12846', '3710', '14455', '3697', '4023', '4890', '4830', '6121', '14481', '14008', '11731', '1329', '5163', '8398', '5055', '14260', '7622', '1406', '10725', '4885', '9606', '2387', '5051', '4017', '10767', '15650', '3256', '12150', '455', '15799', '13682', '5955', '8525', '7849', '5386', '12241', '8767', '13219', '4564', '954', '1746', '14001', '7663', '5810', '13677', '5306', '11547', '3386', '12423', '2763', '12787', '5432', '10488', '12028', '11046', '1576', '14847', '3854', '6712', '2983', '4783', '10881', '2267', '6178', '10006', '678', '5554', '11333', '11673', '20', '560', '7070', '9084', '10422', '7866', '4848', '5139', '1893', '3878', '15184', '1749', '5082', '13425', '9521', '137', '10264', '7472', '10149', '11185', '14960', '13746', '8790', '9690', '6004', '176', '6719', '8669', '3365', '11580', '9695']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('305', '286', '2006-02-16T02:30:53', '2005-08-19T02:03:26', '2005-08-25T07:39:26', '2'), - ('228', '2596', '2006-02-16T02:30:53', '2005-07-06T10:28:53', '2005-07-15T06:17:53', '2'), - ('68', '3442', '2006-02-16T02:30:53', '2005-08-21T12:36:11', '2005-08-27T08:12:11', '2'), - ('182', '1223', '2006-02-16T02:30:53', '2005-07-06T10:07:22', '2005-07-13T14:04:22', '2'), - ('573', '274', '2006-02-16T02:30:53', '2005-07-07T01:55:25', '2005-07-08T02:43:25', '2'), - ('574', '3576', '2006-02-16T02:30:53', '2005-07-08T20:05:38', '2005-07-14T14:55:38', '2'), - ('359', '1150', '2006-02-16T02:30:53', '2005-07-08T17:56:23', '2005-07-17T21:40:23', '2'), - ('347', '1613', '2006-02-16T02:30:53', '2005-07-11T07:55:27', '2005-07-16T03:43:27', '2'), - ('367', '4099', '2006-02-16T02:30:53', '2005-08-21T13:41:14', '2005-08-30T07:53:14', '2'), - ('560', '2427', '2006-02-16T02:30:53', '2005-08-20T20:26:00', '2005-08-28T17:23:00', '2'), - ('52', '917', '2006-02-16T02:30:53', '2005-08-17T08:24:35', '2005-08-24T02:54:35', '2'), - ('359', '1154', '2006-02-16T02:30:53', '2005-06-15T11:25:06', '2005-06-17T16:10:06', '2'), - ('103', '1486', '2006-02-16T02:30:53', '2005-07-09T09:00:28', '2005-07-17T08:07:28', '2'), - ('220', '348', '2006-02-16T02:30:53', '2005-07-29T06:12:40', '2005-08-02T05:01:40', '2'), - ('54', '751', '2006-02-16T02:30:53', '2005-07-09T04:05:28', '2005-07-14T04:26:28', '2'), - ('40', '2961', '2006-02-16T02:30:53', '2005-08-21T06:01:08', '2005-08-29T09:01:08', '2'), - ('198', '4014', '2006-02-16T02:30:53', '2005-07-28T00:37:34', '2005-07-31T23:27:34', '2'), - ('199', '3118', '2006-02-16T02:30:53', '2005-06-15T16:44:00', '2005-06-21T11:22:00', '2'), - ('534', '4486', '2006-02-16T02:30:53', '2005-08-01T19:11:04', '2005-08-07T18:16:04', '2'), - ('233', '442', '2006-02-16T02:30:53', '2005-07-08T19:51:17', '2005-07-12T16:02:17', '2'), - ('253', '1357', '2006-02-16T02:30:53', '2005-07-31T03:50:46', '2005-08-01T05:29:46', '2'), - ('289', '692', '2006-02-16T02:30:53', '2005-06-18T15:24:19', '2005-06-25T17:41:19', '2'), - ('85', '4091', '2006-02-16T02:30:53', '2005-07-09T03:57:53', '2005-07-16T08:22:53', '2'), - ('595', '3117', '2006-02-16T02:30:53', '2005-07-07T01:08:18', '2005-07-09T01:47:18', '2'), - ('488', '2875', '2006-02-16T02:30:53', '2005-08-01T20:37:23', '2005-08-04T23:15:23', '2'), - ('353', '2447', '2006-02-16T02:30:53', '2005-08-23T08:29:53', '2005-08-25T07:23:53', '2'), - ('319', '1235', '2006-02-16T02:30:53', '2005-06-21T03:45:42', '2005-06-30T02:51:42', '2'), - ('555', '3781', '2006-02-16T02:30:53', '2005-08-18T00:13:55', '2005-08-20T23:35:55', '2'), - ('343', '3344', '2006-02-16T02:30:53', '2005-05-27T19:43:29', '2005-06-04T23:40:29', '2'), - ('215', '2519', '2006-02-16T02:30:53', '2005-08-23T14:23:23', '2005-08-24T17:15:23', '2'), - ('30', '287', '2006-02-16T02:30:53', '2005-08-20T08:50:39', '2005-08-21T09:05:39', '2'), - ('409', '834', '2006-02-16T02:30:53', '2005-07-10T23:22:10', '2005-07-17T17:55:10', '2'), - ('111', '1322', '2006-02-16T02:30:53', '2005-07-29T10:20:19', '2005-07-30T05:49:19', '2'), - ('423', '996', '2006-02-16T02:30:53', '2005-07-28T09:30:02', '2005-08-06T12:41:02', '2'), - ('594', '721', '2006-02-16T02:30:53', '2005-07-09T19:19:09', '2005-07-13T00:13:09', '2'), - ('248', '1261', '2006-02-16T02:30:53', '2005-08-18T03:33:17', '2005-08-21T03:13:17', '2'), - ('467', '962', '2006-02-16T02:30:53', '2005-07-29T19:42:33', '2005-08-01T20:52:33', '2'), - ('288', '2075', '2006-02-16T02:30:53', '2005-08-19T15:40:28', '2005-08-22T21:20:28', '2'), - ('519', '2494', '2006-02-16T02:30:53', '2005-07-08T05:09:38', '2005-07-11T05:37:38', '2'), - ('297', '1231', '2006-02-16T02:30:53', '2005-05-30T16:57:29', '2005-06-08T13:30:29', '2'), - ('385', '4272', '2006-02-16T02:30:53', '2005-06-16T16:41:19', '2005-06-19T11:28:19', '2'), - ('120', '1318', '2006-02-16T02:30:53', '2005-08-20T20:07:15', '2005-08-27T00:50:15', '2'), - ('470', '832', '2006-02-16T02:30:53', '2005-07-28T02:19:48', '2005-07-30T21:43:48', '2'), - ('482', '1426', '2006-02-16T02:30:53', '2005-07-10T15:22:04', '2005-07-18T21:05:04', '2'), - ('15', '4013', '2006-02-16T02:30:53', '2005-08-20T08:34:41', '2005-08-26T11:51:41', '2'), - ('409', '2221', '2006-02-16T02:30:53', '2005-07-09T15:56:45', '2005-07-15T19:02:45', '2'), - ('114', '737', '2006-02-16T02:30:53', '2005-08-17T00:59:24', '2005-08-20T04:03:24', '2'), - ('190', '1224', '2006-02-16T02:30:53', '2005-06-21T14:21:06', '2005-06-24T08:32:06', '2'), - ('470', '1014', '2006-02-16T02:30:53', '2005-08-18T10:14:52', '2005-08-26T13:16:52', '2'), - ('276', '3096', '2006-02-16T02:30:53', '2005-06-19T17:23:34', '2005-06-21T21:37:34', '2'), - ('278', '2023', '2006-02-16T02:30:53', '2005-08-19T00:07:58', '2005-08-24T00:42:58', '2'), - ('64', '1958', '2006-02-16T02:30:53', '2005-07-09T21:21:25', '2005-07-14T21:34:25', '2'), - ('423', '297', '2006-02-16T02:30:53', '2005-08-01T10:27:27', '2005-08-02T11:05:27', '2'), - ('316', '607', '2006-02-16T02:30:53', '2005-08-17T20:03:47', '2005-08-23T17:09:47', '2'), - ('526', '2105', '2006-02-16T02:30:53', '2005-08-02T06:08:34', '2005-08-06T08:45:34', '2'), - ('442', '1014', '2006-02-16T02:30:53', '2005-06-16T03:54:39', '2005-06-24T21:55:39', '2'), - ('327', '2995', '2006-02-16T02:30:53', '2005-08-22T02:13:51', '2005-08-29T03:42:51', '2'), - ('243', '2054', '2006-02-16T02:30:53', '2005-07-06T17:02:33', '2005-07-12T17:32:33', '2'), - ('226', '4581', '2006-02-16T02:30:53', '2005-07-12T13:24:47', '2005-07-20T09:35:47', '2'), - ('322', '1349', '2006-02-16T02:30:53', '2005-06-20T08:41:42', '2005-06-29T04:02:42', '2'), - ('214', '3952', '2006-02-16T02:30:53', '2005-07-08T16:09:24', '2005-07-16T21:53:24', '2'), - ('253', '781', '2006-02-16T02:30:53', '2005-08-02T00:38:14', '2005-08-09T22:02:14', '2'), - ('218', '2086', '2006-02-16T02:30:53', '2005-06-18T06:10:23', '2005-06-20T00:39:23', '2'), - ('91', '2777', '2006-02-16T02:30:53', '2005-07-11T10:59:09', '2005-07-16T11:19:09', '2'), - ('470', '2538', '2006-02-16T02:30:53', '2005-07-31T17:54:35', '2005-08-02T20:40:35', '2'), - ('269', '3741', '2006-02-16T02:30:53', '2005-05-28T23:15:48', '2005-06-03T04:43:48', '2'), - ('252', '4084', '2006-02-16T02:30:53', '2005-07-10T03:03:38', '2005-07-17T00:00:38', '2'), - ('225', '3335', '2006-02-16T02:30:53', '2005-08-02T16:53:00', '2005-08-07T20:49:00', '2'), - ('303', '823', '2006-02-16T02:30:53', '2005-08-17T05:54:15', '2005-08-21T08:12:15', '2'), - ('185', '3517', '2006-02-16T02:30:53', '2005-05-25T01:48:41', '2005-05-27T02:20:41', '2'), - ('463', '644', '2006-02-16T02:30:53', '2005-05-28T08:53:02', '2005-06-04T12:27:02', '2'), - ('280', '4182', '2006-02-16T02:30:53', '2005-07-27T04:01:08', '2005-07-30T08:10:08', '2'), - ('171', '3950', '2006-02-16T02:30:53', '2005-07-30T08:14:29', '2005-08-03T11:12:29', '2'), - ('166', '37', '2006-02-16T02:30:53', '2005-08-01T08:17:11', '2005-08-10T10:08:11', '2'), - ('101', '1602', '2006-02-16T02:30:53', '2005-07-28T10:08:01', '2005-08-04T09:29:01', '2'), - ('251', '2962', '2006-02-16T02:30:53', '2005-07-08T18:30:16', '2005-07-12T19:53:16', '2'), - ('539', '51', '2006-02-16T02:30:53', '2005-07-09T08:01:51', '2005-07-18T09:16:51', '2'), - ('390', '3346', '2006-02-16T02:30:53', '2005-06-17T04:18:37', '2005-06-23T23:35:37', '2'), - ('385', '4022', '2006-02-16T02:30:53', '2005-07-06T18:27:09', '2005-07-15T20:13:09', '2'), - ('471', '1193', '2006-02-16T02:30:53', '2005-08-22T15:51:12', '2005-08-24T19:23:12', '2'), - ('283', '1554', '2006-02-16T02:30:53', '2005-06-16T16:56:00', '2005-06-21T21:02:00', '2'), - ('470', '1584', '2006-02-16T02:30:53', '2005-07-09T05:28:38', '2005-07-10T02:46:38', '2'), - ('340', '2274', '2006-02-16T02:30:53', '2005-08-19T23:11:44', '2005-08-25T21:19:44', '2'), - ('227', '1423', '2006-02-16T02:30:53', '2005-07-31T00:52:24', '2005-08-06T03:33:24', '2'), - ('560', '2591', '2006-02-16T02:30:53', '2005-05-25T22:25:18', '2005-06-01T02:30:18', '2'), - ('297', '1374', '2006-02-16T02:30:53', '2005-08-01T03:03:12', '2005-08-08T00:34:12', '2'), - ('103', '1535', '2006-02-16T02:30:53', '2005-07-27T19:04:19', '2005-08-03T00:08:19', '2'), - ('276', '890', '2006-02-16T02:30:53', '2005-07-31T22:20:46', '2005-08-07T23:12:46', '2'), - ('469', '1215', '2006-02-16T02:30:53', '2005-08-02T11:04:35', '2005-08-05T13:48:35', '2'), - ('147', '3316', '2006-02-16T02:30:53', '2005-08-22T06:31:36', '2005-08-29T07:10:36', '2'), - ('520', '3742', '2006-02-16T02:30:53', '2005-08-20T10:55:28', '2005-08-25T07:48:28', '2'), - ('323', '751', '2006-02-16T02:30:53', '2005-07-29T20:51:41', '2005-07-30T17:30:41', '2'), - ('468', '4449', '2006-02-16T02:30:53', '2005-07-31T07:06:29', '2005-08-06T09:45:29', '2'), - ('204', '1756', '2006-02-16T02:30:53', '2005-07-11T01:34:25', '2005-07-18T00:48:25', '2'), - ('250', '851', '2006-02-16T02:30:53', '2005-05-26T03:47:39', '2005-06-01T02:36:39', '2'), - ('330', '739', '2006-02-16T02:30:53', '2005-07-12T13:40:37', '2005-07-15T15:23:37', '2'), - ('401', '1667', '2006-02-16T02:30:53', '2005-07-29T15:44:55', '2005-08-01T14:09:55', '2'), - ('133', '657', '2006-02-16T02:30:53', '2005-06-21T12:55:48', '2005-06-23T13:38:48', '2'), - ('436', '1346', '2006-02-16T02:30:53', '2005-08-17T01:59:07', '2005-08-21T06:18:07', '2'), - ('95', '726', '2006-02-16T02:30:53', '2005-07-31T07:13:30', '2005-08-07T05:38:30', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['8088', '9988', '4838', '755', '1790', '15447', '15148', '14957', '14773', '10629', '12503', '3811', '1401', '8652', '6214', '2041', '6691', '7468', '3888', '10713', '5249', '142', '7231', '2528', '15300', '8781', '11686', '15793', '12577', '11932', '8545', '12180', '7132', '10816', '13613', '4866', '9538', '8569', '2454', '11763', '13808', '9630', '4565', '11724', '61', '5406', '10652', '1954', '9864', '11155', '4657', '12084', '4934', '13121', '5225', '462', '8532', '6322', '1232', '12045', '5522', '8016', '11017', '7815', '7750', '11816', '10761', '8447', '5721', '6812', '6613', '659', '8469', '12437', '313', '10301', '507', '5697', '11237', '8208', '14923', '3249', '9696', '10906', '6631', '2460', '5400', '5822', '7003', '8867', '1260', '6973', '14746', '7738', '10594', '12476', '15060', '6949', '5886', '6511']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('343', '2590', '2006-02-16T02:30:53', '2005-07-28T18:23:49', '2005-08-06T23:25:49', '2'), - ('243', '3844', '2006-02-16T02:30:53', '2005-07-31T17:22:36', '2005-08-07T18:35:36', '2'), - ('84', '3733', '2006-02-16T02:30:53', '2005-07-08T18:11:00', '2005-07-17T12:57:00', '2'), - ('576', '3090', '2006-02-16T02:30:53', '2005-05-29T10:26:29', '2005-06-01T10:25:29', '2'), - ('158', '1070', '2006-02-16T02:30:53', '2005-06-16T19:58:40', '2005-06-17T19:31:40', '2'), - ('331', '4090', '2006-02-16T02:30:53', '2005-08-23T00:53:57', '2005-08-29T06:19:57', '2'), - ('359', '3704', '2006-02-16T02:30:53', '2005-08-22T13:59:19', '2005-08-31T13:59:19', '2'), - ('323', '1384', '2006-02-16T02:30:53', '2005-08-22T06:29:34', '2005-08-26T04:52:34', '2'), - ('413', '2541', '2006-02-16T02:30:53', '2005-08-21T23:50:57', '2005-08-26T04:45:57', '2'), - ('575', '997', '2006-02-16T02:30:53', '2005-08-01T15:33:32', '2005-08-08T12:40:32', '2'), - ('379', '3548', '2006-02-16T02:30:53', '2005-08-18T13:16:46', '2005-08-19T10:24:46', '2'), - ('208', '695', '2006-02-16T02:30:53', '2005-07-06T15:20:37', '2005-07-08T16:26:37', '2'), - ('366', '4081', '2006-02-16T02:30:53', '2005-06-15T16:30:22', '2005-06-21T11:07:22', '2'), - ('219', '2729', '2006-02-16T02:30:53', '2005-07-29T15:02:54', '2005-08-07T17:21:54', '2'), - ('49', '1258', '2006-02-16T02:30:53', '2005-07-11T12:49:48', '2005-07-18T07:41:48', '2'), - ('348', '782', '2006-02-16T02:30:53', '2005-06-17T14:19:00', '2005-06-26T08:38:00', '2'), - ('192', '403', '2006-02-16T02:30:53', '2005-07-12T12:26:38', '2005-07-18T13:26:38', '2'), - ('113', '3166', '2006-02-16T02:30:53', '2005-07-27T18:52:27', '2005-08-03T19:29:27', '2'), - ('412', '1945', '2006-02-16T02:30:53', '2005-07-06T18:54:20', '2005-07-12T17:13:20', '2'), - ('369', '2030', '2006-02-16T02:30:53', '2005-08-01T18:50:05', '2005-08-05T00:43:05', '2'), - ('389', '1950', '2006-02-16T02:30:53', '2005-07-09T13:33:53', '2005-07-11T12:55:53', '2'), - ('472', '4407', '2006-02-16T02:30:53', '2005-05-25T23:43:47', '2005-05-29T00:46:47', '2'), - ('86', '1638', '2006-02-16T02:30:53', '2005-07-27T10:01:51', '2005-08-05T13:38:51', '2'), - ('331', '1836', '2006-02-16T02:30:53', '2005-06-19T01:14:12', '2005-06-26T05:08:12', '2'), - ('399', '2319', '2006-02-16T02:30:53', '2005-08-22T19:44:00', '2005-08-25T22:49:00', '2'), - ('235', '3746', '2006-02-16T02:30:53', '2005-07-29T20:20:16', '2005-07-30T16:19:16', '2'), - ('392', '1393', '2006-02-16T02:30:53', '2005-08-17T06:39:30', '2005-08-21T10:19:30', '2'), - ('22', '2863', '2006-02-16T02:30:53', '2005-08-23T14:06:19', '2005-08-24T19:59:19', '2'), - ('16', '4134', '2006-02-16T02:30:53', '2005-08-18T15:39:46', '2005-08-25T18:05:46', '2'), - ('364', '151', '2006-02-16T02:30:53', '2005-08-17T16:36:12', '2005-08-18T19:34:12', '2'), - ('3', '3261', '2006-02-16T02:30:53', '2005-07-29T11:07:04', '2005-08-06T13:30:04', '2'), - ('20', '2276', '2006-02-16T02:30:53', '2005-08-18T01:28:15', '2005-08-20T20:52:15', '2'), - ('227', '3201', '2006-02-16T02:30:53', '2005-07-27T06:28:34', '2005-08-05T06:02:34', '2'), - ('129', '905', '2006-02-16T02:30:53', '2005-08-01T22:48:57', '2005-08-10T04:39:57', '2'), - ('201', '2415', '2006-02-16T02:30:53', '2005-08-20T06:23:53', '2005-08-29T11:40:53', '2'), - ('278', '4036', '2006-02-16T02:30:53', '2005-07-08T19:09:59', '2005-07-15T00:51:59', '2'), - ('68', '3402', '2006-02-16T02:30:53', '2005-07-31T01:25:22', '2005-08-06T00:10:22', '2'), - ('348', '276', '2006-02-16T02:30:53', '2005-07-29T11:39:17', '2005-07-31T07:50:17', '2'), - ('253', '314', '2006-02-16T02:30:53', '2005-06-18T19:32:51', '2005-06-24T20:03:51', '2'), - ('586', '872', '2006-02-16T02:30:53', '2005-08-17T09:51:39', '2005-08-21T10:15:39', '2'), - ('262', '3689', '2006-02-16T02:30:53', '2005-08-20T12:55:43', '2005-08-29T11:01:43', '2'), - ('599', '2008', '2006-02-16T02:30:53', '2005-07-31T04:57:07', '2005-08-07T10:55:07', '2'), - ('563', '3755', '2006-02-16T02:30:53', '2005-07-08T05:12:28', '2005-07-17T03:38:28', '2'), - ('207', '4484', '2006-02-16T02:30:53', '2005-08-17T08:04:44', '2005-08-25T03:25:44', '2'), - ('250', '4210', '2006-02-16T02:30:53', '2005-05-25T09:01:57', '2005-06-02T07:22:57', '2'), - ('563', '1322', '2006-02-16T02:30:53', '2005-07-09T20:13:23', '2005-07-11T22:05:23', '2'), - ('241', '1633', '2006-02-16T02:30:53', '2005-08-01T16:24:08', '2005-08-03T16:00:08', '2'), - ('533', '3203', '2006-02-16T02:30:53', '2005-06-17T08:37:55', '2005-06-20T02:55:55', '2'), - ('394', '3619', '2006-02-16T02:30:53', '2005-07-31T13:06:54', '2005-08-02T11:47:54', '2'), - ('73', '2001', '2006-02-16T02:30:53', '2005-08-02T09:55:28', '2005-08-03T06:00:28', '2'), - ('54', '1002', '2006-02-16T02:30:53', '2005-07-08T09:51:02', '2005-07-09T09:29:02', '2'), - ('60', '2706', '2006-02-16T02:30:53', '2005-08-17T22:16:49', '2005-08-24T17:42:49', '2'), - ('517', '1744', '2006-02-16T02:30:53', '2005-07-08T22:18:42', '2005-07-10T20:44:42', '2'), - ('251', '3517', '2006-02-16T02:30:53', '2005-08-19T11:51:39', '2005-08-22T11:50:39', '2'), - ('445', '703', '2006-02-16T02:30:53', '2005-07-09T12:10:16', '2005-07-12T09:55:16', '2'), - ('364', '2314', '2006-02-16T02:30:53', '2005-05-27T20:10:36', '2005-06-03T21:12:36', '2'), - ('546', '3045', '2006-02-16T02:30:53', '2005-07-29T10:26:56', '2005-08-02T13:23:56', '2'), - ('403', '4115', '2006-02-16T02:30:53', '2005-07-11T18:58:20', '2005-07-14T16:41:20', '2'), - ('391', '2743', '2006-02-16T02:30:53', '2005-06-15T04:18:10', '2005-06-17T06:02:10', '2'), - ('556', '469', '2006-02-16T02:30:53', '2005-08-17T20:40:46', '2005-08-20T18:18:46', '2'), - ('573', '2622', '2006-02-16T02:30:53', '2005-07-10T01:46:29', '2005-07-18T00:41:29', '2'), - ('391', '516', '2006-02-16T02:30:53', '2005-07-28T15:35:41', '2005-07-30T20:06:41', '2'), - ('480', '4140', '2006-02-16T02:30:53', '2005-08-02T05:19:51', '2005-08-09T00:36:51', '2'), - ('300', '3551', '2006-02-16T02:30:53', '2005-07-28T08:14:11', '2005-07-30T02:34:11', '2'), - ('220', '820', '2006-02-16T02:30:53', '2005-07-28T05:55:30', '2005-08-06T04:32:30', '2'), - ('224', '3897', '2006-02-16T02:30:53', '2005-08-17T12:14:16', '2005-08-19T06:15:16', '2'), - ('36', '3967', '2006-02-16T02:30:53', '2005-08-01T20:25:35', '2005-08-08T15:20:35', '2'), - ('11', '930', '2006-02-16T02:30:53', '2005-07-29T07:38:14', '2005-08-05T02:27:14', '2'), - ('5', '2348', '2006-02-16T02:30:53', '2005-07-10T11:09:35', '2005-07-17T16:41:35', '2'), - ('553', '2227', '2006-02-16T02:30:53', '2005-07-12T18:03:25', '2005-07-20T18:33:25', '2'), - ('460', '3421', '2006-02-16T02:30:53', '2005-07-12T08:30:07', '2005-07-14T10:25:07', '2'), - ('207', '1382', '2006-02-16T02:30:53', '2005-05-28T20:27:53', '2005-05-31T01:36:53', '2'), - ('408', '2754', '2006-02-16T02:30:53', '2005-07-29T08:26:27', '2005-08-05T04:26:27', '2'), - ('467', '4036', '2006-02-16T02:30:53', '2005-08-18T10:42:43', '2005-08-26T11:58:43', '2'), - ('594', '4156', '2006-02-16T02:30:53', '2005-05-26T22:56:19', '2005-05-29T01:29:19', '2'), - ('583', '3072', '2006-02-16T02:30:53', '2005-08-01T04:09:37', '2005-08-04T23:14:37', '2'), - ('421', '3621', '2006-02-16T02:30:53', '2005-05-28T02:31:19', '2005-06-02T05:07:19', '2'), - ('515', '934', '2006-02-16T02:30:53', '2005-07-10T09:44:44', '2005-07-12T12:13:44', '2'), - ('426', '2668', '2006-02-16T02:30:53', '2005-08-02T13:24:01', '2005-08-05T11:41:01', '2'), - ('530', '1362', '2006-02-16T02:30:53', '2005-07-28T23:26:35', '2005-08-01T23:00:35', '2'), - ('460', '3434', '2006-02-16T02:30:53', '2005-08-22T05:13:33', '2005-08-28T01:39:33', '2'), - ('410', '703', '2006-02-16T02:30:53', '2005-06-21T03:13:19', '2005-06-29T04:04:19', '2'), - ('156', '2703', '2006-02-16T02:30:53', '2005-07-31T07:13:46', '2005-08-03T10:49:46', '2'), - ('463', '3139', '2006-02-16T02:30:53', '2005-08-02T01:47:04', '2005-08-07T20:41:04', '2'), - ('204', '2340', '2006-02-16T02:30:53', '2005-07-12T09:31:43', '2005-07-15T05:00:43', '2'), - ('553', '3933', '2006-02-16T02:30:53', '2005-06-18T19:54:13', '2005-06-27T22:36:13', '2'), - ('192', '3435', '2006-02-16T02:30:53', '2005-07-09T19:56:40', '2005-07-14T20:43:40', '2'), - ('38', '1385', '2006-02-16T02:30:53', '2005-07-10T16:10:39', '2005-07-13T19:05:39', '2'), - ('161', '636', '2006-02-16T02:30:53', '2005-07-27T01:32:06', '2005-07-30T21:33:06', '2'), - ('497', '1388', '2006-02-16T02:30:53', '2005-07-30T00:02:18', '2005-08-04T00:44:18', '2'), - ('586', '330', '2006-02-16T02:30:53', '2005-06-15T06:42:25', '2005-06-16T10:44:25', '2'), - ('564', '4572', '2006-02-16T02:30:53', '2005-07-27T00:32:04', '2005-07-29T01:05:04', '2'), - ('284', '3197', '2006-02-16T02:30:53', '2005-08-21T22:54:02', '2005-08-27T17:04:02', '2'), - ('10', '80', '2006-02-16T02:30:53', '2005-07-28T05:21:42', '2005-08-03T09:46:42', '2'), - ('53', '1826', '2006-02-16T02:30:53', '2005-08-01T14:14:59', '2005-08-07T10:48:59', '2'), - ('122', '2784', '2006-02-16T02:30:53', '2005-08-18T12:22:40', '2005-08-20T17:29:40', '2'), - ('63', '2740', '2006-02-16T02:30:53', '2005-08-22T10:24:32', '2005-08-31T11:17:32', '2'), - ('103', '1594', '2006-02-16T02:30:53', '2005-07-26T23:44:12', '2005-07-30T05:39:12', '2'), - ('215', '907', '2006-02-16T02:30:53', '2005-07-10T19:36:25', '2005-07-11T22:24:25', '2'), - ('322', '1350', '2006-02-16T02:30:53', '2005-07-12T03:39:29', '2005-07-17T01:01:29', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['5276', '6111', '5696', '7038', '14033', '10433', '7682', '1295', '6584', '10471', '6921', '9313', '679', '15982', '7963', '1720', '6235', '15588', '7676', '6342', '14259', '8712', '12550', '12688', '6722', '8264', '10982', '1683', '593', '11674', '12300', '2109', '7835', '12481', '340', '15478', '12614', '11493', '3068', '13686', '12457', '3948', '5632', '2802', '2031', '12290', '1093', '806', '14004', '2646', '670', '212', '1303', '3163', '13309', '3248', '6130', '2075', '4505', '13757', '15932', '6306', '415', '9618', '14012', '798', '3986', '5088', '2928', '1167', '14948', '3350', '6182', '14849', '7547', '10664', '11581', '15434', '8247', '8795', '2014', '11601', '15278', '7075', '11088', '8064', '7033', '2900', '4812', '15091', '14851', '8802', '6789', '10540', '2287', '7933', '14308', '9238', '7279', '8302']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('521', '2524', '2006-02-16T02:30:53', '2005-07-09T14:35:13', '2005-07-12T14:24:13', '2'), - ('300', '3504', '2006-02-16T02:30:53', '2005-07-11T07:26:57', '2005-07-13T10:43:57', '2'), - ('96', '128', '2006-02-16T02:30:53', '2005-07-10T09:44:32', '2005-07-12T13:38:32', '2'), - ('518', '1909', '2006-02-16T02:30:53', '2005-07-27T03:07:29', '2005-07-31T04:55:29', '2'), - ('243', '525', '2006-02-16T02:30:53', '2005-08-20T21:30:53', '2005-08-23T01:45:53', '2'), - ('517', '1508', '2006-02-16T02:30:53', '2005-08-01T08:45:56', '2005-08-05T09:46:56', '2'), - ('400', '3296', '2006-02-16T02:30:53', '2005-07-28T03:07:29', '2005-08-04T08:48:29', '2'), - ('449', '2897', '2006-02-16T02:30:53', '2005-06-15T09:17:20', '2005-06-18T10:14:20', '2'), - ('472', '1800', '2006-02-16T02:30:53', '2005-07-12T06:43:36', '2005-07-16T12:18:36', '2'), - ('135', '1684', '2006-02-16T02:30:53', '2005-08-01T09:52:37', '2005-08-07T09:40:37', '2'), - ('265', '3322', '2006-02-16T02:30:53', '2005-07-12T22:39:03', '2005-07-21T18:54:03', '2'), - ('41', '4070', '2006-02-16T02:30:53', '2005-07-30T16:59:43', '2005-08-05T14:06:43', '2'), - ('526', '907', '2006-02-16T02:30:53', '2005-05-28T23:24:57', '2005-06-06T21:59:57', '2'), - ('370', '2920', '2006-02-16T02:30:53', '2005-08-23T20:13:31', '2005-09-01T21:51:31', '2'), - ('247', '921', '2006-02-16T02:30:53', '2005-07-28T13:48:38', '2005-08-06T19:37:38', '2'), - ('543', '3500', '2006-02-16T02:30:53', '2005-06-16T15:00:14', '2005-06-21T13:57:14', '2'), - ('379', '2659', '2006-02-16T02:30:53', '2005-07-11T14:17:51', '2005-07-17T11:14:51', '2'), - ('503', '1810', '2006-02-16T02:30:53', '2005-08-23T06:02:35', '2005-08-30T04:01:35', '2'), - ('508', '1110', '2006-02-16T02:30:53', '2005-07-28T02:55:27', '2005-08-01T03:50:27', '2'), - ('403', '1851', '2006-02-16T02:30:53', '2005-07-11T19:48:24', '2005-07-13T14:09:24', '2'), - ('583', '3705', '2006-02-16T02:30:53', '2005-08-21T06:00:22', '2005-08-22T05:38:22', '2'), - ('41', '2800', '2006-02-16T02:30:53', '2005-07-29T17:30:06', '2005-08-03T22:55:06', '2'), - ('138', '4267', '2006-02-16T02:30:53', '2005-08-18T14:40:38', '2005-08-19T13:33:38', '2'), - ('65', '2315', '2006-02-16T02:30:53', '2005-08-18T19:59:54', '2005-08-26T18:52:54', '2'), - ('211', '3124', '2006-02-16T02:30:53', '2005-07-12T13:44:03', '2005-07-19T12:43:03', '2'), - ('175', '2987', '2006-02-16T02:30:53', '2005-07-29T01:18:50', '2005-08-03T05:31:50', '2'), - ('345', '2508', '2006-02-16T02:30:53', '2005-08-02T04:19:11', '2005-08-04T00:20:11', '2'), - ('494', '2361', '2006-02-16T02:30:53', '2005-06-16T11:54:55', '2005-06-18T08:51:55', '2'), - ('16', '1810', '2006-02-16T02:30:53', '2005-05-28T13:33:23', '2005-05-30T17:10:23', '2'), - ('306', '582', '2006-02-16T02:30:53', '2005-08-17T05:56:27', '2005-08-24T08:50:27', '2'), - ('540', '3213', '2006-02-16T02:30:53', '2005-08-18T05:36:14', '2005-08-25T00:20:14', '2'), - ('493', '2292', '2006-02-16T02:30:53', '2005-06-17T19:41:42', '2005-06-25T17:03:42', '2'), - ('547', '43', '2006-02-16T02:30:53', '2005-07-28T08:49:39', '2005-08-02T07:16:39', '2'), - ('218', '2424', '2006-02-16T02:30:53', '2005-08-18T12:31:34', '2005-08-21T16:08:34', '2'), - ('209', '946', '2006-02-16T02:30:53', '2005-05-27T03:55:25', '2005-06-04T07:57:25', '2'), - ('167', '4563', '2006-02-16T02:30:53', '2005-08-23T01:50:31', '2005-08-27T21:40:31', '2'), - ('60', '2233', '2006-02-16T02:30:53', '2005-08-18T17:16:03', '2005-08-26T16:56:03', '2'), - ('124', '3375', '2006-02-16T02:30:53', '2005-08-02T22:47:00', '2005-08-10T20:53:00', '2'), - ('516', '1958', '2006-02-16T02:30:53', '2005-06-20T14:02:22', '2005-06-22T12:52:22', '2'), - ('306', '666', '2006-02-16T02:30:53', '2005-08-20T08:57:28', '2005-08-24T07:21:28', '2'), - ('80', '2145', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('161', '2254', '2006-02-16T02:30:53', '2005-07-06T21:45:53', '2005-07-08T19:24:53', '2'), - ('404', '2632', '2006-02-16T02:30:53', '2005-07-10T06:17:06', '2005-07-17T02:32:06', '2'), - ('489', '4067', '2006-02-16T02:30:53', '2005-06-19T19:18:17', '2005-06-21T17:58:17', '2'), - ('570', '4275', '2006-02-16T02:30:53', '2005-06-17T13:14:03', '2005-06-25T10:06:03', '2'), - ('283', '4100', '2006-02-16T02:30:53', '2005-08-18T05:08:03', '2005-08-23T08:10:03', '2'), - ('214', '2189', '2006-02-16T02:30:53', '2005-05-31T12:32:26', '2005-06-03T07:51:26', '2'), - ('435', '2386', '2006-02-16T02:30:53', '2005-05-29T18:31:30', '2005-05-31T00:18:30', '2'), - ('358', '3445', '2006-02-16T02:30:53', '2005-08-20T20:16:35', '2005-08-28T17:23:35', '2'), - ('275', '3511', '2006-02-16T02:30:53', '2005-06-19T09:56:01', '2005-06-21T04:15:01', '2'), - ('201', '227', '2006-02-16T02:30:53', '2005-05-28T22:04:03', '2005-06-06T22:43:03', '2'), - ('59', '764', '2006-02-16T02:30:53', '2005-05-26T08:34:41', '2005-05-30T12:46:41', '2'), - ('365', '2001', '2006-02-16T02:30:53', '2005-06-15T09:55:57', '2005-06-20T14:26:57', '2'), - ('391', '2632', '2006-02-16T02:30:53', '2005-06-20T21:22:13', '2005-06-26T15:22:13', '2'), - ('91', '2108', '2006-02-16T02:30:53', '2005-08-19T19:04:00', '2005-08-28T23:08:00', '2'), - ('78', '3656', '2006-02-16T02:30:53', '2005-06-21T03:12:21', '2005-06-28T03:54:21', '2'), - ('538', '2547', '2006-02-16T02:30:53', '2005-07-11T08:19:56', '2005-07-16T12:02:56', '2'), - ('459', '2415', '2006-02-16T02:30:53', '2005-06-17T16:40:33', '2005-06-19T13:55:33', '2'), - ('481', '1864', '2006-02-16T02:30:53', '2005-07-08T02:20:04', '2005-07-14T20:28:04', '2'), - ('14', '1147', '2006-02-16T02:30:53', '2005-08-20T11:20:12', '2005-08-23T10:14:12', '2'), - ('405', '4554', '2006-02-16T02:30:53', '2005-08-23T18:31:40', '2005-08-24T16:30:40', '2'), - ('208', '486', '2006-02-16T02:30:53', '2005-07-11T18:04:26', '2005-07-20T14:22:26', '2'), - ('304', '3698', '2006-02-16T02:30:53', '2005-05-27T14:51:45', '2005-05-28T19:07:45', '2'), - ('253', '2688', '2006-02-16T02:30:53', '2005-07-31T04:16:14', '2005-08-07T02:43:14', '2'), - ('274', '1866', '2006-02-16T02:30:53', '2005-08-20T20:42:12', '2005-08-23T23:10:12', '2'), - ('134', '1102', '2006-02-16T02:30:53', '2005-05-29T17:23:43', '2005-06-01T13:06:43', '2'), - ('122', '3737', '2006-02-16T02:30:53', '2005-07-06T23:25:13', '2005-07-09T21:26:13', '2'), - ('454', '3324', '2006-02-16T02:30:53', '2005-07-09T05:45:16', '2005-07-15T00:41:16', '2'), - ('104', '1265', '2006-02-16T02:30:53', '2005-06-20T04:43:45', '2005-06-21T06:58:45', '2'), - ('323', '4021', '2006-02-16T02:30:53', '2005-06-14T23:25:58', '2005-06-18T05:18:58', '2'), - ('488', '2914', '2006-02-16T02:30:53', '2005-08-22T06:10:53', '2005-08-28T11:24:53', '2'), - ('20', '3221', '2006-02-16T02:30:53', '2005-06-21T11:21:38', '2005-06-28T15:37:38', '2'), - ('540', '2562', '2006-02-16T02:30:53', '2005-07-11T11:11:38', '2005-07-17T08:33:38', '2'), - ('177', '3354', '2006-02-16T02:30:53', '2005-08-22T02:15:26', '2005-08-28T00:56:26', '2'), - ('547', '1733', '2006-02-16T02:30:53', '2005-07-27T21:51:48', '2005-08-06T01:05:48', '2'), - ('337', '3167', '2006-02-16T02:30:53', '2005-08-01T16:51:15', '2005-08-04T19:14:15', '2'), - ('231', '1249', '2006-02-16T02:30:53', '2005-08-17T02:03:02', '2005-08-24T03:53:02', '2'), - ('518', '4378', '2006-02-16T02:30:53', '2005-08-23T00:28:16', '2005-08-26T04:27:16', '2'), - ('539', '2607', '2006-02-16T02:30:53', '2005-07-29T00:41:38', '2005-08-06T20:29:38', '2'), - ('302', '1896', '2006-02-16T02:30:53', '2005-07-29T21:04:14', '2005-07-31T02:58:14', '2'), - ('337', '2969', '2006-02-16T02:30:53', '2005-06-17T12:03:28', '2005-06-25T16:00:28', '2'), - ('471', '1098', '2006-02-16T02:30:53', '2005-08-17T03:14:47', '2005-08-20T00:21:47', '2'), - ('472', '2454', '2006-02-16T02:30:53', '2005-08-22T19:06:47', '2005-08-25T01:00:47', '2'), - ('530', '4414', '2006-02-16T02:30:53', '2005-07-27T04:11:40', '2005-08-03T08:16:40', '2'), - ('138', '2739', '2006-02-16T02:30:53', '2005-08-02T07:48:31', '2005-08-05T08:09:31', '2'), - ('488', '3788', '2006-02-16T02:30:53', '2005-07-28T17:15:38', '2005-08-04T18:04:38', '2'), - ('352', '2803', '2006-02-16T02:30:53', '2005-07-27T03:03:25', '2005-07-28T01:57:25', '2'), - ('294', '3407', '2006-02-16T02:30:53', '2005-06-20T02:40:04', '2005-06-27T20:47:04', '2'), - ('304', '3281', '2006-02-16T02:30:53', '2005-07-08T17:07:11', '2005-07-17T21:03:11', '2'), - ('477', '2092', '2006-02-16T02:30:53', '2005-08-22T11:34:43', '2005-08-23T16:52:43', '2'), - ('180', '1139', '2006-02-16T02:30:53', '2005-08-22T02:20:44', '2005-08-26T08:02:44', '2'), - ('407', '296', '2006-02-16T02:30:53', '2005-07-29T21:25:51', '2005-07-30T18:15:51', '2'), - ('76', '1973', '2006-02-16T02:30:53', '2005-07-12T16:34:40', '2005-07-14T17:02:40', '2'), - ('84', '4121', '2006-02-16T02:30:53', '2005-08-01T12:24:42', '2005-08-03T08:39:42', '2'), - ('317', '1473', '2006-02-16T02:30:53', '2005-06-18T07:04:36', '2005-06-27T03:00:36', '2'), - ('297', '3175', '2006-02-16T02:30:53', '2005-07-28T12:27:27', '2005-07-29T10:34:27', '2'), - ('419', '3478', '2006-02-16T02:30:53', '2005-08-21T07:43:21', '2005-08-25T02:39:21', '2'), - ('12', '3356', '2006-02-16T02:30:53', '2005-07-30T13:49:43', '2005-08-08T08:25:43', '2'), - ('12', '1424', '2006-02-16T02:30:53', '2005-07-27T11:50:47', '2005-07-30T11:19:47', '2'), - ('103', '1314', '2006-02-16T02:30:53', '2005-07-29T03:01:24', '2005-07-30T01:08:24', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['9652', '1852', '9817', '15973', '14606', '3136', '9764', '2590', '6355', '2903', '3240', '3481', '587', '4636', '5420', '10840', '15512', '6528', '13954', '2401', '4411', '8144', '10440', '11654', '14650', '3093', '5529', '8127', '7886', '1481', '12462', '14888', '10604', '1780', '5991', '2715', '9456', '8396', '10094', '7540', '556', '2220', '5727', '4487', '11260', '9572', '15666', '12401', '1474', '1972', '3937', '7755', '7296', '15381', '6276', '14490', '3041', '11561', '7275', '5472', '6134', '9993', '4329', '5594', '7368', '7381', '714', '8390', '15553', '9155', '11585', '2435', '7796', '3220', '11833', '15464', '12120', '7727', '15302', '6107', '6109', '4715', '15338', '14053', '4699', '7619', '12525', '9875', '8829', '9430', '13593', '5606', '13870', '14537', '10132', '4375', '1098', '10418', '2990', '6389']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('207', '448', '2006-02-16T02:30:53', '2005-07-31T05:49:53', '2005-08-06T07:38:53', '2'), - ('271', '4122', '2006-02-16T02:30:53', '2005-06-17T00:38:20', '2005-06-22T20:04:20', '2'), - ('170', '4019', '2006-02-16T02:30:53', '2005-07-31T11:33:31', '2005-08-08T14:49:31', '2'), - ('343', '2766', '2006-02-16T02:30:53', '2005-08-23T20:04:41', '2005-09-01T20:08:41', '2'), - ('592', '2291', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('377', '3349', '2006-02-16T02:30:53', '2005-06-20T19:39:08', '2005-06-22T23:35:08', '2'), - ('136', '3761', '2006-02-16T02:30:53', '2005-07-31T09:42:58', '2005-08-07T07:22:58', '2'), - ('324', '3572', '2006-02-16T02:30:53', '2005-06-19T05:31:40', '2005-06-20T07:58:40', '2'), - ('482', '2472', '2006-02-16T02:30:53', '2005-07-11T20:56:29', '2005-07-20T01:50:29', '2'), - ('53', '3580', '2006-02-16T02:30:53', '2005-06-20T02:49:01', '2005-06-25T05:03:01', '2'), - ('405', '2938', '2006-02-16T02:30:53', '2005-06-21T02:53:17', '2005-06-30T03:25:17', '2'), - ('138', '3575', '2006-02-16T02:30:53', '2005-07-05T23:13:07', '2005-07-07T20:36:07', '2'), - ('64', '1413', '2006-02-16T02:30:53', '2005-05-28T12:05:33', '2005-05-30T13:45:33', '2'), - ('228', '1858', '2006-02-16T02:30:53', '2005-07-08T08:44:32', '2005-07-10T08:59:32', '2'), - ('80', '1739', '2006-02-16T02:30:53', '2005-07-09T20:48:42', '2005-07-15T21:35:42', '2'), - ('593', '583', '2006-02-16T02:30:53', '2005-08-01T23:38:34', '2005-08-07T02:36:34', '2'), - ('25', '4336', '2006-02-16T02:30:53', '2005-08-23T02:57:30', '2005-08-25T01:47:30', '2'), - ('598', '3824', '2006-02-16T02:30:53', '2005-07-12T04:29:44', '2005-07-18T02:39:44', '2'), - ('207', '3812', '2006-02-16T02:30:53', '2005-08-20T18:02:41', '2005-08-27T21:52:41', '2'), - ('359', '85', '2006-02-16T02:30:53', '2005-06-18T16:22:03', '2005-06-19T13:49:03', '2'), - ('224', '320', '2006-02-16T02:30:53', '2005-07-07T21:54:58', '2005-07-14T16:14:58', '2'), - ('320', '3556', '2006-02-16T02:30:53', '2005-07-28T20:30:55', '2005-07-31T18:10:55', '2'), - ('299', '842', '2006-02-16T02:30:53', '2005-08-01T08:54:32', '2005-08-02T10:59:32', '2'), - ('218', '1048', '2006-02-16T02:30:53', '2005-08-17T05:06:19', '2005-08-18T04:32:19', '2'), - ('190', '1274', '2006-02-16T02:30:53', '2005-08-21T19:24:51', '2005-08-25T13:58:51', '2'), - ('556', '2534', '2006-02-16T02:30:53', '2005-06-20T16:06:14', '2005-06-22T13:22:14', '2'), - ('590', '1652', '2006-02-16T02:30:53', '2005-07-10T02:11:13', '2005-07-15T06:56:13', '2'), - ('20', '4265', '2006-02-16T02:30:53', '2005-07-28T19:45:19', '2005-07-31T22:07:19', '2'), - ('352', '237', '2006-02-16T02:30:53', '2005-07-28T10:37:55', '2005-08-04T13:22:55', '2'), - ('125', '3041', '2006-02-16T02:30:53', '2005-06-15T21:17:58', '2005-06-18T17:53:58', '2'), - ('574', '890', '2006-02-16T02:30:53', '2005-08-18T11:28:55', '2005-08-20T12:06:55', '2'), - ('91', '3345', '2006-02-16T02:30:53', '2005-08-22T04:09:18', '2005-08-23T07:34:18', '2'), - ('250', '2833', '2006-02-16T02:30:53', '2005-08-01T14:35:08', '2005-08-08T10:19:08', '2'), - ('352', '146', '2006-02-16T02:30:53', '2005-06-16T19:11:45', '2005-06-19T15:34:45', '2'), - ('590', '3623', '2006-02-16T02:30:53', '2005-07-11T01:03:38', '2005-07-12T22:32:38', '2'), - ('404', '2082', '2006-02-16T02:30:53', '2005-06-19T14:29:35', '2005-06-26T08:44:35', '2'), - ('534', '2068', '2006-02-16T02:30:53', '2005-07-30T22:22:16', '2005-08-05T18:56:16', '2'), - ('516', '3911', '2006-02-16T02:30:53', '2005-07-29T06:07:00', '2005-07-30T05:32:00', '2'), - ('596', '2865', '2006-02-16T02:30:53', '2005-07-31T20:31:18', '2005-08-06T18:31:18', '2'), - ('207', '2198', '2006-02-16T02:30:53', '2005-07-27T21:39:55', '2005-08-04T18:10:55', '2'), - ('22', '1814', '2006-02-16T02:30:53', '2005-05-28T08:31:36', '2005-06-06T07:29:36', '2'), - ('587', '320', '2006-02-16T02:30:53', '2005-06-18T03:21:36', '2005-06-21T07:45:36', '2'), - ('550', '3338', '2006-02-16T02:30:53', '2005-07-10T11:25:28', '2005-07-11T11:03:28', '2'), - ('360', '2220', '2006-02-16T02:30:53', '2005-07-08T01:20:22', '2005-07-16T21:23:22', '2'), - ('207', '4015', '2006-02-16T02:30:53', '2005-08-02T13:52:19', '2005-08-06T08:13:19', '2'), - ('283', '1453', '2006-02-16T02:30:53', '2005-07-31T02:44:10', '2005-08-01T03:30:10', '2'), - ('586', '3406', '2006-02-16T02:30:53', '2005-08-23T09:01:10', '2005-08-31T12:32:10', '2'), - ('479', '4314', '2006-02-16T02:30:53', '2005-08-18T09:20:51', '2005-08-21T05:50:51', '2'), - ('202', '164', '2006-02-16T02:30:53', '2005-06-15T20:55:42', '2005-06-19T02:41:42', '2'), - ('526', '2758', '2006-02-16T02:30:53', '2005-06-17T09:25:49', '2005-06-24T09:59:49', '2'), - ('211', '2091', '2006-02-16T02:30:53', '2005-07-06T21:15:38', '2005-07-15T00:01:38', '2'), - ('449', '1247', '2006-02-16T02:30:53', '2005-07-28T06:22:18', '2005-08-06T11:38:18', '2'), - ('400', '1681', '2006-02-16T02:30:53', '2005-07-27T12:39:48', '2005-08-04T18:24:48', '2'), - ('110', '845', '2006-02-16T02:30:53', '2005-08-22T22:28:36', '2005-08-24T19:26:36', '2'), - ('284', '1826', '2006-02-16T02:30:53', '2005-07-11T16:15:50', '2005-07-19T20:50:50', '2'), - ('205', '1771', '2006-02-16T02:30:53', '2005-08-21T13:54:15', '2005-08-28T19:08:15', '2'), - ('459', '2676', '2006-02-16T02:30:53', '2005-06-20T12:35:44', '2005-06-23T18:28:44', '2'), - ('149', '189', '2006-02-16T02:30:53', '2005-08-17T01:23:09', '2005-08-23T21:02:09', '2'), - ('323', '775', '2006-02-16T02:30:53', '2005-07-27T11:39:08', '2005-07-30T13:37:08', '2'), - ('165', '865', '2006-02-16T02:30:53', '2005-07-09T23:16:40', '2005-07-10T18:43:40', '2'), - ('305', '3225', '2006-02-16T02:30:53', '2005-07-11T08:28:19', '2005-07-18T09:20:19', '2'), - ('225', '2503', '2006-02-16T02:30:53', '2005-07-31T17:30:20', '2005-08-01T20:53:20', '2'), - ('504', '638', '2006-02-16T02:30:53', '2005-07-07T18:04:16', '2005-07-15T17:58:16', '2'), - ('440', '61', '2006-02-16T02:30:53', '2005-07-10T04:33:36', '2005-07-12T08:13:36', '2'), - ('286', '2265', '2006-02-16T02:30:53', '2005-07-27T15:06:05', '2005-07-31T14:10:05', '2'), - ('483', '1595', '2006-02-16T02:30:53', '2005-07-27T15:40:26', '2005-08-02T17:26:26', '2'), - ('452', '2010', '2006-02-16T02:30:53', '2005-05-29T04:15:21', '2005-06-01T23:05:21', '2'), - ('32', '581', '2006-02-16T02:30:53', '2005-07-29T05:52:26', '2005-08-04T08:12:26', '2'), - ('232', '1659', '2006-02-16T02:30:53', '2005-08-23T04:33:39', '2005-08-25T07:53:39', '2'), - ('107', '3787', '2006-02-16T02:30:53', '2005-07-30T11:00:00', '2005-08-02T05:24:00', '2'), - ('297', '753', '2006-02-16T02:30:53', '2005-08-17T02:14:36', '2005-08-20T07:37:36', '2'), - ('173', '3548', '2006-02-16T02:30:53', '2005-06-18T18:12:26', '2005-06-22T13:43:26', '2'), - ('419', '622', '2006-02-16T02:30:53', '2005-07-28T07:39:39', '2005-08-02T05:34:39', '2'), - ('574', '1880', '2006-02-16T02:30:53', '2005-06-21T01:46:25', '2005-06-26T07:44:25', '2'), - ('424', '3728', '2006-02-16T02:30:53', '2005-08-17T13:00:33', '2005-08-18T13:45:33', '2'), - ('62', '3235', '2006-02-16T02:30:53', '2005-08-23T01:15:18', '2005-08-29T02:58:18', '2'), - ('323', '2912', '2006-02-16T02:30:53', '2005-08-17T23:16:46', '2005-08-19T00:11:46', '2'), - ('123', '2274', '2006-02-16T02:30:53', '2005-07-28T04:52:43', '2005-08-03T01:12:43', '2'), - ('320', '188', '2006-02-16T02:30:53', '2005-08-22T19:44:53', '2005-08-24T18:13:53', '2'), - ('304', '3798', '2006-02-16T02:30:53', '2005-07-11T07:07:09', '2005-07-14T07:32:09', '2'), - ('163', '3603', '2006-02-16T02:30:53', '2005-07-11T07:20:57', '2005-07-13T07:29:57', '2'), - ('276', '4010', '2006-02-16T02:30:53', '2005-07-08T12:15:37', '2005-07-10T10:37:37', '2'), - ('13', '502', '2006-02-16T02:30:53', '2005-08-22T20:51:24', '2005-08-24T23:41:24', '2'), - ('5', '2177', '2006-02-16T02:30:53', '2005-08-20T22:13:59', '2005-08-26T20:50:59', '2'), - ('348', '2462', '2006-02-16T02:30:53', '2005-07-08T11:36:56', '2005-07-14T11:35:56', '2'), - ('419', '1057', '2006-02-16T02:30:53', '2005-07-28T00:25:41', '2005-07-30T04:35:41', '2'), - ('96', '2357', '2006-02-16T02:30:53', '2005-08-18T13:48:31', '2005-08-23T13:04:31', '2'), - ('421', '2878', '2006-02-16T02:30:53', '2005-07-31T13:37:41', '2005-08-03T15:17:41', '2'), - ('173', '1466', '2006-02-16T02:30:53', '2005-07-29T22:33:34', '2005-08-05T20:23:34', '2'), - ('367', '1529', '2006-02-16T02:30:53', '2005-07-30T21:20:13', '2005-08-04T21:45:13', '2'), - ('585', '261', '2006-02-16T02:30:53', '2005-08-20T05:50:52', '2005-08-27T05:28:52', '2'), - ('51', '2896', '2006-02-16T02:30:53', '2005-07-10T05:07:55', '2005-07-15T00:14:55', '2'), - ('167', '563', '2006-02-16T02:30:53', '2005-08-20T15:09:16', '2005-08-28T10:00:16', '2'), - ('405', '3755', '2006-02-16T02:30:53', '2005-08-21T15:24:24', '2005-08-23T17:14:24', '2'), - ('23', '3934', '2006-02-16T02:30:53', '2005-07-31T21:50:24', '2005-08-07T23:37:24', '2'), - ('560', '3035', '2006-02-16T02:30:53', '2005-07-07T20:20:29', '2005-07-16T19:29:29', '2'), - ('425', '1050', '2006-02-16T02:30:53', '2005-05-31T13:51:48', '2005-06-09T18:42:48', '2'), - ('248', '1692', '2006-02-16T02:30:53', '2005-08-01T08:11:07', '2005-08-04T11:12:07', '2'), - ('18', '4559', '2006-02-16T02:30:53', '2005-06-20T09:02:51', '2005-06-29T13:19:51', '2'), - ('274', '2268', '2006-02-16T02:30:53', '2005-07-11T22:18:20', '2005-07-16T16:57:20', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['13939', '4738', '13465', '11463', '8470', '1097', '13985', '14780', '1963', '2777', '11000', '3717', '7700', '13989', '3028', '7173', '1811', '13159', '607', '8191', '7900', '15367', '5548', '4729', '8931', '13176', '15334', '13361', '4622', '15525', '9014', '7164', '10013', '4399', '7404', '11647', '4238', '13879', '9960', '7099', '2289', '12767', '6090', '330', '11578', '8284', '2169', '10173', '8413', '2940', '9775', '4171', '12707', '12892', '4520', '11400', '6794', '9653', '8503', '11778', '11078', '13386', '12602', '9284', '8449', '6628', '3963', '11049', '9819', '12674', '1090', '15726', '2933', '2563', '7285', '6704', '4405', '15266', '2836', '8314', '4849', '2245', '247', '1509', '5173', '2155', '13780', '13911', '3309', '105', '2637', '10875', '4140', '1396', '808', '4063', '10443', '9214', '14656', '1380']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('585', '2700', '2006-02-16T02:30:53', '2005-08-20T17:28:01', '2005-08-23T14:40:01', '2'), - ('31', '2021', '2006-02-16T02:30:53', '2005-07-08T13:24:58', '2005-07-17T17:44:58', '2'), - ('575', '1305', '2006-02-16T02:30:53', '2005-08-20T00:54:14', '2005-08-21T20:55:14', '2'), - ('138', '1944', '2006-02-16T02:30:53', '2005-08-02T21:37:36', '2005-08-08T03:11:36', '2'), - ('159', '3717', '2006-02-16T02:30:53', '2005-07-29T08:28:50', '2005-07-30T13:40:50', '2'), - ('491', '2285', '2006-02-16T02:30:53', '2005-05-31T13:38:42', '2005-06-01T13:54:42', '2'), - ('339', '1081', '2006-02-16T02:30:53', '2005-08-20T19:13:06', '2005-08-24T21:24:06', '2'), - ('491', '3171', '2006-02-16T02:30:53', '2005-08-22T00:06:33', '2005-08-22T22:02:33', '2'), - ('154', '1943', '2006-02-16T02:30:53', '2005-06-17T09:09:31', '2005-06-24T13:16:31', '2'), - ('230', '4092', '2006-02-16T02:30:53', '2005-06-19T18:16:26', '2005-06-20T13:43:26', '2'), - ('265', '264', '2006-02-16T02:30:53', '2005-08-02T04:56:14', '2005-08-07T01:39:14', '2'), - ('173', '1677', '2006-02-16T02:30:53', '2005-07-06T10:53:34', '2005-07-07T13:43:34', '2'), - ('124', '3546', '2006-02-16T02:30:53', '2005-07-28T03:54:14', '2005-08-05T06:20:14', '2'), - ('252', '1470', '2006-02-16T02:30:53', '2005-08-20T19:27:50', '2005-08-28T15:17:50', '2'), - ('264', '886', '2006-02-16T02:30:53', '2005-06-20T11:50:52', '2005-06-21T11:05:52', '2'), - ('592', '177', '2006-02-16T02:30:53', '2005-07-27T07:59:24', '2005-07-28T02:23:24', '2'), - ('235', '3700', '2006-02-16T02:30:53', '2005-06-16T21:06:20', '2005-06-21T21:59:20', '2'), - ('497', '2300', '2006-02-16T02:30:53', '2005-08-19T13:19:59', '2005-08-21T09:22:59', '2'), - ('554', '2561', '2006-02-16T02:30:53', '2005-05-28T15:02:41', '2005-05-30T12:54:41', '2'), - ('508', '1777', '2006-02-16T02:30:53', '2005-07-28T22:47:14', '2005-07-31T23:13:14', '2'), - ('154', '2781', '2006-02-16T02:30:53', '2005-07-28T11:11:33', '2005-08-05T06:29:33', '2'), - ('355', '160', '2006-02-16T02:30:53', '2005-08-22T21:47:53', '2005-08-27T17:54:53', '2'), - ('317', '2973', '2006-02-16T02:30:53', '2005-07-10T02:56:45', '2005-07-13T01:33:45', '2'), - ('205', '1429', '2006-02-16T02:30:53', '2005-07-08T12:59:40', '2005-07-10T13:35:40', '2'), - ('268', '16', '2006-02-16T02:30:53', '2005-07-30T02:30:07', '2005-08-02T08:24:07', '2'), - ('1', '2269', '2006-02-16T02:30:53', '2005-08-19T13:56:54', '2005-08-23T08:50:54', '2'), - ('407', '3882', '2006-02-16T02:30:53', '2005-08-22T20:44:35', '2005-08-29T23:03:35', '2'), - ('107', '4289', '2006-02-16T02:30:53', '2005-08-19T21:07:22', '2005-08-21T21:26:22', '2'), - ('289', '2710', '2006-02-16T02:30:53', '2005-07-08T08:02:42', '2005-07-10T07:46:42', '2'), - ('123', '3509', '2006-02-16T02:30:53', '2005-08-23T03:43:32', '2005-08-25T07:31:32', '2'), - ('297', '311', '2006-02-16T02:30:53', '2005-07-30T05:19:27', '2005-08-01T01:10:27', '2'), - ('284', '527', '2006-02-16T02:30:53', '2005-07-27T07:36:34', '2005-08-04T05:05:34', '2'), - ('377', '2364', '2006-02-16T02:30:53', '2005-07-31T18:08:21', '2005-08-08T13:22:21', '2'), - ('402', '4515', '2006-02-16T02:30:53', '2005-07-07T21:20:28', '2005-07-12T20:57:28', '2'), - ('190', '2359', '2006-02-16T02:30:53', '2005-07-27T16:24:43', '2005-07-29T11:40:43', '2'), - ('110', '3016', '2006-02-16T02:30:53', '2005-08-17T04:54:14', '2005-08-23T04:16:14', '2'), - ('7', '3024', '2006-02-16T02:30:53', '2005-07-07T13:22:20', '2005-07-10T07:44:20', '2'), - ('112', '4022', '2006-02-16T02:30:53', '2005-08-20T15:18:10', '2005-08-22T19:23:10', '2'), - ('569', '1022', '2006-02-16T02:30:53', '2005-07-31T16:05:52', '2005-08-05T14:15:52', '2'), - ('6', '3136', '2006-02-16T02:30:53', '2005-07-27T05:03:44', '2005-07-29T00:12:44', '2'), - ('392', '2030', '2006-02-16T02:30:53', '2005-06-18T07:29:43', '2005-06-24T11:16:43', '2'), - ('432', '3351', '2006-02-16T02:30:53', '2005-08-18T23:25:49', '2005-08-28T02:40:49', '2'), - ('241', '71', '2006-02-16T02:30:53', '2005-07-11T05:47:08', '2005-07-20T07:52:08', '2'), - ('248', '1536', '2006-02-16T02:30:53', '2005-05-27T02:15:30', '2005-06-04T05:09:30', '2'), - ('590', '192', '2006-02-16T02:30:53', '2005-08-17T01:54:13', '2005-08-26T02:00:13', '2'), - ('446', '4371', '2006-02-16T02:30:53', '2005-07-29T01:56:40', '2005-08-07T07:15:40', '2'), - ('120', '785', '2006-02-16T02:30:53', '2005-06-17T23:57:23', '2005-06-19T20:14:23', '2'), - ('326', '2527', '2006-02-16T02:30:53', '2005-07-31T23:36:59', '2005-08-08T20:20:59', '2'), - ('104', '2762', '2006-02-16T02:30:53', '2005-07-29T06:47:39', '2005-08-02T09:15:39', '2'), - ('73', '2504', '2006-02-16T02:30:53', '2005-06-20T05:20:01', '2005-06-28T06:11:01', '2'), - ('162', '2818', '2006-02-16T02:30:53', '2005-07-31T10:00:00', '2005-08-01T08:57:00', '2'), - ('476', '4199', '2006-02-16T02:30:53', '2005-07-07T09:49:04', '2005-07-14T03:58:04', '2'), - ('426', '1565', '2006-02-16T02:30:53', '2005-08-18T20:52:02', '2005-08-25T19:03:02', '2'), - ('121', '1044', '2006-02-16T02:30:53', '2005-08-19T03:46:34', '2005-08-21T05:11:34', '2'), - ('104', '3505', '2006-02-16T02:30:53', '2005-07-08T02:53:46', '2005-07-08T22:27:46', '2'), - ('9', '3150', '2006-02-16T02:30:53', '2005-08-02T19:00:52', '2005-08-09T19:45:52', '2'), - ('233', '813', '2006-02-16T02:30:53', '2005-07-12T16:38:23', '2005-07-20T17:36:23', '2'), - ('383', '1451', '2006-02-16T02:30:53', '2005-07-31T05:55:38', '2005-08-03T09:35:38', '2'), - ('240', '1164', '2006-02-16T02:30:53', '2005-07-29T09:16:50', '2005-08-04T11:34:50', '2'), - ('213', '1306', '2006-02-16T02:30:53', '2005-08-17T10:31:40', '2005-08-25T13:53:40', '2'), - ('587', '2362', '2006-02-16T02:30:53', '2005-08-02T07:26:58', '2005-08-07T01:59:58', '2'), - ('324', '4476', '2006-02-16T02:30:53', '2005-08-19T21:43:58', '2005-08-24T20:29:58', '2'), - ('533', '2001', '2006-02-16T02:30:53', '2005-08-18T16:49:50', '2005-08-21T11:13:50', '2'), - ('38', '3976', '2006-02-16T02:30:53', '2005-07-30T15:25:19', '2005-08-01T17:45:19', '2'), - ('273', '2610', '2006-02-16T02:30:53', '2005-07-29T07:42:25', '2005-07-30T06:07:25', '2'), - ('211', '2894', '2006-02-16T02:30:53', '2005-07-12T09:18:08', '2005-07-21T04:27:08', '2'), - ('111', '3912', '2006-02-16T02:30:53', '2005-07-06T22:19:17', '2005-07-15T01:22:17', '2'), - ('38', '4352', '2006-02-16T02:30:53', '2005-08-02T06:15:40', '2005-08-11T10:09:40', '2'), - ('292', '1927', '2006-02-16T02:30:53', '2005-07-31T11:39:13', '2005-08-06T09:11:13', '2'), - ('185', '636', '2006-02-16T02:30:53', '2005-08-18T19:24:56', '2005-08-26T22:16:56', '2'), - ('23', '3329', '2006-02-16T02:30:53', '2005-05-31T12:03:44', '2005-06-02T15:54:44', '2'), - ('503', '906', '2006-02-16T02:30:53', '2005-08-23T11:28:26', '2005-08-28T11:23:26', '2'), - ('323', '4483', '2006-02-16T02:30:53', '2005-06-20T04:52:23', '2005-06-26T07:12:23', '2'), - ('41', '1935', '2006-02-16T02:30:53', '2005-06-19T03:24:17', '2005-06-23T04:08:17', '2'), - ('498', '2855', '2006-02-16T02:30:53', '2005-07-27T12:14:06', '2005-08-03T14:57:06', '2'), - ('595', '1590', '2006-02-16T02:30:53', '2005-07-12T12:50:24', '2005-07-20T16:41:24', '2'), - ('145', '2102', '2006-02-16T02:30:53', '2005-07-07T21:33:16', '2005-07-15T00:33:16', '2'), - ('124', '1870', '2006-02-16T02:30:53', '2005-08-22T18:37:24', '2005-08-23T17:34:24', '2'), - ('306', '1453', '2006-02-16T02:30:53', '2005-06-19T21:58:21', '2005-06-27T00:41:21', '2'), - ('118', '2182', '2006-02-16T02:30:53', '2005-07-29T03:35:04', '2005-08-06T08:43:04', '2'), - ('146', '4323', '2006-02-16T02:30:53', '2005-07-08T18:34:34', '2005-07-14T20:27:34', '2'), - ('194', '1496', '2006-02-16T02:30:53', '2005-06-18T04:52:59', '2005-06-24T05:07:59', '2'), - ('102', '4095', '2006-02-16T02:30:53', '2005-05-26T14:01:05', '2005-05-28T13:38:05', '2'), - ('167', '655', '2006-02-16T02:30:53', '2005-06-15T22:35:53', '2005-06-23T17:09:53', '2'), - ('490', '2848', '2006-02-16T02:30:53', '2005-07-09T09:31:44', '2005-07-15T04:20:44', '2'), - ('227', '3640', '2006-02-16T02:30:53', '2005-06-17T23:07:29', '2005-06-25T03:23:29', '2'), - ('14', '1775', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('304', '4400', '2006-02-16T02:30:53', '2005-08-20T16:31:33', '2005-08-28T19:26:33', '2'), - ('463', '248', '2006-02-16T02:30:53', '2005-06-21T08:00:49', '2005-06-29T04:11:49', '2'), - ('108', '794', '2006-02-16T02:30:53', '2005-05-25T17:54:12', '2005-05-30T12:03:12', '2'), - ('327', '2736', '2006-02-16T02:30:53', '2005-06-19T09:20:56', '2005-06-27T10:09:56', '2'), - ('175', '862', '2006-02-16T02:30:53', '2005-08-02T00:31:44', '2005-08-05T22:24:44', '2'), - ('190', '1897', '2006-02-16T02:30:53', '2005-07-07T08:19:10', '2005-07-14T07:27:10', '2'), - ('103', '1007', '2006-02-16T02:30:53', '2005-06-15T16:22:38', '2005-06-17T15:53:38', '2'), - ('104', '1928', '2006-02-16T02:30:53', '2005-05-29T19:08:20', '2005-06-06T20:32:20', '2'), - ('331', '1452', '2006-02-16T02:30:53', '2005-07-07T04:23:57', '2005-07-14T23:35:57', '2'), - ('403', '1965', '2006-02-16T02:30:53', '2005-08-01T09:01:04', '2005-08-04T09:07:04', '2'), - ('181', '2823', '2006-02-16T02:30:53', '2005-07-30T13:10:14', '2005-08-06T14:22:14', '2'), - ('201', '4205', '2006-02-16T02:30:53', '2005-08-21T19:39:28', '2005-08-24T01:36:28', '2'), - ('158', '3376', '2006-02-16T02:30:53', '2005-06-15T15:13:10', '2005-06-18T12:42:10', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['7086', '11828', '9569', '12570', '5335', '12837', '8641', '6382', '14197', '6731', '13725', '11149', '4260', '8612', '1682', '8677', '15010', '2906', '254', '12396', '7370', '4616', '14474', '5493', '14248', '15221', '981', '12485', '2253', '2333', '523', '7382', '13330', '7745', '11158', '2283', '14829', '5750', '12161', '4634', '468', '5275', '9664', '12992', '5413', '9677', '7871', '1897', '312', '531', '15552', '15353', '12810', '3531', '2199', '15680', '11594', '8249', '7701', '7198', '10253', '14327', '1552', '11652', '10020', '8278', '8079', '14494', '205', '9222', '12270', '10654', '4102', '12072', '2038', '5954', '7563', '11345', '13151', '9975', '11896', '3814', '12392', '4963', '10939', '12293', '6610', '14584', '7245', '9985', '1344', '12941', '5908', '9519', '4941', '3326', '14896', '12735', '5446', '13760']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('595', '2938', '2006-02-16T02:30:53', '2005-07-27T04:39:46', '2005-08-05T00:32:46', '2'), - ('268', '2593', '2006-02-16T02:30:53', '2005-08-17T12:48:28', '2005-08-24T09:24:28', '2'), - ('405', '813', '2006-02-16T02:30:53', '2005-07-31T02:39:38', '2005-08-02T05:09:38', '2'), - ('211', '3973', '2006-02-16T02:30:53', '2005-08-18T15:23:31', '2005-08-22T09:59:31', '2'), - ('588', '2353', '2006-02-16T02:30:53', '2005-07-09T17:00:49', '2005-07-12T12:21:49', '2'), - ('495', '2288', '2006-02-16T02:30:53', '2005-08-19T01:51:09', '2005-08-22T07:14:09', '2'), - ('30', '3199', '2006-02-16T02:30:53', '2005-07-29T14:37:30', '2005-08-02T19:32:30', '2'), - ('336', '3223', '2006-02-16T02:30:53', '2005-07-11T21:58:53', '2005-07-17T21:18:53', '2'), - ('469', '340', '2006-02-16T02:30:53', '2005-08-21T03:47:25', '2005-08-30T09:15:25', '2'), - ('593', '844', '2006-02-16T02:30:53', '2005-07-12T13:58:27', '2005-07-15T10:04:27', '2'), - ('306', '3861', '2006-02-16T02:30:53', '2005-08-20T10:08:27', '2005-08-28T06:52:27', '2'), - ('358', '3254', '2006-02-16T02:30:53', '2005-08-02T09:51:43', '2005-08-11T09:40:43', '2'), - ('305', '4575', '2006-02-16T02:30:53', '2005-07-07T14:22:45', '2005-07-08T15:10:45', '2'), - ('392', '3518', '2006-02-16T02:30:53', '2005-07-29T13:28:20', '2005-08-06T14:39:20', '2'), - ('476', '2165', '2006-02-16T02:30:53', '2005-06-16T11:54:25', '2005-06-22T11:09:25', '2'), - ('315', '513', '2006-02-16T02:30:53', '2005-07-29T16:01:13', '2005-08-07T19:21:13', '2'), - ('508', '171', '2006-02-16T02:30:53', '2005-08-22T08:30:17', '2005-08-29T13:24:17', '2'), - ('58', '1087', '2006-02-16T02:30:53', '2005-06-20T03:04:56', '2005-06-23T05:57:56', '2'), - ('390', '1835', '2006-02-16T02:30:53', '2005-05-26T14:43:48', '2005-05-31T09:19:48', '2'), - ('40', '3624', '2006-02-16T02:30:53', '2005-08-18T09:11:23', '2005-08-26T05:35:23', '2'), - ('89', '2022', '2006-02-16T02:30:53', '2005-07-27T15:15:53', '2005-08-03T19:53:53', '2'), - ('280', '2580', '2006-02-16T02:30:53', '2005-07-08T07:48:12', '2005-07-10T08:13:12', '2'), - ('294', '2632', '2006-02-16T02:30:53', '2005-08-21T13:22:48', '2005-08-27T14:13:48', '2'), - ('539', '2037', '2006-02-16T02:30:53', '2005-07-10T00:11:44', '2005-07-15T19:24:44', '2'), - ('293', '725', '2006-02-16T02:30:53', '2005-08-21T05:35:57', '2005-08-28T05:53:57', '2'), - ('253', '110', '2006-02-16T02:30:53', '2005-08-22T17:12:29', '2005-08-24T20:46:29', '2'), - ('326', '2913', '2006-02-16T02:30:53', '2005-05-30T21:52:42', '2005-06-01T03:15:42', '2'), - ('345', '422', '2006-02-16T02:30:53', '2005-08-18T12:41:41', '2005-08-22T16:38:41', '2'), - ('122', '3719', '2006-02-16T02:30:53', '2005-06-18T05:11:43', '2005-06-25T03:30:43', '2'), - ('283', '2323', '2006-02-16T02:30:53', '2005-06-18T10:55:54', '2005-06-25T07:09:54', '2'), - ('138', '1905', '2006-02-16T02:30:53', '2005-05-28T03:53:26', '2005-05-31T05:58:26', '2'), - ('518', '356', '2006-02-16T02:30:53', '2005-07-27T15:43:15', '2005-07-28T11:18:15', '2'), - ('297', '4276', '2006-02-16T02:30:53', '2005-08-19T19:59:21', '2005-08-20T15:34:21', '2'), - ('285', '1014', '2006-02-16T02:30:53', '2005-07-28T05:46:28', '2005-08-06T07:44:28', '2'), - ('190', '530', '2006-02-16T02:30:53', '2005-08-02T09:58:28', '2005-08-10T13:54:28', '2'), - ('507', '2056', '2006-02-16T02:30:53', '2005-06-18T06:56:06', '2005-06-19T05:11:06', '2'), - ('546', '3606', '2006-02-16T02:30:53', '2005-08-22T01:35:37', '2005-08-23T19:55:37', '2'), - ('330', '3855', '2006-02-16T02:30:53', '2005-07-10T12:20:41', '2005-07-17T08:25:41', '2'), - ('444', '2420', '2006-02-16T02:30:53', '2005-08-18T00:41:46', '2005-08-26T22:59:46', '2'), - ('275', '811', '2006-02-16T02:30:53', '2005-07-08T08:40:02', '2005-07-12T04:45:02', '2'), - ('101', '2656', '2006-02-16T02:30:53', '2005-05-27T21:13:10', '2005-06-04T15:26:10', '2'), - ('249', '729', '2006-02-16T02:30:53', '2005-07-09T14:34:18', '2005-07-13T12:56:18', '2'), - ('13', '360', '2006-02-16T02:30:53', '2005-07-31T06:12:08', '2005-08-04T02:19:08', '2'), - ('597', '3022', '2006-02-16T02:30:53', '2005-08-19T07:23:06', '2005-08-23T06:11:06', '2'), - ('167', '2056', '2006-02-16T02:30:53', '2005-07-09T20:28:42', '2005-07-10T19:23:42', '2'), - ('274', '3200', '2006-02-16T02:30:53', '2005-07-31T06:39:45', '2005-08-01T02:37:45', '2'), - ('491', '3990', '2006-02-16T02:30:53', '2005-07-28T10:16:37', '2005-08-05T11:24:37', '2'), - ('422', '4142', '2006-02-16T02:30:53', '2005-06-17T04:26:23', '2005-06-25T09:32:23', '2'), - ('143', '2008', '2006-02-16T02:30:53', '2005-05-26T22:52:19', '2005-06-02T18:14:19', '2'), - ('589', '1113', '2006-02-16T02:30:53', '2005-05-28T05:23:38', '2005-05-29T08:00:38', '2'), - ('527', '4347', '2006-02-16T02:30:53', '2005-08-23T04:33:23', '2005-09-01T10:25:23', '2'), - ('368', '3470', '2006-02-16T02:30:53', '2005-08-22T21:18:08', '2005-08-25T20:29:08', '2'), - ('250', '1340', '2006-02-16T02:30:53', '2005-08-19T00:44:10', '2005-08-22T22:30:10', '2'), - ('165', '1890', '2006-02-16T02:30:53', '2005-07-06T01:24:08', '2005-07-11T22:00:08', '2'), - ('171', '99', '2006-02-16T02:30:53', '2005-06-18T01:57:56', '2005-06-23T20:34:56', '2'), - ('169', '1370', '2006-02-16T02:30:53', '2005-08-23T09:33:22', '2005-08-31T13:29:22', '2'), - ('198', '319', '2006-02-16T02:30:53', '2005-08-17T02:47:02', '2005-08-22T05:14:02', '2'), - ('57', '3331', '2006-02-16T02:30:53', '2005-07-29T00:48:44', '2005-08-07T04:25:44', '2'), - ('306', '1604', '2006-02-16T02:30:53', '2005-07-28T03:54:28', '2005-08-01T08:39:28', '2'), - ('520', '4283', '2006-02-16T02:30:53', '2005-07-27T08:50:07', '2005-08-04T09:46:07', '2'), - ('101', '1406', '2006-02-16T02:30:53', '2005-08-01T02:39:49', '2005-08-08T04:28:49', '2'), - ('457', '553', '2006-02-16T02:30:53', '2005-08-21T08:18:18', '2005-08-30T02:21:18', '2'), - ('518', '819', '2006-02-16T02:30:53', '2005-06-16T02:01:37', '2005-06-21T00:59:37', '2'), - ('597', '1622', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('526', '302', '2006-02-16T02:30:53', '2005-07-31T18:21:08', '2005-08-02T14:03:08', '2'), - ('265', '768', '2006-02-16T02:30:53', '2005-07-29T01:42:55', '2005-08-05T01:55:55', '2'), - ('432', '3564', '2006-02-16T02:30:53', '2005-07-28T17:58:36', '2005-07-29T14:48:36', '2'), - ('5', '169', '2006-02-16T02:30:53', '2005-08-21T14:02:50', '2005-08-22T16:45:50', '2'), - ('114', '303', '2006-02-16T02:30:53', '2005-05-26T07:59:37', '2005-05-29T09:43:37', '2'), - ('95', '3648', '2006-02-16T02:30:53', '2005-07-30T13:21:08', '2005-08-08T10:42:08', '2'), - ('190', '2456', '2006-02-16T02:30:53', '2005-08-18T04:32:05', '2005-08-21T01:37:05', '2'), - ('399', '2522', '2006-02-16T02:30:53', '2005-08-01T16:31:35', '2005-08-05T12:04:35', '2'), - ('135', '3998', '2006-02-16T02:30:53', '2005-07-07T06:25:19', '2005-07-11T00:50:19', '2'), - ('61', '209', '2006-02-16T02:30:53', '2005-08-17T21:50:25', '2005-08-25T22:36:25', '2'), - ('138', '4231', '2006-02-16T02:30:53', '2005-06-17T14:00:51', '2005-06-19T11:54:51', '2'), - ('32', '2627', '2006-02-16T02:30:53', '2005-07-10T23:22:01', '2005-07-14T04:42:01', '2'), - ('453', '2709', '2006-02-16T02:30:53', '2005-07-27T22:25:36', '2005-08-01T03:59:36', '2'), - ('405', '1895', '2006-02-16T02:30:53', '2005-08-02T17:14:19', '2005-08-11T14:02:19', '2'), - ('16', '3045', '2006-02-16T02:30:53', '2005-08-19T13:08:23', '2005-08-20T12:38:23', '2'), - ('40', '2564', '2006-02-16T02:30:53', '2005-07-31T16:53:43', '2005-08-07T20:13:43', '2'), - ('436', '259', '2006-02-16T02:30:53', '2005-08-17T15:19:54', '2005-08-24T18:22:54', '2'), - ('306', '3826', '2006-02-16T02:30:53', '2005-07-06T15:23:56', '2005-07-13T20:51:56', '2'), - ('113', '2695', '2006-02-16T02:30:53', '2005-08-18T08:57:58', '2005-08-25T05:20:58', '2'), - ('404', '737', '2006-02-16T02:30:53', '2005-07-08T23:38:40', '2005-07-12T05:33:40', '2'), - ('161', '2131', '2006-02-16T02:30:53', '2005-08-02T03:06:20', '2005-08-04T01:22:20', '2'), - ('514', '614', '2006-02-16T02:30:53', '2005-08-18T05:13:36', '2005-08-25T04:00:36', '2'), - ('353', '645', '2006-02-16T02:30:53', '2005-07-12T08:20:02', '2005-07-21T09:16:02', '2'), - ('481', '2617', '2006-02-16T02:30:53', '2005-08-21T17:15:33', '2005-08-24T20:24:33', '2'), - ('95', '260', '2006-02-16T02:30:53', '2005-07-27T10:29:06', '2005-08-05T12:09:06', '2'), - ('85', '1831', '2006-02-16T02:30:53', '2005-07-31T17:14:47', '2005-08-01T12:11:47', '2'), - ('585', '1625', '2006-02-16T02:30:53', '2005-06-15T12:29:41', '2005-06-22T12:45:41', '2'), - ('195', '2951', '2006-02-16T02:30:53', '2005-08-19T05:39:26', '2005-08-22T09:50:26', '2'), - ('156', '810', '2006-02-16T02:30:53', '2005-07-10T20:44:14', '2005-07-13T15:05:14', '2'), - ('235', '3767', '2006-02-16T02:30:53', '2005-07-31T00:45:57', '2005-08-06T00:59:57', '2'), - ('553', '3816', '2006-02-16T02:30:53', '2005-07-08T22:39:10', '2005-07-15T17:49:10', '2'), - ('347', '1025', '2006-02-16T02:30:53', '2005-06-21T09:04:50', '2005-06-30T12:10:50', '2'), - ('569', '2508', '2006-02-16T02:30:53', '2005-08-22T04:20:55', '2005-08-29T05:11:55', '2'), - ('383', '3679', '2006-02-16T02:30:53', '2005-08-18T22:04:54', '2005-08-23T21:19:54', '2'), - ('454', '2769', '2006-02-16T02:30:53', '2005-07-09T21:59:55', '2005-07-11T01:45:55', '2'), - ('436', '3459', '2006-02-16T02:30:53', '2005-08-20T11:26:33', '2005-08-27T11:12:33', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['8902', '13670', '217', '11662', '10308', '3596', '3379', '8434', '5939', '4789', '9658', '4496', '15103', '3521', '10854', '13173', '14776', '14832', '6686', '12880', '8034', '11052', '1694', '12389', '15536', '357', '11381', '8738', '14137', '15706', '14391', '12751', '12671', '2875', '2080', '5901', '1541', '2628', '5070', '3230', '14810', '2509', '4022', '1178', '12414', '15093', '6769', '11873', '10591', '3841', '11283', '6356', '11350', '685', '11324', '15037', '1147', '6477', '6888', '13980', '4884', '5328', '2916', '8229', '2562', '14489', '15939', '11464', '15358', '13893', '8753', '11616', '10747', '7503', '572', '9005', '3076', '1775', '1866', '14289', '6484', '5805', '11531', '2949', '5183', '14619', '12364', '2805', '13042', '7312', '10438', '1885', '8873', '11785', '13551', '8812', '3677', '5438', '577', '2749']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('408', '2983', '2006-02-16T02:30:53', '2005-07-30T01:08:06', '2005-08-05T00:00:06', '2'), - ('147', '1951', '2006-02-16T02:30:53', '2005-08-20T08:27:01', '2005-08-29T05:59:01', '2'), - ('121', '4395', '2006-02-16T02:30:53', '2005-05-26T09:24:26', '2005-05-31T03:24:26', '2'), - ('177', '2730', '2006-02-16T02:30:53', '2005-08-17T05:27:37', '2005-08-26T09:56:37', '2'), - ('240', '588', '2006-02-16T02:30:53', '2005-08-01T04:22:49', '2005-08-09T04:39:49', '2'), - ('419', '594', '2006-02-16T02:30:53', '2005-07-06T05:03:11', '2005-07-07T05:30:11', '2'), - ('566', '2022', '2006-02-16T02:30:53', '2005-06-21T13:54:58', '2005-06-23T13:43:58', '2'), - ('141', '40', '2006-02-16T02:30:53', '2005-07-29T07:20:14', '2005-07-30T08:50:14', '2'), - ('207', '4491', '2006-02-16T02:30:53', '2005-07-10T22:30:05', '2005-07-14T00:02:05', '2'), - ('73', '20', '2006-02-16T02:30:53', '2005-07-08T16:22:01', '2005-07-15T18:29:01', '2'), - ('282', '2332', '2006-02-16T02:30:53', '2005-07-31T06:00:52', '2005-08-09T04:47:52', '2'), - ('578', '150', '2006-02-16T02:30:53', '2005-07-08T01:44:19', '2005-07-08T20:34:19', '2'), - ('101', '853', '2006-02-16T02:30:53', '2005-08-22T12:01:06', '2005-08-25T14:40:06', '2'), - ('262', '1440', '2006-02-16T02:30:53', '2005-07-06T01:00:11', '2005-07-11T19:15:11', '2'), - ('356', '3295', '2006-02-16T02:30:53', '2005-08-02T00:02:06', '2005-08-02T21:55:06', '2'), - ('29', '1304', '2006-02-16T02:30:53', '2005-08-19T13:50:36', '2005-08-26T12:34:36', '2'), - ('15', '3488', '2006-02-16T02:30:53', '2005-08-21T23:53:35', '2005-08-24T02:00:35', '2'), - ('494', '1828', '2006-02-16T02:30:53', '2005-08-22T01:43:29', '2005-08-29T07:19:29', '2'), - ('6', '3804', '2006-02-16T02:30:53', '2005-07-12T12:18:38', '2005-07-13T17:56:38', '2'), - ('552', '3386', '2006-02-16T02:30:53', '2005-08-19T03:27:17', '2005-08-28T06:16:17', '2'), - ('502', '1997', '2006-02-16T02:30:53', '2005-07-28T16:20:26', '2005-08-04T19:11:26', '2'), - ('331', '1089', '2006-02-16T02:30:53', '2005-08-02T06:26:19', '2005-08-06T04:20:19', '2'), - ('532', '147', '2006-02-16T02:30:53', '2005-06-16T12:40:23', '2005-06-20T09:18:23', '2'), - ('394', '1891', '2006-02-16T02:30:53', '2005-08-18T08:48:36', '2005-08-22T08:59:36', '2'), - ('98', '4004', '2006-02-16T02:30:53', '2005-08-23T03:58:28', '2005-08-31T03:28:28', '2'), - ('198', '4417', '2006-02-16T02:30:53', '2005-05-27T06:37:15', '2005-05-30T07:04:15', '2'), - ('451', '993', '2006-02-16T02:30:53', '2005-08-02T18:19:29', '2005-08-08T20:39:29', '2'), - ('210', '3893', '2006-02-16T02:30:53', '2005-07-29T18:32:47', '2005-08-02T13:05:47', '2'), - ('53', '2346', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('220', '4486', '2006-02-16T02:30:53', '2005-08-23T10:32:52', '2005-08-24T07:03:52', '2'), - ('205', '3117', '2006-02-16T02:30:53', '2005-08-21T10:16:27', '2005-08-23T07:00:27', '2'), - ('352', '2791', '2006-02-16T02:30:53', '2005-08-18T22:33:22', '2005-08-20T20:28:22', '2'), - ('577', '1734', '2006-02-16T02:30:53', '2005-08-18T19:19:59', '2005-08-23T17:53:59', '2'), - ('186', '3012', '2006-02-16T02:30:53', '2005-06-20T00:47:18', '2005-06-25T18:54:18', '2'), - ('476', '1231', '2006-02-16T02:30:53', '2005-06-17T16:59:40', '2005-06-21T11:28:40', '2'), - ('165', '86', '2006-02-16T02:30:53', '2005-07-10T20:22:12', '2005-07-19T16:43:12', '2'), - ('189', '1911', '2006-02-16T02:30:53', '2005-06-16T01:15:59', '2005-06-22T21:26:59', '2'), - ('3', '3917', '2006-02-16T02:30:53', '2005-06-19T08:34:53', '2005-06-28T04:19:53', '2'), - ('407', '2305', '2006-02-16T02:30:53', '2005-07-09T04:58:26', '2005-07-09T23:00:26', '2'), - ('83', '215', '2006-02-16T02:30:53', '2005-06-21T02:23:16', '2005-06-22T01:37:16', '2'), - ('78', '1982', '2006-02-16T02:30:53', '2005-08-22T01:08:34', '2005-08-25T07:00:34', '2'), - ('213', '4469', '2006-02-16T02:30:53', '2005-06-18T23:44:08', '2005-06-20T01:36:08', '2'), - ('390', '3914', '2006-02-16T02:30:53', '2005-07-07T01:50:06', '2005-07-09T21:47:06', '2'), - ('279', '2553', '2006-02-16T02:30:53', '2005-06-15T00:36:40', '2005-06-21T00:27:40', '2'), - ('32', '4454', '2006-02-16T02:30:53', '2005-08-18T09:50:40', '2005-08-26T06:45:40', '2'), - ('60', '3534', '2006-02-16T02:30:53', '2005-08-22T11:39:03', '2005-08-23T06:16:03', '2'), - ('63', '1687', '2006-02-16T02:30:53', '2005-07-12T15:48:54', '2005-07-21T14:39:54', '2'), - ('554', '4021', '2006-02-16T02:30:53', '2005-08-17T14:14:39', '2005-08-18T17:20:39', '2'), - ('52', '3360', '2006-02-16T02:30:53', '2005-08-01T14:12:29', '2005-08-04T08:46:29', '2'), - ('470', '4228', '2006-02-16T02:30:53', '2005-07-06T16:34:00', '2005-07-08T15:12:00', '2'), - ('134', '312', '2006-02-16T02:30:53', '2005-08-02T14:39:46', '2005-08-05T10:19:46', '2'), - ('149', '2645', '2006-02-16T02:30:53', '2005-07-11T20:57:48', '2005-07-12T22:40:48', '2'), - ('598', '1265', '2006-02-16T02:30:53', '2005-08-02T17:22:59', '2005-08-09T19:56:59', '2'), - ('172', '1385', '2006-02-16T02:30:53', '2005-05-29T00:17:51', '2005-06-05T05:32:51', '2'), - ('540', '2900', '2006-02-16T02:30:53', '2005-08-02T16:31:17', '2005-08-08T15:38:17', '2'), - ('234', '4517', '2006-02-16T02:30:53', '2005-08-22T09:36:33', '2005-08-31T11:20:33', '2'), - ('259', '622', '2006-02-16T02:30:53', '2005-05-31T20:37:52', '2005-06-06T19:23:52', '2'), - ('181', '804', '2006-02-16T02:30:53', '2005-07-12T01:38:42', '2005-07-17T05:19:42', '2'), - ('490', '1896', '2006-02-16T02:30:53', '2005-07-12T21:01:11', '2005-07-17T21:49:11', '2'), - ('391', '1067', '2006-02-16T02:30:53', '2005-08-20T19:04:40', '2005-08-21T18:36:40', '2'), - ('425', '3543', '2006-02-16T02:30:53', '2005-07-08T19:49:17', '2005-07-15T23:14:17', '2'), - ('247', '2444', '2006-02-16T02:30:53', '2005-07-09T16:48:29', '2005-07-17T20:20:29', '2'), - ('590', '3086', '2006-02-16T02:30:53', '2005-06-20T04:01:04', '2005-06-27T22:40:04', '2'), - ('498', '4272', '2006-02-16T02:30:53', '2005-07-29T00:09:08', '2005-07-31T19:29:08', '2'), - ('265', '51', '2006-02-16T02:30:53', '2005-06-19T03:15:05', '2005-06-21T08:26:05', '2'), - ('9', '2312', '2006-02-16T02:30:53', '2005-08-21T13:53:59', '2005-08-30T15:45:59', '2'), - ('382', '3209', '2006-02-16T02:30:53', '2005-08-23T18:44:21', '2005-09-01T17:25:21', '2'), - ('577', '538', '2006-02-16T02:30:53', '2005-08-02T21:42:07', '2005-08-03T21:44:07', '2'), - ('448', '822', '2006-02-16T02:30:53', '2005-08-22T21:29:14', '2005-08-31T00:10:14', '2'), - ('390', '3503', '2006-02-16T02:30:53', '2005-08-20T15:52:52', '2005-08-27T16:21:52', '2'), - ('560', '1345', '2006-02-16T02:30:53', '2005-07-29T19:15:50', '2005-07-31T19:13:50', '2'), - ('36', '2588', '2006-02-16T02:30:53', '2005-08-17T04:00:01', '2005-08-20T23:03:01', '2'), - ('266', '4527', '2006-02-16T02:30:53', '2005-08-01T19:59:41', '2005-08-10T00:00:41', '2'), - ('3', '579', '2006-02-16T02:30:53', '2005-07-27T20:23:12', '2005-08-05T18:46:12', '2'), - ('337', '1899', '2006-02-16T02:30:53', '2005-05-28T10:30:13', '2005-06-02T05:04:13', '2'), - ('204', '157', '2006-02-16T02:30:53', '2005-07-30T05:04:58', '2005-08-03T07:41:58', '2'), - ('109', '1344', '2006-02-16T02:30:53', '2005-06-20T15:01:19', '2005-06-28T16:53:19', '2'), - ('123', '1922', '2006-02-16T02:30:53', '2005-06-16T18:28:19', '2005-06-25T13:09:19', '2'), - ('575', '2579', '2006-02-16T02:30:53', '2005-06-17T01:53:19', '2005-06-19T06:14:19', '2'), - ('103', '1185', '2006-02-16T02:30:53', '2005-08-21T06:58:49', '2005-08-25T11:29:49', '2'), - ('556', '4093', '2006-02-16T02:30:53', '2005-07-12T02:04:10', '2005-07-17T23:18:10', '2'), - ('532', '3553', '2006-02-16T02:30:53', '2005-07-10T15:08:41', '2005-07-19T16:35:41', '2'), - ('278', '1817', '2006-02-16T02:30:53', '2005-08-17T00:30:04', '2005-08-20T01:12:04', '2'), - ('78', '375', '2006-02-16T02:30:53', '2005-06-20T06:05:53', '2005-06-29T03:19:53', '2'), - ('394', '2866', '2006-02-16T02:30:53', '2005-07-09T10:13:45', '2005-07-16T15:55:45', '2'), - ('338', '1589', '2006-02-16T02:30:53', '2005-08-21T18:10:03', '2005-08-23T13:40:03', '2'), - ('84', '3398', '2006-02-16T02:30:53', '2005-08-18T07:55:09', '2005-08-19T05:29:09', '2'), - ('80', '2153', '2006-02-16T02:30:53', '2005-06-19T19:29:17', '2005-06-27T23:14:17', '2'), - ('414', '1047', '2006-02-16T02:30:53', '2005-08-19T09:06:08', '2005-08-22T13:46:08', '2'), - ('543', '228', '2006-02-16T02:30:53', '2005-07-27T13:03:14', '2005-07-31T07:56:14', '2'), - ('316', '4217', '2006-02-16T02:30:53', '2005-08-01T08:53:04', '2005-08-09T06:39:04', '2'), - ('588', '740', '2006-02-16T02:30:53', '2005-06-17T03:35:59', '2005-06-21T05:57:59', '2'), - ('91', '3498', '2006-02-16T02:30:53', '2005-07-30T00:14:32', '2005-08-04T20:42:32', '2'), - ('182', '2760', '2006-02-16T02:30:53', '2005-08-17T10:54:46', '2005-08-23T14:15:46', '2'), - ('503', '1049', '2006-02-16T02:30:53', '2005-08-20T04:00:30', '2005-08-21T06:26:30', '2'), - ('563', '1172', '2006-02-16T02:30:53', '2005-07-29T21:47:40', '2005-08-04T01:18:40', '2'), - ('5', '600', '2006-02-16T02:30:53', '2005-07-06T09:11:58', '2005-07-08T10:50:58', '2'), - ('241', '487', '2006-02-16T02:30:53', '2005-07-09T21:34:32', '2005-07-16T02:21:32', '2'), - ('6', '375', '2006-02-16T02:30:53', '2005-05-28T11:09:14', '2005-06-01T13:27:14', '2'), - ('358', '1540', '2006-02-16T02:30:53', '2005-06-19T16:27:35', '2005-06-25T21:06:35', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['5157', '9034', '8965', '10599', '8323', '11549', '3471', '9413', '9298', '2672', '15676', '13055', '7939', '7085', '14569', '9900', '8107', '15751', '8551', '13992', '3174', '14805', '5184', '11957', '918', '11131', '1360', '11036', '4799', '3806', '10739', '7412', '5612', '13449', '12689', '7355', '13852', '1640', '5213', '9086', '11611', '2254', '3303', '2738', '589', '1875', '9627', '12928', '15915', '7545', '5949', '4249', '15999', '12722', '7227', '8727', '4660', '13209', '6361', '6790', '5782', '11658', '88', '14634', '8497', '9423', '10352', '510', '9461', '7452', '2770', '7423', '8568', '2463', '5657', '13872', '5584', '210', '11984', '13462', '425', '13362', '12165', '2001', '9790', '7151', '13135', '7377', '6339', '8426', '15722', '3231', '9246', '12650', '15290', '13182', '11501', '5513', '14342', '13291']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('463', '637', '2006-02-16T02:30:53', '2005-07-09T08:52:12', '2005-07-12T04:32:12', '2'), - ('144', '3847', '2006-02-16T02:30:53', '2005-07-30T06:10:58', '2005-08-08T05:00:58', '2'), - ('599', '2419', '2006-02-16T02:30:53', '2005-07-30T03:52:37', '2005-08-05T01:28:37', '2'), - ('271', '2422', '2006-02-16T02:30:53', '2005-08-01T14:23:58', '2005-08-06T10:45:58', '2'), - ('87', '2766', '2006-02-16T02:30:53', '2005-07-29T03:52:59', '2005-08-06T01:49:59', '2'), - ('402', '945', '2006-02-16T02:30:53', '2005-08-17T01:01:48', '2005-08-19T21:24:48', '2'), - ('242', '1724', '2006-02-16T02:30:53', '2005-07-05T22:51:44', '2005-07-13T01:38:44', '2'), - ('290', '2618', '2006-02-16T02:30:53', '2005-07-30T20:44:39', '2005-08-01T01:56:39', '2'), - ('208', '2106', '2006-02-16T02:30:53', '2005-07-30T16:27:53', '2005-08-07T12:32:53', '2'), - ('420', '1164', '2006-02-16T02:30:53', '2005-06-19T11:42:04', '2005-06-25T09:14:04', '2'), - ('353', '3874', '2006-02-16T02:30:53', '2005-08-23T09:23:08', '2005-08-30T06:19:08', '2'), - ('485', '3580', '2006-02-16T02:30:53', '2005-08-19T09:36:28', '2005-08-24T05:53:28', '2'), - ('37', '2004', '2006-02-16T02:30:53', '2005-07-28T12:45:47', '2005-07-30T18:32:47', '2'), - ('223', '2603', '2006-02-16T02:30:53', '2005-07-27T04:35:44', '2005-08-05T07:10:44', '2'), - ('15', '884', '2006-02-16T02:30:53', '2005-08-21T16:31:22', '2005-08-25T21:27:22', '2'), - ('453', '3132', '2006-02-16T02:30:53', '2005-07-31T14:15:05', '2005-08-07T11:58:05', '2'), - ('518', '1318', '2006-02-16T02:30:53', '2005-07-28T19:03:16', '2005-08-05T17:18:16', '2'), - ('199', '697', '2006-02-16T02:30:53', '2005-08-23T12:41:07', '2005-08-29T07:03:07', '2'), - ('340', '2083', '2006-02-16T02:30:53', '2005-07-29T11:13:11', '2005-08-05T05:17:11', '2'), - ('136', '2798', '2006-02-16T02:30:53', '2005-08-20T19:30:35', '2005-08-24T19:09:35', '2'), - ('107', '3331', '2006-02-16T02:30:53', '2005-06-20T22:24:00', '2005-06-22T21:22:00', '2'), - ('169', '783', '2006-02-16T02:30:53', '2005-08-22T00:52:01', '2005-08-23T03:28:01', '2'), - ('166', '1101', '2006-02-16T02:30:53', '2005-07-09T10:14:34', '2005-07-14T16:05:34', '2'), - ('198', '1924', '2006-02-16T02:30:53', '2005-08-17T17:22:29', '2005-08-23T21:47:29', '2'), - ('197', '818', '2006-02-16T02:30:53', '2005-05-30T11:32:24', '2005-05-31T07:55:24', '2'), - ('293', '1860', '2006-02-16T02:30:53', '2005-08-02T09:10:04', '2005-08-08T09:59:04', '2'), - ('14', '4107', '2006-02-16T02:30:53', '2005-06-15T13:32:15', '2005-06-18T10:59:15', '2'), - ('502', '2054', '2006-02-16T02:30:53', '2005-08-02T05:56:29', '2005-08-05T05:00:29', '2'), - ('512', '4112', '2006-02-16T02:30:53', '2005-07-08T16:49:27', '2005-07-12T19:58:27', '2'), - ('154', '3555', '2006-02-16T02:30:53', '2005-07-06T15:09:41', '2005-07-14T09:14:41', '2'), - ('197', '3160', '2006-02-16T02:30:53', '2005-08-01T19:46:11', '2005-08-06T21:08:11', '2'), - ('582', '950', '2006-02-16T02:30:53', '2005-07-27T16:44:34', '2005-08-04T15:06:34', '2'), - ('472', '2363', '2006-02-16T02:30:53', '2005-07-10T05:15:12', '2005-07-17T09:50:12', '2'), - ('400', '1297', '2006-02-16T02:30:53', '2005-08-20T00:17:01', '2005-08-23T20:42:01', '2'), - ('296', '1066', '2006-02-16T02:30:53', '2005-08-18T20:06:34', '2005-08-22T20:11:34', '2'), - ('115', '3803', '2006-02-16T02:30:53', '2005-07-27T14:45:59', '2005-08-02T17:23:59', '2'), - ('535', '85', '2006-02-16T02:30:53', '2005-08-20T14:45:23', '2005-08-22T16:47:23', '2'), - ('86', '443', '2006-02-16T02:30:53', '2005-06-16T08:35:39', '2005-06-17T05:37:39', '2'), - ('552', '3708', '2006-02-16T02:30:53', '2005-07-09T11:39:43', '2005-07-18T16:20:43', '2'), - ('57', '2779', '2006-02-16T02:30:53', '2005-07-30T08:18:46', '2005-08-06T06:10:46', '2'), - ('192', '1857', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('281', '1084', '2006-02-16T02:30:53', '2005-06-18T05:15:14', '2005-06-27T04:10:14', '2'), - ('361', '1565', '2006-02-16T02:30:53', '2005-06-21T07:34:14', '2005-06-26T13:18:14', '2'), - ('75', '350', '2006-02-16T02:30:53', '2005-06-19T15:56:30', '2005-06-20T16:14:30', '2'), - ('308', '4231', '2006-02-16T02:30:53', '2005-05-28T12:27:50', '2005-06-03T07:15:50', '2'), - ('528', '1652', '2006-02-16T02:30:53', '2005-06-17T02:45:10', '2005-06-22T22:54:10', '2'), - ('12', '471', '2006-02-16T02:30:53', '2005-07-31T04:42:46', '2005-08-08T00:42:46', '2'), - ('353', '4531', '2006-02-16T02:30:53', '2005-08-19T05:04:09', '2005-08-24T09:09:09', '2'), - ('167', '3566', '2006-02-16T02:30:53', '2005-08-23T17:52:01', '2005-08-24T20:40:01', '2'), - ('292', '2541', '2006-02-16T02:30:53', '2005-07-27T21:48:03', '2005-08-01T22:23:03', '2'), - ('496', '4397', '2006-02-16T02:30:53', '2005-07-10T23:13:00', '2005-07-14T01:10:00', '2'), - ('111', '4185', '2006-02-16T02:30:53', '2005-07-07T14:05:17', '2005-07-10T09:21:17', '2'), - ('377', '2584', '2006-02-16T02:30:53', '2005-08-23T20:44:10', '2005-08-31T02:38:10', '2'), - ('416', '913', '2006-02-16T02:30:53', '2005-08-18T21:33:53', '2005-08-27T23:47:53', '2'), - ('164', '791', '2006-02-16T02:30:53', '2005-07-27T09:53:43', '2005-08-05T09:36:43', '2'), - ('528', '3031', '2006-02-16T02:30:53', '2005-07-29T18:09:57', '2005-08-03T13:41:57', '2'), - ('139', '1208', '2006-02-16T02:30:53', '2005-07-08T09:54:47', '2005-07-11T15:19:47', '2'), - ('5', '1574', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('561', '2903', '2006-02-16T02:30:53', '2005-07-11T21:09:14', '2005-07-14T18:26:14', '2'), - ('400', '4486', '2006-02-16T02:30:53', '2005-07-12T16:34:59', '2005-07-17T21:43:59', '2'), - ('440', '2514', '2006-02-16T02:30:53', '2005-07-10T13:52:56', '2005-07-15T09:32:56', '2'), - ('422', '2008', '2006-02-16T02:30:53', '2005-08-17T05:19:17', '2005-08-24T07:03:17', '2'), - ('53', '2221', '2006-02-16T02:30:53', '2005-05-25T14:13:54', '2005-05-29T09:32:54', '2'), - ('494', '486', '2006-02-16T02:30:53', '2005-08-21T18:51:28', '2005-08-29T19:30:28', '2'), - ('593', '1837', '2006-02-16T02:30:53', '2005-07-29T09:07:03', '2005-08-02T09:18:03', '2'), - ('242', '3145', '2006-02-16T02:30:53', '2005-07-30T21:10:14', '2005-08-07T16:34:14', '2'), - ('564', '1288', '2006-02-16T02:30:53', '2005-08-01T05:44:36', '2005-08-05T07:15:36', '2'), - ('113', '4338', '2006-02-16T02:30:53', '2005-05-28T02:52:14', '2005-05-30T21:20:14', '2'), - ('377', '1679', '2006-02-16T02:30:53', '2005-07-30T22:29:13', '2005-08-05T20:55:13', '2'), - ('285', '3482', '2006-02-16T02:30:53', '2005-07-27T18:26:39', '2005-08-04T17:35:39', '2'), - ('533', '3042', '2006-02-16T02:30:53', '2005-06-19T17:54:22', '2005-06-26T23:09:22', '2'), - ('277', '666', '2006-02-16T02:30:53', '2005-07-27T17:11:47', '2005-07-29T12:29:47', '2'), - ('583', '1599', '2006-02-16T02:30:53', '2005-07-29T11:38:22', '2005-08-04T13:22:22', '2'), - ('194', '1186', '2006-02-16T02:30:53', '2005-06-18T20:01:43', '2005-06-25T15:04:43', '2'), - ('508', '4342', '2006-02-16T02:30:53', '2005-07-10T07:33:43', '2005-07-18T01:55:43', '2'), - ('421', '2416', '2006-02-16T02:30:53', '2005-08-20T15:10:30', '2005-08-24T10:14:30', '2'), - ('289', '2606', '2006-02-16T02:30:53', '2005-07-10T04:15:25', '2005-07-16T22:54:25', '2'), - ('391', '1801', '2006-02-16T02:30:53', '2005-05-26T08:14:15', '2005-05-27T12:12:15', '2'), - ('96', '3577', '2006-02-16T02:30:53', '2005-08-17T18:16:30', '2005-08-24T21:09:30', '2'), - ('489', '3865', '2006-02-16T02:30:53', '2005-08-20T00:49:19', '2005-08-26T06:21:19', '2'), - ('182', '1518', '2006-02-16T02:30:53', '2005-05-27T15:51:30', '2005-06-03T16:52:30', '2'), - ('565', '869', '2006-02-16T02:30:53', '2005-08-19T21:07:54', '2005-08-20T17:29:54', '2'), - ('24', '4215', '2006-02-16T02:30:53', '2005-08-18T00:53:37', '2005-08-27T00:09:37', '2'), - ('260', '2069', '2006-02-16T02:30:53', '2005-06-17T11:35:09', '2005-06-21T14:52:09', '2'), - ('284', '3643', '2006-02-16T02:30:53', '2005-07-31T10:34:08', '2005-08-04T11:19:08', '2'), - ('289', '1259', '2006-02-16T02:30:53', '2005-07-27T07:14:31', '2005-08-01T01:35:31', '2'), - ('361', '1585', '2006-02-16T02:30:53', '2005-08-19T12:22:52', '2005-08-21T14:04:52', '2'), - ('588', '1369', '2006-02-16T02:30:53', '2005-07-27T15:31:28', '2005-08-02T19:59:28', '2'), - ('145', '2401', '2006-02-16T02:30:53', '2005-07-11T19:45:32', '2005-07-18T22:34:32', '2'), - ('564', '1840', '2006-02-16T02:30:53', '2005-07-29T07:07:48', '2005-08-07T08:56:48', '2'), - ('26', '2809', '2006-02-16T02:30:53', '2005-08-23T11:16:29', '2005-09-01T13:24:29', '2'), - ('28', '237', '2006-02-16T02:30:53', '2005-06-21T02:25:00', '2005-06-23T05:46:00', '2'), - ('185', '3390', '2006-02-16T02:30:53', '2005-07-30T14:12:31', '2005-08-02T14:25:31', '2'), - ('276', '3237', '2006-02-16T02:30:53', '2005-08-18T18:33:20', '2005-08-21T17:45:20', '2'), - ('404', '270', '2006-02-16T02:30:53', '2005-08-22T19:28:02', '2005-08-31T20:04:02', '2'), - ('496', '364', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('23', '2147', '2006-02-16T02:30:53', '2005-08-16T23:04:53', '2005-08-19T20:57:53', '2'), - ('356', '2558', '2006-02-16T02:30:53', '2005-07-10T01:05:41', '2005-07-11T02:05:41', '2'), - ('559', '2749', '2006-02-16T02:30:53', '2005-08-21T08:39:26', '2005-08-23T11:40:26', '2'), - ('243', '1631', '2006-02-16T02:30:53', '2005-08-19T18:32:11', '2005-08-20T18:22:11', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['5422', '7502', '6404', '5541', '4501', '2719', '15216', '4918', '9342', '10698', '1064', '8915', '3003', '7953', '11302', '8062', '4091', '3973', '9451', '12056', '10190', '9221', '5816', '6101', '11646', '14038', '8834', '11757', '3156', '5204', '7481', '5368', '4651', '3293', '9965', '658', '3404', '9829', '6623', '9358', '2161', '7998', '12900', '1753', '3528', '5627', '1394', '5686', '7036', '6066', '6653', '11572', '3635', '10566', '2703', '5044', '15965', '4428', '9065', '14432', '14572', '12129', '8504', '541', '945', '9258', '4987', '3714', '3411', '13880', '7999', '3557', '15944', '8220', '9959', '15095', '14641', '14005', '14652', '3453', '4933', '5346', '15727', '174', '8906', '11348', '2067', '4478', '3563', '11420', '8134', '11451', '8061', '6754', '14765', '606', '2300', '8944', '6593', '9063']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('409', '436', '2006-02-16T02:30:53', '2005-07-09T20:55:47', '2005-07-15T15:15:47', '2'), - ('303', '3229', '2006-02-16T02:30:53', '2005-07-27T20:19:08', '2005-07-28T18:32:08', '2'), - ('526', '1183', '2006-02-16T02:30:53', '2005-07-11T22:49:50', '2005-07-14T18:29:50', '2'), - ('135', '1211', '2006-02-16T02:30:53', '2005-07-10T02:44:27', '2005-07-13T04:13:27', '2'), - ('262', '1412', '2006-02-16T02:30:53', '2005-07-08T02:12:00', '2005-07-10T02:16:00', '2'), - ('336', '1200', '2006-02-16T02:30:53', '2005-06-19T14:50:19', '2005-06-20T14:33:19', '2'), - ('166', '1633', '2006-02-16T02:30:53', '2005-08-22T16:57:02', '2005-08-24T16:11:02', '2'), - ('220', '3819', '2006-02-16T02:30:53', '2005-07-08T21:37:31', '2005-07-11T20:16:31', '2'), - ('552', '2318', '2006-02-16T02:30:53', '2005-07-30T18:09:56', '2005-08-08T13:54:56', '2'), - ('135', '2738', '2006-02-16T02:30:53', '2005-08-01T18:24:41', '2005-08-08T18:59:41', '2'), - ('460', '2373', '2006-02-16T02:30:53', '2005-05-31T08:50:07', '2005-06-02T14:47:07', '2'), - ('42', '3030', '2006-02-16T02:30:53', '2005-07-30T01:42:09', '2005-08-04T23:29:09', '2'), - ('38', '616', '2006-02-16T02:30:53', '2005-06-20T10:00:51', '2005-06-22T06:28:51', '2'), - ('319', '4471', '2006-02-16T02:30:53', '2005-07-28T13:24:32', '2005-08-05T16:09:32', '2'), - ('51', '1918', '2006-02-16T02:30:53', '2005-08-02T15:38:03', '2005-08-09T10:33:03', '2'), - ('317', '1384', '2006-02-16T02:30:53', '2005-07-28T17:15:06', '2005-07-30T16:56:06', '2'), - ('337', '3928', '2006-02-16T02:30:53', '2005-07-07T05:53:38', '2005-07-14T03:12:38', '2'), - ('592', '2625', '2006-02-16T02:30:53', '2005-07-06T22:58:31', '2005-07-16T03:27:31', '2'), - ('584', '685', '2006-02-16T02:30:53', '2005-07-30T22:10:17', '2005-08-07T02:53:17', '2'), - ('460', '1091', '2006-02-16T02:30:53', '2005-08-17T21:03:48', '2005-08-21T22:42:48', '2'), - ('138', '4411', '2006-02-16T02:30:53', '2005-08-01T00:27:53', '2005-08-01T20:32:53', '2'), - ('113', '2496', '2006-02-16T02:30:53', '2005-07-30T13:20:06', '2005-08-06T13:58:06', '2'), - ('382', '1746', '2006-02-16T02:30:53', '2005-07-10T15:48:47', '2005-07-13T11:51:47', '2'), - ('508', '2618', '2006-02-16T02:30:53', '2005-07-11T06:50:33', '2005-07-18T01:52:33', '2'), - ('11', '478', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('589', '1069', '2006-02-16T02:30:53', '2005-08-20T21:39:23', '2005-08-27T23:57:23', '2'), - ('243', '4477', '2006-02-16T02:30:53', '2005-07-29T22:41:48', '2005-08-05T03:21:48', '2'), - ('550', '1295', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('365', '2217', '2006-02-16T02:30:53', '2005-06-20T21:03:46', '2005-06-21T23:32:46', '2'), - ('432', '1791', '2006-02-16T02:30:53', '2005-07-09T10:54:14', '2005-07-12T14:29:14', '2'), - ('240', '1804', '2006-02-16T02:30:53', '2005-07-27T19:20:25', '2005-07-29T19:07:25', '2'), - ('502', '4429', '2006-02-16T02:30:53', '2005-07-09T18:41:59', '2005-07-16T00:32:59', '2'), - ('557', '4064', '2006-02-16T02:30:53', '2005-07-08T09:39:39', '2005-07-09T12:14:39', '2'), - ('481', '4407', '2006-02-16T02:30:53', '2005-06-21T06:59:33', '2005-06-25T06:54:33', '2'), - ('101', '3946', '2006-02-16T02:30:53', '2005-07-31T16:19:32', '2005-08-05T20:18:32', '2'), - ('103', '3226', '2006-02-16T02:30:53', '2005-05-28T20:23:23', '2005-06-06T19:31:23', '2'), - ('424', '2005', '2006-02-16T02:30:53', '2005-06-21T15:57:52', '2005-06-24T20:58:52', '2'), - ('435', '231', '2006-02-16T02:30:53', '2005-07-31T11:58:38', '2005-08-07T08:11:38', '2'), - ('302', '4412', '2006-02-16T02:30:53', '2005-07-12T09:05:34', '2005-07-19T13:54:34', '2'), - ('302', '712', '2006-02-16T02:30:53', '2005-07-30T18:37:24', '2005-08-07T23:34:24', '2'), - ('75', '3149', '2006-02-16T02:30:53', '2005-06-17T23:39:50', '2005-06-26T23:28:50', '2'), - ('598', '1397', '2006-02-16T02:30:53', '2005-07-28T15:08:48', '2005-07-31T16:14:48', '2'), - ('408', '849', '2006-02-16T02:30:53', '2005-08-19T04:03:49', '2005-08-24T22:11:49', '2'), - ('249', '3817', '2006-02-16T02:30:53', '2005-06-16T17:08:17', '2005-06-21T21:47:17', '2'), - ('201', '1954', '2006-02-16T02:30:53', '2005-07-06T01:13:27', '2005-07-06T23:45:27', '2'), - ('136', '244', '2006-02-16T02:30:53', '2005-07-10T05:51:12', '2005-07-17T09:56:12', '2'), - ('268', '2802', '2006-02-16T02:30:53', '2005-06-15T16:17:21', '2005-06-21T20:44:21', '2'), - ('521', '717', '2006-02-16T02:30:53', '2005-07-10T09:06:03', '2005-07-11T10:59:03', '2'), - ('70', '2569', '2006-02-16T02:30:53', '2005-07-27T03:06:12', '2005-07-28T23:26:12', '2'), - ('155', '1877', '2006-02-16T02:30:53', '2005-07-11T04:32:42', '2005-07-15T03:56:42', '2'), - ('25', '614', '2006-02-16T02:30:53', '2005-07-12T11:06:17', '2005-07-19T16:52:17', '2'), - ('515', '3512', '2006-02-16T02:30:53', '2005-08-17T01:37:55', '2005-08-19T06:22:55', '2'), - ('250', '421', '2006-02-16T02:30:53', '2005-07-06T06:55:36', '2005-07-09T07:57:36', '2'), - ('269', '3988', '2006-02-16T02:30:53', '2005-08-01T13:12:11', '2005-08-05T11:16:11', '2'), - ('319', '4080', '2006-02-16T02:30:53', '2005-06-19T13:36:06', '2005-06-28T08:26:06', '2'), - ('147', '1625', '2006-02-16T02:30:53', '2005-07-09T03:30:25', '2005-07-11T02:32:25', '2'), - ('509', '3449', '2006-02-16T02:30:53', '2005-08-23T19:46:39', '2005-08-24T20:08:39', '2'), - ('181', '2575', '2006-02-16T02:30:53', '2005-07-07T22:29:40', '2005-07-11T02:46:40', '2'), - ('238', '349', '2006-02-16T02:30:53', '2005-07-30T07:25:09', '2005-07-31T05:18:09', '2'), - ('138', '2294', '2006-02-16T02:30:53', '2005-08-21T11:36:15', '2005-08-24T08:02:15', '2'), - ('538', '1397', '2006-02-16T02:30:53', '2005-08-21T16:44:31', '2005-08-26T16:35:31', '2'), - ('146', '891', '2006-02-16T02:30:53', '2005-08-17T23:31:25', '2005-08-26T19:10:25', '2'), - ('561', '2295', '2006-02-16T02:30:53', '2005-07-29T09:20:16', '2005-08-07T04:27:16', '2'), - ('535', '1662', '2006-02-16T02:30:53', '2005-05-28T06:41:58', '2005-06-02T09:12:58', '2'), - ('357', '1441', '2006-02-16T02:30:53', '2005-05-30T15:33:17', '2005-06-02T15:02:17', '2'), - ('275', '2007', '2006-02-16T02:30:53', '2005-07-30T14:31:31', '2005-08-05T16:29:31', '2'), - ('277', '996', '2006-02-16T02:30:53', '2005-07-09T00:45:41', '2005-07-14T03:32:41', '2'), - ('276', '1985', '2006-02-16T02:30:53', '2005-07-06T10:51:28', '2005-07-09T13:57:28', '2'), - ('12', '4250', '2006-02-16T02:30:53', '2005-06-21T16:31:27', '2005-06-28T12:27:27', '2'), - ('268', '3911', '2006-02-16T02:30:53', '2005-08-20T15:18:20', '2005-08-24T18:03:20', '2'), - ('170', '2750', '2006-02-16T02:30:53', '2005-07-28T15:10:14', '2005-08-06T17:08:14', '2'), - ('292', '3832', '2006-02-16T02:30:53', '2005-07-06T02:48:39', '2005-07-08T22:52:39', '2'), - ('348', '4559', '2006-02-16T02:30:53', '2005-08-23T18:50:54', '2005-08-25T18:04:54', '2'), - ('360', '1061', '2006-02-16T02:30:53', '2005-07-28T23:46:41', '2005-07-31T22:14:41', '2'), - ('199', '340', '2006-02-16T02:30:53', '2005-07-31T16:04:22', '2005-08-03T21:51:22', '2'), - ('202', '489', '2006-02-16T02:30:53', '2005-08-22T11:41:35', '2005-08-25T16:44:35', '2'), - ('147', '2205', '2006-02-16T02:30:53', '2005-08-21T19:05:23', '2005-08-22T22:30:23', '2'), - ('135', '1415', '2006-02-16T02:30:53', '2005-08-20T20:19:05', '2005-08-26T01:42:05', '2'), - ('453', '4163', '2006-02-16T02:30:53', '2005-08-21T19:32:05', '2005-08-23T23:33:05', '2'), - ('278', '842', '2006-02-16T02:30:53', '2005-06-21T21:12:11', '2005-06-23T17:39:11', '2'), - ('579', '322', '2006-02-16T02:30:53', '2005-07-08T22:18:29', '2005-07-13T03:47:29', '2'), - ('287', '2488', '2006-02-16T02:30:53', '2005-07-09T17:29:01', '2005-07-14T12:47:01', '2'), - ('416', '2184', '2006-02-16T02:30:53', '2005-08-23T11:28:49', '2005-08-24T06:24:49', '2'), - ('552', '3954', '2006-02-16T02:30:53', '2005-05-26T03:44:10', '2005-05-28T07:13:10', '2'), - ('560', '2667', '2006-02-16T02:30:53', '2005-07-30T01:21:39', '2005-08-07T02:14:39', '2'), - ('389', '1704', '2006-02-16T02:30:53', '2005-08-02T17:18:38', '2005-08-06T16:11:38', '2'), - ('297', '1711', '2006-02-16T02:30:53', '2005-06-17T16:11:08', '2005-06-22T13:01:08', '2'), - ('357', '1764', '2006-02-16T02:30:53', '2005-07-08T00:39:08', '2005-07-11T21:57:08', '2'), - ('210', '4261', '2006-02-16T02:30:53', '2005-07-06T02:57:01', '2005-07-14T02:25:01', '2'), - ('158', '3928', '2006-02-16T02:30:53', '2005-08-02T19:47:56', '2005-08-05T21:48:56', '2'), - ('41', '1695', '2006-02-16T02:30:53', '2005-07-28T20:01:23', '2005-08-03T01:00:23', '2'), - ('515', '776', '2006-02-16T02:30:53', '2005-08-02T20:45:56', '2005-08-06T21:42:56', '2'), - ('467', '650', '2006-02-16T02:30:53', '2005-07-28T17:12:53', '2005-08-05T13:56:53', '2'), - ('114', '1460', '2006-02-16T02:30:53', '2005-07-12T14:59:24', '2005-07-14T11:04:24', '2'), - ('435', '2817', '2006-02-16T02:30:53', '2005-08-21T23:40:28', '2005-08-25T04:55:28', '2'), - ('299', '3509', '2006-02-16T02:30:53', '2005-05-28T14:48:39', '2005-06-04T09:44:39', '2'), - ('291', '1617', '2006-02-16T02:30:53', '2005-06-18T08:22:34', '2005-06-24T04:51:34', '2'), - ('172', '3513', '2006-02-16T02:30:53', '2005-07-30T03:11:44', '2005-08-06T23:15:44', '2'), - ('356', '3441', '2006-02-16T02:30:53', '2005-07-12T07:21:17', '2005-07-14T02:35:17', '2'), - ('564', '2851', '2006-02-16T02:30:53', '2005-07-30T07:24:34', '2005-08-05T01:28:34', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['8408', '10093', '3654', '3301', '11068', '4906', '989', '1902', '11231', '7342', '14374', '7654', '10279', '7360', '7906', '10574', '2863', '10066', '258', '6445', '1086', '10826', '1588', '8754', '7432', '6249', '2582', '14961', '14916', '4615', '15557', '812', '15926', '12888', '8756', '5060', '11587', '13039', '10809', '12799', '15241', '8736', '6977', '13080', '9111', '12569', '15565', '15873', '9701', '6800', '9524', '977', '8697', '15062', '6194', '4374', '11631', '4747', '5781', '12951', '420', '6213', '1071', '9732', '13854', '557', '8369', '14874', '8384', '1267', '1381', '15480', '14174', '14187', '4975', '11251', '1099', '12554', '7544', '4278', '11951', '13056', '14019', '8865', '10486', '4349', '12642', '4315', '8400', '10656', '8600', '3116', '11376', '11818', '775', '6950', '4200', '7850', '1177', '9345']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('90', '1841', '2006-02-16T02:30:53', '2005-07-29T06:40:40', '2005-07-30T10:02:40', '2'), - ('162', '3943', '2006-02-16T02:30:53', '2005-07-31T20:30:32', '2005-08-04T00:04:32', '2'), - ('528', '1621', '2006-02-16T02:30:53', '2005-07-06T07:45:31', '2005-07-12T09:59:31', '2'), - ('444', '503', '2006-02-16T02:30:53', '2005-06-21T07:32:25', '2005-06-28T06:26:25', '2'), - ('52', '1262', '2006-02-16T02:30:53', '2005-08-02T07:08:07', '2005-08-09T11:15:07', '2'), - ('490', '1527', '2006-02-16T02:30:53', '2005-07-08T20:59:13', '2005-07-15T01:12:13', '2'), - ('83', '4388', '2006-02-16T02:30:53', '2005-05-30T23:11:51', '2005-06-03T20:36:51', '2'), - ('479', '2905', '2006-02-16T02:30:53', '2005-06-17T04:35:52', '2005-06-20T06:52:52', '2'), - ('90', '1100', '2006-02-16T02:30:53', '2005-08-02T13:02:11', '2005-08-07T10:05:11', '2'), - ('504', '4083', '2006-02-16T02:30:53', '2005-07-27T14:25:17', '2005-08-04T10:02:17', '2'), - ('213', '236', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('360', '1009', '2006-02-16T02:30:53', '2005-07-28T02:00:14', '2005-07-31T20:50:14', '2'), - ('247', '3794', '2006-02-16T02:30:53', '2005-08-01T03:26:44', '2005-08-07T22:35:44', '2'), - ('467', '1312', '2006-02-16T02:30:53', '2005-07-27T14:52:06', '2005-08-02T12:24:06', '2'), - ('85', '1216', '2006-02-16T02:30:53', '2005-07-28T11:31:42', '2005-08-01T11:56:42', '2'), - ('287', '679', '2006-02-16T02:30:53', '2005-08-01T13:36:51', '2005-08-10T13:25:51', '2'), - ('228', '2410', '2006-02-16T02:30:53', '2005-06-19T23:58:38', '2005-06-23T23:27:38', '2'), - ('123', '4285', '2006-02-16T02:30:53', '2005-07-31T19:30:01', '2005-08-01T14:45:01', '2'), - ('502', '3534', '2006-02-16T02:30:53', '2005-05-26T15:28:14', '2005-05-30T18:38:14', '2'), - ('385', '582', '2006-02-16T02:30:53', '2005-07-12T00:37:02', '2005-07-17T22:05:02', '2'), - ('549', '2909', '2006-02-16T02:30:53', '2005-05-31T11:17:37', '2005-06-06T13:58:37', '2'), - ('476', '1228', '2006-02-16T02:30:53', '2005-08-01T23:07:56', '2005-08-08T04:10:56', '2'), - ('322', '4472', '2006-02-16T02:30:53', '2005-06-16T04:53:21', '2005-06-25T07:29:21', '2'), - ('174', '1678', '2006-02-16T02:30:53', '2005-07-29T19:18:30', '2005-08-05T18:39:30', '2'), - ('132', '3169', '2006-02-16T02:30:53', '2005-07-27T17:31:40', '2005-07-28T17:44:40', '2'), - ('30', '4334', '2006-02-16T02:30:53', '2005-07-11T15:02:02', '2005-07-14T11:37:02', '2'), - ('267', '201', '2006-02-16T02:30:53', '2005-06-19T04:56:27', '2005-06-26T08:56:27', '2'), - ('52', '3274', '2006-02-16T02:30:53', '2005-08-22T06:35:50', '2005-08-31T04:07:50', '2'), - ('80', '2110', '2006-02-16T02:30:53', '2005-08-22T04:56:57', '2005-08-24T06:36:57', '2'), - ('404', '1200', '2006-02-16T02:30:53', '2005-07-08T07:46:53', '2005-07-16T12:43:53', '2'), - ('444', '3641', '2006-02-16T02:30:53', '2005-08-23T04:52:17', '2005-08-30T02:15:17', '2'), - ('225', '1099', '2006-02-16T02:30:53', '2005-05-29T20:00:30', '2005-05-30T19:43:30', '2'), - ('151', '2231', '2006-02-16T02:30:53', '2005-08-23T18:20:56', '2005-08-24T18:20:56', '2'), - ('146', '4398', '2006-02-16T02:30:53', '2005-08-19T03:41:09', '2005-08-24T07:09:09', '2'), - ('120', '4146', '2006-02-16T02:30:53', '2005-07-29T19:18:57', '2005-08-02T20:07:57', '2'), - ('57', '4317', '2006-02-16T02:30:53', '2005-07-09T04:28:03', '2005-07-12T07:41:03', '2'), - ('156', '1319', '2006-02-16T02:30:53', '2005-08-17T02:21:03', '2005-08-25T21:02:03', '2'), - ('370', '1952', '2006-02-16T02:30:53', '2005-08-19T08:55:19', '2005-08-20T07:39:19', '2'), - ('340', '1167', '2006-02-16T02:30:53', '2005-08-01T22:39:27', '2005-08-03T03:44:27', '2'), - ('197', '3885', '2006-02-16T02:30:53', '2005-08-19T00:27:01', '2005-08-22T03:30:01', '2'), - ('337', '832', '2006-02-16T02:30:53', '2005-08-22T17:47:40', '2005-08-29T15:28:40', '2'), - ('530', '1726', '2006-02-16T02:30:53', '2005-07-29T18:31:15', '2005-07-30T16:24:15', '2'), - ('429', '3545', '2006-02-16T02:30:53', '2005-07-27T00:40:50', '2005-08-02T19:08:50', '2'), - ('452', '4222', '2006-02-16T02:30:53', '2005-08-19T10:18:00', '2005-08-22T06:37:00', '2'), - ('211', '166', '2006-02-16T02:30:53', '2005-07-30T09:05:44', '2005-08-04T14:27:44', '2'), - ('29', '1009', '2006-02-16T02:30:53', '2005-08-18T15:20:46', '2005-08-24T12:38:46', '2'), - ('546', '71', '2006-02-16T02:30:53', '2005-08-23T05:13:09', '2005-08-30T08:58:09', '2'), - ('577', '4548', '2006-02-16T02:30:53', '2005-08-23T16:27:59', '2005-08-26T11:11:59', '2'), - ('401', '4581', '2006-02-16T02:30:53', '2005-07-31T07:32:21', '2005-08-01T05:07:21', '2'), - ('599', '3742', '2006-02-16T02:30:53', '2005-07-12T17:03:56', '2005-07-21T20:32:56', '2'), - ('535', '1796', '2006-02-16T02:30:53', '2005-07-31T01:01:06', '2005-08-04T04:06:06', '2'), - ('394', '2029', '2006-02-16T02:30:53', '2005-05-30T21:22:26', '2005-06-04T22:32:26', '2'), - ('291', '443', '2006-02-16T02:30:53', '2005-07-29T16:46:07', '2005-08-02T19:27:07', '2'), - ('139', '4393', '2006-02-16T02:30:53', '2005-08-22T10:34:39', '2005-08-26T13:09:39', '2'), - ('83', '1049', '2006-02-16T02:30:53', '2005-07-11T11:51:00', '2005-07-15T12:34:00', '2'), - ('517', '4377', '2006-02-16T02:30:53', '2005-07-07T20:13:58', '2005-07-11T18:11:58', '2'), - ('168', '59', '2006-02-16T02:30:53', '2005-08-17T04:28:56', '2005-08-24T00:42:56', '2'), - ('383', '3942', '2006-02-16T02:30:53', '2005-07-08T13:53:01', '2005-07-12T17:10:01', '2'), - ('167', '3191', '2006-02-16T02:30:53', '2005-07-10T13:49:30', '2005-07-11T12:11:30', '2'), - ('70', '2143', '2006-02-16T02:30:53', '2005-08-19T05:56:44', '2005-08-24T11:28:44', '2'), - ('93', '619', '2006-02-16T02:30:53', '2005-05-27T15:19:38', '2005-06-03T15:07:38', '2'), - ('23', '485', '2006-02-16T02:30:53', '2005-07-11T12:43:07', '2005-07-16T07:23:07', '2'), - ('174', '469', '2006-02-16T02:30:53', '2005-05-31T09:48:56', '2005-06-02T03:52:56', '2'), - ('288', '3262', '2006-02-16T02:30:53', '2005-07-31T08:56:08', '2005-08-07T11:05:08', '2'), - ('158', '4192', '2006-02-16T02:30:53', '2005-08-20T14:48:42', '2005-08-21T14:55:42', '2'), - ('444', '158', '2006-02-16T02:30:53', '2005-05-28T08:36:22', '2005-06-03T10:42:22', '2'), - ('507', '1456', '2006-02-16T02:30:53', '2005-07-29T05:15:42', '2005-08-01T03:36:42', '2'), - ('268', '1782', '2006-02-16T02:30:53', '2005-08-22T03:32:05', '2005-08-24T07:02:05', '2'), - ('227', '3807', '2006-02-16T02:30:53', '2005-07-29T05:38:43', '2005-08-01T07:31:43', '2'), - ('509', '4246', '2006-02-16T02:30:53', '2005-06-15T07:21:21', '2005-06-17T08:12:21', '2'), - ('300', '3262', '2006-02-16T02:30:53', '2005-06-15T15:17:21', '2005-06-20T17:07:21', '2'), - ('577', '3298', '2006-02-16T02:30:53', '2005-08-23T01:57:20', '2005-08-26T04:43:20', '2'), - ('29', '1862', '2006-02-16T02:30:53', '2005-08-21T03:01:45', '2005-08-22T07:19:45', '2'), - ('275', '4031', '2006-02-16T02:30:53', '2005-08-21T03:32:03', '2005-08-25T03:29:03', '2'), - ('101', '3730', '2006-02-16T02:30:53', '2005-07-09T00:02:46', '2005-07-14T18:05:46', '2'), - ('532', '2181', '2006-02-16T02:30:53', '2005-08-02T13:40:49', '2005-08-09T14:16:49', '2'), - ('269', '924', '2006-02-16T02:30:53', '2005-05-31T13:54:48', '2005-06-05T13:04:48', '2'), - ('404', '715', '2006-02-16T02:30:53', '2005-08-18T14:47:28', '2005-08-25T14:34:28', '2'), - ('249', '766', '2006-02-16T02:30:53', '2005-07-27T21:47:37', '2005-08-05T02:29:37', '2'), - ('6', '3693', '2006-02-16T02:30:53', '2005-07-07T14:53:24', '2005-07-13T14:21:24', '2'), - ('155', '1394', '2006-02-16T02:30:53', '2005-08-17T17:14:02', '2005-08-26T12:04:02', '2'), - ('115', '3751', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('202', '1929', '2006-02-16T02:30:53', '2005-08-20T20:59:15', '2005-08-28T17:29:15', '2'), - ('305', '1835', '2006-02-16T02:30:53', '2005-07-29T23:54:54', '2005-07-31T05:10:54', '2'), - ('527', '2454', '2006-02-16T02:30:53', '2005-08-01T10:23:43', '2005-08-05T07:11:43', '2'), - ('182', '3430', '2006-02-16T02:30:53', '2005-07-07T19:02:37', '2005-07-09T17:25:37', '2'), - ('167', '2080', '2006-02-16T02:30:53', '2005-08-18T18:19:16', '2005-08-20T17:30:16', '2'), - ('195', '1472', '2006-02-16T02:30:53', '2005-07-07T17:40:26', '2005-07-09T22:58:26', '2'), - ('573', '3680', '2006-02-16T02:30:53', '2005-07-29T06:23:56', '2005-07-31T02:41:56', '2'), - ('80', '2571', '2006-02-16T02:30:53', '2005-08-01T16:38:04', '2005-08-09T19:37:04', '2'), - ('226', '1488', '2006-02-16T02:30:53', '2005-07-29T13:01:19', '2005-07-31T15:40:19', '2'), - ('108', '276', '2006-02-16T02:30:53', '2005-06-20T18:04:55', '2005-06-21T12:12:55', '2'), - ('177', '2530', '2006-02-16T02:30:53', '2005-08-02T18:16:00', '2005-08-11T23:38:00', '2'), - ('512', '213', '2006-02-16T02:30:53', '2005-08-17T12:22:04', '2005-08-25T15:59:04', '2'), - ('124', '1197', '2006-02-16T02:30:53', '2005-05-29T13:23:26', '2005-05-30T07:53:26', '2'), - ('503', '197', '2006-02-16T02:30:53', '2005-07-26T23:45:33', '2005-07-31T04:40:33', '2'), - ('292', '1097', '2006-02-16T02:30:53', '2005-07-07T11:15:11', '2005-07-11T11:46:11', '2'), - ('118', '2913', '2006-02-16T02:30:53', '2005-07-28T09:31:13', '2005-08-02T14:06:13', '2'), - ('210', '1897', '2006-02-16T02:30:53', '2005-06-15T00:33:04', '2005-06-16T03:47:04', '2'), - ('436', '2042', '2006-02-16T02:30:53', '2005-07-30T18:13:51', '2005-08-07T13:45:51', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['2166', '3694', '9768', '11874', '581', '9364', '5067', '12864', '6267', '8585', '12832', '5260', '15713', '6409', '9235', '10025', '8519', '11318', '6908', '5630', '282', '405', '7396', '353', '8720', '14163', '5257', '4990', '6968', '8075', '12177', '8684', '5105', '13997', '3464', '15088', '4942', '14698', '15410', '13508', '4112', '6855', '11992', '4309', '14010', '2958', '11035', '3361', '4276', '4725', '77', '10943', '6552', '1393', '14610', '445', '1909', '1039', '4717', '15857', '7400', '2807', '12218', '838', '13766', '716', '7699', '1253', '7392', '7323', '14725', '4137', '7389', '2589', '3059', '2099', '12409', '1718', '10791', '11623', '12613', '13193', '5481', '263', '13075', '13864', '10039', '4548', '4658', '15849', '15233', '8245', '281', '11263', '12170', '3798', '15309', '3004', '2578', '4098']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('305', '4343', '2006-02-16T02:30:53', '2005-06-17T23:51:21', '2005-06-27T01:06:21', '2'), - ('419', '3848', '2006-02-16T02:30:53', '2005-07-06T10:01:23', '2005-07-08T11:44:23', '2'), - ('582', '2656', '2006-02-16T02:30:53', '2005-07-31T09:48:41', '2005-08-08T11:40:41', '2'), - ('467', '2637', '2006-02-16T02:30:53', '2005-08-17T14:16:40', '2005-08-18T15:51:40', '2'), - ('186', '1380', '2006-02-16T02:30:53', '2005-05-28T11:20:29', '2005-06-04T12:37:29', '2'), - ('87', '306', '2006-02-16T02:30:53', '2005-07-30T18:44:44', '2005-08-08T23:55:44', '2'), - ('225', '1480', '2006-02-16T02:30:53', '2005-07-09T04:52:35', '2005-07-11T23:33:35', '2'), - ('465', '4481', '2006-02-16T02:30:53', '2005-08-19T02:38:26', '2005-08-22T21:42:26', '2'), - ('20', '2152', '2006-02-16T02:30:53', '2005-07-11T15:53:00', '2005-07-17T18:09:00', '2'), - ('516', '512', '2006-02-16T02:30:53', '2005-07-29T12:14:18', '2005-08-03T08:31:18', '2'), - ('563', '2820', '2006-02-16T02:30:53', '2005-08-19T01:41:44', '2005-08-24T23:15:44', '2'), - ('75', '3143', '2006-02-16T02:30:53', '2005-07-09T14:05:45', '2005-07-14T08:41:45', '2'), - ('432', '337', '2006-02-16T02:30:53', '2005-08-23T10:56:15', '2005-08-29T09:14:15', '2'), - ('537', '3859', '2006-02-16T02:30:53', '2005-07-11T23:05:49', '2005-07-13T00:13:49', '2'), - ('181', '984', '2006-02-16T02:30:53', '2005-07-30T13:47:17', '2005-08-06T17:15:17', '2'), - ('565', '475', '2006-02-16T02:30:53', '2005-07-31T18:29:09', '2005-08-07T14:20:09', '2'), - ('588', '1163', '2006-02-16T02:30:53', '2005-07-29T10:09:43', '2005-08-03T08:14:43', '2'), - ('532', '2386', '2006-02-16T02:30:53', '2005-08-02T16:09:11', '2005-08-07T11:28:11', '2'), - ('529', '3161', '2006-02-16T02:30:53', '2005-07-12T22:08:46', '2005-07-21T00:21:46', '2'), - ('537', '1151', '2006-02-16T02:30:53', '2005-07-10T06:08:14', '2005-07-14T03:37:14', '2'), - ('282', '4486', '2006-02-16T02:30:53', '2005-05-26T18:56:26', '2005-06-01T16:32:26', '2'), - ('272', '4090', '2006-02-16T02:30:53', '2005-05-27T13:32:39', '2005-06-05T18:53:39', '2'), - ('595', '3346', '2006-02-16T02:30:53', '2005-07-27T16:03:53', '2005-08-05T10:36:53', '2'), - ('503', '3989', '2006-02-16T02:30:53', '2005-05-27T06:03:39', '2005-06-03T04:39:39', '2'), - ('180', '152', '2006-02-16T02:30:53', '2005-07-29T17:48:32', '2005-08-04T14:30:32', '2'), - ('204', '1007', '2006-02-16T02:30:53', '2005-08-21T02:56:52', '2005-08-21T21:03:52', '2'), - ('292', '286', '2006-02-16T02:30:53', '2005-07-09T13:56:43', '2005-07-10T14:26:43', '2'), - ('35', '3305', '2006-02-16T02:30:53', '2005-07-09T00:48:49', '2005-07-10T06:36:49', '2'), - ('370', '1662', '2006-02-16T02:30:53', '2005-07-27T00:16:45', '2005-07-30T23:16:45', '2'), - ('61', '2175', '2006-02-16T02:30:53', '2005-07-28T17:37:28', '2005-07-29T11:56:28', '2'), - ('470', '522', '2006-02-16T02:30:53', '2005-08-18T01:15:47', '2005-08-24T23:23:47', '2'), - ('185', '2457', '2006-02-16T02:30:53', '2005-07-29T16:16:33', '2005-08-07T12:27:33', '2'), - ('290', '2555', '2006-02-16T02:30:53', '2005-07-09T06:38:59', '2005-07-17T03:06:59', '2'), - ('175', '2330', '2006-02-16T02:30:53', '2005-08-20T19:51:28', '2005-08-26T01:29:28', '2'), - ('251', '2698', '2006-02-16T02:30:53', '2005-06-21T22:08:58', '2005-06-26T16:23:58', '2'), - ('377', '4199', '2006-02-16T02:30:53', '2005-08-22T11:28:26', '2005-08-24T15:46:26', '2'), - ('120', '4467', '2006-02-16T02:30:53', '2005-07-08T22:42:47', '2005-07-15T04:36:47', '2'), - ('196', '4255', '2006-02-16T02:30:53', '2005-08-21T20:49:58', '2005-08-29T20:13:58', '2'), - ('403', '2052', '2006-02-16T02:30:53', '2005-08-22T23:27:43', '2005-08-29T05:12:43', '2'), - ('408', '4120', '2006-02-16T02:30:53', '2005-08-20T02:12:54', '2005-08-28T21:47:54', '2'), - ('533', '3284', '2006-02-16T02:30:53', '2005-07-07T06:49:09', '2005-07-16T06:53:09', '2'), - ('24', '2657', '2006-02-16T02:30:53', '2005-07-12T19:46:29', '2005-07-15T16:56:29', '2'), - ('136', '4132', '2006-02-16T02:30:53', '2005-08-17T18:27:22', '2005-08-26T22:38:22', '2'), - ('209', '3549', '2006-02-16T02:30:53', '2005-07-07T17:29:41', '2005-07-14T22:22:41', '2'), - ('537', '934', '2006-02-16T02:30:53', '2005-08-20T20:29:46', '2005-08-26T17:37:46', '2'), - ('260', '1380', '2006-02-16T02:30:53', '2005-06-20T06:56:20', '2005-06-29T02:33:20', '2'), - ('305', '3776', '2006-02-16T02:30:53', '2005-08-02T05:55:39', '2005-08-08T06:46:39', '2'), - ('268', '2671', '2006-02-16T02:30:53', '2005-06-21T12:14:23', '2005-06-26T10:01:23', '2'), - ('366', '221', '2006-02-16T02:30:53', '2005-07-07T14:50:59', '2005-07-09T15:42:59', '2'), - ('3', '2058', '2006-02-16T02:30:53', '2005-07-08T12:47:11', '2005-07-15T09:08:11', '2'), - ('451', '1303', '2006-02-16T02:30:53', '2005-05-25T11:31:59', '2005-05-26T16:53:59', '2'), - ('377', '1036', '2006-02-16T02:30:53', '2005-08-02T03:17:29', '2005-08-03T00:50:29', '2'), - ('493', '766', '2006-02-16T02:30:53', '2005-07-12T05:05:06', '2005-07-13T05:12:06', '2'), - ('177', '2767', '2006-02-16T02:30:53', '2005-06-15T16:12:50', '2005-06-19T10:40:50', '2'), - ('260', '1894', '2006-02-16T02:30:53', '2005-08-21T17:59:09', '2005-08-29T21:36:09', '2'), - ('293', '1757', '2006-02-16T02:30:53', '2005-05-27T18:42:57', '2005-05-30T22:35:57', '2'), - ('269', '2599', '2006-02-16T02:30:53', '2005-06-17T05:11:04', '2005-06-19T04:33:04', '2'), - ('124', '2479', '2006-02-16T02:30:53', '2005-05-31T05:32:29', '2005-06-01T06:04:29', '2'), - ('453', '1491', '2006-02-16T02:30:53', '2005-07-08T12:22:43', '2005-07-11T10:24:43', '2'), - ('575', '2733', '2006-02-16T02:30:53', '2005-08-23T15:59:51', '2005-08-26T12:01:51', '2'), - ('133', '2874', '2006-02-16T02:30:53', '2005-07-27T16:16:37', '2005-07-31T12:34:37', '2'), - ('194', '2825', '2006-02-16T02:30:53', '2005-06-19T19:32:53', '2005-06-25T00:30:53', '2'), - ('70', '1933', '2006-02-16T02:30:53', '2005-08-18T02:48:14', '2005-08-21T01:52:14', '2'), - ('504', '2859', '2006-02-16T02:30:53', '2005-05-30T00:27:57', '2005-06-06T22:19:57', '2'), - ('189', '1313', '2006-02-16T02:30:53', '2005-08-20T11:42:01', '2005-08-27T13:44:01', '2'), - ('36', '85', '2006-02-16T02:30:53', '2005-05-29T04:35:29', '2005-06-01T07:42:29', '2'), - ('53', '4332', '2006-02-16T02:30:53', '2005-07-28T03:52:21', '2005-08-01T05:00:21', '2'), - ('498', '3242', '2006-02-16T02:30:53', '2005-06-15T06:06:33', '2005-06-21T04:13:33', '2'), - ('204', '3159', '2006-02-16T02:30:53', '2005-07-27T16:01:05', '2005-08-01T17:23:05', '2'), - ('125', '3830', '2006-02-16T02:30:53', '2005-07-27T13:39:40', '2005-07-29T08:45:40', '2'), - ('403', '4427', '2006-02-16T02:30:53', '2005-08-21T22:02:08', '2005-08-23T03:59:08', '2'), - ('485', '2065', '2006-02-16T02:30:53', '2005-07-07T08:17:06', '2005-07-11T10:52:06', '2'), - ('156', '3822', '2006-02-16T02:30:53', '2005-07-27T15:56:15', '2005-07-30T21:28:15', '2'), - ('164', '225', '2006-02-16T02:30:53', '2005-06-19T05:21:27', '2005-06-21T09:55:27', '2'), - ('266', '2911', '2006-02-16T02:30:53', '2005-06-20T13:38:41', '2005-06-21T10:13:41', '2'), - ('146', '3660', '2006-02-16T02:30:53', '2005-06-17T18:47:26', '2005-06-24T22:31:26', '2'), - ('64', '2568', '2006-02-16T02:30:53', '2005-08-18T09:43:58', '2005-08-19T15:02:58', '2'), - ('516', '288', '2006-02-16T02:30:53', '2005-06-16T14:52:02', '2005-06-25T10:53:02', '2'), - ('338', '2061', '2006-02-16T02:30:53', '2005-08-01T21:41:52', '2005-08-04T03:28:52', '2'), - ('163', '759', '2006-02-16T02:30:53', '2005-08-17T04:15:47', '2005-08-19T04:11:47', '2'), - ('8', '3877', '2006-02-16T02:30:53', '2005-08-18T17:16:01', '2005-08-23T18:40:01', '2'), - ('118', '523', '2006-02-16T02:30:53', '2005-08-19T14:33:45', '2005-08-28T08:46:45', '2'), - ('479', '562', '2006-02-16T02:30:53', '2005-07-09T23:51:57', '2005-07-11T05:28:57', '2'), - ('449', '1160', '2006-02-16T02:30:53', '2005-05-26T15:47:40', '2005-05-30T10:07:40', '2'), - ('224', '4125', '2006-02-16T02:30:53', '2005-08-19T10:10:10', '2005-08-21T08:44:10', '2'), - ('214', '3935', '2006-02-16T02:30:53', '2005-08-20T14:59:55', '2005-08-22T09:30:55', '2'), - ('111', '4391', '2006-02-16T02:30:53', '2005-07-31T18:50:40', '2005-08-01T18:49:40', '2'), - ('164', '765', '2006-02-16T02:30:53', '2005-07-08T04:21:54', '2005-07-14T23:16:54', '2'), - ('166', '3131', '2006-02-16T02:30:53', '2005-07-08T09:51:11', '2005-07-10T12:30:11', '2'), - ('482', '4077', '2006-02-16T02:30:53', '2005-08-23T15:41:20', '2005-08-27T15:47:20', '2'), - ('197', '4405', '2006-02-16T02:30:53', '2005-08-22T17:41:53', '2005-08-24T12:59:53', '2'), - ('555', '3330', '2006-02-16T02:30:53', '2005-07-29T00:37:09', '2005-08-05T05:48:09', '2'), - ('582', '1208', '2006-02-16T02:30:53', '2005-05-26T18:49:35', '2005-05-27T18:11:35', '2'), - ('421', '1189', '2006-02-16T02:30:53', '2005-08-02T14:02:19', '2005-08-07T14:03:19', '2'), - ('289', '1125', '2006-02-16T02:30:53', '2005-08-18T01:06:10', '2005-08-25T02:40:10', '2'), - ('479', '1942', '2006-02-16T02:30:53', '2005-07-06T14:57:53', '2005-07-07T10:48:53', '2'), - ('141', '2743', '2006-02-16T02:30:53', '2005-08-22T19:54:52', '2005-08-24T23:00:52', '2'), - ('113', '2836', '2006-02-16T02:30:53', '2005-06-20T10:04:36', '2005-06-23T07:38:36', '2'), - ('267', '1695', '2006-02-16T02:30:53', '2005-06-19T04:40:06', '2005-06-26T09:37:06', '2'), - ('35', '2865', '2006-02-16T02:30:53', '2005-07-07T06:14:51', '2005-07-14T06:51:51', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['15948', '9703', '9263', '14711', '9407', '4875', '11733', '8682', '15901', '7826', '6561', '3815', '8596', '11839', '5361', '9683', '4718', '7946', '6864', '9843', '3504', '1921', '12105', '13723', '3339', '536', '8265', '477', '7090', '393', '3019', '6338', '366', '15418', '7811', '4319', '12125', '8006', '8492', '4041', '2282', '11413', '1088', '1080', '15570', '5767', '1804', '3827', '6201', '9147', '10206', '10611', '6328', '2274', '320', '11813', '3077', '2980', '15454', '10901', '11113', '4843', '12017', '3219', '9924', '8646', '15974', '8517', '12889', '6982', '2695', '13993', '6398', '7482', '233', '15167', '4030', '15052', '4300', '9225', '13123', '12678', '15559', '3640', '2337', '8100', '7138', '13272', '5866', '6368', '12443', '4468', '11092', '2814', '8853', '14779', '5460', '1175', '2664', '15612']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('520', '432', '2006-02-16T02:30:53', '2005-08-23T18:59:33', '2005-08-31T13:02:33', '2'), - ('57', '2708', '2006-02-16T02:30:53', '2005-07-31T07:34:52', '2005-08-03T13:33:52', '2'), - ('410', '73', '2006-02-16T02:30:53', '2005-07-30T14:48:24', '2005-08-04T19:06:24', '2'), - ('448', '1973', '2006-02-16T02:30:53', '2005-08-21T21:22:07', '2005-08-30T16:24:07', '2'), - ('585', '2594', '2006-02-16T02:30:53', '2005-07-30T20:25:24', '2005-08-08T22:51:24', '2'), - ('555', '843', '2006-02-16T02:30:53', '2005-07-08T19:24:17', '2005-07-11T19:15:17', '2'), - ('251', '439', '2006-02-16T02:30:53', '2005-08-17T08:31:03', '2005-08-21T05:44:03', '2'), - ('348', '4328', '2006-02-16T02:30:53', '2005-07-29T16:15:26', '2005-08-03T20:15:26', '2'), - ('226', '2761', '2006-02-16T02:30:53', '2005-08-23T17:19:17', '2005-08-30T14:24:17', '2'), - ('214', '1473', '2006-02-16T02:30:53', '2005-07-28T08:35:51', '2005-08-05T07:57:51', '2'), - ('528', '4568', '2006-02-16T02:30:53', '2005-07-12T05:24:02', '2005-07-16T03:43:02', '2'), - ('472', '4038', '2006-02-16T02:30:53', '2005-07-06T15:26:36', '2005-07-11T17:07:36', '2'), - ('233', '59', '2006-02-16T02:30:53', '2005-07-29T12:48:54', '2005-08-04T07:19:54', '2'), - ('80', '2282', '2006-02-16T02:30:53', '2005-08-17T13:08:45', '2005-08-18T15:05:45', '2'), - ('279', '2045', '2006-02-16T02:30:53', '2005-07-09T18:15:32', '2005-07-17T23:32:32', '2'), - ('141', '856', '2006-02-16T02:30:53', '2005-07-31T06:47:13', '2005-08-04T05:52:13', '2'), - ('535', '1653', '2006-02-16T02:30:53', '2005-07-08T12:32:08', '2005-07-17T17:34:08', '2'), - ('90', '99', '2006-02-16T02:30:53', '2005-07-28T13:01:22', '2005-08-03T15:27:22', '2'), - ('38', '2252', '2006-02-16T02:30:53', '2005-07-12T19:59:25', '2005-07-19T15:52:25', '2'), - ('532', '2923', '2006-02-16T02:30:53', '2005-07-31T12:25:28', '2005-08-01T09:51:28', '2'), - ('209', '268', '2006-02-16T02:30:53', '2005-07-06T00:18:29', '2005-07-10T00:24:29', '2'), - ('417', '4369', '2006-02-16T02:30:53', '2005-06-17T06:04:16', '2005-06-23T05:26:16', '2'), - ('390', '2848', '2006-02-16T02:30:53', '2005-08-17T22:54:45', '2005-08-21T00:33:45', '2'), - ('110', '411', '2006-02-16T02:30:53', '2005-08-20T10:05:30', '2005-08-27T07:43:30', '2'), - ('526', '312', '2006-02-16T02:30:53', '2005-06-21T10:37:11', '2005-06-30T05:04:11', '2'), - ('514', '2962', '2006-02-16T02:30:53', '2005-05-28T06:17:33', '2005-06-03T10:02:33', '2'), - ('409', '2389', '2006-02-16T02:30:53', '2005-07-29T01:20:15', '2005-08-06T19:32:15', '2'), - ('161', '2437', '2006-02-16T02:30:53', '2005-05-27T22:33:33', '2005-06-02T18:35:33', '2'), - ('218', '3495', '2006-02-16T02:30:53', '2005-07-27T04:43:53', '2005-07-29T07:33:53', '2'), - ('251', '145', '2006-02-16T02:30:53', '2005-05-27T11:18:25', '2005-05-28T07:10:25', '2'), - ('144', '491', '2006-02-16T02:30:53', '2005-06-20T11:11:52', '2005-06-27T08:30:52', '2'), - ('54', '1691', '2006-02-16T02:30:53', '2005-07-11T19:39:41', '2005-07-18T01:13:41', '2'), - ('134', '360', '2006-02-16T02:30:53', '2005-05-27T07:33:54', '2005-06-04T01:55:54', '2'), - ('205', '808', '2006-02-16T02:30:53', '2005-08-22T23:54:14', '2005-08-28T04:23:14', '2'), - ('347', '3891', '2006-02-16T02:30:53', '2005-07-28T08:06:01', '2005-07-30T10:08:01', '2'), - ('25', '3389', '2006-02-16T02:30:53', '2005-07-07T17:50:27', '2005-07-10T13:53:27', '2'), - ('573', '136', '2006-02-16T02:30:53', '2005-08-17T23:24:25', '2005-08-25T03:08:25', '2'), - ('109', '3959', '2006-02-16T02:30:53', '2005-07-28T15:15:41', '2005-08-05T19:29:41', '2'), - ('266', '4553', '2006-02-16T02:30:53', '2005-07-29T09:04:17', '2005-08-02T08:48:17', '2'), - ('445', '2217', '2006-02-16T02:30:53', '2005-07-07T03:03:33', '2005-07-09T07:57:33', '2'), - ('113', '4388', '2006-02-16T02:30:53', '2005-06-18T06:48:23', '2005-06-24T11:04:23', '2'), - ('297', '1115', '2006-02-16T02:30:53', '2005-08-02T19:35:19', '2005-08-05T21:33:19', '2'), - ('356', '3988', '2006-02-16T02:30:53', '2005-05-31T11:35:13', '2005-06-06T16:01:13', '2'), - ('215', '3491', '2006-02-16T02:30:53', '2005-05-31T10:55:26', '2005-06-03T13:13:26', '2'), - ('557', '4014', '2006-02-16T02:30:53', '2005-08-23T05:24:55', '2005-08-31T07:06:55', '2'), - ('32', '2871', '2006-02-16T02:30:53', '2005-07-10T13:13:18', '2005-07-17T14:41:18', '2'), - ('570', '1152', '2006-02-16T02:30:53', '2005-06-16T20:33:15', '2005-06-18T02:31:15', '2'), - ('41', '2072', '2006-02-16T02:30:53', '2005-07-06T15:52:03', '2005-07-08T21:43:03', '2'), - ('559', '4530', '2006-02-16T02:30:53', '2005-07-11T12:18:07', '2005-07-12T12:11:07', '2'), - ('394', '4167', '2006-02-16T02:30:53', '2005-07-30T10:38:59', '2005-08-02T11:45:59', '2'), - ('90', '4479', '2006-02-16T02:30:53', '2005-08-01T00:52:40', '2005-08-10T02:36:40', '2'), - ('135', '957', '2006-02-16T02:30:53', '2005-08-01T14:53:52', '2005-08-07T09:15:52', '2'), - ('260', '999', '2006-02-16T02:30:53', '2005-07-11T19:09:33', '2005-07-12T20:16:33', '2'), - ('347', '3021', '2006-02-16T02:30:53', '2005-06-18T06:31:15', '2005-06-21T01:24:15', '2'), - ('2', '1090', '2006-02-16T02:30:53', '2005-05-27T00:09:24', '2005-05-28T04:30:24', '2'), - ('36', '1074', '2006-02-16T02:30:53', '2005-08-17T12:06:54', '2005-08-21T17:52:54', '2'), - ('303', '1675', '2006-02-16T02:30:53', '2005-06-20T15:05:18', '2005-06-26T20:52:18', '2'), - ('343', '310', '2006-02-16T02:30:53', '2005-06-20T08:35:03', '2005-06-29T07:57:03', '2'), - ('142', '2946', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('290', '3813', '2006-02-16T02:30:53', '2005-08-02T01:35:44', '2005-08-04T21:20:44', '2'), - ('231', '1654', '2006-02-16T02:30:53', '2005-08-02T08:26:24', '2005-08-07T09:24:24', '2'), - ('45', '3640', '2006-02-16T02:30:53', '2005-07-08T18:27:28', '2005-07-15T00:26:28', '2'), - ('573', '344', '2006-02-16T02:30:53', '2005-08-17T19:33:49', '2005-08-22T01:16:49', '2'), - ('129', '3024', '2006-02-16T02:30:53', '2005-06-21T01:43:26', '2005-06-28T23:50:26', '2'), - ('64', '1986', '2006-02-16T02:30:53', '2005-07-31T15:04:57', '2005-08-05T20:07:57', '2'), - ('302', '89', '2006-02-16T02:30:53', '2005-07-29T14:48:48', '2005-08-03T18:11:48', '2'), - ('201', '3518', '2006-02-16T02:30:53', '2005-08-23T20:06:04', '2005-08-27T17:33:04', '2'), - ('274', '2064', '2006-02-16T02:30:53', '2005-07-29T10:00:48', '2005-08-06T14:37:48', '2'), - ('515', '4376', '2006-02-16T02:30:53', '2005-08-19T03:41:31', '2005-08-27T00:46:31', '2'), - ('284', '3843', '2006-02-16T02:30:53', '2005-07-27T00:53:41', '2005-07-31T06:19:41', '2'), - ('208', '190', '2006-02-16T02:30:53', '2005-06-19T13:25:53', '2005-06-24T17:12:53', '2'), - ('93', '1158', '2006-02-16T02:30:53', '2005-08-20T19:32:29', '2005-08-26T16:59:29', '2'), - ('296', '1409', '2006-02-16T02:30:53', '2005-07-11T22:34:49', '2005-07-17T17:58:49', '2'), - ('348', '485', '2006-02-16T02:30:53', '2005-07-27T19:24:16', '2005-08-05T18:49:16', '2'), - ('531', '715', '2006-02-16T02:30:53', '2005-05-26T11:43:44', '2005-05-28T17:28:44', '2'), - ('190', '973', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('300', '1734', '2006-02-16T02:30:53', '2005-07-07T02:25:42', '2005-07-08T22:53:42', '2'), - ('147', '2349', '2006-02-16T02:30:53', '2005-08-22T10:09:19', '2005-08-31T09:27:19', '2'), - ('38', '1189', '2006-02-16T02:30:53', '2005-07-07T16:36:16', '2005-07-10T13:59:16', '2'), - ('391', '1992', '2006-02-16T02:30:53', '2005-07-30T13:29:47', '2005-08-02T17:08:47', '2'), - ('220', '2804', '2006-02-16T02:30:53', '2005-08-19T11:55:13', '2005-08-21T05:55:13', '2'), - ('181', '2504', '2006-02-16T02:30:53', '2005-08-18T19:41:27', '2005-08-23T15:14:27', '2'), - ('517', '1773', '2006-02-16T02:30:53', '2005-08-23T04:55:05', '2005-08-30T09:01:05', '2'), - ('271', '3432', '2006-02-16T02:30:53', '2005-07-06T07:12:26', '2005-07-10T04:54:26', '2'), - ('582', '4522', '2006-02-16T02:30:53', '2005-06-18T11:15:27', '2005-06-26T06:59:27', '2'), - ('11', '2859', '2006-02-16T02:30:53', '2005-07-28T18:43:11', '2005-08-02T15:56:11', '2'), - ('31', '1418', '2006-02-16T02:30:53', '2005-07-27T06:47:13', '2005-08-03T01:12:13', '2'), - ('145', '2531', '2006-02-16T02:30:53', '2005-08-19T17:49:13', '2005-08-23T15:49:13', '2'), - ('484', '457', '2006-02-16T02:30:53', '2005-07-10T18:35:14', '2005-07-19T19:41:14', '2'), - ('588', '3666', '2006-02-16T02:30:53', '2005-07-11T21:19:01', '2005-07-13T17:56:01', '2'), - ('233', '2048', '2006-02-16T02:30:53', '2005-08-18T10:50:59', '2005-08-26T07:48:59', '2'), - ('170', '3302', '2006-02-16T02:30:53', '2005-07-08T00:17:59', '2005-07-12T05:51:59', '2'), - ('60', '569', '2006-02-16T02:30:53', '2005-08-02T07:58:50', '2005-08-04T03:23:50', '2'), - ('10', '1783', '2006-02-16T02:30:53', '2005-06-19T20:01:59', '2005-06-26T01:28:59', '2'), - ('58', '2323', '2006-02-16T02:30:53', '2005-07-29T23:34:21', '2005-07-31T21:20:21', '2'), - ('279', '1087', '2006-02-16T02:30:53', '2005-08-22T00:00:56', '2005-08-31T00:01:56', '2'), - ('38', '2410', '2006-02-16T02:30:53', '2005-07-09T22:46:14', '2005-07-12T21:26:14', '2'), - ('197', '3255', '2006-02-16T02:30:53', '2005-06-15T00:15:15', '2005-06-20T19:23:15', '2'), - ('299', '3496', '2006-02-16T02:30:53', '2005-06-19T11:11:23', '2005-06-28T08:30:23', '2'), - ('305', '3367', '2006-02-16T02:30:53', '2005-08-23T06:59:07', '2005-09-01T11:26:07', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['12717', '6199', '8145', '4627', '3131', '69', '15571', '8603', '5132', '13242', '12608', '1403', '2490', '5538', '8788', '1307', '3424', '4996', '8178', '10976', '14607', '13948', '293', '5285', '2326', '14418', '8219', '3856', '5890', '14064', '12937', '14316', '10720', '5291', '1844', '12421', '2699', '4676', '1654', '4119', '14594', '2818', '7554', '5494', '14563', '14042', '15265', '1261', '6617', '13680', '138', '13968', '14250', '7579', '14991', '11480', '5003', '9880', '6434', '3960', '12444', '2208', '9776', '3480', '2572', '9280', '14475', '2645', '5777', '2668', '3871', '14357', '6257', '8552', '10669', '2623', '12278', '8898', '2766', '2516', '2546', '8759', '10367', '6210', '8082', '4459', '13250', '1724', '3021', '12795', '12540', '740', '10643', '4792', '7867', '15086', '12945', '2112', '16043', '15040']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('167', '3551', '2006-02-16T02:30:53', '2005-08-18T21:15:40', '2005-08-20T00:59:40', '2'), - ('80', '4329', '2006-02-16T02:30:53', '2005-07-11T12:16:03', '2005-07-18T15:33:03', '2'), - ('198', '937', '2006-02-16T02:30:53', '2005-07-28T20:34:41', '2005-08-05T15:28:41', '2'), - ('78', '2383', '2006-02-16T02:30:53', '2005-07-08T08:24:39', '2005-07-13T11:04:39', '2'), - ('146', '3678', '2006-02-16T02:30:53', '2005-06-20T19:08:00', '2005-06-24T20:59:00', '2'), - ('305', '3207', '2006-02-16T02:30:53', '2005-05-25T10:10:14', '2005-05-27T14:02:14', '2'), - ('57', '716', '2006-02-16T02:30:53', '2005-08-23T05:26:30', '2005-08-29T00:54:30', '2'), - ('594', '3007', '2006-02-16T02:30:53', '2005-07-29T13:07:07', '2005-08-04T18:32:07', '2'), - ('101', '4158', '2006-02-16T02:30:53', '2005-07-09T07:40:32', '2005-07-16T02:16:32', '2'), - ('414', '230', '2006-02-16T02:30:53', '2005-08-19T16:28:47', '2005-08-24T22:13:47', '2'), - ('366', '624', '2006-02-16T02:30:53', '2005-08-18T17:05:15', '2005-08-23T17:00:15', '2'), - ('546', '3380', '2006-02-16T02:30:53', '2005-06-15T16:31:59', '2005-06-22T14:23:59', '2'), - ('402', '1934', '2006-02-16T02:30:53', '2005-06-18T22:00:50', '2005-06-19T23:45:50', '2'), - ('367', '2119', '2006-02-16T02:30:53', '2005-07-10T02:39:40', '2005-07-12T01:39:40', '2'), - ('121', '3412', '2006-02-16T02:30:53', '2005-07-29T20:46:44', '2005-08-03T02:25:44', '2'), - ('507', '368', '2006-02-16T02:30:53', '2005-06-15T10:06:15', '2005-06-20T04:50:15', '2'), - ('583', '1279', '2006-02-16T02:30:53', '2005-06-21T17:42:51', '2005-06-24T23:22:51', '2'), - ('129', '4440', '2006-02-16T02:30:53', '2005-07-09T00:59:46', '2005-07-16T01:30:46', '2'), - ('503', '2825', '2006-02-16T02:30:53', '2005-07-28T21:54:31', '2005-08-02T23:56:31', '2'), - ('326', '2418', '2006-02-16T02:30:53', '2005-08-02T04:11:48', '2005-08-06T06:30:48', '2'), - ('417', '4518', '2006-02-16T02:30:53', '2005-08-21T17:56:50', '2005-08-22T17:44:50', '2'), - ('410', '4033', '2006-02-16T02:30:53', '2005-08-20T17:50:48', '2005-08-25T20:56:48', '2'), - ('158', '1828', '2006-02-16T02:30:53', '2005-05-26T20:27:02', '2005-06-03T16:45:02', '2'), - ('468', '676', '2006-02-16T02:30:53', '2005-07-09T15:10:44', '2005-07-16T13:02:44', '2'), - ('174', '3829', '2006-02-16T02:30:53', '2005-06-18T10:14:22', '2005-06-24T07:01:22', '2'), - ('442', '89', '2006-02-16T02:30:53', '2005-08-21T11:14:26', '2005-08-28T08:34:26', '2'), - ('227', '3609', '2006-02-16T02:30:53', '2005-07-28T23:46:31', '2005-08-03T00:11:31', '2'), - ('498', '3083', '2006-02-16T02:30:53', '2005-07-06T17:04:46', '2005-07-14T19:23:46', '2'), - ('535', '1463', '2006-02-16T02:30:53', '2005-07-10T20:00:25', '2005-07-18T17:57:25', '2'), - ('103', '2938', '2006-02-16T02:30:53', '2005-08-20T22:39:16', '2005-08-22T00:45:16', '2'), - ('348', '3826', '2006-02-16T02:30:53', '2005-08-19T05:25:30', '2005-08-22T10:40:30', '2'), - ('64', '386', '2006-02-16T02:30:53', '2005-08-21T07:59:47', '2005-08-23T02:20:47', '2'), - ('326', '3712', '2006-02-16T02:30:53', '2005-08-01T19:04:33', '2005-08-06T23:12:33', '2'), - ('194', '1367', '2006-02-16T02:30:53', '2005-07-09T15:15:02', '2005-07-15T10:22:02', '2'), - ('454', '2307', '2006-02-16T02:30:53', '2005-06-16T23:53:53', '2005-06-22T02:19:53', '2'), - ('158', '4067', '2006-02-16T02:30:53', '2005-08-18T10:04:06', '2005-08-24T08:45:06', '2'), - ('267', '72', '2006-02-16T02:30:53', '2005-06-19T13:29:28', '2005-06-24T11:15:28', '2'), - ('302', '2590', '2006-02-16T02:30:53', '2005-07-08T10:26:02', '2005-07-10T13:38:02', '2'), - ('348', '1039', '2006-02-16T02:30:53', '2005-06-16T09:42:48', '2005-06-20T14:28:48', '2'), - ('319', '2078', '2006-02-16T02:30:53', '2005-07-07T07:06:03', '2005-07-13T01:56:03', '2'), - ('62', '2978', '2006-02-16T02:30:53', '2005-08-21T17:34:24', '2005-08-26T22:04:24', '2'), - ('497', '2376', '2006-02-16T02:30:53', '2005-06-19T20:05:52', '2005-06-22T01:01:52', '2'), - ('135', '1805', '2006-02-16T02:30:53', '2005-07-27T22:12:41', '2005-08-04T01:34:41', '2'), - ('139', '3087', '2006-02-16T02:30:53', '2005-07-10T00:15:00', '2005-07-17T01:12:00', '2'), - ('212', '3984', '2006-02-16T02:30:53', '2005-08-21T16:23:53', '2005-08-25T11:30:53', '2'), - ('322', '505', '2006-02-16T02:30:53', '2005-08-20T21:45:51', '2005-08-23T19:57:51', '2'), - ('512', '1763', '2006-02-16T02:30:53', '2005-08-22T18:35:59', '2005-08-28T21:18:59', '2'), - ('95', '2447', '2006-02-16T02:30:53', '2005-06-15T06:52:57', '2005-06-21T01:47:57', '2'), - ('248', '2292', '2006-02-16T02:30:53', '2005-07-12T08:39:56', '2005-07-14T09:32:56', '2'), - ('70', '2822', '2006-02-16T02:30:53', '2005-08-20T08:44:06', '2005-08-27T09:58:06', '2'), - ('586', '4134', '2006-02-16T02:30:53', '2005-05-25T22:48:22', '2005-05-29T20:21:22', '2'), - ('15', '3715', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('313', '3008', '2006-02-16T02:30:53', '2005-08-21T05:39:35', '2005-08-28T10:06:35', '2'), - ('352', '501', '2006-02-16T02:30:53', '2005-07-27T23:06:41', '2005-07-31T20:08:41', '2'), - ('172', '708', '2006-02-16T02:30:53', '2005-08-22T07:50:44', '2005-08-30T06:32:44', '2'), - ('14', '4161', '2006-02-16T02:30:53', '2005-08-02T22:18:24', '2005-08-04T21:22:24', '2'), - ('569', '3438', '2006-02-16T02:30:53', '2005-07-09T01:19:03', '2005-07-10T04:28:03', '2'), - ('64', '3590', '2006-02-16T02:30:53', '2005-07-31T13:49:02', '2005-08-08T10:31:02', '2'), - ('102', '1478', '2006-02-16T02:30:53', '2005-07-12T00:14:25', '2005-07-20T19:54:25', '2'), - ('594', '2090', '2006-02-16T02:30:53', '2005-07-06T22:08:53', '2005-07-07T23:21:53', '2'), - ('285', '1639', '2006-02-16T02:30:53', '2005-08-18T10:53:12', '2005-08-19T13:54:12', '2'), - ('132', '2345', '2006-02-16T02:30:53', '2005-06-18T02:22:07', '2005-06-23T07:24:07', '2'), - ('73', '2524', '2006-02-16T02:30:53', '2005-07-31T10:01:03', '2005-08-03T07:20:03', '2'), - ('382', '1488', '2006-02-16T02:30:53', '2005-07-05T23:11:43', '2005-07-12T02:01:43', '2'), - ('159', '2449', '2006-02-16T02:30:53', '2005-06-19T04:21:26', '2005-06-23T09:22:26', '2'), - ('286', '4103', '2006-02-16T02:30:53', '2005-07-30T15:15:38', '2005-08-05T19:20:38', '2'), - ('2', '3164', '2006-02-16T02:30:53', '2005-08-21T13:24:32', '2005-08-27T08:59:32', '2'), - ('181', '2284', '2006-02-16T02:30:53', '2005-06-19T09:50:35', '2005-06-28T06:47:35', '2'), - ('40', '3959', '2006-02-16T02:30:53', '2005-07-10T13:38:41', '2005-07-17T15:48:41', '2'), - ('568', '3127', '2006-02-16T02:30:53', '2005-06-19T11:28:47', '2005-06-24T10:12:47', '2'), - ('331', '3114', '2006-02-16T02:30:53', '2005-07-06T17:58:51', '2005-07-15T22:18:51', '2'), - ('233', '2906', '2006-02-16T02:30:53', '2005-08-21T09:13:09', '2005-08-22T05:41:09', '2'), - ('492', '3253', '2006-02-16T02:30:53', '2005-07-11T15:23:46', '2005-07-14T17:26:46', '2'), - ('490', '1987', '2006-02-16T02:30:53', '2005-07-29T11:14:02', '2005-08-05T14:13:02', '2'), - ('559', '2121', '2006-02-16T02:30:53', '2005-08-01T17:03:28', '2005-08-08T21:34:28', '2'), - ('12', '4477', '2006-02-16T02:30:53', '2005-06-19T08:11:51', '2005-06-26T12:28:51', '2'), - ('294', '3205', '2006-02-16T02:30:53', '2005-08-18T04:46:45', '2005-08-24T08:59:45', '2'), - ('452', '3961', '2006-02-16T02:30:53', '2005-07-30T01:02:20', '2005-08-05T22:02:20', '2'), - ('345', '3421', '2006-02-16T02:30:53', '2005-06-19T17:45:15', '2005-06-23T20:11:15', '2'), - ('87', '2678', '2006-02-16T02:30:53', '2005-06-19T00:03:28', '2005-06-21T00:30:28', '2'), - ('272', '971', '2006-02-16T02:30:53', '2005-06-19T02:39:39', '2005-06-23T03:56:39', '2'), - ('209', '844', '2006-02-16T02:30:53', '2005-07-29T19:22:37', '2005-08-07T15:36:37', '2'), - ('242', '3408', '2006-02-16T02:30:53', '2005-08-01T06:12:19', '2005-08-04T12:11:19', '2'), - ('209', '931', '2006-02-16T02:30:53', '2005-07-11T12:36:43', '2005-07-17T17:45:43', '2'), - ('423', '3089', '2006-02-16T02:30:53', '2005-07-28T18:08:02', '2005-08-04T14:33:02', '2'), - ('227', '3987', '2006-02-16T02:30:53', '2005-07-07T23:48:52', '2005-07-13T19:37:52', '2'), - ('448', '2524', '2006-02-16T02:30:53', '2005-08-19T16:47:55', '2005-08-26T16:54:55', '2'), - ('146', '61', '2006-02-16T02:30:53', '2005-06-16T15:15:43', '2005-06-23T10:14:43', '2'), - ('62', '120', '2006-02-16T02:30:53', '2005-06-20T11:13:01', '2005-06-28T16:15:01', '2'), - ('360', '2745', '2006-02-16T02:30:53', '2005-08-19T00:21:52', '2005-08-22T22:13:52', '2'), - ('304', '2826', '2006-02-16T02:30:53', '2005-08-18T14:17:30', '2005-08-26T15:33:30', '2'), - ('89', '600', '2006-02-16T02:30:53', '2005-05-29T08:30:36', '2005-06-04T12:47:36', '2'), - ('495', '3853', '2006-02-16T02:30:53', '2005-08-01T15:48:33', '2005-08-06T20:24:33', '2'), - ('147', '2132', '2006-02-16T02:30:53', '2005-07-08T16:29:38', '2005-07-10T16:31:38', '2'), - ('297', '713', '2006-02-16T02:30:53', '2005-07-28T10:08:54', '2005-07-30T10:26:54', '2'), - ('494', '264', '2006-02-16T02:30:53', '2005-08-22T11:21:08', '2005-08-30T08:18:08', '2'), - ('312', '3638', '2006-02-16T02:30:53', '2005-08-19T05:51:46', '2005-08-23T11:22:46', '2'), - ('18', '1629', '2006-02-16T02:30:53', '2005-06-17T19:52:42', '2005-06-25T00:00:42', '2'), - ('526', '3869', '2006-02-16T02:30:53', '2005-08-23T22:21:03', '2005-08-31T03:09:03', '2'), - ('523', '3207', '2006-02-16T02:30:53', '2005-08-22T09:41:09', '2005-08-23T12:49:09', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['14138', '6387', '12877', '15356', '10355', '6748', '14454', '6626', '12310', '1593', '4214', '1510', '12468', '6022', '12140', '6470', '13971', '201', '7681', '261', '937', '6859', '6308', '14347', '12739', '6764', '8879', '7035', '12514', '13461', '8550', '2518', '896', '144', '5971', '3061', '8315', '10386', '9259', '13525', '7372', '7736', '12974', '598', '995', '5313', '2234', '5982', '12943', '13501', '14028', '6960', '12568', '7390', '4948', '10571', '14325', '8660', '12673', '13812', '11750', '7405', '13941', '5510', '3395', '7103', '5860', '1827', '13850', '13923', '6682', '14937', '10774', '10703', '1680', '7896', '3051', '9824', '1744', '13119', '11999', '3091', '10563', '8769', '39', '5732', '10403', '2009', '6265', '1818', '11123', '11285', '2879', '7642', '576', '12616', '11649', '1015', '1424', '6999']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('121', '1238', '2006-02-16T02:30:53', '2005-08-21T01:59:37', '2005-08-30T01:17:37', '2'), - ('384', '1726', '2006-02-16T02:30:53', '2005-07-11T22:15:56', '2005-07-14T20:20:56', '2'), - ('40', '1016', '2006-02-16T02:30:53', '2005-08-19T03:16:58', '2005-08-25T02:10:58', '2'), - ('539', '4507', '2006-02-16T02:30:53', '2005-08-22T21:24:19', '2005-08-25T22:32:19', '2'), - ('161', '2158', '2006-02-16T02:30:53', '2005-08-01T05:47:37', '2005-08-02T09:28:37', '2'), - ('540', '3655', '2006-02-16T02:30:53', '2005-07-12T14:39:27', '2005-07-18T13:40:27', '2'), - ('150', '2475', '2006-02-16T02:30:53', '2005-08-21T12:35:49', '2005-08-22T16:28:49', '2'), - ('269', '2418', '2006-02-16T02:30:53', '2005-07-12T09:16:24', '2005-07-17T04:06:24', '2'), - ('385', '3814', '2006-02-16T02:30:53', '2005-08-18T06:02:34', '2005-08-24T01:08:34', '2'), - ('111', '766', '2006-02-16T02:30:53', '2005-06-16T05:14:52', '2005-06-24T08:00:52', '2'), - ('484', '2534', '2006-02-16T02:30:53', '2005-07-07T11:54:33', '2005-07-08T10:49:33', '2'), - ('338', '989', '2006-02-16T02:30:53', '2005-06-15T22:39:34', '2005-06-24T19:21:34', '2'), - ('80', '1689', '2006-02-16T02:30:53', '2005-08-18T11:41:47', '2005-08-24T16:43:47', '2'), - ('469', '2435', '2006-02-16T02:30:53', '2005-07-11T02:15:53', '2005-07-13T03:40:53', '2'), - ('408', '322', '2006-02-16T02:30:53', '2005-08-17T23:57:55', '2005-08-21T20:09:55', '2'), - ('240', '1680', '2006-02-16T02:30:53', '2005-07-12T01:29:41', '2005-07-15T21:33:41', '2'), - ('64', '1678', '2006-02-16T02:30:53', '2005-08-20T18:44:53', '2005-08-22T16:25:53', '2'), - ('444', '776', '2006-02-16T02:30:53', '2005-05-26T07:13:45', '2005-06-04T02:02:45', '2'), - ('432', '1176', '2006-02-16T02:30:53', '2005-07-28T03:07:09', '2005-07-29T08:30:09', '2'), - ('414', '1369', '2006-02-16T02:30:53', '2005-05-26T15:44:23', '2005-06-02T09:47:23', '2'), - ('304', '1054', '2006-02-16T02:30:53', '2005-05-30T14:47:31', '2005-06-05T09:53:31', '2'), - ('321', '4108', '2006-02-16T02:30:53', '2005-07-12T19:53:57', '2005-07-17T19:48:57', '2'), - ('472', '3155', '2006-02-16T02:30:53', '2005-07-11T18:08:41', '2005-07-19T15:48:41', '2'), - ('214', '3862', '2006-02-16T02:30:53', '2005-08-21T08:42:31', '2005-08-25T07:11:31', '2'), - ('292', '4129', '2006-02-16T02:30:53', '2005-08-18T22:15:18', '2005-08-27T00:37:18', '2'), - ('396', '4407', '2006-02-16T02:30:53', '2005-07-12T15:29:27', '2005-07-21T20:00:27', '2'), - ('584', '2956', '2006-02-16T02:30:53', '2005-07-30T00:16:02', '2005-08-06T20:10:02', '2'), - ('90', '2439', '2006-02-16T02:30:53', '2005-07-27T03:06:09', '2005-08-02T21:59:09', '2'), - ('400', '3310', '2006-02-16T02:30:53', '2005-08-18T13:33:55', '2005-08-23T12:50:55', '2'), - ('421', '2621', '2006-02-16T02:30:53', '2005-08-20T00:49:04', '2005-08-28T02:49:04', '2'), - ('70', '1340', '2006-02-16T02:30:53', '2005-07-29T11:12:37', '2005-07-30T15:05:37', '2'), - ('86', '3503', '2006-02-16T02:30:53', '2005-06-19T00:16:23', '2005-06-25T19:28:23', '2'), - ('207', '2817', '2006-02-16T02:30:53', '2005-05-30T09:03:52', '2005-06-05T07:37:52', '2'), - ('357', '1689', '2006-02-16T02:30:53', '2005-05-25T23:49:56', '2005-06-01T21:41:56', '2'), - ('84', '2191', '2006-02-16T02:30:53', '2005-07-11T00:05:58', '2005-07-19T04:50:58', '2'), - ('330', '4202', '2006-02-16T02:30:53', '2005-06-20T13:48:21', '2005-06-22T17:36:21', '2'), - ('135', '1420', '2006-02-16T02:30:53', '2005-07-29T03:37:07', '2005-07-29T23:22:07', '2'), - ('26', '1568', '2006-02-16T02:30:53', '2005-08-01T06:42:20', '2005-08-07T06:12:20', '2'), - ('138', '97', '2006-02-16T02:30:53', '2005-07-30T14:37:44', '2005-08-06T18:05:44', '2'), - ('111', '3514', '2006-02-16T02:30:53', '2005-08-20T02:50:44', '2005-08-26T22:58:44', '2'), - ('584', '3202', '2006-02-16T02:30:53', '2005-07-27T15:18:42', '2005-08-01T15:18:42', '2'), - ('205', '4466', '2006-02-16T02:30:53', '2005-07-28T05:12:04', '2005-08-05T02:28:04', '2'), - ('218', '3599', '2006-02-16T02:30:53', '2005-08-19T06:51:02', '2005-08-25T11:48:02', '2'), - ('159', '599', '2006-02-16T02:30:53', '2005-05-28T14:04:50', '2005-06-03T18:00:50', '2'), - ('150', '17', '2006-02-16T02:30:53', '2005-05-31T00:06:02', '2005-06-06T02:30:02', '2'), - ('52', '1885', '2006-02-16T02:30:53', '2005-07-09T16:04:45', '2005-07-17T18:53:45', '2'), - ('182', '234', '2006-02-16T02:30:53', '2005-06-18T04:01:28', '2005-06-24T04:55:28', '2'), - ('403', '2329', '2006-02-16T02:30:53', '2005-07-11T00:24:44', '2005-07-14T04:42:44', '2'), - ('547', '3930', '2006-02-16T02:30:53', '2005-08-19T05:46:26', '2005-08-22T03:26:26', '2'), - ('390', '4369', '2006-02-16T02:30:53', '2005-08-20T01:56:20', '2005-08-22T23:07:20', '2'), - ('158', '4061', '2006-02-16T02:30:53', '2005-08-20T21:23:03', '2005-08-25T17:29:03', '2'), - ('421', '192', '2006-02-16T02:30:53', '2005-07-27T00:08:33', '2005-08-03T20:58:33', '2'), - ('569', '2654', '2006-02-16T02:30:53', '2005-08-18T15:15:44', '2005-08-22T19:32:44', '2'), - ('230', '1723', '2006-02-16T02:30:53', '2005-07-27T15:59:19', '2005-08-04T10:09:19', '2'), - ('518', '2972', '2006-02-16T02:30:53', '2005-07-08T22:54:21', '2005-07-17T03:52:21', '2'), - ('308', '3660', '2006-02-16T02:30:53', '2005-08-01T13:25:30', '2005-08-02T16:43:30', '2'), - ('313', '4432', '2006-02-16T02:30:53', '2005-08-21T08:15:38', '2005-08-23T08:08:38', '2'), - ('566', '3122', '2006-02-16T02:30:53', '2005-07-29T15:26:59', '2005-08-05T21:04:59', '2'), - ('535', '4204', '2006-02-16T02:30:53', '2005-08-18T19:21:56', '2005-08-26T22:44:56', '2'), - ('122', '2788', '2006-02-16T02:30:53', '2005-08-20T13:01:43', '2005-08-22T16:32:43', '2'), - ('190', '665', '2006-02-16T02:30:53', '2005-08-17T09:07:00', '2005-08-23T08:16:00', '2'), - ('42', '2312', '2006-02-16T02:30:53', '2005-07-27T16:25:11', '2005-08-01T12:33:11', '2'), - ('476', '2727', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('67', '1298', '2006-02-16T02:30:53', '2005-07-10T00:58:37', '2005-07-17T22:02:37', '2'), - ('66', '3764', '2006-02-16T02:30:53', '2005-06-21T15:19:19', '2005-06-29T14:23:19', '2'), - ('403', '1697', '2006-02-16T02:30:53', '2005-07-27T05:08:59', '2005-07-29T03:42:59', '2'), - ('180', '3897', '2006-02-16T02:30:53', '2005-07-10T18:08:49', '2005-07-16T16:43:49', '2'), - ('423', '3804', '2006-02-16T02:30:53', '2005-06-16T21:54:40', '2005-06-19T21:28:40', '2'), - ('546', '3030', '2006-02-16T02:30:53', '2005-08-20T14:43:03', '2005-08-27T11:41:03', '2'), - ('588', '3129', '2006-02-16T02:30:53', '2005-08-20T17:05:02', '2005-08-27T11:22:02', '2'), - ('339', '1984', '2006-02-16T02:30:53', '2005-07-12T12:12:43', '2005-07-21T10:49:43', '2'), - ('348', '1241', '2006-02-16T02:30:53', '2005-08-22T05:51:59', '2005-08-31T01:45:59', '2'), - ('407', '4231', '2006-02-16T02:30:53', '2005-08-01T20:54:33', '2005-08-08T20:59:33', '2'), - ('181', '1818', '2006-02-16T02:30:53', '2005-08-01T18:37:39', '2005-08-07T23:50:39', '2'), - ('469', '4441', '2006-02-16T02:30:53', '2005-06-16T11:17:22', '2005-06-25T15:55:22', '2'), - ('389', '3561', '2006-02-16T02:30:53', '2005-07-28T11:00:58', '2005-08-04T14:30:58', '2'), - ('65', '1408', '2006-02-16T02:30:53', '2005-06-20T13:06:52', '2005-06-25T13:03:52', '2'), - ('404', '4368', '2006-02-16T02:30:53', '2005-07-31T11:49:55', '2005-08-07T16:54:55', '2'), - ('230', '3075', '2006-02-16T02:30:53', '2005-06-16T16:39:58', '2005-06-18T19:50:58', '2'), - ('240', '1401', '2006-02-16T02:30:53', '2005-08-19T11:44:59', '2005-08-20T12:30:59', '2'), - ('125', '4333', '2006-02-16T02:30:53', '2005-08-17T18:47:07', '2005-08-20T23:26:07', '2'), - ('383', '854', '2006-02-16T02:30:53', '2005-06-20T16:02:59', '2005-06-22T21:30:59', '2'), - ('214', '1885', '2006-02-16T02:30:53', '2005-08-01T13:06:03', '2005-08-09T08:39:03', '2'), - ('588', '2180', '2006-02-16T02:30:53', '2005-07-29T19:45:33', '2005-08-05T22:09:33', '2'), - ('207', '4466', '2006-02-16T02:30:53', '2005-05-25T04:51:46', '2005-05-31T03:14:46', '2'), - ('597', '2833', '2006-02-16T02:30:53', '2005-07-10T11:36:32', '2005-07-12T13:09:32', '2'), - ('494', '1968', '2006-02-16T02:30:53', '2005-08-01T07:30:45', '2005-08-03T03:03:45', '2'), - ('119', '1902', '2006-02-16T02:30:53', '2005-06-17T11:48:31', '2005-06-18T09:34:31', '2'), - ('477', '3931', '2006-02-16T02:30:53', '2005-07-11T15:43:51', '2005-07-12T12:51:51', '2'), - ('63', '1218', '2006-02-16T02:30:53', '2005-06-16T21:30:34', '2005-06-20T03:27:34', '2'), - ('150', '1926', '2006-02-16T02:30:53', '2005-08-02T08:54:17', '2005-08-09T11:11:17', '2'), - ('585', '3849', '2006-02-16T02:30:53', '2005-08-02T14:44:02', '2005-08-11T16:45:02', '2'), - ('583', '1920', '2006-02-16T02:30:53', '2005-06-20T01:24:10', '2005-06-28T20:12:10', '2'), - ('523', '3995', '2006-02-16T02:30:53', '2005-07-28T01:16:51', '2005-08-02T00:45:51', '2'), - ('588', '1866', '2006-02-16T02:30:53', '2005-05-28T10:56:10', '2005-06-04T13:15:10', '2'), - ('476', '2952', '2006-02-16T02:30:53', '2005-08-18T17:22:41', '2005-08-25T18:52:41', '2'), - ('217', '3222', '2006-02-16T02:30:53', '2005-08-17T04:59:26', '2005-08-20T04:02:26', '2'), - ('526', '3702', '2006-02-16T02:30:53', '2005-05-31T02:44:57', '2005-06-07T23:01:57', '2'), - ('224', '887', '2006-02-16T02:30:53', '2005-06-15T18:08:14', '2005-06-24T23:16:14', '2'), - ('224', '12', '2006-02-16T02:30:53', '2005-07-27T01:21:19', '2005-07-29T20:33:19', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['14460', '5206', '10829', '12403', '15546', '10847', '9074', '8955', '4835', '11306', '11', '6733', '4378', '4534', '3261', '3321', '9366', '15577', '11286', '13003', '1078', '10120', '1705', '6206', '11846', '9722', '1335', '13271', '1251', '6348', '15032', '13606', '14224', '5289', '5294', '13700', '11096', '8625', '4451', '15333', '9986', '13167', '1543', '11025', '2045', '9157', '9396', '5649', '13557', '325', '2291', '4955', '6462', '11962', '12067', '13410', '1038', '4244', '4526', '4550', '671', '6005', '243', '2461', '12954', '5286', '6948', '8592', '1370', '5907', '13575', '11672', '50', '3085', '4644', '246', '15790', '15407', '1993', '12195', '9260', '14736', '996', '15491', '11010', '6032', '6903', '3175', '1821', '11395', '11236', '537', '3500', '10148', '6144', '5310', '2102', '9373', '11198', '9601']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('120', '4137', '2006-02-16T02:30:53', '2005-08-21T12:48:48', '2005-08-30T16:34:48', '2'), - ('517', '692', '2006-02-16T02:30:53', '2005-07-09T11:11:01', '2005-07-17T07:23:01', '2'), - ('554', '168', '2006-02-16T02:30:53', '2005-08-01T23:17:06', '2005-08-09T17:22:06', '2'), - ('440', '2124', '2006-02-16T02:30:53', '2005-08-18T09:31:05', '2005-08-23T09:54:05', '2'), - ('223', '2087', '2006-02-16T02:30:53', '2005-08-23T04:20:38', '2005-09-01T09:57:38', '2'), - ('280', '1200', '2006-02-16T02:30:53', '2005-08-01T23:49:33', '2005-08-10T05:37:33', '2'), - ('84', '3244', '2006-02-16T02:30:53', '2005-07-30T07:50:10', '2005-08-01T11:21:10', '2'), - ('405', '4532', '2006-02-16T02:30:53', '2005-07-30T03:28:27', '2005-08-04T04:56:27', '2'), - ('95', '2499', '2006-02-16T02:30:53', '2005-07-08T18:08:13', '2005-07-17T16:51:13', '2'), - ('247', '13', '2006-02-16T02:30:53', '2005-08-02T15:45:10', '2005-08-03T21:14:10', '2'), - ('142', '4443', '2006-02-16T02:30:53', '2005-05-25T00:09:02', '2005-06-02T20:56:02', '2'), - ('585', '1476', '2006-02-16T02:30:53', '2005-07-12T14:04:01', '2005-07-21T18:57:01', '2'), - ('24', '1244', '2006-02-16T02:30:53', '2005-07-07T20:29:08', '2005-07-12T19:17:08', '2'), - ('132', '2518', '2006-02-16T02:30:53', '2005-07-08T03:36:55', '2005-07-16T00:49:55', '2'), - ('169', '2029', '2006-02-16T02:30:53', '2005-06-21T04:07:41', '2005-06-24T06:25:41', '2'), - ('144', '1750', '2006-02-16T02:30:53', '2005-06-21T08:33:26', '2005-06-24T10:09:26', '2'), - ('557', '4013', '2006-02-16T02:30:53', '2005-07-30T18:48:57', '2005-08-03T15:17:57', '2'), - ('29', '539', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('207', '1319', '2006-02-16T02:30:53', '2005-08-02T14:44:22', '2005-08-10T09:01:22', '2'), - ('451', '3431', '2006-02-16T02:30:53', '2005-08-19T07:39:29', '2005-08-23T05:48:29', '2'), - ('230', '3682', '2006-02-16T02:30:53', '2005-05-31T10:28:33', '2005-06-03T14:45:33', '2'), - ('396', '1709', '2006-02-16T02:30:53', '2005-07-31T21:24:24', '2005-08-03T17:44:24', '2'), - ('564', '123', '2006-02-16T02:30:53', '2005-06-16T13:59:42', '2005-06-18T19:54:42', '2'), - ('459', '1368', '2006-02-16T02:30:53', '2005-07-11T12:32:14', '2005-07-15T15:01:14', '2'), - ('283', '3306', '2006-02-16T02:30:53', '2005-08-17T13:18:29', '2005-08-22T18:05:29', '2'), - ('125', '4260', '2006-02-16T02:30:53', '2005-07-31T08:29:48', '2005-08-07T07:52:48', '2'), - ('64', '1713', '2006-02-16T02:30:53', '2005-06-15T11:51:30', '2005-06-16T16:42:30', '2'), - ('242', '3872', '2006-02-16T02:30:53', '2005-08-19T17:42:06', '2005-08-27T18:39:06', '2'), - ('442', '3307', '2006-02-16T02:30:53', '2005-06-15T05:58:55', '2005-06-23T02:45:55', '2'), - ('66', '21', '2006-02-16T02:30:53', '2005-07-11T20:21:18', '2005-07-19T15:56:18', '2'), - ('467', '3414', '2006-02-16T02:30:53', '2005-08-22T09:14:09', '2005-08-25T09:50:09', '2'), - ('146', '83', '2006-02-16T02:30:53', '2005-08-20T06:07:01', '2005-08-27T04:59:01', '2'), - ('323', '3634', '2006-02-16T02:30:53', '2005-08-21T04:53:08', '2005-08-27T04:12:08', '2'), - ('30', '4336', '2006-02-16T02:30:53', '2005-07-09T15:14:08', '2005-07-12T12:51:08', '2'), - ('22', '3237', '2006-02-16T02:30:53', '2005-07-09T15:23:42', '2005-07-15T15:28:42', '2'), - ('265', '4229', '2006-02-16T02:30:53', '2005-08-20T09:26:17', '2005-08-27T05:49:17', '2'), - ('34', '1436', '2006-02-16T02:30:53', '2005-08-02T08:05:19', '2005-08-04T07:28:19', '2'), - ('410', '884', '2006-02-16T02:30:53', '2005-07-29T13:59:13', '2005-08-07T17:56:13', '2'), - ('85', '179', '2006-02-16T02:30:53', '2005-07-07T23:29:54', '2005-07-10T23:29:54', '2'), - ('142', '1839', '2006-02-16T02:30:53', '2005-08-22T20:44:06', '2005-08-29T22:34:06', '2'), - ('124', '1242', '2006-02-16T02:30:53', '2005-07-31T17:16:50', '2005-08-05T18:34:50', '2'), - ('120', '557', '2006-02-16T02:30:53', '2005-08-19T13:36:41', '2005-08-23T15:29:41', '2'), - ('28', '1188', '2006-02-16T02:30:53', '2005-06-16T01:24:08', '2005-06-18T06:24:08', '2'), - ('419', '2253', '2006-02-16T02:30:53', '2005-08-02T05:39:12', '2005-08-08T00:09:12', '2'), - ('391', '561', '2006-02-16T02:30:53', '2005-06-17T14:38:11', '2005-06-26T13:44:11', '2'), - ('19', '146', '2006-02-16T02:30:53', '2005-07-30T11:06:23', '2005-08-05T05:29:23', '2'), - ('91', '1250', '2006-02-16T02:30:53', '2005-07-30T20:07:24', '2005-08-03T21:20:24', '2'), - ('336', '1349', '2006-02-16T02:30:53', '2005-07-10T07:15:07', '2005-07-12T11:57:07', '2'), - ('23', '2290', '2006-02-16T02:30:53', '2005-08-20T04:12:41', '2005-08-21T02:33:41', '2'), - ('449', '2510', '2006-02-16T02:30:53', '2005-05-27T01:09:55', '2005-05-31T07:01:55', '2'), - ('436', '3949', '2006-02-16T02:30:53', '2005-06-18T07:36:46', '2005-06-26T04:57:46', '2'), - ('225', '1103', '2006-02-16T02:30:53', '2005-07-08T23:16:21', '2005-07-14T02:09:21', '2'), - ('414', '4534', '2006-02-16T02:30:53', '2005-07-12T01:15:24', '2005-07-19T05:11:24', '2'), - ('29', '4384', '2006-02-16T02:30:53', '2005-08-17T17:34:38', '2005-08-21T12:59:38', '2'), - ('514', '2013', '2006-02-16T02:30:53', '2005-08-17T21:36:47', '2005-08-22T01:10:47', '2'), - ('104', '1421', '2006-02-16T02:30:53', '2005-08-19T22:41:44', '2005-08-26T18:05:44', '2'), - ('385', '1253', '2006-02-16T02:30:53', '2005-05-31T05:23:47', '2005-06-02T03:57:47', '2'), - ('581', '592', '2006-02-16T02:30:53', '2005-07-07T13:41:58', '2005-07-09T15:32:58', '2'), - ('1', '1443', '2006-02-16T02:30:53', '2005-07-08T03:17:05', '2005-07-14T01:19:05', '2'), - ('409', '615', '2006-02-16T02:30:53', '2005-07-08T04:34:00', '2005-07-14T23:45:00', '2'), - ('14', '1027', '2006-02-16T02:30:53', '2005-05-28T22:04:30', '2005-06-03T01:21:30', '2'), - ('78', '809', '2006-02-16T02:30:53', '2005-07-11T01:36:42', '2005-07-14T04:47:42', '2'), - ('543', '1721', '2006-02-16T02:30:53', '2005-05-26T13:06:05', '2005-06-03T17:28:05', '2'), - ('343', '78', '2006-02-16T02:30:53', '2005-06-18T19:58:12', '2005-06-28T01:35:12', '2'), - ('63', '3592', '2006-02-16T02:30:53', '2005-08-19T06:04:34', '2005-08-28T02:12:34', '2'), - ('498', '483', '2006-02-16T02:30:53', '2005-07-09T15:11:41', '2005-07-10T19:19:41', '2'), - ('228', '3088', '2006-02-16T02:30:53', '2005-07-26T23:43:49', '2005-07-27T21:24:49', '2'), - ('271', '1952', '2006-02-16T02:30:53', '2005-07-29T12:33:58', '2005-08-04T07:14:58', '2'), - ('396', '644', '2006-02-16T02:30:53', '2005-06-15T14:31:05', '2005-06-22T19:23:05', '2'), - ('168', '4432', '2006-02-16T02:30:53', '2005-07-10T20:41:41', '2005-07-15T21:18:41', '2'), - ('339', '2729', '2006-02-16T02:30:53', '2005-08-20T05:15:20', '2005-08-28T07:36:20', '2'), - ('521', '3947', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('18', '1983', '2006-02-16T02:30:53', '2005-05-25T06:44:53', '2005-05-28T11:28:53', '2'), - ('166', '4282', '2006-02-16T02:30:53', '2005-06-20T15:42:33', '2005-06-21T16:51:33', '2'), - ('38', '3239', '2006-02-16T02:30:53', '2005-07-08T09:14:29', '2005-07-10T07:20:29', '2'), - ('240', '2829', '2006-02-16T02:30:53', '2005-05-26T13:57:07', '2005-05-29T10:12:07', '2'), - ('233', '2887', '2006-02-16T02:30:53', '2005-08-23T14:01:07', '2005-08-30T10:32:07', '2'), - ('42', '3330', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('234', '168', '2006-02-16T02:30:53', '2005-06-17T10:59:24', '2005-06-23T07:30:24', '2'), - ('347', '943', '2006-02-16T02:30:53', '2005-08-18T02:07:49', '2005-08-19T23:54:49', '2'), - ('13', '3969', '2006-02-16T02:30:53', '2005-07-30T14:38:22', '2005-08-07T18:47:22', '2'), - ('139', '207', '2006-02-16T02:30:53', '2005-08-21T22:25:53', '2005-08-25T19:01:53', '2'), - ('331', '2075', '2006-02-16T02:30:53', '2005-05-31T00:06:20', '2005-05-31T21:29:20', '2'), - ('28', '2059', '2006-02-16T02:30:53', '2005-08-23T02:08:40', '2005-08-23T20:23:40', '2'), - ('326', '869', '2006-02-16T02:30:53', '2005-08-02T05:06:27', '2005-08-03T23:47:27', '2'), - ('28', '3792', '2006-02-16T02:30:53', '2005-07-11T02:49:01', '2005-07-18T05:05:01', '2'), - ('517', '3690', '2006-02-16T02:30:53', '2005-07-12T21:58:15', '2005-07-14T01:38:15', '2'), - ('249', '4093', '2006-02-16T02:30:53', '2005-06-20T22:30:23', '2005-06-30T03:28:23', '2'), - ('468', '3207', '2006-02-16T02:30:53', '2005-06-16T21:42:49', '2005-06-20T16:25:49', '2'), - ('225', '4234', '2006-02-16T02:30:53', '2005-08-02T18:47:44', '2005-08-10T17:07:44', '2'), - ('420', '145', '2006-02-16T02:30:53', '2005-08-02T13:17:21', '2005-08-09T09:53:21', '2'), - ('315', '3095', '2006-02-16T02:30:53', '2005-05-28T06:20:55', '2005-06-05T11:48:55', '2'), - ('32', '2447', '2006-02-16T02:30:53', '2005-07-06T00:11:13', '2005-07-13T19:01:13', '2'), - ('63', '1381', '2006-02-16T02:30:53', '2005-07-31T22:19:16', '2005-08-05T00:15:16', '2'), - ('554', '1077', '2006-02-16T02:30:53', '2005-07-11T09:02:53', '2005-07-15T10:58:53', '2'), - ('24', '1565', '2006-02-16T02:30:53', '2005-07-09T16:00:34', '2005-07-12T12:45:34', '2'), - ('486', '2316', '2006-02-16T02:30:53', '2005-06-17T19:05:22', '2005-06-23T23:21:22', '2'), - ('180', '3478', '2006-02-16T02:30:53', '2005-07-30T19:05:36', '2005-08-05T16:16:36', '2'), - ('540', '2908', '2006-02-16T02:30:53', '2005-08-02T11:45:15', '2005-08-10T11:42:15', '2'), - ('553', '1592', '2006-02-16T02:30:53', '2005-07-31T03:42:17', '2005-08-04T02:02:17', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['10407', '15805', '7349', '15099', '12221', '433', '12858', '6894', '43', '11542', '12542', '13367', '8933', '628', '4714', '10582', '14278', '12859', '13698', '13915', '5111', '6766', '3018', '5498', '9465', '11653', '6094', '5839', '12281', '15387', '1150', '8037', '1316', '7369', '14921', '15590', '14495', '5722', '1950', '3075', '10814', '10187', '8464', '655', '11188', '10117', '3362', '1958', '8923', '15625', '626', '12479', '9266', '11627', '12472', '11958', '2951', '7247', '1971', '9385', '8527', '10990', '9589', '1863', '11919', '9073', '9473', '15916', '1141', '7451', '1887', '3312', '7177', '5625', '5616', '15717', '7569', '9168', '5043', '11974', '7306', '14788', '6568', '12344', '5317', '11558', '9344', '8391', '11569', '12240', '11109', '3932', '10176', '15235', '12818', '4251', '15993', '8465', '2671', '8430']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('101', '543', '2006-02-16T02:30:53', '2005-08-01T07:38:07', '2005-08-02T05:38:07', '2'), - ('8', '4511', '2006-02-16T02:30:53', '2005-08-23T14:31:19', '2005-08-25T19:01:19', '2'), - ('195', '861', '2006-02-16T02:30:53', '2005-07-27T14:33:00', '2005-08-01T15:01:00', '2'), - ('86', '1940', '2006-02-16T02:30:53', '2005-08-22T11:49:16', '2005-08-26T06:38:16', '2'), - ('98', '2488', '2006-02-16T02:30:53', '2005-08-18T02:50:51', '2005-08-27T06:22:51', '2'), - ('574', '4364', '2006-02-16T02:30:53', '2005-05-27T16:40:40', '2005-05-30T19:55:40', '2'), - ('144', '3024', '2006-02-16T02:30:53', '2005-08-19T02:22:16', '2005-08-26T07:25:16', '2'), - ('315', '1347', '2006-02-16T02:30:53', '2005-07-12T21:20:50', '2005-07-20T23:42:50', '2'), - ('532', '2578', '2006-02-16T02:30:53', '2005-05-25T05:39:25', '2005-05-26T06:54:25', '2'), - ('7', '2155', '2006-02-16T02:30:53', '2005-08-17T00:51:32', '2005-08-24T20:29:32', '2'), - ('230', '1920', '2006-02-16T02:30:53', '2005-08-18T14:21:11', '2005-08-20T16:06:11', '2'), - ('290', '4569', '2006-02-16T02:30:53', '2005-08-19T21:19:27', '2005-08-24T15:22:27', '2'), - ('260', '1664', '2006-02-16T02:30:53', '2005-07-30T02:36:06', '2005-08-02T23:37:06', '2'), - ('173', '2513', '2006-02-16T02:30:53', '2005-05-28T17:05:46', '2005-06-06T16:29:46', '2'), - ('385', '1932', '2006-02-16T02:30:53', '2005-07-08T12:12:48', '2005-07-17T08:43:48', '2'), - ('233', '2536', '2006-02-16T02:30:53', '2005-08-01T13:54:22', '2005-08-05T16:46:22', '2'), - ('557', '2334', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('139', '2289', '2006-02-16T02:30:53', '2005-08-19T02:23:23', '2005-08-28T04:55:23', '2'), - ('364', '3829', '2006-02-16T02:30:53', '2005-08-20T09:24:26', '2005-08-22T05:04:26', '2'), - ('129', '1180', '2006-02-16T02:30:53', '2005-08-20T16:42:53', '2005-08-23T20:30:53', '2'), - ('12', '2875', '2006-02-16T02:30:53', '2005-07-09T07:02:19', '2005-07-10T06:27:19', '2'), - ('171', '3615', '2006-02-16T02:30:53', '2005-07-12T15:32:01', '2005-07-18T14:03:01', '2'), - ('112', '4150', '2006-02-16T02:30:53', '2005-06-20T11:10:35', '2005-06-25T07:17:35', '2'), - ('302', '63', '2006-02-16T02:30:53', '2005-07-10T00:27:21', '2005-07-13T20:11:21', '2'), - ('2', '3084', '2006-02-16T02:30:53', '2005-07-30T22:39:53', '2005-08-06T16:43:53', '2'), - ('358', '4475', '2006-02-16T02:30:53', '2005-08-17T05:06:10', '2005-08-24T03:09:10', '2'), - ('285', '2684', '2006-02-16T02:30:53', '2005-07-11T05:54:42', '2005-07-18T08:19:42', '2'), - ('367', '252', '2006-02-16T02:30:53', '2005-07-10T17:08:30', '2005-07-13T21:21:30', '2'), - ('417', '4576', '2006-02-16T02:30:53', '2005-08-18T04:50:32', '2005-08-21T00:14:32', '2'), - ('323', '3879', '2006-02-16T02:30:53', '2005-08-22T22:49:13', '2005-08-29T01:49:13', '2'), - ('136', '1632', '2006-02-16T02:30:53', '2005-05-31T21:20:09', '2005-06-03T19:15:09', '2'), - ('409', '3973', '2006-02-16T02:30:53', '2005-07-28T16:31:20', '2005-07-31T12:18:20', '2'), - ('138', '3891', '2006-02-16T02:30:53', '2005-06-15T10:26:23', '2005-06-21T09:25:23', '2'), - ('139', '3889', '2006-02-16T02:30:53', '2005-07-27T15:07:58', '2005-07-30T09:16:58', '2'), - ('284', '3724', '2006-02-16T02:30:53', '2005-08-22T05:12:24', '2005-08-26T08:20:24', '2'), - ('599', '4048', '2006-02-16T02:30:53', '2005-08-23T06:09:44', '2005-09-01T06:53:44', '2'), - ('429', '3215', '2006-02-16T02:30:53', '2005-08-21T14:04:39', '2005-08-22T16:53:39', '2'), - ('556', '2890', '2006-02-16T02:30:53', '2005-07-10T11:10:04', '2005-07-12T16:31:04', '2'), - ('594', '723', '2006-02-16T02:30:53', '2005-06-17T08:26:52', '2005-06-22T08:08:52', '2'), - ('161', '4346', '2006-02-16T02:30:53', '2005-06-20T14:52:19', '2005-06-28T18:48:19', '2'), - ('49', '2758', '2006-02-16T02:30:53', '2005-08-01T22:43:12', '2005-08-05T02:35:12', '2'), - ('400', '1629', '2006-02-16T02:30:53', '2005-08-01T00:15:49', '2005-08-05T01:00:49', '2'), - ('28', '2343', '2006-02-16T02:30:53', '2005-07-29T08:18:20', '2005-08-03T04:50:20', '2'), - ('287', '331', '2006-02-16T02:30:53', '2005-05-28T20:16:20', '2005-05-31T16:46:20', '2'), - ('485', '1372', '2006-02-16T02:30:53', '2005-08-02T11:17:11', '2005-08-08T16:46:11', '2'), - ('459', '1894', '2006-02-16T02:30:53', '2005-07-31T21:14:31', '2005-08-01T15:59:31', '2'), - ('454', '1284', '2006-02-16T02:30:53', '2005-06-21T12:19:54', '2005-06-23T06:59:54', '2'), - ('581', '1843', '2006-02-16T02:30:53', '2005-06-17T08:52:01', '2005-06-23T07:55:01', '2'), - ('446', '2425', '2006-02-16T02:30:53', '2005-07-30T02:08:49', '2005-08-03T23:45:49', '2'), - ('207', '4200', '2006-02-16T02:30:53', '2005-08-23T07:25:29', '2005-08-27T13:17:29', '2'), - ('584', '452', '2006-02-16T02:30:53', '2005-05-28T16:58:09', '2005-06-01T14:02:09', '2'), - ('401', '1119', '2006-02-16T02:30:53', '2005-08-18T12:26:37', '2005-08-21T18:08:37', '2'), - ('364', '1705', '2006-02-16T02:30:53', '2005-07-30T14:59:01', '2005-07-31T17:01:01', '2'), - ('168', '3945', '2006-02-16T02:30:53', '2005-08-17T04:25:47', '2005-08-26T02:54:47', '2'), - ('297', '4458', '2006-02-16T02:30:53', '2005-08-18T11:58:48', '2005-08-27T16:37:48', '2'), - ('217', '2061', '2006-02-16T02:30:53', '2005-08-17T17:23:20', '2005-08-24T14:47:20', '2'), - ('404', '2903', '2006-02-16T02:30:53', '2005-06-20T06:23:01', '2005-06-24T00:26:01', '2'), - ('102', '1445', '2006-02-16T02:30:53', '2005-07-27T10:32:58', '2005-07-29T05:00:58', '2'), - ('357', '2870', '2006-02-16T02:30:53', '2005-06-17T09:23:59', '2005-06-25T13:20:59', '2'), - ('570', '3453', '2006-02-16T02:30:53', '2005-07-30T19:25:49', '2005-08-08T17:08:49', '2'), - ('168', '709', '2006-02-16T02:30:53', '2005-07-29T10:21:00', '2005-08-05T16:05:00', '2'), - ('111', '262', '2006-02-16T02:30:53', '2005-08-02T04:41:06', '2005-08-10T05:02:06', '2'), - ('574', '2604', '2006-02-16T02:30:53', '2005-07-31T03:13:29', '2005-08-09T01:51:29', '2'), - ('550', '4466', '2006-02-16T02:30:53', '2005-06-17T01:31:46', '2005-06-26T02:09:46', '2'), - ('40', '4497', '2006-02-16T02:30:53', '2005-08-17T16:08:49', '2005-08-20T16:59:49', '2'), - ('141', '2185', '2006-02-16T02:30:53', '2005-07-30T07:49:56', '2005-08-05T06:25:56', '2'), - ('185', '1717', '2006-02-16T02:30:53', '2005-07-30T23:04:13', '2005-08-04T21:48:13', '2'), - ('327', '4580', '2006-02-16T02:30:53', '2005-08-23T17:56:01', '2005-08-31T21:49:01', '2'), - ('217', '4128', '2006-02-16T02:30:53', '2005-05-31T19:42:02', '2005-06-07T00:59:02', '2'), - ('29', '2382', '2006-02-16T02:30:53', '2005-07-27T18:18:41', '2005-08-03T13:55:41', '2'), - ('32', '3591', '2006-02-16T02:30:53', '2005-06-17T03:53:18', '2005-06-25T07:37:18', '2'), - ('554', '1008', '2006-02-16T02:30:53', '2005-06-21T08:05:32', '2005-06-27T03:34:32', '2'), - ('133', '3818', '2006-02-16T02:30:53', '2005-07-27T08:07:39', '2005-07-30T03:17:39', '2'), - ('114', '1751', '2006-02-16T02:30:53', '2005-07-10T05:44:02', '2005-07-12T00:03:02', '2'), - ('238', '4014', '2006-02-16T02:30:53', '2005-07-10T05:21:11', '2005-07-18T08:42:11', '2'), - ('208', '902', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('528', '2315', '2006-02-16T02:30:53', '2005-07-27T22:38:53', '2005-08-05T19:03:53', '2'), - ('75', '2035', '2006-02-16T02:30:53', '2005-07-30T11:31:17', '2005-08-08T16:56:17', '2'), - ('369', '2979', '2006-02-16T02:30:53', '2005-07-09T03:25:18', '2005-07-13T00:57:18', '2'), - ('485', '1609', '2006-02-16T02:30:53', '2005-08-17T17:56:48', '2005-08-21T19:14:48', '2'), - ('207', '2269', '2006-02-16T02:30:53', '2005-07-27T12:57:26', '2005-08-03T09:35:26', '2'), - ('139', '1917', '2006-02-16T02:30:53', '2005-08-22T00:27:59', '2005-08-29T23:54:59', '2'), - ('13', '4203', '2006-02-16T02:30:53', '2005-07-12T05:45:47', '2005-07-15T05:18:47', '2'), - ('269', '3675', '2006-02-16T02:30:53', '2005-08-18T07:15:19', '2005-08-24T04:58:19', '2'), - ('14', '2693', '2006-02-16T02:30:53', '2005-07-09T16:10:25', '2005-07-18T17:10:25', '2'), - ('403', '1681', '2006-02-16T02:30:53', '2005-08-17T01:19:52', '2005-08-19T00:47:52', '2'), - ('396', '1005', '2006-02-16T02:30:53', '2005-07-30T18:13:45', '2005-08-07T15:23:45', '2'), - ('36', '2134', '2006-02-16T02:30:53', '2005-07-29T05:52:50', '2005-08-03T04:45:50', '2'), - ('504', '2592', '2006-02-16T02:30:53', '2005-08-17T01:31:04', '2005-08-24T03:36:04', '2'), - ('30', '1168', '2006-02-16T02:30:53', '2005-08-18T03:27:11', '2005-08-26T04:34:11', '2'), - ('479', '2683', '2006-02-16T02:30:53', '2005-08-02T08:20:29', '2005-08-09T11:35:29', '2'), - ('490', '4396', '2006-02-16T02:30:53', '2005-07-06T21:06:17', '2005-07-07T19:25:17', '2'), - ('19', '1181', '2006-02-16T02:30:53', '2005-07-31T23:40:35', '2005-08-09T00:46:35', '2'), - ('416', '2726', '2006-02-16T02:30:53', '2005-08-22T17:43:12', '2005-08-29T23:03:12', '2'), - ('528', '3069', '2006-02-16T02:30:53', '2005-08-19T01:04:59', '2005-08-26T21:39:59', '2'), - ('367', '3541', '2006-02-16T02:30:53', '2005-07-07T14:11:55', '2005-07-16T14:01:55', '2'), - ('12', '1638', '2006-02-16T02:30:53', '2005-08-23T20:28:44', '2005-08-27T16:23:44', '2'), - ('238', '4109', '2006-02-16T02:30:53', '2005-07-29T08:20:49', '2005-07-31T04:02:49', '2'), - ('451', '2164', '2006-02-16T02:30:53', '2005-06-19T11:33:11', '2005-06-26T14:30:11', '2'), - ('219', '3377', '2006-02-16T02:30:53', '2005-07-29T07:12:17', '2005-08-03T09:53:17', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['6030', '15475', '15270', '7851', '12478', '2019', '6536', '4394', '14741', '9409', '11485', '5929', '6889', '14637', '12583', '10040', '13168', '2379', '9468', '13488', '10348', '5791', '15879', '5025', '2654', '15033', '264', '7321', '14072', '5161', '2901', '2835', '6504', '15703', '7378', '2764', '3519', '528', '14963', '1618', '10731', '4125', '6560', '9121', '10712', '9583', '2214', '11481', '8012', '9326', '7631', '9114', '12898', '1519', '10421', '4145', '10509', '1784', '8435', '14704', '2367', '6019', '1455', '12210', '436', '10312', '7689', '2336', '5797', '1685', '10198', '14622', '480', '9216', '3936', '843', '5050', '6681', '5867', '15607', '15524', '168', '5613', '14881', '1671', '13155', '14056', '1334', '10868', '3285', '4206', '5827', '12011', '9513', '1938', '13117', '14165', '4923', '7478', '3226']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('36', '95', '2006-02-16T02:30:53', '2005-07-11T02:37:51', '2005-07-16T22:34:51', '2'), - ('562', '4503', '2006-02-16T02:30:53', '2005-08-23T01:44:43', '2005-08-23T23:53:43', '2'), - ('262', '4123', '2006-02-16T02:30:53', '2005-08-22T18:48:42', '2005-08-28T15:38:42', '2'), - ('253', '3596', '2006-02-16T02:30:53', '2005-07-28T09:31:58', '2005-08-04T09:58:58', '2'), - ('42', '4512', '2006-02-16T02:30:53', '2005-08-18T12:25:16', '2005-08-22T06:27:16', '2'), - ('528', '2314', '2006-02-16T02:30:53', '2005-06-17T12:38:44', '2005-06-23T17:38:44', '2'), - ('289', '3521', '2006-02-16T02:30:53', '2005-07-12T04:44:25', '2005-07-18T01:52:25', '2'), - ('156', '563', '2006-02-16T02:30:53', '2005-07-07T21:12:45', '2005-07-16T18:24:45', '2'), - ('60', '612', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('156', '3053', '2006-02-16T02:30:53', '2005-07-30T20:33:53', '2005-08-05T18:32:53', '2'), - ('326', '1872', '2006-02-16T02:30:53', '2005-08-02T22:33:25', '2005-08-04T23:26:25', '2'), - ('54', '4303', '2006-02-16T02:30:53', '2005-07-10T21:59:29', '2005-07-14T20:20:29', '2'), - ('198', '2919', '2006-02-16T02:30:53', '2005-07-12T21:01:22', '2005-07-20T20:16:22', '2'), - ('76', '1846', '2006-02-16T02:30:53', '2005-08-21T19:01:00', '2005-08-26T23:03:00', '2'), - ('108', '3090', '2006-02-16T02:30:53', '2005-08-18T15:51:36', '2005-08-20T18:47:36', '2'), - ('268', '2281', '2006-02-16T02:30:53', '2005-07-31T18:54:15', '2005-08-05T17:33:15', '2'), - ('186', '2210', '2006-02-16T02:30:53', '2005-08-19T13:37:28', '2005-08-27T17:54:28', '2'), - ('597', '2708', '2006-02-16T02:30:53', '2005-06-18T14:59:39', '2005-06-24T13:26:39', '2'), - ('20', '4366', '2006-02-16T02:30:53', '2005-07-30T22:53:52', '2005-08-07T00:22:52', '2'), - ('444', '867', '2006-02-16T02:30:53', '2005-08-20T01:28:42', '2005-08-25T06:17:42', '2'), - ('14', '2076', '2006-02-16T02:30:53', '2005-08-01T05:23:00', '2005-08-04T01:12:00', '2'), - ('319', '2795', '2006-02-16T02:30:53', '2005-07-10T14:16:22', '2005-07-19T13:38:22', '2'), - ('482', '235', '2006-02-16T02:30:53', '2005-08-23T16:42:53', '2005-08-29T16:21:53', '2'), - ('91', '153', '2006-02-16T02:30:53', '2005-07-09T02:28:24', '2005-07-12T04:43:24', '2'), - ('405', '3697', '2006-02-16T02:30:53', '2005-06-19T10:37:54', '2005-06-27T11:44:54', '2'), - ('168', '2431', '2006-02-16T02:30:53', '2005-08-22T09:25:24', '2005-08-28T09:56:24', '2'), - ('251', '2069', '2006-02-16T02:30:53', '2005-05-26T16:00:49', '2005-05-27T10:12:49', '2'), - ('38', '3525', '2006-02-16T02:30:53', '2005-07-27T13:33:38', '2005-08-03T07:35:38', '2'), - ('515', '2387', '2006-02-16T02:30:53', '2005-08-20T23:07:10', '2005-08-23T03:38:10', '2'), - ('284', '2617', '2006-02-16T02:30:53', '2005-07-09T08:57:56', '2005-07-18T07:41:56', '2'), - ('25', '667', '2006-02-16T02:30:53', '2005-06-20T02:41:28', '2005-06-23T04:43:28', '2'), - ('89', '4411', '2006-02-16T02:30:53', '2005-06-19T21:44:11', '2005-06-26T16:46:11', '2'), - ('535', '3786', '2006-02-16T02:30:53', '2005-07-12T03:19:14', '2005-07-17T01:13:14', '2'), - ('322', '2883', '2006-02-16T02:30:53', '2005-08-23T10:23:48', '2005-09-01T06:54:48', '2'), - ('144', '3297', '2006-02-16T02:30:53', '2005-07-27T15:31:33', '2005-08-03T17:15:33', '2'), - ('479', '1718', '2006-02-16T02:30:53', '2005-06-19T17:27:25', '2005-06-28T17:18:25', '2'), - ('320', '4314', '2006-02-16T02:30:53', '2005-07-06T00:57:29', '2005-07-10T21:12:29', '2'), - ('359', '1655', '2006-02-16T02:30:53', '2005-05-28T04:30:05', '2005-06-03T10:01:05', '2'), - ('384', '2672', '2006-02-16T02:30:53', '2005-08-22T06:38:10', '2005-08-31T05:35:10', '2'), - ('134', '3741', '2006-02-16T02:30:53', '2005-06-16T07:08:38', '2005-06-25T05:26:38', '2'), - ('278', '4248', '2006-02-16T02:30:53', '2005-08-01T19:21:48', '2005-08-08T22:01:48', '2'), - ('269', '4131', '2006-02-16T02:30:53', '2005-07-07T07:20:29', '2005-07-15T06:41:29', '2'), - ('54', '433', '2006-02-16T02:30:53', '2005-07-12T05:22:06', '2005-07-15T00:04:06', '2'), - ('150', '3098', '2006-02-16T02:30:53', '2005-07-30T09:36:26', '2005-08-05T15:17:26', '2'), - ('532', '1188', '2006-02-16T02:30:53', '2005-08-01T18:47:56', '2005-08-07T19:26:56', '2'), - ('568', '3543', '2006-02-16T02:30:53', '2005-07-31T03:05:21', '2005-08-06T00:14:21', '2'), - ('366', '2430', '2006-02-16T02:30:53', '2005-06-18T02:44:37', '2005-06-18T23:37:37', '2'), - ('234', '4028', '2006-02-16T02:30:53', '2005-08-02T22:18:41', '2005-08-09T23:43:41', '2'), - ('343', '1513', '2006-02-16T02:30:53', '2005-07-28T15:29:00', '2005-08-05T12:28:00', '2'), - ('588', '3772', '2006-02-16T02:30:53', '2005-07-30T17:30:03', '2005-08-01T13:41:03', '2'), - ('132', '2437', '2006-02-16T02:30:53', '2005-07-28T01:01:15', '2005-08-01T06:16:15', '2'), - ('18', '893', '2006-02-16T02:30:53', '2005-07-30T09:13:21', '2005-08-05T06:00:21', '2'), - ('586', '1555', '2006-02-16T02:30:53', '2005-08-19T03:54:34', '2005-08-23T08:14:34', '2'), - ('155', '1553', '2006-02-16T02:30:53', '2005-06-15T23:55:27', '2005-06-21T04:06:27', '2'), - ('262', '925', '2006-02-16T02:30:53', '2005-08-01T08:14:10', '2005-08-03T05:56:10', '2'), - ('592', '3050', '2006-02-16T02:30:53', '2005-07-07T08:26:39', '2005-07-16T12:54:39', '2'), - ('504', '96', '2006-02-16T02:30:53', '2005-08-01T11:25:28', '2005-08-10T09:19:28', '2'), - ('134', '3792', '2006-02-16T02:30:53', '2005-06-16T19:25:32', '2005-06-20T00:00:32', '2'), - ('520', '4462', '2006-02-16T02:30:53', '2005-07-29T07:20:16', '2005-08-02T09:54:16', '2'), - ('248', '4062', '2006-02-16T02:30:53', '2005-08-21T21:02:22', '2005-08-27T23:10:22', '2'), - ('566', '4086', '2006-02-16T02:30:53', '2005-06-18T14:00:31', '2005-06-22T14:45:31', '2'), - ('9', '3483', '2006-02-16T02:30:53', '2005-07-11T02:08:29', '2005-07-13T02:19:29', '2'), - ('358', '2194', '2006-02-16T02:30:53', '2005-06-15T19:51:06', '2005-06-18T21:54:06', '2'), - ('217', '3035', '2006-02-16T02:30:53', '2005-08-18T02:27:29', '2005-08-20T23:32:29', '2'), - ('267', '4317', '2006-02-16T02:30:53', '2005-05-27T17:21:04', '2005-05-30T21:26:04', '2'), - ('172', '4389', '2006-02-16T02:30:53', '2005-08-01T04:29:06', '2005-08-08T04:52:06', '2'), - ('253', '1803', '2006-02-16T02:30:53', '2005-07-28T03:21:24', '2005-07-31T08:01:24', '2'), - ('124', '3888', '2006-02-16T02:30:53', '2005-06-18T11:00:05', '2005-06-25T06:02:05', '2'), - ('384', '1880', '2006-02-16T02:30:53', '2005-07-10T14:43:52', '2005-07-13T16:12:52', '2'), - ('85', '2754', '2006-02-16T02:30:53', '2005-06-16T12:06:57', '2005-06-21T16:53:57', '2'), - ('366', '1297', '2006-02-16T02:30:53', '2005-08-01T00:36:15', '2005-08-07T06:18:15', '2'), - ('559', '2702', '2006-02-16T02:30:53', '2005-08-21T18:25:59', '2005-08-31T00:11:59', '2'), - ('220', '2108', '2006-02-16T02:30:53', '2005-05-27T22:47:39', '2005-06-04T21:17:39', '2'), - ('38', '2783', '2006-02-16T02:30:53', '2005-07-30T13:11:19', '2005-07-31T11:27:19', '2'), - ('129', '4258', '2006-02-16T02:30:53', '2005-07-06T21:15:03', '2005-07-08T17:45:03', '2'), - ('313', '2214', '2006-02-16T02:30:53', '2005-05-30T00:44:24', '2005-05-31T00:58:24', '2'), - ('337', '3876', '2006-02-16T02:30:53', '2005-07-09T03:54:38', '2005-07-10T02:23:38', '2'), - ('368', '854', '2006-02-16T02:30:53', '2005-07-12T12:04:12', '2005-07-19T11:01:12', '2'), - ('321', '730', '2006-02-16T02:30:53', '2005-07-10T18:39:01', '2005-07-19T21:56:01', '2'), - ('484', '4118', '2006-02-16T02:30:53', '2005-08-23T06:54:06', '2005-08-26T05:03:06', '2'), - ('68', '2886', '2006-02-16T02:30:53', '2005-08-23T03:36:26', '2005-08-26T06:28:26', '2'), - ('469', '2714', '2006-02-16T02:30:53', '2005-05-26T03:07:43', '2005-06-02T02:09:43', '2'), - ('220', '4517', '2006-02-16T02:30:53', '2005-07-10T05:15:43', '2005-07-13T05:17:43', '2'), - ('425', '210', '2006-02-16T02:30:53', '2005-08-22T03:47:39', '2005-08-26T05:58:39', '2'), - ('135', '3805', '2006-02-16T02:30:53', '2005-06-16T10:30:22', '2005-06-22T11:08:22', '2'), - ('442', '290', '2006-02-16T02:30:53', '2005-08-19T13:10:23', '2005-08-25T19:07:23', '2'), - ('22', '1300', '2006-02-16T02:30:53', '2005-08-20T22:18:53', '2005-08-27T01:05:53', '2'), - ('269', '1242', '2006-02-16T02:30:53', '2005-06-15T11:43:09', '2005-06-20T15:45:09', '2'), - ('562', '2443', '2006-02-16T02:30:53', '2005-08-02T00:25:15', '2005-08-10T02:31:15', '2'), - ('481', '948', '2006-02-16T02:30:53', '2005-06-21T06:30:13', '2005-06-23T10:31:13', '2'), - ('448', '1557', '2006-02-16T02:30:53', '2005-07-07T11:32:16', '2005-07-14T13:07:16', '2'), - ('290', '1296', '2006-02-16T02:30:53', '2005-07-10T16:22:20', '2005-07-15T21:13:20', '2'), - ('313', '495', '2006-02-16T02:30:53', '2005-08-17T19:19:44', '2005-08-23T00:56:44', '2'), - ('317', '396', '2006-02-16T02:30:53', '2005-07-31T00:28:30', '2005-08-01T00:22:30', '2'), - ('454', '570', '2006-02-16T02:30:53', '2005-06-17T07:18:36', '2005-06-19T01:43:36', '2'), - ('385', '3430', '2006-02-16T02:30:53', '2005-08-19T11:33:20', '2005-08-20T11:55:20', '2'), - ('150', '4151', '2006-02-16T02:30:53', '2005-08-21T02:59:17', '2005-08-24T23:09:17', '2'), - ('18', '932', '2006-02-16T02:30:53', '2005-07-08T21:44:39', '2005-07-17T15:50:39', '2'), - ('521', '3791', '2006-02-16T02:30:53', '2005-07-27T19:16:02', '2005-08-04T22:30:02', '2'), - ('576', '4079', '2006-02-16T02:30:53', '2005-06-21T02:18:14', '2005-06-26T22:32:14', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['15928', '960', '6957', '15567', '8418', '1363', '13577', '7044', '7705', '5360', '11710', '2378', '15437', '9135', '2366', '9184', '3722', '14140', '14699', '13442', '6797', '2707', '5176', '5933', '14405', '8650', '2709', '5367', '13376', '1204', '5743', '9247', '2543', '10754', '3210', '7940', '15589', '7565', '5888', '2128', '2716', '3512', '13542', '664', '2113', '4264', '9487', '11603', '7171', '3306', '855', '7259', '9660', '14421', '5766', '3186', '8903', '2150', '8630', '7604', '8080', '7109', '8962', '10632', '12505', '5263', '5098', '9224', '8295', '2241', '2585', '14205', '14601', '9291', '6439', '2325', '5032', '7076', '14740', '10062', '10035', '9148', '2149', '8719', '5892', '6931', '2929', '4', '15313', '1667', '14057', '12661', '3110', '10844', '15253', '9338', '6958', '12427', '5645', '7246']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('75', '2086', '2006-02-16T02:30:53', '2005-08-23T18:23:24', '2005-09-01T23:43:24', '2'), - ('445', '1966', '2006-02-16T02:30:53', '2005-05-30T18:13:23', '2005-06-04T00:12:23', '2'), - ('518', '2231', '2006-02-16T02:30:53', '2005-07-27T00:00:00', '2005-07-29T19:32:00', '2'), - ('54', '2506', '2006-02-16T02:30:53', '2005-08-23T05:20:36', '2005-08-24T10:09:36', '2'), - ('355', '3081', '2006-02-16T02:30:53', '2005-07-29T06:54:21', '2005-08-05T06:50:21', '2'), - ('197', '771', '2006-02-16T02:30:53', '2005-06-15T14:05:11', '2005-06-17T19:53:11', '2'), - ('448', '3844', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('147', '88', '2006-02-16T02:30:53', '2005-07-27T03:27:29', '2005-08-01T07:00:29', '2'), - ('22', '1072', '2006-02-16T02:30:53', '2005-07-28T04:02:58', '2005-08-05T01:19:58', '2'), - ('562', '679', '2006-02-16T02:30:53', '2005-07-09T18:14:03', '2005-07-10T15:17:03', '2'), - ('553', '613', '2006-02-16T02:30:53', '2005-08-17T07:29:44', '2005-08-19T02:06:44', '2'), - ('384', '2796', '2006-02-16T02:30:53', '2005-06-18T14:57:49', '2005-06-26T18:23:49', '2'), - ('368', '4236', '2006-02-16T02:30:53', '2005-08-23T00:31:09', '2005-08-30T06:17:09', '2'), - ('161', '821', '2006-02-16T02:30:53', '2005-07-30T10:06:53', '2005-08-03T13:57:53', '2'), - ('162', '1413', '2006-02-16T02:30:53', '2005-06-18T13:46:39', '2005-06-23T18:49:39', '2'), - ('365', '51', '2006-02-16T02:30:53', '2005-07-30T12:10:19', '2005-08-01T07:35:19', '2'), - ('83', '604', '2006-02-16T02:30:53', '2005-07-06T11:10:27', '2005-07-13T12:56:27', '2'), - ('65', '2070', '2006-02-16T02:30:53', '2005-08-21T02:04:57', '2005-08-29T06:41:57', '2'), - ('3', '1427', '2006-02-16T02:30:53', '2005-08-21T20:50:48', '2005-08-29T18:08:48', '2'), - ('356', '2432', '2006-02-16T02:30:53', '2005-08-19T23:50:45', '2005-08-27T22:01:45', '2'), - ('469', '1536', '2006-02-16T02:30:53', '2005-07-12T16:47:06', '2005-07-14T14:38:06', '2'), - ('589', '4486', '2006-02-16T02:30:53', '2005-06-19T13:57:08', '2005-06-27T11:09:08', '2'), - ('119', '328', '2006-02-16T02:30:53', '2005-07-09T09:39:31', '2005-07-17T11:56:31', '2'), - ('419', '4372', '2006-02-16T02:30:53', '2005-07-10T22:06:48', '2005-07-12T23:58:48', '2'), - ('470', '2777', '2006-02-16T02:30:53', '2005-08-21T10:45:01', '2005-08-30T04:48:01', '2'), - ('134', '1272', '2006-02-16T02:30:53', '2005-07-29T14:59:04', '2005-08-04T13:13:04', '2'), - ('7', '2877', '2006-02-16T02:30:53', '2005-06-19T14:00:26', '2005-06-23T14:56:26', '2'), - ('485', '1446', '2006-02-16T02:30:53', '2005-07-09T18:39:15', '2005-07-16T14:19:15', '2'), - ('40', '898', '2006-02-16T02:30:53', '2005-08-19T21:31:45', '2005-08-22T01:14:45', '2'), - ('249', '2450', '2006-02-16T02:30:53', '2005-06-15T02:21:46', '2005-06-20T07:14:46', '2'), - ('297', '593', '2006-02-16T02:30:53', '2005-07-10T11:57:38', '2005-07-19T15:38:38', '2'), - ('426', '4106', '2006-02-16T02:30:53', '2005-07-30T14:13:56', '2005-08-02T16:34:56', '2'), - ('58', '1729', '2006-02-16T02:30:53', '2005-06-19T02:14:11', '2005-06-21T00:40:11', '2'), - ('460', '2122', '2006-02-16T02:30:53', '2005-08-01T20:12:33', '2005-08-10T01:07:33', '2'), - ('75', '467', '2006-02-16T02:30:53', '2005-06-21T01:00:25', '2005-06-23T06:10:25', '2'), - ('409', '901', '2006-02-16T02:30:53', '2005-07-28T12:46:47', '2005-07-29T06:46:47', '2'), - ('22', '2379', '2006-02-16T02:30:53', '2005-08-23T06:03:31', '2005-08-30T07:44:31', '2'), - ('114', '1028', '2006-02-16T02:30:53', '2005-07-27T22:33:59', '2005-07-30T03:03:59', '2'), - ('268', '1620', '2006-02-16T02:30:53', '2005-07-10T19:52:17', '2005-07-18T20:32:17', '2'), - ('2', '352', '2006-02-16T02:30:53', '2005-06-17T20:54:58', '2005-06-24T00:41:58', '2'), - ('252', '944', '2006-02-16T02:30:53', '2005-06-19T14:40:17', '2005-06-27T17:45:17', '2'), - ('291', '371', '2006-02-16T02:30:53', '2005-07-06T00:43:06', '2005-07-12T06:18:06', '2'), - ('147', '4543', '2006-02-16T02:30:53', '2005-08-20T03:41:57', '2005-08-29T03:21:57', '2'), - ('523', '87', '2006-02-16T02:30:53', '2005-05-28T21:31:08', '2005-06-02T20:56:08', '2'), - ('406', '1509', '2006-02-16T02:30:53', '2005-06-17T19:57:46', '2005-06-24T00:22:46', '1'), - ('406', '3499', '2006-02-16T02:30:53', '2005-07-07T14:25:28', '2005-07-08T08:49:28', '2'), - ('406', '2165', '2006-02-16T02:30:53', '2005-07-30T23:40:22', '2005-08-01T22:29:22', '1'), - ('406', '3910', '2006-02-16T02:30:53', '2005-08-17T03:22:10', '2005-08-18T06:48:10', '1'), - ('406', '4381', '2006-02-16T02:30:53', '2005-07-27T07:58:35', '2005-08-03T07:45:35', '1'), - ('406', '1669', '2006-02-16T02:30:53', '2005-06-21T07:46:58', '2005-06-26T11:22:58', '2'), - ('406', '2527', '2006-02-16T02:30:53', '2005-05-30T02:00:28', '2005-06-03T20:16:28', '2'), - ('406', '2345', '2006-02-16T02:30:53', '2005-07-27T11:06:00', '2005-08-02T06:44:00', '2'), - ('406', '1090', '2006-02-16T02:30:53', '2005-07-31T06:03:17', '2005-08-07T06:59:17', '2'), - ('406', '4402', '2006-02-16T02:30:53', '2005-08-21T11:20:21', '2005-08-24T06:26:21', '1'), - ('406', '7', '2006-02-16T02:30:53', '2005-07-10T13:07:31', '2005-07-16T13:03:31', '1'), - ('406', '3198', '2006-02-16T02:30:53', '2005-06-20T23:04:20', '2005-06-29T02:56:20', '2'), - ('406', '4546', '2006-02-16T02:30:53', '2005-07-30T01:08:06', '2005-07-30T21:47:06', '2'), - ('406', '1910', '2006-02-16T02:30:53', '2005-06-17T22:50:36', '2005-06-21T19:33:36', '1'), - ('406', '1378', '2006-02-16T02:30:53', '2005-07-29T14:07:59', '2005-08-03T13:18:59', '2'), - ('406', '3720', '2006-02-16T02:30:53', '2005-07-27T23:54:52', '2005-08-05T03:04:52', '2'), - ('406', '3035', '2006-02-16T02:30:53', '2005-07-28T18:05:06', '2005-07-29T22:44:06', '2'), - ('406', '1658', '2006-02-16T02:30:53', '2005-07-27T05:28:57', '2005-08-04T10:41:57', '2'), - ('406', '4439', '2006-02-16T02:30:53', '2005-07-30T03:43:45', '2005-08-07T00:33:45', '1'), - ('406', '1290', '2006-02-16T02:30:53', '2005-08-01T15:36:56', '2005-08-05T17:32:56', '1'), - ('406', '3741', '2006-02-16T02:30:53', '2005-08-18T13:17:30', '2005-08-23T18:03:30', '1'), - ('406', '119', '2006-02-16T02:30:53', '2005-07-09T14:10:36', '2005-07-12T15:07:36', '1'), - ('406', '1772', '2006-02-16T02:30:53', '2005-07-09T06:13:54', '2005-07-10T04:27:54', '1'), - ('406', '2260', '2006-02-16T02:30:53', '2005-07-30T13:25:37', '2005-08-01T15:13:37', '2'), - ('406', '2065', '2006-02-16T02:30:53', '2005-07-29T02:42:14', '2005-07-30T22:22:14', '1'), - ('406', '921', '2006-02-16T02:30:53', '2005-06-18T04:31:41', '2005-06-24T22:34:41', '2'), - ('406', '91', '2006-02-16T02:30:53', '2005-06-19T05:05:03', '2005-06-20T09:28:03', '1'), - ('406', '315', '2006-02-16T02:30:53', '2005-08-21T03:57:15', '2005-08-30T08:46:15', '2'), - ('406', '548', '2006-02-16T02:30:53', '2005-08-21T17:45:52', '2005-08-29T15:10:52', '1'), - ('406', '2884', '2006-02-16T02:30:53', '2005-07-30T16:03:39', '2005-08-05T11:11:39', '2'), - ('406', '3463', '2006-02-16T02:30:53', '2005-07-12T00:23:48', '2005-07-13T00:54:48', '2'), - ('406', '752', '2006-02-16T02:30:53', '2005-06-18T10:08:07', '2005-06-21T15:07:07', '1'), - ('333', '2257', '2006-02-16T02:30:53', '2005-07-09T02:39:47', '2005-07-10T07:45:47', '1'), - ('333', '2821', '2006-02-16T02:30:53', '2005-07-27T04:12:14', '2005-08-05T00:44:14', '1'), - ('333', '1717', '2006-02-16T02:30:53', '2005-08-21T22:35:33', '2005-08-26T17:49:33', '1'), - ('333', '1815', '2006-02-16T02:30:53', '2005-07-31T19:24:55', '2005-08-03T22:51:55', '2'), - ('333', '2694', '2006-02-16T02:30:53', '2005-07-31T18:46:46', '2005-08-04T20:33:46', '1'), - ('333', '1407', '2006-02-16T02:30:53', '2005-07-30T10:39:10', '2005-08-04T07:17:10', '2'), - ('333', '3365', '2006-02-16T02:30:53', '2005-06-17T22:50:00', '2005-06-26T18:40:00', '1'), - ('333', '995', '2006-02-16T02:30:53', '2005-07-29T17:45:45', '2005-08-01T13:53:45', '1'), - ('333', '4322', '2006-02-16T02:30:53', '2005-07-10T20:02:42', '2005-07-11T20:02:42', '1'), - ('333', '2794', '2006-02-16T02:30:53', '2005-07-26T23:02:57', '2005-07-28T04:48:57', '2'), - ('333', '3389', '2006-02-16T02:30:53', '2005-06-20T04:47:39', '2005-06-25T23:16:39', '2'), - ('333', '2452', '2006-02-16T02:30:53', '2005-05-24T23:04:41', '2005-06-03T01:43:41', '2'), - ('333', '2587', '2006-02-16T02:30:53', '2005-08-22T19:59:42', '2005-08-24T15:03:42', '2'), - ('333', '2362', '2006-02-16T02:30:53', '2005-06-16T10:18:59', '2005-06-22T14:45:59', '2'), - ('333', '1526', '2006-02-16T02:30:53', '2005-08-20T22:22:59', '2005-08-25T16:58:59', '2'), - ('333', '1547', '2006-02-16T02:30:53', '2005-08-18T19:10:10', '2005-08-22T20:30:10', '1'), - ('333', '2008', '2006-02-16T02:30:53', '2005-06-20T17:40:12', '2005-06-24T17:09:12', '1'), - ('333', '1516', '2006-02-16T02:30:53', '2005-08-01T23:46:58', '2005-08-09T19:42:58', '2'), - ('333', '4143', '2006-02-16T02:30:53', '2005-08-22T18:05:21', '2005-08-23T18:06:21', '2'), - ('333', '1482', '2006-02-16T02:30:53', '2005-07-30T18:03:13', '2005-08-08T23:57:13', '2'), - ('333', '657', '2006-02-16T02:30:53', '2005-07-27T00:02:41', '2005-07-28T00:53:41', '2'), - ('333', '1759', '2006-02-16T02:30:53', '2005-08-18T10:24:17', '2005-08-27T14:22:17', '1'), - ('333', '1586', '2006-02-16T02:30:53', '2005-07-10T06:58:21', '2005-07-18T04:19:21', '2'), - ('333', '2003', '2006-02-16T02:30:53', '2005-07-27T10:30:41', '2005-07-30T05:44:41', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['13710', '6275', '13579', '6749', '8977', '1298', '14645', '4603', '10997', '10879', '13325', '15656', '1187', '15548', '5818', '12677', '431', '13876', '14219', '5014', '10408', '3662', '14984', '10207', '2476', '10492', '6987', '9633', '13', '15669', '5845', '5434', '6641', '7598', '2206', '23', '1779', '10607', '12654', '1036', '3315', '11644', '3368', '6138', '1138', '2591', '4355', '1431', '5426', '9082', '10512', '12524', '14582', '6563', '9782', '5316', '15893', '13414', '5870', '7374', '8547', '7357', '11933', '13319', '6615', '4446', '7337', '6388', '15623', '3993', '11660', '6098', '7591', '8960', '8007', '10496', '9702', '437', '14954', '15159', '9507', '6689', '5841', '11406', '1772', '89', '7898', '7831', '15587', '12947', '11978', '12004', '1355', '11513', '5022', '13822', '1526', '8130', '3794', '14858']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('333', '756', '2006-02-16T02:30:53', '2005-08-20T09:35:20', '2005-08-21T05:29:20', '2'), - ('333', '3599', '2006-02-16T02:30:53', '2005-07-11T16:12:11', '2005-07-17T20:19:11', '2'), - ('333', '4237', '2006-02-16T02:30:53', '2005-08-20T05:22:06', '2005-08-28T02:33:06', '2'), - ('334', '2895', '2006-02-16T02:30:53', '2005-07-12T14:43:05', '2005-07-21T15:13:05', '2'), - ('334', '4099', '2006-02-16T02:30:53', '2005-07-30T04:14:07', '2005-08-05T23:45:07', '2'), - ('334', '4163', '2006-02-16T02:30:53', '2005-06-15T09:32:53', '2005-06-16T12:40:53', '2'), - ('334', '2369', '2006-02-16T02:30:53', '2005-08-21T19:12:47', '2005-08-25T21:42:47', '1'), - ('334', '755', '2006-02-16T02:30:53', '2005-07-08T06:57:07', '2005-07-17T04:32:07', '1'), - ('334', '300', '2006-02-16T02:30:53', '2005-08-02T04:49:02', '2005-08-10T08:13:02', '2'), - ('334', '4415', '2006-02-16T02:30:53', '2005-08-02T00:33:20', '2005-08-09T04:13:20', '2'), - ('334', '2388', '2006-02-16T02:30:53', '2005-08-19T19:52:02', '2005-08-22T21:14:02', '1'), - ('334', '4239', '2006-02-16T02:30:53', '2005-08-23T08:38:58', '2005-08-24T04:08:58', '2'), - ('334', '1108', '2006-02-16T02:30:53', '2005-06-15T00:58:50', '2005-06-23T02:19:50', '1'), - ('334', '2350', '2006-02-16T02:30:53', '2005-08-23T04:26:20', '2005-08-28T01:27:20', '1'), - ('334', '3940', '2006-02-16T02:30:53', '2005-07-10T15:51:12', '2005-07-14T14:10:12', '2'), - ('334', '1311', '2006-02-16T02:30:53', '2005-08-18T19:36:05', '2005-08-22T21:23:05', '2'), - ('334', '4507', '2006-02-16T02:30:53', '2005-05-27T16:31:05', '2005-06-05T11:29:05', '1'), - ('334', '3137', '2006-02-16T02:30:53', '2005-08-20T15:15:28', '2005-08-23T12:42:28', '2'), - ('334', '3718', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('334', '4095', '2006-02-16T02:30:53', '2005-07-09T01:51:49', '2005-07-10T04:48:49', '1'), - ('334', '4144', '2006-02-16T02:30:53', '2005-08-01T07:42:10', '2005-08-09T02:29:10', '2'), - ('334', '3827', '2006-02-16T02:30:53', '2005-07-06T08:11:48', '2005-07-09T12:25:48', '2'), - ('334', '1704', '2006-02-16T02:30:53', '2005-08-22T07:35:31', '2005-08-30T02:32:31', '1'), - ('334', '2925', '2006-02-16T02:30:53', '2005-08-01T00:53:01', '2005-08-05T05:51:01', '2'), - ('334', '3998', '2006-02-16T02:30:53', '2005-06-18T20:57:12', '2005-06-20T15:42:12', '1'), - ('334', '1669', '2006-02-16T02:30:53', '2005-08-01T10:42:28', '2005-08-02T07:05:28', '1'), - ('334', '3134', '2006-02-16T02:30:53', '2005-07-27T00:59:50', '2005-07-28T01:47:50', '1'), - ('334', '1141', '2006-02-16T02:30:53', '2005-07-31T05:04:08', '2005-08-06T00:52:08', '2'), - ('334', '2294', '2006-02-16T02:30:53', '2005-05-25T00:22:55', '2005-05-30T04:28:55', '1'), - ('334', '1542', '2006-02-16T02:30:53', '2005-08-23T09:06:17', '2005-08-30T08:10:17', '2'), - ('334', '2882', '2006-02-16T02:30:53', '2005-07-10T17:23:14', '2005-07-12T16:29:14', '2'), - ('334', '3790', '2006-02-16T02:30:53', '2005-07-09T21:25:20', '2005-07-15T03:12:20', '2'), - ('334', '2165', '2006-02-16T02:30:53', '2005-07-12T10:33:14', '2005-07-20T08:24:14', '2'), - ('438', '4545', '2006-02-16T02:30:53', '2005-07-27T23:36:01', '2005-07-29T23:35:01', '2'), - ('438', '3651', '2006-02-16T02:30:53', '2005-06-18T02:14:45', '2005-06-24T23:20:45', '2'), - ('438', '4441', '2006-02-16T02:30:53', '2005-05-25T02:40:21', '2005-05-29T06:34:21', '1'), - ('438', '1044', '2006-02-16T02:30:53', '2005-06-16T18:55:11', '2005-06-17T20:11:11', '1'), - ('438', '3999', '2006-02-16T02:30:53', '2005-08-01T14:44:43', '2005-08-02T16:39:43', '2'), - ('438', '2217', '2006-02-16T02:30:53', '2005-08-18T18:56:40', '2005-08-20T17:51:40', '2'), - ('438', '2164', '2006-02-16T02:30:53', '2005-05-31T05:21:10', '2005-06-04T04:19:10', '1'), - ('438', '4108', '2006-02-16T02:30:53', '2005-06-21T08:17:04', '2005-06-24T11:04:04', '1'), - ('438', '1760', '2006-02-16T02:30:53', '2005-08-17T04:49:46', '2005-08-24T08:49:46', '1'), - ('438', '548', '2006-02-16T02:30:53', '2005-06-21T13:18:38', '2005-06-23T11:13:38', '1'), - ('438', '1808', '2006-02-16T02:30:53', '2005-07-11T08:36:04', '2005-07-13T10:30:04', '2'), - ('438', '3944', '2006-02-16T02:30:53', '2005-05-31T19:30:27', '2005-06-05T21:42:27', '1'), - ('438', '4481', '2006-02-16T02:30:53', '2005-06-19T05:32:22', '2005-06-25T23:42:22', '1'), - ('438', '4557', '2006-02-16T02:30:53', '2005-07-07T19:21:19', '2005-07-09T00:55:19', '2'), - ('438', '3193', '2006-02-16T02:30:53', '2005-06-15T18:26:29', '2005-06-21T17:33:29', '1'), - ('438', '251', '2006-02-16T02:30:53', '2005-07-09T21:04:47', '2005-07-17T00:55:47', '1'), - ('438', '4042', '2006-02-16T02:30:53', '2005-07-30T08:11:22', '2005-08-06T09:26:22', '2'), - ('438', '3294', '2006-02-16T02:30:53', '2005-08-01T11:36:19', '2005-08-09T06:52:19', '2'), - ('438', '857', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('438', '1004', '2006-02-16T02:30:53', '2005-08-21T17:08:33', '2005-08-29T18:04:33', '2'), - ('438', '87', '2006-02-16T02:30:53', '2005-07-12T05:34:09', '2005-07-21T07:37:09', '1'), - ('438', '2397', '2006-02-16T02:30:53', '2005-07-31T10:14:26', '2005-08-06T16:11:26', '1'), - ('438', '3856', '2006-02-16T02:30:53', '2005-07-09T16:09:42', '2005-07-11T15:20:42', '1'), - ('438', '2571', '2006-02-16T02:30:53', '2005-08-23T17:02:00', '2005-08-30T12:45:00', '2'), - ('438', '4126', '2006-02-16T02:30:53', '2005-08-19T22:47:34', '2005-08-21T02:50:34', '1'), - ('438', '1524', '2006-02-16T02:30:53', '2005-07-10T18:40:25', '2005-07-12T15:39:25', '2'), - ('438', '3184', '2006-02-16T02:30:53', '2005-07-27T15:20:57', '2005-08-05T13:09:57', '2'), - ('438', '875', '2006-02-16T02:30:53', '2005-07-29T11:10:15', '2005-08-03T12:50:15', '1'), - ('438', '1917', '2006-02-16T02:30:53', '2005-07-27T14:48:31', '2005-08-02T18:07:31', '2'), - ('438', '2574', '2006-02-16T02:30:53', '2005-08-17T16:38:20', '2005-08-22T14:31:20', '1'), - ('438', '2496', '2006-02-16T02:30:53', '2005-08-19T19:35:13', '2005-08-27T17:59:13', '1'), - ('438', '23', '2006-02-16T02:30:53', '2005-07-12T08:36:22', '2005-07-20T09:03:22', '1'), - ('438', '2629', '2006-02-16T02:30:53', '2005-07-07T23:12:16', '2005-07-13T19:42:16', '1'), - ('525', '3314', '2006-02-16T02:30:53', '2005-07-27T14:12:04', '2005-08-03T14:57:04', '2'), - ('525', '3506', '2006-02-16T02:30:53', '2005-07-11T22:17:16', '2005-07-19T23:50:16', '2'), - ('525', '3003', '2006-02-16T02:30:53', '2005-08-23T07:23:29', '2005-08-31T01:47:29', '1'), - ('525', '1061', '2006-02-16T02:30:53', '2005-07-06T23:37:06', '2005-07-14T19:31:06', '1'), - ('525', '4081', '2006-02-16T02:30:53', '2005-08-17T05:22:42', '2005-08-23T01:03:42', '1'), - ('525', '3016', '2006-02-16T02:30:53', '2005-07-11T06:23:28', '2005-07-17T04:05:28', '1'), - ('525', '651', '2006-02-16T02:30:53', '2005-07-27T23:25:54', '2005-08-02T22:54:54', '1'), - ('525', '391', '2006-02-16T02:30:53', '2005-07-30T03:36:31', '2005-08-01T23:46:31', '2'), - ('525', '1942', '2006-02-16T02:30:53', '2005-07-28T15:22:27', '2005-07-30T13:06:27', '2'), - ('525', '411', '2006-02-16T02:30:53', '2005-08-01T10:53:16', '2005-08-08T10:34:16', '2'), - ('525', '3353', '2006-02-16T02:30:53', '2005-07-31T07:34:07', '2005-08-02T06:13:07', '2'), - ('525', '1800', '2006-02-16T02:30:53', '2005-05-27T17:47:22', '2005-06-05T14:22:22', '2'), - ('525', '3608', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('525', '4355', '2006-02-16T02:30:53', '2005-08-22T14:32:25', '2005-08-24T11:19:25', '2'), - ('525', '387', '2006-02-16T02:30:53', '2005-07-31T00:22:29', '2005-08-07T05:59:29', '2'), - ('525', '1568', '2006-02-16T02:30:53', '2005-07-12T12:22:13', '2005-07-16T07:44:13', '1'), - ('525', '1230', '2006-02-16T02:30:53', '2005-07-10T17:11:31', '2005-07-18T15:50:31', '2'), - ('525', '2502', '2006-02-16T02:30:53', '2005-08-02T19:16:10', '2005-08-04T20:51:10', '2'), - ('525', '1269', '2006-02-16T02:30:53', '2005-06-16T18:12:54', '2005-06-24T19:55:54', '1'), - ('499', '2181', '2006-02-16T02:30:53', '2005-05-25T14:28:29', '2005-05-29T14:33:29', '1'), - ('499', '2680', '2006-02-16T02:30:53', '2005-07-28T11:08:22', '2005-08-03T12:28:22', '1'), - ('499', '4436', '2006-02-16T02:30:53', '2005-07-28T08:44:21', '2005-07-30T03:25:21', '2'), - ('499', '2510', '2006-02-16T02:30:53', '2005-08-23T06:00:28', '2005-08-29T10:15:28', '1'), - ('499', '935', '2006-02-16T02:30:53', '2005-08-19T05:54:21', '2005-08-22T09:17:21', '1'), - ('499', '4380', '2006-02-16T02:30:53', '2005-08-17T18:02:10', '2005-08-18T20:40:10', '2'), - ('499', '2690', '2006-02-16T02:30:53', '2005-08-17T18:56:53', '2005-08-26T14:56:53', '1'), - ('499', '4203', '2006-02-16T02:30:53', '2005-06-15T13:13:59', '2005-06-20T12:23:59', '1'), - ('499', '4473', '2006-02-16T02:30:53', '2005-08-16T23:51:33', '2005-08-24T01:37:33', '2'), - ('499', '928', '2006-02-16T02:30:53', '2005-07-09T02:10:54', '2005-07-17T08:07:54', '2'), - ('499', '807', '2006-02-16T02:30:53', '2005-08-20T13:39:28', '2005-08-24T07:40:28', '1'), - ('499', '1940', '2006-02-16T02:30:53', '2005-06-16T00:27:51', '2005-06-19T00:19:51', '1'), - ('499', '4055', '2006-02-16T02:30:53', '2005-07-28T19:48:15', '2005-08-05T14:18:15', '2'), - ('499', '584', '2006-02-16T02:30:53', '2005-07-06T14:35:26', '2005-07-11T14:40:26', '2'), - ('499', '366', '2006-02-16T02:30:53', '2005-08-22T02:46:18', '2005-08-30T08:22:18', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['3241', '10497', '7800', '12354', '12587', '5956', '6723', '10333', '5392', '11606', '5427', '8770', '1830', '12436', '9588', '8486', '3200', '7129', '2331', '226', '14322', '15125', '11680', '12620', '12324', '4649', '11693', '5058', '13434', '4293', '7531', '9853', '5920', '1369', '4693', '7101', '9453', '14419', '2473', '14371', '11802', '2660', '9320', '10335', '12277', '13958', '14623', '4095', '9040', '9085', '5723', '15096', '1301', '13241', '165', '10870', '7992', '9254', '5421', '6280', '3173', '15115', '13858', '14002', '6468', '1021', '1986', '1066', '15141', '12306', '11273', '5197', '8113', '12395', '10306', '14938', '15071', '15421', '13239', '6718', '15924', '2708', '5018', '13640', '15223', '9603', '8322', '12894', '16018', '8343', '15162', '8624', '2621', '1557', '6672', '9275', '5893', '13358', '11989', '12826']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('499', '1442', '2006-02-16T02:30:53', '2005-06-21T02:54:32', '2005-06-26T21:56:32', '2'), - ('499', '1060', '2006-02-16T02:30:53', '2005-08-01T10:55:59', '2005-08-07T11:15:59', '1'), - ('499', '3386', '2006-02-16T02:30:53', '2005-07-28T07:50:59', '2005-07-29T07:31:59', '2'), - ('499', '2913', '2006-02-16T02:30:53', '2005-08-18T07:34:07', '2005-08-26T05:56:07', '1'), - ('499', '3081', '2006-02-16T02:30:53', '2005-08-18T16:03:13', '2005-08-25T19:30:13', '1'), - ('499', '2536', '2006-02-16T02:30:53', '2005-07-10T23:23:08', '2005-07-13T17:36:08', '1'), - ('499', '2678', '2006-02-16T02:30:53', '2005-07-12T13:44:57', '2005-07-14T15:57:57', '2'), - ('499', '3955', '2006-02-16T02:30:53', '2005-08-01T04:58:32', '2005-08-04T00:51:32', '2'), - ('499', '2552', '2006-02-16T02:30:53', '2005-07-09T19:32:30', '2005-07-16T15:01:30', '1'), - ('499', '4138', '2006-02-16T02:30:53', '2005-08-17T03:32:43', '2005-08-18T04:30:43', '1'), - ('499', '3197', '2006-02-16T02:30:53', '2005-07-09T21:12:26', '2005-07-14T01:02:26', '1'), - ('499', '4025', '2006-02-16T02:30:53', '2005-07-29T19:53:50', '2005-08-05T14:22:50', '1'), - ('499', '4010', '2006-02-16T02:30:53', '2005-06-16T22:18:43', '2005-06-23T21:14:43', '2'), - ('499', '3761', '2006-02-16T02:30:53', '2005-08-18T10:41:05', '2005-08-23T07:36:05', '2'), - ('499', '1368', '2006-02-16T02:30:53', '2005-07-31T03:13:13', '2005-08-02T04:06:13', '1'), - ('221', '1759', '2006-02-16T02:30:53', '2005-07-29T08:53:38', '2005-08-01T14:12:38', '2'), - ('221', '4117', '2006-02-16T02:30:53', '2005-06-21T00:22:47', '2005-06-27T05:52:47', '2'), - ('221', '1930', '2006-02-16T02:30:53', '2005-07-27T06:18:01', '2005-07-28T02:38:01', '1'), - ('221', '1546', '2006-02-16T02:30:53', '2005-06-18T10:50:09', '2005-06-25T14:30:09', '1'), - ('221', '4181', '2006-02-16T02:30:53', '2005-05-26T10:44:04', '2005-05-31T13:26:04', '2'), - ('221', '2818', '2006-02-16T02:30:53', '2005-08-21T08:06:30', '2005-08-29T10:12:30', '2'), - ('221', '3942', '2006-02-16T02:30:53', '2005-08-22T12:53:22', '2005-08-29T18:44:22', '1'), - ('221', '4538', '2006-02-16T02:30:53', '2005-08-17T06:12:27', '2005-08-23T08:54:27', '1'), - ('221', '2663', '2006-02-16T02:30:53', '2005-08-18T17:26:38', '2005-08-25T13:24:38', '1'), - ('221', '2436', '2006-02-16T02:30:53', '2005-08-18T06:38:20', '2005-08-20T02:28:20', '2'), - ('221', '1116', '2006-02-16T02:30:53', '2005-07-08T09:32:05', '2005-07-15T08:37:05', '2'), - ('221', '793', '2006-02-16T02:30:53', '2005-08-17T06:56:56', '2005-08-24T06:20:56', '2'), - ('221', '917', '2006-02-16T02:30:53', '2005-07-09T04:20:35', '2005-07-18T08:09:35', '2'), - ('221', '2073', '2006-02-16T02:30:53', '2005-08-19T23:34:26', '2005-08-23T18:33:26', '1'), - ('221', '984', '2006-02-16T02:30:53', '2005-07-07T15:53:47', '2005-07-10T18:11:47', '1'), - ('221', '2393', '2006-02-16T02:30:53', '2005-07-27T21:19:34', '2005-08-06T01:07:34', '2'), - ('221', '1782', '2006-02-16T02:30:53', '2005-07-31T12:58:20', '2005-08-04T10:47:20', '1'), - ('221', '1893', '2006-02-16T02:30:53', '2005-07-10T21:33:58', '2005-07-17T19:41:58', '2'), - ('221', '679', '2006-02-16T02:30:53', '2005-06-15T14:29:14', '2005-06-16T13:01:14', '1'), - ('221', '1694', '2006-02-16T02:30:53', '2005-07-08T11:07:36', '2005-07-14T08:40:36', '1'), - ('221', '2006', '2006-02-16T02:30:53', '2005-07-27T05:06:34', '2005-07-29T06:12:34', '1'), - ('221', '1988', '2006-02-16T02:30:53', '2005-07-30T22:20:04', '2005-08-08T02:27:04', '1'), - ('221', '3146', '2006-02-16T02:30:53', '2005-08-21T11:15:46', '2005-08-30T16:37:46', '1'), - ('221', '3876', '2006-02-16T02:30:53', '2005-06-18T20:42:45', '2005-06-19T20:17:45', '1'), - ('221', '2197', '2006-02-16T02:30:53', '2005-08-21T09:37:16', '2005-08-27T13:50:16', '2'), - ('221', '2815', '2006-02-16T02:30:53', '2005-08-17T11:32:51', '2005-08-22T10:56:51', '1'), - ('221', '4341', '2006-02-16T02:30:53', '2005-06-19T10:50:02', '2005-06-28T12:49:02', '1'), - ('221', '909', '2006-02-16T02:30:53', '2005-07-30T17:16:39', '2005-08-06T18:43:39', '2'), - ('33', '323', '2006-02-16T02:30:53', '2005-08-01T04:59:30', '2005-08-05T02:26:30', '1'), - ('33', '407', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('33', '2380', '2006-02-16T02:30:53', '2005-08-20T18:11:44', '2005-08-28T14:59:44', '1'), - ('33', '901', '2006-02-16T02:30:53', '2005-08-21T18:29:13', '2005-08-26T20:48:13', '2'), - ('33', '2900', '2006-02-16T02:30:53', '2005-07-07T06:01:48', '2005-07-15T02:52:48', '2'), - ('33', '392', '2006-02-16T02:30:53', '2005-07-30T06:31:45', '2005-08-03T12:20:45', '1'), - ('33', '3400', '2006-02-16T02:30:53', '2005-07-30T08:17:24', '2005-08-03T09:35:24', '2'), - ('33', '605', '2006-02-16T02:30:53', '2005-07-10T11:14:48', '2005-07-11T15:46:48', '2'), - ('33', '1983', '2006-02-16T02:30:53', '2005-08-22T11:43:04', '2005-08-29T12:16:04', '2'), - ('33', '1484', '2006-02-16T02:30:53', '2005-06-15T09:46:33', '2005-06-24T08:56:33', '2'), - ('33', '3106', '2006-02-16T02:30:53', '2005-08-19T16:25:00', '2005-08-26T12:27:00', '2'), - ('33', '2735', '2006-02-16T02:30:53', '2005-05-26T02:28:36', '2005-06-02T03:21:36', '1'), - ('33', '1509', '2006-02-16T02:30:53', '2005-08-02T00:27:12', '2005-08-02T20:00:12', '2'), - ('33', '1851', '2006-02-16T02:30:53', '2005-07-28T14:53:06', '2005-07-29T18:17:06', '1'), - ('33', '495', '2006-02-16T02:30:53', '2005-07-30T14:26:11', '2005-08-04T16:12:11', '1'), - ('33', '2437', '2006-02-16T02:30:53', '2005-07-09T20:49:12', '2005-07-10T16:30:12', '1'), - ('33', '4055', '2006-02-16T02:30:53', '2005-07-11T16:36:17', '2005-07-13T14:04:17', '2'), - ('33', '4306', '2006-02-16T02:30:53', '2005-06-20T22:21:10', '2005-06-27T19:41:10', '2'), - ('33', '1739', '2006-02-16T02:30:53', '2005-08-22T12:28:01', '2005-08-26T16:12:01', '1'), - ('33', '2167', '2006-02-16T02:30:53', '2005-08-20T14:50:57', '2005-08-23T12:10:57', '2'), - ('33', '87', '2006-02-16T02:30:53', '2005-08-20T20:12:19', '2005-08-23T00:23:19', '1'), - ('541', '4560', '2006-02-16T02:30:53', '2005-07-12T01:27:09', '2005-07-20T00:37:09', '2'), - ('541', '2724', '2006-02-16T02:30:53', '2005-05-31T03:16:15', '2005-06-08T06:43:15', '2'), - ('541', '2894', '2006-02-16T02:30:53', '2005-06-17T10:34:59', '2005-06-24T04:57:59', '2'), - ('541', '2383', '2006-02-16T02:30:53', '2005-05-31T09:07:33', '2005-06-09T05:34:33', '2'), - ('541', '227', '2006-02-16T02:30:53', '2005-08-22T13:41:49', '2005-08-28T15:25:49', '2'), - ('541', '3853', '2006-02-16T02:30:53', '2005-08-18T05:47:55', '2005-08-21T01:56:55', '1'), - ('541', '3383', '2006-02-16T02:30:53', '2005-08-02T14:20:55', '2005-08-07T12:57:55', '1'), - ('541', '1571', '2006-02-16T02:30:53', '2005-07-09T10:43:54', '2005-07-16T10:19:54', '1'), - ('541', '4269', '2006-02-16T02:30:53', '2005-07-28T19:14:00', '2005-08-06T00:05:00', '2'), - ('541', '2020', '2006-02-16T02:30:53', '2005-08-18T09:06:30', '2005-08-21T12:09:30', '2'), - ('541', '2819', '2006-02-16T02:30:53', '2005-08-01T04:19:18', '2005-08-09T02:16:18', '1'), - ('541', '408', '2006-02-16T02:30:53', '2005-08-22T05:52:39', '2005-08-31T11:43:39', '1'), - ('541', '417', '2006-02-16T02:30:53', '2005-08-22T10:58:43', '2005-08-31T14:53:43', '1'), - ('541', '3', '2006-02-16T02:30:53', '2005-08-22T23:56:37', '2005-08-25T18:58:37', '2'), - ('541', '3296', '2006-02-16T02:30:53', '2005-08-19T16:22:13', '2005-08-23T19:26:13', '1'), - ('541', '2283', '2006-02-16T02:30:53', '2005-07-12T13:38:06', '2005-07-18T09:05:06', '1'), - ('541', '1114', '2006-02-16T02:30:53', '2005-08-23T18:08:59', '2005-08-27T12:20:59', '2'), - ('541', '2659', '2006-02-16T02:30:53', '2005-06-19T13:59:05', '2005-06-24T10:02:05', '2'), - ('541', '2317', '2006-02-16T02:30:53', '2005-07-09T02:01:05', '2005-07-10T04:09:05', '1'), - ('541', '3427', '2006-02-16T02:30:53', '2005-08-20T07:22:53', '2005-08-21T11:54:53', '2'), - ('541', '2263', '2006-02-16T02:30:53', '2005-08-22T17:13:39', '2005-08-27T11:17:39', '2'), - ('541', '2266', '2006-02-16T02:30:53', '2005-07-31T03:43:43', '2005-08-02T00:11:43', '2'), - ('541', '301', '2006-02-16T02:30:53', '2005-07-29T03:52:49', '2005-08-02T22:53:49', '1'), - ('541', '4581', '2006-02-16T02:30:53', '2005-08-19T03:49:28', '2005-08-25T01:51:28', '2'), - ('439', '897', '2006-02-16T02:30:53', '2005-08-23T21:27:35', '2005-08-30T00:36:35', '1'), - ('439', '4267', '2006-02-16T02:30:53', '2005-07-29T04:45:16', '2005-08-02T03:37:16', '1'), - ('439', '1756', '2006-02-16T02:30:53', '2005-08-22T14:41:05', '2005-08-27T20:23:05', '2'), - ('439', '4402', '2006-02-16T02:30:53', '2005-07-29T13:55:36', '2005-08-02T12:23:36', '2'), - ('439', '1746', '2006-02-16T02:30:53', '2005-06-19T08:07:31', '2005-06-28T05:36:31', '1'), - ('439', '2617', '2006-02-16T02:30:53', '2005-06-16T02:28:35', '2005-06-16T22:11:35', '2'), - ('439', '375', '2006-02-16T02:30:53', '2005-07-12T11:49:16', '2005-07-13T07:03:16', '2'), - ('439', '1916', '2006-02-16T02:30:53', '2005-07-30T15:09:15', '2005-07-31T10:23:15', '2'), - ('439', '1689', '2006-02-16T02:30:53', '2005-07-10T20:05:30', '2005-07-14T23:05:30', '1'), - ('439', '1510', '2006-02-16T02:30:53', '2005-08-19T21:04:20', '2005-08-24T20:49:20', '2'), - ('439', '3686', '2006-02-16T02:30:53', '2005-08-17T18:23:58', '2005-08-20T20:31:58', '2'), - ('439', '1277', '2006-02-16T02:30:53', '2005-08-19T01:25:11', '2005-08-27T01:22:11', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['11544', '5801', '15044', '10905', '8703', '367', '786', '14730', '4813', '3774', '2097', '1264', '15653', '10744', '126', '15818', '12621', '12755', '2992', '11042', '9322', '3294', '4528', '6577', '3896', '2560', '10728', '14846', '2688', '10458', '8917', '7722', '4540', '5305', '3837', '218', '1837', '6480', '13021', '13502', '7846', '10818', '4172', '13909', '2644', '723', '9945', '8681', '5980', '15422', '7214', '8501', '8341', '9949', '11964', '5162', '15644', '7868', '8376', '14837', '652', '14244', '9204', '15745', '15945', '1544', '4498', '6474', '7348', '15155', '5831', '5401', '3683', '5941', '14649', '123', '11753', '15800', '6680', '13769', '3718', '10356', '15714', '14534', '5142', '3771', '130', '12713', '4097', '10946', '7942', '7385', '496', '10678', '12537', '11358', '2485', '1795', '569', '11656']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('439', '836', '2006-02-16T02:30:53', '2005-08-17T00:55:07', '2005-08-22T19:25:07', '1'), - ('439', '3511', '2006-02-16T02:30:53', '2005-07-10T14:59:05', '2005-07-14T17:55:05', '2'), - ('439', '4513', '2006-02-16T02:30:53', '2005-08-22T09:51:54', '2005-08-31T12:45:54', '1'), - ('439', '2835', '2006-02-16T02:30:53', '2005-08-02T01:45:59', '2005-08-04T22:28:59', '1'), - ('439', '1065', '2006-02-16T02:30:53', '2005-07-29T17:12:44', '2005-07-30T19:38:44', '1'), - ('439', '3437', '2006-02-16T02:30:53', '2005-05-27T07:37:02', '2005-05-30T05:43:02', '2'), - ('439', '2637', '2006-02-16T02:30:53', '2005-05-29T15:17:28', '2005-06-07T10:07:28', '2'), - ('439', '2949', '2006-02-16T02:30:53', '2005-08-21T22:21:11', '2005-08-30T03:02:11', '1'), - ('439', '2752', '2006-02-16T02:30:53', '2005-07-08T17:09:56', '2005-07-09T22:29:56', '1'), - ('439', '4044', '2006-02-16T02:30:53', '2005-07-06T13:25:07', '2005-07-15T12:56:07', '2'), - ('439', '569', '2006-02-16T02:30:53', '2005-06-17T18:40:04', '2005-06-23T13:49:04', '1'), - ('439', '4176', '2006-02-16T02:30:53', '2005-06-15T06:59:39', '2005-06-18T08:10:39', '2'), - ('439', '2736', '2006-02-16T02:30:53', '2005-08-23T08:34:42', '2005-09-01T03:07:42', '1'), - ('439', '565', '2006-02-16T02:30:53', '2005-08-01T19:56:49', '2005-08-09T16:33:49', '2'), - ('439', '2047', '2006-02-16T02:30:53', '2005-05-25T21:07:59', '2005-05-28T18:51:59', '1'), - ('439', '2620', '2006-02-16T02:30:53', '2005-08-23T14:59:58', '2005-08-27T13:13:58', '2'), - ('439', '4566', '2006-02-16T02:30:53', '2005-08-18T17:31:36', '2005-08-24T16:43:36', '2'), - ('439', '105', '2006-02-16T02:30:53', '2005-08-18T22:38:47', '2005-08-22T23:58:47', '1'), - ('439', '3347', '2006-02-16T02:30:53', '2005-06-20T09:11:51', '2005-06-24T05:59:51', '1'), - ('439', '4149', '2006-02-16T02:30:53', '2005-08-02T06:04:33', '2005-08-11T01:30:33', '1'), - ('439', '223', '2006-02-16T02:30:53', '2005-07-30T17:21:39', '2005-08-06T16:58:39', '2'), - ('439', '2390', '2006-02-16T02:30:53', '2005-06-21T07:03:23', '2005-06-30T02:22:23', '2'), - ('439', '3209', '2006-02-16T02:30:53', '2005-07-08T03:24:54', '2005-07-09T03:50:54', '2'), - ('439', '4191', '2006-02-16T02:30:53', '2005-07-12T06:15:05', '2005-07-15T06:23:05', '1'), - ('309', '1755', '2006-02-16T02:30:53', '2005-07-06T19:09:15', '2005-07-16T00:52:15', '2'), - ('309', '3340', '2006-02-16T02:30:53', '2005-06-19T03:12:42', '2005-06-28T02:28:42', '1'), - ('309', '3133', '2006-02-16T02:30:53', '2005-08-01T19:15:09', '2005-08-04T19:35:09', '1'), - ('309', '3840', '2006-02-16T02:30:53', '2005-08-22T02:13:48', '2005-08-30T05:39:48', '1'), - ('309', '4281', '2006-02-16T02:30:53', '2005-06-19T12:50:56', '2005-06-28T17:58:56', '2'), - ('309', '1500', '2006-02-16T02:30:53', '2005-08-01T09:19:48', '2005-08-02T10:16:48', '1'), - ('309', '4460', '2006-02-16T02:30:53', '2005-07-30T01:47:02', '2005-08-05T21:10:02', '2'), - ('309', '3828', '2006-02-16T02:30:53', '2005-07-28T04:44:58', '2005-07-30T01:29:58', '1'), - ('309', '4160', '2006-02-16T02:30:53', '2005-07-08T04:03:28', '2005-07-13T03:31:28', '2'), - ('309', '625', '2006-02-16T02:30:53', '2005-07-09T15:55:36', '2005-07-18T15:59:36', '1'), - ('309', '3166', '2006-02-16T02:30:53', '2005-07-06T16:27:43', '2005-07-07T18:02:43', '1'), - ('309', '2291', '2006-02-16T02:30:53', '2005-05-26T09:27:09', '2005-06-04T11:53:09', '2'), - ('309', '1259', '2006-02-16T02:30:53', '2005-06-16T23:16:15', '2005-06-21T21:54:15', '1'), - ('309', '3076', '2006-02-16T02:30:53', '2005-07-12T01:49:29', '2005-07-17T01:00:29', '1'), - ('309', '1242', '2006-02-16T02:30:53', '2005-08-19T08:08:04', '2005-08-26T12:04:04', '2'), - ('309', '1324', '2006-02-16T02:30:53', '2005-08-20T01:58:15', '2005-08-21T20:21:15', '1'), - ('309', '4201', '2006-02-16T02:30:53', '2005-07-28T09:21:18', '2005-08-06T07:10:18', '2'), - ('309', '4549', '2006-02-16T02:30:53', '2005-08-01T22:52:45', '2005-08-06T04:07:45', '1'), - ('309', '1158', '2006-02-16T02:30:53', '2005-07-07T09:49:09', '2005-07-11T15:14:09', '2'), - ('309', '1508', '2006-02-16T02:30:53', '2005-08-20T16:26:36', '2005-08-21T20:59:36', '2'), - ('309', '1923', '2006-02-16T02:30:53', '2005-06-19T09:42:30', '2005-06-27T07:23:30', '2'), - ('309', '3407', '2006-02-16T02:30:53', '2005-05-29T05:34:44', '2005-05-30T05:50:44', '1'), - ('309', '2075', '2006-02-16T02:30:53', '2005-07-31T15:47:51', '2005-08-02T19:06:51', '1'), - ('309', '4004', '2006-02-16T02:30:53', '2005-07-29T16:12:01', '2005-08-01T18:14:01', '2'), - ('309', '1777', '2006-02-16T02:30:53', '2005-07-11T00:18:21', '2005-07-14T21:26:21', '1'), - ('309', '2601', '2006-02-16T02:30:53', '2005-08-22T23:58:09', '2005-08-30T19:03:09', '2'), - ('309', '802', '2006-02-16T02:30:53', '2005-07-27T09:23:33', '2005-08-03T13:14:33', '2'), - ('309', '1052', '2006-02-16T02:30:53', '2005-07-29T09:12:51', '2005-07-30T11:19:51', '2'), - ('309', '4208', '2006-02-16T02:30:53', '2005-07-29T04:42:01', '2005-08-04T00:58:01', '1'), - ('309', '3258', '2006-02-16T02:30:53', '2005-07-31T15:50:10', '2005-08-01T17:53:10', '2'), - ('309', '2225', '2006-02-16T02:30:53', '2005-08-17T17:37:03', '2005-08-25T11:55:03', '2'), - ('43', '2765', '2006-02-16T02:30:53', '2005-07-09T09:00:11', '2005-07-17T07:26:11', '1'), - ('43', '3139', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('43', '3589', '2006-02-16T02:30:53', '2005-07-28T10:08:55', '2005-07-30T11:52:55', '1'), - ('43', '3588', '2006-02-16T02:30:53', '2005-07-29T05:25:32', '2005-08-01T07:42:32', '2'), - ('43', '2251', '2006-02-16T02:30:53', '2005-08-22T01:54:52', '2005-08-29T02:24:52', '1'), - ('43', '1201', '2006-02-16T02:30:53', '2005-05-28T20:08:47', '2005-05-29T14:57:47', '2'), - ('43', '1150', '2006-02-16T02:30:53', '2005-08-21T05:29:55', '2005-08-24T01:06:55', '1'), - ('43', '4378', '2006-02-16T02:30:53', '2005-07-30T12:43:58', '2005-08-03T16:26:58', '2'), - ('43', '2737', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('43', '3633', '2006-02-16T02:30:53', '2005-08-23T18:51:41', '2005-08-28T18:42:41', '1'), - ('43', '269', '2006-02-16T02:30:53', '2005-06-16T01:28:22', '2005-06-17T06:57:22', '2'), - ('43', '4299', '2006-02-16T02:30:53', '2005-07-08T02:07:50', '2005-07-12T23:54:50', '2'), - ('43', '310', '2006-02-16T02:30:53', '2005-07-12T01:36:46', '2005-07-16T07:24:46', '2'), - ('43', '3238', '2006-02-16T02:30:53', '2005-07-27T14:32:32', '2005-07-28T17:05:32', '1'), - ('43', '2641', '2006-02-16T02:30:53', '2005-08-22T14:27:46', '2005-08-23T17:46:46', '2'), - ('43', '830', '2006-02-16T02:30:53', '2005-07-10T16:34:02', '2005-07-11T14:27:02', '2'), - ('43', '431', '2006-02-16T02:30:53', '2005-07-09T19:59:10', '2005-07-11T23:21:10', '2'), - ('43', '3020', '2006-02-16T02:30:53', '2005-07-06T09:25:56', '2005-07-14T12:10:56', '1'), - ('43', '492', '2006-02-16T02:30:53', '2005-07-10T22:40:47', '2005-07-17T00:19:47', '2'), - ('43', '4074', '2006-02-16T02:30:53', '2005-08-21T19:19:21', '2005-08-22T17:23:21', '1'), - ('43', '1795', '2006-02-16T02:30:53', '2005-05-25T20:26:42', '2005-05-26T19:41:42', '1'), - ('43', '2599', '2006-02-16T02:30:53', '2005-08-17T09:11:52', '2005-08-25T05:03:52', '2'), - ('43', '963', '2006-02-16T02:30:53', '2005-08-23T14:23:44', '2005-08-29T17:04:44', '2'), - ('43', '2887', '2006-02-16T02:30:53', '2005-07-12T12:01:56', '2005-07-16T17:32:56', '1'), - ('56', '2868', '2006-02-16T02:30:53', '2005-08-20T11:43:52', '2005-08-28T13:19:52', '1'), - ('56', '2624', '2006-02-16T02:30:53', '2005-07-06T10:57:56', '2005-07-12T12:54:56', '1'), - ('56', '313', '2006-02-16T02:30:53', '2005-08-01T05:49:17', '2005-08-10T05:57:17', '1'), - ('56', '2083', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('56', '2514', '2006-02-16T02:30:53', '2005-08-21T15:16:29', '2005-08-26T16:18:29', '1'), - ('56', '369', '2006-02-16T02:30:53', '2005-07-09T08:05:23', '2005-07-13T12:37:23', '2'), - ('56', '1373', '2006-02-16T02:30:53', '2005-07-06T13:19:34', '2005-07-10T10:27:34', '2'), - ('56', '3990', '2006-02-16T02:30:53', '2005-05-25T21:21:56', '2005-05-30T22:41:56', '2'), - ('56', '1505', '2006-02-16T02:30:53', '2005-08-18T21:07:28', '2005-08-24T17:46:28', '1'), - ('56', '2454', '2006-02-16T02:30:53', '2005-07-07T06:10:55', '2005-07-11T02:45:55', '1'), - ('56', '4271', '2006-02-16T02:30:53', '2005-08-02T03:20:39', '2005-08-05T02:59:39', '1'), - ('56', '1636', '2006-02-16T02:30:53', '2005-07-28T12:49:44', '2005-07-31T18:07:44', '2'), - ('56', '2996', '2006-02-16T02:30:53', '2005-07-27T15:49:46', '2005-07-28T13:50:46', '2'), - ('56', '1785', '2006-02-16T02:30:53', '2005-05-28T00:43:41', '2005-06-04T03:56:41', '1'), - ('56', '4438', '2006-02-16T02:30:53', '2005-08-01T17:26:24', '2005-08-05T22:55:24', '1'), - ('56', '57', '2006-02-16T02:30:53', '2005-08-18T14:06:39', '2005-08-25T09:36:39', '2'), - ('56', '2361', '2006-02-16T02:30:53', '2005-08-02T17:45:02', '2005-08-11T18:16:02', '1'), - ('56', '1562', '2006-02-16T02:30:53', '2005-06-18T21:26:03', '2005-06-21T22:09:03', '2'), - ('56', '536', '2006-02-16T02:30:53', '2005-06-16T20:09:01', '2005-06-24T17:50:01', '2'), - ('56', '4534', '2006-02-16T02:30:53', '2005-05-28T10:12:41', '2005-06-03T10:08:41', '2'), - ('56', '1451', '2006-02-16T02:30:53', '2005-08-17T05:11:09', '2005-08-25T07:51:09', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['14291', '15702', '8285', '2140', '2989', '341', '4702', '13560', '7696', '2410', '406', '10705', '13202', '1402', '12135', '12632', '15747', '15299', '3425', '9144', '7375', '3812', '2418', '7645', '9822', '10608', '12237', '3970', '6451', '6116', '1878', '14198', '9173', '13614', '8688', '4735', '835', '6778', '10033', '169', '11519', '5689', '13430', '13995', '14621', '1341', '15215', '4028', '9788', '12183', '7480', '14624', '13014', '13033', '157', '1731', '11116', '1475', '6363', '8561', '4347', '813', '9371', '1297', '13807', '12294', '11110', '13704', '2642', '1633', '12856', '11529', '11069', '2043', '7718', '1707', '8741', '1735', '15147', '12151', '14225', '15635', '7660', '9100', '1965', '935', '14458', '15609', '4182', '1973', '14036', '15861', '4130', '10759', '15864', '2380', '2839', '13457', '738', '13651']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('56', '3988', '2006-02-16T02:30:53', '2005-08-21T07:03:05', '2005-08-26T12:56:05', '2'), - ('56', '1602', '2006-02-16T02:30:53', '2005-08-23T10:23:28', '2005-08-29T11:08:28', '2'), - ('56', '678', '2006-02-16T02:30:53', '2005-07-29T02:00:18', '2005-08-03T20:43:18', '2'), - ('56', '2395', '2006-02-16T02:30:53', '2005-06-17T21:40:29', '2005-06-19T00:42:29', '1'), - ('56', '1586', '2006-02-16T02:30:53', '2005-06-20T08:59:37', '2005-06-22T03:27:37', '2'), - ('56', '4168', '2006-02-16T02:30:53', '2005-05-27T04:01:42', '2005-06-05T08:51:42', '1'), - ('56', '2593', '2006-02-16T02:30:53', '2005-07-08T11:41:36', '2005-07-10T06:55:36', '1'), - ('56', '820', '2006-02-16T02:30:53', '2005-08-20T04:17:16', '2005-08-28T08:38:16', '1'), - ('56', '3463', '2006-02-16T02:30:53', '2005-07-28T03:41:35', '2005-08-06T05:48:35', '2'), - ('381', '265', '2006-02-16T02:30:53', '2005-06-18T16:55:08', '2005-06-20T12:40:08', '2'), - ('381', '2136', '2006-02-16T02:30:53', '2005-05-27T13:46:46', '2005-05-30T12:43:46', '1'), - ('381', '4338', '2006-02-16T02:30:53', '2005-08-01T18:38:54', '2005-08-04T18:00:54', '1'), - ('381', '3546', '2006-02-16T02:30:53', '2005-08-19T14:58:30', '2005-08-27T17:10:30', '1'), - ('381', '1951', '2006-02-16T02:30:53', '2005-06-15T16:31:08', '2005-06-24T19:31:08', '1'), - ('381', '1019', '2006-02-16T02:30:53', '2005-08-17T23:50:24', '2005-08-23T18:01:24', '2'), - ('381', '827', '2006-02-16T02:30:53', '2005-08-18T17:54:21', '2005-08-22T18:58:21', '1'), - ('381', '1517', '2006-02-16T02:30:53', '2005-08-23T12:29:24', '2005-08-31T08:27:24', '2'), - ('381', '767', '2006-02-16T02:30:53', '2005-08-22T19:42:57', '2005-08-23T15:29:57', '2'), - ('381', '4548', '2006-02-16T02:30:53', '2005-06-21T18:07:07', '2005-06-27T22:59:07', '2'), - ('381', '718', '2006-02-16T02:30:53', '2005-07-30T10:22:15', '2005-08-05T08:14:15', '1'), - ('381', '2970', '2006-02-16T02:30:53', '2005-07-27T15:22:33', '2005-08-01T20:06:33', '1'), - ('381', '4490', '2006-02-16T02:30:53', '2005-07-06T15:22:19', '2005-07-08T13:04:19', '1'), - ('381', '2756', '2006-02-16T02:30:53', '2005-06-18T17:14:42', '2005-06-26T16:33:42', '1'), - ('381', '830', '2006-02-16T02:30:53', '2005-07-28T01:27:42', '2005-08-03T07:16:42', '2'), - ('381', '2469', '2006-02-16T02:30:53', '2005-07-31T11:48:25', '2005-08-05T15:52:25', '2'), - ('381', '3835', '2006-02-16T02:30:53', '2005-08-01T14:48:41', '2005-08-04T17:32:41', '2'), - ('381', '4422', '2006-02-16T02:30:53', '2005-08-18T03:24:38', '2005-08-25T09:05:38', '1'), - ('381', '701', '2006-02-16T02:30:53', '2005-07-06T22:48:17', '2005-07-15T19:07:17', '1'), - ('381', '1008', '2006-02-16T02:30:53', '2005-07-12T00:52:19', '2005-07-16T21:30:19', '2'), - ('381', '247', '2006-02-16T02:30:53', '2005-07-11T07:37:38', '2005-07-14T11:53:38', '2'), - ('381', '3319', '2006-02-16T02:30:53', '2005-06-17T02:55:32', '2005-06-21T03:44:32', '1'), - ('381', '465', '2006-02-16T02:30:53', '2005-08-21T03:48:31', '2005-08-24T07:10:31', '2'), - ('381', '2103', '2006-02-16T02:30:53', '2005-07-30T11:40:10', '2005-08-04T05:40:10', '2'), - ('381', '3736', '2006-02-16T02:30:53', '2005-08-20T06:28:37', '2005-08-22T07:54:37', '2'), - ('381', '2263', '2006-02-16T02:30:53', '2005-07-29T16:31:32', '2005-07-30T12:39:32', '1'), - ('381', '4324', '2006-02-16T02:30:53', '2005-07-08T13:12:27', '2005-07-13T10:06:27', '2'), - ('381', '299', '2006-02-16T02:30:53', '2005-05-29T23:37:00', '2005-06-02T23:38:00', '1'), - ('381', '4503', '2006-02-16T02:30:53', '2005-07-12T16:06:00', '2005-07-14T21:57:00', '2'), - ('381', '4480', '2006-02-16T02:30:53', '2005-07-31T18:44:29', '2005-08-04T19:52:29', '1'), - ('381', '1758', '2006-02-16T02:30:53', '2005-05-26T03:09:30', '2005-05-27T01:37:30', '2'), - ('381', '1034', '2006-02-16T02:30:53', '2005-08-17T00:01:27', '2005-08-19T04:54:27', '2'), - ('381', '1731', '2006-02-16T02:30:53', '2005-07-10T09:24:17', '2005-07-15T05:36:17', '1'), - ('381', '2852', '2006-02-16T02:30:53', '2005-08-19T23:25:43', '2005-08-22T18:41:43', '1'), - ('381', '3789', '2006-02-16T02:30:53', '2005-08-20T19:34:43', '2005-08-25T22:25:43', '2'), - ('344', '3622', '2006-02-16T02:30:53', '2005-08-21T18:17:59', '2005-08-23T14:16:59', '1'), - ('344', '3363', '2006-02-16T02:30:53', '2005-06-15T12:26:18', '2005-06-21T07:26:18', '2'), - ('344', '1906', '2006-02-16T02:30:53', '2005-08-22T16:55:26', '2005-08-25T20:19:26', '1'), - ('344', '1651', '2006-02-16T02:30:53', '2005-07-07T02:19:14', '2005-07-15T08:09:14', '2'), - ('344', '4367', '2006-02-16T02:30:53', '2005-07-31T10:28:21', '2005-08-09T13:45:21', '1'), - ('344', '3153', '2006-02-16T02:30:53', '2005-08-18T01:34:13', '2005-08-24T04:38:13', '1'), - ('344', '452', '2006-02-16T02:30:53', '2005-07-27T19:19:53', '2005-08-02T01:01:53', '1'), - ('344', '4', '2006-02-16T02:30:53', '2005-08-21T18:32:42', '2005-08-23T21:09:42', '1'), - ('344', '3400', '2006-02-16T02:30:53', '2005-08-19T07:56:08', '2005-08-21T10:20:08', '2'), - ('344', '1682', '2006-02-16T02:30:53', '2005-08-19T08:34:39', '2005-08-28T10:13:39', '1'), - ('344', '887', '2006-02-16T02:30:53', '2005-05-26T01:25:21', '2005-05-26T21:17:21', '2'), - ('344', '3698', '2006-02-16T02:30:53', '2005-06-16T15:32:12', '2005-06-19T18:58:12', '2'), - ('344', '434', '2006-02-16T02:30:53', '2005-08-02T08:34:40', '2005-08-09T04:56:40', '1'), - ('344', '1834', '2006-02-16T02:30:53', '2005-06-15T21:08:01', '2005-06-18T22:33:01', '2'), - ('344', '4167', '2006-02-16T02:30:53', '2005-07-11T21:13:19', '2005-07-20T15:44:19', '1'), - ('344', '2207', '2006-02-16T02:30:53', '2005-07-29T11:29:12', '2005-08-05T09:17:12', '1'), - ('344', '1964', '2006-02-16T02:30:53', '2005-07-07T18:58:57', '2005-07-14T16:35:57', '2'), - ('344', '4554', '2006-02-16T02:30:53', '2005-05-29T20:14:34', '2005-06-05T20:56:34', '1'), - ('4', '2980', '2006-02-16T02:30:53', '2005-07-30T18:58:00', '2005-08-03T15:14:00', '1'), - ('4', '1075', '2006-02-16T02:30:53', '2005-06-15T09:31:28', '2005-06-19T04:33:28', '1'), - ('4', '3822', '2006-02-16T02:30:53', '2005-08-20T12:55:40', '2005-08-28T09:06:40', '2'), - ('4', '2479', '2006-02-16T02:30:53', '2005-08-18T05:14:44', '2005-08-27T01:32:44', '2'), - ('4', '4311', '2006-02-16T02:30:53', '2005-08-02T08:20:31', '2005-08-04T05:06:31', '2'), - ('4', '3373', '2006-02-16T02:30:53', '2005-08-20T09:32:04', '2005-08-23T14:29:04', '2'), - ('4', '2065', '2006-02-16T02:30:53', '2005-06-19T09:39:01', '2005-06-25T08:33:01', '1'), - ('4', '280', '2006-02-16T02:30:53', '2005-06-16T08:08:40', '2005-06-17T11:12:40', '1'), - ('4', '132', '2006-02-16T02:30:53', '2005-08-19T02:19:13', '2005-08-23T07:49:13', '2'), - ('4', '3071', '2006-02-16T02:30:53', '2005-08-17T00:28:01', '2005-08-19T04:47:01', '2'), - ('4', '57', '2006-02-16T02:30:53', '2005-08-02T07:09:34', '2005-08-08T08:39:34', '1'), - ('4', '2495', '2006-02-16T02:30:53', '2005-06-17T14:31:12', '2005-06-19T11:04:12', '2'), - ('4', '3587', '2006-02-16T02:30:53', '2005-07-28T04:37:59', '2005-07-29T09:20:59', '2'), - ('4', '185', '2006-02-16T02:30:53', '2005-06-16T14:01:27', '2005-06-18T09:35:27', '1'), - ('4', '165', '2006-02-16T02:30:53', '2005-07-29T18:44:57', '2005-08-03T18:25:57', '2'), - ('4', '97', '2006-02-16T02:30:53', '2005-06-16T15:51:52', '2005-06-20T13:27:52', '1'), - ('4', '2553', '2006-02-16T02:30:53', '2005-08-22T13:58:23', '2005-08-28T14:33:23', '2'), - ('4', '1976', '2006-02-16T02:30:53', '2005-08-18T00:14:03', '2005-08-18T23:52:03', '2'), - ('4', '984', '2006-02-16T02:30:53', '2005-08-21T04:53:37', '2005-08-25T23:39:37', '2'), - ('4', '3308', '2006-02-16T02:30:53', '2005-08-23T07:43:00', '2005-08-27T10:47:00', '1'), - ('4', '4385', '2006-02-16T02:30:53', '2005-07-28T02:10:10', '2005-07-30T04:29:10', '2'), - ('4', '4117', '2006-02-16T02:30:53', '2005-07-30T08:46:09', '2005-08-05T10:34:09', '1'), - ('256', '480', '2006-02-16T02:30:53', '2005-06-17T09:17:39', '2005-06-18T12:35:39', '2'), - ('256', '2421', '2006-02-16T02:30:53', '2005-05-30T13:29:36', '2005-06-02T11:08:36', '1'), - ('256', '1769', '2006-02-16T02:30:53', '2005-08-21T12:47:53', '2005-08-30T17:09:53', '2'), - ('256', '1730', '2006-02-16T02:30:53', '2005-08-23T06:56:04', '2005-09-01T03:25:04', '1'), - ('256', '3080', '2006-02-16T02:30:53', '2005-07-07T10:28:00', '2005-07-08T12:50:00', '1'), - ('256', '3669', '2006-02-16T02:30:53', '2005-06-17T09:26:15', '2005-06-21T10:18:15', '1'), - ('256', '202', '2006-02-16T02:30:53', '2005-08-20T21:35:27', '2005-08-23T03:29:27', '1'), - ('256', '1859', '2006-02-16T02:30:53', '2005-08-23T16:15:45', '2005-09-01T11:37:45', '2'), - ('256', '4170', '2006-02-16T02:30:53', '2005-07-07T07:51:53', '2005-07-11T12:41:53', '2'), - ('256', '3528', '2006-02-16T02:30:53', '2005-08-01T20:22:51', '2005-08-07T22:07:51', '1'), - ('256', '3014', '2006-02-16T02:30:53', '2005-08-23T16:18:12', '2005-08-29T17:10:12', '2'), - ('256', '4413', '2006-02-16T02:30:53', '2005-06-18T15:00:04', '2005-06-24T13:29:04', '2'), - ('256', '3856', '2006-02-16T02:30:53', '2005-06-19T22:07:24', '2005-06-23T16:37:24', '2'), - ('256', '1220', '2006-02-16T02:30:53', '2005-08-20T00:33:22', '2005-08-26T21:37:22', '2'), - ('256', '2284', '2006-02-16T02:30:53', '2005-05-29T08:20:08', '2005-06-06T08:59:08', '2'), - ('256', '1082', '2006-02-16T02:30:53', '2005-08-20T07:50:08', '2005-08-21T07:11:08', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['51', '2230', '11628', '11011', '14003', '1555', '2561', '1116', '14445', '5179', '7661', '232', '6298', '9424', '15803', '779', '485', '5429', '12899', '327', '473', '13751', '5542', '15624', '1991', '14048', '5261', '9198', '1789', '7442', '9124', '2635', '10513', '6546', '5677', '12217', '9210', '15688', '13057', '8980', '1499', '11008', '10859', '10589', '3981', '307', '2236', '10672', '873', '4335', '15505', '1404', '12663', '12122', '7856', '8900', '10961', '5474', '412', '10274', '10640', '15004', '749', '13836', '6216', '6456', '841', '7497', '13034', '11682', '302', '12153', '14279', '10838', '697', '1465', '13645', '2981', '8090', '10564', '1464', '6517', '14979', '13082', '1127', '2068', '3378', '2100', '12936', '13772', '10519', '3881', '13348', '1288', '7248', '2103', '3743', '12188', '2192', '2146']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('256', '1257', '2006-02-16T02:30:53', '2005-05-25T06:49:10', '2005-05-26T06:42:10', '1'), - ('256', '833', '2006-02-16T02:30:53', '2005-06-18T03:50:49', '2005-06-25T01:12:49', '2'), - ('256', '3656', '2006-02-16T02:30:53', '2005-08-17T04:27:18', '2005-08-25T01:12:18', '2'), - ('256', '3981', '2006-02-16T02:30:53', '2005-08-02T05:07:07', '2005-08-09T07:16:07', '1'), - ('256', '3165', '2006-02-16T02:30:53', '2005-08-20T20:16:06', '2005-08-28T14:36:06', '1'), - ('256', '4168', '2006-02-16T02:30:53', '2005-06-16T02:17:07', '2005-06-22T06:28:07', '1'), - ('256', '4128', '2006-02-16T02:30:53', '2005-06-19T03:14:52', '2005-06-21T02:42:52', '2'), - ('256', '1356', '2006-02-16T02:30:53', '2005-05-31T16:10:46', '2005-06-01T20:27:46', '2'), - ('256', '3186', '2006-02-16T02:30:53', '2005-08-21T12:07:42', '2005-08-22T17:51:42', '2'), - ('256', '2995', '2006-02-16T02:30:53', '2005-07-09T10:00:44', '2005-07-11T06:52:44', '1'), - ('256', '3060', '2006-02-16T02:30:53', '2005-07-28T02:10:27', '2005-08-05T03:45:27', '2'), - ('256', '2945', '2006-02-16T02:30:53', '2005-05-26T11:38:05', '2005-05-27T08:42:05', '2'), - ('256', '3906', '2006-02-16T02:30:53', '2005-07-11T17:42:33', '2005-07-13T18:14:33', '2'), - ('256', '4499', '2006-02-16T02:30:53', '2005-07-30T21:10:56', '2005-08-05T00:01:56', '1'), - ('105', '500', '2006-02-16T02:30:53', '2005-08-23T14:27:07', '2005-08-28T12:01:07', '2'), - ('105', '533', '2006-02-16T02:30:53', '2005-05-29T14:17:17', '2005-06-06T16:46:17', '1'), - ('105', '2392', '2006-02-16T02:30:53', '2005-05-27T23:40:52', '2005-05-28T22:40:52', '2'), - ('105', '2467', '2006-02-16T02:30:53', '2005-07-09T21:14:03', '2005-07-18T01:33:03', '1'), - ('105', '830', '2006-02-16T02:30:53', '2005-08-19T04:03:34', '2005-08-20T08:34:34', '2'), - ('105', '2678', '2006-02-16T02:30:53', '2005-05-27T01:18:57', '2005-06-04T04:06:57', '1'), - ('105', '802', '2006-02-16T02:30:53', '2005-05-27T21:36:34', '2005-06-05T17:02:34', '1'), - ('105', '185', '2006-02-16T02:30:53', '2005-08-20T11:17:03', '2005-08-22T14:12:03', '2'), - ('105', '1713', '2006-02-16T02:30:53', '2005-07-10T02:45:53', '2005-07-15T23:23:53', '2'), - ('105', '396', '2006-02-16T02:30:53', '2005-08-23T07:24:27', '2005-08-29T12:36:27', '2'), - ('105', '3963', '2006-02-16T02:30:53', '2005-06-17T10:49:23', '2005-06-25T10:48:23', '1'), - ('105', '3475', '2006-02-16T02:30:53', '2005-08-20T22:03:18', '2005-08-25T02:57:18', '2'), - ('105', '2899', '2006-02-16T02:30:53', '2005-07-09T14:06:56', '2005-07-11T14:21:56', '2'), - ('105', '2371', '2006-02-16T02:30:53', '2005-07-30T12:37:08', '2005-08-07T16:37:08', '2'), - ('105', '4264', '2006-02-16T02:30:53', '2005-06-16T19:49:18', '2005-06-23T17:07:18', '2'), - ('105', '2471', '2006-02-16T02:30:53', '2005-07-27T17:47:00', '2005-07-28T21:37:00', '1'), - ('105', '4552', '2006-02-16T02:30:53', '2005-07-30T09:43:12', '2005-08-06T06:17:12', '1'), - ('105', '3332', '2006-02-16T02:30:53', '2005-06-19T09:08:45', '2005-06-26T09:20:45', '1'), - ('105', '4057', '2006-02-16T02:30:53', '2005-08-01T11:37:34', '2005-08-02T17:15:34', '2'), - ('105', '393', '2006-02-16T02:30:53', '2005-07-12T04:57:17', '2005-07-17T09:29:17', '2'), - ('105', '2647', '2006-02-16T02:30:53', '2005-07-10T08:41:28', '2005-07-12T09:05:28', '2'), - ('105', '2556', '2006-02-16T02:30:53', '2005-08-18T02:44:44', '2005-08-24T03:27:44', '1'), - ('105', '101', '2006-02-16T02:30:53', '2005-07-30T12:56:44', '2005-08-08T09:41:44', '2'), - ('105', '2851', '2006-02-16T02:30:53', '2005-08-23T09:48:45', '2005-08-30T10:28:45', '2'), - ('105', '876', '2006-02-16T02:30:53', '2005-08-19T09:40:05', '2005-08-28T13:22:05', '2'), - ('105', '3061', '2006-02-16T02:30:53', '2005-07-30T04:22:15', '2005-08-04T08:16:15', '1'), - ('375', '165', '2006-02-16T02:30:53', '2005-06-15T21:58:07', '2005-06-22T19:37:07', '2'), - ('375', '2831', '2006-02-16T02:30:53', '2005-08-02T05:06:17', '2005-08-10T01:22:17', '2'), - ('375', '277', '2006-02-16T02:30:53', '2005-08-02T00:11:39', '2005-08-08T19:52:39', '1'), - ('375', '4280', '2006-02-16T02:30:53', '2005-08-01T14:11:09', '2005-08-09T09:28:09', '2'), - ('375', '842', '2006-02-16T02:30:53', '2005-07-06T23:12:12', '2005-07-13T01:47:12', '2'), - ('375', '1097', '2006-02-16T02:30:53', '2005-05-26T21:48:13', '2005-06-04T22:24:13', '1'), - ('375', '4001', '2006-02-16T02:30:53', '2005-06-18T04:12:33', '2005-06-23T04:07:33', '1'), - ('375', '3674', '2006-02-16T02:30:53', '2005-08-01T17:10:54', '2005-08-07T12:19:54', '2'), - ('375', '4568', '2006-02-16T02:30:53', '2005-05-30T05:15:20', '2005-06-07T00:49:20', '2'), - ('375', '1332', '2006-02-16T02:30:53', '2005-07-07T18:33:57', '2005-07-11T13:23:57', '1'), - ('375', '1144', '2006-02-16T02:30:53', '2005-08-23T02:46:13', '2005-08-26T23:34:13', '2'), - ('375', '2776', '2006-02-16T02:30:53', '2005-06-15T16:38:53', '2005-06-16T20:37:53', '1'), - ('375', '1163', '2006-02-16T02:30:53', '2005-08-18T19:10:52', '2005-08-19T15:46:52', '1'), - ('375', '4030', '2006-02-16T02:30:53', '2005-08-17T23:20:45', '2005-08-25T04:23:45', '2'), - ('375', '2376', '2006-02-16T02:30:53', '2005-07-28T09:48:24', '2005-07-29T09:49:24', '2'), - ('375', '3057', '2006-02-16T02:30:53', '2005-07-30T01:07:03', '2005-08-06T04:07:03', '1'), - ('375', '1416', '2006-02-16T02:30:53', '2005-08-02T03:47:55', '2005-08-09T02:03:55', '1'), - ('375', '3608', '2006-02-16T02:30:53', '2005-07-09T23:23:57', '2005-07-15T03:11:57', '1'), - ('375', '1400', '2006-02-16T02:30:53', '2005-05-27T14:17:23', '2005-05-29T15:07:23', '2'), - ('375', '2916', '2006-02-16T02:30:53', '2005-08-01T03:16:51', '2005-08-04T22:22:51', '2'), - ('375', '3020', '2006-02-16T02:30:53', '2005-08-01T15:44:51', '2005-08-06T15:52:51', '1'), - ('375', '4464', '2006-02-16T02:30:53', '2005-08-22T08:15:21', '2005-08-28T10:35:21', '1'), - ('375', '1146', '2006-02-16T02:30:53', '2005-05-29T09:33:33', '2005-05-31T11:45:33', '2'), - ('375', '4271', '2006-02-16T02:30:53', '2005-08-20T14:18:16', '2005-08-21T18:13:16', '2'), - ('387', '3571', '2006-02-16T02:30:53', '2005-07-11T12:57:05', '2005-07-13T12:31:05', '1'), - ('387', '259', '2006-02-16T02:30:53', '2005-07-12T01:05:11', '2005-07-20T23:26:11', '2'), - ('387', '4318', '2006-02-16T02:30:53', '2005-05-30T00:31:17', '2005-06-02T19:14:17', '1'), - ('387', '286', '2006-02-16T02:30:53', '2005-07-27T20:05:27', '2005-07-30T22:47:27', '1'), - ('387', '990', '2006-02-16T02:30:53', '2005-08-19T08:41:29', '2005-08-20T07:36:29', '2'), - ('387', '2544', '2006-02-16T02:30:53', '2005-08-17T06:13:40', '2005-08-18T06:11:40', '1'), - ('387', '2921', '2006-02-16T02:30:53', '2005-05-26T21:13:46', '2005-06-03T15:49:46', '2'), - ('387', '3929', '2006-02-16T02:30:53', '2005-08-18T00:22:30', '2005-08-23T04:13:30', '2'), - ('387', '3325', '2006-02-16T02:30:53', '2005-08-21T06:39:08', '2005-08-29T11:01:08', '2'), - ('387', '69', '2006-02-16T02:30:53', '2005-08-01T23:36:10', '2005-08-05T04:55:10', '2'), - ('387', '3949', '2006-02-16T02:30:53', '2005-05-29T02:04:04', '2005-06-04T00:47:04', '2'), - ('387', '609', '2006-02-16T02:30:53', '2005-06-15T20:43:08', '2005-06-18T23:00:08', '1'), - ('387', '157', '2006-02-16T02:30:53', '2005-08-20T07:47:05', '2005-08-23T02:58:05', '1'), - ('387', '522', '2006-02-16T02:30:53', '2005-06-20T08:35:17', '2005-06-28T09:14:17', '1'), - ('387', '1336', '2006-02-16T02:30:53', '2005-07-28T18:27:29', '2005-08-02T14:08:29', '2'), - ('387', '4469', '2006-02-16T02:30:53', '2005-08-01T13:07:34', '2005-08-06T15:14:34', '2'), - ('387', '4113', '2006-02-16T02:30:53', '2005-06-15T20:38:14', '2005-06-17T14:52:14', '2'), - ('387', '185', '2006-02-16T02:30:53', '2005-07-12T03:52:39', '2005-07-20T08:00:39', '1'), - ('387', '2320', '2006-02-16T02:30:53', '2005-08-22T07:16:36', '2005-08-24T02:29:36', '2'), - ('387', '2117', '2006-02-16T02:30:53', '2005-08-19T10:19:19', '2005-08-28T05:02:19', '1'), - ('387', '2412', '2006-02-16T02:30:53', '2005-05-31T17:45:49', '2005-06-08T22:41:49', '2'), - ('387', '4252', '2006-02-16T02:30:53', '2005-06-17T16:11:46', '2005-06-20T11:28:46', '1'), - ('387', '35', '2006-02-16T02:30:53', '2005-06-21T13:51:28', '2005-06-25T09:21:28', '1'), - ('387', '2267', '2006-02-16T02:30:53', '2005-06-17T18:53:21', '2005-06-19T21:49:21', '2'), - ('387', '654', '2006-02-16T02:30:53', '2005-08-19T05:25:06', '2005-08-28T08:21:06', '1'), - ('387', '2038', '2006-02-16T02:30:53', '2005-08-20T11:47:52', '2005-08-28T05:50:52', '2'), - ('456', '1967', '2006-02-16T02:30:53', '2005-08-01T11:44:13', '2005-08-09T16:57:13', '1'), - ('456', '143', '2006-02-16T02:30:53', '2005-07-06T18:35:37', '2005-07-10T00:06:37', '2'), - ('456', '275', '2006-02-16T02:30:53', '2005-08-19T20:31:48', '2005-08-21T21:01:48', '1'), - ('456', '830', '2006-02-16T02:30:53', '2005-06-15T08:41:52', '2005-06-19T05:30:52', '2'), - ('456', '4256', '2006-02-16T02:30:53', '2005-07-27T10:37:45', '2005-08-01T13:13:45', '1'), - ('456', '1469', '2006-02-16T02:30:53', '2005-06-17T19:13:10', '2005-06-21T21:32:10', '2'), - ('456', '1012', '2006-02-16T02:30:53', '2005-07-06T12:03:54', '2005-07-13T10:56:54', '2'), - ('456', '2989', '2006-02-16T02:30:53', '2005-08-18T01:51:43', '2005-08-18T22:23:43', '1'), - ('456', '1886', '2006-02-16T02:30:53', '2005-06-18T01:35:47', '2005-06-23T23:38:47', '2'), - ('456', '326', '2006-02-16T02:30:53', '2005-06-17T22:26:23', '2005-06-26T17:10:23', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['1700', '2404', '13547', '19', '2581', '13144', '4141', '14690', '6023', '15720', '8749', '15910', '10813', '5964', '14253', '11356', '11866', '8462', '5110', '270', '2717', '1296', '15961', '3580', '14034', '14521', '6181', '10685', '6167', '2667', '7574', '2227', '15742', '15691', '9527', '1309', '13737', '6947', '3190', '8368', '6123', '1899', '14767', '15547', '11943', '4265', '12121', '11995', '13023', '9193', '5569', '14685', '6785', '3358', '10074', '14311', '9612', '3883', '12012', '6385', '4427', '765', '584', '12966', '6297', '1549', '8649', '10139', '9854', '11247', '14796', '8617', '3629', '4208', '8427', '13932', '8575', '8281', '823', '2328', '14878', '3695', '1602', '13739', '15070', '5811', '10846', '8237', '4084', '9644', '6642', '5129', '13483', '6636', '6941', '9145', '2503', '8279', '1062', '1291']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('456', '4251', '2006-02-16T02:30:53', '2005-06-16T13:18:23', '2005-06-21T16:46:23', '2'), - ('456', '4138', '2006-02-16T02:30:53', '2005-06-18T16:33:48', '2005-06-23T20:39:48', '2'), - ('456', '3122', '2006-02-16T02:30:53', '2005-08-20T03:53:16', '2005-08-25T04:02:16', '1'), - ('456', '1941', '2006-02-16T02:30:53', '2005-05-25T01:17:24', '2005-05-31T06:00:24', '1'), - ('456', '376', '2006-02-16T02:30:53', '2005-06-19T04:54:13', '2005-06-23T23:28:13', '2'), - ('456', '3766', '2006-02-16T02:30:53', '2005-08-19T12:45:55', '2005-08-27T10:37:55', '2'), - ('456', '1904', '2006-02-16T02:30:53', '2005-07-07T08:19:20', '2005-07-11T06:54:20', '1'), - ('456', '3649', '2006-02-16T02:30:53', '2005-08-21T20:42:25', '2005-08-29T18:42:25', '2'), - ('456', '3794', '2006-02-16T02:30:53', '2005-07-11T02:15:57', '2005-07-15T21:30:57', '2'), - ('456', '2490', '2006-02-16T02:30:53', '2005-08-23T11:15:20', '2005-08-31T09:49:20', '1'), - ('456', '2252', '2006-02-16T02:30:53', '2005-07-29T19:13:15', '2005-08-01T15:02:15', '1'), - ('456', '254', '2006-02-16T02:30:53', '2005-08-23T17:43:16', '2005-08-24T21:55:16', '2'), - ('456', '3580', '2006-02-16T02:30:53', '2005-08-01T22:43:00', '2005-08-03T21:43:00', '1'), - ('456', '3981', '2006-02-16T02:30:53', '2005-07-10T23:47:18', '2005-07-12T03:55:18', '2'), - ('456', '4246', '2006-02-16T02:30:53', '2005-08-21T05:47:52', '2005-08-25T04:28:52', '1'), - ('200', '303', '2006-02-16T02:30:53', '2005-08-02T17:42:40', '2005-08-11T23:29:40', '1'), - ('200', '2758', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('200', '3633', '2006-02-16T02:30:53', '2005-07-29T08:15:42', '2005-08-04T03:57:42', '1'), - ('200', '195', '2006-02-16T02:30:53', '2005-07-09T06:57:25', '2005-07-12T05:39:25', '2'), - ('200', '207', '2006-02-16T02:30:53', '2005-05-26T16:20:56', '2005-06-03T12:40:56', '2'), - ('200', '140', '2006-02-16T02:30:53', '2005-06-19T14:46:10', '2005-06-22T20:17:10', '1'), - ('200', '1760', '2006-02-16T02:30:53', '2005-06-15T09:23:59', '2005-06-19T03:44:59', '2'), - ('200', '4006', '2006-02-16T02:30:53', '2005-08-23T19:35:42', '2005-08-30T22:52:42', '1'), - ('200', '3837', '2006-02-16T02:30:53', '2005-07-06T03:48:44', '2005-07-13T01:15:44', '2'), - ('200', '3484', '2006-02-16T02:30:53', '2005-08-20T21:31:52', '2005-08-29T00:13:52', '1'), - ('200', '1538', '2006-02-16T02:30:53', '2005-08-21T15:01:32', '2005-08-28T19:12:32', '1'), - ('200', '4398', '2006-02-16T02:30:53', '2005-07-11T11:10:11', '2005-07-15T09:33:11', '1'), - ('200', '2029', '2006-02-16T02:30:53', '2005-08-01T17:49:38', '2005-08-07T21:04:38', '2'), - ('200', '3255', '2006-02-16T02:30:53', '2005-07-11T10:21:21', '2005-07-14T15:38:21', '1'), - ('200', '1028', '2006-02-16T02:30:53', '2005-06-19T11:28:46', '2005-06-27T11:48:46', '2'), - ('200', '298', '2006-02-16T02:30:53', '2005-07-27T22:53:00', '2005-07-29T18:39:00', '2'), - ('200', '3623', '2006-02-16T02:30:53', '2005-06-18T03:43:23', '2005-06-19T05:55:23', '2'), - ('200', '1339', '2006-02-16T02:30:53', '2005-08-23T12:11:37', '2005-08-31T07:28:37', '2'), - ('200', '784', '2006-02-16T02:30:53', '2005-08-23T09:53:54', '2005-08-27T10:14:54', '1'), - ('200', '2539', '2006-02-16T02:30:53', '2005-07-31T01:02:24', '2005-08-09T02:08:24', '2'), - ('200', '2356', '2006-02-16T02:30:53', '2005-06-15T10:10:49', '2005-06-16T12:44:49', '1'), - ('200', '4319', '2006-02-16T02:30:53', '2005-08-20T10:41:50', '2005-08-25T14:33:50', '2'), - ('200', '760', '2006-02-16T02:30:53', '2005-07-26T23:42:03', '2005-08-02T05:06:03', '2'), - ('200', '351', '2006-02-16T02:30:53', '2005-06-20T23:27:15', '2005-06-28T01:22:15', '2'), - ('200', '1410', '2006-02-16T02:30:53', '2005-07-29T05:15:41', '2005-08-07T01:35:41', '1'), - ('200', '1354', '2006-02-16T02:30:53', '2005-07-11T08:02:27', '2005-07-15T08:58:27', '2'), - ('200', '858', '2006-02-16T02:30:53', '2005-06-17T04:29:15', '2005-06-26T08:39:15', '1'), - ('69', '1232', '2006-02-16T02:30:53', '2005-08-21T23:43:00', '2005-08-29T05:26:00', '1'), - ('69', '1488', '2006-02-16T02:30:53', '2005-08-23T04:25:50', '2005-08-26T00:57:50', '1'), - ('69', '4466', '2006-02-16T02:30:53', '2005-08-17T17:00:42', '2005-08-26T22:07:42', '1'), - ('69', '1685', '2006-02-16T02:30:53', '2005-07-07T14:27:51', '2005-07-12T19:55:51', '2'), - ('69', '3423', '2006-02-16T02:30:53', '2005-08-17T23:20:40', '2005-08-22T21:30:40', '2'), - ('69', '3953', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('69', '1566', '2006-02-16T02:30:53', '2005-08-19T08:13:54', '2005-08-27T13:18:54', '1'), - ('69', '3470', '2006-02-16T02:30:53', '2005-07-30T12:28:42', '2005-08-02T12:17:42', '2'), - ('69', '2835', '2006-02-16T02:30:53', '2005-07-10T03:38:32', '2005-07-16T00:02:32', '2'), - ('69', '1320', '2006-02-16T02:30:53', '2005-08-21T20:31:25', '2005-08-22T21:02:25', '1'), - ('69', '4448', '2006-02-16T02:30:53', '2005-07-12T16:30:57', '2005-07-18T20:46:57', '1'), - ('69', '1772', '2006-02-16T02:30:53', '2005-06-21T11:56:40', '2005-06-26T08:28:40', '2'), - ('69', '1268', '2006-02-16T02:30:53', '2005-07-31T19:57:16', '2005-08-04T00:54:16', '1'), - ('69', '1761', '2006-02-16T02:30:53', '2005-08-21T07:45:47', '2005-08-27T02:23:47', '2'), - ('69', '2142', '2006-02-16T02:30:53', '2005-07-31T03:58:31', '2005-08-04T07:34:31', '2'), - ('69', '3238', '2006-02-16T02:30:53', '2005-07-06T18:39:38', '2005-07-14T15:59:38', '2'), - ('69', '2698', '2006-02-16T02:30:53', '2005-08-17T19:20:48', '2005-08-22T16:50:48', '1'), - ('69', '1830', '2006-02-16T02:30:53', '2005-07-11T22:07:32', '2005-07-20T16:57:32', '1'), - ('69', '1021', '2006-02-16T02:30:53', '2005-07-07T22:28:51', '2005-07-11T21:37:51', '2'), - ('69', '515', '2006-02-16T02:30:53', '2005-05-29T11:38:34', '2005-06-02T17:04:34', '1'), - ('69', '1833', '2006-02-16T02:30:53', '2005-05-28T11:49:00', '2005-06-01T11:54:00', '1'), - ('69', '3196', '2006-02-16T02:30:53', '2005-08-19T06:37:48', '2005-08-26T03:59:48', '2'), - ('69', '2738', '2006-02-16T02:30:53', '2005-07-11T17:37:22', '2005-07-19T13:54:22', '2'), - ('69', '266', '2006-02-16T02:30:53', '2005-06-16T01:57:15', '2005-06-18T23:30:15', '1'), - ('69', '789', '2006-02-16T02:30:53', '2005-07-29T14:57:33', '2005-08-07T09:43:33', '2'), - ('441', '407', '2006-02-16T02:30:53', '2005-07-31T22:02:20', '2005-08-04T02:09:20', '1'), - ('441', '1049', '2006-02-16T02:30:53', '2005-07-31T12:59:34', '2005-08-03T07:20:34', '2'), - ('441', '1661', '2006-02-16T02:30:53', '2005-08-02T13:34:08', '2005-08-06T16:23:08', '2'), - ('441', '941', '2006-02-16T02:30:53', '2005-08-22T00:40:49', '2005-08-30T03:59:49', '1'), - ('441', '385', '2006-02-16T02:30:53', '2005-07-29T13:46:14', '2005-08-06T13:26:14', '2'), - ('441', '4019', '2006-02-16T02:30:53', '2005-07-06T06:23:22', '2005-07-08T09:32:22', '2'), - ('441', '3617', '2006-02-16T02:30:53', '2005-07-07T11:34:22', '2005-07-09T08:25:22', '1'), - ('441', '1624', '2006-02-16T02:30:53', '2005-07-29T07:08:36', '2005-07-30T11:54:36', '2'), - ('441', '471', '2006-02-16T02:30:53', '2005-08-20T17:17:00', '2005-08-24T14:06:00', '1'), - ('441', '1668', '2006-02-16T02:30:53', '2005-07-29T11:52:47', '2005-08-03T08:14:47', '2'), - ('441', '899', '2006-02-16T02:30:53', '2005-07-29T01:46:00', '2005-08-04T23:09:00', '1'), - ('441', '3249', '2006-02-16T02:30:53', '2005-05-29T21:39:37', '2005-05-30T22:06:37', '1'), - ('441', '2304', '2006-02-16T02:30:53', '2005-06-18T10:17:21', '2005-06-21T04:18:21', '1'), - ('441', '1202', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('441', '2823', '2006-02-16T02:30:53', '2005-07-06T10:02:08', '2005-07-09T15:43:08', '1'), - ('441', '1777', '2006-02-16T02:30:53', '2005-06-16T06:12:40', '2005-06-19T03:50:40', '2'), - ('441', '3027', '2006-02-16T02:30:53', '2005-08-20T10:45:10', '2005-08-28T08:46:10', '2'), - ('441', '2687', '2006-02-16T02:30:53', '2005-08-22T10:55:45', '2005-08-26T09:23:45', '1'), - ('441', '4007', '2006-02-16T02:30:53', '2005-07-10T15:27:04', '2005-07-12T17:20:04', '1'), - ('441', '2277', '2006-02-16T02:30:53', '2005-08-01T23:47:54', '2005-08-08T01:10:54', '1'), - ('441', '608', '2006-02-16T02:30:53', '2005-07-29T00:29:56', '2005-08-06T03:10:56', '1'), - ('441', '2588', '2006-02-16T02:30:53', '2005-07-07T05:16:00', '2005-07-15T09:23:00', '1'), - ('441', '4577', '2006-02-16T02:30:53', '2005-07-31T05:40:35', '2005-08-09T08:18:35', '1'), - ('441', '201', '2006-02-16T02:30:53', '2005-07-12T10:37:52', '2005-07-13T15:13:52', '1'), - ('441', '4516', '2006-02-16T02:30:53', '2005-07-09T07:28:33', '2005-07-14T05:12:33', '2'), - ('441', '2550', '2006-02-16T02:30:53', '2005-08-20T01:16:38', '2005-08-21T20:43:38', '2'), - ('441', '3270', '2006-02-16T02:30:53', '2005-07-12T09:49:46', '2005-07-14T12:15:46', '1'), - ('441', '1575', '2006-02-16T02:30:53', '2005-07-26T23:18:49', '2005-07-31T00:23:49', '2'), - ('176', '559', '2006-02-16T02:30:53', '2005-07-30T10:27:55', '2005-08-07T14:41:55', '2'), - ('176', '2486', '2006-02-16T02:30:53', '2005-06-18T23:17:19', '2005-06-23T03:57:19', '2'), - ('176', '3838', '2006-02-16T02:30:53', '2005-07-29T01:43:37', '2005-08-03T02:36:37', '1'), - ('176', '2223', '2006-02-16T02:30:53', '2005-05-31T08:38:20', '2005-06-09T08:23:20', '2'), - ('176', '3090', '2006-02-16T02:30:53', '2005-06-15T08:55:01', '2005-06-24T04:22:01', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['11678', '7521', '10441', '12299', '6354', '13186', '7210', '15311', '663', '7025', '380', '2922', '3643', '2181', '14083', '1741', '4121', '553', '12718', '2218', '172', '15933', '7751', '14232', '13170', '1836', '6035', '2427', '3931', '10862', '10277', '7017', '12916', '8163', '9958', '642', '8347', '11249', '13214', '9237', '8576', '7110', '7499', '13481', '9264', '4435', '8827', '3739', '352', '11335', '10203', '8337', '4919', '13097', '8707', '4253', '13728', '2340', '12213', '5862', '7195', '14974', '12464', '15335', '14983', '9968', '6878', '733', '14694', '9977', '6705', '1569', '7708', '12189', '7256', '1426', '5687', '8522', '3281', '10339', '8841', '3726', '6140', '13706', '8804', '5758', '15279', '12760', '1847', '6821', '2540', '8121', '464', '8379', '12384', '8431', '15344', '9079', '13608', '14679']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('176', '3511', '2006-02-16T02:30:53', '2005-08-17T06:07:39', '2005-08-21T10:51:39', '2'), - ('176', '3144', '2006-02-16T02:30:53', '2005-07-27T21:04:42', '2005-08-03T16:06:42', '1'), - ('176', '4122', '2006-02-16T02:30:53', '2005-08-01T08:55:56', '2005-08-03T10:26:56', '2'), - ('176', '892', '2006-02-16T02:30:53', '2005-08-18T05:32:32', '2005-08-22T08:14:32', '2'), - ('176', '3203', '2006-02-16T02:30:53', '2005-07-11T20:54:27', '2005-07-18T23:46:27', '2'), - ('176', '2802', '2006-02-16T02:30:53', '2005-08-19T14:23:19', '2005-08-28T11:26:19', '1'), - ('176', '1984', '2006-02-16T02:30:53', '2005-07-27T09:19:05', '2005-07-28T04:35:05', '1'), - ('176', '3612', '2006-02-16T02:30:53', '2005-08-22T19:56:52', '2005-08-31T20:15:52', '2'), - ('176', '3997', '2006-02-16T02:30:53', '2005-05-28T21:23:02', '2005-06-02T17:39:02', '2'), - ('176', '3530', '2006-02-16T02:30:53', '2005-07-27T02:40:29', '2005-07-29T23:02:29', '2'), - ('176', '1777', '2006-02-16T02:30:53', '2005-05-27T09:34:39', '2005-06-04T11:45:39', '1'), - ('176', '1671', '2006-02-16T02:30:53', '2005-06-20T04:13:47', '2005-06-22T04:38:47', '2'), - ('176', '845', '2006-02-16T02:30:53', '2005-07-06T07:20:08', '2005-07-11T07:01:08', '1'), - ('176', '3481', '2006-02-16T02:30:53', '2005-06-18T00:48:31', '2005-06-25T06:43:31', '2'), - ('176', '1823', '2006-02-16T02:30:53', '2005-08-20T23:42:31', '2005-08-28T21:44:31', '1'), - ('176', '3722', '2006-02-16T02:30:53', '2005-06-16T16:31:37', '2005-06-25T21:38:37', '1'), - ('176', '2429', '2006-02-16T02:30:53', '2005-07-07T07:13:50', '2005-07-13T04:32:50', '2'), - ('176', '1349', '2006-02-16T02:30:53', '2005-05-28T08:14:44', '2005-06-02T03:01:44', '2'), - ('176', '3221', '2006-02-16T02:30:53', '2005-08-18T21:21:44', '2005-08-20T01:01:44', '1'), - ('176', '3577', '2006-02-16T02:30:53', '2005-06-18T03:13:13', '2005-06-18T21:16:13', '1'), - ('176', '2873', '2006-02-16T02:30:53', '2005-05-26T03:17:42', '2005-05-29T04:11:42', '2'), - ('176', '3493', '2006-02-16T02:30:53', '2005-08-23T18:36:44', '2005-08-26T12:41:44', '2'), - ('176', '4425', '2006-02-16T02:30:53', '2005-07-28T05:56:13', '2005-08-05T08:08:13', '1'), - ('176', '2710', '2006-02-16T02:30:53', '2005-08-21T05:07:02', '2005-08-29T06:57:02', '1'), - ('176', '1072', '2006-02-16T02:30:53', '2005-08-19T13:45:48', '2005-08-27T11:00:48', '2'), - ('176', '2753', '2006-02-16T02:30:53', '2005-06-16T23:13:05', '2005-06-24T01:40:05', '2'), - ('176', '3474', '2006-02-16T02:30:53', '2005-07-11T03:01:45', '2005-07-14T01:04:45', '2'), - ('176', '4278', '2006-02-16T02:30:53', '2005-06-18T17:45:00', '2005-06-27T20:07:00', '2'), - ('176', '182', '2006-02-16T02:30:53', '2005-07-06T21:03:46', '2005-07-16T01:32:46', '1'), - ('176', '1077', '2006-02-16T02:30:53', '2005-08-02T00:17:34', '2005-08-08T00:31:34', '2'), - ('176', '1472', '2006-02-16T02:30:53', '2005-08-01T03:22:41', '2005-08-05T05:07:41', '1'), - ('176', '753', '2006-02-16T02:30:53', '2005-07-27T02:16:03', '2005-07-31T07:49:03', '1'), - ('157', '2277', '2006-02-16T02:30:53', '2005-08-19T04:27:05', '2005-08-21T02:33:05', '2'), - ('157', '1919', '2006-02-16T02:30:53', '2005-07-28T21:11:48', '2005-07-31T18:30:48', '1'), - ('157', '4142', '2006-02-16T02:30:53', '2005-07-31T16:03:56', '2005-08-04T15:21:56', '2'), - ('157', '140', '2006-02-16T02:30:53', '2005-05-28T18:49:12', '2005-06-01T20:50:12', '2'), - ('157', '4407', '2006-02-16T02:30:53', '2005-07-29T04:49:25', '2005-07-31T00:57:25', '2'), - ('157', '3394', '2006-02-16T02:30:53', '2005-08-02T13:35:40', '2005-08-07T11:22:40', '1'), - ('157', '2675', '2006-02-16T02:30:53', '2005-08-19T15:31:06', '2005-08-20T19:58:06', '2'), - ('157', '2777', '2006-02-16T02:30:53', '2005-07-30T13:48:17', '2005-07-31T13:57:17', '2'), - ('157', '3552', '2006-02-16T02:30:53', '2005-07-29T11:55:01', '2005-08-03T08:41:01', '2'), - ('157', '3289', '2006-02-16T02:30:53', '2005-07-27T05:30:48', '2005-07-28T01:43:48', '1'), - ('157', '3503', '2006-02-16T02:30:53', '2005-07-27T20:10:28', '2005-07-30T16:24:28', '1'), - ('157', '2678', '2006-02-16T02:30:53', '2005-08-20T01:11:12', '2005-08-26T23:07:12', '2'), - ('157', '4071', '2006-02-16T02:30:53', '2005-07-30T14:51:36', '2005-08-02T10:06:36', '1'), - ('157', '3815', '2006-02-16T02:30:53', '2005-07-07T22:51:04', '2005-07-14T23:15:04', '2'), - ('157', '1517', '2006-02-16T02:30:53', '2005-07-29T22:31:24', '2005-08-06T21:05:24', '2'), - ('157', '4333', '2006-02-16T02:30:53', '2005-07-06T11:54:18', '2005-07-09T10:48:18', '1'), - ('157', '4369', '2006-02-16T02:30:53', '2005-05-27T05:48:19', '2005-05-29T09:05:19', '1'), - ('157', '2968', '2006-02-16T02:30:53', '2005-08-02T16:57:37', '2005-08-09T19:43:37', '1'), - ('157', '1096', '2006-02-16T02:30:53', '2005-08-01T00:45:27', '2005-08-04T22:45:27', '2'), - ('157', '752', '2006-02-16T02:30:53', '2005-07-29T04:31:55', '2005-08-02T02:38:55', '2'), - ('157', '2106', '2006-02-16T02:30:53', '2005-07-08T21:41:54', '2005-07-11T23:14:54', '1'), - ('157', '4194', '2006-02-16T02:30:53', '2005-08-19T10:50:43', '2005-08-24T11:10:43', '2'), - ('157', '2525', '2006-02-16T02:30:53', '2005-07-29T17:21:58', '2005-08-02T14:47:58', '2'), - ('157', '3355', '2006-02-16T02:30:53', '2005-07-07T14:13:13', '2005-07-16T18:55:13', '2'), - ('157', '1962', '2006-02-16T02:30:53', '2005-08-20T10:11:07', '2005-08-23T10:32:07', '1'), - ('157', '1913', '2006-02-16T02:30:53', '2005-06-18T11:30:56', '2005-06-23T06:00:56', '1'), - ('157', '4058', '2006-02-16T02:30:53', '2005-08-18T02:33:55', '2005-08-24T03:14:55', '1'), - ('157', '2075', '2006-02-16T02:30:53', '2005-07-10T18:20:48', '2005-07-17T00:09:48', '1'), - ('157', '721', '2006-02-16T02:30:53', '2005-07-27T08:47:01', '2005-07-30T08:40:01', '2'), - ('157', '2596', '2006-02-16T02:30:53', '2005-08-22T07:04:25', '2005-08-27T12:39:25', '1'), - ('157', '1954', '2006-02-16T02:30:53', '2005-08-18T11:33:34', '2005-08-27T14:33:34', '1'), - ('363', '1593', '2006-02-16T02:30:53', '2005-08-22T20:44:55', '2005-08-28T21:43:55', '1'), - ('363', '3579', '2006-02-16T02:30:53', '2005-08-22T07:32:23', '2005-08-30T11:39:23', '2'), - ('363', '2666', '2006-02-16T02:30:53', '2005-07-31T16:32:16', '2005-08-08T12:23:16', '1'), - ('363', '2428', '2006-02-16T02:30:53', '2005-07-12T20:37:13', '2005-07-19T20:13:13', '2'), - ('363', '2951', '2006-02-16T02:30:53', '2005-05-29T07:35:21', '2005-06-05T09:14:21', '1'), - ('363', '2767', '2006-02-16T02:30:53', '2005-08-21T20:46:42', '2005-08-23T16:18:42', '1'), - ('363', '2300', '2006-02-16T02:30:53', '2005-07-31T16:58:42', '2005-08-09T13:34:42', '1'), - ('363', '4268', '2006-02-16T02:30:53', '2005-07-12T12:53:11', '2005-07-13T07:17:11', '1'), - ('363', '3927', '2006-02-16T02:30:53', '2005-06-16T03:19:09', '2005-06-18T21:55:09', '2'), - ('363', '398', '2006-02-16T02:30:53', '2005-07-28T04:19:15', '2005-08-04T04:41:15', '1'), - ('363', '1764', '2006-02-16T02:30:53', '2005-08-18T01:51:44', '2005-08-26T01:01:44', '1'), - ('363', '4275', '2006-02-16T02:30:53', '2005-07-27T10:58:32', '2005-07-29T08:58:32', '2'), - ('363', '4412', '2006-02-16T02:30:53', '2005-06-15T18:16:24', '2005-06-18T22:15:24', '2'), - ('363', '2170', '2006-02-16T02:30:53', '2005-07-10T09:07:19', '2005-07-16T11:17:19', '2'), - ('363', '3636', '2006-02-16T02:30:53', '2005-07-29T10:16:19', '2005-08-06T14:58:19', '1'), - ('363', '4006', '2006-02-16T02:30:53', '2005-06-21T06:08:47', '2005-06-24T11:22:47', '1'), - ('363', '615', '2006-02-16T02:30:53', '2005-08-01T05:05:50', '2005-08-10T07:15:50', '2'), - ('363', '3935', '2006-02-16T02:30:53', '2005-07-29T22:56:07', '2005-08-01T21:21:07', '2'), - ('363', '742', '2006-02-16T02:30:53', '2005-07-06T11:15:49', '2005-07-11T05:54:49', '2'), - ('363', '2749', '2006-02-16T02:30:53', '2005-07-11T08:40:47', '2005-07-14T07:26:47', '1'), - ('363', '3005', '2006-02-16T02:30:53', '2005-08-20T09:32:56', '2005-08-28T05:22:56', '2'), - ('363', '4461', '2006-02-16T02:30:53', '2005-07-29T21:28:19', '2005-08-01T20:15:19', '2'), - ('363', '502', '2006-02-16T02:30:53', '2005-07-10T12:42:43', '2005-07-16T10:18:43', '2'), - ('363', '1088', '2006-02-16T02:30:53', '2005-08-22T19:08:49', '2005-08-30T00:38:49', '2'), - ('363', '4188', '2006-02-16T02:30:53', '2005-08-18T23:03:19', '2005-08-24T17:53:19', '1'), - ('363', '1189', '2006-02-16T02:30:53', '2005-06-17T00:05:22', '2005-06-20T21:09:22', '1'), - ('363', '623', '2006-02-16T02:30:53', '2005-07-12T18:22:10', '2005-07-14T13:25:10', '2'), - ('363', '4305', '2006-02-16T02:30:53', '2005-06-19T02:04:48', '2005-06-20T22:42:48', '2'), - ('363', '2229', '2006-02-16T02:30:53', '2005-07-28T19:25:45', '2005-08-02T13:30:45', '2'), - ('193', '1313', '2006-02-16T02:30:53', '2005-05-27T20:42:44', '2005-05-30T00:49:44', '2'), - ('193', '3907', '2006-02-16T02:30:53', '2005-07-29T05:29:40', '2005-08-06T05:56:40', '2'), - ('193', '2557', '2006-02-16T02:30:53', '2005-08-18T08:36:58', '2005-08-23T05:08:58', '1'), - ('193', '1583', '2006-02-16T02:30:53', '2005-07-29T07:12:48', '2005-08-01T10:03:48', '1'), - ('193', '3560', '2006-02-16T02:30:53', '2005-08-22T21:01:48', '2005-08-27T15:47:48', '1'), - ('193', '2143', '2006-02-16T02:30:53', '2005-07-30T08:02:00', '2005-07-31T04:02:00', '2'), - ('193', '4110', '2006-02-16T02:30:53', '2005-08-20T06:10:44', '2005-08-24T07:08:44', '1'), - ('193', '1520', '2006-02-16T02:30:53', '2005-08-21T20:14:58', '2005-08-23T23:39:58', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['14927', '15495', '12658', '9575', '10462', '4892', '13529', '3297', '15729', '1325', '8211', '2841', '273', '2880', '2846', '15164', '2377', '7049', '4100', '9388', '15210', '13673', '5381', '5440', '11229', '10026', '7578', '14783', '1000', '7934', '4302', '10307', '7577', '5388', '5277', '11564', '9324', '15194', '7418', '5116', '8173', '9921', '600', '12318', '10439', '9827', '9024', '4674', '1183', '4415', '7980', '9219', '10490', '8941', '12659', '11130', '4076', '10473', '4465', '9381', '3976', '8460', '3053', '2024', '14900', '11169', '2010', '2151', '2702', '13627', '11697', '2303', '3268', '15308', '15011', '8172', '3052', '3212', '11970', '14869', '260', '11072', '14446', '570', '10734', '9149', '2393', '2268', '13463', '13740', '12774', '10570', '14077', '12131', '2830', '13399', '7994', '2235', '14161', '463']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('193', '952', '2006-02-16T02:30:53', '2005-08-22T05:31:53', '2005-08-27T07:04:53', '1'), - ('193', '4310', '2006-02-16T02:30:53', '2005-08-23T02:26:10', '2005-08-30T01:07:10', '2'), - ('193', '4320', '2006-02-16T02:30:53', '2005-08-18T19:05:42', '2005-08-19T19:08:42', '1'), - ('193', '3971', '2006-02-16T02:30:53', '2005-07-31T02:51:53', '2005-08-03T20:54:53', '2'), - ('193', '4526', '2006-02-16T02:30:53', '2005-08-01T09:38:28', '2005-08-02T09:52:28', '2'), - ('193', '3566', '2006-02-16T02:30:53', '2005-07-08T20:06:25', '2005-07-14T20:04:25', '1'), - ('193', '1979', '2006-02-16T02:30:53', '2005-08-20T03:07:47', '2005-08-21T21:50:47', '1'), - ('193', '3969', '2006-02-16T02:30:53', '2005-06-21T07:08:19', '2005-06-28T11:53:19', '2'), - ('193', '2699', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('193', '52', '2006-02-16T02:30:53', '2005-06-15T11:03:24', '2005-06-20T10:54:24', '1'), - ('193', '1859', '2006-02-16T02:30:53', '2005-07-28T23:34:22', '2005-08-04T21:18:22', '1'), - ('193', '614', '2006-02-16T02:30:53', '2005-06-19T22:21:06', '2005-06-28T00:56:06', '1'), - ('193', '1590', '2006-02-16T02:30:53', '2005-05-26T16:29:36', '2005-05-29T18:49:36', '2'), - ('193', '1700', '2006-02-16T02:30:53', '2005-06-20T01:24:54', '2005-06-23T02:42:54', '2'), - ('193', '651', '2006-02-16T02:30:53', '2005-06-19T22:52:14', '2005-06-22T17:12:14', '1'), - ('193', '997', '2006-02-16T02:30:53', '2005-08-22T14:47:53', '2005-08-25T16:05:53', '1'), - ('193', '3568', '2006-02-16T02:30:53', '2005-06-18T14:56:23', '2005-06-27T12:36:23', '1'), - ('332', '3043', '2006-02-16T02:30:53', '2005-07-27T03:32:41', '2005-08-04T08:32:41', '2'), - ('332', '2346', '2006-02-16T02:30:53', '2005-07-07T06:20:52', '2005-07-15T05:58:52', '2'), - ('332', '2116', '2006-02-16T02:30:53', '2005-07-30T19:27:22', '2005-08-08T15:31:22', '2'), - ('332', '3811', '2006-02-16T02:30:53', '2005-08-22T16:37:36', '2005-08-29T11:54:36', '1'), - ('332', '343', '2006-02-16T02:30:53', '2005-08-20T08:27:30', '2005-08-26T05:14:30', '1'), - ('332', '3033', '2006-02-16T02:30:53', '2005-07-09T19:11:11', '2005-07-13T17:10:11', '2'), - ('332', '138', '2006-02-16T02:30:53', '2005-07-09T21:45:17', '2005-07-11T22:43:17', '2'), - ('332', '941', '2006-02-16T02:30:53', '2005-08-02T12:56:37', '2005-08-11T11:13:37', '2'), - ('332', '39', '2006-02-16T02:30:53', '2005-07-31T18:31:51', '2005-08-03T21:14:51', '2'), - ('332', '4210', '2006-02-16T02:30:53', '2005-07-27T22:58:17', '2005-07-29T23:14:17', '1'), - ('332', '3419', '2006-02-16T02:30:53', '2005-08-22T00:21:57', '2005-08-28T01:27:57', '2'), - ('332', '1774', '2006-02-16T02:30:53', '2005-05-31T00:25:56', '2005-06-08T19:42:56', '2'), - ('332', '2642', '2006-02-16T02:30:53', '2005-07-28T12:33:10', '2005-08-04T07:40:10', '2'), - ('332', '3669', '2006-02-16T02:30:53', '2005-07-07T16:47:53', '2005-07-16T22:22:53', '2'), - ('332', '975', '2006-02-16T02:30:53', '2005-08-01T04:21:54', '2005-08-04T09:24:54', '2'), - ('332', '2723', '2006-02-16T02:30:53', '2005-07-27T22:56:07', '2005-08-05T21:23:07', '2'), - ('332', '1546', '2006-02-16T02:30:53', '2005-07-09T19:25:25', '2005-07-14T19:51:25', '2'), - ('332', '2026', '2006-02-16T02:30:53', '2005-07-09T14:40:42', '2005-07-16T14:18:42', '2'), - ('332', '2237', '2006-02-16T02:30:53', '2005-08-17T01:27:49', '2005-08-19T22:07:49', '1'), - ('332', '1231', '2006-02-16T02:30:53', '2005-07-30T17:28:52', '2005-08-06T19:02:52', '1'), - ('332', '1217', '2006-02-16T02:30:53', '2005-08-22T16:07:34', '2005-08-26T19:16:34', '1'), - ('332', '3029', '2006-02-16T02:30:53', '2005-07-27T16:59:09', '2005-07-29T15:08:09', '2'), - ('332', '2491', '2006-02-16T02:30:53', '2005-07-09T07:10:12', '2005-07-14T09:16:12', '2'), - ('332', '4377', '2006-02-16T02:30:53', '2005-07-28T21:35:44', '2005-08-06T19:15:44', '2'), - ('332', '1004', '2006-02-16T02:30:53', '2005-07-31T14:59:21', '2005-08-01T12:40:21', '2'), - ('332', '1567', '2006-02-16T02:30:53', '2005-05-28T14:08:19', '2005-06-03T11:57:19', '2'), - ('332', '3694', '2006-02-16T02:30:53', '2005-08-18T06:21:56', '2005-08-27T06:07:56', '1'), - ('332', '2711', '2006-02-16T02:30:53', '2005-08-01T08:54:26', '2005-08-08T14:04:26', '1'), - ('329', '3840', '2006-02-16T02:30:53', '2005-07-31T11:56:55', '2005-08-09T16:29:55', '1'), - ('329', '164', '2006-02-16T02:30:53', '2005-07-30T05:44:42', '2005-08-05T03:15:42', '2'), - ('329', '1617', '2006-02-16T02:30:53', '2005-07-08T10:19:28', '2005-07-12T12:54:28', '2'), - ('329', '706', '2006-02-16T02:30:53', '2005-06-15T00:49:19', '2005-06-20T04:33:19', '1'), - ('329', '1403', '2006-02-16T02:30:53', '2005-07-07T22:01:43', '2005-07-13T03:09:43', '2'), - ('329', '1019', '2006-02-16T02:30:53', '2005-07-28T14:16:49', '2005-08-05T09:20:49', '1'), - ('329', '771', '2006-02-16T02:30:53', '2005-07-30T13:15:21', '2005-08-01T11:39:21', '1'), - ('329', '4365', '2006-02-16T02:30:53', '2005-08-01T10:37:11', '2005-08-03T10:01:11', '2'), - ('329', '4147', '2006-02-16T02:30:53', '2005-07-30T02:59:21', '2005-08-02T05:18:21', '2'), - ('329', '336', '2006-02-16T02:30:53', '2005-08-18T19:05:49', '2005-08-24T22:12:49', '2'), - ('329', '684', '2006-02-16T02:30:53', '2005-08-02T09:08:59', '2005-08-09T07:50:59', '2'), - ('329', '3148', '2006-02-16T02:30:53', '2005-07-07T04:52:15', '2005-07-13T23:22:15', '1'), - ('329', '3034', '2006-02-16T02:30:53', '2005-08-01T09:56:24', '2005-08-10T12:36:24', '2'), - ('329', '2877', '2006-02-16T02:30:53', '2005-07-08T00:07:45', '2005-07-13T18:08:45', '2'), - ('329', '4064', '2006-02-16T02:30:53', '2005-07-30T19:23:04', '2005-07-31T23:37:04', '2'), - ('329', '2424', '2006-02-16T02:30:53', '2005-07-06T23:00:20', '2005-07-07T21:51:20', '2'), - ('329', '2826', '2006-02-16T02:30:53', '2005-07-29T08:08:03', '2005-08-07T06:53:03', '2'), - ('329', '818', '2006-02-16T02:30:53', '2005-06-20T13:10:30', '2005-06-25T17:22:30', '2'), - ('329', '2566', '2006-02-16T02:30:53', '2005-06-17T13:00:51', '2005-06-22T07:03:51', '1'), - ('329', '3420', '2006-02-16T02:30:53', '2005-08-22T04:27:48', '2005-08-25T03:50:48', '2'), - ('329', '2392', '2006-02-16T02:30:53', '2005-08-02T10:19:42', '2005-08-07T05:45:42', '1'), - ('329', '2845', '2006-02-16T02:30:53', '2005-06-17T11:54:15', '2005-06-21T05:55:15', '1'), - ('329', '407', '2006-02-16T02:30:53', '2005-06-17T22:52:37', '2005-06-20T22:00:37', '1'), - ('329', '1736', '2006-02-16T02:30:53', '2005-06-19T13:35:56', '2005-06-20T14:07:56', '2'), - ('329', '603', '2006-02-16T02:30:53', '2005-08-20T06:59:00', '2005-08-29T11:43:00', '2'), - ('329', '383', '2006-02-16T02:30:53', '2005-08-17T07:09:19', '2005-08-19T02:02:19', '1'), - ('329', '1524', '2006-02-16T02:30:53', '2005-06-18T08:27:59', '2005-06-22T10:58:59', '1'), - ('329', '4366', '2006-02-16T02:30:53', '2005-06-21T04:55:49', '2005-06-30T00:23:49', '2'), - ('329', '987', '2006-02-16T02:30:53', '2005-08-22T19:54:31', '2005-08-26T23:09:31', '1'), - ('329', '2722', '2006-02-16T02:30:53', '2005-08-22T08:31:07', '2005-08-24T04:47:07', '1'), - ('329', '1237', '2006-02-16T02:30:53', '2005-07-28T21:34:36', '2005-08-06T23:53:36', '1'), - ('329', '2359', '2006-02-16T02:30:53', '2005-06-20T13:09:19', '2005-06-29T11:55:19', '2'), - ('21', '4178', '2006-02-16T02:30:53', '2005-06-21T01:04:35', '2005-06-30T00:10:35', '2'), - ('21', '1779', '2006-02-16T02:30:53', '2005-08-17T17:53:09', '2005-08-24T14:41:09', '1'), - ('21', '455', '2006-02-16T02:30:53', '2005-08-22T03:20:26', '2005-08-23T05:25:26', '2'), - ('21', '435', '2006-02-16T02:30:53', '2005-05-26T15:42:20', '2005-05-31T13:21:20', '2'), - ('21', '3078', '2006-02-16T02:30:53', '2005-08-02T07:10:57', '2005-08-04T07:42:57', '1'), - ('21', '4367', '2006-02-16T02:30:53', '2005-08-21T12:10:41', '2005-08-26T14:42:41', '1'), - ('21', '1122', '2006-02-16T02:30:53', '2005-05-28T10:15:04', '2005-05-30T08:32:04', '1'), - ('21', '1130', '2006-02-16T02:30:53', '2005-08-01T19:28:47', '2005-08-03T00:41:47', '2'), - ('21', '2632', '2006-02-16T02:30:53', '2005-07-30T10:45:12', '2005-08-01T09:40:12', '1'), - ('21', '3143', '2006-02-16T02:30:53', '2005-06-18T15:37:55', '2005-06-25T17:11:55', '1'), - ('21', '4380', '2006-02-16T02:30:53', '2005-06-18T06:13:41', '2005-06-22T08:53:41', '2'), - ('21', '510', '2006-02-16T02:30:53', '2005-08-20T00:50:54', '2005-08-28T23:00:54', '1'), - ('21', '4366', '2006-02-16T02:30:53', '2005-08-20T10:48:43', '2005-08-29T15:30:43', '1'), - ('21', '3601', '2006-02-16T02:30:53', '2005-08-18T23:34:22', '2005-08-28T05:00:22', '2'), - ('21', '369', '2006-02-16T02:30:53', '2005-08-01T13:23:06', '2005-08-05T15:30:06', '2'), - ('21', '3184', '2006-02-16T02:30:53', '2005-08-20T23:24:07', '2005-08-29T02:53:07', '1'), - ('21', '3380', '2006-02-16T02:30:53', '2005-08-17T23:34:16', '2005-08-26T01:18:16', '1'), - ('21', '2080', '2006-02-16T02:30:53', '2005-06-19T21:14:33', '2005-06-21T17:46:33', '1'), - ('21', '2309', '2006-02-16T02:30:53', '2005-08-19T22:09:28', '2005-08-25T20:25:28', '2'), - ('21', '2431', '2006-02-16T02:30:53', '2005-07-28T14:56:54', '2005-07-30T09:56:54', '2'), - ('21', '3463', '2006-02-16T02:30:53', '2005-06-18T04:08:50', '2005-06-27T07:58:50', '1'), - ('21', '2744', '2006-02-16T02:30:53', '2005-08-21T02:51:59', '2005-08-28T21:38:59', '2'), - ('21', '826', '2006-02-16T02:30:53', '2005-05-27T20:11:47', '2005-06-04T21:18:47', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['13381', '5961', '9699', '12660', '13411', '5772', '8862', '13699', '14933', '5107', '6943', '8196', '14713', '4746', '6793', '10067', '4080', '6169', '1517', '1501', '14965', '682', '2751', '15541', '15237', '8394', '2843', '12029', '5372', '6640', '4950', '3653', '14629', '7693', '7865', '7656', '9594', '8331', '8578', '10830', '14055', '8111', '9023', '11357', '2847', '14184', '9106', '12038', '12512', '8626', '9530', '14155', '12944', '15379', '14879', '5034', '12983', '15586', '9305', '7873', '8487', '11688', '2819', '14518', '4598', '145', '3680', '13847', '12470', '11093', '2506', '9277', '3332', '9447', '15516', '14892', '13032', '5746', '1570', '288', '1438', '6708', '6082', '7733', '9686', '8340', '6261', '2732', '13716', '1819', '9602', '6715', '13764', '15949', '5953', '6324', '1585', '11128', '12961', '3783']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('21', '2823', '2006-02-16T02:30:53', '2005-08-19T21:37:57', '2005-08-21T18:07:57', '2'), - ('21', '3537', '2006-02-16T02:30:53', '2005-07-10T23:43:23', '2005-07-15T05:21:23', '2'), - ('21', '199', '2006-02-16T02:30:53', '2005-07-31T07:29:25', '2005-08-06T01:35:25', '1'), - ('21', '414', '2006-02-16T02:30:53', '2005-08-18T19:07:23', '2005-08-27T17:20:23', '2'), - ('21', '4425', '2006-02-16T02:30:53', '2005-08-19T22:43:38', '2005-08-26T18:29:38', '2'), - ('21', '3635', '2006-02-16T02:30:53', '2005-07-10T13:27:40', '2005-07-17T08:24:40', '1'), - ('21', '916', '2006-02-16T02:30:53', '2005-07-29T23:49:23', '2005-08-04T20:11:23', '1'), - ('21', '3913', '2006-02-16T02:30:53', '2005-08-20T09:26:14', '2005-08-29T08:16:14', '2'), - ('21', '1186', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('21', '1697', '2006-02-16T02:30:53', '2005-07-09T06:42:32', '2005-07-10T08:21:32', '2'), - ('21', '2436', '2006-02-16T02:30:53', '2005-07-26T23:28:13', '2005-07-30T02:22:13', '2'), - ('21', '3435', '2006-02-16T02:30:53', '2005-07-28T22:56:11', '2005-08-06T04:53:11', '1'), - ('148', '3350', '2006-02-16T02:30:53', '2005-08-21T21:27:24', '2005-08-23T20:26:24', '1'), - ('148', '173', '2006-02-16T02:30:53', '2005-07-08T13:47:55', '2005-07-11T09:06:55', '2'), - ('148', '103', '2006-02-16T02:30:53', '2005-07-12T16:37:55', '2005-07-21T16:04:55', '2'), - ('148', '1940', '2006-02-16T02:30:53', '2005-07-31T19:37:58', '2005-08-04T17:32:58', '2'), - ('148', '1364', '2006-02-16T02:30:53', '2005-07-07T05:09:54', '2005-07-11T23:58:54', '1'), - ('148', '2781', '2006-02-16T02:30:53', '2005-07-11T10:25:56', '2005-07-19T07:18:56', '2'), - ('148', '3728', '2006-02-16T02:30:53', '2005-06-15T23:20:26', '2005-06-23T23:23:26', '1'), - ('148', '1780', '2006-02-16T02:30:53', '2005-06-15T22:02:35', '2005-06-23T18:59:35', '1'), - ('148', '1036', '2006-02-16T02:30:53', '2005-08-22T06:45:53', '2005-08-27T10:05:53', '1'), - ('148', '3160', '2006-02-16T02:30:53', '2005-05-28T23:53:18', '2005-05-29T19:14:18', '2'), - ('148', '1291', '2006-02-16T02:30:53', '2005-06-19T16:39:23', '2005-06-25T13:57:23', '1'), - ('148', '2762', '2006-02-16T02:30:53', '2005-08-23T04:13:53', '2005-08-29T05:51:53', '1'), - ('148', '4485', '2006-02-16T02:30:53', '2005-08-22T17:44:30', '2005-08-24T12:51:30', '1'), - ('148', '3933', '2006-02-16T02:30:53', '2005-07-29T06:02:14', '2005-08-03T08:15:14', '1'), - ('148', '1520', '2006-02-16T02:30:53', '2005-06-19T22:36:39', '2005-06-26T22:33:39', '2'), - ('148', '3516', '2006-02-16T02:30:53', '2005-08-17T20:07:01', '2005-08-19T19:36:01', '2'), - ('148', '3551', '2006-02-16T02:30:53', '2005-07-09T18:48:39', '2005-07-11T17:40:39', '1'), - ('148', '2794', '2006-02-16T02:30:53', '2005-07-12T10:27:19', '2005-07-21T06:28:19', '2'), - ('148', '3291', '2006-02-16T02:30:53', '2005-07-08T22:58:07', '2005-07-09T20:41:07', '2'), - ('148', '2513', '2006-02-16T02:30:53', '2005-07-06T07:45:13', '2005-07-10T11:51:13', '2'), - ('148', '761', '2006-02-16T02:30:53', '2005-08-21T18:39:52', '2005-08-25T19:14:52', '2'), - ('148', '2479', '2006-02-16T02:30:53', '2005-07-28T03:31:22', '2005-07-31T06:42:22', '2'), - ('148', '2334', '2006-02-16T02:30:53', '2005-07-28T10:07:04', '2005-08-06T08:16:04', '2'), - ('148', '178', '2006-02-16T02:30:53', '2005-07-28T02:07:19', '2005-07-31T04:05:19', '1'), - ('148', '4382', '2006-02-16T02:30:53', '2005-07-31T03:23:52', '2005-08-04T23:06:52', '1'), - ('148', '18', '2006-02-16T02:30:53', '2005-07-29T04:13:29', '2005-08-04T07:09:29', '1'), - ('148', '3737', '2006-02-16T02:30:53', '2005-07-29T11:58:14', '2005-08-03T06:25:14', '1'), - ('148', '4176', '2006-02-16T02:30:53', '2005-08-01T23:18:06', '2005-08-06T23:15:06', '2'), - ('148', '1571', '2006-02-16T02:30:53', '2005-08-20T22:18:00', '2005-08-22T02:09:00', '2'), - ('148', '3226', '2006-02-16T02:30:53', '2005-07-28T19:10:03', '2005-07-29T22:25:03', '1'), - ('148', '2911', '2006-02-16T02:30:53', '2005-07-30T05:36:40', '2005-08-07T06:20:40', '1'), - ('148', '2644', '2006-02-16T02:30:53', '2005-08-02T17:42:49', '2005-08-11T18:14:49', '1'), - ('148', '1247', '2006-02-16T02:30:53', '2005-06-19T22:54:01', '2005-06-27T23:05:01', '2'), - ('148', '3759', '2006-02-16T02:30:53', '2005-08-21T03:24:50', '2005-08-29T01:46:50', '2'), - ('148', '2935', '2006-02-16T02:30:53', '2005-07-30T08:52:34', '2005-08-02T07:38:34', '2'), - ('148', '3794', '2006-02-16T02:30:53', '2005-08-17T20:28:26', '2005-08-20T23:09:26', '2'), - ('148', '3959', '2006-02-16T02:30:53', '2005-08-18T13:28:27', '2005-08-26T19:08:27', '2'), - ('148', '3092', '2006-02-16T02:30:53', '2005-07-29T14:03:20', '2005-08-02T09:05:20', '1'), - ('148', '1718', '2006-02-16T02:30:53', '2005-07-31T01:09:06', '2005-08-04T23:47:06', '2'), - ('148', '769', '2006-02-16T02:30:53', '2005-08-21T02:31:35', '2005-08-27T06:00:35', '2'), - ('148', '2956', '2006-02-16T02:30:53', '2005-08-19T05:48:12', '2005-08-28T10:10:12', '1'), - ('148', '1899', '2006-02-16T02:30:53', '2005-08-22T22:26:13', '2005-08-31T18:19:13', '1'), - ('148', '2154', '2006-02-16T02:30:53', '2005-08-22T03:42:12', '2005-08-27T06:14:12', '1'), - ('148', '340', '2006-02-16T02:30:53', '2005-07-09T02:48:15', '2005-07-11T23:13:15', '2'), - ('148', '406', '2006-02-16T02:30:53', '2005-08-19T07:06:51', '2005-08-28T10:35:51', '2'), - ('148', '3232', '2006-02-16T02:30:53', '2005-08-23T05:57:04', '2005-08-31T01:59:04', '1'), - ('82', '1224', '2006-02-16T02:30:53', '2005-07-30T16:45:56', '2005-08-08T21:15:56', '2'), - ('82', '2947', '2006-02-16T02:30:53', '2005-07-28T10:19:46', '2005-07-31T04:43:46', '2'), - ('82', '1893', '2006-02-16T02:30:53', '2005-07-29T08:53:49', '2005-07-31T09:10:49', '2'), - ('82', '2229', '2006-02-16T02:30:53', '2005-08-17T06:41:58', '2005-08-25T04:38:58', '1'), - ('82', '4100', '2006-02-16T02:30:53', '2005-06-19T20:13:33', '2005-06-26T16:44:33', '1'), - ('82', '2734', '2006-02-16T02:30:53', '2005-08-21T14:58:58', '2005-08-24T13:19:58', '2'), - ('82', '258', '2006-02-16T02:30:53', '2005-07-08T06:46:26', '2005-07-16T01:21:26', '1'), - ('82', '3905', '2006-02-16T02:30:53', '2005-05-25T23:59:03', '2005-05-31T02:56:03', '1'), - ('82', '2427', '2006-02-16T02:30:53', '2005-07-06T09:16:10', '2005-07-08T07:52:10', '2'), - ('82', '2647', '2006-02-16T02:30:53', '2005-08-20T14:33:59', '2005-08-25T08:49:59', '1'), - ('82', '1290', '2006-02-16T02:30:53', '2005-08-18T11:55:42', '2005-08-24T08:27:42', '2'), - ('82', '239', '2006-02-16T02:30:53', '2005-08-02T07:59:49', '2005-08-11T06:01:49', '1'), - ('82', '2308', '2006-02-16T02:30:53', '2005-06-18T23:29:53', '2005-06-25T18:11:53', '2'), - ('82', '3734', '2006-02-16T02:30:53', '2005-07-30T15:13:45', '2005-08-05T10:25:45', '2'), - ('82', '1975', '2006-02-16T02:30:53', '2005-06-21T09:55:12', '2005-06-25T08:32:12', '2'), - ('82', '1053', '2006-02-16T02:30:53', '2005-07-30T21:54:22', '2005-08-09T01:07:22', '2'), - ('82', '219', '2006-02-16T02:30:53', '2005-08-23T03:12:54', '2005-08-30T04:02:54', '1'), - ('82', '3061', '2006-02-16T02:30:53', '2005-08-22T04:15:05', '2005-08-31T06:07:05', '1'), - ('82', '3699', '2006-02-16T02:30:53', '2005-08-19T08:31:50', '2005-08-23T04:00:50', '2'), - ('82', '3071', '2006-02-16T02:30:53', '2005-07-10T12:15:12', '2005-07-16T07:02:12', '1'), - ('82', '3711', '2006-02-16T02:30:53', '2005-06-16T03:21:33', '2005-06-22T22:03:33', '2'), - ('82', '3546', '2006-02-16T02:30:53', '2005-05-26T19:47:49', '2005-06-03T20:53:49', '2'), - ('82', '1816', '2006-02-16T02:30:53', '2005-06-15T18:38:51', '2005-06-17T23:50:51', '1'), - ('82', '372', '2006-02-16T02:30:53', '2005-07-12T13:10:55', '2005-07-21T07:36:55', '1'), - ('82', '1091', '2006-02-16T02:30:53', '2005-07-11T05:12:41', '2005-07-16T03:40:41', '2'), - ('82', '10', '2006-02-16T02:30:53', '2005-07-28T05:04:47', '2005-08-05T05:12:47', '2'), - ('386', '3825', '2006-02-16T02:30:53', '2005-07-31T06:50:06', '2005-08-06T08:41:06', '1'), - ('386', '1553', '2006-02-16T02:30:53', '2005-07-29T04:41:44', '2005-08-07T10:33:44', '1'), - ('386', '694', '2006-02-16T02:30:53', '2005-07-11T15:28:34', '2005-07-14T17:54:34', '1'), - ('386', '610', '2006-02-16T02:30:53', '2005-06-19T15:19:39', '2005-06-25T19:39:39', '2'), - ('386', '86', '2006-02-16T02:30:53', '2005-08-20T09:48:32', '2005-08-26T07:20:32', '2'), - ('386', '1689', '2006-02-16T02:30:53', '2005-06-16T21:32:50', '2005-06-26T01:11:50', '1'), - ('386', '3173', '2006-02-16T02:30:53', '2005-07-31T03:42:51', '2005-08-01T08:39:51', '1'), - ('386', '643', '2006-02-16T02:30:53', '2005-07-12T13:32:28', '2005-07-15T17:01:28', '2'), - ('386', '989', '2006-02-16T02:30:53', '2005-08-20T11:38:16', '2005-08-27T08:01:16', '1'), - ('386', '1199', '2006-02-16T02:30:53', '2005-08-23T19:06:04', '2005-08-26T18:39:04', '2'), - ('386', '992', '2006-02-16T02:30:53', '2005-07-10T23:21:35', '2005-07-14T20:48:35', '2'), - ('386', '655', '2006-02-16T02:30:53', '2005-07-11T19:02:34', '2005-07-17T15:57:34', '1'), - ('386', '1708', '2006-02-16T02:30:53', '2005-06-16T04:51:13', '2005-06-24T00:23:13', '2'), - ('386', '3472', '2006-02-16T02:30:53', '2005-08-02T09:03:25', '2005-08-09T04:36:25', '1'), - ('386', '4529', '2006-02-16T02:30:53', '2005-08-19T06:22:37', '2005-08-23T00:49:37', '1'), - ('386', '2345', '2006-02-16T02:30:53', '2005-07-06T13:57:31', '2005-07-14T10:44:31', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['13869', '583', '4189', '3351', '1608', '6037', '10715', '10618', '10572', '5524', '11695', '8751', '6222', '9737', '5469', '9183', '7775', '11770', '15097', '702', '5407', '7641', '5415', '3980', '14303', '11293', '5379', '4617', '10162', '10357', '9647', '417', '10633', '4013', '15288', '6224', '8207', '7289', '5366', '9241', '7844', '3709', '15971', '1462', '3402', '14855', '1592', '5833', '252', '11843', '2127', '5738', '2742', '13940', '12307', '4429', '7967', '12534', '2533', '15231', '12490', '6428', '6057', '15517', '1323', '12216', '10861', '5610', '55', '12372', '1768', '83', '9323', '13346', '1646', '944', '15659', '5874', '10459', '5233', '5395', '16042', '5726', '11971', '13050', '13407', '12263', '8071', '7557', '8570', '13353', '3515', '8267', '10179', '11973', '9810', '9942', '12349', '15998', '7078']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('386', '1990', '2006-02-16T02:30:53', '2005-08-20T15:08:57', '2005-08-29T13:13:57', '2'), - ('386', '2679', '2006-02-16T02:30:53', '2005-05-28T11:48:55', '2005-06-04T07:09:55', '2'), - ('386', '1492', '2006-02-16T02:30:53', '2005-07-07T10:51:07', '2005-07-14T14:46:07', '2'), - ('386', '1591', '2006-02-16T02:30:53', '2005-06-21T11:21:39', '2005-06-23T07:23:39', '2'), - ('386', '2581', '2006-02-16T02:30:53', '2005-06-16T06:28:57', '2005-06-24T05:20:57', '2'), - ('386', '1886', '2006-02-16T02:30:53', '2005-07-11T03:06:54', '2005-07-12T22:46:54', '2'), - ('386', '1054', '2006-02-16T02:30:53', '2005-08-01T18:51:48', '2005-08-06T14:44:48', '1'), - ('386', '3729', '2006-02-16T02:30:53', '2005-08-01T15:06:38', '2005-08-06T15:52:38', '2'), - ('386', '1239', '2006-02-16T02:30:53', '2005-08-01T13:26:53', '2005-08-07T18:47:53', '2'), - ('386', '3596', '2006-02-16T02:30:53', '2005-07-10T01:49:24', '2005-07-14T22:55:24', '1'), - ('386', '1110', '2006-02-16T02:30:53', '2005-08-17T07:01:08', '2005-08-21T09:21:08', '1'), - ('386', '3467', '2006-02-16T02:30:53', '2005-07-29T19:14:39', '2005-07-31T23:11:39', '1'), - ('386', '2066', '2006-02-16T02:30:53', '2005-07-11T13:25:49', '2005-07-13T14:32:49', '1'), - ('475', '1720', '2006-02-16T02:30:53', '2005-07-31T08:59:18', '2005-08-03T12:19:18', '2'), - ('475', '2201', '2006-02-16T02:30:53', '2005-07-09T23:08:07', '2005-07-13T19:13:07', '1'), - ('475', '4320', '2006-02-16T02:30:53', '2005-07-30T12:09:56', '2005-08-06T11:50:56', '2'), - ('475', '3795', '2006-02-16T02:30:53', '2005-07-28T07:04:36', '2005-08-03T06:36:36', '2'), - ('475', '2862', '2006-02-16T02:30:53', '2005-08-17T10:05:05', '2005-08-20T15:59:05', '1'), - ('475', '2838', '2006-02-16T02:30:53', '2005-08-22T11:43:42', '2005-08-27T10:25:42', '1'), - ('475', '2556', '2006-02-16T02:30:53', '2005-05-29T02:27:30', '2005-05-30T01:52:30', '2'), - ('475', '3641', '2006-02-16T02:30:53', '2005-07-09T20:16:07', '2005-07-14T21:41:07', '2'), - ('475', '1868', '2006-02-16T02:30:53', '2005-07-28T01:15:45', '2005-08-04T23:50:45', '1'), - ('475', '4413', '2006-02-16T02:30:53', '2005-07-09T20:30:03', '2005-07-18T00:20:03', '1'), - ('475', '1845', '2006-02-16T02:30:53', '2005-07-06T23:11:11', '2005-07-14T18:22:11', '1'), - ('475', '992', '2006-02-16T02:30:53', '2005-08-21T07:22:43', '2005-08-24T11:52:43', '1'), - ('475', '1514', '2006-02-16T02:30:53', '2005-08-02T15:00:43', '2005-08-11T17:49:43', '1'), - ('475', '2110', '2006-02-16T02:30:53', '2005-07-09T19:08:03', '2005-07-10T17:58:03', '1'), - ('475', '3784', '2006-02-16T02:30:53', '2005-07-08T07:55:08', '2005-07-17T02:49:08', '2'), - ('475', '1327', '2006-02-16T02:30:53', '2005-07-31T23:11:01', '2005-08-07T01:52:01', '2'), - ('475', '3102', '2006-02-16T02:30:53', '2005-08-01T05:49:49', '2005-08-04T02:34:49', '2'), - ('475', '3415', '2006-02-16T02:30:53', '2005-07-31T05:45:15', '2005-08-06T08:54:15', '1'), - ('475', '2253', '2006-02-16T02:30:53', '2005-05-27T15:07:27', '2005-05-29T20:01:27', '2'), - ('475', '3125', '2006-02-16T02:30:53', '2005-08-01T15:37:17', '2005-08-10T14:30:17', '2'), - ('475', '2344', '2006-02-16T02:30:53', '2005-07-07T00:58:00', '2005-07-15T19:42:00', '2'), - ('475', '1999', '2006-02-16T02:30:53', '2005-08-22T19:23:58', '2005-08-26T23:28:58', '1'), - ('475', '3274', '2006-02-16T02:30:53', '2005-07-11T13:42:18', '2005-07-16T09:28:18', '1'), - ('475', '1195', '2006-02-16T02:30:53', '2005-07-28T23:26:31', '2005-08-06T03:26:31', '1'), - ('187', '2157', '2006-02-16T02:30:53', '2005-07-27T12:26:51', '2005-08-02T18:20:51', '2'), - ('187', '886', '2006-02-16T02:30:53', '2005-07-09T18:28:37', '2005-07-13T20:45:37', '1'), - ('187', '4145', '2006-02-16T02:30:53', '2005-07-30T13:58:41', '2005-08-04T09:44:41', '2'), - ('187', '4220', '2006-02-16T02:30:53', '2005-07-28T09:16:19', '2005-08-05T14:06:19', '2'), - ('187', '4033', '2006-02-16T02:30:53', '2005-07-06T10:26:56', '2005-07-15T13:51:56', '2'), - ('187', '3456', '2006-02-16T02:30:53', '2005-08-23T19:59:33', '2005-09-02T01:28:33', '1'), - ('187', '653', '2006-02-16T02:30:53', '2005-06-15T20:37:40', '2005-06-18T19:36:40', '2'), - ('187', '596', '2006-02-16T02:30:53', '2005-06-21T15:54:37', '2005-06-30T13:43:37', '1'), - ('187', '1668', '2006-02-16T02:30:53', '2005-08-22T02:27:32', '2005-08-31T03:35:32', '1'), - ('187', '3798', '2006-02-16T02:30:53', '2005-06-16T05:14:37', '2005-06-20T10:52:37', '2'), - ('187', '3829', '2006-02-16T02:30:53', '2005-07-10T16:39:24', '2005-07-17T12:52:24', '1'), - ('187', '1203', '2006-02-16T02:30:53', '2005-05-26T14:39:53', '2005-06-02T14:48:53', '1'), - ('187', '3091', '2006-02-16T02:30:53', '2005-08-17T13:14:50', '2005-08-22T11:31:50', '2'), - ('187', '3757', '2006-02-16T02:30:53', '2005-06-17T20:54:48', '2005-06-18T16:28:48', '2'), - ('187', '200', '2006-02-16T02:30:53', '2005-07-10T11:50:51', '2005-07-19T17:46:51', '1'), - ('187', '4154', '2006-02-16T02:30:53', '2005-06-19T16:05:47', '2005-06-26T21:34:47', '1'), - ('187', '2638', '2006-02-16T02:30:53', '2005-08-20T17:28:57', '2005-08-27T22:07:57', '1'), - ('187', '2679', '2006-02-16T02:30:53', '2005-08-18T05:48:23', '2005-08-26T02:32:23', '1'), - ('187', '2949', '2006-02-16T02:30:53', '2005-07-07T22:32:47', '2005-07-15T03:10:47', '2'), - ('187', '2040', '2006-02-16T02:30:53', '2005-07-28T13:56:51', '2005-08-03T19:38:51', '1'), - ('187', '995', '2006-02-16T02:30:53', '2005-08-18T14:04:41', '2005-08-25T16:57:41', '1'), - ('187', '4564', '2006-02-16T02:30:53', '2005-06-19T01:34:26', '2005-06-22T20:19:26', '1'), - ('187', '2980', '2006-02-16T02:30:53', '2005-08-22T17:32:57', '2005-08-25T13:06:57', '1'), - ('187', '1577', '2006-02-16T02:30:53', '2005-08-18T12:48:45', '2005-08-27T15:53:45', '1'), - ('187', '4365', '2006-02-16T02:30:53', '2005-07-12T00:01:51', '2005-07-20T22:02:51', '2'), - ('187', '1340', '2006-02-16T02:30:53', '2005-07-11T04:03:40', '2005-07-17T01:34:40', '2'), - ('187', '2221', '2006-02-16T02:30:53', '2005-08-23T03:13:01', '2005-08-25T21:14:01', '2'), - ('187', '3273', '2006-02-16T02:30:53', '2005-06-15T10:55:17', '2005-06-24T09:51:17', '1'), - ('131', '4139', '2006-02-16T02:30:53', '2005-08-18T02:37:07', '2005-08-19T02:09:07', '2'), - ('131', '2162', '2006-02-16T02:30:53', '2005-08-02T00:12:46', '2005-08-09T04:09:46', '2'), - ('131', '481', '2006-02-16T02:30:53', '2005-07-10T05:09:52', '2005-07-13T07:08:52', '2'), - ('131', '1139', '2006-02-16T02:30:53', '2005-05-25T08:26:13', '2005-05-30T10:57:13', '1'), - ('131', '2982', '2006-02-16T02:30:53', '2005-08-18T08:04:35', '2005-08-27T08:13:35', '2'), - ('131', '2131', '2006-02-16T02:30:53', '2005-06-16T18:02:06', '2005-06-23T17:19:06', '2'), - ('131', '466', '2006-02-16T02:30:53', '2005-05-25T12:30:15', '2005-05-27T15:40:15', '1'), - ('131', '3749', '2006-02-16T02:30:53', '2005-07-30T17:21:44', '2005-08-03T16:28:44', '1'), - ('131', '4541', '2006-02-16T02:30:53', '2005-08-19T20:28:21', '2005-08-28T00:28:21', '2'), - ('131', '4037', '2006-02-16T02:30:53', '2005-06-16T09:12:53', '2005-06-24T08:03:53', '2'), - ('131', '151', '2006-02-16T02:30:53', '2005-05-30T15:26:24', '2005-06-07T18:09:24', '2'), - ('131', '4573', '2006-02-16T02:30:53', '2005-08-23T08:48:43', '2005-08-27T14:19:43', '2'), - ('131', '2255', '2006-02-16T02:30:53', '2005-07-10T19:02:51', '2005-07-16T13:14:51', '1'), - ('131', '201', '2006-02-16T02:30:53', '2005-08-01T09:20:09', '2005-08-03T11:36:09', '1'), - ('131', '1401', '2006-02-16T02:30:53', '2005-07-09T12:44:26', '2005-07-15T12:31:26', '1'), - ('131', '4428', '2006-02-16T02:30:53', '2005-07-09T19:42:37', '2005-07-10T15:39:37', '1'), - ('131', '629', '2006-02-16T02:30:53', '2005-08-23T22:20:40', '2005-08-24T17:54:40', '1'), - ('131', '3582', '2006-02-16T02:30:53', '2005-07-10T11:22:08', '2005-07-13T05:55:08', '1'), - ('131', '2756', '2006-02-16T02:30:53', '2005-08-17T17:53:42', '2005-08-18T12:11:42', '2'), - ('131', '3682', '2006-02-16T02:30:53', '2005-08-19T09:31:23', '2005-08-26T06:56:23', '2'), - ('131', '2512', '2006-02-16T02:30:53', '2005-08-19T22:26:26', '2005-08-22T16:34:26', '1'), - ('131', '4053', '2006-02-16T02:30:53', '2005-08-18T04:16:18', '2005-08-21T07:22:18', '1'), - ('131', '2582', '2006-02-16T02:30:53', '2005-07-28T17:27:48', '2005-08-03T11:48:48', '2'), - ('131', '3152', '2006-02-16T02:30:53', '2005-07-27T22:18:19', '2005-07-29T00:24:19', '1'), - ('131', '3094', '2006-02-16T02:30:53', '2005-07-29T11:40:08', '2005-08-06T10:23:08', '1'), - ('131', '2790', '2006-02-16T02:30:53', '2005-08-19T20:53:43', '2005-08-25T01:25:43', '1'), - ('131', '3220', '2006-02-16T02:30:53', '2005-07-06T00:48:55', '2005-07-09T00:15:55', '1'), - ('131', '4107', '2006-02-16T02:30:53', '2005-07-29T01:21:02', '2005-08-04T19:34:02', '2'), - ('131', '2136', '2006-02-16T02:30:53', '2005-07-31T23:49:54', '2005-08-01T20:46:54', '2'), - ('131', '1472', '2006-02-16T02:30:53', '2005-08-17T17:55:58', '2005-08-21T19:55:58', '2'), - ('545', '2066', '2006-02-16T02:30:53', '2005-07-31T11:22:41', '2005-08-01T09:40:41', '2'), - ('545', '4573', '2006-02-16T02:30:53', '2005-07-31T15:35:43', '2005-08-07T17:37:43', '2'), - ('545', '4191', '2006-02-16T02:30:53', '2005-08-18T07:23:42', '2005-08-19T04:25:42', '1'), - ('545', '1229', '2006-02-16T02:30:53', '2005-08-23T20:41:09', '2005-08-27T00:20:09', '1'), - ('545', '4518', '2006-02-16T02:30:53', '2005-07-27T04:16:37', '2005-08-05T02:34:37', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['5264', '2123', '12800', '13595', '12098', '248', '8848', '3975', '15585', '4597', '12667', '715', '8599', '10931', '11760', '3693', '11063', '15613', '12022', '14893', '15336', '8133', '7334', '684', '9885', '13269', '7664', '13223', '15187', '15449', '15067', '3127', '8164', '3698', '5650', '15411', '10113', '10260', '9499', '11219', '5809', '4586', '3319', '14186', '5840', '15146', '5223', '9027', '8228', '13660', '12020', '785', '11630', '1047', '13597', '11679', '11422', '5302', '845', '14020', '12448', '15110', '3700', '12593', '13327', '6081', '13145', '2294', '11923', '5424', '10267', '11206', '9420', '9648', '9614', '743', '3686', '177', '1326', '3777', '13691', '4155', '6490', '14723', '10318', '13730', '14188', '12860', '2280', '872', '13584', '5138', '2978', '5779', '10684', '13774', '13928', '11157', '5692', '13630']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('545', '3307', '2006-02-16T02:30:53', '2005-07-09T14:11:28', '2005-07-12T18:24:28', '2'), - ('545', '2497', '2006-02-16T02:30:53', '2005-06-17T20:48:30', '2005-06-18T19:17:30', '2'), - ('545', '257', '2006-02-16T02:30:53', '2005-08-19T00:27:11', '2005-08-22T01:08:11', '1'), - ('545', '673', '2006-02-16T02:30:53', '2005-08-20T05:54:27', '2005-08-29T01:25:27', '1'), - ('545', '534', '2006-02-16T02:30:53', '2005-08-17T22:38:31', '2005-08-20T01:56:31', '1'), - ('545', '1913', '2006-02-16T02:30:53', '2005-05-26T14:07:58', '2005-05-31T14:03:58', '2'), - ('545', '2972', '2006-02-16T02:30:53', '2005-07-29T23:20:58', '2005-08-03T17:28:58', '2'), - ('545', '4343', '2006-02-16T02:30:53', '2005-07-06T23:00:09', '2005-07-10T01:39:09', '2'), - ('545', '1177', '2006-02-16T02:30:53', '2005-08-23T05:55:22', '2005-08-24T11:45:22', '2'), - ('545', '3767', '2006-02-16T02:30:53', '2005-07-08T06:43:42', '2005-07-13T01:32:42', '1'), - ('545', '104', '2006-02-16T02:30:53', '2005-08-18T19:11:45', '2005-08-27T13:34:45', '2'), - ('545', '2030', '2006-02-16T02:30:53', '2005-05-29T04:22:41', '2005-06-05T09:28:41', '1'), - ('545', '1169', '2006-02-16T02:30:53', '2005-07-29T12:58:52', '2005-08-03T08:19:52', '1'), - ('545', '3268', '2006-02-16T02:30:53', '2005-08-02T02:44:59', '2005-08-04T02:02:59', '1'), - ('545', '626', '2006-02-16T02:30:53', '2005-08-17T09:44:22', '2005-08-24T14:39:22', '2'), - ('545', '2989', '2006-02-16T02:30:53', '2005-07-06T09:56:09', '2005-07-15T06:50:09', '2'), - ('461', '2261', '2006-02-16T02:30:53', '2005-08-02T06:53:48', '2005-08-05T03:38:48', '2'), - ('461', '307', '2006-02-16T02:30:53', '2005-08-23T07:03:19', '2005-08-31T07:50:19', '2'), - ('461', '2067', '2006-02-16T02:30:53', '2005-08-17T19:52:45', '2005-08-18T18:26:45', '2'), - ('461', '2336', '2006-02-16T02:30:53', '2005-08-22T04:15:48', '2005-08-30T08:05:48', '1'), - ('461', '490', '2006-02-16T02:30:53', '2005-08-22T20:47:48', '2005-08-31T18:17:48', '2'), - ('461', '849', '2006-02-16T02:30:53', '2005-07-28T20:01:06', '2005-08-01T20:01:06', '1'), - ('461', '3006', '2006-02-16T02:30:53', '2005-07-27T13:59:58', '2005-07-29T11:33:58', '1'), - ('461', '3242', '2006-02-16T02:30:53', '2005-05-29T00:13:15', '2005-06-04T21:26:15', '2'), - ('461', '3600', '2006-02-16T02:30:53', '2005-07-31T13:59:32', '2005-08-07T12:30:32', '2'), - ('461', '2382', '2006-02-16T02:30:53', '2005-08-19T17:34:00', '2005-08-20T15:17:00', '2'), - ('461', '1989', '2006-02-16T02:30:53', '2005-07-28T02:24:23', '2005-07-29T23:01:23', '1'), - ('461', '332', '2006-02-16T02:30:53', '2005-08-19T15:52:04', '2005-08-22T16:27:04', '1'), - ('461', '2338', '2006-02-16T02:30:53', '2005-08-22T15:53:32', '2005-08-27T14:21:32', '1'), - ('461', '2856', '2006-02-16T02:30:53', '2005-08-23T00:55:43', '2005-08-28T03:41:43', '1'), - ('461', '3684', '2006-02-16T02:30:53', '2005-08-22T10:49:21', '2005-08-24T09:01:21', '1'), - ('461', '1292', '2006-02-16T02:30:53', '2005-06-20T18:39:43', '2005-06-28T17:55:43', '1'), - ('461', '1674', '2006-02-16T02:30:53', '2005-07-28T21:17:19', '2005-07-30T21:12:19', '2'), - ('461', '1263', '2006-02-16T02:30:53', '2005-07-06T10:09:20', '2005-07-08T15:49:20', '1'), - ('461', '2793', '2006-02-16T02:30:53', '2005-07-10T07:17:01', '2005-07-15T11:59:01', '1'), - ('461', '4423', '2006-02-16T02:30:53', '2005-08-22T23:35:41', '2005-08-26T00:51:41', '1'), - ('461', '3974', '2006-02-16T02:30:53', '2005-07-31T21:10:03', '2005-08-02T21:13:03', '2'), - ('461', '2864', '2006-02-16T02:30:53', '2005-08-01T02:58:07', '2005-08-05T02:06:07', '2'), - ('461', '602', '2006-02-16T02:30:53', '2005-07-30T23:58:30', '2005-08-01T00:55:30', '2'), - ('461', '2889', '2006-02-16T02:30:53', '2005-08-02T12:30:20', '2005-08-08T13:42:20', '2'), - ('461', '1748', '2006-02-16T02:30:53', '2005-07-10T15:19:30', '2005-07-13T12:31:30', '2'), - ('461', '1374', '2006-02-16T02:30:53', '2005-07-08T06:12:33', '2005-07-13T11:06:33', '2'), - ('461', '2482', '2006-02-16T02:30:53', '2005-06-21T08:25:46', '2005-06-27T03:54:46', '2'), - ('461', '3158', '2006-02-16T02:30:53', '2005-08-21T03:31:07', '2005-08-28T07:29:07', '2'), - ('72', '1073', '2006-02-16T02:30:53', '2005-07-10T17:09:09', '2005-07-15T22:52:09', '1'), - ('72', '3102', '2006-02-16T02:30:53', '2005-08-22T13:57:55', '2005-08-28T12:57:55', '2'), - ('72', '2335', '2006-02-16T02:30:53', '2005-07-09T12:06:03', '2005-07-17T15:50:03', '1'), - ('72', '449', '2006-02-16T02:30:53', '2005-07-30T05:58:27', '2005-08-03T03:02:27', '1'), - ('72', '1955', '2006-02-16T02:30:53', '2005-07-29T00:08:58', '2005-08-03T00:12:58', '2'), - ('72', '3972', '2006-02-16T02:30:53', '2005-08-20T08:05:56', '2005-08-22T13:22:56', '1'), - ('72', '3258', '2006-02-16T02:30:53', '2005-08-17T19:50:33', '2005-08-25T17:54:33', '1'), - ('72', '39', '2006-02-16T02:30:53', '2005-05-29T15:08:41', '2005-05-30T15:51:41', '1'), - ('72', '688', '2006-02-16T02:30:53', '2005-08-17T04:27:46', '2005-08-19T09:58:46', '2'), - ('72', '1366', '2006-02-16T02:30:53', '2005-05-31T06:45:57', '2005-06-04T09:49:57', '2'), - ('72', '3697', '2006-02-16T02:30:53', '2005-08-20T05:59:05', '2005-08-24T05:38:05', '2'), - ('72', '3337', '2006-02-16T02:30:53', '2005-08-17T06:08:54', '2005-08-21T07:50:54', '1'), - ('72', '342', '2006-02-16T02:30:53', '2005-08-02T19:52:08', '2005-08-11T18:40:08', '2'), - ('72', '4270', '2006-02-16T02:30:53', '2005-07-09T15:42:36', '2005-07-10T21:04:36', '2'), - ('72', '2001', '2006-02-16T02:30:53', '2005-05-30T01:17:25', '2005-06-07T02:00:25', '1'), - ('72', '2257', '2006-02-16T02:30:53', '2005-08-20T20:59:43', '2005-08-23T17:11:43', '2'), - ('72', '3889', '2006-02-16T02:30:53', '2005-08-18T10:59:04', '2005-08-21T06:45:04', '2'), - ('72', '1379', '2006-02-16T02:30:53', '2005-08-22T12:16:46', '2005-08-26T13:36:46', '1'), - ('72', '343', '2006-02-16T02:30:53', '2005-07-06T10:12:19', '2005-07-07T14:21:19', '2'), - ('72', '4092', '2006-02-16T02:30:53', '2005-08-18T16:17:54', '2005-08-21T18:02:54', '2'), - ('72', '1808', '2006-02-16T02:30:53', '2005-08-19T19:55:45', '2005-08-22T15:05:45', '2'), - ('72', '2286', '2006-02-16T02:30:53', '2005-07-11T05:11:09', '2005-07-13T05:33:09', '2'), - ('72', '1383', '2006-02-16T02:30:53', '2005-08-19T12:53:53', '2005-08-23T08:06:53', '1'), - ('72', '2096', '2006-02-16T02:30:53', '2005-06-18T07:46:34', '2005-06-22T12:34:34', '2'), - ('72', '1907', '2006-02-16T02:30:53', '2005-08-17T16:21:47', '2005-08-18T14:26:47', '2'), - ('72', '3694', '2006-02-16T02:30:53', '2005-07-09T20:59:09', '2005-07-12T00:05:09', '2'), - ('72', '3883', '2006-02-16T02:30:53', '2005-08-01T03:07:26', '2005-08-07T22:49:26', '1'), - ('72', '4131', '2006-02-16T02:30:53', '2005-08-02T11:58:03', '2005-08-07T12:36:03', '2'), - ('72', '147', '2006-02-16T02:30:53', '2005-07-30T21:05:18', '2005-08-05T23:52:18', '2'), - ('72', '4063', '2006-02-16T02:30:53', '2005-07-31T05:46:03', '2005-08-09T04:36:03', '2'), - ('548', '2955', '2006-02-16T02:30:53', '2005-07-31T03:59:31', '2005-08-08T04:19:31', '1'), - ('548', '2528', '2006-02-16T02:30:53', '2005-05-29T08:39:02', '2005-06-06T08:42:02', '2'), - ('548', '376', '2006-02-16T02:30:53', '2005-07-06T09:37:50', '2005-07-09T10:15:50', '2'), - ('548', '3545', '2006-02-16T02:30:53', '2005-05-26T04:14:29', '2005-06-01T08:16:29', '2'), - ('548', '59', '2006-02-16T02:30:53', '2005-06-15T11:07:39', '2005-06-22T05:55:39', '2'), - ('548', '2470', '2006-02-16T02:30:53', '2005-07-06T13:36:48', '2005-07-11T14:26:48', '1'), - ('548', '676', '2006-02-16T02:30:53', '2005-08-20T09:07:39', '2005-08-28T15:03:39', '1'), - ('548', '212', '2006-02-16T02:30:53', '2005-07-07T09:00:49', '2005-07-13T10:59:49', '2'), - ('548', '2249', '2006-02-16T02:30:53', '2005-07-12T02:28:03', '2005-07-19T03:06:03', '2'), - ('548', '2755', '2006-02-16T02:30:53', '2005-08-21T21:52:32', '2005-08-31T00:03:32', '2'), - ('548', '885', '2006-02-16T02:30:53', '2005-08-01T04:36:53', '2005-08-04T00:54:53', '1'), - ('548', '1330', '2006-02-16T02:30:53', '2005-08-20T10:17:09', '2005-08-28T10:45:09', '1'), - ('548', '4492', '2006-02-16T02:30:53', '2005-08-21T03:32:04', '2005-08-22T07:26:04', '1'), - ('548', '778', '2006-02-16T02:30:53', '2005-08-19T02:24:41', '2005-08-25T07:43:41', '1'), - ('548', '4568', '2006-02-16T02:30:53', '2005-06-18T06:46:54', '2005-06-26T09:48:54', '2'), - ('548', '3904', '2006-02-16T02:30:53', '2005-05-30T05:03:04', '2005-06-06T10:35:04', '1'), - ('548', '3966', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('548', '1283', '2006-02-16T02:30:53', '2005-07-09T08:00:46', '2005-07-12T09:31:46', '2'), - ('548', '4364', '2006-02-16T02:30:53', '2005-06-20T08:25:16', '2005-06-23T05:42:16', '1'), - ('244', '3266', '2006-02-16T02:30:53', '2005-07-10T13:45:54', '2005-07-15T18:13:54', '1'), - ('244', '1985', '2006-02-16T02:30:53', '2005-08-01T17:47:00', '2005-08-09T15:00:00', '2'), - ('244', '735', '2006-02-16T02:30:53', '2005-08-20T11:54:01', '2005-08-22T13:25:01', '2'), - ('244', '1121', '2006-02-16T02:30:53', '2005-08-20T17:12:28', '2005-08-21T13:33:28', '1'), - ('244', '1313', '2006-02-16T02:30:53', '2005-08-02T09:58:15', '2005-08-06T04:23:15', '2'), - ('244', '59', '2006-02-16T02:30:53', '2005-07-10T09:32:22', '2005-07-15T15:20:22', '2'), - ('244', '3346', '2006-02-16T02:30:53', '2005-08-20T07:05:56', '2005-08-29T04:15:56', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['2955', '5461', '1189', '1595', '5803', '6608', '5387', '14919', '14657', '10152', '10969', '6683', '8844', '6374', '797', '14975', '12736', '11762', '8454', '14367', '4814', '11267', '10001', '10047', '592', '1734', '4287', '15693', '127', '629', '5719', '13786', '4044', '7979', '2816', '1213', '14978', '15371', '12316', '5970', '9605', '14865', '2620', '14804', '1367', '7809', '6996', '11895', '5545', '6303', '7792', '2311', '7780', '14364', '4959', '11507', '262', '12988', '11486', '4749', '12975', '8657', '1308', '7798', '5404', '7047', '3857', '13364', '10137', '3645', '3460', '9934', '6049', '2840', '1262', '344', '13443', '5938', '6281', '11139', '3353', '2630', '14321', '1032', '9011', '2139', '7253', '14722', '3067', '5433', '10987', '8297', '14200', '3488', '11192', '13636', '1523', '2987', '9670', '890']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('244', '2312', '2006-02-16T02:30:53', '2005-06-20T06:46:35', '2005-06-25T05:34:35', '2'), - ('244', '53', '2006-02-16T02:30:53', '2005-07-09T22:48:04', '2005-07-10T17:56:04', '2'), - ('244', '142', '2006-02-16T02:30:53', '2005-06-15T01:04:22', '2005-06-24T06:48:22', '1'), - ('244', '1481', '2006-02-16T02:30:53', '2005-06-16T05:23:46', '2005-06-20T00:37:46', '1'), - ('244', '1982', '2006-02-16T02:30:53', '2005-07-10T15:05:42', '2005-07-15T10:19:42', '1'), - ('244', '3577', '2006-02-16T02:30:53', '2005-07-12T08:16:50', '2005-07-18T07:08:50', '2'), - ('244', '4452', '2006-02-16T02:30:53', '2005-07-09T19:25:14', '2005-07-11T21:00:14', '1'), - ('244', '1587', '2006-02-16T02:30:53', '2005-08-22T05:07:17', '2005-08-30T06:41:17', '2'), - ('244', '477', '2006-02-16T02:30:53', '2005-08-21T19:39:43', '2005-08-26T22:39:43', '2'), - ('244', '1114', '2006-02-16T02:30:53', '2005-07-31T22:28:05', '2005-08-08T22:39:05', '2'), - ('244', '1898', '2006-02-16T02:30:53', '2005-08-02T04:04:32', '2005-08-09T23:18:32', '1'), - ('244', '3433', '2006-02-16T02:30:53', '2005-07-12T12:14:05', '2005-07-17T14:02:05', '2'), - ('244', '327', '2006-02-16T02:30:53', '2005-07-29T23:05:08', '2005-08-06T00:24:08', '2'), - ('244', '266', '2006-02-16T02:30:53', '2005-07-11T21:36:10', '2005-07-17T15:50:10', '2'), - ('244', '1446', '2006-02-16T02:30:53', '2005-05-29T17:12:17', '2005-06-03T16:06:17', '1'), - ('244', '924', '2006-02-16T02:30:53', '2005-08-22T07:07:50', '2005-08-28T07:23:50', '2'), - ('244', '3591', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('244', '1204', '2006-02-16T02:30:53', '2005-08-17T09:48:06', '2005-08-26T13:12:06', '2'), - ('244', '159', '2006-02-16T02:30:53', '2005-07-29T07:49:04', '2005-08-03T04:43:04', '2'), - ('244', '870', '2006-02-16T02:30:53', '2005-08-21T09:31:44', '2005-08-26T03:54:44', '2'), - ('244', '3497', '2006-02-16T02:30:53', '2005-07-08T17:11:09', '2005-07-17T12:43:09', '2'), - ('244', '2045', '2006-02-16T02:30:53', '2005-08-02T14:09:08', '2005-08-10T12:33:08', '1'), - ('244', '2188', '2006-02-16T02:30:53', '2005-07-31T17:46:18', '2005-08-07T20:38:18', '1'), - ('244', '4195', '2006-02-16T02:30:53', '2005-07-31T19:07:43', '2005-08-07T00:20:43', '2'), - ('244', '638', '2006-02-16T02:30:53', '2005-05-28T13:21:08', '2005-05-29T16:55:08', '1'), - ('94', '1113', '2006-02-16T02:30:53', '2005-06-16T15:49:30', '2005-06-22T13:52:30', '2'), - ('94', '3558', '2006-02-16T02:30:53', '2005-07-07T15:37:31', '2005-07-16T19:59:31', '2'), - ('94', '748', '2006-02-16T02:30:53', '2005-08-23T10:00:24', '2005-08-25T08:23:24', '1'), - ('94', '2026', '2006-02-16T02:30:53', '2005-05-25T21:10:40', '2005-06-02T21:38:40', '1'), - ('94', '1527', '2006-02-16T02:30:53', '2005-05-28T17:19:15', '2005-06-02T20:01:15', '2'), - ('94', '2100', '2006-02-16T02:30:53', '2005-07-10T11:07:40', '2005-07-15T14:14:40', '2'), - ('94', '515', '2006-02-16T02:30:53', '2005-08-20T12:13:24', '2005-08-28T07:24:24', '2'), - ('94', '3263', '2006-02-16T02:30:53', '2005-07-07T03:22:23', '2005-07-13T03:23:23', '1'), - ('94', '3303', '2006-02-16T02:30:53', '2005-07-28T14:16:30', '2005-08-03T09:39:30', '2'), - ('94', '2180', '2006-02-16T02:30:53', '2005-06-19T20:04:23', '2005-06-20T21:09:23', '2'), - ('94', '3191', '2006-02-16T02:30:53', '2005-06-15T03:14:05', '2005-06-15T21:41:05', '2'), - ('94', '699', '2006-02-16T02:30:53', '2005-08-22T07:13:15', '2005-08-25T12:26:15', '1'), - ('94', '3672', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('94', '4325', '2006-02-16T02:30:53', '2005-08-18T06:16:09', '2005-08-27T05:54:09', '2'), - ('94', '1514', '2006-02-16T02:30:53', '2005-07-11T00:04:50', '2005-07-19T03:36:50', '1'), - ('94', '1477', '2006-02-16T02:30:53', '2005-07-31T03:50:07', '2005-08-07T09:15:07', '2'), - ('94', '3775', '2006-02-16T02:30:53', '2005-08-22T03:06:38', '2005-08-23T04:26:38', '1'), - ('94', '3183', '2006-02-16T02:30:53', '2005-06-19T08:06:29', '2005-06-24T11:42:29', '1'), - ('94', '372', '2006-02-16T02:30:53', '2005-08-22T00:51:25', '2005-08-26T21:15:25', '1'), - ('94', '1505', '2006-02-16T02:30:53', '2005-06-15T14:25:17', '2005-06-21T19:15:17', '1'), - ('94', '4150', '2006-02-16T02:30:53', '2005-07-28T07:59:46', '2005-08-02T02:56:46', '1'), - ('236', '3237', '2006-02-16T02:30:53', '2005-07-27T01:13:45', '2005-07-28T20:43:45', '1'), - ('236', '2156', '2006-02-16T02:30:53', '2005-08-17T15:15:07', '2005-08-18T11:00:07', '2'), - ('236', '118', '2006-02-16T02:30:53', '2005-07-10T02:50:29', '2005-07-16T02:11:29', '1'), - ('236', '846', '2006-02-16T02:30:53', '2005-07-11T17:55:43', '2005-07-13T12:50:43', '1'), - ('236', '3736', '2006-02-16T02:30:53', '2005-07-28T07:24:02', '2005-08-04T11:13:02', '1'), - ('236', '4506', '2006-02-16T02:30:53', '2005-06-18T08:51:29', '2005-06-25T07:51:29', '1'), - ('236', '3069', '2006-02-16T02:30:53', '2005-07-28T07:11:55', '2005-08-06T05:41:55', '1'), - ('236', '3513', '2006-02-16T02:30:53', '2005-08-21T09:25:11', '2005-08-29T09:04:11', '1'), - ('236', '3898', '2006-02-16T02:30:53', '2005-07-08T23:22:23', '2005-07-10T03:17:23', '2'), - ('236', '4197', '2006-02-16T02:30:53', '2005-08-16T23:26:43', '2005-08-24T22:48:43', '2'), - ('236', '4261', '2006-02-16T02:30:53', '2005-05-26T15:46:56', '2005-05-28T15:49:56', '2'), - ('236', '81', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('236', '1610', '2006-02-16T02:30:53', '2005-08-02T22:34:06', '2005-08-09T00:46:06', '2'), - ('236', '1190', '2006-02-16T02:30:53', '2005-07-08T14:05:58', '2005-07-10T18:35:58', '2'), - ('236', '3300', '2006-02-16T02:30:53', '2005-08-19T06:51:19', '2005-08-25T04:22:19', '1'), - ('236', '3194', '2006-02-16T02:30:53', '2005-07-29T15:09:25', '2005-07-31T19:10:25', '1'), - ('236', '220', '2006-02-16T02:30:53', '2005-06-15T10:07:48', '2005-06-24T15:24:48', '1'), - ('236', '3281', '2006-02-16T02:30:53', '2005-07-28T07:41:59', '2005-07-31T12:36:59', '1'), - ('236', '3685', '2006-02-16T02:30:53', '2005-07-09T20:10:43', '2005-07-13T15:16:43', '1'), - ('236', '2866', '2006-02-16T02:30:53', '2005-07-27T03:31:11', '2005-08-03T23:40:11', '1'), - ('236', '1135', '2006-02-16T02:30:53', '2005-07-06T17:07:54', '2005-07-07T13:28:54', '1'), - ('236', '2773', '2006-02-16T02:30:53', '2005-08-19T21:09:30', '2005-08-25T18:37:30', '1'), - ('236', '612', '2006-02-16T02:30:53', '2005-07-31T22:01:41', '2005-08-07T22:24:41', '1'), - ('236', '3390', '2006-02-16T02:30:53', '2005-07-06T07:22:09', '2005-07-10T11:45:09', '1'), - ('236', '1765', '2006-02-16T02:30:53', '2005-06-21T21:46:56', '2005-06-29T20:08:56', '1'), - ('236', '2492', '2006-02-16T02:30:53', '2005-07-31T15:25:26', '2005-08-05T17:13:26', '1'), - ('236', '2582', '2006-02-16T02:30:53', '2005-07-11T03:32:32', '2005-07-15T06:57:32', '2'), - ('236', '1102', '2006-02-16T02:30:53', '2005-06-19T22:17:44', '2005-06-26T00:36:44', '2'), - ('236', '4495', '2006-02-16T02:30:53', '2005-06-15T06:54:53', '2005-06-22T08:09:53', '2'), - ('236', '2327', '2006-02-16T02:30:53', '2005-05-27T04:30:22', '2005-05-29T10:13:22', '2'), - ('236', '3161', '2006-02-16T02:30:53', '2005-08-19T23:53:42', '2005-08-28T05:37:42', '1'), - ('236', '2834', '2006-02-16T02:30:53', '2005-07-10T22:17:42', '2005-07-16T22:38:42', '2'), - ('236', '835', '2006-02-16T02:30:53', '2005-07-11T16:38:16', '2005-07-13T10:57:16', '2'), - ('236', '1011', '2006-02-16T02:30:53', '2005-08-02T09:27:36', '2005-08-08T14:07:36', '2'), - ('236', '3984', '2006-02-16T02:30:53', '2005-06-21T11:29:23', '2005-06-27T15:06:23', '1'), - ('236', '3904', '2006-02-16T02:30:53', '2005-06-19T08:47:21', '2005-06-25T09:31:21', '1'), - ('236', '967', '2006-02-16T02:30:53', '2005-08-21T08:05:12', '2005-08-23T02:17:12', '1'), - ('236', '2937', '2006-02-16T02:30:53', '2005-05-31T04:28:43', '2005-06-02T02:00:43', '2'), - ('236', '2799', '2006-02-16T02:30:53', '2005-07-30T05:16:29', '2005-08-05T06:57:29', '1'), - ('236', '807', '2006-02-16T02:30:53', '2005-06-17T21:29:34', '2005-06-26T21:05:34', '1'), - ('236', '1950', '2006-02-16T02:30:53', '2005-07-27T10:46:37', '2005-07-28T11:18:37', '1'), - ('236', '2930', '2006-02-16T02:30:53', '2005-08-21T21:50:53', '2005-08-30T03:13:53', '1'), - ('349', '3094', '2006-02-16T02:30:53', '2005-06-20T13:59:21', '2005-06-28T19:09:21', '2'), - ('349', '2679', '2006-02-16T02:30:53', '2005-07-09T21:22:00', '2005-07-10T21:18:00', '2'), - ('349', '968', '2006-02-16T02:30:53', '2005-08-02T04:36:52', '2005-08-04T00:03:52', '1'), - ('349', '3774', '2006-02-16T02:30:53', '2005-07-29T02:45:46', '2005-07-31T20:49:46', '1'), - ('349', '2339', '2006-02-16T02:30:53', '2005-08-21T03:51:27', '2005-08-29T22:00:27', '1'), - ('349', '898', '2006-02-16T02:30:53', '2005-07-05T23:32:49', '2005-07-15T02:01:49', '2'), - ('349', '1998', '2006-02-16T02:30:53', '2005-08-02T11:29:41', '2005-08-07T06:01:41', '2'), - ('349', '1467', '2006-02-16T02:30:53', '2005-08-20T07:20:09', '2005-08-23T09:58:09', '1'), - ('349', '681', '2006-02-16T02:30:53', '2005-06-16T00:18:40', '2005-06-17T02:50:40', '2'), - ('349', '1531', '2006-02-16T02:30:53', '2005-06-20T08:55:50', '2005-06-28T13:02:50', '2'), - ('349', '3709', '2006-02-16T02:30:53', '2005-07-31T06:33:33', '2005-08-07T04:51:33', '1'), - ('349', '1464', '2006-02-16T02:30:53', '2005-05-30T07:43:04', '2005-06-01T11:26:04', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['4881', '4190', '13258', '11492', '14915', '11905', '14721', '14908', '4494', '7002', '9262', '15955', '7046', '15833', '1197', '9731', '7702', '9350', '15016', '8205', '508', '2415', '15385', '12624', '12030', '11867', '5464', '14553', '4960', '7260', '12146', '2430', '13359', '4654', '4414', '3014', '7479', '13383', '11242', '1225', '1584', '6972', '3037', '2494', '9412', '12494', '9533', '10223', '11830', '7955', '3102', '9047', '9335', '4701', '8966', '10411', '5532', '3191', '4078', '1289', '7262', '15921', '11696', '5936', '9227', '10821', '14467', '13605', '4563', '3188', '3594', '5514', '10675', '8642', '426', '5271', '8181', '10896', '14398', '11907', '4507', '7784', '13612', '10219', '15867', '645', '3137', '1886', '1799', '4008', '2773', '5976', '11163', '6292', '6441', '15436', '14802', '159', '4590', '11164']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('349', '4346', '2006-02-16T02:30:53', '2005-07-08T19:40:34', '2005-07-09T17:08:34', '2'), - ('349', '826', '2006-02-16T02:30:53', '2005-07-07T10:52:39', '2005-07-11T13:19:39', '1'), - ('349', '2246', '2006-02-16T02:30:53', '2005-08-19T17:05:37', '2005-08-24T17:36:37', '2'), - ('349', '4037', '2006-02-16T02:30:53', '2005-08-02T22:46:47', '2005-08-09T19:54:47', '2'), - ('349', '112', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('349', '2725', '2006-02-16T02:30:53', '2005-08-17T15:40:18', '2005-08-26T15:14:18', '2'), - ('349', '4257', '2006-02-16T02:30:53', '2005-08-21T21:50:51', '2005-08-30T19:21:51', '1'), - ('349', '102', '2006-02-16T02:30:53', '2005-08-22T04:44:10', '2005-08-25T05:09:10', '2'), - ('349', '1655', '2006-02-16T02:30:53', '2005-07-08T01:42:45', '2005-07-16T22:29:45', '2'), - ('349', '4157', '2006-02-16T02:30:53', '2005-07-27T01:26:14', '2005-08-01T20:10:14', '1'), - ('349', '2322', '2006-02-16T02:30:53', '2005-07-30T14:45:02', '2005-08-05T15:18:02', '2'), - ('349', '2247', '2006-02-16T02:30:53', '2005-08-23T19:19:06', '2005-08-31T23:34:06', '1'), - ('349', '3740', '2006-02-16T02:30:53', '2005-07-27T03:27:56', '2005-07-30T00:54:56', '2'), - ('349', '801', '2006-02-16T02:30:53', '2005-08-23T15:22:15', '2005-08-31T14:54:15', '1'), - ('349', '3812', '2006-02-16T02:30:53', '2005-06-15T01:42:46', '2005-06-20T00:22:46', '1'), - ('349', '3713', '2006-02-16T02:30:53', '2005-07-31T08:54:47', '2005-08-05T03:47:47', '1'), - ('349', '253', '2006-02-16T02:30:53', '2005-07-28T03:56:05', '2005-07-31T03:29:05', '1'), - ('434', '798', '2006-02-16T02:30:53', '2005-07-30T18:24:30', '2005-08-02T15:34:30', '2'), - ('434', '879', '2006-02-16T02:30:53', '2005-08-22T08:47:35', '2005-08-28T14:23:35', '2'), - ('434', '2944', '2006-02-16T02:30:53', '2005-07-28T23:18:48', '2005-07-30T00:37:48', '2'), - ('434', '4179', '2006-02-16T02:30:53', '2005-05-28T02:40:50', '2005-06-05T03:05:50', '1'), - ('434', '3105', '2006-02-16T02:30:53', '2005-06-18T17:02:42', '2005-06-25T13:16:42', '2'), - ('434', '140', '2006-02-16T02:30:53', '2005-08-22T22:37:34', '2005-08-26T00:36:34', '2'), - ('434', '1135', '2006-02-16T02:30:53', '2005-08-18T17:35:00', '2005-08-27T12:18:00', '2'), - ('434', '449', '2006-02-16T02:30:53', '2005-08-17T20:10:48', '2005-08-19T00:32:48', '1'), - ('434', '938', '2006-02-16T02:30:53', '2005-08-17T14:04:28', '2005-08-21T10:08:28', '1'), - ('434', '3692', '2006-02-16T02:30:53', '2005-07-09T22:58:14', '2005-07-15T02:48:14', '1'), - ('434', '3160', '2006-02-16T02:30:53', '2005-08-21T15:59:40', '2005-08-23T11:54:40', '2'), - ('434', '2176', '2006-02-16T02:30:53', '2005-07-08T23:27:16', '2005-07-18T02:01:16', '1'), - ('434', '3827', '2006-02-16T02:30:53', '2005-07-27T11:09:28', '2005-08-03T09:41:28', '1'), - ('434', '3833', '2006-02-16T02:30:53', '2005-08-18T00:10:04', '2005-08-25T19:18:04', '2'), - ('434', '1984', '2006-02-16T02:30:53', '2005-06-18T17:51:46', '2005-06-23T19:17:46', '1'), - ('434', '4175', '2006-02-16T02:30:53', '2005-08-19T21:04:49', '2005-08-27T01:46:49', '1'), - ('434', '4210', '2006-02-16T02:30:53', '2005-07-08T09:48:03', '2005-07-17T13:17:03', '1'), - ('434', '991', '2006-02-16T02:30:53', '2005-07-07T22:00:21', '2005-07-12T02:51:21', '1'), - ('434', '2179', '2006-02-16T02:30:53', '2005-06-20T10:45:20', '2005-06-23T06:29:20', '1'), - ('434', '218', '2006-02-16T02:30:53', '2005-07-27T19:18:17', '2005-07-30T18:55:17', '1'), - ('434', '3193', '2006-02-16T02:30:53', '2005-08-19T21:38:44', '2005-08-28T23:22:44', '2'), - ('434', '1041', '2006-02-16T02:30:53', '2005-08-02T13:32:00', '2005-08-10T19:24:00', '2'), - ('434', '1929', '2006-02-16T02:30:53', '2005-06-15T03:45:35', '2005-06-19T02:03:35', '1'), - ('434', '3545', '2006-02-16T02:30:53', '2005-06-16T04:50:50', '2005-06-21T22:51:50', '2'), - ('434', '1716', '2006-02-16T02:30:53', '2005-07-27T00:31:25', '2005-07-28T22:15:25', '2'), - ('434', '2033', '2006-02-16T02:30:53', '2005-06-20T12:28:03', '2005-06-21T08:21:03', '1'), - ('434', '1313', '2006-02-16T02:30:53', '2005-06-18T22:15:09', '2005-06-25T17:23:09', '1'), - ('522', '2482', '2006-02-16T02:30:53', '2005-07-30T20:44:10', '2005-08-06T21:13:10', '2'), - ('522', '3845', '2006-02-16T02:30:53', '2005-08-18T12:53:49', '2005-08-26T15:52:49', '1'), - ('522', '4156', '2006-02-16T02:30:53', '2005-07-31T01:18:10', '2005-08-07T19:58:10', '1'), - ('522', '1370', '2006-02-16T02:30:53', '2005-08-01T01:23:15', '2005-08-02T19:39:15', '1'), - ('522', '3713', '2006-02-16T02:30:53', '2005-08-17T12:53:15', '2005-08-25T08:08:15', '1'), - ('522', '1519', '2006-02-16T02:30:53', '2005-07-28T13:31:36', '2005-07-30T10:03:36', '1'), - ('522', '1144', '2006-02-16T02:30:53', '2005-06-20T16:55:55', '2005-06-29T13:49:55', '1'), - ('522', '256', '2006-02-16T02:30:53', '2005-07-30T06:56:33', '2005-08-08T06:40:33', '2'), - ('522', '1006', '2006-02-16T02:30:53', '2005-07-30T18:00:53', '2005-08-01T16:05:53', '1'), - ('522', '3012', '2006-02-16T02:30:53', '2005-07-08T11:38:48', '2005-07-13T15:59:48', '2'), - ('522', '1903', '2006-02-16T02:30:53', '2005-07-30T03:54:12', '2005-07-31T04:51:12', '1'), - ('522', '1946', '2006-02-16T02:30:53', '2005-08-01T07:56:32', '2005-08-10T04:58:32', '2'), - ('522', '983', '2006-02-16T02:30:53', '2005-07-10T02:17:31', '2005-07-16T02:57:31', '2'), - ('522', '4358', '2006-02-16T02:30:53', '2005-06-20T23:46:39', '2005-06-25T03:21:39', '2'), - ('522', '1671', '2006-02-16T02:30:53', '2005-07-07T05:05:05', '2005-07-10T05:39:05', '1'), - ('522', '3154', '2006-02-16T02:30:53', '2005-06-15T08:44:09', '2005-06-21T06:04:09', '1'), - ('522', '4097', '2006-02-16T02:30:53', '2005-07-27T11:15:36', '2005-07-30T10:49:36', '2'), - ('522', '223', '2006-02-16T02:30:53', '2005-08-23T18:06:54', '2005-08-30T20:19:54', '2'), - ('522', '3816', '2006-02-16T02:30:53', '2005-08-17T07:01:09', '2005-08-21T09:12:09', '2'), - ('522', '1951', '2006-02-16T02:30:53', '2005-07-10T22:14:30', '2005-07-15T01:32:30', '1'), - ('522', '2353', '2006-02-16T02:30:53', '2005-07-30T13:36:13', '2005-08-07T17:39:13', '1'), - ('522', '2016', '2006-02-16T02:30:53', '2005-08-01T22:54:27', '2005-08-07T02:15:27', '2'), - ('522', '1498', '2006-02-16T02:30:53', '2005-08-21T13:03:33', '2005-08-28T15:28:33', '1'), - ('522', '4446', '2006-02-16T02:30:53', '2005-08-20T06:06:17', '2005-08-26T00:53:17', '2'), - ('522', '287', '2006-02-16T02:30:53', '2005-07-08T05:08:55', '2005-07-16T05:44:55', '2'), - ('522', '2471', '2006-02-16T02:30:53', '2005-06-20T23:10:27', '2005-06-25T19:37:27', '2'), - ('522', '4566', '2006-02-16T02:30:53', '2005-07-06T04:42:47', '2005-07-10T00:49:47', '1'), - ('522', '1824', '2006-02-16T02:30:53', '2005-07-10T01:09:42', '2005-07-17T05:47:42', '1'), - ('522', '649', '2006-02-16T02:30:53', '2005-08-01T17:11:57', '2005-08-10T17:18:57', '1'), - ('522', '3947', '2006-02-16T02:30:53', '2005-07-29T14:38:17', '2005-08-03T14:41:17', '1'), - ('522', '1103', '2006-02-16T02:30:53', '2005-05-27T15:56:57', '2005-06-05T11:45:57', '1'), - ('522', '2691', '2006-02-16T02:30:53', '2005-07-09T14:25:01', '2005-07-16T17:28:01', '1'), - ('522', '357', '2006-02-16T02:30:53', '2005-07-28T22:18:38', '2005-08-06T02:43:38', '2'), - ('505', '2283', '2006-02-16T02:30:53', '2005-08-02T01:19:33', '2005-08-08T06:54:33', '1'), - ('505', '357', '2006-02-16T02:30:53', '2005-08-21T10:27:21', '2005-08-23T10:46:21', '2'), - ('505', '3928', '2006-02-16T02:30:53', '2005-08-17T15:40:47', '2005-08-20T19:55:47', '2'), - ('505', '819', '2006-02-16T02:30:53', '2005-07-08T02:22:45', '2005-07-14T20:53:45', '1'), - ('505', '3611', '2006-02-16T02:30:53', '2005-07-28T07:15:32', '2005-08-06T05:00:32', '1'), - ('505', '675', '2006-02-16T02:30:53', '2005-08-20T06:22:08', '2005-08-28T02:22:08', '1'), - ('505', '2262', '2006-02-16T02:30:53', '2005-08-01T01:10:33', '2005-08-10T02:45:33', '2'), - ('505', '837', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('505', '3128', '2006-02-16T02:30:53', '2005-05-28T19:14:09', '2005-06-05T14:01:09', '1'), - ('505', '786', '2006-02-16T02:30:53', '2005-06-20T19:41:28', '2005-06-28T00:32:28', '1'), - ('505', '2367', '2006-02-16T02:30:53', '2005-06-17T03:36:02', '2005-06-19T08:12:02', '2'), - ('505', '2847', '2006-02-16T02:30:53', '2005-06-16T20:17:20', '2005-06-20T23:55:20', '1'), - ('505', '1107', '2006-02-16T02:30:53', '2005-07-07T00:26:43', '2005-07-16T03:58:43', '2'), - ('505', '4155', '2006-02-16T02:30:53', '2005-06-19T18:04:18', '2005-06-28T23:52:18', '1'), - ('505', '1693', '2006-02-16T02:30:53', '2005-07-11T00:16:35', '2005-07-20T01:30:35', '2'), - ('505', '1925', '2006-02-16T02:30:53', '2005-08-02T10:08:40', '2005-08-05T14:59:40', '1'), - ('505', '4375', '2006-02-16T02:30:53', '2005-07-11T17:23:33', '2005-07-12T16:27:33', '2'), - ('505', '2489', '2006-02-16T02:30:53', '2005-07-12T00:27:08', '2005-07-14T03:12:08', '1'), - ('505', '1527', '2006-02-16T02:30:53', '2005-08-23T00:30:26', '2005-08-28T06:29:26', '1'), - ('505', '707', '2006-02-16T02:30:53', '2005-08-22T00:48:23', '2005-08-28T01:02:23', '1'), - ('505', '3453', '2006-02-16T02:30:53', '2005-05-26T01:34:28', '2005-05-29T04:00:28', '1'), - ('580', '4233', '2006-02-16T02:30:53', '2005-07-08T06:27:48', '2005-07-14T07:46:48', '1'), - ('580', '4450', '2006-02-16T02:30:53', '2005-08-02T10:10:56', '2005-08-10T11:20:56', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['9604', '9239', '9199', '10723', '7620', '8784', '12670', '6089', '3571', '15630', '1469', '611', '13313', '8839', '14818', '3867', '9460', '10965', '13742', '4169', '9865', '6170', '15157', '15947', '5937', '6321', '4947', '9368', '5899', '14853', '14273', '6452', '21', '12068', '9213', '2537', '9940', '10044', '9840', '15660', '3159', '411', '8456', '1276', '12267', '11604', '12977', '12646', '12044', '12497', '2692', '7985', '12891', '2145', '12749', '11822', '6808', '7425', '266', '12057', '7706', '7833', '6483', '3578', '10476', '14335', '10775', '11339', '7291', '12432', '3257', '4682', '6376', '2126', '15322', '12919', '3773', '97', '14448', '5254', '15293', '5125', '4637', '15922', '15786', '825', '4115', '13191', '3176', '1573', '9008', '6460', '7408', '14384', '13028', '12397', '384', '8138', '11086', '9117']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('580', '4342', '2006-02-16T02:30:53', '2005-07-31T03:47:12', '2005-08-03T06:48:12', '1'), - ('580', '1728', '2006-02-16T02:30:53', '2005-07-30T13:50:52', '2005-08-06T16:28:52', '1'), - ('580', '4336', '2006-02-16T02:30:53', '2005-07-30T12:38:00', '2005-08-01T07:09:00', '1'), - ('580', '2526', '2006-02-16T02:30:53', '2005-08-01T19:10:49', '2005-08-08T19:21:49', '2'), - ('580', '931', '2006-02-16T02:30:53', '2005-07-28T00:27:17', '2005-07-31T02:04:17', '1'), - ('580', '2308', '2006-02-16T02:30:53', '2005-07-29T20:35:37', '2005-07-30T17:22:37', '1'), - ('580', '1716', '2006-02-16T02:30:53', '2005-08-18T19:17:58', '2005-08-23T20:54:58', '2'), - ('580', '3298', '2006-02-16T02:30:53', '2005-07-11T05:45:59', '2005-07-17T11:04:59', '2'), - ('580', '4166', '2006-02-16T02:30:53', '2005-07-06T03:32:31', '2005-07-11T06:15:31', '1'), - ('580', '3590', '2006-02-16T02:30:53', '2005-08-23T07:29:13', '2005-08-31T04:33:13', '2'), - ('580', '2451', '2006-02-16T02:30:53', '2005-06-15T20:52:36', '2005-06-21T19:55:36', '1'), - ('580', '1230', '2006-02-16T02:30:53', '2005-05-28T15:18:18', '2005-05-31T20:15:18', '2'), - ('580', '3709', '2006-02-16T02:30:53', '2005-08-19T19:11:41', '2005-08-21T23:53:41', '2'), - ('580', '3440', '2006-02-16T02:30:53', '2005-07-29T22:52:34', '2005-08-05T03:24:34', '2'), - ('580', '1619', '2006-02-16T02:30:53', '2005-08-22T01:17:18', '2005-08-26T05:40:18', '1'), - ('580', '3620', '2006-02-16T02:30:53', '2005-07-06T17:52:19', '2005-07-13T21:48:19', '1'), - ('580', '4463', '2006-02-16T02:30:53', '2005-07-30T22:25:39', '2005-08-08T20:56:39', '2'), - ('580', '2192', '2006-02-16T02:30:53', '2005-08-02T04:00:19', '2005-08-09T03:27:19', '1'), - ('580', '1377', '2006-02-16T02:30:53', '2005-08-20T10:49:15', '2005-08-21T11:05:15', '2'), - ('580', '3360', '2006-02-16T02:30:53', '2005-07-07T09:39:18', '2005-07-11T13:43:18', '1'), - ('580', '1355', '2006-02-16T02:30:53', '2005-07-31T13:10:45', '2005-08-02T09:19:45', '2'), - ('580', '278', '2006-02-16T02:30:53', '2005-07-11T10:29:21', '2005-07-16T05:13:21', '2'), - ('580', '1909', '2006-02-16T02:30:53', '2005-08-22T14:30:09', '2005-08-29T18:28:09', '1'), - ('580', '1877', '2006-02-16T02:30:53', '2005-08-23T18:54:32', '2005-08-24T22:39:32', '2'), - ('580', '1579', '2006-02-16T02:30:53', '2005-07-10T22:16:08', '2005-07-16T03:08:08', '2'), - ('388', '2655', '2006-02-16T02:30:53', '2005-07-11T18:51:02', '2005-07-14T20:57:02', '2'), - ('388', '3905', '2006-02-16T02:30:53', '2005-07-08T22:49:37', '2005-07-17T21:03:37', '1'), - ('388', '3026', '2006-02-16T02:30:53', '2005-07-30T18:50:53', '2005-08-05T17:56:53', '2'), - ('388', '1391', '2006-02-16T02:30:53', '2005-07-10T20:21:52', '2005-07-13T00:46:52', '1'), - ('388', '3575', '2006-02-16T02:30:53', '2005-08-22T02:26:33', '2005-08-31T02:49:33', '2'), - ('388', '2640', '2006-02-16T02:30:53', '2005-08-21T06:26:48', '2005-08-30T10:34:48', '1'), - ('388', '109', '2006-02-16T02:30:53', '2005-07-12T00:57:31', '2005-07-14T20:41:31', '1'), - ('388', '146', '2006-02-16T02:30:53', '2005-05-25T01:59:46', '2005-05-26T01:01:46', '2'), - ('388', '4327', '2006-02-16T02:30:53', '2005-08-17T21:37:08', '2005-08-26T00:10:08', '1'), - ('388', '184', '2006-02-16T02:30:53', '2005-07-30T13:07:11', '2005-08-01T15:30:11', '1'), - ('388', '3499', '2006-02-16T02:30:53', '2005-06-19T01:52:21', '2005-06-26T02:09:21', '1'), - ('388', '3975', '2006-02-16T02:30:53', '2005-07-31T15:29:06', '2005-08-06T14:26:06', '2'), - ('388', '3349', '2006-02-16T02:30:53', '2005-07-31T19:02:33', '2005-08-05T13:24:33', '2'), - ('388', '364', '2006-02-16T02:30:53', '2005-07-31T12:23:18', '2005-08-06T15:59:18', '1'), - ('388', '3223', '2006-02-16T02:30:53', '2005-08-23T08:51:21', '2005-08-28T06:26:21', '2'), - ('388', '33', '2006-02-16T02:30:53', '2005-06-20T21:11:50', '2005-06-29T19:35:50', '2'), - ('388', '1434', '2006-02-16T02:30:53', '2005-05-27T14:14:14', '2005-06-03T17:39:14', '1'), - ('388', '671', '2006-02-16T02:30:53', '2005-07-29T07:58:31', '2005-08-05T07:17:31', '2'), - ('388', '1508', '2006-02-16T02:30:53', '2005-06-15T08:00:13', '2005-06-24T02:55:13', '2'), - ('388', '652', '2006-02-16T02:30:53', '2005-08-18T04:24:30', '2005-08-26T03:01:30', '2'), - ('388', '1820', '2006-02-16T02:30:53', '2005-08-17T03:28:27', '2005-08-19T05:38:27', '2'), - ('388', '2004', '2006-02-16T02:30:53', '2005-08-19T06:55:33', '2005-08-27T07:38:33', '2'), - ('388', '3103', '2006-02-16T02:30:53', '2005-08-18T18:25:06', '2005-08-24T18:45:06', '1'), - ('388', '3377', '2006-02-16T02:30:53', '2005-08-17T20:39:37', '2005-08-19T18:34:37', '1'), - ('388', '824', '2006-02-16T02:30:53', '2005-08-18T12:58:40', '2005-08-24T08:24:40', '1'), - ('388', '3162', '2006-02-16T02:30:53', '2005-06-19T13:08:19', '2005-06-21T16:45:19', '1'), - ('388', '4022', '2006-02-16T02:30:53', '2005-07-28T14:29:01', '2005-08-03T17:20:01', '2'), - ('388', '2764', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('388', '238', '2006-02-16T02:30:53', '2005-06-17T22:10:36', '2005-06-18T21:07:36', '2'), - ('388', '828', '2006-02-16T02:30:53', '2005-08-18T22:31:21', '2005-08-20T22:53:21', '1'), - ('263', '1317', '2006-02-16T02:30:53', '2005-08-17T12:32:39', '2005-08-18T12:30:39', '2'), - ('263', '362', '2006-02-16T02:30:53', '2005-07-12T17:36:42', '2005-07-18T23:33:42', '2'), - ('263', '435', '2006-02-16T02:30:53', '2005-07-27T17:18:35', '2005-08-02T11:18:35', '1'), - ('263', '3303', '2006-02-16T02:30:53', '2005-05-26T16:08:05', '2005-05-27T10:55:05', '2'), - ('263', '1878', '2006-02-16T02:30:53', '2005-08-17T21:04:35', '2005-08-25T00:17:35', '1'), - ('263', '994', '2006-02-16T02:30:53', '2005-07-28T04:03:17', '2005-07-29T22:16:17', '2'), - ('263', '1166', '2006-02-16T02:30:53', '2005-07-28T08:46:14', '2005-08-04T06:13:14', '1'), - ('263', '1053', '2006-02-16T02:30:53', '2005-07-12T01:59:20', '2005-07-12T22:22:20', '2'), - ('263', '2954', '2006-02-16T02:30:53', '2005-07-06T03:47:05', '2005-07-08T02:26:05', '1'), - ('263', '1993', '2006-02-16T02:30:53', '2005-08-01T10:03:20', '2005-08-10T06:52:20', '1'), - ('263', '2610', '2006-02-16T02:30:53', '2005-08-21T08:33:07', '2005-08-26T14:16:07', '1'), - ('263', '4190', '2006-02-16T02:30:53', '2005-08-01T20:59:52', '2005-08-04T19:31:52', '2'), - ('263', '705', '2006-02-16T02:30:53', '2005-08-02T17:02:06', '2005-08-08T21:12:06', '1'), - ('263', '310', '2006-02-16T02:30:53', '2005-07-27T12:30:47', '2005-08-01T12:45:47', '1'), - ('263', '2543', '2006-02-16T02:30:53', '2005-08-18T10:35:13', '2005-08-26T08:20:13', '2'), - ('263', '3975', '2006-02-16T02:30:53', '2005-06-21T03:47:19', '2005-06-28T01:24:19', '2'), - ('263', '873', '2006-02-16T02:30:53', '2005-07-08T10:38:27', '2005-07-11T06:29:27', '2'), - ('263', '1834', '2006-02-16T02:30:53', '2005-07-11T21:40:23', '2005-07-13T23:16:23', '1'), - ('263', '4276', '2006-02-16T02:30:53', '2005-06-17T20:54:36', '2005-06-27T02:16:36', '1'), - ('263', '3553', '2006-02-16T02:30:53', '2005-08-22T20:20:30', '2005-08-25T01:26:30', '2'), - ('263', '2121', '2006-02-16T02:30:53', '2005-08-19T04:32:15', '2005-08-24T05:56:15', '2'), - ('263', '2034', '2006-02-16T02:30:53', '2005-07-06T13:23:34', '2005-07-08T17:23:34', '2'), - ('263', '1283', '2006-02-16T02:30:53', '2005-05-25T16:34:24', '2005-05-28T12:13:24', '2'), - ('263', '1937', '2006-02-16T02:30:53', '2005-08-21T12:13:10', '2005-08-30T08:46:10', '1'), - ('263', '654', '2006-02-16T02:30:53', '2005-07-09T13:50:11', '2005-07-13T09:07:11', '1'), - ('263', '1219', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('263', '990', '2006-02-16T02:30:53', '2005-07-09T07:25:28', '2005-07-12T12:34:28', '1'), - ('263', '1917', '2006-02-16T02:30:53', '2005-07-08T08:49:54', '2005-07-11T13:12:54', '2'), - ('263', '1702', '2006-02-16T02:30:53', '2005-08-23T18:07:31', '2005-09-01T22:27:31', '1'), - ('371', '3132', '2006-02-16T02:30:53', '2005-08-23T13:48:34', '2005-08-27T15:59:34', '1'), - ('371', '712', '2006-02-16T02:30:53', '2005-05-29T21:49:41', '2005-06-04T20:27:41', '2'), - ('371', '102', '2006-02-16T02:30:53', '2005-07-07T06:52:23', '2005-07-14T06:12:23', '2'), - ('371', '2753', '2006-02-16T02:30:53', '2005-08-19T14:28:48', '2005-08-23T12:53:48', '2'), - ('371', '1982', '2006-02-16T02:30:53', '2005-06-20T22:31:54', '2005-06-25T02:58:54', '1'), - ('371', '4536', '2006-02-16T02:30:53', '2005-06-16T03:31:39', '2005-06-25T04:04:39', '1'), - ('371', '3592', '2006-02-16T02:30:53', '2005-07-30T05:10:26', '2005-07-31T08:13:26', '1'), - ('371', '2402', '2006-02-16T02:30:53', '2005-07-12T01:13:44', '2005-07-17T04:51:44', '2'), - ('371', '625', '2006-02-16T02:30:53', '2005-07-27T16:31:40', '2005-07-31T11:56:40', '2'), - ('371', '2429', '2006-02-16T02:30:53', '2005-08-21T10:02:37', '2005-08-26T08:20:37', '1'), - ('371', '2165', '2006-02-16T02:30:53', '2005-08-19T08:27:23', '2005-08-24T03:46:23', '1'), - ('371', '1872', '2006-02-16T02:30:53', '2005-08-18T09:12:52', '2005-08-27T10:44:52', '2'), - ('371', '910', '2006-02-16T02:30:53', '2005-05-27T10:18:20', '2005-06-02T09:21:20', '2'), - ('371', '1258', '2006-02-16T02:30:53', '2005-07-28T20:12:17', '2005-08-01T15:21:17', '2'), - ('371', '552', '2006-02-16T02:30:53', '2005-08-02T07:38:44', '2005-08-11T06:30:44', '1'), - ('371', '3055', '2006-02-16T02:30:53', '2005-07-30T09:20:59', '2005-08-07T08:47:59', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['829', '5171', '12584', '13143', '1218', '13953', '286', '2837', '1212', '6000', '3396', '9635', '6922', '15824', '5614', '381', '1675', '4612', '26', '5543', '1873', '5281', '8128', '7550', '2374', '14781', '6020', '5814', '14228', '3345', '16000', '5770', '14105', '8789', '272', '8783', '199', '7982', '8574', '8293', '15704', '6739', '4614', '8668', '8956', '7160', '5358', '14904', '12417', '792', '6743', '1877', '10246', '9842', '1760', '5449', '2392', '11928', '3363', '11834', '13849', '15397', '2072', '9552', '542', '465', '13245', '12', '1988', '12327', '6515', '5122', '9869', '13506', '13669', '2815', '3038', '1699', '11740', '12531', '6658', '4510', '9636', '6115', '1960', '10852', '7927', '11661', '1480', '1310', '12021', '2512', '4038', '787', '3420', '9673', '5552', '9908', '13816', '10794']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('371', '1684', '2006-02-16T02:30:53', '2005-05-29T22:16:42', '2005-06-06T01:38:42', '1'), - ('371', '2099', '2006-02-16T02:30:53', '2005-07-09T09:26:55', '2005-07-10T10:34:55', '1'), - ('371', '4487', '2006-02-16T02:30:53', '2005-08-18T15:51:36', '2005-08-25T19:21:36', '1'), - ('371', '1655', '2006-02-16T02:30:53', '2005-08-19T12:44:38', '2005-08-25T10:59:38', '2'), - ('371', '239', '2006-02-16T02:30:53', '2005-06-15T03:24:44', '2005-06-21T22:45:44', '2'), - ('371', '1818', '2006-02-16T02:30:53', '2005-08-20T18:00:37', '2005-08-28T14:52:37', '1'), - ('371', '314', '2006-02-16T02:30:53', '2005-05-26T19:44:51', '2005-06-04T18:00:51', '2'), - ('371', '417', '2006-02-16T02:30:53', '2005-06-19T22:03:50', '2005-06-20T21:24:50', '1'), - ('371', '3611', '2006-02-16T02:30:53', '2005-06-15T03:03:33', '2005-06-17T06:31:33', '1'), - ('371', '1986', '2006-02-16T02:30:53', '2005-07-11T01:23:06', '2005-07-12T04:39:06', '2'), - ('371', '2744', '2006-02-16T02:30:53', '2005-06-21T15:23:08', '2005-06-23T10:25:08', '1'), - ('371', '1687', '2006-02-16T02:30:53', '2005-07-31T05:12:27', '2005-08-02T00:24:27', '2'), - ('371', '1114', '2006-02-16T02:30:53', '2005-07-12T22:39:48', '2005-07-14T18:35:48', '1'), - ('371', '2933', '2006-02-16T02:30:53', '2005-08-23T15:09:17', '2005-08-28T15:14:17', '2'), - ('371', '133', '2006-02-16T02:30:53', '2005-07-10T05:16:56', '2005-07-13T02:03:56', '1'), - ('371', '2748', '2006-02-16T02:30:53', '2005-05-27T09:43:25', '2005-05-31T12:00:25', '1'), - ('371', '3048', '2006-02-16T02:30:53', '2005-06-16T11:04:47', '2005-06-24T06:56:47', '2'), - ('371', '82', '2006-02-16T02:30:53', '2005-07-08T07:40:44', '2005-07-12T03:48:44', '1'), - ('371', '4371', '2006-02-16T02:30:53', '2005-05-25T03:36:50', '2005-05-31T00:34:50', '1'), - ('71', '1496', '2006-02-16T02:30:53', '2005-07-10T02:48:03', '2005-07-17T05:49:03', '2'), - ('71', '2933', '2006-02-16T02:30:53', '2005-06-17T02:38:28', '2005-06-23T04:39:28', '1'), - ('71', '1966', '2006-02-16T02:30:53', '2005-07-09T14:55:07', '2005-07-13T15:24:07', '2'), - ('71', '2872', '2006-02-16T02:30:53', '2005-07-28T19:46:06', '2005-08-06T16:10:06', '2'), - ('71', '4488', '2006-02-16T02:30:53', '2005-07-27T21:55:07', '2005-07-28T23:34:07', '2'), - ('71', '2634', '2006-02-16T02:30:53', '2005-06-18T14:44:06', '2005-06-22T17:14:06', '1'), - ('71', '3458', '2006-02-16T02:30:53', '2005-08-22T00:15:12', '2005-08-29T21:02:12', '1'), - ('71', '1974', '2006-02-16T02:30:53', '2005-07-11T02:08:55', '2005-07-16T22:07:55', '1'), - ('71', '2537', '2006-02-16T02:30:53', '2005-07-10T15:46:50', '2005-07-13T15:28:50', '2'), - ('71', '2016', '2006-02-16T02:30:53', '2005-08-21T04:57:08', '2005-08-25T00:06:08', '2'), - ('71', '4442', '2006-02-16T02:30:53', '2005-06-21T11:05:07', '2005-06-26T15:14:07', '2'), - ('71', '282', '2006-02-16T02:30:53', '2005-08-23T20:44:36', '2005-08-25T02:29:36', '1'), - ('71', '914', '2006-02-16T02:30:53', '2005-07-10T13:21:28', '2005-07-11T08:59:28', '2'), - ('71', '1111', '2006-02-16T02:30:53', '2005-08-21T00:44:34', '2005-08-29T19:00:34', '1'), - ('71', '3062', '2006-02-16T02:30:53', '2005-07-29T20:47:27', '2005-08-05T18:36:27', '1'), - ('71', '971', '2006-02-16T02:30:53', '2005-05-26T16:27:11', '2005-06-03T13:10:11', '2'), - ('71', '2316', '2006-02-16T02:30:53', '2005-07-29T20:31:28', '2005-08-02T19:33:28', '2'), - ('71', '2135', '2006-02-16T02:30:53', '2005-05-26T07:11:58', '2005-05-28T09:06:58', '1'), - ('71', '668', '2006-02-16T02:30:53', '2005-07-28T14:19:59', '2005-07-29T14:09:59', '2'), - ('71', '2949', '2006-02-16T02:30:53', '2005-07-29T11:51:53', '2005-08-03T05:59:53', '2'), - ('71', '831', '2006-02-16T02:30:53', '2005-07-29T02:30:50', '2005-08-04T03:09:50', '2'), - ('71', '738', '2006-02-16T02:30:53', '2005-08-23T10:25:45', '2005-08-29T16:06:45', '2'), - ('71', '1221', '2006-02-16T02:30:53', '2005-07-12T14:22:08', '2005-07-18T16:57:08', '2'), - ('71', '2579', '2006-02-16T02:30:53', '2005-07-08T07:45:17', '2005-07-12T02:10:17', '2'), - ('71', '4531', '2006-02-16T02:30:53', '2005-07-29T15:41:31', '2005-08-01T16:20:31', '2'), - ('71', '2129', '2006-02-16T02:30:53', '2005-07-30T03:32:29', '2005-08-01T03:08:29', '2'), - ('71', '3905', '2006-02-16T02:30:53', '2005-07-27T07:26:06', '2005-07-31T04:54:06', '2'), - ('71', '3764', '2006-02-16T02:30:53', '2005-07-09T18:09:21', '2005-07-14T23:59:21', '2'), - ('71', '722', '2006-02-16T02:30:53', '2005-08-22T04:32:01', '2005-08-29T05:21:01', '1'), - ('71', '3500', '2006-02-16T02:30:53', '2005-08-18T09:57:00', '2005-08-19T08:56:00', '1'), - ('261', '2841', '2006-02-16T02:30:53', '2005-05-29T16:32:10', '2005-05-31T18:01:10', '1'), - ('261', '158', '2006-02-16T02:30:53', '2005-07-12T14:29:25', '2005-07-13T13:13:25', '1'), - ('261', '3404', '2006-02-16T02:30:53', '2005-06-17T02:54:16', '2005-06-25T21:51:16', '2'), - ('261', '3598', '2006-02-16T02:30:53', '2005-08-01T02:29:50', '2005-08-09T01:17:50', '2'), - ('261', '2896', '2006-02-16T02:30:53', '2005-07-31T12:24:58', '2005-08-02T11:01:58', '2'), - ('261', '3929', '2006-02-16T02:30:53', '2005-06-16T17:48:37', '2005-06-18T16:01:37', '2'), - ('261', '921', '2006-02-16T02:30:53', '2005-07-09T22:12:01', '2005-07-18T01:18:01', '2'), - ('261', '2213', '2006-02-16T02:30:53', '2005-06-18T15:34:18', '2005-06-19T16:22:18', '1'), - ('261', '79', '2006-02-16T02:30:53', '2005-08-17T16:28:24', '2005-08-23T17:50:24', '2'), - ('261', '538', '2006-02-16T02:30:53', '2005-06-21T12:25:07', '2005-06-27T11:52:07', '2'), - ('261', '2407', '2006-02-16T02:30:53', '2005-08-17T13:00:40', '2005-08-22T12:50:40', '1'), - ('261', '3774', '2006-02-16T02:30:53', '2005-08-20T14:42:34', '2005-08-24T13:09:34', '2'), - ('261', '1482', '2006-02-16T02:30:53', '2005-08-22T23:08:46', '2005-08-25T20:58:46', '1'), - ('261', '86', '2006-02-16T02:30:53', '2005-06-17T16:33:32', '2005-06-23T13:22:32', '1'), - ('261', '3544', '2006-02-16T02:30:53', '2005-07-31T02:05:32', '2005-08-01T06:59:32', '1'), - ('261', '4444', '2006-02-16T02:30:53', '2005-05-28T06:42:13', '2005-06-03T09:05:13', '1'), - ('261', '20', '2006-02-16T02:30:53', '2005-05-27T20:44:36', '2005-06-02T02:43:36', '1'), - ('261', '1001', '2006-02-16T02:30:53', '2005-08-19T16:43:41', '2005-08-20T21:17:41', '1'), - ('261', '1584', '2006-02-16T02:30:53', '2005-05-25T00:19:27', '2005-05-30T05:44:27', '2'), - ('261', '3054', '2006-02-16T02:30:53', '2005-06-17T10:42:34', '2005-06-25T11:47:34', '2'), - ('261', '2425', '2006-02-16T02:30:53', '2005-08-18T06:43:22', '2005-08-25T10:50:22', '2'), - ('261', '706', '2006-02-16T02:30:53', '2005-07-12T03:50:32', '2005-07-15T03:54:32', '2'), - ('261', '1423', '2006-02-16T02:30:53', '2005-07-09T07:19:35', '2005-07-16T03:04:35', '2'), - ('261', '783', '2006-02-16T02:30:53', '2005-07-31T13:21:54', '2005-08-07T09:09:54', '1'), - ('261', '1334', '2006-02-16T02:30:53', '2005-08-20T02:07:06', '2005-08-26T08:06:06', '1'), - ('261', '4504', '2006-02-16T02:30:53', '2005-08-20T08:26:32', '2005-08-27T08:10:32', '2'), - ('27', '3046', '2006-02-16T02:30:53', '2005-06-19T20:03:29', '2005-06-25T22:50:29', '2'), - ('27', '2919', '2006-02-16T02:30:53', '2005-06-20T12:28:59', '2005-06-25T07:48:59', '1'), - ('27', '4507', '2006-02-16T02:30:53', '2005-06-16T13:05:09', '2005-06-17T09:53:09', '2'), - ('27', '2441', '2006-02-16T02:30:53', '2005-08-17T08:48:31', '2005-08-24T07:47:31', '2'), - ('27', '2771', '2006-02-16T02:30:53', '2005-08-18T13:57:50', '2005-08-22T09:46:50', '2'), - ('27', '172', '2006-02-16T02:30:53', '2005-07-12T11:13:21', '2005-07-17T09:10:21', '2'), - ('27', '1085', '2006-02-16T02:30:53', '2005-07-08T02:34:51', '2005-07-17T06:03:51', '2'), - ('27', '1725', '2006-02-16T02:30:53', '2005-07-31T05:12:59', '2005-08-09T07:31:59', '2'), - ('27', '3415', '2006-02-16T02:30:53', '2005-07-11T07:36:50', '2005-07-13T11:30:50', '1'), - ('27', '2202', '2006-02-16T02:30:53', '2005-06-17T08:59:57', '2005-06-23T14:38:57', '2'), - ('27', '3862', '2006-02-16T02:30:53', '2005-08-02T00:00:33', '2005-08-03T23:09:33', '1'), - ('27', '1263', '2006-02-16T02:30:53', '2005-07-28T12:13:42', '2005-08-05T12:02:42', '1'), - ('27', '1008', '2006-02-16T02:30:53', '2005-08-17T05:25:57', '2005-08-25T04:37:57', '1'), - ('27', '2598', '2006-02-16T02:30:53', '2005-06-15T21:17:17', '2005-06-23T22:01:17', '1'), - ('27', '2045', '2006-02-16T02:30:53', '2005-06-15T10:11:42', '2005-06-16T15:00:42', '1'), - ('27', '3977', '2006-02-16T02:30:53', '2005-08-17T19:52:43', '2005-08-23T21:49:43', '1'), - ('27', '4515', '2006-02-16T02:30:53', '2005-06-18T23:48:47', '2005-06-21T04:58:47', '2'), - ('27', '1264', '2006-02-16T02:30:53', '2005-07-07T02:52:53', '2005-07-11T22:32:53', '2'), - ('27', '3919', '2006-02-16T02:30:53', '2005-05-29T16:03:03', '2005-06-07T11:07:03', '2'), - ('27', '2523', '2006-02-16T02:30:53', '2005-06-21T17:22:36', '2005-06-28T12:34:36', '1'), - ('27', '339', '2006-02-16T02:30:53', '2005-07-31T06:34:55', '2005-08-09T09:15:55', '2'), - ('27', '2879', '2006-02-16T02:30:53', '2005-07-10T03:01:19', '2005-07-13T06:53:19', '2'), - ('27', '4408', '2006-02-16T02:30:53', '2005-07-31T14:39:52', '2005-08-09T09:46:52', '2'), - ('27', '273', '2006-02-16T02:30:53', '2005-08-20T13:13:56', '2005-08-25T09:46:56', '1'), - ('27', '889', '2006-02-16T02:30:53', '2005-08-01T21:51:15', '2005-08-10T18:51:15', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['9244', '5736', '11234', '12461', '15048', '6562', '10221', '13329', '6202', '13467', '12748', '257', '6944', '8611', '7206', '11663', '3667', '15014', '4325', '12536', '1472', '9397', '3609', '11976', '3161', '11739', '11512', '12780', '10758', '11066', '6311', '12142', '9966', '9480', '7094', '7615', '10010', '5120', '15068', '9327', '13299', '11378', '2515', '10494', '7556', '15409', '2733', '10453', '3848', '1527', '5356', '13570', '14399', '13787', '14809', '15319', '15474', '14503', '10757', '10719', '6555', '9613', '1927', '4150', '5729', '7042', '7646', '11979', '13758', '5943', '3442', '13268', '13154', '8562', '7475', '14600', '12176', '5706', '9061', '13683', '1420', '1681', '1235', '4547', '11889', '4185', '1603', '4393', '5087', '5136', '15970', '14471', '3389', '1270', '3310', '3684', '7986', '3030', '15856', '1562']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('27', '3640', '2006-02-16T02:30:53', '2005-07-30T14:06:53', '2005-08-03T19:46:53', '1'), - ('27', '1172', '2006-02-16T02:30:53', '2005-07-10T11:45:48', '2005-07-13T16:40:48', '1'), - ('27', '1020', '2006-02-16T02:30:53', '2005-08-02T13:12:17', '2005-08-05T17:37:17', '1'), - ('27', '1569', '2006-02-16T02:30:53', '2005-08-18T11:28:14', '2005-08-21T09:47:14', '1'), - ('27', '2895', '2006-02-16T02:30:53', '2005-08-22T10:00:04', '2005-08-26T08:26:04', '1'), - ('27', '3969', '2006-02-16T02:30:53', '2005-07-12T05:26:26', '2005-07-16T05:10:26', '2'), - ('373', '3051', '2006-02-16T02:30:53', '2005-08-01T01:16:50', '2005-08-03T05:35:50', '2'), - ('373', '3136', '2006-02-16T02:30:53', '2005-08-19T19:56:55', '2005-08-25T01:19:55', '2'), - ('373', '1424', '2006-02-16T02:30:53', '2005-07-11T12:24:25', '2005-07-18T08:13:25', '1'), - ('373', '696', '2006-02-16T02:30:53', '2005-08-20T00:56:44', '2005-08-20T20:16:44', '1'), - ('373', '3249', '2006-02-16T02:30:53', '2005-08-18T22:29:05', '2005-08-24T18:25:05', '2'), - ('373', '2570', '2006-02-16T02:30:53', '2005-05-26T15:27:05', '2005-05-29T16:25:05', '2'), - ('373', '1168', '2006-02-16T02:30:53', '2005-07-26T23:34:02', '2005-08-05T01:27:02', '1'), - ('373', '610', '2006-02-16T02:30:53', '2005-07-29T13:26:21', '2005-08-07T18:20:21', '2'), - ('373', '3752', '2006-02-16T02:30:53', '2005-07-27T09:07:05', '2005-07-31T03:13:05', '2'), - ('373', '3798', '2006-02-16T02:30:53', '2005-08-17T05:30:19', '2005-08-25T08:14:19', '1'), - ('373', '447', '2006-02-16T02:30:53', '2005-07-06T08:36:34', '2005-07-15T04:25:34', '2'), - ('373', '3678', '2006-02-16T02:30:53', '2005-08-22T08:43:11', '2005-08-31T02:55:11', '1'), - ('373', '3728', '2006-02-16T02:30:53', '2005-07-07T17:59:24', '2005-07-16T17:10:24', '2'), - ('373', '2343', '2006-02-16T02:30:53', '2005-08-18T14:06:06', '2005-08-25T14:21:06', '1'), - ('373', '4233', '2006-02-16T02:30:53', '2005-06-15T20:54:55', '2005-06-24T21:52:55', '2'), - ('373', '1550', '2006-02-16T02:30:53', '2005-07-30T20:07:29', '2005-08-05T00:36:29', '1'), - ('373', '1064', '2006-02-16T02:30:53', '2005-07-06T05:36:22', '2005-07-10T05:55:22', '1'), - ('373', '498', '2006-02-16T02:30:53', '2005-08-17T17:59:19', '2005-08-23T14:51:19', '2'), - ('373', '1326', '2006-02-16T02:30:53', '2005-06-20T21:21:01', '2005-06-21T18:22:01', '2'), - ('373', '4568', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('373', '1248', '2006-02-16T02:30:53', '2005-08-16T23:51:06', '2005-08-26T02:06:06', '2'), - ('373', '54', '2006-02-16T02:30:53', '2005-08-18T23:48:16', '2005-08-20T18:13:16', '2'), - ('373', '191', '2006-02-16T02:30:53', '2005-08-01T20:22:51', '2005-08-10T16:11:51', '1'), - ('373', '4213', '2006-02-16T02:30:53', '2005-08-02T06:58:32', '2005-08-10T01:27:32', '2'), - ('373', '1789', '2006-02-16T02:30:53', '2005-07-11T18:18:52', '2005-07-16T17:52:52', '2'), - ('373', '3748', '2006-02-16T02:30:53', '2005-08-18T00:04:12', '2005-08-24T01:24:12', '2'), - ('373', '4137', '2006-02-16T02:30:53', '2005-07-31T16:26:46', '2005-08-03T14:29:46', '1'), - ('373', '597', '2006-02-16T02:30:53', '2005-07-30T23:26:03', '2005-08-04T21:18:03', '2'), - ('373', '867', '2006-02-16T02:30:53', '2005-07-27T04:47:33', '2005-07-31T04:07:33', '2'), - ('373', '3884', '2006-02-16T02:30:53', '2005-07-28T00:15:24', '2005-07-31T02:00:24', '1'), - ('373', '2655', '2006-02-16T02:30:53', '2005-07-31T18:01:36', '2005-08-07T20:27:36', '2'), - ('373', '4431', '2006-02-16T02:30:53', '2005-07-09T07:14:23', '2005-07-14T04:00:23', '2'), - ('373', '3268', '2006-02-16T02:30:53', '2005-08-22T10:50:13', '2005-08-26T05:04:13', '2'), - ('373', '345', '2006-02-16T02:30:53', '2005-07-30T17:31:03', '2005-08-08T19:16:03', '1'), - ('373', '4385', '2006-02-16T02:30:53', '2005-08-19T18:46:33', '2005-08-22T20:45:33', '1'), - ('188', '3824', '2006-02-16T02:30:53', '2005-08-02T18:16:52', '2005-08-03T14:25:52', '1'), - ('188', '3213', '2006-02-16T02:30:53', '2005-06-18T23:57:31', '2005-06-22T05:31:31', '2'), - ('188', '847', '2006-02-16T02:30:53', '2005-08-01T10:45:21', '2005-08-02T12:34:21', '1'), - ('188', '794', '2006-02-16T02:30:53', '2005-07-27T22:17:17', '2005-07-28T19:17:17', '2'), - ('188', '560', '2006-02-16T02:30:53', '2005-08-22T23:26:32', '2005-08-24T22:44:32', '1'), - ('188', '1535', '2006-02-16T02:30:53', '2005-06-19T15:21:53', '2005-06-23T11:58:53', '2'), - ('188', '1531', '2006-02-16T02:30:53', '2005-08-01T09:13:27', '2005-08-08T11:34:27', '2'), - ('188', '2906', '2006-02-16T02:30:53', '2005-07-06T16:47:32', '2005-07-14T15:00:32', '1'), - ('188', '296', '2006-02-16T02:30:53', '2005-06-16T00:31:40', '2005-06-21T05:20:40', '1'), - ('188', '2905', '2006-02-16T02:30:53', '2005-07-09T18:08:28', '2005-07-14T14:11:28', '2'), - ('188', '2808', '2006-02-16T02:30:53', '2005-08-20T05:04:57', '2005-08-24T06:19:57', '2'), - ('188', '3582', '2006-02-16T02:30:53', '2005-08-21T10:33:23', '2005-08-27T08:00:23', '1'), - ('188', '253', '2006-02-16T02:30:53', '2005-08-20T12:15:23', '2005-08-27T06:24:23', '2'), - ('188', '1077', '2006-02-16T02:30:53', '2005-08-22T01:00:42', '2005-08-29T19:55:42', '1'), - ('188', '3041', '2006-02-16T02:30:53', '2005-08-22T20:17:17', '2005-08-25T01:06:17', '2'), - ('188', '3015', '2006-02-16T02:30:53', '2005-08-23T01:39:10', '2005-08-23T21:46:10', '2'), - ('188', '2144', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('188', '102', '2006-02-16T02:30:53', '2005-08-01T20:22:44', '2005-08-04T19:48:44', '2'), - ('188', '3861', '2006-02-16T02:30:53', '2005-08-01T19:00:28', '2005-08-07T17:04:28', '1'), - ('188', '1282', '2006-02-16T02:30:53', '2005-07-12T05:08:16', '2005-07-14T04:09:16', '1'), - ('188', '3251', '2006-02-16T02:30:53', '2005-07-31T03:58:53', '2005-08-02T00:10:53', '1'), - ('188', '3304', '2006-02-16T02:30:53', '2005-06-17T06:48:19', '2005-06-21T03:23:19', '1'), - ('188', '4424', '2006-02-16T02:30:53', '2005-07-07T08:43:22', '2005-07-08T05:21:22', '2'), - ('188', '4137', '2006-02-16T02:30:53', '2005-07-10T11:27:25', '2005-07-15T06:13:25', '2'), - ('188', '399', '2006-02-16T02:30:53', '2005-07-27T03:20:18', '2005-08-01T02:23:18', '1'), - ('255', '1615', '2006-02-16T02:30:53', '2005-07-28T01:31:45', '2005-07-31T07:16:45', '1'), - ('255', '568', '2006-02-16T02:30:53', '2005-08-17T18:07:13', '2005-08-19T23:12:13', '1'), - ('255', '864', '2006-02-16T02:30:53', '2005-08-20T11:21:26', '2005-08-29T14:37:26', '2'), - ('255', '3019', '2006-02-16T02:30:53', '2005-07-10T22:48:13', '2005-07-16T01:33:13', '1'), - ('255', '1896', '2006-02-16T02:30:53', '2005-06-21T20:06:51', '2005-06-25T17:35:51', '2'), - ('255', '1166', '2006-02-16T02:30:53', '2005-08-19T17:33:50', '2005-08-25T17:15:50', '2'), - ('255', '2465', '2006-02-16T02:30:53', '2005-08-19T13:09:54', '2005-08-26T16:40:54', '1'), - ('255', '3595', '2006-02-16T02:30:53', '2005-07-29T11:32:13', '2005-07-30T08:23:13', '2'), - ('255', '1670', '2006-02-16T02:30:53', '2005-07-27T19:07:43', '2005-08-04T22:12:43', '2'), - ('255', '3532', '2006-02-16T02:30:53', '2005-08-21T17:45:21', '2005-08-28T19:03:21', '1'), - ('255', '3873', '2006-02-16T02:30:53', '2005-08-18T01:10:33', '2005-08-24T02:45:33', '2'), - ('255', '3701', '2006-02-16T02:30:53', '2005-07-10T10:21:46', '2005-07-16T04:37:46', '2'), - ('255', '1933', '2006-02-16T02:30:53', '2005-07-30T07:21:52', '2005-08-08T10:52:52', '1'), - ('255', '1729', '2006-02-16T02:30:53', '2005-08-20T08:54:55', '2005-08-24T14:10:55', '2'), - ('255', '4149', '2006-02-16T02:30:53', '2005-06-15T17:56:14', '2005-06-24T15:45:14', '2'), - ('255', '530', '2006-02-16T02:30:53', '2005-06-16T11:38:17', '2005-06-19T13:05:17', '1'), - ('255', '1000', '2006-02-16T02:30:53', '2005-06-15T04:31:28', '2005-06-22T10:08:28', '1'), - ('255', '3386', '2006-02-16T02:30:53', '2005-07-08T04:20:19', '2005-07-09T00:28:19', '2'), - ('395', '293', '2006-02-16T02:30:53', '2005-08-17T15:08:27', '2005-08-18T17:10:27', '1'), - ('395', '2425', '2006-02-16T02:30:53', '2005-07-07T10:31:05', '2005-07-13T05:30:05', '2'), - ('395', '3308', '2006-02-16T02:30:53', '2005-06-16T06:14:03', '2005-06-17T06:04:03', '2'), - ('395', '4034', '2006-02-16T02:30:53', '2005-07-07T21:12:36', '2005-07-09T22:41:36', '2'), - ('395', '3716', '2006-02-16T02:30:53', '2005-07-09T05:44:28', '2005-07-10T02:25:28', '2'), - ('395', '3498', '2006-02-16T02:30:53', '2005-07-09T07:55:01', '2005-07-11T05:26:01', '2'), - ('395', '4509', '2006-02-16T02:30:53', '2005-08-23T19:54:24', '2005-08-24T18:07:24', '1'), - ('395', '1254', '2006-02-16T02:30:53', '2005-08-21T13:10:40', '2005-08-26T16:49:40', '1'), - ('395', '727', '2006-02-16T02:30:53', '2005-06-21T14:37:55', '2005-06-28T18:13:55', '1'), - ('395', '62', '2006-02-16T02:30:53', '2005-06-15T07:30:22', '2005-06-18T11:31:22', '2'), - ('395', '1717', '2006-02-16T02:30:53', '2005-06-21T08:04:51', '2005-06-22T04:20:51', '2'), - ('395', '3261', '2006-02-16T02:30:53', '2005-07-06T09:29:22', '2005-07-12T08:19:22', '1'), - ('395', '1283', '2006-02-16T02:30:53', '2005-07-28T14:30:13', '2005-08-05T09:35:13', '1'), - ('395', '1543', '2006-02-16T02:30:53', '2005-06-20T11:51:59', '2005-06-24T10:51:59', '1'), - ('395', '3379', '2006-02-16T02:30:53', '2005-08-23T15:59:12', '2005-08-25T15:36:12', '1'), - ('395', '595', '2006-02-16T02:30:53', '2005-06-16T02:46:27', '2005-06-23T00:56:27', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['15698', '14720', '7740', '9691', '12766', '11053', '6667', '6634', '4149', '10261', '10046', '3169', '1785', '5681', '13136', '1029', '7383', '905', '15138', '9615', '8261', '3000', '1136', '5641', '763', '10485', '5928', '5290', '16015', '8619', '9179', '14054', '1223', '10180', '794', '10165', '15388', '8089', '4291', '12076', '3095', '6802', '13244', '383', '13172', '12765', '10248', '14473', '2385', '5247', '3728', '7869', '15245', '4936', '11288', '7802', '5166', '11070', '15643', '1454', '8737', '3400', '15262', '3479', '9200', '8028', '4332', '3589', '3676', '9002', '10175', '5106', '5443', '15537', '14754', '10842', '3436', '5804', '6039', '12078', '3058', '3874', '11732', '15082', '2785', '4474', '9709', '925', '15133', '13148', '6200', '2469', '9466', '8954', '11281', '8106', '10595', '16030', '15889', '9789']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('395', '4465', '2006-02-16T02:30:53', '2005-08-23T10:11:40', '2005-08-28T08:50:40', '2'), - ('395', '3617', '2006-02-16T02:30:53', '2005-08-21T21:43:53', '2005-08-25T18:21:53', '1'), - ('395', '3613', '2006-02-16T02:30:53', '2005-07-28T05:23:36', '2005-08-01T02:20:36', '2'), - ('50', '2626', '2006-02-16T02:30:53', '2005-07-31T07:09:55', '2005-08-09T02:29:55', '1'), - ('50', '3737', '2006-02-16T02:30:53', '2005-08-18T23:25:20', '2005-08-27T04:43:20', '1'), - ('50', '2599', '2006-02-16T02:30:53', '2005-08-02T06:27:13', '2005-08-09T11:24:13', '2'), - ('50', '215', '2006-02-16T02:30:53', '2005-07-12T11:36:22', '2005-07-19T12:53:22', '1'), - ('50', '2943', '2006-02-16T02:30:53', '2005-07-12T09:37:18', '2005-07-13T09:28:18', '1'), - ('50', '3028', '2006-02-16T02:30:53', '2005-07-07T08:40:17', '2005-07-10T02:58:17', '2'), - ('50', '2346', '2006-02-16T02:30:53', '2005-08-01T02:58:27', '2005-08-01T21:55:27', '2'), - ('50', '4302', '2006-02-16T02:30:53', '2005-07-31T19:07:11', '2005-08-03T13:25:11', '1'), - ('50', '2437', '2006-02-16T02:30:53', '2005-06-20T21:55:54', '2005-06-25T19:45:54', '1'), - ('50', '3413', '2006-02-16T02:30:53', '2005-06-16T19:27:12', '2005-06-24T19:25:12', '1'), - ('50', '4176', '2006-02-16T02:30:53', '2005-07-10T08:48:39', '2005-07-18T07:17:39', '1'), - ('50', '2532', '2006-02-16T02:30:53', '2005-08-19T12:24:23', '2005-08-28T08:37:23', '2'), - ('50', '2082', '2006-02-16T02:30:53', '2005-05-31T03:52:02', '2005-06-06T08:10:02', '1'), - ('50', '3860', '2006-02-16T02:30:53', '2005-07-27T15:46:53', '2005-08-03T11:10:53', '1'), - ('50', '4372', '2006-02-16T02:30:53', '2005-05-30T10:25:00', '2005-06-06T06:23:00', '1'), - ('50', '2467', '2006-02-16T02:30:53', '2005-08-22T13:36:30', '2005-08-27T15:35:30', '1'), - ('50', '3370', '2006-02-16T02:30:53', '2005-07-31T03:59:56', '2005-08-02T00:46:56', '2'), - ('50', '1915', '2006-02-16T02:30:53', '2005-07-29T01:11:05', '2005-08-04T03:13:05', '2'), - ('50', '549', '2006-02-16T02:30:53', '2005-06-20T09:32:33', '2005-06-22T07:45:33', '1'), - ('50', '3963', '2006-02-16T02:30:53', '2005-05-31T19:19:36', '2005-06-09T16:04:36', '2'), - ('50', '3568', '2006-02-16T02:30:53', '2005-07-10T06:43:43', '2005-07-15T06:33:43', '1'), - ('50', '2022', '2006-02-16T02:30:53', '2005-05-29T11:32:15', '2005-05-31T17:31:15', '1'), - ('50', '29', '2006-02-16T02:30:53', '2005-08-01T10:20:34', '2005-08-09T09:20:34', '1'), - ('50', '4132', '2006-02-16T02:30:53', '2005-07-10T21:58:30', '2005-07-15T19:41:30', '1'), - ('50', '277', '2006-02-16T02:30:53', '2005-07-09T15:14:47', '2005-07-11T20:30:47', '2'), - ('50', '3113', '2006-02-16T02:30:53', '2005-08-23T21:25:03', '2005-08-24T20:05:03', '2'), - ('50', '2169', '2006-02-16T02:30:53', '2005-07-29T13:50:08', '2005-08-06T13:15:08', '1'), - ('50', '62', '2006-02-16T02:30:53', '2005-07-30T12:02:41', '2005-08-05T15:23:41', '2'), - ('50', '338', '2006-02-16T02:30:53', '2005-08-20T22:17:01', '2005-08-21T21:34:01', '1'), - ('50', '1299', '2006-02-16T02:30:53', '2005-06-15T03:38:53', '2005-06-20T01:00:53', '2'), - ('50', '757', '2006-02-16T02:30:53', '2005-07-31T23:57:43', '2005-08-09T04:04:43', '2'), - ('50', '1995', '2006-02-16T02:30:53', '2005-05-29T16:44:11', '2005-06-05T16:11:11', '1'), - ('50', '3476', '2006-02-16T02:30:53', '2005-07-31T23:21:23', '2005-08-06T18:06:23', '1'), - ('50', '3995', '2006-02-16T02:30:53', '2005-08-22T22:49:23', '2005-09-01T03:50:23', '2'), - ('50', '1414', '2006-02-16T02:30:53', '2005-07-28T18:26:47', '2005-08-03T21:28:47', '1'), - ('298', '2074', '2006-02-16T02:30:53', '2005-07-07T15:47:47', '2005-07-10T11:45:47', '1'), - ('298', '4278', '2006-02-16T02:30:53', '2005-08-17T21:58:19', '2005-08-20T22:10:19', '1'), - ('298', '3937', '2006-02-16T02:30:53', '2005-06-20T16:16:53', '2005-06-22T10:35:53', '2'), - ('298', '2942', '2006-02-16T02:30:53', '2005-07-12T17:14:17', '2005-07-17T11:54:17', '2'), - ('298', '3246', '2006-02-16T02:30:53', '2005-08-19T16:43:04', '2005-08-22T15:21:04', '2'), - ('298', '955', '2006-02-16T02:30:53', '2005-05-27T10:12:20', '2005-06-03T10:37:20', '1'), - ('298', '1301', '2006-02-16T02:30:53', '2005-08-19T13:49:07', '2005-08-20T19:39:07', '2'), - ('298', '2244', '2006-02-16T02:30:53', '2005-08-18T23:21:50', '2005-08-28T04:42:50', '2'), - ('298', '2146', '2006-02-16T02:30:53', '2005-08-01T02:35:28', '2005-08-08T02:24:28', '2'), - ('298', '2747', '2006-02-16T02:30:53', '2005-08-21T13:19:03', '2005-08-23T15:12:03', '1'), - ('298', '1641', '2006-02-16T02:30:53', '2005-06-18T15:22:40', '2005-06-26T10:02:40', '1'), - ('298', '1186', '2006-02-16T02:30:53', '2005-07-09T13:26:28', '2005-07-12T14:00:28', '2'), - ('298', '1798', '2006-02-16T02:30:53', '2005-07-06T11:29:00', '2005-07-11T06:28:00', '1'), - ('298', '3005', '2006-02-16T02:30:53', '2005-07-28T10:13:15', '2005-08-03T12:58:15', '1'), - ('298', '2545', '2006-02-16T02:30:53', '2005-08-22T17:49:35', '2005-08-26T18:25:35', '2'), - ('298', '2033', '2006-02-16T02:30:53', '2005-07-08T22:24:50', '2005-07-15T03:14:50', '2'), - ('298', '1478', '2006-02-16T02:30:53', '2005-08-02T14:54:08', '2005-08-11T12:22:08', '1'), - ('298', '1108', '2006-02-16T02:30:53', '2005-07-28T07:51:57', '2005-07-29T09:32:57', '1'), - ('298', '2771', '2006-02-16T02:30:53', '2005-07-09T09:15:48', '2005-07-16T06:04:48', '1'), - ('298', '4020', '2006-02-16T02:30:53', '2005-08-02T07:10:39', '2005-08-03T07:43:39', '1'), - ('298', '103', '2006-02-16T02:30:53', '2005-08-23T08:13:26', '2005-08-25T05:18:26', '2'), - ('298', '102', '2006-02-16T02:30:53', '2005-06-15T19:49:41', '2005-06-17T15:17:41', '2'), - ('298', '4154', '2006-02-16T02:30:53', '2005-07-29T18:32:13', '2005-08-05T21:07:13', '2'), - ('298', '1697', '2006-02-16T02:30:53', '2005-06-21T15:50:30', '2005-06-25T18:07:30', '1'), - ('298', '2534', '2006-02-16T02:30:53', '2005-08-22T18:25:21', '2005-08-28T22:19:21', '1'), - ('298', '2277', '2006-02-16T02:30:53', '2005-07-05T23:08:53', '2005-07-11T21:42:53', '1'), - ('137', '3277', '2006-02-16T02:30:53', '2005-07-30T12:39:52', '2005-08-08T09:43:52', '2'), - ('137', '2715', '2006-02-16T02:30:53', '2005-07-28T16:11:15', '2005-08-05T15:11:15', '1'), - ('137', '1714', '2006-02-16T02:30:53', '2005-07-07T18:25:26', '2005-07-16T15:05:26', '1'), - ('137', '3740', '2006-02-16T02:30:53', '2005-07-06T04:30:18', '2005-07-10T09:18:18', '1'), - ('137', '1967', '2006-02-16T02:30:53', '2005-07-06T09:10:37', '2005-07-14T08:24:37', '1'), - ('137', '1936', '2006-02-16T02:30:53', '2005-07-30T05:02:21', '2005-07-31T04:58:21', '1'), - ('137', '3672', '2006-02-16T02:30:53', '2005-07-31T23:40:11', '2005-08-09T02:22:11', '1'), - ('137', '110', '2006-02-16T02:30:53', '2005-07-09T06:40:24', '2005-07-13T10:28:24', '1'), - ('137', '2951', '2006-02-16T02:30:53', '2005-07-09T21:56:09', '2005-07-16T00:33:09', '2'), - ('137', '2958', '2006-02-16T02:30:53', '2005-08-23T04:00:30', '2005-08-24T01:45:30', '2'), - ('137', '2355', '2006-02-16T02:30:53', '2005-08-21T23:17:26', '2005-08-29T18:55:26', '2'), - ('137', '1300', '2006-02-16T02:30:53', '2005-08-01T23:41:24', '2005-08-11T03:48:24', '1'), - ('137', '2740', '2006-02-16T02:30:53', '2005-06-21T19:16:09', '2005-06-30T13:58:09', '2'), - ('137', '2168', '2006-02-16T02:30:53', '2005-07-10T15:06:31', '2005-07-14T11:00:31', '1'), - ('137', '1776', '2006-02-16T02:30:53', '2005-07-11T03:12:19', '2005-07-19T05:46:19', '1'), - ('137', '684', '2006-02-16T02:30:53', '2005-08-17T22:00:22', '2005-08-24T02:54:22', '2'), - ('137', '938', '2006-02-16T02:30:53', '2005-06-20T13:28:35', '2005-06-28T13:57:35', '2'), - ('137', '1870', '2006-02-16T02:30:53', '2005-07-06T18:06:12', '2005-07-12T16:55:12', '1'), - ('137', '460', '2006-02-16T02:30:53', '2005-08-17T08:29:46', '2005-08-23T14:21:46', '2'), - ('137', '2046', '2006-02-16T02:30:53', '2005-08-22T11:17:06', '2005-08-28T06:40:06', '1'), - ('137', '826', '2006-02-16T02:30:53', '2005-06-19T18:43:57', '2005-06-24T15:36:57', '2'), - ('137', '4474', '2006-02-16T02:30:53', '2005-07-08T00:26:56', '2005-07-12T23:07:56', '1'), - ('137', '2096', '2006-02-16T02:30:53', '2005-07-31T08:04:55', '2005-08-07T08:58:55', '1'), - ('137', '3203', '2006-02-16T02:30:53', '2005-05-30T12:13:52', '2005-06-02T14:41:52', '2'), - ('137', '3408', '2006-02-16T02:30:53', '2005-08-22T13:17:43', '2005-08-26T08:40:43', '1'), - ('137', '1762', '2006-02-16T02:30:53', '2005-08-19T12:55:30', '2005-08-21T11:01:30', '1'), - ('137', '3258', '2006-02-16T02:30:53', '2005-07-11T12:16:42', '2005-07-17T09:27:42', '2'), - ('137', '1993', '2006-02-16T02:30:53', '2005-06-18T20:24:23', '2005-06-27T15:39:23', '1'), - ('137', '2595', '2006-02-16T02:30:53', '2005-07-30T22:44:36', '2005-08-07T02:35:36', '2'), - ('137', '991', '2006-02-16T02:30:53', '2005-07-30T03:25:51', '2005-08-06T05:10:51', '2'), - ('137', '2210', '2006-02-16T02:30:53', '2005-08-02T14:35:01', '2005-08-07T17:28:01', '1'), - ('137', '963', '2006-02-16T02:30:53', '2005-07-28T19:02:46', '2005-07-30T20:48:46', '2'), - ('137', '966', '2006-02-16T02:30:53', '2005-08-01T14:16:28', '2005-08-03T10:37:28', '1'), - ('137', '4161', '2006-02-16T02:30:53', '2005-08-23T21:56:04', '2005-08-31T01:24:04', '2'), - ('137', '787', '2006-02-16T02:30:53', '2005-08-23T16:57:43', '2005-08-27T22:14:43', '1'), - ('137', '619', '2006-02-16T02:30:53', '2005-07-31T10:30:25', '2005-08-03T14:58:25', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['13776', '13472', '11057', '14728', '11909', '816', '2944', '4481', '12597', '8991', '5251', '12702', '4785', '11537', '12440', '1758', '15558', '11117', '6499', '12236', '4886', '4809', '15046', '10376', '4048', '11489', '4533', '12083', '3787', '12128', '5665', '10553', '12588', '13729', '6505', '15959', '3211', '7379', '11310', '9586', '7748', '15121', '5733', '7624', '8317', '6491', '10263', '1867', '14992', '4926', '9852', '665', '3130', '2829', '13074', '5487', '11723', '3382', '10605', '8728', '1318', '14344', '1778', '1520', '15030', '4624', '5931', '7473', '13806', '1849', '13059', '3938', '8661', '15938', '11305', '6493', '196', '13303', '14801', '13134', '7686', '13262', '5891', '4882', '6700', '2312', '12532', '567', '7051', '1976', '12454', '14472', '12166', '534', '4314', '15611', '9162', '8892', '1400', '9408']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('137', '2439', '2006-02-16T02:30:53', '2005-08-20T11:57:06', '2005-08-26T10:55:06', '1'), - ('137', '3074', '2006-02-16T02:30:53', '2005-08-20T01:03:31', '2005-08-28T02:54:31', '1'), - ('137', '3143', '2006-02-16T02:30:53', '2005-08-02T06:38:19', '2005-08-11T03:43:19', '1'), - ('474', '2671', '2006-02-16T02:30:53', '2005-08-21T22:15:36', '2005-08-25T17:14:36', '2'), - ('474', '871', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('474', '630', '2006-02-16T02:30:53', '2005-05-29T20:26:39', '2005-06-06T22:31:39', '2'), - ('474', '1550', '2006-02-16T02:30:53', '2005-06-20T05:43:42', '2005-06-29T09:40:42', '2'), - ('474', '1669', '2006-02-16T02:30:53', '2005-07-08T00:58:15', '2005-07-11T23:22:15', '2'), - ('474', '3804', '2006-02-16T02:30:53', '2005-08-18T16:34:02', '2005-08-25T17:30:02', '2'), - ('474', '4540', '2006-02-16T02:30:53', '2005-07-30T04:42:54', '2005-08-01T23:51:54', '1'), - ('474', '478', '2006-02-16T02:30:53', '2005-07-09T13:36:10', '2005-07-15T11:40:10', '1'), - ('474', '1884', '2006-02-16T02:30:53', '2005-08-18T20:30:33', '2005-08-27T01:22:33', '2'), - ('474', '58', '2006-02-16T02:30:53', '2005-07-08T16:10:19', '2005-07-11T18:52:19', '1'), - ('474', '190', '2006-02-16T02:30:53', '2005-08-17T00:41:08', '2005-08-19T00:25:08', '2'), - ('474', '2779', '2006-02-16T02:30:53', '2005-08-18T10:47:35', '2005-08-21T11:10:35', '2'), - ('474', '2654', '2006-02-16T02:30:53', '2005-06-16T17:39:39', '2005-06-25T13:06:39', '1'), - ('474', '638', '2006-02-16T02:30:53', '2005-08-23T04:52:22', '2005-09-01T02:26:22', '1'), - ('474', '1613', '2006-02-16T02:30:53', '2005-08-02T08:36:03', '2005-08-05T06:56:03', '2'), - ('474', '3165', '2006-02-16T02:30:53', '2005-07-12T03:11:18', '2005-07-21T07:50:18', '2'), - ('474', '1190', '2006-02-16T02:30:53', '2005-08-18T03:19:29', '2005-08-23T07:39:29', '2'), - ('474', '3393', '2006-02-16T02:30:53', '2005-07-08T19:53:22', '2005-07-09T17:05:22', '1'), - ('474', '4251', '2006-02-16T02:30:53', '2005-07-08T17:03:22', '2005-07-17T22:39:22', '1'), - ('474', '1536', '2006-02-16T02:30:53', '2005-08-22T09:54:54', '2005-08-26T07:34:54', '1'), - ('474', '4194', '2006-02-16T02:30:53', '2005-08-01T06:27:13', '2005-08-07T06:11:13', '2'), - ('474', '659', '2006-02-16T02:30:53', '2005-07-07T03:30:52', '2005-07-14T05:05:52', '2'), - ('474', '3001', '2006-02-16T02:30:53', '2005-08-02T22:35:28', '2005-08-04T00:29:28', '2'), - ('474', '1105', '2006-02-16T02:30:53', '2005-07-08T03:32:01', '2005-07-10T21:57:01', '1'), - ('474', '1985', '2006-02-16T02:30:53', '2005-08-17T22:13:37', '2005-08-19T19:01:37', '2'), - ('474', '288', '2006-02-16T02:30:53', '2005-07-06T14:02:01', '2005-07-09T19:09:01', '2'), - ('415', '2252', '2006-02-16T02:30:53', '2005-08-17T23:31:09', '2005-08-24T05:07:09', '2'), - ('415', '1175', '2006-02-16T02:30:53', '2005-07-10T08:10:08', '2005-07-11T05:22:08', '2'), - ('415', '2768', '2006-02-16T02:30:53', '2005-08-01T12:54:06', '2005-08-06T15:27:06', '1'), - ('415', '694', '2006-02-16T02:30:53', '2005-08-18T16:04:45', '2005-08-23T20:30:45', '1'), - ('415', '4108', '2006-02-16T02:30:53', '2005-08-20T10:17:08', '2005-08-28T15:35:08', '1'), - ('415', '3986', '2006-02-16T02:30:53', '2005-07-12T03:27:37', '2005-07-17T22:42:37', '2'), - ('415', '547', '2006-02-16T02:30:53', '2005-08-23T19:27:04', '2005-08-24T15:24:04', '1'), - ('415', '1150', '2006-02-16T02:30:53', '2005-06-21T01:01:29', '2005-06-23T04:05:29', '1'), - ('415', '424', '2006-02-16T02:30:53', '2005-07-27T15:36:43', '2005-07-30T16:37:43', '2'), - ('415', '3601', '2006-02-16T02:30:53', '2005-08-02T15:51:58', '2005-08-07T12:34:58', '1'), - ('415', '3987', '2006-02-16T02:30:53', '2005-07-31T03:07:16', '2005-08-04T00:39:16', '1'), - ('415', '3523', '2006-02-16T02:30:53', '2005-07-28T05:52:23', '2005-07-31T01:35:23', '2'), - ('415', '2981', '2006-02-16T02:30:53', '2005-08-22T12:46:37', '2005-08-25T17:42:37', '1'), - ('415', '3806', '2006-02-16T02:30:53', '2005-07-10T11:37:24', '2005-07-11T12:34:24', '2'), - ('415', '2756', '2006-02-16T02:30:53', '2005-07-28T00:37:44', '2005-07-30T21:26:44', '1'), - ('415', '3898', '2006-02-16T02:30:53', '2005-07-29T03:39:07', '2005-08-03T00:14:07', '1'), - ('415', '2803', '2006-02-16T02:30:53', '2005-07-12T02:28:31', '2005-07-21T00:38:31', '1'), - ('415', '2420', '2006-02-16T02:30:53', '2005-08-01T03:02:48', '2005-08-08T02:16:48', '2'), - ('415', '3537', '2006-02-16T02:30:53', '2005-06-17T02:01:37', '2005-06-25T04:52:37', '2'), - ('415', '4430', '2006-02-16T02:30:53', '2005-08-22T07:51:47', '2005-08-25T08:17:47', '2'), - ('415', '4155', '2006-02-16T02:30:53', '2005-07-08T22:01:48', '2005-07-18T03:27:48', '1'), - ('415', '4257', '2006-02-16T02:30:53', '2005-07-31T12:52:17', '2005-08-05T07:59:17', '2'), - ('415', '1012', '2006-02-16T02:30:53', '2005-05-28T21:38:39', '2005-05-29T21:37:39', '1'), - ('341', '2569', '2006-02-16T02:30:53', '2005-06-20T19:03:22', '2005-06-29T18:05:22', '2'), - ('341', '2047', '2006-02-16T02:30:53', '2005-06-19T21:11:30', '2005-06-24T18:10:30', '1'), - ('341', '3266', '2006-02-16T02:30:53', '2005-08-19T10:06:53', '2005-08-28T09:56:53', '2'), - ('341', '1144', '2006-02-16T02:30:53', '2005-07-10T00:01:50', '2005-07-10T20:43:50', '1'), - ('341', '1665', '2006-02-16T02:30:53', '2005-08-17T07:56:22', '2005-08-22T03:49:22', '1'), - ('341', '131', '2006-02-16T02:30:53', '2005-06-21T14:05:23', '2005-06-29T19:13:23', '2'), - ('341', '680', '2006-02-16T02:30:53', '2005-08-01T14:36:26', '2005-08-06T12:04:26', '2'), - ('341', '973', '2006-02-16T02:30:53', '2005-07-29T18:12:49', '2005-08-06T22:45:49', '1'), - ('341', '2760', '2006-02-16T02:30:53', '2005-06-15T10:34:26', '2005-06-20T16:20:26', '1'), - ('341', '1562', '2006-02-16T02:30:53', '2005-08-21T08:40:56', '2005-08-27T12:40:56', '1'), - ('341', '2512', '2006-02-16T02:30:53', '2005-06-16T18:54:48', '2005-06-22T16:08:48', '2'), - ('341', '3419', '2006-02-16T02:30:53', '2005-06-15T23:57:20', '2005-06-24T23:46:20', '1'), - ('341', '3168', '2006-02-16T02:30:53', '2005-08-22T09:10:21', '2005-08-24T06:00:21', '2'), - ('341', '1548', '2006-02-16T02:30:53', '2005-07-08T08:12:17', '2005-07-15T12:24:17', '2'), - ('341', '2259', '2006-02-16T02:30:53', '2005-07-10T22:04:19', '2005-07-13T00:45:19', '2'), - ('341', '401', '2006-02-16T02:30:53', '2005-07-27T19:05:40', '2005-08-05T14:47:40', '1'), - ('341', '444', '2006-02-16T02:30:53', '2005-08-20T12:53:46', '2005-08-21T10:36:46', '1'), - ('341', '2507', '2006-02-16T02:30:53', '2005-06-17T00:13:19', '2005-06-23T18:37:19', '2'), - ('341', '3810', '2006-02-16T02:30:53', '2005-08-19T09:42:01', '2005-08-21T12:07:01', '1'), - ('341', '1991', '2006-02-16T02:30:53', '2005-07-06T21:15:45', '2005-07-13T20:02:45', '2'), - ('341', '3409', '2006-02-16T02:30:53', '2005-07-29T15:28:24', '2005-08-05T20:04:24', '2'), - ('341', '2884', '2006-02-16T02:30:53', '2005-08-23T18:43:31', '2005-08-31T00:26:31', '2'), - ('341', '1690', '2006-02-16T02:30:53', '2005-08-02T15:44:55', '2005-08-08T16:42:55', '2'), - ('184', '16', '2006-02-16T02:30:53', '2005-07-12T02:40:41', '2005-07-16T04:56:41', '1'), - ('184', '190', '2006-02-16T02:30:53', '2005-05-26T06:55:58', '2005-05-27T10:54:58', '1'), - ('184', '34', '2006-02-16T02:30:53', '2005-08-19T18:55:21', '2005-08-23T18:49:21', '2'), - ('184', '1677', '2006-02-16T02:30:53', '2005-08-22T00:46:54', '2005-08-30T19:03:54', '1'), - ('184', '1354', '2006-02-16T02:30:53', '2005-08-19T12:14:14', '2005-08-20T11:52:14', '1'), - ('184', '2144', '2006-02-16T02:30:53', '2005-07-28T03:19:23', '2005-08-04T05:17:23', '2'), - ('184', '4483', '2006-02-16T02:30:53', '2005-08-19T17:20:15', '2005-08-26T18:28:15', '2'), - ('184', '4355', '2006-02-16T02:30:53', '2005-07-10T20:01:17', '2005-07-12T00:15:17', '1'), - ('184', '4540', '2006-02-16T02:30:53', '2005-07-08T19:42:03', '2005-07-16T22:24:03', '1'), - ('184', '3063', '2006-02-16T02:30:53', '2005-07-12T12:47:22', '2005-07-21T16:04:22', '1'), - ('184', '402', '2006-02-16T02:30:53', '2005-06-18T08:55:46', '2005-06-24T04:34:46', '2'), - ('184', '114', '2006-02-16T02:30:53', '2005-08-18T13:57:58', '2005-08-24T14:58:58', '2'), - ('184', '3308', '2006-02-16T02:30:53', '2005-05-28T09:56:20', '2005-06-01T06:41:20', '2'), - ('184', '1310', '2006-02-16T02:30:53', '2005-07-27T03:34:37', '2005-07-31T03:48:37', '2'), - ('184', '3631', '2006-02-16T02:30:53', '2005-06-17T09:38:08', '2005-06-23T07:23:08', '2'), - ('184', '4219', '2006-02-16T02:30:53', '2005-08-18T11:19:02', '2005-08-19T12:00:02', '2'), - ('184', '4097', '2006-02-16T02:30:53', '2005-08-21T13:13:57', '2005-08-23T14:04:57', '2'), - ('184', '3627', '2006-02-16T02:30:53', '2005-08-18T00:57:06', '2005-08-26T03:13:06', '2'), - ('184', '992', '2006-02-16T02:30:53', '2005-05-28T06:15:25', '2005-06-06T07:51:25', '1'), - ('184', '539', '2006-02-16T02:30:53', '2005-07-07T17:38:31', '2005-07-09T20:24:31', '1'), - ('184', '1713', '2006-02-16T02:30:53', '2005-08-23T06:56:18', '2005-08-25T06:10:18', '1'), - ('184', '4198', '2006-02-16T02:30:53', '2005-07-30T11:21:56', '2005-08-02T15:32:56', '1'), - ('184', '1584', '2006-02-16T02:30:53', '2005-07-30T00:47:03', '2005-08-06T03:23:03', '2'), - ('571', '230', '2006-02-16T02:30:53', '2005-06-15T16:29:56', '2005-06-21T14:43:56', '2'), - ('571', '4383', '2006-02-16T02:30:53', '2005-07-30T20:32:09', '2005-08-04T20:14:09', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['11080', '15841', '3616', '6792', '6676', '1990', '2977', '13266', '8638', '228', '10227', '2327', '14956', '11191', '13228', '4162', '5789', '8084', '1756', '9300', '689', '1254', '13688', '11426', '7161', '4601', '11526', '9081', '11121', '6108', '11114', '12256', '11415', '5595', '13377', '559', '2007', '2458', '8342', '10204', '1889', '5713', '7713', '9950', '7345', '13523', '8432', '11268', '5375', '8889', '13566', '2544', '4932', '4192', '3451', '8523', '5492', '2411', '3731', '11567', '10707', '8858', '14235', '12194', '6479', '7424', '3016', '1967', '12040', '6742', '3990', '6757', '6278', '3954', '14286', '3337', '3376', '10023', '7853', '3974', '14276', '2643', '3732', '224', '4356', '2634', '7649', '3995', '6687', '13027', '9433', '5647', '12910', '1131', '14925', '15835', '9234', '3751', '9952', '2565']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('571', '4303', '2006-02-16T02:30:53', '2005-08-02T07:29:56', '2005-08-08T05:58:56', '1'), - ('571', '2865', '2006-02-16T02:30:53', '2005-08-23T15:35:59', '2005-08-30T19:30:59', '2'), - ('571', '557', '2006-02-16T02:30:53', '2005-07-06T05:52:13', '2005-07-10T10:24:13', '1'), - ('571', '510', '2006-02-16T02:30:53', '2005-07-12T16:37:28', '2005-07-20T11:20:28', '2'), - ('571', '2294', '2006-02-16T02:30:53', '2005-07-12T11:53:40', '2005-07-19T09:15:40', '1'), - ('571', '1471', '2006-02-16T02:30:53', '2005-06-17T10:48:44', '2005-06-24T08:11:44', '1'), - ('571', '2645', '2006-02-16T02:30:53', '2005-06-20T08:15:27', '2005-06-29T04:30:27', '2'), - ('571', '1326', '2006-02-16T02:30:53', '2005-08-19T17:31:20', '2005-08-21T11:41:20', '2'), - ('571', '4060', '2006-02-16T02:30:53', '2005-07-29T14:30:23', '2005-08-01T10:32:23', '1'), - ('571', '511', '2006-02-16T02:30:53', '2005-05-26T10:54:28', '2005-06-04T09:39:28', '1'), - ('571', '872', '2006-02-16T02:30:53', '2005-08-01T01:42:22', '2005-08-09T23:45:22', '2'), - ('571', '1351', '2006-02-16T02:30:53', '2005-06-18T10:16:40', '2005-06-20T15:06:40', '1'), - ('571', '3650', '2006-02-16T02:30:53', '2005-08-22T06:26:16', '2005-08-25T11:06:16', '2'), - ('571', '1097', '2006-02-16T02:30:53', '2005-08-02T11:24:07', '2005-08-10T10:39:07', '1'), - ('571', '2497', '2006-02-16T02:30:53', '2005-08-19T16:08:16', '2005-08-20T18:55:16', '1'), - ('571', '745', '2006-02-16T02:30:53', '2005-07-07T09:17:26', '2005-07-15T10:15:26', '2'), - ('571', '2601', '2006-02-16T02:30:53', '2005-07-10T14:11:26', '2005-07-18T16:19:26', '1'), - ('571', '911', '2006-02-16T02:30:53', '2005-07-28T18:11:58', '2005-08-03T23:41:58', '2'), - ('571', '1401', '2006-02-16T02:30:53', '2005-06-16T17:22:33', '2005-06-21T16:52:33', '1'), - ('571', '1639', '2006-02-16T02:30:53', '2005-07-30T16:33:12', '2005-08-05T15:56:12', '1'), - ('571', '742', '2006-02-16T02:30:53', '2005-05-29T00:46:53', '2005-06-03T23:48:53', '2'), - ('571', '3986', '2006-02-16T02:30:53', '2005-06-15T06:11:16', '2005-06-21T06:40:16', '2'), - ('572', '1116', '2006-02-16T02:30:53', '2005-08-20T08:59:38', '2005-08-28T04:54:38', '2'), - ('572', '130', '2006-02-16T02:30:53', '2005-08-02T20:00:09', '2005-08-09T01:30:09', '2'), - ('572', '378', '2006-02-16T02:30:53', '2005-07-27T07:26:32', '2005-08-03T01:26:32', '2'), - ('572', '3184', '2006-02-16T02:30:53', '2005-07-08T06:49:10', '2005-07-09T07:43:10', '1'), - ('572', '2419', '2006-02-16T02:30:53', '2005-08-17T00:17:38', '2005-08-18T03:59:38', '2'), - ('572', '3040', '2006-02-16T02:30:53', '2005-07-30T08:09:58', '2005-08-03T13:27:58', '1'), - ('572', '1025', '2006-02-16T02:30:53', '2005-08-02T08:48:31', '2005-08-04T05:08:31', '2'), - ('572', '4296', '2006-02-16T02:30:53', '2005-07-11T07:19:24', '2005-07-13T12:38:24', '2'), - ('572', '1273', '2006-02-16T02:30:53', '2005-08-02T08:26:45', '2005-08-03T08:41:45', '2'), - ('572', '2975', '2006-02-16T02:30:53', '2005-08-18T04:09:39', '2005-08-22T01:53:39', '2'), - ('572', '2197', '2006-02-16T02:30:53', '2005-08-02T19:43:38', '2005-08-10T15:13:38', '1'), - ('572', '264', '2006-02-16T02:30:53', '2005-07-10T04:33:45', '2005-07-16T04:04:45', '1'), - ('572', '1316', '2006-02-16T02:30:53', '2005-08-19T21:32:23', '2005-08-25T22:24:23', '1'), - ('572', '1227', '2006-02-16T02:30:53', '2005-05-28T08:39:02', '2005-06-05T08:38:02', '2'), - ('572', '1123', '2006-02-16T02:30:53', '2005-06-17T11:47:17', '2005-06-21T07:19:17', '1'), - ('572', '599', '2006-02-16T02:30:53', '2005-06-18T19:39:05', '2005-06-21T13:54:05', '2'), - ('572', '3301', '2006-02-16T02:30:53', '2005-07-29T04:45:05', '2005-08-01T07:20:05', '1'), - ('572', '764', '2006-02-16T02:30:53', '2005-08-01T00:47:39', '2005-08-05T01:11:39', '1'), - ('572', '3909', '2006-02-16T02:30:53', '2005-06-17T04:05:12', '2005-06-26T04:13:12', '1'), - ('572', '1213', '2006-02-16T02:30:53', '2005-07-10T10:46:15', '2005-07-19T14:34:15', '1'), - ('572', '2018', '2006-02-16T02:30:53', '2005-07-28T04:32:14', '2005-08-03T04:30:14', '2'), - ('572', '1657', '2006-02-16T02:30:53', '2005-07-31T15:50:22', '2005-08-08T19:10:22', '2'), - ('572', '2434', '2006-02-16T02:30:53', '2005-07-27T14:29:53', '2005-08-03T18:38:53', '2'), - ('572', '163', '2006-02-16T02:30:53', '2005-08-20T02:47:03', '2005-08-28T07:43:03', '1'), - ('572', '3896', '2006-02-16T02:30:53', '2005-07-29T07:13:33', '2005-07-30T03:14:33', '1'), - ('558', '3275', '2006-02-16T02:30:53', '2005-08-02T14:10:39', '2005-08-04T14:35:39', '1'), - ('558', '1407', '2006-02-16T02:30:53', '2005-07-09T18:52:55', '2005-07-16T15:32:55', '2'), - ('558', '3457', '2006-02-16T02:30:53', '2005-07-30T00:39:43', '2005-08-02T23:22:43', '1'), - ('558', '4397', '2006-02-16T02:30:53', '2005-08-20T04:45:32', '2005-08-28T02:12:32', '2'), - ('558', '1465', '2006-02-16T02:30:53', '2005-06-19T02:16:17', '2005-06-22T21:45:17', '1'), - ('558', '4237', '2006-02-16T02:30:53', '2005-07-08T22:17:40', '2005-07-15T22:13:40', '2'), - ('558', '624', '2006-02-16T02:30:53', '2005-07-07T10:57:06', '2005-07-13T16:30:06', '1'), - ('558', '3489', '2006-02-16T02:30:53', '2005-06-21T21:10:39', '2005-06-30T19:03:39', '2'), - ('558', '3614', '2006-02-16T02:30:53', '2005-07-29T10:18:27', '2005-08-04T09:31:27', '1'), - ('558', '4524', '2006-02-16T02:30:53', '2005-07-10T00:11:09', '2005-07-14T01:27:09', '1'), - ('558', '3302', '2006-02-16T02:30:53', '2005-06-18T16:55:54', '2005-06-25T12:44:54', '1'), - ('558', '4133', '2006-02-16T02:30:53', '2005-07-06T11:33:36', '2005-07-15T12:23:36', '2'), - ('558', '567', '2006-02-16T02:30:53', '2005-08-17T01:28:43', '2005-08-24T20:20:43', '2'), - ('558', '1165', '2006-02-16T02:30:53', '2005-08-01T18:41:34', '2005-08-06T12:41:34', '1'), - ('558', '2378', '2006-02-16T02:30:53', '2005-07-29T23:44:35', '2005-08-01T05:25:35', '2'), - ('558', '125', '2006-02-16T02:30:53', '2005-08-21T05:08:42', '2005-08-29T23:36:42', '1'), - ('558', '292', '2006-02-16T02:30:53', '2005-08-18T02:04:47', '2005-08-25T20:45:47', '2'), - ('558', '2587', '2006-02-16T02:30:53', '2005-07-12T01:49:00', '2005-07-21T04:26:00', '1'), - ('558', '660', '2006-02-16T02:30:53', '2005-07-27T17:14:19', '2005-08-01T19:21:19', '2'), - ('558', '3514', '2006-02-16T02:30:53', '2005-06-20T10:55:08', '2005-06-24T14:05:08', '1'), - ('558', '3225', '2006-02-16T02:30:53', '2005-06-17T09:19:52', '2005-06-21T03:35:52', '1'), - ('558', '1288', '2006-02-16T02:30:53', '2005-08-17T20:29:56', '2005-08-26T22:17:56', '1'), - ('558', '4242', '2006-02-16T02:30:53', '2005-07-12T14:25:31', '2005-07-17T08:50:31', '2'), - ('558', '2009', '2006-02-16T02:30:53', '2005-07-06T23:32:44', '2005-07-14T01:35:44', '2'), - ('558', '547', '2006-02-16T02:30:53', '2005-07-12T15:09:48', '2005-07-17T15:04:48', '2'), - ('558', '2232', '2006-02-16T02:30:53', '2005-07-11T16:20:02', '2005-07-19T19:29:02', '2'), - ('558', '4250', '2006-02-16T02:30:53', '2005-07-06T21:57:44', '2005-07-08T02:37:44', '2'), - ('558', '2377', '2006-02-16T02:30:53', '2005-08-21T06:53:53', '2005-08-27T11:37:53', '2'), - ('318', '1176', '2006-02-16T02:30:53', '2005-06-21T10:24:35', '2005-06-22T13:51:35', '1'), - ('318', '3055', '2006-02-16T02:30:53', '2005-06-21T13:43:02', '2005-06-28T18:07:02', '1'), - ('318', '384', '2006-02-16T02:30:53', '2005-07-31T18:25:51', '2005-08-09T18:00:51', '1'), - ('318', '4053', '2006-02-16T02:30:53', '2005-07-28T09:36:38', '2005-07-29T15:01:38', '1'), - ('318', '4282', '2006-02-16T02:30:53', '2005-07-06T22:59:16', '2005-07-11T22:30:16', '1'), - ('318', '3637', '2006-02-16T02:30:53', '2005-08-21T06:34:05', '2005-08-28T10:13:05', '2'), - ('318', '1928', '2006-02-16T02:30:53', '2005-06-19T09:39:27', '2005-06-26T10:27:27', '2'), - ('318', '106', '2006-02-16T02:30:53', '2005-07-06T11:33:37', '2005-07-08T08:31:37', '1'), - ('318', '4285', '2006-02-16T02:30:53', '2005-05-26T10:18:27', '2005-06-04T06:59:27', '1'), - ('318', '1907', '2006-02-16T02:30:53', '2005-07-07T19:21:22', '2005-07-16T15:57:22', '1'), - ('318', '3687', '2006-02-16T02:30:53', '2005-06-19T08:55:17', '2005-06-20T11:44:17', '2'), - ('318', '2704', '2006-02-16T02:30:53', '2005-07-28T01:37:26', '2005-07-28T21:18:26', '1'), - ('128', '3990', '2006-02-16T02:30:53', '2005-07-06T23:43:03', '2005-07-13T04:13:03', '2'), - ('128', '2736', '2006-02-16T02:30:53', '2005-07-12T12:19:23', '2005-07-19T17:12:23', '1'), - ('128', '3756', '2006-02-16T02:30:53', '2005-08-19T08:25:16', '2005-08-25T13:42:16', '1'), - ('128', '1082', '2006-02-16T02:30:53', '2005-07-30T21:28:17', '2005-08-08T18:20:17', '2'), - ('128', '1466', '2006-02-16T02:30:53', '2005-07-10T07:08:40', '2005-07-13T05:19:40', '2'), - ('128', '3968', '2006-02-16T02:30:53', '2005-08-19T04:23:13', '2005-08-20T22:27:13', '1'), - ('128', '2654', '2006-02-16T02:30:53', '2005-05-31T18:44:19', '2005-06-01T20:13:19', '1'), - ('128', '442', '2006-02-16T02:30:53', '2005-08-22T05:16:16', '2005-08-30T02:47:16', '2'), - ('128', '1362', '2006-02-16T02:30:53', '2005-08-23T15:25:27', '2005-09-01T16:14:27', '2'), - ('128', '1660', '2006-02-16T02:30:53', '2005-07-30T13:45:54', '2005-08-02T15:33:54', '1'), - ('128', '3652', '2006-02-16T02:30:53', '2005-07-06T12:23:41', '2005-07-10T06:58:41', '1'), - ('128', '1634', '2006-02-16T02:30:53', '2005-07-31T15:52:37', '2005-08-06T10:50:37', '2'), - ('128', '2347', '2006-02-16T02:30:53', '2005-06-19T03:44:03', '2005-06-24T01:26:03', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['12731', '888', '9215', '7582', '12843', '5997', '6481', '10011', '8415', '6186', '13181', '9858', '14157', '13964', '5270', '2519', '10394', '15220', '13509', '3987', '15620', '1345', '3501', '10579', '8618', '1896', '10461', '193', '5533', '10069', '14618', '13945', '11917', '11389', '2115', '6520', '10648', '3164', '12442', '12192', '11841', '8355', '1040', '11810', '2440', '7021', '10983', '15697', '15636', '2018', '10450', '15175', '4675', '11945', '5339', '9710', '9056', '7167', '2998', '15361', '1868', '847', '3637', '7443', '14529', '7974', '14935', '12996', '11936', '12636', '15748', '3688', '7773', '3099', '3260', '7435', '9261', '2464', '1984', '4706', '4769', '605', '7456', '15699', '8529', '8021', '493', '3222', '15239', '9359', '3723', '3541', '12914', '6095', '11799', '5520', '11393', '10817', '3412', '11640']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('128', '1719', '2006-02-16T02:30:53', '2005-08-18T21:55:38', '2005-08-23T20:30:38', '1'), - ('128', '387', '2006-02-16T02:30:53', '2005-05-30T07:13:14', '2005-06-06T09:50:14', '1'), - ('128', '3591', '2006-02-16T02:30:53', '2005-07-30T13:11:11', '2005-08-06T13:06:11', '1'), - ('128', '3941', '2006-02-16T02:30:53', '2005-07-27T23:15:14', '2005-07-29T03:18:14', '2'), - ('128', '3279', '2006-02-16T02:30:53', '2005-08-19T01:58:54', '2005-08-20T00:20:54', '2'), - ('128', '3542', '2006-02-16T02:30:53', '2005-07-11T01:19:50', '2005-07-16T06:29:50', '1'), - ('128', '2392', '2006-02-16T02:30:53', '2005-07-12T01:50:15', '2005-07-20T03:03:15', '1'), - ('128', '606', '2006-02-16T02:30:53', '2005-07-31T18:02:41', '2005-08-08T17:04:41', '1'), - ('128', '2903', '2006-02-16T02:30:53', '2005-07-29T06:52:27', '2005-08-02T10:40:27', '1'), - ('128', '2086', '2006-02-16T02:30:53', '2005-07-11T11:26:41', '2005-07-17T12:02:41', '2'), - ('128', '1256', '2006-02-16T02:30:53', '2005-08-19T14:00:56', '2005-08-24T13:52:56', '2'), - ('128', '252', '2006-02-16T02:30:53', '2005-07-31T13:02:07', '2005-08-03T15:14:07', '2'), - ('128', '4471', '2006-02-16T02:30:53', '2005-08-21T02:43:15', '2005-08-24T02:47:15', '1'), - ('128', '108', '2006-02-16T02:30:53', '2005-08-20T18:24:26', '2005-08-21T21:19:26', '2'), - ('128', '1523', '2006-02-16T02:30:53', '2005-07-09T14:23:46', '2005-07-13T15:04:46', '1'), - ('128', '1172', '2006-02-16T02:30:53', '2005-06-19T00:19:21', '2005-06-25T01:46:21', '1'), - ('128', '1655', '2006-02-16T02:30:53', '2005-08-01T06:58:17', '2005-08-05T02:09:17', '1'), - ('128', '187', '2006-02-16T02:30:53', '2005-08-22T17:02:23', '2005-08-28T21:02:23', '1'), - ('128', '3698', '2006-02-16T02:30:53', '2005-08-20T02:14:16', '2005-08-22T06:36:16', '2'), - ('270', '3104', '2006-02-16T02:30:53', '2005-07-06T23:28:24', '2005-07-15T00:52:24', '1'), - ('270', '1173', '2006-02-16T02:30:53', '2005-08-23T07:10:22', '2005-08-28T06:51:22', '2'), - ('270', '1041', '2006-02-16T02:30:53', '2005-06-15T12:32:13', '2005-06-24T14:02:13', '1'), - ('270', '2219', '2006-02-16T02:30:53', '2005-07-06T00:11:28', '2005-07-10T20:32:28', '2'), - ('270', '4068', '2006-02-16T02:30:53', '2005-08-01T13:48:22', '2005-08-07T11:51:22', '1'), - ('270', '985', '2006-02-16T02:30:53', '2005-07-29T13:48:20', '2005-08-06T14:12:20', '2'), - ('270', '2077', '2006-02-16T02:30:53', '2005-06-17T04:25:46', '2005-06-26T09:37:46', '1'), - ('270', '3212', '2006-02-16T02:30:53', '2005-08-01T09:32:53', '2005-08-09T10:19:53', '1'), - ('270', '3900', '2006-02-16T02:30:53', '2005-05-26T06:41:48', '2005-05-30T06:21:48', '2'), - ('270', '2567', '2006-02-16T02:30:53', '2005-07-10T02:19:28', '2005-07-11T01:37:28', '1'), - ('270', '2168', '2006-02-16T02:30:53', '2005-07-31T19:43:18', '2005-08-06T19:40:18', '2'), - ('270', '4490', '2006-02-16T02:30:53', '2005-08-21T18:09:51', '2005-08-28T22:47:51', '1'), - ('270', '3328', '2006-02-16T02:30:53', '2005-08-20T17:43:56', '2005-08-26T19:19:56', '1'), - ('270', '1608', '2006-02-16T02:30:53', '2005-08-17T16:08:17', '2005-08-20T20:01:17', '1'), - ('270', '3267', '2006-02-16T02:30:53', '2005-08-02T18:39:12', '2005-08-03T23:23:12', '2'), - ('270', '3448', '2006-02-16T02:30:53', '2005-06-17T20:02:16', '2005-06-25T16:56:16', '2'), - ('270', '1535', '2006-02-16T02:30:53', '2005-07-12T04:05:16', '2005-07-15T08:26:16', '1'), - ('270', '691', '2006-02-16T02:30:53', '2005-08-01T16:08:52', '2005-08-05T20:17:52', '1'), - ('270', '155', '2006-02-16T02:30:53', '2005-06-20T21:29:00', '2005-06-27T15:50:00', '1'), - ('270', '78', '2006-02-16T02:30:53', '2005-08-18T10:50:07', '2005-08-21T08:06:07', '1'), - ('270', '3450', '2006-02-16T02:30:53', '2005-08-18T02:01:40', '2005-08-21T05:45:40', '1'), - ('270', '1524', '2006-02-16T02:30:53', '2005-08-17T13:12:20', '2005-08-21T11:16:20', '2'), - ('270', '4569', '2006-02-16T02:30:53', '2005-07-29T04:57:43', '2005-08-03T06:25:43', '1'), - ('270', '2546', '2006-02-16T02:30:53', '2005-05-31T05:35:16', '2005-06-09T04:14:16', '1'), - ('270', '1548', '2006-02-16T02:30:53', '2005-08-17T11:56:48', '2005-08-20T17:39:48', '1'), - ('380', '2866', '2006-02-16T02:30:53', '2005-06-18T18:41:09', '2005-06-22T12:46:09', '1'), - ('380', '2690', '2006-02-16T02:30:53', '2005-07-27T02:26:38', '2005-08-05T01:18:38', '1'), - ('380', '4502', '2006-02-16T02:30:53', '2005-08-02T04:24:23', '2005-08-09T08:05:23', '2'), - ('380', '1987', '2006-02-16T02:30:53', '2005-08-23T10:04:36', '2005-08-24T05:00:36', '2'), - ('380', '1169', '2006-02-16T02:30:53', '2005-08-23T07:50:46', '2005-08-26T07:59:46', '2'), - ('380', '1278', '2006-02-16T02:30:53', '2005-06-17T12:35:58', '2005-06-26T13:16:58', '2'), - ('380', '234', '2006-02-16T02:30:53', '2005-08-01T09:10:03', '2005-08-08T12:34:03', '1'), - ('380', '4318', '2006-02-16T02:30:53', '2005-08-22T15:29:15', '2005-08-27T15:11:15', '2'), - ('380', '1309', '2006-02-16T02:30:53', '2005-07-08T10:24:22', '2005-07-14T11:09:22', '1'), - ('380', '1108', '2006-02-16T02:30:53', '2005-08-17T17:05:33', '2005-08-20T18:37:33', '2'), - ('380', '698', '2006-02-16T02:30:53', '2005-07-09T17:09:17', '2005-07-10T21:07:17', '2'), - ('380', '3486', '2006-02-16T02:30:53', '2005-07-31T08:05:31', '2005-08-09T03:29:31', '2'), - ('380', '4363', '2006-02-16T02:30:53', '2005-07-30T07:13:20', '2005-08-03T07:36:20', '1'), - ('380', '238', '2006-02-16T02:30:53', '2005-07-27T07:37:26', '2005-08-03T06:39:26', '1'), - ('380', '1288', '2006-02-16T02:30:53', '2005-06-20T09:30:22', '2005-06-24T06:31:22', '2'), - ('380', '1407', '2006-02-16T02:30:53', '2005-08-22T21:39:45', '2005-08-23T17:32:45', '2'), - ('380', '2412', '2006-02-16T02:30:53', '2005-06-17T02:03:22', '2005-06-25T04:38:22', '1'), - ('380', '4387', '2006-02-16T02:30:53', '2005-05-30T01:18:15', '2005-06-06T20:20:15', '2'), - ('380', '3823', '2006-02-16T02:30:53', '2005-07-06T07:06:31', '2005-07-10T02:11:31', '2'), - ('380', '703', '2006-02-16T02:30:53', '2005-07-27T17:47:43', '2005-07-29T13:15:43', '1'), - ('380', '1774', '2006-02-16T02:30:53', '2005-08-21T15:08:31', '2005-08-29T17:15:31', '1'), - ('380', '2442', '2006-02-16T02:30:53', '2005-07-28T14:11:57', '2005-08-02T19:25:57', '2'), - ('380', '2025', '2006-02-16T02:30:53', '2005-08-22T05:47:31', '2005-08-29T00:33:31', '2'), - ('380', '4445', '2006-02-16T02:30:53', '2005-08-19T07:31:32', '2005-08-25T11:59:32', '1'), - ('380', '1127', '2006-02-16T02:30:53', '2005-08-17T16:45:34', '2005-08-21T13:33:34', '2'), - ('380', '1645', '2006-02-16T02:30:53', '2005-08-18T18:00:29', '2005-08-26T20:08:29', '2'), - ('380', '2757', '2006-02-16T02:30:53', '2005-08-23T12:33:00', '2005-08-25T15:15:00', '2'), - ('380', '1102', '2006-02-16T02:30:53', '2005-07-06T09:41:53', '2005-07-14T10:30:53', '2'), - ('380', '4143', '2006-02-16T02:30:53', '2005-07-28T07:02:17', '2005-07-30T04:16:17', '2'), - ('380', '3756', '2006-02-16T02:30:53', '2005-06-20T16:44:33', '2005-06-27T12:17:33', '2'), - ('380', '3627', '2006-02-16T02:30:53', '2005-06-21T03:59:13', '2005-06-23T03:29:13', '1'), - ('380', '1574', '2006-02-16T02:30:53', '2005-07-27T17:38:44', '2005-07-30T16:57:44', '1'), - ('380', '372', '2006-02-16T02:30:53', '2005-07-30T14:39:35', '2005-08-08T11:26:35', '1'), - ('380', '463', '2006-02-16T02:30:53', '2005-06-18T20:06:05', '2005-06-20T19:22:05', '1'), - ('380', '3417', '2006-02-16T02:30:53', '2005-06-17T10:25:28', '2005-06-23T08:18:28', '2'), - ('380', '2512', '2006-02-16T02:30:53', '2005-07-08T11:51:41', '2005-07-17T12:58:41', '1'), - ('501', '3462', '2006-02-16T02:30:53', '2005-07-08T15:29:16', '2005-07-09T18:42:16', '2'), - ('501', '4232', '2006-02-16T02:30:53', '2005-05-28T14:39:10', '2005-06-01T09:28:10', '2'), - ('501', '1959', '2006-02-16T02:30:53', '2005-07-27T18:34:53', '2005-07-29T17:46:53', '2'), - ('501', '4155', '2006-02-16T02:30:53', '2005-08-23T10:20:35', '2005-08-30T13:56:35', '1'), - ('501', '1055', '2006-02-16T02:30:53', '2005-07-29T10:24:31', '2005-08-01T16:06:31', '1'), - ('501', '1920', '2006-02-16T02:30:53', '2005-07-28T15:45:24', '2005-08-04T10:49:24', '1'), - ('501', '184', '2006-02-16T02:30:53', '2005-05-28T00:34:11', '2005-05-30T18:40:11', '1'), - ('501', '4023', '2006-02-16T02:30:53', '2005-06-21T01:50:29', '2005-06-27T00:52:29', '2'), - ('501', '1809', '2006-02-16T02:30:53', '2005-08-22T17:46:17', '2005-08-26T19:03:17', '1'), - ('501', '21', '2006-02-16T02:30:53', '2005-07-30T18:39:28', '2005-07-31T15:39:28', '1'), - ('501', '4554', '2006-02-16T02:30:53', '2005-07-06T11:12:02', '2005-07-14T16:45:02', '2'), - ('501', '1204', '2006-02-16T02:30:53', '2005-07-06T01:50:11', '2005-07-12T03:24:11', '1'), - ('501', '4396', '2006-02-16T02:30:53', '2005-08-19T04:25:59', '2005-08-23T08:04:59', '2'), - ('501', '727', '2006-02-16T02:30:53', '2005-07-11T06:06:41', '2005-07-19T06:14:41', '1'), - ('501', '40', '2006-02-16T02:30:53', '2005-08-17T11:25:25', '2005-08-25T13:03:25', '2'), - ('501', '2527', '2006-02-16T02:30:53', '2005-07-10T01:30:41', '2005-07-15T21:37:41', '2'), - ('501', '1033', '2006-02-16T02:30:53', '2005-08-02T18:44:29', '2005-08-11T23:58:29', '1'), - ('501', '3056', '2006-02-16T02:30:53', '2005-08-01T22:51:08', '2005-08-10T16:55:08', '2'), - ('501', '3036', '2006-02-16T02:30:53', '2005-06-21T16:44:31', '2005-06-28T16:15:31', '2'), - ('501', '1718', '2006-02-16T02:30:53', '2005-08-17T04:44:33', '2005-08-21T09:29:33', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['13889', '6736', '11178', '7280', '12522', '6429', '9955', '11446', '13368', '15895', '6060', '2190', '12816', '2914', '10242', '13637', '9948', '14096', '15484', '9956', '14683', '6787', '9526', '13827', '9164', '13755', '3081', '12139', '14299', '5617', '11568', '12404', '6997', '10081', '6625', '15519', '9740', '11449', '14611', '15182', '10360', '15393', '12857', '6983', '3510', '2871', '7987', '12415', '6913', '7317', '7667', '13489', '10014', '1068', '14561', '11005', '8068', '3432', '997', '15199', '6008', '13424', '9096', '15192', '11676', '11621', '1672', '6349', '14638', '4161', '12970', '15934', '2351', '10506', '1461', '1664', '8859', '14726', '1279', '6472', '4134', '13482', '10620', '2471', '13536', '2188', '12831', '3869', '6569', '11386', '12451', '12764', '9931', '7359', '4157', '3381', '382', '5756', '9672', '9818']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('501', '4406', '2006-02-16T02:30:53', '2005-08-20T15:40:06', '2005-08-22T14:09:06', '2'), - ('342', '530', '2006-02-16T02:30:53', '2005-07-12T14:16:50', '2005-07-15T16:26:50', '1'), - ('342', '2613', '2006-02-16T02:30:53', '2005-08-02T10:48:10', '2005-08-06T06:07:10', '1'), - ('342', '236', '2006-02-16T02:30:53', '2005-07-27T11:50:52', '2005-07-30T15:53:52', '2'), - ('342', '4435', '2006-02-16T02:30:53', '2005-08-18T13:45:40', '2005-08-27T17:05:40', '1'), - ('342', '141', '2006-02-16T02:30:53', '2005-07-12T00:02:50', '2005-07-21T02:08:50', '1'), - ('342', '1745', '2006-02-16T02:30:53', '2005-07-31T16:01:26', '2005-08-04T11:15:26', '2'), - ('342', '748', '2006-02-16T02:30:53', '2005-08-02T20:33:37', '2005-08-03T18:22:37', '1'), - ('342', '1073', '2006-02-16T02:30:53', '2005-08-19T21:19:35', '2005-08-21T16:12:35', '2'), - ('342', '2275', '2006-02-16T02:30:53', '2005-08-23T17:09:31', '2005-08-30T17:15:31', '1'), - ('342', '3146', '2006-02-16T02:30:53', '2005-07-11T04:06:17', '2005-07-12T03:05:17', '1'), - ('342', '4398', '2006-02-16T02:30:53', '2005-06-18T01:29:51', '2005-06-26T04:31:51', '2'), - ('342', '4051', '2006-02-16T02:30:53', '2005-08-19T01:04:05', '2005-08-24T01:25:05', '1'), - ('342', '2419', '2006-02-16T02:30:53', '2005-06-20T03:43:18', '2005-06-25T03:44:18', '2'), - ('342', '1825', '2006-02-16T02:30:53', '2005-08-01T02:18:12', '2005-08-02T22:32:12', '2'), - ('342', '2298', '2006-02-16T02:30:53', '2005-08-20T07:21:15', '2005-08-24T10:13:15', '2'), - ('342', '806', '2006-02-16T02:30:53', '2005-07-31T15:49:41', '2005-08-06T12:36:41', '1'), - ('342', '2089', '2006-02-16T02:30:53', '2005-08-21T00:27:46', '2005-08-22T22:53:46', '1'), - ('342', '642', '2006-02-16T02:30:53', '2005-08-23T02:04:49', '2005-08-24T05:46:49', '1'), - ('342', '4485', '2006-02-16T02:30:53', '2005-07-31T16:03:47', '2005-08-01T16:40:47', '2'), - ('342', '3850', '2006-02-16T02:30:53', '2005-08-21T20:27:44', '2005-08-29T16:54:44', '1'), - ('342', '1481', '2006-02-16T02:30:53', '2005-07-12T16:33:28', '2005-07-18T21:48:28', '2'), - ('342', '417', '2006-02-16T02:30:53', '2005-07-31T01:02:22', '2005-08-04T03:00:22', '1'), - ('342', '1103', '2006-02-16T02:30:53', '2005-08-20T13:47:19', '2005-08-28T09:13:19', '1'), - ('342', '4434', '2006-02-16T02:30:53', '2005-07-30T11:24:14', '2005-08-08T16:24:14', '1'), - ('342', '1927', '2006-02-16T02:30:53', '2005-08-20T11:18:53', '2005-08-27T06:51:53', '2'), - ('342', '2071', '2006-02-16T02:30:53', '2005-06-20T15:29:13', '2005-06-24T21:00:13', '2'), - ('342', '1537', '2006-02-16T02:30:53', '2005-08-17T23:57:13', '2005-08-24T19:13:13', '1'), - ('342', '4028', '2006-02-16T02:30:53', '2005-08-21T07:18:57', '2005-08-24T01:28:57', '1'), - ('342', '2324', '2006-02-16T02:30:53', '2005-07-10T05:28:50', '2005-07-12T00:02:50', '2'), - ('342', '183', '2006-02-16T02:30:53', '2005-08-17T01:30:01', '2005-08-18T22:21:01', '2'), - ('342', '1097', '2006-02-16T02:30:53', '2005-08-18T09:36:34', '2005-08-23T10:12:34', '2'), - ('342', '2130', '2006-02-16T02:30:53', '2005-07-27T01:14:02', '2005-07-29T01:12:02', '2'), - ('443', '3183', '2006-02-16T02:30:53', '2005-07-31T20:07:44', '2005-08-06T20:04:44', '1'), - ('443', '735', '2006-02-16T02:30:53', '2005-07-12T09:06:40', '2005-07-21T04:57:40', '2'), - ('443', '542', '2006-02-16T02:30:53', '2005-08-23T03:23:32', '2005-08-25T03:48:32', '1'), - ('443', '3497', '2006-02-16T02:30:53', '2005-07-31T09:08:03', '2005-08-06T04:48:03', '2'), - ('443', '3279', '2006-02-16T02:30:53', '2005-08-02T20:44:43', '2005-08-07T23:47:43', '2'), - ('443', '4078', '2006-02-16T02:30:53', '2005-08-21T18:01:41', '2005-08-26T12:34:41', '1'), - ('443', '645', '2006-02-16T02:30:53', '2005-08-22T15:47:05', '2005-08-25T11:55:05', '1'), - ('443', '1129', '2006-02-16T02:30:53', '2005-08-01T05:52:53', '2005-08-05T10:55:53', '1'), - ('443', '2924', '2006-02-16T02:30:53', '2005-08-22T23:04:09', '2005-08-27T02:23:09', '2'), - ('443', '4307', '2006-02-16T02:30:53', '2005-08-19T02:20:13', '2005-08-20T20:20:13', '1'), - ('443', '1758', '2006-02-16T02:30:53', '2005-07-27T00:55:03', '2005-08-01T21:19:03', '2'), - ('443', '2250', '2006-02-16T02:30:53', '2005-07-06T00:27:41', '2005-07-14T23:20:41', '2'), - ('443', '1731', '2006-02-16T02:30:53', '2005-06-20T00:27:49', '2005-06-29T01:36:49', '1'), - ('443', '288', '2006-02-16T02:30:53', '2005-07-28T14:36:52', '2005-08-05T16:49:52', '2'), - ('443', '392', '2006-02-16T02:30:53', '2005-08-18T09:54:01', '2005-08-24T15:41:01', '1'), - ('443', '569', '2006-02-16T02:30:53', '2005-07-12T22:18:12', '2005-07-14T23:03:12', '2'), - ('443', '1518', '2006-02-16T02:30:53', '2005-07-27T13:19:41', '2005-07-29T16:16:41', '2'), - ('443', '2415', '2006-02-16T02:30:53', '2005-07-28T02:37:22', '2005-08-05T21:37:22', '1'), - ('443', '2934', '2006-02-16T02:30:53', '2005-08-20T01:29:06', '2005-08-27T21:11:06', '1'), - ('443', '2344', '2006-02-16T02:30:53', '2005-07-31T18:10:56', '2005-08-02T23:36:56', '1'), - ('443', '150', '2006-02-16T02:30:53', '2005-05-31T09:32:15', '2005-06-01T11:20:15', '1'), - ('443', '2498', '2006-02-16T02:30:53', '2005-08-21T16:20:43', '2005-08-27T16:48:43', '1'), - ('216', '1547', '2006-02-16T02:30:53', '2005-08-02T05:05:23', '2005-08-07T23:28:23', '2'), - ('216', '209', '2006-02-16T02:30:53', '2005-07-28T17:22:28', '2005-07-29T12:24:28', '2'), - ('216', '1814', '2006-02-16T02:30:53', '2005-06-21T19:02:03', '2005-06-25T00:57:03', '2'), - ('216', '4243', '2006-02-16T02:30:53', '2005-05-31T00:08:25', '2005-06-02T00:17:25', '2'), - ('216', '18', '2006-02-16T02:30:53', '2005-08-22T16:17:49', '2005-08-25T20:12:49', '1'), - ('216', '1227', '2006-02-16T02:30:53', '2005-07-11T01:51:29', '2005-07-18T01:39:29', '1'), - ('216', '4340', '2006-02-16T02:30:53', '2005-08-19T23:10:09', '2005-08-23T02:25:09', '1'), - ('216', '540', '2006-02-16T02:30:53', '2005-07-30T08:39:23', '2005-08-01T03:33:23', '1'), - ('216', '4213', '2006-02-16T02:30:53', '2005-08-22T16:06:23', '2005-08-27T13:12:23', '1'), - ('216', '4496', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('216', '3708', '2006-02-16T02:30:53', '2005-08-17T04:13:45', '2005-08-26T01:00:45', '1'), - ('216', '4206', '2006-02-16T02:30:53', '2005-06-16T10:37:34', '2005-06-23T05:30:34', '1'), - ('216', '1581', '2006-02-16T02:30:53', '2005-07-11T20:25:05', '2005-07-21T00:35:05', '2'), - ('216', '3583', '2006-02-16T02:30:53', '2005-08-21T19:01:36', '2005-08-22T15:09:36', '2'), - ('216', '4021', '2006-02-16T02:30:53', '2005-07-07T09:15:11', '2005-07-15T06:59:11', '1'), - ('216', '3999', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('216', '994', '2006-02-16T02:30:53', '2005-08-23T18:40:41', '2005-08-25T00:18:41', '2'), - ('216', '2942', '2006-02-16T02:30:53', '2005-06-18T12:27:57', '2005-06-23T16:14:57', '1'), - ('216', '1171', '2006-02-16T02:30:53', '2005-08-01T11:16:05', '2005-08-03T05:37:05', '2'), - ('216', '4479', '2006-02-16T02:30:53', '2005-06-15T20:32:08', '2005-06-23T01:08:08', '1'), - ('216', '2464', '2006-02-16T02:30:53', '2005-06-16T10:15:20', '2005-06-18T12:11:20', '2'), - ('216', '603', '2006-02-16T02:30:53', '2005-07-29T23:44:43', '2005-08-07T18:14:43', '2'), - ('216', '4556', '2006-02-16T02:30:53', '2005-08-21T22:08:52', '2005-08-22T18:28:52', '1'), - ('183', '698', '2006-02-16T02:30:53', '2005-06-15T08:13:57', '2005-06-18T09:36:57', '2'), - ('183', '3780', '2006-02-16T02:30:53', '2005-07-12T01:33:25', '2005-07-15T20:26:25', '1'), - ('183', '2917', '2006-02-16T02:30:53', '2005-07-07T08:14:24', '2005-07-09T10:42:24', '1'), - ('183', '1627', '2006-02-16T02:30:53', '2005-08-20T01:14:30', '2005-08-24T04:57:30', '1'), - ('183', '3064', '2006-02-16T02:30:53', '2005-08-01T15:09:17', '2005-08-09T13:58:17', '1'), - ('183', '3399', '2006-02-16T02:30:53', '2005-06-18T20:31:00', '2005-06-24T18:01:00', '2'), - ('183', '667', '2006-02-16T02:30:53', '2005-08-20T03:35:16', '2005-08-25T04:06:16', '2'), - ('183', '712', '2006-02-16T02:30:53', '2005-06-18T01:19:04', '2005-06-25T03:59:04', '2'), - ('183', '1916', '2006-02-16T02:30:53', '2005-08-19T01:40:43', '2005-08-28T05:22:43', '1'), - ('183', '2540', '2006-02-16T02:30:53', '2005-07-06T17:56:46', '2005-07-10T20:44:46', '1'), - ('183', '759', '2006-02-16T02:30:53', '2005-07-12T05:47:40', '2005-07-20T06:23:40', '2'), - ('183', '519', '2006-02-16T02:30:53', '2005-08-02T18:24:03', '2005-08-06T21:22:03', '1'), - ('183', '2780', '2006-02-16T02:30:53', '2005-08-18T11:04:42', '2005-08-20T08:20:42', '1'), - ('183', '26', '2006-02-16T02:30:53', '2005-08-18T23:14:15', '2005-08-22T20:23:15', '1'), - ('183', '3455', '2006-02-16T02:30:53', '2005-07-31T15:18:19', '2005-08-04T14:23:19', '2'), - ('183', '174', '2006-02-16T02:30:53', '2005-07-27T14:51:04', '2005-07-31T16:03:04', '2'), - ('183', '304', '2006-02-16T02:30:53', '2005-07-07T09:04:26', '2005-07-08T09:55:26', '1'), - ('183', '1373', '2006-02-16T02:30:53', '2005-06-21T14:02:59', '2005-06-29T18:11:59', '2'), - ('183', '4358', '2006-02-16T02:30:53', '2005-05-27T10:12:00', '2005-05-31T15:03:00', '1'), - ('183', '130', '2006-02-16T02:30:53', '2005-07-10T12:39:28', '2005-07-11T14:08:28', '2'), - ('183', '4394', '2006-02-16T02:30:53', '2005-07-31T06:34:06', '2005-08-08T10:29:06', '2'), - ('183', '1254', '2006-02-16T02:30:53', '2005-07-31T11:34:32', '2005-08-04T08:20:32', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['5069', '7629', '9913', '3277', '6880', '13295', '7308', '11521', '13431', '15912', '4694', '2200', '6578', '3933', '4458', '3280', '7640', '13679', '7305', '6155', '5623', '12866', '4515', '3208', '13306', '15740', '8986', '5528', '2776', '5201', '3996', '728', '13439', '14633', '6041', '15377', '969', '155', '11883', '14609', '795', '11380', '14420', '9765', '14833', '7095', '9287', '12208', '15390', '1005', '2069', '12868', '3151', '2354', '1710', '419', '10991', '11767', '6168', '8942', '12328', '10184', '10886', '7406', '7710', '6390', '586', '15359', '11469', '760', '4928', '561', '319', '10895', '3238', '9811', '2452', '12065', '13752', '14530', '5775', '10070', '8539', '2507', '15009', '10326', '5740', '2502', '7687', '13054', '5470', '10030', '14672', '6135', '6622', '14452', '12779', '10412', '2808', '12097']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('183', '4417', '2006-02-16T02:30:53', '2005-07-09T04:56:30', '2005-07-13T23:53:30', '2'), - ('229', '2453', '2006-02-16T02:30:53', '2005-07-28T01:00:09', '2005-07-30T06:49:09', '1'), - ('229', '3744', '2006-02-16T02:30:53', '2005-07-31T14:51:04', '2005-08-06T12:12:04', '1'), - ('229', '1330', '2006-02-16T02:30:53', '2005-06-21T05:36:37', '2005-06-29T10:54:37', '1'), - ('229', '1473', '2006-02-16T02:30:53', '2005-07-12T20:41:35', '2005-07-17T02:22:35', '1'), - ('229', '2408', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('229', '1452', '2006-02-16T02:30:53', '2005-07-27T13:00:25', '2005-08-03T16:04:25', '1'), - ('229', '463', '2006-02-16T02:30:53', '2005-08-17T00:04:54', '2005-08-21T00:57:54', '1'), - ('229', '1700', '2006-02-16T02:30:53', '2005-08-19T23:28:15', '2005-08-25T04:44:15', '1'), - ('229', '3079', '2006-02-16T02:30:53', '2005-08-23T17:47:40', '2005-08-31T14:43:40', '2'), - ('229', '3637', '2006-02-16T02:30:53', '2005-07-08T11:07:37', '2005-07-12T06:53:37', '2'), - ('229', '1085', '2006-02-16T02:30:53', '2005-06-18T01:59:16', '2005-06-26T23:25:16', '2'), - ('229', '2304', '2006-02-16T02:30:53', '2005-07-12T06:15:41', '2005-07-15T10:43:41', '1'), - ('229', '1202', '2006-02-16T02:30:53', '2005-07-06T21:06:37', '2005-07-08T20:23:37', '1'), - ('229', '1307', '2006-02-16T02:30:53', '2005-07-07T23:47:47', '2005-07-09T19:17:47', '2'), - ('229', '661', '2006-02-16T02:30:53', '2005-06-21T06:08:12', '2005-06-24T09:34:12', '1'), - ('229', '3014', '2006-02-16T02:30:53', '2005-07-28T01:14:49', '2005-08-03T21:50:49', '1'), - ('229', '2878', '2006-02-16T02:30:53', '2005-08-20T08:39:34', '2005-08-29T10:06:34', '2'), - ('229', '2464', '2006-02-16T02:30:53', '2005-07-27T12:57:06', '2005-07-30T13:13:06', '2'), - ('229', '785', '2006-02-16T02:30:53', '2005-07-11T09:45:31', '2005-07-18T08:09:31', '1'), - ('229', '4464', '2006-02-16T02:30:53', '2005-07-10T05:41:38', '2005-07-14T01:01:38', '2'), - ('229', '1766', '2006-02-16T02:30:53', '2005-08-19T02:39:47', '2005-08-27T02:14:47', '1'), - ('229', '1998', '2006-02-16T02:30:53', '2005-07-08T02:42:03', '2005-07-10T07:22:03', '2'), - ('229', '3169', '2006-02-16T02:30:53', '2005-06-21T00:50:03', '2005-06-24T06:15:03', '2'), - ('229', '2742', '2006-02-16T02:30:53', '2005-08-19T18:57:29', '2005-08-20T20:09:29', '2'), - ('229', '100', '2006-02-16T02:30:53', '2005-08-23T12:07:51', '2005-08-24T13:23:51', '2'), - ('551', '3992', '2006-02-16T02:30:53', '2005-07-30T04:37:20', '2005-07-31T23:54:20', '1'), - ('551', '680', '2006-02-16T02:30:53', '2005-07-10T02:09:21', '2005-07-17T06:22:21', '2'), - ('551', '1726', '2006-02-16T02:30:53', '2005-06-19T18:16:24', '2005-06-26T14:43:24', '2'), - ('551', '2453', '2006-02-16T02:30:53', '2005-07-09T10:52:53', '2005-07-16T12:41:53', '2'), - ('551', '2857', '2006-02-16T02:30:53', '2005-07-06T23:46:43', '2005-07-14T22:34:43', '2'), - ('551', '242', '2006-02-16T02:30:53', '2005-05-29T06:12:38', '2005-06-03T07:41:38', '1'), - ('551', '3535', '2006-02-16T02:30:53', '2005-08-19T23:42:16', '2005-08-26T21:24:16', '2'), - ('551', '2137', '2006-02-16T02:30:53', '2005-08-21T18:51:10', '2005-08-25T13:07:10', '1'), - ('551', '2815', '2006-02-16T02:30:53', '2005-07-11T03:14:58', '2005-07-13T00:48:58', '2'), - ('551', '3405', '2006-02-16T02:30:53', '2005-08-22T22:22:33', '2005-08-29T18:41:33', '1'), - ('551', '443', '2006-02-16T02:30:53', '2005-05-30T19:23:48', '2005-05-31T21:14:48', '1'), - ('551', '288', '2006-02-16T02:30:53', '2005-05-26T01:15:05', '2005-06-01T00:03:05', '1'), - ('551', '221', '2006-02-16T02:30:53', '2005-08-17T14:41:28', '2005-08-19T09:54:28', '1'), - ('551', '1206', '2006-02-16T02:30:53', '2005-08-21T17:57:26', '2005-08-25T14:04:26', '2'), - ('551', '609', '2006-02-16T02:30:53', '2005-05-29T16:57:39', '2005-06-01T11:33:39', '2'), - ('551', '1046', '2006-02-16T02:30:53', '2005-08-02T18:17:32', '2005-08-03T19:26:32', '2'), - ('551', '2495', '2006-02-16T02:30:53', '2005-08-21T11:16:15', '2005-08-24T06:06:15', '2'), - ('551', '472', '2006-02-16T02:30:53', '2005-07-31T09:44:40', '2005-08-05T10:57:40', '1'), - ('551', '1960', '2006-02-16T02:30:53', '2005-08-22T01:45:18', '2005-08-28T21:24:18', '1'), - ('551', '1008', '2006-02-16T02:30:53', '2005-07-27T04:51:15', '2005-08-05T10:25:15', '2'), - ('551', '2048', '2006-02-16T02:30:53', '2005-07-30T15:35:39', '2005-08-02T10:15:39', '1'), - ('551', '2039', '2006-02-16T02:30:53', '2005-08-18T02:25:25', '2005-08-20T04:53:25', '2'), - ('551', '462', '2006-02-16T02:30:53', '2005-08-22T22:57:25', '2005-08-31T18:06:25', '1'), - ('551', '4006', '2006-02-16T02:30:53', '2005-05-31T00:53:25', '2005-06-04T01:21:25', '2'), - ('551', '2746', '2006-02-16T02:30:53', '2005-06-17T16:19:39', '2005-06-26T16:48:39', '1'), - ('551', '4054', '2006-02-16T02:30:53', '2005-08-19T02:47:19', '2005-08-20T00:30:19', '2'), - ('77', '2976', '2006-02-16T02:30:53', '2005-06-20T20:36:53', '2005-06-25T18:56:53', '1'), - ('77', '2793', '2006-02-16T02:30:53', '2005-06-18T12:54:18', '2005-06-26T07:23:18', '2'), - ('77', '144', '2006-02-16T02:30:53', '2005-06-16T14:11:24', '2005-06-22T15:26:24', '1'), - ('77', '2514', '2006-02-16T02:30:53', '2005-05-27T15:15:11', '2005-06-02T11:53:11', '1'), - ('77', '2854', '2006-02-16T02:30:53', '2005-08-02T04:41:12', '2005-08-05T05:36:12', '2'), - ('77', '2374', '2006-02-16T02:30:53', '2005-08-17T10:00:40', '2005-08-25T04:14:40', '2'), - ('77', '284', '2006-02-16T02:30:53', '2005-07-11T10:21:38', '2005-07-14T09:55:38', '2'), - ('77', '4375', '2006-02-16T02:30:53', '2005-07-30T03:01:07', '2005-08-06T22:50:07', '2'), - ('77', '1355', '2006-02-16T02:30:53', '2005-08-18T06:43:56', '2005-08-23T10:19:56', '2'), - ('77', '2785', '2006-02-16T02:30:53', '2005-08-01T00:09:33', '2005-08-05T04:12:33', '2'), - ('77', '943', '2006-02-16T02:30:53', '2005-08-02T00:52:34', '2005-08-08T00:30:34', '1'), - ('77', '1412', '2006-02-16T02:30:53', '2005-07-27T16:25:45', '2005-08-05T20:39:45', '1'), - ('77', '3716', '2006-02-16T02:30:53', '2005-07-28T04:24:07', '2005-08-03T22:49:07', '2'), - ('77', '3057', '2006-02-16T02:30:53', '2005-07-11T22:19:23', '2005-07-15T20:10:23', '2'), - ('77', '898', '2006-02-16T02:30:53', '2005-05-28T12:03:00', '2005-05-29T13:16:00', '1'), - ('77', '4505', '2006-02-16T02:30:53', '2005-08-22T21:34:00', '2005-08-29T18:59:00', '1'), - ('77', '230', '2006-02-16T02:30:53', '2005-08-02T21:48:09', '2005-08-06T18:37:09', '1'), - ('77', '3250', '2006-02-16T02:30:53', '2005-05-29T11:07:25', '2005-06-02T14:16:25', '1'), - ('77', '4363', '2006-02-16T02:30:53', '2005-07-08T22:05:41', '2005-07-09T23:09:41', '2'), - ('77', '928', '2006-02-16T02:30:53', '2005-05-28T08:54:06', '2005-06-05T05:54:06', '1'), - ('77', '3024', '2006-02-16T02:30:53', '2005-05-26T23:52:13', '2005-05-30T18:55:13', '1'), - ('77', '93', '2006-02-16T02:30:53', '2005-08-02T01:16:59', '2005-08-03T02:41:59', '2'), - ('77', '2732', '2006-02-16T02:30:53', '2005-06-21T02:48:21', '2005-06-23T04:43:21', '1'), - ('77', '3305', '2006-02-16T02:30:53', '2005-07-31T11:23:45', '2005-08-06T15:51:45', '1'), - ('77', '4318', '2006-02-16T02:30:53', '2005-06-18T19:29:21', '2005-06-26T22:27:21', '1'), - ('77', '3644', '2006-02-16T02:30:53', '2005-08-17T21:31:46', '2005-08-26T02:26:46', '2'), - ('77', '1794', '2006-02-16T02:30:53', '2005-08-20T11:17:45', '2005-08-29T13:25:45', '2'), - ('77', '1905', '2006-02-16T02:30:53', '2005-08-21T15:10:50', '2005-08-26T09:20:50', '2'), - ('325', '2175', '2006-02-16T02:30:53', '2005-07-10T13:34:26', '2005-07-15T10:01:26', '1'), - ('325', '1010', '2006-02-16T02:30:53', '2005-07-31T19:46:29', '2005-08-03T22:21:29', '1'), - ('325', '599', '2006-02-16T02:30:53', '2005-07-29T10:48:24', '2005-07-30T06:29:24', '2'), - ('325', '3121', '2006-02-16T02:30:53', '2005-06-18T23:39:22', '2005-06-21T19:23:22', '1'), - ('325', '4025', '2006-02-16T02:30:53', '2005-08-22T08:27:27', '2005-08-26T05:57:27', '2'), - ('325', '3856', '2006-02-16T02:30:53', '2005-08-01T04:55:34', '2005-08-02T05:18:34', '1'), - ('325', '2147', '2006-02-16T02:30:53', '2005-07-10T11:51:58', '2005-07-12T07:53:58', '2'), - ('325', '2622', '2006-02-16T02:30:53', '2005-06-18T23:12:13', '2005-06-20T04:19:13', '2'), - ('325', '689', '2006-02-16T02:30:53', '2005-07-28T03:20:26', '2005-08-02T05:48:26', '2'), - ('325', '2983', '2006-02-16T02:30:53', '2005-08-19T09:34:02', '2005-08-23T05:25:02', '2'), - ('325', '3254', '2006-02-16T02:30:53', '2005-07-09T23:10:49', '2005-07-18T04:30:49', '1'), - ('325', '1392', '2006-02-16T02:30:53', '2005-07-31T18:39:36', '2005-08-03T15:29:36', '2'), - ('325', '4144', '2006-02-16T02:30:53', '2005-08-21T19:59:33', '2005-08-30T19:40:33', '1'), - ('325', '833', '2006-02-16T02:30:53', '2005-07-11T08:32:23', '2005-07-17T08:43:23', '1'), - ('325', '4350', '2006-02-16T02:30:53', '2005-07-12T09:04:11', '2005-07-13T04:27:11', '1'), - ('325', '4231', '2006-02-16T02:30:53', '2005-08-21T12:23:20', '2005-08-27T06:26:20', '1'), - ('325', '1814', '2006-02-16T02:30:53', '2005-08-18T23:44:00', '2005-08-26T05:27:00', '2'), - ('325', '1555', '2006-02-16T02:30:53', '2005-08-01T07:57:16', '2005-08-04T11:44:16', '2'), - ('325', '65', '2006-02-16T02:30:53', '2005-06-19T19:34:45', '2005-06-27T14:49:45', '1'), - ('325', '4135', '2006-02-16T02:30:53', '2005-08-17T22:35:24', '2005-08-18T20:31:24', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['7223', '131', '3517', '14815', '440', '6666', '13265', '80', '13120', '13553', '3808', '16021', '6192', '8644', '9191', '7004', '1624', '11908', '12434', '14873', '6763', '14682', '9318', '8073', '14409', '4386', '1598', '14145', '8022', '8328', '7276', '5856', '5241', '3656', '8105', '8428', '15189', '12528', '2087', '8204', '9771', '11132', '3141', '5234', '1228', '9281', '8119', '9042', '10230', '486', '13643', '3830', '5836', '12710', '9536', '12500', '2618', '1918', '14972', '1162', '104', '2480', '8981', '4072', '7648', '11137', '1333', '8637', '12929', '2088', '5621', '14498', '10735', '4703', '4847', '4395', '864', '2395', '11401', '11766', '2373', '15605', '8937', '397', '8963', '14651', '1248', '14981', '14142', '15219', '12640', '8566', '1434', '7241', '7148', '12998', '6926', '5556', '12544', '9130']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('325', '2623', '2006-02-16T02:30:53', '2005-07-27T09:42:27', '2005-08-04T04:02:27', '1'), - ('325', '815', '2006-02-16T02:30:53', '2005-05-25T21:42:46', '2005-05-30T23:25:46', '2'), - ('314', '2762', '2006-02-16T02:30:53', '2005-07-06T00:52:35', '2005-07-08T20:10:35', '2'), - ('314', '1183', '2006-02-16T02:30:53', '2005-08-22T01:12:44', '2005-08-24T01:42:44', '2'), - ('314', '4452', '2006-02-16T02:30:53', '2005-05-27T18:00:35', '2005-05-29T16:15:35', '1'), - ('314', '3194', '2006-02-16T02:30:53', '2005-07-12T11:32:15', '2005-07-14T16:09:15', '2'), - ('314', '3933', '2006-02-16T02:30:53', '2005-08-19T17:29:00', '2005-08-20T12:59:00', '2'), - ('314', '2478', '2006-02-16T02:30:53', '2005-05-25T12:12:07', '2005-05-31T17:46:07', '2'), - ('314', '2273', '2006-02-16T02:30:53', '2005-08-19T11:47:38', '2005-08-26T08:20:38', '2'), - ('314', '4407', '2006-02-16T02:30:53', '2005-08-20T04:07:21', '2005-08-28T09:55:21', '1'), - ('314', '4339', '2006-02-16T02:30:53', '2005-07-06T15:15:35', '2005-07-07T16:10:35', '1'), - ('314', '3057', '2006-02-16T02:30:53', '2005-08-23T21:37:59', '2005-08-31T01:52:59', '1'), - ('314', '4573', '2006-02-16T02:30:53', '2005-07-11T11:44:41', '2005-07-19T10:12:41', '1'), - ('314', '4507', '2006-02-16T02:30:53', '2005-07-29T14:45:45', '2005-08-03T20:10:45', '2'), - ('314', '500', '2006-02-16T02:30:53', '2005-07-30T12:25:51', '2005-08-05T16:13:51', '1'), - ('314', '4416', '2006-02-16T02:30:53', '2005-07-27T01:36:05', '2005-08-03T23:46:05', '1'), - ('314', '1066', '2006-02-16T02:30:53', '2005-06-16T07:48:57', '2005-06-17T05:52:57', '1'), - ('314', '3390', '2006-02-16T02:30:53', '2005-08-17T15:43:09', '2005-08-24T14:32:09', '2'), - ('314', '3078', '2006-02-16T02:30:53', '2005-08-18T10:38:08', '2005-08-22T16:14:08', '2'), - ('314', '3533', '2006-02-16T02:30:53', '2005-08-22T03:31:06', '2005-08-31T05:34:06', '1'), - ('314', '3364', '2006-02-16T02:30:53', '2005-07-12T15:26:34', '2005-07-18T16:38:34', '2'), - ('314', '2974', '2006-02-16T02:30:53', '2005-08-21T20:25:57', '2005-08-28T00:42:57', '2'), - ('314', '2426', '2006-02-16T02:30:53', '2005-07-30T17:14:30', '2005-08-06T16:53:30', '1'), - ('314', '630', '2006-02-16T02:30:53', '2005-07-28T17:29:02', '2005-08-01T22:17:02', '2'), - ('314', '1161', '2006-02-16T02:30:53', '2005-08-21T10:53:35', '2005-08-25T10:40:35', '2'), - ('314', '499', '2006-02-16T02:30:53', '2005-07-07T20:55:19', '2005-07-10T21:51:19', '1'), - ('314', '4171', '2006-02-16T02:30:53', '2005-06-16T06:02:39', '2005-06-23T09:09:39', '1'), - ('314', '150', '2006-02-16T02:30:53', '2005-08-21T02:11:38', '2005-08-22T22:19:38', '2'), - ('314', '294', '2006-02-16T02:30:53', '2005-07-28T15:48:56', '2005-08-06T13:40:56', '1'), - ('314', '4454', '2006-02-16T02:30:53', '2005-07-29T04:06:24', '2005-08-03T22:24:24', '1'), - ('314', '1665', '2006-02-16T02:30:53', '2005-07-27T11:41:57', '2005-08-01T10:39:57', '1'), - ('314', '497', '2006-02-16T02:30:53', '2005-07-10T17:57:32', '2005-07-11T13:57:32', '1'), - ('314', '4079', '2006-02-16T02:30:53', '2005-07-09T13:19:14', '2005-07-11T14:32:14', '1'), - ('314', '4544', '2006-02-16T02:30:53', '2005-07-06T07:55:22', '2005-07-13T10:36:22', '2'), - ('314', '1316', '2006-02-16T02:30:53', '2005-07-28T18:59:46', '2005-07-29T22:51:46', '1'), - ('398', '2545', '2006-02-16T02:30:53', '2005-07-29T07:10:14', '2005-08-06T02:29:14', '2'), - ('398', '2559', '2006-02-16T02:30:53', '2005-08-22T15:56:42', '2005-08-29T12:20:42', '1'), - ('398', '3381', '2006-02-16T02:30:53', '2005-08-18T13:52:41', '2005-08-27T09:09:41', '2'), - ('398', '466', '2006-02-16T02:30:53', '2005-06-17T17:35:10', '2005-06-26T13:52:10', '1'), - ('398', '2472', '2006-02-16T02:30:53', '2005-07-28T23:18:29', '2005-08-02T04:49:29', '1'), - ('398', '4123', '2006-02-16T02:30:53', '2005-07-31T09:55:36', '2005-08-04T10:11:36', '2'), - ('398', '2212', '2006-02-16T02:30:53', '2005-08-02T09:14:09', '2005-08-08T06:39:09', '1'), - ('398', '1806', '2006-02-16T02:30:53', '2005-06-20T19:55:47', '2005-06-30T00:31:47', '1'), - ('398', '4182', '2006-02-16T02:30:53', '2005-07-09T12:44:47', '2005-07-17T10:02:47', '1'), - ('398', '4473', '2006-02-16T02:30:53', '2005-06-15T03:50:36', '2005-06-17T22:41:36', '1'), - ('398', '3086', '2006-02-16T02:30:53', '2005-07-30T15:15:51', '2005-08-05T12:58:51', '1'), - ('398', '1542', '2006-02-16T02:30:53', '2005-07-28T19:23:15', '2005-08-04T15:53:15', '2'), - ('398', '2770', '2006-02-16T02:30:53', '2005-07-30T06:33:55', '2005-08-04T09:31:55', '2'), - ('398', '76', '2006-02-16T02:30:53', '2005-08-01T01:49:36', '2005-08-05T01:29:36', '2'), - ('398', '1822', '2006-02-16T02:30:53', '2005-05-27T23:51:12', '2005-05-28T20:26:12', '1'), - ('398', '2443', '2006-02-16T02:30:53', '2005-08-20T07:42:24', '2005-08-26T09:13:24', '2'), - ('310', '553', '2006-02-16T02:30:53', '2005-07-06T16:01:16', '2005-07-15T19:35:16', '2'), - ('310', '1842', '2006-02-16T02:30:53', '2005-07-10T16:49:02', '2005-07-11T22:35:02', '2'), - ('310', '3011', '2006-02-16T02:30:53', '2005-08-18T21:02:50', '2005-08-26T15:07:50', '2'), - ('310', '2547', '2006-02-16T02:30:53', '2005-07-31T01:19:02', '2005-08-02T19:38:02', '1'), - ('310', '36', '2006-02-16T02:30:53', '2005-08-18T13:05:51', '2005-08-19T14:54:51', '2'), - ('310', '2465', '2006-02-16T02:30:53', '2005-06-19T08:03:01', '2005-06-24T03:23:01', '2'), - ('310', '3749', '2006-02-16T02:30:53', '2005-06-17T05:40:14', '2005-06-21T08:53:14', '2'), - ('310', '3422', '2006-02-16T02:30:53', '2005-08-22T06:53:21', '2005-08-29T02:25:21', '1'), - ('310', '987', '2006-02-16T02:30:53', '2005-06-14T23:09:38', '2005-06-23T22:00:38', '1'), - ('310', '4281', '2006-02-16T02:30:53', '2005-05-25T17:46:33', '2005-05-27T15:20:33', '1'), - ('310', '4078', '2006-02-16T02:30:53', '2005-06-18T21:04:09', '2005-06-22T16:24:09', '1'), - ('310', '4413', '2006-02-16T02:30:53', '2005-07-30T04:25:30', '2005-08-06T02:37:30', '1'), - ('310', '3130', '2006-02-16T02:30:53', '2005-07-07T04:48:02', '2005-07-12T10:32:02', '2'), - ('310', '797', '2006-02-16T02:30:53', '2005-07-28T01:35:33', '2005-08-04T06:21:33', '2'), - ('310', '2500', '2006-02-16T02:30:53', '2005-08-02T09:25:31', '2005-08-08T08:10:31', '1'), - ('310', '448', '2006-02-16T02:30:53', '2005-06-15T11:37:08', '2005-06-16T10:13:08', '2'), - ('310', '1069', '2006-02-16T02:30:53', '2005-07-29T14:30:11', '2005-08-04T14:00:11', '1'), - ('310', '1531', '2006-02-16T02:30:53', '2005-08-19T05:05:23', '2005-08-25T04:37:23', '1'), - ('310', '506', '2006-02-16T02:30:53', '2005-06-17T17:35:30', '2005-06-23T20:13:30', '2'), - ('310', '552', '2006-02-16T02:30:53', '2005-07-10T05:34:10', '2005-07-14T02:49:10', '1'), - ('544', '3971', '2006-02-16T02:30:53', '2005-08-21T14:10:44', '2005-08-23T08:29:44', '1'), - ('544', '4061', '2006-02-16T02:30:53', '2005-08-01T19:29:45', '2005-08-02T19:50:45', '2'), - ('544', '2859', '2006-02-16T02:30:53', '2005-07-08T11:44:56', '2005-07-13T09:17:56', '1'), - ('544', '3397', '2006-02-16T02:30:53', '2005-07-08T18:29:13', '2005-07-15T18:12:13', '2'), - ('544', '360', '2006-02-16T02:30:53', '2005-07-07T21:13:22', '2005-07-08T22:59:22', '2'), - ('544', '2777', '2006-02-16T02:30:53', '2005-05-30T03:27:17', '2005-06-06T08:28:17', '1'), - ('544', '899', '2006-02-16T02:30:53', '2005-06-18T15:45:15', '2005-06-27T19:11:15', '2'), - ('544', '1799', '2006-02-16T02:30:53', '2005-08-02T19:05:06', '2005-08-09T22:34:06', '1'), - ('544', '2999', '2006-02-16T02:30:53', '2005-08-17T09:58:40', '2005-08-21T04:59:40', '1'), - ('544', '2780', '2006-02-16T02:30:53', '2005-06-18T14:37:57', '2005-06-23T19:29:57', '2'), - ('544', '3152', '2006-02-16T02:30:53', '2005-08-23T06:48:47', '2005-08-28T06:09:47', '1'), - ('544', '2406', '2006-02-16T02:30:53', '2005-07-30T02:53:21', '2005-08-08T03:33:21', '2'), - ('544', '4193', '2006-02-16T02:30:53', '2005-05-27T12:29:02', '2005-05-28T17:36:02', '2'), - ('544', '100', '2006-02-16T02:30:53', '2005-07-30T03:46:26', '2005-08-08T06:12:26', '1'), - ('544', '4037', '2006-02-16T02:30:53', '2005-08-21T19:31:09', '2005-08-28T14:26:09', '2'), - ('544', '3878', '2006-02-16T02:30:53', '2005-06-15T05:33:52', '2005-06-19T06:56:52', '2'), - ('544', '1239', '2006-02-16T02:30:53', '2005-08-22T07:19:05', '2005-08-26T03:08:05', '2'), - ('544', '1479', '2006-02-16T02:30:53', '2005-08-21T02:07:43', '2005-08-23T02:37:43', '2'), - ('544', '3313', '2006-02-16T02:30:53', '2005-08-22T17:00:31', '2005-08-31T20:16:31', '1'), - ('544', '1715', '2006-02-16T02:30:53', '2005-08-18T18:14:49', '2005-08-24T21:25:49', '1'), - ('544', '2011', '2006-02-16T02:30:53', '2005-07-29T11:35:46', '2005-07-30T13:50:46', '1'), - ('544', '4228', '2006-02-16T02:30:53', '2005-06-15T18:30:46', '2005-06-24T17:51:46', '1'), - ('354', '2433', '2006-02-16T02:30:53', '2005-07-27T10:25:49', '2005-07-28T05:30:49', '2'), - ('354', '1783', '2006-02-16T02:30:53', '2005-07-27T07:04:09', '2005-08-03T10:20:09', '2'), - ('354', '2301', '2006-02-16T02:30:53', '2005-08-19T07:32:16', '2005-08-24T01:56:16', '2'), - ('354', '1276', '2006-02-16T02:30:53', '2005-07-26T22:52:45', '2005-07-28T18:32:45', '1'), - ('354', '4483', '2006-02-16T02:30:53', '2005-07-10T03:10:17', '2005-07-14T02:47:17', '1'), - ('354', '3783', '2006-02-16T02:30:53', '2005-08-18T14:25:51', '2005-08-26T18:42:51', '1'), - ('354', '1715', '2006-02-16T02:30:53', '2005-07-30T09:55:10', '2005-08-04T08:57:10', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['12243', '402', '11782', '4449', '14245', '14840', '140', '5873', '6054', '8477', '8321', '4034', '15956', '1491', '12759', '8921', '3139', '5354', '4745', '10420', '2275', '158', '6939', '2769', '7235', '8609', '6838', '14212', '3821', '13128', '3831', '4107', '4823', '6139', '7222', '3012', '8217', '9474', '11634', '15709', '13550', '13696', '11022', '14695', '1872', '3847', '13232', '7541', '13263', '3533', '8549', '2477', '15686', '6420', '4068', '10930', '521', '15366', '12696', '14524', '10695', '3797', '1548', '15966', '13337', '6315', '11619', '15053', '2046', '9866', '2641', '2487', '5945', '919', '13734', '8586', '5591', '9113', '7837', '910', '5570', '5463', '15200', '15202', '10802', '1292', '13127', '7959', '12897', '6606', '8069', '1458', '6347', '14257', '8388', '10562', '1745', '2898', '8696', '4915']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('354', '1829', '2006-02-16T02:30:53', '2005-08-18T03:38:54', '2005-08-27T06:56:54', '2'), - ('354', '461', '2006-02-16T02:30:53', '2005-05-27T13:17:18', '2005-05-30T08:53:18', '2'), - ('354', '4098', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('354', '2813', '2006-02-16T02:30:53', '2005-07-07T23:18:58', '2005-07-15T20:40:58', '2'), - ('354', '975', '2006-02-16T02:30:53', '2005-08-21T05:30:54', '2005-08-26T07:02:54', '1'), - ('354', '1240', '2006-02-16T02:30:53', '2005-08-22T01:58:42', '2005-08-29T22:32:42', '2'), - ('354', '655', '2006-02-16T02:30:53', '2005-05-25T23:34:22', '2005-05-27T01:10:22', '1'), - ('354', '3151', '2006-02-16T02:30:53', '2005-07-10T19:02:10', '2005-07-14T19:13:10', '2'), - ('354', '1176', '2006-02-16T02:30:53', '2005-07-11T03:58:39', '2005-07-13T23:08:39', '1'), - ('354', '3571', '2006-02-16T02:30:53', '2005-07-29T08:40:36', '2005-08-06T08:28:36', '2'), - ('354', '1875', '2006-02-16T02:30:53', '2005-07-29T03:50:54', '2005-08-01T02:08:54', '1'), - ('354', '1666', '2006-02-16T02:30:53', '2005-07-07T02:36:33', '2005-07-09T08:32:33', '2'), - ('354', '2763', '2006-02-16T02:30:53', '2005-08-23T19:19:21', '2005-08-25T22:15:21', '2'), - ('354', '848', '2006-02-16T02:30:53', '2005-06-15T21:48:18', '2005-06-20T16:40:18', '1'), - ('354', '4193', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('354', '1016', '2006-02-16T02:30:53', '2005-07-30T02:04:02', '2005-07-31T06:18:02', '1'), - ('354', '3474', '2006-02-16T02:30:53', '2005-06-20T19:44:45', '2005-06-23T16:24:45', '1'), - ('354', '951', '2006-02-16T02:30:53', '2005-07-09T18:04:33', '2005-07-15T18:19:33', '1'), - ('354', '1351', '2006-02-16T02:30:53', '2005-07-08T13:45:09', '2005-07-12T18:54:09', '1'), - ('354', '3490', '2006-02-16T02:30:53', '2005-08-01T08:13:53', '2005-08-06T08:05:53', '2'), - ('354', '2805', '2006-02-16T02:30:53', '2005-06-18T06:31:29', '2005-06-24T10:04:29', '2'), - ('354', '2395', '2006-02-16T02:30:53', '2005-05-26T01:27:11', '2005-06-03T00:30:11', '2'), - ('354', '278', '2006-02-16T02:30:53', '2005-07-26T23:17:51', '2005-08-03T21:12:51', '2'), - ('354', '1222', '2006-02-16T02:30:53', '2005-06-19T17:52:14', '2005-06-26T20:30:14', '2'), - ('354', '1261', '2006-02-16T02:30:53', '2005-07-27T10:09:30', '2005-08-05T11:44:30', '2'), - ('354', '3997', '2006-02-16T02:30:53', '2005-07-29T13:19:25', '2005-08-06T08:33:25', '2'), - ('354', '3492', '2006-02-16T02:30:53', '2005-07-12T19:01:30', '2005-07-17T23:42:30', '1'), - ('354', '4540', '2006-02-16T02:30:53', '2005-08-21T04:29:26', '2005-08-24T00:46:26', '2'), - ('354', '4385', '2006-02-16T02:30:53', '2005-07-06T15:36:20', '2005-07-11T20:04:20', '1'), - ('206', '485', '2006-02-16T02:30:53', '2005-08-19T12:04:16', '2005-08-26T16:06:16', '2'), - ('206', '1338', '2006-02-16T02:30:53', '2005-07-06T16:06:35', '2005-07-08T15:14:35', '2'), - ('206', '4232', '2006-02-16T02:30:53', '2005-07-07T06:36:32', '2005-07-14T03:36:32', '1'), - ('206', '155', '2006-02-16T02:30:53', '2005-07-08T17:28:54', '2005-07-11T23:10:54', '1'), - ('206', '3065', '2006-02-16T02:30:53', '2005-07-11T08:39:33', '2005-07-17T08:00:33', '2'), - ('206', '2330', '2006-02-16T02:30:53', '2005-07-27T09:38:43', '2005-07-28T06:25:43', '1'), - ('206', '1392', '2006-02-16T02:30:53', '2005-06-20T10:43:13', '2005-06-28T10:07:13', '2'), - ('206', '3747', '2006-02-16T02:30:53', '2005-07-28T23:44:13', '2005-08-03T21:27:13', '2'), - ('206', '3771', '2006-02-16T02:30:53', '2005-07-30T23:05:44', '2005-08-05T23:46:44', '1'), - ('206', '2576', '2006-02-16T02:30:53', '2005-08-17T04:31:49', '2005-08-21T02:51:49', '1'), - ('206', '346', '2006-02-16T02:30:53', '2005-08-23T10:36:00', '2005-08-28T06:18:00', '2'), - ('206', '208', '2006-02-16T02:30:53', '2005-08-20T03:58:51', '2005-08-28T00:45:51', '2'), - ('206', '1279', '2006-02-16T02:30:53', '2005-08-20T09:16:15', '2005-08-21T03:33:15', '1'), - ('206', '827', '2006-02-16T02:30:53', '2005-08-02T05:35:03', '2005-08-09T10:20:03', '2'), - ('206', '412', '2006-02-16T02:30:53', '2005-08-21T20:46:47', '2005-08-22T22:25:47', '2'), - ('206', '3596', '2006-02-16T02:30:53', '2005-06-17T02:27:03', '2005-06-20T22:41:03', '2'), - ('206', '782', '2006-02-16T02:30:53', '2005-07-06T16:44:41', '2005-07-07T21:54:41', '2'), - ('206', '2370', '2006-02-16T02:30:53', '2005-08-19T16:13:32', '2005-08-28T14:42:32', '2'), - ('206', '4100', '2006-02-16T02:30:53', '2005-07-27T21:40:05', '2005-07-29T16:13:05', '1'), - ('206', '214', '2006-02-16T02:30:53', '2005-08-19T17:26:55', '2005-08-28T20:07:55', '2'), - ('206', '2028', '2006-02-16T02:30:53', '2005-07-06T01:26:44', '2005-07-14T21:37:44', '1'), - ('206', '1866', '2006-02-16T02:30:53', '2005-07-29T11:12:13', '2005-08-06T06:04:13', '2'), - ('206', '2510', '2006-02-16T02:30:53', '2005-06-18T20:58:46', '2005-06-22T21:49:46', '1'), - ('206', '2041', '2006-02-16T02:30:53', '2005-08-23T09:42:21', '2005-08-29T12:22:21', '1'), - ('206', '4443', '2006-02-16T02:30:53', '2005-07-11T23:38:49', '2005-07-17T17:46:49', '2'), - ('206', '4152', '2006-02-16T02:30:53', '2005-07-07T04:34:38', '2005-07-11T09:16:38', '2'), - ('206', '2027', '2006-02-16T02:30:53', '2005-08-02T02:38:07', '2005-08-08T05:15:07', '2'), - ('374', '2397', '2006-02-16T02:30:53', '2005-05-28T03:32:22', '2005-05-28T22:37:22', '1'), - ('374', '1453', '2006-02-16T02:30:53', '2005-08-22T21:45:57', '2005-08-30T16:35:57', '1'), - ('374', '3989', '2006-02-16T02:30:53', '2005-08-18T20:13:08', '2005-08-19T18:02:08', '2'), - ('374', '4409', '2006-02-16T02:30:53', '2005-08-21T15:05:27', '2005-08-29T12:07:27', '2'), - ('374', '3612', '2006-02-16T02:30:53', '2005-08-01T18:16:20', '2005-08-03T12:21:20', '2'), - ('374', '1047', '2006-02-16T02:30:53', '2005-07-06T14:54:52', '2005-07-10T09:50:52', '2'), - ('374', '2094', '2006-02-16T02:30:53', '2005-06-16T01:43:33', '2005-06-23T22:04:33', '2'), - ('374', '4472', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('374', '3584', '2006-02-16T02:30:53', '2005-08-19T20:06:57', '2005-08-20T16:31:57', '1'), - ('374', '608', '2006-02-16T02:30:53', '2005-07-11T18:42:49', '2005-07-12T23:19:49', '2'), - ('374', '3652', '2006-02-16T02:30:53', '2005-08-17T04:03:26', '2005-08-22T03:07:26', '1'), - ('374', '1065', '2006-02-16T02:30:53', '2005-08-22T10:13:09', '2005-08-28T12:42:09', '2'), - ('374', '872', '2006-02-16T02:30:53', '2005-06-17T14:39:50', '2005-06-24T16:02:50', '1'), - ('374', '3555', '2006-02-16T02:30:53', '2005-07-31T13:13:50', '2005-08-07T15:11:50', '1'), - ('374', '231', '2006-02-16T02:30:53', '2005-06-19T09:38:33', '2005-06-22T09:55:33', '1'), - ('374', '3683', '2006-02-16T02:30:53', '2005-06-18T21:32:54', '2005-06-23T21:11:54', '2'), - ('374', '427', '2006-02-16T02:30:53', '2005-07-10T22:52:42', '2005-07-11T21:52:42', '1'), - ('374', '4052', '2006-02-16T02:30:53', '2005-05-30T11:35:06', '2005-06-02T13:16:06', '2'), - ('374', '4561', '2006-02-16T02:30:53', '2005-08-20T10:29:57', '2005-08-25T14:41:57', '2'), - ('374', '2752', '2006-02-16T02:30:53', '2005-07-29T12:16:34', '2005-08-07T06:48:34', '1'), - ('374', '378', '2006-02-16T02:30:53', '2005-07-10T04:25:03', '2005-07-16T04:21:03', '1'), - ('374', '3903', '2006-02-16T02:30:53', '2005-07-30T09:09:03', '2005-07-31T03:13:03', '1'), - ('374', '115', '2006-02-16T02:30:53', '2005-07-28T08:58:32', '2005-07-29T14:11:32', '1'), - ('374', '2601', '2006-02-16T02:30:53', '2005-05-30T10:46:16', '2005-06-04T13:32:16', '1'), - ('374', '2013', '2006-02-16T02:30:53', '2005-07-10T03:46:47', '2005-07-17T09:28:47', '1'), - ('374', '601', '2006-02-16T02:30:53', '2005-07-09T22:57:02', '2005-07-11T03:10:02', '1'), - ('374', '1000', '2006-02-16T02:30:53', '2005-08-22T16:22:53', '2005-08-24T10:25:53', '2'), - ('374', '2119', '2006-02-16T02:30:53', '2005-08-22T16:26:53', '2005-08-23T13:49:53', '2'), - ('178', '3998', '2006-02-16T02:30:53', '2005-08-01T22:18:32', '2005-08-10T18:41:32', '2'), - ('178', '4535', '2006-02-16T02:30:53', '2005-06-15T09:03:52', '2005-06-21T07:53:52', '1'), - ('178', '2582', '2006-02-16T02:30:53', '2005-08-19T12:04:03', '2005-08-27T13:56:03', '1'), - ('178', '1549', '2006-02-16T02:30:53', '2005-07-28T13:43:20', '2005-08-02T12:13:20', '2'), - ('178', '1512', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('178', '2805', '2006-02-16T02:30:53', '2005-07-12T08:03:40', '2005-07-13T09:05:40', '1'), - ('178', '2822', '2006-02-16T02:30:53', '2005-07-28T17:23:46', '2005-07-30T16:19:46', '1'), - ('178', '3546', '2006-02-16T02:30:53', '2005-06-15T20:24:05', '2005-06-21T01:22:05', '1'), - ('178', '3160', '2006-02-16T02:30:53', '2005-07-11T20:18:53', '2005-07-16T20:45:53', '1'), - ('178', '3830', '2006-02-16T02:30:53', '2005-08-21T05:52:57', '2005-08-29T03:18:57', '2'), - ('178', '770', '2006-02-16T02:30:53', '2005-07-29T05:48:15', '2005-08-05T06:24:15', '2'), - ('178', '1947', '2006-02-16T02:30:53', '2005-08-01T13:05:52', '2005-08-02T17:05:52', '1'), - ('178', '2812', '2006-02-16T02:30:53', '2005-06-16T16:41:16', '2005-06-23T21:02:16', '2'), - ('178', '3106', '2006-02-16T02:30:53', '2005-06-20T02:38:06', '2005-06-29T08:18:06', '2'), - ('178', '2553', '2006-02-16T02:30:53', '2005-07-29T16:45:18', '2005-08-07T18:51:18', '1'), - ('178', '2772', '2006-02-16T02:30:53', '2005-07-08T21:31:22', '2005-07-13T16:45:22', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['1568', '2124', '15323', '9311', '2844', '6554', '11319', '11884', '8287', '14314', '9879', '5094', '14104', '6566', '12049', '10125', '9004', '11927', '2293', '5057', '12727', '5984', '5015', '4339', '2163', '746', '9452', '1864', '10645', '7181', '9637', '2535', '14111', '2292', '11811', '6353', '15777', '1', '12094', '7728', '2982', '9724', '10568', '12777', '15574', '1630', '4485', '13001', '5072', '10522', '12206', '9494', '3882', '7413', '5042', '11190', '5826', '1108', '7011', '15774', '2138', '14497', '2687', '183', '5537', '8581', '13130', '12874', '12247', '13045', '5930', '2082', '8216', '12148', '1390', '1285', '5550', '5080', '11665', '4360', '6277', '4828', '2740', '7832', '7073', '5620', '14998', '456', '5792', '13495', '8938', '271', '11203', '3595', '5497', '5919', '6158', '2521', '11245', '8494']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('178', '635', '2006-02-16T02:30:53', '2005-06-16T03:14:01', '2005-06-19T21:17:01', '2'), - ('178', '1273', '2006-02-16T02:30:53', '2005-06-17T20:49:14', '2005-06-23T17:44:14', '1'), - ('178', '1153', '2006-02-16T02:30:53', '2005-08-22T20:22:40', '2005-08-26T00:35:40', '1'), - ('178', '1432', '2006-02-16T02:30:53', '2005-07-30T16:58:31', '2005-08-07T15:23:31', '1'), - ('178', '4452', '2006-02-16T02:30:53', '2005-06-19T22:40:12', '2005-06-24T03:58:12', '2'), - ('178', '2741', '2006-02-16T02:30:53', '2005-07-12T05:07:26', '2005-07-21T06:06:26', '2'), - ('178', '4069', '2006-02-16T02:30:53', '2005-08-02T16:10:09', '2005-08-09T11:21:09', '2'), - ('178', '797', '2006-02-16T02:30:53', '2005-08-17T14:43:23', '2005-08-25T15:38:23', '1'), - ('178', '812', '2006-02-16T02:30:53', '2005-07-29T02:03:58', '2005-08-07T02:11:58', '1'), - ('178', '4115', '2006-02-16T02:30:53', '2005-08-21T07:50:14', '2005-08-24T10:47:14', '2'), - ('178', '1935', '2006-02-16T02:30:53', '2005-07-31T13:45:32', '2005-08-07T17:12:32', '1'), - ('178', '4451', '2006-02-16T02:30:53', '2005-07-09T05:59:47', '2005-07-18T05:34:47', '2'), - ('178', '912', '2006-02-16T02:30:53', '2005-08-21T00:37:44', '2005-08-21T22:55:44', '2'), - ('178', '1822', '2006-02-16T02:30:53', '2005-07-12T05:42:53', '2005-07-19T01:23:53', '2'), - ('178', '2433', '2006-02-16T02:30:53', '2005-08-17T20:53:27', '2005-08-26T19:45:27', '2'), - ('178', '493', '2006-02-16T02:30:53', '2005-07-31T21:33:03', '2005-08-01T19:10:03', '1'), - ('178', '3775', '2006-02-16T02:30:53', '2005-07-30T05:04:27', '2005-07-31T00:49:27', '1'), - ('178', '3134', '2006-02-16T02:30:53', '2005-08-17T16:25:03', '2005-08-23T16:41:03', '1'), - ('178', '3209', '2006-02-16T02:30:53', '2005-06-18T07:45:03', '2005-06-24T08:12:03', '1'), - ('178', '1076', '2006-02-16T02:30:53', '2005-07-09T04:20:29', '2005-07-14T23:59:29', '1'), - ('178', '15', '2006-02-16T02:30:53', '2005-08-18T21:45:15', '2005-08-24T15:52:15', '1'), - ('178', '2801', '2006-02-16T02:30:53', '2005-07-11T00:44:36', '2005-07-15T00:04:36', '1'), - ('178', '1564', '2006-02-16T02:30:53', '2005-07-09T01:54:24', '2005-07-12T20:07:24', '1'), - ('130', '3215', '2006-02-16T02:30:53', '2005-07-07T18:41:42', '2005-07-08T13:00:42', '1'), - ('130', '2600', '2006-02-16T02:30:53', '2005-06-17T23:46:16', '2005-06-22T22:48:16', '2'), - ('130', '4272', '2006-02-16T02:30:53', '2005-05-29T09:25:10', '2005-06-02T04:20:10', '2'), - ('130', '3178', '2006-02-16T02:30:53', '2005-07-30T22:19:16', '2005-08-04T19:26:16', '1'), - ('130', '1815', '2006-02-16T02:30:53', '2005-06-17T01:39:47', '2005-06-24T19:39:47', '2'), - ('130', '3864', '2006-02-16T02:30:53', '2005-08-01T15:52:01', '2005-08-09T18:58:01', '1'), - ('130', '2788', '2006-02-16T02:30:53', '2005-07-27T08:14:34', '2005-07-28T03:09:34', '1'), - ('130', '3013', '2006-02-16T02:30:53', '2005-07-31T05:18:54', '2005-08-03T01:23:54', '2'), - ('130', '901', '2006-02-16T02:30:53', '2005-06-19T01:39:04', '2005-06-28T01:33:04', '2'), - ('130', '1294', '2006-02-16T02:30:53', '2005-08-21T00:59:01', '2005-08-22T20:43:01', '2'), - ('130', '173', '2006-02-16T02:30:53', '2005-06-18T07:37:48', '2005-06-20T02:45:48', '2'), - ('130', '195', '2006-02-16T02:30:53', '2005-08-17T11:59:18', '2005-08-18T09:13:18', '2'), - ('130', '699', '2006-02-16T02:30:53', '2005-07-11T20:48:56', '2005-07-21T00:11:56', '1'), - ('130', '4241', '2006-02-16T02:30:53', '2005-08-23T13:29:08', '2005-08-27T18:50:08', '2'), - ('130', '367', '2006-02-15T21:30:53', '2005-05-24T22:53:30', '2005-05-26T22:04:30', '1'), - ('130', '1050', '2006-02-16T02:30:53', '2005-08-17T22:31:04', '2005-08-23T22:45:04', '1'), - ('130', '492', '2006-02-16T02:30:53', '2005-07-28T04:56:33', '2005-07-31T07:54:33', '1'), - ('130', '2574', '2006-02-16T02:30:53', '2005-06-20T08:38:29', '2005-06-28T13:21:29', '1'), - ('130', '518', '2006-02-16T02:30:53', '2005-07-31T08:33:08', '2005-08-08T04:50:08', '1'), - ('130', '3009', '2006-02-16T02:30:53', '2005-08-01T13:17:28', '2005-08-08T17:04:28', '1'), - ('130', '3467', '2006-02-16T02:30:53', '2005-08-18T23:39:22', '2005-08-27T20:28:22', '1'), - ('130', '3253', '2006-02-16T02:30:53', '2005-08-23T05:29:32', '2005-09-01T01:25:32', '2'), - ('130', '2413', '2006-02-16T02:30:53', '2005-06-16T07:55:01', '2005-06-19T06:38:01', '1'), - ('130', '2614', '2006-02-16T02:30:53', '2005-07-08T01:07:54', '2005-07-16T03:19:54', '2'), - ('254', '2505', '2006-02-16T02:30:53', '2005-08-19T07:36:44', '2005-08-22T13:06:44', '1'), - ('254', '94', '2006-02-16T02:30:53', '2005-07-09T05:01:58', '2005-07-18T08:17:58', '2'), - ('254', '4159', '2006-02-16T02:30:53', '2005-08-01T11:48:51', '2005-08-05T12:40:51', '1'), - ('254', '3275', '2006-02-16T02:30:53', '2005-08-18T02:22:20', '2005-08-23T05:36:20', '1'), - ('254', '3799', '2006-02-16T02:30:53', '2005-07-30T23:52:46', '2005-08-05T23:13:46', '2'), - ('254', '788', '2006-02-16T02:30:53', '2005-07-06T18:38:21', '2005-07-09T14:55:21', '1'), - ('254', '2909', '2006-02-16T02:30:53', '2005-07-27T16:45:40', '2005-07-31T12:02:40', '1'), - ('254', '3609', '2006-02-16T02:30:53', '2005-07-09T03:20:30', '2005-07-15T07:22:30', '1'), - ('254', '922', '2006-02-16T02:30:53', '2005-08-02T11:21:34', '2005-08-05T05:23:34', '1'), - ('254', '4104', '2006-02-16T02:30:53', '2005-07-10T16:21:02', '2005-07-17T21:08:02', '1'), - ('254', '2562', '2006-02-16T02:30:53', '2005-05-31T15:05:12', '2005-06-09T19:48:12', '2'), - ('254', '4082', '2006-02-16T02:30:53', '2005-07-27T01:58:34', '2005-07-28T06:11:34', '1'), - ('254', '1273', '2006-02-16T02:30:53', '2005-08-23T13:25:08', '2005-08-28T10:08:08', '2'), - ('254', '512', '2006-02-16T02:30:53', '2005-06-17T21:28:14', '2005-06-22T01:16:14', '2'), - ('254', '3240', '2006-02-16T02:30:53', '2005-08-21T14:09:47', '2005-08-22T11:10:47', '2'), - ('254', '3152', '2006-02-16T02:30:53', '2005-06-19T12:46:52', '2005-06-23T06:58:52', '2'), - ('254', '2877', '2006-02-16T02:30:53', '2005-05-26T05:01:18', '2005-06-01T09:04:18', '1'), - ('254', '1781', '2006-02-16T02:30:53', '2005-07-10T02:35:41', '2005-07-13T07:11:41', '2'), - ('254', '2102', '2006-02-16T02:30:53', '2005-07-29T12:02:06', '2005-08-02T10:32:06', '2'), - ('254', '2006', '2006-02-16T02:30:53', '2005-08-19T12:06:42', '2005-08-23T12:08:42', '1'), - ('254', '848', '2006-02-16T02:30:53', '2005-08-19T03:07:57', '2005-08-22T22:42:57', '2'), - ('254', '2264', '2006-02-16T02:30:53', '2005-08-18T03:51:51', '2005-08-24T05:36:51', '2'), - ('254', '389', '2006-02-16T02:30:53', '2005-08-19T09:17:35', '2005-08-23T12:04:35', '1'), - ('254', '2338', '2006-02-16T02:30:53', '2005-07-10T21:59:32', '2005-07-11T18:40:32', '2'), - ('254', '434', '2006-02-16T02:30:53', '2005-06-17T17:13:32', '2005-06-19T16:16:32', '1'), - ('254', '2211', '2006-02-16T02:30:53', '2005-07-28T23:43:59', '2005-08-06T05:05:59', '1'), - ('254', '2409', '2006-02-16T02:30:53', '2005-08-18T00:13:15', '2005-08-20T01:27:15', '2'), - ('254', '4502', '2006-02-16T02:30:53', '2005-06-15T16:06:29', '2005-06-19T13:11:29', '1'), - ('254', '1054', '2006-02-16T02:30:53', '2005-06-15T08:33:06', '2005-06-19T07:36:06', '1'), - ('254', '1905', '2006-02-16T02:30:53', '2005-07-10T02:58:35', '2005-07-16T02:38:35', '2'), - ('254', '635', '2006-02-16T02:30:53', '2005-07-09T05:23:55', '2005-07-11T05:56:55', '2'), - ('254', '334', '2006-02-16T02:30:53', '2005-08-17T05:36:57', '2005-08-23T01:38:57', '1'), - ('92', '1811', '2006-02-16T02:30:53', '2005-07-07T19:31:12', '2005-07-10T23:11:12', '2'), - ('92', '4023', '2006-02-16T02:30:53', '2005-07-11T16:19:01', '2005-07-18T21:00:01', '2'), - ('92', '1100', '2006-02-16T02:30:53', '2005-07-08T17:52:29', '2005-07-11T14:35:29', '1'), - ('92', '1534', '2006-02-16T02:30:53', '2005-06-19T15:59:04', '2005-06-28T12:18:04', '2'), - ('92', '284', '2006-02-16T02:30:53', '2005-07-28T08:46:11', '2005-08-04T06:55:11', '1'), - ('92', '3859', '2006-02-16T02:30:53', '2005-07-27T04:03:26', '2005-08-03T05:50:26', '1'), - ('92', '2980', '2006-02-16T02:30:53', '2005-07-10T05:30:52', '2005-07-16T04:13:52', '1'), - ('92', '3852', '2006-02-16T02:30:53', '2005-08-22T07:53:14', '2005-08-24T03:46:14', '2'), - ('92', '1699', '2006-02-16T02:30:53', '2005-05-27T19:50:06', '2005-06-02T22:14:06', '1'), - ('92', '4234', '2006-02-16T02:30:53', '2005-07-10T14:22:19', '2005-07-19T09:08:19', '1'), - ('92', '3881', '2006-02-16T02:30:53', '2005-08-20T01:40:25', '2005-08-23T06:32:25', '2'), - ('92', '4031', '2006-02-16T02:30:53', '2005-07-30T02:56:08', '2005-07-31T23:08:08', '2'), - ('92', '2388', '2006-02-16T02:30:53', '2005-05-26T16:22:01', '2005-06-03T17:30:01', '2'), - ('92', '4520', '2006-02-16T02:30:53', '2005-08-02T11:52:41', '2005-08-10T15:52:41', '2'), - ('92', '1431', '2006-02-16T02:30:53', '2005-07-06T04:59:49', '2005-07-15T06:26:49', '2'), - ('92', '4473', '2006-02-16T02:30:53', '2005-07-10T00:23:23', '2005-07-16T03:54:23', '1'), - ('92', '164', '2006-02-16T02:30:53', '2005-07-10T21:32:14', '2005-07-12T16:47:14', '1'), - ('92', '3954', '2006-02-16T02:30:53', '2005-07-11T09:50:24', '2005-07-13T04:49:24', '2'), - ('92', '132', '2006-02-16T02:30:53', '2005-06-19T00:41:08', '2005-06-22T00:40:08', '1'), - ('92', '2609', '2006-02-16T02:30:53', '2005-08-02T13:33:50', '2005-08-04T10:20:50', '2'), - ('92', '3524', '2006-02-16T02:30:53', '2005-07-29T09:04:32', '2005-07-31T10:30:32', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['11849', '13020', '14798', '2084', '3716', '13620', '9240', '1051', '13750', '6688', '10683', '4092', '13418', '13987', '699', '1968', '124', '3152', '9525', '14360', '2704', '4994', '10208', '2725', '4905', '434', '5347', '15746', '421', '1448', '3725', '11613', '11801', '3450', '5865', '8091', '3804', '14477', '1054', '3502', '7962', '14577', '752', '11196', '12991', '5137', '6755', '15741', '9492', '6747', '9', '4730', '13177', '10032', '16007', '11779', '4691', '13015', '2167', '535', '7536', '10135', '6125', '2787', '6991', '7760', '5871', '14231', '413', '614', '11491', '4522', '7929', '970', '2152', '15515', '2881', '10374', '3962', '10745', '3057', '12391', '3209', '6256', '3985', '13365', '8647', '4868', '2517', '10051', '16046', '8796', '13335', '12477', '6241', '3819', '15739', '3445', '13583', '13520']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('92', '1191', '2006-02-16T02:30:53', '2005-08-17T13:24:55', '2005-08-22T12:50:55', '2'), - ('92', '4501', '2006-02-16T02:30:53', '2005-08-19T08:07:50', '2005-08-28T11:42:50', '1'), - ('92', '7', '2006-02-16T02:30:53', '2005-08-22T00:44:08', '2005-08-27T02:18:08', '2'), - ('92', '428', '2006-02-16T02:30:53', '2005-06-17T17:17:19', '2005-06-22T14:57:19', '1'), - ('92', '3271', '2006-02-16T02:30:53', '2005-07-06T10:52:32', '2005-07-14T08:45:32', '2'), - ('92', '2361', '2006-02-16T02:30:53', '2005-08-20T06:41:27', '2005-08-24T11:02:27', '1'), - ('92', '587', '2006-02-16T02:30:53', '2005-07-30T13:57:54', '2005-08-03T12:23:54', '2'), - ('246', '1025', '2006-02-16T02:30:53', '2005-05-31T07:02:09', '2005-06-03T01:32:09', '1'), - ('246', '3363', '2006-02-16T02:30:53', '2005-08-20T11:11:42', '2005-08-29T16:16:42', '2'), - ('246', '2377', '2006-02-16T02:30:53', '2005-07-12T12:22:12', '2005-07-14T14:05:12', '1'), - ('246', '244', '2006-02-16T02:30:53', '2005-08-01T17:33:03', '2005-08-04T23:12:03', '1'), - ('246', '1721', '2006-02-16T02:30:53', '2005-07-07T05:54:18', '2005-07-16T09:14:18', '1'), - ('246', '2113', '2006-02-16T02:30:53', '2005-08-19T22:53:56', '2005-08-28T02:05:56', '2'), - ('246', '1443', '2006-02-16T02:30:53', '2005-08-20T19:19:30', '2005-08-23T15:37:30', '2'), - ('246', '130', '2006-02-16T02:30:53', '2005-05-29T02:11:44', '2005-06-04T20:23:44', '2'), - ('246', '1139', '2006-02-16T02:30:53', '2005-06-17T09:20:36', '2005-06-18T11:06:36', '2'), - ('246', '212', '2006-02-16T02:30:53', '2005-05-25T20:46:11', '2005-05-30T00:47:11', '2'), - ('246', '1022', '2006-02-16T02:30:53', '2005-06-20T20:42:41', '2005-06-28T21:12:41', '1'), - ('246', '2990', '2006-02-16T02:30:53', '2005-07-31T01:02:18', '2005-08-06T21:31:18', '1'), - ('246', '2677', '2006-02-16T02:30:53', '2005-08-21T09:16:40', '2005-08-29T11:43:40', '2'), - ('246', '2026', '2006-02-16T02:30:53', '2005-06-19T13:50:10', '2005-06-26T18:25:10', '2'), - ('246', '2546', '2006-02-16T02:30:53', '2005-07-09T00:54:13', '2005-07-09T21:02:13', '1'), - ('246', '3324', '2006-02-16T02:30:53', '2005-08-01T00:54:51', '2005-08-04T22:39:51', '2'), - ('246', '63', '2006-02-16T02:30:53', '2005-06-19T15:01:23', '2005-06-22T09:08:23', '1'), - ('246', '4101', '2006-02-16T02:30:53', '2005-07-08T20:56:00', '2005-07-12T00:19:00', '2'), - ('246', '3360', '2006-02-16T02:30:53', '2005-05-27T16:54:27', '2005-06-04T22:26:27', '1'), - ('246', '1293', '2006-02-16T02:30:53', '2005-07-09T17:31:32', '2005-07-10T21:06:32', '2'), - ('246', '2241', '2006-02-16T02:30:53', '2005-08-23T12:26:19', '2005-08-26T09:51:19', '2'), - ('246', '2985', '2006-02-16T02:30:53', '2005-05-27T15:30:13', '2005-06-04T13:19:13', '2'), - ('246', '2781', '2006-02-16T02:30:53', '2005-06-15T19:17:16', '2005-06-23T21:56:16', '2'), - ('126', '2789', '2006-02-16T02:30:53', '2005-07-06T11:15:04', '2005-07-09T06:39:04', '1'), - ('126', '2486', '2006-02-16T02:30:53', '2005-08-17T03:50:33', '2005-08-25T00:37:33', '2'), - ('126', '659', '2006-02-16T02:30:53', '2005-08-17T11:30:11', '2005-08-23T09:54:11', '1'), - ('126', '2268', '2006-02-16T02:30:53', '2005-06-21T21:01:57', '2005-06-25T23:57:57', '1'), - ('126', '1382', '2006-02-16T02:30:53', '2005-07-10T18:31:05', '2005-07-12T18:29:05', '2'), - ('126', '3025', '2006-02-16T02:30:53', '2005-07-28T18:27:29', '2005-08-01T19:45:29', '2'), - ('126', '537', '2006-02-16T02:30:53', '2005-07-06T15:08:08', '2005-07-15T14:01:08', '2'), - ('126', '1564', '2006-02-16T02:30:53', '2005-08-21T13:32:38', '2005-08-25T18:02:38', '2'), - ('126', '1575', '2006-02-16T02:30:53', '2005-05-31T07:33:25', '2005-06-02T01:40:25', '2'), - ('126', '1026', '2006-02-16T02:30:53', '2005-07-06T00:15:06', '2005-07-13T01:35:06', '1'), - ('126', '1746', '2006-02-16T02:30:53', '2005-07-28T13:48:09', '2005-08-03T19:21:09', '1'), - ('126', '1965', '2006-02-16T02:30:53', '2005-08-21T16:52:29', '2005-08-26T12:30:29', '1'), - ('126', '1720', '2006-02-16T02:30:53', '2005-05-29T10:14:15', '2005-06-04T06:30:15', '1'), - ('126', '2648', '2006-02-16T02:30:53', '2005-08-02T11:42:40', '2005-08-10T11:58:40', '2'), - ('126', '2227', '2006-02-16T02:30:53', '2005-08-19T07:21:24', '2005-08-21T04:31:24', '2'), - ('126', '409', '2006-02-16T02:30:53', '2005-07-09T08:00:34', '2005-07-12T05:34:34', '1'), - ('126', '2542', '2006-02-16T02:30:53', '2005-07-12T15:07:49', '2005-07-21T18:43:49', '2'), - ('126', '4243', '2006-02-16T02:30:53', '2005-08-23T12:10:54', '2005-08-24T10:08:54', '2'), - ('126', '639', '2006-02-16T02:30:53', '2005-07-30T23:52:21', '2005-08-08T20:50:21', '2'), - ('126', '3651', '2006-02-16T02:30:53', '2005-07-12T14:33:21', '2005-07-13T09:59:21', '2'), - ('126', '2580', '2006-02-16T02:30:53', '2005-05-25T00:00:40', '2005-05-28T00:22:40', '1'), - ('126', '1619', '2006-02-16T02:30:53', '2005-07-08T12:59:49', '2005-07-14T16:15:49', '2'), - ('126', '3172', '2006-02-16T02:30:53', '2005-08-19T13:56:58', '2005-08-23T13:13:58', '2'), - ('126', '2331', '2006-02-16T02:30:53', '2005-07-31T18:41:55', '2005-08-04T22:45:55', '1'), - ('126', '3236', '2006-02-16T02:30:53', '2005-08-23T21:02:43', '2005-08-30T23:37:43', '2'), - ('126', '181', '2006-02-16T02:30:53', '2005-08-17T10:31:58', '2005-08-24T15:28:58', '2'), - ('126', '596', '2006-02-16T02:30:53', '2005-07-08T11:04:53', '2005-07-09T07:48:53', '1'), - ('126', '3461', '2006-02-16T02:30:53', '2005-08-19T07:56:51', '2005-08-28T07:05:51', '2'), - ('307', '3796', '2006-02-16T02:30:53', '2005-06-17T23:51:28', '2005-06-21T00:43:28', '2'), - ('307', '4209', '2006-02-16T02:30:53', '2005-05-28T06:16:32', '2005-05-31T02:48:32', '1'), - ('307', '3417', '2006-02-16T02:30:53', '2005-07-27T21:34:09', '2005-08-02T03:26:09', '1'), - ('307', '4193', '2006-02-16T02:30:53', '2005-07-31T21:57:32', '2005-08-05T22:23:32', '1'), - ('307', '2439', '2006-02-16T02:30:53', '2005-07-11T08:03:35', '2005-07-18T12:46:35', '1'), - ('307', '3371', '2006-02-16T02:30:53', '2005-06-19T18:47:00', '2005-06-22T20:22:00', '2'), - ('307', '319', '2006-02-16T02:30:53', '2005-07-27T01:03:06', '2005-08-05T04:18:06', '2'), - ('307', '409', '2006-02-16T02:30:53', '2005-07-28T06:29:45', '2005-08-03T01:36:45', '1'), - ('307', '3288', '2006-02-16T02:30:53', '2005-07-10T18:46:08', '2005-07-16T17:32:08', '1'), - ('307', '1244', '2006-02-16T02:30:53', '2005-08-21T05:04:34', '2005-08-23T04:58:34', '1'), - ('307', '3516', '2006-02-16T02:30:53', '2005-05-27T14:45:37', '2005-06-03T11:11:37', '1'), - ('307', '280', '2006-02-16T02:30:53', '2005-05-28T15:33:28', '2005-06-04T12:27:28', '2'), - ('307', '268', '2006-02-16T02:30:53', '2005-08-02T22:44:50', '2005-08-11T01:55:50', '2'), - ('307', '4114', '2006-02-16T02:30:53', '2005-07-08T03:03:12', '2005-07-10T04:49:12', '1'), - ('307', '2652', '2006-02-16T02:30:53', '2005-07-28T12:16:40', '2005-07-31T13:09:40', '2'), - ('307', '1520', '2006-02-16T02:30:53', '2005-05-30T19:50:28', '2005-06-09T01:19:28', '1'), - ('307', '2665', '2006-02-16T02:30:53', '2005-06-17T22:53:27', '2005-06-23T19:19:27', '1'), - ('307', '3940', '2006-02-16T02:30:53', '2005-08-23T03:03:53', '2005-08-25T08:27:53', '2'), - ('307', '1391', '2006-02-16T02:30:53', '2005-06-20T01:26:18', '2005-06-26T23:42:18', '1'), - ('307', '4351', '2006-02-16T02:30:53', '2005-08-01T06:25:27', '2005-08-07T05:44:27', '2'), - ('307', '379', '2006-02-16T02:30:53', '2005-07-06T22:13:45', '2005-07-15T00:22:45', '2'), - ('307', '446', '2006-02-16T02:30:53', '2005-08-01T19:57:06', '2005-08-07T18:04:06', '1'), - ('307', '1101', '2006-02-16T02:30:53', '2005-06-20T13:22:48', '2005-06-26T17:22:48', '2'), - ('307', '1507', '2006-02-16T02:30:53', '2005-08-18T08:52:53', '2005-08-22T12:15:53', '2'), - ('307', '287', '2006-02-16T02:30:53', '2005-06-21T00:51:06', '2005-06-22T21:49:06', '2'), - ('307', '480', '2006-02-16T02:30:53', '2005-07-11T15:19:22', '2005-07-13T12:43:22', '1'), - ('307', '2096', '2006-02-16T02:30:53', '2005-07-06T23:24:03', '2005-07-10T00:20:03', '2'), - ('307', '4136', '2006-02-16T02:30:53', '2005-08-19T21:12:37', '2005-08-25T19:56:37', '2'), - ('307', '556', '2006-02-16T02:30:53', '2005-07-29T14:52:59', '2005-08-06T11:09:59', '2'), - ('307', '1157', '2006-02-16T02:30:53', '2005-07-08T19:13:50', '2005-07-14T20:59:50', '2'), - ('74', '53', '2006-02-16T02:30:53', '2005-06-19T00:11:26', '2005-06-25T02:19:26', '1'), - ('74', '163', '2006-02-16T02:30:53', '2005-07-31T19:14:20', '2005-08-05T19:45:20', '1'), - ('74', '4364', '2006-02-16T02:30:53', '2005-08-23T22:26:47', '2005-08-27T18:02:47', '2'), - ('74', '2234', '2006-02-16T02:30:53', '2005-07-29T21:09:11', '2005-08-04T22:55:11', '1'), - ('74', '1861', '2006-02-16T02:30:53', '2005-08-19T20:03:18', '2005-08-24T20:09:18', '2'), - ('74', '4516', '2006-02-16T02:30:53', '2005-08-18T12:25:01', '2005-08-25T17:25:01', '2'), - ('74', '4449', '2006-02-16T02:30:53', '2005-07-11T14:40:48', '2005-07-18T09:51:48', '1'), - ('74', '1814', '2006-02-16T02:30:53', '2005-07-06T15:35:06', '2005-07-14T19:08:06', '1'), - ('74', '266', '2006-02-16T02:30:53', '2005-08-23T11:56:22', '2005-08-29T16:10:22', '2'), - ('74', '2381', '2006-02-16T02:30:53', '2005-06-21T20:40:28', '2005-06-29T00:47:28', '2'), - ('74', '176', '2006-02-16T02:30:53', '2005-08-20T05:29:45', '2005-08-26T06:49:45', '1'), - ('74', '3326', '2006-02-16T02:30:53', '2005-08-20T02:41:46', '2005-08-22T01:53:46', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['3020', '15286', '7304', '12374', '1121', '13747', '9112', '5917', '5530', '15500', '6475', '5603', '2498', '15325', '10624', '8658', '82', '1628', '8531', '10560', '6423', '1342', '13720', '1648', '10464', '1857', '10417', '15330', '11024', '14201', '8182', '2466', '9978', '4793', '6938', '5586', '5476', '14287', '6509', '13343', '13867', '7511', '3636', '7997', '12934', '8666', '12227', '4383', '4581', '13104', '5759', '7212', '8819', '12547', '7118', '12203', '7549', '3435', '7741', '9684', '1418', '5704', '12571', '10415', '3341', '8149', '6576', '14759', '7485', '14752', '5227', '14051', '4646', '8364', '1429', '8662', '10546', '14336', '14950', '12244', '1615', '1035', '14808', '8714', '5690', '9784', '6204', '7172', '3197', '14129', '1529', '13603', '12854', '6981', '8081', '3393', '8325', '5563', '8402', '175']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('74', '4363', '2006-02-16T02:30:53', '2005-06-20T11:12:04', '2005-06-27T07:31:04', '2'), - ('74', '3731', '2006-02-16T02:30:53', '2005-08-22T19:17:56', '2005-08-29T16:08:56', '2'), - ('74', '1162', '2006-02-16T02:30:53', '2005-07-27T12:56:56', '2005-08-05T09:19:56', '2'), - ('74', '939', '2006-02-16T02:30:53', '2005-08-18T08:07:45', '2005-08-26T10:42:45', '2'), - ('74', '1691', '2006-02-16T02:30:53', '2005-05-31T16:37:36', '2005-06-06T21:02:36', '1'), - ('74', '3332', '2006-02-16T02:30:53', '2005-08-20T10:56:06', '2005-08-29T10:29:06', '1'), - ('74', '395', '2006-02-16T02:30:53', '2005-07-30T09:06:31', '2005-08-04T05:12:31', '2'), - ('74', '2910', '2006-02-16T02:30:53', '2005-07-10T21:30:22', '2005-07-12T18:54:22', '2'), - ('74', '2701', '2006-02-16T02:30:53', '2005-07-10T02:13:49', '2005-07-18T08:01:49', '2'), - ('74', '886', '2006-02-16T02:30:53', '2005-08-23T02:39:37', '2005-08-27T06:42:37', '1'), - ('74', '2035', '2006-02-16T02:30:53', '2005-07-12T01:36:57', '2005-07-17T21:22:57', '1'), - ('74', '1308', '2006-02-16T02:30:53', '2005-07-10T05:04:54', '2005-07-12T01:54:54', '2'), - ('74', '2291', '2006-02-16T02:30:53', '2005-06-18T22:56:26', '2005-06-22T20:02:26', '1'), - ('74', '3549', '2006-02-16T02:30:53', '2005-08-22T20:27:38', '2005-08-23T15:24:38', '1'), - ('74', '3801', '2006-02-16T02:30:53', '2005-08-01T15:27:05', '2005-08-05T19:50:05', '1'), - ('427', '2033', '2006-02-16T02:30:53', '2005-07-29T15:16:37', '2005-08-07T20:45:37', '2'), - ('427', '1388', '2006-02-16T02:30:53', '2005-05-25T12:17:46', '2005-06-01T10:48:46', '1'), - ('427', '868', '2006-02-16T02:30:53', '2005-06-16T07:52:55', '2005-06-25T11:09:55', '1'), - ('427', '1631', '2006-02-16T02:30:53', '2005-07-29T10:26:15', '2005-08-06T09:28:15', '1'), - ('427', '1534', '2006-02-16T02:30:53', '2005-08-01T13:04:57', '2005-08-05T18:25:57', '2'), - ('427', '892', '2006-02-16T02:30:53', '2005-07-11T23:47:31', '2005-07-19T18:16:31', '1'), - ('427', '4429', '2006-02-16T02:30:53', '2005-06-15T12:26:21', '2005-06-22T11:23:21', '1'), - ('427', '813', '2006-02-16T02:30:53', '2005-08-20T10:01:39', '2005-08-27T08:26:39', '1'), - ('427', '457', '2006-02-16T02:30:53', '2005-06-16T09:17:07', '2005-06-24T06:31:07', '2'), - ('427', '464', '2006-02-16T02:30:53', '2005-08-01T09:43:14', '2005-08-06T09:01:14', '1'), - ('427', '4257', '2006-02-16T02:30:53', '2005-06-17T01:12:58', '2005-06-21T04:49:58', '1'), - ('427', '3675', '2006-02-16T02:30:53', '2005-08-01T08:10:36', '2005-08-02T03:42:36', '2'), - ('427', '689', '2006-02-16T02:30:53', '2005-08-22T20:35:30', '2005-08-30T21:54:30', '1'), - ('427', '2284', '2006-02-16T02:30:53', '2005-08-02T05:38:31', '2005-08-11T04:47:31', '1'), - ('427', '314', '2006-02-16T02:30:53', '2005-08-21T03:51:34', '2005-08-30T03:42:34', '2'), - ('427', '4120', '2006-02-16T02:30:53', '2005-07-28T22:19:12', '2005-08-01T22:40:12', '2'), - ('427', '1356', '2006-02-16T02:30:53', '2005-06-18T20:18:42', '2005-06-20T01:32:42', '1'), - ('427', '2812', '2006-02-16T02:30:53', '2005-07-31T16:59:51', '2005-08-06T16:48:51', '2'), - ('427', '3090', '2006-02-16T02:30:53', '2005-07-08T16:30:01', '2005-07-15T17:56:01', '1'), - ('427', '2058', '2006-02-16T02:30:53', '2005-07-26T23:16:04', '2005-08-05T00:59:04', '2'), - ('427', '2965', '2006-02-16T02:30:53', '2005-07-10T04:17:06', '2005-07-18T07:11:06', '1'), - ('427', '1199', '2006-02-16T02:30:53', '2005-07-09T23:37:09', '2005-07-15T23:57:09', '1'), - ('427', '2426', '2006-02-16T02:30:53', '2005-08-21T06:53:59', '2005-08-25T03:10:59', '2'), - ('427', '2468', '2006-02-16T02:30:53', '2005-07-12T03:35:01', '2005-07-13T06:50:01', '2'), - ('591', '1032', '2006-02-16T02:30:53', '2005-08-19T20:22:08', '2005-08-27T17:21:08', '1'), - ('591', '4514', '2006-02-16T02:30:53', '2005-08-20T15:05:42', '2005-08-29T10:48:42', '2'), - ('591', '4044', '2006-02-16T02:30:53', '2005-07-27T20:38:40', '2005-08-04T22:36:40', '2'), - ('591', '3379', '2006-02-16T02:30:53', '2005-07-06T07:03:52', '2005-07-08T03:14:52', '2'), - ('591', '1845', '2006-02-16T02:30:53', '2005-07-28T15:02:25', '2005-08-04T14:35:25', '1'), - ('591', '3242', '2006-02-16T02:30:53', '2005-08-19T05:18:42', '2005-08-24T10:42:42', '1'), - ('591', '3669', '2006-02-16T02:30:53', '2005-07-29T15:39:38', '2005-08-06T17:12:38', '1'), - ('591', '3671', '2006-02-16T02:30:53', '2005-08-18T03:04:28', '2005-08-21T08:52:28', '2'), - ('591', '2649', '2006-02-16T02:30:53', '2005-07-07T20:45:51', '2005-07-17T00:52:51', '2'), - ('591', '887', '2006-02-16T02:30:53', '2005-07-08T06:05:06', '2005-07-16T00:54:06', '1'), - ('591', '310', '2006-02-16T02:30:53', '2005-08-19T11:06:06', '2005-08-21T13:50:06', '2'), - ('591', '816', '2006-02-16T02:30:53', '2005-07-10T12:43:22', '2005-07-16T16:42:22', '1'), - ('591', '2905', '2006-02-16T02:30:53', '2005-07-27T09:21:22', '2005-08-01T04:47:22', '2'), - ('591', '3100', '2006-02-16T02:30:53', '2005-07-29T22:14:26', '2005-08-06T23:02:26', '2'), - ('591', '3046', '2006-02-16T02:30:53', '2005-08-18T14:29:39', '2005-08-22T16:52:39', '2'), - ('591', '582', '2006-02-16T02:30:53', '2005-07-27T05:53:50', '2005-08-05T04:19:50', '2'), - ('591', '4228', '2006-02-16T02:30:53', '2005-08-18T02:18:52', '2005-08-22T21:01:52', '1'), - ('591', '1765', '2006-02-16T02:30:53', '2005-07-27T21:53:21', '2005-08-05T18:53:21', '1'), - ('591', '451', '2006-02-16T02:30:53', '2005-06-21T19:14:58', '2005-06-24T19:58:58', '1'), - ('591', '3917', '2006-02-16T02:30:53', '2005-07-28T05:25:55', '2005-08-02T02:40:55', '1'), - ('591', '362', '2006-02-16T02:30:53', '2005-07-31T06:48:33', '2005-08-01T07:07:33', '2'), - ('591', '2974', '2006-02-16T02:30:53', '2005-06-15T17:51:27', '2005-06-18T23:20:27', '2'), - ('591', '2104', '2006-02-16T02:30:53', '2005-07-10T10:06:29', '2005-07-17T10:48:29', '1'), - ('591', '1013', '2006-02-16T02:30:53', '2005-08-18T15:31:18', '2005-08-23T15:20:18', '2'), - ('591', '2597', '2006-02-16T02:30:53', '2005-08-01T08:05:59', '2005-08-04T13:46:59', '1'), - ('591', '2189', '2006-02-16T02:30:53', '2005-06-21T10:37:25', '2005-06-26T15:38:25', '1'), - ('591', '1790', '2006-02-16T02:30:53', '2005-07-28T20:48:12', '2005-08-01T20:07:12', '2'), - ('362', '339', '2006-02-16T02:30:53', '2005-07-12T06:13:41', '2005-07-16T03:22:41', '1'), - ('362', '3871', '2006-02-16T02:30:53', '2005-08-21T23:28:58', '2005-08-31T00:35:58', '2'), - ('362', '631', '2006-02-16T02:30:53', '2005-07-27T19:29:09', '2005-07-30T16:28:09', '1'), - ('362', '1252', '2006-02-16T02:30:53', '2005-08-21T23:11:42', '2005-08-28T22:12:42', '1'), - ('362', '1862', '2006-02-16T02:30:53', '2005-07-09T12:16:39', '2005-07-18T15:38:39', '2'), - ('362', '4012', '2006-02-16T02:30:53', '2005-08-20T22:09:51', '2005-08-29T04:04:51', '2'), - ('362', '618', '2006-02-16T02:30:53', '2005-07-08T09:23:26', '2005-07-16T04:03:26', '1'), - ('362', '1361', '2006-02-16T02:30:53', '2005-07-29T05:10:31', '2005-07-30T04:02:31', '2'), - ('362', '4116', '2006-02-16T02:30:53', '2005-06-15T18:24:10', '2005-06-18T16:30:10', '1'), - ('362', '3758', '2006-02-16T02:30:53', '2005-07-29T15:31:33', '2005-07-30T09:39:33', '2'), - ('362', '1589', '2006-02-16T02:30:53', '2005-08-01T12:44:17', '2005-08-06T16:26:17', '2'), - ('362', '3166', '2006-02-16T02:30:53', '2005-08-21T08:33:42', '2005-08-23T03:27:42', '1'), - ('362', '635', '2006-02-16T02:30:53', '2005-08-22T06:17:12', '2005-08-27T08:48:12', '2'), - ('362', '4441', '2006-02-16T02:30:53', '2005-08-18T03:39:11', '2005-08-21T02:57:11', '2'), - ('362', '3894', '2006-02-16T02:30:53', '2005-06-16T07:00:28', '2005-06-25T08:53:28', '1'), - ('362', '949', '2006-02-16T02:30:53', '2005-05-31T05:01:09', '2005-06-02T03:59:09', '1'), - ('362', '1657', '2006-02-16T02:30:53', '2005-08-22T00:58:35', '2005-08-29T20:16:35', '2'), - ('362', '4547', '2006-02-16T02:30:53', '2005-07-29T17:31:40', '2005-08-04T16:12:40', '2'), - ('362', '1326', '2006-02-16T02:30:53', '2005-07-10T09:26:49', '2005-07-19T07:17:49', '2'), - ('362', '2761', '2006-02-16T02:30:53', '2005-07-31T10:21:32', '2005-08-07T09:20:32', '2'), - ('362', '2572', '2006-02-16T02:30:53', '2005-07-11T12:29:22', '2005-07-13T10:41:22', '2'), - ('362', '2405', '2006-02-16T02:30:53', '2005-07-27T07:59:16', '2005-08-01T04:46:16', '1'), - ('362', '1811', '2006-02-16T02:30:53', '2005-06-21T00:07:23', '2005-06-23T00:53:23', '2'), - ('362', '3572', '2006-02-16T02:30:53', '2005-08-21T01:42:15', '2005-08-23T20:04:15', '2'), - ('362', '1688', '2006-02-16T02:30:53', '2005-06-16T00:37:35', '2005-06-22T18:58:35', '2'), - ('362', '937', '2006-02-16T02:30:53', '2005-08-20T06:02:48', '2005-08-29T09:39:48', '1'), - ('362', '4577', '2006-02-16T02:30:53', '2005-08-19T02:18:51', '2005-08-24T04:16:51', '2'), - ('362', '154', '2006-02-16T02:30:53', '2005-07-27T00:51:38', '2005-07-28T01:06:38', '2'), - ('362', '4404', '2006-02-16T02:30:53', '2005-07-28T18:06:46', '2005-08-04T18:54:46', '1'), - ('362', '1631', '2006-02-16T02:30:53', '2005-06-21T15:14:27', '2005-06-25T19:54:27', '2'), - ('362', '932', '2006-02-16T02:30:53', '2005-07-29T03:57:27', '2005-08-06T22:30:27', '1'), - ('362', '2258', '2006-02-16T02:30:53', '2005-07-10T03:21:02', '2005-07-14T07:40:02', '1'), - ('47', '186', '2006-02-16T02:30:53', '2005-07-29T06:25:45', '2005-08-07T10:48:45', '1'), - ('47', '4346', '2006-02-16T02:30:53', '2005-05-26T03:46:26', '2005-06-03T06:01:26', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['11126', '14397', '3631', '6153', '8863', '6164', '12215', '2307', '207', '5174', '300', '1882', '11477', '15846', '9274', '3320', '6337', '8159', '4064', '12274', '8805', '5515', '10639', '1905', '10269', '2135', '4727', '4419', '4695', '9431', '2439', '1625', '8723', '8366', '15124', '9656', '10630', '2876', '12459', '12268', '4712', '10251', '2631', '10052', '13101', '8307', '10126', '6045', '5451', '6289', '3780', '4954', '11266', '5748', '4800', '11593', '4589', '8514', '1858', '4170', '6662', '8242', '6370', '7039', '10388', '12379', '5035', '2368', '10455', '4344', '8072', '867', '12869', '1500', '9661', '2156', '4844', '7812', '8799', '8835', '7193', '7951', '1518', '8102', '11125', '6053', '3069', '13969', '10056', '9276', '13922', '10058', '11479', '2492', '182', '8748', '15337', '133', '15139', '14453']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('47', '3310', '2006-02-16T02:30:53', '2005-08-02T08:59:04', '2005-08-04T11:00:04', '1'), - ('47', '3883', '2006-02-16T02:30:53', '2005-08-21T10:25:56', '2005-08-24T07:48:56', '1'), - ('47', '4068', '2006-02-16T02:30:53', '2005-07-06T06:36:53', '2005-07-07T10:32:53', '1'), - ('47', '105', '2006-02-16T02:30:53', '2005-07-11T09:31:04', '2005-07-19T03:41:04', '1'), - ('47', '75', '2006-02-16T02:30:53', '2005-07-29T23:52:01', '2005-08-04T20:28:01', '1'), - ('47', '2755', '2006-02-16T02:30:53', '2005-07-11T10:16:23', '2005-07-14T11:21:23', '1'), - ('47', '4095', '2006-02-16T02:30:53', '2005-08-18T02:35:39', '2005-08-24T00:36:39', '1'), - ('47', '4576', '2006-02-16T02:30:53', '2005-06-18T08:34:59', '2005-06-23T04:42:59', '1'), - ('47', '102', '2006-02-16T02:30:53', '2005-05-26T08:04:38', '2005-05-27T09:32:38', '2'), - ('47', '3621', '2006-02-16T02:30:53', '2005-07-09T09:31:59', '2005-07-15T03:49:59', '1'), - ('47', '249', '2006-02-16T02:30:53', '2005-05-26T20:57:00', '2005-06-05T01:34:00', '2'), - ('47', '1400', '2006-02-16T02:30:53', '2005-06-17T03:17:21', '2005-06-19T22:23:21', '2'), - ('47', '1671', '2006-02-16T02:30:53', '2005-08-02T22:09:01', '2005-08-07T03:46:01', '2'), - ('47', '3635', '2006-02-16T02:30:53', '2005-08-23T15:39:18', '2005-08-27T14:28:18', '2'), - ('47', '4424', '2006-02-16T02:30:53', '2005-07-30T15:07:04', '2005-08-06T11:17:04', '2'), - ('47', '860', '2006-02-16T02:30:53', '2005-06-21T08:29:41', '2005-06-29T13:54:41', '2'), - ('47', '3967', '2006-02-16T02:30:53', '2005-07-11T19:30:47', '2005-07-19T20:27:47', '2'), - ('47', '1118', '2006-02-16T02:30:53', '2005-07-28T21:09:28', '2005-08-04T15:34:28', '1'), - ('47', '1402', '2006-02-16T02:30:53', '2005-07-07T04:29:20', '2005-07-14T05:48:20', '2'), - ('47', '265', '2006-02-16T02:30:53', '2005-08-18T04:41:47', '2005-08-27T07:00:47', '1'), - ('39', '4041', '2006-02-16T02:30:53', '2005-07-29T21:29:58', '2005-08-04T23:12:58', '1'), - ('39', '3772', '2006-02-16T02:30:53', '2005-07-10T01:12:44', '2005-07-13T00:39:44', '1'), - ('39', '1015', '2006-02-16T02:30:53', '2005-08-01T15:44:43', '2005-08-10T13:51:43', '1'), - ('39', '1043', '2006-02-16T02:30:53', '2005-06-17T04:51:43', '2005-06-24T09:35:43', '1'), - ('39', '2537', '2006-02-16T02:30:53', '2005-08-01T03:09:26', '2005-08-02T00:01:26', '1'), - ('39', '4091', '2006-02-16T02:30:53', '2005-06-17T21:14:02', '2005-06-19T00:59:02', '1'), - ('39', '1251', '2006-02-16T02:30:53', '2005-07-08T12:54:15', '2005-07-17T14:32:15', '2'), - ('39', '783', '2006-02-16T02:30:53', '2005-07-07T22:06:24', '2005-07-15T23:59:24', '1'), - ('39', '805', '2006-02-16T02:30:53', '2005-07-08T11:07:59', '2005-07-17T16:35:59', '1'), - ('39', '3364', '2006-02-16T02:30:53', '2005-07-30T21:24:22', '2005-08-03T01:22:22', '2'), - ('39', '909', '2006-02-16T02:30:53', '2005-06-18T18:35:04', '2005-06-21T19:47:04', '2'), - ('39', '3367', '2006-02-16T02:30:53', '2005-06-16T07:49:08', '2005-06-24T09:08:08', '2'), - ('39', '224', '2006-02-16T02:30:53', '2005-07-29T18:03:47', '2005-08-06T18:53:47', '1'), - ('39', '479', '2006-02-16T02:30:53', '2005-07-29T05:11:14', '2005-08-05T01:48:14', '1'), - ('39', '1598', '2006-02-16T02:30:53', '2005-08-22T12:51:38', '2005-08-26T09:05:38', '1'), - ('39', '4215', '2006-02-16T02:30:53', '2005-07-31T06:00:21', '2005-08-05T04:36:21', '1'), - ('39', '2335', '2006-02-16T02:30:53', '2005-08-01T15:34:46', '2005-08-03T10:50:46', '1'), - ('39', '3117', '2006-02-16T02:30:53', '2005-06-20T01:06:34', '2005-06-23T04:55:34', '1'), - ('39', '421', '2006-02-16T02:30:53', '2005-08-18T11:25:11', '2005-08-22T06:13:11', '1'), - ('39', '93', '2006-02-16T02:30:53', '2005-08-18T04:26:54', '2005-08-23T06:40:54', '2'), - ('39', '2371', '2006-02-16T02:30:53', '2005-07-08T12:10:50', '2005-07-17T14:54:50', '2'), - ('39', '2986', '2006-02-16T02:30:53', '2005-08-01T02:39:12', '2005-08-06T03:51:12', '1'), - ('39', '3471', '2006-02-16T02:30:53', '2005-06-19T08:49:53', '2005-06-26T03:25:53', '1'), - ('39', '3307', '2006-02-16T02:30:53', '2005-07-31T19:15:13', '2005-08-07T22:47:13', '2'), - ('39', '1804', '2006-02-16T02:30:53', '2005-08-19T11:01:54', '2005-08-27T16:06:54', '2'), - ('39', '3197', '2006-02-16T02:30:53', '2005-07-29T03:18:34', '2005-08-06T05:51:34', '2'), - ('39', '3', '2006-02-16T02:30:53', '2005-07-31T21:36:07', '2005-08-03T23:59:07', '1'), - ('39', '2003', '2006-02-16T02:30:53', '2005-07-11T03:21:05', '2005-07-17T23:10:05', '1'), - ('39', '3484', '2006-02-16T02:30:53', '2005-07-09T22:22:10', '2005-07-11T02:43:10', '1'), - ('99', '3185', '2006-02-16T02:30:53', '2005-07-11T17:06:39', '2005-07-12T15:54:39', '2'), - ('99', '1209', '2006-02-16T02:30:53', '2005-07-06T13:52:02', '2005-07-15T08:41:02', '2'), - ('99', '627', '2006-02-16T02:30:53', '2005-07-08T23:14:16', '2005-07-14T23:23:16', '2'), - ('99', '3972', '2006-02-16T02:30:53', '2005-08-02T14:07:35', '2005-08-04T13:31:35', '1'), - ('99', '1618', '2006-02-16T02:30:53', '2005-07-10T12:19:59', '2005-07-12T12:59:59', '1'), - ('99', '1940', '2006-02-16T02:30:53', '2005-07-08T16:51:08', '2005-07-13T14:16:08', '2'), - ('99', '817', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('99', '1192', '2006-02-16T02:30:53', '2005-07-08T06:26:04', '2005-07-09T10:31:04', '2'), - ('99', '3755', '2006-02-16T02:30:53', '2005-07-29T09:53:33', '2005-07-30T06:34:33', '2'), - ('99', '3200', '2006-02-16T02:30:53', '2005-06-17T01:13:11', '2005-06-18T21:33:11', '2'), - ('99', '2665', '2006-02-16T02:30:53', '2005-07-07T09:44:36', '2005-07-13T14:10:36', '1'), - ('99', '1464', '2006-02-16T02:30:53', '2005-07-12T11:21:06', '2005-07-13T13:00:06', '1'), - ('99', '509', '2006-02-16T02:30:53', '2005-07-29T00:34:27', '2005-08-05T23:13:27', '2'), - ('99', '1410', '2006-02-16T02:30:53', '2005-07-11T21:28:32', '2005-07-20T02:51:32', '2'), - ('99', '1906', '2006-02-16T02:30:53', '2005-07-27T03:11:48', '2005-08-01T23:55:48', '1'), - ('99', '3180', '2006-02-16T02:30:53', '2005-08-01T06:42:44', '2005-08-09T11:43:44', '2'), - ('99', '2879', '2006-02-16T02:30:53', '2005-08-18T08:26:48', '2005-08-19T10:08:48', '2'), - ('99', '3699', '2006-02-16T02:30:53', '2005-07-09T02:51:34', '2005-07-16T21:38:34', '1'), - ('99', '1058', '2006-02-16T02:30:53', '2005-06-18T14:10:27', '2005-06-23T10:49:27', '1'), - ('99', '4197', '2006-02-16T02:30:53', '2005-08-01T09:15:00', '2005-08-05T13:35:00', '1'), - ('99', '1185', '2006-02-16T02:30:53', '2005-07-07T18:50:47', '2005-07-12T16:38:47', '2'), - ('99', '2347', '2006-02-16T02:30:53', '2005-07-28T17:27:59', '2005-07-30T19:08:59', '1'), - ('99', '3389', '2006-02-16T02:30:53', '2005-05-30T03:54:43', '2005-06-01T22:59:43', '1'), - ('99', '3939', '2006-02-16T02:30:53', '2005-08-19T02:50:36', '2005-08-26T21:38:36', '2'), - ('237', '2652', '2006-02-16T02:30:53', '2005-06-15T22:00:45', '2005-06-18T16:19:45', '2'), - ('237', '2693', '2006-02-16T02:30:53', '2005-07-31T06:06:37', '2005-08-04T07:37:37', '1'), - ('237', '623', '2006-02-16T02:30:53', '2005-06-17T23:08:12', '2005-06-22T19:44:12', '2'), - ('237', '4057', '2006-02-16T02:30:53', '2005-07-08T18:28:13', '2005-07-09T21:17:13', '2'), - ('237', '4556', '2006-02-16T02:30:53', '2005-07-28T08:06:52', '2005-07-31T09:57:52', '2'), - ('237', '326', '2006-02-16T02:30:53', '2005-07-29T21:16:47', '2005-08-07T22:09:47', '2'), - ('237', '2653', '2006-02-16T02:30:53', '2005-07-29T22:44:35', '2005-08-05T23:28:35', '1'), - ('237', '1801', '2006-02-16T02:30:53', '2005-07-27T08:37:00', '2005-07-30T12:51:00', '2'), - ('237', '3979', '2006-02-16T02:30:53', '2005-07-28T13:21:16', '2005-08-06T08:21:16', '1'), - ('237', '4537', '2006-02-16T02:30:53', '2005-06-15T23:36:37', '2005-06-16T18:24:37', '2'), - ('237', '4505', '2006-02-16T02:30:53', '2005-07-28T18:49:43', '2005-08-03T23:04:43', '2'), - ('237', '2081', '2006-02-16T02:30:53', '2005-08-02T08:55:35', '2005-08-03T09:12:35', '1'), - ('237', '2836', '2006-02-16T02:30:53', '2005-07-11T03:51:59', '2005-07-19T09:13:59', '2'), - ('237', '1952', '2006-02-16T02:30:53', '2005-06-20T14:13:00', '2005-06-28T10:57:00', '1'), - ('237', '1836', '2006-02-16T02:30:53', '2005-08-20T18:42:40', '2005-08-27T17:33:40', '2'), - ('237', '281', '2006-02-16T02:30:53', '2005-07-31T19:19:13', '2005-08-01T16:09:13', '2'), - ('237', '1528', '2006-02-16T02:30:53', '2005-07-30T15:09:28', '2005-08-06T19:39:28', '1'), - ('237', '1398', '2006-02-16T02:30:53', '2005-08-20T17:02:37', '2005-08-29T19:28:37', '1'), - ('237', '758', '2006-02-16T02:30:53', '2005-07-31T19:20:21', '2005-08-04T00:41:21', '2'), - ('237', '4077', '2006-02-16T02:30:53', '2005-08-02T22:18:13', '2005-08-12T00:43:13', '1'), - ('237', '2858', '2006-02-16T02:30:53', '2005-06-18T22:04:15', '2005-06-23T21:58:15', '1'), - ('237', '4396', '2006-02-16T02:30:53', '2005-05-26T04:49:17', '2005-06-01T05:43:17', '2'), - ('237', '2184', '2006-02-16T02:30:53', '2005-07-29T19:08:37', '2005-08-01T16:24:37', '1'), - ('237', '280', '2006-02-16T02:30:53', '2005-08-22T20:49:51', '2005-08-26T23:27:51', '1'), - ('237', '399', '2006-02-16T02:30:53', '2005-05-25T21:48:30', '2005-05-30T00:26:30', '2'), - ('237', '2018', '2006-02-16T02:30:53', '2005-08-22T13:38:11', '2005-08-30T09:00:11', '1'), - ('237', '3312', '2006-02-16T02:30:53', '2005-08-21T12:33:34', '2005-08-27T11:10:34', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['12469', '7330', '15931', '11772', '9715', '13914', '15898', '15098', '8296', '7621', '2483', '3673', '36', '3524', '3620', '10424', '14827', '6643', '14097', '8526', '3846', '2878', '1433', '11056', '8692', '6916', '7088', '12052', '2403', '1582', '7065', '9727', '929', '237', '3483', '9411', '8958', '3514', '8535', '11826', '8679', '4448', '15130', '15978', '5196', '11977', '11473', '10019', '6400', '13505', '1962', '15979', '15782', '8811', '241', '719', '519', '7358', '13286', '7230', '12303', '8701', '9088', '3634', '2122', '6795', '1377', '3157', '11211', '725', '9813', '948', '11061', '9169', '7233', '5321', '79', '7397', '11105', '6242', '5764', '6962', '12682', '10087', '9758', '4908', '11803', '10089', '11154', '15962', '10788', '7500', '10305', '9681', '2873', '11888', '8184', '2465', '12334', '2314']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('237', '2395', '2006-02-16T02:30:53', '2005-08-18T11:53:07', '2005-08-24T16:00:07', '1'), - ('237', '3705', '2006-02-16T02:30:53', '2005-07-27T13:56:46', '2005-08-04T07:56:46', '1'), - ('237', '1128', '2006-02-16T02:30:53', '2005-08-23T18:28:09', '2005-08-28T23:08:09', '1'), - ('237', '1021', '2006-02-16T02:30:53', '2005-08-17T10:18:57', '2005-08-26T12:48:57', '2'), - ('237', '3319', '2006-02-16T02:30:53', '2005-07-31T08:16:58', '2005-08-04T11:13:58', '1'), - ('237', '3037', '2006-02-16T02:30:53', '2005-08-20T16:38:57', '2005-08-26T14:53:57', '2'), - ('88', '3502', '2006-02-16T02:30:53', '2005-08-23T17:13:01', '2005-08-29T11:22:01', '2'), - ('88', '4414', '2006-02-16T02:30:53', '2005-08-22T11:48:19', '2005-08-31T11:07:19', '2'), - ('88', '2543', '2006-02-16T02:30:53', '2005-07-29T02:43:25', '2005-08-01T00:23:25', '1'), - ('88', '1833', '2006-02-16T02:30:53', '2005-07-28T00:34:06', '2005-08-06T00:13:06', '1'), - ('88', '4225', '2006-02-16T02:30:53', '2005-06-18T21:22:23', '2005-06-25T01:14:23', '1'), - ('88', '1837', '2006-02-16T02:30:53', '2005-07-06T09:02:09', '2005-07-15T06:45:09', '2'), - ('88', '1308', '2006-02-16T02:30:53', '2005-05-25T04:36:26', '2005-05-29T00:31:26', '1'), - ('88', '1626', '2006-02-16T02:30:53', '2005-07-06T01:01:51', '2005-07-11T19:52:51', '2'), - ('88', '1661', '2006-02-16T02:30:53', '2005-07-06T06:01:50', '2005-07-08T05:04:50', '1'), - ('88', '1921', '2006-02-16T02:30:53', '2005-08-01T08:22:54', '2005-08-06T13:44:54', '1'), - ('88', '2267', '2006-02-16T02:30:53', '2005-08-22T01:32:32', '2005-08-31T06:21:32', '2'), - ('88', '174', '2006-02-16T02:30:53', '2005-07-12T10:39:22', '2005-07-18T13:52:22', '1'), - ('88', '4351', '2006-02-16T02:30:53', '2005-08-21T00:28:48', '2005-08-29T22:15:48', '1'), - ('88', '575', '2006-02-16T02:30:53', '2005-07-29T10:20:48', '2005-08-03T14:15:48', '1'), - ('88', '2829', '2006-02-16T02:30:53', '2005-07-06T16:43:10', '2005-07-14T11:09:10', '2'), - ('88', '4120', '2006-02-16T02:30:53', '2005-06-20T01:09:14', '2005-06-21T21:40:14', '2'), - ('88', '2310', '2006-02-16T02:30:53', '2005-06-15T18:30:00', '2005-06-16T15:14:00', '1'), - ('88', '1404', '2006-02-16T02:30:53', '2005-08-02T06:36:27', '2005-08-10T06:02:27', '1'), - ('88', '3192', '2006-02-16T02:30:53', '2005-07-29T16:43:39', '2005-08-01T15:54:39', '2'), - ('88', '3311', '2006-02-16T02:30:53', '2005-07-12T22:29:18', '2005-07-19T16:46:18', '1'), - ('88', '373', '2006-02-16T02:30:53', '2005-07-27T04:42:28', '2005-08-04T07:09:28', '2'), - ('536', '99', '2006-02-16T02:30:53', '2005-08-17T20:57:02', '2005-08-25T19:04:02', '1'), - ('536', '2697', '2006-02-16T02:30:53', '2005-06-18T16:33:22', '2005-06-23T19:25:22', '1'), - ('536', '163', '2006-02-16T02:30:53', '2005-06-16T04:31:57', '2005-06-22T01:25:57', '1'), - ('536', '3570', '2006-02-16T02:30:53', '2005-07-27T03:53:43', '2005-07-30T23:41:43', '2'), - ('536', '3076', '2006-02-16T02:30:53', '2005-07-31T08:39:13', '2005-08-03T07:54:13', '1'), - ('536', '4296', '2006-02-16T02:30:53', '2005-05-30T12:32:39', '2005-06-06T12:17:39', '1'), - ('536', '241', '2006-02-16T02:30:53', '2005-05-26T12:15:13', '2005-05-29T18:10:13', '1'), - ('536', '79', '2006-02-16T02:30:53', '2005-07-05T23:13:51', '2005-07-13T18:31:51', '1'), - ('536', '3484', '2006-02-16T02:30:53', '2005-07-30T20:38:22', '2005-08-06T01:23:22', '2'), - ('536', '1556', '2006-02-16T02:30:53', '2005-07-30T03:34:26', '2005-08-06T08:14:26', '1'), - ('536', '4546', '2006-02-16T02:30:53', '2005-07-06T00:46:54', '2005-07-09T05:47:54', '1'), - ('536', '4489', '2006-02-16T02:30:53', '2005-07-29T10:32:33', '2005-07-31T05:46:33', '1'), - ('536', '1837', '2006-02-16T02:30:53', '2005-08-17T12:43:46', '2005-08-19T16:59:46', '2'), - ('536', '3549', '2006-02-16T02:30:53', '2005-07-29T16:07:47', '2005-08-02T18:37:47', '1'), - ('536', '2768', '2006-02-16T02:30:53', '2005-07-07T23:17:12', '2005-07-13T18:26:12', '1'), - ('536', '2375', '2006-02-16T02:30:53', '2005-08-22T13:04:32', '2005-08-30T17:24:32', '1'), - ('536', '4444', '2006-02-16T02:30:53', '2005-08-23T20:08:18', '2005-08-31T17:35:18', '2'), - ('536', '2278', '2006-02-16T02:30:53', '2005-07-09T10:43:34', '2005-07-13T12:10:34', '2'), - ('536', '1528', '2006-02-16T02:30:53', '2005-08-17T18:01:15', '2005-08-23T23:03:15', '1'), - ('536', '620', '2006-02-16T02:30:53', '2005-08-02T21:52:03', '2005-08-09T02:01:03', '1'), - ('536', '2114', '2006-02-16T02:30:53', '2005-07-31T18:20:56', '2005-08-07T14:25:56', '1'), - ('536', '3289', '2006-02-16T02:30:53', '2005-07-11T22:43:44', '2005-07-19T03:58:44', '2'), - ('536', '914', '2006-02-16T02:30:53', '2005-08-20T02:05:57', '2005-08-23T05:52:57', '1'), - ('536', '4386', '2006-02-16T02:30:53', '2005-06-17T09:08:58', '2005-06-23T14:55:58', '1'), - ('536', '3733', '2006-02-16T02:30:53', '2005-08-23T20:08:26', '2005-08-26T19:19:26', '1'), - ('245', '3282', '2006-02-16T02:30:53', '2005-08-23T13:43:26', '2005-08-30T14:03:26', '1'), - ('245', '2041', '2006-02-16T02:30:53', '2005-07-29T21:46:21', '2005-08-07T16:51:21', '2'), - ('245', '4438', '2006-02-16T02:30:53', '2005-05-26T12:49:01', '2005-05-28T11:43:01', '2'), - ('245', '267', '2006-02-16T02:30:53', '2005-05-29T05:16:05', '2005-06-01T07:53:05', '2'), - ('245', '3564', '2006-02-16T02:30:53', '2005-05-28T03:22:33', '2005-06-03T05:06:33', '1'), - ('245', '175', '2006-02-16T02:30:53', '2005-07-27T14:49:44', '2005-07-28T20:00:44', '1'), - ('245', '2685', '2006-02-16T02:30:53', '2005-08-19T18:28:07', '2005-08-22T17:23:07', '2'), - ('245', '1152', '2006-02-16T02:30:53', '2005-07-27T10:01:41', '2005-08-02T11:00:41', '1'), - ('245', '1604', '2006-02-16T02:30:53', '2005-08-18T05:43:22', '2005-08-27T08:54:22', '2'), - ('245', '3158', '2006-02-16T02:30:53', '2005-07-29T17:02:35', '2005-08-07T19:55:35', '2'), - ('245', '3407', '2006-02-16T02:30:53', '2005-07-30T08:21:02', '2005-08-01T09:55:02', '1'), - ('245', '3688', '2006-02-16T02:30:53', '2005-07-06T06:51:14', '2005-07-10T02:30:14', '1'), - ('245', '2932', '2006-02-16T02:30:53', '2005-06-17T20:48:27', '2005-06-23T00:58:27', '2'), - ('245', '1489', '2006-02-16T02:30:53', '2005-07-12T16:41:00', '2005-07-21T20:52:00', '1'), - ('245', '3410', '2006-02-16T02:30:53', '2005-06-15T15:02:03', '2005-06-22T14:54:03', '2'), - ('245', '1899', '2006-02-16T02:30:53', '2005-06-20T21:07:54', '2005-06-23T16:01:54', '1'), - ('245', '1722', '2006-02-16T02:30:53', '2005-08-02T12:16:48', '2005-08-03T10:40:48', '1'), - ('245', '4088', '2006-02-16T02:30:53', '2005-05-29T06:03:41', '2005-06-03T08:52:41', '2'), - ('245', '1706', '2006-02-16T02:30:53', '2005-07-31T11:29:23', '2005-08-07T08:01:23', '2'), - ('245', '585', '2006-02-16T02:30:53', '2005-05-30T15:44:27', '2005-06-08T17:30:27', '2'), - ('245', '809', '2006-02-16T02:30:53', '2005-08-02T06:50:18', '2005-08-07T07:41:18', '2'), - ('245', '1567', '2006-02-16T02:30:53', '2005-07-30T11:35:00', '2005-08-06T16:16:00', '2'), - ('245', '213', '2006-02-16T02:30:53', '2005-07-27T10:08:36', '2005-07-31T16:00:36', '1'), - ('245', '3347', '2006-02-16T02:30:53', '2005-07-09T16:26:33', '2005-07-15T15:05:33', '2'), - ('245', '3299', '2006-02-16T02:30:53', '2005-05-25T12:11:07', '2005-06-03T10:54:07', '2'), - ('245', '4474', '2006-02-16T02:30:53', '2005-07-27T16:05:00', '2005-08-01T20:29:00', '1'), - ('245', '3170', '2006-02-16T02:30:53', '2005-08-02T08:13:31', '2005-08-03T11:08:31', '1'), - ('245', '670', '2006-02-16T02:30:53', '2005-07-11T14:45:04', '2005-07-12T18:34:04', '2'), - ('245', '1556', '2006-02-16T02:30:53', '2005-07-10T12:58:16', '2005-07-19T07:28:16', '1'), - ('245', '4500', '2006-02-16T02:30:53', '2005-07-27T00:10:58', '2005-07-30T02:11:58', '2'), - ('245', '1148', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('245', '1393', '2006-02-16T02:30:53', '2005-07-31T20:15:22', '2005-08-07T01:33:22', '1'), - ('160', '1307', '2006-02-16T02:30:53', '2005-07-31T09:25:38', '2005-08-03T14:16:38', '1'), - ('160', '1963', '2006-02-16T02:30:53', '2005-07-08T21:05:44', '2005-07-17T21:33:44', '2'), - ('160', '3648', '2006-02-16T02:30:53', '2005-08-17T11:42:08', '2005-08-22T07:45:08', '2'), - ('160', '248', '2006-02-16T02:30:53', '2005-07-31T20:17:09', '2005-08-01T19:14:09', '2'), - ('160', '697', '2006-02-16T02:30:53', '2005-08-02T09:54:50', '2005-08-06T14:48:50', '2'), - ('160', '3491', '2006-02-16T02:30:53', '2005-08-23T19:42:04', '2005-08-25T23:53:04', '1'), - ('160', '3350', '2006-02-16T02:30:53', '2005-08-01T21:37:10', '2005-08-03T01:33:10', '1'), - ('160', '609', '2006-02-16T02:30:53', '2005-07-27T20:16:03', '2005-07-29T18:50:03', '1'), - ('160', '2946', '2006-02-16T02:30:53', '2005-08-01T04:16:16', '2005-08-07T23:47:16', '1'), - ('160', '64', '2006-02-16T02:30:53', '2005-07-31T06:42:09', '2005-08-06T08:21:09', '1'), - ('160', '3321', '2006-02-16T02:30:53', '2005-06-20T00:41:25', '2005-06-25T02:06:25', '1'), - ('160', '1100', '2006-02-16T02:30:53', '2005-08-17T15:04:05', '2005-08-25T18:52:05', '2'), - ('160', '1249', '2006-02-16T02:30:53', '2005-07-28T22:22:35', '2005-07-31T19:30:35', '1'), - ('160', '3783', '2006-02-16T02:30:53', '2005-06-18T20:07:02', '2005-06-25T20:55:02', '1'), - ('160', '2629', '2006-02-16T02:30:53', '2005-08-18T06:52:36', '2005-08-25T12:06:36', '1'), - ('160', '2157', '2006-02-16T02:30:53', '2005-06-18T09:03:19', '2005-06-19T12:14:19', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['10979', '13093', '12435', '6448', '15642', '15112', '10958', '6364', '14868', '4842', '16027', '4632', '6513', '8448', '13357', '4275', '12563', '4791', '8004', '15527', '2219', '16049', '6930', '13184', '7486', '4546', '10158', '9763', '12059', '12676', '5099', '1915', '599', '1611', '15284', '3001', '15132', '12113', '6221', '886', '13788', '2319', '6884', '14326', '14346', '287', '8213', '2684', '14040', '9092', '9382', '884', '580', '2175', '5714', '8076', '5883', '9489', '3269', '11990', '15752', '13732', '9138', '4320', '10810', '4869', '11144', '8269', '10413', '13009', '5675', '6807', '1208', '2779', '6545', '15107', '9872', '4163', '9828', '11851', '8420', '3719', '9773', '6524', '4554', '554', '4166', '13761', '11792', '13141', '15382', '3876', '5994', '12041', '2999', '1935', '9692', '10349', '1184', '2054']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('160', '2625', '2006-02-16T02:30:53', '2005-08-02T04:16:37', '2005-08-06T00:01:37', '2'), - ('160', '1667', '2006-02-16T02:30:53', '2005-08-19T10:46:16', '2005-08-26T08:05:16', '1'), - ('160', '3211', '2006-02-16T02:30:53', '2005-08-18T10:38:31', '2005-08-26T15:18:31', '1'), - ('160', '2663', '2006-02-16T02:30:53', '2005-07-12T00:45:59', '2005-07-17T00:34:59', '1'), - ('160', '2627', '2006-02-16T02:30:53', '2005-08-23T08:09:11', '2005-08-28T05:57:11', '1'), - ('160', '2832', '2006-02-16T02:30:53', '2005-08-22T12:21:49', '2005-08-27T11:03:49', '1'), - ('160', '2174', '2006-02-16T02:30:53', '2005-08-02T03:37:13', '2005-08-04T23:28:13', '2'), - ('160', '4146', '2006-02-16T02:30:53', '2005-07-11T21:14:48', '2005-07-20T23:20:48', '2'), - ('160', '4383', '2006-02-16T02:30:53', '2005-08-22T03:15:01', '2005-08-25T01:24:01', '1'), - ('160', '1438', '2006-02-16T02:30:53', '2005-07-08T18:21:30', '2005-07-10T22:25:30', '2'), - ('160', '1724', '2006-02-16T02:30:53', '2005-08-23T21:49:33', '2005-08-30T16:19:33', '2'), - ('393', '4330', '2006-02-16T02:30:53', '2005-07-08T08:38:57', '2005-07-15T09:33:57', '1'), - ('393', '2671', '2006-02-16T02:30:53', '2005-07-12T03:44:43', '2005-07-13T05:54:43', '1'), - ('393', '4349', '2006-02-16T02:30:53', '2005-07-29T07:41:54', '2005-08-02T13:12:54', '1'), - ('393', '3295', '2006-02-16T02:30:53', '2005-08-19T21:02:59', '2005-08-25T23:46:59', '2'), - ('393', '1167', '2006-02-16T02:30:53', '2005-07-07T14:43:51', '2005-07-15T18:04:51', '2'), - ('393', '2552', '2006-02-16T02:30:53', '2005-08-18T15:08:29', '2005-08-27T15:15:29', '1'), - ('393', '2505', '2006-02-16T02:30:53', '2005-07-08T16:27:24', '2005-07-14T21:50:24', '2'), - ('393', '4428', '2006-02-16T02:30:53', '2005-07-28T15:14:07', '2005-07-30T19:32:07', '2'), - ('393', '88', '2006-02-16T02:30:53', '2005-08-23T03:44:51', '2005-08-25T03:09:51', '1'), - ('393', '1881', '2006-02-16T02:30:53', '2005-06-18T03:16:54', '2005-06-22T01:29:54', '1'), - ('393', '2666', '2006-02-16T02:30:53', '2005-08-23T22:50:12', '2005-08-30T01:01:12', '2'), - ('393', '2989', '2006-02-16T02:30:53', '2005-07-26T23:00:01', '2005-08-04T01:57:01', '2'), - ('393', '4395', '2006-02-16T02:30:53', '2005-08-19T14:16:18', '2005-08-20T08:44:18', '1'), - ('393', '4362', '2006-02-16T02:30:53', '2005-07-27T19:29:24', '2005-08-02T20:46:24', '2'), - ('393', '4507', '2006-02-16T02:30:53', '2005-07-08T04:18:36', '2005-07-17T08:23:36', '1'), - ('393', '1626', '2006-02-16T02:30:53', '2005-07-31T22:40:31', '2005-08-08T18:25:31', '2'), - ('393', '126', '2006-02-16T02:30:53', '2005-07-31T09:34:03', '2005-08-08T05:30:03', '1'), - ('393', '4111', '2006-02-16T02:30:53', '2005-08-17T21:09:23', '2005-08-25T23:09:23', '1'), - ('393', '2581', '2006-02-16T02:30:53', '2005-08-18T19:34:40', '2005-08-20T18:03:40', '2'), - ('393', '768', '2006-02-16T02:30:53', '2005-07-09T06:14:30', '2005-07-12T08:23:30', '2'), - ('393', '2620', '2006-02-16T02:30:53', '2005-06-17T05:28:28', '2005-06-21T07:12:28', '2'), - ('393', '4136', '2006-02-16T02:30:53', '2005-05-28T14:05:57', '2005-06-01T16:41:57', '2'), - ('393', '1739', '2006-02-16T02:30:53', '2005-06-16T06:41:35', '2005-06-25T06:13:35', '2'), - ('393', '2265', '2006-02-16T02:30:53', '2005-08-22T19:17:08', '2005-08-29T13:28:08', '2'), - ('393', '2941', '2006-02-16T02:30:53', '2005-06-20T09:50:16', '2005-06-28T05:13:16', '2'), - ('393', '3474', '2006-02-16T02:30:53', '2005-08-22T13:11:25', '2005-08-27T17:04:25', '2'), - ('393', '2707', '2006-02-16T02:30:53', '2005-08-17T23:01:00', '2005-08-25T03:57:00', '2'), - ('393', '1699', '2006-02-16T02:30:53', '2005-07-11T13:24:27', '2005-07-15T17:51:27', '1'), - ('393', '4356', '2006-02-16T02:30:53', '2005-05-30T06:54:51', '2005-06-01T06:04:51', '2'), - ('393', '3177', '2006-02-16T02:30:53', '2005-08-20T12:15:41', '2005-08-28T16:28:41', '2'), - ('393', '1521', '2006-02-16T02:30:53', '2005-06-18T09:24:22', '2005-06-26T14:12:22', '2'), - ('17', '3642', '2006-02-16T02:30:53', '2005-07-12T20:52:41', '2005-07-20T23:13:41', '1'), - ('17', '1052', '2006-02-16T02:30:53', '2005-08-21T08:15:41', '2005-08-27T05:22:41', '1'), - ('17', '109', '2006-02-16T02:30:53', '2005-08-21T08:42:26', '2005-08-23T09:18:26', '2'), - ('17', '3631', '2006-02-16T02:30:53', '2005-05-26T19:44:54', '2005-06-02T01:10:54', '1'), - ('17', '3816', '2006-02-16T02:30:53', '2005-07-28T23:37:33', '2005-07-31T00:32:33', '2'), - ('17', '1225', '2006-02-16T02:30:53', '2005-06-19T12:29:08', '2005-06-28T08:50:08', '2'), - ('17', '905', '2006-02-16T02:30:53', '2005-08-20T21:43:44', '2005-08-25T16:30:44', '1'), - ('17', '1877', '2006-02-16T02:30:53', '2005-07-30T08:30:56', '2005-08-06T08:09:56', '2'), - ('17', '2127', '2006-02-16T02:30:53', '2005-07-30T19:23:44', '2005-08-06T16:20:44', '2'), - ('17', '4079', '2006-02-16T02:30:53', '2005-05-30T06:41:32', '2005-05-31T07:39:32', '1'), - ('17', '3515', '2006-02-16T02:30:53', '2005-05-28T11:19:53', '2005-06-01T10:44:53', '2'), - ('17', '4038', '2006-02-16T02:30:53', '2005-06-18T00:17:58', '2005-06-22T23:18:58', '2'), - ('17', '3706', '2006-02-16T02:30:53', '2005-07-10T10:46:57', '2005-07-18T14:07:57', '1'), - ('17', '214', '2006-02-16T02:30:53', '2005-07-28T17:45:58', '2005-08-04T18:07:58', '2'), - ('17', '2820', '2006-02-16T02:30:53', '2005-07-10T19:25:21', '2005-07-16T20:50:21', '2'), - ('17', '4011', '2006-02-16T02:30:53', '2005-07-30T23:43:32', '2005-07-31T20:45:32', '2'), - ('17', '3828', '2006-02-16T02:30:53', '2005-06-21T05:06:30', '2005-06-27T09:26:30', '2'), - ('17', '3012', '2006-02-16T02:30:53', '2005-08-17T18:26:22', '2005-08-19T14:34:22', '2'), - ('17', '2112', '2006-02-16T02:30:53', '2005-08-23T12:41:38', '2005-09-01T14:06:38', '1'), - ('17', '1138', '2006-02-16T02:30:53', '2005-08-20T10:24:41', '2005-08-22T04:44:41', '1'), - ('17', '2550', '2006-02-16T02:30:53', '2005-07-30T10:11:52', '2005-07-31T07:05:52', '2'), - ('376', '3437', '2006-02-16T02:30:53', '2005-07-07T17:51:59', '2005-07-13T18:39:59', '1'), - ('376', '2314', '2006-02-16T02:30:53', '2005-08-01T22:40:39', '2005-08-06T19:47:39', '1'), - ('376', '2860', '2006-02-16T02:30:53', '2005-07-08T19:14:05', '2005-07-15T22:27:05', '1'), - ('376', '2724', '2006-02-16T02:30:53', '2005-08-02T09:39:17', '2005-08-03T11:53:17', '2'), - ('376', '2778', '2006-02-16T02:30:53', '2005-07-29T01:26:54', '2005-08-04T22:42:54', '1'), - ('376', '1018', '2006-02-16T02:30:53', '2005-08-01T07:59:39', '2005-08-08T03:55:39', '1'), - ('376', '677', '2006-02-16T02:30:53', '2005-08-19T07:50:35', '2005-08-21T06:04:35', '1'), - ('376', '2134', '2006-02-16T02:30:53', '2005-07-10T08:31:06', '2005-07-17T11:48:06', '1'), - ('376', '669', '2006-02-16T02:30:53', '2005-07-12T17:33:53', '2005-07-18T16:28:53', '2'), - ('376', '750', '2006-02-16T02:30:53', '2005-06-15T02:30:03', '2005-06-18T00:04:03', '1'), - ('376', '1020', '2006-02-16T02:30:53', '2005-06-19T18:19:07', '2005-06-23T18:25:07', '2'), - ('376', '4447', '2006-02-16T02:30:53', '2005-07-12T04:56:30', '2005-07-20T05:41:30', '1'), - ('376', '2378', '2006-02-16T02:30:53', '2005-08-22T12:05:02', '2005-08-23T11:09:02', '1'), - ('376', '1021', '2006-02-16T02:30:53', '2005-07-31T13:27:55', '2005-08-04T14:33:55', '1'), - ('376', '3176', '2006-02-16T02:30:53', '2005-07-07T09:19:28', '2005-07-10T06:47:28', '2'), - ('376', '3845', '2006-02-16T02:30:53', '2005-07-31T11:56:57', '2005-08-02T17:05:57', '1'), - ('376', '3225', '2006-02-16T02:30:53', '2005-08-17T13:30:27', '2005-08-20T15:34:27', '2'), - ('376', '4184', '2006-02-16T02:30:53', '2005-07-29T07:00:45', '2005-08-06T02:20:45', '1'), - ('376', '3573', '2006-02-16T02:30:53', '2005-07-06T11:05:55', '2005-07-11T08:10:55', '2'), - ('376', '4555', '2006-02-16T02:30:53', '2005-07-31T09:56:56', '2005-08-04T09:38:56', '1'), - ('376', '1467', '2006-02-16T02:30:53', '2005-07-12T04:14:35', '2005-07-17T03:59:35', '2'), - ('376', '3878', '2006-02-16T02:30:53', '2005-07-08T04:48:03', '2005-07-16T04:34:03', '1'), - ('376', '1951', '2006-02-16T02:30:53', '2005-05-28T08:23:16', '2005-05-31T03:29:16', '2'), - ('376', '3267', '2006-02-16T02:30:53', '2005-07-07T09:33:30', '2005-07-16T06:06:30', '1'), - ('376', '3149', '2006-02-16T02:30:53', '2005-08-20T11:28:50', '2005-08-21T12:05:50', '2'), - ('376', '3703', '2006-02-16T02:30:53', '2005-08-17T11:03:53', '2005-08-26T06:34:53', '1'), - ('376', '4545', '2006-02-16T02:30:53', '2005-08-19T12:41:41', '2005-08-21T08:17:41', '2'), - ('376', '333', '2006-02-16T02:30:53', '2005-08-22T22:30:50', '2005-08-24T04:07:50', '2'), - ('295', '4039', '2006-02-16T02:30:53', '2005-07-06T18:21:13', '2005-07-14T16:57:13', '2'), - ('295', '4287', '2006-02-16T02:30:53', '2005-07-11T01:14:10', '2005-07-12T00:42:10', '2'), - ('295', '2389', '2006-02-16T02:30:53', '2005-08-17T20:34:33', '2005-08-19T00:47:33', '1'), - ('295', '735', '2006-02-16T02:30:53', '2005-06-20T09:30:34', '2005-06-26T05:51:34', '2'), - ('295', '1962', '2006-02-16T02:30:53', '2005-06-17T07:14:15', '2005-06-20T05:59:15', '1'), - ('295', '3481', '2006-02-16T02:30:53', '2005-07-31T07:11:04', '2005-08-07T06:34:04', '2'), - ('295', '114', '2006-02-16T02:30:53', '2005-08-01T05:27:13', '2005-08-08T10:15:13', '1'), - ('295', '473', '2006-02-16T02:30:53', '2005-06-15T00:49:36', '2005-06-22T23:39:36', '2'), - ('295', '1588', '2006-02-16T02:30:53', '2005-06-17T15:26:37', '2005-06-26T14:22:37', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['3394', '15735', '3198', '5283', '11913', '14514', '3496', '1328', '2638', '14387', '5053', '6331', '14264', '5019', '371', '2431', '4432', '8087', '9793', '11083', '4164', '9425', '12383', '8840', '8932', '10222', '10160', '6252', '8108', '4949', '12119', '8629', '9279', '10708', '4576', '6551', '3010', '7340', '8201', '2689', '13031', '3769', '6358', '14839', '9475', '15594', '15074', '11749', '4457', '15758', '9045', '1214', '12280', '3916', '14940', '14144', '5698', '13226', '12455', '3855', '2203', '12095', '8152', '7336', '10827', '15708', '10428', '401', '10088', '9806', '12238', '11721', '14528', '2144', '1166', '10803', '2965', '12298', '938', '3439', '432', '2975', '15438', '6833', '5511', '7818', '7318', '15268', '10883', '15201', '5119', '4834', '5807', '227', '955', '4316', '2611', '5730', '1853', '27']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('295', '3393', '2006-02-16T02:30:53', '2005-06-21T15:17:39', '2005-06-30T13:55:39', '2'), - ('295', '3167', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('295', '1626', '2006-02-16T02:30:53', '2005-06-21T00:08:54', '2005-06-29T02:11:54', '2'), - ('295', '644', '2006-02-16T02:30:53', '2005-07-09T15:07:17', '2005-07-17T09:52:17', '2'), - ('295', '741', '2006-02-16T02:30:53', '2005-08-17T15:53:17', '2005-08-24T18:50:17', '2'), - ('295', '1259', '2006-02-16T02:30:53', '2005-08-21T14:51:52', '2005-08-30T10:40:52', '2'), - ('295', '2430', '2006-02-16T02:30:53', '2005-07-05T23:59:15', '2005-07-09T19:39:15', '2'), - ('295', '3665', '2006-02-16T02:30:53', '2005-06-15T11:23:27', '2005-06-19T12:42:27', '2'), - ('295', '2944', '2006-02-16T02:30:53', '2005-06-19T09:23:30', '2005-06-26T14:56:30', '1'), - ('295', '1286', '2006-02-16T02:30:53', '2005-08-21T10:10:01', '2005-08-28T14:16:01', '2'), - ('295', '570', '2006-02-16T02:30:53', '2005-07-09T03:59:46', '2005-07-09T23:53:46', '2'), - ('295', '1356', '2006-02-16T02:30:53', '2005-07-11T19:17:21', '2005-07-18T18:35:21', '2'), - ('295', '3426', '2006-02-16T02:30:53', '2005-08-21T06:18:22', '2005-08-25T08:08:22', '1'), - ('295', '3534', '2006-02-16T02:30:53', '2005-07-09T02:04:32', '2005-07-15T07:01:32', '2'), - ('295', '1235', '2006-02-16T02:30:53', '2005-05-27T08:08:18', '2005-06-05T03:05:18', '2'), - ('295', '1383', '2006-02-16T02:30:53', '2005-06-18T17:53:03', '2005-06-25T15:08:03', '2'), - ('295', '2779', '2006-02-16T02:30:53', '2005-07-07T22:40:02', '2005-07-15T01:46:02', '1'), - ('295', '1913', '2006-02-16T02:30:53', '2005-07-28T18:21:16', '2005-08-03T12:38:16', '2'), - ('295', '4576', '2006-02-16T02:30:53', '2005-07-31T10:45:11', '2005-08-03T14:29:11', '1'), - ('295', '4395', '2006-02-16T02:30:53', '2005-08-02T07:32:01', '2005-08-08T02:23:01', '1'), - ('295', '3133', '2006-02-16T02:30:53', '2005-07-07T09:20:11', '2005-07-14T09:35:11', '1'), - ('295', '271', '2006-02-16T02:30:53', '2005-07-30T21:11:21', '2005-08-05T19:00:21', '1'), - ('295', '1641', '2006-02-16T02:30:53', '2005-08-18T08:36:03', '2005-08-23T03:30:03', '2'), - ('295', '1484', '2006-02-16T02:30:53', '2005-07-29T22:55:38', '2005-08-06T02:11:38', '1'), - ('295', '4537', '2006-02-16T02:30:53', '2005-07-30T02:31:26', '2005-08-04T02:17:26', '2'), - ('295', '1214', '2006-02-16T02:30:53', '2005-08-01T01:17:42', '2005-08-08T02:45:42', '1'), - ('295', '863', '2006-02-16T02:30:53', '2005-07-31T23:07:40', '2005-08-05T23:34:40', '1'), - ('295', '1294', '2006-02-16T02:30:53', '2005-07-11T15:06:29', '2005-07-16T14:07:29', '1'), - ('295', '1600', '2006-02-16T02:30:53', '2005-07-28T19:07:38', '2005-08-03T15:13:38', '2'), - ('567', '1184', '2006-02-16T02:30:53', '2005-07-08T22:57:10', '2005-07-11T01:26:10', '2'), - ('567', '4298', '2006-02-16T02:30:53', '2005-08-17T23:16:44', '2005-08-20T02:13:44', '2'), - ('567', '853', '2006-02-16T02:30:53', '2005-07-29T14:06:35', '2005-08-03T16:59:35', '2'), - ('567', '1070', '2006-02-16T02:30:53', '2005-07-30T15:15:21', '2005-08-07T18:46:21', '1'), - ('567', '3978', '2006-02-16T02:30:53', '2005-08-01T18:43:28', '2005-08-09T15:24:28', '1'), - ('567', '1920', '2006-02-16T02:30:53', '2005-07-08T05:51:19', '2005-07-10T11:36:19', '1'), - ('567', '282', '2006-02-16T02:30:53', '2005-07-12T05:03:43', '2005-07-13T10:44:43', '1'), - ('567', '1298', '2006-02-16T02:30:53', '2005-06-20T10:29:59', '2005-06-27T06:52:59', '1'), - ('567', '1344', '2006-02-16T02:30:53', '2005-07-27T14:18:10', '2005-07-30T09:57:10', '1'), - ('567', '220', '2006-02-16T02:30:53', '2005-07-28T23:10:48', '2005-08-01T00:50:48', '2'), - ('567', '2478', '2006-02-16T02:30:53', '2005-06-19T12:58:53', '2005-06-24T17:35:53', '1'), - ('567', '1525', '2006-02-16T02:30:53', '2005-08-19T08:30:04', '2005-08-23T09:35:04', '2'), - ('567', '467', '2006-02-16T02:30:53', '2005-07-06T13:11:33', '2005-07-14T17:54:33', '2'), - ('567', '4527', '2006-02-16T02:30:53', '2005-07-11T21:03:12', '2005-07-15T20:06:12', '2'), - ('567', '3440', '2006-02-16T02:30:53', '2005-08-22T01:58:15', '2005-08-24T05:24:15', '2'), - ('567', '2186', '2006-02-16T02:30:53', '2005-07-30T23:06:33', '2005-08-04T23:23:33', '1'), - ('567', '4227', '2006-02-16T02:30:53', '2005-08-23T06:18:43', '2005-09-01T09:09:43', '2'), - ('567', '3112', '2006-02-16T02:30:53', '2005-08-22T11:02:52', '2005-08-28T07:59:52', '2'), - ('567', '4141', '2006-02-16T02:30:53', '2005-08-17T09:04:03', '2005-08-19T09:32:03', '2'), - ('567', '407', '2006-02-16T02:30:53', '2005-07-07T23:45:38', '2005-07-09T20:02:38', '1'), - ('46', '152', '2006-02-16T02:30:53', '2005-08-23T12:47:26', '2005-08-29T11:05:26', '2'), - ('46', '4521', '2006-02-16T02:30:53', '2005-07-30T06:36:57', '2005-08-08T01:51:57', '1'), - ('46', '4482', '2006-02-16T02:30:53', '2005-06-15T03:18:40', '2005-06-20T07:32:40', '1'), - ('46', '4032', '2006-02-16T02:30:53', '2005-08-18T04:49:27', '2005-08-21T03:39:27', '2'), - ('46', '3198', '2006-02-16T02:30:53', '2005-07-06T20:18:50', '2005-07-12T21:56:50', '1'), - ('46', '2635', '2006-02-16T02:30:53', '2005-08-22T05:54:03', '2005-08-24T05:52:03', '2'), - ('46', '2366', '2006-02-16T02:30:53', '2005-08-21T02:10:57', '2005-08-28T01:02:57', '1'), - ('46', '639', '2006-02-16T02:30:53', '2005-07-10T09:47:00', '2005-07-16T06:26:00', '1'), - ('46', '2850', '2006-02-16T02:30:53', '2005-08-19T16:05:36', '2005-08-21T10:07:36', '2'), - ('46', '4478', '2006-02-16T02:30:53', '2005-08-18T11:19:47', '2005-08-22T16:08:47', '2'), - ('46', '2931', '2006-02-16T02:30:53', '2005-07-06T17:03:48', '2005-07-12T14:32:48', '1'), - ('46', '1347', '2006-02-16T02:30:53', '2005-06-18T02:10:42', '2005-06-22T06:25:42', '2'), - ('46', '1089', '2006-02-16T02:30:53', '2005-08-17T22:32:37', '2005-08-20T04:00:37', '1'), - ('46', '2557', '2006-02-16T02:30:53', '2005-07-28T20:53:05', '2005-08-06T20:03:05', '2'), - ('46', '2706', '2006-02-16T02:30:53', '2005-07-27T14:11:45', '2005-07-28T11:00:45', '2'), - ('46', '1590', '2006-02-16T02:30:53', '2005-08-01T23:13:00', '2005-08-08T02:51:00', '1'), - ('46', '1974', '2006-02-16T02:30:53', '2005-08-23T10:35:51', '2005-08-27T16:02:51', '1'), - ('46', '4245', '2006-02-16T02:30:53', '2005-08-01T08:30:11', '2005-08-02T09:30:11', '2'), - ('46', '2179', '2006-02-16T02:30:53', '2005-05-27T12:57:55', '2005-05-29T17:55:55', '2'), - ('46', '4293', '2006-02-16T02:30:53', '2005-07-31T20:16:21', '2005-08-01T22:47:21', '2'), - ('46', '245', '2006-02-16T02:30:53', '2005-07-31T11:13:49', '2005-08-04T06:18:49', '1'), - ('46', '4043', '2006-02-16T02:30:53', '2005-08-18T03:25:08', '2005-08-20T02:41:08', '2'), - ('46', '1923', '2006-02-16T02:30:53', '2005-08-17T07:49:17', '2005-08-18T04:08:17', '1'), - ('46', '4305', '2006-02-16T02:30:53', '2005-08-21T15:08:05', '2005-08-26T15:58:05', '2'), - ('46', '3303', '2006-02-16T02:30:53', '2005-06-17T22:05:40', '2005-06-21T02:53:40', '1'), - ('46', '2508', '2006-02-16T02:30:53', '2005-06-14T23:17:03', '2005-06-15T20:43:03', '1'), - ('46', '3318', '2006-02-16T02:30:53', '2005-08-01T22:22:07', '2005-08-08T02:37:07', '2'), - ('46', '27', '2006-02-16T02:30:53', '2005-06-20T07:33:38', '2005-06-29T11:45:38', '1'), - ('46', '904', '2006-02-16T02:30:53', '2005-08-18T05:30:31', '2005-08-27T07:33:31', '1'), - ('46', '1521', '2006-02-16T02:30:53', '2005-05-30T14:47:31', '2005-06-04T10:10:31', '2'), - ('46', '1529', '2006-02-16T02:30:53', '2005-06-21T19:36:15', '2005-06-23T14:54:15', '2'), - ('46', '1119', '2006-02-16T02:30:53', '2005-05-27T16:40:29', '2005-05-29T16:20:29', '1'), - ('46', '4534', '2006-02-16T02:30:53', '2005-06-20T08:06:18', '2005-06-21T08:01:18', '1'), - ('46', '2030', '2006-02-16T02:30:53', '2005-08-23T00:31:57', '2005-08-26T20:02:57', '1'), - ('301', '912', '2006-02-16T02:30:53', '2005-07-12T18:53:34', '2005-07-19T22:21:34', '2'), - ('301', '3678', '2006-02-16T02:30:53', '2005-07-10T01:00:00', '2005-07-12T20:44:00', '1'), - ('301', '1672', '2006-02-16T02:30:53', '2005-07-28T08:25:00', '2005-07-29T14:07:00', '1'), - ('301', '1954', '2006-02-16T02:30:53', '2005-07-27T13:25:31', '2005-07-31T11:44:31', '2'), - ('301', '1245', '2006-02-16T02:30:53', '2005-08-22T18:39:11', '2005-08-26T21:46:11', '1'), - ('301', '4', '2006-02-16T02:30:53', '2005-08-02T00:47:19', '2005-08-03T00:02:19', '1'), - ('301', '4456', '2006-02-16T02:30:53', '2005-08-22T16:24:42', '2005-08-31T17:54:42', '1'), - ('301', '2996', '2006-02-16T02:30:53', '2005-07-09T07:14:18', '2005-07-18T04:07:18', '1'), - ('301', '1288', '2006-02-16T02:30:53', '2005-07-08T18:07:45', '2005-07-14T15:27:45', '1'), - ('301', '2092', '2006-02-16T02:30:53', '2005-07-10T15:16:30', '2005-07-11T14:02:30', '2'), - ('301', '214', '2006-02-16T02:30:53', '2005-05-26T10:51:46', '2005-05-30T07:24:46', '1'), - ('301', '4140', '2006-02-16T02:30:53', '2005-05-30T16:59:03', '2005-05-31T11:58:03', '2'), - ('301', '517', '2006-02-16T02:30:53', '2005-07-07T17:44:22', '2005-07-14T15:12:22', '2'), - ('301', '3682', '2006-02-16T02:30:53', '2005-06-19T07:18:17', '2005-06-21T10:19:17', '1'), - ('301', '1903', '2006-02-16T02:30:53', '2005-07-10T11:28:32', '2005-07-11T11:45:32', '2'), - ('301', '2949', '2006-02-16T02:30:53', '2005-06-17T00:39:54', '2005-06-19T00:22:54', '2'), - ('301', '1225', '2006-02-16T02:30:53', '2005-05-25T03:41:50', '2005-05-30T01:13:50', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['2925', '13633', '13183', '9435', '2051', '2555', '7520', '5397', '9297', '10532', '1278', '1173', '1677', '14361', '5924', '1870', '7450', '9964', '1134', '5338', '1152', '7150', '8583', '15375', '4761', '5280', '8512', '6777', '1792', '6180', '15762', '7630', '10119', '15142', '15712', '6664', '14368', '9707', '4544', '11127', '15664', '4756', '3836', '10501', '2759', '1137', '1869', '5912', '5909', '4390', '5849', '1497', '15054', '5787', '2866', '12982', '2809', '12504', '8866', '12790', '7526', '29', '407', '5551', '7514', '11364', '13428', '99', '904', '12345', '4723', '2369', '721', '8775', '12772', '10785', '6266', '11511', '6471', '14790', '12700', '1002', '5598', '7356', '12726', '7892', '10534', '3489', '8103', '10598', '15083', '12329', '12223', '14100', '12276', '4036', '9608', '1769', '5763', '9495']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('301', '804', '2006-02-16T02:30:53', '2005-06-20T04:23:49', '2005-06-22T04:37:49', '2'), - ('301', '3227', '2006-02-16T02:30:53', '2005-08-20T07:13:47', '2005-08-24T11:25:47', '1'), - ('301', '2404', '2006-02-16T02:30:53', '2005-08-19T14:09:26', '2005-08-28T08:44:26', '2'), - ('301', '3116', '2006-02-16T02:30:53', '2005-07-30T21:31:02', '2005-08-05T22:34:02', '1'), - ('191', '2366', '2006-02-16T02:30:53', '2005-06-17T15:10:16', '2005-06-19T20:45:16', '1'), - ('191', '260', '2006-02-16T02:30:53', '2005-06-19T03:07:02', '2005-06-25T05:25:02', '2'), - ('191', '3875', '2006-02-16T02:30:53', '2005-07-27T21:02:02', '2005-07-28T18:18:02', '1'), - ('191', '4376', '2006-02-16T02:30:53', '2005-07-09T19:43:51', '2005-07-17T00:11:51', '1'), - ('191', '3502', '2006-02-16T02:30:53', '2005-07-30T16:26:29', '2005-08-03T13:51:29', '1'), - ('191', '746', '2006-02-16T02:30:53', '2005-08-01T12:06:35', '2005-08-07T16:04:35', '2'), - ('191', '4471', '2006-02-16T02:30:53', '2005-06-15T08:09:12', '2005-06-17T04:05:12', '2'), - ('191', '1050', '2006-02-16T02:30:53', '2005-06-14T23:54:46', '2005-06-19T23:26:46', '2'), - ('191', '240', '2006-02-16T02:30:53', '2005-06-16T11:07:11', '2005-06-23T10:50:11', '1'), - ('191', '1231', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('191', '629', '2006-02-16T02:30:53', '2005-07-10T21:41:23', '2005-07-16T21:33:23', '1'), - ('191', '895', '2006-02-16T02:30:53', '2005-06-17T02:24:36', '2005-06-17T23:04:36', '2'), - ('191', '3496', '2006-02-16T02:30:53', '2005-07-27T18:18:35', '2005-08-04T15:18:35', '1'), - ('191', '3149', '2006-02-16T02:30:53', '2005-07-31T16:17:39', '2005-08-03T15:03:39', '1'), - ('191', '143', '2006-02-16T02:30:53', '2005-05-31T19:14:15', '2005-06-02T17:13:15', '2'), - ('191', '3449', '2006-02-16T02:30:53', '2005-07-09T17:07:07', '2005-07-14T11:15:07', '1'), - ('191', '210', '2006-02-16T02:30:53', '2005-05-31T21:32:17', '2005-06-04T21:07:17', '2'), - ('191', '457', '2006-02-16T02:30:53', '2005-07-27T07:11:14', '2005-08-05T06:55:14', '2'), - ('191', '3130', '2006-02-16T02:30:53', '2005-07-29T12:04:50', '2005-08-04T17:21:50', '1'), - ('191', '3864', '2006-02-16T02:30:53', '2005-08-22T22:12:02', '2005-08-24T00:50:02', '2'), - ('351', '3556', '2006-02-16T02:30:53', '2005-07-08T14:51:45', '2005-07-14T20:28:45', '1'), - ('351', '1177', '2006-02-16T02:30:53', '2005-07-09T14:55:07', '2005-07-12T10:05:07', '2'), - ('351', '4132', '2006-02-16T02:30:53', '2005-07-29T09:48:03', '2005-07-31T13:40:03', '1'), - ('351', '4089', '2006-02-16T02:30:53', '2005-07-12T16:04:40', '2005-07-20T15:05:40', '2'), - ('351', '3800', '2006-02-16T02:30:53', '2005-06-16T20:04:50', '2005-06-26T00:57:50', '1'), - ('351', '4401', '2006-02-16T02:30:53', '2005-07-11T11:06:50', '2005-07-19T09:03:50', '2'), - ('351', '887', '2006-02-16T02:30:53', '2005-08-23T13:01:43', '2005-08-26T16:35:43', '1'), - ('351', '2798', '2006-02-16T02:30:53', '2005-07-28T01:01:03', '2005-07-31T01:08:03', '2'), - ('351', '54', '2006-02-16T02:30:53', '2005-07-31T21:20:59', '2005-08-02T23:14:59', '2'), - ('351', '1337', '2006-02-16T02:30:53', '2005-08-22T13:44:32', '2005-08-29T14:19:32', '1'), - ('351', '1882', '2006-02-16T02:30:53', '2005-08-23T10:43:56', '2005-08-29T15:35:56', '2'), - ('351', '4578', '2006-02-16T02:30:53', '2005-07-12T11:28:22', '2005-07-15T09:30:22', '1'), - ('351', '2063', '2006-02-16T02:30:53', '2005-08-21T09:31:47', '2005-08-30T04:17:47', '1'), - ('351', '203', '2006-02-16T02:30:53', '2005-07-31T07:44:18', '2005-08-08T12:45:18', '1'), - ('351', '4471', '2006-02-16T02:30:53', '2005-07-08T04:11:04', '2005-07-09T22:48:04', '1'), - ('351', '1106', '2006-02-16T02:30:53', '2005-08-02T09:00:59', '2005-08-05T11:54:59', '2'), - ('351', '2029', '2006-02-16T02:30:53', '2005-08-23T08:57:11', '2005-08-31T14:19:11', '2'), - ('351', '3068', '2006-02-16T02:30:53', '2005-07-08T14:24:00', '2005-07-12T16:16:00', '1'), - ('351', '1148', '2006-02-16T02:30:53', '2005-07-06T16:26:04', '2005-07-10T15:08:04', '1'), - ('351', '1792', '2006-02-16T02:30:53', '2005-08-01T11:04:46', '2005-08-02T12:10:46', '2'), - ('351', '687', '2006-02-16T02:30:53', '2005-06-19T17:10:24', '2005-06-24T21:56:24', '2'), - ('351', '3259', '2006-02-16T02:30:53', '2005-05-31T19:20:14', '2005-06-07T16:10:14', '1'), - ('351', '871', '2006-02-16T02:30:53', '2005-06-17T02:08:00', '2005-06-19T21:43:00', '1'), - ('351', '1187', '2006-02-16T02:30:53', '2005-07-10T20:58:22', '2005-07-17T01:15:22', '2'), - ('44', '2333', '2006-02-16T02:30:53', '2005-07-10T20:46:13', '2005-07-14T18:01:13', '2'), - ('44', '6', '2006-02-16T02:30:53', '2005-07-07T20:59:06', '2005-07-09T00:04:06', '2'), - ('44', '1632', '2006-02-16T02:30:53', '2005-07-10T17:32:33', '2005-07-19T22:39:33', '1'), - ('44', '2958', '2006-02-16T02:30:53', '2005-06-15T21:56:39', '2005-06-20T20:32:39', '1'), - ('44', '2314', '2006-02-16T02:30:53', '2005-08-22T10:14:33', '2005-08-25T15:07:33', '1'), - ('44', '1075', '2006-02-16T02:30:53', '2005-07-10T14:08:49', '2005-07-19T18:29:49', '1'), - ('44', '2718', '2006-02-16T02:30:53', '2005-06-20T00:01:36', '2005-06-20T21:39:36', '1'), - ('44', '1258', '2006-02-16T02:30:53', '2005-08-19T07:06:34', '2005-08-21T06:53:34', '1'), - ('44', '1786', '2006-02-16T02:30:53', '2005-06-19T19:40:27', '2005-06-27T15:28:27', '2'), - ('44', '4429', '2006-02-16T02:30:53', '2005-08-18T13:17:07', '2005-08-24T09:13:07', '2'), - ('44', '1530', '2006-02-16T02:30:53', '2005-07-29T23:58:19', '2005-08-01T05:19:19', '2'), - ('44', '1281', '2006-02-16T02:30:53', '2005-08-19T00:16:54', '2005-08-26T02:00:54', '1'), - ('44', '696', '2006-02-16T02:30:53', '2005-07-27T21:13:47', '2005-08-05T15:23:47', '2'), - ('44', '611', '2006-02-16T02:30:53', '2005-05-25T03:47:12', '2005-05-30T00:31:12', '2'), - ('44', '1077', '2006-02-16T02:30:53', '2005-05-27T13:57:38', '2005-05-31T18:23:38', '1'), - ('44', '4238', '2006-02-16T02:30:53', '2005-07-10T03:01:09', '2005-07-18T02:04:09', '2'), - ('44', '400', '2006-02-16T02:30:53', '2005-07-27T20:51:49', '2005-07-29T18:21:49', '2'), - ('44', '4515', '2006-02-16T02:30:53', '2005-08-02T17:53:36', '2005-08-03T14:16:36', '1'), - ('44', '106', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('44', '535', '2006-02-16T02:30:53', '2005-05-25T16:50:20', '2005-05-28T18:52:20', '1'), - ('44', '2466', '2006-02-16T02:30:53', '2005-05-30T10:19:42', '2005-06-05T04:58:42', '2'), - ('44', '2359', '2006-02-16T02:30:53', '2005-08-18T07:16:58', '2005-08-25T05:50:58', '1'), - ('44', '965', '2006-02-16T02:30:53', '2005-07-08T12:44:59', '2005-07-17T07:22:59', '2'), - ('44', '1515', '2006-02-16T02:30:53', '2005-06-18T14:25:29', '2005-06-23T18:45:29', '2'), - ('44', '1116', '2006-02-16T02:30:53', '2005-05-29T05:28:47', '2005-05-31T11:24:47', '1'), - ('44', '1358', '2006-02-16T02:30:53', '2005-07-29T20:05:38', '2005-07-30T21:13:38', '1'), - ('397', '1179', '2006-02-16T02:30:53', '2005-08-18T23:29:25', '2005-08-23T20:32:25', '1'), - ('397', '2282', '2006-02-16T02:30:53', '2005-08-01T21:24:55', '2005-08-06T17:47:55', '1'), - ('397', '941', '2006-02-16T02:30:53', '2005-07-11T15:45:39', '2005-07-15T18:29:39', '1'), - ('397', '2127', '2006-02-16T02:30:53', '2005-08-16T23:39:59', '2005-08-18T18:04:59', '1'), - ('397', '2253', '2006-02-16T02:30:53', '2005-07-12T01:31:06', '2005-07-13T05:26:06', '1'), - ('397', '1002', '2006-02-16T02:30:53', '2005-08-22T00:34:17', '2005-08-31T02:27:17', '1'), - ('397', '540', '2006-02-16T02:30:53', '2005-08-18T20:24:46', '2005-08-23T21:50:46', '1'), - ('397', '709', '2006-02-16T02:30:53', '2005-05-31T00:47:56', '2005-06-06T19:51:56', '1'), - ('397', '3412', '2006-02-16T02:30:53', '2005-07-10T04:48:29', '2005-07-18T10:33:29', '2'), - ('397', '309', '2006-02-16T02:30:53', '2005-07-27T14:47:35', '2005-07-28T18:10:35', '2'), - ('397', '20', '2006-02-16T02:30:53', '2005-08-18T21:44:46', '2005-08-19T21:58:46', '2'), - ('397', '2717', '2006-02-16T02:30:53', '2005-07-28T10:46:58', '2005-07-30T16:03:58', '1'), - ('397', '4354', '2006-02-16T02:30:53', '2005-08-01T12:15:11', '2005-08-04T17:06:11', '1'), - ('397', '2936', '2006-02-16T02:30:53', '2005-07-05T23:33:40', '2005-07-15T02:15:40', '2'), - ('397', '4472', '2006-02-16T02:30:53', '2005-07-28T18:50:14', '2005-08-04T16:53:14', '1'), - ('397', '2341', '2006-02-16T02:30:53', '2005-08-01T14:23:36', '2005-08-10T14:07:36', '2'), - ('397', '1691', '2006-02-16T02:30:53', '2005-08-22T11:17:37', '2005-08-28T06:27:37', '2'), - ('397', '3127', '2006-02-16T02:30:53', '2005-08-18T06:44:30', '2005-08-25T04:05:30', '1'), - ('397', '4142', '2006-02-16T02:30:53', '2005-08-18T02:58:40', '2005-08-23T23:30:40', '2'), - ('397', '4295', '2006-02-16T02:30:53', '2005-08-21T00:31:07', '2005-08-25T05:31:07', '2'), - ('397', '4491', '2006-02-16T02:30:53', '2005-08-18T04:43:22', '2005-08-22T01:49:22', '2'), - ('397', '500', '2006-02-16T02:30:53', '2005-07-07T02:48:00', '2005-07-07T22:46:00', '1'), - ('397', '363', '2006-02-16T02:30:53', '2005-07-31T03:51:52', '2005-08-06T05:38:52', '2'), - ('397', '1229', '2006-02-16T02:30:53', '2005-06-16T18:07:48', '2005-06-22T12:39:48', '1'), - ('397', '753', '2006-02-16T02:30:53', '2005-07-10T12:58:12', '2005-07-14T08:52:12', '1'), - ('397', '2128', '2006-02-16T02:30:53', '2005-07-30T23:54:26', '2005-08-01T22:02:26', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['6014', '3027', '5103', '5428', '15825', '1994', '10521', '14890', '5557', '9927', '8543', '6136', '8505', '8732', '3372', '6881', '3421', '7943', '10389', '810', '15661', '9848', '11470', '10304', '8272', '4958', '15535', '9566', '15827', '11062', '6323', '65', '11375', '15459', '4420', '10156', '13240', '13400', '14589', '3844', '10569', '4618', '6806', '13957', '7054', '1286', '9893', '8573', '8731', '6071', '15985', '1046', '7609', '11342', '2613', '14082', '7028', '502', '10385', '9491', '13844', '3671', '6616', '759', '13452', '3153', '15031', '12965', '1274', '5958', '9450', '5217', '8560', '13454', '13007', '1759', '5002', '5879', '6043', '364', '12723', '1538', '2892', '1207', '30', '14058', '416', '6129', '6497', '134', '7786', '1006', '10043', '14350', '2603', '5635', '5592', '5266', '13477', '5']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('397', '3748', '2006-02-16T02:30:53', '2005-07-11T02:02:55', '2005-07-12T23:49:55', '1'), - ('397', '4028', '2006-02-16T02:30:53', '2005-06-20T11:50:30', '2005-06-25T15:58:30', '2'), - ('397', '2390', '2006-02-16T02:30:53', '2005-07-09T06:34:40', '2005-07-10T03:44:40', '2'), - ('346', '3109', '2006-02-16T02:30:53', '2005-07-09T21:12:50', '2005-07-14T16:25:50', '2'), - ('346', '149', '2006-02-16T02:30:53', '2005-08-23T15:10:42', '2005-08-29T09:28:42', '2'), - ('346', '2203', '2006-02-16T02:30:53', '2005-06-17T11:07:06', '2005-06-25T08:32:06', '2'), - ('346', '662', '2006-02-16T02:30:53', '2005-08-01T11:46:17', '2005-08-05T11:06:17', '2'), - ('346', '517', '2006-02-16T02:30:53', '2005-08-22T04:10:49', '2005-08-30T23:23:49', '1'), - ('346', '1433', '2006-02-16T02:30:53', '2005-07-10T03:10:21', '2005-07-11T21:34:21', '1'), - ('346', '999', '2006-02-16T02:30:53', '2005-07-31T15:12:13', '2005-08-01T11:37:13', '1'), - ('346', '403', '2006-02-16T02:30:53', '2005-07-29T11:01:57', '2005-08-03T06:03:57', '1'), - ('346', '205', '2006-02-16T02:30:53', '2005-07-11T08:34:09', '2005-07-14T06:11:09', '1'), - ('346', '1454', '2006-02-16T02:30:53', '2005-07-29T09:22:52', '2005-08-06T05:23:52', '1'), - ('346', '1143', '2006-02-16T02:30:53', '2005-07-29T18:25:03', '2005-08-07T18:56:03', '2'), - ('346', '4169', '2006-02-16T02:30:53', '2005-06-21T13:34:19', '2005-06-27T08:41:19', '2'), - ('346', '2496', '2006-02-16T02:30:53', '2005-07-12T20:46:35', '2005-07-21T00:26:35', '2'), - ('346', '3930', '2006-02-16T02:30:53', '2005-06-21T17:22:58', '2005-06-24T18:57:58', '1'), - ('346', '2914', '2006-02-16T02:30:53', '2005-07-28T12:50:55', '2005-08-04T11:29:55', '2'), - ('346', '3534', '2006-02-16T02:30:53', '2005-08-01T06:46:43', '2005-08-08T07:07:43', '2'), - ('346', '2533', '2006-02-16T02:30:53', '2005-05-29T19:12:04', '2005-06-04T21:12:04', '2'), - ('346', '1599', '2006-02-16T02:30:53', '2005-08-23T08:52:03', '2005-08-30T08:17:03', '2'), - ('346', '3290', '2006-02-16T02:30:53', '2005-07-31T12:44:33', '2005-08-07T13:49:33', '2'), - ('346', '2379', '2006-02-16T02:30:53', '2005-08-02T21:48:28', '2005-08-05T23:58:28', '2'), - ('346', '1538', '2006-02-16T02:30:53', '2005-08-01T04:14:12', '2005-08-07T22:38:12', '1'), - ('346', '70', '2006-02-16T02:30:53', '2005-07-29T01:29:51', '2005-08-03T21:56:51', '2'), - ('346', '2354', '2006-02-16T02:30:53', '2005-07-08T23:19:52', '2005-07-17T20:31:52', '1'), - ('346', '2371', '2006-02-16T02:30:53', '2005-08-23T03:58:02', '2005-08-25T05:06:02', '2'), - ('346', '643', '2006-02-16T02:30:53', '2005-07-31T02:32:10', '2005-08-02T23:54:10', '2'), - ('346', '1732', '2006-02-16T02:30:53', '2005-08-23T15:15:19', '2005-08-24T10:50:19', '2'), - ('346', '2014', '2006-02-16T02:30:53', '2005-08-02T06:52:54', '2005-08-07T10:59:54', '1'), - ('346', '1352', '2006-02-16T02:30:53', '2005-07-11T19:02:19', '2005-07-14T15:54:19', '1'), - ('346', '3552', '2006-02-16T02:30:53', '2005-05-25T09:32:03', '2005-05-29T14:21:03', '1'), - ('346', '1064', '2006-02-16T02:30:53', '2005-08-02T18:14:56', '2005-08-08T23:29:56', '1'), - ('346', '2058', '2006-02-16T02:30:53', '2005-08-23T01:09:48', '2005-08-24T04:52:48', '1'), - ('346', '4427', '2006-02-16T02:30:53', '2005-07-07T22:07:31', '2005-07-12T19:14:31', '2'), - ('179', '141', '2006-02-16T02:30:53', '2005-07-31T22:36:00', '2005-08-02T00:03:00', '2'), - ('179', '1411', '2006-02-16T02:30:53', '2005-08-19T16:22:14', '2005-08-20T13:24:14', '1'), - ('179', '2173', '2006-02-16T02:30:53', '2005-08-19T22:11:44', '2005-08-20T23:27:44', '2'), - ('179', '2810', '2006-02-16T02:30:53', '2005-08-21T17:28:55', '2005-08-22T23:06:55', '1'), - ('179', '2814', '2006-02-16T02:30:53', '2005-07-06T16:37:58', '2005-07-09T19:54:58', '2'), - ('179', '611', '2006-02-16T02:30:53', '2005-08-01T13:18:23', '2005-08-10T13:33:23', '1'), - ('179', '3691', '2006-02-16T02:30:53', '2005-07-08T08:00:20', '2005-07-14T05:59:20', '1'), - ('179', '656', '2006-02-16T02:30:53', '2005-07-12T17:31:43', '2005-07-17T14:36:43', '1'), - ('179', '2889', '2006-02-16T02:30:53', '2005-08-20T18:09:04', '2005-08-23T16:52:04', '1'), - ('179', '2661', '2006-02-16T02:30:53', '2005-07-27T03:43:28', '2005-08-04T09:15:28', '1'), - ('179', '774', '2006-02-16T02:30:53', '2005-06-15T08:41:13', '2005-06-23T13:13:13', '2'), - ('179', '2445', '2006-02-16T02:30:53', '2005-07-31T14:07:21', '2005-08-01T09:20:21', '2'), - ('179', '1637', '2006-02-16T02:30:53', '2005-07-29T11:51:25', '2005-08-07T08:53:25', '1'), - ('179', '2638', '2006-02-16T02:30:53', '2005-07-29T18:23:57', '2005-08-05T19:38:57', '1'), - ('179', '889', '2006-02-16T02:30:53', '2005-07-11T04:50:03', '2005-07-19T23:52:03', '1'), - ('179', '2646', '2006-02-16T02:30:53', '2005-08-23T20:20:23', '2005-08-26T20:55:23', '1'), - ('179', '468', '2006-02-16T02:30:53', '2005-05-31T06:42:30', '2005-06-03T04:33:30', '2'), - ('179', '3655', '2006-02-16T02:30:53', '2005-07-28T00:11:00', '2005-07-31T03:04:00', '1'), - ('179', '4251', '2006-02-16T02:30:53', '2005-08-02T17:11:35', '2005-08-07T15:04:35', '1'), - ('179', '3830', '2006-02-16T02:30:53', '2005-06-19T07:25:50', '2005-06-21T03:04:50', '1'), - ('179', '3767', '2006-02-16T02:30:53', '2005-08-20T23:42:00', '2005-08-27T00:59:00', '1'), - ('179', '834', '2006-02-16T02:30:53', '2005-07-27T02:54:25', '2005-08-02T06:16:25', '2'), - ('179', '3131', '2006-02-16T02:30:53', '2005-05-28T01:34:43', '2005-05-31T01:02:43', '2'), - ('179', '778', '2006-02-16T02:30:53', '2005-08-01T06:39:55', '2005-08-06T02:16:55', '1'), - ('179', '3624', '2006-02-16T02:30:53', '2005-07-30T23:45:23', '2005-08-01T00:33:23', '2'), - ('179', '983', '2006-02-16T02:30:53', '2005-08-20T14:30:26', '2005-08-29T17:08:26', '1'), - ('179', '2821', '2006-02-16T02:30:53', '2005-07-06T09:01:29', '2005-07-15T08:08:29', '1'), - ('179', '1833', '2006-02-16T02:30:53', '2005-07-12T08:37:30', '2005-07-20T10:33:30', '1'), - ('179', '2367', '2006-02-16T02:30:53', '2005-05-29T10:57:57', '2005-06-07T16:23:57', '2'), - ('430', '2449', '2006-02-16T02:30:53', '2005-08-20T00:20:07', '2005-08-25T05:43:07', '1'), - ('430', '659', '2006-02-16T02:30:53', '2005-06-20T20:44:15', '2005-06-23T16:04:15', '1'), - ('430', '3926', '2006-02-16T02:30:53', '2005-08-22T09:11:48', '2005-08-27T06:11:48', '1'), - ('430', '4308', '2006-02-16T02:30:53', '2005-08-19T06:33:00', '2005-08-22T02:02:00', '1'), - ('430', '2765', '2006-02-16T02:30:53', '2005-06-15T07:52:52', '2005-06-20T10:01:52', '1'), - ('430', '3468', '2006-02-16T02:30:53', '2005-07-10T23:31:51', '2005-07-19T00:36:51', '2'), - ('430', '1371', '2006-02-16T02:30:53', '2005-07-30T22:04:04', '2005-08-05T18:39:04', '2'), - ('430', '4150', '2006-02-16T02:30:53', '2005-07-09T11:56:50', '2005-07-17T07:10:50', '1'), - ('430', '3499', '2006-02-16T02:30:53', '2005-07-29T11:27:27', '2005-08-01T12:05:27', '2'), - ('430', '1553', '2006-02-16T02:30:53', '2005-08-20T00:30:52', '2005-08-27T19:45:52', '2'), - ('430', '4280', '2006-02-16T02:30:53', '2005-08-19T07:47:43', '2005-08-26T02:48:43', '2'), - ('430', '1402', '2006-02-16T02:30:53', '2005-06-16T17:46:37', '2005-06-24T19:40:37', '2'), - ('430', '2388', '2006-02-16T02:30:53', '2005-07-09T01:17:08', '2005-07-15T21:53:08', '1'), - ('430', '3851', '2006-02-16T02:30:53', '2005-07-10T19:12:47', '2005-07-16T16:32:47', '1'), - ('430', '3303', '2006-02-16T02:30:53', '2005-07-11T03:18:10', '2005-07-12T05:50:10', '1'), - ('430', '833', '2006-02-16T02:30:53', '2005-05-27T07:20:12', '2005-05-31T10:44:12', '2'), - ('430', '4167', '2006-02-16T02:30:53', '2005-08-18T21:34:16', '2005-08-22T22:37:16', '1'), - ('430', '708', '2006-02-16T02:30:53', '2005-06-16T01:05:50', '2005-06-18T19:48:50', '1'), - ('430', '2993', '2006-02-16T02:30:53', '2005-06-20T02:06:39', '2005-06-21T02:50:39', '2'), - ('430', '2277', '2006-02-16T02:30:53', '2005-06-15T02:27:08', '2005-06-19T08:18:08', '2'), - ('430', '3744', '2006-02-16T02:30:53', '2005-05-25T04:01:32', '2005-05-30T03:12:32', '1'), - ('430', '178', '2006-02-16T02:30:53', '2005-08-20T22:24:35', '2005-08-30T02:26:35', '1'), - ('222', '2371', '2006-02-16T02:30:53', '2005-05-27T15:02:10', '2005-05-29T10:34:10', '2'), - ('222', '3875', '2006-02-16T02:30:53', '2005-07-11T08:15:09', '2005-07-18T13:00:09', '1'), - ('222', '933', '2006-02-16T02:30:53', '2005-07-12T03:04:29', '2005-07-17T21:36:29', '2'), - ('222', '2272', '2006-02-16T02:30:53', '2005-05-25T21:48:41', '2005-06-02T18:28:41', '1'), - ('222', '2285', '2006-02-16T02:30:53', '2005-07-28T07:18:26', '2005-07-29T03:00:26', '1'), - ('222', '3461', '2006-02-16T02:30:53', '2005-05-31T00:57:08', '2005-06-02T22:35:08', '1'), - ('222', '2558', '2006-02-16T02:30:53', '2005-07-31T19:02:07', '2005-08-07T17:58:07', '1'), - ('222', '3174', '2006-02-16T02:30:53', '2005-08-21T08:58:38', '2005-08-30T03:29:38', '2'), - ('222', '587', '2006-02-16T02:30:53', '2005-06-19T06:21:25', '2005-06-26T03:19:25', '1'), - ('222', '1457', '2006-02-16T02:30:53', '2005-07-10T06:28:39', '2005-07-17T08:35:39', '2'), - ('222', '2471', '2006-02-16T02:30:53', '2005-07-10T04:26:13', '2005-07-19T02:32:13', '2'), - ('222', '2409', '2006-02-16T02:30:53', '2005-07-09T14:17:40', '2005-07-16T10:42:40', '1'), - ('222', '1442', '2006-02-16T02:30:53', '2005-08-20T01:07:00', '2005-08-26T02:47:00', '1'), - ('222', '2079', '2006-02-16T02:30:53', '2005-05-24T23:05:21', '2005-06-02T04:33:21', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['809', '5209', '12179', '1368', '8597', '8787', '8300', '10444', '12845', '7224', '10228', '552', '11436', '14920', '14431', '10213', '1156', '5453', '4229', '15154', '6992', '4277', '2295', '4665', '7483', '3023', '9072', '12159', '9747', '8115', '3702', '10888', '5373', '634', '3377', '1471', '3925', '9982', '10577', '8387', '4151', '6735', '7823', '9904', '8528', '8155', '1227', '1601', '2677', '11536', '9742', '14450', '5148', '72', '6498', '4367', '10276', '9402', '1689', '7920', '3758', '14536', '8716', '390', '297', '2822', '15228', '7050', '12776', '1027', '12972', '1825', '2904', '12808', '4671', '2976', '15296', '11287', '2062', '1048', '9798', '9596', '14667', '13345', '3149', '8288', '555', '9302', '6314', '11890', '8689', '8510', '3994', '13658', '3100', '9490', '7097', '15665', '11669', '10511']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('222', '2114', '2006-02-16T02:30:53', '2005-05-29T19:10:20', '2005-06-05T19:05:20', '2'), - ('222', '4441', '2006-02-16T02:30:53', '2005-07-09T11:22:39', '2005-07-17T09:31:39', '1'), - ('222', '1499', '2006-02-16T02:30:53', '2005-08-18T01:21:21', '2005-08-19T00:59:21', '1'), - ('222', '2020', '2006-02-16T02:30:53', '2005-06-15T14:27:47', '2005-06-23T18:07:47', '2'), - ('222', '4218', '2006-02-16T02:30:53', '2005-07-29T12:55:55', '2005-08-05T18:54:55', '1'), - ('222', '2366', '2006-02-16T02:30:53', '2005-07-29T20:43:49', '2005-07-31T15:15:49', '1'), - ('222', '4364', '2006-02-16T02:30:53', '2005-07-29T02:57:59', '2005-08-05T01:12:59', '2'), - ('106', '3242', '2006-02-16T02:30:53', '2005-08-01T09:01:40', '2005-08-09T11:31:40', '1'), - ('106', '1698', '2006-02-16T02:30:53', '2005-08-19T02:02:37', '2005-08-22T01:08:37', '1'), - ('106', '2701', '2006-02-16T02:30:53', '2005-07-27T09:44:26', '2005-08-05T12:46:26', '2'), - ('106', '1742', '2006-02-16T02:30:53', '2005-08-01T01:43:18', '2005-08-06T22:10:18', '2'), - ('106', '23', '2006-02-16T02:30:53', '2005-05-28T07:53:38', '2005-06-04T12:45:38', '2'), - ('106', '3834', '2006-02-16T02:30:53', '2005-08-02T20:16:06', '2005-08-05T20:40:06', '2'), - ('106', '3357', '2006-02-16T02:30:53', '2005-08-22T05:08:58', '2005-08-23T02:51:58', '1'), - ('106', '1572', '2006-02-16T02:30:53', '2005-08-21T11:31:15', '2005-08-26T11:22:15', '2'), - ('106', '1462', '2006-02-16T02:30:53', '2005-08-01T01:03:18', '2005-08-09T20:07:18', '1'), - ('106', '460', '2006-02-16T02:30:53', '2005-05-31T22:37:34', '2005-06-01T23:02:34', '2'), - ('106', '1780', '2006-02-16T02:30:53', '2005-07-09T22:24:11', '2005-07-19T04:08:11', '1'), - ('106', '953', '2006-02-16T02:30:53', '2005-07-07T12:43:23', '2005-07-13T15:00:23', '2'), - ('106', '3395', '2006-02-16T02:30:53', '2005-08-22T14:27:37', '2005-08-29T20:04:37', '2'), - ('106', '3411', '2006-02-16T02:30:53', '2005-07-27T01:04:45', '2005-07-28T02:34:45', '2'), - ('106', '1983', '2006-02-16T02:30:53', '2005-07-07T14:52:12', '2005-07-09T13:10:12', '1'), - ('106', '3250', '2006-02-16T02:30:53', '2005-06-18T07:56:18', '2005-06-21T07:10:18', '1'), - ('106', '575', '2006-02-16T02:30:53', '2005-07-08T10:04:24', '2005-07-14T15:13:24', '1'), - ('106', '3678', '2006-02-16T02:30:53', '2005-07-27T19:25:00', '2005-07-29T21:19:00', '2'), - ('106', '4304', '2006-02-16T02:30:53', '2005-06-20T11:18:11', '2005-06-21T12:43:11', '1'), - ('106', '4536', '2006-02-16T02:30:53', '2005-07-30T07:45:49', '2005-08-04T10:00:49', '1'), - ('106', '2243', '2006-02-16T02:30:53', '2005-08-18T00:36:09', '2005-08-27T06:31:09', '1'), - ('106', '2455', '2006-02-16T02:30:53', '2005-07-31T09:16:57', '2005-08-08T06:47:57', '2'), - ('106', '2080', '2006-02-16T02:30:53', '2005-07-28T19:14:17', '2005-08-03T14:58:17', '2'), - ('428', '2204', '2006-02-16T02:30:53', '2005-07-06T10:13:56', '2005-07-10T08:12:56', '1'), - ('428', '2412', '2006-02-16T02:30:53', '2005-08-02T00:52:45', '2005-08-03T03:07:45', '1'), - ('428', '950', '2006-02-16T02:30:53', '2005-07-09T18:48:57', '2005-07-10T16:34:57', '1'), - ('428', '2630', '2006-02-16T02:30:53', '2005-05-28T17:40:35', '2005-06-05T16:18:35', '2'), - ('428', '1845', '2006-02-16T02:30:53', '2005-06-21T13:51:12', '2005-06-22T18:16:12', '1'), - ('428', '565', '2006-02-16T02:30:53', '2005-06-15T20:53:26', '2005-06-24T18:25:26', '2'), - ('428', '2653', '2006-02-16T02:30:53', '2005-07-06T20:41:44', '2005-07-15T21:05:44', '2'), - ('428', '2698', '2006-02-16T02:30:53', '2005-07-31T17:09:02', '2005-08-02T13:02:02', '2'), - ('428', '2240', '2006-02-16T02:30:53', '2005-08-01T13:46:38', '2005-08-06T11:35:38', '2'), - ('428', '910', '2006-02-16T02:30:53', '2005-07-29T05:47:27', '2005-07-31T06:26:27', '1'), - ('428', '4564', '2006-02-16T02:30:53', '2005-07-07T08:49:02', '2005-07-11T05:19:02', '1'), - ('428', '276', '2006-02-16T02:30:53', '2005-07-12T14:08:20', '2005-07-18T09:41:20', '2'), - ('428', '84', '2006-02-16T02:30:53', '2005-07-28T08:32:53', '2005-08-06T11:59:53', '1'), - ('428', '4089', '2006-02-16T02:30:53', '2005-07-31T14:34:17', '2005-08-08T17:19:17', '1'), - ('428', '2107', '2006-02-16T02:30:53', '2005-07-29T10:24:22', '2005-08-07T10:34:22', '1'), - ('428', '3023', '2006-02-16T02:30:53', '2005-07-28T20:57:06', '2005-08-02T18:40:06', '2'), - ('428', '654', '2006-02-16T02:30:53', '2005-06-15T03:50:03', '2005-06-21T23:48:03', '2'), - ('428', '3115', '2006-02-16T02:30:53', '2005-06-16T06:11:13', '2005-06-21T08:57:13', '2'), - ('428', '4384', '2006-02-16T02:30:53', '2005-06-19T12:01:59', '2005-06-21T06:15:59', '2'), - ('428', '2735', '2006-02-16T02:30:53', '2005-08-17T00:40:03', '2005-08-21T19:11:03', '1'), - ('48', '4058', '2006-02-16T02:30:53', '2005-07-31T09:10:20', '2005-08-08T10:07:20', '1'), - ('48', '1194', '2006-02-16T02:30:53', '2005-08-21T12:21:25', '2005-08-26T14:35:25', '2'), - ('48', '456', '2006-02-16T02:30:53', '2005-07-09T08:22:46', '2005-07-18T04:36:46', '1'), - ('48', '2260', '2006-02-16T02:30:53', '2005-05-25T10:52:13', '2005-05-28T05:52:13', '2'), - ('48', '243', '2006-02-16T02:30:53', '2005-07-12T03:05:38', '2005-07-19T07:12:38', '1'), - ('48', '4529', '2006-02-16T02:30:53', '2005-07-07T19:52:01', '2005-07-13T19:41:01', '2'), - ('48', '2201', '2006-02-16T02:30:53', '2005-08-01T03:22:23', '2005-08-03T07:59:23', '1'), - ('48', '2424', '2006-02-16T02:30:53', '2005-07-30T20:18:27', '2005-08-07T21:29:27', '2'), - ('48', '4036', '2006-02-16T02:30:53', '2005-06-16T12:18:41', '2005-06-24T13:33:41', '2'), - ('48', '66', '2006-02-16T02:30:53', '2005-07-28T12:01:19', '2005-08-05T07:08:19', '1'), - ('48', '2498', '2006-02-16T02:30:53', '2005-07-06T12:43:11', '2005-07-14T12:52:11', '2'), - ('48', '2615', '2006-02-16T02:30:53', '2005-08-21T15:22:50', '2005-08-27T17:03:50', '1'), - ('48', '2123', '2006-02-16T02:30:53', '2005-07-29T17:39:09', '2005-08-03T20:26:09', '2'), - ('48', '3759', '2006-02-16T02:30:53', '2005-05-27T11:02:26', '2005-06-02T16:09:26', '2'), - ('48', '1594', '2006-02-16T02:30:53', '2005-05-26T20:48:48', '2005-05-27T19:52:48', '2'), - ('48', '3599', '2006-02-16T02:30:53', '2005-06-19T20:29:24', '2005-06-23T02:21:24', '1'), - ('48', '2485', '2006-02-16T02:30:53', '2005-08-22T17:27:23', '2005-08-29T11:38:23', '2'), - ('55', '1135', '2006-02-16T02:30:53', '2005-07-27T03:33:17', '2005-08-02T03:12:17', '1'), - ('55', '2345', '2006-02-16T02:30:53', '2005-08-18T23:37:33', '2005-08-23T03:07:33', '1'), - ('55', '2718', '2006-02-16T02:30:53', '2005-05-31T03:46:19', '2005-06-09T03:50:19', '1'), - ('55', '1218', '2006-02-16T02:30:53', '2005-08-19T06:43:28', '2005-08-27T11:30:28', '1'), - ('55', '2908', '2006-02-16T02:30:53', '2005-06-16T21:53:05', '2005-06-20T17:22:05', '2'), - ('55', '2195', '2006-02-16T02:30:53', '2005-06-20T02:54:06', '2005-06-21T06:57:06', '2'), - ('55', '3920', '2006-02-16T02:30:53', '2005-08-19T00:40:41', '2005-08-21T06:39:41', '2'), - ('55', '2139', '2006-02-16T02:30:53', '2005-07-08T10:15:32', '2005-07-14T08:19:32', '2'), - ('55', '4210', '2006-02-16T02:30:53', '2005-06-20T08:09:11', '2005-06-21T10:45:11', '1'), - ('55', '2715', '2006-02-16T02:30:53', '2005-08-22T19:37:20', '2005-08-24T15:16:20', '1'), - ('55', '927', '2006-02-16T02:30:53', '2005-08-02T14:49:51', '2005-08-09T09:19:51', '2'), - ('55', '1749', '2006-02-16T02:30:53', '2005-06-17T15:56:43', '2005-06-20T21:37:43', '2'), - ('55', '2811', '2006-02-16T02:30:53', '2005-05-31T06:49:53', '2005-06-02T11:33:53', '1'), - ('55', '3759', '2006-02-16T02:30:53', '2005-07-31T10:55:18', '2005-08-01T07:37:18', '2'), - ('55', '2847', '2006-02-16T02:30:53', '2005-07-31T03:28:47', '2005-08-04T03:43:47', '2'), - ('55', '2608', '2006-02-16T02:30:53', '2005-08-21T19:51:11', '2005-08-23T17:37:11', '1'), - ('55', '47', '2006-02-16T02:30:53', '2005-08-19T20:25:24', '2005-08-27T20:38:24', '1'), - ('55', '3295', '2006-02-16T02:30:53', '2005-06-20T20:34:55', '2005-06-21T18:51:55', '1'), - ('55', '1822', '2006-02-16T02:30:53', '2005-07-29T02:04:22', '2005-08-05T04:21:22', '2'), - ('55', '4397', '2006-02-16T02:30:53', '2005-05-28T08:31:14', '2005-05-30T07:34:14', '2'), - ('55', '2326', '2006-02-16T02:30:53', '2005-07-30T16:34:57', '2005-07-31T11:08:57', '2'), - ('55', '4128', '2006-02-16T02:30:53', '2005-07-11T18:32:44', '2005-07-17T23:58:44', '1'), - ('487', '3023', '2006-02-16T02:30:53', '2005-08-17T15:08:43', '2005-08-26T14:56:43', '2'), - ('487', '824', '2006-02-16T02:30:53', '2005-07-29T16:38:58', '2005-08-01T17:09:58', '2'), - ('487', '7', '2006-02-16T02:30:53', '2005-07-29T09:41:38', '2005-08-05T05:30:38', '2'), - ('487', '902', '2006-02-16T02:30:53', '2005-07-06T23:39:01', '2005-07-14T00:33:01', '1'), - ('487', '3827', '2006-02-16T02:30:53', '2005-08-20T08:02:22', '2005-08-28T06:00:22', '1'), - ('487', '2428', '2006-02-16T02:30:53', '2005-06-20T16:47:57', '2005-06-26T16:59:57', '1'), - ('487', '1302', '2006-02-16T02:30:53', '2005-07-30T23:45:09', '2005-08-07T18:50:09', '1'), - ('487', '258', '2006-02-16T02:30:53', '2005-07-27T04:56:09', '2005-07-31T05:47:09', '1'), - ('487', '3471', '2006-02-16T02:30:53', '2005-08-23T08:59:12', '2005-08-24T12:50:12', '2'), - ('487', '3224', '2006-02-16T02:30:53', '2005-08-17T05:48:51', '2005-08-22T01:22:51', '1'), - ('487', '3874', '2006-02-16T02:30:53', '2005-08-01T11:32:16', '2005-08-04T09:38:16', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['8988', '6928', '4854', '10123', '5634', '10555', '7788', '7949', '10877', '10832', '12493', '13210', '9457', '10978', '8814', '12657', '3468', '4980', '7921', '5238', '6655', '71', '15163', '4970', '5355', '11346', '9048', '11143', '9271', '1216', '4209', '8203', '1427', '15246', '3800', '15021', '7819', '1340', '3602', '8282', '12582', '8066', '7295', '8290', '15943', '16013', '3279', '11808', '7932', '13492', '12466', '6721', '13041', '8757', '6710', '7324', '1773', '6583', '1926', '4500', '10283', '6630', '4728', '11639', '9891', '156', '13328', '12802', '7762', '7935', '590', '15581', '8209', '1803', '7912', '452', '13043', '13091', '14189', '5983', '11235', '10787', '4652', '14030', '10197', '1293', '15463', '2412', '9859', '15736', '5499', '12060', '708', '4811', '10973', '12820', '4014', '75', '12317', '2729']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('487', '777', '2006-02-16T02:30:53', '2005-07-30T04:38:49', '2005-08-07T07:00:49', '2'), - ('487', '3605', '2006-02-16T02:30:53', '2005-07-26T22:56:21', '2005-07-30T04:46:21', '1'), - ('487', '3644', '2006-02-16T02:30:53', '2005-07-08T18:44:44', '2005-07-13T13:37:44', '1'), - ('487', '4564', '2006-02-16T02:30:53', '2005-07-31T21:30:46', '2005-08-06T16:28:46', '1'), - ('487', '323', '2006-02-16T02:30:53', '2005-07-10T06:25:48', '2005-07-17T09:07:48', '2'), - ('487', '377', '2006-02-16T02:30:53', '2005-08-01T12:56:38', '2005-08-10T18:19:38', '1'), - ('487', '95', '2006-02-16T02:30:53', '2005-07-28T07:21:55', '2005-08-03T06:33:55', '1'), - ('487', '2145', '2006-02-16T02:30:53', '2005-07-28T13:07:24', '2005-08-02T09:41:24', '1'), - ('487', '3337', '2006-02-16T02:30:53', '2005-08-02T00:32:04', '2005-08-07T19:44:04', '2'), - ('487', '4096', '2006-02-16T02:30:53', '2005-08-01T23:24:53', '2005-08-06T23:18:53', '1'), - ('487', '3029', '2006-02-16T02:30:53', '2005-08-18T12:53:38', '2005-08-27T13:15:38', '2'), - ('487', '2789', '2006-02-16T02:30:53', '2005-08-19T15:23:38', '2005-08-21T11:57:38', '1'), - ('487', '2172', '2006-02-16T02:30:53', '2005-07-30T22:23:05', '2005-07-31T23:07:05', '2'), - ('487', '1597', '2006-02-16T02:30:53', '2005-08-02T04:12:27', '2005-08-10T08:19:27', '2'), - ('487', '1492', '2006-02-16T02:30:53', '2005-07-29T21:49:43', '2005-08-01T19:56:43', '1'), - ('100', '3621', '2006-02-16T02:30:53', '2005-08-18T19:02:16', '2005-08-21T14:59:16', '1'), - ('100', '2899', '2006-02-16T02:30:53', '2005-06-21T22:43:45', '2005-06-30T01:49:45', '1'), - ('100', '2638', '2006-02-16T02:30:53', '2005-07-09T00:26:59', '2005-07-14T19:42:59', '1'), - ('100', '116', '2006-02-16T02:30:53', '2005-07-28T12:02:46', '2005-08-01T12:08:46', '2'), - ('100', '3297', '2006-02-16T02:30:53', '2005-07-09T13:11:14', '2005-07-10T07:27:14', '2'), - ('100', '3937', '2006-02-16T02:30:53', '2005-07-12T11:08:32', '2005-07-15T15:17:32', '1'), - ('100', '2408', '2006-02-16T02:30:53', '2005-05-25T10:26:39', '2005-05-28T04:59:39', '1'), - ('100', '3597', '2006-02-16T02:30:53', '2005-08-22T14:43:13', '2005-08-26T14:26:13', '1'), - ('100', '2983', '2006-02-16T02:30:53', '2005-07-08T23:54:29', '2005-07-16T22:47:29', '1'), - ('100', '2458', '2006-02-16T02:30:53', '2005-07-09T18:07:17', '2005-07-16T20:33:17', '2'), - ('100', '584', '2006-02-16T02:30:53', '2005-08-02T17:15:38', '2005-08-04T13:31:38', '2'), - ('100', '3929', '2006-02-16T02:30:53', '2005-07-30T06:57:07', '2005-08-05T00:57:07', '1'), - ('100', '3382', '2006-02-16T02:30:53', '2005-08-02T09:32:54', '2005-08-05T12:04:54', '2'), - ('100', '2660', '2006-02-16T02:30:53', '2005-07-30T15:04:31', '2005-07-31T20:33:31', '1'), - ('100', '3973', '2006-02-16T02:30:53', '2005-06-15T03:23:48', '2005-06-18T03:35:48', '1'), - ('100', '2010', '2006-02-16T02:30:53', '2005-07-07T11:35:08', '2005-07-10T10:58:08', '1'), - ('100', '3878', '2006-02-16T02:30:53', '2005-07-28T23:14:56', '2005-07-31T04:19:56', '2'), - ('100', '14', '2006-02-16T02:30:53', '2005-06-15T18:17:28', '2005-06-16T15:47:28', '1'), - ('100', '3786', '2006-02-16T02:30:53', '2005-08-22T17:50:49', '2005-08-30T22:21:49', '1'), - ('100', '4004', '2006-02-16T02:30:53', '2005-07-06T15:01:27', '2005-07-15T11:12:27', '2'), - ('100', '418', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('100', '3182', '2006-02-16T02:30:53', '2005-07-28T08:27:14', '2005-08-02T12:34:14', '2'), - ('100', '251', '2006-02-16T02:30:53', '2005-06-15T12:24:15', '2005-06-22T13:02:15', '1'), - ('100', '2192', '2006-02-16T02:30:53', '2005-07-06T05:23:10', '2005-07-15T03:22:10', '2'), - ('462', '980', '2006-02-16T02:30:53', '2005-07-29T01:49:04', '2005-08-05T01:51:04', '2'), - ('462', '4467', '2006-02-16T02:30:53', '2005-08-18T15:51:12', '2005-08-20T12:05:12', '1'), - ('462', '3208', '2006-02-16T02:30:53', '2005-07-28T17:20:09', '2005-07-31T18:36:09', '2'), - ('462', '3396', '2006-02-16T02:30:53', '2005-07-27T12:38:47', '2005-08-05T10:12:47', '1'), - ('462', '3823', '2006-02-16T02:30:53', '2005-07-29T02:24:08', '2005-08-03T01:02:08', '2'), - ('462', '706', '2006-02-16T02:30:53', '2005-08-23T18:49:32', '2005-08-27T19:20:32', '1'), - ('462', '561', '2006-02-16T02:30:53', '2005-08-23T21:17:17', '2005-08-26T21:15:17', '1'), - ('462', '1672', '2006-02-16T02:30:53', '2005-06-21T06:05:53', '2005-06-25T09:40:53', '1'), - ('462', '4042', '2006-02-16T02:30:53', '2005-08-17T11:51:16', '2005-08-18T14:01:16', '2'), - ('462', '3738', '2006-02-16T02:30:53', '2005-07-28T12:24:54', '2005-07-30T11:33:54', '1'), - ('462', '1155', '2006-02-16T02:30:53', '2005-08-20T01:32:04', '2005-08-29T02:14:04', '2'), - ('462', '2686', '2006-02-16T02:30:53', '2005-08-18T11:36:55', '2005-08-23T13:46:55', '1'), - ('462', '2798', '2006-02-16T02:30:53', '2005-07-12T13:42:58', '2005-07-19T16:39:58', '2'), - ('462', '1576', '2006-02-16T02:30:53', '2005-08-19T09:05:38', '2005-08-27T06:34:38', '1'), - ('462', '3473', '2006-02-16T02:30:53', '2005-07-29T19:19:10', '2005-08-02T13:47:10', '2'), - ('462', '806', '2006-02-16T02:30:53', '2005-07-12T13:23:09', '2005-07-20T10:10:09', '2'), - ('462', '2572', '2006-02-16T02:30:53', '2005-07-27T13:42:39', '2005-08-04T10:33:39', '2'), - ('462', '4396', '2006-02-16T02:30:53', '2005-06-16T18:13:43', '2005-06-24T17:43:43', '2'), - ('462', '2343', '2006-02-16T02:30:53', '2005-07-12T06:42:31', '2005-07-15T07:51:31', '1'), - ('462', '3509', '2006-02-16T02:30:53', '2005-06-17T06:24:30', '2005-06-25T03:39:30', '2'), - ('462', '398', '2006-02-16T02:30:53', '2005-07-08T02:10:01', '2005-07-15T05:49:01', '2'), - ('462', '4237', '2006-02-16T02:30:53', '2005-08-01T03:29:45', '2005-08-07T04:19:45', '1'), - ('462', '1843', '2006-02-16T02:30:53', '2005-07-12T09:30:05', '2005-07-14T08:29:05', '2'), - ('462', '3687', '2006-02-16T02:30:53', '2005-07-08T12:59:01', '2005-07-13T13:00:01', '1'), - ('462', '3985', '2006-02-16T02:30:53', '2005-08-17T04:43:29', '2005-08-25T01:04:29', '2'), - ('462', '3359', '2006-02-16T02:30:53', '2005-07-31T14:05:44', '2005-08-02T16:21:44', '2'), - ('462', '3193', '2006-02-16T02:30:53', '2005-05-26T01:19:05', '2005-05-27T23:43:05', '1'), - ('462', '605', '2006-02-16T02:30:53', '2005-08-19T19:56:01', '2005-08-20T22:16:01', '2'), - ('462', '2461', '2006-02-16T02:30:53', '2005-08-19T00:27:41', '2005-08-28T03:24:41', '1'), - ('462', '3234', '2006-02-16T02:30:53', '2005-07-28T06:34:23', '2005-08-05T09:55:23', '2'), - ('462', '3664', '2006-02-16T02:30:53', '2005-07-28T12:33:17', '2005-08-04T14:40:17', '2'), - ('462', '473', '2006-02-16T02:30:53', '2005-05-28T13:06:50', '2005-06-02T09:18:50', '1'), - ('462', '4010', '2006-02-16T02:30:53', '2005-08-23T05:42:13', '2005-08-28T00:03:13', '1'), - ('127', '2484', '2006-02-16T02:30:53', '2005-07-28T23:29:28', '2005-08-07T04:22:28', '2'), - ('127', '3784', '2006-02-16T02:30:53', '2005-06-16T20:32:47', '2005-06-21T02:03:47', '1'), - ('127', '745', '2006-02-16T02:30:53', '2005-07-28T11:46:58', '2005-08-05T12:50:58', '1'), - ('127', '2993', '2006-02-16T02:30:53', '2005-05-27T19:30:33', '2005-05-30T20:53:33', '2'), - ('127', '24', '2006-02-16T02:30:53', '2005-08-19T09:07:13', '2005-08-27T07:49:13', '1'), - ('127', '1815', '2006-02-16T02:30:53', '2005-08-19T10:40:10', '2005-08-23T09:03:10', '1'), - ('127', '2209', '2006-02-16T02:30:53', '2005-08-21T03:32:17', '2005-08-22T04:46:17', '2'), - ('127', '351', '2006-02-16T02:30:53', '2005-07-11T00:34:11', '2005-07-15T05:37:11', '1'), - ('127', '2501', '2006-02-16T02:30:53', '2005-08-02T13:13:21', '2005-08-03T07:17:21', '1'), - ('127', '3246', '2006-02-16T02:30:53', '2005-08-01T21:35:01', '2005-08-10T23:30:01', '1'), - ('127', '4198', '2006-02-16T02:30:53', '2005-07-08T09:47:51', '2005-07-16T04:09:51', '2'), - ('127', '1027', '2006-02-16T02:30:53', '2005-08-20T21:23:54', '2005-08-27T01:19:54', '1'), - ('127', '1186', '2006-02-16T02:30:53', '2005-08-01T00:35:25', '2005-08-07T06:04:25', '2'), - ('127', '2882', '2006-02-16T02:30:53', '2005-06-15T09:06:24', '2005-06-18T06:58:24', '1'), - ('127', '863', '2006-02-16T02:30:53', '2005-08-23T01:15:07', '2005-08-29T06:50:07', '1'), - ('127', '1946', '2006-02-16T02:30:53', '2005-06-18T16:58:58', '2005-06-27T22:57:58', '1'), - ('127', '4094', '2006-02-16T02:30:53', '2005-07-31T13:02:55', '2005-08-05T11:04:55', '1'), - ('127', '4272', '2006-02-16T02:30:53', '2005-08-23T11:40:30', '2005-08-30T12:40:30', '1'), - ('127', '1525', '2006-02-16T02:30:53', '2005-07-10T00:27:45', '2005-07-17T06:11:45', '1'), - ('127', '2373', '2006-02-16T02:30:53', '2005-08-17T21:11:57', '2005-08-21T01:42:57', '1'), - ('127', '3133', '2006-02-16T02:30:53', '2005-05-29T03:23:47', '2005-05-31T21:27:47', '2'), - ('127', '4032', '2006-02-16T02:30:53', '2005-07-08T17:04:24', '2005-07-12T16:41:24', '2'), - ('127', '3562', '2006-02-16T02:30:53', '2005-08-02T04:09:42', '2005-08-08T05:24:42', '2'), - ('127', '2936', '2006-02-16T02:30:53', '2005-08-19T01:05:08', '2005-08-21T05:37:08', '2'), - ('510', '583', '2006-02-16T02:30:53', '2005-07-07T00:58:54', '2005-07-12T02:40:54', '1'), - ('510', '3393', '2006-02-16T02:30:53', '2005-05-25T11:13:34', '2005-06-03T12:58:34', '1'), - ('510', '90', '2006-02-16T02:30:53', '2005-08-18T06:17:06', '2005-08-22T08:56:06', '1'), - ('510', '4449', '2006-02-16T02:30:53', '2005-06-19T15:06:15', '2005-06-27T17:58:15', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['10131', '3352', '11996', '10265', '15065', '8926', '7457', '372', '1435', '7794', '3744', '1925', '2806', '7678', '8763', '3465', '1757', '1118', '12406', '2817', '5851', '6531', '15789', '11595', '4767', '3893', '11692', '24', '2619', '2011', '11504', '12445', '13086', '3079', '3529', '12252', '3206', '7416', '11800', '5786', '15807', '802', '5303', '6408', '5240', '15997', '15108', '8537', '8945', '1890', '461', '14443', '5331', '4403', '5734', '6651', '16032', '2025', '4858', '13848', '13072', '1230', '9076', '12511', '10425', '9288', '5987', '13110', '2285', '11108', '732', '6690', '11465', '10957', '952', '15826', '10448', '8167', '5224', '13310', '1128', '16020', '13423', '544', '2967', '8473', '9882', '9503', '6419', '4836', '14517', '12997', '990', '1955', '10134', '274', '1622', '10456', '15858', '13820']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('510', '4169', '2006-02-16T02:30:53', '2005-07-31T21:45:28', '2005-08-04T00:19:28', '2'), - ('510', '578', '2006-02-16T02:30:53', '2005-06-21T11:26:29', '2005-06-28T07:26:29', '1'), - ('510', '2720', '2006-02-16T02:30:53', '2005-08-17T18:34:37', '2005-08-20T22:25:37', '2'), - ('510', '3338', '2006-02-16T02:30:53', '2005-08-01T03:05:04', '2005-08-08T08:09:04', '1'), - ('510', '468', '2006-02-16T02:30:53', '2005-08-22T10:46:44', '2005-08-27T09:40:44', '2'), - ('510', '3677', '2006-02-16T02:30:53', '2005-07-30T02:10:31', '2005-08-03T23:56:31', '1'), - ('510', '3635', '2006-02-16T02:30:53', '2005-07-27T18:35:17', '2005-07-30T12:41:17', '2'), - ('510', '4089', '2006-02-16T02:30:53', '2005-05-27T08:13:58', '2005-06-04T03:50:58', '2'), - ('510', '2769', '2006-02-16T02:30:53', '2005-06-15T18:32:30', '2005-06-24T12:44:30', '2'), - ('510', '4509', '2006-02-16T02:30:53', '2005-07-28T07:28:03', '2005-08-06T12:32:03', '2'), - ('510', '3343', '2006-02-16T02:30:53', '2005-07-06T12:10:02', '2005-07-08T11:49:02', '2'), - ('510', '3995', '2006-02-16T02:30:53', '2005-06-17T06:16:47', '2005-06-21T06:03:47', '1'), - ('510', '2114', '2006-02-16T02:30:53', '2005-06-19T19:30:48', '2005-06-20T19:42:48', '2'), - ('510', '3398', '2006-02-16T02:30:53', '2005-07-28T02:58:16', '2005-08-06T04:22:16', '1'), - ('510', '374', '2006-02-16T02:30:53', '2005-07-29T19:38:24', '2005-08-04T16:51:24', '1'), - ('510', '1488', '2006-02-16T02:30:53', '2005-06-21T22:10:01', '2005-06-30T21:35:01', '1'), - ('510', '4491', '2006-02-16T02:30:53', '2005-06-16T17:32:24', '2005-06-18T13:12:24', '1'), - ('510', '213', '2006-02-16T02:30:53', '2005-05-31T16:23:02', '2005-06-03T20:00:02', '1'), - ('510', '4368', '2006-02-16T02:30:53', '2005-08-18T09:38:02', '2005-08-22T12:56:02', '1'), - ('510', '3476', '2006-02-16T02:30:53', '2005-06-19T20:05:22', '2005-06-24T23:29:22', '1'), - ('510', '3944', '2006-02-16T02:30:53', '2005-07-10T17:40:47', '2005-07-11T19:24:47', '2'), - ('510', '4231', '2006-02-16T02:30:53', '2005-07-12T04:35:24', '2005-07-16T05:37:24', '2'), - ('350', '1213', '2006-02-16T02:30:53', '2005-08-23T13:56:40', '2005-08-27T15:25:40', '1'), - ('350', '466', '2006-02-16T02:30:53', '2005-08-17T02:53:14', '2005-08-26T02:05:14', '1'), - ('350', '3744', '2006-02-16T02:30:53', '2005-07-08T15:18:53', '2005-07-13T15:48:53', '1'), - ('350', '1281', '2006-02-16T02:30:53', '2005-07-06T18:59:31', '2005-07-12T19:21:31', '1'), - ('350', '1222', '2006-02-16T02:30:53', '2005-08-17T06:52:41', '2005-08-24T12:17:41', '2'), - ('350', '3273', '2006-02-16T02:30:53', '2005-05-25T02:53:02', '2005-05-27T01:15:02', '1'), - ('350', '1848', '2006-02-16T02:30:53', '2005-06-19T08:03:12', '2005-06-21T05:02:12', '2'), - ('350', '734', '2006-02-16T02:30:53', '2005-06-17T11:56:09', '2005-06-24T06:47:09', '2'), - ('350', '2132', '2006-02-16T02:30:53', '2005-08-16T23:16:46', '2005-08-18T20:49:46', '2'), - ('350', '3347', '2006-02-16T02:30:53', '2005-08-18T10:56:20', '2005-08-21T16:46:20', '1'), - ('350', '3712', '2006-02-16T02:30:53', '2005-08-19T10:32:28', '2005-08-26T07:57:28', '2'), - ('350', '2135', '2006-02-16T02:30:53', '2005-06-20T15:13:40', '2005-06-21T12:03:40', '1'), - ('350', '4316', '2006-02-16T02:30:53', '2005-07-06T01:15:26', '2005-07-07T04:28:26', '1'), - ('350', '127', '2006-02-16T02:30:53', '2005-08-18T03:59:51', '2005-08-25T08:54:51', '2'), - ('350', '2196', '2006-02-16T02:30:53', '2005-06-21T00:39:39', '2005-06-22T05:12:39', '1'), - ('350', '653', '2006-02-16T02:30:53', '2005-07-27T16:55:25', '2005-07-29T11:27:25', '1'), - ('350', '2284', '2006-02-16T02:30:53', '2005-08-17T11:29:52', '2005-08-21T08:37:52', '1'), - ('350', '2290', '2006-02-16T02:30:53', '2005-07-10T14:06:44', '2005-07-14T19:55:44', '2'), - ('350', '2705', '2006-02-16T02:30:53', '2005-08-23T14:35:10', '2005-08-29T19:06:10', '2'), - ('350', '785', '2006-02-16T02:30:53', '2005-05-29T17:38:59', '2005-05-31T22:42:59', '2'), - ('350', '3572', '2006-02-16T02:30:53', '2005-07-09T15:44:09', '2005-07-15T18:09:09', '2'), - ('350', '2008', '2006-02-16T02:30:53', '2005-07-11T23:03:02', '2005-07-19T23:09:02', '2'), - ('350', '1378', '2006-02-16T02:30:53', '2005-07-09T13:14:48', '2005-07-10T18:47:48', '2'), - ('447', '2843', '2006-02-16T02:30:53', '2005-08-23T20:40:31', '2005-08-26T19:47:31', '1'), - ('447', '3463', '2006-02-16T02:30:53', '2005-08-22T12:10:07', '2005-08-26T14:46:07', '2'), - ('447', '1012', '2006-02-16T02:30:53', '2005-07-29T10:44:54', '2005-08-06T14:55:54', '2'), - ('447', '1441', '2006-02-16T02:30:53', '2005-07-30T03:11:48', '2005-08-07T07:53:48', '2'), - ('447', '1764', '2006-02-16T02:30:53', '2005-06-17T04:06:13', '2005-06-22T07:46:13', '2'), - ('447', '2077', '2006-02-16T02:30:53', '2005-05-27T20:08:55', '2005-06-01T14:32:55', '1'), - ('447', '376', '2006-02-16T02:30:53', '2005-08-21T12:06:32', '2005-08-29T13:44:32', '2'), - ('447', '4181', '2006-02-16T02:30:53', '2005-07-09T16:54:06', '2005-07-10T19:04:06', '1'), - ('447', '3973', '2006-02-16T02:30:53', '2005-07-07T21:29:40', '2005-07-09T17:58:40', '1'), - ('447', '399', '2006-02-16T02:30:53', '2005-07-10T11:37:28', '2005-07-16T11:10:28', '1'), - ('447', '98', '2006-02-16T02:30:53', '2005-07-12T10:57:28', '2005-07-15T06:06:28', '2'), - ('447', '2527', '2006-02-16T02:30:53', '2005-08-23T21:59:57', '2005-08-31T22:46:57', '2'), - ('447', '1203', '2006-02-16T02:30:53', '2005-06-17T13:04:00', '2005-06-18T18:45:00', '2'), - ('447', '3424', '2006-02-16T02:30:53', '2005-07-08T18:53:24', '2005-07-17T20:32:24', '2'), - ('447', '802', '2006-02-16T02:30:53', '2005-08-20T14:37:49', '2005-08-25T13:15:49', '1'), - ('447', '2313', '2006-02-16T02:30:53', '2005-08-19T10:03:30', '2005-08-22T14:27:30', '2'), - ('447', '2324', '2006-02-16T02:30:53', '2005-06-15T04:04:09', '2005-06-16T02:21:09', '1'), - ('447', '496', '2006-02-16T02:30:53', '2005-07-30T07:58:12', '2005-08-08T06:04:12', '1'), - ('447', '919', '2006-02-16T02:30:53', '2005-08-18T13:23:19', '2005-08-22T11:43:19', '2'), - ('447', '322', '2006-02-16T02:30:53', '2005-08-01T08:23:25', '2005-08-05T04:29:25', '1'), - ('447', '2640', '2006-02-16T02:30:53', '2005-07-30T15:56:39', '2005-08-04T13:25:39', '2'), - ('447', '1000', '2006-02-16T02:30:53', '2005-07-11T00:55:31', '2005-07-16T06:28:31', '2'), - ('447', '62', '2006-02-16T02:30:53', '2005-08-19T11:24:37', '2005-08-21T05:48:37', '1'), - ('447', '755', '2006-02-16T02:30:53', '2005-06-18T07:00:54', '2005-06-25T08:58:54', '2'), - ('447', '560', '2006-02-16T02:30:53', '2005-08-02T08:20:01', '2005-08-03T13:22:01', '2'), - ('447', '2530', '2006-02-16T02:30:53', '2005-05-29T07:32:51', '2005-05-30T10:08:51', '2'), - ('447', '4254', '2006-02-16T02:30:53', '2005-07-12T12:23:02', '2005-07-16T15:39:02', '2'), - ('447', '2190', '2006-02-16T02:30:53', '2005-08-02T21:43:52', '2005-08-10T22:24:52', '1'), - ('447', '1652', '2006-02-16T02:30:53', '2005-08-02T03:33:30', '2005-08-10T06:19:30', '2'), - ('311', '4389', '2006-02-16T02:30:53', '2005-05-30T16:28:07', '2005-06-02T16:12:07', '2'), - ('311', '215', '2006-02-16T02:30:53', '2005-08-23T15:15:02', '2005-08-31T20:39:02', '2'), - ('311', '2254', '2006-02-16T02:30:53', '2005-08-01T09:09:31', '2005-08-02T09:55:31', '2'), - ('311', '3181', '2006-02-16T02:30:53', '2005-07-28T21:25:45', '2005-08-04T18:04:45', '1'), - ('311', '279', '2006-02-16T02:30:53', '2005-07-09T12:07:27', '2005-07-17T08:59:27', '1'), - ('311', '2563', '2006-02-16T02:30:53', '2005-08-19T19:05:16', '2005-08-23T22:47:16', '1'), - ('311', '1496', '2006-02-16T02:30:53', '2005-05-31T17:49:26', '2005-06-05T19:51:26', '2'), - ('311', '277', '2006-02-16T02:30:53', '2005-08-23T21:34:33', '2005-09-01T18:17:33', '1'), - ('311', '546', '2006-02-16T02:30:53', '2005-08-19T23:07:42', '2005-08-26T20:45:42', '1'), - ('311', '2964', '2006-02-16T02:30:53', '2005-05-28T07:03:00', '2005-06-06T06:23:00', '1'), - ('311', '4243', '2006-02-16T02:30:53', '2005-06-20T07:40:35', '2005-06-29T05:50:35', '2'), - ('311', '4141', '2006-02-16T02:30:53', '2005-07-29T08:36:53', '2005-07-31T12:14:53', '1'), - ('311', '1429', '2006-02-16T02:30:53', '2005-07-31T13:53:33', '2005-08-09T15:55:33', '1'), - ('311', '1013', '2006-02-16T02:30:53', '2005-07-31T00:02:38', '2005-08-06T06:01:38', '1'), - ('311', '3683', '2006-02-16T02:30:53', '2005-07-11T23:36:38', '2005-07-13T03:23:38', '1'), - ('311', '2756', '2006-02-16T02:30:53', '2005-07-08T18:09:08', '2005-07-15T20:19:08', '1'), - ('311', '3568', '2006-02-16T02:30:53', '2005-08-21T14:57:03', '2005-08-24T13:52:03', '2'), - ('311', '1661', '2006-02-16T02:30:53', '2005-08-19T07:31:46', '2005-08-24T09:20:46', '2'), - ('311', '4171', '2006-02-16T02:30:53', '2005-05-30T23:25:14', '2005-06-06T18:41:14', '2'), - ('311', '811', '2006-02-16T02:30:53', '2005-06-17T08:40:22', '2005-06-19T10:47:22', '1'), - ('311', '4483', '2006-02-16T02:30:53', '2005-07-31T21:56:10', '2005-08-06T21:20:10', '1'), - ('311', '656', '2006-02-16T02:30:53', '2005-05-26T16:48:51', '2005-06-03T18:17:51', '1'), - ('311', '1774', '2006-02-16T02:30:53', '2005-06-16T07:33:18', '2005-06-21T07:23:18', '1'), - ('81', '4339', '2006-02-16T02:30:53', '2005-08-01T09:17:21', '2005-08-06T10:30:21', '1'), - ('81', '4515', '2006-02-16T02:30:53', '2005-08-23T16:07:15', '2005-08-25T19:36:15', '2'), - ('81', '3191', '2006-02-16T02:30:53', '2005-08-20T13:26:37', '2005-08-27T14:05:37', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['4983', '9454', '7709', '3229', '14642', '14128', '289', '2854', '5468', '3879', '7130', '15224', '15823', '12181', '2714', '14748', '15602', '11837', '15884', '13846', '3083', '10142', '11545', '11394', '4462', '8252', '12841', '7518', '8344', '5858', '8640', '705', '15967', '15968', '244', '6711', '7007', '139', '4574', '8946', '13218', '5495', '11230', '8156', '14115', '7510', '13389', '7496', '9800', '11860', '2557', '6422', '12904', '15025', '7176', '13203', '15006', '7924', '3459', '3540', '5454', '3565', '7182', '2083', '2790', '6726', '10820', '4508', '8438', '3818', '9591', '14323', '4312', '6544', '6850', '11664', '4087', '15502', '5457', '5969', '146', '14523', '13273', '6848', '10663', '9161', '6765', '9294', '7907', '7821', '4158', '4988', '13801', '691', '8414', '8713', '15476', '14559', '12669', '12296']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('81', '1469', '2006-02-16T02:30:53', '2005-07-09T00:34:16', '2005-07-17T03:21:16', '2'), - ('81', '3028', '2006-02-16T02:30:53', '2005-07-30T22:20:09', '2005-08-04T01:33:09', '2'), - ('81', '3800', '2006-02-16T02:30:53', '2005-07-28T04:22:14', '2005-07-31T09:18:14', '2'), - ('81', '2301', '2006-02-16T02:30:53', '2005-06-21T02:20:41', '2005-06-26T00:39:41', '1'), - ('81', '1280', '2006-02-16T02:30:53', '2005-08-21T19:09:40', '2005-08-30T13:25:40', '2'), - ('81', '2594', '2006-02-16T02:30:53', '2005-08-21T01:35:58', '2005-08-21T21:23:58', '2'), - ('81', '2449', '2006-02-16T02:30:53', '2005-05-26T20:01:09', '2005-05-28T15:09:09', '1'), - ('81', '4453', '2006-02-16T02:30:53', '2005-06-19T23:11:48', '2005-06-23T19:37:48', '2'), - ('81', '2196', '2006-02-16T02:30:53', '2005-07-09T23:06:09', '2005-07-13T00:48:09', '1'), - ('81', '1376', '2006-02-16T02:30:53', '2005-07-06T18:31:20', '2005-07-09T19:03:20', '2'), - ('81', '420', '2006-02-16T02:30:53', '2005-07-27T06:23:36', '2005-07-28T10:23:36', '1'), - ('81', '33', '2006-02-16T02:30:53', '2005-08-22T17:18:05', '2005-08-29T14:35:05', '2'), - ('81', '3047', '2006-02-16T02:30:53', '2005-08-23T15:08:00', '2005-08-24T17:52:00', '2'), - ('81', '532', '2006-02-16T02:30:53', '2005-08-18T01:28:18', '2005-08-23T21:17:18', '2'), - ('81', '2853', '2006-02-16T02:30:53', '2005-06-19T14:26:09', '2005-06-23T17:24:09', '2'), - ('81', '1697', '2006-02-16T02:30:53', '2005-08-21T23:02:02', '2005-08-28T05:01:02', '2'), - ('81', '1429', '2006-02-16T02:30:53', '2005-08-23T06:41:07', '2005-08-24T07:16:07', '1'), - ('81', '1085', '2006-02-16T02:30:53', '2005-08-17T13:04:41', '2005-08-26T14:19:41', '1'), - ('81', '2255', '2006-02-16T02:30:53', '2005-08-23T16:45:28', '2005-08-27T20:18:28', '1'), - ('257', '3289', '2006-02-16T02:30:53', '2005-08-20T14:32:31', '2005-08-28T16:58:31', '1'), - ('257', '2896', '2006-02-16T02:30:53', '2005-06-20T15:33:47', '2005-06-26T16:14:47', '2'), - ('257', '1839', '2006-02-16T02:30:53', '2005-07-31T22:10:54', '2005-08-09T19:04:54', '2'), - ('257', '3198', '2006-02-16T02:30:53', '2005-08-17T00:56:06', '2005-08-25T22:47:06', '1'), - ('257', '2087', '2006-02-16T02:30:53', '2005-08-02T18:44:45', '2005-08-06T22:51:45', '2'), - ('257', '4120', '2006-02-16T02:30:53', '2005-07-08T00:02:49', '2005-07-15T20:48:49', '2'), - ('257', '3312', '2006-02-16T02:30:53', '2005-07-29T00:54:17', '2005-07-31T20:34:17', '1'), - ('257', '4233', '2006-02-16T02:30:53', '2005-08-19T01:55:55', '2005-08-24T02:56:55', '1'), - ('257', '2676', '2006-02-16T02:30:53', '2005-07-27T21:01:16', '2005-08-03T15:26:16', '1'), - ('257', '221', '2006-02-16T02:30:53', '2005-07-29T04:45:25', '2005-08-06T01:53:25', '1'), - ('257', '2913', '2006-02-16T02:30:53', '2005-07-10T18:00:07', '2005-07-11T20:01:07', '2'), - ('257', '1874', '2006-02-16T02:30:53', '2005-07-29T14:34:17', '2005-08-01T13:09:17', '2'), - ('257', '2809', '2006-02-16T02:30:53', '2005-05-29T02:48:52', '2005-05-30T06:21:52', '1'), - ('257', '321', '2006-02-16T02:30:53', '2005-08-23T19:50:06', '2005-08-29T14:51:06', '1'), - ('257', '3598', '2006-02-16T02:30:53', '2005-08-23T19:51:29', '2005-08-24T15:07:29', '1'), - ('257', '1041', '2006-02-16T02:30:53', '2005-05-26T13:40:40', '2005-05-31T11:58:40', '1'), - ('257', '2247', '2006-02-16T02:30:53', '2005-07-12T13:23:40', '2005-07-20T11:45:40', '2'), - ('257', '4186', '2006-02-16T02:30:53', '2005-07-27T01:43:39', '2005-07-31T21:04:39', '1'), - ('257', '327', '2006-02-16T02:30:53', '2005-05-25T23:00:21', '2005-05-29T17:12:21', '1'), - ('257', '536', '2006-02-16T02:30:53', '2005-07-08T05:39:42', '2005-07-08T23:44:42', '2'), - ('257', '3510', '2006-02-16T02:30:53', '2005-07-30T03:14:53', '2005-08-04T00:50:53', '1'), - ('257', '4148', '2006-02-16T02:30:53', '2005-08-19T15:39:39', '2005-08-22T17:28:39', '1'), - ('257', '2199', '2006-02-16T02:30:53', '2005-07-10T00:16:54', '2005-07-19T01:22:54', '2'), - ('257', '1463', '2006-02-16T02:30:53', '2005-08-02T12:59:08', '2005-08-04T13:42:08', '1'), - ('257', '1977', '2006-02-16T02:30:53', '2005-07-28T20:59:04', '2005-08-01T01:52:04', '1'), - ('257', '1945', '2006-02-16T02:30:53', '2005-08-21T01:10:29', '2005-08-24T01:21:29', '1'), - ('257', '1617', '2006-02-16T02:30:53', '2005-07-27T20:37:57', '2005-08-01T17:14:57', '2'), - ('257', '3352', '2006-02-16T02:30:53', '2005-08-19T21:52:51', '2005-08-25T02:38:51', '1'), - ('257', '2449', '2006-02-16T02:30:53', '2005-07-27T20:04:05', '2005-08-02T20:12:05', '1'), - ('257', '2153', '2006-02-16T02:30:53', '2005-07-31T11:00:58', '2005-08-02T10:13:58', '2'), - ('257', '4354', '2006-02-16T02:30:53', '2005-08-17T13:52:26', '2005-08-24T14:47:26', '1'), - ('257', '4546', '2006-02-16T02:30:53', '2005-06-19T03:08:51', '2005-06-20T07:59:51', '1'), - ('257', '762', '2006-02-16T02:30:53', '2005-07-11T23:46:19', '2005-07-20T22:12:19', '1'), - ('257', '459', '2006-02-16T02:30:53', '2005-08-19T04:10:50', '2005-08-27T23:24:50', '1'), - ('257', '2107', '2006-02-16T02:30:53', '2005-08-22T08:57:24', '2005-08-24T06:09:24', '2'), - ('257', '227', '2006-02-16T02:30:53', '2005-07-27T08:04:28', '2005-07-29T14:00:28', '2'), - ('257', '804', '2006-02-16T02:30:53', '2005-08-19T15:00:58', '2005-08-27T15:38:58', '2'), - ('97', '2967', '2006-02-16T02:30:53', '2005-08-22T08:20:15', '2005-08-23T11:57:15', '1'), - ('97', '656', '2006-02-16T02:30:53', '2005-07-28T12:08:53', '2005-07-30T06:45:53', '2'), - ('97', '3080', '2006-02-16T02:30:53', '2005-06-21T21:45:47', '2005-06-25T00:46:47', '1'), - ('97', '1295', '2006-02-16T02:30:53', '2005-07-06T01:47:20', '2005-07-08T23:48:20', '2'), - ('97', '3049', '2006-02-16T02:30:53', '2005-07-09T22:24:25', '2005-07-11T01:52:25', '1'), - ('97', '599', '2006-02-16T02:30:53', '2005-07-06T03:02:58', '2005-07-13T21:31:58', '2'), - ('97', '3209', '2006-02-16T02:30:53', '2005-07-27T08:15:38', '2005-08-03T12:48:38', '2'), - ('97', '2423', '2006-02-16T02:30:53', '2005-06-17T17:14:00', '2005-06-18T18:31:00', '2'), - ('97', '202', '2006-02-16T02:30:53', '2005-06-19T18:49:45', '2005-06-21T00:13:45', '1'), - ('97', '4494', '2006-02-16T02:30:53', '2005-07-12T13:48:14', '2005-07-16T11:11:14', '1'), - ('97', '1487', '2006-02-16T02:30:53', '2005-08-01T22:53:40', '2005-08-02T17:59:40', '2'), - ('97', '3996', '2006-02-16T02:30:53', '2005-07-08T02:28:41', '2005-07-16T23:59:41', '1'), - ('97', '720', '2006-02-16T02:30:53', '2005-07-29T07:25:42', '2005-08-04T07:39:42', '1'), - ('97', '653', '2006-02-16T02:30:53', '2005-07-06T15:33:31', '2005-07-11T16:35:31', '1'), - ('97', '504', '2006-02-16T02:30:53', '2005-07-31T03:19:28', '2005-08-01T07:30:28', '1'), - ('97', '1257', '2006-02-16T02:30:53', '2005-08-21T08:08:43', '2005-08-25T10:44:43', '1'), - ('97', '3870', '2006-02-16T02:30:53', '2005-07-07T17:34:59', '2005-07-09T17:45:59', '2'), - ('97', '1218', '2006-02-16T02:30:53', '2005-07-12T04:56:15', '2005-07-17T08:28:15', '1'), - ('433', '1145', '2006-02-16T02:30:53', '2005-07-12T19:30:42', '2005-07-17T21:26:42', '2'), - ('433', '1343', '2006-02-16T02:30:53', '2005-08-17T05:35:52', '2005-08-18T02:40:52', '1'), - ('433', '3066', '2006-02-16T02:30:53', '2005-07-07T05:30:56', '2005-07-16T10:20:56', '1'), - ('433', '3219', '2006-02-16T02:30:53', '2005-08-23T02:40:04', '2005-08-31T00:36:04', '2'), - ('433', '4179', '2006-02-16T02:30:53', '2005-07-09T22:33:14', '2005-07-12T02:30:14', '1'), - ('433', '4177', '2006-02-16T02:30:53', '2005-07-11T00:03:22', '2005-07-18T01:28:22', '2'), - ('433', '1431', '2006-02-16T02:30:53', '2005-05-26T00:07:11', '2005-06-04T00:20:11', '2'), - ('433', '345', '2006-02-16T02:30:53', '2005-08-21T15:03:45', '2005-08-22T18:06:45', '2'), - ('433', '4181', '2006-02-16T02:30:53', '2005-08-19T17:49:13', '2005-08-21T14:15:13', '1'), - ('433', '1782', '2006-02-16T02:30:53', '2005-07-12T19:24:07', '2005-07-14T17:03:07', '1'), - ('433', '4258', '2006-02-16T02:30:53', '2005-08-01T16:51:08', '2005-08-08T21:17:08', '2'), - ('433', '969', '2006-02-16T02:30:53', '2005-07-30T11:19:18', '2005-08-02T05:32:18', '1'), - ('433', '2571', '2006-02-16T02:30:53', '2005-07-12T15:30:47', '2005-07-19T14:19:47', '2'), - ('433', '2468', '2006-02-16T02:30:53', '2005-07-30T16:14:37', '2005-08-07T18:49:37', '1'), - ('433', '3252', '2006-02-16T02:30:53', '2005-07-28T11:32:00', '2005-07-30T15:27:00', '1'), - ('433', '1184', '2006-02-16T02:30:53', '2005-07-28T08:31:23', '2005-08-03T05:08:23', '2'), - ('433', '291', '2006-02-16T02:30:53', '2005-07-07T09:05:42', '2005-07-09T04:28:42', '1'), - ('433', '2718', '2006-02-16T02:30:53', '2005-07-09T00:46:14', '2005-07-16T01:45:14', '2'), - ('433', '1464', '2006-02-16T02:30:53', '2005-08-20T12:40:53', '2005-08-21T16:29:53', '1'), - ('433', '4034', '2006-02-16T02:30:53', '2005-05-29T01:01:26', '2005-06-07T06:21:26', '1'), - ('433', '1337', '2006-02-16T02:30:53', '2005-07-29T06:48:35', '2005-08-06T10:54:35', '2'), - ('433', '473', '2006-02-16T02:30:53', '2005-07-29T17:31:19', '2005-08-02T16:37:19', '2'), - ('433', '2478', '2006-02-16T02:30:53', '2005-08-23T01:45:07', '2005-08-26T21:07:07', '2'), - ('433', '3842', '2006-02-16T02:30:53', '2005-08-21T16:11:35', '2005-08-30T15:26:35', '1'), - ('433', '4530', '2006-02-16T02:30:53', '2005-08-18T19:17:47', '2005-08-24T14:55:47', '1'), - ('258', '2091', '2006-02-16T02:30:53', '2005-08-18T05:16:28', '2005-08-22T10:32:28', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['10393', '10315', '4677', '2931', '5312', '10325', '6012', '9069', '12246', '10332', '4897', '5935', '7814', '13695', '5674', '4408', '13897', '13491', '2678', '14901', '8675', '1743', '10293', '8591', '9558', '14836', '8546', '10915', '14484', '11910', '11769', '6970', '11650', '11270', '13537', '15466', '8886', '2825', '11409', '4938', '4865', '2969', '10537', '14860', '10709', '3805', '2943', '6150', '13312', '15957', '11322', '4852', '13970', '5864', '13839', '11417', '10009', '13838', '5085', '2239', '656', '9333', '9172', '8215', '2792', '5744', '3265', '13905', '4765', '192', '5167', '12205', '666', '10249', '14993', '3747', '8810', '13153', '10959', '4801', '15809', '13784', '15960', '2761', '1126', '13587', '10508', '2281', '10527', '3304', '2096', '12273', '7978', '4863', '4144', '11538', '1561', '3369', '2269', '1906']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('258', '808', '2006-02-16T02:30:53', '2005-08-01T06:52:50', '2005-08-05T08:45:50', '1'), - ('258', '895', '2006-02-16T02:30:53', '2005-08-01T04:34:45', '2005-08-07T05:27:45', '1'), - ('258', '1226', '2006-02-16T02:30:53', '2005-07-08T10:30:36', '2005-07-14T12:40:36', '1'), - ('258', '3122', '2006-02-16T02:30:53', '2005-06-20T04:50:45', '2005-06-29T09:18:45', '1'), - ('258', '2123', '2006-02-16T02:30:53', '2005-07-09T16:03:09', '2005-07-13T16:41:09', '2'), - ('258', '2749', '2006-02-16T02:30:53', '2005-08-01T04:52:12', '2005-08-08T09:31:12', '1'), - ('258', '2609', '2006-02-16T02:30:53', '2005-07-11T02:00:12', '2005-07-17T02:49:12', '2'), - ('258', '1852', '2006-02-16T02:30:53', '2005-07-30T07:39:59', '2005-08-02T04:10:59', '1'), - ('258', '3199', '2006-02-16T02:30:53', '2005-08-18T03:48:41', '2005-08-25T05:12:41', '1'), - ('258', '642', '2006-02-16T02:30:53', '2005-08-01T04:57:32', '2005-08-10T02:42:32', '2'), - ('258', '2950', '2006-02-16T02:30:53', '2005-07-08T20:25:11', '2005-07-09T17:16:11', '1'), - ('258', '3371', '2006-02-16T02:30:53', '2005-07-10T22:11:04', '2005-07-19T18:12:04', '2'), - ('258', '2662', '2006-02-16T02:30:53', '2005-07-28T08:09:48', '2005-08-01T13:14:48', '2'), - ('258', '3114', '2006-02-16T02:30:53', '2005-08-20T09:13:25', '2005-08-27T11:51:25', '2'), - ('258', '548', '2006-02-16T02:30:53', '2005-07-10T08:26:26', '2005-07-16T02:43:26', '1'), - ('258', '2482', '2006-02-16T02:30:53', '2005-07-07T21:41:06', '2005-07-11T00:32:06', '1'), - ('258', '628', '2006-02-16T02:30:53', '2005-08-20T16:02:28', '2005-08-23T14:29:28', '1'), - ('258', '2503', '2006-02-16T02:30:53', '2005-08-20T01:30:56', '2005-08-28T23:26:56', '2'), - ('258', '4230', '2006-02-16T02:30:53', '2005-06-19T12:12:23', '2005-06-21T16:28:23', '2'), - ('258', '4297', '2006-02-16T02:30:53', '2005-08-22T04:31:37', '2005-08-29T08:24:37', '1'), - ('258', '1026', '2006-02-16T02:30:53', '2005-07-29T15:56:18', '2005-07-30T18:50:18', '1'), - ('258', '2777', '2006-02-16T02:30:53', '2005-06-16T16:38:10', '2005-06-17T13:13:10', '1'), - ('258', '1570', '2006-02-16T02:30:53', '2005-08-01T03:44:26', '2005-08-05T04:16:26', '2'), - ('418', '2568', '2006-02-16T02:30:53', '2005-07-29T12:32:33', '2005-08-01T16:19:33', '2'), - ('418', '1161', '2006-02-16T02:30:53', '2005-07-31T02:14:35', '2005-08-06T03:00:35', '1'), - ('418', '4287', '2006-02-16T02:30:53', '2005-08-22T01:52:26', '2005-08-22T23:39:26', '1'), - ('418', '3224', '2006-02-16T02:30:53', '2005-07-29T11:08:48', '2005-08-03T16:50:48', '2'), - ('418', '4568', '2006-02-16T02:30:53', '2005-08-02T02:05:04', '2005-08-10T21:58:04', '2'), - ('418', '3714', '2006-02-16T02:30:53', '2005-08-21T13:47:29', '2005-08-23T18:25:29', '1'), - ('418', '4254', '2006-02-16T02:30:53', '2005-08-17T15:44:37', '2005-08-19T10:58:37', '2'), - ('418', '1406', '2006-02-16T02:30:53', '2005-08-17T10:04:49', '2005-08-20T09:22:49', '1'), - ('418', '17', '2006-02-16T02:30:53', '2005-07-27T00:26:14', '2005-08-03T20:00:14', '2'), - ('418', '3979', '2006-02-16T02:30:53', '2005-08-17T05:00:03', '2005-08-22T01:45:03', '2'), - ('418', '1882', '2006-02-16T02:30:53', '2005-08-02T14:18:07', '2005-08-03T08:20:07', '1'), - ('418', '2521', '2006-02-16T02:30:53', '2005-08-20T03:39:15', '2005-08-23T22:03:15', '2'), - ('418', '571', '2006-02-16T02:30:53', '2005-08-23T01:16:55', '2005-08-29T22:57:55', '1'), - ('418', '1469', '2006-02-16T02:30:53', '2005-07-30T00:36:31', '2005-08-08T06:18:31', '1'), - ('418', '2601', '2006-02-16T02:30:53', '2005-06-19T20:32:19', '2005-06-22T22:32:19', '1'), - ('418', '3691', '2006-02-16T02:30:53', '2005-08-02T19:26:51', '2005-08-07T19:55:51', '1'), - ('418', '2164', '2006-02-16T02:30:53', '2005-07-08T22:32:53', '2005-07-14T16:48:53', '2'), - ('418', '1614', '2006-02-16T02:30:53', '2005-07-08T19:09:04', '2005-07-13T21:25:04', '2'), - ('418', '1748', '2006-02-16T02:30:53', '2005-06-20T07:44:27', '2005-06-22T06:12:27', '2'), - ('418', '2140', '2006-02-16T02:30:53', '2005-08-01T12:22:28', '2005-08-08T07:27:28', '1'), - ('418', '1368', '2006-02-16T02:30:53', '2005-08-22T02:47:07', '2005-08-28T00:00:07', '1'), - ('418', '282', '2006-02-16T02:30:53', '2005-08-01T18:43:57', '2005-08-06T13:17:57', '2'), - ('418', '1716', '2006-02-16T02:30:53', '2005-07-06T15:08:42', '2005-07-07T14:34:42', '1'), - ('418', '2591', '2006-02-16T02:30:53', '2005-06-20T05:43:05', '2005-06-25T04:31:05', '1'), - ('418', '1110', '2006-02-16T02:30:53', '2005-07-11T09:23:56', '2005-07-15T10:56:56', '2'), - ('418', '2891', '2006-02-16T02:30:53', '2005-08-19T19:09:14', '2005-08-23T00:50:14', '2'), - ('418', '74', '2006-02-16T02:30:53', '2005-08-23T19:21:22', '2005-08-31T16:42:22', '1'), - ('418', '761', '2006-02-16T02:30:53', '2005-08-02T16:23:17', '2005-08-09T19:55:17', '2'), - ('418', '3545', '2006-02-16T02:30:53', '2005-07-08T18:43:15', '2005-07-15T18:48:15', '2'), - ('418', '1942', '2006-02-16T02:30:53', '2005-08-20T18:43:34', '2005-08-22T15:17:34', '2'), - ('437', '4380', '2006-02-16T02:30:53', '2005-07-10T18:29:57', '2005-07-19T14:27:57', '2'), - ('437', '1056', '2006-02-16T02:30:53', '2005-08-20T14:23:16', '2005-08-26T19:11:16', '2'), - ('437', '3083', '2006-02-16T02:30:53', '2005-08-02T19:44:46', '2005-08-11T21:43:46', '2'), - ('437', '4441', '2006-02-16T02:30:53', '2005-07-31T18:00:28', '2005-08-08T22:24:28', '2'), - ('437', '1134', '2006-02-16T02:30:53', '2005-08-20T14:22:46', '2005-08-29T12:28:46', '2'), - ('437', '4164', '2006-02-16T02:30:53', '2005-07-09T05:36:49', '2005-07-13T09:26:49', '1'), - ('437', '4419', '2006-02-16T02:30:53', '2005-06-18T04:23:54', '2005-06-26T00:12:54', '2'), - ('437', '2846', '2006-02-16T02:30:53', '2005-05-28T20:18:24', '2005-05-30T16:19:24', '1'), - ('437', '1377', '2006-02-16T02:30:53', '2005-07-30T17:53:45', '2005-07-31T22:35:45', '2'), - ('437', '695', '2006-02-16T02:30:53', '2005-07-30T11:36:38', '2005-08-04T09:39:38', '1'), - ('437', '2921', '2006-02-16T02:30:53', '2005-07-28T23:43:56', '2005-08-03T19:30:56', '2'), - ('437', '3057', '2006-02-16T02:30:53', '2005-06-19T18:52:25', '2005-06-23T17:39:25', '1'), - ('437', '1372', '2006-02-16T02:30:53', '2005-07-10T12:08:33', '2005-07-14T12:34:33', '2'), - ('437', '3637', '2006-02-16T02:30:53', '2005-06-21T04:23:13', '2005-06-28T03:37:13', '1'), - ('437', '2714', '2006-02-16T02:30:53', '2005-08-20T16:12:48', '2005-08-28T16:05:48', '1'), - ('437', '469', '2006-02-16T02:30:53', '2005-07-08T15:08:45', '2005-07-13T10:44:45', '1'), - ('437', '1897', '2006-02-16T02:30:53', '2005-05-26T06:20:37', '2005-06-02T10:57:37', '1'), - ('437', '2485', '2006-02-16T02:30:53', '2005-07-09T09:18:43', '2005-07-14T12:59:43', '2'), - ('437', '774', '2006-02-16T02:30:53', '2005-08-18T02:21:08', '2005-08-27T00:08:08', '2'), - ('437', '3075', '2006-02-16T02:30:53', '2005-05-28T21:48:51', '2005-06-05T16:45:51', '2'), - ('437', '135', '2006-02-16T02:30:53', '2005-08-01T02:35:39', '2005-08-06T06:50:39', '1'), - ('437', '3416', '2006-02-16T02:30:53', '2005-08-22T07:52:18', '2005-08-27T02:13:18', '1'), - ('437', '1093', '2006-02-16T02:30:53', '2005-07-06T12:11:14', '2005-07-09T17:14:14', '2'), - ('431', '1233', '2006-02-16T02:30:53', '2005-07-29T21:45:19', '2005-08-08T01:45:19', '2'), - ('431', '3896', '2006-02-16T02:30:53', '2005-08-19T13:09:47', '2005-08-23T17:35:47', '2'), - ('431', '4233', '2006-02-16T02:30:53', '2005-08-02T03:39:39', '2005-08-11T07:20:39', '1'), - ('431', '761', '2006-02-16T02:30:53', '2005-07-08T16:51:36', '2005-07-13T17:23:36', '1'), - ('431', '1885', '2006-02-16T02:30:53', '2005-08-23T14:42:07', '2005-08-27T15:00:07', '2'), - ('431', '3087', '2006-02-16T02:30:53', '2005-08-20T12:11:28', '2005-08-25T08:11:28', '1'), - ('431', '1497', '2006-02-16T02:30:53', '2005-08-23T19:35:42', '2005-08-26T17:36:42', '2'), - ('431', '2134', '2006-02-16T02:30:53', '2005-06-19T17:22:17', '2005-06-20T20:20:17', '2'), - ('431', '2765', '2006-02-16T02:30:53', '2005-05-31T17:27:45', '2005-06-04T20:06:45', '2'), - ('431', '2455', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('431', '3890', '2006-02-16T02:30:53', '2005-08-01T11:23:27', '2005-08-02T10:17:27', '1'), - ('431', '4212', '2006-02-16T02:30:53', '2005-06-18T06:47:29', '2005-06-20T10:27:29', '2'), - ('431', '4530', '2006-02-16T02:30:53', '2005-08-01T11:55:54', '2005-08-05T15:56:54', '2'), - ('431', '2154', '2006-02-16T02:30:53', '2005-06-21T07:43:40', '2005-06-27T08:06:40', '2'), - ('431', '1069', '2006-02-16T02:30:53', '2005-06-17T18:33:04', '2005-06-21T17:29:04', '2'), - ('431', '3539', '2006-02-16T02:30:53', '2005-08-18T04:40:50', '2005-08-25T01:44:50', '2'), - ('431', '508', '2006-02-16T02:30:53', '2005-07-28T14:16:14', '2005-08-01T12:53:14', '2'), - ('431', '1', '2006-02-16T02:30:53', '2005-07-08T19:03:15', '2005-07-11T21:29:15', '2'), - ('431', '550', '2006-02-16T02:30:53', '2005-07-07T08:25:44', '2005-07-16T13:10:44', '2'), - ('431', '554', '2006-02-16T02:30:53', '2005-08-17T00:44:04', '2005-08-18T03:43:04', '2'), - ('431', '2263', '2006-02-16T02:30:53', '2005-06-16T02:41:30', '2005-06-22T05:19:30', '1'), - ('431', '303', '2006-02-16T02:30:53', '2005-06-21T13:20:31', '2005-06-30T13:45:31', '2'), - ('431', '3088', '2006-02-16T02:30:53', '2005-06-18T06:20:54', '2005-06-25T04:51:54', '2'), - ('455', '1049', '2006-02-16T02:30:53', '2005-06-17T04:53:35', '2005-06-21T01:16:35', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['14294', '4195', '15494', '10436', '13813', '115', '12163', '12314', '6729', '1382', '343', '1802', '7388', '14583', '7905', '11605', '13083', '4861', '8291', '7498', '2356', '4964', '5504', '15101', '8855', '13622', '13267', '3607', '3329', '10606', '4387', '8634', '4016', '5024', '11541', '9361', '5728', '6906', '15005', '4279', '6624', '9428', '4032', '9125', '5252', '14014', '9862', '15545', '8683', '8320', '13596', '11755', '2290', '8350', '4178', '4055', '7655', '2737', '1607', '12784', '8798', '6027', '11165', '10012', '4220', '3872', '14844', '15035', '13690', '5741', '11081', '15289', '11407', '14875', '12807', '993', '12559', '636', '13175', '11487', '9863', '13427', '7491', '11900', '10923', '444', '3552', '13999', '12721', '2215', '3383', '7426', '1082', '7012', '9676', '3547', '12340', '8', '6573', '5651']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('455', '354', '2006-02-16T02:30:53', '2005-08-21T07:07:26', '2005-08-22T02:20:26', '2'), - ('455', '450', '2006-02-16T02:30:53', '2005-07-07T11:00:02', '2005-07-14T16:54:02', '1'), - ('455', '2968', '2006-02-16T02:30:53', '2005-08-23T02:25:09', '2005-08-27T00:18:09', '1'), - ('455', '4026', '2006-02-16T02:30:53', '2005-08-01T08:50:59', '2005-08-04T05:23:59', '1'), - ('455', '601', '2006-02-16T02:30:53', '2005-08-20T13:03:26', '2005-08-25T08:42:26', '1'), - ('455', '749', '2006-02-16T02:30:53', '2005-05-25T19:13:25', '2005-05-29T20:17:25', '1'), - ('455', '1349', '2006-02-16T02:30:53', '2005-08-18T00:46:01', '2005-08-22T06:16:01', '1'), - ('455', '2204', '2006-02-16T02:30:53', '2005-08-18T06:10:02', '2005-08-25T02:48:02', '1'), - ('455', '2495', '2006-02-16T02:30:53', '2005-07-12T13:58:23', '2005-07-19T09:34:23', '2'), - ('455', '3133', '2006-02-16T02:30:53', '2005-06-15T15:18:08', '2005-06-22T09:22:08', '2'), - ('455', '3301', '2006-02-16T02:30:53', '2005-05-27T04:13:41', '2005-05-28T08:34:41', '1'), - ('455', '4174', '2006-02-16T02:30:53', '2005-06-16T20:23:30', '2005-06-21T20:02:30', '1'), - ('455', '4559', '2006-02-16T02:30:53', '2005-07-27T15:54:19', '2005-08-01T17:02:19', '2'), - ('455', '1203', '2006-02-16T02:30:53', '2005-08-21T17:11:47', '2005-08-24T16:16:47', '2'), - ('455', '4287', '2006-02-16T02:30:53', '2005-07-28T11:26:57', '2005-08-02T06:14:57', '1'), - ('455', '1292', '2006-02-16T02:30:53', '2005-08-17T03:30:57', '2005-08-24T07:02:57', '2'), - ('455', '3469', '2006-02-16T02:30:53', '2005-08-19T10:26:45', '2005-08-23T05:31:45', '2'), - ('455', '2984', '2006-02-16T02:30:53', '2005-07-08T18:57:30', '2005-07-16T15:12:30', '2'), - ('455', '2817', '2006-02-16T02:30:53', '2005-07-29T02:28:25', '2005-08-03T20:57:25', '2'), - ('455', '1144', '2006-02-16T02:30:53', '2005-07-27T20:09:31', '2005-07-29T23:38:31', '1'), - ('455', '2207', '2006-02-16T02:30:53', '2005-06-18T12:59:23', '2005-06-21T10:12:23', '2'), - ('455', '1033', '2006-02-16T02:30:53', '2005-07-08T23:46:38', '2005-07-09T22:19:38', '2'), - ('455', '3053', '2006-02-16T02:30:53', '2005-07-10T00:36:38', '2005-07-16T19:36:38', '1'), - ('335', '683', '2006-02-16T02:30:53', '2005-08-22T11:56:02', '2005-08-28T13:08:02', '2'), - ('335', '4388', '2006-02-16T02:30:53', '2005-07-29T23:40:10', '2005-08-02T18:07:10', '2'), - ('335', '3355', '2006-02-16T02:30:53', '2005-08-20T06:45:32', '2005-08-25T02:40:32', '1'), - ('335', '550', '2006-02-16T02:30:53', '2005-08-19T17:31:36', '2005-08-21T13:47:36', '1'), - ('335', '542', '2006-02-16T02:30:53', '2005-07-06T05:30:09', '2005-07-08T01:36:09', '2'), - ('335', '3506', '2006-02-16T02:30:53', '2005-06-21T09:20:31', '2005-06-22T10:00:31', '2'), - ('335', '81', '2006-02-16T02:30:53', '2005-08-01T14:39:15', '2005-08-08T11:31:15', '1'), - ('335', '591', '2006-02-16T02:30:53', '2005-07-07T20:56:47', '2005-07-16T00:51:47', '1'), - ('335', '2023', '2006-02-16T02:30:53', '2005-07-29T14:19:57', '2005-08-07T13:44:57', '1'), - ('335', '3318', '2006-02-16T02:30:53', '2005-07-07T01:05:50', '2005-07-09T05:59:50', '1'), - ('335', '2987', '2006-02-16T02:30:53', '2005-07-09T02:25:12', '2005-07-12T03:15:12', '1'), - ('335', '2026', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '1'), - ('335', '4163', '2006-02-16T02:30:53', '2005-07-30T18:43:49', '2005-08-06T21:24:49', '1'), - ('335', '636', '2006-02-16T02:30:53', '2005-07-10T11:26:14', '2005-07-15T12:55:14', '1'), - ('335', '1435', '2006-02-16T02:30:53', '2005-07-12T22:03:02', '2005-07-15T00:35:02', '1'), - ('335', '2897', '2006-02-16T02:30:53', '2005-08-22T08:15:44', '2005-08-24T09:52:44', '2'), - ('335', '581', '2006-02-16T02:30:53', '2005-07-07T15:01:53', '2005-07-08T09:43:53', '1'), - ('335', '3946', '2006-02-16T02:30:53', '2005-07-12T09:05:50', '2005-07-18T13:59:50', '2'), - ('335', '1948', '2006-02-16T02:30:53', '2005-07-30T21:18:37', '2005-08-05T16:09:37', '1'), - ('335', '2628', '2006-02-16T02:30:53', '2005-07-07T02:34:13', '2005-07-14T22:43:13', '1'), - ('335', '333', '2006-02-16T02:30:53', '2005-07-30T09:43:39', '2005-08-07T14:02:39', '1'), - ('335', '2581', '2006-02-16T02:30:53', '2005-07-09T13:40:44', '2005-07-14T09:41:44', '1'), - ('335', '2188', '2006-02-16T02:30:53', '2005-08-20T20:47:09', '2005-08-21T22:08:09', '2'), - ('513', '474', '2006-02-16T02:30:53', '2005-07-31T13:05:03', '2005-08-01T09:05:03', '2'), - ('513', '843', '2006-02-16T02:30:53', '2005-08-23T04:20:16', '2005-08-29T08:22:16', '1'), - ('513', '3915', '2006-02-16T02:30:53', '2005-07-29T16:15:43', '2005-08-07T19:19:43', '1'), - ('513', '1285', '2006-02-16T02:30:53', '2005-07-29T03:49:58', '2005-08-03T01:00:58', '1'), - ('513', '482', '2006-02-16T02:30:53', '2005-08-20T05:58:58', '2005-08-27T08:35:58', '1'), - ('513', '3457', '2006-02-16T02:30:53', '2005-08-17T09:15:35', '2005-08-23T06:28:35', '2'), - ('513', '200', '2006-02-16T02:30:53', '2005-06-18T07:34:37', '2005-06-26T11:45:37', '1'), - ('513', '3726', '2006-02-16T02:30:53', '2005-07-29T04:50:39', '2005-07-31T05:36:39', '2'), - ('513', '2898', '2006-02-16T02:30:53', '2005-07-07T10:14:31', '2005-07-12T09:38:31', '2'), - ('513', '2561', '2006-02-16T02:30:53', '2005-07-07T03:49:13', '2005-07-11T03:15:13', '2'), - ('513', '2665', '2006-02-16T02:30:53', '2005-07-28T02:01:11', '2005-07-30T23:12:11', '2'), - ('513', '3131', '2006-02-16T02:30:53', '2005-06-19T15:48:33', '2005-06-26T18:44:33', '2'), - ('513', '3289', '2006-02-16T02:30:53', '2005-06-16T06:25:35', '2005-06-20T02:50:35', '2'), - ('513', '447', '2006-02-16T02:30:53', '2005-08-19T00:02:46', '2005-08-20T04:39:46', '1'), - ('513', '800', '2006-02-16T02:30:53', '2005-07-29T21:15:38', '2005-08-05T02:46:38', '2'), - ('513', '4536', '2006-02-16T02:30:53', '2005-07-11T02:26:29', '2005-07-18T23:05:29', '1'), - ('513', '2059', '2006-02-16T02:30:53', '2005-08-02T10:12:17', '2005-08-04T11:09:17', '1'), - ('513', '2554', '2006-02-16T02:30:53', '2005-07-31T18:06:06', '2005-08-09T16:47:06', '2'), - ('513', '821', '2006-02-16T02:30:53', '2005-07-07T12:12:36', '2005-07-10T13:37:36', '1'), - ('513', '1785', '2006-02-16T02:30:53', '2005-07-06T18:00:19', '2005-07-07T17:26:19', '1'), - ('513', '145', '2006-02-16T02:30:53', '2005-08-22T02:09:12', '2005-08-31T05:43:12', '1'), - ('513', '339', '2006-02-16T02:30:53', '2005-08-22T09:34:32', '2005-08-28T10:23:32', '1'), - ('513', '3721', '2006-02-16T02:30:53', '2005-08-20T09:07:27', '2005-08-23T08:03:27', '2'), - ('513', '2041', '2006-02-16T02:30:53', '2005-07-10T11:55:40', '2005-07-16T15:02:40', '2'), - ('513', '3804', '2006-02-16T02:30:53', '2005-08-02T07:30:14', '2005-08-09T08:50:14', '1'), - ('513', '1026', '2006-02-16T02:30:53', '2005-08-22T19:27:24', '2005-08-30T22:21:24', '1'), - ('513', '3437', '2006-02-16T02:30:53', '2005-08-02T19:18:43', '2005-08-08T16:15:43', '2'), - ('513', '3912', '2006-02-16T02:30:53', '2005-08-22T03:34:39', '2005-08-26T03:40:39', '1'), - ('513', '2323', '2006-02-16T02:30:53', '2005-08-19T00:38:46', '2005-08-28T03:37:46', '2'), - ('513', '2080', '2006-02-16T02:30:53', '2005-05-30T23:54:19', '2005-06-04T21:27:19', '1'), - ('513', '39', '2006-02-16T02:30:53', '2005-08-18T14:53:58', '2005-08-25T20:22:58', '1'), - ('239', '4213', '2006-02-16T02:30:53', '2005-05-28T17:47:58', '2005-06-04T16:32:58', '1'), - ('239', '3187', '2006-02-16T02:30:53', '2005-08-19T13:54:53', '2005-08-20T16:25:53', '2'), - ('239', '734', '2006-02-16T02:30:53', '2005-08-02T22:35:05', '2005-08-08T00:54:05', '2'), - ('239', '19', '2006-02-16T02:30:53', '2005-07-31T13:05:29', '2005-08-08T12:33:29', '1'), - ('239', '3120', '2006-02-16T02:30:53', '2005-08-19T23:19:02', '2005-08-21T18:30:02', '1'), - ('239', '4261', '2006-02-16T02:30:53', '2005-07-27T19:53:23', '2005-07-28T23:25:23', '2'), - ('239', '1931', '2006-02-16T02:30:53', '2005-08-17T15:30:44', '2005-08-19T16:12:44', '1'), - ('239', '2602', '2006-02-16T02:30:53', '2005-08-02T02:15:01', '2005-08-03T04:18:01', '1'), - ('239', '723', '2006-02-16T02:30:53', '2005-05-27T18:39:15', '2005-06-01T15:56:15', '1'), - ('239', '1099', '2006-02-16T02:30:53', '2005-07-06T02:34:09', '2005-07-12T05:31:09', '1'), - ('239', '4149', '2006-02-16T02:30:53', '2005-08-20T19:53:32', '2005-08-26T19:01:32', '1'), - ('239', '1045', '2006-02-16T02:30:53', '2005-08-18T21:30:12', '2005-08-22T22:45:12', '1'), - ('239', '2060', '2006-02-16T02:30:53', '2005-06-18T02:48:21', '2005-06-22T01:03:21', '2'), - ('239', '2968', '2006-02-16T02:30:53', '2005-06-21T14:07:19', '2005-06-29T17:00:19', '2'), - ('239', '4420', '2006-02-16T02:30:53', '2005-07-27T17:19:46', '2005-07-29T21:41:46', '1'), - ('239', '4510', '2006-02-16T02:30:53', '2005-05-31T11:02:01', '2005-06-05T08:43:01', '1'), - ('239', '779', '2006-02-16T02:30:53', '2005-07-27T02:01:03', '2005-08-05T07:34:03', '2'), - ('239', '681', '2006-02-16T02:30:53', '2005-07-31T06:39:13', '2005-08-05T09:31:13', '2'), - ('239', '2730', '2006-02-16T02:30:53', '2005-07-06T02:18:06', '2005-07-08T05:24:06', '1'), - ('239', '3561', '2006-02-16T02:30:53', '2005-08-18T07:07:01', '2005-08-20T05:06:01', '1'), - ('239', '2346', '2006-02-16T02:30:53', '2005-05-24T23:31:46', '2005-05-27T23:33:46', '2'), - ('239', '3308', '2006-02-16T02:30:53', '2005-07-12T06:03:40', '2005-07-13T11:49:40', '2'), - ('239', '301', '2006-02-16T02:30:53', '2005-07-10T07:17:13', '2005-07-15T12:13:13', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['1560', '14062', '621', '10755', '1022', '4920', '1160', '11968', '5960', '2390', '8457', '15991', '2939', '1715', '12519', '8792', '7787', '11712', '10700', '10805', '8039', '5579', '15798', '14505', '9015', '314', '3406', '13841', '1217', '4136', '8463', '13609', '3239', '12825', '8780', '11174', '5450', '3024', '8017', '14755', '2243', '9835', '12175', '13681', '1980', '15863', '1670', '15179', '14939', '9557', '14307', '862', '8577', '13907', '5985', '15694', '2755', '6783', '9972', '1467', '1153', '10873', '14337', '387', '15022', '11781', '2824', '13767', '9654', '11238', '410', '15572', '14395', '14074', '8096', '8506', '1446', '7020', '114', '547', '12994', '1042', '10477', '4640', '907', '4594', '13073', '1565', '4806', '13810', '13828', '13731', '5999', '7365', '14172', '15419', '3155', '10432', '6028', '548']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('239', '3418', '2006-02-16T02:30:53', '2005-06-16T02:36:43', '2005-06-24T23:10:43', '2'), - ('239', '2841', '2006-02-16T02:30:53', '2005-08-20T22:34:34', '2005-08-25T17:11:34', '2'), - ('239', '1144', '2006-02-16T02:30:53', '2005-05-28T15:58:12', '2005-05-30T21:54:12', '1'), - ('239', '1217', '2006-02-16T02:30:53', '2005-08-01T20:14:14', '2005-08-07T01:04:14', '1'), - ('239', '842', '2006-02-16T02:30:53', '2005-05-31T03:16:45', '2005-06-08T09:04:45', '1'), - ('239', '4285', '2006-02-16T02:30:53', '2005-07-08T21:42:10', '2005-07-15T03:08:10', '1'), - ('239', '2795', '2006-02-16T02:30:53', '2005-06-14T23:00:34', '2005-06-18T01:58:34', '2'), - ('239', '698', '2006-02-16T02:30:53', '2005-08-17T17:47:34', '2005-08-18T19:40:34', '1'), - ('239', '3884', '2006-02-16T02:30:53', '2005-07-10T23:38:34', '2005-07-11T19:21:34', '1'), - ('239', '2748', '2006-02-16T02:30:53', '2005-06-18T15:29:26', '2005-06-23T17:50:26', '1'), - ('239', '3371', '2006-02-16T02:30:53', '2005-07-29T07:59:03', '2005-08-04T08:42:03', '1'), - ('203', '2078', '2006-02-16T02:30:53', '2005-08-23T20:27:34', '2005-08-28T16:48:34', '2'), - ('203', '2638', '2006-02-16T02:30:53', '2005-06-20T05:18:16', '2005-06-26T06:56:16', '1'), - ('203', '1594', '2006-02-16T02:30:53', '2005-06-16T14:37:12', '2005-06-20T19:36:12', '1'), - ('203', '2394', '2006-02-16T02:30:53', '2005-08-18T13:42:14', '2005-08-24T16:44:14', '1'), - ('203', '3764', '2006-02-16T02:30:53', '2005-07-29T20:56:14', '2005-08-07T16:44:14', '2'), - ('203', '2191', '2006-02-16T02:30:53', '2005-07-28T07:19:02', '2005-08-06T02:38:02', '2'), - ('203', '3607', '2006-02-16T02:30:53', '2005-08-17T07:32:51', '2005-08-21T09:18:51', '2'), - ('203', '4259', '2006-02-16T02:30:53', '2005-08-01T18:26:31', '2005-08-07T19:51:31', '2'), - ('203', '557', '2006-02-16T02:30:53', '2005-08-01T22:23:37', '2005-08-05T01:22:37', '2'), - ('203', '1996', '2006-02-16T02:30:53', '2005-07-28T16:35:16', '2005-07-30T14:49:16', '1'), - ('203', '945', '2006-02-16T02:30:53', '2005-07-10T04:04:29', '2005-07-14T04:31:29', '1'), - ('203', '3803', '2006-02-16T02:30:53', '2005-08-23T14:23:03', '2005-08-30T17:39:03', '2'), - ('203', '2172', '2006-02-16T02:30:53', '2005-08-21T14:26:28', '2005-08-29T17:34:28', '1'), - ('203', '4128', '2006-02-16T02:30:53', '2005-07-30T05:21:32', '2005-08-08T07:03:32', '2'), - ('203', '2851', '2006-02-16T02:30:53', '2005-05-26T23:09:41', '2005-05-28T22:49:41', '2'), - ('203', '2049', '2006-02-16T02:30:53', '2005-06-21T16:00:18', '2005-06-23T18:25:18', '1'), - ('203', '3277', '2006-02-16T02:30:53', '2005-08-20T14:25:18', '2005-08-29T15:49:18', '1'), - ('203', '600', '2006-02-16T02:30:53', '2005-06-15T03:24:14', '2005-06-18T22:37:14', '2'), - ('203', '3461', '2006-02-16T02:30:53', '2005-07-07T08:15:52', '2005-07-10T04:22:52', '2'), - ('203', '466', '2006-02-16T02:30:53', '2005-07-29T08:17:51', '2005-08-03T13:41:51', '1'), - ('328', '299', '2006-02-16T02:30:53', '2005-08-20T06:11:51', '2005-08-23T04:13:51', '2'), - ('328', '3402', '2006-02-16T02:30:53', '2005-06-21T02:48:40', '2005-06-22T02:49:40', '2'), - ('328', '4495', '2006-02-16T02:30:53', '2005-08-19T01:23:58', '2005-08-20T00:19:58', '2'), - ('328', '1095', '2006-02-16T02:30:53', '2005-07-29T20:19:45', '2005-08-03T22:22:45', '2'), - ('328', '1551', '2006-02-16T02:30:53', '2005-08-02T10:32:11', '2005-08-09T12:30:11', '1'), - ('328', '2356', '2006-02-16T02:30:53', '2005-07-09T22:13:25', '2005-07-13T23:28:25', '1'), - ('328', '1966', '2006-02-16T02:30:53', '2005-06-20T11:29:17', '2005-06-27T12:51:17', '2'), - ('328', '1764', '2006-02-16T02:30:53', '2005-07-28T15:35:41', '2005-08-01T19:12:41', '1'), - ('328', '862', '2006-02-16T02:30:53', '2005-08-21T23:18:08', '2005-08-27T01:06:08', '2'), - ('328', '1254', '2006-02-16T02:30:53', '2005-06-18T04:33:03', '2005-06-23T04:14:03', '2'), - ('328', '1051', '2006-02-16T02:30:53', '2005-07-31T12:07:35', '2005-08-04T07:32:35', '2'), - ('328', '4558', '2006-02-16T02:30:53', '2005-08-18T01:10:17', '2005-08-19T05:25:17', '2'), - ('328', '3039', '2006-02-16T02:30:53', '2005-08-20T08:47:37', '2005-08-27T09:47:37', '1'), - ('328', '2985', '2006-02-16T02:30:53', '2005-06-17T09:48:05', '2005-06-23T14:43:05', '1'), - ('328', '2783', '2006-02-16T02:30:53', '2005-08-23T16:17:09', '2005-08-28T16:10:09', '2'), - ('328', '2066', '2006-02-16T02:30:53', '2005-06-16T10:26:33', '2005-06-19T07:15:33', '1'), - ('328', '450', '2006-02-16T02:30:53', '2005-08-22T15:36:22', '2005-08-31T19:57:22', '1'), - ('328', '719', '2006-02-16T02:30:53', '2005-08-22T05:53:52', '2005-08-27T06:20:52', '1'), - ('328', '708', '2006-02-16T02:30:53', '2005-07-31T02:14:01', '2005-08-05T23:55:01', '1'), - ('328', '2894', '2006-02-16T02:30:53', '2005-08-21T07:34:52', '2005-08-29T09:45:52', '1'), - ('328', '1186', '2006-02-16T02:30:53', '2005-05-30T03:09:11', '2005-06-03T21:27:11', '1'), - ('328', '520', '2006-02-16T02:30:53', '2005-07-29T11:56:30', '2005-08-07T15:41:30', '1'), - ('328', '806', '2006-02-16T02:30:53', '2005-08-20T16:17:27', '2005-08-24T20:14:27', '2'), - ('506', '1108', '2006-02-16T02:30:53', '2005-07-11T00:51:58', '2005-07-14T22:02:58', '2'), - ('506', '3017', '2006-02-16T02:30:53', '2005-08-23T10:02:46', '2005-08-31T05:46:46', '2'), - ('506', '946', '2006-02-16T02:30:53', '2005-06-19T16:56:31', '2005-06-27T12:02:31', '2'), - ('506', '3633', '2006-02-16T02:30:53', '2005-07-12T16:27:56', '2005-07-13T12:11:56', '2'), - ('506', '190', '2006-02-16T02:30:53', '2005-07-31T16:42:43', '2005-08-02T11:05:43', '2'), - ('506', '688', '2006-02-16T02:30:53', '2005-06-15T20:47:10', '2005-06-22T00:30:10', '1'), - ('506', '2725', '2006-02-16T02:30:53', '2005-05-31T21:36:44', '2005-06-10T01:26:44', '2'), - ('506', '169', '2006-02-16T02:30:53', '2005-08-02T00:30:34', '2005-08-07T00:16:34', '2'), - ('506', '3529', '2006-02-16T02:30:53', '2005-08-21T08:34:26', '2005-08-24T11:31:26', '1'), - ('506', '2684', '2006-02-16T02:30:53', '2005-05-27T10:35:27', '2005-06-01T13:37:27', '2'), - ('506', '249', '2006-02-16T02:30:53', '2005-08-22T08:55:43', '2005-08-31T05:35:43', '2'), - ('506', '1853', '2006-02-16T02:30:53', '2005-08-17T10:37:00', '2005-08-21T12:03:00', '2'), - ('506', '2878', '2006-02-16T02:30:53', '2005-06-19T20:31:45', '2005-06-29T00:40:45', '2'), - ('506', '2739', '2006-02-16T02:30:53', '2005-08-20T11:43:36', '2005-08-22T17:10:36', '1'), - ('506', '3286', '2006-02-16T02:30:53', '2005-07-31T05:57:42', '2005-08-06T04:19:42', '1'), - ('506', '2705', '2006-02-16T02:30:53', '2005-08-02T13:25:50', '2005-08-08T19:12:50', '2'), - ('506', '4010', '2006-02-16T02:30:53', '2005-05-27T14:11:22', '2005-06-02T20:06:22', '2'), - ('506', '2816', '2006-02-16T02:30:53', '2005-08-23T05:28:01', '2005-08-27T00:14:01', '2'), - ('506', '632', '2006-02-16T02:30:53', '2005-08-21T10:24:00', '2005-08-28T12:23:00', '2'), - ('506', '1303', '2006-02-16T02:30:53', '2005-08-20T23:16:07', '2005-08-26T04:45:07', '1'), - ('506', '502', '2006-02-16T02:30:53', '2005-07-28T18:32:46', '2005-08-06T15:00:46', '1'), - ('506', '3714', '2006-02-16T02:30:53', '2005-07-29T09:23:52', '2005-07-31T04:42:52', '1'), - ('506', '1989', '2006-02-16T02:30:53', '2005-06-15T19:13:45', '2005-06-23T19:43:45', '2'), - ('506', '3965', '2006-02-16T02:30:53', '2005-07-27T02:24:27', '2005-07-29T01:27:27', '2'), - ('506', '4502', '2006-02-16T02:30:53', '2005-05-25T19:12:42', '2005-06-01T23:10:42', '1'), - ('506', '2065', '2006-02-16T02:30:53', '2005-05-28T07:24:28', '2005-06-06T01:31:28', '2'), - ('506', '3809', '2006-02-16T02:30:53', '2005-08-19T07:26:10', '2005-08-20T07:02:10', '2'), - ('506', '3155', '2006-02-16T02:30:53', '2005-05-31T05:53:00', '2005-06-01T05:24:00', '1'), - ('506', '235', '2006-02-16T02:30:53', '2005-08-01T10:04:17', '2005-08-06T11:32:17', '2'), - ('506', '1147', '2006-02-16T02:30:53', '2005-07-08T08:59:34', '2005-07-15T03:31:34', '1'), - ('506', '3320', '2006-02-16T02:30:53', '2005-05-30T10:37:27', '2005-06-02T09:51:27', '1'), - ('506', '26', '2006-02-16T02:30:53', '2005-07-08T06:40:06', '2005-07-16T05:51:06', '2'), - ('506', '855', '2006-02-16T02:30:53', '2005-08-19T10:05:38', '2005-08-26T07:37:38', '2'), - ('506', '3833', '2006-02-16T02:30:53', '2005-06-16T03:13:09', '2005-06-16T22:42:09', '2'), - ('506', '214', '2006-02-16T02:30:53', '2005-07-08T17:01:02', '2005-07-15T21:41:02', '1'), - ('450', '2228', '2006-02-16T02:30:53', '2005-08-20T12:59:38', '2005-08-21T17:40:38', '1'), - ('450', '2391', '2006-02-16T02:30:53', '2005-08-20T13:49:52', '2005-08-25T07:49:52', '2'), - ('450', '1133', '2006-02-16T02:30:53', '2005-08-20T10:22:08', '2005-08-21T12:04:08', '2'), - ('450', '211', '2006-02-16T02:30:53', '2005-07-11T01:21:22', '2005-07-19T01:35:22', '1'), - ('450', '3283', '2006-02-16T02:30:53', '2005-07-27T15:00:20', '2005-07-30T12:58:20', '1'), - ('450', '2158', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('450', '1120', '2006-02-16T02:30:53', '2005-08-22T23:54:36', '2005-08-25T00:52:36', '1'), - ('450', '458', '2006-02-16T02:30:53', '2005-06-20T21:02:38', '2005-06-27T19:34:38', '1'), - ('450', '4238', '2006-02-16T02:30:53', '2005-08-01T08:43:21', '2005-08-08T13:09:21', '2'), - ('450', '784', '2006-02-16T02:30:53', '2005-07-11T02:31:44', '2005-07-14T03:18:44', '1'), - ('450', '3704', '2006-02-16T02:30:53', '2005-05-28T07:34:56', '2005-06-05T03:14:56', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['7626', '2501', '15019', '15327', '2278', '7610', '1639', '1914', '10984', '14282', '3570', '8733', '2626', '1739', '12812', '8533', '2610', '13447', '5477', '8544', '14982', '6325', '376', '5293', '220', '6887', '10280', '11583', '6077', '12819', '11903', '2957', '7672', '10250', '14907', '11016', '1913', '6557', '1533', '2861', '3908', '3940', '13146', '1058', '10801', '2639', '7238', '14763', '13369', '7763', '9562', '12376', '1332', '1762', '4737', '13474', '9245', '4027', '5169', '13775', '8059', '5914', '8358', '617', '7190', '2315', '2959', '13871', '15041', '14037', '8837', '14331', '13402', '5352', '11555', '5501', '5229', '14770', '8009', '12224', '9128', '8724', '638', '5314', '12714', '11438', '3283', '6692', '7735', '14211', '8755', '15563', '11134', '7234', '5412', '6654', '6595', '6250', '14428', '11975']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('450', '4200', '2006-02-16T02:30:53', '2005-07-28T00:49:01', '2005-07-31T00:43:01', '1'), - ('450', '1185', '2006-02-16T02:30:53', '2005-06-18T23:10:11', '2005-06-24T18:40:11', '2'), - ('450', '3425', '2006-02-16T02:30:53', '2005-08-22T08:52:53', '2005-08-25T13:07:53', '2'), - ('450', '1018', '2006-02-16T02:30:53', '2005-08-22T20:31:24', '2005-08-30T23:52:24', '1'), - ('450', '1166', '2006-02-16T02:30:53', '2005-06-18T06:37:57', '2005-06-22T10:57:57', '1'), - ('450', '1279', '2006-02-16T02:30:53', '2005-07-28T00:11:35', '2005-07-31T00:33:35', '1'), - ('450', '176', '2006-02-16T02:30:53', '2005-06-16T08:33:39', '2005-06-25T07:51:39', '1'), - ('450', '3406', '2006-02-16T02:30:53', '2005-06-17T05:25:54', '2005-06-24T04:25:54', '2'), - ('450', '1813', '2006-02-16T02:30:53', '2005-08-02T04:30:02', '2005-08-10T02:51:02', '1'), - ('450', '3107', '2006-02-16T02:30:53', '2005-08-21T06:41:29', '2005-08-22T12:37:29', '1'), - ('450', '1300', '2006-02-16T02:30:53', '2005-07-06T03:23:43', '2005-07-14T07:28:43', '2'), - ('450', '3187', '2006-02-16T02:30:53', '2005-07-29T18:26:34', '2005-08-03T15:06:34', '1'), - ('450', '2816', '2006-02-16T02:30:53', '2005-06-19T08:28:44', '2005-06-24T03:58:44', '1'), - ('450', '2557', '2006-02-16T02:30:53', '2005-06-16T16:09:38', '2005-06-22T18:04:38', '2'), - ('450', '4024', '2006-02-16T02:30:53', '2005-08-19T00:54:02', '2005-08-22T20:35:02', '2'), - ('542', '551', '2006-02-16T02:30:53', '2005-07-29T10:29:16', '2005-08-01T06:52:16', '1'), - ('542', '3845', '2006-02-16T02:30:53', '2005-06-19T07:16:20', '2005-06-25T09:39:20', '2'), - ('542', '285', '2006-02-16T02:30:53', '2005-08-20T00:09:36', '2005-08-25T01:22:36', '1'), - ('542', '994', '2006-02-16T02:30:53', '2005-07-09T23:43:49', '2005-07-15T05:03:49', '2'), - ('542', '412', '2006-02-16T02:30:53', '2005-07-29T11:02:08', '2005-08-06T15:06:08', '2'), - ('542', '2333', '2006-02-16T02:30:53', '2005-08-22T07:20:55', '2005-08-31T04:35:55', '2'), - ('542', '4556', '2006-02-16T02:30:53', '2005-07-11T19:06:01', '2005-07-18T18:25:01', '2'), - ('542', '3197', '2006-02-16T02:30:53', '2005-05-27T08:58:15', '2005-06-02T04:48:15', '1'), - ('542', '2880', '2006-02-16T02:30:53', '2005-07-09T15:17:23', '2005-07-11T11:23:23', '2'), - ('542', '1259', '2006-02-16T02:30:53', '2005-05-26T10:06:49', '2005-06-01T07:43:49', '1'), - ('542', '4487', '2006-02-16T02:30:53', '2005-07-12T21:00:23', '2005-07-21T17:46:23', '1'), - ('542', '1457', '2006-02-16T02:30:53', '2005-08-01T03:27:15', '2005-08-07T23:01:15', '2'), - ('542', '133', '2006-02-16T02:30:53', '2005-08-17T02:08:13', '2005-08-20T23:13:13', '2'), - ('542', '2154', '2006-02-16T02:30:53', '2005-07-11T05:06:08', '2005-07-16T10:29:08', '1'), - ('542', '1117', '2006-02-16T02:30:53', '2005-08-19T01:05:05', '2005-08-22T05:50:05', '1'), - ('542', '1196', '2006-02-16T02:30:53', '2005-08-17T15:37:45', '2005-08-23T18:31:45', '2'), - ('542', '4034', '2006-02-16T02:30:53', '2005-06-20T06:53:47', '2005-06-29T09:21:47', '2'), - ('542', '573', '2006-02-16T02:30:53', '2005-07-28T02:49:41', '2005-08-04T02:38:41', '1'), - ('116', '3706', '2006-02-16T02:30:53', '2005-08-01T02:38:42', '2005-08-07T03:59:42', '2'), - ('116', '2469', '2006-02-16T02:30:53', '2005-08-22T04:44:09', '2005-08-25T09:53:09', '1'), - ('116', '4446', '2006-02-16T02:30:53', '2005-08-02T05:19:13', '2005-08-05T05:31:13', '1'), - ('116', '1825', '2006-02-16T02:30:53', '2005-06-17T05:19:47', '2005-06-21T03:39:47', '1'), - ('116', '1442', '2006-02-16T02:30:53', '2005-07-12T05:12:03', '2005-07-20T06:49:03', '1'), - ('116', '2452', '2006-02-16T02:30:53', '2005-06-16T00:46:02', '2005-06-17T20:11:02', '1'), - ('116', '1489', '2006-02-16T02:30:53', '2005-06-19T23:21:34', '2005-06-26T17:32:34', '1'), - ('116', '3980', '2006-02-16T02:30:53', '2005-07-06T19:47:26', '2005-07-13T19:59:26', '1'), - ('116', '1502', '2006-02-16T02:30:53', '2005-07-06T21:16:59', '2005-07-07T19:17:59', '2'), - ('116', '1463', '2006-02-16T02:30:53', '2005-08-19T12:54:42', '2005-08-26T07:31:42', '1'), - ('116', '40', '2006-02-16T02:30:53', '2005-05-31T08:04:17', '2005-06-03T11:12:17', '2'), - ('116', '3757', '2006-02-16T02:30:53', '2005-08-01T22:09:35', '2005-08-08T22:23:35', '1'), - ('116', '3971', '2006-02-16T02:30:53', '2005-06-19T09:24:02', '2005-06-21T14:16:02', '2'), - ('116', '1197', '2006-02-16T02:30:53', '2005-07-27T10:13:41', '2005-07-29T11:07:41', '1'), - ('116', '1480', '2006-02-16T02:30:53', '2005-08-21T23:34:00', '2005-08-31T03:58:00', '2'), - ('116', '2728', '2006-02-16T02:30:53', '2005-08-19T21:19:47', '2005-08-24T23:25:47', '1'), - ('116', '2461', '2006-02-16T02:30:53', '2005-07-28T06:35:16', '2005-08-03T02:46:16', '2'), - ('116', '1571', '2006-02-16T02:30:53', '2005-07-31T02:23:20', '2005-08-06T21:01:20', '2'), - ('116', '852', '2006-02-16T02:30:53', '2005-08-18T08:20:29', '2005-08-20T13:20:29', '1'), - ('116', '1412', '2006-02-16T02:30:53', '2005-06-15T11:36:01', '2005-06-17T14:29:01', '1'), - ('116', '3050', '2006-02-16T02:30:53', '2005-06-16T17:50:19', '2005-06-19T21:35:19', '2'), - ('116', '4286', '2006-02-16T02:30:53', '2005-07-08T13:23:53', '2005-07-12T18:49:53', '1'), - ('116', '1209', '2006-02-16T02:30:53', '2005-08-20T01:04:32', '2005-08-21T20:26:32', '2'), - ('116', '2586', '2006-02-16T02:30:53', '2005-07-30T14:07:50', '2005-08-06T17:59:50', '2'), - ('116', '56', '2006-02-16T02:30:53', '2005-07-07T02:19:01', '2005-07-10T01:12:01', '1'), - ('116', '2608', '2006-02-16T02:30:53', '2005-07-09T09:22:25', '2005-07-10T03:48:25', '1'), - ('116', '1858', '2006-02-16T02:30:53', '2005-08-20T11:56:30', '2005-08-28T12:48:30', '2'), - ('372', '2611', '2006-02-16T02:30:53', '2005-07-28T17:09:59', '2005-07-31T15:42:59', '2'), - ('372', '2639', '2006-02-16T02:30:53', '2005-07-10T21:01:12', '2005-07-16T18:27:12', '2'), - ('372', '1449', '2006-02-16T02:30:53', '2005-07-29T05:00:58', '2005-08-01T02:49:58', '2'), - ('372', '4142', '2006-02-16T02:30:53', '2005-05-28T15:49:14', '2005-05-31T14:29:14', '2'), - ('372', '1330', '2006-02-16T02:30:53', '2005-07-27T08:36:01', '2005-07-30T08:32:01', '2'), - ('372', '2766', '2006-02-16T02:30:53', '2005-06-18T09:03:39', '2005-06-22T11:18:39', '1'), - ('372', '4185', '2006-02-16T02:30:53', '2005-06-20T07:07:54', '2005-06-27T03:31:54', '1'), - ('372', '3206', '2006-02-16T02:30:53', '2005-08-20T15:10:13', '2005-08-29T19:43:13', '2'), - ('372', '1913', '2006-02-16T02:30:53', '2005-08-22T09:43:18', '2005-08-23T11:04:18', '2'), - ('372', '3655', '2006-02-16T02:30:53', '2005-08-20T21:35:58', '2005-08-29T23:06:58', '2'), - ('372', '42', '2006-02-16T02:30:53', '2005-07-29T22:49:00', '2005-08-07T21:56:00', '2'), - ('372', '3128', '2006-02-16T02:30:53', '2005-08-21T08:29:38', '2005-08-29T13:18:38', '2'), - ('372', '3264', '2006-02-16T02:30:53', '2005-08-19T22:16:53', '2005-08-22T22:28:53', '1'), - ('372', '908', '2006-02-16T02:30:53', '2005-07-09T17:54:58', '2005-07-15T16:20:58', '1'), - ('372', '2569', '2006-02-16T02:30:53', '2005-08-17T01:08:59', '2005-08-18T06:09:59', '2'), - ('372', '3979', '2006-02-16T02:30:53', '2005-07-10T00:33:48', '2005-07-17T02:58:48', '1'), - ('372', '4472', '2006-02-16T02:30:53', '2005-07-09T12:30:18', '2005-07-14T15:31:18', '2'), - ('372', '2977', '2006-02-16T02:30:53', '2005-08-21T23:47:16', '2005-08-25T04:48:16', '1'), - ('372', '337', '2006-02-16T02:30:53', '2005-07-28T15:25:58', '2005-08-04T10:16:58', '2'), - ('372', '1781', '2006-02-16T02:30:53', '2005-08-18T02:59:09', '2005-08-19T06:22:09', '1'), - ('372', '3647', '2006-02-16T02:30:53', '2005-07-30T09:51:14', '2005-08-07T06:23:14', '1'), - ('372', '898', '2006-02-16T02:30:53', '2005-07-29T18:05:21', '2005-08-01T15:41:21', '1'), - ('372', '2685', '2006-02-16T02:30:53', '2005-05-28T18:24:43', '2005-06-02T19:03:43', '2'), - ('372', '3770', '2006-02-16T02:30:53', '2005-07-09T16:05:28', '2005-07-10T18:18:28', '1'), - ('372', '868', '2006-02-16T02:30:53', '2005-08-18T21:08:01', '2005-08-27T17:09:01', '2'), - ('372', '1040', '2006-02-16T02:30:53', '2005-08-02T20:21:08', '2005-08-10T22:12:08', '1'), - ('372', '3988', '2006-02-16T02:30:53', '2005-06-21T06:19:07', '2005-06-26T10:59:07', '2'), - ('372', '2837', '2006-02-16T02:30:53', '2005-07-12T12:35:39', '2005-07-20T11:20:39', '2'), - ('372', '3949', '2006-02-16T02:30:53', '2005-07-28T05:09:56', '2005-07-31T23:34:56', '2'), - ('372', '300', '2006-02-16T02:30:53', '2005-08-21T04:29:11', '2005-08-24T02:50:11', '2'), - ('372', '1498', '2006-02-16T02:30:53', '2005-07-29T19:18:31', '2005-07-31T19:20:31', '2'), - ('372', '170', '2006-02-16T02:30:53', '2005-08-23T05:08:58', '2005-08-24T04:24:58', '1'), - ('372', '2641', '2006-02-16T02:30:53', '2005-08-02T09:19:22', '2005-08-11T03:56:22', '1'), - ('372', '3873', '2006-02-16T02:30:53', '2005-07-27T10:08:45', '2005-07-31T13:58:45', '1'), - ('458', '3174', '2006-02-16T02:30:53', '2005-07-09T20:23:52', '2005-07-18T18:40:52', '1'), - ('458', '2870', '2006-02-16T02:30:53', '2005-07-12T11:06:28', '2005-07-20T10:27:28', '1'), - ('458', '1286', '2006-02-16T02:30:53', '2005-07-12T07:25:48', '2005-07-20T02:24:48', '2'), - ('458', '4087', '2006-02-16T02:30:53', '2005-07-11T15:02:04', '2005-07-17T10:54:04', '1'), - ('458', '1614', '2006-02-16T02:30:53', '2005-08-21T11:27:07', '2005-08-29T09:50:07', '1'), - ('458', '3843', '2006-02-16T02:30:53', '2005-08-17T17:58:39', '2005-08-20T19:11:39', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['7923', '12768', '4525', '11138', '3322', '13571', '6431', '13259', '2629', '5572', '8158', '13487', '15604', '3928', '8613', '5800', '13634', '5357', '14772', '972', '7513', '13246', '7395', '4246', '1985', '2712', '9622', '686', '1997', '7102', '8023', '14480', '11997', '4146', '13656', '7813', '15936', '14996', '11294', '11421', '11741', '13984', '7928', '7215', '9120', '7111', '973', '14202', '4873', '7918', '2748', '2553', '4006', '1748', '14757', '6890', '9025', '4625', '15118', '6446', '11336', '2125', '5447', '14550', '10867', '14658', '15400', '11216', '348', '11006', '16024', '942', '3971', '15206', '3454', '1306', '6240', '7040', '1651', '14680', '5037', '7014', '14178', '118', '14046', '6745', '8507', '6161', '4366', '982', '13626', '14366', '9936', '2649', '7824', '15267', '4670', '14747', '2893', '2945']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('458', '2273', '2006-02-16T02:30:53', '2005-07-28T12:08:29', '2005-08-04T12:30:29', '1'), - ('458', '1993', '2006-02-16T02:30:53', '2005-08-18T23:26:11', '2005-08-19T20:31:11', '2'), - ('458', '3631', '2006-02-16T02:30:53', '2005-07-08T03:15:00', '2005-07-11T04:53:00', '1'), - ('458', '4250', '2006-02-16T02:30:53', '2005-08-02T09:26:16', '2005-08-11T07:50:16', '2'), - ('458', '4324', '2006-02-16T02:30:53', '2005-06-21T08:42:37', '2005-06-22T13:17:37', '1'), - ('458', '1251', '2006-02-16T02:30:53', '2005-08-20T05:05:14', '2005-08-25T03:59:14', '2'), - ('458', '3471', '2006-02-16T02:30:53', '2005-07-12T00:03:57', '2005-07-20T03:47:57', '1'), - ('458', '2518', '2006-02-16T02:30:53', '2005-08-19T17:08:53', '2005-08-23T14:14:53', '1'), - ('458', '1810', '2006-02-16T02:30:53', '2005-06-19T08:42:12', '2005-06-28T03:38:12', '2'), - ('458', '2709', '2006-02-16T02:30:53', '2005-07-10T03:49:00', '2005-07-14T01:25:00', '1'), - ('458', '4327', '2006-02-16T02:30:53', '2005-07-28T21:08:46', '2005-08-01T21:50:46', '2'), - ('458', '2609', '2006-02-16T02:30:53', '2005-08-20T01:27:05', '2005-08-24T00:41:05', '2'), - ('458', '4000', '2006-02-16T02:30:53', '2005-08-23T06:44:19', '2005-08-29T07:17:19', '1'), - ('411', '1960', '2006-02-16T02:30:53', '2005-07-06T20:52:09', '2005-07-08T18:51:09', '1'), - ('411', '394', '2006-02-16T02:30:53', '2005-07-29T13:30:58', '2005-08-05T16:21:58', '2'), - ('411', '2466', '2006-02-16T02:30:53', '2005-07-10T14:58:36', '2005-07-11T19:50:36', '2'), - ('411', '850', '2006-02-16T02:30:53', '2005-08-20T07:16:45', '2005-08-22T03:38:45', '1'), - ('411', '1988', '2006-02-16T02:30:53', '2005-07-09T18:08:59', '2005-07-16T17:28:59', '2'), - ('411', '4047', '2006-02-16T02:30:53', '2005-08-21T23:50:39', '2005-08-30T20:44:39', '2'), - ('411', '2', '2006-02-16T02:30:53', '2005-05-30T20:21:07', '2005-06-06T00:36:07', '1'), - ('411', '939', '2006-02-16T02:30:53', '2005-07-27T20:51:04', '2005-08-03T20:15:04', '2'), - ('411', '1849', '2006-02-16T02:30:53', '2006-02-14T15:16:03', NULL, '2'), - ('411', '2888', '2006-02-16T02:30:53', '2005-07-27T16:03:11', '2005-07-31T20:26:11', '2'), - ('411', '1141', '2006-02-16T02:30:53', '2005-07-07T13:49:03', '2005-07-09T13:01:03', '1'), - ('411', '87', '2006-02-16T02:30:53', '2005-06-17T10:31:37', '2005-06-22T11:17:37', '1'), - ('411', '3132', '2006-02-16T02:30:53', '2005-06-19T14:20:13', '2005-06-22T19:08:13', '1'), - ('411', '2255', '2006-02-16T02:30:53', '2005-07-31T04:21:45', '2005-08-02T09:20:45', '1'), - ('411', '2441', '2006-02-16T02:30:53', '2005-05-29T00:27:10', '2005-05-30T02:29:10', '1'), - ('411', '846', '2006-02-16T02:30:53', '2005-06-17T11:19:43', '2005-06-19T14:18:43', '1'), - ('411', '1081', '2006-02-16T02:30:53', '2005-07-27T05:07:21', '2005-08-01T09:41:21', '2'), - ('411', '2133', '2006-02-16T02:30:53', '2005-07-28T15:53:29', '2005-07-31T12:26:29', '1'), - ('411', '229', '2006-02-16T02:30:53', '2005-08-21T13:36:40', '2005-08-26T08:39:40', '1'), - ('411', '2193', '2006-02-16T02:30:53', '2005-08-17T18:34:38', '2005-08-26T00:12:38', '2'), - ('411', '176', '2006-02-16T02:30:53', '2005-07-07T08:30:16', '2005-07-12T07:52:16', '1'), - ('411', '3180', '2006-02-16T02:30:53', '2005-08-20T08:01:07', '2005-08-28T13:16:07', '2'), - ('411', '4216', '2006-02-16T02:30:53', '2005-07-28T08:08:27', '2005-07-30T03:08:27', '2'), - ('411', '1293', '2006-02-16T02:30:53', '2005-08-23T18:43:11', '2005-08-26T00:19:11', '1'), - ('411', '1178', '2006-02-16T02:30:53', '2005-08-22T07:52:41', '2005-08-29T02:35:41', '1'), - ('411', '855', '2006-02-16T02:30:53', '2005-08-02T15:08:27', '2005-08-03T18:28:27', '1'), - ('473', '3361', '2006-02-16T02:30:53', '2005-08-02T19:51:53', '2005-08-12T00:50:53', '2'), - ('473', '1819', '2006-02-16T02:30:53', '2005-08-17T08:48:39', '2005-08-20T07:37:39', '1'), - ('473', '2183', '2006-02-16T02:30:53', '2005-08-20T19:12:30', '2005-08-29T22:04:30', '1'), - ('473', '912', '2006-02-16T02:30:53', '2005-07-28T12:15:51', '2005-08-05T06:34:51', '1'), - ('473', '2713', '2006-02-16T02:30:53', '2005-07-27T09:24:00', '2005-08-05T07:37:00', '2'), - ('473', '139', '2006-02-16T02:30:53', '2005-07-30T09:26:08', '2005-08-08T09:52:08', '1'), - ('473', '1252', '2006-02-16T02:30:53', '2005-07-27T05:38:16', '2005-07-29T04:28:16', '2'), - ('473', '1914', '2006-02-16T02:30:53', '2005-05-30T20:27:45', '2005-06-08T22:47:45', '2'), - ('473', '1995', '2006-02-16T02:30:53', '2005-08-21T03:51:52', '2005-08-22T09:35:52', '1'), - ('473', '4500', '2006-02-16T02:30:53', '2005-07-08T19:23:32', '2005-07-11T15:24:32', '1'), - ('473', '63', '2006-02-16T02:30:53', '2005-07-28T11:58:53', '2005-08-04T12:08:53', '2'), - ('473', '511', '2006-02-16T02:30:53', '2005-06-19T16:22:26', '2005-06-21T21:55:26', '1'), - ('473', '923', '2006-02-16T02:30:53', '2005-06-19T03:04:59', '2005-06-26T02:36:59', '2'), - ('473', '397', '2006-02-16T02:30:53', '2005-07-07T00:25:29', '2005-07-08T05:30:29', '2'), - ('473', '2434', '2006-02-16T02:30:53', '2005-06-16T16:54:03', '2005-06-18T20:11:03', '1'), - ('473', '1154', '2006-02-16T02:30:53', '2005-08-21T23:23:37', '2005-08-26T23:24:37', '2'), - ('473', '2538', '2006-02-16T02:30:53', '2005-07-12T21:03:03', '2005-07-14T00:47:03', '1'), - ('473', '2244', '2006-02-16T02:30:53', '2005-07-30T05:50:08', '2005-07-31T09:58:08', '1'), - ('473', '318', '2006-02-16T02:30:53', '2005-07-08T08:14:26', '2005-07-09T03:45:26', '1'), - ('473', '2081', '2006-02-16T02:30:53', '2005-08-22T12:38:37', '2005-08-29T14:01:37', '2'), - ('473', '3634', '2006-02-16T02:30:53', '2005-07-12T00:44:08', '2005-07-14T20:39:08', '2'), - ('473', '1949', '2006-02-16T02:30:53', '2005-08-02T16:58:56', '2005-08-06T16:56:56', '1'), - ('473', '4303', '2006-02-16T02:30:53', '2005-06-17T20:53:42', '2005-06-19T01:53:42', '2'), - ('473', '2530', '2006-02-16T02:30:53', '2005-07-09T22:09:28', '2005-07-18T20:03:28', '2'), - ('473', '2814', '2006-02-16T02:30:53', '2005-08-21T15:56:39', '2005-08-23T21:40:39', '1'), - ('473', '2577', '2006-02-16T02:30:53', '2005-08-02T00:24:15', '2005-08-05T21:09:15', '1'), - ('473', '1465', '2006-02-16T02:30:53', '2005-08-21T19:41:50', '2005-08-25T16:11:50', '1'), - ('473', '2664', '2006-02-16T02:30:53', '2005-08-22T23:13:03', '2005-08-28T18:34:03', '1'), - ('473', '1109', '2006-02-16T02:30:53', '2005-08-02T12:23:43', '2005-08-03T13:19:43', '1'), - ('473', '1825', '2006-02-16T02:30:53', '2005-05-27T04:50:56', '2005-06-01T04:43:56', '1'), - ('473', '2776', '2006-02-16T02:30:53', '2005-08-02T05:05:52', '2005-08-05T03:33:52', '1'), - ('473', '2910', '2006-02-16T02:30:53', '2005-08-23T21:46:47', '2005-08-27T02:06:47', '1'), - ('473', '4279', '2006-02-16T02:30:53', '2005-05-30T15:05:47', '2005-06-08T15:59:47', '2'), - ('473', '4415', '2006-02-16T02:30:53', '2005-07-06T22:50:40', '2005-07-08T01:02:40', '1'), - ('524', '3901', '2006-02-16T02:30:53', '2005-08-22T16:33:39', '2005-08-31T11:41:39', '1'), - ('524', '3009', '2006-02-16T02:30:53', '2005-06-21T21:12:13', '2005-06-25T23:23:13', '1'), - ('524', '2132', '2006-02-16T02:30:53', '2005-06-15T09:59:24', '2005-06-19T09:37:24', '2'), - ('524', '640', '2006-02-16T02:30:53', '2005-07-11T14:32:41', '2005-07-20T18:38:41', '1'), - ('524', '470', '2006-02-16T02:30:53', '2005-07-27T03:17:19', '2005-07-29T07:03:19', '2'), - ('524', '4444', '2006-02-16T02:30:53', '2005-06-16T09:24:38', '2005-06-17T09:50:38', '2'), - ('524', '4469', '2006-02-16T02:30:53', '2005-08-21T20:19:52', '2005-08-28T17:10:52', '1'), - ('524', '435', '2006-02-16T02:30:53', '2005-07-09T02:59:10', '2005-07-15T07:54:10', '2'), - ('524', '714', '2006-02-16T02:30:53', '2005-07-27T02:14:40', '2005-08-03T00:32:40', '2'), - ('524', '2178', '2006-02-16T02:30:53', '2005-08-21T03:13:45', '2005-08-22T01:50:45', '1'), - ('524', '872', '2006-02-16T02:30:53', '2005-05-25T19:31:18', '2005-05-31T15:00:18', '1'), - ('524', '2352', '2006-02-16T02:30:53', '2005-08-20T21:53:21', '2005-08-23T17:51:21', '2'), - ('524', '1331', '2006-02-16T02:30:53', '2005-07-12T14:30:51', '2005-07-13T13:42:51', '2'), - ('524', '3273', '2006-02-16T02:30:53', '2005-07-29T09:29:44', '2005-08-07T05:48:44', '2'), - ('524', '3681', '2006-02-16T02:30:53', '2005-07-11T10:11:54', '2005-07-15T12:12:54', '2'), - ('524', '2961', '2006-02-16T02:30:53', '2005-07-07T19:48:36', '2005-07-14T01:14:36', '1'), - ('524', '3560', '2006-02-16T02:30:53', '2005-05-30T22:15:24', '2005-06-02T16:18:24', '1'), - ('524', '594', '2006-02-16T02:30:53', '2005-08-20T06:55:24', '2005-08-29T12:32:24', '1'), - ('524', '4011', '2006-02-16T02:30:53', '2005-08-21T09:31:39', '2005-08-26T11:55:39', '2'), - ('153', '979', '2006-02-16T02:30:53', '2005-07-31T15:27:41', '2005-08-06T16:25:41', '1'), - ('153', '98', '2006-02-16T02:30:53', '2005-06-19T10:20:09', '2005-06-21T10:05:09', '1'), - ('153', '2241', '2006-02-16T02:30:53', '2005-07-28T08:34:47', '2005-08-05T09:43:47', '2'), - ('153', '2966', '2006-02-16T02:30:53', '2005-08-22T18:37:48', '2005-08-24T00:22:48', '1'), - ('153', '3317', '2006-02-16T02:30:53', '2005-07-08T10:14:18', '2005-07-16T15:10:18', '2'), - ('153', '201', '2006-02-16T02:30:53', '2005-08-21T23:00:02', '2005-08-26T18:58:02', '2'), - ('153', '397', '2006-02-16T02:30:53', '2005-06-20T02:22:08', '2005-06-26T21:01:08', '2'), - ('153', '4193', '2006-02-16T02:30:53', '2005-06-20T05:49:27', '2005-06-26T09:48:27', '1') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - v_old_ids_rental := ARRAY['6818', '3949', '15593', '14944', '12439', '12103', '12882', '4194', '10015', '5676', '14664', '15444', '3795', '11368', '5771', '2224', '6018', '8538', '15584', '2996', '2526', '610', '15853', '3926', '8925', '1388', '389', '4561', '12639', '4790', '6801', '7925', '7857', '13628', '112', '11218', '9290', '14964', '1375', '2189', '10947', '6187', '12813', '14407']; - WITH inserted AS ( - INSERT INTO "public"."rental" ("customer_id", "inventory_id", "last_update", "rental_date", "return_date", "staff_id") - SELECT - map0.new_id::smallint, - map1.new_id::integer, - data.last_update::timestamp without time zone, - data.rental_date::timestamp without time zone, - data.return_date::timestamp without time zone, - map2.new_id::smallint - FROM (VALUES - ('153', '1013', '2006-02-16T02:30:53', '2005-07-12T18:20:54', '2005-07-21T00:03:54', '2'), - ('153', '1765', '2006-02-16T02:30:53', '2005-07-06T21:46:36', '2005-07-11T03:18:36', '1'), - ('153', '3734', '2006-02-16T02:30:53', '2005-08-23T06:15:09', '2005-08-27T07:47:09', '2'), - ('153', '535', '2006-02-16T02:30:53', '2005-08-22T06:01:26', '2005-08-24T10:33:26', '2'), - ('153', '3204', '2006-02-16T02:30:53', '2005-08-18T10:44:57', '2005-08-22T06:51:57', '1'), - ('153', '4363', '2006-02-16T02:30:53', '2005-08-17T22:49:09', '2005-08-24T21:53:09', '1'), - ('153', '911', '2006-02-16T02:30:53', '2005-08-19T03:33:46', '2005-08-21T22:49:46', '1'), - ('153', '1753', '2006-02-16T02:30:53', '2005-07-07T10:59:39', '2005-07-15T09:34:39', '1'), - ('153', '67', '2006-02-16T02:30:53', '2005-07-31T18:11:17', '2005-08-03T15:48:17', '2'), - ('153', '3595', '2006-02-16T02:30:53', '2005-07-10T08:38:32', '2005-07-13T10:11:32', '1'), - ('153', '4377', '2006-02-16T02:30:53', '2005-08-21T19:48:47', '2005-08-27T16:47:47', '1'), - ('153', '959', '2006-02-16T02:30:53', '2005-08-23T00:46:52', '2005-08-29T20:37:52', '2'), - ('153', '240', '2006-02-16T02:30:53', '2005-07-06T14:37:41', '2005-07-11T20:27:41', '2'), - ('153', '866', '2006-02-16T02:30:53', '2005-08-02T18:03:05', '2005-08-07T20:40:05', '1'), - ('153', '3275', '2006-02-16T02:30:53', '2005-07-10T13:26:45', '2005-07-14T15:43:45', '1'), - ('153', '1336', '2006-02-16T02:30:53', '2005-06-18T03:33:58', '2005-06-18T22:10:58', '1'), - ('500', '4555', '2006-02-16T02:30:53', '2005-07-11T02:06:36', '2005-07-12T02:16:36', '2'), - ('500', '3768', '2006-02-16T02:30:53', '2005-07-29T10:45:17', '2005-08-04T15:12:17', '1'), - ('500', '3526', '2006-02-16T02:30:53', '2005-08-23T05:49:21', '2005-08-27T04:49:21', '1'), - ('500', '4064', '2006-02-16T02:30:53', '2005-06-20T09:20:29', '2005-06-27T09:18:29', '1'), - ('500', '3309', '2006-02-16T02:30:53', '2005-06-19T01:03:07', '2005-06-28T06:57:07', '1'), - ('500', '3642', '2006-02-16T02:30:53', '2005-05-28T15:15:25', '2005-06-02T12:30:25', '2'), - ('500', '225', '2006-02-16T02:30:53', '2005-08-23T15:54:20', '2005-08-24T18:53:20', '2'), - ('500', '4241', '2006-02-16T02:30:53', '2005-07-06T20:42:35', '2005-07-09T16:30:35', '2'), - ('500', '3753', '2006-02-16T02:30:53', '2005-07-30T02:09:14', '2005-07-30T21:39:14', '1'), - ('500', '3987', '2006-02-16T02:30:53', '2005-06-15T15:48:41', '2005-06-22T17:51:41', '1'), - ('500', '691', '2006-02-16T02:30:53', '2005-05-27T10:45:41', '2005-06-05T06:22:41', '2'), - ('500', '1643', '2006-02-16T02:30:53', '2005-07-08T05:02:43', '2005-07-11T04:56:43', '1'), - ('500', '562', '2006-02-16T02:30:53', '2005-08-18T18:13:05', '2005-08-27T16:00:05', '2'), - ('500', '100', '2006-02-16T02:30:53', '2005-07-08T16:25:27', '2005-07-11T11:35:27', '1'), - ('500', '872', '2006-02-16T02:30:53', '2005-07-12T17:09:08', '2005-07-21T22:25:08', '1'), - ('500', '1763', '2006-02-16T02:30:53', '2005-07-28T12:10:02', '2005-08-02T15:50:02', '1'), - ('500', '4027', '2006-02-16T02:30:53', '2005-07-28T09:49:40', '2005-08-01T05:34:40', '2'), - ('500', '1006', '2006-02-16T02:30:53', '2005-08-20T07:03:53', '2005-08-22T11:27:53', '2'), - ('500', '2153', '2006-02-16T02:30:53', '2005-05-25T18:57:24', '2005-06-02T20:44:24', '1'), - ('500', '1126', '2006-02-16T02:30:53', '2005-08-02T12:29:12', '2005-08-10T16:13:12', '2'), - ('500', '2275', '2006-02-16T02:30:53', '2005-07-30T15:59:08', '2005-08-06T21:49:08', '2'), - ('500', '2302', '2006-02-16T02:30:53', '2005-08-22T06:39:24', '2005-08-26T06:05:24', '1'), - ('500', '3555', '2006-02-16T02:30:53', '2005-06-15T14:54:56', '2005-06-21T14:48:56', '2'), - ('500', '249', '2006-02-16T02:30:53', '2005-06-18T01:20:26', '2005-06-25T00:30:26', '1'), - ('500', '2510', '2006-02-16T02:30:53', '2005-08-02T03:23:17', '2005-08-07T05:25:17', '1'), - ('500', '3344', '2006-02-16T02:30:53', '2005-07-11T11:28:51', '2005-07-12T15:44:51', '1'), - ('500', '3285', '2006-02-16T02:30:53', '2005-08-19T00:54:22', '2005-08-19T21:17:22', '2'), - ('500', '2403', '2006-02-16T02:30:53', '2005-08-21T10:46:51', '2005-08-25T09:28:51', '2') - ) AS data(old_customer_id, old_inventory_id, last_update, rental_date, return_date, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."inventory"' - AND map1.old_id = data.old_inventory_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING rental_id - ) - SELECT array_agg(rental_id) INTO v_new_ids_rental FROM inserted; - - FOR i IN 1..array_length(v_new_ids_rental, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."rental"', v_old_ids_rental[i], v_new_ids_rental[i]::TEXT); - END LOOP; - - -- Table: "public"."store" (2 records) - v_old_ids_store := ARRAY['1', '2']; - WITH inserted AS ( - INSERT INTO "public"."store" ("address_id", "last_update", "manager_staff_id") - SELECT - map0.new_id::smallint, - data.last_update::timestamp without time zone, - map1.new_id::smallint - FROM (VALUES - ('1', '2006-02-15T09:57:12', '1'), - ('2', '2006-02-15T09:57:12', '2') - ) AS data(old_address_id, last_update, old_manager_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."address"' - AND map0.old_id = data.old_address_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."staff"' - AND map1.old_id = data.old_manager_staff_id - RETURNING store_id - ) - SELECT array_agg(store_id) INTO v_new_ids_store FROM inserted; - - FOR i IN 1..array_length(v_new_ids_store, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."store"', v_old_ids_store[i], v_new_ids_store[i]::TEXT); - END LOOP; - - -- Table: "public"."payment" (14596 records) - v_old_ids_payment := ARRAY['24185', '26093', '30616', '22080', '22538', '27559', '23294', '31098', '20859', '21980', '29246', '27969', '30203', '30266', '29829', '22216', '26027', '29077', '25766', '31671', '28492', '25238', '21779', '28107', '18850', '19890', '21199', '27838', '29007', '21703', '31554', '31238', '25887', '19731', '29722', '29060', '24031', '23076', '24004', '19995', '19134', '28456', '30633', '17641', '23678', '30640', '26840', '22283', '17512', '26867', '24123', '30210', '24735', '31066', '24964', '29325', '19954', '24329', '19294', '20193', '18916', '19023', '26335', '23655', '29397', '28891', '28732', '18584', '28667', '19618', '24127', '31216', '29323', '17553', '31217', '28445', '26234', '22771', '22010', '20228', '29831', '25807', '24999', '29974', '30614', '25313', '23403', '21975', '31503', '22571', '28386', '18167', '19236', '27776', '27181', '17942', '22076', '21989', '22509', '28094']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('2.99', '156', '2007-03-20T01:54:36.996577', '13531', '2'), - ('2.99', '348', '2007-04-27T14:05:27.996577', '7380', '2'), - ('0.99', '143', '2007-04-29T02:01:04.996577', '8312', '1'), - ('2.99', '537', '2007-03-22T12:36:32.996577', '15149', '1'), - ('4.99', '589', '2007-03-17T16:38:44.996577', '11980', '1'), - ('2.99', '480', '2007-04-11T10:06:18.996577', '6191', '1'), - ('2.99', '63', '2007-03-22T15:58:51.996577', '15229', '1'), - ('7.99', '185', '2007-04-08T15:57:13.996577', '4822', '2'), - ('1.99', '408', '2007-03-23T09:30:26.996577', '15716', '2'), - ('6.99', '527', '2007-03-18T12:00:11.996577', '12513', '1'), - ('2.99', '25', '2007-04-07T13:54:57.996577', '4282', '1'), - ('4.99', '517', '2007-04-07T05:08:09.996577', '4109', '1'), - ('3.99', '107', '2007-04-10T13:13:35.996577', '5798', '2'), - ('4.99', '113', '2007-04-10T05:59:32.996577', '5655', '2'), - ('2.99', '75', '2007-04-28T09:30:17.996577', '7897', '2'), - ('4.99', '553', '2007-03-22T08:16:03.996577', '15042', '1'), - ('7.99', '343', '2007-04-07T22:50:32.996577', '4472', '1'), - ('3.99', '8', '2007-04-08T00:45:38.996577', '4503', '1'), - ('3.99', '320', '2007-04-27T02:21:55.996577', '7064', '2'), - ('2.99', '243', '2007-04-30T04:44:33.996577', '9035', '2'), - ('0.99', '565', '2007-04-12T11:13:47.996577', '6699', '1'), - ('2.99', '275', '2007-04-27T20:40:02.996577', '7553', '1'), - ('4.99', '504', '2007-03-23T20:12:53.996577', '16022', '2'), - ('0.99', '528', '2007-04-06T06:44:23.996577', '3664', '1'), - ('4.99', '89', '2007-02-17T06:35:19.996577', '1948', '1'), - ('3.99', '305', '2007-03-18T14:46:16.996577', '12592', '2'), - ('4.99', '444', '2007-03-23T13:24:13.996577', '15815', '2'), - ('6.99', '504', '2007-04-06T09:17:56.996577', '3713', '1'), - ('4.99', '2', '2007-04-27T12:59:08.996577', '7346', '2'), - ('2.99', '497', '2007-03-19T16:59:56.996577', '13289', '1'), - ('5.99', '234', '2007-04-30T20:23:33.996577', '10133', '2'), - ('4.99', '199', '2007-04-28T05:42:06.996577', '7782', '1'), - ('2.99', '331', '2007-04-09T07:03:10.996577', '5152', '1'), - ('1.99', '288', '2007-03-17T22:18:09.996577', '12134', '1'), - ('4.99', '66', '2007-04-07T05:06:57.996577', '4108', '1'), - ('2.99', '6', '2007-04-27T05:06:51.996577', '7136', '2'), - ('1.99', '142', '2007-03-23T00:15:01.996577', '15477', '1'), - ('6.99', '40', '2007-03-19T11:35:38.996577', '13149', '1'), - ('2.99', '140', '2007-03-23T14:15:28.996577', '15852', '1'), - ('5.99', '317', '2007-03-20T19:55:21.996577', '14032', '1'), - ('8.99', '164', '2007-02-20T14:00:37.996577', '3082', '1'), - ('3.99', '562', '2007-04-27T06:05:22.996577', '7166', '2'), - ('0.99', '144', '2007-04-30T02:59:34.996577', '8983', '1'), - ('0.99', '377', '2007-02-20T14:11:06.996577', '3086', '2'), - ('6.99', '107', '2007-03-20T00:46:56.996577', '13510', '1'), - ('4.99', '145', '2007-04-07T18:15:17.996577', '4364', '1'), - ('0.99', '414', '2007-04-27T00:14:10.996577', '7009', '1'), - ('2.99', '560', '2007-03-21T22:53:03.996577', '14785', '2'), - ('4.99', '343', '2007-02-16T00:10:50.996577', '1547', '2'), - ('2.99', '417', '2007-04-07T20:33:56.996577', '4418', '1'), - ('1.99', '150', '2007-03-19T02:07:20.996577', '12887', '1'), - ('4.99', '107', '2007-04-28T19:40:12.996577', '8162', '1'), - ('4.99', '220', '2007-03-19T02:21:10.996577', '12896', '1'), - ('2.99', '182', '2007-04-07T08:28:15.996577', '4174', '1'), - ('4.99', '247', '2007-03-18T02:50:27.996577', '12265', '2'), - ('0.99', '30', '2007-04-30T04:02:14.996577', '9641', '1'), - ('2.99', '312', '2007-03-21T07:48:15.996577', '14362', '2'), - ('0.99', '172', '2007-03-01T13:38:52.996577', '10621', '2'), - ('0.99', '210', '2007-02-19T21:41:30.996577', '2856', '2'), - ('2.99', '340', '2007-03-19T04:06:55.996577', '12940', '2'), - ('0.99', '107', '2007-02-20T16:47:55.996577', '3120', '2'), - ('0.99', '134', '2007-02-17T01:38:22.996577', '1881', '2'), - ('5.99', '368', '2007-04-30T18:44:24.996577', '9400', '1'), - ('4.99', '104', '2007-03-19T12:28:19.996577', '13179', '1'), - ('2.99', '36', '2007-04-30T17:20:45.996577', '9369', '1'), - ('5.99', '598', '2007-04-10T07:44:34.996577', '5688', '2'), - ('4.99', '585', '2007-04-08T04:30:22.996577', '4579', '2'), - ('2.99', '24', '2007-02-17T14:56:17.996577', '2070', '1'), - ('4.99', '579', '2007-04-30T16:05:56.996577', '9997', '2'), - ('2.99', '275', '2007-03-22T17:08:10.996577', '15269', '2'), - ('2.99', '150', '2007-03-19T19:51:45.996577', '13372', '1'), - ('2.99', '198', '2007-04-06T11:42:54.996577', '3770', '2'), - ('2.99', '30', '2007-04-30T15:24:19.996577', '9309', '2'), - ('2.99', '353', '2007-02-15T11:58:56.996577', '1359', '2'), - ('2.99', '198', '2007-04-08T04:46:27.996577', '4588', '2'), - ('0.99', '561', '2007-04-11T22:44:45.996577', '6435', '1'), - ('2.99', '360', '2007-04-30T02:58:28.996577', '9623', '1'), - ('4.99', '9', '2007-03-18T17:17:24.996577', '12652', '2'), - ('0.99', '530', '2007-03-22T09:17:32.996577', '15066', '2'), - ('2.99', '343', '2007-03-17T00:02:58.996577', '11570', '2'), - ('6.99', '75', '2007-04-29T20:50:38.996577', '8823', '1'), - ('2.99', '323', '2007-04-30T17:12:49.996577', '9363', '1'), - ('2.99', '252', '2007-03-01T21:56:26.996577', '10834', '2'), - ('0.99', '89', '2007-04-07T23:50:49.996577', '4488', '1'), - ('6.99', '143', '2007-04-11T03:33:56.996577', '6076', '2'), - ('1.99', '282', '2007-04-29T06:54:30.996577', '8468', '2'), - ('4.99', '75', '2007-03-01T22:55:50.996577', '10871', '1'), - ('0.99', '527', '2007-03-01T13:24:40.996577', '10613', '2'), - ('2.99', '230', '2007-04-09T12:51:31.996577', '5269', '2'), - ('4.99', '593', '2007-03-02T00:11:28.996577', '10904', '2'), - ('2.99', '556', '2007-04-08T11:01:26.996577', '4719', '2'), - ('4.99', '515', '2007-02-15T03:37:06.996577', '1244', '1'), - ('4.99', '190', '2007-02-17T14:00:24.996577', '2057', '1'), - ('4.99', '498', '2007-04-28T14:11:58.996577', '8020', '2'), - ('3.99', '444', '2007-04-28T01:27:05.996577', '7679', '2'), - ('5.99', '454', '2007-02-17T23:24:44.996577', '2182', '2'), - ('4.99', '537', '2007-03-20T14:00:35.996577', '13885', '2'), - ('2.99', '528', '2007-03-21T00:46:15.996577', '14148', '2'), - ('4.99', '585', '2007-03-23T12:57:42.996577', '15804', '1'), - ('6.99', '526', '2007-04-30T01:21:59.996577', '9577', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['21404', '24411', '27385', '17745', '18430', '30065', '27930', '17739', '22721', '25612', '21608', '18788', '27455', '22733', '25585', '21403', '28239', '18011', '24754', '21707', '28824', '27027', '19604', '20380', '22238', '22432', '28163', '23087', '23173', '18107', '21339', '23818', '21841', '20095', '18332', '27326', '27689', '18449', '23996', '19922', '18708', '26896', '29095', '28098', '19051', '22814', '19182', '25804', '24040', '23747', '27179', '24386', '22867', '26860', '26732', '28437', '23918', '23031', '22054', '27437', '31047', '27580', '28664', '31392', '30393', '29714', '30256', '20366', '22540', '23685', '31103', '31864', '24049', '18825', '20002', '21587', '27583', '27837', '20191', '25418', '26871', '29719', '23993', '23147', '18830', '22920', '28249', '28419', '23821', '20167', '18350', '18712', '29567', '30261', '22695', '30949', '23705', '23717', '30339', '19062']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('3.99', '465', '2007-03-01T11:00:49.996577', '10542', '1'), - ('5.99', '180', '2007-03-01T12:14:28.996577', '10576', '1'), - ('4.99', '464', '2007-04-10T19:20:00.996577', '5910', '1'), - ('2.99', '402', '2007-02-20T02:10:53.996577', '2913', '2'), - ('8.99', '589', '2007-02-19T09:03:52.996577', '2652', '2'), - ('4.99', '96', '2007-04-28T18:00:14.996577', '8125', '2'), - ('0.99', '512', '2007-04-27T19:00:14.996577', '7507', '1'), - ('5.99', '399', '2007-02-20T10:46:57.996577', '3036', '1'), - ('0.99', '5', '2007-03-01T13:55:36.996577', '10625', '1'), - ('1.99', '306', '2007-04-08T05:09:51.996577', '4596', '2'), - ('4.99', '486', '2007-03-02T00:04:12.996577', '10902', '2'), - ('6.99', '75', '2007-02-20T12:18:26.996577', '3062', '2'), - ('8.99', '470', '2007-04-29T07:07:38.996577', '8476', '2'), - ('2.99', '6', '2007-03-01T01:42:05.996577', '10271', '1'), - ('6.99', '303', '2007-04-29T16:56:41.996577', '8734', '2'), - ('4.99', '464', '2007-03-23T18:42:04.996577', '15983', '1'), - ('4.99', '539', '2007-04-09T04:08:30.996577', '5086', '2'), - ('7.99', '470', '2007-02-16T03:43:38.996577', '1594', '2'), - ('5.99', '223', '2007-03-19T03:31:12.996577', '12927', '1'), - ('0.99', '497', '2007-03-23T16:29:57.996577', '15919', '1'), - ('0.99', '592', '2007-04-29T18:24:00.996577', '8773', '2'), - ('4.99', '432', '2007-04-08T22:26:44.996577', '4973', '1'), - ('6.99', '275', '2007-03-01T08:39:51.996577', '10479', '1'), - ('4.99', '360', '2007-03-21T19:22:06.996577', '14700', '1'), - ('4.99', '555', '2007-03-19T02:02:13.996577', '12883', '1'), - ('4.99', '577', '2007-03-01T03:13:24.996577', '10323', '2'), - ('3.99', '532', '2007-04-12T12:26:51.996577', '6730', '1'), - ('7.99', '41', '2007-03-21T13:58:13.996577', '14539', '2'), - ('2.99', '51', '2007-03-20T13:51:52.996577', '13882', '2'), - ('0.99', '498', '2007-02-20T15:05:27.996577', '3098', '1'), - ('4.99', '459', '2007-03-01T01:14:39.996577', '10255', '2'), - ('3.99', '122', '2007-03-02T04:33:53.996577', '11044', '2'), - ('4.99', '512', '2007-03-23T10:05:58.996577', '15733', '2'), - ('3.99', '330', '2007-03-02T12:14:56.996577', '11259', '2'), - ('4.99', '562', '2007-02-19T12:22:56.996577', '2705', '1'), - ('4.99', '459', '2007-04-27T23:43:02.996577', '7639', '2'), - ('2.99', '491', '2007-04-07T19:39:28.996577', '4392', '1'), - ('4.99', '593', '2007-02-19T19:50:19.996577', '2832', '1'), - ('3.99', '139', '2007-03-23T00:07:14.996577', '15471', '1'), - ('6.99', '308', '2007-03-19T00:20:16.996577', '12838', '2'), - ('0.99', '51', '2007-02-15T19:39:44.996577', '1477', '1'), - ('4.99', '420', '2007-04-07T08:32:00.996577', '4176', '1'), - ('4.99', '10', '2007-04-07T01:35:06.996577', '4042', '2'), - ('0.99', '527', '2007-04-09T16:55:26.996577', '5365', '1'), - ('3.99', '143', '2007-02-18T03:33:34.996577', '2251', '2'), - ('0.99', '14', '2007-03-23T20:53:52.996577', '16045', '1'), - ('2.99', '177', '2007-02-18T18:48:31.996577', '2467', '2'), - ('4.99', '323', '2007-04-28T11:06:48.996577', '7937', '2'), - ('5.99', '144', '2007-03-01T18:18:58.996577', '10740', '1'), - ('6.99', '115', '2007-03-22T13:58:51.996577', '15176', '1'), - ('2.99', '444', '2007-04-10T14:48:56.996577', '5825', '2'), - ('0.99', '177', '2007-03-21T06:12:58.996577', '14310', '2'), - ('0.99', '20', '2007-03-17T10:56:21.996577', '11821', '1'), - ('0.99', '416', '2007-04-28T09:11:47.996577', '7889', '1'), - ('0.99', '405', '2007-04-09T11:03:28.996577', '5231', '1'), - ('4.99', '560', '2007-04-27T07:28:46.996577', '7202', '2'), - ('6.99', '132', '2007-03-01T05:46:50.996577', '10400', '1'), - ('0.99', '36', '2007-03-02T02:16:43.996577', '10963', '1'), - ('8.99', '535', '2007-03-17T07:09:21.996577', '11736', '2'), - ('6.99', '469', '2007-04-27T09:57:37.996577', '7271', '2'), - ('2.99', '180', '2007-04-27T10:04:00.996577', '7274', '1'), - ('4.99', '482', '2007-04-09T15:28:39.996577', '5334', '1'), - ('9.99', '579', '2007-04-30T16:48:34.996577', '9349', '2'), - ('10.99', '220', '2007-04-30T20:48:55.996577', '9455', '2'), - ('0.99', '124', '2007-04-29T08:48:33.996577', '8524', '2'), - ('0.99', '65', '2007-04-12T02:51:32.996577', '6527', '2'), - ('4.99', '112', '2007-04-30T11:42:21.996577', '9217', '1'), - ('1.99', '359', '2007-03-21T04:25:02.996577', '14258', '1'), - ('8.99', '589', '2007-03-19T03:46:46.996577', '12933', '2'), - ('6.99', '108', '2007-03-18T16:04:45.996577', '12625', '2'), - ('2.99', '185', '2007-04-28T21:39:12.996577', '8200', '1'), - ('6.99', '262', '2007-04-30T07:18:51.996577', '9105', '1'), - ('6.99', '144', '2007-03-19T05:31:40.996577', '12980', '2'), - ('0.99', '84', '2007-02-17T12:59:28.996577', '2042', '2'), - ('0.99', '319', '2007-03-17T00:18:52.996577', '11575', '1'), - ('0.99', '483', '2007-03-01T15:53:01.996577', '10677', '2'), - ('2.99', '482', '2007-04-10T17:43:24.996577', '5880', '2'), - ('9.99', '504', '2007-04-06T09:16:01.996577', '3712', '2'), - ('4.99', '340', '2007-03-18T15:02:29.996577', '12598', '2'), - ('4.99', '290', '2007-04-29T12:58:57.996577', '8639', '1'), - ('2.99', '417', '2007-04-29T22:43:48.996577', '8877', '1'), - ('4.99', '66', '2007-04-06T02:02:14.996577', '3573', '1'), - ('2.99', '139', '2007-03-22T07:33:19.996577', '15029', '2'), - ('0.99', '49', '2007-03-01T01:34:25.996577', '10266', '1'), - ('4.99', '85', '2007-02-20T19:57:43.996577', '3165', '1'), - ('4.99', '24', '2007-03-22T19:57:25.996577', '15357', '2'), - ('4.99', '540', '2007-04-08T06:54:18.996577', '4628', '2'), - ('4.99', '559', '2007-04-07T05:35:29.996577', '4120', '1'), - ('4.99', '122', '2007-03-18T19:31:58.996577', '12711', '2'), - ('4.99', '338', '2007-03-02T05:23:43.996577', '11064', '2'), - ('4.99', '568', '2007-02-21T00:46:51.996577', '3227', '1'), - ('4.99', '52', '2007-02-20T22:30:54.996577', '3196', '2'), - ('9.99', '51', '2007-04-05T23:31:05.996577', '3525', '1'), - ('2.99', '112', '2007-04-30T17:17:38.996577', '10038', '1'), - ('2.99', '2', '2007-03-02T12:13:19.996577', '11256', '2'), - ('0.99', '172', '2007-04-11T20:24:06.996577', '6380', '1'), - ('2.99', '111', '2007-03-19T15:17:03.996577', '13251', '2'), - ('0.99', '112', '2007-03-21T07:42:54.996577', '14358', '1'), - ('0.99', '119', '2007-04-30T19:15:55.996577', '10101', '1'), - ('7.99', '146', '2007-02-15T00:59:38.996577', '1209', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['19102', '29729', '22768', '28705', '24119', '26245', '29712', '27724', '26312', '31506', '27658', '19015', '21298', '28740', '28949', '20004', '28361', '26239', '21351', '31672', '30330', '30577', '21272', '30299', '21294', '29050', '23291', '18914', '21654', '18923', '26836', '19624', '19061', '20108', '27232', '24804', '31667', '28360', '28246', '27553', '30874', '29319', '27664', '23679', '20463', '30507', '32005', '25233', '24684', '31007', '21398', '23795', '20466', '27706', '27573', '17927', '22470', '29676', '22753', '29387', '23817', '28778', '29987', '28090', '24442', '27375', '30606', '17937', '19211', '25456', '26443', '24642', '19370', '23837', '20791', '17999', '31896', '29261', '28830', '24272', '24275', '26939', '21203', '30623', '18126', '25808', '23348', '23681', '26927', '19662', '29388', '24269', '20459', '30323', '26959', '31325', '23819', '20983', '20071', '19878']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('7.99', '155', '2007-02-17T11:36:34.996577', '2028', '1'), - ('2.99', '66', '2007-04-26T23:40:39.996577', '6995', '1'), - ('0.99', '9', '2007-03-16T23:40:19.996577', '11556', '1'), - ('6.99', '582', '2007-04-29T18:42:51.996577', '8778', '1'), - ('6.99', '150', '2007-03-17T09:27:50.996577', '11789', '2'), - ('4.99', '361', '2007-04-30T20:51:03.996577', '10151', '1'), - ('3.99', '65', '2007-04-08T07:11:06.996577', '4635', '2'), - ('1.99', '494', '2007-04-28T03:43:29.996577', '7737', '2'), - ('6.99', '366', '2007-04-30T15:40:24.996577', '9316', '1'), - ('4.99', '230', '2007-04-27T12:27:37.996577', '7333', '2'), - ('6.99', '488', '2007-04-07T06:40:52.996577', '4133', '2'), - ('4.99', '132', '2007-02-20T02:48:40.996577', '2924', '2'), - ('2.99', '454', '2007-03-22T00:33:51.996577', '14843', '2'), - ('2.99', '585', '2007-04-29T03:20:36.996577', '8353', '2'), - ('7.99', '205', '2007-04-28T12:41:50.996577', '7976', '2'), - ('6.99', '319', '2007-03-17T15:50:01.996577', '11955', '1'), - ('4.99', '553', '2007-04-06T13:01:10.996577', '3793', '2'), - ('0.99', '361', '2007-04-12T20:43:00.996577', '6911', '2'), - ('1.99', '460', '2007-03-02T00:55:03.996577', '10926', '1'), - ('4.99', '243', '2007-04-30T22:58:10.996577', '9514', '2'), - ('8.99', '119', '2007-04-08T16:46:42.996577', '4840', '2'), - ('6.99', '139', '2007-04-12T01:26:05.996577', '6496', '1'), - ('4.99', '451', '2007-03-23T07:00:15.996577', '15651', '1'), - ('4.99', '115', '2007-04-27T17:18:56.996577', '7465', '2'), - ('2.99', '454', '2007-03-20T00:56:19.996577', '13513', '2'), - ('1.99', '5', '2007-04-30T02:42:54.996577', '8978', '1'), - ('8.99', '63', '2007-03-20T05:19:28.996577', '13624', '1'), - ('3.99', '107', '2007-02-20T01:02:49.996577', '2897', '2'), - ('0.99', '491', '2007-03-17T00:56:59.996577', '11590', '1'), - ('2.99', '109', '2007-02-16T02:57:11.996577', '1581', '2'), - ('3.99', '414', '2007-04-07T21:24:07.996577', '4437', '1'), - ('3.99', '276', '2007-03-17T15:56:27.996577', '11961', '2'), - ('0.99', '145', '2007-02-19T05:56:37.996577', '2614', '2'), - ('2.99', '331', '2007-03-23T01:59:17.996577', '15521', '1'), - ('8.99', '449', '2007-04-06T21:29:15.996577', '3977', '1'), - ('5.99', '230', '2007-03-16T23:32:55.996577', '11552', '1'), - ('2.99', '243', '2007-04-12T16:49:56.996577', '6820', '2'), - ('6.99', '553', '2007-04-05T22:18:30.996577', '3495', '1'), - ('0.99', '539', '2007-04-30T12:46:42.996577', '9250', '2'), - ('5.99', '479', '2007-04-30T16:44:29.996577', '9347', '1'), - ('4.99', '166', '2007-04-09T17:37:10.996577', '5380', '2'), - ('4.99', '30', '2007-04-28T14:41:19.996577', '8030', '1'), - ('0.99', '488', '2007-04-28T15:24:13.996577', '8050', '2'), - ('4.99', '107', '2007-03-21T14:51:25.996577', '14562', '1'), - ('0.99', '369', '2007-03-01T02:36:30.996577', '10299', '1'), - ('2.99', '133', '2007-04-30T08:40:18.996577', '9139', '2'), - ('0.99', '587', '2007-05-14T13:44:29.996577', '12144', '1'), - ('0.99', '275', '2007-04-07T19:42:45.996577', '4396', '2'), - ('0.99', '214', '2007-03-21T14:55:51.996577', '14567', '1'), - ('1.99', '177', '2007-04-28T01:22:56.996577', '7674', '2'), - ('1.99', '464', '2007-03-02T12:54:24.996577', '11275', '2'), - ('0.99', '120', '2007-03-02T07:44:11.996577', '11133', '2'), - ('4.99', '369', '2007-03-02T06:02:45.996577', '11084', '1'), - ('4.99', '493', '2007-04-06T02:53:08.996577', '3586', '2'), - ('7.99', '481', '2007-04-28T07:23:53.996577', '7836', '2'), - ('4.99', '452', '2007-02-15T00:37:28.996577', '1203', '2'), - ('2.99', '581', '2007-03-17T05:53:25.996577', '11707', '2'), - ('8.99', '63', '2007-04-06T19:02:36.996577', '3923', '2'), - ('2.99', '7', '2007-03-19T19:51:57.996577', '13373', '2'), - ('4.99', '36', '2007-04-08T03:27:14.996577', '4560', '2'), - ('1.99', '122', '2007-03-01T14:01:07.996577', '10626', '1'), - ('0.99', '589', '2007-04-27T09:12:35.996577', '7250', '2'), - ('2.99', '89', '2007-04-30T04:11:54.996577', '9646', '2'), - ('2.99', '526', '2007-04-28T09:05:46.996577', '7883', '2'), - ('6.99', '182', '2007-03-22T04:52:20.996577', '14953', '1'), - ('0.99', '463', '2007-04-11T15:54:21.996577', '6294', '2'), - ('2.99', '142', '2007-04-29T08:21:25.996577', '8513', '2'), - ('4.99', '454', '2007-02-16T07:43:24.996577', '1647', '2'), - ('4.99', '185', '2007-02-21T07:20:10.996577', '3325', '1'), - ('9.99', '293', '2007-04-11T22:38:07.996577', '6432', '1'), - ('8.99', '377', '2007-04-30T22:36:27.996577', '10183', '1'), - ('0.99', '210', '2007-03-23T07:37:44.996577', '15672', '2'), - ('2.99', '233', '2007-02-18T03:14:59.996577', '2244', '2'), - ('0.99', '124', '2007-03-23T20:13:28.996577', '16023', '2'), - ('4.99', '402', '2007-03-22T22:40:18.996577', '15428', '1'), - ('9.99', '467', '2007-02-19T22:46:12.996577', '2870', '2'), - ('4.99', '265', '2007-04-11T03:09:35.996577', '6068', '1'), - ('0.99', '26', '2007-04-07T19:57:12.996577', '4402', '2'), - ('3.99', '593', '2007-04-07T13:37:57.996577', '4280', '2'), - ('7.99', '166', '2007-03-20T14:35:19.996577', '13901', '2'), - ('5.99', '166', '2007-03-22T15:17:28.996577', '15213', '1'), - ('2.99', '423', '2007-04-30T04:23:57.996577', '9026', '2'), - ('7.99', '445', '2007-03-02T16:50:31.996577', '11383', '1'), - ('8.99', '144', '2007-04-09T17:20:34.996577', '5374', '2'), - ('1.99', '504', '2007-02-19T13:20:21.996577', '2720', '1'), - ('4.99', '323', '2007-04-30T16:16:42.996577', '10002', '2'), - ('9.99', '70', '2007-03-02T12:52:34.996577', '11274', '1'), - ('5.99', '108', '2007-03-02T14:36:15.996577', '11316', '1'), - ('0.99', '423', '2007-04-07T04:59:26.996577', '4105', '2'), - ('2.99', '279', '2007-03-19T14:43:07.996577', '13233', '1'), - ('4.99', '36', '2007-04-08T13:23:08.996577', '4762', '2'), - ('4.99', '166', '2007-03-18T18:19:09.996577', '12683', '2'), - ('1.99', '368', '2007-03-20T16:48:44.996577', '13963', '2'), - ('2.99', '118', '2007-04-27T07:17:34.996577', '7196', '1'), - ('8.99', '425', '2007-04-07T23:31:38.996577', '4483', '2'), - ('4.99', '213', '2007-04-29T09:30:16.996577', '8542', '2'), - ('2.99', '122', '2007-03-02T10:13:33.996577', '11197', '2'), - ('10.99', '420', '2007-03-01T12:54:06.996577', '10601', '2'), - ('5.99', '327', '2007-03-23T13:44:58.996577', '15828', '1'), - ('0.99', '304', '2007-03-01T14:03:40.996577', '10631', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['30492', '19360', '23607', '24691', '18014', '24579', '23274', '20934', '23352', '20244', '29206', '19765', '18746', '20008', '27461', '21276', '29251', '23082', '25266', '19893', '18408', '19138', '20931', '31149', '20764', '25334', '25841', '18829', '22251', '20457', '23501', '28489', '31974', '21243', '23779', '27768', '24732', '25619', '21558', '27659', '17757', '22440', '22295', '18857', '17549', '26006', '22419', '27439', '28614', '29574', '25214', '30953', '23085', '25421', '21393', '30209', '22874', '30798', '30852', '18485', '29386', '26935', '18415', '23743', '20788', '19873', '18651', '20000', '29956', '23631', '26678', '25785', '31991', '23703', '27763', '26668', '19298', '20098', '21207', '21802', '29071', '23025', '17960', '27476', '21840', '29129', '25312', '22009', '19617', '22457', '31147', '22060', '29954', '30121', '31502', '24578', '18254', '22752', '29153', '28545']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('1.99', '132', '2007-04-10T09:16:29.996577', '5715', '2'), - ('3.99', '230', '2007-02-15T19:16:48.996577', '1468', '2'), - ('2.99', '98', '2007-03-02T00:53:04.996577', '10925', '1'), - ('4.99', '215', '2007-03-21T23:45:42.996577', '14817', '2'), - ('2.99', '471', '2007-02-17T22:19:36.996577', '2165', '2'), - ('3.99', '198', '2007-03-02T15:56:33.996577', '11351', '1'), - ('6.99', '61', '2007-03-22T10:02:32.996577', '15089', '2'), - ('6.99', '416', '2007-03-16T23:47:46.996577', '11557', '1'), - ('6.99', '70', '2007-03-18T14:17:41.996577', '12581', '1'), - ('10.99', '345', '2007-03-21T19:28:29.996577', '14702', '1'), - ('4.99', '20', '2007-04-30T06:23:40.996577', '9075', '2'), - ('2.99', '292', '2007-03-20T08:11:32.996577', '13715', '1'), - ('0.99', '62', '2007-02-16T03:20:54.996577', '1587', '1'), - ('3.99', '319', '2007-03-20T02:21:46.996577', '13548', '1'), - ('2.99', '471', '2007-04-07T00:10:48.996577', '4020', '1'), - ('4.99', '452', '2007-03-18T16:17:54.996577', '12630', '1'), - ('2.99', '25', '2007-04-12T20:30:44.996577', '6905', '2'), - ('4.99', '41', '2007-03-01T09:14:17.996577', '10495', '2'), - ('4.99', '278', '2007-04-07T21:03:50.996577', '4430', '1'), - ('2.99', '305', '2007-03-22T22:22:30.996577', '15417', '2'), - ('5.99', '583', '2007-02-19T21:15:03.996577', '2845', '2'), - ('3.99', '166', '2007-02-18T00:57:36.996577', '2211', '1'), - ('6.99', '416', '2007-03-01T18:21:39.996577', '10742', '1'), - ('5.99', '190', '2007-04-27T14:20:36.996577', '7386', '1'), - ('3.99', '399', '2007-03-17T15:45:08.996577', '11953', '1'), - ('0.99', '284', '2007-04-06T02:01:49.996577', '3572', '1'), - ('2.99', '326', '2007-04-29T17:02:59.996577', '8739', '2'), - ('0.99', '85', '2007-02-19T17:21:31.996577', '2794', '2'), - ('0.99', '557', '2007-03-22T16:12:53.996577', '15236', '2'), - ('0.99', '368', '2007-03-19T20:02:01.996577', '13378', '2'), - ('0.99', '85', '2007-03-01T11:12:58.996577', '10548', '1'), - ('4.99', '565', '2007-04-09T05:53:45.996577', '5124', '1'), - ('0.99', '479', '2007-05-14T13:44:29.996577', '12101', '1'), - ('6.99', '449', '2007-03-01T10:10:21.996577', '10516', '1'), - ('5.99', '119', '2007-03-16T22:32:54.996577', '11520', '1'), - ('2.99', '498', '2007-04-08T22:24:35.996577', '4972', '2'), - ('4.99', '220', '2007-03-17T02:44:12.996577', '11622', '1'), - ('0.99', '306', '2007-04-29T12:19:46.996577', '8620', '2'), - ('4.99', '480', '2007-03-19T02:42:03.996577', '12905', '2'), - ('5.99', '488', '2007-04-07T11:28:46.996577', '4233', '2'), - ('0.99', '405', '2007-02-17T02:27:02.996577', '1888', '1'), - ('3.99', '577', '2007-03-20T00:23:05.996577', '13500', '2'), - ('5.99', '562', '2007-03-18T02:21:44.996577', '12248', '1'), - ('3.99', '91', '2007-02-18T18:06:46.996577', '2457', '1'), - ('4.99', '352', '2007-02-16T07:48:59.996577', '1649', '1'), - ('2.99', '340', '2007-04-30T10:34:08.996577', '9834', '1'), - ('4.99', '575', '2007-03-19T21:03:17.996577', '13408', '2'), - ('4.99', '469', '2007-04-28T10:16:34.996577', '7914', '1'), - ('4.99', '575', '2007-04-30T07:26:01.996577', '9733', '1'), - ('5.99', '51', '2007-04-27T23:37:02.996577', '7636', '1'), - ('1.99', '273', '2007-04-12T08:16:24.996577', '6635', '1'), - ('3.99', '172', '2007-04-27T07:08:24.996577', '7194', '1'), - ('3.99', '41', '2007-03-17T23:37:00.996577', '12173', '2'), - ('3.99', '290', '2007-04-30T19:07:24.996577', '10096', '2'), - ('2.99', '463', '2007-03-19T04:24:24.996577', '12950', '1'), - ('7.99', '107', '2007-04-27T22:09:44.996577', '7600', '1'), - ('1.99', '20', '2007-03-22T13:05:48.996577', '15161', '1'), - ('1.99', '158', '2007-04-30T06:41:54.996577', '9713', '1'), - ('0.99', '164', '2007-04-12T11:16:29.996577', '6702', '2'), - ('5.99', '205', '2007-02-18T02:46:10.996577', '2237', '2'), - ('0.99', '36', '2007-04-07T06:43:29.996577', '4135', '2'), - ('9.99', '423', '2007-04-27T20:08:08.996577', '7539', '2'), - ('0.99', '585', '2007-02-19T10:16:25.996577', '2674', '1'), - ('0.99', '115', '2007-03-02T00:39:29.996577', '10919', '2'), - ('0.99', '402', '2007-03-02T04:36:20.996577', '11045', '2'), - ('0.99', '303', '2007-03-18T06:23:35.996577', '12365', '1'), - ('0.99', '36', '2007-02-19T14:34:07.996577', '2741', '2'), - ('4.99', '317', '2007-03-22T17:38:18.996577', '15280', '1'), - ('5.99', '87', '2007-04-29T00:31:12.996577', '8286', '1'), - ('0.99', '101', '2007-03-21T11:59:33.996577', '14476', '1'), - ('5.99', '400', '2007-04-30T10:21:06.996577', '9177', '2'), - ('4.99', '322', '2007-04-06T05:57:25.996577', '3646', '1'), - ('4.99', '537', '2007-05-14T13:44:29.996577', '13419', '1'), - ('2.99', '111', '2007-03-02T11:55:37.996577', '11239', '2'), - ('9.99', '497', '2007-04-30T13:34:02.996577', '9273', '1'), - ('5.99', '399', '2007-04-29T06:39:57.996577', '8461', '2'), - ('0.99', '212', '2007-02-15T13:33:36.996577', '1379', '2'), - ('4.99', '330', '2007-03-18T20:45:30.996577', '12740', '1'), - ('6.99', '445', '2007-03-21T16:31:41.996577', '14612', '1'), - ('4.99', '507', '2007-03-18T05:43:39.996577', '12343', '1'), - ('5.99', '7', '2007-04-29T05:31:21.996577', '8422', '2'), - ('2.99', '35', '2007-03-20T08:59:27.996577', '13735', '1'), - ('0.99', '457', '2007-02-17T11:41:53.996577', '2030', '1'), - ('5.99', '472', '2007-04-30T00:56:48.996577', '8929', '2'), - ('3.99', '512', '2007-03-22T18:42:39.996577', '15317', '1'), - ('2.99', '13', '2007-04-06T20:07:50.996577', '3946', '2'), - ('4.99', '282', '2007-04-28T23:55:48.996577', '8270', '2'), - ('5.99', '530', '2007-03-21T19:34:55.996577', '14707', '2'), - ('4.99', '275', '2007-03-21T20:41:11.996577', '14727', '2'), - ('0.99', '579', '2007-03-23T05:01:52.996577', '15601', '2'), - ('3.99', '190', '2007-04-12T18:35:13.996577', '6867', '2'), - ('1.99', '535', '2007-03-18T21:01:05.996577', '12750', '2'), - ('2.99', '87', '2007-04-27T22:07:12.996577', '7599', '2'), - ('2.99', '101', '2007-04-09T04:44:29.996577', '5100', '2'), - ('0.99', '230', '2007-04-09T02:59:16.996577', '5061', '1'), - ('0.99', '198', '2007-03-01T15:56:24.996577', '10679', '1'), - ('3.99', '539', '2007-02-15T06:53:59.996577', '1282', '2'), - ('2.99', '7', '2007-03-18T20:23:27.996577', '12730', '1'), - ('2.99', '14', '2007-04-30T01:49:42.996577', '9592', '1'), - ('4.99', '570', '2007-04-11T13:35:45.996577', '6253', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['18532', '29249', '26084', '25308', '29889', '18414', '26328', '23745', '21610', '31934', '19313', '26217', '29796', '22340', '28431', '21554', '29262', '30762', '19686', '18406', '23028', '31291', '26333', '23494', '30215', '28885', '20007', '22450', '25767', '30602', '28138', '27570', '24424', '26346', '23523', '23784', '18106', '26497', '22612', '23167', '23822', '24356', '30365', '30267', '17524', '31277', '31075', '26794', '22985', '30206', '25582', '23928', '29640', '22337', '22064', '19586', '25879', '23838', '28821', '28248', '28135', '22099', '22327', '23728', '20264', '20174', '17671', '30644', '23676', '31897', '29146', '26492', '22231', '29622', '24660', '27566', '27267', '26211', '19884', '20386', '28436', '19665', '24353', '30879', '23692', '19420', '28621', '19906', '23786', '17582', '30829', '22736', '26079', '19755', '29625', '22773', '23924', '26594', '31946', '21269']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('4.99', '10', '2007-02-16T18:50:19.996577', '1801', '1'), - ('2.99', '25', '2007-04-10T17:48:09.996577', '5881', '1'), - ('4.99', '348', '2007-04-05T22:15:56.996577', '3494', '2'), - ('6.99', '282', '2007-04-10T20:22:08.996577', '5926', '1'), - ('0.99', '80', '2007-04-27T20:47:34.996577', '7558', '2'), - ('7.99', '585', '2007-02-15T11:08:18.996577', '1346', '2'), - ('8.99', '368', '2007-04-08T19:56:14.996577', '4913', '2'), - ('0.99', '115', '2007-03-18T06:23:40.996577', '12366', '2'), - ('2.99', '486', '2007-03-18T15:34:48.996577', '12609', '2'), - ('2.99', '330', '2007-05-14T13:44:29.996577', '11709', '2'), - ('4.99', '215', '2007-02-15T13:27:32.996577', '1376', '2'), - ('4.99', '359', '2007-04-30T12:40:29.996577', '9898', '1'), - ('2.99', '73', '2007-04-07T16:30:05.996577', '4327', '2'), - ('1.99', '566', '2007-03-17T15:25:23.996577', '11941', '1'), - ('2.99', '560', '2007-04-07T14:55:51.996577', '4298', '1'), - ('2.99', '479', '2007-03-20T17:23:25.996577', '13974', '1'), - ('6.99', '26', '2007-04-07T21:07:28.996577', '4431', '1'), - ('2.99', '156', '2007-04-10T14:55:51.996577', '5828', '1'), - ('2.99', '282', '2007-03-20T09:29:03.996577', '13749', '2'), - ('9.99', '583', '2007-02-18T16:16:54.996577', '2429', '1'), - ('4.99', '35', '2007-03-21T20:53:35.996577', '14735', '2'), - ('8.99', '210', '2007-04-29T02:49:08.996577', '8336', '2'), - ('0.99', '368', '2007-04-28T15:18:04.996577', '8045', '1'), - ('4.99', '84', '2007-03-17T15:52:56.996577', '11960', '2'), - ('2.99', '108', '2007-04-07T03:40:19.996577', '4082', '2'), - ('4.99', '597', '2007-04-30T16:53:05.996577', '10021', '2'), - ('8.99', '319', '2007-03-18T08:45:23.996577', '12424', '2'), - ('3.99', '579', '2007-03-02T21:19:49.996577', '11494', '1'), - ('4.99', '320', '2007-04-28T10:49:34.996577', '7930', '2'), - ('4.99', '142', '2007-04-08T00:19:58.996577', '4497', '2'), - ('4.99', '530', '2007-04-30T13:19:45.996577', '9914', '1'), - ('2.99', '481', '2007-04-10T09:05:46.996577', '5711', '2'), - ('6.99', '181', '2007-03-01T19:22:11.996577', '10773', '1'), - ('0.99', '369', '2007-04-30T06:52:05.996577', '9089', '1'), - ('5.99', '87', '2007-03-18T02:45:59.996577', '12264', '1'), - ('3.99', '119', '2007-03-21T07:23:19.996577', '14349', '2'), - ('4.99', '498', '2007-02-18T17:47:02.996577', '2449', '1'), - ('4.99', '383', '2007-04-11T04:17:44.996577', '6091', '2'), - ('2.99', '598', '2007-03-18T15:16:18.996577', '12601', '2'), - ('6.99', '51', '2007-03-17T07:36:22.996577', '11751', '2'), - ('2.99', '122', '2007-03-19T12:17:20.996577', '13171', '1'), - ('4.99', '174', '2007-03-23T18:34:49.996577', '15975', '1'), - ('4.99', '122', '2007-04-08T03:52:25.996577', '4568', '1'), - ('5.99', '113', '2007-04-10T12:00:22.996577', '5774', '1'), - ('0.99', '345', '2007-02-16T00:27:01.996577', '1550', '2'), - ('4.99', '210', '2007-04-06T17:09:59.996577', '3884', '2'), - ('8.99', '182', '2007-04-28T15:18:52.996577', '8048', '2'), - ('1.99', '409', '2007-04-29T16:37:48.996577', '8726', '1'), - ('2.99', '30', '2007-03-21T15:46:59.996577', '14585', '1'), - ('5.99', '107', '2007-04-12T16:22:59.996577', '6811', '1'), - ('4.99', '303', '2007-04-27T01:01:10.996577', '7023', '1'), - ('2.99', '133', '2007-03-19T18:16:33.996577', '13323', '2'), - ('9.99', '58', '2007-04-27T02:20:53.996577', '7063', '1'), - ('6.99', '566', '2007-03-01T02:08:14.996577', '10289', '2'), - ('5.99', '535', '2007-03-22T09:33:18.996577', '15075', '2'), - ('2.99', '273', '2007-03-22T20:28:17.996577', '15372', '2'), - ('4.99', '330', '2007-04-29T14:36:29.996577', '8680', '1'), - ('2.99', '125', '2007-03-01T12:23:01.996577', '10583', '1'), - ('3.99', '592', '2007-04-27T10:19:00.996577', '7278', '1'), - ('4.99', '539', '2007-04-30T09:21:09.996577', '9796', '1'), - ('4.99', '530', '2007-04-27T08:02:50.996577', '7218', '1'), - ('6.99', '540', '2007-03-02T18:38:27.996577', '11432', '2'), - ('4.99', '565', '2007-03-16T21:54:14.996577', '11506', '2'), - ('2.99', '113', '2007-03-19T20:50:27.996577', '13406', '2'), - ('2.99', '347', '2007-03-22T22:35:45.996577', '15426', '2'), - ('6.99', '338', '2007-03-22T13:54:55.996577', '15173', '2'), - ('2.99', '383', '2007-02-18T03:33:44.996577', '2252', '1'), - ('2.99', '145', '2007-04-11T02:29:53.996577', '6056', '2'), - ('4.99', '107', '2007-03-01T00:08:30.996577', '10226', '1'), - ('4.99', '265', '2007-04-11T20:00:17.996577', '6371', '2'), - ('4.99', '14', '2007-04-09T17:42:58.996577', '5383', '1'), - ('9.99', '382', '2007-04-29T22:41:07.996577', '8871', '1'), - ('4.99', '555', '2007-03-02T08:48:08.996577', '11168', '1'), - ('4.99', '57', '2007-04-06T09:45:09.996577', '3727', '1'), - ('7.99', '212', '2007-03-17T22:55:59.996577', '12156', '1'), - ('2.99', '481', '2007-04-07T22:50:36.996577', '4473', '1'), - ('8.99', '453', '2007-04-07T01:04:12.996577', '4033', '2'), - ('9.99', '359', '2007-04-11T22:18:03.996577', '6424', '2'), - ('4.99', '304', '2007-03-22T04:34:04.996577', '14945', '1'), - ('2.99', '361', '2007-03-02T15:09:13.996577', '11327', '1'), - ('2.99', '560', '2007-04-26T22:03:55.996577', '6945', '1'), - ('3.99', '279', '2007-03-21T19:56:09.996577', '14714', '1'), - ('5.99', '174', '2007-03-19T02:06:58.996577', '12886', '2'), - ('2.99', '166', '2007-04-27T21:43:01.996577', '7581', '1'), - ('6.99', '109', '2007-03-17T22:20:52.996577', '12137', '2'), - ('5.99', '243', '2007-02-19T15:29:40.996577', '2757', '2'), - ('1.99', '576', '2007-04-27T11:59:51.996577', '7319', '2'), - ('2.99', '306', '2007-03-22T23:36:03.996577', '15457', '1'), - ('6.99', '119', '2007-03-21T17:40:24.996577', '14643', '2'), - ('6.99', '360', '2007-02-19T16:47:59.996577', '2780', '2'), - ('2.99', '162', '2007-04-08T22:59:18.996577', '4982', '2'), - ('6.99', '6', '2007-03-17T00:58:07.996577', '11591', '1'), - ('2.99', '347', '2007-04-29T18:23:07.996577', '8771', '2'), - ('1.99', '290', '2007-03-19T12:56:25.996577', '13190', '2'), - ('0.99', '57', '2007-04-10T08:09:04.996577', '5694', '1'), - ('8.99', '10', '2007-03-01T15:38:25.996577', '10671', '2'), - ('4.99', '132', '2007-03-23T14:59:21.996577', '15874', '1'), - ('2.99', '392', '2007-04-28T01:58:47.996577', '7692', '1'), - ('0.00', '361', '2007-05-14T13:44:29.996577', '14769', '1'), - ('2.99', '451', '2007-03-20T06:48:45.996577', '13666', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['27377', '29184', '24327', '21487', '26044', '25284', '20099', '27176', '23023', '29044', '28366', '18732', '21409', '31372', '19615', '25682', '24180', '29225', '28658', '18396', '24331', '23921', '18578', '28426', '30301', '18903', '28115', '22755', '26781', '23388', '18208', '24721', '28691', '21354', '18902', '18566', '21568', '25784', '31957', '20856', '25584', '27526', '23727', '28715', '27269', '28102', '23062', '29588', '31724', '30201', '30207', '21424', '22498', '22343', '28278', '26307', '25257', '30794', '25790', '21411', '18745', '26735', '22872', '31714', '30636', '27721', '18201', '31557', '32091', '20837', '26075', '22774', '23720', '28659', '28105', '28552', '29133', '20063', '22907', '29318', '23704', '21962', '17613', '21483', '30484', '17740', '24833', '18949', '28836', '23541', '20611', '24378', '19237', '28280', '29045', '30943', '25293', '28712', '22266', '23039']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('0.99', '463', '2007-04-27T00:31:47.996577', '7013', '1'), - ('3.99', '18', '2007-04-08T11:14:56.996577', '4724', '2'), - ('0.99', '171', '2007-03-23T13:11:41.996577', '15810', '2'), - ('0.99', '472', '2007-03-01T14:01:29.996577', '10627', '1'), - ('3.99', '345', '2007-04-09T23:18:27.996577', '5508', '2'), - ('0.99', '280', '2007-04-12T18:00:40.996577', '6851', '2'), - ('0.99', '330', '2007-03-19T01:08:37.996577', '12867', '1'), - ('0.99', '444', '2007-04-06T00:07:34.996577', '3539', '1'), - ('4.99', '35', '2007-03-17T03:19:22.996577', '11645', '1'), - ('3.99', '5', '2007-04-12T09:56:01.996577', '6663', '1'), - ('4.99', '553', '2007-04-07T12:47:07.996577', '4257', '1'), - ('0.99', '57', '2007-02-17T17:44:11.996577', '2105', '1'), - ('4.99', '465', '2007-03-18T23:26:50.996577', '12814', '1'), - ('7.99', '219', '2007-04-10T10:20:16.996577', '5739', '2'), - ('2.99', '275', '2007-03-21T05:41:49.996577', '14296', '1'), - ('4.99', '312', '2007-04-28T18:35:44.996577', '8137', '1'), - ('0.99', '155', '2007-03-22T10:30:14.996577', '15106', '1'), - ('2.99', '23', '2007-04-06T12:22:07.996577', '3781', '2'), - ('6.99', '579', '2007-04-12T16:55:12.996577', '6824', '2'), - ('3.99', '579', '2007-02-18T23:12:08.996577', '2522', '1'), - ('4.99', '172', '2007-03-18T05:58:12.996577', '12350', '2'), - ('0.99', '132', '2007-03-02T07:56:11.996577', '11140', '2'), - ('1.99', '23', '2007-02-19T15:13:01.996577', '2753', '1'), - ('1.99', '559', '2007-04-29T12:36:32.996577', '8631', '1'), - ('4.99', '115', '2007-04-29T11:10:39.996577', '8594', '1'), - ('0.99', '104', '2007-02-17T17:59:42.996577', '2107', '1'), - ('8.99', '528', '2007-04-30T22:11:08.996577', '9488', '2'), - ('0.99', '7', '2007-03-20T04:21:57.996577', '13594', '1'), - ('5.99', '409', '2007-04-06T16:15:46.996577', '3866', '1'), - ('2.99', '73', '2007-03-23T19:15:38.996577', '16002', '2'), - ('7.99', '526', '2007-02-17T00:18:02.996577', '1865', '2'), - ('2.99', '219', '2007-03-02T15:11:04.996577', '11328', '1'), - ('4.99', '581', '2007-04-10T08:54:40.996577', '5707', '1'), - ('4.99', '460', '2007-03-18T14:23:05.996577', '12586', '2'), - ('3.99', '104', '2007-02-15T07:10:04.996577', '1287', '2'), - ('2.99', '19', '2007-02-19T21:24:03.996577', '2848', '1'), - ('2.99', '481', '2007-03-17T23:06:25.996577', '12160', '2'), - ('1.99', '322', '2007-04-06T04:47:51.996577', '3627', '2'), - ('2.99', '417', '2007-05-14T13:44:29.996577', '13261', '2'), - ('2.99', '408', '2007-03-20T16:09:42.996577', '13944', '1'), - ('0.99', '303', '2007-04-29T05:09:48.996577', '8409', '1'), - ('2.99', '477', '2007-04-07T13:58:01.996577', '4283', '1'), - ('3.99', '113', '2007-03-18T23:33:01.996577', '12817', '2'), - ('5.99', '583', '2007-04-27T14:46:21.996577', '7401', '1'), - ('2.99', '453', '2007-04-08T15:27:38.996577', '4805', '2'), - ('1.99', '527', '2007-04-26T23:08:20.996577', '6975', '2'), - ('5.99', '38', '2007-03-23T10:24:16.996577', '15738', '1'), - ('4.99', '52', '2007-04-30T04:31:37.996577', '9029', '1'), - ('5.99', '248', '2007-04-28T05:38:37.996577', '7778', '2'), - ('4.99', '107', '2007-04-09T14:31:20.996577', '5311', '2'), - ('6.99', '107', '2007-04-26T21:39:29.996577', '6934', '2'), - ('2.99', '467', '2007-03-02T15:21:23.996577', '11332', '2'), - ('5.99', '584', '2007-03-18T18:38:45.996577', '12693', '2'), - ('4.99', '566', '2007-03-20T09:57:58.996577', '13762', '2'), - ('4.99', '543', '2007-04-29T21:34:39.996577', '8845', '2'), - ('4.99', '366', '2007-04-27T22:17:01.996577', '7602', '2'), - ('0.99', '277', '2007-04-10T16:42:48.996577', '5861', '1'), - ('2.99', '158', '2007-04-28T11:52:15.996577', '7952', '2'), - ('4.99', '322', '2007-04-27T03:12:36.996577', '7091', '1'), - ('3.99', '465', '2007-03-23T02:56:20.996577', '15550', '1'), - ('0.99', '62', '2007-02-15T19:53:56.996577', '1486', '1'), - ('2.99', '405', '2007-04-27T17:03:07.996577', '7455', '1'), - ('2.99', '20', '2007-03-21T16:31:46.996577', '14613', '2'), - ('2.99', '247', '2007-04-08T00:00:30.996577', '4492', '1'), - ('4.99', '144', '2007-04-30T10:10:36.996577', '9174', '2'), - ('2.99', '494', '2007-04-09T08:35:19.996577', '5180', '1'), - ('0.99', '523', '2007-02-19T09:57:18.996577', '2669', '2'), - ('4.99', '235', '2007-04-06T21:15:35.996577', '3968', '1'), - ('0.99', '234', '2007-05-14T13:44:29.996577', '15778', '1'), - ('8.99', '407', '2007-03-02T10:48:16.996577', '11214', '1'), - ('4.99', '347', '2007-04-28T19:08:13.996577', '8148', '2'), - ('2.99', '10', '2007-03-02T13:23:26.996577', '11289', '2'), - ('8.99', '112', '2007-03-23T08:14:59.996577', '15687', '1'), - ('8.99', '579', '2007-04-26T22:52:20.996577', '6969', '2'), - ('0.99', '527', '2007-04-30T07:48:12.996577', '9750', '2'), - ('4.99', '570', '2007-04-30T08:14:55.996577', '9766', '1'), - ('2.99', '13', '2007-04-12T19:59:07.996577', '6897', '1'), - ('6.99', '327', '2007-03-17T14:57:17.996577', '11929', '2'), - ('4.99', '23', '2007-03-19T18:28:51.996577', '13331', '2'), - ('4.99', '30', '2007-04-28T05:13:49.996577', '7769', '2'), - ('3.99', '111', '2007-03-18T00:37:14.996577', '12196', '2'), - ('10.99', '526', '2007-03-16T21:39:00.996577', '11503', '1'), - ('4.99', '368', '2007-02-19T11:45:47.996577', '2694', '1'), - ('7.99', '471', '2007-03-22T04:26:53.996577', '14942', '2'), - ('2.99', '132', '2007-04-06T14:18:29.996577', '3825', '2'), - ('0.99', '400', '2007-02-15T12:33:58.996577', '1364', '2'), - ('2.99', '233', '2007-03-22T17:45:50.996577', '15285', '2'), - ('0.99', '115', '2007-02-15T12:06:04.996577', '1361', '2'), - ('4.99', '593', '2007-04-28T12:03:00.996577', '7958', '2'), - ('2.99', '89', '2007-03-20T12:10:36.996577', '13823', '1'), - ('0.99', '383', '2007-03-02T03:13:27.996577', '10993', '2'), - ('4.99', '177', '2007-03-01T03:08:28.996577', '10321', '2'), - ('3.99', '190', '2007-02-19T02:37:29.996577', '2568', '1'), - ('0.99', '543', '2007-04-30T16:09:19.996577', '9999', '1'), - ('4.99', '5', '2007-04-12T10:44:54.996577', '6685', '2'), - ('4.99', '171', '2007-04-30T05:57:20.996577', '9066', '2'), - ('0.99', '280', '2007-04-30T07:17:52.996577', '9103', '2'), - ('5.99', '583', '2007-04-09T22:13:41.996577', '5478', '1'), - ('1.99', '559', '2007-03-19T14:45:41.996577', '13234', '1'), - ('4.99', '36', '2007-03-23T07:11:06.996577', '15657', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['29538', '21388', '30300', '18757', '23456', '18338', '23842', '29986', '31861', '29406', '18967', '23597', '19078', '23487', '29824', '22024', '29674', '29393', '23498', '29683', '31056', '18384', '25437', '21361', '18731', '25686', '23245', '22021', '22499', '17969', '27332', '19580', '30169', '31556', '18899', '30060', '19179', '24003', '18515', '24043', '27694', '27562', '26870', '20778', '21629', '22031', '22053', '24121', '27328', '30376', '28275', '24032', '26679', '24987', '24062', '27726', '29170', '20762', '28057', '18260', '21208', '28443', '18682', '22777', '23657', '28157', '21406', '27464', '20310', '32018', '28324', '29910', '28608', '30213', '29256', '22105', '20707', '30364', '29881', '17795', '30491', '19694', '28442', '22564', '21282', '22605', '27598', '28665', '24854', '19781', '19626', '30708', '23926', '27590', '19716', '17578', '19157', '27638', '20166', '20371']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('0.99', '49', '2007-04-06T04:16:13.996577', '3615', '2'), - ('3.99', '463', '2007-03-01T01:48:34.996577', '10275', '1'), - ('4.99', '115', '2007-04-28T12:51:27.996577', '7983', '1'), - ('2.99', '66', '2007-02-17T03:36:53.996577', '1907', '1'), - ('0.99', '80', '2007-03-20T13:12:48.996577', '13851', '2'), - ('4.99', '565', '2007-02-15T18:55:28.996577', '1460', '2'), - ('4.99', '125', '2007-03-17T11:23:57.996577', '11832', '1'), - ('2.99', '89', '2007-04-30T16:00:37.996577', '9328', '1'), - ('7.99', '262', '2007-04-12T13:53:59.996577', '6762', '2'), - ('1.99', '38', '2007-04-07T11:10:28.996577', '4228', '2'), - ('4.99', '120', '2007-02-16T20:03:16.996577', '1820', '1'), - ('4.99', '96', '2007-03-18T00:37:49.996577', '12199', '1'), - ('2.99', '149', '2007-02-15T22:27:19.996577', '1521', '2'), - ('5.99', '83', '2007-03-23T10:20:44.996577', '15737', '2'), - ('0.99', '75', '2007-04-12T03:01:45.996577', '6530', '2'), - ('3.99', '532', '2007-03-17T19:42:01.996577', '12061', '2'), - ('4.99', '62', '2007-04-29T03:36:26.996577', '8360', '2'), - ('6.99', '36', '2007-04-28T10:28:11.996577', '7919', '2'), - ('4.99', '84', '2007-03-22T14:26:04.996577', '15190', '1'), - ('5.99', '63', '2007-04-29T01:54:33.996577', '8311', '2'), - ('0.99', '181', '2007-04-27T14:31:18.996577', '7393', '1'), - ('0.99', '576', '2007-02-18T07:11:50.996577', '2309', '1'), - ('4.99', '292', '2007-04-09T04:36:48.996577', '5095', '2'), - ('2.99', '460', '2007-03-23T17:42:33.996577', '15954', '2'), - ('5.99', '57', '2007-02-17T14:03:07.996577', '2058', '1'), - ('3.99', '312', '2007-04-30T09:28:20.996577', '9154', '1'), - ('4.99', '58', '2007-03-20T17:21:09.996577', '13973', '2'), - ('5.99', '532', '2007-03-02T01:48:49.996577', '10945', '1'), - ('2.99', '584', '2007-03-19T00:27:34.996577', '12844', '1'), - ('0.99', '459', '2007-02-17T01:19:17.996577', '1876', '2'), - ('2.99', '459', '2007-04-29T23:28:43.996577', '8897', '1'), - ('0.99', '273', '2007-03-18T18:37:45.996577', '12692', '1'), - ('4.99', '104', '2007-04-06T23:24:35.996577', '4012', '2'), - ('6.99', '235', '2007-04-06T10:58:38.996577', '3752', '1'), - ('0.99', '103', '2007-02-17T18:56:55.996577', '2118', '1'), - ('2.99', '96', '2007-04-06T10:30:04.996577', '3742', '2'), - ('2.99', '177', '2007-02-15T22:54:18.996577', '1524', '1'), - ('2.99', '140', '2007-03-22T16:53:00.996577', '15261', '1'), - ('4.99', '5', '2007-02-17T14:25:19.996577', '2063', '2'), - ('6.99', '144', '2007-03-02T20:32:13.996577', '11476', '2'), - ('6.99', '491', '2007-04-27T10:27:46.996577', '7281', '2'), - ('4.99', '480', '2007-04-29T21:42:07.996577', '8847', '2'), - ('4.99', '417', '2007-04-11T16:47:28.996577', '6312', '1'), - ('4.99', '400', '2007-03-23T18:51:34.996577', '15988', '2'), - ('5.99', '488', '2007-03-18T11:07:03.996577', '12483', '2'), - ('1.99', '532', '2007-03-22T22:12:20.996577', '15414', '2'), - ('3.99', '535', '2007-03-01T04:14:59.996577', '10353', '2'), - ('2.99', '150', '2007-03-18T05:27:41.996577', '12335', '2'), - ('5.99', '459', '2007-04-28T06:57:17.996577', '7820', '1'), - ('4.99', '122', '2007-04-30T13:16:23.996577', '9910', '2'), - ('4.99', '543', '2007-04-11T00:30:29.996577', '6013', '2'), - ('6.99', '143', '2007-03-02T12:58:09.996577', '11278', '1'), - ('4.99', '400', '2007-04-30T07:53:26.996577', '9756', '2'), - ('6.99', '250', '2007-03-22T16:20:31.996577', '15247', '2'), - ('5.99', '145', '2007-03-20T20:17:04.996577', '14044', '2'), - ('2.99', '494', '2007-04-29T23:17:43.996577', '8895', '2'), - ('2.99', '16', '2007-04-27T20:32:07.996577', '7552', '2'), - ('5.99', '399', '2007-03-02T02:14:44.996577', '10960', '2'), - ('6.99', '523', '2007-04-30T04:52:18.996577', '9667', '2'), - ('3.99', '540', '2007-02-20T05:07:37.996577', '2953', '1'), - ('2.99', '445', '2007-03-21T18:29:44.996577', '14673', '2'), - ('5.99', '560', '2007-04-30T12:36:22.996577', '9895', '2'), - ('2.99', '45', '2007-02-17T08:13:56.996577', '1979', '2'), - ('2.99', '10', '2007-03-18T07:47:38.996577', '12400', '2'), - ('3.99', '104', '2007-03-21T03:12:25.996577', '14218', '1'), - ('7.99', '532', '2007-04-09T12:09:43.996577', '5253', '1'), - ('4.99', '465', '2007-03-17T00:49:08.996577', '11586', '1'), - ('5.99', '471', '2007-04-12T20:45:42.996577', '6912', '1'), - ('0.99', '352', '2007-03-17T16:50:24.996577', '11986', '2'), - ('2.99', '23', '2007-05-14T13:44:29.996577', '15532', '2'), - ('4.99', '549', '2007-04-06T17:27:24.996577', '3892', '2'), - ('2.99', '83', '2007-04-06T11:04:10.996577', '3754', '1'), - ('2.99', '575', '2007-04-12T20:32:15.996577', '6907', '2'), - ('2.99', '107', '2007-04-30T16:56:56.996577', '9351', '2'), - ('2.99', '25', '2007-04-30T13:28:03.996577', '9922', '2'), - ('3.99', '540', '2007-03-23T17:42:12.996577', '15953', '2'), - ('5.99', '392', '2007-03-21T10:19:36.996577', '14438', '2'), - ('7.99', '122', '2007-04-07T11:51:43.996577', '4239', '1'), - ('8.99', '80', '2007-04-07T13:04:31.996577', '4268', '2'), - ('0.99', '416', '2007-02-16T00:31:10.996577', '1553', '2'), - ('0.99', '132', '2007-04-10T08:32:41.996577', '5703', '1'), - ('7.99', '284', '2007-03-01T05:37:12.996577', '10396', '1'), - ('0.99', '560', '2007-04-30T13:23:51.996577', '9265', '1'), - ('0.99', '592', '2007-03-18T15:52:41.996577', '12619', '2'), - ('2.99', '453', '2007-03-18T19:05:39.996577', '12703', '1'), - ('4.99', '597', '2007-03-17T20:39:12.996577', '12081', '1'), - ('4.99', '483', '2007-04-29T03:27:22.996577', '8356', '1'), - ('5.99', '579', '2007-04-30T00:35:00.996577', '9553', '2'), - ('6.99', '235', '2007-03-22T08:01:34.996577', '15034', '1'), - ('2.99', '294', '2007-03-01T12:53:47.996577', '10600', '2'), - ('4.99', '276', '2007-03-18T02:27:28.996577', '12251', '2'), - ('4.99', '150', '2007-04-28T01:54:47.996577', '7690', '2'), - ('4.99', '133', '2007-03-18T08:30:14.996577', '12419', '1'), - ('4.99', '483', '2007-04-06T01:18:08.996577', '3559', '2'), - ('4.99', '286', '2007-03-20T17:26:49.996577', '13975', '1'), - ('4.99', '359', '2007-02-19T14:11:46.996577', '2736', '1'), - ('0.99', '172', '2007-02-17T13:43:09.996577', '2052', '1'), - ('4.99', '486', '2007-04-11T20:35:19.996577', '6383', '2'), - ('0.99', '338', '2007-03-01T23:52:08.996577', '10897', '1'), - ('2.99', '360', '2007-03-01T22:35:46.996577', '10857', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['24066', '25604', '19927', '18915', '25979', '23188', '30348', '28618', '23407', '29067', '26499', '27250', '22873', '24350', '22517', '31235', '28624', '22280', '19657', '32042', '20275', '19330', '22175', '28447', '22353', '19363', '28779', '24840', '22574', '24120', '21969', '29454', '27688', '21914', '29308', '17856', '21244', '18562', '24188', '20021', '25764', '21871', '18939', '24640', '21028', '26241', '27697', '30375', '30791', '18885', '20195', '30792', '18476', '26301', '31337', '27188', '25467', '17532', '22676', '27379', '26141', '18357', '20441', '22724', '19108', '21628', '18970', '20818', '31510', '20317', '25458', '24730', '22379', '27879', '31978', '31099', '28628', '27757', '31371', '29678', '20101', '25215', '25394', '27728', '29196', '19125', '18045', '17640', '31712', '18379', '17548', '26673', '19901', '29585', '23387', '19900', '29961', '28823', '22324', '18819']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('0.99', '146', '2007-03-02T16:34:27.996577', '11370', '2'), - ('4.99', '305', '2007-04-10T02:36:51.996577', '5582', '2'), - ('2.99', '308', '2007-03-23T13:31:39.996577', '15820', '2'), - ('3.99', '107', '2007-02-20T10:30:31.996577', '3033', '1'), - ('4.99', '338', '2007-04-09T14:28:42.996577', '5309', '1'), - ('5.99', '52', '2007-03-23T15:28:38.996577', '15891', '2'), - ('0.99', '120', '2007-04-28T15:18:07.996577', '8046', '2'), - ('4.99', '576', '2007-04-08T01:09:51.996577', '4514', '1'), - ('1.99', '75', '2007-03-18T05:28:07.996577', '12336', '1'), - ('7.99', '7', '2007-04-10T20:03:38.996577', '5921', '1'), - ('4.99', '383', '2007-04-12T14:30:10.996577', '6775', '1'), - ('3.99', '451', '2007-04-08T23:50:10.996577', '5005', '1'), - ('6.99', '20', '2007-03-22T08:48:24.996577', '15057', '2'), - ('4.99', '174', '2007-03-01T05:40:15.996577', '10398', '2'), - ('2.99', '586', '2007-03-21T13:43:45.996577', '14533', '2'), - ('5.99', '199', '2007-04-10T07:16:02.996577', '5680', '2'), - ('5.99', '576', '2007-04-30T08:27:26.996577', '9133', '1'), - ('1.99', '560', '2007-03-21T07:06:50.996577', '14341', '1'), - ('2.99', '279', '2007-03-16T22:23:00.996577', '11515', '1'), - ('4.99', '83', '2007-05-14T13:44:29.996577', '11563', '2'), - ('0.99', '348', '2007-03-20T07:24:19.996577', '13684', '2'), - ('3.99', '219', '2007-02-18T15:40:27.996577', '2417', '2'), - ('0.99', '549', '2007-03-01T01:56:59.996577', '10281', '2'), - ('4.99', '561', '2007-04-12T17:42:31.996577', '6843', '1'), - ('2.99', '568', '2007-03-01T03:35:29.996577', '10340', '1'), - ('8.99', '230', '2007-02-18T17:54:13.996577', '2450', '2'), - ('3.99', '589', '2007-04-27T15:55:53.996577', '7431', '2'), - ('0.99', '234', '2007-03-02T05:41:29.996577', '11073', '1'), - ('5.99', '593', '2007-03-21T09:15:50.996577', '14408', '1'), - ('6.99', '150', '2007-03-18T02:44:09.996577', '12260', '2'), - ('6.99', '526', '2007-03-21T12:21:59.996577', '14487', '2'), - ('4.99', '41', '2007-04-27T05:44:04.996577', '7153', '2'), - ('8.99', '491', '2007-04-07T01:56:25.996577', '4046', '1'), - ('5.99', '520', '2007-03-18T16:58:17.996577', '12647', '1'), - ('4.99', '30', '2007-04-06T20:51:28.996577', '3964', '1'), - ('4.99', '432', '2007-02-20T22:28:23.996577', '3194', '2'), - ('6.99', '449', '2007-03-01T16:22:09.996577', '10688', '2'), - ('4.99', '18', '2007-02-16T17:51:49.996577', '1783', '2'), - ('4.99', '156', '2007-03-22T00:09:15.996577', '14831', '2'), - ('5.99', '321', '2007-03-23T15:24:40.996577', '15888', '2'), - ('2.99', '320', '2007-04-07T08:25:52.996577', '4173', '2'), - ('3.99', '515', '2007-03-17T05:19:31.996577', '11691', '1'), - ('4.99', '113', '2007-02-17T15:14:37.996577', '2077', '2'), - ('6.99', '210', '2007-03-21T17:30:05.996577', '14639', '2'), - ('5.99', '425', '2007-03-20T22:27:28.996577', '14089', '2'), - ('2.99', '361', '2007-04-27T20:06:30.996577', '7538', '1'), - ('2.99', '491', '2007-04-30T17:15:46.996577', '10036', '2'), - ('5.99', '122', '2007-04-29T18:23:51.996577', '8772', '1'), - ('5.99', '158', '2007-04-12T20:14:59.996577', '6901', '2'), - ('5.99', '98', '2007-02-16T03:40:07.996577', '1590', '2'), - ('4.99', '340', '2007-03-21T11:16:04.996577', '14457', '1'), - ('2.99', '158', '2007-04-27T05:52:26.996577', '7159', '2'), - ('2.99', '204', '2007-02-15T09:17:43.996577', '1321', '1'), - ('6.99', '366', '2007-04-12T03:08:04.996577', '6533', '2'), - ('8.99', '215', '2007-04-08T21:04:32.996577', '4940', '2'), - ('4.99', '445', '2007-04-28T12:29:13.996577', '7971', '2'), - ('4.99', '294', '2007-04-29T21:32:51.996577', '8843', '2'), - ('8.99', '347', '2007-02-20T14:33:08.996577', '3092', '1'), - ('8.99', '207', '2007-03-20T11:24:29.996577', '13809', '2'), - ('2.99', '463', '2007-04-29T17:58:28.996577', '8762', '1'), - ('0.99', '352', '2007-04-30T20:59:23.996577', '9463', '1'), - ('5.99', '570', '2007-02-17T10:16:31.996577', '2008', '2'), - ('2.99', '366', '2007-03-23T01:32:06.996577', '15514', '1'), - ('3.99', '5', '2007-03-17T14:57:19.996577', '11930', '2'), - ('0.99', '156', '2007-02-19T16:53:33.996577', '2782', '1'), - ('3.99', '488', '2007-03-17T08:49:05.996577', '11774', '1'), - ('9.99', '120', '2007-02-19T17:46:53.996577', '2803', '1'), - ('4.99', '405', '2007-03-01T08:23:07.996577', '10472', '1'), - ('2.99', '230', '2007-04-29T20:19:52.996577', '8815', '1'), - ('4.99', '353', '2007-03-17T05:38:25.996577', '11698', '2'), - ('4.99', '293', '2007-04-29T10:56:43.996577', '8589', '1'), - ('0.99', '220', '2007-03-02T04:26:38.996577', '11037', '1'), - ('3.99', '570', '2007-03-21T22:13:19.996577', '14768', '2'), - ('2.99', '507', '2007-04-30T03:31:18.996577', '9003', '1'), - ('4.99', '497', '2007-05-14T13:44:29.996577', '12698', '1'), - ('2.99', '185', '2007-04-11T05:33:32.996577', '6106', '2'), - ('2.99', '576', '2007-04-30T15:28:33.996577', '9979', '1'), - ('4.99', '497', '2007-04-09T11:41:01.996577', '5239', '1'), - ('4.99', '219', '2007-04-09T22:00:04.996577', '5475', '2'), - ('6.99', '63', '2007-04-10T02:44:09.996577', '5585', '1'), - ('2.99', '331', '2007-03-02T16:15:51.996577', '11362', '1'), - ('2.99', '273', '2007-04-12T11:12:30.996577', '6696', '2'), - ('2.99', '288', '2007-04-30T19:47:52.996577', '9429', '2'), - ('4.99', '494', '2007-04-30T03:47:23.996577', '9012', '2'), - ('9.99', '19', '2007-04-30T18:29:32.996577', '10077', '2'), - ('0.99', '162', '2007-02-20T21:17:10.996577', '3180', '2'), - ('2.99', '479', '2007-02-17T09:09:02.996577', '1987', '2'), - ('1.99', '377', '2007-02-20T13:50:58.996577', '3080', '1'), - ('2.99', '247', '2007-04-06T20:26:34.996577', '3955', '2'), - ('2.99', '575', '2007-02-15T20:22:46.996577', '1494', '2'), - ('0.99', '352', '2007-02-15T20:26:26.996577', '1498', '1'), - ('5.99', '400', '2007-04-09T10:34:11.996577', '5222', '2'), - ('2.99', '306', '2007-03-19T05:47:30.996577', '12989', '1'), - ('5.99', '52', '2007-04-27T16:09:06.996577', '7438', '2'), - ('0.99', '73', '2007-03-23T07:30:29.996577', '15667', '1'), - ('7.99', '306', '2007-03-18T01:28:37.996577', '12225', '1'), - ('4.99', '87', '2007-04-30T23:16:50.996577', '10205', '2'), - ('2.99', '592', '2007-04-29T16:52:00.996577', '8730', '1'), - ('3.99', '565', '2007-03-02T00:32:29.996577', '10913', '2'), - ('3.99', '83', '2007-02-16T05:34:32.996577', '1617', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['30500', '21205', '19058', '30086', '18325', '24190', '25183', '25361', '18077', '18979', '24433', '28650', '32040', '22479', '28697', '23496', '27191', '30699', '31223', '22326', '22511', '28941', '17664', '26901', '28423', '30264', '29260', '17584', '28214', '22308', '18963', '29641', '30796', '26866', '31326', '26030', '20553', '29975', '18888', '31234', '31529', '24667', '29016', '30655', '21491', '21651', '26326', '19419', '28467', '18884', '29396', '22913', '25245', '22699', '26300', '18386', '30698', '29259', '21016', '30335', '30831', '28255', '28662', '22272', '23845', '18931', '22473', '25595', '23929', '23244', '30262', '24681', '28718', '28468', '24388', '19629', '24756', '27634', '31340', '29713', '18546', '26069', '22754', '22922', '31369', '21963', '29804', '21916', '29989', '27308', '28622', '29671', '18531', '19050', '24686', '27753', '22304', '23540', '22981', '27841']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('2.99', '133', '2007-04-08T16:22:44.996577', '4829', '2'), - ('3.99', '445', '2007-03-17T12:49:37.996577', '11877', '1'), - ('2.99', '144', '2007-02-20T18:49:43.996577', '3145', '1'), - ('3.99', '98', '2007-04-27T04:25:05.996577', '7120', '2'), - ('4.99', '561', '2007-02-17T19:03:08.996577', '2119', '1'), - ('6.99', '156', '2007-03-22T21:54:58.996577', '15408', '1'), - ('4.99', '269', '2007-04-27T01:31:35.996577', '7032', '1'), - ('6.99', '286', '2007-04-07T12:07:27.996577', '4242', '2'), - ('3.99', '490', '2007-02-16T08:44:28.996577', '1665', '1'), - ('4.99', '122', '2007-02-19T04:12:21.996577', '2595', '2'), - ('3.99', '181', '2007-03-21T09:15:01.996577', '14406', '2'), - ('2.99', '578', '2007-04-28T22:14:07.996577', '8218', '1'), - ('0.00', '75', '2007-05-14T13:44:29.996577', '15191', '2'), - ('2.99', '582', '2007-03-17T05:55:13.996577', '11708', '1'), - ('0.99', '582', '2007-04-06T11:35:53.996577', '3767', '1'), - ('2.99', '84', '2007-03-19T09:56:09.996577', '13115', '2'), - ('4.99', '445', '2007-04-30T02:59:14.996577', '9625', '2'), - ('2.99', '149', '2007-04-09T04:21:20.996577', '5091', '1'), - ('0.99', '198', '2007-04-27T10:52:38.996577', '7287', '1'), - ('3.99', '565', '2007-03-02T17:24:54.996577', '11399', '1'), - ('2.99', '586', '2007-03-02T04:23:19.996577', '11034', '1'), - ('5.99', '204', '2007-04-30T18:34:50.996577', '9394', '1'), - ('0.99', '382', '2007-02-18T13:56:13.996577', '2389', '1'), - ('4.99', '420', '2007-04-11T04:46:30.996577', '6096', '2'), - ('2.99', '559', '2007-04-12T20:56:35.996577', '6915', '1'), - ('2.99', '113', '2007-04-09T08:51:47.996577', '5189', '2'), - ('4.99', '26', '2007-04-07T19:09:29.996577', '4382', '1'), - ('1.99', '361', '2007-02-19T01:37:42.996577', '2558', '2'), - ('5.99', '537', '2007-04-10T17:37:17.996577', '5877', '2'), - ('0.99', '563', '2007-03-23T01:16:52.996577', '15507', '2'), - ('7.99', '119', '2007-02-14T23:05:16.996577', '1179', '1'), - ('4.99', '58', '2007-04-27T18:01:11.996577', '7487', '2'), - ('1.99', '158', '2007-04-30T02:02:36.996577', '8957', '1'), - ('4.99', '417', '2007-04-06T20:19:57.996577', '3952', '1'), - ('6.99', '213', '2007-04-30T09:17:58.996577', '9150', '2'), - ('6.99', '343', '2007-04-27T02:28:01.996577', '7069', '1'), - ('2.99', '377', '2007-03-19T15:16:07.996577', '13249', '1'), - ('8.99', '89', '2007-04-08T13:29:51.996577', '4764', '1'), - ('4.99', '98', '2007-02-19T04:38:10.996577', '2601', '2'), - ('2.99', '199', '2007-04-09T18:13:24.996577', '5398', '2'), - ('0.99', '232', '2007-04-28T02:36:13.996577', '7707', '2'), - ('2.99', '213', '2007-03-01T07:38:25.996577', '10449', '1'), - ('6.99', '2', '2007-04-30T14:49:39.996577', '9296', '2'), - ('7.99', '146', '2007-04-11T05:21:35.996577', '6102', '1'), - ('4.99', '472', '2007-03-21T02:46:22.996577', '14209', '1'), - ('2.99', '490', '2007-03-22T23:23:50.996577', '15448', '1'), - ('0.99', '368', '2007-04-07T03:02:35.996577', '4066', '2'), - ('0.99', '243', '2007-02-15T18:01:18.996577', '1452', '1'), - ('4.99', '563', '2007-04-08T16:11:27.996577', '4825', '2'), - ('3.99', '98', '2007-02-15T12:21:58.996577', '1362', '1'), - ('4.99', '36', '2007-04-30T01:49:04.996577', '8952', '1'), - ('2.99', '24', '2007-03-02T10:38:11.996577', '11209', '1'), - ('4.99', '276', '2007-04-09T11:53:44.996577', '5246', '2'), - ('5.99', '2', '2007-03-21T21:10:22.996577', '14743', '2'), - ('4.99', '366', '2007-04-11T19:46:42.996577', '6366', '1'), - ('3.99', '576', '2007-02-19T08:51:22.996577', '2651', '1'), - ('0.99', '149', '2007-04-08T16:37:38.996577', '4837', '1'), - ('4.99', '26', '2007-04-07T13:10:30.996577', '4274', '1'), - ('4.99', '423', '2007-03-23T11:15:04.996577', '15755', '1'), - ('4.99', '119', '2007-04-28T18:46:16.996577', '8140', '2'), - ('4.99', '162', '2007-04-29T10:31:53.996577', '8582', '1'), - ('0.99', '540', '2007-04-12T21:00:43.996577', '6919', '1'), - ('0.99', '579', '2007-04-29T22:43:35.996577', '8876', '1'), - ('4.99', '559', '2007-03-22T23:05:47.996577', '15440', '2'), - ('2.99', '125', '2007-03-18T02:44:41.996577', '12262', '2'), - ('1.99', '111', '2007-02-17T09:58:34.996577', '1999', '2'), - ('8.99', '581', '2007-03-20T21:25:00.996577', '14070', '2'), - ('4.99', '304', '2007-04-12T12:45:18.996577', '6737', '1'), - ('1.99', '133', '2007-03-19T23:00:43.996577', '13455', '1'), - ('2.99', '58', '2007-03-20T15:43:32.996577', '13930', '1'), - ('5.99', '113', '2007-04-06T06:23:56.996577', '3657', '2'), - ('0.99', '214', '2007-03-20T08:37:06.996577', '13726', '1'), - ('1.99', '583', '2007-04-30T09:45:48.996577', '9808', '2'), - ('0.99', '563', '2007-04-08T18:15:24.996577', '4883', '1'), - ('0.99', '177', '2007-03-22T02:23:28.996577', '14883', '2'), - ('2.99', '276', '2007-03-23T09:33:43.996577', '15718', '2'), - ('4.99', '223', '2007-03-21T12:36:01.996577', '14496', '2'), - ('4.99', '486', '2007-04-07T09:54:05.996577', '4205', '1'), - ('1.99', '215', '2007-04-27T06:43:00.996577', '7180', '1'), - ('3.99', '65', '2007-04-10T10:07:41.996577', '5735', '1'), - ('2.99', '13', '2007-02-17T05:23:08.996577', '1933', '1'), - ('5.99', '347', '2007-04-07T11:17:38.996577', '4232', '1'), - ('2.99', '7', '2007-03-19T23:34:30.996577', '13476', '1'), - ('2.99', '25', '2007-03-01T22:40:58.996577', '10860', '2'), - ('0.99', '219', '2007-04-09T05:48:56.996577', '5123', '2'), - ('2.99', '526', '2007-03-17T02:17:17.996577', '11612', '1'), - ('2.99', '73', '2007-04-30T11:31:39.996577', '9212', '1'), - ('2.99', '520', '2007-03-19T22:06:28.996577', '13438', '2'), - ('4.99', '89', '2007-04-30T21:46:23.996577', '10164', '2'), - ('2.99', '457', '2007-04-29T07:44:07.996577', '8502', '1'), - ('3.99', '576', '2007-04-27T22:25:27.996577', '7605', '1'), - ('2.99', '62', '2007-04-06T15:04:06.996577', '3843', '2'), - ('4.99', '9', '2007-02-21T02:37:09.996577', '3262', '2'), - ('4.99', '143', '2007-02-17T06:12:05.996577', '1942', '1'), - ('2.99', '215', '2007-03-17T06:43:07.996577', '11729', '1'), - ('4.99', '497', '2007-04-08T01:12:07.996577', '4516', '1'), - ('1.99', '563', '2007-03-18T00:42:34.996577', '12202', '1'), - ('2.99', '89', '2007-03-18T21:20:39.996577', '12756', '1'), - ('0.99', '30', '2007-03-18T21:27:00.996577', '12758', '2'), - ('6.99', '504', '2007-04-09T07:03:31.996577', '5153', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['17892', '21013', '17523', '20058', '25800', '30955', '30228', '18446', '20702', '19124', '17774', '31224', '28418', '28016', '22451', '23285', '25416', '23287', '27588', '26342', '20097', '19158', '26337', '29098', '18859', '18517', '20387', '27457', '26305', '23035', '18702', '21901', '21709', '24041', '31280', '18924', '25335', '19661', '29086', '30124', '26096', '17894', '30338', '27246', '18257', '22378', '29715', '24067', '22691', '22446', '24963', '28242', '21296', '30973', '30247', '28440', '19608', '23318', '26868', '31367', '25250', '23646', '25981', '28130', '29072', '27973', '31713', '25998', '18832', '29444', '24207', '31673', '21900', '26308', '24844', '19667', '29833', '31755', '19876', '17723', '19992', '28463', '28455', '18480', '27032', '28782', '17514', '19235', '28402', '29710', '18084', '28623', '21291', '24753', '17554', '21195', '26897', '27990', '17945', '27727']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('4.99', '444', '2007-02-19T01:19:30.996577', '2551', '1'), - ('6.99', '423', '2007-03-21T02:04:24.996577', '14191', '2'), - ('4.99', '345', '2007-02-15T18:34:15.996577', '1457', '1'), - ('2.99', '326', '2007-03-02T18:31:36.996577', '11428', '2'), - ('7.99', '323', '2007-04-27T05:30:56.996577', '7146', '2'), - ('4.99', '172', '2007-04-27T23:41:52.996577', '7638', '1'), - ('2.99', '109', '2007-04-09T01:01:03.996577', '5027', '1'), - ('5.99', '593', '2007-02-17T13:55:29.996577', '2055', '2'), - ('0.99', '392', '2007-03-18T13:27:17.996577', '12561', '2'), - ('0.99', '162', '2007-02-20T11:02:39.996577', '3040', '1'), - ('5.99', '409', '2007-02-15T02:14:36.996577', '1226', '2'), - ('5.99', '198', '2007-04-27T16:15:19.996577', '7441', '1'), - ('5.99', '559', '2007-04-06T07:31:39.996577', '3674', '1'), - ('2.99', '520', '2007-04-29T01:01:07.996577', '8294', '1'), - ('6.99', '579', '2007-03-17T19:24:41.996577', '12051', '2'), - ('6.99', '63', '2007-03-01T02:07:08.996577', '10288', '1'), - ('2.99', '290', '2007-04-27T09:47:27.996577', '7265', '2'), - ('2.99', '63', '2007-03-18T05:41:12.996577', '12342', '2'), - ('2.99', '482', '2007-04-29T10:36:19.996577', '8584', '2'), - ('2.99', '369', '2007-04-10T01:43:50.996577', '5561', '2'), - ('2.99', '330', '2007-03-18T07:33:41.996577', '12394', '1'), - ('1.99', '172', '2007-02-20T10:26:56.996577', '3032', '2'), - ('6.99', '369', '2007-04-05T22:05:39.996577', '3490', '1'), - ('2.99', '10', '2007-04-09T03:21:44.996577', '5068', '2'), - ('2.99', '91', '2007-02-21T12:36:01.996577', '3384', '2'), - ('4.99', '5', '2007-02-20T17:06:48.996577', '3126', '2'), - ('3.99', '361', '2007-03-17T16:55:34.996577', '11991', '1'), - ('5.99', '470', '2007-04-30T19:37:07.996577', '9422', '1'), - ('1.99', '366', '2007-04-27T12:57:54.996577', '7344', '1'), - ('2.99', '36', '2007-03-20T03:00:11.996577', '13562', '2'), - ('4.99', '49', '2007-02-21T01:14:43.996577', '3235', '2'), - ('4.99', '518', '2007-03-21T00:51:13.996577', '14149', '1'), - ('6.99', '498', '2007-03-02T19:35:32.996577', '11455', '1'), - ('4.99', '144', '2007-03-02T01:55:01.996577', '10951', '1'), - ('0.99', '210', '2007-04-07T17:00:30.996577', '4334', '1'), - ('3.99', '109', '2007-02-17T02:45:10.996577', '1891', '2'), - ('2.99', '284', '2007-04-07T03:38:34.996577', '4081', '2'), - ('7.99', '279', '2007-03-19T09:34:42.996577', '13105', '1'), - ('0.99', '9', '2007-04-08T12:28:04.996577', '4748', '2'), - ('2.99', '101', '2007-04-10T11:08:43.996577', '5757', '1'), - ('2.99', '348', '2007-04-29T07:40:27.996577', '8500', '1'), - ('5.99', '444', '2007-02-21T15:28:15.996577', '3415', '2'), - ('2.99', '119', '2007-04-30T04:29:01.996577', '9028', '2'), - ('4.99', '451', '2007-04-06T14:20:24.996577', '3826', '2'), - ('2.99', '540', '2007-02-15T05:25:05.996577', '1263', '2'), - ('4.99', '570', '2007-03-17T19:05:03.996577', '12042', '2'), - ('6.99', '65', '2007-04-28T08:54:02.996577', '7877', '1'), - ('5.99', '146', '2007-03-02T17:09:37.996577', '11392', '2'), - ('0.99', '2', '2007-03-01T08:13:52.996577', '10466', '1'), - ('5.99', '578', '2007-03-19T08:29:33.996577', '13071', '2'), - ('0.99', '247', '2007-03-16T21:19:46.996577', '11495', '1'), - ('5.99', '539', '2007-04-12T18:49:19.996577', '6874', '2'), - ('6.99', '454', '2007-03-20T11:21:38.996577', '13805', '1'), - ('1.99', '174', '2007-04-08T15:25:00.996577', '4803', '2'), - ('2.99', '111', '2007-04-12T19:54:03.996577', '6896', '1'), - ('5.99', '560', '2007-04-29T22:15:55.996577', '8861', '2'), - ('1.99', '275', '2007-03-18T15:30:47.996577', '12606', '1'), - ('2.99', '66', '2007-03-20T23:59:51.996577', '14123', '2'), - ('9.99', '417', '2007-04-07T20:36:21.996577', '4421', '1'), - ('0.99', '219', '2007-04-08T08:59:06.996577', '4678', '2'), - ('4.99', '276', '2007-04-30T07:16:46.996577', '9102', '1'), - ('5.99', '103', '2007-03-22T23:42:18.996577', '15461', '1'), - ('4.99', '338', '2007-04-11T19:36:06.996577', '6360', '1'), - ('2.99', '530', '2007-04-06T07:06:55.996577', '3669', '2'), - ('7.99', '7', '2007-04-30T02:58:29.996577', '9624', '2'), - ('2.99', '517', '2007-04-08T23:18:13.996577', '4993', '1'), - ('6.99', '247', '2007-04-07T09:36:37.996577', '4198', '2'), - ('2.99', '340', '2007-04-07T22:55:56.996577', '4475', '2'), - ('3.99', '85', '2007-02-21T15:35:04.996577', '3418', '2'), - ('3.99', '40', '2007-04-28T20:00:55.996577', '8170', '2'), - ('1.99', '158', '2007-03-19T13:52:33.996577', '13212', '2'), - ('2.99', '243', '2007-04-30T05:05:33.996577', '9675', '2'), - ('6.99', '518', '2007-03-20T22:25:50.996577', '14088', '1'), - ('6.99', '366', '2007-04-28T06:25:07.996577', '7805', '1'), - ('4.99', '234', '2007-03-19T01:04:25.996577', '12863', '2'), - ('4.99', '279', '2007-03-21T22:58:05.996577', '14789', '1'), - ('4.99', '75', '2007-04-30T20:12:57.996577', '9442', '2'), - ('4.99', '252', '2007-04-27T01:05:06.996577', '7024', '1'), - ('4.99', '303', '2007-03-21T23:08:48.996577', '14795', '2'), - ('4.99', '394', '2007-02-15T09:31:11.996577', '1324', '2'), - ('7.99', '317', '2007-03-17T22:24:20.996577', '12138', '2'), - ('6.99', '563', '2007-04-08T06:59:52.996577', '4629', '2'), - ('8.99', '562', '2007-04-12T06:37:16.996577', '6607', '1'), - ('2.99', '204', '2007-02-17T23:43:53.996577', '2186', '2'), - ('4.99', '432', '2007-04-27T12:19:06.996577', '7326', '2'), - ('3.99', '589', '2007-04-29T03:52:28.996577', '8374', '1'), - ('0.99', '343', '2007-02-17T01:26:00.996577', '1879', '2'), - ('2.99', '190', '2007-02-15T11:12:09.996577', '1347', '1'), - ('6.99', '557', '2007-04-30T17:18:24.996577', '9367', '2'), - ('4.99', '65', '2007-04-06T00:01:12.996577', '3535', '1'), - ('3.99', '491', '2007-02-21T18:26:44.996577', '3440', '1'), - ('4.99', '576', '2007-04-29T23:53:29.996577', '8907', '1'), - ('0.99', '454', '2007-03-18T05:46:36.996577', '12347', '2'), - ('4.99', '223', '2007-03-02T04:31:48.996577', '11040', '2'), - ('7.99', '353', '2007-02-17T05:16:57.996577', '1928', '2'), - ('2.99', '444', '2007-03-20T02:44:33.996577', '13559', '2'), - ('4.99', '420', '2007-04-09T03:53:46.996577', '5081', '2'), - ('6.99', '518', '2007-04-28T07:29:39.996577', '7839', '2'), - ('2.99', '454', '2007-02-21T00:18:13.996577', '3221', '1'), - ('4.99', '494', '2007-04-30T01:05:31.996577', '8934', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['22056', '22246', '24515', '26905', '28717', '29096', '24780', '19762', '27592', '27635', '18047', '21945', '17513', '27715', '22286', '31334', '30490', '17672', '28721', '26872', '19310', '28470', '22497', '27989', '23482', '27409', '27676', '26231', '22061', '25849', '21257', '22917', '23724', '20187', '28737', '31393', '19998', '18189', '27568', '30168', '23385', '30510', '25276', '29827', '25143', '18597', '30204', '31548', '18059', '19715', '26761', '31860', '28011', '21913', '25676', '19106', '31314', '25115', '18581', '30586', '25162', '31834', '31069', '19518', '29163', '25390', '23057', '18156', '29573', '22758', '22911', '30343', '28499', '28497', '20769', '25311', '27720', '22725', '31240', '18965', '21872', '20844', '30607', '18756', '22802', '26863', '30387', '24349', '29078', '25805', '20024', '23841', '19154', '29255', '29228', '17982', '31920', '30513', '18710', '27752']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('2.99', '535', '2007-03-17T23:32:18.996577', '12168', '2'), - ('0.99', '557', '2007-03-02T09:23:29.996577', '11181', '1'), - ('4.99', '190', '2007-03-21T00:35:48.996577', '14141', '2'), - ('0.99', '420', '2007-04-29T07:21:35.996577', '8485', '2'), - ('7.99', '583', '2007-04-30T00:26:00.996577', '9550', '1'), - ('1.99', '10', '2007-04-07T12:42:39.996577', '4255', '1'), - ('0.99', '226', '2007-03-21T21:01:48.996577', '14739', '2'), - ('3.99', '291', '2007-03-23T07:22:52.996577', '15663', '2'), - ('4.99', '483', '2007-04-12T00:10:10.996577', '6478', '2'), - ('2.99', '486', '2007-04-07T19:06:19.996577', '4381', '1'), - ('2.99', '479', '2007-02-18T13:23:56.996577', '2376', '2'), - ('4.99', '523', '2007-03-17T11:12:53.996577', '11827', '1'), - ('6.99', '343', '2007-02-16T01:15:33.996577', '1564', '1'), - ('2.99', '494', '2007-04-06T13:35:21.996577', '3803', '2'), - ('4.99', '561', '2007-03-02T00:20:14.996577', '10907', '1'), - ('4.99', '214', '2007-04-27T15:26:59.996577', '7417', '2'), - ('5.99', '132', '2007-04-10T07:27:29.996577', '5684', '2'), - ('2.99', '383', '2007-02-18T07:42:20.996577', '2318', '2'), - ('0.99', '584', '2007-04-07T20:16:42.996577', '4410', '1'), - ('2.99', '417', '2007-04-30T05:25:54.996577', '9049', '2'), - ('4.99', '214', '2007-02-15T06:24:09.996577', '1275', '2'), - ('2.99', '563', '2007-04-11T17:35:21.996577', '6326', '2'), - ('2.99', '584', '2007-03-18T12:46:56.996577', '12541', '2'), - ('2.99', '518', '2007-04-28T00:37:26.996577', '7657', '1'), - ('4.99', '83', '2007-03-17T08:55:45.996577', '11777', '2'), - ('8.99', '467', '2007-04-29T07:13:12.996577', '8480', '2'), - ('2.99', '490', '2007-04-07T03:41:41.996577', '4083', '1'), - ('2.99', '360', '2007-04-29T03:37:23.996577', '8361', '2'), - ('4.99', '535', '2007-03-20T05:36:03.996577', '13631', '1'), - ('1.99', '327', '2007-04-28T06:27:22.996577', '7808', '2'), - ('8.99', '451', '2007-03-01T03:30:12.996577', '10337', '2'), - ('1.99', '24', '2007-03-19T06:03:19.996577', '12999', '1'), - ('7.99', '113', '2007-03-17T03:39:33.996577', '11655', '2'), - ('8.99', '340', '2007-03-01T15:26:48.996577', '10667', '1'), - ('2.99', '585', '2007-04-27T04:53:32.996577', '7131', '1'), - ('2.99', '220', '2007-04-30T19:15:40.996577', '10099', '1'), - ('4.99', '317', '2007-03-21T23:04:21.996577', '14791', '1'), - ('0.99', '520', '2007-02-15T15:34:02.996577', '1411', '1'), - ('0.99', '481', '2007-04-08T01:59:05.996577', '4532', '1'), - ('4.99', '103', '2007-04-30T18:10:33.996577', '9390', '2'), - ('4.99', '73', '2007-03-18T03:37:03.996577', '12291', '2'), - ('4.99', '134', '2007-04-09T14:37:45.996577', '5315', '1'), - ('2.99', '279', '2007-04-09T11:58:10.996577', '5248', '2'), - ('4.99', '75', '2007-04-27T16:55:52.996577', '7454', '1'), - ('6.99', '265', '2007-03-21T14:31:53.996577', '14556', '2'), - ('3.99', '26', '2007-02-18T15:36:00.996577', '2416', '2'), - ('2.99', '107', '2007-04-11T06:50:31.996577', '6131', '2'), - ('5.99', '233', '2007-04-29T04:07:42.996577', '8385', '2'), - ('8.99', '483', '2007-02-21T12:27:12.996577', '3380', '1'), - ('5.99', '286', '2007-03-20T05:46:01.996577', '13635', '2'), - ('0.99', '407', '2007-04-12T12:22:51.996577', '6727', '1'), - ('3.99', '262', '2007-04-12T12:13:41.996577', '6724', '1'), - ('3.99', '520', '2007-04-10T16:13:39.996577', '5853', '1'), - ('5.99', '520', '2007-03-18T16:08:51.996577', '12628', '1'), - ('2.99', '312', '2007-04-06T11:33:01.996577', '3766', '1'), - ('0.99', '156', '2007-02-18T01:53:22.996577', '2221', '2'), - ('2.99', '212', '2007-04-28T07:09:12.996577', '7828', '2'), - ('4.99', '262', '2007-03-23T11:47:12.996577', '15771', '2'), - ('4.99', '23', '2007-02-20T11:48:24.996577', '3055', '1'), - ('2.99', '140', '2007-04-12T20:58:55.996577', '6918', '1'), - ('1.99', '259', '2007-03-23T04:41:42.996577', '4591', '2'), - ('3.99', '546', '2007-04-30T19:44:46.996577', '4591', '1'), - ('3.99', '182', '2007-04-08T04:58:09.996577', '4591', '2'), - ('1.99', '16', '2007-02-18T03:24:38.996577', '4591', '1'), - ('0.99', '401', '2007-04-12T04:54:36.996577', '4591', '1'), - ('2.99', '288', '2007-04-11T21:07:31.996577', '6399', '1'), - ('1.99', '38', '2007-03-18T00:14:16.996577', '12187', '2'), - ('4.99', '512', '2007-02-17T11:39:25.996577', '2029', '2'), - ('6.99', '51', '2007-04-27T14:35:48.996577', '7398', '1'), - ('9.99', '8', '2007-03-02T11:32:38.996577', '11232', '1'), - ('2.99', '23', '2007-03-21T12:11:11.996577', '14482', '2'), - ('9.99', '120', '2007-04-08T08:33:28.996577', '4666', '2'), - ('9.99', '566', '2007-04-09T03:49:06.996577', '5079', '1'), - ('0.99', '566', '2007-04-06T19:50:43.996577', '3943', '1'), - ('2.99', '400', '2007-03-01T08:48:19.996577', '10484', '2'), - ('6.99', '282', '2007-04-28T22:24:27.996577', '8223', '1'), - ('4.99', '494', '2007-04-09T03:58:58.996577', '5083', '2'), - ('9.99', '5', '2007-03-17T22:38:30.996577', '12145', '1'), - ('2.99', '199', '2007-04-30T07:50:28.996577', '9752', '1'), - ('5.99', '119', '2007-02-21T13:03:17.996577', '3388', '2'), - ('6.99', '515', '2007-03-17T15:17:02.996577', '11937', '2'), - ('0.99', '407', '2007-03-20T11:09:14.996577', '13800', '1'), - ('4.99', '142', '2007-04-29T12:23:37.996577', '8623', '2'), - ('2.99', '66', '2007-02-15T03:02:53.996577', '1236', '1'), - ('0.99', '13', '2007-03-19T23:01:45.996577', '13456', '1'), - ('2.99', '416', '2007-04-29T10:50:46.996577', '8588', '2'), - ('7.99', '124', '2007-04-07T17:12:49.996577', '4341', '1'), - ('2.99', '174', '2007-03-01T04:30:18.996577', '10363', '1'), - ('2.99', '8', '2007-04-09T14:09:12.996577', '5300', '1'), - ('0.99', '323', '2007-04-29T07:05:22.996577', '8474', '2'), - ('4.99', '322', '2007-03-19T12:29:04.996577', '13180', '2'), - ('4.99', '125', '2007-03-17T10:17:54.996577', '11806', '1'), - ('2.99', '171', '2007-02-19T17:16:37.996577', '2788', '2'), - ('2.99', '25', '2007-04-30T16:25:04.996577', '9334', '2'), - ('2.99', '23', '2007-04-11T12:48:44.996577', '6238', '1'), - ('2.99', '463', '2007-02-15T06:55:59.996577', '1284', '1'), - ('0.00', '269', '2007-05-14T13:44:29.996577', '12610', '2'), - ('2.99', '134', '2007-04-27T19:23:54.996577', '7516', '2'), - ('0.99', '52', '2007-02-18T02:22:57.996577', '2232', '2'), - ('7.99', '497', '2007-04-07T10:38:50.996577', '4218', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['25886', '25442', '23270', '19770', '24932', '31501', '19198', '24782', '22723', '26862', '23650', '21186', '23037', '28504', '17583', '29320', '23117', '22896', '30395', '29440', '25603', '21011', '22008', '20258', '30410', '22485', '22003', '30202', '28750', '23773', '23936', '28086', '19379', '22278', '21346', '24436', '28553', '25106', '29270', '28748', '28751', '28446', '18229', '21776', '27596', '29195', '27253', '30787', '30260', '27544', '17639', '28615', '31923', '30161', '22807', '21355', '26933', '21394', '24415', '27925', '30223', '23449', '26788', '24803', '22836', '18082', '24026', '28103', '29187', '25739', '25240', '18259', '19311', '18650', '29455', '19545', '19882', '30347', '19181', '22899', '24933', '23410', '22810', '22437', '25462', '28838', '31102', '18944', '30609', '26500', '30658', '24852', '30164', '28776', '20763', '23938', '29148', '30218', '24179', '23710']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('10.99', '331', '2007-04-07T16:29:48.996577', '4326', '1'), - ('5.99', '292', '2007-04-27T07:21:49.996577', '7199', '2'), - ('2.99', '61', '2007-03-02T16:45:21.996577', '11379', '2'), - ('2.99', '293', '2007-03-17T00:21:46.996577', '11576', '1'), - ('3.99', '243', '2007-03-21T04:53:21.996577', '14272', '1'), - ('4.99', '230', '2007-04-09T02:01:58.996577', '5045', '1'), - ('4.99', '181', '2007-02-21T21:17:25.996577', '3469', '2'), - ('2.99', '226', '2007-03-23T00:07:31.996577', '15472', '2'), - ('4.99', '5', '2007-03-02T09:18:32.996577', '11179', '1'), - ('5.99', '416', '2007-04-29T03:18:48.996577', '8349', '2'), - ('8.99', '103', '2007-03-23T21:11:33.996577', '16048', '2'), - ('4.99', '444', '2007-03-01T10:28:28.996577', '10529', '1'), - ('4.99', '36', '2007-03-20T06:59:20.996577', '13674', '1'), - ('6.99', '566', '2007-04-28T19:35:11.996577', '8157', '1'), - ('4.99', '361', '2007-02-18T11:21:51.996577', '2353', '2'), - ('4.99', '30', '2007-04-28T15:01:21.996577', '8038', '2'), - ('4.99', '45', '2007-03-19T20:33:45.996577', '13394', '2'), - ('0.99', '22', '2007-03-18T23:10:50.996577', '12809', '2'), - ('4.99', '125', '2007-04-06T04:26:32.996577', '3617', '1'), - ('5.99', '40', '2007-04-10T17:08:35.996577', '5869', '1'), - ('2.99', '305', '2007-04-09T02:28:09.996577', '5052', '1'), - ('4.99', '423', '2007-03-16T22:21:36.996577', '11514', '2'), - ('5.99', '530', '2007-03-20T18:21:04.996577', '13998', '1'), - ('8.99', '347', '2007-03-17T07:14:21.996577', '11738', '2'), - ('2.99', '125', '2007-04-30T07:26:11.996577', '9734', '2'), - ('0.99', '582', '2007-03-23T02:37:29.996577', '15539', '1'), - ('4.99', '530', '2007-03-01T09:39:21.996577', '10504', '2'), - ('2.99', '107', '2007-04-10T02:24:16.996577', '5575', '2'), - ('2.99', '587', '2007-04-06T01:23:02.996577', '3562', '2'), - ('2.99', '118', '2007-03-22T03:43:43.996577', '14924', '1'), - ('4.99', '134', '2007-03-02T20:52:57.996577', '11482', '2'), - ('7.99', '526', '2007-04-27T09:57:28.996577', '7270', '2'), - ('6.99', '234', '2007-02-20T21:26:27.996577', '3185', '2'), - ('4.99', '560', '2007-03-17T09:27:44.996577', '11788', '1'), - ('3.99', '459', '2007-03-21T06:25:05.996577', '14315', '1'), - ('4.99', '182', '2007-03-02T05:04:31.996577', '11055', '1'), - ('0.99', '570', '2007-04-30T16:19:49.996577', '10004', '1'), - ('0.99', '262', '2007-03-01T19:14:05.996577', '10770', '2'), - ('0.99', '26', '2007-04-30T22:00:06.996577', '9484', '1'), - ('2.99', '586', '2007-04-30T08:53:47.996577', '9786', '2'), - ('0.99', '587', '2007-04-06T21:16:25.996577', '3969', '2'), - ('0.99', '561', '2007-04-12T07:25:56.996577', '6621', '1'), - ('3.99', '532', '2007-02-19T18:55:18.996577', '2821', '2'), - ('4.99', '504', '2007-03-22T07:21:04.996577', '15018', '2'), - ('4.99', '483', '2007-04-28T01:12:33.996577', '7669', '1'), - ('0.99', '19', '2007-04-30T12:57:55.996577', '9256', '1'), - ('3.99', '452', '2007-04-06T05:36:43.996577', '3638', '2'), - ('8.99', '158', '2007-04-07T05:26:40.996577', '4117', '1'), - ('3.99', '112', '2007-04-30T13:16:27.996577', '9911', '2'), - ('8.99', '479', '2007-04-07T08:56:59.996577', '4183', '2'), - ('3.99', '377', '2007-02-19T01:35:58.996577', '2556', '2'), - ('4.99', '576', '2007-04-06T16:50:36.996577', '3877', '1'), - ('0.99', '282', '2007-05-14T13:44:29.996577', '15430', '2'), - ('5.99', '103', '2007-04-12T02:45:41.996577', '6525', '1'), - ('6.99', '14', '2007-03-01T10:23:59.996577', '10526', '2'), - ('0.99', '460', '2007-03-19T01:07:16.996577', '12865', '1'), - ('4.99', '423', '2007-04-27T05:48:54.996577', '7157', '1'), - ('4.99', '463', '2007-03-20T15:53:11.996577', '13938', '2'), - ('4.99', '180', '2007-03-20T12:58:03.996577', '13842', '2'), - ('5.99', '512', '2007-04-08T12:43:46.996577', '4752', '1'), - ('5.99', '108', '2007-04-29T02:34:59.996577', '8329', '2'), - ('5.99', '80', '2007-03-02T06:36:50.996577', '11101', '2'), - ('4.99', '409', '2007-04-11T00:50:09.996577', '6026', '2'), - ('5.99', '230', '2007-03-02T08:15:34.996577', '11148', '2'), - ('2.99', '16', '2007-03-17T21:21:26.996577', '12104', '2'), - ('4.99', '491', '2007-02-18T14:01:56.996577', '2391', '2'), - ('0.99', '142', '2007-03-20T09:22:15.996577', '13745', '2'), - ('8.99', '527', '2007-04-27T18:57:00.996577', '7506', '1'), - ('0.99', '18', '2007-04-12T17:49:11.996577', '6846', '1'), - ('2.99', '317', '2007-04-29T02:29:18.996577', '8327', '1'), - ('2.99', '275', '2007-04-29T17:31:41.996577', '8746', '1'), - ('2.99', '540', '2007-02-19T07:54:39.996577', '2640', '2'), - ('2.99', '214', '2007-02-17T15:59:22.996577', '2085', '2'), - ('4.99', '35', '2007-02-20T16:21:56.996577', '3112', '2'), - ('1.99', '41', '2007-04-27T19:25:33.996577', '7517', '1'), - ('2.99', '269', '2007-03-20T09:53:14.996577', '13759', '2'), - ('0.99', '304', '2007-03-20T19:38:58.996577', '14023', '1'), - ('4.99', '120', '2007-04-26T23:29:00.996577', '6989', '1'), - ('0.99', '177', '2007-02-16T14:35:53.996577', '1738', '1'), - ('6.99', '22', '2007-03-21T14:53:09.996577', '14564', '1'), - ('1.99', '243', '2007-03-21T15:35:34.996577', '14581', '2'), - ('0.99', '75', '2007-03-18T17:39:07.996577', '12662', '1'), - ('2.99', '14', '2007-03-18T17:45:13.996577', '12668', '1'), - ('4.99', '577', '2007-03-18T17:39:20.996577', '12664', '1'), - ('4.99', '294', '2007-04-06T23:56:10.996577', '4019', '2'), - ('6.99', '593', '2007-04-30T16:11:04.996577', '9329', '2'), - ('4.99', '185', '2007-04-27T02:22:18.996577', '7066', '1'), - ('6.99', '113', '2007-02-20T19:49:41.996577', '3162', '1'), - ('2.99', '142', '2007-04-30T08:24:23.996577', '9131', '1'), - ('3.99', '383', '2007-04-27T13:34:11.996577', '7367', '1'), - ('0.99', '146', '2007-04-26T23:31:12.996577', '6990', '1'), - ('0.99', '235', '2007-03-19T23:28:02.996577', '13469', '1'), - ('0.99', '103', '2007-04-27T11:29:21.996577', '7310', '1'), - ('4.99', '589', '2007-04-11T09:22:15.996577', '6177', '2'), - ('4.99', '399', '2007-03-02T15:11:18.996577', '11329', '1'), - ('2.99', '134', '2007-03-19T05:40:10.996577', '12987', '2'), - ('6.99', '14', '2007-04-28T14:51:27.996577', '8035', '1'), - ('0.99', '108', '2007-04-08T12:48:27.996577', '4754', '1'), - ('0.99', '155', '2007-03-22T03:17:10.996577', '14909', '2'), - ('2.99', '112', '2007-03-02T03:57:57.996577', '11019', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['22176', '18012', '20862', '24635', '18081', '22281', '31527', '27755', '25305', '29091', '30758', '26034', '24065', '21895', '21879', '28165', '18842', '18980', '19052', '19647', '24508', '20013', '25304', '24419', '18583', '19610', '24124', '29677', '28398', '30088', '24665', '24248', '25622', '21489', '19080', '26345', '23998', '18058', '24781', '23185', '18516', '29952', '26137', '24340', '23997', '22495', '28502', '21668', '28729', '19132', '22674', '28702', '19994', '23235', '28753', '19993', '27376', '23789', '23716', '24111', '28775', '19502', '27408', '18351', '17922', '23775', '28503', '29539', '27436', '30155', '21800', '23078', '21279', '28277', '27404', '19013', '29014', '30371', '19874', '19340', '18046', '31715', '30158', '25624', '26841', '22701', '26956', '29326', '21292', '24727', '25978', '22902', '30399', '18951', '24759', '17890', '18548', '22926', '30321', '31391']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('4.99', '549', '2007-03-17T07:10:34.996577', '11737', '2'), - ('4.99', '471', '2007-02-15T17:42:17.996577', '1447', '1'), - ('8.99', '409', '2007-03-19T20:31:48.996577', '13392', '1'), - ('8.99', '210', '2007-03-18T08:13:59.996577', '12410', '2'), - ('4.99', '491', '2007-02-18T04:06:11.996577', '2259', '1'), - ('4.99', '560', '2007-03-21T07:48:29.996577', '14363', '2'), - ('5.99', '232', '2007-04-27T04:37:14.996577', '7123', '1'), - ('0.99', '497', '2007-04-08T15:01:20.996577', '4795', '2'), - ('4.99', '282', '2007-04-07T20:25:19.996577', '4412', '2'), - ('0.99', '9', '2007-04-27T22:43:52.996577', '7616', '2'), - ('7.99', '155', '2007-04-30T08:41:28.996577', '9781', '2'), - ('2.99', '343', '2007-04-30T07:36:29.996577', '9739', '2'), - ('2.99', '146', '2007-03-02T11:00:38.996577', '11221', '1'), - ('3.99', '518', '2007-03-02T18:41:36.996577', '11433', '2'), - ('4.99', '515', '2007-03-22T17:24:18.996577', '15274', '2'), - ('2.99', '532', '2007-04-27T21:12:55.996577', '7572', '2'), - ('2.99', '87', '2007-02-18T15:19:10.996577', '2408', '2'), - ('1.99', '122', '2007-02-19T20:10:12.996577', '2834', '2'), - ('0.99', '143', '2007-02-19T02:52:18.996577', '2574', '1'), - ('5.99', '278', '2007-03-02T06:31:46.996577', '11095', '1'), - ('4.99', '190', '2007-03-02T12:57:12.996577', '11276', '2'), - ('0.99', '320', '2007-03-21T01:29:08.996577', '14171', '2'), - ('2.99', '282', '2007-04-07T17:58:46.996577', '4359', '1'), - ('4.99', '180', '2007-03-22T08:06:20.996577', '15039', '1'), - ('2.99', '24', '2007-02-16T13:07:57.996577', '1716', '1'), - ('2.99', '275', '2007-03-20T13:23:35.996577', '13860', '2'), - ('0.99', '150', '2007-03-19T02:10:34.996577', '12890', '2'), - ('4.99', '63', '2007-04-08T04:44:52.996577', '4587', '1'), - ('0.99', '557', '2007-04-12T20:07:30.996577', '6898', '2'), - ('5.99', '98', '2007-04-29T02:24:31.996577', '8324', '1'), - ('4.99', '212', '2007-03-23T14:55:50.996577', '15872', '1'), - ('1.99', '162', '2007-03-21T05:48:14.996577', '14301', '2'), - ('4.99', '306', '2007-04-30T18:35:32.996577', '9395', '2'), - ('4.99', '472', '2007-03-18T21:35:27.996577', '12763', '2'), - ('6.99', '149', '2007-02-17T09:46:11.996577', '1996', '2'), - ('4.99', '369', '2007-04-30T04:35:20.996577', '9032', '2'), - ('6.99', '140', '2007-03-01T03:39:37.996577', '10342', '1'), - ('0.99', '483', '2007-02-19T22:37:04.996577', '2867', '2'), - ('4.99', '226', '2007-03-22T04:15:41.996577', '14934', '2'), - ('2.99', '52', '2007-03-21T23:47:03.996577', '14820', '2'), - ('2.99', '5', '2007-02-19T02:48:39.996577', '2570', '2'), - ('4.99', '87', '2007-04-10T08:18:08.996577', '5700', '2'), - ('6.99', '352', '2007-04-27T19:09:06.996577', '7512', '2'), - ('3.99', '172', '2007-03-23T20:42:57.996577', '16038', '2'), - ('0.99', '139', '2007-03-23T10:40:31.996577', '15743', '1'), - ('6.99', '584', '2007-03-16T21:29:48.996577', '11500', '2'), - ('0.99', '566', '2007-04-28T11:15:46.996577', '7941', '2'), - ('4.99', '493', '2007-03-22T14:03:15.996577', '15177', '2'), - ('5.99', '584', '2007-04-30T06:53:39.996577', '9719', '1'), - ('4.99', '164', '2007-02-16T12:56:59.996577', '1713', '2'), - ('6.99', '207', '2007-03-17T21:25:05.996577', '12108', '2'), - ('2.99', '582', '2007-04-27T21:22:18.996577', '7575', '1'), - ('4.99', '317', '2007-03-19T20:15:15.996577', '13388', '1'), - ('9.99', '57', '2007-03-20T15:42:14.996577', '13929', '2'), - ('0.99', '587', '2007-04-12T08:29:10.996577', '6639', '1'), - ('2.99', '317', '2007-03-18T04:04:46.996577', '12301', '2'), - ('6.99', '463', '2007-04-26T21:36:30.996577', '6932', '1'), - ('3.99', '119', '2007-03-22T11:34:52.996577', '15131', '2'), - ('5.99', '112', '2007-03-20T20:37:21.996577', '14049', '2'), - ('0.99', '149', '2007-03-02T02:30:42.996577', '10967', '2'), - ('0.99', '589', '2007-04-10T21:42:55.996577', '5951', '1'), - ('7.99', '265', '2007-02-17T11:35:22.996577', '2027', '2'), - ('2.99', '467', '2007-04-28T22:27:28.996577', '8224', '2'), - ('1.99', '568', '2007-02-21T20:21:18.996577', '3462', '2'), - ('6.99', '451', '2007-02-17T06:10:48.996577', '1940', '1'), - ('3.99', '119', '2007-03-01T04:38:03.996577', '10366', '1'), - ('2.99', '566', '2007-04-28T17:50:48.996577', '8118', '2'), - ('2.99', '49', '2007-04-09T22:38:11.996577', '5491', '1'), - ('6.99', '469', '2007-04-27T02:20:27.996577', '7062', '2'), - ('4.99', '103', '2007-04-06T15:19:47.996577', '3850', '1'), - ('6.99', '507', '2007-03-17T20:17:40.996577', '12071', '2'), - ('5.99', '40', '2007-03-20T12:51:46.996577', '13840', '1'), - ('0.99', '452', '2007-03-21T18:11:47.996577', '14660', '1'), - ('2.99', '543', '2007-04-29T10:28:53.996577', '8580', '1'), - ('5.99', '467', '2007-04-27T21:14:46.996577', '7573', '2'), - ('0.99', '132', '2007-02-18T13:47:15.996577', '2384', '1'), - ('10.99', '2', '2007-04-30T12:16:09.996577', '9236', '2'), - ('2.99', '122', '2007-04-27T09:51:21.996577', '7267', '1'), - ('2.99', '303', '2007-03-18T10:28:10.996577', '12473', '2'), - ('5.99', '223', '2007-02-16T21:50:48.996577', '1839', '2'), - ('3.99', '479', '2007-02-17T15:01:43.996577', '2071', '2'), - ('2.99', '247', '2007-04-08T23:26:12.996577', '4995', '2'), - ('1.99', '103', '2007-04-07T17:53:05.996577', '4357', '1'), - ('6.99', '306', '2007-04-30T23:11:44.996577', '10202', '1'), - ('2.99', '414', '2007-04-28T05:39:37.996577', '7779', '1'), - ('4.99', '2', '2007-03-23T16:08:01.996577', '15907', '2'), - ('4.99', '425', '2007-04-06T13:40:10.996577', '3807', '1'), - ('2.99', '30', '2007-04-30T16:09:01.996577', '9998', '1'), - ('0.99', '454', '2007-03-18T13:15:20.996577', '12553', '1'), - ('4.99', '219', '2007-03-22T17:44:30.996577', '15283', '1'), - ('4.99', '338', '2007-04-08T14:22:07.996577', '4779', '2'), - ('4.99', '22', '2007-03-23T07:17:09.996577', '15658', '1'), - ('6.99', '125', '2007-04-11T14:24:00.996577', '6268', '2'), - ('6.99', '115', '2007-02-21T05:10:14.996577', '3289', '1'), - ('2.99', '223', '2007-03-23T07:21:16.996577', '15662', '1'), - ('3.99', '444', '2007-02-15T14:53:52.996577', '1397', '2'), - ('2.99', '13', '2007-02-20T04:55:23.996577', '2952', '1'), - ('4.99', '25', '2007-03-21T02:06:53.996577', '14193', '1'), - ('0.99', '118', '2007-04-11T20:09:42.996577', '6377', '1'), - ('7.99', '220', '2007-04-30T17:54:01.996577', '9384', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['27477', '24064', '28613', '25891', '29951', '17997', '26277', '18241', '30578', '20556', '26303', '20455', '19197', '22244', '28081', '19752', '23922', '28251', '28724', '21204', '23484', '28464', '23771', '29927', '22895', '21344', '28965', '19886', '23648', '25372', '28108', '23995', '27031', '19492', '30853', '23846', '18750', '31952', '23302', '21359', '24000', '27693', '21492', '28049', '23917', '29094', '28735', '21541', '19546', '26869', '22863', '27759', '18308', '20025', '29220', '22029', '31562', '24189', '30405', '26299', '31665', '20939', '31423', '22288', '24116', '28257', '31569', '30764', '22798', '24583', '26244', '23999', '30085', '18441', '31221', '18586', '21466', '24680', '29546', '27870', '25761', '22864', '25213', '29375', '31668', '29039', '19630', '27029', '21392', '22980', '20860', '26001', '29143', '21015', '29376', '20267', '22572', '27427', '23113', '28365']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('6.99', '472', '2007-04-30T13:40:17.996577', '9926', '2'), - ('7.99', '146', '2007-03-02T08:56:26.996577', '11173', '2'), - ('4.99', '575', '2007-04-30T03:07:45.996577', '8989', '2'), - ('4.99', '331', '2007-04-30T03:21:37.996577', '8995', '2'), - ('3.99', '87', '2007-04-10T04:25:06.996577', '5628', '1'), - ('8.99', '467', '2007-02-16T14:28:10.996577', '1737', '1'), - ('4.99', '364', '2007-04-06T20:40:09.996577', '3961', '2'), - ('4.99', '535', '2007-02-16T12:53:35.996577', '1712', '1'), - ('0.99', '139', '2007-04-12T12:50:34.996577', '6740', '2'), - ('0.99', '377', '2007-03-23T18:58:22.996577', '15995', '1'), - ('0.99', '366', '2007-04-12T17:36:21.996577', '6842', '1'), - ('8.99', '368', '2007-03-19T12:55:42.996577', '13189', '2'), - ('5.99', '181', '2007-02-21T19:29:53.996577', '3449', '2'), - ('2.99', '556', '2007-03-21T01:37:49.996577', '14176', '1'), - ('3.99', '526', '2007-04-09T05:46:57.996577', '5121', '2'), - ('6.99', '290', '2007-03-17T01:22:21.996577', '11596', '1'), - ('0.99', '132', '2007-03-17T10:29:20.996577', '11812', '2'), - ('2.99', '540', '2007-04-11T05:28:21.996577', '6103', '1'), - ('2.99', '584', '2007-04-27T06:54:38.996577', '7186', '1'), - ('4.99', '445', '2007-03-17T12:34:00.996577', '11868', '1'), - ('5.99', '83', '2007-03-19T05:36:31.996577', '12985', '2'), - ('2.99', '563', '2007-04-08T10:35:24.996577', '4711', '2'), - ('5.99', '118', '2007-03-21T08:51:36.996577', '14394', '2'), - ('8.99', '84', '2007-04-29T13:32:53.996577', '8654', '1'), - ('2.99', '22', '2007-03-17T21:51:12.996577', '12124', '1'), - ('10.99', '459', '2007-03-20T16:44:52.996577', '13960', '2'), - ('2.99', '207', '2007-04-06T02:45:09.996577', '3584', '2'), - ('4.99', '305', '2007-03-02T01:04:10.996577', '10929', '2'), - ('5.99', '103', '2007-03-23T04:53:33.996577', '15599', '1'), - ('0.99', '286', '2007-04-29T04:48:44.996577', '8399', '2'), - ('9.99', '528', '2007-04-07T02:03:59.996577', '4050', '2'), - ('9.99', '139', '2007-03-22T15:27:31.996577', '15218', '1'), - ('4.99', '432', '2007-04-10T23:31:40.996577', '5990', '1'), - ('2.99', '262', '2007-02-16T01:14:54.996577', '1563', '1'), - ('3.99', '164', '2007-04-26T23:18:56.996577', '6980', '1'), - ('6.99', '125', '2007-03-19T22:16:49.996577', '13441', '2'), - ('3.99', '62', '2007-02-21T07:33:16.996577', '3327', '1'), - ('4.99', '394', '2007-05-14T13:44:29.996577', '13178', '2'), - ('5.99', '65', '2007-03-02T06:36:26.996577', '11100', '2'), - ('0.99', '460', '2007-03-22T01:25:32.996577', '14864', '2'), - ('4.99', '140', '2007-03-17T20:48:27.996577', '12086', '1'), - ('3.99', '491', '2007-04-27T00:48:52.996577', '7019', '2'), - ('4.99', '472', '2007-03-21T16:07:03.996577', '14596', '2'), - ('2.99', '523', '2007-04-09T07:15:20.996577', '5155', '2'), - ('4.99', '132', '2007-03-01T00:47:12.996577', '10243', '2'), - ('3.99', '10', '2007-04-06T12:42:11.996577', '3790', '2'), - ('4.99', '585', '2007-04-10T21:42:11.996577', '5950', '2'), - ('2.99', '477', '2007-03-23T16:51:56.996577', '15929', '1'), - ('4.99', '269', '2007-03-21T04:49:17.996577', '14266', '1'), - ('6.99', '417', '2007-04-11T13:52:58.996577', '6258', '2'), - ('0.99', '19', '2007-03-23T02:15:13.996577', '15529', '2'), - ('2.99', '497', '2007-04-28T13:55:05.996577', '8011', '2'), - ('0.99', '557', '2007-02-16T08:45:45.996577', '1666', '1'), - ('9.99', '322', '2007-03-20T06:17:32.996577', '13650', '1'), - ('4.99', '22', '2007-04-27T03:10:34.996577', '7087', '1'), - ('4.99', '532', '2007-03-20T14:50:06.996577', '13908', '1'), - ('4.99', '235', '2007-04-11T23:49:29.996577', '6466', '2'), - ('0.99', '156', '2007-03-22T03:22:01.996577', '14914', '1'), - ('4.99', '125', '2007-04-29T21:06:15.996577', '8832', '1'), - ('6.99', '366', '2007-04-11T05:56:31.996577', '6112', '1'), - ('0.99', '243', '2007-04-09T23:02:41.996577', '5502', '1'), - ('4.99', '416', '2007-03-23T00:03:38.996577', '15470', '2'), - ('7.99', '223', '2007-04-30T17:44:05.996577', '10053', '2'), - ('2.99', '561', '2007-03-02T17:35:47.996577', '11402', '2'), - ('2.99', '149', '2007-03-23T03:32:59.996577', '15562', '2'), - ('2.99', '540', '2007-04-30T09:59:17.996577', '9815', '2'), - ('0.99', '235', '2007-04-30T21:00:09.996577', '10155', '2'), - ('6.99', '156', '2007-04-12T03:19:39.996577', '6540', '2'), - ('5.99', '13', '2007-03-17T08:13:25.996577', '11761', '2'), - ('2.99', '198', '2007-03-17T15:40:52.996577', '11949', '2'), - ('1.99', '361', '2007-04-30T20:43:39.996577', '10145', '1'), - ('3.99', '140', '2007-03-02T18:33:02.996577', '11430', '2'), - ('2.99', '98', '2007-04-26T22:15:57.996577', '6951', '2'), - ('6.99', '592', '2007-02-14T21:41:12.996577', '1163', '2'), - ('4.99', '198', '2007-04-12T16:49:27.996577', '6819', '1'), - ('5.99', '24', '2007-02-18T17:56:28.996577', '2451', '1'), - ('2.99', '470', '2007-03-17T05:59:21.996577', '11711', '2'), - ('0.99', '214', '2007-03-20T03:07:18.996577', '13565', '1'), - ('10.99', '49', '2007-04-29T09:44:02.996577', '8553', '2'), - ('2.99', '507', '2007-04-08T19:13:17.996577', '4901', '2'), - ('0.99', '319', '2007-04-30T05:03:47.996577', '9044', '2'), - ('4.99', '20', '2007-03-01T02:01:45.996577', '10284', '2'), - ('8.99', '273', '2007-04-12T05:48:01.996577', '6592', '1'), - ('5.99', '35', '2007-04-10T19:54:57.996577', '5916', '1'), - ('2.99', '243', '2007-04-27T00:59:41.996577', '7022', '2'), - ('4.99', '5', '2007-04-09T00:26:23.996577', '5016', '1'), - ('3.99', '276', '2007-03-23T11:44:41.996577', '15769', '1'), - ('6.99', '432', '2007-04-09T14:56:39.996577', '5322', '1'), - ('6.99', '463', '2007-03-18T18:10:37.996577', '12679', '2'), - ('2.99', '30', '2007-03-18T12:58:03.996577', '12546', '1'), - ('6.99', '408', '2007-03-23T11:34:45.996577', '15765', '1'), - ('2.99', '340', '2007-04-27T22:47:06.996577', '7617', '2'), - ('0.99', '14', '2007-04-08T21:28:33.996577', '4952', '1'), - ('0.99', '423', '2007-03-22T20:56:41.996577', '15380', '1'), - ('0.99', '35', '2007-04-10T22:15:34.996577', '5963', '1'), - ('2.99', '348', '2007-03-02T02:36:51.996577', '10972', '2'), - ('2.99', '593', '2007-03-18T20:51:02.996577', '12744', '2'), - ('3.99', '469', '2007-04-07T03:02:49.996577', '4067', '2'), - ('2.99', '45', '2007-03-02T20:56:48.996577', '11483', '2'), - ('4.99', '553', '2007-04-06T19:50:00.996577', '3942', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['29920', '28626', '28474', '20942', '28660', '19038', '31377', '25591', '23628', '26213', '28394', '30066', '30646', '21667', '21260', '21987', '18080', '30642', '24641', '25433', '26276', '23649', '22696', '21451', '21920', '26733', '26280', '29373', '29141', '18442', '19576', '18393', '28505', '31863', '19729', '17665', '27933', '26283', '17930', '25388', '26839', '18382', '18339', '26238', '27878', '26698', '22527', '21775', '22528', '25368', '18707', '29730', '21801', '19273', '23275', '21190', '26005', '30632', '18284', '26498', '21919', '18941', '31969', '26965', '24325', '25741', '28966', '25178', '22296', '23304', '24441', '24379', '31420', '19889', '18199', '18646', '23115', '25392', '20429', '28485', '31328', '30068', '19017', '18479', '27283', '30572', '26858', '26670', '18912', '24025', '26332', '18709', '21201', '26614', '30390', '28429', '25457', '24690', '22100', '28461']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('5.99', '84', '2007-04-09T10:30:49.996577', '5221', '1'), - ('8.99', '576', '2007-04-30T02:47:44.996577', '9620', '2'), - ('6.99', '563', '2007-04-29T12:39:51.996577', '8632', '2'), - ('0.99', '417', '2007-03-01T08:37:32.996577', '10478', '1'), - ('2.99', '579', '2007-04-27T08:06:01.996577', '7221', '2'), - ('0.99', '139', '2007-02-19T09:16:08.996577', '2659', '1'), - ('5.99', '219', '2007-04-28T03:20:45.996577', '7726', '1'), - ('4.99', '304', '2007-04-10T09:08:58.996577', '5712', '1'), - ('2.99', '101', '2007-03-17T23:37:19.996577', '12174', '2'), - ('0.99', '359', '2007-04-12T12:52:42.996577', '6741', '2'), - ('1.99', '557', '2007-04-08T17:08:31.996577', '4851', '1'), - ('6.99', '96', '2007-04-29T05:52:09.996577', '8437', '1'), - ('0.99', '145', '2007-04-11T20:13:49.996577', '6378', '2'), - ('4.99', '493', '2007-03-20T23:40:25.996577', '14117', '1'), - ('6.99', '451', '2007-03-02T08:44:17.996577', '11167', '2'), - ('2.99', '528', '2007-03-20T01:04:43.996577', '13518', '2'), - ('4.99', '491', '2007-02-17T11:34:04.996577', '2026', '2'), - ('2.99', '145', '2007-04-07T22:49:23.996577', '4470', '1'), - ('4.99', '210', '2007-03-22T02:07:55.996577', '14876', '2'), - ('5.99', '291', '2007-04-30T11:10:47.996577', '9201', '2'), - ('4.99', '364', '2007-04-06T07:43:41.996577', '3678', '1'), - ('0.99', '103', '2007-03-23T07:55:55.996577', '15679', '2'), - ('2.99', '2', '2007-03-17T02:20:44.996577', '11614', '1'), - ('2.99', '469', '2007-03-01T18:21:18.996577', '10741', '1'), - ('0.99', '520', '2007-03-21T13:08:24.996577', '14509', '1'), - ('1.99', '405', '2007-04-09T23:34:04.996577', '5512', '2'), - ('10.99', '364', '2007-04-10T17:22:31.996577', '5872', '1'), - ('2.99', '35', '2007-04-09T00:15:11.996577', '5013', '1'), - ('4.99', '13', '2007-04-30T16:17:17.996577', '10003', '1'), - ('5.99', '592', '2007-02-15T16:36:38.996577', '1423', '2'), - ('3.99', '273', '2007-03-01T18:37:50.996577', '10753', '1'), - ('4.99', '578', '2007-02-19T05:57:39.996577', '2615', '2'), - ('2.99', '566', '2007-04-28T23:31:46.996577', '8257', '1'), - ('4.99', '262', '2007-04-26T23:27:31.996577', '6986', '1'), - ('9.99', '288', '2007-03-02T00:59:41.996577', '10927', '1'), - ('4.99', '382', '2007-02-18T18:52:18.996577', '2468', '1'), - ('2.99', '512', '2007-04-30T05:41:33.996577', '9055', '1'), - ('0.99', '364', '2007-04-30T18:56:35.996577', '10092', '1'), - ('0.99', '452', '2007-02-18T04:26:13.996577', '2263', '1'), - ('2.99', '288', '2007-04-08T09:35:32.996577', '4692', '1'), - ('0.99', '414', '2007-04-12T17:49:07.996577', '6845', '2'), - ('4.99', '576', '2007-02-15T12:49:26.996577', '1366', '1'), - ('5.99', '565', '2007-02-18T08:11:08.996577', '2321', '1'), - ('4.99', '361', '2007-04-12T17:07:25.996577', '6829', '2'), - ('2.99', '507', '2007-04-30T02:40:58.996577', '8976', '2'), - ('3.99', '402', '2007-04-11T15:15:58.996577', '6283', '1'), - ('2.99', '587', '2007-03-22T19:42:12.996577', '15348', '2'), - ('5.99', '504', '2007-03-20T13:22:09.996577', '13859', '2'), - ('0.99', '587', '2007-03-22T19:42:17.996577', '15349', '2'), - ('2.99', '286', '2007-04-27T11:18:22.996577', '7299', '1'), - ('1.99', '51', '2007-02-15T13:16:30.996577', '1373', '2'), - ('2.99', '66', '2007-04-28T08:46:42.996577', '7872', '1'), - ('4.99', '507', '2007-03-18T03:10:28.996577', '12275', '2'), - ('0.99', '198', '2007-02-17T23:40:48.996577', '2185', '2'), - ('1.99', '61', '2007-03-23T08:04:00.996577', '15681', '1'), - ('4.99', '444', '2007-03-17T06:40:52.996577', '11728', '1'), - ('4.99', '340', '2007-04-29T11:42:50.996577', '8606', '1'), - ('5.99', '144', '2007-04-29T06:34:06.996577', '8459', '2'), - ('2.99', '549', '2007-02-17T13:35:56.996577', '2050', '1'), - ('0.99', '383', '2007-04-11T13:22:04.996577', '6244', '2'), - ('4.99', '520', '2007-03-21T08:08:16.996577', '14372', '1'), - ('2.99', '113', '2007-02-19T16:57:36.996577', '2783', '1'), - ('3.98', '457', '2007-05-14T13:44:29.996577', '12645', '1'), - ('2.99', '425', '2007-04-11T17:16:48.996577', '6318', '2'), - ('1.99', '171', '2007-03-21T04:50:44.996577', '14270', '1'), - ('2.99', '317', '2007-04-30T07:34:08.996577', '9110', '1'), - ('9.99', '207', '2007-04-06T08:06:59.996577', '3687', '2'), - ('0.99', '269', '2007-04-08T15:25:56.996577', '4804', '2'), - ('2.99', '562', '2007-03-19T14:22:59.996577', '13225', '2'), - ('4.99', '65', '2007-03-02T20:03:26.996577', '11461', '2'), - ('5.99', '182', '2007-03-21T15:47:35.996577', '14586', '1'), - ('2.99', '177', '2007-03-01T15:16:57.996577', '10661', '1'), - ('2.99', '223', '2007-04-10T23:46:59.996577', '5996', '2'), - ('3.99', '305', '2007-03-17T10:20:05.996577', '11809', '2'), - ('8.99', '523', '2007-02-18T17:39:21.996577', '2447', '1'), - ('2.99', '35', '2007-02-17T09:15:50.996577', '1989', '1'), - ('2.99', '45', '2007-03-17T06:37:26.996577', '11725', '1'), - ('0.99', '288', '2007-04-28T04:06:46.996577', '7744', '2'), - ('4.99', '366', '2007-03-01T05:07:40.996577', '10384', '1'), - ('0.99', '565', '2007-04-05T21:17:50.996577', '3470', '2'), - ('4.99', '213', '2007-04-30T21:35:48.996577', '9477', '1'), - ('4.99', '96', '2007-04-30T15:33:55.996577', '9315', '1'), - ('3.99', '133', '2007-02-15T22:46:05.996577', '1522', '2'), - ('7.99', '204', '2007-02-17T02:47:14.996577', '1894', '2'), - ('0.99', '454', '2007-04-29T20:05:00.996577', '8806', '1'), - ('2.99', '139', '2007-04-08T08:27:44.996577', '4663', '2'), - ('2.99', '416', '2007-04-11T04:50:09.996577', '6097', '1'), - ('6.99', '400', '2007-04-08T04:07:12.996577', '4573', '1'), - ('6.99', '107', '2007-02-19T11:40:13.996577', '2693', '2'), - ('0.99', '142', '2007-03-19T07:42:57.996577', '13044', '1'), - ('4.99', '368', '2007-04-27T21:12:08.996577', '7571', '2'), - ('4.99', '52', '2007-02-15T00:06:57.996577', '1196', '1'), - ('0.99', '445', '2007-03-01T03:38:28.996577', '10341', '2'), - ('2.99', '394', '2007-04-06T22:57:21.996577', '4009', '2'), - ('2.99', '124', '2007-04-11T21:39:16.996577', '6411', '1'), - ('2.99', '559', '2007-04-30T20:46:22.996577', '10146', '2'), - ('4.99', '293', '2007-04-27T22:34:19.996577', '7607', '2'), - ('0.99', '215', '2007-03-21T00:00:43.996577', '14126', '2'), - ('8.99', '540', '2007-03-17T19:36:07.996577', '12058', '2'), - ('0.99', '563', '2007-04-07T21:20:30.996577', '4436', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['18057', '29066', '27686', '18055', '30575', '22345', '29446', '28460', '21981', '24413', '19871', '22482', '27271', '26765', '24594', '18335', '18876', '27236', '20933', '28496', '28160', '22900', '22734', '19493', '24320', '25890', '28815', '21475', '21459', '25461', '18215', '24582', '23555', '18649', '24182', '22801', '25743', '28508', '26903', '30175', '18482', '19695', '28397', '23722', '28739', '22422', '23088', '28663', '24430', '30869', '29130', '31922', '21649', '29723', '29537', '21676', '29015', '29006', '30269', '24050', '19104', '26971', '27550', '21979', '30587', '29462', '22103', '24850', '17961', '26216', '29507', '19305', '22862', '26771', '21200', '20618', '20018', '19149', '25210', '19047', '25268', '26236', '22486', '19275', '18401', '30404', '29953', '22330', '24733', '27730', '25593', '28529', '18889', '19733', '23772', '27722', '31533', '19446', '18212', '28387']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('4.99', '483', '2007-02-19T21:40:15.996577', '2855', '1'), - ('8.99', '7', '2007-04-09T20:20:31.996577', '5441', '1'), - ('4.99', '490', '2007-04-30T07:25:02.996577', '9108', '2'), - ('2.99', '482', '2007-02-20T11:18:21.996577', '3048', '2'), - ('6.99', '139', '2007-04-09T17:54:48.996577', '5390', '1'), - ('2.99', '566', '2007-03-21T05:42:12.996577', '14297', '1'), - ('4.99', '40', '2007-04-30T05:58:25.996577', '9700', '2'), - ('1.99', '563', '2007-04-07T05:02:01.996577', '4106', '1'), - ('6.99', '527', '2007-03-21T07:34:55.996577', '14352', '1'), - ('8.99', '180', '2007-03-18T04:35:57.996577', '12313', '1'), - ('2.99', '303', '2007-03-17T16:56:15.996577', '11993', '2'), - ('0.99', '582', '2007-03-21T14:59:14.996577', '14568', '1'), - ('4.99', '453', '2007-04-12T13:21:41.996577', '6752', '1'), - ('4.99', '407', '2007-04-28T17:36:10.996577', '8109', '1'), - ('4.99', '199', '2007-03-01T10:10:23.996577', '10517', '2'), - ('4.99', '563', '2007-02-15T23:59:49.996577', '1545', '2'), - ('0.99', '96', '2007-02-15T17:05:30.996577', '1437', '2'), - ('3.99', '449', '2007-04-28T06:20:39.996577', '7803', '2'), - ('5.99', '416', '2007-03-02T04:37:46.996577', '11047', '2'), - ('4.99', '566', '2007-04-06T06:44:13.996577', '3663', '2'), - ('2.99', '532', '2007-04-10T18:14:13.996577', '5887', '1'), - ('7.99', '22', '2007-03-22T11:46:51.996577', '15134', '1'), - ('2.99', '6', '2007-03-02T04:05:04.996577', '11023', '1'), - ('6.99', '262', '2007-02-19T16:23:14.996577', '2771', '1'), - ('4.99', '171', '2007-03-18T15:12:50.996577', '12600', '1'), - ('0.99', '331', '2007-04-28T22:43:03.996577', '8231', '1'), - ('1.99', '592', '2007-04-07T06:05:29.996577', '4129', '1'), - ('3.99', '471', '2007-03-01T21:44:36.996577', '10828', '2'), - ('2.99', '469', '2007-03-21T18:12:47.996577', '14661', '2'), - ('4.99', '294', '2007-04-06T07:47:56.996577', '3681', '1'), - ('2.99', '527', '2007-02-15T14:57:08.996577', '1398', '1'), - ('4.99', '198', '2007-03-17T11:32:02.996577', '11836', '1'), - ('0.99', '91', '2007-03-02T18:13:59.996577', '11418', '2'), - ('2.99', '35', '2007-02-19T14:44:22.996577', '2743', '1'), - ('2.99', '156', '2007-03-02T21:04:26.996577', '11490', '2'), - ('0.99', '13', '2007-03-19T13:54:14.996577', '13213', '2'), - ('8.99', '317', '2007-04-30T08:21:06.996577', '9770', '1'), - ('0.99', '566', '2007-04-29T15:54:29.996577', '8710', '1'), - ('4.99', '420', '2007-04-12T05:26:06.996577', '6588', '1'), - ('2.99', '104', '2007-04-27T03:50:30.996577', '7107', '2'), - ('2.99', '205', '2007-02-15T03:17:34.996577', '1238', '1'), - ('4.99', '284', '2007-03-01T10:49:39.996577', '10535', '1'), - ('4.99', '557', '2007-04-12T16:52:57.996577', '6823', '2'), - ('0.99', '113', '2007-03-01T04:58:30.996577', '10378', '1'), - ('4.99', '585', '2007-04-27T15:06:50.996577', '7409', '2'), - ('4.99', '575', '2007-03-23T11:02:07.996577', '15749', '2'), - ('4.99', '41', '2007-03-23T14:37:06.996577', '15860', '2'), - ('0.99', '579', '2007-04-30T03:21:49.996577', '8996', '1'), - ('4.99', '181', '2007-03-19T10:08:24.996577', '13118', '2'), - ('2.99', '166', '2007-04-06T03:56:28.996577', '3606', '2'), - ('8.99', '13', '2007-04-11T06:11:34.996577', '6118', '1'), - ('4.99', '279', '2007-05-14T13:44:29.996577', '13538', '2'), - ('6.99', '490', '2007-03-21T21:58:54.996577', '14761', '2'), - ('6.99', '66', '2007-04-07T07:51:53.996577', '4165', '2'), - ('4.99', '49', '2007-04-06T02:04:45.996577', '3575', '2'), - ('0.99', '494', '2007-03-19T09:16:24.996577', '13094', '2'), - ('0.99', '2', '2007-04-30T12:42:37.996577', '9248', '2'), - ('6.99', '2', '2007-04-10T11:07:22.996577', '5755', '1'), - ('0.99', '113', '2007-04-12T17:26:31.996577', '6836', '1'), - ('2.99', '144', '2007-03-20T13:47:21.996577', '13881', '2'), - ('4.99', '155', '2007-02-21T14:26:51.996577', '3405', '2'), - ('0.99', '425', '2007-04-30T19:53:19.996577', '10121', '1'), - ('8.99', '479', '2007-04-12T17:57:45.996577', '6849', '2'), - ('7.99', '527', '2007-03-17T22:19:56.996577', '12136', '1'), - ('4.99', '140', '2007-04-27T06:26:52.996577', '7170', '1'), - ('2.99', '41', '2007-04-30T17:55:28.996577', '10064', '1'), - ('0.99', '540', '2007-03-22T03:19:18.996577', '14910', '2'), - ('4.99', '235', '2007-03-18T11:44:57.996577', '12502', '1'), - ('7.99', '457', '2007-02-17T22:34:42.996577', '2172', '1'), - ('4.99', '359', '2007-04-28T20:05:18.996577', '8174', '1'), - ('2.99', '45', '2007-04-10T23:56:15.996577', '6002', '2'), - ('6.99', '213', '2007-02-19T02:47:30.996577', '2569', '2'), - ('2.99', '19', '2007-03-22T08:25:42.996577', '15047', '1'), - ('0.99', '408', '2007-04-11T02:40:24.996577', '6062', '1'), - ('1.99', '445', '2007-03-01T03:27:08.996577', '10334', '2'), - ('6.99', '383', '2007-03-23T15:12:51.996577', '15881', '1'), - ('4.99', '321', '2007-03-18T07:41:50.996577', '12398', '1'), - ('0.99', '171', '2007-02-16T09:34:35.996577', '1676', '2'), - ('7.99', '273', '2007-04-09T12:24:11.996577', '5256', '1'), - ('1.99', '142', '2007-02-15T05:57:56.996577', '1268', '1'), - ('4.99', '278', '2007-04-12T18:40:32.996577', '6869', '2'), - ('2.99', '361', '2007-04-09T07:14:44.996577', '5154', '2'), - ('4.99', '582', '2007-03-23T16:13:19.996577', '15911', '2'), - ('2.99', '199', '2007-02-17T03:39:53.996577', '1910', '1'), - ('4.99', '581', '2007-02-17T19:46:54.996577', '2137', '1'), - ('2.99', '125', '2007-04-29T05:47:42.996577', '8433', '1'), - ('4.99', '87', '2007-04-12T08:26:28.996577', '6638', '1'), - ('5.99', '565', '2007-03-18T20:50:57.996577', '12743', '2'), - ('2.99', '220', '2007-03-17T15:36:39.996577', '11947', '2'), - ('2.99', '494', '2007-04-30T09:26:58.996577', '9799', '1'), - ('0.99', '304', '2007-04-10T13:04:55.996577', '5795', '2'), - ('2.99', '568', '2007-04-27T02:26:16.996577', '7068', '2'), - ('4.99', '98', '2007-02-21T14:16:14.996577', '3399', '2'), - ('0.99', '288', '2007-03-19T14:34:04.996577', '13227', '1'), - ('7.99', '118', '2007-03-21T16:03:43.996577', '14595', '2'), - ('3.99', '494', '2007-04-27T09:34:20.996577', '7258', '2'), - ('4.99', '232', '2007-04-29T04:53:34.996577', '8401', '2'), - ('0.99', '252', '2007-02-20T06:10:13.996577', '2968', '1'), - ('2.99', '526', '2007-02-19T19:19:59.996577', '2828', '1'), - ('3.99', '556', '2007-04-08T16:41:36.996577', '4839', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['30259', '28759', '22669', '18360', '19643', '31857', '20857', '19105', '18216', '21399', '21474', '26968', '22761', '21567', '30333', '27978', '27982', '18785', '27992', '21948', '21564', '29767', '25337', '29589', '21462', '24051', '26963', '24784', '27778', '27760', '21286', '22938', '26934', '18536', '27247', '23778', '30832', '28452', '25141', '21582', '31052', '27980', '25451', '30584', '30217', '30302', '27307', '31286', '30583', '17944', '23714', '25309', '25107', '25788', '21877', '29921', '29918', '21674', '32001', '31534', '24659', '28937', '21836', '28273', '21708', '30231', '29822', '17772', '31073', '30219', '27405', '24443', '23602', '18402', '18806', '25777', '19712', '28627', '28817', '19234', '28777', '30292', '19303', '28969', '19101', '19066', '28547', '18108', '23712', '24110', '27525', '27190', '27532', '22430', '23839', '23800', '23171', '26612', '18926', '29915']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('5.99', '112', '2007-04-30T10:27:31.996577', '9830', '1'), - ('5.99', '587', '2007-04-30T13:12:00.996577', '9909', '2'), - ('0.99', '207', '2007-03-01T02:36:37.996577', '10300', '2'), - ('2.99', '570', '2007-02-20T18:12:11.996577', '3138', '2'), - ('5.99', '277', '2007-03-22T19:34:16.996577', '15345', '1'), - ('0.99', '262', '2007-04-09T23:04:03.996577', '5503', '2'), - ('4.99', '408', '2007-03-21T20:50:59.996577', '14733', '2'), - ('9.99', '156', '2007-02-17T16:13:35.996577', '2089', '2'), - ('0.99', '527', '2007-02-18T15:57:23.996577', '2422', '1'), - ('8.99', '464', '2007-03-20T06:14:56.996577', '13644', '1'), - ('2.99', '471', '2007-03-01T07:05:32.996577', '10430', '1'), - ('0.99', '425', '2007-04-30T02:37:42.996577', '8974', '1'), - ('0.99', '8', '2007-03-20T23:35:37.996577', '14114', '1'), - ('4.99', '481', '2007-03-17T13:22:19.996577', '11885', '1'), - ('7.99', '119', '2007-04-11T03:35:40.996577', '6079', '1'), - ('3.99', '517', '2007-04-28T13:05:44.996577', '7988', '2'), - ('4.99', '518', '2007-04-08T08:23:32.996577', '4661', '2'), - ('4.99', '75', '2007-02-17T04:28:49.996577', '1920', '1'), - ('2.99', '518', '2007-04-29T04:38:01.996577', '8397', '1'), - ('4.99', '523', '2007-03-21T22:10:46.996577', '14766', '1'), - ('0.99', '481', '2007-03-02T10:29:56.996577', '11207', '2'), - ('2.99', '70', '2007-04-29T17:36:23.996577', '8747', '1'), - ('7.99', '284', '2007-04-08T20:44:44.996577', '4931', '2'), - ('3.99', '52', '2007-04-30T07:46:59.996577', '9749', '2'), - ('2.99', '469', '2007-03-23T14:14:59.996577', '15851', '1'), - ('2.99', '144', '2007-03-21T01:14:24.996577', '14159', '2'), - ('2.99', '425', '2007-04-09T16:47:15.996577', '5363', '2'), - ('2.99', '226', '2007-03-23T18:49:03.996577', '15986', '1'), - ('0.99', '498', '2007-04-30T04:02:50.996577', '9021', '2'), - ('6.99', '497', '2007-04-28T19:19:07.996577', '8150', '1'), - ('5.99', '453', '2007-03-21T06:01:01.996577', '14306', '2'), - ('1.99', '26', '2007-03-21T16:19:32.996577', '14603', '2'), - ('0.99', '423', '2007-04-27T10:57:11.996577', '7290', '1'), - ('0.99', '10', '2007-02-19T22:29:21.996577', '2865', '1'), - ('2.99', '451', '2007-04-08T02:24:55.996577', '4538', '1'), - ('2.99', '119', '2007-03-02T16:45:13.996577', '11377', '2'), - ('4.99', '162', '2007-04-30T09:59:03.996577', '9167', '2'), - ('4.99', '562', '2007-04-08T15:23:43.996577', '4802', '1'), - ('4.99', '265', '2007-03-21T00:00:42.996577', '14125', '2'), - ('4.99', '482', '2007-03-22T06:20:57.996577', '14995', '2'), - ('6.99', '181', '2007-04-06T16:03:48.996577', '3862', '1'), - ('0.99', '518', '2007-04-06T06:12:56.996577', '3652', '1'), - ('3.99', '293', '2007-04-06T18:04:21.996577', '3906', '1'), - ('9.99', '140', '2007-04-11T21:30:45.996577', '6407', '1'), - ('4.99', '108', '2007-04-08T08:00:34.996577', '4650', '1'), - ('0.99', '115', '2007-04-30T01:22:57.996577', '9578', '2'), - ('4.99', '457', '2007-04-29T03:48:19.996577', '8373', '2'), - ('0.99', '210', '2007-04-10T21:52:28.996577', '5957', '2'), - ('4.99', '140', '2007-04-11T15:24:01.996577', '6286', '1'), - ('9.99', '454', '2007-02-19T09:45:38.996577', '2666', '2'), - ('8.99', '112', '2007-03-20T04:49:08.996577', '13611', '2'), - ('2.99', '282', '2007-04-27T16:00:46.996577', '7433', '1'), - ('2.99', '262', '2007-03-19T23:23:42.996577', '13466', '2'), - ('0.99', '322', '2007-04-12T10:19:22.996577', '6673', '2'), - ('3.99', '515', '2007-03-21T08:18:28.996577', '14378', '2'), - ('0.99', '84', '2007-04-09T11:25:24.996577', '5237', '1'), - ('6.99', '84', '2007-04-07T03:34:53.996577', '4079', '2'), - ('3.99', '494', '2007-03-02T08:22:02.996577', '11152', '2'), - ('0.00', '576', '2007-05-14T13:44:29.996577', '13464', '1'), - ('4.99', '232', '2007-04-29T13:33:08.996577', '8655', '2'), - ('0.99', '212', '2007-03-01T11:44:27.996577', '10567', '2'), - ('6.99', '204', '2007-04-12T11:07:49.996577', '6694', '1'), - ('4.99', '512', '2007-03-21T05:26:00.996577', '14288', '1'), - ('2.99', '543', '2007-04-08T18:27:40.996577', '4887', '1'), - ('0.99', '498', '2007-03-01T00:07:06.996577', '10225', '1'), - ('0.99', '109', '2007-04-27T05:29:26.996577', '7145', '2'), - ('3.99', '75', '2007-04-11T04:19:57.996577', '6092', '1'), - ('2.99', '408', '2007-02-19T02:09:36.996577', '2564', '1'), - ('0.99', '182', '2007-04-28T08:34:12.996577', '7863', '2'), - ('6.99', '108', '2007-04-09T13:02:35.996577', '5274', '2'), - ('2.99', '467', '2007-04-27T22:40:13.996577', '7611', '1'), - ('1.99', '182', '2007-03-22T08:17:58.996577', '15043', '1'), - ('4.99', '96', '2007-03-23T18:53:02.996577', '15989', '2'), - ('2.99', '582', '2007-02-16T13:24:19.996577', '1719', '1'), - ('2.99', '80', '2007-02-19T04:16:52.996577', '2596', '1'), - ('2.99', '321', '2007-04-09T09:22:14.996577', '5202', '2'), - ('0.99', '286', '2007-03-17T04:17:25.996577', '11670', '2'), - ('0.99', '576', '2007-04-30T14:39:02.996577', '9962', '2'), - ('0.99', '592', '2007-04-07T22:18:40.996577', '4460', '1'), - ('2.99', '190', '2007-02-15T09:07:31.996577', '1319', '1'), - ('3.99', '589', '2007-04-11T13:28:31.996577', '6247', '2'), - ('4.99', '115', '2007-04-09T11:52:40.996577', '5245', '1'), - ('5.99', '213', '2007-02-18T08:12:47.996577', '2322', '1'), - ('0.99', '207', '2007-04-08T15:42:40.996577', '4816', '1'), - ('7.99', '155', '2007-02-16T00:45:13.996577', '1554', '1'), - ('2.99', '146', '2007-02-18T10:11:06.996577', '2342', '1'), - ('4.99', '570', '2007-04-27T06:29:02.996577', '7174', '2'), - ('0.99', '498', '2007-02-21T10:41:07.996577', '3360', '2'), - ('4.99', '112', '2007-03-17T03:49:11.996577', '11659', '2'), - ('7.99', '149', '2007-03-01T17:59:50.996577', '10737', '2'), - ('5.99', '477', '2007-04-07T11:45:21.996577', '4237', '2'), - ('0.99', '445', '2007-04-29T23:59:23.996577', '8911', '2'), - ('5.99', '477', '2007-04-29T20:46:38.996577', '8821', '1'), - ('0.99', '576', '2007-03-21T14:02:58.996577', '14541', '1'), - ('2.99', '125', '2007-03-01T16:53:17.996577', '10699', '1'), - ('4.99', '120', '2007-03-21T04:02:35.996577', '14246', '1'), - ('2.99', '51', '2007-03-19T17:22:52.996577', '13302', '1'), - ('0.99', '394', '2007-04-06T00:29:34.996577', '3543', '2'), - ('5.99', '109', '2007-02-19T10:40:56.996577', '2679', '2'), - ('0.99', '83', '2007-04-28T03:11:24.996577', '7721', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['18297', '23288', '20929', '17643', '19997', '30334', '17529', '24176', '24676', '23383', '18015', '23505', '21397', '26790', '29577', '20705', '27554', '27304', '30005', '17756', '30006', '23174', '27175', '21835', '19301', '27845', '29069', '25275', '20607', '28780', '24779', '26041', '26970', '27698', '26327', '30654', '21566', '21581', '18340', '21188', '30937', '27445', '19641', '20274', '20190', '24063', '28191', '30268', '22242', '29248', '25607', '29229', '22566', '28363', '21868', '21887', '23273', '31096', '22932', '27466', '28421', '30019', '30090', '23654', '22602', '29102', '30253', '32061', '30004', '23701', '30013', '28092', '17585', '21189', '20230', '24589', '25455', '18943', '29242', '25792', '18018', '23797', '26695', '21402', '30059', '18596', '19671', '18599', '29084', '28250', '24666', '26774', '21537', '24836', '18989', '29012', '29549', '24270', '30208', '27840']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('6.99', '553', '2007-02-20T15:26:45.996577', '3103', '2'), - ('0.99', '63', '2007-03-18T12:07:52.996577', '12515', '2'), - ('3.99', '416', '2007-03-01T01:10:29.996577', '10254', '1'), - ('4.99', '377', '2007-02-21T18:47:26.996577', '3443', '2'), - ('2.99', '317', '2007-03-21T18:22:32.996577', '14669', '2'), - ('0.99', '119', '2007-04-11T17:44:08.996577', '6330', '2'), - ('8.99', '347', '2007-02-16T12:40:18.996577', '1711', '2'), - ('8.99', '155', '2007-03-21T06:39:22.996577', '14324', '1'), - ('4.99', '214', '2007-03-18T10:00:00.996577', '12463', '2'), - ('4.99', '73', '2007-03-02T15:50:15.996577', '11349', '2'), - ('4.99', '471', '2007-02-18T10:53:55.996577', '2350', '2'), - ('3.99', '85', '2007-03-20T08:37:19.996577', '13727', '1'), - ('7.99', '463', '2007-03-22T12:51:37.996577', '15151', '2'), - ('2.99', '409', '2007-04-28T01:22:19.996577', '7673', '2'), - ('0.99', '51', '2007-04-29T22:45:21.996577', '8880', '1'), - ('5.99', '392', '2007-03-21T03:20:17.996577', '14223', '1'), - ('8.99', '479', '2007-04-30T20:06:38.996577', '9439', '1'), - ('0.99', '457', '2007-04-09T22:56:43.996577', '5500', '1'), - ('4.99', '91', '2007-04-07T12:16:59.996577', '4245', '1'), - ('4.99', '405', '2007-02-15T08:51:34.996577', '1315', '2'), - ('4.99', '91', '2007-04-07T16:21:04.996577', '4321', '1'), - ('6.99', '51', '2007-03-21T03:18:07.996577', '14221', '2'), - ('4.99', '444', '2007-04-05T22:30:34.996577', '3498', '2'), - ('0.99', '512', '2007-03-20T10:15:47.996577', '13771', '2'), - ('0.99', '213', '2007-02-15T20:10:04.996577', '1489', '1'), - ('1.99', '504', '2007-04-28T08:52:14.996577', '7875', '2'), - ('2.99', '7', '2007-04-11T15:59:24.996577', '6295', '1'), - ('7.99', '279', '2007-04-08T22:50:28.996577', '4978', '1'), - ('5.99', '382', '2007-03-21T07:36:40.996577', '14354', '2'), - ('9.99', '589', '2007-04-28T11:34:42.996577', '7948', '2'), - ('0.99', '226', '2007-03-21T19:51:22.996577', '14712', '1'), - ('2.99', '345', '2007-04-07T20:38:11.996577', '4422', '2'), - ('2.99', '425', '2007-04-30T05:15:36.996577', '9682', '2'), - ('4.99', '491', '2007-04-30T22:11:30.996577', '10178', '2'), - ('0.99', '368', '2007-04-08T04:39:28.996577', '4584', '1'), - ('4.99', '146', '2007-04-08T23:44:39.996577', '5000', '2'), - ('4.99', '481', '2007-03-17T07:39:21.996577', '11752', '1'), - ('6.99', '482', '2007-03-22T02:39:28.996577', '14891', '2'), - ('5.99', '565', '2007-02-21T05:53:27.996577', '3300', '1'), - ('0.99', '444', '2007-03-02T16:03:11.996577', '11353', '2'), - ('2.99', '171', '2007-04-06T10:38:58.996577', '3745', '2'), - ('4.99', '470', '2007-04-06T19:00:53.996577', '3922', '1'), - ('4.99', '277', '2007-03-21T21:21:27.996577', '14745', '2'), - ('5.99', '348', '2007-03-20T04:30:28.996577', '13602', '2'), - ('0.99', '340', '2007-03-02T03:16:26.996577', '10995', '1'), - ('6.99', '145', '2007-03-21T08:43:46.996577', '14389', '2'), - ('6.99', '535', '2007-04-08T19:59:19.996577', '4914', '2'), - ('0.99', '113', '2007-04-11T00:46:39.996577', '6025', '1'), - ('3.99', '556', '2007-03-17T10:11:11.996577', '11804', '2'), - ('2.99', '25', '2007-04-07T20:00:19.996577', '4404', '2'), - ('0.99', '305', '2007-04-12T07:19:14.996577', '6619', '2'), - ('5.99', '23', '2007-04-12T20:58:41.996577', '6917', '2'), - ('2.99', '592', '2007-03-19T11:40:54.996577', '13157', '1'), - ('4.99', '553', '2007-04-06T17:26:41.996577', '3890', '1'), - ('0.99', '515', '2007-03-01T17:22:14.996577', '10716', '2'), - ('4.99', '517', '2007-03-01T04:18:33.996577', '10358', '2'), - ('0.99', '61', '2007-03-20T12:26:25.996577', '13830', '1'), - ('9.99', '185', '2007-04-07T09:00:51.996577', '4186', '1'), - ('2.99', '26', '2007-03-02T14:32:34.996577', '11314', '2'), - ('2.99', '471', '2007-04-30T06:28:45.996577', '9077', '1'), - ('1.99', '559', '2007-04-09T18:11:18.996577', '5396', '2'), - ('2.99', '91', '2007-04-30T12:05:23.996577', '9228', '2'), - ('5.99', '98', '2007-04-29T20:42:30.996577', '8818', '2'), - ('1.99', '104', '2007-03-19T06:30:50.996577', '13017', '1'), - ('2.99', '597', '2007-03-02T11:02:53.996577', '11223', '2'), - ('6.99', '10', '2007-04-28T13:39:21.996577', '8001', '2'), - ('2.99', '112', '2007-04-12T03:31:40.996577', '6550', '2'), - ('0.99', '162', '2007-05-14T13:44:29.996577', '14220', '1'), - ('2.99', '91', '2007-04-07T04:53:54.996577', '4103', '2'), - ('4.99', '111', '2007-03-02T01:56:47.996577', '10952', '1'), - ('2.99', '91', '2007-04-12T18:22:43.996577', '6860', '2'), - ('4.99', '526', '2007-04-28T22:43:03.996577', '8232', '1'), - ('2.99', '361', '2007-02-19T21:35:29.996577', '2851', '1'), - ('6.99', '444', '2007-03-02T18:15:04.996577', '11419', '2'), - ('3.99', '343', '2007-03-20T01:12:32.996577', '13522', '2'), - ('5.99', '198', '2007-03-21T02:59:15.996577', '14214', '1'), - ('3.99', '293', '2007-04-10T11:31:28.996577', '5765', '2'), - ('8.99', '113', '2007-02-20T16:56:45.996577', '3124', '1'), - ('1.99', '24', '2007-04-27T09:50:43.996577', '7266', '1'), - ('7.99', '322', '2007-04-30T07:18:21.996577', '9104', '1'), - ('6.99', '472', '2007-02-16T17:15:24.996577', '1776', '2'), - ('7.99', '120', '2007-03-19T19:59:57.996577', '13375', '2'), - ('3.99', '402', '2007-04-08T05:27:09.996577', '4604', '2'), - ('0.99', '464', '2007-03-23T14:26:31.996577', '15854', '2'), - ('2.99', '96', '2007-04-06T09:35:23.996577', '3720', '1'), - ('9.99', '26', '2007-02-17T16:42:34.996577', '2093', '1'), - ('4.99', '280', '2007-03-02T16:29:51.996577', '11366', '1'), - ('4.99', '26', '2007-02-18T23:56:12.996577', '2532', '1'), - ('0.99', '8', '2007-04-30T20:36:55.996577', '10141', '2'), - ('4.99', '540', '2007-04-08T23:17:29.996577', '4991', '2'), - ('2.99', '212', '2007-03-23T16:33:36.996577', '15920', '2'), - ('4.99', '408', '2007-04-27T02:07:20.996577', '7053', '1'), - ('4.99', '477', '2007-03-18T08:30:16.996577', '12420', '2'), - ('0.99', '234', '2007-03-01T10:53:20.996577', '10541', '2'), - ('7.99', '125', '2007-02-19T19:10:01.996577', '2826', '1'), - ('5.99', '2', '2007-04-29T15:42:55.996577', '8705', '2'), - ('4.99', '49', '2007-04-30T20:42:18.996577', '10144', '1'), - ('4.99', '166', '2007-03-19T05:06:44.996577', '12968', '1'), - ('4.99', '107', '2007-04-27T16:30:34.996577', '7447', '2'), - ('0.99', '504', '2007-04-08T13:05:17.996577', '4757', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['24126', '21700', '19782', '31243', '26957', '31549', '25882', '19926', '28370', '28902', '28331', '24042', '22650', '19620', '23600', '27687', '29165', '26898', '29391', '31751', '29173', '22744', '21663', '21211', '21803', '19297', '22234', '29377', '23169', '23595', '29572', '19763', '18180', '22338', '17797', '22732', '25889', '18698', '21481', '25220', '20241', '19372', '30877', '21912', '21988', '18887', '18394', '25794', '18190', '23642', '20192', '29576', '24671', '19156', '29988', '25111', '21576', '21967', '22455', '29144', '30332', '31324', '25615', '25765', '21771', '27398', '19758', '32069', '21395', '21273', '26696', '18684', '29798', '28139', '20392', '26080', '21295', '28113', '25984', '17805', '20388', '25269', '29728', '27976', '25763', '19925', '19674', '23164', '30249', '18587', '30162', '26344', '22332', '23112', '30319', '20260', '20437', '24429', '31901', '30498']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('8.99', '150', '2007-03-19T15:22:38.996577', '13255', '2'), - ('7.99', '497', '2007-03-01T18:53:46.996577', '10760', '2'), - ('4.99', '294', '2007-03-01T14:13:37.996577', '10642', '2'), - ('2.99', '199', '2007-04-30T23:03:17.996577', '10196', '1'), - ('2.99', '425', '2007-04-07T18:01:49.996577', '4361', '2'), - ('2.99', '233', '2007-04-29T08:54:40.996577', '8530', '2'), - ('4.99', '331', '2007-04-06T04:14:19.996577', '3613', '1'), - ('4.99', '308', '2007-03-23T00:49:19.996577', '15493', '2'), - ('2.99', '553', '2007-04-11T03:13:25.996577', '6069', '1'), - ('4.99', '598', '2007-04-30T17:44:18.996577', '10054', '1'), - ('0.99', '549', '2007-04-30T12:28:58.996577', '9887', '2'), - ('2.99', '144', '2007-03-02T11:23:49.996577', '11228', '1'), - ('11.99', '204', '2007-03-22T22:17:22.996577', '15415', '2'), - ('0.99', '276', '2007-03-01T16:38:19.996577', '10691', '2'), - ('4.99', '96', '2007-03-20T13:17:21.996577', '13855', '1'), - ('0.99', '490', '2007-04-30T00:35:15.996577', '9554', '1'), - ('2.99', '16', '2007-04-07T10:39:48.996577', '4219', '2'), - ('4.99', '420', '2007-04-09T07:48:27.996577', '5168', '1'), - ('6.99', '36', '2007-04-27T07:34:39.996577', '7205', '1'), - ('0.99', '252', '2007-04-07T18:37:27.996577', '4372', '2'), - ('5.99', '16', '2007-04-30T02:22:31.996577', '9610', '2'), - ('0.99', '6', '2007-03-23T05:09:58.996577', '15603', '2'), - ('6.99', '493', '2007-03-01T19:32:16.996577', '10777', '1'), - ('3.99', '445', '2007-03-22T11:17:10.996577', '15123', '1'), - ('4.99', '507', '2007-03-21T17:02:47.996577', '14625', '2'), - ('0.99', '212', '2007-02-15T11:45:27.996577', '1356', '1'), - ('4.99', '555', '2007-03-17T20:51:16.996577', '12091', '2'), - ('5.99', '35', '2007-04-11T07:41:34.996577', '6147', '1'), - ('4.99', '51', '2007-03-18T20:11:35.996577', '12725', '1'), - ('4.99', '96', '2007-03-17T12:30:27.996577', '11864', '2'), - ('5.99', '51', '2007-04-27T07:41:52.996577', '7207', '1'), - ('4.99', '292', '2007-03-02T09:59:59.996577', '11193', '1'), - ('8.99', '517', '2007-02-16T19:28:46.996577', '1809', '1'), - ('2.99', '566', '2007-03-02T07:37:10.996577', '11129', '2'), - ('0.99', '416', '2007-02-16T16:40:43.996577', '1771', '2'), - ('0.99', '5', '2007-03-22T16:05:28.996577', '15232', '2'), - ('5.99', '331', '2007-04-10T21:36:08.996577', '5947', '1'), - ('0.99', '49', '2007-02-14T21:44:52.996577', '1164', '1'), - ('5.99', '471', '2007-03-21T06:29:06.996577', '14317', '1'), - ('0.99', '273', '2007-04-30T18:17:07.996577', '9391', '2'), - ('2.99', '345', '2007-03-17T12:32:12.996577', '11865', '1'), - ('4.99', '233', '2007-02-18T17:20:56.996577', '2443', '2'), - ('0.99', '166', '2007-04-11T12:47:38.996577', '6237', '2'), - ('4.99', '520', '2007-03-18T12:08:46.996577', '12517', '1'), - ('7.99', '528', '2007-03-20T04:28:51.996577', '13600', '1'), - ('0.99', '98', '2007-02-18T17:30:37.996577', '2445', '1'), - ('2.99', '578', '2007-02-21T06:15:23.996577', '3305', '1'), - ('1.99', '322', '2007-04-30T12:48:25.996577', '9252', '1'), - ('6.99', '520', '2007-02-17T22:37:27.996577', '2174', '2'), - ('0.99', '103', '2007-03-20T07:01:47.996577', '13676', '1'), - ('1.99', '340', '2007-03-19T02:47:31.996577', '12908', '2'), - ('0.99', '51', '2007-04-29T15:12:39.996577', '8693', '1'), - ('6.99', '213', '2007-03-21T21:13:47.996577', '14744', '1'), - ('0.99', '172', '2007-02-15T20:53:52.996577', '1507', '2'), - ('0.99', '89', '2007-04-30T08:15:15.996577', '9767', '2'), - ('6.99', '262', '2007-03-22T00:14:24.996577', '14834', '2'), - ('2.99', '482', '2007-03-01T22:06:05.996577', '10839', '2'), - ('0.99', '526', '2007-03-20T03:52:00.996577', '13580', '2'), - ('1.99', '579', '2007-03-21T14:07:27.996577', '14543', '1'), - ('0.99', '14', '2007-04-09T05:05:33.996577', '5104', '1'), - ('0.99', '119', '2007-04-09T12:51:09.996577', '5268', '1'), - ('2.99', '213', '2007-04-29T06:04:39.996577', '8444', '2'), - ('4.99', '306', '2007-04-26T22:21:13.996577', '6953', '1'), - ('4.99', '320', '2007-04-27T02:18:29.996577', '7057', '2'), - ('1.99', '504', '2007-03-18T21:55:06.996577', '12769', '1'), - ('0.99', '467', '2007-04-07T10:30:00.996577', '4216', '1'), - ('4.99', '291', '2007-03-01T08:08:09.996577', '10463', '1'), - ('2.99', '181', '2007-05-14T13:44:29.996577', '13008', '2'), - ('0.99', '463', '2007-03-21T19:01:26.996577', '14689', '1'), - ('4.99', '452', '2007-03-17T06:09:21.996577', '11715', '2'), - ('4.99', '402', '2007-04-09T15:18:12.996577', '5329', '2'), - ('3.99', '45', '2007-02-21T13:39:28.996577', '3391', '1'), - ('4.99', '73', '2007-04-09T00:38:07.996577', '5021', '2'), - ('3.99', '530', '2007-04-30T23:29:42.996577', '10211', '2'), - ('0.99', '361', '2007-03-21T09:50:12.996577', '14422', '1'), - ('4.99', '347', '2007-04-30T03:47:46.996577', '9013', '1'), - ('8.99', '454', '2007-03-20T07:41:49.996577', '13694', '2'), - ('4.99', '528', '2007-04-28T17:39:33.996577', '8112', '2'), - ('7.99', '338', '2007-04-30T22:01:06.996577', '9485', '1'), - ('0.99', '420', '2007-02-19T13:30:46.996577', '2726', '1'), - ('5.99', '361', '2007-03-18T16:05:11.996577', '12626', '2'), - ('0.99', '278', '2007-04-27T08:48:53.996577', '7239', '1'), - ('3.99', '66', '2007-04-11T21:14:36.996577', '6402', '1'), - ('4.99', '517', '2007-04-12T05:54:09.996577', '6594', '2'), - ('4.99', '320', '2007-04-06T11:09:04.996577', '3756', '2'), - ('4.99', '308', '2007-03-22T16:16:54.996577', '15243', '1'), - ('5.99', '280', '2007-03-19T00:34:03.996577', '12849', '1'), - ('0.99', '51', '2007-03-01T23:41:01.996577', '10894', '1'), - ('0.99', '111', '2007-04-30T13:53:12.996577', '9933', '2'), - ('7.99', '24', '2007-02-20T06:01:35.996577', '2963', '2'), - ('6.99', '103', '2007-04-12T11:13:23.996577', '6697', '2'), - ('2.99', '369', '2007-04-29T20:58:42.996577', '8826', '2'), - ('4.99', '565', '2007-03-19T14:07:05.996577', '13217', '2'), - ('4.99', '45', '2007-03-02T04:19:36.996577', '11029', '1'), - ('0.99', '118', '2007-04-08T22:15:51.996577', '4966', '1'), - ('10.99', '347', '2007-03-18T07:42:08.996577', '12399', '2'), - ('4.99', '366', '2007-03-21T05:31:25.996577', '14290', '1'), - ('2.99', '181', '2007-03-19T04:06:51.996577', '12939', '2'), - ('2.99', '265', '2007-04-28T02:30:39.996577', '7704', '1'), - ('2.99', '133', '2007-04-08T03:47:16.996577', '4566', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['23022', '29955', '28110', '27714', '29100', '30851', '23847', '28245', '27338', '27036', '21299', '29083', '24777', '29085', '19885', '29628', '22492', '31418', '18072', '26488', '30647', '22763', '29985', '18988', '17934', '27261', '18594', '18034', '23769', '30938', '28828', '31005', '24731', '23526', '21202', '28211', '30397', '30849', '25289', '18183', '27546', '19180', '18191', '29384', '21590', '23305', '28018', '32051', '28381', '31070', '27667', '27389', '22215', '24658', '24634', '30761', '31547', '25216', '24968', '29721', '31924', '25255', '22447', '22858', '19780', '24440', '21328', '20839', '21400', '27255', '25371', '25609', '27716', '17670', '22277', '26493', '19734', '31043', '29183', '19054', '25871', '24380', '24673', '27552', '20771', '18878', '24664', '29074', '27666', '20852', '23686', '29983', '30273', '29645', '31339', '31453', '21357', '24385', '19055', '24514']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('7.99', '35', '2007-03-02T19:28:18.996577', '11452', '1'), - ('7.99', '87', '2007-04-28T21:02:19.996577', '8187', '2'), - ('3.99', '528', '2007-04-09T10:16:24.996577', '5215', '2'), - ('0.99', '494', '2007-04-05T23:10:27.996577', '3511', '1'), - ('2.99', '10', '2007-04-10T19:09:35.996577', '5905', '1'), - ('4.99', '164', '2007-04-12T08:26:05.996577', '6637', '1'), - ('2.99', '125', '2007-03-21T11:06:35.996577', '14456', '2'), - ('5.99', '539', '2007-04-29T17:55:13.996577', '8761', '2'), - ('7.99', '460', '2007-04-07T22:00:20.996577', '4452', '1'), - ('4.99', '432', '2007-04-30T13:23:18.996577', '9916', '2'), - ('4.99', '454', '2007-03-22T07:10:58.996577', '15012', '2'), - ('2.99', '8', '2007-04-30T03:23:09.996577', '9629', '2'), - ('6.99', '226', '2007-03-21T12:24:05.996577', '14491', '1'), - ('2.99', '9', '2007-04-07T22:05:26.996577', '4454', '1'), - ('4.99', '305', '2007-03-01T06:54:34.996577', '10426', '2'), - ('1.99', '57', '2007-04-12T01:11:17.996577', '6494', '1'), - ('4.99', '584', '2007-03-02T00:33:09.996577', '10914', '1'), - ('0.99', '223', '2007-04-06T08:46:25.996577', '3705', '1'), - ('5.99', '488', '2007-02-16T12:14:22.996577', '1704', '2'), - ('4.99', '382', '2007-04-08T23:49:16.996577', '5004', '1'), - ('2.99', '145', '2007-04-27T02:19:36.996577', '7061', '2'), - ('2.99', '8', '2007-03-23T11:33:36.996577', '15764', '1'), - ('0.99', '89', '2007-04-30T02:34:51.996577', '8972', '2'), - ('3.99', '125', '2007-02-18T11:25:32.996577', '2355', '1'), - ('5.99', '453', '2007-02-19T21:37:16.996577', '2852', '2'), - ('0.99', '452', '2007-04-09T22:17:33.996577', '5480', '2'), - ('5.99', '26', '2007-02-15T17:21:40.996577', '1440', '1'), - ('2.99', '477', '2007-02-17T23:45:53.996577', '2187', '1'), - ('2.99', '118', '2007-03-18T12:37:35.996577', '12538', '2'), - ('5.99', '171', '2007-04-10T06:14:38.996577', '5660', '1'), - ('2.99', '593', '2007-04-06T00:20:08.996577', '3542', '2'), - ('2.99', '177', '2007-04-11T15:20:05.996577', '6284', '1'), - ('3.99', '220', '2007-03-02T08:22:45.996577', '11153', '1'), - ('10.99', '87', '2007-03-20T19:42:24.996577', '14024', '2'), - ('9.99', '445', '2007-03-02T01:23:30.996577', '10936', '2'), - ('0.99', '537', '2007-04-06T01:14:01.996577', '3555', '1'), - ('7.99', '125', '2007-04-10T00:16:21.996577', '5523', '2'), - ('0.99', '164', '2007-04-11T20:56:38.996577', '6393', '1'), - ('7.99', '280', '2007-04-29T10:03:49.996577', '8565', '1'), - ('0.99', '517', '2007-02-20T16:25:06.996577', '3113', '1'), - ('4.99', '479', '2007-04-10T10:53:37.996577', '5751', '1'), - ('4.99', '177', '2007-02-16T05:52:38.996577', '1621', '2'), - ('4.99', '520', '2007-02-19T16:27:53.996577', '2772', '1'), - ('2.99', '35', '2007-04-30T04:36:08.996577', '9033', '2'), - ('2.99', '483', '2007-03-18T18:40:01.996577', '12695', '2'), - ('2.99', '65', '2007-03-17T11:45:04.996577', '11845', '2'), - ('2.99', '520', '2007-04-30T09:34:28.996577', '9803', '1'), - ('4.99', '108', '2007-05-14T13:44:29.996577', '15294', '1'), - ('0.99', '555', '2007-04-28T19:39:26.996577', '8161', '1'), - ('0.99', '182', '2007-04-08T14:38:22.996577', '4784', '2'), - ('2.99', '488', '2007-04-30T23:45:17.996577', '9532', '1'), - ('3.99', '465', '2007-04-12T20:30:35.996577', '6904', '2'), - ('2.99', '553', '2007-03-20T17:20:43.996577', '13972', '1'), - ('4.99', '212', '2007-03-01T01:43:13.996577', '10273', '2'), - ('4.99', '210', '2007-03-01T23:27:12.996577', '10890', '2'), - ('4.99', '156', '2007-04-10T00:55:15.996577', '5534', '2'), - ('4.99', '233', '2007-04-27T14:22:45.996577', '7387', '2'), - ('5.99', '273', '2007-04-12T12:03:28.996577', '6717', '1'), - ('4.99', '247', '2007-03-20T20:13:49.996577', '14041', '1'), - ('2.99', '66', '2007-04-07T04:00:21.996577', '4088', '2'), - ('5.98', '284', '2007-05-14T13:44:29.996577', '12064', '1'), - ('4.99', '277', '2007-04-07T14:15:36.996577', '4290', '1'), - ('5.99', '578', '2007-03-20T00:19:49.996577', '13498', '2'), - ('2.99', '19', '2007-03-18T06:09:18.996577', '12357', '2'), - ('6.99', '294', '2007-03-01T11:17:21.996577', '10551', '1'), - ('2.99', '182', '2007-03-19T16:47:10.996577', '13285', '1'), - ('6.99', '457', '2007-03-21T07:53:39.996577', '14365', '1'), - ('5.99', '407', '2007-03-02T16:49:18.996577', '11382', '2'), - ('2.99', '464', '2007-03-20T15:59:44.996577', '13943', '2'), - ('6.99', '452', '2007-04-06T18:07:40.996577', '3907', '2'), - ('6.99', '286', '2007-04-28T03:07:35.996577', '7719', '1'), - ('4.99', '305', '2007-04-30T07:54:22.996577', '9119', '2'), - ('0.99', '494', '2007-04-06T18:39:26.996577', '3913', '2'), - ('2.99', '383', '2007-02-18T02:13:16.996577', '2228', '2'), - ('7.99', '560', '2007-03-02T15:21:46.996577', '11334', '1'), - ('4.99', '382', '2007-04-30T03:19:51.996577', '8993', '1'), - ('2.99', '288', '2007-03-19T19:36:25.996577', '13363', '2'), - ('9.99', '180', '2007-04-08T20:23:51.996577', '4924', '1'), - ('3.99', '18', '2007-04-08T08:44:04.996577', '4672', '2'), - ('5.99', '144', '2007-02-16T19:43:48.996577', '1814', '1'), - ('2.99', '330', '2007-04-06T11:17:54.996577', '3760', '2'), - ('0.99', '177', '2007-03-01T17:13:02.996577', '10710', '1'), - ('4.99', '214', '2007-03-01T18:30:27.996577', '10749', '2'), - ('2.99', '479', '2007-04-28T09:17:53.996577', '7893', '2'), - ('6.99', '400', '2007-03-16T21:58:33.996577', '11510', '2'), - ('5.99', '96', '2007-02-20T06:27:53.996577', '2973', '2'), - ('5.99', '212', '2007-03-21T18:53:39.996577', '14681', '2'), - ('0.99', '8', '2007-04-06T22:37:28.996577', '4003', '1'), - ('5.99', '488', '2007-04-30T06:42:53.996577', '9083', '2'), - ('2.99', '408', '2007-03-18T11:29:34.996577', '12498', '1'), - ('2.99', '108', '2007-03-20T09:46:34.996577', '13754', '2'), - ('2.99', '89', '2007-04-28T13:39:53.996577', '8003', '1'), - ('4.99', '113', '2007-04-30T22:29:10.996577', '10181', '2'), - ('4.99', '58', '2007-04-30T18:08:04.996577', '10068', '1'), - ('8.99', '215', '2007-04-10T22:30:45.996577', '5967', '2'), - ('2.99', '226', '2007-04-09T19:16:02.996577', '5419', '1'), - ('3.99', '460', '2007-03-19T18:47:19.996577', '13341', '1'), - ('0.99', '177', '2007-03-20T22:49:55.996577', '14093', '2'), - ('0.99', '144', '2007-02-17T06:17:43.996577', '1943', '1'), - ('0.99', '190', '2007-03-20T21:09:13.996577', '14065', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['28513', '30793', '25848', '29890', '24125', '30941', '31561', '23480', '29984', '30648', '27956', '22287', '18100', '23529', '19107', '18856', '25734', '30656', '22601', '18858', '29882', '24352', '19081', '23081', '30254', '20697', '27640', '22603', '19605', '22476', '27400', '30488', '23152', '25363', '22474', '19380', '28647', '26838', '24205', '26617', '18213', '24037', '21896', '31735', '22292', '25845', '23356', '26843', '24838', '23537', '23746', '19607', '27642', '25892', '30509', '28188', '19673', '21890', '25432', '20368', '27451', '18840', '32037', '22692', '18590', '28400', '23563', '21460', '21970', '29891', '22799', '27319', '17989', '24463', '20102', '17959', '22914', '28371', '24431', '21964', '18387', '18224', '19660', '27380', '20373', '18411', '17741', '28685', '30790', '21551', '23323', '31059', '29088', '20440', '22417', '17943', '30329', '19577', '26078', '24809']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('2.99', '566', '2007-04-30T13:20:52.996577', '9915', '2'), - ('0.99', '158', '2007-04-28T03:31:58.996577', '7732', '1'), - ('1.99', '327', '2007-04-27T17:04:43.996577', '7458', '2'), - ('5.99', '80', '2007-04-29T08:06:45.996577', '8509', '1'), - ('6.99', '150', '2007-03-19T10:00:07.996577', '13116', '1'), - ('0.99', '171', '2007-04-12T14:24:34.996577', '6774', '2'), - ('4.99', '235', '2007-04-11T19:02:39.996577', '6352', '2'), - ('0.99', '83', '2007-03-02T17:53:39.996577', '11408', '1'), - ('2.99', '89', '2007-04-28T15:55:22.996577', '8070', '2'), - ('7.99', '145', '2007-04-27T19:46:34.996577', '7529', '1'), - ('3.99', '515', '2007-04-27T15:53:16.996577', '7429', '2'), - ('2.99', '561', '2007-03-02T16:36:02.996577', '11371', '1'), - ('5.99', '497', '2007-02-18T06:46:55.996577', '2298', '1'), - ('4.99', '87', '2007-03-23T15:26:38.996577', '15890', '2'), - ('4.99', '156', '2007-02-19T09:12:08.996577', '2658', '1'), - ('4.99', '91', '2007-02-15T08:03:16.996577', '1299', '1'), - ('0.99', '317', '2007-04-08T10:05:47.996577', '4700', '2'), - ('6.99', '146', '2007-04-11T09:47:47.996577', '6184', '2'), - ('4.99', '597', '2007-03-02T08:14:20.996577', '11147', '2'), - ('0.99', '91', '2007-02-20T01:45:18.996577', '2908', '1'), - ('3.99', '80', '2007-04-07T15:02:14.996577', '4299', '2'), - ('0.99', '174', '2007-03-16T22:43:57.996577', '11525', '1'), - ('4.99', '149', '2007-02-18T00:10:03.996577', '2194', '2'), - ('2.99', '40', '2007-03-22T14:35:15.996577', '15193', '1'), - ('4.99', '112', '2007-04-28T01:58:35.996577', '7691', '2'), - ('4.99', '392', '2007-03-01T07:19:17.996577', '10435', '1'), - ('4.99', '486', '2007-04-27T16:28:50.996577', '7446', '2'), - ('2.99', '597', '2007-03-02T11:56:56.996577', '11240', '1'), - ('1.99', '275', '2007-03-02T14:19:21.996577', '11309', '2'), - ('4.99', '581', '2007-03-23T12:34:03.996577', '15792', '2'), - ('4.99', '467', '2007-04-07T12:50:44.996577', '4259', '1'), - ('0.99', '132', '2007-04-08T19:18:31.996577', '4903', '2'), - ('2.99', '49', '2007-03-21T18:30:44.996577', '14676', '1'), - ('4.99', '286', '2007-04-08T10:25:54.996577', '4707', '1'), - ('2.99', '581', '2007-03-22T05:38:52.996577', '14976', '1'), - ('4.99', '234', '2007-02-20T22:41:06.996577', '3199', '2'), - ('0.99', '578', '2007-04-12T17:11:21.996577', '6830', '1'), - ('0.99', '414', '2007-04-12T12:25:14.996577', '6728', '2'), - ('1.99', '158', '2007-03-17T20:15:13.996577', '12070', '2'), - ('4.99', '394', '2007-04-10T00:56:08.996577', '5535', '1'), - ('6.99', '526', '2007-02-20T03:19:45.996577', '2932', '2'), - ('4.99', '143', '2007-03-23T20:22:28.996577', '16029', '1'), - ('2.99', '518', '2007-03-18T09:32:30.996577', '12450', '2'), - ('2.99', '250', '2007-04-09T22:15:59.996577', '5479', '1'), - ('2.99', '561', '2007-03-23T17:22:33.996577', '15946', '1'), - ('4.99', '327', '2007-04-07T21:36:48.996577', '4445', '1'), - ('3.99', '70', '2007-03-23T05:35:04.996577', '15616', '1'), - ('2.99', '414', '2007-04-30T15:54:53.996577', '9991', '2'), - ('7.99', '234', '2007-03-02T02:31:39.996577', '10968', '2'), - ('3.99', '89', '2007-03-02T06:25:06.996577', '11090', '1'), - ('0.99', '115', '2007-03-20T17:31:00.996577', '13977', '2'), - ('5.99', '275', '2007-03-18T14:34:57.996577', '12589', '2'), - ('0.99', '486', '2007-04-30T08:49:29.996577', '9142', '2'), - ('5.99', '331', '2007-04-30T18:46:45.996577', '9401', '1'), - ('0.99', '133', '2007-04-30T05:02:07.996577', '9671', '2'), - ('4.99', '535', '2007-04-07T16:50:56.996577', '4331', '1'), - ('4.99', '280', '2007-03-17T19:25:53.996577', '12053', '1'), - ('0.99', '517', '2007-03-18T19:12:40.996577', '12705', '2'), - ('5.99', '291', '2007-04-30T09:52:54.996577', '9165', '1'), - ('2.99', '359', '2007-03-22T10:29:42.996577', '15104', '1'), - ('4.99', '470', '2007-04-12T11:18:45.996577', '6703', '2'), - ('4.99', '87', '2007-02-16T02:40:51.996577', '1580', '2'), - ('2.99', '73', '2007-05-14T13:44:29.996577', '13108', '2'), - ('0.99', '2', '2007-03-02T00:39:22.996577', '10918', '1'), - ('6.99', '25', '2007-02-16T15:41:49.996577', '1754', '2'), - ('2.99', '557', '2007-04-30T16:36:24.996577', '9341', '1'), - ('1.99', '91', '2007-03-23T09:04:11.996577', '15707', '1'), - ('4.99', '469', '2007-03-23T00:34:17.996577', '15487', '1'), - ('7.99', '526', '2007-03-21T15:57:36.996577', '14590', '1'), - ('6.99', '80', '2007-04-29T22:54:48.996577', '8884', '1'), - ('7.99', '13', '2007-03-19T03:00:02.996577', '12918', '2'), - ('2.99', '459', '2007-04-05T22:50:55.996577', '3506', '1'), - ('4.99', '465', '2007-02-17T15:18:11.996577', '2079', '1'), - ('0.99', '185', '2007-03-19T02:05:51.996577', '12885', '1'), - ('4.99', '331', '2007-03-18T12:30:06.996577', '12533', '2'), - ('0.99', '457', '2007-02-16T13:50:13.996577', '1727', '2'), - ('2.99', '24', '2007-03-16T23:26:02.996577', '11546', '2'), - ('0.99', '553', '2007-04-12T09:40:02.996577', '6657', '2'), - ('4.99', '181', '2007-03-19T20:49:15.996577', '13405', '2'), - ('4.99', '526', '2007-03-17T05:47:22.996577', '11702', '2'), - ('4.99', '576', '2007-02-19T17:43:47.996577', '2799', '2'), - ('1.99', '530', '2007-02-15T06:21:01.996577', '1273', '2'), - ('4.99', '279', '2007-03-19T04:24:18.996577', '12949', '1'), - ('7.99', '463', '2007-04-30T18:50:43.996577', '9405', '2'), - ('4.99', '360', '2007-03-16T23:32:57.996577', '11553', '2'), - ('3.99', '584', '2007-02-15T17:04:06.996577', '1436', '2'), - ('3.99', '400', '2007-02-17T04:04:33.996577', '1917', '1'), - ('4.99', '581', '2007-04-07T17:08:22.996577', '4338', '1'), - ('2.99', '158', '2007-04-11T21:57:40.996577', '6416', '1'), - ('4.99', '479', '2007-03-17T11:31:39.996577', '11835', '2'), - ('8.99', '66', '2007-03-23T04:51:52.996577', '15598', '1'), - ('9.99', '181', '2007-04-29T11:31:57.996577', '8601', '1'), - ('2.99', '9', '2007-04-10T06:14:06.996577', '5659', '1'), - ('6.99', '366', '2007-03-22T03:06:44.996577', '14906', '1'), - ('8.99', '575', '2007-03-18T03:33:54.996577', '12289', '2'), - ('2.99', '454', '2007-02-18T16:58:52.996577', '2437', '1'), - ('1.99', '118', '2007-04-30T17:33:01.996577', '10045', '2'), - ('6.99', '273', '2007-03-01T19:07:58.996577', '10768', '1'), - ('4.99', '347', '2007-04-29T03:57:01.996577', '8378', '2'), - ('0.99', '230', '2007-03-20T19:23:58.996577', '14017', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['28884', '28690', '32022', '31322', '30345', '29263', '30328', '31947', '24128', '20450', '21343', '31971', '21647', '19785', '30958', '17794', '21588', '30015', '28819', '26592', '30881', '23241', '20460', '23730', '31987', '24355', '19368', '19377', '20431', '29456', '28931', '18179', '26347', '26226', '24384', '21461', '20468', '22919', '22675', '22608', '29190', '22670', '18320', '31737', '23630', '29680', '23788', '20006', '27443', '24434', '23453', '28530', '27556', '22503', '20279', '20615', '22443', '31285', '28161', '18734', '19952', '18021', '30489', '30351', '21968', '19776', '27847', '31539', '25581', '19585', '22852', '18157', '24069', '30263', '23029', '31893', '23645', '27467', '28942', '24807', '27731', '23272', '30366', '23528', '22456', '23024', '25000', '29764', '29147', '30635', '26762', '31508', '20062', '18255', '23713', '31100', '24423', '20549', '29093', '30624']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('4.99', '597', '2007-04-30T01:44:44.996577', '8948', '2'), - ('4.99', '581', '2007-04-09T23:42:18.996577', '5516', '1'), - ('2.99', '41', '2007-05-14T13:44:29.996577', '15875', '1'), - ('2.99', '213', '2007-04-12T12:15:43.996577', '6725', '2'), - ('1.99', '120', '2007-04-09T13:41:33.996577', '5288', '2'), - ('3.99', '26', '2007-04-08T02:11:48.996577', '4536', '1'), - ('4.99', '118', '2007-04-29T22:50:57.996577', '8881', '1'), - ('4.99', '366', '2007-05-14T13:44:29.996577', '13421', '1'), - ('5.99', '150', '2007-03-20T04:28:29.996577', '13599', '2'), - ('8.99', '368', '2007-03-01T17:50:08.996577', '10730', '2'), - ('7.99', '459', '2007-03-18T16:08:59.996577', '12629', '1'), - ('4.99', '472', '2007-05-14T13:44:29.996577', '14928', '2'), - ('2.99', '490', '2007-03-17T16:08:11.996577', '11965', '2'), - ('4.99', '294', '2007-03-17T12:45:14.996577', '11875', '2'), - ('5.99', '172', '2007-04-30T11:43:01.996577', '9218', '2'), - ('4.99', '416', '2007-02-15T10:55:45.996577', '1343', '1'), - ('6.99', '483', '2007-03-02T01:57:04.996577', '10953', '1'), - ('0.99', '91', '2007-04-27T23:40:51.996577', '7637', '2'), - ('0.99', '592', '2007-04-26T21:44:16.996577', '6937', '1'), - ('0.99', '392', '2007-04-11T02:34:51.996577', '6061', '2'), - ('8.99', '166', '2007-04-30T03:40:27.996577', '9009', '1'), - ('8.99', '58', '2007-03-18T03:37:20.996577', '12292', '2'), - ('7.99', '368', '2007-03-21T08:51:17.996577', '14393', '1'), - ('2.99', '113', '2007-03-23T11:46:42.996577', '15770', '1'), - ('2.99', '530', '2007-05-14T13:44:29.996577', '13561', '1'), - ('1.99', '174', '2007-03-23T15:29:26.996577', '15892', '1'), - ('8.99', '232', '2007-02-19T20:03:20.996577', '2833', '1'), - ('4.99', '234', '2007-02-17T10:13:20.996577', '2005', '1'), - ('5.99', '366', '2007-03-02T15:34:09.996577', '11340', '2'), - ('6.99', '41', '2007-04-28T13:54:21.996577', '8008', '2'), - ('4.99', '204', '2007-04-08T22:53:00.996577', '4979', '1'), - ('4.99', '517', '2007-02-16T08:03:11.996577', '1653', '2'), - ('0.99', '369', '2007-04-30T00:12:00.996577', '9543', '2'), - ('2.99', '360', '2007-04-27T09:13:21.996577', '7251', '1'), - ('4.99', '177', '2007-03-18T16:02:45.996577', '12623', '1'), - ('9.99', '469', '2007-03-23T03:30:57.996577', '15561', '1'), - ('0.99', '369', '2007-03-18T12:11:33.996577', '12521', '1'), - ('0.99', '24', '2007-03-19T15:14:25.996577', '13247', '1'), - ('2.99', '207', '2007-03-20T06:27:39.996577', '13655', '2'), - ('6.99', '597', '2007-03-19T11:37:58.996577', '13152', '1'), - ('4.99', '18', '2007-04-30T04:47:04.996577', '9036', '1'), - ('2.99', '207', '2007-03-02T06:53:40.996577', '11112', '1'), - ('4.99', '560', '2007-02-15T06:00:50.996577', '1271', '1'), - ('2.99', '250', '2007-04-10T23:49:12.996577', '5998', '1'), - ('1.99', '101', '2007-03-19T19:48:37.996577', '13370', '2'), - ('4.99', '63', '2007-04-10T15:03:14.996577', '5832', '2'), - ('4.99', '119', '2007-03-22T10:50:09.996577', '15111', '1'), - ('4.99', '319', '2007-03-17T18:13:12.996577', '12018', '1'), - ('5.99', '470', '2007-04-06T11:29:29.996577', '3764', '1'), - ('2.99', '181', '2007-03-22T14:39:58.996577', '15196', '2'), - ('4.99', '80', '2007-03-19T19:20:06.996577', '13352', '1'), - ('0.99', '568', '2007-04-28T20:52:15.996577', '8185', '2'), - ('7.99', '479', '2007-04-30T07:52:09.996577', '9754', '2'), - ('1.99', '584', '2007-03-22T04:06:58.996577', '14930', '1'), - ('0.99', '348', '2007-03-23T13:28:17.996577', '15817', '2'), - ('4.99', '383', '2007-03-20T20:08:09.996577', '14039', '2'), - ('4.99', '577', '2007-03-23T19:15:54.996577', '16003', '2'), - ('3.99', '210', '2007-04-08T23:15:22.996577', '4989', '1'), - ('7.99', '532', '2007-04-11T18:33:44.996577', '6345', '2'), - ('7.99', '57', '2007-02-20T01:59:44.996577', '2910', '2'), - ('2.99', '312', '2007-03-18T00:12:02.996577', '12186', '1'), - ('4.99', '472', '2007-02-20T07:39:09.996577', '2991', '1'), - ('2.99', '132', '2007-04-09T17:57:00.996577', '5391', '1'), - ('6.99', '120', '2007-04-30T13:08:16.996577', '9907', '2'), - ('8.99', '526', '2007-03-20T05:03:56.996577', '13617', '1'), - ('4.99', '293', '2007-03-22T16:51:10.996577', '15258', '1'), - ('9.99', '504', '2007-04-29T04:30:37.996577', '8393', '1'), - ('2.99', '233', '2007-04-06T14:40:49.996577', '3832', '1'), - ('4.99', '303', '2007-04-11T23:45:06.996577', '6464', '1'), - ('2.99', '273', '2007-03-22T03:20:08.996577', '14911', '2'), - ('4.99', '18', '2007-03-02T18:51:11.996577', '11439', '2'), - ('2.99', '512', '2007-02-18T12:05:58.996577', '2364', '1'), - ('4.99', '146', '2007-03-17T12:16:56.996577', '11857', '1'), - ('2.99', '113', '2007-04-07T17:00:16.996577', '4333', '1'), - ('2.99', '36', '2007-03-01T10:21:43.996577', '10525', '2'), - ('7.99', '265', '2007-04-09T01:03:58.996577', '5029', '2'), - ('8.99', '103', '2007-03-22T21:41:36.996577', '15401', '2'), - ('0.99', '471', '2007-04-30T22:30:36.996577', '9502', '1'), - ('4.99', '204', '2007-04-30T13:06:38.996577', '9906', '2'), - ('7.99', '230', '2007-03-18T12:14:07.996577', '12523', '2'), - ('7.99', '494', '2007-04-30T14:05:55.996577', '9943', '2'), - ('0.99', '61', '2007-03-19T22:46:41.996577', '13450', '1'), - ('6.99', '122', '2007-04-09T11:22:51.996577', '5235', '2'), - ('2.99', '87', '2007-03-23T15:00:36.996577', '15876', '1'), - ('2.99', '579', '2007-03-21T14:42:13.996577', '14560', '2'), - ('4.99', '35', '2007-03-17T19:30:45.996577', '12055', '1'), - ('0.99', '252', '2007-03-17T08:20:20.996577', '11764', '2'), - ('7.99', '70', '2007-04-27T15:38:31.996577', '7421', '2'), - ('7.99', '14', '2007-04-10T01:58:14.996577', '5565', '1'), - ('3.99', '144', '2007-04-30T07:12:47.996577', '9098', '1'), - ('5.99', '407', '2007-04-27T13:26:55.996577', '7363', '1'), - ('4.99', '230', '2007-04-28T14:45:26.996577', '8032', '2'), - ('4.99', '327', '2007-03-02T16:39:16.996577', '11372', '1'), - ('0.99', '539', '2007-02-15T09:40:05.996577', '1327', '1'), - ('3.99', '112', '2007-03-17T12:24:27.996577', '11863', '2'), - ('1.99', '185', '2007-04-11T22:04:53.996577', '6418', '1'), - ('4.99', '181', '2007-03-01T18:29:50.996577', '10748', '1'), - ('3.99', '377', '2007-03-01T18:07:34.996577', '10738', '1'), - ('4.99', '9', '2007-04-30T05:02:33.996577', '9043', '1'), - ('7.99', '144', '2007-04-09T18:45:17.996577', '5408', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['29082', '28733', '21270', '23689', '20198', '30833', '29252', '28639', '24985', '28656', '30271', '18754', '27182', '18407', '27663', '18083', '31239', '28554', '21573', '27579', '19784', '29380', '18079', '21275', '22546', '21899', '22748', '24960', '23290', '28825', '20919', '30170', '29638', '21412', '21193', '18304', '23641', '19199', '21324', '27846', '21486', '25286', '19639', '31536', '22075', '26861', '27286', '30172', '22428', '24319', '25677', '25884', '30396', '17770', '25847', '25755', '31553', '22870', '19039', '27557', '23269', '27843', '26338', '23748', '29090', '18886', '24839', '29081', '20603', '28454', '28944', '21634', '26667', '25302', '21209', '22700', '30016', '28133', '27774', '19544', '23729', '22894', '29799', '25281', '23931', '29826', '27303', '25114', '26092', '32032', '29543', '30589', '22091', '25367', '18091', '29586', '31981', '21472', '29237', '21478']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('1.99', '8', '2007-04-29T20:11:15.996577', '8809', '1'), - ('9.99', '585', '2007-04-08T09:09:32.996577', '4684', '1'), - ('2.99', '451', '2007-03-20T08:00:49.996577', '13705', '1'), - ('2.99', '108', '2007-03-23T19:14:19.996577', '16001', '1'), - ('2.99', '340', '2007-03-22T18:15:02.996577', '15306', '2'), - ('7.99', '162', '2007-04-30T07:05:33.996577', '9726', '1'), - ('2.99', '25', '2007-04-29T14:09:23.996577', '8667', '2'), - ('5.99', '577', '2007-04-28T15:14:10.996577', '8043', '1'), - ('5.99', '250', '2007-03-21T15:49:21.996577', '14587', '1'), - ('4.99', '579', '2007-04-11T16:30:42.996577', '6304', '1'), - ('2.99', '113', '2007-04-27T21:51:29.996577', '7587', '2'), - ('7.99', '65', '2007-02-17T22:36:46.996577', '2173', '1'), - ('1.99', '444', '2007-04-30T03:34:28.996577', '9634', '2'), - ('4.99', '583', '2007-02-19T09:22:26.996577', '2663', '2'), - ('2.99', '488', '2007-04-28T13:43:37.996577', '8005', '1'), - ('4.99', '491', '2007-02-20T10:21:15.996577', '3031', '2'), - ('0.99', '199', '2007-04-29T15:54:20.996577', '8709', '1'), - ('2.99', '570', '2007-04-30T21:53:50.996577', '10168', '2'), - ('4.99', '481', '2007-03-21T05:08:24.996577', '14280', '2'), - ('4.99', '482', '2007-04-08T13:56:46.996577', '4768', '1'), - ('2.99', '294', '2007-03-02T17:07:42.996577', '11390', '1'), - ('4.99', '35', '2007-04-12T04:25:04.996577', '6572', '1'), - ('4.99', '491', '2007-02-15T13:06:41.996577', '1371', '1'), - ('0.99', '452', '2007-03-18T06:04:49.996577', '12355', '1'), - ('0.99', '589', '2007-03-23T18:56:58.996577', '15992', '2'), - ('6.99', '518', '2007-03-20T02:08:53.996577', '13539', '1'), - ('4.99', '7', '2007-03-01T14:20:26.996577', '10644', '2'), - ('6.99', '247', '2007-03-01T06:21:55.996577', '10410', '1'), - ('0.99', '63', '2007-03-19T09:07:22.996577', '13089', '1'), - ('4.99', '592', '2007-04-30T13:30:56.996577', '9268', '1'), - ('0.99', '414', '2007-03-23T00:27:40.996577', '15481', '2'), - ('6.99', '104', '2007-04-07T21:24:43.996577', '4438', '2'), - ('4.99', '58', '2007-04-07T06:21:44.996577', '4131', '2'), - ('4.99', '465', '2007-03-23T14:36:41.996577', '15859', '2'), - ('2.99', '444', '2007-03-19T04:22:00.996577', '12946', '2'), - ('5.99', '556', '2007-02-19T04:08:37.996577', '2593', '2'), - ('7.99', '103', '2007-03-19T04:09:02.996577', '12942', '2'), - ('3.99', '182', '2007-02-15T23:48:31.996577', '1542', '2'), - ('0.99', '457', '2007-03-19T09:04:37.996577', '13088', '1'), - ('4.99', '504', '2007-04-28T11:19:48.996577', '7944', '2'), - ('6.99', '472', '2007-03-01T01:57:36.996577', '10282', '1'), - ('0.99', '280', '2007-04-28T09:40:38.996577', '7901', '2'), - ('4.99', '277', '2007-03-20T08:09:35.996577', '13714', '1'), - ('10.99', '232', '2007-04-30T16:12:50.996577', '9330', '2'), - ('4.99', '537', '2007-03-19T05:35:17.996577', '12984', '2'), - ('2.99', '416', '2007-04-28T10:25:23.996577', '7917', '1'), - ('3.99', '454', '2007-04-30T16:22:17.996577', '10005', '1'), - ('7.99', '104', '2007-04-08T01:54:46.996577', '4529', '1'), - ('4.99', '576', '2007-03-19T18:21:18.996577', '13326', '1'), - ('4.99', '171', '2007-03-01T13:40:26.996577', '10622', '2'), - ('1.99', '312', '2007-04-06T12:55:04.996577', '3792', '1'), - ('4.99', '331', '2007-04-07T02:05:54.996577', '4051', '1'), - ('2.99', '125', '2007-04-09T09:20:35.996577', '5200', '1'), - ('0.99', '407', '2007-02-19T04:22:12.996577', '2597', '2'), - ('2.99', '327', '2007-04-12T07:10:08.996577', '6618', '1'), - ('2.99', '319', '2007-04-11T06:53:10.996577', '6132', '2'), - ('7.99', '234', '2007-04-08T11:07:57.996577', '4721', '1'), - ('4.99', '20', '2007-03-19T10:54:58.996577', '13137', '1'), - ('7.99', '139', '2007-02-19T13:18:08.996577', '2718', '2'), - ('7.99', '480', '2007-04-05T22:52:09.996577', '3507', '2'), - ('0.99', '61', '2007-03-01T11:15:05.996577', '10549', '2'), - ('2.99', '504', '2007-04-27T21:06:31.996577', '7567', '1'), - ('2.99', '369', '2007-04-06T17:55:58.996577', '3903', '2'), - ('0.99', '115', '2007-03-22T23:25:38.996577', '15452', '2'), - ('5.99', '9', '2007-04-11T08:45:55.996577', '6165', '1'), - ('4.99', '98', '2007-02-18T01:05:13.996577', '2213', '1'), - ('4.99', '234', '2007-03-02T04:45:42.996577', '11050', '1'), - ('0.99', '8', '2007-04-12T09:12:19.996577', '6647', '1'), - ('0.99', '382', '2007-03-18T01:36:49.996577', '12229', '2'), - ('6.99', '562', '2007-04-11T02:54:17.996577', '6065', '2'), - ('7.99', '205', '2007-04-06T03:48:51.996577', '3601', '1'), - ('2.99', '488', '2007-03-23T01:05:45.996577', '15499', '2'), - ('4.99', '399', '2007-04-12T10:20:20.996577', '6674', '2'), - ('2.99', '282', '2007-04-06T07:37:45.996577', '3675', '2'), - ('6.99', '445', '2007-03-22T01:40:01.996577', '14866', '1'), - ('4.99', '2', '2007-03-22T12:21:30.996577', '15145', '2'), - ('4.99', '91', '2007-04-28T12:22:20.996577', '7966', '1'), - ('3.99', '530', '2007-04-27T01:30:33.996577', '7031', '1'), - ('6.99', '498', '2007-04-27T10:52:15.996577', '7286', '1'), - ('5.99', '269', '2007-03-19T11:10:54.996577', '13142', '2'), - ('1.99', '113', '2007-03-23T04:59:50.996577', '15600', '1'), - ('5.99', '22', '2007-03-17T18:23:20.996577', '12023', '1'), - ('9.99', '73', '2007-04-12T02:16:10.996577', '6514', '1'), - ('5.99', '279', '2007-04-30T10:15:23.996577', '9820', '2'), - ('0.99', '133', '2007-03-22T09:40:17.996577', '15080', '2'), - ('2.99', '75', '2007-04-27T02:05:04.996577', '7052', '1'), - ('5.99', '457', '2007-04-08T05:17:03.996577', '4600', '2'), - ('4.99', '262', '2007-03-23T06:33:06.996577', '15640', '1'), - ('2.99', '348', '2007-04-12T14:30:35.996577', '6776', '2'), - ('0.99', '58', '2007-05-14T13:44:29.996577', '15326', '2'), - ('4.99', '49', '2007-04-12T13:43:14.996577', '6759', '2'), - ('0.99', '140', '2007-04-30T18:50:01.996577', '9404', '1'), - ('3.99', '539', '2007-03-02T00:43:06.996577', '10922', '2'), - ('2.99', '286', '2007-04-27T09:17:16.996577', '7254', '1'), - ('0.99', '493', '2007-02-19T03:09:10.996577', '2579', '1'), - ('4.99', '52', '2007-04-27T23:25:13.996577', '7627', '2'), - ('0.99', '512', '2007-05-14T13:44:29.996577', '12786', '1'), - ('4.99', '470', '2007-03-20T04:19:01.996577', '13592', '1'), - ('7.99', '24', '2007-04-06T06:01:08.996577', '3649', '2'), - ('5.99', '471', '2007-03-20T06:34:25.996577', '13661', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['31988', '27679', '26082', '22545', '25602', '17789', '30613', '29880', '26769', '30070', '20436', '25833', '19684', '28237', '29958', '18447', '24323', '30130', '21569', '20453', '24984', '20030', '28742', '24636', '25182', '28933', '19664', '22851', '23562', '21536', '19635', '22264', '27756', '28640', '25142', '25179', '32050', '26091', '24824', '28700', '18623', '29018', '27979', '26615', '23320', '17966', '26095', '22575', '18007', '19364', '22562', '22253', '24511', '28636', '18522', '29720', '29166', '29711', '31890', '22640', '29510', '19014', '17928', '24034', '30157', '19917', '22931', '27259', '27382', '28373', '20197', '26930', '28362', '30391', '18978', '28943', '22478', '27431', '17581', '23186', '19606', '21284', '28328', '26438', '24827', '27770', '28610', '29547', '31900', '26439', '21915', '30601', '25307', '24598', '27460', '20936', '21428', '29724', '27465', '20617']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('0.99', '532', '2007-05-14T13:44:29.996577', '14616', '1'), - ('0.99', '490', '2007-04-09T22:35:29.996577', '5489', '2'), - ('3.99', '347', '2007-04-30T11:29:01.996577', '9856', '1'), - ('5.99', '589', '2007-03-23T16:25:54.996577', '15917', '2'), - ('0.99', '305', '2007-04-09T01:47:17.996577', '5041', '2'), - ('9.99', '414', '2007-02-19T01:38:12.996577', '2559', '1'), - ('7.99', '143', '2007-04-08T04:40:24.996577', '4585', '1'), - ('4.99', '80', '2007-04-06T04:33:49.996577', '3623', '2'), - ('3.99', '408', '2007-04-07T16:38:07.996577', '4330', '2'), - ('4.99', '96', '2007-04-30T17:08:41.996577', '10031', '2'), - ('4.99', '366', '2007-03-21T00:42:29.996577', '14147', '1'), - ('0.99', '326', '2007-04-06T17:12:50.996577', '3886', '2'), - ('2.99', '282', '2007-03-02T11:15:56.996577', '11226', '2'), - ('2.99', '539', '2007-04-07T01:13:28.996577', '4035', '1'), - ('0.99', '87', '2007-04-30T05:49:02.996577', '9060', '2'), - ('4.99', '593', '2007-02-18T00:43:00.996577', '2205', '2'), - ('0.99', '171', '2007-03-19T17:03:58.996577', '13292', '2'), - ('4.99', '101', '2007-04-29T21:08:02.996577', '8833', '2'), - ('4.99', '481', '2007-03-19T05:32:26.996577', '12981', '1'), - ('2.99', '368', '2007-03-18T04:55:11.996577', '12319', '2'), - ('4.99', '250', '2007-03-21T14:53:11.996577', '14565', '2'), - ('3.99', '323', '2007-03-02T03:15:19.996577', '10994', '1'), - ('3.99', '585', '2007-04-30T01:45:42.996577', '9590', '1'), - ('4.99', '210', '2007-03-19T01:51:21.996577', '12879', '1'), - ('4.99', '269', '2007-04-12T15:50:32.996577', '6804', '2'), - ('2.99', '204', '2007-04-10T03:57:59.996577', '5619', '1'), - ('2.99', '279', '2007-03-21T02:27:52.996577', '14206', '2'), - ('4.99', '18', '2007-03-02T06:31:28.996577', '11094', '2'), - ('4.99', '91', '2007-03-22T19:24:57.996577', '15341', '1'), - ('0.99', '477', '2007-03-02T00:28:29.996577', '10912', '2'), - ('3.99', '277', '2007-03-17T22:42:17.996577', '12149', '2'), - ('0.99', '559', '2007-03-01T23:00:24.996577', '10876', '2'), - ('4.99', '497', '2007-04-09T01:04:09.996577', '5030', '1'), - ('6.99', '577', '2007-04-28T15:38:28.996577', '8060', '1'), - ('6.99', '265', '2007-03-21T14:20:04.996577', '14547', '1'), - ('6.99', '269', '2007-04-08T18:04:43.996577', '4880', '2'), - ('0.00', '107', '2007-05-14T13:44:29.996577', '15497', '1'), - ('0.99', '348', '2007-04-10T22:20:18.996577', '5965', '2'), - ('0.99', '232', '2007-03-17T12:22:13.996577', '11861', '2'), - ('6.99', '582', '2007-04-27T11:31:20.996577', '7311', '2'), - ('4.99', '30', '2007-02-17T21:28:08.996577', '2154', '2'), - ('2.99', '2', '2007-04-30T20:27:22.996577', '10136', '1'), - ('4.99', '517', '2007-04-30T17:53:39.996577', '10063', '1'), - ('6.99', '394', '2007-04-07T15:49:05.996577', '4307', '1'), - ('2.99', '66', '2007-03-21T07:32:46.996577', '14351', '2'), - ('2.99', '457', '2007-02-20T21:26:10.996577', '3184', '2'), - ('4.99', '348', '2007-04-28T07:03:23.996577', '7825', '2'), - ('0.99', '593', '2007-03-21T18:04:25.996577', '14653', '1'), - ('0.99', '469', '2007-02-15T14:58:17.996577', '1399', '2'), - ('0.99', '230', '2007-02-19T10:20:41.996577', '2675', '2'), - ('8.99', '592', '2007-03-02T17:57:27.996577', '11410', '1'), - ('0.99', '557', '2007-03-23T16:17:52.996577', '15914', '2'), - ('9.99', '190', '2007-03-17T15:41:42.996577', '11950', '2'), - ('0.99', '577', '2007-04-27T07:17:58.996577', '7197', '2'), - ('0.99', '7', '2007-02-16T19:34:26.996577', '1810', '2'), - ('2.99', '66', '2007-04-06T11:10:52.996577', '3757', '2'), - ('3.99', '16', '2007-04-07T12:53:10.996577', '4263', '2'), - ('4.99', '65', '2007-04-07T12:01:38.996577', '4240', '1'), - ('2.99', '265', '2007-04-06T14:09:53.996577', '3823', '1'), - ('5.99', '204', '2007-03-01T05:42:05.996577', '10399', '2'), - ('3.99', '45', '2007-04-28T12:15:47.996577', '7961', '1'), - ('2.99', '132', '2007-02-19T05:39:02.996577', '2608', '2'), - ('5.99', '452', '2007-02-15T21:21:29.996577', '1512', '1'), - ('2.99', '143', '2007-03-18T08:09:04.996577', '12408', '1'), - ('2.99', '103', '2007-04-07T10:22:15.996577', '4213', '1'), - ('4.99', '308', '2007-03-01T21:21:23.996577', '10819', '1'), - ('3.99', '26', '2007-03-02T03:16:37.996577', '10996', '1'), - ('0.99', '452', '2007-04-08T11:03:00.996577', '4720', '1'), - ('4.99', '464', '2007-04-06T11:21:10.996577', '3761', '1'), - ('4.99', '553', '2007-04-28T09:12:06.996577', '7890', '1'), - ('2.99', '340', '2007-03-22T02:47:49.996577', '14895', '1'), - ('1.99', '423', '2007-04-12T01:56:48.996577', '6506', '1'), - ('2.99', '553', '2007-04-06T15:46:41.996577', '3859', '2'), - ('6.99', '124', '2007-04-27T19:30:07.996577', '7519', '1'), - ('4.99', '122', '2007-02-18T19:39:10.996577', '2482', '1'), - ('2.99', '204', '2007-04-30T17:29:51.996577', '10042', '2'), - ('5.99', '582', '2007-03-17T04:15:21.996577', '11667', '1'), - ('6.99', '469', '2007-04-10T06:33:07.996577', '5664', '2'), - ('3.99', '360', '2007-02-19T00:36:36.996577', '2541', '2'), - ('5.99', '52', '2007-03-21T23:49:40.996577', '14822', '1'), - ('4.99', '275', '2007-03-17T02:12:03.996577', '11610', '1'), - ('4.99', '453', '2007-03-20T10:40:12.996577', '13785', '1'), - ('4.99', '549', '2007-04-29T02:07:15.996577', '8316', '1'), - ('10.99', '377', '2007-04-28T14:05:14.996577', '8018', '2'), - ('0.99', '232', '2007-03-21T13:36:08.996577', '14527', '2'), - ('0.99', '498', '2007-04-10T18:00:04.996577', '5884', '2'), - ('2.99', '575', '2007-04-27T05:20:47.996577', '7139', '1'), - ('0.99', '49', '2007-04-30T03:34:58.996577', '9006', '2'), - ('1.99', '265', '2007-04-27T15:14:33.996577', '7414', '2'), - ('4.99', '377', '2007-04-30T00:10:47.996577', '8916', '2'), - ('0.99', '520', '2007-03-19T17:35:35.996577', '13311', '1'), - ('2.99', '142', '2007-04-05T22:13:03.996577', '3492', '2'), - ('8.99', '282', '2007-04-09T14:46:10.996577', '5319', '2'), - ('4.99', '199', '2007-03-21T06:33:06.996577', '14320', '2'), - ('0.99', '471', '2007-04-06T18:47:55.996577', '3917', '1'), - ('4.99', '416', '2007-03-19T03:45:56.996577', '12932', '1'), - ('2.99', '467', '2007-03-18T16:46:34.996577', '12641', '1'), - ('5.99', '66', '2007-04-08T19:48:52.996577', '4911', '2'), - ('0.99', '471', '2007-04-28T21:38:51.996577', '8199', '1'), - ('1.99', '383', '2007-03-22T22:19:49.996577', '15416', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['17667', '30173', '28629', '24723', '26962', '28635', '23486', '24805', '25681', '30878', '20772', '21632', '24811', '26433', '28935', '28695', '26212', '22746', '21561', '25875', '22357', '21648', '24802', '30233', '22567', '22005', '25872', '21493', '21325', '21278', '22739', '30009', '28008', '30408', '18624', '19579', '25291', '19346', '18319', '22336', '21944', '29134', '18200', '17717', '24044', '23802', '22027', '29199', '31542', '24339', '17889', '19783', '20828', '28686', '22769', '22778', '28367', '17965', '22276', '22728', '19714', '23322', '28427', '18844', '26906', '26904', '20941', '28084', '30291', '22521', '30619', '21965', '21655', '25221', '30214', '29258', '22335', '28648', '23652', '25468', '26227', '19362', '23700', '22939', '31218', '18657', '26760', '20065', '29203', '22328', '21457', '31526', '26772', '19153', '28892', '23451', '28424', '30638', '23055', '20847']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('2.99', '382', '2007-02-18T22:25:10.996577', '2514', '1'), - ('2.99', '104', '2007-04-08T20:00:56.996577', '4917', '1'), - ('2.99', '576', '2007-04-30T16:09:31.996577', '10000', '1'), - ('4.99', '219', '2007-03-20T10:07:26.996577', '13765', '1'), - ('7.99', '425', '2007-04-08T21:03:56.996577', '4939', '1'), - ('2.99', '577', '2007-04-12T03:08:09.996577', '6534', '2'), - ('4.99', '83', '2007-03-23T01:01:53.996577', '15498', '2'), - ('2.99', '230', '2007-03-17T14:33:08.996577', '11914', '2'), - ('2.99', '312', '2007-04-12T18:32:10.996577', '6866', '1'), - ('2.99', '166', '2007-04-12T19:19:05.996577', '6882', '2'), - ('2.99', '400', '2007-03-16T22:57:26.996577', '11530', '2'), - ('0.99', '488', '2007-03-22T16:51:49.996577', '15259', '2'), - ('2.99', '230', '2007-03-21T07:06:47.996577', '14340', '1'), - ('0.99', '377', '2007-04-07T02:07:48.996577', '4053', '2'), - ('2.99', '204', '2007-04-11T12:13:40.996577', '6225', '2'), - ('2.99', '581', '2007-04-30T13:43:45.996577', '9278', '1'), - ('2.99', '359', '2007-04-12T03:22:15.996577', '6542', '1'), - ('5.99', '7', '2007-03-01T06:48:19.996577', '10423', '1'), - ('4.99', '480', '2007-03-20T12:28:01.996577', '13831', '1'), - ('0.99', '330', '2007-04-12T09:38:13.996577', '6656', '1'), - ('4.99', '568', '2007-03-20T13:57:19.996577', '13883', '1'), - ('4.99', '490', '2007-03-21T14:33:37.996577', '14557', '2'), - ('2.99', '230', '2007-03-01T22:59:26.996577', '10874', '2'), - ('0.99', '109', '2007-04-30T12:08:08.996577', '9230', '1'), - ('3.99', '592', '2007-03-20T06:40:24.996577', '13662', '2'), - ('4.99', '530', '2007-03-18T01:18:28.996577', '12220', '1'), - ('1.99', '330', '2007-04-07T05:48:20.996577', '4124', '1'), - ('4.99', '472', '2007-03-21T16:08:07.996577', '14597', '1'), - ('2.99', '457', '2007-03-19T11:36:45.996577', '13150', '1'), - ('3.99', '452', '2007-03-20T06:10:43.996577', '13642', '1'), - ('2.99', '6', '2007-03-18T02:33:55.996577', '12254', '2'), - ('1.99', '91', '2007-04-09T08:48:17.996577', '5187', '2'), - ('2.99', '520', '2007-04-07T17:27:11.996577', '4346', '2'), - ('0.99', '125', '2007-04-30T22:37:33.996577', '9504', '2'), - ('2.99', '30', '2007-02-19T13:38:35.996577', '2730', '2'), - ('4.99', '273', '2007-03-16T21:58:19.996577', '11509', '2'), - ('3.99', '280', '2007-04-29T17:26:50.996577', '8744', '2'), - ('2.99', '226', '2007-02-21T15:27:16.996577', '3414', '2'), - ('1.99', '559', '2007-02-21T11:55:27.996577', '3370', '1'), - ('2.99', '566', '2007-03-01T01:20:31.996577', '10259', '2'), - ('1.99', '523', '2007-03-01T08:20:52.996577', '10470', '2'), - ('2.99', '13', '2007-04-28T10:18:19.996577', '7916', '1'), - ('7.99', '523', '2007-02-19T03:30:06.996577', '2583', '1'), - ('4.99', '392', '2007-02-20T00:29:11.996577', '2890', '2'), - ('7.99', '144', '2007-03-16T23:03:53.996577', '11534', '1'), - ('6.99', '120', '2007-03-22T05:17:41.996577', '14969', '2'), - ('8.99', '532', '2007-03-19T12:58:32.996577', '13192', '1'), - ('2.99', '20', '2007-04-07T20:08:11.996577', '4407', '1'), - ('5.99', '233', '2007-04-09T12:49:36.996577', '5267', '2'), - ('3.99', '172', '2007-03-23T15:56:29.996577', '15902', '1'), - ('0.99', '444', '2007-02-15T03:21:27.996577', '1239', '1'), - ('2.99', '294', '2007-03-02T05:39:19.996577', '11071', '2'), - ('2.99', '405', '2007-03-22T20:59:46.996577', '15383', '2'), - ('0.99', '581', '2007-04-08T06:13:15.996577', '4613', '2'), - ('2.99', '9', '2007-03-18T01:36:36.996577', '12228', '1'), - ('4.99', '10', '2007-03-19T17:51:56.996577', '13316', '2'), - ('0.99', '553', '2007-04-08T08:27:20.996577', '4662', '2'), - ('2.99', '457', '2007-02-20T16:27:31.996577', '3115', '2'), - ('7.99', '560', '2007-03-01T17:56:27.996577', '10733', '1'), - ('0.99', '5', '2007-03-20T13:44:44.996577', '13877', '2'), - ('0.99', '286', '2007-03-18T17:27:01.996577', '12656', '1'), - ('4.99', '66', '2007-03-22T07:30:18.996577', '15026', '2'), - ('0.99', '559', '2007-04-30T08:28:47.996577', '9134', '2'), - ('9.99', '87', '2007-02-20T16:54:23.996577', '3122', '2'), - ('0.99', '420', '2007-04-30T17:12:42.996577', '9362', '1'), - ('2.99', '420', '2007-04-27T02:54:25.996577', '7081', '2'), - ('0.99', '416', '2007-03-23T11:24:17.996577', '15761', '2'), - ('2.99', '526', '2007-04-12T09:25:36.996577', '6650', '2'), - ('1.99', '115', '2007-04-08T14:35:17.996577', '4780', '1'), - ('2.99', '587', '2007-03-01T21:33:59.996577', '10825', '1'), - ('0.99', '143', '2007-04-30T19:44:57.996577', '10118', '1'), - ('0.99', '526', '2007-03-18T15:32:15.996577', '12607', '1'), - ('4.99', '491', '2007-03-17T11:37:27.996577', '11840', '1'), - ('3.99', '273', '2007-04-30T05:40:16.996577', '9693', '2'), - ('0.99', '108', '2007-04-06T16:44:05.996577', '3875', '1'), - ('2.99', '26', '2007-04-07T03:00:54.996577', '4065', '1'), - ('2.99', '565', '2007-03-23T15:19:09.996577', '15885', '1'), - ('5.99', '578', '2007-04-27T02:19:28.996577', '7059', '2'), - ('3.99', '104', '2007-03-18T09:45:33.996577', '12453', '1'), - ('2.99', '294', '2007-04-30T10:57:11.996577', '9194', '2'), - ('9.99', '360', '2007-04-27T21:51:57.996577', '7588', '2'), - ('0.99', '230', '2007-02-16T18:35:53.996577', '1793', '2'), - ('4.99', '111', '2007-03-01T12:58:49.996577', '10602', '2'), - ('7.99', '26', '2007-03-21T18:40:56.996577', '14677', '1'), - ('0.99', '198', '2007-04-08T12:35:29.996577', '4750', '2'), - ('1.99', '38', '2007-02-19T05:16:27.996577', '2605', '2'), - ('9.99', '407', '2007-04-10T02:51:37.996577', '5590', '2'), - ('2.99', '327', '2007-03-19T11:46:36.996577', '13158', '2'), - ('4.99', '20', '2007-04-27T08:00:10.996577', '7217', '2'), - ('3.99', '565', '2007-03-17T00:54:49.996577', '11588', '1'), - ('2.99', '469', '2007-03-20T10:06:22.996577', '13763', '1'), - ('2.99', '232', '2007-04-11T16:41:50.996577', '6309', '1'), - ('4.99', '408', '2007-04-11T10:57:23.996577', '6203', '2'), - ('5.99', '171', '2007-02-19T04:34:33.996577', '2599', '2'), - ('4.99', '598', '2007-04-12T02:29:02.996577', '6519', '1'), - ('1.99', '80', '2007-03-17T11:58:41.996577', '11850', '1'), - ('1.99', '559', '2007-04-27T06:20:05.996577', '7169', '1'), - ('5.99', '145', '2007-04-06T05:57:43.996577', '3647', '1'), - ('4.99', '38', '2007-03-17T10:48:27.996577', '11817', '1'), - ('0.99', '407', '2007-03-22T18:46:15.996577', '15320', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['25836', '31331', '28501', '25441', '30946', '27231', '29417', '20773', '17611', '18577', '21580', '29818', '26692', '18445', '29590', '31892', '26310', '21677', '21271', '23719', '18462', '30205', '20103', '29925', '26501', '21356', '22762', '21539', '28643', '18519', '24412', '23168', '26339', '27984', '31373', '23542', '31451', '24846', '22065', '19924', '20188', '22613', '24593', '29800', '31919', '21658', '31386', '20824', '25870', '24249', '19736', '29005', '28687', '29269', '21652', '21633', '31525', '18913', '27954', '25366', '17580', '25237', '27238', '31759', '27957', '28500', '26619', '28889', '31063', '23557', '27637', '22269', '31321', '32083', '21972', '24071', '20858', '19672', '23350', '19916', '28611', '22857', '28890', '28945', '27331', '18736', '28330', '30123', '25452', '25375', '21873', '31891', '27390', '21704', '19079', '28688', '28156', '22610', '31895', '18310']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('2.99', '326', '2007-04-27T04:17:02.996577', '7117', '1'), - ('3.99', '214', '2007-04-08T23:03:57.996577', '4984', '2'), - ('2.99', '566', '2007-04-28T01:25:03.996577', '7677', '1'), - ('6.99', '292', '2007-04-12T20:13:51.996577', '6900', '1'), - ('4.99', '172', '2007-04-08T15:56:34.996577', '4821', '1'), - ('0.99', '449', '2007-04-05T22:45:50.996577', '3503', '1'), - ('0.99', '38', '2007-04-28T05:56:42.996577', '7795', '1'), - ('5.99', '400', '2007-03-17T01:40:30.996577', '11600', '1'), - ('9.99', '368', '2007-02-15T21:21:56.996577', '1513', '1'), - ('2.99', '22', '2007-02-21T15:46:27.996577', '3419', '1'), - ('0.99', '482', '2007-03-21T20:50:55.996577', '14732', '2'), - ('0.99', '75', '2007-04-08T01:04:47.996577', '4511', '2'), - ('3.99', '402', '2007-04-06T04:05:52.996577', '3612', '2'), - ('7.99', '592', '2007-02-20T19:36:45.996577', '3158', '1'), - ('4.99', '52', '2007-04-30T09:22:10.996577', '9797', '2'), - ('2.99', '265', '2007-04-08T15:07:31.996577', '4797', '1'), - ('1.99', '366', '2007-04-28T23:39:26.996577', '8260', '2'), - ('3.99', '494', '2007-03-19T17:21:41.996577', '13301', '2'), - ('0.99', '451', '2007-03-21T12:39:56.996577', '14500', '2'), - ('0.99', '112', '2007-03-23T07:36:42.996577', '15671', '1'), - ('1.99', '597', '2007-02-20T22:58:52.996577', '3201', '1'), - ('0.99', '107', '2007-04-11T06:53:48.996577', '6133', '2'), - ('0.99', '331', '2007-03-20T11:00:35.996577', '13795', '1'), - ('2.99', '84', '2007-04-28T08:10:57.996577', '7854', '1'), - ('2.99', '383', '2007-04-29T03:39:45.996577', '8367', '2'), - ('8.99', '460', '2007-03-19T14:04:04.996577', '13215', '2'), - ('7.99', '8', '2007-03-22T20:37:35.996577', '15374', '1'), - ('3.99', '477', '2007-03-21T14:27:53.996577', '14552', '2'), - ('4.99', '578', '2007-04-09T17:32:56.996577', '5377', '1'), - ('2.99', '6', '2007-02-16T22:12:39.996577', '1841', '2'), - ('8.99', '180', '2007-03-02T03:09:43.996577', '10992', '1'), - ('0.99', '51', '2007-03-18T00:04:26.996577', '12184', '1'), - ('4.99', '369', '2007-04-08T17:22:30.996577', '4859', '2'), - ('2.99', '518', '2007-04-12T09:28:04.996577', '6652', '1'), - ('4.99', '219', '2007-04-11T09:00:35.996577', '6172', '2'), - ('2.99', '89', '2007-03-23T14:07:00.996577', '15845', '1'), - ('4.99', '226', '2007-04-07T16:26:22.996577', '4324', '1'), - ('2.99', '234', '2007-03-19T19:11:42.996577', '13349', '2'), - ('6.99', '535', '2007-03-22T17:48:03.996577', '15287', '1'), - ('2.99', '308', '2007-03-22T04:35:36.996577', '14946', '2'), - ('3.99', '340', '2007-03-01T15:40:18.996577', '10674', '2'), - ('0.99', '598', '2007-03-21T07:09:41.996577', '14345', '2'), - ('4.99', '198', '2007-03-22T22:55:44.996577', '15433', '1'), - ('2.99', '73', '2007-04-12T09:08:21.996577', '6645', '1'), - ('3.98', '269', '2007-05-14T13:44:29.996577', '13025', '1'), - ('5.99', '491', '2007-03-23T08:09:54.996577', '15685', '2'), - ('0.99', '220', '2007-04-11T21:47:47.996577', '6412', '2'), - ('0.99', '405', '2007-03-19T20:37:14.996577', '13398', '1'), - ('2.99', '330', '2007-04-06T06:31:40.996577', '3659', '2'), - ('4.99', '162', '2007-03-22T19:10:19.996577', '15332', '1'), - ('0.99', '288', '2007-03-21T21:49:49.996577', '14756', '2'), - ('2.99', '2', '2007-04-10T04:59:50.996577', '5636', '1'), - ('5.99', '581', '2007-04-08T08:41:34.996577', '4669', '1'), - ('4.99', '26', '2007-04-28T23:02:02.996577', '8241', '1'), - ('6.99', '491', '2007-03-02T02:39:18.996577', '10974', '2'), - ('2.99', '488', '2007-03-22T19:43:55.996577', '15350', '1'), - ('5.99', '232', '2007-04-11T12:44:36.996577', '6234', '2'), - ('4.99', '107', '2007-02-19T21:49:06.996577', '2860', '2'), - ('2.99', '515', '2007-04-10T01:19:03.996577', '5546', '2'), - ('2.99', '286', '2007-04-12T06:48:49.996577', '6611', '2'), - ('6.99', '360', '2007-02-18T14:53:11.996577', '2402', '2'), - ('0.99', '275', '2007-04-12T18:18:42.996577', '6856', '2'), - ('5.99', '449', '2007-04-30T18:38:45.996577', '10083', '2'), - ('5.99', '252', '2007-04-29T12:52:39.996577', '8636', '1'), - ('4.99', '515', '2007-04-29T15:47:41.996577', '8706', '1'), - ('2.99', '566', '2007-04-11T19:46:06.996577', '6365', '2'), - ('3.99', '394', '2007-04-27T16:25:41.996577', '7445', '2'), - ('4.99', '598', '2007-04-06T21:22:23.996577', '3972', '1'), - ('4.99', '181', '2007-04-30T10:54:57.996577', '9844', '1'), - ('4.99', '91', '2007-03-19T14:16:24.996577', '13222', '2'), - ('4.99', '486', '2007-04-08T23:52:33.996577', '5006', '2'), - ('5.99', '559', '2007-03-20T12:59:47.996577', '13845', '1'), - ('0.99', '213', '2007-04-09T19:49:37.996577', '5431', '1'), - ('0.99', '215', '2007-05-14T13:44:29.996577', '15862', '2'), - ('4.99', '526', '2007-03-22T21:34:51.996577', '15395', '1'), - ('2.99', '146', '2007-03-18T07:07:59.996577', '12385', '1'), - ('2.99', '408', '2007-03-23T05:56:30.996577', '15628', '1'), - ('2.99', '280', '2007-03-16T22:24:54.996577', '11517', '1'), - ('4.99', '70', '2007-03-17T17:24:31.996577', '12003', '1'), - ('0.99', '308', '2007-03-01T20:31:17.996577', '10797', '2'), - ('2.99', '575', '2007-04-29T15:55:41.996577', '8711', '2'), - ('9.99', '19', '2007-03-18T00:59:44.996577', '12211', '1'), - ('4.99', '598', '2007-04-07T08:56:20.996577', '4181', '1'), - ('3.99', '205', '2007-04-07T11:15:13.996577', '4230', '2'), - ('10.99', '459', '2007-04-29T09:48:25.996577', '8557', '2'), - ('4.99', '58', '2007-02-18T00:01:35.996577', '2191', '1'), - ('9.99', '549', '2007-04-30T22:53:31.996577', '9511', '2'), - ('2.99', '101', '2007-04-09T09:17:36.996577', '5198', '2'), - ('0.99', '293', '2007-04-07T17:17:20.996577', '4343', '2'), - ('5.99', '286', '2007-04-30T19:22:46.996577', '10105', '2'), - ('2.99', '515', '2007-03-18T08:25:14.996577', '12416', '2'), - ('0.99', '265', '2007-04-08T05:56:31.996577', '4610', '1'), - ('2.99', '465', '2007-04-27T19:01:34.996577', '7508', '2'), - ('0.99', '497', '2007-03-21T00:14:20.996577', '14134', '2'), - ('2.99', '149', '2007-02-16T18:47:12.996577', '1800', '1'), - ('8.99', '581', '2007-04-08T15:41:17.996577', '4815', '1'), - ('2.99', '532', '2007-04-09T08:53:50.996577', '5190', '2'), - ('4.99', '597', '2007-03-22T23:58:25.996577', '15469', '1'), - ('9.99', '265', '2007-04-10T09:01:18.996577', '5710', '1'), - ('3.99', '557', '2007-02-20T11:31:29.996577', '3050', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['23927', '22489', '23493', '30346', '28641', '29051', '21645', '27468', '27473', '19622', '26932', '27429', '31544', '20226', '19737', '24381', '26081', '30174', '24335', '25758', '18648', '18127', '17788', '29392', '19680', '27662', '22929', '24321', '23925', '28420', '29762', '23485', '28510', '19896', '28883', '19955', '28970', '29223', '20266', '29244', '31512', '18397', '18567', '25439', '26857', '28158', '31315', '28709', '23658', '30017', '31944', '23380', '23246', '26969', '31546', '21268', '23539', '32059', '21075', '27875', '25235', '27761', '20703', '18961', '29374', '22055', '21774', '28747', '18935', '31538', '23527', '31316', '18666', '30388', '27771', '28396', '20452', '20011', '21477', '18822', '27442', '29959', '21197', '19016', '27343', '29061', '24177', '23021', '29979', '26736', '28099', '17920', '23782', '19950', '25290', '21768', '24729', '30706', '22094', '23243']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('4.99', '133', '2007-03-19T00:15:56.996577', '12834', '1'), - ('4.99', '583', '2007-03-01T20:36:10.996577', '10800', '2'), - ('0.99', '84', '2007-03-17T13:57:38.996577', '11899', '2'), - ('0.99', '120', '2007-04-12T01:46:33.996577', '6503', '2'), - ('6.99', '577', '2007-04-29T14:18:03.996577', '8671', '2'), - ('4.99', '5', '2007-04-30T22:20:56.996577', '9493', '1'), - ('7.99', '490', '2007-03-01T19:58:00.996577', '10786', '1'), - ('2.99', '471', '2007-04-30T00:45:53.996577', '9560', '2'), - ('5.99', '472', '2007-04-11T14:38:08.996577', '6274', '2'), - ('2.99', '276', '2007-03-02T06:05:10.996577', '11085', '2'), - ('2.99', '423', '2007-04-27T05:23:53.996577', '7141', '2'), - ('0.99', '469', '2007-04-09T06:11:48.996577', '5133', '1'), - ('4.99', '233', '2007-04-11T17:19:11.996577', '6319', '1'), - ('0.99', '343', '2007-03-01T21:22:54.996577', '10822', '1'), - ('2.99', '288', '2007-03-22T08:49:21.996577', '15058', '2'), - ('0.99', '177', '2007-03-02T10:10:49.996577', '11195', '1'), - ('4.99', '347', '2007-04-30T01:33:45.996577', '9582', '1'), - ('1.99', '104', '2007-04-09T17:22:34.996577', '5376', '1'), - ('0.99', '172', '2007-03-19T18:50:02.996577', '13342', '1'), - ('6.99', '319', '2007-04-12T00:36:25.996577', '6485', '1'), - ('0.99', '35', '2007-02-18T02:20:40.996577', '2231', '1'), - ('6.99', '504', '2007-02-20T03:45:48.996577', '2938', '1'), - ('4.99', '414', '2007-02-18T03:22:55.996577', '2246', '1'), - ('0.99', '36', '2007-04-28T00:03:43.996577', '7647', '1'), - ('5.99', '280', '2007-03-23T03:16:38.996577', '15554', '2'), - ('5.99', '488', '2007-04-27T13:47:59.996577', '7373', '1'), - ('5.99', '25', '2007-03-23T18:28:56.996577', '15972', '1'), - ('5.99', '171', '2007-03-19T04:51:14.996577', '12962', '1'), - ('0.99', '133', '2007-03-01T15:24:43.996577', '10665', '1'), - ('7.99', '559', '2007-04-07T18:34:02.996577', '4370', '1'), - ('5.99', '70', '2007-04-10T20:25:40.996577', '5927', '1'), - ('4.99', '83', '2007-03-20T13:41:37.996577', '13875', '1'), - ('4.99', '566', '2007-04-30T07:15:39.996577', '9101', '2'), - ('4.99', '306', '2007-03-02T07:58:37.996577', '11142', '2'), - ('4.99', '597', '2007-04-28T12:26:01.996577', '7968', '2'), - ('3.99', '312', '2007-03-21T12:51:27.996577', '14504', '1'), - ('0.99', '207', '2007-04-08T23:54:48.996577', '5007', '2'), - ('4.99', '22', '2007-04-30T01:29:37.996577', '9580', '1'), - ('2.99', '348', '2007-03-01T19:11:28.996577', '10769', '1'), - ('0.99', '24', '2007-04-30T06:59:44.996577', '9723', '1'), - ('3.99', '230', '2007-04-30T17:41:55.996577', '10050', '2'), - ('2.99', '579', '2007-02-20T16:15:13.996577', '3111', '1'), - ('2.99', '19', '2007-02-21T16:06:28.996577', '3423', '2'), - ('4.99', '292', '2007-04-10T20:59:27.996577', '5940', '1'), - ('2.99', '416', '2007-04-06T16:22:39.996577', '3868', '1'), - ('4.99', '532', '2007-04-09T13:12:49.996577', '5278', '2'), - ('4.99', '212', '2007-04-28T13:38:51.996577', '8000', '2'), - ('9.99', '583', '2007-04-06T22:02:07.996577', '3991', '2'), - ('0.99', '104', '2007-03-22T14:21:23.996577', '15186', '2'), - ('0.99', '91', '2007-04-29T02:02:47.996577', '8313', '1'), - ('4.99', '359', '2007-05-14T13:44:29.996577', '15655', '2'), - ('4.99', '73', '2007-03-01T07:15:26.996577', '10434', '2'), - ('5.99', '58', '2007-03-21T05:57:31.996577', '14305', '2'), - ('0.99', '425', '2007-04-30T10:03:50.996577', '9170', '1'), - ('8.99', '233', '2007-04-27T02:14:53.996577', '7056', '1'), - ('0.99', '451', '2007-03-19T20:05:24.996577', '13380', '2'), - ('2.99', '89', '2007-03-18T09:03:25.996577', '12431', '2'), - ('7.98', '155', '2007-05-14T13:44:29.996577', '11496', '2'), - ('2.99', '432', '2007-03-20T19:50:00.996577', '14027', '1'), - ('5.99', '507', '2007-04-28T05:18:01.996577', '7770', '2'), - ('9.99', '275', '2007-04-08T19:54:37.996577', '4912', '2'), - ('6.99', '497', '2007-04-29T20:16:21.996577', '8813', '2'), - ('4.99', '392', '2007-03-20T05:32:33.996577', '13629', '1'), - ('0.99', '118', '2007-02-18T01:40:55.996577', '2217', '2'), - ('0.99', '35', '2007-04-09T15:02:33.996577', '5323', '2'), - ('7.99', '535', '2007-03-17T12:11:33.996577', '11855', '1'), - ('2.99', '504', '2007-03-19T20:14:36.996577', '13387', '2'), - ('2.99', '586', '2007-04-12T10:29:33.996577', '6679', '1'), - ('4.99', '112', '2007-02-16T21:34:02.996577', '1835', '1'), - ('2.99', '232', '2007-04-30T21:07:14.996577', '10157', '2'), - ('2.99', '87', '2007-03-21T14:53:31.996577', '14566', '1'), - ('3.99', '212', '2007-04-30T01:25:52.996577', '8940', '1'), - ('7.99', '40', '2007-02-18T18:56:57.996577', '2470', '2'), - ('2.99', '124', '2007-04-08T10:33:00.996577', '4709', '2'), - ('2.99', '498', '2007-04-11T02:32:17.996577', '6058', '1'), - ('3.99', '557', '2007-04-12T11:56:02.996577', '6713', '2'), - ('0.99', '368', '2007-03-17T11:44:30.996577', '11844', '1'), - ('0.99', '320', '2007-03-02T10:31:03.996577', '11208', '1'), - ('4.99', '471', '2007-03-18T03:01:37.996577', '12271', '1'), - ('4.99', '84', '2007-02-15T09:10:39.996577', '1320', '2'), - ('4.99', '469', '2007-04-30T18:27:08.996577', '10075', '2'), - ('2.99', '87', '2007-04-30T16:45:35.996577', '9348', '1'), - ('4.99', '444', '2007-03-22T16:26:53.996577', '15249', '1'), - ('4.99', '132', '2007-02-20T16:51:56.996577', '3121', '1'), - ('3.99', '460', '2007-04-28T05:44:37.996577', '7785', '1'), - ('0.99', '6', '2007-04-28T17:15:49.996577', '8101', '1'), - ('2.99', '155', '2007-03-21T14:22:47.996577', '14549', '2'), - ('1.99', '35', '2007-03-02T14:00:58.996577', '11298', '1'), - ('2.99', '89', '2007-04-12T14:24:01.996577', '6772', '1'), - ('0.99', '405', '2007-04-28T04:57:11.996577', '7759', '1'), - ('3.99', '527', '2007-04-10T23:56:59.996577', '6003', '2'), - ('0.99', '451', '2007-02-15T00:36:30.996577', '1202', '1'), - ('6.99', '119', '2007-03-19T00:25:47.996577', '12842', '2'), - ('0.99', '312', '2007-03-02T12:04:00.996577', '11248', '2'), - ('6.99', '280', '2007-04-29T15:13:21.996577', '8695', '2'), - ('0.99', '504', '2007-03-01T05:39:53.996577', '10397', '2'), - ('4.99', '220', '2007-03-02T01:51:49.996577', '10948', '1'), - ('6.99', '150', '2007-04-07T13:07:18.996577', '4271', '1'), - ('5.99', '539', '2007-03-20T10:32:10.996577', '13778', '2'), - ('3.99', '58', '2007-03-19T13:43:04.996577', '13207', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['22856', '23723', '22925', '19121', '31537', '17939', '30629', '28471', '25740', '28644', '32049', '32038', '25586', '26087', '18380', '30322', '25683', '23306', '18295', '17668', '30126', '25364', '30603', '22129', '26298', '31968', '29505', '18930', '32048', '19761', '22429', '28612', '18069', '26085', '28744', '19696', '25443', '22239', '25837', '32060', '19872', '29136', '28752', '19371', '27636', '29234', '22737', '18595', '17610', '22063', '27425', '20706', '23284', '20168', '25262', '22797', '21073', '29057', '27273', '28486', '20930', '19043', '31760', '31044', '22421', '26835', '18821', '27339', '22909', '20726', '25138', '27692', '22988', '30063', '25605', '30870', '32052', '23184', '25781', '31530', '18520', '23606', '20612', '29506', '30303', '19548', '30621', '30848', '31532', '25471', '29981', '31336', '25273', '29405', '30242', '24117', '24047', '21630', '21898', '27401']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('5.99', '19', '2007-03-17T12:38:48.996577', '11869', '1'), - ('1.99', '113', '2007-03-01T12:16:28.996577', '10578', '2'), - ('0.99', '25', '2007-03-19T03:17:14.996577', '12922', '1'), - ('4.99', '162', '2007-02-15T10:50:22.996577', '1339', '2'), - ('2.99', '232', '2007-04-30T17:14:28.996577', '9365', '2'), - ('1.99', '454', '2007-02-16T23:45:57.996577', '1861', '1'), - ('2.99', '144', '2007-04-27T21:03:11.996577', '7566', '2'), - ('0.99', '563', '2007-04-27T22:40:21.996577', '7612', '2'), - ('4.99', '317', '2007-04-29T06:33:35.996577', '8458', '1'), - ('0.99', '578', '2007-04-09T20:28:07.996577', '5445', '1'), - ('1.98', '107', '2007-05-14T13:44:29.996577', '13079', '1'), - ('8.97', '75', '2007-05-14T13:44:29.996577', '13534', '2'), - ('0.99', '303', '2007-04-29T18:07:30.996577', '8764', '2'), - ('0.99', '348', '2007-04-08T07:08:05.996577', '4633', '2'), - ('2.99', '575', '2007-02-16T20:19:30.996577', '1824', '1'), - ('1.99', '118', '2007-04-12T02:01:38.996577', '6507', '1'), - ('6.99', '312', '2007-04-29T05:13:16.996577', '8412', '1'), - ('7.99', '65', '2007-03-17T21:30:26.996577', '12114', '1'), - ('3.99', '553', '2007-02-16T23:57:56.996577', '1862', '2'), - ('4.99', '382', '2007-02-20T17:00:24.996577', '3125', '2'), - ('5.99', '101', '2007-04-27T04:07:08.996577', '7112', '2'), - ('2.99', '286', '2007-04-08T18:49:57.996577', '4894', '1'), - ('4.99', '142', '2007-04-08T01:56:25.996577', '4531', '1'), - ('0.99', '543', '2007-03-19T12:53:14.996577', '13187', '1'), - ('0.99', '366', '2007-04-09T16:53:14.996577', '5364', '2'), - ('4.99', '452', '2007-05-14T13:44:29.996577', '14175', '1'), - ('0.99', '45', '2007-04-10T05:00:03.996577', '5637', '1'), - ('2.99', '111', '2007-02-17T07:58:31.996577', '1974', '2'), - ('0.99', '101', '2007-05-14T13:44:29.996577', '12141', '2'), - ('4.99', '291', '2007-03-21T03:53:21.996577', '14241', '2'), - ('4.99', '576', '2007-03-21T12:43:04.996577', '14501', '1'), - ('0.99', '575', '2007-04-29T23:36:59.996577', '8904', '2'), - ('2.99', '486', '2007-02-19T17:32:58.996577', '2797', '2'), - ('4.99', '348', '2007-04-06T04:05:25.996577', '3610', '2'), - ('6.99', '586', '2007-04-05T21:59:02.996577', '3487', '2'), - ('3.99', '284', '2007-03-17T23:12:56.996577', '12162', '2'), - ('2.99', '292', '2007-04-27T07:56:11.996577', '7216', '1'), - ('6.99', '555', '2007-03-22T10:27:24.996577', '15102', '2'), - ('2.99', '326', '2007-04-28T03:15:40.996577', '7725', '2'), - ('0.00', '155', '2007-05-14T13:44:29.996577', '12352', '1'), - ('0.99', '303', '2007-03-17T21:39:38.996577', '12117', '2'), - ('11.99', '13', '2007-04-29T21:06:07.996577', '8831', '2'), - ('3.99', '587', '2007-04-09T11:50:34.996577', '5243', '2'), - ('2.99', '233', '2007-02-18T16:03:34.996577', '2424', '1'), - ('7.99', '486', '2007-04-08T14:09:37.996577', '4772', '1'), - ('9.99', '23', '2007-04-30T12:55:12.996577', '9255', '2'), - ('0.99', '6', '2007-03-17T06:40:46.996577', '11727', '1'), - ('4.99', '26', '2007-02-16T12:29:28.996577', '1706', '2'), - ('0.99', '368', '2007-02-14T23:25:11.996577', '1186', '1'), - ('4.99', '535', '2007-03-21T13:30:00.996577', '14522', '1'), - ('4.99', '469', '2007-04-05T23:28:47.996577', '3522', '2'), - ('0.99', '392', '2007-03-21T08:02:10.996577', '14369', '2'), - ('0.99', '62', '2007-03-23T04:40:18.996577', '15591', '1'), - ('4.99', '338', '2007-03-17T04:18:47.996577', '11671', '2'), - ('2.99', '277', '2007-04-29T05:10:02.996577', '8410', '2'), - ('0.99', '13', '2007-03-02T14:33:43.996577', '11315', '2'), - ('0.99', '432', '2007-03-17T12:39:54.996577', '11870', '2'), - ('7.99', '6', '2007-04-11T13:30:20.996577', '6248', '1'), - ('6.99', '453', '2007-04-30T14:25:30.996577', '9289', '2'), - ('2.99', '565', '2007-04-06T14:58:09.996577', '3838', '1'), - ('2.99', '416', '2007-03-01T04:15:36.996577', '10354', '1'), - ('0.99', '140', '2007-02-20T20:44:13.996577', '3171', '2'), - ('0.99', '252', '2007-04-29T23:33:56.996577', '8899', '1'), - ('0.99', '180', '2007-04-09T17:46:12.996577', '5384', '2'), - ('2.99', '575', '2007-03-22T04:48:33.996577', '14952', '2'), - ('10.99', '414', '2007-04-06T20:34:13.996577', '3957', '1'), - ('0.99', '84', '2007-02-15T00:06:04.996577', '1195', '2'), - ('3.99', '460', '2007-04-09T22:21:30.996577', '5482', '2'), - ('0.99', '23', '2007-03-20T00:50:06.996577', '13511', '2'), - ('0.99', '394', '2007-03-21T16:24:32.996577', '14605', '1'), - ('1.99', '265', '2007-03-18T00:52:33.996577', '12207', '1'), - ('2.99', '491', '2007-04-11T08:58:01.996577', '6171', '2'), - ('2.99', '30', '2007-03-23T13:45:40.996577', '15829', '2'), - ('4.99', '96', '2007-04-10T07:11:08.996577', '5678', '1'), - ('8.99', '305', '2007-04-10T10:38:37.996577', '5745', '1'), - ('2.99', '166', '2007-04-06T05:46:46.996577', '3642', '1'), - ('2.99', '111', '2007-05-14T13:44:29.996577', '15542', '2'), - ('5.99', '52', '2007-03-19T09:08:20.996577', '13090', '2'), - ('6.99', '321', '2007-04-29T14:45:31.996577', '8685', '2'), - ('2.99', '232', '2007-04-28T04:22:02.996577', '7749', '1'), - ('0.99', '6', '2007-02-17T07:48:11.996577', '1966', '1'), - ('3.99', '98', '2007-03-01T16:43:33.996577', '10694', '2'), - ('0.99', '383', '2007-03-02T07:17:35.996577', '11122', '2'), - ('0.99', '45', '2007-04-10T23:53:10.996577', '6001', '2'), - ('3.99', '115', '2007-04-30T16:53:56.996577', '10022', '2'), - ('2.99', '269', '2007-03-23T12:23:05.996577', '15788', '2'), - ('3.99', '144', '2007-04-08T15:46:48.996577', '4818', '2'), - ('3.99', '164', '2007-04-10T18:41:45.996577', '5895', '1'), - ('2.99', '232', '2007-04-29T01:40:52.996577', '8306', '1'), - ('0.99', '294', '2007-04-30T22:41:02.996577', '10186', '2'), - ('4.99', '89', '2007-04-28T03:26:23.996577', '7729', '2'), - ('4.99', '214', '2007-04-29T14:01:44.996577', '8663', '1'), - ('2.99', '278', '2007-04-30T20:24:39.996577', '9448', '2'), - ('5.99', '38', '2007-04-07T09:52:14.996577', '4202', '1'), - ('1.99', '111', '2007-04-05T21:54:20.996577', '3485', '2'), - ('2.99', '150', '2007-03-01T16:19:47.996577', '10686', '1'), - ('2.99', '144', '2007-03-18T20:27:26.996577', '12733', '2'), - ('4.99', '488', '2007-03-19T22:34:39.996577', '13446', '2'), - ('4.99', '518', '2007-03-19T08:17:18.996577', '13065', '1'), - ('4.99', '467', '2007-04-09T07:25:33.996577', '5160', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['23355', '17769', '21705', '17550', '28746', '22274', '29542', '20031', '21682', '28101', '26490', '20385', '30091', '20073', '22299', '28055', '31323', '18359', '23321', '26000', '22101', '24432', '32011', '29186', '20243', '25258', '28395', '19193', '23381', '18990', '31736', '18622', '31292', '28646', '31319', '30401', '19067', '18336', '20199', '21626', '28525', '20308', '21562', '27576', '18779', '26591', '31290', '22897', '28826', '21670', '23680', '24586', '24757', '24416', '21280', '28162', '28968', '31385', '29914', '17771', '20917', '28488', '24592', '19760', '21454', '28888', '19685', '26240', '26666', '24336', '20422', '25869', '31719', '24974', '21976', '21555', '19152', '19759', '22837', '24273', '18432', '27281', '19730', '25271', '26294', '28048', '22066', '24052', '31233', '23627', '19317', '22740', '31317', '27758', '19632', '31058', '19418', '26958', '20846', '20067']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('0.99', '70', '2007-03-22T16:14:38.996577', '15238', '2'), - ('2.99', '407', '2007-02-16T11:33:08.996577', '1698', '1'), - ('5.99', '497', '2007-03-22T20:08:46.996577', '15362', '1'), - ('4.99', '352', '2007-02-16T09:36:54.996577', '1678', '1'), - ('2.99', '586', '2007-04-09T17:41:23.996577', '5382', '2'), - ('4.99', '560', '2007-03-01T08:42:07.996577', '10480', '2'), - ('7.99', '49', '2007-04-12T02:34:37.996577', '6521', '1'), - ('0.99', '323', '2007-03-16T23:28:13.996577', '11548', '2'), - ('4.99', '494', '2007-03-22T17:56:30.996577', '15291', '2'), - ('2.99', '527', '2007-04-11T02:02:55.996577', '6050', '1'), - ('0.99', '382', '2007-04-27T23:16:22.996577', '7625', '2'), - ('5.99', '361', '2007-03-02T12:01:14.996577', '11243', '2'), - ('2.99', '98', '2007-04-30T07:51:04.996577', '9753', '1'), - ('7.99', '327', '2007-03-23T18:19:56.996577', '15969', '2'), - ('2.99', '562', '2007-03-22T15:12:52.996577', '15212', '1'), - ('5.99', '523', '2007-04-29T03:46:34.996577', '8372', '1'), - ('0.99', '213', '2007-04-27T19:43:51.996577', '7528', '2'), - ('3.99', '570', '2007-02-18T04:14:41.996577', '2261', '2'), - ('0.99', '66', '2007-03-21T09:58:09.996577', '14429', '2'), - ('4.99', '340', '2007-04-11T20:27:14.996577', '6381', '2'), - ('4.99', '540', '2007-03-18T00:42:32.996577', '12201', '2'), - ('2.99', '181', '2007-03-19T21:16:35.996577', '13415', '2'), - ('4.99', '9', '2007-05-14T13:44:29.996577', '15813', '1'), - ('2.99', '18', '2007-04-11T06:43:34.996577', '6128', '2'), - ('4.99', '345', '2007-03-18T23:05:00.996577', '12805', '2'), - ('2.99', '277', '2007-04-10T19:27:21.996577', '5913', '1'), - ('0.99', '557', '2007-04-11T23:40:29.996577', '6459', '1'), - ('2.99', '180', '2007-02-19T12:00:18.996577', '2700', '2'), - ('4.99', '73', '2007-03-02T06:36:56.996577', '11102', '1'), - ('4.99', '125', '2007-02-20T16:34:23.996577', '3118', '1'), - ('0.99', '250', '2007-04-10T01:12:47.996577', '5540', '1'), - ('2.99', '30', '2007-02-17T02:53:38.996577', '1895', '2'), - ('3.99', '210', '2007-04-29T14:32:26.996577', '8678', '2'), - ('4.99', '578', '2007-04-12T14:57:15.996577', '6784', '1'), - ('8.99', '213', '2007-04-08T08:17:48.996577', '4655', '1'), - ('0.99', '125', '2007-04-28T08:56:12.996577', '7879', '2'), - ('0.99', '146', '2007-02-19T17:44:22.996577', '2800', '1'), - ('0.99', '563', '2007-02-19T02:51:44.996577', '2573', '2'), - ('9.99', '340', '2007-03-22T20:53:43.996577', '15378', '1'), - ('5.99', '488', '2007-03-01T08:30:08.996577', '10474', '2'), - ('2.99', '568', '2007-04-07T16:23:03.996577', '4322', '1'), - ('5.99', '352', '2007-03-17T09:34:19.996577', '11793', '1'), - ('2.99', '480', '2007-03-22T20:10:06.996577', '15363', '2'), - ('4.99', '481', '2007-04-30T21:54:31.996577', '9481', '1'), - ('0.99', '73', '2007-02-16T08:48:46.996577', '1669', '1'), - ('2.99', '392', '2007-04-06T01:37:17.996577', '3566', '1'), - ('0.99', '210', '2007-04-28T10:06:34.996577', '7909', '2'), - ('9.99', '22', '2007-03-19T08:11:51.996577', '13060', '2'), - ('3.99', '592', '2007-04-30T20:04:30.996577', '9437', '1'), - ('6.99', '493', '2007-03-23T00:36:44.996577', '15490', '1'), - ('3.99', '107', '2007-03-23T03:29:39.996577', '15560', '1'), - ('4.99', '198', '2007-03-18T14:52:50.996577', '12594', '2'), - ('7.99', '223', '2007-03-22T16:49:30.996577', '15257', '1'), - ('2.99', '180', '2007-03-20T18:01:47.996577', '13994', '1'), - ('0.99', '452', '2007-03-23T16:11:08.996577', '15909', '1'), - ('4.99', '532', '2007-04-12T06:06:51.996577', '6598', '2'), - ('5.99', '207', '2007-04-08T10:40:59.996577', '4713', '2'), - ('0.99', '220', '2007-04-10T16:30:28.996577', '5859', '2'), - ('2.99', '83', '2007-04-12T18:25:18.996577', '6861', '2'), - ('4.99', '408', '2007-02-18T19:31:34.996577', '2479', '2'), - ('4.99', '414', '2007-03-20T06:30:05.996577', '13657', '2'), - ('0.99', '565', '2007-04-09T00:36:22.996577', '5020', '2'), - ('6.99', '198', '2007-03-22T16:48:33.996577', '15256', '1'), - ('5.99', '291', '2007-03-20T06:47:46.996577', '13665', '1'), - ('4.99', '469', '2007-03-18T09:25:27.996577', '12447', '1'), - ('6.99', '598', '2007-04-06T20:17:10.996577', '3950', '2'), - ('2.99', '282', '2007-03-19T16:26:19.996577', '13278', '1'), - ('1.99', '361', '2007-04-12T20:55:22.996577', '6914', '1'), - ('6.99', '399', '2007-04-11T12:28:16.996577', '6229', '2'), - ('4.99', '172', '2007-03-20T15:51:17.996577', '13937', '2'), - ('0.99', '364', '2007-03-22T16:16:36.996577', '15242', '1'), - ('4.99', '330', '2007-04-06T03:53:29.996577', '3603', '2'), - ('0.99', '248', '2007-04-06T18:33:44.996577', '3910', '1'), - ('5.99', '248', '2007-03-22T02:26:55.996577', '14885', '2'), - ('5.99', '527', '2007-03-02T03:39:20.996577', '11013', '1'), - ('1.99', '480', '2007-03-01T21:05:37.996577', '10808', '2'), - ('4.99', '171', '2007-02-18T21:19:06.996577', '2497', '1'), - ('0.99', '291', '2007-03-02T08:11:50.996577', '11145', '2'), - ('4.99', '16', '2007-03-18T06:10:09.996577', '12358', '1'), - ('5.99', '166', '2007-03-21T04:35:50.996577', '14261', '2'), - ('2.99', '589', '2007-02-20T06:59:31.996577', '2979', '1'), - ('0.99', '454', '2007-04-12T11:16:25.996577', '6701', '2'), - ('2.99', '288', '2007-03-17T15:43:23.996577', '11952', '2'), - ('5.99', '278', '2007-04-28T22:20:19.996577', '8222', '2'), - ('4.99', '366', '2007-04-06T05:06:47.996577', '3632', '2'), - ('4.99', '523', '2007-04-08T05:28:40.996577', '4605', '1'), - ('0.99', '535', '2007-03-23T19:55:37.996577', '16017', '1'), - ('1.99', '144', '2007-03-22T07:16:10.996577', '15017', '1'), - ('4.99', '199', '2007-04-08T22:31:56.996577', '4976', '1'), - ('4.99', '101', '2007-03-17T15:52:01.996577', '11959', '2'), - ('2.99', '215', '2007-02-20T02:37:30.996577', '2918', '2'), - ('6.99', '6', '2007-03-19T22:46:51.996577', '13451', '2'), - ('4.99', '213', '2007-04-06T21:59:20.996577', '3989', '2'), - ('2.99', '497', '2007-04-27T22:23:10.996577', '7603', '2'), - ('3.99', '277', '2007-03-02T05:50:09.996577', '11074', '2'), - ('5.99', '181', '2007-04-29T11:06:40.996577', '8593', '1'), - ('5.99', '243', '2007-02-15T15:09:52.996577', '1405', '1'), - ('5.99', '425', '2007-04-07T18:03:56.996577', '4362', '2'), - ('6.99', '407', '2007-03-21T09:04:46.996577', '14401', '2'), - ('0.99', '327', '2007-03-19T22:41:09.996577', '13448', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['23695', '23170', '25463', '23939', '20613', '17926', '28696', '18921', '23520', '28738', '31753', '23314', '20843', '28252', '23308', '25465', '28155', '22412', '28749', '29312', '31855', '18828', '18302', '21557', '31756', '26003', '27026', '18168', '28498', '18225', '24675', '29314', '19024', '26233', '27527', '20169', '18429', '26900', '18477', '24460', '22301', '22526', '22861', '26902', '29885', '19167', '26618', '27690', '23538', '19921', '26697', '17579', '18582', '30639', '23787', '22472', '17931', '23240', '20314', '23234', '28528', '21287', '17975', '28078', '20451', '18324', '26702', '21391', '18565', '28096', '18824', '29193', '23317', '20552', '28509', '26330', '22934', '19113', '21984', '20721', '25264', '21347', '28638', '24202', '22217', '21326', '25208', '28222', '26773', '23054', '22449', '18331', '18826', '20005', '22800', '32017', '28327', '30508', '30952', '25640']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('2.99', '109', '2007-03-23T07:52:02.996577', '15677', '2'), - ('2.99', '51', '2007-03-19T09:20:25.996577', '13098', '2'), - ('7.99', '294', '2007-04-08T14:41:31.996577', '4786', '1'), - ('2.99', '134', '2007-03-19T06:15:42.996577', '13006', '2'), - ('2.99', '383', '2007-03-17T01:04:30.996577', '11592', '1'), - ('6.99', '451', '2007-02-21T06:48:44.996577', '3316', '1'), - ('1.99', '581', '2007-04-30T20:31:00.996577', '9449', '1'), - ('2.99', '108', '2007-02-18T00:55:27.996577', '2210', '1'), - ('4.99', '87', '2007-03-01T05:10:57.996577', '10387', '1'), - ('4.99', '585', '2007-04-27T14:18:11.996577', '7384', '1'), - ('0.99', '252', '2007-04-11T19:27:17.996577', '6357', '1'), - ('5.99', '66', '2007-03-17T04:43:43.996577', '11683', '1'), - ('2.99', '407', '2007-03-19T03:40:13.996577', '12931', '2'), - ('7.99', '540', '2007-04-11T07:35:27.996577', '6145', '2'), - ('0.99', '65', '2007-03-20T07:36:18.996577', '13692', '2'), - ('6.99', '294', '2007-04-27T15:19:25.996577', '7415', '2'), - ('4.99', '532', '2007-04-08T22:04:39.996577', '4962', '2'), - ('4.99', '575', '2007-03-01T03:25:40.996577', '10331', '1'), - ('2.99', '586', '2007-04-30T12:38:14.996577', '9896', '2'), - ('9.99', '30', '2007-04-09T05:12:56.996577', '5108', '1'), - ('3.99', '262', '2007-04-06T08:39:51.996577', '3699', '1'), - ('5.99', '85', '2007-02-17T19:30:51.996577', '2131', '1'), - ('1.99', '555', '2007-02-21T00:59:03.996577', '3232', '2'), - ('5.99', '480', '2007-03-02T16:33:07.996577', '11369', '1'), - ('0.99', '252', '2007-04-27T04:26:58.996577', '7121', '2'), - ('0.99', '340', '2007-04-29T09:23:27.996577', '8541', '1'), - ('5.99', '432', '2007-04-08T22:15:23.996577', '4965', '1'), - ('5.99', '515', '2007-02-15T23:09:00.996577', '1531', '2'), - ('3.99', '566', '2007-04-06T22:17:46.996577', '3998', '1'), - ('0.99', '530', '2007-02-15T21:39:36.996577', '1516', '1'), - ('4.99', '214', '2007-03-02T20:21:34.996577', '11474', '2'), - ('7.99', '30', '2007-04-10T22:37:20.996577', '5972', '2'), - ('5.99', '134', '2007-02-21T03:23:47.996577', '3267', '1'), - ('0.99', '360', '2007-04-30T16:57:52.996577', '9352', '2'), - ('7.99', '477', '2007-04-08T21:45:36.996577', '4956', '2'), - ('5.99', '338', '2007-03-17T06:14:31.996577', '11719', '2'), - ('4.99', '589', '2007-02-16T11:57:10.996577', '1703', '2'), - ('3.99', '420', '2007-04-11T03:57:29.996577', '6086', '2'), - ('7.99', '204', '2007-02-16T05:33:18.996577', '1616', '1'), - ('0.99', '185', '2007-03-02T16:06:09.996577', '11355', '2'), - ('1.99', '562', '2007-03-23T15:44:56.996577', '15900', '1'), - ('4.99', '587', '2007-03-21T19:43:49.996577', '14710', '2'), - ('4.99', '19', '2007-03-20T23:01:29.996577', '14101', '1'), - ('4.99', '420', '2007-04-12T04:56:38.996577', '6582', '2'), - ('4.99', '80', '2007-04-09T20:51:47.996577', '5452', '2'), - ('1.99', '174', '2007-02-21T19:14:17.996577', '3446', '2'), - ('4.99', '394', '2007-04-11T02:32:20.996577', '6059', '2'), - ('6.99', '491', '2007-04-09T06:21:38.996577', '5134', '2'), - ('3.99', '89', '2007-03-17T21:42:51.996577', '12118', '1'), - ('6.99', '308', '2007-03-18T14:40:01.996577', '12590', '1'), - ('2.99', '402', '2007-04-11T09:43:01.996577', '6183', '2'), - ('0.99', '360', '2007-02-15T20:17:01.996577', '1492', '2'), - ('2.99', '23', '2007-02-21T20:17:44.996577', '3461', '1'), - ('8.99', '145', '2007-04-07T09:48:17.996577', '4201', '2'), - ('0.99', '119', '2007-03-21T18:11:02.996577', '14659', '2'), - ('2.99', '581', '2007-03-20T08:06:30.996577', '13712', '2'), - ('4.99', '452', '2007-02-18T04:33:28.996577', '2266', '2'), - ('6.99', '58', '2007-03-02T18:12:30.996577', '11416', '1'), - ('0.99', '352', '2007-03-22T00:54:19.996577', '14852', '2'), - ('0.99', '57', '2007-03-20T09:19:53.996577', '13743', '2'), - ('4.99', '568', '2007-04-10T12:03:48.996577', '5776', '1'), - ('4.99', '453', '2007-03-21T17:40:38.996577', '14644', '2'), - ('9.99', '459', '2007-02-21T01:08:10.996577', '3234', '2'), - ('5.99', '526', '2007-04-06T18:02:00.996577', '3905', '2'), - ('1.99', '368', '2007-03-01T22:18:48.996577', '10848', '2'), - ('4.99', '561', '2007-02-16T05:49:56.996577', '1620', '2'), - ('0.99', '402', '2007-04-30T08:36:59.996577', '9779', '2'), - ('7.99', '463', '2007-03-17T21:01:16.996577', '12096', '2'), - ('2.99', '19', '2007-02-19T09:11:25.996577', '2657', '1'), - ('2.99', '526', '2007-04-30T23:07:21.996577', '10199', '2'), - ('5.99', '84', '2007-02-17T10:25:41.996577', '2012', '1'), - ('4.99', '19', '2007-04-12T01:25:28.996577', '6495', '2'), - ('2.99', '66', '2007-03-20T14:34:07.996577', '13900', '1'), - ('4.99', '377', '2007-03-18T13:06:33.996577', '12549', '1'), - ('4.99', '566', '2007-04-29T19:39:03.996577', '8797', '1'), - ('5.99', '368', '2007-04-11T08:00:45.996577', '6154', '1'), - ('5.99', '26', '2007-03-17T07:22:56.996577', '11744', '1'), - ('8.99', '158', '2007-02-20T23:03:22.996577', '3203', '2'), - ('0.99', '528', '2007-03-01T15:40:17.996577', '10673', '1'), - ('0.99', '394', '2007-03-01T17:24:04.996577', '10718', '1'), - ('0.99', '277', '2007-04-30T12:49:25.996577', '9901', '1'), - ('5.99', '459', '2007-03-22T11:22:24.996577', '15126', '1'), - ('8.99', '577', '2007-04-28T08:52:48.996577', '7876', '2'), - ('6.99', '158', '2007-03-02T06:38:20.996577', '11103', '1'), - ('0.99', '553', '2007-03-23T01:16:50.996577', '15506', '1'), - ('0.99', '457', '2007-03-20T15:47:14.996577', '13934', '2'), - ('2.99', '273', '2007-04-06T01:14:39.996577', '3556', '2'), - ('2.99', '537', '2007-04-30T14:59:43.996577', '9967', '1'), - ('2.99', '408', '2007-04-12T17:00:28.996577', '6826', '2'), - ('2.99', '38', '2007-03-02T15:41:52.996577', '11344', '1'), - ('0.99', '578', '2007-03-23T07:02:36.996577', '15652', '1'), - ('3.99', '562', '2007-02-17T09:53:23.996577', '1998', '1'), - ('0.99', '84', '2007-02-18T15:21:59.996577', '2409', '2'), - ('2.99', '319', '2007-03-17T16:58:01.996577', '11994', '2'), - ('4.99', '13', '2007-03-19T09:17:29.996577', '13096', '2'), - ('4.99', '22', '2007-05-14T13:44:29.996577', '12222', '1'), - ('0.99', '549', '2007-04-28T23:00:05.996577', '8239', '2'), - ('0.99', '133', '2007-04-30T10:16:14.996577', '9175', '1'), - ('2.99', '172', '2007-04-27T05:02:58.996577', '7135', '1'), - ('2.99', '308', '2007-04-10T21:25:55.996577', '5946', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['28399', '19786', '22177', '29204', '28451', '29230', '25249', '20022', '29092', '22427', '20319', '27309', '18182', '23992', '23405', '19628', '21463', '24057', '19625', '27876', '29043', '26786', '31456', '31663', '30754', '27257', '28758', '26789', '24581', '23599', '18533', '27587', '25466', '18849', '28491', '22519', '26070', '24075', '19332', '23151', '27597', '18448', '30755', '26672', '29445', '19276', '18385', '26221', '22742', '19582', '18051', '29104', '20265', '22433', '23844', '23504', '28131', '18248', '17738', '21911', '21614', '18181', '20321', '30224', '18848', '30830', '27440', '30650', '19306', '30947', '20948', '22241', '18101', '23277', '18671', '17929', '17925', '27387', '21266', '22933', '18483', '20375', '19778', '20394', '22180', '29673', '28256', '22454', '21978', '18937', '29802', '21471', '18966', '25428', '26662', '17972', '25370', '30604', '27929', '26142']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('0.99', '557', '2007-04-30T16:29:41.996577', '9336', '1'), - ('2.99', '294', '2007-03-17T16:39:06.996577', '11981', '2'), - ('2.99', '549', '2007-03-17T12:52:18.996577', '11878', '2'), - ('5.99', '20', '2007-04-28T08:34:36.996577', '7864', '2'), - ('5.99', '562', '2007-04-08T11:38:11.996577', '4732', '2'), - ('7.99', '23', '2007-04-27T05:47:12.996577', '7155', '1'), - ('1.99', '276', '2007-04-30T06:31:05.996577', '9080', '1'), - ('4.99', '322', '2007-03-02T07:15:30.996577', '11120', '2'), - ('2.99', '9', '2007-04-28T06:20:22.996577', '7801', '1'), - ('4.99', '576', '2007-03-19T08:12:05.996577', '13061', '1'), - ('0.99', '353', '2007-03-20T04:31:59.996577', '13604', '2'), - ('2.99', '457', '2007-04-30T17:39:37.996577', '10049', '1'), - ('2.99', '517', '2007-02-19T00:07:05.996577', '2534', '2'), - ('2.99', '139', '2007-03-22T07:25:36.996577', '15024', '1'), - ('2.99', '75', '2007-03-17T17:24:28.996577', '12002', '1'), - ('4.99', '276', '2007-03-20T18:34:31.996577', '14000', '1'), - ('0.99', '470', '2007-03-01T00:34:00.996577', '10236', '1'), - ('2.99', '145', '2007-03-18T16:35:19.996577', '12637', '1'), - ('5.99', '276', '2007-03-17T23:45:58.996577', '12178', '2'), - ('5.99', '507', '2007-04-28T12:27:04.996577', '7970', '1'), - ('8.99', '5', '2007-04-11T01:45:30.996577', '6042', '1'), - ('2.99', '409', '2007-04-10T15:56:40.996577', '5848', '1'), - ('3.99', '226', '2007-04-27T12:24:00.996577', '7329', '1'), - ('4.99', '243', '2007-04-06T21:04:46.996577', '3965', '1'), - ('2.99', '155', '2007-04-11T23:04:17.996577', '6443', '1'), - ('4.99', '452', '2007-04-07T17:47:31.996577', '4353', '2'), - ('4.99', '587', '2007-04-30T08:50:41.996577', '9785', '2'), - ('2.99', '409', '2007-04-12T06:01:25.996577', '6596', '1'), - ('2.99', '198', '2007-03-17T07:57:48.996577', '11756', '1'), - ('0.99', '96', '2007-03-20T00:56:35.996577', '13514', '1'), - ('4.99', '10', '2007-02-17T09:39:40.996577', '1995', '1'), - ('6.99', '482', '2007-04-28T07:31:28.996577', '7840', '2'), - ('4.99', '294', '2007-04-28T05:08:59.996577', '7765', '1'), - ('7.99', '89', '2007-02-15T15:13:33.996577', '1407', '2'), - ('2.99', '565', '2007-04-12T07:45:12.996577', '6627', '1'), - ('0.99', '586', '2007-03-23T08:08:30.996577', '15684', '2'), - ('6.99', '347', '2007-04-08T01:35:25.996577', '4523', '1'), - ('2.99', '146', '2007-03-21T00:38:58.996577', '14143', '2'), - ('0.99', '220', '2007-02-16T21:03:46.996577', '1832', '1'), - ('6.99', '49', '2007-03-21T17:04:20.996577', '14627', '1'), - ('7.99', '483', '2007-04-28T15:35:39.996577', '8057', '1'), - ('4.99', '593', '2007-02-18T17:13:37.996577', '2441', '1'), - ('3.99', '155', '2007-04-27T02:41:28.996577', '7077', '1'), - ('6.99', '400', '2007-04-09T10:06:13.996577', '5212', '2'), - ('8.99', '40', '2007-04-30T05:28:21.996577', '9050', '1'), - ('0.99', '199', '2007-02-21T05:52:00.996577', '3299', '1'), - ('8.99', '576', '2007-02-18T17:26:38.996577', '2444', '2'), - ('2.99', '360', '2007-04-09T21:00:11.996577', '5456', '2'), - ('4.99', '6', '2007-03-21T08:17:54.996577', '14377', '1'), - ('5.99', '273', '2007-03-20T16:33:38.996577', '13955', '1'), - ('2.99', '481', '2007-02-14T22:03:35.996577', '1168', '2'), - ('4.99', '10', '2007-04-30T13:55:33.996577', '9935', '1'), - ('4.99', '347', '2007-03-23T03:20:18.996577', '15555', '2'), - ('0.99', '577', '2007-03-01T08:55:00.996577', '10487', '1'), - ('4.99', '125', '2007-03-17T20:23:21.996577', '12075', '1'), - ('4.99', '85', '2007-03-18T09:50:17.996577', '12456', '1'), - ('4.99', '530', '2007-04-06T17:15:00.996577', '3887', '2'), - ('8.99', '537', '2007-02-19T03:33:37.996577', '2586', '1'), - ('2.99', '399', '2007-02-20T05:57:41.996577', '2961', '2'), - ('0.99', '520', '2007-03-16T23:57:01.996577', '11566', '1'), - ('4.99', '486', '2007-03-21T05:13:03.996577', '14284', '2'), - ('4.99', '517', '2007-02-16T23:00:01.996577', '1850', '1'), - ('1.99', '353', '2007-03-23T03:39:08.996577', '15564', '1'), - ('4.99', '108', '2007-04-29T10:47:06.996577', '8587', '2'), - ('8.99', '89', '2007-02-15T04:33:44.996577', '1252', '1'), - ('4.99', '162', '2007-04-29T07:09:02.996577', '8478', '2'), - ('0.99', '469', '2007-04-29T19:21:49.996577', '8791', '2'), - ('0.99', '145', '2007-04-29T03:59:55.996577', '8380', '1'), - ('4.99', '213', '2007-02-20T00:22:34.996577', '2889', '1'), - ('6.99', '172', '2007-04-08T18:02:15.996577', '4878', '2'), - ('4.99', '417', '2007-03-20T02:18:41.996577', '13545', '1'), - ('1.99', '556', '2007-03-02T20:15:12.996577', '11466', '1'), - ('2.99', '497', '2007-02-18T15:08:03.996577', '2406', '1'), - ('5.99', '62', '2007-03-02T13:51:13.996577', '11297', '1'), - ('7.99', '41', '2007-02-21T01:38:27.996577', '3246', '2'), - ('3.99', '452', '2007-02-16T18:37:03.996577', '1794', '1'), - ('0.99', '451', '2007-02-20T02:37:01.996577', '2917', '2'), - ('5.99', '464', '2007-04-30T02:04:00.996577', '9600', '1'), - ('2.99', '451', '2007-03-19T09:24:11.996577', '13100', '2'), - ('0.99', '26', '2007-03-02T15:28:38.996577', '11338', '1'), - ('4.99', '205', '2007-02-15T11:54:49.996577', '1357', '1'), - ('5.99', '360', '2007-03-18T22:00:45.996577', '12773', '1'), - ('7.99', '293', '2007-03-23T01:17:30.996577', '15508', '1'), - ('2.99', '361', '2007-03-23T17:09:37.996577', '15935', '2'), - ('0.99', '549', '2007-03-21T10:09:12.996577', '14434', '1'), - ('2.99', '62', '2007-04-09T13:45:20.996577', '5292', '2'), - ('4.99', '540', '2007-04-30T08:01:20.996577', '9762', '2'), - ('0.99', '579', '2007-03-21T01:57:03.996577', '14185', '1'), - ('0.99', '527', '2007-03-17T02:46:08.996577', '11624', '1'), - ('4.99', '112', '2007-02-18T00:07:11.996577', '2193', '1'), - ('4.99', '73', '2007-04-28T01:39:55.996577', '7683', '1'), - ('4.99', '470', '2007-03-20T04:00:49.996577', '13585', '2'), - ('3.99', '120', '2007-02-15T13:18:20.996577', '1374', '1'), - ('5.99', '291', '2007-04-27T20:49:31.996577', '7561', '1'), - ('0.99', '399', '2007-04-08T21:47:14.996577', '4957', '2'), - ('0.99', '459', '2007-02-20T01:07:47.996577', '2899', '1'), - ('2.99', '286', '2007-04-27T15:39:08.996577', '7422', '1'), - ('0.99', '142', '2007-04-12T02:40:24.996577', '6522', '1'), - ('2.99', '512', '2007-04-27T08:04:02.996577', '7219', '1'), - ('5.99', '353', '2007-04-07T19:03:26.996577', '4380', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['18659', '21494', '29568', '21274', '30514', '22424', '27260', '20819', '28950', '25843', '20245', '22310', '29268', '18701', '18514', '25274', '21675', '18326', '23691', '23933', '20986', '21772', '26048', '18044', '25218', '27713', '24692', '23406', '29933', '28052', '24638', '27952', '30389', '21465', '18342', '29665', '22425', '29389', '28551', '24056', '20551', '20949', '30222', '22543', '31504', '27428', '31320', '17601', '30132', '30631', '20070', '28683', '19581', '24965', '20827', '24595', '24596', '29717', '20945', '26779', '21563', '20467', '31722', '23693', '27865', '31151', '23791', '18056', '26309', '21830', '19951', '21301', '19956', '30067', '29978', '20916', '26693', '20610', '23247', '22649', '29569', '23110', '18307', '19920', '26795', '27274', '22356', '23316', '31898', '18404', '18155', '22643', '18656', '27329', '29245', '31717', '19331', '22803', '27456', '23941']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('3.99', '38', '2007-02-21T13:41:10.996577', '3392', '2'), - ('5.99', '472', '2007-03-22T14:21:16.996577', '15185', '2'), - ('2.99', '51', '2007-04-09T10:58:49.996577', '5230', '1'), - ('3.99', '452', '2007-03-17T07:04:08.996577', '11735', '1'), - ('4.99', '134', '2007-04-28T12:21:23.996577', '7965', '2'), - ('3.99', '576', '2007-03-01T17:39:25.996577', '10724', '2'), - ('1.99', '452', '2007-04-09T08:11:47.996577', '5177', '1'), - ('4.99', '405', '2007-03-01T21:27:36.996577', '10823', '2'), - ('4.99', '205', '2007-04-29T23:19:47.996577', '8896', '2'), - ('0.99', '326', '2007-04-30T19:30:40.996577', '10108', '1'), - ('4.99', '345', '2007-03-23T02:56:51.996577', '15551', '1'), - ('4.99', '563', '2007-03-23T14:14:08.996577', '15850', '1'), - ('0.99', '26', '2007-04-27T12:23:44.996577', '7328', '2'), - ('6.99', '49', '2007-02-16T17:20:38.996577', '1777', '2'), - ('2.99', '5', '2007-02-16T06:29:28.996577', '1631', '2'), - ('4.99', '279', '2007-04-07T23:02:51.996577', '4476', '1'), - ('5.99', '494', '2007-03-17T16:50:25.996577', '11987', '1'), - ('5.99', '561', '2007-02-18T11:28:07.996577', '2357', '1'), - ('3.99', '109', '2007-03-01T23:40:32.996577', '10892', '2'), - ('6.99', '134', '2007-03-01T22:47:25.996577', '10864', '1'), - ('0.99', '420', '2007-03-21T13:35:15.996577', '14525', '2'), - ('2.99', '504', '2007-03-19T12:04:54.996577', '13166', '1'), - ('8.99', '345', '2007-04-29T15:13:14.996577', '8694', '2'), - ('3.99', '479', '2007-02-17T06:30:46.996577', '1947', '2'), - ('4.99', '273', '2007-04-30T10:42:14.996577', '9186', '1'), - ('2.99', '493', '2007-04-29T12:07:35.996577', '8616', '1'), - ('2.99', '215', '2007-03-23T04:16:21.996577', '15583', '1'), - ('0.99', '75', '2007-03-18T01:55:08.996577', '12239', '2'), - ('0.99', '85', '2007-04-09T23:46:58.996577', '5519', '1'), - ('4.99', '523', '2007-04-12T10:21:32.996577', '6675', '2'), - ('4.99', '210', '2007-03-19T05:38:02.996577', '12986', '2'), - ('6.99', '515', '2007-04-07T05:16:22.996577', '4111', '2'), - ('2.99', '124', '2007-04-10T01:58:43.996577', '5566', '1'), - ('1.99', '470', '2007-03-02T17:21:40.996577', '11397', '2'), - ('4.99', '566', '2007-02-17T08:40:41.996577', '1982', '2'), - ('7.99', '61', '2007-04-27T01:18:41.996577', '7027', '1'), - ('5.99', '576', '2007-03-17T21:28:57.996577', '12112', '2'), - ('0.99', '36', '2007-04-09T18:35:35.996577', '5403', '1'), - ('2.99', '570', '2007-04-30T19:54:44.996577', '9432', '2'), - ('2.99', '145', '2007-03-17T15:47:02.996577', '11954', '2'), - ('1.99', '377', '2007-03-18T07:20:08.996577', '12390', '1'), - ('1.99', '417', '2007-03-20T15:40:24.996577', '13927', '1'), - ('0.99', '108', '2007-04-12T17:32:50.996577', '6841', '1'), - ('0.99', '589', '2007-03-21T14:09:27.996577', '14544', '1'), - ('4.99', '230', '2007-04-11T06:35:22.996577', '6126', '2'), - ('0.99', '469', '2007-04-07T05:44:45.996577', '4123', '2'), - ('4.99', '213', '2007-04-09T07:24:18.996577', '5159', '2'), - ('3.99', '364', '2007-02-20T06:00:21.996577', '2962', '2'), - ('0.99', '101', '2007-04-30T23:38:10.996577', '10218', '2'), - ('3.99', '144', '2007-04-28T08:18:44.996577', '7858', '1'), - ('2.99', '327', '2007-03-22T21:09:40.996577', '15386', '1'), - ('2.99', '581', '2007-04-07T10:04:46.996577', '4210', '2'), - ('4.99', '273', '2007-03-20T09:11:08.996577', '13738', '2'), - ('7.99', '247', '2007-03-18T11:06:02.996577', '12482', '1'), - ('1.99', '405', '2007-03-22T09:27:11.996577', '15072', '1'), - ('8.99', '199', '2007-03-01T22:22:11.996577', '10850', '1'), - ('2.99', '199', '2007-03-02T19:33:05.996577', '11454', '1'), - ('5.99', '65', '2007-04-29T04:55:27.996577', '8404', '2'), - ('0.99', '417', '2007-03-02T14:07:44.996577', '11303', '2'), - ('0.99', '408', '2007-04-30T05:34:34.996577', '9052', '1'), - ('4.99', '480', '2007-03-23T04:07:07.996577', '15579', '2'), - ('1.99', '369', '2007-03-02T17:04:21.996577', '11388', '2'), - ('2.99', '248', '2007-04-09T17:11:45.996577', '5370', '1'), - ('3.99', '109', '2007-03-19T15:55:36.996577', '13264', '1'), - ('4.99', '507', '2007-04-06T06:35:55.996577', '3660', '1'), - ('0.99', '190', '2007-04-29T07:36:04.996577', '8498', '1'), - ('2.99', '119', '2007-03-23T14:06:38.996577', '15844', '1'), - ('0.99', '482', '2007-02-21T02:08:18.996577', '3255', '2'), - ('4.99', '366', '2007-04-28T19:58:12.996577', '8169', '2'), - ('4.99', '512', '2007-03-01T00:19:21.996577', '10232', '2'), - ('5.99', '312', '2007-03-17T12:53:35.996577', '11879', '2'), - ('1.99', '454', '2007-03-23T05:23:52.996577', '15608', '2'), - ('4.99', '312', '2007-03-22T10:23:29.996577', '15100', '1'), - ('3.99', '96', '2007-04-30T07:01:50.996577', '9093', '2'), - ('2.99', '89', '2007-04-09T22:22:35.996577', '5483', '1'), - ('2.99', '414', '2007-03-20T00:05:00.996577', '13494', '2'), - ('5.99', '402', '2007-04-06T11:05:42.996577', '3755', '2'), - ('4.99', '383', '2007-03-02T02:36:43.996577', '10971', '1'), - ('6.99', '58', '2007-03-21T18:18:12.996577', '14665', '1'), - ('4.99', '204', '2007-03-22T20:10:07.996577', '15364', '1'), - ('5.99', '51', '2007-04-09T14:16:32.996577', '5304', '2'), - ('6.99', '45', '2007-03-01T23:01:38.996577', '10878', '2'), - ('6.99', '556', '2007-02-21T18:00:06.996577', '3438', '2'), - ('3.99', '308', '2007-03-18T13:43:02.996577', '12567', '2'), - ('0.99', '409', '2007-04-30T13:27:31.996577', '9267', '2'), - ('6.99', '453', '2007-04-30T18:52:26.996577', '9406', '2'), - ('2.99', '568', '2007-03-02T15:17:27.996577', '11331', '1'), - ('0.99', '66', '2007-03-18T18:49:25.996577', '12699', '1'), - ('5.99', '265', '2007-04-12T03:35:05.996577', '6553', '2'), - ('0.99', '582', '2007-02-20T12:49:08.996577', '3071', '2'), - ('6.99', '512', '2007-02-14T22:57:03.996577', '1176', '1'), - ('6.99', '204', '2007-03-18T20:40:03.996577', '12737', '1'), - ('1.99', '38', '2007-02-19T01:18:21.996577', '2550', '1'), - ('6.99', '459', '2007-04-28T10:15:49.996577', '7913', '1'), - ('0.99', '24', '2007-04-30T13:37:13.996577', '9925', '2'), - ('4.99', '247', '2007-04-10T15:40:03.996577', '5842', '1'), - ('0.99', '219', '2007-02-19T03:12:56.996577', '2580', '2'), - ('9.99', '13', '2007-03-21T04:12:33.996577', '14252', '1'), - ('6.99', '470', '2007-04-29T23:10:32.996577', '8890', '1'), - ('2.99', '134', '2007-03-23T18:11:12.996577', '15963', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['25184', '23312', '29731', '26763', '29048', '17855', '17598', '30585', '29219', '25449', '22236', '30320', '24131', '19771', '20370', '22722', '21917', '22730', '31332', '23793', '22834', '24115', '25772', '19713', '30243', '27551', '28713', '27660', '24778', '20315', '27564', '29667', '28637', '30766', '28901', '23940', '30657', '20984', '22780', '19541', '23303', '31287', '25592', '25424', '26806', '20876', '20874', '26797', '26798', '20877', '20871', '26796', '17779', '17777', '20870', '17778', '26802', '20878', '17776', '20869', '20879', '20866', '26800', '20882', '20867', '26799', '27520', '21529', '18032', '27521', '21530', '24501', '31141', '31136', '24500', '31139', '19232', '31140', '31137', '31144', '24505', '19230', '31135', '27077', '27079', '21113', '21114', '27071', '27078', '27081', '21120', '21116', '21112', '21115', '21119', '27075', '27076', '27082', '21108', '25161']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('6.99', '269', '2007-04-27T20:04:35.996577', '7537', '1'), - ('5.99', '66', '2007-03-02T04:16:46.996577', '11028', '2'), - ('5.99', '66', '2007-04-30T06:59:11.996577', '9091', '1'), - ('4.99', '407', '2007-04-27T23:48:10.996577', '7643', '2'), - ('3.99', '5', '2007-04-28T07:12:05.996577', '7829', '2'), - ('2.99', '432', '2007-02-16T04:15:29.996577', '1597', '2'), - ('2.99', '364', '2007-02-18T17:17:44.996577', '2442', '2'), - ('0.99', '140', '2007-04-12T04:20:13.996577', '6571', '2'), - ('2.99', '22', '2007-04-10T14:16:45.996577', '5815', '1'), - ('5.99', '292', '2007-04-30T09:12:07.996577', '9792', '1'), - ('2.99', '555', '2007-03-17T23:58:45.996577', '12182', '2'), - ('1.99', '118', '2007-04-10T14:58:07.996577', '5829', '1'), - ('9.99', '150', '2007-03-21T13:29:15.996577', '14520', '2'), - ('6.99', '293', '2007-03-19T06:24:17.996577', '13013', '2'), - ('1.99', '359', '2007-03-22T23:29:27.996577', '15453', '1'), - ('4.99', '5', '2007-03-02T03:25:11.996577', '11001', '2'), - ('2.99', '520', '2007-03-20T06:34:18.996577', '13659', '2'), - ('6.99', '5', '2007-03-21T09:59:37.996577', '14430', '1'), - ('2.99', '214', '2007-04-09T07:59:53.996577', '5172', '2'), - ('4.99', '120', '2007-03-01T16:46:39.996577', '10696', '2'), - ('2.99', '16', '2007-03-01T17:43:34.996577', '10727', '2'), - ('4.99', '149', '2007-03-23T00:19:19.996577', '15479', '2'), - ('0.99', '320', '2007-04-30T22:51:08.996577', '9509', '1'), - ('0.99', '286', '2007-03-18T14:55:34.996577', '12595', '2'), - ('3.99', '111', '2007-04-06T01:02:14.996577', '3551', '1'), - ('7.99', '479', '2007-04-27T02:19:30.996577', '7060', '1'), - ('7.99', '583', '2007-04-10T10:43:59.996577', '5747', '2'), - ('8.99', '488', '2007-04-09T06:33:40.996577', '5141', '1'), - ('4.99', '226', '2007-03-21T19:35:49.996577', '14708', '1'), - ('0.99', '353', '2007-03-02T09:40:34.996577', '11186', '1'), - ('4.99', '480', '2007-04-30T16:22:05.996577', '9332', '2'), - ('6.99', '61', '2007-04-28T14:39:47.996577', '8029', '2'), - ('4.99', '577', '2007-04-27T13:47:08.996577', '7371', '1'), - ('4.99', '156', '2007-04-28T07:00:11.996577', '7822', '2'), - ('4.99', '598', '2007-04-30T01:25:19.996577', '8939', '1'), - ('2.99', '134', '2007-03-21T04:48:40.996577', '14265', '2'), - ('4.99', '146', '2007-04-11T17:35:55.996577', '6327', '1'), - ('4.99', '420', '2007-03-01T19:04:55.996577', '10766', '1'), - ('5.99', '10', '2007-03-22T20:27:55.996577', '15370', '1'), - ('4.99', '269', '2007-03-02T03:40:48.996577', '11014', '1'), - ('8.99', '65', '2007-03-02T11:16:31.996577', '11227', '1'), - ('4.99', '210', '2007-04-11T12:25:12.996577', '6227', '2'), - ('3.99', '304', '2007-04-10T10:49:02.996577', '5749', '2'), - ('3.99', '291', '2007-04-08T17:31:12.996577', '4862', '2'), - ('4.99', '410', '2007-04-27T19:39:49.996577', '7523', '1'), - ('3.99', '410', '2007-03-21T03:43:26.996577', '14237', '1'), - ('2.99', '410', '2007-03-20T09:28:20.996577', '13748', '2'), - ('0.99', '410', '2007-04-07T13:03:56.996577', '4267', '1'), - ('3.99', '410', '2007-04-09T06:57:06.996577', '5150', '1'), - ('4.99', '410', '2007-03-21T05:45:36.996577', '14298', '2'), - ('6.99', '410', '2007-03-17T05:25:56.996577', '11694', '1'), - ('0.99', '410', '2007-04-07T02:50:53.996577', '4062', '2'), - ('5.99', '410', '2007-02-18T14:39:12.996577', '2400', '2'), - ('2.99', '410', '2007-02-17T15:02:25.996577', '2073', '1'), - ('6.99', '410', '2007-03-02T20:17:32.996577', '11472', '1'), - ('4.99', '410', '2007-02-18T03:49:38.996577', '2255', '1'), - ('4.99', '410', '2007-04-11T07:42:48.996577', '6148', '1'), - ('4.99', '410', '2007-03-21T06:29:21.996577', '14319', '1'), - ('2.99', '410', '2007-02-15T21:26:00.996577', '1514', '1'), - ('10.99', '410', '2007-03-02T09:44:45.996577', '11187', '1'), - ('2.99', '410', '2007-03-21T23:45:45.996577', '14819', '2'), - ('4.99', '410', '2007-03-01T05:55:45.996577', '10402', '1'), - ('5.99', '410', '2007-04-09T15:22:23.996577', '5330', '2'), - ('4.99', '410', '2007-03-23T01:48:00.996577', '15518', '1'), - ('2.99', '410', '2007-03-01T21:58:48.996577', '10837', '1'), - ('4.99', '410', '2007-04-09T08:55:35.996577', '5192', '1'), - ('2.99', '476', '2007-04-11T07:53:43.996577', '6151', '1'), - ('4.99', '476', '2007-03-01T03:47:49.996577', '10346', '1'), - ('2.99', '476', '2007-02-21T19:27:46.996577', '3448', '2'), - ('0.99', '476', '2007-04-27T17:13:41.996577', '7461', '1'), - ('9.99', '476', '2007-03-01T13:34:18.996577', '10617', '1'), - ('6.99', '189', '2007-03-02T05:10:04.996577', '11059', '2'), - ('2.99', '189', '2007-04-28T05:51:01.996577', '7790', '2'), - ('4.99', '189', '2007-04-06T13:52:00.996577', '3813', '2'), - ('9.99', '189', '2007-03-01T01:02:32.996577', '10247', '1'), - ('4.99', '189', '2007-04-27T17:26:06.996577', '7469', '1'), - ('6.99', '189', '2007-02-20T15:57:09.996577', '3108', '1'), - ('4.99', '189', '2007-04-28T01:23:46.996577', '7675', '1'), - ('0.99', '189', '2007-04-07T09:52:40.996577', '4203', '2'), - ('4.99', '189', '2007-04-30T22:47:27.996577', '9506', '1'), - ('5.99', '189', '2007-03-23T19:33:17.996577', '16008', '1'), - ('0.99', '189', '2007-02-16T21:17:34.996577', '1834', '1'), - ('0.99', '189', '2007-04-06T11:24:57.996577', '3763', '1'), - ('4.99', '436', '2007-04-27T21:57:13.996577', '7593', '1'), - ('9.99', '436', '2007-04-28T17:01:15.996577', '8097', '2'), - ('6.99', '436', '2007-03-18T08:55:12.996577', '12429', '2'), - ('9.99', '436', '2007-03-19T09:23:45.996577', '13099', '2'), - ('1.99', '436', '2007-04-06T15:22:38.996577', '3851', '2'), - ('5.99', '436', '2007-04-28T14:38:23.996577', '8027', '2'), - ('0.99', '436', '2007-04-30T00:04:45.996577', '9539', '1'), - ('4.99', '436', '2007-03-23T11:38:42.996577', '15766', '2'), - ('3.99', '436', '2007-03-20T01:58:26.996577', '13533', '1'), - ('0.99', '436', '2007-03-18T03:48:23.996577', '12297', '2'), - ('7.99', '436', '2007-03-19T20:07:07.996577', '13382', '2'), - ('2.99', '436', '2007-03-20T12:15:04.996577', '13826', '2'), - ('4.99', '436', '2007-04-08T14:37:17.996577', '4782', '1'), - ('0.99', '436', '2007-04-10T22:04:02.996577', '5959', '1'), - ('5.99', '436', '2007-04-30T03:58:53.996577', '9638', '1'), - ('0.99', '436', '2007-03-02T08:33:56.996577', '11160', '2'), - ('4.99', '266', '2007-03-22T19:34:26.996577', '15346', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['25152', '25151', '25154', '31907', '25150', '25157', '25160', '25149', '25147', '31910', '31908', '25155', '25158', '24348', '30966', '24347', '19159', '24346', '30960', '30962', '19162', '24342', '24341', '19163', '30961', '19114', '30807', '30808', '30802', '30149', '23640', '23637', '30147', '23639', '30141', '30134', '30152', '18896', '30133', '23638', '30148', '30137', '18897', '30146', '30140', '30144', '30151', '23634', '30153', '31930', '25713', '25714', '19980', '19978', '19981', '24239', '24236', '30826', '30820', '24244', '30822', '30828', '24234', '30823', '30824', '18042', '21546', '27538', '18039', '27540', '18037', '18040', '21543', '27539', '27541', '27535', '18038', '27537', '18041', '20679', '26576', '26578', '26565', '20678', '26569', '17705', '17707', '26577', '26573', '26570', '26567', '26571', '20688', '20687', '29479', '29466', '29467', '29464', '29470', '29465']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('0.99', '266', '2007-03-18T06:54:39.996577', '12378', '2'), - ('4.99', '266', '2007-03-18T02:35:46.996577', '12255', '1'), - ('4.99', '266', '2007-03-18T19:38:04.996577', '12715', '1'), - ('5.99', '266', '2007-04-09T16:44:34.996577', '5362', '2'), - ('0.99', '266', '2007-03-17T06:39:36.996577', '11726', '1'), - ('1.99', '266', '2007-03-20T21:58:16.996577', '14080', '1'), - ('2.99', '266', '2007-03-22T14:14:46.996577', '15181', '1'), - ('0.99', '266', '2007-03-17T02:54:08.996577', '11626', '2'), - ('5.99', '266', '2007-03-02T11:34:37.996577', '11233', '2'), - ('5.99', '266', '2007-04-30T07:26:50.996577', '9109', '2'), - ('4.99', '266', '2007-04-10T02:27:06.996577', '5577', '1'), - ('8.99', '266', '2007-03-19T23:25:10.996577', '13468', '1'), - ('2.99', '266', '2007-03-21T12:27:34.996577', '14492', '1'), - ('2.99', '173', '2007-03-23T19:38:50.996577', '16010', '1'), - ('4.99', '173', '2007-04-11T00:38:44.996577', '6021', '2'), - ('8.99', '173', '2007-03-23T11:54:10.996577', '15775', '1'), - ('2.99', '173', '2007-02-14T23:32:33.996577', '1188', '2'), - ('0.99', '173', '2007-03-23T00:31:19.996577', '15483', '2'), - ('7.99', '173', '2007-04-08T19:21:53.996577', '4904', '1'), - ('4.99', '173', '2007-04-09T22:23:51.996577', '5485', '2'), - ('0.99', '173', '2007-02-21T00:40:02.996577', '3224', '2'), - ('2.99', '173', '2007-03-17T20:19:05.996577', '12073', '2'), - ('5.99', '173', '2007-03-01T04:00:39.996577', '10351', '1'), - ('4.99', '173', '2007-02-21T08:42:53.996577', '3336', '1'), - ('2.99', '173', '2007-04-09T19:48:20.996577', '5430', '2'), - ('0.99', '159', '2007-02-16T11:08:54.996577', '1695', '1'), - ('0.99', '159', '2007-04-30T08:24:26.996577', '9132', '2'), - ('7.99', '159', '2007-04-30T00:44:19.996577', '9559', '1'), - ('0.99', '159', '2007-04-10T05:59:33.996577', '5656', '2'), - ('3.99', '102', '2007-04-30T09:19:19.996577', '9151', '2'), - ('3.99', '102', '2007-03-23T20:27:52.996577', '16031', '2'), - ('4.99', '102', '2007-03-18T11:25:03.996577', '12495', '2'), - ('0.99', '102', '2007-04-28T20:58:53.996577', '8186', '1'), - ('1.99', '102', '2007-03-22T08:34:54.996577', '15049', '1'), - ('5.99', '102', '2007-04-09T23:23:12.996577', '5509', '2'), - ('1.99', '102', '2007-04-06T04:55:41.996577', '3630', '2'), - ('2.99', '102', '2007-04-30T02:44:04.996577', '9617', '2'), - ('2.99', '102', '2007-02-15T01:49:26.996577', '1215', '2'), - ('1.99', '102', '2007-04-05T23:26:53.996577', '3520', '2'), - ('9.99', '102', '2007-03-19T21:25:51.996577', '13420', '1'), - ('5.99', '102', '2007-04-29T14:04:53.996577', '8664', '1'), - ('3.99', '102', '2007-04-08T14:17:00.996577', '4777', '2'), - ('8.99', '102', '2007-02-18T15:49:50.996577', '2419', '2'), - ('6.99', '102', '2007-04-27T16:10:57.996577', '7439', '2'), - ('4.99', '102', '2007-04-09T05:17:15.996577', '5109', '1'), - ('0.99', '102', '2007-04-27T04:23:58.996577', '7119', '2'), - ('0.99', '102', '2007-04-30T14:47:05.996577', '9295', '2'), - ('1.99', '102', '2007-03-01T22:07:47.996577', '10841', '2'), - ('4.99', '102', '2007-04-30T08:38:48.996577', '9780', '1'), - ('2.99', '315', '2007-05-14T13:44:29.996577', '14426', '2'), - ('4.99', '315', '2007-04-08T23:18:03.996577', '4992', '1'), - ('6.99', '315', '2007-04-09T05:54:01.996577', '5126', '2'), - ('2.99', '315', '2007-03-20T23:14:27.996577', '14106', '1'), - ('0.99', '315', '2007-03-02T12:12:15.996577', '11254', '2'), - ('2.99', '315', '2007-03-21T01:24:00.996577', '14162', '2'), - ('2.99', '161', '2007-03-17T11:34:26.996577', '11838', '1'), - ('2.99', '161', '2007-03-01T14:12:35.996577', '10637', '1'), - ('4.99', '161', '2007-04-29T18:33:30.996577', '8774', '2'), - ('0.99', '161', '2007-04-07T09:09:57.996577', '4187', '2'), - ('2.99', '161', '2007-03-22T12:40:31.996577', '15150', '2'), - ('2.99', '161', '2007-04-07T23:54:58.996577', '4490', '1'), - ('0.99', '161', '2007-04-30T19:36:58.996577', '9421', '2'), - ('5.99', '161', '2007-03-01T00:40:51.996577', '10241', '1'), - ('6.99', '161', '2007-04-09T16:04:01.996577', '5349', '2'), - ('4.99', '161', '2007-04-12T18:49:16.996577', '6873', '2'), - ('4.99', '478', '2007-02-21T02:25:41.996577', '3259', '2'), - ('4.99', '478', '2007-03-22T14:24:14.996577', '15188', '2'), - ('4.99', '478', '2007-04-29T07:26:04.996577', '8488', '2'), - ('6.99', '478', '2007-02-18T23:46:53.996577', '2529', '1'), - ('4.99', '478', '2007-04-30T16:41:32.996577', '10016', '2'), - ('0.99', '478', '2007-02-16T12:37:10.996577', '1708', '1'), - ('8.99', '478', '2007-02-19T06:01:26.996577', '2616', '2'), - ('2.99', '478', '2007-03-19T11:56:52.996577', '13162', '2'), - ('4.99', '478', '2007-04-30T04:45:59.996577', '9665', '1'), - ('0.99', '478', '2007-04-30T20:08:14.996577', '10127', '2'), - ('4.99', '478', '2007-04-06T08:14:38.996577', '3691', '1'), - ('4.99', '478', '2007-02-18T11:29:17.996577', '2358', '2'), - ('2.99', '478', '2007-04-27T19:39:29.996577', '7522', '1'), - ('4.99', '478', '2007-02-19T16:03:05.996577', '2765', '2'), - ('3.99', '390', '2007-03-19T21:15:12.996577', '13413', '1'), - ('2.99', '390', '2007-04-30T15:33:45.996577', '9314', '2'), - ('4.99', '390', '2007-04-30T17:51:51.996577', '10061', '1'), - ('2.99', '390', '2007-04-06T22:19:20.996577', '3999', '1'), - ('2.99', '390', '2007-03-18T22:56:47.996577', '12803', '2'), - ('5.99', '390', '2007-04-08T22:17:45.996577', '4968', '1'), - ('2.99', '390', '2007-02-16T13:58:27.996577', '1730', '2'), - ('7.99', '390', '2007-02-18T09:09:45.996577', '2330', '1'), - ('4.99', '390', '2007-04-30T10:19:17.996577', '9825', '1'), - ('5.99', '390', '2007-04-27T22:00:49.996577', '7595', '1'), - ('4.99', '390', '2007-04-11T11:21:02.996577', '6215', '1'), - ('3.99', '390', '2007-04-07T09:24:40.996577', '4191', '2'), - ('0.99', '390', '2007-04-11T22:32:00.996577', '6430', '1'), - ('4.99', '390', '2007-03-22T20:50:01.996577', '15376', '2'), - ('8.99', '390', '2007-03-22T18:13:25.996577', '15303', '2'), - ('6.99', '42', '2007-04-30T17:51:26.996577', '10060', '2'), - ('5.99', '42', '2007-04-09T23:43:26.996577', '5517', '2'), - ('3.99', '42', '2007-04-10T05:47:24.996577', '5652', '2'), - ('2.99', '42', '2007-04-07T19:38:04.996577', '4391', '2'), - ('0.99', '42', '2007-04-26T21:20:58.996577', '6925', '1'), - ('4.99', '42', '2007-04-09T09:19:22.996577', '5199', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['29476', '29473', '23090', '23095', '29475', '23094', '29468', '29472', '23093', '18672', '23516', '29942', '23514', '29949', '23518', '18834', '18835', '29946', '23510', '18838', '29944', '18836', '29941', '29938', '23512', '32087', '24788', '19351', '24789', '31459', '19348', '31460', '31462', '17906', '27221', '21233', '21234', '27229', '27222', '27228', '17905', '17907', '27223', '21237', '17909', '31748', '31744', '31743', '32095', '24988', '31740', '24990', '24996', '19286', '24613', '19284', '24618', '31255', '24615', '24609', '18948', '18946', '30285', '23735', '30286', '30288', '30276', '30287', '30277', '30280', '23739', '23738', '18947', '30278', '31189', '24551', '31192', '31186', '24548', '31182', '31191', '24547', '19263', '31204', '19261', '19258', '31206', '31197', '24557', '31198', '31195', '19257', '31207', '31201', '24558', '31205', '31194', '31203', '24555', '24554']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('2.99', '42', '2007-04-29T19:04:52.996577', '8785', '2'), - ('6.99', '42', '2007-04-28T17:01:06.996577', '8095', '1'), - ('2.99', '42', '2007-03-01T22:15:29.996577', '10845', '2'), - ('2.99', '42', '2007-03-22T23:11:15.996577', '15442', '1'), - ('3.99', '42', '2007-04-29T07:39:07.996577', '8499', '1'), - ('7.99', '42', '2007-03-21T11:18:59.996577', '14461', '1'), - ('2.99', '42', '2007-04-11T09:28:25.996577', '6179', '1'), - ('0.99', '42', '2007-04-28T15:20:24.996577', '8049', '1'), - ('2.99', '42', '2007-03-18T11:34:03.996577', '12499', '2'), - ('0.99', '42', '2007-02-15T23:17:58.996577', '1534', '2'), - ('1.99', '86', '2007-03-20T23:57:27.996577', '14122', '2'), - ('0.99', '86', '2007-04-09T13:53:32.996577', '5295', '2'), - ('4.99', '86', '2007-03-20T01:58:51.996577', '13535', '1'), - ('4.99', '86', '2007-04-30T17:40:15.996577', '9376', '2'), - ('1.99', '86', '2007-03-23T09:26:06.996577', '15715', '1'), - ('0.99', '86', '2007-02-16T20:12:11.996577', '1822', '2'), - ('2.99', '86', '2007-02-17T04:42:00.996577', '1924', '2'), - ('10.99', '86', '2007-04-28T08:50:18.996577', '7874', '1'), - ('0.99', '86', '2007-03-17T14:34:17.996577', '11916', '2'), - ('0.99', '86', '2007-02-20T23:11:42.996577', '3207', '1'), - ('7.99', '86', '2007-04-12T18:43:30.996577', '6872', '2'), - ('4.99', '86', '2007-02-17T20:10:00.996577', '2141', '1'), - ('9.99', '86', '2007-04-08T04:03:07.996577', '4571', '1'), - ('0.99', '86', '2007-04-06T04:05:44.996577', '3611', '1'), - ('3.99', '86', '2007-03-19T01:23:04.996577', '12870', '2'), - ('4.99', '227', '2007-05-14T13:44:29.996577', '13374', '2'), - ('4.99', '227', '2007-03-19T20:02:05.996577', '13379', '2'), - ('0.99', '227', '2007-02-20T12:22:19.996577', '3065', '2'), - ('0.99', '227', '2007-03-22T21:49:48.996577', '15406', '2'), - ('5.99', '227', '2007-04-06T02:08:27.996577', '3576', '1'), - ('2.99', '227', '2007-02-16T09:39:27.996577', '1679', '1'), - ('2.99', '227', '2007-04-07T17:10:12.996577', '4340', '2'), - ('2.99', '227', '2007-04-08T09:03:54.996577', '4680', '1'), - ('7.99', '448', '2007-02-16T20:16:42.996577', '1823', '2'), - ('5.99', '448', '2007-04-06T20:36:24.996577', '3959', '2'), - ('2.99', '448', '2007-03-18T09:24:55.996577', '12446', '1'), - ('2.99', '448', '2007-03-19T14:10:58.996577', '13220', '1'), - ('4.99', '448', '2007-04-26T23:26:08.996577', '6985', '2'), - ('6.99', '448', '2007-04-06T22:05:22.996577', '3992', '2'), - ('2.99', '448', '2007-04-11T18:16:28.996577', '6341', '2'), - ('5.99', '448', '2007-02-15T08:47:00.996577', '1313', '1'), - ('0.99', '448', '2007-02-19T11:57:34.996577', '2697', '2'), - ('0.99', '448', '2007-04-07T00:39:49.996577', '4024', '2'), - ('3.99', '448', '2007-03-21T15:25:05.996577', '14580', '1'), - ('5.99', '448', '2007-02-21T09:36:58.996577', '3347', '2'), - ('0.99', '251', '2007-04-30T02:59:28.996577', '8982', '2'), - ('2.99', '251', '2007-04-10T22:45:35.996577', '5979', '2'), - ('2.99', '251', '2007-04-09T00:13:30.996577', '5012', '2'), - ('0.99', '251', '2007-05-14T13:44:29.996577', '14107', '1'), - ('7.99', '251', '2007-03-01T12:10:07.996577', '10575', '1'), - ('4.99', '251', '2007-04-06T13:28:40.996577', '3799', '1'), - ('3.99', '251', '2007-03-17T19:16:58.996577', '12047', '2'), - ('2.99', '251', '2007-03-23T06:52:22.996577', '15647', '2'), - ('6.99', '201', '2007-02-18T11:33:08.996577', '2359', '2'), - ('4.99', '201', '2007-03-19T08:38:52.996577', '13076', '2'), - ('1.99', '201', '2007-02-17T13:09:24.996577', '2047', '1'), - ('2.99', '201', '2007-03-22T05:27:54.996577', '14973', '1'), - ('6.99', '201', '2007-04-06T08:51:53.996577', '3708', '2'), - ('3.99', '201', '2007-03-20T06:55:29.996577', '13671', '2'), - ('5.99', '201', '2007-03-01T18:34:26.996577', '10750', '2'), - ('5.99', '114', '2007-02-20T18:42:46.996577', '3144', '2'), - ('7.99', '114', '2007-02-19T10:42:03.996577', '2680', '2'), - ('5.99', '114', '2007-04-28T11:07:37.996577', '7938', '2'), - ('5.99', '114', '2007-03-21T01:11:46.996577', '14158', '2'), - ('4.99', '114', '2007-04-29T07:33:59.996577', '8496', '2'), - ('4.99', '114', '2007-04-30T06:53:07.996577', '9717', '1'), - ('0.99', '114', '2007-04-07T00:41:50.996577', '4025', '1'), - ('10.99', '114', '2007-04-29T11:00:46.996577', '8590', '1'), - ('0.99', '114', '2007-04-09T19:10:01.996577', '5418', '1'), - ('2.99', '114', '2007-04-11T10:00:13.996577', '6188', '1'), - ('3.99', '114', '2007-03-23T06:48:21.996577', '15646', '2'), - ('2.99', '114', '2007-03-23T02:14:06.996577', '15528', '1'), - ('2.99', '114', '2007-02-20T14:35:17.996577', '3094', '1'), - ('4.99', '114', '2007-04-10T04:11:42.996577', '5624', '2'), - ('0.99', '195', '2007-04-29T07:10:30.996577', '8479', '2'), - ('0.99', '195', '2007-03-20T09:17:13.996577', '13741', '2'), - ('4.99', '195', '2007-04-30T15:58:57.996577', '9994', '1'), - ('4.99', '195', '2007-04-11T09:13:03.996577', '6175', '2'), - ('2.99', '195', '2007-03-17T09:27:26.996577', '11787', '2'), - ('6.99', '195', '2007-04-07T11:30:01.996577', '4234', '1'), - ('5.99', '195', '2007-04-30T11:51:17.996577', '9870', '1'), - ('7.99', '195', '2007-03-02T10:17:42.996577', '11201', '1'), - ('5.99', '196', '2007-02-21T03:44:36.996577', '3271', '2'), - ('6.99', '196', '2007-04-30T06:57:12.996577', '9721', '1'), - ('4.99', '196', '2007-02-20T02:01:11.996577', '2912', '2'), - ('2.99', '196', '2007-02-15T11:13:56.996577', '1348', '1'), - ('10.99', '196', '2007-04-30T19:57:54.996577', '10122', '2'), - ('4.99', '196', '2007-04-10T11:43:52.996577', '5768', '2'), - ('0.99', '196', '2007-03-19T00:16:59.996577', '12836', '2'), - ('4.99', '196', '2007-04-12T18:21:56.996577', '6857', '2'), - ('4.99', '196', '2007-04-09T06:35:33.996577', '5143', '2'), - ('5.99', '196', '2007-02-14T23:13:47.996577', '1182', '1'), - ('4.99', '196', '2007-04-30T22:57:04.996577', '10191', '1'), - ('1.99', '196', '2007-04-29T07:04:48.996577', '8472', '2'), - ('8.99', '196', '2007-03-20T11:05:08.996577', '13799', '1'), - ('4.99', '196', '2007-04-30T09:36:05.996577', '9804', '1'), - ('4.99', '196', '2007-04-08T23:41:23.996577', '4999', '2'), - ('5.99', '196', '2007-04-30T16:42:18.996577', '9346', '1'), - ('0.99', '196', '2007-03-18T09:01:07.996577', '12430', '2'), - ('2.99', '196', '2007-03-02T06:38:24.996577', '11104', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['24556', '31200', '31193', '19748', '25406', '25402', '25398', '25396', '19739', '19746', '25405', '19744', '19745', '19749', '19747', '20177', '25991', '25990', '25995', '25993', '25986', '25989', '25987', '20179', '20178', '27736', '27741', '27738', '21690', '18094', '27733', '27735', '31976', '21685', '21684', '27732', '21688', '18097', '27734', '21689', '31295', '31307', '31300', '24645', '31306', '31296', '31302', '32080', '24656', '24646', '24654', '19295', '24652', '24653', '31298', '31299', '18164', '27950', '21857', '27948', '21860', '21863', '21865', '18165', '18163', '21861', '27949', '27947', '21862', '21867', '25203', '19571', '25207', '19574', '19568', '19570', '25204', '19572', '27750', '21693', '21691', '27746', '21695', '21694', '27743', '21697', '27747', '27745', '19865', '19867', '19859', '25574', '25571', '25569', '19864', '25567', '19860', '19858', '25577', '25566']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('0.99', '196', '2007-03-18T18:19:53.996577', '12684', '2'), - ('0.99', '196', '2007-04-28T23:48:42.996577', '8266', '2'), - ('2.99', '196', '2007-04-08T18:03:21.996577', '4879', '1'), - ('0.99', '289', '2007-03-20T22:22:06.996577', '14087', '1'), - ('0.99', '289', '2007-04-27T12:15:21.996577', '7325', '2'), - ('3.99', '289', '2007-04-11T00:11:32.996577', '6007', '2'), - ('4.99', '289', '2007-04-09T04:14:06.996577', '5089', '1'), - ('2.99', '289', '2007-04-06T02:57:39.996577', '3588', '1'), - ('7.99', '289', '2007-03-01T02:33:30.996577', '10297', '2'), - ('5.99', '289', '2007-03-19T18:31:48.996577', '13336', '2'), - ('4.99', '289', '2007-04-27T06:01:11.996577', '7162', '1'), - ('0.99', '289', '2007-03-19T13:52:07.996577', '13211', '2'), - ('9.99', '289', '2007-03-19T15:22:38.996577', '13256', '2'), - ('4.99', '289', '2007-03-21T20:45:23.996577', '14729', '2'), - ('6.99', '289', '2007-03-20T14:10:31.996577', '13891', '2'), - ('2.99', '339', '2007-03-16T23:30:32.996577', '11550', '1'), - ('0.99', '339', '2007-04-11T22:23:18.996577', '6425', '1'), - ('6.99', '339', '2007-04-11T03:21:06.996577', '6072', '1'), - ('0.99', '339', '2007-04-30T02:25:58.996577', '8968', '1'), - ('2.99', '339', '2007-04-27T08:55:59.996577', '7244', '2'), - ('4.99', '339', '2007-04-07T12:08:24.996577', '4243', '1'), - ('3.99', '339', '2007-04-10T09:37:38.996577', '5720', '1'), - ('0.99', '339', '2007-04-07T22:42:18.996577', '4467', '1'), - ('5.99', '339', '2007-03-17T05:40:24.996577', '11699', '2'), - ('3.99', '339', '2007-03-17T00:32:15.996577', '11582', '2'), - ('0.99', '495', '2007-04-28T19:19:18.996577', '8151', '1'), - ('4.99', '495', '2007-04-30T07:37:48.996577', '9741', '1'), - ('5.99', '495', '2007-04-29T06:13:22.996577', '8451', '1'), - ('2.99', '495', '2007-03-23T18:44:53.996577', '15984', '1'), - ('2.99', '495', '2007-02-17T15:08:29.996577', '2074', '2'), - ('7.99', '495', '2007-04-09T22:23:03.996577', '5484', '2'), - ('2.99', '495', '2007-04-27T07:04:41.996577', '7191', '2'), - ('0.99', '495', '2007-05-14T13:44:29.996577', '13753', '2'), - ('5.99', '495', '2007-03-18T22:24:49.996577', '12782', '1'), - ('4.99', '495', '2007-03-01T19:52:03.996577', '10783', '1'), - ('2.99', '495', '2007-04-06T21:07:15.996577', '3966', '2'), - ('2.99', '495', '2007-03-19T22:33:59.996577', '13445', '2'), - ('3.99', '495', '2007-02-20T17:26:14.996577', '3129', '1'), - ('7.99', '495', '2007-04-11T22:25:04.996577', '6426', '2'), - ('4.99', '495', '2007-03-20T11:48:35.996577', '13818', '2'), - ('2.99', '211', '2007-04-07T02:38:39.996577', '4060', '2'), - ('6.99', '211', '2007-04-30T02:12:01.996577', '8961', '2'), - ('3.99', '211', '2007-04-10T08:16:30.996577', '5699', '2'), - ('4.99', '211', '2007-03-02T01:02:38.996577', '10928', '2'), - ('2.99', '211', '2007-04-28T12:41:13.996577', '7975', '1'), - ('5.99', '211', '2007-04-07T21:32:49.996577', '4441', '2'), - ('0.99', '211', '2007-04-11T22:51:27.996577', '6438', '2'), - ('4.99', '211', '2007-05-14T13:44:29.996577', '12746', '2'), - ('6.99', '211', '2007-03-23T02:36:03.996577', '15538', '2'), - ('8.99', '211', '2007-03-02T05:53:13.996577', '11076', '2'), - ('1.99', '211', '2007-03-21T23:38:58.996577', '14812', '2'), - ('8.99', '211', '2007-02-19T18:26:42.996577', '2812', '2'), - ('2.99', '211', '2007-03-20T17:32:15.996577', '13979', '1'), - ('0.99', '211', '2007-03-21T22:45:46.996577', '14782', '2'), - ('2.99', '211', '2007-04-08T17:20:33.996577', '4857', '1'), - ('5.99', '211', '2007-04-10T06:39:31.996577', '5668', '1'), - ('0.99', '514', '2007-02-19T17:16:47.996577', '2789', '1'), - ('3.99', '514', '2007-04-30T04:52:01.996577', '9038', '1'), - ('1.99', '514', '2007-03-17T04:26:20.996577', '11675', '1'), - ('2.99', '514', '2007-04-06T15:48:50.996577', '3860', '2'), - ('4.99', '514', '2007-03-18T04:10:05.996577', '12302', '1'), - ('3.99', '514', '2007-03-19T18:51:10.996577', '13344', '2'), - ('1.99', '514', '2007-03-21T08:35:00.996577', '14386', '1'), - ('2.99', '514', '2007-02-20T14:03:50.996577', '3084', '2'), - ('0.99', '514', '2007-02-18T11:59:41.996577', '2362', '2'), - ('0.99', '514', '2007-03-18T14:15:37.996577', '12578', '2'), - ('4.99', '514', '2007-04-28T05:51:17.996577', '7791', '1'), - ('5.99', '514', '2007-04-06T07:05:14.996577', '3668', '2'), - ('2.99', '514', '2007-03-18T21:02:02.996577', '12752', '1'), - ('5.99', '514', '2007-03-23T11:54:27.996577', '15776', '1'), - ('2.99', '272', '2007-04-09T07:21:35.996577', '5158', '2'), - ('0.99', '272', '2007-03-17T13:00:22.996577', '11881', '1'), - ('10.99', '272', '2007-04-30T08:54:45.996577', '9787', '2'), - ('2.99', '272', '2007-03-20T14:36:21.996577', '13903', '1'), - ('2.99', '272', '2007-03-01T17:58:47.996577', '10736', '1'), - ('8.99', '272', '2007-03-17T01:31:22.996577', '11597', '2'), - ('7.99', '272', '2007-04-27T11:18:43.996577', '7300', '2'), - ('6.99', '272', '2007-03-17T17:37:38.996577', '12006', '2'), - ('2.99', '496', '2007-04-28T22:15:45.996577', '8221', '2'), - ('3.99', '496', '2007-03-17T13:41:55.996577', '11893', '1'), - ('7.99', '496', '2007-03-02T05:16:44.996577', '11060', '1'), - ('0.99', '496', '2007-04-07T13:06:59.996577', '4269', '1'), - ('5.99', '496', '2007-03-20T03:31:25.996577', '13569', '1'), - ('4.99', '496', '2007-03-18T15:28:03.996577', '12605', '2'), - ('3.99', '496', '2007-04-06T01:45:49.996577', '3569', '2'), - ('7.99', '496', '2007-03-21T06:59:09.996577', '14332', '1'), - ('5.99', '496', '2007-04-10T01:41:33.996577', '5559', '1'), - ('4.99', '496', '2007-04-07T12:52:22.996577', '4261', '1'), - ('2.99', '302', '2007-03-23T04:05:39.996577', '15578', '2'), - ('0.99', '302', '2007-03-23T10:08:34.996577', '15734', '2'), - ('7.99', '302', '2007-03-17T21:53:47.996577', '12126', '1'), - ('7.99', '302', '2007-04-30T09:00:34.996577', '9146', '1'), - ('6.99', '302', '2007-04-29T03:38:34.996577', '8363', '1'), - ('0.99', '302', '2007-04-27T06:47:04.996577', '7183', '1'), - ('3.99', '302', '2007-03-21T04:03:43.996577', '14247', '2'), - ('4.99', '302', '2007-04-10T14:35:42.996577', '5821', '2'), - ('4.99', '302', '2007-03-18T12:08:19.996577', '12516', '2'), - ('0.99', '302', '2007-03-01T03:24:39.996577', '10329', '2'), - ('5.99', '302', '2007-04-30T01:31:33.996577', '9581', '2'), - ('0.99', '302', '2007-04-10T09:00:18.996577', '5709', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['19862', '25570', '30240', '30238', '30239', '30241', '30235', '23697', '30039', '23581', '23579', '23577', '30038', '23582', '30040', '30037', '18864', '23576', '23575', '24980', '24979', '24975', '24976', '19438', '24978', '31732', '31728', '24977', '24169', '24173', '30746', '24167', '30743', '24164', '30741', '30745', '24165', '24172', '24166', '30739', '30738', '30742', '22534', '22529', '22536', '28767', '22530', '22535', '28769', '18426', '28760', '22532', '23047', '23045', '23049', '29403', '23051', '18652', '18654', '23043', '29400', '23046', '21000', '21005', '21006', '17811', '17812', '21008', '20996', '26923', '21004', '26922', '21002', '26925', '26921', '20997', '21003', '26924', '20999', '26505', '17676', '20619', '17675', '26507', '26512', '20620', '20621', '17680', '17678', '26506', '25298', '19683', '25294', '19682', '25301', '25297', '18454', '28840', '22576', '28841']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('2.99', '302', '2007-03-20T15:11:28.996577', '13916', '1'), - ('6.99', '302', '2007-04-27T15:10:56.996577', '7411', '1'), - ('0.99', '110', '2007-04-27T20:11:30.996577', '7542', '2'), - ('4.99', '110', '2007-04-11T08:36:39.996577', '6160', '1'), - ('0.99', '110', '2007-04-27T17:35:43.996577', '7474', '1'), - ('2.99', '110', '2007-04-27T21:08:32.996577', '7570', '1'), - ('4.99', '110', '2007-04-06T02:56:18.996577', '3587', '1'), - ('3.99', '110', '2007-03-18T14:20:38.996577', '12585', '2'), - ('4.99', '93', '2007-04-11T15:28:30.996577', '6287', '2'), - ('5.99', '93', '2007-03-22T18:51:39.996577', '15324', '2'), - ('0.99', '93', '2007-03-21T02:09:01.996577', '14195', '1'), - ('8.99', '93', '2007-03-20T16:26:26.996577', '13950', '1'), - ('4.99', '93', '2007-04-09T05:58:11.996577', '5130', '2'), - ('2.99', '93', '2007-03-23T05:58:49.996577', '15631', '2'), - ('4.99', '93', '2007-04-12T05:24:50.996577', '6586', '1'), - ('2.99', '93', '2007-04-08T11:40:33.996577', '4733', '1'), - ('0.99', '93', '2007-02-20T16:02:21.996577', '3109', '1'), - ('2.99', '93', '2007-03-20T14:40:00.996577', '13904', '2'), - ('2.99', '93', '2007-03-20T02:38:16.996577', '13555', '1'), - ('6.99', '249', '2007-03-22T13:02:16.996577', '15160', '1'), - ('0.99', '249', '2007-03-21T05:19:14.996577', '14285', '2'), - ('1.99', '249', '2007-03-02T07:23:51.996577', '11124', '1'), - ('4.99', '249', '2007-03-02T08:29:21.996577', '11159', '1'), - ('1.99', '249', '2007-02-17T19:26:58.996577', '2129', '2'), - ('4.99', '249', '2007-03-20T17:35:46.996577', '13981', '2'), - ('4.99', '249', '2007-04-28T09:01:48.996577', '7881', '2'), - ('3.99', '249', '2007-04-10T05:02:05.996577', '5639', '2'), - ('0.99', '249', '2007-03-17T04:15:58.996577', '11668', '2'), - ('2.99', '154', '2007-03-21T20:50:15.996577', '14731', '2'), - ('2.99', '154', '2007-03-23T09:44:42.996577', '15721', '1'), - ('4.99', '154', '2007-04-27T05:48:00.996577', '7156', '1'), - ('0.99', '154', '2007-03-18T05:37:53.996577', '12341', '1'), - ('0.99', '154', '2007-04-11T02:00:49.996577', '6048', '1'), - ('6.99', '154', '2007-03-01T01:53:53.996577', '10278', '1'), - ('0.99', '154', '2007-04-09T04:49:55.996577', '5101', '1'), - ('4.99', '154', '2007-04-27T02:14:08.996577', '7055', '1'), - ('4.99', '154', '2007-03-01T22:27:11.996577', '10851', '1'), - ('0.99', '154', '2007-03-22T19:44:12.996577', '15351', '1'), - ('5.99', '154', '2007-03-02T13:43:53.996577', '11296', '1'), - ('2.99', '154', '2007-04-07T12:41:31.996577', '4252', '1'), - ('4.99', '154', '2007-04-07T06:34:33.996577', '4132', '2'), - ('2.99', '154', '2007-04-10T11:13:14.996577', '5760', '2'), - ('1.99', '588', '2007-03-22T10:41:24.996577', '15109', '1'), - ('4.99', '588', '2007-03-01T04:52:52.996577', '10373', '2'), - ('4.99', '588', '2007-03-22T15:05:58.996577', '15209', '1'), - ('2.99', '588', '2007-04-28T09:49:02.996577', '7903', '2'), - ('2.99', '588', '2007-03-18T00:08:40.996577', '12185', '1'), - ('2.99', '588', '2007-03-22T12:59:05.996577', '15158', '1'), - ('2.99', '588', '2007-04-29T05:40:15.996577', '8429', '1'), - ('2.99', '588', '2007-02-18T17:59:19.996577', '2453', '1'), - ('4.99', '588', '2007-04-06T04:48:09.996577', '3628', '1'), - ('4.99', '588', '2007-03-19T08:15:19.996577', '13064', '1'), - ('0.99', '37', '2007-03-20T22:11:12.996577', '14084', '1'), - ('3.99', '37', '2007-03-20T00:02:02.996577', '13493', '2'), - ('3.99', '37', '2007-03-22T07:32:10.996577', '15028', '1'), - ('9.99', '37', '2007-04-29T05:23:14.996577', '8419', '1'), - ('0.99', '37', '2007-03-23T20:36:30.996577', '16035', '2'), - ('4.99', '37', '2007-02-16T03:12:49.996577', '1583', '1'), - ('3.99', '37', '2007-02-16T23:12:23.996577', '1854', '2'), - ('4.99', '37', '2007-03-19T11:23:35.996577', '13147', '2'), - ('5.99', '37', '2007-04-06T10:08:53.996577', '3734', '1'), - ('8.99', '37', '2007-03-20T19:48:02.996577', '14025', '2'), - ('9.99', '422', '2007-03-19T02:44:39.996577', '12907', '1'), - ('4.99', '422', '2007-03-22T01:16:31.996577', '14861', '1'), - ('3.99', '422', '2007-03-22T17:18:06.996577', '15272', '1'), - ('2.99', '422', '2007-02-19T14:50:33.996577', '2747', '2'), - ('5.99', '422', '2007-02-19T16:46:38.996577', '2778', '1'), - ('2.99', '422', '2007-03-22T18:35:29.996577', '15316', '2'), - ('6.99', '422', '2007-03-01T21:54:21.996577', '10833', '2'), - ('1.99', '422', '2007-04-10T12:31:54.996577', '5784', '1'), - ('4.99', '422', '2007-03-20T08:32:11.996577', '13722', '2'), - ('0.99', '422', '2007-04-08T00:47:53.996577', '4504', '2'), - ('1.99', '422', '2007-03-20T05:20:29.996577', '13625', '2'), - ('4.99', '422', '2007-04-28T21:48:57.996577', '8206', '2'), - ('2.99', '422', '2007-04-07T22:33:25.996577', '4463', '2'), - ('6.99', '422', '2007-03-02T15:01:37.996577', '11325', '2'), - ('0.99', '422', '2007-03-20T08:03:17.996577', '13709', '2'), - ('0.99', '422', '2007-04-28T07:05:48.996577', '7827', '2'), - ('4.99', '422', '2007-03-17T11:42:03.996577', '11842', '1'), - ('0.99', '384', '2007-04-07T20:43:09.996577', '4424', '2'), - ('0.99', '384', '2007-02-17T11:08:16.996577', '2020', '2'), - ('5.99', '384', '2007-03-17T08:48:17.996577', '11773', '2'), - ('0.99', '384', '2007-02-17T07:31:24.996577', '1961', '1'), - ('4.99', '384', '2007-04-10T03:36:52.996577', '5608', '1'), - ('1.99', '384', '2007-04-29T06:06:14.996577', '8445', '1'), - ('2.99', '384', '2007-03-20T01:10:54.996577', '13521', '2'), - ('2.99', '384', '2007-03-21T09:40:12.996577', '14416', '2'), - ('9.99', '384', '2007-02-20T14:24:31.996577', '3088', '1'), - ('5.99', '384', '2007-02-18T22:12:47.996577', '2510', '2'), - ('0.99', '384', '2007-04-09T12:03:58.996577', '5250', '2'), - ('2.99', '281', '2007-04-27T01:32:03.996577', '7034', '2'), - ('1.99', '281', '2007-03-21T02:09:06.996577', '14196', '1'), - ('0.99', '281', '2007-04-08T05:43:40.996577', '4607', '1'), - ('2.99', '281', '2007-03-20T06:03:08.996577', '13641', '1'), - ('4.99', '281', '2007-04-28T20:33:50.996577', '8180', '2'), - ('0.99', '281', '2007-04-12T16:56:38.996577', '6825', '2'), - ('0.99', '594', '2007-02-19T17:15:09.996577', '2786', '2'), - ('0.99', '594', '2007-04-05T21:28:19.996577', '3474', '2'), - ('8.99', '594', '2007-03-01T17:06:28.996577', '10704', '2'), - ('4.99', '594', '2007-04-06T00:46:20.996577', '3546', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['18451', '28843', '22578', '18455', '28853', '28851', '28846', '19690', '25320', '25322', '19693', '25321', '25325', '25331', '25326', '25324', '25317', '25323', '19688', '25318', '25327', '30897', '24290', '30898', '30913', '24294', '19144', '30904', '24293', '30905', '30910', '24297', '30912', '30901', '32064', '24295', '26952', '26948', '21019', '21018', '26941', '21024', '21017', '26943', '21025', '31960', '26955', '26945', '17818', '21022', '17819', '21020', '26947', '28171', '28179', '22037', '28174', '28177', '28176', '28170', '18232', '22033', '28180', '22035', '22042', '31643', '24902', '19408', '31652', '31646', '24912', '31638', '31644', '31649', '31648', '31640', '31641', '24911', '19409', '31651', '21929', '21933', '21932', '21927', '21926', '28027', '28023', '21934', '28021', '19413', '24922', '24919', '24927', '24925', '31654', '31655', '19416', '24915', '24916', '31656']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('4.99', '594', '2007-02-16T19:49:07.996577', '1816', '1'), - ('5.99', '594', '2007-04-07T01:21:18.996577', '4037', '1'), - ('4.99', '594', '2007-03-22T06:23:13.996577', '14999', '1'), - ('1.99', '594', '2007-02-21T06:02:06.996577', '3302', '2'), - ('4.99', '594', '2007-04-30T09:32:46.996577', '9802', '2'), - ('7.99', '594', '2007-04-30T00:14:50.996577', '9545', '1'), - ('6.99', '594', '2007-04-12T00:04:06.996577', '6473', '1'), - ('0.99', '283', '2007-03-17T16:08:30.996577', '11966', '2'), - ('0.99', '283', '2007-04-06T07:30:22.996577', '3672', '2'), - ('1.99', '283', '2007-04-08T17:56:16.996577', '4876', '2'), - ('2.99', '283', '2007-03-23T13:58:07.996577', '15837', '1'), - ('2.99', '283', '2007-04-08T09:06:54.996577', '4683', '2'), - ('1.99', '283', '2007-04-11T16:18:35.996577', '6300', '1'), - ('2.99', '283', '2007-04-30T21:41:19.996577', '9478', '2'), - ('0.99', '283', '2007-04-11T16:58:18.996577', '6313', '2'), - ('0.99', '283', '2007-04-11T03:31:29.996577', '6075', '1'), - ('4.99', '283', '2007-04-06T00:00:53.996577', '3534', '1'), - ('2.99', '283', '2007-04-10T23:26:19.996577', '5989', '2'), - ('0.99', '283', '2007-03-17T03:05:05.996577', '11637', '1'), - ('6.99', '283', '2007-04-06T01:40:23.996577', '3568', '1'), - ('4.99', '283', '2007-04-12T17:02:11.996577', '6827', '1'), - ('2.99', '168', '2007-04-05T23:51:11.996577', '3530', '1'), - ('0.99', '168', '2007-03-16T23:32:15.996577', '11551', '1'), - ('5.99', '168', '2007-04-07T15:57:42.996577', '4308', '1'), - ('4.99', '168', '2007-04-30T12:41:02.996577', '9899', '2'), - ('2.99', '168', '2007-03-18T22:18:50.996577', '12781', '1'), - ('4.99', '168', '2007-02-15T02:07:15.996577', '1222', '2'), - ('0.99', '168', '2007-04-11T23:04:28.996577', '6444', '2'), - ('6.99', '168', '2007-03-18T12:56:26.996577', '12545', '1'), - ('3.99', '168', '2007-04-12T16:20:20.996577', '6809', '2'), - ('4.99', '168', '2007-04-30T11:00:02.996577', '9197', '2'), - ('0.99', '168', '2007-03-20T11:28:56.996577', '13811', '2'), - ('6.99', '168', '2007-04-30T11:29:19.996577', '9857', '2'), - ('0.99', '168', '2007-04-09T21:12:22.996577', '5459', '1'), - ('0.99', '168', '2007-05-14T13:44:29.996577', '15894', '1'), - ('8.99', '168', '2007-03-19T06:33:16.996577', '13018', '1'), - ('4.99', '424', '2007-04-30T21:31:02.996577', '9471', '1'), - ('2.99', '424', '2007-04-28T21:20:10.996577', '8194', '2'), - ('2.99', '424', '2007-03-02T16:43:20.996577', '11374', '2'), - ('2.99', '424', '2007-03-01T22:51:15.996577', '10866', '1'), - ('0.99', '424', '2007-04-08T01:07:22.996577', '4512', '2'), - ('0.99', '424', '2007-03-22T10:52:25.996577', '15113', '2'), - ('4.99', '424', '2007-03-01T04:42:10.996577', '10369', '2'), - ('5.99', '424', '2007-04-08T09:40:53.996577', '4696', '2'), - ('9.99', '424', '2007-03-23T17:15:10.996577', '15941', '2'), - ('0.99', '424', '2007-05-14T13:44:29.996577', '15094', '1'), - ('6.99', '424', '2007-04-30T16:41:48.996577', '10017', '1'), - ('3.99', '424', '2007-04-10T03:42:09.996577', '5611', '1'), - ('4.99', '424', '2007-02-20T11:07:15.996577', '3044', '2'), - ('0.99', '424', '2007-03-18T20:21:25.996577', '12729', '2'), - ('6.99', '424', '2007-02-20T20:00:58.996577', '3166', '1'), - ('6.99', '424', '2007-03-16T23:52:05.996577', '11562', '2'), - ('2.99', '424', '2007-04-27T21:59:07.996577', '7594', '1'), - ('0.99', '533', '2007-04-12T17:22:03.996577', '6834', '2'), - ('1.99', '533', '2007-04-29T19:08:15.996577', '8786', '2'), - ('2.99', '533', '2007-03-17T14:37:08.996577', '11918', '1'), - ('8.99', '533', '2007-04-28T16:57:42.996577', '8093', '1'), - ('2.99', '533', '2007-04-29T07:00:37.996577', '8471', '1'), - ('2.99', '533', '2007-04-28T23:17:41.996577', '8250', '2'), - ('2.99', '533', '2007-04-12T14:50:13.996577', '6781', '2'), - ('0.99', '533', '2007-02-16T23:42:04.996577', '1859', '1'), - ('2.99', '533', '2007-03-01T05:03:02.996577', '10380', '1'), - ('3.99', '533', '2007-04-30T18:50:27.996577', '10090', '2'), - ('7.99', '533', '2007-03-16T22:39:21.996577', '11524', '2'), - ('0.99', '533', '2007-03-23T19:29:35.996577', '16006', '2'), - ('3.99', '241', '2007-04-10T00:31:34.996577', '5525', '2'), - ('3.99', '241', '2007-03-01T07:33:24.996577', '10447', '2'), - ('0.99', '241', '2007-02-18T18:01:32.996577', '2455', '1'), - ('5.99', '241', '2007-04-30T14:13:09.996577', '9944', '1'), - ('2.99', '241', '2007-04-11T13:25:23.996577', '6245', '2'), - ('2.99', '241', '2007-03-22T22:48:57.996577', '15429', '1'), - ('0.99', '241', '2007-04-06T14:09:41.996577', '3822', '2'), - ('4.99', '241', '2007-04-10T22:47:30.996577', '5981', '1'), - ('2.99', '241', '2007-04-28T08:26:28.996577', '7860', '1'), - ('2.99', '241', '2007-04-27T16:03:06.996577', '7434', '1'), - ('2.99', '241', '2007-04-09T00:28:42.996577', '5017', '2'), - ('0.99', '241', '2007-04-09T09:55:16.996577', '5211', '1'), - ('2.99', '241', '2007-03-22T11:48:54.996577', '15137', '2'), - ('5.99', '241', '2007-02-18T19:29:47.996577', '2478', '2'), - ('3.99', '241', '2007-04-30T23:33:30.996577', '9528', '1'), - ('2.99', '521', '2007-03-20T01:29:13.996577', '13527', '1'), - ('4.99', '521', '2007-03-22T13:50:41.996577', '15170', '2'), - ('5.99', '521', '2007-03-21T20:57:39.996577', '14738', '2'), - ('4.99', '521', '2007-03-17T20:41:41.996577', '12082', '2'), - ('3.99', '521', '2007-03-17T16:13:26.996577', '11967', '1'), - ('7.99', '521', '2007-04-30T00:41:56.996577', '9556', '1'), - ('4.99', '521', '2007-04-09T21:04:15.996577', '5458', '2'), - ('2.99', '521', '2007-03-22T19:01:05.996577', '15329', '2'), - ('2.99', '521', '2007-04-07T21:25:56.996577', '4439', '2'), - ('4.99', '242', '2007-02-15T13:50:29.996577', '1384', '1'), - ('4.99', '242', '2007-03-19T00:47:24.996577', '12855', '1'), - ('0.99', '242', '2007-03-17T02:04:32.996577', '11607', '2'), - ('0.99', '242', '2007-03-22T06:34:26.996577', '15002', '1'), - ('5.99', '242', '2007-03-20T06:15:34.996577', '13646', '2'), - ('0.99', '242', '2007-04-06T03:53:48.996577', '3604', '2'), - ('4.99', '242', '2007-04-07T20:56:58.996577', '4426', '1'), - ('4.99', '242', '2007-02-19T11:35:16.996577', '2691', '1'), - ('4.99', '242', '2007-03-01T05:05:11.996577', '10382', '2'), - ('9.99', '242', '2007-03-01T14:47:11.996577', '10650', '2'), - ('1.99', '242', '2007-04-08T18:50:31.996577', '4895', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['24920', '24924', '19417', '31659', '19412', '24918', '24926', '20560', '17647', '26449', '20558', '26448', '26444', '26445', '17645', '20562', '22205', '28357', '28354', '18294', '28356', '28351', '22206', '22208', '18293', '22213', '28358', '22207', '23552', '29998', '18855', '29991', '23546', '23550', '23554', '18853', '23551', '23553', '29990', '23549', '23548', '23547', '29992', '19482', '25087', '19480', '19481', '31835', '19483', '19485', '25092', '31843', '25094', '25089', '25088', '31841', '25086', '18998', '23889', '30461', '19001', '30460', '30452', '23890', '30448', '23895', '23885', '23893', '30458', '18997', '19000', '30453', '18999', '30451', '20046', '25821', '25822', '25814', '20039', '25812', '25811', '25818', '20044', '25819', '25810', '20041', '25815', '20040', '25813', '25817', '20042', '27063', '27068', '21098', '27069', '27061', '21104', '21103', '27062', '27065']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('4.99', '242', '2007-03-17T15:03:40.996577', '11931', '1'), - ('0.99', '242', '2007-03-20T03:17:47.996577', '13567', '2'), - ('4.99', '242', '2007-02-20T03:55:57.996577', '2942', '2'), - ('4.99', '242', '2007-04-29T07:30:39.996577', '8491', '1'), - ('4.99', '242', '2007-02-15T08:24:28.996577', '1304', '2'), - ('4.99', '242', '2007-03-02T12:14:05.996577', '11258', '1'), - ('0.99', '242', '2007-03-21T13:20:40.996577', '14515', '1'), - ('2.99', '378', '2007-03-18T14:58:01.996577', '12596', '1'), - ('4.99', '378', '2007-02-19T12:51:35.996577', '2713', '2'), - ('2.99', '378', '2007-04-29T17:09:57.996577', '8740', '2'), - ('4.99', '378', '2007-03-02T00:34:44.996577', '10917', '1'), - ('0.99', '378', '2007-04-28T09:08:50.996577', '7888', '1'), - ('4.99', '378', '2007-04-06T11:15:04.996577', '3759', '1'), - ('0.99', '378', '2007-04-08T12:52:07.996577', '4755', '2'), - ('5.99', '378', '2007-02-16T08:42:01.996577', '1662', '1'), - ('4.99', '378', '2007-03-21T12:50:54.996577', '14502', '2'), - ('1.99', '552', '2007-03-02T08:13:58.996577', '11146', '1'), - ('5.99', '552', '2007-04-29T12:00:31.996577', '8614', '2'), - ('2.99', '552', '2007-04-28T05:27:35.996577', '7772', '1'), - ('4.99', '552', '2007-02-21T13:58:37.996577', '3397', '2'), - ('2.99', '552', '2007-04-28T21:17:37.996577', '8192', '2'), - ('6.99', '552', '2007-04-07T23:06:50.996577', '4477', '1'), - ('4.99', '552', '2007-03-02T10:25:20.996577', '11205', '2'), - ('4.99', '552', '2007-03-18T09:06:15.996577', '12433', '2'), - ('0.99', '552', '2007-02-18T07:53:16.996577', '2320', '2'), - ('2.99', '552', '2007-03-23T08:49:47.996577', '15700', '2'), - ('4.99', '552', '2007-04-29T23:16:57.996577', '8894', '2'), - ('7.99', '552', '2007-03-02T14:06:08.996577', '11300', '2'), - ('0.99', '90', '2007-03-22T08:58:10.996577', '15061', '2'), - ('2.99', '90', '2007-04-28T14:24:06.996577', '8024', '1'), - ('0.99', '90', '2007-02-20T17:38:12.996577', '3132', '2'), - ('4.99', '90', '2007-04-07T18:35:11.996577', '4371', '2'), - ('0.99', '90', '2007-03-16T22:23:13.996577', '11516', '1'), - ('1.99', '90', '2007-03-21T16:25:48.996577', '14608', '1'), - ('7.99', '90', '2007-03-23T07:45:05.996577', '15674', '1'), - ('0.99', '90', '2007-02-17T11:53:09.996577', '2033', '2'), - ('4.99', '90', '2007-03-21T23:26:09.996577', '14807', '1'), - ('0.99', '90', '2007-03-22T15:26:57.996577', '15217', '2'), - ('3.99', '90', '2007-04-06T09:58:55.996577', '3729', '2'), - ('4.99', '90', '2007-03-19T07:59:59.996577', '13051', '1'), - ('2.99', '90', '2007-03-18T22:43:35.996577', '12788', '1'), - ('0.99', '90', '2007-03-17T18:17:21.996577', '12019', '2'), - ('0.99', '90', '2007-04-09T12:54:27.996577', '5272', '2'), - ('0.99', '260', '2007-02-17T23:07:01.996577', '2178', '1'), - ('0.99', '260', '2007-03-19T00:41:06.996577', '12852', '1'), - ('2.99', '260', '2007-02-17T12:47:03.996577', '2040', '2'), - ('10.99', '260', '2007-02-17T16:37:30.996577', '2091', '1'), - ('0.99', '260', '2007-04-07T02:10:33.996577', '4054', '2'), - ('7.99', '260', '2007-02-19T18:58:47.996577', '2823', '1'), - ('0.99', '260', '2007-02-20T22:20:56.996577', '3193', '1'), - ('2.99', '260', '2007-03-20T20:00:24.996577', '14035', '2'), - ('2.99', '260', '2007-04-29T07:20:25.996577', '8484', '1'), - ('7.99', '260', '2007-03-21T15:23:13.996577', '14579', '1'), - ('3.99', '260', '2007-03-20T07:25:37.996577', '13685', '1'), - ('2.99', '260', '2007-03-19T22:11:18.996577', '13440', '2'), - ('7.99', '260', '2007-04-28T09:06:07.996577', '7885', '1'), - ('8.99', '260', '2007-03-02T02:35:12.996577', '10970', '2'), - ('3.99', '129', '2007-02-19T13:31:05.996577', '2727', '1'), - ('4.99', '129', '2007-03-18T20:16:14.996577', '12728', '2'), - ('7.99', '129', '2007-04-30T16:55:02.996577', '10024', '1'), - ('4.99', '129', '2007-02-20T21:24:21.996577', '3183', '1'), - ('7.99', '129', '2007-04-30T15:38:02.996577', '9983', '1'), - ('0.99', '129', '2007-04-08T05:21:06.996577', '4602', '1'), - ('10.99', '129', '2007-03-20T06:23:20.996577', '13653', '2'), - ('0.99', '129', '2007-04-06T08:11:27.996577', '3689', '1'), - ('1.99', '129', '2007-03-22T05:15:25.996577', '14968', '2'), - ('2.99', '129', '2007-03-01T08:48:11.996577', '10483', '1'), - ('0.99', '129', '2007-03-20T16:45:00.996577', '13961', '1'), - ('2.99', '129', '2007-04-29T03:16:03.996577', '8345', '1'), - ('0.99', '129', '2007-02-16T14:03:07.996577', '1732', '2'), - ('4.99', '129', '2007-02-19T17:27:19.996577', '2795', '2'), - ('2.99', '129', '2007-04-08T18:51:41.996577', '4896', '1'), - ('0.99', '129', '2007-02-19T16:15:18.996577', '2768', '2'), - ('2.99', '129', '2007-04-07T12:43:02.996577', '4256', '2'), - ('4.99', '324', '2007-03-22T16:55:59.996577', '15263', '1'), - ('4.99', '324', '2007-04-30T04:17:15.996577', '9651', '1'), - ('2.99', '324', '2007-04-30T23:30:01.996577', '10212', '2'), - ('0.99', '324', '2007-04-10T12:10:03.996577', '5778', '1'), - ('2.99', '324', '2007-03-17T02:29:06.996577', '11617', '1'), - ('4.99', '324', '2007-04-07T18:23:45.996577', '4368', '2'), - ('0.99', '324', '2007-04-07T09:36:18.996577', '4197', '1'), - ('7.99', '324', '2007-04-27T09:45:48.996577', '7263', '1'), - ('8.99', '324', '2007-03-21T04:36:39.996577', '14262', '1'), - ('6.99', '324', '2007-04-28T12:15:34.996577', '7960', '2'), - ('4.99', '324', '2007-04-06T20:10:47.996577', '3947', '1'), - ('2.99', '324', '2007-03-18T12:52:21.996577', '12543', '2'), - ('2.99', '324', '2007-04-11T01:29:16.996577', '6034', '1'), - ('6.99', '324', '2007-03-17T08:45:35.996577', '11771', '1'), - ('2.99', '324', '2007-04-10T08:28:27.996577', '5702', '2'), - ('3.99', '324', '2007-04-27T08:49:41.996577', '7240', '2'), - ('0.99', '324', '2007-03-19T19:30:47.996577', '13356', '2'), - ('4.99', '435', '2007-04-09T10:27:30.996577', '5220', '2'), - ('0.99', '435', '2007-04-30T13:30:59.996577', '9269', '2'), - ('2.99', '435', '2007-03-02T04:32:19.996577', '11041', '1'), - ('3.99', '435', '2007-04-30T04:26:20.996577', '9655', '1'), - ('0.99', '435', '2007-04-06T08:14:29.996577', '3690', '1'), - ('4.99', '435', '2007-03-21T19:16:31.996577', '14696', '1'), - ('0.99', '435', '2007-03-19T13:47:21.996577', '13208', '2'), - ('8.99', '435', '2007-04-06T18:54:41.996577', '3918', '1'), - ('2.99', '435', '2007-04-26T21:41:36.996577', '6935', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['21097', '21106', '22082', '28233', '22090', '18253', '22087', '22085', '28223', '28236', '28226', '18252', '22083', '28230', '22089', '28231', '28235', '28227', '22084', '22086', '18250', '22318', '22314', '22312', '28483', '28484', '22321', '22319', '28476', '22313', '22317', '22320', '19267', '19268', '31212', '31208', '24566', '24567', '24569', '24565', '19270', '19269', '31213', '24575', '24562', '24570', '24577', '24568', '31209', '27160', '27159', '27150', '21167', '21172', '21170', '27156', '21175', '27149', '17885', '27162', '30562', '30568', '23974', '30561', '30559', '30563', '30558', '23983', '23986', '23981', '19517', '31915', '31916', '19510', '19516', '19522', '19526', '19527', '19520', '19521', '25163', '31918', '19529', '26684', '31914', '19515', '31911', '19511', '28630', '24140', '30715', '24135', '19089', '24142', '30713', '24136', '30719', '19091', '24134', '24133']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('6.99', '435', '2007-03-02T03:19:21.996577', '10998', '1'), - ('0.99', '435', '2007-03-22T00:45:21.996577', '14850', '1'), - ('3.99', '538', '2007-03-01T16:56:43.996577', '10701', '2'), - ('0.99', '538', '2007-04-30T15:21:09.996577', '9307', '1'), - ('6.99', '538', '2007-03-22T19:29:51.996577', '15343', '1'), - ('2.99', '538', '2007-02-20T21:47:59.996577', '3189', '2'), - ('4.99', '538', '2007-03-20T10:14:20.996577', '13770', '2'), - ('5.99', '538', '2007-03-17T20:48:55.996577', '12089', '2'), - ('4.99', '538', '2007-04-06T01:05:36.996577', '3554', '2'), - ('8.99', '538', '2007-04-30T13:57:26.996577', '9939', '2'), - ('2.99', '538', '2007-04-09T22:26:10.996577', '5486', '1'), - ('4.99', '538', '2007-02-19T10:46:43.996577', '2682', '1'), - ('5.99', '538', '2007-03-01T17:53:44.996577', '10732', '1'), - ('0.99', '538', '2007-04-26T21:42:00.996577', '6936', '2'), - ('0.99', '538', '2007-03-21T15:58:35.996577', '14591', '1'), - ('0.99', '538', '2007-04-28T02:07:51.996577', '7694', '1'), - ('4.99', '538', '2007-04-30T12:40:23.996577', '9897', '2'), - ('2.99', '538', '2007-04-10T18:46:35.996577', '5898', '1'), - ('4.99', '538', '2007-03-02T02:16:39.996577', '10962', '1'), - ('1.99', '538', '2007-03-20T02:12:52.996577', '13544', '1'), - ('5.99', '538', '2007-02-15T08:50:11.996577', '1314', '1'), - ('0.99', '564', '2007-03-20T02:41:43.996577', '13558', '2'), - ('2.99', '564', '2007-03-17T08:30:55.996577', '11768', '2'), - ('4.99', '564', '2007-03-01T05:55:35.996577', '10401', '2'), - ('2.99', '564', '2007-04-30T13:45:50.996577', '9929', '2'), - ('6.99', '564', '2007-04-30T20:10:01.996577', '10129', '1'), - ('0.99', '564', '2007-03-21T16:01:44.996577', '14593', '1'), - ('0.99', '564', '2007-03-20T07:55:31.996577', '13701', '1'), - ('2.99', '564', '2007-04-07T09:34:59.996577', '4196', '1'), - ('2.99', '564', '2007-03-01T10:24:48.996577', '10528', '1'), - ('0.99', '564', '2007-03-19T18:19:26.996577', '13324', '2'), - ('5.99', '564', '2007-03-21T10:21:07.996577', '14439', '2'), - ('2.99', '197', '2007-02-15T20:35:35.996577', '1503', '1'), - ('8.99', '197', '2007-02-16T04:46:21.996577', '1605', '2'), - ('2.99', '197', '2007-04-28T19:51:32.996577', '8165', '1'), - ('8.99', '197', '2007-04-07T23:37:35.996577', '4486', '1'), - ('4.99', '197', '2007-03-02T03:56:19.996577', '11018', '1'), - ('4.99', '197', '2007-03-02T10:49:08.996577', '11215', '1'), - ('2.99', '197', '2007-03-02T20:37:31.996577', '11478', '1'), - ('2.99', '197', '2007-03-01T18:23:35.996577', '10743', '1'), - ('2.99', '197', '2007-02-17T16:34:40.996577', '2090', '1'), - ('4.99', '197', '2007-02-17T04:09:18.996577', '1919', '2'), - ('4.99', '197', '2007-04-30T17:41:20.996577', '9378', '2'), - ('2.99', '197', '2007-03-22T09:37:57.996577', '15078', '1'), - ('3.99', '197', '2007-03-01T07:59:26.996577', '10460', '2'), - ('1.99', '197', '2007-03-17T03:18:01.996577', '11643', '1'), - ('8.99', '197', '2007-03-23T02:41:18.996577', '15540', '1'), - ('4.99', '197', '2007-03-02T14:22:14.996577', '11311', '1'), - ('4.99', '197', '2007-04-08T11:54:23.996577', '4739', '2'), - ('2.99', '442', '2007-04-28T15:17:38.996577', '8044', '1'), - ('2.99', '442', '2007-04-28T01:16:57.996577', '7671', '1'), - ('2.99', '442', '2007-04-06T06:38:28.996577', '3661', '1'), - ('6.99', '442', '2007-03-01T04:37:10.996577', '10365', '2'), - ('0.99', '442', '2007-03-21T02:17:09.996577', '14199', '2'), - ('0.99', '442', '2007-03-19T06:08:34.996577', '13004', '2'), - ('2.99', '442', '2007-04-12T08:01:36.996577', '6632', '2'), - ('2.99', '442', '2007-03-22T15:03:51.996577', '15207', '2'), - ('4.99', '442', '2007-04-06T00:44:43.996577', '3545', '2'), - ('0.99', '442', '2007-02-15T11:57:14.996577', '1358', '2'), - ('4.99', '442', '2007-04-30T10:31:41.996577', '9180', '1'), - ('2.99', '138', '2007-04-28T04:39:21.996577', '7754', '1'), - ('9.99', '138', '2007-04-30T14:18:06.996577', '9947', '1'), - ('3.99', '138', '2007-03-01T01:37:22.996577', '10268', '1'), - ('2.99', '138', '2007-04-27T07:44:54.996577', '7208', '1'), - ('2.99', '138', '2007-04-11T23:37:18.996577', '6458', '1'), - ('4.99', '138', '2007-04-28T17:56:49.996577', '8123', '2'), - ('4.99', '138', '2007-04-10T07:12:28.996577', '5679', '1'), - ('4.99', '138', '2007-03-21T12:21:20.996577', '14486', '2'), - ('0.99', '138', '2007-03-23T01:08:22.996577', '15501', '1'), - ('1.99', '138', '2007-03-21T02:08:37.996577', '14194', '1'), - ('0.99', '267', '2007-02-20T14:28:45.996577', '3090', '2'), - ('4.99', '267', '2007-04-28T21:15:32.996577', '8190', '1'), - ('1.99', '267', '2007-04-29T10:19:50.996577', '8572', '1'), - ('4.99', '267', '2007-02-15T11:17:28.996577', '1349', '2'), - ('1.99', '267', '2007-02-19T23:35:42.996577', '2877', '1'), - ('4.99', '267', '2007-03-18T04:55:17.996577', '12320', '1'), - ('3.99', '267', '2007-03-22T07:22:38.996577', '15020', '2'), - ('3.99', '267', '2007-03-22T15:04:13.996577', '15208', '1'), - ('0.99', '267', '2007-03-02T16:42:38.996577', '11373', '2'), - ('6.99', '267', '2007-03-17T05:12:48.996577', '11690', '1'), - ('2.99', '267', '2007-04-30T09:42:18.996577', '9807', '2'), - ('0.00', '267', '2007-05-14T13:44:29.996577', '13713', '2'), - ('3.99', '267', '2007-03-23T15:59:06.996577', '15903', '1'), - ('3.99', '267', '2007-04-30T05:47:10.996577', '9059', '2'), - ('3.99', '267', '2007-04-12T11:27:42.996577', '6706', '1'), - ('4.99', '267', '2007-02-19T15:24:25.996577', '2754', '2'), - ('2.99', '267', '2007-04-06T14:00:11.996577', '3817', '1'), - ('2.99', '267', '2007-02-18T04:31:53.996577', '2265', '2'), - ('4.99', '267', '2007-04-30T18:47:19.996577', '9403', '2'), - ('4.99', '151', '2007-03-22T15:51:07.996577', '15227', '1'), - ('3.99', '151', '2007-04-27T12:27:23.996577', '7332', '2'), - ('2.99', '151', '2007-03-17T06:03:21.996577', '11714', '2'), - ('3.99', '151', '2007-02-20T09:37:22.996577', '3017', '1'), - ('2.99', '151', '2007-03-23T19:00:04.996577', '15996', '2'), - ('0.99', '151', '2007-04-12T18:07:23.996577', '6854', '2'), - ('0.99', '151', '2007-03-19T14:40:33.996577', '13230', '2'), - ('2.99', '151', '2007-04-30T18:30:28.996577', '10078', '1'), - ('2.99', '151', '2007-02-21T13:39:16.996577', '3390', '2'), - ('2.99', '151', '2007-03-01T15:19:23.996577', '10662', '1'), - ('4.99', '151', '2007-03-01T02:56:25.996577', '10311', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['30717', '24139', '19087', '30710', '28538', '28535', '22362', '22374', '22366', '22360', '22364', '22361', '28533', '22372', '22365', '22368', '21422', '27393', '21418', '21414', '21417', '27391', '27395', '17996', '17992', '27392', '27397', '29695', '29693', '29709', '23296', '23298', '29701', '18753', '29694', '29706', '29699', '23300', '30865', '30868', '19135', '24267', '24266', '24262', '30864', '24264', '19960', '19959', '19958', '25689', '25690', '25691', '19965', '25693', '27619', '21600', '27615', '27627', '21603', '27626', '27624', '27618', '27620', '21601', '27631', '18065', '27625', '21605', '21606', '27622', '18064', '27629', '29739', '18764', '23326', '29736', '23328', '23325', '23324', '28859', '28863', '28860', '28872', '28867', '28869', '28865', '28854', '22584', '22582', '24308', '19145', '24302', '30920', '30914', '24306', '30921', '30922', '17701', '20674', '26553']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('4.99', '151', '2007-04-30T12:33:10.996577', '9890', '1'), - ('3.99', '151', '2007-03-22T03:41:31.996577', '14922', '2'), - ('2.99', '151', '2007-02-18T19:20:00.996577', '2474', '2'), - ('2.99', '151', '2007-04-07T18:52:59.996577', '4376', '1'), - ('4.99', '569', '2007-04-30T18:43:16.996577', '9399', '1'), - ('5.99', '569', '2007-04-11T01:50:15.996577', '6046', '2'), - ('4.99', '569', '2007-03-02T12:12:56.996577', '11255', '2'), - ('2.99', '569', '2007-03-22T04:58:54.996577', '14959', '1'), - ('0.99', '569', '2007-03-18T04:17:19.996577', '12308', '2'), - ('0.99', '569', '2007-03-01T23:15:59.996577', '10884', '2'), - ('4.99', '569', '2007-03-17T15:34:19.996577', '11946', '1'), - ('1.99', '569', '2007-03-02T04:19:46.996577', '11030', '1'), - ('5.99', '569', '2007-04-07T09:52:44.996577', '4204', '1'), - ('0.99', '569', '2007-03-21T09:02:11.996577', '14400', '2'), - ('2.99', '569', '2007-03-17T23:02:11.996577', '12157', '1'), - ('2.99', '569', '2007-03-19T04:47:47.996577', '12958', '2'), - ('7.99', '466', '2007-03-23T19:28:48.996577', '16005', '1'), - ('6.99', '466', '2007-04-11T03:22:57.996577', '6073', '1'), - ('5.99', '466', '2007-03-20T13:59:17.996577', '13884', '1'), - ('0.99', '466', '2007-03-02T15:40:56.996577', '11343', '2'), - ('2.99', '466', '2007-03-19T23:35:40.996577', '13478', '1'), - ('0.99', '466', '2007-04-09T02:14:59.996577', '5048', '2'), - ('0.99', '466', '2007-04-29T00:07:09.996577', '8276', '2'), - ('2.99', '466', '2007-02-21T09:25:25.996577', '3343', '2'), - ('7.99', '466', '2007-02-16T19:28:01.996577', '1808', '2'), - ('4.99', '466', '2007-04-10T07:58:15.996577', '5691', '1'), - ('2.99', '466', '2007-04-30T12:59:04.996577', '9257', '1'), - ('3.99', '64', '2007-04-09T05:35:31.996577', '5114', '1'), - ('5.99', '64', '2007-04-08T15:47:41.996577', '4819', '2'), - ('0.99', '64', '2007-04-30T22:40:37.996577', '10185', '2'), - ('4.99', '64', '2007-03-01T23:22:59.996577', '10889', '1'), - ('2.99', '64', '2007-03-20T10:18:40.996577', '13773', '1'), - ('0.99', '64', '2007-04-12T12:58:54.996577', '6744', '2'), - ('2.99', '64', '2007-02-17T14:11:08.996577', '2060', '1'), - ('5.99', '64', '2007-04-08T22:23:15.996577', '4971', '2'), - ('2.99', '64', '2007-04-30T10:30:15.996577', '9832', '1'), - ('0.99', '64', '2007-04-11T23:35:01.996577', '6457', '2'), - ('5.99', '64', '2007-03-21T01:28:14.996577', '14167', '1'), - ('2.99', '165', '2007-04-27T02:34:50.996577', '7074', '1'), - ('4.99', '165', '2007-04-30T05:17:44.996577', '9685', '2'), - ('3.99', '165', '2007-02-17T10:31:27.996577', '2013', '1'), - ('5.99', '165', '2007-03-23T13:52:16.996577', '15834', '2'), - ('3.99', '165', '2007-03-23T12:54:30.996577', '15801', '1'), - ('4.99', '165', '2007-03-01T11:36:53.996577', '10565', '1'), - ('0.99', '165', '2007-04-10T22:37:43.996577', '5973', '1'), - ('4.99', '165', '2007-03-18T16:49:32.996577', '12643', '2'), - ('2.99', '313', '2007-03-17T12:11:18.996577', '11854', '2'), - ('7.99', '313', '2007-03-02T01:19:15.996577', '10933', '2'), - ('5.99', '313', '2007-03-01T00:35:58.996577', '10237', '2'), - ('2.99', '313', '2007-04-11T20:35:52.996577', '6384', '1'), - ('0.99', '313', '2007-04-27T11:06:40.996577', '7294', '2'), - ('4.99', '313', '2007-04-29T04:00:10.996577', '8381', '2'), - ('0.99', '313', '2007-03-22T19:24:22.996577', '15340', '1'), - ('2.99', '313', '2007-04-30T10:40:26.996577', '9836', '2'), - ('2.99', '485', '2007-04-09T08:56:44.996577', '5193', '1'), - ('4.99', '485', '2007-03-01T19:18:01.996577', '10771', '1'), - ('1.99', '485', '2007-04-06T17:41:06.996577', '3899', '1'), - ('2.99', '485', '2007-04-30T04:52:54.996577', '9039', '2'), - ('4.99', '485', '2007-03-17T14:40:53.996577', '11921', '1'), - ('6.99', '485', '2007-04-30T03:00:16.996577', '8984', '2'), - ('4.99', '485', '2007-04-12T20:25:42.996577', '6902', '2'), - ('2.99', '485', '2007-04-08T08:34:52.996577', '4667', '2'), - ('3.99', '485', '2007-04-09T15:52:09.996577', '5343', '1'), - ('6.99', '485', '2007-03-01T19:19:36.996577', '10772', '2'), - ('0.99', '485', '2007-04-30T01:00:26.996577', '9565', '1'), - ('8.99', '485', '2007-02-16T13:30:02.996577', '1721', '1'), - ('4.99', '485', '2007-04-27T05:29:03.996577', '7144', '1'), - ('8.99', '485', '2007-03-18T02:44:32.996577', '12261', '2'), - ('0.99', '485', '2007-03-18T11:13:50.996577', '12487', '2'), - ('4.99', '485', '2007-04-10T14:33:25.996577', '5820', '1'), - ('2.99', '485', '2007-02-16T10:26:00.996577', '1684', '2'), - ('2.99', '485', '2007-04-30T10:49:25.996577', '9189', '2'), - ('7.99', '67', '2007-04-30T04:01:51.996577', '9640', '1'), - ('3.99', '67', '2007-02-19T00:37:05.996577', '2542', '1'), - ('4.99', '67', '2007-03-19T22:06:18.996577', '13437', '2'), - ('5.99', '67', '2007-04-27T10:17:03.996577', '7277', '2'), - ('4.99', '67', '2007-03-20T10:49:31.996577', '13791', '2'), - ('8.99', '67', '2007-03-17T13:43:27.996577', '11894', '1'), - ('8.99', '67', '2007-03-02T13:38:32.996577', '11295', '1'), - ('1.99', '595', '2007-04-10T21:46:46.996577', '5952', '1'), - ('0.99', '595', '2007-04-27T11:27:36.996577', '7307', '2'), - ('6.99', '595', '2007-04-11T05:31:45.996577', '6105', '1'), - ('10.99', '595', '2007-04-30T10:20:12.996577', '9826', '2'), - ('2.99', '595', '2007-04-30T11:51:46.996577', '9223', '2'), - ('0.99', '595', '2007-04-30T22:25:20.996577', '9497', '2'), - ('3.99', '595', '2007-04-27T18:16:38.996577', '7490', '2'), - ('9.99', '595', '2007-04-06T12:30:52.996577', '3789', '1'), - ('2.99', '595', '2007-03-23T04:00:29.996577', '15576', '2'), - ('0.99', '595', '2007-03-18T01:46:16.996577', '12235', '1'), - ('0.99', '169', '2007-03-23T02:24:20.996577', '15534', '2'), - ('4.99', '169', '2007-02-17T11:21:24.996577', '2023', '1'), - ('5.99', '169', '2007-03-17T05:08:25.996577', '11687', '2'), - ('6.99', '169', '2007-04-27T06:56:24.996577', '7187', '2'), - ('8.99', '169', '2007-04-05T22:14:45.996577', '3493', '1'), - ('0.99', '169', '2007-03-21T10:13:03.996577', '14435', '2'), - ('0.99', '169', '2007-04-27T22:04:15.996577', '7597', '1'), - ('4.99', '169', '2007-04-29T09:53:15.996577', '8558', '2'), - ('4.99', '389', '2007-02-16T16:19:27.996577', '1763', '1'), - ('2.99', '389', '2007-03-21T22:24:16.996577', '14777', '1'), - ('0.99', '389', '2007-04-05T23:39:34.996577', '3527', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['17703', '20672', '20675', '26559', '20676', '26556', '26557', '26554', '26563', '26564', '22618', '22622', '22616', '28910', '28903', '22617', '18466', '18467', '18464', '22621', '22619', '21828', '27922', '21825', '27918', '18151', '21824', '18153', '21823', '21829', '27915', '18154', '27917', '21827', '27916', '18287', '22192', '18290', '28335', '22182', '18288', '28341', '22185', '28336', '28338', '18285', '22187', '28340', '27607', '27610', '27604', '18060', '27601', '27612', '27608', '27605', '21597', '27606', '21592', '21599', '21596', '27600', '28299', '28302', '28296', '28306', '22158', '28304', '22152', '18279', '22156', '20355', '26194', '20356', '26192', '26199', '26198', '26196', '26200', '26197', '26193', '26190', '17566', '20352', '20351', '17565', '29019', '29025', '29023', '29029', '22704', '29030', '29024', '18503', '29028', '22702', '22707', '18459', '22591', '22590']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('3.99', '389', '2007-02-19T01:29:55.996577', '2552', '1'), - ('7.99', '389', '2007-03-21T12:30:10.996577', '14493', '2'), - ('5.99', '389', '2007-03-22T23:42:27.996577', '15462', '1'), - ('4.99', '389', '2007-04-27T01:26:09.996577', '7029', '1'), - ('9.99', '389', '2007-03-23T19:39:59.996577', '16011', '2'), - ('3.99', '389', '2007-04-10T04:18:01.996577', '5626', '2'), - ('2.99', '389', '2007-04-11T05:30:01.996577', '6104', '2'), - ('6.99', '389', '2007-04-07T21:34:19.996577', '4443', '1'), - ('4.99', '389', '2007-04-29T23:05:20.996577', '8887', '1'), - ('4.99', '389', '2007-04-30T23:35:53.996577', '10217', '1'), - ('4.99', '599', '2007-03-21T16:12:08.996577', '14599', '1'), - ('2.99', '599', '2007-03-23T09:53:26.996577', '15725', '2'), - ('3.99', '599', '2007-03-16T22:33:31.996577', '11522', '2'), - ('2.99', '599', '2007-04-30T05:09:45.996577', '9679', '2'), - ('0.99', '599', '2007-04-09T03:10:26.996577', '5065', '1'), - ('1.99', '599', '2007-03-21T03:35:34.996577', '14233', '1'), - ('4.99', '599', '2007-02-21T14:03:04.996577', '3398', '2'), - ('6.99', '599', '2007-02-21T17:14:31.996577', '3429', '1'), - ('1.99', '599', '2007-02-18T04:58:19.996577', '2272', '1'), - ('2.99', '599', '2007-03-23T09:37:12.996577', '15719', '2'), - ('1.99', '599', '2007-03-21T20:10:23.996577', '14719', '1'), - ('6.99', '511', '2007-03-21T05:48:23.996577', '14302', '1'), - ('0.99', '511', '2007-04-30T07:07:02.996577', '9095', '1'), - ('6.99', '511', '2007-03-17T21:28:12.996577', '12110', '2'), - ('0.99', '511', '2007-04-10T03:25:21.996577', '5601', '1'), - ('2.99', '511', '2007-02-15T06:50:05.996577', '1281', '2'), - ('2.99', '511', '2007-03-01T07:02:44.996577', '10429', '2'), - ('10.99', '511', '2007-02-20T06:07:59.996577', '2966', '2'), - ('2.99', '511', '2007-03-01T00:19:15.996577', '10231', '1'), - ('4.99', '511', '2007-03-22T13:53:59.996577', '15172', '1'), - ('0.99', '511', '2007-04-06T15:26:15.996577', '3852', '1'), - ('4.99', '511', '2007-02-21T11:32:03.996577', '3366', '2'), - ('3.99', '511', '2007-04-09T07:31:40.996577', '5164', '2'), - ('4.99', '511', '2007-03-21T02:59:13.996577', '14213', '1'), - ('4.99', '511', '2007-04-07T23:29:44.996577', '4482', '1'), - ('4.99', '550', '2007-02-17T01:47:17.996577', '1883', '2'), - ('0.99', '550', '2007-03-23T15:13:22.996577', '15883', '1'), - ('10.99', '550', '2007-02-21T03:46:53.996577', '3272', '1'), - ('0.99', '550', '2007-04-27T01:30:06.996577', '7030', '1'), - ('0.99', '550', '2007-03-02T14:41:54.996577', '11320', '2'), - ('2.99', '550', '2007-02-20T19:13:06.996577', '3154', '1'), - ('0.99', '550', '2007-04-30T07:46:22.996577', '9748', '1'), - ('4.99', '550', '2007-03-17T20:27:40.996577', '12077', '2'), - ('2.99', '550', '2007-04-28T07:28:47.996577', '7838', '2'), - ('2.99', '550', '2007-04-29T21:20:49.996577', '8838', '2'), - ('6.99', '550', '2007-02-15T02:47:03.996577', '1233', '1'), - ('2.99', '550', '2007-03-20T21:30:22.996577', '14071', '2'), - ('2.99', '550', '2007-04-30T02:33:27.996577', '9616', '1'), - ('4.99', '484', '2007-04-27T16:11:53.996577', '7440', '2'), - ('5.99', '484', '2007-04-30T08:44:30.996577', '9141', '2'), - ('5.99', '484', '2007-04-10T22:45:04.996577', '5977', '2'), - ('3.99', '484', '2007-02-15T11:19:29.996577', '1351', '1'), - ('6.99', '484', '2007-04-10T08:57:45.996577', '5708', '2'), - ('4.99', '484', '2007-04-30T08:20:42.996577', '9769', '1'), - ('2.99', '484', '2007-04-27T20:21:44.996577', '7548', '2'), - ('2.99', '484', '2007-04-11T16:02:30.996577', '6296', '2'), - ('3.99', '484', '2007-03-20T16:36:45.996577', '13956', '2'), - ('6.99', '484', '2007-04-12T18:27:00.996577', '6863', '1'), - ('4.99', '484', '2007-03-17T12:40:10.996577', '11871', '2'), - ('4.99', '484', '2007-03-23T20:17:48.996577', '16026', '1'), - ('0.99', '484', '2007-03-19T11:49:30.996577', '13160', '2'), - ('2.99', '484', '2007-04-09T17:54:11.996577', '5389', '1'), - ('0.99', '546', '2007-04-10T04:30:51.996577', '5629', '1'), - ('6.99', '546', '2007-04-12T20:39:47.996577', '6910', '2'), - ('4.99', '546', '2007-04-06T10:19:23.996577', '3738', '1'), - ('1.99', '546', '2007-04-30T03:06:07.996577', '9626', '2'), - ('3.99', '546', '2007-03-22T04:01:04.996577', '14929', '1'), - ('4.99', '546', '2007-04-30T06:48:13.996577', '9087', '1'), - ('5.99', '546', '2007-03-02T15:58:05.996577', '11352', '2'), - ('5.99', '546', '2007-02-18T11:47:31.996577', '2361', '1'), - ('4.99', '546', '2007-03-21T23:09:50.996577', '14797', '1'), - ('0.99', '357', '2007-03-22T03:47:10.996577', '14926', '1'), - ('4.99', '357', '2007-04-11T19:46:55.996577', '6367', '2'), - ('2.99', '357', '2007-03-23T14:50:46.996577', '15869', '2'), - ('0.99', '357', '2007-04-10T18:44:22.996577', '5896', '1'), - ('2.99', '357', '2007-04-28T15:08:22.996577', '8041', '2'), - ('5.99', '357', '2007-04-27T13:29:43.996577', '7366', '1'), - ('0.99', '357', '2007-04-12T17:31:45.996577', '6839', '1'), - ('2.99', '357', '2007-04-28T17:57:24.996577', '8124', '1'), - ('2.99', '357', '2007-04-27T13:07:05.996577', '7353', '1'), - ('8.99', '357', '2007-04-11T15:30:18.996577', '6288', '1'), - ('3.99', '357', '2007-04-06T16:15:23.996577', '3865', '1'), - ('1.99', '357', '2007-02-16T18:15:44.996577', '1788', '1'), - ('6.99', '357', '2007-03-01T09:36:10.996577', '10503', '1'), - ('2.99', '357', '2007-03-01T09:35:05.996577', '10502', '1'), - ('5.99', '357', '2007-02-15T03:39:45.996577', '1246', '2'), - ('4.99', '3', '2007-04-07T08:51:51.996577', '4180', '1'), - ('4.99', '3', '2007-04-28T10:15:11.996577', '7911', '1'), - ('7.99', '3', '2007-04-28T02:27:47.996577', '7703', '2'), - ('3.99', '3', '2007-04-30T20:14:12.996577', '9443', '2'), - ('8.99', '3', '2007-03-19T20:46:33.996577', '13403', '1'), - ('2.99', '3', '2007-04-30T01:56:24.996577', '9595', '1'), - ('6.99', '3', '2007-04-28T03:14:56.996577', '7724', '2'), - ('8.99', '3', '2007-02-16T00:02:31.996577', '1546', '1'), - ('1.99', '3', '2007-04-30T11:59:46.996577', '9226', '1'), - ('5.99', '3', '2007-03-01T12:48:14.996577', '10597', '2'), - ('0.99', '3', '2007-03-22T08:05:53.996577', '15038', '2'), - ('1.99', '596', '2007-02-19T16:15:01.996577', '2767', '1'), - ('3.99', '596', '2007-03-17T12:06:53.996577', '11852', '2'), - ('4.99', '596', '2007-03-02T03:34:49.996577', '11009', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['18458', '28876', '22587', '22598', '22593', '22597', '32008', '22594', '28875', '22549', '18435', '22550', '28793', '28797', '28792', '28784', '28794', '28795', '28787', '18437', '31767', '25010', '25004', '25007', '25009', '31766', '25011', '19448', '31761', '19447', '19449', '25013', '20155', '20158', '20159', '25971', '25965', '25972', '25969', '25973', '31938', '25347', '19703', '25348', '19707', '25353', '25349', '25358', '25352', '25354', '25346', '19711', '17560', '31943', '26173', '26168', '26167', '20333', '26175', '26166', '26171', '20334', '17561', '20336', '26174', '26172', '26170', '29363', '23018', '18644', '29368', '23019', '29364', '29362', '23020', '18643', '23009', '23016', '29365', '29367', '18642', '23010', '23444', '29871', '29867', '23442', '18805', '29878', '29868', '23443', '29872', '29879', '29870', '29876', '29877', '24088', '30660', '30668', '24077', '19070']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('1.99', '596', '2007-02-16T07:26:44.996577', '1644', '1'), - ('4.99', '596', '2007-04-11T10:38:17.996577', '6197', '1'), - ('4.99', '596', '2007-03-01T16:41:01.996577', '10692', '2'), - ('0.99', '596', '2007-03-22T21:49:07.996577', '15405', '1'), - ('4.99', '596', '2007-03-18T13:22:45.996577', '12560', '2'), - ('0.99', '596', '2007-03-21T09:42:01.996577', '14417', '1'), - ('0.99', '596', '2007-05-14T13:44:29.996577', '15423', '1'), - ('4.99', '596', '2007-03-19T01:45:34.996577', '12878', '1'), - ('0.99', '596', '2007-04-11T00:33:58.996577', '6017', '1'), - ('3.99', '590', '2007-03-17T06:02:31.996577', '11713', '2'), - ('2.99', '590', '2007-02-19T16:42:46.996577', '2775', '2'), - ('2.99', '590', '2007-03-22T00:05:45.996577', '14830', '1'), - ('2.99', '590', '2007-04-28T00:56:56.996577', '7665', '2'), - ('4.99', '590', '2007-04-30T12:24:50.996577', '9884', '1'), - ('4.99', '590', '2007-04-27T00:24:27.996577', '7010', '1'), - ('4.99', '590', '2007-04-08T09:13:39.996577', '4685', '2'), - ('5.99', '590', '2007-04-28T21:21:24.996577', '8195', '1'), - ('4.99', '590', '2007-04-29T19:53:48.996577', '8801', '1'), - ('0.99', '590', '2007-04-09T07:37:19.996577', '5165', '1'), - ('9.99', '590', '2007-02-20T06:01:55.996577', '2964', '1'), - ('2.99', '253', '2007-04-29T17:43:33.996577', '8752', '2'), - ('3.99', '253', '2007-03-20T22:16:20.996577', '14086', '2'), - ('4.99', '253', '2007-03-01T05:59:51.996577', '10404', '2'), - ('0.99', '253', '2007-03-18T14:01:20.996577', '12572', '1'), - ('5.99', '253', '2007-03-19T10:28:54.996577', '13126', '1'), - ('2.99', '253', '2007-04-28T09:08:38.996577', '7887', '2'), - ('4.99', '253', '2007-03-21T05:12:40.996577', '14283', '2'), - ('6.99', '253', '2007-02-16T04:46:57.996577', '1606', '2'), - ('7.99', '253', '2007-04-06T06:29:34.996577', '3658', '1'), - ('1.99', '253', '2007-02-15T13:31:41.996577', '1378', '2'), - ('5.99', '253', '2007-02-17T15:33:28.996577', '2081', '2'), - ('4.99', '253', '2007-03-21T18:05:36.996577', '14655', '2'), - ('0.99', '337', '2007-03-01T19:03:17.996577', '10765', '2'), - ('6.99', '337', '2007-03-18T06:26:09.996577', '12369', '1'), - ('6.99', '337', '2007-03-19T17:25:31.996577', '13305', '2'), - ('4.99', '337', '2007-04-27T15:10:25.996577', '7410', '1'), - ('4.99', '337', '2007-04-07T04:23:16.996577', '4093', '2'), - ('4.99', '337', '2007-04-29T08:28:29.996577', '8516', '1'), - ('7.99', '337', '2007-04-11T16:30:51.996577', '6305', '2'), - ('8.99', '337', '2007-04-30T00:25:29.996577', '8919', '2'), - ('0.99', '337', '2007-05-14T13:44:29.996577', '11847', '2'), - ('2.99', '285', '2007-04-09T05:32:30.996577', '5112', '2'), - ('2.99', '285', '2007-03-01T14:01:45.996577', '10628', '2'), - ('9.99', '285', '2007-04-10T07:20:39.996577', '5683', '1'), - ('0.99', '285', '2007-03-18T09:31:30.996577', '12449', '1'), - ('0.99', '285', '2007-04-12T09:08:05.996577', '6644', '2'), - ('0.99', '285', '2007-04-11T00:20:54.996577', '6010', '1'), - ('0.99', '285', '2007-04-29T06:53:13.996577', '8466', '2'), - ('4.99', '285', '2007-04-11T17:48:42.996577', '6333', '2'), - ('6.99', '285', '2007-04-27T07:48:26.996577', '7211', '1'), - ('6.99', '285', '2007-04-06T22:54:31.996577', '4007', '2'), - ('4.99', '285', '2007-03-23T00:35:07.996577', '15489', '1'), - ('0.99', '355', '2007-02-15T20:08:20.996577', '1488', '2'), - ('0.99', '355', '2007-05-14T13:44:29.996577', '14760', '1'), - ('4.99', '355', '2007-04-12T10:08:21.996577', '6669', '2'), - ('4.99', '355', '2007-04-09T09:52:45.996577', '5210', '1'), - ('6.99', '355', '2007-04-06T09:59:50.996577', '3730', '1'), - ('0.99', '355', '2007-03-02T20:17:29.996577', '11471', '2'), - ('5.99', '355', '2007-04-27T17:39:29.996577', '7477', '2'), - ('5.99', '355', '2007-04-06T01:38:02.996577', '3567', '1'), - ('6.99', '355', '2007-04-11T14:01:50.996577', '6262', '2'), - ('1.99', '355', '2007-03-20T12:02:13.996577', '13821', '2'), - ('2.99', '355', '2007-02-16T05:20:31.996577', '1612', '1'), - ('2.99', '355', '2007-03-23T02:21:02.996577', '15531', '2'), - ('4.99', '355', '2007-04-27T03:56:58.996577', '7108', '2'), - ('2.99', '355', '2007-04-11T22:48:55.996577', '6437', '1'), - ('0.99', '355', '2007-04-11T06:35:25.996577', '6127', '1'), - ('4.99', '34', '2007-04-09T08:50:57.996577', '5188', '1'), - ('2.99', '34', '2007-03-20T16:23:39.996577', '13949', '2'), - ('0.99', '34', '2007-02-20T19:03:54.996577', '3150', '1'), - ('0.99', '34', '2007-04-27T19:49:18.996577', '7532', '1'), - ('5.99', '34', '2007-03-21T19:00:34.996577', '14686', '1'), - ('4.99', '34', '2007-04-10T05:17:26.996577', '5643', '2'), - ('2.99', '34', '2007-04-06T18:37:37.996577', '3911', '1'), - ('7.99', '34', '2007-03-21T19:22:58.996577', '14701', '2'), - ('5.99', '34', '2007-02-18T03:58:18.996577', '2257', '2'), - ('0.99', '34', '2007-03-01T10:20:58.996577', '10523', '1'), - ('0.99', '34', '2007-03-18T17:04:42.996577', '12651', '1'), - ('5.99', '34', '2007-04-10T20:00:32.996577', '5918', '2'), - ('2.99', '34', '2007-04-27T04:37:56.996577', '7124', '2'), - ('4.99', '34', '2007-02-17T02:58:24.996577', '1900', '1'), - ('4.99', '34', '2007-03-01T13:26:40.996577', '10615', '1'), - ('2.99', '79', '2007-03-19T06:51:11.996577', '13026', '2'), - ('4.99', '79', '2007-04-08T11:51:21.996577', '4736', '2'), - ('0.99', '79', '2007-04-06T05:45:35.996577', '3641', '1'), - ('2.99', '79', '2007-03-01T15:42:41.996577', '10676', '1'), - ('2.99', '79', '2007-02-20T21:03:38.996577', '3178', '2'), - ('6.99', '79', '2007-04-30T10:56:31.996577', '9845', '2'), - ('2.99', '79', '2007-04-06T10:39:48.996577', '3748', '1'), - ('4.99', '79', '2007-03-17T03:14:05.996577', '11641', '2'), - ('2.99', '79', '2007-04-09T09:25:03.996577', '5205', '2'), - ('0.99', '79', '2007-04-30T15:51:05.996577', '9989', '1'), - ('4.99', '79', '2007-04-08T01:55:31.996577', '4530', '1'), - ('2.99', '79', '2007-04-29T21:49:27.996577', '8849', '1'), - ('1.99', '79', '2007-04-30T09:58:12.996577', '9814', '1'), - ('4.99', '147', '2007-03-22T19:06:23.996577', '15331', '2'), - ('7.99', '147', '2007-04-06T18:54:47.996577', '3919', '2'), - ('2.99', '147', '2007-04-12T13:24:08.996577', '6753', '2'), - ('7.99', '147', '2007-03-01T17:09:54.996577', '10706', '1'), - ('6.99', '147', '2007-02-18T18:05:16.996577', '2456', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['30666', '24080', '30665', '30671', '19071', '24083', '20632', '26520', '20629', '20626', '26516', '26518', '26519', '20631', '26522', '26521', '26514', '22787', '22785', '22782', '29114', '29110', '22783', '29113', '18537', '18539', '29105', '22781', '22786', '27836', '21756', '27828', '21765', '21763', '21762', '18124', '21753', '27831', '21758', '27829', '18123', '18614', '29304', '18620', '22976', '22969', '29297', '22962', '22972', '29301', '22967', '22973', '22971', '29305', '22966', '29298', '18619', '18617', '18615', '18227', '28145', '22011', '28148', '28141', '28140', '22018', '28149', '28150', '22012', '22016', '28308', '22162', '28316', '22168', '28315', '22167', '22166', '28311', '22163', '18280', '28307', '22161', '22160', '29597', '18716', '18713', '29593', '29591', '23193', '23198', '23195', '23197', '29596', '23190', '29594', '23194', '29592', '18714', '17712', '26584']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('0.99', '147', '2007-04-11T18:20:01.996577', '6343', '2'), - ('4.99', '147', '2007-03-18T21:26:11.996577', '12757', '1'), - ('0.99', '147', '2007-04-10T15:43:09.996577', '5844', '1'), - ('2.99', '147', '2007-04-29T23:16:45.996577', '8893', '1'), - ('2.99', '147', '2007-02-19T21:47:08.996577', '2859', '2'), - ('4.99', '147', '2007-03-20T19:30:38.996577', '14021', '2'), - ('7.99', '385', '2007-03-19T08:12:43.996577', '13062', '2'), - ('2.99', '385', '2007-04-29T03:16:48.996577', '8346', '1'), - ('2.99', '385', '2007-03-16T23:48:52.996577', '11559', '1'), - ('3.99', '385', '2007-03-01T14:09:01.996577', '10636', '1'), - ('2.99', '385', '2007-04-10T12:23:59.996577', '5783', '1'), - ('4.99', '385', '2007-04-26T21:37:49.996577', '6933', '2'), - ('0.99', '385', '2007-04-28T05:33:02.996577', '7776', '2'), - ('8.99', '385', '2007-03-18T18:23:35.996577', '12686', '2'), - ('2.99', '385', '2007-04-30T01:09:03.996577', '9570', '1'), - ('2.99', '385', '2007-04-29T08:33:53.996577', '8518', '1'), - ('0.99', '385', '2007-04-06T20:23:21.996577', '3953', '2'), - ('0.99', '11', '2007-03-22T11:11:13.996577', '15120', '1'), - ('0.99', '11', '2007-03-20T03:35:53.996577', '13572', '2'), - ('6.99', '11', '2007-03-02T08:43:24.996577', '11166', '2'), - ('9.99', '11', '2007-04-30T01:45:39.996577', '8950', '1'), - ('4.99', '11', '2007-04-28T14:00:33.996577', '8014', '1'), - ('0.99', '11', '2007-03-16T21:34:56.996577', '11502', '2'), - ('0.99', '11', '2007-04-29T16:02:11.996577', '8715', '1'), - ('6.99', '11', '2007-02-15T19:21:33.996577', '1470', '1'), - ('0.99', '11', '2007-02-20T22:17:38.996577', '3192', '1'), - ('2.99', '11', '2007-04-08T05:47:37.996577', '4608', '2'), - ('4.99', '11', '2007-03-01T21:09:42.996577', '10812', '1'), - ('4.99', '11', '2007-03-20T10:45:53.996577', '13790', '1'), - ('4.99', '503', '2007-04-30T15:19:37.996577', '9974', '1'), - ('2.99', '503', '2007-03-18T06:26:13.996577', '12370', '2'), - ('2.99', '503', '2007-04-08T04:02:25.996577', '4570', '2'), - ('4.99', '503', '2007-03-23T08:28:28.996577', '15692', '1'), - ('2.99', '503', '2007-03-22T09:37:44.996577', '15077', '2'), - ('4.99', '503', '2007-03-22T08:44:20.996577', '15056', '2'), - ('2.99', '503', '2007-02-18T02:04:06.996577', '2225', '1'), - ('2.99', '503', '2007-03-02T05:52:49.996577', '11075', '2'), - ('4.99', '503', '2007-04-11T08:47:31.996577', '6166', '1'), - ('2.99', '503', '2007-03-19T18:29:17.996577', '13332', '1'), - ('2.99', '503', '2007-04-09T21:29:39.996577', '5465', '2'), - ('4.99', '503', '2007-02-17T18:03:52.996577', '2108', '2'), - ('0.99', '29', '2007-02-19T09:07:08.996577', '2655', '1'), - ('0.99', '29', '2007-04-27T16:55:39.996577', '7453', '1'), - ('2.99', '29', '2007-02-21T07:17:42.996577', '3324', '1'), - ('7.99', '29', '2007-03-22T06:04:22.996577', '14985', '1'), - ('6.99', '29', '2007-03-18T15:44:33.996577', '12615', '2'), - ('6.99', '29', '2007-04-07T12:52:56.996577', '4262', '2'), - ('5.99', '29', '2007-03-01T11:04:35.996577', '10543', '1'), - ('2.99', '29', '2007-03-20T10:32:01.996577', '13777', '2'), - ('1.99', '29', '2007-04-10T16:27:55.996577', '5857', '1'), - ('2.99', '29', '2007-03-18T11:48:39.996577', '12508', '1'), - ('3.99', '29', '2007-03-20T12:28:51.996577', '13832', '1'), - ('0.99', '29', '2007-03-19T22:04:51.996577', '13436', '1'), - ('2.99', '29', '2007-04-29T14:18:40.996577', '8673', '2'), - ('4.99', '29', '2007-03-18T11:16:48.996577', '12488', '1'), - ('0.99', '29', '2007-04-07T16:05:22.996577', '4313', '1'), - ('2.99', '29', '2007-02-20T02:44:33.996577', '2923', '2'), - ('2.99', '29', '2007-02-19T14:10:33.996577', '2735', '1'), - ('0.99', '29', '2007-02-19T10:10:46.996577', '2673', '1'), - ('2.99', '531', '2007-02-20T06:26:20.996577', '2972', '2'), - ('4.99', '531', '2007-04-12T19:01:16.996577', '6876', '1'), - ('4.99', '531', '2007-03-02T00:42:36.996577', '10920', '2'), - ('2.99', '531', '2007-04-27T16:17:42.996577', '7444', '2'), - ('5.99', '531', '2007-04-10T02:45:51.996577', '5587', '1'), - ('5.99', '531', '2007-04-06T18:58:14.996577', '3921', '2'), - ('0.99', '531', '2007-03-22T20:05:17.996577', '15360', '2'), - ('6.99', '531', '2007-04-28T04:37:45.996577', '7753', '2'), - ('5.99', '531', '2007-04-29T03:30:38.996577', '8359', '2'), - ('5.99', '531', '2007-03-02T01:39:59.996577', '10941', '1'), - ('2.99', '531', '2007-03-19T03:18:46.996577', '12923', '1'), - ('4.99', '547', '2007-04-06T11:30:13.996577', '3765', '1'), - ('5.99', '547', '2007-03-02T08:50:19.996577', '11170', '2'), - ('2.99', '547', '2007-04-29T21:01:20.996577', '8828', '1'), - ('4.99', '547', '2007-03-22T02:25:34.996577', '14884', '2'), - ('3.99', '547', '2007-04-28T08:25:43.996577', '7859', '1'), - ('9.99', '547', '2007-03-21T13:13:07.996577', '14510', '1'), - ('2.99', '547', '2007-03-19T17:27:10.996577', '13307', '2'), - ('0.99', '547', '2007-04-12T06:29:33.996577', '6605', '1'), - ('0.99', '547', '2007-03-02T16:15:00.996577', '11361', '2'), - ('8.99', '547', '2007-02-17T11:13:05.996577', '2022', '2'), - ('4.99', '547', '2007-04-06T07:44:23.996577', '3679', '2'), - ('4.99', '547', '2007-03-02T02:45:58.996577', '10980', '1'), - ('2.99', '547', '2007-03-02T00:10:25.996577', '10903', '1'), - ('7.99', '53', '2007-04-30T13:42:23.996577', '9928', '1'), - ('2.99', '53', '2007-02-20T18:15:38.996577', '3140', '2'), - ('0.99', '53', '2007-02-17T07:38:35.996577', '1964', '1'), - ('2.99', '53', '2007-04-09T08:43:05.996577', '5185', '2'), - ('2.99', '53', '2007-04-06T03:05:36.996577', '3591', '2'), - ('2.99', '53', '2007-03-20T10:45:04.996577', '13789', '2'), - ('0.99', '53', '2007-03-21T23:37:30.996577', '14811', '2'), - ('0.99', '53', '2007-03-20T22:39:43.996577', '14091', '2'), - ('4.99', '53', '2007-03-21T18:27:56.996577', '14671', '1'), - ('4.99', '53', '2007-04-30T16:41:39.996577', '9343', '1'), - ('5.99', '53', '2007-03-17T19:28:22.996577', '12054', '1'), - ('2.99', '53', '2007-04-27T17:19:43.996577', '7466', '2'), - ('2.99', '53', '2007-03-20T21:00:37.996577', '14061', '1'), - ('4.99', '53', '2007-04-06T17:41:03.996577', '3898', '2'), - ('2.99', '53', '2007-02-18T13:54:56.996577', '2388', '1'), - ('2.99', '391', '2007-02-19T11:28:28.996577', '2690', '1'), - ('3.99', '391', '2007-04-11T16:24:04.996577', '6302', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['20689', '20691', '26583', '26579', '20696', '20692', '26585', '26590', '26582', '17710', '26588', '26587', '20785', '26681', '20783', '26690', '20782', '20787', '26686', '26683', '26682', '26688', '20784', '19405', '24896', '24901', '31627', '31637', '31631', '19406', '31629', '24897', '31635', '31886', '31883', '31885', '25132', '31879', '25131', '31880', '31889', '32098', '19501', '25135', '31882', '25134', '31888', '25130', '25129', '24545', '19254', '24544', '31180', '19252', '31178', '24541', '31177', '20812', '26718', '17753', '26727', '20815', '26725', '26726', '26716', '20807', '20810', '26715', '20813', '17752', '20814', '26724', '20808', '25529', '25527', '19841', '25536', '25537', '25533', '19838', '25532', '19836', '25535', '25530', '25531', '24250', '30845', '24252', '32063', '19130', '30843', '19126', '24258', '24256', '19127', '24259', '24257', '30837', '30846', '30836']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('2.99', '391', '2007-03-01T06:05:31.996577', '10406', '2'), - ('2.99', '391', '2007-03-02T18:41:40.996577', '11434', '2'), - ('4.99', '391', '2007-04-10T03:20:30.996577', '5599', '1'), - ('5.99', '391', '2007-04-07T09:13:55.996577', '4188', '1'), - ('0.99', '391', '2007-03-21T08:24:13.996577', '14381', '1'), - ('4.99', '391', '2007-03-17T01:49:45.996577', '11602', '1'), - ('2.99', '391', '2007-04-11T23:44:37.996577', '6463', '1'), - ('7.99', '391', '2007-04-30T23:27:18.996577', '10210', '1'), - ('7.99', '391', '2007-04-10T02:37:14.996577', '5583', '2'), - ('0.99', '391', '2007-02-17T05:20:22.996577', '1931', '2'), - ('6.99', '391', '2007-04-30T00:03:27.996577', '8913', '2'), - ('0.99', '391', '2007-04-29T23:54:31.996577', '8908', '1'), - ('1.99', '401', '2007-03-21T10:05:00.996577', '14433', '2'), - ('0.99', '401', '2007-04-07T02:32:52.996577', '4059', '1'), - ('4.99', '401', '2007-03-19T06:47:47.996577', '13024', '1'), - ('0.99', '401', '2007-04-30T21:57:31.996577', '10171', '2'), - ('2.99', '401', '2007-03-19T02:42:09.996577', '12906', '1'), - ('0.99', '401', '2007-03-23T16:51:37.996577', '15927', '1'), - ('2.99', '401', '2007-04-29T06:12:31.996577', '8450', '1'), - ('0.99', '401', '2007-04-10T20:08:32.996577', '5923', '2'), - ('7.99', '401', '2007-04-07T14:17:04.996577', '4292', '2'), - ('8.99', '401', '2007-04-29T16:27:24.996577', '8722', '1'), - ('0.99', '401', '2007-03-21T07:44:45.996577', '14359', '1'), - ('4.99', '240', '2007-02-18T04:27:11.996577', '2264', '1'), - ('6.99', '240', '2007-03-18T03:22:51.996577', '12283', '2'), - ('0.99', '240', '2007-03-23T06:35:15.996577', '15641', '2'), - ('4.99', '240', '2007-04-09T12:36:27.996577', '5262', '2'), - ('5.99', '240', '2007-04-29T23:39:37.996577', '8905', '2'), - ('4.99', '240', '2007-04-26T22:24:23.996577', '6956', '1'), - ('5.99', '240', '2007-02-19T23:06:47.996577', '2872', '2'), - ('0.99', '240', '2007-04-11T14:32:15.996577', '6272', '1'), - ('2.99', '240', '2007-03-19T06:56:37.996577', '13030', '2'), - ('4.99', '240', '2007-04-28T08:44:29.996577', '7870', '1'), - ('2.99', '264', '2007-04-30T17:45:57.996577', '9380', '2'), - ('2.99', '264', '2007-04-11T20:57:55.996577', '6395', '1'), - ('8.99', '264', '2007-04-27T00:10:46.996577', '7006', '1'), - ('4.99', '264', '2007-03-18T12:09:58.996577', '12518', '1'), - ('4.99', '264', '2007-04-07T16:31:43.996577', '4328', '1'), - ('2.99', '264', '2007-03-16T23:14:07.996577', '11539', '1'), - ('0.99', '264', '2007-04-08T02:29:28.996577', '4539', '1'), - ('5.99', '264', '2007-04-30T13:48:14.996577', '9932', '1'), - ('2.99', '264', '2007-05-14T13:44:29.996577', '14243', '2'), - ('3.99', '264', '2007-02-21T14:23:32.996577', '3403', '1'), - ('4.99', '264', '2007-03-23T04:47:38.996577', '15595', '1'), - ('0.99', '264', '2007-04-11T20:51:35.996577', '6391', '2'), - ('5.99', '264', '2007-03-20T06:47:02.996577', '13664', '1'), - ('5.99', '264', '2007-04-30T11:32:40.996577', '9861', '1'), - ('0.99', '264', '2007-03-16T23:03:19.996577', '11533', '2'), - ('3.99', '264', '2007-03-16T22:53:32.996577', '11527', '1'), - ('4.99', '194', '2007-03-23T17:11:48.996577', '15937', '2'), - ('2.99', '194', '2007-02-18T10:40:55.996577', '2347', '1'), - ('4.99', '194', '2007-03-21T10:27:30.996577', '14440', '1'), - ('3.99', '194', '2007-04-10T18:38:00.996577', '5894', '2'), - ('0.99', '194', '2007-02-15T16:53:21.996577', '1430', '1'), - ('2.99', '194', '2007-04-09T06:43:24.996577', '5146', '2'), - ('3.99', '194', '2007-03-19T00:40:38.996577', '12851', '2'), - ('7.99', '194', '2007-04-07T11:16:45.996577', '4231', '2'), - ('0.99', '404', '2007-03-21T19:10:55.996577', '14691', '1'), - ('4.99', '404', '2007-04-08T08:16:27.996577', '4653', '1'), - ('4.99', '404', '2007-02-16T22:08:00.996577', '1840', '2'), - ('4.99', '404', '2007-04-30T21:31:58.996577', '9472', '1'), - ('4.99', '404', '2007-03-22T03:20:08.996577', '14912', '2'), - ('3.99', '404', '2007-04-29T06:21:32.996577', '8455', '1'), - ('4.99', '404', '2007-04-30T11:15:25.996577', '9206', '1'), - ('2.99', '404', '2007-04-08T00:12:12.996577', '4495', '1'), - ('2.99', '404', '2007-03-01T14:48:48.996577', '10651', '1'), - ('5.99', '404', '2007-03-19T21:15:01.996577', '13412', '2'), - ('2.99', '404', '2007-04-06T19:16:40.996577', '3927', '1'), - ('5.99', '404', '2007-03-22T00:17:33.996577', '14835', '2'), - ('2.99', '404', '2007-02-15T20:48:03.996577', '1506', '2'), - ('4.99', '404', '2007-03-22T00:26:00.996577', '14838', '2'), - ('5.99', '404', '2007-04-28T15:36:15.996577', '8058', '1'), - ('5.99', '404', '2007-03-18T05:09:56.996577', '12325', '1'), - ('2.99', '299', '2007-04-07T17:31:07.996577', '4350', '1'), - ('0.99', '299', '2007-04-05T22:28:29.996577', '3497', '2'), - ('6.99', '299', '2007-03-22T02:55:00.996577', '14898', '2'), - ('9.99', '299', '2007-04-28T08:30:51.996577', '7862', '2'), - ('2.99', '299', '2007-04-30T23:19:20.996577', '9520', '1'), - ('7.99', '299', '2007-04-12T18:06:37.996577', '6853', '1'), - ('0.99', '299', '2007-03-21T02:37:44.996577', '14208', '2'), - ('0.99', '299', '2007-04-12T12:27:17.996577', '6732', '2'), - ('0.99', '299', '2007-03-17T17:14:47.996577', '11998', '1'), - ('2.99', '299', '2007-04-28T04:17:22.996577', '7746', '1'), - ('1.99', '299', '2007-04-09T01:10:27.996577', '5033', '2'), - ('2.99', '299', '2007-04-10T05:14:34.996577', '5642', '1'), - ('0.99', '163', '2007-03-01T00:52:35.996577', '10245', '2'), - ('4.99', '163', '2007-04-28T15:43:37.996577', '8063', '2'), - ('4.99', '163', '2007-03-17T15:24:54.996577', '11940', '2'), - ('0.00', '163', '2007-05-14T13:44:29.996577', '15282', '1'), - ('6.99', '163', '2007-02-20T07:45:31.996577', '2994', '1'), - ('2.99', '163', '2007-04-27T14:50:35.996577', '7403', '1'), - ('4.99', '163', '2007-02-15T05:29:16.996577', '1265', '2'), - ('8.99', '163', '2007-03-23T01:59:11.996577', '15520', '1'), - ('4.99', '163', '2007-03-21T04:58:56.996577', '14275', '2'), - ('2.99', '163', '2007-02-17T10:00:56.996577', '2000', '2'), - ('0.99', '163', '2007-03-23T14:08:04.996577', '15847', '1'), - ('5.99', '163', '2007-03-21T09:54:32.996577', '14427', '2'), - ('1.99', '163', '2007-04-07T05:52:37.996577', '4126', '1'), - ('4.99', '163', '2007-04-29T04:55:05.996577', '8403', '2'), - ('3.99', '163', '2007-04-06T18:45:12.996577', '3915', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['19129', '18720', '23207', '18721', '23199', '23200', '29604', '23205', '23209', '23202', '23208', '23204', '29605', '23203', '23211', '18719', '27669', '27671', '27672', '21643', '18075', '18074', '21636', '18073', '21644', '21640', '18374', '28600', '28603', '22410', '18375', '28593', '22405', '22411', '28599', '28596', '22409', '28601', '26631', '20736', '26636', '26630', '20741', '17732', '20737', '20735', '20738', '20734', '17731', '26635', '20733', '26640', '26637', '20742', '29002', '29000', '22680', '29001', '28998', '18500', '22684', '22687', '22689', '18497', '28996', '22682', '18498', '18501', '20428', '26290', '26288', '26284', '26286', '26291', '26293', '20423', '17603', '26287', '17604', '20424', '26289', '27994', '18188', '18187', '21904', '28002', '18186', '21905', '27995', '28003', '28005', '28000', '27996', '28001', '21908', '21909', '21906', '24010', '30592', '30593']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('5.99', '163', '2007-02-19T00:10:00.996577', '2536', '2'), - ('6.99', '54', '2007-02-18T08:23:28.996577', '2323', '2'), - ('0.99', '54', '2007-03-19T01:26:03.996577', '12872', '2'), - ('4.99', '54', '2007-02-19T08:26:22.996577', '2647', '1'), - ('5.99', '54', '2007-03-01T08:56:08.996577', '10489', '2'), - ('5.99', '54', '2007-03-01T23:15:42.996577', '10882', '2'), - ('0.99', '54', '2007-04-12T16:32:16.996577', '6813', '1'), - ('5.99', '54', '2007-03-18T22:04:22.996577', '12775', '2'), - ('0.99', '54', '2007-03-20T14:09:26.996577', '13890', '1'), - ('4.99', '54', '2007-03-02T09:23:40.996577', '11182', '1'), - ('2.99', '54', '2007-03-19T17:44:44.996577', '13315', '2'), - ('2.99', '54', '2007-03-18T12:17:09.996577', '12526', '1'), - ('4.99', '54', '2007-04-30T03:12:44.996577', '8992', '2'), - ('2.99', '54', '2007-03-17T13:31:39.996577', '11887', '2'), - ('10.99', '54', '2007-03-22T15:48:43.996577', '15226', '1'), - ('2.99', '54', '2007-02-16T01:50:26.996577', '1571', '1'), - ('2.99', '489', '2007-04-06T13:55:30.996577', '3816', '2'), - ('4.99', '489', '2007-04-26T22:41:28.996577', '6963', '1'), - ('0.99', '489', '2007-04-30T12:10:41.996577', '9231', '2'), - ('0.99', '489', '2007-03-22T15:00:49.996577', '15205', '1'), - ('7.99', '489', '2007-02-18T12:58:20.996577', '2370', '1'), - ('0.99', '489', '2007-02-18T00:36:53.996577', '2201', '1'), - ('4.99', '489', '2007-03-17T05:50:51.996577', '11705', '1'), - ('3.99', '489', '2007-02-16T05:26:28.996577', '1614', '2'), - ('4.99', '489', '2007-03-23T18:40:43.996577', '15981', '1'), - ('5.99', '489', '2007-03-20T22:54:11.996577', '14095', '2'), - ('0.99', '574', '2007-02-16T01:03:29.996577', '1559', '1'), - ('1.99', '574', '2007-04-27T03:15:26.996577', '7093', '1'), - ('4.99', '574', '2007-04-29T01:34:22.996577', '8303', '1'), - ('2.99', '574', '2007-03-22T04:26:49.996577', '14941', '2'), - ('5.99', '574', '2007-02-16T06:57:20.996577', '1636', '2'), - ('4.99', '574', '2007-04-07T10:21:40.996577', '4212', '1'), - ('4.99', '574', '2007-03-01T03:48:29.996577', '10347', '1'), - ('2.99', '574', '2007-03-22T15:21:55.996577', '15214', '2'), - ('2.99', '574', '2007-04-12T02:42:45.996577', '6523', '1'), - ('3.99', '574', '2007-04-09T03:41:48.996577', '5076', '1'), - ('4.99', '574', '2007-03-20T21:48:36.996577', '14076', '1'), - ('2.99', '574', '2007-04-27T05:01:32.996577', '7134', '1'), - ('2.99', '396', '2007-04-11T17:53:41.996577', '6335', '2'), - ('4.99', '396', '2007-03-19T19:27:45.996577', '13355', '2'), - ('2.99', '396', '2007-04-29T03:45:01.996577', '8371', '2'), - ('1.99', '396', '2007-04-09T02:56:27.996577', '5059', '1'), - ('1.99', '396', '2007-03-21T23:05:07.996577', '14792', '1'), - ('6.99', '396', '2007-02-15T15:26:24.996577', '1408', '2'), - ('3.99', '396', '2007-03-20T21:55:06.996577', '14078', '1'), - ('4.99', '396', '2007-03-19T02:19:14.996577', '12895', '1'), - ('4.99', '396', '2007-03-21T01:28:57.996577', '14169', '1'), - ('5.99', '396', '2007-03-18T07:31:07.996577', '12393', '2'), - ('4.99', '396', '2007-02-15T13:56:49.996577', '1385', '2'), - ('2.99', '396', '2007-04-27T11:40:23.996577', '7313', '2'), - ('0.99', '396', '2007-03-01T13:18:07.996577', '10610', '2'), - ('0.99', '396', '2007-04-30T20:00:15.996577', '10124', '2'), - ('2.99', '396', '2007-04-29T20:05:25.996577', '8807', '2'), - ('7.99', '396', '2007-03-22T14:43:59.996577', '15198', '2'), - ('0.99', '1', '2007-04-28T17:48:33.996577', '8116', '2'), - ('4.99', '1', '2007-04-28T14:46:49.996577', '8033', '2'), - ('4.99', '1', '2007-03-01T07:19:30.996577', '10437', '2'), - ('0.99', '1', '2007-04-28T16:02:05.996577', '8074', '1'), - ('2.99', '1', '2007-04-27T09:59:48.996577', '7273', '2'), - ('0.99', '1', '2007-02-18T12:02:25.996577', '2363', '2'), - ('0.99', '1', '2007-03-18T02:25:55.996577', '12250', '1'), - ('0.99', '1', '2007-03-21T22:02:23.996577', '14762', '1'), - ('2.99', '1', '2007-03-22T18:10:03.996577', '15298', '2'), - ('9.99', '1', '2007-02-15T19:37:12.996577', '1476', '2'), - ('4.99', '1', '2007-04-09T15:06:27.996577', '5326', '1'), - ('0.99', '1', '2007-03-02T16:30:04.996577', '11367', '1'), - ('4.99', '1', '2007-02-16T13:47:23.996577', '1725', '1'), - ('3.99', '1', '2007-02-21T04:53:11.996577', '3284', '1'), - ('6.99', '365', '2007-03-21T11:20:15.996577', '14463', '2'), - ('3.99', '365', '2007-04-29T22:10:26.996577', '8856', '1'), - ('4.99', '365', '2007-04-28T19:56:58.996577', '8168', '1'), - ('1.99', '365', '2007-04-08T04:38:10.996577', '4583', '1'), - ('7.99', '365', '2007-04-27T18:04:41.996577', '7488', '1'), - ('2.99', '365', '2007-04-30T08:05:18.996577', '9122', '1'), - ('2.99', '365', '2007-04-30T00:08:32.996577', '9540', '2'), - ('2.99', '365', '2007-03-01T17:22:19.996577', '10717', '2'), - ('6.99', '365', '2007-02-16T02:36:42.996577', '1578', '1'), - ('4.99', '365', '2007-04-27T23:35:27.996577', '7634', '2'), - ('4.99', '365', '2007-02-17T08:50:39.996577', '1983', '1'), - ('2.99', '365', '2007-03-18T05:03:54.996577', '12322', '2'), - ('4.99', '365', '2007-04-29T18:58:00.996577', '8782', '2'), - ('2.99', '519', '2007-04-08T14:10:05.996577', '4773', '2'), - ('5.99', '519', '2007-02-20T07:52:11.996577', '2997', '2'), - ('8.99', '519', '2007-02-18T21:56:53.996577', '2505', '2'), - ('4.99', '519', '2007-03-01T16:48:49.996577', '10697', '2'), - ('0.99', '519', '2007-04-30T04:11:15.996577', '9645', '2'), - ('2.99', '519', '2007-02-17T06:11:11.996577', '1941', '1'), - ('7.99', '519', '2007-03-18T16:58:47.996577', '12648', '2'), - ('0.99', '519', '2007-04-09T11:24:55.996577', '5236', '2'), - ('7.99', '519', '2007-04-30T12:28:39.996577', '9886', '2'), - ('5.99', '519', '2007-04-30T19:08:04.996577', '10097', '1'), - ('4.99', '519', '2007-04-30T20:11:54.996577', '9441', '2'), - ('5.99', '519', '2007-04-10T01:21:13.996577', '5547', '2'), - ('7.99', '519', '2007-04-30T23:46:53.996577', '9534', '2'), - ('2.99', '519', '2007-03-21T01:45:36.996577', '14182', '1'), - ('2.99', '519', '2007-03-22T19:40:45.996577', '15347', '2'), - ('2.99', '519', '2007-03-19T03:20:13.996577', '12924', '2'), - ('5.99', '141', '2007-03-17T18:42:52.996577', '12032', '1'), - ('5.99', '141', '2007-04-08T08:18:36.996577', '4656', '1'), - ('2.99', '141', '2007-04-09T03:05:15.996577', '5062', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['30590', '24009', '19046', '24014', '24018', '24012', '30594', '24016', '24011', '30596', '24015', '24006', '19044', '24007', '21055', '27009', '27005', '17840', '27013', '27011', '22398', '28580', '28587', '28584', '28585', '22403', '28577', '22396', '28579', '18372', '28589', '22404', '28581', '18373', '22399', '22402', '22397', '18370', '28582', '23413', '29840', '23412', '18793', '23416', '29839', '29836', '18791', '18794', '23414', '26203', '26205', '17570', '26204', '20360', '20361', '26207', '26209', '17571', '29662', '18742', '29663', '23259', '29661', '29660', '29659', '29658', '23266', '29657', '23268', '23265', '18743', '23956', '19028', '30533', '23953', '23958', '30534', '25386', '19728', '25381', '25383', '19727', '19721', '19725', '25384', '19720', '19722', '25376', '19726', '19723', '31926', '23945', '23950', '23951', '23948', '30527', '30521', '30520', '32056', '19025']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('1.99', '141', '2007-04-07T02:28:46.996577', '4057', '1'), - ('5.99', '141', '2007-03-02T18:01:17.996577', '11412', '1'), - ('4.99', '141', '2007-02-21T17:36:54.996577', '3434', '1'), - ('0.99', '141', '2007-03-19T06:05:08.996577', '13000', '1'), - ('2.99', '141', '2007-03-20T23:29:12.996577', '14112', '1'), - ('3.99', '141', '2007-03-17T21:24:50.996577', '12107', '2'), - ('0.99', '141', '2007-04-10T11:46:24.996577', '5769', '1'), - ('4.99', '141', '2007-03-19T23:29:42.996577', '13470', '2'), - ('2.99', '141', '2007-03-17T20:57:06.996577', '12093', '1'), - ('2.99', '141', '2007-04-28T08:55:36.996577', '7878', '2'), - ('2.99', '141', '2007-03-19T12:12:01.996577', '13169', '2'), - ('1.99', '141', '2007-03-01T05:02:55.996577', '10379', '1'), - ('7.99', '141', '2007-02-15T03:33:33.996577', '1242', '2'), - ('4.99', '141', '2007-03-01T20:31:36.996577', '10798', '1'), - ('4.99', '429', '2007-03-19T04:32:33.996577', '12953', '1'), - ('4.99', '429', '2007-04-27T13:06:55.996577', '7352', '2'), - ('4.99', '429', '2007-04-10T17:07:42.996577', '5868', '2'), - ('2.99', '429', '2007-02-21T14:46:04.996577', '3409', '1'), - ('0.99', '429', '2007-04-30T11:13:00.996577', '9849', '1'), - ('2.99', '429', '2007-04-28T18:51:37.996577', '8143', '2'), - ('0.99', '573', '2007-03-02T04:33:10.996577', '11043', '1'), - ('0.99', '573', '2007-04-08T05:50:55.996577', '4609', '1'), - ('10.99', '573', '2007-04-30T10:42:45.996577', '9837', '2'), - ('2.99', '573', '2007-04-10T19:07:30.996577', '5903', '2'), - ('7.99', '573', '2007-04-12T11:05:26.996577', '6693', '1'), - ('0.99', '573', '2007-03-18T22:45:35.996577', '12791', '1'), - ('2.99', '573', '2007-04-06T19:22:33.996577', '3930', '1'), - ('0.99', '573', '2007-03-01T02:33:03.996577', '10296', '1'), - ('0.99', '573', '2007-04-07T03:54:05.996577', '4085', '1'), - ('1.99', '573', '2007-02-20T07:46:48.996577', '2995', '1'), - ('2.99', '573', '2007-04-30T14:45:12.996577', '9963', '2'), - ('2.99', '573', '2007-03-19T09:55:46.996577', '13113', '2'), - ('2.99', '573', '2007-04-08T13:58:12.996577', '4770', '1'), - ('7.99', '573', '2007-02-21T05:32:43.996577', '3295', '1'), - ('5.99', '573', '2007-03-17T14:20:15.996577', '11912', '2'), - ('6.99', '573', '2007-03-18T02:56:20.996577', '12269', '1'), - ('2.99', '573', '2007-03-01T23:21:01.996577', '10887', '1'), - ('4.99', '573', '2007-02-16T05:23:36.996577', '1613', '1'), - ('5.99', '573', '2007-04-09T01:27:07.996577', '5036', '1'), - ('7.99', '76', '2007-03-02T08:56:18.996577', '11172', '2'), - ('2.99', '76', '2007-04-29T03:28:10.996577', '8357', '2'), - ('4.99', '76', '2007-03-01T20:25:03.996577', '10795', '2'), - ('1.99', '76', '2007-02-18T14:19:51.996577', '2397', '2'), - ('4.99', '76', '2007-03-22T13:50:22.996577', '15169', '2'), - ('6.99', '76', '2007-04-28T23:25:32.996577', '8253', '2'), - ('4.99', '76', '2007-04-07T04:48:59.996577', '4099', '2'), - ('6.99', '76', '2007-02-16T18:32:54.996577', '1791', '1'), - ('0.99', '76', '2007-02-20T00:51:08.996577', '2894', '1'), - ('3.99', '76', '2007-03-20T07:49:34.996577', '13697', '2'), - ('2.99', '358', '2007-04-06T13:45:03.996577', '3809', '1'), - ('2.99', '358', '2007-04-11T19:37:57.996577', '6362', '1'), - ('0.99', '358', '2007-02-17T03:39:02.996577', '1908', '2'), - ('5.99', '358', '2007-04-09T00:51:42.996577', '5023', '2'), - ('6.99', '358', '2007-03-18T09:43:01.996577', '12452', '1'), - ('2.99', '358', '2007-03-19T13:12:29.996577', '13197', '1'), - ('0.99', '358', '2007-04-30T05:51:43.996577', '9062', '2'), - ('2.99', '358', '2007-04-30T23:01:53.996577', '10193', '1'), - ('5.99', '358', '2007-02-17T18:28:51.996577', '2114', '1'), - ('0.99', '60', '2007-04-27T18:24:57.996577', '7494', '1'), - ('4.99', '60', '2007-02-15T19:46:42.996577', '1482', '2'), - ('4.99', '60', '2007-04-30T17:04:50.996577', '9356', '1'), - ('0.99', '60', '2007-03-01T15:56:31.996577', '10680', '2'), - ('3.99', '60', '2007-04-27T12:26:16.996577', '7331', '1'), - ('0.99', '60', '2007-04-27T02:23:36.996577', '7067', '2'), - ('5.99', '60', '2007-04-11T15:14:48.996577', '6282', '1'), - ('2.99', '60', '2007-04-06T15:18:09.996577', '3849', '1'), - ('5.99', '60', '2007-03-23T05:36:24.996577', '15618', '1'), - ('2.99', '60', '2007-04-05T21:26:00.996577', '3473', '2'), - ('2.99', '60', '2007-03-23T06:56:29.996577', '15649', '1'), - ('2.99', '60', '2007-03-22T18:43:42.996577', '15318', '1'), - ('4.99', '60', '2007-02-18T14:10:56.996577', '2394', '2'), - ('0.99', '136', '2007-03-21T08:21:29.996577', '14379', '2'), - ('2.99', '136', '2007-02-17T17:42:56.996577', '2104', '2'), - ('8.99', '136', '2007-04-12T05:19:18.996577', '6585', '1'), - ('5.99', '136', '2007-03-18T03:26:32.996577', '12287', '1'), - ('4.99', '136', '2007-03-22T23:02:54.996577', '15439', '1'), - ('0.99', '136', '2007-04-30T15:43:53.996577', '9319', '2'), - ('6.99', '287', '2007-04-30T17:02:17.996577', '10027', '1'), - ('2.99', '287', '2007-03-23T05:33:41.996577', '15614', '1'), - ('2.99', '287', '2007-04-11T21:02:28.996577', '6397', '1'), - ('2.99', '287', '2007-04-28T05:33:08.996577', '7777', '2'), - ('0.99', '287', '2007-03-22T11:24:55.996577', '15127', '2'), - ('4.99', '287', '2007-03-02T06:46:04.996577', '11106', '2'), - ('1.99', '287', '2007-03-22T09:34:00.996577', '15076', '2'), - ('6.99', '287', '2007-04-30T03:19:58.996577', '8994', '2'), - ('4.99', '287', '2007-03-01T20:54:36.996577', '10807', '2'), - ('4.99', '287', '2007-03-17T06:09:21.996577', '11716', '1'), - ('4.99', '287', '2007-04-08T17:59:28.996577', '4877', '2'), - ('4.99', '287', '2007-03-22T09:46:25.996577', '15084', '1'), - ('2.99', '287', '2007-03-19T00:58:50.996577', '12861', '2'), - ('0.99', '287', '2007-05-14T13:44:29.996577', '14204', '2'), - ('5.99', '135', '2007-03-02T10:04:19.996577', '11194', '2'), - ('5.99', '135', '2007-03-21T00:25:52.996577', '14136', '2'), - ('2.99', '135', '2007-03-23T16:10:26.996577', '15908', '2'), - ('0.99', '135', '2007-03-19T07:15:11.996577', '13035', '1'), - ('7.99', '135', '2007-04-29T23:04:52.996577', '8885', '2'), - ('3.99', '135', '2007-04-12T16:48:23.996577', '6817', '1'), - ('3.99', '135', '2007-04-11T23:42:29.996577', '6461', '1'), - ('0.99', '135', '2007-05-14T13:44:29.996577', '13390', '1'), - ('0.99', '135', '2007-02-15T06:11:24.996577', '1272', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['23946', '23947', '25083', '31832', '25084', '31829', '25081', '25078', '31828', '25071', '19476', '31831', '25075', '31826', '25072', '25082', '25085', '25073', '31824', '25076', '31827', '25077', '31830', '24631', '31267', '31262', '31271', '31270', '24632', '31268', '24628', '19291', '31273', '24627', '31269', '31264', '31430', '31424', '24769', '24761', '31432', '19344', '24768', '24765', '31429', '19343', '31431', '25962', '25961', '25957', '20146', '20149', '25952', '25958', '20147', '20152', '21156', '27127', '27124', '27126', '27121', '21154', '21158', '27128', '27130', '31963', '19536', '19538', '25175', '19530', '19532', '25166', '25174', '25169', '19533', '25165', '22224', '22223', '22218', '18299', '22227', '22225', '28378', '22222', '18300', '22220', '22229', '20802', '26704', '26714', '20793', '20796', '17746', '17747', '17749', '20798', '26710', '17750', '17751', '18769']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('7.99', '135', '2007-03-17T05:49:48.996577', '11704', '1'), - ('2.99', '135', '2007-03-18T02:22:00.996577', '12249', '1'), - ('10.99', '259', '2007-03-22T22:34:23.996577', '15425', '1'), - ('6.99', '259', '2007-04-30T13:45:57.996577', '9282', '1'), - ('2.99', '259', '2007-03-23T00:07:36.996577', '15473', '1'), - ('7.99', '259', '2007-04-28T05:31:51.996577', '7774', '2'), - ('4.99', '259', '2007-03-21T01:29:05.996577', '14170', '2'), - ('5.99', '259', '2007-03-20T04:27:43.996577', '13598', '1'), - ('2.99', '259', '2007-04-27T07:00:34.996577', '7188', '2'), - ('3.99', '259', '2007-03-01T09:56:56.996577', '10510', '1'), - ('2.99', '259', '2007-02-16T19:39:26.996577', '1813', '2'), - ('6.99', '259', '2007-04-30T11:15:06.996577', '9205', '2'), - ('4.99', '259', '2007-03-19T09:51:46.996577', '13109', '1'), - ('0.99', '259', '2007-04-11T03:28:22.996577', '6074', '1'), - ('2.99', '259', '2007-03-01T19:51:07.996577', '10781', '1'), - ('2.99', '259', '2007-03-22T05:14:23.996577', '14966', '2'), - ('2.99', '259', '2007-03-23T08:21:21.996577', '15689', '1'), - ('3.99', '259', '2007-03-02T09:29:52.996577', '11184', '1'), - ('5.99', '259', '2007-04-07T09:41:33.996577', '4199', '2'), - ('2.99', '259', '2007-03-19T09:55:36.996577', '13112', '2'), - ('3.99', '259', '2007-04-12T03:19:15.996577', '6539', '2'), - ('4.99', '259', '2007-03-19T19:43:11.996577', '13366', '2'), - ('4.99', '259', '2007-04-28T06:49:21.996577', '7817', '1'), - ('6.99', '209', '2007-03-21T17:16:15.996577', '14631', '2'), - ('6.99', '209', '2007-04-27T04:15:09.996577', '7116', '1'), - ('4.99', '209', '2007-04-08T15:32:32.996577', '4810', '2'), - ('4.99', '209', '2007-04-28T15:48:43.996577', '8067', '1'), - ('5.99', '209', '2007-04-28T04:29:26.996577', '7752', '2'), - ('2.99', '209', '2007-03-22T16:41:33.996577', '15254', '1'), - ('3.99', '209', '2007-04-27T09:52:13.996577', '7269', '1'), - ('6.99', '209', '2007-03-01T21:09:41.996577', '10811', '2'), - ('4.99', '209', '2007-02-19T08:50:11.996577', '2650', '1'), - ('2.99', '209', '2007-04-29T20:21:26.996577', '8816', '2'), - ('4.99', '209', '2007-03-01T14:26:21.996577', '10646', '1'), - ('4.99', '209', '2007-04-27T18:56:29.996577', '7505', '1'), - ('3.99', '209', '2007-04-09T07:52:45.996577', '5170', '2'), - ('2.99', '224', '2007-04-29T05:57:09.996577', '8439', '2'), - ('2.99', '224', '2007-04-07T05:31:56.996577', '4118', '1'), - ('1.99', '224', '2007-03-23T17:39:55.996577', '15952', '1'), - ('4.99', '224', '2007-03-18T11:17:30.996577', '12492', '1'), - ('0.99', '224', '2007-04-30T10:34:24.996577', '9181', '1'), - ('4.99', '224', '2007-02-21T04:47:08.996577', '3282', '2'), - ('0.99', '224', '2007-03-22T15:46:58.996577', '15225', '1'), - ('5.99', '224', '2007-03-21T04:51:55.996577', '14271', '2'), - ('0.99', '224', '2007-04-28T23:30:56.996577', '8255', '2'), - ('2.99', '224', '2007-02-18T05:03:29.996577', '2277', '1'), - ('4.99', '224', '2007-04-29T11:42:00.996577', '8605', '1'), - ('0.99', '336', '2007-04-30T17:44:24.996577', '10055', '1'), - ('0.99', '336', '2007-04-30T15:15:43.996577', '9306', '2'), - ('4.99', '336', '2007-04-29T00:04:13.996577', '8275', '2'), - ('8.99', '336', '2007-03-18T05:04:48.996577', '12323', '1'), - ('0.99', '336', '2007-03-19T08:19:05.996577', '13066', '2'), - ('2.99', '336', '2007-04-08T05:08:51.996577', '4595', '1'), - ('6.99', '336', '2007-04-29T05:05:28.996577', '8407', '1'), - ('0.99', '336', '2007-03-18T22:49:03.996577', '12794', '2'), - ('10.99', '336', '2007-03-22T09:29:41.996577', '15073', '1'), - ('0.99', '440', '2007-03-21T14:31:28.996577', '14555', '1'), - ('0.99', '440', '2007-04-27T22:43:04.996577', '7614', '1'), - ('2.99', '440', '2007-04-10T10:00:18.996577', '5731', '2'), - ('4.99', '440', '2007-04-27T21:46:48.996577', '7585', '2'), - ('7.99', '440', '2007-04-08T21:14:49.996577', '4946', '1'), - ('4.99', '440', '2007-03-19T20:07:17.996577', '13384', '2'), - ('0.99', '440', '2007-03-22T16:56:04.996577', '15264', '2'), - ('9.99', '440', '2007-04-28T06:26:43.996577', '7806', '1'), - ('2.99', '440', '2007-04-30T10:58:09.996577', '9195', '1'), - ('4.99', '440', '2007-05-14T13:44:29.996577', '13106', '1'), - ('4.99', '268', '2007-03-21T08:13:19.996577', '14373', '2'), - ('2.99', '268', '2007-03-22T14:18:20.996577', '15183', '2'), - ('3.99', '268', '2007-04-30T23:40:19.996577', '9531', '2'), - ('7.99', '268', '2007-03-02T20:05:12.996577', '11462', '2'), - ('2.99', '268', '2007-03-17T17:39:00.996577', '12007', '2'), - ('4.99', '268', '2007-04-08T06:46:47.996577', '4626', '2'), - ('7.99', '268', '2007-04-30T20:01:27.996577', '9436', '2'), - ('2.99', '268', '2007-04-10T13:01:26.996577', '5793', '2'), - ('4.99', '268', '2007-03-18T18:39:05.996577', '12694', '2'), - ('4.99', '268', '2007-04-06T07:25:09.996577', '3670', '2'), - ('4.99', '554', '2007-03-19T11:00:36.996577', '13139', '2'), - ('0.99', '554', '2007-03-17T17:58:10.996577', '12014', '1'), - ('6.99', '554', '2007-03-01T13:23:57.996577', '10612', '1'), - ('6.99', '554', '2007-02-18T05:06:48.996577', '2279', '1'), - ('0.99', '554', '2007-03-21T11:35:50.996577', '14469', '1'), - ('2.99', '554', '2007-03-20T19:16:09.996577', '14015', '2'), - ('5.99', '554', '2007-04-10T22:31:37.996577', '5968', '1'), - ('8.99', '554', '2007-03-17T17:46:20.996577', '12010', '1'), - ('2.99', '554', '2007-02-21T04:09:56.996577', '3278', '2'), - ('9.99', '554', '2007-03-17T00:56:48.996577', '11589', '2'), - ('4.99', '554', '2007-03-23T08:21:56.996577', '15690', '2'), - ('5.99', '403', '2007-03-18T22:49:02.996577', '12793', '1'), - ('3.99', '403', '2007-04-06T10:14:19.996577', '3737', '2'), - ('5.99', '403', '2007-04-30T19:33:15.996577', '10109', '2'), - ('6.99', '403', '2007-03-01T11:12:43.996577', '10547', '1'), - ('9.99', '403', '2007-03-02T17:08:38.996577', '11391', '2'), - ('4.99', '403', '2007-02-15T02:03:42.996577', '1221', '2'), - ('8.99', '403', '2007-02-15T04:06:35.996577', '1249', '1'), - ('4.99', '403', '2007-02-20T03:10:07.996577', '2927', '1'), - ('0.99', '403', '2007-03-02T19:56:29.996577', '11460', '2'), - ('5.99', '403', '2007-04-28T13:58:52.996577', '8013', '2'), - ('6.99', '403', '2007-02-20T11:19:27.996577', '3049', '2'), - ('5.99', '403', '2007-02-21T10:07:11.996577', '3356', '1'), - ('2.99', '68', '2007-02-19T07:21:36.996577', '2633', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['23333', '29743', '29749', '23332', '18770', '23335', '29741', '29748', '29742', '18771', '30884', '24284', '30892', '30889', '30896', '24282', '30890', '30895', '24285', '19143', '30882', '24770', '31446', '31443', '31445', '31442', '31439', '31444', '31440', '24772', '31435', '18544', '29118', '29125', '29128', '22790', '22791', '22789', '29120', '29116', '18542', '29117', '30050', '23593', '30051', '30054', '30058', '18873', '30057', '31167', '31170', '31166', '24528', '24529', '24527', '19245', '24522', '24524', '31168', '24520', '31164', '26177', '26182', '26187', '26178', '26189', '20340', '17563', '20343', '20349', '26181', '17562', '27198', '27201', '17898', '21215', '27194', '27193', '27195', '17900', '27197', '21218', '21216', '17897', '27196', '27204', '27199', '23767', '23768', '18958', '23764', '30318', '23765', '30316', '23763', '23761', '23766', '23760', '18959', '30317']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('2.99', '68', '2007-03-18T20:50:29.996577', '12742', '2'), - ('6.99', '68', '2007-04-08T03:17:02.996577', '4555', '2'), - ('7.99', '68', '2007-04-30T19:42:13.996577', '10115', '1'), - ('2.99', '68', '2007-03-02T12:57:16.996577', '11277', '1'), - ('4.99', '68', '2007-02-19T09:22:08.996577', '2662', '2'), - ('0.99', '68', '2007-03-21T03:54:25.996577', '14242', '2'), - ('4.99', '68', '2007-04-06T13:34:16.996577', '3801', '2'), - ('4.99', '68', '2007-04-30T04:02:23.996577', '9642', '2'), - ('0.99', '68', '2007-04-06T16:10:08.996577', '3864', '1'), - ('2.99', '68', '2007-02-19T11:12:46.996577', '2686', '1'), - ('0.99', '167', '2007-04-09T06:03:29.996577', '5131', '2'), - ('3.99', '167', '2007-03-22T06:39:50.996577', '15003', '1'), - ('4.99', '167', '2007-04-28T22:30:48.996577', '8227', '2'), - ('4.99', '167', '2007-04-11T14:27:09.996577', '6269', '2'), - ('4.99', '167', '2007-04-30T00:57:05.996577', '9563', '2'), - ('6.99', '167', '2007-03-20T12:11:48.996577', '13825', '1'), - ('4.99', '167', '2007-04-27T22:37:02.996577', '7608', '1'), - ('0.99', '167', '2007-04-29T22:20:38.996577', '8864', '2'), - ('0.99', '167', '2007-03-22T08:36:18.996577', '15050', '1'), - ('5.99', '167', '2007-02-18T13:28:56.996577', '2381', '2'), - ('4.99', '167', '2007-04-05T23:24:29.996577', '3518', '2'), - ('2.99', '225', '2007-03-01T20:16:29.996577', '10793', '1'), - ('4.99', '225', '2007-04-28T17:36:11.996577', '8110', '2'), - ('4.99', '225', '2007-04-27T12:59:50.996577', '7347', '2'), - ('7.99', '225', '2007-04-28T15:30:44.996577', '8054', '1'), - ('2.99', '225', '2007-04-12T03:06:58.996577', '6532', '2'), - ('2.99', '225', '2007-04-11T17:16:07.996577', '6317', '1'), - ('6.99', '225', '2007-04-27T19:40:10.996577', '7524', '1'), - ('2.99', '225', '2007-04-11T18:58:41.996577', '6350', '2'), - ('0.99', '225', '2007-03-02T16:51:27.996577', '11384', '2'), - ('7.99', '225', '2007-04-08T16:06:05.996577', '4824', '1'), - ('2.99', '12', '2007-02-20T18:02:18.996577', '3135', '2'), - ('0.99', '12', '2007-04-09T03:34:50.996577', '5074', '1'), - ('4.99', '12', '2007-04-30T09:54:54.996577', '9166', '2'), - ('5.99', '12', '2007-04-30T06:13:59.996577', '9708', '2'), - ('0.99', '12', '2007-03-16T21:20:56.996577', '11497', '2'), - ('4.99', '12', '2007-03-18T15:27:14.996577', '12604', '1'), - ('10.99', '12', '2007-03-01T05:18:52.996577', '10392', '2'), - ('3.99', '12', '2007-04-09T11:48:51.996577', '5242', '2'), - ('3.99', '12', '2007-04-06T16:26:20.996577', '3870', '1'), - ('5.99', '12', '2007-02-18T21:35:38.996577', '2500', '2'), - ('0.99', '12', '2007-04-09T03:29:05.996577', '5071', '1'), - ('1.99', '95', '2007-04-06T05:11:52.996577', '3633', '1'), - ('7.99', '95', '2007-03-20T01:01:11.996577', '13516', '2'), - ('4.99', '95', '2007-04-06T22:27:03.996577', '4000', '2'), - ('4.99', '95', '2007-04-27T17:30:45.996577', '7471', '1'), - ('0.99', '95', '2007-04-30T20:12:56.996577', '10130', '1'), - ('0.99', '95', '2007-02-21T16:40:36.996577', '3426', '2'), - ('4.99', '95', '2007-04-30T14:19:42.996577', '9951', '1'), - ('0.99', '192', '2007-04-28T15:24:42.996577', '8051', '2'), - ('2.99', '192', '2007-04-30T10:27:58.996577', '9831', '1'), - ('2.99', '192', '2007-04-27T05:31:00.996577', '7147', '2'), - ('6.99', '192', '2007-03-21T19:11:47.996577', '14692', '2'), - ('2.99', '192', '2007-03-23T14:27:27.996577', '15855', '2'), - ('4.99', '192', '2007-03-21T09:11:30.996577', '14404', '1'), - ('3.99', '192', '2007-02-19T15:44:59.996577', '2760', '1'), - ('4.99', '192', '2007-03-02T16:51:37.996577', '11385', '1'), - ('5.99', '192', '2007-03-19T10:26:15.996577', '13125', '1'), - ('7.99', '192', '2007-04-29T00:58:02.996577', '8292', '2'), - ('0.99', '192', '2007-03-01T00:36:31.996577', '10238', '2'), - ('0.99', '192', '2007-04-11T11:55:35.996577', '6223', '2'), - ('6.99', '356', '2007-04-06T14:28:06.996577', '3829', '2'), - ('2.99', '356', '2007-04-27T02:50:24.996577', '7079', '1'), - ('4.99', '356', '2007-04-30T04:51:40.996577', '9037', '2'), - ('4.99', '356', '2007-04-08T05:16:52.996577', '4599', '2'), - ('6.99', '356', '2007-04-30T12:22:03.996577', '9883', '2'), - ('2.99', '356', '2007-03-17T00:26:15.996577', '11579', '2'), - ('2.99', '356', '2007-02-18T15:05:04.996577', '2405', '1'), - ('0.99', '356', '2007-03-19T02:54:05.996577', '12913', '1'), - ('2.99', '356', '2007-03-23T11:15:42.996577', '15757', '1'), - ('0.99', '356', '2007-04-12T09:14:56.996577', '6648', '1'), - ('0.99', '356', '2007-02-15T15:28:12.996577', '1410', '1'), - ('0.99', '446', '2007-04-12T03:12:09.996577', '6535', '1'), - ('0.99', '446', '2007-04-27T03:12:08.996577', '7089', '2'), - ('0.99', '446', '2007-02-19T12:32:22.996577', '2710', '2'), - ('0.99', '446', '2007-03-18T02:29:16.996577', '12253', '2'), - ('4.99', '446', '2007-04-09T18:03:38.996577', '5393', '2'), - ('4.99', '446', '2007-04-07T17:55:30.996577', '4358', '2'), - ('2.99', '446', '2007-04-09T18:45:45.996577', '5409', '2'), - ('0.99', '446', '2007-02-20T20:14:27.996577', '3168', '2'), - ('4.99', '446', '2007-04-12T02:04:05.996577', '6510', '1'), - ('0.99', '446', '2007-03-23T17:38:58.996577', '15951', '2'), - ('8.99', '446', '2007-03-18T10:55:09.996577', '12480', '2'), - ('6.99', '446', '2007-02-18T22:57:26.996577', '2520', '2'), - ('0.99', '446', '2007-04-11T23:28:38.996577', '6454', '2'), - ('4.99', '446', '2007-04-29T01:50:46.996577', '8309', '1'), - ('6.99', '446', '2007-04-12T12:32:50.996577', '6734', '1'), - ('2.99', '117', '2007-03-22T00:55:13.996577', '14854', '2'), - ('2.99', '117', '2007-03-22T22:55:18.996577', '15432', '1'), - ('2.99', '117', '2007-02-16T15:47:10.996577', '1755', '1'), - ('6.99', '117', '2007-03-18T14:06:08.996577', '12575', '1'), - ('2.99', '117', '2007-04-29T14:47:43.996577', '8687', '1'), - ('4.99', '117', '2007-03-18T15:52:28.996577', '12618', '1'), - ('9.99', '117', '2007-04-11T04:21:16.996577', '6093', '1'), - ('2.99', '117', '2007-03-18T05:30:50.996577', '12337', '1'), - ('3.99', '117', '2007-03-02T20:15:33.996577', '11467', '2'), - ('0.99', '117', '2007-03-21T22:51:39.996577', '14784', '1'), - ('4.99', '117', '2007-03-01T11:28:46.996577', '10558', '1'), - ('2.99', '117', '2007-02-21T00:06:35.996577', '3218', '2'), - ('6.99', '117', '2007-04-11T23:17:24.996577', '6449', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['22816', '18551', '22830', '22832', '29160', '29161', '29157', '22825', '18552', '29156', '22820', '22826', '22823', '26917', '26907', '26919', '26913', '20995', '26915', '31958', '26908', '20994', '20990', '20988', '18637', '29340', '18639', '29339', '29351', '18638', '29345', '29349', '29352', '29348', '22996', '29341', '22994', '19847', '19852', '19844', '25552', '19849', '31929', '25551', '19850', '25544', '19845', '25541', '25548', '25550', '19851', '25547', '25539', '21997', '21995', '28117', '21998', '28126', '18221', '28120', '21993', '21992', '28129', '28121', '22001', '28125', '21994', '18222', '28128', '30935', '24314', '24312', '30926', '30930', '24310', '30928', '24316', '24318', '30933', '30925', '18625', '29331', '22989', '29327', '22991', '29329', '18626', '18630', '18631', '22992', '29332', '18635', '29337', '18633', '18236', '22045', '22051', '31990', '22046', '28183']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('2.99', '15', '2007-03-02T07:57:37.996577', '11141', '1'), - ('2.99', '15', '2007-02-18T19:55:22.996577', '2486', '1'), - ('8.99', '15', '2007-03-22T01:52:07.996577', '14872', '2'), - ('4.99', '15', '2007-03-23T15:40:57.996577', '15897', '1'), - ('6.99', '15', '2007-04-29T12:04:27.996577', '8615', '2'), - ('4.99', '15', '2007-04-30T00:41:57.996577', '8927', '2'), - ('2.99', '15', '2007-04-10T22:42:45.996577', '5975', '2'), - ('5.99', '15', '2007-03-20T00:28:59.996577', '13503', '2'), - ('5.99', '15', '2007-02-20T03:44:03.996577', '2937', '1'), - ('2.99', '15', '2007-04-10T09:30:29.996577', '5717', '1'), - ('2.99', '15', '2007-03-18T03:07:36.996577', '12272', '2'), - ('4.99', '15', '2007-03-20T02:10:07.996577', '13541', '1'), - ('8.99', '15', '2007-03-19T18:47:02.996577', '13339', '2'), - ('4.99', '421', '2007-04-30T17:40:44.996577', '9377', '2'), - ('7.99', '421', '2007-04-05T22:09:34.996577', '3491', '1'), - ('4.99', '421', '2007-04-30T23:07:31.996577', '10200', '1'), - ('4.99', '421', '2007-04-27T16:46:07.996577', '7449', '2'), - ('3.99', '421', '2007-03-22T02:32:57.996577', '14887', '1'), - ('4.99', '421', '2007-04-28T23:51:49.996577', '8268', '1'), - ('0.99', '421', '2007-05-14T13:44:29.996577', '15710', '2'), - ('5.99', '421', '2007-04-06T08:43:52.996577', '3703', '2'), - ('4.99', '421', '2007-03-21T21:07:27.996577', '14742', '1'), - ('3.99', '421', '2007-03-16T22:38:36.996577', '11523', '1'), - ('2.99', '421', '2007-03-02T06:20:46.996577', '11089', '2'), - ('0.99', '32', '2007-02-17T22:07:37.996577', '2160', '2'), - ('2.99', '32', '2007-04-08T14:01:58.996577', '4771', '2'), - ('1.99', '32', '2007-02-20T00:30:31.996577', '2891', '2'), - ('2.99', '32', '2007-04-07T21:17:00.996577', '4434', '1'), - ('2.99', '32', '2007-04-29T06:14:55.996577', '8453', '2'), - ('5.99', '32', '2007-02-19T06:50:35.996577', '2624', '2'), - ('3.99', '32', '2007-04-11T06:26:33.996577', '6122', '1'), - ('2.99', '32', '2007-04-28T05:54:40.996577', '7793', '1'), - ('2.99', '32', '2007-04-30T00:10:29.996577', '8914', '2'), - ('5.99', '32', '2007-04-27T21:52:02.996577', '7589', '1'), - ('8.99', '32', '2007-03-20T08:59:49.996577', '13736', '1'), - ('0.99', '32', '2007-04-08T19:05:37.996577', '4899', '2'), - ('4.99', '32', '2007-03-17T11:23:13.996577', '11831', '2'), - ('6.99', '300', '2007-03-20T00:20:56.996577', '13499', '2'), - ('5.99', '300', '2007-03-23T13:12:12.996577', '15811', '2'), - ('5.99', '300', '2007-03-18T16:50:53.996577', '12644', '2'), - ('0.99', '300', '2007-04-30T09:03:48.996577', '9791', '2'), - ('7.99', '300', '2007-03-21T18:30:00.996577', '14674', '1'), - ('4.99', '300', '2007-05-14T13:44:29.996577', '15695', '1'), - ('2.99', '300', '2007-04-30T08:15:02.996577', '9127', '2'), - ('9.99', '300', '2007-03-21T19:36:25.996577', '14709', '1'), - ('5.99', '300', '2007-04-12T16:52:05.996577', '6822', '1'), - ('3.99', '300', '2007-03-19T15:29:46.996577', '13257', '2'), - ('2.99', '300', '2007-04-10T01:46:08.996577', '5562', '2'), - ('6.99', '300', '2007-04-28T21:59:31.996577', '8210', '1'), - ('0.99', '300', '2007-04-30T06:29:26.996577', '9078', '1'), - ('2.99', '300', '2007-03-22T08:37:16.996577', '15051', '2'), - ('6.99', '300', '2007-04-28T17:48:42.996577', '8117', '1'), - ('0.99', '300', '2007-04-06T11:55:59.996577', '3775', '1'), - ('2.99', '529', '2007-03-20T11:02:02.996577', '13797', '1'), - ('4.99', '529', '2007-03-19T06:22:24.996577', '13011', '1'), - ('0.99', '529', '2007-04-07T01:54:40.996577', '4045', '2'), - ('9.99', '529', '2007-03-20T16:12:58.996577', '13946', '2'), - ('2.99', '529', '2007-04-29T15:52:39.996577', '8708', '2'), - ('1.99', '529', '2007-02-15T02:50:18.996577', '1234', '1'), - ('0.99', '529', '2007-04-08T03:12:07.996577', '4553', '1'), - ('2.99', '529', '2007-03-18T06:05:31.996577', '12356', '2'), - ('2.99', '529', '2007-03-17T12:23:19.996577', '11862', '1'), - ('0.99', '529', '2007-04-30T17:38:43.996577', '9375', '2'), - ('4.99', '529', '2007-04-10T23:35:07.996577', '5993', '1'), - ('5.99', '529', '2007-03-22T05:17:55.996577', '14970', '1'), - ('3.99', '529', '2007-04-27T04:43:02.996577', '7128', '1'), - ('3.99', '529', '2007-03-18T16:02:37.996577', '12622', '1'), - ('0.99', '529', '2007-02-16T10:36:46.996577', '1686', '2'), - ('4.99', '529', '2007-04-30T15:25:35.996577', '9310', '2'), - ('9.99', '170', '2007-04-30T19:17:36.996577', '10102', '1'), - ('0.99', '170', '2007-03-19T08:47:32.996577', '13081', '1'), - ('3.99', '170', '2007-03-18T19:13:00.996577', '12706', '2'), - ('4.99', '170', '2007-04-07T05:18:18.996577', '4113', '2'), - ('7.99', '170', '2007-04-10T07:30:04.996577', '5685', '2'), - ('5.99', '170', '2007-03-01T08:45:52.996577', '10481', '2'), - ('0.99', '170', '2007-04-09T03:40:33.996577', '5075', '2'), - ('8.99', '170', '2007-03-20T19:37:15.996577', '14022', '2'), - ('7.99', '170', '2007-03-23T02:55:32.996577', '15549', '1'), - ('2.99', '170', '2007-04-30T23:09:49.996577', '9517', '2'), - ('4.99', '170', '2007-04-06T10:46:29.996577', '3749', '1'), - ('4.99', '31', '2007-02-16T08:34:06.996577', '1656', '2'), - ('3.99', '31', '2007-04-11T11:03:22.996577', '6208', '1'), - ('4.99', '31', '2007-03-17T20:45:35.996577', '12085', '2'), - ('4.99', '31', '2007-04-06T08:41:11.996577', '3701', '1'), - ('6.99', '31', '2007-03-23T08:06:00.996577', '15682', '2'), - ('6.99', '31', '2007-04-07T05:44:01.996577', '4122', '1'), - ('1.99', '31', '2007-02-16T21:48:42.996577', '1838', '1'), - ('0.99', '31', '2007-02-18T17:02:47.996577', '2438', '2'), - ('0.99', '31', '2007-02-18T23:48:26.996577', '2530', '1'), - ('6.99', '31', '2007-03-23T13:26:32.996577', '15816', '2'), - ('4.99', '31', '2007-04-12T04:54:36.996577', '6580', '2'), - ('0.99', '31', '2007-02-20T23:07:13.996577', '3205', '1'), - ('0.99', '31', '2007-04-30T03:22:22.996577', '8997', '2'), - ('2.99', '31', '2007-02-20T16:33:41.996577', '3117', '2'), - ('4.99', '534', '2007-02-16T05:04:59.996577', '1610', '1'), - ('0.99', '534', '2007-03-01T20:25:07.996577', '10796', '1'), - ('1.99', '534', '2007-03-21T23:44:17.996577', '14816', '2'), - ('2.99', '534', '2007-05-14T13:44:29.996577', '14526', '1'), - ('5.99', '534', '2007-03-02T09:22:56.996577', '11180', '2'), - ('2.99', '534', '2007-04-27T04:09:46.996577', '7113', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['18237', '28184', '22050', '26830', '20904', '26829', '20906', '26834', '30384', '23832', '23826', '30381', '30382', '30383', '30379', '23829', '23831', '23825', '31607', '31605', '19398', '24882', '24881', '31610', '24880', '24878', '31613', '25195', '25196', '25197', '25198', '19564', '25194', '19601', '25228', '31921', '19594', '25232', '19602', '19595', '25225', '19591', '19590', '19592', '19589', '25230', '29646', '29651', '29649', '23254', '29650', '18741', '23257', '29654', '29652', '23251', '23252', '23250', '18740', '29647', '22626', '28914', '22625', '28913', '28911', '28917', '22628', '23435', '23436', '29854', '29864', '29866', '29858', '29862', '23428', '23433', '23429', '23432', '29863', '24146', '24143', '32058', '30722', '24148', '30721', '24152', '24149', '19092', '30724', '21747', '27816', '27823', '21748', '21752', '21746', '27822', '18122', '27815', '18121', '21745']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('2.99', '534', '2007-02-16T09:08:43.996577', '1673', '1'), - ('2.99', '534', '2007-04-28T00:44:34.996577', '7662', '1'), - ('0.99', '534', '2007-03-19T17:05:01.996577', '13294', '2'), - ('0.99', '413', '2007-04-07T23:59:12.996577', '4491', '2'), - ('3.99', '413', '2007-03-19T06:20:47.996577', '13010', '1'), - ('4.99', '413', '2007-04-06T11:21:15.996577', '3762', '1'), - ('4.99', '413', '2007-03-20T12:11:38.996577', '13824', '2'), - ('0.99', '413', '2007-04-28T03:29:44.996577', '7731', '2'), - ('4.99', '123', '2007-04-29T15:21:26.996577', '8699', '2'), - ('2.99', '123', '2007-03-23T12:20:23.996577', '15787', '2'), - ('2.99', '123', '2007-03-18T06:15:01.996577', '12360', '1'), - ('0.99', '123', '2007-04-28T05:12:29.996577', '7768', '2'), - ('2.99', '123', '2007-04-28T08:02:55.996577', '7852', '1'), - ('5.99', '123', '2007-04-28T12:26:03.996577', '7969', '1'), - ('4.99', '123', '2007-04-27T20:01:05.996577', '7535', '2'), - ('7.99', '123', '2007-03-22T12:53:47.996577', '15152', '2'), - ('1.99', '123', '2007-03-23T05:42:09.996577', '15621', '1'), - ('8.99', '123', '2007-03-01T02:22:15.996577', '10295', '2'), - ('0.99', '238', '2007-04-11T21:14:51.996577', '6403', '2'), - ('0.99', '238', '2007-04-07T06:50:33.996577', '4143', '1'), - ('2.99', '238', '2007-02-20T21:19:28.996577', '3181', '1'), - ('0.99', '238', '2007-03-22T23:33:26.996577', '15455', '1'), - ('8.99', '238', '2007-03-21T07:08:47.996577', '14343', '1'), - ('6.99', '238', '2007-04-29T04:01:47.996577', '8382', '1'), - ('4.99', '238', '2007-03-21T06:17:00.996577', '14312', '1'), - ('2.99', '238', '2007-03-17T02:57:58.996577', '11632', '2'), - ('7.99', '238', '2007-04-30T10:52:45.996577', '9841', '2'), - ('1.99', '271', '2007-04-10T17:38:23.996577', '5878', '2'), - ('2.99', '271', '2007-04-10T20:05:19.996577', '5922', '1'), - ('2.99', '271', '2007-04-11T00:45:13.996577', '6024', '1'), - ('3.99', '271', '2007-04-27T22:52:40.996577', '7618', '1'), - ('4.99', '271', '2007-03-18T01:18:20.996577', '12219', '1'), - ('2.99', '271', '2007-04-08T02:46:13.996577', '4545', '2'), - ('2.99', '274', '2007-03-22T16:52:42.996577', '15260', '1'), - ('5.99', '274', '2007-04-29T05:03:11.996577', '8406', '2'), - ('0.99', '274', '2007-05-14T13:44:29.996577', '13486', '1'), - ('8.99', '274', '2007-03-19T10:33:30.996577', '13129', '2'), - ('4.99', '274', '2007-04-30T17:49:15.996577', '10059', '2'), - ('2.99', '274', '2007-03-22T19:00:04.996577', '15328', '2'), - ('8.99', '274', '2007-03-20T02:27:07.996577', '13549', '1'), - ('2.99', '274', '2007-04-08T04:37:35.996577', '4582', '2'), - ('2.99', '274', '2007-03-02T16:17:05.996577', '11363', '2'), - ('3.99', '274', '2007-03-02T05:07:10.996577', '11058', '1'), - ('3.99', '274', '2007-03-18T04:55:31.996577', '12321', '1'), - ('0.99', '274', '2007-03-01T22:35:03.996577', '10855', '2'), - ('4.99', '274', '2007-04-30T16:15:16.996577', '9331', '1'), - ('2.99', '59', '2007-04-07T07:05:24.996577', '4148', '2'), - ('3.99', '59', '2007-04-09T09:44:10.996577', '5207', '1'), - ('3.99', '59', '2007-04-08T18:34:45.996577', '4891', '1'), - ('5.99', '59', '2007-03-21T00:22:20.996577', '14135', '1'), - ('8.99', '59', '2007-04-09T09:07:57.996577', '5195', '2'), - ('3.99', '59', '2007-02-20T02:41:30.996577', '2921', '1'), - ('4.99', '59', '2007-03-23T10:44:17.996577', '15744', '2'), - ('4.99', '59', '2007-04-29T13:13:49.996577', '8643', '2'), - ('4.99', '59', '2007-04-10T15:02:26.996577', '5830', '1'), - ('2.99', '59', '2007-03-19T16:36:44.996577', '13282', '2'), - ('2.99', '59', '2007-03-20T03:38:40.996577', '13573', '1'), - ('5.99', '59', '2007-03-19T00:10:54.996577', '12833', '1'), - ('3.99', '59', '2007-02-16T13:57:55.996577', '1728', '1'), - ('4.99', '59', '2007-04-07T19:15:11.996577', '4384', '1'), - ('8.99', '202', '2007-03-18T22:55:45.996577', '12801', '2'), - ('2.99', '202', '2007-04-10T15:33:22.996577', '5838', '2'), - ('4.99', '202', '2007-03-17T14:50:31.996577', '11924', '2'), - ('2.99', '202', '2007-04-09T14:00:55.996577', '5297', '1'), - ('4.99', '202', '2007-04-08T03:48:30.996577', '4567', '2'), - ('2.99', '202', '2007-04-29T18:43:26.996577', '8779', '1'), - ('3.99', '202', '2007-03-20T01:31:57.996577', '13528', '1'), - ('0.99', '78', '2007-03-19T21:57:32.996577', '13432', '1'), - ('5.99', '78', '2007-03-20T10:50:03.996577', '13792', '2'), - ('5.99', '78', '2007-04-07T11:10:02.996577', '4227', '2'), - ('6.99', '78', '2007-04-28T12:02:34.996577', '7957', '1'), - ('5.99', '78', '2007-04-30T06:00:11.996577', '9068', '1'), - ('0.99', '78', '2007-04-10T03:33:26.996577', '5604', '2'), - ('4.99', '78', '2007-04-28T04:18:37.996577', '7747', '2'), - ('3.99', '78', '2007-03-01T03:58:31.996577', '10350', '2'), - ('4.99', '78', '2007-03-18T17:21:43.996577', '12653', '2'), - ('2.99', '78', '2007-03-01T12:40:19.996577', '10590', '1'), - ('8.99', '78', '2007-03-18T10:38:29.996577', '12474', '2'), - ('3.99', '78', '2007-04-28T10:41:28.996577', '7926', '2'), - ('2.99', '152', '2007-03-18T18:43:22.996577', '12697', '1'), - ('6.99', '152', '2007-03-01T03:07:52.996577', '10320', '1'), - ('4.99', '152', '2007-05-14T13:44:29.996577', '11848', '2'), - ('4.99', '152', '2007-04-08T22:29:02.996577', '4974', '1'), - ('1.99', '152', '2007-03-19T04:50:18.996577', '12960', '2'), - ('7.99', '152', '2007-04-06T12:29:07.996577', '3786', '1'), - ('0.99', '152', '2007-03-21T01:29:27.996577', '14173', '1'), - ('4.99', '152', '2007-03-19T13:31:14.996577', '13204', '1'), - ('4.99', '152', '2007-02-19T23:54:52.996577', '2882', '1'), - ('2.99', '152', '2007-04-12T06:56:59.996577', '6612', '1'), - ('0.99', '502', '2007-03-17T02:34:48.996577', '11620', '1'), - ('7.99', '502', '2007-04-11T21:54:39.996577', '6414', '2'), - ('4.99', '502', '2007-04-28T09:05:50.996577', '7884', '1'), - ('4.99', '502', '2007-03-18T21:35:20.996577', '12762', '1'), - ('3.99', '502', '2007-03-23T20:35:00.996577', '16034', '1'), - ('0.99', '502', '2007-03-02T18:42:49.996577', '11435', '1'), - ('4.99', '502', '2007-04-28T04:51:26.996577', '7757', '1'), - ('0.99', '502', '2007-02-20T02:01:03.996577', '2911', '1'), - ('2.99', '502', '2007-04-10T06:27:50.996577', '5662', '2'), - ('0.99', '502', '2007-02-18T15:50:54.996577', '2420', '2'), - ('4.99', '502', '2007-03-02T14:37:18.996577', '11317', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['27818', '21742', '27700', '27703', '18085', '27699', '27702', '27701', '27705', '21661', '21660', '18087', '21662', '18086', '23807', '23805', '23812', '23814', '30355', '23813', '30356', '30361', '30357', '23808', '18972', '30358', '23806', '24712', '31351', '31355', '24707', '24705', '31352', '31354', '31358', '19325', '31356', '20972', '20974', '20977', '26887', '26890', '20979', '26888', '26885', '20975', '26892', '20476', '26353', '20478', '20475', '26352', '20472', '20471', '26356', '26354', '20477', '19799', '25499', '19800', '25497', '19807', '25500', '25501', '25492', '19806', '25496', '19805', '25502', '27883', '27881', '27888', '27884', '27885', '27892', '21809', '21808', '21807', '27893', '20575', '20572', '17650', '26453', '20569', '26457', '26454', '20566', '20570', '26452', '21812', '27900', '21816', '18142', '25726', '19988', '25729', '25731', '25728', '19989', '25723']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('2.99', '502', '2007-04-12T17:07:17.996577', '6828', '2'), - ('0.99', '502', '2007-03-02T01:33:48.996577', '10938', '1'), - ('2.99', '492', '2007-04-07T06:48:11.996577', '4142', '1'), - ('0.99', '492', '2007-04-10T03:38:12.996577', '5609', '1'), - ('1.99', '492', '2007-02-16T10:52:54.996577', '1691', '2'), - ('8.99', '492', '2007-04-07T06:03:51.996577', '4128', '2'), - ('0.99', '492', '2007-04-09T15:04:13.996577', '5325', '2'), - ('6.99', '492', '2007-04-07T12:49:25.996577', '4258', '2'), - ('2.99', '492', '2007-04-27T07:29:49.996577', '7203', '2'), - ('0.99', '492', '2007-03-23T13:34:25.996577', '15822', '2'), - ('2.99', '492', '2007-03-21T04:20:03.996577', '14255', '1'), - ('4.99', '492', '2007-02-17T07:11:58.996577', '1956', '2'), - ('4.99', '492', '2007-03-23T17:51:02.996577', '15958', '1'), - ('4.99', '492', '2007-02-16T23:23:24.996577', '1855', '2'), - ('1.99', '121', '2007-03-18T20:33:18.996577', '12734', '2'), - ('1.99', '121', '2007-03-18T02:05:57.996577', '12242', '2'), - ('9.99', '121', '2007-03-21T09:30:35.996577', '14412', '2'), - ('7.99', '121', '2007-03-22T10:53:21.996577', '15114', '2'), - ('0.99', '121', '2007-04-27T04:10:39.996577', '7114', '2'), - ('2.99', '121', '2007-03-21T11:21:20.996577', '14464', '1'), - ('0.99', '121', '2007-04-27T06:52:20.996577', '7185', '1'), - ('8.99', '121', '2007-04-30T02:28:45.996577', '8969', '2'), - ('2.99', '121', '2007-04-27T11:13:40.996577', '7298', '2'), - ('5.99', '121', '2007-03-19T01:56:39.996577', '12881', '1'), - ('2.99', '121', '2007-02-16T06:44:31.996577', '1634', '1'), - ('6.99', '121', '2007-04-29T03:44:47.996577', '8370', '1'), - ('3.99', '121', '2007-03-18T08:52:47.996577', '12428', '2'), - ('0.99', '217', '2007-03-22T11:04:06.996577', '15116', '2'), - ('3.99', '217', '2007-04-10T11:16:27.996577', '5762', '2'), - ('0.99', '217', '2007-04-30T09:45:03.996577', '9159', '1'), - ('2.99', '217', '2007-03-02T15:46:33.996577', '11347', '1'), - ('5.99', '217', '2007-03-01T12:20:56.996577', '10581', '1'), - ('4.99', '217', '2007-04-12T04:18:57.996577', '6570', '2'), - ('4.99', '217', '2007-04-29T02:44:26.996577', '8332', '2'), - ('2.99', '217', '2007-04-30T07:44:40.996577', '9745', '2'), - ('6.99', '217', '2007-02-17T15:12:13.996577', '2076', '1'), - ('2.99', '217', '2007-04-30T15:42:03.996577', '9317', '2'), - ('2.99', '419', '2007-03-01T04:52:14.996577', '10372', '1'), - ('2.99', '419', '2007-03-02T14:31:17.996577', '11313', '1'), - ('6.99', '419', '2007-03-17T05:10:34.996577', '11689', '2'), - ('0.99', '419', '2007-04-10T16:53:49.996577', '5863', '2'), - ('0.99', '419', '2007-04-11T09:01:37.996577', '6173', '2'), - ('5.99', '419', '2007-03-18T19:57:08.996577', '12720', '1'), - ('3.99', '419', '2007-04-10T18:50:20.996577', '5900', '1'), - ('0.99', '419', '2007-04-07T10:52:47.996577', '4224', '1'), - ('2.99', '419', '2007-03-02T14:58:23.996577', '11323', '2'), - ('4.99', '419', '2007-04-27T13:26:53.996577', '7362', '1'), - ('2.99', '370', '2007-03-21T22:53:08.996577', '14786', '2'), - ('6.99', '370', '2007-04-27T08:16:19.996577', '7226', '1'), - ('4.99', '370', '2007-03-23T05:54:00.996577', '15626', '1'), - ('3.99', '370', '2007-03-21T16:17:15.996577', '14602', '1'), - ('7.99', '370', '2007-04-27T05:43:27.996577', '7152', '2'), - ('0.99', '370', '2007-03-17T14:51:30.996577', '11925', '2'), - ('1.99', '370', '2007-03-16T23:16:29.996577', '11540', '1'), - ('0.99', '370', '2007-04-30T19:07:01.996577', '10095', '2'), - ('0.99', '370', '2007-04-28T06:09:33.996577', '7797', '2'), - ('3.99', '370', '2007-03-22T20:25:41.996577', '15368', '2'), - ('4.99', '296', '2007-03-17T00:06:17.996577', '11571', '2'), - ('6.99', '296', '2007-04-26T22:44:57.996577', '6967', '1'), - ('4.99', '296', '2007-03-17T11:11:56.996577', '11825', '2'), - ('4.99', '296', '2007-04-11T00:33:11.996577', '6016', '2'), - ('2.99', '296', '2007-03-22T07:25:14.996577', '15023', '2'), - ('4.99', '296', '2007-04-27T21:07:19.996577', '7568', '2'), - ('0.99', '296', '2007-04-28T20:01:23.996577', '8171', '2'), - ('7.99', '296', '2007-04-05T21:58:21.996577', '3486', '2'), - ('7.99', '296', '2007-03-21T15:08:52.996577', '14571', '2'), - ('4.99', '296', '2007-04-10T02:51:24.996577', '5589', '1'), - ('1.99', '296', '2007-03-20T17:58:10.996577', '13991', '1'), - ('5.99', '296', '2007-04-30T12:43:28.996577', '9249', '1'), - ('0.99', '508', '2007-04-12T09:10:00.996577', '6646', '2'), - ('6.99', '508', '2007-04-10T22:45:20.996577', '5978', '2'), - ('2.99', '508', '2007-04-28T01:09:57.996577', '7668', '2'), - ('8.99', '508', '2007-04-26T21:27:45.996577', '6929', '2'), - ('5.99', '508', '2007-04-27T10:31:07.996577', '7283', '1'), - ('2.99', '508', '2007-04-30T06:11:45.996577', '9706', '1'), - ('2.99', '508', '2007-03-19T13:24:31.996577', '13201', '2'), - ('6.99', '508', '2007-03-19T09:16:36.996577', '13095', '1'), - ('6.99', '508', '2007-03-02T19:04:51.996577', '11447', '2'), - ('2.99', '508', '2007-04-30T20:08:30.996577', '10128', '2'), - ('3.99', '379', '2007-03-23T16:55:17.996577', '15930', '2'), - ('4.99', '379', '2007-03-22T02:27:27.996577', '14886', '1'), - ('2.99', '379', '2007-02-20T03:06:11.996577', '2926', '1'), - ('2.99', '379', '2007-04-08T11:59:01.996577', '4740', '2'), - ('5.99', '379', '2007-03-20T19:01:22.996577', '14011', '1'), - ('4.99', '379', '2007-04-30T17:29:28.996577', '10041', '1'), - ('4.99', '379', '2007-04-09T18:30:24.996577', '5402', '1'), - ('0.99', '379', '2007-03-19T18:30:59.996577', '13334', '1'), - ('2.99', '379', '2007-03-21T00:52:16.996577', '14152', '2'), - ('4.99', '379', '2007-04-06T12:30:28.996577', '3788', '1'), - ('5.99', '509', '2007-03-02T03:06:43.996577', '10988', '2'), - ('8.99', '509', '2007-04-28T17:42:32.996577', '8114', '1'), - ('5.99', '509', '2007-03-22T06:20:50.996577', '14994', '2'), - ('4.99', '509', '2007-02-20T02:38:42.996577', '2919', '2'), - ('2.99', '316', '2007-04-27T21:47:55.996577', '7586', '2'), - ('2.99', '316', '2007-03-21T03:24:03.996577', '14226', '1'), - ('4.99', '316', '2007-04-29T10:01:26.996577', '8564', '1'), - ('6.99', '316', '2007-04-30T13:00:10.996577', '9903', '2'), - ('1.99', '316', '2007-04-28T11:22:24.996577', '7945', '1'), - ('2.99', '316', '2007-03-23T14:03:15.996577', '15840', '2'), - ('5.99', '316', '2007-04-10T03:57:24.996577', '5618', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['25722', '25730', '32078', '28989', '28988', '24622', '28983', '24621', '18490', '18491', '24625', '28990', '18492', '21039', '26973', '26983', '26974', '21036', '21041', '17824', '21037', '26978', '21035', '21040', '17823', '26981', '17826', '26977', '26980', '30982', '24361', '24357', '30985', '24365', '30988', '30980', '30990', '30984', '32066', '24359', '30989', '21443', '18002', '18001', '27421', '21434', '27423', '21447', '27413', '21436', '27414', '21437', '21438', '27422', '21435', '27416', '27411', '27418', '26315', '20448', '17609', '26320', '26319', '20445', '26322', '20442', '26324', '20443', '20447', '17785', '26826', '31956', '20891', '20894', '20898', '26828', '20893', '26827', '22956', '29286', '29294', '22960', '22954', '22955', '29284', '32019', '18609', '22957', '29292', '29285', '29290', '18611', '24468', '24472', '31113', '24475', '31108', '19217', '24474', '24473']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('7.99', '316', '2007-04-10T01:16:33.996577', '5544', '2'), - ('4.99', '316', '2007-04-30T22:51:05.996577', '9508', '1'), - ('5.98', '208', '2007-05-14T13:44:29.996577', '13719', '1'), - ('2.99', '208', '2007-04-28T12:56:17.996577', '7984', '2'), - ('2.99', '208', '2007-04-28T08:30:27.996577', '7861', '1'), - ('5.99', '208', '2007-03-01T19:52:54.996577', '10784', '2'), - ('2.99', '208', '2007-04-09T05:39:48.996577', '5117', '1'), - ('4.99', '208', '2007-03-01T18:57:05.996577', '10762', '2'), - ('0.99', '208', '2007-02-16T19:04:26.996577', '1805', '1'), - ('5.99', '208', '2007-02-17T06:47:48.996577', '1949', '1'), - ('0.99', '208', '2007-03-17T10:53:43.996577', '11819', '2'), - ('1.99', '208', '2007-04-29T17:24:38.996577', '8742', '1'), - ('0.99', '208', '2007-02-19T04:05:20.996577', '2592', '2'), - ('4.99', '426', '2007-03-18T23:43:50.996577', '12822', '1'), - ('2.99', '426', '2007-04-07T05:19:38.996577', '4114', '2'), - ('10.99', '426', '2007-04-30T21:58:17.996577', '10172', '2'), - ('4.99', '426', '2007-04-07T19:47:10.996577', '4398', '2'), - ('6.99', '426', '2007-03-17T15:23:20.996577', '11938', '2'), - ('6.99', '426', '2007-03-21T00:51:51.996577', '14151', '2'), - ('2.99', '426', '2007-02-18T00:40:04.996577', '2204', '1'), - ('5.99', '426', '2007-03-18T13:03:52.996577', '12548', '2'), - ('10.99', '426', '2007-04-27T19:42:54.996577', '7527', '1'), - ('0.99', '426', '2007-03-17T12:46:47.996577', '11876', '2'), - ('2.99', '426', '2007-03-20T12:31:34.996577', '13834', '2'), - ('7.99', '426', '2007-02-16T22:14:25.996577', '1842', '1'), - ('5.99', '426', '2007-04-30T10:39:06.996577', '9185', '1'), - ('0.99', '426', '2007-02-21T01:28:37.996577', '3243', '1'), - ('4.99', '426', '2007-04-27T18:29:46.996577', '7495', '1'), - ('5.99', '426', '2007-04-28T05:50:33.996577', '7789', '1'), - ('1.99', '175', '2007-04-09T11:03:34.996577', '5232', '1'), - ('4.99', '175', '2007-03-19T06:25:40.996577', '13016', '1'), - ('7.99', '175', '2007-03-01T00:13:52.996577', '10229', '2'), - ('0.99', '175', '2007-04-28T05:20:38.996577', '7771', '1'), - ('2.99', '175', '2007-03-22T02:50:57.996577', '14897', '2'), - ('3.99', '175', '2007-04-29T05:59:52.996577', '8440', '1'), - ('4.99', '175', '2007-04-06T04:41:18.996577', '3625', '1'), - ('4.99', '175', '2007-04-30T13:59:51.996577', '9941', '2'), - ('2.99', '175', '2007-04-27T16:34:56.996577', '7448', '1'), - ('0.00', '175', '2007-05-14T13:44:29.996577', '13161', '2'), - ('4.99', '175', '2007-03-17T02:30:02.996577', '11618', '2'), - ('4.99', '175', '2007-04-29T20:37:34.996577', '8817', '1'), - ('9.99', '468', '2007-03-21T16:32:17.996577', '14614', '1'), - ('8.99', '468', '2007-02-16T06:19:35.996577', '1627', '1'), - ('2.99', '468', '2007-02-15T02:21:39.996577', '1229', '2'), - ('5.99', '468', '2007-04-29T05:31:23.996577', '8423', '2'), - ('10.99', '468', '2007-03-02T12:13:31.996577', '11257', '2'), - ('0.99', '468', '2007-04-30T01:59:07.996577', '9598', '1'), - ('0.99', '468', '2007-03-23T20:53:05.996577', '16044', '2'), - ('3.99', '468', '2007-04-07T08:58:34.996577', '4184', '2'), - ('6.99', '468', '2007-03-17T18:28:36.996577', '12026', '2'), - ('3.99', '468', '2007-04-08T01:48:36.996577', '4527', '2'), - ('3.99', '468', '2007-03-19T14:14:13.996577', '13221', '2'), - ('0.99', '468', '2007-03-19T21:20:05.996577', '13417', '1'), - ('6.99', '468', '2007-04-29T18:11:28.996577', '8768', '2'), - ('4.99', '468', '2007-03-17T02:58:35.996577', '11633', '2'), - ('0.99', '468', '2007-04-11T20:53:45.996577', '6392', '1'), - ('2.99', '468', '2007-04-06T09:41:14.996577', '3724', '2'), - ('5.99', '468', '2007-04-12T16:42:36.996577', '6815', '2'), - ('4.99', '367', '2007-04-09T22:37:37.996577', '5490', '2'), - ('6.99', '367', '2007-03-21T09:34:59.996577', '14413', '1'), - ('0.99', '367', '2007-02-20T13:38:14.996577', '3078', '1'), - ('5.99', '367', '2007-04-12T17:26:29.996577', '6835', '2'), - ('0.99', '367', '2007-04-12T12:03:24.996577', '6716', '1'), - ('8.99', '367', '2007-03-18T06:35:51.996577', '12373', '2'), - ('3.99', '367', '2007-04-30T04:34:04.996577', '9030', '1'), - ('4.99', '367', '2007-03-01T03:46:49.996577', '10344', '2'), - ('4.99', '367', '2007-04-30T13:17:30.996577', '9912', '1'), - ('4.99', '367', '2007-03-17T22:50:01.996577', '12152', '1'), - ('4.99', '367', '2007-03-19T14:46:19.996577', '13235', '2'), - ('2.99', '412', '2007-02-21T05:27:37.996577', '3292', '1'), - ('8.99', '412', '2007-04-29T05:12:49.996577', '8411', '1'), - ('0.99', '412', '2007-05-14T13:44:29.996577', '15314', '1'), - ('2.99', '412', '2007-03-01T05:05:03.996577', '10381', '2'), - ('3.99', '412', '2007-03-20T21:19:25.996577', '14068', '1'), - ('8.99', '412', '2007-03-23T12:09:31.996577', '15781', '1'), - ('4.99', '412', '2007-04-30T12:19:04.996577', '9881', '1'), - ('4.99', '412', '2007-03-02T04:15:36.996577', '11027', '2'), - ('0.99', '412', '2007-04-29T14:22:48.996577', '8674', '1'), - ('0.99', '28', '2007-03-18T06:12:31.996577', '12359', '1'), - ('2.99', '28', '2007-04-10T05:49:53.996577', '5653', '2'), - ('4.99', '28', '2007-04-30T01:50:56.996577', '9593', '2'), - ('4.99', '28', '2007-03-22T23:16:55.996577', '15445', '1'), - ('3.99', '28', '2007-03-17T12:13:15.996577', '11856', '1'), - ('2.99', '28', '2007-03-18T00:23:10.996577', '12190', '2'), - ('0.99', '28', '2007-04-08T10:14:01.996577', '4704', '2'), - ('2.99', '28', '2007-05-14T13:44:29.996577', '12938', '2'), - ('2.99', '28', '2007-02-15T03:26:33.996577', '1240', '2'), - ('2.99', '28', '2007-03-18T19:27:43.996577', '12708', '1'), - ('2.99', '28', '2007-04-29T23:35:38.996577', '8901', '1'), - ('4.99', '28', '2007-04-08T21:26:47.996577', '4951', '2'), - ('9.99', '28', '2007-04-27T21:36:06.996577', '7580', '1'), - ('3.99', '28', '2007-02-18T06:47:18.996577', '2299', '2'), - ('8.99', '186', '2007-03-18T09:11:18.996577', '12438', '1'), - ('2.99', '186', '2007-03-20T18:50:02.996577', '14006', '1'), - ('2.99', '186', '2007-04-30T15:04:25.996577', '9303', '2'), - ('3.99', '186', '2007-03-22T06:14:31.996577', '14988', '2'), - ('4.99', '186', '2007-04-11T03:03:15.996577', '6067', '2'), - ('4.99', '186', '2007-02-20T11:00:56.996577', '3039', '1'), - ('4.99', '186', '2007-03-21T17:43:14.996577', '14646', '2'), - ('4.99', '186', '2007-03-21T03:25:41.996577', '14229', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['19215', '32070', '24466', '24471', '24465', '19212', '24478', '31112', '31111', '25509', '19821', '19818', '25510', '19810', '19813', '19814', '19819', '24817', '24816', '19366', '31518', '24822', '31515', '31521', '24818', '31523', '24813', '31364', '31361', '31363', '24717', '21881', '27961', '21886', '18178', '18173', '21880', '21882', '27965', '27963', '18174', '31983', '21885', '27962', '31484', '31480', '31477', '24792', '32088', '24793', '24794', '31473', '31479', '31485', '31481', '19354', '28548', '30062', '27533', '21099', '31263', '22282', '27695', '18035', '27586', '24326', '21642', '22439', '25393', '23984', '18031', '30136', '28915', '18193', '24986', '28708', '22544', '18418', '22935', '31762', '18499', '22505', '31959', '18419', '28813', '20559', '19155', '19681', '22047', '30512', '17804', '22963', '17998', '30723', '31169', '24766', '17644', '20420', '24906', '20017']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('4.99', '186', '2007-02-17T19:33:32.996577', '2132', '2'), - ('2.99', '186', '2007-05-14T13:44:29.996577', '14216', '1'), - ('0.99', '186', '2007-03-17T16:41:33.996577', '11982', '1'), - ('3.99', '186', '2007-03-20T13:15:28.996577', '13853', '1'), - ('0.99', '186', '2007-03-02T02:58:45.996577', '10985', '1'), - ('4.99', '186', '2007-02-14T23:47:05.996577', '1192', '1'), - ('0.99', '186', '2007-03-23T04:48:17.996577', '15596', '1'), - ('0.99', '186', '2007-04-29T22:42:20.996577', '8872', '2'), - ('4.99', '186', '2007-04-29T07:18:44.996577', '8483', '1'), - ('6.99', '297', '2007-04-11T02:51:44.996577', '6064', '1'), - ('4.99', '297', '2007-03-23T09:11:26.996577', '15711', '1'), - ('1.99', '297', '2007-03-20T14:08:08.996577', '13888', '1'), - ('4.99', '297', '2007-04-11T08:14:14.996577', '6156', '1'), - ('0.99', '297', '2007-03-02T12:40:07.996577', '11269', '2'), - ('2.99', '297', '2007-03-17T09:02:50.996577', '11780', '1'), - ('0.99', '297', '2007-03-17T09:16:31.996577', '11784', '1'), - ('5.99', '297', '2007-03-21T09:09:00.996577', '14403', '1'), - ('3.99', '231', '2007-03-18T01:40:10.996577', '12231', '1'), - ('8.99', '231', '2007-03-18T01:39:30.996577', '12230', '2'), - ('0.99', '231', '2007-02-18T16:00:34.996577', '2423', '2'), - ('2.99', '231', '2007-04-09T04:36:49.996577', '5096', '1'), - ('3.99', '231', '2007-03-22T21:19:39.996577', '15389', '1'), - ('2.99', '231', '2007-04-06T14:58:56.996577', '3839', '1'), - ('1.99', '231', '2007-04-12T19:01:24.996577', '6877', '1'), - ('6.99', '231', '2007-03-20T17:36:58.996577', '13983', '2'), - ('5.99', '231', '2007-04-30T01:45:28.996577', '8949', '2'), - ('7.99', '231', '2007-03-02T10:20:23.996577', '11202', '1'), - ('6.99', '218', '2007-04-30T03:57:06.996577', '9018', '2'), - ('0.99', '218', '2007-04-10T10:18:30.996577', '5737', '2'), - ('8.99', '218', '2007-04-27T08:38:05.996577', '7236', '1'), - ('5.99', '218', '2007-03-20T08:02:33.996577', '13708', '2'), - ('1.99', '516', '2007-03-17T15:24:23.996577', '11939', '2'), - ('6.99', '516', '2007-04-12T18:22:17.996577', '6858', '1'), - ('0.99', '516', '2007-03-23T08:50:47.996577', '15701', '1'), - ('2.99', '516', '2007-02-21T17:15:14.996577', '3431', '1'), - ('4.99', '516', '2007-02-14T21:23:39.996577', '1159', '2'), - ('0.99', '516', '2007-03-17T14:53:28.996577', '11926', '2'), - ('1.99', '516', '2007-03-18T12:33:48.996577', '12535', '1'), - ('5.99', '516', '2007-04-29T08:58:39.996577', '8534', '2'), - ('4.99', '516', '2007-04-28T09:02:08.996577', '7882', '1'), - ('1.99', '516', '2007-02-15T00:28:17.996577', '1200', '1'), - ('0.00', '516', '2007-05-14T13:44:29.996577', '12915', '1'), - ('0.99', '516', '2007-03-23T02:12:56.996577', '15526', '1'), - ('4.99', '516', '2007-04-27T23:26:30.996577', '7628', '1'), - ('0.99', '228', '2007-04-27T22:16:41.996577', '7601', '1'), - ('0.99', '228', '2007-04-10T18:59:50.996577', '5902', '2'), - ('0.99', '228', '2007-04-08T19:35:50.996577', '4909', '1'), - ('0.99', '228', '2007-03-18T04:12:55.996577', '12304', '1'), - ('3.98', '228', '2007-05-14T13:44:29.996577', '12672', '2'), - ('2.99', '228', '2007-03-19T04:29:18.996577', '12952', '2'), - ('4.99', '228', '2007-03-19T23:03:56.996577', '13458', '2'), - ('6.99', '228', '2007-04-06T09:20:14.996577', '3715', '1'), - ('4.99', '228', '2007-04-09T14:51:58.996577', '5320', '1'), - ('2.99', '228', '2007-04-28T19:06:22.996577', '8147', '1'), - ('1.99', '228', '2007-04-11T07:20:42.996577', '6141', '2'), - ('2.99', '228', '2007-02-20T03:34:19.996577', '2934', '2'), - ('4.99', '570', '2007-04-29T16:57:20.996577', '8735', '2'), - ('0.99', '96', '2007-04-10T01:40:34.996577', '5558', '1'), - ('2.99', '477', '2007-04-29T22:12:48.996577', '8857', '2'), - ('3.99', '435', '2007-03-17T09:26:06.996577', '11786', '1'), - ('4.99', '209', '2007-04-08T19:30:07.996577', '4907', '1'), - ('2.99', '560', '2007-03-21T10:16:53.996577', '14436', '1'), - ('7.99', '491', '2007-04-28T01:49:13.996577', '7688', '2'), - ('10.99', '477', '2007-02-18T07:01:49.996577', '2306', '1'), - ('5.99', '482', '2007-04-12T17:43:19.996577', '6844', '2'), - ('9.99', '171', '2007-03-21T16:34:58.996577', '14615', '2'), - ('6.99', '489', '2007-03-21T09:52:37.996577', '14424', '2'), - ('3.99', '577', '2007-03-19T13:24:24.996577', '13200', '2'), - ('2.99', '288', '2007-04-28T08:11:28.996577', '7855', '2'), - ('4.99', '138', '2007-03-22T06:09:34.996577', '14987', '1'), - ('4.99', '476', '2007-02-18T22:12:24.996577', '2508', '2'), - ('6.99', '102', '2007-04-07T04:14:25.996577', '4089', '1'), - ('2.99', '202', '2007-04-27T22:42:24.996577', '7613', '1'), - ('0.99', '521', '2007-02-17T13:48:00.996577', '2053', '2'), - ('4.99', '250', '2007-03-21T23:40:40.996577', '14814', '2'), - ('4.99', '583', '2007-04-06T15:02:58.996577', '3842', '1'), - ('0.99', '589', '2007-03-21T19:33:08.996577', '14706', '2'), - ('0.99', '586', '2007-02-15T23:43:22.996577', '1540', '2'), - ('4.99', '26', '2007-03-19T09:53:36.996577', '13111', '2'), - ('2.99', '253', '2007-04-09T23:07:14.996577', '5505', '1'), - ('4.99', '1', '2007-02-18T07:10:14.996577', '2308', '1'), - ('0.99', '585', '2007-03-01T11:55:50.996577', '10573', '2'), - ('2.99', '422', '2007-05-14T13:44:29.996577', '15441', '2'), - ('2.99', '587', '2007-02-15T09:57:43.996577', '1330', '2'), - ('2.99', '592', '2007-04-06T01:20:03.996577', '3560', '2'), - ('4.99', '378', '2007-03-02T06:49:53.996577', '11111', '1'), - ('6.99', '171', '2007-02-21T08:55:57.996577', '3338', '2'), - ('5.99', '280', '2007-03-23T17:38:05.996577', '15950', '2'), - ('2.99', '534', '2007-03-18T04:14:55.996577', '12305', '2'), - ('0.99', '134', '2007-04-12T09:46:31.996577', '6659', '1'), - ('0.99', '420', '2007-02-19T11:57:37.996577', '2698', '1'), - ('1.99', '29', '2007-03-01T23:58:47.996577', '10899', '2'), - ('4.99', '467', '2007-02-17T19:07:20.996577', '2121', '2'), - ('0.99', '152', '2007-04-11T14:37:07.996577', '6273', '1'), - ('7.99', '192', '2007-04-30T20:59:10.996577', '9462', '1'), - ('5.99', '224', '2007-03-21T11:35:36.996577', '14468', '2'), - ('4.99', '378', '2007-02-16T06:17:16.996577', '1623', '2'), - ('0.99', '364', '2007-03-20T15:51:01.996577', '13936', '2'), - ('4.99', '241', '2007-03-19T04:34:52.996577', '12956', '1'), - ('7.99', '321', '2007-03-17T18:43:57.996577', '12034', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['22240', '20804', '20148', '31143', '23408', '20823', '30804', '25576', '18088', '31647', '23248', '25977', '22645', '30664', '28511', '28720', '19600', '30885', '29052', '24542', '31376', '21924', '18804', '28774', '18016', '26886', '27251', '30900', '30178', '30511', '31519', '30908', '18269', '23536', '25515', '29404', '26185', '27462', '28661', '29947', '28987', '21408', '24265', '31568', '22032', '17793', '25494', '31231', '19835', '31989', '19611', '20571', '21560', '29939', '25803', '19084', '23327', '26045', '19899', '27711', '18976', '30795', '21650', '26764', '18317', '28173', '30976', '25211', '30753', '30894', '25579', '24271', '18268', '31833', '26355', '25545', '26325', '18323', '28617', '24333', '24215', '20694', '30350', '28730', '22036', '29299', '28274', '31275', '22480', '24687', '29916', '19883', '29316', '24260', '22504', '26960', '20946', '28506', '31368', '25265']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('6.99', '556', '2007-03-01T10:12:34.996577', '10518', '2'), - ('0.99', '403', '2007-03-21T18:13:53.996577', '14662', '1'), - ('3.99', '336', '2007-03-19T03:28:42.996577', '12926', '2'), - ('0.99', '189', '2007-04-30T17:54:47.996577', '9386', '2'), - ('5.99', '75', '2007-03-18T08:18:18.996577', '12412', '1'), - ('1.99', '405', '2007-03-19T17:24:58.996577', '13304', '1'), - ('2.99', '159', '2007-04-28T22:05:49.996577', '8212', '2'), - ('8.99', '302', '2007-04-30T17:38:29.996577', '9374', '1'), - ('9.99', '492', '2007-02-21T05:38:10.996577', '3298', '1'), - ('0.99', '241', '2007-04-27T12:02:01.996577', '7320', '1'), - ('4.99', '58', '2007-03-22T06:15:33.996577', '14989', '1'), - ('5.99', '338', '2007-04-07T04:54:07.996577', '4104', '2'), - ('4.99', '204', '2007-03-19T21:17:14.996577', '13416', '1'), - ('2.99', '147', '2007-04-10T02:05:12.996577', '5567', '1'), - ('4.99', '566', '2007-04-30T21:29:57.996577', '9470', '2'), - ('7.99', '584', '2007-04-06T17:32:50.996577', '3895', '2'), - ('2.99', '274', '2007-03-22T12:14:50.996577', '15143', '2'), - ('4.99', '167', '2007-04-09T08:28:18.996577', '5178', '1'), - ('3.99', '5', '2007-04-30T12:29:19.996577', '9888', '1'), - ('0.99', '194', '2007-03-20T00:58:13.996577', '13515', '1'), - ('2.99', '219', '2007-04-27T12:35:16.996577', '7335', '2'), - ('2.99', '521', '2007-03-01T12:32:04.996577', '10587', '1'), - ('4.99', '79', '2007-02-20T14:46:22.996577', '3096', '2'), - ('2.99', '589', '2007-04-08T23:12:59.996577', '4986', '2'), - ('4.99', '471', '2007-02-20T13:01:52.996577', '3073', '2'), - ('5.99', '419', '2007-04-09T15:28:04.996577', '5333', '2'), - ('8.99', '451', '2007-04-09T23:43:37.996577', '5518', '2'), - ('2.99', '168', '2007-04-08T21:38:14.996577', '4953', '2'), - ('5.99', '104', '2007-04-30T16:00:29.996577', '9996', '2'), - ('2.99', '134', '2007-04-11T12:16:37.996577', '6226', '2'), - ('5.99', '231', '2007-04-10T01:41:50.996577', '5560', '1'), - ('6.99', '168', '2007-04-29T13:54:57.996577', '8659', '2'), - ('2.99', '543', '2007-02-20T17:10:13.996577', '3128', '1'), - ('4.99', '89', '2007-03-01T20:53:55.996577', '10806', '2'), - ('5.99', '297', '2007-04-30T05:05:19.996577', '9674', '2'), - ('5.99', '37', '2007-04-30T01:04:37.996577', '9567', '1'), - ('3.99', '356', '2007-04-28T21:36:31.996577', '8198', '1'), - ('2.99', '471', '2007-04-11T15:53:23.996577', '6293', '2'), - ('0.99', '579', '2007-04-29T03:24:52.996577', '8354', '1'), - ('5.99', '86', '2007-04-29T19:54:50.996577', '8803', '2'), - ('0.99', '208', '2007-04-27T11:43:22.996577', '7315', '1'), - ('4.99', '465', '2007-03-17T21:23:58.996577', '12106', '2'), - ('1.99', '165', '2007-03-22T06:49:47.996577', '15007', '2'), - ('3.99', '235', '2007-04-30T01:38:56.996577', '9587', '1'), - ('5.99', '532', '2007-03-23T19:46:57.996577', '16014', '1'), - ('2.99', '416', '2007-02-14T21:21:59.996577', '1158', '2'), - ('4.99', '296', '2007-04-07T23:24:56.996577', '4480', '1'), - ('2.99', '199', '2007-04-08T00:37:14.996577', '4499', '1'), - ('5.99', '299', '2007-03-17T07:31:50.996577', '11746', '1'), - ('2.99', '533', '2007-05-14T13:44:29.996577', '14018', '2'), - ('1.99', '275', '2007-03-20T13:32:35.996577', '13865', '2'), - ('0.99', '379', '2007-03-21T11:38:07.996577', '14470', '1'), - ('9.99', '480', '2007-03-19T10:36:39.996577', '13131', '2'), - ('4.99', '86', '2007-04-06T20:03:26.996577', '3945', '2'), - ('1.99', '323', '2007-04-28T07:51:40.996577', '7847', '1'), - ('0.99', '149', '2007-02-19T15:12:44.996577', '2752', '1'), - ('2.99', '67', '2007-03-20T06:21:00.996577', '13652', '1'), - ('7.99', '345', '2007-04-11T16:32:55.996577', '6307', '1'), - ('0.99', '306', '2007-03-17T08:55:45.996577', '11776', '2'), - ('7.99', '493', '2007-04-27T01:52:49.996577', '7043', '2'), - ('3.99', '122', '2007-02-18T02:56:53.996577', '2240', '2'), - ('2.99', '158', '2007-04-29T17:42:47.996577', '8750', '1'), - ('2.99', '490', '2007-03-22T17:27:27.996577', '15276', '2'), - ('2.99', '407', '2007-04-28T16:23:08.996577', '8078', '1'), - ('0.99', '559', '2007-02-19T12:25:17.996577', '2706', '1'), - ('4.99', '533', '2007-04-27T20:45:31.996577', '7555', '2'), - ('7.99', '174', '2007-04-29T03:17:52.996577', '8348', '2'), - ('7.99', '273', '2007-04-09T19:56:33.996577', '5435', '2'), - ('4.99', '155', '2007-04-11T03:57:48.996577', '6087', '2'), - ('0.99', '167', '2007-04-29T19:25:48.996577', '8793', '1'), - ('4.99', '303', '2007-04-11T10:59:50.996577', '6205', '1'), - ('4.99', '166', '2007-03-20T03:56:37.996577', '13582', '2'), - ('4.99', '543', '2007-02-20T12:44:05.996577', '3070', '2'), - ('7.99', '259', '2007-04-30T20:17:10.996577', '9444', '1'), - ('0.99', '370', '2007-04-28T23:32:08.996577', '8258', '2'), - ('4.99', '300', '2007-04-26T23:44:55.996577', '6998', '1'), - ('4.99', '368', '2007-04-06T04:04:05.996577', '3608', '2'), - ('2.99', '561', '2007-02-15T20:41:16.996577', '1505', '2'), - ('4.99', '576', '2007-04-06T19:35:49.996577', '3934', '2'), - ('5.99', '172', '2007-03-19T08:19:43.996577', '13067', '2'), - ('1.99', '159', '2007-03-19T16:09:42.996577', '13270', '2'), - ('1.99', '391', '2007-03-17T21:09:36.996577', '12100', '1'), - ('6.99', '120', '2007-04-30T03:22:40.996577', '8998', '1'), - ('2.99', '584', '2007-04-30T18:21:41.996577', '10073', '2'), - ('8.99', '533', '2007-03-17T08:01:28.996577', '11758', '1'), - ('0.99', '29', '2007-04-08T02:09:12.996577', '4535', '2'), - ('4.99', '543', '2007-04-09T21:34:13.996577', '5467', '2'), - ('0.99', '209', '2007-04-30T13:28:41.996577', '9923', '1'), - ('5.99', '582', '2007-03-20T11:37:19.996577', '13815', '2'), - ('2.99', '215', '2007-03-18T03:25:09.996577', '12285', '2'), - ('4.99', '83', '2007-04-29T16:51:28.996577', '8729', '2'), - ('4.99', '304', '2007-03-22T02:55:04.996577', '14899', '1'), - ('2.99', '30', '2007-04-11T19:34:43.996577', '6359', '2'), - ('2.99', '164', '2007-03-02T09:07:13.996577', '11175', '2'), - ('0.99', '584', '2007-03-23T05:34:26.996577', '15615', '1'), - ('2.99', '425', '2007-04-08T08:21:54.996577', '4659', '1'), - ('0.99', '417', '2007-03-17T20:19:23.996577', '12074', '2'), - ('1.99', '566', '2007-04-29T01:37:13.996577', '8305', '2'), - ('7.99', '219', '2007-04-08T19:42:22.996577', '4910', '2'), - ('2.99', '278', '2007-04-06T12:00:03.996577', '3776', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['29459', '27569', '30950', '26049', '24734', '21687', '23592', '22341', '18298', '26713', '23118', '29264', '25357', '31219', '21966', '26824', '18936', '31996', '20669', '19702', '28175', '18758', '21416', '23175', '24624', '31842', '24089', '28606', '24649', '20320', '18068', '28232', '24610', '29477', '22585', '19705', '21031', '22912', '24132', '19895', '29819', '25974', '28938', '23888', '28339', '23163', '20865', '27186', '24170', '27581', '19494', '31520', '22273', '24171', '22775', '19868', '28368', '17684', '25110', '17758', '30659', '20634', '23886', '21547', '24246', '27641', '29844', '20332', '18823', '21553', '21866', '24068', '24775', '18036', '24643', '29409', '22537', '29366', '28004', '24253', '27226', '27265', '22906', '22316', '18971', '27270', '25446', '24330', '18169', '30627', '21259', '25687', '29328', '26076', '30883', '31110', '30352', '21579', '23114', '21464']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('2.99', '41', '2007-04-28T22:27:55.996577', '8225', '2'), - ('10.99', '481', '2007-04-08T08:40:11.996577', '4668', '1'), - ('5.99', '172', '2007-04-12T18:51:31.996577', '6875', '1'), - ('4.99', '345', '2007-04-30T09:51:48.996577', '9163', '1'), - ('4.99', '220', '2007-03-18T08:07:52.996577', '12407', '1'), - ('3.99', '495', '2007-03-19T13:33:52.996577', '13205', '2'), - ('5.99', '95', '2007-03-18T06:00:38.996577', '12351', '2'), - ('8.99', '566', '2007-03-18T07:00:59.996577', '12382', '2'), - ('4.99', '554', '2007-02-17T07:22:36.996577', '1959', '1'), - ('4.99', '403', '2007-04-30T09:15:27.996577', '9794', '2'), - ('6.99', '45', '2007-03-21T15:20:29.996577', '14576', '1'), - ('6.99', '26', '2007-04-08T07:38:12.996577', '4641', '1'), - ('4.99', '285', '2007-04-28T19:24:44.996577', '8154', '1'), - ('4.99', '198', '2007-04-10T13:03:19.996577', '5794', '2'), - ('8.99', '526', '2007-03-19T14:20:39.996577', '13224', '2'), - ('0.99', '412', '2007-04-28T14:56:09.996577', '8036', '1'), - ('2.99', '112', '2007-02-17T05:19:12.996577', '1930', '2'), - ('0.00', '560', '2007-05-14T13:44:29.996577', '14425', '2'), - ('2.99', '389', '2007-03-02T18:54:07.996577', '11441', '2'), - ('5.99', '285', '2007-03-01T09:11:38.996577', '10493', '1'), - ('2.99', '533', '2007-04-28T17:28:02.996577', '8104', '2'), - ('4.99', '66', '2007-02-17T17:57:29.996577', '2106', '1'), - ('7.99', '466', '2007-03-17T19:17:50.996577', '12048', '1'), - ('4.99', '51', '2007-03-21T13:15:35.996577', '14512', '2'), - ('6.99', '208', '2007-03-17T10:17:13.996577', '11805', '2'), - ('1.99', '260', '2007-04-29T07:06:07.996577', '8475', '1'), - ('4.99', '147', '2007-03-23T01:30:22.996577', '15513', '2'), - ('6.99', '575', '2007-04-06T01:17:32.996577', '3558', '1'), - ('4.99', '211', '2007-03-18T13:40:43.996577', '12565', '2'), - ('4.99', '353', '2007-03-21T08:53:20.996577', '14396', '1'), - ('2.99', '486', '2007-02-19T02:14:05.996577', '2566', '2'), - ('0.99', '538', '2007-04-29T18:08:34.996577', '8765', '1'), - ('3.99', '201', '2007-03-01T22:51:12.996577', '10865', '2'), - ('3.99', '42', '2007-04-29T21:58:29.996577', '8852', '2'), - ('0.99', '595', '2007-03-23T18:57:36.996577', '15994', '2'), - ('8.99', '285', '2007-03-17T18:29:38.996577', '12027', '1'), - ('6.99', '425', '2007-03-23T12:14:26.996577', '15784', '2'), - ('2.99', '24', '2007-03-01T09:06:53.996577', '10491', '2'), - ('0.99', '150', '2007-03-21T18:16:21.996577', '14663', '1'), - ('5.99', '306', '2007-03-01T23:40:39.996577', '10893', '2'), - ('5.99', '75', '2007-04-08T07:25:47.996577', '4639', '1'), - ('5.99', '337', '2007-04-30T05:34:20.996577', '9051', '2'), - ('2.99', '204', '2007-04-12T18:42:15.996577', '6871', '2'), - ('3.99', '129', '2007-03-18T15:38:31.996577', '12612', '2'), - ('8.99', '550', '2007-04-30T02:04:15.996577', '8959', '1'), - ('2.99', '51', '2007-03-01T19:42:50.996577', '10780', '1'), - ('4.99', '409', '2007-03-21T19:17:47.996577', '14697', '1'), - ('0.99', '445', '2007-04-11T18:37:00.996577', '6346', '1'), - ('7.99', '154', '2007-03-21T23:06:23.996577', '14793', '2'), - ('4.99', '482', '2007-04-09T21:31:47.996577', '5466', '1'), - ('8.99', '262', '2007-02-19T21:34:54.996577', '2850', '2'), - ('0.99', '231', '2007-04-12T18:26:35.996577', '6862', '1'), - ('4.99', '559', '2007-03-23T15:01:59.996577', '15877', '1'), - ('6.99', '154', '2007-03-22T03:35:04.996577', '14918', '1'), - ('0.99', '10', '2007-03-02T17:42:05.996577', '11405', '1'), - ('6.99', '302', '2007-03-23T18:50:43.996577', '15987', '2'), - ('4.99', '553', '2007-04-08T16:56:46.996577', '4845', '2'), - ('0.99', '385', '2007-02-20T15:40:12.996577', '3105', '1'), - ('3.99', '262', '2007-03-21T11:22:48.996577', '14465', '2'), - ('5.99', '405', '2007-02-17T07:03:23.996577', '1953', '2'), - ('3.99', '146', '2007-04-28T23:07:07.996577', '8246', '2'), - ('6.99', '385', '2007-03-23T00:34:27.996577', '15488', '1'), - ('2.99', '129', '2007-03-01T11:15:18.996577', '10550', '2'), - ('4.99', '478', '2007-03-23T09:50:35.996577', '15724', '1'), - ('0.99', '162', '2007-03-02T03:38:08.996577', '11012', '2'), - ('8.99', '486', '2007-04-29T05:34:47.996577', '8425', '2'), - ('0.99', '76', '2007-04-30T18:37:58.996577', '10082', '2'), - ('0.99', '355', '2007-03-01T09:25:14.996577', '10498', '1'), - ('0.99', '84', '2007-02-16T19:44:33.996577', '1815', '2'), - ('8.99', '479', '2007-03-19T08:45:09.996577', '13078', '2'), - ('2.99', '514', '2007-03-22T23:24:53.996577', '15451', '1'), - ('4.99', '146', '2007-03-17T00:06:44.996577', '11573', '1'), - ('5.99', '225', '2007-03-21T10:35:51.996577', '14444', '2'), - ('4.99', '477', '2007-02-19T10:23:23.996577', '2676', '2'), - ('8.99', '210', '2007-03-23T17:17:06.996577', '15942', '2'), - ('2.99', '38', '2007-04-09T12:59:50.996577', '5273', '1'), - ('4.99', '589', '2007-03-01T11:04:47.996577', '10544', '2'), - ('2.99', '34', '2007-04-27T00:43:27.996577', '7015', '2'), - ('0.99', '519', '2007-04-30T13:05:29.996577', '9905', '1'), - ('2.99', '163', '2007-03-17T22:52:22.996577', '12154', '1'), - ('2.99', '448', '2007-04-08T02:17:06.996577', '4537', '2'), - ('6.99', '452', '2007-04-30T17:41:27.996577', '9379', '2'), - ('2.99', '23', '2007-03-19T17:00:16.996577', '13290', '2'), - ('2.99', '564', '2007-03-18T15:51:14.996577', '12617', '2'), - ('2.99', '120', '2007-02-20T17:46:58.996577', '3133', '1'), - ('6.99', '453', '2007-04-09T16:39:18.996577', '5359', '2'), - ('2.99', '292', '2007-04-28T15:18:09.996577', '8047', '1'), - ('6.99', '172', '2007-03-16T21:22:38.996577', '11499', '2'), - ('4.99', '515', '2007-02-17T10:09:01.996577', '2003', '2'), - ('9.99', '144', '2007-04-12T15:03:33.996577', '6791', '2'), - ('2.99', '451', '2007-03-02T01:53:34.996577', '10950', '2'), - ('2.99', '313', '2007-04-08T03:05:01.996577', '4552', '2'), - ('4.99', '31', '2007-04-06T21:13:36.996577', '3967', '2'), - ('4.99', '347', '2007-04-28T19:24:15.996577', '8153', '2'), - ('0.99', '167', '2007-04-08T00:08:50.996577', '4493', '2'), - ('3.99', '186', '2007-04-28T10:18:12.996577', '7915', '1'), - ('0.99', '120', '2007-04-30T21:38:07.996577', '10161', '2'), - ('4.99', '482', '2007-03-21T08:30:31.996577', '14383', '2'), - ('3.99', '45', '2007-03-02T21:03:41.996577', '11488', '2'), - ('4.99', '470', '2007-03-02T01:48:29.996577', '10944', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['31664', '30258', '24241', '17837', '27516', '25643', '25408', '23892', '21232', '25470', '27968', '31288', '19588', '25330', '25288', '25620', '19415', '30716', '19523', '20027', '23744', '19717', '25153', '29300', '28703', '27202', '28698', '27572', '30485', '30588', '19985', '25344', '25223', '17983', '19565', '29011', '27189', '28726', '20045', '26494', '29192', '30087', '29266', '30749', '31341', '29841', '20561', '19314', '27402', '29973', '24661', '18905', '26721', '27083', '21977', '18412', '29865', '28015', '28542', '18316', '26926', '23815', '21329', '22648', '24997', '31229', '28880', '25464', '18066', '23794', '22743', '29198', '22720', '22096', '24928', '18766', '22539', '29154', '19808', '24506', '28852', '31370', '18261', '19840', '22524', '27670', '26306', '27037', '17891', '31469', '19919', '28243', '18673', '21760', '30968', '24917', '30649', '27519', '19477', '19839']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('0.99', '243', '2007-04-08T16:28:40.996577', '4831', '1'), - ('4.99', '112', '2007-04-30T02:21:50.996577', '9609', '2'), - ('7.99', '161', '2007-03-21T08:03:40.996577', '14370', '1'), - ('5.99', '429', '2007-02-16T17:48:50.996577', '1781', '2'), - ('7.99', '476', '2007-04-05T21:33:43.996577', '3477', '2'), - ('7.99', '308', '2007-04-30T07:45:14.996577', '9746', '1'), - ('4.99', '290', '2007-04-07T01:26:25.996577', '4039', '2'), - ('4.99', '129', '2007-03-20T15:16:00.996577', '13919', '1'), - ('9.99', '448', '2007-03-17T09:50:09.996577', '11798', '1'), - ('0.99', '294', '2007-04-30T02:19:32.996577', '9607', '2'), - ('2.99', '517', '2007-04-07T04:28:47.996577', '4094', '2'), - ('1.99', '210', '2007-04-12T04:03:10.996577', '6564', '1'), - ('1.99', '274', '2007-03-01T20:07:03.996577', '10790', '1'), - ('4.99', '283', '2007-04-30T16:59:03.996577', '9353', '2'), - ('0.99', '280', '2007-04-29T03:39:26.996577', '8365', '1'), - ('0.99', '306', '2007-04-29T15:33:03.996577', '8702', '1'), - ('4.99', '242', '2007-02-16T11:49:31.996577', '1702', '2'), - ('4.99', '151', '2007-04-30T12:48:38.996577', '9253', '1'), - ('4.99', '267', '2007-03-19T05:29:01.996577', '12979', '1'), - ('0.99', '322', '2007-03-22T23:24:27.996577', '15450', '1'), - ('2.99', '115', '2007-03-17T13:40:21.996577', '11891', '1'), - ('0.99', '286', '2007-03-22T03:02:48.996577', '14905', '1'), - ('6.99', '266', '2007-03-18T08:05:56.996577', '12405', '1'), - ('10.99', '29', '2007-04-09T20:23:45.996577', '5442', '2'), - ('5.99', '582', '2007-04-29T01:50:41.996577', '8308', '2'), - ('4.99', '446', '2007-04-27T21:23:01.996577', '7576', '1'), - ('5.99', '582', '2007-04-12T07:47:01.996577', '6629', '2'), - ('4.99', '481', '2007-04-27T08:23:59.996577', '7228', '1'), - ('4.99', '132', '2007-04-07T08:05:50.996577', '4168', '1'), - ('4.99', '140', '2007-04-30T07:03:36.996577', '9094', '1'), - ('0.99', '316', '2007-03-18T00:25:37.996577', '12191', '2'), - ('2.99', '284', '2007-04-29T23:08:02.996577', '8888', '1'), - ('5.99', '274', '2007-04-05T23:53:04.996577', '3532', '2'), - ('4.99', '463', '2007-02-18T23:38:57.996577', '2527', '2'), - ('0.99', '271', '2007-03-21T03:35:38.996577', '14234', '2'), - ('2.99', '2', '2007-04-29T11:25:25.996577', '8598', '1'), - ('8.99', '445', '2007-04-29T21:54:45.996577', '8851', '1'), - ('4.99', '584', '2007-04-28T00:38:11.996577', '7659', '1'), - ('7.99', '324', '2007-03-21T12:04:20.996577', '14479', '2'), - ('6.99', '382', '2007-04-30T05:59:27.996577', '9067', '1'), - ('4.99', '19', '2007-04-06T00:53:21.996577', '3549', '2'), - ('0.99', '98', '2007-04-27T19:47:24.996577', '7530', '1'), - ('1.99', '26', '2007-04-11T07:47:57.996577', '6149', '1'), - ('2.99', '154', '2007-04-30T14:00:54.996577', '9286', '2'), - ('2.99', '215', '2007-04-30T05:15:21.996577', '9046', '2'), - ('3.99', '76', '2007-04-29T04:56:45.996577', '8405', '2'), - ('4.99', '378', '2007-03-19T00:06:13.996577', '12828', '1'), - ('4.99', '215', '2007-02-16T04:31:59.996577', '1599', '2'), - ('6.99', '467', '2007-04-11T14:30:01.996577', '6271', '2'), - ('4.99', '89', '2007-04-07T07:18:59.996577', '4152', '2'), - ('0.99', '212', '2007-03-18T10:08:35.996577', '12467', '2'), - ('2.99', '104', '2007-02-21T03:52:43.996577', '3273', '2'), - ('1.99', '404', '2007-04-11T06:02:14.996577', '6114', '1'), - ('3.99', '436', '2007-04-30T23:34:53.996577', '10216', '2'), - ('2.99', '527', '2007-03-02T08:20:12.996577', '11150', '1'), - ('6.99', '584', '2007-02-21T06:50:58.996577', '3317', '2'), - ('4.99', '78', '2007-04-30T00:27:50.996577', '8920', '2'), - ('0.99', '520', '2007-04-28T11:01:47.996577', '7936', '1'), - ('0.99', '570', '2007-04-07T03:03:32.996577', '4069', '1'), - ('4.99', '559', '2007-02-19T03:02:41.996577', '2576', '2'), - ('4.99', '422', '2007-04-30T00:08:40.996577', '9541', '2'), - ('0.99', '121', '2007-03-22T20:26:32.996577', '15369', '1'), - ('3.99', '457', '2007-03-22T11:25:52.996577', '15128', '1'), - ('0.99', '204', '2007-03-22T01:51:50.996577', '14871', '1'), - ('4.99', '251', '2007-03-23T14:51:34.996577', '15870', '2'), - ('4.99', '198', '2007-04-30T19:37:22.996577', '10112', '1'), - ('4.99', '597', '2007-04-09T16:02:37.996577', '5348', '1'), - ('5.99', '294', '2007-04-11T09:53:35.996577', '6185', '2'), - ('4.99', '486', '2007-02-17T12:15:18.996577', '2036', '1'), - ('3.99', '120', '2007-03-02T01:36:55.996577', '10940', '1'), - ('5.99', '6', '2007-03-23T01:19:50.996577', '15509', '1'), - ('3.99', '20', '2007-04-06T23:16:51.996577', '4011', '2'), - ('4.99', '5', '2007-03-01T13:17:11.996577', '10609', '2'), - ('8.99', '540', '2007-03-02T00:48:45.996577', '10924', '1'), - ('2.99', '243', '2007-03-18T00:55:46.996577', '12209', '1'), - ('4.99', '67', '2007-02-21T10:36:44.996577', '3359', '1'), - ('7.99', '589', '2007-03-18T20:40:13.996577', '12738', '1'), - ('7.99', '15', '2007-04-06T00:57:47.996577', '3550', '1'), - ('7.99', '296', '2007-03-23T14:47:28.996577', '15866', '2'), - ('5.99', '190', '2007-03-02T05:58:45.996577', '11082', '1'), - ('3.99', '594', '2007-04-30T05:53:01.996577', '9698', '1'), - ('4.99', '219', '2007-04-09T19:02:16.996577', '5416', '2'), - ('3.99', '540', '2007-02-21T09:05:49.996577', '3340', '1'), - ('4.99', '299', '2007-03-22T02:38:36.996577', '14889', '2'), - ('4.99', '587', '2007-03-17T23:15:04.996577', '12164', '2'), - ('3.99', '489', '2007-04-08T14:10:54.996577', '4774', '1'), - ('2.99', '366', '2007-04-27T20:53:41.996577', '7562', '1'), - ('2.99', '432', '2007-04-30T15:40:49.996577', '9984', '2'), - ('1.99', '444', '2007-02-15T17:22:47.996577', '1441', '2'), - ('2.99', '227', '2007-04-30T01:15:39.996577', '8936', '1'), - ('4.99', '308', '2007-03-17T16:24:12.996577', '11972', '1'), - ('2.99', '539', '2007-04-28T05:41:46.996577', '7781', '1'), - ('2.99', '42', '2007-02-17T13:55:59.996577', '2056', '2'), - ('0.99', '503', '2007-03-21T23:53:08.996577', '14823', '1'), - ('2.99', '173', '2007-04-29T01:24:26.996577', '8299', '2'), - ('0.99', '242', '2007-03-02T03:58:14.996577', '11020', '2'), - ('0.99', '145', '2007-04-28T11:53:31.996577', '7954', '2'), - ('4.99', '476', '2007-04-10T05:26:10.996577', '5644', '2'), - ('5.99', '259', '2007-02-18T13:15:55.996577', '2375', '2'), - ('3.99', '299', '2007-03-21T14:22:18.996577', '14548', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['30449', '20268', '26964', '17683', '20170', '18371', '29167', '28871', '23027', '22855', '19056', '18513', '26067', '28116', '18984', '21565', '26435', '20010', '18593', '22986', '19103', '18761', '20740', '23249', '24623', '24629', '21583', '25074', '20976', '31825', '20811', '30314', '28006', '18675', '29447', '18354', '19287', '26183', '26214', '28009', '22303', '31145', '24688', '32004', '23629', '18925', '27207', '24823', '19636', '25093', '18013', '28185', '23519', '27547', '31745', '19519', '31310', '24513', '27441', '18718', '31757', '20554', '22153', '20816', '21001', '20907', '25639', '22747', '19289', '24084', '25508', '19324', '25422', '24351', '19326', '30252', '30591', '25008', '31609', '18425', '27887', '28392', '28886', '22998', '31101', '22081', '31057', '28978', '30725', '28247', '17924', '31068', '29336', '28619', '25253', '29545', '17990', '28858', '30519', '31928']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('4.99', '129', '2007-04-06T17:49:54.996577', '3900', '2'), - ('2.99', '348', '2007-03-02T12:27:21.996577', '11262', '1'), - ('4.99', '425', '2007-04-09T17:16:14.996577', '5371', '1'), - ('0.99', '385', '2007-02-17T05:45:12.996577', '1937', '1'), - ('2.99', '338', '2007-03-17T23:28:28.996577', '12167', '1'), - ('5.99', '573', '2007-02-19T06:39:07.996577', '2622', '2'), - ('4.99', '16', '2007-04-08T01:13:45.996577', '4517', '2'), - ('2.99', '595', '2007-04-30T03:30:26.996577', '9631', '1'), - ('2.99', '35', '2007-03-21T00:00:17.996577', '14124', '2'), - ('8.99', '19', '2007-03-16T21:56:02.996577', '11508', '2'), - ('4.99', '144', '2007-02-19T15:26:08.996577', '2756', '1'), - ('3.99', '5', '2007-02-15T20:31:40.996577', '1502', '1'), - ('0.99', '347', '2007-04-06T03:55:41.996577', '3605', '2'), - ('3.99', '528', '2007-04-30T18:39:55.996577', '10084', '1'), - ('0.99', '123', '2007-02-17T06:59:01.996577', '1951', '2'), - ('2.99', '481', '2007-03-02T17:01:04.996577', '11387', '2'), - ('0.99', '377', '2007-04-07T10:53:03.996577', '4225', '1'), - ('5.99', '319', '2007-03-22T21:36:23.996577', '15396', '2'), - ('4.99', '25', '2007-02-21T19:21:57.996577', '3447', '1'), - ('4.99', '30', '2007-03-22T09:08:17.996577', '15063', '1'), - ('4.99', '155', '2007-02-19T22:37:51.996577', '2869', '1'), - ('3.99', '66', '2007-02-21T08:32:59.996577', '3334', '1'), - ('5.99', '396', '2007-03-21T22:24:56.996577', '14778', '2'), - ('4.99', '59', '2007-03-02T17:16:55.996577', '11396', '2'), - ('2.99', '208', '2007-03-02T18:54:45.996577', '11442', '2'), - ('0.99', '209', '2007-03-17T18:27:32.996577', '12025', '1'), - ('0.99', '482', '2007-03-22T21:30:11.996577', '15391', '1'), - ('6.99', '259', '2007-03-18T18:12:12.996577', '12680', '2'), - ('2.99', '419', '2007-03-02T18:27:14.996577', '11425', '1'), - ('4.99', '259', '2007-04-07T23:52:24.996577', '4489', '2'), - ('4.99', '404', '2007-03-19T21:35:50.996577', '13422', '1'), - ('5.99', '117', '2007-04-09T23:14:14.996577', '5506', '2'), - ('4.99', '520', '2007-04-05T21:41:48.996577', '3482', '2'), - ('4.99', '42', '2007-02-18T06:55:59.996577', '2302', '1'), - ('6.99', '40', '2007-04-30T14:36:16.996577', '9961', '2'), - ('4.99', '570', '2007-02-15T05:06:21.996577', '1259', '1'), - ('4.99', '201', '2007-02-20T15:46:32.996577', '3106', '1'), - ('1.99', '356', '2007-04-28T04:52:07.996577', '7758', '1'), - ('0.99', '359', '2007-04-27T03:29:34.996577', '7098', '2'), - ('4.99', '520', '2007-04-10T13:22:01.996577', '5799', '2'), - ('1.99', '563', '2007-03-17T18:57:34.996577', '12039', '1'), - ('5.99', '190', '2007-04-06T22:50:52.996577', '4005', '2'), - ('1.99', '215', '2007-03-18T06:55:54.996577', '12380', '1'), - ('4.99', '585', '2007-05-14T13:44:29.996577', '14604', '2'), - ('4.99', '101', '2007-03-18T10:25:26.996577', '12471', '1'), - ('6.99', '109', '2007-02-18T00:19:48.996577', '2198', '2'), - ('9.99', '446', '2007-04-30T00:36:51.996577', '8922', '2'), - ('6.99', '232', '2007-03-01T10:51:26.996577', '10539', '1'), - ('5.99', '277', '2007-03-18T09:51:19.996577', '12458', '1'), - ('2.99', '260', '2007-03-21T10:28:04.996577', '14441', '2'), - ('2.99', '471', '2007-02-15T17:47:42.996577', '1449', '2'), - ('0.99', '534', '2007-04-29T12:48:19.996577', '8633', '2'), - ('5.99', '86', '2007-03-23T17:13:32.996577', '15940', '2'), - ('7.99', '479', '2007-04-11T03:44:46.996577', '6084', '2'), - ('6.99', '251', '2007-04-11T21:54:37.996577', '6413', '2'), - ('2.99', '267', '2007-03-01T03:44:13.996577', '10343', '1'), - ('10.99', '212', '2007-04-08T10:27:45.996577', '4708', '2'), - ('0.99', '190', '2007-03-18T07:00:09.996577', '12381', '2'), - ('2.99', '469', '2007-04-30T10:42:29.996577', '9187', '1'), - ('4.99', '54', '2007-02-16T00:47:28.996577', '1556', '1'), - ('0.99', '252', '2007-04-27T06:19:37.996577', '7168', '2'), - ('0.99', '377', '2007-03-19T16:22:04.996577', '13275', '1'), - ('4.99', '546', '2007-03-17T09:45:47.996577', '11797', '1'), - ('0.99', '404', '2007-03-22T09:52:35.996577', '15087', '2'), - ('1.99', '422', '2007-03-19T14:04:31.996577', '13216', '2'), - ('4.99', '413', '2007-03-20T14:07:26.996577', '13887', '2'), - ('8.99', '308', '2007-04-07T14:03:01.996577', '4285', '1'), - ('4.99', '7', '2007-03-01T10:07:52.996577', '10514', '1'), - ('4.99', '209', '2007-02-15T00:34:54.996577', '1201', '2'), - ('0.99', '147', '2007-03-21T01:03:42.996577', '14156', '1'), - ('2.99', '297', '2007-04-11T01:30:54.996577', '6036', '2'), - ('2.99', '217', '2007-02-15T09:23:35.996577', '1322', '1'), - ('1.99', '290', '2007-04-30T23:02:18.996577', '10194', '1'), - ('8.99', '174', '2007-03-01T11:31:24.996577', '10559', '1'), - ('4.99', '217', '2007-02-19T21:02:46.996577', '2842', '1'), - ('2.99', '112', '2007-04-09T17:46:37.996577', '5385', '1'), - ('0.99', '141', '2007-04-07T14:52:35.996577', '4297', '2'), - ('5.99', '253', '2007-03-18T23:55:49.996577', '12827', '2'), - ('8.99', '238', '2007-04-29T01:54:22.996577', '8310', '1'), - ('7.99', '588', '2007-02-18T04:57:27.996577', '2270', '2'), - ('7.99', '508', '2007-04-27T12:21:52.996577', '7327', '2'), - ('4.99', '556', '2007-04-30T19:29:13.996577', '10106', '2'), - ('0.99', '597', '2007-04-30T23:32:41.996577', '10214', '1'), - ('0.99', '32', '2007-03-20T21:47:20.996577', '14075', '1'), - ('2.99', '185', '2007-04-26T22:43:44.996577', '6965', '1'), - ('8.99', '537', '2007-03-23T13:50:01.996577', '15832', '1'), - ('4.99', '181', '2007-04-27T23:31:06.996577', '7632', '1'), - ('5.99', '207', '2007-04-29T19:47:25.996577', '8800', '1'), - ('5.99', '152', '2007-04-30T03:40:30.996577', '9010', '1'), - ('7.99', '539', '2007-04-30T08:29:32.996577', '9777', '1'), - ('3.99', '451', '2007-02-20T01:47:36.996577', '2909', '1'), - ('1.99', '182', '2007-04-08T01:08:25.996577', '4513', '2'), - ('2.99', '31', '2007-04-27T17:18:08.996577', '7464', '2'), - ('3.99', '576', '2007-04-10T03:16:23.996577', '5597', '2'), - ('5.99', '277', '2007-04-06T10:24:01.996577', '3740', '2'), - ('8.99', '49', '2007-04-28T04:01:42.996577', '7742', '2'), - ('8.99', '465', '2007-02-17T22:05:55.996577', '2159', '1'), - ('1.99', '595', '2007-04-10T04:44:11.996577', '5631', '1'), - ('3.99', '135', '2007-04-11T06:08:04.996577', '6117', '1'), - ('2.99', '296', '2007-05-14T13:44:29.996577', '12009', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['22040', '20943', '30809', '18553', '18973', '31725', '31427', '21761', '22500', '23556', '22226', '22688', '17822', '28692', '24669', '19035', '31982', '20262', '29140', '25873', '29076', '26966', '25205', '25200', '31417', '19986', '28019', '29857', '26700', '25799', '21338', '27729', '18428', '27561', '28576', '19285', '29135', '24216', '31931', '24639', '28882', '25472', '21878', '26086', '18096', '31499', '22416', '21349', '25414', '30750', '18162', '27997', '18240', '22426', '20825', '30557', '25079', '29021', '22824', '28122', '18854', '30983', '17597', '31215', '19676', '28541', '26350', '29399', '24719', '29201', '28007', '24678', '24150', '24213', '23732', '27826', '30487', '26242', '25985', '22013', '25880', '25789', '29580', '31309', '18303', '27668', '26334', '28868', '20157', '18589', '23386', '24644', '19767', '31199', '22952', '22977', '18210', '27921', '19259', '28391']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('7.99', '533', '2007-03-21T04:36:41.996577', '14263', '1'), - ('7.99', '417', '2007-03-02T10:54:57.996577', '11217', '1'), - ('4.99', '159', '2007-04-30T13:23:37.996577', '9917', '1'), - ('0.99', '15', '2007-02-20T21:20:44.996577', '3182', '2'), - ('1.99', '121', '2007-02-16T21:13:29.996577', '1833', '1'), - ('9.99', '249', '2007-04-07T17:44:24.996577', '4352', '1'), - ('4.99', '224', '2007-04-11T01:10:40.996577', '6031', '1'), - ('2.99', '503', '2007-03-22T03:20:39.996577', '14913', '1'), - ('5.99', '584', '2007-03-20T23:03:47.996577', '14102', '2'), - ('0.99', '91', '2007-03-19T00:32:33.996577', '12847', '1'), - ('3.99', '554', '2007-03-20T22:58:58.996577', '14098', '1'), - ('1.99', '1', '2007-03-21T23:56:23.996577', '14825', '1'), - ('6.99', '426', '2007-02-16T12:38:41.996577', '1709', '1'), - ('2.99', '581', '2007-04-10T13:56:22.996577', '5812', '2'), - ('4.99', '213', '2007-03-19T19:23:49.996577', '13354', '1'), - ('7.99', '138', '2007-02-19T13:43:21.996577', '2731', '1'), - ('5.98', '516', '2007-05-14T13:44:29.996577', '12130', '1'), - ('4.99', '347', '2007-03-22T02:45:22.996577', '14894', '2'), - ('7.99', '13', '2007-04-30T07:27:06.996577', '9736', '1'), - ('2.99', '330', '2007-04-09T06:56:49.996577', '5149', '2'), - ('3.99', '8', '2007-04-07T20:15:55.996577', '4409', '2'), - ('2.99', '425', '2007-04-12T06:21:21.996577', '6603', '1'), - ('2.99', '272', '2007-04-28T00:37:38.996577', '7658', '2'), - ('4.99', '271', '2007-04-30T10:16:20.996577', '9821', '1'), - ('5.99', '223', '2007-04-05T23:14:23.996577', '3513', '1'), - ('2.99', '316', '2007-03-18T23:44:13.996577', '12823', '2'), - ('0.99', '520', '2007-04-30T18:19:03.996577', '10072', '1'), - ('1.99', '78', '2007-04-09T03:48:50.996577', '5078', '1'), - ('7.99', '402', '2007-04-29T08:41:11.996577', '8521', '2'), - ('3.99', '323', '2007-04-12T17:31:48.996577', '6840', '1'), - ('6.99', '459', '2007-03-01T00:22:49.996577', '10233', '1'), - ('7.99', '494', '2007-04-30T22:52:43.996577', '9510', '2'), - ('4.99', '589', '2007-02-15T17:13:58.996577', '1439', '1'), - ('9.99', '480', '2007-04-28T10:13:22.996577', '7910', '2'), - ('0.99', '573', '2007-04-06T11:35:56.996577', '3768', '2'), - ('3.99', '201', '2007-02-17T21:59:18.996577', '2157', '1'), - ('2.99', '13', '2007-04-29T00:07:19.996577', '8277', '1'), - ('0.99', '159', '2007-03-20T15:45:33.996577', '13933', '1'), - ('0.99', '317', '2007-05-14T13:44:29.996577', '12574', '1'), - ('7.99', '210', '2007-03-21T01:44:56.996577', '14181', '1'), - ('2.99', '597', '2007-04-12T02:03:16.996577', '6508', '1'), - ('4.99', '294', '2007-04-30T23:41:48.996577', '10220', '2'), - ('0.99', '515', '2007-03-21T09:36:43.996577', '14414', '2'), - ('9.99', '348', '2007-04-08T03:17:07.996577', '4556', '2'), - ('7.99', '495', '2007-02-19T01:15:05.996577', '2549', '1'), - ('3.99', '230', '2007-04-08T01:01:04.996577', '4509', '1'), - ('7.99', '575', '2007-03-18T00:49:01.996577', '12204', '1'), - ('0.99', '459', '2007-03-23T13:21:16.996577', '15814', '1'), - ('4.99', '290', '2007-04-12T16:47:16.996577', '6816', '2'), - ('1.99', '155', '2007-04-09T05:54:20.996577', '5128', '1'), - ('3.99', '514', '2007-02-17T10:08:24.996577', '2002', '1'), - ('0.99', '519', '2007-04-11T02:45:17.996577', '6063', '2'), - ('4.99', '534', '2007-02-20T23:48:03.996577', '3216', '1'), - ('4.99', '576', '2007-03-18T02:15:06.996577', '12245', '1'), - ('4.99', '405', '2007-03-21T04:57:46.996577', '14274', '1'), - ('1.99', '138', '2007-04-10T03:24:11.996577', '5600', '1'), - ('4.99', '259', '2007-03-20T06:17:04.996577', '13649', '2'), - ('5.99', '3', '2007-04-27T03:23:08.996577', '7096', '1'), - ('5.99', '15', '2007-03-19T20:32:12.996577', '13393', '1'), - ('6.99', '529', '2007-04-12T03:18:52.996577', '6538', '2'), - ('6.99', '90', '2007-02-19T03:31:02.996577', '2584', '2'), - ('7.99', '175', '2007-04-12T18:31:06.996577', '6865', '2'), - ('2.99', '364', '2007-02-16T13:41:18.996577', '1722', '1'), - ('4.99', '197', '2007-04-30T01:34:21.996577', '9585', '2'), - ('4.99', '280', '2007-03-19T18:09:03.996577', '13321', '1'), - ('0.99', '570', '2007-04-06T21:51:02.996577', '3984', '2'), - ('0.99', '370', '2007-04-12T11:57:32.996577', '6714', '2'), - ('7.99', '37', '2007-04-05T21:24:59.996577', '3472', '2'), - ('4.99', '218', '2007-03-22T00:42:45.996577', '14848', '2'), - ('2.99', '20', '2007-04-11T13:38:44.996577', '6254', '1'), - ('7.99', '520', '2007-04-05T22:32:46.996577', '3499', '1'), - ('9.99', '214', '2007-03-19T19:12:26.996577', '13350', '2'), - ('0.99', '152', '2007-03-19T23:45:18.996577', '13484', '2'), - ('5.99', '158', '2007-03-23T12:55:17.996577', '15802', '1'), - ('0.99', '114', '2007-03-18T05:10:25.996577', '12326', '2'), - ('4.99', '502', '2007-04-30T02:00:32.996577', '9599', '1'), - ('5.99', '132', '2007-04-08T03:17:41.996577', '4557', '1'), - ('2.99', '361', '2007-04-28T02:58:19.996577', '7712', '2'), - ('2.99', '339', '2007-04-06T00:04:37.996577', '3536', '2'), - ('4.99', '531', '2007-03-02T04:14:31.996577', '11026', '2'), - ('4.99', '330', '2007-04-30T19:15:44.996577', '10100', '2'), - ('4.99', '322', '2007-04-12T11:49:07.996577', '6709', '2'), - ('0.99', '52', '2007-04-09T14:27:04.996577', '5308', '1'), - ('0.99', '211', '2007-04-30T14:25:01.996577', '9953', '1'), - ('6.99', '556', '2007-02-17T16:40:42.996577', '2092', '1'), - ('0.99', '488', '2007-04-30T23:51:26.996577', '9537', '1'), - ('2.99', '368', '2007-04-28T22:29:30.996577', '8226', '2'), - ('4.99', '595', '2007-04-30T17:01:17.996577', '9354', '1'), - ('3.99', '337', '2007-03-17T07:02:48.996577', '11734', '1'), - ('2.99', '25', '2007-02-15T12:38:21.996577', '1365', '1'), - ('4.99', '73', '2007-03-20T14:03:09.996577', '13886', '1'), - ('2.99', '211', '2007-03-01T07:30:41.996577', '10445', '1'), - ('4.99', '292', '2007-03-22T00:41:10.996577', '14845', '2'), - ('3.99', '196', '2007-04-28T01:03:38.996577', '7666', '2'), - ('6.99', '28', '2007-03-01T02:16:38.996577', '10294', '2'), - ('5.99', '29', '2007-03-22T06:21:26.996577', '14997', '1'), - ('2.99', '526', '2007-02-17T08:32:00.996577', '1981', '1'), - ('4.99', '511', '2007-04-28T14:34:04.996577', '8026', '1'), - ('0.99', '196', '2007-02-16T04:32:38.996577', '1600', '2'), - ('5.99', '556', '2007-04-29T23:56:29.996577', '8909', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['28946', '25798', '22833', '26568', '32003', '26776', '28831', '17935', '17742', '31211', '18470', '29026', '30125', '27446', '25538', '29873', '25797', '20161', '24509', '30497', '21110', '29040', '30703', '28597', '29124', '24572', '23683', '17568', '24438', '22793', '28024', '23980', '22842', '27867', '23233', '21342', '25968', '22028', '26348', '24821', '31074', '18818', '21054', '26942', '27928', '31986', '30315', '23774', '27830', '22230', '20667', '19072', '23454', '26134', '22494', '30493', '19410', '19875', '27589', '26780', '19623', '24655', '19161', '22059', '20624', '19633', '31162', '24187', '32023', '21429', '22813', '25549', '17964', '19687', '25201', '19668', '30532', '17921', '22435', '22953', '20012', '23780', '31350', '27282', '23736', '24209', '27628', '25588', '20861', '28326', '24019', '29541', '23707', '19905', '19583', '29823', '23210', '20765', '21245', '23721']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('7.99', '205', '2007-04-07T18:57:23.996577', '4377', '2'), - ('1.99', '323', '2007-04-10T19:10:07.996577', '5906', '2'), - ('2.99', '16', '2007-03-01T16:21:28.996577', '10687', '2'), - ('2.99', '390', '2007-04-07T15:59:22.996577', '4310', '2'), - ('2.99', '582', '2007-05-14T13:44:29.996577', '12127', '2'), - ('4.99', '408', '2007-04-28T23:18:40.996577', '8251', '2'), - ('0.99', '593', '2007-04-08T06:31:48.996577', '4623', '2'), - ('7.99', '453', '2007-02-19T21:38:07.996577', '2853', '1'), - ('6.99', '400', '2007-02-17T04:34:36.996577', '1923', '2'), - ('0.99', '197', '2007-04-09T15:55:31.996577', '5344', '2'), - ('0.99', '202', '2007-02-20T08:51:51.996577', '3008', '1'), - ('4.99', '3', '2007-04-28T16:45:40.996577', '8086', '2'), - ('5.99', '101', '2007-04-11T22:40:28.996577', '6433', '2'), - ('4.99', '470', '2007-04-07T18:39:25.996577', '4373', '1'), - ('0.99', '299', '2007-04-30T23:10:44.996577', '10201', '1'), - ('2.99', '79', '2007-04-10T01:37:21.996577', '5555', '1'), - ('4.99', '323', '2007-04-10T06:41:19.996577', '5669', '2'), - ('3.99', '337', '2007-03-20T14:18:43.996577', '13892', '2'), - ('6.99', '190', '2007-03-02T14:25:17.996577', '11312', '2'), - ('6.99', '133', '2007-04-08T00:50:44.996577', '4506', '2'), - ('4.99', '436', '2007-03-17T02:23:01.996577', '11615', '2'), - ('5.99', '5', '2007-04-09T05:42:18.996577', '5118', '2'), - ('4.99', '149', '2007-04-27T20:48:29.996577', '7559', '2'), - ('3.99', '574', '2007-04-09T03:46:27.996577', '5077', '1'), - ('0.99', '12', '2007-04-30T03:03:17.996577', '8985', '2'), - ('3.99', '197', '2007-03-20T15:06:01.996577', '13913', '2'), - ('2.99', '108', '2007-03-17T08:09:49.996577', '11759', '2'), - ('6.99', '357', '2007-02-17T21:26:30.996577', '2153', '2'), - ('4.99', '182', '2007-03-18T14:01:23.996577', '12573', '1'), - ('2.99', '12', '2007-03-20T14:26:54.996577', '13895', '2'), - ('6.99', '521', '2007-04-10T02:34:15.996577', '5580', '2'), - ('2.99', '138', '2007-03-19T01:34:07.996577', '12873', '2'), - ('8.99', '16', '2007-03-21T13:14:00.996577', '14511', '1'), - ('0.99', '507', '2007-04-07T21:29:24.996577', '4440', '2'), - ('0.99', '57', '2007-03-19T11:58:12.996577', '13163', '2'), - ('6.99', '459', '2007-03-18T12:17:12.996577', '12527', '1'), - ('0.99', '337', '2007-04-11T11:09:14.996577', '6212', '1'), - ('4.99', '532', '2007-03-19T15:22:27.996577', '13254', '1'), - ('4.99', '369', '2007-04-30T15:17:57.996577', '9973', '1'), - ('2.99', '231', '2007-03-21T23:21:34.996577', '14806', '2'), - ('4.99', '182', '2007-04-28T08:59:03.996577', '7880', '2'), - ('5.99', '83', '2007-02-16T03:41:03.996577', '1591', '1'), - ('2.99', '429', '2007-03-18T02:43:01.996577', '12259', '1'), - ('0.99', '424', '2007-04-08T03:25:15.996577', '4559', '2'), - ('3.99', '512', '2007-04-10T14:03:03.996577', '5813', '2'), - ('2.99', '527', '2007-05-14T13:44:29.996577', '14267', '1'), - ('0.99', '117', '2007-04-10T06:50:20.996577', '5673', '1'), - ('0.99', '118', '2007-03-23T10:01:51.996577', '15731', '1'), - ('6.99', '503', '2007-04-10T20:09:53.996577', '5925', '1'), - ('3.99', '555', '2007-03-02T00:42:59.996577', '10921', '1'), - ('2.99', '389', '2007-03-02T01:52:30.996577', '10949', '1'), - ('5.99', '147', '2007-02-20T09:07:36.996577', '3011', '2'), - ('0.99', '80', '2007-03-19T20:34:06.996577', '13395', '2'), - ('5.99', '352', '2007-04-11T17:39:04.996577', '6329', '2'), - ('4.99', '584', '2007-03-02T10:47:01.996577', '11213', '1'), - ('6.99', '132', '2007-04-11T12:49:14.996577', '6239', '1'), - ('2.99', '241', '2007-02-19T10:55:45.996577', '2683', '2'), - ('5.99', '303', '2007-03-21T21:37:58.996577', '14750', '1'), - ('6.99', '482', '2007-04-30T12:00:57.996577', '9874', '2'), - ('4.99', '408', '2007-04-30T07:53:40.996577', '9757', '2'), - ('4.99', '276', '2007-03-17T03:04:57.996577', '11636', '1'), - ('7.99', '211', '2007-03-22T21:48:10.996577', '15404', '1'), - ('2.99', '173', '2007-02-19T04:38:34.996577', '2602', '1'), - ('0.99', '535', '2007-03-18T20:26:16.996577', '12732', '1'), - ('4.99', '384', '2007-03-22T18:48:30.996577', '15321', '2'), - ('4.99', '277', '2007-03-02T08:36:20.996577', '11162', '2'), - ('4.99', '192', '2007-04-07T22:46:58.996577', '4469', '1'), - ('1.99', '156', '2007-03-21T23:07:57.996577', '14794', '1'), - ('5.98', '42', '2007-05-14T13:44:29.996577', '13351', '1'), - ('2.99', '467', '2007-03-21T09:06:43.996577', '14402', '1'), - ('0.99', '14', '2007-03-22T20:36:37.996577', '15373', '1'), - ('3.99', '300', '2007-04-29T00:20:48.996577', '8283', '1'), - ('0.99', '457', '2007-02-19T18:21:56.996577', '2811', '1'), - ('4.99', '282', '2007-03-23T02:44:07.996577', '15543', '2'), - ('7.99', '271', '2007-04-30T20:40:09.996577', '10143', '2'), - ('6.99', '279', '2007-03-23T04:07:32.996577', '15580', '2'), - ('3.99', '136', '2007-04-11T07:22:35.996577', '6142', '2'), - ('0.99', '451', '2007-02-16T23:00:52.996577', '1851', '1'), - ('7.99', '577', '2007-03-02T05:01:33.996577', '11054', '1'), - ('2.99', '28', '2007-03-02T19:01:21.996577', '11444', '1'), - ('2.99', '320', '2007-03-16T23:48:56.996577', '11560', '2'), - ('2.99', '119', '2007-03-18T14:06:57.996577', '12576', '2'), - ('2.99', '217', '2007-04-10T02:25:31.996577', '5576', '2'), - ('2.99', '454', '2007-04-29T07:14:23.996577', '8481', '2'), - ('4.99', '114', '2007-03-22T01:43:12.996577', '14867', '1'), - ('2.99', '158', '2007-03-20T15:37:53.996577', '13926', '1'), - ('4.99', '485', '2007-04-30T05:36:05.996577', '9053', '1'), - ('6.99', '304', '2007-04-07T22:41:19.996577', '4466', '1'), - ('0.99', '409', '2007-03-19T00:08:51.996577', '12830', '2'), - ('7.99', '549', '2007-04-27T09:13:54.996577', '7252', '1'), - ('4.99', '141', '2007-03-22T07:11:11.996577', '15013', '1'), - ('6.99', '49', '2007-04-11T14:54:33.996577', '6279', '1'), - ('0.99', '111', '2007-03-22T04:40:42.996577', '14949', '1'), - ('4.99', '306', '2007-03-20T18:14:09.996577', '13996', '1'), - ('4.99', '273', '2007-03-20T22:42:58.996577', '14092', '2'), - ('0.99', '75', '2007-04-12T00:38:02.996577', '6486', '1'), - ('4.99', '54', '2007-03-21T03:02:37.996577', '14215', '1'), - ('4.99', '399', '2007-03-19T15:22:22.996577', '13253', '1'), - ('4.99', '449', '2007-03-18T01:01:55.996577', '12212', '1'), - ('2.99', '112', '2007-03-23T11:15:31.996577', '15756', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['18198', '30007', '21482', '19566', '21659', '22840', '25878', '19658', '30230', '23937', '26184', '27324', '28152', '28850', '31142', '19612', '21293', '18226', '30615', '24774', '22987', '26711', '30620', '24254', '23441', '20873', '29474', '26975', '28710', '24810', '27530', '30799', '29705', '25109', '21213', '24969', '25387', '29950', '18309', '25303', '25678', '23116', '19773', '25001', '27832', '28873', '21441', '24427', '20953', '28164', '24023', '22815', '30216', '25893', '17887', '24417', '19350', '18920', '27817', '31343', '29121', '30283', '20061', '25133', '19139', '22188', '30295', '29171', '21242', '27708', '20426', '27819', '26145', '22484', '22876', '24439', '29302', '28856', '18125', '22860', '31948', '27470', '28219', '21947', '27262', '25769', '21118', '20574', '23036', '27737', '26206', '22563', '26979', '30246', '26089', '22993', '22377', '24028', '19996', '23448']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('6.99', '523', '2007-02-16T13:58:13.996577', '1729', '2'), - ('4.99', '91', '2007-04-08T08:44:26.996577', '4673', '1'), - ('2.99', '471', '2007-03-21T13:56:41.996577', '14538', '2'), - ('4.99', '271', '2007-03-21T07:36:55.996577', '14355', '2'), - ('4.99', '492', '2007-03-19T05:11:09.996577', '12971', '2'), - ('4.99', '16', '2007-03-19T20:30:08.996577', '13391', '1'), - ('2.99', '330', '2007-04-28T09:22:24.996577', '7894', '2'), - ('4.99', '279', '2007-03-17T05:47:55.996577', '11703', '1'), - ('6.99', '109', '2007-04-12T21:01:24.996577', '6920', '2'), - ('7.99', '134', '2007-03-18T21:06:07.996577', '12754', '1'), - ('0.99', '356', '2007-04-28T09:42:45.996577', '7902', '1'), - ('3.99', '459', '2007-04-12T13:18:05.996577', '6750', '2'), - ('0.99', '531', '2007-04-30T01:35:14.996577', '8943', '2'), - ('5.99', '594', '2007-04-29T20:43:22.996577', '8820', '2'), - ('5.99', '189', '2007-04-30T10:04:50.996577', '9171', '2'), - ('0.99', '275', '2007-03-20T14:35:34.996577', '13902', '2'), - ('8.99', '454', '2007-03-20T00:10:55.996577', '13496', '2'), - ('2.99', '530', '2007-02-17T22:04:53.996577', '2158', '1'), - ('4.99', '143', '2007-04-11T11:02:50.996577', '6207', '2'), - ('4.99', '225', '2007-03-02T18:48:32.996577', '11437', '2'), - ('4.99', '30', '2007-03-23T02:46:22.996577', '15544', '1'), - ('2.99', '403', '2007-04-30T05:44:11.996577', '9058', '1'), - ('6.99', '144', '2007-04-08T11:19:20.996577', '4726', '1'), - ('2.99', '163', '2007-03-19T05:16:37.996577', '12973', '2'), - ('2.99', '78', '2007-03-23T20:47:17.996577', '16039', '2'), - ('4.99', '410', '2007-03-19T23:16:50.996577', '13460', '1'), - ('2.99', '42', '2007-04-28T19:51:59.996577', '8166', '1'), - ('4.99', '426', '2007-04-08T19:06:32.996577', '4900', '1'), - ('4.99', '583', '2007-04-07T22:35:44.996577', '4464', '1'), - ('5.99', '230', '2007-03-20T21:41:23.996577', '14073', '1'), - ('10.99', '477', '2007-04-28T09:54:05.996577', '7904', '2'), - ('2.99', '158', '2007-04-30T09:31:39.996577', '9801', '1'), - ('4.99', '64', '2007-04-29T11:32:53.996577', '8602', '2'), - ('4.99', '262', '2007-03-21T01:44:41.996577', '14180', '1'), - ('2.99', '445', '2007-03-23T16:04:26.996577', '15906', '2'), - ('4.99', '247', '2007-03-23T12:14:10.996577', '15783', '1'), - ('3.99', '288', '2007-04-06T20:35:59.996577', '3958', '1'), - ('7.99', '87', '2007-04-09T04:01:53.996577', '5084', '1'), - ('6.99', '557', '2007-02-20T07:27:34.996577', '2988', '2'), - ('2.99', '282', '2007-04-06T17:12:09.996577', '3885', '1'), - ('3.99', '312', '2007-04-08T07:56:02.996577', '4647', '1'), - ('3.99', '45', '2007-03-19T18:47:05.996577', '13340', '1'), - ('5.99', '293', '2007-03-20T00:30:14.996577', '13504', '2'), - ('4.99', '252', '2007-03-19T20:08:01.996577', '13385', '1'), - ('2.99', '503', '2007-04-12T02:59:30.996577', '6529', '1'), - ('3.99', '596', '2007-04-10T10:24:44.996577', '5742', '2'), - ('9.99', '468', '2007-03-21T06:12:43.996577', '14309', '1'), - ('0.99', '181', '2007-03-18T08:16:23.996577', '12411', '1'), - ('2.99', '417', '2007-03-22T02:20:47.996577', '14882', '2'), - ('4.99', '532', '2007-04-27T07:05:21.996577', '7192', '1'), - ('5.99', '142', '2007-03-02T12:01:50.996577', '11244', '2'), - ('2.99', '15', '2007-03-02T07:12:44.996577', '11118', '1'), - ('1.99', '108', '2007-04-07T15:25:58.996577', '4303', '1'), - ('6.99', '331', '2007-04-30T22:48:07.996577', '10188', '2'), - ('2.99', '442', '2007-02-16T16:56:18.996577', '1774', '1'), - ('0.99', '180', '2007-03-20T23:21:24.996577', '14109', '1'), - ('6.99', '227', '2007-02-17T22:14:47.996577', '2164', '1'), - ('8.99', '108', '2007-02-17T14:15:26.996577', '2061', '1'), - ('8.99', '502', '2007-04-12T13:44:26.996577', '6760', '1'), - ('4.99', '215', '2007-04-30T02:23:09.996577', '9611', '2'), - ('2.99', '12', '2007-04-12T14:24:05.996577', '6773', '1'), - ('2.99', '114', '2007-04-27T17:16:13.996577', '7462', '2'), - ('0.99', '327', '2007-03-01T04:48:55.996577', '10371', '1'), - ('2.99', '264', '2007-03-20T04:17:25.996577', '13590', '2'), - ('5.99', '166', '2007-02-19T23:10:52.996577', '2874', '1'), - ('4.99', '550', '2007-03-21T00:01:58.996577', '14127', '2'), - ('0.99', '115', '2007-04-11T20:03:46.996577', '6373', '1'), - ('5.99', '16', '2007-04-29T06:13:26.996577', '8452', '2'), - ('4.99', '449', '2007-03-01T06:37:05.996577', '10416', '1'), - ('7.99', '493', '2007-04-12T03:30:27.996577', '6549', '1'), - ('8.99', '365', '2007-03-18T23:01:41.996577', '12804', '1'), - ('8.99', '502', '2007-04-26T21:20:19.996577', '6924', '2'), - ('3.99', '353', '2007-04-28T13:25:07.996577', '7993', '2'), - ('2.99', '582', '2007-03-23T01:13:15.996577', '15503', '1'), - ('2.99', '20', '2007-03-22T23:39:08.996577', '15460', '1'), - ('6.99', '182', '2007-03-19T00:22:37.996577', '12840', '1'), - ('3.99', '29', '2007-04-27T08:41:02.996577', '7237', '2'), - ('4.99', '595', '2007-04-07T12:07:26.996577', '4241', '1'), - ('0.99', '503', '2007-02-21T17:14:34.996577', '3430', '2'), - ('8.99', '19', '2007-03-20T11:14:58.996577', '13804', '2'), - ('0.99', '369', '2007-05-14T13:44:29.996577', '13898', '1'), - ('2.99', '472', '2007-04-09T14:39:59.996577', '5318', '2'), - ('4.99', '537', '2007-04-28T06:29:04.996577', '7810', '2'), - ('2.99', '523', '2007-03-19T10:39:29.996577', '13133', '1'), - ('2.99', '452', '2007-04-26T22:36:17.996577', '6959', '2'), - ('4.99', '320', '2007-04-28T22:51:22.996577', '8235', '2'), - ('0.99', '436', '2007-03-20T11:35:49.996577', '13814', '1'), - ('4.99', '379', '2007-03-22T23:17:50.996577', '15446', '1'), - ('1.99', '36', '2007-03-20T03:03:12.996577', '13564', '2'), - ('1.99', '495', '2007-04-29T04:05:13.996577', '8383', '1'), - ('2.99', '358', '2007-04-29T12:21:08.996577', '8621', '1'), - ('0.99', '592', '2007-03-17T19:06:47.996577', '12043', '2'), - ('4.99', '426', '2007-04-28T02:55:08.996577', '7711', '1'), - ('0.99', '111', '2007-04-07T14:05:10.996577', '4286', '2'), - ('8.99', '348', '2007-04-08T15:30:14.996577', '4807', '1'), - ('4.99', '32', '2007-03-02T07:50:51.996577', '11135', '1'), - ('3.99', '570', '2007-03-02T06:34:44.996577', '11098', '1'), - ('4.99', '142', '2007-03-20T23:39:43.996577', '14116', '2'), - ('0.99', '317', '2007-03-21T08:31:21.996577', '14385', '2'), - ('8.99', '80', '2007-03-01T16:34:20.996577', '10690', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['19597', '26077', '23256', '28754', '20851', '21609', '24806', '25732', '30838', '24611', '24504', '27325', '28079', '25846', '29745', '24526', '20393', '28457', '22359', '29698', '22078', '28172', '18305', '20768', '30720', '22607', '30697', '28353', '28465', '28967', '23434', '19328', '19150', '20164', '23781', '18010', '19475', '25159', '23920', '20382', '30129', '20842', '21834', '30971', '27682', '23172', '22265', '30336', '19141', '29679', '30167', '25139', '18424', '30599', '24261', '24648', '20671', '25399', '21322', '28827', '18223', '29321', '19584', '30612', '18416', '22151', '31379', '22285', '31048', '30010', '23610', '20790', '21258', '27524', '28376', '29716', '19957', '21033', '21699', '24053', '18161', '31225', '20987', '25773', '17552', '28653', '27384', '18289', '23709', '20606', '30918', '30494', '30530', '21706', '17986', '26729', '22859', '29106', '28466', '21826']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('7.99', '274', '2007-03-20T21:14:24.996577', '14066', '1'), - ('4.99', '347', '2007-04-28T20:10:34.996577', '8176', '2'), - ('5.99', '59', '2007-03-22T17:17:14.996577', '15271', '2'), - ('6.99', '587', '2007-04-12T09:57:40.996577', '6665', '2'), - ('4.99', '408', '2007-03-18T05:32:50.996577', '12338', '1'), - ('0.99', '486', '2007-03-18T10:03:28.996577', '12465', '1'), - ('1.99', '230', '2007-03-17T20:32:43.996577', '12079', '1'), - ('0.99', '317', '2007-04-07T06:45:39.996577', '4138', '1'), - ('4.99', '163', '2007-04-10T01:26:55.996577', '5549', '2'), - ('0.99', '201', '2007-03-01T23:38:21.996577', '10891', '1'), - ('1.99', '189', '2007-03-23T11:53:23.996577', '15773', '1'), - ('6.99', '459', '2007-04-27T23:06:07.996577', '7623', '1'), - ('6.99', '526', '2007-04-07T20:39:54.996577', '4423', '1'), - ('0.99', '327', '2007-04-08T01:26:22.996577', '4521', '1'), - ('4.99', '68', '2007-04-12T02:11:15.996577', '6512', '1'), - ('7.99', '192', '2007-03-21T03:45:06.996577', '14238', '2'), - ('6.99', '361', '2007-03-23T11:16:03.996577', '15759', '1'), - ('2.99', '562', '2007-04-27T15:54:40.996577', '7430', '1'), - ('2.99', '568', '2007-03-22T14:56:26.996577', '15203', '1'), - ('2.99', '64', '2007-04-11T20:03:32.996577', '6372', '2'), - ('0.99', '537', '2007-03-21T13:00:53.996577', '14506', '2'), - ('9.99', '533', '2007-04-12T17:28:11.996577', '6837', '2'), - ('0.99', '556', '2007-02-20T07:18:54.996577', '2986', '2'), - ('4.99', '399', '2007-03-22T23:53:56.996577', '15468', '1'), - ('2.99', '152', '2007-04-06T02:09:02.996577', '3577', '2'), - ('2.99', '597', '2007-03-19T06:36:09.996577', '13019', '2'), - ('3.99', '149', '2007-04-08T13:44:30.996577', '4766', '1'), - ('4.99', '552', '2007-04-11T10:04:29.996577', '6189', '2'), - ('5.99', '563', '2007-04-08T14:12:46.996577', '4776', '2'), - ('2.99', '207', '2007-04-06T23:38:59.996577', '4018', '1'), - ('5.99', '78', '2007-03-19T10:24:25.996577', '13124', '2'), - ('0.99', '218', '2007-02-18T04:18:12.996577', '2262', '1'), - ('4.99', '171', '2007-02-17T10:12:04.996577', '2004', '2'), - ('4.99', '337', '2007-03-22T17:57:22.996577', '15292', '1'), - ('3.99', '119', '2007-03-18T15:24:46.996577', '12603', '2'), - ('0.99', '470', '2007-02-15T06:55:56.996577', '1283', '1'), - ('7.99', '259', '2007-02-16T13:42:44.996577', '1723', '2'), - ('0.99', '266', '2007-03-22T02:08:22.996577', '14877', '1'), - ('6.99', '132', '2007-03-01T14:12:46.996577', '10638', '1'), - ('0.99', '361', '2007-03-01T06:32:21.996577', '10414', '1'), - ('1.99', '101', '2007-04-29T20:52:42.996577', '8825', '2'), - ('0.99', '407', '2007-03-18T13:41:30.996577', '12566', '2'), - ('4.99', '512', '2007-03-19T11:39:08.996577', '13156', '2'), - ('4.99', '173', '2007-04-30T07:09:01.996577', '9097', '1'), - ('4.99', '490', '2007-04-12T15:50:15.996577', '6803', '1'), - ('0.99', '51', '2007-03-20T13:34:52.996577', '13868', '1'), - ('1.99', '559', '2007-03-02T07:51:23.996577', '11136', '2'), - ('5.99', '119', '2007-04-28T20:49:33.996577', '8183', '1'), - ('3.99', '167', '2007-02-15T16:13:23.996577', '1416', '1'), - ('4.99', '63', '2007-04-10T12:38:48.996577', '5788', '2'), - ('4.99', '103', '2007-04-29T08:38:28.996577', '8520', '1'), - ('4.99', '265', '2007-03-18T05:46:21.996577', '12346', '2'), - ('6.99', '588', '2007-02-17T03:05:46.996577', '1903', '2'), - ('4.99', '141', '2007-04-30T01:34:14.996577', '9584', '1'), - ('5.99', '164', '2007-03-19T22:59:17.996577', '13453', '2'), - ('0.99', '211', '2007-03-18T04:35:26.996577', '12311', '2'), - ('4.99', '389', '2007-03-17T20:08:06.996577', '12069', '2'), - ('8.99', '289', '2007-04-09T15:48:29.996577', '5342', '2'), - ('4.99', '457', '2007-03-17T21:32:41.996577', '12115', '1'), - ('6.99', '592', '2007-04-30T04:49:24.996577', '9666', '2'), - ('0.99', '529', '2007-02-21T09:58:15.996577', '3354', '2'), - ('4.99', '30', '2007-04-28T16:38:14.996577', '8083', '1'), - ('2.99', '273', '2007-03-21T14:39:16.996577', '14558', '2'), - ('0.99', '143', '2007-04-07T10:47:23.996577', '4221', '2'), - ('3.99', '585', '2007-02-20T03:18:55.996577', '2930', '1'), - ('0.99', '546', '2007-03-01T04:46:30.996577', '10370', '2'), - ('4.99', '219', '2007-04-29T09:05:49.996577', '8536', '2'), - ('2.99', '561', '2007-03-01T03:04:00.996577', '10317', '2'), - ('2.99', '180', '2007-04-29T09:21:17.996577', '8540', '2'), - ('0.99', '91', '2007-04-10T08:24:50.996577', '5701', '2'), - ('5.99', '98', '2007-03-17T03:01:43.996577', '11635', '1'), - ('0.99', '402', '2007-03-17T14:38:45.996577', '11920', '2'), - ('2.99', '451', '2007-03-01T22:35:40.996577', '10856', '1'), - ('3.99', '476', '2007-04-30T07:41:08.996577', '9743', '2'), - ('4.99', '554', '2007-04-08T19:17:56.996577', '4902', '2'), - ('1.99', '65', '2007-04-29T04:28:53.996577', '8392', '2'), - ('6.99', '312', '2007-03-23T15:12:57.996577', '15882', '1'), - ('1.99', '426', '2007-03-01T09:42:25.996577', '10505', '1'), - ('2.99', '496', '2007-03-23T11:04:31.996577', '15750', '2'), - ('7.99', '144', '2007-03-23T11:11:56.996577', '15753', '1'), - ('4.99', '514', '2007-02-16T10:58:45.996577', '1692', '2'), - ('2.99', '198', '2007-04-27T21:43:48.996577', '7583', '1'), - ('0.99', '420', '2007-03-23T04:49:46.996577', '15597', '2'), - ('5.99', '321', '2007-04-06T17:53:21.996577', '3901', '2'), - ('4.99', '352', '2007-02-21T08:06:19.996577', '3331', '2'), - ('2.99', '578', '2007-04-30T22:36:27.996577', '10182', '2'), - ('6.99', '464', '2007-04-09T20:57:11.996577', '5455', '2'), - ('9.99', '550', '2007-02-21T01:16:09.996577', '3236', '2'), - ('5.99', '112', '2007-03-01T12:47:23.996577', '10596', '2'), - ('4.99', '382', '2007-03-21T05:48:03.996577', '14300', '2'), - ('4.99', '169', '2007-04-11T23:28:19.996577', '6453', '2'), - ('1.99', '132', '2007-04-26T23:16:06.996577', '6978', '1'), - ('0.99', '136', '2007-04-08T20:34:01.996577', '4927', '1'), - ('0.99', '497', '2007-03-23T05:59:36.996577', '15633', '2'), - ('4.99', '464', '2007-02-15T06:29:55.996577', '1277', '2'), - ('0.99', '405', '2007-04-07T10:52:20.996577', '4223', '2'), - ('8.99', '19', '2007-03-20T08:22:10.996577', '13718', '1'), - ('4.99', '11', '2007-04-08T21:11:31.996577', '4943', '1'), - ('3.99', '563', '2007-04-08T15:31:15.996577', '4808', '2'), - ('4.99', '511', '2007-03-19T03:00:58.996577', '12920', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['27306', '26071', '21815', '20171', '29004', '29309', '20849', '25712', '29442', '30972', '17572', '20950', '28786', '30128', '19048', '23038', '30501', '30643', '29046', '24147', '24993', '23458', '27388', '17806', '31763', '29765', '23278', '28844', '21423', '24153', '18839', '22822', '28234', '25379', '29761', '28773', '27180', '31551', '26699', '30014', '24549', '31468', '21169', '22369', '24322', '21999', '27322', '22821', '27673', '27744', '31564', '28743', '23647', '17896', '30705', '22936', '17646', '22371', '31608', '23295', '21571', '28550', '22586', '31055', '30841', '28590', '22809', '26043', '30000', '23182', '28010', '17761', '25417', '18645', '18444', '19704', '20015', '27248', '20739', '20425', '26596', '18443', '26558', '22191', '26232', '27723', '29926', '19766', '21445', '26051', '22850', '17994', '22307', '31333', '26954', '24540', '26235', '29666', '28428', '29009']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('1.99', '457', '2007-04-27T06:50:52.996577', '7184', '1'), - ('0.99', '347', '2007-04-09T21:40:18.996577', '5471', '2'), - ('4.99', '509', '2007-03-20T20:18:37.996577', '14045', '2'), - ('3.99', '338', '2007-03-19T16:40:57.996577', '13284', '1'), - ('2.99', '1', '2007-04-30T01:10:44.996577', '9571', '2'), - ('2.99', '30', '2007-04-07T22:49:55.996577', '4471', '2'), - ('2.99', '408', '2007-03-02T06:59:32.996577', '11115', '2'), - ('2.99', '315', '2007-04-07T00:15:10.996577', '4021', '1'), - ('0.99', '40', '2007-04-28T01:40:20.996577', '7684', '2'), - ('2.99', '173', '2007-04-30T22:54:56.996577', '9512', '2'), - ('2.99', '358', '2007-02-19T13:21:50.996577', '2721', '1'), - ('4.99', '417', '2007-03-20T23:54:59.996577', '14121', '2'), - ('4.99', '590', '2007-04-08T11:10:53.996577', '4722', '2'), - ('0.99', '101', '2007-04-29T01:28:34.996577', '8301', '1'), - ('2.99', '142', '2007-02-20T23:36:52.996577', '3214', '1'), - ('9.99', '36', '2007-03-21T17:43:59.996577', '14647', '1'), - ('2.99', '133', '2007-04-09T03:05:57.996577', '5063', '2'), - ('2.99', '145', '2007-04-08T15:45:57.996577', '4817', '2'), - ('0.99', '5', '2007-04-27T11:05:54.996577', '7293', '2'), - ('4.99', '152', '2007-03-19T02:55:37.996577', '12917', '1'), - ('2.99', '251', '2007-03-19T15:01:42.996577', '13243', '1'), - ('8.99', '80', '2007-03-23T06:56:23.996577', '15648', '1'), - ('0.99', '465', '2007-04-08T13:25:58.996577', '4763', '1'), - ('4.99', '421', '2007-02-16T11:08:17.996577', '1693', '1'), - ('4.99', '253', '2007-04-10T03:30:48.996577', '5602', '1'), - ('2.99', '70', '2007-04-28T03:00:56.996577', '7714', '1'), - ('0.99', '62', '2007-03-17T16:52:16.996577', '11988', '1'), - ('3.99', '594', '2007-04-07T07:26:49.996577', '4154', '1'), - ('0.99', '467', '2007-03-01T00:37:48.996577', '10239', '2'), - ('4.99', '152', '2007-03-21T18:19:56.996577', '14668', '2'), - ('4.99', '86', '2007-02-21T03:35:57.996577', '3270', '2'), - ('2.99', '15', '2007-03-18T16:28:49.996577', '12635', '1'), - ('4.99', '538', '2007-04-30T04:04:14.996577', '9643', '1'), - ('0.99', '287', '2007-04-10T11:14:02.996577', '5761', '2'), - ('0.99', '70', '2007-04-07T02:42:01.996577', '4061', '1'), - ('4.99', '588', '2007-04-30T17:25:55.996577', '9370', '2'), - ('2.99', '444', '2007-04-11T15:20:33.996577', '6285', '2'), - ('0.99', '233', '2007-04-30T01:17:46.996577', '9574', '1'), - ('0.99', '402', '2007-04-27T23:32:07.996577', '7633', '1'), - ('0.99', '91', '2007-04-27T05:24:57.996577', '7143', '2'), - ('0.99', '195', '2007-03-17T21:07:20.996577', '12099', '2'), - ('4.99', '227', '2007-04-29T05:22:02.996577', '8417', '2'), - ('0.99', '442', '2007-03-19T04:23:40.996577', '12948', '1'), - ('7.99', '569', '2007-03-19T16:56:50.996577', '13287', '1'), - ('6.99', '171', '2007-03-19T09:02:18.996577', '13087', '2'), - ('4.99', '529', '2007-03-21T10:41:44.996577', '14449', '2'), - ('0.99', '459', '2007-04-10T08:12:06.996577', '5695', '1'), - ('2.99', '15', '2007-03-18T13:14:52.996577', '12551', '2'), - ('4.99', '489', '2007-04-30T20:53:12.996577', '9459', '1'), - ('2.99', '496', '2007-04-07T03:05:35.996577', '4070', '1'), - ('6.99', '235', '2007-04-29T06:06:36.996577', '8446', '2'), - ('6.99', '585', '2007-04-30T11:31:50.996577', '9860', '1'), - ('3.99', '103', '2007-03-22T23:50:38.996577', '15467', '1'), - ('3.99', '446', '2007-02-18T09:28:02.996577', '2335', '2'), - ('2.99', '149', '2007-04-30T20:59:15.996577', '10154', '2'), - ('4.99', '26', '2007-03-21T01:52:55.996577', '14183', '2'), - ('7.99', '378', '2007-02-17T19:42:10.996577', '2134', '2'), - ('4.99', '569', '2007-03-21T02:36:45.996577', '14207', '2'), - ('4.99', '238', '2007-04-27T08:54:37.996577', '7243', '2'), - ('4.99', '64', '2007-03-01T17:19:55.996577', '10714', '2'), - ('4.99', '481', '2007-03-20T13:46:04.996577', '13878', '2'), - ('0.99', '570', '2007-04-30T18:37:26.996577', '9398', '1'), - ('2.99', '595', '2007-03-23T19:55:01.996577', '16016', '2'), - ('8.99', '181', '2007-04-26T22:08:33.996577', '6946', '1'), - ('1.99', '163', '2007-04-12T17:12:30.996577', '6831', '1'), - ('5.99', '573', '2007-04-30T15:10:42.996577', '9971', '2'), - ('3.99', '14', '2007-03-16T22:55:49.996577', '11528', '2'), - ('4.99', '345', '2007-04-07T21:48:31.996577', '4450', '2'), - ('9.99', '90', '2007-04-29T22:36:34.996577', '8870', '2'), - ('2.99', '52', '2007-03-18T00:40:59.996577', '12200', '2'), - ('10.99', '520', '2007-04-10T13:30:43.996577', '5802', '1'), - ('5.99', '405', '2007-02-21T01:54:03.996577', '3253', '1'), - ('1.99', '290', '2007-04-28T00:15:46.996577', '7650', '1'), - ('0.99', '35', '2007-02-16T02:37:34.996577', '1579', '1'), - ('0.99', '592', '2007-02-19T07:00:26.996577', '2627', '1'), - ('4.99', '285', '2007-03-01T14:13:23.996577', '10641', '1'), - ('2.99', '321', '2007-03-17T06:21:29.996577', '11722', '1'), - ('8.99', '451', '2007-04-08T14:58:37.996577', '4794', '1'), - ('2.99', '396', '2007-03-21T13:02:24.996577', '14508', '1'), - ('4.99', '365', '2007-03-18T06:48:34.996577', '12375', '2'), - ('0.99', '392', '2007-04-28T23:27:57.996577', '8254', '1'), - ('2.99', '592', '2007-02-15T19:42:04.996577', '1479', '1'), - ('3.99', '389', '2007-04-12T06:10:14.996577', '6600', '1'), - ('9.99', '550', '2007-03-22T22:55:13.996577', '15431', '2'), - ('4.99', '360', '2007-04-30T13:53:45.996577', '9283', '1'), - ('8.99', '494', '2007-04-27T20:18:35.996577', '7546', '2'), - ('4.99', '84', '2007-04-28T14:06:09.996577', '8019', '2'), - ('0.99', '292', '2007-03-21T12:39:45.996577', '14499', '1'), - ('1.99', '468', '2007-03-23T02:00:57.996577', '15522', '1'), - ('8.99', '345', '2007-04-30T23:32:54.996577', '10215', '2'), - ('1.99', '18', '2007-03-01T17:33:44.996577', '10721', '2'), - ('3.99', '466', '2007-02-20T09:45:46.996577', '3022', '1'), - ('4.99', '563', '2007-03-21T15:58:43.996577', '14592', '2'), - ('7.99', '214', '2007-04-12T06:18:50.996577', '6602', '1'), - ('4.99', '424', '2007-04-30T12:10:28.996577', '9878', '2'), - ('5.99', '194', '2007-03-02T20:23:35.996577', '11475', '2'), - ('3.99', '360', '2007-04-30T04:30:40.996577', '9659', '2'), - ('1.99', '61', '2007-04-27T02:29:41.996577', '7071', '2'), - ('2.99', '559', '2007-04-30T12:10:23.996577', '9877', '1'), - ('5.99', '2', '2007-04-27T17:08:46.996577', '7459', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['24597', '31669', '25786', '19907', '21804', '25839', '24559', '29087', '22642', '20680', '27433', '29047', '24426', '21030', '23521', '24787', '29860', '24181', '27924', '20910', '23734', '29438', '24114', '24685', '27813', '23015', '22154', '30866', '24905', '21187', '23583', '19567', '30251', '21611', '20458', '26723', '19897', '20564', '29737', '24317', '18945', '19603', '28916', '30354', '28196', '25287', '19718', '20263', '29342', '30369', '20276', '30942', '30610', '19587', '19201', '21012', '26595', '31284', '23824', '18138', '24853', '27237', '30695', '23166', '28153', '19789', '23811', '30876', '30788', '29394', '28151', '31741', '30875', '28054', '30236', '21777', '30564', '19663', '18518', '22245', '23561', '26911', '26669', '22547', '19724', '22363', '31965', '24630', '27263', '27072', '24843', '28118', '27874', '26613', '22034', '22869', '26456', '21750', '29692', '28192']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('0.99', '199', '2007-03-18T07:14:23.996577', '12386', '1'), - ('0.99', '243', '2007-04-27T06:05:12.996577', '7165', '2'), - ('2.99', '322', '2007-04-11T01:28:00.996577', '6033', '2'), - ('7.99', '306', '2007-03-23T14:47:40.996577', '15868', '2'), - ('2.99', '507', '2007-03-22T21:32:47.996577', '15394', '1'), - ('5.99', '326', '2007-04-29T06:54:01.996577', '8467', '1'), - ('5.99', '196', '2007-03-21T09:23:15.996577', '14410', '2'), - ('1.99', '9', '2007-04-08T15:04:10.996577', '4796', '1'), - ('0.99', '204', '2007-03-17T13:27:17.996577', '11886', '2'), - ('4.99', '390', '2007-03-19T23:32:16.996577', '13473', '1'), - ('4.99', '469', '2007-04-11T04:53:10.996577', '6099', '2'), - ('0.99', '5', '2007-04-28T00:18:55.996577', '7652', '2'), - ('7.99', '181', '2007-03-18T06:21:15.996577', '12363', '1'), - ('0.99', '425', '2007-03-22T09:10:24.996577', '15064', '1'), - ('0.99', '87', '2007-03-18T01:42:40.996577', '12232', '1'), - ('0.99', '227', '2007-03-17T13:41:47.996577', '11892', '2'), - ('4.99', '78', '2007-04-11T18:33:09.996577', '6344', '1'), - ('6.99', '156', '2007-03-01T02:52:44.996577', '10309', '2'), - ('4.99', '511', '2007-04-30T07:57:59.996577', '9760', '1'), - ('0.99', '414', '2007-03-17T05:52:12.996577', '11706', '1'), - ('6.99', '114', '2007-03-19T23:14:06.996577', '13459', '2'), - ('1.99', '40', '2007-04-08T23:45:30.996577', '5001', '2'), - ('3.99', '149', '2007-03-21T22:18:41.996577', '14771', '1'), - ('2.99', '214', '2007-03-23T06:31:51.996577', '15639', '2'), - ('2.99', '502', '2007-04-08T05:34:16.996577', '4606', '1'), - ('2.99', '34', '2007-03-18T15:11:11.996577', '12599', '1'), - ('2.99', '546', '2007-03-18T14:45:07.996577', '12591', '2'), - ('0.99', '165', '2007-04-29T11:47:18.996577', '8608', '1'), - ('4.99', '241', '2007-03-18T08:28:02.996577', '12418', '2'), - ('4.99', '444', '2007-03-01T16:42:40.996577', '10693', '1'), - ('0.99', '93', '2007-03-23T08:32:43.996577', '15696', '1'), - ('2.99', '271', '2007-03-22T16:17:08.996577', '15244', '1'), - ('4.99', '112', '2007-04-09T16:09:18.996577', '5351', '1'), - ('4.99', '486', '2007-03-19T07:53:32.996577', '13048', '1'), - ('7.99', '368', '2007-03-20T10:35:11.996577', '13781', '2'), - ('4.99', '404', '2007-04-26T22:43:30.996577', '6964', '1'), - ('0.99', '306', '2007-03-02T18:52:28.996577', '11440', '1'), - ('3.99', '379', '2007-03-02T19:42:42.996577', '11457', '2'), - ('0.99', '67', '2007-04-28T09:25:41.996577', '7895', '2'), - ('2.99', '170', '2007-03-21T18:30:17.996577', '14675', '2'), - ('2.99', '114', '2007-02-17T14:04:38.996577', '2059', '1'), - ('3.99', '274', '2007-03-23T13:30:20.996577', '15819', '2'), - ('2.99', '202', '2007-04-29T03:19:19.996577', '8351', '1'), - ('4.99', '121', '2007-04-12T14:46:38.996577', '6780', '2'), - ('4.99', '535', '2007-04-29T13:16:11.996577', '8645', '1'), - ('0.99', '280', '2007-04-29T02:13:18.996577', '8319', '2'), - ('4.99', '286', '2007-03-23T05:56:48.996577', '15629', '2'), - ('2.99', '347', '2007-03-22T04:58:36.996577', '14958', '2'), - ('9.99', '32', '2007-04-09T14:25:41.996577', '5307', '1'), - ('0.99', '122', '2007-04-11T22:47:08.996577', '6436', '1'), - ('1.99', '348', '2007-03-20T16:46:32.996577', '13962', '1'), - ('3.99', '171', '2007-04-27T01:35:10.996577', '7037', '1'), - ('5.99', '142', '2007-04-30T19:33:25.996577', '9419', '1'), - ('6.99', '273', '2007-03-23T11:18:26.996577', '15760', '1'), - ('5.99', '182', '2007-02-17T19:05:16.996577', '2120', '2'), - ('4.99', '423', '2007-03-18T23:05:52.996577', '12806', '2'), - ('1.99', '392', '2007-04-28T12:46:51.996577', '7981', '1'), - ('4.99', '210', '2007-04-08T18:48:21.996577', '4893', '1'), - ('5.99', '122', '2007-03-21T18:19:35.996577', '14666', '2'), - ('4.99', '507', '2007-02-17T20:26:39.996577', '2143', '1'), - ('3.99', '235', '2007-03-21T21:36:59.996577', '14749', '2'), - ('2.99', '449', '2007-04-28T13:39:26.996577', '8002', '2'), - ('2.99', '149', '2007-04-06T17:30:05.996577', '3894', '1'), - ('4.99', '51', '2007-03-17T05:07:42.996577', '11685', '2'), - ('4.99', '531', '2007-04-30T07:21:11.996577', '9107', '2'), - ('7.99', '294', '2007-03-21T17:12:10.996577', '14630', '2'), - ('4.99', '121', '2007-03-21T01:39:59.996577', '14177', '1'), - ('7.99', '166', '2007-04-10T16:22:32.996577', '5855', '1'), - ('2.99', '158', '2007-04-10T06:48:04.996577', '5672', '1'), - ('0.99', '36', '2007-04-28T17:03:38.996577', '8099', '2'), - ('4.99', '531', '2007-04-29T22:14:23.996577', '8860', '2'), - ('3.99', '251', '2007-04-07T00:44:14.996577', '4026', '2'), - ('2.99', '166', '2007-04-10T05:36:35.996577', '5646', '1'), - ('0.99', '523', '2007-04-28T18:49:45.996577', '8141', '2'), - ('2.99', '110', '2007-04-07T16:13:15.996577', '4317', '1'), - ('6.99', '504', '2007-03-22T13:34:03.996577', '15166', '1'), - ('3.99', '138', '2007-04-28T19:38:56.996577', '8160', '2'), - ('4.99', '279', '2007-03-20T04:15:37.996577', '13588', '2'), - ('3.99', '6', '2007-02-16T02:10:04.996577', '1575', '1'), - ('2.99', '556', '2007-03-23T03:52:35.996577', '15568', '1'), - ('1.99', '91', '2007-03-22T11:16:11.996577', '15122', '1'), - ('0.99', '421', '2007-04-11T11:50:32.996577', '6220', '1'), - ('2.99', '399', '2007-04-30T07:09:20.996577', '9728', '2'), - ('4.99', '590', '2007-03-01T15:07:10.996577', '10657', '1'), - ('6.99', '287', '2007-03-21T19:56:44.996577', '14715', '2'), - ('6.99', '569', '2007-03-02T16:03:36.996577', '11354', '1'), - ('3.98', '448', '2007-05-14T13:44:29.996577', '14734', '2'), - ('8.99', '209', '2007-03-20T11:00:58.996577', '13796', '1'), - ('6.99', '452', '2007-04-28T09:38:38.996577', '7899', '2'), - ('2.99', '436', '2007-04-06T20:02:37.996577', '3944', '2'), - ('0.99', '234', '2007-03-18T01:29:14.996577', '12226', '1'), - ('0.99', '529', '2007-04-07T12:42:18.996577', '4254', '2'), - ('2.99', '507', '2007-04-12T19:36:01.996577', '6891', '1'), - ('6.99', '394', '2007-04-06T16:31:42.996577', '3873', '1'), - ('6.99', '533', '2007-03-01T13:25:26.996577', '10614', '1'), - ('4.99', '20', '2007-03-19T07:17:03.996577', '13036', '2'), - ('4.99', '379', '2007-04-27T01:46:58.996577', '7041', '2'), - ('4.99', '502', '2007-03-21T09:23:23.996577', '14411', '1'), - ('1.99', '64', '2007-04-08T09:32:28.996577', '4690', '1'), - ('0.99', '535', '2007-04-10T02:49:36.996577', '5588', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['23111', '18529', '23331', '19136', '26050', '26561', '26295', '18329', '28077', '17993', '21710', '18256', '28981', '27542', '31734', '26450', '25136', '17743', '25172', '27035', '17600', '20066', '21741', '31329', '20389', '31749', '27765', '30293', '21231', '22583', '22344', '24255', '28822', '19528', '26598', '19296', '30855', '22600', '24599', '24546', '30574', '30142', '29746', '30919', '31509', '24724', '23089', '23310', '24842', '17796', '24762', '20439', '27129', '29310', '26722', '27674', '27960', '23564', '25816', '26318', '23201', '31359', '26224', '31283', '26511', '31666', '31980', '30573', '29441', '21925', '23799', '21533', '19904', '25752', '19019', '20803', '30859', '18950', '31366', '22232', '29887', '19083', '21838', '27517', '18347', '25724', '31232', '29732', '24877', '30740', '25382', '31241', '19652', '18918', '22434', '22250', '23580', '21023', '29155', '18170']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('8.99', '45', '2007-03-02T03:32:44.996577', '11004', '1'), - ('4.99', '8', '2007-02-20T16:26:13.996577', '3114', '2'), - ('2.99', '67', '2007-03-22T09:47:48.996577', '15085', '2'), - ('2.99', '165', '2007-02-20T22:30:36.996577', '3195', '2'), - ('2.99', '345', '2007-04-30T11:18:23.996577', '9207', '2'), - ('4.99', '389', '2007-04-28T12:44:20.996577', '7977', '2'), - ('2.99', '366', '2007-04-06T14:48:22.996577', '3834', '1'), - ('4.99', '561', '2007-02-20T19:49:17.996577', '3160', '1'), - ('1.99', '526', '2007-04-06T04:28:10.996577', '3619', '1'), - ('8.99', '466', '2007-02-18T17:33:07.996577', '2446', '2'), - ('2.99', '498', '2007-03-19T02:15:09.996577', '12893', '1'), - ('4.99', '539', '2007-02-15T17:36:42.996577', '1444', '2'), - ('5.99', '208', '2007-04-07T17:49:28.996577', '4354', '1'), - ('6.99', '479', '2007-04-06T00:05:19.996577', '3537', '2'), - ('3.99', '250', '2007-04-06T20:19:07.996577', '3951', '1'), - ('3.99', '378', '2007-04-30T04:59:29.996577', '9668', '2'), - ('3.99', '265', '2007-03-01T12:41:26.996577', '10592', '2'), - ('4.99', '402', '2007-02-14T23:53:34.996577', '1194', '2'), - ('1.99', '268', '2007-04-12T00:51:12.996577', '6489', '2'), - ('6.99', '432', '2007-04-28T16:58:54.996577', '8094', '2'), - ('4.99', '364', '2007-02-19T21:43:41.996577', '2857', '2'), - ('4.99', '327', '2007-03-19T19:33:37.996577', '13360', '1'), - ('4.99', '502', '2007-03-01T05:15:14.996577', '10390', '2'), - ('0.99', '214', '2007-04-07T10:19:07.996577', '4211', '2'), - ('2.99', '361', '2007-03-18T18:35:23.996577', '12690', '2'), - ('2.99', '251', '2007-04-30T10:58:45.996577', '9196', '1'), - ('0.99', '498', '2007-04-06T14:25:56.996577', '3828', '2'), - ('2.99', '115', '2007-04-11T03:36:37.996577', '6080', '1'), - ('8.99', '448', '2007-03-17T02:05:18.996577', '11608', '2'), - ('0.99', '595', '2007-03-21T07:00:58.996577', '14334', '1'), - ('3.99', '566', '2007-03-21T05:03:07.996577', '14277', '1'), - ('7.99', '163', '2007-03-20T02:11:39.996577', '13543', '2'), - ('4.99', '592', '2007-04-27T13:27:06.996577', '7364', '2'), - ('0.99', '267', '2007-03-23T11:43:13.996577', '15768', '1'), - ('0.99', '392', '2007-04-30T18:40:28.996577', '10085', '2'), - ('6.99', '211', '2007-02-21T17:48:43.996577', '3437', '2'), - ('3.99', '164', '2007-04-28T18:31:51.996577', '8135', '2'), - ('5.99', '597', '2007-03-02T03:03:50.996577', '10986', '2'), - ('0.99', '199', '2007-03-22T22:05:37.996577', '15412', '2'), - ('4.99', '195', '2007-03-02T00:27:02.996577', '10911', '2'), - ('7.99', '139', '2007-04-09T12:43:27.996577', '5265', '2'), - ('2.99', '102', '2007-04-10T09:27:49.996577', '5716', '1'), - ('3.99', '68', '2007-04-30T16:31:54.996577', '9339', '2'), - ('9.99', '169', '2007-04-12T00:48:35.996577', '6488', '2'), - ('0.99', '230', '2007-04-29T13:32:49.996577', '8653', '2'), - ('0.99', '219', '2007-03-20T19:51:37.996577', '14029', '2'), - ('2.99', '42', '2007-03-01T03:47:22.996577', '10345', '2'), - ('0.99', '65', '2007-03-21T07:37:17.996577', '14356', '1'), - ('3.99', '234', '2007-03-17T13:02:07.996577', '11882', '1'), - ('2.99', '416', '2007-02-16T03:59:24.996577', '1596', '2'), - ('2.99', '224', '2007-03-19T05:07:25.996577', '12969', '1'), - ('2.99', '366', '2007-03-21T19:59:05.996577', '14717', '1'), - ('4.99', '440', '2007-04-30T03:28:07.996577', '9001', '1'), - ('2.99', '30', '2007-04-08T07:41:54.996577', '4642', '2'), - ('0.99', '404', '2007-04-12T14:39:16.996577', '6779', '2'), - ('4.99', '490', '2007-04-05T21:31:03.996577', '3476', '1'), - ('6.99', '516', '2007-04-12T10:26:40.996577', '6677', '2'), - ('4.99', '91', '2007-03-23T15:19:19.996577', '15886', '2'), - ('4.99', '324', '2007-04-11T16:13:34.996577', '6299', '2'), - ('2.99', '367', '2007-04-11T12:27:02.996577', '6228', '2'), - ('4.99', '54', '2007-03-02T02:01:40.996577', '10956', '1'), - ('6.99', '218', '2007-04-08T19:00:09.996577', '4898', '1'), - ('0.99', '360', '2007-04-11T22:58:11.996577', '6442', '1'), - ('6.99', '210', '2007-04-08T17:48:18.996577', '4871', '1'), - ('0.99', '384', '2007-04-28T06:10:35.996577', '7799', '2'), - ('3.99', '243', '2007-04-11T01:39:03.996577', '6038', '2'), - ('0.99', '508', '2007-05-14T13:44:29.996577', '14318', '1'), - ('2.99', '139', '2007-04-09T04:26:05.996577', '5092', '2'), - ('0.99', '40', '2007-04-12T01:44:11.996577', '6502', '1'), - ('2.99', '521', '2007-03-17T02:47:18.996577', '11625', '2'), - ('4.99', '120', '2007-03-21T00:52:59.996577', '14153', '1'), - ('5.99', '476', '2007-03-18T19:28:17.996577', '12709', '2'), - ('0.99', '306', '2007-03-20T13:39:37.996577', '13873', '1'), - ('4.99', '319', '2007-04-08T07:02:04.996577', '4630', '1'), - ('0.99', '133', '2007-02-20T08:38:55.996577', '3006', '1'), - ('2.99', '403', '2007-03-21T13:27:55.996577', '14519', '1'), - ('0.99', '165', '2007-04-07T15:29:45.996577', '4304', '2'), - ('2.99', '115', '2007-02-15T21:36:16.996577', '1515', '2'), - ('0.99', '218', '2007-04-30T19:41:24.996577', '10114', '1'), - ('4.99', '555', '2007-03-17T06:13:08.996577', '11718', '1'), - ('6.99', '80', '2007-04-11T22:03:37.996577', '6417', '2'), - ('7.99', '149', '2007-02-18T13:46:25.996577', '2383', '2'), - ('2.99', '512', '2007-03-22T12:54:27.996577', '15153', '1'), - ('5.99', '476', '2007-04-06T23:15:26.996577', '4010', '1'), - ('4.99', '568', '2007-02-16T08:35:36.996577', '1658', '2'), - ('4.99', '316', '2007-04-26T23:28:34.996577', '6988', '2'), - ('8.99', '199', '2007-04-08T04:32:49.996577', '4580', '2'), - ('4.99', '67', '2007-04-07T04:15:59.996577', '4090', '2'), - ('5.99', '238', '2007-03-16T23:22:54.996577', '11543', '2'), - ('5.99', '154', '2007-04-08T17:07:57.996577', '4850', '1'), - ('2.99', '287', '2007-04-27T14:48:06.996577', '7402', '2'), - ('4.99', '199', '2007-04-30T12:36:10.996577', '9894', '2'), - ('2.99', '278', '2007-03-21T04:49:50.996577', '14268', '1'), - ('4.99', '108', '2007-02-15T13:14:14.996577', '1372', '2'), - ('4.99', '577', '2007-03-01T19:51:51.996577', '10782', '1'), - ('2.99', '557', '2007-03-20T10:53:58.996577', '13794', '2'), - ('4.99', '93', '2007-03-21T06:59:29.996577', '14333', '2'), - ('3.99', '424', '2007-03-20T10:50:30.996577', '13793', '2'), - ('5.99', '15', '2007-04-07T05:54:45.996577', '4127', '1'), - ('4.99', '515', '2007-02-18T19:53:49.996577', '2484', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['24021', '29150', '28632', '20622', '22646', '18185', '29172', '28438', '31555', '22513', '25727', '25994', '31517', '23762', '18231', '23177', '29821', '32053', '19194', '23026', '32055', '21653', '23401', '19290', '27006', '22275', '21559', '18711', '28355', '23507', '31236', '24553', '26634', '29632', '23261', '27320', '31522', '18851', '30377', '27725', '24334', '25343', '28839', '22984', '18071', '20776', '26914', '18774', '22458', '19987', '30611', '23119', '28588', '19679', '29103', '28218', '31447', '27334', '24301', '19540', '25448', '28848', '20686', '29644', '25505', '28834', '31738', '24033', '19292', '23792', '27707', '18017', '29874', '29509', '27958', '24637', '17895', '28756', '22796', '19302', '29226', '27327', '29003', '22599', '23883', '17908', '29070', '27827', '24591', '21341', '22233', '26575', '19964', '29079', '24826', '22515', '17787', '25495', '21281', '19085']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('2.99', '141', '2007-03-23T18:13:51.996577', '15964', '1'), - ('3.99', '14', '2007-04-29T09:39:59.996577', '8548', '1'), - ('7.99', '577', '2007-04-06T12:28:39.996577', '3785', '1'), - ('0.99', '384', '2007-03-22T00:31:56.996577', '14841', '1'), - ('2.99', '204', '2007-03-20T14:33:37.996577', '13899', '2'), - ('0.99', '518', '2007-02-21T06:33:53.996577', '3311', '2'), - ('0.99', '16', '2007-04-30T09:40:29.996577', '9158', '2'), - ('3.99', '560', '2007-04-28T09:12:22.996577', '7891', '1'), - ('2.99', '235', '2007-04-06T02:26:01.996577', '3581', '2'), - ('4.99', '586', '2007-03-17T17:51:28.996577', '12013', '1'), - ('4.99', '316', '2007-04-27T21:54:30.996577', '7592', '1'), - ('4.99', '339', '2007-04-28T12:38:32.996577', '7973', '2'), - ('0.99', '231', '2007-04-08T22:19:52.996577', '4969', '2'), - ('2.99', '117', '2007-03-17T22:34:52.996577', '12143', '1'), - ('0.99', '533', '2007-02-16T08:00:03.996577', '1652', '1'), - ('4.99', '51', '2007-03-22T03:00:16.996577', '14903', '1'), - ('0.99', '75', '2007-04-11T02:19:53.996577', '6052', '2'), - ('4.99', '114', '2007-05-14T13:44:29.996577', '12506', '2'), - ('2.99', '180', '2007-02-19T17:36:14.996577', '2798', '1'), - ('0.99', '35', '2007-03-20T23:21:35.996577', '14110', '1'), - ('4.99', '120', '2007-05-14T13:44:29.996577', '15780', '1'), - ('4.99', '491', '2007-03-02T04:43:33.996577', '11048', '1'), - ('5.99', '75', '2007-03-01T14:56:33.996577', '10653', '2'), - ('4.99', '209', '2007-02-16T08:35:15.996577', '1657', '1'), - ('7.99', '429', '2007-04-11T10:34:12.996577', '6196', '2'), - ('4.99', '560', '2007-03-01T17:03:25.996577', '10702', '1'), - ('0.99', '480', '2007-03-19T09:09:35.996577', '13092', '2'), - ('2.99', '52', '2007-02-19T22:15:50.996577', '2862', '1'), - ('2.99', '552', '2007-04-28T16:41:41.996577', '8085', '1'), - ('8.99', '86', '2007-03-01T01:08:05.996577', '10252', '2'), - ('2.99', '199', '2007-04-12T10:06:11.996577', '6668', '2'), - ('11.99', '195', '2007-03-23T20:47:59.996577', '16040', '2'), - ('0.99', '396', '2007-04-27T05:24:05.996577', '7142', '2'), - ('0.99', '57', '2007-04-30T08:35:46.996577', '9136', '2'), - ('8.99', '60', '2007-03-02T17:41:06.996577', '11404', '1'), - ('2.99', '459', '2007-04-08T01:19:49.996577', '4519', '2'), - ('0.99', '231', '2007-04-29T09:46:53.996577', '8556', '1'), - ('0.99', '89', '2007-02-18T23:14:22.996577', '2523', '1'), - ('3.99', '123', '2007-04-07T21:33:56.996577', '4442', '1'), - ('2.99', '494', '2007-04-29T02:45:06.996577', '8333', '2'), - ('4.99', '172', '2007-03-19T18:03:59.996577', '13320', '2'), - ('8.99', '284', '2007-04-28T03:01:41.996577', '7716', '2'), - ('6.99', '593', '2007-04-30T21:59:57.996577', '9483', '1'), - ('0.99', '30', '2007-03-21T07:05:41.996577', '14339', '1'), - ('3.99', '488', '2007-02-16T08:20:05.996577', '1655', '2'), - ('2.99', '400', '2007-03-21T22:21:33.996577', '14775', '1'), - ('2.99', '421', '2007-04-28T14:31:53.996577', '8025', '2'), - ('4.99', '70', '2007-02-18T19:01:06.996577', '2472', '1'), - ('4.99', '579', '2007-03-23T13:59:14.996577', '15838', '1'), - ('5.99', '316', '2007-03-19T16:26:01.996577', '13277', '2'), - ('7.99', '143', '2007-04-07T01:00:33.996577', '4031', '1'), - ('10.99', '45', '2007-03-23T13:15:52.996577', '15812', '1'), - ('4.99', '573', '2007-04-30T10:58:38.996577', '9846', '2'), - ('4.99', '280', '2007-03-22T18:26:41.996577', '15312', '1'), - ('4.99', '10', '2007-04-28T21:02:38.996577', '8188', '2'), - ('2.99', '537', '2007-04-27T06:38:55.996577', '7179', '1'), - ('4.99', '225', '2007-04-30T15:30:26.996577', '9980', '1'), - ('2.99', '459', '2007-04-30T04:00:36.996577', '9639', '2'), - ('2.99', '168', '2007-03-23T08:06:43.996577', '15683', '2'), - ('4.99', '269', '2007-03-02T00:21:32.996577', '10908', '1'), - ('8.99', '292', '2007-04-30T03:10:08.996577', '8990', '1'), - ('1.99', '594', '2007-04-29T10:05:56.996577', '8567', '1'), - ('4.99', '390', '2007-03-22T15:40:56.996577', '15222', '2'), - ('2.99', '58', '2007-04-30T17:16:34.996577', '10037', '2'), - ('2.99', '297', '2007-04-08T06:30:44.996577', '4621', '2'), - ('2.99', '593', '2007-04-11T20:43:23.996577', '6386', '1'), - ('2.99', '250', '2007-04-29T10:27:48.996577', '8579', '1'), - ('6.99', '143', '2007-03-17T03:30:51.996577', '11651', '2'), - ('4.99', '209', '2007-02-19T17:29:03.996577', '2796', '1'), - ('3.99', '119', '2007-03-23T20:21:22.996577', '16028', '2'), - ('5.99', '493', '2007-04-06T06:21:20.996577', '3655', '1'), - ('4.99', '472', '2007-02-15T14:17:27.996577', '1389', '1'), - ('5.99', '79', '2007-04-11T08:40:56.996577', '6162', '2'), - ('2.99', '45', '2007-04-27T16:07:38.996577', '7436', '1'), - ('4.99', '515', '2007-04-30T21:22:56.996577', '10159', '1'), - ('2.99', '210', '2007-03-19T02:48:51.996577', '12909', '2'), - ('4.99', '446', '2007-02-18T03:28:14.996577', '2248', '1'), - ('5.99', '587', '2007-04-29T18:35:32.996577', '8776', '2'), - ('4.99', '13', '2007-03-02T13:27:07.996577', '11292', '1'), - ('4.99', '213', '2007-02-17T05:44:07.996577', '1936', '2'), - ('2.99', '23', '2007-04-08T17:11:44.996577', '4853', '2'), - ('4.99', '459', '2007-04-28T03:02:20.996577', '7717', '1'), - ('2.99', '1', '2007-04-29T02:27:15.996577', '8326', '2'), - ('6.99', '596', '2007-03-23T15:44:54.996577', '15899', '1'), - ('2.99', '129', '2007-03-01T05:36:48.996577', '10395', '2'), - ('3.99', '448', '2007-02-21T00:45:21.996577', '3225', '2'), - ('3.99', '7', '2007-04-12T13:46:08.996577', '6761', '2'), - ('6.99', '503', '2007-04-06T19:36:55.996577', '3935', '2'), - ('4.99', '198', '2007-03-22T06:16:27.996577', '14990', '2'), - ('2.99', '459', '2007-03-01T10:34:56.996577', '10531', '1'), - ('2.99', '555', '2007-03-17T07:31:57.996577', '11747', '2'), - ('5.99', '390', '2007-04-30T12:47:51.996577', '9251', '1'), - ('2.99', '313', '2007-03-22T09:42:57.996577', '15081', '2'), - ('2.99', '8', '2007-04-09T15:41:49.996577', '5341', '2'), - ('2.99', '232', '2007-03-20T08:02:24.996577', '13707', '2'), - ('2.99', '586', '2007-03-20T20:15:09.996577', '14043', '2'), - ('4.99', '413', '2007-02-19T00:52:02.996577', '2545', '2'), - ('0.99', '296', '2007-04-09T04:16:48.996577', '5090', '2'), - ('4.99', '453', '2007-03-17T09:37:14.996577', '11794', '1'), - ('1.99', '150', '2007-02-20T21:34:33.996577', '3187', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['31739', '24815', '28994', '27901', '28450', '22481', '27420', '28543', '31933', '28310', '18790', '29875', '24828', '24994', '25775', '31937', '22703', '17518', '31434', '31109', '22127', '21773', '17987', '28833', '24240', '24502', '22475', '30517', '22431', '20162', '21897', '21635', '21692', '30842', '28332', '20573', '18962', '29346', '26068', '24561', '27681', '18568', '28087', '19053', '21754', '27073', '25244', '20951', '27932', '20682', '28082', '30378', '30502', '23255', '24315', '20313', '18092', '18456', '27529', '28182', '19613', '26633', '31475', '24237', '19709', '31115', '18050', '29099', '21396', '18352', '26891', '25770', '21669', '18006', '22853', '25590', '20176', '24825', '24168', '22406', '27330', '22237', '19210', '29548', '24626', '20616', '23242', '31466', '25493', '30457', '21456', '22130', '28906', '18461', '29159', '20822', '21446', '19041', '27560', '29038']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('0.99', '250', '2007-04-30T07:14:14.996577', '9099', '2'), - ('0.99', '231', '2007-03-18T01:02:48.996577', '12214', '1'), - ('5.99', '1', '2007-04-08T06:02:22.996577', '4611', '1'), - ('5.99', '509', '2007-04-28T22:06:23.996577', '8214', '1'), - ('7.99', '561', '2007-04-30T10:49:42.996577', '9839', '2'), - ('4.99', '582', '2007-03-21T08:17:22.996577', '14376', '1'), - ('0.99', '468', '2007-04-28T01:41:26.996577', '7685', '1'), - ('0.99', '570', '2007-04-08T09:47:57.996577', '4698', '1'), - ('2.99', '327', '2007-05-14T13:44:29.996577', '15297', '1'), - ('4.99', '547', '2007-04-10T16:16:00.996577', '5854', '2'), - ('0.99', '76', '2007-02-15T19:56:08.996577', '1487', '2'), - ('9.99', '79', '2007-04-27T08:04:20.996577', '7220', '1'), - ('0.99', '232', '2007-03-22T01:11:05.996577', '14857', '2'), - ('6.99', '251', '2007-03-19T15:37:48.996577', '13260', '2'), - ('4.99', '321', '2007-04-07T13:46:16.996577', '4281', '2'), - ('0.99', '336', '2007-05-14T13:44:29.996577', '13022', '1'), - ('4.99', '3', '2007-03-18T13:18:21.996577', '12556', '2'), - ('0.99', '343', '2007-02-21T14:42:28.996577', '3407', '1'), - ('7.99', '225', '2007-04-07T17:21:23.996577', '4345', '1'), - ('0.99', '186', '2007-04-28T03:50:17.996577', '7739', '2'), - ('9.99', '543', '2007-03-02T11:57:50.996577', '11241', '2'), - ('2.99', '504', '2007-03-19T13:34:00.996577', '13206', '2'), - ('2.99', '464', '2007-02-20T20:10:55.996577', '3167', '1'), - ('0.99', '593', '2007-04-08T17:39:18.996577', '4867', '2'), - ('0.99', '161', '2007-03-21T00:51:29.996577', '14150', '2'), - ('6.99', '189', '2007-03-20T04:29:41.996577', '13601', '2'), - ('0.99', '581', '2007-03-22T21:46:36.996577', '15403', '1'), - ('7.99', '135', '2007-04-09T02:29:28.996577', '5054', '2'), - ('0.99', '576', '2007-03-23T06:02:44.996577', '15634', '1'), - ('5.99', '337', '2007-03-20T23:42:03.996577', '14118', '2'), - ('2.99', '518', '2007-03-18T18:16:32.996577', '12681', '2'), - ('9.99', '489', '2007-03-02T07:13:10.996577', '11119', '2'), - ('4.99', '496', '2007-03-02T19:12:59.996577', '11448', '2'), - ('1.99', '163', '2007-04-27T11:23:05.996577', '7303', '1'), - ('4.99', '550', '2007-04-06T21:33:01.996577', '3979', '1'), - ('4.99', '379', '2007-03-22T21:40:25.996577', '15399', '2'), - ('4.99', '118', '2007-02-21T02:44:18.996577', '3263', '1'), - ('2.99', '32', '2007-04-11T23:17:31.996577', '6450', '2'), - ('4.99', '347', '2007-04-06T06:56:09.996577', '3666', '2'), - ('0.99', '196', '2007-03-23T18:38:39.996577', '15980', '2'), - ('2.99', '490', '2007-04-11T12:30:45.996577', '6230', '2'), - ('0.99', '20', '2007-02-16T01:02:19.996577', '1558', '2'), - ('0.99', '526', '2007-04-27T12:55:39.996577', '7343', '2'), - ('4.99', '143', '2007-02-19T03:48:57.996577', '2588', '1'), - ('1.99', '503', '2007-03-02T08:34:23.996577', '11161', '1'), - ('0.99', '436', '2007-04-08T07:42:22.996577', '4643', '2'), - ('4.99', '276', '2007-04-09T08:47:06.996577', '5186', '2'), - ('6.99', '417', '2007-03-21T05:51:36.996577', '14304', '1'), - ('4.99', '512', '2007-04-29T22:30:52.996577', '8868', '2'), - ('3.99', '390', '2007-03-20T02:18:50.996577', '13546', '2'), - ('7.99', '526', '2007-04-11T17:13:18.996577', '6316', '1'), - ('8.99', '123', '2007-04-08T17:22:33.996577', '4860', '1'), - ('4.99', '133', '2007-04-11T08:16:42.996577', '6157', '1'), - ('5.99', '59', '2007-03-22T05:41:19.996577', '14977', '1'), - ('6.99', '170', '2007-03-20T13:25:27.996577', '13862', '2'), - ('4.99', '352', '2007-03-21T00:11:37.996577', '14130', '1'), - ('2.99', '493', '2007-02-19T22:29:18.996577', '2864', '1'), - ('2.99', '595', '2007-02-14T22:16:01.996577', '1170', '2'), - ('2.99', '477', '2007-04-27T11:20:39.996577', '7302', '2'), - ('4.99', '534', '2007-04-08T23:35:47.996577', '4998', '2'), - ('0.99', '275', '2007-03-20T21:05:06.996577', '14063', '2'), - ('2.99', '396', '2007-04-12T14:23:06.996577', '6771', '2'), - ('3.99', '228', '2007-04-07T10:37:25.996577', '4217', '1'), - ('6.99', '161', '2007-03-01T22:46:33.996577', '10863', '1'), - ('7.99', '285', '2007-03-19T09:30:29.996577', '13102', '2'), - ('1.99', '186', '2007-04-30T19:17:40.996577', '10104', '1'), - ('0.99', '480', '2007-02-16T14:05:33.996577', '1733', '1'), - ('0.99', '10', '2007-04-09T20:27:23.996577', '5444', '1'), - ('2.99', '463', '2007-03-22T01:15:01.996577', '14859', '1'), - ('6.99', '569', '2007-02-15T19:06:17.996577', '1463', '1'), - ('3.99', '419', '2007-04-12T05:24:52.996577', '6587', '2'), - ('0.99', '320', '2007-04-28T22:58:32.996577', '8238', '1'), - ('0.99', '493', '2007-03-22T19:47:50.996577', '15355', '1'), - ('0.99', '468', '2007-02-19T19:45:32.996577', '2831', '1'), - ('0.99', '18', '2007-03-18T05:20:05.996577', '12333', '2'), - ('2.99', '304', '2007-04-09T18:52:04.996577', '5411', '1'), - ('4.99', '339', '2007-03-02T08:52:07.996577', '11171', '2'), - ('2.99', '232', '2007-03-19T00:43:58.996577', '12853', '2'), - ('4.99', '154', '2007-03-20T13:25:19.996577', '13861', '2'), - ('3.99', '574', '2007-03-17T08:54:19.996577', '11775', '2'), - ('9.99', '459', '2007-04-29T00:51:50.996577', '8289', '1'), - ('2.99', '555', '2007-03-18T07:16:35.996577', '12388', '1'), - ('4.99', '185', '2007-02-21T06:45:26.996577', '3314', '1'), - ('4.99', '49', '2007-04-30T11:18:50.996577', '9851', '1'), - ('2.99', '209', '2007-03-01T11:24:45.996577', '10554', '2'), - ('4.99', '383', '2007-03-21T18:41:09.996577', '14678', '2'), - ('6.99', '58', '2007-03-19T13:02:38.996577', '13194', '1'), - ('0.99', '227', '2007-04-28T22:47:46.996577', '8234', '1'), - ('2.99', '296', '2007-04-06T13:47:10.996577', '3810', '1'), - ('4.99', '129', '2007-04-29T03:09:39.996577', '8339', '1'), - ('4.99', '469', '2007-03-20T06:26:47.996577', '13654', '1'), - ('1.99', '543', '2007-03-22T17:38:52.996577', '15281', '2'), - ('2.99', '599', '2007-04-12T19:52:25.996577', '6895', '2'), - ('4.99', '597', '2007-02-19T11:57:08.996577', '2696', '1'), - ('0.99', '15', '2007-04-28T21:19:16.996577', '8193', '1'), - ('5.99', '405', '2007-03-18T08:46:32.996577', '12425', '2'), - ('2.99', '468', '2007-03-23T13:57:43.996577', '15836', '1'), - ('2.99', '140', '2007-02-16T10:37:46.996577', '1687', '1'), - ('2.99', '480', '2007-04-27T09:32:43.996577', '7257', '1'), - ('2.99', '5', '2007-04-08T18:33:09.996577', '4889', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['26931', '20683', '22817', '17715', '20151', '26950', '17522', '28425', '18570', '28224', '24876', '22794', '22531', '29627', '23502', '29055', '28607', '17995', '29626', '25306', '29463', '24274', '31365', '28633', '29587', '25835', '19790', '21778', '18009', '23490', '20416', '28215', '18327', '31995', '19820', '19879', '28143', '20903', '23489', '19599', '24961', '30021', '29834', '22331', '28829', '22452', '23884', '24332', '31260', '22329', '20605', '29686', '27630', '26229', '29049', '31975', '18555', '30084', '23718', '24420', '19757', '19991', '23816', '22757', '24211', '26731', '21570', '32044', '30257', '24689', '22975', '26580', '27868', '20020', '19165', '31474', '21283', '28238', '24137', '29682', '20954', '19128', '25760', '23785', '26572', '28300', '22309', '22015', '26664', '25638', '21210', '25503', '21805', '20105', '24247', '20261', '27523', '21757', '20911', '20438']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('5.99', '423', '2007-04-27T00:43:42.996577', '7016', '1'), - ('3.99', '390', '2007-03-20T04:18:31.996577', '13591', '2'), - ('2.99', '15', '2007-03-02T14:16:34.996577', '11307', '2'), - ('2.99', '392', '2007-02-16T16:20:20.996577', '1764', '2'), - ('2.99', '336', '2007-03-21T05:37:53.996577', '14295', '1'), - ('1.99', '424', '2007-04-30T02:18:01.996577', '8964', '2'), - ('0.99', '345', '2007-02-15T01:26:17.996577', '1210', '2'), - ('1.99', '559', '2007-04-28T01:27:34.996577', '7680', '1'), - ('4.99', '20', '2007-02-18T10:14:52.996577', '2343', '2'), - ('8.99', '538', '2007-04-09T06:21:48.996577', '5135', '2'), - ('5.99', '238', '2007-03-01T15:09:00.996577', '10659', '1'), - ('4.99', '12', '2007-03-21T03:48:05.996577', '14240', '2'), - ('4.99', '588', '2007-03-18T23:28:08.996577', '12815', '2'), - ('4.99', '57', '2007-04-12T00:18:47.996577', '6482', '2'), - ('8.99', '85', '2007-03-02T05:31:50.996577', '11067', '2'), - ('0.99', '6', '2007-04-10T01:32:01.996577', '5553', '1'), - ('8.99', '575', '2007-04-10T17:35:13.996577', '5875', '2'), - ('4.99', '466', '2007-02-21T01:16:22.996577', '3237', '2'), - ('2.99', '57', '2007-04-10T21:40:34.996577', '5948', '2'), - ('0.99', '282', '2007-04-09T05:34:44.996577', '5113', '1'), - ('7.99', '41', '2007-04-30T21:55:57.996577', '10170', '1'), - ('2.99', '166', '2007-03-21T05:09:14.996577', '14281', '2'), - ('6.99', '218', '2007-04-30T12:52:59.996577', '9902', '2'), - ('2.99', '577', '2007-04-08T20:12:26.996577', '4922', '1'), - ('4.99', '52', '2007-04-29T14:46:15.996577', '8686', '1'), - ('5.99', '326', '2007-04-09T06:46:07.996577', '5147', '1'), - ('5.99', '294', '2007-03-23T14:03:12.996577', '15839', '1'), - ('8.99', '504', '2007-03-23T09:45:52.996577', '15723', '1'), - ('0.99', '470', '2007-02-15T04:42:23.996577', '1256', '2'), - ('4.99', '84', '2007-03-02T11:00:07.996577', '11220', '2'), - ('4.99', '364', '2007-03-18T13:19:29.996577', '12557', '1'), - ('2.99', '537', '2007-04-11T16:42:31.996577', '6310', '2'), - ('0.99', '561', '2007-02-19T01:14:01.996577', '2548', '1'), - ('5.98', '560', '2007-05-14T13:44:29.996577', '12116', '2'), - ('2.99', '297', '2007-03-23T04:14:10.996577', '15582', '2'), - ('4.99', '304', '2007-03-17T16:42:21.996577', '11983', '2'), - ('4.99', '531', '2007-04-10T19:08:10.996577', '5904', '2'), - ('2.99', '413', '2007-03-18T13:15:00.996577', '12552', '2'), - ('2.99', '84', '2007-03-01T22:56:16.996577', '10872', '1'), - ('4.99', '274', '2007-03-21T08:43:39.996577', '14388', '1'), - ('2.99', '247', '2007-03-02T10:24:57.996577', '11204', '2'), - ('4.99', '91', '2007-04-30T16:28:02.996577', '10008', '2'), - ('4.99', '75', '2007-04-30T22:27:47.996577', '9501', '2'), - ('4.99', '565', '2007-03-19T13:07:40.996577', '13195', '2'), - ('2.99', '593', '2007-04-07T03:20:10.996577', '4075', '2'), - ('5.99', '579', '2007-03-18T04:43:32.996577', '12315', '2'), - ('0.99', '129', '2007-03-01T08:16:55.996577', '10468', '1'), - ('8.99', '172', '2007-03-18T16:40:05.996577', '12638', '2'), - ('5.99', '209', '2007-04-07T03:05:52.996577', '4071', '2'), - ('2.99', '565', '2007-03-17T09:42:04.996577', '11795', '1'), - ('4.99', '382', '2007-03-20T18:55:19.996577', '14009', '1'), - ('3.99', '63', '2007-04-30T00:25:30.996577', '9549', '2'), - ('2.99', '485', '2007-04-30T23:47:19.996577', '9535', '1'), - ('3.99', '360', '2007-04-28T10:01:23.996577', '7908', '2'), - ('2.99', '5', '2007-04-28T23:39:49.996577', '8263', '1'), - ('2.99', '493', '2007-05-14T13:44:29.996577', '14160', '2'), - ('7.99', '16', '2007-02-17T06:19:19.996577', '1944', '1'), - ('4.99', '98', '2007-04-08T02:53:29.996577', '4549', '1'), - ('4.99', '112', '2007-03-22T18:14:23.996577', '15304', '2'), - ('4.99', '181', '2007-03-01T01:29:52.996577', '10262', '2'), - ('2.99', '290', '2007-03-20T07:26:17.996577', '13687', '2'), - ('2.99', '317', '2007-03-17T21:28:21.996577', '12111', '2'), - ('2.99', '121', '2007-03-23T20:48:52.996577', '16041', '1'), - ('2.99', '8', '2007-03-01T11:34:01.996577', '10561', '2'), - ('2.99', '158', '2007-03-23T11:31:25.996577', '15763', '1'), - ('7.99', '405', '2007-04-09T01:45:00.996577', '5040', '2'), - ('2.99', '481', '2007-03-20T00:15:04.996577', '13497', '2'), - ('4.99', '91', '2007-05-14T13:44:29.996577', '12902', '1'), - ('6.99', '112', '2007-04-30T15:48:10.996577', '9321', '2'), - ('0.99', '215', '2007-03-19T08:56:48.996577', '13085', '2'), - ('4.99', '29', '2007-03-21T19:29:45.996577', '14703', '1'), - ('0.99', '391', '2007-04-08T10:47:17.996577', '4716', '1'), - ('2.99', '507', '2007-04-07T22:12:12.996577', '4455', '2'), - ('6.99', '321', '2007-03-23T07:41:16.996577', '15673', '1'), - ('0.99', '174', '2007-02-16T05:03:25.996577', '1609', '1'), - ('0.99', '228', '2007-04-06T13:13:48.996577', '3796', '2'), - ('7.99', '453', '2007-03-20T08:03:46.996577', '13711', '1'), - ('0.99', '539', '2007-04-07T12:20:20.996577', '4247', '1'), - ('5.99', '151', '2007-03-20T03:31:12.996577', '13568', '1'), - ('8.99', '63', '2007-04-12T17:51:03.996577', '6847', '2'), - ('0.99', '417', '2007-03-23T12:36:22.996577', '15795', '1'), - ('7.99', '163', '2007-02-17T18:14:15.996577', '2110', '2'), - ('4.99', '319', '2007-04-30T03:54:46.996577', '9017', '2'), - ('2.99', '119', '2007-03-21T08:29:29.996577', '14382', '2'), - ('3.99', '390', '2007-04-27T19:21:03.996577', '7515', '2'), - ('9.99', '546', '2007-04-12T13:42:15.996577', '6758', '2'), - ('3.99', '563', '2007-03-23T06:23:20.996577', '15638', '2'), - ('2.99', '531', '2007-03-17T04:13:36.996577', '11666', '1'), - ('0.99', '399', '2007-04-09T23:17:30.996577', '5507', '1'), - ('3.99', '308', '2007-04-06T22:36:44.996577', '4002', '1'), - ('4.99', '445', '2007-03-22T04:54:18.996577', '14955', '1'), - ('2.99', '296', '2007-04-30T15:10:00.996577', '9304', '1'), - ('8.99', '508', '2007-03-01T18:27:15.996577', '10746', '1'), - ('1.99', '331', '2007-03-21T17:05:50.996577', '14628', '1'), - ('4.99', '162', '2007-03-19T16:58:36.996577', '13288', '1'), - ('5.99', '347', '2007-03-19T17:41:09.996577', '13314', '2'), - ('6.99', '476', '2007-04-30T15:57:45.996577', '9325', '2'), - ('4.99', '503', '2007-03-18T22:29:40.996577', '12783', '2'), - ('4.99', '414', '2007-03-19T03:39:58.996577', '12930', '2'), - ('2.99', '366', '2007-03-21T08:44:04.996577', '14390', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['23073', '24281', '18235', '18000', '26215', '27593', '20435', '18547', '22496', '18217', '31374', '19979', '28329', '30403', '23601', '30221', '31639', '29200', '31265', '27684', '28920', '18748', '28512', '27534', '18098', '17839', '19656', '23574', '26831', '20900', '29122', '23084', '23500', '17825', '27187', '18481', '27342', '21542', '31729', '30499', '30200', '23258', '31720', '23688', '30220', '29013', '22469', '19863', '18400', '20684', '19214', '18616', '20794', '26047', '20033', '23828', '25733', '28995', '18249', '19414', '28279', '24767', '19200', '28487', '31633', '18469', '28132', '25003', '21637', '28592', '20414', '26859', '23032', '27571', '19609', '20277', '18981', '30042', '28879', '25360', '17984', '29675', '23176', '27967', '30294', '17681', '24851', '21665', '27661', '19877', '28785', '22002', '19347', '30580', '19209', '19887', '18230', '28982', '27163', '26281']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('3.99', '40', '2007-03-17T15:39:31.996577', '11948', '2'), - ('4.99', '167', '2007-03-19T05:25:53.996577', '12978', '1'), - ('0.99', '533', '2007-02-20T05:15:49.996577', '2956', '1'), - ('6.99', '467', '2007-02-21T01:45:02.996577', '3250', '1'), - ('0.99', '359', '2007-04-27T04:11:24.996577', '7115', '1'), - ('9.99', '483', '2007-04-12T20:12:42.996577', '6899', '2'), - ('2.99', '366', '2007-03-20T13:18:32.996577', '13857', '1'), - ('4.99', '13', '2007-02-18T00:52:27.996577', '2209', '1'), - ('8.99', '584', '2007-03-18T11:47:39.996577', '12507', '2'), - ('0.99', '527', '2007-02-18T20:48:37.996577', '2496', '2'), - ('2.99', '219', '2007-04-11T11:04:31.996577', '6209', '1'), - ('2.99', '315', '2007-03-17T22:52:56.996577', '12155', '2'), - ('7.99', '549', '2007-04-30T20:19:08.996577', '9445', '2'), - ('2.99', '125', '2007-04-29T03:53:56.996577', '8375', '2'), - ('3.99', '96', '2007-03-21T11:19:23.996577', '14462', '1'), - ('4.99', '108', '2007-04-10T13:40:20.996577', '5806', '2'), - ('0.99', '241', '2007-04-08T11:36:44.996577', '4731', '1'), - ('2.99', '20', '2007-04-10T09:31:46.996577', '5718', '1'), - ('5.99', '209', '2007-04-09T10:26:21.996577', '5219', '2'), - ('8.99', '490', '2007-04-12T21:09:14.996577', '6923', '2'), - ('2.99', '202', '2007-04-30T05:42:44.996577', '9057', '2'), - ('5.99', '62', '2007-02-20T10:45:29.996577', '3035', '1'), - ('3.99', '566', '2007-04-30T05:24:34.996577', '9688', '1'), - ('8.99', '477', '2007-04-30T20:21:27.996577', '9446', '2'), - ('2.99', '496', '2007-02-19T02:33:12.996577', '2567', '1'), - ('7.99', '429', '2007-02-17T03:58:25.996577', '1916', '2'), - ('6.99', '279', '2007-03-02T12:04:08.996577', '11250', '2'), - ('4.99', '93', '2007-03-18T19:11:26.996577', '12704', '1'), - ('7.99', '413', '2007-04-10T18:44:40.996577', '5897', '1'), - ('2.99', '413', '2007-03-02T14:08:36.996577', '11304', '2'), - ('0.99', '12', '2007-04-27T00:12:29.996577', '7008', '2'), - ('2.99', '41', '2007-03-17T22:38:46.996577', '12147', '2'), - ('4.99', '85', '2007-03-01T03:24:36.996577', '10328', '1'), - ('0.99', '426', '2007-02-19T17:53:20.996577', '2804', '1'), - ('2.99', '445', '2007-04-27T13:06:02.996577', '7351', '2'), - ('4.99', '204', '2007-02-19T14:04:53.996577', '2734', '2'), - ('6.99', '460', '2007-04-27T04:39:26.996577', '7125', '1'), - ('2.99', '478', '2007-03-17T14:09:12.996577', '11906', '1'), - ('7.99', '249', '2007-04-12T10:12:59.996577', '6670', '2'), - ('6.99', '133', '2007-04-08T09:04:29.996577', '4681', '1'), - ('6.99', '107', '2007-04-06T14:11:41.996577', '3824', '2'), - ('2.99', '59', '2007-03-23T16:01:30.996577', '15905', '2'), - ('4.99', '248', '2007-04-08T02:32:45.996577', '4541', '2'), - ('8.99', '108', '2007-03-23T03:20:42.996577', '15556', '2'), - ('5.99', '108', '2007-04-10T06:22:17.996577', '5661', '1'), - ('4.99', '2', '2007-04-30T04:34:36.996577', '9031', '1'), - ('2.99', '581', '2007-03-02T18:57:56.996577', '11443', '2'), - ('4.99', '302', '2007-03-20T23:53:26.996577', '14120', '1'), - ('2.99', '581', '2007-02-17T17:25:28.996577', '2101', '2'), - ('7.99', '390', '2007-03-20T05:05:12.996577', '13618', '2'), - ('2.99', '186', '2007-02-16T08:42:41.996577', '1663', '1'), - ('7.99', '29', '2007-02-19T12:01:32.996577', '2701', '1'), - ('2.99', '403', '2007-03-01T20:06:21.996577', '10789', '2'), - ('2.99', '345', '2007-04-28T18:15:28.996577', '8129', '2'), - ('2.99', '323', '2007-03-17T23:34:20.996577', '12169', '1'), - ('2.99', '123', '2007-03-20T06:54:32.996577', '13668', '1'), - ('8.99', '317', '2007-04-07T08:41:02.996577', '4177', '1'), - ('4.99', '1', '2007-04-09T11:52:33.996577', '5244', '1'), - ('8.99', '537', '2007-02-20T17:57:35.996577', '3134', '2'), - ('4.99', '242', '2007-02-15T19:50:24.996577', '1483', '1'), - ('2.99', '543', '2007-04-30T22:39:45.996577', '9505', '1'), - ('2.99', '224', '2007-03-22T02:13:02.996577', '14880', '2'), - ('2.99', '182', '2007-02-17T13:27:02.996577', '2049', '1'), - ('2.99', '565', '2007-04-07T20:28:30.996577', '4413', '1'), - ('8.99', '240', '2007-04-27T17:20:20.996577', '7467', '1'), - ('4.99', '202', '2007-02-15T23:20:30.996577', '1535', '1'), - ('0.99', '530', '2007-04-10T06:29:59.996577', '5663', '2'), - ('4.99', '252', '2007-03-21T22:20:58.996577', '14774', '1'), - ('6.99', '489', '2007-03-18T11:26:51.996577', '12496', '1'), - ('4.99', '574', '2007-04-06T22:49:17.996577', '4004', '1'), - ('5.99', '364', '2007-03-01T02:08:16.996577', '10290', '2'), - ('7.99', '416', '2007-04-12T19:06:03.996577', '6879', '1'), - ('6.99', '36', '2007-03-02T02:24:49.996577', '10964', '2'), - ('0.99', '481', '2007-04-11T01:47:05.996577', '6044', '1'), - ('3.99', '275', '2007-03-19T07:22:23.996577', '13037', '1'), - ('3.99', '348', '2007-03-20T21:57:51.996577', '14079', '2'), - ('4.99', '123', '2007-02-15T20:10:43.996577', '1490', '2'), - ('0.99', '93', '2007-04-28T22:44:49.996577', '8233', '1'), - ('0.99', '597', '2007-04-09T04:27:38.996577', '5093', '1'), - ('3.99', '286', '2007-04-06T08:22:38.996577', '3692', '2'), - ('2.99', '463', '2007-02-20T23:56:38.996577', '3217', '1'), - ('0.99', '62', '2007-04-30T18:35:36.996577', '10080', '2'), - ('4.99', '51', '2007-03-21T16:36:06.996577', '14617', '1'), - ('4.99', '516', '2007-04-30T12:34:53.996577', '9243', '2'), - ('2.99', '115', '2007-04-11T05:59:34.996577', '6113', '2'), - ('4.99', '384', '2007-02-20T15:17:24.996577', '3101', '2'), - ('0.99', '235', '2007-03-19T08:24:49.996577', '13070', '2'), - ('2.99', '493', '2007-03-20T05:49:41.996577', '13638', '1'), - ('5.99', '488', '2007-04-12T03:29:12.996577', '6548', '2'), - ('3.99', '303', '2007-03-23T01:24:08.996577', '15511', '1'), - ('2.99', '590', '2007-04-08T10:33:19.996577', '4710', '1'), - ('2.99', '529', '2007-03-22T18:14:31.996577', '15305', '2'), - ('4.99', '226', '2007-02-21T20:41:59.996577', '3466', '1'), - ('5.99', '139', '2007-04-28T05:10:28.996577', '7767', '2'), - ('4.99', '185', '2007-02-18T18:12:34.996577', '2459', '1'), - ('2.99', '305', '2007-03-02T02:46:19.996577', '10981', '1'), - ('5.99', '533', '2007-02-15T16:25:30.996577', '1421', '1'), - ('4.99', '208', '2007-04-08T23:04:28.996577', '4985', '2'), - ('5.99', '442', '2007-04-30T12:00:44.996577', '9873', '2'), - ('2.99', '364', '2007-04-27T09:58:46.996577', '7272', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['19561', '17816', '26949', '29379', '26487', '31004', '19640', '26349', '22683', '20374', '21910', '27873', '22315', '19735', '20346', '21811', '17911', '24728', '21421', '20473', '22604', '21007', '19692', '26436', '20897', '22006', '22668', '17708', '31858', '24001', '28109', '21585', '18932', '18674', '22693', '27153', '21814', '18333', '19982', '24435', '26895', '28187', '30290', '21010', '29222', '21928', '25976', '17649', '31754', '31433', '21323', '29307', '20982', '21014', '17838', '20800', '25751', '21389', '23052', '25374', '28598', '26033', '27452', '31661', '25279', '21192', '21439', '28097', '23957', '28384', '22354', '27158', '29733', '30757', '30915', '21358', '29401', '29690', '27821', '20421', '25876', '28477', '26302', '29869', '27161', '18960', '20673', '25834', '18390', '22523', '22580', '21891', '25719', '20627', '25754', '21656', '29735', '28762', '18874', '23522']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('4.99', '271', '2007-03-01T02:53:13.996577', '10310', '2'), - ('6.99', '423', '2007-02-19T15:33:01.996577', '2758', '2'), - ('4.99', '424', '2007-04-30T00:24:48.996577', '8918', '1'), - ('4.99', '35', '2007-04-12T04:08:16.996577', '6565', '1'), - ('4.99', '382', '2007-04-07T17:32:50.996577', '4351', '2'), - ('9.99', '177', '2007-04-11T11:42:11.996577', '6217', '2'), - ('4.99', '277', '2007-03-21T03:24:57.996577', '14227', '2'), - ('7.99', '370', '2007-04-07T19:50:52.996577', '4400', '2'), - ('4.99', '1', '2007-03-17T11:06:20.996577', '11824', '2'), - ('5.99', '360', '2007-03-17T20:48:42.996577', '12088', '2'), - ('4.99', '520', '2007-03-01T10:29:43.996577', '10530', '2'), - ('1.99', '507', '2007-04-11T20:59:34.996577', '6396', '1'), - ('6.99', '564', '2007-03-18T00:37:24.996577', '12197', '2'), - ('0.99', '288', '2007-03-20T23:31:56.996577', '14113', '2'), - ('6.99', '356', '2007-03-20T07:58:01.996577', '13703', '2'), - ('4.99', '508', '2007-03-22T14:36:49.996577', '15195', '1'), - ('0.99', '449', '2007-02-18T10:44:09.996577', '2348', '1'), - ('4.99', '220', '2007-03-01T19:40:05.996577', '10778', '2'), - ('4.99', '466', '2007-03-22T16:00:07.996577', '15230', '2'), - ('4.99', '370', '2007-03-18T05:33:32.996577', '12339', '1'), - ('5.99', '597', '2007-03-17T12:56:54.996577', '11880', '1'), - ('2.99', '422', '2007-03-22T17:21:54.996577', '15273', '1'), - ('2.99', '283', '2007-03-19T14:36:59.996577', '13229', '1'), - ('7.99', '377', '2007-04-12T19:48:37.996577', '6893', '2'), - ('4.99', '412', '2007-03-23T10:03:38.996577', '15732', '2'), - ('2.99', '530', '2007-03-18T07:14:50.996577', '12387', '1'), - ('3.99', '207', '2007-03-01T00:24:46.996577', '10234', '2'), - ('5.99', '390', '2007-02-20T18:53:43.996577', '3147', '1'), - ('0.99', '262', '2007-04-11T15:45:06.996577', '6291', '1'), - ('4.99', '140', '2007-03-18T18:02:28.996577', '12675', '1'), - ('5.99', '528', '2007-04-08T05:06:38.996577', '4593', '1'), - ('2.99', '482', '2007-03-23T14:46:51.996577', '15865', '2'), - ('4.99', '111', '2007-02-18T06:46:07.996577', '2297', '2'), - ('3.99', '42', '2007-02-17T22:26:00.996577', '2170', '1'), - ('5.99', '2', '2007-03-02T06:10:07.996577', '11087', '1'), - ('2.99', '442', '2007-04-07T18:16:12.996577', '4365', '2'), - ('4.99', '509', '2007-03-17T21:27:01.996577', '12109', '2'), - ('3.99', '562', '2007-02-19T14:50:06.996577', '2746', '1'), - ('6.99', '315', '2007-03-23T01:13:47.996577', '15504', '1'), - ('4.99', '181', '2007-03-23T00:29:46.996577', '15482', '2'), - ('2.99', '419', '2007-04-30T20:50:26.996577', '10150', '1'), - ('4.99', '534', '2007-04-30T20:59:57.996577', '9464', '2'), - ('0.99', '115', '2007-04-06T04:34:53.996577', '3624', '1'), - ('2.99', '423', '2007-03-02T06:25:07.996577', '11091', '1'), - ('0.99', '22', '2007-04-30T19:06:31.996577', '9410', '2'), - ('4.99', '521', '2007-03-18T12:23:14.996577', '12530', '1'), - ('2.99', '338', '2007-04-06T11:51:19.996577', '3772', '2'), - ('5.99', '379', '2007-02-18T07:25:11.996577', '2313', '1'), - ('0.99', '252', '2007-04-11T19:52:02.996577', '6369', '2'), - ('4.99', '225', '2007-04-06T02:04:27.996577', '3574', '2'), - ('4.99', '457', '2007-03-17T23:34:39.996577', '12171', '1'), - ('4.99', '29', '2007-04-30T14:17:20.996577', '9946', '1'), - ('4.99', '420', '2007-03-01T02:08:23.996577', '10291', '2'), - ('4.99', '423', '2007-03-22T03:00:16.996577', '14902', '2'), - ('2.99', '429', '2007-02-16T18:44:41.996577', '1798', '2'), - ('5.99', '403', '2007-03-17T17:25:21.996577', '12005', '2'), - ('2.99', '319', '2007-04-07T14:37:17.996577', '4295', '2'), - ('0.99', '463', '2007-03-01T06:03:51.996577', '10405', '2'), - ('6.99', '38', '2007-03-01T10:21:38.996577', '10524', '2'), - ('3.99', '286', '2007-04-30T09:47:47.996577', '9809', '1'), - ('2.99', '574', '2007-04-10T05:06:26.996577', '5640', '1'), - ('5.99', '343', '2007-04-30T20:53:00.996577', '9458', '2'), - ('10.99', '470', '2007-04-26T21:24:26.996577', '6927', '1'), - ('6.99', '242', '2007-04-30T07:18:34.996577', '9730', '1'), - ('2.99', '279', '2007-04-28T11:34:16.996577', '7947', '1'), - ('2.99', '444', '2007-03-18T19:32:39.996577', '12712', '2'), - ('4.99', '468', '2007-03-21T00:58:26.996577', '14154', '2'), - ('0.99', '527', '2007-04-08T18:32:53.996577', '4888', '1'), - ('2.99', '136', '2007-03-21T10:16:58.996577', '14437', '1'), - ('7.99', '555', '2007-04-30T15:52:47.996577', '9990', '2'), - ('0.99', '568', '2007-03-01T16:32:44.996577', '10689', '2'), - ('0.99', '442', '2007-04-27T17:10:01.996577', '7460', '1'), - ('2.99', '67', '2007-04-09T18:21:10.996577', '5399', '2'), - ('5.99', '155', '2007-04-28T03:28:14.996577', '7730', '2'), - ('4.99', '169', '2007-04-08T09:22:45.996577', '4687', '1'), - ('5.99', '460', '2007-03-20T15:19:44.996577', '13920', '2'), - ('5.99', '37', '2007-04-09T19:30:52.996577', '5425', '1'), - ('0.99', '64', '2007-04-06T21:42:42.996577', '3982', '2'), - ('4.99', '502', '2007-04-27T09:18:20.996577', '7255', '1'), - ('4.99', '364', '2007-03-21T05:35:13.996577', '14293', '2'), - ('2.99', '330', '2007-04-12T10:27:02.996577', '6678', '2'), - ('0.99', '564', '2007-04-07T19:17:04.996577', '4385', '2'), - ('5.99', '366', '2007-04-12T12:46:21.996577', '6738', '2'), - ('4.99', '79', '2007-04-07T02:03:19.996577', '4049', '2'), - ('4.99', '442', '2007-04-29T17:49:15.996577', '8758', '1'), - ('4.99', '118', '2007-02-16T16:28:03.996577', '1766', '2'), - ('2.99', '389', '2007-03-21T15:22:04.996577', '14578', '1'), - ('7.99', '326', '2007-04-07T07:41:43.996577', '4160', '1'), - ('2.99', '577', '2007-02-21T04:59:55.996577', '3286', '2'), - ('4.99', '587', '2007-03-02T17:38:47.996577', '11403', '2'), - ('2.99', '595', '2007-03-02T01:14:48.996577', '10932', '1'), - ('0.99', '517', '2007-03-19T20:34:35.996577', '13396', '1'), - ('9.99', '315', '2007-04-30T07:26:15.996577', '9735', '2'), - ('4.99', '385', '2007-03-01T15:01:53.996577', '10655', '1'), - ('2.99', '319', '2007-04-10T17:49:00.996577', '5882', '1'), - ('2.99', '491', '2007-03-20T04:37:08.996577', '13607', '2'), - ('2.99', '67', '2007-04-11T07:02:46.996577', '6137', '1'), - ('5.99', '588', '2007-04-07T10:01:11.996577', '4207', '2'), - ('3.99', '96', '2007-02-15T05:40:05.996577', '1266', '1'), - ('8.99', '87', '2007-03-18T02:39:29.996577', '12257', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['22445', '20625', '19040', '28383', '31228', '21666', '29168', '29217', '24277', '25329', '18528', '21321', '18526', '29703', '24845', '20344', '31097', '22247', '17714', '30856', '19381', '27902', '30948', '27563', '20567', '31566', '20038', '30503', '25236', '19309', '20932', '20693', '19272', '22057', '18974', '28783', '29138', '31844', '24024', '32028', '19753', '19433', '18628', '28458', '23445', '19352', '28119', '22561', '29324', '31905', '19271', '31312', '23783', '23192', '29080', '18427', '24909', '27030', '26629', '31471', '27438', '27154', '30234', '29109', '29053', '24590', '24647', '28874', '26169', '23071', '19738', '30325', '22490', '19341', '21971', '18523', '24362', '27453', '30714', '30924', '22453', '32002', '30582', '27835', '23733', '23148', '29296', '30967', '19659', '24588', '17614', '22520', '18591', '27430', '23162', '31313', '23409', '23513', '25459', '19655']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('7.99', '578', '2007-03-02T10:16:06.996577', '11199', '1'), - ('0.99', '385', '2007-03-01T11:27:50.996577', '10557', '1'), - ('4.99', '140', '2007-02-16T03:19:44.996577', '1586', '1'), - ('5.99', '555', '2007-04-30T15:01:17.996577', '9299', '1'), - ('0.99', '198', '2007-04-30T17:56:25.996577', '9389', '2'), - ('6.99', '493', '2007-03-20T07:01:17.996577', '13675', '2'), - ('4.99', '16', '2007-04-11T05:08:57.996577', '6100', '1'), - ('2.99', '22', '2007-04-07T10:29:18.996577', '4215', '2'), - ('1.99', '166', '2007-03-23T13:00:16.996577', '15806', '2'), - ('0.99', '283', '2007-04-28T06:42:38.996577', '7816', '1'), - ('5.99', '8', '2007-02-17T16:50:01.996577', '2095', '1'), - ('6.99', '457', '2007-03-17T15:50:31.996577', '11956', '2'), - ('0.99', '7', '2007-02-20T08:40:19.996577', '3007', '1'), - ('2.99', '64', '2007-04-27T02:55:58.996577', '7082', '1'), - ('5.99', '234', '2007-03-19T03:16:14.996577', '12921', '1'), - ('4.99', '356', '2007-03-19T09:42:24.996577', '13107', '2'), - ('2.99', '185', '2007-04-08T01:39:14.996577', '4524', '1'), - ('1.99', '557', '2007-03-18T13:17:48.996577', '12555', '1'), - ('6.99', '392', '2007-02-15T23:06:33.996577', '1530', '2'), - ('4.99', '164', '2007-04-29T20:51:24.996577', '8824', '2'), - ('4.99', '235', '2007-02-15T20:18:58.996577', '1493', '1'), - ('0.99', '509', '2007-04-28T23:01:58.996577', '8240', '2'), - ('7.99', '172', '2007-04-11T13:26:17.996577', '6246', '2'), - ('6.99', '480', '2007-04-30T02:25:21.996577', '8967', '1'), - ('7.99', '379', '2007-03-19T20:35:01.996577', '13397', '2'), - ('5.99', '235', '2007-04-30T03:57:19.996577', '9019', '1'), - ('0.99', '323', '2007-03-23T09:58:58.996577', '15728', '1'), - ('3.99', '133', '2007-04-12T06:48:07.996577', '6609', '1'), - ('5.99', '275', '2007-04-11T16:22:35.996577', '6301', '2'), - ('2.99', '213', '2007-02-21T06:39:44.996577', '3313', '1'), - ('6.99', '416', '2007-03-02T01:28:44.996577', '10937', '1'), - ('0.99', '391', '2007-03-17T20:50:09.996577', '12090', '1'), - ('2.99', '197', '2007-02-19T16:53:08.996577', '2781', '2'), - ('0.99', '535', '2007-03-18T01:45:20.996577', '12233', '1'), - ('0.99', '122', '2007-02-15T01:29:46.996577', '1211', '1'), - ('4.99', '589', '2007-04-30T09:26:42.996577', '9153', '1'), - ('0.99', '13', '2007-04-30T19:58:07.996577', '9434', '2'), - ('0.99', '260', '2007-04-29T16:09:11.996577', '8717', '1'), - ('0.99', '142', '2007-03-19T04:57:39.996577', '12964', '1'), - ('4.99', '52', '2007-05-14T13:44:29.996577', '12001', '1'), - ('3.99', '290', '2007-03-18T00:32:25.996577', '12193', '2'), - ('3.99', '248', '2007-02-17T14:35:34.996577', '2066', '1'), - ('6.99', '31', '2007-02-18T10:03:56.996577', '2341', '2'), - ('2.99', '562', '2007-04-27T20:48:43.996577', '7560', '2'), - ('0.99', '79', '2007-03-21T01:42:53.996577', '14179', '1'), - ('3.99', '228', '2007-02-18T05:28:17.996577', '2284', '2'), - ('5.99', '529', '2007-04-07T21:36:10.996577', '4444', '2'), - ('2.99', '592', '2007-03-01T14:06:14.996577', '10634', '2'), - ('0.99', '30', '2007-04-30T00:33:24.996577', '9551', '2'), - ('2.99', '265', '2007-04-30T19:21:11.996577', '9416', '1'), - ('4.99', '197', '2007-02-19T15:05:50.996577', '2750', '1'), - ('6.99', '212', '2007-04-08T20:00:43.996577', '4916', '2'), - ('4.99', '119', '2007-03-20T03:54:41.996577', '13581', '1'), - ('5.99', '53', '2007-03-19T07:54:06.996577', '13049', '1'), - ('4.99', '8', '2007-04-11T20:08:12.996577', '6375', '1'), - ('3.99', '588', '2007-02-20T02:41:12.996577', '2920', '2'), - ('2.99', '241', '2007-03-21T12:20:33.996577', '14485', '2'), - ('4.99', '432', '2007-04-10T21:20:10.996577', '5944', '1'), - ('6.99', '396', '2007-04-06T18:23:07.996577', '3909', '2'), - ('0.99', '228', '2007-04-06T00:05:33.996577', '3538', '2'), - ('4.99', '469', '2007-04-28T04:51:18.996577', '7756', '2'), - ('3.99', '442', '2007-04-08T04:27:26.996577', '4577', '2'), - ('2.99', '109', '2007-04-30T11:54:12.996577', '9871', '1'), - ('4.99', '11', '2007-04-27T11:41:58.996577', '7314', '1'), - ('0.99', '6', '2007-04-06T21:42:47.996577', '3983', '2'), - ('2.99', '198', '2007-03-21T08:22:18.996577', '14380', '2'), - ('3.99', '211', '2007-03-17T16:04:13.996577', '11963', '2'), - ('2.99', '596', '2007-04-11T00:32:38.996577', '6015', '1'), - ('5.99', '355', '2007-04-10T01:51:31.996577', '5564', '1'), - ('2.99', '40', '2007-03-01T07:26:34.996577', '10442', '1'), - ('2.99', '288', '2007-03-22T11:09:59.996577', '15119', '1'), - ('4.99', '118', '2007-04-28T12:00:43.996577', '7956', '2'), - ('4.99', '583', '2007-03-02T03:31:22.996577', '11002', '2'), - ('4.99', '223', '2007-02-18T09:24:50.996577', '2334', '1'), - ('2.99', '526', '2007-03-22T13:42:46.996577', '15168', '1'), - ('2.99', '7', '2007-02-18T03:32:02.996577', '2250', '1'), - ('6.99', '175', '2007-03-20T12:28:55.996577', '13833', '2'), - ('5.99', '470', '2007-04-26T21:56:06.996577', '6942', '1'), - ('0.99', '151', '2007-04-27T07:03:28.996577', '7189', '1'), - ('4.99', '170', '2007-04-06T06:08:57.996577', '3651', '2'), - ('2.99', '579', '2007-03-20T20:29:09.996577', '14047', '2'), - ('0.99', '579', '2007-05-14T13:44:29.996577', '15794', '2'), - ('4.99', '139', '2007-04-30T13:25:39.996577', '9920', '2'), - ('0.99', '503', '2007-04-30T07:03:44.996577', '9725', '2'), - ('6.99', '114', '2007-03-18T18:19:55.996577', '12685', '1'), - ('2.99', '49', '2007-03-01T12:38:47.996577', '10588', '1'), - ('2.99', '28', '2007-04-30T19:42:28.996577', '10116', '2'), - ('0.99', '173', '2007-04-27T23:55:59.996577', '7644', '1'), - ('2.99', '279', '2007-03-19T03:48:51.996577', '12935', '2'), - ('5.99', '198', '2007-03-20T10:12:09.996577', '13768', '1'), - ('4.99', '368', '2007-02-19T14:49:06.996577', '2744', '1'), - ('4.99', '587', '2007-03-01T00:00:22.996577', '10224', '2'), - ('8.99', '25', '2007-02-19T06:51:37.996577', '2625', '2'), - ('3.99', '469', '2007-04-09T14:06:35.996577', '5299', '1'), - ('4.99', '51', '2007-03-01T00:48:27.996577', '10244', '2'), - ('6.99', '212', '2007-04-09T05:35:44.996577', '5115', '1'), - ('4.99', '75', '2007-03-18T08:52:37.996577', '12426', '1'), - ('4.99', '86', '2007-03-19T18:38:25.996577', '13338', '2'), - ('2.99', '293', '2007-04-29T17:31:31.996577', '8745', '1'), - ('4.99', '278', '2007-03-23T19:59:11.996577', '16019', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['22592', '27178', '18348', '22284', '30625', '27522', '20367', '27305', '24245', '31458', '31188', '20670', '28757', '18278', '25840', '30522', '31318', '30986', '23349', '28433', '26083', '28144', '30860', '28212', '28334', '25224', '20186', '31500', '22581', '29861', '19112', '27632', '23835', '28761', '29413', '28221', '22927', '24848', '28951', '27234', '23017', '29062', '24587', '18579', '31008', '23276', '26201', '30954', '23985', '18172', '28918', '22184', '27820', '20704', '30154', '20872', '31531', '18104', '24900', '31278', '17864', '29240', '27767', '30652', '25715', '21264', '29010', '19168', '19642', '30916', '30274', '29398', '17932', '23056', '31846', '30801', '24755', '19507', '22569', '20372', '30667', '18928', '27975', '25809', '20150', '31384', '19119', '27574', '30936', '29633', '29740', '29948', '28609', '31478', '18621', '18341', '18192', '27472', '29108', '21575']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('0.99', '596', '2007-03-17T15:08:26.996577', '11934', '1'), - ('2.99', '444', '2007-04-10T10:58:09.996577', '5753', '1'), - ('4.99', '568', '2007-02-18T13:32:18.996577', '2382', '2'), - ('6.99', '560', '2007-03-22T19:45:20.996577', '15352', '1'), - ('7.99', '144', '2007-04-10T00:32:29.996577', '5526', '2'), - ('0.99', '476', '2007-04-28T19:06:02.996577', '8146', '1'), - ('5.99', '359', '2007-03-21T16:08:31.996577', '14598', '2'), - ('7.99', '457', '2007-04-11T23:50:29.996577', '6467', '1'), - ('5.99', '161', '2007-03-22T22:24:17.996577', '15420', '1'), - ('2.99', '226', '2007-04-29T12:33:38.996577', '8627', '1'), - ('4.99', '195', '2007-04-29T00:14:17.996577', '8280', '2'), - ('3.99', '389', '2007-03-17T15:31:08.996577', '11944', '2'), - ('6.99', '587', '2007-04-30T06:53:47.996577', '9720', '2'), - ('3.99', '546', '2007-02-16T17:59:25.996577', '1787', '1'), - ('4.99', '326', '2007-04-29T11:35:39.996577', '8604', '1'), - ('4.99', '135', '2007-04-27T11:08:14.996577', '7297', '2'), - ('4.99', '213', '2007-04-07T11:40:33.996577', '4236', '2'), - ('2.99', '175', '2007-04-28T23:04:00.996577', '8244', '1'), - ('2.99', '70', '2007-03-17T14:04:13.996577', '11901', '1'), - ('0.99', '560', '2007-04-07T22:01:05.996577', '4453', '1'), - ('2.99', '347', '2007-04-30T12:06:17.996577', '9876', '1'), - ('4.99', '531', '2007-04-12T13:36:54.996577', '6756', '1'), - ('2.99', '165', '2007-04-08T21:13:28.996577', '4945', '2'), - ('0.99', '537', '2007-04-06T15:27:46.996577', '3853', '2'), - ('2.99', '550', '2007-04-12T11:08:05.996577', '6695', '1'), - ('2.99', '274', '2007-04-07T07:00:38.996577', '4147', '1'), - ('2.99', '340', '2007-03-01T02:11:06.996577', '10292', '1'), - ('0.99', '230', '2007-04-08T20:49:22.996577', '4935', '1'), - ('0.99', '595', '2007-03-17T07:32:28.996577', '11748', '2'), - ('1.99', '78', '2007-04-27T07:26:04.996577', '7200', '2'), - ('6.99', '158', '2007-02-17T12:13:35.996577', '2035', '2'), - ('4.99', '486', '2007-04-06T14:51:11.996577', '3835', '1'), - ('0.99', '124', '2007-03-21T20:55:37.996577', '14737', '2'), - ('0.99', '588', '2007-04-07T04:53:37.996577', '4101', '1'), - ('0.99', '38', '2007-04-26T22:39:15.996577', '6961', '1'), - ('4.99', '537', '2007-04-28T23:31:08.996577', '8256', '2'), - ('4.99', '25', '2007-03-21T03:41:42.996577', '14236', '1'), - ('2.99', '234', '2007-03-22T11:32:18.996577', '15129', '1'), - ('4.99', '205', '2007-04-30T18:42:34.996577', '10086', '2'), - ('2.99', '449', '2007-04-10T14:48:19.996577', '5824', '1'), - ('4.99', '34', '2007-03-19T19:50:13.996577', '13371', '1'), - ('5.99', '7', '2007-04-06T05:37:43.996577', '3639', '2'), - ('5.99', '198', '2007-03-19T01:00:25.996577', '12862', '1'), - ('0.99', '23', '2007-02-19T19:18:27.996577', '2827', '1'), - ('0.99', '177', '2007-04-28T18:44:56.996577', '8139', '1'), - ('2.99', '62', '2007-03-01T21:14:47.996577', '10815', '1'), - ('3.99', '357', '2007-04-30T12:12:41.996577', '9233', '2'), - ('2.99', '172', '2007-04-27T09:43:27.996577', '7261', '2'), - ('2.99', '138', '2007-03-22T22:31:27.996577', '15424', '1'), - ('3.99', '515', '2007-02-20T12:20:29.996577', '3063', '2'), - ('2.99', '202', '2007-04-29T21:03:01.996577', '8830', '1'), - ('2.99', '550', '2007-03-17T19:53:14.996577', '12063', '1'), - ('3.99', '502', '2007-04-27T07:50:55.996577', '7213', '2'), - ('7.99', '392', '2007-03-20T22:03:39.996577', '14081', '2'), - ('6.99', '103', '2007-04-06T10:47:54.996577', '3750', '2'), - ('8.99', '410', '2007-03-19T04:34:24.996577', '12955', '2'), - ('2.99', '232', '2007-04-28T13:11:34.996577', '7990', '1'), - ('2.99', '498', '2007-02-16T17:49:38.996577', '1782', '1'), - ('2.99', '240', '2007-03-21T15:12:58.996577', '14573', '2'), - ('0.99', '210', '2007-04-07T13:07:07.996577', '4270', '2'), - ('0.99', '435', '2007-02-15T17:26:17.996577', '1443', '2'), - ('0.99', '24', '2007-04-10T05:37:47.996577', '5648', '2'), - ('4.99', '498', '2007-04-07T15:59:40.996577', '4311', '1'), - ('0.99', '145', '2007-04-30T01:21:25.996577', '9576', '2'), - ('4.99', '315', '2007-04-12T09:49:05.996577', '6661', '1'), - ('4.99', '451', '2007-03-18T08:41:38.996577', '12422', '1'), - ('5.99', '2', '2007-04-28T22:41:25.996577', '8230', '2'), - ('0.99', '175', '2007-02-15T20:22:57.996577', '1495', '2'), - ('10.99', '277', '2007-03-22T06:52:58.996577', '15008', '1'), - ('2.99', '169', '2007-04-09T03:17:16.996577', '5066', '1'), - ('4.99', '114', '2007-04-05T21:51:37.996577', '3484', '1'), - ('0.99', '36', '2007-04-30T09:39:36.996577', '9805', '2'), - ('0.99', '452', '2007-02-18T21:48:19.996577', '2504', '1'), - ('0.99', '38', '2007-03-17T20:56:41.996577', '12092', '2'), - ('4.99', '260', '2007-04-30T10:19:20.996577', '9176', '2'), - ('4.99', '159', '2007-04-07T13:08:48.996577', '4273', '2'), - ('0.99', '223', '2007-03-20T03:48:22.996577', '13576', '1'), - ('4.99', '266', '2007-02-20T08:24:38.996577', '3002', '2'), - ('3.99', '593', '2007-03-01T10:42:42.996577', '10533', '2'), - ('6.99', '360', '2007-03-02T12:33:44.996577', '11264', '2'), - ('4.99', '147', '2007-04-11T23:57:53.996577', '6469', '2'), - ('8.99', '110', '2007-02-15T23:01:18.996577', '1528', '2'), - ('5.99', '517', '2007-04-10T22:39:03.996577', '5974', '2'), - ('4.99', '323', '2007-04-30T17:04:20.996577', '10028', '1'), - ('4.99', '336', '2007-03-20T07:32:56.996577', '13689', '2'), - ('2.99', '220', '2007-04-10T15:56:08.996577', '5847', '2'), - ('2.99', '161', '2007-02-16T23:30:26.996577', '1856', '1'), - ('6.99', '481', '2007-04-28T23:03:59.996577', '8243', '1'), - ('0.99', '171', '2007-04-06T04:32:21.996577', '3621', '1'), - ('1.99', '57', '2007-04-30T11:28:11.996577', '9211', '1'), - ('0.99', '68', '2007-04-06T03:39:30.996577', '3598', '1'), - ('2.99', '86', '2007-04-29T21:52:46.996577', '8850', '1'), - ('0.99', '575', '2007-04-27T02:57:05.996577', '7083', '1'), - ('2.99', '228', '2007-04-09T06:59:29.996577', '5151', '1'), - ('1.99', '30', '2007-02-17T01:07:46.996577', '1874', '2'), - ('5.99', '566', '2007-02-16T06:55:22.996577', '1635', '1'), - ('0.99', '521', '2007-02-16T16:18:23.996577', '1761', '1'), - ('6.99', '472', '2007-04-11T06:13:12.996577', '6119', '1'), - ('6.99', '11', '2007-04-11T07:38:25.996577', '6146', '2'), - ('4.99', '482', '2007-03-01T21:28:48.996577', '10824', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['32082', '23636', '22079', '24931', '20418', '18495', '29843', '17702', '23279', '21673', '22323', '21455', '25791', '17616', '20357', '23431', '20881', '29508', '27775', '18795', '18618', '23440', '29738', '30696', '24516', '25959', '24184', '27536', '18020', '25587', '17555', '30891', '31257', '30858', '21664', '19086', '28654', '25247', '25296', '19644', '23319', '18453', '22026', '21591', '22854', '28975', '20766', '28971', '25090', '29702', '23803', '25721', '30789', '27897', '21831', '18120', '22501', '27999', '22579', '21534', '26446', '22588', '20868', '22186', '18934', '18422', '24201', '19701', '17865', '22030', '29653', '26899', '26832', '26865', '26856', '19436', '31282', '27740', '29347', '20184', '17780', '21240', '31274', '28434', '21894', '20364', '22358', '25359', '30353', '30923', '29725', '25259', '25528', '31256', '30752', '20432', '30844', '18668', '26504', '29582']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('2.99', '214', '2007-05-14T13:44:29.996577', '15645', '2'), - ('4.99', '102', '2007-03-02T09:28:58.996577', '11183', '1'), - ('0.99', '537', '2007-03-21T18:22:37.996577', '14670', '1'), - ('0.99', '243', '2007-03-20T23:21:11.996577', '14108', '1'), - ('3.99', '364', '2007-03-19T02:53:01.996577', '12912', '2'), - ('5.99', '1', '2007-02-14T23:22:38.996577', '1185', '1'), - ('2.99', '76', '2007-04-30T15:27:43.996577', '9312', '2'), - ('4.99', '389', '2007-02-17T06:27:05.996577', '1946', '1'), - ('8.99', '62', '2007-03-20T00:55:39.996577', '13512', '2'), - ('2.99', '494', '2007-03-01T13:51:04.996577', '10623', '1'), - ('10.99', '565', '2007-03-01T19:28:24.996577', '10776', '2'), - ('6.99', '469', '2007-03-18T16:24:04.996577', '12633', '1'), - ('4.99', '322', '2007-04-28T18:50:20.996577', '8142', '2'), - ('0.99', '369', '2007-02-15T02:12:51.996577', '1224', '1'), - ('4.99', '358', '2007-03-01T08:46:13.996577', '10482', '1'), - ('10.99', '78', '2007-03-02T01:44:57.996577', '10942', '1'), - ('3.99', '410', '2007-03-22T21:30:41.996577', '15392', '2'), - ('9.99', '45', '2007-04-26T22:44:01.996577', '6966', '1'), - ('4.99', '498', '2007-04-27T12:52:21.996577', '7341', '1'), - ('0.99', '76', '2007-02-21T15:33:55.996577', '3416', '2'), - ('2.99', '29', '2007-02-19T17:46:35.996577', '2801', '2'), - ('7.99', '78', '2007-03-22T01:20:07.996577', '14862', '2'), - ('1.99', '67', '2007-04-29T10:01:24.996577', '8563', '2'), - ('6.99', '149', '2007-04-06T19:44:58.996577', '3939', '1'), - ('2.99', '190', '2007-03-21T01:27:57.996577', '14166', '2'), - ('4.99', '336', '2007-04-29T11:46:26.996577', '8607', '2'), - ('0.99', '156', '2007-03-20T01:41:09.996577', '13530', '2'), - ('4.99', '478', '2007-04-10T15:26:16.996577', '5837', '1'), - ('0.99', '472', '2007-02-20T06:28:50.996577', '2974', '1'), - ('2.99', '303', '2007-04-30T23:25:13.996577', '10209', '2'), - ('6.99', '353', '2007-02-21T01:07:57.996577', '3233', '2'), - ('2.99', '167', '2007-04-28T16:56:33.996577', '8092', '1'), - ('2.99', '201', '2007-04-27T22:30:41.996577', '7606', '2'), - ('5.99', '165', '2007-04-06T12:26:22.996577', '3784', '1'), - ('7.99', '493', '2007-03-01T23:20:03.996577', '10885', '2'), - ('5.99', '150', '2007-02-21T19:48:13.996577', '3456', '1'), - ('9.99', '579', '2007-04-08T06:29:35.996577', '4619', '1'), - ('2.99', '276', '2007-04-28T07:38:32.996577', '7842', '2'), - ('5.99', '281', '2007-04-09T18:49:36.996577', '5410', '2'), - ('2.99', '278', '2007-03-01T14:40:06.996577', '10649', '1'), - ('6.99', '66', '2007-03-21T03:06:22.996577', '14217', '1'), - ('6.99', '594', '2007-02-18T05:02:14.996577', '2276', '1'), - ('4.99', '532', '2007-03-19T07:23:42.996577', '13038', '2'), - ('2.99', '483', '2007-03-19T01:38:47.996577', '12875', '2'), - ('0.99', '18', '2007-03-19T23:57:55.996577', '13490', '2'), - ('0.99', '207', '2007-04-12T03:14:56.996577', '6537', '1'), - ('4.99', '399', '2007-03-19T17:04:18.996577', '13293', '2'), - ('0.99', '207', '2007-04-09T12:25:22.996577', '5258', '1'), - ('2.99', '260', '2007-03-20T16:56:54.996577', '13966', '1'), - ('0.99', '64', '2007-04-27T01:56:01.996577', '7045', '2'), - ('5.99', '121', '2007-03-01T07:46:00.996577', '10457', '2'), - ('3.99', '316', '2007-04-09T04:54:14.996577', '5102', '2'), - ('4.99', '158', '2007-04-10T23:24:04.996577', '5988', '1'), - ('2.99', '509', '2007-04-09T00:00:08.996577', '5008', '2'), - ('3.99', '512', '2007-03-01T15:35:42.996577', '10670', '2'), - ('7.99', '502', '2007-02-16T11:18:27.996577', '1696', '2'), - ('5.99', '584', '2007-03-21T03:25:55.996577', '14230', '2'), - ('6.99', '519', '2007-04-30T19:23:21.996577', '9417', '1'), - ('2.99', '595', '2007-03-01T17:49:37.996577', '10729', '1'), - ('0.99', '476', '2007-03-22T22:06:27.996577', '15413', '1'), - ('1.99', '378', '2007-04-10T02:28:57.996577', '5578', '1'), - ('2.99', '596', '2007-03-01T18:45:29.996577', '10756', '1'), - ('0.99', '410', '2007-03-02T06:48:04.996577', '11107', '1'), - ('10.99', '550', '2007-03-19T09:55:58.996577', '13114', '1'), - ('2.99', '111', '2007-02-21T08:30:02.996577', '3333', '2'), - ('4.99', '587', '2007-02-18T08:51:18.996577', '2329', '1'), - ('4.99', '158', '2007-03-02T05:55:09.996577', '11077', '2'), - ('3.99', '284', '2007-03-22T11:47:45.996577', '15135', '2'), - ('0.99', '435', '2007-02-20T07:12:10.996577', '2984', '1'), - ('0.99', '532', '2007-03-22T14:11:23.996577', '15180', '2'), - ('4.99', '59', '2007-04-28T13:14:11.996577', '7991', '1'), - ('0.99', '420', '2007-04-10T19:20:08.996577', '5911', '2'), - ('4.99', '413', '2007-04-27T03:33:27.996577', '7100', '2'), - ('2.99', '416', '2007-04-30T17:53:16.996577', '9383', '2'), - ('3.99', '416', '2007-04-06T14:46:54.996577', '3833', '1'), - ('5.99', '249', '2007-02-15T19:23:46.996577', '1473', '1'), - ('5.99', '210', '2007-04-08T06:30:10.996577', '4620', '1'), - ('9.99', '495', '2007-04-30T17:55:31.996577', '9387', '1'), - ('6.99', '32', '2007-04-27T03:02:33.996577', '7084', '1'), - ('4.99', '339', '2007-03-21T17:27:43.996577', '14636', '1'), - ('0.99', '410', '2007-02-20T06:24:26.996577', '2971', '2'), - ('4.99', '448', '2007-03-22T22:36:19.996577', '15427', '1'), - ('6.99', '209', '2007-04-30T05:40:10.996577', '9054', '2'), - ('2.99', '560', '2007-04-09T09:45:22.996577', '5208', '2'), - ('5.99', '518', '2007-03-01T18:34:36.996577', '10751', '1'), - ('1.99', '359', '2007-03-18T15:38:08.996577', '12611', '1'), - ('5.99', '568', '2007-03-22T09:24:08.996577', '15069', '2'), - ('4.99', '286', '2007-04-06T03:07:16.996577', '3592', '2'), - ('0.99', '121', '2007-04-10T06:43:18.996577', '5670', '2'), - ('0.99', '169', '2007-04-30T11:12:06.996577', '9203', '2'), - ('0.99', '66', '2007-04-10T19:40:42.996577', '5915', '2'), - ('2.99', '277', '2007-04-11T23:30:24.996577', '6455', '2'), - ('5.99', '299', '2007-04-07T07:21:34.996577', '4153', '2'), - ('0.99', '201', '2007-04-27T03:49:50.996577', '7106', '1'), - ('4.99', '155', '2007-04-11T03:53:02.996577', '6085', '1'), - ('2.99', '366', '2007-03-18T08:19:00.996577', '12413', '2'), - ('0.99', '163', '2007-04-28T15:08:09.996577', '8040', '2'), - ('4.99', '40', '2007-02-20T07:40:38.996577', '2993', '1'), - ('0.99', '383', '2007-04-30T05:09:13.996577', '9678', '1'), - ('2.99', '52', '2007-04-10T03:36:36.996577', '5607', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['20470', '25380', '22268', '19638', '31181', '22751', '19525', '22940', '28649', '29912', '30945', '25167', '25975', '31387', '18739', '27074', '21577', '31658', '24079', '17813', '29149', '30929', '30297', '22644', '25260', '27277', '26916', '25429', '26029', '18647', '26509', '21892', '25757', '30342', '17933', '32065', '21696', '27577', '30456', '27742', '23741', '18276', '26844', '30368', '30964', '31516', '28634', '30718', '28602', '20003', '29636', '19378', '23315', '31071', '19374', '25314', '18052', '23987', '21595', '25782', '24060', '29457', '31558', '23653', '28325', '23330', '31114', '31190', '24670', '23919', '25280', '19846', '18166', '30797', '22448', '22297', '30605', '26437', '22004', '27558', '23511', '22178', '28479', '28894', '22125', '27233', '27914', '25362', '27131', '19861', '18870', '24029', '27152', '30617', '29664', '18685', '21027', '20348', '22019', '28719']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('4.99', '370', '2007-03-01T03:28:19.996577', '10336', '1'), - ('3.99', '287', '2007-04-11T20:19:51.996577', '6379', '2'), - ('4.99', '559', '2007-03-19T18:11:34.996577', '13322', '2'), - ('4.99', '277', '2007-03-20T01:27:08.996577', '13526', '2'), - ('7.99', '194', '2007-04-30T05:53:21.996577', '9064', '1'), - ('8.99', '7', '2007-03-18T06:25:40.996577', '12367', '1'), - ('5.99', '267', '2007-03-21T00:12:06.996577', '14131', '1'), - ('2.99', '26', '2007-03-22T21:03:10.996577', '15384', '1'), - ('2.99', '578', '2007-04-28T20:33:39.996577', '8179', '1'), - ('6.99', '83', '2007-04-09T18:04:41.996577', '5394', '2'), - ('5.99', '172', '2007-04-08T15:53:49.996577', '4820', '1'), - ('7.99', '268', '2007-04-09T01:43:11.996577', '5039', '1'), - ('0.99', '338', '2007-04-05T23:18:56.996577', '3516', '1'), - ('8.99', '220', '2007-04-12T17:20:07.996577', '6832', '2'), - ('2.99', '59', '2007-02-15T05:58:25.996577', '1269', '1'), - ('2.99', '436', '2007-04-08T12:36:18.996577', '4751', '2'), - ('6.99', '482', '2007-03-16T21:21:20.996577', '11498', '2'), - ('3.99', '242', '2007-04-27T05:39:06.996577', '7149', '2'), - ('4.99', '147', '2007-03-18T03:24:15.996577', '12284', '1'), - ('3.99', '423', '2007-02-15T20:36:32.996577', '1504', '1'), - ('0.99', '14', '2007-04-28T15:13:37.996577', '8042', '1'), - ('4.99', '170', '2007-04-10T02:19:13.996577', '5573', '1'), - ('6.99', '115', '2007-04-12T15:17:37.996577', '6798', '1'), - ('0.99', '204', '2007-03-19T08:55:51.996577', '13084', '1'), - ('5.99', '277', '2007-04-12T00:45:26.996577', '6487', '1'), - ('4.99', '454', '2007-04-08T03:36:58.996577', '4562', '2'), - ('4.99', '421', '2007-04-29T16:37:08.996577', '8725', '1'), - ('0.99', '291', '2007-04-27T20:59:43.996577', '7564', '2'), - ('3.99', '343', '2007-04-09T15:32:16.996577', '5337', '1'), - ('4.99', '35', '2007-02-18T02:18:44.996577', '2229', '1'), - ('2.99', '384', '2007-04-10T22:27:53.996577', '5966', '2'), - ('4.99', '517', '2007-03-21T02:03:47.996577', '14190', '2'), - ('4.99', '319', '2007-04-11T13:39:59.996577', '6255', '1'), - ('0.99', '120', '2007-04-07T17:15:29.996577', '4342', '2'), - ('0.99', '452', '2007-02-19T09:19:18.996577', '2661', '2'), - ('3.98', '175', '2007-05-14T13:44:29.996577', '14060', '2'), - ('6.99', '496', '2007-03-20T19:11:16.996577', '14013', '2'), - ('3.99', '481', '2007-04-30T16:43:40.996577', '10018', '1'), - ('4.99', '129', '2007-04-09T16:07:56.996577', '5350', '2'), - ('4.99', '495', '2007-04-30T17:56:00.996577', '10065', '2'), - ('4.99', '115', '2007-03-01T08:31:43.996577', '10475', '2'), - ('1.99', '546', '2007-02-14T23:10:43.996577', '1181', '1'), - ('5.99', '414', '2007-04-30T19:30:12.996577', '10107', '2'), - ('0.99', '122', '2007-04-11T22:26:00.996577', '6427', '1'), - ('2.99', '173', '2007-04-10T00:42:25.996577', '5531', '2'), - ('0.99', '231', '2007-04-07T14:14:24.996577', '4289', '2'), - ('2.99', '577', '2007-04-12T01:39:49.996577', '6500', '1'), - ('2.99', '151', '2007-04-30T15:06:38.996577', '9969', '1'), - ('2.99', '574', '2007-04-28T12:18:24.996577', '7964', '1'), - ('0.99', '319', '2007-03-17T01:31:33.996577', '11598', '2'), - ('4.99', '57', '2007-04-30T21:55:39.996577', '10169', '2'), - ('5.99', '234', '2007-02-18T22:13:56.996577', '2511', '2'), - ('0.99', '66', '2007-03-17T15:10:39.996577', '11935', '1'), - ('2.99', '182', '2007-04-09T23:59:48.996577', '5521', '1'), - ('0.99', '234', '2007-02-16T07:38:32.996577', '1645', '2'), - ('0.99', '282', '2007-04-29T17:25:27.996577', '8743', '2'), - ('4.99', '481', '2007-02-18T06:39:08.996577', '2296', '2'), - ('2.99', '139', '2007-03-02T00:02:52.996577', '10900', '1'), - ('7.99', '484', '2007-03-19T05:52:29.996577', '12993', '1'), - ('0.99', '321', '2007-04-30T15:36:57.996577', '9981', '1'), - ('3.99', '145', '2007-03-19T11:59:21.996577', '13164', '1'), - ('0.99', '41', '2007-04-28T17:02:46.996577', '8098', '1'), - ('2.99', '235', '2007-04-08T04:59:54.996577', '4592', '2'), - ('0.99', '104', '2007-03-19T06:14:08.996577', '13005', '1'), - ('0.99', '549', '2007-04-07T21:43:54.996577', '4447', '1'), - ('4.99', '67', '2007-03-22T05:14:29.996577', '14967', '2'), - ('5.99', '186', '2007-04-30T17:08:09.996577', '9360', '2'), - ('6.99', '195', '2007-04-30T10:48:20.996577', '9188', '2'), - ('0.99', '213', '2007-03-19T21:43:26.996577', '13426', '2'), - ('3.99', '132', '2007-03-01T13:35:30.996577', '10619', '2'), - ('3.99', '279', '2007-04-29T09:54:20.996577', '8559', '2'), - ('0.99', '300', '2007-03-19T17:12:19.996577', '13296', '1'), - ('0.99', '514', '2007-02-21T12:45:14.996577', '3385', '1'), - ('2.99', '158', '2007-04-30T18:33:14.996577', '9393', '1'), - ('2.99', '578', '2007-03-20T02:32:17.996577', '13552', '2'), - ('10.99', '562', '2007-03-19T18:57:14.996577', '13347', '2'), - ('2.99', '142', '2007-04-28T05:08:31.996577', '7764', '1'), - ('1.99', '377', '2007-04-28T02:12:11.996577', '7697', '1'), - ('0.99', '530', '2007-03-02T15:02:55.996577', '11326', '1'), - ('2.99', '480', '2007-04-10T04:50:50.996577', '5633', '2'), - ('2.99', '86', '2007-03-18T00:37:46.996577', '12198', '1'), - ('2.99', '549', '2007-03-18T16:26:40.996577', '12634', '2'), - ('10.99', '564', '2007-04-27T17:29:29.996577', '7470', '2'), - ('0.99', '598', '2007-04-12T04:41:19.996577', '6575', '2'), - ('0.99', '543', '2007-03-01T01:18:09.996577', '10257', '2'), - ('3.99', '449', '2007-04-07T21:14:07.996577', '4433', '2'), - ('4.99', '511', '2007-04-06T03:48:08.996577', '3600', '2'), - ('9.99', '286', '2007-04-07T22:28:09.996577', '4461', '2'), - ('4.99', '440', '2007-04-30T00:21:00.996577', '9547', '1'), - ('2.99', '302', '2007-03-19T02:38:04.996577', '12903', '1'), - ('2.99', '95', '2007-02-14T22:41:17.996577', '1174', '2'), - ('0.99', '142', '2007-03-21T23:40:03.996577', '14813', '2'), - ('2.99', '442', '2007-04-07T02:31:16.996577', '4058', '1'), - ('0.99', '143', '2007-04-29T02:46:51.996577', '8335', '1'), - ('4.99', '60', '2007-04-30T08:00:20.996577', '9761', '1'), - ('0.99', '45', '2007-02-21T19:08:05.996577', '3444', '2'), - ('0.99', '425', '2007-03-19T07:32:50.996577', '13040', '2'), - ('5.99', '356', '2007-03-23T11:12:08.996577', '15754', '2'), - ('6.99', '532', '2007-03-01T02:04:24.996577', '10286', '2'), - ('2.99', '584', '2007-04-06T10:28:44.996577', '3741', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['31932', '21985', '24791', '31859', '27844', '24186', '22904', '23894', '28992', '27613', '25365', '31214', '32039', '31389', '19653', '31543', '19123', '29333', '18152', '22573', '26593', '19404', '21907', '28195', '21430', '22342', '19892', '29142', '20724', '26940', '27426', '23455', '19375', '17936', '21480', '29257', '31505', '25091', '25146', '21420', '22726', '24662', '30211', '20430', '22937', '21448', '30327', '20231', '27616', '21548', '23840', '18267', '22788', '25842', '23334', '20895', '23525', '18258', '20342', '21426', '26002', '31912', '26143', '25966', '22677', '25534', '30744', '24364', '17963', '22568', '29253', '27258', '28693', '30626', '28930', '28897', '24414', '19646', '26133', '30462', '22831', '20175', '25954', '22039', '26805', '19779', '27225', '18801', '19743', '19740', '29648', '25616', '23711', '28014', '24899', '19803', '31258', '24523', '25410', '18238']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('2.99', '324', '2007-05-14T13:44:29.996577', '13965', '2'), - ('2.99', '528', '2007-03-01T23:02:38.996577', '10880', '1'), - ('4.99', '228', '2007-03-01T12:29:08.996577', '10585', '1'), - ('7.99', '262', '2007-04-12T03:26:12.996577', '6547', '2'), - ('2.99', '504', '2007-04-28T06:26:53.996577', '7807', '2'), - ('2.99', '156', '2007-03-20T11:13:19.996577', '13802', '2'), - ('2.99', '23', '2007-03-01T23:58:23.996577', '10898', '1'), - ('0.99', '129', '2007-03-21T07:36:16.996577', '14353', '1'), - ('4.99', '208', '2007-04-30T10:47:15.996577', '9838', '1'), - ('8.99', '484', '2007-04-30T21:50:46.996577', '10166', '2'), - ('4.99', '286', '2007-04-10T13:11:20.996577', '5796', '1'), - ('0.99', '197', '2007-04-30T21:35:06.996577', '9476', '1'), - ('0.00', '75', '2007-05-14T13:44:29.996577', '14488', '1'), - ('2.99', '220', '2007-04-28T15:44:14.996577', '8065', '1'), - ('0.99', '278', '2007-03-21T23:17:36.996577', '14803', '2'), - ('2.99', '233', '2007-04-10T15:53:50.996577', '5846', '1'), - ('4.99', '162', '2007-02-19T01:12:43.996577', '2547', '1'), - ('1.99', '31', '2007-04-26T23:51:50.996577', '7000', '1'), - ('2.99', '511', '2007-02-15T21:01:50.996577', '1508', '1'), - ('6.99', '593', '2007-03-20T01:17:09.996577', '13524', '1'), - ('2.99', '392', '2007-04-11T21:23:53.996577', '6406', '2'), - ('3.99', '240', '2007-02-18T00:15:33.996577', '2196', '2'), - ('7.99', '519', '2007-03-20T06:16:33.996577', '13647', '1'), - ('2.99', '535', '2007-04-29T04:31:56.996577', '8395', '1'), - ('0.99', '467', '2007-03-21T10:50:10.996577', '14451', '1'), - ('4.99', '566', '2007-03-19T05:54:56.996577', '12995', '2'), - ('4.99', '305', '2007-03-20T10:37:52.996577', '13782', '1'), - ('2.99', '14', '2007-04-06T08:50:15.996577', '3707', '1'), - ('9.99', '394', '2007-03-18T11:50:51.996577', '12510', '2'), - ('0.99', '424', '2007-04-06T10:39:17.996577', '3746', '2'), - ('10.99', '469', '2007-04-05T23:31:55.996577', '3526', '1'), - ('4.99', '80', '2007-03-20T08:35:54.996577', '13724', '1'), - ('2.99', '234', '2007-02-16T09:25:26.996577', '1674', '1'), - ('4.99', '453', '2007-02-20T00:08:09.996577', '2887', '2'), - ('4.99', '471', '2007-03-20T22:50:01.996577', '14094', '1'), - ('2.99', '25', '2007-04-30T19:17:39.996577', '10103', '2'), - ('2.99', '230', '2007-04-11T13:34:46.996577', '6251', '1'), - ('0.99', '260', '2007-03-20T17:31:51.996577', '13978', '2'), - ('5.99', '266', '2007-03-02T00:23:00.996577', '10910', '2'), - ('2.99', '466', '2007-03-21T14:19:16.996577', '14546', '2'), - ('2.99', '5', '2007-03-18T22:52:34.996577', '12797', '1'), - ('3.99', '212', '2007-03-18T13:28:29.996577', '12562', '2'), - ('1.99', '107', '2007-04-29T15:42:11.996577', '8704', '2'), - ('2.99', '366', '2007-03-02T15:27:35.996577', '11337', '2'), - ('8.99', '26', '2007-03-21T02:06:08.996577', '14192', '2'), - ('4.99', '469', '2007-03-01T01:19:35.996577', '10258', '1'), - ('7.99', '118', '2007-04-29T17:51:06.996577', '8760', '2'), - ('0.99', '343', '2007-03-20T13:33:55.996577', '13866', '2'), - ('0.99', '485', '2007-04-06T17:59:23.996577', '3904', '1'), - ('4.99', '479', '2007-03-01T02:41:59.996577', '10303', '2'), - ('7.99', '125', '2007-03-02T12:58:29.996577', '11279', '2'), - ('2.99', '543', '2007-02-18T16:09:10.996577', '2426', '1'), - ('2.99', '11', '2007-03-22T16:15:07.996577', '15240', '2'), - ('0.99', '326', '2007-04-30T11:28:59.996577', '9855', '2'), - ('4.99', '68', '2007-03-19T23:33:31.996577', '13475', '2'), - ('6.99', '412', '2007-03-21T13:51:03.996577', '14535', '1'), - ('0.99', '87', '2007-03-20T14:44:29.996577', '13906', '1'), - ('4.99', '540', '2007-02-15T07:21:10.996577', '1290', '2'), - ('2.99', '356', '2007-03-19T01:40:45.996577', '12876', '2'), - ('2.99', '467', '2007-03-18T02:50:57.996577', '12266', '1'), - ('4.99', '340', '2007-04-29T00:02:58.996577', '8274', '2'), - ('6.99', '267', '2007-04-09T15:40:01.996577', '5340', '1'), - ('1.99', '353', '2007-04-12T03:49:01.996577', '6559', '2'), - ('4.99', '337', '2007-04-08T17:14:16.996577', '4855', '2'), - ('9.99', '207', '2007-03-20T15:00:36.996577', '13912', '2'), - ('4.99', '299', '2007-04-27T09:47:24.996577', '7264', '1'), - ('4.99', '154', '2007-04-26T23:33:50.996577', '6993', '2'), - ('4.99', '175', '2007-03-21T13:01:11.996577', '14507', '2'), - ('3.99', '457', '2007-02-19T15:50:57.996577', '2762', '1'), - ('3.99', '593', '2007-03-01T04:42:04.996577', '10368', '1'), - ('0.99', '25', '2007-04-29T22:44:23.996577', '8878', '2'), - ('2.99', '452', '2007-04-07T20:33:31.996577', '4417', '2'), - ('7.99', '581', '2007-04-27T02:00:14.996577', '7048', '2'), - ('7.99', '144', '2007-04-12T07:02:15.996577', '6614', '2'), - ('0.99', '204', '2007-04-07T01:38:16.996577', '4043', '1'), - ('0.99', '598', '2007-04-27T13:10:37.996577', '7354', '2'), - ('2.99', '180', '2007-03-19T16:38:45.996577', '13283', '1'), - ('3.99', '278', '2007-03-01T22:19:26.996577', '10849', '2'), - ('4.99', '352', '2007-04-07T05:24:39.996577', '4116', '2'), - ('5.99', '129', '2007-04-30T21:52:57.996577', '10167', '2'), - ('0.99', '15', '2007-03-22T14:04:30.996577', '15178', '1'), - ('3.99', '339', '2007-03-01T03:31:29.996577', '10338', '2'), - ('0.99', '336', '2007-04-10T06:39:29.996577', '5667', '2'), - ('6.99', '533', '2007-03-18T17:26:10.996577', '12655', '1'), - ('5.99', '410', '2007-04-27T14:57:30.996577', '7407', '2'), - ('5.99', '293', '2007-03-23T07:47:18.996577', '15675', '2'), - ('1.99', '448', '2007-04-07T20:03:42.996577', '4406', '1'), - ('2.99', '78', '2007-02-18T00:47:47.996577', '2207', '1'), - ('0.99', '289', '2007-03-19T12:02:36.996577', '13165', '2'), - ('1.99', '289', '2007-03-17T23:02:46.996577', '12158', '1'), - ('4.99', '59', '2007-04-08T07:06:48.996577', '4631', '1'), - ('6.99', '306', '2007-04-27T08:15:38.996577', '7225', '1'), - ('7.99', '112', '2007-03-17T01:36:36.996577', '11599', '1'), - ('4.99', '520', '2007-04-28T03:10:10.996577', '7720', '1'), - ('8.99', '240', '2007-03-20T06:40:59.996577', '13663', '1'), - ('2.99', '296', '2007-03-20T07:55:46.996577', '13702', '1'), - ('0.99', '201', '2007-04-30T17:03:51.996577', '9355', '2'), - ('4.99', '192', '2007-03-17T10:41:52.996577', '11815', '1'), - ('0.99', '290', '2007-04-07T20:33:02.996577', '4416', '2'), - ('0.99', '534', '2007-02-18T16:41:58.996577', '2436', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['28974', '17679', '30707', '29670', '23759', '28093', '27372', '24059', '27406', '30979', '20309', '21290', '19231', '19708', '22306', '19262', '24679', '27602', '26928', '23446', '17991', '25116', '19710', '24287', '18389', '25511', '24695', '30893', '28546', '18489', '28900', '23286', '19411', '21348', '20145', '22849', '18090', '23013', '32033', '23179', '23232', '26685', '20064', '22471', '29828', '24074', '31559', '29381', '31148', '22999', '27919', '22835', '29656', '22759', '24344', '30229', '23012', '22128', '30296', '27959', '27164', '31161', '21168', '19698', '20918', '27866', '31220', '18321', '28527', '27772', '30061', '23404', '24837', '19098', '25996', '29579', '19441', '31514', '24633', '18653', '25725', '28430', '25680', '21407', '23313', '25783', '30003', '30909', '21241', '19866', '27256', '18465', '25613', '22779', '30806', '26825', '30529', '23239', '30459', '21413']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('5.99', '207', '2007-04-11T23:45:37.996577', '6465', '2'), - ('3.99', '384', '2007-02-20T03:35:50.996577', '2935', '2'), - ('2.99', '150', '2007-04-12T08:04:08.996577', '6633', '1'), - ('6.99', '61', '2007-04-30T01:57:33.996577', '9597', '2'), - ('2.99', '117', '2007-03-01T11:27:08.996577', '10556', '2'), - ('2.99', '526', '2007-04-29T06:01:31.996577', '8441', '1'), - ('2.99', '463', '2007-04-09T01:01:00.996577', '5026', '1'), - ('7.99', '145', '2007-03-19T06:23:25.996577', '13012', '2'), - ('7.99', '467', '2007-04-28T13:54:46.996577', '8010', '1'), - ('2.99', '174', '2007-04-30T11:02:09.996577', '9847', '1'), - ('6.99', '352', '2007-03-17T11:05:03.996577', '11823', '1'), - ('4.99', '453', '2007-03-23T05:54:04.996577', '15627', '2'), - ('1.99', '189', '2007-02-20T01:24:42.996577', '2905', '2'), - ('9.99', '285', '2007-03-18T18:26:05.996577', '12687', '2'), - ('9.99', '563', '2007-03-20T13:26:16.996577', '13863', '2'), - ('4.99', '196', '2007-02-20T15:35:12.996577', '3104', '1'), - ('2.99', '214', '2007-03-19T21:04:52.996577', '13409', '1'), - ('0.99', '484', '2007-04-10T16:11:56.996577', '5852', '1'), - ('0.99', '423', '2007-04-07T12:36:37.996577', '4250', '1'), - ('0.99', '80', '2007-03-01T02:57:55.996577', '10313', '1'), - ('0.99', '465', '2007-02-18T23:16:37.996577', '2524', '2'), - ('3.99', '262', '2007-03-23T16:26:01.996577', '15918', '1'), - ('0.99', '285', '2007-03-22T16:32:23.996577', '15251', '2'), - ('4.99', '167', '2007-03-23T02:19:14.996577', '15530', '2'), - ('3.99', '577', '2007-02-18T14:34:40.996577', '2399', '2'), - ('2.99', '297', '2007-04-26T23:24:56.996577', '6984', '1'), - ('0.99', '215', '2007-03-23T14:05:57.996577', '15843', '1'), - ('2.99', '167', '2007-04-29T02:12:56.996577', '8318', '1'), - ('0.99', '570', '2007-04-12T03:38:42.996577', '6556', '1'), - ('3.99', '207', '2007-02-17T06:19:52.996577', '1945', '2'), - ('5.99', '598', '2007-04-29T08:11:08.996577', '8511', '1'), - ('4.99', '63', '2007-03-17T14:06:00.996577', '11902', '1'), - ('0.99', '241', '2007-02-21T02:22:24.996577', '3258', '2'), - ('2.99', '459', '2007-03-22T19:25:07.996577', '15342', '2'), - ('2.99', '336', '2007-03-17T07:17:31.996577', '11743', '2'), - ('4.99', '18', '2007-03-01T16:01:19.996577', '10682', '1'), - ('4.99', '493', '2007-02-18T12:14:00.996577', '2365', '1'), - ('4.99', '34', '2007-03-17T05:44:13.996577', '11701', '2'), - ('9.98', '60', '2007-05-14T13:44:29.996577', '12489', '2'), - ('0.99', '52', '2007-03-01T14:06:24.996577', '10635', '1'), - ('5.99', '57', '2007-03-19T03:27:27.996577', '12925', '2'), - ('4.99', '401', '2007-04-28T00:16:58.996577', '7651', '2'), - ('0.99', '327', '2007-03-17T18:01:50.996577', '12016', '1'), - ('0.99', '581', '2007-03-20T05:12:10.996577', '13621', '2'), - ('0.99', '75', '2007-04-28T07:38:48.996577', '7843', '1'), - ('4.99', '146', '2007-03-20T12:18:43.996577', '13829', '2'), - ('4.99', '235', '2007-04-10T12:43:47.996577', '5790', '1'), - ('4.99', '35', '2007-04-27T05:22:38.996577', '7140', '1'), - ('4.99', '190', '2007-04-27T06:31:48.996577', '7175', '1'), - ('5.99', '32', '2007-03-21T15:00:58.996577', '14570', '2'), - ('0.99', '511', '2007-04-11T01:42:52.996577', '6040', '2'), - ('0.99', '16', '2007-03-02T14:19:10.996577', '11308', '2'), - ('6.99', '59', '2007-04-30T01:14:04.996577', '9573', '2'), - ('2.99', '8', '2007-03-02T13:11:11.996577', '11284', '2'), - ('4.99', '173', '2007-03-18T11:41:39.996577', '12501', '2'), - ('2.99', '109', '2007-04-09T13:54:53.996577', '5296', '2'), - ('2.99', '34', '2007-03-16T21:47:13.996577', '11505', '1'), - ('2.99', '543', '2007-03-17T04:41:56.996577', '11681', '1'), - ('5.99', '115', '2007-04-12T04:32:48.996577', '6574', '1'), - ('3.99', '516', '2007-04-10T12:14:49.996577', '5780', '2'), - ('2.99', '442', '2007-04-30T17:13:56.996577', '10034', '1'), - ('2.99', '192', '2007-04-06T17:53:44.996577', '3902', '1'), - ('0.99', '442', '2007-03-01T07:40:02.996577', '10452', '2'), - ('4.99', '284', '2007-03-21T17:46:27.996577', '14648', '1'), - ('6.99', '414', '2007-03-22T12:07:46.996577', '15140', '1'), - ('2.99', '507', '2007-04-06T17:01:15.996577', '3880', '1'), - ('4.99', '198', '2007-04-12T04:11:35.996577', '6567', '2'), - ('1.99', '560', '2007-02-16T01:51:48.996577', '1572', '2'), - ('0.99', '568', '2007-04-10T04:08:03.996577', '5622', '1'), - ('1.99', '498', '2007-04-11T04:09:01.996577', '6088', '1'), - ('4.99', '96', '2007-04-08T22:04:19.996577', '4961', '1'), - ('0.99', '75', '2007-03-02T15:13:59.996577', '11330', '1'), - ('6.99', '234', '2007-03-01T12:19:40.996577', '10580', '2'), - ('4.99', '154', '2007-02-20T00:07:05.996577', '2886', '1'), - ('5.99', '339', '2007-04-30T11:22:29.996577', '9208', '2'), - ('1.99', '52', '2007-04-06T22:15:18.996577', '3997', '1'), - ('6.99', '251', '2007-02-18T02:50:32.996577', '2238', '1'), - ('9.99', '231', '2007-04-06T01:22:59.996577', '3561', '2'), - ('9.99', '209', '2007-03-23T01:19:53.996577', '15510', '2'), - ('1.99', '37', '2007-02-16T19:37:12.996577', '1812', '2'), - ('2.99', '316', '2007-04-27T12:46:14.996577', '7339', '2'), - ('4.99', '560', '2007-04-06T19:49:03.996577', '3941', '1'), - ('2.99', '312', '2007-04-12T13:19:00.996577', '6751', '2'), - ('6.99', '465', '2007-03-17T03:24:42.996577', '11648', '2'), - ('2.99', '66', '2007-03-02T16:14:30.996577', '11360', '2'), - ('0.99', '322', '2007-04-05T21:34:10.996577', '3478', '1'), - ('0.99', '91', '2007-04-06T13:34:35.996577', '3802', '2'), - ('1.99', '168', '2007-04-29T22:53:14.996577', '8883', '2'), - ('2.99', '449', '2007-03-01T06:17:41.996577', '10409', '2'), - ('5.99', '302', '2007-03-23T05:50:28.996577', '15622', '1'), - ('0.99', '452', '2007-04-07T17:30:31.996577', '4348', '1'), - ('6.99', '599', '2007-02-20T11:07:01.996577', '3043', '2'), - ('2.99', '306', '2007-04-10T02:34:32.996577', '5581', '2'), - ('2.99', '10', '2007-03-20T15:11:54.996577', '13917', '2'), - ('3.99', '159', '2007-04-30T04:03:11.996577', '9022', '2'), - ('8.99', '412', '2007-04-29T02:37:33.996577', '8330', '2'), - ('4.99', '135', '2007-04-30T18:51:39.996577', '10091', '2'), - ('0.99', '58', '2007-03-01T15:28:53.996577', '10668', '1'), - ('4.99', '129', '2007-04-30T10:17:26.996577', '9823', '2'), - ('4.99', '466', '2007-03-01T08:19:37.996577', '10469', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['29107', '18667', '22248', '29726', '20106', '24720', '27717', '29817', '30581', '17976', '24303', '26336', '28385', '18527', '29453', '25982', '22370', '28972', '31721', '27012', '20780', '25239', '30981', '18760', '21806', '29835', '29451', '18749', '28100', '26842', '18877', '24343', '22908', '17854', '31513', '18933', '25295', '20381', '27920', '21488', '25128', '29369', '28197', '25774', '30702', '28536', '25180', '28301', '28832', '27450', '23109', '30001', '26766', '20937', '28999', '18985', '28085', '23573', '20181', '22052', '18247', '22865', '29503', '29691', '24354', '27337', '21345', '23329', '24934', '30069', '25447', '30978', '17988', '25185', '17669', '26432', '23048', '18463', '31042', '18218', '31840', '24995', '29700', '23042', '30483', '20899', '29575', '23509', '20316', '21864', '19444', '24022', '30903', '18534', '30398', '24907', '22770', '31196', '31463', '29830']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('5.99', '11', '2007-04-10T15:13:24.996577', '5835', '2'), - ('2.99', '40', '2007-02-20T01:02:08.996577', '2896', '2'), - ('2.99', '557', '2007-03-18T22:44:45.996577', '12789', '1'), - ('8.99', '66', '2007-04-11T15:41:08.996577', '6290', '1'), - ('2.99', '331', '2007-03-22T19:20:38.996577', '15339', '1'), - ('0.99', '218', '2007-03-23T03:58:45.996577', '15575', '2'), - ('3.99', '494', '2007-04-07T03:54:32.996577', '4086', '1'), - ('2.99', '75', '2007-04-07T08:45:41.996577', '4179', '2'), - ('2.99', '139', '2007-04-30T19:16:57.996577', '9415', '2'), - ('0.99', '460', '2007-02-15T14:40:53.996577', '1392', '2'), - ('5.99', '169', '2007-03-17T13:52:38.996577', '11898', '1'), - ('6.99', '368', '2007-04-30T10:33:27.996577', '9833', '1'), - ('7.99', '555', '2007-04-30T18:29:00.996577', '10076', '2'), - ('2.99', '8', '2007-02-15T08:27:42.996577', '1305', '2'), - ('4.99', '41', '2007-04-26T23:08:27.996577', '6976', '1'), - ('3.99', '338', '2007-04-27T21:44:12.996577', '7584', '2'), - ('9.99', '569', '2007-03-20T02:37:05.996577', '13554', '2'), - ('4.99', '207', '2007-04-09T12:31:16.996577', '5259', '1'), - ('0.99', '248', '2007-04-08T16:46:49.996577', '4841', '1'), - ('7.99', '429', '2007-04-28T20:06:42.996577', '8175', '2'), - ('4.99', '401', '2007-03-18T10:42:47.996577', '12475', '1'), - ('4.99', '275', '2007-04-27T22:02:23.996577', '7596', '2'), - ('5.99', '175', '2007-04-07T08:05:34.996577', '4167', '2'), - ('4.99', '66', '2007-02-19T03:04:29.996577', '2577', '1'), - ('2.99', '508', '2007-03-02T16:28:35.996577', '11365', '1'), - ('9.99', '75', '2007-04-30T08:44:12.996577', '9783', '1'), - ('4.99', '41', '2007-04-08T02:35:21.996577', '4543', '1'), - ('0.99', '62', '2007-02-21T05:01:05.996577', '3287', '1'), - ('4.99', '527', '2007-04-11T00:23:14.996577', '6011', '2'), - ('2.99', '414', '2007-04-30T04:15:58.996577', '9650', '1'), - ('0.99', '96', '2007-02-18T13:06:03.996577', '2372', '1'), - ('6.99', '173', '2007-03-18T03:22:46.996577', '12282', '1'), - ('6.99', '23', '2007-03-19T21:54:03.996577', '13429', '2'), - ('5.99', '432', '2007-02-14T23:07:27.996577', '1180', '2'), - ('9.99', '230', '2007-04-30T17:48:44.996577', '10057', '1'), - ('2.99', '111', '2007-02-20T14:22:25.996577', '3087', '2'), - ('6.99', '281', '2007-04-08T17:34:00.996577', '4864', '2'), - ('2.99', '360', '2007-03-22T18:25:07.996577', '15310', '1'), - ('0.99', '511', '2007-04-11T17:19:21.996577', '6320', '1'), - ('6.99', '472', '2007-03-17T14:20:01.996577', '11911', '1'), - ('2.99', '264', '2007-03-01T20:12:50.996577', '10792', '2'), - ('3.99', '34', '2007-04-30T09:45:59.996577', '9160', '1'), - ('0.99', '535', '2007-04-30T20:08:41.996577', '9440', '2'), - ('4.99', '321', '2007-04-06T18:55:06.996577', '3920', '1'), - ('5.99', '149', '2007-04-26T21:47:01.996577', '6940', '2'), - ('2.99', '569', '2007-04-29T23:58:14.996577', '8910', '1'), - ('2.99', '269', '2007-04-11T22:53:30.996577', '6440', '1'), - ('2.99', '546', '2007-04-12T15:00:59.996577', '6786', '1'), - ('4.99', '593', '2007-04-08T14:35:21.996577', '4781', '2'), - ('2.99', '470', '2007-04-11T10:40:43.996577', '6198', '1'), - ('2.99', '45', '2007-03-01T09:50:46.996577', '10507', '1'), - ('2.99', '90', '2007-04-30T16:30:51.996577', '9337', '2'), - ('9.99', '407', '2007-04-28T21:32:36.996577', '8197', '1'), - ('4.99', '416', '2007-03-21T03:47:23.996577', '14239', '1'), - ('4.99', '1', '2007-04-28T07:33:11.996577', '7841', '1'), - ('2.99', '123', '2007-02-19T04:12:09.996577', '2594', '1'), - ('3.99', '526', '2007-04-12T10:17:14.996577', '6671', '1'), - ('5.99', '93', '2007-03-02T12:46:48.996577', '11271', '2'), - ('3.99', '339', '2007-03-19T13:21:48.996577', '13199', '1'), - ('5.99', '535', '2007-03-01T03:12:39.996577', '10322', '2'), - ('2.99', '537', '2007-02-17T23:39:02.996577', '2184', '2'), - ('7.99', '20', '2007-03-01T13:28:16.996577', '10616', '1'), - ('6.99', '45', '2007-04-09T08:35:53.996577', '5181', '1'), - ('4.99', '64', '2007-04-07T14:06:51.996577', '4288', '1'), - ('0.99', '174', '2007-03-19T12:50:56.996577', '13185', '1'), - ('4.99', '460', '2007-04-06T14:03:52.996577', '3820', '2'), - ('4.99', '459', '2007-03-20T16:57:12.996577', '13967', '1'), - ('2.99', '67', '2007-03-20T12:47:29.996577', '13837', '2'), - ('2.99', '243', '2007-03-21T19:31:21.996577', '14705', '2'), - ('3.99', '96', '2007-04-30T04:38:19.996577', '9662', '1'), - ('4.99', '292', '2007-04-29T21:32:06.996577', '8842', '2'), - ('4.99', '174', '2007-04-30T15:02:55.996577', '9301', '1'), - ('2.99', '465', '2007-02-15T10:41:08.996577', '1337', '1'), - ('2.99', '269', '2007-04-28T12:36:12.996577', '7972', '1'), - ('7.99', '383', '2007-02-16T20:50:43.996577', '1831', '1'), - ('2.99', '377', '2007-04-06T15:46:23.996577', '3858', '1'), - ('2.99', '37', '2007-03-21T13:43:29.996577', '14532', '2'), - ('2.99', '598', '2007-02-20T08:38:55.996577', '3005', '1'), - ('7.99', '180', '2007-04-08T16:12:51.996577', '4826', '2'), - ('2.99', '527', '2007-02-19T00:27:05.996577', '2539', '1'), - ('1.99', '260', '2007-04-27T09:51:35.996577', '7268', '1'), - ('0.99', '251', '2007-03-21T05:34:46.996577', '14292', '1'), - ('1.99', '64', '2007-04-12T11:13:26.996577', '6698', '2'), - ('7.99', '37', '2007-03-19T07:49:36.996577', '13046', '1'), - ('0.99', '132', '2007-04-06T08:46:27.996577', '3706', '1'), - ('2.99', '413', '2007-03-02T00:22:25.996577', '10909', '1'), - ('4.99', '51', '2007-04-29T07:33:32.996577', '8495', '1'), - ('6.99', '86', '2007-03-01T12:27:13.996577', '10584', '2'), - ('4.99', '353', '2007-03-02T18:11:33.996577', '11414', '2'), - ('0.99', '514', '2007-03-20T20:40:12.996577', '14052', '1'), - ('5.99', '252', '2007-02-15T14:49:30.996577', '1395', '1'), - ('5.99', '142', '2007-03-02T01:20:44.996577', '10934', '2'), - ('5.99', '168', '2007-04-11T17:49:10.996577', '6334', '1'), - ('3.99', '10', '2007-02-18T01:54:49.996577', '2222', '2'), - ('0.99', '125', '2007-04-11T02:27:34.996577', '6055', '1'), - ('2.99', '241', '2007-03-19T08:43:45.996577', '13077', '2'), - ('2.99', '9', '2007-03-18T04:27:06.996577', '12309', '1'), - ('3.99', '196', '2007-04-09T16:32:55.996577', '5353', '2'), - ('3.99', '227', '2007-04-09T02:03:23.996577', '5046', '1'), - ('1.99', '75', '2007-04-28T21:40:11.996577', '8202', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['19213', '30803', '22000', '19300', '21442', '24122', '19742', '26072', '20725', '26808', '29068', '31524', '23543', '19569', '31970', '23061', '31184', '20196', '24718', '28796', '26495', '28374', '31903', '19949', '30911', '20700', '18541', '31837', '29943', '27825', '19407', '24616', '29164', '23483', '20427', '30704', '30756', '30965', '31746', '18334', '19011', '22190', '20690', '21884', '24657', '24151', '28080', '21444', '24476', '19619', '18246', '22818', '25688', '19509', '26099', '29414', '24174', '27276', '17808', '19027', '22325', '26909', '22444', '17576', '27871', '20339', '22181', '30700', '25720', '25282', '25881', '21813', '23280', '25453', '26701', '23559', '22871', '28448', '26042', '27266', '27754', '31726', '32043', '29982', '21535', '19440', '25970', '17899', '19774', '29041', '30360', '26297', '29158', '20770', '28142', '29188', '28364', '26441', '25246', '31997']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('2.99', '186', '2007-02-15T08:04:45.996577', '1300', '1'), - ('4.99', '159', '2007-04-12T19:24:30.996577', '6885', '2'), - ('0.99', '529', '2007-03-21T22:06:13.996577', '14764', '2'), - ('9.99', '212', '2007-02-19T14:27:04.996577', '2739', '2'), - ('2.99', '468', '2007-03-21T06:18:19.996577', '14313', '1'), - ('2.99', '150', '2007-03-18T16:05:37.996577', '12627', '2'), - ('7.99', '289', '2007-03-18T13:21:01.996577', '12558', '2'), - ('2.99', '347', '2007-04-10T14:24:46.996577', '5819', '1'), - ('0.99', '394', '2007-03-19T07:53:15.996577', '13047', '2'), - ('0.99', '410', '2007-04-29T22:52:31.996577', '8882', '1'), - ('1.99', '7', '2007-04-11T09:04:54.996577', '6174', '1'), - ('2.99', '231', '2007-04-30T06:35:07.996577', '9711', '2'), - ('4.99', '90', '2007-03-01T17:35:34.996577', '10722', '1'), - ('2.99', '272', '2007-03-02T03:31:31.996577', '11003', '2'), - ('0.00', '457', '2007-05-14T13:44:29.996577', '14516', '2'), - ('2.99', '38', '2007-03-23T07:30:30.996577', '15668', '1'), - ('4.99', '195', '2007-04-09T10:54:27.996577', '5228', '1'), - ('0.99', '340', '2007-03-21T20:07:51.996577', '14718', '2'), - ('5.99', '218', '2007-03-20T16:14:32.996577', '13947', '2'), - ('0.99', '590', '2007-04-30T08:12:41.996577', '9126', '2'), - ('0.99', '382', '2007-04-30T00:39:42.996577', '9555', '2'), - ('4.99', '553', '2007-04-30T13:33:48.996577', '9272', '2'), - ('2.99', '265', '2007-04-29T07:26:29.996577', '8489', '2'), - ('2.99', '312', '2007-03-01T22:37:05.996577', '10858', '2'), - ('4.99', '168', '2007-04-30T19:29:18.996577', '9418', '1'), - ('6.99', '392', '2007-03-17T21:13:52.996577', '12102', '2'), - ('5.99', '12', '2007-02-18T16:40:17.996577', '2434', '2'), - ('2.99', '260', '2007-04-08T17:43:11.996577', '4870', '1'), - ('8.99', '86', '2007-04-10T10:56:04.996577', '5752', '1'), - ('0.99', '502', '2007-04-30T12:11:26.996577', '9232', '2'), - ('0.99', '241', '2007-02-18T16:16:00.996577', '2428', '2'), - ('2.99', '201', '2007-03-20T06:55:53.996577', '13672', '2'), - ('0.99', '16', '2007-04-06T00:52:05.996577', '3548', '1'), - ('4.99', '83', '2007-03-18T02:39:39.996577', '12258', '1'), - ('2.99', '365', '2007-03-20T05:07:52.996577', '13619', '1'), - ('6.99', '149', '2007-04-28T13:07:31.996577', '7989', '1'), - ('2.99', '155', '2007-04-27T18:22:44.996577', '7492', '1'), - ('3.99', '173', '2007-04-10T03:47:17.996577', '5615', '1'), - ('8.99', '251', '2007-04-27T12:42:00.996577', '7338', '2'), - ('4.99', '562', '2007-02-21T01:24:50.996577', '3242', '2'), - ('0.99', '132', '2007-02-16T22:22:08.996577', '1843', '1'), - ('4.99', '550', '2007-03-21T19:00:42.996577', '14687', '1'), - ('4.99', '391', '2007-03-02T08:21:10.996577', '11151', '1'), - ('0.99', '516', '2007-03-22T04:09:05.996577', '14932', '1'), - ('5.99', '211', '2007-03-23T07:35:37.996577', '15670', '2'), - ('0.99', '152', '2007-03-20T17:41:49.996577', '13986', '1'), - ('2.99', '526', '2007-04-09T02:42:11.996577', '5056', '2'), - ('4.99', '468', '2007-03-22T22:56:45.996577', '15435', '2'), - ('0.99', '186', '2007-03-22T06:29:15.996577', '15001', '2'), - ('3.99', '275', '2007-03-23T00:58:49.996577', '15496', '2'), - ('2.99', '537', '2007-02-15T17:38:33.996577', '1445', '1'), - ('2.99', '15', '2007-03-02T15:37:50.996577', '11341', '2'), - ('5.99', '313', '2007-04-09T12:19:34.996577', '5255', '1'), - ('4.99', '267', '2007-02-15T04:44:02.996577', '1257', '2'), - ('2.99', '348', '2007-04-30T21:57:42.996577', '9482', '2'), - ('4.99', '38', '2007-04-27T05:52:24.996577', '7158', '2'), - ('4.99', '155', '2007-03-02T04:22:43.996577', '11033', '1'), - ('7.99', '454', '2007-04-06T04:33:30.996577', '3622', '1'), - ('4.99', '421', '2007-02-20T20:31:20.996577', '3170', '1'), - ('2.99', '135', '2007-02-20T03:50:44.996577', '2941', '2'), - ('6.99', '565', '2007-03-02T09:45:49.996577', '11189', '2'), - ('8.99', '421', '2007-04-06T21:59:08.996577', '3988', '1'), - ('7.99', '578', '2007-03-01T19:40:20.996577', '10779', '1'), - ('1.99', '359', '2007-02-16T16:36:21.996577', '1770', '2'), - ('0.99', '507', '2007-04-10T22:13:48.996577', '5962', '1'), - ('3.99', '356', '2007-03-16T23:08:20.996577', '11535', '1'), - ('2.99', '550', '2007-03-02T12:02:22.996577', '11246', '1'), - ('10.99', '149', '2007-04-09T14:04:43.996577', '5298', '1'), - ('2.99', '316', '2007-04-07T19:00:56.996577', '4379', '1'), - ('2.99', '279', '2007-04-30T22:10:59.996577', '10177', '2'), - ('4.99', '331', '2007-04-05T22:47:58.996577', '3505', '1'), - ('6.99', '509', '2007-03-17T10:37:46.996577', '11814', '1'), - ('1.99', '62', '2007-03-21T15:19:00.996577', '14574', '2'), - ('4.99', '293', '2007-04-08T02:34:56.996577', '4542', '2'), - ('6.99', '402', '2007-04-30T04:29:07.996577', '9657', '1'), - ('0.99', '91', '2007-03-21T00:12:24.996577', '14132', '1'), - ('2.99', '20', '2007-03-19T17:54:08.996577', '13317', '2'), - ('0.99', '561', '2007-04-28T02:12:40.996577', '7698', '1'), - ('2.99', '345', '2007-04-07T20:51:10.996577', '4425', '1'), - ('0.99', '453', '2007-04-06T19:21:05.996577', '3929', '2'), - ('0.99', '497', '2007-04-08T04:28:43.996577', '4578', '1'), - ('4.99', '249', '2007-04-09T00:13:06.996577', '5011', '1'), - ('4.99', '87', '2007-05-14T13:44:29.996577', '12719', '2'), - ('4.99', '89', '2007-04-28T13:28:35.996577', '7995', '2'), - ('4.99', '477', '2007-03-01T09:29:27.996577', '10500', '1'), - ('4.99', '250', '2007-02-18T16:27:44.996577', '2432', '1'), - ('2.99', '337', '2007-04-12T07:19:29.996577', '6620', '1'), - ('2.99', '446', '2007-02-20T12:15:46.996577', '3060', '1'), - ('4.99', '293', '2007-03-20T11:43:56.996577', '13817', '1'), - ('1.99', '5', '2007-04-09T07:20:08.996577', '5156', '2'), - ('2.99', '121', '2007-04-29T22:43:35.996577', '8875', '2'), - ('5.99', '366', '2007-04-08T03:59:17.996577', '4569', '1'), - ('4.99', '15', '2007-04-27T03:44:03.996577', '7105', '1'), - ('0.99', '400', '2007-03-01T17:13:35.996577', '10711', '1'), - ('0.99', '531', '2007-04-10T16:04:53.996577', '5850', '2'), - ('2.99', '18', '2007-04-28T17:56:03.996577', '8122', '2'), - ('4.99', '553', '2007-04-06T17:26:51.996577', '3891', '2'), - ('0.99', '377', '2007-04-30T01:00:03.996577', '9564', '1'), - ('5.99', '276', '2007-04-27T10:28:45.996577', '7282', '2'), - ('0.99', '561', '2007-05-14T13:44:29.996577', '14415', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['23083', '18901', '30951', '25623', '25596', '26976', '25270', '26663', '22741', '21837', '25999', '23491', '23311', '20029', '22560', '29601', '21578', '24345', '23834', '26434', '30622', '19678', '29289', '22924', '24982', '28625', '29361', '28895', '24820', '25426', '30839', '30871', '20845', '22516', '24467', '18005', '22565', '20391', '31353', '25440', '27899', '24543', '28526', '21767', '19367', '25779', '27206', '27719', '30226', '25504', '29450', '25776', '26447', '25736', '19573', '26910', '20153', '18392', '22294', '28178', '29993', '20069', '25621', '29842', '26195', '28494', '31342', '21467', '27333', '30862', '31839', '28866', '27227', '26502', '21217', '25430', '28707', '28342', '22542', '19308', '23975', '20060', '23060', '24144', '25692', '26967', '22093', '24039', '21613', '25254', '20311', '25209', '19772', '18557', '29151', '28472', '21638', '29031', '20469', '23790']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('5.99', '41', '2007-03-01T22:29:20.996577', '10853', '1'), - ('0.99', '103', '2007-02-19T13:26:20.996577', '2724', '1'), - ('6.99', '172', '2007-04-27T04:31:44.996577', '7122', '1'), - ('0.99', '306', '2007-04-30T08:26:17.996577', '9774', '1'), - ('4.99', '304', '2007-04-27T20:27:41.996577', '7551', '2'), - ('3.99', '426', '2007-04-10T09:49:47.996577', '5725', '1'), - ('0.99', '278', '2007-04-28T07:15:09.996577', '7834', '2'), - ('4.99', '399', '2007-04-08T22:57:55.996577', '4981', '2'), - ('7.99', '6', '2007-03-21T06:51:22.996577', '14329', '1'), - ('2.99', '512', '2007-03-22T01:51:46.996577', '14870', '1'), - ('0.99', '340', '2007-04-08T12:03:49.996577', '4742', '1'), - ('3.99', '84', '2007-03-02T18:26:08.996577', '11424', '2'), - ('0.99', '66', '2007-03-01T06:41:48.996577', '10419', '1'), - ('0.99', '323', '2007-03-01T02:34:29.996577', '10298', '1'), - ('0.99', '592', '2007-03-01T05:05:42.996577', '10383', '2'), - ('2.99', '54', '2007-04-10T23:34:47.996577', '5992', '1'), - ('4.99', '482', '2007-03-19T12:21:16.996577', '13174', '1'), - ('2.99', '173', '2007-03-21T18:05:25.996577', '14654', '1'), - ('4.99', '124', '2007-03-19T00:16:11.996577', '12835', '1'), - ('0.99', '377', '2007-04-07T03:22:06.996577', '4077', '1'), - ('0.99', '144', '2007-04-09T02:22:38.996577', '5049', '2'), - ('2.99', '280', '2007-03-22T08:04:26.996577', '15036', '2'), - ('0.99', '28', '2007-04-12T00:06:14.996577', '6476', '2'), - ('0.99', '25', '2007-03-17T03:16:31.996577', '11642', '1'), - ('0.99', '250', '2007-03-18T06:15:57.996577', '12361', '1'), - ('5.99', '576', '2007-04-30T00:22:45.996577', '9548', '2'), - ('3.99', '34', '2007-04-05T22:52:51.996577', '3508', '2'), - ('3.99', '598', '2007-04-12T09:48:38.996577', '6660', '2'), - ('4.99', '231', '2007-03-21T12:01:54.996577', '14478', '1'), - ('4.99', '291', '2007-04-12T02:20:20.996577', '6516', '2'), - ('10.99', '163', '2007-04-10T02:23:04.996577', '5574', '1'), - ('6.99', '166', '2007-04-07T19:27:24.996577', '4389', '2'), - ('6.99', '407', '2007-03-20T13:17:58.996577', '13856', '2'), - ('1.99', '586', '2007-03-21T08:47:51.996577', '14392', '1'), - ('5.99', '186', '2007-03-18T05:50:13.996577', '12348', '1'), - ('4.99', '468', '2007-02-18T18:28:41.996577', '2462', '2'), - ('1.99', '592', '2007-03-19T05:21:24.996577', '12976', '1'), - ('0.99', '361', '2007-03-20T19:52:50.996577', '14031', '2'), - ('2.99', '217', '2007-04-27T03:43:51.996577', '7104', '2'), - ('8.99', '292', '2007-04-11T14:27:36.996577', '6270', '1'), - ('6.99', '509', '2007-04-28T07:52:57.996577', '7848', '1'), - ('7.99', '194', '2007-03-20T04:58:59.996577', '13616', '2'), - ('2.99', '568', '2007-04-09T15:27:49.996577', '5332', '2'), - ('0.99', '503', '2007-03-23T12:42:13.996577', '15797', '1'), - ('0.99', '232', '2007-02-16T05:42:39.996577', '1619', '2'), - ('2.99', '321', '2007-04-11T10:04:44.996577', '6190', '2'), - ('0.99', '446', '2007-04-29T15:09:49.996577', '8691', '2'), - ('7.99', '494', '2007-04-08T03:04:47.996577', '4551', '2'), - ('4.99', '108', '2007-04-30T07:53:21.996577', '9755', '2'), - ('0.99', '297', '2007-04-06T02:39:01.996577', '3582', '1'), - ('9.99', '41', '2007-04-07T14:24:49.996577', '4294', '2'), - ('5.99', '321', '2007-04-07T16:16:16.996577', '4318', '1'), - ('1.99', '378', '2007-04-11T12:39:13.996577', '6233', '2'), - ('7.99', '317', '2007-04-10T21:15:43.996577', '5942', '2'), - ('2.99', '272', '2007-03-19T16:18:29.996577', '13274', '2'), - ('5.99', '421', '2007-04-07T22:13:47.996577', '4456', '2'), - ('2.99', '336', '2007-03-23T14:09:38.996577', '15848', '2'), - ('6.99', '578', '2007-02-16T20:22:18.996577', '1826', '2'), - ('4.99', '562', '2007-03-17T17:44:44.996577', '12008', '2'), - ('1.99', '533', '2007-04-29T14:27:32.996577', '8676', '1'), - ('3.99', '90', '2007-04-10T01:11:24.996577', '5539', '2'), - ('3.99', '327', '2007-03-22T20:10:43.996577', '15365', '2'), - ('4.99', '306', '2007-04-30T12:32:24.996577', '9242', '2'), - ('0.99', '76', '2007-04-30T01:07:11.996577', '8935', '1'), - ('2.99', '357', '2007-04-11T21:21:38.996577', '6405', '2'), - ('2.99', '565', '2007-04-30T03:19:37.996577', '9628', '1'), - ('0.99', '215', '2007-04-30T23:11:52.996577', '9518', '1'), - ('0.99', '470', '2007-03-17T07:17:09.996577', '11742', '1'), - ('6.99', '459', '2007-04-30T08:37:50.996577', '9137', '1'), - ('4.99', '165', '2007-04-10T06:02:34.996577', '5658', '2'), - ('0.99', '260', '2007-04-27T02:30:59.996577', '7072', '2'), - ('2.99', '595', '2007-04-30T09:19:53.996577', '9152', '1'), - ('2.99', '448', '2007-04-08T03:23:52.996577', '4558', '2'), - ('0.99', '383', '2007-04-29T12:51:14.996577', '8635', '1'), - ('1.99', '446', '2007-03-23T13:07:03.996577', '15808', '1'), - ('0.99', '291', '2007-04-29T15:07:54.996577', '8690', '1'), - ('2.99', '583', '2007-04-06T12:15:02.996577', '3779', '1'), - ('4.99', '550', '2007-04-30T20:31:46.996577', '10140', '2'), - ('6.99', '589', '2007-03-21T04:19:54.996577', '14254', '1'), - ('2.99', '213', '2007-02-21T01:53:52.996577', '3252', '1'), - ('5.99', '138', '2007-03-01T07:10:20.996577', '10431', '1'), - ('2.99', '326', '2007-03-19T00:06:44.996577', '12829', '2'), - ('6.99', '38', '2007-03-21T22:54:25.996577', '14787', '1'), - ('6.99', '152', '2007-03-17T03:07:35.996577', '11638', '2'), - ('3.99', '313', '2007-04-30T02:30:31.996577', '8970', '1'), - ('4.99', '425', '2007-04-27T09:08:19.996577', '7249', '1'), - ('2.99', '539', '2007-03-20T04:57:19.996577', '13615', '2'), - ('4.99', '144', '2007-03-01T12:41:45.996577', '10593', '1'), - ('4.99', '486', '2007-03-21T04:10:46.996577', '14251', '2'), - ('2.99', '277', '2007-04-06T17:40:09.996577', '3897', '2'), - ('5.99', '352', '2007-03-18T01:45:59.996577', '12234', '2'), - ('5.99', '273', '2007-04-08T20:58:25.996577', '4937', '1'), - ('2.99', '293', '2007-03-19T06:56:30.996577', '13029', '1'), - ('0.99', '16', '2007-02-21T09:45:08.996577', '3348', '2'), - ('4.99', '14', '2007-04-29T21:14:34.996577', '8836', '2'), - ('1.99', '563', '2007-04-28T23:39:44.996577', '8262', '1'), - ('6.99', '489', '2007-03-18T18:55:13.996577', '12701', '2'), - ('4.99', '3', '2007-04-30T10:01:24.996577', '9816', '2'), - ('5.99', '369', '2007-03-21T18:56:52.996577', '14684', '2'), - ('6.99', '119', '2007-03-22T13:52:25.996577', '15171', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['21946', '27894', '26279', '21991', '24967', '20456', '27417', '31450', '21419', '24725', '18033', '20347', '24045', '25642', '22921', '18062', '27184', '32086', '22990', '27280', '31072', '26311', '17531', '30370', '27067', '21026', '28020', '18863', '22483', '20840', '26491', '24013', '20104', '22007', '21401', '24776', '29888', '24464', '31750', '23608', '28595', '27927', '29075', '25598', '17599', '28297', '22766', '30282', '24574', '26767', '17666', '29382', '23191', '30011', '31279', '25319', '20880', '25171', '25148', '28217', '25080', '29235', '24305', '27412', '18019', '22025', '30939', '18911', '29311', '27749', '29335', '17564', '19260', '30159', '19697', '21196', '20337', '25212', '28645', '30225', '19804', '28088', '25578', '22126', '24726', '30800', '25980', '18420', '31375', '18655', '24552', '27548', '29570', '30237', '20341', '23417', '25988', '26343', '21042', '30523']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('2.99', '523', '2007-03-18T03:29:46.996577', '12288', '1'), - ('1.99', '509', '2007-04-07T06:46:01.996577', '4139', '2'), - ('4.99', '364', '2007-04-08T09:32:13.996577', '4689', '2'), - ('10.99', '529', '2007-03-01T04:22:15.996577', '10361', '2'), - ('4.99', '247', '2007-03-18T23:46:26.996577', '12824', '1'), - ('2.99', '368', '2007-03-19T16:31:17.996577', '13280', '2'), - ('4.99', '468', '2007-04-12T04:55:15.996577', '6581', '1'), - ('4.99', '226', '2007-04-06T09:38:35.996577', '3721', '1'), - ('4.99', '466', '2007-03-20T17:49:54.996577', '13988', '1'), - ('5.99', '219', '2007-03-21T15:54:19.996577', '14588', '1'), - ('6.99', '477', '2007-02-16T12:58:25.996577', '1714', '1'), - ('4.99', '356', '2007-03-23T09:01:18.996577', '15705', '1'), - ('4.99', '144', '2007-03-17T12:19:46.996577', '11859', '1'), - ('2.99', '308', '2007-04-30T21:50:35.996577', '9479', '1'), - ('5.99', '25', '2007-03-01T03:17:32.996577', '10324', '1'), - ('4.99', '484', '2007-02-17T10:44:55.996577', '2015', '1'), - ('0.99', '445', '2007-04-07T09:25:47.996577', '4193', '1'), - ('4.99', '219', '2007-05-14T13:44:29.996577', '11577', '1'), - ('0.99', '31', '2007-03-18T06:54:31.996577', '12377', '1'), - ('4.99', '454', '2007-04-11T13:54:55.996577', '6260', '2'), - ('0.99', '182', '2007-04-27T08:29:20.996577', '7229', '2'), - ('2.99', '366', '2007-04-30T00:46:45.996577', '8928', '2'), - ('4.99', '347', '2007-02-20T10:16:26.996577', '3026', '1'), - ('7.99', '122', '2007-04-26T23:07:42.996577', '6974', '2'), - ('4.99', '435', '2007-04-29T23:15:21.996577', '8891', '2'), - ('0.99', '425', '2007-03-01T11:06:12.996577', '10545', '1'), - ('0.99', '521', '2007-04-07T14:00:23.996577', '4284', '2'), - ('4.99', '93', '2007-02-18T03:50:22.996577', '2256', '2'), - ('5.99', '582', '2007-03-22T10:02:59.996577', '15090', '1'), - ('4.99', '407', '2007-03-16T22:28:15.996577', '11518', '2'), - ('0.99', '382', '2007-04-29T18:38:47.996577', '8777', '2'), - ('2.99', '141', '2007-03-18T06:01:34.996577', '12353', '2'), - ('7.99', '331', '2007-03-21T04:20:53.996577', '14256', '1'), - ('4.99', '530', '2007-03-18T17:00:13.996577', '12649', '1'), - ('6.99', '464', '2007-03-22T10:04:42.996577', '15092', '1'), - ('1.99', '226', '2007-03-17T23:35:26.996577', '12172', '1'), - ('1.99', '80', '2007-04-12T11:36:21.996577', '6707', '2'), - ('2.99', '185', '2007-03-21T13:20:01.996577', '14513', '2'), - ('0.99', '251', '2007-04-30T12:34:51.996577', '9892', '1'), - ('0.99', '98', '2007-03-02T03:34:19.996577', '11007', '2'), - ('4.99', '574', '2007-04-09T00:01:49.996577', '5010', '2'), - ('6.99', '512', '2007-04-09T03:07:17.996577', '5064', '1'), - ('2.99', '8', '2007-04-07T08:30:29.996577', '4175', '2'), - ('0.99', '304', '2007-04-30T13:46:29.996577', '9930', '1'), - ('4.99', '364', '2007-02-19T05:19:58.996577', '2606', '2'), - ('0.99', '546', '2007-04-08T08:29:54.996577', '4664', '2'), - ('4.99', '9', '2007-03-01T07:42:26.996577', '10454', '1'), - ('2.99', '114', '2007-04-27T11:47:29.996577', '7316', '2'), - ('4.99', '197', '2007-03-22T04:48:03.996577', '14951', '2'), - ('0.99', '407', '2007-04-29T10:17:05.996577', '8571', '2'), - ('1.99', '382', '2007-02-18T20:29:10.996577', '2489', '1'), - ('6.99', '35', '2007-04-29T20:48:47.996577', '8822', '1'), - ('2.99', '53', '2007-03-18T14:17:34.996577', '12580', '1'), - ('4.99', '91', '2007-04-11T03:35:18.996577', '6078', '1'), - ('2.99', '210', '2007-04-07T15:40:58.996577', '4306', '1'), - ('4.99', '283', '2007-04-06T03:03:38.996577', '3590', '2'), - ('2.99', '410', '2007-03-22T15:08:47.996577', '15211', '1'), - ('3.99', '268', '2007-04-11T06:18:19.996577', '6120', '1'), - ('4.99', '266', '2007-03-02T14:43:33.996577', '11321', '1'), - ('0.99', '537', '2007-04-12T13:01:27.996577', '6746', '1'), - ('6.99', '259', '2007-03-20T21:17:49.996577', '14067', '2'), - ('3.99', '23', '2007-04-30T06:53:29.996577', '9718', '2'), - ('1.99', '169', '2007-03-19T14:47:02.996577', '13237', '2'), - ('5.99', '468', '2007-04-06T14:59:25.996577', '3840', '1'), - ('5.99', '472', '2007-02-19T00:25:25.996577', '2538', '1'), - ('5.99', '532', '2007-03-18T03:44:12.996577', '12295', '2'), - ('4.99', '171', '2007-04-10T23:23:22.996577', '5986', '1'), - ('2.99', '107', '2007-02-15T03:35:58.996577', '1243', '2'), - ('5.99', '30', '2007-04-09T01:03:11.996577', '5028', '2'), - ('2.99', '496', '2007-04-27T04:57:49.996577', '7133', '1'), - ('2.99', '31', '2007-04-27T06:37:51.996577', '7178', '2'), - ('4.99', '356', '2007-02-18T16:38:43.996577', '2433', '1'), - ('0.99', '196', '2007-02-19T10:43:53.996577', '2681', '1'), - ('4.99', '103', '2007-04-08T17:51:42.996577', '4872', '2'), - ('5.99', '284', '2007-03-20T18:51:13.996577', '14007', '1'), - ('0.99', '444', '2007-03-20T15:33:44.996577', '13924', '1'), - ('3.99', '356', '2007-03-01T06:58:37.996577', '10427', '1'), - ('2.99', '273', '2007-04-10T03:35:11.996577', '5605', '1'), - ('4.99', '578', '2007-04-10T17:35:41.996577', '5876', '2'), - ('4.99', '108', '2007-04-29T21:38:54.996577', '8846', '1'), - ('4.99', '296', '2007-03-20T11:51:41.996577', '13819', '1'), - ('1.99', '526', '2007-04-27T14:44:28.996577', '7399', '2'), - ('4.99', '303', '2007-04-09T06:33:25.996577', '5140', '1'), - ('4.99', '543', '2007-03-01T10:14:24.996577', '10520', '1'), - ('4.99', '219', '2007-03-21T19:01:03.996577', '14688', '1'), - ('5.99', '159', '2007-04-06T18:39:36.996577', '3914', '2'), - ('2.99', '338', '2007-04-11T12:46:43.996577', '6236', '1'), - ('4.99', '587', '2007-02-17T11:55:42.996577', '2034', '2'), - ('1.99', '219', '2007-04-12T01:40:21.996577', '6501', '2'), - ('2.99', '38', '2007-02-15T04:24:06.996577', '1250', '2'), - ('7.99', '195', '2007-03-21T21:39:49.996577', '14751', '2'), - ('1.99', '479', '2007-04-11T22:13:51.996577', '6421', '1'), - ('7.99', '51', '2007-04-09T21:47:37.996577', '5473', '1'), - ('4.99', '110', '2007-04-08T16:14:56.996577', '4827', '2'), - ('4.99', '356', '2007-03-17T18:50:01.996577', '12037', '2'), - ('10.99', '76', '2007-03-23T03:45:49.996577', '15566', '1'), - ('3.99', '339', '2007-04-08T22:16:29.996577', '4967', '2'), - ('2.99', '369', '2007-04-28T22:55:30.996577', '8236', '1'), - ('2.99', '426', '2007-03-22T00:00:40.996577', '14826', '2'), - ('0.99', '135', '2007-04-27T16:07:44.996577', '7437', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['31006', '27869', '18471', '28388', '31511', '22982', '31954', '20464', '29917', '18478', '19318', '21246', '17612', '27449', '18318', '30899', '29623', '18580', '17821', '25820', '18561', '19504', '22690', '19299', '22918', '24214', '26562', '21930', '24058', '21159', '22694', '27344', '23609', '28225', '26219', '25565', '29672', '23196', '19169', '25445', '32000', '19288', '27157', '20377', '18242', '21107', '28790', '27284', '26944', '20777', '31836', '25617', '22502', '20034', '27177', '28309', '18395', '23430', '19990', '26329', '21698', '22978', '24910', '27209', '26946', '21100', '18353', '31009', '20915', '31301', '24027', '24304', '27555', '18831', '20786', '19082', '21157', '21479', '22179', '25434', '30340', '24998', '31626', '29097', '23253', '31632', '22477', '28312', '18699', '29801', '27565', '29295', '26304', '17773', '28605', '19650', '19307', '22623', '17941', '30177']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('3.99', '177', '2007-04-27T18:24:12.996577', '7493', '1'), - ('0.99', '507', '2007-04-08T12:12:23.996577', '4744', '2'), - ('0.99', '202', '2007-02-20T18:55:44.996577', '3148', '2'), - ('0.99', '556', '2007-04-08T16:57:31.996577', '4846', '1'), - ('3.99', '230', '2007-04-30T08:30:30.996577', '9778', '2'), - ('0.99', '30', '2007-03-19T22:04:10.996577', '13435', '1'), - ('2.99', '410', '2007-05-14T13:44:29.996577', '12665', '1'), - ('3.99', '369', '2007-03-01T04:20:47.996577', '10359', '2'), - ('1.99', '83', '2007-04-30T11:45:30.996577', '9867', '1'), - ('4.99', '204', '2007-02-17T00:53:38.996577', '1871', '1'), - ('2.99', '215', '2007-02-20T18:30:18.996577', '3143', '1'), - ('7.99', '449', '2007-03-22T05:06:09.996577', '14962', '2'), - ('4.99', '368', '2007-02-18T23:49:15.996577', '2531', '1'), - ('3.99', '470', '2007-04-11T00:20:24.996577', '6009', '1'), - ('4.99', '559', '2007-02-20T11:11:25.996577', '3046', '2'), - ('5.99', '168', '2007-04-07T18:11:54.996577', '4363', '2'), - ('4.99', '57', '2007-04-07T11:06:22.996577', '4226', '2'), - ('5.99', '23', '2007-02-20T09:17:22.996577', '3015', '1'), - ('6.99', '425', '2007-02-21T04:04:18.996577', '3276', '1'), - ('3.99', '324', '2007-04-29T15:20:43.996577', '8698', '1'), - ('5.99', '18', '2007-02-15T17:58:44.996577', '1451', '2'), - ('2.99', '265', '2007-02-19T04:28:23.996577', '2598', '1'), - ('5.99', '1', '2007-03-22T18:32:12.996577', '15315', '1'), - ('2.99', '212', '2007-02-16T06:58:24.996577', '1637', '1'), - ('4.99', '24', '2007-03-19T08:09:19.996577', '13058', '2'), - ('4.99', '159', '2007-03-02T11:11:53.996577', '11225', '2'), - ('6.99', '389', '2007-04-29T03:09:05.996577', '8338', '1'), - ('0.99', '521', '2007-03-21T09:52:25.996577', '14423', '1'), - ('2.99', '145', '2007-03-18T22:34:15.996577', '12785', '2'), - ('4.99', '440', '2007-03-23T16:43:32.996577', '15925', '1'), - ('6.99', '2', '2007-03-02T09:12:14.996577', '11177', '1'), - ('2.99', '460', '2007-04-29T13:34:18.996577', '8656', '2'), - ('2.99', '98', '2007-03-02T10:17:02.996577', '11200', '2'), - ('4.99', '538', '2007-04-09T17:10:42.996577', '5369', '1'), - ('4.99', '360', '2007-04-07T02:26:02.996577', '4056', '1'), - ('2.99', '302', '2007-04-10T07:20:05.996577', '5682', '2'), - ('4.99', '62', '2007-04-07T07:39:23.996577', '4159', '2'), - ('5.99', '53', '2007-03-20T23:44:25.996577', '14119', '2'), - ('4.99', '175', '2007-02-21T03:17:33.996577', '3266', '2'), - ('4.99', '292', '2007-04-28T05:10:23.996577', '7766', '1'), - ('5.98', '576', '2007-05-14T13:44:29.996577', '11942', '2'), - ('7.99', '201', '2007-02-21T11:06:12.996577', '3364', '1'), - ('2.99', '442', '2007-04-27T15:48:42.996577', '7427', '2'), - ('6.99', '360', '2007-03-19T00:22:09.996577', '12839', '1'), - ('4.99', '535', '2007-02-21T00:48:50.996577', '3228', '1'), - ('2.99', '435', '2007-03-22T11:47:51.996577', '15136', '1'), - ('4.99', '590', '2007-04-11T12:36:53.996577', '6232', '2'), - ('0.99', '454', '2007-04-30T05:01:02.996577', '9041', '2'), - ('0.99', '424', '2007-04-10T02:05:22.996577', '5568', '1'), - ('4.99', '400', '2007-03-23T02:23:05.996577', '15533', '2'), - ('6.99', '260', '2007-04-08T11:59:49.996577', '4741', '2'), - ('4.99', '306', '2007-04-27T08:32:45.996577', '7232', '1'), - ('4.99', '584', '2007-03-21T10:40:31.996577', '14447', '2'), - ('5.99', '323', '2007-03-19T11:04:22.996577', '13140', '1'), - ('6.99', '444', '2007-04-08T07:59:53.996577', '4648', '2'), - ('4.99', '547', '2007-04-09T15:08:15.996577', '5327', '2'), - ('5.99', '579', '2007-02-18T16:06:11.996577', '2425', '2'), - ('7.99', '78', '2007-03-01T21:51:11.996577', '10831', '1'), - ('2.99', '317', '2007-03-01T04:35:15.996577', '10364', '1'), - ('4.99', '368', '2007-04-11T06:30:58.996577', '6124', '1'), - ('0.99', '496', '2007-03-21T07:22:52.996577', '14348', '1'), - ('6.99', '30', '2007-03-01T00:26:14.996577', '10235', '1'), - ('0.99', '241', '2007-03-22T04:19:52.996577', '14936', '1'), - ('0.99', '446', '2007-04-30T07:48:07.996577', '9116', '1'), - ('2.99', '424', '2007-04-12T05:34:55.996577', '6589', '1'), - ('0.99', '435', '2007-03-17T09:45:13.996577', '11796', '1'), - ('5.99', '569', '2007-02-16T08:48:18.996577', '1668', '2'), - ('1.99', '177', '2007-04-30T10:52:43.996577', '9190', '2'), - ('0.99', '414', '2007-03-19T20:47:08.996577', '13404', '1'), - ('4.99', '211', '2007-04-10T12:34:29.996577', '5785', '2'), - ('0.99', '142', '2007-03-20T16:44:47.996577', '13959', '1'), - ('2.99', '169', '2007-03-19T13:15:44.996577', '13198', '2'), - ('2.99', '479', '2007-04-30T05:51:37.996577', '9697', '2'), - ('1.99', '85', '2007-02-21T06:20:56.996577', '3307', '1'), - ('0.99', '401', '2007-03-23T13:49:45.996577', '15831', '1'), - ('5.99', '149', '2007-02-18T06:59:44.996577', '2305', '1'), - ('7.99', '440', '2007-03-22T01:25:30.996577', '14863', '2'), - ('7.99', '471', '2007-03-20T22:14:50.996577', '14085', '1'), - ('4.99', '549', '2007-03-18T20:56:48.996577', '12747', '2'), - ('7.99', '291', '2007-04-30T13:24:12.996577', '9919', '2'), - ('5.99', '120', '2007-04-06T22:35:26.996577', '4001', '1'), - ('0.99', '252', '2007-03-01T02:59:44.996577', '10314', '2'), - ('4.99', '240', '2007-04-07T15:35:37.996577', '4305', '2'), - ('7.99', '10', '2007-04-09T01:41:18.996577', '5038', '1'), - ('4.99', '59', '2007-03-20T15:25:37.996577', '13921', '2'), - ('4.99', '240', '2007-04-26T23:54:00.996577', '7001', '1'), - ('7.99', '582', '2007-03-02T13:26:10.996577', '11290', '2'), - ('4.99', '547', '2007-04-27T15:38:05.996577', '7420', '2'), - ('9.99', '49', '2007-02-15T03:12:36.996577', '1237', '2'), - ('4.99', '73', '2007-04-27T21:52:50.996577', '7590', '1'), - ('0.99', '481', '2007-04-06T16:08:44.996577', '3863', '1'), - ('4.99', '28', '2007-04-30T06:08:59.996577', '9705', '2'), - ('4.99', '366', '2007-04-26T22:54:43.996577', '6971', '2'), - ('2.99', '408', '2007-02-19T13:32:30.996577', '2728', '2'), - ('3.99', '574', '2007-04-30T07:54:23.996577', '9759', '1'), - ('0.99', '278', '2007-03-20T14:28:22.996577', '13896', '1'), - ('4.99', '213', '2007-02-20T04:19:06.996577', '2946', '2'), - ('2.99', '202', '2007-03-01T04:54:48.996577', '10375', '1'), - ('5.99', '454', '2007-02-17T13:23:55.996577', '2048', '2'), - ('3.99', '104', '2007-04-30T06:53:08.996577', '9090', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['29378', '30341', '28870', '20350', '20905', '25342', '24300', '23923', '26223', '28887', '21490', '29306', '27970', '29231', '20270', '21440', '23506', '25263', '19834', '29283', '24477', '24835', '27981', '28473', '31003', '28877', '18598', '22964', '25460', '28912', '28791', '18585', '24278', '18733', '25963', '25597', '27064', '29421', '20855', '25425', '17748', '20795', '21883', '27341', '28984', '31913', '25469', '25300', '17802', '21285', '20720', '22493', '27374', '18494', '22189', '30089', '19478', '28146', '25336', '22615', '23694', '22738', '23737', '23954', '28896', '28919', '26770', '21589', '29008', '29370', '24035', '27447', '31452', '28922', '27680', '24002', '27585', '19843', '27891', '29924', '22749', '17790', '27594', '25960', '22756', '19634', '29977', '25401', '30957', '29837', '22415', '21415', '29469', '23934', '27895', '28493', '20378', '18540', '23827', '29923']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('4.99', '35', '2007-04-11T21:13:00.996577', '6401', '1'), - ('3.99', '120', '2007-04-07T13:07:46.996577', '4272', '2'), - ('4.99', '595', '2007-04-30T00:10:14.996577', '9542', '2'), - ('2.99', '357', '2007-03-01T05:17:31.996577', '10391', '2'), - ('2.99', '413', '2007-03-19T18:02:23.996577', '13318', '1'), - ('4.99', '284', '2007-04-27T17:16:58.996577', '7463', '1'), - ('2.99', '168', '2007-03-22T13:27:56.996577', '15165', '1'), - ('0.99', '132', '2007-03-17T22:15:42.996577', '12133', '2'), - ('3.99', '360', '2007-04-10T23:44:05.996577', '5995', '1'), - ('0.99', '598', '2007-04-06T05:59:07.996577', '3648', '1'), - ('8.99', '472', '2007-03-19T12:55:29.996577', '13188', '2'), - ('4.99', '29', '2007-04-30T18:18:39.996577', '9392', '2'), - ('4.99', '517', '2007-04-07T18:30:04.996577', '4369', '1'), - ('2.99', '23', '2007-04-28T14:01:29.996577', '8015', '1'), - ('2.99', '348', '2007-03-18T13:40:01.996577', '12564', '2'), - ('4.99', '468', '2007-03-21T02:56:28.996577', '14210', '2'), - ('0.99', '85', '2007-03-20T08:53:38.996577', '13733', '2'), - ('4.99', '277', '2007-04-30T05:00:02.996577', '9669', '2'), - ('6.99', '299', '2007-03-17T02:55:50.996577', '11629', '1'), - ('0.99', '28', '2007-04-06T15:06:40.996577', '3845', '1'), - ('3.99', '186', '2007-03-22T18:04:47.996577', '15295', '2'), - ('0.99', '233', '2007-03-23T13:32:24.996577', '15821', '2'), - ('7.99', '518', '2007-04-07T00:48:10.996577', '4029', '2'), - ('5.99', '563', '2007-04-29T11:53:28.996577', '8610', '1'), - ('0.99', '177', '2007-04-08T13:16:33.996577', '4760', '1'), - ('4.99', '596', '2007-04-12T19:19:14.996577', '6883', '2'), - ('6.99', '26', '2007-02-18T15:53:31.996577', '2421', '2'), - ('4.99', '29', '2007-03-02T05:57:36.996577', '11079', '1'), - ('2.99', '293', '2007-04-30T08:07:41.996577', '9123', '2'), - ('2.99', '202', '2007-04-09T09:00:00.996577', '5194', '2'), - ('4.99', '590', '2007-04-12T00:57:06.996577', '6492', '2'), - ('4.99', '24', '2007-02-17T18:44:38.996577', '2116', '2'), - ('3.99', '167', '2007-03-01T02:03:37.996577', '10285', '2'), - ('4.99', '57', '2007-02-18T11:39:39.996577', '2360', '1'), - ('5.99', '337', '2007-04-06T04:44:01.996577', '3626', '1'), - ('4.99', '304', '2007-04-28T15:30:58.996577', '8055', '2'), - ('4.99', '435', '2007-04-11T02:15:07.996577', '6051', '2'), - ('4.99', '38', '2007-04-30T02:49:34.996577', '9621', '1'), - ('3.99', '408', '2007-03-20T09:20:11.996577', '13744', '2'), - ('2.99', '291', '2007-04-10T11:01:09.996577', '5754', '2'), - ('3.99', '403', '2007-02-18T20:06:52.996577', '2488', '2'), - ('7.99', '403', '2007-03-02T04:28:08.996577', '11038', '1'), - ('8.99', '516', '2007-03-19T16:22:08.996577', '13276', '1'), - ('5.99', '460', '2007-04-12T15:02:10.996577', '6788', '1'), - ('2.99', '208', '2007-04-10T08:04:09.996577', '5693', '2'), - ('0.99', '267', '2007-04-11T03:16:08.996577', '6070', '1'), - ('2.99', '294', '2007-04-30T23:23:37.996577', '9522', '1'), - ('0.99', '281', '2007-04-28T18:23:47.996577', '8131', '2'), - ('2.99', '419', '2007-02-19T17:21:03.996577', '2793', '2'), - ('2.99', '453', '2007-03-21T00:12:40.996577', '14133', '1'), - ('0.99', '394', '2007-03-01T12:59:01.996577', '10603', '1'), - ('0.99', '584', '2007-03-02T02:29:13.996577', '10966', '2'), - ('0.99', '463', '2007-04-09T20:39:40.996577', '5448', '1'), - ('0.99', '208', '2007-02-20T01:43:35.996577', '2907', '2'), - ('6.99', '550', '2007-03-21T08:15:01.996577', '14375', '2'), - ('4.99', '98', '2007-04-29T12:21:54.996577', '8622', '2'), - ('3.99', '260', '2007-02-16T06:18:13.996577', '1626', '1'), - ('2.99', '531', '2007-04-27T07:30:57.996577', '7204', '2'), - ('7.99', '284', '2007-04-08T13:07:48.996577', '4759', '1'), - ('7.99', '598', '2007-03-22T23:12:41.996577', '15443', '1'), - ('7.99', '109', '2007-03-22T21:39:15.996577', '15398', '2'), - ('0.99', '6', '2007-03-17T12:07:58.996577', '11853', '1'), - ('0.99', '114', '2007-03-23T00:33:23.996577', '15485', '1'), - ('0.99', '136', '2007-03-18T12:38:35.996577', '12539', '2'), - ('6.99', '598', '2007-04-27T07:26:06.996577', '7201', '2'), - ('0.99', '202', '2007-04-30T00:57:04.996577', '8930', '2'), - ('0.99', '408', '2007-04-09T03:31:01.996577', '5073', '2'), - ('3.99', '483', '2007-03-18T05:15:45.996577', '12331', '2'), - ('5.99', '2', '2007-04-27T13:51:28.996577', '7376', '1'), - ('2.99', '35', '2007-04-06T03:32:25.996577', '3597', '2'), - ('4.99', '143', '2007-03-20T12:34:59.996577', '13835', '2'), - ('6.99', '470', '2007-04-08T00:40:30.996577', '4502', '2'), - ('2.99', '226', '2007-04-09T13:29:49.996577', '5282', '1'), - ('4.99', '202', '2007-04-30T07:49:16.996577', '9751', '2'), - ('4.99', '490', '2007-04-10T05:53:12.996577', '5654', '1'), - ('10.99', '140', '2007-03-19T08:00:14.996577', '13053', '2'), - ('7.99', '482', '2007-04-11T23:13:43.996577', '6447', '2'), - ('2.99', '300', '2007-03-18T11:08:03.996577', '12484', '2'), - ('5.99', '508', '2007-04-30T05:41:42.996577', '9694', '2'), - ('9.99', '84', '2007-04-11T21:56:18.996577', '6415', '2'), - ('3.99', '7', '2007-03-02T03:09:20.996577', '10989', '2'), - ('5.99', '414', '2007-02-21T06:51:31.996577', '3318', '1'), - ('0.99', '483', '2007-04-27T05:09:07.996577', '7137', '2'), - ('8.99', '336', '2007-04-30T01:46:50.996577', '8951', '2'), - ('5.99', '7', '2007-03-21T03:18:14.996577', '14222', '1'), - ('0.99', '277', '2007-03-17T00:06:45.996577', '11574', '2'), - ('2.99', '89', '2007-04-09T19:59:37.996577', '5436', '2'), - ('0.99', '289', '2007-04-10T09:46:38.996577', '5724', '2'), - ('2.99', '172', '2007-04-30T07:52:44.996577', '9118', '1'), - ('0.99', '76', '2007-04-10T02:16:46.996577', '5571', '2'), - ('4.99', '575', '2007-03-02T19:52:28.996577', '11458', '1'), - ('4.99', '466', '2007-03-02T16:14:21.996577', '11359', '1'), - ('2.99', '42', '2007-04-12T15:20:39.996577', '6799', '1'), - ('3.99', '134', '2007-03-02T13:02:59.996577', '11280', '1'), - ('4.99', '509', '2007-04-07T13:03:16.996577', '4266', '2'), - ('5.99', '565', '2007-04-27T08:54:17.996577', '7242', '2'), - ('4.99', '360', '2007-03-19T05:49:05.996577', '12990', '1'), - ('5.99', '12', '2007-02-16T15:31:21.996577', '1752', '2'), - ('3.99', '123', '2007-03-18T07:56:00.996577', '12402', '1'), - ('2.99', '84', '2007-04-11T13:54:18.996577', '6259', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['21572', '19651', '29696', '24991', '27383', '18681', '31381', '28694', '26775', '20229', '19164', '19777', '19090', '23508', '21671', '32089', '21431', '27812', '30275', '20185', '23481', '20698', '20821', '23183', '30712', '27951', '26864', '27007', '24711', '28050', '17809', '26243', '26581', '29162', '25385', '28620', '23497', '18765', '31305', '29189', '20896', '27120', '30374', '22228', '21889', '30670', '27903', '25333', '19474', '23079', '27386', '18759', '18061', '18792', '24585', '25202', '28652', '25795', '19312', '21155', '22322', '26321', '24525', '19966', '17807', '19677', '31758', '25412', '25614', '26046', '24054', '27898', '19060', '31940', '27931', '18768', '24879', '26972', '31104', '25454', '21874', '26202', '29504', '22262', '20019', '27321', '27575', '24038', '22705', '19802', '27639', '26188', '29929', '23041', '25717', '28220', '18879', '21744', '22609', '30139']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('1.99', '481', '2007-03-20T17:57:49.996577', '13990', '1'), - ('0.99', '278', '2007-03-20T17:30:42.996577', '13976', '2'), - ('2.99', '64', '2007-04-09T13:15:02.996577', '5279', '2'), - ('4.99', '251', '2007-03-18T17:40:07.996577', '12666', '2'), - ('5.99', '464', '2007-04-07T17:05:03.996577', '4337', '1'), - ('4.99', '45', '2007-02-16T19:10:23.996577', '1806', '1'), - ('4.99', '219', '2007-04-30T06:41:37.996577', '9712', '1'), - ('2.99', '581', '2007-04-28T05:43:09.996577', '7783', '1'), - ('4.99', '408', '2007-04-28T13:29:15.996577', '7996', '2'), - ('4.99', '343', '2007-03-19T16:30:44.996577', '13279', '2'), - ('7.99', '174', '2007-02-16T01:41:46.996577', '1566', '2'), - ('8.99', '293', '2007-03-22T21:46:07.996577', '15402', '1'), - ('0.99', '151', '2007-02-20T14:25:27.996577', '3089', '2'), - ('4.99', '86', '2007-03-01T10:50:19.996577', '10536', '2'), - ('2.99', '493', '2007-03-23T15:02:57.996577', '15878', '2'), - ('0.00', '228', '2007-05-14T13:44:29.996577', '15234', '1'), - ('3.99', '467', '2007-03-22T00:33:04.996577', '14842', '1'), - ('2.99', '502', '2007-04-06T04:14:31.996577', '3614', '2'), - ('2.99', '114', '2007-04-06T19:06:28.996577', '3924', '1'), - ('3.99', '339', '2007-03-21T21:53:18.996577', '14758', '2'), - ('5.99', '83', '2007-03-16T23:56:31.996577', '11565', '1'), - ('0.99', '392', '2007-03-02T19:53:51.996577', '11459', '1'), - ('0.99', '405', '2007-03-17T19:23:51.996577', '12050', '1'), - ('0.99', '52', '2007-03-18T12:11:11.996577', '12520', '2'), - ('3.99', '151', '2007-04-12T14:16:17.996577', '6768', '2'), - ('0.99', '515', '2007-04-06T12:25:29.996577', '3782', '2'), - ('2.99', '416', '2007-04-29T13:24:47.996577', '8648', '2'), - ('6.99', '429', '2007-04-12T19:26:30.996577', '6886', '2'), - ('4.99', '217', '2007-03-19T01:24:02.996577', '12871', '1'), - ('6.99', '523', '2007-04-09T13:40:20.996577', '5287', '1'), - ('0.99', '422', '2007-02-16T22:31:10.996577', '1846', '1'), - ('4.99', '361', '2007-04-28T21:04:52.996577', '8189', '2'), - ('0.99', '391', '2007-04-08T12:47:07.996577', '4753', '2'), - ('2.99', '15', '2007-04-30T15:51:01.996577', '9987', '1'), - ('1.99', '287', '2007-04-30T06:52:19.996577', '9716', '2'), - ('4.99', '576', '2007-04-10T20:36:25.996577', '5934', '1'), - ('5.99', '84', '2007-03-21T06:57:46.996577', '14330', '1'), - ('0.99', '67', '2007-02-19T18:12:38.996577', '2810', '2'), - ('0.99', '211', '2007-04-27T17:56:43.996577', '7484', '2'), - ('4.99', '18', '2007-04-29T09:46:27.996577', '8555', '1'), - ('4.99', '412', '2007-03-22T19:47:25.996577', '15354', '2'), - ('2.99', '440', '2007-04-07T15:05:49.996577', '4301', '1'), - ('0.99', '122', '2007-04-28T20:12:20.996577', '8177', '2'), - ('2.99', '554', '2007-03-21T17:04:10.996577', '14626', '1'), - ('3.99', '517', '2007-03-17T04:55:41.996577', '11684', '1'), - ('0.99', '147', '2007-04-28T03:14:03.996577', '7723', '1'), - ('4.99', '509', '2007-04-30T22:53:26.996577', '10189', '1'), - ('2.99', '283', '2007-04-30T13:23:48.996577', '9918', '2'), - ('7.99', '259', '2007-02-16T07:14:52.996577', '1641', '1'), - ('2.99', '40', '2007-03-20T16:26:37.996577', '13951', '1'), - ('3.99', '464', '2007-04-12T06:13:15.996577', '6601', '2'), - ('2.99', '66', '2007-02-19T02:48:40.996577', '2571', '2'), - ('3.99', '484', '2007-02-16T07:24:01.996577', '1643', '2'), - ('0.99', '76', '2007-02-17T18:15:47.996577', '2111', '2'), - ('2.99', '198', '2007-03-17T16:48:10.996577', '11985', '2'), - ('3.99', '272', '2007-04-09T02:12:41.996577', '5047', '2'), - ('6.99', '578', '2007-04-30T17:06:13.996577', '10029', '1'), - ('6.99', '323', '2007-04-06T08:45:11.996577', '3704', '2'), - ('2.99', '214', '2007-02-19T22:37:24.996577', '2868', '2'), - ('2.99', '440', '2007-03-20T10:32:20.996577', '13779', '2'), - ('8.99', '564', '2007-03-22T08:50:26.996577', '15059', '2'), - ('0.99', '367', '2007-04-29T07:27:51.996577', '8490', '2'), - ('4.99', '192', '2007-03-21T00:41:57.996577', '14146', '2'), - ('6.99', '313', '2007-03-23T03:52:55.996577', '15569', '2'), - ('2.99', '421', '2007-02-18T15:19:07.996577', '2407', '2'), - ('4.99', '280', '2007-03-20T06:54:00.996577', '13667', '1'), - ('0.99', '252', '2007-04-28T01:12:51.996577', '7670', '1'), - ('5.99', '290', '2007-04-09T10:11:34.996577', '5214', '2'), - ('2.99', '306', '2007-04-12T18:38:43.996577', '6868', '2'), - ('6.99', '345', '2007-04-27T03:14:26.996577', '7092', '1'), - ('4.99', '145', '2007-03-01T20:31:57.996577', '10799', '2'), - ('5.99', '509', '2007-04-12T05:42:12.996577', '6591', '1'), - ('4.99', '145', '2007-02-18T04:58:18.996577', '2271', '2'), - ('2.99', '352', '2007-05-14T13:44:29.996577', '13578', '2'), - ('6.99', '512', '2007-04-28T03:01:04.996577', '7715', '1'), - ('8.99', '68', '2007-02-17T07:19:24.996577', '1957', '2'), - ('2.99', '238', '2007-03-17T13:52:32.996577', '11897', '1'), - ('0.99', '425', '2007-04-30T21:41:00.996577', '10163', '2'), - ('0.99', '185', '2007-04-29T06:01:33.996577', '8442', '2'), - ('6.99', '293', '2007-04-08T21:12:54.996577', '4944', '2'), - ('8.99', '515', '2007-03-18T11:11:16.996577', '12486', '1'), - ('2.99', '358', '2007-04-06T11:02:32.996577', '3753', '1'), - ('7.99', '45', '2007-04-09T18:40:15.996577', '5405', '1'), - ('3.99', '559', '2007-03-01T04:56:54.996577', '10377', '1'), - ('6.99', '321', '2007-03-20T05:18:12.996577', '13623', '2'), - ('3.99', '459', '2007-04-09T14:10:36.996577', '5301', '1'), - ('6.99', '481', '2007-04-28T23:56:10.996577', '8271', '2'), - ('0.99', '144', '2007-03-01T02:40:34.996577', '10302', '1'), - ('2.99', '3', '2007-03-20T04:42:38.996577', '13610', '2'), - ('2.99', '296', '2007-03-19T23:30:52.996577', '13471', '2'), - ('4.99', '486', '2007-04-27T04:42:14.996577', '7127', '2'), - ('3.99', '356', '2007-04-30T23:24:35.996577', '9523', '2'), - ('4.99', '84', '2007-04-30T05:10:12.996577', '9680', '2'), - ('3.99', '37', '2007-03-02T09:08:09.996577', '11176', '1'), - ('5.99', '315', '2007-04-29T05:21:20.996577', '8416', '1'), - ('4.99', '537', '2007-04-28T18:01:07.996577', '8126', '2'), - ('0.99', '96', '2007-02-21T06:27:02.996577', '3308', '1'), - ('0.99', '502', '2007-03-02T14:06:25.996577', '11301', '1'), - ('2.99', '597', '2007-03-22T17:26:05.996577', '15275', '2'), - ('5.99', '102', '2007-04-09T00:00:43.996577', '5009', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['25299', '26641', '24764', '25684', '31862', '26730', '26146', '25599', '28591', '27151', '28763', '21550', '24203', '18496', '23206', '27614', '31483', '23682', '30672', '18434', '24921', '22375', '30630', '27718', '19869', '17912', '29233', '27399', '21297', '18767', '29629', '29996', '22014', '20173', '28181', '20271', '17704', '31917', '30906', '29578', '28435', '21470', '28909', '27886', '19065', '27764', '23777', '24737', '27463', '27691', '21263', '18377', '28986', '27435', '26703', '27953', '28305', '29064', '30265', '24090', '21544', '28091', '18735', '21076', '19495', '17617', '23591', '26953', '25164', '23544', '30608', '30567', '23437', '29415', '31237', '30455', '18391', '25888', '29853', '20841', '31441', '29744', '19999', '21593', '28755', '19147', '20227', '27643', '19018', '31185', '21262', '28377', '23150', '18808', '27249', '27122', '22735', '28651', '22819', '31357']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('3.99', '281', '2007-04-27T19:41:54.996577', '7525', '1'), - ('6.99', '396', '2007-04-30T23:03:08.996577', '10195', '2'), - ('0.99', '224', '2007-03-20T22:59:29.996577', '14099', '2'), - ('4.99', '312', '2007-04-29T16:24:47.996577', '8721', '1'), - ('6.99', '262', '2007-04-12T15:51:27.996577', '6805', '1'), - ('0.99', '405', '2007-04-07T19:54:53.996577', '4401', '2'), - ('2.99', '353', '2007-04-30T18:18:01.996577', '10071', '2'), - ('6.99', '304', '2007-04-30T15:58:14.996577', '9992', '1'), - ('7.99', '574', '2007-04-06T02:39:09.996577', '3583', '1'), - ('5.99', '442', '2007-04-07T02:06:48.996577', '4052', '1'), - ('2.99', '588', '2007-04-09T09:22:25.996577', '5203', '2'), - ('1.99', '479', '2007-03-17T00:41:52.996577', '11584', '2'), - ('0.99', '158', '2007-03-02T12:48:53.996577', '11272', '1'), - ('0.99', '1', '2007-02-15T16:31:19.996577', '1422', '2'), - ('4.99', '54', '2007-03-18T23:19:54.996577', '12811', '1'), - ('0.99', '485', '2007-04-06T02:16:13.996577', '3579', '2'), - ('8.99', '228', '2007-04-27T19:05:45.996577', '7509', '2'), - ('6.99', '108', '2007-03-02T19:02:01.996577', '11445', '2'), - ('0.99', '147', '2007-04-30T08:24:33.996577', '9772', '2'), - ('2.99', '590', '2007-02-18T11:08:41.996577', '2352', '2'), - ('7.99', '242', '2007-03-18T20:05:46.996577', '12724', '2'), - ('0.99', '569', '2007-03-23T05:35:48.996577', '15617', '2'), - ('0.99', '144', '2007-04-28T07:12:15.996577', '7830', '1'), - ('5.99', '494', '2007-04-07T19:43:20.996577', '4397', '2'), - ('4.99', '303', '2007-03-02T12:11:10.996577', '11253', '1'), - ('2.99', '449', '2007-02-20T06:20:17.996577', '2970', '2'), - ('5.99', '23', '2007-04-30T11:24:02.996577', '9209', '2'), - ('4.99', '467', '2007-04-07T10:48:47.996577', '4222', '2'), - ('0.99', '454', '2007-03-21T23:13:23.996577', '14799', '1'), - ('5.99', '68', '2007-02-16T20:33:00.996577', '1828', '2'), - ('4.99', '57', '2007-04-12T09:19:35.996577', '6649', '2'), - ('5.99', '90', '2007-04-27T15:50:18.996577', '7428', '1'), - ('10.99', '531', '2007-03-02T12:34:08.996577', '11265', '1'), - ('0.99', '338', '2007-03-22T10:29:59.996577', '15105', '2'), - ('2.99', '534', '2007-04-06T10:10:30.996577', '3735', '1'), - ('5.99', '348', '2007-03-19T02:02:30.996577', '12884', '2'), - ('5.99', '390', '2007-02-15T23:39:51.996577', '1539', '2'), - ('7.98', '267', '2007-05-14T13:44:29.996577', '12066', '2'), - ('1.99', '168', '2007-04-29T03:20:27.996577', '8352', '2'), - ('0.99', '51', '2007-04-30T04:15:20.996577', '9649', '2'), - ('4.99', '560', '2007-04-11T21:36:32.996577', '6410', '1'), - ('10.99', '470', '2007-03-18T21:06:05.996577', '12753', '1'), - ('8.99', '202', '2007-04-06T15:53:15.996577', '3861', '1'), - ('3.99', '508', '2007-04-27T12:05:52.996577', '7322', '2'), - ('3.99', '146', '2007-02-18T03:00:54.996577', '2242', '1'), - ('4.99', '497', '2007-04-30T11:15:18.996577', '9850', '2'), - ('4.99', '119', '2007-03-01T15:59:01.996577', '10681', '1'), - ('2.99', '220', '2007-03-19T16:36:13.996577', '13281', '1'), - ('8.99', '471', '2007-04-11T17:58:39.996577', '6336', '1'), - ('4.99', '491', '2007-04-10T18:23:07.996577', '5889', '1'), - ('2.99', '451', '2007-03-18T06:31:12.996577', '12371', '2'), - ('0.99', '574', '2007-02-19T07:20:13.996577', '2632', '1'), - ('1.99', '208', '2007-04-12T14:15:21.996577', '6767', '1'), - ('3.99', '469', '2007-04-26T22:24:14.996577', '6955', '1'), - ('6.99', '403', '2007-04-06T05:48:37.996577', '3644', '1'), - ('0.99', '515', '2007-04-09T10:23:24.996577', '5216', '2'), - ('6.99', '267', '2007-04-30T15:21:47.996577', '9308', '1'), - ('5.99', '7', '2007-04-08T14:44:30.996577', '4787', '2'), - ('2.99', '113', '2007-04-09T15:02:44.996577', '5324', '2'), - ('8.99', '147', '2007-03-23T10:01:01.996577', '15730', '1'), - ('4.99', '478', '2007-03-20T00:38:53.996577', '13507', '2'), - ('4.99', '526', '2007-04-28T15:28:07.996577', '8053', '1'), - ('0.99', '57', '2007-02-21T10:24:08.996577', '3357', '1'), - ('4.99', '432', '2007-03-23T02:01:02.996577', '15523', '1'), - ('1.99', '262', '2007-02-20T02:25:43.996577', '2915', '1'), - ('6.99', '370', '2007-02-14T23:33:58.996577', '1190', '2'), - ('0.99', '95', '2007-03-01T07:30:43.996577', '10446', '2'), - ('8.99', '424', '2007-04-30T23:09:24.996577', '9516', '1'), - ('4.99', '267', '2007-04-30T17:37:22.996577', '10048', '2'), - ('4.99', '90', '2007-03-01T21:57:15.996577', '10835', '1'), - ('7.99', '142', '2007-04-30T03:59:53.996577', '9020', '1'), - ('0.99', '138', '2007-04-30T02:45:28.996577', '9619', '1'), - ('2.99', '78', '2007-03-21T16:39:09.996577', '14620', '2'), - ('5.99', '38', '2007-04-27T06:04:37.996577', '7163', '2'), - ('4.99', '199', '2007-04-12T14:51:51.996577', '6782', '2'), - ('0.99', '129', '2007-04-09T05:54:13.996577', '5127', '1'), - ('6.99', '577', '2007-02-21T14:21:09.996577', '3401', '2'), - ('1.99', '331', '2007-04-10T18:02:16.996577', '5885', '1'), - ('4.99', '78', '2007-04-06T03:08:18.996577', '3593', '1'), - ('0.99', '407', '2007-03-17T04:34:52.996577', '11677', '1'), - ('3.99', '225', '2007-04-12T02:49:46.996577', '6526', '1'), - ('3.99', '68', '2007-04-08T20:24:26.996577', '4925', '1'), - ('2.99', '317', '2007-03-22T14:59:09.996577', '15204', '1'), - ('0.99', '484', '2007-03-17T18:26:00.996577', '12024', '1'), - ('8.99', '587', '2007-04-27T18:45:25.996577', '7501', '1'), - ('0.99', '170', '2007-02-17T18:52:26.996577', '2117', '2'), - ('0.99', '343', '2007-03-02T10:46:55.996577', '11212', '1'), - ('2.99', '486', '2007-04-30T18:34:11.996577', '10079', '1'), - ('7.99', '133', '2007-02-19T09:41:01.996577', '2665', '2'), - ('0.99', '195', '2007-04-10T00:58:08.996577', '5536', '1'), - ('2.99', '451', '2007-03-17T09:28:34.996577', '11790', '1'), - ('2.99', '554', '2007-04-10T00:34:27.996577', '5527', '1'), - ('5.99', '49', '2007-03-21T01:28:29.996577', '14168', '2'), - ('3.99', '80', '2007-02-21T11:36:47.996577', '3367', '1'), - ('4.99', '451', '2007-04-08T20:44:14.996577', '4930', '2'), - ('2.99', '440', '2007-04-09T19:25:14.996577', '5423', '2'), - ('3.99', '6', '2007-03-02T17:23:41.996577', '11398', '1'), - ('4.99', '578', '2007-04-30T15:06:50.996577', '9970', '2'), - ('7.99', '15', '2007-03-17T14:49:03.996577', '11922', '1'), - ('6.99', '217', '2007-04-30T03:30:49.996577', '9632', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['32068', '28997', '31422', '27591', '26285', '21681', '31327', '22804', '20365', '31894', '23742', '19547', '30737', '24849', '23499', '31552', '23438', '22595', '22302', '31045', '30748', '20944', '21545', '26705', '31528', '29267', '21751', '25415', '22376', '24470', '29976', '19195', '21449', '23384', '20981', '20568', '25144', '30556', '26801', '28481', '18063', '32029', '29637', '23282', '24521', '29544', '25378', '30963', '19505', '19045', '30651', '19524', '29293', '22866', '22812', '28847', '29669', '19369', '24243', '31560', '18049', '19923', '27578', '30525', '29643', '18405', '24212', '23058', '26451', '28089', '28532', '18078', '31297', '29584', '19575', '27623', '22959', '22631', '31998', '18505', '24298', '19137', '24785', '20563', '25838', '25407', '27205', '24055', '24008', '21996', '25802', '27335', '26675', '23687', '18744', '18171', '20273', '31289', '30711', '22193']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('4.99', '180', '2007-05-14T13:44:29.996577', '12901', '1'), - ('7.99', '1', '2007-04-11T08:42:12.996577', '6163', '1'), - ('3.99', '223', '2007-04-29T03:37:37.996577', '8362', '2'), - ('4.99', '483', '2007-04-10T14:48:18.996577', '5823', '1'), - ('4.99', '365', '2007-04-12T06:26:11.996577', '6604', '1'), - ('9.99', '494', '2007-03-22T12:57:37.996577', '15156', '2'), - ('2.99', '213', '2007-04-30T16:35:42.996577', '9340', '2'), - ('7.99', '13', '2007-03-21T14:12:49.996577', '14545', '2'), - ('2.99', '359', '2007-03-19T17:14:15.996577', '13297', '2'), - ('4.99', '265', '2007-04-09T19:02:35.996577', '5417', '1'), - ('2.99', '115', '2007-03-01T14:37:12.996577', '10647', '2'), - ('6.99', '269', '2007-03-21T19:12:45.996577', '14693', '2'), - ('0.99', '154', '2007-04-06T18:38:29.996577', '3912', '2'), - ('2.99', '235', '2007-03-18T05:19:31.996577', '12332', '2'), - ('2.99', '84', '2007-03-22T16:45:16.996577', '15255', '1'), - ('0.99', '234', '2007-04-08T09:22:05.996577', '4686', '2'), - ('0.99', '78', '2007-03-21T19:58:21.996577', '14716', '1'), - ('4.99', '596', '2007-03-20T06:16:36.996577', '13648', '1'), - ('0.99', '563', '2007-03-17T11:20:30.996577', '11829', '2'), - ('0.99', '180', '2007-04-10T11:59:35.996577', '5773', '2'), - ('7.99', '154', '2007-04-29T02:46:51.996577', '8334', '2'), - ('6.99', '417', '2007-03-02T13:26:24.996577', '11291', '1'), - ('4.99', '478', '2007-03-22T07:31:30.996577', '15027', '1'), - ('4.99', '403', '2007-04-07T04:37:37.996577', '4096', '2'), - ('4.99', '232', '2007-04-28T00:26:56.996577', '7653', '2'), - ('2.99', '26', '2007-04-11T13:21:51.996577', '6243', '2'), - ('3.99', '502', '2007-03-23T00:33:46.996577', '15486', '1'), - ('4.99', '290', '2007-04-26T22:19:53.996577', '6952', '1'), - ('4.99', '569', '2007-03-23T20:17:20.996577', '16025', '2'), - ('4.99', '186', '2007-03-20T01:01:43.996577', '13517', '2'), - ('7.99', '89', '2007-04-09T06:38:19.996577', '5144', '2'), - ('2.99', '181', '2007-02-16T07:01:02.996577', '1638', '1'), - ('4.99', '469', '2007-03-01T03:03:23.996577', '10316', '1'), - ('3.99', '73', '2007-03-17T02:09:37.996577', '11609', '2'), - ('4.99', '419', '2007-03-23T12:02:12.996577', '15779', '2'), - ('0.99', '379', '2007-03-19T23:48:40.996577', '13485', '1'), - ('2.99', '265', '2007-03-22T04:28:25.996577', '14943', '1'), - ('0.99', '138', '2007-04-09T17:34:22.996577', '5378', '1'), - ('2.99', '410', '2007-04-09T15:29:34.996577', '5336', '1'), - ('0.99', '564', '2007-04-29T22:43:11.996577', '8874', '1'), - ('5.99', '484', '2007-02-17T13:06:23.996577', '2044', '1'), - ('7.98', '53', '2007-05-14T13:44:29.996577', '11657', '2'), - ('4.99', '58', '2007-04-06T07:59:11.996577', '3685', '1'), - ('4.99', '62', '2007-03-21T23:48:45.996577', '14821', '2'), - ('7.99', '192', '2007-03-01T22:11:29.996577', '10843', '1'), - ('4.99', '49', '2007-04-27T07:45:19.996577', '7209', '2'), - ('3.99', '287', '2007-04-10T03:01:39.996577', '5593', '1'), - ('2.99', '173', '2007-04-09T22:30:32.996577', '5488', '1'), - ('5.99', '266', '2007-02-15T06:44:32.996577', '1280', '2'), - ('7.99', '141', '2007-02-20T00:54:57.996577', '2895', '2'), - ('2.99', '145', '2007-04-30T09:33:21.996577', '9156', '1'), - ('9.99', '267', '2007-03-19T14:46:50.996577', '13236', '2'), - ('2.99', '28', '2007-04-30T00:13:17.996577', '9544', '2'), - ('1.99', '20', '2007-03-02T01:58:50.996577', '10954', '1'), - ('6.99', '14', '2007-03-22T07:12:16.996577', '15015', '2'), - ('8.99', '594', '2007-04-27T19:52:59.996577', '7533', '1'), - ('3.99', '61', '2007-04-29T13:30:44.996577', '8651', '1'), - ('2.99', '233', '2007-02-17T09:27:19.996577', '1992', '2'), - ('5.99', '161', '2007-03-22T08:21:49.996577', '15045', '2'), - ('2.99', '235', '2007-04-11T01:55:27.996577', '6047', '1'), - ('0.99', '480', '2007-02-15T11:42:02.996577', '1353', '1'), - ('2.99', '308', '2007-03-20T12:58:27.996577', '13843', '1'), - ('2.99', '482', '2007-04-06T06:02:41.996577', '3650', '2'), - ('0.99', '135', '2007-04-28T03:37:10.996577', '7734', '1'), - ('2.99', '58', '2007-04-30T00:50:39.996577', '9561', '2'), - ('3.99', '583', '2007-02-15T16:47:56.996577', '1428', '1'), - ('5.99', '158', '2007-03-23T12:40:48.996577', '15796', '1'), - ('4.99', '38', '2007-03-21T14:31:27.996577', '14554', '1'), - ('2.99', '378', '2007-04-30T11:48:34.996577', '9868', '1'), - ('5.99', '526', '2007-04-27T20:12:54.996577', '7543', '2'), - ('0.99', '568', '2007-04-30T07:32:40.996577', '9738', '1'), - ('2.99', '491', '2007-02-15T00:17:24.996577', '1198', '2'), - ('2.99', '211', '2007-04-07T23:21:01.996577', '4479', '2'), - ('0.99', '52', '2007-04-27T10:40:30.996577', '7284', '2'), - ('8.99', '273', '2007-03-01T01:43:00.996577', '10272', '1'), - ('4.99', '485', '2007-04-12T16:22:45.996577', '6810', '2'), - ('2.99', '28', '2007-03-21T14:02:49.996577', '14540', '2'), - ('4.99', '202', '2007-03-23T11:51:22.996577', '15772', '2'), - ('2.99', '568', '2007-05-14T13:44:29.996577', '14531', '2'), - ('6.99', '3', '2007-02-17T03:43:41.996577', '1911', '2'), - ('2.99', '168', '2007-03-20T22:39:42.996577', '14090', '1'), - ('2.99', '166', '2007-02-15T15:38:14.996577', '1412', '2'), - ('5.99', '226', '2007-03-23T20:34:41.996577', '16033', '1'), - ('2.99', '378', '2007-03-22T05:21:15.996577', '14971', '1'), - ('4.99', '326', '2007-04-28T10:52:07.996577', '7931', '2'), - ('2.99', '289', '2007-04-30T22:25:21.996577', '9498', '1'), - ('4.99', '446', '2007-04-29T14:17:29.996577', '8670', '2'), - ('5.99', '145', '2007-03-17T14:07:52.996577', '11904', '2'), - ('2.99', '141', '2007-03-02T17:58:13.996577', '11411', '1'), - ('3.99', '529', '2007-03-19T10:39:23.996577', '13132', '2'), - ('5.99', '323', '2007-04-28T02:09:39.996577', '7695', '2'), - ('4.99', '459', '2007-04-30T07:44:04.996577', '9744', '1'), - ('2.99', '400', '2007-04-26T23:36:52.996577', '6994', '2'), - ('3.99', '108', '2007-03-21T17:20:09.996577', '14635', '2'), - ('6.99', '62', '2007-02-15T03:28:09.996577', '1241', '2'), - ('0.99', '515', '2007-02-18T22:21:41.996577', '2513', '2'), - ('2.99', '348', '2007-03-19T14:49:22.996577', '13238', '2'), - ('5.99', '210', '2007-04-28T04:04:39.996577', '7743', '1'), - ('0.99', '151', '2007-04-12T12:09:42.996577', '6720', '2'), - ('4.99', '550', '2007-03-23T18:35:36.996577', '15977', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['27252', '25156', '18004', '24242', '18717', '18632', '31438', '22614', '25251', '19442', '29718', '22048', '20096', '20838', '26712', '26208', '17648', '29224', '21340', '22651', '29684', '19768', '31535', '24360', '22131', '23120', '18206', '31904', '30565', '30867', '18629', '29940', '19036', '20180', '31731', '26139', '29936', '21833', '19535', '32062', '20016', '29995', '26691', '21749', '18556', '17958', '27010', '18549', '26671', '31953', '25427', '28932', '17515', '28657', '28544', '28616', '20354', '28459', '27396', '30227', '25310', '24904', '25997', '30886', '30150', '30974', '18875', '18975', '29073', '29243', '30528', '27458', '21922', '22958', '20901', '18022', '20602', '24296', '30560', '24113', '29232', '30969', '24674', '18383', '25771', '19848', '25292', '24563', '19450', '24619', '21352', '31064', '20160', '30618', '22017', '30289', '21101', '23989', '30850', '22164']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('2.99', '451', '2007-04-27T00:48:48.996577', '7018', '1'), - ('6.99', '266', '2007-03-20T02:38:52.996577', '13556', '1'), - ('2.99', '468', '2007-02-17T08:00:36.996577', '1975', '1'), - ('0.99', '161', '2007-03-22T06:23:24.996577', '15000', '1'), - ('0.99', '53', '2007-02-21T01:29:36.996577', '3244', '2'), - ('4.99', '31', '2007-02-19T08:34:46.996577', '2648', '2'), - ('2.99', '225', '2007-04-11T08:24:00.996577', '6159', '1'), - ('2.99', '598', '2007-03-22T18:22:52.996577', '15307', '2'), - ('8.99', '276', '2007-04-30T12:06:43.996577', '9229', '1'), - ('7.99', '251', '2007-02-21T15:53:06.996577', '3422', '2'), - ('3.99', '65', '2007-04-30T14:40:54.996577', '9293', '1'), - ('5.99', '534', '2007-03-18T18:36:12.996577', '12691', '1'), - ('2.99', '330', '2007-03-17T19:53:13.996577', '12062', '1'), - ('2.99', '407', '2007-03-02T11:00:54.996577', '11222', '1'), - ('7.99', '403', '2007-04-30T22:04:08.996577', '9486', '2'), - ('0.99', '358', '2007-04-30T01:06:10.996577', '9568', '1'), - ('8.99', '379', '2007-02-15T13:48:32.996577', '1383', '1'), - ('3.99', '23', '2007-04-06T10:12:10.996577', '3736', '2'), - ('7.99', '459', '2007-03-01T09:28:46.996577', '10499', '1'), - ('2.99', '205', '2007-03-20T15:49:15.996577', '13935', '1'), - ('0.99', '63', '2007-04-30T03:37:58.996577', '9007', '2'), - ('2.99', '292', '2007-03-22T11:06:46.996577', '15117', '1'), - ('0.99', '232', '2007-04-30T13:31:42.996577', '9270', '2'), - ('0.99', '175', '2007-03-18T11:50:18.996577', '12509', '1'), - ('1.99', '543', '2007-03-23T12:14:53.996577', '15785', '1'), - ('7.99', '45', '2007-03-23T20:41:30.996577', '16037', '2'), - ('4.99', '526', '2007-02-15T04:42:11.996577', '1255', '1'), - ('0.99', '265', '2007-04-29T14:07:55.996577', '8665', '2'), - ('3.99', '138', '2007-04-29T05:34:29.996577', '8424', '1'), - ('7.99', '165', '2007-04-30T10:35:24.996577', '9182', '2'), - ('7.99', '31', '2007-02-18T14:18:14.996577', '2396', '1'), - ('2.99', '86', '2007-04-07T11:34:18.996577', '4235', '1'), - ('2.99', '139', '2007-02-14T22:11:22.996577', '1169', '2'), - ('0.99', '339', '2007-03-18T16:21:17.996577', '12631', '1'), - ('2.99', '249', '2007-04-28T06:24:26.996577', '7804', '1'), - ('5.99', '352', '2007-04-28T07:46:33.996577', '7845', '1'), - ('4.99', '85', '2007-04-30T14:32:21.996577', '9957', '2'), - ('8.99', '512', '2007-03-19T04:41:10.996577', '12957', '2'), - ('4.99', '268', '2007-03-21T04:06:31.996577', '14249', '2'), - ('7.98', '163', '2007-05-14T13:44:29.996577', '11754', '2'), - ('6.99', '321', '2007-03-17T18:43:00.996577', '12033', '1'), - ('1.99', '90', '2007-04-27T02:19:12.996577', '7058', '2'), - ('6.99', '402', '2007-04-06T01:30:39.996577', '3564', '2'), - ('9.99', '502', '2007-03-19T08:00:08.996577', '13052', '1'), - ('7.99', '16', '2007-02-20T05:38:35.996577', '2960', '1'), - ('4.99', '457', '2007-02-15T18:05:05.996577', '1453', '2'), - ('1.99', '429', '2007-04-28T18:34:14.996577', '8136', '2'), - ('8.99', '13', '2007-02-20T11:13:59.996577', '3047', '1'), - ('2.99', '400', '2007-04-08T07:48:35.996577', '4645', '1'), - ('0.99', '405', '2007-05-14T13:44:29.996577', '12792', '1'), - ('2.99', '291', '2007-04-12T15:12:42.996577', '6796', '1'), - ('0.99', '204', '2007-04-09T06:41:51.996577', '5145', '2'), - ('0.99', '343', '2007-02-17T04:32:51.996577', '1922', '2'), - ('1.99', '579', '2007-04-12T16:40:24.996577', '6814', '2'), - ('4.99', '570', '2007-04-10T05:01:15.996577', '5638', '2'), - ('0.99', '576', '2007-04-06T17:24:51.996577', '3889', '2'), - ('2.99', '357', '2007-03-02T05:26:21.996577', '11065', '2'), - ('0.99', '562', '2007-04-28T18:25:57.996577', '8132', '2'), - ('3.99', '466', '2007-04-30T11:11:50.996577', '9202', '1'), - ('4.99', '109', '2007-04-08T20:11:47.996577', '4921', '1'), - ('3.99', '282', '2007-04-27T19:54:43.996577', '7534', '2'), - ('1.99', '241', '2007-03-02T18:25:39.996577', '11423', '1'), - ('4.99', '339', '2007-04-30T04:39:14.996577', '9663', '1'), - ('0.99', '167', '2007-04-09T08:55:14.996577', '5191', '1'), - ('2.99', '102', '2007-04-30T10:54:52.996577', '9192', '1'), - ('4.99', '174', '2007-04-09T18:58:02.996577', '5414', '2'), - ('7.99', '96', '2007-02-15T15:53:33.996577', '1413', '2'), - ('7.99', '122', '2007-02-15T17:24:00.996577', '1442', '2'), - ('5.99', '8', '2007-04-05T21:29:47.996577', '3475', '1'), - ('4.99', '24', '2007-04-30T01:44:03.996577', '8947', '1'), - ('6.99', '135', '2007-04-30T03:06:02.996577', '8987', '1'), - ('2.99', '470', '2007-04-30T05:21:20.996577', '9687', '1'), - ('2.99', '520', '2007-03-23T00:42:12.996577', '15492', '2'), - ('4.99', '28', '2007-03-20T10:39:29.996577', '13783', '2'), - ('0.99', '413', '2007-03-02T20:15:52.996577', '11468', '1'), - ('0.99', '472', '2007-02-21T01:55:36.996577', '3254', '1'), - ('3.99', '382', '2007-03-01T03:24:01.996577', '10327', '2'), - ('4.99', '168', '2007-03-20T01:57:54.996577', '13532', '2'), - ('0.99', '138', '2007-04-12T19:38:30.996577', '6892', '1'), - ('4.99', '149', '2007-03-17T17:18:10.996577', '12000', '1'), - ('0.99', '23', '2007-04-29T16:09:40.996577', '8718', '2'), - ('4.99', '173', '2007-04-29T20:07:33.996577', '8808', '2'), - ('2.99', '214', '2007-03-02T19:14:20.996577', '11450', '2'), - ('2.99', '576', '2007-02-16T15:06:14.996577', '1742', '2'), - ('4.99', '320', '2007-04-29T19:28:04.996577', '8794', '2'), - ('5.99', '300', '2007-03-20T08:19:18.996577', '13717', '1'), - ('0.99', '280', '2007-04-29T23:59:51.996577', '8912', '1'), - ('0.99', '197', '2007-03-01T15:25:02.996577', '10666', '2'), - ('4.99', '253', '2007-02-17T20:24:09.996577', '2142', '1'), - ('2.99', '201', '2007-03-23T15:22:35.996577', '15887', '1'), - ('2.99', '460', '2007-03-16T23:33:43.996577', '11554', '2'), - ('2.99', '182', '2007-04-05T22:53:23.996577', '3509', '1'), - ('4.99', '337', '2007-03-20T07:06:50.996577', '13678', '1'), - ('1.99', '143', '2007-04-30T12:31:16.996577', '9889', '2'), - ('8.99', '531', '2007-03-19T17:15:22.996577', '13300', '2'), - ('0.99', '115', '2007-04-06T00:34:58.996577', '3544', '2'), - ('0.99', '435', '2007-03-17T19:16:12.996577', '12046', '2'), - ('3.99', '139', '2007-03-19T20:44:42.996577', '13401', '2'), - ('2.99', '164', '2007-04-12T03:44:33.996577', '6558', '2'), - ('0.99', '547', '2007-03-18T14:16:15.996577', '12579', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['24573', '21990', '26341', '18763', '23091', '19373', '24706', '27254', '24091', '20797', '26136', '22685', '31650', '18504', '27710', '20379', '31426', '29443', '22092', '30880', '32006', '26783', '22104', '22681', '21174', '27896', '23725', '29317', '21842', '24713', '23515', '27531', '25506', '24790', '17974', '18328', '24651', '19598', '19593', '18968', '27192', '20902', '28722', '22298', '26026', '18634', '24218', '28323', '25955', '22249', '23014', '29911', '20384', '24421', '30759', '18538', '21538', '22408', '25793', '18355', '23044', '29856', '29254', '19345', '32096', '29152', '28028', '28104', '26090', '30506', '25580', '17970', '17817', '27739', '20454', '23594', '26028', '22043', '22334', '28768', '18322', '24738', '28127', '26833', '20628', '17775', '18612', '21612', '27394', '20914', '19499', '30367', '26186', '22291', '22267', '21921', '19327', '17536', '29816', '25012']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('9.99', '197', '2007-03-20T21:19:51.996577', '14069', '1'), - ('6.99', '528', '2007-03-23T15:12:20.996577', '15880', '2'), - ('7.99', '369', '2007-04-09T22:48:49.996577', '5496', '2'), - ('3.99', '67', '2007-02-17T14:26:22.996577', '2064', '1'), - ('5.99', '42', '2007-03-02T01:23:19.996577', '10935', '1'), - ('3.99', '234', '2007-02-15T03:37:27.996577', '1245', '2'), - ('6.99', '217', '2007-03-01T21:58:24.996577', '10836', '1'), - ('2.99', '452', '2007-04-06T12:53:22.996577', '3791', '1'), - ('6.99', '147', '2007-03-23T19:21:46.996577', '16004', '2'), - ('2.99', '403', '2007-03-02T18:31:05.996577', '11427', '2'), - ('7.99', '352', '2007-04-27T15:32:41.996577', '7419', '1'), - ('0.99', '1', '2007-03-19T08:23:42.996577', '13068', '2'), - ('6.99', '241', '2007-04-30T22:27:02.996577', '9500', '1'), - ('6.99', '3', '2007-02-16T13:47:36.996577', '1726', '1'), - ('2.99', '493', '2007-04-27T01:17:24.996577', '7026', '1'), - ('7.99', '360', '2007-03-20T14:23:46.996577', '13894', '2'), - ('2.99', '224', '2007-04-08T09:47:40.996577', '4697', '1'), - ('0.99', '40', '2007-04-28T14:44:15.996577', '8031', '2'), - ('2.99', '539', '2007-03-19T00:33:37.996577', '12848', '1'), - ('5.99', '166', '2007-04-28T15:25:57.996577', '8052', '1'), - ('2.99', '590', '2007-05-14T13:44:29.996577', '15458', '2'), - ('3.99', '409', '2007-04-09T08:02:54.996577', '5175', '1'), - ('2.99', '540', '2007-03-22T09:38:22.996577', '15079', '2'), - ('3.99', '1', '2007-03-02T14:05:18.996577', '11299', '2'), - ('0.99', '442', '2007-03-21T11:31:39.996577', '14466', '1'), - ('2.99', '509', '2007-04-08T16:35:31.996577', '4832', '2'), - ('5.99', '113', '2007-03-17T12:40:11.996577', '11872', '1'), - ('2.99', '30', '2007-04-27T14:31:34.996577', '7394', '2'), - ('4.99', '512', '2007-03-23T18:53:37.996577', '15990', '2'), - ('2.99', '217', '2007-03-22T17:31:14.996577', '15277', '2'), - ('2.99', '86', '2007-03-20T13:40:14.996577', '13874', '1'), - ('6.99', '477', '2007-04-29T08:23:46.996577', '8515', '1'), - ('5.99', '297', '2007-04-08T20:34:44.996577', '4929', '1'), - ('4.99', '227', '2007-03-23T18:35:34.996577', '15976', '2'), - ('0.99', '459', '2007-02-20T11:10:26.996577', '3045', '2'), - ('4.99', '561', '2007-02-20T04:37:02.996577', '2950', '1'), - ('2.99', '211', '2007-03-20T15:59:18.996577', '13942', '2'), - ('7.99', '274', '2007-03-21T01:26:28.996577', '14164', '2'), - ('2.99', '274', '2007-03-19T09:34:17.996577', '13103', '1'), - ('2.99', '120', '2007-02-17T05:23:07.996577', '1932', '2'), - ('0.99', '445', '2007-04-30T16:23:24.996577', '10007', '1'), - ('0.99', '413', '2007-03-16T23:02:40.996577', '11532', '1'), - ('0.99', '584', '2007-04-08T22:44:16.996577', '4977', '1'), - ('0.99', '562', '2007-03-20T05:50:33.996577', '13639', '2'), - ('5.99', '343', '2007-04-06T21:32:59.996577', '3978', '1'), - ('1.99', '31', '2007-02-20T20:47:51.996577', '3172', '2'), - ('0.99', '159', '2007-03-22T14:42:51.996577', '15197', '1'), - ('2.99', '549', '2007-04-05T23:30:04.996577', '3523', '2'), - ('4.99', '336', '2007-04-11T14:02:16.996577', '6263', '2'), - ('2.99', '557', '2007-03-20T02:09:49.996577', '13540', '1'), - ('2.99', '34', '2007-03-18T03:26:25.996577', '12286', '2'), - ('0.99', '83', '2007-04-09T10:25:38.996577', '5218', '1'), - ('5.99', '361', '2007-03-02T04:21:24.996577', '11031', '2'), - ('6.99', '181', '2007-03-01T04:23:39.996577', '10362', '2'), - ('0.99', '155', '2007-04-30T19:09:43.996577', '10098', '1'), - ('7.99', '11', '2007-02-17T05:55:11.996577', '1939', '1'), - ('0.99', '477', '2007-03-19T06:06:24.996577', '13002', '1'), - ('4.99', '574', '2007-03-20T04:15:51.996577', '13589', '1'), - ('4.99', '322', '2007-04-30T07:42:21.996577', '9115', '1'), - ('4.99', '570', '2007-02-15T16:14:17.996577', '1417', '2'), - ('0.99', '37', '2007-03-19T22:28:50.996577', '13444', '2'), - ('0.99', '78', '2007-04-08T14:20:17.996577', '4778', '2'), - ('8.99', '25', '2007-04-30T08:40:27.996577', '9140', '1'), - ('7.99', '225', '2007-02-18T02:08:22.996577', '2226', '2'), - ('4.99', '252', '2007-05-14T13:44:29.996577', '13756', '2'), - ('4.99', '14', '2007-04-30T20:04:41.996577', '9438', '2'), - ('1.99', '521', '2007-04-30T13:56:36.996577', '9937', '2'), - ('0.99', '527', '2007-04-29T22:08:33.996577', '8854', '1'), - ('4.99', '348', '2007-04-09T15:56:44.996577', '5345', '1'), - ('6.99', '133', '2007-04-29T04:18:35.996577', '8389', '2'), - ('4.99', '303', '2007-04-11T11:47:03.996577', '6219', '2'), - ('2.99', '459', '2007-02-17T08:06:48.996577', '1977', '2'), - ('8.99', '423', '2007-02-20T12:49:57.996577', '3072', '1'), - ('5.99', '495', '2007-04-29T14:18:14.996577', '8672', '1'), - ('4.99', '368', '2007-03-18T22:50:50.996577', '12796', '1'), - ('4.99', '95', '2007-03-21T02:20:18.996577', '14203', '2'), - ('4.99', '343', '2007-04-09T04:38:17.996577', '5097', '2'), - ('5.99', '534', '2007-03-01T08:13:51.996577', '10465', '2'), - ('8.99', '565', '2007-03-20T15:34:00.996577', '13925', '1'), - ('4.99', '588', '2007-04-29T05:29:13.996577', '8421', '1'), - ('2.99', '561', '2007-02-14T23:52:46.996577', '1193', '2'), - ('4.99', '220', '2007-03-20T19:20:29.996577', '14016', '2'), - ('5.99', '529', '2007-04-30T02:48:51.996577', '8979', '1'), - ('0.99', '413', '2007-04-27T23:36:37.996577', '7635', '1'), - ('2.99', '385', '2007-03-02T03:58:37.996577', '11021', '1'), - ('8.99', '409', '2007-02-18T07:14:25.996577', '2310', '2'), - ('0.99', '28', '2007-02-19T04:58:36.996577', '2604', '2'), - ('0.99', '486', '2007-03-20T11:14:43.996577', '13803', '2'), - ('2.99', '466', '2007-04-27T02:53:51.996577', '7080', '2'), - ('7.99', '414', '2007-03-19T17:28:08.996577', '13308', '1'), - ('4.99', '264', '2007-02-15T00:55:33.996577', '1206', '1'), - ('0.99', '122', '2007-04-11T12:31:02.996577', '6231', '2'), - ('5.99', '356', '2007-04-30T02:38:44.996577', '8975', '1'), - ('0.99', '561', '2007-03-23T03:57:02.996577', '15573', '1'), - ('6.99', '559', '2007-03-19T15:16:07.996577', '13248', '2'), - ('0.99', '520', '2007-03-22T23:44:59.996577', '15465', '1'), - ('2.99', '218', '2007-02-15T18:54:19.996577', '1459', '1'), - ('0.99', '348', '2007-02-18T21:30:02.996577', '2499', '2'), - ('0.99', '75', '2007-04-06T09:14:41.996577', '3711', '1'), - ('7.99', '253', '2007-03-21T17:31:45.996577', '14640', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['27712', '27066', '23848', '28490', '26222', '31311', '21485', '26523', '27872', '18376', '25601', '22290', '28699', '29422', '29287', '27609', '28056', '27200', '22916', '18099', '25328', '17786', '30931', '30041', '30156', '24311', '29056', '26237', '18270', '19542', '18207', '19037', '26758', '29803', '22841', '23651', '25113', '19099', '25391', '18140', '31455', '31210', '23804', '19315', '20863', '19316', '29132', '23976', '31563', '28169', '18530', '25315', '17615', '29931', '20446', '31747', '26737', '28666', '22596', '29655', '27155', '23932', '28704', '22792', '29265', '19506', '22627', '20353', '25951', '20909', '27779', '20269', '18176', '24819', '26574', '18330', '22875', '29825', '31878', '23776', '17673', '19918', '20156', '29935', '30373', '31906', '28051', '24289', '19563', '23635', '21267', '18900', '26278', '28734', '25737', '24966', '24677', '22652', '19621', '19397']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('4.99', '493', '2007-04-29T01:16:02.996577', '8298', '1'), - ('5.99', '435', '2007-04-29T04:13:56.996577', '8386', '1'), - ('2.99', '125', '2007-03-22T08:43:05.996577', '15055', '1'), - ('2.99', '565', '2007-04-11T14:11:01.996577', '6264', '1'), - ('1.99', '360', '2007-04-10T15:12:38.996577', '5834', '1'), - ('3.99', '212', '2007-04-08T15:13:42.996577', '4798', '2'), - ('1.99', '471', '2007-03-23T07:03:19.996577', '15654', '1'), - ('4.99', '385', '2007-04-30T06:07:58.996577', '9704', '1'), - ('6.99', '507', '2007-04-11T19:00:10.996577', '6351', '1'), - ('0.99', '574', '2007-02-16T19:49:18.996577', '1817', '1'), - ('2.99', '305', '2007-04-08T07:25:46.996577', '4638', '1'), - ('0.99', '561', '2007-03-21T00:32:59.996577', '14139', '2'), - ('4.99', '582', '2007-04-27T04:41:39.996577', '7126', '2'), - ('2.99', '38', '2007-04-30T19:36:59.996577', '10111', '2'), - ('5.99', '28', '2007-04-10T14:17:38.996577', '5817', '1'), - ('0.99', '484', '2007-04-29T08:03:04.996577', '8508', '2'), - ('2.99', '523', '2007-04-30T06:09:24.996577', '9071', '1'), - ('5.99', '446', '2007-04-27T00:07:02.996577', '7005', '1'), - ('2.99', '24', '2007-03-18T20:51:11.996577', '12745', '1'), - ('8.99', '497', '2007-02-17T23:16:09.996577', '2180', '2'), - ('0.99', '283', '2007-04-27T18:52:57.996577', '7504', '1'), - ('5.99', '413', '2007-02-17T19:29:10.996577', '2130', '2'), - ('2.99', '170', '2007-04-10T13:45:59.996577', '5808', '2'), - ('2.99', '93', '2007-04-27T11:18:49.996577', '7301', '1'), - ('6.99', '103', '2007-04-07T01:31:06.996577', '4040', '2'), - ('0.99', '170', '2007-03-02T04:29:19.996577', '11039', '1'), - ('5.99', '6', '2007-04-11T11:07:27.996577', '6211', '2'), - ('0.99', '361', '2007-04-11T07:54:18.996577', '6152', '1'), - ('5.99', '543', '2007-02-21T20:47:51.996577', '3467', '2'), - ('3.99', '269', '2007-03-17T14:33:54.996577', '11915', '1'), - ('0.99', '526', '2007-02-16T22:35:33.996577', '1848', '2'), - ('2.99', '139', '2007-02-16T14:20:58.996577', '1736', '1'), - ('0.99', '407', '2007-04-07T14:44:29.996577', '4296', '1'), - ('4.99', '73', '2007-04-29T03:56:06.996577', '8377', '1'), - ('6.99', '16', '2007-03-19T23:38:53.996577', '13480', '1'), - ('2.99', '104', '2007-03-17T05:40:57.996577', '11700', '1'), - ('0.99', '262', '2007-03-22T23:35:27.996577', '15456', '1'), - ('2.99', '154', '2007-02-20T07:13:34.996577', '2985', '1'), - ('3.99', '288', '2007-04-12T02:28:08.996577', '6518', '2'), - ('4.99', '508', '2007-02-16T08:41:23.996577', '1661', '2'), - ('5.99', '226', '2007-04-27T10:53:25.996577', '7288', '2'), - ('6.99', '197', '2007-04-09T08:36:36.996577', '5182', '2'), - ('8.99', '121', '2007-03-17T06:15:20.996577', '11720', '2'), - ('4.99', '215', '2007-02-16T22:24:37.996577', '1845', '2'), - ('6.99', '409', '2007-03-20T05:39:18.996577', '13632', '2'), - ('2.99', '215', '2007-02-17T10:15:29.996577', '2006', '2'), - ('0.99', '13', '2007-04-12T18:42:11.996577', '6870', '1'), - ('4.99', '138', '2007-03-02T03:41:26.996577', '11015', '1'), - ('0.99', '235', '2007-04-28T17:52:50.996577', '8120', '1'), - ('4.99', '533', '2007-04-08T14:46:01.996577', '4788', '1'), - ('7.99', '9', '2007-02-20T18:27:54.996577', '3142', '2'), - ('1.99', '282', '2007-04-30T02:37:39.996577', '8973', '2'), - ('4.99', '368', '2007-02-21T04:01:30.996577', '3275', '2'), - ('2.99', '85', '2007-04-08T10:19:04.996577', '4705', '1'), - ('6.99', '367', '2007-03-19T02:52:36.996577', '12911', '2'), - ('2.99', '251', '2007-04-29T06:01:38.996577', '8443', '2'), - ('2.99', '405', '2007-04-29T07:14:59.996577', '8482', '2'), - ('2.99', '579', '2007-04-30T15:26:15.996577', '9976', '2'), - ('3.99', '596', '2007-03-20T20:37:30.996577', '14050', '1'), - ('8.99', '59', '2007-04-30T21:25:00.996577', '9469', '1'), - ('4.99', '442', '2007-04-12T05:36:47.996577', '6590', '2'), - ('6.99', '133', '2007-03-23T19:36:25.996577', '16009', '1'), - ('2.99', '582', '2007-04-29T09:44:55.996577', '8554', '1'), - ('0.99', '12', '2007-03-20T01:05:33.996577', '13519', '2'), - ('2.99', '26', '2007-04-09T20:00:55.996577', '5437', '1'), - ('4.99', '266', '2007-02-17T14:32:12.996577', '2065', '2'), - ('4.99', '202', '2007-03-19T13:08:58.996577', '13196', '1'), - ('0.99', '357', '2007-03-01T19:01:08.996577', '10764', '2'), - ('5.99', '336', '2007-04-07T16:24:19.996577', '4323', '2'), - ('2.99', '413', '2007-03-23T07:52:11.996577', '15678', '1'), - ('4.99', '498', '2007-04-30T05:28:34.996577', '9689', '2'), - ('7.99', '348', '2007-03-02T18:32:18.996577', '11429', '1'), - ('0.99', '516', '2007-02-17T11:01:56.996577', '2017', '1'), - ('0.99', '231', '2007-03-20T19:49:34.996577', '14026', '1'), - ('0.99', '390', '2007-04-29T07:32:57.996577', '8493', '1'), - ('0.99', '561', '2007-02-21T16:59:35.996577', '3427', '1'), - ('0.99', '20', '2007-03-22T16:21:32.996577', '15248', '2'), - ('2.99', '75', '2007-04-12T18:02:15.996577', '6852', '2'), - ('6.99', '264', '2007-04-06T04:27:11.996577', '3618', '1'), - ('2.99', '119', '2007-03-01T11:18:10.996577', '10552', '2'), - ('7.99', '383', '2007-02-19T05:41:38.996577', '2609', '1'), - ('2.99', '308', '2007-03-17T08:23:54.996577', '11765', '1'), - ('2.99', '337', '2007-03-02T12:10:39.996577', '11252', '2'), - ('7.99', '85', '2007-04-30T19:44:59.996577', '9427', '2'), - ('2.99', '122', '2007-04-28T16:23:01.996577', '8077', '1'), - ('0.99', '266', '2007-04-06T02:51:02.996577', '3585', '2'), - ('2.99', '523', '2007-04-10T20:33:41.996577', '5932', '2'), - ('0.99', '168', '2007-03-01T01:38:50.996577', '10270', '2'), - ('2.99', '271', '2007-03-02T18:33:42.996577', '11431', '1'), - ('4.99', '102', '2007-03-02T06:35:38.996577', '11099', '2'), - ('2.99', '451', '2007-03-19T15:19:16.996577', '13252', '2'), - ('0.99', '103', '2007-02-18T00:18:53.996577', '2197', '1'), - ('0.99', '364', '2007-04-07T01:57:15.996577', '4047', '1'), - ('2.99', '585', '2007-04-09T13:36:47.996577', '5284', '2'), - ('2.99', '317', '2007-04-27T11:28:55.996577', '7309', '1'), - ('4.99', '247', '2007-03-18T11:17:11.996577', '12491', '1'), - ('2.99', '214', '2007-03-19T10:58:27.996577', '13138', '2'), - ('0.99', '205', '2007-03-21T07:04:29.996577', '14338', '1'), - ('2.99', '276', '2007-03-01T19:00:53.996577', '10763', '1'), - ('4.99', '238', '2007-02-16T08:41:21.996577', '1660', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['18700', '23337', '18095', '24338', '17574', '21153', '31540', '20604', '25641', '27285', '19669', '28731', '20383', '28781', '31230', '18841', '27381', '30975', '21646', '23503', '18433', '20719', '28298', '28921', '24005', '30661', '20779', '17605', '24461', '30135', '30569', '21453', '20722', '22525', '18211', '19616', '30372', '28337', '29635', '21206', '30337', '28689', '19837', '22414', '30402', '20417', '18554', '28711', '21641', '30138', '31051', '23050', '25219', '27998', '25796', '19355', '22654', '22776', '25679', '31945', '26665', '27751', '27987', '29065', '19637', '19233', '26218', '28012', '18588', '21450', '19131', '24217', '20701', '22997', '24138', '24076', '22339', '19842', '31657', '23584', '27611', '19452', '22418', '26938', '23238', '20978', '30821', '22510', '20991', '27923', '19088', '22784', '21214', '23611', '30637', '24425', '23402', '29169', '22289', '20801']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('0.99', '49', '2007-02-16T10:39:46.996577', '1688', '2'), - ('1.99', '68', '2007-03-22T04:36:18.996577', '14947', '1'), - ('4.99', '495', '2007-02-18T10:53:40.996577', '2349', '1'), - ('2.99', '172', '2007-03-23T06:22:04.996577', '15637', '2'), - ('2.99', '358', '2007-02-21T01:34:37.996577', '3245', '1'), - ('0.99', '440', '2007-03-19T00:36:32.996577', '12850', '1'), - ('5.99', '233', '2007-04-06T23:28:12.996577', '4015', '1'), - ('0.99', '382', '2007-03-18T12:22:02.996577', '12529', '2'), - ('0.99', '308', '2007-04-29T22:34:58.996577', '8869', '2'), - ('9.99', '454', '2007-04-30T17:32:56.996577', '9372', '1'), - ('2.99', '279', '2007-03-23T05:18:53.996577', '15606', '1'), - ('4.99', '585', '2007-04-07T07:32:17.996577', '4156', '2'), - ('0.99', '361', '2007-03-02T02:39:51.996577', '10975', '2'), - ('0.99', '589', '2007-04-28T15:32:41.996577', '8056', '2'), - ('2.99', '198', '2007-04-30T20:47:09.996577', '10147', '1'), - ('2.99', '87', '2007-02-17T03:14:07.996577', '1904', '1'), - ('2.99', '463', '2007-04-30T14:25:33.996577', '9954', '1'), - ('4.99', '174', '2007-04-12T20:37:56.996577', '6909', '1'), - ('7.99', '490', '2007-03-02T02:01:00.996577', '10955', '1'), - ('0.99', '85', '2007-03-17T18:47:32.996577', '12036', '2'), - ('7.99', '590', '2007-02-15T18:28:37.996577', '1456', '2'), - ('4.99', '394', '2007-03-01T03:05:45.996577', '10319', '1'), - ('0.99', '546', '2007-04-08T11:40:38.996577', '4734', '1'), - ('8.99', '202', '2007-04-30T21:14:00.996577', '9467', '2'), - ('3.99', '141', '2007-03-01T02:05:27.996577', '10287', '1'), - ('2.99', '147', '2007-04-06T20:30:17.996577', '3956', '2'), - ('2.99', '401', '2007-03-17T10:53:59.996577', '11820', '1'), - ('2.99', '365', '2007-02-18T23:16:48.996577', '2525', '1'), - ('2.99', '185', '2007-03-18T04:35:52.996577', '12312', '1'), - ('4.99', '102', '2007-04-06T06:51:34.996577', '3665', '2'), - ('0.99', '138', '2007-04-30T19:34:38.996577', '10110', '1'), - ('0.99', '469', '2007-03-17T18:46:32.996577', '12035', '2'), - ('4.99', '394', '2007-03-17T20:36:30.996577', '12080', '1'), - ('6.99', '587', '2007-03-18T05:14:59.996577', '12330', '2'), - ('4.99', '526', '2007-02-18T14:25:19.996577', '2398', '2'), - ('5.99', '275', '2007-03-21T12:12:25.996577', '14483', '2'), - ('4.99', '122', '2007-04-28T11:49:26.996577', '7950', '2'), - ('6.99', '550', '2007-04-29T12:34:50.996577', '8628', '1'), - ('2.99', '57', '2007-04-30T09:56:33.996577', '9812', '2'), - ('0.99', '445', '2007-03-20T04:08:59.996577', '13586', '2'), - ('4.99', '119', '2007-04-29T01:36:56.996577', '8304', '1'), - ('1.99', '581', '2007-04-08T16:36:01.996577', '4833', '1'), - ('4.99', '299', '2007-03-19T08:23:46.996577', '13069', '1'), - ('3.99', '575', '2007-03-02T06:34:12.996577', '11097', '1'), - ('0.99', '125', '2007-04-28T10:33:51.996577', '7922', '2'), - ('1.99', '364', '2007-03-18T21:33:48.996577', '12761', '1'), - ('6.99', '16', '2007-02-17T05:33:23.996577', '1934', '2'), - ('0.99', '583', '2007-04-09T21:25:19.996577', '5462', '1'), - ('2.99', '489', '2007-03-21T06:46:46.996577', '14328', '2'), - ('6.99', '102', '2007-04-08T23:34:29.996577', '4997', '1'), - ('3.99', '180', '2007-04-30T15:59:13.996577', '9995', '2'), - ('0.99', '37', '2007-03-23T16:00:45.996577', '15904', '1'), - ('5.99', '273', '2007-04-30T13:54:34.996577', '9285', '2'), - ('3.99', '519', '2007-04-12T06:09:40.996577', '6599', '1'), - ('1.99', '323', '2007-04-08T04:05:25.996577', '4572', '2'), - ('3.99', '228', '2007-02-21T17:35:45.996577', '3433', '2'), - ('2.99', '205', '2007-03-21T10:28:47.996577', '14442', '1'), - ('2.99', '10', '2007-03-17T18:40:01.996577', '12031', '2'), - ('5.99', '312', '2007-04-09T01:05:03.996577', '5031', '1'), - ('3.98', '361', '2007-05-14T13:44:29.996577', '13298', '1'), - ('2.99', '399', '2007-04-11T00:07:08.996577', '6006', '2'), - ('2.99', '497', '2007-04-06T08:33:21.996577', '3696', '1'), - ('4.99', '518', '2007-04-27T05:44:43.996577', '7154', '2'), - ('4.99', '7', '2007-04-08T17:16:04.996577', '4856', '1'), - ('4.99', '277', '2007-03-19T10:22:15.996577', '13122', '1'), - ('2.99', '189', '2007-02-21T09:35:19.996577', '3346', '1'), - ('5.99', '359', '2007-04-30T22:08:34.996577', '10174', '2'), - ('2.99', '520', '2007-04-11T01:05:12.996577', '6029', '1'), - ('4.99', '25', '2007-02-15T10:46:00.996577', '1338', '1'), - ('2.99', '469', '2007-03-01T15:07:44.996577', '10658', '1'), - ('0.99', '163', '2007-02-20T21:06:25.996577', '3179', '1'), - ('8.99', '159', '2007-03-21T15:20:00.996577', '14575', '2'), - ('6.99', '392', '2007-03-18T06:26:04.996577', '12368', '1'), - ('1.99', '32', '2007-03-20T15:44:36.996577', '13931', '1'), - ('4.99', '151', '2007-03-22T01:00:17.996577', '14856', '1'), - ('6.99', '146', '2007-03-23T14:04:31.996577', '15842', '1'), - ('0.99', '566', '2007-03-17T06:12:35.996577', '11717', '1'), - ('4.99', '300', '2007-03-02T02:40:43.996577', '10977', '1'), - ('5.99', '242', '2007-04-10T06:38:55.996577', '5666', '2'), - ('1.99', '93', '2007-03-23T16:16:56.996577', '15913', '2'), - ('9.99', '484', '2007-04-30T19:14:28.996577', '9414', '2'), - ('4.99', '253', '2007-02-19T07:41:32.996577', '2636', '2'), - ('5.99', '575', '2007-03-18T21:57:26.996577', '12770', '2'), - ('9.99', '423', '2007-04-29T11:16:09.996577', '8595', '2'), - ('4.99', '58', '2007-03-01T01:15:37.996577', '10256', '2'), - ('7.99', '419', '2007-03-18T09:53:39.996577', '12460', '1'), - ('6.99', '161', '2007-04-07T12:27:46.996577', '4248', '2'), - ('6.99', '585', '2007-03-23T15:38:22.996577', '15896', '1'), - ('4.99', '421', '2007-03-18T03:15:56.996577', '12279', '1'), - ('6.99', '511', '2007-04-30T08:50:37.996577', '9143', '1'), - ('2.99', '151', '2007-02-20T04:28:47.996577', '2947', '2'), - ('5.99', '11', '2007-03-17T18:01:10.996577', '12015', '2'), - ('3.99', '446', '2007-03-02T04:52:05.996577', '11051', '1'), - ('2.99', '98', '2007-03-17T06:50:26.996577', '11730', '1'), - ('0.99', '144', '2007-04-30T06:43:58.996577', '9714', '2'), - ('4.99', '181', '2007-03-02T11:09:04.996577', '11224', '2'), - ('3.99', '75', '2007-03-01T17:43:19.996577', '10726', '1'), - ('0.99', '16', '2007-04-27T18:08:04.996577', '7489', '2'), - ('2.99', '561', '2007-03-18T09:16:23.996577', '12441', '2'), - ('2.99', '403', '2007-03-17T22:05:29.996577', '12132', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['30406', '23708', '25409', '19817', '28537', '29688', '19148', '24693', '23740', '26804', '18600', '29883', '30917', '32076', '23059', '20009', '23267', '18484', '21212', '22589', '25227', '28154', '19654', '24313', '31884', '31628', '19069', '19578', '31419', '25611', '19434', '18569', '23459', '28166', '31062', '19049', '25248', '30385', '27378', '31925', '23292', '20023', '26951', '24036', '22708', '23690', '20444', '18251', '22210', '23930', '26734', '30255', '21594', '23524', '18669', '24145', '25516', '21032', '29704', '26823', '27419', '31887', '25278', '29418', '24908', '19675', '28631', '29685', '18982', '18450', '29385', '30595', '21102', '23613', '18919', '25756', '20892', '24972', '29639', '21982', '30083', '31281', '31449', '31202', '24612', '28857', '24046', '19396', '32035', '21902', '31138', '27230', '28714', '29687', '31360', '26929', '29383', '21300', '22745', '21755']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('9.99', '125', '2007-04-30T08:19:47.996577', '9129', '1'), - ('6.99', '111', '2007-03-22T13:55:02.996577', '15174', '2'), - ('0.99', '290', '2007-04-07T03:17:39.996577', '4073', '1'), - ('4.99', '297', '2007-03-20T08:31:25.996577', '13721', '2'), - ('1.99', '569', '2007-04-30T11:45:53.996577', '9220', '2'), - ('2.99', '63', '2007-04-30T13:57:13.996577', '9938', '2'), - ('8.99', '170', '2007-02-18T15:28:00.996577', '2413', '2'), - ('2.99', '215', '2007-03-23T05:24:41.996577', '15610', '2'), - ('0.99', '114', '2007-03-23T21:11:14.996577', '16047', '1'), - ('4.99', '410', '2007-04-27T13:02:40.996577', '7350', '2'), - ('4.99', '26', '2007-02-19T14:49:45.996577', '2745', '1'), - ('5.99', '80', '2007-04-08T09:31:55.996577', '4688', '1'), - ('3.99', '169', '2007-04-11T07:31:03.996577', '6143', '1'), - ('2.99', '199', '2007-05-14T13:44:29.996577', '13952', '2'), - ('2.99', '38', '2007-03-21T17:16:32.996577', '14632', '2'), - ('4.99', '319', '2007-03-22T00:02:31.996577', '14828', '2'), - ('0.99', '60', '2007-03-23T05:58:52.996577', '15632', '1'), - ('0.99', '205', '2007-02-16T16:30:02.996577', '1767', '1'), - ('6.99', '445', '2007-03-23T12:30:39.996577', '15791', '1'), - ('0.99', '596', '2007-03-01T20:50:37.996577', '10804', '2'), - ('0.99', '274', '2007-04-28T23:33:42.996577', '8259', '2'), - ('2.99', '532', '2007-04-07T17:03:02.996577', '4336', '1'), - ('4.99', '278', '2007-03-22T06:05:50.996577', '14986', '1'), - ('3.99', '170', '2007-03-19T05:06:17.996577', '12967', '1'), - ('0.99', '264', '2007-04-12T03:22:58.996577', '6543', '1'), - ('0.99', '240', '2007-04-10T03:11:40.996577', '5596', '1'), - ('0.99', '147', '2007-02-17T22:34:30.996577', '2171', '1'), - ('4.99', '273', '2007-03-02T13:03:29.996577', '11282', '1'), - ('4.99', '223', '2007-04-08T17:52:04.996577', '4874', '1'), - ('5.99', '306', '2007-04-07T23:34:23.996577', '4484', '2'), - ('0.99', '248', '2007-02-18T13:03:55.996577', '2371', '2'), - ('3.99', '20', '2007-02-17T19:45:07.996577', '2136', '2'), - ('5.99', '80', '2007-03-23T19:42:05.996577', '16012', '1'), - ('5.99', '532', '2007-04-29T00:01:42.996577', '8273', '1'), - ('8.99', '181', '2007-04-30T17:05:26.996577', '9357', '1'), - ('1.99', '143', '2007-02-17T02:56:37.996577', '1898', '2'), - ('0.99', '276', '2007-04-30T06:09:05.996577', '9070', '1'), - ('4.99', '123', '2007-04-30T23:33:52.996577', '9529', '2'), - ('0.99', '463', '2007-04-27T13:22:21.996577', '7361', '1'), - ('0.00', '284', '2007-05-14T13:44:29.996577', '12959', '2'), - ('3.99', '63', '2007-03-22T04:07:21.996577', '14931', '1'), - ('0.99', '322', '2007-03-02T19:42:30.996577', '11456', '2'), - ('2.99', '424', '2007-04-30T03:24:12.996577', '8999', '2'), - ('5.99', '143', '2007-03-22T16:31:37.996577', '15250', '1'), - ('2.99', '3', '2007-03-23T05:38:40.996577', '15619', '1'), - ('0.99', '109', '2007-03-01T00:37:59.996577', '10240', '2'), - ('0.99', '367', '2007-03-18T06:16:31.996577', '12362', '2'), - ('4.99', '538', '2007-02-17T03:46:58.996577', '1912', '1'), - ('2.99', '552', '2007-03-20T03:39:05.996577', '13574', '2'), - ('2.99', '133', '2007-03-20T14:59:15.996577', '13910', '2'), - ('2.99', '405', '2007-04-11T05:52:13.996577', '6110', '1'), - ('4.99', '112', '2007-04-28T05:00:11.996577', '7761', '2'), - ('4.99', '484', '2007-03-18T21:57:49.996577', '12771', '1'), - ('0.99', '87', '2007-03-19T23:37:37.996577', '13479', '1'), - ('0.99', '40', '2007-02-21T17:08:00.996577', '3428', '1'), - ('0.99', '152', '2007-03-17T09:07:50.996577', '11783', '2'), - ('0.99', '297', '2007-04-30T20:58:36.996577', '10153', '1'), - ('2.99', '425', '2007-03-23T20:41:10.996577', '16036', '2'), - ('1.99', '64', '2007-04-27T17:37:22.996577', '7476', '1'), - ('0.99', '412', '2007-04-07T03:18:15.996577', '4074', '2'), - ('4.99', '468', '2007-04-27T11:02:40.996577', '7292', '2'), - ('0.99', '264', '2007-04-30T23:03:31.996577', '9515', '2'), - ('0.99', '279', '2007-04-11T09:16:47.996577', '6176', '1'), - ('3.99', '38', '2007-04-30T00:37:24.996577', '8924', '2'), - ('7.99', '241', '2007-03-21T04:50:33.996577', '14269', '2'), - ('9.99', '280', '2007-03-19T14:41:15.996577', '13231', '2'), - ('0.99', '577', '2007-04-06T03:45:02.996577', '3599', '2'), - ('4.99', '63', '2007-04-30T00:16:06.996577', '9546', '1'), - ('0.99', '123', '2007-02-16T15:28:40.996577', '1751', '1'), - ('5.99', '594', '2007-02-15T23:21:17.996577', '1537', '2'), - ('6.99', '35', '2007-04-30T01:27:46.996577', '9579', '1'), - ('4.99', '141', '2007-04-26T23:18:19.996577', '6979', '2'), - ('4.99', '435', '2007-03-18T20:45:31.996577', '12741', '1'), - ('1.99', '98', '2007-03-21T11:16:34.996577', '14459', '2'), - ('2.99', '108', '2007-02-15T16:42:12.996577', '1425', '1'), - ('4.99', '319', '2007-04-11T10:28:58.996577', '6195', '1'), - ('5.99', '412', '2007-03-01T08:14:24.996577', '10467', '1'), - ('0.99', '248', '2007-03-20T15:15:58.996577', '13918', '1'), - ('1.99', '58', '2007-04-09T20:08:01.996577', '5439', '2'), - ('2.99', '527', '2007-03-22T12:17:44.996577', '15144', '1'), - ('7.99', '98', '2007-04-06T07:51:14.996577', '3682', '2'), - ('7.99', '210', '2007-04-07T19:26:29.996577', '4388', '2'), - ('2.99', '225', '2007-04-30T20:30:35.996577', '10138', '2'), - ('0.99', '196', '2007-04-29T15:24:27.996577', '8700', '2'), - ('0.99', '201', '2007-03-17T10:19:41.996577', '11807', '2'), - ('2.99', '595', '2007-04-08T14:12:31.996577', '4775', '2'), - ('2.99', '144', '2007-03-17T20:48:38.996577', '12087', '2'), - ('2.99', '238', '2007-02-15T00:27:16.996577', '1199', '1'), - ('4.99', '64', '2007-05-14T13:44:29.996577', '13333', '2'), - ('0.99', '518', '2007-03-22T05:45:11.996577', '14980', '2'), - ('5.99', '189', '2007-04-11T10:15:23.996577', '6193', '1'), - ('10.99', '448', '2007-04-30T10:27:16.996577', '9178', '1'), - ('6.99', '583', '2007-04-12T10:43:08.996577', '6684', '2'), - ('0.99', '63', '2007-04-30T09:15:45.996577', '9795', '1'), - ('0.99', '218', '2007-04-09T10:39:10.996577', '5226', '1'), - ('2.99', '423', '2007-04-08T09:01:40.996577', '4679', '1'), - ('5.99', '35', '2007-04-30T02:32:24.996577', '8971', '1'), - ('3.99', '454', '2007-03-22T18:12:42.996577', '15301', '1'), - ('6.99', '7', '2007-03-01T03:25:30.996577', '10330', '2'), - ('4.99', '503', '2007-03-17T12:18:57.996577', '11858', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['25350', '31999', '24786', '17962', '18457', '18239', '18817', '22765', '19042', '24263', '22183', '32014', '21405', '26803', '21289', '22355', '18525', '27633', '23492', '31881', '25419', '24895', '26225', '28899', '22641', '23632', '24078', '23040', '24324', '21236', '22624', '19264', '17815', '18683', '18521', '22697', '30407', '21433', '25206', '24913', '19432', '28229', '22211', '29452', '25168', '19631', '22049', '18872', '20609', '19750', '23086', '28147', '19498', '22923', '26920', '21701', '22577', '23237', '20363', '25983', '28540', '28818', '25389', '28190', '30362', '19754', '29115', '24017', '27549', '25542', '18105', '22041', '22212', '24178', '18880', '28723', '25005', '25222', '20434', '25272', '28745', '24722', '29583', '20864', '22727', '25685', '22488', '28904', '18627', '28123', '21931', '19891', '31472', '23336', '31065', '28578', '28594', '26210', '26073', '20449']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('3.99', '285', '2007-04-11T03:41:15.996577', '6083', '2'), - ('0.99', '570', '2007-05-14T13:44:29.996577', '12716', '1'), - ('3.99', '227', '2007-03-02T03:21:39.996577', '10999', '2'), - ('4.99', '457', '2007-02-19T09:58:42.996577', '2670', '1'), - ('4.99', '595', '2007-02-21T11:55:48.996577', '3371', '2'), - ('1.99', '534', '2007-02-20T23:33:45.996577', '3213', '2'), - ('5.99', '83', '2007-02-15T11:42:15.996577', '1354', '1'), - ('0.99', '9', '2007-03-01T07:39:51.996577', '10451', '1'), - ('6.99', '140', '2007-02-18T09:22:17.996577', '2332', '2'), - ('2.99', '165', '2007-03-02T20:56:49.996577', '11484', '1'), - ('4.99', '550', '2007-03-17T16:18:03.996577', '11969', '1'), - ('3.98', '15', '2007-05-14T13:44:29.996577', '13798', '1'), - ('2.99', '465', '2007-03-02T08:24:32.996577', '11156', '1'), - ('5.99', '410', '2007-04-11T11:43:24.996577', '6218', '2'), - ('0.99', '453', '2007-03-22T16:32:48.996577', '15252', '1'), - ('0.99', '568', '2007-03-01T22:55:20.996577', '10869', '2'), - ('4.99', '7', '2007-02-20T00:19:22.996577', '2888', '1'), - ('4.99', '486', '2007-04-07T05:12:53.996577', '4110', '2'), - ('7.99', '84', '2007-03-02T19:28:31.996577', '11453', '2'), - ('8.99', '264', '2007-04-11T18:14:31.996577', '6340', '1'), - ('7.99', '290', '2007-04-30T03:27:21.996577', '9000', '1'), - ('3.99', '240', '2007-03-17T07:28:27.996577', '11745', '1'), - ('5.99', '360', '2007-04-12T14:18:06.996577', '6770', '2'), - ('0.99', '598', '2007-04-29T05:49:46.996577', '8436', '2'), - ('7.99', '204', '2007-03-02T12:22:52.996577', '11261', '1'), - ('3.99', '101', '2007-03-21T14:05:00.996577', '14542', '2'), - ('8.99', '147', '2007-03-01T18:37:15.996577', '10752', '2'), - ('2.99', '37', '2007-03-01T10:51:07.996577', '10538', '1'), - ('0.99', '171', '2007-03-19T21:59:19.996577', '13433', '2'), - ('3.99', '448', '2007-03-20T17:36:51.996577', '13982', '1'), - ('4.99', '202', '2007-03-02T10:44:20.996577', '11210', '1'), - ('4.99', '196', '2007-02-21T09:15:02.996577', '3342', '2'), - ('6.99', '423', '2007-02-19T04:35:51.996577', '2600', '1'), - ('4.99', '45', '2007-02-19T13:23:43.996577', '2722', '2'), - ('0.99', '6', '2007-02-18T10:31:49.996577', '2345', '1'), - ('2.99', '2', '2007-03-19T04:54:30.996577', '12963', '1'), - ('4.99', '125', '2007-04-30T22:23:46.996577', '9496', '1'), - ('2.99', '467', '2007-03-23T13:47:41.996577', '15830', '2'), - ('7.99', '272', '2007-04-28T23:10:22.996577', '8248', '1'), - ('4.99', '241', '2007-03-23T11:42:41.996577', '15767', '1'), - ('5.99', '247', '2007-02-18T05:51:43.996577', '2288', '1'), - ('0.99', '538', '2007-04-11T17:47:32.996577', '6332', '1'), - ('0.99', '552', '2007-03-20T07:40:08.996577', '13693', '1'), - ('2.99', '41', '2007-04-08T04:17:40.996577', '4575', '1'), - ('2.99', '268', '2007-04-10T06:46:48.996577', '5671', '2'), - ('4.99', '276', '2007-03-23T16:36:45.996577', '15923', '2'), - ('4.99', '534', '2007-03-18T22:52:59.996577', '12798', '2'), - ('2.99', '95', '2007-02-20T11:49:24.996577', '3056', '2'), - ('4.99', '383', '2007-03-01T10:09:59.996577', '10515', '2'), - ('4.99', '289', '2007-03-22T03:32:25.996577', '14917', '2'), - ('0.99', '41', '2007-03-18T23:35:28.996577', '12821', '2'), - ('6.99', '531', '2007-04-27T14:28:26.996577', '7391', '1'), - ('3.99', '264', '2007-02-14T21:44:53.996577', '1165', '2'), - ('2.99', '25', '2007-03-02T00:34:25.996577', '10916', '1'), - ('4.99', '422', '2007-04-06T01:04:07.996577', '3553', '1'), - ('0.99', '497', '2007-03-17T21:50:44.996577', '12123', '1'), - ('4.99', '594', '2007-03-21T23:56:17.996577', '14824', '2'), - ('9.99', '57', '2007-03-23T14:52:50.996577', '15871', '2'), - ('4.99', '359', '2007-03-02T04:22:01.996577', '11032', '1'), - ('0.99', '338', '2007-04-29T18:09:30.996577', '8766', '1'), - ('2.99', '569', '2007-04-30T23:01:26.996577', '10192', '2'), - ('2.99', '592', '2007-04-08T01:17:02.996577', '4518', '1'), - ('0.99', '288', '2007-04-08T13:06:28.996577', '4758', '2'), - ('2.99', '535', '2007-04-08T12:11:02.996577', '4743', '1'), - ('2.99', '122', '2007-04-06T12:13:14.996577', '3778', '1'), - ('4.99', '290', '2007-03-18T22:08:49.996577', '12778', '2'), - ('6.99', '11', '2007-04-30T14:36:47.996577', '9292', '2'), - ('7.99', '141', '2007-03-20T20:53:10.996577', '14059', '2'), - ('0.99', '479', '2007-04-12T06:05:28.996577', '6597', '1'), - ('10.99', '300', '2007-04-10T08:37:43.996577', '5705', '1'), - ('2.99', '498', '2007-02-18T10:30:13.996577', '2344', '1'), - ('4.99', '533', '2007-03-21T23:14:44.996577', '14800', '1'), - ('4.99', '552', '2007-03-21T20:22:13.996577', '14724', '2'), - ('2.99', '155', '2007-03-21T21:40:09.996577', '14753', '1'), - ('0.99', '96', '2007-02-21T20:28:26.996577', '3463', '2'), - ('0.99', '584', '2007-04-26T22:23:39.996577', '6954', '2'), - ('2.99', '253', '2007-03-01T15:16:27.996577', '10660', '1'), - ('0.99', '273', '2007-04-30T07:12:09.996577', '9729', '2'), - ('0.99', '366', '2007-03-20T03:01:57.996577', '13563', '2'), - ('4.99', '278', '2007-04-30T01:49:31.996577', '8953', '1'), - ('4.99', '586', '2007-04-06T10:02:21.996577', '3733', '2'), - ('0.99', '219', '2007-03-17T09:29:37.996577', '11791', '2'), - ('7.99', '52', '2007-04-11T20:57:41.996577', '6394', '1'), - ('1.99', '409', '2007-03-20T23:05:26.996577', '14103', '1'), - ('1.99', '5', '2007-03-19T08:14:07.996577', '13063', '1'), - ('6.99', '312', '2007-04-30T03:54:39.996577', '9016', '1'), - ('2.99', '583', '2007-03-01T12:29:25.996577', '10586', '2'), - ('2.99', '599', '2007-04-10T15:42:53.996577', '5843', '1'), - ('0.99', '31', '2007-02-18T02:26:02.996577', '2233', '1'), - ('5.99', '529', '2007-04-12T03:22:07.996577', '6541', '2'), - ('3.99', '521', '2007-03-21T14:25:51.996577', '14551', '2'), - ('0.99', '305', '2007-03-19T00:31:52.996577', '12846', '2'), - ('8.99', '228', '2007-04-06T08:57:19.996577', '3710', '2'), - ('5.99', '68', '2007-03-21T11:04:37.996577', '14455', '2'), - ('6.99', '182', '2007-04-06T08:35:48.996577', '3697', '1'), - ('4.99', '573', '2007-04-07T00:23:51.996577', '4023', '2'), - ('2.99', '574', '2007-04-08T18:34:04.996577', '4890', '2'), - ('7.99', '359', '2007-04-08T16:24:49.996577', '4830', '2'), - ('1.99', '347', '2007-04-11T06:23:53.996577', '6121', '2'), - ('10.99', '367', '2007-03-21T12:09:40.996577', '14481', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['22279', '23181', '17575', '30160', '31390', '29599', '23080', '31226', '19274', '22044', '31541', '31768', '29932', '28855', '21627', '20322', '22235', '24694', '22983', '26787', '30248', '26936', '28845', '24971', '27410', '19732', '27993', '17682', '23798', '27454', '27582', '22827', '26784', '23731', '19238', '21469', '19649', '29697', '21009', '19984', '21961', '17886', '20068', '31662', '31454', '31330', '25006', '19329', '30012', '27459', '31752', '24771', '19870', '25285', '30944', '24268', '30127', '31742', '28240', '17706', '26513', '21484', '27448', '20194', '31470', '19809', '30165', '25252', '21452', '24086', '21918', '25806', '27424', '28934', '25877', '26687', '19020', '21109', '30056', '26032', '31674', '29919', '19111', '20107', '20369', '20036', '20908', '22413', '20565', '28980', '17607', '31380', '29540', '17535', '31165', '30270', '26822', '20465', '26555', '29945']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('5.99', '560', '2007-03-20T18:54:26.996577', '14008', '2'), - ('3.99', '52', '2007-03-17T06:53:01.996577', '11731', '1'), - ('4.99', '359', '2007-02-15T09:53:32.996577', '1329', '2'), - ('4.99', '103', '2007-04-09T07:28:54.996577', '5163', '2'), - ('4.99', '220', '2007-04-29T04:41:06.996577', '8398', '1'), - ('1.99', '54', '2007-04-09T02:33:54.996577', '5055', '2'), - ('6.99', '40', '2007-03-21T04:29:34.996577', '14260', '1'), - ('0.99', '198', '2007-04-27T23:06:00.996577', '7622', '2'), - ('4.99', '199', '2007-02-15T15:12:26.996577', '1406', '1'), - ('6.99', '534', '2007-03-01T17:39:30.996577', '10725', '2'), - ('4.99', '233', '2007-04-08T18:19:43.996577', '4885', '1'), - ('0.99', '253', '2007-04-30T02:19:12.996577', '9606', '2'), - ('4.99', '85', '2007-04-09T02:26:19.996577', '5051', '1'), - ('4.99', '595', '2007-04-06T23:36:44.996577', '4017', '1'), - ('0.99', '488', '2007-03-01T19:05:49.996577', '10767', '1'), - ('0.99', '353', '2007-03-23T06:58:19.996577', '15650', '2'), - ('2.99', '555', '2007-03-17T22:42:21.996577', '12150', '2'), - ('2.99', '215', '2007-03-23T12:51:49.996577', '15799', '2'), - ('4.99', '30', '2007-03-20T07:19:05.996577', '13682', '1'), - ('7.99', '409', '2007-04-10T21:50:36.996577', '5955', '1'), - ('0.99', '111', '2007-04-29T08:48:45.996577', '8525', '2'), - ('9.99', '423', '2007-04-28T07:58:28.996577', '7849', '1'), - ('2.99', '594', '2007-04-09T17:47:35.996577', '5386', '2'), - ('0.99', '248', '2007-03-18T02:01:43.996577', '12241', '1'), - ('4.99', '467', '2007-04-29T18:10:59.996577', '8767', '1'), - ('2.99', '288', '2007-03-19T14:08:54.996577', '13219', '1'), - ('0.99', '519', '2007-04-08T03:38:04.996577', '4564', '2'), - ('2.99', '385', '2007-02-16T15:09:45.996577', '1746', '1'), - ('2.99', '120', '2007-03-20T18:35:41.996577', '14001', '1'), - ('4.99', '470', '2007-04-28T00:48:14.996577', '7663', '1'), - ('8.99', '482', '2007-04-10T13:50:30.996577', '5810', '2'), - ('3.99', '15', '2007-03-20T07:03:07.996577', '13677', '2'), - ('5.99', '409', '2007-04-09T14:25:11.996577', '5306', '2'), - ('4.99', '114', '2007-03-16T23:27:50.996577', '11547', '1'), - ('4.99', '190', '2007-02-21T12:49:32.996577', '3386', '1'), - ('8.99', '470', '2007-03-18T08:43:18.996577', '12423', '2'), - ('0.99', '278', '2007-03-18T22:36:24.996577', '12787', '1'), - ('0.99', '64', '2007-04-09T19:49:51.996577', '5432', '1'), - ('2.99', '423', '2007-03-01T08:55:53.996577', '10488', '1'), - ('0.99', '316', '2007-03-17T18:32:13.996577', '12028', '1'), - ('4.99', '526', '2007-03-02T04:37:00.996577', '11046', '2'), - ('8.99', '442', '2007-02-16T02:23:05.996577', '1576', '2'), - ('4.99', '327', '2007-03-22T00:42:17.996577', '14847', '1'), - ('5.99', '243', '2007-04-06T15:30:59.996577', '3854', '2'), - ('9.99', '226', '2007-04-12T11:53:13.996577', '6712', '1'), - ('3.99', '214', '2007-04-08T14:37:50.996577', '4783', '1'), - ('6.99', '253', '2007-03-01T23:06:40.996577', '10881', '2'), - ('0.99', '218', '2007-02-18T04:38:49.996577', '2267', '1'), - ('2.99', '91', '2007-04-11T09:27:35.996577', '6178', '1'), - ('4.99', '470', '2007-04-30T16:23:01.996577', '10006', '1'), - ('2.99', '252', '2007-04-10T01:32:04.996577', '5554', '2'), - ('1.99', '225', '2007-03-02T15:21:26.996577', '11333', '2'), - ('2.99', '303', '2007-03-17T04:22:41.996577', '11673', '2'), - ('4.99', '280', '2007-04-27T02:29:34.996577', '7070', '1'), - ('5.99', '171', '2007-04-30T06:42:55.996577', '9084', '2'), - ('7.99', '166', '2007-03-01T06:45:37.996577', '10422', '2'), - ('8.99', '101', '2007-04-28T08:36:27.996577', '7866', '2'), - ('2.99', '251', '2007-04-08T16:58:42.996577', '4848', '2'), - ('7.99', '539', '2007-04-09T06:30:17.996577', '5139', '2'), - ('2.99', '390', '2007-02-17T02:47:03.996577', '1893', '2'), - ('8.99', '385', '2007-04-06T16:55:35.996577', '3878', '2'), - ('0.99', '471', '2007-03-22T14:19:38.996577', '15184', '2'), - ('4.99', '470', '2007-04-09T03:57:04.996577', '5082', '2'), - ('2.99', '340', '2007-03-19T21:40:10.996577', '13425', '1'), - ('2.99', '227', '2007-04-30T23:20:50.996577', '9521', '2'), - ('4.99', '297', '2007-03-01T01:31:38.996577', '10264', '2'), - ('6.99', '103', '2007-04-27T17:32:45.996577', '7472', '2'), - ('5.99', '276', '2007-04-30T20:49:12.996577', '10149', '2'), - ('0.99', '469', '2007-03-02T09:33:01.996577', '11185', '2'), - ('4.99', '147', '2007-03-22T05:00:02.996577', '14960', '2'), - ('5.99', '520', '2007-03-20T09:23:54.996577', '13746', '2'), - ('0.99', '323', '2007-04-29T19:20:07.996577', '8790', '1'), - ('6.99', '468', '2007-04-30T05:34:55.996577', '9690', '1'), - ('4.99', '204', '2007-04-11T00:02:51.996577', '6004', '2'), - ('2.99', '330', '2007-04-12T12:09:03.996577', '6719', '1'), - ('2.99', '401', '2007-04-29T14:13:21.996577', '8669', '2'), - ('0.99', '133', '2007-02-21T11:24:14.996577', '3365', '2'), - ('2.99', '436', '2007-03-17T00:27:33.996577', '11580', '1'), - ('6.99', '95', '2007-04-30T05:41:56.996577', '9695', '1'), - ('9.99', '343', '2007-04-28T16:52:15.996577', '8088', '2'), - ('5.99', '243', '2007-04-30T15:51:02.996577', '9988', '2'), - ('6.99', '84', '2007-04-08T16:39:26.996577', '4838', '2'), - ('4.99', '158', '2007-02-16T18:27:06.996577', '1790', '2'), - ('3.99', '331', '2007-03-22T23:22:23.996577', '15447', '2'), - ('4.99', '359', '2007-03-22T12:27:45.996577', '15148', '1'), - ('3.99', '323', '2007-03-22T04:58:00.996577', '14957', '1'), - ('2.99', '413', '2007-03-21T22:19:23.996577', '14773', '1'), - ('7.99', '575', '2007-03-01T14:01:58.996577', '10629', '2'), - ('4.99', '379', '2007-03-18T11:45:12.996577', '12503', '1'), - ('2.99', '208', '2007-04-06T13:49:03.996577', '3811', '2'), - ('1.99', '366', '2007-02-15T14:58:48.996577', '1401', '2'), - ('6.99', '219', '2007-04-29T13:31:20.996577', '8652', '1'), - ('4.99', '49', '2007-04-11T11:18:14.996577', '6214', '1'), - ('8.99', '348', '2007-02-17T12:47:26.996577', '2041', '1'), - ('0.99', '192', '2007-04-12T10:55:04.996577', '6691', '2'), - ('5.99', '113', '2007-04-27T17:20:53.996577', '7468', '2'), - ('0.99', '412', '2007-04-06T17:22:46.996577', '3888', '2'), - ('2.99', '369', '2007-03-01T17:18:31.996577', '10713', '2'), - ('0.99', '389', '2007-04-09T12:02:19.996577', '5249', '1'), - ('2.99', '86', '2007-04-27T08:30:17.996577', '7231', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['20767', '31565', '20699', '22903', '22838', '20415', '29027', '22868', '31464', '23887', '24614', '25267', '29747', '26097', '19451', '22512', '25108', '28908', '28462', '22673', '28469', '24903', '18233', '26621', '23382', '29598', '23262', '27972', '24992', '27185', '28303', '26707', '17709', '22243', '28583', '26586', '21556', '25546', '31388', '24760', '23030', '29112', '29042', '28372', '27340', '26777', '21427', '22487', '27955', '21034', '28136', '21360', '17781', '30768', '21390', '28936', '18296', '31163', '29411', '30825', '27762', '18417', '28478', '19699', '29101', '23189', '23820', '23293', '30163', '31338', '25787', '28022', '25543', '30064', '27986', '24930', '21888', '26677', '17910', '27475', '23942', '31899', '29461', '20479', '31718', '18266', '26455', '21764', '27889', '26708', '22491', '29460', '23979', '23307', '31304', '30987', '20240', '18093', '19898', '22102']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('0.99', '399', '2007-03-22T18:12:26.996577', '15300', '1'), - ('0.99', '235', '2007-04-29T18:48:42.996577', '8781', '2'), - ('2.99', '392', '2007-03-17T05:07:56.996577', '11686', '1'), - ('4.99', '22', '2007-03-23T12:34:45.996577', '15793', '1'), - ('7.99', '16', '2007-03-18T14:08:12.996577', '12577', '1'), - ('4.99', '364', '2007-03-17T15:04:38.996577', '11932', '2'), - ('2.99', '3', '2007-04-29T09:35:30.996577', '8545', '1'), - ('0.99', '20', '2007-03-17T23:56:41.996577', '12180', '1'), - ('7.99', '227', '2007-04-27T04:57:00.996577', '7132', '1'), - ('4.99', '129', '2007-03-01T21:17:23.996577', '10816', '2'), - ('9.99', '201', '2007-03-20T04:52:19.996577', '13613', '2'), - ('8.99', '278', '2007-04-08T17:38:25.996577', '4866', '2'), - ('3.99', '68', '2007-04-30T23:53:48.996577', '9538', '1'), - ('4.99', '348', '2007-04-29T10:07:43.996577', '8569', '1'), - ('4.99', '253', '2007-02-18T18:01:17.996577', '2454', '1'), - ('0.99', '586', '2007-03-17T08:20:05.996577', '11763', '1'), - ('5.99', '262', '2007-03-20T11:24:09.996577', '13808', '1'), - ('2.99', '599', '2007-04-30T03:25:33.996577', '9630', '2'), - ('3.99', '563', '2007-04-08T03:40:54.996577', '4565', '1'), - ('6.99', '207', '2007-03-17T06:33:10.996577', '11724', '1'), - ('0.99', '563', '2007-04-09T18:41:49.996577', '5406', '1'), - ('2.99', '241', '2007-03-01T14:52:34.996577', '10652', '1'), - ('2.99', '533', '2007-02-17T07:06:21.996577', '1954', '1'), - ('0.99', '394', '2007-04-30T11:35:20.996577', '9864', '2'), - ('0.99', '73', '2007-03-02T08:23:54.996577', '11155', '2'), - ('4.99', '54', '2007-04-08T08:19:28.996577', '4657', '2'), - ('1.99', '60', '2007-03-17T20:45:15.996577', '12084', '1'), - ('0.99', '517', '2007-04-08T20:47:08.996577', '4934', '2'), - ('2.99', '251', '2007-03-19T10:20:05.996577', '13121', '2'), - ('2.99', '445', '2007-04-09T10:38:42.996577', '5225', '2'), - ('4.99', '546', '2007-04-29T08:55:22.996577', '8532', '1'), - ('2.99', '403', '2007-04-11T17:26:46.996577', '6322', '2'), - ('0.99', '391', '2007-02-15T02:46:36.996577', '1232', '2'), - ('4.99', '556', '2007-03-17T19:09:12.996577', '12045', '1'), - ('9.99', '573', '2007-04-10T00:14:55.996577', '5522', '2'), - ('0.99', '391', '2007-04-28T14:04:07.996577', '8016', '2'), - ('0.99', '480', '2007-03-02T03:48:17.996577', '11017', '2'), - ('4.99', '300', '2007-04-28T06:42:37.996577', '7815', '1'), - ('9.99', '220', '2007-04-28T04:23:56.996577', '7750', '2'), - ('0.99', '224', '2007-03-17T10:42:42.996577', '11816', '1'), - ('2.99', '36', '2007-03-01T18:54:01.996577', '10761', '2'), - ('1.99', '11', '2007-04-29T06:06:40.996577', '8447', '2'), - ('0.99', '5', '2007-04-10T09:38:01.996577', '5721', '2'), - ('6.99', '553', '2007-04-12T16:31:51.996577', '6812', '1'), - ('4.99', '460', '2007-04-12T06:58:33.996577', '6613', '1'), - ('3.99', '408', '2007-04-29T06:54:53.996577', '8469', '2'), - ('9.99', '467', '2007-03-18T09:11:09.996577', '12437', '1'), - ('4.99', '583', '2007-03-01T02:38:03.996577', '10301', '2'), - ('4.99', '515', '2007-04-10T08:13:10.996577', '5697', '2'), - ('0.99', '426', '2007-03-02T11:52:27.996577', '11237', '2'), - ('4.99', '530', '2007-04-28T21:55:01.996577', '8208', '2'), - ('3.99', '460', '2007-03-22T03:41:59.996577', '14923', '1'), - ('4.99', '410', '2007-02-21T01:41:45.996577', '3249', '1'), - ('0.99', '156', '2007-04-30T05:42:12.996577', '9696', '1'), - ('2.99', '463', '2007-03-02T00:15:30.996577', '10906', '2'), - ('0.99', '204', '2007-04-12T08:00:09.996577', '6631', '2'), - ('8.99', '553', '2007-02-18T18:22:39.996577', '2460', '1'), - ('2.99', '192', '2007-04-09T18:25:06.996577', '5400', '1'), - ('2.99', '38', '2007-04-10T14:39:05.996577', '5822', '1'), - ('2.99', '161', '2007-04-27T00:00:32.996577', '7003', '1'), - ('4.99', '497', '2007-04-29T22:30:44.996577', '8867', '2'), - ('2.99', '586', '2007-02-15T05:10:51.996577', '1260', '1'), - ('2.99', '564', '2007-04-26T23:00:30.996577', '6973', '1'), - ('4.99', '284', '2007-03-21T21:22:28.996577', '14746', '2'), - ('2.99', '10', '2007-04-28T03:50:08.996577', '7738', '1'), - ('3.99', '53', '2007-03-01T12:43:25.996577', '10594', '1'), - ('4.99', '122', '2007-03-18T10:51:06.996577', '12476', '2'), - ('5.99', '63', '2007-03-22T08:52:58.996577', '15060', '1'), - ('2.99', '103', '2007-04-26T22:12:38.996577', '6949', '2'), - ('2.99', '215', '2007-04-10T18:04:51.996577', '5886', '1'), - ('3.99', '322', '2007-04-12T02:07:55.996577', '6511', '1'), - ('2.99', '521', '2007-04-09T13:03:39.996577', '5276', '1'), - ('4.99', '300', '2007-04-11T05:55:23.996577', '6111', '2'), - ('2.99', '96', '2007-04-10T08:12:58.996577', '5696', '1'), - ('3.99', '518', '2007-04-27T01:35:55.996577', '7038', '2'), - ('2.99', '243', '2007-03-20T19:59:19.996577', '14033', '1'), - ('4.99', '517', '2007-03-01T07:14:22.996577', '10433', '2'), - ('5.99', '400', '2007-04-28T01:35:55.996577', '7682', '1'), - ('4.99', '449', '2007-02-15T07:45:46.996577', '1295', '2'), - ('2.99', '472', '2007-04-12T05:12:02.996577', '6584', '1'), - ('0.99', '135', '2007-03-01T08:21:03.996577', '10471', '2'), - ('6.99', '265', '2007-04-12T21:07:29.996577', '6921', '2'), - ('5.99', '41', '2007-04-30T15:28:09.996577', '9313', '2'), - ('5.99', '370', '2007-03-23T18:41:57.996577', '15982', '1'), - ('5.99', '247', '2007-04-28T12:17:04.996577', '7963', '1'), - ('4.99', '543', '2007-02-16T13:28:40.996577', '1720', '2'), - ('7.99', '379', '2007-04-11T12:46:17.996577', '6235', '1'), - ('3.99', '503', '2007-03-23T04:31:01.996577', '15588', '1'), - ('4.99', '508', '2007-04-28T01:23:53.996577', '7676', '2'), - ('4.99', '403', '2007-04-11T18:16:50.996577', '6342', '1'), - ('0.99', '583', '2007-03-21T04:28:48.996577', '14259', '1'), - ('2.99', '41', '2007-04-29T15:58:32.996577', '8712', '1'), - ('2.99', '138', '2007-03-18T13:09:04.996577', '12550', '2'), - ('6.99', '65', '2007-03-18T18:28:20.996577', '12688', '1'), - ('1.99', '211', '2007-04-12T12:12:29.996577', '6722', '1'), - ('4.99', '175', '2007-04-28T23:47:16.996577', '8264', '1'), - ('4.99', '345', '2007-03-02T02:47:37.996577', '10982', '2'), - ('2.99', '494', '2007-02-16T10:23:21.996577', '1683', '1'), - ('6.99', '306', '2007-03-17T04:24:53.996577', '11674', '2'), - ('6.99', '540', '2007-03-18T04:04:40.996577', '12300', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['18089', '28314', '24715', '24286', '23263', '23833', '18177', '19902', '32041', '30819', '26720', '18076', '18358', '19691', '20362', '17602', '17713', '23558', '18803', '28228', '17971', '27567', '22811', '20829', '28985', '31769', '19596', '30363', '27278', '18904', '21631', '18571', '28253', '24387', '28313', '20154', '24814', '21903', '28244', '25573', '21476', '21495', '28134', '23977', '27665', '26135', '25589', '21540', '24418', '26768', '29838', '23488', '25513', '20980', '29126', '29123', '30166', '28979', '30934', '20232', '32007', '17642', '30535', '27584', '18715', '17760', '30555', '31476', '29884', '22570', '22928', '28893', '22678', '17577', '31425', '25768', '19833', '24714', '24517', '18306', '28788', '29205', '26140', '18987', '22407', '23560', '24981', '17551', '28789', '17754', '28186', '27964', '28878', '28977', '18421', '28333', '26220', '22671', '25332', '22518']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('3.99', '493', '2007-02-17T18:10:08.996577', '2109', '2'), - ('4.99', '547', '2007-04-28T07:18:05.996577', '7835', '1'), - ('2.99', '218', '2007-03-18T11:00:00.996577', '12481', '2'), - ('0.99', '167', '2007-03-23T00:18:57.996577', '15478', '2'), - ('7.99', '60', '2007-03-18T15:44:29.996577', '12614', '2'), - ('5.99', '124', '2007-03-02T21:15:26.996577', '11493', '2'), - ('0.99', '516', '2007-02-20T12:30:48.996577', '3068', '2'), - ('4.99', '306', '2007-03-20T07:25:54.996577', '13686', '1'), - ('2.99', '80', '2007-05-14T13:44:29.996577', '12457', '2'), - ('4.99', '161', '2007-04-06T20:14:19.996577', '3948', '1'), - ('3.99', '404', '2007-04-10T04:45:32.996577', '5632', '1'), - ('4.99', '489', '2007-02-19T17:46:43.996577', '2802', '1'), - ('6.99', '570', '2007-02-17T11:42:29.996577', '2031', '2'), - ('6.99', '283', '2007-03-18T03:36:29.996577', '12290', '1'), - ('7.99', '358', '2007-03-20T18:45:01.996577', '14004', '1'), - ('1.99', '365', '2007-02-15T08:24:23.996577', '1303', '1'), - ('2.99', '391', '2007-02-20T19:50:39.996577', '3163', '2'), - ('4.99', '91', '2007-03-19T17:32:26.996577', '13309', '2'), - ('7.99', '78', '2007-02-21T01:40:47.996577', '3248', '2'), - ('2.99', '538', '2007-04-11T06:48:22.996577', '6130', '2'), - ('4.99', '459', '2007-02-17T15:08:59.996577', '2075', '2'), - ('1.99', '481', '2007-04-08T00:48:30.996577', '4505', '1'), - ('4.99', '14', '2007-03-20T09:48:38.996577', '13757', '1'), - ('4.99', '405', '2007-03-23T17:00:06.996577', '15932', '1'), - ('6.99', '208', '2007-04-11T16:32:52.996577', '6306', '2'), - ('6.99', '253', '2007-04-30T02:44:40.996577', '9618', '2'), - ('0.99', '274', '2007-03-20T19:10:38.996577', '14012', '1'), - ('4.99', '122', '2007-04-06T21:53:39.996577', '3986', '2'), - ('4.99', '454', '2007-04-09T04:13:42.996577', '5088', '2'), - ('0.99', '104', '2007-02-20T03:12:11.996577', '2928', '2'), - ('5.99', '488', '2007-03-22T04:39:19.996577', '14948', '2'), - ('4.99', '20', '2007-02-21T09:50:04.996577', '3350', '1'), - ('2.99', '540', '2007-04-11T09:40:04.996577', '6182', '2'), - ('2.99', '177', '2007-03-22T00:43:52.996577', '14849', '2'), - ('3.99', '547', '2007-04-27T20:20:14.996577', '7547', '2'), - ('0.99', '337', '2007-03-01T15:19:41.996577', '10664', '1'), - ('5.99', '231', '2007-03-17T00:31:28.996577', '11581', '1'), - ('4.99', '518', '2007-03-22T22:56:42.996577', '15434', '2'), - ('6.99', '539', '2007-04-28T23:10:04.996577', '8247', '2'), - ('2.99', '302', '2007-04-29T19:32:40.996577', '8795', '1'), - ('4.99', '471', '2007-03-17T01:43:13.996577', '11601', '2'), - ('2.99', '472', '2007-03-22T17:35:13.996577', '15278', '2'), - ('1.99', '530', '2007-04-27T02:40:06.996577', '7075', '2'), - ('0.99', '138', '2007-03-02T06:16:57.996577', '11088', '1'), - ('2.99', '488', '2007-04-28T15:44:04.996577', '8064', '2'), - ('2.99', '352', '2007-04-27T01:31:51.996577', '7033', '1'), - ('8.99', '304', '2007-04-08T15:35:37.996577', '4812', '2'), - ('2.99', '477', '2007-03-22T10:03:09.996577', '15091', '2'), - ('2.99', '180', '2007-03-22T00:49:10.996577', '14851', '1'), - ('2.99', '407', '2007-04-29T19:54:17.996577', '8802', '1'), - ('0.99', '76', '2007-04-12T15:03:06.996577', '6789', '2'), - ('0.99', '84', '2007-03-01T10:53:08.996577', '10540', '2'), - ('0.99', '297', '2007-04-28T10:55:53.996577', '7933', '1'), - ('0.99', '419', '2007-03-21T06:11:47.996577', '14308', '2'), - ('5.99', '12', '2007-04-30T12:18:09.996577', '9238', '2'), - ('0.99', '12', '2007-04-27T10:19:13.996577', '7279', '2'), - ('0.99', '103', '2007-04-29T01:29:50.996577', '8302', '1'), - ('2.99', '207', '2007-04-30T04:18:19.996577', '9652', '2'), - ('2.99', '170', '2007-04-30T10:01:57.996577', '9817', '1'), - ('5.99', '343', '2007-03-23T18:33:07.996577', '15973', '2'), - ('0.99', '592', '2007-05-14T13:44:29.996577', '14606', '2'), - ('2.99', '377', '2007-02-20T18:07:34.996577', '3136', '2'), - ('5.99', '136', '2007-04-30T08:11:24.996577', '9764', '2'), - ('8.99', '482', '2007-04-11T19:24:55.996577', '6355', '1'), - ('2.99', '53', '2007-02-20T01:17:27.996577', '2903', '1'), - ('4.99', '405', '2007-02-21T01:21:43.996577', '3240', '1'), - ('2.99', '138', '2007-04-05T21:41:33.996577', '3481', '2'), - ('4.99', '228', '2007-04-08T07:12:58.996577', '4636', '1'), - ('3.99', '80', '2007-04-09T19:17:08.996577', '5420', '2'), - ('5.99', '593', '2007-03-01T22:07:00.996577', '10840', '1'), - ('0.99', '25', '2007-03-23T01:25:56.996577', '15512', '1'), - ('4.99', '598', '2007-04-12T02:58:10.996577', '6528', '2'), - ('3.99', '207', '2007-03-20T16:31:07.996577', '13954', '2'), - ('0.99', '359', '2007-02-18T14:50:29.996577', '2401', '1'), - ('3.99', '224', '2007-04-07T20:23:24.996577', '4411', '2'), - ('4.99', '320', '2007-04-28T18:59:21.996577', '8144', '2'), - ('2.99', '299', '2007-03-01T07:22:58.996577', '10440', '2'), - ('2.99', '218', '2007-03-17T03:34:45.996577', '11654', '1'), - ('0.99', '190', '2007-03-21T17:53:17.996577', '14650', '2'), - ('4.99', '556', '2007-02-20T14:34:40.996577', '3093', '1'), - ('2.99', '590', '2007-04-10T00:39:39.996577', '5529', '1'), - ('2.99', '20', '2007-04-28T18:13:45.996577', '8127', '2'), - ('2.99', '352', '2007-04-28T09:06:21.996577', '7886', '1'), - ('2.99', '125', '2007-02-15T19:46:24.996577', '1481', '1'), - ('2.99', '574', '2007-03-18T09:57:21.996577', '12462', '1'), - ('2.99', '91', '2007-03-22T02:37:44.996577', '14888', '2'), - ('4.99', '250', '2007-03-01T13:03:34.996577', '10604', '2'), - ('4.99', '352', '2007-02-16T17:40:11.996577', '1780', '1'), - ('4.99', '590', '2007-04-10T23:32:04.996577', '5991', '1'), - ('4.99', '404', '2007-02-19T12:58:01.996577', '2715', '1'), - ('5.99', '534', '2007-04-30T20:50:42.996577', '9456', '1'), - ('4.99', '516', '2007-04-29T04:35:26.996577', '8396', '2'), - ('3.99', '596', '2007-04-30T18:59:44.996577', '10094', '1'), - ('5.99', '207', '2007-04-27T20:08:21.996577', '7540', '1'), - ('2.99', '587', '2007-02-18T01:50:02.996577', '2220', '1'), - ('4.99', '550', '2007-04-10T09:53:54.996577', '5727', '1'), - ('7.99', '360', '2007-04-07T23:48:48.996577', '4487', '1'), - ('0.99', '207', '2007-03-02T12:20:45.996577', '11260', '2'), - ('2.99', '283', '2007-04-30T01:12:36.996577', '9572', '2'), - ('3.99', '586', '2007-03-23T07:29:36.996577', '15666', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['21552', '18468', '18209', '31294', '27235', '26676', '23699', '25339', '22655', '17973', '24112', '25801', '30861', '25606', '31448', '27839', '27123', '25369', '27595', '29350', '24829', '30212', '19812', '19160', '26894', '18378', '21021', '23283', '20032', '30380', '20014', '25594', '30840', '25243', '22805', '22729', '26088', '26893', '23598', '26918', '30970', '26323', '22507', '29571', '24283', '20826', '29236', '28432', '24970', '18564', '25226', '22508', '29330', '22420', '23978', '30805', '20183', '21657', '19097', '19365', '25137', '30959', '30392', '25002', '19500', '28820', '19382', '21702', '27890', '30747', '20335', '25735', '28947', '25173', '22686', '20848', '23677', '25397', '23830', '25514', '25341', '26442', '26694', '31150', '23696', '29063', '23715', '28539', '29059', '17716', '21074', '31645', '22548', '27203', '18969', '25844', '30176', '18780', '30834', '27518']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('0.99', '479', '2007-03-18T07:49:17.996577', '12401', '2'), - ('2.99', '202', '2007-02-15T19:24:08.996577', '1474', '1'), - ('2.99', '526', '2007-02-17T07:54:15.996577', '1972', '2'), - ('8.99', '211', '2007-04-06T19:44:04.996577', '3937', '2'), - ('6.99', '449', '2007-04-28T04:50:44.996577', '7755', '2'), - ('2.99', '400', '2007-04-27T11:08:14.996577', '7296', '2'), - ('2.99', '110', '2007-03-22T20:57:02.996577', '15381', '2'), - ('5.99', '284', '2007-04-11T14:44:16.996577', '6276', '1'), - ('6.99', '205', '2007-03-21T12:22:41.996577', '14490', '2'), - ('4.99', '459', '2007-02-20T11:04:10.996577', '3041', '2'), - ('2.99', '149', '2007-03-16T23:51:35.996577', '11561', '1'), - ('2.99', '323', '2007-04-27T10:07:34.996577', '7275', '2'), - ('4.99', '165', '2007-04-09T21:45:06.996577', '5472', '1'), - ('7.99', '305', '2007-04-11T06:56:45.996577', '6134', '1'), - ('2.99', '225', '2007-04-30T15:58:46.996577', '9993', '2'), - ('5.99', '504', '2007-04-07T16:32:42.996577', '4329', '1'), - ('0.99', '440', '2007-04-10T03:02:02.996577', '5594', '2'), - ('0.99', '286', '2007-04-27T13:34:31.996577', '7368', '1'), - ('4.99', '483', '2007-04-27T14:08:52.996577', '7381', '1'), - ('5.99', '32', '2007-04-29T04:20:52.996577', '8390', '2'), - ('2.99', '232', '2007-03-23T03:02:05.996577', '15553', '2'), - ('2.99', '107', '2007-04-30T09:28:26.996577', '9155', '1'), - ('4.99', '297', '2007-03-17T00:43:02.996577', '11585', '2'), - ('4.99', '173', '2007-02-18T16:40:52.996577', '2435', '2'), - ('4.99', '419', '2007-04-28T06:08:05.996577', '7796', '1'), - ('6.99', '574', '2007-02-21T00:14:51.996577', '3220', '1'), - ('2.99', '424', '2007-03-17T11:28:59.996577', '11833', '2'), - ('6.99', '62', '2007-03-22T23:43:44.996577', '15464', '1'), - ('4.99', '323', '2007-03-17T21:45:12.996577', '12120', '1'), - ('2.99', '123', '2007-04-28T03:21:09.996577', '7727', '1'), - ('2.99', '320', '2007-03-22T18:13:19.996577', '15302', '1'), - ('0.99', '304', '2007-04-11T05:35:35.996577', '6107', '2'), - ('0.99', '163', '2007-04-11T05:49:23.996577', '6109', '1'), - ('0.99', '276', '2007-04-08T10:44:03.996577', '4715', '1'), - ('4.99', '13', '2007-03-22T19:19:50.996577', '15338', '1'), - ('6.99', '5', '2007-03-20T20:42:25.996577', '14053', '2'), - ('0.99', '348', '2007-04-08T10:05:22.996577', '4699', '1'), - ('2.99', '419', '2007-04-27T22:54:07.996577', '7619', '1'), - ('4.99', '96', '2007-03-18T12:16:57.996577', '12525', '2'), - ('0.99', '421', '2007-04-30T12:06:07.996577', '9875', '2'), - ('8.99', '173', '2007-04-29T21:02:00.996577', '8829', '2'), - ('4.99', '367', '2007-04-30T19:48:39.996577', '9430', '1'), - ('3.99', '585', '2007-03-20T04:19:18.996577', '13593', '2'), - ('4.99', '51', '2007-04-10T03:36:21.996577', '5606', '1'), - ('1.99', '167', '2007-03-20T13:37:42.996577', '13870', '1'), - ('0.99', '405', '2007-03-21T13:52:50.996577', '14537', '2'), - ('6.99', '23', '2007-04-30T20:18:50.996577', '10132', '1'), - ('9.99', '560', '2007-04-07T18:48:55.996577', '4375', '2'), - ('4.99', '248', '2007-03-01T06:39:33.996577', '10418', '2'), - ('8.99', '18', '2007-02-20T07:31:17.996577', '2990', '1'), - ('3.99', '274', '2007-04-11T20:46:46.996577', '6389', '2'), - ('0.99', '585', '2007-03-20T15:56:27.996577', '13939', '2'), - ('9.99', '31', '2007-04-08T11:53:24.996577', '4738', '2'), - ('2.99', '575', '2007-03-19T23:22:40.996577', '13465', '2'), - ('0.99', '138', '2007-03-02T20:06:02.996577', '11463', '1'), - ('0.99', '159', '2007-04-29T06:57:16.996577', '8470', '1'), - ('0.99', '339', '2007-03-20T17:41:32.996577', '13985', '1'), - ('0.99', '491', '2007-03-21T22:34:59.996577', '14780', '1'), - ('0.99', '154', '2007-02-17T07:37:57.996577', '1963', '1'), - ('0.99', '230', '2007-02-19T16:44:52.996577', '2777', '1'), - ('3.99', '265', '2007-03-02T03:24:40.996577', '11000', '2'), - ('0.99', '173', '2007-04-06T09:22:00.996577', '3717', '2'), - ('8.99', '124', '2007-04-28T02:22:40.996577', '7700', '2'), - ('5.99', '252', '2007-03-20T17:56:16.996577', '13989', '2'), - ('0.99', '264', '2007-02-20T10:19:18.996577', '3028', '1'), - ('0.99', '592', '2007-04-27T06:27:50.996577', '7173', '2'), - ('0.99', '235', '2007-02-16T19:34:46.996577', '1811', '2'), - ('4.99', '497', '2007-03-19T11:48:25.996577', '13159', '1'), - ('4.99', '508', '2007-04-28T21:15:40.996577', '8191', '2'), - ('1.99', '154', '2007-04-28T09:39:59.996577', '7900', '2'), - ('3.99', '355', '2007-03-22T20:16:19.996577', '15367', '1'), - ('0.99', '317', '2007-04-10T01:25:11.996577', '5548', '1'), - ('4.99', '205', '2007-04-08T11:28:06.996577', '4729', '1'), - ('2.99', '268', '2007-04-30T00:58:33.996577', '8931', '1'), - ('2.99', '1', '2007-03-19T12:25:20.996577', '13176', '2'), - ('1.99', '407', '2007-03-22T19:13:01.996577', '15334', '2'), - ('4.99', '107', '2007-03-19T19:35:48.996577', '13361', '2'), - ('0.99', '289', '2007-04-08T06:31:08.996577', '4622', '2'), - ('4.99', '123', '2007-03-23T02:11:58.996577', '15525', '2'), - ('2.99', '297', '2007-04-30T03:47:53.996577', '9014', '2'), - ('6.99', '284', '2007-04-27T06:05:00.996577', '7164', '1'), - ('4.99', '377', '2007-04-30T16:36:47.996577', '10013', '1'), - ('2.99', '402', '2007-04-07T19:48:54.996577', '4399', '1'), - ('2.99', '190', '2007-04-27T14:53:09.996577', '7404', '2'), - ('7.99', '110', '2007-03-17T03:22:40.996577', '11647', '1'), - ('2.99', '7', '2007-04-07T11:50:46.996577', '4238', '2'), - ('2.99', '112', '2007-03-20T13:46:36.996577', '13879', '2'), - ('1.99', '569', '2007-04-30T14:34:18.996577', '9960', '2'), - ('2.99', '6', '2007-04-27T03:32:10.996577', '7099', '2'), - ('2.99', '392', '2007-02-18T05:58:09.996577', '2289', '2'), - ('6.99', '432', '2007-03-18T21:54:15.996577', '12767', '1'), - ('6.99', '241', '2007-04-11T04:15:34.996577', '6090', '2'), - ('5.99', '590', '2007-03-17T00:22:39.996577', '11578', '2'), - ('6.99', '446', '2007-04-29T00:25:06.996577', '8284', '2'), - ('4.99', '120', '2007-02-17T22:25:49.996577', '2169', '1'), - ('4.99', '326', '2007-04-30T22:05:25.996577', '10173', '2'), - ('1.99', '104', '2007-04-29T05:16:05.996577', '8413', '1'), - ('4.99', '73', '2007-02-20T03:48:27.996577', '2940', '2'), - ('0.99', '162', '2007-04-30T08:28:26.996577', '9775', '1'), - ('4.99', '476', '2007-04-07T08:17:30.996577', '4171', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['21038', '23809', '30171', '22767', '31545', '26503', '31636', '24668', '22522', '20043', '22038', '29420', '25217', '31303', '30244', '23053', '25450', '24462', '21766', '18670', '27773', '28861', '30641', '23836', '30326', '30653', '19253', '19142', '27678', '19349', '32013', '19881', '17985', '24358', '31146', '18898', '25885', '20792', '31060', '24617', '19110', '28862', '19531', '26739', '24650', '28764', '21686', '29322', '25956', '21458', '28835', '19903', '20358', '25600', '26597', '18029', '25718', '21810', '18738', '23074', '29980', '25283', '19788', '28241', '19775', '25014', '20242', '18977', '27988', '19816', '25356', '24507', '18139', '22157', '25874', '21191', '25234', '31727', '29139', '22606', '30887', '25231', '27696', '17810', '21983', '20461', '24983', '30857', '19151', '24309', '24580', '29630', '25618', '28013', '23625', '21327', '18184', '32009', '28095', '31902']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('4.99', '426', '2007-03-18T19:20:28.996577', '12707', '2'), - ('0.99', '121', '2007-03-19T02:15:00.996577', '12892', '2'), - ('4.99', '104', '2007-04-08T01:22:12.996577', '4520', '2'), - ('5.99', '9', '2007-03-02T17:29:18.996577', '11400', '2'), - ('2.99', '233', '2007-04-12T15:06:49.996577', '6794', '1'), - ('0.99', '383', '2007-04-30T04:24:04.996577', '9653', '1'), - ('3.99', '240', '2007-04-29T07:45:16.996577', '8503', '2'), - ('3.99', '213', '2007-03-17T09:00:06.996577', '11778', '2'), - ('2.99', '587', '2007-03-02T05:55:24.996577', '11078', '1'), - ('2.99', '324', '2007-03-19T20:12:24.996577', '13386', '1'), - ('0.99', '533', '2007-03-18T15:18:16.996577', '12602', '1'), - ('0.99', '38', '2007-04-30T13:53:45.996577', '9284', '1'), - ('2.99', '273', '2007-04-29T06:10:51.996577', '8449', '1'), - ('4.99', '211', '2007-04-12T07:46:34.996577', '6628', '1'), - ('9.99', '111', '2007-04-06T20:47:43.996577', '3963', '2'), - ('3.99', '38', '2007-03-02T04:44:06.996577', '11049', '2'), - ('1.99', '292', '2007-04-30T10:07:39.996577', '9819', '2'), - ('5.99', '185', '2007-03-18T17:53:22.996577', '12674', '1'), - ('2.99', '503', '2007-03-23T09:56:52.996577', '15726', '1'), - ('4.99', '41', '2007-02-19T01:52:43.996577', '2563', '1'), - ('4.99', '498', '2007-04-27T10:42:32.996577', '7285', '1'), - ('6.99', '595', '2007-04-12T11:18:50.996577', '6704', '1'), - ('6.99', '145', '2007-04-07T20:01:42.996577', '4405', '2'), - ('4.99', '124', '2007-03-22T17:05:50.996577', '15266', '2'), - ('3.99', '118', '2007-04-29T02:03:30.996577', '8314', '1'), - ('6.99', '146', '2007-04-08T17:03:00.996577', '4849', '1'), - ('7.99', '194', '2007-02-18T03:21:25.996577', '2245', '1'), - ('5.99', '167', '2007-02-15T21:04:19.996577', '1509', '1'), - ('7.99', '490', '2007-04-09T08:00:10.996577', '5173', '2'), - ('1.99', '227', '2007-02-17T21:35:55.996577', '2155', '2'), - ('4.99', '14', '2007-05-14T13:44:29.996577', '13780', '1'), - ('3.99', '304', '2007-03-20T14:59:59.996577', '13911', '2'), - ('4.99', '463', '2007-02-21T06:29:15.996577', '3309', '1'), - ('0.99', '175', '2007-03-01T23:00:10.996577', '10875', '1'), - ('2.99', '190', '2007-04-07T06:47:36.996577', '4140', '1'), - ('4.99', '103', '2007-02-15T14:51:04.996577', '1396', '2'), - ('5.99', '331', '2007-04-07T02:52:23.996577', '4063', '2'), - ('2.99', '403', '2007-03-01T07:29:30.996577', '10443', '1'), - ('4.99', '181', '2007-04-30T11:38:40.996577', '9214', '2'), - ('2.99', '201', '2007-03-21T18:07:54.996577', '14656', '2'), - ('0.99', '158', '2007-02-15T13:41:36.996577', '1380', '1'), - ('4.99', '595', '2007-04-27T03:08:12.996577', '7086', '1'), - ('6.99', '268', '2007-03-17T11:16:54.996577', '11828', '2'), - ('0.99', '405', '2007-04-30T01:08:04.996577', '9569', '1'), - ('5.99', '211', '2007-03-18T13:51:57.996577', '12570', '2'), - ('4.99', '588', '2007-04-09T15:29:15.996577', '5335', '1'), - ('0.99', '495', '2007-03-19T00:19:35.996577', '12837', '2'), - ('2.99', '30', '2007-04-29T13:05:56.996577', '8641', '1'), - ('6.99', '336', '2007-04-11T20:27:19.996577', '6382', '2'), - ('7.99', '469', '2007-03-21T02:15:51.996577', '14197', '2'), - ('2.99', '593', '2007-04-12T12:26:53.996577', '6731', '1'), - ('5.99', '306', '2007-03-20T08:36:53.996577', '13725', '2'), - ('5.99', '358', '2007-03-02T08:20:09.996577', '11149', '2'), - ('4.99', '305', '2007-04-07T12:51:11.996577', '4260', '2'), - ('9.99', '392', '2007-04-29T11:56:46.996577', '8612', '2'), - ('3.99', '476', '2007-02-16T10:22:51.996577', '1682', '1'), - ('6.99', '315', '2007-04-29T14:29:39.996577', '8677', '2'), - ('6.99', '508', '2007-03-22T06:58:43.996577', '15010', '1'), - ('0.99', '58', '2007-02-20T01:33:22.996577', '2906', '1'), - ('9.99', '40', '2007-03-18T07:39:49.996577', '12396', '2'), - ('7.99', '89', '2007-04-27T13:44:19.996577', '7370', '2'), - ('4.99', '280', '2007-04-08T06:16:38.996577', '4616', '1'), - ('2.99', '294', '2007-03-21T11:51:14.996577', '14474', '1'), - ('2.99', '539', '2007-04-09T22:40:10.996577', '5493', '2'), - ('6.99', '293', '2007-03-21T04:04:23.996577', '14248', '1'), - ('2.99', '253', '2007-03-22T15:40:55.996577', '15221', '2'), - ('4.99', '345', '2007-03-18T11:10:07.996577', '12485', '1'), - ('0.99', '122', '2007-02-18T03:40:09.996577', '2253', '1'), - ('2.99', '518', '2007-04-27T14:11:41.996577', '7382', '2'), - ('2.99', '297', '2007-03-19T18:27:47.996577', '13330', '1'), - ('9.99', '285', '2007-04-28T04:14:54.996577', '7745', '1'), - ('6.99', '190', '2007-03-02T08:26:54.996577', '11158', '2'), - ('4.99', '507', '2007-02-18T05:24:32.996577', '2283', '2'), - ('2.99', '546', '2007-03-22T00:04:03.996577', '14829', '1'), - ('5.99', '330', '2007-04-10T10:49:07.996577', '5750', '1'), - ('6.99', '444', '2007-03-17T23:10:12.996577', '12161', '1'), - ('0.99', '275', '2007-04-08T07:08:28.996577', '4634', '1'), - ('4.99', '249', '2007-04-09T13:02:44.996577', '5275', '1'), - ('0.99', '13', '2007-04-30T04:40:34.996577', '9664', '1'), - ('0.99', '597', '2007-03-19T05:51:32.996577', '12992', '1'), - ('4.99', '167', '2007-04-09T18:57:08.996577', '5413', '1'), - ('4.99', '274', '2007-04-30T05:08:11.996577', '9677', '1'), - ('6.99', '491', '2007-04-28T08:45:03.996577', '7871', '1'), - ('4.99', '422', '2007-02-17T02:54:49.996577', '1897', '1'), - ('3.99', '527', '2007-03-23T03:01:49.996577', '15552', '1'), - ('2.99', '368', '2007-03-22T19:46:34.996577', '15353', '1'), - ('0.99', '250', '2007-03-18T23:12:36.996577', '12810', '1'), - ('4.99', '165', '2007-04-05T23:52:34.996577', '3531', '2'), - ('5.99', '171', '2007-02-18T00:26:22.996577', '2199', '2'), - ('4.99', '169', '2007-03-23T08:01:48.996577', '15680', '2'), - ('6.99', '198', '2007-03-17T01:15:28.996577', '11594', '1'), - ('5.99', '57', '2007-04-28T23:17:10.996577', '8249', '2'), - ('2.99', '306', '2007-04-28T02:22:54.996577', '7701', '2'), - ('5.99', '520', '2007-04-27T07:18:33.996577', '7198', '2'), - ('6.99', '101', '2007-03-01T01:08:15.996577', '10253', '1'), - ('10.99', '457', '2007-03-21T06:46:44.996577', '14327', '2'), - ('5.99', '518', '2007-02-16T00:30:03.996577', '1552', '2'), - ('4.99', '597', '2007-05-14T13:44:29.996577', '11652', '1'), - ('4.99', '526', '2007-04-30T16:49:34.996577', '10020', '2'), - ('5.99', '265', '2007-04-29T00:11:21.996577', '8278', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['27034', '22731', '30055', '24512', '20761', '30516', '23271', '19034', '29344', '27272', '20820', '22839', '29448', '21111', '25610', '23726', '26719', '24238', '21859', '26144', '21574', '30053', '29937', '18413', '24550', '30763', '31567', '28369', '17533', '22373', '20614', '27279', '21117', '26778', '24082', '24383', '24894', '26883', '18344', '30597', '28973', '29797', '25316', '28642', '23633', '31854', '20338', '22970', '22829', '21679', '29058', '22209', '27824', '20100', '18228', '20723', '23614', '21261', '31293', '32030', '24739', '22653', '20312', '22438', '19216', '18030', '30863', '19229', '18506', '26759', '18820', '23439', '19304', '26566', '22995', '23264', '29681', '22221', '23178', '27444', '23935', '30701', '22611', '22098', '24847', '31054', '27683', '20695', '26961', '31716', '18436', '27777', '19503', '22772', '20608', '22436', '21239', '20685', '28439', '23033']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('4.99', '432', '2007-04-28T16:27:02.996577', '8079', '2'), - ('2.99', '5', '2007-03-21T12:31:16.996577', '14494', '2'), - ('6.99', '95', '2007-04-30T11:49:34.996577', '9222', '1'), - ('2.99', '190', '2007-03-18T03:00:31.996577', '12270', '1'), - ('2.99', '399', '2007-03-01T15:00:01.996577', '10654', '2'), - ('0.99', '135', '2007-04-07T04:53:45.996577', '4102', '1'), - ('9.99', '61', '2007-03-17T20:18:51.996577', '12072', '1'), - ('0.99', '138', '2007-02-17T12:29:17.996577', '2038', '2'), - ('2.99', '32', '2007-04-10T21:50:27.996577', '5954', '1'), - ('0.99', '453', '2007-04-27T20:54:02.996577', '7563', '1'), - ('7.99', '405', '2007-03-02T15:42:45.996577', '11345', '1'), - ('4.99', '16', '2007-03-19T11:36:49.996577', '13151', '2'), - ('1.99', '40', '2007-04-30T15:22:09.996577', '9975', '1'), - ('5.99', '436', '2007-03-17T13:48:20.996577', '11896', '2'), - ('6.99', '306', '2007-04-06T13:52:22.996577', '3814', '1'), - ('5.99', '113', '2007-03-18T07:26:24.996577', '12392', '1'), - ('4.99', '404', '2007-04-08T22:07:06.996577', '4963', '1'), - ('0.99', '161', '2007-03-02T01:34:46.996577', '10939', '2'), - ('4.99', '514', '2007-03-18T03:42:02.996577', '12293', '1'), - ('3.99', '353', '2007-04-12T06:48:28.996577', '6610', '1'), - ('0.99', '481', '2007-03-21T15:43:59.996577', '14584', '2'), - ('5.99', '95', '2007-04-27T08:57:32.996577', '7245', '2'), - ('2.99', '85', '2007-04-30T15:43:13.996577', '9985', '1'), - ('0.99', '585', '2007-02-15T10:58:07.996577', '1344', '1'), - ('0.99', '195', '2007-03-19T04:07:52.996577', '12941', '2'), - ('0.99', '156', '2007-04-10T19:12:40.996577', '5908', '2'), - ('6.99', '235', '2007-04-30T23:14:23.996577', '9519', '2'), - ('3.99', '553', '2007-04-08T21:07:36.996577', '4941', '2'), - ('7.99', '347', '2007-02-21T07:33:16.996577', '3326', '1'), - ('8.99', '569', '2007-03-22T02:49:21.996577', '14896', '1'), - ('4.99', '383', '2007-03-18T20:33:20.996577', '12735', '1'), - ('2.99', '454', '2007-04-09T20:28:21.996577', '5446', '2'), - ('5.99', '436', '2007-03-20T09:54:59.996577', '13760', '1'), - ('6.99', '408', '2007-04-29T23:36:32.996577', '8902', '2'), - ('3.99', '147', '2007-03-20T06:55:27.996577', '13670', '2'), - ('6.99', '177', '2007-03-17T03:56:03.996577', '11662', '2'), - ('7.99', '240', '2007-03-01T02:51:15.996577', '10308', '1'), - ('0.99', '419', '2007-04-06T03:31:37.996577', '3596', '1'), - ('4.99', '566', '2007-02-21T12:23:24.996577', '3379', '1'), - ('4.99', '141', '2007-04-29T05:48:40.996577', '8434', '1'), - ('0.99', '207', '2007-04-10T20:58:31.996577', '5939', '2'), - ('4.99', '73', '2007-04-08T14:50:27.996577', '4789', '1'), - ('9.99', '282', '2007-04-30T04:29:18.996577', '9658', '2'), - ('4.99', '578', '2007-04-08T00:12:45.996577', '4496', '2'), - ('2.99', '101', '2007-03-22T10:29:32.996577', '15103', '2'), - ('1.99', '262', '2007-04-05T23:28:37.996577', '3521', '1'), - ('4.99', '356', '2007-03-01T22:30:32.996577', '10854', '1'), - ('2.99', '29', '2007-03-19T12:19:02.996577', '13173', '2'), - ('4.99', '15', '2007-03-21T22:22:01.996577', '14776', '2'), - ('4.99', '494', '2007-03-22T00:11:55.996577', '14832', '1'), - ('0.99', '6', '2007-04-12T10:47:04.996577', '6686', '2'), - ('2.99', '552', '2007-03-19T01:55:43.996577', '12880', '2'), - ('4.99', '502', '2007-04-28T14:48:52.996577', '8034', '2'), - ('5.99', '331', '2007-03-02T04:54:45.996577', '11052', '1'), - ('4.99', '532', '2007-02-16T11:08:49.996577', '1694', '1'), - ('4.99', '394', '2007-03-18T07:17:02.996577', '12389', '1'), - ('7.99', '98', '2007-03-23T02:26:54.996577', '15536', '1'), - ('6.99', '451', '2007-03-02T16:47:55.996577', '11381', '2'), - ('0.99', '210', '2007-04-29T17:01:13.996577', '8738', '2'), - ('0.00', '53', '2007-05-14T13:44:29.996577', '14137', '1'), - ('4.99', '220', '2007-03-23T09:01:18.996577', '15706', '2'), - ('4.99', '205', '2007-03-21T08:44:53.996577', '14391', '2'), - ('2.99', '352', '2007-03-18T21:01:48.996577', '12751', '1'), - ('0.99', '577', '2007-03-18T17:48:25.996577', '12671', '2'), - ('4.99', '186', '2007-02-19T23:15:44.996577', '2875', '2'), - ('0.99', '476', '2007-02-17T15:28:06.996577', '2080', '1'), - ('6.99', '165', '2007-04-10T18:50:38.996577', '5901', '2'), - ('0.99', '189', '2007-02-15T23:44:25.996577', '1541', '1'), - ('2.99', '3', '2007-02-19T07:03:19.996577', '2628', '1'), - ('4.99', '407', '2007-04-09T03:26:52.996577', '5070', '1'), - ('4.99', '83', '2007-02-21T00:51:42.996577', '3230', '2'), - ('2.99', '78', '2007-03-21T23:37:00.996577', '14810', '1'), - ('0.99', '213', '2007-02-18T22:12:34.996577', '2509', '1'), - ('4.99', '390', '2007-04-07T00:18:32.996577', '4022', '1'), - ('9.99', '32', '2007-03-18T08:19:06.996577', '12414', '2'), - ('2.99', '60', '2007-03-22T10:07:29.996577', '15093', '1'), - ('3.99', '63', '2007-04-12T14:17:20.996577', '6769', '2'), - ('0.99', '554', '2007-03-17T12:43:05.996577', '11873', '1'), - ('0.99', '52', '2007-03-01T12:40:55.996577', '10591', '2'), - ('4.99', '470', '2007-04-06T15:02:26.996577', '3841', '1'), - ('4.99', '134', '2007-03-02T13:08:12.996577', '11283', '1'), - ('4.99', '149', '2007-04-11T19:26:14.996577', '6356', '1'), - ('0.99', '598', '2007-03-02T15:51:25.996577', '11350', '2'), - ('4.99', '540', '2007-03-02T14:59:43.996577', '11324', '2'), - ('5.99', '234', '2007-03-22T08:04:59.996577', '15037', '2'), - ('4.99', '181', '2007-04-12T00:07:08.996577', '6477', '2'), - ('2.99', '490', '2007-04-12T19:29:37.996577', '6888', '2'), - ('2.99', '391', '2007-03-20T17:33:06.996577', '13980', '1'), - ('7.99', '425', '2007-04-08T18:17:43.996577', '4884', '1'), - ('6.99', '247', '2007-04-09T15:16:55.996577', '5328', '1'), - ('6.99', '590', '2007-02-20T02:29:30.996577', '2916', '1'), - ('2.99', '498', '2007-04-28T22:37:34.996577', '8229', '1'), - ('4.99', '265', '2007-02-19T01:43:31.996577', '2562', '2'), - ('7.99', '9', '2007-03-21T12:22:25.996577', '14489', '2'), - ('7.99', '382', '2007-03-23T17:12:47.996577', '15939', '2'), - ('0.99', '577', '2007-03-02T20:10:33.996577', '11464', '2'), - ('9.99', '448', '2007-03-22T19:57:40.996577', '15358', '2'), - ('5.99', '390', '2007-03-20T14:21:18.996577', '13893', '2'), - ('2.99', '560', '2007-04-29T17:44:16.996577', '8753', '1'), - ('4.99', '36', '2007-03-17T02:28:27.996577', '11616', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['25145', '29022', '28940', '18927', '18983', '18381', '23644', '28390', '28159', '19648', '18802', '26616', '20172', '23495', '18807', '20912', '28276', '19983', '18423', '30018', '24437', '21759', '28475', '29037', '31642', '17573', '27373', '30634', '28907', '19562', '29957', '20789', '31653', '25420', '28991', '17803', '20323', '21607', '29402', '31421', '22828', '27275', '27991', '24600', '26004', '23955', '18917', '24307', '30873', '24584', '19769', '18550', '21743', '27926', '30736', '24564', '28701', '27471', '20775', '19801', '30298', '22062', '18833', '28352', '29631', '32074', '17586', '18787', '18219', '29127', '20318', '24288', '25444', '27748', '30245', '20557', '20935', '30854', '28114', '30571', '32010', '28444', '26674', '27125', '20998', '21678', '28837', '31660', '22311', '26440', '25355', '18234', '25261', '28716', '19255', '27880', '20993', '25400', '23596', '21639']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('4.99', '266', '2007-03-01T18:28:07.996577', '10747', '2'), - ('10.99', '3', '2007-04-27T18:51:38.996577', '7503', '2'), - ('0.99', '204', '2007-04-30T03:33:24.996577', '9005', '2'), - ('5.99', '109', '2007-02-20T13:29:45.996577', '3076', '2'), - ('4.99', '123', '2007-02-16T16:56:45.996577', '1775', '2'), - ('4.99', '575', '2007-02-17T00:21:45.996577', '1866', '2'), - ('4.99', '103', '2007-03-21T05:27:15.996577', '14289', '2'), - ('2.99', '556', '2007-04-12T00:32:36.996577', '6484', '2'), - ('8.99', '532', '2007-04-10T13:37:07.996577', '5805', '2'), - ('0.99', '278', '2007-03-16T22:58:30.996577', '11531', '2'), - ('6.99', '78', '2007-02-20T04:34:19.996577', '2949', '2'), - ('4.99', '394', '2007-04-09T08:42:11.996577', '5183', '2'), - ('2.99', '338', '2007-03-21T16:38:29.996577', '14619', '1'), - ('4.99', '84', '2007-03-18T06:23:35.996577', '12364', '2'), - ('8.99', '80', '2007-02-19T17:57:43.996577', '2805', '2'), - ('0.99', '414', '2007-03-19T07:34:34.996577', '13042', '1'), - ('2.99', '543', '2007-04-27T11:31:40.996577', '7312', '2'), - ('7.99', '316', '2007-03-01T07:21:30.996577', '10438', '1'), - ('2.99', '588', '2007-02-17T02:04:25.996577', '1885', '2'), - ('0.99', '91', '2007-04-29T22:42:58.996577', '8873', '2'), - ('3.99', '182', '2007-03-17T09:23:12.996577', '11785', '2'), - ('2.99', '503', '2007-03-20T02:28:56.996577', '13551', '1'), - ('7.99', '563', '2007-04-29T20:16:06.996577', '8812', '2'), - ('4.99', '5', '2007-04-06T07:40:24.996577', '3677', '2'), - ('4.99', '241', '2007-04-09T20:02:58.996577', '5438', '1'), - ('2.99', '358', '2007-02-19T14:56:01.996577', '2749', '1'), - ('2.99', '463', '2007-04-09T07:20:38.996577', '5157', '1'), - ('7.99', '144', '2007-04-30T04:39:24.996577', '9034', '1'), - ('6.99', '599', '2007-04-30T02:21:03.996577', '8965', '1'), - ('3.99', '271', '2007-03-01T12:52:24.996577', '10599', '1'), - ('4.99', '87', '2007-04-29T02:21:25.996577', '8323', '2'), - ('4.99', '402', '2007-03-16T23:30:14.996577', '11549', '2'), - ('4.99', '242', '2007-04-05T21:20:10.996577', '3471', '1'), - ('0.99', '290', '2007-04-30T19:13:05.996577', '9413', '1'), - ('3.99', '208', '2007-04-30T14:56:19.996577', '9298', '2'), - ('3.99', '420', '2007-02-19T10:10:30.996577', '2672', '2'), - ('2.99', '353', '2007-03-23T07:51:34.996577', '15676', '2'), - ('2.99', '485', '2007-03-19T08:04:54.996577', '13055', '2'), - ('0.99', '37', '2007-04-28T11:14:13.996577', '7939', '2'), - ('5.99', '223', '2007-04-27T03:04:10.996577', '7085', '2'), - ('0.99', '15', '2007-03-21T14:59:48.996577', '14569', '2'), - ('1.99', '453', '2007-04-30T12:43:31.996577', '9900', '2'), - ('3.99', '518', '2007-04-28T17:31:42.996577', '8107', '1'), - ('3.99', '199', '2007-03-23T11:09:33.996577', '15751', '2'), - ('4.99', '340', '2007-04-29T09:41:37.996577', '8551', '2'), - ('4.99', '136', '2007-03-20T17:59:01.996577', '13992', '2'), - ('0.99', '107', '2007-02-20T20:52:26.996577', '3174', '2'), - ('4.99', '169', '2007-03-21T23:20:27.996577', '14805', '2'), - ('4.99', '166', '2007-04-09T08:43:00.996577', '5184', '1'), - ('1.99', '198', '2007-03-17T15:50:55.996577', '11957', '1'), - ('1.99', '293', '2007-03-02T07:38:30.996577', '11131', '2'), - ('4.99', '14', '2007-02-15T12:00:41.996577', '1360', '2'), - ('4.99', '502', '2007-03-02T04:24:55.996577', '11036', '2'), - ('0.99', '512', '2007-04-08T15:17:53.996577', '4799', '1'), - ('7.99', '154', '2007-04-06T13:38:07.996577', '3806', '2'), - ('4.99', '197', '2007-03-01T18:14:37.996577', '10739', '2'), - ('5.99', '582', '2007-04-27T15:13:00.996577', '7412', '2'), - ('3.99', '472', '2007-04-10T03:43:38.996577', '5612', '1'), - ('2.99', '400', '2007-03-19T22:45:27.996577', '13449', '2'), - ('3.99', '296', '2007-03-18T18:35:00.996577', '12689', '2'), - ('1.99', '115', '2007-04-27T13:14:25.996577', '7355', '2'), - ('0.99', '535', '2007-03-20T13:13:49.996577', '13852', '1'), - ('4.99', '86', '2007-02-16T07:04:05.996577', '1640', '2'), - ('7.99', '552', '2007-04-09T10:08:09.996577', '5213', '1'), - ('0.99', '57', '2007-04-30T06:47:12.996577', '9086', '1'), - ('4.99', '192', '2007-05-14T13:44:29.996577', '11611', '1'), - ('2.99', '361', '2007-02-21T06:02:40.996577', '3303', '2'), - ('4.99', '75', '2007-02-19T14:24:56.996577', '2738', '2'), - ('2.99', '528', '2007-02-17T01:13:36.996577', '1875', '2'), - ('5.99', '12', '2007-04-30T03:11:12.996577', '9627', '1'), - ('5.99', '353', '2007-03-19T03:32:35.996577', '12928', '1'), - ('4.99', '167', '2007-03-23T16:20:27.996577', '15915', '2'), - ('2.99', '292', '2007-04-27T20:16:29.996577', '7545', '1'), - ('4.99', '496', '2007-04-10T21:41:26.996577', '5949', '2'), - ('4.99', '111', '2007-04-07T12:33:43.996577', '4249', '1'), - ('7.99', '377', '2007-03-23T19:12:36.996577', '15999', '1'), - ('8.99', '416', '2007-03-18T20:02:19.996577', '12722', '1'), - ('6.99', '164', '2007-04-27T08:22:09.996577', '7227', '1'), - ('3.99', '528', '2007-04-29T16:38:23.996577', '8727', '1'), - ('0.99', '139', '2007-04-08T08:23:13.996577', '4660', '2'), - ('0.99', '5', '2007-05-14T13:44:29.996577', '13209', '2'), - ('2.99', '561', '2007-04-11T19:37:40.996577', '6361', '2'), - ('5.99', '400', '2007-04-12T15:03:25.996577', '6790', '2'), - ('0.99', '440', '2007-04-10T12:21:22.996577', '5782', '2'), - ('2.99', '422', '2007-03-17T03:47:43.996577', '11658', '1'), - ('5.99', '494', '2007-03-21T17:19:54.996577', '14634', '2'), - ('2.99', '593', '2007-04-29T07:35:29.996577', '8497', '1'), - ('3.99', '242', '2007-04-30T19:38:40.996577', '9423', '1'), - ('1.99', '564', '2007-03-01T04:13:02.996577', '10352', '2'), - ('3.99', '377', '2007-04-30T20:57:39.996577', '9461', '2'), - ('9.99', '285', '2007-04-27T16:55:05.996577', '7452', '1'), - ('6.99', '533', '2007-02-19T16:22:48.996577', '2770', '2'), - ('4.99', '277', '2007-04-27T15:40:13.996577', '7423', '2'), - ('7.99', '583', '2007-04-29T10:06:48.996577', '8568', '2'), - ('3.99', '194', '2007-02-18T18:30:09.996577', '2463', '1'), - ('9.99', '508', '2007-04-10T06:02:09.996577', '5657', '2'), - ('4.99', '421', '2007-03-20T13:38:56.996577', '13872', '1'), - ('4.99', '289', '2007-04-10T02:43:51.996577', '5584', '2'), - ('3.99', '96', '2007-03-17T16:44:56.996577', '11984', '1'), - ('4.99', '489', '2007-03-19T23:17:45.996577', '13462', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['22333', '22915', '19479', '25345', '25404', '20390', '28766', '30645', '28480', '22941', '18613', '31106', '19627', '20817', '31977', '22905', '26179', '22270', '24929', '26785', '25583', '28083', '30518', '31856', '24276', '31382', '28359', '23944', '29478', '18658', '25759', '23165', '25738', '25964', '28814', '28728', '21353', '30570', '30272', '26489', '27882', '32012', '22541', '31670', '31993', '17606', '27028', '31634', '27814', '28393', '18054', '30131', '17820', '27070', '25568', '25575', '18786', '28898', '20853', '19437', '31254', '30531', '28025', '29763', '30751', '29250', '21870', '31733', '19539', '30663', '21817', '31053', '31612', '23982', '22088', '24070', '28449', '25241', '25256', '25242', '18545', '19534', '30932', '25435', '20280', '26230', '31242', '22630', '24085', '23949', '21288', '28655', '25377', '20940', '28441', '20668', '26191', '31276', '24204', '29458']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('0.99', '565', '2007-03-19T19:36:20.996577', '13362', '1'), - ('8.99', '24', '2007-03-17T23:22:03.996577', '12165', '2'), - ('2.99', '260', '2007-02-17T10:03:35.996577', '2001', '2'), - ('0.99', '284', '2007-04-30T09:02:34.996577', '9790', '1'), - ('4.99', '289', '2007-04-27T05:42:57.996577', '7151', '1'), - ('0.99', '361', '2007-03-19T10:51:18.996577', '13135', '1'), - ('2.99', '588', '2007-04-27T13:59:54.996577', '7377', '2'), - ('1.99', '145', '2007-04-11T18:13:58.996577', '6339', '1'), - ('4.99', '564', '2007-04-29T05:36:14.996577', '8426', '2'), - ('7.99', '26', '2007-03-23T09:44:55.996577', '15722', '1'), - ('0.99', '28', '2007-02-21T00:53:26.996577', '3231', '1'), - ('0.99', '185', '2007-04-30T12:40:57.996577', '9246', '2'), - ('4.99', '276', '2007-03-18T17:01:46.996577', '12650', '1'), - ('10.99', '404', '2007-03-22T17:56:28.996577', '15290', '2'), - ('2.99', '496', '2007-05-14T13:44:29.996577', '13182', '1'), - ('2.99', '23', '2007-03-16T21:33:19.996577', '11501', '2'), - ('0.99', '356', '2007-04-09T23:34:07.996577', '5513', '1'), - ('4.99', '559', '2007-03-21T07:07:52.996577', '14342', '1'), - ('2.99', '243', '2007-03-19T17:00:37.996577', '13291', '1'), - ('0.99', '409', '2007-04-09T19:24:13.996577', '5422', '1'), - ('2.99', '303', '2007-04-27T18:47:34.996577', '7502', '2'), - ('4.99', '526', '2007-04-11T21:18:16.996577', '6404', '1'), - ('0.99', '135', '2007-04-10T01:12:53.996577', '5541', '1'), - ('0.99', '262', '2007-04-08T00:40:26.996577', '4501', '1'), - ('2.99', '166', '2007-03-22T15:25:28.996577', '15216', '2'), - ('2.99', '220', '2007-04-08T20:05:57.996577', '4918', '2'), - ('8.99', '552', '2007-04-30T16:38:22.996577', '9342', '1'), - ('3.99', '135', '2007-03-01T16:53:07.996577', '10698', '1'), - ('3.99', '42', '2007-04-30T00:10:35.996577', '8915', '2'), - ('4.99', '38', '2007-02-20T08:29:17.996577', '3003', '2'), - ('2.99', '319', '2007-04-28T11:52:58.996577', '7953', '2'), - ('2.99', '51', '2007-03-02T14:06:29.996577', '11302', '1'), - ('2.99', '317', '2007-04-28T15:43:32.996577', '8062', '2'), - ('6.99', '337', '2007-04-07T04:22:04.996577', '4091', '1'), - ('11.99', '592', '2007-04-06T21:26:57.996577', '3973', '1'), - ('3.99', '584', '2007-04-30T20:38:43.996577', '9451', '2'), - ('5.99', '460', '2007-03-17T19:32:14.996577', '12056', '1'), - ('4.99', '138', '2007-04-30T22:56:19.996577', '10190', '2'), - ('6.99', '113', '2007-04-30T11:48:32.996577', '9221', '2'), - ('0.99', '382', '2007-04-10T14:17:13.996577', '5816', '1'), - ('4.99', '508', '2007-04-11T05:18:59.996577', '6101', '1'), - ('0.99', '11', '2007-05-14T13:44:29.996577', '11646', '1'), - ('6.99', '589', '2007-03-20T20:07:49.996577', '14038', '1'), - ('4.99', '243', '2007-04-29T21:10:14.996577', '8834', '1'), - ('2.99', '550', '2007-05-14T13:44:29.996577', '11757', '2'), - ('0.99', '365', '2007-02-20T19:32:12.996577', '3156', '2'), - ('2.99', '432', '2007-04-09T09:22:40.996577', '5204', '1'), - ('4.99', '240', '2007-04-27T17:48:51.996577', '7481', '2'), - ('5.99', '502', '2007-04-09T17:10:25.996577', '5368', '2'), - ('0.99', '557', '2007-04-08T08:08:05.996577', '4651', '1'), - ('0.99', '481', '2007-02-21T05:27:59.996577', '3293', '2'), - ('6.99', '101', '2007-04-30T14:47:58.996577', '9965', '2'), - ('0.99', '424', '2007-02-21T14:26:18.996577', '3404', '2'), - ('4.99', '435', '2007-04-30T10:27:04.996577', '9829', '2'), - ('7.99', '302', '2007-04-12T07:34:00.996577', '6623', '2'), - ('2.99', '302', '2007-04-30T17:05:50.996577', '9358', '2'), - ('7.99', '75', '2007-02-17T22:08:16.996577', '2161', '1'), - ('0.99', '598', '2007-04-28T13:37:14.996577', '7998', '1'), - ('0.99', '408', '2007-03-19T02:32:15.996577', '12900', '2'), - ('2.99', '249', '2007-02-16T15:36:43.996577', '1753', '2'), - ('4.99', '201', '2007-04-05T23:41:53.996577', '3528', '2'), - ('3.99', '136', '2007-04-10T04:19:38.996577', '5627', '1'), - ('0.99', '521', '2007-04-10T07:34:29.996577', '5686', '2'), - ('4.99', '70', '2007-04-27T01:34:38.996577', '7036', '2'), - ('5.99', '155', '2007-04-11T03:01:08.996577', '6066', '1'), - ('4.99', '25', '2007-04-12T09:34:43.996577', '6653', '1'), - ('4.99', '515', '2007-03-17T00:06:21.996577', '11572', '2'), - ('4.99', '250', '2007-04-06T05:24:02.996577', '3635', '1'), - ('2.99', '269', '2007-03-01T11:40:37.996577', '10566', '2'), - ('0.99', '147', '2007-04-09T01:58:51.996577', '5044', '2'), - ('2.99', '509', '2007-03-23T18:15:05.996577', '15965', '1'), - ('4.99', '181', '2007-04-07T20:58:06.996577', '4428', '2'), - ('4.99', '238', '2007-04-30T05:53:35.996577', '9065', '1'), - ('4.99', '138', '2007-03-21T10:04:41.996577', '14432', '2'), - ('2.99', '538', '2007-03-21T15:12:57.996577', '14572', '2'), - ('7.99', '146', '2007-03-17T21:59:51.996577', '12129', '1'), - ('10.99', '561', '2007-04-29T07:48:42.996577', '8504', '1'), - ('2.99', '275', '2007-04-30T12:59:57.996577', '9258', '2'), - ('5.99', '277', '2007-04-08T23:14:07.996577', '4987', '2'), - ('2.99', '276', '2007-04-06T09:19:54.996577', '3714', '2'), - ('0.99', '12', '2007-02-21T14:59:53.996577', '3411', '1'), - ('5.99', '268', '2007-03-20T13:46:46.996577', '13880', '2'), - ('7.99', '170', '2007-04-28T13:38:40.996577', '7999', '1'), - ('0.99', '292', '2007-04-06T01:17:05.996577', '3557', '2'), - ('4.99', '348', '2007-03-23T17:19:20.996577', '15944', '1'), - ('2.99', '360', '2007-04-28T22:15:07.996577', '8220', '1'), - ('4.99', '199', '2007-04-30T14:32:48.996577', '9959', '1'), - ('0.99', '202', '2007-03-22T10:10:01.996577', '15095', '1'), - ('0.99', '147', '2007-03-21T17:33:49.996577', '14641', '2'), - ('0.99', '135', '2007-03-20T18:47:31.996577', '14005', '1'), - ('4.99', '453', '2007-03-21T18:00:31.996577', '14652', '1'), - ('2.99', '579', '2007-04-08T20:46:55.996577', '4933', '1'), - ('1.99', '287', '2007-04-09T15:57:27.996577', '5346', '2'), - ('2.99', '416', '2007-03-23T09:57:15.996577', '15727', '1'), - ('4.99', '560', '2007-04-29T23:50:05.996577', '8906', '2'), - ('4.99', '389', '2007-03-02T15:47:04.996577', '11348', '2'), - ('0.99', '357', '2007-04-07T23:07:34.996577', '4478', '1'), - ('4.99', '210', '2007-04-06T01:25:27.996577', '3563', '2'), - ('2.99', '158', '2007-03-02T18:16:22.996577', '11420', '1'), - ('6.99', '41', '2007-04-28T18:29:49.996577', '8134', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['21869', '27407', '30281', '21105', '30956', '26180', '28482', '29999', '30835', '28106', '17893', '23180', '27677', '18043', '23545', '27842', '32081', '26228', '24959', '27403', '29934', '19719', '19353', '30386', '26517', '21531', '30977', '30495', '29315', '19513', '23187', '23457', '26717', '21198', '24141', '24072', '30349', '29624', '24183', '20474', '20189', '24571', '20163', '28137', '27008', '21277', '31308', '22968', '22159', '22442', '26689', '28905', '28198', '25431', '23994', '29913', '27971', '24292', '26496', '30888', '23353', '29227', '25395', '24208', '27877', '19537', '31467', '18141', '22441', '22974', '19614', '30120', '22022', '20809', '31730', '29054', '24175', '32054', '22629', '25608', '21974', '31067', '24279', '31183', '28586', '23447', '31457', '18922', '24382', '21832', '27833', '25436', '30324', '19293', '27080', '26884', '28706', '21425', '29960', '31437']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('3.99', '515', '2007-03-02T19:14:22.996577', '11451', '1'), - ('6.99', '467', '2007-04-28T15:41:19.996577', '8061', '2'), - ('4.99', '114', '2007-04-12T13:27:50.996577', '6754', '1'), - ('1.99', '435', '2007-03-21T22:08:54.996577', '14765', '1'), - ('6.99', '172', '2007-04-30T01:40:10.996577', '8944', '2'), - ('4.99', '356', '2007-04-12T05:49:43.996577', '6593', '1'), - ('3.99', '564', '2007-04-30T05:53:00.996577', '9063', '2'), - ('0.99', '90', '2007-04-29T05:09:06.996577', '8408', '1'), - ('5.99', '162', '2007-04-30T18:58:58.996577', '10093', '2'), - ('4.99', '528', '2007-04-06T06:13:57.996577', '3654', '2'), - ('7.99', '444', '2007-02-21T06:00:51.996577', '3301', '2'), - ('0.99', '52', '2007-03-02T05:36:33.996577', '11068', '1'), - ('5.99', '490', '2007-04-08T19:27:39.996577', '4906', '1'), - ('2.99', '479', '2007-02-17T03:04:18.996577', '1902', '1'), - ('4.99', '90', '2007-03-02T11:30:37.996577', '11231', '2'), - ('3.99', '504', '2007-04-27T12:53:43.996577', '7342', '2'), - ('2.99', '213', '2007-05-14T13:44:29.996577', '14374', '2'), - ('4.99', '360', '2007-04-28T00:28:40.996577', '7654', '1'), - ('1.99', '247', '2007-03-01T01:55:10.996577', '10279', '1'), - ('2.99', '467', '2007-04-27T13:20:32.996577', '7360', '2'), - ('0.99', '85', '2007-04-28T10:00:08.996577', '7906', '2'), - ('2.99', '287', '2007-03-01T12:05:17.996577', '10574', '2'), - ('2.99', '228', '2007-02-19T22:27:04.996577', '2863', '2'), - ('4.99', '123', '2007-04-30T17:58:27.996577', '10066', '1'), - ('4.99', '385', '2007-04-11T23:05:28.996577', '6445', '1'), - ('6.99', '476', '2007-03-01T21:36:22.996577', '10826', '1'), - ('4.99', '174', '2007-04-29T17:46:56.996577', '8754', '1'), - ('0.99', '132', '2007-04-27T16:00:06.996577', '7432', '2'), - ('0.99', '30', '2007-04-11T13:30:28.996577', '6249', '1'), - ('6.99', '267', '2007-02-19T03:24:53.996577', '2582', '1'), - ('6.99', '52', '2007-03-22T05:04:16.996577', '14961', '2'), - ('0.99', '80', '2007-03-22T03:25:23.996577', '14916', '1'), - ('8.99', '404', '2007-04-08T06:15:19.996577', '4615', '2'), - ('0.99', '444', '2007-03-23T03:20:43.996577', '15557', '1'), - ('2.99', '151', '2007-03-23T16:49:22.996577', '15926', '1'), - ('4.99', '146', '2007-03-19T02:09:35.996577', '12888', '1'), - ('1.99', '120', '2007-04-29T17:47:23.996577', '8756', '2'), - ('4.99', '57', '2007-04-09T02:56:29.996577', '5060', '1'), - ('5.99', '156', '2007-03-17T00:49:29.996577', '11587', '1'), - ('0.99', '370', '2007-03-19T07:23:45.996577', '13039', '1'), - ('0.99', '340', '2007-03-01T21:07:53.996577', '10809', '1'), - ('0.99', '197', '2007-03-18T22:55:27.996577', '12799', '1'), - ('4.99', '337', '2007-03-22T16:16:06.996577', '15241', '2'), - ('0.99', '530', '2007-04-29T16:59:41.996577', '8736', '1'), - ('6.99', '429', '2007-04-26T23:09:16.996577', '6977', '1'), - ('4.99', '452', '2007-03-19T08:46:26.996577', '13080', '1'), - ('3.99', '211', '2007-04-30T07:34:10.996577', '9111', '1'), - ('6.99', '29', '2007-03-18T13:49:12.996577', '12569', '2'), - ('4.99', '546', '2007-03-23T03:41:35.996577', '15565', '2'), - ('2.99', '577', '2007-03-23T14:56:25.996577', '15873', '2'), - ('4.99', '401', '2007-04-30T06:00:47.996577', '9701', '2'), - ('9.99', '599', '2007-04-12T15:32:22.996577', '6800', '2'), - ('4.99', '535', '2007-04-30T23:29:32.996577', '9524', '1'), - ('4.99', '291', '2007-04-29T15:14:33.996577', '8697', '2'), - ('2.99', '139', '2007-03-22T09:03:05.996577', '15062', '1'), - ('2.99', '83', '2007-04-11T10:19:26.996577', '6194', '2'), - ('4.99', '517', '2007-04-07T18:42:24.996577', '4374', '2'), - ('1.99', '168', '2007-03-17T02:57:22.996577', '11631', '1'), - ('5.99', '383', '2007-04-08T12:21:27.996577', '4747', '2'), - ('2.99', '167', '2007-04-10T12:17:56.996577', '5781', '1'), - ('3.99', '70', '2007-03-19T04:25:10.996577', '12951', '1'), - ('2.99', '23', '2007-04-11T11:11:33.996577', '6213', '1'), - ('0.99', '288', '2007-04-30T07:24:34.996577', '9732', '1'), - ('2.99', '158', '2007-03-20T13:17:08.996577', '13854', '2'), - ('2.99', '507', '2007-04-29T03:44:08.996577', '8369', '2'), - ('0.99', '268', '2007-03-22T02:00:31.996577', '14874', '1'), - ('0.99', '227', '2007-04-29T04:07:09.996577', '8384', '1'), - ('2.99', '509', '2007-02-15T05:49:47.996577', '1267', '1'), - ('2.99', '577', '2007-03-23T00:25:46.996577', '15480', '2'), - ('0.99', '29', '2007-03-21T01:30:11.996577', '14174', '1'), - ('5.99', '275', '2007-03-21T02:00:29.996577', '14187', '1'), - ('2.99', '101', '2007-04-08T22:31:12.996577', '4975', '1'), - ('2.99', '532', '2007-03-02T12:09:15.996577', '11251', '2'), - ('8.99', '404', '2007-03-18T13:15:54.996577', '12554', '1'), - ('7.99', '249', '2007-04-27T20:16:03.996577', '7544', '1'), - ('2.99', '6', '2007-04-07T13:21:50.996577', '4278', '2'), - ('5.99', '155', '2007-03-17T15:42:28.996577', '11951', '2'), - ('2.99', '115', '2007-05-14T13:44:29.996577', '13056', '2'), - ('3.99', '202', '2007-03-20T19:27:41.996577', '14019', '1'), - ('4.99', '305', '2007-04-29T22:23:20.996577', '8865', '2'), - ('3.99', '527', '2007-03-01T08:52:09.996577', '10486', '2'), - ('0.99', '182', '2007-04-07T17:31:03.996577', '4349', '1'), - ('4.99', '167', '2007-03-18T16:47:42.996577', '12642', '1'), - ('2.99', '195', '2007-04-07T16:08:52.996577', '4315', '1'), - ('4.99', '573', '2007-04-29T04:52:22.996577', '8400', '1'), - ('6.99', '80', '2007-03-01T15:06:30.996577', '10656', '1'), - ('2.99', '226', '2007-04-29T11:29:45.996577', '8600', '2'), - ('4.99', '108', '2007-02-20T16:33:21.996577', '3116', '2'), - ('5.99', '177', '2007-03-02T16:44:26.996577', '11376', '1'), - ('9.99', '512', '2007-03-17T10:50:30.996577', '11818', '2'), - ('4.99', '503', '2007-04-26T22:13:59.996577', '6950', '2'), - ('4.99', '292', '2007-04-07T09:43:37.996577', '4200', '1'), - ('4.99', '118', '2007-04-28T07:59:39.996577', '7850', '1'), - ('2.99', '210', '2007-02-14T23:01:30.996577', '1177', '2'), - ('9.99', '436', '2007-04-30T16:42:17.996577', '9345', '1'), - ('4.99', '419', '2007-04-06T08:29:49.996577', '3694', '1'), - ('9.99', '582', '2007-04-30T08:17:07.996577', '9768', '1'), - ('4.99', '467', '2007-03-17T12:45:06.996577', '11874', '1'), - ('8.99', '87', '2007-04-30T17:13:10.996577', '9364', '2'), - ('4.99', '225', '2007-04-09T03:21:01.996577', '5067', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['21410', '29202', '27966', '22305', '29820', '21077', '28216', '31061', '28495', '28770', '22023', '28124', '28213', '28864', '31049', '22647', '25438', '29372', '26351', '29668', '21468', '31105', '25411', '24363', '19443', '20555', '30344', '24560', '20806', '20854', '28168', '29241', '23952', '31261', '22077', '19484', '19888', '26296', '29020', '20550', '27709', '19178', '25095', '27268', '22423', '30505', '19256', '23351', '24503', '29595', '18103', '28939', '30400', '20805', '27617', '30765', '19133', '19508', '19064', '23297', '18175', '20165', '24251', '22760', '23770', '27545', '24763', '24682', '30250', '30847', '30872', '21584', '24576', '28382', '20989', '19741', '27543', '24020', '18942', '19512', '29371', '21923', '29634', '26809', '21238', '28741', '28380', '24989', '26098', '24783', '31335', '28111', '27469', '31550', '23450', '25277', '30600', '28189', '29997', '29412']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('4.99', '465', '2007-03-19T01:06:52.996577', '12864', '1'), - ('6.99', '20', '2007-04-11T14:21:26.996577', '6267', '2'), - ('2.99', '516', '2007-04-29T10:42:44.996577', '8585', '2'), - ('2.99', '563', '2007-03-19T00:10:10.996577', '12832', '1'), - ('2.99', '75', '2007-04-09T12:34:11.996577', '5260', '2'), - ('6.99', '432', '2007-03-23T09:24:41.996577', '15713', '1'), - ('4.99', '537', '2007-04-11T21:34:15.996577', '6409', '1'), - ('5.99', '181', '2007-04-30T12:15:43.996577', '9235', '2'), - ('5.99', '565', '2007-04-30T16:57:35.996577', '10025', '1'), - ('2.99', '588', '2007-04-29T08:38:09.996577', '8519', '2'), - ('4.99', '532', '2007-03-02T14:37:37.996577', '11318', '2'), - ('7.99', '529', '2007-04-12T20:37:12.996577', '6908', '1'), - ('2.99', '537', '2007-04-10T04:36:40.996577', '5630', '1'), - ('4.99', '595', '2007-04-27T14:32:19.996577', '7396', '1'), - ('5.99', '180', '2007-04-29T16:16:58.996577', '8720', '2'), - ('4.99', '204', '2007-03-21T01:25:18.996577', '14163', '2'), - ('0.99', '292', '2007-04-09T12:25:09.996577', '5257', '2'), - ('0.99', '35', '2007-04-08T23:17:15.996577', '4990', '2'), - ('0.99', '370', '2007-04-26T22:45:11.996577', '6968', '1'), - ('4.99', '61', '2007-04-28T16:05:54.996577', '8075', '2'), - ('3.99', '470', '2007-03-17T23:44:13.996577', '12177', '2'), - ('8.99', '185', '2007-04-29T14:44:59.996577', '8684', '1'), - ('2.99', '290', '2007-04-09T05:07:25.996577', '5105', '1'), - ('6.99', '175', '2007-03-20T18:19:54.996577', '13997', '2'), - ('2.99', '251', '2007-02-21T20:37:24.996577', '3464', '1'), - ('0.99', '377', '2007-03-22T09:56:52.996577', '15088', '2'), - ('1.99', '120', '2007-04-08T21:11:13.996577', '4942', '1'), - ('5.99', '196', '2007-03-21T19:18:24.996577', '14698', '1'), - ('4.99', '403', '2007-03-22T21:56:09.996577', '15410', '1'), - ('7.99', '408', '2007-03-20T00:41:20.996577', '13508', '1'), - ('8.99', '533', '2007-04-07T05:17:35.996577', '4112', '1'), - ('4.99', '24', '2007-04-12T18:14:55.996577', '6855', '1'), - ('10.99', '136', '2007-03-17T16:55:48.996577', '11992', '2'), - ('5.99', '209', '2007-04-07T15:58:07.996577', '4309', '1'), - ('4.99', '537', '2007-03-20T18:58:12.996577', '14010', '1'), - ('3.99', '260', '2007-02-20T05:24:46.996577', '2958', '2'), - ('5.99', '305', '2007-03-02T04:24:05.996577', '11035', '2'), - ('2.99', '366', '2007-04-07T13:19:25.996577', '4276', '2'), - ('4.99', '3', '2007-04-08T11:15:37.996577', '4725', '1'), - ('2.99', '377', '2007-03-02T01:45:55.996577', '10943', '1'), - ('4.99', '493', '2007-04-12T03:33:32.996577', '6552', '1'), - ('2.99', '177', '2007-02-15T14:41:16.996577', '1393', '1'), - ('6.99', '260', '2007-03-21T16:27:35.996577', '14610', '1'), - ('4.99', '453', '2007-04-08T10:51:09.996577', '4717', '1'), - ('0.99', '575', '2007-03-23T14:28:17.996577', '15857', '2'), - ('0.99', '133', '2007-04-27T14:45:03.996577', '7400', '1'), - ('3.99', '194', '2007-02-19T18:01:19.996577', '2807', '1'), - ('4.99', '70', '2007-03-18T01:16:40.996577', '12218', '2'), - ('3.99', '189', '2007-03-20T10:10:27.996577', '13766', '1'), - ('4.99', '53', '2007-04-28T02:20:47.996577', '7699', '1'), - ('6.99', '498', '2007-02-15T04:34:59.996577', '1253', '1'), - ('4.99', '204', '2007-04-27T14:29:31.996577', '7392', '1'), - ('4.99', '125', '2007-04-27T12:08:06.996577', '7323', '1'), - ('4.99', '403', '2007-03-21T20:30:34.996577', '14725', '2'), - ('3.99', '485', '2007-04-07T06:45:32.996577', '4137', '2'), - ('2.99', '156', '2007-04-27T14:24:41.996577', '7389', '2'), - ('2.99', '164', '2007-02-19T03:49:53.996577', '2589', '2'), - ('4.99', '266', '2007-02-20T12:07:07.996577', '3059', '1'), - ('2.99', '146', '2007-02-17T17:15:52.996577', '2099', '2'), - ('0.99', '64', '2007-03-18T08:12:24.996577', '12409', '1'), - ('10.99', '516', '2007-02-16T13:20:28.996577', '1718', '1'), - ('2.99', '338', '2007-03-01T20:10:18.996577', '10791', '2'), - ('2.99', '163', '2007-03-17T02:44:13.996577', '11623', '2'), - ('2.99', '8', '2007-03-18T15:44:27.996577', '12613', '1'), - ('6.99', '118', '2007-03-19T13:02:11.996577', '13193', '2'), - ('0.99', '479', '2007-04-09T22:20:23.996577', '5481', '1'), - ('4.99', '224', '2007-03-19T08:38:36.996577', '13075', '2'), - ('4.99', '214', '2007-03-20T13:28:21.996577', '13864', '1'), - ('2.99', '111', '2007-04-30T17:19:06.996577', '10039', '2'), - ('4.99', '164', '2007-04-08T02:50:20.996577', '4548', '2'), - ('0.99', '166', '2007-04-08T08:19:37.996577', '4658', '1'), - ('5.99', '482', '2007-03-23T14:09:46.996577', '15849', '1'), - ('0.99', '197', '2007-03-22T16:10:19.996577', '15233', '2'), - ('3.99', '555', '2007-04-28T23:05:35.996577', '8245', '1'), - ('4.99', '421', '2007-03-02T12:30:45.996577', '11263', '1'), - ('0.99', '289', '2007-03-17T23:34:36.996577', '12170', '1'), - ('0.99', '479', '2007-04-06T13:26:19.996577', '3798', '1'), - ('0.99', '141', '2007-03-22T18:23:18.996577', '15309', '1'), - ('0.99', '113', '2007-02-20T08:33:02.996577', '3004', '2'), - ('7.99', '267', '2007-02-19T03:08:32.996577', '2578', '2'), - ('4.99', '35', '2007-04-07T04:43:17.996577', '4098', '2'), - ('7.99', '520', '2007-03-23T17:27:59.996577', '15948', '1'), - ('0.99', '57', '2007-04-30T06:03:18.996577', '9703', '1'), - ('2.99', '410', '2007-04-30T13:16:50.996577', '9263', '1'), - ('2.99', '448', '2007-03-21T19:50:33.996577', '14711', '1'), - ('8.99', '585', '2007-04-30T18:53:50.996577', '9407', '2'), - ('2.99', '555', '2007-04-08T17:52:43.996577', '4875', '2'), - ('0.99', '251', '2007-03-17T06:59:29.996577', '11733', '1'), - ('4.99', '348', '2007-04-29T14:43:52.996577', '8682', '2'), - ('4.99', '226', '2007-03-23T15:47:43.996577', '15901', '1'), - ('5.99', '214', '2007-04-28T07:04:17.996577', '7826', '2'), - ('0.99', '528', '2007-04-12T03:52:28.996577', '6561', '2'), - ('6.99', '472', '2007-04-06T13:55:02.996577', '3815', '2'), - ('0.99', '233', '2007-04-29T11:17:20.996577', '8596', '2'), - ('0.99', '80', '2007-03-17T11:37:11.996577', '11839', '2'), - ('9.99', '279', '2007-04-09T16:43:58.996577', '5361', '1'), - ('2.99', '141', '2007-04-30T05:15:39.996577', '9683', '2'), - ('6.99', '535', '2007-04-08T11:00:34.996577', '4718', '1'), - ('6.99', '90', '2007-04-28T11:29:48.996577', '7946', '1'), - ('5.99', '38', '2007-04-12T18:27:51.996577', '6864', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['28167', '31259', '17798', '20677', '23698', '18214', '26793', '31362', '19057', '29602', '22656', '26074', '29247', '22401', '30232', '31909', '27183', '18940', '19811', '22252', '29343', '18356', '29449', '28422', '26620', '30002', '23943', '31838', '17530', '23034', '17517', '32057', '19751', '24812', '29502', '22400', '19002', '29708', '25572', '24620', '25229', '21875', '25340', '18493', '23578', '25498', '26094', '32072', '25540', '24087', '29407', '26589', '24736', '24428', '21893', '25193', '18403', '29111', '29334', '24061', '27603', '28765', '24831', '30927', '23260', '18535', '29642', '19666', '29410', '19265', '19894', '24280', '29886', '31227', '29855', '19068', '23236', '28849', '30122', '20913', '20433', '18277', '17744', '26316', '30359', '18137', '18410', '30454', '27834', '20056', '20952', '20875', '27415', '19166', '21173', '31465', '27766', '28193', '23643', '20272']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('2.99', '532', '2007-04-30T10:53:54.996577', '9843', '1'), - ('2.99', '209', '2007-04-05T22:46:55.996577', '3504', '2'), - ('3.99', '417', '2007-02-17T04:32:42.996577', '1921', '1'), - ('5.99', '390', '2007-03-17T21:23:11.996577', '12105', '1'), - ('2.99', '110', '2007-03-20T08:33:56.996577', '13723', '1'), - ('6.99', '526', '2007-02-21T09:05:37.996577', '3339', '1'), - ('5.99', '409', '2007-04-28T23:48:41.996577', '8265', '2'), - ('4.99', '218', '2007-04-27T03:12:19.996577', '7090', '2'), - ('4.99', '144', '2007-02-20T09:40:18.996577', '3019', '2'), - ('7.99', '54', '2007-04-11T18:08:07.996577', '6338', '1'), - ('0.99', '205', '2007-03-22T22:22:40.996577', '15418', '2'), - ('0.99', '347', '2007-04-28T06:34:27.996577', '7811', '1'), - ('0.99', '25', '2007-04-07T16:18:53.996577', '4319', '1'), - ('1.99', '573', '2007-03-17T21:52:51.996577', '12125', '1'), - ('3.99', '109', '2007-04-28T13:44:07.996577', '8006', '1'), - ('2.99', '266', '2007-04-29T07:32:43.996577', '8492', '1'), - ('0.99', '445', '2007-04-07T01:31:59.996577', '4041', '1'), - ('2.99', '113', '2007-02-18T05:16:49.996577', '2282', '1'), - ('0.99', '297', '2007-03-02T18:03:45.996577', '11413', '2'), - ('5.99', '557', '2007-03-23T03:53:21.996577', '15570', '2'), - ('0.99', '32', '2007-04-10T11:41:44.996577', '5767', '1'), - ('2.99', '570', '2007-02-16T19:01:41.996577', '1804', '2'), - ('2.99', '41', '2007-04-06T14:20:29.996577', '3827', '2'), - ('4.99', '559', '2007-04-11T10:46:33.996577', '6201', '1'), - ('0.99', '394', '2007-04-30T09:07:25.996577', '9147', '1'), - ('7.99', '90', '2007-04-30T23:21:06.996577', '10206', '2'), - ('2.99', '135', '2007-03-01T13:22:18.996577', '10611', '1'), - ('2.99', '260', '2007-04-11T17:37:59.996577', '6328', '2'), - ('0.99', '347', '2007-02-18T04:59:41.996577', '2274', '2'), - ('4.99', '36', '2007-03-17T10:35:20.996577', '11813', '1'), - ('8.99', '343', '2007-02-20T07:03:29.996577', '2980', '1'), - ('0.99', '142', '2007-05-14T13:44:29.996577', '15454', '1'), - ('2.99', '290', '2007-03-02T00:04:10.996577', '10901', '1'), - ('2.99', '231', '2007-03-02T06:54:50.996577', '11113', '2'), - ('0.99', '45', '2007-04-08T16:55:54.996577', '4843', '1'), - ('1.99', '573', '2007-03-17T18:02:15.996577', '12017', '1'), - ('3.99', '129', '2007-02-21T00:11:52.996577', '3219', '1'), - ('3.99', '64', '2007-04-30T13:33:23.996577', '9924', '1'), - ('0.99', '302', '2007-04-29T13:17:14.996577', '8646', '2'), - ('5.99', '201', '2007-03-23T18:34:30.996577', '15974', '2'), - ('7.99', '274', '2007-04-29T08:29:14.996577', '8517', '2'), - ('5.99', '515', '2007-03-19T02:09:57.996577', '12889', '1'), - ('2.99', '284', '2007-04-26T23:22:07.996577', '6982', '2'), - ('2.99', '208', '2007-02-19T11:54:19.996577', '2695', '1'), - ('4.99', '93', '2007-03-20T18:00:55.996577', '13993', '1'), - ('5.99', '296', '2007-04-11T21:03:15.996577', '6398', '1'), - ('6.99', '348', '2007-04-27T17:52:42.996577', '7482', '1'), - ('4.99', '190', '2007-05-14T13:44:29.996577', '15167', '2'), - ('0.99', '300', '2007-04-07T00:54:08.996577', '4030', '1'), - ('2.99', '147', '2007-03-22T08:37:45.996577', '15052', '1'), - ('4.99', '38', '2007-04-07T15:04:42.996577', '4300', '1'), - ('0.99', '391', '2007-04-30T11:58:13.996577', '9225', '1'), - ('2.99', '220', '2007-03-19T10:23:39.996577', '13123', '2'), - ('2.99', '181', '2007-03-18T18:09:53.996577', '12678', '1'), - ('5.99', '517', '2007-03-23T03:23:31.996577', '15559', '1'), - ('1.99', '271', '2007-04-06T05:40:52.996577', '3640', '1'), - ('7.99', '582', '2007-02-18T09:43:53.996577', '2337', '1'), - ('2.99', '11', '2007-04-28T17:11:37.996577', '8100', '2'), - ('3.99', '31', '2007-04-27T05:15:39.996577', '7138', '2'), - ('0.99', '145', '2007-03-19T16:17:39.996577', '13272', '2'), - ('6.99', '484', '2007-04-10T17:03:40.996577', '5866', '2'), - ('4.99', '588', '2007-04-11T19:47:27.996577', '6368', '1'), - ('5.99', '233', '2007-03-18T09:19:25.996577', '12443', '1'), - ('0.99', '170', '2007-04-07T22:46:25.996577', '4468', '2'), - ('4.99', '60', '2007-03-02T06:27:16.996577', '11092', '1'), - ('0.99', '10', '2007-02-19T18:30:25.996577', '2814', '1'), - ('0.99', '58', '2007-04-29T22:02:47.996577', '8853', '1'), - ('5.99', '279', '2007-03-21T22:29:22.996577', '14779', '1'), - ('2.99', '38', '2007-04-09T21:14:40.996577', '5460', '2'), - ('2.99', '197', '2007-02-14T22:43:41.996577', '1175', '2'), - ('6.99', '305', '2007-03-23T05:27:33.996577', '15612', '1'), - ('4.99', '167', '2007-03-18T19:44:06.996577', '12717', '2'), - ('5.99', '80', '2007-04-11T10:44:29.996577', '6199', '1'), - ('5.99', '198', '2007-04-28T19:03:07.996577', '8145', '1'), - ('2.99', '78', '2007-04-08T06:53:05.996577', '4627', '2'), - ('4.99', '146', '2007-02-20T17:36:26.996577', '3131', '1'), - ('0.99', '57', '2007-03-23T03:54:56.996577', '15571', '2'), - ('2.99', '594', '2007-04-29T11:35:33.996577', '8603', '1'), - ('5.99', '101', '2007-04-09T06:08:58.996577', '5132', '1'), - ('2.99', '414', '2007-03-19T14:57:13.996577', '13242', '1'), - ('4.99', '366', '2007-03-18T15:33:41.996577', '12608', '1'), - ('0.99', '546', '2007-02-15T15:00:25.996577', '1403', '2'), - ('4.99', '402', '2007-02-18T20:29:16.996577', '2490', '2'), - ('4.99', '367', '2007-04-10T01:08:06.996577', '5538', '2'), - ('1.99', '121', '2007-04-29T19:15:10.996577', '8788', '2'), - ('4.99', '507', '2007-02-15T08:34:41.996577', '1307', '2'), - ('0.99', '583', '2007-02-21T16:11:17.996577', '3424', '1'), - ('0.99', '129', '2007-04-08T23:28:12.996577', '4996', '1'), - ('2.99', '503', '2007-04-28T20:22:57.996577', '8178', '1'), - ('4.99', '326', '2007-03-02T02:40:14.996577', '10976', '2'), - ('2.99', '417', '2007-03-21T16:25:16.996577', '14607', '1'), - ('6.99', '410', '2007-03-20T16:19:14.996577', '13948', '2'), - ('2.99', '468', '2007-04-09T13:39:10.996577', '5285', '1'), - ('5.99', '174', '2007-02-18T08:42:48.996577', '2326', '1'), - ('1.99', '442', '2007-03-21T09:42:52.996577', '14418', '1'), - ('2.99', '227', '2007-04-28T22:14:57.996577', '8219', '1'), - ('2.99', '498', '2007-04-06T15:33:12.996577', '3856', '2'), - ('8.99', '535', '2007-04-10T18:28:51.996577', '5890', '2'), - ('2.99', '103', '2007-03-20T21:07:42.996577', '14064', '2'), - ('4.99', '348', '2007-03-19T03:53:56.996577', '12937', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['23301', '20055', '31179', '17938', '24206', '19514', '25563', '17534', '25750', '23281', '18102', '30524', '30576', '24663', '20026', '21839', '18871', '31723', '23354', '32015', '19962', '26138', '24337', '22808', '28534', '29707', '30143', '28842', '19706', '19012', '29805', '26486', '19115', '25373', '22698', '19196', '29439', '18349', '25883', '24832', '27704', '27685', '22263', '18543', '19787', '27264', '17525', '18843', '31272', '24914', '31266', '26937', '31461', '21235', '19063', '18747', '20376', '19880', '21683', '30662', '25512', '21680', '19953', '18563', '21973', '21949', '23810', '26510', '23075', '22095', '24235', '28254', '24130', '25181', '20630', '18929', '27599', '23452', '27432', '20850', '31630', '23299', '27033', '25780', '27474', '24683', '19764', '26632', '28727', '29994', '20774', '20992', '29766', '18837', '29922', '30526', '22930', '30566', '23706', '28725']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('0.99', '64', '2007-03-21T06:28:13.996577', '14316', '2'), - ('0.99', '326', '2007-03-01T17:32:59.996577', '10720', '2'), - ('2.99', '194', '2007-04-09T13:43:28.996577', '5291', '1'), - ('7.99', '454', '2007-02-16T22:22:19.996577', '1844', '2'), - ('5.99', '158', '2007-03-18T08:32:32.996577', '12421', '2'), - ('2.99', '267', '2007-02-19T11:57:54.996577', '2699', '2'), - ('4.99', '302', '2007-04-08T08:54:28.996577', '4676', '2'), - ('2.99', '348', '2007-02-16T08:11:14.996577', '1654', '1'), - ('3.99', '319', '2007-04-07T05:34:29.996577', '4119', '2'), - ('2.99', '62', '2007-03-21T16:02:50.996577', '14594', '2'), - ('4.99', '497', '2007-02-19T18:34:18.996577', '2818', '2'), - ('7.99', '135', '2007-04-27T20:41:07.996577', '7554', '1'), - ('6.99', '139', '2007-04-09T22:43:26.996577', '5494', '1'), - ('2.99', '212', '2007-03-21T14:52:19.996577', '14563', '1'), - ('4.99', '322', '2007-03-20T20:14:17.996577', '14042', '2'), - ('3.99', '512', '2007-03-22T17:04:25.996577', '15265', '2'), - ('1.99', '95', '2007-02-15T05:21:23.996577', '1261', '2'), - ('2.99', '248', '2007-04-12T07:08:22.996577', '6617', '2'), - ('4.99', '70', '2007-03-20T07:12:32.996577', '13680', '2'), - ('0.00', '15', '2007-05-14T13:44:29.996577', '13968', '2'), - ('2.99', '313', '2007-03-21T04:08:01.996577', '14250', '2'), - ('4.99', '352', '2007-04-27T21:35:07.996577', '7579', '1'), - ('4.99', '172', '2007-03-22T06:19:10.996577', '14991', '1'), - ('4.99', '14', '2007-03-02T20:46:50.996577', '11480', '1'), - ('0.99', '569', '2007-04-08T23:47:29.996577', '5003', '2'), - ('6.99', '64', '2007-04-30T12:17:28.996577', '9880', '1'), - ('5.99', '102', '2007-04-11T22:42:51.996577', '6434', '2'), - ('2.99', '594', '2007-04-06T20:37:19.996577', '3960', '2'), - ('0.99', '285', '2007-03-18T09:21:38.996577', '12444', '1'), - ('4.99', '132', '2007-02-18T00:50:33.996577', '2208', '1'), - ('2.99', '73', '2007-04-30T08:29:29.996577', '9776', '1'), - ('3.99', '382', '2007-04-05T21:40:09.996577', '3480', '2'), - ('0.99', '159', '2007-02-19T02:49:52.996577', '2572', '1'), - ('6.99', '286', '2007-04-30T13:44:04.996577', '9280', '2'), - ('4.99', '2', '2007-03-21T11:52:58.996577', '14475', '1'), - ('5.99', '181', '2007-02-19T08:19:01.996577', '2645', '1'), - ('2.99', '40', '2007-04-10T12:07:07.996577', '5777', '2'), - ('0.99', '568', '2007-02-19T09:57:13.996577', '2668', '2'), - ('8.99', '331', '2007-04-06T16:27:17.996577', '3871', '2'), - ('2.99', '233', '2007-03-21T07:41:35.996577', '14357', '2'), - ('2.99', '492', '2007-04-11T13:52:12.996577', '6257', '1'), - ('5.99', '490', '2007-04-29T09:42:28.996577', '8552', '1'), - ('8.99', '559', '2007-03-01T15:31:54.996577', '10669', '1'), - ('4.99', '12', '2007-02-19T06:40:17.996577', '2623', '2'), - ('5.99', '294', '2007-03-18T03:15:11.996577', '12278', '1'), - ('1.99', '452', '2007-04-29T23:30:46.996577', '8898', '1'), - ('4.99', '345', '2007-02-19T16:13:41.996577', '2766', '2'), - ('4.99', '87', '2007-02-18T22:31:54.996577', '2516', '1'), - ('8.99', '209', '2007-04-29T17:51:03.996577', '8759', '2'), - ('0.99', '242', '2007-03-01T04:40:45.996577', '10367', '2'), - ('0.99', '209', '2007-04-11T11:05:09.996577', '6210', '1'), - ('3.99', '423', '2007-04-28T16:36:28.996577', '8082', '2'), - ('4.99', '227', '2007-04-07T22:17:18.996577', '4459', '2'), - ('3.99', '448', '2007-03-19T15:16:21.996577', '13250', '2'), - ('1.99', '146', '2007-02-16T13:44:09.996577', '1724', '2'), - ('4.99', '62', '2007-02-20T09:41:27.996577', '3021', '2'), - ('0.99', '360', '2007-03-18T22:50:18.996577', '12795', '2'), - ('5.99', '304', '2007-03-18T12:45:56.996577', '12540', '1'), - ('5.99', '495', '2007-03-01T14:16:59.996577', '10643', '2'), - ('0.99', '147', '2007-04-08T14:58:04.996577', '4792', '2'), - ('0.99', '297', '2007-04-28T08:37:20.996577', '7867', '2'), - ('6.99', '494', '2007-03-22T09:49:34.996577', '15086', '1'), - ('0.99', '312', '2007-03-19T04:20:12.996577', '12945', '1'), - ('5.99', '18', '2007-02-17T18:21:08.996577', '2112', '2'), - ('9.99', '526', '2007-03-23T20:49:29.996577', '16043', '1'), - ('2.99', '523', '2007-03-22T08:09:35.996577', '15040', '1'), - ('7.99', '121', '2007-03-21T00:28:03.996577', '14138', '1'), - ('0.99', '384', '2007-04-11T20:44:22.996577', '6387', '2'), - ('2.99', '40', '2007-03-19T01:45:24.996577', '12877', '2'), - ('2.99', '539', '2007-03-22T19:52:45.996577', '15356', '1'), - ('0.99', '161', '2007-03-01T04:16:03.996577', '10355', '1'), - ('6.99', '540', '2007-04-12T13:07:53.996577', '6748', '1'), - ('2.99', '150', '2007-03-21T11:04:15.996577', '14454', '2'), - ('5.99', '269', '2007-04-12T07:44:50.996577', '6626', '1'), - ('2.99', '385', '2007-03-18T04:31:00.996577', '12310', '2'), - ('6.99', '111', '2007-02-16T03:43:18.996577', '1593', '1'), - ('4.99', '484', '2007-04-07T10:22:59.996577', '4214', '1'), - ('2.99', '80', '2007-03-18T10:10:13.996577', '12468', '2'), - ('0.99', '469', '2007-04-11T00:44:19.996577', '6022', '2'), - ('2.99', '408', '2007-03-17T22:26:21.996577', '12140', '1'), - ('0.99', '240', '2007-04-11T23:58:07.996577', '6470', '2'), - ('0.99', '64', '2007-03-20T17:13:19.996577', '13971', '1'), - ('0.99', '432', '2007-04-28T01:35:35.996577', '7681', '2'), - ('5.99', '321', '2007-04-12T18:22:23.996577', '6859', '1'), - ('5.99', '472', '2007-04-11T16:37:07.996577', '6308', '1'), - ('4.99', '214', '2007-03-21T07:10:57.996577', '14347', '2'), - ('10.99', '292', '2007-03-18T20:43:44.996577', '12739', '1'), - ('4.99', '396', '2007-04-12T13:57:53.996577', '6764', '2'), - ('4.99', '584', '2007-04-29T22:44:28.996577', '8879', '2'), - ('5.99', '90', '2007-04-27T01:34:35.996577', '7035', '2'), - ('2.99', '400', '2007-03-18T12:02:21.996577', '12514', '1'), - ('9.99', '421', '2007-03-19T23:17:30.996577', '13461', '2'), - ('0.99', '70', '2007-04-29T09:41:03.996577', '8550', '2'), - ('4.99', '86', '2007-02-18T22:44:49.996577', '2518', '1'), - ('5.99', '84', '2007-04-10T22:34:24.996577', '5971', '1'), - ('0.99', '135', '2007-04-29T02:05:33.996577', '8315', '1'), - ('3.99', '26', '2007-03-01T05:10:46.996577', '10386', '1'), - ('1.99', '138', '2007-04-30T13:06:10.996577', '9259', '2'), - ('5.99', '111', '2007-03-20T01:19:10.996577', '13525', '2'), - ('4.99', '584', '2007-04-27T13:47:08.996577', '7372', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['28948', '24716', '29581', '19202', '26706', '22165', '20681', '24210', '26912', '22367', '31507', '27983', '19915', '19963', '28507', '22058', '23823', '24510', '29471', '31973', '29734', '18762', '26709', '31046', '17814', '22155', '22533', '25992', '20278', '20836', '24422', '18008', '26560', '18755', '26728', '19361', '24898', '23843', '17674', '24672', '28771', '28881', '21672', '18964', '27528', '18751', '24118', '22506', '18409', '28053', '21532', '24708', '19342', '31428', '23801', '27974', '22219', '21152', '24758', '19670', '29928', '26738', '30052', '24962', '28736', '29238', '30486', '19146', '19059', '28401', '32020', '22672', '21265', '26639', '18337', '27323', '19689', '30409', '18752', '24923', '17884', '29727', '21432', '24073', '20035', '29313', '29218', '25140', '23011', '26807', '29930', '24030', '30394', '23796', '18610', '20973', '17711', '29194', '30020', '25953']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('2.99', '205', '2007-04-28T03:40:30.996577', '7736', '1'), - ('0.99', '218', '2007-03-19T05:19:28.996577', '12974', '1'), - ('3.99', '52', '2007-04-09T14:33:11.996577', '5313', '2'), - ('0.99', '182', '2007-02-18T02:29:54.996577', '2234', '1'), - ('4.99', '403', '2007-04-10T22:53:10.996577', '5982', '1'), - ('2.99', '547', '2007-03-19T04:14:52.996577', '12943', '2'), - ('0.99', '390', '2007-03-20T00:24:46.996577', '13501', '1'), - ('0.99', '158', '2007-03-20T19:51:29.996577', '14028', '2'), - ('3.99', '421', '2007-04-26T22:36:59.996577', '6960', '2'), - ('3.99', '569', '2007-03-18T13:44:10.996577', '12568', '1'), - ('4.99', '230', '2007-04-27T14:27:45.996577', '7390', '2'), - ('6.99', '518', '2007-04-08T21:22:47.996577', '4948', '2'), - ('2.99', '308', '2007-03-01T11:53:56.996577', '10571', '1'), - ('4.99', '313', '2007-03-21T06:44:04.996577', '14325', '1'), - ('6.99', '566', '2007-04-29T13:55:25.996577', '8660', '2'), - ('4.99', '535', '2007-03-18T17:50:22.996577', '12673', '2'), - ('4.99', '122', '2007-03-20T11:30:09.996577', '13812', '1'), - ('0.99', '190', '2007-03-17T07:35:26.996577', '11750', '2'), - ('3.99', '42', '2007-04-27T14:53:37.996577', '7405', '1'), - ('0.99', '476', '2007-05-14T13:44:29.996577', '13941', '1'), - ('2.99', '67', '2007-04-09T23:27:03.996577', '5510', '2'), - ('6.99', '66', '2007-02-21T13:47:45.996577', '3395', '2'), - ('4.99', '403', '2007-04-27T03:37:25.996577', '7103', '1'), - ('3.99', '180', '2007-04-10T16:37:15.996577', '5860', '1'), - ('0.99', '423', '2007-02-16T20:23:06.996577', '1827', '2'), - ('5.99', '546', '2007-03-20T13:11:29.996577', '13850', '2'), - ('1.99', '588', '2007-03-20T15:33:28.996577', '13923', '1'), - ('7.99', '339', '2007-04-12T10:41:09.996577', '6682', '2'), - ('7.99', '348', '2007-03-22T04:20:25.996577', '14937', '2'), - ('4.99', '407', '2007-03-01T19:22:59.996577', '10774', '2'), - ('2.99', '181', '2007-03-01T17:06:05.996577', '10703', '2'), - ('9.99', '469', '2007-02-16T09:45:48.996577', '1680', '1'), - ('8.99', '389', '2007-04-28T09:29:24.996577', '7896', '1'), - ('4.99', '65', '2007-02-20T11:35:18.996577', '3051', '1'), - ('2.99', '404', '2007-04-30T10:18:21.996577', '9824', '2'), - ('4.99', '230', '2007-02-16T15:08:24.996577', '1744', '1'), - ('4.99', '240', '2007-03-19T10:13:25.996577', '13119', '2'), - ('0.99', '125', '2007-03-17T17:15:33.996577', '11999', '1'), - ('2.99', '383', '2007-02-20T14:31:25.996577', '3091', '1'), - ('3.99', '214', '2007-03-01T11:34:29.996577', '10563', '1'), - ('2.99', '588', '2007-04-29T18:13:59.996577', '8769', '1'), - ('2.99', '597', '2007-04-10T10:04:58.996577', '5732', '2'), - ('0.99', '494', '2007-03-01T05:59:11.996577', '10403', '1'), - ('2.99', '119', '2007-02-17T10:16:57.996577', '2009', '2'), - ('2.99', '477', '2007-04-11T14:12:17.996577', '6265', '2'), - ('0.99', '63', '2007-02-16T19:59:00.996577', '1818', '2'), - ('2.99', '150', '2007-03-02T07:22:43.996577', '11123', '2'), - ('9.99', '585', '2007-03-02T13:12:28.996577', '11285', '1'), - ('3.99', '583', '2007-02-19T23:52:36.996577', '2879', '2'), - ('1.99', '523', '2007-04-27T23:45:17.996577', '7642', '2'), - ('4.99', '476', '2007-03-18T15:51:07.996577', '12616', '1'), - ('2.99', '217', '2007-03-17T03:27:52.996577', '11649', '1'), - ('7.99', '224', '2007-02-15T16:36:40.996577', '1424', '1'), - ('2.99', '224', '2007-04-26T23:49:45.996577', '6999', '2'), - ('9.99', '120', '2007-03-21T11:17:14.996577', '14460', '2'), - ('7.99', '517', '2007-04-09T09:39:27.996577', '5206', '1'), - ('7.99', '554', '2007-03-01T21:45:32.996577', '10829', '2'), - ('6.99', '440', '2007-03-18T07:59:31.996577', '12403', '2'), - ('5.99', '223', '2007-03-23T02:49:04.996577', '15546', '2'), - ('9.99', '280', '2007-03-01T22:17:59.996577', '10847', '1'), - ('2.99', '84', '2007-04-30T06:18:36.996577', '9074', '2'), - ('5.99', '405', '2007-04-30T01:56:53.996577', '8955', '1'), - ('5.99', '95', '2007-04-08T16:36:39.996577', '4835', '1'), - ('2.99', '247', '2007-03-02T14:13:36.996577', '11306', '2'), - ('6.99', '585', '2007-04-12T12:32:27.996577', '6733', '2'), - ('2.99', '24', '2007-04-07T18:57:34.996577', '4378', '2'), - ('4.99', '132', '2007-04-08T02:05:21.996577', '4534', '1'), - ('2.99', '169', '2007-02-21T02:36:07.996577', '3261', '1'), - ('2.99', '144', '2007-02-21T07:01:52.996577', '3321', '1'), - ('1.99', '557', '2007-04-30T17:17:23.996577', '9366', '2'), - ('0.99', '29', '2007-05-14T13:44:29.996577', '15577', '2'), - ('5.99', '207', '2007-03-02T13:12:48.996577', '11286', '2'), - ('1.99', '451', '2007-03-19T06:07:55.996577', '13003', '2'), - ('2.99', '396', '2007-04-30T19:52:50.996577', '10120', '2'), - ('2.99', '564', '2007-02-16T12:28:08.996577', '1705', '2'), - ('0.99', '459', '2007-04-11T11:00:40.996577', '6206', '1'), - ('2.99', '283', '2007-03-17T11:46:55.996577', '11846', '2'), - ('4.99', '125', '2007-04-30T06:58:14.996577', '9722', '1'), - ('0.99', '64', '2007-02-15T10:19:56.996577', '1335', '2'), - ('9.99', '242', '2007-03-19T16:10:32.996577', '13271', '1'), - ('5.99', '442', '2007-02-15T04:27:21.996577', '1251', '1'), - ('5.99', '66', '2007-04-11T18:49:44.996577', '6348', '2'), - ('0.99', '467', '2007-03-22T07:42:35.996577', '15032', '1'), - ('4.99', '146', '2007-03-20T04:35:27.996577', '13606', '1'), - ('2.99', '323', '2007-03-21T03:21:34.996577', '14224', '1'), - ('0.99', '30', '2007-04-09T13:42:34.996577', '5289', '1'), - ('6.99', '22', '2007-04-09T13:52:08.996577', '5294', '1'), - ('8.99', '265', '2007-03-20T07:54:43.996577', '13700', '2'), - ('0.99', '34', '2007-03-02T06:33:45.996577', '11096', '2'), - ('3.99', '410', '2007-04-29T12:27:39.996577', '8625', '2'), - ('0.99', '85', '2007-04-07T21:58:20.996577', '4451', '2'), - ('2.99', '142', '2007-03-22T19:12:32.996577', '15333', '2'), - ('3.99', '124', '2007-04-30T15:45:16.996577', '9986', '1'), - ('2.99', '120', '2007-03-19T12:05:07.996577', '13167', '2'), - ('4.99', '28', '2007-02-15T23:52:34.996577', '1543', '1'), - ('4.99', '419', '2007-03-02T04:07:38.996577', '11025', '2'), - ('2.99', '391', '2007-02-17T13:06:37.996577', '2045', '1'), - ('5.99', '19', '2007-04-30T09:34:49.996577', '9157', '1'), - ('4.99', '91', '2007-04-30T18:35:50.996577', '9396', '2'), - ('2.99', '336', '2007-04-10T05:43:33.996577', '5649', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['22910', '17866', '31436', '26837', '22965', '21858', '23656', '28684', '28993', '26782', '29859', '17516', '23289', '27769', '31482', '25199', '17730', '30902', '20182', '31984', '19140', '29408', '24834', '32024', '19376', '20259', '29137', '23990', '22961', '20057', '29288', '27977', '19439', '18003', '24773', '20985', '29338', '29689', '28379', '29239', '18067', '31050', '22097', '28375', '23626', '22764', '31187', '23517', '23612', '24048', '25716', '22750', '24808', '19756', '31845', '26515', '24830', '31994', '23988', '20419', '23891', '29119', '30940', '18938', '25564', '29017', '20359', '25351', '26317', '20947', '20037', '26792', '19033', '30579', '19700', '22620', '21056', '28389', '18452', '19120', '23149', '26680', '29291', '21602', '27336', '17946', '18399', '27208', '22679', '20781', '26282', '24291', '19815', '24709', '17755', '30145', '17567', '28549', '30907', '23702']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('0.99', '23', '2007-03-20T02:41:07.996577', '13557', '2'), - ('9.99', '436', '2007-02-18T06:05:12.996577', '2291', '1'), - ('2.99', '225', '2007-04-08T21:44:47.996577', '4955', '2'), - ('7.99', '414', '2007-04-11T23:43:50.996577', '6462', '2'), - ('2.99', '29', '2007-03-17T16:03:04.996577', '11962', '2'), - ('4.99', '514', '2007-03-17T20:05:13.996577', '12067', '2'), - ('3.99', '104', '2007-03-19T21:10:10.996577', '13410', '1'), - ('2.99', '581', '2007-04-07T12:10:24.996577', '4244', '2'), - ('5.99', '1', '2007-04-08T01:45:31.996577', '4526', '2'), - ('4.99', '409', '2007-04-08T03:02:26.996577', '4550', '2'), - ('0.99', '78', '2007-04-11T00:05:08.996577', '6005', '1'), - ('6.99', '343', '2007-02-18T18:26:38.996577', '2461', '2'), - ('7.99', '63', '2007-03-19T04:33:00.996577', '12954', '1'), - ('2.99', '498', '2007-04-09T13:40:07.996577', '5286', '1'), - ('2.99', '228', '2007-04-26T22:12:15.996577', '6948', '1'), - ('0.99', '271', '2007-04-29T11:02:24.996577', '8592', '1'), - ('1.99', '396', '2007-02-15T12:59:31.996577', '1370', '2'), - ('5.99', '168', '2007-04-10T19:10:07.996577', '5907', '1'), - ('5.99', '339', '2007-03-20T03:43:46.996577', '13575', '1'), - ('4.99', '521', '2007-05-14T13:44:29.996577', '11672', '2'), - ('0.99', '166', '2007-02-20T14:10:59.996577', '3085', '1'), - ('4.99', '38', '2007-04-08T07:42:55.996577', '4644', '2'), - ('1.99', '233', '2007-03-23T12:29:33.996577', '15790', '1'), - ('0.00', '42', '2007-05-14T13:44:29.996577', '15407', '1'), - ('5.99', '234', '2007-02-17T09:27:50.996577', '1993', '2'), - ('2.99', '347', '2007-03-18T00:36:15.996577', '12195', '1'), - ('9.99', '13', '2007-04-30T13:06:48.996577', '9260', '2'), - ('5.99', '139', '2007-03-21T20:54:19.996577', '14736', '2'), - ('2.99', '28', '2007-03-23T00:37:06.996577', '15491', '1'), - ('0.99', '326', '2007-03-02T03:34:53.996577', '11010', '2'), - ('0.99', '28', '2007-04-11T01:17:27.996577', '6032', '2'), - ('0.99', '517', '2007-04-12T20:26:41.996577', '6903', '2'), - ('7.99', '249', '2007-02-20T20:58:49.996577', '3175', '2'), - ('2.99', '468', '2007-02-16T20:11:15.996577', '1821', '1'), - ('5.99', '225', '2007-03-02T17:16:10.996577', '11395', '2'), - ('5.99', '420', '2007-03-02T11:45:47.996577', '11236', '2'), - ('2.99', '32', '2007-04-05T22:39:39.996577', '3500', '1'), - ('0.99', '63', '2007-04-30T20:47:42.996577', '10148', '2'), - ('2.99', '554', '2007-04-11T07:31:19.996577', '6144', '1'), - ('0.99', '24', '2007-04-09T14:29:00.996577', '5310', '1'), - ('5.99', '486', '2007-02-17T17:33:48.996577', '2102', '1'), - ('0.99', '180', '2007-04-30T17:34:02.996577', '9373', '1'), - ('3.99', '540', '2007-03-02T10:13:41.996577', '11198', '1'), - ('2.99', '553', '2007-04-30T02:10:43.996577', '9601', '2'), - ('0.99', '101', '2007-03-01T06:06:33.996577', '10407', '1'), - ('4.99', '8', '2007-03-23T12:59:45.996577', '15805', '1'), - ('2.99', '195', '2007-04-27T13:01:26.996577', '7349', '1'), - ('4.99', '86', '2007-03-22T10:17:42.996577', '15099', '2'), - ('5.99', '98', '2007-03-18T01:19:17.996577', '12221', '2'), - ('3.99', '144', '2007-03-19T00:50:42.996577', '12858', '1'), - ('4.99', '315', '2007-04-12T19:49:16.996577', '6894', '1'), - ('7.99', '7', '2007-03-16T23:19:58.996577', '11542', '2'), - ('0.99', '230', '2007-03-18T12:49:37.996577', '12542', '2'), - ('2.99', '290', '2007-03-19T19:47:53.996577', '13367', '1'), - ('0.99', '260', '2007-04-30T01:04:32.996577', '8933', '1'), - ('6.99', '385', '2007-04-08T10:41:14.996577', '4714', '1'), - ('4.99', '233', '2007-03-01T12:22:48.996577', '10582', '1'), - ('4.99', '557', '2007-05-14T13:44:29.996577', '14278', '1'), - ('6.99', '139', '2007-03-19T00:51:49.996577', '12859', '1'), - ('4.99', '364', '2007-03-20T07:52:52.996577', '13698', '1'), - ('4.99', '129', '2007-03-20T15:11:19.996577', '13915', '1'), - ('0.99', '12', '2007-04-09T05:30:45.996577', '5111', '2'), - ('2.99', '171', '2007-04-12T14:00:27.996577', '6766', '1'), - ('2.99', '112', '2007-02-20T09:39:01.996577', '3018', '2'), - ('0.99', '302', '2007-04-09T22:55:47.996577', '5498', '2'), - ('6.99', '2', '2007-04-30T21:08:19.996577', '9465', '2'), - ('4.99', '358', '2007-03-17T03:34:36.996577', '11653', '2'), - ('4.99', '285', '2007-04-11T04:23:08.996577', '6094', '1'), - ('2.99', '367', '2007-04-10T15:36:56.996577', '5839', '2'), - ('4.99', '417', '2007-03-18T03:18:58.996577', '12281', '2'), - ('4.99', '323', '2007-03-22T21:17:39.996577', '15387', '1'), - ('4.99', '409', '2007-04-28T14:59:46.996577', '8037', '1'), - ('0.99', '138', '2007-02-15T08:54:49.996577', '1316', '2'), - ('0.99', '139', '2007-04-27T13:36:24.996577', '7369', '1'), - ('4.99', '284', '2007-03-22T03:40:50.996577', '14921', '1'), - ('8.99', '599', '2007-03-23T04:38:10.996577', '15590', '2'), - ('4.99', '429', '2007-03-21T12:33:05.996577', '14495', '2'), - ('0.99', '556', '2007-04-10T09:38:30.996577', '5722', '2'), - ('2.99', '594', '2007-02-17T06:55:18.996577', '1950', '1'), - ('3.99', '161', '2007-02-20T13:20:45.996577', '3075', '1'), - ('2.99', '49', '2007-03-01T21:11:38.996577', '10814', '1'), - ('2.99', '400', '2007-04-30T22:44:15.996577', '10187', '1'), - ('4.99', '28', '2007-04-29T06:46:46.996577', '8464', '1'), - ('3.99', '485', '2007-03-02T09:45:37.996577', '11188', '2'), - ('4.99', '459', '2007-04-30T19:42:57.996577', '10117', '2'), - ('4.99', '454', '2007-02-21T10:48:20.996577', '3362', '1'), - ('3.99', '581', '2007-02-17T07:20:27.996577', '1958', '2'), - ('3.99', '446', '2007-04-30T00:37:15.996577', '8923', '1'), - ('1.99', '207', '2007-03-23T05:53:55.996577', '15625', '1'), - ('4.99', '401', '2007-03-18T10:55:03.996577', '12479', '2'), - ('4.99', '364', '2007-04-30T13:27:27.996577', '9266', '2'), - ('10.99', '168', '2007-03-17T02:54:13.996577', '11627', '1'), - ('10.99', '297', '2007-03-18T10:27:14.996577', '12472', '1'), - ('4.99', '217', '2007-03-17T15:51:46.996577', '11958', '1'), - ('2.99', '404', '2007-02-20T04:51:27.996577', '2951', '1'), - ('0.99', '102', '2007-04-27T09:01:24.996577', '7247', '2'), - ('1.99', '357', '2007-02-17T07:52:25.996577', '1971', '2'), - ('7.99', '570', '2007-04-30T17:54:15.996577', '9385', '1'), - ('1.99', '168', '2007-04-29T08:49:26.996577', '8527', '1'), - ('4.99', '111', '2007-03-02T03:09:32.996577', '10990', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['28604', '18286', '23072', '30598', '31107', '20072', '29303', '18636', '18301', '30504', '30279', '31606', '32079', '28112', '29832', '26340', '21604', '28976', '23991', '29131', '19543', '29145', '20799', '26638', '29395', '21770', '22979', '21549', '27675', '29197', '20938', '21986', '26314', '22795', '31611', '17923', '31378', '29390', '22300', '25112', '31765', '23092', '18220', '25403', '30760', '32034', '30767', '20059', '29600', '31222', '23415', '23684', '25176', '24469', '18460', '29207', '21194', '22806', '25753', '21586', '30008', '17759', '24299', '29416', '21876', '25338', '18592', '18852', '28194', '20028', '30628', '18048', '25762', '20623', '19021', '19645', '25177', '29603', '30709', '22020', '28531', '17608', '24841', '26031', '28772', '30496', '29191', '22514', '19100', '25105', '28816', '21769', '19022', '28017', '24973', '18343', '29089', '17569', '24710', '24328']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('7.99', '574', '2007-04-30T01:41:55.996577', '9589', '1'), - ('3.99', '550', '2007-02-17T00:00:12.996577', '1863', '1'), - ('0.99', '40', '2007-03-17T14:37:15.996577', '11919', '2'), - ('7.99', '141', '2007-04-30T06:18:22.996577', '9073', '2'), - ('2.99', '185', '2007-04-30T21:32:39.996577', '9473', '2'), - ('9.99', '327', '2007-03-23T16:24:27.996577', '15916', '1'), - ('6.99', '29', '2007-04-27T16:47:07.996577', '7451', '1'), - ('6.99', '32', '2007-02-17T02:21:44.996577', '1887', '2'), - ('6.99', '554', '2007-02-21T06:33:58.996577', '3312', '1'), - ('2.99', '133', '2007-04-27T06:36:05.996577', '7177', '1'), - ('2.99', '114', '2007-04-10T04:12:28.996577', '5625', '1'), - ('5.99', '238', '2007-04-10T03:49:37.996577', '5616', '1'), - ('0.00', '208', '2007-05-14T13:44:29.996577', '15717', '1'), - ('7.99', '528', '2007-04-27T21:07:19.996577', '7569', '1'), - ('5.99', '75', '2007-04-30T09:59:43.996577', '9168', '2'), - ('1.99', '369', '2007-04-09T01:53:44.996577', '5043', '1'), - ('2.99', '485', '2007-03-17T16:25:14.996577', '11974', '1'), - ('5.99', '207', '2007-04-27T11:25:52.996577', '7306', '2'), - ('2.99', '139', '2007-03-21T22:56:25.996577', '14788', '1'), - ('2.99', '13', '2007-04-12T04:14:13.996577', '6568', '1'), - ('4.99', '269', '2007-03-18T05:43:45.996577', '12344', '1'), - ('7.99', '14', '2007-04-09T14:38:51.996577', '5317', '2'), - ('0.99', '403', '2007-03-16T23:48:18.996577', '11558', '2'), - ('5.99', '396', '2007-04-30T16:42:11.996577', '9344', '1'), - ('2.99', '36', '2007-04-29T04:21:16.996577', '8391', '1'), - ('2.99', '504', '2007-03-16T23:59:30.996577', '11569', '2'), - ('2.99', '30', '2007-03-18T01:55:37.996577', '12240', '1'), - ('4.99', '479', '2007-03-02T06:48:55.996577', '11109', '2'), - ('4.99', '490', '2007-04-06T19:34:43.996577', '3932', '2'), - ('7.99', '19', '2007-04-30T22:09:01.996577', '10176', '1'), - ('1.99', '416', '2007-03-22T16:11:38.996577', '15235', '1'), - ('3.99', '528', '2007-03-18T23:33:25.996577', '12818', '1'), - ('8.99', '367', '2007-04-07T12:40:21.996577', '4251', '1'), - ('0.99', '12', '2007-03-23T18:57:10.996577', '15993', '1'), - ('0.99', '238', '2007-04-29T06:49:15.996577', '8465', '1'), - ('1.99', '451', '2007-02-19T10:01:37.996577', '2671', '1'), - ('0.99', '219', '2007-04-29T05:40:43.996577', '8430', '1'), - ('0.99', '36', '2007-04-11T01:06:17.996577', '6030', '2'), - ('2.99', '562', '2007-03-23T00:13:09.996577', '15475', '2'), - ('3.99', '262', '2007-03-22T17:17:08.996577', '15270', '2'), - ('0.99', '253', '2007-04-28T08:00:24.996577', '7851', '2'), - ('4.99', '42', '2007-03-18T10:53:42.996577', '12478', '1'), - ('4.99', '528', '2007-02-17T11:07:10.996577', '2019', '1'), - ('7.99', '289', '2007-04-12T03:12:51.996577', '6536', '2'), - ('2.99', '156', '2007-04-07T19:41:11.996577', '4394', '2'), - ('0.00', '60', '2007-05-14T13:44:29.996577', '14741', '2'), - ('6.99', '156', '2007-04-30T19:02:19.996577', '9409', '1'), - ('4.99', '326', '2007-03-02T21:01:51.996577', '11485', '2'), - ('2.99', '54', '2007-04-10T20:27:55.996577', '5929', '1'), - ('4.99', '198', '2007-04-12T19:29:48.996577', '6889', '2'), - ('2.99', '76', '2007-03-21T17:29:26.996577', '14637', '1'), - ('2.99', '108', '2007-03-18T14:20:02.996577', '12583', '1'), - ('1.99', '268', '2007-04-30T17:22:41.996577', '10040', '1'), - ('6.99', '186', '2007-03-19T12:05:54.996577', '13168', '1'), - ('0.99', '597', '2007-02-18T13:28:05.996577', '2379', '1'), - ('3.99', '20', '2007-04-30T21:22:18.996577', '9468', '2'), - ('0.99', '444', '2007-03-19T23:57:08.996577', '13488', '1'), - ('2.99', '14', '2007-03-01T03:51:26.996577', '10348', '1'), - ('8.99', '319', '2007-04-10T12:44:48.996577', '5791', '1'), - ('3.99', '482', '2007-03-23T15:11:19.996577', '15879', '1'), - ('4.99', '91', '2007-04-09T00:56:50.996577', '5025', '2'), - ('3.99', '405', '2007-02-19T09:06:20.996577', '2654', '2'), - ('3.99', '168', '2007-03-22T07:53:50.996577', '15033', '1'), - ('5.99', '38', '2007-04-27T12:02:04.996577', '7321', '2'), - ('4.99', '515', '2007-03-20T21:35:36.996577', '14072', '2'), - ('6.99', '284', '2007-04-09T07:26:22.996577', '5161', '1'), - ('4.99', '25', '2007-02-20T01:09:54.996577', '2901', '1'), - ('7.99', '89', '2007-02-19T20:12:37.996577', '2835', '1'), - ('2.99', '535', '2007-04-12T01:47:40.996577', '6504', '1'), - ('8.99', '322', '2007-03-23T08:52:14.996577', '15703', '2'), - ('5.99', '144', '2007-04-27T13:59:59.996577', '7378', '2'), - ('6.99', '479', '2007-02-19T15:55:51.996577', '2764', '2'), - ('0.99', '320', '2007-04-05T23:25:55.996577', '3519', '2'), - ('5.99', '384', '2007-03-22T05:06:36.996577', '14963', '1'), - ('9.99', '134', '2007-02-16T05:37:04.996577', '1618', '1'), - ('2.99', '278', '2007-03-01T17:50:14.996577', '10731', '1'), - ('9.99', '269', '2007-04-07T05:48:55.996577', '4125', '1'), - ('2.99', '54', '2007-04-12T03:50:32.996577', '6560', '2'), - ('2.99', '150', '2007-04-30T08:04:52.996577', '9121', '1'), - ('5.99', '532', '2007-03-01T17:16:22.996577', '10712', '2'), - ('6.99', '568', '2007-04-30T01:33:47.996577', '9583', '2'), - ('0.99', '366', '2007-02-18T01:13:03.996577', '2214', '2'), - ('3.99', '234', '2007-03-02T20:47:07.996577', '11481', '1'), - ('5.99', '343', '2007-04-28T13:57:26.996577', '8012', '2'), - ('2.99', '588', '2007-04-30T15:58:29.996577', '9326', '2'), - ('1.99', '132', '2007-04-27T23:29:41.996577', '7631', '1'), - ('4.99', '18', '2007-04-30T07:41:47.996577', '9114', '2'), - ('0.99', '586', '2007-03-19T02:23:00.996577', '12898', '1'), - ('1.99', '155', '2007-02-15T22:23:53.996577', '1519', '2'), - ('0.99', '262', '2007-03-01T06:42:36.996577', '10421', '2'), - ('9.99', '592', '2007-04-07T06:55:05.996577', '4145', '1'), - ('3.99', '504', '2007-03-01T09:53:54.996577', '10509', '2'), - ('0.99', '134', '2007-02-16T17:53:58.996577', '1784', '2'), - ('2.99', '520', '2007-04-29T05:48:42.996577', '8435', '2'), - ('0.99', '248', '2007-03-21T19:30:48.996577', '14704', '2'), - ('0.99', '566', '2007-02-18T12:28:57.996577', '2367', '1'), - ('4.99', '9', '2007-04-11T00:36:55.996577', '6019', '2'), - ('2.99', '358', '2007-02-15T18:19:32.996577', '1455', '1'), - ('4.99', '217', '2007-03-18T00:55:55.996577', '12210', '2'), - ('3.99', '172', '2007-03-01T02:57:32.996577', '10312', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['31764', '18986', '26508', '18827', '26313', '22271', '29419', '30450', '25967', '26331', '25778', '21598', '23338', '31383', '21029', '19026', '21171', '22898', '22293', '18053', '27224', '25413', '19961', '25742', '17940', '20633', '24129', '29185', '28026', '18388', '23411', '27985', '23212', '26176', '19266', '31966', '30669', '29221', '28453', '22214', '17677', '20462', '30827', '19122', '26292', '29909', '23309', '22706', '20345', '27434', '18431', '30331', '26889', '21473', '30515', '18524', '27621', '23077', '19435', '25507', '26982', '18737', '21350', '18789', '26791', '22901', '30284', '25170', '18502', '19445', '25423', '24081', '17762', '26740', '26756', '20831', '26746', '17768', '26747', '26757', '20834', '26743', '17767', '26752', '17763', '26751', '26748', '26749', '26745', '26753', '20830', '20832', '26742', '26741', '26754', '26750', '17764', '17766', '20833', '20835']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('2.99', '253', '2007-04-28T01:49:50.996577', '7689', '2'), - ('1.99', '124', '2007-02-18T09:28:31.996577', '2336', '2'), - ('4.99', '384', '2007-04-10T13:12:18.996577', '5797', '2'), - ('1.99', '85', '2007-02-16T10:35:23.996577', '1685', '1'), - ('2.99', '366', '2007-04-30T23:04:41.996577', '10198', '1'), - ('4.99', '559', '2007-03-21T16:54:25.996577', '14622', '2'), - ('0.99', '38', '2007-04-30T11:39:45.996577', '9216', '2'), - ('0.99', '129', '2007-04-06T19:43:29.996577', '3936', '2'), - ('2.99', '337', '2007-04-09T02:23:04.996577', '5050', '1'), - ('2.99', '368', '2007-04-12T10:32:38.996577', '6681', '1'), - ('8.99', '321', '2007-04-10T17:07:27.996577', '5867', '2'), - ('2.99', '484', '2007-03-23T05:22:32.996577', '15607', '1'), - ('4.99', '68', '2007-03-23T02:04:52.996577', '15524', '1'), - ('2.99', '220', '2007-04-10T03:44:09.996577', '5613', '2'), - ('4.99', '425', '2007-03-22T02:16:05.996577', '14881', '2'), - ('1.99', '135', '2007-02-16T08:58:48.996577', '1671', '2'), - ('7.99', '442', '2007-03-19T11:38:49.996577', '13155', '1'), - ('2.99', '22', '2007-03-20T20:47:19.996577', '14056', '1'), - ('6.99', '562', '2007-03-01T22:53:41.996577', '10868', '2'), - ('4.99', '481', '2007-02-21T04:58:39.996577', '3285', '2'), - ('2.99', '448', '2007-04-07T10:00:42.996577', '4206', '2'), - ('2.99', '290', '2007-04-10T14:50:46.996577', '5827', '2'), - ('2.99', '313', '2007-03-17T17:48:10.996577', '12011', '2'), - ('4.99', '317', '2007-04-30T22:56:56.996577', '9513', '2'), - ('4.99', '454', '2007-02-17T05:47:02.996577', '1938', '1'), - ('0.99', '385', '2007-03-19T10:01:46.996577', '13117', '1'), - ('0.99', '150', '2007-03-21T01:27:43.996577', '14165', '2'), - ('3.99', '18', '2007-04-08T20:13:05.996577', '4923', '2'), - ('1.99', '521', '2007-04-27T17:44:28.996577', '7478', '1'), - ('6.99', '576', '2007-02-21T00:46:40.996577', '3226', '2'), - ('5.99', '75', '2007-03-23T16:51:50.996577', '15928', '2'), - ('2.99', '518', '2007-04-26T22:28:26.996577', '6957', '1'), - ('4.99', '54', '2007-03-23T03:49:02.996577', '15567', '1'), - ('1.99', '355', '2007-04-29T05:22:47.996577', '8418', '2'), - ('0.99', '197', '2007-02-15T12:33:37.996577', '1363', '1'), - ('0.00', '448', '2007-05-14T13:44:29.996577', '13577', '1'), - ('0.99', '147', '2007-04-27T01:55:55.996577', '7044', '2'), - ('7.99', '22', '2007-04-28T02:31:24.996577', '7705', '1'), - ('0.99', '562', '2007-04-09T16:42:29.996577', '5360', '2'), - ('4.99', '553', '2007-03-17T05:58:10.996577', '11710', '2'), - ('7.99', '384', '2007-02-18T13:26:15.996577', '2378', '1'), - ('2.99', '368', '2007-03-22T22:59:35.996577', '15437', '1'), - ('4.99', '161', '2007-04-30T08:35:19.996577', '9135', '1'), - ('0.99', '162', '2007-02-18T12:15:05.996577', '2366', '1'), - ('4.99', '365', '2007-04-30T10:38:45.996577', '9184', '2'), - ('6.99', '83', '2007-04-06T09:38:53.996577', '3722', '2'), - ('6.99', '65', '2007-03-21T00:33:23.996577', '14140', '2'), - ('8.99', '3', '2007-03-21T19:19:14.996577', '14699', '2'), - ('5.99', '356', '2007-03-19T22:19:11.996577', '13442', '2'), - ('4.99', '469', '2007-04-12T15:15:32.996577', '6797', '1'), - ('8.99', '589', '2007-02-19T12:25:34.996577', '2707', '1'), - ('5.99', '119', '2007-04-09T08:07:57.996577', '5176', '1'), - ('0.99', '419', '2007-04-10T20:35:14.996577', '5933', '2'), - ('4.99', '470', '2007-03-21T09:13:27.996577', '14405', '2'), - ('1.99', '134', '2007-04-29T13:27:30.996577', '8650', '2'), - ('0.99', '7', '2007-02-19T12:28:52.996577', '2709', '1'), - ('3.99', '485', '2007-04-09T17:07:41.996577', '5367', '1'), - ('0.99', '40', '2007-03-19T20:00:11.996577', '13376', '1'), - ('0.99', '249', '2007-02-15T00:50:12.996577', '1204', '1'), - ('8.99', '297', '2007-04-10T10:26:04.996577', '5743', '1'), - ('4.99', '426', '2007-04-30T12:42:22.996577', '9247', '2'), - ('0.99', '58', '2007-02-19T00:42:37.996577', '2543', '2'), - ('10.99', '460', '2007-03-01T18:40:59.996577', '10754', '2'), - ('4.99', '75', '2007-02-20T23:28:51.996577', '3210', '1'), - ('0.99', '409', '2007-04-28T11:15:13.996577', '7940', '2'), - ('6.99', '22', '2007-03-23T04:31:57.996577', '15589', '1'), - ('2.99', '114', '2007-04-27T21:02:25.996577', '7565', '2'), - ('6.99', '268', '2007-04-10T18:20:43.996577', '5888', '2'), - ('2.99', '2', '2007-02-17T19:23:24.996577', '2128', '1'), - ('4.99', '252', '2007-02-19T13:08:43.996577', '2716', '2'), - ('4.99', '291', '2007-04-05T23:11:32.996577', '3512', '2'), - ('4.99', '147', '2007-03-20T02:10:23.996577', '13542', '2'), - ('4.99', '406', '2007-02-17T18:26:12.996577', '2113', '1'), - ('4.99', '406', '2007-04-07T12:53:54.996577', '4264', '2'), - ('2.99', '406', '2007-04-30T22:08:48.996577', '9487', '2'), - ('4.99', '406', '2007-03-17T01:50:36.996577', '11603', '1'), - ('4.99', '406', '2007-04-27T06:27:01.996577', '7171', '1'), - ('4.99', '406', '2007-02-21T06:15:24.996577', '3306', '1'), - ('4.99', '406', '2007-04-27T09:34:26.996577', '7259', '1'), - ('8.99', '406', '2007-04-30T04:31:43.996577', '9660', '1'), - ('2.99', '406', '2007-03-21T09:48:47.996577', '14421', '2'), - ('0.99', '406', '2007-04-10T11:35:57.996577', '5766', '1'), - ('7.99', '406', '2007-02-20T21:32:46.996577', '3186', '1'), - ('0.99', '406', '2007-04-29T23:36:32.996577', '8903', '1'), - ('3.99', '406', '2007-02-17T21:19:02.996577', '2150', '2'), - ('0.99', '406', '2007-04-29T12:36:25.996577', '8630', '2'), - ('7.99', '406', '2007-04-27T22:23:18.996577', '7604', '2'), - ('4.99', '406', '2007-04-28T16:33:32.996577', '8080', '2'), - ('5.99', '406', '2007-04-27T03:57:23.996577', '7109', '2'), - ('1.99', '406', '2007-04-30T02:12:11.996577', '8962', '2'), - ('1.99', '406', '2007-03-01T14:05:22.996577', '10632', '1'), - ('5.99', '406', '2007-03-18T11:45:56.996577', '12505', '2'), - ('0.99', '406', '2007-04-09T12:39:02.996577', '5263', '2'), - ('4.99', '406', '2007-04-09T04:42:20.996577', '5098', '2'), - ('0.99', '406', '2007-04-30T11:54:03.996577', '9224', '2'), - ('2.99', '406', '2007-04-29T01:10:40.996577', '8295', '2'), - ('2.99', '406', '2007-02-18T03:00:07.996577', '2241', '1'), - ('0.99', '406', '2007-02-19T03:33:29.996577', '2585', '2'), - ('6.99', '406', '2007-03-21T02:25:41.996577', '14205', '2'), - ('2.99', '406', '2007-03-21T16:14:18.996577', '14601', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['26755', '26744', '17765', '25911', '25917', '20124', '25923', '25922', '25920', '25919', '25913', '25915', '20126', '20123', '20120', '20118', '20125', '25921', '25916', '20119', '25912', '25918', '20122', '25914', '20121', '25931', '25933', '20134', '25925', '20130', '20129', '20132', '20137', '20136', '25928', '20131', '20133', '31935', '25926', '20127', '25924', '20135', '25935', '20128', '25932', '25934', '20138', '25929', '25927', '25930', '27104', '17872', '17871', '21129', '21132', '17874', '21130', '17875', '27099', '17873', '27094', '17870', '27097', '27106', '21128', '31962', '21135', '27100', '27107', '27096', '21136', '21134', '27098', '27103', '27105', '27102', '21131', '21133', '27101', '27095', '28071', '28069', '21960', '28066', '21958', '28068', '28072', '28074', '28073', '21956', '28076', '31985', '21959', '28075', '28070', '28067', '21957', '18205', '27788', '27787']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('4.99', '406', '2007-04-30T14:32:05.996577', '9291', '1'), - ('2.99', '406', '2007-04-11T22:52:14.996577', '6439', '2'), - ('0.99', '406', '2007-02-18T08:36:33.996577', '2325', '2'), - ('0.99', '333', '2007-04-09T01:08:13.996577', '5032', '2'), - ('6.99', '333', '2007-04-27T02:40:40.996577', '7076', '2'), - ('2.99', '333', '2007-03-21T21:03:59.996577', '14740', '1'), - ('2.99', '333', '2007-04-30T17:53:21.996577', '10062', '1'), - ('4.99', '333', '2007-04-30T17:15:12.996577', '10035', '2'), - ('4.99', '333', '2007-04-30T09:07:36.996577', '9148', '2'), - ('4.99', '333', '2007-04-29T16:14:11.996577', '8719', '1'), - ('4.99', '333', '2007-04-10T18:31:08.996577', '5892', '2'), - ('4.99', '333', '2007-04-26T21:31:23.996577', '6931', '2'), - ('4.99', '333', '2007-03-22T18:28:08.996577', '15313', '1'), - ('4.99', '333', '2007-03-20T20:51:25.996577', '14057', '1'), - ('0.99', '333', '2007-03-18T17:38:36.996577', '12661', '2'), - ('4.99', '333', '2007-03-01T22:15:24.996577', '10844', '2'), - ('2.99', '333', '2007-03-22T16:33:47.996577', '15253', '2'), - ('10.99', '333', '2007-04-30T16:31:39.996577', '9338', '2'), - ('0.99', '333', '2007-04-26T22:31:07.996577', '6958', '2'), - ('6.99', '333', '2007-03-18T08:52:43.996577', '12427', '1'), - ('1.99', '333', '2007-04-10T05:26:47.996577', '5645', '1'), - ('0.99', '333', '2007-04-27T08:59:07.996577', '7246', '2'), - ('4.99', '333', '2007-03-20T08:03:46.996577', '13710', '2'), - ('0.99', '333', '2007-04-11T14:40:37.996577', '6275', '2'), - ('3.99', '333', '2007-03-20T03:50:32.996577', '13579', '1'), - ('4.99', '334', '2007-04-12T13:11:31.996577', '6749', '2'), - ('7.99', '334', '2007-04-30T02:42:33.996577', '8977', '1'), - ('0.99', '334', '2007-03-21T17:41:13.996577', '14645', '1'), - ('6.99', '334', '2007-04-08T05:25:33.996577', '4603', '1'), - ('7.99', '334', '2007-03-02T03:17:28.996577', '10997', '2'), - ('1.99', '334', '2007-03-01T23:01:46.996577', '10879', '1'), - ('4.99', '334', '2007-03-19T18:20:28.996577', '13325', '2'), - ('4.99', '334', '2007-03-23T07:07:24.996577', '15656', '2'), - ('0.99', '334', '2007-03-23T02:54:46.996577', '15548', '2'), - ('5.99', '334', '2007-04-10T14:19:38.996577', '5818', '2'), - ('4.99', '334', '2007-03-18T18:04:31.996577', '12677', '2'), - ('2.99', '334', '2007-03-20T13:43:54.996577', '13876', '1'), - ('0.99', '334', '2007-05-14T13:44:29.996577', '14219', '1'), - ('4.99', '334', '2007-04-09T00:20:15.996577', '5014', '2'), - ('4.99', '334', '2007-03-01T06:10:36.996577', '10408', '1'), - ('4.99', '334', '2007-04-06T06:40:14.996577', '3662', '1'), - ('7.99', '334', '2007-03-22T06:03:57.996577', '14984', '1'), - ('3.99', '334', '2007-04-30T23:21:27.996577', '10207', '1'), - ('2.99', '334', '2007-03-01T09:10:54.996577', '10492', '1'), - ('2.99', '334', '2007-04-26T23:28:16.996577', '6987', '1'), - ('2.99', '334', '2007-04-30T03:32:34.996577', '9633', '1'), - ('3.99', '334', '2007-03-23T07:34:43.996577', '15669', '1'), - ('4.99', '334', '2007-04-10T15:51:40.996577', '5845', '1'), - ('0.99', '334', '2007-04-09T19:53:46.996577', '5434', '2'), - ('5.99', '334', '2007-04-12T09:01:40.996577', '6641', '2'), - ('0.99', '438', '2007-04-27T22:04:27.996577', '7598', '1'), - ('0.99', '438', '2007-02-18T00:43:11.996577', '2206', '2'), - ('0.99', '438', '2007-02-16T17:23:37.996577', '1779', '2'), - ('4.99', '438', '2007-03-01T13:13:09.996577', '10607', '1'), - ('0.99', '438', '2007-03-18T17:25:06.996577', '12654', '2'), - ('4.99', '438', '2007-02-21T06:45:30.996577', '3315', '1'), - ('4.99', '438', '2007-03-17T03:18:12.996577', '11644', '2'), - ('0.99', '438', '2007-02-21T11:47:04.996577', '3368', '2'), - ('4.99', '438', '2007-04-11T07:04:30.996577', '6138', '2'), - ('4.99', '438', '2007-02-19T04:00:48.996577', '2591', '1'), - ('4.99', '438', '2007-04-07T17:49:45.996577', '4355', '1'), - ('4.99', '438', '2007-02-15T16:54:55.996577', '1431', '1'), - ('4.99', '438', '2007-04-09T19:33:13.996577', '5426', '2'), - ('3.99', '438', '2007-04-30T06:39:48.996577', '9082', '1'), - ('6.99', '438', '2007-03-01T10:04:45.996577', '10512', '1'), - ('0.99', '438', '2007-05-14T13:44:29.996577', '12524', '2'), - ('5.99', '438', '2007-03-21T15:36:59.996577', '14582', '2'), - ('3.99', '438', '2007-04-12T04:02:35.996577', '6563', '1'), - ('0.99', '438', '2007-04-30T08:42:52.996577', '9782', '2'), - ('4.99', '438', '2007-04-09T14:38:08.996577', '5316', '2'), - ('5.99', '438', '2007-03-23T15:30:26.996577', '15893', '2'), - ('4.99', '438', '2007-03-19T21:16:00.996577', '13414', '1'), - ('2.99', '438', '2007-04-10T17:08:51.996577', '5870', '1'), - ('8.99', '438', '2007-04-27T13:49:23.996577', '7374', '2'), - ('2.99', '438', '2007-04-29T09:38:41.996577', '8547', '2'), - ('1.99', '438', '2007-04-27T13:16:57.996577', '7357', '2'), - ('4.99', '438', '2007-03-17T15:06:46.996577', '11933', '2'), - ('7.99', '438', '2007-03-19T18:03:39.996577', '13319', '2'), - ('4.99', '438', '2007-04-12T07:04:48.996577', '6615', '2'), - ('2.99', '438', '2007-04-07T21:40:42.996577', '4446', '2'), - ('4.99', '525', '2007-04-27T12:40:30.996577', '7337', '2'), - ('6.99', '525', '2007-04-11T20:45:42.996577', '6388', '2'), - ('3.99', '525', '2007-03-23T05:51:55.996577', '15623', '2'), - ('6.99', '525', '2007-04-06T22:05:32.996577', '3993', '1'), - ('1.99', '525', '2007-03-17T03:51:08.996577', '11660', '1'), - ('7.99', '525', '2007-04-11T04:51:54.996577', '6098', '2'), - ('4.99', '525', '2007-04-27T21:54:20.996577', '7591', '2'), - ('4.99', '525', '2007-04-30T02:04:57.996577', '8960', '1'), - ('0.99', '525', '2007-04-28T13:50:53.996577', '8007', '1'), - ('2.99', '525', '2007-03-01T09:21:42.996577', '10496', '1'), - ('0.99', '525', '2007-04-30T06:02:33.996577', '9702', '1'), - ('2.99', '525', '2007-05-14T13:44:29.996577', '14954', '1'), - ('0.99', '525', '2007-03-22T13:00:51.996577', '15159', '1'), - ('5.99', '525', '2007-04-30T22:50:55.996577', '9507', '2'), - ('1.99', '525', '2007-04-12T10:50:39.996577', '6689', '1'), - ('2.99', '525', '2007-04-10T15:39:57.996577', '5841', '1'), - ('2.99', '525', '2007-03-02T17:44:36.996577', '11406', '2'), - ('2.99', '525', '2007-02-16T16:41:20.996577', '1772', '2'), - ('6.99', '499', '2007-04-28T09:36:48.996577', '7898', '1'), - ('0.99', '499', '2007-04-28T07:12:47.996577', '7831', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['21723', '21720', '21715', '21716', '18109', '21713', '27781', '21721', '18110', '27789', '27780', '21722', '18112', '21712', '27786', '21717', '21719', '27784', '27785', '21711', '27782', '21714', '27783', '27790', '18111', '21718', '27791', '31402', '19337', '31400', '19334', '24746', '24749', '24740', '24744', '24743', '31395', '24741', '31397', '24745', '31394', '31401', '31405', '31398', '19333', '31396', '31399', '31404', '24748', '19335', '24747', '24742', '19336', '31403', '23000', '32021', '23004', '23006', '29353', '29358', '29359', '29355', '23007', '18640', '23002', '23001', '29357', '29360', '29354', '29356', '18641', '23008', '23003', '23005', '28260', '18262', '22115', '22108', '22107', '28259', '28262', '22109', '22106', '22113', '22114', '22117', '22111', '28261', '22118', '18263', '28258', '22112', '22116', '28264', '28263', '22110', '21151', '27115', '21148', '27116']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('7.99', '499', '2007-03-23T04:28:54.996577', '15587', '1'), - ('4.99', '499', '2007-03-19T04:22:47.996577', '12947', '2'), - ('4.99', '499', '2007-03-17T16:30:36.996577', '11978', '2'), - ('8.99', '499', '2007-03-17T17:25:19.996577', '12004', '1'), - ('2.99', '499', '2007-02-15T11:42:25.996577', '1355', '1'), - ('7.99', '499', '2007-03-16T22:19:59.996577', '11513', '1'), - ('2.99', '499', '2007-04-09T00:39:20.996577', '5022', '1'), - ('3.99', '499', '2007-03-20T12:07:54.996577', '13822', '2'), - ('4.99', '499', '2007-02-15T22:56:17.996577', '1526', '2'), - ('4.99', '499', '2007-04-28T18:16:41.996577', '8130', '2'), - ('4.99', '499', '2007-04-06T13:03:52.996577', '3794', '1'), - ('3.99', '499', '2007-03-22T01:14:44.996577', '14858', '1'), - ('1.99', '499', '2007-02-21T01:22:58.996577', '3241', '2'), - ('2.99', '499', '2007-03-01T09:24:25.996577', '10497', '2'), - ('0.99', '499', '2007-04-28T06:19:25.996577', '7800', '1'), - ('7.99', '499', '2007-03-18T06:02:33.996577', '12354', '1'), - ('1.99', '499', '2007-03-18T14:31:39.996577', '12587', '1'), - ('4.99', '499', '2007-04-10T21:51:34.996577', '5956', '1'), - ('4.99', '499', '2007-04-12T12:13:23.996577', '6723', '2'), - ('0.99', '499', '2007-03-01T03:26:58.996577', '10333', '2'), - ('2.99', '499', '2007-04-09T18:00:56.996577', '5392', '2'), - ('0.99', '499', '2007-03-17T02:01:09.996577', '11606', '2'), - ('3.99', '499', '2007-04-09T19:40:52.996577', '5427', '2'), - ('3.99', '499', '2007-04-29T18:22:16.996577', '8770', '1'), - ('4.99', '499', '2007-02-16T20:47:09.996577', '1830', '2'), - ('3.99', '499', '2007-03-18T09:09:31.996577', '12436', '1'), - ('0.99', '499', '2007-04-30T01:41:39.996577', '9588', '1'), - ('0.99', '221', '2007-04-29T07:22:04.996577', '8486', '2'), - ('5.99', '221', '2007-02-20T22:51:13.996577', '3200', '1'), - ('0.99', '221', '2007-04-27T04:46:27.996577', '7129', '1'), - ('2.99', '221', '2007-02-18T09:18:35.996577', '2331', '1'), - ('5.99', '221', '2007-03-21T06:34:56.996577', '14322', '2'), - ('8.99', '221', '2007-03-22T11:21:48.996577', '15125', '1'), - ('4.99', '221', '2007-03-17T04:40:53.996577', '11680', '2'), - ('3.99', '221', '2007-03-18T15:55:04.996577', '12620', '2'), - ('0.99', '221', '2007-03-18T05:06:46.996577', '12324', '1'), - ('4.99', '221', '2007-04-08T08:00:31.996577', '4649', '2'), - ('4.99', '221', '2007-03-17T05:25:22.996577', '11693', '1'), - ('5.99', '221', '2007-04-09T02:49:01.996577', '5058', '1'), - ('2.99', '221', '2007-03-19T22:02:52.996577', '13434', '2'), - ('4.99', '221', '2007-04-07T14:22:13.996577', '4293', '1'), - ('8.99', '221', '2007-04-27T19:48:00.996577', '7531', '2'), - ('0.99', '221', '2007-04-30T11:26:46.996577', '9853', '2'), - ('5.99', '221', '2007-04-10T20:02:24.996577', '5920', '2'), - ('0.99', '221', '2007-02-15T12:57:40.996577', '1369', '1'), - ('6.99', '221', '2007-04-08T09:36:02.996577', '4693', '1'), - ('2.99', '221', '2007-04-27T03:35:00.996577', '7101', '1'), - ('7.99', '221', '2007-04-30T20:48:30.996577', '9453', '1'), - ('7.99', '221', '2007-03-21T09:44:12.996577', '14419', '1'), - ('2.99', '221', '2007-02-18T19:11:11.996577', '2473', '2'), - ('0.99', '221', '2007-03-21T08:05:42.996577', '14371', '2'), - ('2.99', '221', '2007-03-17T10:01:17.996577', '11802', '1'), - ('10.99', '221', '2007-02-19T09:18:28.996577', '2660', '1'), - ('6.99', '221', '2007-04-30T15:45:05.996577', '9320', '1'), - ('2.99', '33', '2007-03-01T03:27:56.996577', '10335', '2'), - ('0.99', '33', '2007-05-14T13:44:29.996577', '12277', '1'), - ('7.99', '33', '2007-03-20T16:40:10.996577', '13958', '1'), - ('0.99', '33', '2007-03-21T16:57:39.996577', '14623', '1'), - ('5.99', '33', '2007-04-07T04:30:14.996577', '4095', '1'), - ('4.99', '33', '2007-04-30T05:00:11.996577', '9040', '1'), - ('4.99', '33', '2007-04-30T06:45:50.996577', '9085', '2'), - ('4.99', '33', '2007-04-10T09:43:14.996577', '5723', '1'), - ('5.99', '33', '2007-03-22T10:11:30.996577', '15096', '1'), - ('10.99', '33', '2007-02-15T08:14:59.996577', '1301', '1'), - ('7.99', '33', '2007-03-19T14:53:26.996577', '13241', '1'), - ('4.99', '33', '2007-03-01T22:55:38.996577', '10870', '1'), - ('4.99', '33', '2007-04-28T13:21:32.996577', '7992', '1'), - ('1.99', '33', '2007-04-30T12:54:37.996577', '9254', '1'), - ('0.99', '33', '2007-04-09T19:17:38.996577', '5421', '1'), - ('0.99', '33', '2007-04-11T15:04:43.996577', '6280', '2'), - ('8.99', '33', '2007-02-20T20:49:36.996577', '3173', '2'), - ('2.99', '33', '2007-03-22T10:56:27.996577', '15115', '2'), - ('2.99', '33', '2007-03-20T13:19:23.996577', '13858', '1'), - ('0.99', '33', '2007-03-20T18:40:45.996577', '14002', '1'), - ('7.99', '541', '2007-04-11T23:55:35.996577', '6468', '2'), - ('2.99', '541', '2007-02-17T09:03:25.996577', '1986', '2'), - ('3.99', '541', '2007-03-22T12:10:15.996577', '15141', '2'), - ('4.99', '541', '2007-03-18T04:16:21.996577', '12306', '1'), - ('0.99', '541', '2007-03-02T12:49:21.996577', '11273', '2'), - ('4.99', '541', '2007-04-09T09:12:20.996577', '5197', '2'), - ('8.99', '541', '2007-04-28T17:42:26.996577', '8113', '1'), - ('4.99', '541', '2007-03-18T07:34:56.996577', '12395', '2'), - ('5.99', '541', '2007-03-01T02:47:44.996577', '10306', '1'), - ('6.99', '541', '2007-03-22T04:21:05.996577', '14938', '2'), - ('4.99', '541', '2007-03-22T09:27:09.996577', '15071', '1'), - ('0.99', '541', '2007-03-22T22:25:03.996577', '15421', '1'), - ('4.99', '541', '2007-03-19T14:50:39.996577', '13239', '2'), - ('2.99', '541', '2007-04-12T12:06:32.996577', '6718', '2'), - ('1.99', '541', '2007-03-23T16:37:25.996577', '15924', '2'), - ('6.99', '541', '2007-02-19T12:27:31.996577', '2708', '1'), - ('2.99', '541', '2007-04-09T00:29:31.996577', '5018', '1'), - ('0.99', '541', '2007-03-20T05:51:19.996577', '13640', '2'), - ('1.99', '541', '2007-03-22T15:42:05.996577', '15223', '1'), - ('0.99', '541', '2007-04-30T02:12:09.996577', '9603', '2'), - ('4.99', '541', '2007-04-29T02:21:15.996577', '8322', '1'), - ('7.99', '541', '2007-03-19T02:17:54.996577', '12894', '1'), - ('0.99', '439', '2007-03-23T19:56:01.996577', '16018', '1'), - ('2.99', '439', '2007-04-29T03:13:42.996577', '8343', '1'), - ('4.99', '439', '2007-03-22T13:09:31.996577', '15162', '2'), - ('2.99', '439', '2007-04-29T12:24:02.996577', '8624', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['17879', '17877', '27114', '27118', '27112', '21145', '21141', '21144', '21140', '27111', '21147', '21138', '27117', '21146', '27110', '27108', '17878', '17876', '21149', '21137', '21150', '21142', '21143', '17880', '21139', '27119', '17881', '27109', '27113', '25645', '19929', '19935', '19928', '25657', '25652', '25647', '25648', '25644', '25650', '19932', '19933', '25653', '19930', '25646', '19934', '25658', '25656', '25649', '19936', '25651', '25655', '25654', '25659', '19931', '29482', '32025', '29489', '29490', '23099', '23097', '29491', '32026', '23102', '18676', '29481', '29486', '29488', '23100', '29484', '29483', '29480', '29485', '23098', '23096', '23101', '29487', '23228', '29613', '23220', '32031', '23230', '29617', '29614', '23226', '29615', '23222', '29620', '29618', '23221', '23225', '23223', '18729', '18727', '23224', '23229', '23231', '29621', '18728', '18730', '29616']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('2.99', '439', '2007-02-19T06:35:57.996577', '2621', '1'), - ('0.99', '439', '2007-02-16T00:57:01.996577', '1557', '2'), - ('2.99', '439', '2007-04-12T10:17:42.996577', '6672', '2'), - ('0.99', '439', '2007-04-30T13:37:41.996577', '9275', '1'), - ('2.99', '439', '2007-04-10T18:33:56.996577', '5893', '1'), - ('4.99', '439', '2007-03-19T19:32:46.996577', '13358', '2'), - ('2.99', '439', '2007-03-17T16:52:24.996577', '11989', '1'), - ('3.99', '439', '2007-03-18T23:53:37.996577', '12826', '2'), - ('5.99', '439', '2007-03-16T23:23:33.996577', '11544', '2'), - ('5.99', '439', '2007-04-10T13:27:31.996577', '5801', '2'), - ('9.99', '439', '2007-03-22T08:20:20.996577', '15044', '2'), - ('2.99', '439', '2007-03-02T00:14:25.996577', '10905', '1'), - ('2.99', '439', '2007-04-29T15:41:10.996577', '8703', '2'), - ('5.99', '439', '2007-03-21T20:49:37.996577', '14730', '2'), - ('4.99', '439', '2007-04-08T15:38:22.996577', '4813', '1'), - ('5.99', '439', '2007-04-06T11:53:33.996577', '3774', '2'), - ('4.99', '439', '2007-02-17T17:08:30.996577', '2097', '2'), - ('4.99', '439', '2007-02-15T05:28:05.996577', '1264', '1'), - ('4.99', '439', '2007-03-23T07:03:08.996577', '15653', '2'), - ('1.99', '439', '2007-03-01T18:25:15.996577', '10744', '2'), - ('1.99', '439', '2007-03-23T13:28:24.996577', '15818', '1'), - ('2.99', '439', '2007-03-18T16:00:02.996577', '12621', '1'), - ('5.99', '439', '2007-03-18T21:07:13.996577', '12755', '2'), - ('2.99', '439', '2007-02-20T07:40:17.996577', '2992', '1'), - ('6.99', '439', '2007-03-02T04:32:59.996577', '11042', '2'), - ('6.99', '439', '2007-04-30T15:50:05.996577', '9322', '1'), - ('6.99', '439', '2007-02-21T05:31:49.996577', '3294', '1'), - ('2.99', '439', '2007-04-08T01:53:20.996577', '4528', '1'), - ('2.99', '439', '2007-04-12T04:43:31.996577', '6577', '1'), - ('7.99', '309', '2007-04-06T17:37:41.996577', '3896', '2'), - ('0.99', '309', '2007-03-01T17:43:35.996577', '10728', '1'), - ('5.99', '309', '2007-03-22T00:42:14.996577', '14846', '2'), - ('2.99', '309', '2007-03-01T07:48:14.996577', '10458', '1'), - ('2.99', '309', '2007-04-30T00:15:28.996577', '8917', '1'), - ('4.99', '309', '2007-04-28T03:13:24.996577', '7722', '2'), - ('4.99', '309', '2007-04-08T02:31:54.996577', '4540', '1'), - ('8.99', '309', '2007-04-09T14:24:02.996577', '5305', '2'), - ('4.99', '309', '2007-04-06T14:56:09.996577', '3837', '2'), - ('4.99', '309', '2007-04-12T00:17:55.996577', '6480', '2'), - ('5.99', '309', '2007-03-19T06:36:30.996577', '13021', '2'), - ('0.99', '309', '2007-03-20T00:26:41.996577', '13502', '2'), - ('5.99', '309', '2007-04-28T07:49:44.996577', '7846', '1'), - ('2.99', '309', '2007-03-01T21:21:11.996577', '10818', '1'), - ('4.99', '309', '2007-04-07T08:17:35.996577', '4172', '2'), - ('4.99', '309', '2007-03-20T14:55:02.996577', '13909', '2'), - ('2.99', '309', '2007-04-30T14:16:17.996577', '9945', '2'), - ('2.99', '309', '2007-04-29T14:40:27.996577', '8681', '1'), - ('4.99', '309', '2007-04-10T22:46:47.996577', '5980', '1'), - ('4.99', '309', '2007-03-22T22:26:35.996577', '15422', '2'), - ('5.99', '309', '2007-04-27T07:51:59.996577', '7214', '2'), - ('2.99', '309', '2007-04-29T07:41:17.996577', '8501', '1'), - ('4.99', '309', '2007-04-29T03:10:27.996577', '8341', '1'), - ('0.99', '309', '2007-04-30T14:18:36.996577', '9949', '1'), - ('6.99', '309', '2007-03-17T16:05:29.996577', '11964', '2'), - ('4.99', '43', '2007-04-09T07:28:37.996577', '5162', '1'), - ('3.98', '43', '2007-05-14T13:44:29.996577', '15644', '2'), - ('4.99', '43', '2007-04-28T08:37:21.996577', '7868', '2'), - ('4.99', '43', '2007-04-29T03:53:58.996577', '8376', '2'), - ('4.99', '43', '2007-03-22T00:23:18.996577', '14837', '2'), - ('2.99', '43', '2007-03-21T03:58:21.996577', '14244', '1'), - ('4.99', '43', '2007-04-30T11:12:24.996577', '9204', '1'), - ('0.00', '43', '2007-05-14T13:44:29.996577', '15745', '1'), - ('2.99', '43', '2007-03-23T17:20:07.996577', '15945', '2'), - ('4.99', '43', '2007-02-15T23:56:48.996577', '1544', '2'), - ('2.99', '43', '2007-04-08T00:36:16.996577', '4498', '1'), - ('3.99', '43', '2007-04-12T00:05:12.996577', '6474', '1'), - ('4.99', '43', '2007-04-27T13:00:58.996577', '7348', '1'), - ('4.99', '43', '2007-03-22T12:56:12.996577', '15155', '2'), - ('2.99', '43', '2007-04-10T15:02:28.996577', '5831', '1'), - ('4.99', '43', '2007-04-09T18:27:36.996577', '5401', '1'), - ('1.99', '43', '2007-04-06T07:54:22.996577', '3683', '2'), - ('4.99', '43', '2007-04-10T21:09:13.996577', '5941', '2'), - ('4.99', '43', '2007-03-21T17:47:47.996577', '14649', '1'), - ('4.99', '43', '2007-03-17T07:40:18.996577', '11753', '1'), - ('6.99', '43', '2007-03-23T12:52:10.996577', '15800', '2'), - ('0.99', '43', '2007-04-12T10:30:22.996577', '6680', '2'), - ('5.99', '56', '2007-03-20T10:12:18.996577', '13769', '1'), - ('7.99', '56', '2007-04-06T09:26:22.996577', '3718', '1'), - ('6.99', '56', '2007-03-01T04:17:43.996577', '10356', '2'), - ('4.99', '56', '2007-05-14T13:44:29.996577', '15714', '2'), - ('0.99', '56', '2007-03-21T13:44:55.996577', '14534', '2'), - ('4.99', '56', '2007-04-09T06:33:49.996577', '5142', '1'), - ('2.99', '56', '2007-04-06T11:48:00.996577', '3771', '2'), - ('4.99', '56', '2007-03-18T19:35:54.996577', '12713', '2'), - ('3.99', '56', '2007-04-07T04:39:21.996577', '4097', '1'), - ('4.99', '56', '2007-03-02T01:49:05.996577', '10946', '1'), - ('0.99', '56', '2007-04-28T11:18:10.996577', '7942', '2'), - ('2.99', '56', '2007-04-27T14:18:12.996577', '7385', '1'), - ('0.99', '56', '2007-03-01T15:54:50.996577', '10678', '2'), - ('1.99', '56', '2007-03-18T12:35:05.996577', '12537', '2'), - ('5.99', '56', '2007-03-02T16:13:28.996577', '11358', '1'), - ('4.99', '56', '2007-02-18T19:54:29.996577', '2485', '1'), - ('6.99', '56', '2007-02-16T18:37:27.996577', '1795', '2'), - ('4.99', '56', '2007-03-17T03:39:35.996577', '11656', '1'), - ('3.99', '56', '2007-03-21T05:31:31.996577', '14291', '2'), - ('7.99', '56', '2007-03-23T08:51:54.996577', '15702', '2'), - ('0.99', '56', '2007-04-29T00:28:44.996577', '8285', '1'), - ('0.99', '56', '2007-02-17T20:08:55.996577', '2140', '1'), - ('0.99', '56', '2007-02-20T07:28:03.996577', '2989', '1'), - ('4.99', '56', '2007-04-08T10:10:02.996577', '4702', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['23227', '29619', '17661', '20590', '20595', '17659', '20592', '20594', '20601', '20600', '17663', '26482', '26479', '26472', '17662', '26480', '26484', '20589', '20593', '26473', '26477', '26476', '17660', '20599', '26483', '20597', '26481', '26474', '26478', '26485', '20591', '26475', '20596', '20598', '20237', '17519', '20239', '26035', '26040', '20234', '26038', '20238', '20235', '20236', '17521', '20233', '17520', '26037', '26039', '26036', '29036', '18507', '22716', '22713', '22710', '22715', '18512', '18508', '22714', '22711', '22709', '18511', '29033', '18509', '29034', '18510', '22718', '22712', '22717', '22719', '29032', '29035', '19463', '25042', '25043', '31791', '19464', '25040', '25044', '31790', '25034', '25045', '19466', '19468', '25037', '25038', '19465', '25036', '25035', '25039', '19462', '19467', '25041', '31792', '31794', '31793', '31795', '23667', '30180', '23661']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('8.99', '56', '2007-03-20T02:45:42.996577', '13560', '2'), - ('7.99', '56', '2007-04-28T02:10:01.996577', '7696', '1'), - ('2.99', '381', '2007-02-18T15:23:34.996577', '2410', '2'), - ('0.99', '381', '2007-03-01T17:07:20.996577', '10705', '2'), - ('8.99', '381', '2007-03-19T13:26:56.996577', '13202', '2'), - ('3.99', '381', '2007-02-15T14:59:34.996577', '1402', '1'), - ('2.99', '381', '2007-03-17T22:18:50.996577', '12135', '2'), - ('2.99', '381', '2007-03-18T16:22:47.996577', '12632', '2'), - ('4.99', '381', '2007-03-23T10:57:50.996577', '15747', '1'), - ('4.99', '381', '2007-03-22T18:11:23.996577', '15299', '2'), - ('2.99', '381', '2007-02-21T16:35:33.996577', '3425', '2'), - ('0.99', '381', '2007-04-30T08:50:41.996577', '9144', '2'), - ('2.99', '381', '2007-04-27T13:50:59.996577', '7375', '1'), - ('0.99', '381', '2007-04-06T13:50:45.996577', '3812', '2'), - ('4.99', '381', '2007-02-18T15:43:08.996577', '2418', '1'), - ('2.99', '381', '2007-04-27T23:56:08.996577', '7645', '1'), - ('2.99', '381', '2007-04-30T10:16:51.996577', '9822', '1'), - ('0.99', '381', '2007-03-01T13:17:07.996577', '10608', '1'), - ('4.99', '381', '2007-03-18T01:53:04.996577', '12237', '2'), - ('2.99', '381', '2007-04-06T21:16:43.996577', '3970', '2'), - ('4.99', '381', '2007-04-11T23:20:45.996577', '6451', '2'), - ('2.99', '381', '2007-04-11T06:06:04.996577', '6116', '2'), - ('1.99', '381', '2007-02-17T01:23:58.996577', '1878', '1'), - ('4.99', '381', '2007-03-21T02:16:57.996577', '14198', '1'), - ('4.99', '381', '2007-04-30T10:08:36.996577', '9173', '2'), - ('0.99', '381', '2007-03-20T04:57:03.996577', '13614', '1'), - ('0.99', '381', '2007-04-29T14:59:58.996577', '8688', '2'), - ('0.99', '381', '2007-04-08T11:40:53.996577', '4735', '1'), - ('2.99', '381', '2007-04-12T14:34:26.996577', '6778', '2'), - ('4.99', '381', '2007-04-30T17:12:55.996577', '10033', '2'), - ('2.99', '381', '2007-03-16T22:29:53.996577', '11519', '1'), - ('0.99', '381', '2007-04-10T07:52:43.996577', '5689', '2'), - ('0.99', '381', '2007-03-19T21:54:09.996577', '13430', '2'), - ('2.99', '381', '2007-03-20T18:03:09.996577', '13995', '2'), - ('0.99', '344', '2007-03-21T16:46:25.996577', '14621', '1'), - ('3.99', '344', '2007-02-15T10:54:44.996577', '1341', '1'), - ('2.99', '344', '2007-03-22T15:23:52.996577', '15215', '1'), - ('5.99', '344', '2007-04-07T00:47:40.996577', '4028', '2'), - ('4.99', '344', '2007-04-30T08:56:47.996577', '9788', '2'), - ('5.99', '344', '2007-03-18T00:02:39.996577', '12183', '2'), - ('4.99', '344', '2007-04-27T17:48:19.996577', '7480', '2'), - ('0.99', '344', '2007-03-21T17:01:08.996577', '14624', '2'), - ('4.99', '344', '2007-03-19T06:24:34.996577', '13014', '2'), - ('3.99', '344', '2007-03-19T07:03:05.996577', '13033', '1'), - ('0.99', '344', '2007-02-16T14:00:38.996577', '1731', '1'), - ('5.99', '344', '2007-03-02T07:03:06.996577', '11116', '2'), - ('4.99', '344', '2007-02-15T19:36:27.996577', '1475', '2'), - ('5.99', '344', '2007-04-11T19:41:45.996577', '6363', '2'), - ('2.99', '344', '2007-04-29T09:57:38.996577', '8561', '2'), - ('3.99', '344', '2007-04-07T17:27:23.996577', '4347', '2'), - ('5.99', '4', '2007-04-30T17:26:26.996577', '9371', '1'), - ('4.99', '4', '2007-02-15T07:59:54.996577', '1297', '1'), - ('6.99', '4', '2007-03-20T11:24:06.996577', '13807', '1'), - ('8.99', '4', '2007-03-18T03:43:10.996577', '12294', '2'), - ('2.99', '4', '2007-03-02T06:48:57.996577', '11110', '1'), - ('2.99', '4', '2007-03-20T08:00:30.996577', '13704', '1'), - ('5.99', '4', '2007-02-19T08:07:27.996577', '2642', '1'), - ('0.99', '4', '2007-02-16T06:37:06.996577', '1633', '1'), - ('1.99', '4', '2007-03-19T00:47:39.996577', '12856', '2'), - ('4.99', '4', '2007-03-16T22:56:27.996577', '11529', '2'), - ('0.99', '4', '2007-03-02T05:38:00.996577', '11069', '2'), - ('0.99', '4', '2007-02-17T12:59:38.996577', '2043', '2'), - ('2.99', '4', '2007-04-28T03:06:25.996577', '7718', '2'), - ('2.99', '4', '2007-02-16T12:29:53.996577', '1707', '2'), - ('3.99', '4', '2007-04-29T17:13:23.996577', '8741', '1'), - ('0.99', '4', '2007-02-16T14:20:18.996577', '1735', '2'), - ('2.99', '4', '2007-03-22T12:26:49.996577', '15147', '1'), - ('2.99', '4', '2007-03-17T22:42:29.996577', '12151', '1'), - ('4.99', '4', '2007-03-21T03:22:03.996577', '14225', '2'), - ('1.99', '4', '2007-03-23T06:11:26.996577', '15635', '2'), - ('2.99', '4', '2007-04-28T00:38:36.996577', '7660', '1'), - ('5.99', '4', '2007-04-30T07:14:35.996577', '9100', '1'), - ('0.99', '256', '2007-02-17T07:46:05.996577', '1965', '2'), - ('3.99', '256', '2007-03-21T11:16:19.996577', '14458', '2'), - ('2.99', '256', '2007-03-23T05:24:30.996577', '15609', '2'), - ('0.99', '256', '2007-04-07T08:56:26.996577', '4182', '2'), - ('4.99', '256', '2007-02-17T07:54:41.996577', '1973', '2'), - ('4.99', '256', '2007-03-20T20:03:53.996577', '14036', '2'), - ('4.99', '256', '2007-03-23T14:44:11.996577', '15861', '2'), - ('0.99', '256', '2007-04-07T06:20:19.996577', '4130', '1'), - ('4.99', '256', '2007-03-01T18:51:17.996577', '10759', '2'), - ('7.99', '256', '2007-03-23T14:46:38.996577', '15864', '1'), - ('6.99', '256', '2007-02-18T13:28:30.996577', '2380', '1'), - ('4.99', '256', '2007-02-19T20:35:50.996577', '2839', '1'), - ('0.99', '256', '2007-03-19T23:01:48.996577', '13457', '2'), - ('0.99', '256', '2007-03-20T06:18:34.996577', '13651', '1'), - ('4.99', '256', '2007-02-18T02:19:15.996577', '2230', '2'), - ('8.99', '256', '2007-03-17T02:55:44.996577', '11628', '2'), - ('2.99', '256', '2007-03-02T03:35:33.996577', '11011', '2'), - ('6.99', '256', '2007-03-20T18:44:32.996577', '14003', '1'), - ('2.99', '256', '2007-02-16T00:45:33.996577', '1555', '1'), - ('4.99', '256', '2007-02-19T01:43:18.996577', '2561', '2'), - ('2.99', '256', '2007-03-21T10:36:08.996577', '14445', '2'), - ('2.99', '256', '2007-04-09T08:29:10.996577', '5179', '1'), - ('3.99', '256', '2007-04-28T00:38:53.996577', '7661', '1'), - ('0.99', '256', '2007-04-11T16:10:59.996577', '6298', '1'), - ('2.99', '256', '2007-04-30T19:39:22.996577', '9424', '2'), - ('2.99', '105', '2007-03-23T12:55:33.996577', '15803', '2'), - ('4.99', '105', '2007-04-09T19:42:29.996577', '5429', '1'), - ('2.99', '105', '2007-03-19T02:32:00.996577', '12899', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['23663', '30181', '23665', '18907', '23664', '30179', '30187', '18906', '30184', '30186', '18908', '23659', '30183', '30182', '23660', '30188', '23666', '23662', '30185', '17635', '20533', '20531', '20528', '26412', '17636', '20530', '26413', '20538', '17634', '20535', '20534', '26415', '26416', '20532', '26414', '20527', '20529', '20537', '20536', '26537', '26538', '26540', '20650', '20647', '20648', '20654', '20646', '17691', '20652', '17694', '26541', '20645', '17690', '26539', '20655', '20651', '17692', '17695', '17693', '20649', '20653', '21311', '27297', '21315', '17951', '27301', '17953', '27296', '21313', '17955', '17954', '17952', '17956', '21316', '17957', '21314', '27298', '21318', '27300', '21319', '27302', '21320', '21312', '27299', '21317', '24602', '32077', '31252', '31245', '19282', '19277', '24608', '31244', '24604', '24605', '31248', '24601', '31247', '19281', '31250']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('2.99', '105', '2007-03-20T09:45:29.996577', '13751', '1'), - ('2.99', '105', '2007-04-10T01:14:19.996577', '5542', '2'), - ('4.99', '105', '2007-03-23T05:52:53.996577', '15624', '2'), - ('3.99', '105', '2007-02-17T09:17:49.996577', '1991', '2'), - ('0.99', '105', '2007-03-20T20:31:44.996577', '14048', '2'), - ('4.99', '105', '2007-04-09T12:35:22.996577', '5261', '2'), - ('5.99', '105', '2007-04-30T11:05:34.996577', '9198', '2'), - ('3.99', '105', '2007-02-16T18:17:44.996577', '1789', '2'), - ('2.99', '105', '2007-04-27T16:15:26.996577', '7442', '1'), - ('3.99', '105', '2007-04-30T08:11:38.996577', '9124', '2'), - ('3.99', '105', '2007-02-19T07:37:11.996577', '2635', '2'), - ('4.99', '105', '2007-03-01T10:06:00.996577', '10513', '1'), - ('4.99', '105', '2007-04-12T03:25:43.996577', '6546', '2'), - ('4.99', '105', '2007-04-10T07:09:54.996577', '5677', '2'), - ('0.99', '105', '2007-03-18T01:13:10.996577', '12217', '1'), - ('9.99', '105', '2007-04-30T11:25:10.996577', '9210', '2'), - ('4.99', '105', '2007-03-23T08:17:11.996577', '15688', '2'), - ('6.99', '105', '2007-03-19T08:08:31.996577', '13057', '1'), - ('2.99', '105', '2007-04-30T02:50:41.996577', '8980', '2'), - ('5.99', '375', '2007-02-15T20:26:33.996577', '1499', '1'), - ('5.99', '375', '2007-03-02T03:34:43.996577', '11008', '2'), - ('5.99', '375', '2007-03-01T22:40:05.996577', '10859', '1'), - ('1.99', '375', '2007-03-01T12:39:35.996577', '10589', '2'), - ('6.99', '375', '2007-04-06T21:40:38.996577', '3981', '1'), - ('4.99', '375', '2007-02-18T02:40:59.996577', '2236', '1'), - ('4.99', '375', '2007-03-01T15:39:20.996577', '10672', '1'), - ('4.99', '375', '2007-04-07T17:02:23.996577', '4335', '2'), - ('4.99', '375', '2007-03-23T01:14:39.996577', '15505', '1'), - ('2.99', '375', '2007-02-15T15:07:19.996577', '1404', '2'), - ('0.99', '375', '2007-03-18T17:39:18.996577', '12663', '2'), - ('9.99', '375', '2007-03-17T21:49:11.996577', '12122', '2'), - ('4.99', '375', '2007-04-28T08:16:50.996577', '7856', '1'), - ('2.99', '375', '2007-04-29T23:35:29.996577', '8900', '2'), - ('6.99', '375', '2007-03-02T02:16:21.996577', '10961', '1'), - ('2.99', '375', '2007-04-09T21:52:23.996577', '5474', '2'), - ('0.99', '375', '2007-03-01T01:45:17.996577', '10274', '1'), - ('0.99', '375', '2007-03-01T14:13:17.996577', '10640', '1'), - ('2.99', '375', '2007-03-22T06:43:47.996577', '15004', '1'), - ('4.99', '375', '2007-03-20T12:46:42.996577', '13836', '1'), - ('4.99', '387', '2007-04-11T11:25:31.996577', '6216', '2'), - ('6.99', '387', '2007-04-11T23:33:37.996577', '6456', '2'), - ('0.99', '387', '2007-04-27T18:33:53.996577', '7497', '1'), - ('2.99', '387', '2007-03-19T07:09:55.996577', '13034', '2'), - ('2.99', '387', '2007-03-17T04:42:06.996577', '11682', '2'), - ('4.99', '387', '2007-03-17T22:50:56.996577', '12153', '2'), - ('5.99', '387', '2007-03-21T05:07:34.996577', '14279', '2'), - ('4.99', '387', '2007-03-01T22:04:36.996577', '10838', '1'), - ('0.99', '387', '2007-02-15T19:11:34.996577', '1465', '2'), - ('0.99', '387', '2007-03-20T06:15:31.996577', '13645', '2'), - ('5.99', '387', '2007-02-20T07:03:43.996577', '2981', '2'), - ('2.99', '387', '2007-04-28T16:55:55.996577', '8090', '1'), - ('0.99', '387', '2007-03-01T11:36:00.996577', '10564', '1'), - ('0.99', '387', '2007-02-15T19:06:40.996577', '1464', '1'), - ('5.99', '387', '2007-04-12T02:21:05.996577', '6517', '1'), - ('0.99', '387', '2007-03-22T05:45:02.996577', '14979', '2'), - ('5.99', '387', '2007-03-19T08:47:45.996577', '13082', '1'), - ('0.99', '387', '2007-02-17T14:40:12.996577', '2068', '1'), - ('4.99', '387', '2007-02-21T12:19:54.996577', '3378', '2'), - ('0.99', '387', '2007-02-17T17:21:47.996577', '2100', '2'), - ('6.99', '387', '2007-03-19T03:53:32.996577', '12936', '1'), - ('4.99', '387', '2007-03-20T10:16:18.996577', '13772', '2'), - ('5.99', '456', '2007-03-01T10:12:39.996577', '10519', '2'), - ('2.99', '456', '2007-04-06T17:04:03.996577', '3881', '2'), - ('4.99', '456', '2007-03-19T19:00:14.996577', '13348', '1'), - ('2.99', '456', '2007-02-15T07:10:18.996577', '1288', '1'), - ('2.99', '456', '2007-04-27T09:06:11.996577', '7248', '2'), - ('5.99', '456', '2007-02-17T17:41:36.996577', '2103', '2'), - ('7.99', '456', '2007-04-06T10:32:20.996577', '3743', '1'), - ('4.99', '456', '2007-03-18T00:20:09.996577', '12188', '1'), - ('4.99', '456', '2007-02-18T00:04:13.996577', '2192', '1'), - ('6.99', '456', '2007-02-17T20:54:49.996577', '2146', '2'), - ('0.99', '456', '2007-02-16T11:46:49.996577', '1700', '1'), - ('0.99', '456', '2007-02-18T15:02:14.996577', '2404', '1'), - ('4.99', '456', '2007-03-20T02:21:42.996577', '13547', '1'), - ('2.99', '456', '2007-02-19T03:22:39.996577', '2581', '1'), - ('8.99', '456', '2007-03-19T11:14:21.996577', '13144', '1'), - ('3.99', '456', '2007-04-07T06:47:46.996577', '4141', '1'), - ('1.99', '456', '2007-03-21T19:10:51.996577', '14690', '2'), - ('0.99', '456', '2007-04-11T00:44:23.996577', '6023', '2'), - ('3.99', '456', '2007-03-23T09:43:46.996577', '15720', '1'), - ('4.99', '456', '2007-04-29T17:41:41.996577', '8749', '1'), - ('2.99', '456', '2007-03-23T16:11:42.996577', '15910', '1'), - ('2.99', '456', '2007-03-01T21:11:26.996577', '10813', '1'), - ('0.99', '456', '2007-04-10T22:15:44.996577', '5964', '2'), - ('2.99', '456', '2007-03-21T04:16:18.996577', '14253', '2'), - ('8.99', '200', '2007-03-02T16:11:06.996577', '11356', '1'), - ('2.99', '200', '2007-05-14T13:44:29.996577', '11866', '2'), - ('2.99', '200', '2007-04-29T06:44:08.996577', '8462', '2'), - ('2.99', '200', '2007-04-09T05:25:51.996577', '5110', '1'), - ('4.99', '200', '2007-02-19T13:14:36.996577', '2717', '2'), - ('1.99', '200', '2007-02-15T07:52:25.996577', '1296', '2'), - ('6.99', '200', '2007-03-23T18:04:08.996577', '15961', '1'), - ('4.99', '200', '2007-04-06T02:17:10.996577', '3580', '1'), - ('10.99', '200', '2007-03-20T20:00:18.996577', '14034', '1'), - ('6.99', '200', '2007-03-21T13:29:58.996577', '14521', '2'), - ('4.99', '200', '2007-04-11T09:38:37.996577', '6181', '1'), - ('2.99', '200', '2007-03-01T16:18:04.996577', '10685', '1'), - ('2.99', '200', '2007-04-11T08:49:47.996577', '6167', '2'), - ('3.99', '200', '2007-02-19T09:57:12.996577', '2667', '2'), - ('2.99', '200', '2007-04-27T21:21:26.996577', '7574', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['19280', '24607', '24606', '31253', '19278', '24603', '31249', '19283', '31251', '31246', '19279', '23346', '23347', '23339', '29751', '23341', '32036', '23343', '29758', '29753', '23345', '29756', '18773', '29760', '23344', '29759', '29750', '23340', '29755', '29752', '23342', '29754', '18772', '29757', '27148', '27147', '21161', '21165', '27145', '27132', '27135', '27143', '21164', '27144', '27142', '17883', '31964', '27133', '17882', '21163', '21166', '27137', '21160', '27141', '27134', '27146', '27139', '27136', '21162', '27138', '27140', '31002', '19176', '31001', '19170', '24369', '30999', '24367', '24370', '30995', '24373', '30998', '24376', '30997', '19177', '30991', '19173', '24374', '19171', '30993', '24371', '19174', '24377', '31000', '24375', '24372', '19172', '30994', '19175', '30992', '24368', '24366', '30996', '24195', '30777', '30785', '30779', '24191', '24197', '30783']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('4.99', '200', '2007-02-18T02:11:49.996577', '2227', '1'), - ('5.99', '200', '2007-03-23T10:40:03.996577', '15742', '2'), - ('4.99', '200', '2007-03-23T08:22:20.996577', '15691', '2'), - ('6.99', '200', '2007-04-30T23:30:50.996577', '9527', '1'), - ('4.99', '200', '2007-02-15T08:39:15.996577', '1309', '2'), - ('5.99', '200', '2007-03-20T09:10:16.996577', '13737', '1'), - ('3.99', '200', '2007-04-26T22:10:29.996577', '6947', '1'), - ('3.99', '200', '2007-02-20T21:55:41.996577', '3190', '1'), - ('3.99', '200', '2007-04-29T03:44:07.996577', '8368', '2'), - ('0.99', '200', '2007-04-11T06:30:53.996577', '6123', '1'), - ('6.99', '200', '2007-02-17T02:57:41.996577', '1899', '2'), - ('2.99', '69', '2007-03-21T22:11:26.996577', '14767', '2'), - ('2.99', '69', '2007-03-23T02:54:16.996577', '15547', '1'), - ('3.99', '69', '2007-03-17T15:29:08.996577', '11943', '1'), - ('0.99', '69', '2007-04-07T12:56:17.996577', '4265', '1'), - ('2.99', '69', '2007-03-17T21:49:06.996577', '12121', '1'), - ('0.99', '69', '2007-05-14T13:44:29.996577', '11995', '2'), - ('5.99', '69', '2007-03-19T06:42:20.996577', '13023', '1'), - ('2.99', '69', '2007-04-30T10:57:08.996577', '9193', '2'), - ('3.99', '69', '2007-04-10T02:06:58.996577', '5569', '2'), - ('0.99', '69', '2007-03-21T18:59:51.996577', '14685', '2'), - ('6.99', '69', '2007-04-12T14:59:23.996577', '6785', '2'), - ('4.99', '69', '2007-02-21T10:25:06.996577', '3358', '1'), - ('0.99', '69', '2007-04-30T18:25:42.996577', '10074', '2'), - ('3.99', '69', '2007-03-21T06:14:13.996577', '14311', '2'), - ('2.99', '69', '2007-04-30T02:26:57.996577', '9612', '1'), - ('8.99', '69', '2007-04-06T17:08:04.996577', '3883', '1'), - ('2.99', '69', '2007-03-17T17:49:14.996577', '12012', '1'), - ('6.99', '69', '2007-04-11T20:35:58.996577', '6385', '1'), - ('0.99', '69', '2007-04-07T20:57:17.996577', '4427', '1'), - ('5.99', '69', '2007-03-19T05:06:14.996577', '12966', '1'), - ('4.99', '69', '2007-04-11T16:05:48.996577', '6297', '2'), - ('2.99', '69', '2007-02-16T00:25:41.996577', '1549', '1'), - ('6.99', '69', '2007-04-29T13:25:59.996577', '8649', '2'), - ('1.99', '441', '2007-04-30T20:30:46.996577', '10139', '2'), - ('2.99', '441', '2007-04-30T11:28:00.996577', '9854', '2'), - ('1.99', '441', '2007-03-02T12:02:34.996577', '11247', '2'), - ('4.99', '441', '2007-03-21T23:09:15.996577', '14796', '2'), - ('4.99', '441', '2007-04-29T12:14:40.996577', '8617', '2'), - ('0.99', '441', '2007-04-06T04:51:48.996577', '3629', '2'), - ('0.99', '441', '2007-04-07T10:02:48.996577', '4208', '2'), - ('4.99', '441', '2007-04-29T05:37:02.996577', '8427', '1'), - ('4.99', '441', '2007-03-20T15:45:26.996577', '13932', '1'), - ('4.99', '441', '2007-04-29T10:21:13.996577', '8575', '1'), - ('0.99', '441', '2007-04-29T00:14:26.996577', '8281', '1'), - ('4.99', '441', '2007-02-18T08:45:47.996577', '2328', '2'), - ('4.99', '441', '2007-05-14T13:44:29.996577', '14878', '1'), - ('2.99', '441', '2007-04-06T08:30:34.996577', '3695', '2'), - ('4.99', '441', '2007-02-16T04:41:06.996577', '1602', '1'), - ('4.99', '441', '2007-03-20T09:13:36.996577', '13739', '2'), - ('3.99', '441', '2007-03-22T09:24:11.996577', '15070', '2'), - ('0.99', '441', '2007-04-10T13:55:30.996577', '5811', '1'), - ('1.99', '441', '2007-03-01T22:16:20.996577', '10846', '1'), - ('2.99', '441', '2007-04-28T22:58:22.996577', '8237', '2'), - ('8.99', '441', '2007-04-07T03:44:26.996577', '4084', '1'), - ('10.99', '441', '2007-04-30T04:09:01.996577', '9644', '2'), - ('4.99', '441', '2007-04-12T09:06:18.996577', '6642', '1'), - ('2.99', '441', '2007-04-09T05:56:59.996577', '5129', '2'), - ('2.99', '441', '2007-03-19T23:45:04.996577', '13483', '2'), - ('2.99', '441', '2007-04-12T08:18:12.996577', '6636', '2'), - ('5.99', '441', '2007-04-26T21:47:15.996577', '6941', '1'), - ('6.99', '176', '2007-04-30T08:56:21.996577', '9145', '2'), - ('1.99', '176', '2007-02-18T21:45:45.996577', '2503', '2'), - ('2.99', '176', '2007-04-29T00:12:03.996577', '8279', '1'), - ('5.99', '176', '2007-02-15T07:23:27.996577', '1291', '1'), - ('5.99', '176', '2007-03-17T04:36:05.996577', '11678', '1'), - ('2.99', '176', '2007-04-27T19:33:08.996577', '7521', '2'), - ('0.99', '176', '2007-03-01T07:24:22.996577', '10441', '2'), - ('2.99', '176', '2007-03-18T04:00:58.996577', '12299', '1'), - ('6.99', '176', '2007-04-11T19:22:53.996577', '6354', '1'), - ('5.99', '176', '2007-03-19T12:51:45.996577', '13186', '2'), - ('2.99', '176', '2007-04-27T07:47:31.996577', '7210', '1'), - ('4.99', '176', '2007-03-22T18:25:18.996577', '15311', '2'), - ('2.99', '176', '2007-04-27T01:08:55.996577', '7025', '1'), - ('4.99', '176', '2007-02-20T02:42:13.996577', '2922', '1'), - ('4.99', '176', '2007-04-06T05:48:34.996577', '3643', '1'), - ('8.99', '176', '2007-02-17T23:16:57.996577', '2181', '1'), - ('7.99', '176', '2007-03-20T22:10:57.996577', '14083', '1'), - ('7.99', '176', '2007-02-16T15:00:03.996577', '1741', '1'), - ('3.99', '176', '2007-04-07T05:42:16.996577', '4121', '2'), - ('2.99', '176', '2007-03-18T19:50:10.996577', '12718', '1'), - ('2.99', '176', '2007-02-18T01:41:39.996577', '2218', '1'), - ('4.99', '176', '2007-03-23T17:05:10.996577', '15933', '1'), - ('5.99', '176', '2007-04-28T04:24:39.996577', '7751', '1'), - ('1.99', '176', '2007-03-21T03:35:28.996577', '14232', '2'), - ('7.99', '176', '2007-03-19T12:14:14.996577', '13170', '1'), - ('6.99', '176', '2007-02-16T21:41:31.996577', '1836', '1'), - ('2.99', '176', '2007-04-11T01:30:11.996577', '6035', '1'), - ('2.99', '176', '2007-02-18T16:13:26.996577', '2427', '2'), - ('6.99', '176', '2007-04-06T19:32:12.996577', '3931', '2'), - ('2.99', '176', '2007-03-01T22:46:00.996577', '10862', '1'), - ('2.99', '176', '2007-03-01T01:51:07.996577', '10277', '1'), - ('4.99', '176', '2007-04-27T00:44:29.996577', '7017', '1'), - ('0.99', '157', '2007-03-19T02:55:31.996577', '12916', '1'), - ('0.99', '157', '2007-04-28T19:40:14.996577', '8163', '2'), - ('2.99', '157', '2007-04-30T14:32:22.996577', '9958', '1'), - ('0.99', '157', '2007-04-29T03:17:51.996577', '8347', '2'), - ('4.99', '157', '2007-03-02T12:04:06.996577', '11249', '2'), - ('4.99', '157', '2007-03-19T13:59:32.996577', '13214', '1'), - ('2.99', '157', '2007-04-30T12:16:43.996577', '9237', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['30780', '30774', '30776', '24198', '30784', '30771', '30782', '30769', '24192', '30786', '30778', '30772', '24196', '30781', '30770', '24199', '19109', '24193', '30773', '30775', '24200', '24194', '20413', '20411', '26274', '26267', '20410', '26275', '26265', '17593', '26269', '20407', '26268', '17592', '26262', '26271', '17596', '20406', '26273', '26261', '26264', '20409', '26272', '26263', '20412', '20408', '17594', '26266', '17595', '26270', '31173', '24531', '31174', '24538', '31175', '24534', '24535', '24536', '24539', '24532', '31176', '24530', '31171', '24533', '19251', '32075', '19246', '31172', '19248', '19250', '19249', '24537', '19247', '25901', '25894', '25908', '20117', '20114', '25898', '25900', '20111', '25910', '25904', '20115', '25905', '25895', '20109', '25903', '25899', '25897', '20112', '25907', '20116', '25902', '25896', '25906', '25909', '20113', '20110', '25868']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('4.99', '157', '2007-04-29T10:23:27.996577', '8576', '2'), - ('2.99', '157', '2007-04-27T03:59:14.996577', '7110', '1'), - ('4.99', '157', '2007-04-27T18:38:54.996577', '7499', '2'), - ('6.99', '157', '2007-03-19T23:39:38.996577', '13481', '1'), - ('4.99', '157', '2007-04-30T13:20:02.996577', '9264', '2'), - ('3.99', '157', '2007-04-07T21:19:30.996577', '4435', '2'), - ('4.99', '157', '2007-04-29T20:59:50.996577', '8827', '1'), - ('0.99', '157', '2007-04-06T10:22:44.996577', '3739', '1'), - ('4.99', '157', '2007-03-02T15:26:03.996577', '11335', '2'), - ('4.99', '157', '2007-04-30T23:13:53.996577', '10203', '1'), - ('0.99', '157', '2007-04-29T03:00:21.996577', '8337', '2'), - ('0.99', '157', '2007-04-08T20:10:20.996577', '4919', '1'), - ('4.99', '157', '2007-03-19T09:19:09.996577', '13097', '1'), - ('0.99', '157', '2007-04-29T15:50:24.996577', '8707', '1'), - ('5.99', '157', '2007-04-07T12:41:39.996577', '4253', '1'), - ('2.99', '157', '2007-03-20T08:39:33.996577', '13728', '1'), - ('0.99', '157', '2007-02-18T09:59:22.996577', '2340', '2'), - ('5.99', '157', '2007-03-18T01:02:21.996577', '12213', '1'), - ('4.99', '157', '2007-04-10T16:49:14.996577', '5862', '1'), - ('2.99', '157', '2007-04-27T07:15:27.996577', '7195', '2'), - ('4.99', '157', '2007-03-22T05:32:51.996577', '14974', '2'), - ('6.99', '157', '2007-03-18T10:02:00.996577', '12464', '1'), - ('4.99', '363', '2007-03-22T19:13:21.996577', '15335', '1'), - ('5.99', '363', '2007-03-22T06:00:49.996577', '14983', '1'), - ('4.99', '363', '2007-04-30T15:00:42.996577', '9968', '1'), - ('4.99', '363', '2007-04-12T19:05:39.996577', '6878', '2'), - ('2.99', '363', '2007-03-21T19:15:08.996577', '14694', '1'), - ('8.99', '363', '2007-04-30T15:27:08.996577', '9977', '1'), - ('4.99', '363', '2007-04-12T11:21:37.996577', '6705', '2'), - ('4.99', '363', '2007-02-16T01:47:35.996577', '1569', '2'), - ('4.99', '363', '2007-04-28T02:47:41.996577', '7708', '2'), - ('5.99', '363', '2007-03-18T00:20:10.996577', '12189', '2'), - ('2.99', '363', '2007-04-27T09:26:58.996577', '7256', '1'), - ('4.99', '363', '2007-02-15T16:44:50.996577', '1426', '2'), - ('3.99', '363', '2007-04-10T07:35:45.996577', '5687', '2'), - ('3.99', '363', '2007-04-29T08:44:45.996577', '8522', '2'), - ('2.99', '363', '2007-02-21T04:37:13.996577', '3281', '2'), - ('6.99', '363', '2007-03-01T03:34:16.996577', '10339', '1'), - ('4.99', '363', '2007-04-29T21:24:33.996577', '8841', '2'), - ('3.99', '363', '2007-04-06T09:44:15.996577', '3726', '1'), - ('4.99', '363', '2007-04-11T07:09:13.996577', '6140', '2'), - ('9.99', '363', '2007-03-20T08:01:22.996577', '13706', '1'), - ('2.99', '363', '2007-04-29T19:56:45.996577', '8804', '2'), - ('6.99', '363', '2007-04-10T11:11:09.996577', '5758', '1'), - ('4.99', '363', '2007-03-22T17:37:15.996577', '15279', '2'), - ('4.99', '363', '2007-03-18T21:31:45.996577', '12760', '2'), - ('4.99', '363', '2007-02-16T22:33:48.996577', '1847', '1'), - ('2.99', '363', '2007-04-12T16:50:36.996577', '6821', '2'), - ('4.99', '363', '2007-02-19T00:33:14.996577', '2540', '1'), - ('2.99', '363', '2007-04-28T17:54:11.996577', '8121', '2'), - ('4.99', '193', '2007-04-29T03:58:06.996577', '8379', '1'), - ('0.99', '193', '2007-03-18T07:05:24.996577', '12384', '2'), - ('4.99', '193', '2007-04-29T05:41:14.996577', '8431', '1'), - ('6.99', '193', '2007-03-22T19:30:14.996577', '15344', '2'), - ('2.99', '193', '2007-04-30T06:30:26.996577', '9079', '1'), - ('0.99', '193', '2007-03-20T04:39:10.996577', '13608', '1'), - ('2.99', '193', '2007-03-21T18:43:24.996577', '14679', '1'), - ('4.99', '193', '2007-03-22T04:00:19.996577', '14927', '1'), - ('5.99', '193', '2007-03-23T00:54:36.996577', '15495', '2'), - ('4.99', '193', '2007-03-18T17:34:08.996577', '12658', '2'), - ('4.99', '193', '2007-04-30T01:20:19.996577', '9575', '1'), - ('2.99', '193', '2007-03-01T08:06:54.996577', '10462', '2'), - ('6.99', '193', '2007-04-08T18:34:51.996577', '4892', '1'), - ('2.99', '193', '2007-03-20T01:36:13.996577', '13529', '1'), - ('8.99', '193', '2007-02-21T05:36:45.996577', '3297', '1'), - ('2.99', '193', '2007-05-14T13:44:29.996577', '15729', '2'), - ('4.99', '193', '2007-02-15T09:31:50.996577', '1325', '1'), - ('2.99', '193', '2007-04-28T22:02:48.996577', '8211', '1'), - ('6.99', '193', '2007-02-19T20:49:32.996577', '2841', '2'), - ('2.99', '193', '2007-02-19T23:53:20.996577', '2880', '2'), - ('4.99', '193', '2007-02-19T21:20:40.996577', '2846', '2'), - ('4.99', '193', '2007-03-22T13:16:19.996577', '15164', '2'), - ('6.99', '193', '2007-02-18T13:24:49.996577', '2377', '2'), - ('7.99', '332', '2007-04-27T02:01:07.996577', '7049', '2'), - ('6.99', '332', '2007-04-07T04:49:18.996577', '4100', '1'), - ('5.99', '332', '2007-04-30T17:55:48.996577', '9388', '1'), - ('3.99', '332', '2007-03-22T15:06:02.996577', '15210', '1'), - ('2.99', '332', '2007-03-20T06:55:56.996577', '13673', '2'), - ('2.99', '332', '2007-04-09T17:39:37.996577', '5381', '2'), - ('0.99', '332', '2007-04-09T20:13:43.996577', '5440', '1'), - ('5.99', '332', '2007-03-02T11:25:03.996577', '11229', '1'), - ('4.99', '332', '2007-04-30T17:00:17.996577', '10026', '1'), - ('4.99', '332', '2007-04-27T21:26:43.996577', '7578', '2'), - ('4.99', '332', '2007-03-21T22:50:23.996577', '14783', '2'), - ('8.99', '332', '2007-04-28T11:01:36.996577', '7934', '2'), - ('6.99', '332', '2007-04-07T15:16:19.996577', '4302', '1'), - ('0.99', '332', '2007-03-01T02:50:20.996577', '10307', '1'), - ('8.99', '332', '2007-04-27T21:24:33.996577', '7577', '2'), - ('0.99', '332', '2007-04-09T17:53:51.996577', '5388', '2'), - ('1.99', '332', '2007-04-09T13:09:08.996577', '5277', '1'), - ('2.99', '332', '2007-03-16T23:56:15.996577', '11564', '2'), - ('1.99', '332', '2007-04-30T15:57:18.996577', '9324', '1'), - ('0.99', '332', '2007-03-22T14:36:00.996577', '15194', '2'), - ('2.99', '332', '2007-04-27T15:27:35.996577', '7418', '2'), - ('2.99', '332', '2007-04-09T05:38:38.996577', '5116', '2'), - ('6.99', '332', '2007-04-28T20:04:10.996577', '8173', '2'), - ('0.99', '332', '2007-04-30T13:27:47.996577', '9921', '1'), - ('4.99', '332', '2007-03-18T04:50:22.996577', '12318', '2'), - ('0.99', '332', '2007-03-01T07:22:52.996577', '10439', '2'), - ('6.99', '329', '2007-04-30T10:25:21.996577', '9827', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['25865', '25860', '25858', '25861', '25866', '20086', '25864', '20090', '20087', '25857', '20085', '25859', '25867', '25856', '25863', '20092', '20088', '20091', '20089', '20094', '20093', '25862', '18576', '22880', '22893', '22879', '22892', '22878', '29215', '18574', '18573', '22887', '22889', '22883', '22877', '22890', '22881', '18575', '22885', '29212', '18572', '22891', '22884', '29210', '29216', '22882', '22886', '29209', '29214', '22888', '32016', '29208', '29211', '29213', '24103', '30675', '30681', '30694', '30674', '30679', '19074', '19073', '24105', '19075', '24108', '24106', '30687', '19076', '24094', '30678', '30680', '30676', '30673', '24102', '30683', '30684', '30682', '30693', '30686', '30688', '24092', '24099', '30685', '30690', '24093', '19077', '24101', '30691', '24095', '24096', '30689', '30692', '24100', '24097', '24107', '24104', '30677', '24098', '24109', '29907']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('4.99', '329', '2007-04-30T04:13:08.996577', '9024', '2'), - ('2.99', '329', '2007-04-08T08:47:54.996577', '4674', '2'), - ('4.99', '329', '2007-04-07T20:30:09.996577', '4415', '1'), - ('4.99', '329', '2007-04-28T12:45:15.996577', '7980', '1'), - ('0.99', '329', '2007-04-30T11:43:47.996577', '9219', '2'), - ('0.99', '329', '2007-03-01T09:05:37.996577', '10490', '2'), - ('0.99', '329', '2007-04-30T01:27:47.996577', '8941', '2'), - ('6.99', '329', '2007-03-18T17:34:15.996577', '12659', '1'), - ('2.99', '329', '2007-03-02T07:37:25.996577', '11130', '1'), - ('4.99', '329', '2007-04-07T03:20:41.996577', '4076', '2'), - ('7.99', '329', '2007-03-01T08:24:50.996577', '10473', '1'), - ('1.99', '329', '2007-04-07T22:36:11.996577', '4465', '1'), - ('0.99', '329', '2007-04-30T17:51:30.996577', '9381', '1'), - ('2.99', '329', '2007-04-06T21:28:46.996577', '3976', '2'), - ('6.99', '329', '2007-04-29T06:36:29.996577', '8460', '1'), - ('4.99', '329', '2007-03-22T02:56:14.996577', '14900', '1'), - ('3.99', '329', '2007-03-02T08:48:08.996577', '11169', '2'), - ('8.99', '329', '2007-03-20T05:27:26.996577', '13627', '1'), - ('0.99', '329', '2007-03-17T05:37:45.996577', '11697', '2'), - ('2.99', '329', '2007-03-22T18:22:57.996577', '15308', '1'), - ('4.99', '329', '2007-03-22T06:59:33.996577', '15011', '2'), - ('7.99', '329', '2007-04-28T20:03:02.996577', '8172', '2'), - ('10.99', '21', '2007-02-20T23:33:01.996577', '3212', '1'), - ('0.99', '21', '2007-03-17T16:21:35.996577', '11970', '2'), - ('4.99', '21', '2007-03-22T01:48:52.996577', '14869', '1'), - ('0.99', '21', '2007-03-02T05:39:23.996577', '11072', '2'), - ('2.99', '21', '2007-03-21T10:39:07.996577', '14446', '2'), - ('0.99', '21', '2007-03-01T17:57:13.996577', '10734', '1'), - ('0.99', '21', '2007-04-30T09:13:38.996577', '9149', '2'), - ('2.99', '21', '2007-02-18T14:06:21.996577', '2393', '1'), - ('4.99', '21', '2007-02-18T04:42:07.996577', '2268', '1'), - ('8.99', '21', '2007-03-19T23:19:20.996577', '13463', '1'), - ('4.99', '21', '2007-03-20T09:17:09.996577', '13740', '1'), - ('6.99', '21', '2007-03-18T22:02:48.996577', '12774', '1'), - ('4.99', '21', '2007-03-01T11:51:32.996577', '10570', '2'), - ('8.99', '21', '2007-03-20T21:52:33.996577', '14077', '2'), - ('2.99', '21', '2007-03-17T22:02:42.996577', '12131', '2'), - ('4.99', '21', '2007-02-19T19:42:59.996577', '2830', '2'), - ('4.99', '21', '2007-03-19T20:37:54.996577', '13399', '2'), - ('0.99', '21', '2007-04-28T13:25:20.996577', '7994', '1'), - ('7.99', '21', '2007-02-18T02:37:16.996577', '2235', '2'), - ('2.99', '21', '2007-03-21T01:20:25.996577', '14161', '2'), - ('2.99', '21', '2007-03-19T20:06:23.996577', '13381', '1'), - ('2.99', '21', '2007-04-10T22:11:49.996577', '5961', '1'), - ('5.99', '21', '2007-04-30T05:57:51.996577', '9699', '1'), - ('4.99', '21', '2007-03-18T17:35:49.996577', '12660', '2'), - ('4.99', '21', '2007-03-19T21:12:04.996577', '13411', '1'), - ('3.99', '21', '2007-04-10T11:56:06.996577', '5772', '1'), - ('2.99', '21', '2007-04-29T22:17:49.996577', '8862', '2'), - ('9.99', '21', '2007-03-20T07:54:40.996577', '13699', '1'), - ('2.99', '21', '2007-05-14T13:44:29.996577', '14933', '1'), - ('4.99', '21', '2007-04-09T05:10:58.996577', '5107', '2'), - ('1.99', '21', '2007-04-26T21:56:39.996577', '6943', '2'), - ('6.99', '21', '2007-04-28T21:24:37.996577', '8196', '2'), - ('0.99', '148', '2007-03-21T19:55:50.996577', '14713', '2'), - ('2.99', '148', '2007-04-08T12:16:21.996577', '4746', '1'), - ('10.99', '148', '2007-04-12T15:06:21.996577', '6793', '2'), - ('4.99', '148', '2007-04-30T18:06:24.996577', '10067', '2'), - ('0.99', '148', '2007-04-07T03:38:20.996577', '4080', '1'), - ('1.99', '148', '2007-04-11T08:54:22.996577', '6169', '1'), - ('6.99', '148', '2007-02-15T21:48:52.996577', '1517', '2'), - ('1.99', '148', '2007-02-15T20:31:01.996577', '1501', '1'), - ('2.99', '148', '2007-03-22T05:14:19.996577', '14965', '2'), - ('3.99', '148', '2007-02-19T15:07:49.996577', '2751', '2'), - ('3.99', '148', '2007-03-23T02:42:19.996577', '15541', '1'), - ('4.99', '148', '2007-03-22T16:12:56.996577', '15237', '2'), - ('4.99', '148', '2007-04-29T04:30:40.996577', '8394', '1'), - ('3.99', '148', '2007-02-19T21:05:05.996577', '2843', '2'), - ('2.99', '148', '2007-03-17T18:35:27.996577', '12029', '1'), - ('4.99', '148', '2007-04-09T17:17:05.996577', '5372', '1'), - ('8.99', '148', '2007-04-12T08:55:45.996577', '6640', '1'), - ('2.99', '148', '2007-04-08T21:26:33.996577', '4950', '1'), - ('0.99', '148', '2007-04-06T06:13:39.996577', '3653', '1'), - ('2.99', '148', '2007-03-21T17:08:18.996577', '14629', '2'), - ('4.99', '148', '2007-04-28T01:59:48.996577', '7693', '2'), - ('9.99', '148', '2007-04-28T08:35:30.996577', '7865', '1'), - ('0.99', '148', '2007-04-28T00:35:45.996577', '7656', '1'), - ('4.99', '148', '2007-04-30T01:52:18.996577', '9594', '1'), - ('3.99', '148', '2007-04-29T02:41:55.996577', '8331', '2'), - ('4.99', '148', '2007-04-29T10:26:40.996577', '8578', '2'), - ('6.99', '148', '2007-03-01T21:46:32.996577', '10830', '2'), - ('0.99', '148', '2007-03-20T20:46:26.996577', '14055', '1'), - ('4.99', '148', '2007-04-28T17:38:29.996577', '8111', '2'), - ('5.99', '148', '2007-04-30T04:05:06.996577', '9023', '1'), - ('10.99', '148', '2007-03-02T16:11:15.996577', '11357', '1'), - ('5.99', '148', '2007-02-19T21:22:27.996577', '2847', '2'), - ('6.99', '148', '2007-03-21T01:53:16.996577', '14184', '2'), - ('2.99', '148', '2007-04-30T07:21:00.996577', '9106', '1'), - ('0.99', '148', '2007-03-17T18:56:52.996577', '12038', '2'), - ('3.99', '148', '2007-03-18T11:56:53.996577', '12512', '2'), - ('4.99', '148', '2007-04-29T12:31:46.996577', '8626', '2'), - ('1.99', '148', '2007-04-30T23:37:32.996577', '9530', '1'), - ('4.99', '148', '2007-03-21T01:00:01.996577', '14155', '1'), - ('6.99', '148', '2007-03-19T04:16:38.996577', '12944', '1'), - ('8.99', '148', '2007-03-22T20:54:39.996577', '15379', '2'), - ('5.99', '148', '2007-03-22T02:10:38.996577', '14879', '2'), - ('4.99', '148', '2007-04-09T01:16:41.996577', '5034', '1'), - ('6.99', '148', '2007-03-19T05:35:17.996577', '12983', '1'), - ('3.99', '148', '2007-03-23T04:25:30.996577', '15586', '2'), - ('8.99', '82', '2007-04-30T15:14:22.996577', '9305', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['29904', '29905', '23473', '18815', '23477', '29899', '29898', '23476', '23474', '23472', '18814', '29906', '18816', '29908', '23479', '23478', '23475', '29900', '18813', '18812', '29902', '29901', '29903', '26536', '26533', '26530', '17688', '20641', '17687', '26535', '26532', '20642', '20644', '26527', '26531', '17685', '20638', '20640', '26524', '20643', '26525', '17689', '17686', '26528', '20637', '20636', '20635', '26526', '20639', '26534', '26529', '27514', '27507', '27512', '27510', '21525', '21527', '27505', '27509', '27506', '27501', '21526', '21524', '27504', '27503', '27515', '21522', '27513', '21523', '27502', '21528', '27508', '27511', '31123', '31118', '31126', '31124', '31116', '24487', '19219', '19224', '24484', '19220', '31120', '24479', '19221', '31119', '19223', '24483', '24480', '31117', '31125', '24482', '19222', '24485', '24481', '31122', '31121', '24486', '19218']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('0.99', '82', '2007-04-28T08:48:12.996577', '7873', '2'), - ('4.99', '82', '2007-04-29T07:22:15.996577', '8487', '1'), - ('5.99', '82', '2007-03-17T05:10:24.996577', '11688', '2'), - ('8.99', '82', '2007-02-19T18:41:59.996577', '2819', '1'), - ('0.99', '82', '2007-03-21T13:27:24.996577', '14518', '2'), - ('6.99', '82', '2007-04-08T05:14:52.996577', '4598', '1'), - ('2.99', '82', '2007-04-06T07:44:36.996577', '3680', '1'), - ('6.99', '82', '2007-03-20T13:02:25.996577', '13847', '2'), - ('3.99', '82', '2007-03-18T10:24:08.996577', '12470', '1'), - ('4.99', '82', '2007-03-02T06:28:15.996577', '11093', '1'), - ('8.99', '82', '2007-02-18T21:58:19.996577', '2506', '1'), - ('3.99', '82', '2007-04-30T13:42:11.996577', '9277', '2'), - ('0.99', '82', '2007-02-21T08:23:38.996577', '3332', '2'), - ('6.99', '82', '2007-04-30T20:22:48.996577', '9447', '1'), - ('3.99', '82', '2007-03-23T01:41:20.996577', '15516', '2'), - ('4.99', '82', '2007-03-22T02:43:31.996577', '14892', '2'), - ('0.99', '82', '2007-03-19T07:00:16.996577', '13032', '1'), - ('4.99', '82', '2007-04-10T10:43:38.996577', '5746', '2'), - ('0.99', '82', '2007-02-16T01:49:59.996577', '1570', '2'), - ('0.99', '82', '2007-02-15T17:07:17.996577', '1438', '1'), - ('6.99', '82', '2007-04-12T11:39:21.996577', '6708', '2'), - ('6.99', '82', '2007-04-11T03:41:07.996577', '6082', '2'), - ('9.99', '82', '2007-04-28T03:33:13.996577', '7733', '2'), - ('5.99', '386', '2007-04-30T05:18:32.996577', '9686', '1'), - ('4.99', '386', '2007-04-29T03:10:10.996577', '8340', '2'), - ('2.99', '386', '2007-04-11T13:57:00.996577', '6261', '2'), - ('0.99', '386', '2007-02-19T13:48:05.996577', '2732', '1'), - ('3.99', '386', '2007-03-20T08:16:58.996577', '13716', '1'), - ('5.99', '386', '2007-02-16T20:01:16.996577', '1819', '2'), - ('0.99', '386', '2007-04-30T02:11:17.996577', '9602', '2'), - ('4.99', '386', '2007-04-12T12:00:54.996577', '6715', '2'), - ('2.99', '386', '2007-03-20T10:06:42.996577', '13764', '1'), - ('0.99', '386', '2007-03-23T17:34:30.996577', '15949', '1'), - ('2.99', '386', '2007-04-10T21:50:01.996577', '5953', '1'), - ('3.99', '386', '2007-04-11T17:31:00.996577', '6324', '1'), - ('3.99', '386', '2007-02-16T03:19:39.996577', '1585', '2'), - ('2.99', '386', '2007-03-02T07:31:51.996577', '11128', '2'), - ('2.99', '386', '2007-03-19T04:51:03.996577', '12961', '2'), - ('6.99', '386', '2007-04-06T12:25:57.996577', '3783', '2'), - ('6.99', '386', '2007-03-20T13:37:23.996577', '13869', '2'), - ('8.99', '386', '2007-04-07T09:19:33.996577', '4189', '1'), - ('2.99', '386', '2007-02-21T09:50:05.996577', '3351', '1'), - ('2.99', '386', '2007-02-16T04:57:23.996577', '1608', '1'), - ('4.99', '386', '2007-04-11T01:35:20.996577', '6037', '1'), - ('2.99', '386', '2007-03-01T17:20:14.996577', '10715', '1'), - ('3.99', '386', '2007-03-01T13:35:04.996577', '10618', '2'), - ('4.99', '386', '2007-03-01T11:55:19.996577', '10572', '1'), - ('0.99', '386', '2007-04-10T00:17:50.996577', '5524', '1'), - ('4.99', '386', '2007-03-17T05:29:34.996577', '11695', '2'), - ('2.99', '386', '2007-04-29T17:43:05.996577', '8751', '1'), - ('2.99', '386', '2007-04-11T11:54:15.996577', '6222', '1'), - ('2.99', '475', '2007-04-30T07:27:44.996577', '9737', '1'), - ('2.99', '475', '2007-04-09T21:36:33.996577', '5469', '2'), - ('7.99', '475', '2007-04-30T10:38:22.996577', '9183', '1'), - ('1.99', '475', '2007-04-28T05:33:02.996577', '7775', '1'), - ('4.99', '475', '2007-03-17T08:33:31.996577', '11770', '1'), - ('1.99', '475', '2007-03-22T10:12:08.996577', '15097', '1'), - ('0.99', '475', '2007-04-09T18:44:33.996577', '5407', '1'), - ('7.99', '475', '2007-04-27T23:44:11.996577', '7641', '1'), - ('9.99', '475', '2007-04-09T18:58:29.996577', '5415', '2'), - ('5.99', '475', '2007-04-06T21:39:37.996577', '3980', '2'), - ('2.99', '475', '2007-03-21T05:51:09.996577', '14303', '2'), - ('5.99', '475', '2007-03-02T13:29:09.996577', '11293', '1'), - ('0.99', '475', '2007-04-09T17:36:29.996577', '5379', '2'), - ('4.99', '475', '2007-04-08T06:23:34.996577', '4617', '1'), - ('3.99', '475', '2007-04-30T21:39:27.996577', '10162', '2'), - ('0.99', '475', '2007-03-01T04:18:15.996577', '10357', '1'), - ('2.99', '475', '2007-04-30T04:13:41.996577', '9647', '1'), - ('3.99', '475', '2007-03-01T14:05:43.996577', '10633', '1'), - ('6.99', '475', '2007-04-06T23:26:26.996577', '4013', '1'), - ('4.99', '475', '2007-03-22T17:52:24.996577', '15288', '1'), - ('4.99', '475', '2007-04-11T12:10:44.996577', '6224', '1'), - ('5.99', '475', '2007-04-28T21:54:57.996577', '8207', '2'), - ('4.99', '187', '2007-04-27T10:55:17.996577', '7289', '2'), - ('0.99', '187', '2007-04-09T16:57:03.996577', '5366', '2'), - ('2.99', '187', '2007-04-30T12:27:07.996577', '9241', '1'), - ('7.99', '187', '2007-04-28T07:44:45.996577', '7844', '2'), - ('10.99', '187', '2007-04-06T08:55:22.996577', '3709', '2'), - ('7.99', '187', '2007-03-23T18:27:59.996577', '15971', '2'), - ('4.99', '187', '2007-02-15T19:06:06.996577', '1462', '2'), - ('2.99', '187', '2007-02-21T14:23:03.996577', '3402', '1'), - ('8.99', '187', '2007-03-22T00:55:58.996577', '14855', '2'), - ('0.99', '187', '2007-02-16T03:43:03.996577', '1592', '2'), - ('6.99', '187', '2007-04-10T15:07:50.996577', '5833', '2'), - ('2.99', '187', '2007-03-17T11:43:16.996577', '11843', '1'), - ('0.99', '187', '2007-02-17T19:23:14.996577', '2127', '2'), - ('8.99', '187', '2007-04-10T10:19:17.996577', '5738', '1'), - ('5.99', '187', '2007-02-19T14:34:13.996577', '2742', '1'), - ('8.99', '187', '2007-03-20T15:57:23.996577', '13940', '2'), - ('8.99', '187', '2007-03-18T04:16:49.996577', '12307', '2'), - ('4.99', '187', '2007-04-07T21:01:13.996577', '4429', '1'), - ('7.99', '187', '2007-04-28T12:25:17.996577', '7967', '2'), - ('7.99', '187', '2007-03-18T12:33:07.996577', '12534', '1'), - ('0.99', '187', '2007-02-19T00:02:52.996577', '2533', '2'), - ('4.99', '187', '2007-03-22T16:01:23.996577', '15231', '2'), - ('9.99', '187', '2007-03-18T11:17:11.996577', '12490', '2'), - ('2.99', '187', '2007-04-11T22:30:17.996577', '6428', '2'), - ('3.99', '187', '2007-04-11T02:32:06.996577', '6057', '1'), - ('2.99', '187', '2007-03-23T01:41:27.996577', '15517', '2'), - ('6.99', '187', '2007-02-15T09:23:43.996577', '1323', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['23908', '23905', '30474', '23910', '19010', '30481', '23912', '19009', '23915', '30476', '23904', '30472', '30473', '23916', '30475', '23906', '23911', '23914', '23909', '30478', '30477', '30480', '23913', '30471', '30479', '30482', '23907', '28294', '28295', '22145', '22150', '28291', '28290', '18275', '22147', '22148', '22144', '28293', '28288', '22149', '28289', '22146', '28292', '22142', '22143', '28287', '21363', '21375', '21365', '21369', '21372', '27351', '27349', '27354', '21367', '27350', '21366', '21371', '21374', '21370', '17977', '27352', '27345', '27347', '21373', '27355', '21362', '27353', '21364', '27348', '27346', '17978', '21368', '29790', '23379', '29787', '29793', '29792', '23376', '23370', '23367', '23375', '23368', '23366', '29788', '23377', '23371', '23378', '29786', '23372', '23374', '29791', '23373', '18778', '23369', '29789', '23364', '23365', '29794', '29795']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('0.99', '131', '2007-03-18T01:05:33.996577', '12216', '1'), - ('1.99', '131', '2007-03-01T22:41:12.996577', '10861', '1'), - ('2.99', '131', '2007-04-10T03:38:18.996577', '5610', '1'), - ('9.99', '131', '2007-03-18T06:33:01.996577', '12372', '1'), - ('4.99', '131', '2007-02-16T16:30:32.996577', '1768', '2'), - ('3.99', '131', '2007-04-30T15:50:10.996577', '9323', '1'), - ('7.99', '131', '2007-03-19T18:56:47.996577', '13346', '2'), - ('9.99', '131', '2007-02-16T07:41:19.996577', '1646', '1'), - ('2.99', '131', '2007-03-23T07:17:09.996577', '15659', '2'), - ('3.99', '131', '2007-04-10T17:31:17.996577', '5874', '1'), - ('4.99', '131', '2007-03-01T07:48:35.996577', '10459', '1'), - ('4.99', '131', '2007-04-09T11:12:52.996577', '5233', '1'), - ('4.99', '131', '2007-04-09T18:11:03.996577', '5395', '1'), - ('2.99', '131', '2007-03-23T20:49:06.996577', '16042', '1'), - ('2.99', '131', '2007-04-10T09:50:34.996577', '5726', '2'), - ('0.99', '131', '2007-03-17T16:22:08.996577', '11971', '2'), - ('6.99', '131', '2007-03-19T07:59:49.996577', '13050', '2'), - ('0.99', '131', '2007-03-19T20:54:52.996577', '13407', '1'), - ('0.99', '131', '2007-03-18T02:44:44.996577', '12263', '2'), - ('0.99', '131', '2007-04-28T15:56:14.996577', '8071', '2'), - ('2.99', '131', '2007-04-27T20:46:45.996577', '7557', '1'), - ('8.99', '131', '2007-04-29T10:08:34.996577', '8570', '1'), - ('2.99', '131', '2007-03-19T19:22:09.996577', '13353', '2'), - ('2.99', '131', '2007-04-05T23:17:21.996577', '3515', '1'), - ('6.99', '131', '2007-04-28T23:49:28.996577', '8267', '1'), - ('2.99', '131', '2007-04-30T22:18:20.996577', '10179', '1'), - ('2.99', '131', '2007-03-17T16:24:24.996577', '11973', '1'), - ('2.99', '545', '2007-04-30T09:51:07.996577', '9810', '2'), - ('4.99', '545', '2007-04-30T14:04:09.996577', '9942', '2'), - ('2.99', '545', '2007-03-18T05:52:08.996577', '12349', '1'), - ('4.99', '545', '2007-03-23T19:09:35.996577', '15998', '2'), - ('5.99', '545', '2007-04-27T02:45:03.996577', '7078', '1'), - ('0.99', '545', '2007-04-09T12:39:54.996577', '5264', '1'), - ('2.99', '545', '2007-02-17T19:16:56.996577', '2123', '1'), - ('2.99', '545', '2007-03-18T22:55:37.996577', '12800', '1'), - ('4.99', '545', '2007-03-20T04:22:53.996577', '13595', '1'), - ('4.99', '545', '2007-03-17T21:06:57.996577', '12098', '1'), - ('2.99', '545', '2007-04-29T21:49:24.996577', '8848', '2'), - ('5.99', '545', '2007-04-06T21:28:35.996577', '3975', '1'), - ('0.99', '545', '2007-03-23T04:23:48.996577', '15585', '1'), - ('5.99', '545', '2007-04-08T05:12:08.996577', '4597', '1'), - ('10.99', '545', '2007-03-18T17:40:11.996577', '12667', '2'), - ('3.99', '545', '2007-04-29T11:27:18.996577', '8599', '2'), - ('2.99', '545', '2007-03-02T01:13:25.996577', '10931', '2'), - ('2.99', '545', '2007-03-17T08:12:48.996577', '11760', '2'), - ('8.99', '545', '2007-04-06T08:24:35.996577', '3693', '2'), - ('0.99', '461', '2007-03-02T05:22:14.996577', '11063', '2'), - ('7.99', '461', '2007-03-23T05:31:45.996577', '15613', '2'), - ('2.99', '461', '2007-03-17T18:21:11.996577', '12022', '2'), - ('4.99', '461', '2007-03-22T02:44:14.996577', '14893', '1'), - ('6.99', '461', '2007-03-22T19:16:14.996577', '15336', '1'), - ('0.99', '461', '2007-04-28T18:29:32.996577', '8133', '2'), - ('2.99', '461', '2007-04-27T12:28:24.996577', '7334', '2'), - ('0.99', '461', '2007-04-30T12:27:58.996577', '9885', '1'), - ('2.99', '461', '2007-03-19T16:02:26.996577', '13269', '1'), - ('2.99', '461', '2007-04-28T00:52:49.996577', '7664', '2'), - ('2.99', '461', '2007-03-19T14:20:30.996577', '13223', '1'), - ('4.99', '461', '2007-03-22T14:21:58.996577', '15187', '2'), - ('2.99', '461', '2007-03-22T23:24:09.996577', '15449', '2'), - ('2.99', '461', '2007-03-22T09:17:47.996577', '15067', '1'), - ('5.99', '461', '2007-02-20T17:08:09.996577', '3127', '2'), - ('0.99', '461', '2007-04-28T19:45:45.996577', '8164', '2'), - ('0.99', '461', '2007-04-06T08:37:46.996577', '3698', '2'), - ('0.99', '461', '2007-04-10T05:45:27.996577', '5650', '1'), - ('2.99', '461', '2007-03-22T22:04:07.996577', '15411', '2'), - ('4.99', '461', '2007-04-30T19:38:29.996577', '10113', '2'), - ('2.99', '461', '2007-03-01T01:26:33.996577', '10260', '1'), - ('4.99', '461', '2007-04-30T22:26:56.996577', '9499', '2'), - ('0.99', '461', '2007-03-02T10:58:46.996577', '11219', '2'), - ('2.99', '461', '2007-04-10T13:47:56.996577', '5809', '1'), - ('2.99', '461', '2007-04-08T04:40:59.996577', '4586', '2'), - ('4.99', '461', '2007-02-21T06:54:12.996577', '3319', '2'), - ('4.99', '461', '2007-03-21T01:59:33.996577', '14186', '1'), - ('4.99', '72', '2007-04-10T15:37:35.996577', '5840', '1'), - ('2.99', '72', '2007-03-22T12:26:21.996577', '15146', '2'), - ('4.99', '72', '2007-04-09T10:34:29.996577', '5223', '2'), - ('2.99', '72', '2007-04-30T04:26:53.996577', '9027', '1'), - ('4.99', '72', '2007-04-28T22:37:24.996577', '8228', '2'), - ('4.99', '72', '2007-03-20T06:34:22.996577', '13660', '2'), - ('2.99', '72', '2007-03-17T18:18:59.996577', '12020', '2'), - ('2.99', '72', '2007-03-17T02:56:12.996577', '11630', '1'), - ('0.99', '72', '2007-03-20T04:27:31.996577', '13597', '2'), - ('4.99', '72', '2007-03-17T04:37:20.996577', '11679', '1'), - ('5.99', '72', '2007-03-02T18:20:34.996577', '11422', '2'), - ('4.99', '72', '2007-04-09T14:11:02.996577', '5302', '1'), - ('0.99', '72', '2007-03-20T19:28:09.996577', '14020', '1'), - ('0.99', '72', '2007-03-18T09:27:30.996577', '12448', '1'), - ('0.99', '72', '2007-03-22T10:45:12.996577', '15110', '2'), - ('0.99', '72', '2007-04-06T08:40:45.996577', '3700', '1'), - ('0.99', '72', '2007-03-18T14:46:20.996577', '12593', '2'), - ('4.99', '72', '2007-03-19T18:24:11.996577', '13327', '2'), - ('0.99', '72', '2007-04-11T03:39:35.996577', '6081', '2'), - ('0.99', '72', '2007-03-19T11:22:19.996577', '13145', '1'), - ('4.99', '72', '2007-02-18T06:15:00.996577', '2294', '2'), - ('2.99', '72', '2007-03-17T14:50:13.996577', '11923', '1'), - ('0.99', '72', '2007-04-09T19:27:35.996577', '5424', '1'), - ('0.99', '72', '2007-03-01T01:35:52.996577', '10267', '2'), - ('6.99', '72', '2007-03-02T10:26:29.996577', '11206', '2'), - ('5.99', '72', '2007-04-30T19:33:44.996577', '9420', '2'), - ('4.99', '72', '2007-04-30T04:14:29.996577', '9648', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['28322', '28317', '18281', '28318', '22171', '28319', '28321', '22174', '22169', '22172', '22173', '22170', '18282', '31992', '28320', '18283', '31679', '24935', '24941', '24942', '24937', '31678', '24940', '19423', '31677', '19421', '19422', '31680', '31682', '31676', '24945', '24944', '31688', '24936', '31683', '31685', '31681', '24946', '32093', '24939', '31684', '24943', '31675', '24938', '31686', '31687', '18867', '30044', '23590', '30045', '23586', '30043', '30048', '18869', '18865', '23589', '32045', '23585', '30046', '30049', '23588', '18868', '23587', '18866', '30047', '31580', '24858', '31575', '31579', '31584', '19386', '31583', '24863', '31573', '24857', '32092', '24856', '31572', '24859', '31586', '19384', '31585', '31574', '31581', '31571', '24860', '31589', '31570', '19390', '31588', '31577', '19388', '19383', '24861', '31576', '31578', '24855', '19389', '19387', '24862']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('5.99', '548', '2007-04-30T02:27:57.996577', '9614', '1'), - ('2.99', '548', '2007-04-06T08:06:16.996577', '3686', '1'), - ('1.99', '548', '2007-02-15T09:36:05.996577', '1326', '1'), - ('2.99', '548', '2007-04-06T12:05:14.996577', '3777', '2'), - ('3.99', '548', '2007-03-20T07:36:05.996577', '13691', '1'), - ('7.99', '548', '2007-04-07T07:29:15.996577', '4155', '1'), - ('4.99', '548', '2007-04-12T00:56:29.996577', '6490', '2'), - ('6.99', '548', '2007-03-21T20:20:58.996577', '14723', '2'), - ('0.99', '548', '2007-03-01T03:05:19.996577', '10318', '2'), - ('7.99', '548', '2007-03-20T08:45:35.996577', '13730', '2'), - ('0.99', '548', '2007-03-21T02:00:30.996577', '14188', '2'), - ('5.99', '548', '2007-03-19T00:53:07.996577', '12860', '1'), - ('2.99', '548', '2007-02-18T05:15:20.996577', '2280', '1'), - ('0.99', '548', '2007-05-14T13:44:29.996577', '13584', '1'), - ('4.99', '548', '2007-04-09T06:29:12.996577', '5138', '2'), - ('0.99', '548', '2007-02-20T06:53:42.996577', '2978', '2'), - ('4.99', '244', '2007-04-10T12:14:20.996577', '5779', '1'), - ('6.99', '244', '2007-03-01T16:15:26.996577', '10684', '2'), - ('0.99', '244', '2007-03-20T10:22:27.996577', '13774', '2'), - ('0.99', '244', '2007-03-20T15:40:54.996577', '13928', '1'), - ('0.99', '244', '2007-03-02T08:26:41.996577', '11157', '2'), - ('0.99', '244', '2007-04-10T08:00:48.996577', '5692', '2'), - ('4.99', '244', '2007-03-20T05:34:22.996577', '13630', '1'), - ('3.99', '244', '2007-02-20T05:15:01.996577', '2955', '2'), - ('0.99', '244', '2007-04-09T21:16:30.996577', '5461', '2'), - ('6.99', '244', '2007-02-14T23:32:48.996577', '1189', '2'), - ('5.99', '244', '2007-02-16T03:52:12.996577', '1595', '1'), - ('3.99', '244', '2007-04-10T13:34:08.996577', '5803', '1'), - ('2.99', '244', '2007-04-12T06:45:16.996577', '6608', '2'), - ('4.99', '244', '2007-04-09T17:53:40.996577', '5387', '2'), - ('1.99', '244', '2007-03-22T03:35:43.996577', '14919', '1'), - ('0.99', '244', '2007-03-21T18:08:09.996577', '14657', '2'), - ('5.99', '244', '2007-04-30T20:56:31.996577', '10152', '1'), - ('2.99', '244', '2007-03-02T02:32:58.996577', '10969', '2'), - ('2.99', '244', '2007-04-12T10:42:31.996577', '6683', '2'), - ('5.99', '244', '2007-04-29T21:33:34.996577', '8844', '2'), - ('4.99', '244', '2007-04-11T20:04:36.996577', '6374', '2'), - ('3.99', '244', '2007-03-22T05:36:16.996577', '14975', '1'), - ('4.99', '244', '2007-05-14T13:44:29.996577', '12736', '2'), - ('9.99', '244', '2007-03-17T08:16:32.996577', '11762', '1'), - ('0.99', '244', '2007-04-29T06:17:30.996577', '8454', '2'), - ('0.99', '244', '2007-03-21T08:00:10.996577', '14367', '1'), - ('4.99', '244', '2007-04-08T15:39:35.996577', '4814', '1'), - ('9.99', '244', '2007-03-02T12:37:34.996577', '11267', '1'), - ('4.99', '244', '2007-04-30T16:14:44.996577', '10001', '1'), - ('4.99', '244', '2007-04-30T17:36:09.996577', '10047', '2'), - ('3.99', '94', '2007-02-16T14:17:56.996577', '1734', '2'), - ('8.99', '94', '2007-04-07T14:05:57.996577', '4287', '1'), - ('0.99', '94', '2007-03-23T08:28:50.996577', '15693', '1'), - ('4.99', '94', '2007-04-10T09:36:06.996577', '5719', '2'), - ('5.99', '94', '2007-03-20T10:41:50.996577', '13786', '1'), - ('0.99', '94', '2007-04-07T01:50:49.996577', '4044', '2'), - ('0.99', '94', '2007-04-28T12:44:56.996577', '7979', '2'), - ('2.99', '94', '2007-02-19T18:32:49.996577', '2816', '1'), - ('2.99', '94', '2007-02-15T01:42:31.996577', '1213', '2'), - ('0.99', '94', '2007-03-22T05:41:41.996577', '14978', '1'), - ('4.99', '94', '2007-05-14T13:44:29.996577', '15371', '1'), - ('2.99', '94', '2007-03-18T04:44:35.996577', '12316', '1'), - ('4.99', '94', '2007-04-10T22:33:16.996577', '5970', '2'), - ('4.99', '94', '2007-04-30T02:18:33.996577', '9605', '1'), - ('4.99', '94', '2007-03-22T01:35:04.996577', '14865', '1'), - ('4.99', '94', '2007-02-19T06:34:55.996577', '2620', '2'), - ('1.99', '94', '2007-03-21T23:19:51.996577', '14804', '2'), - ('4.99', '94', '2007-02-15T12:53:43.996577', '1367', '1'), - ('2.99', '94', '2007-04-28T06:28:12.996577', '7809', '2'), - ('4.99', '236', '2007-04-26T23:42:11.996577', '6996', '2'), - ('4.99', '236', '2007-03-17T13:43:33.996577', '11895', '1'), - ('3.99', '236', '2007-04-10T01:18:55.996577', '5545', '1'), - ('2.99', '236', '2007-04-11T16:24:09.996577', '6303', '1'), - ('4.99', '236', '2007-04-28T05:52:28.996577', '7792', '1'), - ('6.99', '236', '2007-02-18T07:19:55.996577', '2311', '2'), - ('5.99', '236', '2007-04-28T05:40:21.996577', '7780', '1'), - ('7.99', '236', '2007-03-21T07:53:37.996577', '14364', '1'), - ('0.99', '236', '2007-04-08T21:50:49.996577', '4959', '1'), - ('5.99', '236', '2007-03-16T21:55:09.996577', '11507', '2'), - ('0.99', '236', '2007-05-14T13:44:29.996577', '12988', '1'), - ('3.99', '236', '2007-03-02T21:02:32.996577', '11486', '2'), - ('4.99', '236', '2007-04-08T12:34:24.996577', '4749', '2'), - ('2.99', '236', '2007-03-19T05:19:45.996577', '12975', '1'), - ('2.99', '236', '2007-04-29T13:37:51.996577', '8657', '1'), - ('5.99', '236', '2007-02-15T08:36:14.996577', '1308', '2'), - ('2.99', '236', '2007-04-28T06:10:25.996577', '7798', '2'), - ('2.99', '236', '2007-04-09T18:39:09.996577', '5404', '1'), - ('4.99', '236', '2007-04-27T01:59:37.996577', '7047', '2'), - ('4.99', '236', '2007-04-06T15:36:20.996577', '3857', '2'), - ('2.99', '236', '2007-03-19T19:37:56.996577', '13364', '1'), - ('4.99', '236', '2007-04-30T20:30:07.996577', '10137', '2'), - ('0.99', '236', '2007-04-06T05:50:35.996577', '3645', '1'), - ('2.99', '236', '2007-02-21T20:15:22.996577', '3460', '2'), - ('2.99', '236', '2007-04-30T13:53:52.996577', '9934', '1'), - ('0.99', '236', '2007-04-11T02:00:58.996577', '6049', '2'), - ('3.99', '236', '2007-02-19T20:46:10.996577', '2840', '2'), - ('0.99', '236', '2007-02-15T05:23:19.996577', '1262', '1'), - ('7.99', '236', '2007-03-19T22:22:08.996577', '13443', '1'), - ('3.99', '236', '2007-04-10T20:46:08.996577', '5938', '2'), - ('4.99', '236', '2007-04-11T15:06:42.996577', '6281', '2'), - ('6.99', '236', '2007-03-02T07:56:02.996577', '11139', '2'), - ('4.99', '236', '2007-02-21T09:57:49.996577', '3353', '1'), - ('2.99', '236', '2007-02-19T07:15:47.996577', '2630', '1'), - ('4.99', '236', '2007-03-21T06:33:38.996577', '14321', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['31587', '19385', '31582', '24864', '17540', '26104', '20281', '26108', '20287', '26100', '20282', '20286', '17538', '17539', '26110', '26103', '26101', '20285', '20283', '31939', '20284', '20288', '20289', '26102', '26105', '26109', '20291', '26106', '20290', '17537', '26111', '26107', '27060', '21095', '27059', '17859', '21096', '21091', '21089', '21088', '27055', '21094', '27054', '27057', '21090', '17860', '21092', '27053', '27052', '17862', '27058', '21093', '21087', '17857', '17858', '27056', '17863', '17861', '28045', '21940', '28046', '28047', '21939', '28038', '18195', '28042', '28044', '28032', '28041', '21935', '28035', '18197', '28030', '18194', '28037', '21943', '21938', '28036', '28043', '21937', '21942', '21941', '28031', '18196', '28029', '28034', '21936', '28040', '28033', '28039', '21780', '21784', '21782', '27849', '27853', '21783', '27854', '31979', '18131', '18129']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('5.99', '236', '2007-04-30T03:44:55.996577', '9011', '1'), - ('8.99', '236', '2007-02-17T19:58:00.996577', '2139', '2'), - ('0.99', '236', '2007-04-27T09:15:03.996577', '7253', '2'), - ('4.99', '236', '2007-03-21T20:19:19.996577', '14722', '2'), - ('8.99', '349', '2007-02-20T12:27:47.996577', '3067', '1'), - ('4.99', '349', '2007-04-09T19:50:26.996577', '5433', '1'), - ('4.99', '349', '2007-03-02T03:05:18.996577', '10987', '1'), - ('4.99', '349', '2007-04-29T01:14:12.996577', '8297', '2'), - ('6.99', '349', '2007-03-21T02:19:53.996577', '14200', '2'), - ('3.99', '349', '2007-04-05T22:01:15.996577', '3488', '2'), - ('4.99', '349', '2007-03-02T09:58:07.996577', '11192', '2'), - ('4.99', '349', '2007-03-20T05:48:35.996577', '13636', '2'), - ('0.99', '349', '2007-02-15T22:47:06.996577', '1523', '1'), - ('6.99', '349', '2007-02-20T07:24:16.996577', '2987', '2'), - ('5.99', '349', '2007-04-30T05:01:59.996577', '9670', '1'), - ('0.99', '349', '2007-04-08T18:09:00.996577', '4881', '1'), - ('2.99', '349', '2007-04-07T09:21:05.996577', '4190', '1'), - ('4.99', '349', '2007-03-19T15:34:03.996577', '13258', '1'), - ('8.99', '349', '2007-03-02T21:15:13.996577', '11492', '2'), - ('2.99', '349', '2007-05-14T13:44:29.996577', '14915', '1'), - ('3.99', '349', '2007-03-17T14:08:44.996577', '11905', '1'), - ('6.99', '349', '2007-03-21T20:19:17.996577', '14721', '2'), - ('4.99', '349', '2007-03-22T03:12:36.996577', '14908', '2'), - ('5.99', '349', '2007-04-08T00:11:11.996577', '4494', '2'), - ('4.99', '349', '2007-04-26T23:54:40.996577', '7002', '1'), - ('1.99', '349', '2007-04-30T13:13:28.996577', '9262', '1'), - ('5.99', '349', '2007-03-23T17:47:32.996577', '15955', '1'), - ('4.99', '349', '2007-04-27T01:56:22.996577', '7046', '1'), - ('6.99', '349', '2007-03-23T13:50:41.996577', '15833', '1'), - ('2.99', '349', '2007-02-15T00:11:12.996577', '1197', '1'), - ('0.99', '349', '2007-04-30T07:23:13.996577', '9731', '1'), - ('2.99', '349', '2007-04-28T02:24:31.996577', '7702', '2'), - ('4.99', '434', '2007-04-30T16:52:56.996577', '9350', '1'), - ('3.99', '434', '2007-03-22T07:16:01.996577', '15016', '2'), - ('0.99', '434', '2007-04-28T21:47:14.996577', '8205', '1'), - ('7.99', '434', '2007-02-18T15:31:08.996577', '2415', '2'), - ('4.99', '434', '2007-03-22T21:06:00.996577', '15385', '2'), - ('7.99', '434', '2007-03-18T16:03:26.996577', '12624', '2'), - ('2.99', '434', '2007-03-17T18:39:14.996577', '12030', '2'), - ('2.99', '434', '2007-03-17T12:32:54.996577', '11867', '1'), - ('2.99', '434', '2007-04-09T21:26:40.996577', '5464', '2'), - ('4.99', '434', '2007-03-21T14:28:06.996577', '14553', '2'), - ('10.99', '434', '2007-04-08T21:55:42.996577', '4960', '2'), - ('6.99', '434', '2007-04-27T09:37:54.996577', '7260', '1'), - ('2.99', '434', '2007-03-17T22:38:30.996577', '12146', '2'), - ('3.99', '434', '2007-02-18T16:20:12.996577', '2430', '1'), - ('9.99', '434', '2007-03-19T19:33:15.996577', '13359', '2'), - ('6.99', '434', '2007-04-08T08:16:29.996577', '4654', '2'), - ('2.99', '434', '2007-04-07T20:28:47.996577', '4414', '1'), - ('2.99', '434', '2007-02-20T09:13:46.996577', '3014', '1'), - ('2.99', '434', '2007-04-27T17:46:43.996577', '7479', '2'), - ('7.99', '434', '2007-03-19T20:07:10.996577', '13383', '1'), - ('3.99', '434', '2007-03-02T12:00:26.996577', '11242', '1'), - ('0.99', '434', '2007-02-15T02:14:01.996577', '1225', '1'), - ('5.99', '434', '2007-02-16T03:19:16.996577', '1584', '2'), - ('0.99', '434', '2007-04-26T22:59:51.996577', '6972', '2'), - ('2.99', '434', '2007-02-20T10:56:29.996577', '3037', '2'), - ('3.99', '434', '2007-02-18T20:43:35.996577', '2494', '1'), - ('5.99', '522', '2007-04-30T19:12:36.996577', '9412', '1'), - ('6.99', '522', '2007-03-18T11:22:15.996577', '12494', '2'), - ('5.99', '522', '2007-04-30T23:46:36.996577', '9533', '2'), - ('0.99', '522', '2007-04-30T23:51:41.996577', '10223', '2'), - ('1.99', '522', '2007-03-17T11:21:41.996577', '11830', '2'), - ('2.99', '522', '2007-04-28T12:00:02.996577', '7955', '1'), - ('8.99', '522', '2007-02-20T15:24:21.996577', '3102', '2'), - ('7.99', '522', '2007-04-30T05:24:59.996577', '9047', '1'), - ('4.99', '522', '2007-04-30T16:29:19.996577', '9335', '1'), - ('4.99', '522', '2007-04-08T10:07:14.996577', '4701', '2'), - ('2.99', '522', '2007-04-30T02:22:38.996577', '8966', '1'), - ('3.99', '522', '2007-03-01T06:24:58.996577', '10411', '1'), - ('4.99', '522', '2007-04-10T00:45:57.996577', '5532', '2'), - ('0.99', '522', '2007-02-20T22:15:05.996577', '3191', '2'), - ('4.99', '522', '2007-04-07T03:33:31.996577', '4078', '2'), - ('3.99', '522', '2007-02-15T07:12:35.996577', '1289', '1'), - ('4.99', '522', '2007-04-27T09:44:02.996577', '7262', '2'), - ('6.99', '522', '2007-03-23T16:35:20.996577', '15921', '1'), - ('2.99', '522', '2007-03-17T05:29:35.996577', '11696', '2'), - ('0.99', '522', '2007-04-10T20:42:56.996577', '5936', '2'), - ('7.99', '522', '2007-04-30T12:04:39.996577', '9227', '2'), - ('5.99', '522', '2007-03-01T21:22:53.996577', '10821', '2'), - ('2.99', '522', '2007-03-21T11:31:59.996577', '14467', '2'), - ('6.99', '522', '2007-03-20T04:34:43.996577', '13605', '2'), - ('9.99', '522', '2007-04-08T03:37:21.996577', '4563', '2'), - ('2.99', '522', '2007-02-20T21:38:53.996577', '3188', '1'), - ('0.99', '522', '2007-04-06T03:11:13.996577', '3594', '1'), - ('6.99', '522', '2007-04-09T23:38:08.996577', '5514', '2'), - ('7.99', '522', '2007-03-01T15:40:23.996577', '10675', '1'), - ('6.99', '522', '2007-04-29T13:06:43.996577', '8642', '1'), - ('6.99', '522', '2007-04-09T12:53:27.996577', '5271', '2'), - ('4.99', '522', '2007-04-28T20:47:04.996577', '8181', '2'), - ('2.99', '505', '2007-03-01T23:47:59.996577', '10896', '1'), - ('2.99', '505', '2007-03-21T08:55:47.996577', '14398', '1'), - ('2.99', '505', '2007-03-17T14:09:13.996577', '11907', '1'), - ('6.99', '505', '2007-04-08T00:51:11.996577', '4507', '1'), - ('4.99', '505', '2007-04-28T05:43:58.996577', '7784', '1'), - ('3.99', '505', '2007-03-20T04:50:34.996577', '13612', '2'), - ('5.99', '505', '2007-04-30T23:38:59.996577', '10219', '2'), - ('4.99', '505', '2007-05-14T13:44:29.996577', '15867', '2'), - ('5.99', '505', '2007-02-20T18:09:54.996577', '3137', '1'), - ('4.99', '505', '2007-02-17T02:04:28.996577', '1886', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['18128', '27848', '18130', '27850', '21781', '27851', '27852', '21786', '21785', '28671', '22461', '28681', '28679', '28678', '22459', '28675', '28676', '22462', '28673', '28668', '22467', '18398', '22463', '28677', '22465', '28669', '28680', '22460', '22464', '28670', '28682', '28674', '22466', '22468', '28672', '26544', '26542', '26549', '26543', '20665', '20664', '26545', '20658', '26548', '17698', '26551', '26552', '26550', '20666', '17700', '26547', '17696', '20659', '20656', '20663', '20661', '20657', '20660', '17699', '26546', '31951', '17697', '20662', '25120', '31873', '31875', '25121', '31876', '31877', '31872', '31865', '25117', '25124', '25118', '25119', '31874', '25122', '19497', '31868', '31871', '19496', '25126', '25123', '31866', '25125', '31870', '32097', '31869', '31867', '25127', '20488', '26357', '20485', '17623', '17620', '26366', '26362', '26364', '20487', '20483']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('5.99', '505', '2007-02-16T18:45:46.996577', '1799', '2'), - ('5.99', '505', '2007-04-06T22:55:09.996577', '4008', '2'), - ('7.99', '505', '2007-02-19T16:32:44.996577', '2773', '1'), - ('9.99', '505', '2007-04-10T22:45:01.996577', '5976', '2'), - ('0.99', '505', '2007-03-02T08:37:06.996577', '11163', '1'), - ('4.99', '505', '2007-04-11T15:51:59.996577', '6292', '2'), - ('0.99', '505', '2007-04-11T22:55:34.996577', '6441', '1'), - ('4.99', '505', '2007-03-22T22:58:52.996577', '15436', '1'), - ('2.99', '505', '2007-03-21T23:16:49.996577', '14802', '1'), - ('3.99', '580', '2007-04-08T04:56:14.996577', '4590', '2'), - ('8.99', '580', '2007-03-02T08:39:22.996577', '11164', '1'), - ('4.99', '580', '2007-04-30T02:15:38.996577', '9604', '2'), - ('3.99', '580', '2007-04-30T12:19:18.996577', '9239', '1'), - ('0.99', '580', '2007-04-30T11:06:26.996577', '9199', '1'), - ('3.99', '580', '2007-03-01T17:39:15.996577', '10723', '1'), - ('0.99', '580', '2007-04-27T22:55:43.996577', '7620', '1'), - ('4.99', '580', '2007-04-29T19:04:03.996577', '8784', '2'), - ('2.99', '580', '2007-03-18T17:46:24.996577', '12670', '2'), - ('2.99', '580', '2007-04-11T04:14:25.996577', '6089', '1'), - ('1.99', '580', '2007-04-06T02:00:57.996577', '3571', '2'), - ('6.99', '580', '2007-03-23T05:57:39.996577', '15630', '1'), - ('0.99', '580', '2007-02-15T19:21:02.996577', '1469', '1'), - ('2.99', '580', '2007-03-19T17:40:07.996577', '13313', '2'), - ('3.99', '580', '2007-04-29T21:21:00.996577', '8839', '1'), - ('2.99', '580', '2007-03-21T23:45:44.996577', '14818', '2'), - ('1.99', '580', '2007-04-06T16:20:45.996577', '3867', '2'), - ('5.99', '580', '2007-04-30T20:54:05.996577', '9460', '1'), - ('3.99', '580', '2007-03-02T02:28:45.996577', '10965', '2'), - ('2.99', '580', '2007-03-20T09:17:41.996577', '13742', '2'), - ('1.99', '580', '2007-04-07T08:07:44.996577', '4169', '2'), - ('0.99', '580', '2007-04-30T11:39:11.996577', '9865', '2'), - ('2.99', '580', '2007-04-11T08:57:47.996577', '6170', '2'), - ('6.99', '580', '2007-03-22T12:58:35.996577', '15157', '1'), - ('4.99', '580', '2007-03-23T17:22:58.996577', '15947', '1'), - ('6.99', '580', '2007-04-10T20:44:34.996577', '5937', '1'), - ('2.99', '388', '2007-04-11T17:19:28.996577', '6321', '2'), - ('5.99', '388', '2007-04-08T21:18:03.996577', '4947', '2'), - ('2.99', '388', '2007-04-30T17:19:19.996577', '9368', '2'), - ('2.99', '388', '2007-04-10T18:50:18.996577', '5899', '2'), - ('5.99', '388', '2007-03-22T00:54:59.996577', '14853', '2'), - ('10.99', '388', '2007-03-21T04:55:14.996577', '14273', '1'), - ('2.99', '388', '2007-04-11T23:25:57.996577', '6452', '1'), - ('2.99', '388', '2007-03-17T20:05:34.996577', '12068', '1'), - ('0.99', '388', '2007-04-30T11:35:37.996577', '9213', '2'), - ('5.99', '388', '2007-02-19T00:20:47.996577', '2537', '1'), - ('0.99', '388', '2007-04-30T13:57:32.996577', '9940', '2'), - ('2.99', '388', '2007-04-30T17:30:59.996577', '10044', '2'), - ('2.99', '388', '2007-04-30T10:51:44.996577', '9840', '2'), - ('5.99', '388', '2007-03-23T07:19:47.996577', '15660', '2'), - ('7.99', '388', '2007-02-20T19:40:16.996577', '3159', '2'), - ('3.99', '388', '2007-04-29T06:26:57.996577', '8456', '2'), - ('6.99', '388', '2007-02-15T06:28:39.996577', '1276', '2'), - ('6.99', '388', '2007-03-18T02:52:56.996577', '12267', '2'), - ('0.99', '388', '2007-03-17T01:56:53.996577', '11604', '2'), - ('4.99', '388', '2007-03-19T05:23:59.996577', '12977', '1'), - ('2.99', '388', '2007-03-18T16:53:32.996577', '12646', '2'), - ('0.99', '388', '2007-03-17T19:08:03.996577', '12044', '2'), - ('4.99', '388', '2007-03-18T11:27:06.996577', '12497', '2'), - ('4.99', '388', '2007-02-19T11:36:45.996577', '2692', '1'), - ('5.99', '388', '2007-04-28T12:57:27.996577', '7985', '2'), - ('0.99', '388', '2007-05-14T13:44:29.996577', '12891', '1'), - ('0.99', '388', '2007-02-17T20:39:02.996577', '2145', '1'), - ('2.99', '388', '2007-03-18T20:59:47.996577', '12749', '1'), - ('0.99', '263', '2007-03-17T11:01:05.996577', '11822', '1'), - ('1.99', '263', '2007-04-12T16:05:08.996577', '6808', '1'), - ('4.99', '263', '2007-04-27T15:47:01.996577', '7425', '1'), - ('9.99', '263', '2007-03-17T19:33:01.996577', '12057', '2'), - ('4.99', '263', '2007-04-28T02:31:43.996577', '7706', '1'), - ('1.99', '263', '2007-04-28T07:14:40.996577', '7833', '2'), - ('2.99', '263', '2007-04-12T00:27:46.996577', '6483', '1'), - ('4.99', '263', '2007-04-06T02:15:31.996577', '3578', '1'), - ('6.99', '263', '2007-03-01T08:31:46.996577', '10476', '1'), - ('3.99', '263', '2007-03-21T07:01:33.996577', '14335', '1'), - ('2.99', '263', '2007-03-01T19:28:18.996577', '10775', '1'), - ('2.99', '263', '2007-03-02T15:30:32.996577', '11339', '1'), - ('4.99', '263', '2007-04-27T10:59:13.996577', '7291', '2'), - ('5.99', '263', '2007-03-18T09:03:39.996577', '12432', '2'), - ('1.99', '263', '2007-02-21T02:15:45.996577', '3257', '2'), - ('2.99', '263', '2007-04-08T09:06:53.996577', '4682', '2'), - ('4.99', '263', '2007-04-11T20:08:49.996577', '6376', '2'), - ('8.99', '263', '2007-02-17T19:23:02.996577', '2126', '2'), - ('4.99', '263', '2007-03-22T18:48:56.996577', '15322', '1'), - ('6.99', '263', '2007-03-19T03:00:41.996577', '12919', '2'), - ('2.99', '263', '2007-04-06T11:52:00.996577', '3773', '2'), - ('6.99', '263', '2007-03-21T10:41:36.996577', '14448', '2'), - ('1.99', '263', '2007-04-09T12:18:37.996577', '5254', '2'), - ('0.99', '263', '2007-05-14T13:44:29.996577', '15293', '1'), - ('2.99', '263', '2007-04-09T05:53:54.996577', '5125', '2'), - ('0.99', '263', '2007-04-08T07:18:20.996577', '4637', '2'), - ('7.99', '263', '2007-03-23T16:35:57.996577', '15922', '2'), - ('0.99', '371', '2007-03-23T12:17:00.996577', '15786', '1'), - ('8.99', '371', '2007-04-07T05:20:49.996577', '4115', '2'), - ('4.99', '371', '2007-03-19T12:57:14.996577', '13191', '1'), - ('3.99', '371', '2007-02-20T21:00:20.996577', '3176', '1'), - ('6.99', '371', '2007-02-16T02:00:05.996577', '1573', '1'), - ('4.99', '371', '2007-04-30T03:38:52.996577', '9008', '1'), - ('1.99', '371', '2007-04-11T23:42:10.996577', '6460', '1'), - ('3.99', '371', '2007-04-27T15:00:06.996577', '7408', '1'), - ('2.99', '371', '2007-03-21T08:31:03.996577', '14384', '1'), - ('2.99', '371', '2007-03-19T06:55:49.996577', '13028', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['20481', '26365', '20480', '26367', '26359', '20482', '20484', '17619', '20486', '17622', '17618', '26361', '17624', '26368', '26363', '20489', '26360', '17621', '26358', '29771', '18775', '29769', '29779', '29777', '18776', '23360', '29774', '29773', '23359', '18777', '23363', '29772', '23358', '29784', '29783', '29778', '29781', '29780', '23362', '29775', '29768', '29782', '29785', '29776', '29770', '23361', '23357', '31850', '19487', '25096', '31852', '19486', '31848', '19490', '25098', '19491', '25097', '25103', '25104', '19489', '31851', '25100', '19488', '25099', '31849', '31847', '31853', '25101', '25102', '18606', '18607', '18603', '22946', '22949', '29277', '29272', '29280', '29275', '18604', '22943', '29278', '22945', '18602', '18601', '22947', '18605', '29271', '18608', '29281', '29273', '29282', '22950', '22942', '29279', '29274', '22944', '22948', '22951', '29276', '26401']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('9.99', '371', '2007-03-18T07:41:18.996577', '12397', '2'), - ('4.99', '371', '2007-04-28T18:40:43.996577', '8138', '1'), - ('10.99', '371', '2007-03-02T06:07:10.996577', '11086', '1'), - ('8.99', '371', '2007-04-30T07:49:25.996577', '9117', '1'), - ('4.99', '371', '2007-04-09T07:55:21.996577', '5171', '1'), - ('7.99', '371', '2007-03-18T14:20:02.996577', '12584', '2'), - ('3.99', '371', '2007-03-19T11:13:04.996577', '13143', '2'), - ('1.99', '371', '2007-02-15T01:53:10.996577', '1218', '1'), - ('4.99', '371', '2007-03-20T16:29:03.996577', '13953', '2'), - ('0.99', '371', '2007-02-19T20:32:16.996577', '2837', '2'), - ('2.99', '371', '2007-02-15T01:31:59.996577', '1212', '2'), - ('2.99', '371', '2007-04-10T23:51:32.996577', '6000', '1'), - ('0.99', '371', '2007-02-21T13:51:34.996577', '3396', '2'), - ('0.99', '371', '2007-04-30T03:40:53.996577', '9635', '1'), - ('0.99', '371', '2007-04-12T21:08:14.996577', '6922', '1'), - ('2.99', '371', '2007-03-23T13:37:43.996577', '15824', '1'), - ('0.99', '371', '2007-04-10T03:45:22.996577', '5614', '2'), - ('5.99', '371', '2007-02-16T09:33:13.996577', '1675', '2'), - ('1.99', '371', '2007-04-08T06:09:10.996577', '4612', '1'), - ('8.99', '71', '2007-04-10T01:16:29.996577', '5543', '1'), - ('2.99', '71', '2007-02-17T01:06:54.996577', '1873', '2'), - ('1.99', '71', '2007-04-09T13:23:33.996577', '5281', '2'), - ('2.99', '71', '2007-04-28T18:14:32.996577', '8128', '2'), - ('4.99', '71', '2007-04-27T20:23:33.996577', '7550', '1'), - ('4.99', '71', '2007-02-18T13:12:32.996577', '2374', '1'), - ('4.99', '71', '2007-03-21T22:43:38.996577', '14781', '2'), - ('0.99', '71', '2007-04-11T00:37:21.996577', '6020', '2'), - ('4.99', '71', '2007-04-10T14:15:16.996577', '5814', '2'), - ('3.99', '71', '2007-03-21T03:25:34.996577', '14228', '1'), - ('5.99', '71', '2007-02-21T09:33:33.996577', '3345', '2'), - ('0.99', '71', '2007-03-23T19:13:02.996577', '16000', '1'), - ('4.99', '71', '2007-04-10T11:49:54.996577', '5770', '1'), - ('7.99', '71', '2007-03-20T23:13:00.996577', '14105', '1'), - ('4.99', '71', '2007-04-29T19:15:53.996577', '8789', '1'), - ('3.99', '71', '2007-04-29T18:59:54.996577', '8783', '1'), - ('4.99', '71', '2007-04-28T12:48:25.996577', '7982', '2'), - ('1.99', '71', '2007-04-29T10:20:19.996577', '8574', '1'), - ('2.99', '71', '2007-04-29T00:59:16.996577', '8293', '1'), - ('4.99', '71', '2007-03-23T08:54:11.996577', '15704', '1'), - ('5.99', '71', '2007-04-12T12:50:34.996577', '6739', '1'), - ('4.99', '71', '2007-04-08T06:13:43.996577', '4614', '2'), - ('4.99', '71', '2007-04-29T14:09:57.996577', '8668', '1'), - ('0.99', '71', '2007-04-30T02:00:55.996577', '8956', '1'), - ('0.99', '71', '2007-04-27T05:54:32.996577', '7160', '2'), - ('3.99', '71', '2007-04-09T16:37:47.996577', '5358', '2'), - ('3.99', '71', '2007-03-22T03:00:27.996577', '14904', '2'), - ('4.99', '71', '2007-03-18T08:25:26.996577', '12417', '1'), - ('0.99', '261', '2007-04-12T12:57:51.996577', '6743', '1'), - ('5.99', '261', '2007-02-17T01:22:42.996577', '1877', '1'), - ('1.99', '261', '2007-03-01T00:58:16.996577', '10246', '2'), - ('4.99', '261', '2007-04-30T10:53:24.996577', '9842', '1'), - ('2.99', '261', '2007-02-16T16:17:03.996577', '1760', '1'), - ('5.99', '261', '2007-04-09T20:40:27.996577', '5449', '1'), - ('0.99', '261', '2007-02-18T14:02:44.996577', '2392', '2'), - ('2.99', '261', '2007-03-17T14:56:50.996577', '11928', '2'), - ('0.99', '261', '2007-02-21T10:53:33.996577', '3363', '1'), - ('1.99', '261', '2007-03-17T11:29:06.996577', '11834', '1'), - ('4.99', '261', '2007-03-20T13:11:00.996577', '13849', '1'), - ('4.99', '261', '2007-03-22T21:37:12.996577', '15397', '2'), - ('3.99', '261', '2007-02-17T15:01:58.996577', '2072', '2'), - ('4.99', '261', '2007-04-30T00:33:58.996577', '9552', '2'), - ('4.99', '261', '2007-03-19T15:12:07.996577', '13245', '2'), - ('8.99', '261', '2007-02-17T09:11:00.996577', '1988', '2'), - ('6.99', '261', '2007-03-18T05:11:48.996577', '12327', '1'), - ('2.99', '261', '2007-04-12T02:18:58.996577', '6515', '2'), - ('3.99', '261', '2007-04-09T05:48:01.996577', '5122', '1'), - ('4.99', '261', '2007-04-30T11:50:20.996577', '9869', '1'), - ('5.99', '261', '2007-03-20T00:35:32.996577', '13506', '2'), - ('2.99', '261', '2007-03-20T06:54:58.996577', '13669', '1'), - ('4.99', '27', '2007-02-19T18:31:55.996577', '2815', '1'), - ('1.99', '27', '2007-02-20T10:57:25.996577', '3038', '1'), - ('2.99', '27', '2007-02-16T11:33:35.996577', '1699', '2'), - ('6.99', '27', '2007-03-17T07:16:57.996577', '11740', '2'), - ('2.99', '27', '2007-03-18T12:26:16.996577', '12531', '1'), - ('4.99', '27', '2007-04-12T09:41:47.996577', '6658', '2'), - ('5.99', '27', '2007-04-08T01:03:17.996577', '4510', '1'), - ('5.99', '27', '2007-04-30T03:41:25.996577', '9636', '2'), - ('0.99', '27', '2007-04-11T06:05:16.996577', '6115', '2'), - ('3.99', '27', '2007-02-17T07:28:23.996577', '1960', '2'), - ('4.99', '27', '2007-03-01T22:28:59.996577', '10852', '1'), - ('1.99', '27', '2007-04-28T10:42:08.996577', '7927', '1'), - ('8.99', '27', '2007-03-17T03:54:23.996577', '11661', '1'), - ('4.99', '27', '2007-02-15T19:45:43.996577', '1480', '2'), - ('4.99', '27', '2007-02-15T08:40:08.996577', '1310', '1'), - ('5.99', '27', '2007-03-17T18:21:09.996577', '12021', '2'), - ('2.99', '27', '2007-02-18T22:17:13.996577', '2512', '2'), - ('0.99', '27', '2007-04-07T01:21:19.996577', '4038', '2'), - ('3.99', '27', '2007-02-21T15:51:02.996577', '3420', '2'), - ('7.99', '27', '2007-04-30T05:03:21.996577', '9673', '1'), - ('0.99', '27', '2007-04-10T01:29:45.996577', '5552', '1'), - ('4.99', '27', '2007-04-30T13:08:18.996577', '9908', '1'), - ('4.99', '27', '2007-03-20T11:42:22.996577', '13816', '2'), - ('7.99', '27', '2007-03-01T20:19:41.996577', '10794', '1'), - ('0.99', '27', '2007-04-30T12:35:19.996577', '9244', '2'), - ('4.99', '27', '2007-04-10T10:14:14.996577', '5736', '1'), - ('0.99', '27', '2007-03-02T11:40:43.996577', '11234', '1'), - ('0.99', '27', '2007-03-18T09:56:40.996577', '12461', '2'), - ('0.99', '27', '2007-03-22T08:28:30.996577', '15048', '1'), - ('5.99', '27', '2007-04-12T03:54:52.996577', '6562', '2'), - ('4.99', '373', '2007-04-30T23:45:16.996577', '10221', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['20513', '26389', '20514', '20510', '26391', '26395', '26393', '20506', '26386', '20515', '26387', '20509', '17628', '26397', '26385', '20507', '17629', '31949', '20505', '20511', '20503', '20504', '26390', '20508', '26399', '26398', '26392', '26394', '26400', '26388', '20516', '26396', '20512', '24492', '19227', '24489', '31133', '24498', '19228', '24488', '31127', '19225', '31129', '24493', '24495', '24494', '24496', '24497', '24499', '32071', '24491', '24490', '31131', '31134', '19226', '31128', '31130', '31132', '31787', '25027', '25032', '31785', '19461', '25030', '25029', '31788', '31786', '25033', '25028', '31784', '31789', '25031', '19459', '19460', '19458', '31783', '20727', '26623', '17726', '26624', '26625', '26626', '20732', '20728', '17729', '17724', '17728', '26622', '26628', '17727', '20731', '17725', '20730', '20729', '26627', '29563', '23156', '23155', '29556', '29555']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('3.99', '373', '2007-03-19T18:25:21.996577', '13329', '1'), - ('3.99', '373', '2007-04-11T10:52:51.996577', '6202', '1'), - ('2.99', '373', '2007-03-19T23:25:10.996577', '13467', '2'), - ('7.99', '373', '2007-03-18T20:57:31.996577', '12748', '1'), - ('4.99', '373', '2007-04-26T22:02:28.996577', '6944', '1'), - ('3.99', '373', '2007-04-29T11:54:47.996577', '8611', '1'), - ('3.99', '373', '2007-04-27T07:35:31.996577', '7206', '2'), - ('3.99', '373', '2007-03-17T03:58:45.996577', '11663', '2'), - ('4.99', '373', '2007-04-06T07:05:00.996577', '3667', '2'), - ('6.99', '373', '2007-03-22T07:11:37.996577', '15014', '2'), - ('7.99', '373', '2007-04-07T16:27:50.996577', '4325', '1'), - ('5.99', '373', '2007-03-18T12:34:32.996577', '12536', '2'), - ('6.99', '373', '2007-02-15T19:23:21.996577', '1472', '1'), - ('4.99', '373', '2007-04-30T18:35:55.996577', '9397', '1'), - ('2.99', '373', '2007-04-06T04:04:48.996577', '3609', '2'), - ('3.99', '373', '2007-03-17T16:27:45.996577', '11976', '2'), - ('2.99', '373', '2007-02-20T19:49:27.996577', '3161', '1'), - ('0.99', '373', '2007-05-14T13:44:29.996577', '11739', '1'), - ('7.99', '373', '2007-03-16T22:19:32.996577', '11512', '2'), - ('0.99', '373', '2007-03-18T22:16:42.996577', '12780', '2'), - ('5.99', '373', '2007-03-01T18:51:17.996577', '10758', '1'), - ('7.99', '373', '2007-03-02T05:26:58.996577', '11066', '2'), - ('0.99', '373', '2007-04-11T16:47:18.996577', '6311', '2'), - ('5.99', '373', '2007-03-17T22:32:38.996577', '12142', '1'), - ('4.99', '373', '2007-04-30T14:55:12.996577', '9966', '1'), - ('0.99', '373', '2007-04-30T21:54:29.996577', '9480', '2'), - ('0.99', '373', '2007-04-27T03:15:59.996577', '7094', '1'), - ('0.99', '373', '2007-04-27T22:43:50.996577', '7615', '1'), - ('6.99', '373', '2007-04-30T16:30:02.996577', '10010', '1'), - ('5.99', '373', '2007-04-09T05:42:49.996577', '5120', '1'), - ('3.99', '373', '2007-03-22T09:18:39.996577', '15068', '1'), - ('8.99', '373', '2007-04-30T15:59:29.996577', '9327', '2'), - ('2.99', '373', '2007-03-19T17:14:59.996577', '13299', '2'), - ('2.99', '188', '2007-03-02T16:45:18.996577', '11378', '2'), - ('4.99', '188', '2007-02-18T22:25:57.996577', '2515', '1'), - ('0.99', '188', '2007-03-01T09:13:47.996577', '10494', '1'), - ('4.99', '188', '2007-04-27T20:45:43.996577', '7556', '1'), - ('0.99', '188', '2007-03-22T21:54:58.996577', '15409', '2'), - ('4.99', '188', '2007-02-19T13:50:19.996577', '2733', '2'), - ('5.99', '188', '2007-03-01T07:41:53.996577', '10453', '2'), - ('3.99', '188', '2007-04-06T15:15:58.996577', '3848', '2'), - ('2.99', '188', '2007-02-15T23:00:06.996577', '1527', '2'), - ('2.99', '188', '2007-04-09T16:36:54.996577', '5356', '2'), - ('2.99', '188', '2007-03-20T03:33:23.996577', '13570', '1'), - ('2.99', '188', '2007-03-21T09:01:49.996577', '14399', '1'), - ('5.99', '188', '2007-03-20T10:43:49.996577', '13787', '1'), - ('2.99', '188', '2007-03-21T23:29:08.996577', '14809', '2'), - ('2.99', '188', '2007-03-22T18:45:43.996577', '15319', '2'), - ('4.99', '188', '2007-03-23T00:07:36.996577', '15474', '2'), - ('2.99', '188', '2007-05-14T13:44:29.996577', '14503', '1'), - ('4.99', '188', '2007-03-01T18:51:10.996577', '10757', '2'), - ('4.99', '188', '2007-03-01T17:28:54.996577', '10719', '2'), - ('4.99', '188', '2007-04-12T03:36:42.996577', '6555', '2'), - ('4.99', '188', '2007-04-30T02:27:19.996577', '9613', '2'), - ('0.99', '188', '2007-02-17T05:16:45.996577', '1927', '2'), - ('2.99', '188', '2007-04-07T07:11:48.996577', '4150', '2'), - ('5.99', '188', '2007-04-10T09:55:51.996577', '5729', '2'), - ('0.99', '188', '2007-04-27T01:48:44.996577', '7042', '2'), - ('2.99', '255', '2007-04-28T00:00:11.996577', '7646', '1'), - ('4.99', '255', '2007-03-17T16:35:39.996577', '11979', '2'), - ('8.99', '255', '2007-03-20T09:49:52.996577', '13758', '1'), - ('0.99', '255', '2007-04-10T21:16:39.996577', '5943', '1'), - ('2.99', '255', '2007-02-21T18:35:17.996577', '3442', '2'), - ('0.99', '255', '2007-03-19T16:02:16.996577', '13268', '1'), - ('2.99', '255', '2007-03-19T11:38:20.996577', '13154', '2'), - ('0.99', '255', '2007-04-29T10:00:39.996577', '8562', '1'), - ('8.99', '255', '2007-04-27T17:36:09.996577', '7475', '2'), - ('3.99', '255', '2007-03-21T16:13:47.996577', '14600', '2'), - ('7.99', '255', '2007-03-17T23:38:59.996577', '12176', '2'), - ('1.99', '255', '2007-04-10T08:50:12.996577', '5706', '1'), - ('6.99', '255', '2007-04-30T05:50:18.996577', '9061', '1'), - ('0.99', '255', '2007-03-20T07:23:21.996577', '13683', '2'), - ('6.99', '255', '2007-02-15T16:24:40.996577', '1420', '1'), - ('2.99', '255', '2007-02-16T10:06:43.996577', '1681', '2'), - ('2.99', '255', '2007-02-15T02:59:54.996577', '1235', '1'), - ('0.99', '255', '2007-04-08T02:48:45.996577', '4547', '1'), - ('0.99', '395', '2007-03-17T13:36:53.996577', '11889', '1'), - ('5.99', '395', '2007-04-07T08:59:31.996577', '4185', '1'), - ('0.99', '395', '2007-02-16T04:42:29.996577', '1603', '2'), - ('4.99', '395', '2007-04-07T19:41:02.996577', '4393', '1'), - ('0.99', '395', '2007-04-09T04:12:54.996577', '5087', '1'), - ('0.99', '395', '2007-04-09T06:23:27.996577', '5136', '2'), - ('4.99', '395', '2007-03-23T18:22:50.996577', '15970', '1'), - ('5.99', '395', '2007-03-21T11:39:06.996577', '14471', '1'), - ('6.99', '395', '2007-02-21T13:06:21.996577', '3389', '1'), - ('0.99', '395', '2007-02-15T05:58:48.996577', '1270', '1'), - ('0.99', '395', '2007-02-21T06:33:17.996577', '3310', '1'), - ('0.99', '395', '2007-04-06T07:57:48.996577', '3684', '2'), - ('7.99', '395', '2007-04-28T12:58:39.996577', '7986', '2'), - ('4.99', '395', '2007-02-20T10:20:25.996577', '3030', '1'), - ('0.99', '395', '2007-03-23T14:27:38.996577', '15856', '1'), - ('0.99', '395', '2007-02-16T01:14:53.996577', '1562', '1'), - ('2.99', '395', '2007-03-23T08:40:06.996577', '15698', '1'), - ('0.99', '395', '2007-03-21T20:12:19.996577', '14720', '2'), - ('2.99', '395', '2007-04-28T03:52:02.996577', '7740', '1'), - ('10.99', '50', '2007-04-30T05:38:21.996577', '9691', '2'), - ('6.99', '50', '2007-03-18T21:53:46.996577', '12766', '1'), - ('3.99', '50', '2007-03-02T04:55:39.996577', '11053', '2'), - ('8.99', '50', '2007-04-12T10:04:48.996577', '6667', '1'), - ('0.99', '50', '2007-04-12T08:05:44.996577', '6634', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['29550', '23153', '29564', '18706', '18704', '29553', '23157', '29557', '23159', '29562', '29559', '18705', '29552', '23154', '29554', '29551', '23161', '29560', '29561', '23158', '18703', '29566', '29565', '23160', '29558', '25519', '19825', '25523', '19828', '19827', '19826', '19822', '19829', '25522', '25518', '25525', '19830', '25520', '19824', '25524', '25521', '19823', '19832', '25526', '19831', '25517', '30550', '30546', '30539', '30536', '30537', '30549', '30554', '30541', '30542', '23971', '23968', '23960', '19032', '30543', '30544', '23964', '19031', '30538', '23963', '23969', '19030', '30540', '30552', '23970', '23965', '30545', '19029', '30551', '30548', '23962', '30547', '23959', '23973', '23972', '30553', '23967', '23966', '23961', '21519', '31972', '18028', '27493', '21517', '27500', '27498', '21518', '27495', '21513', '21516', '18027', '21521', '21511', '27499', '21515']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('2.99', '50', '2007-04-07T07:08:43.996577', '4149', '2'), - ('4.99', '50', '2007-03-01T01:26:53.996577', '10261', '2'), - ('2.99', '50', '2007-04-30T17:35:37.996577', '10046', '2'), - ('2.99', '50', '2007-02-20T20:24:20.996577', '3169', '2'), - ('4.99', '50', '2007-02-16T17:55:38.996577', '1785', '1'), - ('9.99', '50', '2007-04-10T07:17:05.996577', '5681', '2'), - ('7.99', '50', '2007-03-19T10:52:49.996577', '13136', '2'), - ('4.99', '50', '2007-04-27T14:15:19.996577', '7383', '1'), - ('2.99', '50', '2007-03-22T12:04:56.996577', '15138', '2'), - ('4.99', '50', '2007-04-30T02:28:22.996577', '9615', '1'), - ('0.99', '50', '2007-04-28T23:39:31.996577', '8261', '1'), - ('0.99', '50', '2007-02-20T08:00:59.996577', '3000', '2'), - ('4.99', '50', '2007-04-10T05:12:09.996577', '5641', '2'), - ('7.99', '50', '2007-03-01T08:49:00.996577', '10485', '2'), - ('6.99', '50', '2007-04-10T20:26:56.996577', '5928', '1'), - ('4.99', '50', '2007-04-09T13:43:13.996577', '5290', '2'), - ('4.99', '50', '2007-03-23T19:53:29.996577', '16015', '1'), - ('5.99', '50', '2007-04-29T12:18:34.996577', '8619', '1'), - ('0.99', '50', '2007-04-30T10:31:07.996577', '9179', '2'), - ('4.99', '50', '2007-03-20T20:45:27.996577', '14054', '1'), - ('2.99', '50', '2007-02-15T02:07:19.996577', '1223', '1'), - ('6.99', '50', '2007-04-30T22:26:09.996577', '10180', '2'), - ('0.99', '50', '2007-04-30T21:49:49.996577', '10165', '2'), - ('6.99', '50', '2007-03-22T21:17:49.996577', '15388', '2'), - ('0.99', '50', '2007-04-28T16:55:13.996577', '8089', '1'), - ('2.99', '298', '2007-04-07T14:16:13.996577', '4291', '2'), - ('0.99', '298', '2007-03-17T20:26:45.996577', '12076', '2'), - ('0.99', '298', '2007-04-12T15:42:43.996577', '6802', '2'), - ('4.99', '298', '2007-03-19T15:11:30.996577', '13244', '1'), - ('0.99', '298', '2007-03-19T12:17:33.996577', '13172', '1'), - ('8.99', '298', '2007-03-18T21:50:16.996577', '12765', '1'), - ('6.99', '298', '2007-03-01T01:03:54.996577', '10248', '2'), - ('0.99', '298', '2007-03-21T11:47:29.996577', '14473', '2'), - ('2.99', '298', '2007-04-09T11:54:54.996577', '5247', '1'), - ('2.99', '298', '2007-04-06T09:57:26.996577', '3728', '1'), - ('7.99', '298', '2007-04-28T08:41:41.996577', '7869', '1'), - ('3.99', '298', '2007-03-22T16:18:01.996577', '15245', '1'), - ('3.99', '298', '2007-04-08T20:53:16.996577', '4936', '1'), - ('6.99', '298', '2007-03-02T13:22:34.996577', '11288', '2'), - ('0.99', '298', '2007-04-28T06:20:23.996577', '7802', '2'), - ('2.99', '298', '2007-04-09T07:44:14.996577', '5166', '2'), - ('0.99', '298', '2007-03-02T05:39:05.996577', '11070', '1'), - ('4.99', '298', '2007-03-23T06:41:52.996577', '15643', '1'), - ('5.99', '298', '2007-04-29T17:00:39.996577', '8737', '2'), - ('4.99', '298', '2007-03-22T16:53:47.996577', '15262', '2'), - ('0.99', '298', '2007-04-05T21:37:19.996577', '3479', '2'), - ('4.99', '137', '2007-04-30T11:08:18.996577', '9200', '2'), - ('8.99', '137', '2007-04-28T14:39:41.996577', '8028', '1'), - ('6.99', '137', '2007-04-07T16:53:52.996577', '4332', '1'), - ('4.99', '137', '2007-04-06T02:58:44.996577', '3589', '2'), - ('5.99', '137', '2007-04-06T07:39:03.996577', '3676', '2'), - ('4.99', '137', '2007-04-30T03:30:47.996577', '9002', '1'), - ('6.99', '137', '2007-04-30T22:08:37.996577', '10175', '1'), - ('2.99', '137', '2007-04-09T05:08:50.996577', '5106', '1'), - ('3.99', '137', '2007-04-09T20:24:35.996577', '5443', '1'), - ('2.99', '137', '2007-03-23T02:28:56.996577', '15537', '2'), - ('7.99', '137', '2007-03-21T21:45:52.996577', '14754', '1'), - ('5.99', '137', '2007-03-01T22:09:50.996577', '10842', '2'), - ('5.99', '137', '2007-02-21T17:44:35.996577', '3436', '1'), - ('2.99', '137', '2007-04-10T13:34:57.996577', '5804', '1'), - ('6.99', '137', '2007-04-11T01:40:45.996577', '6039', '1'), - ('2.99', '137', '2007-03-17T20:28:48.996577', '12078', '1'), - ('3.99', '137', '2007-02-20T11:57:01.996577', '3058', '2'), - ('6.99', '137', '2007-04-06T16:34:38.996577', '3874', '2'), - ('3.99', '137', '2007-03-17T06:58:12.996577', '11732', '2'), - ('7.99', '137', '2007-03-22T09:45:32.996577', '15082', '2'), - ('2.99', '137', '2007-02-19T17:12:23.996577', '2785', '1'), - ('3.99', '137', '2007-04-07T22:55:22.996577', '4474', '2'), - ('4.99', '137', '2007-04-30T06:33:21.996577', '9709', '1'), - ('0.99', '137', '2007-03-22T11:46:09.996577', '15133', '1'), - ('0.99', '137', '2007-03-19T11:23:56.996577', '13148', '1'), - ('0.99', '137', '2007-04-11T10:45:08.996577', '6200', '2'), - ('6.99', '137', '2007-02-18T18:52:49.996577', '2469', '1'), - ('7.99', '137', '2007-04-30T21:13:02.996577', '9466', '2'), - ('2.99', '137', '2007-04-30T01:54:17.996577', '8954', '2'), - ('3.99', '137', '2007-03-02T13:03:27.996577', '11281', '1'), - ('4.99', '137', '2007-04-28T17:31:12.996577', '8106', '1'), - ('4.99', '137', '2007-03-01T12:44:54.996577', '10595', '2'), - ('9.99', '137', '2007-03-23T20:24:30.996577', '16030', '1'), - ('4.99', '137', '2007-03-23T15:26:09.996577', '15889', '2'), - ('2.99', '137', '2007-04-30T08:58:51.996577', '9789', '1'), - ('5.99', '137', '2007-03-20T10:25:32.996577', '13776', '1'), - ('5.99', '137', '2007-03-19T23:31:57.996577', '13472', '1'), - ('4.99', '137', '2007-03-02T05:06:45.996577', '11057', '2'), - ('0.99', '474', '2007-03-21T20:44:02.996577', '14728', '1'), - ('0.99', '474', '2007-05-14T13:44:29.996577', '11909', '1'), - ('7.99', '474', '2007-02-20T04:12:08.996577', '2944', '2'), - ('2.99', '474', '2007-04-07T23:26:41.996577', '4481', '1'), - ('2.99', '474', '2007-03-18T15:02:28.996577', '12597', '2'), - ('2.99', '474', '2007-04-30T03:11:20.996577', '8991', '1'), - ('0.99', '474', '2007-04-09T12:04:36.996577', '5251', '1'), - ('4.99', '474', '2007-03-18T18:58:59.996577', '12702', '1'), - ('0.99', '474', '2007-04-08T14:38:45.996577', '4785', '2'), - ('2.99', '474', '2007-03-16T23:09:34.996577', '11537', '2'), - ('0.99', '474', '2007-03-18T09:16:01.996577', '12440', '1'), - ('8.99', '474', '2007-02-16T16:08:05.996577', '1758', '1'), - ('6.99', '474', '2007-03-23T03:20:48.996577', '15558', '1'), - ('0.99', '474', '2007-03-02T07:04:29.996577', '11117', '2'), - ('7.99', '474', '2007-04-12T01:39:44.996577', '6499', '1'), - ('4.99', '474', '2007-03-18T01:47:55.996577', '12236', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['27497', '27496', '21520', '21510', '27492', '21512', '27494', '21514', '27491', '20923', '26846', '20921', '20924', '20925', '26849', '20928', '17792', '26850', '20922', '26854', '26852', '20927', '26847', '26851', '26853', '26848', '20920', '17791', '20926', '26845', '26855', '17507', '17506', '20204', '26009', '20202', '17508', '20200', '26013', '20206', '17504', '17503', '20207', '26008', '26010', '26011', '20205', '17505', '20203', '26007', '26012', '20208', '20201', '31090', '24456', '24458', '24454', '31093', '24455', '31089', '31088', '31091', '19208', '24453', '31092', '19207', '24452', '24457', '24451', '31087', '24459', '31095', '31094', '18362', '28563', '22381', '22386', '28555', '28559', '28558', '18364', '18366', '22384', '28561', '22380', '18365', '22385', '22382', '22383', '28556', '28557', '28560', '18363', '28562', '18361', '22395', '22390', '28568', '28564', '22391']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('4.99', '474', '2007-04-08T18:21:48.996577', '4886', '2'), - ('2.99', '474', '2007-04-08T15:31:48.996577', '4809', '1'), - ('4.99', '474', '2007-03-22T08:23:20.996577', '15046', '2'), - ('5.99', '474', '2007-03-01T04:55:39.996577', '10376', '2'), - ('1.99', '474', '2007-04-07T01:59:18.996577', '4048', '2'), - ('2.99', '474', '2007-03-02T21:03:54.996577', '11489', '1'), - ('0.99', '474', '2007-04-08T02:00:27.996577', '4533', '1'), - ('2.99', '474', '2007-03-17T20:42:03.996577', '12083', '1'), - ('4.99', '474', '2007-04-06T12:30:27.996577', '3787', '2'), - ('5.99', '415', '2007-03-17T21:59:35.996577', '12128', '2'), - ('0.99', '415', '2007-04-10T06:38:34.996577', '5665', '2'), - ('2.99', '415', '2007-03-01T11:22:32.996577', '10553', '1'), - ('2.99', '415', '2007-03-18T14:33:11.996577', '12588', '2'), - ('8.99', '415', '2007-03-20T08:45:34.996577', '13729', '2'), - ('3.99', '415', '2007-04-12T01:56:03.996577', '6505', '1'), - ('0.99', '415', '2007-03-23T17:55:30.996577', '15959', '1'), - ('2.99', '415', '2007-02-20T23:29:55.996577', '3211', '1'), - ('4.99', '415', '2007-04-27T14:05:09.996577', '7379', '1'), - ('1.99', '415', '2007-03-02T14:20:24.996577', '11310', '2'), - ('2.99', '415', '2007-04-30T01:35:42.996577', '9586', '2'), - ('4.99', '415', '2007-04-28T04:20:49.996577', '7748', '1'), - ('4.99', '415', '2007-03-22T11:15:03.996577', '15121', '2'), - ('0.99', '415', '2007-04-10T10:05:50.996577', '5733', '2'), - ('0.99', '415', '2007-04-27T23:06:10.996577', '7624', '2'), - ('2.99', '415', '2007-04-29T02:07:33.996577', '8317', '2'), - ('5.99', '415', '2007-04-12T00:56:57.996577', '6491', '2'), - ('5.99', '415', '2007-03-01T01:31:14.996577', '10263', '1'), - ('4.99', '415', '2007-02-17T00:30:03.996577', '1867', '2'), - ('4.99', '415', '2007-03-22T06:20:13.996577', '14992', '1'), - ('8.99', '415', '2007-04-08T20:30:14.996577', '4926', '2'), - ('2.99', '415', '2007-04-30T11:20:43.996577', '9852', '1'), - ('7.99', '341', '2007-02-20T17:31:48.996577', '3130', '2'), - ('2.99', '341', '2007-02-19T19:39:56.996577', '2829', '2'), - ('8.99', '341', '2007-03-19T08:35:19.996577', '13074', '2'), - ('4.99', '341', '2007-04-09T22:30:16.996577', '5487', '2'), - ('2.99', '341', '2007-03-17T06:24:48.996577', '11723', '1'), - ('5.99', '341', '2007-02-21T12:33:49.996577', '3382', '1'), - ('0.99', '341', '2007-03-01T13:04:52.996577', '10605', '2'), - ('9.99', '341', '2007-04-29T16:41:15.996577', '8728', '1'), - ('4.99', '341', '2007-03-21T07:09:22.996577', '14344', '2'), - ('1.99', '341', '2007-02-16T17:23:14.996577', '1778', '1'), - ('7.99', '341', '2007-02-15T22:25:46.996577', '1520', '2'), - ('0.99', '341', '2007-03-22T07:38:47.996577', '15030', '2'), - ('2.99', '341', '2007-04-08T06:40:43.996577', '4624', '1'), - ('0.99', '341', '2007-04-10T20:32:45.996577', '5931', '2'), - ('2.99', '341', '2007-04-27T17:34:06.996577', '7473', '2'), - ('4.99', '341', '2007-03-20T11:22:12.996577', '13806', '2'), - ('7.99', '341', '2007-02-16T22:41:45.996577', '1849', '1'), - ('0.99', '341', '2007-03-19T08:10:27.996577', '13059', '2'), - ('4.99', '341', '2007-04-06T19:44:11.996577', '3938', '2'), - ('2.99', '341', '2007-04-29T13:56:50.996577', '8661', '1'), - ('6.99', '341', '2007-03-23T17:11:57.996577', '15938', '2'), - ('6.99', '341', '2007-03-02T14:13:21.996577', '11305', '1'), - ('2.99', '184', '2007-04-12T01:09:07.996577', '6493', '2'), - ('4.99', '184', '2007-03-19T17:23:47.996577', '13303', '1'), - ('5.99', '184', '2007-03-21T23:15:20.996577', '14801', '1'), - ('0.99', '184', '2007-03-19T10:42:40.996577', '13134', '1'), - ('6.99', '184', '2007-04-28T01:47:49.996577', '7686', '2'), - ('5.99', '184', '2007-03-19T15:48:41.996577', '13262', '1'), - ('0.99', '184', '2007-04-10T18:29:43.996577', '5891', '1'), - ('6.99', '184', '2007-04-08T18:10:29.996577', '4882', '2'), - ('6.99', '184', '2007-04-12T11:15:48.996577', '6700', '2'), - ('0.99', '184', '2007-02-18T07:24:12.996577', '2312', '1'), - ('2.99', '184', '2007-03-18T12:26:24.996577', '12532', '1'), - ('4.99', '184', '2007-04-27T02:03:03.996577', '7051', '2'), - ('2.99', '184', '2007-02-17T08:06:34.996577', '1976', '2'), - ('2.99', '184', '2007-03-18T09:47:28.996577', '12454', '2'), - ('4.99', '184', '2007-03-21T11:42:23.996577', '14472', '2'), - ('9.99', '184', '2007-03-17T23:25:32.996577', '12166', '2'), - ('0.99', '184', '2007-04-07T16:06:57.996577', '4314', '1'), - ('0.99', '184', '2007-03-23T05:24:44.996577', '15611', '2'), - ('0.99', '184', '2007-04-30T09:50:22.996577', '9162', '1'), - ('4.99', '184', '2007-04-29T23:15:29.996577', '8892', '1'), - ('3.99', '571', '2007-02-15T14:58:22.996577', '1400', '2'), - ('4.99', '571', '2007-04-30T19:00:35.996577', '9408', '1'), - ('2.99', '571', '2007-03-02T05:58:22.996577', '11080', '2'), - ('4.99', '571', '2007-03-23T14:04:25.996577', '15841', '1'), - ('2.99', '571', '2007-04-06T04:20:39.996577', '3616', '2'), - ('8.99', '571', '2007-04-12T15:05:54.996577', '6792', '1'), - ('8.99', '571', '2007-04-12T10:22:06.996577', '6676', '2'), - ('4.99', '571', '2007-02-17T09:17:10.996577', '1990', '2'), - ('10.99', '571', '2007-02-20T06:43:53.996577', '2977', '1'), - ('2.99', '571', '2007-03-19T15:59:46.996577', '13266', '2'), - ('4.99', '571', '2007-04-29T12:58:49.996577', '8638', '1'), - ('2.99', '571', '2007-03-01T00:10:48.996577', '10227', '1'), - ('2.99', '571', '2007-02-18T08:45:06.996577', '2327', '1'), - ('0.99', '571', '2007-03-22T04:54:42.996577', '14956', '1'), - ('7.99', '571', '2007-03-02T09:52:33.996577', '11191', '2'), - ('2.99', '571', '2007-03-19T14:36:42.996577', '13228', '1'), - ('4.99', '571', '2007-04-07T07:45:52.996577', '4162', '1'), - ('4.99', '571', '2007-04-10T12:39:52.996577', '5789', '2'), - ('5.99', '571', '2007-04-28T16:40:24.996577', '8084', '1'), - ('4.99', '571', '2007-02-16T15:50:59.996577', '1756', '1'), - ('1.99', '571', '2007-04-30T15:01:38.996577', '9300', '2'), - ('4.99', '571', '2007-02-15T04:39:42.996577', '1254', '1'), - ('5.99', '572', '2007-03-20T07:28:04.996577', '13688', '1'), - ('4.99', '572', '2007-03-02T18:28:35.996577', '11426', '1'), - ('4.99', '572', '2007-04-27T05:54:58.996577', '7161', '1'), - ('2.99', '572', '2007-04-08T05:17:36.996577', '4601', '1'), - ('4.99', '572', '2007-03-16T22:46:04.996577', '11526', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['28573', '22388', '28567', '22387', '22392', '22389', '28565', '22393', '18368', '18369', '28571', '28575', '18367', '28566', '28570', '28574', '28569', '22394', '28572', '22255', '28408', '28417', '22259', '18313', '28407', '28406', '18315', '28415', '28409', '18312', '28403', '22256', '22254', '28416', '22260', '22258', '28411', '28414', '18314', '18311', '22257', '28412', '28405', '28413', '28410', '28404', '22261', '25749', '25748', '25745', '20001', '25744', '25746', '25747', '30433', '30439', '23875', '30444', '30435', '23874', '23880', '23882', '30443', '30432', '30446', '18996', '23872', '30442', '30440', '23873', '30436', '30438', '30447', '30441', '30437', '23876', '30445', '23879', '23878', '30434', '18995', '23871', '23881', '23877', '25187', '19560', '25186', '19550', '25191', '19549', '25188', '25192', '19559', '19558', '19555', '19552', '25189', '19551', '19557', '19556']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('3.99', '572', '2007-04-30T06:38:24.996577', '9081', '1'), - ('4.99', '572', '2007-03-02T07:16:57.996577', '11121', '1'), - ('2.99', '572', '2007-04-11T05:47:50.996577', '6108', '2'), - ('0.99', '572', '2007-03-02T06:55:11.996577', '11114', '1'), - ('1.99', '572', '2007-03-18T02:38:05.996577', '12256', '1'), - ('2.99', '572', '2007-03-02T18:12:04.996577', '11415', '2'), - ('4.99', '572', '2007-04-10T03:02:11.996577', '5595', '1'), - ('1.99', '572', '2007-03-19T20:00:49.996577', '13377', '2'), - ('0.99', '572', '2007-02-17T10:15:43.996577', '2007', '1'), - ('0.99', '572', '2007-02-18T18:07:31.996577', '2458', '1'), - ('0.99', '572', '2007-04-29T03:13:31.996577', '8342', '2'), - ('4.99', '572', '2007-04-30T23:16:05.996577', '10204', '2'), - ('10.99', '572', '2007-02-17T02:33:38.996577', '1889', '2'), - ('6.99', '572', '2007-04-10T09:14:41.996577', '5713', '1'), - ('6.99', '572', '2007-04-28T03:00:40.996577', '7713', '2'), - ('5.99', '572', '2007-04-30T14:18:48.996577', '9950', '2'), - ('4.99', '572', '2007-04-27T12:58:19.996577', '7345', '1'), - ('6.99', '572', '2007-03-20T01:15:29.996577', '13523', '2'), - ('0.99', '572', '2007-04-29T05:41:59.996577', '8432', '1'), - ('0.99', '558', '2007-03-02T12:39:05.996577', '11268', '1'), - ('6.99', '558', '2007-04-09T17:21:21.996577', '5375', '2'), - ('2.99', '558', '2007-04-29T23:08:09.996577', '8889', '1'), - ('5.99', '558', '2007-03-20T03:13:58.996577', '13566', '2'), - ('4.99', '558', '2007-02-19T00:44:43.996577', '2544', '2'), - ('2.99', '558', '2007-04-08T20:46:06.996577', '4932', '1'), - ('5.99', '558', '2007-04-07T09:25:32.996577', '4192', '1'), - ('10.99', '558', '2007-02-21T19:39:05.996577', '3451', '2'), - ('2.99', '558', '2007-04-29T08:46:53.996577', '8523', '1'), - ('3.99', '558', '2007-04-09T22:39:35.996577', '5492', '1'), - ('1.99', '558', '2007-02-18T15:24:20.996577', '2411', '1'), - ('9.99', '558', '2007-04-06T10:02:02.996577', '3731', '1'), - ('5.99', '558', '2007-03-16T23:57:09.996577', '11567', '2'), - ('0.99', '558', '2007-03-01T17:10:00.996577', '10707', '2'), - ('4.99', '558', '2007-04-29T22:13:01.996577', '8858', '1'), - ('7.99', '558', '2007-03-21T03:37:08.996577', '14235', '2'), - ('1.99', '558', '2007-03-18T00:33:13.996577', '12194', '1'), - ('9.99', '558', '2007-04-12T00:17:26.996577', '6479', '2'), - ('0.99', '558', '2007-04-27T15:42:45.996577', '7424', '1'), - ('4.99', '558', '2007-02-20T09:23:34.996577', '3016', '2'), - ('4.99', '558', '2007-02-17T07:48:18.996577', '1967', '2'), - ('6.99', '558', '2007-03-17T18:58:22.996577', '12040', '2'), - ('4.99', '558', '2007-04-12T12:53:57.996577', '6742', '2'), - ('3.99', '558', '2007-04-06T22:01:10.996577', '3990', '1'), - ('0.99', '558', '2007-04-12T13:38:14.996577', '6757', '1'), - ('7.99', '558', '2007-04-11T14:48:28.996577', '6278', '2'), - ('0.99', '558', '2007-04-06T20:26:10.996577', '3954', '1'), - ('5.99', '558', '2007-03-21T05:22:19.996577', '14286', '1'), - ('5.99', '318', '2007-04-30T16:54:17.996577', '10023', '2'), - ('0.99', '318', '2007-04-28T08:05:04.996577', '7853', '2'), - ('2.99', '318', '2007-04-06T21:27:42.996577', '3974', '2'), - ('2.99', '318', '2007-03-21T05:02:31.996577', '14276', '1'), - ('4.99', '318', '2007-04-06T10:02:03.996577', '3732', '1'), - ('8.99', '318', '2007-04-07T17:49:48.996577', '4356', '1'), - ('0.99', '318', '2007-04-28T00:05:52.996577', '7649', '1'), - ('5.99', '128', '2007-04-06T22:11:29.996577', '3995', '2'), - ('2.99', '128', '2007-04-12T10:47:49.996577', '6687', '2'), - ('0.99', '128', '2007-03-19T06:53:42.996577', '13027', '2'), - ('5.99', '128', '2007-04-30T19:56:43.996577', '9433', '1'), - ('4.99', '128', '2007-04-10T05:37:06.996577', '5647', '1'), - ('0.99', '128', '2007-03-19T02:51:39.996577', '12910', '2'), - ('8.99', '128', '2007-03-22T03:44:42.996577', '14925', '1'), - ('8.99', '128', '2007-03-23T13:53:53.996577', '15835', '1'), - ('2.99', '128', '2007-04-30T12:14:20.996577', '9234', '2'), - ('0.99', '128', '2007-04-06T10:52:07.996577', '3751', '1'), - ('3.99', '128', '2007-04-30T14:21:03.996577', '9952', '1'), - ('0.99', '128', '2007-02-19T02:12:29.996577', '2565', '1'), - ('2.99', '128', '2007-03-18T20:24:04.996577', '12731', '2'), - ('5.99', '128', '2007-04-30T11:39:37.996577', '9215', '2'), - ('4.99', '128', '2007-04-27T21:43:40.996577', '7582', '2'), - ('2.99', '128', '2007-03-19T00:27:20.996577', '12843', '2'), - ('4.99', '128', '2007-04-10T23:48:16.996577', '5997', '2'), - ('6.99', '128', '2007-04-12T00:18:41.996577', '6481', '2'), - ('2.99', '128', '2007-04-30T16:31:07.996577', '10011', '1'), - ('2.99', '128', '2007-04-29T05:20:53.996577', '8415', '2'), - ('2.99', '128', '2007-04-11T09:55:07.996577', '6186', '2'), - ('5.99', '128', '2007-03-19T12:29:22.996577', '13181', '2'), - ('2.99', '128', '2007-04-30T11:30:33.996577', '9858', '2'), - ('0.99', '128', '2007-03-21T01:11:41.996577', '14157', '2'), - ('2.99', '128', '2007-03-20T16:52:52.996577', '13964', '2'), - ('2.99', '128', '2007-04-09T12:52:12.996577', '5270', '1'), - ('7.99', '128', '2007-02-18T22:47:47.996577', '2519', '2'), - ('2.99', '128', '2007-03-01T05:26:43.996577', '10394', '1'), - ('3.99', '128', '2007-03-22T15:30:49.996577', '15220', '1'), - ('0.99', '128', '2007-03-20T00:42:42.996577', '13509', '1'), - ('9.99', '270', '2007-04-06T21:56:50.996577', '3987', '1'), - ('6.99', '270', '2007-03-23T05:38:48.996577', '15620', '2'), - ('3.99', '270', '2007-04-05T22:39:54.996577', '3501', '1'), - ('5.99', '270', '2007-03-01T12:16:48.996577', '10579', '2'), - ('3.99', '270', '2007-04-29T12:16:46.996577', '8618', '2'), - ('7.99', '270', '2007-03-01T08:01:19.996577', '10461', '1'), - ('0.99', '270', '2007-04-10T00:47:54.996577', '5533', '2'), - ('3.99', '270', '2007-04-30T18:11:44.996577', '10069', '1'), - ('0.99', '270', '2007-03-21T16:38:17.996577', '14618', '1'), - ('1.99', '270', '2007-03-20T16:12:22.996577', '13945', '2'), - ('2.99', '270', '2007-03-17T14:36:43.996577', '11917', '1'), - ('2.99', '270', '2007-03-02T17:07:38.996577', '11389', '1'), - ('4.99', '270', '2007-04-12T02:33:42.996577', '6520', '2'), - ('4.99', '270', '2007-03-01T14:37:18.996577', '10648', '2'), - ('2.99', '270', '2007-03-18T09:18:33.996577', '12442', '1'), - ('2.99', '270', '2007-03-18T00:30:06.996577', '12192', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['19554', '25190', '19553', '17654', '26463', '20577', '20587', '20586', '17653', '20576', '20584', '26460', '20579', '26462', '26471', '26469', '26464', '17656', '20585', '17651', '26458', '26466', '20582', '26468', '20583', '20581', '20578', '20580', '20588', '26459', '26467', '17657', '17658', '26465', '26470', '17655', '17652', '26461', '27805', '27808', '21740', '27810', '27809', '18118', '21739', '27811', '27804', '27803', '21737', '27807', '21736', '27806', '21734', '21733', '18119', '21735', '21738', '26017', '20210', '26020', '20215', '26016', '26024', '20211', '20217', '20225', '26015', '17509', '20216', '17510', '20209', '20218', '26023', '20221', '20224', '26025', '20223', '26018', '26022', '20220', '26021', '20219', '17511', '20213', '20222', '26014', '20212', '20214', '26019', '27174', '27166', '21185', '27172', '21177', '21182', '21183', '21176', '21184', '21179', '27168']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('2.99', '270', '2007-03-17T11:40:46.996577', '11841', '2'), - ('2.99', '270', '2007-04-29T03:26:09.996577', '8355', '1'), - ('0.99', '270', '2007-03-17T10:25:14.996577', '11810', '1'), - ('2.99', '380', '2007-02-18T17:09:35.996577', '2440', '1'), - ('8.99', '380', '2007-04-27T00:55:04.996577', '7021', '2'), - ('3.99', '380', '2007-03-02T02:52:49.996577', '10983', '1'), - ('2.99', '380', '2007-03-23T08:33:02.996577', '15697', '1'), - ('2.99', '380', '2007-03-23T06:19:12.996577', '15636', '2'), - ('3.99', '380', '2007-02-17T11:04:24.996577', '2018', '1'), - ('1.99', '380', '2007-03-01T07:38:29.996577', '10450', '2'), - ('5.99', '380', '2007-03-22T13:57:41.996577', '15175', '2'), - ('2.99', '380', '2007-04-08T08:52:48.996577', '4675', '1'), - ('0.99', '380', '2007-03-17T15:33:59.996577', '11945', '2'), - ('0.99', '380', '2007-04-09T15:37:43.996577', '5339', '2'), - ('10.99', '380', '2007-04-30T06:33:57.996577', '9710', '1'), - ('0.99', '380', '2007-04-30T05:41:46.996577', '9056', '1'), - ('2.99', '380', '2007-04-27T06:05:52.996577', '7167', '2'), - ('1.99', '380', '2007-02-20T07:58:48.996577', '2998', '2'), - ('2.99', '380', '2007-03-22T20:08:11.996577', '15361', '1'), - ('3.99', '380', '2007-02-17T00:31:48.996577', '1868', '1'), - ('2.99', '380', '2007-04-06T05:34:57.996577', '3637', '1'), - ('2.99', '380', '2007-04-27T16:16:09.996577', '7443', '2'), - ('6.99', '380', '2007-03-21T13:36:57.996577', '14529', '1'), - ('3.99', '380', '2007-04-28T12:40:23.996577', '7974', '1'), - ('1.99', '380', '2007-03-22T04:15:57.996577', '14935', '1'), - ('6.99', '380', '2007-03-19T05:59:58.996577', '12996', '1'), - ('0.99', '380', '2007-03-17T15:14:00.996577', '11936', '1'), - ('3.99', '380', '2007-03-18T16:28:55.996577', '12636', '1'), - ('2.99', '380', '2007-03-23T11:01:26.996577', '15748', '2'), - ('4.99', '380', '2007-04-06T08:10:19.996577', '3688', '1'), - ('2.99', '380', '2007-04-28T05:30:43.996577', '7773', '1'), - ('1.99', '380', '2007-02-20T15:12:59.996577', '3099', '2'), - ('4.99', '380', '2007-02-21T02:27:39.996577', '3260', '1'), - ('0.99', '380', '2007-04-27T16:07:10.996577', '7435', '2'), - ('6.99', '380', '2007-04-30T13:08:01.996577', '9261', '1'), - ('4.99', '380', '2007-02-18T18:34:31.996577', '2464', '1'), - ('2.99', '380', '2007-02-17T08:53:54.996577', '1984', '1'), - ('4.99', '380', '2007-04-08T10:20:07.996577', '4706', '2'), - ('2.99', '501', '2007-04-08T13:57:42.996577', '4769', '2'), - ('0.99', '501', '2007-04-27T17:03:19.996577', '7456', '1'), - ('5.99', '501', '2007-03-23T08:49:01.996577', '15699', '1'), - ('2.99', '501', '2007-04-29T08:52:57.996577', '8529', '2'), - ('2.99', '501', '2007-04-28T14:13:50.996577', '8021', '1'), - ('5.99', '501', '2007-02-21T00:18:55.996577', '3222', '2'), - ('4.99', '501', '2007-03-22T16:14:43.996577', '15239', '1'), - ('2.99', '501', '2007-04-30T17:07:54.996577', '9359', '1'), - ('6.99', '501', '2007-04-06T09:40:28.996577', '3723', '2'), - ('6.99', '501', '2007-04-06T00:18:37.996577', '3541', '2'), - ('4.99', '501', '2007-03-19T02:54:25.996577', '12914', '1'), - ('7.99', '501', '2007-04-11T04:35:07.996577', '6095', '2'), - ('6.99', '501', '2007-03-17T09:53:51.996577', '11799', '2'), - ('1.99', '501', '2007-04-09T23:59:07.996577', '5520', '2'), - ('4.99', '501', '2007-03-02T17:12:55.996577', '11393', '2'), - ('4.99', '501', '2007-03-01T21:19:34.996577', '10817', '1'), - ('7.99', '501', '2007-02-21T15:12:57.996577', '3412', '1'), - ('1.99', '501', '2007-03-17T03:12:59.996577', '11640', '1'), - ('0.99', '501', '2007-03-20T14:08:32.996577', '13889', '2'), - ('2.99', '342', '2007-04-12T12:45:16.996577', '6736', '1'), - ('2.99', '342', '2007-03-02T09:16:36.996577', '11178', '2'), - ('2.99', '342', '2007-04-27T10:19:18.996577', '7280', '2'), - ('2.99', '342', '2007-03-18T12:14:06.996577', '12522', '1'), - ('8.99', '342', '2007-04-11T22:31:16.996577', '6429', '2'), - ('0.99', '342', '2007-04-30T14:29:52.996577', '9955', '1'), - ('0.99', '342', '2007-03-02T19:02:03.996577', '11446', '2'), - ('4.99', '342', '2007-03-19T19:48:01.996577', '13368', '2'), - ('3.99', '342', '2007-03-23T15:37:57.996577', '15895', '1'), - ('4.99', '342', '2007-04-11T02:34:43.996577', '6060', '2'), - ('5.99', '342', '2007-02-17T23:58:17.996577', '2190', '2'), - ('4.99', '342', '2007-03-18T23:32:31.996577', '12816', '2'), - ('5.99', '342', '2007-02-20T02:11:44.996577', '2914', '1'), - ('4.99', '342', '2007-03-01T00:46:38.996577', '10242', '1'), - ('4.99', '342', '2007-03-20T05:49:41.996577', '13637', '2'), - ('5.99', '342', '2007-04-30T14:18:07.996577', '9948', '2'), - ('2.99', '342', '2007-03-20T22:56:12.996577', '14096', '2'), - ('4.99', '342', '2007-03-23T00:33:15.996577', '15484', '1'), - ('4.99', '342', '2007-04-30T14:32:13.996577', '9956', '2'), - ('8.99', '342', '2007-03-21T18:56:10.996577', '14683', '2'), - ('7.99', '342', '2007-04-12T15:01:54.996577', '6787', '2'), - ('0.99', '342', '2007-04-30T23:30:48.996577', '9526', '1'), - ('4.99', '342', '2007-03-20T12:15:45.996577', '13827', '2'), - ('2.99', '342', '2007-04-30T09:52:40.996577', '9164', '1'), - ('2.99', '342', '2007-03-20T09:47:19.996577', '13755', '1'), - ('2.99', '342', '2007-02-20T13:57:39.996577', '3081', '1'), - ('6.99', '342', '2007-03-17T22:25:39.996577', '12139', '1'), - ('0.99', '342', '2007-03-21T05:47:23.996577', '14299', '2'), - ('0.99', '342', '2007-04-10T03:57:16.996577', '5617', '1'), - ('0.99', '342', '2007-03-16T23:58:27.996577', '11568', '1'), - ('4.99', '342', '2007-03-18T08:05:00.996577', '12404', '1'), - ('0.99', '342', '2007-04-26T23:42:28.996577', '6997', '2'), - ('5.99', '443', '2007-04-30T18:36:10.996577', '10081', '2'), - ('5.99', '443', '2007-04-12T07:35:06.996577', '6625', '2'), - ('0.99', '443', '2007-03-23T01:51:58.996577', '15519', '1'), - ('1.99', '443', '2007-04-30T07:36:29.996577', '9740', '2'), - ('4.99', '443', '2007-03-02T19:13:09.996577', '11449', '1'), - ('6.99', '443', '2007-03-21T16:30:07.996577', '14611', '2'), - ('0.99', '443', '2007-03-22T14:15:31.996577', '15182', '1'), - ('0.99', '443', '2007-03-01T04:21:19.996577', '10360', '2'), - ('4.99', '443', '2007-03-22T21:32:35.996577', '15393', '2'), - ('4.99', '443', '2007-03-19T00:48:39.996577', '12857', '2'), - ('2.99', '443', '2007-04-26T23:23:29.996577', '6983', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['27165', '17888', '27171', '21178', '27167', '27169', '27170', '21180', '27173', '21181', '24697', '31347', '19323', '24703', '31345', '24699', '31349', '24702', '32085', '24698', '19321', '31346', '24700', '31344', '32084', '24704', '19322', '24696', '19319', '19320', '31348', '24701', '19203', '31081', '31077', '24449', '24444', '19205', '24450', '19204', '24448', '31076', '31082', '24445', '24446', '24447', '31086', '31083', '31078', '19206', '31080', '31084', '31085', '31079', '31496', '31498', '19358', '31493', '32090', '31495', '24795', '24798', '24801', '31489', '19356', '31492', '31486', '31487', '19359', '31497', '24799', '31494', '31491', '31490', '24796', '31488', '19357', '24797', '24800', '28348', '28345', '18292', '28344', '28343', '22198', '22201', '28346', '22203', '22195', '22200', '22194', '22199', '28350', '22202', '28347', '28349', '22196', '22204', '18291', '22197']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('5.99', '443', '2007-04-05T22:56:07.996577', '3510', '2'), - ('2.99', '443', '2007-02-19T22:56:15.996577', '2871', '1'), - ('9.99', '443', '2007-04-28T13:05:18.996577', '7987', '1'), - ('4.99', '443', '2007-03-18T08:22:27.996577', '12415', '1'), - ('4.99', '443', '2007-04-12T20:46:38.996577', '6913', '1'), - ('2.99', '443', '2007-04-27T11:48:07.996577', '7317', '1'), - ('8.99', '443', '2007-04-28T01:05:48.996577', '7667', '1'), - ('2.99', '443', '2007-03-19T23:57:32.996577', '13489', '1'), - ('4.99', '443', '2007-04-30T16:39:22.996577', '10014', '1'), - ('2.99', '443', '2007-03-21T14:49:09.996577', '14561', '1'), - ('0.99', '216', '2007-03-02T03:33:49.996577', '11005', '1'), - ('4.99', '216', '2007-04-28T15:50:54.996577', '8068', '1'), - ('2.99', '216', '2007-02-21T17:30:29.996577', '3432', '1'), - ('2.99', '216', '2007-03-22T14:46:15.996577', '15199', '2'), - ('6.99', '216', '2007-04-11T00:19:55.996577', '6008', '1'), - ('0.99', '216', '2007-03-19T21:38:35.996577', '13424', '2'), - ('0.99', '216', '2007-04-30T07:07:49.996577', '9096', '1'), - ('4.99', '216', '2007-03-22T14:34:49.996577', '15192', '1'), - ('0.00', '216', '2007-05-14T13:44:29.996577', '11676', '1'), - ('7.99', '216', '2007-03-17T02:42:11.996577', '11621', '2'), - ('3.99', '216', '2007-02-16T09:06:00.996577', '1672', '1'), - ('7.99', '216', '2007-04-11T18:53:31.996577', '6349', '2'), - ('2.99', '216', '2007-03-21T17:30:02.996577', '14638', '2'), - ('2.99', '216', '2007-04-07T07:43:37.996577', '4161', '2'), - ('5.98', '216', '2007-05-14T13:44:29.996577', '12970', '1'), - ('4.99', '216', '2007-03-23T17:09:07.996577', '15934', '2'), - ('0.99', '216', '2007-02-18T10:56:23.996577', '2351', '2'), - ('4.99', '216', '2007-03-01T09:44:31.996577', '10506', '1'), - ('6.99', '216', '2007-02-15T19:00:34.996577', '1461', '2'), - ('0.99', '216', '2007-02-16T08:43:46.996577', '1664', '1'), - ('8.99', '216', '2007-04-29T22:13:09.996577', '8859', '2'), - ('4.99', '216', '2007-03-21T20:37:18.996577', '14726', '2'), - ('0.99', '183', '2007-02-15T06:42:23.996577', '1279', '1'), - ('4.99', '183', '2007-04-12T00:01:51.996577', '6472', '1'), - ('0.99', '183', '2007-04-07T06:42:50.996577', '4134', '2'), - ('2.99', '183', '2007-03-19T23:42:56.996577', '13482', '1'), - ('5.99', '183', '2007-03-01T13:37:43.996577', '10620', '2'), - ('5.99', '183', '2007-02-18T18:59:26.996577', '2471', '2'), - ('4.99', '183', '2007-03-20T02:03:42.996577', '13536', '1'), - ('1.99', '183', '2007-02-17T23:47:30.996577', '2188', '2'), - ('3.99', '183', '2007-03-19T00:09:09.996577', '12831', '2'), - ('2.99', '183', '2007-04-06T16:25:12.996577', '3869', '1'), - ('4.99', '183', '2007-04-12T04:16:06.996577', '6569', '1'), - ('2.99', '183', '2007-03-02T16:52:29.996577', '11386', '2'), - ('0.99', '183', '2007-03-18T09:33:08.996577', '12451', '2'), - ('3.99', '183', '2007-03-18T21:42:41.996577', '12764', '2'), - ('2.99', '183', '2007-04-30T13:46:45.996577', '9931', '2'), - ('0.99', '183', '2007-04-27T13:19:30.996577', '7359', '2'), - ('2.99', '183', '2007-04-07T07:32:52.996577', '4157', '2'), - ('5.99', '183', '2007-02-21T12:31:25.996577', '3381', '1'), - ('0.99', '183', '2007-04-10T11:07:54.996577', '5756', '2'), - ('5.99', '183', '2007-04-30T05:02:32.996577', '9672', '2'), - ('4.99', '183', '2007-04-30T10:02:58.996577', '9818', '1'), - ('1.99', '183', '2007-04-09T03:24:56.996577', '5069', '1'), - ('0.99', '229', '2007-04-27T23:28:35.996577', '7629', '2'), - ('3.99', '229', '2007-04-30T13:19:30.996577', '9913', '2'), - ('7.99', '229', '2007-02-21T04:05:03.996577', '3277', '1'), - ('2.99', '229', '2007-04-12T19:10:01.996577', '6880', '1'), - ('0.99', '229', '2007-05-14T13:44:29.996577', '13295', '2'), - ('5.99', '229', '2007-04-27T11:28:51.996577', '7308', '2'), - ('4.99', '229', '2007-03-16T22:33:20.996577', '11521', '1'), - ('4.99', '229', '2007-03-19T21:56:41.996577', '13431', '2'), - ('2.99', '229', '2007-03-23T16:16:06.996577', '15912', '2'), - ('0.99', '229', '2007-04-08T09:36:03.996577', '4694', '2'), - ('4.99', '229', '2007-02-18T00:27:42.996577', '2200', '1'), - ('4.99', '229', '2007-04-12T04:44:07.996577', '6578', '2'), - ('4.99', '229', '2007-04-06T19:35:03.996577', '3933', '2'), - ('2.99', '229', '2007-04-07T22:16:13.996577', '4458', '2'), - ('0.99', '229', '2007-02-21T04:36:38.996577', '3280', '2'), - ('7.99', '229', '2007-04-27T23:43:15.996577', '7640', '2'), - ('5.99', '229', '2007-03-20T07:08:00.996577', '13679', '1'), - ('0.99', '229', '2007-04-27T11:25:32.996577', '7305', '2'), - ('4.99', '229', '2007-04-11T08:13:57.996577', '6155', '2'), - ('2.99', '229', '2007-04-10T04:10:04.996577', '5623', '1'), - ('2.99', '229', '2007-03-19T01:08:13.996577', '12866', '1'), - ('4.99', '229', '2007-04-08T01:10:29.996577', '4515', '1'), - ('0.99', '229', '2007-02-20T23:18:29.996577', '3208', '1'), - ('0.99', '229', '2007-03-19T17:25:55.996577', '13306', '2'), - ('4.99', '229', '2007-03-23T10:36:17.996577', '15740', '1'), - ('0.99', '551', '2007-04-30T03:05:46.996577', '8986', '1'), - ('0.99', '551', '2007-04-10T00:37:47.996577', '5528', '2'), - ('3.99', '551', '2007-02-19T16:44:50.996577', '2776', '1'), - ('1.99', '551', '2007-04-09T09:21:19.996577', '5201', '1'), - ('5.99', '551', '2007-04-06T22:15:09.996577', '3996', '2'), - ('3.99', '551', '2007-03-19T22:10:42.996577', '13439', '1'), - ('2.99', '551', '2007-03-21T17:19:36.996577', '14633', '2'), - ('0.99', '551', '2007-04-11T01:43:24.996577', '6041', '1'), - ('4.99', '551', '2007-03-22T20:50:59.996577', '15377', '1'), - ('2.99', '551', '2007-03-17T13:09:54.996577', '11883', '2'), - ('4.99', '551', '2007-03-21T16:25:52.996577', '14609', '2'), - ('0.99', '551', '2007-03-02T16:45:58.996577', '11380', '2'), - ('0.99', '551', '2007-03-21T09:44:41.996577', '14420', '1'), - ('4.99', '551', '2007-04-30T08:13:06.996577', '9765', '2'), - ('2.99', '551', '2007-03-22T00:13:44.996577', '14833', '1'), - ('9.99', '551', '2007-04-27T03:19:41.996577', '7095', '2'), - ('2.99', '551', '2007-04-30T14:04:05.996577', '9287', '1'), - ('4.99', '551', '2007-03-18T00:53:51.996577', '12208', '2'), - ('6.99', '551', '2007-03-22T21:25:51.996577', '15390', '2'), - ('4.99', '551', '2007-02-17T14:48:05.996577', '2069', '2'), - ('0.99', '551', '2007-03-19T01:15:45.996577', '12868', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['18799', '18797', '18796', '23420', '23422', '29846', '29850', '23424', '29852', '23418', '29848', '29849', '29847', '23427', '23421', '29845', '23419', '18800', '29851', '18798', '23423', '23425', '23426', '25825', '25832', '25830', '20054', '20047', '25824', '25829', '20051', '25823', '25831', '20053', '25826', '25827', '20052', '20050', '20048', '20049', '25828', '25694', '19975', '25701', '19970', '19969', '19971', '25696', '19977', '25700', '25709', '25710', '25703', '19967', '19968', '19976', '25702', '19974', '25711', '25706', '19973', '25697', '19972', '25705', '25708', '25704', '25699', '25698', '25695', '25707', '26658', '20760', '20758', '17736', '26657', '26661', '20757', '17737', '26655', '17735', '26660', '26656', '26659', '20756', '20759', '25660', '25663', '19939', '25667', '19938', '19941', '25666', '25661', '25664', '19937', '25665', '19940', '25662', '22137', '22132']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('2.99', '77', '2007-02-20T19:05:19.996577', '3151', '1'), - ('3.99', '77', '2007-02-18T11:22:44.996577', '2354', '1'), - ('4.99', '77', '2007-02-16T12:39:50.996577', '1710', '1'), - ('0.99', '77', '2007-03-02T03:09:38.996577', '10991', '2'), - ('7.99', '77', '2007-03-17T08:29:06.996577', '11767', '2'), - ('0.99', '77', '2007-04-11T08:50:04.996577', '6168', '2'), - ('4.99', '77', '2007-04-30T01:29:33.996577', '8942', '2'), - ('1.99', '77', '2007-03-18T05:12:22.996577', '12328', '2'), - ('4.99', '77', '2007-04-30T22:37:59.996577', '10184', '2'), - ('2.99', '77', '2007-03-01T23:21:00.996577', '10886', '1'), - ('3.99', '77', '2007-04-27T14:54:11.996577', '7406', '1'), - ('0.99', '77', '2007-04-28T02:52:33.996577', '7710', '1'), - ('2.99', '77', '2007-04-11T20:47:49.996577', '6390', '2'), - ('2.99', '77', '2007-03-22T20:02:26.996577', '15359', '2'), - ('2.99', '77', '2007-03-02T20:16:35.996577', '11469', '1'), - ('0.99', '77', '2007-04-08T20:34:07.996577', '4928', '2'), - ('0.99', '77', '2007-03-01T23:45:25.996577', '10895', '1'), - ('0.99', '77', '2007-02-21T01:16:47.996577', '3238', '2'), - ('0.99', '77', '2007-04-30T09:52:11.996577', '9811', '1'), - ('8.99', '77', '2007-02-18T17:57:47.996577', '2452', '2'), - ('6.99', '77', '2007-03-17T20:00:12.996577', '12065', '1'), - ('9.99', '77', '2007-03-20T09:46:11.996577', '13752', '2'), - ('4.99', '77', '2007-03-21T13:39:16.996577', '14530', '2'), - ('4.99', '325', '2007-04-10T12:02:52.996577', '5775', '1'), - ('4.99', '325', '2007-04-30T18:14:55.996577', '10070', '1'), - ('0.99', '325', '2007-04-29T09:16:50.996577', '8539', '2'), - ('0.99', '325', '2007-03-22T06:55:53.996577', '15009', '2'), - ('4.99', '325', '2007-03-01T03:24:00.996577', '10326', '2'), - ('2.99', '325', '2007-04-10T10:20:24.996577', '5740', '2'), - ('2.99', '325', '2007-04-28T01:48:52.996577', '7687', '2'), - ('4.99', '325', '2007-03-19T08:02:28.996577', '13054', '2'), - ('5.99', '325', '2007-04-09T21:39:15.996577', '5470', '1'), - ('2.99', '325', '2007-04-30T17:08:02.996577', '10030', '2'), - ('5.99', '325', '2007-03-21T18:27:59.996577', '14672', '1'), - ('4.99', '325', '2007-04-11T07:00:49.996577', '6135', '2'), - ('0.99', '325', '2007-04-12T07:32:37.996577', '6622', '2'), - ('3.99', '325', '2007-03-21T10:51:46.996577', '14452', '2'), - ('3.99', '325', '2007-03-18T22:12:26.996577', '12779', '1'), - ('0.99', '325', '2007-03-01T06:25:42.996577', '10412', '1'), - ('4.99', '325', '2007-03-17T21:03:50.996577', '12097', '2'), - ('9.99', '325', '2007-04-27T08:10:53.996577', '7223', '2'), - ('0.99', '314', '2007-04-05T23:21:01.996577', '3517', '1'), - ('4.99', '314', '2007-03-21T23:41:10.996577', '14815', '2'), - ('2.99', '314', '2007-04-12T10:00:41.996577', '6666', '1'), - ('2.99', '314', '2007-03-19T15:57:26.996577', '13265', '1'), - ('3.99', '314', '2007-03-19T10:16:04.996577', '13120', '2'), - ('3.99', '314', '2007-03-20T02:35:47.996577', '13553', '2'), - ('0.99', '314', '2007-04-06T13:44:01.996577', '3808', '1'), - ('3.99', '314', '2007-03-23T20:06:25.996577', '16021', '2'), - ('5.99', '314', '2007-04-11T10:13:07.996577', '6192', '1'), - ('4.99', '314', '2007-04-29T13:14:11.996577', '8644', '2'), - ('3.99', '314', '2007-04-30T10:54:17.996577', '9191', '2'), - ('4.99', '314', '2007-04-27T00:04:31.996577', '7004', '2'), - ('3.99', '314', '2007-03-17T14:11:35.996577', '11908', '2'), - ('0.99', '314', '2007-03-18T09:06:34.996577', '12434', '1'), - ('5.99', '314', '2007-03-22T01:59:32.996577', '14873', '2'), - ('3.99', '314', '2007-04-12T13:55:00.996577', '6763', '1'), - ('4.99', '314', '2007-03-21T18:54:23.996577', '14682', '2'), - ('6.99', '314', '2007-04-30T15:42:56.996577', '9318', '2'), - ('3.99', '314', '2007-04-28T15:57:28.996577', '8073', '1'), - ('4.99', '314', '2007-03-21T09:22:01.996577', '14409', '1'), - ('0.99', '314', '2007-04-07T19:23:45.996577', '4386', '2'), - ('4.99', '314', '2007-03-21T00:40:04.996577', '14145', '2'), - ('6.99', '314', '2007-04-28T14:17:22.996577', '8022', '2'), - ('6.99', '314', '2007-04-29T02:34:50.996577', '8328', '2'), - ('2.99', '314', '2007-04-27T10:10:23.996577', '7276', '1'), - ('0.99', '314', '2007-04-10T16:25:58.996577', '5856', '2'), - ('4.99', '314', '2007-04-09T11:47:40.996577', '5241', '2'), - ('2.99', '314', '2007-04-06T06:23:48.996577', '3656', '1'), - ('0.99', '314', '2007-04-28T17:28:12.996577', '8105', '2'), - ('7.99', '398', '2007-04-29T05:38:40.996577', '8428', '1'), - ('3.99', '398', '2007-03-22T14:25:08.996577', '15189', '1'), - ('2.99', '398', '2007-03-18T12:21:07.996577', '12528', '2'), - ('6.99', '398', '2007-02-17T16:03:36.996577', '2087', '1'), - ('4.99', '398', '2007-04-28T21:46:55.996577', '8204', '2'), - ('1.99', '398', '2007-04-30T08:24:02.996577', '9771', '1'), - ('4.99', '398', '2007-03-02T07:42:35.996577', '11132', '2'), - ('9.99', '398', '2007-02-20T18:24:13.996577', '3141', '2'), - ('5.99', '398', '2007-04-09T11:13:13.996577', '5234', '2'), - ('2.99', '398', '2007-02-15T02:19:02.996577', '1228', '2'), - ('5.99', '398', '2007-04-30T13:44:17.996577', '9281', '2'), - ('3.99', '398', '2007-04-28T17:51:41.996577', '8119', '2'), - ('2.99', '398', '2007-04-30T05:02:21.996577', '9042', '1'), - ('2.99', '398', '2007-03-01T00:18:02.996577', '10230', '1'), - ('4.99', '398', '2007-03-20T06:10:50.996577', '13643', '2'), - ('10.99', '310', '2007-04-06T14:29:42.996577', '3830', '2'), - ('0.99', '310', '2007-04-10T15:17:28.996577', '5836', '2'), - ('7.99', '310', '2007-03-18T19:31:16.996577', '12710', '2'), - ('2.99', '310', '2007-04-30T23:47:28.996577', '9536', '1'), - ('4.99', '310', '2007-03-18T11:34:17.996577', '12500', '2'), - ('5.99', '310', '2007-03-22T05:21:47.996577', '14972', '1'), - ('7.99', '310', '2007-04-30T02:53:56.996577', '8981', '1'), - ('0.99', '310', '2007-04-07T03:16:28.996577', '4072', '1'), - ('5.99', '310', '2007-04-28T00:03:59.996577', '7648', '1'), - ('2.99', '310', '2007-03-02T07:53:57.996577', '11137', '2'), - ('5.99', '310', '2007-04-29T12:58:37.996577', '8637', '2'), - ('4.99', '310', '2007-03-19T03:33:49.996577', '12929', '1'), - ('5.99', '310', '2007-04-10T04:02:36.996577', '5621', '1'), - ('4.99', '544', '2007-03-21T12:39:10.996577', '14498', '1'), - ('0.99', '544', '2007-03-01T17:58:11.996577', '10735', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['28282', '28283', '28281', '18274', '22133', '22134', '18273', '22141', '28285', '28286', '22138', '18271', '22139', '22136', '22140', '22135', '28284', '18272', '26160', '26158', '20327', '26156', '26152', '20326', '26165', '20325', '31942', '26149', '20329', '20330', '26153', '26154', '26162', '26161', '26148', '20331', '17556', '31941', '26164', '17559', '26151', '26150', '20324', '17557', '26157', '17558', '26159', '26163', '26155', '20328', '26147', '22660', '28953', '28956', '28957', '28958', '28960', '18488', '28962', '28964', '22659', '22667', '22663', '22664', '22658', '22665', '18486', '28954', '22661', '28961', '22662', '28952', '28963', '18487', '22666', '28959', '28955', '22657', '20526', '20519', '20522', '20517', '26402', '17630', '31950', '20520', '26407', '20518', '20523', '17631', '26411', '17633', '17632', '26406', '20521', '26409', '26405', '26410', '26408', '26404']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('2.99', '544', '2007-04-08T10:13:22.996577', '4703', '1'), - ('6.99', '544', '2007-04-08T16:57:39.996577', '4847', '2'), - ('0.99', '544', '2007-04-07T19:41:48.996577', '4395', '1'), - ('2.99', '544', '2007-02-18T14:13:41.996577', '2395', '1'), - ('3.99', '544', '2007-03-02T17:33:32.996577', '11401', '1'), - ('2.99', '544', '2007-03-17T08:27:06.996577', '11766', '2'), - ('0.99', '544', '2007-02-18T13:06:23.996577', '2373', '1'), - ('4.99', '544', '2007-03-23T05:17:13.996577', '15605', '1'), - ('5.99', '544', '2007-04-30T01:21:47.996577', '8937', '1'), - ('9.99', '544', '2007-04-30T02:14:52.996577', '8963', '1'), - ('8.99', '544', '2007-03-21T17:59:35.996577', '14651', '2'), - ('1.99', '544', '2007-02-15T04:02:18.996577', '1248', '1'), - ('2.99', '544', '2007-03-22T05:47:31.996577', '14981', '1'), - ('4.99', '544', '2007-03-21T00:36:09.996577', '14142', '2'), - ('6.99', '544', '2007-03-22T15:28:57.996577', '15219', '1'), - ('3.99', '544', '2007-03-18T16:43:15.996577', '12640', '2'), - ('2.99', '544', '2007-04-29T10:04:12.996577', '8566', '2'), - ('10.99', '544', '2007-02-15T16:59:12.996577', '1434', '2'), - ('0.99', '354', '2007-04-27T08:54:15.996577', '7241', '2'), - ('0.99', '354', '2007-04-27T05:32:35.996577', '7148', '2'), - ('4.99', '354', '2007-03-19T06:00:42.996577', '12998', '1'), - ('0.99', '354', '2007-04-26T21:21:11.996577', '6926', '1'), - ('4.99', '354', '2007-04-10T01:38:43.996577', '5556', '2'), - ('3.99', '354', '2007-03-18T12:54:17.996577', '12544', '1'), - ('2.99', '354', '2007-04-30T08:23:36.996577', '9130', '1'), - ('6.99', '354', '2007-03-18T02:07:20.996577', '12243', '2'), - ('0.00', '354', '2007-05-14T13:44:29.996577', '11782', '1'), - ('5.99', '354', '2007-04-07T21:47:24.996577', '4449', '1'), - ('0.99', '354', '2007-03-21T03:59:20.996577', '14245', '2'), - ('5.99', '354', '2007-03-22T00:27:08.996577', '14840', '1'), - ('3.99', '354', '2007-04-10T17:30:36.996577', '5873', '1'), - ('0.99', '354', '2007-04-11T02:27:05.996577', '6054', '1'), - ('8.99', '354', '2007-04-29T07:09:02.996577', '8477', '2'), - ('4.99', '354', '2007-04-29T02:19:20.996577', '8321', '2'), - ('0.99', '354', '2007-04-07T01:04:59.996577', '4034', '2'), - ('0.99', '354', '2007-03-23T17:47:47.996577', '15956', '2'), - ('0.99', '354', '2007-02-15T20:16:44.996577', '1491', '1'), - ('7.98', '354', '2007-05-14T13:44:29.996577', '12759', '1'), - ('0.99', '354', '2007-04-30T00:32:28.996577', '8921', '2'), - ('2.99', '354', '2007-02-20T18:13:11.996577', '3139', '1'), - ('4.99', '354', '2007-04-09T16:32:59.996577', '5354', '1'), - ('2.99', '354', '2007-04-08T12:13:35.996577', '4745', '2'), - ('6.99', '354', '2007-03-01T06:42:19.996577', '10420', '1'), - ('4.99', '354', '2007-02-18T04:59:55.996577', '2275', '1'), - ('5.99', '354', '2007-04-26T21:46:17.996577', '6939', '1'), - ('6.99', '354', '2007-02-19T16:20:40.996577', '2769', '1'), - ('2.99', '354', '2007-04-27T08:37:56.996577', '7235', '2'), - ('4.99', '354', '2007-04-29T11:47:51.996577', '8609', '1'), - ('4.99', '354', '2007-04-12T17:29:56.996577', '6838', '1'), - ('2.99', '354', '2007-03-21T02:57:52.996577', '14212', '2'), - ('2.99', '354', '2007-04-06T14:04:46.996577', '3821', '2'), - ('4.99', '206', '2007-03-19T10:32:42.996577', '13128', '1'), - ('0.99', '206', '2007-04-06T14:35:01.996577', '3831', '2'), - ('4.99', '206', '2007-04-07T05:04:58.996577', '4107', '2'), - ('4.99', '206', '2007-04-08T15:57:20.996577', '4823', '2'), - ('3.99', '206', '2007-04-11T07:07:59.996577', '6139', '1'), - ('4.99', '206', '2007-04-27T08:07:09.996577', '7222', '1'), - ('4.99', '206', '2007-02-20T09:11:39.996577', '3012', '2'), - ('5.99', '206', '2007-04-28T22:12:39.996577', '8217', '1'), - ('2.99', '206', '2007-04-30T21:34:10.996577', '9474', '2'), - ('2.99', '206', '2007-03-17T03:00:15.996577', '11634', '2'), - ('4.99', '206', '2007-03-23T09:04:26.996577', '15709', '1'), - ('9.99', '206', '2007-03-20T02:27:17.996577', '13550', '2'), - ('0.99', '206', '2007-03-20T07:44:41.996577', '13696', '2'), - ('2.99', '206', '2007-03-02T04:03:29.996577', '11022', '1'), - ('0.99', '206', '2007-03-21T19:15:13.996577', '14695', '2'), - ('0.99', '206', '2007-02-17T00:55:29.996577', '1872', '2'), - ('4.99', '206', '2007-04-06T15:13:07.996577', '3847', '1'), - ('2.99', '206', '2007-03-19T14:41:58.996577', '13232', '2'), - ('4.99', '206', '2007-04-27T20:08:31.996577', '7541', '2'), - ('10.99', '206', '2007-03-19T15:55:21.996577', '13263', '2'), - ('5.99', '206', '2007-04-05T23:55:10.996577', '3533', '1'), - ('3.99', '206', '2007-04-29T09:40:39.996577', '8549', '1'), - ('5.99', '206', '2007-02-18T19:27:12.996577', '2477', '2'), - ('7.99', '206', '2007-03-23T08:10:47.996577', '15686', '2'), - ('6.99', '206', '2007-04-11T22:07:15.996577', '6420', '1'), - ('4.99', '206', '2007-04-07T03:03:04.996577', '4068', '2'), - ('3.99', '206', '2007-03-02T01:06:33.996577', '10930', '2'), - ('6.99', '374', '2007-03-22T20:14:23.996577', '15366', '2'), - ('2.99', '374', '2007-03-18T18:41:34.996577', '12696', '2'), - ('8.99', '374', '2007-03-21T13:33:53.996577', '14524', '2'), - ('2.99', '374', '2007-03-01T16:44:46.996577', '10695', '1'), - ('1.99', '374', '2007-04-06T13:23:18.996577', '3797', '1'), - ('1.99', '374', '2007-02-16T00:11:59.996577', '1548', '1'), - ('2.99', '374', '2007-05-14T13:44:29.996577', '15966', '2'), - ('2.99', '374', '2007-03-19T18:35:23.996577', '13337', '1'), - ('0.99', '374', '2007-04-11T17:11:15.996577', '6315', '2'), - ('0.99', '374', '2007-03-17T02:31:52.996577', '11619', '1'), - ('5.99', '374', '2007-03-22T08:41:35.996577', '15053', '2'), - ('1.99', '374', '2007-02-17T13:08:16.996577', '2046', '2'), - ('6.99', '374', '2007-04-30T11:42:16.996577', '9866', '1'), - ('2.99', '374', '2007-02-19T08:06:59.996577', '2641', '2'), - ('4.99', '374', '2007-02-18T20:01:20.996577', '2487', '2'), - ('2.99', '374', '2007-04-10T21:21:08.996577', '5945', '2'), - ('4.99', '374', '2007-03-20T08:58:23.996577', '13734', '2'), - ('7.99', '374', '2007-04-29T10:45:00.996577', '8586', '2'), - ('3.99', '374', '2007-04-10T02:53:29.996577', '5591', '2'), - ('0.99', '374', '2007-04-30T07:37:29.996577', '9113', '2'), - ('0.99', '374', '2007-04-28T07:26:58.996577', '7837', '2'), - ('6.99', '374', '2007-04-10T02:15:13.996577', '5570', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['26403', '20524', '20525', '24390', '19183', '24396', '31019', '32067', '31018', '31020', '19184', '31015', '24398', '31022', '24389', '19186', '19190', '31023', '31010', '19185', '19187', '24400', '31025', '19189', '31016', '24391', '24392', '31021', '24399', '31026', '31013', '24397', '31017', '24394', '31027', '31024', '24393', '19188', '31012', '24395', '31014', '31011', '30463', '19005', '30468', '19004', '23897', '30466', '30469', '19007', '23901', '19006', '23898', '30465', '23903', '23899', '30467', '19008', '30470', '23896', '23900', '23902', '19003', '30464', '25022', '31772', '25015', '25019', '31782', '31770', '31779', '31771', '25016', '31776', '31778', '25026', '19456', '25025', '19457', '31774', '31781', '25024', '25021', '25020', '25023', '31777', '19455', '31780', '25018', '19454', '19453', '31775', '31773', '25017', '30024', '30031', '30025', '18862', '30033', '30032']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('4.99', '374', '2007-04-09T21:25:28.996577', '5463', '1'), - ('2.99', '374', '2007-03-22T14:51:19.996577', '15200', '1'), - ('4.99', '374', '2007-03-22T14:55:19.996577', '15202', '2'), - ('5.99', '178', '2007-03-01T20:46:58.996577', '10802', '1'), - ('6.99', '178', '2007-02-15T07:32:18.996577', '1292', '1'), - ('2.99', '178', '2007-03-19T10:32:29.996577', '13127', '1'), - ('4.99', '178', '2007-04-28T12:11:46.996577', '7959', '1'), - ('4.99', '178', '2007-05-14T13:44:29.996577', '12897', '1'), - ('2.99', '178', '2007-04-12T06:32:06.996577', '6606', '2'), - ('0.99', '178', '2007-04-28T15:52:12.996577', '8069', '2'), - ('6.99', '178', '2007-02-15T18:52:31.996577', '1458', '2'), - ('4.99', '178', '2007-04-11T18:47:19.996577', '6347', '2'), - ('7.99', '178', '2007-03-21T04:21:23.996577', '14257', '1'), - ('5.99', '178', '2007-04-29T04:16:41.996577', '8388', '2'), - ('0.99', '178', '2007-03-01T11:34:18.996577', '10562', '2'), - ('3.99', '178', '2007-02-16T15:09:42.996577', '1745', '2'), - ('9.99', '178', '2007-02-20T01:06:32.996577', '2898', '1'), - ('4.99', '178', '2007-04-29T15:13:44.996577', '8696', '2'), - ('2.99', '178', '2007-04-08T19:59:48.996577', '4915', '1'), - ('2.99', '178', '2007-02-16T01:42:27.996577', '1568', '2'), - ('1.99', '178', '2007-02-17T19:17:40.996577', '2124', '2'), - ('4.99', '178', '2007-03-22T18:51:06.996577', '15323', '1'), - ('7.99', '178', '2007-04-30T15:26:57.996577', '9311', '1'), - ('6.99', '178', '2007-02-19T21:08:38.996577', '2844', '2'), - ('5.99', '178', '2007-04-12T03:35:52.996577', '6554', '1'), - ('6.99', '178', '2007-03-02T14:38:35.996577', '11319', '2'), - ('6.99', '178', '2007-03-17T13:11:49.996577', '11884', '2'), - ('3.99', '178', '2007-04-29T00:32:24.996577', '8287', '1'), - ('2.99', '178', '2007-03-21T06:18:40.996577', '14314', '2'), - ('4.99', '178', '2007-04-30T12:13:58.996577', '9879', '2'), - ('10.99', '178', '2007-04-09T04:28:13.996577', '5094', '1'), - ('4.99', '178', '2007-03-20T23:06:10.996577', '14104', '1'), - ('6.99', '178', '2007-04-12T04:11:19.996577', '6566', '1'), - ('6.99', '178', '2007-03-17T19:21:53.996577', '12049', '2'), - ('0.99', '178', '2007-04-30T20:01:29.996577', '10125', '2'), - ('4.99', '178', '2007-04-30T03:32:53.996577', '9004', '2'), - ('3.99', '178', '2007-03-17T14:53:29.996577', '11927', '2'), - ('4.99', '178', '2007-02-18T06:13:29.996577', '2293', '1'), - ('4.99', '178', '2007-04-09T02:48:55.996577', '5057', '1'), - ('2.99', '178', '2007-03-18T20:13:41.996577', '12727', '2'), - ('2.99', '178', '2007-04-10T23:13:02.996577', '5984', '1'), - ('2.99', '178', '2007-04-09T00:22:50.996577', '5015', '1'), - ('4.99', '130', '2007-04-07T17:10:08.996577', '4339', '2'), - ('2.99', '130', '2007-02-17T22:14:42.996577', '2163', '2'), - ('0.99', '130', '2007-04-30T20:47:42.996577', '9452', '1'), - ('2.99', '130', '2007-02-17T00:08:13.996577', '1864', '2'), - ('5.99', '130', '2007-03-01T14:20:27.996577', '10645', '2'), - ('4.99', '130', '2007-04-27T06:43:00.996577', '7181', '1'), - ('4.99', '130', '2007-04-30T03:47:20.996577', '9637', '2'), - ('2.99', '130', '2007-02-19T00:07:30.996577', '2535', '1'), - ('0.99', '130', '2007-03-20T23:27:27.996577', '14111', '2'), - ('2.99', '130', '2007-02-18T06:06:14.996577', '2292', '2'), - ('2.99', '130', '2007-03-17T10:27:44.996577', '11811', '1'), - ('3.99', '130', '2007-04-11T19:17:22.996577', '6353', '1'), - ('4.99', '130', '2007-03-23T11:57:34.996577', '15777', '1'), - ('2.99', '130', '2007-03-17T20:59:30.996577', '12094', '1'), - ('0.99', '130', '2007-04-28T03:24:59.996577', '7728', '1'), - ('6.99', '130', '2007-02-20T07:06:55.996577', '2982', '1'), - ('5.99', '130', '2007-04-30T07:01:34.996577', '9724', '2'), - ('2.99', '130', '2007-03-01T11:45:54.996577', '10568', '2'), - ('6.99', '130', '2007-03-18T22:07:48.996577', '12777', '1'), - ('5.99', '130', '2007-03-23T03:57:58.996577', '15574', '2'), - ('2.99', '130', '2007-02-16T06:23:27.996577', '1630', '1'), - ('4.99', '130', '2007-04-07T23:36:20.996577', '4485', '2'), - ('4.99', '254', '2007-03-19T06:05:10.996577', '13001', '2'), - ('3.99', '254', '2007-04-09T03:30:24.996577', '5072', '1'), - ('4.99', '254', '2007-03-01T10:17:17.996577', '10522', '1'), - ('0.99', '254', '2007-03-18T00:50:46.996577', '12206', '1'), - ('1.99', '254', '2007-04-30T22:21:12.996577', '9494', '2'), - ('4.99', '254', '2007-04-06T17:06:47.996577', '3882', '1'), - ('4.99', '254', '2007-04-27T15:14:06.996577', '7413', '1'), - ('2.99', '254', '2007-04-09T01:48:56.996577', '5042', '2'), - ('0.99', '254', '2007-03-02T09:50:00.996577', '11190', '1'), - ('7.99', '254', '2007-04-10T14:49:28.996577', '5826', '1'), - ('0.99', '254', '2007-04-27T00:27:00.996577', '7011', '2'), - ('0.99', '254', '2007-03-23T11:53:34.996577', '15774', '1'), - ('2.99', '254', '2007-02-17T19:56:40.996577', '2138', '1'), - ('4.99', '254', '2007-03-21T12:38:13.996577', '14497', '2'), - ('3.99', '254', '2007-02-19T11:15:18.996577', '2687', '2'), - ('0.99', '254', '2007-04-10T01:04:07.996577', '5537', '1'), - ('4.99', '254', '2007-04-29T10:30:32.996577', '8581', '2'), - ('2.99', '254', '2007-03-19T10:35:08.996577', '13130', '2'), - ('0.99', '254', '2007-03-19T01:36:23.996577', '12874', '1'), - ('2.99', '254', '2007-03-18T02:20:17.996577', '12247', '1'), - ('4.99', '254', '2007-03-19T07:46:01.996577', '13045', '1'), - ('4.99', '254', '2007-04-10T20:27:58.996577', '5930', '2'), - ('2.99', '254', '2007-02-17T15:41:58.996577', '2082', '1'), - ('7.99', '254', '2007-04-28T22:12:25.996577', '8216', '2'), - ('0.99', '254', '2007-03-17T22:41:41.996577', '12148', '2'), - ('0.99', '254', '2007-02-15T14:34:55.996577', '1390', '2'), - ('2.99', '254', '2007-02-15T07:01:32.996577', '1285', '1'), - ('5.99', '254', '2007-04-10T01:27:01.996577', '5550', '1'), - ('2.99', '254', '2007-04-09T03:52:21.996577', '5080', '2'), - ('6.99', '254', '2007-03-17T04:05:23.996577', '11665', '1'), - ('2.99', '92', '2007-04-07T17:59:38.996577', '4360', '1'), - ('6.99', '92', '2007-04-11T14:47:27.996577', '6277', '2'), - ('4.99', '92', '2007-04-08T16:20:55.996577', '4828', '2'), - ('8.99', '92', '2007-02-19T14:27:30.996577', '2740', '1'), - ('1.99', '92', '2007-04-28T07:14:37.996577', '7832', '1'), - ('4.99', '92', '2007-04-27T02:31:52.996577', '7073', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['30027', '23572', '30028', '23569', '30035', '23565', '30022', '30026', '30029', '30030', '18861', '23566', '30034', '23567', '23568', '23571', '18860', '30023', '23570', '30036', '24955', '31709', '24953', '31705', '24954', '24956', '19428', '19431', '31710', '24957', '19429', '31707', '31711', '19430', '31706', '31708', '24958', '19427', '30412', '23850', '23852', '18991', '30417', '30421', '30413', '23856', '30411', '30420', '23857', '23849', '23853', '30416', '30419', '23858', '30422', '30418', '30415', '23855', '30423', '23859', '23851', '30414', '23854', '25633', '25637', '25630', '25632', '25634', '25629', '19913', '19910', '25627', '25635', '19914', '19908', '25625', '19909', '19911', '25631', '25626', '19912', '25636', '25628', '18782', '29815', '23400', '29813', '23392', '23391', '29810', '29806', '23399', '18784', '23394', '23393', '18783', '23396', '29812', '23390', '23395']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('7.99', '92', '2007-04-10T03:59:18.996577', '5620', '2'), - ('4.99', '92', '2007-03-22T06:21:40.996577', '14998', '2'), - ('6.99', '92', '2007-04-10T12:50:45.996577', '5792', '1'), - ('0.99', '92', '2007-03-20T00:08:51.996577', '13495', '1'), - ('4.99', '92', '2007-04-30T01:24:34.996577', '8938', '1'), - ('4.99', '92', '2007-03-02T10:21:07.996577', '11203', '2'), - ('8.99', '92', '2007-04-06T03:28:15.996577', '3595', '2'), - ('5.99', '92', '2007-04-09T22:51:49.996577', '5497', '2'), - ('2.99', '92', '2007-04-10T20:00:40.996577', '5919', '2'), - ('0.99', '92', '2007-04-11T08:18:50.996577', '6158', '1'), - ('0.99', '92', '2007-02-18T23:09:34.996577', '2521', '1'), - ('2.99', '92', '2007-03-02T12:02:16.996577', '11245', '2'), - ('4.99', '92', '2007-04-29T07:32:58.996577', '8494', '1'), - ('4.99', '92', '2007-03-17T11:53:21.996577', '11849', '1'), - ('5.99', '92', '2007-03-19T06:36:16.996577', '13020', '2'), - ('0.99', '92', '2007-03-21T23:12:34.996577', '14798', '1'), - ('4.99', '92', '2007-02-17T15:45:45.996577', '2084', '2'), - ('7.99', '92', '2007-04-06T09:20:58.996577', '3716', '2'), - ('2.99', '92', '2007-03-20T05:09:53.996577', '13620', '1'), - ('4.99', '92', '2007-04-30T12:26:20.996577', '9240', '1'), - ('6.99', '246', '2007-03-20T09:40:08.996577', '13750', '1'), - ('4.99', '246', '2007-04-12T10:50:38.996577', '6688', '1'), - ('2.99', '246', '2007-03-01T16:01:29.996577', '10683', '2'), - ('7.99', '246', '2007-04-07T04:22:44.996577', '4092', '1'), - ('5.99', '246', '2007-03-19T21:22:22.996577', '13418', '2'), - ('4.99', '246', '2007-03-20T17:47:56.996577', '13987', '1'), - ('2.99', '246', '2007-02-17T07:49:02.996577', '1968', '1'), - ('4.99', '246', '2007-02-20T19:11:07.996577', '3152', '1'), - ('5.99', '246', '2007-04-30T23:30:44.996577', '9525', '2'), - ('6.99', '246', '2007-03-21T07:45:06.996577', '14360', '1'), - ('1.99', '246', '2007-02-19T12:18:36.996577', '2704', '2'), - ('2.99', '246', '2007-04-08T23:22:39.996577', '4994', '2'), - ('4.99', '246', '2007-04-30T23:23:17.996577', '10208', '2'), - ('0.99', '246', '2007-02-19T13:29:49.996577', '2725', '1'), - ('4.99', '246', '2007-04-08T19:24:26.996577', '4905', '2'), - ('0.99', '246', '2007-04-09T15:59:58.996577', '5347', '2'), - ('2.99', '246', '2007-03-23T10:54:45.996577', '15746', '1'), - ('1.99', '246', '2007-02-15T17:45:42.996577', '1448', '2'), - ('4.99', '126', '2007-04-06T09:43:30.996577', '3725', '1'), - ('4.99', '126', '2007-03-17T02:18:59.996577', '11613', '2'), - ('0.99', '126', '2007-03-17T09:58:37.996577', '11801', '1'), - ('2.99', '126', '2007-02-21T19:30:23.996577', '3450', '1'), - ('0.99', '126', '2007-04-10T16:59:31.996577', '5865', '1'), - ('2.99', '126', '2007-04-28T16:55:55.996577', '8091', '1'), - ('7.99', '126', '2007-04-06T13:36:34.996577', '3804', '1'), - ('2.99', '126', '2007-03-21T12:01:04.996577', '14477', '2'), - ('5.99', '126', '2007-04-05T22:43:32.996577', '3502', '2'), - ('0.99', '126', '2007-04-28T12:16:35.996577', '7962', '1'), - ('2.99', '126', '2007-03-21T15:20:55.996577', '14577', '2'), - ('9.99', '126', '2007-03-02T10:11:06.996577', '11196', '1'), - ('2.99', '126', '2007-03-19T05:49:50.996577', '12991', '2'), - ('0.99', '126', '2007-04-09T06:29:00.996577', '5137', '2'), - ('6.99', '126', '2007-04-12T13:36:15.996577', '6755', '2'), - ('4.99', '126', '2007-03-23T10:39:20.996577', '15741', '2'), - ('6.99', '126', '2007-04-30T22:20:47.996577', '9492', '1'), - ('0.99', '126', '2007-04-12T13:01:47.996577', '6747', '1'), - ('2.99', '126', '2007-04-08T11:28:15.996577', '4730', '2'), - ('0.99', '126', '2007-03-19T12:25:24.996577', '13177', '2'), - ('4.99', '126', '2007-04-30T17:10:21.996577', '10032', '2'), - ('7.99', '126', '2007-03-23T19:31:09.996577', '16007', '1'), - ('3.99', '126', '2007-03-17T09:00:24.996577', '11779', '1'), - ('0.99', '126', '2007-04-08T09:33:19.996577', '4691', '1'), - ('7.99', '126', '2007-03-19T06:25:17.996577', '13015', '2'), - ('2.99', '307', '2007-04-27T20:02:35.996577', '7536', '1'), - ('4.99', '307', '2007-04-30T20:25:58.996577', '10135', '1'), - ('6.99', '307', '2007-04-11T06:32:01.996577', '6125', '2'), - ('10.99', '307', '2007-04-26T23:31:32.996577', '6991', '1'), - ('3.99', '307', '2007-04-28T04:58:11.996577', '7760', '1'), - ('3.99', '307', '2007-04-10T17:14:34.996577', '5871', '1'), - ('0.99', '307', '2007-03-21T03:33:00.996577', '14231', '1'), - ('7.99', '307', '2007-03-02T21:13:16.996577', '11491', '1'), - ('2.99', '307', '2007-04-08T01:31:38.996577', '4522', '1'), - ('0.99', '307', '2007-04-28T10:45:06.996577', '7929', '1'), - ('4.99', '307', '2007-03-23T01:32:19.996577', '15515', '2'), - ('0.99', '307', '2007-03-01T04:53:53.996577', '10374', '1'), - ('6.99', '307', '2007-04-06T20:42:11.996577', '3962', '1'), - ('2.99', '307', '2007-03-01T18:25:32.996577', '10745', '1'), - ('4.99', '307', '2007-03-18T07:21:19.996577', '12391', '2'), - ('0.99', '307', '2007-04-11T13:47:48.996577', '6256', '1'), - ('4.99', '307', '2007-04-06T21:52:29.996577', '3985', '1'), - ('6.99', '307', '2007-03-19T19:41:03.996577', '13365', '2'), - ('6.99', '307', '2007-04-29T13:21:25.996577', '8647', '1'), - ('4.99', '307', '2007-04-08T17:42:16.996577', '4868', '1'), - ('0.99', '74', '2007-02-18T22:39:52.996577', '2517', '2'), - ('3.99', '74', '2007-04-30T17:42:46.996577', '10051', '2'), - ('0.99', '74', '2007-03-23T20:55:13.996577', '16046', '1'), - ('5.99', '74', '2007-04-29T19:37:37.996577', '8796', '2'), - ('0.99', '74', '2007-03-19T18:31:44.996577', '13335', '2'), - ('3.99', '74', '2007-03-18T10:53:27.996577', '12477', '2'), - ('7.99', '74', '2007-04-11T13:09:14.996577', '6241', '1'), - ('3.99', '74', '2007-04-06T14:03:32.996577', '3819', '2'), - ('4.99', '74', '2007-03-23T10:24:48.996577', '15739', '2'), - ('7.99', '74', '2007-02-21T19:08:54.996577', '3445', '2'), - ('1.99', '74', '2007-03-20T03:58:11.996577', '13583', '1'), - ('0.99', '74', '2007-03-20T01:10:12.996577', '13520', '2'), - ('1.99', '74', '2007-02-20T09:40:30.996577', '3020', '1'), - ('4.99', '74', '2007-03-22T17:46:22.996577', '15286', '1'), - ('6.99', '74', '2007-04-27T11:25:22.996577', '7304', '1'), - ('3.99', '74', '2007-03-18T06:36:11.996577', '12374', '2'), - ('5.99', '74', '2007-03-20T09:24:32.996577', '13747', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['29814', '29809', '29807', '23398', '29811', '29808', '18781', '23397', '23389', '26992', '17828', '26991', '21045', '26987', '17827', '21047', '17829', '21044', '17830', '21043', '21050', '21046', '21048', '26990', '17831', '26993', '26984', '26989', '26986', '26985', '21049', '26988', '22558', '22559', '28805', '28798', '28808', '22556', '28810', '22553', '28799', '28800', '22557', '28802', '28804', '28811', '22554', '28803', '22552', '28806', '18440', '28807', '28812', '18438', '28801', '22555', '22551', '18439', '28809', '26251', '20403', '26254', '20402', '26247', '20399', '26246', '26257', '17587', '26258', '20395', '20401', '20405', '20396', '17589', '20404', '26259', '26249', '26260', '26250', '26253', '17590', '20400', '17588', '20398', '20397', '26252', '26255', '17591', '26256', '26248', '29526', '23137', '23141', '29519', '29522', '29527', '29523', '23139', '18694', '29521']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('4.99', '74', '2007-04-30T07:34:57.996577', '9112', '2'), - ('4.99', '74', '2007-04-10T19:58:48.996577', '5917', '2'), - ('2.99', '74', '2007-04-10T00:42:15.996577', '5530', '1'), - ('0.99', '74', '2007-03-23T01:08:03.996577', '15500', '2'), - ('2.99', '74', '2007-04-12T00:05:23.996577', '6475', '1'), - ('2.99', '74', '2007-04-10T03:33:20.996577', '5603', '2'), - ('1.99', '74', '2007-02-18T21:24:52.996577', '2498', '1'), - ('4.99', '74', '2007-03-22T18:56:04.996577', '15325', '2'), - ('0.99', '74', '2007-03-01T13:55:31.996577', '10624', '1'), - ('5.99', '427', '2007-04-29T13:45:03.996577', '8658', '2'), - ('3.99', '427', '2007-02-16T06:21:21.996577', '1628', '2'), - ('5.99', '427', '2007-04-29T08:54:41.996577', '8531', '1'), - ('4.99', '427', '2007-03-01T11:33:23.996577', '10560', '2'), - ('6.99', '427', '2007-04-11T22:15:57.996577', '6423', '1'), - ('5.99', '427', '2007-02-15T10:54:47.996577', '1342', '1'), - ('1.99', '427', '2007-03-20T08:30:05.996577', '13720', '1'), - ('5.99', '427', '2007-02-16T07:45:33.996577', '1648', '1'), - ('5.99', '427', '2007-03-01T08:11:40.996577', '10464', '1'), - ('1.99', '427', '2007-02-16T23:41:24.996577', '1857', '1'), - ('4.99', '427', '2007-03-01T06:39:02.996577', '10417', '1'), - ('3.99', '427', '2007-03-22T19:03:56.996577', '15330', '1'), - ('5.99', '427', '2007-03-02T04:06:57.996577', '11024', '1'), - ('6.99', '427', '2007-03-21T02:20:00.996577', '14201', '2'), - ('3.99', '427', '2007-04-28T20:47:38.996577', '8182', '2'), - ('0.99', '427', '2007-02-18T18:47:08.996577', '2466', '2'), - ('2.99', '427', '2007-04-30T15:28:17.996577', '9978', '2'), - ('3.99', '427', '2007-04-08T14:58:27.996577', '4793', '1'), - ('7.99', '427', '2007-04-26T21:44:30.996577', '6938', '2'), - ('5.99', '427', '2007-04-10T02:45:32.996577', '5586', '2'), - ('2.99', '427', '2007-04-09T22:05:35.996577', '5476', '2'), - ('3.99', '427', '2007-03-21T05:22:25.996577', '14287', '1'), - ('2.99', '427', '2007-04-12T02:03:27.996577', '6509', '1'), - ('3.99', '591', '2007-03-19T18:50:34.996577', '13343', '2'), - ('9.99', '591', '2007-03-20T13:34:08.996577', '13867', '1'), - ('4.99', '591', '2007-04-27T19:07:06.996577', '7511', '2'), - ('0.99', '591', '2007-04-06T05:32:18.996577', '3636', '1'), - ('4.99', '591', '2007-04-28T13:30:51.996577', '7997', '1'), - ('5.99', '591', '2007-03-19T03:47:08.996577', '12934', '1'), - ('5.99', '591', '2007-04-29T14:08:04.996577', '8666', '2'), - ('4.99', '591', '2007-03-18T01:32:54.996577', '12227', '2'), - ('11.99', '591', '2007-04-07T19:14:17.996577', '4383', '2'), - ('6.99', '591', '2007-04-08T04:33:32.996577', '4581', '1'), - ('2.99', '591', '2007-03-19T09:34:32.996577', '13104', '2'), - ('6.99', '591', '2007-04-10T11:11:48.996577', '5759', '1'), - ('2.99', '591', '2007-04-27T07:49:48.996577', '7212', '1'), - ('4.99', '591', '2007-04-29T20:42:52.996577', '8819', '2'), - ('4.99', '591', '2007-03-18T12:58:05.996577', '12547', '1'), - ('8.99', '591', '2007-04-27T04:22:16.996577', '7118', '1'), - ('5.99', '591', '2007-03-18T00:47:18.996577', '12203', '2'), - ('3.99', '591', '2007-04-27T20:21:47.996577', '7549', '1'), - ('4.99', '591', '2007-02-21T17:43:24.996577', '3435', '2'), - ('0.99', '591', '2007-04-28T03:54:21.996577', '7741', '2'), - ('0.99', '591', '2007-04-30T05:16:59.996577', '9684', '1'), - ('0.99', '591', '2007-02-15T16:19:53.996577', '1418', '1'), - ('5.99', '591', '2007-04-10T08:34:55.996577', '5704', '1'), - ('5.99', '591', '2007-03-18T13:59:44.996577', '12571', '1'), - ('4.99', '591', '2007-03-01T06:34:25.996577', '10415', '1'), - ('2.99', '591', '2007-02-21T09:05:51.996577', '3341', '2'), - ('3.99', '591', '2007-04-28T19:16:38.996577', '8149', '1'), - ('4.99', '362', '2007-04-12T04:42:07.996577', '6576', '2'), - ('11.99', '362', '2007-03-21T21:57:24.996577', '14759', '1'), - ('2.99', '362', '2007-04-27T17:57:35.996577', '7485', '1'), - ('5.99', '362', '2007-03-21T21:40:08.996577', '14752', '1'), - ('4.99', '362', '2007-04-09T10:45:05.996577', '5227', '1'), - ('6.99', '362', '2007-03-20T20:38:17.996577', '14051', '2'), - ('8.99', '362', '2007-04-08T07:51:52.996577', '4646', '2'), - ('4.99', '362', '2007-04-29T03:38:57.996577', '8364', '2'), - ('2.99', '362', '2007-02-15T16:52:36.996577', '1429', '1'), - ('0.99', '362', '2007-04-29T13:59:59.996577', '8662', '1'), - ('3.99', '362', '2007-03-01T11:12:43.996577', '10546', '2'), - ('4.99', '362', '2007-03-21T07:02:08.996577', '14336', '2'), - ('2.99', '362', '2007-03-22T04:45:38.996577', '14950', '1'), - ('4.99', '362', '2007-03-18T02:07:37.996577', '12244', '2'), - ('2.99', '362', '2007-02-16T05:28:54.996577', '1615', '1'), - ('4.99', '362', '2007-03-21T23:27:01.996577', '14808', '1'), - ('2.99', '362', '2007-04-29T16:00:06.996577', '8714', '1'), - ('5.99', '362', '2007-04-10T07:55:15.996577', '5690', '2'), - ('4.99', '362', '2007-04-30T08:49:58.996577', '9784', '1'), - ('4.99', '362', '2007-04-11T10:57:48.996577', '6204', '1'), - ('1.99', '362', '2007-04-27T06:27:42.996577', '7172', '1'), - ('2.99', '362', '2007-02-20T22:35:49.996577', '3197', '2'), - ('2.99', '362', '2007-03-21T00:10:41.996577', '14129', '2'), - ('2.99', '362', '2007-02-15T23:06:01.996577', '1529', '1'), - ('6.99', '362', '2007-03-20T04:31:14.996577', '13603', '1'), - ('6.99', '362', '2007-03-19T00:47:17.996577', '12854', '1'), - ('4.99', '362', '2007-04-26T23:20:04.996577', '6981', '1'), - ('2.99', '362', '2007-04-28T16:35:12.996577', '8081', '1'), - ('2.99', '362', '2007-02-21T13:42:53.996577', '3393', '2'), - ('2.99', '362', '2007-04-29T02:25:53.996577', '8325', '2'), - ('1.99', '362', '2007-04-10T01:49:28.996577', '5563', '2'), - ('6.99', '47', '2007-04-29T04:54:11.996577', '8402', '2'), - ('0.99', '47', '2007-03-02T07:27:30.996577', '11126', '1'), - ('0.99', '47', '2007-03-21T08:54:22.996577', '14397', '1'), - ('4.99', '47', '2007-04-06T05:05:19.996577', '3631', '1'), - ('9.99', '47', '2007-04-11T07:59:30.996577', '6153', '2'), - ('3.99', '47', '2007-04-29T22:20:27.996577', '8863', '1'), - ('0.99', '47', '2007-04-11T08:44:49.996577', '6164', '2'), - ('7.99', '47', '2007-03-18T01:04:05.996577', '12215', '1'), - ('6.99', '47', '2007-02-18T07:03:25.996577', '2307', '1'), - ('0.99', '47', '2007-04-09T08:00:25.996577', '5174', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['18693', '23138', '23142', '29528', '18695', '29524', '29525', '29520', '23140', '29433', '29428', '23066', '18661', '23064', '18662', '29426', '29423', '29424', '29434', '18663', '18660', '29432', '29431', '23070', '29435', '23065', '18665', '23068', '23067', '29425', '23063', '18664', '29436', '23069', '29430', '29437', '29429', '29427', '30100', '30092', '30097', '23617', '30099', '30096', '32046', '30095', '30106', '18890', '30093', '30102', '30105', '30101', '30103', '23615', '23618', '30098', '18891', '23616', '30094', '30104', '23619', '19391', '31601', '19393', '31590', '31594', '31598', '31599', '31592', '31595', '19392', '31596', '24865', '31591', '19395', '24871', '31603', '31600', '24870', '31604', '24866', '19394', '31597', '24874', '24873', '24872', '24868', '31593', '24875', '24867', '31602', '24869', '23535', '23534', '29970', '29969', '18846', '29964', '29962', '29963']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('4.99', '47', '2007-02-17T01:45:47.996577', '1882', '1'), - ('5.99', '47', '2007-03-02T20:37:27.996577', '11477', '2'), - ('2.99', '47', '2007-03-23T14:07:44.996577', '15846', '2'), - ('4.99', '47', '2007-04-30T13:35:30.996577', '9274', '2'), - ('5.99', '47', '2007-02-21T06:58:07.996577', '3320', '2'), - ('3.99', '47', '2007-04-11T17:59:13.996577', '6337', '1'), - ('4.99', '47', '2007-04-28T19:37:54.996577', '8159', '2'), - ('5.99', '47', '2007-04-07T02:57:46.996577', '4064', '2'), - ('7.99', '47', '2007-03-18T03:10:13.996577', '12274', '2'), - ('2.99', '39', '2007-04-29T19:58:24.996577', '8805', '1'), - ('2.99', '39', '2007-04-09T23:41:10.996577', '5515', '2'), - ('9.99', '39', '2007-03-01T14:13:09.996577', '10639', '1'), - ('4.99', '39', '2007-02-17T03:20:09.996577', '1905', '1'), - ('4.99', '39', '2007-03-01T01:37:52.996577', '10269', '2'), - ('0.99', '39', '2007-02-17T19:42:28.996577', '2135', '2'), - ('7.99', '39', '2007-04-08T11:22:41.996577', '4727', '2'), - ('5.99', '39', '2007-04-07T20:34:50.996577', '4419', '1'), - ('8.99', '39', '2007-04-08T09:36:25.996577', '4695', '2'), - ('1.99', '39', '2007-04-30T19:52:48.996577', '9431', '1'), - ('4.99', '39', '2007-02-18T17:03:30.996577', '2439', '2'), - ('5.99', '39', '2007-02-16T06:17:34.996577', '1625', '1'), - ('7.99', '39', '2007-04-29T16:32:13.996577', '8723', '2'), - ('1.99', '39', '2007-04-29T03:39:40.996577', '8366', '2'), - ('5.99', '39', '2007-03-22T11:20:04.996577', '15124', '2'), - ('4.99', '39', '2007-04-30T04:28:47.996577', '9656', '1'), - ('0.99', '39', '2007-03-01T14:03:12.996577', '10630', '2'), - ('4.99', '39', '2007-02-19T23:35:00.996577', '2876', '1'), - ('4.99', '39', '2007-03-18T09:53:37.996577', '12459', '2'), - ('0.99', '39', '2007-03-18T02:55:20.996577', '12268', '2'), - ('6.99', '39', '2007-04-08T10:39:16.996577', '4712', '2'), - ('4.99', '39', '2007-03-01T01:07:38.996577', '10251', '1'), - ('4.99', '39', '2007-02-19T07:18:19.996577', '2631', '1'), - ('4.99', '39', '2007-04-30T17:43:39.996577', '10052', '2'), - ('7.99', '39', '2007-03-19T09:30:20.996577', '13101', '2'), - ('6.99', '39', '2007-04-29T01:47:00.996577', '8307', '2'), - ('0.99', '39', '2007-04-30T20:04:33.996577', '10126', '1'), - ('2.99', '39', '2007-04-11T01:49:31.996577', '6045', '1'), - ('4.99', '39', '2007-04-09T20:50:36.996577', '5451', '1'), - ('2.99', '99', '2007-04-11T15:35:05.996577', '6289', '1'), - ('6.99', '99', '2007-04-06T12:20:28.996577', '3780', '2'), - ('2.99', '99', '2007-04-08T21:42:42.996577', '4954', '2'), - ('4.99', '99', '2007-03-02T12:36:01.996577', '11266', '2'), - ('2.99', '99', '2007-04-10T10:48:25.996577', '5748', '1'), - ('4.99', '99', '2007-04-08T15:19:34.996577', '4800', '2'), - ('0.99', '99', '2007-05-14T13:44:29.996577', '11593', '1'), - ('0.99', '99', '2007-04-08T04:54:30.996577', '4589', '1'), - ('0.99', '99', '2007-04-29T08:21:59.996577', '8514', '2'), - ('4.99', '99', '2007-02-16T23:41:37.996577', '1858', '1'), - ('2.99', '99', '2007-04-07T08:13:02.996577', '4170', '2'), - ('4.99', '99', '2007-04-12T09:49:32.996577', '6662', '2'), - ('7.99', '99', '2007-04-28T23:02:53.996577', '8242', '2'), - ('3.99', '99', '2007-04-11T19:56:58.996577', '6370', '1'), - ('4.99', '99', '2007-04-27T01:40:14.996577', '7039', '1'), - ('7.99', '99', '2007-03-01T05:11:10.996577', '10388', '2'), - ('0.99', '99', '2007-03-18T06:55:14.996577', '12379', '2'), - ('2.99', '99', '2007-04-09T01:20:00.996577', '5035', '2'), - ('2.99', '99', '2007-02-18T12:38:53.996577', '2368', '1'), - ('1.99', '99', '2007-03-01T07:43:26.996577', '10455', '1'), - ('4.99', '99', '2007-04-07T17:19:13.996577', '4344', '2'), - ('0.99', '99', '2007-04-28T15:56:25.996577', '8072', '1'), - ('8.99', '99', '2007-03-19T01:19:02.996577', '12869', '2'), - ('0.99', '237', '2007-02-15T20:29:11.996577', '1500', '1'), - ('4.99', '237', '2007-04-30T04:35:03.996577', '9661', '1'), - ('4.99', '237', '2007-02-17T21:36:38.996577', '2156', '1'), - ('4.99', '237', '2007-04-08T16:56:39.996577', '4844', '1'), - ('4.99', '237', '2007-04-28T06:35:18.996577', '7812', '1'), - ('6.99', '237', '2007-04-29T19:45:13.996577', '8799', '2'), - ('3.99', '237', '2007-04-29T21:13:01.996577', '8835', '1'), - ('2.99', '237', '2007-04-27T07:05:26.996577', '7193', '1'), - ('8.99', '237', '2007-04-28T11:49:42.996577', '7951', '2'), - ('0.99', '237', '2007-02-15T22:05:03.996577', '1518', '2'), - ('2.99', '237', '2007-04-28T17:18:09.996577', '8102', '2'), - ('4.99', '237', '2007-03-02T07:24:01.996577', '11125', '2'), - ('4.99', '237', '2007-04-11T02:20:25.996577', '6053', '2'), - ('2.99', '237', '2007-02-20T12:41:26.996577', '3069', '2'), - ('6.99', '237', '2007-03-20T17:11:06.996577', '13969', '2'), - ('0.99', '237', '2007-04-30T17:47:39.996577', '10056', '2'), - ('5.99', '237', '2007-04-30T13:37:54.996577', '9276', '1'), - ('6.99', '237', '2007-03-20T15:31:03.996577', '13922', '2'), - ('2.99', '237', '2007-04-30T17:48:47.996577', '10058', '2'), - ('11.99', '237', '2007-03-02T20:46:39.996577', '11479', '2'), - ('2.99', '237', '2007-02-18T20:32:41.996577', '2492', '1'), - ('2.99', '237', '2007-04-29T17:37:03.996577', '8748', '2'), - ('0.99', '237', '2007-03-22T19:18:17.996577', '15337', '1'), - ('8.99', '237', '2007-03-22T12:06:37.996577', '15139', '2'), - ('3.99', '237', '2007-03-21T11:02:00.996577', '14453', '2'), - ('0.99', '237', '2007-03-18T10:21:33.996577', '12469', '1'), - ('3.99', '237', '2007-04-27T12:25:12.996577', '7330', '2'), - ('1.99', '237', '2007-03-23T16:56:35.996577', '15931', '2'), - ('5.99', '237', '2007-03-17T08:47:23.996577', '11772', '2'), - ('1.99', '237', '2007-04-30T06:45:24.996577', '9715', '2'), - ('6.99', '237', '2007-03-20T15:07:23.996577', '13914', '2'), - ('4.99', '88', '2007-03-23T15:41:27.996577', '15898', '1'), - ('3.99', '88', '2007-03-22T10:16:45.996577', '15098', '2'), - ('2.99', '88', '2007-04-29T01:11:51.996577', '8296', '1'), - ('8.99', '88', '2007-04-27T23:02:32.996577', '7621', '1'), - ('7.99', '88', '2007-02-18T19:50:49.996577', '2483', '1'), - ('5.99', '88', '2007-04-06T07:30:35.996577', '3673', '2'), - ('0.99', '88', '2007-04-05T23:30:17.996577', '3524', '2'), - ('0.99', '88', '2007-04-06T04:30:16.996577', '3620', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['23530', '23533', '29966', '23532', '29971', '29965', '18847', '18845', '23531', '29972', '29967', '29968', '22070', '18245', '18243', '28204', '28209', '28199', '28208', '28207', '28200', '28205', '22068', '28206', '28201', '22072', '22073', '28202', '22069', '22067', '28210', '28203', '22071', '18244', '22074', '24952', '31700', '31697', '24951', '31695', '24950', '31699', '31701', '31689', '19425', '31693', '19424', '19426', '24949', '31703', '24947', '31702', '31696', '31690', '31698', '24948', '31692', '31691', '31694', '32094', '31704', '30817', '30811', '24224', '30818', '24223', '24232', '24220', '30814', '24219', '30816', '19118', '24225', '30815', '19117', '24226', '19116', '24222', '24228', '24227', '30813', '24231', '24230', '24221', '30812', '24229', '30810', '24233', '26601', '26605', '26609', '20713', '26599', '20710', '26602', '26608', '20717', '17720', '20718', '26606']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('0.99', '88', '2007-03-01T06:51:20.996577', '10424', '1'), - ('5.99', '88', '2007-03-22T00:00:58.996577', '14827', '2'), - ('1.99', '88', '2007-04-12T09:07:48.996577', '6643', '1'), - ('2.99', '88', '2007-03-20T22:57:14.996577', '14097', '2'), - ('2.99', '88', '2007-04-29T08:49:14.996577', '8526', '2'), - ('5.99', '88', '2007-04-06T15:11:36.996577', '3846', '1'), - ('2.99', '88', '2007-02-19T23:37:40.996577', '2878', '1'), - ('2.99', '88', '2007-02-15T16:58:26.996577', '1433', '1'), - ('6.99', '88', '2007-03-02T05:04:53.996577', '11056', '1'), - ('2.99', '88', '2007-04-29T15:12:05.996577', '8692', '1'), - ('4.99', '88', '2007-04-12T20:57:44.996577', '6916', '1'), - ('5.99', '88', '2007-04-27T03:10:54.996577', '7088', '1'), - ('8.99', '536', '2007-03-17T19:25:28.996577', '12052', '2'), - ('2.99', '536', '2007-02-18T15:01:48.996577', '2403', '2'), - ('4.99', '536', '2007-02-16T03:00:23.996577', '1582', '1'), - ('4.99', '536', '2007-04-27T02:22:09.996577', '7065', '1'), - ('4.99', '536', '2007-04-30T07:07:39.996577', '9727', '1'), - ('4.99', '536', '2007-04-05T21:42:17.996577', '3483', '1'), - ('8.99', '536', '2007-04-30T19:06:48.996577', '9411', '1'), - ('2.99', '536', '2007-04-30T02:02:52.996577', '8958', '1'), - ('0.99', '536', '2007-04-05T23:15:20.996577', '3514', '1'), - ('4.99', '536', '2007-04-29T09:00:59.996577', '8535', '2'), - ('2.99', '536', '2007-03-17T11:12:12.996577', '11826', '1'), - ('4.99', '536', '2007-04-29T14:36:13.996577', '8679', '1'), - ('2.99', '536', '2007-04-07T21:45:38.996577', '4448', '1'), - ('7.99', '536', '2007-03-22T11:32:58.996577', '15130', '1'), - ('8.99', '536', '2007-03-23T18:36:44.996577', '15978', '1'), - ('0.99', '536', '2007-04-09T09:12:00.996577', '5196', '2'), - ('4.99', '536', '2007-03-17T16:29:41.996577', '11977', '2'), - ('6.99', '536', '2007-03-02T20:20:29.996577', '11473', '1'), - ('3.99', '536', '2007-04-30T16:49:22.996577', '10019', '2'), - ('5.99', '536', '2007-04-11T21:12:10.996577', '6400', '1'), - ('4.99', '536', '2007-03-20T00:34:23.996577', '13505', '2'), - ('2.99', '536', '2007-02-17T07:37:24.996577', '1962', '2'), - ('0.99', '536', '2007-03-23T18:36:52.996577', '15979', '1'), - ('6.99', '245', '2007-03-23T12:11:52.996577', '15782', '1'), - ('10.99', '245', '2007-04-29T20:14:47.996577', '8811', '1'), - ('0.99', '245', '2007-04-27T13:18:10.996577', '7358', '1'), - ('0.99', '245', '2007-03-19T16:56:33.996577', '13286', '1'), - ('4.99', '245', '2007-04-27T08:30:07.996577', '7230', '1'), - ('7.99', '245', '2007-03-18T04:11:48.996577', '12303', '1'), - ('6.99', '245', '2007-04-29T15:31:01.996577', '8701', '2'), - ('0.99', '245', '2007-04-30T06:49:28.996577', '9088', '2'), - ('2.99', '245', '2007-04-06T05:19:40.996577', '3634', '1'), - ('2.99', '245', '2007-02-17T19:16:53.996577', '2122', '1'), - ('5.99', '245', '2007-04-12T15:09:26.996577', '6795', '1'), - ('2.99', '245', '2007-02-15T13:30:29.996577', '1377', '1'), - ('2.99', '245', '2007-02-20T19:36:20.996577', '3157', '1'), - ('0.99', '245', '2007-03-02T10:45:14.996577', '11211', '1'), - ('6.99', '245', '2007-04-30T09:57:49.996577', '9813', '1'), - ('0.99', '245', '2007-03-02T05:18:44.996577', '11061', '2'), - ('4.99', '245', '2007-04-30T10:03:26.996577', '9169', '2'), - ('5.99', '245', '2007-04-27T08:37:02.996577', '7233', '2'), - ('2.99', '245', '2007-04-09T14:54:59.996577', '5321', '2'), - ('4.99', '245', '2007-04-27T14:33:26.996577', '7397', '2'), - ('0.99', '245', '2007-03-02T06:41:57.996577', '11105', '1'), - ('2.99', '245', '2007-04-11T13:13:30.996577', '6242', '2'), - ('4.99', '245', '2007-04-10T11:26:42.996577', '5764', '1'), - ('0.99', '245', '2007-04-26T22:39:24.996577', '6962', '2'), - ('2.99', '245', '2007-05-14T13:44:29.996577', '12682', '2'), - ('3.99', '245', '2007-04-30T18:43:48.996577', '10087', '1'), - ('2.99', '160', '2007-04-30T07:54:04.996577', '9758', '2'), - ('5.99', '160', '2007-04-08T19:34:10.996577', '4908', '1'), - ('2.99', '160', '2007-03-17T10:10:34.996577', '11803', '1'), - ('2.99', '160', '2007-04-30T18:45:35.996577', '10089', '2'), - ('2.99', '160', '2007-03-02T08:23:16.996577', '11154', '2'), - ('4.99', '160', '2007-03-23T18:10:30.996577', '15962', '1'), - ('0.99', '160', '2007-03-01T20:05:36.996577', '10788', '2'), - ('0.99', '160', '2007-04-27T18:44:29.996577', '7500', '2'), - ('2.99', '160', '2007-03-01T02:44:42.996577', '10305', '1'), - ('0.99', '160', '2007-04-30T05:10:35.996577', '9681', '1'), - ('2.99', '160', '2007-02-19T23:09:51.996577', '2873', '2'), - ('7.99', '160', '2007-03-17T13:32:31.996577', '11888', '1'), - ('4.99', '160', '2007-04-28T20:51:01.996577', '8184', '1'), - ('2.99', '160', '2007-02-18T18:35:28.996577', '2465', '1'), - ('2.99', '160', '2007-03-18T05:21:02.996577', '12334', '2'), - ('4.99', '160', '2007-02-18T07:31:45.996577', '2314', '2'), - ('5.99', '160', '2007-03-02T02:45:03.996577', '10979', '2'), - ('6.99', '160', '2007-03-19T09:14:42.996577', '13093', '2'), - ('7.99', '160', '2007-03-18T09:06:57.996577', '12435', '1'), - ('1.99', '160', '2007-04-11T23:14:25.996577', '6448', '2'), - ('2.99', '160', '2007-03-23T06:37:37.996577', '15642', '2'), - ('2.99', '160', '2007-03-22T10:50:15.996577', '15112', '1'), - ('4.99', '160', '2007-03-02T02:05:39.996577', '10958', '2'), - ('6.99', '160', '2007-04-11T19:43:14.996577', '6364', '2'), - ('4.99', '160', '2007-03-22T01:43:27.996577', '14868', '1'), - ('0.99', '160', '2007-04-08T16:49:56.996577', '4842', '1'), - ('3.99', '160', '2007-03-23T20:17:59.996577', '16027', '1'), - ('5.99', '393', '2007-04-08T07:07:23.996577', '4632', '2'), - ('0.99', '393', '2007-04-12T02:13:09.996577', '6513', '2'), - ('0.99', '393', '2007-04-29T06:10:20.996577', '8448', '2'), - ('4.99', '393', '2007-03-19T19:31:25.996577', '13357', '2'), - ('2.99', '393', '2007-04-07T13:12:17.996577', '4275', '2'), - ('4.99', '393', '2007-03-18T13:36:55.996577', '12563', '1'), - ('7.99', '393', '2007-04-08T14:55:50.996577', '4791', '2'), - ('4.99', '393', '2007-04-28T13:42:33.996577', '8004', '2'), - ('0.99', '393', '2007-03-23T02:13:17.996577', '15527', '2'), - ('2.99', '393', '2007-02-18T01:45:20.996577', '2219', '2'), - ('3.99', '393', '2007-03-23T21:18:38.996577', '16049', '2'), - ('8.99', '393', '2007-04-26T21:28:27.996577', '6930', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['20712', '26607', '26600', '26611', '26610', '20708', '20711', '26603', '17719', '17718', '20716', '17722', '20715', '20709', '26604', '20714', '17721', '29176', '22846', '22847', '29178', '18559', '22845', '29179', '29181', '18558', '29174', '29177', '29175', '29182', '18560', '22843', '22848', '22844', '29180', '26420', '20540', '26422', '20541', '26427', '20539', '20544', '26423', '26426', '17637', '17638', '26425', '20547', '26431', '26418', '26430', '20543', '26428', '26417', '26429', '26424', '26421', '26419', '20546', '20542', '20545', '20548', '25474', '25480', '19794', '25488', '19791', '31927', '25479', '19793', '19798', '25473', '19797', '25478', '25482', '19796', '25477', '25476', '25483', '25489', '19792', '25475', '25487', '19795', '25485', '25486', '25491', '25490', '25481', '25484', '28517', '22348', '28522', '28523', '22346', '28516', '28519', '18346', '28520', '28521']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('4.99', '393', '2007-03-19T12:44:44.996577', '13184', '1'), - ('0.99', '393', '2007-04-27T17:57:50.996577', '7486', '2'), - ('8.99', '393', '2007-04-08T02:47:02.996577', '4546', '2'), - ('1.99', '393', '2007-04-30T21:08:57.996577', '10158', '1'), - ('7.99', '393', '2007-04-30T08:02:29.996577', '9763', '2'), - ('2.99', '393', '2007-03-17T19:37:49.996577', '12059', '2'), - ('0.99', '393', '2007-03-18T18:03:06.996577', '12676', '1'), - ('4.99', '393', '2007-04-09T04:42:56.996577', '5099', '1'), - ('1.99', '393', '2007-02-17T03:56:54.996577', '1915', '2'), - ('6.99', '393', '2007-02-16T05:10:01.996577', '1611', '1'), - ('3.99', '393', '2007-03-22T17:45:34.996577', '15284', '2'), - ('2.99', '393', '2007-02-20T08:18:42.996577', '3001', '2'), - ('2.99', '393', '2007-03-22T11:39:51.996577', '15132', '1'), - ('1.99', '393', '2007-03-17T21:29:26.996577', '12113', '1'), - ('2.99', '393', '2007-04-11T11:52:53.996577', '6221', '1'), - ('1.99', '393', '2007-03-20T10:44:07.996577', '13788', '2'), - ('4.99', '393', '2007-02-18T07:52:48.996577', '2319', '1'), - ('1.99', '17', '2007-04-12T19:21:07.996577', '6884', '2'), - ('2.99', '17', '2007-03-21T06:44:07.996577', '14326', '2'), - ('2.99', '17', '2007-03-21T07:10:52.996577', '14346', '1'), - ('2.99', '17', '2007-04-28T22:05:59.996577', '8213', '1'), - ('8.99', '17', '2007-02-19T10:57:34.996577', '2684', '1'), - ('2.99', '17', '2007-03-20T20:12:10.996577', '14040', '1'), - ('8.99', '17', '2007-04-30T06:59:22.996577', '9092', '2'), - ('8.99', '17', '2007-04-30T17:52:10.996577', '9382', '2'), - ('5.99', '17', '2007-02-17T22:46:24.996577', '2175', '2'), - ('3.99', '17', '2007-04-10T09:15:23.996577', '5714', '1'), - ('8.99', '17', '2007-04-28T16:14:24.996577', '8076', '2'), - ('3.99', '17', '2007-04-10T17:53:47.996577', '5883', '1'), - ('0.99', '17', '2007-04-30T22:11:58.996577', '9489', '1'), - ('5.99', '17', '2007-02-21T03:34:56.996577', '3269', '2'), - ('4.99', '17', '2007-03-17T16:54:48.996577', '11990', '2'), - ('5.99', '17', '2007-03-23T11:10:04.996577', '15752', '2'), - ('2.99', '17', '2007-03-20T08:53:07.996577', '13732', '1'), - ('2.99', '17', '2007-04-30T08:40:18.996577', '9138', '1'), - ('3.99', '376', '2007-04-07T16:20:25.996577', '4320', '1'), - ('3.99', '376', '2007-03-01T21:09:05.996577', '10810', '1'), - ('4.99', '376', '2007-04-08T17:42:31.996577', '4869', '1'), - ('4.99', '376', '2007-03-02T08:07:43.996577', '11144', '1'), - ('2.99', '376', '2007-04-28T23:55:20.996577', '8269', '1'), - ('3.99', '376', '2007-03-01T06:28:05.996577', '10413', '2'), - ('0.99', '376', '2007-03-19T06:19:01.996577', '13009', '1'), - ('4.99', '376', '2007-04-10T06:59:32.996577', '5675', '1'), - ('2.99', '376', '2007-04-12T16:02:19.996577', '6807', '2'), - ('0.99', '376', '2007-02-15T00:58:29.996577', '1208', '2'), - ('0.99', '376', '2007-02-19T16:47:33.996577', '2779', '1'), - ('8.99', '376', '2007-04-12T03:24:56.996577', '6545', '1'), - ('4.99', '376', '2007-03-22T10:33:28.996577', '15107', '1'), - ('0.99', '376', '2007-04-30T11:56:21.996577', '9872', '1'), - ('0.99', '376', '2007-04-07T07:47:54.996577', '4163', '1'), - ('2.99', '376', '2007-04-30T10:25:23.996577', '9828', '1'), - ('4.99', '376', '2007-03-17T11:58:53.996577', '11851', '1'), - ('5.99', '376', '2007-04-29T05:29:11.996577', '8420', '1'), - ('2.99', '376', '2007-04-06T09:34:21.996577', '3719', '2'), - ('4.99', '376', '2007-04-30T08:25:22.996577', '9773', '1'), - ('6.99', '376', '2007-04-12T02:43:01.996577', '6524', '1'), - ('5.99', '376', '2007-04-08T03:16:29.996577', '4554', '1'), - ('8.99', '376', '2007-04-07T08:01:56.996577', '4166', '2'), - ('4.99', '376', '2007-03-20T09:57:16.996577', '13761', '2'), - ('4.99', '376', '2007-03-17T09:32:19.996577', '11792', '2'), - ('0.99', '376', '2007-03-19T11:10:07.996577', '13141', '1'), - ('2.99', '376', '2007-03-22T20:59:16.996577', '15382', '1'), - ('9.99', '295', '2007-04-06T16:49:39.996577', '3876', '1'), - ('4.99', '295', '2007-04-10T23:42:36.996577', '5994', '2'), - ('4.99', '295', '2007-03-17T19:02:59.996577', '12041', '2'), - ('8.99', '295', '2007-04-30T05:39:30.996577', '9692', '2'), - ('3.99', '295', '2007-03-01T03:55:39.996577', '10349', '1'), - ('0.99', '295', '2007-05-14T13:44:29.996577', '15735', '2'), - ('2.99', '295', '2007-04-09T13:35:43.996577', '5283', '2'), - ('5.99', '295', '2007-03-17T14:21:43.996577', '11913', '2'), - ('6.99', '295', '2007-03-21T13:20:18.996577', '14514', '1'), - ('1.99', '295', '2007-04-05T22:27:41.996577', '3496', '2'), - ('6.99', '295', '2007-03-21T08:38:27.996577', '14387', '1'), - ('4.99', '295', '2007-04-09T02:28:12.996577', '5053', '2'), - ('3.99', '295', '2007-04-11T17:45:47.996577', '6331', '2'), - ('0.99', '295', '2007-03-21T04:46:48.996577', '14264', '1'), - ('2.99', '295', '2007-04-09T00:32:58.996577', '5019', '1'), - ('1.99', '295', '2007-04-07T21:08:28.996577', '4432', '1'), - ('0.99', '295', '2007-04-28T16:49:42.996577', '8087', '2'), - ('4.99', '295', '2007-04-30T09:13:37.996577', '9793', '2'), - ('4.99', '295', '2007-03-02T06:00:27.996577', '11083', '2'), - ('1.99', '295', '2007-04-07T07:48:37.996577', '4164', '1'), - ('7.99', '295', '2007-04-30T19:39:47.996577', '9425', '1'), - ('0.99', '295', '2007-03-18T07:04:29.996577', '12383', '1'), - ('9.99', '295', '2007-04-29T21:24:04.996577', '8840', '1'), - ('2.99', '295', '2007-04-30T00:59:52.996577', '8932', '2'), - ('0.99', '295', '2007-04-30T23:46:08.996577', '10222', '2'), - ('4.99', '295', '2007-04-30T21:36:06.996577', '10160', '2'), - ('2.99', '295', '2007-04-11T13:34:55.996577', '6252', '1'), - ('7.99', '295', '2007-04-28T17:36:04.996577', '8108', '1'), - ('4.99', '567', '2007-04-08T21:25:36.996577', '4949', '1'), - ('2.99', '567', '2007-03-17T21:45:10.996577', '12119', '1'), - ('2.99', '567', '2007-04-29T12:35:01.996577', '8629', '1'), - ('7.99', '567', '2007-04-30T13:43:47.996577', '9279', '1'), - ('7.99', '567', '2007-03-01T17:11:54.996577', '10708', '2'), - ('0.99', '567', '2007-04-08T04:19:45.996577', '4576', '2'), - ('0.99', '567', '2007-04-12T03:32:09.996577', '6551', '2'), - ('2.99', '567', '2007-02-20T08:58:25.996577', '3010', '1'), - ('2.99', '567', '2007-04-27T12:46:36.996577', '7340', '2'), - ('2.99', '567', '2007-04-28T21:39:14.996577', '8201', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['18345', '22349', '28514', '28518', '22350', '28524', '22352', '22351', '22347', '28515', '23136', '29516', '18687', '23127', '29512', '23133', '23131', '29513', '23130', '23129', '29511', '18689', '23125', '29515', '29514', '23123', '23135', '23121', '29518', '29517', '23126', '23124', '23132', '18688', '18686', '23122', '18690', '23128', '18692', '18691', '23134', '25559', '25556', '25561', '25560', '19857', '19853', '19856', '25555', '25554', '25558', '25553', '25557', '19855', '19854', '25562', '19243', '19244', '31157', '31153', '31159', '24518', '19240', '19239', '19241', '32073', '31154', '19242', '31156', '31160', '31152', '31155', '31158', '24519', '26123', '26124', '26130', '26128', '17545', '26126', '20307', '26129', '26132', '20304', '20306', '26127', '20303', '26131', '26121', '20302', '20305', '26122', '26120', '20301', '17547', '17546', '26125', '29497', '29492', '29496']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('4.99', '567', '2007-02-19T11:27:19.996577', '2689', '2'), - ('2.99', '567', '2007-03-19T06:58:30.996577', '13031', '2'), - ('5.99', '567', '2007-04-06T11:39:59.996577', '3769', '1'), - ('2.99', '567', '2007-04-11T19:31:38.996577', '6358', '2'), - ('2.99', '567', '2007-03-22T00:26:41.996577', '14839', '2'), - ('6.99', '567', '2007-04-30T21:34:59.996577', '9475', '1'), - ('10.99', '567', '2007-03-23T04:47:09.996577', '15594', '2'), - ('5.99', '567', '2007-03-22T09:31:18.996577', '15074', '2'), - ('2.99', '567', '2007-03-17T07:32:29.996577', '11749', '2'), - ('0.99', '567', '2007-04-07T22:14:04.996577', '4457', '2'), - ('5.99', '46', '2007-03-23T11:15:52.996577', '15758', '1'), - ('8.99', '46', '2007-04-30T05:05:23.996577', '9045', '2'), - ('4.99', '46', '2007-02-15T01:47:06.996577', '1214', '2'), - ('4.99', '46', '2007-03-18T03:17:53.996577', '12280', '2'), - ('4.99', '46', '2007-04-06T18:47:16.996577', '3916', '1'), - ('4.99', '46', '2007-03-22T04:22:29.996577', '14940', '1'), - ('4.99', '46', '2007-03-21T00:39:23.996577', '14144', '2'), - ('4.99', '46', '2007-04-10T08:15:26.996577', '5698', '2'), - ('0.99', '46', '2007-03-19T14:34:02.996577', '13226', '1'), - ('4.99', '46', '2007-03-18T09:48:13.996577', '12455', '2'), - ('2.99', '46', '2007-04-06T15:32:14.996577', '3855', '2'), - ('2.99', '46', '2007-02-18T00:39:08.996577', '2203', '1'), - ('4.99', '46', '2007-03-17T21:01:03.996577', '12095', '2'), - ('3.99', '46', '2007-04-28T19:21:31.996577', '8152', '2'), - ('0.99', '46', '2007-04-27T12:40:11.996577', '7336', '1'), - ('5.99', '46', '2007-03-01T21:41:26.996577', '10827', '1'), - ('0.99', '46', '2007-03-23T09:04:17.996577', '15708', '1'), - ('4.99', '46', '2007-03-01T06:58:37.996577', '10428', '2'), - ('2.99', '46', '2007-04-30T18:44:47.996577', '10088', '1'), - ('2.99', '46', '2007-04-30T09:42:15.996577', '9806', '2'), - ('2.99', '46', '2007-03-18T01:53:34.996577', '12238', '2'), - ('0.99', '46', '2007-03-17T06:17:43.996577', '11721', '1'), - ('6.99', '46', '2007-03-21T13:36:31.996577', '14528', '2'), - ('0.99', '46', '2007-02-17T20:34:06.996577', '2144', '2'), - ('4.99', '46', '2007-02-14T21:45:29.996577', '1166', '1'), - ('4.99', '46', '2007-03-01T20:50:33.996577', '10803', '1'), - ('8.99', '46', '2007-02-20T06:02:04.996577', '2965', '2'), - ('2.99', '46', '2007-03-18T03:58:57.996577', '12298', '1'), - ('4.99', '46', '2007-02-21T18:04:41.996577', '3439', '2'), - ('4.99', '46', '2007-02-20T06:34:44.996577', '2975', '2'), - ('2.99', '46', '2007-03-22T23:00:23.996577', '15438', '1'), - ('6.99', '301', '2007-04-12T17:22:00.996577', '6833', '2'), - ('4.99', '301', '2007-04-09T23:28:26.996577', '5511', '2'), - ('4.99', '301', '2007-04-28T06:53:26.996577', '7818', '2'), - ('4.99', '301', '2007-04-27T11:53:57.996577', '7318', '2'), - ('1.99', '301', '2007-03-22T17:07:37.996577', '15268', '1'), - ('0.99', '301', '2007-03-01T23:15:45.996577', '10883', '1'), - ('10.99', '301', '2007-03-22T14:53:08.996577', '15201', '1'), - ('6.99', '301', '2007-04-09T05:42:44.996577', '5119', '1'), - ('3.99', '301', '2007-04-08T16:36:11.996577', '4834', '2'), - ('2.99', '301', '2007-04-10T13:44:56.996577', '5807', '2'), - ('4.99', '301', '2007-04-07T16:12:48.996577', '4316', '2'), - ('2.99', '301', '2007-04-10T09:56:58.996577', '5730', '2'), - ('2.99', '301', '2007-03-20T05:42:13.996577', '13633', '2'), - ('5.99', '301', '2007-03-19T12:37:52.996577', '13183', '2'), - ('4.99', '301', '2007-04-30T19:59:28.996577', '9435', '2'), - ('4.99', '191', '2007-02-17T13:38:42.996577', '2051', '1'), - ('2.99', '191', '2007-02-19T01:35:28.996577', '2555', '2'), - ('2.99', '191', '2007-04-27T19:30:28.996577', '7520', '1'), - ('5.99', '191', '2007-04-09T18:12:17.996577', '5397', '2'), - ('4.99', '191', '2007-04-30T14:54:55.996577', '9297', '1'), - ('2.99', '191', '2007-03-01T10:35:01.996577', '10532', '2'), - ('0.99', '191', '2007-02-15T06:37:38.996577', '1278', '1'), - ('2.99', '191', '2007-02-14T22:23:12.996577', '1173', '2'), - ('2.99', '191', '2007-02-16T09:35:37.996577', '1677', '1'), - ('0.99', '191', '2007-05-14T13:44:29.996577', '14361', '1'), - ('5.99', '191', '2007-04-10T20:09:49.996577', '5924', '1'), - ('2.99', '191', '2007-02-17T00:53:02.996577', '1870', '2'), - ('3.99', '191', '2007-04-27T16:47:01.996577', '7450', '1'), - ('4.99', '191', '2007-04-30T14:46:05.996577', '9964', '1'), - ('2.99', '191', '2007-04-09T15:35:33.996577', '5338', '1'), - ('6.99', '191', '2007-04-27T05:39:40.996577', '7150', '1'), - ('0.99', '191', '2007-04-29T10:33:16.996577', '8583', '2'), - ('4.99', '191', '2007-03-22T20:40:28.996577', '15375', '2'), - ('5.99', '351', '2007-04-08T13:20:11.996577', '4761', '2'), - ('0.99', '351', '2007-04-09T13:23:33.996577', '5280', '1'), - ('4.99', '351', '2007-04-29T08:16:29.996577', '8512', '2'), - ('5.99', '351', '2007-04-12T14:33:06.996577', '6777', '2'), - ('5.99', '351', '2007-02-16T18:33:16.996577', '1792', '2'), - ('3.99', '351', '2007-04-11T09:35:16.996577', '6180', '2'), - ('2.99', '351', '2007-03-23T11:30:09.996577', '15762', '1'), - ('4.99', '351', '2007-04-27T23:29:29.996577', '7630', '2'), - ('0.99', '351', '2007-04-30T19:49:25.996577', '10119', '2'), - ('4.99', '351', '2007-03-22T12:12:58.996577', '15142', '2'), - ('2.99', '351', '2007-03-23T09:12:22.996577', '15712', '2'), - ('4.99', '351', '2007-04-12T09:56:48.996577', '6664', '1'), - ('6.99', '351', '2007-03-21T08:00:13.996577', '14368', '1'), - ('7.99', '351', '2007-04-30T06:12:44.996577', '9707', '1'), - ('0.99', '351', '2007-04-08T02:39:30.996577', '4544', '1'), - ('0.99', '351', '2007-03-02T07:29:25.996577', '11127', '2'), - ('4.99', '351', '2007-03-23T07:25:37.996577', '15664', '1'), - ('1.99', '351', '2007-04-08T12:52:26.996577', '4756', '1'), - ('2.99', '351', '2007-04-06T14:54:30.996577', '3836', '1'), - ('2.99', '351', '2007-03-01T09:33:12.996577', '10501', '2'), - ('2.99', '351', '2007-02-19T15:38:50.996577', '2759', '1'), - ('0.99', '351', '2007-02-17T00:36:26.996577', '1869', '1'), - ('3.99', '351', '2007-04-10T19:26:48.996577', '5912', '1'), - ('4.99', '44', '2007-04-10T19:14:39.996577', '5909', '2'), - ('0.99', '44', '2007-04-07T19:27:32.996577', '4390', '2'), - ('6.99', '44', '2007-04-10T16:00:59.996577', '5849', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['18677', '23108', '29495', '18680', '23107', '18679', '23105', '29501', '23106', '29499', '29494', '29498', '23103', '32027', '23104', '29493', '18678', '29500', '20752', '20745', '26648', '20746', '26649', '20754', '20750', '26645', '26650', '20751', '26651', '20743', '26642', '26652', '20744', '20755', '20749', '20747', '20753', '20748', '26643', '26654', '17733', '26646', '26653', '26647', '17734', '26644', '26054', '20256', '17526', '20248', '20252', '26055', '26066', '26062', '26056', '26061', '26063', '17527', '26058', '17528', '26059', '20247', '20255', '26065', '20251', '20246', '26060', '26053', '20254', '26064', '20257', '20249', '26057', '20250', '20253', '26052', '31041', '24404', '24405', '24409', '31029', '24402', '31030', '31033', '24407', '31035', '19191', '31040', '31037', '31038', '31031', '24410', '31036', '24403', '19192', '24408', '31034', '24401', '31039', '24406']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('3.99', '44', '2007-02-15T20:25:05.996577', '1497', '1'), - ('2.99', '44', '2007-03-22T08:42:59.996577', '15054', '2'), - ('8.99', '44', '2007-04-10T12:37:15.996577', '5787', '1'), - ('4.99', '44', '2007-02-19T22:30:02.996577', '2866', '2'), - ('4.99', '44', '2007-03-19T05:35:00.996577', '12982', '2'), - ('3.99', '44', '2007-02-19T18:08:53.996577', '2809', '1'), - ('4.99', '44', '2007-03-18T11:45:33.996577', '12504', '1'), - ('4.99', '44', '2007-04-29T22:26:45.996577', '8866', '1'), - ('6.99', '44', '2007-03-18T22:45:20.996577', '12790', '1'), - ('6.99', '44', '2007-04-27T19:42:13.996577', '7526', '2'), - ('3.99', '44', '2007-04-10T01:29:35.996577', '5551', '1'), - ('0.99', '44', '2007-04-27T19:20:15.996577', '7514', '1'), - ('2.99', '44', '2007-03-02T16:22:02.996577', '11364', '1'), - ('4.99', '44', '2007-05-14T13:44:29.996577', '13428', '2'), - ('3.99', '44', '2007-03-18T05:45:24.996577', '12345', '2'), - ('9.99', '44', '2007-04-08T11:13:25.996577', '4723', '2'), - ('2.99', '44', '2007-02-18T12:53:55.996577', '2369', '1'), - ('4.99', '44', '2007-04-29T18:34:04.996577', '8775', '2'), - ('4.99', '397', '2007-03-18T21:57:51.996577', '12772', '1'), - ('1.99', '397', '2007-03-01T19:53:21.996577', '10785', '1'), - ('2.99', '397', '2007-04-11T14:14:05.996577', '6266', '2'), - ('4.99', '397', '2007-03-16T22:08:25.996577', '11511', '2'), - ('4.99', '397', '2007-04-11T23:59:32.996577', '6471', '1'), - ('6.99', '397', '2007-03-21T23:02:43.996577', '14790', '1'), - ('0.99', '397', '2007-03-18T18:53:12.996577', '12700', '2'), - ('4.99', '397', '2007-04-10T03:16:55.996577', '5598', '2'), - ('2.99', '397', '2007-04-27T13:16:01.996577', '7356', '2'), - ('2.99', '397', '2007-03-18T20:13:12.996577', '12726', '2'), - ('4.99', '397', '2007-04-28T09:15:24.996577', '7892', '2'), - ('0.99', '397', '2007-03-01T10:43:37.996577', '10534', '1'), - ('5.99', '397', '2007-04-05T22:02:06.996577', '3489', '1'), - ('6.99', '397', '2007-04-28T17:18:40.996577', '8103', '1'), - ('4.99', '397', '2007-03-01T12:52:02.996577', '10598', '2'), - ('6.99', '397', '2007-03-22T09:46:03.996577', '15083', '1'), - ('1.99', '397', '2007-03-18T05:12:56.996577', '12329', '2'), - ('2.99', '397', '2007-03-18T01:27:06.996577', '12223', '2'), - ('3.99', '397', '2007-03-20T22:59:33.996577', '14100', '2'), - ('0.99', '397', '2007-03-18T03:11:48.996577', '12276', '1'), - ('0.99', '397', '2007-04-07T01:16:26.996577', '4036', '1'), - ('1.99', '397', '2007-04-30T02:20:18.996577', '9608', '2'), - ('5.99', '397', '2007-02-16T16:36:14.996577', '1769', '1'), - ('4.99', '397', '2007-04-10T11:26:38.996577', '5763', '2'), - ('0.99', '397', '2007-04-30T22:22:52.996577', '9495', '1'), - ('2.99', '397', '2007-04-11T00:31:21.996577', '6014', '2'), - ('1.99', '397', '2007-02-20T10:18:56.996577', '3027', '2'), - ('4.99', '397', '2007-04-09T05:03:06.996577', '5103', '2'), - ('4.99', '346', '2007-04-09T19:41:16.996577', '5428', '1'), - ('5.99', '346', '2007-03-23T13:39:08.996577', '15825', '2'), - ('5.99', '346', '2007-02-17T09:35:32.996577', '1994', '1'), - ('0.99', '346', '2007-03-01T10:14:43.996577', '10521', '2'), - ('5.99', '346', '2007-03-22T02:39:15.996577', '14890', '1'), - ('4.99', '346', '2007-04-10T01:38:47.996577', '5557', '2'), - ('2.99', '346', '2007-04-30T13:40:39.996577', '9927', '1'), - ('0.99', '346', '2007-04-29T09:30:23.996577', '8543', '2'), - ('4.99', '346', '2007-04-11T07:02:35.996577', '6136', '2'), - ('6.99', '346', '2007-04-29T07:51:18.996577', '8505', '1'), - ('8.99', '346', '2007-04-29T16:53:29.996577', '8732', '2'), - ('2.99', '346', '2007-02-21T12:02:45.996577', '3372', '2'), - ('8.99', '346', '2007-04-12T19:15:01.996577', '6881', '2'), - ('2.99', '346', '2007-02-21T15:51:24.996577', '3421', '1'), - ('6.99', '346', '2007-04-28T11:19:21.996577', '7943', '2'), - ('3.99', '346', '2007-03-01T05:15:09.996577', '10389', '2'), - ('8.99', '346', '2007-03-23T07:20:29.996577', '15661', '1'), - ('4.99', '346', '2007-04-30T11:12:59.996577', '9848', '1'), - ('2.99', '346', '2007-03-02T20:16:54.996577', '11470', '2'), - ('5.99', '346', '2007-03-01T02:42:38.996577', '10304', '1'), - ('5.99', '346', '2007-04-28T23:58:17.996577', '8272', '2'), - ('8.99', '346', '2007-04-08T21:48:18.996577', '4958', '1'), - ('0.99', '346', '2007-03-23T02:26:28.996577', '15535', '1'), - ('4.99', '346', '2007-04-30T01:00:36.996577', '9566', '2'), - ('0.99', '346', '2007-03-23T13:43:45.996577', '15827', '1'), - ('4.99', '346', '2007-03-02T05:21:20.996577', '11062', '2'), - ('2.99', '346', '2007-04-11T17:30:45.996577', '6323', '2'), - ('4.99', '346', '2007-03-02T16:43:22.996577', '11375', '1'), - ('2.99', '346', '2007-03-22T23:38:14.996577', '15459', '2'), - ('4.99', '346', '2007-04-07T20:35:57.996577', '4420', '2'), - ('4.99', '179', '2007-04-30T21:04:26.996577', '10156', '1'), - ('0.99', '179', '2007-03-19T14:50:40.996577', '13240', '2'), - ('4.99', '179', '2007-03-19T20:40:10.996577', '13400', '1'), - ('0.99', '179', '2007-03-21T15:57:21.996577', '14589', '1'), - ('0.99', '179', '2007-04-06T15:06:24.996577', '3844', '1'), - ('3.99', '179', '2007-03-01T11:46:49.996577', '10569', '2'), - ('2.99', '179', '2007-04-08T06:28:46.996577', '4618', '1'), - ('2.99', '179', '2007-04-12T16:00:09.996577', '6806', '1'), - ('0.99', '179', '2007-03-20T16:37:30.996577', '13957', '2'), - ('4.99', '179', '2007-04-27T02:11:54.996577', '7054', '1'), - ('7.99', '179', '2007-02-15T07:09:39.996577', '1286', '2'), - ('0.99', '179', '2007-04-30T12:35:47.996577', '9893', '2'), - ('2.99', '179', '2007-04-29T10:19:51.996577', '8573', '1'), - ('8.99', '179', '2007-04-29T16:52:23.996577', '8731', '1'), - ('6.99', '179', '2007-04-11T03:18:29.996577', '6071', '2'), - ('4.99', '179', '2007-03-23T18:48:49.996577', '15985', '1'), - ('4.99', '179', '2007-04-27T22:39:26.996577', '7609', '1'), - ('0.99', '179', '2007-03-02T15:40:01.996577', '11342', '1'), - ('4.99', '179', '2007-02-19T05:54:16.996577', '2613', '1'), - ('7.99', '179', '2007-03-20T22:10:26.996577', '14082', '2'), - ('6.99', '179', '2007-04-27T01:22:51.996577', '7028', '1'), - ('4.99', '179', '2007-03-01T05:08:21.996577', '10385', '1'), - ('4.99', '179', '2007-04-30T22:13:49.996577', '9491', '2'), - ('7.99', '179', '2007-03-20T12:58:52.996577', '13844', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['31028', '31032', '21060', '17846', '21063', '21058', '17842', '27017', '27020', '27015', '27019', '21061', '21059', '17844', '27014', '27016', '27018', '21057', '17843', '17845', '17841', '21062', '31410', '31411', '31412', '31416', '24752', '19339', '31409', '31408', '31407', '24751', '31406', '24750', '19338', '31414', '31415', '31413', '23669', '23672', '30194', '23668', '23670', '23674', '23673', '30199', '30192', '30189', '23675', '30193', '30190', '18909', '30191', '30195', '18910', '30197', '23671', '30198', '30196', '26994', '21052', '26997', '17836', '17833', '26995', '27004', '21051', '27001', '26996', '26998', '26999', '27003', '27002', '27000', '17832', '17834', '17835', '21053', '29536', '23144', '29531', '29532', '29530', '23143', '29535', '18696', '29533', '29529', '23145', '29534', '18697', '23146', '29608', '23214', '23216', '18722', '18724', '23215', '29606', '18725']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('6.99', '179', '2007-04-06T07:29:55.996577', '3671', '1'), - ('7.99', '179', '2007-04-12T07:05:56.996577', '6616', '1'), - ('0.99', '430', '2007-03-19T22:48:33.996577', '13452', '2'), - ('0.99', '430', '2007-02-20T19:12:41.996577', '3153', '2'), - ('4.99', '430', '2007-03-22T07:40:14.996577', '15031', '1'), - ('4.99', '430', '2007-03-19T05:01:26.996577', '12965', '1'), - ('2.99', '430', '2007-02-15T06:21:18.996577', '1274', '1'), - ('6.99', '430', '2007-04-10T22:00:17.996577', '5958', '1'), - ('2.99', '430', '2007-04-30T20:32:30.996577', '9450', '2'), - ('5.99', '430', '2007-04-09T10:25:16.996577', '5217', '1'), - ('4.99', '430', '2007-04-29T09:55:53.996577', '8560', '1'), - ('2.99', '430', '2007-03-19T22:59:18.996577', '13454', '2'), - ('0.99', '430', '2007-03-19T06:16:09.996577', '13007', '1'), - ('6.99', '430', '2007-02-16T16:15:03.996577', '1759', '1'), - ('4.99', '430', '2007-04-08T23:45:34.996577', '5002', '1'), - ('6.99', '430', '2007-04-10T17:41:13.996577', '5879', '2'), - ('0.99', '430', '2007-04-11T01:46:36.996577', '6043', '2'), - ('0.99', '430', '2007-03-18T20:02:42.996577', '12723', '1'), - ('2.99', '430', '2007-02-15T23:34:16.996577', '1538', '1'), - ('0.99', '430', '2007-02-20T00:35:05.996577', '2892', '2'), - ('0.99', '430', '2007-02-15T00:55:34.996577', '1207', '2'), - ('5.99', '430', '2007-03-20T20:53:01.996577', '14058', '1'), - ('2.99', '222', '2007-04-11T06:43:35.996577', '6129', '2'), - ('0.99', '222', '2007-04-12T01:32:55.996577', '6497', '1'), - ('0.99', '222', '2007-04-28T05:46:52.996577', '7786', '2'), - ('1.99', '222', '2007-04-30T17:30:33.996577', '10043', '2'), - ('2.99', '222', '2007-03-21T07:27:04.996577', '14350', '2'), - ('6.99', '222', '2007-02-19T04:49:51.996577', '2603', '2'), - ('5.99', '222', '2007-04-10T04:57:05.996577', '5635', '2'), - ('6.99', '222', '2007-04-10T02:54:39.996577', '5592', '2'), - ('3.99', '222', '2007-04-09T12:46:06.996577', '5266', '1'), - ('2.99', '222', '2007-03-19T23:35:26.996577', '13477', '1'), - ('8.99', '222', '2007-04-09T09:51:05.996577', '5209', '2'), - ('2.99', '222', '2007-03-17T23:49:47.996577', '12179', '2'), - ('8.99', '222', '2007-02-15T12:56:13.996577', '1368', '1'), - ('6.99', '222', '2007-04-29T11:24:21.996577', '8597', '2'), - ('4.99', '222', '2007-04-29T19:12:15.996577', '8787', '1'), - ('1.99', '222', '2007-04-29T01:26:25.996577', '8300', '1'), - ('8.99', '106', '2007-03-01T07:30:06.996577', '10444', '1'), - ('2.99', '106', '2007-03-19T00:31:03.996577', '12845', '1'), - ('3.99', '106', '2007-04-27T08:12:52.996577', '7224', '1'), - ('2.99', '106', '2007-03-01T00:11:44.996577', '10228', '1'), - ('0.99', '106', '2007-03-02T18:44:32.996577', '11436', '2'), - ('0.99', '106', '2007-03-22T03:37:24.996577', '14920', '1'), - ('2.99', '106', '2007-03-21T09:59:41.996577', '14431', '2'), - ('8.99', '106', '2007-04-30T23:31:44.996577', '10213', '2'), - ('3.99', '106', '2007-04-09T20:52:37.996577', '5453', '2'), - ('4.99', '106', '2007-04-07T11:11:49.996577', '4229', '1'), - ('6.99', '106', '2007-03-22T12:56:03.996577', '15154', '1'), - ('0.99', '106', '2007-04-26T23:33:11.996577', '6992', '2'), - ('2.99', '106', '2007-04-07T13:20:38.996577', '4277', '2'), - ('4.99', '106', '2007-02-18T06:24:44.996577', '2295', '1'), - ('3.99', '106', '2007-04-08T08:32:50.996577', '4665', '1'), - ('4.99', '106', '2007-04-27T17:53:26.996577', '7483', '1'), - ('4.99', '106', '2007-02-20T09:46:37.996577', '3023', '1'), - ('2.99', '106', '2007-04-30T06:14:15.996577', '9072', '2'), - ('7.99', '106', '2007-03-17T23:04:35.996577', '12159', '1'), - ('7.99', '106', '2007-04-30T07:45:23.996577', '9747', '2'), - ('4.99', '106', '2007-04-28T17:42:43.996577', '8115', '1'), - ('2.99', '428', '2007-04-06T08:42:22.996577', '3702', '1'), - ('2.99', '428', '2007-03-01T23:21:11.996577', '10888', '2'), - ('4.99', '428', '2007-04-09T17:17:23.996577', '5373', '1'), - ('0.99', '428', '2007-02-21T12:19:38.996577', '3377', '2'), - ('2.99', '428', '2007-02-15T19:21:52.996577', '1471', '2'), - ('5.99', '428', '2007-04-06T19:10:10.996577', '3925', '1'), - ('2.99', '428', '2007-04-30T15:37:28.996577', '9982', '2'), - ('4.99', '428', '2007-03-01T12:15:04.996577', '10577', '2'), - ('4.99', '428', '2007-04-29T04:15:53.996577', '8387', '2'), - ('0.99', '428', '2007-04-07T07:17:28.996577', '4151', '1'), - ('5.99', '428', '2007-04-12T12:36:46.996577', '6735', '1'), - ('6.99', '428', '2007-04-28T07:01:19.996577', '7823', '1'), - ('5.99', '428', '2007-04-30T13:02:43.996577', '9904', '1'), - ('4.99', '428', '2007-04-29T08:52:48.996577', '8528', '2'), - ('2.99', '428', '2007-04-28T19:25:32.996577', '8155', '1'), - ('3.99', '428', '2007-02-15T02:18:29.996577', '1227', '1'), - ('3.99', '428', '2007-02-16T04:39:39.996577', '1601', '1'), - ('2.99', '428', '2007-02-19T10:30:25.996577', '2677', '1'), - ('0.99', '428', '2007-03-16T23:08:29.996577', '11536', '2'), - ('7.99', '48', '2007-04-30T07:38:46.996577', '9742', '2'), - ('1.99', '48', '2007-03-21T10:49:51.996577', '14450', '2'), - ('6.99', '48', '2007-04-09T06:51:12.996577', '5148', '2'), - ('3.99', '48', '2007-04-12T01:34:04.996577', '6498', '2'), - ('2.99', '48', '2007-04-07T18:20:27.996577', '4367', '1'), - ('2.99', '48', '2007-03-01T01:50:49.996577', '10276', '2'), - ('7.99', '48', '2007-04-30T18:46:53.996577', '9402', '1'), - ('9.99', '48', '2007-02-16T10:47:07.996577', '1689', '2'), - ('2.99', '48', '2007-04-28T10:29:45.996577', '7920', '1'), - ('4.99', '48', '2007-04-06T11:11:37.996577', '3758', '2'), - ('2.99', '48', '2007-03-21T13:51:16.996577', '14536', '2'), - ('6.99', '48', '2007-04-29T16:07:35.996577', '8716', '1'), - ('0.99', '48', '2007-02-19T18:57:50.996577', '2822', '2'), - ('3.99', '48', '2007-03-22T15:55:49.996577', '15228', '1'), - ('4.99', '55', '2007-04-27T02:01:43.996577', '7050', '2'), - ('4.99', '55', '2007-03-18T22:05:59.996577', '12776', '1'), - ('1.99', '55', '2007-03-19T05:11:54.996577', '12972', '2'), - ('2.99', '55', '2007-02-16T20:21:31.996577', '1825', '2'), - ('2.99', '55', '2007-02-20T01:22:32.996577', '2904', '1'), - ('4.99', '55', '2007-03-18T23:09:07.996577', '12808', '1'), - ('4.99', '55', '2007-04-08T08:43:58.996577', '4671', '1'), - ('4.99', '55', '2007-02-20T06:37:37.996577', '2976', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['23219', '23213', '18723', '29612', '29611', '23218', '23217', '18726', '29609', '29610', '29607', '21621', '27652', '27651', '27644', '21624', '18070', '27656', '27648', '21625', '21620', '21615', '27654', '27647', '27645', '27657', '27646', '21616', '27649', '27650', '21618', '21617', '21622', '21623', '27655', '21619', '27653', '23622', '18895', '30111', '30116', '30112', '30114', '23623', '30110', '30113', '23621', '30118', '23620', '30119', '18892', '30109', '30117', '18894', '23624', '30108', '32047', '30115', '18893', '30107', '27368', '21380', '27367', '27362', '27369', '21386', '21387', '17981', '21378', '27365', '21384', '21379', '27361', '21382', '27370', '27360', '27363', '17979', '27358', '17980', '27356', '21376', '27359', '27357', '21377', '27371', '21383', '21381', '27364', '27366', '21385', '30429', '18993', '30428', '23865', '23866', '23868', '30427', '23862', '23860']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('4.99', '55', '2007-03-22T18:05:46.996577', '15296', '1'), - ('1.99', '55', '2007-03-02T13:18:17.996577', '11287', '2'), - ('2.99', '55', '2007-02-17T14:25:09.996577', '2062', '2'), - ('2.99', '55', '2007-04-30T09:23:44.996577', '9798', '2'), - ('5.99', '55', '2007-04-30T01:57:13.996577', '9596', '2'), - ('2.99', '55', '2007-03-21T18:19:37.996577', '14667', '1'), - ('6.99', '55', '2007-03-19T18:53:50.996577', '13345', '1'), - ('4.99', '55', '2007-02-20T19:03:21.996577', '3149', '1'), - ('6.99', '55', '2007-04-29T00:32:48.996577', '8288', '2'), - ('2.99', '55', '2007-04-30T15:03:23.996577', '9302', '1'), - ('7.99', '55', '2007-04-11T17:01:10.996577', '6314', '2'), - ('5.99', '487', '2007-03-17T13:37:09.996577', '11890', '2'), - ('2.99', '487', '2007-04-29T15:07:24.996577', '8689', '2'), - ('1.99', '487', '2007-04-29T08:10:04.996577', '8510', '2'), - ('1.99', '487', '2007-04-06T22:07:27.996577', '3994', '2'), - ('7.99', '487', '2007-03-20T06:30:48.996577', '13658', '1'), - ('3.99', '487', '2007-02-20T15:16:23.996577', '3100', '2'), - ('3.99', '487', '2007-04-30T22:13:35.996577', '9490', '1'), - ('2.99', '487', '2007-04-27T03:24:35.996577', '7097', '1'), - ('2.99', '487', '2007-03-23T07:27:38.996577', '15665', '2'), - ('5.99', '487', '2007-03-17T04:17:17.996577', '11669', '1'), - ('2.99', '487', '2007-03-01T10:00:42.996577', '10511', '2'), - ('7.99', '487', '2007-04-30T03:07:15.996577', '8988', '1'), - ('2.99', '487', '2007-04-26T21:24:47.996577', '6928', '1'), - ('2.99', '487', '2007-04-08T17:13:10.996577', '4854', '2'), - ('0.99', '487', '2007-04-30T19:59:12.996577', '10123', '2'), - ('3.99', '487', '2007-04-10T04:54:14.996577', '5634', '1'), - ('6.99', '487', '2007-03-01T11:25:04.996577', '10555', '2'), - ('0.99', '487', '2007-04-28T05:50:21.996577', '7788', '1'), - ('4.99', '487', '2007-04-28T11:35:50.996577', '7949', '2'), - ('5.99', '487', '2007-03-01T23:00:30.996577', '10877', '2'), - ('6.99', '487', '2007-03-01T21:53:19.996577', '10832', '1'), - ('7.99', '487', '2007-03-18T11:22:04.996577', '12493', '1'), - ('4.99', '487', '2007-03-19T13:52:04.996577', '13210', '2'), - ('2.99', '487', '2007-04-30T20:51:31.996577', '9457', '2'), - ('9.99', '487', '2007-03-02T02:40:53.996577', '10978', '1'), - ('4.99', '487', '2007-04-29T20:18:09.996577', '8814', '1'), - ('0.99', '100', '2007-03-18T17:30:42.996577', '12657', '1'), - ('6.99', '100', '2007-02-21T21:12:11.996577', '3468', '2'), - ('6.99', '100', '2007-04-08T22:55:25.996577', '4980', '2'), - ('1.99', '100', '2007-04-28T10:31:12.996577', '7921', '1'), - ('4.99', '100', '2007-04-09T11:39:40.996577', '5238', '2'), - ('4.99', '100', '2007-04-12T09:36:58.996577', '6655', '1'), - ('0.99', '100', '2007-03-22T13:11:39.996577', '15163', '1'), - ('8.99', '100', '2007-04-08T22:22:55.996577', '4970', '1'), - ('6.99', '100', '2007-04-09T16:35:43.996577', '5355', '2'), - ('4.99', '100', '2007-03-02T15:44:04.996577', '11346', '2'), - ('5.99', '100', '2007-04-30T05:25:33.996577', '9048', '2'), - ('0.99', '100', '2007-03-02T08:01:20.996577', '11143', '1'), - ('4.99', '100', '2007-04-30T13:32:57.996577', '9271', '1'), - ('4.99', '100', '2007-02-15T01:52:14.996577', '1216', '2'), - ('2.99', '100', '2007-04-07T10:03:34.996577', '4209', '1'), - ('0.99', '100', '2007-04-28T21:43:22.996577', '8203', '2'), - ('2.99', '100', '2007-02-15T16:45:54.996577', '1427', '1'), - ('3.99', '100', '2007-03-22T16:19:15.996577', '15246', '2'), - ('8.99', '100', '2007-04-06T13:29:53.996577', '3800', '1'), - ('0.99', '100', '2007-05-14T13:44:29.996577', '15021', '2'), - ('4.99', '100', '2007-04-28T06:55:40.996577', '7819', '2'), - ('3.99', '100', '2007-02-15T10:52:41.996577', '1340', '1'), - ('5.99', '100', '2007-04-06T03:51:36.996577', '3602', '2'), - ('0.99', '462', '2007-04-29T00:17:30.996577', '8282', '1'), - ('0.99', '462', '2007-03-18T14:19:38.996577', '12582', '2'), - ('2.99', '462', '2007-04-28T15:48:35.996577', '8066', '1'), - ('8.99', '462', '2007-04-27T11:07:13.996577', '7295', '2'), - ('3.99', '462', '2007-04-29T00:52:34.996577', '8290', '1'), - ('2.99', '462', '2007-03-23T17:17:58.996577', '15943', '1'), - ('0.99', '462', '2007-03-23T19:45:43.996577', '16013', '1'), - ('4.99', '462', '2007-02-21T04:34:19.996577', '3279', '1'), - ('2.99', '462', '2007-03-17T10:19:42.996577', '11808', '1'), - ('4.99', '462', '2007-04-28T10:53:20.996577', '7932', '1'), - ('7.99', '462', '2007-03-20T00:00:30.996577', '13492', '1'), - ('4.99', '462', '2007-03-18T10:05:21.996577', '12466', '1'), - ('6.99', '462', '2007-04-12T12:11:24.996577', '6721', '1'), - ('8.99', '462', '2007-03-19T07:34:04.996577', '13041', '2'), - ('2.99', '462', '2007-04-29T17:47:36.996577', '8757', '2'), - ('7.99', '462', '2007-04-12T11:51:35.996577', '6710', '1'), - ('6.99', '462', '2007-04-27T12:11:05.996577', '7324', '1'), - ('5.99', '462', '2007-02-16T16:42:09.996577', '1773', '2'), - ('4.99', '462', '2007-04-12T05:10:57.996577', '6583', '1'), - ('9.99', '462', '2007-02-17T04:52:56.996577', '1926', '2'), - ('4.99', '462', '2007-04-08T00:38:27.996577', '4500', '1'), - ('2.99', '462', '2007-03-01T01:58:11.996577', '10283', '1'), - ('0.99', '462', '2007-04-12T07:58:31.996577', '6630', '1'), - ('3.99', '462', '2007-04-08T11:27:27.996577', '4728', '2'), - ('6.99', '462', '2007-03-17T03:11:55.996577', '11639', '2'), - ('0.99', '462', '2007-04-30T12:34:10.996577', '9891', '1'), - ('4.99', '462', '2007-03-19T18:24:27.996577', '13328', '1'), - ('8.99', '462', '2007-03-18T22:56:07.996577', '12802', '1'), - ('8.99', '462', '2007-04-28T05:02:49.996577', '7762', '1'), - ('2.99', '462', '2007-04-28T11:01:43.996577', '7935', '2'), - ('2.99', '462', '2007-03-23T04:10:39.996577', '15581', '2'), - ('6.99', '127', '2007-04-28T21:57:54.996577', '8209', '2'), - ('2.99', '127', '2007-02-16T19:01:13.996577', '1803', '2'), - ('4.99', '127', '2007-04-28T10:15:24.996577', '7912', '1'), - ('4.99', '127', '2007-03-19T07:35:39.996577', '13043', '2'), - ('2.99', '127', '2007-03-19T09:08:36.996577', '13091', '1'), - ('2.99', '127', '2007-03-21T02:00:43.996577', '14189', '1'), - ('2.99', '127', '2007-04-10T23:02:37.996577', '5983', '2'), - ('0.99', '127', '2007-03-02T11:41:47.996577', '11235', '1'), - ('10.99', '127', '2007-03-01T20:03:27.996577', '10787', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['30424', '23867', '30431', '18992', '23869', '18994', '30430', '23870', '30426', '23863', '30425', '23861', '23864', '27905', '21820', '18146', '27913', '18149', '21819', '21818', '21822', '27912', '27908', '18143', '27910', '27904', '18145', '18147', '27909', '27911', '18150', '18144', '21821', '18148', '27906', '27907', '20299', '20293', '26114', '26113', '20294', '17542', '17541', '20292', '20297', '20298', '17543', '26112', '20296', '17544', '26119', '20295', '26117', '20300', '26116', '26118', '26115', '21229', '21228', '27217', '27218', '17902', '21227', '27212', '27210', '27213', '27215', '21230', '17903', '27211', '21226', '21224', '17901', '27219', '21223', '21219', '27220', '27214', '21225', '17904', '21221', '27216', '21222', '21220', '19947', '19942', '25671', '25669', '19944', '19948', '19945', '25672', '25674', '25673', '25670', '25668', '19946', '19943', '25675', '23460']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('5.99', '127', '2007-04-08T08:16:17.996577', '4652', '1'), - ('2.99', '127', '2007-03-20T19:52:20.996577', '14030', '2'), - ('2.99', '127', '2007-04-30T23:03:51.996577', '10197', '1'), - ('4.99', '127', '2007-02-15T07:34:50.996577', '1293', '1'), - ('5.99', '127', '2007-03-22T23:43:33.996577', '15463', '1'), - ('3.99', '127', '2007-02-18T15:27:24.996577', '2412', '2'), - ('6.99', '127', '2007-04-30T11:31:21.996577', '9859', '1'), - ('5.99', '127', '2007-03-23T10:08:56.996577', '15736', '2'), - ('2.99', '127', '2007-04-09T22:56:11.996577', '5499', '2'), - ('4.99', '127', '2007-03-17T19:40:23.996577', '12060', '2'), - ('5.99', '127', '2007-04-08T15:32:50.996577', '4811', '2'), - ('7.99', '127', '2007-03-02T02:38:08.996577', '10973', '1'), - ('2.99', '127', '2007-03-18T23:33:34.996577', '12820', '2'), - ('4.99', '510', '2007-04-06T23:27:20.996577', '4014', '1'), - ('0.99', '510', '2007-03-18T04:45:32.996577', '12317', '1'), - ('8.99', '510', '2007-02-19T13:34:41.996577', '2729', '1'), - ('0.99', '510', '2007-04-30T20:13:54.996577', '10131', '1'), - ('8.99', '510', '2007-02-21T09:54:55.996577', '3352', '2'), - ('4.99', '510', '2007-03-17T17:03:03.996577', '11996', '2'), - ('7.99', '510', '2007-03-01T01:33:30.996577', '10265', '2'), - ('4.99', '510', '2007-03-22T09:15:10.996577', '15065', '1'), - ('4.99', '510', '2007-04-30T00:38:57.996577', '8926', '1'), - ('2.99', '510', '2007-04-27T17:03:43.996577', '7457', '1'), - ('5.99', '510', '2007-02-15T17:00:56.996577', '1435', '2'), - ('9.99', '510', '2007-04-28T05:56:29.996577', '7794', '2'), - ('2.99', '510', '2007-04-06T10:38:28.996577', '3744', '2'), - ('0.99', '510', '2007-02-17T04:45:13.996577', '1925', '2'), - ('0.99', '510', '2007-02-19T17:59:14.996577', '2806', '2'), - ('8.99', '510', '2007-04-28T01:26:42.996577', '7678', '1'), - ('3.99', '510', '2007-04-29T18:06:50.996577', '8763', '2'), - ('5.99', '510', '2007-02-21T20:38:27.996577', '3465', '2'), - ('0.99', '510', '2007-02-16T16:00:50.996577', '1757', '2'), - ('2.99', '510', '2007-03-18T08:06:28.996577', '12406', '2'), - ('0.99', '510', '2007-02-19T18:33:48.996577', '2817', '2'), - ('4.99', '510', '2007-04-10T16:09:13.996577', '5851', '2'), - ('1.99', '510', '2007-04-12T03:03:50.996577', '6531', '1'), - ('1.99', '350', '2007-03-23T12:25:06.996577', '15789', '2'), - ('6.99', '350', '2007-03-17T01:21:40.996577', '11595', '2'), - ('2.99', '350', '2007-04-08T13:47:19.996577', '4767', '1'), - ('5.99', '350', '2007-04-06T17:27:57.996577', '3893', '1'), - ('6.99', '350', '2007-03-17T05:21:07.996577', '11692', '2'), - ('0.99', '350', '2007-02-19T06:31:38.996577', '2619', '1'), - ('3.99', '350', '2007-02-17T10:24:35.996577', '2011', '2'), - ('0.99', '350', '2007-03-16T21:45:12.996577', '11504', '2'), - ('2.99', '350', '2007-03-18T09:24:46.996577', '12445', '2'), - ('0.99', '350', '2007-03-19T09:00:54.996577', '13086', '2'), - ('2.99', '350', '2007-02-20T13:42:06.996577', '3079', '1'), - ('0.99', '350', '2007-04-05T23:43:52.996577', '3529', '1'), - ('6.99', '350', '2007-03-18T02:28:17.996577', '12252', '2'), - ('0.99', '350', '2007-02-20T23:08:05.996577', '3206', '2'), - ('4.99', '350', '2007-04-27T15:23:51.996577', '7416', '2'), - ('0.99', '350', '2007-03-17T09:58:18.996577', '11800', '1'), - ('1.99', '350', '2007-04-10T12:35:10.996577', '5786', '1'), - ('0.99', '350', '2007-03-23T13:03:36.996577', '15807', '1'), - ('2.99', '350', '2007-04-09T14:12:35.996577', '5303', '1'), - ('3.99', '350', '2007-04-11T21:31:28.996577', '6408', '2'), - ('0.99', '350', '2007-04-09T11:43:14.996577', '5240', '1'), - ('4.99', '447', '2007-03-23T19:08:57.996577', '15997', '1'), - ('2.99', '447', '2007-03-22T10:38:33.996577', '15108', '1'), - ('8.99', '447', '2007-04-29T09:13:20.996577', '8537', '1'), - ('4.99', '447', '2007-04-30T01:40:14.996577', '8945', '2'), - ('2.99', '447', '2007-02-17T02:34:39.996577', '1890', '2'), - ('5.99', '447', '2007-03-21T10:34:58.996577', '14443', '2'), - ('4.99', '447', '2007-04-09T15:22:32.996577', '5331', '1'), - ('4.99', '447', '2007-04-07T19:58:06.996577', '4403', '2'), - ('0.99', '447', '2007-04-10T10:05:54.996577', '5734', '1'), - ('0.99', '447', '2007-04-12T09:25:54.996577', '6651', '1'), - ('4.99', '447', '2007-03-23T20:28:23.996577', '16032', '2'), - ('4.99', '447', '2007-02-17T11:32:26.996577', '2025', '1'), - ('6.99', '447', '2007-04-08T17:21:50.996577', '4858', '1'), - ('4.99', '447', '2007-03-20T13:06:15.996577', '13848', '1'), - ('2.99', '447', '2007-03-19T08:31:56.996577', '13072', '1'), - ('0.99', '447', '2007-02-15T02:32:35.996577', '1230', '2'), - ('5.99', '447', '2007-04-30T06:26:38.996577', '9076', '2'), - ('0.99', '447', '2007-03-18T11:51:45.996577', '12511', '2'), - ('2.99', '447', '2007-03-01T06:51:51.996577', '10425', '1'), - ('6.99', '447', '2007-04-30T14:25:05.996577', '9288', '1'), - ('2.99', '447', '2007-04-10T23:23:57.996577', '5987', '2'), - ('0.99', '447', '2007-03-19T09:53:03.996577', '13110', '2'), - ('4.99', '447', '2007-02-18T05:29:20.996577', '2285', '2'), - ('0.99', '447', '2007-03-02T06:48:27.996577', '11108', '2'), - ('1.99', '447', '2007-04-12T10:51:28.996577', '6690', '1'), - ('5.99', '447', '2007-03-02T20:12:18.996577', '11465', '1'), - ('5.99', '447', '2007-03-02T02:01:56.996577', '10957', '2'), - ('9.99', '311', '2007-03-23T13:43:28.996577', '15826', '2'), - ('4.99', '311', '2007-03-01T07:37:57.996577', '10448', '2'), - ('6.99', '311', '2007-04-28T19:54:11.996577', '8167', '2'), - ('5.99', '311', '2007-04-09T10:35:53.996577', '5224', '2'), - ('0.99', '311', '2007-03-19T17:33:42.996577', '13310', '2'), - ('8.99', '311', '2007-03-23T20:02:59.996577', '16020', '1'), - ('1.99', '311', '2007-03-19T21:36:08.996577', '13423', '2'), - ('2.99', '311', '2007-04-29T07:05:19.996577', '8473', '1'), - ('8.99', '311', '2007-04-30T12:21:59.996577', '9882', '2'), - ('6.99', '311', '2007-04-30T22:31:04.996577', '9503', '1'), - ('4.99', '311', '2007-04-11T22:05:04.996577', '6419', '2'), - ('3.99', '311', '2007-04-08T16:37:34.996577', '4836', '2'), - ('4.99', '311', '2007-03-21T13:25:29.996577', '14517', '2'), - ('2.99', '311', '2007-03-19T06:00:12.996577', '12997', '1'), - ('4.99', '311', '2007-04-30T20:24:36.996577', '10134', '1'), - ('0.99', '81', '2007-03-01T07:45:47.996577', '10456', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['23470', '23463', '29893', '29897', '29896', '18811', '23465', '23464', '18810', '29894', '29892', '29895', '23467', '23469', '23462', '18809', '23466', '23468', '23461', '23471', '25055', '19470', '31813', '25048', '25047', '31796', '31808', '25050', '31806', '31809', '31799', '31810', '25058', '25059', '31801', '31802', '31797', '31811', '25053', '31798', '25046', '31807', '25056', '31805', '25054', '31804', '31812', '25049', '19469', '31800', '25051', '25057', '31803', '25052', '23605', '30080', '18883', '30071', '30076', '30072', '30079', '18881', '18882', '30078', '23603', '30075', '30081', '30073', '30082', '23604', '30074', '30077', '27045', '21079', '27038', '21086', '27041', '27042', '21083', '21081', '27044', '21078', '27050', '27043', '27051', '27047', '27046', '27039', '27040', '21082', '27048', '27049', '21085', '21084', '21080', '25066', '25064', '25061', '31815', '19473']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('2.99', '81', '2007-03-23T14:35:41.996577', '15858', '1'), - ('5.99', '81', '2007-03-20T11:55:03.996577', '13820', '2'), - ('9.99', '81', '2007-04-08T23:02:42.996577', '4983', '2'), - ('3.99', '81', '2007-04-30T20:48:35.996577', '9454', '2'), - ('0.99', '81', '2007-04-28T02:50:40.996577', '7709', '1'), - ('4.99', '81', '2007-02-21T00:49:07.996577', '3229', '1'), - ('3.99', '81', '2007-03-21T17:38:06.996577', '14642', '1'), - ('4.99', '81', '2007-03-21T00:04:24.996577', '14128', '1'), - ('5.99', '81', '2007-02-19T21:40:14.996577', '2854', '1'), - ('0.99', '81', '2007-04-09T21:34:35.996577', '5468', '1'), - ('2.99', '81', '2007-04-06T16:59:46.996577', '3879', '1'), - ('4.99', '81', '2007-04-27T04:52:02.996577', '7130', '2'), - ('5.99', '81', '2007-03-22T15:46:31.996577', '15224', '1'), - ('4.99', '81', '2007-03-23T13:36:26.996577', '15823', '1'), - ('4.99', '81', '2007-03-17T23:56:44.996577', '12181', '2'), - ('1.99', '81', '2007-02-19T12:54:35.996577', '2714', '1'), - ('7.99', '81', '2007-03-21T21:30:28.996577', '14748', '2'), - ('4.99', '81', '2007-03-23T05:09:33.996577', '15602', '1'), - ('5.99', '81', '2007-03-17T11:33:07.996577', '11837', '1'), - ('1.99', '81', '2007-03-23T15:13:54.996577', '15884', '2'), - ('5.99', '257', '2007-03-20T13:00:57.996577', '13846', '2'), - ('4.99', '257', '2007-02-20T14:02:13.996577', '3083', '2'), - ('4.99', '257', '2007-04-30T20:39:20.996577', '10142', '2'), - ('6.99', '257', '2007-03-16T23:24:32.996577', '11545', '2'), - ('0.99', '257', '2007-03-02T17:13:11.996577', '11394', '1'), - ('6.99', '257', '2007-04-07T22:31:15.996577', '4462', '2'), - ('2.99', '257', '2007-04-28T23:22:43.996577', '8252', '2'), - ('2.99', '257', '2007-03-19T00:24:21.996577', '12841', '2'), - ('5.99', '257', '2007-04-27T19:29:42.996577', '7518', '2'), - ('4.99', '257', '2007-04-29T03:13:51.996577', '8344', '1'), - ('4.99', '257', '2007-04-10T16:28:33.996577', '5858', '1'), - ('4.99', '257', '2007-04-29T13:02:43.996577', '8640', '1'), - ('2.99', '257', '2007-03-23T18:18:32.996577', '15967', '1'), - ('0.99', '257', '2007-03-23T18:19:55.996577', '15968', '2'), - ('5.99', '257', '2007-04-12T11:52:06.996577', '6711', '2'), - ('4.99', '257', '2007-04-27T00:12:05.996577', '7007', '2'), - ('4.99', '257', '2007-04-08T04:08:08.996577', '4574', '2'), - ('6.99', '257', '2007-04-30T01:43:19.996577', '8946', '2'), - ('0.99', '257', '2007-03-19T14:08:05.996577', '13218', '2'), - ('6.99', '257', '2007-04-09T22:45:20.996577', '5495', '1'), - ('4.99', '257', '2007-03-02T11:27:34.996577', '11230', '1'), - ('3.99', '257', '2007-04-28T19:27:30.996577', '8156', '2'), - ('0.99', '257', '2007-03-20T23:38:55.996577', '14115', '2'), - ('2.99', '257', '2007-04-27T19:06:23.996577', '7510', '2'), - ('2.99', '257', '2007-03-19T20:21:17.996577', '13389', '1'), - ('1.99', '257', '2007-04-27T18:32:31.996577', '7496', '1'), - ('4.99', '257', '2007-04-30T09:29:24.996577', '9800', '1'), - ('1.99', '257', '2007-03-17T12:20:52.996577', '11860', '2'), - ('0.99', '257', '2007-02-19T01:37:17.996577', '2557', '1'), - ('5.99', '257', '2007-04-11T22:14:45.996577', '6422', '1'), - ('5.99', '257', '2007-03-19T02:39:16.996577', '12904', '1'), - ('0.99', '257', '2007-03-22T07:25:50.996577', '15025', '1'), - ('2.99', '257', '2007-04-27T06:32:54.996577', '7176', '1'), - ('7.99', '257', '2007-03-19T13:29:24.996577', '13203', '2'), - ('0.99', '97', '2007-03-22T06:48:41.996577', '15006', '1'), - ('0.99', '97', '2007-04-28T10:37:19.996577', '7924', '2'), - ('0.99', '97', '2007-02-21T20:14:13.996577', '3459', '1'), - ('2.99', '97', '2007-04-06T00:15:46.996577', '3540', '1'), - ('4.99', '97', '2007-04-09T20:52:51.996577', '5454', '2'), - ('0.99', '97', '2007-04-06T01:31:24.996577', '3565', '2'), - ('5.99', '97', '2007-04-27T06:44:04.996577', '7182', '2'), - ('2.99', '97', '2007-02-17T15:42:26.996577', '2083', '2'), - ('4.99', '97', '2007-02-19T17:18:11.996577', '2790', '2'), - ('0.99', '97', '2007-04-12T12:16:40.996577', '6726', '1'), - ('2.99', '97', '2007-03-01T21:22:06.996577', '10820', '1'), - ('4.99', '97', '2007-04-08T00:57:07.996577', '4508', '1'), - ('2.99', '97', '2007-04-29T05:54:08.996577', '8438', '2'), - ('4.99', '97', '2007-04-06T14:01:57.996577', '3818', '2'), - ('4.99', '97', '2007-04-30T01:47:54.996577', '9591', '1'), - ('4.99', '97', '2007-03-21T06:37:09.996577', '14323', '2'), - ('4.99', '97', '2007-04-07T16:03:25.996577', '4312', '2'), - ('0.99', '97', '2007-04-12T03:24:41.996577', '6544', '1'), - ('4.99', '433', '2007-04-12T17:59:08.996577', '6850', '1'), - ('2.99', '433', '2007-03-17T04:04:18.996577', '11664', '1'), - ('6.99', '433', '2007-04-07T03:59:22.996577', '4087', '2'), - ('5.99', '433', '2007-03-23T01:08:30.996577', '15502', '1'), - ('0.99', '433', '2007-04-09T21:01:40.996577', '5457', '2'), - ('8.99', '433', '2007-04-10T22:31:48.996577', '5969', '1'), - ('4.99', '433', '2007-03-21T13:32:11.996577', '14523', '2'), - ('4.99', '433', '2007-03-19T16:17:39.996577', '13273', '2'), - ('0.99', '433', '2007-04-12T17:52:33.996577', '6848', '1'), - ('4.99', '433', '2007-03-01T15:19:34.996577', '10663', '1'), - ('4.99', '433', '2007-04-30T09:47:44.996577', '9161', '2'), - ('5.99', '433', '2007-04-12T13:59:13.996577', '6765', '1'), - ('3.99', '433', '2007-04-30T14:43:03.996577', '9294', '1'), - ('4.99', '433', '2007-04-28T10:00:26.996577', '7907', '2'), - ('4.99', '433', '2007-04-28T06:59:49.996577', '7821', '1'), - ('0.99', '433', '2007-04-07T07:34:08.996577', '4158', '2'), - ('7.99', '433', '2007-04-08T23:14:40.996577', '4988', '2'), - ('4.99', '433', '2007-03-20T11:09:19.996577', '13801', '1'), - ('5.99', '433', '2007-04-29T05:17:01.996577', '8414', '1'), - ('2.99', '433', '2007-04-29T15:59:45.996577', '8713', '1'), - ('4.99', '433', '2007-03-23T00:13:33.996577', '15476', '2'), - ('6.99', '433', '2007-03-21T14:40:01.996577', '14559', '1'), - ('6.99', '433', '2007-03-18T17:46:13.996577', '12669', '2'), - ('3.99', '258', '2007-03-18T03:44:54.996577', '12296', '2'), - ('0.99', '258', '2007-03-01T05:21:16.996577', '10393', '1'), - ('4.99', '258', '2007-03-01T03:03:11.996577', '10315', '2'), - ('5.99', '258', '2007-04-08T08:59:02.996577', '4677', '1'), - ('8.99', '258', '2007-02-20T03:19:11.996577', '2931', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['31817', '25062', '31820', '31823', '25065', '25063', '31816', '31819', '31821', '25068', '31818', '31814', '25069', '25067', '19472', '25070', '31822', '19471', '25060', '26880', '26882', '20968', '26879', '20957', '20967', '20963', '20962', '26878', '20961', '20958', '20965', '20970', '26881', '17799', '20960', '26876', '26875', '17801', '20955', '20969', '20956', '26873', '17800', '26877', '20964', '20971', '20959', '26874', '20966', '27089', '21125', '21122', '27093', '21124', '27086', '17867', '27092', '27091', '27090', '17868', '27088', '17869', '21126', '27085', '27087', '21123', '21121', '21127', '27084', '27025', '21069', '21066', '27022', '21071', '21070', '21072', '17851', '31961', '21064', '17850', '21065', '17852', '17848', '21068', '27024', '27023', '27021', '21067', '17847', '17853', '17849', '17949', '21308', '27287', '21310', '21302', '21307', '21304', '21305', '27291']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('5.99', '258', '2007-04-09T14:31:35.996577', '5312', '2'), - ('5.99', '258', '2007-03-01T03:20:38.996577', '10325', '1'), - ('4.99', '258', '2007-04-11T00:28:38.996577', '6012', '2'), - ('4.99', '258', '2007-04-30T06:08:25.996577', '9069', '2'), - ('5.99', '258', '2007-03-18T02:17:07.996577', '12246', '1'), - ('6.99', '258', '2007-03-01T03:25:58.996577', '10332', '2'), - ('0.99', '258', '2007-04-08T18:53:37.996577', '4897', '2'), - ('9.99', '258', '2007-04-10T20:39:30.996577', '5935', '1'), - ('2.99', '258', '2007-04-28T06:38:14.996577', '7814', '1'), - ('6.99', '258', '2007-03-20T07:41:51.996577', '13695', '1'), - ('0.99', '258', '2007-04-10T06:54:52.996577', '5674', '1'), - ('2.99', '258', '2007-04-07T20:09:32.996577', '4408', '2'), - ('2.99', '258', '2007-03-20T14:30:54.996577', '13897', '2'), - ('4.99', '258', '2007-03-19T23:59:22.996577', '13491', '1'), - ('0.99', '258', '2007-02-19T10:40:49.996577', '2678', '2'), - ('6.99', '258', '2007-03-22T03:00:03.996577', '14901', '2'), - ('4.99', '258', '2007-04-29T14:24:44.996577', '8675', '1'), - ('2.99', '258', '2007-02-16T15:06:36.996577', '1743', '1'), - ('1.99', '258', '2007-03-01T02:12:52.996577', '10293', '2'), - ('0.99', '418', '2007-04-29T11:00:59.996577', '8591', '2'), - ('4.99', '418', '2007-04-30T00:43:01.996577', '9558', '1'), - ('4.99', '418', '2007-03-22T00:20:52.996577', '14836', '1'), - ('5.99', '418', '2007-04-29T09:37:14.996577', '8546', '2'), - ('2.99', '418', '2007-03-02T00:33:30.996577', '10915', '2'), - ('0.99', '418', '2007-03-21T12:15:55.996577', '14484', '1'), - ('0.99', '418', '2007-03-17T14:13:03.996577', '11910', '1'), - ('2.99', '418', '2007-03-17T08:33:15.996577', '11769', '1'), - ('4.99', '418', '2007-04-26T22:54:40.996577', '6970', '1'), - ('4.99', '418', '2007-03-17T03:28:29.996577', '11650', '1'), - ('2.99', '418', '2007-03-02T12:46:33.996577', '11270', '1'), - ('2.99', '418', '2007-03-20T02:07:41.996577', '13537', '1'), - ('4.99', '418', '2007-03-22T23:45:21.996577', '15466', '1'), - ('10.99', '418', '2007-04-29T23:04:57.996577', '8886', '2'), - ('2.99', '418', '2007-02-19T19:00:45.996577', '2825', '1'), - ('1.99', '418', '2007-03-02T17:55:17.996577', '11409', '2'), - ('0.99', '418', '2007-04-08T21:01:19.996577', '4938', '1'), - ('2.99', '418', '2007-04-08T17:37:30.996577', '4865', '1'), - ('2.99', '418', '2007-02-20T06:12:53.996577', '2969', '2'), - ('5.99', '418', '2007-03-01T10:50:54.996577', '10537', '2'), - ('2.99', '418', '2007-03-22T01:15:33.996577', '14860', '2'), - ('0.99', '418', '2007-03-01T17:12:23.996577', '10709', '1'), - ('0.99', '418', '2007-04-06T13:37:08.996577', '3805', '1'), - ('2.99', '418', '2007-02-20T04:11:31.996577', '2943', '2'), - ('4.99', '418', '2007-04-11T07:52:22.996577', '6150', '1'), - ('0.99', '418', '2007-03-19T17:37:40.996577', '13312', '2'), - ('5.99', '418', '2007-03-23T17:49:48.996577', '15957', '2'), - ('3.99', '418', '2007-03-02T14:51:43.996577', '11322', '2'), - ('7.99', '418', '2007-04-08T17:11:41.996577', '4852', '2'), - ('0.99', '418', '2007-03-20T17:12:00.996577', '13970', '1'), - ('6.99', '437', '2007-04-10T16:58:23.996577', '5864', '2'), - ('2.99', '437', '2007-03-20T12:51:42.996577', '13839', '1'), - ('3.99', '437', '2007-03-02T18:13:12.996577', '11417', '2'), - ('8.99', '437', '2007-04-30T16:28:54.996577', '10009', '2'), - ('7.99', '437', '2007-03-20T12:51:12.996577', '13838', '2'), - ('4.99', '437', '2007-04-09T04:05:15.996577', '5085', '2'), - ('5.99', '437', '2007-02-18T02:52:20.996577', '2239', '2'), - ('2.99', '437', '2007-04-30T16:22:11.996577', '9333', '2'), - ('2.99', '437', '2007-04-30T10:05:04.996577', '9172', '2'), - ('2.99', '437', '2007-04-28T22:12:22.996577', '8215', '2'), - ('2.99', '437', '2007-02-19T17:20:51.996577', '2792', '1'), - ('2.99', '437', '2007-04-10T10:36:59.996577', '5744', '2'), - ('2.99', '437', '2007-02-21T02:51:39.996577', '3265', '2'), - ('1.99', '437', '2007-03-20T14:41:14.996577', '13905', '1'), - ('4.99', '437', '2007-04-08T13:37:11.996577', '4765', '2'), - ('1.99', '437', '2007-04-09T07:47:09.996577', '5167', '1'), - ('8.99', '437', '2007-03-18T00:49:34.996577', '12205', '1'), - ('0.99', '437', '2007-03-01T01:04:05.996577', '10249', '2'), - ('1.99', '437', '2007-03-22T06:20:44.996577', '14993', '1'), - ('4.99', '437', '2007-04-06T10:39:40.996577', '3747', '1'), - ('4.99', '431', '2007-04-29T20:13:45.996577', '8810', '2'), - ('1.99', '431', '2007-03-19T11:38:13.996577', '13153', '2'), - ('6.99', '431', '2007-03-02T02:08:05.996577', '10959', '2'), - ('2.99', '431', '2007-04-08T15:20:02.996577', '4801', '1'), - ('2.99', '431', '2007-03-23T13:10:33.996577', '15809', '1'), - ('4.99', '431', '2007-03-20T10:39:54.996577', '13784', '1'), - ('2.99', '431', '2007-03-23T18:04:08.996577', '15960', '1'), - ('2.99', '431', '2007-02-19T15:50:43.996577', '2761', '2'), - ('2.99', '431', '2007-05-14T13:44:29.996577', '13587', '2'), - ('0.99', '431', '2007-03-01T09:51:53.996577', '10508', '2'), - ('4.99', '431', '2007-02-18T05:15:55.996577', '2281', '2'), - ('4.99', '431', '2007-03-01T10:24:20.996577', '10527', '1'), - ('6.99', '431', '2007-02-21T06:12:06.996577', '3304', '2'), - ('4.99', '431', '2007-02-17T17:01:30.996577', '2096', '1'), - ('6.99', '431', '2007-03-18T03:09:16.996577', '12273', '1'), - ('4.99', '431', '2007-04-28T12:44:40.996577', '7978', '2'), - ('0.99', '431', '2007-04-08T17:31:41.996577', '4863', '1'), - ('3.99', '431', '2007-04-07T06:54:10.996577', '4144', '1'), - ('2.99', '431', '2007-03-16T23:12:30.996577', '11538', '2'), - ('2.99', '431', '2007-02-16T01:09:56.996577', '1561', '2'), - ('8.99', '431', '2007-02-21T11:48:57.996577', '3369', '2'), - ('3.99', '431', '2007-02-18T04:49:20.996577', '2269', '1'), - ('2.99', '455', '2007-02-17T03:22:01.996577', '1906', '1'), - ('2.99', '455', '2007-03-21T05:35:52.996577', '14294', '1'), - ('2.99', '455', '2007-04-07T09:28:28.996577', '4195', '2'), - ('1.99', '455', '2007-03-23T00:53:35.996577', '15494', '1'), - ('0.99', '455', '2007-03-01T07:19:25.996577', '10436', '1'), - ('4.99', '455', '2007-03-20T11:31:52.996577', '13813', '2'), - ('2.99', '455', '2007-03-17T23:14:27.996577', '12163', '1'), - ('4.99', '455', '2007-03-18T04:38:28.996577', '12314', '1'), - ('4.99', '455', '2007-04-12T12:26:49.996577', '6729', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['17947', '17948', '27292', '21309', '27294', '21303', '21306', '27288', '27295', '27293', '17950', '27289', '27290', '20144', '25947', '20141', '20140', '25936', '20139', '25940', '25946', '25937', '25941', '31936', '25949', '25943', '25945', '20143', '25939', '25944', '25950', '25938', '25948', '25942', '20142', '27945', '21856', '27943', '27941', '21850', '21846', '18159', '27942', '27936', '27935', '27940', '18160', '18158', '21848', '27944', '27939', '21844', '27946', '27937', '27934', '21852', '21854', '21851', '27938', '21843', '21855', '21845', '21853', '21849', '21847', '24890', '24885', '31625', '24891', '31622', '24886', '24884', '31615', '24892', '24889', '19401', '19403', '31621', '31620', '31624', '31614', '24888', '31619', '31617', '19400', '24893', '24883', '31616', '19399', '24887', '31618', '19402', '31623', '22639', '18474', '18473', '22635', '28928', '28925', '22634']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('1.99', '455', '2007-02-15T13:46:34.996577', '1382', '2'), - ('1.99', '455', '2007-02-16T18:51:56.996577', '1802', '1'), - ('4.99', '455', '2007-04-27T14:22:45.996577', '7388', '1'), - ('4.99', '455', '2007-03-21T15:40:13.996577', '14583', '2'), - ('5.99', '455', '2007-04-28T09:55:23.996577', '7905', '2'), - ('4.99', '455', '2007-03-17T01:59:23.996577', '11605', '1'), - ('2.99', '455', '2007-03-19T08:55:11.996577', '13083', '2'), - ('8.99', '455', '2007-04-08T17:25:56.996577', '4861', '1'), - ('2.99', '455', '2007-04-29T00:56:51.996577', '8291', '2'), - ('4.99', '455', '2007-04-27T18:37:57.996577', '7498', '2'), - ('0.99', '455', '2007-02-18T11:27:49.996577', '2356', '2'), - ('2.99', '455', '2007-04-08T22:15:04.996577', '4964', '1'), - ('6.99', '455', '2007-04-09T23:05:04.996577', '5504', '1'), - ('0.99', '335', '2007-03-22T10:24:28.996577', '15101', '2'), - ('2.99', '335', '2007-04-29T22:08:36.996577', '8855', '1'), - ('1.99', '335', '2007-03-20T05:13:58.996577', '13622', '1'), - ('0.99', '335', '2007-03-19T16:00:02.996577', '13267', '2'), - ('0.99', '335', '2007-04-06T03:58:35.996577', '3607', '1'), - ('4.99', '335', '2007-03-01T13:07:41.996577', '10606', '2'), - ('8.99', '335', '2007-04-07T19:25:13.996577', '4387', '1'), - ('3.99', '335', '2007-04-29T12:48:23.996577', '8634', '2'), - ('0.99', '335', '2007-04-06T23:34:16.996577', '4016', '2'), - ('4.99', '335', '2007-04-09T00:53:38.996577', '5024', '1'), - ('0.99', '335', '2007-05-14T13:44:29.996577', '11541', '2'), - ('4.99', '335', '2007-04-30T17:12:15.996577', '9361', '2'), - ('2.99', '335', '2007-04-10T09:54:40.996577', '5728', '2'), - ('0.99', '335', '2007-04-12T20:31:28.996577', '6906', '1'), - ('4.99', '335', '2007-03-22T06:44:10.996577', '15005', '2'), - ('4.99', '335', '2007-04-07T13:30:19.996577', '4279', '1'), - ('7.99', '335', '2007-04-12T07:34:16.996577', '6624', '1'), - ('0.99', '335', '2007-04-30T19:47:03.996577', '9428', '1'), - ('2.99', '335', '2007-04-07T01:02:39.996577', '4032', '2'), - ('5.99', '335', '2007-04-30T08:12:05.996577', '9125', '1'), - ('0.99', '335', '2007-04-09T12:09:10.996577', '5252', '1'), - ('2.99', '335', '2007-03-20T19:15:35.996577', '14014', '1'), - ('2.99', '513', '2007-04-30T11:33:29.996577', '9862', '2'), - ('5.99', '513', '2007-03-23T02:48:42.996577', '15545', '2'), - ('9.99', '513', '2007-04-29T14:44:09.996577', '8683', '2'), - ('4.99', '513', '2007-04-29T02:18:24.996577', '8320', '2'), - ('5.99', '513', '2007-03-20T04:27:24.996577', '13596', '1'), - ('3.99', '513', '2007-03-17T07:44:01.996577', '11755', '1'), - ('7.99', '513', '2007-02-18T06:03:03.996577', '2290', '2'), - ('4.99', '513', '2007-04-29T03:19:05.996577', '8350', '1'), - ('4.99', '513', '2007-04-07T08:42:57.996577', '4178', '2'), - ('2.99', '513', '2007-04-07T02:17:39.996577', '4055', '2'), - ('0.99', '513', '2007-04-28T00:29:37.996577', '7655', '1'), - ('1.99', '513', '2007-02-19T14:16:59.996577', '2737', '2'), - ('2.99', '513', '2007-02-16T04:54:01.996577', '1607', '1'), - ('2.99', '513', '2007-03-18T22:31:12.996577', '12784', '2'), - ('5.99', '513', '2007-04-29T19:44:04.996577', '8798', '1'), - ('4.99', '513', '2007-04-11T00:54:55.996577', '6027', '1'), - ('2.99', '513', '2007-03-02T08:40:43.996577', '11165', '1'), - ('3.99', '513', '2007-04-30T16:34:32.996577', '10012', '1'), - ('4.99', '513', '2007-04-07T10:41:02.996577', '4220', '2'), - ('0.99', '513', '2007-04-06T16:28:45.996577', '3872', '2'), - ('7.99', '513', '2007-03-22T00:37:38.996577', '14844', '2'), - ('4.99', '513', '2007-03-22T08:02:58.996577', '15035', '1'), - ('4.99', '513', '2007-03-20T07:35:53.996577', '13690', '1'), - ('7.99', '513', '2007-04-10T10:24:06.996577', '5741', '1'), - ('2.99', '513', '2007-03-02T05:58:40.996577', '11081', '2'), - ('6.99', '513', '2007-03-22T17:55:50.996577', '15289', '2'), - ('3.99', '513', '2007-03-02T17:47:09.996577', '11407', '1'), - ('4.99', '513', '2007-03-22T02:03:05.996577', '14875', '1'), - ('4.99', '513', '2007-03-18T23:07:12.996577', '12807', '2'), - ('5.99', '513', '2007-03-18T13:22:24.996577', '12559', '1'), - ('4.99', '239', '2007-03-19T12:23:19.996577', '13175', '1'), - ('2.99', '239', '2007-03-02T21:03:31.996577', '11487', '1'), - ('5.99', '239', '2007-04-30T11:33:55.996577', '9863', '1'), - ('4.99', '239', '2007-03-19T21:47:28.996577', '13427', '2'), - ('2.99', '239', '2007-04-27T18:21:49.996577', '7491', '2'), - ('4.99', '239', '2007-03-17T13:59:10.996577', '11900', '2'), - ('2.99', '239', '2007-03-02T00:43:27.996577', '10923', '2'), - ('5.99', '239', '2007-04-06T01:02:35.996577', '3552', '1'), - ('3.99', '239', '2007-03-20T18:21:58.996577', '13999', '2'), - ('1.99', '239', '2007-03-18T19:58:38.996577', '12721', '1'), - ('2.99', '239', '2007-02-18T01:16:47.996577', '2215', '2'), - ('5.99', '239', '2007-02-21T12:35:45.996577', '3383', '1'), - ('0.99', '239', '2007-04-27T15:48:12.996577', '7426', '1'), - ('8.99', '239', '2007-04-27T00:29:29.996577', '7012', '2'), - ('0.99', '239', '2007-04-30T05:07:39.996577', '9676', '2'), - ('0.99', '239', '2007-04-06T00:46:32.996577', '3547', '2'), - ('4.99', '239', '2007-03-18T05:35:27.996577', '12340', '1'), - ('0.99', '239', '2007-04-12T04:32:06.996577', '6573', '1'), - ('4.99', '239', '2007-04-10T05:45:39.996577', '5651', '2'), - ('4.99', '239', '2007-02-16T01:05:09.996577', '1560', '2'), - ('1.99', '239', '2007-03-20T21:03:00.996577', '14062', '2'), - ('0.99', '239', '2007-03-01T18:42:40.996577', '10755', '1'), - ('7.99', '239', '2007-04-08T20:10:36.996577', '4920', '2'), - ('4.99', '239', '2007-02-14T21:29:00.996577', '1160', '1'), - ('0.99', '239', '2007-03-17T16:16:00.996577', '11968', '1'), - ('0.99', '239', '2007-04-10T22:07:00.996577', '5960', '1'), - ('4.99', '239', '2007-02-18T13:57:52.996577', '2390', '1'), - ('6.99', '239', '2007-04-29T06:27:29.996577', '8457', '1'), - ('2.99', '203', '2007-03-23T18:56:00.996577', '15991', '2'), - ('7.99', '203', '2007-02-20T03:46:42.996577', '2939', '2'), - ('2.99', '203', '2007-02-16T13:05:38.996577', '1715', '1'), - ('0.99', '203', '2007-03-18T12:10:40.996577', '12519', '1'), - ('7.99', '203', '2007-04-29T19:24:40.996577', '8792', '1'), - ('6.99', '203', '2007-04-28T05:47:28.996577', '7787', '2'), - ('2.99', '203', '2007-03-17T06:01:17.996577', '11712', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['22632', '22633', '28926', '28924', '22638', '22637', '28929', '18475', '22636', '18472', '28923', '28927', '20077', '20076', '25853', '20074', '25850', '25851', '20081', '25855', '20075', '20078', '20084', '20083', '20082', '25854', '20080', '25852', '20079', '27858', '21799', '18135', '27859', '27864', '18133', '21788', '21795', '21797', '21790', '18136', '21793', '27863', '21789', '21798', '21796', '21794', '27861', '27862', '18132', '27860', '21791', '21787', '27856', '27855', '21792', '18134', '27857', '21251', '21252', '21250', '27240', '27242', '31967', '21256', '17919', '21247', '27241', '27244', '17917', '21254', '21255', '17916', '27243', '17913', '17915', '21248', '21253', '27239', '27245', '17918', '17914', '21249', '28271', '18264', '22123', '28266', '28272', '22124', '28268', '28265', '28269', '22119', '22120', '28267', '22122', '22121', '18265', '28270', '23749', '23758']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('3.99', '203', '2007-03-01T16:54:57.996577', '10700', '2'), - ('2.99', '203', '2007-03-01T20:52:03.996577', '10805', '2'), - ('0.99', '203', '2007-04-28T15:03:42.996577', '8039', '1'), - ('5.99', '203', '2007-04-10T02:32:55.996577', '5579', '2'), - ('2.99', '203', '2007-03-23T12:51:29.996577', '15798', '2'), - ('5.99', '203', '2007-03-21T12:54:54.996577', '14505', '2'), - ('10.99', '203', '2007-04-30T03:49:58.996577', '9015', '2'), - ('2.99', '203', '2007-02-21T14:28:44.996577', '3406', '2'), - ('4.99', '203', '2007-03-20T12:53:44.996577', '13841', '2'), - ('4.99', '203', '2007-02-15T01:52:40.996577', '1217', '1'), - ('2.99', '203', '2007-04-07T06:44:18.996577', '4136', '2'), - ('4.99', '203', '2007-04-29T06:46:17.996577', '8463', '1'), - ('2.99', '328', '2007-03-20T04:40:17.996577', '13609', '1'), - ('0.99', '328', '2007-03-18T23:52:24.996577', '12825', '2'), - ('4.99', '328', '2007-04-29T18:48:11.996577', '8780', '2'), - ('2.99', '328', '2007-03-02T09:00:37.996577', '11174', '1'), - ('4.99', '328', '2007-04-09T20:41:51.996577', '5450', '1'), - ('1.99', '328', '2007-04-28T14:04:07.996577', '8017', '1'), - ('3.99', '328', '2007-03-21T21:46:34.996577', '14755', '1'), - ('2.99', '328', '2007-04-30T10:36:01.996577', '9835', '1'), - ('4.99', '328', '2007-03-17T23:38:43.996577', '12175', '1'), - ('7.99', '328', '2007-03-20T07:16:03.996577', '13681', '2'), - ('0.99', '328', '2007-03-23T14:45:35.996577', '15863', '1'), - ('4.99', '328', '2007-03-22T14:04:48.996577', '15179', '1'), - ('2.99', '328', '2007-03-22T04:22:18.996577', '14939', '2'), - ('2.99', '328', '2007-04-30T00:42:27.996577', '9557', '2'), - ('3.99', '328', '2007-03-21T06:03:18.996577', '14307', '2'), - ('6.99', '328', '2007-04-29T10:24:56.996577', '8577', '1'), - ('3.99', '328', '2007-03-20T14:45:53.996577', '13907', '1'), - ('0.99', '506', '2007-04-10T23:20:24.996577', '5985', '2'), - ('9.99', '506', '2007-03-23T08:31:12.996577', '15694', '1'), - ('9.99', '506', '2007-02-19T15:24:57.996577', '2755', '1'), - ('2.99', '506', '2007-04-12T14:56:22.996577', '6783', '1'), - ('2.99', '506', '2007-04-30T15:11:09.996577', '9972', '2'), - ('2.99', '506', '2007-02-15T19:15:36.996577', '1467', '1'), - ('4.99', '506', '2007-03-01T22:59:00.996577', '10873', '1'), - ('2.99', '506', '2007-03-21T07:02:52.996577', '14337', '1'), - ('5.99', '506', '2007-03-22T07:24:09.996577', '15022', '2'), - ('4.99', '506', '2007-03-17T09:05:26.996577', '11781', '2'), - ('6.99', '506', '2007-02-19T19:00:11.996577', '2824', '2'), - ('0.99', '506', '2007-03-20T10:12:02.996577', '13767', '2'), - ('3.99', '506', '2007-04-30T04:26:08.996577', '9654', '2'), - ('0.99', '506', '2007-03-02T11:54:16.996577', '11238', '2'), - ('1.99', '506', '2007-03-23T03:56:27.996577', '15572', '2'), - ('6.99', '506', '2007-03-21T08:52:26.996577', '14395', '2'), - ('1.99', '506', '2007-03-20T21:44:33.996577', '14074', '1'), - ('9.99', '506', '2007-04-28T17:01:12.996577', '8096', '2'), - ('0.99', '506', '2007-04-29T07:52:18.996577', '8506', '2'), - ('6.99', '506', '2007-02-15T17:42:11.996577', '1446', '1'), - ('0.99', '506', '2007-04-27T00:52:53.996577', '7020', '1'), - ('0.99', '506', '2007-03-19T05:54:36.996577', '12994', '1'), - ('2.99', '506', '2007-03-01T08:32:43.996577', '10477', '1'), - ('6.99', '506', '2007-04-08T07:28:00.996577', '4640', '2'), - ('7.99', '506', '2007-04-08T05:08:32.996577', '4594', '2'), - ('2.99', '506', '2007-03-19T08:34:04.996577', '13073', '2'), - ('0.99', '506', '2007-02-16T01:41:35.996577', '1565', '2'), - ('8.99', '506', '2007-04-08T15:29:28.996577', '4806', '2'), - ('0.99', '450', '2007-03-20T11:28:04.996577', '13810', '1'), - ('4.99', '450', '2007-03-20T12:18:18.996577', '13828', '1'), - ('4.99', '450', '2007-03-20T08:50:34.996577', '13731', '2'), - ('7.99', '450', '2007-04-10T23:49:48.996577', '5999', '1'), - ('2.99', '450', '2007-04-27T13:28:46.996577', '7365', '2'), - ('0.99', '450', '2007-05-14T13:44:29.996577', '14172', '1'), - ('4.99', '450', '2007-03-22T22:23:02.996577', '15419', '2'), - ('4.99', '450', '2007-02-20T19:31:04.996577', '3155', '1'), - ('2.99', '450', '2007-03-01T07:11:47.996577', '10432', '2'), - ('4.99', '450', '2007-04-11T01:00:10.996577', '6028', '1'), - ('0.99', '450', '2007-04-27T23:17:27.996577', '7626', '1'), - ('4.99', '450', '2007-02-18T21:38:37.996577', '2501', '1'), - ('0.99', '450', '2007-03-22T07:21:19.996577', '15019', '2'), - ('4.99', '450', '2007-03-22T18:59:50.996577', '15327', '1'), - ('0.99', '450', '2007-02-18T05:06:23.996577', '2278', '2'), - ('0.99', '450', '2007-04-27T22:40:01.996577', '7610', '1'), - ('4.99', '450', '2007-02-16T07:02:05.996577', '1639', '2'), - ('2.99', '450', '2007-02-17T03:54:20.996577', '1914', '2'), - ('3.99', '450', '2007-03-02T02:58:28.996577', '10984', '1'), - ('4.99', '450', '2007-03-21T05:09:55.996577', '14282', '1'), - ('3.99', '450', '2007-04-06T01:52:09.996577', '3570', '1'), - ('4.99', '450', '2007-04-29T16:55:00.996577', '8733', '2'), - ('2.99', '450', '2007-02-19T06:57:10.996577', '2626', '1'), - ('0.99', '450', '2007-02-16T14:38:04.996577', '1739', '1'), - ('0.99', '450', '2007-03-18T23:22:28.996577', '12812', '2'), - ('4.99', '542', '2007-04-29T08:57:42.996577', '8533', '1'), - ('4.99', '542', '2007-02-19T05:44:46.996577', '2610', '1'), - ('0.99', '542', '2007-03-19T22:38:02.996577', '13447', '1'), - ('6.99', '542', '2007-04-09T22:12:15.996577', '5477', '1'), - ('3.99', '542', '2007-04-29T09:30:34.996577', '8544', '2'), - ('9.99', '542', '2007-03-22T05:49:21.996577', '14982', '2'), - ('5.99', '542', '2007-04-11T17:34:27.996577', '6325', '2'), - ('0.99', '542', '2007-04-09T13:45:49.996577', '5293', '2'), - ('9.99', '542', '2007-04-12T19:28:49.996577', '6887', '1'), - ('4.99', '542', '2007-03-01T01:55:41.996577', '10280', '1'), - ('0.99', '542', '2007-03-17T00:36:39.996577', '11583', '2'), - ('5.99', '542', '2007-04-11T03:34:34.996577', '6077', '2'), - ('0.99', '542', '2007-03-18T23:33:31.996577', '12819', '1'), - ('2.99', '542', '2007-03-17T14:06:11.996577', '11903', '2'), - ('10.99', '542', '2007-02-20T05:22:13.996577', '2957', '2'), - ('8.99', '542', '2007-04-28T01:18:07.996577', '7672', '2'), - ('1.99', '116', '2007-03-01T01:07:08.996577', '10250', '2'), - ('2.99', '116', '2007-03-22T03:12:35.996577', '14907', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['23751', '18955', '30309', '18953', '18957', '30304', '30305', '23753', '23750', '18956', '30310', '23757', '23754', '30311', '30313', '23752', '18952', '18954', '30307', '23755', '30312', '30306', '30308', '23756', '26379', '26373', '26380', '26375', '17625', '17626', '20496', '20501', '20497', '26383', '20499', '20495', '26371', '20492', '26372', '26369', '20500', '26378', '20493', '26384', '26381', '26370', '20494', '20491', '17627', '26374', '26377', '20498', '26382', '20502', '20490', '26376', '27311', '27316', '27315', '27313', '21336', '21331', '27317', '21332', '27310', '21330', '17968', '21335', '27314', '21333', '17967', '27312', '27318', '21334', '21337', '26810', '26820', '26814', '20885', '26813', '20888', '26817', '31955', '26816', '26812', '17782', '17784', '26821', '17783', '26815', '26819', '20887', '20884', '26811', '20886', '26818', '20890', '20889', '20883', '21500']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('4.99', '116', '2007-03-02T03:47:39.996577', '11016', '2'), - ('4.99', '116', '2007-02-17T03:48:13.996577', '1913', '2'), - ('4.99', '116', '2007-04-12T03:40:29.996577', '6557', '1'), - ('0.99', '116', '2007-02-15T23:14:28.996577', '1533', '2'), - ('3.99', '116', '2007-02-19T21:50:00.996577', '2861', '1'), - ('6.99', '116', '2007-04-06T18:15:52.996577', '3908', '2'), - ('2.99', '116', '2007-04-06T19:45:25.996577', '3940', '2'), - ('7.99', '116', '2007-03-19T11:23:08.996577', '13146', '2'), - ('1.99', '116', '2007-03-01T20:38:01.996577', '10801', '1'), - ('4.99', '116', '2007-02-19T07:52:28.996577', '2639', '1'), - ('0.99', '116', '2007-04-27T08:42:07.996577', '7238', '1'), - ('11.99', '116', '2007-03-21T22:02:26.996577', '14763', '2'), - ('0.99', '116', '2007-03-19T19:48:13.996577', '13369', '1'), - ('5.99', '116', '2007-04-28T05:03:42.996577', '7763', '2'), - ('3.99', '116', '2007-04-30T00:51:46.996577', '9562', '1'), - ('2.99', '116', '2007-03-18T06:48:55.996577', '12376', '2'), - ('0.99', '116', '2007-02-15T10:04:27.996577', '1332', '2'), - ('4.99', '116', '2007-02-16T16:18:45.996577', '1762', '2'), - ('4.99', '116', '2007-04-08T11:52:19.996577', '4737', '2'), - ('0.99', '116', '2007-03-19T23:32:58.996577', '13474', '1'), - ('6.99', '116', '2007-04-30T12:36:16.996577', '9245', '2'), - ('0.99', '116', '2007-04-07T00:47:27.996577', '4027', '1'), - ('2.99', '116', '2007-04-09T07:50:51.996577', '5169', '2'), - ('6.99', '116', '2007-03-20T10:24:56.996577', '13775', '1'), - ('2.99', '372', '2007-04-28T15:38:25.996577', '8059', '1'), - ('7.99', '372', '2007-04-10T19:29:38.996577', '5914', '2'), - ('0.99', '372', '2007-04-29T03:29:24.996577', '8358', '1'), - ('4.99', '372', '2007-04-27T07:04:27.996577', '7190', '1'), - ('2.99', '372', '2007-02-18T07:32:05.996577', '2315', '1'), - ('4.99', '372', '2007-02-20T05:36:20.996577', '2959', '1'), - ('8.99', '372', '2007-03-20T13:38:39.996577', '13871', '2'), - ('0.99', '372', '2007-03-22T08:11:44.996577', '15041', '2'), - ('9.99', '372', '2007-03-20T20:04:24.996577', '14037', '2'), - ('8.99', '372', '2007-04-29T21:17:26.996577', '8837', '2'), - ('2.99', '372', '2007-03-21T06:58:04.996577', '14331', '1'), - ('4.99', '372', '2007-03-19T20:45:19.996577', '13402', '2'), - ('2.99', '372', '2007-04-09T16:23:24.996577', '5352', '1'), - ('4.99', '372', '2007-03-16T23:37:25.996577', '11555', '2'), - ('6.99', '372', '2007-04-09T23:02:14.996577', '5501', '1'), - ('4.99', '372', '2007-04-09T10:58:44.996577', '5229', '1'), - ('1.99', '372', '2007-03-21T22:15:42.996577', '14770', '1'), - ('7.99', '372', '2007-04-28T13:54:24.996577', '8009', '2'), - ('0.99', '372', '2007-03-18T01:27:35.996577', '12224', '1'), - ('5.99', '372', '2007-04-30T08:19:40.996577', '9128', '1'), - ('0.99', '372', '2007-04-29T16:33:47.996577', '8724', '1'), - ('2.99', '372', '2007-04-09T14:33:54.996577', '5314', '1'), - ('3.99', '372', '2007-03-18T19:36:27.996577', '12714', '1'), - ('3.99', '372', '2007-03-02T18:49:34.996577', '11438', '2'), - ('3.99', '372', '2007-02-21T04:47:33.996577', '3283', '1'), - ('4.99', '372', '2007-04-12T11:04:05.996577', '6692', '2'), - ('4.99', '372', '2007-04-28T03:38:22.996577', '7735', '2'), - ('4.99', '372', '2007-03-21T02:57:37.996577', '14211', '1'), - ('2.99', '372', '2007-04-29T17:46:57.996577', '8755', '1'), - ('2.99', '372', '2007-03-23T03:37:24.996577', '15563', '1'), - ('10.99', '372', '2007-03-02T07:47:48.996577', '11134', '2'), - ('5.99', '372', '2007-04-27T08:37:11.996577', '7234', '2'), - ('2.99', '458', '2007-04-09T18:52:18.996577', '5412', '1'), - ('1.99', '458', '2007-04-12T09:34:54.996577', '6654', '1'), - ('7.99', '458', '2007-04-12T05:54:14.996577', '6595', '2'), - ('3.99', '458', '2007-04-11T13:30:30.996577', '6250', '2'), - ('4.99', '458', '2007-03-21T09:55:33.996577', '14428', '2'), - ('2.99', '458', '2007-03-17T16:27:05.996577', '11975', '2'), - ('3.99', '458', '2007-04-28T10:36:55.996577', '7923', '2'), - ('0.99', '458', '2007-03-18T21:54:37.996577', '12768', '2'), - ('2.99', '458', '2007-04-08T01:43:26.996577', '4525', '2'), - ('2.99', '458', '2007-03-02T07:54:42.996577', '11138', '2'), - ('0.99', '458', '2007-02-21T07:11:03.996577', '3322', '2'), - ('4.99', '458', '2007-03-20T03:33:40.996577', '13571', '2'), - ('5.99', '458', '2007-04-11T22:32:23.996577', '6431', '1'), - ('2.99', '458', '2007-03-19T15:37:19.996577', '13259', '2'), - ('5.99', '458', '2007-02-19T07:10:38.996577', '2629', '2'), - ('0.99', '458', '2007-04-10T02:17:26.996577', '5572', '1'), - ('0.99', '458', '2007-04-28T19:37:12.996577', '8158', '1'), - ('2.99', '458', '2007-03-19T23:55:31.996577', '13487', '2'), - ('4.99', '458', '2007-03-23T05:12:45.996577', '15604', '1'), - ('2.99', '411', '2007-04-06T19:20:35.996577', '3928', '1'), - ('5.99', '411', '2007-04-29T11:59:24.996577', '8613', '2'), - ('2.99', '411', '2007-04-10T13:27:02.996577', '5800', '1'), - ('0.99', '411', '2007-03-20T05:45:11.996577', '13634', '2'), - ('5.99', '411', '2007-04-09T16:37:25.996577', '5357', '2'), - ('5.99', '411', '2007-03-21T22:19:05.996577', '14772', '1'), - ('2.99', '411', '2007-04-27T19:19:30.996577', '7513', '1'), - ('4.99', '411', '2007-05-14T13:44:29.996577', '13246', '2'), - ('0.99', '411', '2007-04-27T14:31:37.996577', '7395', '2'), - ('2.99', '411', '2007-04-07T12:17:29.996577', '4246', '1'), - ('0.99', '411', '2007-02-17T09:00:03.996577', '1985', '1'), - ('0.99', '411', '2007-02-19T12:48:39.996577', '2712', '2'), - ('0.99', '411', '2007-04-30T02:50:11.996577', '9622', '2'), - ('2.99', '411', '2007-02-17T09:48:09.996577', '1997', '2'), - ('1.99', '411', '2007-04-27T03:35:47.996577', '7102', '1'), - ('0.99', '411', '2007-04-28T14:21:55.996577', '8023', '1'), - ('2.99', '411', '2007-03-21T12:05:06.996577', '14480', '2'), - ('5.99', '411', '2007-03-17T17:03:04.996577', '11997', '1'), - ('0.99', '411', '2007-04-07T06:58:42.996577', '4146', '2'), - ('7.99', '411', '2007-03-20T06:29:33.996577', '13656', '2'), - ('2.99', '411', '2007-04-28T06:36:53.996577', '7813', '1'), - ('0.99', '411', '2007-03-23T17:11:37.996577', '15936', '1'), - ('2.99', '411', '2007-03-22T06:21:07.996577', '14996', '2'), - ('2.99', '411', '2007-03-02T13:36:53.996577', '11294', '2'), - ('7.99', '473', '2007-03-02T18:20:19.996577', '11421', '2') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - - v_old_ids_payment := ARRAY['21501', '21502', '27488', '27486', '27490', '27485', '21503', '27481', '27487', '18026', '18025', '27479', '18023', '21506', '27484', '27489', '27480', '21507', '27483', '21499', '18024', '27482', '21504', '21496', '21505', '21508', '21498', '21497', '21509', '27478', '21955', '18204', '18202', '28061', '28064', '18203', '21954', '28059', '28063', '21952', '21951', '28062', '28065', '28060', '28058', '21950', '21953', '30734', '19094', '30733', '24161', '30729', '24159', '19095', '19096', '30732', '30727', '24163', '24160', '24156', '24155', '24157', '30728', '30735', '30730', '24158', '24162', '30726', '24154', '30731', '19093', '27795', '27800', '21731', '18117', '18116', '21732', '27792', '27801', '18114', '27793', '21726', '27794', '27797', '27799', '27798', '21728', '21725', '27802', '21730', '18113', '18115', '21724', '27796', '21727', '21729']; - WITH inserted AS ( - INSERT INTO "public"."payment" ("amount", "customer_id", "payment_date", "rental_id", "staff_id") - SELECT - data.amount::numeric, - map0.new_id::smallint, - data.payment_date::timestamp without time zone, - map1.new_id::integer, - map2.new_id::smallint - FROM (VALUES - ('0.99', '473', '2007-03-17T07:17:05.996577', '11741', '1'), - ('4.99', '473', '2007-03-20T17:40:56.996577', '13984', '2'), - ('7.99', '473', '2007-04-28T10:44:17.996577', '7928', '2'), - ('2.99', '473', '2007-04-27T07:52:26.996577', '7215', '1'), - ('8.99', '473', '2007-04-30T07:54:34.996577', '9120', '2'), - ('4.99', '473', '2007-04-27T04:06:42.996577', '7111', '1'), - ('0.99', '473', '2007-03-21T02:20:18.996577', '14202', '2'), - ('0.99', '473', '2007-04-08T17:51:58.996577', '4873', '1'), - ('1.99', '473', '2007-04-28T10:27:19.996577', '7918', '2'), - ('4.99', '473', '2007-02-19T14:50:52.996577', '2748', '2'), - ('4.99', '473', '2007-02-19T01:33:25.996577', '2553', '2'), - ('4.99', '473', '2007-04-06T22:53:55.996577', '4006', '2'), - ('0.99', '473', '2007-02-16T15:22:29.996577', '1748', '2'), - ('4.99', '473', '2007-03-21T21:52:03.996577', '14757', '2'), - ('4.99', '473', '2007-04-12T19:31:29.996577', '6890', '2'), - ('4.99', '473', '2007-04-30T04:18:34.996577', '9025', '1'), - ('4.99', '473', '2007-04-08T06:42:52.996577', '4625', '2'), - ('4.99', '473', '2007-03-22T11:07:03.996577', '15118', '1'), - ('2.99', '473', '2007-04-11T23:12:34.996577', '6446', '1'), - ('0.99', '473', '2007-03-02T15:27:22.996577', '11336', '1'), - ('2.99', '473', '2007-02-17T19:22:08.996577', '2125', '1'), - ('5.99', '473', '2007-04-09T20:37:54.996577', '5447', '2'), - ('0.99', '473', '2007-03-21T14:25:05.996577', '14550', '2'), - ('2.99', '473', '2007-03-01T22:52:41.996577', '10867', '1'), - ('4.99', '473', '2007-03-21T18:10:16.996577', '14658', '2'), - ('2.99', '473', '2007-03-22T21:41:29.996577', '15400', '2'), - ('4.99', '473', '2007-03-02T10:52:09.996577', '11216', '1'), - ('2.99', '473', '2007-03-02T03:34:18.996577', '11006', '2'), - ('4.99', '473', '2007-03-23T20:15:13.996577', '16024', '2'), - ('0.99', '473', '2007-04-06T21:19:06.996577', '3971', '1'), - ('6.99', '524', '2007-03-22T15:02:05.996577', '15206', '2'), - ('2.99', '524', '2007-02-21T19:40:39.996577', '3454', '2'), - ('1.99', '524', '2007-02-15T08:27:50.996577', '1306', '1'), - ('6.99', '524', '2007-04-11T13:01:07.996577', '6240', '1'), - ('4.99', '524', '2007-04-27T01:45:45.996577', '7040', '1'), - ('4.99', '524', '2007-02-16T07:53:04.996577', '1651', '2'), - ('1.99', '524', '2007-03-21T18:48:18.996577', '14680', '2'), - ('4.99', '524', '2007-04-09T01:27:36.996577', '5037', '2'), - ('8.99', '524', '2007-04-27T00:43:06.996577', '7014', '2'), - ('2.99', '524', '2007-03-21T01:42:11.996577', '14178', '1'), - ('4.99', '524', '2007-03-20T20:21:47.996577', '14046', '2'), - ('4.99', '524', '2007-04-12T12:59:17.996577', '6745', '2'), - ('6.99', '524', '2007-04-29T07:58:10.996577', '8507', '1'), - ('4.99', '524', '2007-04-11T08:40:20.996577', '6161', '2'), - ('5.99', '524', '2007-04-07T18:17:02.996577', '4366', '1'), - ('2.99', '524', '2007-03-20T05:23:50.996577', '13626', '2'), - ('2.99', '524', '2007-03-21T08:00:05.996577', '14366', '1'), - ('0.99', '153', '2007-04-30T13:56:07.996577', '9936', '2'), - ('0.99', '153', '2007-02-19T08:48:35.996577', '2649', '1'), - ('7.99', '153', '2007-04-28T07:03:13.996577', '7824', '2'), - ('0.99', '153', '2007-03-22T17:06:14.996577', '15267', '2'), - ('5.99', '153', '2007-04-08T08:42:44.996577', '4670', '2'), - ('4.99', '153', '2007-03-21T21:28:28.996577', '14747', '1'), - ('4.99', '153', '2007-02-20T00:50:34.996577', '2893', '1'), - ('5.99', '153', '2007-02-20T04:17:53.996577', '2945', '1'), - ('9.99', '153', '2007-04-12T16:49:20.996577', '6818', '2'), - ('0.99', '153', '2007-04-06T20:15:02.996577', '3949', '1'), - ('1.99', '153', '2007-03-23T04:43:35.996577', '15593', '1'), - ('4.99', '153', '2007-03-22T04:29:52.996577', '14944', '1'), - ('3.99', '153', '2007-03-18T09:13:23.996577', '12439', '1'), - ('1.99', '153', '2007-03-17T21:17:35.996577', '12103', '1'), - ('4.99', '153', '2007-03-19T02:02:12.996577', '12882', '1'), - ('5.99', '153', '2007-04-07T09:28:05.996577', '4194', '1'), - ('4.99', '153', '2007-04-30T16:39:43.996577', '10015', '2'), - ('0.99', '153', '2007-04-10T07:06:58.996577', '5676', '2'), - ('4.99', '153', '2007-03-21T18:17:13.996577', '14664', '1'), - ('7.99', '153', '2007-03-22T23:15:18.996577', '15444', '2'), - ('0.99', '153', '2007-04-06T13:06:07.996577', '3795', '1'), - ('4.99', '153', '2007-03-02T16:31:31.996577', '11368', '2'), - ('0.99', '153', '2007-04-10T11:55:11.996577', '5771', '2'), - ('0.99', '153', '2007-02-18T02:02:24.996577', '2224', '1'), - ('4.99', '500', '2007-04-11T00:35:02.996577', '6018', '2'), - ('6.99', '500', '2007-04-29T09:13:43.996577', '8538', '1'), - ('2.99', '500', '2007-03-23T04:17:47.996577', '15584', '1'), - ('2.99', '500', '2007-02-20T07:48:55.996577', '2996', '1'), - ('6.99', '500', '2007-02-18T23:31:33.996577', '2526', '2'), - ('2.99', '500', '2007-03-23T14:22:46.996577', '15853', '1'), - ('4.99', '500', '2007-04-06T19:11:01.996577', '3926', '2'), - ('0.99', '500', '2007-04-30T00:37:40.996577', '8925', '1'), - ('5.99', '500', '2007-02-15T14:17:07.996577', '1388', '2'), - ('0.99', '500', '2007-04-08T03:31:09.996577', '4561', '1'), - ('2.99', '500', '2007-03-18T16:41:31.996577', '12639', '1'), - ('4.99', '500', '2007-04-08T14:53:53.996577', '4790', '2'), - ('3.99', '500', '2007-04-12T15:37:34.996577', '6801', '2'), - ('2.99', '500', '2007-04-28T10:38:28.996577', '7925', '1'), - ('0.99', '500', '2007-04-28T08:18:06.996577', '7857', '1'), - ('4.99', '500', '2007-03-20T05:32:19.996577', '13628', '2'), - ('1.99', '500', '2007-03-02T10:57:38.996577', '11218', '2'), - ('3.99', '500', '2007-04-30T14:27:34.996577', '9290', '2'), - ('4.99', '500', '2007-03-22T05:07:50.996577', '14964', '1'), - ('5.99', '500', '2007-02-15T13:23:22.996577', '1375', '1'), - ('3.99', '500', '2007-02-17T23:48:52.996577', '2189', '2'), - ('6.99', '500', '2007-03-02T01:51:43.996577', '10947', '1'), - ('2.99', '500', '2007-04-11T09:57:17.996577', '6187', '2'), - ('2.99', '500', '2007-03-18T23:22:48.996577', '12813', '2'), - ('0.99', '500', '2007-03-21T09:15:17.996577', '14407', '1') - ) AS data(amount, old_customer_id, payment_date, old_rental_id, old_staff_id) - JOIN _pgslice_id_map map0 - ON map0.table_name = '"public"."customer"' - AND map0.old_id = data.old_customer_id - JOIN _pgslice_id_map map1 - ON map1.table_name = '"public"."rental"' - AND map1.old_id = data.old_rental_id - JOIN _pgslice_id_map map2 - ON map2.table_name = '"public"."staff"' - AND map2.old_id = data.old_staff_id - RETURNING payment_id - ) - SELECT array_agg(payment_id) INTO v_new_ids_payment FROM inserted; - - FOR i IN 1..array_length(v_new_ids_payment, 1) LOOP - INSERT INTO _pgslice_id_map VALUES ('"public"."payment"', v_old_ids_payment[i], v_new_ids_payment[i]::TEXT); - END LOOP; - -END $$; - --- Cleanup -DROP TABLE IF EXISTS _pgslice_id_map; diff --git a/src/pgslice/cli.py b/src/pgslice/cli.py index f5f13d1..8a99841 100644 --- a/src/pgslice/cli.py +++ b/src/pgslice/cli.py @@ -4,6 +4,7 @@ import argparse import sys +import time from dataclasses import dataclass from datetime import datetime from importlib.metadata import version as get_version @@ -174,13 +175,15 @@ def run_cli_dump( # Users want to see progress for large datasets show_progress = True + # Start timing + start_time = time.time() + # Wide mode warning if args.wide and show_progress: - sys.stderr.write( - "\n⚠ Note: Wide mode follows ALL relationships including self-referencing FKs.\n" + printy( + "\n[gI]⚠ Note: Wide mode follows ALL relationships including self-referencing FKs.@" ) - sys.stderr.write(" This may take longer and fetch more data.\n\n") - sys.stderr.flush() + printy("[gI]This may take longer and fetch more data.@\n") # Create dump service service = DumpService(conn_manager, config, show_progress=show_progress) @@ -210,7 +213,19 @@ def run_cli_dump( ) SQLWriter.write_to_file(result.sql_content, str(output_path)) - printy(f"[g]✓ Wrote {result.record_count} records to {output_path}@") + + # Calculate and format elapsed time + elapsed_time = time.time() - start_time + if elapsed_time >= 60: + time_str = f"{elapsed_time / 60:.1f}m" + elif elapsed_time >= 1: + time_str = f"{elapsed_time:.1f}s" + else: + time_str = f"{elapsed_time * 1000:.0f}ms" + + printy( + f"[g]✓ Wrote {result.record_count} records to {output_path} (took {time_str})@" + ) return 0 diff --git a/src/pgslice/dumper/dump_service.py b/src/pgslice/dumper/dump_service.py index 9111590..33ad2da 100644 --- a/src/pgslice/dumper/dump_service.py +++ b/src/pgslice/dumper/dump_service.py @@ -14,7 +14,7 @@ from ..graph.traverser import RelationshipTraverser from ..graph.visited_tracker import VisitedTracker from ..utils.logging_config import get_logger -from ..utils.spinner import SpinnerAnimator +from ..utils.spinner import SpinnerAnimator, animated_spinner from .dependency_sorter import DependencySorter from .sql_generator import SQLGenerator @@ -88,63 +88,55 @@ def dump( file=sys.stderr, bar_format="{desc}: {percentage:3.0f}%|{bar}| {n_fmt}/{total_fmt}", ) as pbar: - # Step 1: Setup and traverse relationships # Create spinner animator (updates every 100ms for smooth animation) spinner = SpinnerAnimator(update_interval=0.1) - pbar.set_description(f"Traversing relationships {spinner.get_frame()}") - - # Define progress callback to update progress bar with animated spinner - def update_progress(count: int) -> None: - pbar.set_description( - f"Traversing relationships {spinner.get_frame()} {count} records found" + # Step 1: Setup and traverse relationships (using animated spinner) + with animated_spinner( + spinner, pbar.set_description, "Traversing relationships" + ): + conn = self.conn_manager.get_connection() + introspector = SchemaIntrospector(conn) + visited = VisitedTracker() + traverser = RelationshipTraverser( + conn, + introspector, + visited, + timeframe_filters, + wide_mode=wide_mode, + fetch_batch_size=self.config.sql_batch_size, ) - conn = self.conn_manager.get_connection() - introspector = SchemaIntrospector(conn) - visited = VisitedTracker() - traverser = RelationshipTraverser( - conn, - introspector, - visited, - timeframe_filters, - wide_mode=wide_mode, - progress_callback=update_progress, - ) - - if len(pk_values) == 1: - records = traverser.traverse( - table, pk_values[0], schema, self.config.max_depth - ) - else: - records = traverser.traverse_multiple( - table, pk_values, schema, self.config.max_depth - ) - pbar.set_description( - f"Traversing relationships ✓ {len(records)} records found" - ) + if len(pk_values) == 1: + records = traverser.traverse( + table, pk_values[0], schema, self.config.max_depth + ) + else: + records = traverser.traverse_multiple( + table, pk_values, schema, self.config.max_depth + ) pbar.update(1) - # Step 2: Sort by dependencies - pbar.set_description("Sorting dependencies ⠋") - sorter = DependencySorter() - sorted_records = sorter.sort(records) - pbar.set_description("Sorting dependencies ✓") + # Step 2: Sort by dependencies (using animated spinner) + with animated_spinner( + spinner, pbar.set_description, "Sorting dependencies" + ): + sorter = DependencySorter() + sorted_records = sorter.sort(records) pbar.update(1) - # Step 3: Generate SQL - pbar.set_description("Generating SQL ⠋") - generator = SQLGenerator( - introspector, batch_size=self.config.sql_batch_size - ) - sql = generator.generate_batch( - sorted_records, - keep_pks=keep_pks, - create_schema=create_schema, - database_name=self.config.db.database, - schema_name=schema, - ) - pbar.set_description("Generating SQL ✓") + # Step 3: Generate SQL (using animated spinner) + with animated_spinner(spinner, pbar.set_description, "Generating SQL"): + generator = SQLGenerator( + introspector, batch_size=self.config.sql_batch_size + ) + sql = generator.generate_batch( + sorted_records, + keep_pks=keep_pks, + create_schema=create_schema, + database_name=self.config.db.database, + schema_name=schema, + ) pbar.update(1) # Step 4: Complete diff --git a/src/pgslice/dumper/sql_generator.py b/src/pgslice/dumper/sql_generator.py index 8227181..9a27b07 100644 --- a/src/pgslice/dumper/sql_generator.py +++ b/src/pgslice/dumper/sql_generator.py @@ -4,6 +4,7 @@ import json from datetime import date, datetime, time +from decimal import Decimal from typing import Any from uuid import UUID @@ -413,6 +414,15 @@ def _format_value( elif isinstance(value, int): return str(value) + elif isinstance(value, Decimal): + # Handle Decimal (before float, since we want numeric output) + if value.is_nan(): + return "'NaN'" + if value.is_infinite(): + return "'Infinity'" if value > 0 else "'-Infinity'" + # Return as numeric literal (no quotes) + return str(value) + elif isinstance(value, float): # Handle special float values if value != value: # NaN diff --git a/src/pgslice/graph/traverser.py b/src/pgslice/graph/traverser.py index 757fe8b..09dd2d2 100644 --- a/src/pgslice/graph/traverser.py +++ b/src/pgslice/graph/traverser.py @@ -3,7 +3,6 @@ from __future__ import annotations from collections import deque -from collections.abc import Callable from typing import Any import psycopg @@ -32,7 +31,7 @@ def __init__( visited_tracker: VisitedTracker, timeframe_filters: list[TimeframeFilter] | None = None, wide_mode: bool = False, - progress_callback: Callable[[int], None] | None = None, + fetch_batch_size: int = 500, ) -> None: """ Initialize relationship traverser. @@ -45,7 +44,8 @@ def __init__( wide_mode: If True, follow incoming FKs from all records (wide/exploratory). If False (default), only follow incoming FKs from starting records and records reached via incoming FKs (strict mode, prevents fan-out). - progress_callback: Optional callback invoked with record count after each fetch + fetch_batch_size: Number of records to fetch in a single batch query (default: 500). + Higher values reduce database round-trips but increase memory usage. """ self.conn = connection self.introspector = schema_introspector @@ -53,7 +53,7 @@ def __init__( self.table_cache: dict[str, Table] = {} self.timeframe_filters = {f.table_name: f for f in (timeframe_filters or [])} self.wide_mode = wide_mode - self.progress_callback = progress_callback + self.fetch_batch_size = fetch_batch_size def traverse( self, @@ -63,18 +63,17 @@ def traverse( max_depth: int | None = None, ) -> set[RecordData]: """ - Traverse relationships from a starting record. + Traverse relationships from a starting record using batch fetching. Algorithm: 1. Start with initial record (table + PK) - 2. Use BFS with queue of (RecordIdentifier, depth) - 3. For each record: - - Skip if already visited - - Mark as visited - - Fetch record data - - Follow outgoing FKs (forward relationships) - - Follow incoming FKs (reverse relationships) - 4. Continue until queue empty + 2. Use BFS with queue of (RecordIdentifier, depth, follow_incoming_fks) + 3. Collect records at same depth into batches (up to fetch_batch_size) + 4. For each batch: + - Batch fetch all records + - Process outgoing FKs for all records in batch + - Batch process incoming FKs + 5. Continue until queue empty Args: table_name: Starting table name @@ -89,101 +88,149 @@ def traverse( RecordNotFoundError: If starting record doesn't exist """ start_id = self._create_record_identifier(schema, table_name, (pk_value,)) - # Queue now tracks: (record_id, depth, follow_incoming_fks) - # follow_incoming_fks=True for starting records and records reached via incoming FKs - # follow_incoming_fks=False for records reached via outgoing FKs (dependencies) queue: deque[tuple[RecordIdentifier, int, bool]] = deque([(start_id, 0, True)]) results: set[RecordData] = set() logger.info(f"Starting traversal from {start_id}") while queue: - record_id, depth, follow_incoming_fks = queue.popleft() + # Collect batch: all records at current depth (up to batch_size) + current_depth = queue[0][1] if queue else 0 + batch: list[tuple[RecordIdentifier, bool]] = [] - # Check depth limit - if max_depth is not None and depth > max_depth: - logger.debug(f"Skipping {record_id}: depth {depth} > max {max_depth}") - continue + while queue and len(batch) < self.fetch_batch_size: + record_id, depth, follow_incoming_fks = queue.popleft() - # Skip if already visited - if self.visited.is_visited(record_id): - logger.debug(f"Skipping {record_id}: already visited") - continue + # If depth changed, put it back and process current batch + if depth != current_depth: + queue.appendleft((record_id, depth, follow_incoming_fks)) + break - # Mark as visited BEFORE fetching to prevent re-queueing - self.visited.mark_visited(record_id) + # Check depth limit + if max_depth is not None and depth > max_depth: + logger.debug( + f"Skipping {record_id}: depth {depth} > max {max_depth}" + ) + continue - # Fetch record data - try: - record_data = self._fetch_record(record_id) - except RecordNotFoundError: - logger.warning(f"Record not found: {record_id}") + # Skip if already visited + if self.visited.is_visited(record_id): + logger.debug(f"Skipping {record_id}: already visited") + continue + + # Mark as visited BEFORE fetching + self.visited.mark_visited(record_id) + batch.append((record_id, follow_incoming_fks)) + + # Process batch + if not batch: continue - results.add(record_data) - logger.debug( - f"Fetched {record_id} at depth {depth} ({len(results)} total records)" - ) + # Batch fetch all records + record_ids = [rid for rid, _ in batch] + try: + fetched_records = self._fetch_records_batch(record_ids) + except Exception as e: + logger.error(f"Error batch fetching records: {e}") + # Fall back to individual fetches + fetched_records = {} + for record_id in record_ids: + try: + fetched_records[record_id] = self._fetch_record(record_id) + except RecordNotFoundError: + logger.warning(f"Record not found: {record_id}") + + # Process each fetched record + for record_id, _ in batch: + if record_id not in fetched_records: + continue + + record_data = fetched_records[record_id] + results.add(record_data) + logger.debug( + f"Fetched {record_id} at depth {current_depth} ({len(results)} total)" + ) + + # Get table metadata + table = self._get_table_metadata( + record_id.schema_name, record_id.table_name + ) + + # Traverse outgoing FKs (forward relationships) + for fk in table.foreign_keys_outgoing: + target_id = self._resolve_foreign_key_target(record_data, fk) + if target_id: + # ALWAYS add dependency + record_data.dependencies.add(target_id) + logger.debug( + f" -> Dependency: {record_data.identifier} depends on {target_id}" + ) - # Invoke progress callback with current record count - if self.progress_callback: - self.progress_callback(len(results)) + # Only traverse if not visited + if not self.visited.is_visited(target_id): + follow_incoming = self.wide_mode + queue.append( + (target_id, current_depth + 1, follow_incoming) + ) + logger.debug(f" -> Following outgoing FK to {target_id}") - # Get table metadata - table = self._get_table_metadata( - record_id.schema_name, record_id.table_name - ) + # Process incoming FKs for batch (using batch lookup) + # Group by FK to minimize queries + incoming_fk_lookups: dict[Any, list[tuple[RecordIdentifier, bool]]] = {} + for record_id, follow_incoming_fks in batch: + if record_id not in fetched_records or not follow_incoming_fks: + continue - # Traverse outgoing FKs (forward relationships) - for fk in table.foreign_keys_outgoing: - target_id = self._resolve_foreign_key_target(record_data, fk) - if target_id: - # ALWAYS add dependency (even if target already visited) - # This ensures correct SQL ordering when inserting records - record_data.dependencies.add(target_id) - logger.debug( - f" -> Dependency: {record_data.identifier} depends on {target_id}" - ) + table = self._get_table_metadata( + record_id.schema_name, record_id.table_name + ) - # Only traverse if not visited - # In strict mode: dependencies should NOT follow incoming FKs (prevents fan-out) - # In wide mode: all records can follow incoming FKs - if not self.visited.is_visited(target_id): - follow_incoming = self.wide_mode - queue.append((target_id, depth + 1, follow_incoming)) - logger.debug(f" -> Following outgoing FK to {target_id}") - - # Traverse incoming FKs (reverse relationships) - # Only follow incoming FKs if this record allows it - if follow_incoming_fks: for fk in table.foreign_keys_incoming: - logger.debug( - f" <- Processing incoming FK: {fk.source_table}, wide_mode={self.wide_mode}" - ) - # In strict mode, skip self-referencing FKs to prevent sibling expansion - # Self-referencing FKs like users.manager_id -> users.id would find peers/siblings + # Skip self-referencing FKs in strict mode if not self.wide_mode: source_schema, source_table = self._parse_table_name( fk.source_table ) - logger.debug( - f" <- Checking FK: {fk.source_table} (parsed: {source_schema}.{source_table}) vs current: {record_id.schema_name}.{record_id.table_name}" - ) if ( source_schema == record_id.schema_name and source_table == record_id.table_name ): logger.debug( - f" <- Skipping self-referencing FK from {source_schema}.{source_table} (strict mode)" + " <- Skipping self-referencing FK (strict mode)" ) continue - source_records = self._find_referencing_records(record_id, fk) - for source_id in source_records: - if not self.visited.is_visited(source_id): - # Records reached via incoming FKs CAN follow incoming FKs - queue.append((source_id, depth + 1, True)) - logger.debug(f" <- Following incoming FK from {source_id}") + # Group records by FK for batch lookup + fk_key = (fk.source_table, fk.source_column) + if fk_key not in incoming_fk_lookups: + incoming_fk_lookups[fk_key] = [] + incoming_fk_lookups[fk_key].append((record_id, follow_incoming_fks)) + + # Batch process incoming FKs + for (source_table, source_column), targets in incoming_fk_lookups.items(): + # Reconstruct FK object for batch lookup + fk_obj = type( + "FK", + (), + {"source_table": source_table, "source_column": source_column}, + )() + target_ids = [tid for tid, _ in targets] + + try: + referencing_map = self._find_referencing_records_batch( + target_ids, fk_obj + ) + + for target_id in target_ids: + source_records = referencing_map.get(target_id, []) + for source_id in source_records: + if not self.visited.is_visited(source_id): + queue.append((source_id, current_depth + 1, True)) + logger.debug( + f" <- Following incoming FK from {source_id}" + ) + except Exception as e: + logger.error(f"Error in batch FK lookup: {e}") logger.info(f"Traversal complete: {len(results)} records found") return results @@ -218,10 +265,6 @@ def traverse_multiple( records = self.traverse(table_name, pk_value, schema, max_depth) all_records.update(records) - # Final progress callback with total unique records - if self.progress_callback: - self.progress_callback(len(all_records)) - logger.info( f"Multi-traversal complete: {len(all_records)} unique records found" ) @@ -281,6 +324,74 @@ def _fetch_record(self, record_id: RecordIdentifier) -> RecordData: return RecordData(identifier=record_id, data=data) + def _fetch_records_batch( + self, record_ids: list[RecordIdentifier] + ) -> dict[RecordIdentifier, RecordData]: + """ + Fetch multiple records in a single query using IN clause. + Groups records by table for efficient batching. + + Args: + record_ids: List of record identifiers to fetch + + Returns: + Dictionary mapping RecordIdentifier to RecordData + """ + if not record_ids: + return {} + + results: dict[RecordIdentifier, RecordData] = {} + + # Group by (schema, table) + by_table: dict[tuple[str, str], list[RecordIdentifier]] = {} + for record_id in record_ids: + key = (record_id.schema_name, record_id.table_name) + by_table.setdefault(key, []).append(record_id) + + # Fetch each table's records in batch + for (schema, table), table_record_ids in by_table.items(): + table_metadata = self._get_table_metadata(schema, table) + + if not table_metadata.primary_keys: + logger.warning(f"Table {schema}.{table} has no primary key, skipping") + continue + + # Build WHERE clause: WHERE id IN (1, 2, 3) + pk_col = table_metadata.primary_keys[0] + pk_values = [rid.pk_values[0] for rid in table_record_ids] + placeholders = ", ".join(["%s"] * len(pk_values)) + + # Apply timeframe filter if applicable + timeframe_clause = "" + params: list[Any] = pk_values.copy() + + if table in self.timeframe_filters: + filter_config = self.timeframe_filters[table] + timeframe_clause = ( + f' AND "{filter_config.column_name}" BETWEEN %s AND %s' + ) + params.extend([filter_config.start_date, filter_config.end_date]) + + query = f""" + SELECT * FROM "{schema}"."{table}" + WHERE "{pk_col}" IN ({placeholders}){timeframe_clause} + """ + + with self.conn.cursor() as cur: + cur.execute(query, params) + rows = cur.fetchall() + columns = [desc[0] for desc in (cur.description or [])] + + for row in rows: + data = dict(zip(columns, row, strict=False)) + pk_value = data[pk_col] + record_id = self._create_record_identifier( + schema, table, (pk_value,) + ) + results[record_id] = RecordData(identifier=record_id, data=data) + + return results + def _resolve_foreign_key_target( self, record: RecordData, fk: Any ) -> RecordIdentifier | None: @@ -378,6 +489,81 @@ def _find_referencing_records( return results + def _find_referencing_records_batch( + self, target_ids: list[RecordIdentifier], fk: Any + ) -> dict[RecordIdentifier, list[RecordIdentifier]]: + """ + Find all records referencing multiple targets via single FK using IN clause. + + Args: + target_ids: List of target record identifiers being referenced + fk: ForeignKey object + + Returns: + Dictionary mapping each target_id to list of RecordIdentifiers referencing it + """ + if not target_ids: + return {} + + # Parse source table + schema, table = self._parse_table_name(fk.source_table) + + # Get primary keys for source table + source_table = self._get_table_metadata(schema, table) + if not source_table.primary_keys: + logger.warning(f"Table {schema}.{table} has no primary key, skipping") + return {} + + # Get target PK values + target_pk_values = [tid.pk_values[0] for tid in target_ids] + + # Build query with IN clause + pk_columns = ", ".join(f'"{pk}"' for pk in source_table.primary_keys) + placeholders = ", ".join(["%s"] * len(target_pk_values)) + + # Apply timeframe filter if applicable + timeframe_clause = "" + params: list[Any] = target_pk_values.copy() + + if table in self.timeframe_filters: + filter_config = self.timeframe_filters[table] + timeframe_clause = f' AND "{filter_config.column_name}" BETWEEN %s AND %s' + params.extend([filter_config.start_date, filter_config.end_date]) + + # Include FK column to map back to targets + query = f""" + SELECT {pk_columns}, "{fk.source_column}" + FROM "{schema}"."{table}" + WHERE "{fk.source_column}" IN ({placeholders}){timeframe_clause} + """ + + # Initialize results dict with empty lists for all targets + results: dict[RecordIdentifier, list[RecordIdentifier]] = { + tid: [] for tid in target_ids + } + + with self.conn.cursor() as cur: + cur.execute(query, params) + rows = cur.fetchall() + + for row in rows: + fk_value = row[-1] # Last column is FK value + pk_values = row[:-1] # Rest are PK values + + source_id = self._create_record_identifier( + schema, + table, + (pk_values[0],) if len(pk_values) == 1 else tuple(pk_values), + ) + + # Map to correct target + for target_id in target_ids: + if str(target_id.pk_values[0]) == str(fk_value): + results[target_id].append(source_id) + break + + return results + def _get_table_metadata(self, schema: str, table: str) -> Table: """ Get table metadata with caching. diff --git a/src/pgslice/repl.py b/src/pgslice/repl.py index cc04015..935b6d9 100644 --- a/src/pgslice/repl.py +++ b/src/pgslice/repl.py @@ -3,9 +3,10 @@ from __future__ import annotations import shlex +import time from pathlib import Path -from printy import printy, raw_format +from printy import printy, raw from prompt_toolkit import PromptSession from prompt_toolkit.completion import WordCompleter from prompt_toolkit.history import FileHistory @@ -190,9 +191,9 @@ def _cmd_dump(self, args: list[str]) -> None: # Wide mode warning if wide_mode: printy( - " [y]⚠ Note: Wide mode follows ALL relationships including self-referencing FKs.@" + "\n[gI]⚠ Note: Wide mode follows ALL relationships including self-referencing FKs.@" ) - printy(" [y] This may take longer and fetch more data.@\n") + printy("[gI]This may take longer and fetch more data.@\n") if timeframe_filters: printy(" [y]Truncate filters:@") @@ -201,6 +202,9 @@ def _cmd_dump(self, args: list[str]) -> None: printy("") # Empty line after filters try: + # Start timing + start_time = time.time() + # Use DumpService for the actual dump # REPL always writes to files, so progress bar is safe to show service = DumpService(self.conn_manager, self.config, show_progress=True) @@ -215,13 +219,22 @@ def _cmd_dump(self, args: list[str]) -> None: show_graph=show_graph, ) + # Calculate and format elapsed time + elapsed_time = time.time() - start_time + if elapsed_time >= 60: + time_str = f"{elapsed_time / 60:.1f}m" + elif elapsed_time >= 1: + time_str = f"{elapsed_time:.1f}s" + else: + time_str = f"{elapsed_time * 1000:.0f}ms" + printy(f"\n [g]✓ Found {result.record_count} related records@") # Output if output_file: SQLWriter.write_to_file(result.sql_content, output_file) printy( - f" [g]✓ Wrote {result.record_count} INSERT statements to {output_file}@\n" + f" [g]✓ Wrote {result.record_count} INSERT statements to {output_file} (took {time_str})@\n" ) else: # Use default output path @@ -233,7 +246,7 @@ def _cmd_dump(self, args: list[str]) -> None: ) SQLWriter.write_to_file(result.sql_content, str(default_path)) printy( - f" [g]✓ Wrote {result.record_count} INSERT statements to {default_path}@\n" + f" [g]✓ Wrote {result.record_count} INSERT statements to {default_path} (took {time_str})@\n" ) except DBReverseDumpError as e: @@ -260,8 +273,8 @@ def _cmd_help(self, args: list[str]) -> None: tabulate( help_data, headers=[ - raw_format("Command", flags="B"), - raw_format("Description", flags="B"), + raw("Command", flags="B"), + raw("Description", flags="B"), ], tablefmt="simple", ) diff --git a/src/pgslice/utils/spinner.py b/src/pgslice/utils/spinner.py index 0650e49..fd88978 100644 --- a/src/pgslice/utils/spinner.py +++ b/src/pgslice/utils/spinner.py @@ -2,7 +2,10 @@ from __future__ import annotations +import threading import time +from collections.abc import Callable, Iterator +from contextlib import contextmanager class SpinnerAnimator: @@ -46,3 +49,40 @@ def reset(self) -> None: """Reset spinner to initial state.""" self._current_idx = 0 self._last_update = time.time() + + +@contextmanager +def animated_spinner( + spinner: SpinnerAnimator, + update_fn: Callable[[str], None], + base_text: str, + interval: float = 0.1, +) -> Iterator[None]: + """ + Context manager that animates spinner in background thread. + + Args: + spinner: SpinnerAnimator instance + update_fn: Function to call with updated description (e.g., pbar.set_description) + base_text: Base description text (spinner appended) + interval: Update interval in seconds + + Usage: + with animated_spinner(spinner, pbar.set_description, "Sorting dependencies"): + sorter.sort(records) # Spinner animates during this + """ + stop_event = threading.Event() + + def animate() -> None: + while not stop_event.is_set(): + update_fn(f"{base_text} {spinner.get_frame()}") + stop_event.wait(interval) + + thread = threading.Thread(target=animate, daemon=True) + thread.start() + try: + yield + finally: + stop_event.set() + thread.join(timeout=0.5) + update_fn(f"{base_text} ✓") diff --git a/tests/unit/graph/test_traverser.py b/tests/unit/graph/test_traverser.py index 37ff3b0..fe36556 100644 --- a/tests/unit/graph/test_traverser.py +++ b/tests/unit/graph/test_traverser.py @@ -30,7 +30,12 @@ def mock_cursor(self) -> MagicMock: cursor = MagicMock() cursor.execute = MagicMock() cursor.fetchone = MagicMock() - cursor.fetchall = MagicMock(return_value=[]) + # Set up fetchall to return the same data as fetchone for batch compatibility + cursor.fetchall = MagicMock( + side_effect=lambda: [cursor.fetchone.return_value] + if cursor.fetchone.return_value + else [] + ) cursor.description = [("id",), ("name",)] return cursor @@ -537,7 +542,7 @@ def test_skips_incoming_fks_when_disabled( mock_introspector.get_table_metadata.return_value = users_table mock_cursor.fetchone.return_value = (1, "Alice") - results = traverser.traverse("users", "public", (1,)) + results = traverser.traverse("users", 1, "public") # Should only find the user, not referencing orders assert len(results) == 1 @@ -631,7 +636,7 @@ def test_strict_mode_skips_self_referencing_fk( mock_introspector.get_table_metadata.return_value = users_table mock_cursor.fetchone.return_value = (1, "Employee", 2) - results = traverser.traverse("users", "public", (1,)) + results = traverser.traverse("users", 1, "public") # In strict mode, should skip self-referencing FK assert len(results) == 1 diff --git a/tests/unit/graph/test_traverser_progress.py b/tests/unit/graph/test_traverser_progress.py deleted file mode 100644 index 5660ffe..0000000 --- a/tests/unit/graph/test_traverser_progress.py +++ /dev/null @@ -1,185 +0,0 @@ -"""Tests for traverser progress callback functionality.""" - -from __future__ import annotations - -from unittest.mock import MagicMock - -from pgslice.graph.models import RecordData -from pgslice.graph.traverser import RelationshipTraverser - - -class TestProgressCallback: - """Tests for progress callback parameter and invocation.""" - - def test_traverser_accepts_progress_callback(self) -> None: - """Should accept progress_callback parameter without errors.""" - mock_conn = MagicMock() - mock_introspector = MagicMock() - mock_visited = MagicMock() - mock_callback = MagicMock() - - traverser = RelationshipTraverser( - mock_conn, - mock_introspector, - mock_visited, - progress_callback=mock_callback, - ) - - assert traverser.progress_callback == mock_callback - - def test_progress_callback_none_does_not_error(self) -> None: - """Should work correctly when progress_callback is None.""" - mock_conn = MagicMock() - mock_introspector = MagicMock() - mock_visited = MagicMock() - - # Should not raise any errors - traverser = RelationshipTraverser( - mock_conn, - mock_introspector, - mock_visited, - progress_callback=None, - ) - - assert traverser.progress_callback is None - - def test_progress_callback_invoked_per_record(self, mocker: MagicMock) -> None: - """Should invoke callback after each record is fetched.""" - mock_conn = MagicMock() - mock_introspector = MagicMock() - mock_visited = MagicMock() - mock_callback = MagicMock() - - # Mock table metadata - mock_table = MagicMock() - mock_table.primary_keys = ["id"] - mock_table.foreign_keys_outgoing = [] - mock_table.foreign_keys_incoming = [] - mock_introspector.get_table_metadata.return_value = mock_table - - # Mock visited tracker - mock_visited.is_visited.return_value = False - mock_visited.mark_visited.return_value = None - - # Mock fetch_record to return a valid record - def mock_fetch(record_id): - return RecordData( - identifier=record_id, - data={"id": record_id.pk_values[0]}, - ) - - traverser = RelationshipTraverser( - mock_conn, - mock_introspector, - mock_visited, - progress_callback=mock_callback, - ) - - # Patch _fetch_record method - mocker.patch.object(traverser, "_fetch_record", side_effect=mock_fetch) - - # Traverse a single record - traverser.traverse("users", "1", "public", max_depth=0) - - # Callback should be invoked at least once - assert mock_callback.called - mock_callback.assert_called_with(1) - - def test_progress_callback_receives_correct_count(self, mocker: MagicMock) -> None: - """Should pass accurate record count to callback.""" - mock_conn = MagicMock() - mock_introspector = MagicMock() - mock_visited = MagicMock() - mock_callback = MagicMock() - - # Mock table metadata with no relationships - mock_table = MagicMock() - mock_table.primary_keys = ["id"] - mock_table.foreign_keys_outgoing = [] - mock_table.foreign_keys_incoming = [] - mock_introspector.get_table_metadata.return_value = mock_table - - # Track visited records - visited_records = set() - - def is_visited(record_id): - return record_id in visited_records - - def mark_visited(record_id): - visited_records.add(record_id) - - mock_visited.is_visited.side_effect = is_visited - mock_visited.mark_visited.side_effect = mark_visited - - # Mock fetch_record - def mock_fetch(record_id): - return RecordData( - identifier=record_id, - data={"id": record_id.pk_values[0]}, - ) - - traverser = RelationshipTraverser( - mock_conn, - mock_introspector, - mock_visited, - progress_callback=mock_callback, - ) - - mocker.patch.object(traverser, "_fetch_record", side_effect=mock_fetch) - - # Traverse - traverser.traverse("users", "1", "public", max_depth=0) - - # Should be called with count 1 (only the starting record) - mock_callback.assert_called_with(1) - - def test_traverse_multiple_updates_progress(self, mocker: MagicMock) -> None: - """Should invoke callback when traversing multiple starting records.""" - mock_conn = MagicMock() - mock_introspector = MagicMock() - mock_visited = MagicMock() - mock_callback = MagicMock() - - # Mock table metadata - mock_table = MagicMock() - mock_table.primary_keys = ["id"] - mock_table.foreign_keys_outgoing = [] - mock_table.foreign_keys_incoming = [] - mock_introspector.get_table_metadata.return_value = mock_table - - # Track visited records to avoid duplicates - visited_records = set() - - def is_visited(record_id): - return record_id in visited_records - - def mark_visited(record_id): - visited_records.add(record_id) - - mock_visited.is_visited.side_effect = is_visited - mock_visited.mark_visited.side_effect = mark_visited - - # Mock fetch_record - def mock_fetch(record_id): - return RecordData( - identifier=record_id, - data={"id": record_id.pk_values[0]}, - ) - - traverser = RelationshipTraverser( - mock_conn, - mock_introspector, - mock_visited, - progress_callback=mock_callback, - ) - - mocker.patch.object(traverser, "_fetch_record", side_effect=mock_fetch) - - # Traverse multiple records - traverser.traverse_multiple("users", ["1", "2", "3"], "public", max_depth=0) - - # Should be called multiple times (once per record + final callback) - assert mock_callback.call_count >= 3 - # Final call should have count of 3 unique records - final_call_arg = mock_callback.call_args[0][0] - assert final_call_arg == 3 diff --git a/tests/unit/test_cli.py b/tests/unit/test_cli.py index 155a484..41142e3 100644 --- a/tests/unit/test_cli.py +++ b/tests/unit/test_cli.py @@ -320,7 +320,7 @@ def test_table_without_pks_or_timeframe_fails( "test", "--database", "test", - "--table", + "--dump", "users", ], ), @@ -360,7 +360,7 @@ def test_cli_dump_mode_executes(self) -> None: "test", "--database", "test", - "--table", + "--dump", "users", "--pks", "1", @@ -381,6 +381,7 @@ def test_cli_dump_mode_executes(self) -> None: mock_config.cache.enabled = False mock_config.connection_ttl_minutes = 30 mock_config.create_schema = False + mock_config.output_dir = Path("/tmp") mock_load.return_value = mock_config mock_cm_instance = MagicMock() @@ -390,6 +391,9 @@ def test_cli_dump_mode_executes(self) -> None: mock_service_instance.dump.return_value = mock_result mock_dump_service.return_value = mock_service_instance + # Mock get_default_output_path for auto-generated filename + mock_writer.get_default_output_path.return_value = Path("/tmp/test.sql") + exit_code = main() assert exit_code == 0 @@ -399,8 +403,8 @@ def test_cli_dump_mode_executes(self) -> None: assert call_kwargs["table"] == "users" assert call_kwargs["pk_values"] == ["1"] - # SQL should be written to stdout (no --output flag) - mock_writer.write_to_stdout.assert_called_once_with(mock_result.sql_content) + # SQL should be written to file (always writes to files now) + mock_writer.write_to_file.assert_called_once() def test_cli_dump_with_output_file(self, tmp_path: Path) -> None: """Should write to file when --output is specified.""" @@ -425,7 +429,7 @@ def test_cli_dump_with_output_file(self, tmp_path: Path) -> None: "test", "--database", "test", - "--table", + "--dump", "users", "--pks", "1", @@ -448,6 +452,7 @@ def test_cli_dump_with_output_file(self, tmp_path: Path) -> None: mock_config.cache.enabled = False mock_config.connection_ttl_minutes = 30 mock_config.create_schema = False + mock_config.output_dir = tmp_path mock_load.return_value = mock_config mock_cm_instance = MagicMock() @@ -487,7 +492,7 @@ def test_cli_dump_with_flags(self) -> None: "test", "--database", "test", - "--table", + "--dump", "users", "--pks", "1,2,3", @@ -502,7 +507,7 @@ def test_cli_dump_with_flags(self) -> None: patch("pgslice.cli.SecureCredentials"), patch("pgslice.cli.ConnectionManager") as mock_cm, patch("pgslice.cli.DumpService") as mock_dump_service, - patch("pgslice.cli.SQLWriter"), + patch("pgslice.cli.SQLWriter") as mock_writer, ): mock_config = MagicMock() mock_config.db.host = "localhost" @@ -513,6 +518,7 @@ def test_cli_dump_with_flags(self) -> None: mock_config.cache.enabled = False mock_config.connection_ttl_minutes = 30 mock_config.create_schema = False + mock_config.output_dir = Path("/tmp") mock_load.return_value = mock_config mock_cm_instance = MagicMock() @@ -522,6 +528,9 @@ def test_cli_dump_with_flags(self) -> None: mock_service_instance.dump.return_value = mock_result mock_dump_service.return_value = mock_service_instance + # Mock get_default_output_path for auto-generated filename + mock_writer.get_default_output_path.return_value = Path("/tmp/test.sql") + exit_code = main() assert exit_code == 0 @@ -596,7 +605,7 @@ def test_mutual_exclusion_with_pks(self) -> None: "argv", [ "pgslice", - "--table", + "--dump", "users", "--pks", "1", @@ -635,7 +644,7 @@ def test_timeframe_mode_executes(self) -> None: "test", "--database", "test", - "--table", + "--dump", "users", "--timeframe", "created_at:2024-01-01:2024-12-31", @@ -646,7 +655,7 @@ def test_timeframe_mode_executes(self) -> None: patch("pgslice.cli.ConnectionManager") as mock_cm, patch("pgslice.cli.SchemaIntrospector") as mock_introspector, patch("pgslice.cli.DumpService") as mock_dump_service, - patch("pgslice.cli.SQLWriter"), + patch("pgslice.cli.SQLWriter") as mock_writer, patch("pgslice.cli.printy"), ): mock_config = MagicMock() @@ -658,6 +667,7 @@ def test_timeframe_mode_executes(self) -> None: mock_config.cache.enabled = False mock_config.connection_ttl_minutes = 30 mock_config.create_schema = False + mock_config.output_dir = Path("/tmp") mock_load.return_value = mock_config mock_cm_instance = MagicMock() @@ -676,6 +686,9 @@ def test_timeframe_mode_executes(self) -> None: mock_service_instance.dump.return_value = mock_result mock_dump_service.return_value = mock_service_instance + # Mock get_default_output_path for auto-generated filename + mock_writer.get_default_output_path.return_value = Path("/tmp/test.sql") + exit_code = main() assert exit_code == 0 @@ -701,7 +714,7 @@ def test_timeframe_mode_empty_result(self) -> None: "test", "--database", "test", - "--table", + "--dump", "users", "--timeframe", "created_at:2024-01-01:2024-12-31", @@ -722,6 +735,7 @@ def test_timeframe_mode_empty_result(self) -> None: mock_config.cache.enabled = False mock_config.connection_ttl_minutes = 30 mock_config.create_schema = False + mock_config.output_dir = Path("/tmp") mock_load.return_value = mock_config mock_cm_instance = MagicMock() From 350967cec12676da5a629ee29552b602b2037a09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgardo=20Obreg=C3=B3n?= Date: Mon, 29 Dec 2025 08:46:40 -0500 Subject: [PATCH 3/3] docs: update changelog --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c41c9d3..3e05084 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.2.1] - 2025-12-29 + +### Fixed +- Docker volume permission issues with dedicated entrypoint script + +### Changed +- Optimized graph traversal performance using batch queries for relationship lookups + ## [0.2.0] - 2025-12-28 ### Added