A few questions (was: SQL-Query 2 get primary key)

Started by Hannu Krosingabout 27 years ago1 messageshackers
Jump to latest
#1Hannu Krosing
hannu@tm.ee

"D'Arcy J.M. Cain" wrote:

Can someone suggest a
SELECT statement the would return something like this for this table?

relname|attname
-------+-------
y |id1,id2

Fist:

I have been wanting to write aggregate functions SET() and MULTISET()
that produce an array of base type like SUM() produces a single value.

But AFAIK the C function interface is not capable of returning it ?

I hope I have misread something.

BTW is there any possibility do define (in system tables) a function
that returns an array of its argument type ?

I know that currently COUNT() is defined to return int and take any
type, but it would be terribly nice to have a mechanism that makes
the above possible.

Or even this.

relname|attname
-------+-------
y |id1
y |id2

Of course, best would be a new command to give this list. Perhaps it can
be added to the pg_indexes table. Heck, creation time would be a perfect
time to store it.

Second:

Is there a (prefgerrably single) spot where I could place a trigger
that can
store the source for a CREATE statement?

I know that Oracle stores all DDL source (sometimes in one big text
field,
sometimes each row in its own record), and uses it in recompiling
stuff.

As it is not currently the case with PostgreSQL, it would be nice to do
it
using some existing mechanism.

And finally :

what is the state of ALTER TABLE statements for
adding/[dis|en]abling/dropping constraints ?

Will it be in 6.5 ?

Or will the only way to make a column nullable defining a new column ?

------------------------
Hannu