Re: [GENERAL] JSP pages don't work with database after postgres downgrade

2006-03-07 Thread Phill Edwards
> > Check your postgresql logs firstly. > > Nothing's showing up in the logs. I can see that postgres has > successfully started in syslog when I restart it. I'm not getting > anything at all being written to /var/log/postgresql even though > debug_level = 4 in /var/lib/pgsql/data/postgresql.conf >

[GENERAL] pg_dump error - filesystem full

2006-03-07 Thread Poul Møller Hansen
/tmp: write failed, filesystem is full pg_dump: [tar archiver] could not write to tar member (wrote 0, attempted 101) Is there a way to make pg_dump use /var/tmp as a temporary filespace instead ? Thanks, Poul ---(end of broadcast)--- TIP 9

Re: REPOST: [GENERAL] How to determine the table a query or a views columns come from?

2006-03-07 Thread Frank Church
Quoting Tom Lane <[EMAIL PROTECTED]>: Quoting Tom Lane <[EMAIL PROTECTED]>: Can this info be obtained by querying the system tables, especially in the case of views? I am using 'scripting' languages and using C will be quite awkward. > Frank Church <[EMAIL PROTECTED]> writes: > > Is there way to

[GENERAL] Logging seq scans

2006-03-07 Thread Guido Neitzer
Hi. Is there a way to set up logging in a way that I can see queries which trigger seq scans? Or to log queries "taking longer than xx ms"? Background is, that it is nearly impossible to tell, which queries are used in my applications as they are mostly generated by the frameworks. Yester

[GENERAL] Question about index usage

2006-03-07 Thread Guido Neitzer
Hi. Is there a reason why this query: select id from dga_dienstleister where plz in ('45257', '45259'); doesn't use this index: "dga_dienstleister_plz_index" btree (plz varchar_pattern_ops) but uses this index: "dga_dienstleister_plz_index2" btree (plz) I had the first index setup f

Re: [GENERAL] Question about index usage

2006-03-07 Thread chris smith
On 3/7/06, Guido Neitzer <[EMAIL PROTECTED]> wrote: > Hi. > > Is there a reason why this query: > > select id from dga_dienstleister where plz in ('45257', '45259'); > > doesn't use this index: > > "dga_dienstleister_plz_index" btree (plz varchar_pattern_ops) > > but uses this index: > >

Re: [GENERAL] Logging seq scans

2006-03-07 Thread A. Kretschmer
am 07.03.2006, um 11:59:18 +0100 mailte Guido Neitzer folgendes: > Hi. > > Is there a way to set up logging in a way that I can see queries which > trigger seq scans? Or to log queries "taking longer than xx ms"? Yes, of cource. You can define log_min_duration_statement = 100 to log all quer

Re: REPOST: [GENERAL] How to determine the table a query or a views columns come from?

2006-03-07 Thread Martijn van Oosterhout
On Tue, Mar 07, 2006 at 10:38:29AM +, Frank Church wrote: > Quoting Tom Lane <[EMAIL PROTECTED]>: > > Can this info be obtained by querying the system tables, > especially in the case of views? I am using 'scripting' languages and using C > will be quite awkward. Well, Tom suggests the PQftab

Re: [GENERAL] Question about index usage

2006-03-07 Thread Guido Neitzer
On 07.03.2006, at 12:09 Uhr, chris smith wrote: Try without the quotes: select id from dga_dienstleister where plz in (45257, 45259); Same result, second index is used. What is the table structure for dga_dienstleister ? For the relevant column: plz| chara

Re: [GENERAL] Logging seq scans

2006-03-07 Thread Guido Neitzer
On 07.03.2006, at 12:11 Uhr, A. Kretschmer wrote: Yes, of cource. You can define log_min_duration_statement = 100 to log all queries taking longer 100 ms. Thanks. cug -- PharmaLine, Essen, GERMANY Software and Database Development smime.p7s Description: S/MIME cryptographic signature

Re: [GENERAL] JSP pages don't work with database after postgres downgrade

2006-03-07 Thread Kenevel
Phill Edwards wrote: > I can see these errors in /usr/local/tomcat/logs/catalina.out: > >Unable to instantiate DB connection pool. >Technical error message: >java.lang.NullPointerException >A null connection was relinquished. > > Does that shed any more light on the matter? Err, ye

Re: [GENERAL] pg_dump error - filesystem full

2006-03-07 Thread Peter Eisentraut
Am Dienstag, 7. März 2006 11:13 schrieb Poul Møller Hansen: > Is there a way to make pg_dump use /var/tmp as a temporary filespace > instead ? Try export TMPDIR=/var/tmp. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)--

Re: [GENERAL] Is the "ACCESS EXCLUSIVE" lock for TRUNCATE really

2006-03-07 Thread Florian G. Pflug
Tom Lane wrote: "Florian G. Pflug" <[EMAIL PROTECTED]> writes: Tom Lane wrote: Until when? How would you synchronize the switchover? Every snapshot would either contain the old, or the new version of the corresponding pg_class tuple. The ones using the old version couldn't possible be writ

[GENERAL] real - integer type cast in prepared statements

2006-03-07 Thread Andrei
Hi! Why when I prepare statement by parsing such query: 'SELECT * FROM "test" WHERE "ind" < $1 + 1' ("ind" is of type REAL) $1 is interpreted by backend as INTEGER? Parse completed successfully, but trying to bind parameter as '20.20' resulted in "ERROR C22P02 Minvalid input syntax for intege

Re: [GENERAL] Benchmark-Comparison PostGreSQL vs. SQL Server

2006-03-07 Thread Russ Brown
On Thu, 25 Nov 2004 11:36:33 +0100 "Robert Soeding" <[EMAIL PROTECTED]> wrote: > Hi, this is my first question here, and also, it's somewhat delicate. > So please be patient. > My question is, CAN PostGreSQL perform in the SQL Server area when it > comes to speed? In other words, are there explan

Re: [GENERAL] Logging seq scans

2006-03-07 Thread Richard Huxton
Guido Neitzer wrote: Hi. Is there a way to set up logging in a way that I can see queries which trigger seq scans? Or to log queries "taking longer than xx ms"? The second is straightforward. See the "log_min_duration_statement" setting in the "logging" section of the manuals. -- Richard

[GENERAL] per-statement, after, what's new?

2006-03-07 Thread Kenneth Downs
Hi folks, I cannot find this in Google, Google groups, online docs, or the archive, so I hope somebody can help me. If I define a per-statement AFTER INSERT trigger, how are the new rows exposed to the trigger? Put another way, what is the equivalent to the row-level variables NEW and OLD

Re: [GENERAL] real - integer type cast in prepared statements

2006-03-07 Thread Tom Lane
Andrei <[EMAIL PROTECTED]> writes: > Why when I prepare statement by parsing such query: 'SELECT * FROM > "test" WHERE "ind" < $1 + 1' ("ind" is of type REAL) $1 is interpreted > by backend as INTEGER? Because the context in which its type first has to be resolved is "$1 + 1", and the "1" is INT

Re: [GENERAL] About when we should setup index?

2006-03-07 Thread Emi Lu
Thank you very much Michael. Your inputs are very helpful for me. Just have one small question, the example you gave is based on postgresql 8.1, does it apply to PostgreSQL 8.0.1 as well (i686-pc-linux-gnu, compiled by GCC gcc 3.3.2)? - Emi . id is the primary key, so a default unique inde

Re: [GENERAL] pg_dump error - filesystem full

2006-03-07 Thread Tom Lane
Peter Eisentraut <[EMAIL PROTECTED]> writes: > Am Dienstag, 7. März 2006 11:13 schrieb Poul Møller Hansen: >> Is there a way to make pg_dump use /var/tmp as a temporary filespace >> instead ? > Try export TMPDIR=/var/tmp. Also, unless you have a really good reason to be using -Ft dump format, I'd

Re: [GENERAL] Question about index usage

2006-03-07 Thread Tom Lane
Guido Neitzer <[EMAIL PROTECTED]> writes: > Is there a reason why this query: > select id from dga_dienstleister where plz in ('45257', '45259'); > doesn't use this index: > "dga_dienstleister_plz_index" btree (plz varchar_pattern_ops) > but uses this index: > "dga_dienstleister_plz_index

Re: [GENERAL] Question about index usage

2006-03-07 Thread Guido Neitzer
On 07.03.2006, at 16:04 Uhr, Tom Lane wrote: Because IN means "=", which is a member of the index opclass for the second index but not the first. Why do you care? Should be about the same result either way. Only because I haven't set up the second index because I wasn't aware of this fact.

Re: [GENERAL] per-statement, after, what's new?

2006-03-07 Thread Tom Lane
Kenneth Downs <[EMAIL PROTECTED]> writes: > If I define a per-statement AFTER INSERT trigger, how are the new rows > exposed to the trigger? They aren't. regards, tom lane ---(end of broadcast)--- TIP 6: explain analyze is

Re: [GENERAL] About when we should setup index?

2006-03-07 Thread Michael Fuhr
On Tue, Mar 07, 2006 at 09:54:11AM -0500, Emi Lu wrote: > Thank you very much Michael. Your inputs are very helpful for me. Just > have one small question, the example you gave is based on postgresql > 8.1, does it apply to PostgreSQL 8.0.1 as well (i686-pc-linux-gnu, > compiled by GCC gcc 3.3.

[GENERAL] how to setup default privileges

2006-03-07 Thread Emi Lu
Hello, When an object is created by the default user "user1", I ran: \dp+ tableName , and got: Schema| Name | Type | Access privileges -+--+---+--- schemaName | t1 | table | --- step 0 The Access privileges is blank. However, I

[GENERAL] User defined EXCEPTIONs

2006-03-07 Thread vishal saberwal
Using postgreSQL 8.1 on fedora.Below is a function RowCount_Select(Table_Name) defined that raises exception (test1) which i intend to catch in test1( ) and raise exception (test2).Do we have a way to catch such user defined exceptions? Can someone direct me to the right resource pages? create or r

Re: [GENERAL] User defined EXCEPTIONs

2006-03-07 Thread vishal saberwal
I have a work around, but it would really help if there was a way to define my own exceptions (for business logic),Here is the output, for those who would be browsing for it in future,create or replace function RowCount_Select(varchar) returns int as $$ DECLARE    res int;BEGIN    select into res r

Re: [GENERAL] how to setup default privileges

2006-03-07 Thread Tom Lane
Emi Lu <[EMAIL PROTECTED]> writes: > Could somebody tell me that what are the default privileges for table t1 > please? Does it equal to > grant all on t1 to "user1", please? Yes. See the reference page for GRANT for details. regards, tom lane --

Re: [GENERAL] how to setup default privileges

2006-03-07 Thread Emi Lu
When I first created an object, and did "\dp+ tableName" I got blank under "Access privileges". However, if I tried to grant any permission to a group/user, I will see the access privileges for the object owner. Example: 1. create table test(id char(3)); 2. \dp+ test; Schema| Name |

[GENERAL] Perspective: PostgreSQL usage boon after release of 8.2

2006-03-07 Thread Ken Johanson
Just a quick thought, and an possibly over-optimistic forecast: I think PG will see a really significant increase in usage, especially 'corporate' use, with the release of the version that has support for (what I consider to be) one of the biggest features in recent memory: standard iso/ansi s

[GENERAL] ALTER TABLE -- how to add ON DELETE CASCADE?

2006-03-07 Thread felix
I have table A with a column AA which references table B's primary key BB, and I want to alter column AA to delete on cascade. ALTER TABLE A COLUMN AA ADD CONSTRAINT DELETE ON CASCADE is what I tried with a zillion variations, all reporting syntax errors. \h alter table seems to be missing a

Re: [GENERAL] ALTER TABLE -- how to add ON DELETE CASCADE?

2006-03-07 Thread Tom Lane
[EMAIL PROTECTED] writes: > ALTER TABLE A COLUMN AA ADD CONSTRAINT DELETE ON CASCADE You're missing the specification of the foreign key, not to mention spelling the CASCADE clause backwards. Try ALTER TABLE A ADD FOREIGN KEY(AA) REFERENCES B(BB) ON DELETE CASCADE > \h alter table seems to

Re: [GENERAL] ALTER TABLE -- how to add ON DELETE CASCADE?

2006-03-07 Thread felix
On Tue, Mar 07, 2006 at 05:36:37PM -0500, Tom Lane wrote: > [EMAIL PROTECTED] writes: > > ALTER TABLE A COLUMN AA ADD CONSTRAINT DELETE ON CASCADE > > You're missing the specification of the foreign key, not to mention > spelling the CASCADE clause backwards. Try > > ALTER TABLE A ADD FOREIG

[GENERAL] reindexdb script required in 8.1?

2006-03-07 Thread David Wall
I've upgraded from 8.0 to 8.1 and want to be sure I'm making the changes that are required. For my backups, I have removed the option --blobs because it says this is no longer needed. I guess the backup automatically includes blobs now? I have also been running the contributed 'reindexdb' sc

Re: [GENERAL] Perspective: PostgreSQL usage boon after release of

2006-03-07 Thread Tony Caduto
Ken Johanson wrote: Most of the corp folks I know who have tried using PG to augment or replacement a commercial offering just tend to silently pause and wait for this change.. that why this topic isn't really heard very often. It's like going to a car lot to buy a SUV, but they don't have any

Re: [GENERAL] Perspective: PostgreSQL usage boon after release of

2006-03-07 Thread Ken Johanson
Tony Caduto wrote: Ken Johanson wrote: Most of the corp folks I know who have tried using PG to augment or replacement a commercial offering just tend to silently pause and wait for this change.. that why this topic isn't really heard very often. It's like going to a car lot to buy a SUV, but