Re: [BUGS] New kind of crash?

2013-03-10 Thread Alvaro Herrera
Josh Berkus wrote:
> On 03/08/2013 07:27 PM, Alvaro Herrera wrote:
> > Josh Berkus wrote:
> >> Folks,
> >>
> >> This is one I've never seen before:
> >>
> >> => select generate_master_tables();
> >> WARNING:  AbortTransaction while in COMMIT state
> >> PANIC:  cannot abort transaction 9387287, it was already committed
> > 
> > Anything that causes an ERROR in the final stages of a transaction
> > commit will look like this.  Maybe, for example, something tried to
> > acquire more shared memory for something (serializable xact?) but that
> > was already full because of lock objects.
> 
> Well, is it worth trying to reproduce and diagnose?

IMO it's worth adding enough protections that in these situations you
get regular ERRORs rather than PANICs, assuming the scenario is not too
contrived and the required patches are not too complex.

-- 
Álvaro Herrerahttp://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


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


[BUGS] ERROR: invalid input syntax for type timestamp with time zone

2013-03-10 Thread Rushabh Lathia
Hi All,

Consider the following test:

postgres=# select version();

version

-
 PostgreSQL 9.3devel on x86_64-unknown-linux-gnu, compiled by gcc (GCC)
4.4.6 20120305 (Red Hat 4.4.6-4), 64-bit
(1 row)

postgres=# create table test ( a timestamptz);
CREATE TABLE
postgres=# insert into test values ( 'Sat Mar 11 23:58:48 1000 IST');
INSERT 0 1
postgres=# select * from test;
  a
--
 1000-03-12 03:52:16+05:53:28
(1 row)

postgres=# insert into test values ( 'Sat Mar 11 23:58:48 1 IST');
ERROR:  invalid input syntax for type timestamp with time zone: "Sat Mar 11
23:58:48 1 IST"
LINE 1: insert into test values ( 'Sat Mar 11 23:58:48 1 IST');

So, if you see while trying to insert date 'Sat Mar 11 23:58:48 *1* IST'
, its returns with invalid input syntax.  Error coming from the stack
(timestamptz_in()  -> DecodeDateTime()).

But when I tried to enter same date with other format then it does work.

postgres=# insert into test values ( '*1*-03-11 23:58:48');
INSERT 0 1
postgres=# select * from test;
  a
---
Sat Mar 11 23:58:48 *1* IST
(1 row)

Looking at the code, it seems like for Postgres,MDY datestyle DecodeDateTime()
doesn't handle date properly if year is greater then 4 digits (greater then
). Do you see this as bug or expected output ?


Regards,
Rushabh Lathia
www.EnterpriseDB.com