Cross database query between Google SQL instances PostgreSQL

Topic: Cross-database query between Google SQL instances PostgreSQL


Cross-database query between Google SQL instances PostgreSQL | GCP SQL Tutorial 2022, in this article we are going to learn Cross database query between Google SQL instances PostgreSQL.

Script used in demo:

create database sales_asia
create database sales_europe
create table public.AsiaSale(id int, name varchar(100), region varchar(100))
insert into public.AsiaSale values(1,'aamir','Asia')
Select * From public.AsiaSale create table public.EuropeSale(id int, name varchar(100), region varchar(100))
insert into public.EuropeSale values(2,'lisa','Europe')
Select * From public.europesale -- we want to execute union query in sales_asia database that should get data from sales_europe.public.EuropeSale table.
Select * From public.europesale
union all
select * from public.AsiaSale 1) Set up a Foreign User-- Do this on DB from which you would like to read the tables
CREATE USER fdwuser WITH PASSWORD 'test123$';
GRANT USAGE ON SCHEMA PUBLIC TO fdwuser;
GRANT SELECT ON europesale TO fdwuser; --Check the list of Tables
select * from information_schema.tables where table_name like '%sale%' 2) Create the Extension
CREATE EXTENSION postgres_fdw;
select * from pg_extension; 3) Create the Foreign Server
CREATE SERVER secondrydb_srv FOREIGN DATA WRAPPER postgres_fdw OPTIONS (host '34.67.244.181', port '5432', dbname 'sales_europe');
Select * From pg_foreign_server; 4) Create User Mapping
CREATE USER MAPPING FOR postgres SERVER secondrydb_srv OPTIONS(user 'fdwuser',password 'test123$');
Select * From pg_user_mappings 5) Grant the Local User Access to the Foreign Data Wrapper
GRANT USAGE ON FOREIGN SERVER secondrydb_srv TO postgres; 6) Import the Foreign Schema or Tables
IMPORT FOREIGN SCHEMA public LIMIT TO (europesale) FROM SERVER secondrydb_srv INTO public; Select * From public.europesale
union all
select * from public.AsiaSale


Video Demo: Cross database query between Google SQL instances PostgreSQL


15 comments:

  1. We will always be grateful to you and will share your hard-written article with our friends too. https://www.ayushibosus.com/ | Mumbai

    ReplyDelete
  2. 🖍🖍🖍🖍🖍🖍🖍🖍🖍🖍🖍🖍🖍🖍🖍🖍🖍🖍🖍🖍🖍🖍🖍🖍🖍🖍🖍🖍🖍🖍
    I and my household have been blessed through an Expert Forex trader Mr Mark Toray who I came across while searching for top Bitcoin entrepreneurs. He traded for me and also gave me lessons on how to trade with his Forex/Binary trading company where I earned $10,500 in just 7 days, you also want to be bill free? Do well and reach out to him via his Email: Marktoray8@gmail.com, Telegram: @Mark4toray_fx

    ReplyDelete
  3. Fullz with CC Info (USA, UK, CAN)
    USA FULLZ (SSN DOB DL) & HIGH CREDIT SCORES FULLZ
    Track 101 & 202 Dumps With Pin Codes
    EIN Business Fullz
    PayPal/Office365 Logins
    USA/Canada Photo I.D's/Passports
    Bank Logins

    Here you can DM me Guy's
    IcQ - 752822040
    TG/icq - @killhacks
    Wickr/Skype - peeterhacks

    Contact with full potential
    Many More stuff will be provided on demand
    Will Serve you with Loyalty
    Here we are for you 24by7

    (Te.legram) (@leadsupplier)
    (I/C/Q) (752.822.040)

    ::GADGETS LIST::

    SMTP's/Web-Mailers/PHP-mailers/Alexus-Mailer
    C-panel/RDP's
    S-hells/Bru-tes/Dorks
    Spa-mming To-ols with Guides/Tutorials (package available also)
    PC/Mob/Web/Server Ha-cking Stuff on demand
    Credit/Debit Cards Tuts for Transfers, Cashouts, CC To BTC
    Car-ding (Amazon, PayPal, E-bay, BTC, etc) Updated Tuts
    Flasher/Cracker for Bit.Co*n
    2021 OR 2022 Fr**D B**le
    I.p's & Pro.xies
    Bulk (Netflix/Amazon/Spotify/Coinbase) Acount Logs
    W.eb L-inks D*R* DE*p Updated
    Web Complete Course for D**P & D**K with Video Tuts
    Scri-pting for Sca-m Pages
    Master Class Complete Kal-i Li-nux
    Vi-ruses for Attac-king & Sp-ying
    Senders (Email, SMS, Codes)

    ReplyDelete
  4. How do I get money back from Scammers? Reach out Recovery Masters.

    I must give special thanks to Recovery Masters,Specialised hackers in Cryptocurrency Recovery  and lost Bitcoin wallet tracing,My wife and I happened to be scammed by an online scammer who claimed to be professional and knowledgeable in the field investments.I and my wife had agreed to invest our savings pounds worth $623,400 in form of Crypto. This scammer persuaded us to invest in an online platform called Cryptos-seed.com.''I was persuaded to deposit the funds to platform that would generate us much profits on a daily basis.The profits generated significantly,but on asking on how my withdrawal of the funds,the swindler provided multiple excuses and was asking me to invest more funds.On search on how to recover The lost funds I came through Recovery Masters who were able to recover a significant portion of the lost funds.Contact them through; Mail Recoverymasters@email.cz                         Whatspp; 1(204){ 819}-{5505}

    ReplyDelete
  5. Victim of a BTC Scam? Contact Ultimate Hacker Jerry to recover your Lost Bitcoin.

    Have you ever been a victim of a scam? or have you Suffered a loss from a Fraudulent Ponzi Scheme? I implore you to Contact Ultimate Hacker Jerry, A Certified hacker and Lost Crypto Recovery Expert. I once fell victim to an online imposter who convinced me to invest in a phoney Cryptocurrency scheme by claiming to have made large profits from the plan. My Trezor wallet contained $219,100 in Crypto that I lost, I had been reporting to the Authorities tirelessly for a longtime without getting assistance before I finally got in touch with Ultimate Hacker Jerry. Fortunately after a serious conversation with Ultimate Hacker Jerry all my funds were recovered back.
    I recommend this Expert to any victim who has lost Crypto to any fake online Ponzi Scheme..

    Get in touch with ULTIMATE HACKER JERRY
    Through ; Mail (Ultimatehackerjerry@seznam. cz)
    WhatsAp, (+1,5/20,2827,15,1)

    ReplyDelete
  6. ASSET RECLAIM IS POSSIBLE WITH THE RIGHT FIRM:
    There is a glimmer of hope through ICC RECOVERY SERVICE, and I am voluntarily publishing this review so that others can lean on ICC RECOVERY. In the world of online trading, propelled by promises of financial independence and opportunity, lies a harrowing journey. I was caught in a web of fraud and disillusionment when the investment platform mediating my trades betrayed my trust. My quest for justice led me down a path filled with stories and bitter testimonials - negative reviews that painted a grim picture of fraud and exploitation by similar online trading platforms. In my search for redress, I came across ICC RECOVERY SERVICE on Yelp. Guided by reviews and recommendations from other victims, I turned to ICC - a beacon of hope in my murky waters of cybercrime and financial fraud. ICC RECOVERY SERVICE quickly became my ally in my fight for justice, offering not only technical expertise but also an unwavering commitment to reclaiming what was rightfully mine. Although the road to redress was riddled with obstacles, ICC's team of specialists were able to meticulously trace my assets to multiple digital wallets. Their professionalism and dedication offered me a semblance of comfort in the midst of my chaos, reassuring me that redress was within reach, and I would get my assets back, which was the case after 3 business days. For timely recovery of lost passwords and seed phrases, hacked wallets and lost funds with fake financial brokers, chatting with ICC RECOVERY SERVICE is the right solution. I highly recommend ICC as a recovery company.
    Contact addresses:
    Email: (ironcladcyber@techie.com)
    W/App: (+1-(623)- (688) -(6815)
    Email:(Ironcladcyberrecovery@gmail.com)

    ReplyDelete
  7. Losing one's Bitcoin investment can be a devastating experience, leaving individuals feeling powerless and resigned to their misfortune. However, the story of Unlost: How Brunoe's Quick Hack Restored My Bitcoin Investment offers a glimmer of hope in the face of such adversity. This gripping account delves into the harrowing journey of a Bitcoin investor who, through a seemingly inexplicable series of events, found themselves bereft of their hard-earned digital currency. Yet, rather than succumbing to despair, this individual discovered Brunoe Quick Hack, a cybersecurity expert with a remarkable talent for recovering lost or stolen Bitcoin. With a keen understanding of the blockchain's inner workings and a dogged determination, Brunoe Quick Hack embarked on a race against time, employing a series of strategic maneuvers to trace the missing funds and ultimately restore the investor's portfolio. The narrative paints a vivid picture of the high-stakes drama that unfolded, as the investor anxiously watched Brunoe Quick Hack every move, oscillating between cautious optimism and the ever-present fear of a permanent loss. Ultimately, the story culminates in a triumphant moment, as Brunoe Quick Hack – a testament to their technological prowess – not only recovers the lost Bitcoin but also reignites the investor's faith in the resilience of the cryptocurrency ecosystem. This captivating tale serves as a powerful reminder that even in the face of seemingly insurmountable challenges, there are individuals and solutions available to help navigate the complexities of the digital finance landscape and reclaim what was once thought to be lost. Contact these genius Brunoe Quick Hack via; and thank me later.
    Website; brunoequickhack.COM
    Whatsapp: 1-705 7842- 635
    Gmail; Brunoequickhack AT GMAIL DOT COM


    Regards,
    Swanta.

    ReplyDelete
  8. Teaming up with Asset Rescue Specialist turned out to be one of the most critical decisions I could have made in the aftermath of falling victim to a sophisticated financial scam. When I first discovered that my investment and broker were fraudulent, the situation felt insurmountable. I had lost an astonishing $2.2 million to scammers who created convincing financial comparison websites and fraudulent investment platforms. The scale of the deception left me feeling financially ruined and emotionally devastated. However, collaborating with Asset Rescue Specialists proved to be a game-changer. Their approach to fraud detection and recovery was both proactive and effective. They employed advanced fraud detection techniques that allowed me to respond quickly and begin mitigating the damage caused by these criminals. Asset Rescue Specialist expertise in fraud compliance and security provided me with a unified strategy to address the situation comprehensively. From the outset, Asset Rescue Specialist demonstrated an exceptional level of domain expertise and security intelligence. They were able to analyze the scam with remarkable precision, identifying the fraudulent activities and tracing the stolen assets. Their state-of-the-art analytics and in-depth understanding of financial fraud were instrumental in the recovery process. It became evident that Asset Rescue Specialist was uniquely equipped to offer an essential layer of protection and asset recovery that was unmatched by other services. The fraudulent scheme had been elaborate and convincing, involving the creation of seemingly legitimate financial comparison websites and advertisements for bogus investments. This complexity made it difficult to discern the fraud until it was too late. Asset Rescue Specialist ability to navigate through this intricate web of deceit and recover my lost assets was a testament to its advanced analytical capabilities and dedicated approach. After recovering my presumed lost assets, I realized that Asset Rescue Specialist comprehensive security solutions were crucial for preventing similar issues in the future. Their team provided robust digital safety assessments and practical advice on protecting oneself from financial fraud. Their assistance was not limited to asset recovery alone; it extended to offering guidance on how to safeguard against potential threats and improve financial security. If you find yourself in a situation where you have lost money due to fraudulent investments or negligence by a stockbroker or financial advisor, I highly recommend reaching out to an Asset Rescue Specialist. They offer a range of recovery options tailored to the nature of the fraud involved. Their professional team is dedicated to working tirelessly until every penny of your lost assets is recovered. Asset Rescue Specialist commitment to its clients is evident in its thorough and relentless approach to resolving financial fraud cases. They understand the profound impact of such scams and are prepared to leverage their expertise and resources to achieve the best possible outcomes for their clients. The Asset Rescue Specialist was pivotal in my journey from financial devastation to recovery. Their advanced fraud detection, exceptional security solutions, and unwavering dedication were crucial in outsmarting the criminals and reclaiming my assets. Anyone who has suffered financial losses due to fraud should contact Asset Rescue Specialist. Their professional team, backed by the world’s best analytics, is ready to assist you in recovering what you’ve lost and ensuring your financial safety. Get an assessment from certified professionals and take the first step towards reclaiming your financial well-being. Asset Rescue Specialists can help turn your recovery journey into a successful outcome. write an email to (assetrescuespecialist@quality service. com) or (support@assetrescuespecialist . com)

    ReplyDelete
  9. Being naturally sceptical, I never thought that money lost to con artists and their Ponzi schemes could really be found and recovered. I cried out to the Capitalix organisation to stick to our original conditions and give me my money back, but they refused. They like to claim that I have to pay a fee each time I try to withdraw my money, but I believe it's just a ruse to keep me from getting the money they want by telling me new lies and taking advantage of my desperation until they wear me out. Things moved quickly as soon as I involved WIZARD JAMES RECOVERY. Compared to what I experienced when I attempted to handle the Capitalix group on my own, it was like night and day. Engage the experts; the risk is worthwhile. These are the greatest dudes ever. It is impossible for you to fight fraudulent investment cases like this because of our lack of expertise in this field. Even if you are correct, if you refuse to pay, they will hang your assets and destroy your financial future. Furthermore, nobody is interested in "why" it was ruined—they only want to hear your tale and then point the finger at you for making an effort to change your life. What then do you do? The irony is in the fact that you continue to provide money to the scammers even if you don't agree with the accusations in order for them to release your money—you never get compensated, you just end up ruining yourself further. After battling this problem for over a year, I finally told myself the truth—that I had been duped—and reported my case to WIZARD JAMES RECOVERY in hopes that they would step in and assist me in regaining possession of my belongings before it was too late. My money moved from being pending to being available in my Coinbase wallet in less than 72 hours after the recovery process was started and quickly completed. Total turnaround. Wizard James rectified in 72 hours what took me a year of work and still had no resolution. I've been beating myself up for not asking for assistance sooner, but I just didn't think it was possible. However they did. Reach out to them today on any of their available support channels to get help,
    EMAIL ADDRESS: WIZARDJAMESRECOVERY @ USA . COM
    WHATSAPP: (+44) (7418) (367204)
    WEBPAGE: htt ps : // ww w. wizardjamesrecovery . com

    ReplyDelete
  10. Early in March, I was introduced to WIZARD JAMES RECOVERY by Mrs. Bradwil. We met at a very low time for me. I was surviving a loss of $470,000 worth of BTC. I felt like I was going to lose everything every day because I had sold my shares to get this money, only to have it all stolen. After she lost access to her wallet, she suggested this guy: wizardjamesrecovery(@)usa(.)com. He had assisted her in recovering her wallet password. I knew I had made the proper decision as soon as I reached out to this Wizard. I received a response right away. My funds were totally deposited into my account in less than 4 days. I owe this Wizard so much. He is beyond measure knowledgeable. Please go find him if you find yourself in a similar circumstance.

    ReplyDelete
  11. It can be quite difficult to navigate the aftermath of a large financial loss. My name is Kai Jackson, and I was recently put in a difficult situation when my girlfriend tried to access my bitcoin wallet without authorization. She even tried to delete the wallet and change the PIN in a desperate attempt to lock me out. Luckily, I had predicted her moves and had changed the PIN in time to prevent her from taking the $510,000 worth of Bitcoin assets that were kept inside. I was so scared and exposed that I went to WIZARD JAMES RECOVERY, a friend's recommendation, for help. From the beginning, their group offered outstanding assistance and confidence. They listened to my narrative with sympathetic ears and promised me that they have the know-how to get my money back. The experts at WIZARD JAMES RECOVERY started a thorough investigation and painstakingly tracked down the attempt at unauthorised entry and the wallet's subsequent erasure. They were desperate to recover what was properly mine, and their technological prowess was on display as they dug deep into the intricacies of digital transactions. In just a few weeks, they recovered the complete wallet in an amazing feat of expertise and perseverance. There was an unbelievable wave of relief and gratitude that passed over me.
    Furthermore, WIZARD JAMES RECOVERY gave me priceless advice on bolstering my digital assets' security to stave off future intrusions. Their steadfast dedication to their work and their kind assistance were sorely needed during this difficult period. What should have been a disastrous event was turned into a story of resiliency and healing by them. I highly recommend their services to anyone facing comparable difficulties. They are the real protectors of online safety, able to guide you through difficulties and help you come out stronger on the other side.
    Email: WIZARDJAMESRECOVERY@USA.COM

    ReplyDelete
  12. Wizard James Recovery can help if you're looking for a reliable hacker and want to avoid falling victim to scammers who steal money. As an Australian hacker, he specialises in handling various cyber-related issues and has experience with hacking websites, Facebook, Gmail, WhatsApp, mobile phones, accounts, erasing criminal records, bitcoin trading, and other related issues. Wizard James Recovery can be reached by email at wizardjamesrecovery(@)usa(dot)com or by visiting their web page for more info. Don’t forget to say Anslem Allen Ponce Recommended you. Note this is not free.

    ReplyDelete
  13. 随着全球化的不断深入,留学热潮也日益高涨。然而,随之而来的学业压力和时间紧迫使得许多留学生在完成学业的过程中遇到了困扰。尤其是在当前全球疫情的冲击下,许多留学生被迫放弃了原本计划的线下学习,转而选择线上学习。为了解决这一问题,留学生网课代修http://www.meeloun.com/wangkedaixiu/平台应运而生,为广大留学生提供了一条便捷高效的解决方案。

    ReplyDelete
  14. 除了学历和专业背景,写手是否拥有丰富的写作经验也直接影响到论文质量。一个有经验的写手通常能够熟练掌握学术写作的格式和风格,如APA、MLA、Harvard等不同的引用格式。他们还具备对论文结构、逻辑性和论证方法的理解,从而确保论文内容连贯、论证严密。此外,有经验的写手在应对不同类型的论文时,例如研究报告、文学评论、数据分析等,也能够灵活自如。因此,在选择代写http://www.emwchinese.com/机构时,客户应了解写手的写作经历,最好能够查看他们过去的论文样本或成功案例,这样可以更直观地判断其写作水平。

    ReplyDelete