Bug in contrib/intagg int_array_enum() ?

Started by Bruce Momjianabout 23 years ago7 messagesgeneral
Jump to latest
#1Bruce Momjian
bruce@momjian.us

I'm seeing some strange behaviour using the int_array_enum function in
contrib/intagg.

It seems when i set the array to an empty array by hand doing update set
level_2_ids = '{}' then int_array_enum generates some odd data:

slo=> select * from (select int_array_enum(level_2_ids) as l2,level_2_ids from cache where key_id = 900) as x where level_2_ids = '{}';
l2 | level_2_ids
------------+-------------
0 | {}
23 | {}
1 | {}
0 | {}
5541 | {}
28 | {}
1 | {}
0 | {}
23 | {}
1 | {}
0 | {}
42 | {}
100932 | {}
0 | {}
0 | {}
2113601536 | {}
589827 | {}
1583362 | {}
800 | {}
4120 | {}
1104836463 | {}
1075191249 | {}
32 | {}
1 | {}
0 | {}
23 | {}
2 | {}
0 | {}
(28 rows)

--
greg

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#1)
Re: Bug in contrib/intagg int_array_enum() ?

Greg Stark <gsstark@mit.edu> writes:

I'm seeing some strange behaviour using the int_array_enum function in
contrib/intagg.

AFAICT, intagg is completely unready to deal with arrays of other than
one dimension; nor has it got any error checks to notice when the input
is not 1-D. '{}' is treated as zero-dimensional ...

regards, tom lane

#3Reynard Hilman
reynardmh@lightsky.com
In reply to: Tom Lane (#2)
how to test whether postgres server is running?

Hi everyone,

I run into problem where pg_pconnect (in php script) failed to get
connection to the postgres server even when the server is actually
running because the server is too busy (serving too many requests).

So I want to check from php script if postgres server is running. The
only way I could think of to is telnet the server on port 5432 (where
postgres is listening).

Does someone know a better way to check if postgres server is running?

thanks
- reynard

#4Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#2)
Re: Bug in contrib/intagg int_array_enum() ?

Tom Lane <tgl@sss.pgh.pa.us> writes:

Greg Stark <gsstark@mit.edu> writes:

I'm seeing some strange behaviour using the int_array_enum function in
contrib/intagg.

AFAICT, intagg is completely unready to deal with arrays of other than
one dimension; nor has it got any error checks to notice when the input
is not 1-D. '{}' is treated as zero-dimensional ...

Ah, so then how do I construct a one-dimensional zero-sized array?

--
greg

#5Reynard Hilman
reynardmh@lightsky.com
In reply to: Reynard Hilman (#3)
Re: how to test whether postgres server is running?

thanks for the quick reply Darren, but you can't do this if the web
server is running on a different server than the database, right?

- reynard

Show quoted text

netstat -anp | grep postmaster

This will tell you if postmater is listening on the port.

If you do not have root access then

netstat -an | grep 5432

HTH

Darren

#6Darren Ferguson
darren@thread.crystalballinc.com
In reply to: Reynard Hilman (#3)
Re: how to test whether postgres server is running?

netstat -anp | grep postmaster

This will tell you if postmater is listening on the port.

If you do not have root access then

netstat -an | grep 5432

HTH

Darren

On Thu, 27 Mar 2003, Reynard Hilman wrote:

Hi everyone,

I run into problem where pg_pconnect (in php script) failed to get
connection to the postgres server even when the server is actually
running because the server is too busy (serving too many requests).

So I want to check from php script if postgres server is running. The
only way I could think of to is telnet the server on port 5432 (where
postgres is listening).

Does someone know a better way to check if postgres server is running?

thanks
- reynard

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

--
Darren Ferguson

#7Darren Ferguson
darren@thread.crystalballinc.com
In reply to: Reynard Hilman (#5)
Re: how to test whether postgres server is running?

If you have command line access to the machine with the Database you can
run the command from there.

Sorry about that i should have read the mail more

Darren

On Thu, 27 Mar 2003, Reynard Hilman wrote:

thanks for the quick reply Darren, but you can't do this if the web
server is running on a different server than the database, right?

- reynard

netstat -anp | grep postmaster

This will tell you if postmater is listening on the port.

If you do not have root access then

netstat -an | grep 5432

HTH

Darren

--
Darren Ferguson