Re: [GENERAL] scenario with a slow query

2012-01-19 Thread Volodymyr Kostyrko
Tom Lane wrote: Volodymyr Kostyrko writes: Maybe I'm missing something but I have found a case when planner is unoptimal. The planner knows next to nothing about optimizing FULL JOIN, and I would not recommend holding your breath waiting for it to get better about that, because there's basica

Re: [GENERAL] On duplicate ignore

2012-01-19 Thread Florian Weimer
* Gnanakumar: >> Just create a unique index on EMAIL column and handle error if it comes > > Thanks for your suggestion. Of course, I do understand that this could be > enforced/imposed at the database-level at any time. But I'm trying to find > out whether this could be solved at the applicatio

[GENERAL] variadic array arguments, can it work?

2012-01-19 Thread Ingmar Brouns
Hi, I was trying to write a variadic function where the arguments themselves are arrays, but calling it does not seem to work. I couldn't find documentation mentioning this restriction postgres=# create or replace function foo(variadic args integer[][]) returns integer as $$ begin return args[2][

Re: [GENERAL] variadic array arguments, can it work?

2012-01-19 Thread Tom Lane
Ingmar Brouns writes: > I was trying to write a variadic function where the arguments themselves > are arrays, but calling it does not seem to work. I couldn't find > documentation mentioning this restriction > postgres=# create or replace function foo(variadic args integer[][]) The reason that

Re: [GENERAL] On duplicate ignore

2012-01-19 Thread Scott Marlowe
On Thu, Jan 19, 2012 at 7:54 AM, Florian Weimer wrote: > * Gnanakumar: > >>> Just create a unique index on EMAIL column and handle error if it comes >> >> Thanks for your suggestion.  Of course, I do understand that this could be >> enforced/imposed at the database-level at any time.  But I'm tryi

Re: [GENERAL] On duplicate ignore

2012-01-19 Thread Scott Marlowe
On Thu, Jan 19, 2012 at 9:49 AM, Scott Marlowe wrote: > On Thu, Jan 19, 2012 at 7:54 AM, Florian Weimer wrote: >> * Gnanakumar: >> Just create a unique index on EMAIL column and handle error if it comes >>> >>> Thanks for your suggestion.  Of course, I do understand that this could be >>> en

Re: [GENERAL] On duplicate ignore

2012-01-19 Thread Florian Weimer
* Scott Marlowe: > On Thu, Jan 19, 2012 at 7:54 AM, Florian Weimer wrote: >> * Gnanakumar: >> Just create a unique index on EMAIL column and handle error if it comes >>> >>> Thanks for your suggestion.  Of course, I do understand that this could be >>> enforced/imposed at the database-level

[GENERAL] Cannot connect remotely to postgresql

2012-01-19 Thread Willem Buitendyk
I have 8.2 installed on 64bit windows 7. I have no problem making a local connection. However, when I make changes to pg_hba.conf such as add: local all all trust I still cannot connect through a VPN. On a hunch that my pg server was not using the config files in "C:\Program Files (x86)\Post

Re: [GENERAL] Cannot connect remotely to postgresql

2012-01-19 Thread Raymond O'Donnell
On 19/01/2012 17:27, Willem Buitendyk wrote: > I have 8.2 installed on 64bit windows 7. I have no problem making a > local connection. However, when I make changes to pg_hba.conf such > as add: > > local all all trust What is the exact error message you're getting? Did you restart the server a

[GENERAL] How to improve my slow query for table have list of child table?

2012-01-19 Thread Alex Lai
Dear All, I have a large table that have 8 child tables. The size of the table is 30 millioins with necessary index needed. Table filemeta Column | Type| Modifiers +---+--- fileid | integer | not null esdt | character varying | key

Re: [GENERAL] How to improve my slow query for table have list of child table?

2012-01-19 Thread David Johnston
-Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Alex Lai Sent: Thursday, January 19, 2012 1:56 PM To: postgres general support Subject: [GENERAL] How to improve my slow query for table have list of child table? Dear All,

Re: [GENERAL] On duplicate ignore

2012-01-19 Thread Lincoln Yeoh
At 10:54 PM 1/19/2012, Florian Weimer wrote: * Gnanakumar: >> Just create a unique index on EMAIL column and handle error if it comes > > Thanks for your suggestion. Of course, I do understand that this could be > enforced/imposed at the database-level at any time. But I'm trying to find > out

[GENERAL] how to make text fields accent insensitive?

2012-01-19 Thread Heine Ferreira
Hi Recently you answered my question on how to make a field case insensitive. You showed me how to do it with the extension and data type citext. How do I make the same field accent insensitive as well? I managed to install the extension "unaccent" in Postgres 9.1.2 using create extension. Unfort

Re: [GENERAL] Cannot connect remotely to postgresql

2012-01-19 Thread Willem Buitendyk
On 2012-01-19, at 10:10 AM, Raymond O'Donnell wrote: > On 19/01/2012 17:27, Willem Buitendyk wrote: >> I have 8.2 installed on 64bit windows 7. I have no problem making a >> local connection. However, when I make changes to pg_hba.conf such >> as add: >> >> local all all trust > > What is the

[GENERAL] 2 very newbie questions

2012-01-19 Thread Heine Ferreira
Hi The Postgresql manual is rather huge so I would appreciate it if you could help me with the following 2 questions: What is an oid when creating tables and what is the purpose of it? What is a toast table? Thanks H.F.

Re: [GENERAL] How to improve my slow query for table have list of child table?

2012-01-19 Thread Alex Lai
David Johnston wrote: -Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Alex Lai Sent: Thursday, January 19, 2012 1:56 PM To: postgres general support Subject: [GENERAL] How to improve my slow query for table have list of

Re: [GENERAL] 2 very newbie questions

2012-01-19 Thread Adrian Klaver
On 01/19/2012 12:04 PM, Heine Ferreira wrote: Hi The Postgresql manual is rather huge so I would appreciate it if you could help me with the following 2 questions: What is an oid when creating tables and what is the purpose of it? oid stands for Object ID. A long time ago they where used as a

[GENERAL] schema question

2012-01-19 Thread Heine Ferreira
Hi I saw with PGAdmin that there is a public schema in the default postgres database. Does every database have a public schema? What is a schema and can you create your own? Thanks H.F.

Re: [GENERAL] schema question

2012-01-19 Thread Raymond O'Donnell
On 19/01/2012 20:14, Heine Ferreira wrote: > Hi > > I saw with PGAdmin that there is a public schema in the default postgres > database. > Does every database have a public schema? Yes. > What is a schema and can you create your own? A schema is a means of making logical divisions within your d

Re: [GENERAL] Cannot connect remotely to postgresql

2012-01-19 Thread Willem Buitendyk
I tried manually starting without the service automatically running using pg_ctl start -D "c:\program files (x86)\etc etc" which reported back that i might have another postmaster running. I then did pg_ctl reload -D "c:\program files (x86)\etc etc" and it sent a signal and voila it worked. I

Re: [GENERAL] Cannot connect remotely to postgresql

2012-01-19 Thread Raymond O'Donnell
On 19/01/2012 20:40, Willem Buitendyk wrote: > I tried manually starting without the service automatically running > using pg_ctl start -D "c:\program files (x86)\etc etc" which > reported back that i might have another postmaster running. I then > did pg_ctl reload -D "c:\program files (x86)\etc

Re: [GENERAL] How to improve my slow query for table have list of child table?

2012-01-19 Thread David Johnston
-Original Message- From: Alex Lai [mailto:a...@sesda2.com] Sent: Thursday, January 19, 2012 3:12 PM To: David Johnston Cc: 'postgres general support' Subject: Re: [GENERAL] How to improve my slow query for table have list of child table? David Johnston wrote: > -Original Message-

[GENERAL] planner, newly added records and most common values

2012-01-19 Thread Jeff Amiel
Ive got a scenario where I've got a 2 million row table. Data from inbound files gets processed into it. A new file might have 10 resulting rows in this table...might have 40K...depends on the source, day of month, etc. I've got a process that parses the file and loads the records into the t

Re: [GENERAL] planner, newly added records and most common values

2012-01-19 Thread Andrew Sullivan
On Thu, Jan 19, 2012 at 05:36:26PM -0800, Jeff Amiel wrote: > I COULD do an analyze after loading the file...but there is no guarantee that > the file I just loaded will end up in the most common value listand I end > up with bad plan. > Sounds like you need to SET STATISTICS higher for th

[GENERAL] Exclusive row locks not release

2012-01-19 Thread Mark van Leeuwen
Hi, I have a case where exclusive row locks have been placed on a table and I don't what process has the locks or how they might be released. The locks are still there even after I have restarted the database. Rebooting the server also made no difference. I am running the latest pg version

Re: [GENERAL] Exclusive row locks not release

2012-01-19 Thread Tom Lane
Mark van Leeuwen writes: > I have a case where exclusive row locks have been placed on a table and > I don't what process has the locks or how they might be released. > The locks are still there even after I have restarted the database. Uncommitted prepared transaction, perhaps? Look into pg_

Re: [GENERAL] Exclusive row locks not release

2012-01-19 Thread Mark van Leeuwen
On 20/01/2012 4:40 PM, Tom Lane wrote: Mark van Leeuwen writes: I have a case where exclusive row locks have been placed on a table and I don't what process has the locks or how they might be released. The locks are still there even after I have restarted the database. Uncommitted prepared tra