Re: [GENERAL] md5 of table

2011-09-03 Thread Sim Zacks
I thought about using dblink and the EXCEPT query, but then I need to know the field list of each query result, which is a pain in the butt. That is not correct. As long as the table definitions are precisely the same, you can move records across dblink without specifying fields. You do this

Re: [GENERAL] md5 of table

2011-09-02 Thread Vincent de Phily
On Thursday 01 September 2011 11:47:24 Sim Zacks wrote: > Is there a way to get an md5 or other hash of an entire table? > > I want to be able to easily compare 2 tables in different databases. > > I thought about using dblink and the EXCEPT query, but then I need to > know the field list of each

Re: [GENERAL] md5 of table

2011-09-01 Thread Scott Marlowe
On Thu, Sep 1, 2011 at 7:56 AM, Achilleas Mantzios wrote: > Στις Thursday 01 September 2011 15:50:21 ο/η Scott Marlowe έγραψε: >> Really?  I was not aware of size limits of md5, what are they? >> > > sorry, i was wrong. i dont know why i had this impression, > just checked with a 43GB table on a f

Re: [GENERAL] md5 of table

2011-09-01 Thread Merlin Moncure
2011/9/1 Sim Zacks : > >> OP: >>> >>> I thought about using dblink and the EXCEPT query, but then I need to >>> know the field list of each query result, which is a pain in the butt. >> >> That is not correct.  As long as the table definitions are precisely >> the same, you can move records across

Re: [GENERAL] md5 of table

2011-09-01 Thread Robert Treat
2011/9/1 Merlin Moncure : > 2011/9/1 Grzegorz Jaśkiewicz : >> On Thu, Sep 1, 2011 at 11:14 AM, Sim Zacks wrote: >>> On 09/01/2011 12:26 PM, Pavel Stehule wrote: Hello postgres=# create table tt(a int, b varchar); CREATE TABLE postgres=# insert into tt values(10,'hello

Re: [GENERAL] md5 of table

2011-09-01 Thread Sim Zacks
OP: I thought about using dblink and the EXCEPT query, but then I need to know the field list of each query result, which is a pain in the butt. That is not correct. As long as the table definitions are precisely the same, you can move records across dblink without specifying fields. You do

Re: [GENERAL] md5 of table

2011-09-01 Thread Merlin Moncure
2011/9/1 Grzegorz Jaśkiewicz : > On Thu, Sep 1, 2011 at 11:14 AM, Sim Zacks wrote: >> On 09/01/2011 12:26 PM, Pavel Stehule wrote: >>> >>> Hello >>> >>> postgres=# create table tt(a int, b varchar); >>> CREATE TABLE >>> postgres=# insert into tt values(10,'hello'); >>> INSERT 0 1 >>> >>> postgres=

Re: [GENERAL] md5 of table

2011-09-01 Thread Achilleas Mantzios
Στις Thursday 01 September 2011 15:50:21 ο/η Scott Marlowe έγραψε: > On Thu, Sep 1, 2011 at 3:48 AM, Achilleas Mantzios > wrote: > > md5 has size limitations, the second approach seems more practical. > > Really? I was not aware of size limits of md5, what are they? > sorry, i was wrong. i don

Re: [GENERAL] md5 of table

2011-09-01 Thread Scott Marlowe
On Thu, Sep 1, 2011 at 3:48 AM, Achilleas Mantzios wrote: > md5 has size limitations, the second approach seems more practical. Really? I was not aware of size limits of md5, what are they? -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscripti

Re: [GENERAL] md5 of table

2011-09-01 Thread Sim Zacks
On 09/01/2011 01:35 PM, Grzegorz Jaśkiewicz wrote: On Thu, Sep 1, 2011 at 11:14 AM, Sim Zacks wrote: On 09/01/2011 12:26 PM, Pavel Stehule wrote: Hello postgres=# create table tt(a int, b varchar); CREATE TABLE postgres=# insert into tt

Re: [GENERAL] md5 of table

2011-09-01 Thread Sim Zacks
I am not sure if this will work, but you can try it http://www.pgsql.cz/index.php/PostgreSQL_SQL_Tricks#Cast_to_varchar Pavel I appreciate your help, but UDTs don't have input/ouput functions unless you define them manually and I need this for all of my

Re: [GENERAL] md5 of table

2011-09-01 Thread Grzegorz Jaśkiewicz
On Thu, Sep 1, 2011 at 11:14 AM, Sim Zacks wrote: > On 09/01/2011 12:26 PM, Pavel Stehule wrote: >> >> Hello >> >> postgres=# create table tt(a int, b varchar); >> CREATE TABLE >> postgres=# insert into tt values(10,'hello'); >> INSERT 0 1 >> >> postgres=# select md5(array_to_string(array_agg(md5(

Re: [GENERAL] md5 of table

2011-09-01 Thread Sim Zacks
On 09/01/2011 12:26 PM, Pavel Stehule wrote: Hello postgres=# create table tt(a int, b varchar); CREATE TABLE postgres=# insert into tt values(10,'hello'); INSERT 0 1 postgres=# select md5(array_to_string(array_agg(md5(tt::text)),'')) from tt; md5 ---

Re: [GENERAL] md5 of table

2011-09-01 Thread Achilleas Mantzios
md5 has size limitations, the second approach seems more practical. Στις Thursday 01 September 2011 12:30:45 ο/η Karsten Hilbert έγραψε: > On Thu, Sep 01, 2011 at 11:47:24AM +0300, Sim Zacks wrote: > > > Is there a way to get an md5 or other hash of an entire table? > > > > I want to be able to

Re: [GENERAL] md5 of table

2011-09-01 Thread Karsten Hilbert
On Thu, Sep 01, 2011 at 11:47:24AM +0300, Sim Zacks wrote: > Is there a way to get an md5 or other hash of an entire table? > > I want to be able to easily compare 2 tables in different databases. > > I thought about using dblink and the EXCEPT query, but then I need to > know the field list of