Re: How to access array elements via PL/pgSQL trigger? - Mailing list pgsql-general

From Roland Roberts
Subject Re: How to access array elements via PL/pgSQL trigger?
Date
Msg-id m2vger2kzs.fsf@tycho.rlent.pnet
Whole thread Raw
In response to Re: How to access array elements via PL/pgSQL trigger?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: How to access array elements via PL/pgSQL trigger?
List pgsql-general
Okay, I've re-executed the query after setting debug_level = 2 and
restarting the postmaster to use a log file.  Here is an extract from
the log starting from my connect up to the first aborted insert on the
"exam" table.  All of the activity up to that point is correct (i.e.,
the previous duplicate key errors).

DEBUG:  connection: host=192.168.2.50 user=roland database=psr
DEBUG:  InitPostgres
DEBUG:  StartTransactionCommand
DEBUG:  query: select getdatabaseencoding()
DEBUG:  ProcessQuery
DEBUG:  CommitTransactionCommand
DEBUG:  StartTransactionCommand
DEBUG:  query: insert into district (number, borough) values (22, 'BKLN')
DEBUG:  ProcessQuery
ERROR:  Cannot insert a duplicate key into unique index district_pkey
DEBUG:  AbortCurrentTransaction
DEBUG:  StartTransactionCommand
DEBUG:  query: insert into school (number, district, level) values (312, 22, 'PS')
DEBUG:  ProcessQuery
ERROR:  Cannot insert a duplicate key into unique index uk_school
DEBUG:  AbortCurrentTransaction
DEBUG:  StartTransactionCommand
DEBUG:  query: select id from school where number=312 and district=22 and level='PS'
DEBUG:  ProcessQuery
DEBUG:  CommitTransactionCommand
DEBUG:  StartTransactionCommand
DEBUG:  query: update school set name = 'BERGEN BEACH SCHOOL' where id = 4
DEBUG:  ProcessQuery
DEBUG:  query: SELECT oid FROM ONLY "school_level_lookup" WHERE "id" = $1 FOR UPDATE OF "school_level_lookup"
DEBUG:  query: SELECT oid FROM ONLY "district" WHERE "number" = $1 FOR UPDATE OF "district"
DEBUG:  CommitTransactionCommand
DEBUG:  StartTransactionCommand
DEBUG:  query: insert into exam (type, school_id, year, population, level) values ('ELA', 4, 1999, 'GE', '{ 7,87,208,73
}')
DEBUG:  ProcessQuery
NOTICE:  plpgsql: ERROR during compile of exam_statistics_fixup near line 4
ERROR:  parse error at or near "["
DEBUG:  AbortCurrentTransaction

Does this tell you any more?  Should I log this as a bug?  (The bug
form on the web site doesn't seem to be found right now...).

roland
--
               PGP Key ID: 66 BC 3B CD
Roland B. Roberts, PhD                             RL Enterprises
roland@rlenter.com                     76-15 113th Street, Apt 3B
roland@astrofoto.org                       Forest Hills, NY 11375

pgsql-general by date:

Previous
From: "Jeffrey W. Baker"
Date:
Subject: Re: postgres processes spending most of their time in the
Next
From: "Jeffrey W. Baker"
Date:
Subject: Re: postgres processes spending most of their time in the