You can check out more examples of upserts in the YugabyteDB documentation. INSERT INTO sample(id, c1, c2)ĭO UPDATE SET (c1, c2) = (EXCLUDED.c1, EXCLUDED.c2) Likewise, ROWID is a pseudocolumn that returns the address of the row. ROWNUM is a pseudocolumn which indicates the row number in a result set retrieved by a SQL query. YugabyteDB can perform string concatenation just like PostgreSQL. To achieve the same Oracle functionality in PostgreSQL, we’ll need to use the concat function: SELECT concat('Concat with ', NULL) String Concatenation Oracle 'Concat with ' || NULL YugabyteDB doesn’t have a DUAL table either, but supports the same functionality as PostgreSQL. The DUAL table doesn’t exist in PostgreSQL, but you can achieve similar results by excluding the FROM clause. Oracle ships with a table called DUAL which can be thought of as a dummy table with a single record that can be used for selecting when you’re not actually interested in the data, but instead want the results of some system function in a SELECT statement. If you’d like to follow along and test the exercises against YugabyteDB, you can either install a cluster locally or sign up for a free cluster of YugabyteDB Managed. Yugabyte’s SQL API (YSQL) is PostgreSQL wire compatible. What’s YugabyteDB? It is an open source, high-performance distributed SQL database built on a scalable and fault-tolerant design inspired by Google Spanner. In this post I’ll walk you through each of the features from Roland’s post so we can see how YugabyteDB stacks up on the “PostgreSQL compatibility” vector. YugabyteDB supports more SQL features than any other distributed SQL database, including CockroachDB. Seeing that YugabyteDB is a PostgreSQL-compatible, distributed SQL database (in fact it reuses PostgreSQL’s native query layer), I thought it would be an interesting exercise to verify which of the “Oracle functional equivalents” in PostgreSQL that Roland highlighted would also work in YugabyteDB. In his post, Roland walked us through 15 different Oracle features and their PostgreSQL equivalents. As such, Roland thought it might be a good exercise to document the various Oracle features he was accustomed to and figure out what the equivalent functionality was in PostgreSQL. The genesis for his blog post was that he was in the middle of migrating his current Oracle tech stack to Python, parquet files, and PostgreSQL. Roland Takacs recently wrote an interesting blog post titled Oracle vs PostgreSQL: First Glance.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |