Importing data into PostgreSQL from remote text file using ftplib class
In this line i don't want to write the actual details,i want that to be hidden from my script.How can i do that? ftp = FTP('server.com','user_name','password')
  


You may want to declare constants, either at the beginning of your file or in a Credentials class that would be used as an enum:

SERVER = 'server.com'
USER_NAME = 'Linu'
PASSWORD = 'CR.SEisGreat'

ftp = FTP(SERVER, USER_NAME, PASSWORD)


You may also want to encrypt your password, with base64 or something alike. Storing passwords in files isn't a good idea anyway, so if you're using this file as a script you're going to call via bash or something alike, I would use a placeholder like argparse that would prompt your password when calling the script: 

parser = argparse.ArgumentParser(description='Reading a file from a distant FTP server.')
parser.add_argument('--passwd', dest='password', type=str,
                   help='password required for FTP connection')



  
  The script downloads the file to my local system and process it as it
  is a local file, Is there anyway too read and process it without
  downloading it to the source server(there might be permission issues
  also)?
  


I don't know much about FTP manipulation with Python so I'm not sure there is a way to read a file without having to download it.


  
  If there is no way rather than downloading it to the source, shall I
  able to mention specific path where this file would be downloaded
  rather than the way i have written?
  


Again, you may place the path into a class constant (or in a separate class):

FILE_PATH='''/path/to/file/''' 



  
  Is there anything which i can do to improve this code?
  


Imports

import psycopg2
import time
import os


I would edit this to import only the parts you need, e.g. 

from psycopg2 import connect, sql 
from time import perf_counter


There is no need to import the whole module if you only use a couple of functions, so whenever you can, I'd suggest you only import what you will actually use. 



Raising exceptions

try:
    # ...
except:
    print ("Error")


I would raise an exception here, since it's a undesired behaviour:

 try:
    # ...
except Exception as e:
    print ("Error: {}".format(e))


You may want to do the same with your psycopg and FTP errors, I see you catch them but don't read their value. It may provide a more helpful message than the prints, which just indicate you encountered an error but don't tell more about what actually happened.

SQL placeholders

SQL="""DROP TABLE IF EXISTS """+  table + """;CREATE TABLE IF NOT EXISTS """+ table + """
(created_date TEXT, product_sku TEXT, previous_stock TEXT, current_stock TEXT );"""


Should you want to make your code more generic, you could transform the above mentioned statement into:

sql.SQL="""DROP TABLE IF EXISTS {table_name} ; CREATE TABLE IF NOT EXISTS {table_name}
 (created_date TEXT, product_sku TEXT, previous_stock TEXT, 
 current_stock TEXT );""".format(
    table_name = sql.Literal(table)
)


That way you may reuse the query on other tables. You may do the same on the table attributes, i.e. 

keys = ['created_date', 'product_sku', 'previous_stock', 'current_stock']
sql.SQL("""CREATE TABLE IF NOT EXISTS {} ({});""").format(
    sql.Identifier(table),
    sql.SQL('{} TEXT,').join(map(sql.Identifier, keys))
)


It alleviates the query and makes it more generic and reusable. By the way, I don't think you need to add IF NOT EXISTS after CREATE since you already deleted the table in the first part of your query.