postgresql - How to declare a record on a user-defined type in postgres -


i have snippet of code in oracle, creating variable of record type

  type t_article record (article_id sch.article.article_id%type,                             short_article_title sch.article.short_article_title%type,                             short_article_text  sch.article.short_article_text%type,                             pub_ts sch.article.pub_ts%type,                             paren_info varchar2(500),                             article_date        sch.article.article_date%type);         v_article_rec       t_article; 

how can declare above code create user defined record in postgres?

i tried using below code in postgres,

type  v_article_rec (article_id sch.article.article_id%type,                         short_article_title sch.article.short_article_title%type,                         short_article_text  sch.article.short_article_text%type,                         pub_ts sch.article.pub_ts%type,                         paren_info varchar2(500),                         article_date sch.article.article_date%type); 

but getting syntax error. kindly help.

in postgres can declare record name record

record variables similar row-type variables, have no predefined structure. take on actual row structure of row assigned during select or command

documentation


Comments

Popular posts from this blog

What is happening when Matlab is starting a "parallel pool"? -

php - Cannot override Laravel Spark authentication with own implementation -

Qt QGraphicsScene is not accessable from QGraphicsView (on Qt 5.6.1) -