Re: [GENERAL] Core reported from vaccum function.

2007-07-31 Thread Tom Lane
"Mavinakuli, Prasanna (STSD)" <[EMAIL PROTECTED]> writes: > Thanks Alvaro for your time and suggestions.Yes we do understand that we > are expected to use the higher versions.But as Bruce pointed out > already,the same is NOT recommended when there is NO imperative > reason. Say again? Bruce's po

Re: [GENERAL] Core reported from vaccum function.

2007-07-31 Thread Alvaro Herrera
Mavinakuli, Prasanna (STSD) wrote: > Hello Alvaro, > > Thanks Alvaro for your time and suggestions.Yes we do understand that we > are expected to use the higher versions.But as Bruce pointed out > already,the same is NOT recommended when there is NO imperative > reason.Hence we were just in the p

Re: [GENERAL] Auto Starting +/or Shutdown on OS X

2007-07-31 Thread John DeSoi
On Jul 31, 2007, at 3:27 PM, Ralph Smith wrote: How come shutdown isn't clearing things up? Or is the problem in the startup? There is a small package you can download from this page which will install in StartupItems and handle things correctly: http://www.entropy.ch/software/macosx/pos

Re: [GENERAL] Polymorphic functions' weird behavior

2007-07-31 Thread Tom Lane
"Vyacheslav Kalinin" <[EMAIL PROTECTED]> writes: > Another little issue with that function. I cannot make it > accept NULL as an argument. You'd have to cast the NULL to some specific array type. regards, tom lane ---(end of broadcast)

Re: [GENERAL] array_to_set functions

2007-07-31 Thread Merlin Moncure
On 8/1/07, Decibel! <[EMAIL PROTECTED]> wrote: > David Fetter and I just came up with these, perhaps others will find > them useful: > > CREATE OR REPLACE FUNCTION array_to_set(anyarray, int) RETURNS SETOF > anyelement LANGUAGE SQL AS $$ > SELECT $1[i] from generate_series(array_lower($1, $2),

[GENERAL] array_to_set functions

2007-07-31 Thread Decibel!
David Fetter and I just came up with these, perhaps others will find them useful: CREATE OR REPLACE FUNCTION array_to_set(anyarray, int) RETURNS SETOF anyelement LANGUAGE SQL AS $$ SELECT $1[i] from generate_series(array_lower($1, $2), array_upper($1, $2)) i $$; CREATE OR REPLACE FUNCTION ar

Re: [GENERAL] Auto Starting +/or Shutdown on OS X

2007-07-31 Thread Ralph Smith
Apologies for the huge post, but it's got everything relevant that I can think of. See below. Michael Glaesemann wrote: On Jul 31, 2007, at 14:27 , Ralph Smith wrote: === INITIAL POST I'm using scripts in /Library/StartupItems/PostgreSQL PostgreSQL starts manually just

[GENERAL] client encoding mismatch

2007-07-31 Thread Brian J. Erickson
Hello, I am getting the following error: client encoding mismatch State:22003,Native:214,Origin: Using the function "SQLDriverConnect" with the connection string "DSN=PostgreSQL;Servername=server;UID=user;Password=xx;Database=database ;" OS: Windows 2000 Postgresql Server 8.1.3 ODBC:

Re: [GENERAL] Polymorphic functions' weird behavior

2007-07-31 Thread Vyacheslav Kalinin
Tom Lane wrote: The fix is pretty easy if you need it now Thanks for the update, Tom. Another little issue with that function. I cannot make it accept NULL as an argument. It won't normally accept NULL reporting an appropriate error that it cannot determine argument type, nor will it accept

Re: [GENERAL] Auto Starting +/or Shutdown on OS X

2007-07-31 Thread Michael Glaesemann
On Jul 31, 2007, at 14:27 , Ralph Smith wrote: === INITIAL POST I'm using scripts in /Library/StartupItems/PostgreSQL PostgreSQL starts manually just fine via /usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l /usr/local/ pgsql/logfile start What user are you start

Re: [GENERAL] plperl syntax highlighting for vi

2007-07-31 Thread Richard Broersma Jr
> > http://www.gunduz.org/postgresql/pgsql.vim > > That's great for PL/PgSQL. Maybe there's a way to do it for PL/Perl, > too :) Can anyone point me to a link that shows which file vim conf file need to be configured and how to configure it to use this above .vim file? TIA, Regards, Richa

Re: [GENERAL] Auto Starting +/or Shutdown on OS X

2007-07-31 Thread Ralph Smith
=== INITIAL POST I'm using scripts in /Library/StartupItems/PostgreSQL PostgreSQL starts manually just fine via /usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l /usr/local/pgsql/logfile start PostgreSQL will not start on System restart using files in /Library/Start

Re: [GENERAL] FOREIGN KEY migration of syntax, help needed

2007-07-31 Thread Mike Haberman
Thank you for the quick response. If all my old constraints are NOT DEFERRABLE INITIALLY IMMEDIATE does that mean I don't have to worry about the deferrable keyword? mike On Tue, Jul 31, 2007 at 04:00:59PM -0400, Tom Lane wrote: > Mike Haberman <[EMAIL PROTECTED]> writes: > >

Re: [GENERAL] continue in plpgsql 7.4

2007-07-31 Thread Tom Lane
"Gauthier, Dave" <[EMAIL PROTECTED]> writes: > Lacking "continue", what would you suggest? EXIT out of a labeled BEGIN block immediately within the loop. On the whole, though, if you're doing development for PG 7.4 my reaction is "why"? Your effort would be better invested in an update.

Re: [GENERAL] plperl syntax highlighting for vi

2007-07-31 Thread David Fetter
On Tue, Jul 31, 2007 at 01:19:06PM -0400, Bruce Momjian wrote: > David Fetter wrote: > > On Mon, Jul 30, 2007 at 07:58:14PM -0500, Decibel! wrote: > > > On Jul 30, 2007, at 3:44 PM, Geoffrey wrote: > > > >Has anyone taken a stab at adding plperl syntax highlighting for > > > >vi? > > > > > > Hrm,

[GENERAL] continue in plpgsql 7.4

2007-07-31 Thread Gauthier, Dave
How does one effectively doa "continue" in plpgsql v7.4? I believe "continue" is supported in v8, but not 7. At any rate, "continue" gets flagged as a syntax error in the code I'm trying. Lacking "continue", what would you suggest? Thanks -dave

Re: [GENERAL] FOREIGN KEY migration of syntax, help needed

2007-07-31 Thread Tom Lane
Mike Haberman <[EMAIL PROTECTED]> writes: >Will the following take care of all three statements? >ALTER TABLE ONLY assettype >ADD CONSTRAINT at_fk_1 FOREIGN KEY (pid) REFERENCES assettype(id) >ON UPDATE CASCADE ON DELETE CASCADE; Yes, there are three or so triggers under the hood

Re: [GENERAL] Need quick help with standalone mode

2007-07-31 Thread RW
Thanks a lot! That was a life saver :-) Greetings Robert Merlin Moncure wrote: > On 7/31/07, RW <[EMAIL PROTECTED]> wrote: > >> Hi! >> >> I'm really in big trouble with a production database. It doesn't accept >> connections anymore: >> >> 2007-07-31 19:27:33 CEST WARNING: database "userbas

[GENERAL] FOREIGN KEY migration of syntax, help needed

2007-07-31 Thread Mike Haberman
Hi, Quick question: My old database has the old-style FOREIGN KEY syntax: CREATE CONSTRAINT TRIGGER "" AFTER INSERT OR UPDATE ON assettype FROM assettype NOT DEFERRABLE INITIALLY IMMEDIATE FOR EACH ROW EXECUTE PROCEDURE "RI_FKey_check_ins"('', 'assettype', 'assettype'

[GENERAL] Indexing Hostnames with tsearch2 and fti.c

2007-07-31 Thread Robert Landrum
We're currently using the old fti.c code for searching our database. It's indexing a mixed bag of hostnames, employee names, ticket subjects, and the like. We hacked it to make it work correctly for hostnames, ignoring whitespace and periods as word boundaries. Since were moving to 8.2, we no

Re: [GENERAL] upgrade to 8.2.? or implement Slony, which first?

2007-07-31 Thread Vivek Khera
On Jul 27, 2007, at 8:29 PM, Jim Nasby wrote: Double-check with the Slony guys, but ISTR that there's an issue going all the way from 7.4 to 8.2 in a single shot. I don't think that's a slony-specific issue. Moving from 7.4 to 8.0 introduces a fair number of incompatibilities one must add

Re: [GENERAL] Need quick help with standalone mode

2007-07-31 Thread Merlin Moncure
On 7/31/07, RW <[EMAIL PROTECTED]> wrote: > Hi! > > I'm really in big trouble with a production database. It doesn't accept > connections anymore: > > 2007-07-31 19:27:33 CEST WARNING: database "userbase" must be > vacuumed within 999832 transactions > 2007-07-31 19:27:33 CEST HINT: To avoid

Re: [GENERAL] huge file in pg_xlog and base

2007-07-31 Thread Steve Crawford
Nicola Benaglia wrote: > Hi, > I have 6 little dbs, but I see that my base directory needs 213MB and > log are 114MB. > Here my folder structure and size: > > 3571./base/1 > 3487./base/10792 > 4691./base/10793 > 3707./base/16384 > 16618 ./base/16386 > 0 ./base/64673/pgsql_t

[GENERAL] Need quick help with standalone mode

2007-07-31 Thread RW
Hi! I'm really in big trouble with a production database. It doesn't accept connections anymore: 2007-07-31 19:27:33 CEST WARNING: database "userbase" must be vacuumed within 999832 transactions 2007-07-31 19:27:33 CEST HINT: To avoid a database shutdown, execute a full-database VACUUM in "

Re: [GENERAL] Error restarting postmaster

2007-07-31 Thread Simon Riggs
On Tue, 2007-07-31 at 06:53 -0700, Andrew Edson wrote: > Yesterday, one of the (replicated) remote databases I work with > somehow got corrupted, so I attempted to drop a new copy off of the > master (on a different box) and rebuild the database. Creation, > language install, schema reload, all ap

Re: [GENERAL] plperl syntax highlighting for vi

2007-07-31 Thread Bruce Momjian
David Fetter wrote: > On Mon, Jul 30, 2007 at 07:58:14PM -0500, Decibel! wrote: > > On Jul 30, 2007, at 3:44 PM, Geoffrey wrote: > > >Has anyone taken a stab at adding plperl syntax highlighting for > > >vi? > > > > Hrm, not likely. David Fetter might be able to point you at > > something. > > >

Re: [GENERAL] PG Admin

2007-07-31 Thread Merlin Moncure
On 7/31/07, Bob Pawley <[EMAIL PROTECTED]> wrote: > > > Can anyone tell me why a table developed through the PG Admin interface > isn't found by SQL when accessing it through the SQL interface?? > > Bob Pawley likely issues: in the wrong schema in the wrong database in the wrong host :-) merlin

Re: [GENERAL] PG Admin

2007-07-31 Thread Luca Ferrari
On Tuesday 31 July 2007 Bob Pawley's cat, walking on the keyboard, wrote: > Can anyone tell me why a table developed through the PG Admin interface > isn't found by SQL when accessing it through the SQL interface?? Maybe it is a problem of case-sensitive names? Check in the table definition of pg

Re: [GENERAL] PG Admin

2007-07-31 Thread Raymond O'Donnell
On 31/07/2007 16:55, Bob Pawley wrote: Can anyone tell me why a table developed through the PG Admin interface isn't found by SQL when accessing it through the SQL interface?? Hi Bob, No reason that I can think ofcan you describe *IN DETAIL* the steps you followed and the result? Ray.

Re: [GENERAL] psql 8.2 client vs pg 8.1 server problem

2007-07-31 Thread Tom Lane
Alban Hertroys <[EMAIL PROTECTED]> writes: > But wouldn't it suffice to issue the "old" versions of the command > queries on an "old" server? It shouldn't be that hard to keep backward > compatibility among minor versions of psql. It's enough of a pain in the neck that no one has bothered ...

[GENERAL] PG Admin

2007-07-31 Thread Bob Pawley
Can anyone tell me why a table developed through the PG Admin interface isn't found by SQL when accessing it through the SQL interface?? Bob Pawley

Re: [GENERAL] Polymorphic functions' weird behavior

2007-07-31 Thread Tom Lane
Viatcheslav Kalinin <[EMAIL PROTECTED]> writes: > Now we change SECURITY INVOKER clause to SECURITY DEFINER and voila: >>> select * from array_to_set(array[1,2,3]); > ERROR: could not determine actual argument type for polymorphic > function "array_to_set" Wow, apparently you're the first perso

Re: [GENERAL] psql 8.2 client vs pg 8.1 server problem

2007-07-31 Thread Alban Hertroys
Dave Page wrote: > Alban Hertroys wrote: >> We have psql 8.2 clients on our workstations, while we still have pg 8.1 >> on our development and production servers. This causes problems like the >> following: >> >> database> \d table >> ERROR: column i.indisvalid does not exist >> database> >> >> We

Re: [GENERAL] Error restarting postmaster

2007-07-31 Thread Andrew Edson
Is somewhat old, 8.1.3. I'll try to upgrade it to the 8.1.9. The box is running on SuSE 9.2, if I recall correctly...which binary rpm should I snag for that? Tom Lane <[EMAIL PROTECTED]> wrote: Andrew Edson writes: > PANIC: block 39 unfound > LOG: startup process (PID 6403) was terminated by

Re: [GENERAL] Core reported from vaccum function.

2007-07-31 Thread Bruce Momjian
Alvaro Herrera wrote: > Mavinakuli, Prasanna (STSD) wrote: > > > > Thanks Alvaro,for your deliberate explanation.But few more > > clarifications are requested as we are too novice to postgreSQL. > > Let me give you this piece of advice, since you are too novice to > PostgreSQL: > > Do NOT conti

Re: [GENERAL] Error restarting postmaster

2007-07-31 Thread Tom Lane
Andrew Edson <[EMAIL PROTECTED]> writes: > PANIC: block 39 unfound > LOG: startup process (PID 6403) was terminated by signal 6 > LOG: aborting startup due to startup process failure What PG version is this? (If your answer had a release date more than about a year ago, first update to the lat

Re: [GENERAL] Porting MySQL data types to PostgreSQL

2007-07-31 Thread Tom Lane
[EMAIL PROTECTED] (Patrick TJ McPhee) writes: > One problem with this idea is the treatment of implicit casts between > numeric types in TypeCategory(). For implicit casts to work, the type's > OID has to be listed in that function (i.e., it has to be a built-in type). That's not the case. There

[GENERAL] huge file in pg_xlog and base

2007-07-31 Thread Nicola Benaglia
Hi, I have 6 little dbs, but I see that my base directory needs 213MB and log are 114MB. Here my folder structure and size: 3571./base/1 3487./base/10792 4691./base/10793 3707./base/16384 16618 ./base/16386 0 ./base/64673/pgsql_tmp 143697 ./base/64673 0 ./base/86171/

Re: [GENERAL] Performance problem with large resultsets (byte array 2200)

2007-07-31 Thread Tom Lane
"Victor Adolfsson" <[EMAIL PROTECTED]> writes: > I'm having a problem with bad performance when retrieving many rows where > each row has a 2200 long byte array (called template_compressed) and a 50 > character varying (called uniqueid) 2200 bytes is (just) long enough to trigger toasting of the e

Re: [GENERAL] tables not in list

2007-07-31 Thread Lee Keel
> -Original Message- > From: Viatcheslav Kalinin [mailto:[EMAIL PROTECTED] > Sent: Tuesday, July 31, 2007 9:16 AM > To: Lee Keel > Cc: pgsql-general@postgresql.org > Subject: Re: [GENERAL] tables not in list > > I usually resolve this as: > -- this function lets you select from an array >

Re: [GENERAL] tables not in list

2007-07-31 Thread Viatcheslav Kalinin
Lee Keel wrote: Is there no way to do this without doing an insert into another table? I usually resolve this as: -- this function lets you select from an array CREATE OR REPLACE FUNCTION "array_to_set" (vaarray anyarray) RETURNS SETOF anyelement AS $body$ BEGIN FOR I IN COALESCE(ARRAY_LOW

Re: [GENERAL] tables not in list

2007-07-31 Thread Lee Keel
Is there no way to do this without doing an insert into another table? _ From: paddy carroll [mailto:[EMAIL PROTECTED] Sent: Monday, July 30, 2007 3:24 PM To: Lee Keel Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] tables not in list put all your tables in a new table (pu

[GENERAL] Error restarting postmaster

2007-07-31 Thread Andrew Edson
Yesterday, one of the (replicated) remote databases I work with somehow got corrupted, so I attempted to drop a new copy off of the master (on a different box) and rebuild the database. Creation, language install, schema reload, all appeared to go well. On the actual data reload, I set the sys

Re: [GENERAL] Core reported from vaccum function.

2007-07-31 Thread Alvaro Herrera
Mavinakuli, Prasanna (STSD) wrote: > > Thanks Alvaro,for your deliberate explanation.But few more > clarifications are requested as we are too novice to postgreSQL. Let me give you this piece of advice, since you are too novice to PostgreSQL: Do NOT continue to run 7.4.2. Upgrade to 7.4.17. N

Re: [GENERAL] psql 8.2 client vs pg 8.1 server problem

2007-07-31 Thread Dave Page
Alban Hertroys wrote: We have psql 8.2 clients on our workstations, while we still have pg 8.1 on our development and production servers. This causes problems like the following: database> \d table ERROR: column i.indisvalid does not exist database> We can log into the server and use the local

[GENERAL] psql 8.2 client vs pg 8.1 server problem

2007-07-31 Thread Alban Hertroys
We have psql 8.2 clients on our workstations, while we still have pg 8.1 on our development and production servers. This causes problems like the following: database> \d table ERROR: column i.indisvalid does not exist database> We can log into the server and use the local client of course, but t

Re: [GENERAL] query to match '\N'

2007-07-31 Thread pc
On Jul 30, 3:27 am, [EMAIL PROTECTED] (Alban Hertroys) wrote: > Nis Jørgensen wrote: > > Alban Hertroys skrev: > > >> Presumably he wanted col2 like E'%N%'. > >> But doesn't \N mean NULL, or would the OP be looking for literal '\N' > >> strings in his data? Because if he's looking for NULLs it

Re: [GENERAL] Porting MySQL data types to PostgreSQL

2007-07-31 Thread Patrick TJ McPhee
In article <[EMAIL PROTECTED]>, Jim Nasby <[EMAIL PROTECTED]> wrote: % On Jul 26, 2007, at 11:06 AM, Jeff Davis wrote: % > If you really do need an unsigned type, this is a good use of % > postgresql's extensible type system. You can just create an unsigned % > type for yourself. % % If you do tha

Re: [GENERAL] query to match '\N'

2007-07-31 Thread pc
wow! works for me! Thank you !! ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Core reported from vaccum function.

2007-07-31 Thread Mavinakuli, Prasanna (STSD)
Thanks Alvaro,for your deliberate explanation.But few more clarifications are requested as we are too novice to postgreSQL. 1)When it is said "upgrade" it is NOT the upgrade of table rather it is the upgrade that does happen because of vacuum query execution?..is that understanding right?.(Becau

Re: [GENERAL] create function error

2007-07-31 Thread Tony Crisera
Sorry, received information I wasn't aware of. My understanding was this was all running on the db server, but the script was actually being executed through another server (web) that only had a 7.4 client. This appears to have been the problem. Thanks. Tony Crisera Michael Glaesemann

Re: [GENERAL] Core reported from vaccum function.

2007-07-31 Thread Mavinakuli, Prasanna (STSD)
Hello Alvaro, Thanks for your reply. We could see "Fix potential-data-corruption bug in how VACUUM FULL handles UPDATE chains (Tom, Pavan Deolasee) " in 7.4.17 release notes. Could you please elaborate more on the above problem.Meaning what was the actual problem and what fix has been done et

[GENERAL] Polymorphic functions' weird behavior

2007-07-31 Thread Viatcheslav Kalinin
Hello We've come across the following issue with Polymorphic functions: CREATE OR REPLACE FUNCTION "array_to_set" (vaarray anyarray) RETURNS SETOF anyelement AS $body$ BEGIN FOR I IN COALESCE(ARRAY_LOWER(VAARRAY, 1), 1) .. COALESCE(ARRAY_UPPER(VAARRAY, 1), 0) LOOP RETURN NEXT VAARRAY

[GENERAL] Performance problem with large resultsets (byte array 2200)

2007-07-31 Thread Victor Adolfsson
Hi I'm having a problem with bad performance when retrieving many rows where each row has a 2200 long byte array (called template_compressed) and a 50 character varying (called uniqueid) Is there a better datatype than bytea when it is important to fetch the information from the database? Would

Re: [GENERAL] alter table table add column

2007-07-31 Thread Nis Jørgensen
Ronald Rojas skrev: > Hi, > > Anybody knows how to add column with reference to BEFORE or AFTER any > given column? Let say here's my table structure: > > Column | Type| Modifiers > --+---+--- > surname | character varying | > lastname | chara

Re: [GENERAL] [NOVICE] alter table table add column

2007-07-31 Thread Peter Childs
On 31/07/07, Ronald Rojas <[EMAIL PROTECTED]> wrote: > > Oh yes you have a good point. But then I will still have to test insert > and update on views. > > Thanks a lot michael! > > On Tue, 2007-07-31 at 00:56 -0500, Michael Glaesemann wrote: > > On Jul 31, 2007, at 0:23 , Ronald Rojas wrote: > >

Re: [GENERAL] Manual Vaccum very slow with Autovaccum enabled

2007-07-31 Thread Gregory Stark
"Andy Dale" <[EMAIL PROTECTED]> writes: > Hi, > > I am working with a 3 Postgresql databases, 1 is configured with autovaccum > enabled with the following settings: > > vacuum_cost_delay = 200 # 0-1000 milliseconds > vacuum_cost_limit = 100 # 0-1 credits ... >

[GENERAL] Manual Vaccum very slow with Autovaccum enabled

2007-07-31 Thread Andy Dale
Hi, I am working with a 3 Postgresql databases, 1 is configured with autovaccum enabled with the following settings: vacuum_cost_delay = 200 # 0-1000 milliseconds vacuum_cost_page_hit = 6# 0-1 credits #vacuum_cost_page_miss = 10 # 0-1 credits #vacuu