TYPEOF() vs PG_TYPEOF() in DuckDB: What’s the Difference?

You may be aware that DuckDB includes a typeof() function that works just like the SQLite equivalent; it returns the data type of its argument. But did you know that DuckDB also provides us with a pg_typeof() function that does essentially the same thing?

So why would DuckDB need a pg_typeof() function that does basically the same thing as typeof()? Let’s find out!

Continue reading

Using LIST_RESIZE() to Resize a List in DuckDB

DuckDB provides us with a list_resize() function for those occasions where we need to resize a list. It also offers an alias called array_resize() that does exactly the same thing. When we resize a list using these functions, we specify how big we want the resulting list to be, and we can also specify a value to use for any extra elements that are added to the list.

Continue reading