Re: [HACKERS] patch for xidin

2015-04-29 Thread Robert Haas
On Fri, Apr 17, 2015 at 10:27 AM, Tom Lane t...@sss.pgh.pa.us wrote:
 The patch will correct it. I have justly copy some code of 'OID'. Whether we 
 need to extract the common code?

 This seems like an awful lot of code to solve a problem that will never
 occur in practice.

It does seem like an awful lot of code.  We should be able to come up
with something shorter.  But the bug report is legitimate.  It's not
too much to ask that data types sanity check their inputs.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


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


Re: [HACKERS] patch for xidin

2015-04-17 Thread Tom Lane
Zhang Zq zqzhangm...@163.com writes:
The implements of 'xidin' use only ¡®strtoul¡¯ to cast from string to 
 xid. So in some cases, may cause confusion, for example,
 The sql 'select c1 from test where xmin='abc' can be executed.  and sometimes 
 will make mistakes, I want to query select c1 from test where xmin='0x10' 
 ,but write 'Ox10', '0' to 'O',The result is obviously wrong.

 The patch will correct it. I have justly copy some code of 'OID'. Whether we 
 need to extract the common code?

This seems like an awful lot of code to solve a problem that will never
occur in practice.

regards, tom lane


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


[HACKERS] patch for xidin

2015-04-17 Thread Zhang Zq
hi,
   The implements of 'xidin' use only ‘strtoul’ to cast from string to xid. So 
in some cases, may cause confusion, for example,
The sql 'select c1 from test where xmin='abc' can be executed.  and sometimes 
will make mistakes, I want to query select c1 from test where xmin='0x10' 
,but write 'Ox10', '0' to 'O',The result is obviously wrong.

The patch will correct it. I have justly copy some code of 'OID'. Whether we 
need to extract the common code?

Thanks.


xid.patch
Description: Binary data

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