Re: [GENERAL] granting privileges

2004-12-01 Thread Najib Abi Fadel
Hi Nageshwar try this command i think it's what you need.   psql -t -d DataBaseName -c "select tablename from pg_tables where schemaname='theSchemaName' " | xargs -i  psql -t -d DataBaseName -c "grant select on {} to nabifadel"     Najib. Programmer at Saint-Joseph University Lebanon     -

Re: [GENERAL] Trigger problem 2

2004-12-01 Thread Richard Huxton
Jamie Deppeler wrote: UPDATE wip.resource set "name" = datarecord.borname where wip.resource."primary" = OLD."primary"; get the following error Error: record "old" is not yet assigned If called from an INSERT then OLD is undefined, since there is no old version of the row. -- Richar

Re: [GENERAL] [HACKERS] Adding Reply-To: to Lists configuration ...

2004-12-01 Thread Chris Green
On Wed, Dec 01, 2004 at 02:02:41AM -0600, Bruno Wolff III wrote: > On Mon, Nov 29, 2004 at 12:49:46 +, > Chris Green <[EMAIL PROTECTED]> wrote: > > > > This is a perpetual problem, if people all used the same MUA and > > (assuming it has the capability) all used the 'reply to list' command >

Re: [GENERAL] Upcoming Changes to News Server ...

2004-12-01 Thread Geoffrey
Tom Lane wrote: Jan Wieck <[EMAIL PROTECTED]> writes: Oh my, after reading this he really caught my attention. You have to google for "Gary Burnore" a little. This guy has a record ... gburnore was known far and wide as a net.asshole when I dropped out of Usenet, lo these many years ago. Doesn'

[GENERAL] "PoastgreSQL/SQLite Anywhere"?

2004-12-01 Thread Wolfgang Keller
Hello, for applications which require offline data collection/processing with PDAs and synchronisation/replication with a centralised server database (running on PostgreSQL), I was wondering whether it would be possible to set up an equivalent to *duck* Sybase SQL Anwhere using free software, m

[GENERAL] pg_restore taking 4 hours!

2004-12-01 Thread Rodrigo Carvalhaes
Hi! I am using PostgreSQL with a proprietary ERP software in Brazil. The database have around 1.600 tables (each one with +/- 50 columns). My problem now is the time that takes to restore a dump. My customer database have arount 500mb (on the disk, not the dump file) and I am making the dump wit

Re: [GENERAL] Newbie question: returning rowtypes from a plpgsql function

2004-12-01 Thread Larry White
Please excuse my ignorance of databases and black holes. I don't have access to a Postgres db right now so I tried an experiment with mysql. Since they don't have a "select into" that creates a table, I tried this: mysql> create table t as ( select * from table_x); since table_x has no rows,

Re: [GENERAL] "PoastgreSQL/SQLite Anywhere"?

2004-12-01 Thread Johan Wehtje
I am glad to hear that someone else is thinking along these lines , I am working on a project that uses PDA's with Differential GPS as field survey units, and I would like to be able to do more than simply dump the collected data and then append it to a Postgresql DB at home base, as we are loo

Re: [GENERAL] "PoastgreSQL/SQLite Anywhere"?

2004-12-01 Thread Adrian Klaver
On Wednesday 01 December 2004 04:43 am, Wolfgang Keller wrote: > Hello, > > for applications which require offline data collection/processing with PDAs > and synchronisation/replication with a centralised server database (running > on PostgreSQL), I was wondering whether it would be possible to set

Re: [GENERAL] [PERFORM] pg_restore taking 4 hours!

2004-12-01 Thread Shridhar Daithankar
On Wednesday 01 Dec 2004 4:46 pm, Rodrigo Carvalhaes wrote: > I need to find a solution for this because I am convincing customers > that are using SQL Server, DB2 and Oracle to change to PostgreSQL but > this customers have databases of 5GB!!! I am thinking that even with a > better server, the re

Re: [GENERAL] [HACKERS] Adding Reply-To: to Lists configuration ...

2004-12-01 Thread Bruno Wolff III
On Wed, Dec 01, 2004 at 09:33:18 +, Chris Green <[EMAIL PROTECTED]> wrote: > On Wed, Dec 01, 2004 at 02:02:41AM -0600, Bruno Wolff III wrote: > > On Mon, Nov 29, 2004 at 12:49:46 +, > > Chris Green <[EMAIL PROTECTED]> wrote: > > > > > > This is a perpetual problem, if people all used t

Re: [GENERAL] Newbie question: returning rowtypes from a plpgsql function

2004-12-01 Thread Tom Lane
Larry White <[EMAIL PROTECTED]> writes: > mysql> create table t as ( select * from table_x); That works in Postgres too. The SELECT INTO construct is a bit broken since, as you discovered, it has a different meaning in plpgsql than in the main SQL language. So I recommend using CREATE TABLE AS w

Re: [GENERAL] [PERFORM] pg_restore taking 4 hours!

2004-12-01 Thread Riccardo G. Facchini
--- Shridhar Daithankar <__> wrote: > On Wednesday 01 Dec 2004 4:46 pm, Rodrigo Carvalhaes wrote: > > I need to find a solution for this because I am convincing > customers > > that are using SQL Server, DB2 and Oracle to change to PostgreSQL > but > > this customers have databases of 5GB!!! I am

Re: [GENERAL] [HACKERS] Adding Reply-To: to Lists configuration ...

2004-12-01 Thread Tom Lane
Bruno Wolff III <[EMAIL PROTECTED]> writes: > It is also possible for mailing list software to handle this > preference for you (by not sending copies to addresses on the list > that appear in the recipient headers), but I don't know if the > software in use has that capability. That's a good poin

Re: [GENERAL] [PERFORM] pg_restore taking 4 hours!

2004-12-01 Thread Tom Lane
Shridhar Daithankar <[EMAIL PROTECTED]> writes: > On Wednesday 01 Dec 2004 4:46 pm, Rodrigo Carvalhaes wrote: >> I need to find a solution for this because I am convincing customers >> that are using SQL Server, DB2 and Oracle to change to PostgreSQL but >> this customers have databases of 5GB!!! I

[GENERAL] Variable column name in plpgsql function

2004-12-01 Thread George Woodring
I am trying to create a trigger that needs to capture the primary key value out of NEW variable. However the trigger can be called from 2 different tables whose PKs are Table1id Table2id Is possible to declare a variable to build the column name Tableid varchar(20) := TG_RELNAME || ''id''; And

Re: [GENERAL] Upcoming Changes to News Server ...

2004-12-01 Thread Jan Wieck
On 11/30/2004 11:46 PM, Marc G. Fournier wrote: On Tue, 30 Nov 2004, Jan Wieck wrote: On 11/30/2004 2:37 PM, Gary L. Burnore wrote: Perhaps I wasn't clear. I don't care WHO you are. I've already asked you once to stay out of my email. Further emails from you will be reported to both Yahoo and C

Re: [GENERAL] Variable column name in plpgsql function

2004-12-01 Thread Richard Huxton
George Woodring wrote: Is possible to declare a variable to build the column name Tableid varchar(20) := TG_RELNAME || ''id''; And then use this variable to get the PK value? Tableidvalue int4 := NEW.tableid; No. You can build a dynamic query via EXECUTE, but that can't access NEW/OLD. -- Richa

Re: [GENERAL] Variable column name in plpgsql function

2004-12-01 Thread mark
Richard Huxton wrote: George Woodring wrote: Is possible to declare a variable to build the column name Tableid varchar(20) := TG_RELNAME || ''id''; And then use this variable to get the PK value? Tableidvalue int4 := NEW.tableid; No. You can build a dynamic query via EXECUTE, but that can't acces

[GENERAL] autocommit and transactions

2004-12-01 Thread Sally Sally
Using perl DBI I recently read that if autocommit is turned on, it does a commit after every transaction. I wanted to confirm if this also applies to select statements. When I'm loading data, I need to do a select before inserting a new row and I don't want to commit after the select because it'

[GENERAL] data integrity and inserts

2004-12-01 Thread Scott Frankel
I want to ensure data integrity when inserting into a table, preventing multiple entries of identical rows of data. Does this call for using a trigger? How would triggers perform a query to test if data already exists in the table? (The doco outlines how triggers perform tests on NEW data inser

Re: [GENERAL] data integrity and inserts

2004-12-01 Thread gnari
From: "Scott Frankel" <[EMAIL PROTECTED]> > > I want to ensure data integrity when inserting into a table, preventing > multiple > entries of identical rows of data. > > sample table: > > CREATE TABLE names (the_id SERIAL PRIMARY KEY, the_name text); sounds like a job for a UNIQUE constrain

Re: [GENERAL] data integrity and inserts

2004-12-01 Thread Joshua D. Drake
Scott Frankel wrote: I want to ensure data integrity when inserting into a table, preventing multiple entries of identical rows of data. Just use a unique index on the columns you want to make sure are not duplicated. Does this call for using a trigger? How would triggers perform a query to test

Re: [GENERAL] data integrity and inserts

2004-12-01 Thread Ian Harding
CREATE UNIQUE INDEX uidx_thename ON names(the_name); Should prevent duplicates. Ian Harding Programmer/Analyst II Tacoma-Pierce County Health Department [EMAIL PROTECTED] Phone: (253) 798-3549 Pager: (253) 754-0002 >>> Scott Frankel <[EMAIL PROTECTED]> 12/01/04 10:11 AM >>> I want to ensure dat

Re: [GENERAL] USENET vs Mailing Lists Poll ...

2004-12-01 Thread Michelle Konzack
Am 2004-12-01 10:45:51, schrieb Joel: > Suggested questions: > > (1) If there were a USENET newsfeed, under comp.databases.postgresql.*, > of one or more of the current postgresql mailing lists, I would > (c) use the mailing lists primarily, > (2) If there were a separate USENET comp.databa

Re: [GENERAL] data integrity and inserts

2004-12-01 Thread Scott Frankel
1. CREATE TABLE names (the_id SERIAL PRIMARY KEY, the_name text); CREATE UNIQUE INDEX uidx_thename ON names(the_name); vs. 2. CREATE TABLE names (the_id SERIAL PRIMARY KEY, the_name text UNIQUE); Is the UNIQUE constraint in the second solution merely short-hand for the explicit index decla

Re: [GENERAL] autocommit and transactions

2004-12-01 Thread gnari
From: "Sally Sally" <[EMAIL PROTECTED]> > Using perl DBI I recently read that if autocommit is turned on, it does a > commit after every transaction. I wanted to confirm if this also applies to > select statements. in fact, it wraps every statement that is not aleady in a transaction, into one.

[GENERAL] createlang plperl fails with 8.0 beta5

2004-12-01 Thread Joachim Zobel
Hi. If I try createlang plperl I get: [EMAIL PROTECTED]:~$ /usr/local/pgsql/bin/createlang plperl shop createlang: language installation failed: ERROR: could not access file "$libdir/plperl": No such file or directory Checking my build dirs I find that no plperl.so has been build (--with-perl

[GENERAL] Poor Performance with Distinct Subqueries with EXISTS and EXCEPT

2004-12-01 Thread Thomas F . O'Connell
I'm trying to do some research and reporting for an email application by domain name. This has led to a confounding attempt to do any of the legwork in SQL via postgres. Here is my foundational query: SELECT DISTINCT split_part( u.email, '@', 2 ) FROM user AS u, message AS m WHERE u.id = m.use

[GENERAL] Need Help and suggestion.

2004-12-01 Thread Artistic-HO- IT-Department
Hi I have a user table in which number of users are created in a database rather creating postgresql user. We are having only one database user, through which we connect database. I have make a simple table into database and fire a triggers on add, edit and delete data alongwith userid and act

[GENERAL] Get diagnistic (row_count) 7.3 vs. 7.4 changes

2004-12-01 Thread Maksim Likharev
Hi, Just trying 7.4.5 and bumped into a problem. consider following code: CREATE OR REPLACE FUNCTION rowcount_test() RETURNS bigint AS ' DECLARE base_hits bigint; BEGIN CREATE TEMP TABLE ltbl_temp AS SELECT 1 AS data; GET DIAGNOSTICS base_hits = ROW_COUNT; RETURN base_hits; E

Re: [GENERAL] Upcoming Changes to News Server ...

2004-12-01 Thread Woodchuck Bill
[EMAIL PROTECTED] (Jan Wieck) wrote in news:[EMAIL PROTECTED]: > On 11/30/2004 2:37 PM, Gary L. Burnore wrote: > >> Perhaps I wasn't clear. I don't care WHO you are. I've already asked >> you once to stay out of my email. Further emails from you will be >> reported to both Yahoo and Comcast as

[GENERAL] md5 checksum mismatch

2004-12-01 Thread Bill Kurland
I've downloaded several versions of postgresql from several mirrors. On none of them did the md5 checksums from http://www.gtsm.com/postgres_sigs.html match the md5 checksum from the postgresql-*.tar.gz source file I downloaded. I can't imagine that all these file are corrupted, yet I don't see

Re: [GENERAL] Get diagnistic (row_count) 7.3 vs. 7.4 changes

2004-12-01 Thread Tom Lane
Maksim Likharev <[EMAIL PROTECTED]> writes: > consider following code: > CREATE OR REPLACE FUNCTION rowcount_test() RETURNS bigint AS ' > DECLARE > base_hits bigint; > BEGIN > CREATE TEMP TABLE ltbl_temp AS SELECT 1 AS data; > GET DIAGNOSTICS base_hits = ROW_COUNT; > RETURN base

[GENERAL] Displaying more than six digits from a real number

2004-12-01 Thread Clodoaldo Pinto
The 7.4.2 manual says the precision of a real number is 6 decimal digits. Is it possible to force the display of more than six decimal digits of a real number whithout using to_char() or casting? Using 7.4.2, FC2. create table test (f4 float4) without oids; insert into test values (4877852); sel

[GENERAL] Pl/Perl w/ Postgres 8.0 on Windows

2004-12-01 Thread Eric E
Hi all, I am throughly enjoying using Postgres 8.0 on Windows, so I can develop my Windows client against Postgres. I would like to write some pl/perl functions, and I'm a little stumped. Now comes the sad confession - I installed PG from the Windows installer rather than building it. Can

Re: [GENERAL] createlang plperl fails with 8.0 beta5

2004-12-01 Thread Tom Lane
Joachim Zobel <[EMAIL PROTECTED]> writes: > Checking my build dirs I find that no plperl.so has been build > (--with-perl was used in configure). Instead I find a libplperl.so in > the pgperl build directory. That's how it's built, but it should be installed as plperl.so. Are you sure you are loo

Re: [GENERAL] [PERFORM] pg_restore taking 4 hours!

2004-12-01 Thread Josh Berkus
Rodrigo, > Our machine it's a Dell Server Power Edge 1600sc (Xeon 2,4Ghz, with 1GB > memory, 7200 RPM disk). I don't think that there is a machine problem > because it's a server dedicated for the database and the cpu utilization > during the restore is around 30%. In addition to Tom and Shridhar

Re: [GENERAL] createlang plperl fails with 8.0 beta5

2004-12-01 Thread Joachim Zobel
Am Mi, den 01.12.2004 schrieb Tom Lane um 21:22: > Joachim Zobel <[EMAIL PROTECTED]> writes: > > Checking my build dirs I find that no plperl.so has been build > > (--with-perl was used in configure). Instead I find a libplperl.so in > > the pgperl build directory. > > That's how it's built, but i

Re: [GENERAL] Displaying more than six digits from a real number

2004-12-01 Thread Bruno Wolff III
On Wed, Dec 01, 2004 at 20:25:28 -0300, Clodoaldo Pinto <[EMAIL PROTECTED]> wrote: > The 7.4.2 manual says the precision of a real number is 6 decimal digits. > > Is it possible to force the display of more than six decimal digits of a real > number whithout using to_char() or casting? I think

Re: [GENERAL] Displaying more than six digits from a real number

2004-12-01 Thread Tom Lane
Clodoaldo Pinto <[EMAIL PROTECTED]> writes: > The 7.4.2 manual says the precision of a real number is 6 decimal digits. > Is it possible to force the display of more than six decimal digits of a real > number Perhaps the extra_float_digits runtime parameter is what you want? (You are of course awa

Re: [GENERAL] data integrity and inserts

2004-12-01 Thread Bruno Wolff III
On Wed, Dec 01, 2004 at 10:48:40 -0800, Scott Frankel <[EMAIL PROTECTED]> wrote: > > 1. > CREATE TABLE names (the_id SERIAL PRIMARY KEY, the_name text); > CREATE UNIQUE INDEX uidx_thename ON names(the_name); > > vs. > > 2. > CREATE TABLE names (the_id SERIAL PRIMARY KEY, the_name text UN

Re: [GENERAL] createlang plperl fails with 8.0 beta5

2004-12-01 Thread Tom Lane
Joachim Zobel <[EMAIL PROTECTED]> writes: > Am Mi, den 01.12.2004 schrieb Tom Lane um 21:22: >> That's how it's built, but it should be installed as plperl.so. Are you >> sure you are looking in the right $libdir? > I did not give any directory options during install, so > ls -l /usr/local/pgsql/

Re: [GENERAL] createlang plperl fails with 8.0 beta5

2004-12-01 Thread Joachim Zobel
Am Mi, den 01.12.2004 schrieb Tom Lane um 22:00: > Probably more like /usr/local/lib/postgresql ... did you look at the > directory structure? Or consult pg_config --pkglibdir ? [EMAIL PROTECTED]:~$ /usr/local/pgsql/bin/pg_config --pkglibdir /usr/local/pgsql/lib and there is [EMAIL PROTECTED]:

Re: [GENERAL] Upcoming Changes to News Server ...

2004-12-01 Thread Jan Wieck
On 12/1/2004 1:25 PM, Woodchuck Bill wrote: Jan, Gary may be blunt at times, but try to understand things from his perspective. He is posting to Usenet. He expects his replies to appear on Usenet. You are accustomed to your way of writing and reading messages. He is accustomed to his way. Perhaps

[GENERAL] Indexes?

2004-12-01 Thread Bjørn T Johansen
I have a table where I need to use "..where curdate between fromDate and toDate". Is it best to have two indexes, one for FromDate and one for toDate or just one index for both the fields? Regards, BTJ --