Re: [GENERAL] Copying a column into a temp. table

2010-10-01 Thread Alexander Farber
[sorry, I didn't intend to send my prev. reply off-list] Hello Gurjeet, thanks for you interest! I've just summarized my problem at the http://www.phpbb.com/community/viewtopic.php?uid=221190&f=46&t=2105913&start=0 I log protocols of card games into forum_id=5 as Anonymous user_id=1 at my site

Re: [GENERAL] Copying a column into a temp. table

2010-10-01 Thread Gurjeet Singh
On Fri, Oct 1, 2010 at 10:52 AM, Alexander Farber < alexander.far...@gmail.com> wrote: > Thank you, I've created the following script which seems to work ok. > > I just hope, that it won't be hit by the max_stack_depth-problem > which actually forced me to look for a custom solution - > >SQL E

Re: [GENERAL] Copying a column into a temp. table

2010-10-01 Thread Gurjeet Singh
On Fri, Oct 1, 2010 at 10:02 AM, Adrian Klaver wrote: > On Friday 01 October 2010 6:54:09 am Alexander Farber wrote: > > How do you copy a column from table please? > > I'm trying with PostgreSQL 8.1.21/CentOS 5.5: > > > select topic_id from phpbb_topics where forum_id=5 and topic_poster=1 > > a

Re: [GENERAL] Copying a column into a temp. table

2010-10-01 Thread Adrian Klaver
On Friday 01 October 2010 6:54:09 am Alexander Farber wrote: > How do you copy a column from table please? > I'm trying with PostgreSQL 8.1.21/CentOS 5.5: > > # psql -a -f clean-forum.sql > start transaction; > START TRANSACTION > create temp table old_topics (topic_id integer) on commit delete row

Re: [GENERAL] Copying a column into a temp. table

2010-10-01 Thread Gabriele Bartolini
Hi Alex, Of course "select ... into" doesn't work, but how should I do it? Can't find in http://www.postgresql.org/docs/8.1/static/ You might want to look at the CREATE TABLE AS command. You might even use the temporary definer. Ciao, Gabriele -- Gabriele Bartolini - 2ndQuadrant Italia Po

[GENERAL] Copying a column into a temp. table

2010-10-01 Thread Alexander Farber
How do you copy a column from table please? I'm trying with PostgreSQL 8.1.21/CentOS 5.5: # psql -a -f clean-forum.sql start transaction; START TRANSACTION create temp table old_topics (topic_id integer) on commit delete rows; CREATE TABLE create temp table old_posts (post_id integer) on commit de