Re: [GENERAL] create a script which imports csv data

2012-06-28 Thread Craig Ringer
On 06/28/2012 07:53 PM, Robert Buckley wrote: Hi, I have to create a script which imports csv data into postgresql ...and have a few questions about the best way to do it. The advice already given is pretty good. Remember you can always create a clean new table then INSERT INTO ... SELECT to

Re: [GENERAL] Postgresql 9.0.6 alway run VACUUM ANALYZE pg_catalog.pg_attribute

2012-06-28 Thread Jeff Davis
On Thu, 2012-06-28 at 21:41 +0700, tuanhoanganh wrote: > Hello > I am using PostgreSQL 9.0.6 64 bit on Windows 2003 64bit. > When i view Postgresql status, there are some autovaccum alway run. > Ex VACUUM ANALYZE pg_catalog.pg_attribute. > > > Is it problem of PostgreSQL? Please help me. Do you

Re: [GENERAL] Stored function signature incompatibility in index (probably a bug)

2012-06-28 Thread Sergey Konoplev
On Thu, Jun 28, 2012 at 8:59 PM, Tom Lane wrote: > A potential workaround is illustrated by: > > regression=# create index foobari on foobar (foosum(row(foobar.*)::foo)); > CREATE INDEX > regression=# \d foobari >           Index "public.foobari" >  Column |  Type   |        Definition > +

Re: [GENERAL] Stored function signature incompatibility in index (probably a bug)

2012-06-28 Thread Tom Lane
Sergey Konoplev writes: > When I was restoring a dump on 9.1.4 (created on 9.0.7) I got this error: > ERROR: function > imported_credentials_generalized_external_id(imported_email3) does not exist Yeah. Here's a more complete example on HEAD: regression=# create table foo(f1 int, f2 int); CRE

[GENERAL] Stored function signature incompatibility in index (probably a bug)

2012-06-28 Thread Sergey Konoplev
Hi, When I was restoring a dump on 9.1.4 (created on 9.0.7) I got this error: ERROR: function imported_credentials_generalized_external_id(imported_email3) does not exist LINE 1: ...ed_external_i_idx ON imported_email3 USING btree (imported_c...

Re: [GENERAL] create database from template requires the source database to be unused

2012-06-28 Thread Tom Lane
Alban Hertroys writes: >> I've read that postgres uses MVCC for transactions, and that it creates >> snapshots of the database for each transaction.  Couldn't the create >> database command just use that snapshot? > Database creation cannot be done inside a transaction (one of the few > DDL state

Re: [GENERAL] Customising pg directories

2012-06-28 Thread Raghavendra
Thanks too... :) --Raghav On Thu, Jun 28, 2012 at 4:52 PM, Ben Carbery wrote: > Too easy, thanks. > > On 28 June 2012 18:38, Raghavendra > wrote: > > On Thu, Jun 28, 2012 at 1:20 PM, Ben Carbery > wrote: > >> > >> I am building a new server with a separate partition for data and > >> xlogs. W

Re: [GENERAL] create a script which imports csv data

2012-06-28 Thread Arjen Nienhuis
On Thu, Jun 28, 2012 at 2:12 PM, Berend Tober wrote: > Robert Buckley wrote: >> >> I have to create a script which imports csv data into postgresql >> The csv data is automatically created from an external database >> so I have no influence over which columns etc are downloaded. >> >> How can I be

Re: [GENERAL] create database from template requires the source database to be unused

2012-06-28 Thread Alban Hertroys
> I've read that postgres uses MVCC for transactions, and that it creates > snapshots of the database for each transaction.  Couldn't the create > database command just use that snapshot? Database creation cannot be done inside a transaction (one of the few DDL statements that can't), so no. --

Re: [GENERAL] create database from template requires the source database to be unused

2012-06-28 Thread Haszlakiewicz, Eric
> -Original Message- > From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general- > It'd be really interesting to relax that limitation to "... other > non-read-only transaction ... " and have a database that's being cloned > block or reject > DML, UPDATE, etc. There are some issues wi

[GENERAL] Postgresql 9.0.6 alway run VACUUM ANALYZE pg_catalog.pg_attribute

2012-06-28 Thread tuanhoanganh
Hello I am using PostgreSQL 9.0.6 64 bit on Windows 2003 64bit. When i view Postgresql status, there are some autovaccum alway run. Ex VACUUM ANALYZE pg_catalog.pg_attribute. Is it problem of PostgreSQL? Please help me. Tuan Hoang Anh.

Re: [GENERAL] create a script which imports csv data

2012-06-28 Thread Berend Tober
Robert Buckley wrote: I have to create a script which imports csv data into postgresql The csv data is automatically created from an external database so I have no influence over which columns etc are downloaded. How can I best create a table for the import? This is what I do: 1) I have a ta

Re: [GENERAL] create a script which imports csv data

2012-06-28 Thread Marc Mamin
> > > From: pgsql-general-ow...@postgresql.org On Behalf Of Robert Buckley > Sent: Donnerstag, 28. Juni 2012 13:53 > To: pgsql-general@postgresql.org > Subject: [GENERAL] create a script which imports csv data > > Hi, > > I have to create a script which imports csv data into postgresql ...and

Re: [GENERAL] create a script which imports csv data

2012-06-28 Thread Raymond O'Donnell
On 28/06/2012 12:53, Robert Buckley wrote: > Hi, > > I have to create a script which imports csv data into postgresql ...and > have a few questions about the best way to do it. > > The csv data is automatically created from an external database so I > have no influence over which columns etc are

[GENERAL] create a script which imports csv data

2012-06-28 Thread Robert Buckley
Hi, I have to create a script which imports csv data into postgresql ...and have a few questions about the best way to do it. The csv data is automatically created from an external database so I have no influence over which columns etc are downloaded. The csv comes without an fid field and has

[GENERAL] function lookup using a "real" function call

2012-06-28 Thread Marc Mamin
Hello, Is it possible to find out the (list of) function oids from a function call? e.g. select MYFUNC('foo', 1234) => someting like select * from get_function_oids($$MYFUNC('foo', 1234)$$) best regards, Marc Mamin -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) T

Re: [GENERAL] Customising pg directories

2012-06-28 Thread Raghavendra
On Thu, Jun 28, 2012 at 1:20 PM, Ben Carbery wrote: > I am building a new server with a separate partition for data and > xlogs. What is the correct way to do this? > > Can I create a symlink from /var/lib/pgsql/9.1/data -> /pg_data (and > then a symlink in /pgdata for xlogs-> /pg_xlog) > Or do I

Re: [GENERAL] log_min_duration_statement modification for non superusers?

2012-06-28 Thread Albe Laurenz
Paul McGarry wrote: > I have a situation where I'd like to lower the > log_min_duration_statement for a particular connection > . > The DB is used for several reporting type queries which may reasonably > take several seconds so the log_min_duration_statement in the DB is > set accordingly. > > Ho

[GENERAL] Customising pg directories

2012-06-28 Thread Ben Carbery
I am building a new server with a separate partition for data and xlogs. What is the correct way to do this? Can I create a symlink from /var/lib/pgsql/9.1/data -> /pg_data (and then a symlink in /pgdata for xlogs-> /pg_xlog) Or do I have to modify $PGDATA in the init script? This is all after in