Re: [GENERAL] batch insert/update

2007-12-26 Thread Thomas Hart
Ivan Sergio Borgonovo wrote: What if you know in advance what are the row that should be inserted and you've a batch of rows that should be updated? Is it still the fasted system to insert them all in a temp table with copy? What about the one that have to be updated if you've all the columns,

Re: [GENERAL] batch insert/update

2007-12-26 Thread Ivan Sergio Borgonovo
On Wed, 26 Dec 2007 20:48:27 +0100 Andreas Kretschmer <[EMAIL PROTECTED]> wrote: > blackwater dev <[EMAIL PROTECTED]> schrieb: > > > I have some php code that will be pulling in a file via ftp. > > This file will contain 20,000+ records that I then need to pump > > into the postgres db. These re

Re: [GENERAL] batch insert/update

2007-12-26 Thread Ivan Sergio Borgonovo
On Wed, 26 Dec 2007 20:48:27 +0100 Andreas Kretschmer <[EMAIL PROTECTED]> wrote: > blackwater dev <[EMAIL PROTECTED]> schrieb: > > > I have some php code that will be pulling in a file via ftp. > > This file will contain 20,000+ records that I then need to pump > > into the postgres db. These re

Re: [GENERAL] batch insert/update

2007-12-26 Thread Andreas Kretschmer
blackwater dev <[EMAIL PROTECTED]> schrieb: > I have some php code that will be pulling in a file via ftp. This file will > contain 20,000+ records that I then need to pump into the postgres db. These > records will represent a subset of the records in a certain table. I > basically > need an

Re: [GENERAL] how to alter an enum type

2007-12-26 Thread Gurjeet Singh
I would still recommend to keep the meanings associated with the values in the database somehow. Have you given thought to CHECK constraints? They are easier to alter on the fly: create table questionnare( Q varchar(256), A varchar(16) constraint possible_answers check ( A IN( 'yes',

[GENERAL] batch insert/update

2007-12-26 Thread blackwater dev
I have some php code that will be pulling in a file via ftp. This file will contain 20,000+ records that I then need to pump into the postgres db. These records will represent a subset of the records in a certain table. I basically need an efficient way to pump these rows into the table, replacin

Re: [GENERAL] how to alter an enum type

2007-12-26 Thread Henrique Pantarotto
Thanks a lot Gurjeet! I understanded your suggestion... that seems to work indeed. But I really would like to be able to alter the enum type on the fly, so instead of using enum, I think I'll just use a "smallint" type and tie the "possible results" to the application using flags such as 0, 1, 2

Re: [GENERAL] COPY with composite type column

2007-12-26 Thread Reg Me Please
Il Wednesday 26 December 2007 14:31:04 Reg Me Please ha scritto: > Il Wednesday 26 December 2007 12:58:34 Reg Me Please ha scritto: > > Hi all. > > > > I have this composite type: > > > > create type ct as ( > > ct1 text, > > ct2 int > > ); > > > > Then I have this table > > > > create table at

Re: [GENERAL] postgresql long text column

2007-12-26 Thread A. Kretschmer
am Wed, dem 26.12.2007, um 10:08:13 -0500 mailte Josh Harrison folgendes: > Hi > I have a question about postgres long text column values. > How does it handles these long text column values? Does it put all the long > text columns values from all the tables in one single place or separately? PG

[GENERAL] postgresql long text column

2007-12-26 Thread Josh Harrison
Hi I have a question about postgres long text column values. How does it handles these long text column values? Does it put all the long text columns values from all the tables in one single place or separately? Thanks josh

Re: [GENERAL] COPY with composite type column

2007-12-26 Thread Reg Me Please
Il Wednesday 26 December 2007 12:58:34 Reg Me Please ha scritto: > Hi all. > > I have this composite type: > > create type ct as ( > ct1 text, > ct2 int > ); > > Then I have this table > > create table atable ( > somedata numeric, > otherdata text, > compo ct > ); > > when I try to COPY d

[GENERAL] COPY with composite type column

2007-12-26 Thread Reg Me Please
Hi all. I have this composite type: create type ct as ( ct1 text, ct2 int ); Then I have this table create table atable ( somedata numeric, otherdata text, compo ct ); when I try to COPY data to that table and use the following "query" I get a syntax error message: COPY atable( some