Skip to content
Advertisement

Function as parameter to another function in Postgres

Can I create a user defined function in Postgres either through the C-Language Function API or by using pl/pgsql which accepts a callback function as parameter? As far as I see there is no way to do this through the C-Language API since it only accepts sql datatypes and there is no datatype for function. But maybe I’m missing something?

Superkey, candidate key & primary key

Can any kind soul clarify my doubts with a simple example below and identify the superkey, candidate key and primary key? I know there are a lot of posts and websites out there explaining the differences between them. But it looks like all are generic definitions. Example: So from the above example, I can know StudentNumber is a primary key.

Oracle Count even if nothing is there

So i have this query: It will return stuff from place and then d is another table describes. It will get the number of reviews the place has and the average rating. This works perfectly fine as long as there is something in the describes table. How can i go about getting the stuff that does not have anything in

Create unique constraint with null columns

I have a table with this layout: CREATE TABLE Favorites ( FavoriteId uuid NOT NULL PRIMARY KEY, UserId uuid NOT NULL, RecipeId uuid NOT NULL, MenuId uuid ) I want to create a unique …

Show MySQL host via SQL Command

Show Database Use database show tables Describe

All good and well, but is it possible to show the current connections host. Not connection_id, but the IP Address or Name of the host.

SQL. Average entries per month

I have some abstract entry in DB and it’s creation date. How can I get average entries created per month? Edit: Table has Name field and CreationDate field.

Advertisement