Re: [GENERAL] php and postgres - too many queries too fast?

2007-11-06 Thread Richard Huxton
Tom Hart wrote: It turns out that for some reason it didn't like to UPDATE when I was using a text type field (specifically an empty text field) in the WHERE clause. To remedy this, I instructed PHP to not use a field in the WHERE clause if the destination type was 'text', and now we're

Re: [GENERAL] Locale and indexes: howto?

2007-11-06 Thread Reg Me Please
Il Monday 05 November 2007 21:27:27 Reg Me Please ha scritto: HI all. While reading chapter 11 of v8.2 I've encountered this sentence: However, if your server does not use the C locale you will need to create the index with a special operator class to support indexing of pattern-matching

Re: [GENERAL] How to create primary key

2007-11-06 Thread Samantha Atkins
On Nov 6, 2007, at 1:15 AM, Raymond O'Donnell wrote: On 06/11/2007 08:54, Reg Me Please wrote: What'd be the syntax to create a primary key on an already build table? ALTER TABLE test ADD CONSTRAINT test_pk PRIMARY KEY (f1); So, ALTER TABLE test ADD PRMARY KEY(f1 [, ... ] ) isn't

Re: [GENERAL] How to create primary key

2007-11-06 Thread Raymond O'Donnell
On 06/11/2007 08:54, Reg Me Please wrote: What'd be the syntax to create a primary key on an already build table? ALTER TABLE test ADD CONSTRAINT test_pk PRIMARY KEY (f1); http://www.postgresql.org/docs/8.2/static/sql-altertable.html

[GENERAL] How to create primary key

2007-11-06 Thread Reg Me Please
Hi all. What'd be the syntax to create a primary key on an already build table? Thanks. -- Reg me Please ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] How to create primary key

2007-11-06 Thread Magnus Hagander
On Tue, Nov 06, 2007 at 01:38:31AM -0800, Samantha Atkins wrote: On Nov 6, 2007, at 1:15 AM, Raymond O'Donnell wrote: On 06/11/2007 08:54, Reg Me Please wrote: What'd be the syntax to create a primary key on an already build table? ALTER TABLE test ADD CONSTRAINT test_pk PRIMARY KEY

Re: [GENERAL] How to create primary key

2007-11-06 Thread Richard Huxton
Reg Me Please wrote: Hi all. What'd be the syntax to create a primary key on an already build table? Hmm - so you want to sort of alter a table and add a primary key constraint to an existing column? ALTER TABLE my_table ADD PRIMARY CONSTRAINT (existing_column); All in the manuals:

Re: [GENERAL] How to create primary key

2007-11-06 Thread Raymond O'Donnell
On 06/11/2007 09:38, Samantha Atkins wrote: So, ALTER TABLE test ADD PRMARY KEY(f1 [, ... ] ) isn't enough? It appears in the examples. What more does the explicit test_pk do that wouldn't happen anyway? confession To make sure I got it right, I tried it out using PgAdmin and copied the

Re: [GENERAL] How to create primary key

2007-11-06 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/06/07 03:15, Richard Huxton wrote: Reg Me Please wrote: Hi all. What'd be the syntax to create a primary key on an already build table? Hmm - so you want to sort of alter a table and add a primary key constraint to an existing column?

Re: [GENERAL] How to transfer from place to plase without backup/restore

2007-11-06 Thread Hristo Filipov
Man ... well :-), thanks for the answer. At least I'll stop running against the wall. -Original Message- From: Alvaro Herrera [mailto:[EMAIL PROTECTED] Sent: 06 ??? 2007 00:11 To: Hristo Filipov Cc: 'Shane Ambler'; pgsql-general@postgresql.org Subject: Re: [GENERAL] How to transfer

Re: [GENERAL] How to create primary key

2007-11-06 Thread Albe Laurenz
Reg Me Please wrote: What'd be the syntax to create a primary key on an already build table? As described in the documentation: ALTER TABLE name ADD [CONSTRAINT constraint name] PRIMARY KEY (colname [, ...]) [WITH (FILLFACTOR = number)] [USING INDEX TABLESPACE tbsp name] Yours, Laurenz Albe

[GENERAL] generic crosstab

2007-11-06 Thread Toni Casueps
I'm using the PostgreSQL crosstab functions to do something like this: From this table ... ax 10 bx 13 ay 11 by 17 ... I get: xy a10 11 b13 17 To get the second table I have to specify the field list when I call

Re: [GENERAL] How to temporarily disable a table's FK constraints?

2007-11-06 Thread Kynn Jones
On 11/5/07, andy [EMAIL PROTECTED] wrote: Hey, I was just thinking about this... instead of disabling the FK's, what about adding a temp table where you could COPY into, then fire off a bunch of update's to setup the id fields, etc, etc, then do an Insert into realtable select * from

Re: [GENERAL] generic crosstab

2007-11-06 Thread Reg Me Please
I was having the same problem. I defined a crosstab definition table where I declare the things I want out of crosstab and then I dynamically build views that will add the needed AS ct42( ). Maybe someone else can suggest a better solution ... Il Tuesday 06 November 2007 13:46:06 Toni

Re: [GENERAL] How to create primary key

2007-11-06 Thread Richard Huxton
Albe Laurenz wrote: Richard Huxton wrote: What'd be the syntax to create a primary key on an already build table? ALTER TABLE my_table ADD PRIMARY CONSTRAINT (existing_column); I'm sure it's just a typo, but that is wrong. It is not ADD PRIMARY CONSTRAINT, but ADD PRIMARY KEY. It is indeed

[GENERAL] Postgresql simple query performance question

2007-11-06 Thread SHARMILA JOTHIRAJAH
Hi We are in the process of testing for migration of our database from Oracle to Postgresql. I hava a simple query Select count(*) from foo This table has 29384048 rows and is indexed on foo_id The tables are vacuumed and the explain plan for postgresql is QUERY PLAN

Re: [GENERAL] How to create primary key

2007-11-06 Thread Albe Laurenz
Richard Huxton wrote: What'd be the syntax to create a primary key on an already build table? ALTER TABLE my_table ADD PRIMARY CONSTRAINT (existing_column); I'm sure it's just a typo, but that is wrong. It is not ADD PRIMARY CONSTRAINT, but ADD PRIMARY KEY. Yours, Laurenz Albe

Re: [GENERAL] Postgresql simple query performance question

2007-11-06 Thread Reg Me Please
I have no doubt you're right, Pavel. But why not? It could be a simple enhacement. Il Tuesday 06 November 2007 15:11:02 Pavel Stehule ha scritto: Hello PostgreSQL doesn't use index for COUN(*) http://www.varlena.com/GeneralBits/18.php

Re: [GENERAL] Postgresql simple query performance question

2007-11-06 Thread Pavel Stehule
Hello PostgreSQL doesn't use index for COUN(*) http://www.varlena.com/GeneralBits/18.php http://sql-info.de/en/postgresql/postgres-gotchas.html#1_7 Regards Pavel Stehule On 06/11/2007, SHARMILA JOTHIRAJAH [EMAIL PROTECTED] wrote: Hi We are in the process of testing for migration of our

Re: [GENERAL] generic crosstab

2007-11-06 Thread Pavel Stehule
On 06/11/2007, Toni Casueps [EMAIL PROTECTED] wrote: I'm using the PostgreSQL crosstab functions to do something like this: From this table ... ax 10 bx 13 ay 11 by 17 ... I get: xy a10 11 b13 17 To

Re: [GENERAL] Number to Words Conversion

2007-11-06 Thread Yogesh Arora
Hi, As i am Working for Decimal Formats. is there any method to do it in the same way. On 11/2/07, Moiz Kothari [EMAIL PROTECTED] wrote: Hi, You can use what bruce has suggested and get the value you want. eg. select trim(substring(cash_words('1520'), 1, position('dollars' in

Re: [GENERAL] Postgresql simple query performance question

2007-11-06 Thread Bill Moran
In response to SHARMILA JOTHIRAJAH [EMAIL PROTECTED]: Hi We are in the process of testing for migration of our database from Oracle to Postgresql. I hava a simple query Select count(*) from foo This is asked a lot. The quick answer is that PostgreSQL method of MVCC makes it impossible

Re: [GENERAL] young guy wanting (Postgres DBA) ammo

2007-11-06 Thread Lew
Scott Marlowe wrote: PostgreSQL is ... still not in the same realm for really really big transactional sites, but man is it geting close fast. I beg to differ. All anecdotal evidence, and also Sun benchmarks with Postgres, show that it is not only in the same realm but can actually come

Re: [GENERAL] Populating large DB from Perl script

2007-11-06 Thread Andy
Kynn Jones wrote: I have large database that needs to be built from scratch roughly once every month. I use a Perl script to do this. The tables are very large, so I avoid as much as possible using in-memory data structures, and instead I rely heavily on temporary flat files. I have solved

Re: [GENERAL] Copy the database..

2007-11-06 Thread Sascha Bohnenkamp
if you dump/undump using a pipe there is no temp file ... Abandoned schrieb: On Nov 2, 3:49 pm, Sascha Bohnenkamp [EMAIL PROTECTED] wrote: maybe pg_dump | pg_undump could work? I mean pg_dump with the appropriate parameters and undump directly to the other database? This may one of the

Re: [GENERAL] Copy the database..

2007-11-06 Thread Sascha Bohnenkamp
maybe pg_dump | pg_undump could work? I mean pg_dump with the appropriate parameters and undump directly to the other database? This may one of the fastest ways to do it I think. Abandoned schrieb: Hi.. I want to copy my database.. I have a database which is name db01 and i want to copy it

[GENERAL] Copy the database..

2007-11-06 Thread Abandoned
Hi.. I want to copy my database.. I have a database which is name db01 and i want to copy it as name db01copy ? How can i do this ? This database is very big 200GB so i want to the fastest way. Also if you suggest pg_dump how can i remove the dump data after copying ? Note: I have a root account

Re: [GENERAL] Copy the database..

2007-11-06 Thread Abandoned
On Nov 2, 3:49 pm, Sascha Bohnenkamp [EMAIL PROTECTED] wrote: maybe pg_dump | pg_undump could work? I mean pg_dump with the appropriate parameters and undump directly to the other database? This may one of the fastest ways to do it I think. Abandoned schrieb: Hi.. I want to copy my

Re: [GENERAL] Copy the database..

2007-11-06 Thread Abandoned
On Nov 2, 5:30 pm, Sascha Bohnenkamp [EMAIL PROTECTED] wrote: if you dump/undump using a pipe there is no temp file ... Abandoned schrieb: On Nov 2, 3:49 pm, Sascha Bohnenkamp [EMAIL PROTECTED] wrote: maybe pg_dump | pg_undump could work? I mean pg_dump with the appropriate parameters

Re: [GENERAL] Postgresql simple query performance question

2007-11-06 Thread Reg Me Please
While I would not spend resources in fine tuning the count(*), I would spend some to underastand why and how the other ones do it better. Just to be better. Il Tuesday 06 November 2007 15:29:34 Bill Moran ha scritto: In response to Reg Me Please [EMAIL PROTECTED]: I have no doubt you're

Re: [GENERAL] Postgresql simple query performance question

2007-11-06 Thread SHARMILA JOTHIRAJAH
I understand that. But why is that when oracle is given a hint to do full table scan instead of using index to get the count, it is still faster than postgres when both has the same explain plan? Oracle takes 34 sec and postgres takes 1 m10 sec . Is there anything that can be done in postgresql

Re: [GENERAL] Postgresql simple query performance question

2007-11-06 Thread Bill Moran
In response to Reg Me Please [EMAIL PROTECTED]: I have no doubt you're right, Pavel. But why not? It could be a simple enhacement. It's not simple. Do some searches on the mailing lists and you will find discussion of why it's difficult to do. Il Tuesday 06 November 2007 15:11:02 Pavel

[GENERAL] RPATH issue with libpq on Solaris 8 (gcc)

2007-11-06 Thread Jason Testart
I'm interested in some guidance on how to best deal with the following issue. I'm building postgres-8.2.5 on Solaris 8 SPARC, using a gcc built (not by me) for our environment. We have an old home-grown software distribution/configuration management system that arranges shared-objects and

Re: [GENERAL] what could be blocking an insertion?

2007-11-06 Thread Sascha Bohnenkamp
There were other JDBC clients but they never lock any tables. They all used transactions with the serializable isolation level. If you have concurrent access and some isolation you have locking. If two inserts/updates try to change the same data (even via triggers/rules) you get a failed

[GENERAL] Problem starting the server with Mac OSX

2007-11-06 Thread Myshkin LeVine
Hi, I have a problem starting the server on Mac OSX 10.3.9. I compiled v8.2.5 from source. The compilation, regression testing, and installation all went smoothly with no errors. I installed PostgreSQL in the default location and created a new user account named postgres. I ran initdb which

[GENERAL] Npsql is much faster than ODBC ?

2007-11-06 Thread 一首诗
Hi all, Recently I found my C/S program becomes slow. So I analysed the tcp traffic between my program and the Postgresql database. I found there are occasionally tcp re-transmission and that's why my porgram slow down. But when I changed to npsql, the tcp traffic was cut off to only 1/4 and

[GENERAL] Selecting all but a few fields in a query

2007-11-06 Thread thefronny
I have a table with a lot of fields, some of which are type TEXT. I seem to have a lot of occasions where I'd like to see almost all of the fields in a query but a SELECT * will pull in the text fields, which then wrap across the screen, even using \x. Is there a variation of SELECT that is

Re: [GENERAL] What makes a Postgres DBA?

2007-11-06 Thread Lew
Kevin Hunter wrote: what do I need to able to do to be able to honestly say that 'I am a Postgres DBA' on my resume Greg Smith wrote: Organizing things as above, this turns into a somewhat fuzzy question about how much of the grid one has to cover before achieving that goal. Consider this;

[GENERAL]

2007-11-06 Thread Erin Millard
I am facing a difficult problem with setting up a rule. The rule is essentially designed to allow updates to a view made up of data from two tables. Here is a simplified example to reproduce the problem: -- -- clear the table and view -- DROP VIEW IF EXISTS full_view; DROP TABLE IF EXISTS

Re: [GENERAL] posgresql-8.2 startup problem

2007-11-06 Thread novice
Thanks Tom! I already solved the problem by putting 127.0.0.1 localhost in /etc/hosts file.. On Nov 2, 12:04 am, [EMAIL PROTECTED] (Tom Lane) wrote: novice [EMAIL PROTECTED] writes: I just installed postgres-8.2 using the command line apt-get install postgres-8.2 and it seems the

Re: [GENERAL] any way for ORDER BY x to imply NULLS FIRST in 8.3?

2007-11-06 Thread Tom Lane
rihad [EMAIL PROTECTED] writes: Is there any way to hardcode the NULL handling in an index (as per http://www.postgresql.org/docs/8.3/static/indexes-ordering.html) so that SELECT * FROM t ORDER BY foo automatically implies NULLS FIRST (and, similarly so that SELECT * FROM t ORDER BY foo

Re: [GENERAL] Selecting all but a few fields in a query

2007-11-06 Thread Scott Marlowe
On 11/5/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I have a table with a lot of fields, some of which are type TEXT. I seem to have a lot of occasions where I'd like to see almost all of the fields in a query but a SELECT * will pull in the text fields, which then wrap across the screen,

Re: [GENERAL] young guy wanting (Postgres DBA) ammo

2007-11-06 Thread Scott Marlowe
On 11/2/07, Lew [EMAIL PROTECTED] wrote: Scott Marlowe wrote: PostgreSQL is ... still not in the same realm for really really big transactional sites, but man is it geting close fast. I beg to differ. All anecdotal evidence, and also Sun benchmarks with Postgres, show that it is not

Re: [GENERAL] Copy the database..

2007-11-06 Thread Martijn van Oosterhout
On Sat, Nov 03, 2007 at 01:42:09PM -, Abandoned wrote: I tryed pg_dump but it is very slowly. Are there any faster way to copy database? Have you tried CREATE DATABASE .. TEMPLATE ? (See amual for syntax) Have a nice day, -- Martijn van Oosterhout [EMAIL PROTECTED]

Re: [GENERAL] (Never?) Kill Postmaster?

2007-11-06 Thread Christian Schröder
Tom Lane wrote: What we can be reasonably certain of is that that backend wasn't reaching any CHECK_FOR_INTERRUPTS() macros. Whether it was hung up waiting for something, or caught in a tight loop somewhere, is impossible to say without more data than we have. AFAIR the OP didn't even mention

Re: [GENERAL] Copy the database..

2007-11-06 Thread Scott Marlowe
On 11/3/07, Abandoned [EMAIL PROTECTED] wrote: I tryed pg_dump but it is very slowly. Are there any faster way to copy database? Assuming it's all happening on the same db server, yes: psql template1 create database newdb template olddb ---(end of

[GENERAL] How to find non-unique indexes in system tables

2007-11-06 Thread Eric Johnson
I can find all the check constraints, primary keys and foreign keys in the information schema, but I cannot find the non-unique indexes. Is there anyplace to get that information (name, columns, etc)? Sorry if this is an FAQ. I couldn't find it with Google. -- Eric Johnson Where your pleasure

Re: [GENERAL] Postgresql simple query performance question

2007-11-06 Thread Richard Huxton
Reg Me Please wrote: While I would not spend resources in fine tuning the count(*), I would spend some to underastand why and how the other ones do it better. Just to be better. The problem is well understood, and there is extensive discussion in the mailing lists archives. The basic problem

[GENERAL] How does the query planner make its plan?

2007-11-06 Thread Christian Schröder
Hi list, once again I do not understand how the query planner works and why it apparently does not find the best result. I have a table with about 125 million rows. There is a char(5) column with a (non-unique) index. When I try to find the distinct values in this column using the following

Re: [GENERAL] (Never?) Kill Postmaster?

2007-11-06 Thread Tom Lane
=?ISO-8859-1?Q?Christian_Schr=F6der?= [EMAIL PROTECTED] writes: db2:/home/pgsql/data # gdb --pid=7129 GNU gdb 6.5 Copyright (C) 2006 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it

Re: [GENERAL] Npsql is much faster than ODBC ?

2007-11-06 Thread Ilan Volow
I've never used Npsql and I'm not a C# developer (so take this response with more than a few grains of salt) but from what I remember reading somewhere, Npsql implements postgres protocols natively, with the protocol handling done directly in C# and getting the raw data without going

Re: [GENERAL] How does the query planner make its plan?

2007-11-06 Thread Scott Marlowe
On 11/6/07, Christian Schröder [EMAIL PROTECTED] wrote: Hi list, once again I do not understand how the query planner works and why it apparently does not find the best result. I have a table with about 125 million rows. There is a char(5) column with a (non-unique) index. When I try to find

Re: [GENERAL] How does the query planner make its plan?

2007-11-06 Thread Reg Me Please
It may depend on the index itself against the locales. 1. define the insex with the text_pattern_ops operato class 2. run vacuum analyze on the table 3. re-run the explain See chapter 11 (especiallu 11.8) for v8.2 Il Tuesday 06 November 2007 16:25:09 Christian Schröder ha scritto: Hi list,

Re: [GENERAL] external editor for psql

2007-11-06 Thread Reg Me Please
Il Tuesday 06 November 2007 16:40:27 John Smith ha scritto: http://www.nabble.com/need-good-editor-for-postgreSQL-tf3660882.html#a10229 560 how do u get gvim (portable?) to do syntax color highlighting for sql/plpgsql on files in buffer?? you're right- notepad is not enough (and pgedit is not

[GENERAL] external editor for psql

2007-11-06 Thread John Smith
http://www.nabble.com/need-good-editor-for-postgreSQL-tf3660882.html#a10229560 how do u get gvim (portable?) to do syntax color highlighting for sql/plpgsql on files in buffer?? you're right- notepad is not enough (and pgedit is not free). cheers, jzs ---(end of

Re: [GENERAL] Postgresql simple query performance question

2007-11-06 Thread Gokulakannan Somasundaram
Hi, Oracle, eventhough is a timestamp based database, stores only one version for each row in the table and the rest of the versions of the same-row(which might have got created due to updates) in a separate place called undo log. In postgres, all the versions are stored in the table. So the

Re: [GENERAL] external editor for psql

2007-11-06 Thread Scott Marlowe
On 11/6/07, John Smith [EMAIL PROTECTED] wrote: http://www.nabble.com/need-good-editor-for-postgreSQL-tf3660882.html#a10229560 how do u get gvim (portable?) to do syntax color highlighting for sql/plpgsql on files in buffer?? you're right- notepad is not enough (and pgedit is not free).

Re: [GENERAL] How to find non-unique indexes in system tables

2007-11-06 Thread Tom Lane
Eric Johnson [EMAIL PROTECTED] writes: I can find all the check constraints, primary keys and foreign keys in the information schema, but I cannot find the non-unique indexes. Is there anyplace to get that information (name, columns, etc)? Not from the information_schema, because index is

[GENERAL] ORDER BY a string

2007-11-06 Thread phazon
Hi, I've to order by q query by a column. SELECT a.id, a.nom FROM table a ORDER BY a.nom; And i've something strange. It's order like that: 5 | 8 | aaab 15 | ** aaac 6 | aaad I've ** before the name in order to display them at first, but the 2 chars ** are ignored in the order by.

Re: [GENERAL] Selecting all but a few fields in a query

2007-11-06 Thread brian
[EMAIL PROTECTED] wrote: I have a table with a lot of fields, some of which are type TEXT. I seem to have a lot of occasions where I'd like to see almost all of the fields in a query but a SELECT * will pull in the text fields, which then wrap across the screen, even using \x. Is there a

Re: [GENERAL] ORDER BY a string

2007-11-06 Thread Tom Lane
phazon [EMAIL PROTECTED] writes: I've ** before the name in order to display them at first, but the 2 chars ** are ignored in the order by. What's your lc_collate setting? In locales other than C this is not at all unexpected. regards, tom lane

Re: [GENERAL] Postgresql simple query performance question

2007-11-06 Thread André Volpato
Richard Huxton escreveu: Reg Me Please wrote: While I would not spend resources in fine tuning the count(*), I would spend some to underastand why and how the other ones do it better. Just to be better. The problem is well understood, and there is extensive discussion in the mailing lists

Re: [GENERAL] Postgresql simple query performance question

2007-11-06 Thread Bill Moran
In response to André Volpato [EMAIL PROTECTED]: Richard Huxton escreveu: Reg Me Please wrote: While I would not spend resources in fine tuning the count(*), I would spend some to underastand why and how the other ones do it better. Just to be better. The problem is well understood,

Re: [GENERAL] (Never?) Kill Postmaster?

2007-11-06 Thread Christian Schröder
Tom Lane wrote: * The only place internal_flush would call errmsg is here: ereport(COMMERROR, (errcode_for_socket_access(), errmsg(could not send data to client: %m))); So why is it unable to send data to the client? The user

[GENERAL] Syntax error in a large COPY

2007-11-06 Thread Reg Me Please
Hi all. I'm generating an SQL script to load some million rows into a table. I'm trying to use the COPY command in order to speed the load up. At a certain point I get an error telling about a invalid input syntax for type numeric The incriminated line number is the last one (the one containing

Re: [GENERAL] Syntax error in a large COPY

2007-11-06 Thread Tom Lane
Reg Me Please [EMAIL PROTECTED] writes: At a certain point I get an error telling about a invalid input syntax for type numeric The incriminated line number is the last one (the one containing the \.). Is there a way to know which line is really malformed? Why do you think the report is

[GENERAL] Exclusive Locks Taken on User Tables?

2007-11-06 Thread Marc
Hi, I'm seeing an EXCLUSIVE lock being taken on a table even though the documentation says that This lock mode is not automatically acquired on user tables by any PostgreSQL command. My SQL is UPDATE users SET online = $1 where username = $2 username is the PK on the users table. Other locks

Re: [GENERAL] Syntax error in a large COPY

2007-11-06 Thread Scott Marlowe
On 11/6/07, Reg Me Please [EMAIL PROTECTED] wrote: That seems not to be the case. The last line has a \. by its own and the last but one is well formed. (Please don't top post...) Got a self contained test case you can post? ---(end of

Re: [GENERAL] Syntax error in a large COPY

2007-11-06 Thread Reg Me Please
That seems not to be the case. The last line has a \. by its own and the last but one is well formed. Il Tuesday 06 November 2007 19:14:00 Tom Lane ha scritto: Reg Me Please [EMAIL PROTECTED] writes: At a certain point I get an error telling about a invalid input syntax for type numeric

Re: [GENERAL] Syntax error in a large COPY

2007-11-06 Thread Collin Kidder
This is offtopic but there is nothing wrong with top posting. Is there a mail list policy on it or are you just picky about it? Scott Marlowe wrote: On 11/6/07, Reg Me Please [EMAIL PROTECTED] wrote: That seems not to be the case. The last line has a \. by its own and the last but one is

Re: [GENERAL] Syntax error in a large COPY

2007-11-06 Thread Scott Marlowe
A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail? On Nov 6, 2007 1:16 PM, Collin Kidder [EMAIL PROTECTED] wrote: This is offtopic but there is nothing wrong with top posting.

Re: [GENERAL] Exclusive Locks Taken on User Tables?

2007-11-06 Thread Richard Huxton
Marc wrote: Hi, I'm seeing an EXCLUSIVE lock being taken on a table even though the documentation says that This lock mode is not automatically acquired on user tables by any PostgreSQL command. Hmm - are you sure? My SQL is UPDATE users SET online = $1 where username = $2 username is the

Re: [GENERAL] Exclusive Locks Taken on User Tables?

2007-11-06 Thread Marc
This is the query that I'm running to view locks: SELECT pg_class.relname AS table, pg_database.datname AS database, transaction, pid, mode, granted FROM pg_locks, pg_class, pg_database WHERE pg_locks.relation = pg_class.oid AND pg_locks.database = pg_database.oid ORDER BY

Re: [GENERAL] Syntax error in a large COPY

2007-11-06 Thread Scott Marlowe
On Nov 6, 2007 1:16 PM, Collin Kidder [EMAIL PROTECTED] wrote: This is offtopic but there is nothing wrong with top posting. Is there a mail list policy on it or are you just picky about it? OK, I was being a bit flippant with my last response. The reasoning on technical mailing lists for

Re: [GENERAL] Exclusive Locks Taken on User Tables?

2007-11-06 Thread Tom Lane
Marc [EMAIL PROTECTED] writes: This is the query that I'm running to view locks: SELECT pg_class.relname AS table, pg_database.datname AS database, transaction, pid, mode, granted FROM pg_locks, pg_class, pg_database WHERE pg_locks.relation = pg_class.oid AND

Re: [GENERAL] Syntax error in a large COPY

2007-11-06 Thread Tom Lane
Scott Marlowe [EMAIL PROTECTED] writes: But the other reason is that top posters are often the biggest offenders of not editing their replies. there's nothing like seeing a one line reply to a 500 line conversation. When inline posting, one can delete the parts of the converstation that they

[GENERAL] Exclusive Locks Taken on User Tables?

2007-11-06 Thread Marc
Version of postgres is 8.2.4. Maybe it will help to give more b/g on how I'm identifying the problem? The way this materializes as a real issue surrounds transactions left idle. There is a bug in our app that we haven't tracked down yet where on occasion we end up with connections marked IDLE in

Re: [GENERAL] Exclusive Locks Taken on User Tables?

2007-11-06 Thread Tom Lane
Marc [EMAIL PROTECTED] writes: Version of postgres is 8.2.4. ... second report that I always see that UPDATE statement and in the list of locks I see ExclusiveLock granted on the users table for one of the running pids but not the others. Well, if it's not a foreign key issue then I think

Re: [GENERAL] Npsql is much faster than ODBC ?

2007-11-06 Thread Alvaro Herrera
? wrote: Hi all, Recently I found my C/S program becomes slow. So I analysed the tcp traffic between my program and the Postgresql database. I found there are occasionally tcp re-transmission and that's why my porgram slow down. But when I changed to npsql, the tcp traffic was

Re: [GENERAL] subversion support?

2007-11-06 Thread Tim Goodaire
Robert, I'd like to have a copy of your script if you're willing to share. We're currently working on schema control stuff, and your script may be useful. On Wed, Oct 24, 2007 at 11:23:39PM -0400, Robert Treat wrote: On Wednesday 24 October 2007 15:11, Roberts, Jon wrote: Yeah. I think

Re: [GENERAL] subversion support?

2007-11-06 Thread Erik Jones
On Nov 6, 2007, at 3:43 PM, Tim Goodaire wrote: Robert, I'd like to have a copy of your script if you're willing to share. We're currently working on schema control stuff, and your script may be useful. On Wed, Oct 24, 2007 at 11:23:39PM -0400, Robert Treat wrote: On Wednesday 24

Re: [GENERAL] Syntax error in a large COPY

2007-11-06 Thread Tom Lane
Reg Me Please [EMAIL PROTECTED] writes: I'm trying to understand what and where. The point is that I have this 29M+ lines script telling me there's a problem somewhere. It told you exactly where it detected the problem. Actually ... are you looking at the right error message? If this is a

Re: [GENERAL] Syntax error in a large COPY

2007-11-06 Thread Scott Marlowe
On 11/6/07, Reg Me Please [EMAIL PROTECTED] wrote: Il Tuesday 06 November 2007 22:13:15 hai scritto: On 11/6/07, Reg Me Please [EMAIL PROTECTED] wrote: Il Tuesday 06 November 2007 19:43:38 Scott Marlowe ha scritto: On 11/6/07, Reg Me Please [EMAIL PROTECTED] wrote: That seems not to

Re: [GENERAL] Syntax error in a large COPY

2007-11-06 Thread Reg Me Please
Il Tuesday 06 November 2007 22:13:15 hai scritto: On 11/6/07, Reg Me Please [EMAIL PROTECTED] wrote: Il Tuesday 06 November 2007 19:43:38 Scott Marlowe ha scritto: On 11/6/07, Reg Me Please [EMAIL PROTECTED] wrote: That seems not to be the case. The last line has a \. by its own and

Re: [GENERAL] Syntax error in a large COPY

2007-11-06 Thread Scott Marlowe
On 11/6/07, Reg Me Please [EMAIL PROTECTED] wrote: Il Tuesday 06 November 2007 19:43:38 Scott Marlowe ha scritto: On 11/6/07, Reg Me Please [EMAIL PROTECTED] wrote: That seems not to be the case. The last line has a \. by its own and the last but one is well formed. (Please don't

Re: [GENERAL] Syntax error in a large COPY

2007-11-06 Thread Reg Me Please
Il Tuesday 06 November 2007 19:43:38 Scott Marlowe ha scritto: On 11/6/07, Reg Me Please [EMAIL PROTECTED] wrote: That seems not to be the case. The last line has a \. by its own and the last but one is well formed. (Please don't top post...) Got a self contained test case you can post?

Re: [GENERAL] Exclusive Locks Taken on User Tables?

2007-11-06 Thread Tom Lane
Marc [EMAIL PROTECTED] writes: My original reason for reaching out to the list was over confusion as to when an EXCLUSIVE lock would be taken table level since the documentation says this should never happen except to some system catalogs. Is there something missing from the documentation?

Re: [GENERAL] Exclusive Locks Taken on User Tables?

2007-11-06 Thread Marc
Ok. I'll keep looking at pg_locks. My original reason for reaching out to the list was over confusion as to when an EXCLUSIVE lock would be taken table level since the documentation says this should never happen except to some system catalogs. Is there something missing from the documentation?

Re: [GENERAL] Npsql is much faster than ODBC ?

2007-11-06 Thread Rainer Bauer
Alvaro Herrera wrote: FYI there's another Postgres ODBC driver that is said to have better performance. https://projects.commandprompt.com/public/odbcng (Yes, my company maintains it) psqlodbc is licenced under LGPL, but ODBCng uses the GPL. That means that commercial software cannot use the

Re: [GENERAL] Syntax error in a large COPY

2007-11-06 Thread Reg Me Please
Il Tuesday 06 November 2007 22:37:12 Scott Marlowe ha scritto: On 11/6/07, Reg Me Please [EMAIL PROTECTED] wrote: Il Tuesday 06 November 2007 22:13:15 hai scritto: On 11/6/07, Reg Me Please [EMAIL PROTECTED] wrote: Il Tuesday 06 November 2007 19:43:38 Scott Marlowe ha scritto: On

Re: [GENERAL] Syntax error in a large COPY

2007-11-06 Thread Thomas Kellerer
Tom Lane wrote on 06.11.2007 21:21: The real point here is that when writing to a mailing list, you should make an effort to conserve other peoples' time. Hundreds of people are going to read what you wrote, possibly thousands when you count in people searching the list archives in the future.

Re: [GENERAL] Syntax error in a large COPY

2007-11-06 Thread Dimitri Fontaine
Hi, Le Tuesday 06 November 2007 22:40:50 Tom Lane, vous avez écrit : Reg Me Please [EMAIL PROTECTED] writes: I'm trying to understand what and where. The point is that I have this 29M+ lines script telling me there's a problem somewhere. You could use pgloader, which reads CSV input (or

Re: [GENERAL] (Never?) Kill Postmaster?

2007-11-06 Thread Alvaro Herrera
Christian Schröder wrote: Since ps -Lw only showed me my own processes, I did ps -AT -o pid,ppid,lwp,nlwp,command instead. This is the relevant line: PID PPID LWP NLWP COMMAND ... 7129 3934 71291 postgres: dpyrek uspi 88.70.241.205(10612) SELECT ... I'm not sure if this data

Re: [GENERAL] Syntax error in a large COPY

2007-11-06 Thread Alvaro Herrera
Reg Me Please wrote: Il Tuesday 06 November 2007 22:13:15 hai scritto: Split it in half, with the appropriate sql on each end so the data still works, and see which half causes a problem. Keep splitting the one that causes a problem in half until you have a small one with the problem

Re: [GENERAL] Postgresql simple query performance question

2007-11-06 Thread Gregory Stark
SHARMILA JOTHIRAJAH [EMAIL PROTECTED] writes: I understand that. But why is that when oracle is given a hint to do full table scan instead of using index to get the count, it is still faster than postgres when both has the same explain plan? Oracle takes 34 sec and postgres takes 1 m10 sec .

Re: [GENERAL] Npsql is much faster than ODBC ?

2007-11-06 Thread Joshua D. Drake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Tue, 06 Nov 2007 22:03:52 +0100 Rainer Bauer [EMAIL PROTECTED] wrote: Alvaro Herrera wrote: FYI there's another Postgres ODBC driver that is said to have better performance. https://projects.commandprompt.com/public/odbcng (Yes, my

Re: [GENERAL] Npsql is much faster than ODBC ?

2007-11-06 Thread Rainer Bauer
Joshua D. Drake wrote: psqlodbc is licenced under LGPL, but ODBCng uses the GPL. That means that commercial software cannot use the ODBCng driver. Are there any plans to release it under LGPL licence? The only time this would be an issue is if you tried to embed the driver. Other than that,

Re: [GENERAL] Npsql is much faster than ODBC ?

2007-11-06 Thread Joshua D. Drake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Wed, 07 Nov 2007 02:40:08 +0100 Rainer Bauer [EMAIL PROTECTED] wrote: That's nice to hear. But I respect licences as they are and the ODBCng driver is licenced under the GPL. So is this an _official_ statement from CommandPrompt that the

Re: [GENERAL] Npsql is much faster than ODBC ?

2007-11-06 Thread Andrej Ricnik-Bay
On Nov 7, 2007 2:40 PM, Rainer Bauer [EMAIL PROTECTED] wrote: That's nice to hear. But I respect licences as they are and the ODBCng driver is licenced under the GPL. That doesn't mean that you're not allowed to use it with commercial applications; it just means that you need to be happy to

[GENERAL] returning dynamic record

2007-11-06 Thread nick
Just wondering, if it is possible to do the following create function foo() RETURNS Record(int, varchar, int) then inside of the function return a set int, varchar, int. Then be able to call the function select * From foo() instead of having to write select * from foo() as (int, varchar,

  1   2   >