[GENERAL] question about hstore and indexes

2013-09-27 Thread Andreas Kretschmer
Hi @all, i have this table with some rows: test=*# \d my_hstore; Table public.my_hstore Column | Type | Modifiers +-+ id | integer | not null default

Re: [GENERAL] question about hstore and indexes

2013-09-27 Thread Matteo Beccati
Hi Andreas, On 27/09/2013 09:24, Andreas Kretschmer wrote: This query can't use the index: test=*# explain select * from my_hstore where werte-'key1' = 'val1'; QUERY PLAN -- Seq

Re: [GENERAL] question about hstore and indexes

2013-09-27 Thread Andreas Kretschmer
Matteo Beccati p...@beccati.com wrote: Hi Andreas, On 27/09/2013 09:24, Andreas Kretschmer wrote: This query can't use the index: test=*# explain select * from my_hstore where werte-'key1' = 'val1'; QUERY PLAN

Re: [GENERAL] ENUM drop label workaround

2013-09-27 Thread Arjen Nienhuis
On Sep 26, 2013 9:20 PM, Sergey Konoplev gray...@gmail.com wrote: Hi, AIU we have no ability to drop a label from ENUM currently, and there are no plans to add this feature in the nearest future. I came to a workaround via DOMAIN, here it is: CREATE TYPE ref AS ENUM ('aaa', 'bbb');

Re: [GENERAL] Trouble installing psycopg2

2013-09-27 Thread Augori
*Thanks again for the suggestions. It doesn't look to me like it's installed in /usr/local/lib/python2.7/site-packages. There's an egg directory there, but otherwise, no psycopg2. The egg directory doesn't mean it's installed, does it?? Here's an ls of that site-packages dir:* root@server

Re: [GENERAL] Building with MinGW issue

2013-09-27 Thread Adrian Klaver
On 09/26/2013 07:53 PM, Muhammad Bashir Al-Noimi wrote: On 09/24/2013 02:57 AM, Adrian Klaver wrote: Sort of late in the thread to ask this, but any reason you are not using the precompiled binaries? I couldn’t find Postgresql binaries built by MinGW... Do you know if these binaries already

Re: [GENERAL] Trouble installing psycopg2

2013-09-27 Thread Adrian Klaver
On 09/27/2013 04:45 AM, Augori wrote: *Thanks again for the suggestions. It doesn't look to me like it's installed in /usr/local/lib/python2.7/site-packages. There's an egg directory there, but otherwise, no psycopg2. The egg directory doesn't mean it's installed, does it?? Here's an ls of

Re: [GENERAL] Trouble installing psycopg2

2013-09-27 Thread Adrian Klaver
On 09/27/2013 04:45 AM, Augori wrote: Do you have other ideas? Re: my previous post. I was assuming you are not using Python 2.7 for anything important at this point. That might be an erroneous assumption, in which case truly cleaning house might not be the way to go. -- Adrian Klaver

Re: [GENERAL] PlPython with pyodbc error DLL load failed: A dynamic link library (DLL) initialization routine failed.

2013-09-27 Thread tuanhoanganh
I try install plpython on PostgreSQL 9.3, Ubuntu 12.04 64bit but it has error when CREATE EXTENSION plpython3u; 2013-09-27 22:09:26 ICT LOG: database system was shut down at 2013-09-27 22:09:20 ICT 2013-09-27 22:09:26 ICT LOG: database system is ready to accept connections 2013-09-27 22:09:26

Re: [GENERAL] Trying to create DB / user to import some data

2013-09-27 Thread mdr
Hi Steven - Thanks. Worked great. I assumed it would assume the dbname to be import_dbms_db as import_dbms_user was granted admin privileges on it. Also I do have import_dbms_user and import_dbms_db in my pg_hba.conf as: local import_dbms_db import_dbms_user md5 I still need that - correct? And

Re: [GENERAL] PlPython with pyodbc error DLL load failed: A dynamic link library (DLL) initialization routine failed.

2013-09-27 Thread Adrian Klaver
On 09/27/2013 08:55 AM, tuanhoanganh wrote: I try install plpython on PostgreSQL 9.3, Ubuntu 12.04 64bit but it has error when CREATE EXTENSION plpython3u; 2013-09-27 22:09:26 ICT LOG: database system was shut down at 2013-09-27 22:09:20 ICT 2013-09-27 22:09:26 ICT LOG: database system is

Re: [GENERAL] Trying to create DB / user to import some data

2013-09-27 Thread Adrian Klaver
On 09/27/2013 09:26 AM, mdr wrote: Hi Steven - Thanks. Worked great. I assumed it would assume the dbname to be import_dbms_db as import_dbms_user was granted admin privileges on it. User names are global to a Postgres cluster, they can be used for any database in that cluster. Also I do

Re: [GENERAL] Trying to create DB / user to import some data

2013-09-27 Thread mdr
Thanks for your help Adrian. Works great. I had a few other questions on creating primary keys after create table using alter table. I will post them separately so this thread is closed. Thank you both again. Mono -- View this message in context:

Re: [GENERAL] Trying to create DB / user to import some data

2013-09-27 Thread John R Pierce
On 9/26/2013 10:28 PM, mdr wrote: create user import_dbms_user with password 'import_dbms'; create database import_dbms_db; grant all privileges on database import_dbms_db to import_dbms_user; that grant only controls connection and create schema privileges. if you want this user to have full

[GENERAL] Creating Primary Key after CREATE TABLE: Is Sequence created?

2013-09-27 Thread mdr
I had a question on creating PK with alter table, after table is created. I understand I create a PK id during create table by stating id as follows: id serial primary key It implicitly creates index and the sequence testing_id_seq to be associated with the id field. I can list the sequence

Re: [GENERAL] ENUM drop label workaround

2013-09-27 Thread Sergey Konoplev
On Fri, Sep 27, 2013 at 1:37 AM, Arjen Nienhuis a.g.nienh...@gmail.com wrote: Are there any caveats of this solution and may be there is a better one? Why don't you just create a new ENUM with fewer values? You can use: ALTER TABLE ... SET DATA TYPE ... USING col1::text::new_enum_type; You

Re: [GENERAL] Creating Primary Key after CREATE TABLE: Is Sequence created?

2013-09-27 Thread David Johnston
mdr wrote I had a question on creating PK with alter table, after table is created. I understand I create a PK id during create table by stating id as follows: id serial primary key It implicitly creates index and the sequence testing_id_seq to be associated with the id field. I can

Re: [GENERAL] Creating Primary Key after CREATE TABLE: Is Sequence created?

2013-09-27 Thread Elliot
On 2013-09-27 14:27, mdr wrote: I had a question on creating PK with alter table, after table is created. I understand I create a PK id during create table by stating id as follows: id serial primary key It implicitly creates index and the sequence testing_id_seq to be associated with the id

Re: [GENERAL] Creating Primary Key after CREATE TABLE: Is Sequence created?

2013-09-27 Thread mdr
Hi David and John - Thank you for your answers on the SERIAL, SEQUENCE and thus PRIMARY KEY. I did not realize there was a column of type SERIAL that creates a SEQUENCE. However, now I have a different question. Is it possible to create a column of type SQL:2011 types (INTEGER or such) and

Re: [GENERAL] Trying to create DB / user to import some data

2013-09-27 Thread Monosij
Hi John - Thanks for sharing your connection params. Very helpful to have this and to know it has been tested. Much appreciated all answers here. Mono -- View this message in context:

Re: [GENERAL] Creating Primary Key after CREATE TABLE: Is Sequence created?

2013-09-27 Thread John R Pierce
On 9/27/2013 12:40 PM, mdr wrote: Is it possible to create a column of type SQL:2011 types (INTEGER or such) and then connect a SEQUENCE to it and make that column a PRIMARY KEY - without creating a column of type SERIAL? yes, its just more work. something like... CREATE TABLE fred (id

Re: [GENERAL] Building with MinGW issue

2013-09-27 Thread Muhammad Bashir Al-Noimi
On 09/27/2013 05:04 AM, John R Pierce wrote: why does the compiler matter for a precompiled binary? I want to link Postgresql client to my application statically so I've to use precompiled binaries built by same compiler (in my case I'm using MinGW) Default precompiled binaries of Postgresql

Re: [GENERAL] Creating Primary Key after CREATE TABLE: Is Sequence created?

2013-09-27 Thread John R Pierce
On 9/27/2013 12:40 PM, mdr wrote: just wanted to manage to SQL:2011. afaik, *nothing* completely implements SQL:2011 (or any prior SQL standard). The standard are unwieldy messes cobbled together out of various vendors wishlists mixed in with academic wishful thinking. if you program to

Re: [GENERAL] Building with MinGW issue

2013-09-27 Thread Muhammad Bashir Al-Noimi
On 09/27/2013 04:16 PM, Adrian Klaver wrote: I was talking about these: http://www.postgresql.org/download/windows/ Not sure what they are compiled with, it should not matter though. Oh man these binaries built by MSVC which takes us to first square! -- Best Regards, Muhammad Bashir

Re: [GENERAL] Creating Primary Key after CREATE TABLE: Is Sequence created?

2013-09-27 Thread Monosij
Thanks again John. Will try it out. So I have to rely in 1 statement that is Postgres specific. That still works for me. Also I can create the PRIMARY KEY as an alter table and not be part of CREATE TABLE right? So let me see how the trials go. Thank you again John. Also Elliot for your last

Re: [GENERAL] Creating Primary Key after CREATE TABLE: Is Sequence created?

2013-09-27 Thread Monosij
Ok I understand about not programming to LCD. I just initially wanted to play around with creating tables / indexes / fks and import some data before moving to next steps. I did want to have some control over namimg conventions. For eg. with creating PK id and sequence with 1 statement as: id

Re: [GENERAL] Creating Primary Key after CREATE TABLE: Is Sequence created?

2013-09-27 Thread Adrian Klaver
On 09/27/2013 01:16 PM, Monosij wrote: Ok I understand about not programming to LCD. I just initially wanted to play around with creating tables / indexes / fks and import some data before moving to next steps. I did want to have some control over namimg conventions. For eg. with creating PK

Re: [GENERAL] Building with MinGW issue

2013-09-27 Thread John R Pierce
On 9/27/2013 1:03 PM, Muhammad Bashir Al-Noimi wrote: On 09/27/2013 05:04 AM, John R Pierce wrote: why does the compiler matter for a precompiled binary? I want to link Postgresql client to my application statically static linking is heavily deprecated in most all environments. -- john r

Re: [GENERAL] Building with MinGW issue

2013-09-27 Thread Adrian Klaver
On 09/27/2013 01:05 PM, Muhammad Bashir Al-Noimi wrote: On 09/27/2013 04:16 PM, Adrian Klaver wrote: I was talking about these: http://www.postgresql.org/download/windows/ Not sure what they are compiled with, it should not matter though. Oh man these binaries built by MSVC which takes us to

Re: [GENERAL] Creating Primary Key after CREATE TABLE: Is Sequence created?

2013-09-27 Thread Monosij
Thanks Adrian. Will likely follow the transaction approach then. -- View this message in context: http://postgresql.1045698.n5.nabble.com/Creating-Primary-Key-after-CREATE-TABLE-Is-Sequence-created-tp5772633p5772665.html Sent from the PostgreSQL - general mailing list archive at Nabble.com.

Re: [GENERAL] truncate/rotate pgbouncer log using .ini settings

2013-09-27 Thread Sergey Konoplev
On Thu, Sep 26, 2013 at 2:25 PM, Venkat Kaushik venkat.pgu...@gmail.com wrote: a) Is there a way (from pgbouncer.ini) to curtail/truncate/rotate logs? http://pgbouncer.projects.pgfoundry.org/doc/config.html#_log_settings You can configure it to log to syslog and then configure your logging