Re: creating postgres tables by passing a string to function

From: Richard Huxton <dev(at)archonet(dot)com>
To: Scott cox <sadcox66(at)hotmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: creating postgres tables by passing a string to function
Date: 2005-10-05 08:20:50
Message-ID: 43438CE2.3080108@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Scott cox wrote:
> I am storing data separated by month.
> How do I perform Inserts and Selects based on something like this.
>
> select * from (select 'shipped' || '0509') AS aShippingTable
>
> The table 'shipped' || '0509' exists.
>
> I am scanning barcode labels which have the '0509' on them and I want to
> move the data
> to appropiate monthly tables. '0510' would represent shipped on 2005
> october.
>
> Eventually I want to create, insert, select all based on passing a
> string such as '0509' to a function.

Well, it sounds like you want to look at the EXECUTE command if you're
thinking of writing functions in plpgsql.

However, you don't say how you came to the conclusion that separating
your shipping-table into hundreds of smaller tables was the best design.
Can I ask what testing you did and what the results were?

--
Richard Huxton
Archonet Ltd

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Richard Huxton 2005-10-05 08:30:04 Re: BirthDay SQL Issue
Previous Message Richard Huxton 2005-10-05 08:18:39 Re: MOVE in SQL vs PLPGSQL