Re: [HACKERS] List of binary-compatible data types

2013-11-05 Thread Josh Berkus
Noah, Also, JSON -- Text seems to be missing from the possible binary conversions. That's a TODO, I suppose. Only json -- text, not json -- text. Note that you can add the cast manually if you have an immediate need. Huh? Why would text -- JSON require a physical rewrite? We have to

Re: [HACKERS] List of binary-compatible data types

2013-11-05 Thread Noah Misch
On Tue, Nov 05, 2013 at 10:00:15AM -0800, Josh Berkus wrote: Noah, Also, JSON -- Text seems to be missing from the possible binary conversions. That's a TODO, I suppose. Only json -- text, not json -- text. Note that you can add the cast manually if you have an immediate need.

Re: [HACKERS] List of binary-compatible data types

2013-11-05 Thread Josh Berkus
Noah, That's all true, but the system has no concept like this cast validates the data, never changing it. We would first need to add metadata supporting such a concept. On the other hand, create cast (json as text) without function; leans only on concepts the system already knows. Yeah,

Re: [HACKERS] List of binary-compatible data types

2013-11-05 Thread Andres Freund
On 2013-11-05 11:15:29 -0800, Josh Berkus wrote: Noah, That's all true, but the system has no concept like this cast validates the data, never changing it. We would first need to add metadata supporting such a concept. On the other hand, create cast (json as text) without

Re: [HACKERS] List of binary-compatible data types

2013-11-05 Thread Josh Berkus
Andres, There's zap chance of doing anything for 9.3, this would require quite a bit of code in tablecmds.c and that surely isn't going to happen in the backbranches. Oh, sure, I was thinking of a workaround. Actually, being able to separate need to check contents from need to rewrite values

[HACKERS] List of binary-compatible data types

2013-11-04 Thread Josh Berkus
Folks, From our docs: Adding a column with a non-null default or changing the type of an existing column will require the entire table and indexes to be rewritten. As an exception, if the USING clause does not change the column contents and the old type is either binary coercible to the new type

Re: [HACKERS] List of binary-compatible data types

2013-11-04 Thread Thom Brown
On 4 November 2013 21:58, Josh Berkus j...@agliodbs.com wrote: Folks, From our docs: Adding a column with a non-null default or changing the type of an existing column will require the entire table and indexes to be rewritten. As an exception, if the USING clause does not change the column

Re: [HACKERS] List of binary-compatible data types

2013-11-04 Thread Josh Berkus
Thom, SELECT castsource::regtype::text, array_agg(casttarget::regtype order by casttarget::regtype::text) casttargets FROM pg_cast WHERE castmethod = 'b' GROUP BY 1 ORDER BY 1; Are we actually covering 100% of these for ALTER COLUMN now? -- Josh Berkus PostgreSQL Experts Inc.

Re: [HACKERS] List of binary-compatible data types

2013-11-04 Thread Josh Berkus
On 11/04/2013 05:21 PM, Josh Berkus wrote: Thom, SELECT castsource::regtype::text, array_agg(casttarget::regtype order by casttarget::regtype::text) casttargets FROM pg_cast WHERE castmethod = 'b' GROUP BY 1 ORDER BY 1; Are we actually covering 100% of these for ALTER COLUMN

Re: [HACKERS] List of binary-compatible data types

2013-11-04 Thread Noah Misch
On Mon, Nov 04, 2013 at 05:23:36PM -0800, Josh Berkus wrote: On 11/04/2013 05:21 PM, Josh Berkus wrote: Thom, SELECT castsource::regtype::text, array_agg(casttarget::regtype order by casttarget::regtype::text) casttargets FROM pg_cast WHERE castmethod = 'b' GROUP BY 1