Quantcast
Channel: Use array of composite type as function parameter and access it - Database Administrators Stack Exchange
Browsing all 3 articles
Browse latest View live

Answer by Erwin Brandstetter for Use array of composite type as function...

I answered a similar question on SO some time ago, to suggest the same solution with unnest() like @a_horse did:Array of composite type as stored procedure inputIf books_table has the same row type as...

View Article



Answer by a_horse_with_no_name for Use array of composite type as function...

To create an array of a type, use an explicit array constructor:array[(1,100,'Arthur',1), (1,50,'Zaphod',1)]::books[]So to call your function you would need to use:select...

View Article

Use array of composite type as function parameter and access it

I have created a type Books in Postgres which has 2 numeric fields and 2 varchar fields. I want to send an array of Books to a function to INSERT those values in a matching table.This is my type:CREATE...

View Article
Browsing all 3 articles
Browse latest View live




Latest Images