Re: Proposal: Add JSON support - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Proposal: Add JSON support
Date
Msg-id 20100406150513.GA3491@alvh.no-ip.org
Whole thread Raw
In response to Re: Proposal: Add JSON support  (Joseph Adams <joeyadams3.14159@gmail.com>)
Responses Re: Proposal: Add JSON support  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Joseph Adams escribió:

> http://constellationmedia.com/~funsite/static/json-0.0.2.tar.bz2
> 
> My json.c is now 1161 lines long, so I can't quite call it "small" anymore.

Just noticed you don't check the return value of malloc and friends.
How do you intend to handle that?  There are various places that would
simply dump core with the 0.0.2 code.  Within Postgres it's easy -- a
failed palloc aborts the transaction and doesn't continue running your
code.  But in a standalone library that's probably not acceptable.

If we were to import this there are some lines that could be ripped out,
like 60 lines in the string buffer stuff and 130 lines for Unicode.
That brings your code just under 1000 lines.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: recovery.conf.sample
Next
From: Robert Haas
Date:
Subject: Re: Remaining Streaming Replication Open Items