[HACKERS] timestamp format escape rules

2015-03-12 Thread Rikard Pavelic
Currently Postgres uses DATE WHITESPACE TIME for timestamp/tz datatype.

Due whitespace it needs to be escaped when returned as record.
How likely is to change WHITESPACE to something more ISO like, like 'T'?

This would allow it to be serialized without the need for escaping.

I'm asking this since we often return nested records directly from
Postgres and when reading deeply nested records, we are mostly skipping
on quotes/escapes.

Regards,
Rikard

-- 
Rikard Pavelic
https://dsl-platform.com/
http://templater.info/


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


[HACKERS] Rewriting existing table tuples on alter type

2012-06-30 Thread Rikard Pavelic
How hard would it be to rewrite table content on composite attribute type 
change?

For simple use cases:
create type complex as (i int, j int);
create table numbers (c complex);
insert into numbers values(row(1,2));

I  can work around
alter complex from int to bigint
fairly easy with
alter type complex add attribute _tmp_i bigint;
--loop for each table
update numbers set c._tmp_i = (c).i;
--end loop
alter type complex drop attribute i;
alter type complex rename attribute _tmp_i to i;

I can easily work with deep nested types, but things starts to get PITA when 
there is
array involved because I need to unroll it and pack it again.

Regards,
Rikard

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