Re: [GENERAL] pg_dump and schemas

2008-04-04 Thread Brent Wood
Hi Rusty, Try passing the output through a utility like sed, already there under Linux , but versions that work under Windows are available (eg, cygwin) eg, using a pipe: pg_dump -d | sed 's/public/test1/g' > dump.sql or converting a pg_dump output file: pg_dump cat dump.sql | se

[GENERAL] Word boundaries in regular expressions

2008-04-04 Thread Troy Rasiah
Apologies if this has been posted somewhere else but what is the equivalent of perl's \b in postgres regular expressions ? -- Troy Rasiah -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-ge

Re: [GENERAL] Direct access to GIST structure

2008-04-04 Thread Oleg Bartunov
Tim, we have this in our TODO http://www.sai.msu.su/~megera/wiki/TODO Current interface doesn't allow tree navigation. We're looking for sponsorships of this project. Oleg On Fri, 4 Apr 2008, Tim Keitt wrote: I was wondering if there is a way to get access to the tree structure underlying at G

Re: [GENERAL] Direct access to GIST structure

2008-04-04 Thread Teodor Sigaev
I just stumbled on http://www.cs.purdue.edu/spgist/ which seems like exactly what I need. It doesn't work with 8.2 and up, because since 8.2 index should take care about concurrent access itself and that implementation doesn't do it. -- Teodor Sigaev E-mail:

Re: [GENERAL] dump data into complex type table

2008-04-04 Thread Craig Ringer
[EMAIL PROTECTED] wrote: hi,everyone,first thank you help me relove the problem about complex type. now i have other two question about complex type field. firstly, i want to know if the complex type data can be dump into the database by command 'copy'? secondly, i try it but failure. The follow

Re: [GENERAL] Conversion to 8.3

2008-04-04 Thread Scott Marlowe
On Fri, Apr 4, 2008 at 2:39 PM, Terry Lee Tucker <[EMAIL PROTECTED]> wrote: > On Friday 04 April 2008 15:01, Craig Ringer wrote: > > > Terry Lee Tucker wrote: > > > Greetings: > > > > > > I am converting our application from 7.4.19 to 8.3.1. In the old scheme > > > of things, I was generating a

Re: [GENERAL] Direct access to GIST structure

2008-04-04 Thread Tim Keitt
On Fri, Apr 4, 2008 at 4:58 PM, Teodor Sigaev <[EMAIL PROTECTED]> wrote: > > > > encode spatial proximity. Is there an API (backend C-level is fine) to > > access a GIST index? > > > > The best way is to extend existing interface to GiST to support KNN-search. > But you can see how to get access t

[GENERAL] dump data into complex type table

2008-04-04 Thread windwxc
hi,everyone,first thank you help me relove the problem about complex type. now i have other two question about complex type field. firstly, i want to know if the complex type data can be dump into the database by command 'copy'? secondly, i try it but failure. The following is detail about my oper

Re: [GENERAL] Conversion to 8.3

2008-04-04 Thread Terry Lee Tucker
On Friday 04 April 2008 16:36, Tom Lane wrote: > Terry Lee Tucker <[EMAIL PROTECTED]> writes: > > I am converting our application from 7.4.19 to 8.3.1. In the old scheme > > of things, I was generating an interval between two timestamps and > > evaluating the interval string in another set of trigg

Re: [GENERAL] Conversion to 8.3

2008-04-04 Thread Terry Lee Tucker
On Friday 04 April 2008 15:01, Craig Ringer wrote: > Terry Lee Tucker wrote: > > Greetings: > > > > I am converting our application from 7.4.19 to 8.3.1. In the old scheme > > of things, I was generating an interval between two timestamps and > > evaluating the interval string in another set of tri

Re: [GENERAL] too many LWLocks taken

2008-04-04 Thread Tom Lane
Alex Vinogradovs <[EMAIL PROTECTED]> writes: > Version is 8.2.5 running on FreeBSD 6.2. I can try upgrading > to 8.2.7, if you think that would help. Well, an upgrade would be a good idea on general principles, but I doubt it will fix a previously unknown bug. Does the postmaster log show any oth

Re: [GENERAL] too many LWLocks taken

2008-04-04 Thread Alex Vinogradovs
Version is 8.2.5 running on FreeBSD 6.2. I can try upgrading to 8.2.7, if you think that would help. I don't think I can make a test case. Database had been up for a year now, with about 2 thousand inherited tables (partitioning) and about 2B rows in all tables... On Fri, 2008-04-04 at 18:58 -04

Re: [GENERAL] Duplicate Key violation on dump&reload using pg_restore

2008-04-04 Thread Markus Wollny
Tom Lane wrote: > Maybe there actually is a duplicate key in the source DB --- have you > checked? There were some bugs in early 8.2.x releases that could > possibly allow that to happen. Thanks, I was hoping there would be an easy explanation like that. I guess I'll have to do a little reading

Re: [GENERAL] Duplicate Key violation on dump&reload using pg_restore

2008-04-04 Thread Markus Wollny
Quick update: Seems like removing that tuple has solved the issue, dump and import of that table went fine, everything is where is should be - but there shouldn't have been an issue there in the first place however, with the primary key constraint present in the source database. I'm still curiou

Re: [GENERAL] Duplicate Key violation on dump&reload using pg_restore

2008-04-04 Thread Tom Lane
"Markus Wollny" <[EMAIL PROTECTED]> writes: > I'm currently trying to migrate one of our databases from PostgreSQL 8.2.4 to > PostgreSQL 8.3.1. I have worked around the Tsearch2 migration (we used the > contrib module) without too much hassle, but find myself stuck at an > unexpected point - I g

Re: [GENERAL] too many LWLocks taken

2008-04-04 Thread Tom Lane
Alex Vinogradovs <[EMAIL PROTECTED]> writes: > I've got a pretty large database, and since certain time > it started giving me "too many LWLocks taken" when running > some batch inserts... Any parameter can be ajusted ? Oh really? That's a bug, not something you need to adjust a parameter for. C

[GENERAL] Duplicate Key violation on dump&reload using pg_restore

2008-04-04 Thread Markus Wollny
Hello! I'm currently trying to migrate one of our databases from PostgreSQL 8.2.4 to PostgreSQL 8.3.1. I have worked around the Tsearch2 migration (we used the contrib module) without too much hassle, but find myself stuck at an unexpected point - I get a duplicate key violation for the primar

Re: [GENERAL] psql: FATAL: role "xyz" is not permitted to log in

2008-04-04 Thread Ralph Smith
Egg in the face time. I knew it was going to be one of those... CREATE ROLE --DOES NOT EQUAL-- CREATE USER Whereas the latter implies LOGIN priv, the former does not. I'd read about LOGIN auto-implied some time ago, but I'd not noticed that is not so w/ a created ROLE. Maybe you can sme

Re: [GENERAL] Exception messages -> application?

2008-04-04 Thread Karsten Hilbert
On Fri, Apr 04, 2008 at 12:02:20PM -0700, Frank Miles wrote: > I have a moderately DB-ignorant question: is there a "built-in" way for an > application to receive the message emitted by a RAISE in a PgSQL > function? > > Context: I have a moderately complex application (in python, using psyc

Re: [GENERAL] Direct access to GIST structure

2008-04-04 Thread Teodor Sigaev
encode spatial proximity. Is there an API (backend C-level is fine) to access a GIST index? The best way is to extend existing interface to GiST to support KNN-search. But you can see how to get access to index structure from module in gevel module (http://www.sigaev.ru/cvsweb/cvsweb.cgi/gev

Re: [GENERAL] psql: FATAL: role "xyz" is not permitted to log in

2008-04-04 Thread Tom Lane
Ralph Smith <[EMAIL PROTECTED]> writes: > However I'm now trying to access it using all lower case. > Are you saying that IT'S confused and I should go all lower or use > quotes (") not (')? Well, you can do it either way. If you want the database to be really truly named "LabNews_dev" (mixed c

[GENERAL] too many LWLocks taken

2008-04-04 Thread Alex Vinogradovs
Guys, I've got a pretty large database, and since certain time it started giving me "too many LWLocks taken" when running some batch inserts... Any parameter can be ajusted ? Thanks! Best regards, Alex Vinogradovs -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make

Re: [GENERAL] Out of memory

2008-04-04 Thread Tom Lane
Alex Adriaanse <[EMAIL PROTECTED]> writes: > ... possible that these particular addresses have shifted due to the > different environment and now point to irrelevant instructions. But in > case they haven't, here's the output I got: > (gdb) x/i 0x0049ea35 > 0x49ea35 :callq 0x562c00

[GENERAL] Direct access to GIST structure

2008-04-04 Thread Tim Keitt
I was wondering if there is a way to get access to the tree structure underlying at GIST index? What I would like to do is perform a breadth-first search on the tree in order to find nearest neighbors (using PostGIS data types). Nearest neighbor searchers are not very efficient using only range que

Re: [GENERAL] psql: FATAL: role "xyz" is not permitted to log in

2008-04-04 Thread Ralph Smith
On Apr 4, 2008, at 2:11 PM, Tom Lane wrote: --- Ralph Smith <[EMAIL PROTECTED]> writes: I just can't connect to a database, though I can to others as other users... You'

Re: [GENERAL] psql: FATAL: role "xyz" is not permitted to log in

2008-04-04 Thread Tom Lane
Ralph Smith <[EMAIL PROTECTED]> writes: > I just can't connect to a database, though I can to others as other > users... You're confused about the rules for case sensitivity. > postgres=# CREATE DATABASE LabNews_dev WITH OWNER=xyz ENCODING='UTF8' ; > CREATE DATABASE This got folded to lower ca

[GENERAL] psql: FATAL: role "xyz" is not permitted to log in

2008-04-04 Thread Ralph Smith
I just can't connect to a database, though I can to others as other users... postgres=# CREATE ROLE xyz WITH password 'abc' ; CREATE ROLE postgres=# CREATE DATABASE LabNews_dev WITH OWNER=xyz ENCODING='UTF8' ; CREATE DATABASE postgres=# grant create, connect on database LabNews_dev to xyz wi

Re: [GENERAL] creating a temp table in a function

2008-04-04 Thread Andreas 'ads' Scherbaum
On Fri, 04 Apr 2008 21:22:17 +0100 Raymond O'Donnell wrote: > On 04/04/2008 20:47, Andreas 'ads' Scherbaum wrote: > > >> I have a function that creates a temp table and drops it on commit. If > >> I run the function twice in the same psql interactive session, I get an > >> error. If I run it tw

Re: [GENERAL] Conversion to 8.3

2008-04-04 Thread Tom Lane
Terry Lee Tucker <[EMAIL PROTECTED]> writes: > I am converting our application from 7.4.19 to 8.3.1. In the old scheme of > things, I was generating an interval between two timestamps and evaluating > the interval string in another set of trigger code. I was doing the > following: > IF new.ontim

Re: [GENERAL] creating a temp table in a function

2008-04-04 Thread Alvaro Herrera
Raymond O'Donnell wrote: > On 04/04/2008 20:47, Andreas 'ads' Scherbaum wrote: > >>> I have a function that creates a temp table and drops it on commit. If >>> I run the function twice in the same psql interactive session, I get an >>> error. If I run it twice in two different psql sessions (usin

Re: [GENERAL] Out of memory

2008-04-04 Thread Alex Adriaanse
Tom Lane wrote: Alex Adriaanse <[EMAIL PROTECTED]> writes: Unfortunately, we do not have any core dumps from those. Is there anything else I can provide to make tracing this easier? Could we use the addresses mentioned in the segfault messages for anything useful? Hmm, you could try

Re: [GENERAL] creating a temp table in a function

2008-04-04 Thread Raymond O'Donnell
On 04/04/2008 20:47, Andreas 'ads' Scherbaum wrote: I have a function that creates a temp table and drops it on commit. If I run the function twice in the same psql interactive session, I get an error. If I run it twice in two different psql sessions (using the -c flag), I get no error. Is th

Re: [GENERAL] Question about pg_catalog.pg_trigger.

2008-04-04 Thread Tom Lane
"Bhat, Suma" <[EMAIL PROTECTED]> writes: > but with postgresql-8.3.1, t1.args values are empty. Yes, the RI triggers no longer care about tgargs. They look at the FK constraint's pg_constraint entry, instead. regards, tom lane -- Sent via pgsql-general mailing list (pgs

[GENERAL] pg_dump and schemas

2008-04-04 Thread Rusty Conover
Hi All, Is there a way to pass a parameter to pg_dump that would make the produced dump be loaded into a different schema rather then the one it is being dumped from? Basically be able to say dump out of public, but write the dump so its restored to say "test1". Thanks, Rusty -- Rusty C

Re: [GENERAL] creating a temp table in a function

2008-04-04 Thread Ivan Sergio Borgonovo
On Fri, 4 Apr 2008 09:13:18 -0700 "Shahaf Abileah" <[EMAIL PROTECTED]> wrote: > I have a function that creates a temp table and drops it on > commit. If I run the function twice in the same psql interactive > session, I get an error. If I run it twice in two different psql > sessions (using the

Re: [GENERAL] creating a temp table in a function

2008-04-04 Thread Andreas 'ads' Scherbaum
On Fri, 4 Apr 2008 09:13:18 -0700 Shahaf Abileah wrote: > I have a function that creates a temp table and drops it on commit. If > I run the function twice in the same psql interactive session, I get an > error. If I run it twice in two different psql sessions (using the -c > flag), I get no err

[GENERAL] Exception messages -> application?

2008-04-04 Thread Frank Miles
First of all, many thanks to all the developers for creating such a great DB. I have a moderately DB-ignorant question: is there a "built-in" way for an application to receive the message emitted by a RAISE in a PgSQL function? Context: I have a moderately complex application (in python, us

[GENERAL] creating a temp table in a function

2008-04-04 Thread Shahaf Abileah
I have a function that creates a temp table and drops it on commit. If I run the function twice in the same psql interactive session, I get an error. If I run it twice in two different psql sessions (using the -c flag), I get no error. Is this expected behavior? If so, why? You are now conn

[GENERAL] Question about pg_catalog.pg_trigger.

2008-04-04 Thread Bhat, Suma
We are upgrading our system from postgresql-8.2.0 to postgresql-8.3.1. With postgresql-8.2.0, SELECT c1.relname as PKTABLE_NAME,c2.relname as FKTABLE_NAME, t1.tgconstrname,a.attnum as keyseq,ic.relname as fkeyname,t1.tgdeferrable,t1.tginitdeferred, t

Re: [GENERAL] Upgrading from 8.2.0 to 8.3.1

2008-04-04 Thread Bhat, Suma
but with postgresql-8.3.1, ***t1.tgargs*** values are empty - I meant sorry about the typo. -Suma From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bhat, Suma Sent: Friday, April 04, 2008 3:07 PM To: pgsql-general@postgresql.org Subject

Re: [GENERAL] how to insert values into complex type field

2008-04-04 Thread Stephane Bortzmeyer
On Fri, Apr 04, 2008 at 04:32:36PM +0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote a message of 74 lines which said: > INSERT INTO attribute2005 > VALUES(1,(23,'ee','ttt',('2005-01-01','2005-12-31'))); And why did you not post the error message? Because it is very clear: ERROR: malformed

[GENERAL] Upgrading from 8.2.0 to 8.3.1

2008-04-04 Thread Bhat, Suma
We are upgrading our system from postgresql-8.2.0 to postgresql-8.3.1. With postgresql-8.2.0, SELECT c1.relname as PKTABLE_NAME,c2.relname as FKTABLE_NAME, t1.tgconstrname,a.attnum as keyseq,ic.relname as fkeyname,t1.tgdeferrable,t1.tginitdeferred, t

Re: [GENERAL] Conversion to 8.3

2008-04-04 Thread Craig Ringer
Terry Lee Tucker wrote: Greetings: I am converting our application from 7.4.19 to 8.3.1. In the old scheme of things, I was generating an interval between two timestamps and evaluating the interval string in another set of trigger code. I was doing the following: IF new.ontime IS NOT NULL AN

Re: [GENERAL] Secure "where in(a,b,c)" clause.

2008-04-04 Thread Tino Wildenhain
Steve Atkins wrote: ... I count the number of values that I want to put in the IN () clause, then create a query string with the right number of bind variables in the in clause, then bind the values. So for {1, 3, 5} I'd use "select * from foo where bar in (?, ?, ?)" and for {1,5,7,9,11} I'd use

[GENERAL] ERROR: XX000: cache lookup failed for relation

2008-04-04 Thread Glyn Astill
Hi chaps, I've got a problem trying to drop a table, I get the error "cache lookup failed for relation" SEE=# drop table replicated_users; ERROR: XX000: cache lookup failed for relation 30554884 LOCATION: getRelationDescription, dependency.c:2021 Now this table is on a slony-I slave and was in

Re: [GENERAL] Connection reset by peer / broken pipe

2008-04-04 Thread Jeff Wigal (Referee Assistant)
I'm in the process of tracking down the cause of this... Is there any way on the server side of things to terminate a connection after "x" number of minutes? For what we're doing, there is no reason to have a connection open after 10 minutes. Thanks in advance-- On Tue, Apr 1, 2008 at 5:44 PM, J

Re: [GENERAL] Autograph Annoucement (ERD Tool)

2008-04-04 Thread Colin Fox
Colin Wetherbee wrote: > Colin Wetherbee wrote: >> Also, is there a way to forcibly remove tables and views from the >> output? In all.xml, I only list the tables I want, but in addition >> to those, I also get my PostGIS tables and all the views I've created >> within the schema. > > And... > > I

Re: [GENERAL] how to insert values into complex type field

2008-04-04 Thread Stephan Szabo
On Fri, 4 Apr 2008 [EMAIL PROTECTED] wrote: > hi all, i want to know how to insert values into the field which is a complex > type. In fact it is a complex type which also include a complex type. The > following is its definition: > create TYPE lifetime as( strattime date, endtime date); > crea

[GENERAL] Conversion to 8.3

2008-04-04 Thread Terry Lee Tucker
Greetings: I am converting our application from 7.4.19 to 8.3.1. In the old scheme of things, I was generating an interval between two timestamps and evaluating the interval string in another set of trigger code. I was doing the following: IF new.ontime IS NOT NULL AND new.ontime ~* 'ago' THEN

Re: [GENERAL] simple update queries take a long time - postgres 8.3.1

2008-04-04 Thread mark
On Thu, Apr 3, 2008 at 10:02 PM, Greg Smith <[EMAIL PROTECTED]> wrote: > On Wed, 2 Apr 2008, mark wrote: > > > with no clients connected to the database when I try to shutdown the > > database [to apply new settings], it says database cant be shutdown.. for a > > long time both in smart and normal

Re: [GENERAL] Autograph Annoucement (ERD Tool)

2008-04-04 Thread Colin Fox
Colin Wetherbee wrote: > >> >> Can you look at the PS file, and make sure that you're at least getting >> a legitimate postscript diagram? > > It turned out I had incorrectly added my schema information. > > Works now, with NetPBM. > > Cool tool! Glad you like it. I've found it personally indispens

Re: [GENERAL] is it helpful for the optimiser/planner to add LIMIT 1

2008-04-04 Thread Gregory Stark
"Ivan Sergio Borgonovo" <[EMAIL PROTECTED]> writes: > Summarising it up: is it worth to add it here and there as an > optimisation flag? Probably not. Unless you're not planning on reading all the resulting records anyways and want the planner to optimize with that assumption. -- Gregory Star

Re: [GENERAL] Secure "where in(a,b,c)" clause.

2008-04-04 Thread William Temperley
Thanks for the replies, "Rodrigo E. De León Plicet" <[EMAIL PROTECTED]> wrote: >Use a prepared query and ANY, e.g.: >select st_collect(the_geom) from tiles >where tilename = any('{foo,bar,baz}'); Thanks, that's what I was looking for! $sql = "select uid, accredited as acc, x(the_geom), y(the_geom

[GENERAL] how to insert values into complex type field

2008-04-04 Thread windwxc
hi all, i want to know how to insert values into the field which is a complex type. In fact it is a complex type which also include a complex type. The following is its definition: create TYPE lifetime as( strattime date, endtime date); create TYPE attributetype as( ID numeric, address character(

Re: [GENERAL] Autograph Annoucement (ERD Tool)

2008-04-04 Thread A. Kretschmer
am Thu, dem 03.04.2008, um 15:40:41 -0700 mailte Colin Fox folgendes: > Hello everyone. > > There were a number of people asking about ERD tools here a while ago, > so I decided to publish one that I've put together. > > It's called Autograph, and you can find it on the pg foundry: > > http://p