User-defined types

Поиск
Список
Период
Сортировка
От Jonathan Daugherty
Тема User-defined types
Дата
Msg-id 20041117183016.GA32204@vulcan.cprogrammer.org
обсуждение исходный текст
Ответы Re: User-defined types  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Hello,

I'm trying to write a PL/PgSQL function whose sole parameter is an
array whose element type is a type that I've created.  For example:

  CREATE TYPE test_type AS (x bigint, y bigint);

  CREATE OR REPLACE FUNCTION array_test (test_type[]) ...

According to the 7.4 docs,

 "Whenever a user-defined base data type is created, PostgreSQL
 automatically creates an associated array type, whose name consists
 of the base type's name prepended with an underscore. The parser
 understands this naming convention, and translates requests for
 columns of type foo[] into requests for type _foo. The
 implicitly-created array type is variable length and uses the
 built-in input and output functions array_in and array_out."

However,

mydb=# SELECT COUNT(*) FROM pg_type WHERE typname = '_test_type';
 count
-------
     0
(1 row)

Am I missing something?  Thanks for your time.

I'm running PostgreSQL 7.4.5.

--
  Jonathan Daugherty
  Command Prompt, Inc. - http://www.commandprompt.com/
  PostgreSQL Replication & Support Services, (503) 667-4564


В списке pgsql-general по дате отправления:

Предыдущее
От: Robert Fitzpatrick
Дата:
Сообщение: Re: Rules WHERE condition
Следующее
От: Tom Lane
Дата:
Сообщение: Re: User-defined types