Re: [HACKERS] bin checks taking too long.

2014-12-23 Thread Andrew Dunstan
On 12/22/2014 10:41 PM, Peter Eisentraut wrote: On 12/22/14 7:56 PM, Andrew Dunstan wrote: Currently the buildfarm animal crake (my development instance) is running the bin check, but not any other animal. These tests still take for too long, not least because each set of tests requires a

Re: [HACKERS] bin checks taking too long.

2014-12-23 Thread Andrew Dunstan
On 12/23/2014 11:11 AM, Andrew Dunstan wrote: On 12/22/2014 10:41 PM, Peter Eisentraut wrote: On 12/22/14 7:56 PM, Andrew Dunstan wrote: Currently the buildfarm animal crake (my development instance) is running the bin check, but not any other animal. These tests still take for too long, not

[HACKERS] bin checks taking too long.

2014-12-22 Thread Andrew Dunstan
Currently the buildfarm animal crake (my development instance) is running the bin check, but not any other animal. These tests still take for too long, not least because each set of tests requires a separate install. I have complained about this before, but we don't seem to have made any

Re: [HACKERS] bin checks taking too long.

2014-12-22 Thread Peter Eisentraut
On 12/22/14 7:56 PM, Andrew Dunstan wrote: Currently the buildfarm animal crake (my development instance) is running the bin check, but not any other animal. These tests still take for too long, not least because each set of tests requires a separate install. You can avoid that by using make

[HACKERS] BIN()

2005-11-29 Thread Christopher Kings-Lynne
Hi guys, How would I go about implementing MySQL's BIN() function easily in PL/SQL. mysql SELECT BIN(12); - '1100' Basically it converts a bigint to a string containing 1's and 0's. I've tried messing about with bit() types, but those types lack casts to text, etc. And they are left

Re: [HACKERS] BIN()

2005-11-29 Thread Andrew Dunstan
here's a plperl version :-) : create or replace function bin(bigint) returns text language plperl as $$ my $arg = $_[0] + 0; my $res = ; while($arg) { $res = ($arg % 2) . $res; $arg = 1; } return $res; $$; cheers andrew Christopher Kings-Lynne wrote: Hi guys, How would I

Re: [HACKERS] BIN()

2005-11-29 Thread Michael Fuhr
On Tue, Nov 29, 2005 at 09:46:13PM -0500, Andrew Dunstan wrote: create or replace function bin(bigint) returns text language plperl as $$ my $arg = $_[0] + 0; my $res = ; while($arg) { $res = ($arg % 2) . $res; $arg = 1; } return $res; $$; Any reason not to use

Re: [HACKERS] BIN()

2005-11-29 Thread Christopher Kings-Lynne
create or replace function bin(bigint) returns text language plperl as $$ my $arg = $_[0] + 0; my $res = ; while($arg) { $res = ($arg % 2) . $res; $arg = 1; } return $res; $$; Any reason not to use sprintf(%b, $_[0])? All very well and good, but it has to be PL/SQL preferably or

Re: [HACKERS] BIN()

2005-11-29 Thread Michael Fuhr
On Tue, Nov 29, 2005 at 07:57:58PM -0700, Michael Fuhr wrote: Any reason not to use sprintf(%b, $_[0])? Or something like this in SQL or PL/pgSQL: test= SELECT ltrim(textin(bit_out(12::bit(64))), '0'); ltrim --- 1100 (1 row) -- Michael Fuhr ---(end of

Re: [HACKERS] BIN()

2005-11-29 Thread Christopher Kings-Lynne
Or something like this in SQL or PL/pgSQL: test= SELECT ltrim(textin(bit_out(12::bit(64))), '0'); ltrim --- 1100 (1 row) Swet. Good old i/o functions. Chris ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [HACKERS] BIN()

2005-11-29 Thread Tom Lane
Christopher Kings-Lynne [EMAIL PROTECTED] writes: test= SELECT ltrim(textin(bit_out(12::bit(64))), '0'); ltrim --- 1100 (1 row) Swet. Good old i/o functions. Who needs the I/O functions? Just cast int to bit(n). regards, tom lane

Re: [HACKERS] BIN()

2005-11-29 Thread Christopher Kings-Lynne
Tom Lane wrote: Christopher Kings-Lynne [EMAIL PROTECTED] writes: test= SELECT ltrim(textin(bit_out(12::bit(64))), '0'); ltrim --- 1100 (1 row) Swet. Good old i/o functions. Who needs the I/O functions? Just cast int to bit(n). Then how do you remove all leading zeros,

Re: [HACKERS] BIN()

2005-11-29 Thread Andrew Dunstan
Michael Fuhr wrote: On Tue, Nov 29, 2005 at 09:46:13PM -0500, Andrew Dunstan wrote: create or replace function bin(bigint) returns text language plperl as $$ my $arg = $_[0] + 0; my $res = ; while($arg) { $res = ($arg % 2) . $res; $arg = 1; } return $res; $$; Any reason not

Re: [HACKERS] BIN()

2005-11-29 Thread Tino Wildenhain
Am Mittwoch, den 30.11.2005, 10:15 +0800 schrieb Christopher Kings-Lynne: Hi guys, How would I go about implementing MySQL's BIN() function easily in PL/SQL. mysql SELECT BIN(12); - '1100' Basically it converts a bigint to a string containing 1's and 0's. I've tried messing

Re: [HACKERS] BIN()

2005-11-29 Thread Michael Fuhr
On Wed, Nov 30, 2005 at 07:42:36AM +0100, Tino Wildenhain wrote: In python, I usually go like this: In Ruby (and therefore in PL/Ruby) you could do this: 10.to_s(2) = 1010 10.to_s(16) = a -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have

Re: [HACKERS] BIN()

2005-11-29 Thread Tino Wildenhain
Am Mittwoch, den 30.11.2005, 00:03 -0700 schrieb Michael Fuhr: On Wed, Nov 30, 2005 at 07:42:36AM +0100, Tino Wildenhain wrote: In python, I usually go like this: In Ruby (and therefore in PL/Ruby) you could do this: 10.to_s(2) = 1010 10.to_s(16) = a is there a