pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedcreating postgres tables by passing a string to function
2+ messages / 2 participants
[nested] [flat]
* creating postgres tables by passing a string to function
@ 2005-09-30 15:38 Scott cox <sadcox66@hotmail.com>
2005-10-05 08:20 ` Re: creating postgres tables by passing a string to function Richard Huxton <dev@archonet.com>
0 siblings, 1 reply; 2+ messages in thread
From: Scott cox @ 2005-09-30 15:38 UTC (permalink / raw)
To: pgsql-sql
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.
I am a newbie.
Thanks in advance
-Scott
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: creating postgres tables by passing a string to function
2005-09-30 15:38 creating postgres tables by passing a string to function Scott cox <sadcox66@hotmail.com>
@ 2005-10-05 08:20 ` Richard Huxton <dev@archonet.com>
0 siblings, 0 replies; 2+ messages in thread
From: Richard Huxton @ 2005-10-05 08:20 UTC (permalink / raw)
To: Scott cox <sadcox66@hotmail.com>; +Cc: 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
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2005-10-05 08:20 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-09-30 15:38 creating postgres tables by passing a string to function Scott cox <sadcox66@hotmail.com>
2005-10-05 08:20 ` Richard Huxton <dev@archonet.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox