I have recently moved to a new job. I am not clear about the tasks that were assigned to me. For example, in PgAdmin my boss showed me some tables and asked me to copy one table from one schema to another. It is unclear to me whether he wanted me to copy one table or all of the tables using the new schema. I would like to request my work colleagues for help, but I am not sure what is the best way to get help from them for ramp up in my new job.
Firstly, you always need to know exactly what your boss expects you to do. If you're unclear on what he wants, ask him:
Hi, I'm sorry to bother you but I wanted to make sure I understood my assignment correctly. Did you want me to copy over all the tables in schema X to a new schema Y?
At this point your boss will clarify what he meant. The follow-up question would then be if there are any tools that are normally used for this type of thing or if you should do it manually.
As for the rest of your question, you can't always know who to ask in every situation, the skill you should learn here is how to identify who to talk to. As your manager is hinting, try to deduce who to talk to first. It doesn't have to be the exact right person straight away, you don't know what all the other employees in a company have as their job descriptions, but if you start asking in the right direction you'll eventually find the right person. In this case, go to the first person and say something like:
Hi, I'm sorry to bother you but I'm having some problems adding foreign keys to table X in database Y. Can you help with that or is there someone else I should be talking to?
There are two possibilities now, either this was the right person to talk to and you get your answer, or it wasn't the right person to talk to. If it wasn't the right person to talk to, since she is more familiar with the subject matter than you are, chances are she will know who can help you. If she indicates she doesn't know either, go to your boss and tell him what problem you ran into and what you've done to try and solve it. When you show that you've done the legwork but didn't manage to end up with the correct solution, he'll be a lot more likely to help you.
Where have I been going wrong in my process?
You have gone wrong by not asking your boss when you don't understand what to do, and when you don't know who to ask for help. Start with your boss!
Next time your boss shows you some tables and asks you to copy one from one schema to another, ask "Sure thing, boss. Did you want me to copy one table or all of them in the schema?" Bingo - you've got the answer you need!
The next time you are unsure what the best way to do copy a table, ask any of your peers "So in this shop, what is the best way to copy a table?" You've got the answer.
But if you simply aren't sure you have the ability to do your job, you'll need to work closer with your boss. You'll need to admit the parts that confuse you, and ask what he/she would like you to do. You may need a mentor, you may need more training, or there may be something else needed.
From the way you word the question, it seems to me that you understand your problem pretty well -- you're not asking for assistance in a timely fashion.
The first step to overcoming it is embracing the fact that asking for clarification is part of your job, it's not something you need to apologize for. This is true of every job, including ones where a high degree of initiative is expected. If you don't know how to do something or don't have the resources to do something or whatever the hold up is, you need to address that in a prompt and professional manner with your supervisor/manager/boss.
In terms of process: you could set a time for yourself every day and jot down the questions you need to ask -- be very precise about what those are and try to anticipate follow up questions you might have. Then you could either take the list down to your boss' office and have a quick face to face meeting with them or send the questions to them via email.
This shouldn't be a big thing where you explain why you don't know what you don't know; in most cases the questions will speak for themselves.
On project X, who do I speak to about sourcing Y?
To complete task A, I need access to resource B. Can this be arranged?
That sort of thing.
If you're doing a face to face, take notes -- you don't want to have to go back because you've forgotten something (once in a while is fine, but more than that will look flakey). I also recommend a dedicated notebook for this, so you can refer back to it as necessary.
Another thing that might help is getting to know your coworkers. You'll be more familiar with who does what, and water cooler and lunch room chat about the company will help orientate you to things you won't find in any employee handbook: Jamie in accounting is great for questions about billing, Alex in HR never checks voice mail -- little things that can trip a new employee up. So if that's an option, I would invest some time and effort in just getting to know people. It really can make a huge difference to your knowledge base.