[GENERAL] Creating table in different database

2005-10-25 Thread Paresh Bafna
If there are multiple databases, say db1 and db2. And currently we are in db1, can we create table in db2 (without switching databases)? Is there any query to do this? - Paresh ---(end of broadcast)--- TIP 4: Have you searched our list archives?

[GENERAL] Anyone know of a Schema Comparer

2005-10-25 Thread Paul Newman
Hi, We will have anything upto 400 schema in our db. Each Schema is a replica of a master schema. Can anyone recommend a tool that we can compare our master schema to any given target schema which will then generate an update script which can subsequently be executed ? We have looked at

Re: [GENERAL] Anyone know of a Schema Comparer

2005-10-25 Thread Hannes Dorbath
On 25.10.2005 08:19, Paul Newman wrote: We have looked at EMS comparer and few others but all seem to compare one entire db with another. We had the same problem. EMS DB comparer has this limitation, but it's probably the best tool out there. We solved it be wrapping the command line version

Re: [GENERAL] Anyone know of a Schema Comparer

2005-10-25 Thread David Pradier
Hi Paul, why not simply pg_dump your database and then restore only the chosen schema on 2 new databases ? Then you can use your software comparers. Making a script that dump and restore only the chosen schemas should be 3 lines shell script. Regards, David On Tue, Oct 25, 2005 at 07:19:57AM

Re: [GENERAL] FoxPro in WINE to Postgresql on LINUX?

2005-10-25 Thread Andrus
Is it possible to create zero config installation by using connecton string and simply including odbc dll files (odbc32.dll, odbcint.dll, odbccp32.dll ) with application ? This is a lot simpler for end user, no manual config required. William Yu [EMAIL PROTECTED] wrote in message news:[EMAIL

Re: [GENERAL] Prevent application log pollution with notice messages

2005-10-25 Thread Andrus
Magnus, thank you. How about the main problem: I have two commands like CREATE TEMP TABLE tasutud1 (dokumnr INTEGER PRIMARY KEY, tasutud NUMERIC(1)) ON COMMIT DROP; in my transaction. This command causes NOTICE message written to the log file. There a number of transactions per second. So

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-25 Thread Andrus
Suggestions: use text or varchar for the email address, don't embed newlines in the regular expression, and if you use dollar quotes and the regular expression ends with a dollar sign then quote with a character sequence other than $$. Michael, thank you. Excellent! I'm afraid that using

Re: [GENERAL] Installation Problem

2005-10-25 Thread Martijn van Oosterhout
On Mon, Oct 24, 2005 at 08:59:17PM -0400, phil campaigne wrote: I can run ./configure but when I try to run make, the program cannot find a usable c compiler. I tried ./configure CC=/usr/lib/gcc-lib/i586-suse-linux/3.3.3/cc1 but get the error: cannot run c compiled programs. I think you

Re: [GENERAL] function DECODE and triggers

2005-10-25 Thread Oliver Elphick
On Tue, 2005-10-25 at 00:16 +0200, Rafael Montoya wrote: I'm migrating from oracle to postgresl, and i have these 2 problems: 1. PostgreSQL doesn't support function DECODE from Oracle, but it can be replicated with CASE WHEN expr THEN expr [...] ELSE expr END , the problem appears when i

Re: [GENERAL] Deleting vs foreign keys

2005-10-25 Thread WireSpot
On 10/25/05, Michael Fuhr [EMAIL PROTECTED] wrote: Are there indexes on the foreign key columns? That is, given the following example, CREATE TABLE foo (id integer PRIMARY KEY); CREATE TABLE bar (fooid integer NOT NULL REFERENCES foo ON DELETE CASCADE); do you have an index on bar.fooid?

Re: [GENERAL] pl/pgsql help

2005-10-25 Thread Oliver Elphick
On Tue, 2005-10-25 at 00:17 +, krishnaa sridharan wrote: Hi all When I installed postgresql in my computer, I had pl/pgsql language selected but still, I dont have any language installed. Can some one tell me how to install a language. thanks in advance. i am a beginner so any help would

Re: [GENERAL] pg_dump, MVCC and consistency

2005-10-25 Thread Martijn van Oosterhout
On Mon, Oct 24, 2005 at 02:42:09PM -0700, Jeff Davis wrote: So it seems that, in order for the wraparound to be a problem, the transaction would have to last longer than 2 billion other transactions. And if a transaction did last that long, according to the 8.1 docs (22.1.3): ...the

Re: [GENERAL] newbie question: reading sql commands from script

2005-10-25 Thread Oliver Elphick
On Mon, 2005-10-24 at 20:39 -0400, Sean Davis wrote: In psql, look at \i. Sean - Original Message - From: basel novo To: pgsql-general@postgresql.org Sent: Monday, October 24, 2005 8:28 PM Subject: [GENERAL] newbie question: reading

Re: [GENERAL] Deleting vs foreign keys

2005-10-25 Thread Martijn van Oosterhout
On Tue, Oct 25, 2005 at 12:18:34PM +0300, WireSpot wrote: On 10/25/05, Michael Fuhr [EMAIL PROTECTED] wrote: Are there indexes on the foreign key columns? That is, given the following example, CREATE TABLE foo (id integer PRIMARY KEY); CREATE TABLE bar (fooid integer NOT NULL

Re: [GENERAL] Deleting vs foreign keys

2005-10-25 Thread Csaba Nagy
On Tue, 2005-10-25 at 11:18, WireSpot wrote: On 10/25/05, Michael Fuhr [EMAIL PROTECTED] wrote: Are there indexes on the foreign key columns? That is, given the following example, CREATE TABLE foo (id integer PRIMARY KEY); CREATE TABLE bar (fooid integer NOT NULL REFERENCES foo ON

Re: [GENERAL] Deleting vs foreign keys

2005-10-25 Thread WireSpot
On 10/25/05, Martijn van Oosterhout kleptog@svana.org wrote: BTW, have you considered TRUNCATE? (although it may not work with foreign keys). It doesn't :) TRUNCATE cannot be used if there are foreign-key references to the table from other tables. Checking validity in such cases would require

Re: [GENERAL] [ANNOUNCE] PostgreSQL 8.1 Beta 4

2005-10-25 Thread Zlatko Matic
what is the schedule for releasing first official 8.1 ? - Original Message - From: Magnus Hagander [EMAIL PROTECTED] To: Marc G. Fournier [EMAIL PROTECTED] Cc: pgsql-general@postgresql.org Sent: Monday, October 24, 2005 8:04 PM Subject: Re: [GENERAL] [ANNOUNCE] PostgreSQL 8.1 Beta 4

Re: [GENERAL] STL problem in stored procedures

2005-10-25 Thread Andreas Seltenreich
Zoltán Dudás schrob: I have downloaded an extension for PostgreSql. It contains stored procedures written in C. I compiled the neccessary files into an so file and I tried to use the functions, but it gives an error message when it has to load the shared object file. The error message

Re: [GENERAL] STL problem in stored procedures

2005-10-25 Thread Zoltán Dudás
On Tuesday 25 October 2005 12.32, Andreas Seltenreich wrote: This is the error message: psql:/usr/share/postgresql/contrib/proximity.sql:5: ERROR: could not load library /usr/lib/postgresql/proximity.so: /usr/lib/postgresql/proximity.so: undefined symbol:

Re: [GENERAL] FoxPro in WINE to Postgresql on LINUX?

2005-10-25 Thread William Yu
Here's what I do. Once I get a good config, I just tarball my .wine dir and untarball it for any Linux/WINE box I need to get running. For users already running WINE w/ their own app configs already, then copying the files manually into the appropriate dirs and then appending the necessary

Re: [GENERAL] STL problem in stored procedures

2005-10-25 Thread Zoltán Dudás
Hi, It looks like your .so isn't linked to libstdc++. How exactly did you compile and link the .so? I attached output of the make -n. Regards, Zoli -- Zoltan Dudas Software Engineer SEI Hungary Office +36-52-889-532 Ext: 2032 Fax +36-52-889-599 Email [EMAIL PROTECTED] URL

Re: [GENERAL] STL problem in stored procedures

2005-10-25 Thread Martijn van Oosterhout
On Tue, Oct 25, 2005 at 02:11:31PM +0200, Zoltán Dudás wrote: Hi, It looks like your .so isn't linked to libstdc++. How exactly did you compile and link the .so? I attached output of the make -n. I notice other contrib modules include lines like: SHLIB_LINK = $(libpq) SHLIB_LINK +=

Re: [GENERAL] [ANNOUNCE] PostgreSQL 8.1 Beta 4

2005-10-25 Thread Matthew T. O'Connor
Zlatko Matic wrote: what is the schedule for releasing first official 8.1 ? Ahh the eternal question. I believe the official answers, and always will be: When it's ready. However seeing as they think they are just about ready for Release Candidate stage, I would say, not too much longer.

Re: [GENERAL] a stored procedure ..with integer as the parameter

2005-10-25 Thread Harald Fuchs
In article [EMAIL PROTECTED], Alex Turner [EMAIL PROTECTED] writes: delete * from user; select * from table where my_id=$in_value Am I just smoking crack here, or does this approach have some merit? The former :-) The correct defense against SQL injection is proper

Re: [GENERAL] STL problem in stored procedures

2005-10-25 Thread Zoltán Dudás
Hi, On Tuesday 25 October 2005 14.34, Martijn van Oosterhout wrote: I notice other contrib modules include lines like: SHLIB_LINK = $(libpq) SHLIB_LINK += $(filter -lm, $(LIBS)) SHLIB_LINK = -lxml2 -lxslt Perhaps you need a: SHLIB_LICK = -lstl or whatever the lib is called. Thanks, it

Re: [GENERAL] Prevent application log pollution with notice messages

2005-10-25 Thread Tom Lane
Andrus [EMAIL PROTECTED] writes: I don't see any reason for writing notice messages in this case. So increase log_min_messages. (I'm not real sure why that defaults to NOTICE, either, except perhaps habit.) regards, tom lane ---(end of

Re: [GENERAL] pg_dump, MVCC and consistency

2005-10-25 Thread Tom Lane
Martijn van Oosterhout kleptog@svana.org writes: On Mon, Oct 24, 2005 at 02:42:09PM -0700, Jeff Davis wrote: And what about a transaction left open for 2PC? Does a transaction get a new XID if it's PREPAREd now and COMMIT PREPAREd in a year? That I don't know. A prepared transaction is still

Re: [GENERAL] STL problem in stored procedures

2005-10-25 Thread Tom Lane
Martijn van Oosterhout kleptog@svana.org writes: Perhaps you need a: SHLIB_LICK = -lstl or whatever the lib is called. I think he needs to rewrite in C :-(. The backend is not C++ and I fear it's unlikely that libc++ will play nicely as a dynamic add-on. regards, tom

Re: [GENERAL] STL problem in stored procedures

2005-10-25 Thread Kevin Murphy
Tom Lane wrote: I think he needs to rewrite in C :-(. The backend is not C++ and I fear it's unlikely that libc++ will play nicely as a dynamic add-on. Grrr. I also have a C++ library that I'd like to use from PostgreSQL on Mac OS X. I have succeeded in calling a tiny toy C++ shared

Re: [GENERAL] STL problem in stored procedures

2005-10-25 Thread Tom Lane
Kevin Murphy [EMAIL PROTECTED] writes: Tom Lane wrote: I think he needs to rewrite in C :-(. The backend is not C++ and I fear it's unlikely that libc++ will play nicely as a dynamic add-on. It would be great if some C++/C guru could make a thorough analysis of C++ integration issues. The

Re: [GENERAL] STL problem in stored procedures

2005-10-25 Thread Michael Fuhr
On Tue, Oct 25, 2005 at 10:24:53AM -0400, Kevin Murphy wrote: I have succeeded in calling a tiny toy C++ shared library from PG, but I don't know enough to understand what problems might be associated with using more complicated C++ code. It would be great if some C++/C guru could make a

Re: [GENERAL] Deleting vs foreign keys

2005-10-25 Thread WireSpot
On 10/25/05, WireSpot [EMAIL PROTECTED] wrote: Thanks for the tip, guys. I'll go punch in some indexes and I'll be back to report how much of a difference it made. Adding indexes made the dropping of entries for the master table roughly 6 (six) times faster. It's definitely an improvement and I

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-25 Thread Michael Fuhr
On Tue, Oct 25, 2005 at 11:20:53AM +0300, Andrus wrote: This regex allows email addresses containing two dots without any letters, like [EMAIL PROTECTED] I havent seen any email of such kind. That's because the regular expression is wrong: it simply checks the local part for zero or more

Re: [GENERAL] Deleting vs foreign keys

2005-10-25 Thread Csaba Nagy
I guess your master table has a considerable tree of child records for each deleted record, that's why the deletion takes so long. We have this situation too on top level object deletion. Our solution is to make it asynchronous, i.e. the user requests it and then a background job does it. There's

Re: [GENERAL] Creating table in different database

2005-10-25 Thread Michael Fuhr
On Tue, Oct 25, 2005 at 11:27:08AM +0530, Paresh Bafna wrote: If there are multiple databases, say db1 and db2. And currently we are in db1, can we create table in db2 (without switching databases)? You could use contrib/dblink. However, if you need to do this often then it might be better to

Re: [GENERAL] Map of Postgresql Users (OT)

2005-10-25 Thread Claire McLister
Thanks. I looked at the Mapserver maps, and at first glance it seems Google Maps API provides better map images and more interactive features (zooming, panning, JS popups, satellite/map views, etc.) So, what would be the advantage of Mapserver apart from it being based on Open Source? We

Re: [GENERAL] function DECODE and triggers

2005-10-25 Thread Rafael Montoya
Thanks for your answer, and if i have many options like decode (pre.C_EST,'01','U','02','M','03','W','04','D','05','O','06','S','') as Est do i have to write many else options in this way? select case when pre.C_EST = '01' THEN 'U' ELSE when pre-C_EST = '02' THEN 'M' ...

Re: [GENERAL] [ANNOUNCE] PostgreSQL 8.1 Beta 4

2005-10-25 Thread Zlatko Matic
thanks for information - Original Message - From: Matthew T. O'Connor matthew@zeut.net To: Zlatko Matic [EMAIL PROTECTED] Cc: Magnus Hagander [EMAIL PROTECTED]; Marc G. Fournier [EMAIL PROTECTED]; pgsql-general@postgresql.org Sent: Tuesday, October 25, 2005 2:40 PM Subject: Re:

Re: [GENERAL] Deleting vs foreign keys

2005-10-25 Thread WireSpot
On 10/25/05, Csaba Nagy [EMAIL PROTECTED] wrote: I guess your master table has a considerable tree of child records for each deleted record, that's why the deletion takes so long. We have this situation too on top level object deletion. Our solution is to make it asynchronous, i.e. the user

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-25 Thread Steve Atkins
On Tue, Oct 25, 2005 at 09:09:44AM -0600, Michael Fuhr wrote: On Tue, Oct 25, 2005 at 11:20:53AM +0300, Andrus wrote: This regex allows email addresses containing two dots without any letters, like [EMAIL PROTECTED] I havent seen any email of such kind. That's because the regular

Re: [GENERAL] STL problem in stored procedures

2005-10-25 Thread Andreas Seltenreich
Tom Lane schrob: Kevin Murphy [EMAIL PROTECTED] writes: Tom Lane wrote: I think he needs to rewrite in C :-(. The backend is not C++ and I fear it's unlikely that libc++ will play nicely as a dynamic add-on. It would be great if some C++/C guru could make a thorough analysis of C++

Re: [GENERAL] Deleting vs foreign keys

2005-10-25 Thread Richard Huxton
WireSpot wrote: On 10/25/05, Csaba Nagy [EMAIL PROTECTED] wrote: I guess your master table has a considerable tree of child records for each deleted record, that's why the deletion takes so long. We have this situation too on top level object deletion. Our solution is to make it asynchronous,

[GENERAL] the best way to catch table modification

2005-10-25 Thread Marek Lewczuk
Hello, I'm implementing db-queries caching system - for this I need to know each table's modification time (or at least modification counter). I know that I can make a statement-level trigger, which will update a table with tables modification times - however this is inefficient if many

Re: [GENERAL] the best way to catch table modification

2005-10-25 Thread David Gagnon
Hi, I posted on the same subject a month ago . .you can search for the current title in the JDBC mailing list [JDBC] implementing asynchronous notifications PLEASE CONFIRM MY I ended using statement-level trigger. I haven't found another way to do it . Regards /David Marek Lewczuk

Re: [GENERAL] STL problem in stored procedures

2005-10-25 Thread Tom Lane
Andreas Seltenreich [EMAIL PROTECTED] writes: Tom Lane schrob: It *might* work to put a generic catch/report via elog handler around each one of your entry-point functions. Haven't tried it. Hmm, this setup worked quite stable here for some smaller educational projects. The snippet I used

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-25 Thread Andrus
This regex allows email addresses containing two dots without any letters, like [EMAIL PROTECTED] That's because the regular expression is wrong: it simply checks the local part for zero or more non-@ characters instead of checking against the RFC822/RFC2822 specification. Use a search

Re: [GENERAL] STL problem in stored procedures

2005-10-25 Thread Andreas Seltenreich
Tom Lane schrob: Andreas Seltenreich [EMAIL PROTECTED] writes: Tom Lane schrob: It *might* work to put a generic catch/report via elog handler around each one of your entry-point functions. Haven't tried it. Hmm, this setup worked quite stable here for some smaller educational projects.

Re: [GENERAL] PostgreSQL vs mySQL, any performance difference for

2005-10-25 Thread Wes Williams
For what it may be worth, executing the same commands into MySQL 5.0.15-nt-max (Win XP Pro) the following it received: mysql create table test (i1 int); Query OK, 0 rows affected (0.41 sec) mysql insert into test values (123913284723498723423); ERROR 1264 (22003): Out of range value adjusted for

[GENERAL] alt+F not working after calling pg_dump

2005-10-25 Thread Andrus
I call pg_dump to create backup copies from my application using Windows CreateProcess() API call. After pg_dump finishes, Alt+F ( to open File menu) and other Alt key combinations in my application stop working. If I use Alt+Tab to switch to other application and then back to my application,

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-25 Thread Scott Marlowe
On Tue, 2005-10-25 at 13:01, Andrus wrote: This regex allows email addresses containing two dots without any letters, like [EMAIL PROTECTED] That's because the regular expression is wrong: it simply checks the local part for zero or more non-@ characters instead of checking against

Re: [GENERAL] [ANNOUNCE] PostgreSQL 8.1 Beta 4

2005-10-25 Thread Marc G. Fournier
On Tue, 25 Oct 2005, Zlatko Matic wrote: what is the schedule for releasing first official 8.1 ? RC1 is schedualed for end of this week ... if that presents zero problems, then figure on full release by the week after ... we're aiming for around the 8th of November though ... -

Re: [GENERAL] PostgreSQL vs mySQL, any performance difference for

2005-10-25 Thread Scott Marlowe
Cool. Does it still error out after issueing: set sql_mode='MYSQL323'; ??? Just wondering if bounds checking is still optional but is now op-out instead of opt-in, or if it's something that you can no longer turn off. The whole idea of correct behaviour being an option is pretty bad, but

Re: [GENERAL] PostgreSQL vs mySQL, any performance difference for

2005-10-25 Thread Wes Williams
set sql_mode='MYSQL323'; Query OK, 0 rows affected (0.00 sec) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Scott Marlowe Sent: Tuesday, October 25, 2005 3:24 PM To: Wes Williams Cc: 'Jan'; pgsql-general@postgresql.org Subject: Re: [GENERAL] PostgreSQL vs

Re: [GENERAL] alt+F not working after calling pg_dump

2005-10-25 Thread Magnus Hagander
I call pg_dump to create backup copies from my application using Windows CreateProcess() API call. After pg_dump finishes, Alt+F ( to open File menu) and other Alt key combinations in my application stop working. If I use Alt+Tab to switch to other application and then back to my

Re: [GENERAL] PostgreSQL vs mySQL, any performance difference for

2005-10-25 Thread Michael Fuhr
On Tue, Oct 25, 2005 at 02:24:11PM -0500, Scott Marlowe wrote: Cool. Does it still error out after issueing: set sql_mode='MYSQL323'; ??? Just wondering if bounds checking is still optional but is now op-out instead of opt-in, or if it's something that you can no longer turn off.

Re: [GENERAL] Installation Problem

2005-10-25 Thread Peter Wiersig
On Mon, Oct 24, 2005 at 08:59:17PM -0400, phil campaigne wrote: Hi All, I'm trying ot install postgresql 8.0.4 on suse 9.0. I can run ./configure but when I try to run make, the program cannot find a usable c compiler. I tried ./configure CC=/usr/lib/gcc-lib/i586-suse-linux/3.3.3/cc1

Re: [GENERAL] Why different execution times for different instances for the

2005-10-25 Thread Oliver Elphick
On Tue, 2005-10-25 at 13:14 -0700, Kishore B wrote: Hi , I am Kishore doing freelance development of J2EE applications. We switched to use Postgresql recently because of the advantages it has over other commercial databases. All went well untill recently, untill we began working on an

[GENERAL] improve 'where not exists' query..

2005-10-25 Thread Noel Whelan
I'm wondering if there's an idealway to improve the efficiency of this query: SELECT i.id FROMitemsiWHERE (NOT (EXISTS (SELECT c.idFROMcontactscWHERE (c.id = i.id; It takes a while to execute, clearly. Thank you,

[GENERAL] Getting Stated

2005-10-25 Thread Bob Pawley
I am very new. I am running Postgresql 8 on Windows. I have managed to create tables and have searched all the documentation available to get to the next step I need to take. Would anyone on the list be interested in giving me a few pointers on a one to one basis? If so I would much

[GENERAL] Dump only functions...

2005-10-25 Thread Cristian Prieto
Any of you knows is there is any way in pg_dump or anything to dump just the functions from a database? Thanks a lot in advance!

Re: [GENERAL] Map of Postgresql Users (OT)

2005-10-25 Thread Robert Treat
Actually I have already made a basic google map for the website[1] meant to replace the old developers map. Check out the blog post at http://people.planetpostgresql.org/xzilla/index.php?/archives/76-Maptastic.html I'd be interested in talking more about getting more content into the map and

Re: [GENERAL] Why different execution times for different instances for the

2005-10-25 Thread Benjamin Smith
I ran into something like this once, where a complex update occurred inside a transaction. When the update happened, I saw what you describe - the DB hung, and the load average shot out thru the roof until I restarted the PG daemon. The query otherwise worked fine, but only failed with this

Re: [GENERAL] Map of Postgresql Users (OT)

2005-10-25 Thread Bruce Momjian
Robert Treat wrote: Actually I have already made a basic google map for the website[1] meant to replace the old developers map. Check out the blog post at http://people.planetpostgresql.org/xzilla/index.php?/archives/76-Maptastic.html I'd be interested in talking more about getting more

Re: [GENERAL] Map of Postgresql Users (OT)

2005-10-25 Thread Joshua D. Drake
I do like the fact you pulled the names off the emails as well as the email addresses. That is important. Is there a plugin I am missing to make this work in Firefox? I just get a blank grey screen. Sincerely, Joshua D. Drake -- The PostgreSQL Company - Command Prompt, Inc.

Re: [GENERAL] STL problem in stored procedures

2005-10-25 Thread Tom Lane
Andreas Seltenreich [EMAIL PROTECTED] writes: Tom Lane schrob: And on top of that, what if the error was one that the backend can't recover from except by a transaction abort? If some level of the C++ code thinks it can catch and recover from the error, you've left things in a pretty bad

Re: [GENERAL] a stored procedure ..with integer as the parameter

2005-10-25 Thread surabhi.ahuja
Title: Re: [GENERAL] a stored procedure ..with integer as the parameter what do u suggest i do then in that case? i mean how should i make a query - i mean howdo i make a command? From: Tino Wildenhain [mailto:[EMAIL PROTECTED]Sent: Tue 10/25/2005 11:22 AMTo: surabhi.ahujaCc: Richard