Re: [GENERAL] /usr/sbin/useradd is needed by postgresql-server-8.0.1-PGDG

2005-02-15 Thread Rey Arqueza
Ok.. thanks. ...seconds later... It worked! hmm.. strange... why is that? is this a bug for the rpm installer? If so, here's my distro: Fedora Core 2 maybe the rpm has issues with this distro? - Original Message - From: "Uwe C. Schroeder" <[EMAIL PROTECTED]> To: "Rey Arqueza" <[EM

[GENERAL] Slony uninstall info/warning

2005-02-15 Thread John Sidney-Woollett
Hopefully this will prevent data loss or problems for others using slony 1.0.5 and pg 7.4.6... We just got bitten by something we didn't foresee when completely uninstalling a slony replication cluster from the master and slave... MAKE SURE YOU STOP YOUR APPLICATION RUNNING AGAINST YOUR MASTER

[GENERAL] How to view the list of tables?

2005-02-15 Thread Konstantin Danilov
Hello, list! I need to view the list of tables in a database. In MySQL I can do it with the command "SHOW TABLES". What about PostgreSQL? Can I also see somehow the datatypes of tables' fields? Konstantin ---(end of broadcast)--- TIP 6: Have you se

Re: [GENERAL] How to view the list of tables?

2005-02-15 Thread Richard Huxton
Konstantin Danilov wrote: Hello, list! I need to view the list of tables in a database. In MySQL I can do it with the command "SHOW TABLES". What about PostgreSQL? Can I also see somehow the datatypes of tables' fields? Konstantin "man psql" will show you details of how to operate the psql applica

Re: [GENERAL] Lost rows/data corruption?

2005-02-15 Thread Geoffrey
Tom Lane wrote: "Andrew Hall" <[EMAIL PROTECTED]> writes: We haven't been able to isolate what causes it but it's unlikely to be hardware as it happens on quite a few of our customer's boxes. Okay, then not hardware; but it seems like you ought to be in a position to create a test case for other p

Re: [GENERAL] How to view the list of tables?

2005-02-15 Thread Shridhar Daithankar
On Tuesday 15 Feb 2005 3:46 pm, Konstantin Danilov wrote: > Hello, list! > I need to view the list of tables in a database. In MySQL I can do it with > the command "SHOW TABLES". What about PostgreSQL? Can I also see somehow > the datatypes of tables' fields? In psql, you can try '\dt' and '\d tab

Re: [GENERAL] /usr/sbin/useradd is needed by postgresql-server-8.0.1-PGDG

2005-02-15 Thread Geoffrey
Rey Arqueza wrote: I have added /usr/sbin to my path (bash) and /usr/sbin/useradd does exist (and the command works when I type the command from any directory). However I still get the same error when running rpm -i ..etc. Silly question, but does /usr/sbin/useradd exist? Was it installed by an

Re: [GENERAL] Slony uninstall info/warning

2005-02-15 Thread Richard Huxton
John Sidney-Woollett wrote: Hopefully this will prevent data loss or problems for others using slony 1.0.5 and pg 7.4.6... We just got bitten by something we didn't foresee when completely uninstalling a slony replication cluster from the master and slave... MAKE SURE YOU STOP YOUR APPLICATION

Re: [GENERAL] Slony uninstall info/warning

2005-02-15 Thread John Sidney-Woollett
Thanks for the info, Richard. I didn't think that it was a slony issue per se, but that a note should be added to the slony docs warning to recycle connections after making substantive changes to the schema. You're right, we use both (java) prepared statements and pl/pgsql functions. The data lo

Re: [GENERAL] Slony uninstall info/warning

2005-02-15 Thread Richard Huxton
John Sidney-Woollett wrote: Thanks for the info, Richard. I didn't think that it was a slony issue per se, but that a note should be added to the slony docs warning to recycle connections after making substantive changes to the schema. You're right, we use both (java) prepared statements and pl/

Re: [GENERAL] Slony uninstall info/warning

2005-02-15 Thread Csaba Nagy
Hi all, It's just marginally relevant to the issue at hand: in our code we drop the connection on any error we cannot map to an expected condition. This would eventually recycle all connections on such unexpected problems after just one error per connection. Of course if the error surfaces as a co

Re: [GENERAL] Slony uninstall info/warning

2005-02-15 Thread John Sidney-Woollett
Richard Huxton wrote: > Hmm - not sure you could do this without a savepoint to catch the > error. > However, it might be possible to add track dependencies with the > function (as with views). Then you'd have to issue a CASCADE to alter > the table. If you use Oracle and drop and recreate a table

Re: [GENERAL] regular expressions in query

2005-02-15 Thread Lincoln Yeoh
But that method would be specific for searches for the last 4 digits. It won't work as well for the general case of the last X digits. To clarify the method I suggested: Say a phone number is: 818 9567 1234 You reverse the number and store it as text and index it as 43217659818 Then if someone se

Re: [Slony1-general] Re: [GENERAL] Slony uninstall info/warning

2005-02-15 Thread David Parker
We recently ran into this as well, because in testing we had people leaving an application running against the database while they uninstalled slony. I'm curious, what OIDs would be missing exactly, since the application does not refer directly to any slony objects? Does the cached plan "know" abo

Re: [Slony1-general] Re: [GENERAL] Slony uninstall info/warning

2005-02-15 Thread John Sidney-Woollett
It doesn't make sense to me either. The error was always for the same OID. Like you I assumed that removing slony would not cause any problems to a running app. Hopefully someone more involved in Slony will be able to explain why my pl/pgsql functions all got broken after uninstalling slony, eve

Re: [GENERAL] Lost rows/data corruption?

2005-02-15 Thread Scott Marlowe
On Tue, 2005-02-15 at 04:56, Geoffrey wrote: > Tom Lane wrote: > > "Andrew Hall" <[EMAIL PROTECTED]> writes: > > > >> We haven't been able to isolate what causes it but it's unlikely to be > >> hardware as it happens on quite a few of our customer's boxes. > > > > > > Okay, then not hardware; bu

[GENERAL] Trading off large objects (arrays, large strings, large tables) for timeseries

2005-02-15 Thread Antonios Christofides
My questions briefly: (1) I made experiments with large (millions of rows/elements) arrays of text (text[], each element is 20-30 characters). On 7.4 (Debian Sarge prepackaged), inserting such an array takes forever (10 thousand elements per minute), but accessing, or writing an el

Re: [GENERAL] database encoding "WIN" -- Western or Cyrillic?

2005-02-15 Thread Peter Eisentraut
Am Dienstag, 15. Februar 2005 00:09 schrieb Preston Landers: > Assuming that it is indeed supposed to be Cyrillic, that leaves the > question of how to create a Postgresql database using Windows CP 1252 > a.k.a. "Western" or "ANSI". You don't. That encoding is not supported (mostly because no one

Re: [GENERAL] Trading off large objects (arrays, large strings, large tables) for timeseries

2005-02-15 Thread Tom Lane
Antonios Christofides <[EMAIL PROTECTED]> writes: > Why 25 seconds for appending an element? Would you give us a specific test case, rather than a vague description of what you're doing? > (2) I also tried using a large (80M) text instead (i.e. instead of > storing an array of lines, I st

Re: [GENERAL] Trading off large objects (arrays, large strings, large tables) for timeseries

2005-02-15 Thread Shridhar Daithankar
On Tuesday 15 Feb 2005 8:03 pm, Antonios Christofides wrote: > I'm also considering a table, of course, where each timeseries record > will be one row. I have experimented only a little with that (id > integer, date timestamp, value double precision, flags text, primary > key(id, date)). It appears

[GENERAL] Alternate db location

2005-02-15 Thread rwhart
Hi all, I am installing 8.0.1 on FC3. The initial installatin went well. I am now trying to change and use a different directory /pg_data. I have established and exportede PGDATA and it is /pg_data. I have mkdir /pg_data and changed the owner to postgres and run chmod with 700 on the directory

Re: [GENERAL] Alternate db location

2005-02-15 Thread Scott Marlowe
On Tue, 2005-02-15 at 09:16, [EMAIL PROTECTED] wrote: > Hi all, > I am installing 8.0.1 on FC3. The initial installatin went well. I am now > trying to change and use a different directory /pg_data. I have established > and > exportede PGDATA and it is /pg_data. I have mkdir /pg_data and chan

Re: [GENERAL] Trading off large objects (arrays, large strings,

2005-02-15 Thread Pavel Stehule
Hello, I did package for packing and unpacking large time series (in text format) into binary object. You can use it. Its very fast, storing 3 cols and 9 rows ~ 10sec(P160). testdb011=# select * FROM time_series_unpack( testdb011(# time_series_pack( testdb011(# '10.23, 10.21, 10.222

Re: [GENERAL] Lost rows/data corruption?

2005-02-15 Thread Marco Colombo
On Tue, 15 Feb 2005, Andrew Hall wrote: It sounds like a mess, all right. Do you have a procedure to follow to replicate this havoc? Are you sure there's not a hardware problem underlying it all? regards, tom lane We haven't been able to isolate what causes it but it's unlikely to be hardware as

[GENERAL] problem with dots in order by

2005-02-15 Thread Ruben Oliveira
Hello everybody ! I have this order by : select lalala from tablex order by field_y; where field_y is a text column. that returns something like : 2.1004.11 21.00.461 2.1006.21 in PostgreSQL 7.3.2 in Linux Mandrake 9.1 but in PostgreSQL 8.0.0 in Windows XP it works as I expected ... 2.1004.11 2.10

Re: [GENERAL] random record from small set

2005-02-15 Thread Jan Poslusny
And what about another data representation like create table r1 ( i int, chance_from numeric, chance_to numeric ) , you can select one random row in one select, for instance select * from r1 where chance_from <= $rnd and chance_to > $rnd; I see these advantages - Only one select. - Indices ca

Re: [GENERAL] random record from small set

2005-02-15 Thread Jan Poslusny
Or create table r1 ( i int, chance_from numeric ) and select * from r1 where chance_from <= $rnd order by chance_from desc limit 1; which can be easier updated... Just ideas, I has never tested it... Jan Poslusny wrote: And what about another data representation like create table r1 ( i int,

Re: [GENERAL] problem with dots in order by

2005-02-15 Thread Tom Lane
Ruben Oliveira <[EMAIL PROTECTED]> writes: > Can anybody tell me if there is something I can do in the Linux config > to have the same order by result ?? Sort order is determined by locale, not encoding. You did the Linux initdb in the wrong locale (possibly something like en_US where you'd rath

Re: [GENERAL] Alternate db location

2005-02-15 Thread Tom Lane
[EMAIL PROTECTED] writes: > [ initdb fails with ] > creating directory /pg_data/pg_tblspc ... ok > selecting default max_connections ... 10 > selecting default shared_buffers ... 50 > creating configuration files ... ok > creating template1 database in /pg_data/base/1 ... Hmm, the "default max_co

Re: [GENERAL] problem with dots in order by

2005-02-15 Thread Stephan Szabo
On Tue, 15 Feb 2005, Ruben Oliveira wrote: > Hello everybody ! > > I have this order by : > select lalala from tablex order by field_y; > where field_y is a text column. > > that returns something like : > 2.1004.11 > 21.00.461 > 2.1006.21 > > in PostgreSQL 7.3.2 in Linux Mandrake 9.1 > > but in

Re: [GENERAL] database encoding "WIN" -- Western or Cyrillic?

2005-02-15 Thread Serguei A. Mokhov
> Date: Tue, 15 Feb 2005 15:47:14 +0100 > From: Peter Eisentraut <[EMAIL PROTECTED]> > > > I remain mystified why the "WIN" encoding would default to a fairly > > obscure Cyrillic encoding considering most Russian users that I know > > are using either KOI8 or Unicode. > > Legacy. I'd not call it

Re: [GENERAL] Alternate db location

2005-02-15 Thread Marco Colombo
On Tue, 15 Feb 2005 [EMAIL PROTECTED] wrote: Hi all, I am installing 8.0.1 on FC3. The initial installatin went well. I am now trying to change and use a different directory /pg_data. I have established and exportede PGDATA and it is /pg_data. I have mkdir /pg_data and changed the owner to post

Re: [GENERAL] problem with dots in order by

2005-02-15 Thread Ruben Oliveira
Thanks for the quick reply :) I missed the localization part of the manual , shame on me !! http://www.postgresql.org/docs/current/static/charset.html LC_COLLATE String sort order I did: set|grep LC and because I am portuguese it returns pt_PT just a quick question if you please : is there any impl

[GENERAL] CURSORs and selects with parameters

2005-02-15 Thread Dan Sugalski
When using cursors through the libpq interface, do I need to be passing in the parameters when I'm FETCHing from them? I've got some code that uses PQexecParams and does the equivalent of: DECLARE a_cursor CURSOR FOR SELECT foo, bar FROM baz WHERE field = $1 FETCH NEXT a_cursor but when I g

Re: [GENERAL] CURSORs and selects with parameters

2005-02-15 Thread Michael Fuhr
On Tue, Feb 15, 2005 at 02:32:56PM -0500, Dan Sugalski wrote: > > I've got some code that uses PQexecParams and does the equivalent of: > >DECLARE a_cursor CURSOR FOR SELECT foo, bar FROM baz WHERE field = $1 >FETCH NEXT a_cursor > > but when I get to the FETCH I'm getting back the error

Re: [GENERAL] CURSORs and selects with parameters

2005-02-15 Thread Dan Sugalski
At 12:50 PM -0700 2/15/05, Michael Fuhr wrote: On Tue, Feb 15, 2005 at 02:32:56PM -0500, Dan Sugalski wrote: I've got some code that uses PQexecParams and does the equivalent of: DECLARE a_cursor CURSOR FOR SELECT foo, bar FROM baz WHERE field = $1 FETCH NEXT a_cursor but when I get to th

Re: [GENERAL] Slony uninstall info/warning

2005-02-15 Thread Christopher Browne
In an attempt to throw the authorities off his trail, [EMAIL PROTECTED] (John Sidney-Woollett) transmitted: > MAKE SURE YOU STOP YOUR APPLICATION RUNNING AGAINST YOUR MASTER > DATABASE WHEN REMOVING THE WHOLE SLONY CLUSTER, or at least re-cycle > all your open connections after the event! > > The

[GENERAL] Schema comparison tool

2005-02-15 Thread Jeff Amiel
I'm looking specifically for a tool to help compare 2 database schemas (nominally, production and development) and generate the appropriate SQL (that can be later executed) to bring the to schema's into sync. Option1 : pg_dump -s firstdatabasename > first pg_dump -s seconddatabasename > second

Re: [GENERAL] Schema comparison tool

2005-02-15 Thread Bradley D. Snobar
The database comparer tool is one of EMS better products. http://www.sqlmanager.net/ http://www.sqlmanager.net/products/postgresql/dbcomparer Jeff Amiel <[EMAIL PROTECTED]> wrote: >I'm looking specifically for a tool to help compare 2 database schemas >(nominally, production and development) a

Re: [GENERAL] PostgreSQL vs. MySQL vs. Oracle, 2005 report card

2005-02-15 Thread Jim C. Nasby
They also say that mysql is free, which isn't the case for commercial applications. On Mon, Feb 14, 2005 at 07:36:44PM +0530, Shridhar Daithankar wrote: > On Friday 11 Feb 2005 6:07 pm, Marques Johansson wrote: > > A recent Slashdot thread on MySQL performance > > (http://developers.slashdot.org/a

Re: [GENERAL] Lost rows/data corruption?

2005-02-15 Thread Andrew Hall
fsync is on for all these boxes. Our customers run their own hardware with many different specification of hardware in use. Many of our customers don't have UPS, although their power is probably pretty reliable (normal city based utilities), but of course I can't guarantee they don't get an outa

[GENERAL] Need to check palloc() return value?

2005-02-15 Thread Michael Fuhr
Do user-defined functions need to check palloc()'s return value, or does return guarantee success? The latter appears to be the case: Datum palloctest(PG_FUNCTION_ARGS) { int32 nbytes = PG_GETARG_INT32(0); char *p; ereport(INFO, (errmsg("calling palloc"))); p = palloc(nbytes);

Re: [GENERAL] random record from small set

2005-02-15 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 > Here's what I have so far: If you go that route, make sure you check for edge cases, such as reaching the end of the rows without hitting your number: while($accum < $r) { die qq{Ran out of rows!\n} if ! defined $res->

Re: [GENERAL] Need to check palloc() return value?

2005-02-15 Thread Neil Conway
On Tue, 2005-02-15 at 20:13 -0700, Michael Fuhr wrote: > Do user-defined functions need to check palloc()'s return value, > or does return guarantee success? It guarantees success. -Neil ---(end of broadcast)--- TIP 9: the planner will ignore you

[GENERAL] hung postmaster?

2005-02-15 Thread Ed L.
I'm seeing some unpleasant database cluster seizures. After running fine for hours, days, even weeks, all of a sudden new connections via psql, DBI, libpq, all completely hang with no log message or error, while existing connections can continue to execute queries, log messages, etc. Postmas