[GENERAL] alter superuser...

2006-02-07 Thread Sergey Karin
Hi, List!I alter user postgres, that was a superuser in my db cluster.  And now it is not a superuser. There are no superusers in my cluster. Yes, I am stupid :)But are there any abilities to restore superuser excluding initdb? Sergey Karin

Re: [GENERAL] Question

2006-02-07 Thread Bruno Wolff III
On Mon, Feb 06, 2006 at 10:54:49 -0500, Hrishikesh Deshmukh <[EMAIL PROTECTED]> wrote: > Hi All, > > I am trying to create a simpel table to handle geneId and productId but the > data file which i want to read in has for some genes more than one productId > ex: > GeneId | ProID1 /// ProID2 /// P

[GENERAL] futex lockup?

2006-02-07 Thread Rob Newton
Hi, I wrote a program using pgsql's ESQL/C. Occasionally it blocks forever on a system call futex(), and I'm wondering if pgsql's libraries use this futex call?? (because my code doesn't use it). Because the problem only occurs occasionally I can't really trace it while it's running. But w

Re: [GENERAL] B-tree performance improvements in 8.x

2006-02-07 Thread Tom Lane
Dick Kniep <[EMAIL PROTECTED]> writes: > Does this also affect if you have many NULL values in the key? So testing Not > is NULL would also be affected? IS NOT NULL isn't an indexable operation, so your question doesn't really apply :-( regards, tom lane -

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

2006-02-07 Thread Luki Rustianto
Hi All, 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 surely affect the other database performance ... Thanks. -

Re: [GENERAL] Clarification Regarding Vacuum and template1

2006-02-07 Thread Christopher Browne
>So in practice, should one vacuum template1 when > vacuuming other database (Assuming one doesn't use vaccumdb > script when vacuuming database)? In practice, it shouldn't be a big deal to vacuum template1 once in a while, because, since it shouldn't have much data other than pg_catalog ta

Re: [GENERAL] UNION or OR / INTERSECT or AND ?

2006-02-07 Thread Michael Glaesemann
On Feb 7, 2006, at 23:04 , David W wrote: do i have to prefered to use UNION and INTERSECT or is it better with OR and AND ? In general, EXPLAIN ANALYZE is your friend. I suspect using OR will be better (and that's only a suspicion), but by using EXPLAIN ANALYZE you can see exactly how th

Re: [GENERAL] B-tree performance improvements in 8.x

2006-02-07 Thread Dick Kniep
Hi list, Does this also affect if you have many NULL values in the key? So testing Not is NULL would also be affected? Cheers, Dick Kniep On Tuesday 07 February 2006 23:13, Tom Lane wrote: > [EMAIL PROTECTED] writes: > > Quoting Tom Lane <[EMAIL PROTECTED]>: > >> In 8.0, the descent code can do

Re: [GENERAL] B-tree performance improvements in 8.x

2006-02-07 Thread Tom Lane
[EMAIL PROTECTED] writes: > Quoting Tom Lane <[EMAIL PROTECTED]>: >> In 8.0, the descent code can do >> either "first entry >= X" or "first entry > X", and the positioning >> rules never need to step more than one entry to locate the desired >> starting position (details left as exercise for the re

Re: [GENERAL] Why pg_hba not in table?

2006-02-07 Thread Tom Lane
Scott Marlowe <[EMAIL PROTECTED]> writes: > On Tue, 2006-02-07 at 15:37, Michael Fuhr wrote: >> On Tue, Feb 07, 2006 at 03:24:01PM -0500, Tom Lane wrote: >>> One other small point is the bootstrapping problem: if you can't get >>> into the database to modify the config table, you've got trouble. >>

Re: [GENERAL] Why pg_hba not in table?

2006-02-07 Thread Scott Marlowe
On Tue, 2006-02-07 at 15:37, Michael Fuhr wrote: > On Tue, Feb 07, 2006 at 03:24:01PM -0500, Tom Lane wrote: > > One other small point is the bootstrapping problem: if you can't get > > into the database to modify the config table, you've got trouble. > > Hence MySQL's --skip-grant-tables option;

Re: [GENERAL] Why pg_hba not in table?

2006-02-07 Thread Michael Fuhr
On Tue, Feb 07, 2006 at 03:24:01PM -0500, Tom Lane wrote: > One other small point is the bootstrapping problem: if you can't get > into the database to modify the config table, you've got trouble. Hence MySQL's --skip-grant-tables option; if you've locked yourself out then you have to disable secu

Re: [GENERAL] Primary keys for companies and people

2006-02-07 Thread John D. Burger
Leif B. Kristensen wrote: Still, I'm struggling with the basic concept of /identity/, eg. is the William Smith born to John Smith and Jane Doe in 1733, the same William Smith who marries Mary Jones in the same parish in 1758? You may never really know. Still, collecting such disparate "facts" un

Re: [GENERAL] B-tree performance improvements in 8.x

2006-02-07 Thread jao
Quoting Tom Lane <[EMAIL PROTECTED]>: [EMAIL PROTECTED] writes: In the 8.0 release notes, (section E.10.4.1), I noticed this statement: Improve B-tree index performance for duplicate keys (Dmitry Tkach, Tom) This improves the way indexes are scanned when many duplicate values

Re: [GENERAL] Why pg_hba not in table?

2006-02-07 Thread Tom Lane
Chris Browne <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] ("Jason C. Leach") writes: >> Why not put pg_hba.conf in a pg table? Seems like it would be much >> easier to work with. After all, if we can keep users in the db >> tables, why not this? > ... Because it represents information that ne

Re: [GENERAL] Why pg_hba not in table?

2006-02-07 Thread Chris Browne
[EMAIL PROTECTED] ("Jason C. Leach") writes: > Why not put pg_hba.conf in a pg table? Seems like it would be much > easier to work with. After all, if we can keep users in the db > tables, why not this? ... Because it represents information that needs to be accessed *before* a connection to the

Re: [GENERAL] B-tree performance improvements in 8.x

2006-02-07 Thread Tom Lane
[EMAIL PROTECTED] writes: > In the 8.0 release notes, (section E.10.4.1), I noticed this > statement: > Improve B-tree index performance for duplicate keys (Dmitry Tkach, Tom) > This improves the way indexes are scanned when many duplicate > values exist in the index. > Can someone d

[GENERAL] B-tree performance improvements in 8.x

2006-02-07 Thread jao
I'm currently running postgresql 7.4.8. Our two biggest tables have indexes on (x, y), where x, y are integers, and there are often many y values per x value. The ratio can be anywhere from 1:1 to 20:1. In the 8.0 release notes, (section E.10.4.1), I noticed this statement: Improve B-tree

Re: [GENERAL] Syncing Databases Weekly

2006-02-07 Thread Joshua D. Drake
Brad Nicholson wrote: Joshua D. Drake wrote: Benjamin Arai wrote: Hi, I am familiar with applications like slony for replications, I am looking for a technique for syncing a very large database every week for backup and redundancy purposes. More specifically, I do all my writes to a ma

Re: [GENERAL] Syncing Databases Weekly

2006-02-07 Thread Brad Nicholson
Joshua D. Drake wrote: Benjamin Arai wrote: Hi, I am familiar with applications like slony for replications, I am looking for a technique for syncing a very large database every week for backup and redundancy purposes. More specifically, I do all my writes to a main server once a week, a

Re: [GENERAL] Why pg_hba not in table?

2006-02-07 Thread Joshua D. Drake
Jason C. Leach wrote: hi, Why not put pg_hba.conf in a pg table? Seems like it would be much easier to work with. After all, if we can keep users in the db tables, why not this? Go for it! It is actually on the TODO. Joshua D. Drake Thanks, J. -- ..

[GENERAL] Why pg_hba not in table?

2006-02-07 Thread Jason C. Leach
hi, Why not put pg_hba.conf in a pg table? Seems like it would be much easier to work with. After all, if we can keep users in the db tables, why not this? Thanks, J. -- Jason C. Leach PGP Key: 0x62DDDF75 Keyserver: gpg.mit.edu -

Re: [GENERAL] Syncing Databases Weekly

2006-02-07 Thread Joshua D. Drake
Benjamin Arai wrote: Hi, I am familiar with applications like slony for replications, I am looking for a technique for syncing a very large database every week for backup and redundancy purposes. More specifically, I do all my writes to a main server once a week, at the end of the updates

Re: [GENERAL] SELECT with REAL...

2006-02-07 Thread Philippe Ferreira
Hi, Thank you all for your comments. Finally, I think I will simply use the data type NUMERIC instead of REAL in all my columns !! This type is more appropriate to store prices ! Philippe Ferreira. Try this: SELECT 13.95 = 13.95::real; It should yield false, because the first number cons

Re: [GENERAL] what is the data type for files(.txt,.doc,.jpeg) in pgsql

2006-02-07 Thread Michael Fuhr
On Tue, Feb 07, 2006 at 10:58:27AM +0100, Peter Eisentraut wrote: > rama krishna wrote: > > 2)I need to perform some action in database before it shutting down > > or before booting of my server.What to do for this situation > > Such a thing doesn't exist in PostgreSQL. You may be able to do thi

Re: [GENERAL] what is the data type for files(.txt,.doc,.jpeg) in

2006-02-07 Thread SCassidy
For item (2), couldn't you modify the existing /etc/rc.d/rc2.d/K15postgresql, /etc/rc.d/rc3.d/K15postgresql, or whatever script(s), or add another script in the /etc/rc.d/rc*.d directories to be run just prior to shutting down the database? Of course, this would only work if the system was taken d

Re: [GENERAL] Syncing Databases Weekly

2006-02-07 Thread Richard Huxton
Benjamin Arai wrote: Hi, I am familiar with applications like slony for replications, I am looking for a technique for syncing a very large database every week for backup and redundancy purposes. More specifically, I do all my writes to a main server once a week, at the end of the updates I w

Re: [GENERAL] Sequences/defaults and pg_dump

2006-02-07 Thread Nikolay Samokhvalov
There is no SERIAL type in the standard at all. Moreover, standard defines following expression for SEQUENCE GENERATORs: ::= NEXT VALUE FOR Postgres has non-standard equivalent - nextval()... So, sequences implementation in PostgreSQL isn't standard-compliant. On 2/7/06, John D. Burger <[EMAI

Re: [GENERAL] Sequences/defaults and pg_dump

2006-02-07 Thread Tom Lane
"John D. Burger" <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> The correct solution to this is to forbid ALTER COLUMN SET DEFAULT on >> a serial column, but we haven't gotten around to enforcing that yet. > Is this per the Standard? SERIAL isn't in the standard. > If so, then the oft-repeated

[GENERAL] Syncing Databases Weekly

2006-02-07 Thread Benjamin Arai
Hi,   I am familiar with applications like slony for replications, I am looking for a technique for syncing a very large database every week for backup and redundancy purposes.  More specifically, I do all my writes to a main server once a week, at the end of the updates I would like to auto

Re: [GENERAL] Sequences/defaults and pg_dump

2006-02-07 Thread John D. Burger
Tom Lane wrote: The correct solution to this is to forbid ALTER COLUMN SET DEFAULT on a serial column, but we haven't gotten around to enforcing that yet. Is this per the Standard? If so, then the oft-repeated mantra that SERIAL is simply a macro for an INTEGER column with a particular DEFA

Re: [GENERAL] Sequences/defaults and pg_dump

2006-02-07 Thread Tom Lane
Nikolay Samokhvalov <[EMAIL PROTECTED]> writes: > Forget about SERIAL. I have INTEGER column with some expression as > DEFAULT in it. No, you have a SERIAL column that you've improperly mucked with the implementation of. If you'd declared it as INTEGER to start with, you could do whatever you wan

Re: [GENERAL] Sequences/defaults and pg_dump

2006-02-07 Thread Bruce Momjian
Nikolay Samokhvalov wrote: > On 2/7/06, Tom Lane <[EMAIL PROTECTED]> wrote: > > Nikolay Samokhvalov <[EMAIL PROTECTED]> writes: > > > testseq=# CREATE TABLE test(id SERIAL, data TEXT); > > > NOTICE: CREATE TABLE will create implicit sequence "test_id_seq" for > > > serial column "test.id" > > > CR

Re: [GENERAL] Clarification Regarding Vacuum and template1

2006-02-07 Thread Ludwig Isaac Lim
> > Yes: the wraparound limit is for transactions > cluster-wide, not per > database. If you make 1 change in template1 and then 2 > billion > changes in some other databases, template1 is broken > unless it's > been vacuumed meanwhile. > > regards, tom lane > So in pr

Re: [GENERAL] strange query runtime

2006-02-07 Thread Tom Lane
Olivier Sirven <[EMAIL PROTECTED]> writes: > Limit (cost=0.00..9677.68 rows=20 width=4) >-> Nested Loop (cost=0.00..61006657.19 rows=126077 width=4) > -> Nested Loop (cost=0.00..59991538.61 rows=252145 width=12) >-> Index Scan Backward using generals_topics_pkey

Re: [GENERAL] Commercial Use

2006-02-07 Thread Gevik Babakhani
yes you can. Read the license :) > Hi,sorry for my English. > I would like to know if i can use PostgreSql for my commercial software. > > ---(end of broadcast)--- > TIP 3: Have you checked our extensive FAQ? > >http://www.postgresql.

Re: [GENERAL] Clarification Regarding Vacuum and template1

2006-02-07 Thread Tom Lane
Ludwig Isaac Lim <[EMAIL PROTECTED]> writes: > Under normal circumstances, there's no need to vacuum > template1 right? Only if it hasn't been modified. > Its quite difficult to imagine XID > wraparound problems occuring in template1. I can't think > how can 4 billion transactions occur in temp

Re: [GENERAL] Sequences/defaults and pg_dump

2006-02-07 Thread Nikolay Samokhvalov
On 2/7/06, Tom Lane <[EMAIL PROTECTED]> wrote: > Nikolay Samokhvalov <[EMAIL PROTECTED]> writes: > > testseq=# CREATE TABLE test(id SERIAL, data TEXT); > > NOTICE: CREATE TABLE will create implicit sequence "test_id_seq" for > > serial column "test.id" > > CREATE TABLE > > *** > > ALTER TABLE test

[GENERAL] UNION or OR / INTERSECT or AND ?

2006-02-07 Thread David W
Hello, do i have to prefered to use UNION and INTERSECT or is it better with OR and AND ? Query example : 1. OR SELECT a.designation, m.label FROM article a JOIN manufacturer m ON m.id = a.manufacturer_id WHERE a.designation || m.label ILIKE '%elec%' OR a.designation || m.label ILIKE '%compa%'

[GENERAL] Clarification Regarding Vacuum and template1

2006-02-07 Thread Ludwig Isaac Lim
Hi : Saw this post on BUGS mailing list : "Olleg Samoylov" writes: >> Opps, template1 must not be vacuumed. >Says who? >If we didn't vacuum template1 then it would be subject to >XID wraparound >problems, unless it had never been modified, which is >something vacuumdb >can't count on. > rega

Re: [GENERAL] Trying to auto start Postgres when server boots up

2006-02-07 Thread Tom Lane
"Shahid Butt" <[EMAIL PROTECTED]> writes: > I am using PostgreSQL 7.4.7 and Red Hat Enterprise Linux 4. > I want to start the Postgres Postmaster automatically when the server > boots up. If you're using an RPM distribution then you shouldn't need to muck with rc.local. The startup files are th

Re: [GENERAL] Commercial Use

2006-02-07 Thread Bruce Momjian
Yes, see our FAQ. --- Flavio Basile wrote: > Hi,sorry for my English. > I would like to know if i can use PostgreSql for my commercial software. > > ---(end of broadcast)--- >

Re: [GENERAL] Sequences/defaults and pg_dump

2006-02-07 Thread Bruce Momjian
Tom Lane wrote: > Nikolay Samokhvalov <[EMAIL PROTECTED]> writes: > > testseq=# CREATE TABLE test(id SERIAL, data TEXT); > > NOTICE: CREATE TABLE will create implicit sequence "test_id_seq" for > > serial column "test.id" > > CREATE TABLE > > *** > > ALTER TABLE test ALTER COLUMN id SET DEFAULT ne

[GENERAL] Commercial Use

2006-02-07 Thread Flavio Basile
Hi,sorry for my English. I would like to know if i can use PostgreSql for my commercial software. ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] Sequences/defaults and pg_dump

2006-02-07 Thread Tom Lane
Nikolay Samokhvalov <[EMAIL PROTECTED]> writes: > testseq=# CREATE TABLE test(id SERIAL, data TEXT); > NOTICE: CREATE TABLE will create implicit sequence "test_id_seq" for > serial column "test.id" > CREATE TABLE > *** > ALTER TABLE test ALTER COLUMN id SET DEFAULT nextval('test_id_seq') * 10; Th

Re: [GENERAL] Installation of PostGIS

2006-02-07 Thread Richard Huxton
gwx cathy wrote: > Hi, everyone, I installed PostgreSql 8.1, then I go on install PostGIS > 1.1.1. But I failed at last and got the following details information. > Who knows the problem? Thanks! > 3008 ERRORS > Loading PostGIS failed. Check > "C:\DOCUME~1\cathy\LOCALS~1\Temp\create_postgis_sql

[GENERAL] Installation of PostGIS

2006-02-07 Thread gwx cathy
Hi, everyone, I installed PostgreSql 8.1, then I go on install PostGIS 1.1.1. But I failed at last and got the following details information. Who knows the problem? Thanks! cathy Created uninstaller: C:\Program Files\PostgreSQL\8.1\uninstall-postgis-pg81-1.1.1-1.exe UserName=postgres Passwo

Re: [GENERAL] Sequences/defaults and pg_dump

2006-02-07 Thread Martijn van Oosterhout
On Tue, Feb 07, 2006 at 03:28:31PM +0300, Nikolay Samokhvalov 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 user in my system can

Re: [GENERAL] Compile of Pgmail function fails

2006-02-07 Thread Robert Treat
On Monday 06 February 2006 01:12, indu ss wrote: > Hello, > > I want to send mail on update of a field in a table. > I'm using pgmail() function (from sourceforge) . I'm > calling this function from another function which is > called by trigger on update of the field. > On executing the update sta

Re: [GENERAL] Sequences/defaults and pg_dump

2006-02-07 Thread Nikolay Samokhvalov
On 2/7/06, Martijn van Oosterhout wrote: > On Tue, Feb 07, 2006 at 02:33:56PM +0300, Nikolay Samokhvalov wrote: > Well, it's a very contrived example (I can't think of a reason why one > would do that) but I agree it is a bug. You could acheive the same > effect by setting the step of the sequenc

Re: [GENERAL] Sequences/defaults and pg_dump

2006-02-07 Thread Martijn van Oosterhout
On Tue, Feb 07, 2006 at 02:33:56PM +0300, Nikolay Samokhvalov wrote: > Maybe it was discussed already, but I think it's very strange behavior > and things should be changed (please correct me if I'm wrong) > > Suppose we have database containing only one simple table: > So, if we don't know the

[GENERAL] Sequences/defaults and pg_dump

2006-02-07 Thread Nikolay Samokhvalov
Maybe it was discussed already, but I think it's very strange behavior and things should be changed (please correct me if I'm wrong) Suppose we have database containing only one simple table: *** template1=# CREATE DATABASE testseq; template1=# \c testseq testseq=# CREATE TABLE test(id SERIAL, da

Re: [GENERAL] strange query runtime

2006-02-07 Thread Richard Huxton
Olivier Sirven wrote: The query is slow but it works fine as it completes in less than 1 second. The problem is that if I change the filter value of id_category from 15 to 3 the query will take more than 7 minutes to complete! The only difference between id_category 3 and 15 is that there is ab

Re: [GENERAL] query

2006-02-07 Thread Richard Huxton
superboy143 (sent by Nabble.com) wrote: I have a table in which I have a field with format like 100101. [snip] Try to restrict posting to one list at a time. I've replied on the SQL list already to this message, and I think it's a better location for it. -- Richard Huxton Archonet Ltd

[GENERAL] strange query runtime

2006-02-07 Thread Olivier Sirven
Hi, I am running a query which makes a join on 3 tables: - generals (contains 200 000 rows) - category_generals (contains 200 000 rows) - generals_topics (contains 15 000 000 rows) The query is wrote this way: SELECT gt.id_topic FROM generals g, category_generals cs, generals_topi

Re: [GENERAL] what is the data type for files(.txt,.doc,.jpeg) in pgsql

2006-02-07 Thread Peter Eisentraut
rama krishna wrote: > 1)I need to insert the files in database .So what i have to give the > data type for that field while creating the table. bytea -- Look into the documentation for encoding and other handling issues. > 2)I need to perform some action in database before it shutting down > or

[GENERAL] query

2006-02-07 Thread superboy143 (sent by Nabble.com)
I have a table in which I have a field with format like 100101. It has many values like 100101, 100102, 100103, 100201, 100202, 100301. I have to write a query such that I have to get only distinct values such that they contain only the substring I need. If I give 10 as substring, then it should