I don't have an independent reproduction yet (though make test in [1] should reproduce this). I haven't actually been able to reproduce by hand yet, but pgtap has something to do with this. This is affecting at least 9.4 and a fairly recent HEAD.

-- Bits from top of test/sql/base.sql
\i test/helpers/setup.sql

SET ROLE = DEFAULT;
CREATE ROLE test_role;
GRANT USAGE ON SCHEMA tap TO test_role;
GRANT test_role TO test_factory__owner;

CREATE SCHEMA test AUTHORIZATION test_role;
SET ROLE = test_role;
SET search_path = test, tap;
\i test/helpers/create.sql

SELECT tf.register(
  'customer'
  , array[
    row(
      'insert'
, $$INSERT INTO customer VALUES (DEFAULT, 'first', 'last' ) RETURNING *$$
    )::tf.test_set
    , row(
      'function'
      , $$SELECT * FROM customer__add( 'func first', 'func last' )$$
    )::tf.test_set
  ]
);
SELECT tf.register(
  'invoice'
  , array[
      row(
        'base'
        , $$INSERT INTO invoice VALUES(
            DEFAULT
            , (tf.get( NULL::customer, 'insert' )).customer_id
            , current_date
            , current_date + 30
          ) RETURNING *$$
      )::tf.test_set
  ]
);
SELECT no_plan();
SELECT lives_ok($$SELECT * FROM tf.get( NULL::invoice, 'base' )$$);
not ok 1
# Failed test 1
#         died: 42703: column "c_data_table_name" does not exist


-- Ok, got an error, but no crash. But now...

SELECT results_eq(
  $$SELECT * FROM tf.get( NULL::invoice, 'base' )$$
  , $$VALUES( 1, 1, current_date, current_date + 30 )$$
  , 'invoice factory output'
);
server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.

lives_ok() and results_eq() are both pgTap functions. Definitions at [2] and [3].

I've attached a full server log from running make test, but the most relevant bit is below:

DEBUG:  AbortSubTransaction
CONTEXT: PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 during exception cleanup
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG: name: unnamed; blockState: INPROGRESS; state: INPROGR, xid/subid/cid: 1980/1/979, nestlvl: 1, children: 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 CONTEXT: PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 during exception cleanup
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG: name: pg_psql_temporary_savepoint; blockState: SUB INPROGRS; state: INPROGR, xid/subid/cid: 2000/34/979, nestlvl: 2, children: CONTEXT: PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 during exception cleanup
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG: name: unnamed; blockState: SUB INPROGRS; state: INPROGR, xid/subid/cid: 2001/35/979, nestlvl: 3, children: CONTEXT: PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 during exception cleanup
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
TRAP: FailedAssertion("!(rebuild ? !((bool)((relation)->rd_refcnt == 0)) : ((bool)((relation)->rd_refcnt == 0)))", File: "relcache.c", Line: 2055)

[1] https://github.com/BlueTreble/test_factory/tree/crash
[2] https://github.com/theory/pgtap/blob/master/sql/pgtap.sql.in#L746
[3] https://github.com/theory/pgtap/blob/master/sql/pgtap.sql.in#L6541 which is being called by https://github.com/theory/pgtap/blob/master/sql/pgtap.sql.in#L6591
--
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com
DEBUG:  CommitTransactionCommand
DEBUG:  StartTransactionCommand
DEBUG:  ProcessUtility
DEBUG:  CommitTransactionCommand
DEBUG:  CommitSubTransaction
DEBUG:  name: unnamed; blockState:    INPROGRESS; state: INPROGR, 
xid/subid/cid: 1980/1/968, nestlvl: 1, children: 1981 1982 1983 1984 1985 1986 
1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999
DEBUG:  name: pg_psql_temporary_savepoint; blockState:   SUB RELEASE; state: 
INPROGR, xid/subid/cid: 0/32/968, nestlvl: 2, children: 
DEBUG:  StartTransactionCommand
DEBUG:  ProcessUtility
DEBUG:  CommitTransactionCommand
DEBUG:  StartSubTransaction
DEBUG:  name: unnamed; blockState:    INPROGRESS; state: INPROGR, 
xid/subid/cid: 1980/1/968, nestlvl: 1, children: 1981 1982 1983 1984 1985 1986 
1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999
DEBUG:  name: pg_psql_temporary_savepoint; blockState:     SUB BEGIN; state: 
INPROGR, xid/subid/cid: 0/33/968, nestlvl: 2, children: 
DEBUG:  StartTransactionCommand
DEBUG:  ProcessUtility
DEBUG:  CommitTransactionCommand
DEBUG:  StartTransactionCommand
DEBUG:  ProcessUtility
DEBUG:  CommitTransactionCommand
DEBUG:  CommitSubTransaction
DEBUG:  name: unnamed; blockState:    INPROGRESS; state: INPROGR, 
xid/subid/cid: 1980/1/968, nestlvl: 1, children: 1981 1982 1983 1984 1985 1986 
1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999
DEBUG:  name: pg_psql_temporary_savepoint; blockState:   SUB RELEASE; state: 
INPROGR, xid/subid/cid: 0/33/968, nestlvl: 2, children: 
DEBUG:  StartTransactionCommand
DEBUG:  ProcessUtility
DEBUG:  CommitTransactionCommand
DEBUG:  StartSubTransaction
DEBUG:  name: unnamed; blockState:    INPROGRESS; state: INPROGR, 
xid/subid/cid: 1980/1/968, nestlvl: 1, children: 1981 1982 1983 1984 1985 1986 
1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999
DEBUG:  name: pg_psql_temporary_savepoint; blockState:     SUB BEGIN; state: 
INPROGR, xid/subid/cid: 0/34/968, nestlvl: 2, children: 
DEBUG:  StartTransactionCommand
DEBUG:  StartSubTransaction
CONTEXT:  PL/pgSQL function results_eq(refcursor,refcursor,text) line 10 during 
statement block entry
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:    INPROGRESS; state: INPROGR, 
xid/subid/cid: 1980/1/968, nestlvl: 1, children: 1981 1982 1983 1984 1985 1986 
1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999
CONTEXT:  PL/pgSQL function results_eq(refcursor,refcursor,text) line 10 during 
statement block entry
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: pg_psql_temporary_savepoint; blockState:  SUB INPROGRS; state: 
INPROGR, xid/subid/cid: 0/34/968, nestlvl: 2, children: 
CONTEXT:  PL/pgSQL function results_eq(refcursor,refcursor,text) line 10 during 
statement block entry
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:     SUB BEGIN; state: INPROGR, 
xid/subid/cid: 0/35/968, nestlvl: 3, children: 
CONTEXT:  PL/pgSQL function results_eq(refcursor,refcursor,text) line 10 during 
statement block entry
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  StartSubTransaction
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block entry
        SQL statement "SELECT
              -- Get a fixed-width representation of ID. btrim shouldn't be 
necessary but it is
              '_' || btrim( to_char(
                factory_id
                -- Get a string of 0's long enough to hold a max-sized int
                , repeat( '0', length( (2^31-1)::int::text ) )
              ) )
              , c.relname
                                                     FROM 
_tf.test_factory__get( table_name, set_name ) f
              JOIN pg_class c ON c.oid = f.table_oid
              JOIN pg_namespace n ON n.oid = c.relnamespace"
        PL/pgSQL function _tf.data_table_name(text,text) line 8 at SQL statement
        PL/pgSQL function tf.get(anyelement,text) line 5 during statement block 
local variable initialization
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:    INPROGRESS; state: INPROGR, 
xid/subid/cid: 1980/1/968, nestlvl: 1, children: 1981 1982 1983 1984 1985 1986 
1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block entry
        SQL statement "SELECT
              -- Get a fixed-width representation of ID. btrim shouldn't be 
necessary but it is
              '_' || btrim( to_char(
                factory_id
                -- Get a string of 0's long enough to hold a max-sized int
                , repeat( '0', length( (2^31-1)::int::text ) )
              ) )
              , c.relname
                                                     FROM 
_tf.test_factory__get( table_name, set_name ) f
              JOIN pg_class c ON c.oid = f.table_oid
              JOIN pg_namespace n ON n.oid = c.relnamespace"
        PL/pgSQL function _tf.data_table_name(text,text) line 8 at SQL statement
        PL/pgSQL function tf.get(anyelement,text) line 5 during statement block 
local variable initialization
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: pg_psql_temporary_savepoint; blockState:  SUB INPROGRS; state: 
INPROGR, xid/subid/cid: 0/34/968, nestlvl: 2, children: 
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block entry
        SQL statement "SELECT
              -- Get a fixed-width representation of ID. btrim shouldn't be 
necessary but it is
              '_' || btrim( to_char(
                factory_id
                -- Get a string of 0's long enough to hold a max-sized int
                , repeat( '0', length( (2^31-1)::int::text ) )
              ) )
              , c.relname
                                                     FROM 
_tf.test_factory__get( table_name, set_name ) f
              JOIN pg_class c ON c.oid = f.table_oid
              JOIN pg_namespace n ON n.oid = c.relnamespace"
        PL/pgSQL function _tf.data_table_name(text,text) line 8 at SQL statement
        PL/pgSQL function tf.get(anyelement,text) line 5 during statement block 
local variable initialization
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:  SUB INPROGRS; state: INPROGR, 
xid/subid/cid: 0/35/968, nestlvl: 3, children: 
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block entry
        SQL statement "SELECT
              -- Get a fixed-width representation of ID. btrim shouldn't be 
necessary but it is
              '_' || btrim( to_char(
                factory_id
                -- Get a string of 0's long enough to hold a max-sized int
                , repeat( '0', length( (2^31-1)::int::text ) )
              ) )
              , c.relname
                                                     FROM 
_tf.test_factory__get( table_name, set_name ) f
              JOIN pg_class c ON c.oid = f.table_oid
              JOIN pg_namespace n ON n.oid = c.relnamespace"
        PL/pgSQL function _tf.data_table_name(text,text) line 8 at SQL statement
        PL/pgSQL function tf.get(anyelement,text) line 5 during statement block 
local variable initialization
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:     SUB BEGIN; state: INPROGR, 
xid/subid/cid: 0/36/968, nestlvl: 4, children: 
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block entry
        SQL statement "SELECT
              -- Get a fixed-width representation of ID. btrim shouldn't be 
necessary but it is
              '_' || btrim( to_char(
                factory_id
                -- Get a string of 0's long enough to hold a max-sized int
                , repeat( '0', length( (2^31-1)::int::text ) )
              ) )
              , c.relname
                                                     FROM 
_tf.test_factory__get( table_name, set_name ) f
              JOIN pg_class c ON c.oid = f.table_oid
              JOIN pg_namespace n ON n.oid = c.relnamespace"
        PL/pgSQL function _tf.data_table_name(text,text) line 8 at SQL statement
        PL/pgSQL function tf.get(anyelement,text) line 5 during statement block 
local variable initialization
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  CommitSubTransaction
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block exit
        SQL statement "SELECT
              -- Get a fixed-width representation of ID. btrim shouldn't be 
necessary but it is
              '_' || btrim( to_char(
                factory_id
                -- Get a string of 0's long enough to hold a max-sized int
                , repeat( '0', length( (2^31-1)::int::text ) )
              ) )
              , c.relname
                                                     FROM 
_tf.test_factory__get( table_name, set_name ) f
              JOIN pg_class c ON c.oid = f.table_oid
              JOIN pg_namespace n ON n.oid = c.relnamespace"
        PL/pgSQL function _tf.data_table_name(text,text) line 8 at SQL statement
        PL/pgSQL function tf.get(anyelement,text) line 5 during statement block 
local variable initialization
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:    INPROGRESS; state: INPROGR, 
xid/subid/cid: 1980/1/968, nestlvl: 1, children: 1981 1982 1983 1984 1985 1986 
1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block exit
        SQL statement "SELECT
              -- Get a fixed-width representation of ID. btrim shouldn't be 
necessary but it is
              '_' || btrim( to_char(
                factory_id
                -- Get a string of 0's long enough to hold a max-sized int
                , repeat( '0', length( (2^31-1)::int::text ) )
              ) )
              , c.relname
                                                     FROM 
_tf.test_factory__get( table_name, set_name ) f
              JOIN pg_class c ON c.oid = f.table_oid
              JOIN pg_namespace n ON n.oid = c.relnamespace"
        PL/pgSQL function _tf.data_table_name(text,text) line 8 at SQL statement
        PL/pgSQL function tf.get(anyelement,text) line 5 during statement block 
local variable initialization
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: pg_psql_temporary_savepoint; blockState:  SUB INPROGRS; state: 
INPROGR, xid/subid/cid: 0/34/968, nestlvl: 2, children: 
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block exit
        SQL statement "SELECT
              -- Get a fixed-width representation of ID. btrim shouldn't be 
necessary but it is
              '_' || btrim( to_char(
                factory_id
                -- Get a string of 0's long enough to hold a max-sized int
                , repeat( '0', length( (2^31-1)::int::text ) )
              ) )
              , c.relname
                                                     FROM 
_tf.test_factory__get( table_name, set_name ) f
              JOIN pg_class c ON c.oid = f.table_oid
              JOIN pg_namespace n ON n.oid = c.relnamespace"
        PL/pgSQL function _tf.data_table_name(text,text) line 8 at SQL statement
        PL/pgSQL function tf.get(anyelement,text) line 5 during statement block 
local variable initialization
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:  SUB INPROGRS; state: INPROGR, 
xid/subid/cid: 0/35/968, nestlvl: 3, children: 
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block exit
        SQL statement "SELECT
              -- Get a fixed-width representation of ID. btrim shouldn't be 
necessary but it is
              '_' || btrim( to_char(
                factory_id
                -- Get a string of 0's long enough to hold a max-sized int
                , repeat( '0', length( (2^31-1)::int::text ) )
              ) )
              , c.relname
                                                     FROM 
_tf.test_factory__get( table_name, set_name ) f
              JOIN pg_class c ON c.oid = f.table_oid
              JOIN pg_namespace n ON n.oid = c.relnamespace"
        PL/pgSQL function _tf.data_table_name(text,text) line 8 at SQL statement
        PL/pgSQL function tf.get(anyelement,text) line 5 during statement block 
local variable initialization
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:  SUB INPROGRS; state: INPROGR, 
xid/subid/cid: 0/36/968, nestlvl: 4, children: 
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block exit
        SQL statement "SELECT
              -- Get a fixed-width representation of ID. btrim shouldn't be 
necessary but it is
              '_' || btrim( to_char(
                factory_id
                -- Get a string of 0's long enough to hold a max-sized int
                , repeat( '0', length( (2^31-1)::int::text ) )
              ) )
              , c.relname
                                                     FROM 
_tf.test_factory__get( table_name, set_name ) f
              JOIN pg_class c ON c.oid = f.table_oid
              JOIN pg_namespace n ON n.oid = c.relnamespace"
        PL/pgSQL function _tf.data_table_name(text,text) line 8 at SQL statement
        PL/pgSQL function tf.get(anyelement,text) line 5 during statement block 
local variable initialization
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  StartSubTransaction
CONTEXT:  PL/pgSQL function tf.get(anyelement,text) line 5 during statement 
block entry
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:    INPROGRESS; state: INPROGR, 
xid/subid/cid: 1980/1/968, nestlvl: 1, children: 1981 1982 1983 1984 1985 1986 
1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999
CONTEXT:  PL/pgSQL function tf.get(anyelement,text) line 5 during statement 
block entry
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: pg_psql_temporary_savepoint; blockState:  SUB INPROGRS; state: 
INPROGR, xid/subid/cid: 0/34/968, nestlvl: 2, children: 
CONTEXT:  PL/pgSQL function tf.get(anyelement,text) line 5 during statement 
block entry
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:  SUB INPROGRS; state: INPROGR, 
xid/subid/cid: 0/35/968, nestlvl: 3, children: 
CONTEXT:  PL/pgSQL function tf.get(anyelement,text) line 5 during statement 
block entry
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:     SUB BEGIN; state: INPROGR, 
xid/subid/cid: 0/37/968, nestlvl: 4, children: 
CONTEXT:  PL/pgSQL function tf.get(anyelement,text) line 5 during statement 
block entry
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  StartSubTransaction
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block entry
        SQL statement "SELECT
              -- Get a fixed-width representation of ID. btrim shouldn't be 
necessary but it is
              '_' || btrim( to_char(
                factory_id
                -- Get a string of 0's long enough to hold a max-sized int
                , repeat( '0', length( (2^31-1)::int::text ) )
              ) )
              , c.relname
                                                     FROM 
_tf.test_factory__get( table_name, set_name ) f
              JOIN pg_class c ON c.oid = f.table_oid
              JOIN pg_namespace n ON n.oid = c.relnamespace"
        PL/pgSQL function _tf.data_table_name(text,text) line 8 at SQL statement
        PL/pgSQL function _tf.get(anyelement,text) line 9 during statement 
block local variable initialization
        PL/pgSQL function tf.get(anyelement,text) line 6 at RETURN QUERY
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:    INPROGRESS; state: INPROGR, 
xid/subid/cid: 1980/1/968, nestlvl: 1, children: 1981 1982 1983 1984 1985 1986 
1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block entry
        SQL statement "SELECT
              -- Get a fixed-width representation of ID. btrim shouldn't be 
necessary but it is
              '_' || btrim( to_char(
                factory_id
                -- Get a string of 0's long enough to hold a max-sized int
                , repeat( '0', length( (2^31-1)::int::text ) )
              ) )
              , c.relname
                                                     FROM 
_tf.test_factory__get( table_name, set_name ) f
              JOIN pg_class c ON c.oid = f.table_oid
              JOIN pg_namespace n ON n.oid = c.relnamespace"
        PL/pgSQL function _tf.data_table_name(text,text) line 8 at SQL statement
        PL/pgSQL function _tf.get(anyelement,text) line 9 during statement 
block local variable initialization
        PL/pgSQL function tf.get(anyelement,text) line 6 at RETURN QUERY
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: pg_psql_temporary_savepoint; blockState:  SUB INPROGRS; state: 
INPROGR, xid/subid/cid: 0/34/968, nestlvl: 2, children: 
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block entry
        SQL statement "SELECT
              -- Get a fixed-width representation of ID. btrim shouldn't be 
necessary but it is
              '_' || btrim( to_char(
                factory_id
                -- Get a string of 0's long enough to hold a max-sized int
                , repeat( '0', length( (2^31-1)::int::text ) )
              ) )
              , c.relname
                                                     FROM 
_tf.test_factory__get( table_name, set_name ) f
              JOIN pg_class c ON c.oid = f.table_oid
              JOIN pg_namespace n ON n.oid = c.relnamespace"
        PL/pgSQL function _tf.data_table_name(text,text) line 8 at SQL statement
        PL/pgSQL function _tf.get(anyelement,text) line 9 during statement 
block local variable initialization
        PL/pgSQL function tf.get(anyelement,text) line 6 at RETURN QUERY
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:  SUB INPROGRS; state: INPROGR, 
xid/subid/cid: 0/35/968, nestlvl: 3, children: 
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block entry
        SQL statement "SELECT
              -- Get a fixed-width representation of ID. btrim shouldn't be 
necessary but it is
              '_' || btrim( to_char(
                factory_id
                -- Get a string of 0's long enough to hold a max-sized int
                , repeat( '0', length( (2^31-1)::int::text ) )
              ) )
              , c.relname
                                                     FROM 
_tf.test_factory__get( table_name, set_name ) f
              JOIN pg_class c ON c.oid = f.table_oid
              JOIN pg_namespace n ON n.oid = c.relnamespace"
        PL/pgSQL function _tf.data_table_name(text,text) line 8 at SQL statement
        PL/pgSQL function _tf.get(anyelement,text) line 9 during statement 
block local variable initialization
        PL/pgSQL function tf.get(anyelement,text) line 6 at RETURN QUERY
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:  SUB INPROGRS; state: INPROGR, 
xid/subid/cid: 0/37/968, nestlvl: 4, children: 
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block entry
        SQL statement "SELECT
              -- Get a fixed-width representation of ID. btrim shouldn't be 
necessary but it is
              '_' || btrim( to_char(
                factory_id
                -- Get a string of 0's long enough to hold a max-sized int
                , repeat( '0', length( (2^31-1)::int::text ) )
              ) )
              , c.relname
                                                     FROM 
_tf.test_factory__get( table_name, set_name ) f
              JOIN pg_class c ON c.oid = f.table_oid
              JOIN pg_namespace n ON n.oid = c.relnamespace"
        PL/pgSQL function _tf.data_table_name(text,text) line 8 at SQL statement
        PL/pgSQL function _tf.get(anyelement,text) line 9 during statement 
block local variable initialization
        PL/pgSQL function tf.get(anyelement,text) line 6 at RETURN QUERY
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:     SUB BEGIN; state: INPROGR, 
xid/subid/cid: 0/38/968, nestlvl: 5, children: 
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block entry
        SQL statement "SELECT
              -- Get a fixed-width representation of ID. btrim shouldn't be 
necessary but it is
              '_' || btrim( to_char(
                factory_id
                -- Get a string of 0's long enough to hold a max-sized int
                , repeat( '0', length( (2^31-1)::int::text ) )
              ) )
              , c.relname
                                                     FROM 
_tf.test_factory__get( table_name, set_name ) f
              JOIN pg_class c ON c.oid = f.table_oid
              JOIN pg_namespace n ON n.oid = c.relnamespace"
        PL/pgSQL function _tf.data_table_name(text,text) line 8 at SQL statement
        PL/pgSQL function _tf.get(anyelement,text) line 9 during statement 
block local variable initialization
        PL/pgSQL function tf.get(anyelement,text) line 6 at RETURN QUERY
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  CommitSubTransaction
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block exit
        SQL statement "SELECT
              -- Get a fixed-width representation of ID. btrim shouldn't be 
necessary but it is
              '_' || btrim( to_char(
                factory_id
                -- Get a string of 0's long enough to hold a max-sized int
                , repeat( '0', length( (2^31-1)::int::text ) )
              ) )
              , c.relname
                                                     FROM 
_tf.test_factory__get( table_name, set_name ) f
              JOIN pg_class c ON c.oid = f.table_oid
              JOIN pg_namespace n ON n.oid = c.relnamespace"
        PL/pgSQL function _tf.data_table_name(text,text) line 8 at SQL statement
        PL/pgSQL function _tf.get(anyelement,text) line 9 during statement 
block local variable initialization
        PL/pgSQL function tf.get(anyelement,text) line 6 at RETURN QUERY
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:    INPROGRESS; state: INPROGR, 
xid/subid/cid: 1980/1/968, nestlvl: 1, children: 1981 1982 1983 1984 1985 1986 
1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block exit
        SQL statement "SELECT
              -- Get a fixed-width representation of ID. btrim shouldn't be 
necessary but it is
              '_' || btrim( to_char(
                factory_id
                -- Get a string of 0's long enough to hold a max-sized int
                , repeat( '0', length( (2^31-1)::int::text ) )
              ) )
              , c.relname
                                                     FROM 
_tf.test_factory__get( table_name, set_name ) f
              JOIN pg_class c ON c.oid = f.table_oid
              JOIN pg_namespace n ON n.oid = c.relnamespace"
        PL/pgSQL function _tf.data_table_name(text,text) line 8 at SQL statement
        PL/pgSQL function _tf.get(anyelement,text) line 9 during statement 
block local variable initialization
        PL/pgSQL function tf.get(anyelement,text) line 6 at RETURN QUERY
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: pg_psql_temporary_savepoint; blockState:  SUB INPROGRS; state: 
INPROGR, xid/subid/cid: 0/34/968, nestlvl: 2, children: 
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block exit
        SQL statement "SELECT
              -- Get a fixed-width representation of ID. btrim shouldn't be 
necessary but it is
              '_' || btrim( to_char(
                factory_id
                -- Get a string of 0's long enough to hold a max-sized int
                , repeat( '0', length( (2^31-1)::int::text ) )
              ) )
              , c.relname
                                                     FROM 
_tf.test_factory__get( table_name, set_name ) f
              JOIN pg_class c ON c.oid = f.table_oid
              JOIN pg_namespace n ON n.oid = c.relnamespace"
        PL/pgSQL function _tf.data_table_name(text,text) line 8 at SQL statement
        PL/pgSQL function _tf.get(anyelement,text) line 9 during statement 
block local variable initialization
        PL/pgSQL function tf.get(anyelement,text) line 6 at RETURN QUERY
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:  SUB INPROGRS; state: INPROGR, 
xid/subid/cid: 0/35/968, nestlvl: 3, children: 
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block exit
        SQL statement "SELECT
              -- Get a fixed-width representation of ID. btrim shouldn't be 
necessary but it is
              '_' || btrim( to_char(
                factory_id
                -- Get a string of 0's long enough to hold a max-sized int
                , repeat( '0', length( (2^31-1)::int::text ) )
              ) )
              , c.relname
                                                     FROM 
_tf.test_factory__get( table_name, set_name ) f
              JOIN pg_class c ON c.oid = f.table_oid
              JOIN pg_namespace n ON n.oid = c.relnamespace"
        PL/pgSQL function _tf.data_table_name(text,text) line 8 at SQL statement
        PL/pgSQL function _tf.get(anyelement,text) line 9 during statement 
block local variable initialization
        PL/pgSQL function tf.get(anyelement,text) line 6 at RETURN QUERY
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:  SUB INPROGRS; state: INPROGR, 
xid/subid/cid: 0/37/968, nestlvl: 4, children: 
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block exit
        SQL statement "SELECT
              -- Get a fixed-width representation of ID. btrim shouldn't be 
necessary but it is
              '_' || btrim( to_char(
                factory_id
                -- Get a string of 0's long enough to hold a max-sized int
                , repeat( '0', length( (2^31-1)::int::text ) )
              ) )
              , c.relname
                                                     FROM 
_tf.test_factory__get( table_name, set_name ) f
              JOIN pg_class c ON c.oid = f.table_oid
              JOIN pg_namespace n ON n.oid = c.relnamespace"
        PL/pgSQL function _tf.data_table_name(text,text) line 8 at SQL statement
        PL/pgSQL function _tf.get(anyelement,text) line 9 during statement 
block local variable initialization
        PL/pgSQL function tf.get(anyelement,text) line 6 at RETURN QUERY
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:  SUB INPROGRS; state: INPROGR, 
xid/subid/cid: 0/38/968, nestlvl: 5, children: 
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block exit
        SQL statement "SELECT
              -- Get a fixed-width representation of ID. btrim shouldn't be 
necessary but it is
              '_' || btrim( to_char(
                factory_id
                -- Get a string of 0's long enough to hold a max-sized int
                , repeat( '0', length( (2^31-1)::int::text ) )
              ) )
              , c.relname
                                                     FROM 
_tf.test_factory__get( table_name, set_name ) f
              JOIN pg_class c ON c.oid = f.table_oid
              JOIN pg_namespace n ON n.oid = c.relnamespace"
        PL/pgSQL function _tf.data_table_name(text,text) line 8 at SQL statement
        PL/pgSQL function _tf.get(anyelement,text) line 9 during statement 
block local variable initialization
        PL/pgSQL function tf.get(anyelement,text) line 6 at RETURN QUERY
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  sql = SELECT * FROM _test_data.invoice_0000000003 AS t
CONTEXT:  PL/pgSQL function tf.get(anyelement,text) line 6 at RETURN QUERY
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  AbortSubTransaction
CONTEXT:  PL/pgSQL function tf.get(anyelement,text) line 6 during exception 
cleanup
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:    INPROGRESS; state: INPROGR, 
xid/subid/cid: 1980/1/969, nestlvl: 1, children: 1981 1982 1983 1984 1985 1986 
1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999
CONTEXT:  PL/pgSQL function tf.get(anyelement,text) line 6 during exception 
cleanup
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: pg_psql_temporary_savepoint; blockState:  SUB INPROGRS; state: 
INPROGR, xid/subid/cid: 2000/34/969, nestlvl: 2, children: 
CONTEXT:  PL/pgSQL function tf.get(anyelement,text) line 6 during exception 
cleanup
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:  SUB INPROGRS; state: INPROGR, 
xid/subid/cid: 2001/35/969, nestlvl: 3, children: 
CONTEXT:  PL/pgSQL function tf.get(anyelement,text) line 6 during exception 
cleanup
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:  SUB INPROGRS; state: INPROGR, 
xid/subid/cid: 2002/37/969, nestlvl: 4, children: 
CONTEXT:  PL/pgSQL function tf.get(anyelement,text) line 6 during exception 
cleanup
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  CleanupSubTransaction
CONTEXT:  PL/pgSQL function tf.get(anyelement,text) line 6 during exception 
cleanup
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:    INPROGRESS; state: INPROGR, 
xid/subid/cid: 1980/1/969, nestlvl: 1, children: 1981 1982 1983 1984 1985 1986 
1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999
CONTEXT:  PL/pgSQL function tf.get(anyelement,text) line 6 during exception 
cleanup
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: pg_psql_temporary_savepoint; blockState:  SUB INPROGRS; state: 
INPROGR, xid/subid/cid: 2000/34/969, nestlvl: 2, children: 
CONTEXT:  PL/pgSQL function tf.get(anyelement,text) line 6 during exception 
cleanup
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:  SUB INPROGRS; state: INPROGR, 
xid/subid/cid: 2001/35/969, nestlvl: 3, children: 
CONTEXT:  PL/pgSQL function tf.get(anyelement,text) line 6 during exception 
cleanup
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:  SUB INPROGRS; state:   ABORT, 
xid/subid/cid: 2002/37/969, nestlvl: 4, children: 
CONTEXT:  PL/pgSQL function tf.get(anyelement,text) line 6 during exception 
cleanup
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  StartSubTransaction
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block entry
        SQL statement "SELECT format(
                    $$
        CREATE TEMP TABLE %I ON COMMIT DROP AS
        WITH i AS (
              %s
            )
          SELECT *
            FROM i
        $$
                    , c_data_table_name
                    , factory.insert_sql
                  )
                                        FROM _tf.test_factory__get( 
c_table_name, set_name ) factory"
        PL/pgSQL function tf.get(anyelement,text) line 13 at SQL statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:    INPROGRESS; state: INPROGR, 
xid/subid/cid: 1980/1/969, nestlvl: 1, children: 1981 1982 1983 1984 1985 1986 
1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block entry
        SQL statement "SELECT format(
                    $$
        CREATE TEMP TABLE %I ON COMMIT DROP AS
        WITH i AS (
              %s
            )
          SELECT *
            FROM i
        $$
                    , c_data_table_name
                    , factory.insert_sql
                  )
                                        FROM _tf.test_factory__get( 
c_table_name, set_name ) factory"
        PL/pgSQL function tf.get(anyelement,text) line 13 at SQL statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: pg_psql_temporary_savepoint; blockState:  SUB INPROGRS; state: 
INPROGR, xid/subid/cid: 2000/34/969, nestlvl: 2, children: 
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block entry
        SQL statement "SELECT format(
                    $$
        CREATE TEMP TABLE %I ON COMMIT DROP AS
        WITH i AS (
              %s
            )
          SELECT *
            FROM i
        $$
                    , c_data_table_name
                    , factory.insert_sql
                  )
                                        FROM _tf.test_factory__get( 
c_table_name, set_name ) factory"
        PL/pgSQL function tf.get(anyelement,text) line 13 at SQL statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:  SUB INPROGRS; state: INPROGR, 
xid/subid/cid: 2001/35/969, nestlvl: 3, children: 
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block entry
        SQL statement "SELECT format(
                    $$
        CREATE TEMP TABLE %I ON COMMIT DROP AS
        WITH i AS (
              %s
            )
          SELECT *
            FROM i
        $$
                    , c_data_table_name
                    , factory.insert_sql
                  )
                                        FROM _tf.test_factory__get( 
c_table_name, set_name ) factory"
        PL/pgSQL function tf.get(anyelement,text) line 13 at SQL statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:     SUB BEGIN; state: INPROGR, 
xid/subid/cid: 0/39/969, nestlvl: 4, children: 
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block entry
        SQL statement "SELECT format(
                    $$
        CREATE TEMP TABLE %I ON COMMIT DROP AS
        WITH i AS (
              %s
            )
          SELECT *
            FROM i
        $$
                    , c_data_table_name
                    , factory.insert_sql
                  )
                                        FROM _tf.test_factory__get( 
c_table_name, set_name ) factory"
        PL/pgSQL function tf.get(anyelement,text) line 13 at SQL statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  CommitSubTransaction
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block exit
        SQL statement "SELECT format(
                    $$
        CREATE TEMP TABLE %I ON COMMIT DROP AS
        WITH i AS (
              %s
            )
          SELECT *
            FROM i
        $$
                    , c_data_table_name
                    , factory.insert_sql
                  )
                                        FROM _tf.test_factory__get( 
c_table_name, set_name ) factory"
        PL/pgSQL function tf.get(anyelement,text) line 13 at SQL statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:    INPROGRESS; state: INPROGR, 
xid/subid/cid: 1980/1/969, nestlvl: 1, children: 1981 1982 1983 1984 1985 1986 
1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block exit
        SQL statement "SELECT format(
                    $$
        CREATE TEMP TABLE %I ON COMMIT DROP AS
        WITH i AS (
              %s
            )
          SELECT *
            FROM i
        $$
                    , c_data_table_name
                    , factory.insert_sql
                  )
                                        FROM _tf.test_factory__get( 
c_table_name, set_name ) factory"
        PL/pgSQL function tf.get(anyelement,text) line 13 at SQL statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: pg_psql_temporary_savepoint; blockState:  SUB INPROGRS; state: 
INPROGR, xid/subid/cid: 2000/34/969, nestlvl: 2, children: 
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block exit
        SQL statement "SELECT format(
                    $$
        CREATE TEMP TABLE %I ON COMMIT DROP AS
        WITH i AS (
              %s
            )
          SELECT *
            FROM i
        $$
                    , c_data_table_name
                    , factory.insert_sql
                  )
                                        FROM _tf.test_factory__get( 
c_table_name, set_name ) factory"
        PL/pgSQL function tf.get(anyelement,text) line 13 at SQL statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:  SUB INPROGRS; state: INPROGR, 
xid/subid/cid: 2001/35/969, nestlvl: 3, children: 
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block exit
        SQL statement "SELECT format(
                    $$
        CREATE TEMP TABLE %I ON COMMIT DROP AS
        WITH i AS (
              %s
            )
          SELECT *
            FROM i
        $$
                    , c_data_table_name
                    , factory.insert_sql
                  )
                                        FROM _tf.test_factory__get( 
c_table_name, set_name ) factory"
        PL/pgSQL function tf.get(anyelement,text) line 13 at SQL statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:  SUB INPROGRS; state: INPROGR, 
xid/subid/cid: 0/39/969, nestlvl: 4, children: 
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block exit
        SQL statement "SELECT format(
                    $$
        CREATE TEMP TABLE %I ON COMMIT DROP AS
        WITH i AS (
              %s
            )
          SELECT *
            FROM i
        $$
                    , c_data_table_name
                    , factory.insert_sql
                  )
                                        FROM _tf.test_factory__get( 
c_table_name, set_name ) factory"
        PL/pgSQL function tf.get(anyelement,text) line 13 at SQL statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  sql = 
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        
CONTEXT:  PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at 
FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  StartSubTransaction
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block entry
        SQL statement "SELECT
              -- Get a fixed-width representation of ID. btrim shouldn't be 
necessary but it is
              '_' || btrim( to_char(
                factory_id
                -- Get a string of 0's long enough to hold a max-sized int
                , repeat( '0', length( (2^31-1)::int::text ) )
              ) )
              , c.relname
                                                     FROM 
_tf.test_factory__get( table_name, set_name ) f
              JOIN pg_class c ON c.oid = f.table_oid
              JOIN pg_namespace n ON n.oid = c.relnamespace"
        PL/pgSQL function _tf.data_table_name(text,text) line 8 at SQL statement
        PL/pgSQL function tf.get(anyelement,text) line 5 during statement block 
local variable initialization
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:    INPROGRESS; state: INPROGR, 
xid/subid/cid: 1980/1/971, nestlvl: 1, children: 1981 1982 1983 1984 1985 1986 
1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block entry
        SQL statement "SELECT
              -- Get a fixed-width representation of ID. btrim shouldn't be 
necessary but it is
              '_' || btrim( to_char(
                factory_id
                -- Get a string of 0's long enough to hold a max-sized int
                , repeat( '0', length( (2^31-1)::int::text ) )
              ) )
              , c.relname
                                                     FROM 
_tf.test_factory__get( table_name, set_name ) f
              JOIN pg_class c ON c.oid = f.table_oid
              JOIN pg_namespace n ON n.oid = c.relnamespace"
        PL/pgSQL function _tf.data_table_name(text,text) line 8 at SQL statement
        PL/pgSQL function tf.get(anyelement,text) line 5 during statement block 
local variable initialization
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: pg_psql_temporary_savepoint; blockState:  SUB INPROGRS; state: 
INPROGR, xid/subid/cid: 2000/34/971, nestlvl: 2, children: 
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block entry
        SQL statement "SELECT
              -- Get a fixed-width representation of ID. btrim shouldn't be 
necessary but it is
              '_' || btrim( to_char(
                factory_id
                -- Get a string of 0's long enough to hold a max-sized int
                , repeat( '0', length( (2^31-1)::int::text ) )
              ) )
              , c.relname
                                                     FROM 
_tf.test_factory__get( table_name, set_name ) f
              JOIN pg_class c ON c.oid = f.table_oid
              JOIN pg_namespace n ON n.oid = c.relnamespace"
        PL/pgSQL function _tf.data_table_name(text,text) line 8 at SQL statement
        PL/pgSQL function tf.get(anyelement,text) line 5 during statement block 
local variable initialization
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:  SUB INPROGRS; state: INPROGR, 
xid/subid/cid: 2001/35/971, nestlvl: 3, children: 
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block entry
        SQL statement "SELECT
              -- Get a fixed-width representation of ID. btrim shouldn't be 
necessary but it is
              '_' || btrim( to_char(
                factory_id
                -- Get a string of 0's long enough to hold a max-sized int
                , repeat( '0', length( (2^31-1)::int::text ) )
              ) )
              , c.relname
                                                     FROM 
_tf.test_factory__get( table_name, set_name ) f
              JOIN pg_class c ON c.oid = f.table_oid
              JOIN pg_namespace n ON n.oid = c.relnamespace"
        PL/pgSQL function _tf.data_table_name(text,text) line 8 at SQL statement
        PL/pgSQL function tf.get(anyelement,text) line 5 during statement block 
local variable initialization
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:     SUB BEGIN; state: INPROGR, 
xid/subid/cid: 0/40/971, nestlvl: 4, children: 
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block entry
        SQL statement "SELECT
              -- Get a fixed-width representation of ID. btrim shouldn't be 
necessary but it is
              '_' || btrim( to_char(
                factory_id
                -- Get a string of 0's long enough to hold a max-sized int
                , repeat( '0', length( (2^31-1)::int::text ) )
              ) )
              , c.relname
                                                     FROM 
_tf.test_factory__get( table_name, set_name ) f
              JOIN pg_class c ON c.oid = f.table_oid
              JOIN pg_namespace n ON n.oid = c.relnamespace"
        PL/pgSQL function _tf.data_table_name(text,text) line 8 at SQL statement
        PL/pgSQL function tf.get(anyelement,text) line 5 during statement block 
local variable initialization
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  CommitSubTransaction
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block exit
        SQL statement "SELECT
              -- Get a fixed-width representation of ID. btrim shouldn't be 
necessary but it is
              '_' || btrim( to_char(
                factory_id
                -- Get a string of 0's long enough to hold a max-sized int
                , repeat( '0', length( (2^31-1)::int::text ) )
              ) )
              , c.relname
                                                     FROM 
_tf.test_factory__get( table_name, set_name ) f
              JOIN pg_class c ON c.oid = f.table_oid
              JOIN pg_namespace n ON n.oid = c.relnamespace"
        PL/pgSQL function _tf.data_table_name(text,text) line 8 at SQL statement
        PL/pgSQL function tf.get(anyelement,text) line 5 during statement block 
local variable initialization
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:    INPROGRESS; state: INPROGR, 
xid/subid/cid: 1980/1/971, nestlvl: 1, children: 1981 1982 1983 1984 1985 1986 
1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block exit
        SQL statement "SELECT
              -- Get a fixed-width representation of ID. btrim shouldn't be 
necessary but it is
              '_' || btrim( to_char(
                factory_id
                -- Get a string of 0's long enough to hold a max-sized int
                , repeat( '0', length( (2^31-1)::int::text ) )
              ) )
              , c.relname
                                                     FROM 
_tf.test_factory__get( table_name, set_name ) f
              JOIN pg_class c ON c.oid = f.table_oid
              JOIN pg_namespace n ON n.oid = c.relnamespace"
        PL/pgSQL function _tf.data_table_name(text,text) line 8 at SQL statement
        PL/pgSQL function tf.get(anyelement,text) line 5 during statement block 
local variable initialization
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: pg_psql_temporary_savepoint; blockState:  SUB INPROGRS; state: 
INPROGR, xid/subid/cid: 2000/34/971, nestlvl: 2, children: 
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block exit
        SQL statement "SELECT
              -- Get a fixed-width representation of ID. btrim shouldn't be 
necessary but it is
              '_' || btrim( to_char(
                factory_id
                -- Get a string of 0's long enough to hold a max-sized int
                , repeat( '0', length( (2^31-1)::int::text ) )
              ) )
              , c.relname
                                                     FROM 
_tf.test_factory__get( table_name, set_name ) f
              JOIN pg_class c ON c.oid = f.table_oid
              JOIN pg_namespace n ON n.oid = c.relnamespace"
        PL/pgSQL function _tf.data_table_name(text,text) line 8 at SQL statement
        PL/pgSQL function tf.get(anyelement,text) line 5 during statement block 
local variable initialization
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:  SUB INPROGRS; state: INPROGR, 
xid/subid/cid: 2001/35/971, nestlvl: 3, children: 
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block exit
        SQL statement "SELECT
              -- Get a fixed-width representation of ID. btrim shouldn't be 
necessary but it is
              '_' || btrim( to_char(
                factory_id
                -- Get a string of 0's long enough to hold a max-sized int
                , repeat( '0', length( (2^31-1)::int::text ) )
              ) )
              , c.relname
                                                     FROM 
_tf.test_factory__get( table_name, set_name ) f
              JOIN pg_class c ON c.oid = f.table_oid
              JOIN pg_namespace n ON n.oid = c.relnamespace"
        PL/pgSQL function _tf.data_table_name(text,text) line 8 at SQL statement
        PL/pgSQL function tf.get(anyelement,text) line 5 during statement block 
local variable initialization
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:  SUB INPROGRS; state: INPROGR, 
xid/subid/cid: 0/40/971, nestlvl: 4, children: 
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block exit
        SQL statement "SELECT
              -- Get a fixed-width representation of ID. btrim shouldn't be 
necessary but it is
              '_' || btrim( to_char(
                factory_id
                -- Get a string of 0's long enough to hold a max-sized int
                , repeat( '0', length( (2^31-1)::int::text ) )
              ) )
              , c.relname
                                                     FROM 
_tf.test_factory__get( table_name, set_name ) f
              JOIN pg_class c ON c.oid = f.table_oid
              JOIN pg_namespace n ON n.oid = c.relnamespace"
        PL/pgSQL function _tf.data_table_name(text,text) line 8 at SQL statement
        PL/pgSQL function tf.get(anyelement,text) line 5 during statement block 
local variable initialization
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  StartSubTransaction
CONTEXT:  PL/pgSQL function tf.get(anyelement,text) line 5 during statement 
block entry
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:    INPROGRESS; state: INPROGR, 
xid/subid/cid: 1980/1/971, nestlvl: 1, children: 1981 1982 1983 1984 1985 1986 
1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999
CONTEXT:  PL/pgSQL function tf.get(anyelement,text) line 5 during statement 
block entry
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: pg_psql_temporary_savepoint; blockState:  SUB INPROGRS; state: 
INPROGR, xid/subid/cid: 2000/34/971, nestlvl: 2, children: 
CONTEXT:  PL/pgSQL function tf.get(anyelement,text) line 5 during statement 
block entry
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:  SUB INPROGRS; state: INPROGR, 
xid/subid/cid: 2001/35/971, nestlvl: 3, children: 
CONTEXT:  PL/pgSQL function tf.get(anyelement,text) line 5 during statement 
block entry
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:     SUB BEGIN; state: INPROGR, 
xid/subid/cid: 0/41/971, nestlvl: 4, children: 
CONTEXT:  PL/pgSQL function tf.get(anyelement,text) line 5 during statement 
block entry
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  StartSubTransaction
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block entry
        SQL statement "SELECT
              -- Get a fixed-width representation of ID. btrim shouldn't be 
necessary but it is
              '_' || btrim( to_char(
                factory_id
                -- Get a string of 0's long enough to hold a max-sized int
                , repeat( '0', length( (2^31-1)::int::text ) )
              ) )
              , c.relname
                                                     FROM 
_tf.test_factory__get( table_name, set_name ) f
              JOIN pg_class c ON c.oid = f.table_oid
              JOIN pg_namespace n ON n.oid = c.relnamespace"
        PL/pgSQL function _tf.data_table_name(text,text) line 8 at SQL statement
        PL/pgSQL function _tf.get(anyelement,text) line 9 during statement 
block local variable initialization
        PL/pgSQL function tf.get(anyelement,text) line 6 at RETURN QUERY
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:    INPROGRESS; state: INPROGR, 
xid/subid/cid: 1980/1/971, nestlvl: 1, children: 1981 1982 1983 1984 1985 1986 
1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block entry
        SQL statement "SELECT
              -- Get a fixed-width representation of ID. btrim shouldn't be 
necessary but it is
              '_' || btrim( to_char(
                factory_id
                -- Get a string of 0's long enough to hold a max-sized int
                , repeat( '0', length( (2^31-1)::int::text ) )
              ) )
              , c.relname
                                                     FROM 
_tf.test_factory__get( table_name, set_name ) f
              JOIN pg_class c ON c.oid = f.table_oid
              JOIN pg_namespace n ON n.oid = c.relnamespace"
        PL/pgSQL function _tf.data_table_name(text,text) line 8 at SQL statement
        PL/pgSQL function _tf.get(anyelement,text) line 9 during statement 
block local variable initialization
        PL/pgSQL function tf.get(anyelement,text) line 6 at RETURN QUERY
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: pg_psql_temporary_savepoint; blockState:  SUB INPROGRS; state: 
INPROGR, xid/subid/cid: 2000/34/971, nestlvl: 2, children: 
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block entry
        SQL statement "SELECT
              -- Get a fixed-width representation of ID. btrim shouldn't be 
necessary but it is
              '_' || btrim( to_char(
                factory_id
                -- Get a string of 0's long enough to hold a max-sized int
                , repeat( '0', length( (2^31-1)::int::text ) )
              ) )
              , c.relname
                                                     FROM 
_tf.test_factory__get( table_name, set_name ) f
              JOIN pg_class c ON c.oid = f.table_oid
              JOIN pg_namespace n ON n.oid = c.relnamespace"
        PL/pgSQL function _tf.data_table_name(text,text) line 8 at SQL statement
        PL/pgSQL function _tf.get(anyelement,text) line 9 during statement 
block local variable initialization
        PL/pgSQL function tf.get(anyelement,text) line 6 at RETURN QUERY
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:  SUB INPROGRS; state: INPROGR, 
xid/subid/cid: 2001/35/971, nestlvl: 3, children: 
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block entry
        SQL statement "SELECT
              -- Get a fixed-width representation of ID. btrim shouldn't be 
necessary but it is
              '_' || btrim( to_char(
                factory_id
                -- Get a string of 0's long enough to hold a max-sized int
                , repeat( '0', length( (2^31-1)::int::text ) )
              ) )
              , c.relname
                                                     FROM 
_tf.test_factory__get( table_name, set_name ) f
              JOIN pg_class c ON c.oid = f.table_oid
              JOIN pg_namespace n ON n.oid = c.relnamespace"
        PL/pgSQL function _tf.data_table_name(text,text) line 8 at SQL statement
        PL/pgSQL function _tf.get(anyelement,text) line 9 during statement 
block local variable initialization
        PL/pgSQL function tf.get(anyelement,text) line 6 at RETURN QUERY
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:  SUB INPROGRS; state: INPROGR, 
xid/subid/cid: 0/41/971, nestlvl: 4, children: 
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block entry
        SQL statement "SELECT
              -- Get a fixed-width representation of ID. btrim shouldn't be 
necessary but it is
              '_' || btrim( to_char(
                factory_id
                -- Get a string of 0's long enough to hold a max-sized int
                , repeat( '0', length( (2^31-1)::int::text ) )
              ) )
              , c.relname
                                                     FROM 
_tf.test_factory__get( table_name, set_name ) f
              JOIN pg_class c ON c.oid = f.table_oid
              JOIN pg_namespace n ON n.oid = c.relnamespace"
        PL/pgSQL function _tf.data_table_name(text,text) line 8 at SQL statement
        PL/pgSQL function _tf.get(anyelement,text) line 9 during statement 
block local variable initialization
        PL/pgSQL function tf.get(anyelement,text) line 6 at RETURN QUERY
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:     SUB BEGIN; state: INPROGR, 
xid/subid/cid: 0/42/971, nestlvl: 5, children: 
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block entry
        SQL statement "SELECT
              -- Get a fixed-width representation of ID. btrim shouldn't be 
necessary but it is
              '_' || btrim( to_char(
                factory_id
                -- Get a string of 0's long enough to hold a max-sized int
                , repeat( '0', length( (2^31-1)::int::text ) )
              ) )
              , c.relname
                                                     FROM 
_tf.test_factory__get( table_name, set_name ) f
              JOIN pg_class c ON c.oid = f.table_oid
              JOIN pg_namespace n ON n.oid = c.relnamespace"
        PL/pgSQL function _tf.data_table_name(text,text) line 8 at SQL statement
        PL/pgSQL function _tf.get(anyelement,text) line 9 during statement 
block local variable initialization
        PL/pgSQL function tf.get(anyelement,text) line 6 at RETURN QUERY
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  CommitSubTransaction
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block exit
        SQL statement "SELECT
              -- Get a fixed-width representation of ID. btrim shouldn't be 
necessary but it is
              '_' || btrim( to_char(
                factory_id
                -- Get a string of 0's long enough to hold a max-sized int
                , repeat( '0', length( (2^31-1)::int::text ) )
              ) )
              , c.relname
                                                     FROM 
_tf.test_factory__get( table_name, set_name ) f
              JOIN pg_class c ON c.oid = f.table_oid
              JOIN pg_namespace n ON n.oid = c.relnamespace"
        PL/pgSQL function _tf.data_table_name(text,text) line 8 at SQL statement
        PL/pgSQL function _tf.get(anyelement,text) line 9 during statement 
block local variable initialization
        PL/pgSQL function tf.get(anyelement,text) line 6 at RETURN QUERY
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:    INPROGRESS; state: INPROGR, 
xid/subid/cid: 1980/1/971, nestlvl: 1, children: 1981 1982 1983 1984 1985 1986 
1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block exit
        SQL statement "SELECT
              -- Get a fixed-width representation of ID. btrim shouldn't be 
necessary but it is
              '_' || btrim( to_char(
                factory_id
                -- Get a string of 0's long enough to hold a max-sized int
                , repeat( '0', length( (2^31-1)::int::text ) )
              ) )
              , c.relname
                                                     FROM 
_tf.test_factory__get( table_name, set_name ) f
              JOIN pg_class c ON c.oid = f.table_oid
              JOIN pg_namespace n ON n.oid = c.relnamespace"
        PL/pgSQL function _tf.data_table_name(text,text) line 8 at SQL statement
        PL/pgSQL function _tf.get(anyelement,text) line 9 during statement 
block local variable initialization
        PL/pgSQL function tf.get(anyelement,text) line 6 at RETURN QUERY
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: pg_psql_temporary_savepoint; blockState:  SUB INPROGRS; state: 
INPROGR, xid/subid/cid: 2000/34/971, nestlvl: 2, children: 
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block exit
        SQL statement "SELECT
              -- Get a fixed-width representation of ID. btrim shouldn't be 
necessary but it is
              '_' || btrim( to_char(
                factory_id
                -- Get a string of 0's long enough to hold a max-sized int
                , repeat( '0', length( (2^31-1)::int::text ) )
              ) )
              , c.relname
                                                     FROM 
_tf.test_factory__get( table_name, set_name ) f
              JOIN pg_class c ON c.oid = f.table_oid
              JOIN pg_namespace n ON n.oid = c.relnamespace"
        PL/pgSQL function _tf.data_table_name(text,text) line 8 at SQL statement
        PL/pgSQL function _tf.get(anyelement,text) line 9 during statement 
block local variable initialization
        PL/pgSQL function tf.get(anyelement,text) line 6 at RETURN QUERY
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:  SUB INPROGRS; state: INPROGR, 
xid/subid/cid: 2001/35/971, nestlvl: 3, children: 
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block exit
        SQL statement "SELECT
              -- Get a fixed-width representation of ID. btrim shouldn't be 
necessary but it is
              '_' || btrim( to_char(
                factory_id
                -- Get a string of 0's long enough to hold a max-sized int
                , repeat( '0', length( (2^31-1)::int::text ) )
              ) )
              , c.relname
                                                     FROM 
_tf.test_factory__get( table_name, set_name ) f
              JOIN pg_class c ON c.oid = f.table_oid
              JOIN pg_namespace n ON n.oid = c.relnamespace"
        PL/pgSQL function _tf.data_table_name(text,text) line 8 at SQL statement
        PL/pgSQL function _tf.get(anyelement,text) line 9 during statement 
block local variable initialization
        PL/pgSQL function tf.get(anyelement,text) line 6 at RETURN QUERY
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:  SUB INPROGRS; state: INPROGR, 
xid/subid/cid: 0/41/971, nestlvl: 4, children: 
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block exit
        SQL statement "SELECT
              -- Get a fixed-width representation of ID. btrim shouldn't be 
necessary but it is
              '_' || btrim( to_char(
                factory_id
                -- Get a string of 0's long enough to hold a max-sized int
                , repeat( '0', length( (2^31-1)::int::text ) )
              ) )
              , c.relname
                                                     FROM 
_tf.test_factory__get( table_name, set_name ) f
              JOIN pg_class c ON c.oid = f.table_oid
              JOIN pg_namespace n ON n.oid = c.relnamespace"
        PL/pgSQL function _tf.data_table_name(text,text) line 8 at SQL statement
        PL/pgSQL function _tf.get(anyelement,text) line 9 during statement 
block local variable initialization
        PL/pgSQL function tf.get(anyelement,text) line 6 at RETURN QUERY
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:  SUB INPROGRS; state: INPROGR, 
xid/subid/cid: 0/42/971, nestlvl: 5, children: 
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block exit
        SQL statement "SELECT
              -- Get a fixed-width representation of ID. btrim shouldn't be 
necessary but it is
              '_' || btrim( to_char(
                factory_id
                -- Get a string of 0's long enough to hold a max-sized int
                , repeat( '0', length( (2^31-1)::int::text ) )
              ) )
              , c.relname
                                                     FROM 
_tf.test_factory__get( table_name, set_name ) f
              JOIN pg_class c ON c.oid = f.table_oid
              JOIN pg_namespace n ON n.oid = c.relnamespace"
        PL/pgSQL function _tf.data_table_name(text,text) line 8 at SQL statement
        PL/pgSQL function _tf.get(anyelement,text) line 9 during statement 
block local variable initialization
        PL/pgSQL function tf.get(anyelement,text) line 6 at RETURN QUERY
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  sql = SELECT * FROM _test_data.customer_0000000001 AS t
CONTEXT:  PL/pgSQL function tf.get(anyelement,text) line 6 at RETURN QUERY
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  AbortSubTransaction
CONTEXT:  PL/pgSQL function tf.get(anyelement,text) line 6 during exception 
cleanup
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:    INPROGRESS; state: INPROGR, 
xid/subid/cid: 1980/1/972, nestlvl: 1, children: 1981 1982 1983 1984 1985 1986 
1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999
CONTEXT:  PL/pgSQL function tf.get(anyelement,text) line 6 during exception 
cleanup
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: pg_psql_temporary_savepoint; blockState:  SUB INPROGRS; state: 
INPROGR, xid/subid/cid: 2000/34/972, nestlvl: 2, children: 
CONTEXT:  PL/pgSQL function tf.get(anyelement,text) line 6 during exception 
cleanup
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:  SUB INPROGRS; state: INPROGR, 
xid/subid/cid: 2001/35/972, nestlvl: 3, children: 
CONTEXT:  PL/pgSQL function tf.get(anyelement,text) line 6 during exception 
cleanup
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:  SUB INPROGRS; state: INPROGR, 
xid/subid/cid: 2003/41/972, nestlvl: 4, children: 
CONTEXT:  PL/pgSQL function tf.get(anyelement,text) line 6 during exception 
cleanup
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  CleanupSubTransaction
CONTEXT:  PL/pgSQL function tf.get(anyelement,text) line 6 during exception 
cleanup
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:    INPROGRESS; state: INPROGR, 
xid/subid/cid: 1980/1/972, nestlvl: 1, children: 1981 1982 1983 1984 1985 1986 
1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999
CONTEXT:  PL/pgSQL function tf.get(anyelement,text) line 6 during exception 
cleanup
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: pg_psql_temporary_savepoint; blockState:  SUB INPROGRS; state: 
INPROGR, xid/subid/cid: 2000/34/972, nestlvl: 2, children: 
CONTEXT:  PL/pgSQL function tf.get(anyelement,text) line 6 during exception 
cleanup
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:  SUB INPROGRS; state: INPROGR, 
xid/subid/cid: 2001/35/972, nestlvl: 3, children: 
CONTEXT:  PL/pgSQL function tf.get(anyelement,text) line 6 during exception 
cleanup
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:  SUB INPROGRS; state:   ABORT, 
xid/subid/cid: 2003/41/972, nestlvl: 4, children: 
CONTEXT:  PL/pgSQL function tf.get(anyelement,text) line 6 during exception 
cleanup
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  StartSubTransaction
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block entry
        SQL statement "SELECT format(
                    $$
        CREATE TEMP TABLE %I ON COMMIT DROP AS
        WITH i AS (
              %s
            )
          SELECT *
            FROM i
        $$
                    , c_data_table_name
                    , factory.insert_sql
                  )
                                        FROM _tf.test_factory__get( 
c_table_name, set_name ) factory"
        PL/pgSQL function tf.get(anyelement,text) line 13 at SQL statement
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:    INPROGRESS; state: INPROGR, 
xid/subid/cid: 1980/1/972, nestlvl: 1, children: 1981 1982 1983 1984 1985 1986 
1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block entry
        SQL statement "SELECT format(
                    $$
        CREATE TEMP TABLE %I ON COMMIT DROP AS
        WITH i AS (
              %s
            )
          SELECT *
            FROM i
        $$
                    , c_data_table_name
                    , factory.insert_sql
                  )
                                        FROM _tf.test_factory__get( 
c_table_name, set_name ) factory"
        PL/pgSQL function tf.get(anyelement,text) line 13 at SQL statement
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: pg_psql_temporary_savepoint; blockState:  SUB INPROGRS; state: 
INPROGR, xid/subid/cid: 2000/34/972, nestlvl: 2, children: 
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block entry
        SQL statement "SELECT format(
                    $$
        CREATE TEMP TABLE %I ON COMMIT DROP AS
        WITH i AS (
              %s
            )
          SELECT *
            FROM i
        $$
                    , c_data_table_name
                    , factory.insert_sql
                  )
                                        FROM _tf.test_factory__get( 
c_table_name, set_name ) factory"
        PL/pgSQL function tf.get(anyelement,text) line 13 at SQL statement
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:  SUB INPROGRS; state: INPROGR, 
xid/subid/cid: 2001/35/972, nestlvl: 3, children: 
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block entry
        SQL statement "SELECT format(
                    $$
        CREATE TEMP TABLE %I ON COMMIT DROP AS
        WITH i AS (
              %s
            )
          SELECT *
            FROM i
        $$
                    , c_data_table_name
                    , factory.insert_sql
                  )
                                        FROM _tf.test_factory__get( 
c_table_name, set_name ) factory"
        PL/pgSQL function tf.get(anyelement,text) line 13 at SQL statement
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:     SUB BEGIN; state: INPROGR, 
xid/subid/cid: 0/43/972, nestlvl: 4, children: 
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block entry
        SQL statement "SELECT format(
                    $$
        CREATE TEMP TABLE %I ON COMMIT DROP AS
        WITH i AS (
              %s
            )
          SELECT *
            FROM i
        $$
                    , c_data_table_name
                    , factory.insert_sql
                  )
                                        FROM _tf.test_factory__get( 
c_table_name, set_name ) factory"
        PL/pgSQL function tf.get(anyelement,text) line 13 at SQL statement
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  CommitSubTransaction
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block exit
        SQL statement "SELECT format(
                    $$
        CREATE TEMP TABLE %I ON COMMIT DROP AS
        WITH i AS (
              %s
            )
          SELECT *
            FROM i
        $$
                    , c_data_table_name
                    , factory.insert_sql
                  )
                                        FROM _tf.test_factory__get( 
c_table_name, set_name ) factory"
        PL/pgSQL function tf.get(anyelement,text) line 13 at SQL statement
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:    INPROGRESS; state: INPROGR, 
xid/subid/cid: 1980/1/972, nestlvl: 1, children: 1981 1982 1983 1984 1985 1986 
1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block exit
        SQL statement "SELECT format(
                    $$
        CREATE TEMP TABLE %I ON COMMIT DROP AS
        WITH i AS (
              %s
            )
          SELECT *
            FROM i
        $$
                    , c_data_table_name
                    , factory.insert_sql
                  )
                                        FROM _tf.test_factory__get( 
c_table_name, set_name ) factory"
        PL/pgSQL function tf.get(anyelement,text) line 13 at SQL statement
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: pg_psql_temporary_savepoint; blockState:  SUB INPROGRS; state: 
INPROGR, xid/subid/cid: 2000/34/972, nestlvl: 2, children: 
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block exit
        SQL statement "SELECT format(
                    $$
        CREATE TEMP TABLE %I ON COMMIT DROP AS
        WITH i AS (
              %s
            )
          SELECT *
            FROM i
        $$
                    , c_data_table_name
                    , factory.insert_sql
                  )
                                        FROM _tf.test_factory__get( 
c_table_name, set_name ) factory"
        PL/pgSQL function tf.get(anyelement,text) line 13 at SQL statement
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:  SUB INPROGRS; state: INPROGR, 
xid/subid/cid: 2001/35/972, nestlvl: 3, children: 
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block exit
        SQL statement "SELECT format(
                    $$
        CREATE TEMP TABLE %I ON COMMIT DROP AS
        WITH i AS (
              %s
            )
          SELECT *
            FROM i
        $$
                    , c_data_table_name
                    , factory.insert_sql
                  )
                                        FROM _tf.test_factory__get( 
c_table_name, set_name ) factory"
        PL/pgSQL function tf.get(anyelement,text) line 13 at SQL statement
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:  SUB INPROGRS; state: INPROGR, 
xid/subid/cid: 0/43/972, nestlvl: 4, children: 
CONTEXT:  PL/pgSQL function _tf.test_factory__get(text,text) line 7 during 
statement block exit
        SQL statement "SELECT format(
                    $$
        CREATE TEMP TABLE %I ON COMMIT DROP AS
        WITH i AS (
              %s
            )
          SELECT *
            FROM i
        $$
                    , c_data_table_name
                    , factory.insert_sql
                  )
                                        FROM _tf.test_factory__get( 
c_table_name, set_name ) factory"
        PL/pgSQL function tf.get(anyelement,text) line 13 at SQL statement
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  sql = 
        CREATE TEMP TABLE customer_0000000001 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO customer VALUES (DEFAULT, 'first', 'last' ) RETURNING 
*
            )
          SELECT *
            FROM i
        
CONTEXT:  SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  building index "pg_toast_111523_index" on table "pg_toast_111523"
CONTEXT:  SQL statement "
        CREATE TEMP TABLE customer_0000000001 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO customer VALUES (DEFAULT, 'first', 'last' ) RETURNING 
*
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        SQL statement "
        CREATE TEMP TABLE invoice_0000000003 ON COMMIT DROP AS
        WITH i AS (
              INSERT INTO invoice VALUES(
                    DEFAULT
                    , (tf.get( NULL::customer, 'insert' )).customer_id
                    , current_date
                    , current_date + 30
                  ) RETURNING *
            )
          SELECT *
            FROM i
        "
        PL/pgSQL function tf.get(anyelement,text) line 29 at EXECUTE statement
        PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 at FETCH
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  AbortSubTransaction
CONTEXT:  PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 during 
exception cleanup
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:    INPROGRESS; state: INPROGR, 
xid/subid/cid: 1980/1/979, nestlvl: 1, children: 1981 1982 1983 1984 1985 1986 
1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999
CONTEXT:  PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 during 
exception cleanup
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: pg_psql_temporary_savepoint; blockState:  SUB INPROGRS; state: 
INPROGR, xid/subid/cid: 2000/34/979, nestlvl: 2, children: 
CONTEXT:  PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 during 
exception cleanup
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
DEBUG:  name: unnamed; blockState:  SUB INPROGRS; state: INPROGR, 
xid/subid/cid: 2001/35/979, nestlvl: 3, children: 
CONTEXT:  PL/pgSQL function results_eq(refcursor,refcursor,text) line 11 during 
exception cleanup
        PL/pgSQL function results_eq(text,text,text) line 9 at assignment
TRAP: FailedAssertion("!(rebuild ? !((bool)((relation)->rd_refcnt == 0)) : 
((bool)((relation)->rd_refcnt == 0)))", File: "relcache.c", Line: 2055)
LOG:  server process (PID 65380) was terminated by signal 6: Abort trap
DETAIL:  Failed process was running: SELECT results_eq(
          $$SELECT * FROM tf.get( NULL::invoice, 'base' )$$
          , $$VALUES( 1, 1, current_date, current_date + 30 )$$
          , 'invoice factory output'
        );
LOG:  terminating any other active server processes
WARNING:  terminating connection because of crash of another server process
DETAIL:  The postmaster has commanded this server process to roll back the 
current transaction and exit, because another server process exited abnormally 
and possibly corrupted shared memory.
HINT:  In a moment you should be able to reconnect to the database and repeat 
your command.
LOG:  all server processes terminated; reinitializing
LOG:  database system was interrupted; last known up at 2015-08-27 19:01:01 CDT
LOG:  database system was not properly shut down; automatic recovery in progress
LOG:  redo starts at 0/509BFA8
LOG:  unexpected pageaddr 0/31D4000 in log segment 000000010000000000000005, 
offset 1916928
LOG:  redo done at 0/51D3FB8
LOG:  last completed transaction was at log time 2015-08-27 19:01:02.577529-05
LOG:  MultiXact member wraparound protections are now enabled
LOG:  autovacuum launcher started
LOG:  database system is ready to accept connections


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to