TYPE type_name IS TABLE OF NUMBER INDEX BY VARCHAR2(64) from Oracle in PostgreSQL
Is there an equivalent type declaration in PostgreSQL to this one in Oracle:
开发者_如何学PythonTYPE type_name IS TABLE OF OBJECT
I have a type:
CREATE TYPE t_pick AS
(
bet_no integer,
result smallint
);
And now I want to create table using this type. In Oracle I did this with a declaration like above. But how to do this in PostgreSQL?
Or is there another way?You cannot define array types or collection types in PostgreSQL.
But you can create a composite type and then use it in an array:
CREATE TYPE t_pick AS ( bet_no integer; result smallint; ); CREATE OR REPLACE FUNCTION foo .. DECLARE var t_pick[]; BEGIN ...
精彩评论