Re: [HACKERS] bin checks taking too long.

2014-12-23 Thread Noah Misch
On Tue, Dec 23, 2014 at 01:55:46PM -0500, Andrew Dunstan wrote: > On 12/23/2014 11:11 AM, Andrew Dunstan wrote: > > Use of uninitialized value $ENV{"top_builddir"} in concatenation (.) > > or string at t/001_start_stop.pl line 17. > > file not found: /src/test/regress/pg_regress at > >/home/b

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

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 separ

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 ma

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 1000.

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: H

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 tri

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 no

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 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
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 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 broadc

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 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 t

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