Re: [GENERAL] Database Comparison tool?

2006-02-09 Thread Devrim GUNDUZ
Hi, On Wed, 2006-02-08 at 18:22 +, Nicholas Walker wrote: > Are there any tools that can compare a database schema, and produce sql > of the changes from one version to the next. http://www.sqlmanager.net/en/products/postgresql/dbcomparer http://www.sqlmanager.net/en/products/postgresql/data

Re: [GENERAL] Database Comparison tool?

2006-02-09 Thread Roger Hand
I have a script I've been using that does a db comparison, and it works very well. In order to ensure things are in the right order, I have to ... - query for table and view names (FROM pg_tables WHERE schemaname = 'public' ...), with an ORDER BY clause, natch. - create a batch command file wit

Re: [GENERAL] Database Comparison tool?

2006-02-09 Thread Rick Gigger
Is the ordering guaranteed to be the same on both boxes if you do this? Rick On Feb 9, 2006, at 1:03 PM, Philippe Ferreira wrote: Are there any tools that can compare a database schema, and produce sql of the changes from one version to the next. We have a development server, and it would

Re: [GENERAL] Database Comparison tool?

2006-02-09 Thread Philippe Ferreira
Are there any tools that can compare a database schema, and produce sql of the changes from one version to the next. We have a development server, and it would be great to be able to just run a tool, where we could produce the changes, review it, and then commit to production. Hi, Do a "p

Re: [GENERAL] Sequences/defaults and pg_dump

2006-02-09 Thread Bruno Wolff III
On Tue, Feb 07, 2006 at 15:28:31 +0300, Nikolay Samokhvalov <[EMAIL PROTECTED]> wrote: > The real situation would be as the following. > I want to use some algorithm to hide real number of registered users > in my table user. So, I don't want to use simple sequence, when every > new registered us

Re: [GENERAL] Is there a way to limit CPU usage per user

2006-02-09 Thread Michael Fuhr
On Fri, Feb 10, 2006 at 11:30:04AM +0700, Luki Rustianto wrote: > So how can we terminate such a long running query ? > > The idea is to make a crontab to periodicaly do a job to search a > typical "SELECT * FROM bigtable" query who has run for some hours then > to terminate them... Are you famil

Re: [GENERAL] Return more then one value using PL

2006-02-09 Thread Michael Fuhr
On Thu, Feb 09, 2006 at 11:23:55AM -0800, Benjamin Arai wrote: > What languages allow you to return more than one value using PL? For > example, I read that PL/Python only supports returning a single value. What do you mean by "more than one value"? Multiple columns (composite type), multiple ro

Re: [GENERAL] Is there a way to limit CPU usage per user

2006-02-09 Thread Luki Rustianto
So how can we terminate such a long running query ? The idea is to make a crontab to periodicaly do a job to search a typical "SELECT * FROM bigtable" query who has run for some hours then to terminate them... On 2/9/06, Merlin Moncure <[EMAIL PROTECTED]> wrote: > > Is there a way to limit user

Re: [GENERAL] r trim of characters other than space

2006-02-09 Thread surabhi.ahuja
Title: Re: [GENERAL] r trim of characters other than space but how should i do it within a stored procedure something like:   CREATE OR REPLACE FUNCTION insert(varchar(65),varchar(65),date,varchar(256)) RETURNS retval AS'DECLAREpatName text;BEGIN    patName := trim($1); 

Re: [GENERAL] distinct not working in a multiple join

2006-02-09 Thread Stephen Frost
* David Rio Deiros ([EMAIL PROTECTED]) wrote: > Now I have to redefine my query because I want to get the second > output but keeping the group_id. Ideas and suggestions are welcome. You might want to look at 'distinct on'. Stephen signature.asc Description: Digital signature

Re: [GENERAL] Request to have VACUUM ignore cost based limits

2006-02-09 Thread Karl O. Pinc
On 02/09/2006 12:19:39 AM, Tom Lane wrote: "Karl O. Pinc" <[EMAIL PROTECTED]> writes: > But isn't SET server wide? No. Perhaps you need to read http://www.postgresql.org/docs/8.1/static/runtime-config.html#CONFIG-SETTING Yes, I do. Thanks. (Probably a sign it's time to read the whole manua

Re: [GENERAL] distinct not working in a multiple join

2006-02-09 Thread David Rio Deiros
On Thu, Feb 09, 2006 at 07:20:19PM -0500, Tom Lane wrote: > David Rio Deiros <[EMAIL PROTECTED]> writes: > > I have some issues with the query attached at the end of this email. > > If I run that query I got this output ( I have removed some of the > > fields) despite the distinct clause: > > > Q

Re: [GENERAL] Insert more than one t-uple in a single sql

2006-02-09 Thread David Fetter
On Thu, Feb 09, 2006 at 07:12:45PM -0500, Tom Lane wrote: > >> You can't do that in postgres, sorry. That's a mysql-ism. > >> > >> Gonzalo Villegas wrote: > >> > >>> It must be something like > >>> insert into table (field1,field2,...) values (v1,v2,...),(b1,b2,...), > >>> (c1,c2,...) > > Actual

Re: [GENERAL] distinct not working in a multiple join

2006-02-09 Thread Tom Lane
David Rio Deiros <[EMAIL PROTECTED]> writes: > I have some issues with the query attached at the end of this email. > If I run that query I got this output ( I have removed some of the > fields) despite the distinct clause: > QC Q&A | www.xxx.com | 44281 > QC Q&A | www.xxx.com | 44281 > WhyMAX?

Re: [GENERAL] Insert more than one t-uple in a single sql

2006-02-09 Thread Tom Lane
>> You can't do that in postgres, sorry. That's a mysql-ism. >> >> Gonzalo Villegas wrote: >> >>> It must be something like >>> insert into table (field1,field2,...) values (v1,v2,...),(b1,b2,...), >>> (c1,c2,...) Actually, that's not a mysql-ism, it's SQL-spec syntax. We haven't got round to i

[GENERAL] distinct not working in a multiple join

2006-02-09 Thread David Rio Deiros
Hi there, I have some issues with the query attached at the end of this email. If I run that query I got this output ( I have removed some of the fields) despite the distinct clause: QC Q&A | www.xxx.com | 44281 QC Q&A | www.xxx.com | 44281 WhyMAX? | | 44285 But, and here is the w

Re: [GENERAL] Insert more than one t-uple in a single sql

2006-02-09 Thread Rick Gigger
There is a little trick you can do though, it goes something like this: insert into table (field1, field2, field3) select v1, v2, v3 union b1, b2, b3 union select c1, c2, c3 I originally did this because it was significantly faster on SQL Server 2000 than doing the inserts individually. Us

Re: [GENERAL] Insert more than one t-uple in a single sql

2006-02-09 Thread Klint Gore
On Thu, 9 Feb 2006 17:57:03 -0500, "Gonzalo Villegas" <[EMAIL PROTECTED]> wrote: > > > Hi all, > > I'm trying to insert more than one t-uple in a single sql query. Just like > > copy table (field1,field2,...) from > > It must be something like > > insert into table (field1,field2,...) v

Re: [GENERAL] Insert more than one t-uple in a single sql

2006-02-09 Thread Chris
Hi, You can't do that in postgres, sorry. That's a mysql-ism. Gonzalo Villegas wrote: It must be something like insert into table (field1,field2,...) values (v1,v2,...),(b1,b2,...), (c1,c2,...) ---(end of broadcast)--- TIP 1: if posting/readin

[GENERAL] Insert more than one t-uple in a single sql

2006-02-09 Thread Gonzalo Villegas
Hi all, I'm trying to insert more than one t-uple in a single sql query. Just like copy table (field1,field2,...) from It must be something like insert into table (field1,field2,...) values (v1,v2,...),(b1,b2,...), (c1,c2,...) Thanks in advance! Gonzalo A. Villegas

Re: [GENERAL] referential integrity without trigger

2006-02-09 Thread Tom Lane
Alexander Presber <[EMAIL PROTECTED]> writes: > Is there a clever, general scheme to "recheck" and enforce foreign > key contraints, after the responsible triggers have been disabled and > reenabled? Drop the constraint (keep your fingers off the trigger, thank you ;-)). Modify the master tab

Re: [GENERAL] Update table with data from another table

2006-02-09 Thread Chandra Sekhar Surapaneni
UPDATE schema1.A SET col = z.col FROM schema2.A z WHERE z.match = schema1.A.match This should always work. Observe schema1.A.match in the last line of the query. If this does not work please post the error message you are getting when you tried this. -Chandra Sekhar Surapaneni -Original Me

Re: [GENERAL] PQputline error with pg_restore

2006-02-09 Thread Tom Lane
Jennifer I Drake/O/VCU <[EMAIL PROTECTED]> writes: > ERROR: copy: line 178286, overflow on numeric ABS(value) >= 10^3 for field > with precision 5 scale 3 It would seem that you've got an incorrect (too large) value in a numeric field in the dumped data. It's not clear how you got into this stat

Re: [GENERAL] PQputline error with pg_restore

2006-02-09 Thread Jennifer I Drake/O/VCU
The postmaster stderr was being sent to /dev/null, so I changed that and was able to generate a log file.  Unfortunately, I'm not sure what the output in the log file means - I don't have a lot of experience with this sort of thing and would greatly appreciate any help.  Here's the info from the lo

Re: [GENERAL] PgAdmin3 for Suse AMD64

2006-02-09 Thread Chandra Sekhar Surapaneni
select groname, grosysid, usename from pg_user right outer join pg_group on usesysid = any(grolist);   This should do the job for 1).   - Chandra Sekhar Surapaneni From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Hrishikesh DeshmukhSent: Thursday, February 09, 2006 12:52 PMTo

[GENERAL] Update table with data from another table

2006-02-09 Thread Mike G.
Hi, I was hoping to update the results of one table with data from another table. I have done this many times before using UPDATE X SET Z FROM Y. The catch this time is the tables involved both have the same column names, same table names but reside in different schemas. UPDATE schema1.A SET

Re: [GENERAL] What's faster?

2006-02-09 Thread Martijn van Oosterhout
On Thu, Feb 09, 2006 at 10:52:03AM -0800, Uwe C. Schroeder wrote: > Depending on your keys neither. > Rather let the DB handle the resultset. count(*) is quite slow. > > How about something like > > select blablabla from _complex_query order by _key_ (optional DESC or ASC) > OFFSET xxx LIMIT 15

[GENERAL] Return more then one value using PL

2006-02-09 Thread Benjamin Arai
smime.p7m Description: S/MIME encrypted message

Re: [GENERAL] Debian Packages For PostgreSQL

2006-02-09 Thread Stephen Frost
* Tyler MacDonald ([EMAIL PROTECTED]) wrote: > Stephen Frost <[EMAIL PROTECTED]> wrote: > > > Speaking of Debian, is there some list to discuss Debian-specific > > > packaging issues, e.g. how to create a Debian package which installs > > > some stored procedures written in C? > > > > Sure: > > ht

Re: [GENERAL] Debian Packages For PostgreSQL

2006-02-09 Thread Tyler MacDonald
Stephen Frost <[EMAIL PROTECTED]> wrote: > > Speaking of Debian, is there some list to discuss Debian-specific > > packaging issues, e.g. how to create a Debian package which installs > > some stored procedures written in C? > > Sure: > http://lists.alioth.debian.org/mailman/listinfo/pkg-postgresq

Re: [GENERAL] Debian Packages For PostgreSQL

2006-02-09 Thread Stephen Frost
* Florian Weimer ([EMAIL PROTECTED]) wrote: > * Redefined Horizons: > > > It looks like the packages.debian.org site is down. Is there another > > place where I can download a .deb for the latest stable version of > > PostgreSQL. (I don't have a direct link to the internet on my Linux > > box, so

[GENERAL] PgAdmin3 for Suse AMD64

2006-02-09 Thread Hrishikesh Deshmukh
Dear All,I have two questions:1) One can used select * from pg_group to get list of groups BUT how does one get group membership say for this example find users who are under the group sales?! booktown=# SELECT * FROM pg_group; groname | grosysid | grolist+--+-

Re: [GENERAL] What's faster?

2006-02-09 Thread Uwe C. Schroeder
Depending on your keys neither. Rather let the DB handle the resultset. count(*) is quite slow. How about something like select blablabla from _complex_query order by _key_ (optional DESC or ASC) OFFSET xxx LIMIT 15 where your offset would be a parameter from the php side and is basically the

Re: [GENERAL] Debian Packages For PostgreSQL

2006-02-09 Thread Florian Weimer
* Redefined Horizons: > It looks like the packages.debian.org site is down. Is there another > place where I can download a .deb for the latest stable version of > PostgreSQL. (I don't have a direct link to the internet on my Linux > box, so I can't use APT.)

Re: [GENERAL] referential integrity without trigger

2006-02-09 Thread Stephan Szabo
On Thu, 9 Feb 2006, Alexander Presber wrote: > Hello everybody, > > Assuming I want to empty and refill table A (with roughly the same > content, preferrably in one transaction) and don't want to completely > empty a dependent table B but still keep referential integrity after > the commit. > > W

Re: [GENERAL] referential integrity without trigger

2006-02-09 Thread Harald Fuchs
In article <[EMAIL PROTECTED]>, Alexander Presber <[EMAIL PROTECTED]> writes: > Hello everybody, > Assuming I want to empty and refill table A (with roughly the same > content, preferrably in one transaction) and don't want to completely > empty a dependent table B but still keep referential integ

Re: [GENERAL] Debian Packages For PostgreSQL

2006-02-09 Thread Shelby Cain
--- Redefined Horizons <[EMAIL PROTECTED]> wrote: > It looks like the packages.debian.org site is down. Is there another > place where I can download a .deb for the latest stable version of > PostgreSQL. (I don't have a direct link to the internet on my Linux > box, so I can't use APT.) > Sorry.

Re: [GENERAL] Debian Packages For PostgreSQL

2006-02-09 Thread Shelby Cain
--- Redefined Horizons <[EMAIL PROTECTED]> wrote: > It looks like the packages.debian.org site is down. Is there another > place where I can download a .deb for the latest stable version of > PostgreSQL. (I don't have a direct link to the internet on my Linux > box, so I can't use APT.) > Try ht

[GENERAL] Debian Packages For PostgreSQL

2006-02-09 Thread Redefined Horizons
It looks like the packages.debian.org site is down. Is there another place where I can download a .deb for the latest stable version of PostgreSQL. (I don't have a direct link to the internet on my Linux box, so I can't use APT.) Thanks, Scott Huey ---(end of broadcast)--

Re: [GENERAL] PQputline error with pg_restore

2006-02-09 Thread Tom Lane
Jennifer Drake <[EMAIL PROTECTED]> writes: > I am running PostgreSQL 7.3.2 on Mandrake 9.1 You should really update to something more current than 7.3.2 :-( > pg_restore: [archiver(db)] error returned by PQputline > pg_restore: *** aborted because of error The first thing to do is get more info

Re: [GENERAL] Is there a way to limit CPU usage per user

2006-02-09 Thread Scott Marlowe
On Wed, 2006-02-08 at 15:42, Merlin Moncure wrote: > > Is there a way to limit user's CPU resource specially on "SELECT" query ? > > > > I hava a table with a lot of rows inside, if one sloopy DB users do a > > "SELECT * FROM bigtable" > > then CPU resource will go near 99% and this action will sur

Re: [GENERAL] [ODBC] Problem using ODBC from .NET framework

2006-02-09 Thread Shelby Cain
--- Ludek Finstrle <[EMAIL PROTECTED]> wrote: > Feel free to re-post the message if 08.01.0200 is still boken. I'll > appreciate if you include mylog output (from 08.01.0200 driver). > Using 08.01.0200, I'm still receiving the same error. However, I've managed to narrow the case when it happens

[GENERAL] PQputline error with pg_restore

2006-02-09 Thread Jennifer Drake
Hello, I am running PostgreSQL 7.3.2 on Mandrake 9.1 I created a database archive using pg_dump (pg_dump -Ft -v -R oral > dbarchive200106.tar). When I try to restore this database with pg_restore on a new system (pg_restore -d oral -R -v dbarchive200106.tar), I get the following error: pg_

Re: [GENERAL] What's faster?

2006-02-09 Thread Alban Hertroys
Silas Justiniano wrote: Hello all! I'm performing a query that returns me hundreds of records... but I need cut them in pages that have 15 items! (using PHP) So, is it faster: select blablabal from _complex_query if (count($result) > 15) show_pages; show_only_15_rows($result); or: se

Re: [GENERAL] Create a new database from JDBC?

2006-02-09 Thread Dan Armbrust
Dave Page wrote: On 8/2/06 17:26, "Joshua D. Drake" <[EMAIL PROTECTED]> wrote: Certainly not what I want, since that database doesn't exist. Is there a system database I could always count on being available that I could connect to? template1 but only if you allow it from pg_hba.conf. The

Re: [GENERAL] [ODBC] Problem using ODBC from .NET framework

2006-02-09 Thread Shelby Cain
--- Ludek Finstrle <[EMAIL PROTECTED]> wrote: > > Hi all. I having an issue with the 8.01.01.02 ODBC driver that is > > installed via the 8.1.x Windows installer. > > ... > > > Anyone have any ideas whats going on or how I can get back to the > 8.0.x > > behavior? > > There is newer 08.01 ps

[GENERAL] Database Comparison tool?

2006-02-09 Thread Nicholas Walker
Are there any tools that can compare a database schema, and produce sql of the changes from one version to the next. We have a development server, and it would be great to be able to just run a tool, where we could produce the changes, review it, and then commit to production. Or is there a

Re: [GENERAL] About CASE Studio - generate SQL output (how to link

2006-02-09 Thread Emi Lu
I saw the online doc mentioned that it supports tablespace for oracle and db2, but does it supports tablespace for postgresql 8.0 as well? http://www.casestudio.com/enu/ver219.aspx - Emi Does anybody have the experiences of using "CASE Studio" ? I used CASE Studio 2.2.1,and it helps me get

[GENERAL] About CASE Studio - generate SQL output (how to link tablespace to table definition)

2006-02-09 Thread Emi Lu
Hello, Does anybody have the experiences of using "CASE Studio" ? I used CASE Studio 2.2.1,and it helps me get a global picture of all objects we have. I tried to generate SQL outputs for tables' definitions. However, I cannot figure out how to specify tablespaces for indexes. For example, "

Re: [GENERAL] Confirming the autovacuum daemon is running

2006-02-09 Thread Jim Buttafuoco
I would be "nice" if vacuum/analyze recorded in a table pg_vacuum (for example) the last time it ran and some stats for each table Jim -- Original Message --- From: "Karl O. Pinc" <[EMAIL PROTECTED]> To: Tom Lane <[EMAIL PROTECTED]> Cc: pgsql-general@postgresql.org Sent: Thu, 09

[GENERAL] Situation with delphi7 x postgresql 8.1.2

2006-02-09 Thread Marcio
 Hi, I develop under Delphi7(Build 8.1) pgexpress 4.01 and postgreSQL 8.1.2 OS is windows XP Professional or Windows 2003 Server. In my project i use dbexpress components TSQLConnection, TSQLQuery -> TDataSetProvider -> TClientDataSet. In some situations when the TClientDataSet excute action

Re: [GENERAL] loading pg_description ... FATAL: duplicate key violates unique constraint "pg_description_o_c_o_index"

2006-02-09 Thread Martijn van Oosterhout
On Thu, Feb 09, 2006 at 10:24:38AM +0530, surabhi.ahuja wrote: > thank u so much for the help. > ok i ll tell u how i arrived at this problem. > > this i was using just for testing purpose on my local m/c > > i had deleted rows in a table, and had searched and found the following: > and did

[GENERAL] referential integrity without trigger

2006-02-09 Thread Alexander Presber
Hello everybody, Assuming I want to empty and refill table A (with roughly the same content, preferrably in one transaction) and don't want to completely empty a dependent table B but still keep referential integrity after the commit. Without disabling A's on-delete-trigger B will be be e