Re: [GENERAL] How do I insert and update into a table of arrays of composite types via a select command?

2017-10-25 Thread Celia McInnis
Yes, thanks - that's nicer - I am now using: insert into t_array select array[data_comp]::mytype[] from t_composite; On Wed, Oct 25, 2017 at 5:25 PM, Tom Lane wrote: > "David G. Johnston" writes: > > On Wed, Oct 25, 2017 at 2:16 PM, Celia McInnis > >> Go

Re: [GENERAL] How do I insert and update into a table of arrays of composite types via a select command?

2017-10-25 Thread Celia McInnis
Got it, finally... insert into t_array select array[row((data_comp).*)::mytype[] from t_composite; I'm not sure why I need (data_comp).* rather than some of the other things that I tried and failed with... On Wed, Oct 25, 2017 at 3:47 PM, Tom Lane wrote: > Celia McInnis writes: >

Re: [GENERAL] How do I insert and update into a table of arrays of composite types via a select command?

2017-10-25 Thread Celia McInnis
ues? I am running postgresql 9.6.2. On Wed, Oct 25, 2017 at 3:47 PM, Tom Lane wrote: > Celia McInnis writes: > > My first question is: HOW do I populate this table, at first with arrays > > containing one element from the t_composite table? > > I have tried various things

[GENERAL] How do I insert and update into a table of arrays of composite types via a select command?

2017-10-25 Thread Celia McInnis
I have a composite type like this, for example: create type mytype(a text, b text, c text); and a table create table t_cols(a text,b text,c text); containing some data. I have a table with my composite type: create table t_composite(data_comp mytype); and loaded data into it like so: insert

Re: [GENERAL] using conda environment for plpython3u?

2017-10-24 Thread Celia McInnis
2:05 PM, Celia McInnis wrote: > >> Is it possible for users to use their conda environment for plpython, >> complete with the modules that they have loaded in that environment? If so, >> what do I do? >> >> I am running postgres 9.6.2 and would like to use a

[GENERAL] using conda environment for plpython3u?

2017-10-23 Thread Celia McInnis
Is it possible for users to use their conda environment for plpython, complete with the modules that they have loaded in that environment? If so, what do I do? I am running postgres 9.6.2 and would like to use a conda environment for python 3.6 which contrains a fair number of modules that I want

[GENERAL] Using COPY command when input file contain backslashes?

2005-09-13 Thread Celia McInnis
Is there some way (apart from pre-processing my (huge) input files) to get the data correctly  into postgres?   Thanks for your help, Celia McInnis