[GENERAL] SSL connection option from client side?

2010-02-03 Thread dipti shah
I got the information about how to set server configuration to make SSL aware only from http://www.postgresql.org/docs/8.4/static/ssl-tcp.html. Please see below and let me know if I am missing anything. 1. I need to switch on "ssl" attribute in postgresql.conf and compile the server again. 2

Re: [GENERAL] Shall I apply normalization in the following case?

2010-02-03 Thread Sim Zacks
> For example, for the following table, > > > measurement (without normalization) > === > id | value | measurement_unit | measurement_type > > 1 0.23 mmwidth > 2 0.38 mmwidth > 2 0.72

Re: [GENERAL] Is it necessary to have index for child table in following case?

2010-02-03 Thread Joe Conway
On 02/03/2010 06:59 PM, Yan Cheng Cheok wrote: > PQexec(Database::instance().getConnection(), "copy unit_1 from > stdin"); // | serial | int | int /* But I just do not want to put > as serial. I want it to be auto-increment. However, I have no > idea how to make serial auto-increment, without

Re: [GENERAL] Is it necessary to have index for child table in following case?

2010-02-03 Thread Yan Cheng Cheok
Sorry. I do read your previous post.However, I ignore and soon forget quite a while, as I do not how to use it with the column contains serial PQexec(Database::instance().getConnection(), "copy unit_1 from stdin"); // | serial | int | int /* But I just do not want to put as seri

Re: [GENERAL] Why lots of temp schemas are being created

2010-02-03 Thread Tom Lane
Alvaro Herrera writes: > Temp schemas are not destroyed on session shutdown; they are rather > destroyed the next time the backend ID is reused. Normally that's not a > problem, because a backend ID is reused pretty soon. It's only a > problem when you use so high a backend ID due to high load,

Re: [GENERAL] Shall I apply normalization in the following case?

2010-02-03 Thread Jorge Godoy
You can always normalize and not use an artificial key. You'd end up with: measurement (normalization) === id | value | measurement_unit_id | measurement_type_id -- > 1 0.23 mmwidth > 2 0.38 mm

Re: [GENERAL] varchar(n) and text

2010-02-03 Thread Bruce Momjian
Yan Cheng Cheok wrote: > According to > http://www.postgresql.org/docs/8.0/interactive/datatype-character.html > > I always use TEXT, for column which store text so that I need not to worry on > text length. > > However, in certain situation, I know that my text length will always < 10 > chara

[GENERAL] varchar(n) and text

2010-02-03 Thread Yan Cheng Cheok
According to http://www.postgresql.org/docs/8.0/interactive/datatype-character.html I always use TEXT, for column which store text so that I need not to worry on text length. However, in certain situation, I know that my text length will always < 10 characters I was wondering, if I using TEXT

[GENERAL] Shall I apply normalization in the following case?

2010-02-03 Thread Yan Cheng Cheok
For example, for the following table, measurement (without normalization) === id | value | measurement_unit | measurement_type 1 0.23 mmwidth 2 0.38 mmwidth 2 0.72 mm

Re: [GENERAL] Is it necessary to have index for child table in following case?

2010-02-03 Thread Joe Conway
On 02/03/2010 05:02 PM, Yan Cheng Cheok wrote: >> >> Are you using INSERT or COPY to insert your data? COPY tends to be >> a lot faster than separate INSERTs, especially if you don't wrap >> the INSERTs in a transaction block and COMMIT them in batches. > > But I do not use File or Stdio. The dat

Re: [GENERAL] Need to Remove Constraint, but Don't Know How - Previous attempts failed

2010-02-03 Thread John R Pierce
Wang, Mary Y wrote: Hi, I'm sorry but I didn't create the table. I fiddled with the table for a while and didn't get what I expected. So I'm going to ask the community. Can some one tell me which constraint would case me the "duplicate key into unique index users_pkey"? I'd like to remove

Re: [GENERAL] Need to Remove Constraint, but Don't Know How - Previous attempts failed

2010-02-03 Thread Adrian Klaver
On Wednesday 03 February 2010 4:57:09 pm Wang, Mary Y wrote: > Hi, > > I'm sorry but I didn't create the table. I fiddled with the table for a > while and didn't get what I expected. So I'm going to ask the community. > > Can some one tell me which constraint would case me the "duplicate key into

Re: [GENERAL] Is it necessary to have index for child table in following case?

2010-02-03 Thread Yan Cheng Cheok
> > Are you using INSERT or COPY to insert your data? COPY > tends to be a lot faster than separate INSERTs, especially > if you don't wrap the INSERTs in a transaction block and > COMMIT them in batches. > But I do not use File or Stdio. The data is coming in row by row real-time. I need to in

[GENERAL] Need to Remove Constraint, but Don't Know How - Previous attempts failed

2010-02-03 Thread Wang, Mary Y
Hi, I'm sorry but I didn't create the table. I fiddled with the table for a while and didn't get what I expected. So I'm going to ask the community. Can some one tell me which constraint would case me the "duplicate key into unique index users_pkey"? I'd like to remove that constraint. Here

Re: [GENERAL] Why lots of temp schemas are being created

2010-02-03 Thread Walter Coole
Thanks for the pointer! In case anyone else has the same problem, here's what I did: I used SELECT MAX(backendid) FROM (SELECT pg_stat_get_backend_idset() AS backendid) AS s; to get the highest backend ID that is running. I deleted all the pg*_temp_ schemas numbers higher than that. This di

Re: [GENERAL] Why lots of temp schemas are being created

2010-02-03 Thread Alvaro Herrera
Walter Coole escribió: > This didn't seem quite thorough enough, as I found that when a process > would end (MAX(backendid) went down), the corresponding pg*_temp_ > schema would not go away. I think these were schemas created by a > previous backend, so would not be cleaned up by a backend that

Re: [GENERAL] Why lots of temp schemas are being created

2010-02-03 Thread Tom Lane
Walter Coole writes: > I've gotten a lot of similar schemas, like: > CREATE SCHEMA pg_toast_temp_1 > AUTHORIZATION postgres; These schemas are automatically created to hold temporary tables. There is not a lot of point in removing them, because they'll just reappear next time you have a lot of

Re: [GENERAL] Why lots of temp schemas are being created

2010-02-03 Thread Alvaro Herrera
Walter Coole escribió: > I would like to drop them, since there are so many of them, they make > it tedious to look through my databases in pgAdmin. Is there a > reliable way to distinguish between temp schemas that exist because > they are supposed to be there and those that are not? Run pg_get

Re: [GENERAL] Why lots of temp schemas are being created

2010-02-03 Thread Walter Coole
I've gotten a lot of similar schemas, like: CREATE SCHEMA pg_toast_temp_1 AUTHORIZATION postgres; and CREATE SCHEMA pg_temp_1 AUTHORIZATION postgres; I don't see anything of substance inside those schemas, like tables or sequences, so I THINK they are the legacy of some previous problem (O

Re: [GENERAL] PQendcopy:resetting connection Problem and Cannot insert a duplicate key into unique index

2010-02-03 Thread Tom Lane
"Wang, Mary Y" writes: > What would be the newer version of pgsql (I mean a bit higher version of my > current version) that provides that capability of telling me what the > duplicated key was ? Hmm ... [ experiments... ] For the specific case of COPY into a table with a pre-existing unique i

Re: [GENERAL] PQendcopy:resetting connection Problem and Cannot insert a duplicate key into unique index

2010-02-03 Thread Scott Marlowe
On Wed, Feb 3, 2010 at 3:31 PM, Wang, Mary Y wrote: > Thanks Scott and Tom. > Yes.  I know, I know that I need to upgrade :-) > What would be the newer version of pgsql (I mean a bit higher version of my > current version) that provides that capability of telling me what the > duplicated key was

Re: [GENERAL] PQendcopy:resetting connection Problem and Cannot insert a duplicate key into unique index

2010-02-03 Thread Wang, Mary Y
Thanks Scott and Tom. Yes. I know, I know that I need to upgrade :-) What would be the newer version of pgsql (I mean a bit higher version of my current version) that provides that capability of telling me what the duplicated key was ? Migration is always a challenge, especially I'm not sure if

Re: [GENERAL] PQendcopy:resetting connection Problem and Cannot insert a duplicate key into unique index

2010-02-03 Thread Tom Lane
Scott Marlowe writes: > On Wed, Feb 3, 2010 at 2:16 PM, Wang, Mary Y wrote: >> I still couldn't find that particular line that caused that problem :-(.   >> Counting was very pain. >> Is there anyway that I can tell psql just to "ignore" (I mean don't insert >> it duplicate key into unique index

Re: [GENERAL] JOIN Record returning Function

2010-02-03 Thread Tim Landscheidt
Daniel Schuchardt wrote: > i have a function that returns a record. > myfunc(IN id INTEGER) RETURNS RECORD. > in that function the record is build from some subquery's in > dependence of data. > Now i need to join that function to its correponding main > table that holds the id. > SELECT myfu

Re: [GENERAL] PQendcopy:resetting connection Problem and Cannot insert a duplicate key into unique index

2010-02-03 Thread Scott Marlowe
On Wed, Feb 3, 2010 at 2:16 PM, Wang, Mary Y wrote: > Thanks Tom. > I still couldn't find that particular line that caused that problem :-(.   > Counting was very pain. > Is there anyway that I can tell psql just to "ignore" (I mean don't insert it > duplicate key into unique index users_pkey) an

Re: [GENERAL] PQendcopy:resetting connection Problem and Cannot insert a duplicate key into unique index

2010-02-03 Thread Wang, Mary Y
Thanks Tom. I still couldn't find that particular line that caused that problem :-(. Counting was very pain. Is there anyway that I can tell psql just to "ignore" (I mean don't insert it duplicate key into unique index users_pkey) and just keep going without doing the PQendcopy:resetting connec

Re: [GENERAL] add column specify position

2010-02-03 Thread Scott Frankel
Excellent! Thanks for providing the link. I think the 'add columns and move data' option would best fit my needs. Thanks! Scott On Feb 2, 2010, at 11:44 PM, Shoaib Mir wrote: On Wed, Feb 3, 2010 at 4:14 PM, Scott Frankel wrote: Hi all, Is it possible to specify a position when ad

Re: [GENERAL]

2010-02-03 Thread Andrej
On 4 February 2010 02:26, vijayalakshmi thiruvengadam wrote: > Good Morning, > I am a developer trying to use postgresql 8.3.2 when > it was available. Now it says fatal error ie when executing > postgresql-8.3-int.msi that has two msi files pgadmin3.msi and psqlodbc.msi, >

[GENERAL] statically linking libpq to psycopg2

2010-02-03 Thread john blair
I am trying to link statically psycopg2-2.0.13 to libpq.a on my mac os 10.5.5. The build goes fine and libpq is statically linked: otool -L build/lib.macosx-10.3-i386-2.6/psycopg2/_psycopg.so build/lib.macosx-10.3-i386-2.6/psycopg2/_psycopg.so: /usr/lib/libssl.0.9.7.dylib (compatibility v

Re: [GENERAL] PQendcopy:resetting connection Problem and Cannot insert a duplicate key into unique index

2010-02-03 Thread Tom Lane
"Wang, Mary Y" writes: > I managed to restore my database. However, one table is not restored. > The error message that I was received was "copy: line 3057, Cannot insert a > duplicate key into unique index users_pkey..." and then > "...PQendcopy:resetting connection" > Then I went to the log f

Re: [GENERAL] stat collector is not using

2010-02-03 Thread Tom Lane
AI Rumman writes: > I am using Postgresql 8.1. > I set stats_start_collector = on > But I found statistics collector is not using; The collector won't actually collect anything unless you enable at least one of these settings: #stats_command_string = off #stats_block_level = off #stats_row_leve

[GENERAL] Deleted Records & file format

2010-02-03 Thread Jonathan Bond-Caron
Is there any documentation of the binary format of the 'base' tables? I found that I can find where a table's data stored with: SELECT oid FROM pg_database WHERE datname = current_database(); SELECT relfilenode, reltoastrelid FROM pg_class WHERE relname = 'table'; /usr/local/pgsql/data

[GENERAL] Grant on table without access to other tables structure

2010-02-03 Thread Pedro Zorzenon Neto
Hi, I will explain what I need with a simple example. I have three tables: jobs, people, cities I have to grant select on people to john. GRANT SELECT ON PEOPLE TO JOHN; Now, when john opens "psql", it can do the selects. That is OK. But when john does \d \d cities

[GENERAL]

2010-02-03 Thread vijayalakshmi thiruvengadam
Good Morning, I am a developer trying to use postgresql 8.3.2 when it was available. Now it says fatal error ie when executing postgresql-8.3-int.msi that has two msi files pgadmin3.msi and psqlodbc.msi, it shows "please use the main msi file to install postgresql"

Re: [GENERAL] Attribute a value to a record

2010-02-03 Thread Florent THOMAS
Thanks a lot for this precision. unfortunately, the cursor doesn't accept "complicated" queries whereas record type stay more powerfull on this aspect. I found a solution and BTW it has considerably simplfy my code! A clue can make you think better! Le mercredi 03 février 2010 à 14:33 +0100, Wapp

Re: [GENERAL] Attribute a value to a record

2010-02-03 Thread Florent THOMAS
Le mercredi 03 février 2010 à 14:38 +0100, Florent THOMAS a écrit : > Thank you, > > As I posted on a french list, whene I start to develop trigger bigger > than 10lines, I always come back on developper habits and forget > database aspects. > So I WILL PRINT IT ON MY WALL : With records everyt

Re: [GENERAL] Attribute a value to a record

2010-02-03 Thread Wappler, Robert
On 2010-02-03, Florent THOMAS wrote: > Dear laurenz Albe, > > Thank you for answering so fast. for me, the variable ventilation_local > is defined as a record type. So as I wrote on the other mail, I made > some additionnal test because the doc precise that the syntax above is > allowed : http:

Re: [GENERAL] Attribute a value to a record

2010-02-03 Thread Albe Laurenz
Florent THOMAS wrote: > I understood that in the Loop you can change the values of a > variable! Exactly what I needed. > but unfortunately all of this seems to be temporary. > Consequently, the record in the table won't be updated by the > changes we made on the local variable even if it points

Re: [GENERAL] Is it necessary to have index for child table in following case?

2010-02-03 Thread Alban Hertroys
On 3 Feb 2010, at 3:58, Yan Cheng Cheok wrote: > Due to the fact > > "A serious limitation of the inheritance feature is that indexes (including > unique constraints) and foreign key constraints only apply to single tables, > not to their inheritance children. This is true on both the referenci

Re: [GENERAL] table size is not changed

2010-02-03 Thread Scott Marlowe
On Wed, Feb 3, 2010 at 2:43 AM, AI Rumman wrote: > I deleted 7 rows from a table and then execute > vacuum analyze . > > But table size not yet changed. > > I am using Postgresql 8.1. > > Could anyone please tell me what the problem is? http://www.postgresql.org/docs/8.1/static/maintenance.h

Re: [GENERAL] table size is not changed

2010-02-03 Thread Grzegorz Jaśkiewicz
try reindexing table. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] table size is not changed

2010-02-03 Thread AI Rumman
I deleted 7 rows from a table and then execute vacuum analyze . But table size not yet changed. I am using Postgresql 8.1. Could anyone please tell me what the problem is?

[GENERAL] PQendcopy:resetting connection Problem and Cannot insert a duplicate key into unique index

2010-02-03 Thread Wang, Mary Y
Hi, I managed to restore my database. However, one table is not restored. The error message that I was received was "copy: line 3057, Cannot insert a duplicate key into unique index users_pkey..." and then "...PQendcopy:resetting connection" Then I went to the log file (my debug file was set to

Re: [GENERAL] Attribute a value to a record

2010-02-03 Thread Florent THOMAS
Dear laurenz Albe, Thank you for answering so fast. for me, the variable ventilation_local is defined as a record type. So as I wrote on the other mail, I made some additionnal test because the doc precise that the syntax above is allowed : http://www.postgresql.org/docs/8.4/interactive/plpgsql-s

Re: [GENERAL] Attribute a value to a record

2010-02-03 Thread Albe Laurenz
Florent THOMAS wrote: > I'm currently running on pg8.4 and I have a trigger with a loop : > > FOR ventilation_local IN (SELECT * FROM XXX) LOOP > IF (mytest) THEN > ventilation_local.myfield:=mynewvalue; > END IF; > END LOOP; > > my problem is that the record doen't accept the new

Re: [GENERAL] surprised by non-strict array_append

2010-02-03 Thread Greg Stark
If it were strict wouldn't it return NULL? greg On 3 Feb 2010 07:16, "J. Greg Davidson" wrote: I was caught out today by the non-strict behavior of array_append causing me to get an undesired result for a COALESCE. My subsequent attempt to create a STRICT VARIADIC generalization of array_appen

Re: [GENERAL] Unusual table size and very slow inserts

2010-02-03 Thread Greg Smith
Ivano Luberti wrote: This is what I was thinking , but today I was able to look at the processes running while a client was doing a bunc of inserts. There was no autovacuum running and every insert was taking many seconds to e executed. Have you done any basic tuning of the database paramete