Unix Technical Forum

Question on PL/Perl

This is a discussion on Question on PL/Perl within the pgsql Novice forums, part of the PostgreSQL category; --> Hi, I'm new to PostgreSql and i'm wondering how to write functions in PL/Perl to INSERT, RETRIEVE, DELETE elements ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Novice

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-17-2008, 09:30 PM
Deepblues
 
Posts: n/a
Default Question on PL/Perl

Hi,

I'm new to PostgreSql and i'm wondering how to write functions in
PL/Perl to INSERT, RETRIEVE, DELETE elements from the tables.
I have 3 tables and I have to write functions in perl to populate data
to the tables.

Any input would be appreciated. I tried online help but it doesn't
seem to be appropriate.

Deepblues

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-17-2008, 09:30 PM
Mike G.
 
Posts: n/a
Default Re: Question on PL/Perl

What version of Postgres are you running? Perl in 8.0 is different from earlier versions.

On Mon, Feb 14, 2005 at 01:11:19PM -0600, Deepblues wrote:
> Hi,
>
> I'm new to PostgreSql and i'm wondering how to write functions in
> PL/Perl to INSERT, RETRIEVE, DELETE elements from the tables.
> I have 3 tables and I have to write functions in perl to populate data
> to the tables.
>
> Any input would be appreciated. I tried online help but it doesn't
> seem to be appropriate.
>
> Deepblues
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: the planner will ignore your desire to choose an index scan if your
> joining column's datatypes do not match


---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-17-2008, 09:30 PM
operationsengineer1@yahoo.com
 
Posts: n/a
Default Revision Control

i'm working with data that requires revisions.

the easiest way to think about it is a product by
revision. for example,

product A, rev 1
product A, rev 2
product A, rev 3

where is revision is potentially a viable product to
some customer. iow, customer blue may order product
A, rev 3 and customer green may want product A, rev 1.

i have put some thought into this and developed the
following scheme...

three tables (T=table, C=column in table, PK=primary
key, FK=foreign key):

T product_base
C PK product_base_id
C product_number
C product_name
C product_description

T revision
C PK revision_id
C revision_number
C revision_description

T product_revision
C PK product_revision_id
C FK product_base_id
C FK revision_id

does this seem like a reasonable approach to solving
this problem? please let me know if you have a better
approach or more information to improve this approach.



__________________________________
Do you Yahoo!?
Yahoo! Mail - 250MB free storage. Do more. Manage less.
http://info.mail.yahoo.com/mail_250

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-17-2008, 09:30 PM
brew@theMode.com
 
Posts: n/a
Default Re: Revision Control



operationsengineer1@yahoo.com......

So you have three tables:

> T product_base
> T revision
> T product_revision


I don't understand the difference between revision and product revision.
Maybe product_revision is a cross reference of the first two tables?

What kind of queries would you make? I don't really see the sense of
asking what products have a revision 4. What are these products anyway?

Maybe it would make sense to ask who uses a product a revision 4 level,
but you don't have a users table.

I think we need more info as to what you are trying to do.

brew

================================================== ========================
Strange Brew (brew@theMode.com)
Check out my Stock Option Covered Call website http://www.callpix.com
and my Musician's Online Database Exchange http://www.TheMode.com
================================================== ========================


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:46 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com