Re: [GENERAL] Identify primary key in simple/updatable view

2013-08-02 Thread Andrew Tipton
for the view (with appropriate values for contype, conrelid, conkey, etc.) Postgres will simply ignore it. Updates to the view continue to work without any issue. I wouldn't recommend hacking around with the catalogs in this manner, but perhaps this would solve your issue? Regards, Andrew

Re: [GENERAL] Event trigger information accessibility on plpgsql

2013-07-29 Thread Andrew Tipton
toying with the idea of an extension which (ab)uses event triggers in precisely this manner. The goal is to provide built-in version control that doesn't need any external tools to be run after changes have been made to the schema.] Regards, Andrew Tipton

Re: [GENERAL] Event trigger information accessibility on plpgsql

2013-07-29 Thread Andrew Tipton
audit_ddl_event_trigger DISABLE; before attempting to DROP anything in the audit_ddl schema, or recursive hilarity will ensue. Regards, Andrew Tipton audit_ddl.sql Description: Binary data -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription

Re: [GENERAL] Determining the type (array, object, or scalar) of a JSON value

2013-06-13 Thread Andrew Tipton
On Wed, Jun 12, 2013 at 11:38 PM, Merlin Moncure mmonc...@gmail.com wrote: no argument against json_typeof, but why can you just peek the first non-whitespace character? json is famously easy to parse (see here: http://www.json.org/) create or replace function json_typeof(_json json)

[GENERAL] Determining the type (array, object, or scalar) of a JSON value

2013-06-12 Thread Andrew Tipton
Hi all, I recently wanted to declare a CHECK constraint to ensure that a JSON value was an object with keys that were scalars (not nested objects or arrays). This proved to be more difficult than I had expected. In the end, I had to write a json_typeof() function in pl/pgsql. It's a simple